@sanurb/ringi 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +534 -1598
- package/dist/cli.mjs.map +1 -1
- package/dist/mcp.mjs +4 -4
- package/dist/runtime.mjs +2437 -2437
- package/dist/runtime.mjs.map +1 -1
- package/package.json +2 -1
- package/server/nitro.json +1 -1
- package/server/public/assets/{_reviewId-DdOpDx4U.js → _reviewId-DszBZzPS.js} +1 -1
- package/server/public/assets/{main-FvxVz-kD.js → main-BQVB_Z0Z.js} +2 -2
- package/server/public/assets/{new-DOyplRwM.js → new-BpF6zgAP.js} +1 -1
- package/server/public/assets/{reviews-CfbuF6ib.js → reviews-Cqy8KE2-.js} +1 -1
- package/server/public/assets/reviews-YuW-Er6I.js +1 -0
- package/server/public/assets/{routes-DNxq1Fba.js → routes-Bp_N1q52.js} +1 -1
- package/server/public/assets/{routes-Dp0ODZ55.js → routes-CdmXLllM.js} +1 -1
- package/server/server/_chunks/ssr-renderer.mjs +2 -2
- package/server/server/_libs/effect+[...].mjs +396 -193
- package/server/server/{_reviewId-AWnOGz5k.mjs → _reviewId-BBo0j3l1.mjs} +2 -2
- package/server/server/{_reviewId-p9mhYVwa.mjs → _reviewId-CBLnTeaJ.mjs} +2 -2
- package/server/server/{_reviewId-DAhmekJ2.mjs → _reviewId-Ce1qqku3.mjs} +3 -3
- package/server/server/_ssr/action-bar-C68xGnWW.mjs +1 -1
- package/server/server/_ssr/{api-handler-CstW2n82.mjs → api-handler-yxu7Cbl5.mjs} +35 -3
- package/server/server/_ssr/client-runtime-BoPuAEoA.mjs +1 -1
- package/server/server/_ssr/domain-rpc-3Ds9DPr0.mjs +1 -1
- package/server/server/_ssr/file-tree-CQ5w2GHh.mjs +1 -1
- package/server/server/_ssr/load-scoped-diff-NL2XAcdz.mjs +2 -2
- package/server/server/_ssr/new-BKl_G2Ks.mjs +1 -1
- package/server/server/_ssr/new-DCz5eHkb.mjs +1 -1
- package/server/server/_ssr/reviews-C7_NIhY8.mjs +1 -1
- package/server/server/_ssr/{router-DLxN8FOm.mjs → router-5hEjszhz.mjs} +4 -4
- package/server/server/_ssr/routes-lz0AN75A.mjs +1 -1
- package/server/server/_ssr/runtime-D9IbnMlF.mjs +1 -1
- package/server/server/_ssr/ssr.mjs +7 -7
- package/server/server/_ssr/todo-m_uUvxca.mjs +1 -1
- package/server/server/{_tanstack-start-manifest_v-CnL10NRH.mjs → _tanstack-start-manifest_v--jyOFxuR.mjs} +9 -9
- package/server/server/index.mjs +905 -905
- package/server/public/assets/reviews-CJvVXRLH.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanurb/ringi",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Local-first code review tool for AI-generated changes — CLI and MCP server",
|
|
5
5
|
"homepage": "https://github.com/sanurb/ringi#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"@effect/platform-node": "4.0.0-beta.41",
|
|
32
33
|
"effect": "4.0.0-beta.41"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
package/server/nitro.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{O as i,b as a,h as o,m as s,n as c,r as l,v as u,y as d}from"./preload-helper-D7oT-Xwl.js";import{t as f}from"./main-
|
|
1
|
+
import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{O as i,b as a,h as o,m as s,n as c,r as l,v as u,y as d}from"./preload-helper-D7oT-Xwl.js";import{t as f}from"./main-BQVB_Z0Z.js";import{t as p}from"./action-bar-DLRNvLjj.js";import{i as m,n as h,r as g,t as _}from"./file-tree-CI3Xwwid.js";import{t as v}from"./utils-DElCu2hq.js";var y=t(n()),b=r(),x=e();function S(e){let t=new Map;for(let n of e){let e=t.get(n.filePath);e?e.push(n):t.set(n.filePath,[n])}return[...t.entries()]}function C(){let e=(0,b.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-text-tertiary`,children:(0,x.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`})}),e[0]=t):t=e[0],t}function w(){let e=(0,b.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(`div`,{className:`flex flex-1 flex-col items-center justify-center px-4`,children:(0,x.jsx)(C,{})}),e[0]=t):t=e[0],t}function T(e){let t=(0,b.c)(13),{comment:n,index:r}=e,i=`${r*40}ms`,a;t[0]===i?a=t[1]:(a={animationDelay:i},t[0]=i,t[1]=a);let o;t[2]===n.lineNumber?o=t[3]:(o=n.lineNumber!=null&&(0,x.jsxs)(`span`,{className:`font-mono text-[10px] text-text-tertiary`,children:[`L`,n.lineNumber]}),t[2]=n.lineNumber,t[3]=o);let s;t[4]===n.content?s=t[5]:(s=(0,x.jsx)(`p`,{className:`whitespace-pre-wrap text-xs text-text-secondary`,children:n.content}),t[4]=n.content,t[5]=s);let c;t[6]===n.resolved?c=t[7]:(c=n.resolved&&(0,x.jsx)(`span`,{className:`text-[10px] text-status-success`,children:`Resolved`}),t[6]=n.resolved,t[7]=c);let l;return t[8]!==a||t[9]!==o||t[10]!==s||t[11]!==c?(l=(0,x.jsxs)(`div`,{className:`ringi-comment-card flex flex-col gap-1 rounded border border-border-subtle bg-surface-elevated px-2.5 py-2 animate-in fade-in duration-100`,style:a,children:[o,s,c]}),t[8]=a,t[9]=o,t[10]=s,t[11]=c,t[12]=l):l=t[12],l}function E(e){let t=(0,b.c)(7),{filePath:n,comments:r}=e,i;t[0]===n?i=t[1]:(i=(0,x.jsx)(`span`,{className:`truncate font-mono text-[10px] text-text-tertiary`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r.map(D),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function D(e,t){return(0,x.jsx)(T,{comment:e,index:t},e.id)}function O(e){let t=(0,b.c)(8),{comments:n,isOpen:r}=e,i;if(t[0]!==n||t[1]!==r){let e=S(n),a=r?`translate-x-0 opacity-100`:`pointer-events-none translate-x-full opacity-0`,o;t[3]===a?o=t[4]:(o=v(`ringi-annotations-panel flex w-64 shrink-0 flex-col overflow-hidden border-l border-border-default bg-surface-secondary transition-[transform,opacity] duration-200 [transition-timing-function:cubic-bezier(0.23,1,0.32,1)]`,a),t[3]=a,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,x.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-widest text-text-tertiary`,children:`Annotations`}),t[5]=s):s=t[5];let c;t[6]===n.length?c=t[7]:(c=(0,x.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border-subtle px-3 py-2.5`,children:[s,(0,x.jsx)(`span`,{className:`rounded-full bg-surface-overlay px-1.5 text-[10px] text-text-secondary`,children:n.length})]}),t[6]=n.length,t[7]=c),i=(0,x.jsxs)(`aside`,{"aria-hidden":!r,className:o,children:[c,n.length===0?(0,x.jsx)(w,{}):(0,x.jsx)(`div`,{className:`flex flex-1 flex-col gap-3 overflow-y-auto p-3`,children:e.map(k)})]}),t[0]=n,t[1]=r,t[2]=i}else i=t[2];return i}function k(e){let[t,n]=e;return(0,x.jsx)(E,{filePath:t,comments:n},t)}var A=(e,t)=>s(function*(){let{http:n}=yield*l;return yield*n.reviews.update({path:{id:e},payload:{status:i(t)}})}),j=(e,t)=>{switch(t.type){case`SET_STATUS`:return{...e,status:t.status};case`TOGGLE_DIFF_MODE`:return{...e,diffMode:e.diffMode===`split`?`unified`:`split`};case`TOGGLE_ANNOTATIONS`:return{...e,annotationsOpen:!e.annotationsOpen};case`SET_EXPORT_OPEN`:return{...e,exportOpen:t.open};case`SELECT_FILE`:return{...e,selectedFile:t.path};case`TOGGLE_VIEWED`:{let n=new Set(e.viewedFiles);return n.has(t.filePath)?n.delete(t.filePath):n.add(t.filePath),{...e,viewedFiles:n}}case`COMMENT_RESOLVED`:return{...e,unresolvedCount:Math.max(0,e.unresolvedCount-1)};case`COMMENT_UNRESOLVED`:return{...e,unresolvedCount:e.unresolvedCount+1};case`COMMENT_ADDED`:return{...e,unresolvedCount:e.unresolvedCount+1};case`COMMENT_DELETED`:return{...e,unresolvedCount:t.wasResolved?e.unresolvedCount:Math.max(0,e.unresolvedCount-1)};default:return e}},M=()=>{let e=(0,b.c)(64),t=f.useLoaderData(),n;e[0]===t.files?n=e[1]:(n=t.files.map(N),e[0]=t.files,e[1]=n);let r=n,i=r[0]?.newPath??null,o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Set,e[2]=o):o=e[2];let s;e[3]!==t.commentStats.unresolved||e[4]!==t.status||e[5]!==i?(s={annotationsOpen:!0,diffMode:`split`,exportOpen:!1,selectedFile:i,status:t.status,unresolvedCount:t.commentStats.unresolved,viewedFiles:o},e[3]=t.commentStats.unresolved,e[4]=t.status,e[5]=i,e[6]=s):s=e[6];let[l,v]=(0,y.useReducer)(j,s),S;e[7]!==r||e[8]!==l.selectedFile?(S=r.find(e=>e.newPath===l.selectedFile)??null,e[7]=r,e[8]=l.selectedFile,e[9]=S):S=e[9];let C=S,w;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{v({path:e,type:`SELECT_FILE`})},e[10]=w):w=e[10];let T=w,E;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{v({filePath:e,type:`TOGGLE_VIEWED`})},e[11]=E):E=e[11];let D=E,k;e[12]===t.id?k=e[13]:(k=e=>{c.runFork(A(t.id,e).pipe(d(()=>u(()=>v({status:e,type:`SET_STATUS`}))),a(P)))},e[12]=t.id,e[13]=k);let M=k,F;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>{v({type:`TOGGLE_DIFF_MODE`})},e[14]=F):F=e[14];let I=F,L;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{v({type:`TOGGLE_ANNOTATIONS`})},e[15]=L):L=e[15];let R=L,z;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(z=()=>{v({open:!0,type:`SET_EXPORT_OPEN`})},e[16]=z):z=e[16];let B=z,V;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>{v({open:e,type:`SET_EXPORT_OPEN`})},e[17]=V):V=e[17];let H=V,U=t.summary,W;e[18]===t.repositoryPath?W=e[19]:(W=t.repositoryPath.split(`/`).pop()??t.repositoryPath,e[18]=t.repositoryPath,e[19]=W);let G=W,K;e[20]!==t.baseRef||e[21]!==t.sourceRef||e[22]!==t.sourceType?(K=t.sourceRef?`${t.sourceRef}${t.baseRef?` → ${t.baseRef}`:``}`:`${t.sourceType.charAt(0).toUpperCase()}${t.sourceType.slice(1)} snapshot`,e[20]=t.baseRef,e[21]=t.sourceRef,e[22]=t.sourceType,e[23]=K):K=e[23];let q;e[24]!==t.id||e[25]!==r.length||e[26]!==M||e[27]!==G||e[28]!==l.annotationsOpen||e[29]!==l.diffMode||e[30]!==l.status||e[31]!==l.unresolvedCount||e[32]!==l.viewedFiles.size||e[33]!==K?(q=(0,x.jsx)(p,{repoName:G,reviewId:t.id,status:l.status,onStatusChange:M,sourceDescription:K,diffMode:l.diffMode,onToggleDiffMode:I,reviewedFileCount:l.viewedFiles.size,totalFileCount:r.length,unresolvedCount:l.unresolvedCount,isAnnotationsOpen:l.annotationsOpen,onToggleAnnotations:R,onExport:B}),e[24]=t.id,e[25]=r.length,e[26]=M,e[27]=G,e[28]=l.annotationsOpen,e[29]=l.diffMode,e[30]=l.status,e[31]=l.unresolvedCount,e[32]=l.viewedFiles.size,e[33]=K,e[34]=q):q=e[34];let J;e[35]!==r||e[36]!==l.selectedFile||e[37]!==l.viewedFiles?(J=(0,x.jsx)(_,{files:r,selectedFile:l.selectedFile,onSelectFile:T,reviewedFiles:l.viewedFiles,onToggleViewed:D}),e[35]=r,e[36]=l.selectedFile,e[37]=l.viewedFiles,e[38]=J):J=e[38];let Y;e[39]!==t.comments||e[40]!==t.id||e[41]!==U||e[42]!==C||e[43]!==l.diffMode||e[44]!==l.selectedFile||e[45]!==l.viewedFiles?(Y=(0,x.jsx)(`div`,{className:`flex-1 overflow-y-auto bg-surface-primary p-4`,children:C?(0,x.jsxs)(`div`,{className:`space-y-3`,children:[(0,x.jsx)(g,{summary:U}),(0,x.jsx)(h,{file:C,reviewId:t.id,diffMode:l.diffMode,comments:t.comments,viewed:l.selectedFile?l.viewedFiles.has(l.selectedFile):!1,onToggleViewed:D})]}):(0,x.jsx)(`div`,{className:`rounded-sm border border-border-default bg-surface-elevated p-8 text-center`,children:(0,x.jsx)(`p`,{className:`text-sm text-text-tertiary`,children:`Select a file to view its diff.`})})}),e[39]=t.comments,e[40]=t.id,e[41]=U,e[42]=C,e[43]=l.diffMode,e[44]=l.selectedFile,e[45]=l.viewedFiles,e[46]=Y):Y=e[46];let X;e[47]!==t.comments||e[48]!==t.id||e[49]!==l.annotationsOpen||e[50]!==l.selectedFile?(X=(0,x.jsx)(O,{comments:t.comments,selectedFile:l.selectedFile,reviewId:t.id,isOpen:l.annotationsOpen}),e[47]=t.comments,e[48]=t.id,e[49]=l.annotationsOpen,e[50]=l.selectedFile,e[51]=X):X=e[51];let Z;e[52]!==J||e[53]!==Y||e[54]!==X?(Z=(0,x.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[J,Y,X]}),e[52]=J,e[53]=Y,e[54]=X,e[55]=Z):Z=e[55];let Q;e[56]!==t.comments||e[57]!==t.id||e[58]!==l.exportOpen?(Q=(0,x.jsx)(m,{open:l.exportOpen,onOpenChange:H,comments:t.comments,reviewId:t.id}),e[56]=t.comments,e[57]=t.id,e[58]=l.exportOpen,e[59]=Q):Q=e[59];let $;return e[60]!==q||e[61]!==Z||e[62]!==Q?($=(0,x.jsxs)(`div`,{className:`flex h-full flex-col`,children:[q,Z,Q]}),e[60]=q,e[61]=Z,e[62]=Q,e[63]=$):$=e[63],$};function N(e){return{additions:e.additions,deletions:e.deletions,hunks:[],newPath:e.filePath,oldPath:e.oldPath??e.filePath,status:e.status}}function P(e){return o(`Failed to update review status`,e)}export{M as component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/test-D7JRfog1.js","assets/compiler-runtime-DZXZ41-q.js","assets/reviews-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/test-D7JRfog1.js","assets/compiler-runtime-DZXZ41-q.js","assets/reviews-Cqy8KE2-.js","assets/routes-CdmXLllM.js","assets/preload-helper-D7oT-Xwl.js","assets/useStore-M3H8PB1v.js","assets/file-tree-CI3Xwwid.js","assets/action-bar-DLRNvLjj.js","assets/utils-DElCu2hq.js","assets/routes-Bp_N1q52.js","assets/reviews-YuW-Er6I.js","assets/createServerFn-DTk395iP.js","assets/ClientOnly-QdfAxyFs.js","assets/new-BpF6zgAP.js","assets/_reviewId-CmXHvWLn.js","assets/_reviewId-DszBZzPS.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{i as e,n as t,o as n,r,t as i}from"./compiler-runtime-DZXZ41-q.js";import{B as a,I as o,S as s,V as c,f as l,i as u,j as d,k as f,m as p,n as m,p as h,r as g,t as _,v,y,z as b}from"./preload-helper-D7oT-Xwl.js";import{c as x,i as S,n as C,o as w,r as ee,s as te,t as T}from"./createServerFn-DTk395iP.js";import{_ as E,a as ne,b as re,c as ie,d as ae,f as oe,h as se,i as D,l as O,m as ce,o as le,p as ue,r as de,s as fe,t as k,u as pe,v as me,y as he}from"./useStore-M3H8PB1v.js";import{C as ge,S as _e,T as ve,_ as ye,b as be,c as xe,d as Se,g as Ce,l as we,m as Te,n as Ee,o as De,p as Oe,r as ke,s as Ae,t as je,u as Me,w as Ne,x as Pe,y as Fe}from"./ClientOnly-QdfAxyFs.js";var Ie=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,E());else{var t=n(l);t!==null&&ie(x,t.startTime-e)}}var S=!1,C=-1,w=5,ee=-1;function te(){return g?!0:!(e.unstable_now()-ee<w)}function T(){if(g=!1,S){var t=e.unstable_now();ee=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?E():S=!1}}}var E;if(typeof y==`function`)E=function(){y(T)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=T,E=function(){re.postMessage(null)}}else E=function(){_(T,0)};function ie(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,E()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Le=e(((e,t)=>{t.exports=Ie()})),Re=e((e=>{var t=Le(),n=r(),i=c();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(s(e)!==e)throw Error(a(188))}function f(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return d(i),e;if(o===r)return d(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),ne=Symbol.for(`react.memo_cache_sentinel`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Symbol.for(`react.client.reference`);function oe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case w:return`Suspense`;case ee:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case te:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var se=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function k(e,t){ue++,le[ue]=e.current,e.current=t}var pe=de(null),me=de(null),he=de(null),ge=de(null);function _e(e,t){switch(k(he,t),k(me,e),k(pe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(pe),k(pe,e)}function ve(){fe(pe),fe(me),fe(he)}function ye(e){e.memoizedState!==null&&k(ge,e);var t=pe.current,n=Hd(t,e.type);t!==n&&(k(me,e),k(pe,n))}function be(e){me.current===e&&(fe(pe),fe(me)),ge.current===e&&(fe(ge),Qf._currentValue=ce)}var xe,Se;function Ce(e){if(xe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||``,Se=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+xe+e+Se}var we=!1;function Te(e,t){if(!e||we)return``;we=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -12,4 +12,4 @@ Error generating stack: `+e.message+`
|
|
|
12
12
|
? — Show this help
|
|
13
13
|
n — New review (on Changes/Reviews pages)
|
|
14
14
|
r — Go to Reviews (on Changes page)
|
|
15
|
-
c — Go to Changes (on Reviews page)`)}function hr(e){return!e}var gr=ee(`/test`)({component:C(()=>_(()=>import(`./test-D7JRfog1.js`),__vite__mapDeps([0,1])),`component`)}),_r=ee(`/reviews`)({component:C(()=>_(()=>import(`./reviews-
|
|
15
|
+
c — Go to Changes (on Reviews page)`)}function hr(e){return!e}var gr=ee(`/test`)({component:C(()=>_(()=>import(`./test-D7JRfog1.js`),__vite__mapDeps([0,1])),`component`)}),_r=ee(`/reviews`)({component:C(()=>_(()=>import(`./reviews-Cqy8KE2-.js`),__vite__mapDeps([2,1])),`component`)}),vr=`staged`,yr=e=>typeof e==`string`&&u.includes(e),br=e=>yr(e)?e:vr,xr=T({method:`GET`}).handler(w(`367245383f9546b6fd4dc5f473195892e7eabc03edaced380dedab17ad1518ad`)),Sr=ee(`/`)({component:C(()=>_(()=>import(`./routes-CdmXLllM.js`),__vite__mapDeps([3,1,4,5,6,7,8])),`component`),errorComponent:C(()=>_(()=>import(`./routes-Bp_N1q52.js`),__vite__mapDeps([9,1,8])),`errorComponent`),loader:({deps:e})=>xr({data:{scope:br(e.scope)}}),loaderDeps:({search:e})=>({scope:br(e.scope)})}),Cr=()=>_(()=>import(`./reviews-YuW-Er6I.js`),__vite__mapDeps([10,1,4,5,7,8,11,12])),wr=T({method:`GET`}).handler(w(`ef00136dd20ec37765a8f42cad846e072de11bf51dbffbdc25b2722522e391d3`)),Tr=ee(`/reviews/`)({component:C(Cr,`component`),loader:()=>wr()}),Er=()=>_(()=>import(`./new-BpF6zgAP.js`),__vite__mapDeps([13,1,4,5,7,8,11,12])),Dr=T({method:`GET`}).handler(w(`b537fee0f6819f860391360c1ec8ca70eabf81955ba0c4b7c59a6f7391291e15`)),Or=ee(`/reviews/new`)({component:C(Er,`component`),loader:()=>Dr()}),kr=()=>_(()=>import(`./_reviewId-CmXHvWLn.js`),__vite__mapDeps([14,1])),Ar=()=>_(()=>import(`./_reviewId-DszBZzPS.js`),__vite__mapDeps([15,1,4,5,6,7,8])),jr=T({method:`GET`}).handler(w(`d17f62149492ac39d233ae8a98fd9e6f8cb42fca22b195a215054e1e2ad0ea53`)),Mr=ee(`/reviews/$reviewId`)({component:C(Ar,`component`),errorComponent:C(kr,`errorComponent`),loader:({params:e})=>jr({data:{reviewId:e.reviewId}})}),Nr=gr.update({id:`/test`,path:`/test`,getParentRoute:()=>dr}),Pr=_r.update({id:`/reviews`,path:`/reviews`,getParentRoute:()=>dr}),Fr=Sr.update({id:`/`,path:`/`,getParentRoute:()=>dr}),Ir=Tr.update({id:`/`,path:`/`,getParentRoute:()=>Pr}),Lr=Or.update({id:`/new`,path:`/new`,getParentRoute:()=>Pr}),Rr={ReviewsReviewIdRoute:Mr.update({id:`/$reviewId`,path:`/$reviewId`,getParentRoute:()=>Pr}),ReviewsNewRoute:Lr,ReviewsIndexRoute:Ir},zr={IndexRoute:Fr,ReviewsRoute:Pr._addFileChildren(Rr),TestRoute:Nr},Br=dr._addFileChildren(zr),Vr=()=>Jn({defaultPreloadStaleTime:0,routeTree:Br,scrollRestoration:!0});async function Hr(){let e=await Vr(),t=[];return window.__TSS_START_OPTIONS__={serializationAdapters:t},t.push(tn),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:``,serializationAdapters:t}),e.stores.matchesId.state.length||await an(e),e}async function Ur(){let e=await Hr();return window.$_TSR?.h(),e}var Wr;function Gr(){return Wr||=Ur(),(0,j.jsx)(sn,{promise:Wr,children:e=>(0,j.jsx)(Zn,{router:e})})}var Kr=ze();(0,A.startTransition)(()=>{(0,Kr.hydrateRoot)(document,(0,j.jsx)(A.StrictMode,{children:(0,j.jsx)(Gr,{})}))});export{Un as a,or as i,Or as n,Tr as r,Mr as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t,r as n}from"./compiler-runtime-DZXZ41-q.js";import{N as r,T as i,b as a,m as o,n as s,r as c,v as l,y as u}from"./preload-helper-D7oT-Xwl.js";import{a as d}from"./createServerFn-DTk395iP.js";import{n as f}from"./main-
|
|
1
|
+
import{n as e,o as t,r as n}from"./compiler-runtime-DZXZ41-q.js";import{N as r,T as i,b as a,m as o,n as s,r as c,v as l,y as u}from"./preload-helper-D7oT-Xwl.js";import{a as d}from"./createServerFn-DTk395iP.js";import{n as f}from"./main-BQVB_Z0Z.js";import{t as p}from"./action-bar-DLRNvLjj.js";var m=t(n()),h=e();function g(){let e=f.useLoaderData(),t=r(),[n,g]=(0,m.useState)(!1),[_,v]=(0,m.useState)(null);return(0,h.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,h.jsx)(p,{repoName:e.repository.name,branchName:e.repository.branch}),(0,h.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,h.jsxs)(`div`,{className:`mx-auto max-w-xl px-6 py-6`,children:[(0,h.jsx)(`div`,{className:`mb-5`,children:(0,h.jsx)(d,{to:`/`,className:`text-xs text-text-tertiary transition-colors hover:text-text-secondary`,children:`← Back to changes`})}),(0,h.jsx)(`h1`,{className:`mb-5 text-sm font-semibold text-text-primary`,children:`New Review`}),(0,h.jsxs)(`div`,{className:`mb-4 rounded-sm border border-border-default bg-surface-elevated p-3`,children:[(0,h.jsx)(`h2`,{className:`mb-2 text-xs font-medium text-text-tertiary`,children:`Repository`}),(0,h.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,h.jsxs)(`div`,{className:`flex justify-between`,children:[(0,h.jsx)(`span`,{className:`text-xs text-text-tertiary`,children:`Name`}),(0,h.jsx)(`span`,{className:`text-xs text-text-primary`,children:e.repository.name})]}),(0,h.jsxs)(`div`,{className:`flex justify-between`,children:[(0,h.jsx)(`span`,{className:`text-xs text-text-tertiary`,children:`Branch`}),(0,h.jsx)(`span`,{className:`text-xs text-text-primary`,children:e.repository.branch})]})]})]}),(0,h.jsxs)(`div`,{className:`mb-4 rounded-sm border border-border-default bg-surface-elevated p-3`,children:[(0,h.jsx)(`h2`,{className:`mb-2 text-xs font-medium text-text-tertiary`,children:`Staged Changes`}),e.hasStagedChanges?(0,h.jsxs)(`div`,{className:`flex gap-4`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`text-lg font-bold text-text-primary`,children:e.stagedSummary.filesChanged}),(0,h.jsx)(`span`,{className:`ml-1 text-xs text-text-tertiary`,children:e.stagedSummary.filesChanged===1?`file`:`files`})]}),(0,h.jsx)(`div`,{children:(0,h.jsxs)(`span`,{className:`text-lg font-bold text-status-success`,children:[`+`,e.stagedSummary.additions]})}),(0,h.jsx)(`div`,{children:(0,h.jsxs)(`span`,{className:`text-lg font-bold text-status-error`,children:[`-`,e.stagedSummary.deletions]})})]}):(0,h.jsxs)(`p`,{className:`text-xs text-text-tertiary`,children:[`No staged changes. Stage some files first with`,` `,(0,h.jsx)(`code`,{className:`rounded bg-surface-overlay px-1 py-0.5 text-[10px] text-text-secondary`,children:`git add`})]})]}),_&&(0,h.jsx)(`div`,{className:`mb-3 rounded-sm border border-status-error/30 bg-status-error/10 p-2.5 text-xs text-status-error`,children:_}),(0,h.jsx)(`button`,{type:`button`,onClick:()=>{g(!0),v(null),s.runFork(o(function*(){let{http:e}=yield*c;return yield*e.reviews.create({payload:{sourceRef:null,sourceType:`staged`}})}).pipe(u(e=>l(()=>t({params:{reviewId:e.id},to:`/reviews/$reviewId`}))),a(e=>l(()=>{v(i(e)),g(!1)}))))},disabled:!e.hasStagedChanges||n,className:`w-full rounded-sm bg-accent-primary px-4 py-2.5 text-xs font-medium text-white transition-colors hover:bg-accent-primary/90 disabled:cursor-not-allowed disabled:opacity-50`,children:n?`Creating...`:`Create Review`})]})})]})}export{g as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./compiler-runtime-DZXZ41-q.js";import{a as n}from"./main-
|
|
1
|
+
import{n as e,t}from"./compiler-runtime-DZXZ41-q.js";import{a as n}from"./main-BQVB_Z0Z.js";var r=t(),i=e(),a=()=>{let e=(0,r.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,i.jsx)(n,{}),e[0]=t):t=e[0],t};export{a as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./compiler-runtime-DZXZ41-q.js";import{N as r}from"./preload-helper-D7oT-Xwl.js";import{a as i}from"./createServerFn-DTk395iP.js";import{i as a,r as o}from"./main-BQVB_Z0Z.js";import{t as s}from"./action-bar-DLRNvLjj.js";import{t as c}from"./utils-DElCu2hq.js";var l=n();t();var u=e(),d={approved:`bg-status-success/15 text-status-success`,changes_requested:`bg-status-error/15 text-status-error`,in_progress:`bg-status-warning/15 text-status-warning`},f={branch:`Branch`,commits:`Commits`,staged:`Staged`};function p(){let e=(0,l.c)(7),t=o.useLoaderData(),n=r(),c;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={description:`New review`,handler:h,key:`n`},e[0]=c):c=e[0];let d;e[1]===n?d=e[2]:(d=[c,{description:`Go to Changes`,handler:()=>n({to:`/`}),key:`c`}],e[1]=n,e[2]=d),a(d);let f;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,u.jsx)(s,{}),e[3]=f):f=e[3];let p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,u.jsxs)(`div`,{className:`mb-5 flex items-center justify-between`,children:[(0,u.jsx)(`h1`,{className:`text-sm font-semibold text-text-primary`,children:`Reviews`}),(0,u.jsx)(i,{to:`/reviews/new`,className:`rounded-sm bg-accent-primary px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent-primary/90`,children:`New Review`})]}),e[4]=p):p=e[4];let g;return e[5]===t.reviews?g=e[6]:(g=(0,u.jsxs)(`div`,{className:`flex h-full flex-col`,children:[f,(0,u.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,u.jsxs)(`div`,{className:`mx-auto max-w-3xl px-6 py-6`,children:[p,t.reviews.length===0?(0,u.jsxs)(`div`,{className:`rounded-sm border border-border-default bg-surface-elevated p-8 text-center`,children:[(0,u.jsx)(`p`,{className:`text-sm text-text-secondary`,children:`No reviews yet.`}),(0,u.jsx)(`p`,{className:`mt-1 text-xs text-text-tertiary`,children:`Stage some changes and create a review.`})]}):(0,u.jsx)(`div`,{className:`space-y-1`,children:t.reviews.map(m)})]})})]}),e[5]=t.reviews,e[6]=g),g}function m(e){return(0,u.jsx)(g,{review:e},e.id)}function h(){window.location.href=`/reviews/new`}function g(e){let t=(0,l.c)(32),{review:n}=e,r;t[0]===n.id?r=t[1]:(r={reviewId:n.id},t[0]=n.id,t[1]=r);let a=d[n.status]??`bg-surface-overlay text-text-tertiary`,o;t[2]===a?o=t[3]:(o=c(`rounded-full px-2 py-0.5 text-xs font-medium capitalize`,a),t[2]=a,t[3]=o);let s;t[4]===n.status?s=t[5]:(s=n.status.replace(`_`,` `),t[4]=n.status,t[5]=s);let p;t[6]!==o||t[7]!==s?(p=(0,u.jsx)(`span`,{className:o,children:s}),t[6]=o,t[7]=s,t[8]=p):p=t[8];let m=f[n.sourceType]??n.sourceType,h;t[9]===m?h=t[10]:(h=(0,u.jsx)(`span`,{className:`text-xs text-text-tertiary`,children:m}),t[9]=m,t[10]=h);let g;t[11]!==p||t[12]!==h?(g=(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,h]}),t[11]=p,t[12]=h,t[13]=g):g=t[13];let _;t[14]===n.createdAt?_=t[15]:(_=new Date(n.createdAt).toLocaleDateString(),t[14]=n.createdAt,t[15]=_);let v;t[16]===_?v=t[17]:(v=(0,u.jsx)(`span`,{className:`text-xs text-text-tertiary`,children:_}),t[16]=_,t[17]=v);let y;t[18]!==v||t[19]!==g?(y=(0,u.jsxs)(`div`,{className:`flex items-center justify-between`,children:[g,v]}),t[18]=v,t[19]=g,t[20]=y):y=t[20];let b;t[21]===n.id?b=t[22]:(b=n.id.slice(0,8),t[21]=n.id,t[22]=b);let x;t[23]===n.repositoryPath?x=t[24]:(x=n.repositoryPath.split(`/`).pop(),t[23]=n.repositoryPath,t[24]=x);let S;t[25]!==b||t[26]!==x?(S=(0,u.jsxs)(`p`,{className:`mt-1.5 truncate font-mono text-xs text-text-secondary`,children:[b,` — `,x]}),t[25]=b,t[26]=x,t[27]=S):S=t[27];let C;return t[28]!==r||t[29]!==y||t[30]!==S?(C=(0,u.jsxs)(i,{to:`/reviews/$reviewId`,params:r,className:`block rounded-sm border border-border-default bg-surface-elevated p-3 transition-colors hover:bg-surface-overlay`,children:[y,S]}),t[28]=r,t[29]=y,t[30]=S,t[31]=C):C=t[31],C}export{p as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./compiler-runtime-DZXZ41-q.js";import{n as r,r as i,t as a}from"./utils-DElCu2hq.js";var o=n()
|
|
1
|
+
import{n as e,r as t,t as n}from"./compiler-runtime-DZXZ41-q.js";import{n as r,r as i,t as a}from"./utils-DElCu2hq.js";var o=n();t();var s=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,c=r,l=(e,t)=>n=>{if(t?.variants==null)return c(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=s(t)||s(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return c(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},u=e(),d=l(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-lg":`size-9`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`},variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`}}});function f(e){let t=(0,o.c)(16),n,r,s,c,l;t[0]===e?(n=t[1],r=t[2],s=t[3],c=t[4],l=t[5]):({className:n,variant:s,size:c,asChild:l,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=s,t[4]=c,t[5]=l);let f=s===void 0?`default`:s,p=c===void 0?`default`:c,m=l!==void 0&&l?i:`button`,h;t[6]!==n||t[7]!==p||t[8]!==f?(h=a(d({className:n,size:p,variant:f})),t[6]=n,t[7]=p,t[8]=f,t[9]=h):h=t[9];let g;return t[10]!==m||t[11]!==r||t[12]!==p||t[13]!==h||t[14]!==f?(g=(0,u.jsx)(m,{"data-slot":`button`,"data-variant":f,"data-size":p,className:h,...r}),t[10]=m,t[11]=r,t[12]=p,t[13]=h,t[14]=f,t[15]=g):g=t[15],g}var p=e=>{let t=(0,o.c)(6),{error:n}=e,r=n instanceof Error?n.message:`Unable to load changes`,i=m,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,u.jsx)(`p`,{className:`text-sm font-medium text-status-error`,children:`Error`}),t[0]=a):a=t[0];let s;t[1]===r?s=t[2]:(s=(0,u.jsx)(`p`,{className:`mt-2 text-xs text-text-secondary`,children:r}),t[1]=r,t[2]=s);let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,u.jsx)(f,{className:`mt-4`,onClick:i,size:`sm`,variant:`outline`,children:`Retry`}),t[3]=c):c=t[3];let l;return t[4]===s?l=t[5]:(l=(0,u.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,u.jsxs)(`div`,{className:`rounded-sm border border-border-default bg-surface-elevated p-8 text-center`,children:[a,s,c]})}),t[4]=s,t[5]=l),l};function m(){window.location.reload()}export{p as errorComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{D as i,E as a,N as o,P as s,S as c,V as l,_ as u,c as d,d as f,f as p,i as m,l as h,m as g,n as _,o as v,r as y,s as b,u as x,y as S}from"./preload-helper-D7oT-Xwl.js";import{i as C}from"./useStore-M3H8PB1v.js";import{i as w}from"./main-FvxVz-kD.js";import{C as T,E,S as D,T as O,_ as k,a as A,b as j,c as M,d as N,f as ee,g as te,h as ne,i as P,l as F,m as re,n as ie,o as ae,p as oe,r as se,s as ce,t as le,u as ue,v as de,w as I,x as L,y as fe}from"./action-bar-DLRNvLjj.js";import{a as pe,i as me,n as he,r as ge,t as _e}from"./file-tree-CI3Xwwid.js";import{a as R,i as ve,t as z}from"./utils-DElCu2hq.js";var ye=E(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),be=E(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),xe=E(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Se=E(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),Ce=E(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),we=E(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),Te=E(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),B=t(n(),1),V=e(),Ee=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`}),De=`VisuallyHidden`,Oe=B.forwardRef((e,t)=>(0,V.jsx)(I.span,{...e,ref:t,style:{...Ee,...e.style}}));Oe.displayName=De;var ke=[`top`,`right`,`bottom`,`left`],Ae=Math.min,H=Math.max,je=Math.round,Me=Math.floor,U=e=>({x:e,y:e}),Ne={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Pe(e,t,n){return H(e,Ae(t,n))}function W(e,t){return typeof e==`function`?e(t):e}function G(e){return e.split(`-`)[0]}function Fe(e){return e.split(`-`)[1]}function Ie(e){return e===`x`?`y`:`x`}function Le(e){return e===`y`?`height`:`width`}function K(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Re(e){return Ie(K(e))}function ze(e,t,n){n===void 0&&(n=!1);let r=Fe(e),i=Re(e),a=Le(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Je(o)),[o,Je(o)]}function Be(e){let t=Je(e);return[Ve(e),t,Ve(t)]}function Ve(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var He=[`left`,`right`],Ue=[`right`,`left`],We=[`top`,`bottom`],Ge=[`bottom`,`top`];function Ke(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ue:He:t?He:Ue;case`left`:case`right`:return t?We:Ge;default:return[]}}function qe(e,t,n,r){let i=Fe(e),a=Ke(G(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ve)))),a}function Je(e){let t=G(e);return Ne[t]+e.slice(t.length)}function Ye(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xe(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ye(e)}function Ze(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 Qe(e,t,n){let{reference:r,floating:i}=e,a=K(t),o=Re(t),s=Le(o),c=G(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}}switch(Fe(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function $e(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}=W(t,e),p=Xe(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ze(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},y=Ze(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var et=50,tt=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:$e},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Qe(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<et&&(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}=Qe(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},nt=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}=W(e,t)||{};if(l==null)return{};let d=Xe(u),f={x:n,y:r},p=Re(i),m=Le(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ae(d[_],T),D=Ae(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Pe(O,A,k),M=!c.arrow&&Fe(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),rt=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}=W(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=G(r),_=K(o),v=G(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Je(o)]:Be(o)),x=p!==`none`;!d&&x&&b.push(...qe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ze(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==K(t))||T.every(e=>K(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.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=T.filter(e=>{if(x){let t=K(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 it(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function at(e){return ke.some(t=>e[t]>=0)}var ot=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=W(e,t);switch(i){case`referenceHidden`:{let e=it(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:at(e)}}}case`escaped`:{let e=it(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:at(e)}}}default:return{}}}}},st=new Set([`left`,`top`]);async function ct(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=G(n),s=Fe(n),c=K(n)===`y`,l=st.has(o)?-1:1,u=a&&c?-1:1,d=W(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 lt=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 ct(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}}}}},ut=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}=W(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=K(G(i)),p=Ie(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Pe(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Pe(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},dt=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}=W(e,t),u={x:n,y:r},d=K(i),f=Ie(d),p=u[f],m=u[d],h=W(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=st.has(G(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}}}},ft=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=W(e,t),u=await o.detectOverflow(t,l),d=G(i),f=Fe(i),p=K(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Ae(h-u[g],v),x=Ae(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=H(u.left,0),t=H(u.right,0),n=H(u.top,0),r=H(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:H(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:H(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function pt(){return typeof window<`u`}function mt(e){return ht(e)?(e.nodeName||``).toLowerCase():`#document`}function q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function J(e){return((ht(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ht(e){return pt()?e instanceof Node||e instanceof q(e).Node:!1}function Y(e){return pt()?e instanceof Element||e instanceof q(e).Element:!1}function X(e){return pt()?e instanceof HTMLElement||e instanceof q(e).HTMLElement:!1}function gt(e){return!pt()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof q(e).ShadowRoot}function _t(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Z(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function vt(e){return/^(table|td|th)$/.test(mt(e))}function yt(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var bt=/transform|translate|scale|rotate|perspective|filter/,xt=/paint|layout|strict|content/,St=e=>!!e&&e!==`none`,Ct;function wt(e){let t=Y(e)?Z(e):e;return St(t.transform)||St(t.translate)||St(t.scale)||St(t.rotate)||St(t.perspective)||!Et()&&(St(t.backdropFilter)||St(t.filter))||bt.test(t.willChange||``)||xt.test(t.contain||``)}function Tt(e){let t=kt(e);for(;X(t)&&!Dt(t);){if(wt(t))return t;if(yt(t))return null;t=kt(t)}return null}function Et(){return Ct??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ct}function Dt(e){return/^(html|body|#document)$/.test(mt(e))}function Z(e){return q(e).getComputedStyle(e)}function Ot(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kt(e){if(mt(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||gt(e)&&e.host||J(e);return gt(t)?t.host:t}function At(e){let t=kt(e);return Dt(t)?e.ownerDocument?e.ownerDocument.body:e.body:X(t)&&_t(t)?t:At(t)}function jt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=At(e),i=r===e.ownerDocument?.body,a=q(r);if(i){let e=Mt(a);return t.concat(a,a.visualViewport||[],_t(r)?r:[],e&&n?jt(e):[])}else return t.concat(r,jt(r,[],n))}function Mt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nt(e){let t=Z(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=X(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=je(n)!==a||je(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Pt(e){return Y(e)?e:e.contextElement}function Ft(e){let t=Pt(e);if(!X(t))return U(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Nt(t),o=(a?je(n.width):n.width)/r,s=(a?je(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var It=U(0);function Lt(e){let t=q(e);return!Et()||!t.visualViewport?It:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==q(e)?!1:t}function zt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Pt(e),o=U(1);t&&(r?Y(r)&&(o=Ft(r)):o=Ft(e));let s=Rt(a,n,r)?Lt(a):U(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){let e=q(a),t=r&&Y(r)?q(r):r,n=e,i=Mt(n);for(;i&&r&&t!==n;){let e=Ft(i),t=i.getBoundingClientRect(),r=Z(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=q(i),i=Mt(n)}}return Ze({width:u,height:d,x:c,y:l})}function Bt(e,t){let n=Ot(e).scrollLeft;return t?t.left+n:zt(J(e)).left+n}function Vt(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Bt(e,n),y:n.top+t.scrollTop}}function Ht(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=J(r),s=t?yt(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=U(1),u=U(0),d=X(r);if((d||!d&&!a)&&((mt(r)!==`body`||_t(o))&&(c=Ot(r)),d)){let e=zt(r);l=Ft(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Vt(o,c):U(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 Ut(e){return Array.from(e.getClientRects())}function Wt(e){let t=J(e),n=Ot(e),r=e.ownerDocument.body,i=H(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=H(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Bt(e),s=-n.scrollTop;return Z(r).direction===`rtl`&&(o+=H(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Gt=25;function Kt(e,t){let n=q(e),r=J(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Et();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Bt(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Gt&&(a-=o)}else l<=Gt&&(a+=l);return{width:a,height:o,x:s,y:c}}function qt(e,t){let n=zt(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=X(e)?Ft(e):U(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Jt(e,t,n){let r;if(t===`viewport`)r=Kt(e,n);else if(t===`document`)r=Wt(J(e));else if(Y(t))r=qt(t,n);else{let n=Lt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ze(r)}function Yt(e,t){let n=kt(e);return n===t||!Y(n)||Dt(n)?!1:Z(n).position===`fixed`||Yt(n,t)}function Xt(e,t){let n=t.get(e);if(n)return n;let r=jt(e,[],!1).filter(e=>Y(e)&&mt(e)!==`body`),i=null,a=Z(e).position===`fixed`,o=a?kt(e):e;for(;Y(o)&&!Dt(o);){let t=Z(o),n=wt(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||_t(o)&&!n&&Yt(e,o))?r=r.filter(e=>e!==o):i=t,o=kt(o)}return t.set(e,r),r}function Zt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?yt(t)?[]:Xt(t,this._c):[].concat(n),r],o=Jt(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=Jt(t,a[e],i);s=H(n.top,s),c=Ae(n.right,c),l=Ae(n.bottom,l),u=H(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Qt(e){let{width:t,height:n}=Nt(e);return{width:t,height:n}}function $t(e,t,n){let r=X(t),i=J(t),a=n===`fixed`,o=zt(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=U(0);function l(){c.x=Bt(i)}if(r||!r&&!a)if((mt(t)!==`body`||_t(i))&&(s=Ot(t)),r){let e=zt(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Vt(i,s):U(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function en(e){return Z(e).position===`static`}function tn(e,t){if(!X(e)||Z(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return J(e)===n&&(n=n.ownerDocument.body),n}function nn(e,t){let n=q(e);if(yt(e))return n;if(!X(e)){let t=kt(e);for(;t&&!Dt(t);){if(Y(t)&&!en(t))return t;t=kt(t)}return n}let r=tn(e,t);for(;r&&vt(r)&&en(r);)r=tn(r,t);return r&&Dt(r)&&en(r)&&!wt(r)?n:r||Tt(e)||n}var rn=async function(e){let t=this.getOffsetParent||nn,n=this.getDimensions,r=await n(e.floating);return{reference:$t(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function an(e){return Z(e).direction===`rtl`}var on={convertOffsetParentRelativeRectToViewportRelativeRect:Ht,getDocumentElement:J,getClippingRect:Zt,getOffsetParent:nn,getElementRects:rn,getClientRects:Ut,getDimensions:Qt,getScale:Ft,isElement:Y,isRTL:an};function sn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cn(e,t){let n=null,r,i=J(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Me(d),h=Me(i.clientWidth-(u+f)),g=Me(i.clientHeight-(d+p)),_=Me(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:H(0,Ae(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!sn(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function ln(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=Pt(e),u=i||a?[...l?jt(l):[],...t?jt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?cn(l,n):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?zt(e):null;c&&g();function g(){let t=zt(e);h&&!sn(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 un=lt,dn=ut,fn=rt,pn=ft,mn=ot,hn=nt,gn=dt,_n=(e,t,n)=>{let r=new Map,i={platform:on,...n},a={...i.platform,_c:r};return tt(e,t,{...i,platform:a})},vn=t(l(),1),yn=typeof document<`u`?B.useLayoutEffect:function(){};function bn(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(!bn(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)&&!bn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function xn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sn(e,t){let n=xn(e);return Math.round(t*n)/n}function Cn(e){let t=B.useRef(e);return yn(()=>{t.current=e}),t}function wn(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,[u,d]=B.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=B.useState(r);bn(f,r)||p(r);let[m,h]=B.useState(null),[g,_]=B.useState(null),v=B.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=B.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=B.useRef(null),C=B.useRef(null),w=B.useRef(u),T=c!=null,E=Cn(c),D=Cn(i),O=Cn(l),k=B.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),_n(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!bn(w.current,t)&&(w.current=t,vn.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);yn(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=B.useRef(!1);yn(()=>(A.current=!0,()=>{A.current=!1}),[]),yn(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=B.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=B.useMemo(()=>({reference:b,floating:x}),[b,x]),N=B.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Sn(M.floating,u.x),r=Sn(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...xn(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return B.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Tn=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?{}:hn({element:r.current,padding:i}).fn(n):r?hn({element:r,padding:i}).fn(n):{}}}},En=(e,t)=>{let n=un(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dn=(e,t)=>{let n=dn(e);return{name:n.name,fn:n.fn,options:[e,t]}},On=(e,t)=>({fn:gn(e).fn,options:[e,t]}),kn=(e,t)=>{let n=fn(e);return{name:n.name,fn:n.fn,options:[e,t]}},An=(e,t)=>{let n=pn(e);return{name:n.name,fn:n.fn,options:[e,t]}},jn=(e,t)=>{let n=mn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mn=(e,t)=>{let n=Tn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nn=`Arrow`,Pn=B.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,V.jsx)(I.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,V.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Pn.displayName=Nn;var Fn=Pn,In=`Popper`,[Ln,Rn]=T(In),[zn,Bn]=Ln(In),Vn=e=>{let{__scopePopper:t,children:n}=e,[r,i]=B.useState(null);return(0,V.jsx)(zn,{scope:t,anchor:r,onAnchorChange:i,children:n})};Vn.displayName=In;var Hn=`PopperAnchor`,Un=B.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Bn(Hn,n),o=B.useRef(null),s=R(t,o),c=B.useRef(null);return B.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,V.jsx)(I.div,{...i,ref:s})});Un.displayName=Hn;var Wn=`PopperContent`,[Gn,Kn]=Ln(Wn),qn=B.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Bn(Wn,n),[_,v]=B.useState(null),y=R(t,e=>v(e)),[b,x]=B.useState(null),S=M(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(Zn),altBoundary:O},{refs:A,floatingStyles:N,placement:ee,isPositioned:ne,middlewareData:P}=wn({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>ln(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[En({mainAxis:i+w,alignmentAxis:o}),c&&Dn({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?On():void 0,...k}),c&&kn({...k}),An({...k,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`)}}),b&&Mn({element:b,padding:s}),Qn({arrowWidth:C,arrowHeight:w}),f&&jn({strategy:`referenceHidden`,...k})]}),[F,re]=$n(ee),ie=te(m);j(()=>{ne&&ie?.()},[ne,ie]);let ae=P.arrow?.x,oe=P.arrow?.y,se=P.arrow?.centerOffset!==0,[ce,le]=B.useState();return j(()=>{_&&le(window.getComputedStyle(_).zIndex)},[_]),(0,V.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:ne?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ce,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,V.jsx)(Gn,{scope:n,placedSide:F,onArrowChange:x,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:(0,V.jsx)(I.div,{"data-side":F,"data-align":re,...h,ref:y,style:{...h.style,animation:ne?void 0:`none`}})})})});qn.displayName=Wn;var Jn=`PopperArrow`,Yn={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Xn=B.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Kn(Jn,n),a=Yn[i.placedSide];return(0,V.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,V.jsx)(Fn,{...r,ref:t,style:{...r.style,display:`block`}})})});Xn.displayName=Jn;function Zn(e){return e!==null}var Qn=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]=$n(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 $n(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var er=Vn,tr=Un,nr=qn,rr=Xn;function ir(e,[t,n]){return Math.min(n,Math.max(t,e))}var ar=[` `,`Enter`,`ArrowUp`,`ArrowDown`],or=[` `,`Enter`],sr=`Select`,[cr,lr,ur]=D(sr),[dr,fr]=T(sr,[ur,Rn]),pr=Rn(),[mr,hr]=dr(sr),[gr,_r]=dr(sr),vr=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=pr(t),[g,_]=B.useState(null),[v,y]=B.useState(null),[b,x]=B.useState(!1),S=k(l),[C,w]=fe({prop:r,defaultProp:i??!1,onChange:a,caller:sr}),[T,E]=fe({prop:o,defaultProp:s,onChange:c,caller:sr}),D=B.useRef(null),O=g?m||!!g.closest(`form`):!0,[A,j]=B.useState(new Set),M=Array.from(A).map(e=>e.props.value).join(`;`);return(0,V.jsx)(er,{...h,children:(0,V.jsxs)(mr,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:de(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[(0,V.jsx)(cr.Provider,{scope:t,children:(0,V.jsx)(gr,{scope:e.__scopeSelect,onNativeOptionAdd:B.useCallback(e=>{j(t=>new Set(t).add(e))},[]),onNativeOptionRemove:B.useCallback(e=>{j(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),O?(0,V.jsxs)(fi,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:e=>E(e.target.value),disabled:f,form:m,children:[T===void 0?(0,V.jsx)(`option`,{value:``}):null,Array.from(A)]},M):null]})})};vr.displayName=sr;var yr=`SelectTrigger`,br=B.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=pr(n),o=hr(yr,n),s=o.disabled||r,c=R(t,o.onTriggerChange),l=lr(n),u=B.useRef(`touch`),[d,f,p]=mi(e=>{let t=l().filter(e=>!e.disabled),n=hi(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,V.jsx)(tr,{asChild:!0,...a,children:(0,V.jsx)(I.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":pi(o.value)?``:void 0,...i,ref:c,onClick:L(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:L(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:L(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&ar.includes(e.key)&&(m(),e.preventDefault())})})})});br.displayName=yr;var xr=`SelectValue`,Sr=B.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=hr(xr,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=R(t,c.onValueNodeChange);return j(()=>{l(u)},[l,u]),(0,V.jsx)(I.span,{...s,ref:d,style:{pointerEvents:`none`},children:pi(c.value)?(0,V.jsx)(V.Fragment,{children:o}):a})});Sr.displayName=xr;var Cr=`SelectIcon`,wr=B.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,V.jsx)(I.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});wr.displayName=Cr;var Tr=`SelectPortal`,Er=e=>(0,V.jsx)(oe,{asChild:!0,...e});Er.displayName=Tr;var Dr=`SelectContent`,Or=B.forwardRef((e,t)=>{let n=hr(Dr,e.__scopeSelect),[r,i]=B.useState();if(j(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?vn.createPortal((0,V.jsx)(kr,{scope:e.__scopeSelect,children:(0,V.jsx)(cr.Slot,{scope:e.__scopeSelect,children:(0,V.jsx)(`div`,{children:e.children})})}),t):null}return(0,V.jsx)(Nr,{...e,ref:t})});Or.displayName=Dr;var Q=10,[kr,Ar]=dr(Dr),jr=`SelectContentImpl`,Mr=ve(`SelectContent.RemoveScroll`),Nr=B.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=hr(Dr,n),[y,b]=B.useState(null),[x,S]=B.useState(null),C=R(t,e=>b(e)),[w,T]=B.useState(null),[E,D]=B.useState(null),O=lr(n),[k,A]=B.useState(!1),j=B.useRef(!1);B.useEffect(()=>{if(y)return ue(y)},[y]),ee();let M=B.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),te=B.useCallback(()=>M([w,y]),[M,w,y]);B.useEffect(()=>{k&&te()},[k,te]);let{onOpenChange:P,triggerPointerDownPosRef:F}=v;B.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||P(!1),document.removeEventListener(`pointermove`,t),F.current=null};return F.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,P,F]),B.useEffect(()=>{let e=()=>P(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[P]);let[ie,ae]=mi(e=>{let t=O().filter(e=>!e.disabled),n=hi(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),oe=B.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(j.current=!0))},[v.value]),se=B.useCallback(()=>y?.focus(),[y]),ce=B.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),le=r===`popper`?Lr:Fr,de=le===Lr?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,V.jsx)(kr,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:oe,selectedItem:w,onItemLeave:se,itemTextRefCallback:ce,focusSelectedItem:te,selectedItemText:E,position:r,isPositioned:k,searchRef:ie,children:(0,V.jsx)(N,{as:Mr,allowPinchZoom:!0,children:(0,V.jsx)(re,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:L(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,V.jsx)(ne,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,V.jsx)(le,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...de,onPlaced:()=>A(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:L(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ae(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})});Nr.displayName=jr;var Pr=`SelectItemAlignedPosition`,Fr=B.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=hr(Dr,n),o=Ar(Dr,n),[s,c]=B.useState(null),[l,u]=B.useState(null),d=R(t,e=>u(e)),f=lr(n),p=B.useRef(!1),m=B.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=B.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Q,d=ir(a,[Q,Math.max(Q,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Q,d=ir(a,[Q,Math.max(Q,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Q*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Q,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${Q}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);j(()=>y(),[y]);let[b,x]=B.useState();return j(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,V.jsx)(Rr,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:B.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,V.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,V.jsx)(I.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});Fr.displayName=Pr;var Ir=`SelectPopperPosition`,Lr=B.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Q,...a}=e,o=pr(n);return(0,V.jsx)(nr,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});Lr.displayName=Ir;var[Rr,zr]=dr(Dr,{}),Br=`SelectViewport`,Vr=B.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Ar(Br,n),o=zr(Br,n),s=R(t,a.onViewportChange),c=B.useRef(0);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,V.jsx)(cr.Slot,{scope:n,children:(0,V.jsx)(I.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:L(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Q*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});Vr.displayName=Br;var Hr=`SelectGroup`,[Ur,Wr]=dr(Hr),Gr=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=de();return(0,V.jsx)(Ur,{scope:n,id:i,children:(0,V.jsx)(I.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Gr.displayName=Hr;var Kr=`SelectLabel`,qr=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Wr(Kr,n);return(0,V.jsx)(I.div,{id:i.id,...r,ref:t})});qr.displayName=Kr;var Jr=`SelectItem`,[Yr,Xr]=dr(Jr),Zr=B.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=hr(Jr,n),c=Ar(Jr,n),l=s.value===r,[u,d]=B.useState(a??``),[f,p]=B.useState(!1),m=R(t,e=>c.itemRefCallback?.(e,r,i)),h=de(),g=B.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,V.jsx)(Yr,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:B.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,V.jsx)(cr.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,V.jsx)(I.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:L(o.onFocus,()=>p(!0)),onBlur:L(o.onBlur,()=>p(!1)),onClick:L(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:L(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:L(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:L(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:L(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:L(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(or.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});Zr.displayName=Jr;var Qr=`SelectItemText`,$r=B.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=hr(Qr,n),s=Ar(Qr,n),c=Xr(Qr,n),l=_r(Qr,n),[u,d]=B.useState(null),f=R(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=B.useMemo(()=>(0,V.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return j(()=>(h(m),()=>g(m)),[h,g,m]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(I.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?vn.createPortal(a.children,o.valueNode):null]})});$r.displayName=Qr;var ei=`SelectItemIndicator`,ti=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Xr(ei,n).isSelected?(0,V.jsx)(I.span,{"aria-hidden":!0,...r,ref:t}):null});ti.displayName=ei;var ni=`SelectScrollUpButton`,ri=B.forwardRef((e,t)=>{let n=Ar(ni,e.__scopeSelect),r=zr(ni,e.__scopeSelect),[i,a]=B.useState(!1),o=R(t,r.onScrollButtonChange);return j(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,V.jsx)(oi,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});ri.displayName=ni;var ii=`SelectScrollDownButton`,ai=B.forwardRef((e,t)=>{let n=Ar(ii,e.__scopeSelect),r=zr(ii,e.__scopeSelect),[i,a]=B.useState(!1),o=R(t,r.onScrollButtonChange);return j(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,V.jsx)(oi,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});ai.displayName=ii;var oi=B.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Ar(`SelectScrollButton`,n),o=B.useRef(null),s=lr(n),c=B.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return B.useEffect(()=>()=>c(),[c]),j(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,V.jsx)(I.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:L(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:L(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:L(i.onPointerLeave,()=>{c()})})}),si=`SelectSeparator`,ci=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,V.jsx)(I.div,{"aria-hidden":!0,...r,ref:t})});ci.displayName=si;var li=`SelectArrow`,ui=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=pr(n),a=hr(li,n),o=Ar(li,n);return a.open&&o.position===`popper`?(0,V.jsx)(rr,{...i,...r,ref:t}):null});ui.displayName=li;var di=`SelectBubbleInput`,fi=B.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=B.useRef(null),a=R(r,i),o=F(t);return B.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,V.jsx)(I.select,{...n,style:{...Ee,...n.style},ref:a,defaultValue:t})});fi.displayName=di;function pi(e){return e===``||e===void 0}function mi(e){let t=te(e),n=B.useRef(``),r=B.useRef(0),i=B.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=B.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return B.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function hi(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=gi(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function gi(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var _i=vr,vi=br,yi=wr,bi=Er,xi=Or,Si=Vr,Ci=Gr,wi=Zr,Ti=$r,Ei=ti,Di=ri,Oi=ai,$=r(),ki=e=>{let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,V.jsx)(_i,{"data-slot":`select`,...e}),t[0]=e,t[1]=n),n},Ai=e=>{let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=z(`scroll-my-1 p-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(Ci,{"data-slot":`select-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a},ji=e=>{let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,size:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===r?s=t[6]:(s=z(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsx)(yi,{asChild:!0,children:(0,V.jsx)(ye,{className:`pointer-events-none size-4 text-muted-foreground`})}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,V.jsxs)(vi,{"data-slot":`select-trigger`,"data-size":o,className:s,...i,children:[n,c]}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l},Mi=e=>{let t=(0,$.c)(24),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,position:a,align:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?`item-aligned`:a,c=o===void 0?`center`:o,l=s===`item-aligned`,u=s===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,d;t[6]!==r||t[7]!==u?(d=z(`relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,u,r),t[6]=r,t[7]=u,t[8]=d):d=t[8];let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,V.jsx)(Pi,{}),t[9]=f):f=t[9];let p=s===`popper`&&``,m;t[10]===p?m=t[11]:(m=z(`data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`,p),t[10]=p,t[11]=m);let h;t[12]!==n||t[13]!==s||t[14]!==m?(h=(0,V.jsx)(Si,{"data-position":s,className:m,children:n}),t[12]=n,t[13]=s,t[14]=m,t[15]=h):h=t[15];let g;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,V.jsx)(Fi,{}),t[16]=g):g=t[16];let _;return t[17]!==c||t[18]!==s||t[19]!==i||t[20]!==l||t[21]!==d||t[22]!==h?(_=(0,V.jsx)(bi,{children:(0,V.jsxs)(xi,{"data-slot":`select-content`,"data-align-trigger":l,className:d,position:s,align:c,...i,children:[f,h,g]})}),t[17]=c,t[18]=s,t[19]=i,t[20]=l,t[21]=d,t[22]=h,t[23]=_):_=t[23],_},Ni=e=>{let t=(0,$.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=z(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]: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 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,V.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`,children:(0,V.jsx)(Ei,{children:(0,V.jsx)(O,{className:`pointer-events-none`})})}),t[6]=o):o=t[6];let s;t[7]===n?s=t[8]:(s=(0,V.jsx)(Ti,{children:n}),t[7]=n,t[8]=s);let c;return t[9]!==i||t[10]!==a||t[11]!==s?(c=(0,V.jsxs)(wi,{"data-slot":`select-item`,className:a,...i,children:[o,s]}),t[9]=i,t[10]=a,t[11]=s,t[12]=c):c=t[12],c},Pi=e=>{let t=(0,$.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=z(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsx)(be,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,V.jsx)(Di,{"data-slot":`select-scroll-up-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o},Fi=e=>{let t=(0,$.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=z(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsx)(ye,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,V.jsx)(Oi,{"data-slot":`select-scroll-down-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o},Ii={"last-commit":`Last Commit`,staged:`Staged`,uncommitted:`Uncommitted`,unstaged:`Unstaged`},Li={"last-commit":`No previous commit found`,staged:`No staged changes — stage files with git add`,uncommitted:`Working tree clean — no uncommitted changes`,unstaged:`No unstaged changes — all modifications are staged`},Ri={"last-commit":we,staged:xe,uncommitted:Se,unstaged:Ce},zi=e=>{let t=(0,$.c)(3),{fileCount:n,isLoading:r}=e;if(r){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`span`,{className:`inline-flex h-5 min-w-5 items-center justify-center rounded-full border border-border-default bg-surface-overlay px-1.5 text-[10px] text-text-tertiary motion-reduce:animate-none`,children:(0,V.jsx)(Te,{className:`size-3 animate-spin motion-reduce:animate-none`})}),t[0]=e):e=t[0],e}if(typeof n!=`number`)return null;let i;return t[1]===n?i=t[2]:(i=(0,V.jsx)(`span`,{className:`inline-flex h-5 min-w-5 items-center justify-center rounded-full border border-border-default bg-surface-overlay px-1.5 text-[10px] font-medium tabular-nums text-text-secondary`,children:n}),t[1]=n,t[2]=i),i},Bi=e=>{let t=(0,$.c)(26),{value:n,onChange:r,fileCount:i,isLoading:a}=e,o=a===void 0?!1:a,s=o?Te:Ri[n],c;t[0]===r?c=t[1]:(c=e=>{r(e)},t[0]=r,t[1]=c);let l=c,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=z(`h-7 min-w-0 gap-1.5 rounded-[10px] border-border-subtle bg-surface-primary px-2 text-[11px] font-medium text-text-secondary shadow-none transition-[color,background-color,border-color,box-shadow,transform,opacity] duration-150 [transition-timing-function:cubic-bezier(0.23,1,0.32,1)] focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40 active:scale-[0.97] motion-reduce:transform-none motion-reduce:transition-[color,background-color,border-color,box-shadow,opacity] [&_svg]:text-text-tertiary`),t[2]=u):u=t[2];let d=o&&`animate-spin motion-reduce:animate-none`,f;t[3]===d?f=t[4]:(f=z(`size-3.5 shrink-0`,d),t[3]=d,t[4]=f);let p;t[5]!==s||t[6]!==f?(p=(0,V.jsx)(s,{className:f}),t[5]=s,t[6]=f,t[7]=p):p=t[7];let h=Ii[n],g;t[8]===h?g=t[9]:(g=(0,V.jsx)(`span`,{className:`truncate`,children:h}),t[8]=h,t[9]=g);let _;t[10]!==p||t[11]!==g?(_=(0,V.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[p,g]}),t[10]=p,t[11]=g,t[12]=_):_=t[12];let v;t[13]!==i||t[14]!==o?(v=(0,V.jsx)(zi,{fileCount:i,isLoading:o}),t[13]=i,t[14]=o,t[15]=v):v=t[15];let y;t[16]!==v||t[17]!==_?(y=(0,V.jsxs)(ji,{"aria-label":`Diff scope`,className:u,size:`sm`,children:[_,v]}),t[16]=v,t[17]=_,t[18]=y):y=t[18];let b;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(b=z(`min-w-44 rounded-xl border border-border-default bg-surface-elevated p-1 shadow-[0_18px_40px_-24px_rgba(0,0,0,0.7)] transition-[opacity,transform] duration-150 [transition-timing-function:cubic-bezier(0.23,1,0.32,1)] data-[state=closed]:scale-95 data-[state=closed]:opacity-0 data-[state=open]:scale-100 data-[state=open]:opacity-100 motion-reduce:transform-none motion-reduce:transition-opacity`),t[19]=b):b=t[19];let x;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,V.jsx)(Mi,{align:`end`,className:b,position:`popper`,children:(0,V.jsx)(Ai,{children:m.map(Vi)})}),t[20]=x):x=t[20];let S;return t[21]!==l||t[22]!==o||t[23]!==y||t[24]!==n?(S=(0,V.jsxs)(ki,{disabled:o,onValueChange:l,value:n,children:[y,x]}),t[21]=l,t[22]=o,t[23]=y,t[24]=n,t[25]=S):S=t[25],S};function Vi(e){let t=Ri[e];return(0,V.jsx)(Ni,{className:`rounded-lg px-2 py-1.5 text-xs text-text-secondary focus:bg-surface-overlay focus:text-text-primary`,value:e,children:(0,V.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(t,{className:`size-3.5 shrink-0`}),(0,V.jsx)(`span`,{className:`truncate`,children:Ii[e]})]})},e)}var Hi=`ringi.session-draft.v1`,Ui=1800*1e3,Wi=()=>{if(!(typeof window>`u`))try{localStorage.removeItem(Hi)}catch{}},Gi=e=>{if(typeof window>`u`)return;let t={...e,savedAt:Date.now()};try{localStorage.setItem(Hi,JSON.stringify(t))}catch{}},Ki=()=>{if(typeof window>`u`)return null;try{let e=localStorage.getItem(Hi);if(!e)return null;let t=JSON.parse(e);return typeof t.savedAt!=`number`||!Array.isArray(t.viewedFiles)||typeof t.scope!=`string`?null:Date.now()-t.savedAt>Ui?(Wi(),null):{savedAt:t.savedAt,scope:t.scope,selectedFile:typeof t.selectedFile==`string`?t.selectedFile:null,viewedFiles:t.viewedFiles.filter(e=>typeof e==`string`)}}catch{return null}},qi=e=>{let t=Date.now()-e,n=Math.floor(t/1e3),r=Math.floor(n/60),i=Math.floor(r/60);return n<30?`just now`:r<1?`less than a minute ago`:r===1?`1 minute ago`:r<60?`${r} minutes ago`:i===1?`1 hour ago`:`${i} hours ago`},Ji=(e,t)=>e!==null&&e.scope===t&&e.viewedFiles.length>0,Yi=`transition-[transform,background-color,color,border-color,box-shadow,opacity] duration-150 [transition-timing-function:cubic-bezier(0.23,1,0.32,1)] motion-reduce:transform-none`,Xi=e=>{let t=(0,$.c)(35),{open:n,draft:r,onRestore:i,onDismiss:a}=e,o=r.viewedFiles.length,s;t[0]===r.savedAt?s=t[1]:(s=qi(r.savedAt),t[0]=r.savedAt,t[1]=s);let c=s,l;t[2]===i?l=t[3]:(l=()=>{i()},t[2]=i,t[3]=l);let u=l,d;t[4]===a?d=t[5]:(d=()=>{a()},t[4]=a,t[5]=d);let f=d,p;t[6]===a?p=t[7]:(p=e=>{e||a()},t[6]=a,t[7]=p);let m=p,h;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,V.jsx)(ce,{children:`Draft Recovered`}),t[8]=h):h=t[8];let g=`Found ${o} viewed file${o===1?``:`s`} from ${c}.`,_;t[9]===g?_=t[10]:(_=(0,V.jsxs)(ae,{children:[h,(0,V.jsx)(P,{children:g})]}),t[9]=g,t[10]=_);let v;t[11]===r.viewedFiles?v=t[12]:(v=r.viewedFiles.slice(0,5).map(Zi),t[11]=r.viewedFiles,t[12]=v);let y;t[13]===o?y=t[14]:(y=o>5?(0,V.jsx)(`li`,{className:`text-xs text-text-tertiary`,children:`… and ${o-5} more`}):null,t[13]=o,t[14]=y);let b;t[15]!==v||t[16]!==y?(b=(0,V.jsx)(`div`,{className:`px-5 py-3`,children:(0,V.jsxs)(`ul`,{className:`flex flex-col gap-1`,children:[v,y]})}),t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(x=z(`rounded-lg border border-border-default bg-surface-elevated px-3 py-1.5 text-xs text-text-secondary hover:bg-surface-overlay hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 active:scale-[0.97]`,Yi),t[18]=x):x=t[18];let S;t[19]===f?S=t[20]:(S=(0,V.jsx)(`button`,{type:`button`,onClick:f,className:x,children:`Dismiss`}),t[19]=f,t[20]=S);let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=z(`rounded-lg bg-accent-primary px-3 py-1.5 text-xs font-medium text-white hover:bg-accent-primary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary/40 active:scale-[0.97]`,Yi),t[21]=C):C=t[21];let w;t[22]===u?w=t[23]:(w=(0,V.jsx)(`button`,{type:`button`,onClick:u,className:C,children:`Restore`}),t[22]=u,t[23]=w);let T;t[24]!==S||t[25]!==w?(T=(0,V.jsxs)(A,{children:[S,w]}),t[24]=S,t[25]=w,t[26]=T):T=t[26];let E;t[27]!==b||t[28]!==T||t[29]!==_?(E=(0,V.jsxs)(se,{className:`max-w-sm gap-0`,showCloseButton:!1,children:[_,b,T]}),t[27]=b,t[28]=T,t[29]=_,t[30]=E):E=t[30];let D;return t[31]!==m||t[32]!==n||t[33]!==E?(D=(0,V.jsx)(ie,{open:n,onOpenChange:m,children:E}),t[31]=m,t[32]=n,t[33]=E,t[34]=D):D=t[34],D};function Zi(e){return(0,V.jsx)(`li`,{className:`truncate font-mono text-xs text-text-secondary`,children:e},e)}var Qi=`[transition-timing-function:cubic-bezier(0.23,1,0.32,1)]`,$i=`active:scale-[0.97]`,ea=e=>{let t=new Date(e);if(Number.isNaN(t.getTime()))return``;let n=Date.now()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return`just now`;if(r<60)return`${r}m ago`;let i=Math.floor(r/60);return i<24?`${i}h ago`:new Intl.DateTimeFormat(void 0,{day:`numeric`,month:`short`}).format(t)},ta=e=>e.split(`/`).at(-1)??e,na=e=>{let t=e.split(`/`);return t.length<=1?``:t.slice(0,-1).join(`/`)},ra=e=>{let t=(0,$.c)(11),{onDelete:n,annotationId:r}=e,i;t[0]!==r||t[1]!==n?(i=e=>{e.stopPropagation(),n(r)},t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]!==r||t[4]!==n?(o=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),n(r))},t[3]=r,t[4]=n,t[5]=o):o=t[5];let s=o,c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=z(`ml-auto shrink-0 rounded px-1 py-0.5 text-text-quaternary`,`opacity-0 group-hover:opacity-100 group-focus-within:opacity-100`,`transition-[opacity,color,background-color] duration-100`,Qi,`hover:bg-status-error/10 hover:text-status-error`,`focus-visible:bg-status-error/10 focus-visible:text-status-error focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-status-error/30`,`active:scale-[0.93]`,`motion-reduce:transform-none`),t[6]=c):c=t[6];let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 12 12`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,className:`shrink-0`,children:(0,V.jsx)(`path`,{d:`M2 3h8M4.5 3V2a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 .5.5v1M5 5.5v3M7 5.5v3M3 3l.5 7a1 1 0 0 0 1 .9h3a1 1 0 0 0 1-.9L9 3`})}),t[7]=l):l=t[7];let u;return t[8]!==a||t[9]!==s?(u=(0,V.jsx)(`button`,{type:`button`,onClick:a,onKeyDown:s,"aria-label":`Delete annotation`,tabIndex:0,className:c,children:l}),t[8]=a,t[9]=s,t[10]=u):u=t[10],u},ia=e=>{let t=(0,$.c)(34),{entry:n,onClick:r,onDelete:i}=e,a;t[0]!==n||t[1]!==r?(a=()=>r(n),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=a,s;t[3]!==n||t[4]!==r?(s=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r(n))},t[3]=n,t[4]=r,t[5]=s):s=t[5];let c=s,l=n.lineType===`added`?`+`:`-`,u=n.lineType===`added`?`text-diff-add-text`:`text-diff-remove-text`,d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=z(`group flex w-full cursor-pointer flex-col rounded-md px-2.5 py-2 text-left`,`transition-[background-color,transform] duration-150`,Qi,$i,`hover:bg-surface-overlay/60`,`focus-visible:bg-surface-overlay/60 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent-primary/40`,`motion-reduce:transform-none`),t[6]=d):d=t[6];let f;t[7]===u?f=t[8]:(f=z(`rounded bg-surface-primary/80 px-1 py-px font-mono text-[10px] font-medium tabular-nums`,u),t[7]=u,t[8]=f);let p;t[9]!==n.lineNumber||t[10]!==l||t[11]!==f?(p=(0,V.jsxs)(`span`,{className:f,children:[l,`L`,n.lineNumber]}),t[9]=n.lineNumber,t[10]=l,t[11]=f,t[12]=p):p=t[12];let m;t[13]!==n.id||t[14]!==i?(m=(0,V.jsx)(ra,{onDelete:i,annotationId:n.id}),t[13]=n.id,t[14]=i,t[15]=m):m=t[15];let h;t[16]===n.createdAt?h=t[17]:(h=ea(n.createdAt),t[16]=n.createdAt,t[17]=h);let g;t[18]===h?g=t[19]:(g=(0,V.jsx)(`span`,{className:`text-[10px] text-text-quaternary`,children:h}),t[18]=h,t[19]=g);let _;t[20]!==p||t[21]!==m||t[22]!==g?(_=(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[p,m,g]}),t[20]=p,t[21]=m,t[22]=g,t[23]=_):_=t[23];let v;t[24]===n.content?v=t[25]:(v=(0,V.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-[16px] text-text-secondary group-hover:text-text-primary`,children:n.content}),t[24]=n.content,t[25]=v);let y;t[26]===n.suggestion?y=t[27]:(y=n.suggestion?(0,V.jsx)(`div`,{className:`mt-1 flex items-center text-[10px] text-accent-primary/70`,children:(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 14 14`,fill:`none`,className:`shrink-0`,children:(0,V.jsx)(`path`,{d:`M3 5l2.5 2.5L11 2M3 9h8`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`})})}):null,t[26]=n.suggestion,t[27]=y);let b;return t[28]!==o||t[29]!==c||t[30]!==v||t[31]!==y||t[32]!==_?(b=(0,V.jsxs)(`button`,{type:`button`,onClick:o,onKeyDown:c,className:d,children:[_,v,y]}),t[28]=o,t[29]=c,t[30]=v,t[31]=y,t[32]=_,t[33]=b):b=t[33],b},aa=e=>{let t=(0,$.c)(27),{group:n,onAnnotationClick:r,onDeleteAnnotation:i}=e,a;t[0]===n.filePath?a=t[1]:(a=ta(n.filePath),t[0]=n.filePath,t[1]=a);let o=a,s;t[2]===n.filePath?s=t[3]:(s=na(n.filePath),t[2]=n.filePath,t[3]=s);let c=s,l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`shrink-0 text-text-quaternary`,children:(0,V.jsx)(`path`,{d:`M2 3.5A1.5 1.5 0 0 1 3.5 2h3.379a1.5 1.5 0 0 1 1.06.44l.622.621a.5.5 0 0 0 .353.146H12.5A1.5 1.5 0 0 1 14 4.707V12.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 12.5V3.5Z`})}),t[4]=l):l=t[4];let u;t[5]===o?u=t[6]:(u=(0,V.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[11px] font-medium text-text-primary`,children:o}),t[5]=o,t[6]=u);let d;t[7]===c?d=t[8]:(d=c?(0,V.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[10px] text-text-quaternary`,children:c}):null,t[7]=c,t[8]=d);let f;t[9]===n.annotations.length?f=t[10]:(f=(0,V.jsx)(`span`,{className:`ml-auto shrink-0 rounded-full bg-surface-overlay px-1.5 py-px text-[10px] tabular-nums text-text-tertiary`,children:n.annotations.length}),t[9]=n.annotations.length,t[10]=f);let p;t[11]!==u||t[12]!==d||t[13]!==f?(p=(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 px-3 py-1.5`,children:[l,u,d,f]}),t[11]=u,t[12]=d,t[13]=f,t[14]=p):p=t[14];let m;if(t[15]!==n.annotations||t[16]!==r||t[17]!==i){let e;t[19]!==r||t[20]!==i?(e=e=>(0,V.jsx)(ia,{entry:e,onClick:r,onDelete:i},e.id),t[19]=r,t[20]=i,t[21]=e):e=t[21],m=n.annotations.map(e),t[15]=n.annotations,t[16]=r,t[17]=i,t[18]=m}else m=t[18];let h;t[22]===m?h=t[23]:(h=(0,V.jsx)(`div`,{className:`space-y-0.5 px-1`,children:m}),t[22]=m,t[23]=h);let g;return t[24]!==p||t[25]!==h?(g=(0,V.jsxs)(`div`,{className:`py-1`,children:[p,h]}),t[24]=p,t[25]=h,t[26]=g):g=t[26],g},oa=()=>{let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`div`,{className:`flex flex-col items-center justify-center px-4 py-12 text-center`,children:(0,V.jsx)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`text-text-quaternary/40`,children:(0,V.jsx)(`path`,{d:`M1 3.5A2.5 2.5 0 0 1 3.5 1h9A2.5 2.5 0 0 1 15 3.5v6a2.5 2.5 0 0 1-2.5 2.5H9l-3.5 3v-3H3.5A2.5 2.5 0 0 1 1 9.5v-6Z`})})}),e[0]=t):t=e[0],t},sa=()=>{let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`shrink-0`,children:[(0,V.jsx)(`rect`,{x:`5`,y:`5`,width:`8`,height:`8`,rx:`1.5`}),(0,V.jsx)(`path`,{d:`M5 11H4.5A1.5 1.5 0 0 1 3 9.5V4.5A1.5 1.5 0 0 1 4.5 3H9.5A1.5 1.5 0 0 1 11 4.5V5`})]}),e[0]=t):t=e[0],t},ca=()=>{let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`shrink-0 text-status-success`,children:(0,V.jsx)(`path`,{d:`M2.5 6.5L5 9l4.5-6`})}),e[0]=t):t=e[0],t},la=()=>{let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,className:`shrink-0 text-status-error`,children:(0,V.jsx)(`path`,{d:`M3 3l6 6M9 3l-6 6`})}),e[0]=t):t=e[0],t},ua={copied:`Copied!`,error:`Failed`,idle:`Copy Feedback`},da={copied:`text-status-success`,error:`text-status-error`,idle:`text-text-secondary hover:bg-surface-overlay hover:text-text-primary`},fa=e=>{let t=(0,$.c)(3),{status:n}=e;if(n===`copied`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(ca,{}),t[0]=e):e=t[0],e}if(n===`error`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(la,{}),t[1]=e):e=t[1],e}let r;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,V.jsx)(sa,{}),t[2]=r):r=t[2],r},pa=e=>{let t=(0,$.c)(13),{copyStatus:n,onCopyFeedback:r}=e,i=n!==`idle`,a=da[n],o=n!==`idle`&&`pointer-events-none`,s;t[0]!==a||t[1]!==o?(s=z(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-[11px] font-medium`,`transition-[background-color,color,transform,opacity] duration-150`,Qi,$i,a,o,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent-primary/40`,`motion-reduce:transform-none`),t[0]=a,t[1]=o,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=(0,V.jsx)(fa,{status:n}),t[3]=n,t[4]=c);let l=ua[n],u;t[5]===l?u=t[6]:(u=(0,V.jsx)(`span`,{children:l}),t[5]=l,t[6]=u);let d;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==c||t[11]!==u?(d=(0,V.jsxs)(`button`,{type:`button`,onClick:r,disabled:i,className:s,children:[c,u]}),t[7]=r,t[8]=i,t[9]=s,t[10]=c,t[11]=u,t[12]=d):d=t[12],d},ma=e=>{let t=(0,$.c)(23),{isOpen:n,onClose:r,groups:i,totalCount:a,copyStatus:o,onAnnotationClick:s,onDeleteAnnotation:c,onCopyFeedback:l}=e,u=(0,B.useRef)(null),d,f;t[0]!==n||t[1]!==r?(d=()=>{if(!n)return;let e=e=>{e.key===`Escape`&&(e.stopPropagation(),r())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},f=[n,r],t[0]=n,t[1]=r,t[2]=d,t[3]=f):(d=t[2],f=t[3]),(0,B.useEffect)(d,f);let p=n?`w-72 opacity-100`:`w-0 opacity-0 overflow-hidden`,m;t[4]===p?m=t[5]:(m=z(`flex h-full flex-col border-l border-border-default bg-surface-secondary`,`transition-[width,opacity] duration-200`,Qi,`motion-reduce:transition-none`,p),t[4]=p,t[5]=m);let h;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=z(`inline-flex h-6 w-6 items-center justify-center rounded-md text-text-tertiary`,`transition-[background-color,color,transform] duration-150`,Qi,$i,`hover:bg-surface-overlay hover:text-text-primary`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent-primary/40`,`motion-reduce:transform-none`),t[6]=h):h=t[6];let g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:(0,V.jsx)(`path`,{d:`M3 3l6 6M9 3l-6 6`})}),t[7]=g):g=t[7];let _;t[8]===r?_=t[9]:(_=(0,V.jsx)(`div`,{className:`flex h-10 shrink-0 items-center justify-end border-b border-border-default px-3`,children:(0,V.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Close annotations panel`,className:h,children:g})}),t[8]=r,t[9]=_);let v;t[10]!==i||t[11]!==s||t[12]!==c?(v=(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto overflow-x-hidden py-1`,children:i.length===0?(0,V.jsx)(oa,{}):(0,V.jsx)(`div`,{className:`divide-y divide-border-subtle`,children:i.map(e=>(0,V.jsx)(aa,{group:e,onAnnotationClick:s,onDeleteAnnotation:c},e.filePath))})}),t[10]=i,t[11]=s,t[12]=c,t[13]=v):v=t[13];let y;t[14]!==o||t[15]!==l||t[16]!==a?(y=a>0?(0,V.jsx)(`div`,{className:`flex items-center border-t border-border-subtle px-3 py-1.5`,children:(0,V.jsx)(pa,{copyStatus:o,onCopyFeedback:l})}):null,t[14]=o,t[15]=l,t[16]=a,t[17]=y):y=t[17];let b;return t[18]!==m||t[19]!==_||t[20]!==v||t[21]!==y?(b=(0,V.jsxs)(`aside`,{ref:u,role:`complementary`,"aria-label":`Annotations`,className:m,children:[_,v,y]}),t[18]=m,t[19]=_,t[20]=v,t[21]=y,t[22]=b):b=t[22],b},ha=e=>{let t=[];for(let n of e)for(let e of n.annotations)t.push({content:e.content,filePath:e.filePath,lineNumber:e.lineNumber,lineType:e.lineType===`context`?`context`:e.lineType,suggestion:e.suggestion});return pe(t)},ga=({getLocalComments:e,onNavigate:t,onDeleteAnnotation:n})=>{let[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(`idle`),s=(0,B.useCallback)(()=>i(e=>!e),[]),c=(0,B.useCallback)(()=>i(!1),[]),l=(0,B.useCallback)(e=>{t(e.filePath,e.lineNumber)},[t]),u=(0,B.useCallback)(e=>{n?.(e)},[n]);return{buildGroups:(0,B.useCallback)(()=>{let t=e(),n=[];for(let[e,r]of t){if(r.length===0)continue;let t=r.map(e=>({content:e.content,createdAt:e.createdAt,filePath:e.filePath,id:e.id,lineNumber:e.lineNumber,lineType:e.lineType,suggestion:e.suggestion}));n.push({annotations:t,filePath:e})}return n.sort((e,t)=>e.filePath.localeCompare(t.filePath)),n},[e]),copyStatus:a,handleAnnotationClick:l,handleClose:c,handleCopyFeedback:(0,B.useCallback)(async e=>{let t=ha(e);if(t){try{await navigator.clipboard.writeText(t),o(`copied`)}catch{o(`error`)}setTimeout(()=>o(`idle`),1500)}},[]),handleDeleteAnnotation:u,handleToggle:s,isOpen:r,totalCount:(0,B.useMemo)(()=>{let t=e(),n=0;for(let e of t.values())n+=e.length;return n},[e])}},_a=d({data:h.pipe(f),timestamp:b,type:v([`todos`,`reviews`,`comments`,`files`])}),va=e=>{try{let t=typeof e==`string`?JSON.parse(e):e;return x(_a)(t)}catch{return i()}};function ya(e={}){let{url:t=`/api/events`,onEvent:n,enabled:r=!0}=e,[i,o]=(0,B.useState)(!1),s=(0,B.useRef)(n);s.current=n;let c=(0,B.useRef)(null),l=(0,B.useRef)(null);return(0,B.useEffect)(()=>{if(!r||typeof window>`u`)return;function e(){let n=new EventSource(t);l.current=n,n.onopen=()=>o(!0),n.onerror=()=>{o(!1),n.close(),l.current=null,c.current===null&&(c.current=setTimeout(()=>{c.current=null,e()},1e3))},n.onmessage=e=>{a(va(e.data),e=>s.current?.(e))}}return e(),()=>{c.current!==null&&(clearTimeout(c.current),c.current=null),l.current?.close(),l.current=null,o(!1)}},[t,r]),{connected:i}}var ba=e=>{for(let t of e)if(t.hunks.length>0)return t.newPath;return e[0]?.newPath??null},xa=e=>{let t=(0,$.c)(2),{message:n}=e,r;return t[0]===n?r=t[1]:(r=(0,V.jsx)(`div`,{className:`rounded-sm border border-border-default bg-surface-elevated p-8 text-center`,children:(0,V.jsx)(`p`,{className:`text-sm text-text-tertiary`,children:n})}),t[0]=n,t[1]=r),r},Sa=e=>{let t=(0,$.c)(16),{hasFiles:n,emptyMessage:r,file:i,diffMode:a,summary:o,onLocalCommentsChange:s,viewed:c,onToggleViewed:l,pendingDeleteId:u,onPendingDeleteHandled:d}=e;if(!n){let e;return t[0]===r?e=t[1]:(e=(0,V.jsx)(xa,{message:r}),t[0]=r,t[1]=e),e}if(!i){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(xa,{message:`Select a file to view its diff.`}),t[2]=e):e=t[2],e}let f;t[3]===o?f=t[4]:(f=(0,V.jsx)(ge,{summary:o}),t[3]=o,t[4]=f);let p;t[5]!==a||t[6]!==i||t[7]!==s||t[8]!==d||t[9]!==l||t[10]!==u||t[11]!==c?(p=(0,V.jsx)(he,{file:i,diffMode:a,onLocalCommentsChange:s,viewed:c,onToggleViewed:l,pendingDeleteId:u,onPendingDeleteHandled:d}),t[5]=a,t[6]=i,t[7]=s,t[8]=d,t[9]=l,t[10]=u,t[11]=c,t[12]=p):p=t[12];let m;return t[13]!==f||t[14]!==p?(m=(0,V.jsxs)(`div`,{className:`space-y-3`,children:[f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15],m},Ca=()=>{let e=s({from:`/`}),t=o(),n=C();ya({onEvent:()=>n.invalidate()});let[r,i]=(0,B.useState)(()=>ba(e.files)),[a,l]=(0,B.useState)(new Set),[d,f]=(0,B.useState)(`split`),[m,h]=(0,B.useState)(null),[v,b]=(0,B.useState)(!1),x=(0,B.useRef)(new Map),[T,E]=(0,B.useState)([]),[D,O]=(0,B.useState)(0),[k,A]=(0,B.useState)(()=>{let t=Ki();return Ji(t,e.scope)?t:null}),j=(0,B.useMemo)(()=>e.files.find(e=>e.newPath===r)??null,[e.files,r]),M=(0,B.useCallback)(()=>x.current,[]),N=(0,B.useCallback)((e,t)=>{i(e),requestAnimationFrame(()=>{let t=`diff-file-${e.replaceAll(`/`,`-`)}`,n=document.querySelector(`#${t}`);n&&n.scrollIntoView({behavior:`smooth`,block:`start`})})},[]),[ee,te]=(0,B.useState)(null),ne=(0,B.useCallback)(()=>{te(null)},[]),P=ga({getLocalComments:M,onDeleteAnnotation:(0,B.useCallback)(e=>{if((r?x.current.get(r):void 0)?.some(t=>t.id===e))te(e);else{for(let[t,n]of x.current){let r=n.filter(t=>t.id!==e);if(r.length!==n.length){r.length===0?x.current.delete(t):x.current.set(t,r);break}}O(e=>e+1)}},[r]),onNavigate:N}),{buildGroups:F}=P,re=(0,B.useMemo)(()=>F(),[F,D]);(0,B.useEffect)(()=>{i(ba(e.files)),l(new Set),h(null)},[e.scope,e.files]);let ie=(0,B.useCallback)(e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);(0,B.useEffect)(()=>{a.size!==0&&Gi({scope:e.scope,selectedFile:r,viewedFiles:[...a]})},[a,r,e.scope]),w((0,B.useMemo)(()=>[{description:`New review`,handler:()=>{window.location.href=`/reviews/new`},key:`n`},{description:`Go to Reviews`,handler:()=>t({to:`/reviews`}),key:`r`}],[t]));let ae=(0,B.useCallback)(e=>{i(e)},[]),oe=(0,B.useCallback)((e,t)=>{t.length===0?x.current.delete(e):x.current.set(e,t),O(e=>e+1)},[]),se=(0,B.useCallback)(()=>{let e=[];for(let t of x.current.values())for(let n of t)e.push({content:n.content,filePath:n.filePath,lineNumber:n.lineNumber,lineType:n.lineType,suggestion:n.suggestion});E(e),b(!0)},[]),{handleCopyFeedback:ce}=P,ue=(0,B.useCallback)(()=>{ce(re)},[ce,re]),de=(0,B.useCallback)(()=>{f(e=>e===`split`?`unified`:`split`)},[]),I=(0,B.useCallback)(async n=>{if(n!==e.scope){h(n),i(null);try{await t({search:e=>({...e,scope:n}),to:`/`})}finally{h(null)}}},[e.scope,t]),L=e.scope===`unstaged`||e.scope===`uncommitted`,fe=(0,B.useCallback)(e=>{_.runFork(g(function*(){let{http:t}=yield*y;return yield*t.git.stage({payload:{files:[e]}})}).pipe(S(()=>u(()=>n.invalidate())),p(()=>c)))},[n]),pe=(0,B.useCallback)(async()=>{if(!j)return;let e=j.hunks.flatMap(e=>e.lines.map(e=>e.content)).join(`
|
|
1
|
+
import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{D as i,E as a,N as o,P as s,S as c,V as l,_ as u,c as d,d as f,f as p,i as m,l as h,m as g,n as _,o as v,r as y,s as b,u as x,y as S}from"./preload-helper-D7oT-Xwl.js";import{i as C}from"./useStore-M3H8PB1v.js";import{i as w}from"./main-BQVB_Z0Z.js";import{C as T,E,S as D,T as O,_ as k,a as A,b as j,c as M,d as N,f as ee,g as te,h as ne,i as P,l as F,m as re,n as ie,o as ae,p as oe,r as se,s as ce,t as le,u as ue,v as de,w as I,x as L,y as fe}from"./action-bar-DLRNvLjj.js";import{a as pe,i as me,n as he,r as ge,t as _e}from"./file-tree-CI3Xwwid.js";import{a as R,i as ve,t as z}from"./utils-DElCu2hq.js";var ye=E(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),be=E(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),xe=E(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Se=E(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),Ce=E(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),we=E(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),Te=E(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),B=t(n(),1),V=e(),Ee=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`}),De=`VisuallyHidden`,Oe=B.forwardRef((e,t)=>(0,V.jsx)(I.span,{...e,ref:t,style:{...Ee,...e.style}}));Oe.displayName=De;var ke=[`top`,`right`,`bottom`,`left`],Ae=Math.min,H=Math.max,je=Math.round,Me=Math.floor,U=e=>({x:e,y:e}),Ne={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Pe(e,t,n){return H(e,Ae(t,n))}function W(e,t){return typeof e==`function`?e(t):e}function G(e){return e.split(`-`)[0]}function Fe(e){return e.split(`-`)[1]}function Ie(e){return e===`x`?`y`:`x`}function Le(e){return e===`y`?`height`:`width`}function K(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Re(e){return Ie(K(e))}function ze(e,t,n){n===void 0&&(n=!1);let r=Fe(e),i=Re(e),a=Le(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Je(o)),[o,Je(o)]}function Be(e){let t=Je(e);return[Ve(e),t,Ve(t)]}function Ve(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var He=[`left`,`right`],Ue=[`right`,`left`],We=[`top`,`bottom`],Ge=[`bottom`,`top`];function Ke(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ue:He:t?He:Ue;case`left`:case`right`:return t?We:Ge;default:return[]}}function qe(e,t,n,r){let i=Fe(e),a=Ke(G(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ve)))),a}function Je(e){let t=G(e);return Ne[t]+e.slice(t.length)}function Ye(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xe(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ye(e)}function Ze(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 Qe(e,t,n){let{reference:r,floating:i}=e,a=K(t),o=Re(t),s=Le(o),c=G(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}}switch(Fe(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function $e(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}=W(t,e),p=Xe(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ze(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},y=Ze(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var et=50,tt=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:$e},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Qe(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<et&&(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}=Qe(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},nt=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}=W(e,t)||{};if(l==null)return{};let d=Xe(u),f={x:n,y:r},p=Re(i),m=Le(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ae(d[_],T),D=Ae(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Pe(O,A,k),M=!c.arrow&&Fe(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),rt=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}=W(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=G(r),_=K(o),v=G(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Je(o)]:Be(o)),x=p!==`none`;!d&&x&&b.push(...qe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ze(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==K(t))||T.every(e=>K(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.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=T.filter(e=>{if(x){let t=K(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 it(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function at(e){return ke.some(t=>e[t]>=0)}var ot=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=W(e,t);switch(i){case`referenceHidden`:{let e=it(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:at(e)}}}case`escaped`:{let e=it(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:at(e)}}}default:return{}}}}},st=new Set([`left`,`top`]);async function ct(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=G(n),s=Fe(n),c=K(n)===`y`,l=st.has(o)?-1:1,u=a&&c?-1:1,d=W(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 lt=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 ct(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}}}}},ut=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}=W(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=K(G(i)),p=Ie(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Pe(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Pe(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},dt=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}=W(e,t),u={x:n,y:r},d=K(i),f=Ie(d),p=u[f],m=u[d],h=W(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=st.has(G(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}}}},ft=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=W(e,t),u=await o.detectOverflow(t,l),d=G(i),f=Fe(i),p=K(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Ae(h-u[g],v),x=Ae(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=H(u.left,0),t=H(u.right,0),n=H(u.top,0),r=H(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:H(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:H(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function pt(){return typeof window<`u`}function mt(e){return ht(e)?(e.nodeName||``).toLowerCase():`#document`}function q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function J(e){return((ht(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ht(e){return pt()?e instanceof Node||e instanceof q(e).Node:!1}function Y(e){return pt()?e instanceof Element||e instanceof q(e).Element:!1}function X(e){return pt()?e instanceof HTMLElement||e instanceof q(e).HTMLElement:!1}function gt(e){return!pt()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof q(e).ShadowRoot}function _t(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Z(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function vt(e){return/^(table|td|th)$/.test(mt(e))}function yt(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var bt=/transform|translate|scale|rotate|perspective|filter/,xt=/paint|layout|strict|content/,St=e=>!!e&&e!==`none`,Ct;function wt(e){let t=Y(e)?Z(e):e;return St(t.transform)||St(t.translate)||St(t.scale)||St(t.rotate)||St(t.perspective)||!Et()&&(St(t.backdropFilter)||St(t.filter))||bt.test(t.willChange||``)||xt.test(t.contain||``)}function Tt(e){let t=kt(e);for(;X(t)&&!Dt(t);){if(wt(t))return t;if(yt(t))return null;t=kt(t)}return null}function Et(){return Ct??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ct}function Dt(e){return/^(html|body|#document)$/.test(mt(e))}function Z(e){return q(e).getComputedStyle(e)}function Ot(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kt(e){if(mt(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||gt(e)&&e.host||J(e);return gt(t)?t.host:t}function At(e){let t=kt(e);return Dt(t)?e.ownerDocument?e.ownerDocument.body:e.body:X(t)&&_t(t)?t:At(t)}function jt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=At(e),i=r===e.ownerDocument?.body,a=q(r);if(i){let e=Mt(a);return t.concat(a,a.visualViewport||[],_t(r)?r:[],e&&n?jt(e):[])}else return t.concat(r,jt(r,[],n))}function Mt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nt(e){let t=Z(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=X(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=je(n)!==a||je(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Pt(e){return Y(e)?e:e.contextElement}function Ft(e){let t=Pt(e);if(!X(t))return U(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Nt(t),o=(a?je(n.width):n.width)/r,s=(a?je(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var It=U(0);function Lt(e){let t=q(e);return!Et()||!t.visualViewport?It:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==q(e)?!1:t}function zt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Pt(e),o=U(1);t&&(r?Y(r)&&(o=Ft(r)):o=Ft(e));let s=Rt(a,n,r)?Lt(a):U(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){let e=q(a),t=r&&Y(r)?q(r):r,n=e,i=Mt(n);for(;i&&r&&t!==n;){let e=Ft(i),t=i.getBoundingClientRect(),r=Z(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=q(i),i=Mt(n)}}return Ze({width:u,height:d,x:c,y:l})}function Bt(e,t){let n=Ot(e).scrollLeft;return t?t.left+n:zt(J(e)).left+n}function Vt(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Bt(e,n),y:n.top+t.scrollTop}}function Ht(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=J(r),s=t?yt(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=U(1),u=U(0),d=X(r);if((d||!d&&!a)&&((mt(r)!==`body`||_t(o))&&(c=Ot(r)),d)){let e=zt(r);l=Ft(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Vt(o,c):U(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 Ut(e){return Array.from(e.getClientRects())}function Wt(e){let t=J(e),n=Ot(e),r=e.ownerDocument.body,i=H(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=H(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Bt(e),s=-n.scrollTop;return Z(r).direction===`rtl`&&(o+=H(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Gt=25;function Kt(e,t){let n=q(e),r=J(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Et();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Bt(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Gt&&(a-=o)}else l<=Gt&&(a+=l);return{width:a,height:o,x:s,y:c}}function qt(e,t){let n=zt(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=X(e)?Ft(e):U(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Jt(e,t,n){let r;if(t===`viewport`)r=Kt(e,n);else if(t===`document`)r=Wt(J(e));else if(Y(t))r=qt(t,n);else{let n=Lt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ze(r)}function Yt(e,t){let n=kt(e);return n===t||!Y(n)||Dt(n)?!1:Z(n).position===`fixed`||Yt(n,t)}function Xt(e,t){let n=t.get(e);if(n)return n;let r=jt(e,[],!1).filter(e=>Y(e)&&mt(e)!==`body`),i=null,a=Z(e).position===`fixed`,o=a?kt(e):e;for(;Y(o)&&!Dt(o);){let t=Z(o),n=wt(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||_t(o)&&!n&&Yt(e,o))?r=r.filter(e=>e!==o):i=t,o=kt(o)}return t.set(e,r),r}function Zt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?yt(t)?[]:Xt(t,this._c):[].concat(n),r],o=Jt(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=Jt(t,a[e],i);s=H(n.top,s),c=Ae(n.right,c),l=Ae(n.bottom,l),u=H(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Qt(e){let{width:t,height:n}=Nt(e);return{width:t,height:n}}function $t(e,t,n){let r=X(t),i=J(t),a=n===`fixed`,o=zt(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=U(0);function l(){c.x=Bt(i)}if(r||!r&&!a)if((mt(t)!==`body`||_t(i))&&(s=Ot(t)),r){let e=zt(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Vt(i,s):U(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function en(e){return Z(e).position===`static`}function tn(e,t){if(!X(e)||Z(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return J(e)===n&&(n=n.ownerDocument.body),n}function nn(e,t){let n=q(e);if(yt(e))return n;if(!X(e)){let t=kt(e);for(;t&&!Dt(t);){if(Y(t)&&!en(t))return t;t=kt(t)}return n}let r=tn(e,t);for(;r&&vt(r)&&en(r);)r=tn(r,t);return r&&Dt(r)&&en(r)&&!wt(r)?n:r||Tt(e)||n}var rn=async function(e){let t=this.getOffsetParent||nn,n=this.getDimensions,r=await n(e.floating);return{reference:$t(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function an(e){return Z(e).direction===`rtl`}var on={convertOffsetParentRelativeRectToViewportRelativeRect:Ht,getDocumentElement:J,getClippingRect:Zt,getOffsetParent:nn,getElementRects:rn,getClientRects:Ut,getDimensions:Qt,getScale:Ft,isElement:Y,isRTL:an};function sn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cn(e,t){let n=null,r,i=J(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Me(d),h=Me(i.clientWidth-(u+f)),g=Me(i.clientHeight-(d+p)),_=Me(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:H(0,Ae(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!sn(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function ln(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=Pt(e),u=i||a?[...l?jt(l):[],...t?jt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?cn(l,n):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?zt(e):null;c&&g();function g(){let t=zt(e);h&&!sn(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 un=lt,dn=ut,fn=rt,pn=ft,mn=ot,hn=nt,gn=dt,_n=(e,t,n)=>{let r=new Map,i={platform:on,...n},a={...i.platform,_c:r};return tt(e,t,{...i,platform:a})},vn=t(l(),1),yn=typeof document<`u`?B.useLayoutEffect:function(){};function bn(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(!bn(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)&&!bn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function xn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sn(e,t){let n=xn(e);return Math.round(t*n)/n}function Cn(e){let t=B.useRef(e);return yn(()=>{t.current=e}),t}function wn(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,[u,d]=B.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=B.useState(r);bn(f,r)||p(r);let[m,h]=B.useState(null),[g,_]=B.useState(null),v=B.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=B.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=B.useRef(null),C=B.useRef(null),w=B.useRef(u),T=c!=null,E=Cn(c),D=Cn(i),O=Cn(l),k=B.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),_n(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!bn(w.current,t)&&(w.current=t,vn.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);yn(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=B.useRef(!1);yn(()=>(A.current=!0,()=>{A.current=!1}),[]),yn(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=B.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=B.useMemo(()=>({reference:b,floating:x}),[b,x]),N=B.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Sn(M.floating,u.x),r=Sn(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...xn(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return B.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Tn=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?{}:hn({element:r.current,padding:i}).fn(n):r?hn({element:r,padding:i}).fn(n):{}}}},En=(e,t)=>{let n=un(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dn=(e,t)=>{let n=dn(e);return{name:n.name,fn:n.fn,options:[e,t]}},On=(e,t)=>({fn:gn(e).fn,options:[e,t]}),kn=(e,t)=>{let n=fn(e);return{name:n.name,fn:n.fn,options:[e,t]}},An=(e,t)=>{let n=pn(e);return{name:n.name,fn:n.fn,options:[e,t]}},jn=(e,t)=>{let n=mn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mn=(e,t)=>{let n=Tn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nn=`Arrow`,Pn=B.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,V.jsx)(I.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,V.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Pn.displayName=Nn;var Fn=Pn,In=`Popper`,[Ln,Rn]=T(In),[zn,Bn]=Ln(In),Vn=e=>{let{__scopePopper:t,children:n}=e,[r,i]=B.useState(null);return(0,V.jsx)(zn,{scope:t,anchor:r,onAnchorChange:i,children:n})};Vn.displayName=In;var Hn=`PopperAnchor`,Un=B.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Bn(Hn,n),o=B.useRef(null),s=R(t,o),c=B.useRef(null);return B.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,V.jsx)(I.div,{...i,ref:s})});Un.displayName=Hn;var Wn=`PopperContent`,[Gn,Kn]=Ln(Wn),qn=B.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Bn(Wn,n),[_,v]=B.useState(null),y=R(t,e=>v(e)),[b,x]=B.useState(null),S=M(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(Zn),altBoundary:O},{refs:A,floatingStyles:N,placement:ee,isPositioned:ne,middlewareData:P}=wn({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>ln(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[En({mainAxis:i+w,alignmentAxis:o}),c&&Dn({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?On():void 0,...k}),c&&kn({...k}),An({...k,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`)}}),b&&Mn({element:b,padding:s}),Qn({arrowWidth:C,arrowHeight:w}),f&&jn({strategy:`referenceHidden`,...k})]}),[F,re]=$n(ee),ie=te(m);j(()=>{ne&&ie?.()},[ne,ie]);let ae=P.arrow?.x,oe=P.arrow?.y,se=P.arrow?.centerOffset!==0,[ce,le]=B.useState();return j(()=>{_&&le(window.getComputedStyle(_).zIndex)},[_]),(0,V.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:ne?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ce,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,V.jsx)(Gn,{scope:n,placedSide:F,onArrowChange:x,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:(0,V.jsx)(I.div,{"data-side":F,"data-align":re,...h,ref:y,style:{...h.style,animation:ne?void 0:`none`}})})})});qn.displayName=Wn;var Jn=`PopperArrow`,Yn={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Xn=B.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Kn(Jn,n),a=Yn[i.placedSide];return(0,V.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,V.jsx)(Fn,{...r,ref:t,style:{...r.style,display:`block`}})})});Xn.displayName=Jn;function Zn(e){return e!==null}var Qn=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]=$n(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 $n(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var er=Vn,tr=Un,nr=qn,rr=Xn;function ir(e,[t,n]){return Math.min(n,Math.max(t,e))}var ar=[` `,`Enter`,`ArrowUp`,`ArrowDown`],or=[` `,`Enter`],sr=`Select`,[cr,lr,ur]=D(sr),[dr,fr]=T(sr,[ur,Rn]),pr=Rn(),[mr,hr]=dr(sr),[gr,_r]=dr(sr),vr=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=pr(t),[g,_]=B.useState(null),[v,y]=B.useState(null),[b,x]=B.useState(!1),S=k(l),[C,w]=fe({prop:r,defaultProp:i??!1,onChange:a,caller:sr}),[T,E]=fe({prop:o,defaultProp:s,onChange:c,caller:sr}),D=B.useRef(null),O=g?m||!!g.closest(`form`):!0,[A,j]=B.useState(new Set),M=Array.from(A).map(e=>e.props.value).join(`;`);return(0,V.jsx)(er,{...h,children:(0,V.jsxs)(mr,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:de(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[(0,V.jsx)(cr.Provider,{scope:t,children:(0,V.jsx)(gr,{scope:e.__scopeSelect,onNativeOptionAdd:B.useCallback(e=>{j(t=>new Set(t).add(e))},[]),onNativeOptionRemove:B.useCallback(e=>{j(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),O?(0,V.jsxs)(fi,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:e=>E(e.target.value),disabled:f,form:m,children:[T===void 0?(0,V.jsx)(`option`,{value:``}):null,Array.from(A)]},M):null]})})};vr.displayName=sr;var yr=`SelectTrigger`,br=B.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=pr(n),o=hr(yr,n),s=o.disabled||r,c=R(t,o.onTriggerChange),l=lr(n),u=B.useRef(`touch`),[d,f,p]=mi(e=>{let t=l().filter(e=>!e.disabled),n=hi(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,V.jsx)(tr,{asChild:!0,...a,children:(0,V.jsx)(I.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":pi(o.value)?``:void 0,...i,ref:c,onClick:L(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:L(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:L(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&ar.includes(e.key)&&(m(),e.preventDefault())})})})});br.displayName=yr;var xr=`SelectValue`,Sr=B.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=hr(xr,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=R(t,c.onValueNodeChange);return j(()=>{l(u)},[l,u]),(0,V.jsx)(I.span,{...s,ref:d,style:{pointerEvents:`none`},children:pi(c.value)?(0,V.jsx)(V.Fragment,{children:o}):a})});Sr.displayName=xr;var Cr=`SelectIcon`,wr=B.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,V.jsx)(I.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});wr.displayName=Cr;var Tr=`SelectPortal`,Er=e=>(0,V.jsx)(oe,{asChild:!0,...e});Er.displayName=Tr;var Dr=`SelectContent`,Or=B.forwardRef((e,t)=>{let n=hr(Dr,e.__scopeSelect),[r,i]=B.useState();if(j(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?vn.createPortal((0,V.jsx)(kr,{scope:e.__scopeSelect,children:(0,V.jsx)(cr.Slot,{scope:e.__scopeSelect,children:(0,V.jsx)(`div`,{children:e.children})})}),t):null}return(0,V.jsx)(Nr,{...e,ref:t})});Or.displayName=Dr;var Q=10,[kr,Ar]=dr(Dr),jr=`SelectContentImpl`,Mr=ve(`SelectContent.RemoveScroll`),Nr=B.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=hr(Dr,n),[y,b]=B.useState(null),[x,S]=B.useState(null),C=R(t,e=>b(e)),[w,T]=B.useState(null),[E,D]=B.useState(null),O=lr(n),[k,A]=B.useState(!1),j=B.useRef(!1);B.useEffect(()=>{if(y)return ue(y)},[y]),ee();let M=B.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),te=B.useCallback(()=>M([w,y]),[M,w,y]);B.useEffect(()=>{k&&te()},[k,te]);let{onOpenChange:P,triggerPointerDownPosRef:F}=v;B.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||P(!1),document.removeEventListener(`pointermove`,t),F.current=null};return F.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,P,F]),B.useEffect(()=>{let e=()=>P(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[P]);let[ie,ae]=mi(e=>{let t=O().filter(e=>!e.disabled),n=hi(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),oe=B.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(j.current=!0))},[v.value]),se=B.useCallback(()=>y?.focus(),[y]),ce=B.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),le=r===`popper`?Lr:Fr,de=le===Lr?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,V.jsx)(kr,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:oe,selectedItem:w,onItemLeave:se,itemTextRefCallback:ce,focusSelectedItem:te,selectedItemText:E,position:r,isPositioned:k,searchRef:ie,children:(0,V.jsx)(N,{as:Mr,allowPinchZoom:!0,children:(0,V.jsx)(re,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:L(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,V.jsx)(ne,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,V.jsx)(le,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...de,onPlaced:()=>A(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:L(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ae(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})});Nr.displayName=jr;var Pr=`SelectItemAlignedPosition`,Fr=B.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=hr(Dr,n),o=Ar(Dr,n),[s,c]=B.useState(null),[l,u]=B.useState(null),d=R(t,e=>u(e)),f=lr(n),p=B.useRef(!1),m=B.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=B.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Q,d=ir(a,[Q,Math.max(Q,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Q,d=ir(a,[Q,Math.max(Q,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Q*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Q,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${Q}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);j(()=>y(),[y]);let[b,x]=B.useState();return j(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,V.jsx)(Rr,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:B.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,V.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,V.jsx)(I.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});Fr.displayName=Pr;var Ir=`SelectPopperPosition`,Lr=B.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Q,...a}=e,o=pr(n);return(0,V.jsx)(nr,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});Lr.displayName=Ir;var[Rr,zr]=dr(Dr,{}),Br=`SelectViewport`,Vr=B.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Ar(Br,n),o=zr(Br,n),s=R(t,a.onViewportChange),c=B.useRef(0);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,V.jsx)(cr.Slot,{scope:n,children:(0,V.jsx)(I.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:L(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Q*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});Vr.displayName=Br;var Hr=`SelectGroup`,[Ur,Wr]=dr(Hr),Gr=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=de();return(0,V.jsx)(Ur,{scope:n,id:i,children:(0,V.jsx)(I.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Gr.displayName=Hr;var Kr=`SelectLabel`,qr=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Wr(Kr,n);return(0,V.jsx)(I.div,{id:i.id,...r,ref:t})});qr.displayName=Kr;var Jr=`SelectItem`,[Yr,Xr]=dr(Jr),Zr=B.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=hr(Jr,n),c=Ar(Jr,n),l=s.value===r,[u,d]=B.useState(a??``),[f,p]=B.useState(!1),m=R(t,e=>c.itemRefCallback?.(e,r,i)),h=de(),g=B.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,V.jsx)(Yr,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:B.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,V.jsx)(cr.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,V.jsx)(I.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:L(o.onFocus,()=>p(!0)),onBlur:L(o.onBlur,()=>p(!1)),onClick:L(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:L(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:L(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:L(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:L(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:L(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(or.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});Zr.displayName=Jr;var Qr=`SelectItemText`,$r=B.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=hr(Qr,n),s=Ar(Qr,n),c=Xr(Qr,n),l=_r(Qr,n),[u,d]=B.useState(null),f=R(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=B.useMemo(()=>(0,V.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return j(()=>(h(m),()=>g(m)),[h,g,m]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(I.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?vn.createPortal(a.children,o.valueNode):null]})});$r.displayName=Qr;var ei=`SelectItemIndicator`,ti=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Xr(ei,n).isSelected?(0,V.jsx)(I.span,{"aria-hidden":!0,...r,ref:t}):null});ti.displayName=ei;var ni=`SelectScrollUpButton`,ri=B.forwardRef((e,t)=>{let n=Ar(ni,e.__scopeSelect),r=zr(ni,e.__scopeSelect),[i,a]=B.useState(!1),o=R(t,r.onScrollButtonChange);return j(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,V.jsx)(oi,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});ri.displayName=ni;var ii=`SelectScrollDownButton`,ai=B.forwardRef((e,t)=>{let n=Ar(ii,e.__scopeSelect),r=zr(ii,e.__scopeSelect),[i,a]=B.useState(!1),o=R(t,r.onScrollButtonChange);return j(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,V.jsx)(oi,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});ai.displayName=ii;var oi=B.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Ar(`SelectScrollButton`,n),o=B.useRef(null),s=lr(n),c=B.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return B.useEffect(()=>()=>c(),[c]),j(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,V.jsx)(I.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:L(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:L(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:L(i.onPointerLeave,()=>{c()})})}),si=`SelectSeparator`,ci=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,V.jsx)(I.div,{"aria-hidden":!0,...r,ref:t})});ci.displayName=si;var li=`SelectArrow`,ui=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=pr(n),a=hr(li,n),o=Ar(li,n);return a.open&&o.position===`popper`?(0,V.jsx)(rr,{...i,...r,ref:t}):null});ui.displayName=li;var di=`SelectBubbleInput`,fi=B.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=B.useRef(null),a=R(r,i),o=F(t);return B.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,V.jsx)(I.select,{...n,style:{...Ee,...n.style},ref:a,defaultValue:t})});fi.displayName=di;function pi(e){return e===``||e===void 0}function mi(e){let t=te(e),n=B.useRef(``),r=B.useRef(0),i=B.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=B.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return B.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function hi(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=gi(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function gi(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var _i=vr,vi=br,yi=wr,bi=Er,xi=Or,Si=Vr,Ci=Gr,wi=Zr,Ti=$r,Ei=ti,Di=ri,Oi=ai,$=r(),ki=e=>{let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,V.jsx)(_i,{"data-slot":`select`,...e}),t[0]=e,t[1]=n),n},Ai=e=>{let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=z(`scroll-my-1 p-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(Ci,{"data-slot":`select-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a},ji=e=>{let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,size:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===r?s=t[6]:(s=z(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsx)(yi,{asChild:!0,children:(0,V.jsx)(ye,{className:`pointer-events-none size-4 text-muted-foreground`})}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,V.jsxs)(vi,{"data-slot":`select-trigger`,"data-size":o,className:s,...i,children:[n,c]}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l},Mi=e=>{let t=(0,$.c)(24),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,position:a,align:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?`item-aligned`:a,c=o===void 0?`center`:o,l=s===`item-aligned`,u=s===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,d;t[6]!==r||t[7]!==u?(d=z(`relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,u,r),t[6]=r,t[7]=u,t[8]=d):d=t[8];let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,V.jsx)(Pi,{}),t[9]=f):f=t[9];let p=s===`popper`&&``,m;t[10]===p?m=t[11]:(m=z(`data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`,p),t[10]=p,t[11]=m);let h;t[12]!==n||t[13]!==s||t[14]!==m?(h=(0,V.jsx)(Si,{"data-position":s,className:m,children:n}),t[12]=n,t[13]=s,t[14]=m,t[15]=h):h=t[15];let g;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,V.jsx)(Fi,{}),t[16]=g):g=t[16];let _;return t[17]!==c||t[18]!==s||t[19]!==i||t[20]!==l||t[21]!==d||t[22]!==h?(_=(0,V.jsx)(bi,{children:(0,V.jsxs)(xi,{"data-slot":`select-content`,"data-align-trigger":l,className:d,position:s,align:c,...i,children:[f,h,g]})}),t[17]=c,t[18]=s,t[19]=i,t[20]=l,t[21]=d,t[22]=h,t[23]=_):_=t[23],_},Ni=e=>{let t=(0,$.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=z(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]: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 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,V.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`,children:(0,V.jsx)(Ei,{children:(0,V.jsx)(O,{className:`pointer-events-none`})})}),t[6]=o):o=t[6];let s;t[7]===n?s=t[8]:(s=(0,V.jsx)(Ti,{children:n}),t[7]=n,t[8]=s);let c;return t[9]!==i||t[10]!==a||t[11]!==s?(c=(0,V.jsxs)(wi,{"data-slot":`select-item`,className:a,...i,children:[o,s]}),t[9]=i,t[10]=a,t[11]=s,t[12]=c):c=t[12],c},Pi=e=>{let t=(0,$.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=z(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsx)(be,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,V.jsx)(Di,{"data-slot":`select-scroll-up-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o},Fi=e=>{let t=(0,$.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=z(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsx)(ye,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,V.jsx)(Oi,{"data-slot":`select-scroll-down-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o},Ii={"last-commit":`Last Commit`,staged:`Staged`,uncommitted:`Uncommitted`,unstaged:`Unstaged`},Li={"last-commit":`No previous commit found`,staged:`No staged changes — stage files with git add`,uncommitted:`Working tree clean — no uncommitted changes`,unstaged:`No unstaged changes — all modifications are staged`},Ri={"last-commit":we,staged:xe,uncommitted:Se,unstaged:Ce},zi=e=>{let t=(0,$.c)(3),{fileCount:n,isLoading:r}=e;if(r){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`span`,{className:`inline-flex h-5 min-w-5 items-center justify-center rounded-full border border-border-default bg-surface-overlay px-1.5 text-[10px] text-text-tertiary motion-reduce:animate-none`,children:(0,V.jsx)(Te,{className:`size-3 animate-spin motion-reduce:animate-none`})}),t[0]=e):e=t[0],e}if(typeof n!=`number`)return null;let i;return t[1]===n?i=t[2]:(i=(0,V.jsx)(`span`,{className:`inline-flex h-5 min-w-5 items-center justify-center rounded-full border border-border-default bg-surface-overlay px-1.5 text-[10px] font-medium tabular-nums text-text-secondary`,children:n}),t[1]=n,t[2]=i),i},Bi=e=>{let t=(0,$.c)(26),{value:n,onChange:r,fileCount:i,isLoading:a}=e,o=a===void 0?!1:a,s=o?Te:Ri[n],c;t[0]===r?c=t[1]:(c=e=>{r(e)},t[0]=r,t[1]=c);let l=c,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=z(`h-7 min-w-0 gap-1.5 rounded-[10px] border-border-subtle bg-surface-primary px-2 text-[11px] font-medium text-text-secondary shadow-none transition-[color,background-color,border-color,box-shadow,transform,opacity] duration-150 [transition-timing-function:cubic-bezier(0.23,1,0.32,1)] focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40 active:scale-[0.97] motion-reduce:transform-none motion-reduce:transition-[color,background-color,border-color,box-shadow,opacity] [&_svg]:text-text-tertiary`),t[2]=u):u=t[2];let d=o&&`animate-spin motion-reduce:animate-none`,f;t[3]===d?f=t[4]:(f=z(`size-3.5 shrink-0`,d),t[3]=d,t[4]=f);let p;t[5]!==s||t[6]!==f?(p=(0,V.jsx)(s,{className:f}),t[5]=s,t[6]=f,t[7]=p):p=t[7];let h=Ii[n],g;t[8]===h?g=t[9]:(g=(0,V.jsx)(`span`,{className:`truncate`,children:h}),t[8]=h,t[9]=g);let _;t[10]!==p||t[11]!==g?(_=(0,V.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[p,g]}),t[10]=p,t[11]=g,t[12]=_):_=t[12];let v;t[13]!==i||t[14]!==o?(v=(0,V.jsx)(zi,{fileCount:i,isLoading:o}),t[13]=i,t[14]=o,t[15]=v):v=t[15];let y;t[16]!==v||t[17]!==_?(y=(0,V.jsxs)(ji,{"aria-label":`Diff scope`,className:u,size:`sm`,children:[_,v]}),t[16]=v,t[17]=_,t[18]=y):y=t[18];let b;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(b=z(`min-w-44 rounded-xl border border-border-default bg-surface-elevated p-1 shadow-[0_18px_40px_-24px_rgba(0,0,0,0.7)] transition-[opacity,transform] duration-150 [transition-timing-function:cubic-bezier(0.23,1,0.32,1)] data-[state=closed]:scale-95 data-[state=closed]:opacity-0 data-[state=open]:scale-100 data-[state=open]:opacity-100 motion-reduce:transform-none motion-reduce:transition-opacity`),t[19]=b):b=t[19];let x;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,V.jsx)(Mi,{align:`end`,className:b,position:`popper`,children:(0,V.jsx)(Ai,{children:m.map(Vi)})}),t[20]=x):x=t[20];let S;return t[21]!==l||t[22]!==o||t[23]!==y||t[24]!==n?(S=(0,V.jsxs)(ki,{disabled:o,onValueChange:l,value:n,children:[y,x]}),t[21]=l,t[22]=o,t[23]=y,t[24]=n,t[25]=S):S=t[25],S};function Vi(e){let t=Ri[e];return(0,V.jsx)(Ni,{className:`rounded-lg px-2 py-1.5 text-xs text-text-secondary focus:bg-surface-overlay focus:text-text-primary`,value:e,children:(0,V.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(t,{className:`size-3.5 shrink-0`}),(0,V.jsx)(`span`,{className:`truncate`,children:Ii[e]})]})},e)}var Hi=`ringi.session-draft.v1`,Ui=1800*1e3,Wi=()=>{if(!(typeof window>`u`))try{localStorage.removeItem(Hi)}catch{}},Gi=e=>{if(typeof window>`u`)return;let t={...e,savedAt:Date.now()};try{localStorage.setItem(Hi,JSON.stringify(t))}catch{}},Ki=()=>{if(typeof window>`u`)return null;try{let e=localStorage.getItem(Hi);if(!e)return null;let t=JSON.parse(e);return typeof t.savedAt!=`number`||!Array.isArray(t.viewedFiles)||typeof t.scope!=`string`?null:Date.now()-t.savedAt>Ui?(Wi(),null):{savedAt:t.savedAt,scope:t.scope,selectedFile:typeof t.selectedFile==`string`?t.selectedFile:null,viewedFiles:t.viewedFiles.filter(e=>typeof e==`string`)}}catch{return null}},qi=e=>{let t=Date.now()-e,n=Math.floor(t/1e3),r=Math.floor(n/60),i=Math.floor(r/60);return n<30?`just now`:r<1?`less than a minute ago`:r===1?`1 minute ago`:r<60?`${r} minutes ago`:i===1?`1 hour ago`:`${i} hours ago`},Ji=(e,t)=>e!==null&&e.scope===t&&e.viewedFiles.length>0,Yi=`transition-[transform,background-color,color,border-color,box-shadow,opacity] duration-150 [transition-timing-function:cubic-bezier(0.23,1,0.32,1)] motion-reduce:transform-none`,Xi=e=>{let t=(0,$.c)(35),{open:n,draft:r,onRestore:i,onDismiss:a}=e,o=r.viewedFiles.length,s;t[0]===r.savedAt?s=t[1]:(s=qi(r.savedAt),t[0]=r.savedAt,t[1]=s);let c=s,l;t[2]===i?l=t[3]:(l=()=>{i()},t[2]=i,t[3]=l);let u=l,d;t[4]===a?d=t[5]:(d=()=>{a()},t[4]=a,t[5]=d);let f=d,p;t[6]===a?p=t[7]:(p=e=>{e||a()},t[6]=a,t[7]=p);let m=p,h;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,V.jsx)(ce,{children:`Draft Recovered`}),t[8]=h):h=t[8];let g=`Found ${o} viewed file${o===1?``:`s`} from ${c}.`,_;t[9]===g?_=t[10]:(_=(0,V.jsxs)(ae,{children:[h,(0,V.jsx)(P,{children:g})]}),t[9]=g,t[10]=_);let v;t[11]===r.viewedFiles?v=t[12]:(v=r.viewedFiles.slice(0,5).map(Zi),t[11]=r.viewedFiles,t[12]=v);let y;t[13]===o?y=t[14]:(y=o>5?(0,V.jsx)(`li`,{className:`text-xs text-text-tertiary`,children:`… and ${o-5} more`}):null,t[13]=o,t[14]=y);let b;t[15]!==v||t[16]!==y?(b=(0,V.jsx)(`div`,{className:`px-5 py-3`,children:(0,V.jsxs)(`ul`,{className:`flex flex-col gap-1`,children:[v,y]})}),t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(x=z(`rounded-lg border border-border-default bg-surface-elevated px-3 py-1.5 text-xs text-text-secondary hover:bg-surface-overlay hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 active:scale-[0.97]`,Yi),t[18]=x):x=t[18];let S;t[19]===f?S=t[20]:(S=(0,V.jsx)(`button`,{type:`button`,onClick:f,className:x,children:`Dismiss`}),t[19]=f,t[20]=S);let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=z(`rounded-lg bg-accent-primary px-3 py-1.5 text-xs font-medium text-white hover:bg-accent-primary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-primary/40 active:scale-[0.97]`,Yi),t[21]=C):C=t[21];let w;t[22]===u?w=t[23]:(w=(0,V.jsx)(`button`,{type:`button`,onClick:u,className:C,children:`Restore`}),t[22]=u,t[23]=w);let T;t[24]!==S||t[25]!==w?(T=(0,V.jsxs)(A,{children:[S,w]}),t[24]=S,t[25]=w,t[26]=T):T=t[26];let E;t[27]!==b||t[28]!==T||t[29]!==_?(E=(0,V.jsxs)(se,{className:`max-w-sm gap-0`,showCloseButton:!1,children:[_,b,T]}),t[27]=b,t[28]=T,t[29]=_,t[30]=E):E=t[30];let D;return t[31]!==m||t[32]!==n||t[33]!==E?(D=(0,V.jsx)(ie,{open:n,onOpenChange:m,children:E}),t[31]=m,t[32]=n,t[33]=E,t[34]=D):D=t[34],D};function Zi(e){return(0,V.jsx)(`li`,{className:`truncate font-mono text-xs text-text-secondary`,children:e},e)}var Qi=`[transition-timing-function:cubic-bezier(0.23,1,0.32,1)]`,$i=`active:scale-[0.97]`,ea=e=>{let t=new Date(e);if(Number.isNaN(t.getTime()))return``;let n=Date.now()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return`just now`;if(r<60)return`${r}m ago`;let i=Math.floor(r/60);return i<24?`${i}h ago`:new Intl.DateTimeFormat(void 0,{day:`numeric`,month:`short`}).format(t)},ta=e=>e.split(`/`).at(-1)??e,na=e=>{let t=e.split(`/`);return t.length<=1?``:t.slice(0,-1).join(`/`)},ra=e=>{let t=(0,$.c)(11),{onDelete:n,annotationId:r}=e,i;t[0]!==r||t[1]!==n?(i=e=>{e.stopPropagation(),n(r)},t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]!==r||t[4]!==n?(o=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),n(r))},t[3]=r,t[4]=n,t[5]=o):o=t[5];let s=o,c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=z(`ml-auto shrink-0 rounded px-1 py-0.5 text-text-quaternary`,`opacity-0 group-hover:opacity-100 group-focus-within:opacity-100`,`transition-[opacity,color,background-color] duration-100`,Qi,`hover:bg-status-error/10 hover:text-status-error`,`focus-visible:bg-status-error/10 focus-visible:text-status-error focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-status-error/30`,`active:scale-[0.93]`,`motion-reduce:transform-none`),t[6]=c):c=t[6];let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 12 12`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,className:`shrink-0`,children:(0,V.jsx)(`path`,{d:`M2 3h8M4.5 3V2a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 .5.5v1M5 5.5v3M7 5.5v3M3 3l.5 7a1 1 0 0 0 1 .9h3a1 1 0 0 0 1-.9L9 3`})}),t[7]=l):l=t[7];let u;return t[8]!==a||t[9]!==s?(u=(0,V.jsx)(`button`,{type:`button`,onClick:a,onKeyDown:s,"aria-label":`Delete annotation`,tabIndex:0,className:c,children:l}),t[8]=a,t[9]=s,t[10]=u):u=t[10],u},ia=e=>{let t=(0,$.c)(34),{entry:n,onClick:r,onDelete:i}=e,a;t[0]!==n||t[1]!==r?(a=()=>r(n),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=a,s;t[3]!==n||t[4]!==r?(s=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r(n))},t[3]=n,t[4]=r,t[5]=s):s=t[5];let c=s,l=n.lineType===`added`?`+`:`-`,u=n.lineType===`added`?`text-diff-add-text`:`text-diff-remove-text`,d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=z(`group flex w-full cursor-pointer flex-col rounded-md px-2.5 py-2 text-left`,`transition-[background-color,transform] duration-150`,Qi,$i,`hover:bg-surface-overlay/60`,`focus-visible:bg-surface-overlay/60 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent-primary/40`,`motion-reduce:transform-none`),t[6]=d):d=t[6];let f;t[7]===u?f=t[8]:(f=z(`rounded bg-surface-primary/80 px-1 py-px font-mono text-[10px] font-medium tabular-nums`,u),t[7]=u,t[8]=f);let p;t[9]!==n.lineNumber||t[10]!==l||t[11]!==f?(p=(0,V.jsxs)(`span`,{className:f,children:[l,`L`,n.lineNumber]}),t[9]=n.lineNumber,t[10]=l,t[11]=f,t[12]=p):p=t[12];let m;t[13]!==n.id||t[14]!==i?(m=(0,V.jsx)(ra,{onDelete:i,annotationId:n.id}),t[13]=n.id,t[14]=i,t[15]=m):m=t[15];let h;t[16]===n.createdAt?h=t[17]:(h=ea(n.createdAt),t[16]=n.createdAt,t[17]=h);let g;t[18]===h?g=t[19]:(g=(0,V.jsx)(`span`,{className:`text-[10px] text-text-quaternary`,children:h}),t[18]=h,t[19]=g);let _;t[20]!==p||t[21]!==m||t[22]!==g?(_=(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[p,m,g]}),t[20]=p,t[21]=m,t[22]=g,t[23]=_):_=t[23];let v;t[24]===n.content?v=t[25]:(v=(0,V.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-[16px] text-text-secondary group-hover:text-text-primary`,children:n.content}),t[24]=n.content,t[25]=v);let y;t[26]===n.suggestion?y=t[27]:(y=n.suggestion?(0,V.jsx)(`div`,{className:`mt-1 flex items-center text-[10px] text-accent-primary/70`,children:(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 14 14`,fill:`none`,className:`shrink-0`,children:(0,V.jsx)(`path`,{d:`M3 5l2.5 2.5L11 2M3 9h8`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`})})}):null,t[26]=n.suggestion,t[27]=y);let b;return t[28]!==o||t[29]!==c||t[30]!==v||t[31]!==y||t[32]!==_?(b=(0,V.jsxs)(`button`,{type:`button`,onClick:o,onKeyDown:c,className:d,children:[_,v,y]}),t[28]=o,t[29]=c,t[30]=v,t[31]=y,t[32]=_,t[33]=b):b=t[33],b},aa=e=>{let t=(0,$.c)(27),{group:n,onAnnotationClick:r,onDeleteAnnotation:i}=e,a;t[0]===n.filePath?a=t[1]:(a=ta(n.filePath),t[0]=n.filePath,t[1]=a);let o=a,s;t[2]===n.filePath?s=t[3]:(s=na(n.filePath),t[2]=n.filePath,t[3]=s);let c=s,l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`shrink-0 text-text-quaternary`,children:(0,V.jsx)(`path`,{d:`M2 3.5A1.5 1.5 0 0 1 3.5 2h3.379a1.5 1.5 0 0 1 1.06.44l.622.621a.5.5 0 0 0 .353.146H12.5A1.5 1.5 0 0 1 14 4.707V12.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 12.5V3.5Z`})}),t[4]=l):l=t[4];let u;t[5]===o?u=t[6]:(u=(0,V.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[11px] font-medium text-text-primary`,children:o}),t[5]=o,t[6]=u);let d;t[7]===c?d=t[8]:(d=c?(0,V.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[10px] text-text-quaternary`,children:c}):null,t[7]=c,t[8]=d);let f;t[9]===n.annotations.length?f=t[10]:(f=(0,V.jsx)(`span`,{className:`ml-auto shrink-0 rounded-full bg-surface-overlay px-1.5 py-px text-[10px] tabular-nums text-text-tertiary`,children:n.annotations.length}),t[9]=n.annotations.length,t[10]=f);let p;t[11]!==u||t[12]!==d||t[13]!==f?(p=(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 px-3 py-1.5`,children:[l,u,d,f]}),t[11]=u,t[12]=d,t[13]=f,t[14]=p):p=t[14];let m;if(t[15]!==n.annotations||t[16]!==r||t[17]!==i){let e;t[19]!==r||t[20]!==i?(e=e=>(0,V.jsx)(ia,{entry:e,onClick:r,onDelete:i},e.id),t[19]=r,t[20]=i,t[21]=e):e=t[21],m=n.annotations.map(e),t[15]=n.annotations,t[16]=r,t[17]=i,t[18]=m}else m=t[18];let h;t[22]===m?h=t[23]:(h=(0,V.jsx)(`div`,{className:`space-y-0.5 px-1`,children:m}),t[22]=m,t[23]=h);let g;return t[24]!==p||t[25]!==h?(g=(0,V.jsxs)(`div`,{className:`py-1`,children:[p,h]}),t[24]=p,t[25]=h,t[26]=g):g=t[26],g},oa=()=>{let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`div`,{className:`flex flex-col items-center justify-center px-4 py-12 text-center`,children:(0,V.jsx)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`text-text-quaternary/40`,children:(0,V.jsx)(`path`,{d:`M1 3.5A2.5 2.5 0 0 1 3.5 1h9A2.5 2.5 0 0 1 15 3.5v6a2.5 2.5 0 0 1-2.5 2.5H9l-3.5 3v-3H3.5A2.5 2.5 0 0 1 1 9.5v-6Z`})})}),e[0]=t):t=e[0],t},sa=()=>{let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`shrink-0`,children:[(0,V.jsx)(`rect`,{x:`5`,y:`5`,width:`8`,height:`8`,rx:`1.5`}),(0,V.jsx)(`path`,{d:`M5 11H4.5A1.5 1.5 0 0 1 3 9.5V4.5A1.5 1.5 0 0 1 4.5 3H9.5A1.5 1.5 0 0 1 11 4.5V5`})]}),e[0]=t):t=e[0],t},ca=()=>{let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`shrink-0 text-status-success`,children:(0,V.jsx)(`path`,{d:`M2.5 6.5L5 9l4.5-6`})}),e[0]=t):t=e[0],t},la=()=>{let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,className:`shrink-0 text-status-error`,children:(0,V.jsx)(`path`,{d:`M3 3l6 6M9 3l-6 6`})}),e[0]=t):t=e[0],t},ua={copied:`Copied!`,error:`Failed`,idle:`Copy Feedback`},da={copied:`text-status-success`,error:`text-status-error`,idle:`text-text-secondary hover:bg-surface-overlay hover:text-text-primary`},fa=e=>{let t=(0,$.c)(3),{status:n}=e;if(n===`copied`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(ca,{}),t[0]=e):e=t[0],e}if(n===`error`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(la,{}),t[1]=e):e=t[1],e}let r;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,V.jsx)(sa,{}),t[2]=r):r=t[2],r},pa=e=>{let t=(0,$.c)(13),{copyStatus:n,onCopyFeedback:r}=e,i=n!==`idle`,a=da[n],o=n!==`idle`&&`pointer-events-none`,s;t[0]!==a||t[1]!==o?(s=z(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-[11px] font-medium`,`transition-[background-color,color,transform,opacity] duration-150`,Qi,$i,a,o,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent-primary/40`,`motion-reduce:transform-none`),t[0]=a,t[1]=o,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=(0,V.jsx)(fa,{status:n}),t[3]=n,t[4]=c);let l=ua[n],u;t[5]===l?u=t[6]:(u=(0,V.jsx)(`span`,{children:l}),t[5]=l,t[6]=u);let d;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==c||t[11]!==u?(d=(0,V.jsxs)(`button`,{type:`button`,onClick:r,disabled:i,className:s,children:[c,u]}),t[7]=r,t[8]=i,t[9]=s,t[10]=c,t[11]=u,t[12]=d):d=t[12],d},ma=e=>{let t=(0,$.c)(23),{isOpen:n,onClose:r,groups:i,totalCount:a,copyStatus:o,onAnnotationClick:s,onDeleteAnnotation:c,onCopyFeedback:l}=e,u=(0,B.useRef)(null),d,f;t[0]!==n||t[1]!==r?(d=()=>{if(!n)return;let e=e=>{e.key===`Escape`&&(e.stopPropagation(),r())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},f=[n,r],t[0]=n,t[1]=r,t[2]=d,t[3]=f):(d=t[2],f=t[3]),(0,B.useEffect)(d,f);let p=n?`w-72 opacity-100`:`w-0 opacity-0 overflow-hidden`,m;t[4]===p?m=t[5]:(m=z(`flex h-full flex-col border-l border-border-default bg-surface-secondary`,`transition-[width,opacity] duration-200`,Qi,`motion-reduce:transition-none`,p),t[4]=p,t[5]=m);let h;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=z(`inline-flex h-6 w-6 items-center justify-center rounded-md text-text-tertiary`,`transition-[background-color,color,transform] duration-150`,Qi,$i,`hover:bg-surface-overlay hover:text-text-primary`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent-primary/40`,`motion-reduce:transform-none`),t[6]=h):h=t[6];let g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,V.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:(0,V.jsx)(`path`,{d:`M3 3l6 6M9 3l-6 6`})}),t[7]=g):g=t[7];let _;t[8]===r?_=t[9]:(_=(0,V.jsx)(`div`,{className:`flex h-10 shrink-0 items-center justify-end border-b border-border-default px-3`,children:(0,V.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Close annotations panel`,className:h,children:g})}),t[8]=r,t[9]=_);let v;t[10]!==i||t[11]!==s||t[12]!==c?(v=(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto overflow-x-hidden py-1`,children:i.length===0?(0,V.jsx)(oa,{}):(0,V.jsx)(`div`,{className:`divide-y divide-border-subtle`,children:i.map(e=>(0,V.jsx)(aa,{group:e,onAnnotationClick:s,onDeleteAnnotation:c},e.filePath))})}),t[10]=i,t[11]=s,t[12]=c,t[13]=v):v=t[13];let y;t[14]!==o||t[15]!==l||t[16]!==a?(y=a>0?(0,V.jsx)(`div`,{className:`flex items-center border-t border-border-subtle px-3 py-1.5`,children:(0,V.jsx)(pa,{copyStatus:o,onCopyFeedback:l})}):null,t[14]=o,t[15]=l,t[16]=a,t[17]=y):y=t[17];let b;return t[18]!==m||t[19]!==_||t[20]!==v||t[21]!==y?(b=(0,V.jsxs)(`aside`,{ref:u,role:`complementary`,"aria-label":`Annotations`,className:m,children:[_,v,y]}),t[18]=m,t[19]=_,t[20]=v,t[21]=y,t[22]=b):b=t[22],b},ha=e=>{let t=[];for(let n of e)for(let e of n.annotations)t.push({content:e.content,filePath:e.filePath,lineNumber:e.lineNumber,lineType:e.lineType===`context`?`context`:e.lineType,suggestion:e.suggestion});return pe(t)},ga=({getLocalComments:e,onNavigate:t,onDeleteAnnotation:n})=>{let[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(`idle`),s=(0,B.useCallback)(()=>i(e=>!e),[]),c=(0,B.useCallback)(()=>i(!1),[]),l=(0,B.useCallback)(e=>{t(e.filePath,e.lineNumber)},[t]),u=(0,B.useCallback)(e=>{n?.(e)},[n]);return{buildGroups:(0,B.useCallback)(()=>{let t=e(),n=[];for(let[e,r]of t){if(r.length===0)continue;let t=r.map(e=>({content:e.content,createdAt:e.createdAt,filePath:e.filePath,id:e.id,lineNumber:e.lineNumber,lineType:e.lineType,suggestion:e.suggestion}));n.push({annotations:t,filePath:e})}return n.sort((e,t)=>e.filePath.localeCompare(t.filePath)),n},[e]),copyStatus:a,handleAnnotationClick:l,handleClose:c,handleCopyFeedback:(0,B.useCallback)(async e=>{let t=ha(e);if(t){try{await navigator.clipboard.writeText(t),o(`copied`)}catch{o(`error`)}setTimeout(()=>o(`idle`),1500)}},[]),handleDeleteAnnotation:u,handleToggle:s,isOpen:r,totalCount:(0,B.useMemo)(()=>{let t=e(),n=0;for(let e of t.values())n+=e.length;return n},[e])}},_a=d({data:h.pipe(f),timestamp:b,type:v([`todos`,`reviews`,`comments`,`files`])}),va=e=>{try{let t=typeof e==`string`?JSON.parse(e):e;return x(_a)(t)}catch{return i()}};function ya(e={}){let{url:t=`/api/events`,onEvent:n,enabled:r=!0}=e,[i,o]=(0,B.useState)(!1),s=(0,B.useRef)(n);s.current=n;let c=(0,B.useRef)(null),l=(0,B.useRef)(null);return(0,B.useEffect)(()=>{if(!r||typeof window>`u`)return;function e(){let n=new EventSource(t);l.current=n,n.onopen=()=>o(!0),n.onerror=()=>{o(!1),n.close(),l.current=null,c.current===null&&(c.current=setTimeout(()=>{c.current=null,e()},1e3))},n.onmessage=e=>{a(va(e.data),e=>s.current?.(e))}}return e(),()=>{c.current!==null&&(clearTimeout(c.current),c.current=null),l.current?.close(),l.current=null,o(!1)}},[t,r]),{connected:i}}var ba=e=>{for(let t of e)if(t.hunks.length>0)return t.newPath;return e[0]?.newPath??null},xa=e=>{let t=(0,$.c)(2),{message:n}=e,r;return t[0]===n?r=t[1]:(r=(0,V.jsx)(`div`,{className:`rounded-sm border border-border-default bg-surface-elevated p-8 text-center`,children:(0,V.jsx)(`p`,{className:`text-sm text-text-tertiary`,children:n})}),t[0]=n,t[1]=r),r},Sa=e=>{let t=(0,$.c)(16),{hasFiles:n,emptyMessage:r,file:i,diffMode:a,summary:o,onLocalCommentsChange:s,viewed:c,onToggleViewed:l,pendingDeleteId:u,onPendingDeleteHandled:d}=e;if(!n){let e;return t[0]===r?e=t[1]:(e=(0,V.jsx)(xa,{message:r}),t[0]=r,t[1]=e),e}if(!i){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(xa,{message:`Select a file to view its diff.`}),t[2]=e):e=t[2],e}let f;t[3]===o?f=t[4]:(f=(0,V.jsx)(ge,{summary:o}),t[3]=o,t[4]=f);let p;t[5]!==a||t[6]!==i||t[7]!==s||t[8]!==d||t[9]!==l||t[10]!==u||t[11]!==c?(p=(0,V.jsx)(he,{file:i,diffMode:a,onLocalCommentsChange:s,viewed:c,onToggleViewed:l,pendingDeleteId:u,onPendingDeleteHandled:d}),t[5]=a,t[6]=i,t[7]=s,t[8]=d,t[9]=l,t[10]=u,t[11]=c,t[12]=p):p=t[12];let m;return t[13]!==f||t[14]!==p?(m=(0,V.jsxs)(`div`,{className:`space-y-3`,children:[f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15],m},Ca=()=>{let e=s({from:`/`}),t=o(),n=C();ya({onEvent:()=>n.invalidate()});let[r,i]=(0,B.useState)(()=>ba(e.files)),[a,l]=(0,B.useState)(new Set),[d,f]=(0,B.useState)(`split`),[m,h]=(0,B.useState)(null),[v,b]=(0,B.useState)(!1),x=(0,B.useRef)(new Map),[T,E]=(0,B.useState)([]),[D,O]=(0,B.useState)(0),[k,A]=(0,B.useState)(()=>{let t=Ki();return Ji(t,e.scope)?t:null}),j=(0,B.useMemo)(()=>e.files.find(e=>e.newPath===r)??null,[e.files,r]),M=(0,B.useCallback)(()=>x.current,[]),N=(0,B.useCallback)((e,t)=>{i(e),requestAnimationFrame(()=>{let t=`diff-file-${e.replaceAll(`/`,`-`)}`,n=document.querySelector(`#${t}`);n&&n.scrollIntoView({behavior:`smooth`,block:`start`})})},[]),[ee,te]=(0,B.useState)(null),ne=(0,B.useCallback)(()=>{te(null)},[]),P=ga({getLocalComments:M,onDeleteAnnotation:(0,B.useCallback)(e=>{if((r?x.current.get(r):void 0)?.some(t=>t.id===e))te(e);else{for(let[t,n]of x.current){let r=n.filter(t=>t.id!==e);if(r.length!==n.length){r.length===0?x.current.delete(t):x.current.set(t,r);break}}O(e=>e+1)}},[r]),onNavigate:N}),{buildGroups:F}=P,re=(0,B.useMemo)(()=>F(),[F,D]);(0,B.useEffect)(()=>{i(ba(e.files)),l(new Set),h(null)},[e.scope,e.files]);let ie=(0,B.useCallback)(e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);(0,B.useEffect)(()=>{a.size!==0&&Gi({scope:e.scope,selectedFile:r,viewedFiles:[...a]})},[a,r,e.scope]),w((0,B.useMemo)(()=>[{description:`New review`,handler:()=>{window.location.href=`/reviews/new`},key:`n`},{description:`Go to Reviews`,handler:()=>t({to:`/reviews`}),key:`r`}],[t]));let ae=(0,B.useCallback)(e=>{i(e)},[]),oe=(0,B.useCallback)((e,t)=>{t.length===0?x.current.delete(e):x.current.set(e,t),O(e=>e+1)},[]),se=(0,B.useCallback)(()=>{let e=[];for(let t of x.current.values())for(let n of t)e.push({content:n.content,filePath:n.filePath,lineNumber:n.lineNumber,lineType:n.lineType,suggestion:n.suggestion});E(e),b(!0)},[]),{handleCopyFeedback:ce}=P,ue=(0,B.useCallback)(()=>{ce(re)},[ce,re]),de=(0,B.useCallback)(()=>{f(e=>e===`split`?`unified`:`split`)},[]),I=(0,B.useCallback)(async n=>{if(n!==e.scope){h(n),i(null);try{await t({search:e=>({...e,scope:n}),to:`/`})}finally{h(null)}}},[e.scope,t]),L=e.scope===`unstaged`||e.scope===`uncommitted`,fe=(0,B.useCallback)(e=>{_.runFork(g(function*(){let{http:t}=yield*y;return yield*t.git.stage({payload:{files:[e]}})}).pipe(S(()=>u(()=>n.invalidate())),p(()=>c)))},[n]),pe=(0,B.useCallback)(async()=>{if(!j)return;let e=j.hunks.flatMap(e=>e.lines.map(e=>e.content)).join(`
|
|
2
2
|
`);await navigator.clipboard.writeText(e)},[j]),he=(0,B.useCallback)(()=>{k&&(l(new Set(k.viewedFiles)),k.selectedFile&&e.files.some(e=>e.newPath===k.selectedFile)&&i(k.selectedFile),A(null),Wi())},[k,e.files]),ge=(0,B.useCallback)(()=>{A(null),Wi()},[]),R=m??e.scope,ve=m!==null&&m!==e.scope,z=Li[e.scope];return(0,V.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,V.jsx)(le,{repoName:e.repository.name,branchName:e.repository.branch,scopeLabel:`${Ii[e.scope]} changes`,diffMode:d,onToggleDiffMode:de,onExport:se,onCopyDiff:pe,reviewedFileCount:a.size,totalFileCount:e.files.length,unresolvedCount:P.totalCount,isAnnotationsOpen:P.isOpen,onToggleAnnotations:P.handleToggle}),(0,V.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,V.jsx)(_e,{emptyStateMessage:z,files:e.files,headerAction:(0,V.jsx)(Bi,{fileCount:ve?void 0:e.files.length,isLoading:ve,onChange:I,value:R}),onSelectFile:ae,selectedFile:r,reviewedFiles:a,onToggleViewed:ie,onStageFile:L?fe:void 0},e.scope),(0,V.jsx)(`div`,{className:`flex-1 overflow-y-auto bg-surface-primary p-4`,children:(0,V.jsx)(Sa,{hasFiles:e.files.length>0,emptyMessage:z,file:j,diffMode:d,summary:e.summary,onLocalCommentsChange:oe,viewed:r?a.has(r):!1,onToggleViewed:ie,pendingDeleteId:ee,onPendingDeleteHandled:ne})}),(0,V.jsx)(ma,{isOpen:P.isOpen,onClose:P.handleClose,groups:re,totalCount:P.totalCount,copyStatus:P.copyStatus,onAnnotationClick:P.handleAnnotationClick,onDeleteAnnotation:P.handleDeleteAnnotation,onCopyFeedback:ue})]}),(0,V.jsx)(me,{open:v,onOpenChange:b,localComments:T}),k?(0,V.jsx)(Xi,{open:!0,draft:k,onRestore:he,onDismiss:ge}):null]})};export{Ca as component};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { n as HTTPError, o as toRequest } from "../_libs/h3+rou3+srvx.mjs";
|
|
2
|
-
//#region ../../node_modules/.pnpm/nitro@3.0.260311-beta_@voidzero-dev+vite-plus-core@0.1.14_@types+node@22.19.15_esbuild@
|
|
2
|
+
//#region ../../node_modules/.pnpm/nitro@3.0.260311-beta_@voidzero-dev+vite-plus-core@0.1.14_@types+node@22.19.15_esbuild@_a9397a43c57d16f5ffee252e9e392f5e/node_modules/nitro/dist/runtime/vite.mjs
|
|
3
3
|
function fetchViteEnv(viteEnvName, input, init) {
|
|
4
4
|
const viteEnv = (globalThis.__nitro_vite_envs__ || {})[viteEnvName];
|
|
5
5
|
if (!viteEnv) throw HTTPError.status(404);
|
|
6
6
|
return Promise.resolve(viteEnv.fetch(toRequest(input, init)));
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
|
-
//#region ../../node_modules/.pnpm/nitro@3.0.260311-beta_@voidzero-dev+vite-plus-core@0.1.14_@types+node@22.19.15_esbuild@
|
|
9
|
+
//#region ../../node_modules/.pnpm/nitro@3.0.260311-beta_@voidzero-dev+vite-plus-core@0.1.14_@types+node@22.19.15_esbuild@_a9397a43c57d16f5ffee252e9e392f5e/node_modules/nitro/dist/runtime/internal/vite/ssr-renderer.mjs
|
|
10
10
|
/** @param {{ req: Request }} HTTPEvent */
|
|
11
11
|
function ssrRenderer({ req }) {
|
|
12
12
|
return fetchViteEnv("ssr", req);
|