@kimuson/claude-code-viewer 0.4.5 → 0.4.7

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.
@@ -0,0 +1,6 @@
1
+ import{c as f,a as N,p as m,b as v,j as e,C as y,d as w,e as C,f as b,g as j,T as s,B as l,L as P,r as o,h as k,i as _,k as D,t as u,l as L}from"./index-CEfL1559.js";import{F as p,f as S,u as F,C as I,L as M,a as E,D as q,b as H,P as T,c as Q,d as $,e as A,g as R,h as B,i as G,G as K}from"./label-D9NP5l7d.js";/**
2
+ * @license lucide-react v0.548.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const O=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],V=f("history",O),W=()=>N({queryKey:m.queryKey,queryFn:m.queryFn}),z=()=>{const{data:{projects:n}}=W(),{config:c}=v();return n.length,e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:n.map(t=>e.jsxs(y,{className:"hover:shadow-md transition-shadow",children:[e.jsxs(w,{children:[e.jsxs(C,{className:"flex items-center gap-2",children:[e.jsx(p,{className:"w-5 h-5"}),e.jsx("span",{className:"truncate",children:t.meta.projectName??t.claudeProjectPath})]}),t.meta.projectPath?e.jsx(b,{children:t.meta.projectPath}):null]}),e.jsxs(j,{className:"space-y-2",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx(s,{id:"project_list.last_modified"})," ",t.lastModifiedAt?S(t.lastModifiedAt,{locale:c.locale,target:"time"}):""]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.jsx(s,{id:"project_list.messages"})," ",t.meta.sessionCount]})]}),e.jsx(j,{className:"pt-0",children:e.jsx(l,{asChild:!0,className:"w-full",children:e.jsx(P,{to:"/projects/$projectId/session",params:{projectId:t.id},children:e.jsx(s,{id:"project_list.view_conversations"})})})})]},t.id))})},J=({onPathChange:n})=>{const[c,t]=o.useState(void 0),[d,x]=o.useState(!1),{data:r,isLoading:i}=F(k(c,d));o.useEffect(()=>{r?.currentPath&&n(r.currentPath)},[r?.currentPath,n]);const h=a=>{if(a===""){t(void 0);return}const g=`/${a}`;t(g)};return e.jsxs("div",{className:"border rounded-md",children:[e.jsx("div",{className:"p-3 border-b bg-muted/50",children:e.jsxs("p",{className:"text-sm font-medium",children:[e.jsx(s,{id:"directory_picker.current"})," ",e.jsx("span",{className:"font-mono",children:r?.currentPath||"~"})]})}),e.jsxs("div",{className:"p-3 border-b flex items-center gap-2",children:[e.jsx(I,{id:"show-hidden",checked:d,onCheckedChange:a=>x(a===!0)}),e.jsx(M,{htmlFor:"show-hidden",className:"text-sm cursor-pointer",children:e.jsx(s,{id:"directory_picker.show_hidden"})})]}),e.jsx("div",{className:"max-h-96 overflow-auto",children:i?e.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground",children:e.jsx(s,{id:"directory_picker.loading"})}):r?.entries&&r.entries.length>0?e.jsx("div",{className:"divide-y",children:r.entries.filter(a=>a.type==="directory").filter(a=>d||a.name===".."||!a.name.startsWith(".")).map(a=>e.jsxs("button",{type:"button",onClick:()=>h(a.path),className:"w-full px-3 py-2 flex items-center gap-2 hover:bg-muted/50 transition-colors text-left",children:[a.name===".."?e.jsx(E,{className:"w-4 h-4 rotate-180"}):e.jsx(p,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm",children:a.name})]},a.path))}):e.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground",children:e.jsx(s,{id:"directory_picker.no_directories"})})})]})},U=()=>{const[n,c]=o.useState(!1),[t,d]=o.useState(""),x=_(),r=D({mutationFn:async()=>{const i=await L.api.projects.$post({json:{projectPath:t}});if(!i.ok)throw new Error("Failed to set up project");return await i.json()},onSuccess:i=>{u.success("Project set up successfully"),c(!1),x({to:"/projects/$projectId/session",params:{projectId:i.projectId},search:h=>({...h,sessionId:i.sessionId})})},onError:i=>{u.error(i instanceof Error?i.message:"Failed to set up project")}});return e.jsxs(q,{open:n,onOpenChange:c,children:[e.jsx(H,{asChild:!0,children:e.jsxs(l,{"data-testid":"new-project-button",children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),e.jsx(s,{id:"project.new"})]})}),e.jsxs(Q,{className:"max-w-2xl","data-testid":"new-project-modal",children:[e.jsxs($,{children:[e.jsx(A,{children:e.jsx(s,{id:"project.setup.title"})}),e.jsx(R,{children:e.jsx(s,{id:"project.setup.description",components:{0:e.jsx("code",{className:"text-sm bg-muted px-1 py-0.5 rounded"})}})})]}),e.jsx("div",{className:"py-4",children:e.jsx(J,{onPathChange:d})}),e.jsxs(B,{children:[e.jsx(l,{variant:"outline",onClick:()=>c(!1),children:e.jsx(s,{id:"common.action.cancel"})}),e.jsx(l,{onClick:async()=>await r.mutateAsync(),disabled:!t||r.isPending,children:r.isPending?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-2 animate-spin"}),e.jsx(s,{id:"project.setup.action.setting_up"})]}):e.jsx(s,{id:"project.setup.action.setup"})})]})]})]})},X=()=>e.jsxs("div",{className:"flex h-screen max-h-screen overflow-hidden",children:[e.jsx(K,{}),e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"container mx-auto px-4 py-8",children:[e.jsxs("header",{className:"mb-8",children:[e.jsxs("h1",{className:"text-3xl font-bold mb-2 flex items-center gap-2",children:[e.jsx(V,{className:"w-8 h-8"}),"Claude Code Viewer"]}),e.jsx("p",{className:"text-muted-foreground",children:e.jsx(s,{id:"projects.page.description"})})]}),e.jsx("main",{children:e.jsxs("section",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{className:"text-xl font-semibold",children:e.jsx(s,{id:"projects.page.title"})}),e.jsx(U,{})]}),e.jsx(o.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"text-muted-foreground",children:e.jsx(s,{id:"projects.page.loading"})})}),children:e.jsx(z,{})})]})})]})})]});function ee(){return e.jsx(X,{})}export{ee as component};
@@ -0,0 +1 @@
1
+ import{u as o}from"./index-CEfL1559.js";function r(){o().navigate({to:"/projects"})}export{r as component};
@@ -1,4 +1,4 @@
1
- import{c as oe,s as Ws,Q as Fs,r as l,j as i,gq as it,gI as jt,gp as F,gL as Tr,gM as $s,gN as Bs,gr as U,gt as ke,gO as sn,T as E,gP as Hs,B as Vs,a as an,gQ as zn,b as Ys,gC as zs,gw as qs,gB as Us,p as Xs,gk as Gs,gR as Ks,gS as Qs,gT as Js,gU as Zs}from"./index-D1IPE4nC.js";/**
1
+ import{c as oe,q as Ws,Q as Fs,r as l,j as i,gm as it,gI as jt,gl as F,gL as Tr,gM as $s,gN as Bs,gn as U,gs as ke,gO as sn,T as E,gP as Hs,B as Vs,a as an,gQ as zn,b as Ys,gC as zs,gv as qs,gB as Us,p as Xs,gj as Gs,gR as Ks,gS as Qs,gT as Js,gU as Zs}from"./index-CEfL1559.js";/**
2
2
  * @license lucide-react v0.548.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -98,8 +98,8 @@ import{c as oe,s as Ws,Q as Fs,r as l,j as i,gq as it,gI as jt,gp as F,gL as Tr,
98
98
  `)},mr=function(){var e=parseInt(document.body.getAttribute(Ue)||"0",10);return isFinite(e)?e:0},ul=function(){l.useEffect(function(){return document.body.setAttribute(Ue,(mr()+1).toString()),function(){var e=mr()-1;e<=0?document.body.removeAttribute(Ue):document.body.setAttribute(Ue,e.toString())}},[])},dl=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;ul();var s=l.useMemo(function(){return il(o)},[o]);return l.createElement(cl,{styles:ll(s,!t,o,n?"":"!important")})},hn=!1;if(typeof window<"u")try{var vt=Object.defineProperty({},"passive",{get:function(){return hn=!0,!0}});window.addEventListener("test",vt,vt),window.removeEventListener("test",vt,vt)}catch{hn=!1}var Ve=hn?{passive:!1}:!1,fl=function(e){return e.tagName==="TEXTAREA"},To=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!fl(e)&&n[t]==="visible")},ml=function(e){return To(e,"overflowY")},hl=function(e){return To(e,"overflowX")},hr=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Ro(e,r);if(o){var s=jo(e,r),a=s[1],c=s[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pl=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},gl=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ro=function(e,t){return e==="v"?ml(t):hl(t)},jo=function(e,t){return e==="v"?pl(t):gl(t)},vl=function(e,t){return e==="h"&&t==="rtl"?-1:1},xl=function(e,t,n,r,o){var s=vl(e,window.getComputedStyle(t).direction),a=s*r,c=n.target,u=t.contains(c),d=!1,f=a>0,m=0,g=0;do{if(!c)break;var p=jo(e,c),v=p[0],h=p[1],x=p[2],w=h-x-s*v;(v||w)&&Ro(e,c)&&(m+=w,g+=v);var y=c.parentNode;c=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(f&&Math.abs(m)<1||!f&&Math.abs(g)<1)&&(d=!0),d},xt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},pr=function(e){return[e.deltaX,e.deltaY]},gr=function(e){return e&&"current"in e?e.current:e},yl=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wl=function(e){return`
99
99
  .block-interactivity-`.concat(e,` {pointer-events: none;}
100
100
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
101
- `)},bl=0,Ye=[];function Cl(e){var t=l.useRef([]),n=l.useRef([0,0]),r=l.useRef(),o=l.useState(bl++)[0],s=l.useState(No)[0],a=l.useRef(e);l.useEffect(function(){a.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=Vc([e.lockRef.current],(e.shards||[]).map(gr),!0).filter(Boolean);return h.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=l.useCallback(function(h,x){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var w=xt(h),y=n.current,b="deltaX"in h?h.deltaX:y[0]-w[0],C="deltaY"in h?h.deltaY:y[1]-w[1],P,N=h.target,S=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in h&&S==="h"&&N.type==="range")return!1;var R=hr(S,N);if(!R)return!0;if(R?P=S:(P=S==="v"?"h":"v",R=hr(S,N)),!R)return!1;if(!r.current&&"changedTouches"in h&&(b||C)&&(r.current=P),!P)return!0;var I=r.current||P;return xl(I,x,h,I==="h"?b:C)},[]),u=l.useCallback(function(h){var x=h;if(!(!Ye.length||Ye[Ye.length-1]!==s)){var w="deltaY"in x?pr(x):xt(x),y=t.current.filter(function(P){return P.name===x.type&&(P.target===x.target||x.target===P.shadowParent)&&yl(P.delta,w)})[0];if(y&&y.should){x.cancelable&&x.preventDefault();return}if(!y){var b=(a.current.shards||[]).map(gr).filter(Boolean).filter(function(P){return P.contains(x.target)}),C=b.length>0?c(x,b[0]):!a.current.noIsolation;C&&x.cancelable&&x.preventDefault()}}},[]),d=l.useCallback(function(h,x,w,y){var b={name:h,delta:x,target:w,should:y,shadowParent:Sl(w)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(C){return C!==b})},1)},[]),f=l.useCallback(function(h){n.current=xt(h),r.current=void 0},[]),m=l.useCallback(function(h){d(h.type,pr(h),h.target,c(h,e.lockRef.current))},[]),g=l.useCallback(function(h){d(h.type,xt(h),h.target,c(h,e.lockRef.current))},[]);l.useEffect(function(){return Ye.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Ve),document.addEventListener("touchmove",u,Ve),document.addEventListener("touchstart",f,Ve),function(){Ye=Ye.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,Ve),document.removeEventListener("touchmove",u,Ve),document.removeEventListener("touchstart",f,Ve)}},[]);var p=e.removeScrollBar,v=e.inert;return l.createElement(l.Fragment,null,v?l.createElement(s,{styles:wl(o)}):null,p?l.createElement(dl,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Sl(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Pl=Jc(Eo,Cl);var An=l.forwardRef(function(e,t){return l.createElement(Ft,ue({},e,{ref:t,sideCar:Pl}))});An.classNames=Ft.classNames;var El=[" ","Enter","ArrowUp","ArrowDown"],Nl=[" ","Enter"],Ie="Select",[$t,Bt,Tl]=Oc(Ie),[Ze]=$e(Ie,[Tl,Dt]),Ht=Dt(),[Rl,Te]=Ze(Ie),[jl,Ol]=Ze(Ie),Oo=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:c,onValueChange:u,dir:d,name:f,autoComplete:m,disabled:g,required:p,form:v}=e,h=Ht(t),[x,w]=l.useState(null),[y,b]=l.useState(null),[C,P]=l.useState(!1),N=kc(d),[S,R]=Ge({prop:r,defaultProp:o??!1,onChange:s,caller:Ie}),[I,A]=Ge({prop:a,defaultProp:c,onChange:u,caller:Ie}),$=l.useRef(null),B=x?v||!!x.closest("form"):!0,[W,_]=l.useState(new Set),z=Array.from(W).map(O=>O.props.value).join(";");return i.jsx(Zr,{...h,children:i.jsxs(Rl,{required:p,scope:t,trigger:x,onTriggerChange:w,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:C,onValueNodeHasChildrenChange:P,contentId:be(),value:I,onValueChange:A,open:S,onOpenChange:R,dir:N,triggerPointerDownPosRef:$,disabled:g,children:[i.jsx($t.Provider,{scope:t,children:i.jsx(jl,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(O=>{_(D=>new Set(D).add(O))},[]),onNativeOptionRemove:l.useCallback(O=>{_(D=>{const j=new Set(D);return j.delete(O),j})},[]),children:n})}),B?i.jsxs(Jo,{"aria-hidden":!0,required:p,tabIndex:-1,name:f,autoComplete:m,value:I,onChange:O=>A(O.target.value),disabled:g,form:v,children:[I===void 0?i.jsx("option",{value:""}):null,Array.from(W)]},z):null]})})};Oo.displayName=Ie;var Mo="SelectTrigger",ko=l.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Ht(n),a=Te(Mo,n),c=a.disabled||r,u=F(t,a.onTriggerChange),d=Bt(n),f=l.useRef("touch"),[m,g,p]=es(h=>{const x=d().filter(b=>!b.disabled),w=x.find(b=>b.value===a.value),y=ts(x,h,w);y!==void 0&&a.onValueChange(y.value)}),v=h=>{c||(a.onOpenChange(!0),p()),h&&(a.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return i.jsx(eo,{asChild:!0,...s,children:i.jsx(k.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Zo(a.value)?"":void 0,...o,ref:u,onClick:M(o.onClick,h=>{h.currentTarget.focus(),f.current!=="mouse"&&v(h)}),onPointerDown:M(o.onPointerDown,h=>{f.current=h.pointerType;const x=h.target;x.hasPointerCapture(h.pointerId)&&x.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(v(h),h.preventDefault())}),onKeyDown:M(o.onKeyDown,h=>{const x=m.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&g(h.key),!(x&&h.key===" ")&&El.includes(h.key)&&(v(),h.preventDefault())})})})});ko.displayName=Mo;var _o="SelectValue",Ao=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:a="",...c}=e,u=Te(_o,n),{onValueNodeHasChildrenChange:d}=u,f=s!==void 0,m=F(t,u.onValueNodeChange);return G(()=>{d(f)},[d,f]),i.jsx(k.span,{...c,ref:m,style:{pointerEvents:"none"},children:Zo(u.value)?i.jsx(i.Fragment,{children:a}):s})});Ao.displayName=_o;var Ml="SelectIcon",Do=l.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return i.jsx(k.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Do.displayName=Ml;var kl="SelectPortal",Io=e=>i.jsx(It,{asChild:!0,...e});Io.displayName=kl;var Le="SelectContent",Lo=l.forwardRef((e,t)=>{const n=Te(Le,e.__scopeSelect),[r,o]=l.useState();if(G(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?jt.createPortal(i.jsx(Wo,{scope:e.__scopeSelect,children:i.jsx($t.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),s):null}return i.jsx(Fo,{...e,ref:t})});Lo.displayName=Le;var se=10,[Wo,Re]=Ze(Le),_l="SelectContentImpl",Al=it("SelectContent.RemoveScroll"),Fo=l.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:h,avoidCollisions:x,...w}=e,y=Te(Le,n),[b,C]=l.useState(null),[P,N]=l.useState(null),S=F(t,T=>C(T)),[R,I]=l.useState(null),[A,$]=l.useState(null),B=Bt(n),[W,_]=l.useState(!1),z=l.useRef(!1);l.useEffect(()=>{if(b)return Co(b)},[b]),xo();const O=l.useCallback(T=>{const[q,...K]=B().map(X=>X.ref.current),[V]=K.slice(-1),Y=document.activeElement;for(const X of T)if(X===Y||(X?.scrollIntoView({block:"nearest"}),X===q&&P&&(P.scrollTop=0),X===V&&P&&(P.scrollTop=P.scrollHeight),X?.focus(),document.activeElement!==Y))return},[B,P]),D=l.useCallback(()=>O([R,b]),[O,R,b]);l.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:j,triggerPointerDownPosRef:H}=y;l.useEffect(()=>{if(b){let T={x:0,y:0};const q=V=>{T={x:Math.abs(Math.round(V.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(V.pageY)-(H.current?.y??0))}},K=V=>{T.x<=10&&T.y<=10?V.preventDefault():b.contains(V.target)||j(!1),document.removeEventListener("pointermove",q),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",K,{capture:!0})}}},[b,j,H]),l.useEffect(()=>{const T=()=>j(!1);return window.addEventListener("blur",T),window.addEventListener("resize",T),()=>{window.removeEventListener("blur",T),window.removeEventListener("resize",T)}},[j]);const[Z,je]=es(T=>{const q=B().filter(Y=>!Y.disabled),K=q.find(Y=>Y.ref.current===document.activeElement),V=ts(q,T,K);V&&setTimeout(()=>V.ref.current.focus())}),et=l.useCallback((T,q,K)=>{const V=!z.current&&!K;(y.value!==void 0&&y.value===q||V)&&(I(T),V&&(z.current=!0))},[y.value]),tt=l.useCallback(()=>b?.focus(),[b]),xe=l.useCallback((T,q,K)=>{const V=!z.current&&!K;(y.value!==void 0&&y.value===q||V)&&$(T)},[y.value]),Be=r==="popper"?pn:$o,Oe=Be===pn?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:h,avoidCollisions:x}:{};return i.jsx(Wo,{scope:n,content:b,viewport:P,onViewportChange:N,itemRefCallback:et,selectedItem:R,onItemLeave:tt,itemTextRefCallback:xe,focusSelectedItem:D,selectedItemText:A,position:r,isPositioned:W,searchRef:Z,children:i.jsx(An,{as:Al,allowPinchZoom:!0,children:i.jsx(_n,{asChild:!0,trapped:y.open,onMountAutoFocus:T=>{T.preventDefault()},onUnmountAutoFocus:M(o,T=>{y.trigger?.focus({preventScroll:!0}),T.preventDefault()}),children:i.jsx(Ot,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:T=>T.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:i.jsx(Be,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:T=>T.preventDefault(),...w,...Oe,onPlaced:()=>_(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:M(w.onKeyDown,T=>{const q=T.ctrlKey||T.altKey||T.metaKey;if(T.key==="Tab"&&T.preventDefault(),!q&&T.key.length===1&&je(T.key),["ArrowUp","ArrowDown","Home","End"].includes(T.key)){let V=B().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);if(["ArrowUp","End"].includes(T.key)&&(V=V.slice().reverse()),["ArrowUp","ArrowDown"].includes(T.key)){const Y=T.target,X=V.indexOf(Y);V=V.slice(X+1)}setTimeout(()=>O(V)),T.preventDefault()}})})})})})})});Fo.displayName=_l;var Dl="SelectItemAlignedPosition",$o=l.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Te(Le,n),a=Re(Le,n),[c,u]=l.useState(null),[d,f]=l.useState(null),m=F(t,S=>f(S)),g=Bt(n),p=l.useRef(!1),v=l.useRef(!0),{viewport:h,selectedItem:x,selectedItemText:w,focusSelectedItem:y}=a,b=l.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&d&&h&&x&&w){const S=s.trigger.getBoundingClientRect(),R=d.getBoundingClientRect(),I=s.valueNode.getBoundingClientRect(),A=w.getBoundingClientRect();if(s.dir!=="rtl"){const Y=A.left-R.left,X=I.left-Y,re=S.left-X,Me=S.width+re,Ut=Math.max(Me,R.width),Xt=window.innerWidth-se,Gt=ar(X,[se,Math.max(se,Xt-Ut)]);c.style.minWidth=Me+"px",c.style.left=Gt+"px"}else{const Y=R.right-A.right,X=window.innerWidth-I.right-Y,re=window.innerWidth-S.right-X,Me=S.width+re,Ut=Math.max(Me,R.width),Xt=window.innerWidth-se,Gt=ar(X,[se,Math.max(se,Xt-Ut)]);c.style.minWidth=Me+"px",c.style.right=Gt+"px"}const $=g(),B=window.innerHeight-se*2,W=h.scrollHeight,_=window.getComputedStyle(d),z=parseInt(_.borderTopWidth,10),O=parseInt(_.paddingTop,10),D=parseInt(_.borderBottomWidth,10),j=parseInt(_.paddingBottom,10),H=z+O+W+j+D,Z=Math.min(x.offsetHeight*5,H),je=window.getComputedStyle(h),et=parseInt(je.paddingTop,10),tt=parseInt(je.paddingBottom,10),xe=S.top+S.height/2-se,Be=B-xe,Oe=x.offsetHeight/2,T=x.offsetTop+Oe,q=z+O+T,K=H-q;if(q<=xe){const Y=$.length>0&&x===$[$.length-1].ref.current;c.style.bottom="0px";const X=d.clientHeight-h.offsetTop-h.offsetHeight,re=Math.max(Be,Oe+(Y?tt:0)+X+D),Me=q+re;c.style.height=Me+"px"}else{const Y=$.length>0&&x===$[0].ref.current;c.style.top="0px";const re=Math.max(xe,z+h.offsetTop+(Y?et:0)+Oe)+K;c.style.height=re+"px",h.scrollTop=q-xe+h.offsetTop}c.style.margin=`${se}px 0`,c.style.minHeight=Z+"px",c.style.maxHeight=B+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[g,s.trigger,s.valueNode,c,d,h,x,w,s.dir,r]);G(()=>b(),[b]);const[C,P]=l.useState();G(()=>{d&&P(window.getComputedStyle(d).zIndex)},[d]);const N=l.useCallback(S=>{S&&v.current===!0&&(b(),y?.(),v.current=!1)},[b,y]);return i.jsx(Ll,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:p,onScrollButtonChange:N,children:i.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:i.jsx(k.div,{...o,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});$o.displayName=Dl;var Il="SelectPopperPosition",pn=l.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=se,...s}=e,a=Ht(n);return i.jsx(to,{...a,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});pn.displayName=Il;var[Ll,Dn]=Ze(Le,{}),gn="SelectViewport",Bo=l.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Re(gn,n),a=Dn(gn,n),c=F(t,s.onViewportChange),u=l.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx($t.Slot,{scope:n,children:i.jsx(k.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:M(o.onScroll,d=>{const f=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:g}=a;if(g?.current&&m){const p=Math.abs(u.current-f.scrollTop);if(p>0){const v=window.innerHeight-se*2,h=parseFloat(m.style.minHeight),x=parseFloat(m.style.height),w=Math.max(h,x);if(w<v){const y=w+p,b=Math.min(v,y),C=y-b;m.style.height=b+"px",m.style.bottom==="0px"&&(f.scrollTop=C>0?C:0,m.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})});Bo.displayName=gn;var Ho="SelectGroup",[Wl,Fl]=Ze(Ho),$l=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=be();return i.jsx(Wl,{scope:n,id:o,children:i.jsx(k.div,{role:"group","aria-labelledby":o,...r,ref:t})})});$l.displayName=Ho;var Vo="SelectLabel",Bl=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Fl(Vo,n);return i.jsx(k.div,{id:o.id,...r,ref:t})});Bl.displayName=Vo;var Nt="SelectItem",[Hl,Yo]=Ze(Nt),zo=l.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...a}=e,c=Te(Nt,n),u=Re(Nt,n),d=c.value===r,[f,m]=l.useState(s??""),[g,p]=l.useState(!1),v=F(t,y=>u.itemRefCallback?.(y,r,o)),h=be(),x=l.useRef("touch"),w=()=>{o||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(Hl,{scope:n,value:r,disabled:o,textId:h,isSelected:d,onItemTextChange:l.useCallback(y=>{m(b=>b||(y?.textContent??"").trim())},[]),children:i.jsx($t.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:i.jsx(k.div,{role:"option","aria-labelledby":h,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:v,onFocus:M(a.onFocus,()=>p(!0)),onBlur:M(a.onBlur,()=>p(!1)),onClick:M(a.onClick,()=>{x.current!=="mouse"&&w()}),onPointerUp:M(a.onPointerUp,()=>{x.current==="mouse"&&w()}),onPointerDown:M(a.onPointerDown,y=>{x.current=y.pointerType}),onPointerMove:M(a.onPointerMove,y=>{x.current=y.pointerType,o?u.onItemLeave?.():x.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:M(a.onPointerLeave,y=>{y.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:M(a.onKeyDown,y=>{u.searchRef?.current!==""&&y.key===" "||(Nl.includes(y.key)&&w(),y.key===" "&&y.preventDefault())})})})})});zo.displayName=Nt;var nt="SelectItemText",qo=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,a=Te(nt,n),c=Re(nt,n),u=Yo(nt,n),d=Ol(nt,n),[f,m]=l.useState(null),g=F(t,w=>m(w),u.onItemTextChange,w=>c.itemTextRefCallback?.(w,u.value,u.disabled)),p=f?.textContent,v=l.useMemo(()=>i.jsx("option",{value:u.value,disabled:u.disabled,children:p},u.value),[u.disabled,u.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:x}=d;return G(()=>(h(v),()=>x(v)),[h,x,v]),i.jsxs(i.Fragment,{children:[i.jsx(k.span,{id:u.textId,...s,ref:g}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?jt.createPortal(s.children,a.valueNode):null]})});qo.displayName=nt;var Uo="SelectItemIndicator",Xo=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Yo(Uo,n).isSelected?i.jsx(k.span,{"aria-hidden":!0,...r,ref:t}):null});Xo.displayName=Uo;var vn="SelectScrollUpButton",Go=l.forwardRef((e,t)=>{const n=Re(vn,e.__scopeSelect),r=Dn(vn,e.__scopeSelect),[o,s]=l.useState(!1),a=F(t,r.onScrollButtonChange);return G(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=u.scrollTop>0;s(d)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?i.jsx(Qo,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop-u.offsetHeight)}}):null});Go.displayName=vn;var xn="SelectScrollDownButton",Ko=l.forwardRef((e,t)=>{const n=Re(xn,e.__scopeSelect),r=Dn(xn,e.__scopeSelect),[o,s]=l.useState(!1),a=F(t,r.onScrollButtonChange);return G(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)<d;s(f)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?i.jsx(Qo,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop+u.offsetHeight)}}):null});Ko.displayName=xn;var Qo=l.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Re("SelectScrollButton",n),a=l.useRef(null),c=Bt(n),u=l.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return l.useEffect(()=>()=>u(),[u]),G(()=>{c().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),i.jsx(k.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:M(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:M(o.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:M(o.onPointerLeave,()=>{u()})})}),Vl="SelectSeparator",Yl=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(k.div,{"aria-hidden":!0,...r,ref:t})});Yl.displayName=Vl;var yn="SelectArrow",zl=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ht(n),s=Te(yn,n),a=Re(yn,n);return s.open&&a.position==="popper"?i.jsx(no,{...o,...r,ref:t}):null});zl.displayName=yn;var ql="SelectBubbleInput",Jo=l.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=l.useRef(null),s=F(r,o),a=wo(t);return l.useEffect(()=>{const c=o.current;if(!c)return;const u=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==t&&f){const m=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(m)}},[a,t]),i.jsx(k.select,{...n,style:{...ro,...n.style},ref:s,defaultValue:t})});Jo.displayName=ql;function Zo(e){return e===""||e===void 0}function es(e){const t=Ae(e),n=l.useRef(""),r=l.useRef(0),o=l.useCallback(a=>{const c=n.current+a;t(c),(function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(c)},[t]),s=l.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function ts(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Ul(e,Math.max(s,0));o.length===1&&(a=a.filter(d=>d!==n));const u=a.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function Ul(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Xl=Oo,Gl=ko,Kl=Ao,Ql=Do,Jl=Io,Zl=Lo,eu=Bo,tu=zo,nu=qo,ru=Xo,ou=Go,su=Ko;function rt({...e}){return i.jsx(Xl,{...e})}function ot({...e}){return i.jsx(Kl,{...e})}function st({className:e,children:t,...n}){return i.jsxs(Gl,{className:U("flex h-10 w-full items-center justify-between rounded-md border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,i.jsx(Ql,{asChild:!0,children:i.jsx(bn,{className:"h-4 w-4 opacity-50"})})]})}function au({className:e,...t}){return i.jsx(ou,{className:U("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(sa,{className:"h-4 w-4"})})}function iu({className:e,...t}){return i.jsx(su,{className:U("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(bn,{className:"h-4 w-4"})})}function at({className:e,children:t,position:n="popper",...r}){return i.jsx(Jl,{children:i.jsxs(Zl,{className:U("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[i.jsx(au,{}),i.jsx(eu,{className:U("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(iu,{})]})})}function ee({className:e,children:t,...n}){return i.jsxs(tu,{className:U("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(ru,{children:i.jsx(Rr,{className:"h-4 w-4"})})}),i.jsx(nu,{children:t})]})}const In={},cu=Symbol((In?"production":void 0)!=="production"?"RESET":""),ns=e=>typeof e?.then=="function";function lu(e=()=>{try{return window.localStorage}catch(n){(In?"production":void 0)!=="production"&&typeof window<"u"&&console.warn(n);return}},t){var n;let r,o;const s={getItem:(u,d)=>{var f,m;const g=v=>{if(v=v||"",r!==v){try{o=JSON.parse(v,t?.reviver)}catch{return d}r=v}return o},p=(m=(f=e())==null?void 0:f.getItem(u))!=null?m:null;return ns(p)?p.then(g):g(p)},setItem:(u,d)=>{var f;return(f=e())==null?void 0:f.setItem(u,JSON.stringify(d,void 0))},removeItem:u=>{var d;return(d=e())==null?void 0:d.removeItem(u)}},a=u=>(d,f,m)=>u(d,g=>{let p;try{p=JSON.parse(g||"")}catch{p=m}f(p)});let c;try{c=(n=e())==null?void 0:n.subscribe}catch{}return!c&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(c=(u,d)=>{if(!(e()instanceof window.Storage))return()=>{};const f=m=>{m.storageArea===e()&&m.key===u&&d(m.newValue)};return window.addEventListener("storage",f),()=>{window.removeEventListener("storage",f)}}),c&&(s.subscribe=a(c)),s}const uu=lu();function du(e,t,n=uu,r){const o=sn(t);return(In?"production":void 0)!=="production"&&(o.debugPrivate=!0),o.onMount=a=>{a(n.getItem(e,t));let c;return n.subscribe&&(c=n.subscribe(e,a,t)),c},sn(a=>a(o),(a,c,u)=>{const d=typeof u=="function"?u(a(o)):u;return d===cu?(c(o,t),n.removeItem(e)):ns(d)?d.then(f=>(c(o,f),n.setItem(e,f))):(c(o,d),n.setItem(e,d))})}const fu={soundType:"none"},rs=du("claude-code-viewer-notification-settings",fu),xm=sn(e=>e(rs).soundType!=="none"),mu={beep:{frequency:[800],duration:.15,type:"sine",volume:.3},chime:{frequency:[523,659,784],duration:.4,type:"sine",volume:.2},ping:{frequency:[1e3],duration:.1,type:"triangle",volume:.4},pop:{frequency:[400,600],duration:.08,type:"square",volume:.2}};function hu(e){if(e!=="none")try{const t=mu[e];if(!t){console.warn(`Unknown sound type: ${e}`);return}const n=new(window.AudioContext||window.webkitAudioContext);t.frequency.forEach((r,o)=>{const s=n.createOscillator(),a=n.createGain();s.connect(a),a.connect(n.destination),s.frequency.setValueAtTime(r,n.currentTime),s.type=t.type;const c=n.currentTime+o*.05;a.gain.setValueAtTime(t.volume,c),a.gain.exponentialRampToValueAtTime(.01,c+t.duration),s.start(c),s.stop(c+t.duration)})}catch(t){console.warn("Failed to play notification sound:",t)}}function pu(e){return{none:i.jsx(E,{id:"notification.none"}),beep:i.jsx(E,{id:"notification.beep"}),chime:i.jsx(E,{id:"notification.chime"}),ping:i.jsx(E,{id:"notification.ping"}),pop:i.jsx(E,{id:"notification.pop"})}[e]}function gu(){return["none","beep","chime","ping","pop"]}const vu=({showLabels:e=!0,showDescriptions:t=!0,className:n=""})=>{const r=l.useId(),[o,s]=Hs(rs),a=l.useCallback(d=>{s(f=>({...f,soundType:d}))},[s]),c=l.useCallback(()=>{o.soundType!=="none"&&hu(o.soundType)},[o.soundType]),u=gu();return i.jsx("div",{className:`space-y-4 ${n}`,children:i.jsxs("div",{className:"space-y-2",children:[e&&i.jsx("label",{htmlFor:r,className:"text-sm font-medium leading-none",children:"Task completion sound"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(rt,{value:o.soundType,onValueChange:a,children:[i.jsx(st,{id:r,className:"w-[180px]",children:i.jsx(ot,{placeholder:"音を選択"})}),i.jsx(at,{children:u.map(d=>i.jsx(ee,{value:d,children:pu(d)},d))})]}),o.soundType!=="none"&&i.jsx(Vs,{variant:"outline",size:"sm",onClick:c,className:"px-3",children:i.jsx(E,{id:"notification.test"})})]}),t&&i.jsx("p",{className:"text-xs text-muted-foreground",children:i.jsx(E,{id:"notification.description"})})]})})};var Vt="Checkbox",[xu]=$e(Vt),[yu,Ln]=xu(Vt);function wu(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:a,name:c,onCheckedChange:u,required:d,value:f="on",internal_do_not_use_render:m}=e,[g,p]=Ge({prop:n,defaultProp:o??!1,onChange:u,caller:Vt}),[v,h]=l.useState(null),[x,w]=l.useState(null),y=l.useRef(!1),b=v?!!a||!!v.closest("form"):!0,C={checked:g,disabled:s,setChecked:p,control:v,setControl:h,name:c,form:a,value:f,hasConsumerStoppedPropagationRef:y,required:d,defaultChecked:Ce(o)?!1:o,isFormControl:b,bubbleInput:x,setBubbleInput:w};return i.jsx(yu,{scope:t,...C,children:bu(m)?m(C):r})}var os="CheckboxTrigger",ss=l.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:a,disabled:c,checked:u,required:d,setControl:f,setChecked:m,hasConsumerStoppedPropagationRef:g,isFormControl:p,bubbleInput:v}=Ln(os,e),h=F(o,f),x=l.useRef(u);return l.useEffect(()=>{const w=s?.form;if(w){const y=()=>m(x.current);return w.addEventListener("reset",y),()=>w.removeEventListener("reset",y)}},[s,m]),i.jsx(k.button,{type:"button",role:"checkbox","aria-checked":Ce(u)?"mixed":u,"aria-required":d,"data-state":ds(u),"data-disabled":c?"":void 0,disabled:c,value:a,...r,ref:h,onKeyDown:M(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:M(n,w=>{m(y=>Ce(y)?!0:!y),v&&p&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})})});ss.displayName=os;var as=l.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:a,disabled:c,value:u,onCheckedChange:d,form:f,...m}=e;return i.jsx(wu,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:c,required:a,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:g})=>i.jsxs(i.Fragment,{children:[i.jsx(ss,{...m,ref:t,__scopeCheckbox:n}),g&&i.jsx(us,{__scopeCheckbox:n})]})})});as.displayName=Vt;var is="CheckboxIndicator",cs=l.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=Ln(is,n);return i.jsx(Ne,{present:r||Ce(s.checked)||s.checked===!0,children:i.jsx(k.span,{"data-state":ds(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});cs.displayName=is;var ls="CheckboxBubbleInput",us=l.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:a,required:c,disabled:u,name:d,value:f,form:m,bubbleInput:g,setBubbleInput:p}=Ln(ls,e),v=F(n,p),h=wo(s),x=Vr(r);l.useEffect(()=>{const y=g;if(!y)return;const b=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(b,"checked").set,N=!o.current;if(h!==s&&P){const S=new Event("click",{bubbles:N});y.indeterminate=Ce(s),P.call(y,Ce(s)?!1:s),y.dispatchEvent(S)}},[g,h,s,o]);const w=l.useRef(Ce(s)?!1:s);return i.jsx(k.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??w.current,required:c,disabled:u,name:d,value:f,form:m,...t,tabIndex:-1,ref:v,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});us.displayName=ls;function bu(e){return typeof e=="function"}function Ce(e){return e==="indeterminate"}function ds(e){return Ce(e)?"indeterminate":e?"checked":"unchecked"}function vr({className:e,...t}){return i.jsx(as,{"data-slot":"checkbox",className:U("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsx(cs,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:i.jsx(Rr,{className:"size-3.5"})})})}const fs=()=>{const{data:e}=an({queryKey:zn.queryKey,queryFn:zn.queryFn}),t=l.useMemo(()=>new Set(e.flags.filter(r=>r.enabled).map(r=>r.name)),[e.flags]),n=l.useCallback(r=>t.has(r),[t]);return{flags:e.flags,isFlagEnabled:n}},Cu="en",Su=e=>{},Pu=({openingProjectId:e,showLabels:t=!0,showDescriptions:n=!0,className:r=""})=>{const o=l.useId(),s=l.useId(),a=l.useId(),c=l.useId(),u=l.useId(),{config:d,updateConfig:f}=Ys(),m=zs(),{theme:g}=qs(),{i18n:p}=Us(),{isFlagEnabled:v}=fs(),h=v("tool-approval"),x=l.useMemo(()=>Su()??Cu,[]),w=async()=>{const S={...d,hideNoUserMessageSession:!d?.hideNoUserMessageSession};f(S,{onSuccess:async()=>{await m.refetchQueries({queryKey:Xs.queryKey})}})},y=async()=>{const S={...d,unifySameTitleSession:!d?.unifySameTitleSession};f(S,{onSuccess:async()=>{await m.refetchQueries({queryKey:Gs(e).queryKey})}})},b=async S=>{const R={...d,enterKeyBehavior:S};f(R)},C=async S=>{const R={...d,permissionMode:S};f(R)},P=async S=>{const R={...d,locale:S};f(R)},N=async S=>{const R={...d,theme:S};f(R)};return i.jsxs("div",{className:`space-y-4 ${r}`,children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(vr,{id:o,checked:d?.hideNoUserMessageSession,onCheckedChange:w}),t&&i.jsx("label",{htmlFor:o,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:i.jsx(E,{id:"settings.session.hide_no_user_message"})})]}),n&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:i.jsx(E,{id:"settings.session.hide_no_user_message.description"})}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(vr,{id:`${o}-unify`,checked:d?.unifySameTitleSession,onCheckedChange:y}),t&&i.jsx("label",{htmlFor:`${o}-unify`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:i.jsx(E,{id:"settings.session.unify_same_title"})})]}),n&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:i.jsx(E,{id:"settings.session.unify_same_title.description"})}),i.jsxs("div",{className:"space-y-2",children:[t&&i.jsx("label",{htmlFor:s,className:"text-sm font-medium leading-none",children:i.jsx(E,{id:"settings.input.enter_key_behavior"})}),i.jsxs(rt,{value:d?.enterKeyBehavior||"shift-enter-send",onValueChange:b,children:[i.jsx(st,{id:s,className:"w-full",children:i.jsx(ot,{placeholder:p._("Select enter key behavior")})}),i.jsxs(at,{children:[i.jsx(ee,{value:"shift-enter-send",children:i.jsx(E,{id:"settings.input.enter_key_behavior.shift_enter"})}),i.jsx(ee,{value:"enter-send",children:i.jsx(E,{id:"settings.input.enter_key_behavior.enter"})}),i.jsx(ee,{value:"command-enter-send",children:i.jsx(E,{id:"settings.input.enter_key_behavior.command_enter"})})]})]}),n&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:i.jsx(E,{id:"settings.input.enter_key_behavior.description"})})]}),i.jsxs("div",{className:"space-y-2",children:[t&&i.jsx("label",{htmlFor:a,className:"text-sm font-medium leading-none",children:i.jsx(E,{id:"settings.permission.mode"})}),i.jsxs(rt,{value:d?.permissionMode||"default",onValueChange:C,disabled:!h,children:[i.jsx(st,{id:a,className:"w-full",children:i.jsx(ot,{placeholder:p._("Select permission mode")})}),i.jsxs(at,{children:[i.jsx(ee,{value:"default",children:i.jsx(E,{id:"settings.permission.mode.default"})}),i.jsx(ee,{value:"acceptEdits",children:i.jsx(E,{id:"settings.permission.mode.accept_edits"})}),i.jsx(ee,{value:"bypassPermissions",children:i.jsx(E,{id:"settings.permission.mode.bypass_permissions"})}),i.jsx(ee,{value:"plan",children:i.jsx(E,{id:"settings.permission.mode.plan"})})]})]}),n&&h&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:i.jsx(E,{id:"settings.permission.mode.description"})}),n&&!h&&i.jsx("p",{className:"text-xs text-destructive mt-1",children:i.jsx(E,{id:"settings.permission.mode.unavailable"})})]}),i.jsxs("div",{className:"space-y-2",children:[t&&i.jsx("label",{htmlFor:c,className:"text-sm font-medium leading-none",children:i.jsx(E,{id:"settings.locale"})}),i.jsxs(rt,{value:d?.locale||x,onValueChange:P,children:[i.jsx(st,{id:c,className:"w-full",children:i.jsx(ot,{placeholder:p._("Select language")})}),i.jsxs(at,{children:[i.jsx(ee,{value:"ja",children:i.jsx(E,{id:"settings.locale.ja"})}),i.jsx(ee,{value:"en",children:i.jsx(E,{id:"settings.locale.en"})}),i.jsx(ee,{value:"zh_CN",children:i.jsx(E,{id:"settings.locale.zh_CN"})})]})]}),n&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:i.jsx(E,{id:"settings.locale.description"})})]}),i.jsxs("div",{className:"space-y-2",children:[t&&i.jsx("label",{htmlFor:u,className:"text-sm font-medium leading-none",children:i.jsx(E,{id:"settings.theme"})}),i.jsxs(rt,{value:g??"system",onValueChange:N,children:[i.jsx(st,{id:u,className:"w-full",children:i.jsx(ot,{placeholder:p._("Select theme")})}),i.jsxs(at,{children:[i.jsx(ee,{value:"light",children:i.jsx(E,{id:"settings.theme.light"})}),i.jsx(ee,{value:"dark",children:i.jsx(E,{id:"settings.theme.dark"})}),i.jsx(ee,{value:"system",children:i.jsx(E,{id:"settings.theme.system"})})]})]}),n&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:i.jsx(E,{id:"settings.theme.description"})})]})]})},Eu=Qs("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function xr({className:e,variant:t,asChild:n=!1,...r}){const o=n?Ks:"span";return i.jsx(o,{"data-slot":"badge",className:U(Eu({variant:t}),e),...r})}var Yt="Collapsible",[Nu]=$e(Yt),[Tu,Wn]=Nu(Yt),ms=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:a,...c}=e,[u,d]=Ge({prop:r,defaultProp:o??!1,onChange:a,caller:Yt});return i.jsx(Tu,{scope:n,disabled:s,contentId:be(),open:u,onOpenToggle:l.useCallback(()=>d(f=>!f),[d]),children:i.jsx(k.div,{"data-state":$n(u),"data-disabled":s?"":void 0,...c,ref:t})})});ms.displayName=Yt;var hs="CollapsibleTrigger",ps=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=Wn(hs,n);return i.jsx(k.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":$n(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:M(e.onClick,o.onOpenToggle)})});ps.displayName=hs;var Fn="CollapsibleContent",gs=l.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Wn(Fn,e.__scopeCollapsible);return i.jsx(Ne,{present:n||o.open,children:({present:s})=>i.jsx(Ru,{...r,ref:t,present:s})})});gs.displayName=Fn;var Ru=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,a=Wn(Fn,n),[c,u]=l.useState(r),d=l.useRef(null),f=F(t,d),m=l.useRef(0),g=m.current,p=l.useRef(0),v=p.current,h=a.open||c,x=l.useRef(h),w=l.useRef(void 0);return l.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),G(()=>{const y=d.current;if(y){w.current=w.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const b=y.getBoundingClientRect();m.current=b.height,p.current=b.width,x.current||(y.style.transitionDuration=w.current.transitionDuration,y.style.animationName=w.current.animationName),u(r)}},[a.open,r]),i.jsx(k.div,{"data-state":$n(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!h,...s,ref:f,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:h&&o})});function $n(e){return e?"open":"closed"}var ju=ms;function Ou({...e}){return i.jsx(ju,{"data-slot":"collapsible",...e})}function Mu({...e}){return i.jsx(ps,{"data-slot":"collapsible-trigger",...e})}function ku({...e}){return i.jsx(gs,{"data-slot":"collapsible-content",...e})}const _u=e=>{switch(e){case"tool-approval":return{title:i.jsx(E,{id:"system_info.feature.tool_approval.title"}),description:i.jsx(E,{id:"system_info.feature.tool_approval.description"})};case"agent-sdk":return{title:i.jsx(E,{id:"system_info.feature.agent_sdk.title"}),description:i.jsx(E,{id:"system_info.feature.agent_sdk.description"})};default:return{title:e,description:i.jsx(E,{id:"system_info.feature.unknown.description"})}}},Au=()=>{const[e,t]=l.useState(!1),{data:n}=an({...Js}),{data:r}=an({...Zs}),{flags:o}=fs();return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsxs("div",{className:"border-b border-sidebar-border p-4",children:[i.jsx("h2",{className:"font-semibold text-lg",children:i.jsx(E,{id:"system_info.title"})}),i.jsx("p",{className:"text-xs text-sidebar-foreground/70",children:i.jsx(E,{id:"system_info.description"})})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-6",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsx("h3",{className:"font-medium text-sm text-sidebar-foreground",children:i.jsx(E,{id:"system_info.viewer_version"})}),i.jsxs("div",{className:"flex justify-between items-center pl-2",children:[i.jsx("span",{className:"text-xs text-sidebar-foreground/70",children:i.jsx(E,{id:"system_info.version_label"})}),i.jsxs(xr,{variant:"secondary",className:"text-xs font-mono",children:["v",n?.version||"Unknown"]})]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("h3",{className:"font-medium text-sm text-sidebar-foreground",children:i.jsx(E,{id:"system_info.claude_code"})}),i.jsxs("div",{className:"space-y-2 pl-2",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"text-xs text-sidebar-foreground/70",children:i.jsx(E,{id:"system_info.executable_path"})}),i.jsx("div",{className:"text-xs text-sidebar-foreground font-mono break-all",children:r?.executablePath||i.jsx("span",{className:"text-sidebar-foreground/50",children:i.jsx(E,{id:"system_info.unknown"})})})]}),i.jsxs("div",{className:"flex justify-between items-center pt-1",children:[i.jsx("span",{className:"text-xs text-sidebar-foreground/70",children:i.jsx(E,{id:"system_info.version_label"})}),i.jsx(xr,{variant:"secondary",className:"text-xs font-mono",children:r?.version||i.jsx(E,{id:"system_info.unknown"})})]})]})]}),i.jsx("div",{className:"space-y-3",children:i.jsxs(Ou,{open:e,onOpenChange:t,children:[i.jsxs(Mu,{className:"flex w-full items-center justify-between group",children:[i.jsx("h3",{className:"font-medium text-sm text-sidebar-foreground",children:i.jsx(E,{id:"system_info.available_features"})}),e?i.jsx(bn,{className:"h-4 w-4 text-sidebar-foreground/70 group-hover:text-sidebar-foreground transition-colors"}):i.jsx(ra,{className:"h-4 w-4 text-sidebar-foreground/70 group-hover:text-sidebar-foreground transition-colors"})]}),i.jsx(ku,{className:"pt-3",children:i.jsx(kn,{children:i.jsx("ul",{className:"space-y-2 pl-2",children:o.map(({name:s,enabled:a})=>{const c=_u(s);return i.jsxs("li",{className:"flex items-start gap-2",children:[a?i.jsx(ia,{className:"h-3.5 w-3.5 text-green-500 dark:text-green-400 mt-0.5 flex-shrink-0"}):i.jsx(la,{className:"h-3.5 w-3.5 text-sidebar-foreground/30 mt-0.5 flex-shrink-0"}),i.jsxs(po,{children:[i.jsx(go,{asChild:!0,children:i.jsx("span",{className:a?"text-xs text-sidebar-foreground cursor-help":"text-xs text-sidebar-foreground/50 line-through cursor-help",children:c.title})}),i.jsx(vo,{side:"right",className:"max-w-xs text-xs",children:c.description})]})]},s)})})})})]})})]})]})},ym=({projectId:e,className:t,additionalTabs:n=[],defaultActiveTab:r,headerButton:o})=>{const s={id:"settings",icon:va,title:i.jsx(E,{id:"settings.tab.title"}),content:i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsxs("div",{className:"border-b border-sidebar-border p-4",children:[i.jsx("h2",{className:"font-semibold text-lg",children:i.jsx(E,{id:"settings.title"})}),i.jsx("p",{className:"text-xs text-sidebar-foreground/70",children:i.jsx(E,{id:"settings.description"})})]}),i.jsx(l.Suspense,{fallback:i.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:i.jsx("div",{className:"text-sm text-sidebar-foreground/70",children:i.jsx(E,{id:"settings.loading"})})}),children:i.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"font-medium text-sm text-sidebar-foreground",children:i.jsx(E,{id:"settings.section.session_display"})}),i.jsx(Pu,{openingProjectId:e??""})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"font-medium text-sm text-sidebar-foreground",children:i.jsx(E,{id:"settings.section.notifications"})}),i.jsx(vu,{})]})]})})]})},a={id:"system-info",icon:fa,title:i.jsx(E,{id:"settings.section.system_info"}),content:i.jsx(l.Suspense,{fallback:i.jsx(sr,{}),children:i.jsx(Au,{})})},c=[...n,s,a],[u,d]=l.useState(r??c[c.length-1]?.id??"settings"),[f,m]=l.useState(!!r),g=v=>{u===v&&f?m(!1):(d(v),m(!0))},p=c.find(v=>v.id===u)?.content;return i.jsxs("div",{className:U("h-full border-r border-sidebar-border transition-all duration-300 ease-in-out flex bg-sidebar text-sidebar-foreground",f?"w-72 lg:w-80":"w-12",t),children:[i.jsx("div",{className:"w-12 flex flex-col border-r border-sidebar-border bg-sidebar/50",children:i.jsxs(kn,{children:[o&&i.jsx("div",{className:"border-b border-sidebar-border",children:o}),i.jsx("div",{className:"flex flex-col p-2 space-y-1",children:c.map(v=>{const h=v.icon;return i.jsxs(po,{children:[i.jsx(go,{asChild:!0,children:i.jsx("button",{type:"button",onClick:()=>g(v.id),className:U("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",u===v.id&&f?"bg-sidebar-accent text-sidebar-accent-foreground shadow-sm":"text-sidebar-foreground/70"),"data-testid":`${v.id}-tab-button`,children:i.jsx(h,{className:"w-4 h-4"})})}),i.jsx(vo,{side:"right",children:i.jsx("p",{children:v.title})})]},v.id)})})]})}),f&&i.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:i.jsx(l.Suspense,{fallback:i.jsx(sr,{}),children:p})})]})},vs=6048e5,Du=864e5,yr=Symbol.for("constructDateFrom");function Ee(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&yr in e?e[yr](t):e instanceof Date?new e.constructor(t):new Date(t)}function ce(e,t){return Ee(t||e,e)}let Iu={};function zt(){return Iu}function We(e,t){const n=zt(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=ce(e,t?.in),s=o.getDay(),a=(s<r?7:0)+s-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function Tt(e,t){return We(e,{...t,weekStartsOn:1})}function xs(e,t){const n=ce(e,t?.in),r=n.getFullYear(),o=Ee(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Tt(o),a=Ee(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const c=Tt(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function wr(e){const t=ce(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ys(e,...t){const n=Ee.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function br(e,t){const n=ce(e,t?.in);return n.setHours(0,0,0,0),n}function Lu(e,t,n){const[r,o]=ys(n?.in,e,t),s=br(r),a=br(o),c=+s-wr(s),u=+a-wr(a);return Math.round((c-u)/Du)}function Wu(e,t){const n=xs(e,t),r=Ee(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Tt(r)}function Fu(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function $u(e){return!(!Fu(e)&&typeof e!="number"||isNaN(+ce(e)))}function Bu(e,t){const n=ce(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Hu={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Vu=(e,t,n)=>{let r;const o=Hu[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function pe(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Yu={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zu={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},qu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Uu={date:pe({formats:Yu,defaultWidth:"full"}),time:pe({formats:zu,defaultWidth:"full"}),dateTime:pe({formats:qu,defaultWidth:"full"})},Xu={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Gu=(e,t,n,r)=>Xu[e];function Q(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,c=n?.width?String(n.width):a;o=e.formattingValues[c]||e.formattingValues[a]}else{const a=e.defaultWidth,c=n?.width?String(n.width):e.defaultWidth;o=e.values[c]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const Ku={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Qu={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ju={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Zu={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ed={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},td={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},nd=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},rd={ordinalNumber:nd,era:Q({values:Ku,defaultWidth:"wide"}),quarter:Q({values:Qu,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Q({values:Ju,defaultWidth:"wide"}),day:Q({values:Zu,defaultWidth:"wide"}),dayPeriod:Q({values:ed,defaultWidth:"wide",formattingValues:td,defaultFormattingWidth:"wide"})};function J(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const a=s[0],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(c)?sd(c,m=>m.test(a)):od(c,m=>m.test(a));let d;d=e.valueCallback?e.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=t.slice(a.length);return{value:d,rest:f}}}function od(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function sd(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Bn(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const c=t.slice(o.length);return{value:a,rest:c}}}const ad=/^(\d+)(th|st|nd|rd)?/i,id=/\d+/i,cd={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ld={any:[/^b/i,/^(a|c)/i]},ud={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},dd={any:[/1/i,/2/i,/3/i,/4/i]},fd={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},md={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},hd={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},pd={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},gd={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},vd={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},xd={ordinalNumber:Bn({matchPattern:ad,parsePattern:id,valueCallback:e=>parseInt(e,10)}),era:J({matchPatterns:cd,defaultMatchWidth:"wide",parsePatterns:ld,defaultParseWidth:"any"}),quarter:J({matchPatterns:ud,defaultMatchWidth:"wide",parsePatterns:dd,defaultParseWidth:"any",valueCallback:e=>e+1}),month:J({matchPatterns:fd,defaultMatchWidth:"wide",parsePatterns:md,defaultParseWidth:"any"}),day:J({matchPatterns:hd,defaultMatchWidth:"wide",parsePatterns:pd,defaultParseWidth:"any"}),dayPeriod:J({matchPatterns:gd,defaultMatchWidth:"any",parsePatterns:vd,defaultParseWidth:"any"})},wn={code:"en-US",formatDistance:Vu,formatLong:Uu,formatRelative:Gu,localize:rd,match:xd,options:{weekStartsOn:0,firstWeekContainsDate:1}};function yd(e,t){const n=ce(e,t?.in);return Lu(n,Bu(n))+1}function wd(e,t){const n=ce(e,t?.in),r=+Tt(n)-+Wu(n);return Math.round(r/vs)+1}function ws(e,t){const n=ce(e,t?.in),r=n.getFullYear(),o=zt(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=Ee(t?.in||e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const c=We(a,t),u=Ee(t?.in||e,0);u.setFullYear(r,0,s),u.setHours(0,0,0,0);const d=We(u,t);return+n>=+c?r+1:+n>=+d?r:r-1}function bd(e,t){const n=zt(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=ws(e,t),s=Ee(t?.in||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),We(s,t)}function Cd(e,t){const n=ce(e,t?.in),r=+We(n,t)-+bd(n,t);return Math.round(r/vs)+1}function L(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ye={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return L(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):L(n+1,2)},d(e,t){return L(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return L(e.getHours()%12||12,t.length)},H(e,t){return L(e.getHours(),t.length)},m(e,t){return L(e.getMinutes(),t.length)},s(e,t){return L(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return L(o,t.length)}},ze={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Cr={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return ye.y(e,t)},Y:function(e,t,n,r){const o=ws(e,r),s=o>0?o:1-o;if(t==="YY"){const a=s%100;return L(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):L(s,t.length)},R:function(e,t){const n=xs(e);return L(n,t.length)},u:function(e,t){const n=e.getFullYear();return L(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return L(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return L(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return ye.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return L(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Cd(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):L(o,t.length)},I:function(e,t,n){const r=wd(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):L(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ye.d(e,t)},D:function(e,t,n){const r=yd(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):L(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return L(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return L(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return L(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=ze.noon:r===0?o=ze.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=ze.evening:r>=12?o=ze.afternoon:r>=4?o=ze.morning:o=ze.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ye.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ye.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):L(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):L(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ye.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ye.s(e,t)},S:function(e,t){return ye.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Pr(r);case"XXXX":case"XX":return _e(r);case"XXXXX":case"XXX":default:return _e(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Pr(r);case"xxxx":case"xx":return _e(r);case"xxxxx":case"xxx":default:return _e(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Sr(r,":");case"OOOO":default:return"GMT"+_e(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Sr(r,":");case"zzzz":default:return"GMT"+_e(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return L(r,t.length)},T:function(e,t,n){return L(+e,t.length)}};function Sr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+L(s,2)}function Pr(e,t){return e%60===0?(e>0?"-":"+")+L(Math.abs(e)/60,2):_e(e,t)}function _e(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=L(Math.trunc(r/60),2),s=L(r%60,2);return n+o+t+s}const Er=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},bs=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Sd=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Er(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Er(r,t)).replace("{{time}}",bs(o,t))},Pd={p:bs,P:Sd},Ed=/^D+$/,Nd=/^Y+$/,Td=["D","DD","YY","YYYY"];function Rd(e){return Ed.test(e)}function jd(e){return Nd.test(e)}function Od(e,t,n){const r=Md(e,t,n);if(console.warn(r),Td.includes(e))throw new RangeError(r)}function Md(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const kd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_d=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ad=/^'([^]*?)'?$/,Dd=/''/g,Id=/[a-zA-Z]/;function Ld(e,t,n){const r=zt(),o=n?.locale??r.locale??wn,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,c=ce(e,n?.in);if(!$u(c))throw new RangeError("Invalid time value");let u=t.match(_d).map(f=>{const m=f[0];if(m==="p"||m==="P"){const g=Pd[m];return g(f,o.formatLong)}return f}).join("").match(kd).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:Wd(f)};if(Cr[m])return{isToken:!0,value:f};if(m.match(Id))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});o.localize.preprocessor&&(u=o.localize.preprocessor(c,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:o};return u.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!n?.useAdditionalWeekYearTokens&&jd(m)||!n?.useAdditionalDayOfYearTokens&&Rd(m))&&Od(m,t,String(e));const g=Cr[m[0]];return g(c,m,o.localize,d)}).join("")}function Wd(e){const t=e.match(Ad);return t?t[1].replace(Dd,"'"):e}function Fd(e,t,n){const[r,o]=ys(n?.in,e,t);return+We(r,n)==+We(o,n)}const $d={lessThanXSeconds:{one:"1秒未満",other:"{{count}}秒未満",oneWithSuffix:"約1秒",otherWithSuffix:"約{{count}}秒"},xSeconds:{one:"1秒",other:"{{count}}秒"},halfAMinute:"30秒",lessThanXMinutes:{one:"1分未満",other:"{{count}}分未満",oneWithSuffix:"約1分",otherWithSuffix:"約{{count}}分"},xMinutes:{one:"1分",other:"{{count}}分"},aboutXHours:{one:"約1時間",other:"約{{count}}時間"},xHours:{one:"1時間",other:"{{count}}時間"},xDays:{one:"1日",other:"{{count}}日"},aboutXWeeks:{one:"約1週間",other:"約{{count}}週間"},xWeeks:{one:"1週間",other:"{{count}}週間"},aboutXMonths:{one:"約1か月",other:"約{{count}}か月"},xMonths:{one:"1か月",other:"{{count}}か月"},aboutXYears:{one:"約1年",other:"約{{count}}年"},xYears:{one:"1年",other:"{{count}}年"},overXYears:{one:"1年以上",other:"{{count}}年以上"},almostXYears:{one:"1年近く",other:"{{count}}年近く"}},Bd=(e,t,n)=>{n=n||{};let r;const o=$d[e];return typeof o=="string"?r=o:t===1?n.addSuffix&&o.oneWithSuffix?r=o.oneWithSuffix:r=o.one:n.addSuffix&&o.otherWithSuffix?r=o.otherWithSuffix.replace("{{count}}",String(t)):r=o.other.replace("{{count}}",String(t)),n.addSuffix?n.comparison&&n.comparison>0?r+"後":r+"前":r},Hd={full:"y年M月d日EEEE",long:"y年M月d日",medium:"y/MM/dd",short:"y/MM/dd"},Vd={full:"H時mm分ss秒 zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},Yd={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},zd={date:pe({formats:Hd,defaultWidth:"full"}),time:pe({formats:Vd,defaultWidth:"full"}),dateTime:pe({formats:Yd,defaultWidth:"full"})},qd={lastWeek:"先週のeeeeのp",yesterday:"昨日のp",today:"今日のp",tomorrow:"明日のp",nextWeek:"翌週のeeeeのp",other:"P"},Ud=(e,t,n,r)=>qd[e],Xd={narrow:["BC","AC"],abbreviated:["紀元前","西暦"],wide:["紀元前","西暦"]},Gd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["第1四半期","第2四半期","第3四半期","第4四半期"]},Kd={narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]},Qd={narrow:["日","月","火","水","木","金","土"],short:["日","月","火","水","木","金","土"],abbreviated:["日","月","火","水","木","金","土"],wide:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"]},Jd={narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},Zd={narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},ef=(e,t)=>{const n=Number(e);switch(String(t?.unit)){case"year":return`${n}年`;case"quarter":return`第${n}四半期`;case"month":return`${n}月`;case"week":return`第${n}週`;case"date":return`${n}日`;case"hour":return`${n}時`;case"minute":return`${n}分`;case"second":return`${n}秒`;default:return`${n}`}},tf={ordinalNumber:ef,era:Q({values:Xd,defaultWidth:"wide"}),quarter:Q({values:Gd,defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:Q({values:Kd,defaultWidth:"wide"}),day:Q({values:Qd,defaultWidth:"wide"}),dayPeriod:Q({values:Jd,defaultWidth:"wide",formattingValues:Zd,defaultFormattingWidth:"wide"})},nf=/^第?\d+(年|四半期|月|週|日|時|分|秒)?/i,rf=/\d+/i,of={narrow:/^(B\.?C\.?|A\.?D\.?)/i,abbreviated:/^(紀元[前後]|西暦)/i,wide:/^(紀元[前後]|西暦)/i},sf={narrow:[/^B/i,/^A/i],any:[/^(紀元前)/i,/^(西暦|紀元後)/i]},af={narrow:/^[1234]/i,abbreviated:/^Q[1234]/i,wide:/^第[1234一二三四1234]四半期/i},cf={any:[/(1|一|1)/i,/(2|二|2)/i,/(3|三|3)/i,/(4|四|4)/i]},lf={narrow:/^([123456789]|1[012])/,abbreviated:/^([123456789]|1[012])月/i,wide:/^([123456789]|1[012])月/i},uf={any:[/^1\D/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},df={narrow:/^[日月火水木金土]/,short:/^[日月火水木金土]/,abbreviated:/^[日月火水木金土]/,wide:/^[日月火水木金土]曜日/},ff={any:[/^日/,/^月/,/^火/,/^水/,/^木/,/^金/,/^土/]},mf={any:/^(AM|PM|午前|午後|正午|深夜|真夜中|夜|朝)/i},hf={any:{am:/^(A|午前)/i,pm:/^(P|午後)/i,midnight:/^深夜|真夜中/i,noon:/^正午/i,morning:/^朝/i,afternoon:/^午後/i,evening:/^夜/i,night:/^深夜/i}},pf={ordinalNumber:Bn({matchPattern:nf,parsePattern:rf,valueCallback:function(e){return parseInt(e,10)}}),era:J({matchPatterns:of,defaultMatchWidth:"wide",parsePatterns:sf,defaultParseWidth:"any"}),quarter:J({matchPatterns:af,defaultMatchWidth:"wide",parsePatterns:cf,defaultParseWidth:"any",valueCallback:e=>e+1}),month:J({matchPatterns:lf,defaultMatchWidth:"wide",parsePatterns:uf,defaultParseWidth:"any"}),day:J({matchPatterns:df,defaultMatchWidth:"wide",parsePatterns:ff,defaultParseWidth:"any"}),dayPeriod:J({matchPatterns:mf,defaultMatchWidth:"any",parsePatterns:hf,defaultParseWidth:"any"})},gf={code:"ja",formatDistance:Bd,formatLong:zd,formatRelative:Ud,localize:tf,match:pf,options:{weekStartsOn:0,firstWeekContainsDate:1}},vf={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},xf=(e,t,n)=>{let r;const o=vf[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},yf={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},wf={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},bf={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Cf={date:pe({formats:yf,defaultWidth:"full"}),time:pe({formats:wf,defaultWidth:"full"}),dateTime:pe({formats:bf,defaultWidth:"full"})};function Nr(e,t,n){const r="eeee p";return Fd(e,t,n)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const Sf={lastWeek:Nr,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:Nr,other:"PP p"},Pf=(e,t,n,r)=>{const o=Sf[e];return typeof o=="function"?o(t,n,r):o},Ef={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},Nf={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},Tf={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},Rf={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},jf={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Of={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Mf=(e,t)=>{const n=Number(e);switch(t?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},kf={ordinalNumber:Mf,era:Q({values:Ef,defaultWidth:"wide"}),quarter:Q({values:Nf,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Q({values:Tf,defaultWidth:"wide"}),day:Q({values:Rf,defaultWidth:"wide"}),dayPeriod:Q({values:jf,defaultWidth:"wide",formattingValues:Of,defaultFormattingWidth:"wide"})},_f=/^(第\s*)?\d+(日|时|分|秒)?/i,Af=/\d+/i,Df={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},If={any:[/^(前)/i,/^(公元)/i]},Lf={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},Wf={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},Ff={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},$f={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Bf={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},Hf={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Vf={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},Yf={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},zf={ordinalNumber:Bn({matchPattern:_f,parsePattern:Af,valueCallback:e=>parseInt(e,10)}),era:J({matchPatterns:Df,defaultMatchWidth:"wide",parsePatterns:If,defaultParseWidth:"any"}),quarter:J({matchPatterns:Lf,defaultMatchWidth:"wide",parsePatterns:Wf,defaultParseWidth:"any",valueCallback:e=>e+1}),month:J({matchPatterns:Ff,defaultMatchWidth:"wide",parsePatterns:$f,defaultParseWidth:"any"}),day:J({matchPatterns:Bf,defaultMatchWidth:"wide",parsePatterns:Hf,defaultParseWidth:"any"}),dayPeriod:J({matchPatterns:Vf,defaultMatchWidth:"any",parsePatterns:Yf,defaultParseWidth:"any"})},qf={code:"zh-CN",formatDistance:xf,formatLong:Cf,formatRelative:Pf,localize:kf,match:zf,options:{weekStartsOn:1,firstWeekContainsDate:4}},Uf=e=>{switch(e){case"ja":return gf;case"en":return wn;case"zh_CN":return qf;default:return wn}},wm=(e,t)=>{const{locale:n="en",target:r="time"}=t,o=typeof e=="string"?new Date(e):e,s=Uf(n),c=((u,d)=>{if(u==="ja")switch(d){case"month":return"yyyy年M月";case"day":return"yyyy年M月d日";case"time":return"yyyy年M月d日 HH:mm"}else if(u==="en")switch(d){case"month":return"MM/yyyy";case"day":return"MM/dd/yyyy";case"time":return"MM/dd/yyyy HH:mm"}else if(u==="zh_CN")switch(d){case"month":return"yyyy年M月";case"day":return"yyyy年M月d日";case"time":return"yyyy年M月d日 HH:mm"}switch(d){case"month":return"yyyy-MM";case"day":return"yyyy-MM-dd";case"time":return"yyyy-MM-dd HH:mm"}})(n,r);return Ld(o,c,{locale:s})};var qt="Dialog",[Cs]=$e(qt),[Xf,le]=Cs(qt),Ss=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,c=l.useRef(null),u=l.useRef(null),[d,f]=Ge({prop:r,defaultProp:o??!1,onChange:s,caller:qt});return i.jsx(Xf,{scope:t,triggerRef:c,contentRef:u,contentId:be(),titleId:be(),descriptionId:be(),open:d,onOpenChange:f,onOpenToggle:l.useCallback(()=>f(m=>!m),[f]),modal:a,children:n})};Ss.displayName=qt;var Ps="DialogTrigger",Es=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=le(Ps,n),s=F(t,o.triggerRef);return i.jsx(k.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Yn(o.open),...r,ref:s,onClick:M(e.onClick,o.onOpenToggle)})});Es.displayName=Ps;var Hn="DialogPortal",[Gf,Ns]=Cs(Hn,{forceMount:void 0}),Ts=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=le(Hn,t);return i.jsx(Gf,{scope:t,forceMount:n,children:l.Children.map(r,a=>i.jsx(Ne,{present:n||s.open,children:i.jsx(It,{asChild:!0,container:o,children:a})}))})};Ts.displayName=Hn;var Rt="DialogOverlay",Rs=l.forwardRef((e,t)=>{const n=Ns(Rt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=le(Rt,e.__scopeDialog);return s.modal?i.jsx(Ne,{present:r||s.open,children:i.jsx(Qf,{...o,ref:t})}):null});Rs.displayName=Rt;var Kf=it("DialogOverlay.RemoveScroll"),Qf=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=le(Rt,n);return i.jsx(An,{as:Kf,allowPinchZoom:!0,shards:[o.contentRef],children:i.jsx(k.div,{"data-state":Yn(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Fe="DialogContent",js=l.forwardRef((e,t)=>{const n=Ns(Fe,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=le(Fe,e.__scopeDialog);return i.jsx(Ne,{present:r||s.open,children:s.modal?i.jsx(Jf,{...o,ref:t}):i.jsx(Zf,{...o,ref:t})})});js.displayName=Fe;var Jf=l.forwardRef((e,t)=>{const n=le(Fe,e.__scopeDialog),r=l.useRef(null),o=F(t,n.contentRef,r);return l.useEffect(()=>{const s=r.current;if(s)return Co(s)},[]),i.jsx(Os,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:M(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:M(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&s.preventDefault()}),onFocusOutside:M(e.onFocusOutside,s=>s.preventDefault())})}),Zf=l.forwardRef((e,t)=>{const n=le(Fe,e.__scopeDialog),r=l.useRef(!1),o=l.useRef(!1);return i.jsx(Os,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Os=l.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...a}=e,c=le(Fe,n),u=l.useRef(null),d=F(t,u);return xo(),i.jsxs(i.Fragment,{children:[i.jsx(_n,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:i.jsx(Ot,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Yn(c.open),...a,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(em,{titleId:c.titleId}),i.jsx(nm,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Vn="DialogTitle",Ms=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=le(Vn,n);return i.jsx(k.h2,{id:o.titleId,...r,ref:t})});Ms.displayName=Vn;var ks="DialogDescription",_s=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=le(ks,n);return i.jsx(k.p,{id:o.descriptionId,...r,ref:t})});_s.displayName=ks;var As="DialogClose",Ds=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=le(As,n);return i.jsx(k.button,{type:"button",...r,ref:t,onClick:M(e.onClick,()=>o.onOpenChange(!1))})});Ds.displayName=As;function Yn(e){return e?"open":"closed"}var Is="DialogTitleWarning",[bm,Ls]=wa(Is,{contentName:Fe,titleName:Vn,docsSlug:"dialog"}),em=({titleId:e})=>{const t=Ls(Is),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
101
+ `)},bl=0,Ye=[];function Cl(e){var t=l.useRef([]),n=l.useRef([0,0]),r=l.useRef(),o=l.useState(bl++)[0],s=l.useState(No)[0],a=l.useRef(e);l.useEffect(function(){a.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=Vc([e.lockRef.current],(e.shards||[]).map(gr),!0).filter(Boolean);return h.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=l.useCallback(function(h,x){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var w=xt(h),y=n.current,b="deltaX"in h?h.deltaX:y[0]-w[0],C="deltaY"in h?h.deltaY:y[1]-w[1],P,N=h.target,S=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in h&&S==="h"&&N.type==="range")return!1;var R=hr(S,N);if(!R)return!0;if(R?P=S:(P=S==="v"?"h":"v",R=hr(S,N)),!R)return!1;if(!r.current&&"changedTouches"in h&&(b||C)&&(r.current=P),!P)return!0;var I=r.current||P;return xl(I,x,h,I==="h"?b:C)},[]),u=l.useCallback(function(h){var x=h;if(!(!Ye.length||Ye[Ye.length-1]!==s)){var w="deltaY"in x?pr(x):xt(x),y=t.current.filter(function(P){return P.name===x.type&&(P.target===x.target||x.target===P.shadowParent)&&yl(P.delta,w)})[0];if(y&&y.should){x.cancelable&&x.preventDefault();return}if(!y){var b=(a.current.shards||[]).map(gr).filter(Boolean).filter(function(P){return P.contains(x.target)}),C=b.length>0?c(x,b[0]):!a.current.noIsolation;C&&x.cancelable&&x.preventDefault()}}},[]),d=l.useCallback(function(h,x,w,y){var b={name:h,delta:x,target:w,should:y,shadowParent:Sl(w)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(C){return C!==b})},1)},[]),f=l.useCallback(function(h){n.current=xt(h),r.current=void 0},[]),m=l.useCallback(function(h){d(h.type,pr(h),h.target,c(h,e.lockRef.current))},[]),g=l.useCallback(function(h){d(h.type,xt(h),h.target,c(h,e.lockRef.current))},[]);l.useEffect(function(){return Ye.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Ve),document.addEventListener("touchmove",u,Ve),document.addEventListener("touchstart",f,Ve),function(){Ye=Ye.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,Ve),document.removeEventListener("touchmove",u,Ve),document.removeEventListener("touchstart",f,Ve)}},[]);var p=e.removeScrollBar,v=e.inert;return l.createElement(l.Fragment,null,v?l.createElement(s,{styles:wl(o)}):null,p?l.createElement(dl,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Sl(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Pl=Jc(Eo,Cl);var An=l.forwardRef(function(e,t){return l.createElement(Ft,ue({},e,{ref:t,sideCar:Pl}))});An.classNames=Ft.classNames;var El=[" ","Enter","ArrowUp","ArrowDown"],Nl=[" ","Enter"],Ie="Select",[$t,Bt,Tl]=Oc(Ie),[Ze]=$e(Ie,[Tl,Dt]),Ht=Dt(),[Rl,Te]=Ze(Ie),[jl,Ol]=Ze(Ie),Oo=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:c,onValueChange:u,dir:d,name:f,autoComplete:m,disabled:g,required:p,form:v}=e,h=Ht(t),[x,w]=l.useState(null),[y,b]=l.useState(null),[C,P]=l.useState(!1),N=kc(d),[S,R]=Ge({prop:r,defaultProp:o??!1,onChange:s,caller:Ie}),[I,A]=Ge({prop:a,defaultProp:c,onChange:u,caller:Ie}),$=l.useRef(null),B=x?v||!!x.closest("form"):!0,[W,_]=l.useState(new Set),z=Array.from(W).map(O=>O.props.value).join(";");return i.jsx(Zr,{...h,children:i.jsxs(Rl,{required:p,scope:t,trigger:x,onTriggerChange:w,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:C,onValueNodeHasChildrenChange:P,contentId:be(),value:I,onValueChange:A,open:S,onOpenChange:R,dir:N,triggerPointerDownPosRef:$,disabled:g,children:[i.jsx($t.Provider,{scope:t,children:i.jsx(jl,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(O=>{_(D=>new Set(D).add(O))},[]),onNativeOptionRemove:l.useCallback(O=>{_(D=>{const j=new Set(D);return j.delete(O),j})},[]),children:n})}),B?i.jsxs(Jo,{"aria-hidden":!0,required:p,tabIndex:-1,name:f,autoComplete:m,value:I,onChange:O=>A(O.target.value),disabled:g,form:v,children:[I===void 0?i.jsx("option",{value:""}):null,Array.from(W)]},z):null]})})};Oo.displayName=Ie;var Mo="SelectTrigger",ko=l.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Ht(n),a=Te(Mo,n),c=a.disabled||r,u=F(t,a.onTriggerChange),d=Bt(n),f=l.useRef("touch"),[m,g,p]=es(h=>{const x=d().filter(b=>!b.disabled),w=x.find(b=>b.value===a.value),y=ts(x,h,w);y!==void 0&&a.onValueChange(y.value)}),v=h=>{c||(a.onOpenChange(!0),p()),h&&(a.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return i.jsx(eo,{asChild:!0,...s,children:i.jsx(k.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Zo(a.value)?"":void 0,...o,ref:u,onClick:M(o.onClick,h=>{h.currentTarget.focus(),f.current!=="mouse"&&v(h)}),onPointerDown:M(o.onPointerDown,h=>{f.current=h.pointerType;const x=h.target;x.hasPointerCapture(h.pointerId)&&x.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(v(h),h.preventDefault())}),onKeyDown:M(o.onKeyDown,h=>{const x=m.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&g(h.key),!(x&&h.key===" ")&&El.includes(h.key)&&(v(),h.preventDefault())})})})});ko.displayName=Mo;var _o="SelectValue",Ao=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:a="",...c}=e,u=Te(_o,n),{onValueNodeHasChildrenChange:d}=u,f=s!==void 0,m=F(t,u.onValueNodeChange);return G(()=>{d(f)},[d,f]),i.jsx(k.span,{...c,ref:m,style:{pointerEvents:"none"},children:Zo(u.value)?i.jsx(i.Fragment,{children:a}):s})});Ao.displayName=_o;var Ml="SelectIcon",Do=l.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return i.jsx(k.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Do.displayName=Ml;var kl="SelectPortal",Io=e=>i.jsx(It,{asChild:!0,...e});Io.displayName=kl;var Le="SelectContent",Lo=l.forwardRef((e,t)=>{const n=Te(Le,e.__scopeSelect),[r,o]=l.useState();if(G(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?jt.createPortal(i.jsx(Wo,{scope:e.__scopeSelect,children:i.jsx($t.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),s):null}return i.jsx(Fo,{...e,ref:t})});Lo.displayName=Le;var se=10,[Wo,Re]=Ze(Le),_l="SelectContentImpl",Al=it("SelectContent.RemoveScroll"),Fo=l.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:h,avoidCollisions:x,...w}=e,y=Te(Le,n),[b,C]=l.useState(null),[P,N]=l.useState(null),S=F(t,T=>C(T)),[R,I]=l.useState(null),[A,$]=l.useState(null),B=Bt(n),[W,_]=l.useState(!1),z=l.useRef(!1);l.useEffect(()=>{if(b)return Co(b)},[b]),xo();const O=l.useCallback(T=>{const[q,...K]=B().map(X=>X.ref.current),[V]=K.slice(-1),Y=document.activeElement;for(const X of T)if(X===Y||(X?.scrollIntoView({block:"nearest"}),X===q&&P&&(P.scrollTop=0),X===V&&P&&(P.scrollTop=P.scrollHeight),X?.focus(),document.activeElement!==Y))return},[B,P]),D=l.useCallback(()=>O([R,b]),[O,R,b]);l.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:j,triggerPointerDownPosRef:H}=y;l.useEffect(()=>{if(b){let T={x:0,y:0};const q=V=>{T={x:Math.abs(Math.round(V.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(V.pageY)-(H.current?.y??0))}},K=V=>{T.x<=10&&T.y<=10?V.preventDefault():b.contains(V.target)||j(!1),document.removeEventListener("pointermove",q),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",K,{capture:!0})}}},[b,j,H]),l.useEffect(()=>{const T=()=>j(!1);return window.addEventListener("blur",T),window.addEventListener("resize",T),()=>{window.removeEventListener("blur",T),window.removeEventListener("resize",T)}},[j]);const[Z,je]=es(T=>{const q=B().filter(Y=>!Y.disabled),K=q.find(Y=>Y.ref.current===document.activeElement),V=ts(q,T,K);V&&setTimeout(()=>V.ref.current.focus())}),et=l.useCallback((T,q,K)=>{const V=!z.current&&!K;(y.value!==void 0&&y.value===q||V)&&(I(T),V&&(z.current=!0))},[y.value]),tt=l.useCallback(()=>b?.focus(),[b]),xe=l.useCallback((T,q,K)=>{const V=!z.current&&!K;(y.value!==void 0&&y.value===q||V)&&$(T)},[y.value]),Be=r==="popper"?pn:$o,Oe=Be===pn?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:h,avoidCollisions:x}:{};return i.jsx(Wo,{scope:n,content:b,viewport:P,onViewportChange:N,itemRefCallback:et,selectedItem:R,onItemLeave:tt,itemTextRefCallback:xe,focusSelectedItem:D,selectedItemText:A,position:r,isPositioned:W,searchRef:Z,children:i.jsx(An,{as:Al,allowPinchZoom:!0,children:i.jsx(_n,{asChild:!0,trapped:y.open,onMountAutoFocus:T=>{T.preventDefault()},onUnmountAutoFocus:M(o,T=>{y.trigger?.focus({preventScroll:!0}),T.preventDefault()}),children:i.jsx(Ot,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:T=>T.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:i.jsx(Be,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:T=>T.preventDefault(),...w,...Oe,onPlaced:()=>_(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:M(w.onKeyDown,T=>{const q=T.ctrlKey||T.altKey||T.metaKey;if(T.key==="Tab"&&T.preventDefault(),!q&&T.key.length===1&&je(T.key),["ArrowUp","ArrowDown","Home","End"].includes(T.key)){let V=B().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);if(["ArrowUp","End"].includes(T.key)&&(V=V.slice().reverse()),["ArrowUp","ArrowDown"].includes(T.key)){const Y=T.target,X=V.indexOf(Y);V=V.slice(X+1)}setTimeout(()=>O(V)),T.preventDefault()}})})})})})})});Fo.displayName=_l;var Dl="SelectItemAlignedPosition",$o=l.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Te(Le,n),a=Re(Le,n),[c,u]=l.useState(null),[d,f]=l.useState(null),m=F(t,S=>f(S)),g=Bt(n),p=l.useRef(!1),v=l.useRef(!0),{viewport:h,selectedItem:x,selectedItemText:w,focusSelectedItem:y}=a,b=l.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&d&&h&&x&&w){const S=s.trigger.getBoundingClientRect(),R=d.getBoundingClientRect(),I=s.valueNode.getBoundingClientRect(),A=w.getBoundingClientRect();if(s.dir!=="rtl"){const Y=A.left-R.left,X=I.left-Y,re=S.left-X,Me=S.width+re,Ut=Math.max(Me,R.width),Xt=window.innerWidth-se,Gt=ar(X,[se,Math.max(se,Xt-Ut)]);c.style.minWidth=Me+"px",c.style.left=Gt+"px"}else{const Y=R.right-A.right,X=window.innerWidth-I.right-Y,re=window.innerWidth-S.right-X,Me=S.width+re,Ut=Math.max(Me,R.width),Xt=window.innerWidth-se,Gt=ar(X,[se,Math.max(se,Xt-Ut)]);c.style.minWidth=Me+"px",c.style.right=Gt+"px"}const $=g(),B=window.innerHeight-se*2,W=h.scrollHeight,_=window.getComputedStyle(d),z=parseInt(_.borderTopWidth,10),O=parseInt(_.paddingTop,10),D=parseInt(_.borderBottomWidth,10),j=parseInt(_.paddingBottom,10),H=z+O+W+j+D,Z=Math.min(x.offsetHeight*5,H),je=window.getComputedStyle(h),et=parseInt(je.paddingTop,10),tt=parseInt(je.paddingBottom,10),xe=S.top+S.height/2-se,Be=B-xe,Oe=x.offsetHeight/2,T=x.offsetTop+Oe,q=z+O+T,K=H-q;if(q<=xe){const Y=$.length>0&&x===$[$.length-1].ref.current;c.style.bottom="0px";const X=d.clientHeight-h.offsetTop-h.offsetHeight,re=Math.max(Be,Oe+(Y?tt:0)+X+D),Me=q+re;c.style.height=Me+"px"}else{const Y=$.length>0&&x===$[0].ref.current;c.style.top="0px";const re=Math.max(xe,z+h.offsetTop+(Y?et:0)+Oe)+K;c.style.height=re+"px",h.scrollTop=q-xe+h.offsetTop}c.style.margin=`${se}px 0`,c.style.minHeight=Z+"px",c.style.maxHeight=B+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[g,s.trigger,s.valueNode,c,d,h,x,w,s.dir,r]);G(()=>b(),[b]);const[C,P]=l.useState();G(()=>{d&&P(window.getComputedStyle(d).zIndex)},[d]);const N=l.useCallback(S=>{S&&v.current===!0&&(b(),y?.(),v.current=!1)},[b,y]);return i.jsx(Ll,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:p,onScrollButtonChange:N,children:i.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:i.jsx(k.div,{...o,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});$o.displayName=Dl;var Il="SelectPopperPosition",pn=l.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=se,...s}=e,a=Ht(n);return i.jsx(to,{...a,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});pn.displayName=Il;var[Ll,Dn]=Ze(Le,{}),gn="SelectViewport",Bo=l.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Re(gn,n),a=Dn(gn,n),c=F(t,s.onViewportChange),u=l.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx($t.Slot,{scope:n,children:i.jsx(k.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:M(o.onScroll,d=>{const f=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:g}=a;if(g?.current&&m){const p=Math.abs(u.current-f.scrollTop);if(p>0){const v=window.innerHeight-se*2,h=parseFloat(m.style.minHeight),x=parseFloat(m.style.height),w=Math.max(h,x);if(w<v){const y=w+p,b=Math.min(v,y),C=y-b;m.style.height=b+"px",m.style.bottom==="0px"&&(f.scrollTop=C>0?C:0,m.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})});Bo.displayName=gn;var Ho="SelectGroup",[Wl,Fl]=Ze(Ho),$l=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=be();return i.jsx(Wl,{scope:n,id:o,children:i.jsx(k.div,{role:"group","aria-labelledby":o,...r,ref:t})})});$l.displayName=Ho;var Vo="SelectLabel",Bl=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Fl(Vo,n);return i.jsx(k.div,{id:o.id,...r,ref:t})});Bl.displayName=Vo;var Nt="SelectItem",[Hl,Yo]=Ze(Nt),zo=l.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...a}=e,c=Te(Nt,n),u=Re(Nt,n),d=c.value===r,[f,m]=l.useState(s??""),[g,p]=l.useState(!1),v=F(t,y=>u.itemRefCallback?.(y,r,o)),h=be(),x=l.useRef("touch"),w=()=>{o||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(Hl,{scope:n,value:r,disabled:o,textId:h,isSelected:d,onItemTextChange:l.useCallback(y=>{m(b=>b||(y?.textContent??"").trim())},[]),children:i.jsx($t.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:i.jsx(k.div,{role:"option","aria-labelledby":h,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:v,onFocus:M(a.onFocus,()=>p(!0)),onBlur:M(a.onBlur,()=>p(!1)),onClick:M(a.onClick,()=>{x.current!=="mouse"&&w()}),onPointerUp:M(a.onPointerUp,()=>{x.current==="mouse"&&w()}),onPointerDown:M(a.onPointerDown,y=>{x.current=y.pointerType}),onPointerMove:M(a.onPointerMove,y=>{x.current=y.pointerType,o?u.onItemLeave?.():x.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:M(a.onPointerLeave,y=>{y.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:M(a.onKeyDown,y=>{u.searchRef?.current!==""&&y.key===" "||(Nl.includes(y.key)&&w(),y.key===" "&&y.preventDefault())})})})})});zo.displayName=Nt;var nt="SelectItemText",qo=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,a=Te(nt,n),c=Re(nt,n),u=Yo(nt,n),d=Ol(nt,n),[f,m]=l.useState(null),g=F(t,w=>m(w),u.onItemTextChange,w=>c.itemTextRefCallback?.(w,u.value,u.disabled)),p=f?.textContent,v=l.useMemo(()=>i.jsx("option",{value:u.value,disabled:u.disabled,children:p},u.value),[u.disabled,u.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:x}=d;return G(()=>(h(v),()=>x(v)),[h,x,v]),i.jsxs(i.Fragment,{children:[i.jsx(k.span,{id:u.textId,...s,ref:g}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?jt.createPortal(s.children,a.valueNode):null]})});qo.displayName=nt;var Uo="SelectItemIndicator",Xo=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Yo(Uo,n).isSelected?i.jsx(k.span,{"aria-hidden":!0,...r,ref:t}):null});Xo.displayName=Uo;var vn="SelectScrollUpButton",Go=l.forwardRef((e,t)=>{const n=Re(vn,e.__scopeSelect),r=Dn(vn,e.__scopeSelect),[o,s]=l.useState(!1),a=F(t,r.onScrollButtonChange);return G(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=u.scrollTop>0;s(d)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?i.jsx(Qo,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop-u.offsetHeight)}}):null});Go.displayName=vn;var xn="SelectScrollDownButton",Ko=l.forwardRef((e,t)=>{const n=Re(xn,e.__scopeSelect),r=Dn(xn,e.__scopeSelect),[o,s]=l.useState(!1),a=F(t,r.onScrollButtonChange);return G(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)<d;s(f)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?i.jsx(Qo,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop+u.offsetHeight)}}):null});Ko.displayName=xn;var Qo=l.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Re("SelectScrollButton",n),a=l.useRef(null),c=Bt(n),u=l.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return l.useEffect(()=>()=>u(),[u]),G(()=>{c().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),i.jsx(k.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:M(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:M(o.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:M(o.onPointerLeave,()=>{u()})})}),Vl="SelectSeparator",Yl=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(k.div,{"aria-hidden":!0,...r,ref:t})});Yl.displayName=Vl;var yn="SelectArrow",zl=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ht(n),s=Te(yn,n),a=Re(yn,n);return s.open&&a.position==="popper"?i.jsx(no,{...o,...r,ref:t}):null});zl.displayName=yn;var ql="SelectBubbleInput",Jo=l.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=l.useRef(null),s=F(r,o),a=wo(t);return l.useEffect(()=>{const c=o.current;if(!c)return;const u=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==t&&f){const m=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(m)}},[a,t]),i.jsx(k.select,{...n,style:{...ro,...n.style},ref:s,defaultValue:t})});Jo.displayName=ql;function Zo(e){return e===""||e===void 0}function es(e){const t=Ae(e),n=l.useRef(""),r=l.useRef(0),o=l.useCallback(a=>{const c=n.current+a;t(c),(function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(c)},[t]),s=l.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function ts(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Ul(e,Math.max(s,0));o.length===1&&(a=a.filter(d=>d!==n));const u=a.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function Ul(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Xl=Oo,Gl=ko,Kl=Ao,Ql=Do,Jl=Io,Zl=Lo,eu=Bo,tu=zo,nu=qo,ru=Xo,ou=Go,su=Ko;function rt({...e}){return i.jsx(Xl,{...e})}function ot({...e}){return i.jsx(Kl,{...e})}function st({className:e,children:t,...n}){return i.jsxs(Gl,{className:U("flex h-10 w-full items-center justify-between rounded-md border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,i.jsx(Ql,{asChild:!0,children:i.jsx(bn,{className:"h-4 w-4 opacity-50"})})]})}function au({className:e,...t}){return i.jsx(ou,{className:U("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(sa,{className:"h-4 w-4"})})}function iu({className:e,...t}){return i.jsx(su,{className:U("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(bn,{className:"h-4 w-4"})})}function at({className:e,children:t,position:n="popper",...r}){return i.jsx(Jl,{children:i.jsxs(Zl,{className:U("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[i.jsx(au,{}),i.jsx(eu,{className:U("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(iu,{})]})})}function ee({className:e,children:t,...n}){return i.jsxs(tu,{className:U("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(ru,{children:i.jsx(Rr,{className:"h-4 w-4"})})}),i.jsx(nu,{children:t})]})}const In={},cu=Symbol((In?"production":void 0)!=="production"?"RESET":""),ns=e=>typeof e?.then=="function";function lu(e=()=>{try{return window.localStorage}catch(n){(In?"production":void 0)!=="production"&&typeof window<"u"&&console.warn(n);return}},t){var n;let r,o;const s={getItem:(u,d)=>{var f,m;const g=v=>{if(v=v||"",r!==v){try{o=JSON.parse(v,t?.reviver)}catch{return d}r=v}return o},p=(m=(f=e())==null?void 0:f.getItem(u))!=null?m:null;return ns(p)?p.then(g):g(p)},setItem:(u,d)=>{var f;return(f=e())==null?void 0:f.setItem(u,JSON.stringify(d,void 0))},removeItem:u=>{var d;return(d=e())==null?void 0:d.removeItem(u)}},a=u=>(d,f,m)=>u(d,g=>{let p;try{p=JSON.parse(g||"")}catch{p=m}f(p)});let c;try{c=(n=e())==null?void 0:n.subscribe}catch{}return!c&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(c=(u,d)=>{if(!(e()instanceof window.Storage))return()=>{};const f=m=>{m.storageArea===e()&&m.key===u&&d(m.newValue)};return window.addEventListener("storage",f),()=>{window.removeEventListener("storage",f)}}),c&&(s.subscribe=a(c)),s}const uu=lu();function du(e,t,n=uu,r){const o=sn(t);return(In?"production":void 0)!=="production"&&(o.debugPrivate=!0),o.onMount=a=>{a(n.getItem(e,t));let c;return n.subscribe&&(c=n.subscribe(e,a,t)),c},sn(a=>a(o),(a,c,u)=>{const d=typeof u=="function"?u(a(o)):u;return d===cu?(c(o,t),n.removeItem(e)):ns(d)?d.then(f=>(c(o,f),n.setItem(e,f))):(c(o,d),n.setItem(e,d))})}const fu={soundType:"none"},rs=du("claude-code-viewer-notification-settings",fu),xm=sn(e=>e(rs).soundType!=="none"),mu={beep:{frequency:[800],duration:.15,type:"sine",volume:.3},chime:{frequency:[523,659,784],duration:.4,type:"sine",volume:.2},ping:{frequency:[1e3],duration:.1,type:"triangle",volume:.4},pop:{frequency:[400,600],duration:.08,type:"square",volume:.2}};function hu(e){if(e!=="none")try{const t=mu[e];if(!t){console.warn(`Unknown sound type: ${e}`);return}const n=new(window.AudioContext||window.webkitAudioContext);t.frequency.forEach((r,o)=>{const s=n.createOscillator(),a=n.createGain();s.connect(a),a.connect(n.destination),s.frequency.setValueAtTime(r,n.currentTime),s.type=t.type;const c=n.currentTime+o*.05;a.gain.setValueAtTime(t.volume,c),a.gain.exponentialRampToValueAtTime(.01,c+t.duration),s.start(c),s.stop(c+t.duration)})}catch(t){console.warn("Failed to play notification sound:",t)}}function pu(e){return{none:i.jsx(E,{id:"notification.none"}),beep:i.jsx(E,{id:"notification.beep"}),chime:i.jsx(E,{id:"notification.chime"}),ping:i.jsx(E,{id:"notification.ping"}),pop:i.jsx(E,{id:"notification.pop"})}[e]}function gu(){return["none","beep","chime","ping","pop"]}const vu=({showLabels:e=!0,showDescriptions:t=!0,className:n=""})=>{const r=l.useId(),[o,s]=Hs(rs),a=l.useCallback(d=>{s(f=>({...f,soundType:d}))},[s]),c=l.useCallback(()=>{o.soundType!=="none"&&hu(o.soundType)},[o.soundType]),u=gu();return i.jsx("div",{className:`space-y-4 ${n}`,children:i.jsxs("div",{className:"space-y-2",children:[e&&i.jsx("label",{htmlFor:r,className:"text-sm font-medium leading-none",children:"Task completion sound"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(rt,{value:o.soundType,onValueChange:a,children:[i.jsx(st,{id:r,className:"w-[180px]",children:i.jsx(ot,{placeholder:"音を選択"})}),i.jsx(at,{children:u.map(d=>i.jsx(ee,{value:d,children:pu(d)},d))})]}),o.soundType!=="none"&&i.jsx(Vs,{variant:"outline",size:"sm",onClick:c,className:"px-3",children:i.jsx(E,{id:"notification.test"})})]}),t&&i.jsx("p",{className:"text-xs text-muted-foreground",children:i.jsx(E,{id:"notification.description"})})]})})};var Vt="Checkbox",[xu]=$e(Vt),[yu,Ln]=xu(Vt);function wu(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:a,name:c,onCheckedChange:u,required:d,value:f="on",internal_do_not_use_render:m}=e,[g,p]=Ge({prop:n,defaultProp:o??!1,onChange:u,caller:Vt}),[v,h]=l.useState(null),[x,w]=l.useState(null),y=l.useRef(!1),b=v?!!a||!!v.closest("form"):!0,C={checked:g,disabled:s,setChecked:p,control:v,setControl:h,name:c,form:a,value:f,hasConsumerStoppedPropagationRef:y,required:d,defaultChecked:Ce(o)?!1:o,isFormControl:b,bubbleInput:x,setBubbleInput:w};return i.jsx(yu,{scope:t,...C,children:bu(m)?m(C):r})}var os="CheckboxTrigger",ss=l.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:a,disabled:c,checked:u,required:d,setControl:f,setChecked:m,hasConsumerStoppedPropagationRef:g,isFormControl:p,bubbleInput:v}=Ln(os,e),h=F(o,f),x=l.useRef(u);return l.useEffect(()=>{const w=s?.form;if(w){const y=()=>m(x.current);return w.addEventListener("reset",y),()=>w.removeEventListener("reset",y)}},[s,m]),i.jsx(k.button,{type:"button",role:"checkbox","aria-checked":Ce(u)?"mixed":u,"aria-required":d,"data-state":ds(u),"data-disabled":c?"":void 0,disabled:c,value:a,...r,ref:h,onKeyDown:M(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:M(n,w=>{m(y=>Ce(y)?!0:!y),v&&p&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})})});ss.displayName=os;var as=l.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:a,disabled:c,value:u,onCheckedChange:d,form:f,...m}=e;return i.jsx(wu,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:c,required:a,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:g})=>i.jsxs(i.Fragment,{children:[i.jsx(ss,{...m,ref:t,__scopeCheckbox:n}),g&&i.jsx(us,{__scopeCheckbox:n})]})})});as.displayName=Vt;var is="CheckboxIndicator",cs=l.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=Ln(is,n);return i.jsx(Ne,{present:r||Ce(s.checked)||s.checked===!0,children:i.jsx(k.span,{"data-state":ds(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});cs.displayName=is;var ls="CheckboxBubbleInput",us=l.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:a,required:c,disabled:u,name:d,value:f,form:m,bubbleInput:g,setBubbleInput:p}=Ln(ls,e),v=F(n,p),h=wo(s),x=Vr(r);l.useEffect(()=>{const y=g;if(!y)return;const b=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(b,"checked").set,N=!o.current;if(h!==s&&P){const S=new Event("click",{bubbles:N});y.indeterminate=Ce(s),P.call(y,Ce(s)?!1:s),y.dispatchEvent(S)}},[g,h,s,o]);const w=l.useRef(Ce(s)?!1:s);return i.jsx(k.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??w.current,required:c,disabled:u,name:d,value:f,form:m,...t,tabIndex:-1,ref:v,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});us.displayName=ls;function bu(e){return typeof e=="function"}function Ce(e){return e==="indeterminate"}function ds(e){return Ce(e)?"indeterminate":e?"checked":"unchecked"}function vr({className:e,...t}){return i.jsx(as,{"data-slot":"checkbox",className:U("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsx(cs,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:i.jsx(Rr,{className:"size-3.5"})})})}const fs=()=>{const{data:e}=an({queryKey:zn.queryKey,queryFn:zn.queryFn}),t=l.useMemo(()=>new Set(e.flags.filter(r=>r.enabled).map(r=>r.name)),[e.flags]),n=l.useCallback(r=>t.has(r),[t]);return{flags:e.flags,isFlagEnabled:n}},Cu="en",Su=e=>{},Pu=({openingProjectId:e,showLabels:t=!0,showDescriptions:n=!0,className:r=""})=>{const o=l.useId(),s=l.useId(),a=l.useId(),c=l.useId(),u=l.useId(),{config:d,updateConfig:f}=Ys(),m=zs(),{theme:g}=qs(),{i18n:p}=Us(),{isFlagEnabled:v}=fs(),h=v("tool-approval"),x=l.useMemo(()=>Su()??Cu,[]),w=async()=>{const S={...d,hideNoUserMessageSession:!d?.hideNoUserMessageSession};f(S,{onSuccess:async()=>{await m.refetchQueries({queryKey:Xs.queryKey})}})},y=async()=>{const S={...d,unifySameTitleSession:!d?.unifySameTitleSession};f(S,{onSuccess:async()=>{await m.refetchQueries({queryKey:Gs(e).queryKey})}})},b=async S=>{const R={...d,enterKeyBehavior:S};f(R)},C=async S=>{const R={...d,permissionMode:S};f(R)},P=async S=>{const R={...d,locale:S};f(R)},N=async S=>{const R={...d,theme:S};f(R)};return i.jsxs("div",{className:`space-y-4 ${r}`,children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(vr,{id:o,checked:d?.hideNoUserMessageSession,onCheckedChange:w}),t&&i.jsx("label",{htmlFor:o,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:i.jsx(E,{id:"settings.session.hide_no_user_message"})})]}),n&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:i.jsx(E,{id:"settings.session.hide_no_user_message.description"})}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(vr,{id:`${o}-unify`,checked:d?.unifySameTitleSession,onCheckedChange:y}),t&&i.jsx("label",{htmlFor:`${o}-unify`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:i.jsx(E,{id:"settings.session.unify_same_title"})})]}),n&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:i.jsx(E,{id:"settings.session.unify_same_title.description"})}),i.jsxs("div",{className:"space-y-2",children:[t&&i.jsx("label",{htmlFor:s,className:"text-sm font-medium leading-none",children:i.jsx(E,{id:"settings.input.enter_key_behavior"})}),i.jsxs(rt,{value:d?.enterKeyBehavior||"shift-enter-send",onValueChange:b,children:[i.jsx(st,{id:s,className:"w-full",children:i.jsx(ot,{placeholder:p._("Select enter key behavior")})}),i.jsxs(at,{children:[i.jsx(ee,{value:"shift-enter-send",children:i.jsx(E,{id:"settings.input.enter_key_behavior.shift_enter"})}),i.jsx(ee,{value:"enter-send",children:i.jsx(E,{id:"settings.input.enter_key_behavior.enter"})}),i.jsx(ee,{value:"command-enter-send",children:i.jsx(E,{id:"settings.input.enter_key_behavior.command_enter"})})]})]}),n&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:i.jsx(E,{id:"settings.input.enter_key_behavior.description"})})]}),i.jsxs("div",{className:"space-y-2",children:[t&&i.jsx("label",{htmlFor:a,className:"text-sm font-medium leading-none",children:i.jsx(E,{id:"settings.permission.mode"})}),i.jsxs(rt,{value:d?.permissionMode||"default",onValueChange:C,disabled:!h,children:[i.jsx(st,{id:a,className:"w-full",children:i.jsx(ot,{placeholder:p._("Select permission mode")})}),i.jsxs(at,{children:[i.jsx(ee,{value:"default",children:i.jsx(E,{id:"settings.permission.mode.default"})}),i.jsx(ee,{value:"acceptEdits",children:i.jsx(E,{id:"settings.permission.mode.accept_edits"})}),i.jsx(ee,{value:"bypassPermissions",children:i.jsx(E,{id:"settings.permission.mode.bypass_permissions"})}),i.jsx(ee,{value:"plan",children:i.jsx(E,{id:"settings.permission.mode.plan"})})]})]}),n&&h&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:i.jsx(E,{id:"settings.permission.mode.description"})}),n&&!h&&i.jsx("p",{className:"text-xs text-destructive mt-1",children:i.jsx(E,{id:"settings.permission.mode.unavailable"})})]}),i.jsxs("div",{className:"space-y-2",children:[t&&i.jsx("label",{htmlFor:c,className:"text-sm font-medium leading-none",children:i.jsx(E,{id:"settings.locale"})}),i.jsxs(rt,{value:d?.locale||x,onValueChange:P,children:[i.jsx(st,{id:c,className:"w-full",children:i.jsx(ot,{placeholder:p._("Select language")})}),i.jsxs(at,{children:[i.jsx(ee,{value:"ja",children:i.jsx(E,{id:"settings.locale.ja"})}),i.jsx(ee,{value:"en",children:i.jsx(E,{id:"settings.locale.en"})}),i.jsx(ee,{value:"zh_CN",children:i.jsx(E,{id:"settings.locale.zh_CN"})})]})]}),n&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:i.jsx(E,{id:"settings.locale.description"})})]}),i.jsxs("div",{className:"space-y-2",children:[t&&i.jsx("label",{htmlFor:u,className:"text-sm font-medium leading-none",children:i.jsx(E,{id:"settings.theme"})}),i.jsxs(rt,{value:g??"system",onValueChange:N,children:[i.jsx(st,{id:u,className:"w-full",children:i.jsx(ot,{placeholder:p._("Select theme")})}),i.jsxs(at,{children:[i.jsx(ee,{value:"light",children:i.jsx(E,{id:"settings.theme.light"})}),i.jsx(ee,{value:"dark",children:i.jsx(E,{id:"settings.theme.dark"})}),i.jsx(ee,{value:"system",children:i.jsx(E,{id:"settings.theme.system"})})]})]}),n&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:i.jsx(E,{id:"settings.theme.description"})})]})]})},Eu=Qs("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function xr({className:e,variant:t,asChild:n=!1,...r}){const o=n?Ks:"span";return i.jsx(o,{"data-slot":"badge",className:U(Eu({variant:t}),e),...r})}var Yt="Collapsible",[Nu]=$e(Yt),[Tu,Wn]=Nu(Yt),ms=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:a,...c}=e,[u,d]=Ge({prop:r,defaultProp:o??!1,onChange:a,caller:Yt});return i.jsx(Tu,{scope:n,disabled:s,contentId:be(),open:u,onOpenToggle:l.useCallback(()=>d(f=>!f),[d]),children:i.jsx(k.div,{"data-state":$n(u),"data-disabled":s?"":void 0,...c,ref:t})})});ms.displayName=Yt;var hs="CollapsibleTrigger",ps=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=Wn(hs,n);return i.jsx(k.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":$n(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:M(e.onClick,o.onOpenToggle)})});ps.displayName=hs;var Fn="CollapsibleContent",gs=l.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Wn(Fn,e.__scopeCollapsible);return i.jsx(Ne,{present:n||o.open,children:({present:s})=>i.jsx(Ru,{...r,ref:t,present:s})})});gs.displayName=Fn;var Ru=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,a=Wn(Fn,n),[c,u]=l.useState(r),d=l.useRef(null),f=F(t,d),m=l.useRef(0),g=m.current,p=l.useRef(0),v=p.current,h=a.open||c,x=l.useRef(h),w=l.useRef(void 0);return l.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),G(()=>{const y=d.current;if(y){w.current=w.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const b=y.getBoundingClientRect();m.current=b.height,p.current=b.width,x.current||(y.style.transitionDuration=w.current.transitionDuration,y.style.animationName=w.current.animationName),u(r)}},[a.open,r]),i.jsx(k.div,{"data-state":$n(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!h,...s,ref:f,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:h&&o})});function $n(e){return e?"open":"closed"}var ju=ms;function Ou({...e}){return i.jsx(ju,{"data-slot":"collapsible",...e})}function Mu({...e}){return i.jsx(ps,{"data-slot":"collapsible-trigger",...e})}function ku({...e}){return i.jsx(gs,{"data-slot":"collapsible-content",...e})}const _u=e=>{switch(e){case"tool-approval":return{title:i.jsx(E,{id:"system_info.feature.tool_approval.title"}),description:i.jsx(E,{id:"system_info.feature.tool_approval.description"})};case"agent-sdk":return{title:i.jsx(E,{id:"system_info.feature.agent_sdk.title"}),description:i.jsx(E,{id:"system_info.feature.agent_sdk.description"})};default:return{title:e,description:i.jsx(E,{id:"system_info.feature.unknown.description"})}}},Au=()=>{const[e,t]=l.useState(!1),{data:n}=an({...Js}),{data:r}=an({...Zs}),{flags:o}=fs();return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsxs("div",{className:"border-b border-sidebar-border p-4",children:[i.jsx("h2",{className:"font-semibold text-lg",children:i.jsx(E,{id:"system_info.title"})}),i.jsx("p",{className:"text-xs text-sidebar-foreground/70",children:i.jsx(E,{id:"system_info.description"})})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-6",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsx("h3",{className:"font-medium text-sm text-sidebar-foreground",children:i.jsx(E,{id:"system_info.viewer_version"})}),i.jsxs("div",{className:"flex justify-between items-center pl-2",children:[i.jsx("span",{className:"text-xs text-sidebar-foreground/70",children:i.jsx(E,{id:"system_info.version_label"})}),i.jsxs(xr,{variant:"secondary",className:"text-xs font-mono",children:["v",n?.version||"Unknown"]})]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("h3",{className:"font-medium text-sm text-sidebar-foreground",children:i.jsx(E,{id:"system_info.claude_code"})}),i.jsxs("div",{className:"space-y-2 pl-2",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"text-xs text-sidebar-foreground/70",children:i.jsx(E,{id:"system_info.executable_path"})}),i.jsx("div",{className:"text-xs text-sidebar-foreground font-mono break-all",children:r?.executablePath||i.jsx("span",{className:"text-sidebar-foreground/50",children:i.jsx(E,{id:"system_info.unknown"})})})]}),i.jsxs("div",{className:"flex justify-between items-center pt-1",children:[i.jsx("span",{className:"text-xs text-sidebar-foreground/70",children:i.jsx(E,{id:"system_info.version_label"})}),i.jsx(xr,{variant:"secondary",className:"text-xs font-mono",children:r?.version||i.jsx(E,{id:"system_info.unknown"})})]})]})]}),i.jsx("div",{className:"space-y-3",children:i.jsxs(Ou,{open:e,onOpenChange:t,children:[i.jsxs(Mu,{className:"flex w-full items-center justify-between group",children:[i.jsx("h3",{className:"font-medium text-sm text-sidebar-foreground",children:i.jsx(E,{id:"system_info.available_features"})}),e?i.jsx(bn,{className:"h-4 w-4 text-sidebar-foreground/70 group-hover:text-sidebar-foreground transition-colors"}):i.jsx(ra,{className:"h-4 w-4 text-sidebar-foreground/70 group-hover:text-sidebar-foreground transition-colors"})]}),i.jsx(ku,{className:"pt-3",children:i.jsx(kn,{children:i.jsx("ul",{className:"space-y-2 pl-2",children:o.map(({name:s,enabled:a})=>{const c=_u(s);return i.jsxs("li",{className:"flex items-start gap-2",children:[a?i.jsx(ia,{className:"h-3.5 w-3.5 text-green-500 dark:text-green-400 mt-0.5 flex-shrink-0"}):i.jsx(la,{className:"h-3.5 w-3.5 text-sidebar-foreground/30 mt-0.5 flex-shrink-0"}),i.jsxs(po,{children:[i.jsx(go,{asChild:!0,children:i.jsx("span",{className:a?"text-xs text-sidebar-foreground cursor-help":"text-xs text-sidebar-foreground/50 line-through cursor-help",children:c.title})}),i.jsx(vo,{side:"right",className:"max-w-xs text-xs",children:c.description})]})]},s)})})})})]})})]})]})},ym=({projectId:e,className:t,additionalTabs:n=[],defaultActiveTab:r,headerButton:o})=>{const s={id:"settings",icon:va,title:i.jsx(E,{id:"settings.tab.title"}),content:i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsxs("div",{className:"border-b border-sidebar-border p-4",children:[i.jsx("h2",{className:"font-semibold text-lg",children:i.jsx(E,{id:"settings.title"})}),i.jsx("p",{className:"text-xs text-sidebar-foreground/70",children:i.jsx(E,{id:"settings.description"})})]}),i.jsx(l.Suspense,{fallback:i.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:i.jsx("div",{className:"text-sm text-sidebar-foreground/70",children:i.jsx(E,{id:"settings.loading"})})}),children:i.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"font-medium text-sm text-sidebar-foreground",children:i.jsx(E,{id:"settings.section.session_display"})}),i.jsx(Pu,{openingProjectId:e??""})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"font-medium text-sm text-sidebar-foreground",children:i.jsx(E,{id:"settings.section.notifications"})}),i.jsx(vu,{})]})]})})]})},a={id:"system-info",icon:fa,title:i.jsx(E,{id:"settings.section.system_info"}),content:i.jsx(l.Suspense,{fallback:i.jsx(sr,{}),children:i.jsx(Au,{})})},c=[...n,s,a],[u,d]=l.useState(r??c[c.length-1]?.id??"settings"),[f,m]=l.useState(!!r),g=v=>{u===v&&f?m(!1):(d(v),m(!0))},p=c.find(v=>v.id===u)?.content;return i.jsxs("div",{className:U("h-full border-r border-sidebar-border transition-all duration-300 ease-in-out flex bg-sidebar text-sidebar-foreground",f?"w-80 lg:w-80":"w-12",t),children:[i.jsx("div",{className:"w-12 flex flex-col border-r border-sidebar-border bg-sidebar/50",children:i.jsxs(kn,{children:[o&&i.jsx("div",{className:"border-b border-sidebar-border",children:o}),i.jsx("div",{className:"flex flex-col p-2 space-y-1",children:c.map(v=>{const h=v.icon;return i.jsxs(po,{children:[i.jsx(go,{asChild:!0,children:i.jsx("button",{type:"button",onClick:()=>g(v.id),className:U("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",u===v.id&&f?"bg-sidebar-accent text-sidebar-accent-foreground shadow-sm":"text-sidebar-foreground/70"),"data-testid":`${v.id}-tab-button`,children:i.jsx(h,{className:"w-4 h-4"})})}),i.jsx(vo,{side:"right",children:i.jsx("p",{children:v.title})})]},v.id)})})]})}),f&&i.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:i.jsx(l.Suspense,{fallback:i.jsx(sr,{}),children:p})})]})},vs=6048e5,Du=864e5,yr=Symbol.for("constructDateFrom");function Ee(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&yr in e?e[yr](t):e instanceof Date?new e.constructor(t):new Date(t)}function ce(e,t){return Ee(t||e,e)}let Iu={};function zt(){return Iu}function We(e,t){const n=zt(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=ce(e,t?.in),s=o.getDay(),a=(s<r?7:0)+s-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function Tt(e,t){return We(e,{...t,weekStartsOn:1})}function xs(e,t){const n=ce(e,t?.in),r=n.getFullYear(),o=Ee(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Tt(o),a=Ee(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const c=Tt(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function wr(e){const t=ce(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ys(e,...t){const n=Ee.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function br(e,t){const n=ce(e,t?.in);return n.setHours(0,0,0,0),n}function Lu(e,t,n){const[r,o]=ys(n?.in,e,t),s=br(r),a=br(o),c=+s-wr(s),u=+a-wr(a);return Math.round((c-u)/Du)}function Wu(e,t){const n=xs(e,t),r=Ee(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Tt(r)}function Fu(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function $u(e){return!(!Fu(e)&&typeof e!="number"||isNaN(+ce(e)))}function Bu(e,t){const n=ce(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Hu={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Vu=(e,t,n)=>{let r;const o=Hu[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function pe(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Yu={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zu={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},qu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Uu={date:pe({formats:Yu,defaultWidth:"full"}),time:pe({formats:zu,defaultWidth:"full"}),dateTime:pe({formats:qu,defaultWidth:"full"})},Xu={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Gu=(e,t,n,r)=>Xu[e];function Q(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,c=n?.width?String(n.width):a;o=e.formattingValues[c]||e.formattingValues[a]}else{const a=e.defaultWidth,c=n?.width?String(n.width):e.defaultWidth;o=e.values[c]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const Ku={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Qu={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ju={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Zu={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ed={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},td={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},nd=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},rd={ordinalNumber:nd,era:Q({values:Ku,defaultWidth:"wide"}),quarter:Q({values:Qu,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Q({values:Ju,defaultWidth:"wide"}),day:Q({values:Zu,defaultWidth:"wide"}),dayPeriod:Q({values:ed,defaultWidth:"wide",formattingValues:td,defaultFormattingWidth:"wide"})};function J(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const a=s[0],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(c)?sd(c,m=>m.test(a)):od(c,m=>m.test(a));let d;d=e.valueCallback?e.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=t.slice(a.length);return{value:d,rest:f}}}function od(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function sd(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Bn(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const c=t.slice(o.length);return{value:a,rest:c}}}const ad=/^(\d+)(th|st|nd|rd)?/i,id=/\d+/i,cd={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ld={any:[/^b/i,/^(a|c)/i]},ud={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},dd={any:[/1/i,/2/i,/3/i,/4/i]},fd={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},md={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},hd={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},pd={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},gd={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},vd={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},xd={ordinalNumber:Bn({matchPattern:ad,parsePattern:id,valueCallback:e=>parseInt(e,10)}),era:J({matchPatterns:cd,defaultMatchWidth:"wide",parsePatterns:ld,defaultParseWidth:"any"}),quarter:J({matchPatterns:ud,defaultMatchWidth:"wide",parsePatterns:dd,defaultParseWidth:"any",valueCallback:e=>e+1}),month:J({matchPatterns:fd,defaultMatchWidth:"wide",parsePatterns:md,defaultParseWidth:"any"}),day:J({matchPatterns:hd,defaultMatchWidth:"wide",parsePatterns:pd,defaultParseWidth:"any"}),dayPeriod:J({matchPatterns:gd,defaultMatchWidth:"any",parsePatterns:vd,defaultParseWidth:"any"})},wn={code:"en-US",formatDistance:Vu,formatLong:Uu,formatRelative:Gu,localize:rd,match:xd,options:{weekStartsOn:0,firstWeekContainsDate:1}};function yd(e,t){const n=ce(e,t?.in);return Lu(n,Bu(n))+1}function wd(e,t){const n=ce(e,t?.in),r=+Tt(n)-+Wu(n);return Math.round(r/vs)+1}function ws(e,t){const n=ce(e,t?.in),r=n.getFullYear(),o=zt(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=Ee(t?.in||e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const c=We(a,t),u=Ee(t?.in||e,0);u.setFullYear(r,0,s),u.setHours(0,0,0,0);const d=We(u,t);return+n>=+c?r+1:+n>=+d?r:r-1}function bd(e,t){const n=zt(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=ws(e,t),s=Ee(t?.in||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),We(s,t)}function Cd(e,t){const n=ce(e,t?.in),r=+We(n,t)-+bd(n,t);return Math.round(r/vs)+1}function L(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ye={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return L(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):L(n+1,2)},d(e,t){return L(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return L(e.getHours()%12||12,t.length)},H(e,t){return L(e.getHours(),t.length)},m(e,t){return L(e.getMinutes(),t.length)},s(e,t){return L(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return L(o,t.length)}},ze={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Cr={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return ye.y(e,t)},Y:function(e,t,n,r){const o=ws(e,r),s=o>0?o:1-o;if(t==="YY"){const a=s%100;return L(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):L(s,t.length)},R:function(e,t){const n=xs(e);return L(n,t.length)},u:function(e,t){const n=e.getFullYear();return L(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return L(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return L(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return ye.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return L(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Cd(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):L(o,t.length)},I:function(e,t,n){const r=wd(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):L(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ye.d(e,t)},D:function(e,t,n){const r=yd(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):L(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return L(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return L(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return L(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=ze.noon:r===0?o=ze.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=ze.evening:r>=12?o=ze.afternoon:r>=4?o=ze.morning:o=ze.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ye.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ye.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):L(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):L(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ye.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ye.s(e,t)},S:function(e,t){return ye.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Pr(r);case"XXXX":case"XX":return _e(r);case"XXXXX":case"XXX":default:return _e(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Pr(r);case"xxxx":case"xx":return _e(r);case"xxxxx":case"xxx":default:return _e(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Sr(r,":");case"OOOO":default:return"GMT"+_e(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Sr(r,":");case"zzzz":default:return"GMT"+_e(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return L(r,t.length)},T:function(e,t,n){return L(+e,t.length)}};function Sr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+L(s,2)}function Pr(e,t){return e%60===0?(e>0?"-":"+")+L(Math.abs(e)/60,2):_e(e,t)}function _e(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=L(Math.trunc(r/60),2),s=L(r%60,2);return n+o+t+s}const Er=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},bs=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Sd=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Er(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Er(r,t)).replace("{{time}}",bs(o,t))},Pd={p:bs,P:Sd},Ed=/^D+$/,Nd=/^Y+$/,Td=["D","DD","YY","YYYY"];function Rd(e){return Ed.test(e)}function jd(e){return Nd.test(e)}function Od(e,t,n){const r=Md(e,t,n);if(console.warn(r),Td.includes(e))throw new RangeError(r)}function Md(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const kd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_d=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ad=/^'([^]*?)'?$/,Dd=/''/g,Id=/[a-zA-Z]/;function Ld(e,t,n){const r=zt(),o=n?.locale??r.locale??wn,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,c=ce(e,n?.in);if(!$u(c))throw new RangeError("Invalid time value");let u=t.match(_d).map(f=>{const m=f[0];if(m==="p"||m==="P"){const g=Pd[m];return g(f,o.formatLong)}return f}).join("").match(kd).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:Wd(f)};if(Cr[m])return{isToken:!0,value:f};if(m.match(Id))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});o.localize.preprocessor&&(u=o.localize.preprocessor(c,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:o};return u.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!n?.useAdditionalWeekYearTokens&&jd(m)||!n?.useAdditionalDayOfYearTokens&&Rd(m))&&Od(m,t,String(e));const g=Cr[m[0]];return g(c,m,o.localize,d)}).join("")}function Wd(e){const t=e.match(Ad);return t?t[1].replace(Dd,"'"):e}function Fd(e,t,n){const[r,o]=ys(n?.in,e,t);return+We(r,n)==+We(o,n)}const $d={lessThanXSeconds:{one:"1秒未満",other:"{{count}}秒未満",oneWithSuffix:"約1秒",otherWithSuffix:"約{{count}}秒"},xSeconds:{one:"1秒",other:"{{count}}秒"},halfAMinute:"30秒",lessThanXMinutes:{one:"1分未満",other:"{{count}}分未満",oneWithSuffix:"約1分",otherWithSuffix:"約{{count}}分"},xMinutes:{one:"1分",other:"{{count}}分"},aboutXHours:{one:"約1時間",other:"約{{count}}時間"},xHours:{one:"1時間",other:"{{count}}時間"},xDays:{one:"1日",other:"{{count}}日"},aboutXWeeks:{one:"約1週間",other:"約{{count}}週間"},xWeeks:{one:"1週間",other:"{{count}}週間"},aboutXMonths:{one:"約1か月",other:"約{{count}}か月"},xMonths:{one:"1か月",other:"{{count}}か月"},aboutXYears:{one:"約1年",other:"約{{count}}年"},xYears:{one:"1年",other:"{{count}}年"},overXYears:{one:"1年以上",other:"{{count}}年以上"},almostXYears:{one:"1年近く",other:"{{count}}年近く"}},Bd=(e,t,n)=>{n=n||{};let r;const o=$d[e];return typeof o=="string"?r=o:t===1?n.addSuffix&&o.oneWithSuffix?r=o.oneWithSuffix:r=o.one:n.addSuffix&&o.otherWithSuffix?r=o.otherWithSuffix.replace("{{count}}",String(t)):r=o.other.replace("{{count}}",String(t)),n.addSuffix?n.comparison&&n.comparison>0?r+"後":r+"前":r},Hd={full:"y年M月d日EEEE",long:"y年M月d日",medium:"y/MM/dd",short:"y/MM/dd"},Vd={full:"H時mm分ss秒 zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},Yd={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},zd={date:pe({formats:Hd,defaultWidth:"full"}),time:pe({formats:Vd,defaultWidth:"full"}),dateTime:pe({formats:Yd,defaultWidth:"full"})},qd={lastWeek:"先週のeeeeのp",yesterday:"昨日のp",today:"今日のp",tomorrow:"明日のp",nextWeek:"翌週のeeeeのp",other:"P"},Ud=(e,t,n,r)=>qd[e],Xd={narrow:["BC","AC"],abbreviated:["紀元前","西暦"],wide:["紀元前","西暦"]},Gd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["第1四半期","第2四半期","第3四半期","第4四半期"]},Kd={narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]},Qd={narrow:["日","月","火","水","木","金","土"],short:["日","月","火","水","木","金","土"],abbreviated:["日","月","火","水","木","金","土"],wide:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"]},Jd={narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},Zd={narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},ef=(e,t)=>{const n=Number(e);switch(String(t?.unit)){case"year":return`${n}年`;case"quarter":return`第${n}四半期`;case"month":return`${n}月`;case"week":return`第${n}週`;case"date":return`${n}日`;case"hour":return`${n}時`;case"minute":return`${n}分`;case"second":return`${n}秒`;default:return`${n}`}},tf={ordinalNumber:ef,era:Q({values:Xd,defaultWidth:"wide"}),quarter:Q({values:Gd,defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:Q({values:Kd,defaultWidth:"wide"}),day:Q({values:Qd,defaultWidth:"wide"}),dayPeriod:Q({values:Jd,defaultWidth:"wide",formattingValues:Zd,defaultFormattingWidth:"wide"})},nf=/^第?\d+(年|四半期|月|週|日|時|分|秒)?/i,rf=/\d+/i,of={narrow:/^(B\.?C\.?|A\.?D\.?)/i,abbreviated:/^(紀元[前後]|西暦)/i,wide:/^(紀元[前後]|西暦)/i},sf={narrow:[/^B/i,/^A/i],any:[/^(紀元前)/i,/^(西暦|紀元後)/i]},af={narrow:/^[1234]/i,abbreviated:/^Q[1234]/i,wide:/^第[1234一二三四1234]四半期/i},cf={any:[/(1|一|1)/i,/(2|二|2)/i,/(3|三|3)/i,/(4|四|4)/i]},lf={narrow:/^([123456789]|1[012])/,abbreviated:/^([123456789]|1[012])月/i,wide:/^([123456789]|1[012])月/i},uf={any:[/^1\D/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},df={narrow:/^[日月火水木金土]/,short:/^[日月火水木金土]/,abbreviated:/^[日月火水木金土]/,wide:/^[日月火水木金土]曜日/},ff={any:[/^日/,/^月/,/^火/,/^水/,/^木/,/^金/,/^土/]},mf={any:/^(AM|PM|午前|午後|正午|深夜|真夜中|夜|朝)/i},hf={any:{am:/^(A|午前)/i,pm:/^(P|午後)/i,midnight:/^深夜|真夜中/i,noon:/^正午/i,morning:/^朝/i,afternoon:/^午後/i,evening:/^夜/i,night:/^深夜/i}},pf={ordinalNumber:Bn({matchPattern:nf,parsePattern:rf,valueCallback:function(e){return parseInt(e,10)}}),era:J({matchPatterns:of,defaultMatchWidth:"wide",parsePatterns:sf,defaultParseWidth:"any"}),quarter:J({matchPatterns:af,defaultMatchWidth:"wide",parsePatterns:cf,defaultParseWidth:"any",valueCallback:e=>e+1}),month:J({matchPatterns:lf,defaultMatchWidth:"wide",parsePatterns:uf,defaultParseWidth:"any"}),day:J({matchPatterns:df,defaultMatchWidth:"wide",parsePatterns:ff,defaultParseWidth:"any"}),dayPeriod:J({matchPatterns:mf,defaultMatchWidth:"any",parsePatterns:hf,defaultParseWidth:"any"})},gf={code:"ja",formatDistance:Bd,formatLong:zd,formatRelative:Ud,localize:tf,match:pf,options:{weekStartsOn:0,firstWeekContainsDate:1}},vf={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},xf=(e,t,n)=>{let r;const o=vf[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},yf={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},wf={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},bf={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Cf={date:pe({formats:yf,defaultWidth:"full"}),time:pe({formats:wf,defaultWidth:"full"}),dateTime:pe({formats:bf,defaultWidth:"full"})};function Nr(e,t,n){const r="eeee p";return Fd(e,t,n)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const Sf={lastWeek:Nr,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:Nr,other:"PP p"},Pf=(e,t,n,r)=>{const o=Sf[e];return typeof o=="function"?o(t,n,r):o},Ef={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},Nf={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},Tf={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},Rf={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},jf={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Of={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Mf=(e,t)=>{const n=Number(e);switch(t?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},kf={ordinalNumber:Mf,era:Q({values:Ef,defaultWidth:"wide"}),quarter:Q({values:Nf,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Q({values:Tf,defaultWidth:"wide"}),day:Q({values:Rf,defaultWidth:"wide"}),dayPeriod:Q({values:jf,defaultWidth:"wide",formattingValues:Of,defaultFormattingWidth:"wide"})},_f=/^(第\s*)?\d+(日|时|分|秒)?/i,Af=/\d+/i,Df={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},If={any:[/^(前)/i,/^(公元)/i]},Lf={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},Wf={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},Ff={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},$f={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Bf={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},Hf={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Vf={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},Yf={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},zf={ordinalNumber:Bn({matchPattern:_f,parsePattern:Af,valueCallback:e=>parseInt(e,10)}),era:J({matchPatterns:Df,defaultMatchWidth:"wide",parsePatterns:If,defaultParseWidth:"any"}),quarter:J({matchPatterns:Lf,defaultMatchWidth:"wide",parsePatterns:Wf,defaultParseWidth:"any",valueCallback:e=>e+1}),month:J({matchPatterns:Ff,defaultMatchWidth:"wide",parsePatterns:$f,defaultParseWidth:"any"}),day:J({matchPatterns:Bf,defaultMatchWidth:"wide",parsePatterns:Hf,defaultParseWidth:"any"}),dayPeriod:J({matchPatterns:Vf,defaultMatchWidth:"any",parsePatterns:Yf,defaultParseWidth:"any"})},qf={code:"zh-CN",formatDistance:xf,formatLong:Cf,formatRelative:Pf,localize:kf,match:zf,options:{weekStartsOn:1,firstWeekContainsDate:4}},Uf=e=>{switch(e){case"ja":return gf;case"en":return wn;case"zh_CN":return qf;default:return wn}},wm=(e,t)=>{const{locale:n="en",target:r="time"}=t,o=typeof e=="string"?new Date(e):e,s=Uf(n),c=((u,d)=>{if(u==="ja")switch(d){case"month":return"yyyy年M月";case"day":return"yyyy年M月d日";case"time":return"yyyy年M月d日 HH:mm"}else if(u==="en")switch(d){case"month":return"MM/yyyy";case"day":return"MM/dd/yyyy";case"time":return"MM/dd/yyyy HH:mm"}else if(u==="zh_CN")switch(d){case"month":return"yyyy年M月";case"day":return"yyyy年M月d日";case"time":return"yyyy年M月d日 HH:mm"}switch(d){case"month":return"yyyy-MM";case"day":return"yyyy-MM-dd";case"time":return"yyyy-MM-dd HH:mm"}})(n,r);return Ld(o,c,{locale:s})};var qt="Dialog",[Cs]=$e(qt),[Xf,le]=Cs(qt),Ss=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,c=l.useRef(null),u=l.useRef(null),[d,f]=Ge({prop:r,defaultProp:o??!1,onChange:s,caller:qt});return i.jsx(Xf,{scope:t,triggerRef:c,contentRef:u,contentId:be(),titleId:be(),descriptionId:be(),open:d,onOpenChange:f,onOpenToggle:l.useCallback(()=>f(m=>!m),[f]),modal:a,children:n})};Ss.displayName=qt;var Ps="DialogTrigger",Es=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=le(Ps,n),s=F(t,o.triggerRef);return i.jsx(k.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Yn(o.open),...r,ref:s,onClick:M(e.onClick,o.onOpenToggle)})});Es.displayName=Ps;var Hn="DialogPortal",[Gf,Ns]=Cs(Hn,{forceMount:void 0}),Ts=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=le(Hn,t);return i.jsx(Gf,{scope:t,forceMount:n,children:l.Children.map(r,a=>i.jsx(Ne,{present:n||s.open,children:i.jsx(It,{asChild:!0,container:o,children:a})}))})};Ts.displayName=Hn;var Rt="DialogOverlay",Rs=l.forwardRef((e,t)=>{const n=Ns(Rt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=le(Rt,e.__scopeDialog);return s.modal?i.jsx(Ne,{present:r||s.open,children:i.jsx(Qf,{...o,ref:t})}):null});Rs.displayName=Rt;var Kf=it("DialogOverlay.RemoveScroll"),Qf=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=le(Rt,n);return i.jsx(An,{as:Kf,allowPinchZoom:!0,shards:[o.contentRef],children:i.jsx(k.div,{"data-state":Yn(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Fe="DialogContent",js=l.forwardRef((e,t)=>{const n=Ns(Fe,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=le(Fe,e.__scopeDialog);return i.jsx(Ne,{present:r||s.open,children:s.modal?i.jsx(Jf,{...o,ref:t}):i.jsx(Zf,{...o,ref:t})})});js.displayName=Fe;var Jf=l.forwardRef((e,t)=>{const n=le(Fe,e.__scopeDialog),r=l.useRef(null),o=F(t,n.contentRef,r);return l.useEffect(()=>{const s=r.current;if(s)return Co(s)},[]),i.jsx(Os,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:M(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:M(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&s.preventDefault()}),onFocusOutside:M(e.onFocusOutside,s=>s.preventDefault())})}),Zf=l.forwardRef((e,t)=>{const n=le(Fe,e.__scopeDialog),r=l.useRef(!1),o=l.useRef(!1);return i.jsx(Os,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Os=l.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...a}=e,c=le(Fe,n),u=l.useRef(null),d=F(t,u);return xo(),i.jsxs(i.Fragment,{children:[i.jsx(_n,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:i.jsx(Ot,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Yn(c.open),...a,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(em,{titleId:c.titleId}),i.jsx(nm,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Vn="DialogTitle",Ms=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=le(Vn,n);return i.jsx(k.h2,{id:o.titleId,...r,ref:t})});Ms.displayName=Vn;var ks="DialogDescription",_s=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=le(ks,n);return i.jsx(k.p,{id:o.descriptionId,...r,ref:t})});_s.displayName=ks;var As="DialogClose",Ds=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=le(As,n);return i.jsx(k.button,{type:"button",...r,ref:t,onClick:M(e.onClick,()=>o.onOpenChange(!1))})});Ds.displayName=As;function Yn(e){return e?"open":"closed"}var Is="DialogTitleWarning",[bm,Ls]=wa(Is,{contentName:Fe,titleName:Vn,docsSlug:"dialog"}),em=({titleId:e})=>{const t=Ls(Is),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
102
102
 
103
103
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
104
104
 
105
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},tm="DialogDescriptionWarning",nm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ls(tm).contentName}}.`;return l.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},rm=Ss,om=Es,sm=Ts,am=Rs,im=js,cm=Ms,lm=_s,um=Ds;function Cm({...e}){return i.jsx(rm,{"data-slot":"dialog",...e})}function Sm({...e}){return i.jsx(om,{"data-slot":"dialog-trigger",...e})}function dm({...e}){return i.jsx(sm,{"data-slot":"dialog-portal",...e})}function fm({className:e,...t}){return i.jsx(am,{"data-slot":"dialog-overlay",className:U("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Pm({className:e,children:t,showCloseButton:n=!0,...r}){return i.jsxs(dm,{"data-slot":"dialog-portal",children:[i.jsx(fm,{}),i.jsxs(im,{"data-slot":"dialog-content",className:U("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200",e),...r,children:[t,n&&i.jsxs(um,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[i.jsx(ya,{}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Em({className:e,...t}){return i.jsx("div",{"data-slot":"dialog-header",className:U("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Nm({className:e,...t}){return i.jsx("div",{"data-slot":"dialog-footer",className:U("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Tm({className:e,...t}){return i.jsx(cm,{"data-slot":"dialog-title",className:U("text-lg leading-none font-semibold",e),...t})}function Rm({className:e,...t}){return i.jsx(lm,{"data-slot":"dialog-description",className:U("text-muted-foreground text-sm",e),...t})}const mm=l.forwardRef(({className:e,children:t,...n},r)=>i.jsx("label",{ref:r,className:U("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...n,children:t}));mm.displayName="Label";export{sr as $,eo as A,xr as B,vr as C,Cm as D,Ot as E,pm as F,ym as G,to as H,no as I,rs as J,xm as K,mm as L,hu as M,sa as N,st as O,gm as P,ot as Q,Zr as R,rt as S,at as T,ee as U,Rr as V,po as W,ya as X,go as Y,vo as Z,fa as _,ra as a,kn as a0,va as a1,Au as a2,Pu as a3,vu as a4,Sm as b,Pm as c,Em as d,Tm as e,wm as f,Rm as g,Nm as h,ha as i,Ou as j,Mu as k,bn as l,ku as m,Dt as n,Ge as o,$e as p,be as q,k as r,M as s,Ne as t,vm as u,It as v,Co as w,An as x,xo as y,_n as z};
105
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},tm="DialogDescriptionWarning",nm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ls(tm).contentName}}.`;return l.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},rm=Ss,om=Es,sm=Ts,am=Rs,im=js,cm=Ms,lm=_s,um=Ds;function Cm({...e}){return i.jsx(rm,{"data-slot":"dialog",...e})}function Sm({...e}){return i.jsx(om,{"data-slot":"dialog-trigger",...e})}function dm({...e}){return i.jsx(sm,{"data-slot":"dialog-portal",...e})}function fm({className:e,...t}){return i.jsx(am,{"data-slot":"dialog-overlay",className:U("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Pm({className:e,children:t,showCloseButton:n=!0,...r}){return i.jsxs(dm,{"data-slot":"dialog-portal",children:[i.jsx(fm,{}),i.jsxs(im,{"data-slot":"dialog-content",className:U("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200",e),...r,children:[t,n&&i.jsxs(um,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[i.jsx(ya,{}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Em({className:e,...t}){return i.jsx("div",{"data-slot":"dialog-header",className:U("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Nm({className:e,...t}){return i.jsx("div",{"data-slot":"dialog-footer",className:U("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Tm({className:e,...t}){return i.jsx(cm,{"data-slot":"dialog-title",className:U("text-lg leading-none font-semibold",e),...t})}function Rm({className:e,...t}){return i.jsx(lm,{"data-slot":"dialog-description",className:U("text-muted-foreground text-sm",e),...t})}const mm=l.forwardRef(({className:e,children:t,...n},r)=>i.jsx("label",{ref:r,className:U("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...n,children:t}));mm.displayName="Label";export{fa as $,eo as A,xr as B,vr as C,Cm as D,Ot as E,pm as F,ym as G,to as H,no as I,rs as J,xm as K,mm as L,hu as M,la as N,sa as O,gm as P,st as Q,Zr as R,rt as S,ot as T,at as U,ee as V,Rr as W,ya as X,po as Y,go as Z,vo as _,ra as a,sr as a0,kn as a1,va as a2,Au as a3,Pu as a4,vu as a5,Sm as b,Pm as c,Em as d,Tm as e,wm as f,Rm as g,Nm as h,ha as i,Ou as j,Mu as k,bn as l,ku as m,Dt as n,Ge as o,$e as p,be as q,k as r,M as s,Ne as t,vm as u,It as v,Co as w,An as x,xo as y,_n as z};