@pat-lewczuk/cezar 0.1.2 → 0.1.4

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 (164) hide show
  1. package/README.md +249 -45
  2. package/dist/config.d.ts +8 -0
  3. package/dist/config.js +6 -0
  4. package/dist/config.js.map +1 -1
  5. package/dist/core/agent-runner.d.ts +44 -2
  6. package/dist/core/agent-runner.js +8 -2
  7. package/dist/core/agent-runner.js.map +1 -1
  8. package/dist/core/backend-detect.d.ts +6 -4
  9. package/dist/core/backend-detect.js +44 -4
  10. package/dist/core/backend-detect.js.map +1 -1
  11. package/dist/core/claude-cli-runner.d.ts +3 -25
  12. package/dist/core/claude-cli-runner.js +2 -19
  13. package/dist/core/claude-cli-runner.js.map +1 -1
  14. package/dist/core/claude-ui-mapper.d.ts +57 -0
  15. package/dist/core/claude-ui-mapper.js +370 -0
  16. package/dist/core/claude-ui-mapper.js.map +1 -0
  17. package/dist/core/codex-app-server-runner.d.ts +29 -0
  18. package/dist/core/codex-app-server-runner.js +452 -0
  19. package/dist/core/codex-app-server-runner.js.map +1 -0
  20. package/dist/core/codex-ui-mapper.d.ts +53 -0
  21. package/dist/core/codex-ui-mapper.js +411 -0
  22. package/dist/core/codex-ui-mapper.js.map +1 -0
  23. package/dist/core/ndjson.d.ts +6 -0
  24. package/dist/core/ndjson.js +23 -0
  25. package/dist/core/ndjson.js.map +1 -0
  26. package/dist/core/opencode-server-runner.d.ts +30 -0
  27. package/dist/core/opencode-server-runner.js +451 -0
  28. package/dist/core/opencode-server-runner.js.map +1 -0
  29. package/dist/core/opencode-ui-mapper.d.ts +105 -0
  30. package/dist/core/opencode-ui-mapper.js +578 -0
  31. package/dist/core/opencode-ui-mapper.js.map +1 -0
  32. package/dist/core/process-usage.d.ts +63 -0
  33. package/dist/core/process-usage.js +181 -0
  34. package/dist/core/process-usage.js.map +1 -0
  35. package/dist/core/runner-factory.d.ts +8 -0
  36. package/dist/core/runner-factory.js +22 -0
  37. package/dist/core/runner-factory.js.map +1 -0
  38. package/dist/core/tool-display.d.ts +27 -0
  39. package/dist/core/tool-display.js +150 -0
  40. package/dist/core/tool-display.js.map +1 -0
  41. package/dist/core/ui-events.d.ts +294 -0
  42. package/dist/core/ui-events.js +25 -0
  43. package/dist/core/ui-events.js.map +1 -0
  44. package/dist/index.js +0 -0
  45. package/dist/pack-check.d.ts +17 -0
  46. package/dist/pack-check.js +27 -0
  47. package/dist/pack-check.js.map +1 -0
  48. package/dist/planner.js +7 -3
  49. package/dist/planner.js.map +1 -1
  50. package/dist/runs/store.d.ts +5 -0
  51. package/dist/runs/store.js +3 -0
  52. package/dist/runs/store.js.map +1 -1
  53. package/dist/runs/title-summary.d.ts +15 -0
  54. package/dist/runs/title-summary.js +84 -0
  55. package/dist/runs/title-summary.js.map +1 -0
  56. package/dist/runs/ui-event-sink.d.ts +81 -0
  57. package/dist/runs/ui-event-sink.js +210 -0
  58. package/dist/runs/ui-event-sink.js.map +1 -0
  59. package/dist/server/capabilities.d.ts +18 -0
  60. package/dist/server/capabilities.js +23 -0
  61. package/dist/server/capabilities.js.map +1 -0
  62. package/dist/server/forge/github.d.ts +39 -0
  63. package/dist/server/forge/github.js +369 -0
  64. package/dist/server/forge/github.js.map +1 -0
  65. package/dist/server/forge/index.d.ts +24 -0
  66. package/dist/server/forge/index.js +45 -0
  67. package/dist/server/forge/index.js.map +1 -0
  68. package/dist/server/forge/types.d.ts +80 -0
  69. package/dist/server/forge/types.js +2 -0
  70. package/dist/server/forge/types.js.map +1 -0
  71. package/dist/server/git-changes.d.ts +182 -0
  72. package/dist/server/git-changes.js +424 -0
  73. package/dist/server/git-changes.js.map +1 -0
  74. package/dist/server/open-in-app.d.ts +19 -0
  75. package/dist/server/open-in-app.js +134 -0
  76. package/dist/server/open-in-app.js.map +1 -0
  77. package/dist/server/server.js +34 -10
  78. package/dist/server/server.js.map +1 -1
  79. package/dist/server/static-ui.d.ts +49 -0
  80. package/dist/server/static-ui.js +92 -0
  81. package/dist/server/static-ui.js.map +1 -0
  82. package/dist/update-check.d.ts +12 -0
  83. package/dist/update-check.js +41 -0
  84. package/dist/update-check.js.map +1 -0
  85. package/dist/workflows/run.d.ts +3 -0
  86. package/dist/workflows/run.js +22 -7
  87. package/dist/workflows/run.js.map +1 -1
  88. package/dist/workflows/types.d.ts +16 -0
  89. package/dist/workflows/types.js +3 -1
  90. package/dist/workflows/types.js.map +1 -1
  91. package/package.json +1 -1
  92. package/web/app/node_modules/.vite/vitest/ca84d1343b96baa8137c943ed1860e522cacb238/results.json +1 -0
  93. package/web/app/src/components/app-shell-container.tsx +76 -0
  94. package/web/app.js +145 -18
  95. package/web/dist/assets/arrow-left-BE957rJs.js +1 -0
  96. package/web/dist/assets/bundle-mjs-DLPpRFyl.js +1 -0
  97. package/web/dist/assets/chunk-BO2N2NFS-f5igTtpB.js +131 -0
  98. package/web/dist/assets/compare-variants-D6fPL9cS.js +1 -0
  99. package/web/dist/assets/core-BuMqAF_1.js +12 -0
  100. package/web/dist/assets/css-BsVw1vtW.js +1 -0
  101. package/web/dist/assets/dialog-BEgEWFDS.js +1 -0
  102. package/web/dist/assets/diff-view-CctnJHWe.js +4 -0
  103. package/web/dist/assets/diff-woXpYk--.js +1 -0
  104. package/web/dist/assets/dist-CW7M_Jhs.js +1 -0
  105. package/web/dist/assets/ellipsis-vertical-DJPAfccS.js +1 -0
  106. package/web/dist/assets/engine-javascript-FQvzRocB.js +141 -0
  107. package/web/dist/assets/folder-RbRLfIX-.js +1 -0
  108. package/web/dist/assets/git-pull-request-DJkAMT0f.js +1 -0
  109. package/web/dist/assets/git-toolbar-D8OPPqBP.js +1 -0
  110. package/web/dist/assets/github-BYIHwIJB.js +1 -0
  111. package/web/dist/assets/go-rLFTqkRN.js +1 -0
  112. package/web/dist/assets/highlighted-body-OFNGDK62-DGHHie_q.js +1 -0
  113. package/web/dist/assets/highlighter-BKVEsACy.js +3 -0
  114. package/web/dist/assets/html-BY76lXLH.js +1 -0
  115. package/web/dist/assets/index-9qG98Orw.js +11 -0
  116. package/web/dist/assets/index-Bz_r8Jt3.css +2 -0
  117. package/web/dist/assets/input-BRsSo4xH.js +1 -0
  118. package/web/dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  119. package/web/dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  120. package/web/dist/assets/javascript-BgS3c2Ky.js +1 -0
  121. package/web/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  122. package/web/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  123. package/web/dist/assets/json-qhed-kSA.js +1 -0
  124. package/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
  125. package/web/dist/assets/jsx-Bz0zcwM4.js +1 -0
  126. package/web/dist/assets/lib-CNGa3Dig.js +1 -0
  127. package/web/dist/assets/loader-circle-BV3DO9mE.js +1 -0
  128. package/web/dist/assets/markdown-BYOwaDjH.js +1 -0
  129. package/web/dist/assets/markdown-CR_HLGTs.js +1 -0
  130. package/web/dist/assets/mermaid-GHXKKRXX-DM2VsGBG.js +1 -0
  131. package/web/dist/assets/open-mercato-toBr6SOa.svg +11 -0
  132. package/web/dist/assets/python-gzcpVVnB.js +1 -0
  133. package/web/dist/assets/react-dom-Ddtik4qM.js +1 -0
  134. package/web/dist/assets/refresh-cw-DCa-Rlwz.js +1 -0
  135. package/web/dist/assets/repo-git-XTqlVOl2.js +1 -0
  136. package/web/dist/assets/run-diff-C7mfxj7f.js +3 -0
  137. package/web/dist/assets/run-header-CfVeY3uM.js +1 -0
  138. package/web/dist/assets/rust-Cfkwpbl8.js +1 -0
  139. package/web/dist/assets/search-x-CoCyl7zT.js +1 -0
  140. package/web/dist/assets/shellscript-CLZ0U2zV.js +1 -0
  141. package/web/dist/assets/skill-detail-C9cniyId.js +1 -0
  142. package/web/dist/assets/skills-DXgY1uXJ.js +1 -0
  143. package/web/dist/assets/skills-ynuO5oCr.js +1 -0
  144. package/web/dist/assets/sql-BsFa4tDR.js +1 -0
  145. package/web/dist/assets/square-terminal-B6PZX4Qp.js +1 -0
  146. package/web/dist/assets/tab-link-phWEqSBy.js +1 -0
  147. package/web/dist/assets/task-changes-DYwnPnTN.js +1 -0
  148. package/web/dist/assets/task-commits-DZzxEzbn.js +1 -0
  149. package/web/dist/assets/task-files-FOAAz2FB.js +2 -0
  150. package/web/dist/assets/task-thread-Bncxe8Os.js +5 -0
  151. package/web/dist/assets/toaster-BS2E1bhz.js +43 -0
  152. package/web/dist/assets/trash-2-CDtxmmc8.js +1 -0
  153. package/web/dist/assets/triangle-alert-6su4Js5O.js +1 -0
  154. package/web/dist/assets/tsx-udAQXfEw.js +1 -0
  155. package/web/dist/assets/typescript-bsJCZSQ-.js +1 -0
  156. package/web/dist/assets/upload-Bp7hQxll.js +1 -0
  157. package/web/dist/assets/use-desktop-eHm2iTXX.js +3 -0
  158. package/web/dist/assets/utils-rQGbOrwc.js +1 -0
  159. package/web/dist/assets/workflows-Dg2wQg6i.js +11 -0
  160. package/web/dist/assets/x-Br_jIDBw.js +1 -0
  161. package/web/dist/assets/yaml-rwi0_p6S.js +1 -0
  162. package/web/dist/index.html +67 -0
  163. package/web/index.html +1 -0
  164. package/web/style.css +28 -8
@@ -0,0 +1,43 @@
1
+ import{a as e,i as t,l as n,o as r,r as i}from"./bundle-mjs-DLPpRFyl.js";import{t as a}from"./react-dom-Ddtik4qM.js";import{t as o}from"./utils-rQGbOrwc.js";var s=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},c=new class extends s{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},l={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},u=new class{#e=l;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function d(e){setTimeout(e,0)}var f=typeof window>`u`||`Deno`in globalThis;function p(){}function m(e,t){return typeof e==`function`?e(t):e}function h(e){return typeof e==`number`&&e>=0&&e!==1/0}function g(e,t){return Math.max(e+(t||0)-Date.now(),0)}function _(e,t){return typeof e==`function`?e(t):e}function v(e,t){return typeof e==`function`?e(t):e}function y(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==x(o,t.options))return!1}else if(!C(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function b(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(S(t.options.mutationKey)!==S(a))return!1}else if(!C(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function x(e,t){return(t?.queryKeyHashFn||S)(e)}function S(e){return JSON.stringify(e,(e,t)=>te(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function C(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>C(e[n],t[n])):!1}var w=Object.prototype.hasOwnProperty;function T(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ee(e)&&ee(t);if(!r&&!(te(e)&&te(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:w.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=T(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function E(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ee(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function te(e){if(!ne(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ne(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ne(e){return Object.prototype.toString.call(e)===`[object Object]`}function re(e){return new Promise(t=>{u.setTimeout(t,e)})}function ie(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:T(e,t)}function ae(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function oe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var se=Symbol();function ce(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===se?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function le(e,t){return typeof e==`function`?e(...t):!!e}function ue(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var de=(()=>{let e=()=>f;return{isServer(){return e()},setIsServer(t){e=t}}})();function fe(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var pe=d;function me(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=pe,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var D=me(),he=new class extends s{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ge(e){return Math.min(1e3*2**e,3e4)}function _e(e){return(e??`online`)!==`online`||he.isOnline()}var ve=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ye(e){let t=!1,n=0,r,i=fe(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new ve(t);p(n),e.onCancel?.(n)}},s=()=>{t=!0},l=()=>{t=!1},u=()=>c.isFocused()&&(e.networkMode===`always`||he.isOnline())&&e.canRun(),d=()=>_e(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(de.isServer()?0:3),o=e.retryDelay??ge,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),re(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var be=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),h(this.gcTime)&&(this.#e=u.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(de.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(u.clearTimeout(this.#e),this.#e=void 0)}};function xe(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ue(e,()=>t.signal,()=>n=!0)},u=ce(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?oe:ae;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ce:Se,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Se(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Se(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ce(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var we=class extends be{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=De(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=De(this.options);e.data!==void 0&&(this.setState(Ee(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ie(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(p).catch(p):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>v(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===se||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>_(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!g(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ce(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?xe(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=ye({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ve&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ve){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Te(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ee(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),D.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Te(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_e(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ee(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function De(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Oe=class extends s{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=fe(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ae(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return je(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return je(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof v(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!E(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Me(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||v(this.options.enabled,this.#t)!==v(t.enabled,this.#t)||_(this.options.staleTime,this.#t)!==_(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||v(this.options.enabled,this.#t)!==v(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Pe(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(p)),t}#g(){this.#b();let e=_(this.options.staleTime,this.#t);if(de.isServer()||this.#r.isStale||!h(e))return;let t=g(this.#r.dataUpdatedAt,e)+1;this.#d=u.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(de.isServer()||v(this.options.enabled,this.#t)===!1||!h(this.#p)||this.#p===0)&&(this.#f=u.setInterval(()=>{(this.options.refetchIntervalInBackground||c.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(u.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(u.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Ae(e,t),o=i&&Me(e,n,t,r);(a||o)&&(l={...l,...Te(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=ie(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=ie(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,y=m===`error`,b=_&&g,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:Ne(e,t),refetch:this.refetch,promise:this.#o,isEnabled:v(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{let e=this.#o=S.promise=fe();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!E(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){D.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function ke(e,t){return v(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&v(t.retryOnMount,e)===!1)}function Ae(e,t){return ke(e,t)||e.state.data!==void 0&&je(e,t,t.refetchOnMount)}function je(e,t,n){if(v(t.enabled,e)!==!1&&_(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Ne(e,t)}return!1}function Me(e,t,n,r){return(e!==t||v(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ne(e,n)}function Ne(e,t){return v(t.enabled,e)!==!1&&e.isStaleByTime(_(t.staleTime,e))}function Pe(e,t){return!E(e.getCurrentResult(),t)}var Fe=class extends be{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ie(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=ye({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),D.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ie(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Le=class extends s{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),E(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&S(t.mutationKey)!==S(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ie();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){D.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},O=n(r(),1),k=e(),Re=O.createContext(void 0),ze=e=>{let t=O.useContext(Re);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Be=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,k.jsx)(Re.Provider,{value:e,children:t})),Ve=O.createContext(!1),He=()=>O.useContext(Ve);Ve.Provider;function Ue(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var We=O.createContext(Ue()),Ge=()=>O.useContext(We),Ke=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?le(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},qe=e=>{O.useEffect(()=>{e.clearReset()},[e])},Je=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||le(n,[e.error,r])),Ye=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Xe=(e,t)=>e.isLoading&&e.isFetching&&!t,Ze=(e,t)=>e?.suspense&&t.isPending,Qe=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function $e(e,t,n){let r=He(),i=Ge(),a=ze(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Ye(o),Ke(o,i,s),qe(i);let l=!a.getQueryCache().get(o.queryHash),[u]=O.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(O.useSyncExternalStore(O.useCallback(e=>{let t=f?u.subscribe(D.batchCalls(e)):p;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),O.useEffect(()=>{u.setOptions(o)},[o,u]),Ze(o,d))throw Qe(o,u,i);if(Je({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!de.isServer()&&Xe(d,r)&&(l?Qe(o,u,i):s?.promise)?.catch(p).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function A(e,t){return $e(e,Oe,t)}function et(e,t){let n=ze(t),[r]=O.useState(()=>new Le(n,e));O.useEffect(()=>{r.setOptions(e)},[r,e]);let i=O.useSyncExternalStore(O.useCallback(e=>r.subscribe(D.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=O.useCallback((e,t)=>{r.mutate(e,t).catch(p)},[r]);if(i.error&&le(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var tt=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,nt=/^[\\/]{2}/;function rt(e,t){return t+e.replace(/\\/g,`/`)}var it=`popstate`;function at(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function ot(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return lt(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:ut(t)}return dt(t,n,null,e)}function j(e,t){if(e===!1||e==null)throw Error(t)}function M(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function st(){return Math.random().toString(36).substring(2,10)}function ct(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function lt(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?N(t):t,state:n,key:t&&t.key||r||st(),mask:i}}function ut({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function N(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function dt(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=at(e)?e:lt(h.location,e,t);n&&n(r,e),l=u()+1;let d=ct(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=at(e)?e:lt(h.location,e,t);n&&n(r,e),l=u();let i=ct(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ft(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(it,d),c=e,()=>{i.removeEventListener(it,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ft(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),j(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:ut(t);return i=i.replace(/ $/,`%20`),!n&&nt.test(i)&&(i=r+i),new URL(i,r)}function pt(e,t,n=`/`){return mt(e,t,n,!1)}function mt(e,t,n,r,i){let a=P((typeof t==`string`?N(t):t).pathname||`/`,n);if(a==null)return null;let o=i??gt(e),s=null,c=Nt(a);for(let e=0;s==null&&e<o.length;++e)s=kt(o[e],c,r);return s}function ht(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function gt(e){let t=_t(e);return yt(t),t}function _t(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;j(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=F([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(j(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),_t(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Dt(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Mt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of vt(e.path))a(e,t,!0,n)}),t}function vt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=vt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function yt(e){e.sort((e,t)=>e.score===t.score?Ot(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var bt=/^:[\w-]+$/,xt=3,St=2,Ct=1,wt=10,Tt=-2,Et=e=>e===`*`;function Dt(e,t){let n=e.split(`/`),r=n.length;return n.some(Et)&&(r+=Tt),t&&(r+=St),n.filter(e=>!Et(e)).reduce((e,t)=>e+(bt.test(t)?xt:t===``?Ct:wt),r)}function Ot(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function kt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?jt(u,l,s.matcher,s.compiledParams):At(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=At({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:F([a,d.pathname]),pathnameBase:Ht(F([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=F([a,d.pathnameBase]))}return o}function At(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Mt(e.path,e.caseSensitive,e.end);return jt(e,t,n,r)}function jt(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Mt(e,t=!1,n=!0){M(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Nt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return M(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function P(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Pt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?N(e):e,a;return n?(n=Bt(n),a=n.startsWith(`/`)?Ft(n.substring(1),`/`):Ft(n,t)):a=t,{pathname:a,search:Ut(r),hash:Wt(i)}}function Ft(e,t){let n=Vt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function It(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Lt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Rt(e){let t=Lt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function zt(e,t,n,r=!1){let i;typeof e==`string`?i=N(e):(i={...e},j(!i.pathname||!i.pathname.includes(`?`),It(`?`,`pathname`,`search`,i)),j(!i.pathname||!i.pathname.includes(`#`),It(`#`,`pathname`,`hash`,i)),j(!i.search||!i.search.includes(`#`),It(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Pt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Bt=e=>e.replace(/[\\/]{2,}/g,`/`),F=e=>Bt(e.join(`/`)),Vt=e=>e.replace(/\/+$/,``),Ht=e=>Vt(e).replace(/^\/*/,`/`),Ut=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Wt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Gt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Kt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function qt(e){return F(e.map(e=>e.route.path).filter(Boolean))||`/`}var Jt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Yt(e,t){let n=e;if(typeof n!=`string`||!tt.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Jt)try{let e=new URL(window.location.href),r=nt.test(n)?new URL(rt(n,e.protocol)):new URL(n),a=P(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{M(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Xt=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Xt);var Zt=[`GET`,...Xt];new Set(Zt);var Qt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function $t(e){try{return Qt.includes(new URL(e).protocol)}catch{return!1}}var I=O.createContext(null);I.displayName=`DataRouter`;var L=O.createContext(null);L.displayName=`DataRouterState`;var en=O.createContext(!1);function tn(){return O.useContext(en)}var nn=O.createContext({isTransitioning:!1});nn.displayName=`ViewTransition`;var rn=O.createContext(new Map);rn.displayName=`Fetchers`;var an=O.createContext(null);an.displayName=`Await`;var R=O.createContext(null);R.displayName=`Navigation`;var z=O.createContext(null);z.displayName=`Location`;var B=O.createContext({outlet:null,matches:[],isDataRoute:!1});B.displayName=`Route`;var on=O.createContext(null);on.displayName=`RouteError`;var sn=`REACT_ROUTER_ERROR`,cn=`REDIRECT`,ln=`ROUTE_ERROR_RESPONSE`;function un(e){if(e.startsWith(`${sn}:${cn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function dn(e){if(e.startsWith(`${sn}:${ln}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Gt(t.status,t.statusText,t.data)}catch{}}function fn(e,{relative:t}={}){j(V(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=O.useContext(R),{hash:i,pathname:a,search:o}=yn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:F([n,a])),r.createHref({pathname:s,search:o,hash:i})}function V(){return O.useContext(z)!=null}function H(){return j(V(),`useLocation() may be used only in the context of a <Router> component.`),O.useContext(z).location}function pn(e){j(V(),`useMatch() may be used only in the context of a <Router> component.`);let{pathname:t}=H();return O.useMemo(()=>At(e,Nt(t)),[t,e])}var mn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function hn(e){O.useContext(R).static||O.useLayoutEffect(e)}function gn(){let{isDataRoute:e}=O.useContext(B);return e?Rn():_n()}function _n(){j(V(),`useNavigate() may be used only in the context of a <Router> component.`);let e=O.useContext(I),{basename:t,navigator:n}=O.useContext(R),{matches:r}=O.useContext(B),{pathname:i}=H(),a=JSON.stringify(Rt(r)),o=O.useRef(!1);return hn(()=>{o.current=!0}),O.useCallback((r,s={})=>{if(M(o.current,mn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=zt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:F([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}O.createContext(null);function vn(){let{matches:e}=O.useContext(B);return e[e.length-1]?.params??{}}function yn(e,{relative:t}={}){let{matches:n}=O.useContext(B),{pathname:r}=H(),i=JSON.stringify(Rt(n));return O.useMemo(()=>zt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function bn(e,t){return xn(e,t)}function xn(e,t,n){j(V(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=O.useContext(R),{matches:i}=O.useContext(B),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Bn(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
+
3
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=H(),d;if(t){let e=typeof t==`string`?N(t):t;j(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):pt(e,{pathname:p});M(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),M(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=On(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:F([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:F([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?O.createElement(z.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Sn(){let e=Ln(),t=Kt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=O.createElement(O.Fragment,null,O.createElement(`p`,null,`💿 Hey developer 👋`),O.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,O.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,O.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),O.createElement(O.Fragment,null,O.createElement(`h2`,null,`Unexpected Application Error!`),O.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?O.createElement(`pre`,{style:i},n):null,o)}var Cn=O.createElement(Sn,null),wn=class extends O.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=dn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:O.createElement(B.Provider,{value:this.props.routeContext},O.createElement(on.Provider,{value:e,children:this.props.component}));return this.context?O.createElement(En,{error:e},t):t}};wn.contextType=en;var Tn=new WeakMap;function En({children:e,error:t}){let{basename:n}=O.useContext(R);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=un(t.digest);if(e){let r=Tn.get(t);if(r)throw r;let i=Yt(e.location,n),a=i.absoluteURL||i.to;if($t(a))throw Error(`Invalid redirect location`);if(Jt&&!Tn.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Tn.set(t,n),n}return O.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Dn({routeContext:e,match:t,children:n}){let r=O.useContext(I);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),O.createElement(B.Provider,{value:e},n)}function On(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);j(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:qt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Cn,o&&(s<0&&c===0?(Bn(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?O.createElement(n.route.Component,null):n.route.element?n.route.element:e,O.createElement(Dn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?O.createElement(wn,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function kn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function An(e){let t=O.useContext(I);return j(t,kn(e)),t}function jn(e){let t=O.useContext(L);return j(t,kn(e)),t}function Mn(e){let t=O.useContext(B);return j(t,kn(e)),t}function Nn(e){let t=Mn(e),n=t.matches[t.matches.length-1];return j(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Pn(){return Nn(`useRouteId`)}function Fn(){let e=jn(`useNavigation`);return O.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function In(){let{matches:e,loaderData:t}=jn(`useMatches`);return O.useMemo(()=>e.map(e=>ht(e,t)),[e,t])}function Ln(){let e=O.useContext(on),t=jn(`useRouteError`),n=Nn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Rn(){let{router:e}=An(`useNavigate`),t=Nn(`useNavigate`),n=O.useRef(!1);return hn(()=>{n.current=!0}),O.useCallback(async(r,i={})=>{M(n.current,mn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var zn={};function Bn(e,t,n){!t&&!zn[e]&&(zn[e]=!0,M(!1,n))}O.memo(Vn);function Vn({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return xn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Hn({to:e,replace:t,state:n,relative:r}){j(V(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=O.useContext(R);M(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=O.useContext(B),{pathname:o}=H(),s=gn(),c=zt(e,Rt(a),o,r===`path`),l=JSON.stringify(c);return O.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Un(e){j(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Wn({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){j(!V(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=O.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=N(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=O.useMemo(()=>{let e=P(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return M(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:O.createElement(R.Provider,{value:c},O.createElement(z.Provider,{children:t,value:h}))}function Gn({children:e,location:t}){return bn(Kn(e),t)}O.Component;function Kn(e,t=[]){let n=[];return O.Children.forEach(e,(e,r)=>{if(!O.isValidElement(e))return;let i=[...t,r];if(e.type===O.Fragment){n.push.apply(n,Kn(e.props.children,i));return}j(e.type===Un,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),j(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Kn(e.props.children,i)),n.push(a)}),n}var qn=`get`,Jn=`application/x-www-form-urlencoded`;function Yn(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Xn(e){return Yn(e)&&e.tagName.toLowerCase()===`button`}function Zn(e){return Yn(e)&&e.tagName.toLowerCase()===`form`}function Qn(e){return Yn(e)&&e.tagName.toLowerCase()===`input`}function $n(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function er(e,t){return e.button===0&&(!t||t===`_self`)&&!$n(e)}function tr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function nr(e,t){let n=tr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var rr=null;function ir(){if(rr===null)try{new FormData(document.createElement(`form`),0),rr=!1}catch{rr=!0}return rr}var ar=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function or(e){return e!=null&&!ar.has(e)?(M(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jn}"`),null):e}function sr(e,t){let n,r,i,a,o;if(Zn(e)){let o=e.getAttribute(`action`);r=o?P(o,t):null,n=e.getAttribute(`method`)||qn,i=or(e.getAttribute(`enctype`))||Jn,a=new FormData(e)}else if(Xn(e)||Qn(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?P(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||qn,i=or(e.getAttribute(`formenctype`))||or(o.getAttribute(`enctype`))||Jn,a=new FormData(o,e),!ir()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Yn(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=qn,r=null,i=Jn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var cr={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},lr=/[&><\u2028\u2029]/g;function ur(e){return e.replace(lr,e=>cr[e])}function dr(e,t){if(e===!1||e==null)throw Error(t)}function fr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&P(i.pathname,t)===`/`?i.pathname=`${Vt(t)}/_root.${r}`:i.pathname=`${Vt(i.pathname)}.${r}`,i}async function pr(e,n){if(e.id in n)return n[e.id];try{let r=await t(()=>import(e.module),[]);return n[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function mr(e){return e!=null&&typeof e.page==`string`}function hr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function gr(e,t,n){return xr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await pr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(hr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function _r(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function vr(e,t,{includeHydrateFallback:n}={}){return yr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function yr(e){return[...new Set(e)]}function br(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function xr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!mr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(br(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Sr(){let e=O.useContext(I);return dr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Cr(){let e=O.useContext(L);return dr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var wr=O.createContext(void 0);wr.displayName=`FrameworkContext`;function Tr(){let e=O.useContext(wr);return dr(e,`You must render this element inside a <HydratedRouter> element`),e}function Er(e,t){let n=O.useContext(wr),[r,i]=O.useState(!1),[a,o]=O.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=O.useRef(null);O.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),O.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Dr(s,p),onBlur:Dr(c,m),onMouseEnter:Dr(l,p),onMouseLeave:Dr(u,m),onTouchStart:Dr(d,p)}]:[a,f,{}]:[!1,f,{}]}function Dr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Or({page:e,...t}){let n=tn(),{nonce:r}=Tr(),{router:i}=Sr(),a=O.useMemo(()=>pt(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?O.createElement(Ar,{page:e,matches:a,...t}):O.createElement(jr,{page:e,matches:a,...t})):null}function kr(e){let{manifest:t,routeModules:n}=Tr(),[r,i]=O.useState([]);return O.useEffect(()=>{let r=!1;return gr(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ar({page:e,matches:t,...n}){let r=H(),{future:i}=Tr(),{basename:a}=Sr(),o=O.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=fr(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return O.createElement(O.Fragment,null,o.map(e=>O.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function jr({page:e,matches:t,...n}){let r=H(),{future:i,manifest:a,routeModules:o}=Tr(),{basename:s}=Sr(),{loaderData:c,matches:l}=Cr(),u=O.useMemo(()=>_r(e,t,l,a,r,`data`),[e,t,l,a,r]),d=O.useMemo(()=>_r(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=O.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=fr(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=O.useMemo(()=>vr(d,a),[d,a]),m=kr(d);return O.createElement(O.Fragment,null,f.map(e=>O.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>O.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>O.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Mr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}O.Component;var Nr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Nr&&(window.__reactRouterVersion=`7.18.1`)}catch{}function Pr({basename:e,children:t,useTransitions:n,window:r}){let i=O.useRef();i.current??=ot({window:r,v5Compat:!0});let a=i.current,[o,s]=O.useState({action:a.action,location:a.location}),c=O.useCallback(e=>{n===!1?s(e):O.startTransition(()=>s(e))},[n]);return O.useLayoutEffect(()=>a.listen(c),[a,c]),O.createElement(Wn,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function Fr({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=O.useState({action:n.action,location:n.location}),o=O.useCallback(e=>{r===!1?a(e):O.startTransition(()=>a(e))},[r]);return O.useLayoutEffect(()=>n.listen(o),[n,o]),O.createElement(Wn,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}Fr.displayName=`unstable_HistoryRouter`;var Ir=O.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=O.useContext(R),v=typeof l==`string`&&tt.test(l),y=Yt(l,h);l=y.to;let b=fn(l,{relative:r}),x=H(),S=null;if(o){let e=zt(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:F([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=Er(n,p),E=Ur(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function ee(t){e&&e(t),t.defaultPrevented||E(t)}let te=!(y.isExternal||i),ne=O.createElement(`a`,{...p,...T,href:(te?S:void 0)||y.absoluteURL||b,onClick:te?ee:e,ref:Mr(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?O.createElement(O.Fragment,null,ne,O.createElement(Or,{page:b})):ne});Ir.displayName=`Link`;var Lr=O.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=yn(a,{relative:c.relative}),d=H(),f=O.useContext(L),{navigator:p,basename:m}=O.useContext(R),h=f!=null&&ei(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=P(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return O.createElement(Ir,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Lr.displayName=`NavLink`;var Rr=O.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=qn,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=O.useContext(R),g=qr(),_=Jr(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&tt.test(s);return O.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?O.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Rr.displayName=`Form`;function zr({getKey:e,storageKey:t,...n}){let r=O.useContext(wr),{basename:i}=O.useContext(R),a=H(),o=In();Qr({getKey:e,storageKey:t});let s=O.useMemo(()=>{if(!r||!e)return null;let t=Zr(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),O.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${ur(JSON.stringify(t||Yr))}, ${ur(JSON.stringify(s))})`}})}zr.displayName=`ScrollRestoration`;function Br(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vr(e){let t=O.useContext(I);return j(t,Br(e)),t}function Hr(e){let t=O.useContext(L);return j(t,Br(e)),t}function Ur(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=gn(),d=H(),f=yn(e,{relative:o});return O.useCallback(p=>{if(er(p,t)){p.preventDefault();let t=n===void 0?ut(d)===ut(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?O.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Wr(e){M(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=O.useRef(tr(e)),n=O.useRef(!1),r=H(),i=O.useMemo(()=>nr(r.search,n.current?null:t.current),[r.search]),a=gn();return[i,O.useCallback((e,t)=>{let r=tr(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Gr=0,Kr=()=>`__${String(++Gr)}__`;function qr(){let{router:e}=Vr(`useSubmit`),{basename:t}=O.useContext(R),n=Pn(),r=e.fetch,i=e.navigate;return O.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=sr(e,t);if(a.navigate===!1){let e=a.fetcherKey||Kr();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Jr(e,{relative:t}={}){let{basename:n}=O.useContext(R),r=O.useContext(B);j(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...yn(e||`.`,{relative:t})},o=H();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:F([n,a.pathname])),ut(a)}var Yr=`react-router-scroll-positions`,Xr={};function Zr(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:P(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Qr({getKey:e,storageKey:t}={}){let{router:n}=Vr(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Hr(`useScrollRestoration`),{basename:a}=O.useContext(R),o=H(),s=In(),c=Fn();O.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),$r(O.useCallback(()=>{if(c.state===`idle`){let t=Zr(o,s,a,e);Xr[t]=window.scrollY}try{sessionStorage.setItem(t||Yr,JSON.stringify(Xr))}catch(e){M(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(O.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Yr);e&&(Xr=JSON.parse(e))}catch{}},[t]),O.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Xr,()=>window.scrollY,e?(t,n)=>Zr(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),O.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{M(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function $r(e,t){let{capture:n}=t||{};O.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function ei(e,{relative:t}={}){let n=O.useContext(nn);j(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Vr(`useViewTransitionState`),i=yn(e,{relative:t});if(!n.isTransitioning)return!1;let a=P(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=P(n.nextLocation.pathname,r)||n.nextLocation.pathname;return At(i.pathname,o)!=null||At(i.pathname,a)!=null}var ti=class extends Error{status;manual;command;exists;constructor(e,t,n={}){super(t,n.cause===void 0?void 0:{cause:n.cause}),this.name=`ApiError`,this.status=e,this.manual=n.manual,this.command=n.command,this.exists=n.exists}};function ni(e){try{return JSON.parse(e)}catch{return}}function ri(e){return typeof e==`string`?e:void 0}function ii(e,t,n){let r=ni(n),i=r&&typeof r==`object`?r:{};return new ti(e,ri(i.error)??`${e} ${t||`request failed`}`.trim(),{manual:ri(i.manual),command:ri(i.command),exists:typeof i.exists==`boolean`?i.exists:void 0})}async function ai(e,t){try{return await fetch(e,t)}catch(t){throw t instanceof DOMException&&t.name===`AbortError`?t:new ti(0,`cannot reach the cezar server (${e})`,{cause:t})}}async function oi(e,t={}){let n=await ai(e,t),r=await n.text();if(!n.ok)throw ii(n.status,n.statusText,r);let i=ni(r);if(i===void 0)throw new ti(n.status,`the cezar server answered ${e} with a non-JSON body`);return i}async function si(e,t={}){let n=await ai(e,t),r=await n.text();if(!n.ok)throw ii(n.status,n.statusText,r);return r}function U(e,t={}){return oi(e,{method:`GET`,signal:t.signal})}function W(e,t,n){return oi(t,{method:e,...n===void 0?{}:{headers:{"content-type":`application/json`},body:JSON.stringify(n)}})}var G=(e,t=``)=>`/api/runs/${encodeURIComponent(e)}${t}`;function ci(e){return U(`/api/health`,e)}function li(e){return U(`/api/launch-key`,e)}function ui(e){return U(`/api/runs`,e)}function di(e,t){return U(G(e),t)}function fi(e){return U(`/api/ui-state`,e)}function pi(e){return U(`/api/workflows`,e)}function mi(e){return U(`/api/skills`,e)}function hi(){return W(`POST`,`/api/skills/refresh`)}function gi(e){return U(`/api/todos`,e)}function _i(e){return U(`/api/repo`,e)}function vi(e){return U(`/api/config`,e)}function yi(e){return U(`/api/repo/changes`,e)}function bi(e,t){return U(`/api/repo/commit/${encodeURIComponent(e)}?structured=1`,t)}function xi(e,t){return U(G(e,`/commits`),t)}function Si(e,t,n){return U(G(e,`/commit/${encodeURIComponent(t)}`),n)}function Ci(e={},t){let n=new URLSearchParams;e.limit!==void 0&&n.set(`limit`,String(e.limit)),e.refresh&&n.set(`refresh`,`1`);let r=n.toString();return U(`/api/github${r?`?${r}`:``}`,t)}function wi(e,t){return si(G(e,`/diff`),{method:`GET`,signal:t?.signal})}function Ti(e,t){return si(G(e,`/handoff`),{method:`GET`,signal:t?.signal})}function Ei(e,t){return U(G(e,`/changes`),t)}function Di(e,t,n){return U(G(e,`/files?path=${encodeURIComponent(t)}`),n)}function Oi(e,t){return G(e,`/files?path=${encodeURIComponent(t)}&raw=1`)}function ki(e,t){return U(`/api/groups/${encodeURIComponent(e)}`,t)}function Ai(e){return W(`POST`,`/api/runs`,e)}function ji(e){return W(`POST`,G(e,`/cancel`))}function Mi(e,t=!0){return W(`POST`,G(e,`/archive`),{archived:t})}function Ni(){return W(`POST`,`/api/runs/archive-finished`)}function Pi(e){return W(`POST`,G(e,`/finish`))}function Fi(e,t){return W(`POST`,G(e,`/continue`),t===void 0?{}:{text:t})}function Ii(e){return W(`POST`,G(e,`/pr`))}function Li(e,t){return W(`PATCH`,G(e),t)}function Ri(e){return W(`DELETE`,G(e))}function zi(e){return W(`DELETE`,`/api/todos/${encodeURIComponent(e)}`)}function Bi(e){return W(`POST`,`/api/todos/${encodeURIComponent(e)}/start`)}function Vi(e,t){return W(`POST`,`/api/groups/${encodeURIComponent(e)}/pick`,{runId:t})}function Hi(e){return W(`POST`,G(e,`/open-in-cli`))}function Ui(e){return U(`/api/open-targets`,e)}function Wi(e,t){return W(`POST`,G(e,`/open-in`),{target:t})}function Gi(e,t){return W(`POST`,G(e,`/git/commit`),{message:t})}function Ki(e){return W(`POST`,G(e,`/git/push`))}function qi(e,t){return W(`POST`,G(e,`/messages`),{text:t.text??``,images:t.images??[]})}function Ji(e){return W(`POST`,`/api/repo/branch`,e)}function Yi(e){return W(`POST`,`/api/plan`,{task:e})}function Xi(e){return W(`POST`,`/api/workflows`,e)}function Zi(e){return W(`POST`,`/api/workflows/parse`,{yaml:e})}function Qi(e){return W(`DELETE`,`/api/workflows/${encodeURIComponent(e)}`)}function $i(e){return W(`PUT`,`/api/ui-state`,e)}function ea(e){return W(`PUT`,`/api/config`,e)}var K={health:[`health`],runs:{all:[`runs`],list:()=>[`runs`,`list`],detail:e=>[`runs`,`detail`,e],diff:e=>[`runs`,`diff`,e],changes:e=>[`runs`,`changes`,e],file:(e,t)=>[`runs`,`files`,e,t],handoff:e=>[`runs`,`handoff`,e],commits:e=>[`runs`,`commits`,e],commit:(e,t)=>[`runs`,`commit`,e,t]},groups:{detail:e=>[`groups`,e]},todos:[`todos`],workflows:[`workflows`],skills:[`skills`],launchKey:[`launch-key`],repo:[`repo`],repoChanges:[`repo`,`changes`],repoCommit:e=>[`repo`,`commit`,e],uiState:[`ui-state`],config:[`config`],github:(e={})=>[`github`,e.limit??null],openTargets:[`open-targets`]};function ta(){return A({queryKey:K.health,queryFn:({signal:e})=>ci({signal:e})})}function na(){return A({queryKey:K.openTargets,queryFn:({signal:e})=>Ui({signal:e}),staleTime:5*6e4})}function ra(){return A({queryKey:K.runs.list(),queryFn:({signal:e})=>ui({signal:e})})}function ia(e){return A({queryKey:K.runs.detail(e??``),queryFn:({signal:t})=>di(e,{signal:t}),enabled:!!e})}function aa(e){return A({queryKey:K.runs.diff(e??``),queryFn:({signal:t})=>wi(e,{signal:t}),enabled:!!e})}function oa(e,t=!1){return A({queryKey:K.runs.changes(e??``),queryFn:({signal:t})=>Ei(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?4e3:!1})}function sa(e,t){return A({queryKey:K.runs.file(e??``,t??``),queryFn:({signal:n})=>Di(e,t,{signal:n}),enabled:!!e&&t!==void 0,retry:!1})}function ca(e){return A({queryKey:K.groups.detail(e??``),queryFn:({signal:t})=>ki(e,{signal:t}),enabled:!!e})}function la(e,t=!1){return A({queryKey:K.runs.commits(e??``),queryFn:({signal:t})=>xi(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?5e3:!1})}function ua(e,t){return A({queryKey:K.runs.commit(e??``,t??``),queryFn:({signal:n})=>Si(e,t,{signal:n}),enabled:!!e&&!!t,retry:!1})}function da(e,t=!0){return A({queryKey:K.runs.handoff(e??``),queryFn:({signal:t})=>Ti(e,{signal:t}),enabled:!!e&&t})}function fa(){return A({queryKey:K.todos,queryFn:({signal:e})=>gi({signal:e})})}function pa(){return A({queryKey:K.workflows,queryFn:({signal:e})=>pi({signal:e})})}function ma(e=!0){return A({queryKey:K.skills,queryFn:({signal:e})=>mi({signal:e}),enabled:e})}function ha(){return A({queryKey:K.launchKey,queryFn:({signal:e})=>li({signal:e}),staleTime:1/0})}function ga(){return A({queryKey:K.repo,queryFn:({signal:e})=>_i({signal:e})})}function _a(){return A({queryKey:K.repoChanges,queryFn:({signal:e})=>yi({signal:e}),retry:!1})}function va(e){return A({queryKey:K.repoCommit(e??``),queryFn:({signal:t})=>bi(e,{signal:t}),enabled:!!e,retry:!1})}function ya(){return A({queryKey:K.config,queryFn:({signal:e})=>vi({signal:e})})}function ba(){return A({queryKey:K.uiState,queryFn:({signal:e})=>fi({signal:e})})}function xa(e){let t=ze();return et({mutationFn:t=>Li(e,t),onSuccess:()=>t.invalidateQueries({queryKey:K.runs.all})})}function Sa(e){let t=ze();return et({mutationFn:t=>qi(e,t),onSuccess:()=>t.invalidateQueries({queryKey:K.runs.all})})}function Ca(e={},t=!0){return A({queryKey:K.github(e),queryFn:({signal:t})=>Ci({limit:e.limit},{signal:t}),enabled:t})}var wa=n(a(),1),Ta=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ea=i,Da=(e,t)=>n=>{if(t?.variants==null)return Ea(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Ta(t)||Ta(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Ea(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function Oa(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ka(...e){return t=>{let n=!1,r=e.map(e=>{let r=Oa(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Oa(e[t],null)}}}}function Aa(...e){return O.useCallback(ka(...e),e)}function ja(e){let t=O.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];za(r)&&typeof Ua==`function`&&(r=Ua(r._payload)),O.Children.forEach(r,e=>{if(La(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;za(n)&&typeof Ua==`function`&&(n=Ua(n._payload)),a=Pa(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=O.cloneElement(a,void 0,s):!o&&O.Children.count(r)===1&&O.isValidElement(r)&&(a=r);let c=a?Ia(a):void 0,l=Aa(n,c);if(!a){if(r||r===0)throw Error(o?Ha(e):Va(e));return r}let u=Fa(i,a.props??{});return a.type!==O.Fragment&&(u.ref=n?l:c),O.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var Ma=ja(`Slot`),Na=Symbol.for(`radix.slottable`),Pa=(e,t)=>{if(`child`in e.props){let t=e.props.child;return O.isValidElement(t)?O.cloneElement(t,void 0,e.props.children(t.props.children)):null}return O.isValidElement(t)?t:null};function Fa(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Ia(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function La(e){return O.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Na}var Ra=Symbol.for(`react.lazy`);function za(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ra&&`_payload`in e&&Ba(e._payload)}function Ba(e){return typeof e==`object`&&!!e&&`then`in e}var Va=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Ha=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Ua=O.use,Wa=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ja(`Primitive.${t}`),r=O.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,k.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ga(e,t){e&&wa.flushSync(()=>e.dispatchEvent(t))}function Ka(e,t=[]){let n=[];function r(t,r){let i=O.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=O.useMemo(()=>o,Object.values(o));return(0,k.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=O.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>O.createContext(e));return function(n){let r=n?.[e]||t;return O.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,qa(i,...t)]}function qa(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return O.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function Ja(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var q=globalThis?.document?O.useLayoutEffect:()=>{},Ya=O.useInsertionEffect||q;function Xa({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Za({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=O.useRef(e!==void 0);O.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`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.`),t.current=s},[s,r])}return[c,O.useCallback(t=>{if(s){let n=Qa(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Za({defaultProp:e,onChange:t}){let[n,r]=O.useState(e),i=O.useRef(n),a=O.useRef(t);return Ya(()=>{a.current=t},[t]),O.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Qa(e){return typeof e==`function`}function $a(e,t){return O.useReducer((e,n)=>t[e][n]??e,e)}var eo=e=>{let{present:t,children:n}=e,r=to(t),i=typeof n==`function`?n({present:r.isPresent}):O.Children.only(n),a=ro(r.ref,ao(i));return typeof n==`function`||r.isPresent?O.cloneElement(i,{ref:a}):null};eo.displayName=`Presence`;function to(e){let[t,n]=O.useState(),r=O.useRef(null),i=O.useRef(e),a=O.useRef(`none`),o=O.useRef(void 0),[s,c]=$a(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return O.useEffect(()=>{s===`mounted`?(a.current=o.current??io(r.current),o.current=void 0):a.current=`none`},[s]),q(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=io(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),q(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=io(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=io(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:O.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=io(t)}else r.current=null;n(e)},[])}}function no(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ro(...e){let t=O.useRef(e);return t.current=e,O.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=no(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():no(n[e],null)}}},[])}function io(e){return e?.animationName||`none`}function ao(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var oo=O.useId||(()=>void 0),so=0;function co(e){let[t,n]=O.useState(oo());return q(()=>{e||n(e=>e??String(so++))},[e]),e||(t?`radix-${t}`:``)}function J(e){let t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>((...e)=>t.current?.(...e)),[])}var lo=`DismissableLayer`,uo=`dismissableLayer.update`,fo=`dismissableLayer.pointerDownOutside`,po=`dismissableLayer.focusOutside`,mo,ho=O.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),go=O.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=O.useContext(ho),[d,f]=O.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=O.useState({}),h=Aa(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=O.useRef(!1),C=xo(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:O.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=So(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=J(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return O.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),O.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(mo=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Co(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=mo))}},[d,p,n,u]),O.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Co())},[d,u]),O.useEffect(()=>{let e=()=>m({});return document.addEventListener(uo,e),()=>document.removeEventListener(uo,e)},[]),(0,k.jsx)(Wa.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:Ja(e.onFocusCapture,w.onFocusCapture),onBlurCapture:Ja(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Ja(e.onPointerDownCapture,C.onPointerDownCapture)})});go.displayName=lo;var _o=`DismissableLayerBranch`,vo=O.forwardRef((e,t)=>{let n=O.useContext(ho),r=O.useRef(null),i=Aa(t,r);return O.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,k.jsx)(Wa.div,{...e,ref:i})});vo.displayName=_o;function yo(){let e=O.useContext(ho),[t,n]=O.useState(null);return O.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var bo=()=>!0;function xo(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=bo}=t,s=J(e),c=O.useRef(!1),l=O.useRef(!1),u=O.useRef(new Map),d=O.useRef(()=>{});return O.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}function t(){return Array.from(u.current.values()).some(Boolean)}function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}function p(e){l.current&&u.current.set(e.type,!1)}let m=a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||wo(fo,s,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:()=>c.current=!0}}function So(e,t=globalThis?.document){let n=J(e),r=O.useRef(!1);return O.useEffect(()=>{let e=e=>{e.target&&!r.current&&wo(po,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Co(){let e=new CustomEvent(uo);document.dispatchEvent(e)}function wo(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ga(i,a):i.dispatchEvent(a)}var To=`focusScope.autoFocusOnMount`,Eo=`focusScope.autoFocusOnUnmount`,Do={bubbles:!1,cancelable:!0},Oo=`FocusScope`,ko=O.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=O.useState(null),l=J(i),u=J(a),d=O.useRef(null),f=Aa(t,c),p=O.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;O.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Y(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Y(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Y(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),O.useEffect(()=>{if(s){Io.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(To,Do);s.addEventListener(To,l),s.dispatchEvent(t),t.defaultPrevented||(Ao(zo(Mo(s)),{select:!0}),document.activeElement===e&&Y(s))}return()=>{s.removeEventListener(To,l),setTimeout(()=>{let t=new CustomEvent(Eo,Do);s.addEventListener(Eo,u),s.dispatchEvent(t),t.defaultPrevented||Y(e??document.body,{select:!0}),s.removeEventListener(Eo,u),Io.remove(p)},0)}}},[s,l,u,p]);let m=O.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=jo(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Y(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Y(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,k.jsx)(Wa.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});ko.displayName=Oo;function Ao(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Y(r,{select:t}),document.activeElement!==n)return}function jo(e){let t=Mo(e);return[No(t,e),No(t.reverse(),e)]}function Mo(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function No(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Po(r,{upTo:t})))return r}function Po(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 Fo(e){return e instanceof HTMLInputElement&&`select`in e}function Y(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Fo(e)&&t&&e.select()}}var Io=Lo();function Lo(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ro(e,t),e.unshift(t)},remove(t){e=Ro(e,t),e[0]?.resume()}}}function Ro(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function zo(e){return e.filter(e=>e.tagName!==`A`)}var Bo=`Portal`,Vo=O.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=O.useState(!1);q(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?wa.createPortal((0,k.jsx)(Wa.div,{...r,ref:t}),o):null});Vo.displayName=Bo;var Ho=0,Uo=null;function Wo(){O.useEffect(()=>{Uo||={start:Go(),end:Go()};let{start:e,end:t}=Uo;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ho++,()=>{Ho===1&&(Uo?.start.remove(),Uo?.end.remove(),Uo=null),Ho=Math.max(0,Ho-1)}},[])}function Go(){let 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 X=function(){return X=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},X.apply(this,arguments)};function Ko(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function qo(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Jo=`right-scroll-bar-position`,Yo=`width-before-scroll-bar`,Xo=`with-scroll-bars-hidden`,Zo=`--removed-body-scroll-bar-size`;function Qo(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function $o(e,t){var n=(0,O.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var es=typeof window<`u`?O.useLayoutEffect:O.useEffect,ts=new WeakMap;function ns(e,t){var n=$o(t||null,function(t){return e.forEach(function(e){return Qo(e,t)})});return es(function(){var t=ts.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Qo(e,null)}),i.forEach(function(e){r.has(e)||Qo(e,a)})}ts.set(n,e)},[e]),n}function rs(e){return e}function is(e,t){t===void 0&&(t=rs);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function as(e){e===void 0&&(e={});var t=is(null);return t.options=X({async:!0,ssr:!1},e),t}var os=function(e){var t=e.sideCar,n=Ko(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return O.createElement(r,X({},n))};os.isSideCarExport=!0;function ss(e,t){return e.useMedium(t),os}var cs=as(),ls=function(){},us=O.forwardRef(function(e,t){var n=O.useRef(null),r=O.useState({onScrollCapture:ls,onWheelCapture:ls,onTouchMoveCapture:ls}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Ko(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=ns([n,t]),C=X(X({},b),i);return O.createElement(O.Fragment,null,u&&O.createElement(x,{sideCar:cs,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?O.cloneElement(O.Children.only(s),X(X({},C),{ref:S})):O.createElement(v,X({},C,{className:c,ref:S}),s))});us.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},us.classNames={fullWidth:Yo,zeroRight:Jo};var ds,fs=function(){if(ds)return ds;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ps(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=fs();return t&&e.setAttribute(`nonce`,t),e}function ms(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hs(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var gs=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ps())&&(ms(t,n),hs(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_s=function(){var e=gs();return function(t,n){O.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vs=function(){var e=_s();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ys={left:0,top:0,right:0,gap:0},bs=function(e){return parseInt(e||``,10)||0},xs=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[bs(n),bs(r),bs(i)]},Ss=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return ys;var t=xs(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Cs=vs(),ws=`data-scroll-locked`,Ts=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
4
+ .${Xo} {
5
+ overflow: hidden ${r};
6
+ padding-right: ${s}px ${r};
7
+ }
8
+ body[${ws}] {
9
+ overflow: hidden ${r};
10
+ overscroll-behavior: contain;
11
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
12
+ padding-left: ${i}px;
13
+ padding-top: ${a}px;
14
+ padding-right: ${o}px;
15
+ margin-left:0;
16
+ margin-top:0;
17
+ margin-right: ${s}px ${r};
18
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
19
+ }
20
+
21
+ .${Jo} {
22
+ right: ${s}px ${r};
23
+ }
24
+
25
+ .${Yo} {
26
+ margin-right: ${s}px ${r};
27
+ }
28
+
29
+ .${Jo} .${Jo} {
30
+ right: 0 ${r};
31
+ }
32
+
33
+ .${Yo} .${Yo} {
34
+ margin-right: 0 ${r};
35
+ }
36
+
37
+ body[${ws}] {
38
+ ${Zo}: ${s}px;
39
+ }
40
+ `},Es=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Ds=function(){O.useEffect(function(){return document.body.setAttribute(ws,(Es()+1).toString()),function(){var e=Es()-1;e<=0?document.body.removeAttribute(ws):document.body.setAttribute(ws,e.toString())}},[])},Os=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Ds();var a=O.useMemo(function(){return Ss(i)},[i]);return O.createElement(Cs,{styles:Ts(a,!t,i,n?``:`!important`)})},ks=!1;if(typeof window<`u`)try{var As=Object.defineProperty({},"passive",{get:function(){return ks=!0,!0}});window.addEventListener(`test`,As,As),window.removeEventListener(`test`,As,As)}catch{ks=!1}var Z=ks?{passive:!1}:!1,js=function(e){return e.tagName===`TEXTAREA`},Ms=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!js(e)&&n[t]===`visible`)},Ns=function(e){return Ms(e,`overflowY`)},Ps=function(e){return Ms(e,`overflowX`)},Fs=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Rs(e,r)){var i=zs(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Is=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ls=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Rs=function(e,t){return e===`v`?Ns(t):Ps(t)},zs=function(e,t){return e===`v`?Is(t):Ls(t)},Bs=function(e,t){return e===`h`&&t===`rtl`?-1:1},Vs=function(e,t,n,r,i){var a=Bs(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=zs(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Rs(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Hs=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Us=function(e){return[e.deltaX,e.deltaY]},Ws=function(e){return e&&`current`in e?e.current:e},Gs=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ks=function(e){return`
41
+ .block-interactivity-${e} {pointer-events: none;}
42
+ .allow-interactivity-${e} {pointer-events: all;}
43
+ `},qs=0,Q=[];function Js(e){var t=O.useRef([]),n=O.useRef([0,0]),r=O.useRef(),i=O.useState(qs++)[0],a=O.useState(vs)[0],o=O.useRef(e);O.useEffect(function(){o.current=e},[e]),O.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=qo([e.lockRef.current],(e.shards||[]).map(Ws),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=O.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Hs(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Fs(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Fs(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Vs(h,t,e,h===`h`?s:c,!0)},[]),c=O.useCallback(function(e){var n=e;if(!(!Q.length||Q[Q.length-1]!==a)){var r=`deltaY`in n?Us(n):Hs(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Gs(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Ws).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=O.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ys(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=O.useCallback(function(e){n.current=Hs(e),r.current=void 0},[]),d=O.useCallback(function(t){l(t.type,Us(t),t.target,s(t,e.lockRef.current))},[]),f=O.useCallback(function(t){l(t.type,Hs(t),t.target,s(t,e.lockRef.current))},[]);O.useEffect(function(){return Q.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Z),document.addEventListener(`touchmove`,c,Z),document.addEventListener(`touchstart`,u,Z),function(){Q=Q.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Z),document.removeEventListener(`touchmove`,c,Z),document.removeEventListener(`touchstart`,u,Z)}},[]);var p=e.removeScrollBar,m=e.inert;return O.createElement(O.Fragment,null,m?O.createElement(a,{styles:Ks(i)}):null,p?O.createElement(Os,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ys(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Xs=ss(cs,Js),Zs=O.forwardRef(function(e,t){return O.createElement(us,X({},e,{ref:t,sideCar:Xs}))});Zs.classNames=us.classNames;var Qs=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},$=new WeakMap,$s=new WeakMap,ec={},tc=0,nc=function(e){return e&&(e.host||nc(e.parentNode))},rc=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=nc(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},ic=function(e,t,n,r){var i=rc(t,Array.isArray(e)?e:[e]);ec[n]||(ec[n]=new WeakMap);var a=ec[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=($.get(e)||0)+1,l=(a.get(e)||0)+1;$.set(e,c),a.set(e,l),o.push(e),c===1&&i&&$s.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),tc++,function(){o.forEach(function(e){var t=$.get(e)-1,i=a.get(e)-1;$.set(e,t),a.set(e,i),t||($s.has(e)||e.removeAttribute(r),$s.delete(e)),i||e.removeAttribute(n)}),tc--,tc||($=new WeakMap,$=new WeakMap,$s=new WeakMap,ec={})}},ac=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Qs(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ic(r,i,n,`aria-hidden`)):function(){return null}},oc=Da(`inline-flex shrink-0 items-center justify-center gap-[7px] rounded-md font-semibold whitespace-nowrap transition-[background-color,border-color,opacity,filter] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{primary:`bg-primary text-primary-foreground hover:brightness-[0.96]`,contrast:`bg-contrast text-contrast-foreground hover:brightness-[0.96]`,outline:`border border-border bg-card hover:bg-muted`,ghost:`text-muted-foreground hover:bg-muted hover:text-foreground`,"danger-ghost":`text-danger hover:bg-danger/10`},size:{default:`h-9 px-3.5 text-[13.5px]`,sm:`h-[30px] rounded-sm px-2.5 text-[12.5px]`,icon:`size-9`,"icon-sm":`size-[30px] rounded-sm`}},defaultVariants:{variant:`primary`,size:`default`}});function sc({className:e,variant:t=`primary`,size:n=`default`,asChild:r=!1,...i}){return(0,k.jsx)(r?Ma:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:o(oc({variant:t,size:n,className:e})),...i})}var cc={primary:`border-primary/25 bg-primary/15 text-primary`,neutral:`border-border bg-card text-foreground shadow-xs`,danger:`border-danger/20 bg-danger/15 text-danger`};function lc({icon:e,tone:t=`neutral`,title:n,subtitle:r,children:i,actions:a,backdrop:s=!1,heading:c=`h1`,className:l}){return(0,k.jsxs)(`div`,{"data-slot":`centered-state`,"data-tone":t,className:o(`relative isolate flex min-h-full flex-1 flex-col items-center justify-center px-6 py-12 text-center`,l),children:[s?(0,k.jsx)(fc,{}):null,(0,k.jsxs)(`div`,{className:`flex w-full max-w-md flex-col items-center gap-4`,children:[(0,k.jsx)(`div`,{"data-slot":`centered-state-tile`,className:o(`flex size-[72px] items-center justify-center rounded-[18px] border [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-7`,cc[t]),children:e}),(0,k.jsx)(c,{className:`text-2xl font-semibold text-balance text-foreground`,children:n}),r?(0,k.jsx)(`p`,{className:`text-sm text-pretty text-muted-foreground`,children:r}):null,i?(0,k.jsx)(`div`,{className:`w-full pt-2`,children:i}):null,a?(0,k.jsx)(`div`,{className:`flex items-center justify-center gap-3 pt-2`,children:a}):null]})]})}var uc=[{top:`6%`,left:`14%`,size:2,tone:`violet`,opacity:.5},{top:`11%`,left:`31%`,size:3,tone:`violet`,opacity:.45},{top:`8%`,left:`52%`,size:2,tone:`pending`,opacity:.4},{top:`15%`,left:`71%`,size:2,tone:`violet`,opacity:.5},{top:`9%`,left:`86%`,size:3,tone:`primary`,opacity:.4},{top:`22%`,left:`8%`,size:2,tone:`pending`,opacity:.4},{top:`27%`,left:`24%`,size:2,tone:`primary`,opacity:.35},{top:`20%`,left:`44%`,size:3,tone:`violet`,opacity:.35},{top:`25%`,left:`62%`,size:2,tone:`violet`,opacity:.4},{top:`30%`,left:`79%`,size:2,tone:`primary`,opacity:.35},{top:`36%`,left:`12%`,size:3,tone:`violet`,opacity:.3},{top:`42%`,left:`35%`,size:2,tone:`pending`,opacity:.28},{top:`47%`,left:`58%`,size:2,tone:`primary`,opacity:.28},{top:`52%`,left:`88%`,size:2,tone:`violet`,opacity:.25},{top:`60%`,left:`29%`,size:3,tone:`violet`,opacity:.22}],dc={violet:`bg-violet`,primary:`bg-primary`,pending:`bg-pending`};function fc({className:e}){return(0,k.jsx)(`div`,{"data-slot":`twinkle-backdrop`,"aria-hidden":`true`,className:o(`pointer-events-none absolute inset-0 -z-10 overflow-hidden [mask-image:linear-gradient(to_bottom,black_25%,transparent_88%)]`,e),children:uc.map((e,t)=>(0,k.jsx)(`span`,{className:o(`absolute rounded-[1px] motion-safe:animate-pulse`,e.size===3?`size-[3px]`:`size-0.5`,dc[e.tone]),style:{top:e.top,left:e.left,opacity:e.opacity,animationDuration:`3.5s`,animationDelay:`${t%5*700}ms`}},t))})}var pc=5e3,mc=[],hc=1,gc=new Set;function _c(e){mc=e;for(let e of gc)e()}function vc(e){return gc.add(e),()=>gc.delete(e)}function yc(e,t={}){let n={id:hc++,message:e,tone:t.tone??`default`};_c([...mc,n]),setTimeout(()=>_c(mc.filter(e=>e.id!==n.id)),pc)}function bc(){let e=(0,O.useSyncExternalStore)(vc,()=>mc);return e.length===0?null:(0,k.jsx)(`div`,{"data-slot":`toaster`,className:`pointer-events-none fixed inset-x-0 bottom-[calc(16px+env(safe-area-inset-bottom))] z-50 flex flex-col items-center gap-2 px-4`,children:e.map(e=>(0,k.jsx)(`div`,{role:`status`,"data-slot":`toast`,"data-tone":e.tone,className:o(`pointer-events-auto max-w-full rounded-md px-3.5 py-2.5 text-[13px] font-medium shadow-modal`,e.tone===`danger`?`bg-danger text-danger-foreground`:`bg-contrast text-contrast-foreground`),children:e.message},e.id))})}export{Mi as $,c as $t,ca as A,Un as At,ua as B,Fe as Bt,ja as C,zi as Ct,K as D,Ir as Dt,Da as E,Pr as Et,ga as F,vn as Ft,ra as G,S as Gt,aa as H,he as Ht,_a as I,Wr as It,fa as J,y as Jt,Sa as K,x as Kt,va as L,et as Lt,ha as M,H as Mt,na as N,pn as Nt,ya as O,Lr as Ot,xa as P,gn as Pt,Ni as Q,se as Qt,ia as R,Be as Rt,Ga as S,hi as St,Aa as T,Bi as Tt,sa as U,D as Ut,la as V,we as Vt,da as W,m as Wt,pa as X,C as Xt,ba as Y,p as Yt,ti as Z,_ as Zt,Xa as _,Vi as _t,sc as a,Ii as at,Ka as b,ea as bt,Zs as c,Qi as ct,ko as d,li as dt,s as en,ji as et,go as f,Di as ft,eo as g,Li as gt,co as h,Zi as ht,fc as i,Ai as it,ta as j,Gn as jt,Ca as k,Hn as kt,Wo as l,Pi as lt,J as m,Hi as mt,yc as n,Fi as nt,oc as o,Xi as ot,yo as p,Wi as pt,ma as q,b as qt,lc as r,Ji as rt,ac as s,Ri as st,bc as t,Gi as tt,Vo as u,Ci as ut,q as v,Yi as vt,ka as w,Oi as wt,Wa as x,$i as xt,Ja as y,Ki as yt,oa as z,ze as zt};
@@ -0,0 +1 @@
1
+ import{n as e}from"./utils-rQGbOrwc.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),n=e(`trash-2`,[[`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`}]]);export{t as n,n as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./utils-rQGbOrwc.js";var t=e(`triangle-alert`,[[`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`}]]);export{t};