@wjarka/cezarion 0.18.0-dev.7899 → 0.18.0-dev.7909

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 (155) hide show
  1. package/package.json +2 -2
  2. package/web/dist/assets/accounts-section-C7qacMAX.js +1 -0
  3. package/web/dist/assets/activity-motion-CkAbct6K.js +2 -0
  4. package/web/dist/assets/activity-route-DkSc-BB_.js +1 -0
  5. package/web/dist/assets/agent-config-section-DBqtxqrI.js +4 -0
  6. package/web/dist/assets/agent-defaults-section-AHmatJKy.js +1 -0
  7. package/web/dist/assets/agents-settings-path-7X6_cvUg.js +1 -0
  8. package/web/dist/assets/appearance-Uyrw7pjm.js +1 -0
  9. package/web/dist/assets/archive-on-merge-field-w_cfxV6m.js +1 -0
  10. package/web/dist/assets/attention-BMiaqJnx.js +1 -0
  11. package/web/dist/assets/automation-format-1lHzRTbq.js +1 -0
  12. package/web/dist/assets/automations-route-BBzRefYM.js +1 -0
  13. package/web/dist/assets/badge-D9JrXe0o.js +1 -0
  14. package/web/dist/assets/bot-TkDIw4y-.js +1 -0
  15. package/web/dist/assets/bundle-mjs-rHxsej31.js +1 -0
  16. package/web/dist/assets/button-BQ2y4XRB.js +1 -0
  17. package/web/dist/assets/centered-state-V15AR_qo.js +1 -0
  18. package/web/dist/assets/chevron-down-CHGyCDBH.js +1 -0
  19. package/web/dist/assets/chevron-right-BENZ-1ZN.js +1 -0
  20. package/web/dist/assets/{chunk-BO2N2NFS-y7WHTKOf.js → chunk-BO2N2NFS-DQrpGzb-.js} +4 -4
  21. package/web/dist/assets/chunk-KS7C4IRE-Cg8l-LDN.js +3 -0
  22. package/web/dist/assets/collapsible-BEV4FO-1.js +1 -0
  23. package/web/dist/assets/command-CDt1BsZy.js +1 -0
  24. package/web/dist/assets/commit-diff-panel-Ba-6F5So.js +1 -0
  25. package/web/dist/assets/dialog-BVF6dIeS.js +1 -0
  26. package/web/dist/assets/diff-D3RVmX07.js +3 -0
  27. package/web/dist/assets/diff-controls-BSWICnsb.js +1 -0
  28. package/web/dist/assets/{diff-view-BG91xPpY.js → diff-view-CYIMlq04.js} +4 -4
  29. package/web/dist/assets/dist-BAoXdNsT.js +1 -0
  30. package/web/dist/assets/dist-BW234Kg5.js +1 -0
  31. package/web/dist/assets/dist-C28wFbz0.js +1 -0
  32. package/web/dist/assets/dist-C5mlVBmd.js +1 -0
  33. package/web/dist/assets/dist-DXO3xwbC.js +1 -0
  34. package/web/dist/assets/dist-Da4ckcJG.js +1 -0
  35. package/web/dist/assets/dropdown-menu-4e2iKSMT.js +1 -0
  36. package/web/dist/assets/es2015-CQth82uv.js +41 -0
  37. package/web/dist/assets/external-link-BE6y205O.js +1 -0
  38. package/web/dist/assets/file-preview-jj3RWAaW.js +2 -0
  39. package/web/dist/assets/folder-browser-CH0gdxd-.js +1 -0
  40. package/web/dist/assets/folder-o-AvL3y3.js +1 -0
  41. package/web/dist/assets/git-toolbar-BOaq9GcR.js +1 -0
  42. package/web/dist/assets/github-wkggyCqa.js +1 -0
  43. package/web/dist/assets/global-activity-route-BTrelHAD.js +1 -0
  44. package/web/dist/assets/{highlighted-body-OFNGDK62-D62LjTH2.js → highlighted-body-OFNGDK62-Cx8MiNVZ.js} +1 -1
  45. package/web/dist/assets/highlighter-DvLzHjjY.js +3 -0
  46. package/web/dist/assets/{image-preview-2AnVvt0e.js → image-preview-CNBuRrK5.js} +1 -1
  47. package/web/dist/assets/index-CRfojAQ1.js +21 -0
  48. package/web/dist/assets/index-F-X4qZSv.css +1 -0
  49. package/web/dist/assets/label-D6DhdNb7.js +1 -0
  50. package/web/dist/assets/markdown-i80v6qNq.js +4 -0
  51. package/web/dist/assets/mermaid-GHXKKRXX-lTc_AjAC.js +1 -0
  52. package/web/dist/assets/moon-CRE9nU5R.js +1 -0
  53. package/web/dist/assets/nav-row-styles-DqKjMToI.js +1 -0
  54. package/web/dist/assets/notifications-section-GGsdkedq.js +1 -0
  55. package/web/dist/assets/open-in-menu-DgScIVvr.js +1 -0
  56. package/web/dist/assets/own-lookup-DS54wXvD.js +1 -0
  57. package/web/dist/assets/popover-BPgUYFyu.js +1 -0
  58. package/web/dist/assets/preload-helper-Czpn1I53.js +1 -0
  59. package/web/dist/assets/preview-pane-connected-B3mexb-I.js +3 -0
  60. package/web/dist/assets/project-location-4UN0Eqf-.js +1 -0
  61. package/web/dist/assets/project-order-AcHI4Dcl.js +1 -0
  62. package/web/dist/assets/project-rail-sortable-BmVI4_-T.js +1 -0
  63. package/web/dist/assets/project-router-UyyzK1j2.js +1 -0
  64. package/web/dist/assets/project-scope-context-BRvkKGX1.js +4 -0
  65. package/web/dist/assets/projects-section-DjeKfkRK.js +1 -0
  66. package/web/dist/assets/prompt-templates-section-CPH3RU9O.js +1 -0
  67. package/web/dist/assets/queries-CQWAcH8p.js +1 -0
  68. package/web/dist/assets/reference-chip-DGOmeh0l.js +1 -0
  69. package/web/dist/assets/remote-settings-notice-BFDdo8X5.js +1 -0
  70. package/web/dist/assets/repo-git-PaJ9uJ6o.js +1 -0
  71. package/web/dist/assets/report-reader-DDDg-Iyz.js +1 -0
  72. package/web/dist/assets/reports-DRSGsu5b.js +1 -0
  73. package/web/dist/assets/resources-section-Dwx13rfP.js +1 -0
  74. package/web/dist/assets/run-header-q5egOxrK.js +2 -0
  75. package/web/dist/assets/{runners-CKrq5tR_.js → runners-BFhbiSKy.js} +1 -1
  76. package/web/dist/assets/settings-agent-picker-YO8UtetZ.js +1 -0
  77. package/web/dist/assets/settings-field-Bl6WuvGX.js +1 -0
  78. package/web/dist/assets/settings-shell-De1IxHYf.js +1 -0
  79. package/web/dist/assets/settings-shell-xK8txSJo.css +1 -0
  80. package/web/dist/assets/sidebar-section-CYKz48EO.js +1 -0
  81. package/web/dist/assets/skills-hTBIyeAr.js +1 -0
  82. package/web/dist/assets/smartphone-Lr8Ug2z_.js +1 -0
  83. package/web/dist/assets/sortable.esm-CAVTYaA3.js +5 -0
  84. package/web/dist/assets/square-terminal-B6RYYieR.js +1 -0
  85. package/web/dist/assets/status-dot-DtAOFiIi.js +1 -0
  86. package/web/dist/assets/switch-Bv2Zf1uU.js +1 -0
  87. package/web/dist/assets/tab-link-BmEGnV4R.js +1 -0
  88. package/web/dist/assets/task-changes-CvbqO0ug.js +1 -0
  89. package/web/dist/assets/task-commits-kVuYqkqB.js +1 -0
  90. package/web/dist/assets/task-files-DOFkMbFg.js +1 -0
  91. package/web/dist/assets/task-github-item-13sbVXYb.js +1 -0
  92. package/web/dist/assets/task-groups-Dc7pXgaS.js +1 -0
  93. package/web/dist/assets/task-thread-B0d0xyLV.js +9 -0
  94. package/web/dist/assets/tasks-table-lb5Dy-8O.js +1 -0
  95. package/web/dist/assets/textarea-vJt9undk.js +1 -0
  96. package/web/dist/assets/thread-state-BwzJmXzv.js +4 -0
  97. package/web/dist/assets/toaster-Bo5vCbz-.js +1 -0
  98. package/web/dist/assets/use-hand-to-agent-state-wRTXiZqE.js +1 -0
  99. package/web/dist/assets/{useInfiniteQuery-BdIIhzMI.js → useInfiniteQuery-rgb-nitU.js} +1 -1
  100. package/web/dist/assets/useQuery-SVV6EtG7.js +1 -0
  101. package/web/dist/assets/utils-DSMR_WLb.js +1 -0
  102. package/web/dist/assets/workflows-35bEvVkH.js +7 -0
  103. package/web/dist/assets/workspace-tools-Bw4MyHOW.js +1 -0
  104. package/web/dist/assets/worktrees-section-CLwPLrl2.js +4 -0
  105. package/web/dist/assets/{ws-DiWUfn_t.js → ws-D3-jE1IB.js} +1 -1
  106. package/web/dist/assets/zoomable-image-CIQl1Wpe.js +1 -0
  107. package/web/dist/index.html +49 -25
  108. package/web/dist/assets/activity-motion-DKY_Cd-w.js +0 -2
  109. package/web/dist/assets/activity-route-CFOKEc61.js +0 -1
  110. package/web/dist/assets/attention-B0IBc2_D.js +0 -1
  111. package/web/dist/assets/bundle-mjs-BT31bpU6.js +0 -1
  112. package/web/dist/assets/button-C1fD-ZFr.js +0 -3
  113. package/web/dist/assets/centered-state-CiiA8Vgw.js +0 -1
  114. package/web/dist/assets/commit-diff-panel-BiNUdbd8.js +0 -1
  115. package/web/dist/assets/dialog-B3EUmMBQ.js +0 -1
  116. package/web/dist/assets/diff-WtmvA0fu.js +0 -3
  117. package/web/dist/assets/diff-controls-CA6lS7Yp.js +0 -1
  118. package/web/dist/assets/dist-Du8mGhoH.js +0 -1
  119. package/web/dist/assets/dropdown-menu-Dso6iTId.js +0 -1
  120. package/web/dist/assets/es2015-Ch36azR0.js +0 -41
  121. package/web/dist/assets/file-preview-YCD-8e6S.js +0 -2
  122. package/web/dist/assets/git-toolbar-B5YAUWQ7.js +0 -1
  123. package/web/dist/assets/github-DHeSsbSc.js +0 -1
  124. package/web/dist/assets/global-activity-route-CMq49K4H.js +0 -1
  125. package/web/dist/assets/index-C3pMUosD.js +0 -14
  126. package/web/dist/assets/index-DXvh46tl.css +0 -1
  127. package/web/dist/assets/markdown-OTuqNLUj.js +0 -4
  128. package/web/dist/assets/mermaid-GHXKKRXX-C7OP146z.js +0 -1
  129. package/web/dist/assets/nav-row-styles-CFjnD-9J.js +0 -1
  130. package/web/dist/assets/picker-pill-BhCKGHAn.js +0 -15
  131. package/web/dist/assets/preview-pane-connected-BvOk8924.js +0 -3
  132. package/web/dist/assets/project-router-CcyPWtFH.js +0 -1
  133. package/web/dist/assets/project-scope-context-CX36ze1Q.js +0 -4
  134. package/web/dist/assets/prompt-template-menu-YN8kTo5-.js +0 -1
  135. package/web/dist/assets/queries-Cb76PEoL.js +0 -1
  136. package/web/dist/assets/reference-chip-BuUCKkhB.js +0 -1
  137. package/web/dist/assets/repo-git-B2M2bD92.js +0 -1
  138. package/web/dist/assets/report-reader-DeyzG6gC.js +0 -1
  139. package/web/dist/assets/reports-Ca8vCNah.js +0 -1
  140. package/web/dist/assets/run-header-DP7P0saA.js +0 -2
  141. package/web/dist/assets/skills-5ODbLwjd.js +0 -1
  142. package/web/dist/assets/sortable.esm-zp_qkYGV.js +0 -5
  143. package/web/dist/assets/tab-link-Dn7KFNYr.js +0 -1
  144. package/web/dist/assets/task-changes-BkeLycTI.js +0 -1
  145. package/web/dist/assets/task-commits-Db8B7L6o.js +0 -1
  146. package/web/dist/assets/task-files-CFVAB4Bl.js +0 -1
  147. package/web/dist/assets/task-github-item-z295iYNd.js +0 -1
  148. package/web/dist/assets/task-thread-UXl-CsYi.js +0 -9
  149. package/web/dist/assets/thread-state-BsbjdGGk.js +0 -4
  150. package/web/dist/assets/toaster-Cxgzn9ip.js +0 -1
  151. package/web/dist/assets/use-desktop-BqVEJ3dr.js +0 -1
  152. package/web/dist/assets/use-hand-to-agent-state-DXfR9R5L.js +0 -1
  153. package/web/dist/assets/useQuery-Dg1rzYtR.js +0 -1
  154. package/web/dist/assets/workflows-BCuRK6_a.js +0 -7
  155. package/web/dist/assets/zoomable-image-DrDnCL4V.js +0 -1
@@ -0,0 +1,3 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./preload-helper-Czpn1I53.js";var r=e(t(),1),i=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,a=/^[\\/]{2}/;function o(e,t){return t+e.replace(/\\/g,`/`)}var s=`popstate`;function c(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function l(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return m(``,{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:h(t)}return _(t,n,null,e)}function u(e,t){if(e===!1||e==null)throw Error(t)}function d(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function f(){return Math.random().toString(36).substring(2,10)}function p(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 m(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?g(t):t,state:n,key:t&&t.key||r||f(),mask:i}}function h({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 g(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 _(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l=`POP`,u=null,d=f();d??(d=0,o.replaceState({...o.state,idx:d},``));function f(){return(o.state||{idx:null}).idx}function h(){l=`POP`;let e=f(),t=e==null?null:e-d;d=e,u&&u({action:l,location:b.location,delta:t})}function g(e,t){l=`PUSH`;let r=c(e)?e:m(b.location,e,t);n&&n(r,e),d=f()+1;let s=p(r,d),h=b.createHref(r.mask||r);try{o.pushState(s,``,h)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(h)}a&&u&&u({action:l,location:b.location,delta:1})}function _(e,t){l=`REPLACE`;let r=c(e)?e:m(b.location,e,t);n&&n(r,e),d=f();let i=p(r,d),s=b.createHref(r.mask||r);o.replaceState(i,``,s),a&&u&&u({action:l,location:b.location,delta:0})}function y(e){return v(i,e)}let b={get action(){return l},get location(){return e(i,o)},listen(e){if(u)throw Error(`A history only accepts one active listener`);return i.addEventListener(s,h),u=e,()=>{i.removeEventListener(s,h),u=null}},createHref(e){return t(i,e)},createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:g,replace:_,go(e){return o.go(e)}};return b}function v(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),u(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:h(t);return i=i.replace(/ $/,`%20`),!n&&a.test(i)&&(i=r+i),new URL(i,r)}function y(e,t,n=`/`){return b(e,t,n,!1)}function b(e,t,n,r,i){let a=O((typeof t==`string`?g(t):t).pathname||`/`,n);if(a==null)return null;let o=i??S(e),s=null,c=de(a);for(let e=0;s==null&&e<o.length;++e)s=ce(o[e],c,r);return s}function x(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 S(e){let t=C(e);return T(t),t}function C(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;u(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=A([r,c.relativePath]),d=n.concat(c);e.children&&e.children.length>0&&(u(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),C(e.children,t,d,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:oe(l,e.index),routesMeta:d.map((e,t)=>{let[n,r]=ue(e.relativePath,e.caseSensitive,t===d.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 w(e.path))a(e,t,!0,n)}),t}function w(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=w(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 T(e){e.sort((e,t)=>e.score===t.score?se(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ee=/^:[\w-]+$/,te=3,ne=2,re=1,ie=10,E=-2,ae=e=>e===`*`;function oe(e,t){let n=e.split(`/`),r=n.length;return n.some(ae)&&(r+=E),t&&(r+=ne),n.filter(e=>!ae(e)).reduce((e,t)=>e+(ee.test(t)?te:t===``?re:ie),r)}function se(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 ce(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?le(u,l,s.matcher,s.compiledParams):D(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=D({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:A([a,d.pathname]),pathnameBase:ve(A([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=A([a,d.pathnameBase]))}return o}function D(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ue(e.path,e.caseSensitive,e.end);return le(e,t,n,r)}function le(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 ue(e,t=!1,n=!0){d(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 de(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return d(!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 O(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 fe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?g(e):e,a;return n?(n=_e(n),a=n.startsWith(`/`)?pe(n.substring(1),`/`):pe(n,t)):a=t,{pathname:a,search:ye(r),hash:be(i)}}function pe(e,t){let n=j(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function me(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 he(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ge(e){let t=he(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function k(e,t,n,r=!1){let i;typeof e==`string`?i=g(e):(i={...e},u(!i.pathname||!i.pathname.includes(`?`),me(`?`,`pathname`,`search`,i)),u(!i.pathname||!i.pathname.includes(`#`),me(`#`,`pathname`,`hash`,i)),u(!i.search||!i.search.includes(`#`),me(`#`,`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=fe(i,s),l=o&&o!==`/`&&o.endsWith(`/`),d=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||d)&&(c.pathname+=`/`),c}var _e=e=>e.replace(/[\\/]{2,}/g,`/`),A=e=>_e(e.join(`/`)),j=e=>e.replace(/\/+$/,``),ve=e=>j(e).replace(/^\/*/,`/`),ye=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,be=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,xe=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 Se(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ce(e){return A(e.map(e=>e.route.path).filter(Boolean))||`/`}var we=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Te(e,t){let n=e;if(typeof n!=`string`||!i.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(we)try{let e=new URL(window.location.href),r=a.test(n)?new URL(o(n,e.protocol)):new URL(n),i=O(r.pathname,t);r.origin===e.origin&&i!=null?n=i+r.search+r.hash:s=!0}catch{d(!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:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ee=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Ee);var De=[`GET`,...Ee];new Set(De);var Oe=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function ke(e){try{return Oe.includes(new URL(e).protocol)}catch{return!1}}var M=r.createContext(null);M.displayName=`DataRouter`;var N=r.createContext(null);N.displayName=`DataRouterState`;var Ae=r.createContext(!1);function je(){return r.useContext(Ae)}var Me=r.createContext({isTransitioning:!1});Me.displayName=`ViewTransition`;var Ne=r.createContext(new Map);Ne.displayName=`Fetchers`;var Pe=r.createContext(null);Pe.displayName=`Await`;var P=r.createContext(null);P.displayName=`Navigation`;var F=r.createContext(null);F.displayName=`Location`;var I=r.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName=`Route`;var L=r.createContext(null);L.displayName=`RouteError`;var Fe=`REACT_ROUTER_ERROR`,Ie=`REDIRECT`,Le=`ROUTE_ERROR_RESPONSE`;function Re(e){if(e.startsWith(`${Fe}:${Ie}:{`))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 ze(e){if(e.startsWith(`${Fe}:${Le}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new xe(t.status,t.statusText,t.data)}catch{}}function Be(e,{relative:t}={}){u(R(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:i}=r.useContext(P),{hash:a,pathname:o,search:s}=V(e,{relative:t}),c=o;return n!==`/`&&(c=o===`/`?n:A([n,o])),i.createHref({pathname:c,search:s,hash:a})}function R(){return r.useContext(F)!=null}function z(){return u(R(),`useLocation() may be used only in the context of a <Router> component.`),r.useContext(F).location}function Ve(){return r.useContext(F).navigationType}var He=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Ue(e){r.useContext(P).static||r.useLayoutEffect(e)}function B(){let{isDataRoute:e}=r.useContext(I);return e?lt():We()}function We(){u(R(),`useNavigate() may be used only in the context of a <Router> component.`);let e=r.useContext(M),{basename:t,navigator:n}=r.useContext(P),{matches:i}=r.useContext(I),{pathname:a}=z(),o=JSON.stringify(ge(i)),s=r.useRef(!1);return Ue(()=>{s.current=!0}),r.useCallback((r,i={})=>{if(d(s.current,He),!s.current)return;if(typeof r==`number`){n.go(r);return}let c=k(r,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:A([t,c.pathname])),(i.replace?n.replace:n.push)(c,i.state,i)},[t,n,o,a,e])}var Ge=r.createContext(null);function Ke(e){let t=r.useContext(I).outlet;return r.useMemo(()=>t&&r.createElement(Ge.Provider,{value:e},t),[t,e])}function qe(){let{matches:e}=r.useContext(I);return e[e.length-1]?.params??{}}function V(e,{relative:t}={}){let{matches:n}=r.useContext(I),{pathname:i}=z(),a=JSON.stringify(ge(n));return r.useMemo(()=>k(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function Je(e,t){return Ye(e,t)}function Ye(e,t,n){u(R(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=r.useContext(P),{matches:a}=r.useContext(I),o=a[a.length-1],s=o?o.params:{},c=o?o.pathname:`/`,l=o?o.pathnameBase:`/`,f=o&&o.route;{let e=f&&f.path||``;dt(c,!f||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (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 p=z(),m;if(t){let e=typeof t==`string`?g(t):t;u(l===`/`||e.pathname?.startsWith(l),`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 "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),m=e}else m=p;let h=m.pathname||`/`,_=h;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);_=`/`+h.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let v=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):y(e,{pathname:_});d(f||v!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),d(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.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 b=tt(v&&v.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:A([l,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:A([l,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,n);return t&&b?r.createElement(F.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...m},navigationType:`POP`}},b):b}function Xe(){let e=ct(),t=Se(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i=`rgba(200,200,200, 0.5)`,a={padding:`0.5rem`,backgroundColor:i},o={padding:`2px 4px`,backgroundColor:i},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=r.createElement(r.Fragment,null,r.createElement(`p`,null,`💿 Hey developer 👋`),r.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,r.createElement(`code`,{style:o},`ErrorBoundary`),` or`,` `,r.createElement(`code`,{style:o},`errorElement`),` prop on your route.`)),r.createElement(r.Fragment,null,r.createElement(`h2`,null,`Unexpected Application Error!`),r.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?r.createElement(`pre`,{style:a},n):null,s)}var Ze=r.createElement(Xe,null),Qe=class extends r.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=ze(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:r.createElement(I.Provider,{value:this.props.routeContext},r.createElement(L.Provider,{value:e,children:this.props.component}));return this.context?r.createElement($e,{error:e},t):t}};Qe.contextType=Ae;var H=new WeakMap;function $e({children:e,error:t}){let{basename:n}=r.useContext(P);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Re(t.digest);if(e){let i=H.get(t);if(i)throw i;let a=Te(e.location,n),o=a.absoluteURL||a.to;if(ke(o))throw Error(`Invalid redirect location`);if(we&&!H.get(t))if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw H.set(t,n),n}return r.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function et({routeContext:e,match:t,children:n}){let i=r.useContext(M);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),r.createElement(I.Provider,{value:e},n)}function tt(e,t=[],n){let i=n?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);u(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||o){n.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=n?.onError,d=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},pattern:Ce(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,n,l)=>{let u,f=!1,p=null,m=null;i&&(u=o&&n.route.id?o[n.route.id]:void 0,p=n.route.errorElement||Ze,s&&(c<0&&l===0?(dt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=u?p:f?m:n.route.Component?r.createElement(n.route.Component,null):n.route.element?n.route.element:e,r.createElement(et,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?r.createElement(Qe,{location:i.location,revalidation:i.revalidation,component:p,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:d}):g()},null)}function U(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nt(e){let t=r.useContext(M);return u(t,U(e)),t}function rt(e){let t=r.useContext(N);return u(t,U(e)),t}function it(e){let t=r.useContext(I);return u(t,U(e)),t}function W(e){let t=it(e),n=t.matches[t.matches.length-1];return u(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function at(){return W(`useRouteId`)}function ot(){let e=rt(`useNavigation`);return r.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function st(){let{matches:e,loaderData:t}=rt(`useMatches`);return r.useMemo(()=>e.map(e=>x(e,t)),[e,t])}function ct(){let e=r.useContext(L),t=rt(`useRouteError`),n=W(`useRouteError`);return e===void 0?t.errors?.[n]:e}function lt(){let{router:e}=nt(`useNavigate`),t=W(`useNavigate`),n=r.useRef(!1);return Ue(()=>{n.current=!0}),r.useCallback(async(r,i={})=>{d(n.current,He),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ut={};function dt(e,t,n){!t&&!ut[e]&&(ut[e]=!0,d(!1,n))}r.memo(ft);function ft({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Ye(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function pt({to:e,replace:t,state:n,relative:i}){u(R(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:a}=r.useContext(P);d(!a,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=r.useContext(I),{pathname:s}=z(),c=B(),l=k(e,ge(o),s,i===`path`),f=JSON.stringify(l);return r.useEffect(()=>{c(JSON.parse(f),{replace:t,state:n,relative:i})},[c,f,i,t,n]),null}function mt(e){return Ke(e.context)}function ht(e){u(!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 gt({basename:e=`/`,children:t=null,location:n,navigationType:i=`POP`,navigator:a,static:o=!1,useTransitions:s}){u(!R(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=r.useMemo(()=>({basename:c,navigator:a,static:o,useTransitions:s,future:{}}),[c,a,o,s]);typeof n==`string`&&(n=g(n));let{pathname:f=`/`,search:p=``,hash:m=``,state:h=null,key:_=`default`,mask:v}=n,y=r.useMemo(()=>{let e=O(f,c);return e==null?null:{location:{pathname:e,search:p,hash:m,state:h,key:_,mask:v},navigationType:i}},[c,f,p,m,h,_,i,v]);return d(y!=null,`<Router basename="${c}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:r.createElement(P.Provider,{value:l},r.createElement(F.Provider,{children:t,value:y}))}function _t({children:e,location:t}){return Je(G(e),t)}r.Component;function G(e,t=[]){let n=[];return r.Children.forEach(e,(e,i)=>{if(!r.isValidElement(e))return;let a=[...t,i];if(e.type===r.Fragment){n.push.apply(n,G(e.props.children,a));return}u(e.type===ht,`[${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>`),u(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let o={id:e.props.id||a.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&&(o.children=G(e.props.children,a)),n.push(o)}),n}var vt=G,K=`get`,q=`application/x-www-form-urlencoded`;function J(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function yt(e){return J(e)&&e.tagName.toLowerCase()===`button`}function bt(e){return J(e)&&e.tagName.toLowerCase()===`form`}function xt(e){return J(e)&&e.tagName.toLowerCase()===`input`}function St(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ct(e,t){return e.button===0&&(!t||t===`_self`)&&!St(e)}function wt(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 Tt(e,t){let n=wt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Y=null;function Et(){if(Y===null)try{new FormData(document.createElement(`form`),0),Y=!1}catch{Y=!0}return Y}var Dt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ot(e){return e!=null&&!Dt.has(e)?(d(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${q}"`),null):e}function kt(e,t){let n,r,i,a,o;if(bt(e)){let o=e.getAttribute(`action`);r=o?O(o,t):null,n=e.getAttribute(`method`)||K,i=Ot(e.getAttribute(`enctype`))||q,a=new FormData(e)}else if(yt(e)||xt(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?O(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||K,i=Ot(e.getAttribute(`formenctype`))||Ot(o.getAttribute(`enctype`))||q,a=new FormData(o,e),!Et()){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(J(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=K,r=null,i=q,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 At={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},jt=/[&><\u2028\u2029]/g;function Mt(e){return e.replace(jt,e=>At[e])}function Nt(e,t){if(e===!1||e==null)throw Error(t)}function Pt(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&&O(i.pathname,t)===`/`?i.pathname=`${j(t)}/_root.${r}`:i.pathname=`${j(i.pathname)}.${r}`,i}async function Ft(e,t){if(e.id in t)return t[e.id];try{let r=await n(()=>import(e.module),[]);return t[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 It(e){return e!=null&&typeof e.page==`string`}function Lt(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 Rt(e,t,n){return Ut((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Ft(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Lt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function zt(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 Bt(e,t,{includeHydrateFallback:n}={}){return Vt(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 Vt(e){return[...new Set(e)]}function Ht(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Ut(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!It(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Ht(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Wt(){let e=r.useContext(M);return Nt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Gt(){let e=r.useContext(N);return Nt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var X=r.createContext(void 0);X.displayName=`FrameworkContext`;function Z(){let e=r.useContext(X);return Nt(e,`You must render this element inside a <HydratedRouter> element`),e}function Kt(e,t){let n=r.useContext(X),[i,a]=r.useState(!1),[o,s]=r.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=r.useRef(null);r.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),r.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return n?e===`intent`?[o,p,{onFocus:Q(c,m),onBlur:Q(l,h),onMouseEnter:Q(u,m),onMouseLeave:Q(d,h),onTouchStart:Q(f,m)}]:[o,p,{}]:[!1,p,{}]}function Q(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function qt({page:e,...t}){let n=je(),{nonce:i}=Z(),{router:a}=Wt(),o=r.useMemo(()=>y(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?(t.nonce==null&&i&&(t={...t,nonce:i}),n?r.createElement(Yt,{page:e,matches:o,...t}):r.createElement(Xt,{page:e,matches:o,...t})):null}function Jt(e){let{manifest:t,routeModules:n}=Z(),[i,a]=r.useState([]);return r.useEffect(()=>{let r=!1;return Rt(e,t,n).then(e=>{r||a(e)}),()=>{r=!0}},[e,t,n]),i}function Yt({page:e,matches:t,...n}){let i=z(),{future:a}=Z(),{basename:o}=Wt(),s=r.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=Pt(e,o,a.v8_trailingSlashAwareDataRequests,`rsc`),r=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:s.push(e.route.id);return r&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[o,a.v8_trailingSlashAwareDataRequests,e,i,t]);return r.createElement(r.Fragment,null,s.map(e=>r.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Xt({page:e,matches:t,...n}){let i=z(),{future:a,manifest:o,routeModules:s}=Z(),{basename:c}=Wt(),{loaderData:l,matches:u}=Gt(),d=r.useMemo(()=>zt(e,t,u,o,i,`data`),[e,t,u,o,i]),f=r.useMemo(()=>zt(e,t,u,o,i,`assets`),[e,t,u,o,i]),p=r.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),n.size===0)return[];let u=Pt(e,c,a.v8_trailingSlashAwareDataRequests,`data`);return r&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,a.v8_trailingSlashAwareDataRequests,l,i,o,d,t,e,s]),m=r.useMemo(()=>Bt(f,o),[f,o]),h=Jt(f);return r.createElement(r.Fragment,null,p.map(e=>r.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>r.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>r.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Zt(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}r.Component;var Qt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Qt&&(window.__reactRouterVersion=`7.18.1`)}catch{}function $t({basename:e,children:t,useTransitions:n,window:i}){let a=r.useRef();a.current??=l({window:i,v5Compat:!0});let o=a.current,[s,c]=r.useState({action:o.action,location:o.location}),u=r.useCallback(e=>{n===!1?c(e):r.startTransition(()=>c(e))},[n]);return r.useLayoutEffect(()=>o.listen(u),[o,u]),r.createElement(gt,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:o,useTransitions:n})}function en({basename:e,children:t,history:n,useTransitions:i}){let[a,o]=r.useState({action:n.action,location:n.location}),s=r.useCallback(e=>{i===!1?o(e):r.startTransition(()=>o(e))},[i]);return r.useLayoutEffect(()=>n.listen(s),[n,s]),r.createElement(gt,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:n,useTransitions:i})}en.displayName=`unstable_HistoryRouter`;var tn=r.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:a,reloadDocument:o,replace:s,mask:c,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=r.useContext(P),b=typeof d==`string`&&i.test(d),x=Te(d,_);d=x.to;let S=Be(d,{relative:a}),C=z(),w=null;if(c){let e=k(c,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:A([_,e.pathname])),w=v.createHref(e)}let[T,ee,te]=Kt(n,h),ne=ln(d,{replace:s,mask:c,state:l,target:u,preventScrollReset:f,relative:a,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function re(t){e&&e(t),t.defaultPrevented||ne(t)}let ie=!(x.isExternal||o),E=r.createElement(`a`,{...h,...te,href:(ie?w:void 0)||x.absoluteURL||S,onClick:ie?re:e,ref:Zt(g,ee),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?r.createElement(r.Fragment,null,E,r.createElement(qt,{page:S})):E});tn.displayName=`Link`;var nn=r.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=V(o,{relative:l.relative}),f=z(),p=r.useContext(N),{navigator:m,basename:h}=r.useContext(P),g=p!=null&&yn(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=O(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let ee=typeof a==`function`?a(C):a;return r.createElement(tn,{...l,"aria-current":w,className:T,ref:u,style:ee,to:o,viewTransition:s},typeof c==`function`?c(C):c)});nn.displayName=`NavLink`;var rn=r.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:a,replace:o,state:s,method:c=K,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=r.useContext(P),v=pn(),y=mn(l,{relative:d}),b=c.toLowerCase()===`get`?`get`:`post`,x=typeof l==`string`&&i.test(l);return r.createElement(`form`,{ref:g,method:b,action:y,onSubmit:a?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,a=i?.getAttribute(`formmethod`)||c,l=()=>v(i||e.currentTarget,{fetcherKey:t,method:a,navigate:n,replace:o,state:s,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&n!==!1?r.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});rn.displayName=`Form`;function an({getKey:e,storageKey:t,...n}){let i=r.useContext(X),{basename:a}=r.useContext(P),o=z(),s=st();_n({getKey:e,storageKey:t});let c=r.useMemo(()=>{if(!i||!e)return null;let t=gn(o,s,a,e);return t===o.key?null:t},[]);if(!i||i.isSpaMode)return null;let l=((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&&i?.nonce&&(n.nonce=i.nonce),r.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${Mt(JSON.stringify(t||hn))}, ${Mt(JSON.stringify(c))})`}})}an.displayName=`ScrollRestoration`;function on(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sn(e){let t=r.useContext(M);return u(t,on(e)),t}function cn(e){let t=r.useContext(N);return u(t,on(e)),t}function ln(e,{target:t,replace:n,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=B(),f=z(),p=V(e,{relative:s});return r.useCallback(m=>{if(Ct(m,t)){m.preventDefault();let t=n===void 0?h(f)===h(p):n,g=()=>d(e,{replace:t,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?r.startTransition(()=>g()):g()}},[f,d,p,n,i,a,t,e,o,s,c,l,u])}function un(e){d(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=r.useRef(wt(e)),n=r.useRef(!1),i=z(),a=r.useMemo(()=>Tt(i.search,n.current?null:t.current),[i.search]),o=B();return[a,r.useCallback((e,t)=>{let r=wt(typeof e==`function`?e(new URLSearchParams(a)):e);n.current=!0,o(`?`+r,t)},[o,a])]}var dn=0,fn=()=>`__${String(++dn)}__`;function pn(){let{router:e}=sn(`useSubmit`),{basename:t}=r.useContext(P),n=at(),i=e.fetch,a=e.navigate;return r.useCallback(async(e,r={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=kt(e,t);if(r.navigate===!1){let e=r.fetcherKey||fn();await i(e,n,r.action||o,{defaultShouldRevalidate:r.defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:l,body:u,formMethod:r.method||s,formEncType:r.encType||c,flushSync:r.flushSync})}else await a(r.action||o,{defaultShouldRevalidate:r.defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:l,body:u,formMethod:r.method||s,formEncType:r.encType||c,replace:r.replace,state:r.state,fromRouteId:n,flushSync:r.flushSync,viewTransition:r.viewTransition})},[i,a,t,n])}function mn(e,{relative:t}={}){let{basename:n}=r.useContext(P),i=r.useContext(I);u(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...V(e||`.`,{relative:t})},s=z();if(e==null){o.search=s.search;let e=new URLSearchParams(o.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();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(o.pathname=o.pathname===`/`?n:A([n,o.pathname])),h(o)}var hn=`react-router-scroll-positions`,$={};function gn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:O(e.pathname,n)||e.pathname},t)),i??=e.key,i}function _n({getKey:e,storageKey:t}={}){let{router:n}=sn(`useScrollRestoration`),{restoreScrollPosition:i,preventScrollReset:a}=cn(`useScrollRestoration`),{basename:o}=r.useContext(P),s=z(),c=st(),l=ot();r.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),vn(r.useCallback(()=>{if(l.state===`idle`){let t=gn(s,c,o,e);$[t]=window.scrollY}try{sessionStorage.setItem(t||hn,JSON.stringify($))}catch(e){d(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,o,s,c,t])),typeof document<`u`&&(r.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||hn);e&&($=JSON.parse(e))}catch{}},[t]),r.useLayoutEffect(()=>{let t=n?.enableScrollRestoration($,()=>window.scrollY,e?(t,n)=>gn(t,n,o,e):void 0);return()=>t&&t()},[n,o,e]),r.useLayoutEffect(()=>{if(i!==!1){if(typeof i==`number`){window.scrollTo(0,i);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{d(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[s,i,a]))}function vn(e,t){let{capture:n}=t||{};r.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function yn(e,{relative:t}={}){let n=r.useContext(Me);u(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=sn(`useViewTransitionState`),a=V(e,{relative:t});if(!n.isTransitioning)return!1;let o=O(n.currentLocation.pathname,i)||n.currentLocation.pathname,s=O(n.nextLocation.pathname,i)||n.nextLocation.pathname;return D(a.pathname,s)!=null||D(a.pathname,o)!=null}export{mt as a,vt as c,R as d,z as f,un as g,qe as h,pt as i,D as l,Ve as m,tn as n,ht as o,B as p,nn as r,_t as s,$t as t,y as u};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r}from"./dist-BW234Kg5.js";import{a as i,i as a,n as o,r as s,t as c}from"./dist-C5mlVBmd.js";import{l,u}from"./es2015-CQth82uv.js";var d=e(t(),1),f=n(),p=`Collapsible`,[m,h]=a(p),[g,_]=m(p),v=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:o,onOpenChange:s,...u}=e,[m,h]=c({prop:r,defaultProp:a??!1,onChange:s,caller:p});return(0,f.jsx)(g,{scope:n,disabled:o,contentId:l(),open:m,onOpenToggle:d.useCallback(()=>h(e=>!e),[h]),children:(0,f.jsx)(i.div,{"data-state":w(m),"data-disabled":o?``:void 0,...u,ref:t})})});v.displayName=p;var y=`CollapsibleTrigger`,b=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,a=_(y,n);return(0,f.jsx)(i.button,{type:`button`,"aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":w(a.open),"data-disabled":a.disabled?``:void 0,disabled:a.disabled,...r,ref:t,onClick:s(e.onClick,a.onOpenToggle)})});b.displayName=y;var x=`CollapsibleContent`,S=d.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=_(x,e.__scopeCollapsible);return(0,f.jsx)(u,{present:n||i.open,children:({present:e})=>(0,f.jsx)(C,{...r,ref:t,present:e})})});S.displayName=x;var C=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:a,children:s,...c}=e,l=_(x,n),[u,p]=d.useState(a),m=d.useRef(null),h=r(t,m),g=d.useRef(0),v=g.current,y=d.useRef(0),b=y.current,S=l.open||u,C=d.useRef(S),T=d.useRef(void 0);return d.useEffect(()=>{let e=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(e)},[]),o(()=>{let e=m.current;if(e){T.current=T.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();g.current=t.height,y.current=t.width,C.current||(e.style.transitionDuration=T.current.transitionDuration,e.style.animationName=T.current.animationName),p(a)}},[l.open,a]),(0,f.jsx)(i.div,{"data-state":w(l.open),"data-disabled":l.disabled?``:void 0,id:l.contentId,hidden:!S,...c,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:S&&s})});function w(e){return e?`open`:`closed`}var T=v;function E({...e}){return(0,f.jsx)(T,{"data-slot":`collapsible`,...e})}function D({...e}){return(0,f.jsx)(b,{"data-slot":`collapsible-trigger`,...e})}function O({...e}){return(0,f.jsx)(S,{"data-slot":`collapsible-content`,...e})}export{O as n,D as r,E as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{r,t as i}from"./utils-DSMR_WLb.js";import{X as a}from"./design-icons-CzEoMH9c.js";import{i as o}from"./dist-BW234Kg5.js";import{a as s}from"./dist-C5mlVBmd.js";import{l as c}from"./es2015-CQth82uv.js";import{a as l,o as u,r as d,t as f}from"./dist-Da4ckcJG.js";import{i as p,o as m,r as h,s as g,t as _}from"./dialog-BVF6dIeS.js";var v=e(t(),1),y=1,b=.9,x=.8,S=.17,C=.1,w=.999,T=.9999,E=.99,D=/[\\\/_+.#"@\[\(\{&]/,O=/[\\\/_+.#"@\[\(\{&]/g,k=/[\s-]/,A=/[\s-]/g;function j(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?y:E;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=j(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=y:D.test(e.charAt(l-1))?(d*=x,p=e.slice(i,l-1).match(O),p&&i>0&&(d*=w**+p.length)):k.test(e.charAt(l-1))?(d*=b,m=e.slice(i,l-1).match(A),m&&i>0&&(d*=w**+m.length)):(d*=S,i>0&&(d*=w**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=T)),(d<C&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=j(e,t,n,r,l+1,a+2,o),f*C>d&&(d=f*C)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function M(e){return e.toLowerCase().replace(A,` `)}function N(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,j(e,t,M(e),M(t),0,0,{})}var P=`[cmdk-group=""]`,F=`[cmdk-group-items=""]`,ee=`[cmdk-group-heading=""]`,I=`[cmdk-item=""]`,L=`${I}:not([aria-disabled="true"])`,R=`cmdk-item-select`,z=`data-value`,te=(e,t,n)=>N(e,t,n),ne=v.createContext(void 0),B=()=>v.useContext(ne),re=v.createContext(void 0),V=()=>v.useContext(re),H=v.createContext(void 0),U=v.forwardRef((e,t)=>{let n=X(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=X(()=>new Set),i=X(()=>new Map),a=X(()=>new Map),o=X(()=>new Set),l=J(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:y=!0,...b}=e,x=c(),S=c(),C=c(),w=v.useRef(null),T=fe();Y(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,E.emit()}},[f]),Y(()=>{T(6,M)},[]);let E=v.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)j(),k(),T(1,A);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(C);e?e.focus():(i=document.getElementById(x))==null||i.focus()}if(T(7,()=>{n.current.selectedItemId=N()?.id,E.emit()}),r||T(5,M),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}E.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),D=v.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,O(t,r)),T(2,()=>{k(),E.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),T(3,()=>{j(),k(),n.current.value||A(),E.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=N();T(4,()=>{j(),t?.getAttribute(`id`)===e&&A(),E.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:x,inputId:C,labelId:S,listInnerRef:w}),[]);function O(e,t){let r=l.current?.filter??te;return e?r(e,n.current.search,t):0}function k(){if(!n.current.search||l.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=w.current;B().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(F);t?t.appendChild(e.parentElement===t?e:e.closest(`${F} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${F} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=w.current?.querySelector(`${P}[${z}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function A(){let e=B().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(z);E.setState(`value`,e||void 0)}function j(){if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=O(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function M(){var e;let t=N();t&&(t.parentElement?.firstChild===t&&((e=t.closest(P)?.querySelector(ee))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function N(){return w.current?.querySelector(`${I}[aria-selected="true"]`)}function B(){return Array.from(w.current?.querySelectorAll(L)||[])}function V(e){let t=B()[e];t&&E.setState(`value`,t.getAttribute(z))}function H(e){var t;let n=N(),r=B(),i=r.findIndex(e=>e===n),a=r[i+e];(t=l.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&E.setState(`value`,a.getAttribute(z))}function U(e){let t=N()?.closest(P),n;for(;t&&!n;)t=e>0?le(t,P):ue(t,P),n=t?.querySelector(L);n?E.setState(`value`,n.getAttribute(z)):H(e)}let W=()=>V(B().length-1),G=e=>{e.preventDefault(),e.metaKey?W():e.altKey?U(1):H(1)},K=e=>{e.preventDefault(),e.metaKey?V(0):e.altKey?U(-1):H(-1)};return v.createElement(s.div,{ref:t,tabIndex:-1,...b,"cmdk-root":``,onKeyDown:e=>{var t;(t=b.onKeyDown)==null||t.call(b,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:y&&e.ctrlKey&&G(e);break;case`ArrowDown`:G(e);break;case`p`:case`k`:y&&e.ctrlKey&&K(e);break;case`ArrowUp`:K(e);break;case`Home`:e.preventDefault(),V(0);break;case`End`:e.preventDefault(),W();break;case`Enter`:{e.preventDefault();let t=N();if(t){let e=new Event(R);t.dispatchEvent(e)}}}}},v.createElement(`label`,{"cmdk-label":``,htmlFor:D.inputId,id:D.labelId,style:me},u),Q(e,e=>v.createElement(re.Provider,{value:E},v.createElement(ne.Provider,{value:D},e))))}),W=v.forwardRef((e,t)=>{let n=c(),r=v.useRef(null),i=v.useContext(H),a=B(),l=J(e),u=l.current?.forceMount??i?.forceMount;Y(()=>{if(!u)return a.item(n,i?.id)},[u]);let d=de(n,r,[e.value,e.children,r],e.keywords),f=V(),p=Z(e=>e.value&&e.value===d.current),m=Z(e=>u||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);v.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(R,h),()=>t.removeEventListener(R,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=l.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:y,onSelect:b,forceMount:x,keywords:S,...C}=e;return v.createElement(s.div,{ref:o(r,t),...C,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||a.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),G=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,l=c(),u=v.useRef(null),d=v.useRef(null),f=c(),p=B(),m=Z(e=>i||p.filter()===!1?!0:!e.search||e.filtered.groups.has(l));Y(()=>p.group(l),[]),de(l,u,[e.value,e.heading,d]);let h=v.useMemo(()=>({id:l,forceMount:i}),[i]);return v.createElement(s.div,{ref:o(u,t),...a,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&v.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),Q(e,e=>v.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},v.createElement(H.Provider,{value:h},e))))}),K=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=v.useRef(null),a=Z(e=>!e.search);return!n&&!a?null:v.createElement(s.div,{ref:o(i,t),...r,"cmdk-separator":``,role:`separator`})}),ie=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=V(),o=Z(e=>e.search),c=Z(e=>e.selectedItemId),l=B();return v.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),v.createElement(s.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),ae=v.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=v.useRef(null),c=v.useRef(null),l=Z(e=>e.selectedItemId),u=B();return v.useEffect(()=>{if(c.current&&a.current){let e=c.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),v.createElement(s.div,{ref:o(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},Q(e,e=>v.createElement(`div`,{ref:o(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),oe=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return v.createElement(f,{open:n,onOpenChange:r},v.createElement(u,{container:o},v.createElement(l,{"cmdk-overlay":``,className:i}),v.createElement(d,{"aria-label":e.label,"cmdk-dialog":``,className:a},v.createElement(U,{ref:t,...s}))))}),se=v.forwardRef((e,t)=>Z(e=>e.filtered.count===0)?v.createElement(s.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),ce=v.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return v.createElement(s.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Q(e,e=>v.createElement(`div`,{"aria-hidden":!0},e)))}),q=Object.assign(U,{List:ae,Item:W,Input:ie,Group:G,Separator:K,Dialog:oe,Empty:se,Loading:ce});function le(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ue(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function J(e){let t=v.useRef(e);return Y(()=>{t.current=e}),t}var Y=typeof window>`u`?v.useEffect:v.useLayoutEffect;function X(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=V(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function de(e,t,n,r=[]){let i=v.useRef(),a=B();return Y(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(z,s),i.current=s}),i}var fe=()=>{let[e,t]=v.useState(),n=X(()=>new Map);return Y(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function pe(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Q({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(pe(t),{ref:t.ref},n(t.props.children)):n(t)}var me={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},$=n();function he({className:e,...t}){return(0,$.jsx)(q,{"data-slot":`command`,className:i(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function ge({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:a,showCloseButton:o=!0,filter:s,...c}){return(0,$.jsxs)(_,{...c,children:[(0,$.jsxs)(m,{className:`sr-only`,children:[(0,$.jsx)(g,{children:e}),(0,$.jsx)(p,{children:t})]}),(0,$.jsx)(h,{className:i(`overflow-hidden p-0`,a),showCloseButton:o,children:(0,$.jsx)(he,{...r({filter:s}),className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})})]})}function _e({className:e,...t}){return(0,$.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex min-h-11 shrink-0 items-center gap-2 rounded-ss-[inherit] rounded-se-[inherit] border-b px-3`,children:[(0,$.jsx)(a,{className:`size-4 shrink-0 opacity-50`}),(0,$.jsx)(q.Input,{"data-slot":`command-input`,className:i(`flex h-11 min-w-0 flex-1 rounded-md bg-transparent py-3 text-base md:text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function ve({className:e,onPointerMoveCapture:t,...n}){return(0,$.jsx)(q.List,{"data-slot":`command-list`,onPointerMoveCapture:e=>{t?.(e),e.pointerType===`touch`&&e.stopPropagation()},className:i(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...n})}function ye({...e}){return(0,$.jsx)(q.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function be({className:e,...t}){return(0,$.jsx)(q.Group,{"data-slot":`command-group`,className:i(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function xe({className:e,...t}){return(0,$.jsx)(q.Separator,{"data-slot":`command-separator`,className:i(`-mx-1 h-px bg-border`,e),...t})}function Se({className:e,...t}){return(0,$.jsx)(q.Item,{"data-slot":`command-item`,className:i(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function Ce({className:e,...t}){return(0,$.jsx)(`span`,{"data-slot":`command-shortcut`,className:i(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}export{_e as a,xe as c,be as i,Ce as l,ge as n,Se as o,ye as r,ve as s,he as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{i as r}from"./project-scope-context-BRvkKGX1.js";import{j as i,ot as a,r as o}from"./design-icons-CzEoMH9c.js";import{n as s}from"./diff-controls-BSWICnsb.js";import{u as c}from"./reference-chip-DGOmeh0l.js";import{t as l}from"./button-BQ2y4XRB.js";import{t as u}from"./project-router-UyyzK1j2.js";import{t as d}from"./centered-state-V15AR_qo.js";import{en as f,hn as p}from"./index-CRfojAQ1.js";import{t as m}from"./diff-D3RVmX07.js";var h=e(t(),1),g=n();function _({commit:e,sha:t,backTo:n,backLabel:_,slot:v,className:y,diffClassName:b}){let x=f(),[S,C]=(0,h.useState)(`unified`),[w,T]=(0,h.useState)(!1),E=e.isError&&e.error instanceof r&&e.error.status===409,D=x?S:`unified`,O=!x||w;return(0,g.jsxs)(`section`,{"data-slot":v,"data-sha":t,className:y,children:[(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,g.jsx)(l,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,g.jsxs)(u,{to:n,children:[(0,g.jsx)(o,{size:16,"aria-hidden":`true`}),_]})}),e.data?(0,g.jsx)(p,{stat:e.data.stat}):null,(0,g.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,g.jsx)(s,{mode:S,wrap:w,onModeChange:C,onWrapChange:T})})]}),e.isPending?(0,g.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):e.isError?(0,g.jsx)(d,{icon:E?(0,g.jsx)(c,{}):(0,g.jsx)(a,{size:16}),tone:E?`neutral`:`danger`,heading:`h2`,title:E?`Commit not found`:`Could not load the commit`,subtitle:e.error.message}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,g.jsx)(`h2`,{className:`text-sm font-semibold`,children:e.data.subject}),(0,g.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[e.data.author,` · `,e.data.when,` ·`,` `,(0,g.jsx)(`span`,{className:`font-mono select-all`,children:e.data.sha})]})]}),e.data.files.length===0?(0,g.jsx)(d,{icon:(0,g.jsx)(i,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,g.jsx)(`div`,{className:b,children:(0,g.jsx)(m,{files:e.data.files,mode:D,wrap:O,className:`min-w-0`})})]})]})}export{_ as t};
@@ -0,0 +1 @@
1
+ import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-DSMR_WLb.js";import{ft as r}from"./design-icons-CzEoMH9c.js";import{t as i}from"./button-BQ2y4XRB.js";import{a,i as o,n as s,o as c,r as l,s as u,t as d}from"./dist-Da4ckcJG.js";e();var f=t();function p({...e}){return(0,f.jsx)(d,{"data-slot":`dialog`,...e})}function m({...e}){return(0,f.jsx)(c,{"data-slot":`dialog-portal`,...e})}function h({className:e,...t}){return(0,f.jsx)(a,{"data-slot":`dialog-overlay`,className:n(`fixed inset-0 z-50 bg-black/50 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function g({className:e,children:t,showCloseButton:i=!0,overlayClassName:a,...o}){return(0,f.jsxs)(m,{"data-slot":`dialog-portal`,children:[(0,f.jsx)(h,{className:a}),(0,f.jsxs)(l,{"data-slot":`dialog-content`,className:n(`fixed inset-bs-[50%] start-[50%] z-50 grid max-h-[calc(100dvh-2rem)] overflow-y-auto overscroll-contain w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-hidden motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...o,children:[t,i&&(0,f.jsxs)(s,{"data-slot":`dialog-close`,className:`absolute inset-bs-4 end-4 rounded-sm opacity-70 ring-offset-background transition-opacity pointer-hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,f.jsx)(r,{}),(0,f.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function _({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`dialog-header`,className:n(`flex shrink-0 flex-col gap-2 text-center sm:text-start`,e),...t})}function v({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`dialog-body`,className:n(`min-h-0 min-w-0 overflow-y-auto overscroll-contain`,e),...t})}function y({className:e,showCloseButton:t=!1,children:r,...a}){return(0,f.jsxs)(`div`,{"data-slot":`dialog-footer`,className:n(`flex shrink-0 flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...a,children:[r,t&&(0,f.jsx)(s,{asChild:!0,children:(0,f.jsx)(i,{variant:`outline`,children:`Close`})})]})}function b({className:e,...t}){return(0,f.jsx)(u,{"data-slot":`dialog-title`,className:n(`text-lg leading-none font-semibold`,e),...t})}function x({className:e,...t}){return(0,f.jsx)(o,{"data-slot":`dialog-description`,className:n(`text-sm text-muted-foreground`,e),...t})}export{y as a,x as i,v as n,_ as o,g as r,b as s,p as t};
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-CYIMlq04.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-runtime-CCIEwYL0.js","assets/utils-DSMR_WLb.js","assets/bundle-mjs-rHxsej31.js","assets/chevron-right-BENZ-1ZN.js","assets/createLucideIcon-BHp8sXmF.js","assets/eye-B8okNWXU.js","assets/index-CRfojAQ1.js","assets/live-refetch-CZb2VOyu.js","assets/project-scope-context-BRvkKGX1.js","assets/live-protocol-D9ji1YCl.js","assets/useInfiniteQuery-rgb-nitU.js","assets/queries-CQWAcH8p.js","assets/useQuery-SVV6EtG7.js","assets/ws-D3-jE1IB.js","assets/toaster-Bo5vCbz-.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-Cg8l-LDN.js","assets/label-D6DhdNb7.js","assets/cez-idle-BY3rjM_y.js","assets/dist-C5mlVBmd.js","assets/dist-BW234Kg5.js","assets/tasks-table-lb5Dy-8O.js","assets/task-groups-Dc7pXgaS.js","assets/attention-BMiaqJnx.js","assets/runners-BFhbiSKy.js","assets/design-icons-CzEoMH9c.js","assets/open-in-menu-DgScIVvr.js","assets/bot-TkDIw4y-.js","assets/external-link-BE6y205O.js","assets/folder-o-AvL3y3.js","assets/smartphone-Lr8Ug2z_.js","assets/square-terminal-B6RYYieR.js","assets/button-BQ2y4XRB.js","assets/dropdown-menu-4e2iKSMT.js","assets/es2015-CQth82uv.js","assets/dist-BAoXdNsT.js","assets/dist-DXO3xwbC.js","assets/own-lookup-DS54wXvD.js","assets/dist-C28wFbz0.js","assets/chevron-down-CHGyCDBH.js","assets/nav-row-styles-DqKjMToI.js","assets/folder-browser-CH0gdxd-.js","assets/format-BNCkW110.js","assets/play-CmVAj_fu.js","assets/reference-chip-DGOmeh0l.js","assets/popover-BPgUYFyu.js","assets/dist-Da4ckcJG.js","assets/switch-Bv2Zf1uU.js","assets/badge-D9JrXe0o.js","assets/dialog-BVF6dIeS.js","assets/project-router-UyyzK1j2.js","assets/status-dot-DtAOFiIi.js","assets/command-CDt1BsZy.js","assets/project-order-AcHI4Dcl.js","assets/skills-pM_PouEs.js","assets/agents-settings-path-7X6_cvUg.js","assets/centered-state-V15AR_qo.js","assets/index-F-X4qZSv.css","assets/highlighter-DvLzHjjY.js","assets/image-preview-CNBuRrK5.js","assets/zoomable-image-CIQl1Wpe.js","assets/markdown-BBDDg-4t.js","assets/markdown-i80v6qNq.js","assets/chunk-BO2N2NFS-DQrpGzb-.js","assets/lib-DrPFkMXk.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{hn as a}from"./index-CRfojAQ1.js";import{n as o,t as s}from"./image-preview-CNBuRrK5.js";var c=e(t(),1),l=n();function u(e){let[t,n]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=!1;return i(()=>import(`./diff-view-CYIMlq04.js`).then(t=>{e||n({View:t.DiffView})},()=>{e||n(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66])),()=>{e=!0}},[]),e.files.length===0?(0,l.jsx)(`p`,{"data-slot":`diff-empty`,className:r(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):t===`failed`?(0,l.jsx)(d,{...e}):t===null?(0,l.jsx)(`p`,{"data-slot":`diff-loading`,className:r(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,l.jsx)(t.View,{...e})}function d({files:e,wrap:t=!1,imageSrc:n,onOpenInApp:i,viewRef:o,className:s}){let u={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},d=(0,c.useRef)(null);return(0,c.useImperativeHandle)(o,()=>({scrollToPath:e=>{for(let t of d.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,l.jsxs)(`div`,{ref:d,"data-slot":`diff`,"data-fallback":`true`,className:r(`flex min-w-0 flex-col gap-3`,s),children:[(0,l.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,l.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,l.jsx)(a,{stat:u})]}),e.map(e=>(0,l.jsx)(f,{file:e,wrap:t,imageSrc:n,onOpenInApp:i},`${e.oldPath??``}→${e.path}`))]})}function f({file:e,wrap:t,imageSrc:n,onOpenInApp:i}){return(0,l.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,l.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,l.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,l.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,l.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),o(e)?(0,l.jsx)(s,{file:e,imageSrc:n,onOpenInApp:i}):e.binary?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,l.jsx)(`pre`,{className:r(`py-2 font-mono text-xs leading-[1.7]`,t?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
3
+ `).map((e,t)=>(0,l.jsxs)(`span`,{className:r(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[e,e===``?` `:``]},t))})]})}export{u as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DSMR_WLb.js";import{A as n,_ as r}from"./design-icons-CzEoMH9c.js";import{t as i}from"./createLucideIcon-BHp8sXmF.js";import{t as a}from"./eye-B8okNWXU.js";import{t as o}from"./button-BQ2y4XRB.js";var s=i(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),c=i(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),l=e();function u({mode:e,wrap:n,onModeChange:r,onWrapChange:i}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`flex items-center gap-2`,children:[(0,l.jsx)(f,{current:e,value:`unified`,onModeChange:r}),(0,l.jsx)(f,{current:e,value:`split`,onModeChange:r})]}),(0,l.jsx)(o,{variant:`ghost`,size:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":n,"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:t(`size-11`,n&&`bg-muted text-foreground`),onClick:()=>i(!n),children:(0,l.jsx)(c,{"aria-hidden":`true`})})]})}function d({preview:e,onPreviewChange:n}){return(0,l.jsx)(o,{variant:`ghost`,size:`icon-sm`,"data-slot":`markdown-preview-toggle`,"aria-pressed":e,"aria-label":`Preview Markdown`,title:e?`Show Markdown as a diff`:`Preview Markdown`,className:t(`size-11`,e&&`bg-muted text-foreground`),onClick:()=>n(!e),children:(0,l.jsx)(a,{"aria-hidden":`true`})})}function f({current:e,value:n,onModeChange:i}){let a=e===n;return(0,l.jsxs)(`button`,{type:`button`,"data-mode":n,"aria-pressed":a,onClick:()=>i(n),className:t(`inline-flex items-center gap-2 min-h-11 rounded-lg border border-border bg-card px-3 text-xs font-medium capitalize`,a?`border-accent-text/40 text-accent-text`:`text-muted-foreground hover:text-foreground`),children:[n===`unified`?(0,l.jsx)(s,{"aria-hidden":`true`,className:`size-4`}):(0,l.jsx)(r,{size:16,"aria-hidden":`true`,className:`size-4`}),n]})}function p({branch:e}){return(0,l.jsxs)(`span`,{"data-slot":`branch-chip`,className:`flex min-w-0 items-center gap-1 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium`,children:[(0,l.jsx)(n,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,l.jsx)(`span`,{className:`truncate`,children:e})]})}export{u as n,d as r,p as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{l as r}from"./button-C1fD-ZFr.js";import{t as i}from"./eye-B8okNWXU.js";import{G as a,K as o,Mt as s,hn as c,q as l,s as u}from"./index-C3pMUosD.js";import{n as d,t as f}from"./image-preview-2AnVvt0e.js";import{n as p,t as m}from"./markdown-BBDDg-4t.js";import{t as h}from"./markdown-OTuqNLUj.js";var g=e(t(),1),_=44;function v(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{t as i}from"./chevron-right-BENZ-1ZN.js";import{t as a}from"./eye-B8okNWXU.js";import{hn as o,s}from"./index-CRfojAQ1.js";import{a as c,i as l,r as u}from"./highlighter-DvLzHjjY.js";import{n as d,t as f}from"./image-preview-CNBuRrK5.js";import{n as p,t as m}from"./markdown-BBDDg-4t.js";import{t as h}from"./markdown-i80v6qNq.js";var g=e(t(),1),_=44;function v(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
2
2
  `),n=t.findIndex(e=>e.startsWith(`@@`));return n===-1?t.length:t.length-n}function y(e){return v(e)*20+_}function b(e){return e.reduce((e,t)=>e+v(t),0)}function x(e,t){let n=new URLSearchParams(e).get(`diff`);return n===`flat`||n===`virtual`?n:t>1500?`virtual`:`flat`}function S(e){return`${e.oldPath??``}→${e.path}`}function C(e){let t=0;for(let n of e.split(`
3
3
  `))n.length>t&&(t=n.length);return t}var w=/[A-Za-z0-9_]+|\s+|[^\sA-Za-z0-9_]+/g,T=300,E=.3;function D(e,t){if(e===t)return null;let n=e.match(w)??[],r=t.match(w)??[];if(n.length===0||r.length===0||n.length>T||r.length>T)return null;let i=O(n,r),a=r.length+1;return(i[n.length*a+r.length]??0)/Math.max(n.length,r.length)<E?null:k(n,r,i)}function O(e,t){let n=t.length+1,r=new Uint16Array((e.length+1)*n);for(let i=1;i<=e.length;i++)for(let a=1;a<=t.length;a++)r[i*n+a]=e[i-1]===t[a-1]?(r[(i-1)*n+(a-1)]??0)+1:Math.max(r[(i-1)*n+a]??0,r[i*n+(a-1)]??0);return r}function k(e,t,n){let r=t.length+1,i=Array.from({length:e.length},()=>!1),a=Array.from({length:t.length},()=>!1),o=e.length,s=t.length;for(;o>0&&s>0;)e[o-1]===t[s-1]?(i[o-1]=!0,a[s-1]=!0,o--,s--):(n[(o-1)*r+s]??0)>=(n[o*r+(s-1)]??0)?o--:s--;return{del:A(e,i),add:A(t,a)}}function A(e,t){let n=[];return e.forEach((e,r)=>{let i=!(t[r]??!1),a=n[n.length-1];a&&a.changed===i?a.text+=e:n.push({text:e,changed:i})}),n}function j(e,t,n){if(!t||t.length===0)return e?e.map(e=>({text:e.content,color:e.color,changed:!1})):n===``?[]:[{text:n,changed:!1}];if(!e||e.length===0)return t.map(e=>({text:e.text,changed:e.changed}));let r=[],i=0,a=0,o=0,s=0;for(;i<e.length&&o<t.length;){let n=e[i],c=t[o],l=n.content.length-a,u=c.text.length-s,d=Math.min(l,u);d>0&&(r.push({text:n.content.slice(a,a+d),color:n.color,changed:c.changed}),a+=d,s+=d),n.content.length-a<=0&&(i++,a=0),c.text.length-s<=0&&(o++,s=0)}for(;i<e.length;){let t=e[i],n=t.content.slice(a);n!==``&&r.push({text:n,color:t.color,changed:!1}),i++,a=0}return r}var M=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,N=`… (patch truncated)`;function P(e){let t=[],n=!1,r=null,i=0,a=0,o=e.split(`
4
4
  `);o.at(-1)===``&&o.pop();for(let e of o){let o=M.exec(e);if(o){r={header:e,oldStart:Number(o[1]),oldCount:o[2]===void 0?1:Number(o[2]),newStart:Number(o[3]),newCount:o[4]===void 0?1:Number(o[4]),lines:[]},i=r.oldStart,a=r.newStart,t.push(r);continue}if(e.includes(N)){n=!0,r=null;continue}r&&(e.startsWith(`+`)?r.lines.push({kind:`add`,text:e.slice(1),newLine:a++}):e.startsWith(`-`)?r.lines.push({kind:`del`,text:e.slice(1),oldLine:i++}):e.startsWith(`\\`)||r.lines.push({kind:`context`,text:e.slice(1),oldLine:i++,newLine:a++}))}return{hunks:t,truncated:n}}function F(e,t=!1){let n=[],r=e[0];if(!r)return n;r.newStart>1&&n.push({beforeHunk:0,count:r.newStart-1,oldStart:1,newStart:1});for(let t=1;t<e.length;t++){let r=e[t-1],i=e[t],a=r.oldStart+r.oldCount,o=r.newStart+r.newCount,s=i.newStart-o;s>0&&n.push({beforeHunk:t,count:s,oldStart:a,newStart:o})}if(t){let t=e[e.length-1];n.push({beforeHunk:e.length,oldStart:t.oldStart+t.oldCount,newStart:t.newStart+t.newCount})}return n}function I(e,t){let n=e.count===void 0?t.length:e.newStart+e.count-1,r=e.oldStart-e.newStart,i=[];for(let a=e.newStart;a<=Math.min(n,t.length);a++)i.push({kind:`context`,text:t[a-1]??``,oldLine:a+r,newLine:a});return i}function L(e,t){let n=Array.from({length:e.length}),r=Array.from({length:t.length}),i=Math.min(e.length,t.length);for(let a=0;a<i;a++){let i=D(e[a].text,t[a].text);i&&(n[a]=i.del,r[a]=i.add)}return{dels:e,adds:t,delSpans:n,addSpans:r}}function R(e,t,n){let r=0;for(;r<e.lines.length;){let i=e.lines[r];if(i.kind===`del`||i.kind===`add`){let t=[],i=[];for(;r<e.lines.length&&e.lines[r].kind===`del`;)t.push(e.lines[r++]);for(;r<e.lines.length&&e.lines[r].kind===`add`;)i.push(e.lines[r++]);n(L(t,i))}else t(i),r++}}function z(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`line`,cell:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),R(e,e=>i.push({type:`line`,cell:{line:e}}),e=>{e.dels.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.delSpans[n]}})),e.adds.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.addSpans[n]}}))})}),a(e.length),i}function B(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`pair`,left:{line:e},right:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),R(e,e=>i.push({type:`pair`,left:{line:e},right:{line:e}}),e=>{let t=Math.max(e.dels.length,e.adds.length);for(let n=0;n<t;n++){let t=e.dels[n],r=e.adds[n];i.push({type:`pair`,...t?{left:{line:t,spans:e.delSpans[n]}}:{},...r?{right:{line:r,spans:e.addSpans[n]}}:{}})}})}),a(e.length),i}var V=n();function H({file:e,loadFileText:t,imageSrc:n}){let r=(0,g.useMemo)(()=>U(e),[e]),i=(0,g.useRef)(t);i.current=t;let a=(0,g.useRef)(n);a.current=n;let o=t!==void 0,[s,c]=(0,g.useState)(null);(0,g.useEffect)(()=>{let t=i.current;if(!t)return;let n=!1;return t(e.path).then(t=>!n&&c({path:e.path,text:t}),()=>!n&&c({path:e.path,text:null})),()=>{n=!0}},[e.path,e.patch,o]);let l=(0,g.useCallback)(t=>{let n=a.current,r=n?p(e.path,t):null;return r===null||!n?null:n(r)},[e.path]),u=s?.path===e.path?s:null;if(o&&u===null)return(0,V.jsx)(`p`,{role:`status`,className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Loading preview…`});let d=u?.text??null;if(d===null&&r.text===``)return(0,V.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes to preview.`});let f=d!==null||r.complete?null:o?`The full file could not be loaded. Showing the changed sections only.`:`Showing the changed sections only.`;return(0,V.jsx)(`div`,{"data-slot":`diff-markdown-preview`,className:`px-4 py-5 md:px-6`,children:(0,V.jsxs)(`div`,{className:`mx-auto max-w-[72ch]`,children:[f?(0,V.jsx)(`p`,{className:`mb-4 text-xs text-soft-foreground`,children:f}):null,(0,V.jsx)(h,{document:!0,imageSrc:l,children:d??r.text})]})})}function U(e){let t=P(e.patch);return{text:t.hunks.map(e=>e.lines.filter(e=>e.kind!==`del`).map(e=>e.text).join(`
@@ -6,6 +6,6 @@ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./r
6
6
 
7
7
  ---
8
8
 
9
- `),complete:e.status===`added`&&!t.truncated}}var W=1500,G=new Map;function ee(e,t){if(e){for(let n of e.querySelectorAll(`[data-slot="diff-file"]`))if(n.dataset.path===t)return n}}function te({files:e,mode:t=`unified`,wrap:n=!1,preview:i,loadFileText:a,imageSrc:o,onOpenInApp:c,viewRef:l,className:u}){let d=(0,g.useMemo)(()=>({adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length}),[e]),[f,p]=(0,g.useState)(()=>new Set),[h,_]=(0,g.useState)(()=>new Map),[v,C]=(0,g.useState)(()=>new Map),[w,T]=(0,g.useState)(i);w!==i&&(T(i),C(new Map));let E=(0,g.useCallback)((e,t)=>{C(n=>new Map(n).set(e,t))},[]),D=(0,g.useCallback)(e=>{p(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),O=(0,g.useCallback)(async(e,t)=>{if(!a)return;let n=await a(e.path);if(n===null)return;let r=I(t,n.split(`
10
- `));_(n=>{let i=S(e);return new Map(n).set(i,new Map(n.get(i)??G).set(t.beforeHunk,r))})},[a]),k=(0,g.useMemo)(()=>b(e),[e]),[A]=(0,g.useState)(()=>typeof window>`u`?``:window.location.search),j=x(A,k),M=(0,g.useRef)(null),N=(0,g.useRef)(null),P=(0,g.useRef)(null);(0,g.useImperativeHandle)(l,()=>({scrollToPath:t=>{let n=e.findIndex(e=>e.path===t);if(n===-1)return;let r=N.current;r?r.scrollToIndex(n,{align:`start`}):ee(P.current,t)?.scrollIntoView({block:`start`,behavior:`smooth`})}}),[e]);let F=e=>{let r=S(e),s=i!==void 0&&m(e),l=s&&(v.get(r)??i);return(0,V.jsx)(ie,{file:e,open:!f.has(r),onToggle:()=>D(r),preview:l,onPreviewChange:s?e=>E(r,e):void 0,loadFileText:a,expanded:h.get(r)??G,onExpand:t=>void O(e,t),mode:t,wrap:n,canExpand:a!==void 0,imageSrc:o,onOpenInApp:c})};return(0,V.jsxs)(`div`,{ref:e=>{P.current=e,e&&(M.current=e.closest(`[data-slot="main"]`))},"data-slot":`diff`,"data-mode":t,className:r(`flex min-w-0 flex-col`,u),children:[(0,V.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 pb-3 text-xs text-muted-foreground`,children:[(0,V.jsxs)(`span`,{children:[d.files,` `,d.files===1?`file`:`files`,` changed`]}),(0,V.jsx)(s,{stat:d})]}),j===`virtual`?(0,V.jsx)(ne,{files:e,handleRef:N,scrollElRef:M,card:F}):(0,V.jsx)(`div`,{"data-slot":`diff-files`,"data-virtualized":`false`,children:e.map(e=>(0,V.jsx)(`div`,{"data-slot":`diff-file-slot`,style:{containIntrinsicBlockSize:`auto ${y(e)}px`},className:`pb-3 [content-visibility:auto]`,children:F(e)},S(e)))})]})}function ne({files:e,handleRef:t,scrollElRef:n,card:r}){let i=(0,g.useRef)(null),[a,o]=(0,g.useState)(0);return(0,g.useLayoutEffect)(()=>{let e=()=>{let e=i.current,t=n.current;!e||!t||o(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[n]),(0,V.jsx)(`div`,{ref:e=>{i.current=e,e&&(n.current=e.closest(`[data-slot="main"]`))},"data-slot":`diff-files`,"data-virtualized":`true`,children:(0,V.jsx)(u,{ref:t,scrollRef:n,startMargin:a,children:e.map(e=>(0,V.jsx)(`div`,{"data-slot":`diff-file-slot`,className:`pb-3`,children:r(e)},S(e)))})})}var re={added:`added`,deleted:`deleted`,renamed:`renamed`,copied:`copied`};function ie({file:e,open:t,onToggle:n,expanded:a,onExpand:o,mode:l,wrap:u,preview:d,onPreviewChange:f,loadFileText:p,canExpand:m,imageSrc:h,onOpenInApp:g}){let _=re[e.status];return(0,V.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,V.jsxs)(`header`,{className:`sticky top-[var(--diff-sticky-top,0px)] z-10 flex items-center rounded-t-md border-b border-border/50 bg-card`,children:[(0,V.jsxs)(`button`,{type:`button`,"data-slot":`diff-file-header`,"aria-expanded":t,onClick:n,className:`flex min-w-0 flex-1 items-center gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,V.jsx)(c,{className:r(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),(0,V.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{className:`text-soft-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),_?(0,V.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:_}):null,e.image?(0,V.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:`image`}):e.binary?(0,V.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:`binary`}):null,(0,V.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,V.jsx)(s,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),f?(0,V.jsxs)(`button`,{type:`button`,"data-slot":`diff-file-preview-toggle`,"aria-pressed":d,"aria-label":`Preview ${e.path} as a document`,title:d?`Show this file as a diff`:`Preview this file as a document`,onClick:()=>f(!d),className:r(`mr-1.5 inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-[12px] font-medium max-md:h-11 max-md:px-3 pointer-coarse:h-11 pointer-coarse:px-3`,`focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring`,d?`bg-muted text-foreground`:`text-soft-foreground hover:bg-muted/50 hover:text-foreground`),children:[(0,V.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),`Preview`]}):null]}),t&&d?(0,V.jsx)(H,{file:e,loadFileText:p,imageSrc:h}):t?(0,V.jsx)(ae,{file:e,expanded:a,onExpand:o,mode:l,wrap:u,canExpand:m,imageSrc:h,onOpenInApp:g}):null]})}function ae({file:e,expanded:t,onExpand:n,mode:i,wrap:a,canExpand:o,imageSrc:s,onOpenInApp:c}){let l=(0,g.useMemo)(()=>P(e.patch),[e.patch]),u=o&&e.status!==`added`&&e.status!==`deleted`,p=(0,g.useMemo)(()=>F(l.hunks,u),[l.hunks,u]),m=(0,g.useMemo)(()=>{let e=[];l.hunks.forEach((n,r)=>{let i=t.get(r);i&&e.push(...i),e.push(...n.lines)});let n=t.get(l.hunks.length);return n&&e.push(...n),e},[l.hunks,t]),h=(0,g.useMemo)(()=>new Map(m.map((e,t)=>[e,t])),[m]),_=oe(e.path,m),v=(0,g.useMemo)(()=>i===`unified`?z(l.hunks,p,t):null,[i,l.hunks,p,t]),y=(0,g.useMemo)(()=>i===`split`?B(l.hunks,p,t):null,[i,l.hunks,p,t]),b=(0,g.useMemo)(()=>i===`unified`&&!a?{minInlineSize:`calc(${C(e.patch)}ch + 7rem)`}:void 0,[i,a,e.patch]);if(d(e))return(0,V.jsx)(f,{file:e,imageSrc:s,onOpenInApp:c});if(e.binary)return(0,V.jsx)(K,{children:`Binary file — no text diff.`});if(l.hunks.length===0)return(0,V.jsx)(K,{children:l.truncated?`Patch truncated by the server.`:`No content changes (metadata only).`});let x=e=>{if(!_)return null;let t=h.get(e);return t===void 0?null:_[t]??null};return(0,V.jsxs)(`div`,{"data-slot":`diff-file-body`,"data-wrap":a||void 0,className:r(`py-1 font-mono text-xs leading-[1.7]`,!a&&`overflow-x-auto`),children:[(0,V.jsxs)(`div`,{"data-slot":`diff-rows`,style:b,className:`[&>*]:[contain-intrinsic-block-size:auto_20px] [&>*]:[content-visibility:auto]`,children:[v?v.map((e,t)=>(0,V.jsx)(se,{row:e,wrap:a,tokensFor:x,onExpand:u?n:void 0},t)):null,y?y.map((e,t)=>(0,V.jsx)(ce,{row:e,wrap:a,tokensFor:x,onExpand:u?n:void 0},t)):null]}),l.truncated?(0,V.jsx)(K,{children:`Patch truncated by the server — counts above remain exact.`}):null]})}function oe(e,t){let n=(0,g.useMemo)(()=>t.length>W?null:t.map(e=>e.text).join(`
11
- `),[t]),r=(0,g.useMemo)(()=>l(e),[e]),[i,s]=(0,g.useState)(null);return(0,g.useEffect)(()=>{if(n===null||r===null)return;let e=!1;return a(n,r).then(t=>{e||s({text:n,tokens:t.tokens})}),()=>{e=!0}},[n,r]),n===null||r===null?null:i?.text===n?i.tokens:o(n,r)?.tokens??null}function K({children:e}){return(0,V.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:e})}var q={add:`bg-diff-add`,del:`bg-diff-del`,context:void 0},J={add:`+`,del:`−`,context:` `};function Y({hunk:e}){return(0,V.jsx)(`div`,{"data-slot":`diff-hunk`,className:`bg-muted/40 px-4 py-0.5 whitespace-pre text-soft-foreground`,children:e.header})}function X({gap:e,onExpand:t}){let n=e.count===void 0?`⋯ unchanged lines to end of file`:`⋯ ${e.count} unchanged ${e.count===1?`line`:`lines`}`;return t?(0,V.jsxs)(`button`,{type:`button`,"data-slot":`diff-gap`,onClick:()=>t(e),className:`block w-full border-y border-border/40 bg-muted/20 px-4 py-0.5 text-left text-[11px] text-soft-foreground hover:bg-muted/50 hover:text-foreground`,children:[n,` — expand`]}):(0,V.jsx)(`div`,{"data-slot":`diff-gap`,className:`border-y border-border/40 bg-muted/20 px-4 py-0.5 text-[11px] text-soft-foreground`,children:n})}function Z({cell:e,tokens:t,wrap:n}){let i=j(t,e.spans,e.line.text),a=e.line.kind===`add`?`bg-diff-add-strong`:`bg-diff-del-strong`;return(0,V.jsxs)(`span`,{className:r(`min-w-0 flex-1 pr-4`,n?`break-words whitespace-pre-wrap`:`whitespace-pre`),children:[i.map((t,n)=>(0,V.jsx)(`span`,{"data-word":t.changed?e.line.kind:void 0,style:t.color===void 0?void 0:{color:t.color},className:t.changed?r(`rounded-[2px]`,a):void 0,children:t.text},n)),e.line.text===``?` `:``]})}function Q({value:e}){return(0,V.jsx)(`span`,{className:`w-10 shrink-0 pr-2 text-right text-soft-foreground/70 tabular-nums select-none`,children:e??``})}function se({row:e,wrap:t,tokensFor:n,onExpand:i}){if(e.type===`hunk`)return(0,V.jsx)(Y,{hunk:e.hunk});if(e.type===`gap`)return(0,V.jsx)(X,{gap:e.gap,onExpand:i});let{line:a}=e.cell;return(0,V.jsxs)(`div`,{"data-slot":`diff-line`,"data-line":a.kind,className:r(`flex`,q[a.kind]),children:[(0,V.jsx)(Q,{value:a.oldLine}),(0,V.jsx)(Q,{value:a.newLine}),(0,V.jsx)(`span`,{className:`w-4 shrink-0 text-soft-foreground select-none`,children:J[a.kind]}),(0,V.jsx)(Z,{cell:e.cell,tokens:n(a),wrap:t})]})}function ce({row:e,wrap:t,tokensFor:n,onExpand:r}){return e.type===`hunk`?(0,V.jsx)(Y,{hunk:e.hunk}):e.type===`gap`?(0,V.jsx)(X,{gap:e.gap,onExpand:r}):(0,V.jsxs)(`div`,{"data-slot":`diff-pair`,className:`grid grid-cols-2`,children:[(0,V.jsx)($,{cell:e.left,side:`old`,tokensFor:n,wrap:t}),(0,V.jsx)($,{cell:e.right,side:`new`,tokensFor:n,wrap:t})]})}function $({cell:e,side:t,tokensFor:n,wrap:i}){if(!e)return(0,V.jsx)(`div`,{"data-slot":`diff-cell-empty`,className:r(`bg-muted/20`,t===`new`&&`border-l border-border/40`)});let{line:a}=e;return(0,V.jsxs)(`div`,{"data-slot":`diff-cell`,"data-line":a.kind,className:r(`flex min-w-0 overflow-x-auto`,q[a.kind],t===`new`&&`border-l border-border/40`),children:[(0,V.jsx)(Q,{value:t===`old`?a.oldLine:a.newLine}),(0,V.jsx)(`span`,{className:`w-4 shrink-0 text-soft-foreground select-none`,children:J[a.kind]}),(0,V.jsx)(Z,{cell:e,tokens:n(a),wrap:i})]})}export{te as DiffView};
9
+ `),complete:e.status===`added`&&!t.truncated}}var W=1500,G=new Map;function ee(e,t){if(e){for(let n of e.querySelectorAll(`[data-slot="diff-file"]`))if(n.dataset.path===t)return n}}function te({files:e,mode:t=`unified`,wrap:n=!1,preview:i,loadFileText:a,imageSrc:s,onOpenInApp:c,viewRef:l,className:u}){let d=(0,g.useMemo)(()=>({adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length}),[e]),[f,p]=(0,g.useState)(()=>new Set),[h,_]=(0,g.useState)(()=>new Map),[v,C]=(0,g.useState)(()=>new Map),[w,T]=(0,g.useState)(i);w!==i&&(T(i),C(new Map));let E=(0,g.useCallback)((e,t)=>{C(n=>new Map(n).set(e,t))},[]),D=(0,g.useCallback)(e=>{p(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),O=(0,g.useCallback)(async(e,t)=>{if(!a)return;let n=await a(e.path);if(n===null)return;let r=I(t,n.split(`
10
+ `));_(n=>{let i=S(e);return new Map(n).set(i,new Map(n.get(i)??G).set(t.beforeHunk,r))})},[a]),k=(0,g.useMemo)(()=>b(e),[e]),[A]=(0,g.useState)(()=>typeof window>`u`?``:window.location.search),j=x(A,k),M=(0,g.useRef)(null),N=(0,g.useRef)(null),P=(0,g.useRef)(null);(0,g.useImperativeHandle)(l,()=>({scrollToPath:t=>{let n=e.findIndex(e=>e.path===t);if(n===-1)return;let r=N.current;r?r.scrollToIndex(n,{align:`start`}):ee(P.current,t)?.scrollIntoView({block:`start`,behavior:`smooth`})}}),[e]);let F=e=>{let r=S(e),o=i!==void 0&&m(e),l=o&&(v.get(r)??i);return(0,V.jsx)(ie,{file:e,open:!f.has(r),onToggle:()=>D(r),preview:l,onPreviewChange:o?e=>E(r,e):void 0,loadFileText:a,expanded:h.get(r)??G,onExpand:t=>void O(e,t),mode:t,wrap:n,canExpand:a!==void 0,imageSrc:s,onOpenInApp:c})};return(0,V.jsxs)(`div`,{ref:e=>{P.current=e,e&&(M.current=e.closest(`[data-slot="main"]`))},"data-slot":`diff`,"data-mode":t,className:r(`flex min-w-0 flex-col`,u),children:[(0,V.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 pb-3 text-xs text-muted-foreground`,children:[(0,V.jsxs)(`span`,{children:[d.files,` `,d.files===1?`file`:`files`,` changed`]}),(0,V.jsx)(o,{stat:d})]}),j===`virtual`?(0,V.jsx)(ne,{files:e,handleRef:N,scrollElRef:M,card:F}):(0,V.jsx)(`div`,{"data-slot":`diff-files`,"data-virtualized":`false`,children:e.map(e=>(0,V.jsx)(`div`,{"data-slot":`diff-file-slot`,style:{containIntrinsicBlockSize:`auto ${y(e)}px`},className:`pb-3 [content-visibility:auto]`,children:F(e)},S(e)))})]})}function ne({files:e,handleRef:t,scrollElRef:n,card:r}){let i=(0,g.useRef)(null),[a,o]=(0,g.useState)(0);return(0,g.useLayoutEffect)(()=>{let e=()=>{let e=i.current,t=n.current;!e||!t||o(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[n]),(0,V.jsx)(`div`,{ref:e=>{i.current=e,e&&(n.current=e.closest(`[data-slot="main"]`))},"data-slot":`diff-files`,"data-virtualized":`true`,children:(0,V.jsx)(s,{ref:t,scrollRef:n,startMargin:a,children:e.map(e=>(0,V.jsx)(`div`,{"data-slot":`diff-file-slot`,className:`pb-3`,children:r(e)},S(e)))})})}var re={added:`added`,deleted:`deleted`,renamed:`renamed`,copied:`copied`};function ie({file:e,open:t,onToggle:n,expanded:s,onExpand:c,mode:l,wrap:u,preview:d,onPreviewChange:f,loadFileText:p,canExpand:m,imageSrc:h,onOpenInApp:g}){let _=re[e.status];return(0,V.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,V.jsxs)(`header`,{className:`sticky top-[var(--diff-sticky-top,0px)] z-10 flex items-center rounded-t-md border-b border-border/50 bg-card`,children:[(0,V.jsxs)(`button`,{type:`button`,"data-slot":`diff-file-header`,"aria-expanded":t,onClick:n,className:`flex min-w-0 flex-1 items-center gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,V.jsx)(i,{className:r(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),(0,V.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{className:`text-soft-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),_?(0,V.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:_}):null,e.image?(0,V.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:`image`}):e.binary?(0,V.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:`binary`}):null,(0,V.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,V.jsx)(o,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),f?(0,V.jsxs)(`button`,{type:`button`,"data-slot":`diff-file-preview-toggle`,"aria-pressed":d,"aria-label":`Preview ${e.path} as a document`,title:d?`Show this file as a diff`:`Preview this file as a document`,onClick:()=>f(!d),className:r(`mr-1.5 inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-[12px] font-medium max-md:h-11 max-md:px-3 pointer-coarse:h-11 pointer-coarse:px-3`,`focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring`,d?`bg-muted text-foreground`:`text-soft-foreground hover:bg-muted/50 hover:text-foreground`),children:[(0,V.jsx)(a,{"aria-hidden":`true`,className:`size-3.5`}),`Preview`]}):null]}),t&&d?(0,V.jsx)(H,{file:e,loadFileText:p,imageSrc:h}):t?(0,V.jsx)(ae,{file:e,expanded:s,onExpand:c,mode:l,wrap:u,canExpand:m,imageSrc:h,onOpenInApp:g}):null]})}function ae({file:e,expanded:t,onExpand:n,mode:i,wrap:a,canExpand:o,imageSrc:s,onOpenInApp:c}){let l=(0,g.useMemo)(()=>P(e.patch),[e.patch]),u=o&&e.status!==`added`&&e.status!==`deleted`,p=(0,g.useMemo)(()=>F(l.hunks,u),[l.hunks,u]),m=(0,g.useMemo)(()=>{let e=[];l.hunks.forEach((n,r)=>{let i=t.get(r);i&&e.push(...i),e.push(...n.lines)});let n=t.get(l.hunks.length);return n&&e.push(...n),e},[l.hunks,t]),h=(0,g.useMemo)(()=>new Map(m.map((e,t)=>[e,t])),[m]),_=oe(e.path,m),v=(0,g.useMemo)(()=>i===`unified`?z(l.hunks,p,t):null,[i,l.hunks,p,t]),y=(0,g.useMemo)(()=>i===`split`?B(l.hunks,p,t):null,[i,l.hunks,p,t]),b=(0,g.useMemo)(()=>i===`unified`&&!a?{minInlineSize:`calc(${C(e.patch)}ch + 7rem)`}:void 0,[i,a,e.patch]);if(d(e))return(0,V.jsx)(f,{file:e,imageSrc:s,onOpenInApp:c});if(e.binary)return(0,V.jsx)(K,{children:`Binary file — no text diff.`});if(l.hunks.length===0)return(0,V.jsx)(K,{children:l.truncated?`Patch truncated by the server.`:`No content changes (metadata only).`});let x=e=>{if(!_)return null;let t=h.get(e);return t===void 0?null:_[t]??null};return(0,V.jsxs)(`div`,{"data-slot":`diff-file-body`,"data-wrap":a||void 0,className:r(`py-1 font-mono text-xs leading-[1.7]`,!a&&`overflow-x-auto`),children:[(0,V.jsxs)(`div`,{"data-slot":`diff-rows`,style:b,className:`[&>*]:[contain-intrinsic-block-size:auto_20px] [&>*]:[content-visibility:auto]`,children:[v?v.map((e,t)=>(0,V.jsx)(se,{row:e,wrap:a,tokensFor:x,onExpand:u?n:void 0},t)):null,y?y.map((e,t)=>(0,V.jsx)(ce,{row:e,wrap:a,tokensFor:x,onExpand:u?n:void 0},t)):null]}),l.truncated?(0,V.jsx)(K,{children:`Patch truncated by the server — counts above remain exact.`}):null]})}function oe(e,t){let n=(0,g.useMemo)(()=>t.length>W?null:t.map(e=>e.text).join(`
11
+ `),[t]),r=(0,g.useMemo)(()=>c(e),[e]),[i,a]=(0,g.useState)(null);return(0,g.useEffect)(()=>{if(n===null||r===null)return;let e=!1;return u(n,r).then(t=>{e||a({text:n,tokens:t.tokens})}),()=>{e=!0}},[n,r]),n===null||r===null?null:i?.text===n?i.tokens:l(n,r)?.tokens??null}function K({children:e}){return(0,V.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:e})}var q={add:`bg-diff-add`,del:`bg-diff-del`,context:void 0},J={add:`+`,del:`−`,context:` `};function Y({hunk:e}){return(0,V.jsx)(`div`,{"data-slot":`diff-hunk`,className:`bg-muted/40 px-4 py-0.5 whitespace-pre text-soft-foreground`,children:e.header})}function X({gap:e,onExpand:t}){let n=e.count===void 0?`⋯ unchanged lines to end of file`:`⋯ ${e.count} unchanged ${e.count===1?`line`:`lines`}`;return t?(0,V.jsxs)(`button`,{type:`button`,"data-slot":`diff-gap`,onClick:()=>t(e),className:`block w-full border-y border-border/40 bg-muted/20 px-4 py-0.5 text-left text-[11px] text-soft-foreground hover:bg-muted/50 hover:text-foreground`,children:[n,` — expand`]}):(0,V.jsx)(`div`,{"data-slot":`diff-gap`,className:`border-y border-border/40 bg-muted/20 px-4 py-0.5 text-[11px] text-soft-foreground`,children:n})}function Z({cell:e,tokens:t,wrap:n}){let i=j(t,e.spans,e.line.text),a=e.line.kind===`add`?`bg-diff-add-strong`:`bg-diff-del-strong`;return(0,V.jsxs)(`span`,{className:r(`min-w-0 flex-1 pr-4`,n?`break-words whitespace-pre-wrap`:`whitespace-pre`),children:[i.map((t,n)=>(0,V.jsx)(`span`,{"data-word":t.changed?e.line.kind:void 0,style:t.color===void 0?void 0:{color:t.color},className:t.changed?r(`rounded-[2px]`,a):void 0,children:t.text},n)),e.line.text===``?` `:``]})}function Q({value:e}){return(0,V.jsx)(`span`,{className:`w-10 shrink-0 pr-2 text-right text-soft-foreground/70 tabular-nums select-none`,children:e??``})}function se({row:e,wrap:t,tokensFor:n,onExpand:i}){if(e.type===`hunk`)return(0,V.jsx)(Y,{hunk:e.hunk});if(e.type===`gap`)return(0,V.jsx)(X,{gap:e.gap,onExpand:i});let{line:a}=e.cell;return(0,V.jsxs)(`div`,{"data-slot":`diff-line`,"data-line":a.kind,className:r(`flex`,q[a.kind]),children:[(0,V.jsx)(Q,{value:a.oldLine}),(0,V.jsx)(Q,{value:a.newLine}),(0,V.jsx)(`span`,{className:`w-4 shrink-0 text-soft-foreground select-none`,children:J[a.kind]}),(0,V.jsx)(Z,{cell:e.cell,tokens:n(a),wrap:t})]})}function ce({row:e,wrap:t,tokensFor:n,onExpand:r}){return e.type===`hunk`?(0,V.jsx)(Y,{hunk:e.hunk}):e.type===`gap`?(0,V.jsx)(X,{gap:e.gap,onExpand:r}):(0,V.jsxs)(`div`,{"data-slot":`diff-pair`,className:`grid grid-cols-2`,children:[(0,V.jsx)($,{cell:e.left,side:`old`,tokensFor:n,wrap:t}),(0,V.jsx)($,{cell:e.right,side:`new`,tokensFor:n,wrap:t})]})}function $({cell:e,side:t,tokensFor:n,wrap:i}){if(!e)return(0,V.jsx)(`div`,{"data-slot":`diff-cell-empty`,className:r(`bg-muted/20`,t===`new`&&`border-l border-border/40`)});let{line:a}=e;return(0,V.jsxs)(`div`,{"data-slot":`diff-cell`,"data-line":a.kind,className:r(`flex min-w-0 overflow-x-auto`,q[a.kind],t===`new`&&`border-l border-border/40`),children:[(0,V.jsx)(Q,{value:t===`old`?a.oldLine:a.newLine}),(0,V.jsx)(`span`,{className:`w-4 shrink-0 text-soft-foreground select-none`,children:J[a.kind]}),(0,V.jsx)(Z,{cell:e,tokens:n(a),wrap:i})]})}export{te as DiffView};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{a as i}from"./dist-BW234Kg5.js";import{a,i as o,n as s}from"./dist-C5mlVBmd.js";import{c}from"./es2015-CQth82uv.js";import{t as l}from"./dist-DXO3xwbC.js";var u=e(t(),1),d=[`top`,`right`,`bottom`,`left`],f=Math.min,p=Math.max,m=Math.round,h=Math.floor,g=e=>({x:e,y:e}),_={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function v(e,t,n){return p(e,f(t,n))}function y(e,t){return typeof e==`function`?e(t):e}function b(e){return e.split(`-`)[0]}function x(e){return e.split(`-`)[1]}function S(e){return e===`x`?`y`:`x`}function C(e){return e===`y`?`height`:`width`}function w(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function T(e){return S(w(e))}function E(e,t,n){n===void 0&&(n=!1);let r=x(e),i=T(e),a=C(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=F(o)),[o,F(o)]}function D(e){let t=F(e);return[O(e),t,O(t)]}function O(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var k=[`left`,`right`],A=[`right`,`left`],j=[`top`,`bottom`],M=[`bottom`,`top`];function N(e,t,n){switch(e){case`top`:case`bottom`:return n?t?A:k:t?k:A;case`left`:case`right`:return t?j:M;default:return[]}}function P(e,t,n,r){let i=x(e),a=N(b(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(O)))),a}function F(e){let t=b(e);return _[t]+e.slice(t.length)}function I(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ee(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:I(e)}function L(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function R(e,t,n){let{reference:r,floating:i}=e,a=w(t),o=T(t),s=C(o),c=b(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=x(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function z(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=y(t,e),p=ee(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=L(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},b=L(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-b.top+p.top)/v.y,bottom:(b.bottom-h.bottom+p.bottom)/v.y,left:(h.left-b.left+p.left)/v.x,right:(b.right-h.right+p.right)/v.x}}var te=50,ne=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:z},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=R(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<te&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=R(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},re=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=y(e,t)||{};if(l==null)return{};let d=ee(u),p={x:n,y:r},m=T(i),h=C(m),g=await o.getDimensions(l),_=m===`y`,b=_?`top`:`left`,S=_?`bottom`:`right`,w=_?`clientHeight`:`clientWidth`,E=a.reference[h]+a.reference[m]-p[m]-a.floating[h],D=p[m]-a.reference[m],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),k=O?O[w]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=s.floating[w]||a.floating[h]);let A=E/2-D/2,j=k/2-g[h]/2-1,M=f(d[b],j),N=f(d[S],j),P=k-g[h]-N,F=k/2-g[h]/2+A,I=v(M,F,P),L=!c.arrow&&x(i)!=null&&F!==I&&a.reference[h]/2-(F<M?M:N)-g[h]/2<0,R=L?F<M?F-M:F-P:0;return{[m]:p[m]+R,data:{[m]:I,centerOffset:F-I-R,...L&&{alignmentOffset:R}},reset:L}}}),ie=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=y(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=b(r),_=w(o),v=b(o)===o,x=await(s.isRTL==null?void 0:s.isRTL(c.floating)),S=d||(v||!m?[F(o)]:D(o)),C=p!==`none`;!d&&C&&S.push(...P(o,m,p,x));let T=[o,...S],O=await s.detectOverflow(t,h),k=[],A=i.flip?.overflows||[];if(l&&k.push(O[g]),u){let e=E(r,a,x);k.push(O[e[0]],O[e[1]])}if(A=[...A,{placement:r,overflows:k}],!k.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=T[e];if(t&&(!(u===`alignment`&&_!==w(t))||A.every(e=>w(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:A},reset:{placement:t}};let n=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=A.filter(e=>{if(C){let t=w(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function ae(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function oe(e){return d.some(t=>e[t]>=0)}var se=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=y(e,t);switch(i){case`referenceHidden`:{let e=ae(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:oe(e)}}}case`escaped`:{let e=ae(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:oe(e)}}}default:return{}}}}},ce=new Set([`left`,`top`]);async function le(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=b(n),s=x(n),c=w(n)===`y`,l=ce.has(o)?-1:1,u=a&&c?-1:1,d=y(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ue=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await le(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},de=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=y(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=w(i),p=S(f),m=u[p],h=u[f],g=(e,t)=>v(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},fe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=y(e,t),u={x:n,y:r},d=w(i),f=S(d),p=u[f],m=u[d],h=y(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ce.has(b(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},pe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=y(e,t),c=await i.detectOverflow(t,s),l=b(n),u=x(n),d=w(n)===`y`,{width:m,height:h}=r.floating,g,_;l===`top`||l===`bottom`?(g=l,_=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(_=l,g=u===`end`?`top`:`bottom`);let v=h-c.top-c.bottom,S=m-c.left-c.right,C=f(h-c[g],v),T=f(m-c[_],S),E=t.middlewareData.shift,D=!E,O=C,k=T;E!=null&&E.enabled.x&&(k=S),E!=null&&E.enabled.y&&(O=v),D&&!u&&(d?k=m-2*p(c.left,c.right):O=h-2*p(c.top,c.bottom)),await o({...t,availableWidth:k,availableHeight:O});let A=await i.getDimensions(a.floating);return m!==A.width||h!==A.height?{reset:{rects:!0}}:{}}}};function me(){return typeof window<`u`}function B(e){return he(e)?(e.nodeName||``).toLowerCase():`#document`}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function H(e){return((he(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function he(e){return me()?e instanceof Node||e instanceof V(e).Node:!1}function U(e){return me()?e instanceof Element||e instanceof V(e).Element:!1}function W(e){return me()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function ge(e){return!me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function _e(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ve(e){return/^(table|td|th)$/.test(B(e))}function ye(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var be=/transform|translate|scale|rotate|perspective|filter/,xe=/paint|layout|strict|content/,G=e=>!!e&&e!==`none`,Se;function Ce(e){let t=U(e)?q(e):e;return G(t.transform)||G(t.translate)||G(t.scale)||G(t.rotate)||G(t.perspective)||!Te()&&(G(t.backdropFilter)||G(t.filter))||be.test(t.willChange||``)||xe.test(t.contain||``)}function we(e){let t=J(e);for(;W(t)&&!K(t);){if(Ce(t))return t;if(ye(t))return null;t=J(t)}return null}function Te(){return Se??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Se}function K(e){return/^(html|body|#document)$/.test(B(e))}function q(e){return V(e).getComputedStyle(e)}function Ee(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(B(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ge(e)&&e.host||H(e);return ge(t)?t.host:t}function De(e){let t=J(e);return K(t)?(e.ownerDocument||e).body:W(t)&&_e(t)?t:De(t)}function Y(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=De(e),i=r===e.ownerDocument?.body,a=V(r);if(i){let e=Oe(a);return t.concat(a,a.visualViewport||[],_e(r)?r:[],e&&n?Y(e):[])}else return t.concat(r,Y(r,[],n))}function Oe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ke(e){let t=q(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=W(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=m(n)!==a||m(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ae(e){return U(e)?e:e.contextElement}function X(e){let t=Ae(e);if(!W(t))return g(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ke(t),o=(a?m(n.width):n.width)/r,s=(a?m(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var je=g(0);function Me(e){let t=V(e);return!Te()||!t.visualViewport?je:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ne(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===V(e)}function Z(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ae(e),o=g(1);t&&(r?U(r)&&(o=X(r)):o=X(e));let s=Ne(a,n,r)?Me(a):g(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=V(a),t=U(r)?V(r):r,n=e,i=Oe(n);for(;i&&t!==n;){let e=X(i),t=i.getBoundingClientRect(),r=q(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=V(i),i=Oe(n)}}return L({width:u,height:d,x:c,y:l})}function Q(e,t){let n=Ee(e).scrollLeft;return t?t.left+n:Z(H(e)).left+n}function Pe(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Q(e,n),y:n.top+t.scrollTop}}function Fe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=H(r),s=t?ye(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=g(1),u=g(0),d=W(r);if((d||!a)&&((B(r)!==`body`||_e(o))&&(c=Ee(r)),d)){let e=Z(r);l=X(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Pe(o,c):g(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ie(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Le(e){let t=Ee(e),n=e.ownerDocument.body,r=p(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=p(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Q(e),o=-t.scrollTop;return q(n).direction===`rtl`&&(a+=p(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Re=25;function ze(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=V(e),a=H(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Te()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Q(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Re&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Be(e,t){let n=Z(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=X(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ve(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ze(e,n,t);else if(t===`document`)r=Le(H(e));else if(U(t))r=Be(t,n);else{let n=Me(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return L(r)}function He(e,t){let n=t.get(e);if(n)return n;let r=Y(e,[],!1).filter(e=>U(e)&&B(e)!==`body`),i=null,a=q(e).position===`fixed`,o=a?J(e):e;for(;U(o)&&!K(o);){let e=q(o),t=Ce(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=J(o)}return t.set(e,r),r}function Ue(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ye(t)?[]:He(t,this._c):[].concat(n),r],o=Ve(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ve(t,a[e],i);s=p(n.top,s),c=f(n.right,c),l=f(n.bottom,l),u=p(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function We(e){let{width:t,height:n}=ke(e);return{width:t,height:n}}function Ge(e,t,n){let r=W(t),i=H(t),a=n===`fixed`,o=Z(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=g(0);if((r||!a)&&((B(t)!==`body`||_e(i))&&(s=Ee(t)),r)){let e=Z(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Q(i));let l=i&&!r&&!a?Pe(i,s):g(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ke(e){return q(e).position===`static`}function qe(e,t){if(!W(e)||q(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return H(e)===n&&(n=n.ownerDocument.body),n}function Je(e,t){let n=V(e);if(ye(e))return n;if(!W(e)){let t=J(e);for(;t&&!K(t);){if(U(t)&&!Ke(t))return t;t=J(t)}return n}let r=qe(e,t);for(;r&&ve(r)&&Ke(r);)r=qe(r,t);return r&&K(r)&&Ke(r)&&!Ce(r)?n:r||we(e)||n}var Ye=async function(e){let t=this.getOffsetParent||Je,n=this.getDimensions,r=await n(e.floating);return{reference:Ge(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Xe(e){return q(e).direction===`rtl`}var Ze={convertOffsetParentRelativeRectToViewportRelativeRect:Fe,getDocumentElement:H,getClippingRect:Ue,getOffsetParent:Je,getElementRects:Ye,getClientRects:Ie,getDimensions:We,getScale:X,isElement:U,isRTL:Xe};function Qe(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $e(e,t,n){let r=null,i,a=H(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:m,height:g}=l;if(n||t(),!m||!g)return;let _=h(d),v=h(a.clientWidth-(u+m)),y=h(a.clientHeight-(d+g)),b=h(u),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:p(0,f(1,c))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(!Qe(l,e.getBoundingClientRect()))return s();if(n!==c){if(!S)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(C,{...x,root:a.ownerDocument})}catch{r=new IntersectionObserver(C,x)}r.observe(e)}let c=V(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function et(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ae(e),u=i||a?[...l?Y(l):[],...t?Y(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?$e(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Z(e):null;c&&g();function g(){let t=Z(e);h&&!Qe(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var tt=ue,nt=de,rt=ie,it=pe,at=se,ot=re,st=fe,ct=(e,t,n)=>{let r=new Map,i=n??{},a={...Ze,...i.platform,_c:r};return ne(e,t,{...i,platform:a})},lt=e(n(),1),ut=typeof document<`u`?u.useLayoutEffect:function(){};function dt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!dt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!dt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ft(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pt(e,t){let n=ft(e);return Math.round(t*n)/n}function mt(e){let t=u.useRef(e);return ut(()=>{t.current=e}),t}function ht(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[d,f]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=u.useState(r);dt(p,r)||m(r);let[h,g]=u.useState(null),[_,v]=u.useState(null),y=u.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=u.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=u.useRef(null),w=u.useRef(null),T=u.useRef(d),E=c!=null,D=mt(c),O=mt(i),k=mt(l),A=u.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),ct(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!dt(T.current,t)&&(T.current=t,lt.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);ut(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);let j=u.useRef(!1);ut(()=>(j.current=!0,()=>{j.current=!1}),[]),ut(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=u.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=u.useMemo(()=>({reference:x,floating:S}),[x,S]),P=u.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=pt(N.floating,d.x),r=pt(N.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ft(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,d.x,d.y]);return u.useMemo(()=>({...d,update:A,refs:M,elements:N,floatingStyles:P}),[d,A,M,N,P])}var gt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ot({element:r.current,padding:i}).fn(n):r?ot({element:r,padding:i}).fn(n):{}}}},_t=(e,t)=>{let n=tt(e);return{name:n.name,fn:n.fn,options:[e,t]}},vt=(e,t)=>{let n=nt(e);return{name:n.name,fn:n.fn,options:[e,t]}},yt=(e,t)=>({fn:st(e).fn,options:[e,t]}),bt=(e,t)=>{let n=rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},xt=(e,t)=>{let n=it(e);return{name:n.name,fn:n.fn,options:[e,t]}},St=(e,t)=>{let n=at(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ct=(e,t)=>{let n=gt(e);return{name:n.name,fn:n.fn,options:[e,t]}},$=r(),wt=`Arrow`,Tt=u.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...o}=e;return(0,$.jsx)(a.svg,{...o,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,$.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Tt.displayName=wt;var Et=Tt,Dt=`Popper`,[Ot,kt]=o(Dt),[At,jt]=Ot(Dt),Mt=e=>{let{__scopePopper:t,children:n}=e,[r,i]=u.useState(null),[a,o]=u.useState(void 0);return(0,$.jsx)(At,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};Mt.displayName=Dt;var Nt=`PopperAnchor`,Pt=u.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...o}=e,s=jt(Nt,n),c=u.useRef(null),l=s.onAnchorChange,d=i(t,u.useCallback(e=>{c.current=e,e&&l(e)},[l])),f=u.useRef(null);u.useEffect(()=>{if(!r)return;let e=f.current;f.current=r.current,e!==f.current&&l(f.current)});let p=s.placementState&&Wt(s.placementState),m=p?.[0],h=p?.[1];return r?null:(0,$.jsx)(a.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...o,ref:d})});Pt.displayName=Nt;var Ft=`PopperContent`,[It,Lt]=Ot(Ft),Rt=u.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:o=0,align:d=`center`,alignOffset:f=0,arrowPadding:p=0,avoidCollisions:m=!0,collisionBoundary:h=[],collisionPadding:g=0,sticky:_=`partial`,hideWhenDetached:v=!1,updatePositionStrategy:y=`optimized`,onPlaced:b,...x}=e,S=jt(Ft,n),[C,w]=u.useState(null),T=i(t,w),[E,D]=u.useState(null),O=l(E),k=O?.width??0,A=O?.height??0,j=r+(d===`center`?``:`-`+d),M=typeof g==`number`?g:{top:0,right:0,bottom:0,left:0,...g},N=Array.isArray(h)?h:[h],P=N.length>0,F={padding:M,boundary:N.filter(Ht),altBoundary:P},{refs:I,floatingStyles:ee,placement:L,isPositioned:R,middlewareData:z}=ht({strategy:`fixed`,placement:j,whileElementsMounted:(...e)=>et(...e,{animationFrame:y===`always`}),elements:{reference:S.anchor},middleware:[_t({mainAxis:o+A,alignmentAxis:f}),m&&vt({mainAxis:!0,crossAxis:!1,limiter:_===`partial`?yt():void 0,...F}),m&&bt({...F}),xt({...F,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),E&&Ct({element:E,padding:p}),Ut({arrowWidth:k,arrowHeight:A}),v&&St({strategy:`referenceHidden`,...F,boundary:P?F.boundary:void 0})]}),te=S.setPlacementState;s(()=>(te(L),()=>{te(void 0)}),[L,te]);let[ne,re]=Wt(L),ie=c(b);s(()=>{R&&ie?.()},[R,ie]);let ae=z.arrow?.x,oe=z.arrow?.y,se=z.arrow?.centerOffset!==0,[ce,le]=u.useState();return s(()=>{C&&le(window.getComputedStyle(C).zIndex)},[C]),(0,$.jsx)(`div`,{ref:I.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:R?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ce,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,$.jsx)(It,{scope:n,placedSide:ne,placedAlign:re,onArrowChange:D,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:(0,$.jsx)(a.div,{"data-side":ne,"data-align":re,...x,ref:T,style:{...x.style,animation:R?void 0:`none`}})})})});Rt.displayName=Ft;var zt=`PopperArrow`,Bt={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Vt=u.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Lt(zt,n),a=Bt[i.placedSide];return(0,$.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,$.jsx)(Et,{...r,ref:t,style:{...r.style,display:`block`}})})});Vt.displayName=zt;function Ht(e){return e!==null}var Ut=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Wt(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Wt(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Gt=Mt,Kt=Pt,qt=Rt,Jt=Vt;export{kt as a,Gt as i,Jt as n,qt as r,Kt as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";var n=e(t(),1);function r(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function i(...e){return t=>{let n=!1,i=e.map(e=>{let i=r(e,t);return!n&&typeof i==`function`&&(n=!0),i});if(n)return()=>{for(let t=0;t<i.length;t++){let n=i[t];typeof n==`function`?n():r(e[t],null)}}}}function a(...e){return n.useCallback(i(...e),e)}function o(e){let t=n.forwardRef((t,r)=>{let{children:i,...o}=t,s=null,c=!1,l=[];h(i)&&typeof y==`function`&&(i=y(i._payload)),n.Children.forEach(i,e=>{if(p(e)){c=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;h(n)&&typeof y==`function`&&(n=y(n._payload)),s=u(t,n),l.push(s?.props?.children)}else l.push(e)}),s?s=n.cloneElement(s,void 0,l):!c&&n.Children.count(i)===1&&n.isValidElement(i)&&(s=i);let m=s?f(s):void 0,g=a(r,m);if(!s){if(i||i===0)throw Error(c?v(e):_(e));return i}let b=d(o,s.props??{});return s.type!==n.Fragment&&(b.ref=r?g:m),n.cloneElement(s,b)});return t.displayName=`${e}.Slot`,t}var s=o(`Slot`),c=Symbol.for(`radix.slottable`);function l(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=c,t}var u=(e,t)=>{if(`child`in e.props){let t=e.props.child;return n.isValidElement(t)?n.cloneElement(t,void 0,e.props.children(t.props.children)):null}return n.isValidElement(t)?t:null};function d(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 f(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 p(e){return n.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===c}var m=Symbol.for(`react.lazy`);function h(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===m&&`_payload`in e&&g(e._payload)}function g(e){return typeof e==`object`&&!!e&&`then`in e}var _=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,v=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,y=n.use;export{a,i,o as n,l as r,s as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./createLucideIcon-BHp8sXmF.js";import{a as i}from"./dist-C5mlVBmd.js";var a=r(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),o=e(t(),1),s=n(),c=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),l=`VisuallyHidden`,u=o.forwardRef((e,t)=>(0,s.jsx)(i.span,{...e,ref:t,style:{...c,...e.style}}));u.displayName=l;var d=u;export{c as n,a as r,d as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{n as i}from"./dist-BW234Kg5.js";var a=e(t(),1),o=e(n(),1),s=r(),c=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=i(`Primitive.${t}`),r=a.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,s.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function l(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))}function u(e,t=[]){let n=[];function r(t,r){let i=a.createContext(r);i.displayName=t+`Context`;let o=n.length;n=[...n,r];let c=t=>{let{scope:n,children:r,...c}=t,l=n?.[e]?.[o]||i,u=a.useMemo(()=>c,Object.values(c));return(0,s.jsx)(l.Provider,{value:u,children:r})};c.displayName=t+`Provider`;function l(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[o]||i,d=a.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return[c,l]}let i=()=>{let t=n.map(e=>a.createContext(e));return function(n){let r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,d(i,...t)]}function d(...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 a.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function f(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var p=globalThis?.document?a.useLayoutEffect:()=>{},m=a.useInsertionEffect||p;function h({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,o,s]=g({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=a.useRef(e!==void 0);a.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`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=c},[c,r])}return[l,a.useCallback(t=>{if(c){let n=_(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}function g({defaultProp:e,onChange:t}){let[n,r]=a.useState(e),i=a.useRef(n),o=a.useRef(t);return m(()=>{o.current=t},[t]),a.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function _(e){return typeof e==`function`}export{c as a,u as i,p as n,l as o,f as r,h as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{n}from"./dist-C5mlVBmd.js";var r=e(t(),1);function i(e){let[t,i]=r.useState(void 0);return n(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let n=t[0],r,a;if(`borderBoxSize`in n){let e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;i({width:r,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else i(void 0)},[e]),t}export{i as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,n as i}from"./dist-BW234Kg5.js";import{a,i as o,r as s,t as c}from"./dist-C5mlVBmd.js";import{a as l,i as u,l as d,n as f,o as p,r as m,s as h,t as g,u as _}from"./es2015-CQth82uv.js";var v=e(t(),1),y=n(),b=`Dialog`,[x,S]=o(b),[C,w]=x(b),T=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),l=v.useRef(null),[u,f]=c({prop:r,defaultProp:i??!1,onChange:a,caller:b});return(0,y.jsx)(C,{scope:t,triggerRef:s,contentRef:l,contentId:d(),titleId:d(),descriptionId:d(),open:u,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(e=>!e),[f]),modal:o,children:n})};T.displayName=b;var E=`DialogTrigger`,D=v.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,o=w(E,n),c=r(t,o.triggerRef);return(0,y.jsx)(a.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":q(o.open),...i,ref:c,onClick:s(e.onClick,o.onOpenToggle)})});D.displayName=E;var O=`DialogPortal`,[k,A]=x(O,{forceMount:void 0}),j=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=w(O,t);return(0,y.jsx)(k,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,y.jsx)(_,{present:n||a.open,children:(0,y.jsx)(u,{asChild:!0,container:i,children:e})}))})};j.displayName=O;var M=`DialogOverlay`,N=v.forwardRef((e,t)=>{let n=A(M,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=w(M,e.__scopeDialog);return a.modal?(0,y.jsx)(_,{present:r||a.open,children:(0,y.jsx)(F,{...i,ref:t})}):null});N.displayName=M;var P=i(`DialogOverlay.RemoveScroll`),F=v.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,o=w(M,n),s=r(t,h());return(0,y.jsx)(f,{as:P,allowPinchZoom:!0,shards:[o.contentRef],children:(0,y.jsx)(a.div,{"data-state":q(o.open),...i,ref:s,style:{pointerEvents:`auto`,...i.style}})})}),I=`DialogContent`,L=v.forwardRef((e,t)=>{let n=A(I,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=w(I,e.__scopeDialog);return(0,y.jsx)(_,{present:r||a.open,children:a.modal?(0,y.jsx)(R,{...i,ref:t}):(0,y.jsx)(z,{...i,ref:t})})});L.displayName=I;var R=v.forwardRef((e,t)=>{let n=w(I,e.__scopeDialog),i=v.useRef(null),a=r(t,n.contentRef,i);return v.useEffect(()=>{let e=i.current;if(e)return g(e)},[]),(0,y.jsx)(B,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:s(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:s(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:s(e.onFocusOutside,e=>e.preventDefault())})}),z=v.forwardRef((e,t)=>{let n=w(I,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,y.jsx)(B,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),B=v.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=w(I,n);return m(),(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(l,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,y.jsx)(p,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":q(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),V=`DialogTitle`,H=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(V,n);return(0,y.jsx)(a.h2,{id:i.titleId,...r,ref:t})});H.displayName=V;var U=`DialogDescription`,W=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(U,n);return(0,y.jsx)(a.p,{id:i.descriptionId,...r,ref:t})});W.displayName=U;var G=`DialogClose`,K=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(G,n);return(0,y.jsx)(a.button,{type:`button`,...r,ref:t,onClick:s(e.onClick,()=>i.onOpenChange(!1))})});K.displayName=G;function q(e){return e?`open`:`closed`}export{N as a,D as c,W as i,S as l,K as n,j as o,L as r,H as s,T as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{r,t as i}from"./utils-DSMR_WLb.js";import{c as a,m as o,u as s}from"./design-icons-CzEoMH9c.js";import{a as c,n as l}from"./dist-BW234Kg5.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./dist-C5mlVBmd.js";import{a as g,c as _,i as v,l as y,n as b,o as ee,r as x,t as S,u as C}from"./es2015-CQth82uv.js";import{a as w,i as T,n as te,r as ne,t as E}from"./dist-BAoXdNsT.js";var D=e(t(),1),O=n();function k(e){let t=e+`CollectionProvider`,[n,r]=d(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=D.useRef(null),a=D.useRef(new Map).current;return(0,O.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,u=l(s),f=D.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=c(t,a(s,n).collectionRef);return(0,O.jsx)(u,{ref:i,children:r})});f.displayName=s;let p=e+`CollectionItemSlot`,m=`data-radix-collection-item`,h=l(p),g=D.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=D.useRef(null),s=c(t,o),l=a(p,n);return D.useEffect(()=>(l.itemMap.set(o,{ref:o,...i}),()=>void l.itemMap.delete(o))),(0,O.jsx)(h,{[m]:``,ref:s,children:r})});g.displayName=p;function _(t){let n=a(e+`CollectionConsumer`,t);return D.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:f,ItemSlot:g},_,r]}var re=D.createContext(void 0);function A(e){let t=D.useContext(re);return e||t||`ltr`}var j=!1;function ie(){let[e,t]=D.useState(j);return D.useEffect(()=>{j||(j=!0,t(!0))},[]),e}var M=D.useSyncExternalStore;function N(){return()=>{}}function P(){return M(N,()=>!0,()=>!1)}var ae=typeof M==`function`?P:ie,F=`rovingFocusGroup.onEntryFocus`,oe={bubbles:!1,cancelable:!0},I=`RovingFocusGroup`,[L,se,ce]=k(I),[le,ue]=d(I,[ce]),[de,fe]=le(I),pe=D.forwardRef((e,t)=>(0,O.jsx)(L.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,O.jsx)(L.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,O.jsx)(me,{...e,ref:t})})}));pe.displayName=I;var me=D.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,g=D.useRef(null),v=c(t,g),y=A(a),[b,ee]=h({prop:o,defaultProp:s??null,onChange:l,caller:I}),[x,S]=D.useState(!1),C=_(d),w=se(n),T=D.useRef(!1),[te,ne]=D.useState(0);return D.useEffect(()=>{let e=g.current;if(e)return e.addEventListener(F,C),()=>e.removeEventListener(F,C)},[C]),(0,O.jsx)(de,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:b,onItemFocus:D.useCallback(e=>ee(e),[ee]),onItemShiftTab:D.useCallback(()=>S(!0),[]),onFocusableItemAdd:D.useCallback(()=>ne(e=>e+1),[]),onFocusableItemRemove:D.useCallback(()=>ne(e=>e-1),[]),children:(0,O.jsx)(u.div,{tabIndex:x||te===0?-1:0,"data-orientation":r,...p,ref:v,style:{outline:`none`,...e.style},onMouseDown:m(e.onMouseDown,()=>{T.current=!0}),onFocus:m(e.onFocus,e=>{let t=!T.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(F,oe);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=w().filter(e=>e.focusable);be([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),f)}}T.current=!1}),onBlur:m(e.onBlur,()=>S(!1))})})}),he=`RovingFocusGroupItem`,ge=D.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=y(),l=a||c,d=fe(he,n),p=d.currentTabStopId===l,h=se(n),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:v}=d,b=ae();return f(()=>{if(!(!b||!r))return g(),()=>_()},[b,r,g,_]),D.useEffect(()=>{if(!(b||!r))return g(),()=>_()},[b,r,g,_]),(0,O.jsx)(L.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,O.jsx)(u.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:m(e.onMouseDown,e=>{r?d.onItemFocus(l):e.preventDefault()}),onFocus:m(e.onFocus,()=>d.onItemFocus(l)),onKeyDown:m(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ye(e,d.orientation,d.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=d.loop?xe(n,r+1):n.slice(r+1)}setTimeout(()=>be(n))}}),children:typeof o==`function`?o({isCurrentTabStop:p,hasTabStop:v!=null}):o})})});ge.displayName=he;var _e={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function ve(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function ye(e,t,n){let r=ve(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return _e[r]}function be(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function xe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Se=pe,Ce=ge,R=[`Enter`,` `],we=[`ArrowDown`,`PageUp`,`Home`],Te=[`ArrowUp`,`PageDown`,`End`],Ee=[...we,...Te],De={ltr:[...R,`ArrowRight`],rtl:[...R,`ArrowLeft`]},Oe={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},z=`Menu`,[B,ke,Ae]=k(z),[V,je]=d(z,[Ae,w,ue]),H=w(),Me=ue(),[Ne,U]=V(z),[Pe,W]=V(z),Fe=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=H(t),[c,l]=D.useState(null),u=D.useRef(!1),d=_(a),f=A(i);return D.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),D.useEffect(()=>{if(!n)return;let e=()=>d(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,O.jsx)(T,{...s,children:(0,O.jsx)(Ne,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,O.jsx)(Pe,{scope:t,onClose:D.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Fe.displayName=z;var Ie=`MenuAnchor`,G=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=H(n);return(0,O.jsx)(E,{...i,...r,ref:t})});G.displayName=Ie;var Le=`MenuPortal`,[Re,ze]=V(Le,{forceMount:void 0}),Be=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=U(Le,t);return(0,O.jsx)(Re,{scope:t,forceMount:n,children:(0,O.jsx)(C,{present:n||a.open,children:(0,O.jsx)(v,{asChild:!0,container:i,children:r})})})};Be.displayName=Le;var K=`MenuContent`,[Ve,He]=V(K),Ue=D.forwardRef((e,t)=>{let n=ze(K,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=U(K,e.__scopeMenu),o=W(K,e.__scopeMenu);return(0,O.jsx)(B.Provider,{scope:e.__scopeMenu,children:(0,O.jsx)(C,{present:r||a.open,children:(0,O.jsx)(B.Slot,{scope:e.__scopeMenu,children:o.modal?(0,O.jsx)(We,{...i,ref:t}):(0,O.jsx)(Ge,{...i,ref:t})})})})}),We=D.forwardRef((e,t)=>{let n=U(K,e.__scopeMenu),r=D.useRef(null),i=c(t,r);return D.useEffect(()=>{let e=r.current;if(e)return S(e)},[]),(0,O.jsx)(qe,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:m(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ge=D.forwardRef((e,t)=>{let n=U(K,e.__scopeMenu);return(0,O.jsx)(qe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Ke=l(`MenuContent.ScrollLock`),qe=D.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:h,disableOutsideScroll:_,...v}=e,y=U(K,n),S=W(K,n),C=H(n),w=Me(n),T=ke(n),[te,E]=D.useState(null),k=D.useRef(null),re=c(t,k,y.onContentChange),A=D.useRef(0),j=D.useRef(``),ie=D.useRef(0),M=D.useRef(null),N=D.useRef(`right`),P=D.useRef(0),ae=_?b:D.Fragment,F=_?{as:Ke,allowPinchZoom:!0}:void 0,oe=e=>{let t=j.current+e,n=T().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Dt(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){j.current=t,window.clearTimeout(A.current),t!==``&&(A.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};D.useEffect(()=>()=>window.clearTimeout(A.current),[]),x();let I=D.useCallback(e=>N.current===M.current?.side&&kt(e,M.current?.area),[]);return(0,O.jsx)(Ve,{scope:n,searchRef:j,onItemEnter:D.useCallback(e=>{I(e)&&e.preventDefault()},[I]),onItemLeave:D.useCallback(e=>{I(e)||(k.current?.focus(),E(null))},[I]),onTriggerLeave:D.useCallback(e=>{I(e)&&e.preventDefault()},[I]),pointerGraceTimerRef:ie,onPointerGraceIntentChange:D.useCallback(e=>{M.current=e},[]),children:(0,O.jsx)(ae,{...F,children:(0,O.jsx)(g,{asChild:!0,trapped:i,onMountAutoFocus:m(a,e=>{e.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,O.jsx)(ee,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:h,children:(0,O.jsx)(Se,{asChild:!0,...w,dir:S.dir,orientation:`vertical`,loop:r,currentTabStopId:te,onCurrentTabStopIdChange:E,onEntryFocus:m(l,e=>{S.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,O.jsx)(ne,{role:`menu`,"aria-orientation":`vertical`,"data-state":Ct(y.open),"data-radix-menu-content":``,dir:S.dir,...C,...v,ref:re,style:{outline:`none`,...v.style},onKeyDown:m(v.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&oe(e.key));let i=k.current;if(e.target!==i||!Ee.includes(e.key))return;e.preventDefault();let a=T().filter(e=>!e.disabled).map(e=>e.ref.current);Te.includes(e.key)&&a.reverse(),Tt(a)}),onBlur:m(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(A.current),j.current=``)}),onPointerMove:m(e.onPointerMove,Z(e=>{let t=e.target,n=P.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>P.current?`right`:`left`;N.current=t,P.current=e.clientX}}))})})})})})})});Ue.displayName=K;var Je=`MenuGroup`,Ye=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,O.jsx)(u.div,{role:`group`,...r,ref:t})});Ye.displayName=Je;var Xe=`MenuLabel`,Ze=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,O.jsx)(u.div,{...r,ref:t})});Ze.displayName=Xe;var q=`MenuItem`,Qe=`menu.itemSelect`,J=D.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=D.useRef(null),o=W(q,e.__scopeMenu),s=He(q,e.__scopeMenu),l=c(t,a),u=D.useRef(!1),d=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Qe,{bubbles:!0,cancelable:!0});e.addEventListener(Qe,e=>r?.(e),{once:!0}),p(e,t),t.defaultPrevented?u.current=!1:o.onClose()}};return(0,O.jsx)($e,{...i,ref:l,disabled:n,onClick:m(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:m(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:m(e.onKeyDown,e=>{n||e.target!==e.currentTarget||s.searchRef.current!==``&&e.key===` `||R.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});J.displayName=q;var $e=D.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=He(q,n),s=Me(n),l=D.useRef(null),d=c(t,l),[f,p]=D.useState(!1),[h,g]=D.useState(``);return D.useEffect(()=>{let e=l.current;e&&g((e.textContent??``).trim())},[a.children]),(0,O.jsx)(B.ItemSlot,{scope:n,disabled:r,textValue:i??h,children:(0,O.jsx)(Ce,{asChild:!0,...s,focusable:!r,children:(0,O.jsx)(u.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:d,onPointerMove:m(e.onPointerMove,Z(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:m(e.onPointerLeave,Z(e=>o.onItemLeave(e))),onFocus:m(e.onFocus,()=>p(!0)),onBlur:m(e.onBlur,()=>p(!1))})})})}),et=`MenuCheckboxItem`,tt=D.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,O.jsx)(lt,{scope:e.__scopeMenu,checked:n,children:(0,O.jsx)(J,{role:`menuitemcheckbox`,"aria-checked":X(n)?`mixed`:n,...i,ref:t,"data-state":wt(n),onSelect:m(i.onSelect,()=>r?.(X(n)?!0:!n),{checkForDefaultPrevented:!1})})})});tt.displayName=et;var nt=`MenuRadioGroup`,[rt,it]=V(nt,{value:void 0,onValueChange:()=>{}}),at=D.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=_(r);return(0,O.jsx)(rt,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,O.jsx)(Ye,{...i,ref:t})})});at.displayName=nt;var ot=`MenuRadioItem`,st=D.forwardRef((e,t)=>{let{value:n,...r}=e,i=it(ot,e.__scopeMenu),a=n===i.value;return(0,O.jsx)(lt,{scope:e.__scopeMenu,checked:a,children:(0,O.jsx)(J,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":wt(a),onSelect:m(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});st.displayName=ot;var ct=`MenuItemIndicator`,[lt,ut]=V(ct,{checked:!1}),dt=D.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=ut(ct,n);return(0,O.jsx)(C,{present:r||X(a.checked)||a.checked===!0,children:(0,O.jsx)(u.span,{...i,ref:t,"data-state":wt(a.checked)})})});dt.displayName=ct;var ft=`MenuSeparator`,pt=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,O.jsx)(u.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});pt.displayName=ft;var mt=`MenuArrow`,ht=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=H(n);return(0,O.jsx)(te,{...i,...r,ref:t})});ht.displayName=mt;var gt=`MenuSub`,[_t,vt]=V(gt),yt=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=U(gt,t),o=H(t),[s,c]=D.useState(null),[l,u]=D.useState(null),d=_(i);return D.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,O.jsx)(T,{...o,children:(0,O.jsx)(Ne,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,O.jsx)(_t,{scope:t,contentId:y(),triggerId:y(),trigger:s,onTriggerChange:c,children:n})})})};yt.displayName=gt;var Y=`MenuSubTrigger`,bt=D.forwardRef((e,t)=>{let n=U(Y,e.__scopeMenu),r=W(Y,e.__scopeMenu),i=vt(Y,e.__scopeMenu),a=He(Y,e.__scopeMenu),o=D.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=a,u={__scopeMenu:e.__scopeMenu},d=D.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);D.useEffect(()=>d,[d]),D.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),l(null)}},[s,l]);let f=c(t,i.onTriggerChange);return(0,O.jsx)(G,{asChild:!0,...u,children:(0,O.jsx)($e,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":Ct(n.open),...e,ref:f,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:m(e.onPointerMove,Z(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:m(e.onPointerLeave,Z(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:m(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||a.searchRef.current!==``&&t.key===` `||De[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});bt.displayName=Y;var xt=`MenuSubContent`,St=D.forwardRef((e,t)=>{let n=ze(K,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=U(K,e.__scopeMenu),s=W(K,e.__scopeMenu),l=vt(xt,e.__scopeMenu),u=D.useRef(null),d=c(t,u);return(0,O.jsx)(B.Provider,{scope:e.__scopeMenu,children:(0,O.jsx)(C,{present:r||o.open,children:(0,O.jsx)(B.Slot,{scope:e.__scopeMenu,children:(0,O.jsx)(qe,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:d,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:m(e.onFocusOutside,e=>{e.target!==l.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:m(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:m(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Oe[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});St.displayName=xt;function Ct(e){return e?`open`:`closed`}function X(e){return e===`indeterminate`}function wt(e){return X(e)?`indeterminate`:e?`checked`:`unchecked`}function Tt(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Et(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Dt(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Et(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ot(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function kt(e,t){return t?Ot({x:e.clientX,y:e.clientY},t):!1}function Z(e){return t=>t.pointerType===`mouse`?e(t):void 0}var At=Fe,jt=G,Mt=Be,Nt=Ue,Pt=Ye,Ft=Ze,It=J,Lt=tt,Rt=at,zt=st,Bt=dt,Vt=pt,Ht=ht,Ut=yt,Wt=bt,Gt=St,Q=`DropdownMenu`,[Kt,qt]=d(Q,[je]),$=je(),[Jt,Yt]=Kt(Q),Xt=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=$(t),l=D.useRef(null),[u,d]=h({prop:i,defaultProp:a??!1,onChange:o,caller:Q});return(0,O.jsx)(Jt,{scope:t,triggerId:y(),triggerRef:l,contentId:y(),open:u,onOpenChange:d,onOpenToggle:D.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,O.jsx)(At,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Xt.displayName=Q;var Zt=`DropdownMenuTrigger`,Qt=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Yt(Zt,n),o=$(n),s=c(t,a.triggerRef);return(0,O.jsx)(jt,{asChild:!0,...o,children:(0,O.jsx)(u.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:m(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:m(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Qt.displayName=Zt;var $t=`DropdownMenuPortal`,en=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,O.jsx)(Mt,{...r,...n})};en.displayName=$t;var tn=`DropdownMenuContent`,nn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Yt(tn,n),a=$(n),o=D.useRef(!1);return(0,O.jsx)(Nt,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:m(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:m(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});nn.displayName=tn;var rn=`DropdownMenuGroup`,an=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Pt,{...i,...r,ref:t})});an.displayName=rn;var on=`DropdownMenuLabel`,sn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Ft,{...i,...r,ref:t})});sn.displayName=on;var cn=`DropdownMenuItem`,ln=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(It,{...i,...r,ref:t})});ln.displayName=cn;var un=`DropdownMenuCheckboxItem`,dn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Lt,{...i,...r,ref:t})});dn.displayName=un;var fn=`DropdownMenuRadioGroup`,pn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Rt,{...i,...r,ref:t})});pn.displayName=fn;var mn=`DropdownMenuRadioItem`,hn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(zt,{...i,...r,ref:t})});hn.displayName=mn;var gn=`DropdownMenuItemIndicator`,_n=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Bt,{...i,...r,ref:t})});_n.displayName=gn;var vn=`DropdownMenuSeparator`,yn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Vt,{...i,...r,ref:t})});yn.displayName=vn;var bn=`DropdownMenuArrow`,xn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Ht,{...i,...r,ref:t})});xn.displayName=bn;var Sn=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=$(t),[s,c]=h({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,O.jsx)(Ut,{...o,open:s,onOpenChange:c,children:n})},Cn=`DropdownMenuSubTrigger`,wn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Wt,{...i,...r,ref:t})});wn.displayName=Cn;var Tn=`DropdownMenuSubContent`,En=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Gt,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});En.displayName=Tn;var Dn=Xt,On=Qt,kn=en,An=nn,jn=sn,Mn=ln,Nn=dn,Pn=pn,Fn=hn,In=_n,Ln=yn,Rn=Sn,zn=wn,Bn=En;function Vn({...e}){return(0,O.jsx)(Dn,{"data-slot":`dropdown-menu`,...e})}function Hn({...e}){return(0,O.jsx)(kn,{"data-slot":`dropdown-menu-portal`,...e})}function Un({...e}){return(0,O.jsx)(On,{"data-slot":`dropdown-menu-trigger`,...e})}function Wn({className:e,sideOffset:t=4,...n}){return(0,O.jsx)(kn,{children:(0,O.jsx)(An,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:i(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...n})})}function Gn({className:e,inset:t,variant:n=`default`,...r}){return(0,O.jsx)(Mn,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:i(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Kn({className:e,children:t,checked:n,...o}){return(0,O.jsxs)(Nn,{"data-slot":`dropdown-menu-checkbox-item`,className:i(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r({checked:n}),...o,children:[(0,O.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,O.jsx)(In,{children:(0,O.jsx)(a,{className:`size-4`})})}),t]})}function qn({...e}){return(0,O.jsx)(Pn,{"data-slot":`dropdown-menu-radio-group`,...e})}function Jn({className:e,children:t,...n}){return(0,O.jsxs)(Fn,{"data-slot":`dropdown-menu-radio-item`,className:i(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,O.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,O.jsx)(In,{children:(0,O.jsx)(o,{className:`size-2 fill-current`})})}),t]})}function Yn({className:e,inset:t,...n}){return(0,O.jsx)(jn,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:i(`px-2 py-1.5 text-sm font-medium data-[inset]:ps-8`,e),...n})}function Xn({className:e,...t}){return(0,O.jsx)(Ln,{"data-slot":`dropdown-menu-separator`,className:i(`-mx-1 my-1 h-px bg-border`,e),...t})}function Zn({...e}){return(0,O.jsx)(Rn,{"data-slot":`dropdown-menu-sub`,...e})}function Qn({className:e,inset:t,children:n,...r}){return(0,O.jsxs)(zn,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:i(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:ps-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,O.jsx)(s,{className:`ms-auto size-4`})]})}function $n({className:e,...t}){return(0,O.jsx)(Bn,{"data-slot":`dropdown-menu-sub-content`,className:i(`z-50 min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...t})}export{Yn as a,Jn as c,$n as d,Qn as f,k as h,Gn as i,Xn as l,A as m,Kn as n,Hn as o,Un as p,Wn as r,qn as s,Vn as t,Zn as u};
@@ -0,0 +1,41 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{a as i}from"./dist-BW234Kg5.js";import{a,n as o,o as s,r as c}from"./dist-C5mlVBmd.js";var l=e(t(),1);function u(e,t){return l.useReducer((e,n)=>t[e][n]??e,e)}var d=e=>{let{present:t,children:n}=e,r=f(t),i=typeof n==`function`?n({present:r.isPresent}):l.Children.only(n),a=m(r.ref,g(i));return typeof n==`function`||r.isPresent?l.cloneElement(i,{ref:a}):null};d.displayName=`Presence`;function f(e){let[t,n]=l.useState(),r=l.useRef(null),i=l.useRef(e),a=l.useRef(`none`),s=l.useRef(void 0),[c,d]=u(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return l.useEffect(()=>{c===`mounted`?(a.current=s.current??h(r.current),s.current=void 0):a.current=`none`},[c]),o(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=h(t);e?(s.current=o,d(`MOUNT`)):o===`none`||t?.display===`none`?d(`UNMOUNT`):d(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,d]),o(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=h(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(d(`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=h(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 d(`ANIMATION_END`)},[t,d]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:l.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=h(t)}else r.current=null;n(e)},[])}}function p(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function m(...e){let t=l.useRef(e);return t.current=e,l.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=p(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():p(n[e],null)}}},[])}function h(e){return e?.animationName||`none`}function g(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 _=l.useId||(()=>void 0),v=0;function y(e){let[t,n]=l.useState(_());return o(()=>{e||n(e=>e??String(v++))},[e]),e||(t?`radix-${t}`:``)}function b(e){let t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>((...e)=>t.current?.(...e)),[])}var x=r(),S=`DismissableLayer`,C=`dismissableLayer.update`,w=`dismissableLayer.pointerDownOutside`,ee=`dismissableLayer.focusOutside`,te,T=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),E=l.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...p}=e,m=l.useContext(T),[h,g]=l.useState(null),_=h?.ownerDocument??globalThis?.document,[,v]=l.useState({}),y=i(t,g),S=Array.from(m.layers),[w]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),ee=w?S.indexOf(w):-1,E=h?S.indexOf(h):-1,ne=m.layersWithOutsidePointerEventsDisabled.size>0,D=E>=ee,O=l.useRef(!1),re=ie(e=>{s?.(e),d?.(e),e.defaultPrevented||f?.()},{ownerDocument:_,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:l.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...m.branches].some(t=>t.contains(e));return D&&!t},[m.branches,D])}),A=ae(e=>{if(r&&O.current)return;let t=e.target;[...m.branches].some(e=>e.contains(t))||(u?.(e),d?.(e),e.defaultPrevented||f?.())},_),j=h?E===S.length-1:!1,M=b(e=>{e.key===`Escape`&&(o?.(e),!e.defaultPrevented&&f&&(e.preventDefault(),f()))});return l.useEffect(()=>{if(j)return _.addEventListener(`keydown`,M,{capture:!0}),()=>_.removeEventListener(`keydown`,M,{capture:!0})},[_,j,M]),l.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(te=_.body.style.pointerEvents,_.body.style.pointerEvents=`none`),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),k(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(h),m.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=te))}},[h,_,n,m]),l.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),k())},[h,m]),l.useEffect(()=>{let e=()=>v({});return document.addEventListener(C,e),()=>document.removeEventListener(C,e)},[]),(0,x.jsx)(a.div,{...p,ref:y,style:{pointerEvents:ne?D?`auto`:`none`:void 0,...e.style},onFocusCapture:c(e.onFocusCapture,A.onFocusCapture),onBlurCapture:c(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:c(e.onPointerDownCapture,re.onPointerDownCapture)})});E.displayName=S;var ne=`DismissableLayerBranch`,D=l.forwardRef((e,t)=>{let n=l.useContext(T),r=l.useRef(null),o=i(t,r);return l.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,x.jsx)(a.div,{...e,ref:o})});D.displayName=ne;function O(){let e=l.useContext(T),[t,n]=l.useState(null);return l.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var re=()=>!0;function ie(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=re}=t,s=b(e),c=l.useRef(!1),u=l.useRef(!1),d=l.useRef(new Map),f=l.useRef(()=>{});return l.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function l(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}function p(e){u.current&&d.current.set(e.type,!1)}let m=a=>{if(a.target&&!c.current){let l=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||A(w,s,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,f.current),e(),c.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?l():(n.removeEventListener(`click`,f.current),f.current=l,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();c.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,l,!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`,f.current);for(let e of h)n.removeEventListener(e,l,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:()=>c.current=!0}}function ae(e,t=globalThis?.document){let n=b(e),r=l.useRef(!1);return l.useEffect(()=>{let e=e=>{e.target&&!r.current&&A(ee,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 k(){let e=new CustomEvent(C);document.dispatchEvent(e)}function A(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?s(i,a):i.dispatchEvent(a)}var j=`focusScope.autoFocusOnMount`,M=`focusScope.autoFocusOnUnmount`,oe={bubbles:!1,cancelable:!0},se=`FocusScope`,ce=l.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=e,[u,d]=l.useState(null),f=b(o),p=b(s),m=l.useRef(null),h=i(t,d),g=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(r){let e=function(e){if(g.paused||!u)return;let t=e.target;u.contains(t)?m.current=t:N(m.current,{select:!0})},t=function(e){if(g.paused||!u)return;let t=e.relatedTarget;t!==null&&(u.contains(t)||N(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&N(u)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return u&&r.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,u,g.paused]),l.useEffect(()=>{if(u){he.add(g);let e=document.activeElement;if(!u.contains(e)){let t=new CustomEvent(j,oe);u.addEventListener(j,f),u.dispatchEvent(t),t.defaultPrevented||(le(ve(de(u)),{select:!0}),document.activeElement===e&&N(u))}return()=>{u.removeEventListener(j,f),setTimeout(()=>{let t=new CustomEvent(M,oe);u.addEventListener(M,p),u.dispatchEvent(t),t.defaultPrevented||N(e??document.body,{select:!0}),u.removeEventListener(M,p),he.remove(g)},0)}}},[u,f,p,g]);let _=l.useCallback(e=>{if(!n&&!r||g.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]=ue(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&N(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&N(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,x.jsx)(a.div,{tabIndex:-1,...c,ref:h,onKeyDown:_})});ce.displayName=se;function le(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(N(r,{select:t}),document.activeElement!==n)return}function ue(e){let t=de(e);return[fe(t,e),fe(t.reverse(),e)]}function de(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 fe(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):pe(r,{upTo:t})))return r}function pe(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 me(e){return e instanceof HTMLInputElement&&`select`in e}function N(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&me(e)&&t&&e.select()}}var he=ge();function ge(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=_e(e,t),e.unshift(t)},remove(t){e=_e(e,t),e[0]?.resume()}}}function _e(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ve(e){return e.filter(e=>e.tagName!==`A`)}var ye=e(n(),1),be=`Portal`,xe=l.forwardRef((e,t)=>{let{container:n,...r}=e,[i,s]=l.useState(!1);o(()=>s(!0),[]);let c=n||i&&globalThis?.document?.body;return c?ye.createPortal((0,x.jsx)(a.div,{...r,ref:t}),c):null});xe.displayName=be;var P=0,F=null;function Se(){l.useEffect(()=>{F||={start:Ce(),end:Ce()};let{start:e,end:t}=F;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),P++,()=>{P===1&&(F?.start.remove(),F?.end.remove(),F=null),P=Math.max(0,P-1)}},[])}function Ce(){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 I=function(){return I=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},I.apply(this,arguments)};function we(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 Te(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 L=`right-scroll-bar-position`,R=`width-before-scroll-bar`,Ee=`with-scroll-bars-hidden`,De=`--removed-body-scroll-bar-size`;function z(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Oe(e,t){var n=(0,l.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 ke=typeof window<`u`?l.useLayoutEffect:l.useEffect,Ae=new WeakMap;function je(e,t){var n=Oe(t||null,function(t){return e.forEach(function(e){return z(e,t)})});return ke(function(){var t=Ae.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||z(e,null)}),i.forEach(function(e){r.has(e)||z(e,a)})}Ae.set(n,e)},[e]),n}function Me(e){return e}function Ne(e,t){t===void 0&&(t=Me);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 Pe(e){e===void 0&&(e={});var t=Ne(null);return t.options=I({async:!0,ssr:!1},e),t}var Fe=function(e){var t=e.sideCar,n=we(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 l.createElement(r,I({},n))};Fe.isSideCarExport=!0;function Ie(e,t){return e.useMedium(t),Fe}var Le=Pe(),B=function(){},V=l.forwardRef(function(e,t){var n=l.useRef(null),r=l.useState({onScrollCapture:B,onWheelCapture:B,onTouchMoveCapture:B}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=we(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=je([n,t]),w=I(I({},x),i);return l.createElement(l.Fragment,null,d&&l.createElement(S,{sideCar:Le,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?l.cloneElement(l.Children.only(s),I(I({},w),{ref:C})):l.createElement(y,I({},w,{className:c,ref:C}),s))});V.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},V.classNames={fullWidth:R,zeroRight:L};var Re,ze=function(){if(Re)return Re;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Be(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ze();return t&&e.setAttribute(`nonce`,t),e}function Ve(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function He(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ue=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Be())&&(Ve(t,n),He(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},We=function(){var e=Ue();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ge=function(){var e=We();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Ke={left:0,top:0,right:0,gap:0},H=function(e){return parseInt(e||``,10)||0},qe=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[H(n),H(r),H(i)]},Je=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Ke;var t=qe(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])}},Ye=Ge(),U=`data-scroll-locked`,Xe=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
+ .${Ee} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${U}] {
7
+ overflow: hidden ${r};
8
+ overscroll-behavior: contain;
9
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
10
+ padding-left: ${i}px;
11
+ padding-top: ${a}px;
12
+ padding-right: ${o}px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: ${s}px ${r};
16
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
+ }
18
+
19
+ .${L} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${R} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${L} .${L} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${R} .${R} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${U}] {
36
+ ${De}: ${s}px;
37
+ }
38
+ `},Ze=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Qe=function(){l.useEffect(function(){return document.body.setAttribute(U,(Ze()+1).toString()),function(){var e=Ze()-1;e<=0?document.body.removeAttribute(U):document.body.setAttribute(U,e.toString())}},[])},$e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Qe();var a=l.useMemo(function(){return Je(i)},[i]);return l.createElement(Ye,{styles:Xe(a,!t,i,n?``:`!important`)})},W=!1;if(typeof window<`u`)try{var G=Object.defineProperty({},"passive",{get:function(){return W=!0,!0}});window.addEventListener(`test`,G,G),window.removeEventListener(`test`,G,G)}catch{W=!1}var K=W?{passive:!1}:!1,et=function(e){return e.tagName===`TEXTAREA`},tt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!et(e)&&n[t]===`visible`)},nt=function(e){return tt(e,`overflowY`)},rt=function(e){return tt(e,`overflowX`)},q=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ot(e,r)){var i=st(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},it=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},at=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ot=function(e,t){return e===`v`?nt(t):rt(t)},st=function(e,t){return e===`v`?it(t):at(t)},ct=function(e,t){return e===`h`&&t===`rtl`?-1:1},lt=function(e,t,n,r,i){var a=ct(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=st(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ot(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},J=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ut=function(e){return[e.deltaX,e.deltaY]},dt=function(e){return e&&`current`in e?e.current:e},ft=function(e,t){return e[0]===t[0]&&e[1]===t[1]},pt=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},mt=0,Y=[];function ht(e){var t=l.useRef([]),n=l.useRef([0,0]),r=l.useRef(),i=l.useState(mt++)[0],a=l.useState(Ge)[0],o=l.useRef(e);l.useEffect(function(){o.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Te([e.lockRef.current],(e.shards||[]).map(dt),!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=l.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=J(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=q(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=q(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 lt(h,t,e,h===`h`?s:c,!0)},[]),c=l.useCallback(function(e){var n=e;if(!(!Y.length||Y[Y.length-1]!==a)){var r=`deltaY`in n?ut(n):J(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&ft(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(dt).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=l.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:gt(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=l.useCallback(function(e){n.current=J(e),r.current=void 0},[]),f=l.useCallback(function(t){u(t.type,ut(t),t.target,s(t,e.lockRef.current))},[]),p=l.useCallback(function(t){u(t.type,J(t),t.target,s(t,e.lockRef.current))},[]);l.useEffect(function(){return Y.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,c,K),document.addEventListener(`touchmove`,c,K),document.addEventListener(`touchstart`,d,K),function(){Y=Y.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,K),document.removeEventListener(`touchmove`,c,K),document.removeEventListener(`touchstart`,d,K)}},[]);var m=e.removeScrollBar,h=e.inert;return l.createElement(l.Fragment,null,h?l.createElement(a,{styles:pt(i)}):null,m?l.createElement($e,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function gt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var _t=Ie(Le,ht),vt=l.forwardRef(function(e,t){return l.createElement(V,I({},e,{ref:t,sideCar:_t}))});vt.classNames=V.classNames;var yt=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},X=new WeakMap,Z=new WeakMap,Q={},$=0,bt=function(e){return e&&(e.host||bt(e.parentNode))},xt=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=bt(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})},St=function(e,t,n,r){var i=xt(t,Array.isArray(e)?e:[e]);Q[n]||(Q[n]=new WeakMap);var a=Q[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=(X.get(e)||0)+1,l=(a.get(e)||0)+1;X.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Z.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(),$++,function(){o.forEach(function(e){var t=X.get(e)-1,i=a.get(e)-1;X.set(e,t),a.set(e,i),t||(Z.has(e)||e.removeAttribute(r),Z.delete(e)),i||e.removeAttribute(n)}),$--,$||(X=new WeakMap,X=new WeakMap,Z=new WeakMap,Q={})}},Ct=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||yt(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),St(r,i,n,`aria-hidden`)):function(){return null}};export{ce as a,b as c,xe as i,y as l,vt as n,E as o,Se as r,O as s,Ct as t,d as u};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-BHp8sXmF.js";var t=e(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]);export{t};
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{i,on as a}from"./project-scope-context-BRvkKGX1.js";import{ht as o}from"./queries-CQWAcH8p.js";import{f as s,p as c}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{ot as l,w as u}from"./design-icons-CzEoMH9c.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{t as f}from"./centered-state-V15AR_qo.js";import{a as p,i as m,r as h}from"./highlighter-DvLzHjjY.js";import{a as g,c as _,d as v,l as y,n as b,o as x,s as S,t as C,u as w}from"./markdown-i80v6qNq.js";var T=d(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),E=d(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),D=d(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),O=e(t(),1),k=n(),A=[[`scripts`,`remote script`,`remote scripts`],[`remote`,`remote resource`,`remote resources`],[`relative`,`linked file next to the report`,`linked files next to the report`],[`forms`,`form`,`forms`],[`embeds`,`embedded frame or object`,`embedded frames or objects`]];function j(e){let t=A.filter(([t])=>e[t]>0).map(([t,n,r])=>`${e[t]} ${e[t]===1?n:r}`);return t.length?t.join(`, `):null}var M={};function N(e){let t=(0,O.useMemo)(()=>w(e),[e]).join(` `),[n,r]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(!t)return;let e=!0;return v(t.split(` `)).then(n=>{e&&r({key:t,libraries:n})}),()=>{e=!1}},[t]),t?n?.key===t?n.libraries:null:M}function P({html:e,title:t,fragment:n,className:i}){let a=N(e);return a?(0,k.jsx)(F,{html:e,title:t,fragment:n,className:i,libraries:a}):(0,k.jsx)(`div`,{"data-slot":`html-report`,"aria-busy":`true`,className:r(`flex min-h-0 flex-col`,i)})}function F({html:e,title:t,fragment:n,className:i,libraries:a}){let{srcdoc:o,blocked:s}=(0,O.useMemo)(()=>{let n=_(e,a);return{srcdoc:y(n.srcdoc,t),blocked:n.blocked}},[e,a,t]),c=e=>{n&&/^#\S+$/.test(n)&&e.currentTarget.contentWindow?.frames[0]?.location.replace(`about:srcdoc${n}`)},l=j(s);return(0,k.jsxs)(`div`,{"data-slot":`html-report`,className:r(`flex min-h-0 flex-col`,i),children:[l?(0,k.jsxs)(`p`,{"data-slot":`html-report-blocked`,role:`note`,className:`border-b border-border bg-muted/40 px-4 py-2 text-xs text-foreground`,children:[`Blocked for your safety: `,l,`. Reports show only what they carry inside the file.`]}):null,(0,k.jsx)(`iframe`,{"data-slot":`html-report-frame`,title:t,sandbox:x,allow:g,srcDoc:o,referrerPolicy:`no-referrer`,onLoad:c,className:`block min-h-0 w-full flex-1 border-0 bg-report-canvas`})]})}var I=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function L(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:I.has(t.slice(n+1).toLowerCase())}function R(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return L(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}function z(e){return e.tooLarge?`too-large`:R(e.path)?`image`:e.binary?`binary`:`text`}function B(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}function V({runId:e,path:t,className:n}){let r=o(e,t??void 0);if(t===null)return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(u,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(r.isPending)return(0,k.jsx)(K,{className:n,children:(0,k.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof i&&r.error.status===409;return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:e?(0,k.jsx)(D,{}):(0,k.jsx)(l,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,k.jsx)(H,{runId:e,entry:r.data,className:n}):(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function H({runId:e,entry:t,className:n,imageUrl:r,downloadUrl:i,snapshot:a,readerHref:o,documentPreview:s=!1}){let[c,l]=(0,O.useState)(!1),u=s&&/\.(?:md|markdown)$/i.test(t.path),d=s&&S(t.path),f=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(t.path),p=s&&f&&t.size<=10*1024*1024?`image`:z(t),m=(u||d)&&p===`text`;return(0,k.jsxs)(K,{className:n,children:[(0,k.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,k.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,k.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:B(t.size)})]}),a||i||m?(0,k.jsx)(W,{snapshot:a,downloadUrl:i,source:m?c:null,onSource:()=>l(e=>!e),readerHref:d&&p===`text`?o:void 0}):null,(0,k.jsx)(U,{runId:e,entry:t,kind:p,showImage:p===`image`&&(!s||f),rendered:c?null:u?`markdown`:d?`html`:null,imageUrl:r})]})}function U({runId:e,entry:t,kind:n,showImage:r,rendered:i,imageUrl:o}){return r?(0,k.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,k.jsx)(`img`,{"data-slot":`file-preview-image`,src:o??a(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):n===`too-large`?(0,k.jsx)(f,{icon:(0,k.jsx)(T,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${B(t.size)} — past the preview cap. Open it in your editor instead.`}):n===`binary`?(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${B(t.size)} of binary data — no text preview.`}):i===`markdown`?(0,k.jsx)(`div`,{className:`p-4`,children:(0,k.jsx)(C,{document:!0,children:t.content??``})}):i===`html`?(0,k.jsx)(P,{html:t.content??``,title:`Report: ${t.path}`,className:`h-[70vh]`}):(0,k.jsx)(Y,{path:t.path,text:t.content??``})}function W({snapshot:e,downloadUrl:t,source:n,onSource:r,readerHref:i}){return(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[e?(0,k.jsxs)(`span`,{children:[`Published snapshot · `,e]}):null,t?(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:t,children:`Download`}):null,n===null?null:(0,k.jsx)(`button`,{className:`min-h-11 rounded px-2 text-accent-text underline focus-visible:ring-2`,onClick:r,children:n?`Preview`:`View source`}),i?(0,k.jsx)(G,{href:i}):null]})}function G({href:e}){let t=c(),n=s();return(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center px-2 text-accent-text underline focus-visible:ring-2`,href:e,onClick:r=>b(r,t,e,n),children:`Open reader`})}function K({className:e,children:t}){return(0,k.jsx)(`section`,{"data-slot":`file-preview`,className:r(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var q=1500;function J(e,t){let n=(0,O.useMemo)(()=>t.split(`
2
+ `).map(e=>[{content:e}]),[t]),r=(0,O.useMemo)(()=>p(e),[e]),i=n.length>q,[a,o]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(r===null||i)return;let n=!1;return h(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:m(t,r)?.tokens??n}function Y({path:e,text:t}){let n=J(e,t);return(0,k.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":p(e)??`plaintext`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7]`,children:n.map((e,t)=>(0,k.jsxs)(`div`,{className:`flex px-4`,children:[(0,k.jsx)(`span`,{className:`w-10 shrink-0 select-none pr-3 text-right tabular-nums text-soft-foreground`,children:t+1}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre pr-4`,children:e.map((e,t)=>(0,k.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})}export{R as a,E as c,B as i,T as l,H as n,P as o,V as r,D as s,Y as t};