dsh-git-ui 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +1 -1
- package/lib/client.js.map +3 -3
- package/package.json +1 -1
- package/src/adapters/dsh/client-adapter.ts +27 -10
package/lib/client.js
CHANGED
|
@@ -3,7 +3,7 @@ window.__ModuleLoader__.load({ id: "dsh-git-ui", factory: (require) => {
|
|
|
3
3
|
"use strict";var Ri=Object.defineProperty;var Gh=Object.getOwnPropertyDescriptor;var Fh=Object.getOwnPropertyNames;var Mh=Object.prototype.hasOwnProperty;var Ie=(e,r)=>{for(var n in r)Ri(e,n,{get:r[n],enumerable:!0})},Bh=(e,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of Fh(r))!Mh.call(e,t)&&t!==n&&Ri(e,t,{get:()=>r[t],enumerable:!(o=Gh(r,t))||o.enumerable});return e};var Jh=e=>Bh(Ri({},"__esModule",{value:!0}),e);var Tx={};Ie(Tx,{apply:()=>Ux,inject:()=>jx,name:()=>Dx});module.exports=Jh(Tx);var ku=require("react");var Y=require("react"),xm=require("react-dom");function Tu(e){let r=0;for(let n of e.turnEnds.keys())n>r&&(r=n);return r}var Or=require("react"),Zu=require("react/jsx-runtime"),Nu=(0,Or.createContext)(null);function Wt(){let e=(0,Or.useContext)(Nu);if(e===null)throw new Error("useUI(): missing <UIPrimitivesProvider> \u2014 \u63D2\u4EF6\u5165\u53E3\u672A\u6CE8\u5165 UI \u57FA\u7840\u7EC4\u4EF6");return e}function Eu({value:e,children:r}){return(0,Zu.jsx)(Nu.Provider,{value:e,children:r})}var j=require("react");var Ht=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#06B6D4","#84CC16","#F97316","#6366F1","#14B8A6","#E11D48","#0EA5E9","#A855F7","#22C55E","#F43F5E"];function Ru(e,r){let n=e.indexOf(null),o=n===-1?(e.push(null),e.length-1):n;return r.add(o),o}function Vh(e,r){let n=new Set,o=[];r.forEach((v,g)=>{v===e.hash&&o.push(g)});let t=o.length>0?o[0]:Ru(r,n),i=o.length>0,a=o.slice(1);for(let v of o)r[v]=null;let s=[],l=e.parents[0],c=!1;l!==void 0&&(r[t]=l,c=!0);for(let v=1;v<e.parents.length;v+=1){let g=e.parents[v],k=r.indexOf(g);k===-1&&(k=Ru(r,n),r[k]=g),s.push({from:t,to:k})}let d=new Set(a);d.add(t);let f=[];return r.forEach((v,g)=>{v===null||d.has(g)||n.has(g)||f.push(g)}),{commit:e,column:t,verticals:f,joins:a,nodeFromTop:i,nodeContinues:c,edges:s}}function Ur(){let e=[],r=0;return{get count(){return r},append(n){let o=[];for(let t of n)o.push(Vh(t,e)),r+=1;return o}}}function Au(e){let r=0,n=o=>{o+1>r&&(r=o+1)};for(let o of e){n(o.column);for(let t of o.verticals)n(t);for(let t of o.joins)n(t);for(let t of o.edges)n(t.to)}return r}function Lu(e,r,n){return n?e.map(o=>{if(!o.nodeContinues)return o;let t=o.commit.parents[0];return t!==void 0&&!r.has(t)?{...o,endOpen:!0}:o}):e}function Gu(e,r){return{name:e,path:r,dir:!0,children:new Map}}function Kt(e,r){let n=r??e.endsWith("/"),o=e.replace(/\/+$/,""),t=o.lastIndexOf("/");return t===-1?{name:o,dir:"",isDir:n}:{name:o.slice(t+1),dir:o.slice(0,t),isDir:n}}function Fu(e){let r=Gu("","");for(let n of e){let o=n.path.endsWith("/"),t=n.path.split("/").filter(s=>s!=="");if(t.length===0)continue;let i=r,a="";for(let s=0;s<t.length;s+=1){let l=t[s];a=a===""?l:`${a}/${l}`;let c=s===t.length-1,d=i.children.get(l);d===void 0&&(d=c?{name:l,path:a,dir:o,children:new Map,...o?{}:{status:n.status}}:Gu(l,a),i.children.set(l,d)),i=d}}return Mu(r.children)}function Mu(e){let r=[];for(let n of e.values())r.push({name:n.name,path:n.path,dir:n.dir,children:n.dir?Mu(n.children):[],...n.status===void 0?{}:{status:n.status}});return r.sort((n,o)=>n.dir!==o.dir?n.dir?-1:1:n.name.localeCompare(o.name)),r}var Bu=e=>String(e).padStart(2,"0");function Tr(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function Ju(e,r,n){let o=Date.parse(e);if(!Number.isFinite(o))return e;let t=new Date(o),i=`${Bu(t.getHours())}:${Bu(t.getMinutes())}`,a=Math.floor((r-o)/1e3);return a>=0&&a<3600?n.minutesAgo(Math.max(1,Math.floor(a/60))):Tr(t)===Tr(new Date(r))?`${n.today} ${i}`:Tr(t)===Tr(new Date(r-864e5))?`${n.yesterday} ${i}`:`${t.getFullYear()}/${t.getMonth()+1}/${t.getDate()} ${i}`}function Ai(e){if(e==="")return[];let r=[],n=0,o=0,t=[],i=[],a=()=>{let s=Math.max(t.length,i.length);for(let l=0;l<s;l+=1){let c=t[l],d=i[l];r.push({left:c!==void 0?{num:n+=1,text:c,kind:"del"}:{num:null,text:"",kind:"empty"},right:d!==void 0?{num:o+=1,text:d,kind:"add"}:{num:null,text:"",kind:"empty"}})}t=[],i=[]};for(let s of e.split(`
|
|
4
4
|
`)){if(s.startsWith("@@")){a();let c=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(s);c!==null&&(n=Number(c[1])-1,o=Number(c[2])-1);continue}if(/^(diff --git|index |--- |\+\+\+ |new file |deleted file |old mode |new mode |similarity index |rename from |rename to |Binary files |GIT binary patch)/.test(s)){a();continue}if(s.startsWith("-")){i.length>0&&a(),t.push(s.slice(1));continue}if(s.startsWith("+")){i.push(s.slice(1));continue}if(a(),s==="")continue;let l=s.slice(1);r.push({left:{num:n+=1,text:l,kind:"context"},right:{num:o+=1,text:l,kind:"context"}})}return a(),r}function Vu(e,r){return e.length>r?e.slice(0,r):e}function Wu(e){let r=0,n=0;for(let o of e)o.left.kind==="del"&&(n+=1),o.right.kind==="add"&&(r+=1);return{add:r,del:n}}function Hu(e){return/^Binary files /m.test(e)}function ze(e){return e.status==="untracked"?"worktree":e.staged?"staged":"worktree"}function Ku(e,r){let n=r.filter(t=>t.path===e.path);return n.length===0?null:n.find(t=>ze(t)===e.base)!==void 0?{path:e.path,base:e.base}:{path:e.path,base:ze(n[0])}}function Xu(e,r,n){if(e.length===0)return null;if(r===null){let a=e[0];return{path:a.path,base:ze(a)}}let o=e.findIndex(a=>a.path===r.path&&ze(a)===r.base),i=e[((o===-1?0:o)+n+e.length)%e.length];return{path:i.path,base:ze(i)}}var D=require("react/jsx-runtime");function ct({open:e}){return(0,D.jsx)("svg",{width:10,height:10,viewBox:"0 0 10 10",style:{display:"block",flex:"none",transform:e?"rotate(90deg)":"none",transition:"transform var(--ds-transition-duration-fast) var(--ds-ease-in-out)"},"aria-hidden":"true",children:(0,D.jsx)("path",{d:"M3 1.5 L7 5 L3 8.5",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function Xe(){return(0,D.jsx)("svg",{width:12,height:12,viewBox:"0 0 12 12",style:{display:"block",flex:"none"},"aria-hidden":"true",children:(0,D.jsx)("path",{d:"M1 3 a1 1 0 0 1 1-1 h2.6 l1.2 1.4 H10 a1 1 0 0 1 1 1 V9 a1 1 0 0 1-1 1 H2 a1 1 0 0 1-1-1 Z",fill:"currentColor",opacity:.75})})}function Xt(){return(0,D.jsx)("svg",{width:12,height:12,viewBox:"0 0 12 12",style:{display:"block",flex:"none"},"aria-hidden":"true",children:(0,D.jsx)("path",{d:"M3 1 h4 l2.5 2.5 V11 h-6.5 Z M7 1 v2.5 h2.5",fill:"none",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})})}function Li(){return(0,D.jsxs)("svg",{width:12,height:12,viewBox:"0 0 12 12",style:{display:"block",flex:"none"},"aria-hidden":"true",children:[(0,D.jsx)("path",{d:"M3 1 h4 l2.5 2.5 V11 h-6.5 Z M7 1 v2.5 h2.5",fill:"none",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,D.jsx)("path",{d:"M5 5.5 L4.2 7 L5 8.5 M7 5.5 L7.8 7 L7 8.5",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})]})}function qu(){return(0,D.jsxs)("svg",{width:12,height:12,viewBox:"0 0 12 12",style:{display:"block",flex:"none"},"aria-hidden":"true",children:[(0,D.jsx)("path",{d:"M3 1 h4 l2.5 2.5 V11 h-6.5 Z M7 1 v2.5 h2.5",fill:"none",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,D.jsx)("circle",{cx:6,cy:7,r:1.4,fill:"none",stroke:"currentColor",strokeWidth:1}),(0,D.jsx)("path",{d:"M6 5 V5.6 M6 8.4 V9 M4.6 7 H5.2 M6.8 7 H7.4",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round"})]})}function Yu(){return(0,D.jsxs)("svg",{width:12,height:12,viewBox:"0 0 12 12",style:{display:"block",flex:"none"},"aria-hidden":"true",children:[(0,D.jsx)("path",{d:"M3 1 h4 l2.5 2.5 V11 h-6.5 Z M7 1 v2.5 h2.5",fill:"none",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,D.jsx)("path",{d:"M4.5 5 H7.5 M4.5 6.5 H7.5 M4.5 8 H6.5",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round"})]})}function Wh(){return(0,D.jsxs)("svg",{width:12,height:12,viewBox:"0 0 12 12",style:{display:"block",flex:"none"},"aria-hidden":"true",children:[(0,D.jsx)("path",{d:"M3 1 h4 l2.5 2.5 V11 h-6.5 Z M7 1 v2.5 h2.5",fill:"none",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,D.jsx)("path",{d:"M4 8.5 L5.5 6.5 L7 8.5 M6.5 8.5 L7.5 7 L8.5 8.5",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})]})}var Hh=new Set(["ts","tsx","js","jsx","mjs","cjs","py","go","rs","rb","java","kt","kts","swift","c","h","cpp","cc","cxx","hpp","hxx","cs","vb","php","vue","svelte","sh","bash","zsh","fish","ps1","bat","cmd","lua","r","scala","clj","ex","exs","erl","elm","dart","groovy","gradle","ml","fs","fsx","pl","pm","tcl"]),Qu=new Set(["json","yaml","yml","toml","ini","cfg","conf","env","lock","properties","editorconfig","gitignore","gitattributes","dockerignore","npmrc","prettierrc","eslintrc","babelrc","node-version","nvmrc"]),Kh=new Set(["md","mdx","txt","rst","pdf","doc","docx","rtf","adoc","org"]),Xh=new Set(["png","jpg","jpeg","gif","svg","webp","ico","bmp","tiff","tif","avif"]),qh=new Set(["css","scss","sass","less","styl"]);function Nr(e){let r=e.endsWith("/")?e.slice(0,-1):e,n=r.slice(r.lastIndexOf("/")+1).toUpperCase();if(n==="LICENSE"||n==="README"||n==="CHANGELOG"||n==="AUTHORS")return(0,D.jsx)(Yu,{});if(n==="MAKEFILE"||n==="DOCKERFILE"||n==="CMAKECACHE")return(0,D.jsx)(Li,{});let o=r.lastIndexOf(".");if(o===-1)return(0,D.jsx)(Xt,{});let t=r.slice(o+1).toLowerCase();return o===0?Qu.has(t)?(0,D.jsx)(qu,{}):(0,D.jsx)(Xt,{}):Hh.has(t)?(0,D.jsx)(Li,{}):Qu.has(t)?(0,D.jsx)(qu,{}):Kh.has(t)?(0,D.jsx)(Yu,{}):Xh.has(t)?(0,D.jsx)(Wh,{}):qh.has(t)?(0,D.jsx)(Li,{}):(0,D.jsx)(Xt,{})}function Gi(){return(0,D.jsxs)("svg",{width:12,height:12,viewBox:"0 0 12 12",style:{display:"block",flex:"none"},"aria-hidden":"true",children:[(0,D.jsx)("circle",{cx:3.5,cy:2.5,r:1.5,fill:"currentColor"}),(0,D.jsx)("circle",{cx:3.5,cy:9.5,r:1.5,fill:"currentColor"}),(0,D.jsx)("circle",{cx:8.5,cy:2.5,r:1.5,fill:"currentColor"}),(0,D.jsx)("path",{d:"M3.5 4 v4 M8.5 4 c0 2.5-2.5 2.5-4.5 3",fill:"none",stroke:"currentColor",strokeWidth:1.2})]})}function ed(){return(0,D.jsx)("svg",{width:12,height:12,viewBox:"0 0 12 12",style:{display:"block",flex:"none"},"aria-hidden":"true",children:(0,D.jsx)("path",{d:"M6 0.8 l1.5 3.1 3.4 0.45 -2.5 2.35 0.65 3.35 L6 8.45 l-3.05 1.6 0.65-3.35 -2.5-2.35 3.4-0.45 Z",fill:"currentColor"})})}function td(){return(0,D.jsx)("svg",{width:12,height:12,viewBox:"0 0 12 12",style:{display:"block"},"aria-hidden":"true",children:(0,D.jsx)("path",{d:"M2 1.5 L6 5 L10 1.5 M2 6 L6 9.5 L10 6",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"})})}function rd(){return(0,D.jsx)("svg",{width:12,height:12,viewBox:"0 0 12 12",style:{display:"block"},"aria-hidden":"true",children:(0,D.jsx)("path",{d:"M2 4.5 L6 1 L10 4.5 M2 9 L6 5.5 L10 9",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"})})}function Fi(){return(0,D.jsxs)("svg",{width:12,height:12,viewBox:"0 0 12 12",style:{display:"block",flex:"none"},"aria-hidden":"true",children:[(0,D.jsx)("path",{d:"M1.5 1.5 h4 l5 5 l-4 4 l-5-5 Z",fill:"none",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,D.jsx)("circle",{cx:3.8,cy:3.8,r:.9,fill:"currentColor"})]})}function nd(){return(0,D.jsxs)("svg",{width:14,height:14,viewBox:"0 0 14 14",style:{display:"block",flex:"none"},"aria-hidden":"true",children:[(0,D.jsx)("rect",{x:1.5,y:2.5,width:11,height:9,rx:1.2,fill:"none",stroke:"currentColor",strokeWidth:1.2}),(0,D.jsx)("path",{d:"M7 2.5 v9",stroke:"currentColor",strokeWidth:1.2})]})}function qt(){return(0,D.jsx)("svg",{width:14,height:14,viewBox:"0 0 14 14",style:{display:"block",flex:"none"},"aria-hidden":"true",children:(0,D.jsx)("path",{d:"M7 3 v8 M3 7 h8",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round"})})}function Er(){return(0,D.jsx)("svg",{width:14,height:14,viewBox:"0 0 14 14",style:{display:"block",flex:"none"},"aria-hidden":"true",children:(0,D.jsx)("path",{d:"M3 7 h8",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round"})})}function Zr(){return(0,D.jsx)("svg",{width:14,height:14,viewBox:"0 0 14 14",style:{display:"block",flex:"none"},"aria-hidden":"true",children:(0,D.jsx)("path",{d:"M5.5 3 L3 5.5 L5.5 8 M3.4 5.5 h5.1 a3 3 0 0 1 0 6 h-2",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"})})}function id(){return(0,D.jsx)("svg",{width:14,height:14,viewBox:"0 0 14 14",style:{display:"block",flex:"none"},"aria-hidden":"true",children:(0,D.jsx)("path",{d:"M8.5 3 L4.5 7 L8.5 11",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"})})}function od(){return(0,D.jsx)("svg",{width:14,height:14,viewBox:"0 0 14 14",style:{display:"block",flex:"none"},"aria-hidden":"true",children:(0,D.jsx)("path",{d:"M5.5 3 L9.5 7 L5.5 11",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"})})}function Rr(){return(0,D.jsx)("svg",{width:14,height:14,viewBox:"0 0 14 14",style:{display:"block",flex:"none"},"aria-hidden":"true",children:(0,D.jsx)("path",{d:"M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round"})})}function ad(){return(0,D.jsxs)("svg",{width:16,height:16,viewBox:"0 0 16 16",style:{display:"block",flex:"none"},"aria-hidden":"true",children:[(0,D.jsx)("path",{d:"M8 1.5 L14.5 13 L1.5 13 Z",fill:"currentColor",opacity:.15,stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),(0,D.jsx)("path",{d:"M8 6 V9.5",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round"}),(0,D.jsx)("circle",{cx:8,cy:11.3,r:.8,fill:"currentColor"})]})}function Ar(e,r,n){return e==="local-changes-block"?n("error.localChangesBlock"):r??e}function Mi(e){return e==="local-changes-block"?"open-center":null}var je=require("react"),pm=require("react-dom");var Bi={display:"inline-flex",alignItems:"center",gap:6,height:24,padding:"0 9px",border:0,borderRadius:12,font:"inherit",fontSize:12,lineHeight:"18px",whiteSpace:"nowrap",maxWidth:280,cursor:"pointer",color:"var(--dsw-alias-label-secondary)",background:"var(--dsw-alias-bg-layer-2)",boxShadow:"inset 0 0 0 1px var(--dsw-alias-border-l2)"},cd={overflow:"hidden",textOverflow:"ellipsis",minWidth:0,flexShrink:1},ld={flexShrink:0,whiteSpace:"nowrap"},ud={...Bi,opacity:.55,cursor:"default"},Lr={flex:"none",width:8,height:8,borderRadius:999,background:"var(--dsw-alias-state-success-primary)"},Ji={...Lr,background:"var(--dsw-alias-state-warn-primary)"},dd={position:"fixed",zIndex:1100,boxSizing:"border-box",width:340,maxHeight:420,overflowY:"auto",padding:"12px 14px",fontSize:12,lineHeight:"18px",background:"var(--dsw-alias-bg-layer-3)",color:"var(--dsw-alias-label-primary)",border:"1px solid var(--dsw-alias-border-l1)",borderRadius:12,boxShadow:"var(--dsw-shadow-lv3)"},pd={display:"flex",flexDirection:"column",gap:4,paddingBottom:10,marginBottom:10,borderBottom:"1px solid var(--dsw-alias-border-l2)"},md={display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},fd={fontSize:13,fontWeight:600,color:"var(--dsw-alias-label-primary)"},Gr={fontSize:11,color:"var(--dsw-alias-label-secondary)",fontVariantNumeric:"tabular-nums"},gd={display:"flex",alignItems:"center",gap:5,color:"var(--dsw-alias-label-tertiary)"},hd={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:11},vd={display:"inline-flex",alignItems:"center",gap:4,border:"none",background:"transparent",padding:"2px 4px",cursor:"pointer",font:"inherit",fontSize:13,fontWeight:600,lineHeight:"20px",color:"var(--dsw-alias-label-primary)",borderRadius:4},yd={display:"flex",alignItems:"center",gap:12,flexWrap:"wrap",marginBottom:10},bd={display:"inline-flex",alignItems:"baseline",gap:4},xd={fontWeight:600,fontSize:13,color:"var(--dsw-alias-label-primary)",fontVariantNumeric:"tabular-nums"},$d={fontSize:11,color:"var(--dsw-alias-label-tertiary)"},_d={display:"flex",alignItems:"center",gap:6,marginBottom:6},Vi={margin:"14px 0 6px",fontSize:11,fontWeight:600,color:"var(--dsw-alias-label-tertiary)"},kd={display:"flex",flexDirection:"column",gap:1,padding:"3px 6px",margin:"0 -6px",borderRadius:6},Sd={flex:"none",fontFamily:"var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, monospace)",fontSize:11,color:"var(--dsw-alias-label-secondary)"},wd={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--dsw-alias-label-primary)",fontSize:12},Id={display:"flex",alignItems:"center",gap:4,fontSize:11,color:"var(--dsw-alias-label-tertiary)",whiteSpace:"nowrap"},Wi={color:"var(--dsw-alias-label-tertiary)",opacity:.6},Hi={fontSize:11,color:"var(--dsw-alias-label-tertiary)",whiteSpace:"nowrap"},zd={display:"flex",gap:8,alignItems:"center",padding:"2px 0",borderRadius:6},Pd={width:18,textAlign:"center",borderRadius:5,fontSize:10,lineHeight:"14px",fontWeight:700,flexShrink:0},Ki={added:{background:"color-mix(in srgb, var(--dsw-alias-state-success-primary) 14%, transparent)",color:"var(--dsw-alias-label-primary)"},modified:{background:"color-mix(in srgb, var(--dsw-alias-state-warn-primary) 14%, transparent)",color:"var(--dsw-alias-label-primary)"},deleted:{background:"color-mix(in srgb, var(--dsw-alias-state-error-primary) 14%, transparent)",color:"var(--dsw-alias-label-primary)"},renamed:{background:"color-mix(in srgb, var(--dsw-alias-state-business-primary) 14%, transparent)",color:"var(--dsw-alias-label-primary)"},untracked:{background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-secondary)"},conflicted:{background:"color-mix(in srgb, var(--dsw-alias-state-error-primary) 18%, transparent)",color:"var(--dsw-alias-label-primary)"},typechange:{background:"color-mix(in srgb, var(--dsw-alias-state-warn-primary) 14%, transparent)",color:"var(--dsw-alias-label-primary)"}},Yh={flex:"0 1 auto",minWidth:0,maxWidth:"60%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Xi={...Yh,border:"none",background:"transparent",padding:0,fontFamily:"inherit",fontSize:13,lineHeight:"20px",textAlign:"left",cursor:"pointer"},jd={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:11,color:"var(--dsw-alias-label-tertiary)"},Dd={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,marginTop:12,paddingTop:10,borderTop:"1px solid var(--dsw-alias-border-l2)"},Cd={display:"inline-flex",alignItems:"center",gap:4},Od={background:"var(--dsw-alias-bg-layer-2)",border:"1px solid var(--dsw-alias-state-business-primary)",color:"var(--dsw-alias-state-business-primary)",fontWeight:600},Ud={fontSize:11,color:"var(--dsw-alias-label-tertiary)"},qi={border:0,background:"transparent",padding:"2px 6px",fontSize:12,cursor:"pointer",color:"var(--dsw-alias-label-secondary)",borderRadius:6,font:"inherit"},_e={color:"var(--dsw-alias-label-tertiary)",padding:"4px 0"},lt={flex:1,minHeight:0,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--dsw-alias-label-tertiary)",fontSize:12,lineHeight:"18px",padding:"16px 0"},sd="dsh-git-ui/styles",Qh=[".dsh-git-ui__pop, .dsh-git-ui__center, .dsh-git-ui__select-menu { --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2); --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2); }",".dsh-git-ui__pop, .dsh-git-ui__select-menu { transition: opacity 150ms ease-out, transform 150ms ease-out; }",".dsh-git-ui__pop { transform-origin: top center; }",".dsh-git-ui__select-menu { transform-origin: top left; }",".dsh-git-ui__pop, .dsh-git-ui__select-menu { opacity: 1; transform: scale(1); @starting-style { opacity: 0; transform: scale(0.97); } }",".dsh-git-ui__row { border-radius: 6px; }",".dsh-git-ui__pill { transition: transform var(--ds-transition-duration-fast) ease-out, background var(--ds-transition-duration-fast) var(--ds-ease-in-out); }",".dsh-git-ui__commit-row, .dsh-git-ui__row { transition: transform var(--ds-transition-duration-fast) ease-out, background var(--ds-transition-duration-fast) var(--ds-ease-in-out); }",".dsh-git-ui__refresh { transition: transform var(--ds-transition-duration-fast) ease-out, color var(--ds-transition-duration-fast) var(--ds-ease-in-out); }",".dsh-git-ui__branch-input, .dsh-git-ui__commit-input { transition: border-color var(--ds-transition-duration-fast) var(--ds-ease-in-out); }",".dsh-git-ui__tab { transition: transform var(--ds-transition-duration-fast) ease-out, color var(--ds-transition-duration-fast) var(--ds-ease-in-out); }",'.dsh-git-ui__tab::after { content: ""; position: absolute; right: 0; bottom: 1px; left: 0; height: 2px; border-radius: 2px; background: transparent; transition: background var(--ds-transition-duration-fast) var(--ds-ease-in-out); }',".dsh-git-ui__tab--active::after { background: var(--dsw-alias-state-business-primary); }",".dsh-git-ui__toolbar-select { transition: transform var(--ds-transition-duration-fast) ease-out, background var(--ds-transition-duration-fast) var(--ds-ease-in-out), border-color var(--ds-transition-duration-fast) var(--ds-ease-in-out); }",".dsh-git-ui__row-actions { opacity: 0; transition: opacity var(--ds-transition-duration-fast) var(--ds-ease-in-out); }",".dsh-git-ui__row:focus-within .dsh-git-ui__row-actions { opacity: 1; }",".dsh-git-ui__icon-btn { transition: transform var(--ds-transition-duration-fast) ease-out, background var(--ds-transition-duration-fast) var(--ds-ease-in-out), color var(--ds-transition-duration-fast) var(--ds-ease-in-out); }",".dsh-git-ui__icon-btn:disabled { opacity: 0.45; cursor: default; }",".dsh-git-ui__refresh:disabled { opacity: 0.45; cursor: default; }",".dsh-git-ui__change-link { color: var(--dsw-alias-label-primary); transition: transform var(--ds-transition-duration-fast) ease-out, color var(--ds-transition-duration-fast) var(--ds-ease-in-out); }",".dsh-git-ui__change-link:hover { color: var(--dsw-alias-state-business-primary); }",".dsh-git-ui__change-link:active { transform: scale(0.97); }",".dsh-git-ui__diff-fold { transition: transform var(--ds-transition-duration-fast) ease-out, background var(--ds-transition-duration-fast) var(--ds-ease-in-out), color var(--ds-transition-duration-fast) var(--ds-ease-in-out); }",".dsh-git-ui__footer-primary { transition: transform var(--ds-transition-duration-fast) ease-out, background var(--ds-transition-duration-fast) var(--ds-ease-in-out), border-color var(--ds-transition-duration-fast) var(--ds-ease-in-out); }",".dsh-git-ui__pill:active, .dsh-git-ui__icon-btn:active, .dsh-git-ui__tab:active, .dsh-git-ui__refresh:active, .dsh-git-ui__toolbar-select:active, .dsh-git-ui__diff-fold:active, .dsh-git-ui__commit-row:active, .dsh-git-ui__footer-primary:active { transform: scale(0.97); }",".dsh-git-ui__commit-row:active, .dsh-git-ui__row:active { background: var(--dsw-alias-interactive-bg-active); }",".dsh-git-ui__icon-btn:active { background: var(--dsw-alias-interactive-bg-active); }",".dsh-git-ui__pill:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }",".dsh-git-ui__row:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }",".dsh-git-ui__commit-row:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }",".dsh-git-ui__refresh:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: 2px; }",".dsh-git-ui__commit-input:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }",".dsh-git-ui__branch-input:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }",".dsh-git-ui__tab:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; border-radius: 4px; }",".dsh-git-ui__toolbar-select:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }",".dsh-git-ui__icon-btn:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }",".dsh-git-ui__diff-fold:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }",".dsh-git-ui__footer-primary:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }",".dsh-git-ui__center { width: min(1200px, 100vw); height: min(760px, calc(100vh - 48px)); }","@media (hover: hover) and (pointer: fine) {"," .dsh-git-ui__pill:hover { background: var(--dsw-alias-interactive-bg-hover); }"," .dsh-git-ui__row:hover { background: var(--dsw-alias-interactive-bg-hover); }"," .dsh-git-ui__commit-row:hover { background: var(--dsw-alias-interactive-bg-hover); }"," .dsh-git-ui__splitter:hover { background: var(--dsw-alias-interactive-bg-hover); }"," .dsh-git-ui__refresh:hover { color: var(--dsw-alias-state-business-primary); }"," .dsh-git-ui__branch-input:hover, .dsh-git-ui__commit-input:hover { border-color: var(--dsw-alias-border-l1); }"," .dsh-git-ui__tab:hover { color: var(--dsw-alias-label-primary); }"," .dsh-git-ui__toolbar-select:hover { background: var(--dsw-alias-interactive-bg-hover); border-color: var(--dsw-alias-border-l1); }"," .dsh-git-ui__icon-btn:hover { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); }"," .dsh-git-ui__diff-fold:hover { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-secondary); }"," .dsh-git-ui__footer-primary:hover { background: var(--dsw-alias-interactive-bg-hover); }"," .dsh-git-ui__row:hover .dsh-git-ui__row-actions { opacity: 1; }","}","@media (hover: none) { .dsh-git-ui__row-actions { opacity: 1; } }","@media (prefers-reduced-motion: reduce) {"," .dsh-git-ui__pill, .dsh-git-ui__pop, .dsh-git-ui__select-menu, .dsh-git-ui__icon-btn, .dsh-git-ui__tab, .dsh-git-ui__commit-row, .dsh-git-ui__row, .dsh-git-ui__branch-input, .dsh-git-ui__commit-input, .dsh-git-ui__toolbar-select, .dsh-git-ui__diff-fold, .dsh-git-ui__refresh, .dsh-git-ui__footer-primary, .dsh-git-ui__change-link { transition: opacity 200ms ease, background 200ms ease, color 200ms ease, border-color 200ms ease !important; transform: none !important; }","}"].join(`
|
|
5
5
|
`);function Td(){if(typeof document>"u"||document.getElementById(sd)!==null)return;let e=document.createElement("style");e.id=sd,e.dataset.plugin="dsh-git-ui",e.textContent=Qh,document.head.appendChild(e)}var Nd={display:"flex",flexDirection:"column",height:"100%",fontSize:13,lineHeight:"20px",color:"var(--dsw-alias-label-primary)"},Ed={display:"flex",alignItems:"center",gap:10,padding:"16px 20px 12px",borderBottom:"1px solid var(--dsw-alias-border-l2)",flex:"none"},Zd={margin:0,fontSize:15,lineHeight:"22px",fontWeight:600,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--dsw-alias-label-primary)"},Rd={flex:1,overflowY:"auto",padding:"12px 20px",display:"flex",flexDirection:"column",gap:10},Yi={display:"flex",alignItems:"center",gap:6,height:28,flexShrink:0,padding:"0 8px",borderRadius:6},Ad={background:"var(--dsw-alias-interactive-bg-hover)"},Fr={display:"inline-flex",alignItems:"center",justifyContent:"flex-end",gap:2,flex:"none",width:78},ce={display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"none",width:24,height:24,border:"none",background:"transparent",borderRadius:6,cursor:"pointer",padding:0,color:"var(--dsw-alias-label-secondary)"},Mr={flex:"none",display:"inline-flex",alignItems:"center",color:"var(--dsw-alias-label-tertiary)"},Qi={border:"none",background:"transparent",cursor:"pointer",padding:0,fontFamily:"inherit",fontSize:13,lineHeight:"20px",textAlign:"left",flex:"0 1 auto",minWidth:0,maxWidth:"65%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Ld={flex:"none",width:14,textAlign:"center",fontFamily:"var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, monospace)",fontSize:11,fontWeight:600},Gd={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:6,height:30,flexShrink:0,padding:"0 8px",background:"var(--dsw-alias-bg-layer-2)",borderBottom:"1px solid var(--dsw-alias-border-l2)"},Fd={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,border:"none",background:"transparent",cursor:"pointer",padding:0,fontFamily:"inherit",fontSize:12,lineHeight:"20px",fontWeight:600,textAlign:"left",color:"var(--dsw-alias-label-secondary)"},Md={fontWeight:400,fontSize:11,color:"var(--dsw-alias-label-tertiary)"},eo={flex:"none",accentColor:"var(--dsw-alias-state-business-primary)"},Bd={display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",padding:"6px 0 2px"},Jd={borderTop:"1px solid var(--dsw-alias-border-l2)",padding:"12px 20px 16px",display:"flex",flexDirection:"column",gap:8,flex:"none",marginTop:"auto",background:"var(--dsw-alias-bg-layer-1)"},Vd={width:"100%",boxSizing:"border-box",minHeight:64,resize:"vertical",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:8,padding:"6px 10px",fontSize:13,lineHeight:"20px",fontFamily:"inherit",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)"},Wd={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},to={fontSize:12,lineHeight:"18px",color:"var(--dsw-alias-label-tertiary)"},Hd={display:"flex",alignItems:"flex-start",gap:8,padding:"8px 10px",borderRadius:8,fontSize:12,lineHeight:"18px",background:"color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent)",color:"var(--dsw-alias-label-primary)",borderLeft:"3px solid var(--dsw-alias-state-error-primary)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:120,overflowY:"auto"},Kd={display:"flex",alignItems:"flex-start",gap:8,margin:"8px 12px 0",padding:"8px 10px",borderRadius:8,fontSize:12,lineHeight:"18px",background:"color-mix(in srgb, var(--dsw-alias-state-error-primary) 8%, transparent)",color:"var(--dsw-alias-label-primary)",borderLeft:"3px solid var(--dsw-alias-state-error-primary)",wordBreak:"break-word"},Xd={flex:"none",display:"inline-flex",alignItems:"center",color:"var(--dsw-alias-state-error-primary)",marginTop:1},qd={flex:1,minWidth:0,color:"var(--dsw-alias-label-secondary)"},Yd={flex:"none",border:"none",background:"transparent",padding:"2px 6px",font:"inherit",fontSize:12,lineHeight:"18px",cursor:"pointer",color:"var(--dsw-alias-state-error-primary)",whiteSpace:"nowrap"},Qd={flex:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",width:20,height:20,border:"none",background:"transparent",padding:0,cursor:"pointer",font:"inherit",color:"var(--dsw-alias-label-tertiary)",opacity:.7},ep={flex:"none",border:0,background:"transparent",padding:"0 2px",cursor:"pointer",color:"inherit",fontSize:13,lineHeight:"18px",opacity:.7},tp={display:"flex",gap:12,flex:1,minHeight:0},rp={flex:"none",minWidth:0,display:"flex",flexDirection:"column",minHeight:0},np={flex:1,minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:0},ip={flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:6,borderLeft:"1px solid var(--dsw-alias-border-l2)",paddingLeft:12},op={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0,color:"var(--dsw-alias-label-tertiary)",fontSize:12},ap={flex:1,minHeight:0,display:"flex",overflowY:"auto",overflowX:"hidden",alignItems:"flex-start",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:8,background:"var(--dsw-alias-bg-layer-2)",fontFamily:"var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, monospace)",fontSize:11,lineHeight:"18px"},ro={flex:1,minWidth:0,overflowX:"auto",overflowY:"hidden"},sp={borderLeft:"1px solid var(--dsw-alias-border-l2)"},no={minWidth:"100%",width:"max-content"},cp={boxSizing:"border-box",display:"flex",gap:6,padding:"0 8px",whiteSpace:"pre",width:"100%"},lp={whiteSpace:"pre",flex:"none"},up={flex:"none",width:36,textAlign:"right",paddingRight:8,marginRight:2,color:"var(--dsw-alias-label-tertiary)",userSelect:"none",borderRight:"1px solid var(--dsw-alias-border-l2)"},dp={background:"color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent)",color:"var(--dsw-alias-label-primary)"},pp={background:"color-mix(in srgb, var(--dsw-alias-state-success-primary) 12%, transparent)",color:"var(--dsw-alias-label-primary)"},mp={background:"var(--dsw-alias-bg-layer-1)"},fp={display:"flex",alignItems:"center",gap:6,flex:"none",height:32,padding:"0 2px"},gp={flex:"none",padding:"2px 8px",borderRadius:10,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-secondary)",fontSize:11,lineHeight:"14px",fontWeight:500,whiteSpace:"nowrap"},hp={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,color:"var(--dsw-alias-label-tertiary)"},vp={flex:"none",fontSize:12,fontWeight:500,color:"var(--dsw-alias-label-primary)",whiteSpace:"nowrap"},yp={flex:"none",display:"inline-flex",gap:8,fontFamily:"var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, monospace)",fontSize:11,fontWeight:600,lineHeight:"16px"},bp={color:"var(--dsw-alias-state-success-primary)"},xp={color:"var(--dsw-alias-state-error-primary)"};var $p={flex:"none",fontFamily:"var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, monospace)",fontSize:11,color:"var(--dsw-alias-label-tertiary)"},_p={display:"flex",gap:24,padding:"0 20px",borderBottom:"1px solid var(--dsw-alias-border-l2)",flex:"none"},io={position:"relative",padding:"0 0 11px",border:"none",background:"transparent",fontSize:13,lineHeight:"16px",fontWeight:500,color:"var(--dsw-alias-label-tertiary)",cursor:"pointer",fontFamily:"inherit"},kp={color:"var(--dsw-alias-state-business-primary)"},oo=32,Sp={display:"flex",gap:0,flex:1,minHeight:0},wp={flex:1,minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1,padding:6,fontSize:12,lineHeight:"20px"};var Ip={display:"flex",alignItems:"center",gap:4,margin:"8px 0 2px",padding:"2px 8px",border:"none",background:"transparent",borderRadius:6,cursor:"pointer",fontFamily:"inherit",fontSize:11,fontWeight:600,lineHeight:"16px",textAlign:"left",color:"var(--dsw-alias-label-tertiary)"},Pe={display:"flex",alignItems:"center",gap:6,width:"100%",padding:"4px 8px",border:"none",background:"transparent",borderRadius:6,cursor:"pointer",fontFamily:"inherit",fontSize:12,lineHeight:"20px",textAlign:"left",color:"var(--dsw-alias-label-primary)"},Br={background:"var(--dsw-alias-interactive-bg-active)",color:"var(--dsw-alias-state-business-primary)"},Yt={flex:"none",width:14,display:"inline-flex",alignItems:"center",justifyContent:"center",color:"var(--dsw-alias-label-tertiary)"},ut={flex:"none",width:10,display:"inline-flex",alignItems:"center",color:"var(--dsw-alias-label-tertiary)"},Jr={flex:"none",display:"inline-flex",color:"var(--dsw-alias-label-tertiary)"},Vr={added:"var(--dsw-alias-state-success-primary)",untracked:"var(--dsw-alias-state-success-primary)",modified:"var(--dsw-alias-state-business-primary)",renamed:"var(--dsw-alias-state-business-primary)",deleted:"var(--dsw-alias-state-error-primary)",conflicted:"var(--dsw-alias-state-error-primary)",typechange:"var(--dsw-alias-state-warn-primary)"},zp={marginLeft:12,borderLeft:"1px solid var(--dsw-alias-border-l2)"},Re={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0},Pp={color:"var(--dsw-alias-state-business-primary)",fontWeight:600},jp={flex:"none",fontSize:10,lineHeight:"14px",color:"var(--dsw-alias-label-tertiary)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},Dp={flex:"none",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:8,background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-secondary)",fontSize:11,lineHeight:"14px",padding:"4px 8px",cursor:"pointer",font:"inherit",whiteSpace:"nowrap"},Cp={flex:"none",fontSize:11,lineHeight:"16px",color:"var(--dsw-alias-label-tertiary)",padding:"4px 12px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Op={display:"flex",alignItems:"center",gap:6,flex:"none",height:40,padding:"0 8px",borderBottom:"1px solid var(--dsw-alias-border-l2)"},Up={flex:1,minWidth:80,border:"1px solid var(--dsw-alias-border-l2)",borderRadius:8,padding:"4px 10px",fontSize:12,lineHeight:"18px",fontFamily:"inherit",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)"},Tp={flex:"none",maxWidth:150,display:"inline-flex",alignItems:"center",gap:6,border:"1px solid var(--dsw-alias-border-l2)",borderRadius:8,padding:"4px 8px",fontSize:12,lineHeight:"18px",fontFamily:"inherit",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)",cursor:"pointer"},ao={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0,textAlign:"left"},Np={position:"fixed",zIndex:1200,display:"flex",flexDirection:"column",gap:1,padding:4,maxHeight:280,overflowY:"auto",background:"var(--dsw-alias-bg-layer-3)",border:"1px solid var(--dsw-alias-border-l1)",borderRadius:12,boxShadow:"var(--dsw-shadow-lv3)"},so={display:"flex",alignItems:"center",gap:6,padding:"4px 10px",border:"none",background:"transparent",borderRadius:6,cursor:"pointer",fontFamily:"inherit",fontSize:12,lineHeight:"20px",textAlign:"left",color:"var(--dsw-alias-label-primary)"},Ep={background:"var(--dsw-alias-interactive-bg-hover)",color:"var(--dsw-alias-state-business-primary)"},Zp={flex:"none",padding:"8px 0",textAlign:"center",color:"var(--dsw-alias-label-tertiary)",fontSize:11,lineHeight:"16px"},co={flex:"none",display:"flex",alignItems:"center",gap:6,height:40,padding:"0 8px",borderBottom:"1px solid var(--dsw-alias-border-l2)"},lo={flex:"none",display:"flex",flexDirection:"column",minWidth:0,background:"var(--dsw-alias-interactive-bg-hover)"},Rp={flex:1,minWidth:0,border:"1px solid var(--dsw-alias-border-l2)",borderRadius:8,padding:"3px 8px",fontSize:12,lineHeight:"18px",fontFamily:"inherit",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)"},Ap={color:"var(--dsw-alias-state-business-primary)",fontWeight:600},uo={flex:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,border:"none",background:"transparent",borderRadius:6,cursor:"pointer",color:"var(--dsw-alias-label-secondary)"},Lp={flex:"none",width:5,marginLeft:-3,cursor:"col-resize",background:"transparent",borderLeft:"1px solid var(--dsw-alias-border-l2)",zIndex:1},Gp={flex:"none",height:5,marginTop:-3,cursor:"row-resize",background:"transparent",borderTop:"1px solid var(--dsw-alias-border-l2)",zIndex:1},Fp={display:"flex",flexDirection:"column",flex:1,minHeight:0,minWidth:0},Mp={flex:1,minHeight:0,overflowY:"auto",overflowX:"auto",display:"flex",flexDirection:"column",gap:0,paddingRight:8},po={display:"grid",alignItems:"center",alignSelf:"flex-start",columnGap:8,minWidth:"100%",width:"auto",height:oo,flexShrink:0,padding:0,border:"none",background:"transparent",textAlign:"left",cursor:"pointer",fontFamily:"inherit",fontSize:13,lineHeight:"20px",color:"var(--dsw-alias-label-primary)"},Bp={display:"flex",alignItems:"center",justifyContent:"center"},Jp={width:8,height:8,borderRadius:"50%",border:"1.5px solid var(--dsw-alias-bg-layer-2)",flex:"none"},Vp={background:"var(--dsw-alias-interactive-bg-active)"},Wp={position:"sticky",top:0,zIndex:1,display:"grid",alignItems:"center",alignSelf:"flex-start",columnGap:8,minWidth:"100%",width:"auto",height:28,flexShrink:0,padding:0,background:"var(--dsw-alias-bg-layer-2)",borderBottom:"1px solid var(--dsw-alias-border-l2)",fontSize:11,fontWeight:600,lineHeight:"16px",color:"var(--dsw-alias-label-tertiary)"},Hp={display:"flex",alignItems:"center",gap:6,minWidth:0},Kp={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0,fontSize:13,lineHeight:"20px",color:"var(--dsw-alias-label-primary)"},Xp={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, monospace)",fontSize:11,color:"var(--dsw-alias-label-secondary)"},qp={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,color:"var(--dsw-alias-label-tertiary)"},Yp={textAlign:"right",fontSize:11,color:"var(--dsw-alias-label-tertiary)"},mo={flex:"none",maxWidth:140,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"1px 7px",borderRadius:9,border:"1px solid",fontSize:10,fontWeight:500,lineHeight:"13px"},Qp={color:"var(--dsw-alias-state-success-primary)",borderColor:"var(--dsw-alias-state-success-primary)",background:"transparent"},em={color:"var(--dsw-alias-label-secondary)",borderColor:"var(--dsw-alias-border-l1)",background:"var(--dsw-alias-bg-layer-2)"},fo={color:"var(--dsw-alias-label-tertiary)",borderColor:"var(--dsw-alias-border-l1)",background:"transparent"},tm={color:"var(--dsw-alias-state-warn-primary)",borderColor:"var(--dsw-alias-state-warn-primary)",background:"var(--dsw-alias-bg-layer-2)"},rm={flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:8,paddingLeft:12,overflowY:"hidden"},nm={flex:1,minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1},im={flex:1,minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:4},om={margin:0,fontFamily:"var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, monospace)",fontSize:11,lineHeight:"17px",whiteSpace:"pre-wrap",wordBreak:"break-word",color:"var(--dsw-alias-label-secondary)"},Wr={flex:1,minHeight:0,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--dsw-alias-label-tertiary)",fontSize:12,lineHeight:"18px"},am={flex:"none",height:"34%",borderTop:"1px solid var(--dsw-alias-border-l2)"},sm={display:"flex",flexDirection:"column",gap:4,padding:"2px 0 10px",borderBottom:"1px solid var(--dsw-alias-border-l2)"},cm={fontSize:14,lineHeight:"22px",fontWeight:600,color:"var(--dsw-alias-label-primary)",wordBreak:"break-word"},lm={fontSize:12,lineHeight:"18px",color:"var(--dsw-alias-label-secondary)"},um={flex:1,minWidth:120,border:"1px solid var(--dsw-alias-border-l2)",borderRadius:8,padding:"5px 10px",fontSize:13,lineHeight:"20px",fontFamily:"inherit",background:"var(--dsw-alias-bg-layer-2)",color:"var(--dsw-alias-label-primary)"},dm={flex:"none",color:"var(--dsw-alias-state-business-primary)",fontSize:12};var me=require("react/jsx-runtime");function dt({value:e,options:r,onSelect:n,ariaLabel:o,buttonStyle:t}){let[i,a]=(0,je.useState)(!1),[s,l]=(0,je.useState)(null),c=(0,je.useRef)(null),d=(0,je.useRef)(null),f=r.find(v=>v.value===e);return(0,je.useLayoutEffect)(()=>{if(!i){l(null);return}let v=()=>{let g=c.current?.getBoundingClientRect();g&&l({top:g.bottom+4,left:g.left,width:Math.max(g.width,140)})};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[i]),(0,je.useEffect)(()=>{if(!i)return;let v=k=>{let Z=k.target;(c.current?.contains(Z)??!1)||(d.current?.contains(Z)??!1)||a(!1)},g=k=>{k.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",v),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",g)}},[i]),(0,me.jsxs)(me.Fragment,{children:[(0,me.jsxs)("button",{ref:c,type:"button",className:"dsh-git-ui__toolbar-select",style:t??Tp,"aria-label":o,"aria-haspopup":"listbox","aria-expanded":i,onClick:()=>a(!i),children:[(0,me.jsx)("span",{style:ao,children:f?.label??""}),(0,me.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",flex:"none",transition:"transform var(--ds-transition-duration-fast) var(--ds-ease-in-out)",transform:i?"rotate(180deg)":"none"},children:(0,me.jsx)("svg",{width:10,height:10,viewBox:"0 0 10 10",children:(0,me.jsx)("path",{d:"M1.5 3 L5 7 L8.5 3",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})})]}),i&&s!==null&&(0,pm.createPortal)((0,me.jsx)("div",{ref:d,role:"listbox","aria-label":o,className:"dsh-git-ui__select-menu",style:{...Np,top:s.top,left:s.left,minWidth:s.width},children:r.map(v=>(0,me.jsxs)("button",{type:"button",role:"option","aria-selected":v.value===e,style:v.value===e?{...so,...Ep}:so,className:"dsh-git-ui__row",onClick:()=>{n(v.value),a(!1)},children:[(0,me.jsx)("span",{style:{...ut,visibility:v.value===e?"visible":"hidden"},"aria-hidden":"true",children:"\u2713"}),(0,me.jsx)("span",{style:ao,children:v.label})]},v.value))}),document.body)]})}var u=require("react/jsx-runtime"),ev=1e3,tv={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"?",conflicted:"!",typechange:"T"};function fm(e,r,n){return Ju(e,r,{minutesAgo:o=>n("time.minutesAgo").replace("{n}",String(o)),today:n("time.today"),yesterday:n("time.yesterday")})}function gm({open:e,onClose:r,snapshot:n,run:o,query:t,t:i,openRequest:a=null}){let{Modal:s,Button:l,Toast:c}=Wt(),[d,f]=(0,j.useState)("changes"),[v,g]=(0,j.useState)(!1),[k,Z]=(0,j.useState)(null),[R,A]=(0,j.useState)(null);(0,j.useEffect)(()=>{a!==null&&f("changes")},[a]);let X=async(O,M)=>{if(v)return!1;g(!0),Z(null);let S=await o(O);return g(!1),S.ok?(A({text:M,seq:Date.now()}),!0):(Z({text:Ar(S.error.code,S.error.message,i),...S.error.message===void 0?{}:{detail:S.error.message}}),!1)},F=[{key:"changes",label:i("center.changes")},{key:"history",label:i("center.history")}];return(0,u.jsxs)(s,{open:e,onClose:r,title:i("center.title"),closeLabel:i("center.close"),headless:!0,className:"dsh-git-ui__center",children:[(0,u.jsxs)("div",{style:Nd,children:[(0,u.jsxs)("div",{style:Ed,children:[(0,u.jsxs)("h2",{style:Zd,title:n.root,children:[n.branch??"(detached)"," \u2014 ",i("center.title")]}),(0,u.jsx)(l,{size:"sm",onClick:r,"aria-label":i("center.close"),children:"\u2715"})]}),(0,u.jsx)("div",{style:_p,role:"tablist",children:F.map(({key:O,label:M})=>(0,u.jsx)("button",{type:"button",role:"tab","aria-selected":d===O,className:`dsh-git-ui__tab${d===O?" dsh-git-ui__tab--active":""}`,style:d===O?{...io,...kp}:io,onClick:()=>f(O),children:M},O))}),(0,u.jsxs)("div",{style:Rd,children:[k!==null&&(0,u.jsxs)("div",{style:Hd,role:"alert",title:k.detail,children:[(0,u.jsx)("span",{style:{flex:1},children:k.text}),(0,u.jsx)("button",{type:"button",style:ep,onClick:()=>Z(null),"aria-label":i("center.close"),children:"\u2715"})]}),(0,u.jsx)("div",{style:d==="changes"?{display:"contents"}:{display:"none"},children:(0,u.jsx)(nv,{snapshot:n,busy:v,execute:X,query:t,t:i,openRequest:a})}),(0,u.jsx)("div",{style:d==="history"?{display:"contents"}:{display:"none"},children:(0,u.jsx)(dv,{query:t,run:o,t:i})})]})]}),R!==null&&(0,u.jsx)(c,{text:R.text,onDone:()=>A(null)},R.seq)]})}function ho(e,r){return e.path.localeCompare(r.path)}function rv(e){return e.status==="untracked"?"untracked":e.staged?"staged":"unstaged"}function nv({snapshot:e,busy:r,execute:n,query:o,t,openRequest:i=null}){let{Button:a}=Wt(),[s,l]=(0,j.useState)(new Set),[c,d]=(0,j.useState)(""),[f,v]=(0,j.useState)(null),[g,k]=(0,j.useState)(new Set),[Z,R]=(0,j.useState)(360),[A,X]=(0,j.useState)(null),[F,O]=(0,j.useState)(null),[M,S]=(0,j.useState)(!1),L=(0,j.useRef)(0);(0,j.useEffect)(()=>{if(f===null)return;let z=setTimeout(()=>v(null),3e3);return()=>clearTimeout(z)},[f]);let G=(0,j.useMemo)(()=>e.changes.filter(z=>z.staged).sort(ho),[e]),K=(0,j.useMemo)(()=>e.changes.filter(z=>!z.staged&&z.status!=="untracked").sort(ho),[e]),te=(0,j.useMemo)(()=>e.changes.filter(z=>z.status==="untracked").sort(ho),[e]),Q=[{key:"staged",labelKey:"changes.groupStaged",items:G},{key:"unstaged",labelKey:"changes.groupUnstaged",items:K},{key:"untracked",labelKey:"changes.groupUnversioned",items:te}].filter(z=>z.items.length>0),xe=z=>{l(T=>{let q=new Set(T);return q.has(z)?q.delete(z):q.add(z),q})},w=(z,T)=>{l(q=>{let oe=new Set(q);for(let ve of z)T?oe.add(ve.path):oe.delete(ve.path);return oe})},re=z=>{k(T=>{let q=new Set(T);return q.has(z)?q.delete(z):q.add(z),q})},ie=async(z,T)=>{let q=++L.current;X({path:z,base:T}),O(null),S(!0);let oe=await o({kind:"diff",path:z,base:T});q===L.current&&(S(!1),O(oe.ok&&oe.value.kind==="diff"?oe.value.text:null))};(0,j.useEffect)(()=>{i!==null&&(k(z=>{let T=e.changes.filter(ve=>ve.path===i.path).map(rv),q=[...new Set(T)].filter(ve=>z.has(ve));if(q.length===0)return z;let oe=new Set(z);for(let ve of q)oe.delete(ve);return oe}),ie(i.path,i.base))},[i]),(0,j.useEffect)(()=>{if(A===null)return;let z=Ku(A,e.changes);z===null?(L.current+=1,X(null),O(null)):ie(z.path,z.base)},[e]);let Ze=()=>{let z=c.trim();if(z===""||r)return;let T=s.size>0?[...s]:void 0;n({kind:"commit",message:z,...T===void 0?{}:{paths:T}},t("center.done")).then(q=>{q&&(l(new Set),d(""))})},st={onToggle:xe,onStage:z=>{n({kind:"stage",paths:[z]},t("center.done"))},onUnstage:z=>{n({kind:"unstage",paths:[z]},t("center.done"))},onDiscard:z=>{f===z?n({kind:"discard",paths:[z]},t("center.done")):v(T=>T===z?null:z)}},Ke=(0,j.useMemo)(()=>Q.flatMap(z=>z.items).filter(z=>!z.isDirectory),[Q]),Bt=z=>{let T=Xu(Ke,A,z);T!==null&&ie(T.path,T.base)},we=(0,j.useMemo)(()=>F===null||F===""?null:Wu(Ai(F)),[F]);return(0,u.jsxs)("div",{style:tp,children:[(0,u.jsxs)("div",{style:{...rp,width:Z},children:[(0,u.jsxs)("div",{style:Bd,children:[(0,u.jsx)(a,{size:"sm",disabled:r||K.length===0&&te.length===0,onClick:()=>{n({kind:"stage-all"},t("center.done"))},children:t("center.stageAll")}),(0,u.jsx)(a,{size:"sm",disabled:r||G.length===0,onClick:()=>{n({kind:"unstage-all"},t("center.done"))},children:t("center.unstageAll")}),(0,u.jsx)(a,{size:"sm",disabled:r||G.length+K.length===0,onClick:()=>{f==="all"?n({kind:"discard-all"},t("center.done")):v(z=>z==="all"?null:"all")},children:t(f==="all"?"center.confirmDiscard":"center.discardAll")})]}),(0,u.jsx)("div",{style:np,children:e.changes.length===0?(0,u.jsx)("div",{style:_e,children:t("center.empty")}):(0,u.jsxs)(u.Fragment,{children:[Q.map(z=>(0,u.jsxs)("div",{children:[(0,u.jsx)(iv,{label:t(z.labelKey),count:z.items.length,closed:g.has(z.key),allChecked:z.items.length>0&&z.items.every(T=>s.has(T.path)),someChecked:z.items.some(T=>s.has(T.path)),onToggleClosed:()=>re(z.key),onSelectAll:T=>w(z.items,T),t}),!g.has(z.key)&&z.items.map(T=>(0,u.jsx)(ov,{change:T,checked:s.has(T.path),busy:r,armed:f,diffActive:A!==null&&A.path===T.path&&A.base===ze(T),rowActions:st,onShowDiff:(q,oe)=>{ie(q,oe)},t},T.path))]},z.key)),e.truncated&&(0,u.jsx)("div",{style:_e,children:t("changes.listTruncated").replace("{count}",String(e.changes.length)).replace("{total}",String(e.staged+e.modified+e.untracked))})]})}),(0,u.jsxs)("div",{style:Jd,children:[(0,u.jsx)("textarea",{className:"dsh-git-ui__commit-input",style:Vd,placeholder:t("center.commitMessage"),value:c,disabled:r,onChange:z=>d(z.target.value),onKeyDown:z=>{z.key==="Enter"&&(z.metaKey||z.ctrlKey)&&Ze()}}),(0,u.jsxs)("div",{style:Wd,children:[s.size>0&&(0,u.jsx)("span",{style:to,children:t("center.commitSelected").replace("{count}",String(s.size))}),(0,u.jsx)("span",{style:{flex:1}}),(0,u.jsx)("span",{style:$p,"aria-hidden":"true",children:"\u2318/Ctrl + \u21B5"}),(0,u.jsx)(a,{variant:"primary",size:"sm",disabled:r||c.trim()==="",onClick:Ze,children:t(r?"center.busy":"center.commit")})]})]})]}),(0,u.jsx)(Kr,{kind:"col",onDrag:z=>R(T=>Hr(T+z,280,520))}),(0,u.jsx)("div",{style:ip,children:A===null?(0,u.jsx)("div",{style:Wr,children:t("center.selectFileDiff")}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{style:fp,children:[(0,u.jsx)("span",{style:gp,children:A.base==="staged"?t("diff.baseStaged"):t("diff.baseWorktree")}),(()=>{let{name:z,dir:T}=Kt(A.path);return(0,u.jsxs)(u.Fragment,{children:[T!==""&&(0,u.jsx)("span",{style:hp,title:A.path,children:T}),(0,u.jsx)("span",{style:vp,children:z})]})})(),we!==null&&(we.add>0||we.del>0)&&(0,u.jsxs)("span",{style:yp,children:[we.add>0&&(0,u.jsxs)("span",{style:bp,children:["+",we.add]}),we.del>0&&(0,u.jsxs)("span",{style:xp,children:["\u2212",we.del]})]}),(0,u.jsx)("button",{type:"button",className:"dsh-git-ui__icon-btn",style:ce,title:t("diff.prev"),"aria-label":t("diff.prev"),disabled:r||Ke.length===0,onClick:()=>Bt(-1),children:(0,u.jsx)(id,{})}),(0,u.jsx)("button",{type:"button",className:"dsh-git-ui__icon-btn",style:ce,title:t("diff.next"),"aria-label":t("diff.next"),disabled:r||Ke.length===0,onClick:()=>Bt(1),children:(0,u.jsx)(od,{})}),(0,u.jsx)("button",{type:"button",className:"dsh-git-ui__icon-btn",style:ce,title:t("center.close"),"aria-label":t("center.close"),onClick:()=>{L.current+=1,X(null),O(null)},children:(0,u.jsx)(Rr,{})})]}),M?(0,u.jsx)("div",{style:_e,children:t("center.loading")}):(0,u.jsx)(av,{text:F??"",t})]})})]})}function iv({label:e,count:r,closed:n,allChecked:o,someChecked:t,onToggleClosed:i,onSelectAll:a,t:s}){return(0,u.jsxs)("div",{style:Gd,children:[(0,u.jsx)("input",{type:"checkbox",style:eo,checked:o,ref:l=>{l!==null&&(l.indeterminate=t&&!o)},onChange:l=>a(l.target.checked),"aria-label":`${e} ${s("changes.selectAll")}`}),(0,u.jsxs)("button",{type:"button",style:Fd,onClick:i,"aria-expanded":!n,children:[(0,u.jsx)(ct,{open:!n}),(0,u.jsx)("span",{children:e}),(0,u.jsx)("span",{style:Md,children:r})]})]})}function ov({change:e,checked:r,busy:n,armed:o,diffActive:t,rowActions:i,onShowDiff:a,t:s}){let l=e.status==="untracked",{name:c,dir:d,isDir:f}=Kt(e.path,e.isDirectory),v=ze(e),g=o===e.path,k=Vr[e.status]??"var(--dsw-alias-label-primary)";return(0,u.jsxs)("div",{className:"dsh-git-ui__row",style:t?{...Yi,...Ad}:Yi,children:[(0,u.jsx)("input",{type:"checkbox",style:eo,checked:r,disabled:n,onChange:()=>i.onToggle(e.path),"aria-label":e.path}),(0,u.jsx)("span",{style:Mr,"aria-hidden":"true",children:f?(0,u.jsx)(Xe,{}):Nr(e.path)}),(0,u.jsx)("button",{type:"button",style:f?{...Qi,color:k,cursor:"default"}:{...Qi,color:k},title:f?`${e.path} (${s("changes.dir")})`:e.path,disabled:f,onClick:()=>a(e.path,v),children:c}),d!==""?(0,u.jsx)("span",{style:op,children:d}):(0,u.jsx)("span",{style:{flex:1}}),(0,u.jsx)("span",{style:{...Ld,color:k},"aria-hidden":"true",children:tv[e.status]??"\u2022"}),(0,u.jsxs)("span",{className:"dsh-git-ui__row-actions",style:Fr,children:[(0,u.jsx)("button",{type:"button",className:"dsh-git-ui__icon-btn",style:ce,title:s(f?"changes.dir":"changes.actionDiff"),"aria-label":s(f?"changes.dir":"changes.actionDiff"),disabled:n||f,onClick:()=>a(e.path,v),children:(0,u.jsx)(nd,{})}),l?(0,u.jsx)("button",{type:"button",className:"dsh-git-ui__icon-btn",style:ce,title:s("center.stage"),"aria-label":s("center.stage"),disabled:n,onClick:()=>i.onStage(e.path),children:(0,u.jsx)(qt,{})}):e.staged?(0,u.jsx)("button",{type:"button",className:"dsh-git-ui__icon-btn",style:ce,title:s("center.unstage"),"aria-label":s("center.unstage"),disabled:n,onClick:()=>i.onUnstage(e.path),children:(0,u.jsx)(Er,{})}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("button",{type:"button",className:"dsh-git-ui__icon-btn",style:ce,title:s("center.stage"),"aria-label":s("center.stage"),disabled:n,onClick:()=>i.onStage(e.path),children:(0,u.jsx)(qt,{})}),(0,u.jsx)("button",{type:"button",className:"dsh-git-ui__icon-btn",style:g?{...ce,color:"var(--dsw-alias-state-error-primary)"}:ce,title:s(g?"center.confirmDiscard":"center.discard"),"aria-label":s(g?"center.confirmDiscard":"center.discard"),disabled:n,onClick:()=>i.onDiscard(e.path),children:(0,u.jsx)(Zr,{})})]})]})]})}var vo=2e3;function av({text:e,t:r}){let n=(0,j.useMemo)(()=>Ai(e),[e]),o=(0,j.useMemo)(()=>Vu(n,vo),[n]);if(Hu(e))return(0,u.jsx)("div",{style:_e,children:r("diff.binary")});if(n.length===0)return(0,u.jsx)("div",{style:_e,children:r("center.diffEmpty")});let t=s=>s==="del"?dp:s==="add"?pp:s==="empty"?mp:{},i=(s,l)=>(0,u.jsxs)("div",{style:{...cp,...t(s.kind)},children:[(0,u.jsx)("span",{style:up,children:s.num??""}),(0,u.jsx)("span",{style:lp,children:s.text})]},l),a=s=>o.map((l,c)=>i(s==="left"?l.left:l.right,String(c)));return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{style:ap,children:[(0,u.jsx)("div",{style:ro,children:(0,u.jsx)("div",{style:no,children:a("left")})}),(0,u.jsx)("div",{style:{...ro,...sp},children:(0,u.jsx)("div",{style:no,children:a("right")})})]}),n.length>vo&&(0,u.jsx)("div",{style:_e,children:r("diff.truncated").replace("{count}",String(vo))})]})}var mm=16,sv=192,cv=8,lv=4,uv=2;function dv({query:e,run:r,t:n}){let[o,t]=(0,j.useState)([]),[i,a]=(0,j.useState)(0),[s,l]=(0,j.useState)(!1),[c,d]=(0,j.useState)(null),[f,v]=(0,j.useState)(null),[g,k]=(0,j.useState)({ref:null,search:"",author:"",since:""}),[Z,R]=(0,j.useState)(""),[A,X]=(0,j.useState)([]),[F,O]=(0,j.useState)(null),[M,S]=(0,j.useState)(new Set(["tags"])),[L,G]=(0,j.useState)(new Set),[K,te]=(0,j.useState)(170),[Q,xe]=(0,j.useState)(360),[w,re]=(0,j.useState)(58),ie=(0,j.useRef)(null),Ze=(0,j.useMemo)(()=>Date.now(),[o]),st=(0,j.useRef)(null),Ke=(0,j.useRef)(null),Bt=(0,j.useRef)(new Map),we=$=>JSON.stringify([$.ref,$.search,$.author,$.since]),z=($,C,B)=>{let ae=Bt.current,Vt=we($);for(ae.delete(Vt),ae.set(Vt,{commits:C,total:B});ae.size>10;){let Uu=ae.keys().next().value;if(Uu===void 0)break;ae.delete(Uu)}},T=g.search!=="",q=(0,j.useRef)(Ur()),oe=(0,j.useRef)([]),[ve,Ni]=(0,j.useState)([]);(0,j.useEffect)(()=>{if(T){q.current=Ur(),oe.current=o,Ni([]);return}let $=oe.current;if(!($.length<=o.length&&$.every((B,ae)=>B.hash===o[ae]?.hash)))q.current=Ur(),Ni(q.current.append(o));else if(o.length>$.length){let B=q.current.append(o.slice($.length));B.length>0&&Ni(ae=>[...ae,...B])}oe.current=o},[o,T]);let Jt=(0,j.useMemo)(()=>Au(ve),[ve]),Su=(0,j.useMemo)(()=>Jt===0?mm:Math.max(cv,Math.min(mm,sv/Jt)),[Jt]),Oh=T?0:Math.ceil(Jt*Su),wu=g.search!==""||g.author!==""||g.since!=="",Iu=(0,j.useMemo)(()=>new Set(o.map($=>$.hash)),[o]),zu=(0,j.useMemo)(()=>Lu(ve,Iu,wu),[ve,Iu,wu]),Pu=T?"28px minmax(96px,1fr) 72px 110px 110px":`${Oh}px minmax(96px,1fr) 72px 110px 110px`,Uh=(0,j.useMemo)(()=>T?o.map($=>({commit:$,column:0,verticals:[],joins:[],nodeFromTop:!1,nodeContinues:!1,edges:[]})):zu,[T,o,zu]),ju=(0,j.useMemo)(()=>f===null?[]:Fu(f.stats),[f]),Du=async($,C)=>{if(Ke.current!==null)return;Ke.current=$,l(!0);let B=await e({kind:"history",limit:ev,skip:$,...C.ref!==null?{ref:C.ref}:{},...C.search!==""?{search:C.search}:{},...C.author!==""?{author:C.author}:{},...C.since!==""?{since:C.since}:{}});if(l(!1),Ke.current=null,!B.ok||B.value.kind!=="history")return;let ae=B.value.commits,Vt=$===0?ae:[...o,...ae];t(Vt),a(B.value.total),z(C,Vt,B.value.total)},Th=()=>{let $=st.current;$===null||s||o.length>=i||$.scrollTop+$.clientHeight>=$.scrollHeight-240&&Du(o.length,g)},Ei=(0,j.useCallback)(async()=>{let[$,C,B]=await Promise.all([e({kind:"branches"}),e({kind:"tags"}),e({kind:"authors"})]);X(B.ok&&B.value.kind==="authors"?B.value.authors:[]),O({current:$.ok&&$.value.kind==="branches"?$.value.current:null,defaultBranch:$.ok&&$.value.kind==="branches"?$.value.defaultBranch:null,local:$.ok&&$.value.kind==="branches"?$.value.local:[],remote:$.ok&&$.value.kind==="branches"?$.value.remote:[],tags:C.ok&&C.value.kind==="tags"?C.value.tags:[]})},[e]),[Zi,Cu]=(0,j.useState)(!1),[Nh,Ou]=(0,j.useState)(null),Eh=(0,j.useCallback)(async()=>{if(Zi)return;Cu(!0),Ou(null);let $=await r({kind:"fetch"});await Ei(),Cu(!1),Ou($.ok?n("center.fetchDone"):$.error.message??$.error.code)},[Zi,r,Ei,n]);(0,j.useEffect)(()=>{Ei()},[]),(0,j.useEffect)(()=>{d(null),v(null);let $=Bt.current.get(we(g));$!==void 0&&(t($.commits),a($.total)),Du(0,g)},[g]),(0,j.useEffect)(()=>{let $=setTimeout(()=>{k(C=>C.search===Z?C:{...C,search:Z})},300);return()=>clearTimeout($)},[Z]);let Zh=(0,j.useCallback)(async $=>{d($),v(null);let C=await e({kind:"show",ref:$.hash});C.ok&&C.value.kind==="show"&&C.value.commit!==null&&v({commit:C.value.commit,body:C.value.body,stats:C.value.stats})},[e]),Rh=$=>{G(C=>{let B=new Set(C);return B.has($)?B.delete($):B.add($),B})},Ah=$=>{S(C=>{let B=new Set(C);return B.has($)?B.delete($):B.add($),B})},Lh=()=>{let $=[],C=B=>{for(let ae of B)ae.dir&&($.push(ae.path),C(ae.children))};C(ju),G(new Set($))};return(0,u.jsxs)("div",{style:Sp,children:[(0,u.jsx)("div",{style:{...lo,width:K,borderRight:"1px solid var(--dsw-alias-border-l2)",borderRadius:"12px 0 0 12px"},children:(0,u.jsx)(pv,{tree:F,filter:g.ref===null?{kind:"all"}:{kind:"ref",name:g.ref},onFilter:$=>k(C=>({...C,ref:$.kind==="all"?null:$.name})),closed:M,onToggleSection:Ah,onFetch:Eh,fetching:Zi,fetchNote:Nh,t:n})}),(0,u.jsx)(Kr,{kind:"col",onDrag:$=>te(C=>Hr(C+$,140,320))}),(0,u.jsxs)("div",{style:Fp,children:[(0,u.jsxs)("div",{style:Op,children:[(0,u.jsx)("input",{className:"dsh-git-ui__branch-input",style:Up,placeholder:n("history.search"),value:Z,onChange:$=>R($.target.value),"aria-label":n("history.search")}),(0,u.jsx)(dt,{ariaLabel:n("history.branch"),value:g.ref??"",options:[{value:"",label:n("history.allBranches")},...F?.local.map($=>({value:$.name,label:$.name}))??[],...F?.remote.map($=>({value:$.name,label:$.name}))??[]],onSelect:$=>k(C=>({...C,ref:$===""?null:$}))}),(0,u.jsx)(dt,{ariaLabel:n("history.allUsers"),value:g.author,options:[{value:"",label:n("history.allUsers")},...A.map($=>({value:$,label:$}))],onSelect:$=>k(C=>({...C,author:$}))}),(0,u.jsx)(dt,{ariaLabel:n("history.allTime"),value:g.since,options:[{value:"",label:n("history.allTime")},{value:"1 day ago",label:n("history.today")},{value:"7 days ago",label:n("history.last7d")},{value:"30 days ago",label:n("history.last30d")},{value:"90 days ago",label:n("history.last90d")}],onSelect:$=>k(C=>({...C,since:$}))})]}),(0,u.jsxs)("div",{style:{...Mp,opacity:s&&o.length>0?.55:1,transition:"opacity var(--ds-transition-duration) var(--ds-ease-in-out)"},ref:st,onScroll:Th,children:[s&&o.length===0&&(0,u.jsx)("div",{style:lt,children:n("center.loading")}),!s&&o.length===0&&(0,u.jsx)("div",{style:lt,children:n("history.noResults")}),o.length>0&&(0,u.jsxs)("div",{style:{...Wp,gridTemplateColumns:Pu},"aria-hidden":"true",children:[(0,u.jsx)("span",{}),(0,u.jsx)("span",{children:n("history.commit")}),(0,u.jsx)("span",{children:n("history.hash")}),(0,u.jsx)("span",{children:n("history.author")}),(0,u.jsx)("span",{children:n("history.time")})]}),Uh.map($=>(0,u.jsx)(fv,{row:$,cols:Jt,laneW:Su,gridTpl:Pu,isSelected:c?.hash===$.commit.hash,now:Ze,onSelect:Zh,showGraph:!T,t:n},$.commit.hash)),o.length<i&&(0,u.jsx)("div",{style:Zp,children:s?n("center.loading"):""})]})]}),(0,u.jsx)(Kr,{kind:"col",onDrag:$=>xe(C=>Hr(C-$,260,560))}),(0,u.jsxs)("div",{style:{...lo,width:Q,borderLeft:"1px solid var(--dsw-alias-border-l2)",borderRadius:"0 12px 12px 0"},children:[(0,u.jsxs)("div",{style:co,children:[(0,u.jsx)("span",{style:to,children:n("right.files")}),(0,u.jsx)("span",{style:{flex:1}}),(0,u.jsx)("button",{type:"button",style:uo,className:"dsh-git-ui__refresh","aria-label":n("right.expandAll"),title:n("right.expandAll"),onClick:()=>G(new Set),children:(0,u.jsx)(td,{})}),(0,u.jsx)("button",{type:"button",style:uo,className:"dsh-git-ui__refresh","aria-label":n("right.collapseAll"),title:n("right.collapseAll"),onClick:Lh,children:(0,u.jsx)(rd,{})})]}),(0,u.jsx)("div",{style:rm,ref:ie,children:c===null?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{style:Wr,children:n("right.selectCommit")}),(0,u.jsx)("div",{style:{...Wr,...am},children:n("right.commitDetails")})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{style:{...nm,flex:"none",height:`${w}%`},children:f===null?(0,u.jsx)("div",{style:lt,children:n("center.loading")}):f.stats.length===0?(0,u.jsx)("div",{style:lt,children:n("center.diffEmpty")}):(0,u.jsx)(hm,{nodes:ju,collapsed:L,onToggle:Rh})}),(0,u.jsx)(Kr,{kind:"row",onDrag:$=>{let C=ie.current?.clientHeight??1;re(B=>Hr(B+$/C*100,25,75))}}),(0,u.jsxs)("div",{style:im,children:[(0,u.jsxs)("div",{style:sm,children:[(0,u.jsx)("span",{style:cm,children:c.subject}),(0,u.jsxs)("span",{style:lm,children:[c.shortHash," \xB7 ",c.author," \xB7 ",fm(c.dateIso,Ze,n)]})]}),f!==null&&f.body!==""?(0,u.jsx)("pre",{style:om,children:f.body}):(0,u.jsx)("div",{style:lt,children:n("right.noMessage")})]})]})})]})]})}function pv({tree:e,filter:r,onFilter:n,closed:o,onToggleSection:t,onFetch:i,fetching:a,fetchNote:s,t:l}){let[c,d]=(0,j.useState)(""),f=c.trim().toLowerCase(),v=f!=="",g=S=>!v||S.toLowerCase().includes(f),k=S=>{if(!v)return S;let L=S.toLowerCase().indexOf(f);return L===-1?S:(0,u.jsxs)(u.Fragment,{children:[S.slice(0,L),(0,u.jsx)("span",{style:Ap,children:S.slice(L,L+f.length)}),S.slice(L+f.length)]})},Z="var(--dsw-alias-state-warn-primary)",R=(S,L)=>e!==null&&S===e.current?{icon:(0,u.jsx)(Fi,{}),color:Z}:e!==null&&e.defaultBranch!==null&&L===e.defaultBranch?{icon:(0,u.jsx)(ed,{}),color:Z}:{icon:(0,u.jsx)(Gi,{})},A=(S,L,G,K,te,Q)=>{let xe=R(S,L),w=Q!==void 0&&((Q.ahead??0)>0||(Q.behind??0)>0);return(0,u.jsxs)("button",{type:"button",className:"dsh-git-ui__row",style:{...G?{...Pe,...Br}:Pe,paddingLeft:te},onClick:()=>n({kind:"ref",name:S}),title:S,children:[(0,u.jsx)("span",{style:xe.color===void 0?Yt:{...Yt,color:xe.color},"aria-hidden":"true",children:xe.icon}),(0,u.jsx)("span",{style:K?{...Re,...Pp}:Re,children:k(S)}),w&&(0,u.jsxs)("span",{style:jp,children:[(Q.ahead??0)>0&&`\u2191${Q.ahead}`,(Q.ahead??0)>0&&(Q.behind??0)>0&&" ",(Q.behind??0)>0&&`\u2193${Q.behind}`]}),K&&(0,u.jsx)("span",{style:dm,children:"\u2713"})]})},X=S=>(0,u.jsxs)("button",{type:"button",className:"dsh-git-ui__row",style:{...r.kind==="ref"&&r.name===S?{...Pe,...Br}:Pe,paddingLeft:24},onClick:()=>n({kind:"ref",name:S}),title:S,children:[(0,u.jsx)("span",{style:Yt,"aria-hidden":"true",children:(0,u.jsx)(Fi,{})}),(0,u.jsx)("span",{style:Re,children:k(S)})]},`t-${S}`),F=(S,L)=>(0,u.jsxs)("button",{type:"button",style:Ip,onClick:()=>t(S),"aria-expanded":!o.has(S),children:[(0,u.jsx)(ct,{open:!o.has(S)}),(0,u.jsx)("span",{children:L})]}),O=[];if(e!==null){let S=new Map;for(let L of e.remote){let G=L.name.indexOf("/"),K=G===-1?L.name:L.name.slice(0,G),te=S.get(K);te===void 0?S.set(K,[L]):te.push(L)}O.push(...S.entries())}let M=S=>S.slice(S.indexOf("/")+1);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{style:co,children:[(0,u.jsx)("input",{className:"dsh-git-ui__branch-input",style:Rp,placeholder:l("history.searchTree"),value:c,onChange:S=>d(S.target.value),"aria-label":l("history.searchTree")}),(0,u.jsx)("button",{type:"button",className:"dsh-git-ui__refresh",style:Dp,onClick:()=>{i()},disabled:a,"aria-label":l("center.fetch"),title:l("center.fetch"),children:l(a?"center.fetching":"center.fetch")})]}),s!==null&&(0,u.jsx)("div",{style:Cp,children:s}),(0,u.jsxs)("div",{style:wp,children:[(0,u.jsxs)("button",{type:"button",className:"dsh-git-ui__row",style:r.kind==="all"?{...Pe,...Br}:Pe,onClick:()=>n({kind:"all"}),children:[(0,u.jsx)("span",{style:Yt,"aria-hidden":"true",children:(0,u.jsx)(Gi,{})}),(0,u.jsx)("span",{style:Re,children:l("history.allBranches")})]}),e!==null&&(v?(0,u.jsxs)(u.Fragment,{children:[e.local.filter(S=>g(S.name)).map(S=>A(S.name,S.name,r.kind==="ref"&&r.name===S.name,S.name===e.current,24,S)),e.remote.filter(S=>g(S.name)).map(S=>A(S.name,M(S.name),r.kind==="ref"&&r.name===S.name,!1,24)),e.tags.filter(S=>g(S.name)).map(S=>X(S.name))]}):(0,u.jsxs)(u.Fragment,{children:[F("local",l("center.localBranches")),!o.has("local")&&e.local.map(S=>A(S.name,S.name,r.kind==="ref"&&r.name===S.name,S.name===e.current,24,S)),e.remote.length>0&&F("remote",l("center.remoteBranches")),!o.has("remote")&&O.map(([S,L])=>(0,u.jsxs)("div",{children:[(0,u.jsxs)("button",{type:"button",className:"dsh-git-ui__row",style:{...Pe,paddingLeft:24},onClick:()=>t(`remote:${S}`),"aria-expanded":!o.has(`remote:${S}`),children:[(0,u.jsx)("span",{style:ut,children:(0,u.jsx)(ct,{open:!o.has(`remote:${S}`)})}),(0,u.jsx)("span",{style:Jr,children:(0,u.jsx)(Xe,{})}),(0,u.jsx)("span",{style:Re,children:S})]}),!o.has(`remote:${S}`)&&L.map(G=>A(G.name,M(G.name),r.kind==="ref"&&r.name===G.name,!1,44))]},`g-${S}`)),e.tags.length>0&&F("tags",l("history.tags")),!o.has("tags")&&e.tags.map(S=>X(S.name))]}))]})]})}function hm({nodes:e,collapsed:r,onToggle:n}){return(0,u.jsx)(u.Fragment,{children:e.map(o=>o.dir?(0,u.jsxs)("div",{children:[(0,u.jsxs)("button",{type:"button",className:"dsh-git-ui__row",style:Pe,onClick:()=>n(o.path),"aria-expanded":!r.has(o.path),children:[(0,u.jsx)("span",{style:ut,children:(0,u.jsx)(ct,{open:!r.has(o.path)})}),(0,u.jsx)("span",{style:Jr,children:(0,u.jsx)(Xe,{})}),(0,u.jsx)("span",{style:Re,children:o.name})]}),!r.has(o.path)&&(0,u.jsx)("div",{style:zp,children:(0,u.jsx)(hm,{nodes:o.children,collapsed:r,onToggle:n})})]},o.path):(0,u.jsxs)("div",{className:"dsh-git-ui__row",style:Pe,children:[(0,u.jsx)("span",{style:{...ut,visibility:"hidden"},"aria-hidden":"true",children:(0,u.jsx)(ct,{open:!1})}),(0,u.jsx)("span",{style:{...Jr,color:Vr[o.status??"modified"]},children:(0,u.jsx)(Xt,{})}),(0,u.jsx)("span",{style:{...Re,color:Vr[o.status??"modified"]},title:o.path,children:o.name})]},o.path))})}function Hr(e,r,n){return Math.min(n,Math.max(r,e))}function Kr({kind:e,onDrag:r}){return(0,u.jsx)("div",{className:"dsh-git-ui__splitter",style:e==="col"?Lp:Gp,role:"separator","aria-orientation":e==="col"?"vertical":"horizontal",onMouseDown:o=>{o.preventDefault();let t=o.clientX,i=o.clientY,a=l=>{r(e==="col"?l.clientX-t:l.clientY-i),t=l.clientX,i=l.clientY},s=()=>{window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",s)};window.addEventListener("mousemove",a),window.addEventListener("mouseup",s)}})}function mv(e){let r=0;for(let n=0;n<e.length;n+=1)r+=e.charCodeAt(n);return Ht[r%Ht.length]}var fv=(0,j.memo)(function({row:r,cols:n,laneW:o,gridTpl:t,isSelected:i,now:a,onSelect:s,showGraph:l,t:c}){return(0,u.jsxs)("button",{type:"button",className:"dsh-git-ui__commit-row",style:{...i?{...po,...Vp}:po,gridTemplateColumns:t},onClick:()=>s(r.commit),children:[l?(0,u.jsx)(hv,{row:r,cols:n,laneW:o,endOpen:r.endOpen}):(0,u.jsx)("span",{style:Bp,"aria-hidden":"true",children:(0,u.jsx)("span",{style:{...Jp,background:mv(r.commit.hash)}})}),(0,u.jsxs)("span",{style:Hp,children:[(0,u.jsx)(gv,{refs:r.commit.refs}),(0,u.jsx)("span",{style:Kp,title:r.commit.subject,children:r.commit.subject})]}),(0,u.jsx)("span",{style:Xp,title:r.commit.hash,children:r.commit.shortHash}),(0,u.jsx)("span",{style:qp,title:r.commit.author,children:r.commit.author}),(0,u.jsx)("span",{style:Yp,children:fm(r.commit.dateIso,a,c)})]})});function gv({refs:e}){if(e.length===0)return null;let r=e.slice(0,3),n=e.length-r.length,o=t=>{if(t.head)return Qp;switch(t.kind){case"tag":return tm;case"remote":return fo;default:return em}};return(0,u.jsxs)("span",{style:{display:"inline-flex",gap:4,flex:"none",minWidth:0},title:e.map(t=>t.name).join(", "),children:[r.map(t=>(0,u.jsx)("span",{style:{...mo,...o(t)},children:t.name},`${t.kind}-${t.name}`)),n>0&&(0,u.jsxs)("span",{style:{...mo,...fo},children:["+",n]})]})}function hv({row:e,cols:r,laneW:n,endOpen:o}){let t=Math.max(r,1)*n,i=oo,a=d=>d*n+n/2,s=i/2,l=Math.max(uv,Math.min(lv,n/3)),c=d=>Ht[d%Ht.length];return(0,u.jsxs)("svg",{width:t,height:i,style:{display:"block",flexShrink:0},"aria-hidden":"true",children:[e.verticals.map(d=>(0,u.jsx)("line",{x1:a(d),y1:0,x2:a(d),y2:i,stroke:c(d),strokeWidth:1.5,strokeLinecap:"round"},`v-${d}`)),e.nodeFromTop&&(0,u.jsx)("line",{x1:a(e.column),y1:0,x2:a(e.column),y2:s,stroke:c(e.column),strokeWidth:1.5,strokeLinecap:"round"}),e.joins.map(d=>(0,u.jsxs)("g",{children:[(0,u.jsx)("line",{x1:a(d),y1:0,x2:a(d),y2:s,stroke:c(d),strokeWidth:1.5,strokeLinecap:"round"}),(0,u.jsx)("line",{x1:a(d),y1:s,x2:a(e.column),y2:s,stroke:c(d),strokeWidth:1.5,strokeLinecap:"round"})]},`j-${d}`)),e.nodeContinues&&(o===!0?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("line",{x1:a(e.column),y1:s,x2:a(e.column),y2:i-5,stroke:c(e.column),strokeWidth:1.5,strokeDasharray:"3 3",strokeLinecap:"round"}),(0,u.jsx)("line",{x1:a(e.column)-4,y1:i-5,x2:a(e.column)+4,y2:i-5,stroke:c(e.column),strokeWidth:1.5,strokeLinecap:"round"})]}):(0,u.jsx)("line",{x1:a(e.column),y1:s,x2:a(e.column),y2:i,stroke:c(e.column),strokeWidth:1.5,strokeLinecap:"round"})),e.edges.map((d,f)=>(0,u.jsx)("path",{d:`M ${a(d.from)} ${s} C ${a(d.from)} ${(s+i)/2}, ${a(d.to)} ${(s+i)/2}, ${a(d.to)} ${i}`,fill:"none",stroke:c(d.to),strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},`e-${f}`)),(0,u.jsx)("circle",{cx:a(e.column),cy:s,r:l,fill:c(e.column),stroke:"var(--dsw-alias-bg-layer-2)",strokeWidth:1.5})]})}function vm(e,r,n){return e===null||!(e instanceof Node)?!0:!(r!==null&&r.contains(e)||n!==null&&n.contains(e)||e instanceof Element&&e.closest(".dsh-git-ui__select-menu")!==null)}var I=require("react/jsx-runtime");Td();var vv={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"?",conflicted:"!",typechange:"T"};function $m(e){let r=[];return e.snapshot.staged>0&&r.push(`+${e.snapshot.staged}`),e.snapshot.modified>0&&r.push(`\u2212${e.snapshot.modified}`),e.snapshot.untracked>0&&r.push(`?${e.snapshot.untracked}`),r.join(" ")}function _m(e){let r=[];return e.snapshot.ahead>0&&r.push(`\u2191${e.snapshot.ahead}`),e.snapshot.behind>0&&r.push(`\u2193${e.snapshot.behind}`),r.join(" ")}function yv(e,r,n){let o=Date.parse(e);if(!Number.isFinite(o))return e;let t=Math.max(0,Math.floor((r-o)/1e3)),i=(a,s)=>n(a).replace("{n}",String(s));return t<60?n("time.justNow"):t<3600?i("time.minutesAgo",Math.floor(t/60)):t<86400?i("time.hoursAgo",Math.floor(t/3600)):i("time.daysAgo",Math.floor(t/86400))}function bv(e,r){let n=e.snapshot,o=n.branch===null?`(${r("pill.detached")}) \xB7 ${n.head??""}`:n.unborn?`${n.branch} \xB7 ${r("pill.noCommits")}`:n.branch,t=[$m(e),_m(e)].filter(Boolean);return{branch:o,badges:t}}function ym({label:e,title:r,t:n}){return(0,I.jsx)("span",{className:"dsh-git-ui__pill",style:ud,title:r,"aria-label":e,children:e})}function xv({view:e,refresh:r,openCenter:n,onOpenDiff:o,run:t,query:i,t:a}){let{Button:s}=Wt(),l=Date.now(),c=e.snapshot,d=c.branch===null?`(${a("pill.detached")})`:c.branch,[f,v]=(0,Y.useState)(null),[g,k]=(0,Y.useState)(!1),[Z,R]=(0,Y.useState)(""),[A,X]=(0,Y.useState)(null),[F,O]=(0,Y.useState)(null),M=w=>{X({text:Ar(w.code,w.message,a),...w.message===void 0?{}:{detail:w.message},...Mi(w.code)===null?{}:{action:Mi(w.code)??void 0}})},S=async()=>{let w=await i({kind:"branches"});w.ok&&w.value.kind==="branches"&&v({current:w.value.current,local:w.value.local})};(0,Y.useEffect)(()=>{S()},[]),(0,Y.useEffect)(()=>{if(F===null)return;let w=setTimeout(()=>O(null),3e3);return()=>clearTimeout(w)},[F]);let L=async w=>{if(g||w==="")return;k(!0),X(null);let re=await t({kind:"branch-checkout",name:w});k(!1),re.ok||M(re.error),await S()},G=async()=>{let w=Z.trim();if(w===""||g)return;k(!0),X(null);let re=await t({kind:"branch-create",name:w});if(re.ok){let ie=await t({kind:"branch-checkout",name:w});ie.ok||M(ie.error),R("")}else M(re.error);k(!1),await S()},K=async(w,re)=>{if(g)return;k(!0),X(null);let ie=await t(w);k(!1),ie.ok||M(ie.error)},te=w=>{K({kind:"stage",paths:[w]},w)},Q=w=>{K({kind:"unstage",paths:[w]},w)},xe=w=>{if(!g){if(F!==w){O(w);return}O(null),K({kind:"discard",paths:[w]},w)}};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("header",{style:pd,children:[(0,I.jsxs)("div",{style:md,children:[(0,I.jsx)("span",{style:c.dirty?Ji:Lr,"aria-hidden":"true"}),f===null?(0,I.jsx)("span",{style:fd,children:d}):(0,I.jsx)(dt,{value:f.current??"",options:[...f.current===null?[{value:"",label:d}]:[],...f.local.map(w=>({value:w.name,label:w.name}))],onSelect:w=>{L(w)},ariaLabel:a("center.currentBranch"),buttonStyle:vd}),c.unborn&&(0,I.jsx)("span",{style:Gr,children:a("pill.noCommits")}),c.dirty&&(0,I.jsx)("span",{style:Gr,children:$m(e)}),(c.ahead>0||c.behind>0)&&(0,I.jsx)("span",{style:Gr,children:_m(e)})]}),(0,I.jsxs)("div",{style:gd,title:c.root,children:[(0,I.jsx)(Xe,{}),(0,I.jsx)("span",{style:hd,children:c.root})]})]}),(0,I.jsx)("div",{style:yd,children:[["popup.staged",c.staged],["popup.modified",c.modified],["popup.untracked",c.untracked]].map(([w,re])=>(0,I.jsxs)("span",{style:bd,children:[(0,I.jsx)("span",{style:xd,children:re}),(0,I.jsx)("span",{style:$d,children:a(w)})]},w))}),(0,I.jsxs)("div",{style:_d,children:[(0,I.jsx)("input",{className:"dsh-git-ui__branch-input",style:um,placeholder:a("center.branchName"),value:Z,disabled:g,onChange:w=>R(w.target.value),onKeyDown:w=>{w.key==="Enter"&&G()}}),(0,I.jsx)(s,{size:"sm",disabled:g||Z.trim()==="",onClick:()=>{G()},children:a("center.createAndSwitch")})]}),A!==null&&(0,I.jsxs)("div",{style:Kd,role:"alert",children:[(0,I.jsx)("span",{style:Xd,"aria-hidden":"true",children:(0,I.jsx)(ad,{})}),(0,I.jsx)("span",{style:qd,title:A.detail,children:A.text}),A.action==="open-center"&&(0,I.jsx)("button",{type:"button",className:"dsh-git-ui__change-link",style:Yd,onClick:n,children:a("error.handleChanges")}),(0,I.jsx)("button",{type:"button",className:"dsh-git-ui__icon-btn",style:Qd,title:a("center.close"),"aria-label":a("center.close"),onClick:()=>X(null),children:(0,I.jsx)(Rr,{})})]}),(0,I.jsx)("div",{style:Vi,children:a("popup.recentCommits")}),c.recentCommits.length===0?(0,I.jsx)("div",{style:_e,children:a("popup.emptyCommits")}):c.recentCommits.slice(0,3).map(w=>(0,I.jsxs)("div",{className:"dsh-git-ui__row",style:kd,children:[(0,I.jsx)("div",{style:wd,title:w.subject,children:w.subject}),(0,I.jsxs)("div",{style:Id,children:[(0,I.jsx)("span",{style:Sd,children:w.shortHash}),(0,I.jsx)("span",{style:Wi,children:"\xB7"}),(0,I.jsx)("span",{style:Hi,children:w.author}),(0,I.jsx)("span",{style:Wi,children:"\xB7"}),(0,I.jsx)("span",{style:Hi,children:yv(w.dateIso,l,a)})]})]},w.hash)),(0,I.jsx)("div",{style:Vi,children:a("popup.changes")}),c.changes.length===0?(0,I.jsx)("div",{style:_e,children:a("popup.empty")}):(0,I.jsxs)(I.Fragment,{children:[c.changes.map(w=>{let{name:re,dir:ie,isDir:Ze}=Kt(w.path,w.isDirectory),st=w.status==="untracked";return(0,I.jsxs)("div",{className:"dsh-git-ui__row",style:zd,children:[(0,I.jsx)("span",{style:{...Pd,...Ki[w.status]??Ki.untracked},title:w.status,children:vv[w.status]??"\u2022"}),(0,I.jsx)("span",{style:Mr,"aria-hidden":"true",children:Ze?(0,I.jsx)(Xe,{}):Nr(w.path)}),Ze?(0,I.jsx)("button",{type:"button",className:"dsh-git-ui__change-link",style:Xi,title:w.path,"aria-label":`${re} \u2014 ${a("center.open")}`,onClick:n,children:re}):(0,I.jsx)("button",{type:"button",className:"dsh-git-ui__change-link",style:Xi,title:w.path,"aria-label":`${re} \u2014 ${a("changes.actionDiff")}`,onClick:()=>o(w.path,ze(w)),children:re}),ie!==""?(0,I.jsx)("span",{style:jd,children:ie}):(0,I.jsx)("span",{style:{flex:"1 1 0%",minWidth:0}}),(0,I.jsxs)("span",{className:"dsh-git-ui__row-actions",style:Fr,children:[w.staged?(0,I.jsx)("button",{type:"button",className:"dsh-git-ui__icon-btn",style:ce,title:a("center.unstage"),"aria-label":a("center.unstage"),disabled:g,onClick:()=>Q(w.path),children:(0,I.jsx)(Er,{})}):(0,I.jsx)("button",{type:"button",className:"dsh-git-ui__icon-btn",style:ce,title:a("center.stage"),"aria-label":a("center.stage"),disabled:g,onClick:()=>te(w.path),children:(0,I.jsx)(qt,{})}),!st&&(0,I.jsx)("button",{type:"button",className:"dsh-git-ui__icon-btn",style:F===w.path?{...ce,color:"var(--dsw-alias-state-error-primary)"}:ce,title:F===w.path?a("center.confirmDiscard"):a("center.discard"),"aria-label":F===w.path?a("center.confirmDiscard"):a("center.discard"),disabled:g,onClick:()=>xe(w.path),children:(0,I.jsx)(Zr,{})})]})]},w.path)}),c.truncated&&(0,I.jsx)("div",{style:_e,children:a("popup.changesTruncated").replace("{count}",String(c.changes.length))})]}),(0,I.jsxs)("div",{style:Dd,children:[(0,I.jsx)("span",{style:Ud,children:a("popup.checkedAt").replace("{time}",new Date(c.checkedAt).toLocaleTimeString())}),(0,I.jsxs)("span",{style:Cd,children:[(0,I.jsx)($v,{refresh:r,t:a}),(0,I.jsx)("button",{type:"button",className:"dsh-git-ui__footer-primary",style:{...qi,...Od,padding:"4px 10px"},onClick:n,children:a("center.open")})]})]})]})}function $v({refresh:e,t:r}){let[n,o]=(0,Y.useState)(!1);return(0,I.jsx)("button",{type:"button",className:"dsh-git-ui__refresh",style:qi,onClick:()=>{n||(o(!0),e().finally(()=>o(!1)))},disabled:n,children:n?"\u2026":r("popup.refresh")})}var bm=340,yo=420,_v=6,kv=6,qe=8;function km({useGit:e,useSession:r,refresh:n,run:o,query:t,t:i}){let a=e(G=>G),s=(0,Y.useRef)(null);a.state==="ready"&&(s.current=a);let l=a.state==="loading"&&s.current!==null?s.current:a,c=r(G=>Tu(G)),d=(0,Y.useRef)(c);(0,Y.useEffect)(()=>{c<=d.current||(d.current=c,n())},[c]);let f=(0,Y.useRef)(null),v=(0,Y.useRef)(null),[g,k]=(0,Y.useState)(!1),[Z,R]=(0,Y.useState)(!1),[A,X]=(0,Y.useState)(null),[F,O]=(0,Y.useState)(null),M=(G,K)=>{O({path:G,base:K}),k(!1),X(null),R(!0)};if((0,Y.useEffect)(()=>{n()},[]),(0,Y.useLayoutEffect)(()=>{if(!g){X(null);return}let G=f.current;if(G===null)return;let K=()=>{let te=G.getBoundingClientRect(),Q=Math.max(qe,Math.min(te.right-bm,window.innerWidth-bm-qe)),xe=te.bottom+_v,w=xe+yo>window.innerHeight-qe?Math.max(qe,te.top-yo-kv):xe;X({top:w,left:Q})};return K(),window.addEventListener("scroll",K,!0),window.addEventListener("resize",K),()=>{window.removeEventListener("scroll",K,!0),window.removeEventListener("resize",K)}},[g]),(0,Y.useLayoutEffect)(()=>{if(!g||A===null)return;let G=v.current?.offsetHeight??yo;A.top+G>window.innerHeight-qe&&X({left:A.left,top:Math.max(qe,window.innerHeight-G-qe)})},[g,A]),(0,Y.useEffect)(()=>{if(!g)return;let G=()=>{k(!1),X(null)},K=Q=>{vm(Q.target,f.current,v.current)&&G()},te=Q=>{Q.key==="Escape"&&G()};return document.addEventListener("mousedown",K),document.addEventListener("keydown",te),()=>{document.removeEventListener("mousedown",K),document.removeEventListener("keydown",te)}},[g]),l.state==="cold"||l.state==="no-cwd"||l.state==="loading")return null;if(l.state==="error")return l.error.code==="not-a-git-repo"?(0,I.jsx)(ym,{label:i("pill.noRepo"),t:i}):(0,I.jsx)(ym,{label:i("pill.unavailable"),title:l.error.code==="git-unavailable"?l.error.detail:l.error.code,t:i});let S=l.snapshot.dirty,L=bv(l,i);return(0,I.jsxs)("span",{ref:f,style:{display:"inline-flex"},children:[(0,I.jsxs)("button",{type:"button",className:"dsh-git-ui__pill",style:Bi,onClick:()=>k(!g),"aria-haspopup":"dialog","aria-expanded":g,title:`${l.snapshot.root}
|
|
6
|
-
${[L.branch,...L.badges].filter(Boolean).join(" \xB7 ")}`,children:[(0,I.jsx)("span",{style:S?Ji:Lr,"aria-hidden":"true"}),(0,I.jsx)("span",{style:cd,children:L.branch}),L.badges.length>0&&(0,I.jsx)("span",{style:ld,children:L.badges.join(" \xB7 ")})]}),g&&A!==null&&(0,xm.createPortal)((0,I.jsx)("div",{ref:v,className:"dsh-git-ui__pop",style:{...dd,top:A.top,left:A.left},role:"dialog","aria-label":i("popup.title"),children:(0,I.jsx)(xv,{view:l,refresh:n,openCenter:()=>{k(!1),X(null),R(!0)},onOpenDiff:M,run:o,query:t,t:i})}),document.body),(0,I.jsx)(gm,{open:Z,onClose:()=>R(!1),snapshot:l.snapshot,run:o,query:t,t:i,openRequest:F})]})}var pt=require("@deepseek-ai/dsh-client-ui-primitives"),Sm={Modal:pt.Modal,Button:pt.Button,Toast:pt.Toast};function wm(e){return{registerLocale(r,n){e.locale.register(r,n)},async mountRemoteAndGetService(r,n){if(await e.remote.$mount(r),n==="gitInfo")return e.remote.gitInfo;throw new Error(`adaptDshClientContext: \u672A\u77E5\u547D\u540D\u7A7A\u95F4 "${n}"`)},registerSlotEntry(r,n){let o;return e.slots.inject(r.name,()=>(o=e.slots.register({name:r.name,id:r.id,order:r.order,locale:r.locale,inject:r.inject},n),()=>{o?.()})),()=>{o?.()}},onEvent(r,n){return e.on(r,n)},effect(r,n){e.effect(r,n)}}}var Sv="conversation.session.header.utilities";async function Im(e,r,n){e.effect(()=>e.registerLocale("git",r.locales),"dsh-git-ui: dictionaries");let o=await e.mountRemoteAndGetService(r.remoteContribution,"gitInfo"),t=new Map,i=new Map,a=c=>{let d=t.get(c);return d===void 0&&(d=r.createController(o,c),t.set(c,d)),d},s={name:Sv,id:"git",order:10,locale:"git",inject:c=>{let d=i.get(c);if(d===void 0){let f=a(c);d={hooks:{git:f},refresh:()=>f.refresh(),run:v=>f.run(v),query:v=>f.query(v)},i.set(c,d)}return d}},l=e.registerSlotEntry(s,n);e.effect(()=>()=>{l();for(let c of t.values())c.dispose();t.clear(),i.clear()},"dsh-git-ui: slot and controller lifecycle"),e.onEvent("connection/reset",()=>{for(let c of t.values())c.resync()})}var zm=new Set(["cwd-unavailable","session-not-found"]),wv=3e4,Iv=6e4,Xr=class{constructor(r,n){this.remote=r;this.sessionId=n}remote;sessionId;view={state:"cold"};listeners=new Set;timer;inflight;disposed=!1;pollMs=wv;subscribe(r){return this.listeners.add(r),()=>{this.listeners.delete(r)}}getSnapshot(){return this.view}ensure(){this.view.state!=="cold"&&this.view.state!=="no-cwd"||this.refresh()}refresh(){return this.inflight!==void 0?this.inflight:this.disposed?Promise.resolve():(this.setView({state:"loading"}),this.inflight=this.remote.snapshot({sessionId:this.sessionId}).then(r=>{if(this.disposed)return;if(!r.ok){let o=[r.error.code,r.error.message].filter(Boolean).join(": ");this.setView({state:"error",error:{code:"git-unavailable",detail:o||"rpc failure"}});return}let n=r.value;n.ok?(this.pollMs=n.value.refreshIntervalMs,this.setView({state:"ready",snapshot:n.value})):zm.has(n.error.code)?this.setView({state:"no-cwd"}):this.setView({state:"error",error:n.error})}).catch(()=>{this.disposed||this.setView({state:"error",error:{code:"git-unavailable",detail:"transport failure"}})}).finally(()=>{this.inflight=void 0,this.disposed||this.schedulePoll()}),this.inflight)}resync(){this.disposed||this.view.state==="cold"||this.view.state==="no-cwd"||this.refresh()}run(r){if(this.inflight!==void 0)return this.inflight.then(()=>this.run(r));if(this.disposed)return Promise.resolve({ok:!1,error:{code:"git-error",message:"controller disposed"}});let n=this.remote.run({sessionId:this.sessionId,action:r}).then(o=>{if(this.disposed)return{ok:!1,error:{code:"git-error",message:"controller disposed"}};if(!o.ok){let i=[o.error.code,o.error.message].filter(Boolean).join(": ");return this.setView({state:"error",error:{code:"git-unavailable",detail:i||"rpc failure"}}),{ok:!1,error:{code:"git-error",message:i||"rpc failure"}}}let t=o.value;return t.ok?(this.pollMs=t.snapshot.refreshIntervalMs,this.setView({state:"ready",snapshot:t.snapshot})):zm.has(t.error.code)&&this.setView({state:"no-cwd"}),t}).catch(o=>{let t=o instanceof Error?o.message:String(o);return this.disposed||this.setView({state:"error",error:{code:"git-unavailable",detail:"transport failure"}}),{ok:!1,error:{code:"git-error",message:t}}}).finally(()=>{this.inflight=void 0,this.disposed||this.schedulePoll()});return this.inflight=n.then(()=>{}),n}query(r){if(this.inflight!==void 0)return this.inflight.then(()=>this.query(r));if(this.disposed)return Promise.resolve({ok:!1,message:"controller disposed"});let n=this.remote.query({sessionId:this.sessionId,query:r}).then(o=>{if(!o.ok)return{ok:!1,message:[o.error.code,o.error.message].filter(Boolean).join(": ")||"rpc failure"};let t=o.value;return t.ok?{ok:!0,value:t.value}:{ok:!1,message:t.error.message??t.error.code}}).catch(o=>({ok:!1,message:o instanceof Error?o.message:String(o)})).finally(()=>{this.inflight=void 0,this.disposed||this.schedulePoll()});return this.inflight=n.then(()=>{}),n}dispose(){this.disposed=!0,this.stopPolling()}schedulePoll(){if(this.stopPolling(),this.disposed||this.pollMs<=0||this.view.state==="cold")return;let r=this.view.state==="no-cwd"?Iv:this.pollMs;this.timer=setTimeout(()=>{this.disposed||this.inflight!==void 0||this.refresh()},r)}stopPolling(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0)}setView(r){this.view=r;for(let n of[...this.listeners])n()}};var m={};Ie(m,{$brand:()=>xo,$input:()=>Gs,$output:()=>Ls,NEVER:()=>bo,TimePrecision:()=>Js,ZodAny:()=>Tl,ZodArray:()=>Rl,ZodBase64:()=>Si,ZodBase64URL:()=>wi,ZodBigInt:()=>Mt,ZodBigIntFormat:()=>Pi,ZodBoolean:()=>Ft,ZodCIDRv4:()=>_i,ZodCIDRv6:()=>ki,ZodCUID:()=>gi,ZodCUID2:()=>hi,ZodCatch:()=>au,ZodCodec:()=>Dr,ZodCustom:()=>Cr,ZodCustomStringFormat:()=>Lt,ZodDate:()=>wr,ZodDefault:()=>eu,ZodDiscriminatedUnion:()=>Ll,ZodE164:()=>Ii,ZodEmail:()=>pi,ZodEmoji:()=>mi,ZodEnum:()=>Rt,ZodError:()=>nx,ZodExactOptional:()=>ql,ZodFile:()=>Kl,ZodFirstPartyTypeKind:()=>bu,ZodFunction:()=>hu,ZodGUID:()=>xr,ZodIPv4:()=>xi,ZodIPv6:()=>$i,ZodISODate:()=>ai,ZodISODateTime:()=>oi,ZodISODuration:()=>ci,ZodISOTime:()=>si,ZodIntersection:()=>Gl,ZodIssueCode:()=>ox,ZodJWT:()=>zi,ZodKSUID:()=>bi,ZodLazy:()=>mu,ZodLiteral:()=>Hl,ZodMAC:()=>zl,ZodMap:()=>Vl,ZodNaN:()=>cu,ZodNanoID:()=>fi,ZodNever:()=>El,ZodNonOptional:()=>Ti,ZodNull:()=>Ol,ZodNullable:()=>Ql,ZodNumber:()=>Gt,ZodNumberFormat:()=>at,ZodObject:()=>zr,ZodOptional:()=>Ui,ZodPipe:()=>jr,ZodPrefault:()=>ru,ZodPreprocess:()=>lu,ZodPromise:()=>gu,ZodReadonly:()=>uu,ZodRealError:()=>he,ZodRecord:()=>Zt,ZodSet:()=>Wl,ZodString:()=>At,ZodStringFormat:()=>W,ZodSuccess:()=>ou,ZodSymbol:()=>Dl,ZodTemplateLiteral:()=>pu,ZodTransform:()=>Xl,ZodTuple:()=>Ml,ZodType:()=>N,ZodULID:()=>vi,ZodURL:()=>Sr,ZodUUID:()=>Ue,ZodUndefined:()=>Cl,ZodUnion:()=>Pr,ZodUnknown:()=>Nl,ZodVoid:()=>Zl,ZodXID:()=>yi,ZodXor:()=>Al,_ZodString:()=>di,_default:()=>tu,_function:()=>hh,any:()=>Wg,array:()=>Ir,base64:()=>Dg,base64url:()=>Cg,bigint:()=>Fg,boolean:()=>jl,catch:()=>su,check:()=>vh,cidrv4:()=>Pg,cidrv6:()=>jg,clone:()=>le,codec:()=>ph,coerce:()=>xu,config:()=>ee,core:()=>Ee,cuid:()=>xg,cuid2:()=>$g,custom:()=>yh,date:()=>Kg,decode:()=>xl,decodeAsync:()=>_l,describe:()=>bh,discriminatedUnion:()=>th,e164:()=>Og,email:()=>ug,emoji:()=>yg,encode:()=>bl,encodeAsync:()=>$l,endsWith:()=>zt,enum:()=>Ci,exactOptional:()=>Yl,file:()=>ch,flattenError:()=>ar,float32:()=>Rg,float64:()=>Ag,formatError:()=>sr,fromJSONSchema:()=>Ih,function:()=>hh,getErrorMap:()=>sx,globalRegistry:()=>ne,gt:()=>Ce,gte:()=>de,guid:()=>dg,hash:()=>Zg,hex:()=>Eg,hostname:()=>Ng,httpUrl:()=>vg,includes:()=>wt,instanceof:()=>$h,int:()=>li,int32:()=>Lg,int64:()=>Mg,intersection:()=>Fl,invertCodec:()=>mh,ipv4:()=>wg,ipv6:()=>zg,iso:()=>Et,json:()=>kh,jwt:()=>Ug,keyof:()=>Xg,ksuid:()=>Sg,lazy:()=>fu,length:()=>it,literal:()=>sh,locales:()=>gr,looseObject:()=>Qg,looseRecord:()=>nh,lowercase:()=>kt,lt:()=>De,lte:()=>be,mac:()=>Ig,map:()=>ih,maxLength:()=>nt,maxSize:()=>Je,meta:()=>xh,mime:()=>Pt,minLength:()=>Ne,minSize:()=>Oe,multipleOf:()=>Be,nan:()=>dh,nanoid:()=>bg,nativeEnum:()=>ah,negative:()=>Kn,never:()=>ji,nonnegative:()=>qn,nonoptional:()=>iu,nonpositive:()=>Xn,normalize:()=>jt,null:()=>Ul,nullable:()=>_r,nullish:()=>lh,number:()=>Pl,object:()=>qg,optional:()=>$r,overwrite:()=>Se,parse:()=>gl,parseAsync:()=>hl,partialRecord:()=>rh,pipe:()=>ui,positive:()=>Hn,prefault:()=>nu,preprocess:()=>Sh,prettifyError:()=>Uo,promise:()=>gh,property:()=>Yn,readonly:()=>du,record:()=>Jl,refine:()=>vu,regex:()=>_t,regexes:()=>ye,registry:()=>zn,safeDecode:()=>Sl,safeDecodeAsync:()=>Il,safeEncode:()=>kl,safeEncodeAsync:()=>wl,safeParse:()=>vl,safeParseAsync:()=>yl,set:()=>oh,setErrorMap:()=>ax,size:()=>rt,slugify:()=>Ut,startsWith:()=>It,strictObject:()=>Yg,string:()=>br,stringFormat:()=>Tg,stringbool:()=>_h,success:()=>uh,superRefine:()=>yu,symbol:()=>Jg,templateLiteral:()=>fh,toJSONSchema:()=>ri,toLowerCase:()=>Ct,toUpperCase:()=>Ot,transform:()=>Oi,treeifyError:()=>Oo,trim:()=>Dt,tuple:()=>Bl,uint32:()=>Gg,uint64:()=>Bg,ulid:()=>_g,undefined:()=>Vg,union:()=>Di,unknown:()=>ot,uppercase:()=>St,url:()=>hg,util:()=>x,uuid:()=>pg,uuidv4:()=>mg,uuidv6:()=>fg,uuidv7:()=>gg,void:()=>Hg,xid:()=>kg,xor:()=>eh});var Ee={};Ie(Ee,{$ZodAny:()=>cs,$ZodArray:()=>ms,$ZodAsyncError:()=>ke,$ZodBase64:()=>Ya,$ZodBase64URL:()=>Qa,$ZodBigInt:()=>bn,$ZodBigIntFormat:()=>is,$ZodBoolean:()=>dr,$ZodCIDRv4:()=>Ka,$ZodCIDRv6:()=>Xa,$ZodCUID:()=>Za,$ZodCUID2:()=>Ra,$ZodCatch:()=>Cs,$ZodCheck:()=>H,$ZodCheckBigIntFormat:()=>ma,$ZodCheckEndsWith:()=>wa,$ZodCheckGreaterThan:()=>mn,$ZodCheckIncludes:()=>ka,$ZodCheckLengthEquals:()=>ba,$ZodCheckLessThan:()=>pn,$ZodCheckLowerCase:()=>$a,$ZodCheckMaxLength:()=>va,$ZodCheckMaxSize:()=>fa,$ZodCheckMimeType:()=>za,$ZodCheckMinLength:()=>ya,$ZodCheckMinSize:()=>ga,$ZodCheckMultipleOf:()=>da,$ZodCheckNumberFormat:()=>pa,$ZodCheckOverwrite:()=>Pa,$ZodCheckProperty:()=>Ia,$ZodCheckRegex:()=>xa,$ZodCheckSizeEquals:()=>ha,$ZodCheckStartsWith:()=>Sa,$ZodCheckStringFormat:()=>xt,$ZodCheckUpperCase:()=>_a,$ZodCodec:()=>mr,$ZodCustom:()=>As,$ZodCustomStringFormat:()=>rs,$ZodDate:()=>ps,$ZodDefault:()=>zs,$ZodDiscriminatedUnion:()=>hs,$ZodE164:()=>es,$ZodEmail:()=>Ua,$ZodEmoji:()=>Na,$ZodEncodeError:()=>Ae,$ZodEnum:()=>$s,$ZodError:()=>or,$ZodExactOptional:()=>ws,$ZodFile:()=>ks,$ZodFunction:()=>Es,$ZodGUID:()=>Ca,$ZodIPv4:()=>Va,$ZodIPv6:()=>Wa,$ZodISODate:()=>Ma,$ZodISODateTime:()=>Fa,$ZodISODuration:()=>Ja,$ZodISOTime:()=>Ba,$ZodIntersection:()=>vs,$ZodJWT:()=>ts,$ZodKSUID:()=>Ga,$ZodLazy:()=>Rs,$ZodLiteral:()=>_s,$ZodMAC:()=>Ha,$ZodMap:()=>bs,$ZodNaN:()=>Os,$ZodNanoID:()=>Ea,$ZodNever:()=>us,$ZodNonOptional:()=>js,$ZodNull:()=>ss,$ZodNullable:()=>Is,$ZodNumber:()=>yn,$ZodNumberFormat:()=>ns,$ZodObject:()=>of,$ZodObjectJIT:()=>fs,$ZodOptional:()=>$n,$ZodPipe:()=>_n,$ZodPrefault:()=>Ps,$ZodPreprocess:()=>Us,$ZodPromise:()=>Zs,$ZodReadonly:()=>Ts,$ZodRealError:()=>ge,$ZodRecord:()=>ys,$ZodRegistry:()=>In,$ZodSet:()=>xs,$ZodString:()=>tt,$ZodStringFormat:()=>V,$ZodSuccess:()=>Ds,$ZodSymbol:()=>os,$ZodTemplateLiteral:()=>Ns,$ZodTransform:()=>Ss,$ZodTuple:()=>xn,$ZodType:()=>U,$ZodULID:()=>Aa,$ZodURL:()=>Ta,$ZodUUID:()=>Oa,$ZodUndefined:()=>as,$ZodUnion:()=>pr,$ZodUnknown:()=>ls,$ZodVoid:()=>ds,$ZodXID:()=>La,$ZodXor:()=>gs,$brand:()=>xo,$constructor:()=>p,$input:()=>Gs,$output:()=>Ls,Doc:()=>ur,JSONSchema:()=>sg,JSONSchemaGenerator:()=>ni,NEVER:()=>bo,TimePrecision:()=>Js,_any:()=>pc,_array:()=>bc,_base64:()=>Bn,_base64url:()=>Jn,_bigint:()=>oc,_boolean:()=>nc,_catch:()=>Kb,_check:()=>ag,_cidrv4:()=>Fn,_cidrv6:()=>Mn,_coercedBigint:()=>ac,_coercedBoolean:()=>ic,_coercedDate:()=>vc,_coercedNumber:()=>qs,_coercedString:()=>Ms,_cuid:()=>Nn,_cuid2:()=>En,_custom:()=>$c,_date:()=>hc,_decode:()=>rn,_decodeAsync:()=>on,_default:()=>Vb,_discriminatedUnion:()=>Tb,_e164:()=>Vn,_email:()=>Pn,_emoji:()=>Un,_encode:()=>tn,_encodeAsync:()=>nn,_endsWith:()=>zt,_enum:()=>Lb,_file:()=>xc,_float32:()=>Qs,_float64:()=>ec,_gt:()=>Ce,_gte:()=>de,_guid:()=>hr,_includes:()=>wt,_int:()=>Ys,_int32:()=>tc,_int64:()=>sc,_intersection:()=>Nb,_ipv4:()=>Ln,_ipv6:()=>Gn,_isoDate:()=>Ws,_isoDateTime:()=>Vs,_isoDuration:()=>Ks,_isoTime:()=>Hs,_jwt:()=>Wn,_ksuid:()=>An,_lazy:()=>Qb,_length:()=>it,_literal:()=>Fb,_lowercase:()=>kt,_lt:()=>De,_lte:()=>be,_mac:()=>Bs,_map:()=>Rb,_max:()=>be,_maxLength:()=>nt,_maxSize:()=>Je,_mime:()=>Pt,_min:()=>de,_minLength:()=>Ne,_minSize:()=>Oe,_multipleOf:()=>Be,_nan:()=>yc,_nanoid:()=>Tn,_nativeEnum:()=>Gb,_negative:()=>Kn,_never:()=>fc,_nonnegative:()=>qn,_nonoptional:()=>Wb,_nonpositive:()=>Xn,_normalize:()=>jt,_null:()=>dc,_nullable:()=>Jb,_number:()=>Xs,_optional:()=>Bb,_overwrite:()=>Se,_parse:()=>ht,_parseAsync:()=>vt,_pipe:()=>Xb,_positive:()=>Hn,_promise:()=>ex,_property:()=>Yn,_readonly:()=>qb,_record:()=>Zb,_refine:()=>_c,_regex:()=>_t,_safeDecode:()=>sn,_safeDecodeAsync:()=>ln,_safeEncode:()=>an,_safeEncodeAsync:()=>cn,_safeParse:()=>yt,_safeParseAsync:()=>bt,_set:()=>Ab,_size:()=>rt,_slugify:()=>Ut,_startsWith:()=>It,_string:()=>Fs,_stringFormat:()=>Tt,_stringbool:()=>Ic,_success:()=>Hb,_superRefine:()=>kc,_symbol:()=>lc,_templateLiteral:()=>Yb,_toLowerCase:()=>Ct,_toUpperCase:()=>Ot,_transform:()=>Mb,_trim:()=>Dt,_tuple:()=>Eb,_uint32:()=>rc,_uint64:()=>cc,_ulid:()=>Zn,_undefined:()=>uc,_union:()=>Ob,_unknown:()=>mc,_uppercase:()=>St,_url:()=>vr,_uuid:()=>jn,_uuidv4:()=>Dn,_uuidv6:()=>Cn,_uuidv7:()=>On,_void:()=>gc,_xid:()=>Rn,_xor:()=>Ub,clone:()=>le,config:()=>ee,createStandardJSONSchemaMethod:()=>Nt,createToJSONSchemaMethod:()=>zc,decode:()=>ey,decodeAsync:()=>ry,describe:()=>Sc,encode:()=>Qv,encodeAsync:()=>ty,extractDefs:()=>We,finalize:()=>He,flattenError:()=>ar,formatError:()=>sr,globalConfig:()=>Ye,globalRegistry:()=>ne,initializeContext:()=>Ve,isValidBase64:()=>qa,isValidBase64URL:()=>ef,isValidJWT:()=>tf,locales:()=>gr,meta:()=>wc,parse:()=>Qr,parseAsync:()=>en,prettifyError:()=>Uo,process:()=>J,regexes:()=>ye,registry:()=>zn,safeDecode:()=>iy,safeDecodeAsync:()=>ay,safeEncode:()=>ny,safeEncodeAsync:()=>oy,safeParse:()=>To,safeParseAsync:()=>No,toDotPath:()=>Um,toJSONSchema:()=>ri,treeifyError:()=>Oo,util:()=>x,version:()=>ja});var Pm,bo=Object.freeze({status:"aborted"});function p(e,r,n){function o(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),r(s,l);let c=a.prototype,d=Object.keys(c);for(let f=0;f<d.length;f++){let v=d[f];v in s||(s[v]=c[v].bind(s))}}let t=n?.Parent??Object;class i extends t{}Object.defineProperty(i,"name",{value:e});function a(s){var l;let c=n?.Parent?new i:this;o(c,s),(l=c._zod).deferred??(l.deferred=[]);for(let d of c._zod.deferred)d();return c}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var xo=Symbol("zod_brand"),ke=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ae=class extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}};(Pm=globalThis).__zod_globalConfig??(Pm.__zod_globalConfig={});var Ye=globalThis.__zod_globalConfig;function ee(e){return e&&Object.assign(Ye,e),Ye}var x={};Ie(x,{BIGINT_FORMAT_RANGES:()=>Do,Class:()=>_o,NUMBER_FORMAT_RANGES:()=>jo,aborted:()=>Me,allowsEval:()=>wo,assert:()=>Cv,assertEqual:()=>zv,assertIs:()=>jv,assertNever:()=>Dv,assertNotEqual:()=>Pv,assignProp:()=>Ge,base64ToUint8Array:()=>Dm,base64urlToUint8Array:()=>Hv,cached:()=>ft,captureStackTrace:()=>Yr,cleanEnum:()=>Wv,cleanRegex:()=>tr,clone:()=>le,cloneDef:()=>Uv,createTransparentProxy:()=>Av,defineLazy:()=>E,esc:()=>qr,escapeRegex:()=>$e,explicitlyAborted:()=>Co,extend:()=>Fv,finalizeIssue:()=>ue,floatSafeRemainder:()=>ko,getElementAtPath:()=>Tv,getEnumValues:()=>er,getLengthableOrigin:()=>ir,getParsedType:()=>Rv,getSizableOrigin:()=>nr,hexToUint8Array:()=>Xv,isObject:()=>Qe,isPlainObject:()=>Fe,issue:()=>gt,joinValues:()=>h,jsonStringifyReplacer:()=>mt,merge:()=>Bv,mergeDefs:()=>Te,normalizeParams:()=>_,nullish:()=>Le,numKeys:()=>Zv,objectClone:()=>Ov,omit:()=>Gv,optionalKeys:()=>Po,parsedType:()=>b,partial:()=>Jv,pick:()=>Lv,prefixIssues:()=>fe,primitiveTypes:()=>zo,promiseAllObject:()=>Nv,propertyKeyTypes:()=>rr,randomString:()=>Ev,required:()=>Vv,safeExtend:()=>Mv,shallowClone:()=>Io,slugify:()=>So,stringifyPrimitive:()=>y,uint8ArrayToBase64:()=>Cm,uint8ArrayToBase64url:()=>Kv,uint8ArrayToHex:()=>qv,unwrapMessage:()=>Qt});function zv(e){return e}function Pv(e){return e}function jv(e){}function Dv(e){throw new Error("Unexpected value in exhaustive check")}function Cv(e){}function er(e){let r=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,t])=>r.indexOf(+o)===-1).map(([o,t])=>t)}function h(e,r="|"){return e.map(n=>y(n)).join(r)}function mt(e,r){return typeof r=="bigint"?r.toString():r}function ft(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Le(e){return e==null}function tr(e){let r=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(r,n)}function ko(e,r){let n=e/r,o=Math.round(n),t=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-o)<t?0:n-o}var jm=Symbol("evaluating");function E(e,r,n){let o;Object.defineProperty(e,r,{get(){if(o!==jm)return o===void 0&&(o=jm,o=n()),o},set(t){Object.defineProperty(e,r,{value:t})},configurable:!0})}function Ov(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ge(e,r,n){Object.defineProperty(e,r,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Te(...e){let r={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(r,o)}return Object.defineProperties({},r)}function Uv(e){return Te(e._zod.def)}function Tv(e,r){return r?r.reduce((n,o)=>n?.[o],e):e}function Nv(e){let r=Object.keys(e),n=r.map(o=>e[o]);return Promise.all(n).then(o=>{let t={};for(let i=0;i<r.length;i++)t[r[i]]=o[i];return t})}function Ev(e=10){let r="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<e;o++)n+=r[Math.floor(Math.random()*r.length)];return n}function qr(e){return JSON.stringify(e)}function So(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Yr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var wo=ft(()=>{if(Ye.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Fe(e){if(Qe(e)===!1)return!1;let r=e.constructor;if(r===void 0||typeof r!="function")return!0;let n=r.prototype;return!(Qe(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Io(e){return Fe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Zv(e){let r=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&r++;return r}var Rv=e=>{let r=typeof e;switch(r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${r}`)}},rr=new Set(["string","number","symbol"]),zo=new Set(["string","number","bigint","boolean","symbol","undefined"]);function $e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function le(e,r,n){let o=new e._zod.constr(r??e._zod.def);return(!r||n?.parent)&&(o._zod.parent=e),o}function _(e){let r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function Av(e){let r;return new Proxy({},{get(n,o,t){return r??(r=e()),Reflect.get(r,o,t)},set(n,o,t,i){return r??(r=e()),Reflect.set(r,o,t,i)},has(n,o){return r??(r=e()),Reflect.has(r,o)},deleteProperty(n,o){return r??(r=e()),Reflect.deleteProperty(r,o)},ownKeys(n){return r??(r=e()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(n,o){return r??(r=e()),Reflect.getOwnPropertyDescriptor(r,o)},defineProperty(n,o,t){return r??(r=e()),Reflect.defineProperty(r,o,t)}})}function y(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Po(e){return Object.keys(e).filter(r=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}var jo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Do={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Lv(e,r){let n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=Te(e._zod.def,{get shape(){let a={};for(let s in r){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(a[s]=n.shape[s])}return Ge(this,"shape",a),a},checks:[]});return le(e,i)}function Gv(e,r){let n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=Te(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in r){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);r[s]&&delete a[s]}return Ge(this,"shape",a),a},checks:[]});return le(e,i)}function Fv(e,r){if(!Fe(r))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let i=e._zod.def.shape;for(let a in r)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let t=Te(e._zod.def,{get shape(){let i={...e._zod.def.shape,...r};return Ge(this,"shape",i),i}});return le(e,t)}function Mv(e,r){if(!Fe(r))throw new Error("Invalid input to safeExtend: expected a plain object");let n=Te(e._zod.def,{get shape(){let o={...e._zod.def.shape,...r};return Ge(this,"shape",o),o}});return le(e,n)}function Bv(e,r){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=Te(e._zod.def,{get shape(){let o={...e._zod.def.shape,...r._zod.def.shape};return Ge(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:r._zod.def.checks??[]});return le(e,n)}function Jv(e,r,n){let t=r._zod.def.checks;if(t&&t.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=Te(r._zod.def,{get shape(){let s=r._zod.def.shape,l={...s};if(n)for(let c in n){if(!(c in s))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:s[c]}):s[c])}else for(let c in s)l[c]=e?new e({type:"optional",innerType:s[c]}):s[c];return Ge(this,"shape",l),l},checks:[]});return le(r,a)}function Vv(e,r,n){let o=Te(r._zod.def,{get shape(){let t=r._zod.def.shape,i={...t};if(n)for(let a in n){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=new e({type:"nonoptional",innerType:t[a]}))}else for(let a in t)i[a]=new e({type:"nonoptional",innerType:t[a]});return Ge(this,"shape",i),i}});return le(r,o)}function Me(e,r=0){if(e.aborted===!0)return!0;for(let n=r;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Co(e,r=0){if(e.aborted===!0)return!0;for(let n=r;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function fe(e,r){return r.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Qt(e){return typeof e=="string"?e:e?.message}function ue(e,r,n){let o=e.message?e.message:Qt(e.inst?._zod.def?.error?.(e))??Qt(r?.error?.(e))??Qt(n.customError?.(e))??Qt(n.localeError?.(e))??"Invalid input",{inst:t,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,r?.reportInput&&(s.input=a),s}function nr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ir(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function b(e){let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return r}function gt(...e){let[r,n,o]=e;return typeof r=="string"?{message:r,code:"custom",input:n,inst:o}:{...r}}function Wv(e){return Object.entries(e).filter(([r,n])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}function Dm(e){let r=atob(e),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return n}function Cm(e){let r="";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return btoa(r)}function Hv(e){let r=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-r.length%4)%4);return Dm(r+n)}function Kv(e){return Cm(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Xv(e){let r=e.replace(/^0x/,"");if(r.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(r.length/2);for(let o=0;o<r.length;o+=2)n[o/2]=Number.parseInt(r.slice(o,o+2),16);return n}function qv(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}var _o=class{constructor(...r){}};var Om=(e,r)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,mt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},or=p("$ZodError",Om),ge=p("$ZodError",Om,{Parent:Error});function ar(e,r=n=>n.message){let n={},o=[];for(let t of e.issues)t.path.length>0?(n[t.path[0]]=n[t.path[0]]||[],n[t.path[0]].push(r(t))):o.push(r(t));return{formErrors:o,fieldErrors:n}}function sr(e,r=n=>n.message){let n={_errors:[]},o=(t,i=[])=>{for(let a of t.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)n._errors.push(r(a));else{let l=n,c=0;for(;c<s.length;){let d=s[c];c===s.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(r(a))):l[d]=l[d]||{_errors:[]},l=l[d],c++}}}};return o(e),n}function Oo(e,r=n=>n.message){let n={errors:[]},o=(t,i=[])=>{var a,s;for(let l of t.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(c=>o({issues:c},[...i,...l.path]));else if(l.code==="invalid_key")o({issues:l.issues},[...i,...l.path]);else if(l.code==="invalid_element")o({issues:l.issues},[...i,...l.path]);else{let c=[...i,...l.path];if(c.length===0){n.errors.push(r(l));continue}let d=n,f=0;for(;f<c.length;){let v=c[f],g=f===c.length-1;typeof v=="string"?(d.properties??(d.properties={}),(a=d.properties)[v]??(a[v]={errors:[]}),d=d.properties[v]):(d.items??(d.items=[]),(s=d.items)[v]??(s[v]={errors:[]}),d=d.items[v]),g&&d.errors.push(r(l)),f++}}};return o(e),n}function Um(e){let r=[],n=e.map(o=>typeof o=="object"?o.key:o);for(let o of n)typeof o=="number"?r.push(`[${o}]`):typeof o=="symbol"?r.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?r.push(`[${JSON.stringify(o)}]`):(r.length&&r.push("."),r.push(o));return r.join("")}function Uo(e){let r=[],n=[...e.issues].sort((o,t)=>(o.path??[]).length-(t.path??[]).length);for(let o of n)r.push(`\u2716 ${o.message}`),o.path?.length&&r.push(` \u2192 at ${Um(o.path)}`);return r.join(`
|
|
6
|
+
${[L.branch,...L.badges].filter(Boolean).join(" \xB7 ")}`,children:[(0,I.jsx)("span",{style:S?Ji:Lr,"aria-hidden":"true"}),(0,I.jsx)("span",{style:cd,children:L.branch}),L.badges.length>0&&(0,I.jsx)("span",{style:ld,children:L.badges.join(" \xB7 ")})]}),g&&A!==null&&(0,xm.createPortal)((0,I.jsx)("div",{ref:v,className:"dsh-git-ui__pop",style:{...dd,top:A.top,left:A.left},role:"dialog","aria-label":i("popup.title"),children:(0,I.jsx)(xv,{view:l,refresh:n,openCenter:()=>{k(!1),X(null),R(!0)},onOpenDiff:M,run:o,query:t,t:i})}),document.body),(0,I.jsx)(gm,{open:Z,onClose:()=>R(!1),snapshot:l.snapshot,run:o,query:t,t:i,openRequest:F})]})}var pt=require("@deepseek-ai/dsh-client-ui-primitives"),Sm={Modal:pt.Modal,Button:pt.Button,Toast:pt.Toast};function wm(e){return{registerLocale(r,n){e.locale.register(r,n)},async mountRemoteAndGetService(r,n){if(await e.remote.$mount(r),n!=="gitInfo")throw new Error(`adaptDshClientContext: \u672A\u77E5\u547D\u540D\u7A7A\u95F4 "${n}"`);let o;if(await e.plugin({name:"dsh-git-ui:git",inject:["remote.gitInfo"],apply:t=>{o=t.remote.gitInfo}}),o===void 0)throw new Error("adaptDshClientContext: gitInfo \u670D\u52A1\u672A\u5C31\u7EEA");return o},registerSlotEntry(r,n){let o;return e.slots.inject(r.name,()=>(o=e.slots.register({name:r.name,id:r.id,order:r.order,locale:r.locale,inject:r.inject},n),()=>{o?.()})),()=>{o?.()}},onEvent(r,n){return e.on(r,n)},effect(r,n){e.effect(r,n)}}}var Sv="conversation.session.header.utilities";async function Im(e,r,n){e.effect(()=>e.registerLocale("git",r.locales),"dsh-git-ui: dictionaries");let o=await e.mountRemoteAndGetService(r.remoteContribution,"gitInfo"),t=new Map,i=new Map,a=c=>{let d=t.get(c);return d===void 0&&(d=r.createController(o,c),t.set(c,d)),d},s={name:Sv,id:"git",order:10,locale:"git",inject:c=>{let d=i.get(c);if(d===void 0){let f=a(c);d={hooks:{git:f},refresh:()=>f.refresh(),run:v=>f.run(v),query:v=>f.query(v)},i.set(c,d)}return d}},l=e.registerSlotEntry(s,n);e.effect(()=>()=>{l();for(let c of t.values())c.dispose();t.clear(),i.clear()},"dsh-git-ui: slot and controller lifecycle"),e.onEvent("connection/reset",()=>{for(let c of t.values())c.resync()})}var zm=new Set(["cwd-unavailable","session-not-found"]),wv=3e4,Iv=6e4,Xr=class{constructor(r,n){this.remote=r;this.sessionId=n}remote;sessionId;view={state:"cold"};listeners=new Set;timer;inflight;disposed=!1;pollMs=wv;subscribe(r){return this.listeners.add(r),()=>{this.listeners.delete(r)}}getSnapshot(){return this.view}ensure(){this.view.state!=="cold"&&this.view.state!=="no-cwd"||this.refresh()}refresh(){return this.inflight!==void 0?this.inflight:this.disposed?Promise.resolve():(this.setView({state:"loading"}),this.inflight=this.remote.snapshot({sessionId:this.sessionId}).then(r=>{if(this.disposed)return;if(!r.ok){let o=[r.error.code,r.error.message].filter(Boolean).join(": ");this.setView({state:"error",error:{code:"git-unavailable",detail:o||"rpc failure"}});return}let n=r.value;n.ok?(this.pollMs=n.value.refreshIntervalMs,this.setView({state:"ready",snapshot:n.value})):zm.has(n.error.code)?this.setView({state:"no-cwd"}):this.setView({state:"error",error:n.error})}).catch(()=>{this.disposed||this.setView({state:"error",error:{code:"git-unavailable",detail:"transport failure"}})}).finally(()=>{this.inflight=void 0,this.disposed||this.schedulePoll()}),this.inflight)}resync(){this.disposed||this.view.state==="cold"||this.view.state==="no-cwd"||this.refresh()}run(r){if(this.inflight!==void 0)return this.inflight.then(()=>this.run(r));if(this.disposed)return Promise.resolve({ok:!1,error:{code:"git-error",message:"controller disposed"}});let n=this.remote.run({sessionId:this.sessionId,action:r}).then(o=>{if(this.disposed)return{ok:!1,error:{code:"git-error",message:"controller disposed"}};if(!o.ok){let i=[o.error.code,o.error.message].filter(Boolean).join(": ");return this.setView({state:"error",error:{code:"git-unavailable",detail:i||"rpc failure"}}),{ok:!1,error:{code:"git-error",message:i||"rpc failure"}}}let t=o.value;return t.ok?(this.pollMs=t.snapshot.refreshIntervalMs,this.setView({state:"ready",snapshot:t.snapshot})):zm.has(t.error.code)&&this.setView({state:"no-cwd"}),t}).catch(o=>{let t=o instanceof Error?o.message:String(o);return this.disposed||this.setView({state:"error",error:{code:"git-unavailable",detail:"transport failure"}}),{ok:!1,error:{code:"git-error",message:t}}}).finally(()=>{this.inflight=void 0,this.disposed||this.schedulePoll()});return this.inflight=n.then(()=>{}),n}query(r){if(this.inflight!==void 0)return this.inflight.then(()=>this.query(r));if(this.disposed)return Promise.resolve({ok:!1,message:"controller disposed"});let n=this.remote.query({sessionId:this.sessionId,query:r}).then(o=>{if(!o.ok)return{ok:!1,message:[o.error.code,o.error.message].filter(Boolean).join(": ")||"rpc failure"};let t=o.value;return t.ok?{ok:!0,value:t.value}:{ok:!1,message:t.error.message??t.error.code}}).catch(o=>({ok:!1,message:o instanceof Error?o.message:String(o)})).finally(()=>{this.inflight=void 0,this.disposed||this.schedulePoll()});return this.inflight=n.then(()=>{}),n}dispose(){this.disposed=!0,this.stopPolling()}schedulePoll(){if(this.stopPolling(),this.disposed||this.pollMs<=0||this.view.state==="cold")return;let r=this.view.state==="no-cwd"?Iv:this.pollMs;this.timer=setTimeout(()=>{this.disposed||this.inflight!==void 0||this.refresh()},r)}stopPolling(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0)}setView(r){this.view=r;for(let n of[...this.listeners])n()}};var m={};Ie(m,{$brand:()=>xo,$input:()=>Gs,$output:()=>Ls,NEVER:()=>bo,TimePrecision:()=>Js,ZodAny:()=>Tl,ZodArray:()=>Rl,ZodBase64:()=>Si,ZodBase64URL:()=>wi,ZodBigInt:()=>Mt,ZodBigIntFormat:()=>Pi,ZodBoolean:()=>Ft,ZodCIDRv4:()=>_i,ZodCIDRv6:()=>ki,ZodCUID:()=>gi,ZodCUID2:()=>hi,ZodCatch:()=>au,ZodCodec:()=>Dr,ZodCustom:()=>Cr,ZodCustomStringFormat:()=>Lt,ZodDate:()=>wr,ZodDefault:()=>eu,ZodDiscriminatedUnion:()=>Ll,ZodE164:()=>Ii,ZodEmail:()=>pi,ZodEmoji:()=>mi,ZodEnum:()=>Rt,ZodError:()=>nx,ZodExactOptional:()=>ql,ZodFile:()=>Kl,ZodFirstPartyTypeKind:()=>bu,ZodFunction:()=>hu,ZodGUID:()=>xr,ZodIPv4:()=>xi,ZodIPv6:()=>$i,ZodISODate:()=>ai,ZodISODateTime:()=>oi,ZodISODuration:()=>ci,ZodISOTime:()=>si,ZodIntersection:()=>Gl,ZodIssueCode:()=>ox,ZodJWT:()=>zi,ZodKSUID:()=>bi,ZodLazy:()=>mu,ZodLiteral:()=>Hl,ZodMAC:()=>zl,ZodMap:()=>Vl,ZodNaN:()=>cu,ZodNanoID:()=>fi,ZodNever:()=>El,ZodNonOptional:()=>Ti,ZodNull:()=>Ol,ZodNullable:()=>Ql,ZodNumber:()=>Gt,ZodNumberFormat:()=>at,ZodObject:()=>zr,ZodOptional:()=>Ui,ZodPipe:()=>jr,ZodPrefault:()=>ru,ZodPreprocess:()=>lu,ZodPromise:()=>gu,ZodReadonly:()=>uu,ZodRealError:()=>he,ZodRecord:()=>Zt,ZodSet:()=>Wl,ZodString:()=>At,ZodStringFormat:()=>W,ZodSuccess:()=>ou,ZodSymbol:()=>Dl,ZodTemplateLiteral:()=>pu,ZodTransform:()=>Xl,ZodTuple:()=>Ml,ZodType:()=>N,ZodULID:()=>vi,ZodURL:()=>Sr,ZodUUID:()=>Ue,ZodUndefined:()=>Cl,ZodUnion:()=>Pr,ZodUnknown:()=>Nl,ZodVoid:()=>Zl,ZodXID:()=>yi,ZodXor:()=>Al,_ZodString:()=>di,_default:()=>tu,_function:()=>hh,any:()=>Wg,array:()=>Ir,base64:()=>Dg,base64url:()=>Cg,bigint:()=>Fg,boolean:()=>jl,catch:()=>su,check:()=>vh,cidrv4:()=>Pg,cidrv6:()=>jg,clone:()=>le,codec:()=>ph,coerce:()=>xu,config:()=>ee,core:()=>Ee,cuid:()=>xg,cuid2:()=>$g,custom:()=>yh,date:()=>Kg,decode:()=>xl,decodeAsync:()=>_l,describe:()=>bh,discriminatedUnion:()=>th,e164:()=>Og,email:()=>ug,emoji:()=>yg,encode:()=>bl,encodeAsync:()=>$l,endsWith:()=>zt,enum:()=>Ci,exactOptional:()=>Yl,file:()=>ch,flattenError:()=>ar,float32:()=>Rg,float64:()=>Ag,formatError:()=>sr,fromJSONSchema:()=>Ih,function:()=>hh,getErrorMap:()=>sx,globalRegistry:()=>ne,gt:()=>Ce,gte:()=>de,guid:()=>dg,hash:()=>Zg,hex:()=>Eg,hostname:()=>Ng,httpUrl:()=>vg,includes:()=>wt,instanceof:()=>$h,int:()=>li,int32:()=>Lg,int64:()=>Mg,intersection:()=>Fl,invertCodec:()=>mh,ipv4:()=>wg,ipv6:()=>zg,iso:()=>Et,json:()=>kh,jwt:()=>Ug,keyof:()=>Xg,ksuid:()=>Sg,lazy:()=>fu,length:()=>it,literal:()=>sh,locales:()=>gr,looseObject:()=>Qg,looseRecord:()=>nh,lowercase:()=>kt,lt:()=>De,lte:()=>be,mac:()=>Ig,map:()=>ih,maxLength:()=>nt,maxSize:()=>Je,meta:()=>xh,mime:()=>Pt,minLength:()=>Ne,minSize:()=>Oe,multipleOf:()=>Be,nan:()=>dh,nanoid:()=>bg,nativeEnum:()=>ah,negative:()=>Kn,never:()=>ji,nonnegative:()=>qn,nonoptional:()=>iu,nonpositive:()=>Xn,normalize:()=>jt,null:()=>Ul,nullable:()=>_r,nullish:()=>lh,number:()=>Pl,object:()=>qg,optional:()=>$r,overwrite:()=>Se,parse:()=>gl,parseAsync:()=>hl,partialRecord:()=>rh,pipe:()=>ui,positive:()=>Hn,prefault:()=>nu,preprocess:()=>Sh,prettifyError:()=>Uo,promise:()=>gh,property:()=>Yn,readonly:()=>du,record:()=>Jl,refine:()=>vu,regex:()=>_t,regexes:()=>ye,registry:()=>zn,safeDecode:()=>Sl,safeDecodeAsync:()=>Il,safeEncode:()=>kl,safeEncodeAsync:()=>wl,safeParse:()=>vl,safeParseAsync:()=>yl,set:()=>oh,setErrorMap:()=>ax,size:()=>rt,slugify:()=>Ut,startsWith:()=>It,strictObject:()=>Yg,string:()=>br,stringFormat:()=>Tg,stringbool:()=>_h,success:()=>uh,superRefine:()=>yu,symbol:()=>Jg,templateLiteral:()=>fh,toJSONSchema:()=>ri,toLowerCase:()=>Ct,toUpperCase:()=>Ot,transform:()=>Oi,treeifyError:()=>Oo,trim:()=>Dt,tuple:()=>Bl,uint32:()=>Gg,uint64:()=>Bg,ulid:()=>_g,undefined:()=>Vg,union:()=>Di,unknown:()=>ot,uppercase:()=>St,url:()=>hg,util:()=>x,uuid:()=>pg,uuidv4:()=>mg,uuidv6:()=>fg,uuidv7:()=>gg,void:()=>Hg,xid:()=>kg,xor:()=>eh});var Ee={};Ie(Ee,{$ZodAny:()=>cs,$ZodArray:()=>ms,$ZodAsyncError:()=>ke,$ZodBase64:()=>Ya,$ZodBase64URL:()=>Qa,$ZodBigInt:()=>bn,$ZodBigIntFormat:()=>is,$ZodBoolean:()=>dr,$ZodCIDRv4:()=>Ka,$ZodCIDRv6:()=>Xa,$ZodCUID:()=>Za,$ZodCUID2:()=>Ra,$ZodCatch:()=>Cs,$ZodCheck:()=>H,$ZodCheckBigIntFormat:()=>ma,$ZodCheckEndsWith:()=>wa,$ZodCheckGreaterThan:()=>mn,$ZodCheckIncludes:()=>ka,$ZodCheckLengthEquals:()=>ba,$ZodCheckLessThan:()=>pn,$ZodCheckLowerCase:()=>$a,$ZodCheckMaxLength:()=>va,$ZodCheckMaxSize:()=>fa,$ZodCheckMimeType:()=>za,$ZodCheckMinLength:()=>ya,$ZodCheckMinSize:()=>ga,$ZodCheckMultipleOf:()=>da,$ZodCheckNumberFormat:()=>pa,$ZodCheckOverwrite:()=>Pa,$ZodCheckProperty:()=>Ia,$ZodCheckRegex:()=>xa,$ZodCheckSizeEquals:()=>ha,$ZodCheckStartsWith:()=>Sa,$ZodCheckStringFormat:()=>xt,$ZodCheckUpperCase:()=>_a,$ZodCodec:()=>mr,$ZodCustom:()=>As,$ZodCustomStringFormat:()=>rs,$ZodDate:()=>ps,$ZodDefault:()=>zs,$ZodDiscriminatedUnion:()=>hs,$ZodE164:()=>es,$ZodEmail:()=>Ua,$ZodEmoji:()=>Na,$ZodEncodeError:()=>Ae,$ZodEnum:()=>$s,$ZodError:()=>or,$ZodExactOptional:()=>ws,$ZodFile:()=>ks,$ZodFunction:()=>Es,$ZodGUID:()=>Ca,$ZodIPv4:()=>Va,$ZodIPv6:()=>Wa,$ZodISODate:()=>Ma,$ZodISODateTime:()=>Fa,$ZodISODuration:()=>Ja,$ZodISOTime:()=>Ba,$ZodIntersection:()=>vs,$ZodJWT:()=>ts,$ZodKSUID:()=>Ga,$ZodLazy:()=>Rs,$ZodLiteral:()=>_s,$ZodMAC:()=>Ha,$ZodMap:()=>bs,$ZodNaN:()=>Os,$ZodNanoID:()=>Ea,$ZodNever:()=>us,$ZodNonOptional:()=>js,$ZodNull:()=>ss,$ZodNullable:()=>Is,$ZodNumber:()=>yn,$ZodNumberFormat:()=>ns,$ZodObject:()=>of,$ZodObjectJIT:()=>fs,$ZodOptional:()=>$n,$ZodPipe:()=>_n,$ZodPrefault:()=>Ps,$ZodPreprocess:()=>Us,$ZodPromise:()=>Zs,$ZodReadonly:()=>Ts,$ZodRealError:()=>ge,$ZodRecord:()=>ys,$ZodRegistry:()=>In,$ZodSet:()=>xs,$ZodString:()=>tt,$ZodStringFormat:()=>V,$ZodSuccess:()=>Ds,$ZodSymbol:()=>os,$ZodTemplateLiteral:()=>Ns,$ZodTransform:()=>Ss,$ZodTuple:()=>xn,$ZodType:()=>U,$ZodULID:()=>Aa,$ZodURL:()=>Ta,$ZodUUID:()=>Oa,$ZodUndefined:()=>as,$ZodUnion:()=>pr,$ZodUnknown:()=>ls,$ZodVoid:()=>ds,$ZodXID:()=>La,$ZodXor:()=>gs,$brand:()=>xo,$constructor:()=>p,$input:()=>Gs,$output:()=>Ls,Doc:()=>ur,JSONSchema:()=>sg,JSONSchemaGenerator:()=>ni,NEVER:()=>bo,TimePrecision:()=>Js,_any:()=>pc,_array:()=>bc,_base64:()=>Bn,_base64url:()=>Jn,_bigint:()=>oc,_boolean:()=>nc,_catch:()=>Kb,_check:()=>ag,_cidrv4:()=>Fn,_cidrv6:()=>Mn,_coercedBigint:()=>ac,_coercedBoolean:()=>ic,_coercedDate:()=>vc,_coercedNumber:()=>qs,_coercedString:()=>Ms,_cuid:()=>Nn,_cuid2:()=>En,_custom:()=>$c,_date:()=>hc,_decode:()=>rn,_decodeAsync:()=>on,_default:()=>Vb,_discriminatedUnion:()=>Tb,_e164:()=>Vn,_email:()=>Pn,_emoji:()=>Un,_encode:()=>tn,_encodeAsync:()=>nn,_endsWith:()=>zt,_enum:()=>Lb,_file:()=>xc,_float32:()=>Qs,_float64:()=>ec,_gt:()=>Ce,_gte:()=>de,_guid:()=>hr,_includes:()=>wt,_int:()=>Ys,_int32:()=>tc,_int64:()=>sc,_intersection:()=>Nb,_ipv4:()=>Ln,_ipv6:()=>Gn,_isoDate:()=>Ws,_isoDateTime:()=>Vs,_isoDuration:()=>Ks,_isoTime:()=>Hs,_jwt:()=>Wn,_ksuid:()=>An,_lazy:()=>Qb,_length:()=>it,_literal:()=>Fb,_lowercase:()=>kt,_lt:()=>De,_lte:()=>be,_mac:()=>Bs,_map:()=>Rb,_max:()=>be,_maxLength:()=>nt,_maxSize:()=>Je,_mime:()=>Pt,_min:()=>de,_minLength:()=>Ne,_minSize:()=>Oe,_multipleOf:()=>Be,_nan:()=>yc,_nanoid:()=>Tn,_nativeEnum:()=>Gb,_negative:()=>Kn,_never:()=>fc,_nonnegative:()=>qn,_nonoptional:()=>Wb,_nonpositive:()=>Xn,_normalize:()=>jt,_null:()=>dc,_nullable:()=>Jb,_number:()=>Xs,_optional:()=>Bb,_overwrite:()=>Se,_parse:()=>ht,_parseAsync:()=>vt,_pipe:()=>Xb,_positive:()=>Hn,_promise:()=>ex,_property:()=>Yn,_readonly:()=>qb,_record:()=>Zb,_refine:()=>_c,_regex:()=>_t,_safeDecode:()=>sn,_safeDecodeAsync:()=>ln,_safeEncode:()=>an,_safeEncodeAsync:()=>cn,_safeParse:()=>yt,_safeParseAsync:()=>bt,_set:()=>Ab,_size:()=>rt,_slugify:()=>Ut,_startsWith:()=>It,_string:()=>Fs,_stringFormat:()=>Tt,_stringbool:()=>Ic,_success:()=>Hb,_superRefine:()=>kc,_symbol:()=>lc,_templateLiteral:()=>Yb,_toLowerCase:()=>Ct,_toUpperCase:()=>Ot,_transform:()=>Mb,_trim:()=>Dt,_tuple:()=>Eb,_uint32:()=>rc,_uint64:()=>cc,_ulid:()=>Zn,_undefined:()=>uc,_union:()=>Ob,_unknown:()=>mc,_uppercase:()=>St,_url:()=>vr,_uuid:()=>jn,_uuidv4:()=>Dn,_uuidv6:()=>Cn,_uuidv7:()=>On,_void:()=>gc,_xid:()=>Rn,_xor:()=>Ub,clone:()=>le,config:()=>ee,createStandardJSONSchemaMethod:()=>Nt,createToJSONSchemaMethod:()=>zc,decode:()=>ey,decodeAsync:()=>ry,describe:()=>Sc,encode:()=>Qv,encodeAsync:()=>ty,extractDefs:()=>We,finalize:()=>He,flattenError:()=>ar,formatError:()=>sr,globalConfig:()=>Ye,globalRegistry:()=>ne,initializeContext:()=>Ve,isValidBase64:()=>qa,isValidBase64URL:()=>ef,isValidJWT:()=>tf,locales:()=>gr,meta:()=>wc,parse:()=>Qr,parseAsync:()=>en,prettifyError:()=>Uo,process:()=>J,regexes:()=>ye,registry:()=>zn,safeDecode:()=>iy,safeDecodeAsync:()=>ay,safeEncode:()=>ny,safeEncodeAsync:()=>oy,safeParse:()=>To,safeParseAsync:()=>No,toDotPath:()=>Um,toJSONSchema:()=>ri,treeifyError:()=>Oo,util:()=>x,version:()=>ja});var Pm,bo=Object.freeze({status:"aborted"});function p(e,r,n){function o(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),r(s,l);let c=a.prototype,d=Object.keys(c);for(let f=0;f<d.length;f++){let v=d[f];v in s||(s[v]=c[v].bind(s))}}let t=n?.Parent??Object;class i extends t{}Object.defineProperty(i,"name",{value:e});function a(s){var l;let c=n?.Parent?new i:this;o(c,s),(l=c._zod).deferred??(l.deferred=[]);for(let d of c._zod.deferred)d();return c}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var xo=Symbol("zod_brand"),ke=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ae=class extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}};(Pm=globalThis).__zod_globalConfig??(Pm.__zod_globalConfig={});var Ye=globalThis.__zod_globalConfig;function ee(e){return e&&Object.assign(Ye,e),Ye}var x={};Ie(x,{BIGINT_FORMAT_RANGES:()=>Do,Class:()=>_o,NUMBER_FORMAT_RANGES:()=>jo,aborted:()=>Me,allowsEval:()=>wo,assert:()=>Cv,assertEqual:()=>zv,assertIs:()=>jv,assertNever:()=>Dv,assertNotEqual:()=>Pv,assignProp:()=>Ge,base64ToUint8Array:()=>Dm,base64urlToUint8Array:()=>Hv,cached:()=>ft,captureStackTrace:()=>Yr,cleanEnum:()=>Wv,cleanRegex:()=>tr,clone:()=>le,cloneDef:()=>Uv,createTransparentProxy:()=>Av,defineLazy:()=>E,esc:()=>qr,escapeRegex:()=>$e,explicitlyAborted:()=>Co,extend:()=>Fv,finalizeIssue:()=>ue,floatSafeRemainder:()=>ko,getElementAtPath:()=>Tv,getEnumValues:()=>er,getLengthableOrigin:()=>ir,getParsedType:()=>Rv,getSizableOrigin:()=>nr,hexToUint8Array:()=>Xv,isObject:()=>Qe,isPlainObject:()=>Fe,issue:()=>gt,joinValues:()=>h,jsonStringifyReplacer:()=>mt,merge:()=>Bv,mergeDefs:()=>Te,normalizeParams:()=>_,nullish:()=>Le,numKeys:()=>Zv,objectClone:()=>Ov,omit:()=>Gv,optionalKeys:()=>Po,parsedType:()=>b,partial:()=>Jv,pick:()=>Lv,prefixIssues:()=>fe,primitiveTypes:()=>zo,promiseAllObject:()=>Nv,propertyKeyTypes:()=>rr,randomString:()=>Ev,required:()=>Vv,safeExtend:()=>Mv,shallowClone:()=>Io,slugify:()=>So,stringifyPrimitive:()=>y,uint8ArrayToBase64:()=>Cm,uint8ArrayToBase64url:()=>Kv,uint8ArrayToHex:()=>qv,unwrapMessage:()=>Qt});function zv(e){return e}function Pv(e){return e}function jv(e){}function Dv(e){throw new Error("Unexpected value in exhaustive check")}function Cv(e){}function er(e){let r=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,t])=>r.indexOf(+o)===-1).map(([o,t])=>t)}function h(e,r="|"){return e.map(n=>y(n)).join(r)}function mt(e,r){return typeof r=="bigint"?r.toString():r}function ft(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Le(e){return e==null}function tr(e){let r=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(r,n)}function ko(e,r){let n=e/r,o=Math.round(n),t=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-o)<t?0:n-o}var jm=Symbol("evaluating");function E(e,r,n){let o;Object.defineProperty(e,r,{get(){if(o!==jm)return o===void 0&&(o=jm,o=n()),o},set(t){Object.defineProperty(e,r,{value:t})},configurable:!0})}function Ov(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ge(e,r,n){Object.defineProperty(e,r,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Te(...e){let r={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(r,o)}return Object.defineProperties({},r)}function Uv(e){return Te(e._zod.def)}function Tv(e,r){return r?r.reduce((n,o)=>n?.[o],e):e}function Nv(e){let r=Object.keys(e),n=r.map(o=>e[o]);return Promise.all(n).then(o=>{let t={};for(let i=0;i<r.length;i++)t[r[i]]=o[i];return t})}function Ev(e=10){let r="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<e;o++)n+=r[Math.floor(Math.random()*r.length)];return n}function qr(e){return JSON.stringify(e)}function So(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Yr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var wo=ft(()=>{if(Ye.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Fe(e){if(Qe(e)===!1)return!1;let r=e.constructor;if(r===void 0||typeof r!="function")return!0;let n=r.prototype;return!(Qe(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Io(e){return Fe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Zv(e){let r=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&r++;return r}var Rv=e=>{let r=typeof e;switch(r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${r}`)}},rr=new Set(["string","number","symbol"]),zo=new Set(["string","number","bigint","boolean","symbol","undefined"]);function $e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function le(e,r,n){let o=new e._zod.constr(r??e._zod.def);return(!r||n?.parent)&&(o._zod.parent=e),o}function _(e){let r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function Av(e){let r;return new Proxy({},{get(n,o,t){return r??(r=e()),Reflect.get(r,o,t)},set(n,o,t,i){return r??(r=e()),Reflect.set(r,o,t,i)},has(n,o){return r??(r=e()),Reflect.has(r,o)},deleteProperty(n,o){return r??(r=e()),Reflect.deleteProperty(r,o)},ownKeys(n){return r??(r=e()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(n,o){return r??(r=e()),Reflect.getOwnPropertyDescriptor(r,o)},defineProperty(n,o,t){return r??(r=e()),Reflect.defineProperty(r,o,t)}})}function y(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Po(e){return Object.keys(e).filter(r=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}var jo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Do={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Lv(e,r){let n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=Te(e._zod.def,{get shape(){let a={};for(let s in r){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(a[s]=n.shape[s])}return Ge(this,"shape",a),a},checks:[]});return le(e,i)}function Gv(e,r){let n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=Te(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in r){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);r[s]&&delete a[s]}return Ge(this,"shape",a),a},checks:[]});return le(e,i)}function Fv(e,r){if(!Fe(r))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let i=e._zod.def.shape;for(let a in r)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let t=Te(e._zod.def,{get shape(){let i={...e._zod.def.shape,...r};return Ge(this,"shape",i),i}});return le(e,t)}function Mv(e,r){if(!Fe(r))throw new Error("Invalid input to safeExtend: expected a plain object");let n=Te(e._zod.def,{get shape(){let o={...e._zod.def.shape,...r};return Ge(this,"shape",o),o}});return le(e,n)}function Bv(e,r){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=Te(e._zod.def,{get shape(){let o={...e._zod.def.shape,...r._zod.def.shape};return Ge(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:r._zod.def.checks??[]});return le(e,n)}function Jv(e,r,n){let t=r._zod.def.checks;if(t&&t.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=Te(r._zod.def,{get shape(){let s=r._zod.def.shape,l={...s};if(n)for(let c in n){if(!(c in s))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:s[c]}):s[c])}else for(let c in s)l[c]=e?new e({type:"optional",innerType:s[c]}):s[c];return Ge(this,"shape",l),l},checks:[]});return le(r,a)}function Vv(e,r,n){let o=Te(r._zod.def,{get shape(){let t=r._zod.def.shape,i={...t};if(n)for(let a in n){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=new e({type:"nonoptional",innerType:t[a]}))}else for(let a in t)i[a]=new e({type:"nonoptional",innerType:t[a]});return Ge(this,"shape",i),i}});return le(r,o)}function Me(e,r=0){if(e.aborted===!0)return!0;for(let n=r;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Co(e,r=0){if(e.aborted===!0)return!0;for(let n=r;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function fe(e,r){return r.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Qt(e){return typeof e=="string"?e:e?.message}function ue(e,r,n){let o=e.message?e.message:Qt(e.inst?._zod.def?.error?.(e))??Qt(r?.error?.(e))??Qt(n.customError?.(e))??Qt(n.localeError?.(e))??"Invalid input",{inst:t,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,r?.reportInput&&(s.input=a),s}function nr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ir(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function b(e){let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return r}function gt(...e){let[r,n,o]=e;return typeof r=="string"?{message:r,code:"custom",input:n,inst:o}:{...r}}function Wv(e){return Object.entries(e).filter(([r,n])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}function Dm(e){let r=atob(e),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return n}function Cm(e){let r="";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return btoa(r)}function Hv(e){let r=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-r.length%4)%4);return Dm(r+n)}function Kv(e){return Cm(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Xv(e){let r=e.replace(/^0x/,"");if(r.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(r.length/2);for(let o=0;o<r.length;o+=2)n[o/2]=Number.parseInt(r.slice(o,o+2),16);return n}function qv(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}var _o=class{constructor(...r){}};var Om=(e,r)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,mt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},or=p("$ZodError",Om),ge=p("$ZodError",Om,{Parent:Error});function ar(e,r=n=>n.message){let n={},o=[];for(let t of e.issues)t.path.length>0?(n[t.path[0]]=n[t.path[0]]||[],n[t.path[0]].push(r(t))):o.push(r(t));return{formErrors:o,fieldErrors:n}}function sr(e,r=n=>n.message){let n={_errors:[]},o=(t,i=[])=>{for(let a of t.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)n._errors.push(r(a));else{let l=n,c=0;for(;c<s.length;){let d=s[c];c===s.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(r(a))):l[d]=l[d]||{_errors:[]},l=l[d],c++}}}};return o(e),n}function Oo(e,r=n=>n.message){let n={errors:[]},o=(t,i=[])=>{var a,s;for(let l of t.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(c=>o({issues:c},[...i,...l.path]));else if(l.code==="invalid_key")o({issues:l.issues},[...i,...l.path]);else if(l.code==="invalid_element")o({issues:l.issues},[...i,...l.path]);else{let c=[...i,...l.path];if(c.length===0){n.errors.push(r(l));continue}let d=n,f=0;for(;f<c.length;){let v=c[f],g=f===c.length-1;typeof v=="string"?(d.properties??(d.properties={}),(a=d.properties)[v]??(a[v]={errors:[]}),d=d.properties[v]):(d.items??(d.items=[]),(s=d.items)[v]??(s[v]={errors:[]}),d=d.items[v]),g&&d.errors.push(r(l)),f++}}};return o(e),n}function Um(e){let r=[],n=e.map(o=>typeof o=="object"?o.key:o);for(let o of n)typeof o=="number"?r.push(`[${o}]`):typeof o=="symbol"?r.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?r.push(`[${JSON.stringify(o)}]`):(r.length&&r.push("."),r.push(o));return r.join("")}function Uo(e){let r=[],n=[...e.issues].sort((o,t)=>(o.path??[]).length-(t.path??[]).length);for(let o of n)r.push(`\u2716 ${o.message}`),o.path?.length&&r.push(` \u2192 at ${Um(o.path)}`);return r.join(`
|
|
7
7
|
`)}var ht=e=>(r,n,o,t)=>{let i=o?{...o,async:!1}:{async:!1},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ke;if(a.issues.length){let s=new(t?.Err??e)(a.issues.map(l=>ue(l,i,ee())));throw Yr(s,t?.callee),s}return a.value},Qr=ht(ge),vt=e=>async(r,n,o,t)=>{let i=o?{...o,async:!0}:{async:!0},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(t?.Err??e)(a.issues.map(l=>ue(l,i,ee())));throw Yr(s,t?.callee),s}return a.value},en=vt(ge),yt=e=>(r,n,o)=>{let t=o?{...o,async:!1}:{async:!1},i=r._zod.run({value:n,issues:[]},t);if(i instanceof Promise)throw new ke;return i.issues.length?{success:!1,error:new(e??or)(i.issues.map(a=>ue(a,t,ee())))}:{success:!0,data:i.value}},To=yt(ge),bt=e=>async(r,n,o)=>{let t=o?{...o,async:!0}:{async:!0},i=r._zod.run({value:n,issues:[]},t);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>ue(a,t,ee())))}:{success:!0,data:i.value}},No=bt(ge),tn=e=>(r,n,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return ht(e)(r,n,t)},Qv=tn(ge),rn=e=>(r,n,o)=>ht(e)(r,n,o),ey=rn(ge),nn=e=>async(r,n,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return vt(e)(r,n,t)},ty=nn(ge),on=e=>async(r,n,o)=>vt(e)(r,n,o),ry=on(ge),an=e=>(r,n,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return yt(e)(r,n,t)},ny=an(ge),sn=e=>(r,n,o)=>yt(e)(r,n,o),iy=sn(ge),cn=e=>async(r,n,o)=>{let t=o?{...o,direction:"backward"}:{direction:"backward"};return bt(e)(r,n,t)},oy=cn(ge),ln=e=>async(r,n,o)=>bt(e)(r,n,o),ay=ln(ge);var ye={};Ie(ye,{base64:()=>qo,base64url:()=>un,bigint:()=>ia,boolean:()=>aa,browserEmail:()=>fy,cidrv4:()=>Ko,cidrv6:()=>Xo,cuid:()=>Eo,cuid2:()=>Zo,date:()=>ea,datetime:()=>ra,domain:()=>vy,duration:()=>Fo,e164:()=>Qo,email:()=>Bo,emoji:()=>Jo,extendedDuration:()=>sy,guid:()=>Mo,hex:()=>yy,hostname:()=>hy,html5Email:()=>dy,httpProtocol:()=>Yo,idnEmail:()=>my,integer:()=>oa,ipv4:()=>Vo,ipv6:()=>Wo,ksuid:()=>Lo,lowercase:()=>la,mac:()=>Ho,md5_base64:()=>xy,md5_base64url:()=>$y,md5_hex:()=>by,nanoid:()=>Go,null:()=>sa,number:()=>dn,rfc5322Email:()=>py,sha1_base64:()=>ky,sha1_base64url:()=>Sy,sha1_hex:()=>_y,sha256_base64:()=>Iy,sha256_base64url:()=>zy,sha256_hex:()=>wy,sha384_base64:()=>jy,sha384_base64url:()=>Dy,sha384_hex:()=>Py,sha512_base64:()=>Oy,sha512_base64url:()=>Uy,sha512_hex:()=>Cy,string:()=>na,time:()=>ta,ulid:()=>Ro,undefined:()=>ca,unicodeEmail:()=>Tm,uppercase:()=>ua,uuid:()=>et,uuid4:()=>cy,uuid6:()=>ly,uuid7:()=>uy,xid:()=>Ao});var Eo=/^[cC][0-9a-z]{6,}$/,Zo=/^[0-9a-z]+$/,Ro=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ao=/^[0-9a-vA-V]{20}$/,Lo=/^[A-Za-z0-9]{27}$/,Go=/^[a-zA-Z0-9_-]{21}$/,Fo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sy=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Mo=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,et=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,cy=et(4),ly=et(6),uy=et(7),Bo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,dy=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,py=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Tm=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,my=Tm,fy=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,gy="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Jo(){return new RegExp(gy,"u")}var Vo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Wo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ho=e=>{let r=$e(e??":");return new RegExp(`^(?:[0-9A-F]{2}${r}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${r}){5}[0-9a-f]{2}$`)},Ko=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Xo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,un=/^[A-Za-z0-9_-]*$/,hy=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,vy=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Yo=/^https?$/,Qo=/^\+[1-9]\d{6,14}$/,Nm="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",ea=new RegExp(`^${Nm}$`);function Em(e){let r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${r}`:e.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${e.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ta(e){return new RegExp(`^${Em(e)}$`)}function ra(e){let r=Em({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${r}(?:${n.join("|")})`;return new RegExp(`^${Nm}T(?:${o})$`)}var na=e=>{let r=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},ia=/^-?\d+n?$/,oa=/^-?\d+$/,dn=/^-?\d+(?:\.\d+)?$/,aa=/^(?:true|false)$/i,sa=/^null$/i;var ca=/^undefined$/i;var la=/^[^A-Z]*$/,ua=/^[^a-z]*$/,yy=/^[0-9a-fA-F]*$/;function cr(e,r){return new RegExp(`^[A-Za-z0-9+/]{${e}}${r}$`)}function lr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var by=/^[0-9a-fA-F]{32}$/,xy=cr(22,"=="),$y=lr(22),_y=/^[0-9a-fA-F]{40}$/,ky=cr(27,"="),Sy=lr(27),wy=/^[0-9a-fA-F]{64}$/,Iy=cr(43,"="),zy=lr(43),Py=/^[0-9a-fA-F]{96}$/,jy=cr(64,""),Dy=lr(64),Cy=/^[0-9a-fA-F]{128}$/,Oy=cr(86,"=="),Uy=lr(86);var H=p("$ZodCheck",(e,r)=>{var n;e._zod??(e._zod={}),e._zod.def=r,(n=e._zod).onattach??(n.onattach=[])}),Rm={number:"number",bigint:"bigint",object:"date"},pn=p("$ZodCheckLessThan",(e,r)=>{H.init(e,r);let n=Rm[typeof r.value];e._zod.onattach.push(o=>{let t=o._zod.bag,i=(r.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<i&&(r.inclusive?t.maximum=r.value:t.exclusiveMaximum=r.value)}),e._zod.check=o=>{(r.inclusive?o.value<=r.value:o.value<r.value)||o.issues.push({origin:n,code:"too_big",maximum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),mn=p("$ZodCheckGreaterThan",(e,r)=>{H.init(e,r);let n=Rm[typeof r.value];e._zod.onattach.push(o=>{let t=o._zod.bag,i=(r.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>i&&(r.inclusive?t.minimum=r.value:t.exclusiveMinimum=r.value)}),e._zod.check=o=>{(r.inclusive?o.value>=r.value:o.value>r.value)||o.issues.push({origin:n,code:"too_small",minimum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),da=p("$ZodCheckMultipleOf",(e,r)=>{H.init(e,r),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=r.value)}),e._zod.check=n=>{if(typeof n.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%r.value===BigInt(0):ko(n.value,r.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:r.value,input:n.value,inst:e,continue:!r.abort})}}),pa=p("$ZodCheckNumberFormat",(e,r)=>{H.init(e,r),r.format=r.format||"float64";let n=r.format?.includes("int"),o=n?"int":"number",[t,i]=jo[r.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=r.format,s.minimum=t,s.maximum=i,n&&(s.pattern=oa)}),e._zod.check=a=>{let s=a.value;if(n){if(!Number.isInteger(s)){a.issues.push({expected:o,format:r.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!r.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!r.abort});return}}s<t&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:t,inclusive:!0,inst:e,continue:!r.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!r.abort})}}),ma=p("$ZodCheckBigIntFormat",(e,r)=>{H.init(e,r);let[n,o]=Do[r.format];e._zod.onattach.push(t=>{let i=t._zod.bag;i.format=r.format,i.minimum=n,i.maximum=o}),e._zod.check=t=>{let i=t.value;i<n&&t.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!r.abort}),i>o&&t.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!r.abort})}}),fa=p("$ZodCheckMaxSize",(e,r)=>{var n;H.init(e,r),(n=e._zod.def).when??(n.when=o=>{let t=o.value;return!Le(t)&&t.size!==void 0}),e._zod.onattach.push(o=>{let t=o._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<t&&(o._zod.bag.maximum=r.maximum)}),e._zod.check=o=>{let t=o.value;t.size<=r.maximum||o.issues.push({origin:nr(t),code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),ga=p("$ZodCheckMinSize",(e,r)=>{var n;H.init(e,r),(n=e._zod.def).when??(n.when=o=>{let t=o.value;return!Le(t)&&t.size!==void 0}),e._zod.onattach.push(o=>{let t=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>t&&(o._zod.bag.minimum=r.minimum)}),e._zod.check=o=>{let t=o.value;t.size>=r.minimum||o.issues.push({origin:nr(t),code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),ha=p("$ZodCheckSizeEquals",(e,r)=>{var n;H.init(e,r),(n=e._zod.def).when??(n.when=o=>{let t=o.value;return!Le(t)&&t.size!==void 0}),e._zod.onattach.push(o=>{let t=o._zod.bag;t.minimum=r.size,t.maximum=r.size,t.size=r.size}),e._zod.check=o=>{let t=o.value,i=t.size;if(i===r.size)return;let a=i>r.size;o.issues.push({origin:nr(t),...a?{code:"too_big",maximum:r.size}:{code:"too_small",minimum:r.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!r.abort})}}),va=p("$ZodCheckMaxLength",(e,r)=>{var n;H.init(e,r),(n=e._zod.def).when??(n.when=o=>{let t=o.value;return!Le(t)&&t.length!==void 0}),e._zod.onattach.push(o=>{let t=o._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<t&&(o._zod.bag.maximum=r.maximum)}),e._zod.check=o=>{let t=o.value;if(t.length<=r.maximum)return;let a=ir(t);o.issues.push({origin:a,code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),ya=p("$ZodCheckMinLength",(e,r)=>{var n;H.init(e,r),(n=e._zod.def).when??(n.when=o=>{let t=o.value;return!Le(t)&&t.length!==void 0}),e._zod.onattach.push(o=>{let t=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>t&&(o._zod.bag.minimum=r.minimum)}),e._zod.check=o=>{let t=o.value;if(t.length>=r.minimum)return;let a=ir(t);o.issues.push({origin:a,code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),ba=p("$ZodCheckLengthEquals",(e,r)=>{var n;H.init(e,r),(n=e._zod.def).when??(n.when=o=>{let t=o.value;return!Le(t)&&t.length!==void 0}),e._zod.onattach.push(o=>{let t=o._zod.bag;t.minimum=r.length,t.maximum=r.length,t.length=r.length}),e._zod.check=o=>{let t=o.value,i=t.length;if(i===r.length)return;let a=ir(t),s=i>r.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!r.abort})}}),xt=p("$ZodCheckStringFormat",(e,r)=>{var n,o;H.init(e,r),e._zod.onattach.push(t=>{let i=t._zod.bag;i.format=r.format,r.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(r.pattern))}),r.pattern?(n=e._zod).check??(n.check=t=>{r.pattern.lastIndex=0,!r.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:r.format,input:t.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})}):(o=e._zod).check??(o.check=()=>{})}),xa=p("$ZodCheckRegex",(e,r)=>{xt.init(e,r),e._zod.check=n=>{r.pattern.lastIndex=0,!r.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),$a=p("$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=la),xt.init(e,r)}),_a=p("$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=ua),xt.init(e,r)}),ka=p("$ZodCheckIncludes",(e,r)=>{H.init(e,r);let n=$e(r.includes),o=new RegExp(typeof r.position=="number"?`^.{${r.position}}${n}`:n);r.pattern=o,e._zod.onattach.push(t=>{let i=t._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=t=>{t.value.includes(r.includes,r.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:t.value,inst:e,continue:!r.abort})}}),Sa=p("$ZodCheckStartsWith",(e,r)=>{H.init(e,r);let n=new RegExp(`^${$e(r.prefix)}.*`);r.pattern??(r.pattern=n),e._zod.onattach.push(o=>{let t=o._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(r.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:o.value,inst:e,continue:!r.abort})}}),wa=p("$ZodCheckEndsWith",(e,r)=>{H.init(e,r);let n=new RegExp(`.*${$e(r.suffix)}$`);r.pattern??(r.pattern=n),e._zod.onattach.push(o=>{let t=o._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(r.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:o.value,inst:e,continue:!r.abort})}});function Zm(e,r,n){e.issues.length&&r.issues.push(...fe(n,e.issues))}var Ia=p("$ZodCheckProperty",(e,r)=>{H.init(e,r),e._zod.check=n=>{let o=r.schema._zod.run({value:n.value[r.property],issues:[]},{});if(o instanceof Promise)return o.then(t=>Zm(t,n,r.property));Zm(o,n,r.property)}}),za=p("$ZodCheckMimeType",(e,r)=>{H.init(e,r);let n=new Set(r.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=r.mime}),e._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:"invalid_value",values:r.mime,input:o.value.type,inst:e,continue:!r.abort})}}),Pa=p("$ZodCheckOverwrite",(e,r)=>{H.init(e,r),e._zod.check=n=>{n.value=r.tx(n.value)}});var ur=class{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}let o=r.split(`
|
|
8
8
|
`).filter(a=>a),t=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(t)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let r=Function,n=this?.args,t=[...(this?.content??[""]).map(i=>` ${i}`)];return new r(...n,t.join(`
|
|
9
9
|
`))}};var ja={major:4,minor:4,patch:3};var U=p("$ZodType",(e,r)=>{var n;e??(e={}),e._zod.def=r,e._zod.bag=e._zod.bag||{},e._zod.version=ja;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let t of o)for(let i of t._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(a,s,l)=>{let c=Me(a),d;for(let f of s){if(f._zod.def.when){if(Co(a)||!f._zod.def.when(a))continue}else if(c)continue;let v=a.issues.length,g=f._zod.check(a);if(g instanceof Promise&&l?.async===!1)throw new ke;if(d||g instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await g,a.issues.length!==v&&(c||(c=Me(a,v)))});else{if(a.issues.length===v)continue;c||(c=Me(a,v))}}return d?d.then(()=>a):a},i=(a,s,l)=>{if(Me(a))return a.aborted=!0,a;let c=t(s,o,l);if(c instanceof Promise){if(l.async===!1)throw new ke;return c.then(d=>e._zod.parse(d,l))}return e._zod.parse(c,l)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let c=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return c instanceof Promise?c.then(d=>i(d,a,s)):i(c,a,s)}let l=e._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new ke;return l.then(c=>t(c,o,s))}return t(l,o,s)}}E(e,"~standard",()=>({validate:t=>{try{let i=To(e,t);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return No(e,t).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),tt=p("$ZodString",(e,r)=>{U.init(e,r),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??na(e._zod.bag),e._zod.parse=(n,o)=>{if(r.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),V=p("$ZodStringFormat",(e,r)=>{xt.init(e,r),tt.init(e,r)}),Ca=p("$ZodGUID",(e,r)=>{r.pattern??(r.pattern=Mo),V.init(e,r)}),Oa=p("$ZodUUID",(e,r)=>{if(r.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(o===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=et(o))}else r.pattern??(r.pattern=et());V.init(e,r)}),Ua=p("$ZodEmail",(e,r)=>{r.pattern??(r.pattern=Bo),V.init(e,r)}),Ta=p("$ZodURL",(e,r)=>{V.init(e,r),e._zod.check=n=>{try{let o=n.value.trim();if(!r.normalize&&r.protocol?.source===Yo.source&&!/^https?:\/\//i.test(o)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!r.abort});return}let t=new URL(o);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(t.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:r.hostname.source,input:n.value,inst:e,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:n.value,inst:e,continue:!r.abort})),r.normalize?n.value=t.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!r.abort})}}}),Na=p("$ZodEmoji",(e,r)=>{r.pattern??(r.pattern=Jo()),V.init(e,r)}),Ea=p("$ZodNanoID",(e,r)=>{r.pattern??(r.pattern=Go),V.init(e,r)}),Za=p("$ZodCUID",(e,r)=>{r.pattern??(r.pattern=Eo),V.init(e,r)}),Ra=p("$ZodCUID2",(e,r)=>{r.pattern??(r.pattern=Zo),V.init(e,r)}),Aa=p("$ZodULID",(e,r)=>{r.pattern??(r.pattern=Ro),V.init(e,r)}),La=p("$ZodXID",(e,r)=>{r.pattern??(r.pattern=Ao),V.init(e,r)}),Ga=p("$ZodKSUID",(e,r)=>{r.pattern??(r.pattern=Lo),V.init(e,r)}),Fa=p("$ZodISODateTime",(e,r)=>{r.pattern??(r.pattern=ra(r)),V.init(e,r)}),Ma=p("$ZodISODate",(e,r)=>{r.pattern??(r.pattern=ea),V.init(e,r)}),Ba=p("$ZodISOTime",(e,r)=>{r.pattern??(r.pattern=ta(r)),V.init(e,r)}),Ja=p("$ZodISODuration",(e,r)=>{r.pattern??(r.pattern=Fo),V.init(e,r)}),Va=p("$ZodIPv4",(e,r)=>{r.pattern??(r.pattern=Vo),V.init(e,r),e._zod.bag.format="ipv4"}),Wa=p("$ZodIPv6",(e,r)=>{r.pattern??(r.pattern=Wo),V.init(e,r),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!r.abort})}}}),Ha=p("$ZodMAC",(e,r)=>{r.pattern??(r.pattern=Ho(r.delimiter)),V.init(e,r),e._zod.bag.format="mac"}),Ka=p("$ZodCIDRv4",(e,r)=>{r.pattern??(r.pattern=Ko),V.init(e,r)}),Xa=p("$ZodCIDRv6",(e,r)=>{r.pattern??(r.pattern=Xo),V.init(e,r),e._zod.check=n=>{let o=n.value.split("/");try{if(o.length!==2)throw new Error;let[t,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${t}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!r.abort})}}});function qa(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Ya=p("$ZodBase64",(e,r)=>{r.pattern??(r.pattern=qo),V.init(e,r),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{qa(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!r.abort})}});function ef(e){if(!un.test(e))return!1;let r=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=r.padEnd(Math.ceil(r.length/4)*4,"=");return qa(n)}var Qa=p("$ZodBase64URL",(e,r)=>{r.pattern??(r.pattern=un),V.init(e,r),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{ef(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!r.abort})}}),es=p("$ZodE164",(e,r)=>{r.pattern??(r.pattern=Qo),V.init(e,r)});function tf(e,r=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let t=JSON.parse(atob(o));return!("typ"in t&&t?.typ!=="JWT"||!t.alg||r&&(!("alg"in t)||t.alg!==r))}catch{return!1}}var ts=p("$ZodJWT",(e,r)=>{V.init(e,r),e._zod.check=n=>{tf(n.value,r.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!r.abort})}}),rs=p("$ZodCustomStringFormat",(e,r)=>{V.init(e,r),e._zod.check=n=>{r.fn(n.value)||n.issues.push({code:"invalid_format",format:r.format,input:n.value,inst:e,continue:!r.abort})}}),yn=p("$ZodNumber",(e,r)=>{U.init(e,r),e._zod.pattern=e._zod.bag.pattern??dn,e._zod.parse=(n,o)=>{if(r.coerce)try{n.value=Number(n.value)}catch{}let t=n.value;if(typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t))return n;let i=typeof t=="number"?Number.isNaN(t)?"NaN":Number.isFinite(t)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:t,inst:e,...i?{received:i}:{}}),n}}),ns=p("$ZodNumberFormat",(e,r)=>{pa.init(e,r),yn.init(e,r)}),dr=p("$ZodBoolean",(e,r)=>{U.init(e,r),e._zod.pattern=aa,e._zod.parse=(n,o)=>{if(r.coerce)try{n.value=!!n.value}catch{}let t=n.value;return typeof t=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:t,inst:e}),n}}),bn=p("$ZodBigInt",(e,r)=>{U.init(e,r),e._zod.pattern=ia,e._zod.parse=(n,o)=>{if(r.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),is=p("$ZodBigIntFormat",(e,r)=>{ma.init(e,r),bn.init(e,r)}),os=p("$ZodSymbol",(e,r)=>{U.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;return typeof t=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:t,inst:e}),n}}),as=p("$ZodUndefined",(e,r)=>{U.init(e,r),e._zod.pattern=ca,e._zod.values=new Set([void 0]),e._zod.parse=(n,o)=>{let t=n.value;return typeof t>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:t,inst:e}),n}}),ss=p("$ZodNull",(e,r)=>{U.init(e,r),e._zod.pattern=sa,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let t=n.value;return t===null||n.issues.push({expected:"null",code:"invalid_type",input:t,inst:e}),n}}),cs=p("$ZodAny",(e,r)=>{U.init(e,r),e._zod.parse=n=>n}),ls=p("$ZodUnknown",(e,r)=>{U.init(e,r),e._zod.parse=n=>n}),us=p("$ZodNever",(e,r)=>{U.init(e,r),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),ds=p("$ZodVoid",(e,r)=>{U.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;return typeof t>"u"||n.issues.push({expected:"void",code:"invalid_type",input:t,inst:e}),n}}),ps=p("$ZodDate",(e,r)=>{U.init(e,r),e._zod.parse=(n,o)=>{if(r.coerce)try{n.value=new Date(n.value)}catch{}let t=n.value,i=t instanceof Date;return i&&!Number.isNaN(t.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:t,...i?{received:"Invalid Date"}:{},inst:e}),n}});function Lm(e,r,n){e.issues.length&&r.issues.push(...fe(n,e.issues)),r.value[n]=e.value}var ms=p("$ZodArray",(e,r)=>{U.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;if(!Array.isArray(t))return n.issues.push({expected:"array",code:"invalid_type",input:t,inst:e}),n;n.value=Array(t.length);let i=[];for(let a=0;a<t.length;a++){let s=t[a],l=r.element._zod.run({value:s,issues:[]},o);l instanceof Promise?i.push(l.then(c=>Lm(c,n,a))):Lm(l,n,a)}return i.length?Promise.all(i).then(()=>n):n}});function vn(e,r,n,o,t,i){let a=n in o;if(e.issues.length){if(t&&i&&!a)return;r.issues.push(...fe(n,e.issues))}if(!a&&!t){e.issues.length||r.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?a&&(r.value[n]=void 0):r.value[n]=e.value}function rf(e){let r=Object.keys(e.shape);for(let o of r)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let n=Po(e.shape);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(n)}}function nf(e,r,n,o,t,i){let a=[],s=t.keySet,l=t.catchall._zod,c=l.def.type,d=l.optin==="optional",f=l.optout==="optional";for(let v in r){if(v==="__proto__"||s.has(v))continue;if(c==="never"){a.push(v);continue}let g=l.run({value:r[v],issues:[]},o);g instanceof Promise?e.push(g.then(k=>vn(k,n,v,r,d,f))):vn(g,n,v,r,d,f)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:r,inst:i}),e.length?Promise.all(e).then(()=>n):n}var of=p("$ZodObject",(e,r)=>{if(U.init(e,r),!Object.getOwnPropertyDescriptor(r,"shape")?.get){let s=r.shape;Object.defineProperty(r,"shape",{get:()=>{let l={...s};return Object.defineProperty(r,"shape",{value:l}),l}})}let o=ft(()=>rf(r));E(e._zod,"propValues",()=>{let s=r.shape,l={};for(let c in s){let d=s[c]._zod;if(d.values){l[c]??(l[c]=new Set);for(let f of d.values)l[c].add(f)}}return l});let t=Qe,i=r.catchall,a;e._zod.parse=(s,l)=>{a??(a=o.value);let c=s.value;if(!t(c))return s.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),s;s.value={};let d=[],f=a.shape;for(let v of a.keys){let g=f[v],k=g._zod.optin==="optional",Z=g._zod.optout==="optional",R=g._zod.run({value:c[v],issues:[]},l);R instanceof Promise?d.push(R.then(A=>vn(A,s,v,c,k,Z))):vn(R,s,v,c,k,Z)}return i?nf(d,c,s,l,o.value,e):d.length?Promise.all(d).then(()=>s):s}}),fs=p("$ZodObjectJIT",(e,r)=>{of.init(e,r);let n=e._zod.parse,o=ft(()=>rf(r)),t=v=>{let g=new ur(["shape","payload","ctx"]),k=o.value,Z=F=>{let O=qr(F);return`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`};g.write("const input = payload.value;");let R=Object.create(null),A=0;for(let F of k.keys)R[F]=`key_${A++}`;g.write("const newResult = {};");for(let F of k.keys){let O=R[F],M=qr(F),S=v[F],L=S?._zod?.optin==="optional",G=S?._zod?.optout==="optional";g.write(`const ${O} = ${Z(F)};`),L&&G?g.write(`
|