difit 3.0.3 → 3.0.5

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.
@@ -11,10 +11,10 @@ Error generating stack: `+l.message+`
11
11
 
12
12
  "${T.body}"`)&&(c(T.id),p>=C.length-1&&p>0&&b(p-1))},[c,p,C.length]);R.useEffect(()=>(a?(S("comments-list"),y("navigation")):(S("navigation"),y("comments-list"),b(0)),()=>{S("navigation"),y("comments-list")}),[a,S,y]);const v={scopes:"comments-list",enableOnFormTags:!1};return Ye("escape",()=>r(),v,[r]),Ye("j, down",()=>b(T=>Math.min(T+1,C.length-1)),v,[C.length]),Ye("k, up",()=>b(T=>Math.max(T-1,0)),v,[]),Ye("enter",()=>{C[p]&&_(C[p])},v,[p,C,_]),Ye("d",()=>{C[p]&&x(C[p])},v,[p,C,x]),R.useEffect(()=>{m.current[p]&&m.current[p]?.scrollIntoView({behavior:"smooth",block:"nearest"})},[p]),a?h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:r}),h.jsxs("div",{className:"relative bg-github-bg-primary border border-github-border rounded-lg shadow-lg max-w-4xl w-full max-h-[80vh] overflow-hidden",children:[h.jsxs("div",{className:"sticky top-0 bg-github-bg-primary border-b border-github-border px-6 py-4",children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("h2",{className:"text-lg font-semibold text-github-text-primary",children:"All Comments"}),h.jsx("button",{onClick:r,className:"text-github-text-secondary hover:text-github-text-primary transition-colors","aria-label":"Close comments list",children:h.jsx(kc,{size:20})})]}),h.jsxs("div",{className:"text-xs text-github-text-secondary",children:[h.jsx("span",{className:"font-mono",children:"j/k"})," or ",h.jsx("span",{className:"font-mono",children:"↑/↓"})," to navigate • ",h.jsx("span",{className:"font-mono",children:"Enter"})," to jump •"," ",h.jsx("span",{className:"font-mono",children:"d"})," to delete • ",h.jsx("span",{className:"font-mono",children:"Esc"})," ","to close"]})]}),h.jsx("div",{className:"overflow-y-auto max-h-[calc(80vh-120px)]",children:h.jsx("div",{className:"p-6",children:C.length===0?h.jsx("p",{className:"text-github-text-secondary text-center",children:"No comments yet"}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"space-y-2",children:C.map((T,N)=>h.jsx("div",{ref:A=>{m.current[N]=A},className:`${p===N?"ring-2 ring-blue-500 rounded":""}`,children:h.jsx(Dc,{comment:T,onGeneratePrompt:f,onRemoveComment:c,onUpdateComment:d,onClick:A=>{A.stopPropagation(),b(N),_(T)}})},T.id))}),C.length>0&&h.jsxs("div",{className:"mt-4 pt-4 border-t border-github-border text-xs text-github-text-secondary text-center",children:[p+1," of ",C.length," comments"]})]})})})]})]}):null}function gp(a){return a&&a.split(".").pop()?.toLowerCase()||null}function Fv(a){return a&&a.split("/").pop()||""}const qv=["jpg","jpeg","png","gif","bmp","svg","webp","ico","tiff","tif","avif","heic","heif"];function Gv(a){if(!a)return!1;const r=gp(a);return r?qv.includes(r):!1}class Yv{diff(r,s,o={}){let c;typeof o=="function"?(c=o,o={}):"callback"in o&&(c=o.callback);const f=this.castInput(r,o),d=this.castInput(s,o),p=this.removeEmpty(this.tokenize(f,o)),b=this.removeEmpty(this.tokenize(d,o));return this.diffWithOptionsObj(p,b,o,c)}diffWithOptionsObj(r,s,o,c){var f;const d=A=>{if(A=this.postProcess(A,o),c){setTimeout(function(){c(A)},0);return}else return A},p=s.length,b=r.length;let m=1,S=p+b;o.maxEditLength!=null&&(S=Math.min(S,o.maxEditLength));const y=(f=o.timeout)!==null&&f!==void 0?f:1/0,C=Date.now()+y,_=[{oldPos:-1,lastComponent:void 0}];let x=this.extractCommon(_[0],s,r,0,o);if(_[0].oldPos+1>=b&&x+1>=p)return d(this.buildValues(_[0].lastComponent,s,r));let v=-1/0,T=1/0;const N=()=>{for(let A=Math.max(v,-m);A<=Math.min(T,m);A+=2){let D;const z=_[A-1],L=_[A+1];z&&(_[A-1]=void 0);let Q=!1;if(L){const ce=L.oldPos-A;Q=L&&0<=ce&&ce<p}const Y=z&&z.oldPos+1<b;if(!Q&&!Y){_[A]=void 0;continue}if(!Y||Q&&z.oldPos<L.oldPos?D=this.addToPath(L,!0,!1,0,o):D=this.addToPath(z,!1,!0,1,o),x=this.extractCommon(D,s,r,A,o),D.oldPos+1>=b&&x+1>=p)return d(this.buildValues(D.lastComponent,s,r))||!0;_[A]=D,D.oldPos+1>=b&&(T=Math.min(T,A-1)),x+1>=p&&(v=Math.max(v,A+1))}m++};if(c)(function A(){setTimeout(function(){if(m>S||Date.now()>C)return c(void 0);N()||A()},0)})();else for(;m<=S&&Date.now()<=C;){const A=N();if(A)return A}}addToPath(r,s,o,c,f){const d=r.lastComponent;return d&&!f.oneChangePerToken&&d.added===s&&d.removed===o?{oldPos:r.oldPos+c,lastComponent:{count:d.count+1,added:s,removed:o,previousComponent:d.previousComponent}}:{oldPos:r.oldPos+c,lastComponent:{count:1,added:s,removed:o,previousComponent:d}}}extractCommon(r,s,o,c,f){const d=s.length,p=o.length;let b=r.oldPos,m=b-c,S=0;for(;m+1<d&&b+1<p&&this.equals(o[b+1],s[m+1],f);)m++,b++,S++,f.oneChangePerToken&&(r.lastComponent={count:1,previousComponent:r.lastComponent,added:!1,removed:!1});return S&&!f.oneChangePerToken&&(r.lastComponent={count:S,previousComponent:r.lastComponent,added:!1,removed:!1}),r.oldPos=b,m}equals(r,s,o){return o.comparator?o.comparator(r,s):r===s||!!o.ignoreCase&&r.toLowerCase()===s.toLowerCase()}removeEmpty(r){const s=[];for(let o=0;o<r.length;o++)r[o]&&s.push(r[o]);return s}castInput(r,s){return r}tokenize(r,s){return Array.from(r)}join(r){return r.join("")}postProcess(r,s){return r}get useLongestToken(){return!1}buildValues(r,s,o){const c=[];let f;for(;r;)c.push(r),f=r.previousComponent,delete r.previousComponent,r=f;c.reverse();const d=c.length;let p=0,b=0,m=0;for(;p<d;p++){const S=c[p];if(S.removed)S.value=this.join(o.slice(m,m+S.count)),m+=S.count;else{if(!S.added&&this.useLongestToken){let y=s.slice(b,b+S.count);y=y.map(function(C,_){const x=o[m+_];return x.length>C.length?x:C}),S.value=this.join(y)}else S.value=this.join(s.slice(b,b+S.count));b+=S.count,S.added||(m+=S.count)}}return c}}function Kh(a,r){let s;for(s=0;s<a.length&&s<r.length;s++)if(a[s]!=r[s])return a.slice(0,s);return a.slice(0,s)}function Jh(a,r){let s;if(!a||!r||a[a.length-1]!=r[r.length-1])return"";for(s=0;s<a.length&&s<r.length;s++)if(a[a.length-(s+1)]!=r[r.length-(s+1)])return a.slice(-s);return a.slice(-s)}function yc(a,r,s){if(a.slice(0,r.length)!=r)throw Error(`string ${JSON.stringify(a)} doesn't start with prefix ${JSON.stringify(r)}; this is a bug`);return s+a.slice(r.length)}function vc(a,r,s){if(!r)return a+s;if(a.slice(-r.length)!=r)throw Error(`string ${JSON.stringify(a)} doesn't end with suffix ${JSON.stringify(r)}; this is a bug`);return a.slice(0,-r.length)+s}function Mr(a,r){return yc(a,r,"")}function ao(a,r){return vc(a,r,"")}function Wh(a,r){return r.slice(0,Vv(a,r))}function Vv(a,r){let s=0;a.length>r.length&&(s=a.length-r.length);let o=r.length;a.length<r.length&&(o=a.length);const c=Array(o);let f=0;c[0]=0;for(let d=1;d<o;d++){for(r[d]==r[f]?c[d]=c[f]:c[d]=f;f>0&&r[d]!=r[f];)f=c[f];r[d]==r[f]&&f++}f=0;for(let d=s;d<a.length;d++){for(;f>0&&a[d]!=r[f];)f=c[f];a[d]==r[f]&&f++}return f}function zr(a){let r;for(r=a.length-1;r>=0&&a[r].match(/\s/);r--);return a.substring(r+1)}function bl(a){const r=a.match(/^\s*/);return r?r[0]:""}const Ph="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",Xv=new RegExp(`[${Ph}]+|\\s+|[^${Ph}]`,"ug");class Zv extends Yv{equals(r,s,o){return o.ignoreCase&&(r=r.toLowerCase(),s=s.toLowerCase()),r.trim()===s.trim()}tokenize(r,s={}){let o;if(s.intlSegmenter){const d=s.intlSegmenter;if(d.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');o=Array.from(d.segment(r),p=>p.segment)}else o=r.match(Xv)||[];const c=[];let f=null;return o.forEach(d=>{/\s/.test(d)?f==null?c.push(d):c.push(c.pop()+d):f!=null&&/\s/.test(f)?c[c.length-1]==f?c.push(c.pop()+d):c.push(f+d):c.push(d),f=d}),c}join(r){return r.map((s,o)=>o==0?s:s.replace(/^\s+/,"")).join("")}postProcess(r,s){if(!r||s.oneChangePerToken)return r;let o=null,c=null,f=null;return r.forEach(d=>{d.added?c=d:d.removed?f=d:((c||f)&&em(o,f,c,d),o=d,c=null,f=null)}),(c||f)&&em(o,f,c,null),r}}const Iv=new Zv;function hp(a,r,s){return Iv.diff(a,r,s)}function em(a,r,s,o){if(r&&s){const c=bl(r.value),f=zr(r.value),d=bl(s.value),p=zr(s.value);if(a){const b=Kh(c,d);a.value=vc(a.value,d,b),r.value=Mr(r.value,b),s.value=Mr(s.value,b)}if(o){const b=Jh(f,p);o.value=yc(o.value,p,b),r.value=ao(r.value,b),s.value=ao(s.value,b)}}else if(s){if(a){const c=bl(s.value);s.value=s.value.substring(c.length)}if(o){const c=bl(o.value);o.value=o.value.substring(c.length)}}else if(a&&o){const c=bl(o.value),f=bl(r.value),d=zr(r.value),p=Kh(c,f);r.value=Mr(r.value,p);const b=Jh(Mr(c,p),d);r.value=ao(r.value,b),o.value=yc(o.value,c,b),a.value=vc(a.value,c,c.slice(0,c.length-b.length))}else if(o){const c=bl(o.value),f=zr(r.value),d=Wh(f,c);r.value=ao(r.value,d)}else if(a){const c=zr(a.value),f=bl(r.value),d=Wh(c,f);r.value=Mr(r.value,d)}}function mp(a,r){const s=hp(a,r),o=[],c=[];for(const f of s)f.added?c.push({value:f.value,type:"added"}):f.removed?o.push({value:f.value,type:"removed"}):(o.push({value:f.value,type:"unchanged"}),c.push({value:f.value,type:"unchanged"}));return{oldSegments:o,newSegments:c}}function pp(a,r){if(!a.trim()||!r.trim()||a===r)return!1;const s=hp(a,r);let o=0,c=0;for(const d of s)c+=d.value.length,!d.added&&!d.removed&&(o+=d.value.length);return o/c>=.2}function bp({onSubmit:a,onCancel:r}){const[s,o]=R.useState(""),[c,f]=R.useState(!1),d=async m=>{if(m.preventDefault(),!!s.trim()){f(!0);try{await a(s.trim()),o("")}catch(S){console.error("Failed to submit comment:",S)}finally{f(!1)}}},p=m=>{m.key==="Enter"&&(m.metaKey||m.ctrlKey)?d(m):m.key==="Escape"&&r()},b=/Macintosh|Mac OS X/.test(navigator.userAgent)?"Cmd":"Ctrl";return h.jsxs("form",{className:"m-2 mx-3 p-3 bg-github-bg-tertiary border border-yellow-600/50 rounded-md border-l-4 border-l-yellow-400",onSubmit:d,"data-empty":!s.trim(),children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("span",{className:"text-sm font-medium",style:{color:"var(--color-yellow-path-text)"},children:"Add a comment"}),h.jsxs("span",{className:"text-xs text-github-text-muted",children:[b,"+Enter to submit • Escape to cancel"]})]}),h.jsx("textarea",{className:"w-full min-h-[60px] mb-2 resize-y bg-github-bg-secondary border border-github-border rounded px-3 py-2 text-github-text-primary text-sm leading-6 focus:outline-none focus:border-blue-600 focus:ring-2 focus:ring-blue-600/30 focus:min-h-[80px] disabled:opacity-50",value:s,onChange:m=>o(m.target.value),onKeyDown:p,placeholder:"Leave a comment...",rows:3,autoFocus:!0,disabled:c}),h.jsxs("div",{className:"flex gap-2 justify-end",children:[h.jsx("button",{type:"button",onClick:r,className:"text-xs px-3 py-1.5 bg-github-bg-tertiary text-github-text-primary border border-github-border rounded hover:opacity-80 transition-all disabled:opacity-50",disabled:c,children:"Cancel"}),h.jsx("button",{type:"submit",className:"text-xs px-3 py-1.5 rounded transition-all disabled:opacity-50",style:{backgroundColor:"var(--color-yellow-btn-bg)",color:"var(--color-yellow-btn-text)",border:"1px solid var(--color-yellow-btn-border)"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--color-yellow-btn-hover-bg)",m.currentTarget.style.borderColor="var(--color-yellow-btn-hover-border)"},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="var(--color-yellow-btn-bg)",m.currentTarget.style.borderColor="var(--color-yellow-btn-border)"},disabled:!s.trim()||c,children:c?"Submitting...":"Submit"})]})]})}const fo=Vn.memo(({onMouseDown:a,onMouseUp:r,title:s="Add a comment"})=>h.jsx("button",{className:"absolute -right-2 top-1/2 -translate-y-1/2 w-7 h-7 flex items-center justify-center rounded transition-all duration-150 hover:scale-110 z-10","data-comment-button":"true",style:{backgroundColor:"var(--color-yellow-btn-bg)",color:"var(--color-yellow-btn-text)",border:"1px solid var(--color-yellow-btn-border)"},onMouseEnter:o=>{o.currentTarget.style.backgroundColor="var(--color-yellow-btn-hover-bg)",o.currentTarget.style.borderColor="var(--color-yellow-btn-hover-border)"},onMouseLeave:o=>{o.currentTarget.style.backgroundColor="var(--color-yellow-btn-bg)",o.currentTarget.style.borderColor="var(--color-yellow-btn-border)"},onMouseDown:a,onMouseUp:r,title:s,children:h.jsx(cp,{className:"w-4 h-4"})}));fo.displayName="CommentButton";const $v=2,Qv=100;function Kv(a){return!(a.length<$v||a.length>Qv)}function tm(a){return a.toLowerCase()}function nm(a){const r=a.trim();return r?r.match(/^\w+$/)!==null&&Kv(r):!1}const Jv=200,yp=R.createContext(void 0);function Wv({children:a}){const[r,s]=R.useState(null),o=R.useRef(null),c=R.useCallback(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]),f=R.useCallback(m=>{const S=m.target;if(!S.classList.contains("word-token"))return;c();const y=S.getAttribute("data-word");y&&(o.current=setTimeout(()=>{s(y)},Jv))},[c]),d=R.useCallback(()=>{c(),s(null)},[c]),p=R.useCallback(m=>r?tm(m)===tm(r):!1,[r]);R.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]);const b={highlightedWord:r,handleMouseOver:f,handleMouseOut:d,isWordHighlighted:p};return h.jsx(yp.Provider,{value:b,children:a})}function Pv(){const a=R.useContext(yp);if(!a)throw new Error("useWordHighlight must be used within a WordHighlightProvider");return a}function vp(a){var r,s,o="";if(typeof a=="string"||typeof a=="number")o+=a;else if(typeof a=="object")if(Array.isArray(a)){var c=a.length;for(r=0;r<c;r++)a[r]&&(s=vp(a[r]))&&(o&&(o+=" "),o+=s)}else for(s in a)a[s]&&(o&&(o+=" "),o+=s);return o}function xp(){for(var a,r,s=0,o="",c=arguments.length;s<c;s++)(a=arguments[s])&&(r=vp(a))&&(o&&(o+=" "),o+=r);return o}var e1=Object.create,To=Object.defineProperty,t1=Object.defineProperties,n1=Object.getOwnPropertyDescriptor,l1=Object.getOwnPropertyDescriptors,Sp=Object.getOwnPropertyNames,go=Object.getOwnPropertySymbols,a1=Object.getPrototypeOf,Mc=Object.prototype.hasOwnProperty,Ep=Object.prototype.propertyIsEnumerable,lm=(a,r,s)=>r in a?To(a,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[r]=s,vn=(a,r)=>{for(var s in r||(r={}))Mc.call(r,s)&&lm(a,s,r[s]);if(go)for(var s of go(r))Ep.call(r,s)&&lm(a,s,r[s]);return a},Ro=(a,r)=>t1(a,l1(r)),wp=(a,r)=>{var s={};for(var o in a)Mc.call(a,o)&&r.indexOf(o)<0&&(s[o]=a[o]);if(a!=null&&go)for(var o of go(a))r.indexOf(o)<0&&Ep.call(a,o)&&(s[o]=a[o]);return s},r1=(a,r)=>function(){return r||(0,a[Sp(a)[0]])((r={exports:{}}).exports,r),r.exports},i1=(a,r)=>{for(var s in r)To(a,s,{get:r[s],enumerable:!0})},o1=(a,r,s,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of Sp(r))!Mc.call(a,c)&&c!==s&&To(a,c,{get:()=>r[c],enumerable:!(o=n1(r,c))||o.enumerable});return a},s1=(a,r,s)=>(s=a!=null?e1(a1(a)):{},o1(!a||!a.__esModule?To(s,"default",{value:a,enumerable:!0}):s,a)),u1=r1({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(a,r){var s=(function(){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,c=0,f={},d={util:{encode:function x(v){return v instanceof p?new p(v.type,x(v.content),v.alias):Array.isArray(v)?v.map(x):v.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(x){return Object.prototype.toString.call(x).slice(8,-1)},objId:function(x){return x.__id||Object.defineProperty(x,"__id",{value:++c}),x.__id},clone:function x(v,T){T=T||{};var N,A;switch(d.util.type(v)){case"Object":if(A=d.util.objId(v),T[A])return T[A];N={},T[A]=N;for(var D in v)v.hasOwnProperty(D)&&(N[D]=x(v[D],T));return N;case"Array":return A=d.util.objId(v),T[A]?T[A]:(N=[],T[A]=N,v.forEach(function(z,L){N[L]=x(z,T)}),N);default:return v}},getLanguage:function(x){for(;x;){var v=o.exec(x.className);if(v)return v[1].toLowerCase();x=x.parentElement}return"none"},setLanguage:function(x,v){x.className=x.className.replace(RegExp(o,"gi"),""),x.classList.add("language-"+v)},isActive:function(x,v,T){for(var N="no-"+v;x;){var A=x.classList;if(A.contains(v))return!0;if(A.contains(N))return!1;x=x.parentElement}return!!T}},languages:{plain:f,plaintext:f,text:f,txt:f,extend:function(x,v){var T=d.util.clone(d.languages[x]);for(var N in v)T[N]=v[N];return T},insertBefore:function(x,v,T,N){N=N||d.languages;var A=N[x],D={};for(var z in A)if(A.hasOwnProperty(z)){if(z==v)for(var L in T)T.hasOwnProperty(L)&&(D[L]=T[L]);T.hasOwnProperty(z)||(D[z]=A[z])}var Q=N[x];return N[x]=D,d.languages.DFS(d.languages,function(Y,ce){ce===Q&&Y!=x&&(this[Y]=D)}),D},DFS:function x(v,T,N,A){A=A||{};var D=d.util.objId;for(var z in v)if(v.hasOwnProperty(z)){T.call(v,z,v[z],N||z);var L=v[z],Q=d.util.type(L);Q==="Object"&&!A[D(L)]?(A[D(L)]=!0,x(L,T,null,A)):Q==="Array"&&!A[D(L)]&&(A[D(L)]=!0,x(L,T,z,A))}}},plugins:{},highlight:function(x,v,T){var N={code:x,grammar:v,language:T};if(d.hooks.run("before-tokenize",N),!N.grammar)throw new Error('The language "'+N.language+'" has no grammar.');return N.tokens=d.tokenize(N.code,N.grammar),d.hooks.run("after-tokenize",N),p.stringify(d.util.encode(N.tokens),N.language)},tokenize:function(x,v){var T=v.rest;if(T){for(var N in T)v[N]=T[N];delete v.rest}var A=new S;return y(A,A.head,x),m(x,A,v,A.head,0),_(A)},hooks:{all:{},add:function(x,v){var T=d.hooks.all;T[x]=T[x]||[],T[x].push(v)},run:function(x,v){var T=d.hooks.all[x];if(!(!T||!T.length))for(var N=0,A;A=T[N++];)A(v)}},Token:p};function p(x,v,T,N){this.type=x,this.content=v,this.alias=T,this.length=(N||"").length|0}p.stringify=function x(v,T){if(typeof v=="string")return v;if(Array.isArray(v)){var N="";return v.forEach(function(Q){N+=x(Q,T)}),N}var A={type:v.type,content:x(v.content,T),tag:"span",classes:["token",v.type],attributes:{},language:T},D=v.alias;D&&(Array.isArray(D)?Array.prototype.push.apply(A.classes,D):A.classes.push(D)),d.hooks.run("wrap",A);var z="";for(var L in A.attributes)z+=" "+L+'="'+(A.attributes[L]||"").replace(/"/g,"&quot;")+'"';return"<"+A.tag+' class="'+A.classes.join(" ")+'"'+z+">"+A.content+"</"+A.tag+">"};function b(x,v,T,N){x.lastIndex=v;var A=x.exec(T);if(A&&N&&A[1]){var D=A[1].length;A.index+=D,A[0]=A[0].slice(D)}return A}function m(x,v,T,N,A,D){for(var z in T)if(!(!T.hasOwnProperty(z)||!T[z])){var L=T[z];L=Array.isArray(L)?L:[L];for(var Q=0;Q<L.length;++Q){if(D&&D.cause==z+","+Q)return;var Y=L[Q],ce=Y.inside,ee=!!Y.lookbehind,oe=!!Y.greedy,le=Y.alias;if(oe&&!Y.pattern.global){var P=Y.pattern.toString().match(/[imsuy]*$/)[0];Y.pattern=RegExp(Y.pattern.source,P+"g")}for(var se=Y.pattern||Y,F=N.next,ae=A;F!==v.tail&&!(D&&ae>=D.reach);ae+=F.value.length,F=F.next){var E=F.value;if(v.length>x.length)return;if(!(E instanceof p)){var M=1,k;if(oe){if(k=b(se,ae,x,ee),!k||k.index>=x.length)break;var U=k.index,I=k.index+k[0].length,$=ae;for($+=F.value.length;U>=$;)F=F.next,$+=F.value.length;if($-=F.value.length,ae=$,F.value instanceof p)continue;for(var j=F;j!==v.tail&&($<I||typeof j.value=="string");j=j.next)M++,$+=j.value.length;M--,E=x.slice(ae,$),k.index-=ae}else if(k=b(se,0,E,ee),!k)continue;var U=k.index,X=k[0],re=E.slice(0,U),ie=E.slice(U+X.length),fe=ae+E.length;D&&fe>D.reach&&(D.reach=fe);var ue=F.prev;re&&(ue=y(v,ue,re),ae+=re.length),C(v,ue,M);var ge=new p(z,ce?d.tokenize(X,ce):X,le,X);if(F=y(v,ue,ge),ie&&y(v,F,ie),M>1){var de={cause:z+","+Q,reach:fe};m(x,v,T,F.prev,ae,de),D&&de.reach>D.reach&&(D.reach=de.reach)}}}}}}function S(){var x={value:null,prev:null,next:null},v={value:null,prev:x,next:null};x.next=v,this.head=x,this.tail=v,this.length=0}function y(x,v,T){var N=v.next,A={value:T,prev:v,next:N};return v.next=A,N.prev=A,x.length++,A}function C(x,v,T){for(var N=v.next,A=0;A<T&&N!==x.tail;A++)N=N.next;v.next=N,N.prev=v,x.length-=A}function _(x){for(var v=[],T=x.head.next;T!==x.tail;)v.push(T.value),T=T.next;return v}return d})();r.exports=s,s.default=s}}),W=s1(u1());W.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},W.languages.markup.tag.inside["attr-value"].inside.entity=W.languages.markup.entity,W.languages.markup.doctype.inside["internal-subset"].inside=W.languages.markup,W.hooks.add("wrap",function(a){a.type==="entity"&&(a.attributes.title=a.content.replace(/&amp;/,"&"))}),Object.defineProperty(W.languages.markup.tag,"addInlined",{value:function(a,o){var s={},s=(s["language-"+o]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:W.languages[o]},s.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}}),o=(s["language-"+o]={pattern:/[\s\S]+/,inside:W.languages[o]},{});o[a]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return a}),"i"),lookbehind:!0,greedy:!0,inside:s},W.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(W.languages.markup.tag,"addAttribute",{value:function(a,r){W.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+a+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[r,"language-"+r],inside:W.languages[r]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),W.languages.html=W.languages.markup,W.languages.mathml=W.languages.markup,W.languages.svg=W.languages.markup,W.languages.xml=W.languages.extend("markup",{}),W.languages.ssml=W.languages.xml,W.languages.atom=W.languages.xml,W.languages.rss=W.languages.xml,(function(a){var r={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},s=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,o="(?:[^\\\\-]|"+s.source+")",o=RegExp(o+"-"+o),c={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};a.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:s,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":r,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:s}},"special-escape":r,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":c}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:s,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":c}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(W),W.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},W.languages.javascript=W.languages.extend("clike",{"class-name":[W.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),W.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,W.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:W.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:W.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:W.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:W.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:W.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),W.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:W.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),W.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),W.languages.markup&&(W.languages.markup.tag.addInlined("script","javascript"),W.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),W.languages.js=W.languages.javascript,W.languages.actionscript=W.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),W.languages.actionscript["class-name"].alias="function",delete W.languages.actionscript.parameter,delete W.languages.actionscript["literal-property"],W.languages.markup&&W.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:W.languages.markup}}),(function(a){var r=/#(?!\{).+/,s={pattern:/#\{[^}]+\}/,alias:"variable"};a.languages.coffeescript=a.languages.extend("javascript",{comment:r,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:s}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),a.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:r,interpolation:s}}}),a.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:a.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:s}}]}),a.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete a.languages.coffeescript["template-string"],a.languages.coffee=a.languages.coffeescript})(W),(function(a){var r=a.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(r,"addSupport",{value:function(s,o){(s=typeof s=="string"?[s]:s).forEach(function(c){var f=function(y){y.inside||(y.inside={}),y.inside.rest=o},d="doc-comment";if(p=a.languages[c]){var p,b=p[d];if((b=b||(p=a.languages.insertBefore(c,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[d])instanceof RegExp&&(b=p[d]={pattern:b}),Array.isArray(b))for(var m=0,S=b.length;m<S;m++)b[m]instanceof RegExp&&(b[m]={pattern:b[m]}),f(b[m]);else f(b)}})}}),r.addSupport(["java","javascript","php"],r)})(W),(function(a){var r=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,r=(a.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+r.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+r.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+r.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+r.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:r,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},a.languages.css.atrule.inside.rest=a.languages.css,a.languages.markup);r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(W),(function(a){var r=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,r=(a.languages.css.selector={pattern:a.languages.css.selector.pattern,lookbehind:!0,inside:r={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+r.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[r,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},a.languages.css.atrule.inside["selector-function-argument"].inside=r,a.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),s={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};a.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:s,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:s})})(W),(function(a){var r=/[*&][^\s[\]{},]+/,s=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,o="(?:"+s.source+"(?:[ ]+"+r.source+")?|"+r.source+"(?:[ ]+"+s.source+")?)",c=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),f=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function d(p,b){b=(b||"").replace(/m/g,"")+"m";var m=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return o}).replace(/<<value>>/g,function(){return p});return RegExp(m,b)}a.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return o})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return o}).replace(/<<key>>/g,function(){return"(?:"+c+"|"+f+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:d(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:d(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:d(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:d(f),lookbehind:!0,greedy:!0},number:{pattern:d(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:s,important:r,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},a.languages.yml=a.languages.yaml})(W),(function(a){var r=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function s(m){return m=m.replace(/<inner>/g,function(){return r}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+m+")")}var o=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,c=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return o}),f=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,d=(a.languages.markdown=a.languages.extend("markup",{}),a.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:a.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+c+f+"(?:"+c+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+c+f+")(?:"+c+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(o),inside:a.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+c+")"+f+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+c+"$"),inside:{"table-header":{pattern:RegExp(o),alias:"important",inside:a.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:s(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:s(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:s(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:s(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(m){["url","bold","italic","strike","code-snippet"].forEach(function(S){m!==S&&(a.languages.markdown[m].inside.content.inside[S]=a.languages.markdown[S])})}),a.hooks.add("after-tokenize",function(m){m.language!=="markdown"&&m.language!=="md"||(function S(y){if(y&&typeof y!="string")for(var C=0,_=y.length;C<_;C++){var x,v=y[C];v.type!=="code"?S(v.content):(x=v.content[1],v=v.content[3],x&&v&&x.type==="code-language"&&v.type==="code-block"&&typeof x.content=="string"&&(x=x.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),x="language-"+(x=(/[a-z][\w-]*/i.exec(x)||[""])[0].toLowerCase()),v.alias?typeof v.alias=="string"?v.alias=[v.alias,x]:v.alias.push(x):v.alias=[x]))}})(m.tokens)}),a.hooks.add("wrap",function(m){if(m.type==="code-block"){for(var S="",y=0,C=m.classes.length;y<C;y++){var _=m.classes[y],_=/language-(.+)/.exec(_);if(_){S=_[1];break}}var x,v=a.languages[S];v?m.content=a.highlight((function(T){return T=T.replace(d,""),T=T.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(N,A){var D;return(A=A.toLowerCase())[0]==="#"?(D=A[1]==="x"?parseInt(A.slice(2),16):Number(A.slice(1)),b(D)):p[A]||N})})(m.content),v,S):S&&S!=="none"&&a.plugins.autoloader&&(x="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),m.attributes.id=x,a.plugins.autoloader.loadLanguages(S,function(){var T=document.getElementById(x);T&&(T.innerHTML=a.highlight(T.textContent,a.languages[S],S))}))}}),RegExp(a.languages.markup.tag.pattern.source,"gi")),p={amp:"&",lt:"<",gt:">",quot:'"'},b=String.fromCodePoint||String.fromCharCode;a.languages.md=a.languages.markdown})(W),W.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:W.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},W.hooks.add("after-tokenize",function(a){if(a.language==="graphql")for(var r=a.tokens.filter(function(x){return typeof x!="string"&&x.type!=="comment"&&x.type!=="scalar"}),s=0;s<r.length;){var o=r[s++];if(o.type==="keyword"&&o.content==="mutation"){var c=[];if(y(["definition-mutation","punctuation"])&&S(1).content==="("){s+=2;var f=C(/^\($/,/^\)$/);if(f===-1)continue;for(;s<f;s++){var d=S(0);d.type==="variable"&&(_(d,"variable-input"),c.push(d.content))}s=f+1}if(y(["punctuation","property-query"])&&S(0).content==="{"&&(s++,_(S(0),"property-mutation"),0<c.length)){var p=C(/^\{$/,/^\}$/);if(p!==-1)for(var b=s;b<p;b++){var m=r[b];m.type==="variable"&&0<=c.indexOf(m.content)&&_(m,"variable-input")}}}}function S(x){return r[s+x]}function y(x,v){v=v||0;for(var T=0;T<x.length;T++){var N=S(T+v);if(!N||N.type!==x[T])return}return 1}function C(x,v){for(var T=1,N=s;N<r.length;N++){var A=r[N],D=A.content;if(A.type==="punctuation"&&typeof D=="string"){if(x.test(D))T++;else if(v.test(D)&&--T===0)return N}}return-1}function _(x,v){var T=x.alias;T?Array.isArray(T)||(x.alias=T=[T]):x.alias=T=[],T.push(v)}}),W.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(a){var r=a.languages.javascript["template-string"],s=r.pattern.source,o=r.inside.interpolation,c=o.inside["interpolation-punctuation"],f=o.pattern.source;function d(y,C){if(a.languages[y])return{pattern:RegExp("((?:"+C+")\\s*)"+s),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:y}}}}function p(y,C,_){return y={code:y,grammar:C,language:_},a.hooks.run("before-tokenize",y),y.tokens=a.tokenize(y.code,y.grammar),a.hooks.run("after-tokenize",y),y.tokens}function b(y,C,_){var T=a.tokenize(y,{interpolation:{pattern:RegExp(f),lookbehind:!0}}),x=0,v={},T=p(T.map(function(A){if(typeof A=="string")return A;for(var D,z,A=A.content;y.indexOf((z=x++,D="___"+_.toUpperCase()+"_"+z+"___"))!==-1;);return v[D]=A,D}).join(""),C,_),N=Object.keys(v);return x=0,(function A(D){for(var z=0;z<D.length;z++){if(x>=N.length)return;var L,Q,Y,ce,ee,oe,le,P=D[z];typeof P=="string"||typeof P.content=="string"?(L=N[x],(le=(oe=typeof P=="string"?P:P.content).indexOf(L))!==-1&&(++x,Q=oe.substring(0,le),ee=v[L],Y=void 0,(ce={})["interpolation-punctuation"]=c,(ce=a.tokenize(ee,ce)).length===3&&((Y=[1,1]).push.apply(Y,p(ce[1],a.languages.javascript,"javascript")),ce.splice.apply(ce,Y)),Y=new a.Token("interpolation",ce,o.alias,ee),ce=oe.substring(le+L.length),ee=[],Q&&ee.push(Q),ee.push(Y),ce&&(A(oe=[ce]),ee.push.apply(ee,oe)),typeof P=="string"?(D.splice.apply(D,[z,1].concat(ee)),z+=ee.length-1):P.content=ee)):(le=P.content,Array.isArray(le)?A(le):A([le]))}})(T),new a.Token(_,T,"language-"+_,y)}a.languages.javascript["template-string"]=[d("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),d("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),d("svg",/\bsvg/.source),d("markdown",/\b(?:markdown|md)/.source),d("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),d("sql",/\bsql/.source),r].filter(Boolean);var m={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function S(y){return typeof y=="string"?y:Array.isArray(y)?y.map(S).join(""):S(y.content)}a.hooks.add("after-tokenize",function(y){y.language in m&&(function C(_){for(var x=0,v=_.length;x<v;x++){var T,N,A,D=_[x];typeof D!="string"&&(T=D.content,Array.isArray(T)?D.type==="template-string"?(D=T[1],T.length===3&&typeof D!="string"&&D.type==="embedded-code"&&(N=S(D),D=D.alias,D=Array.isArray(D)?D[0]:D,A=a.languages[D])&&(T[1]=b(N,A,D))):C(T):typeof T!="string"&&C([T]))}})(y.tokens)})})(W),(function(a){a.languages.typescript=a.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),a.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete a.languages.typescript.parameter,delete a.languages.typescript["literal-property"];var r=a.languages.extend("typescript",{});delete r["class-name"],a.languages.typescript["class-name"].inside=r,a.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:r}}}}),a.languages.ts=a.languages.typescript})(W),(function(a){var r=a.languages.javascript,s=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,o="(@(?:arg|argument|param|property)\\s+(?:"+s+"\\s+)?)";a.languages.jsdoc=a.languages.extend("javadoclike",{parameter:{pattern:RegExp(o+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),a.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(o+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:r,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return s})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+s),lookbehind:!0,inside:{string:r.string,number:r.number,boolean:r.boolean,keyword:a.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:r,alias:"language-javascript"}}}}),a.languages.javadoclike.addSupport("javascript",a.languages.jsdoc)})(W),(function(a){a.languages.flow=a.languages.extend("javascript",{}),a.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),a.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete a.languages.flow.parameter,a.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(a.languages.flow.keyword)||(a.languages.flow.keyword=[a.languages.flow.keyword]),a.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(W),W.languages.n4js=W.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),W.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),W.languages.n4jsd=W.languages.n4js,(function(a){function r(d,p){return RegExp(d.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),p)}a.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+a.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),a.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+a.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),a.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),a.languages.insertBefore("javascript","keyword",{imports:{pattern:r(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:a.languages.javascript},exports:{pattern:r(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:a.languages.javascript}}),a.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),a.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),a.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:r(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var s=["function","function-variable","method","method-variable","property-access"],o=0;o<s.length;o++){var f=s[o],c=a.languages.javascript[f],f=(c=a.util.type(c)==="RegExp"?a.languages.javascript[f]={pattern:c}:c).inside||{};(c.inside=f)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(W),(function(a){var r=a.util.clone(a.languages.javascript),s=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,o=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,c=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function f(b,m){return b=b.replace(/<S>/g,function(){return s}).replace(/<BRACES>/g,function(){return o}).replace(/<SPREAD>/g,function(){return c}),RegExp(b,m)}c=f(c).source,a.languages.jsx=a.languages.extend("markup",r),a.languages.jsx.tag.pattern=f(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),a.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,a.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,a.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,a.languages.jsx.tag.inside.comment=r.comment,a.languages.insertBefore("inside","attr-name",{spread:{pattern:f(/<SPREAD>/.source),inside:a.languages.jsx}},a.languages.jsx.tag),a.languages.insertBefore("inside","special-attr",{script:{pattern:f(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:a.languages.jsx}}},a.languages.jsx.tag);function d(b){for(var m=[],S=0;S<b.length;S++){var y=b[S],C=!1;typeof y!="string"&&(y.type==="tag"&&y.content[0]&&y.content[0].type==="tag"?y.content[0].content[0].content==="</"?0<m.length&&m[m.length-1].tagName===p(y.content[0].content[1])&&m.pop():y.content[y.content.length-1].content!=="/>"&&m.push({tagName:p(y.content[0].content[1]),openedBraces:0}):0<m.length&&y.type==="punctuation"&&y.content==="{"?m[m.length-1].openedBraces++:0<m.length&&0<m[m.length-1].openedBraces&&y.type==="punctuation"&&y.content==="}"?m[m.length-1].openedBraces--:C=!0),(C||typeof y=="string")&&0<m.length&&m[m.length-1].openedBraces===0&&(C=p(y),S<b.length-1&&(typeof b[S+1]=="string"||b[S+1].type==="plain-text")&&(C+=p(b[S+1]),b.splice(S+1,1)),0<S&&(typeof b[S-1]=="string"||b[S-1].type==="plain-text")&&(C=p(b[S-1])+C,b.splice(S-1,1),S--),b[S]=new a.Token("plain-text",C,null,C)),y.content&&typeof y.content!="string"&&d(y.content)}}var p=function(b){return b?typeof b=="string"?b:typeof b.content=="string"?b.content:b.content.map(p).join(""):""};a.hooks.add("after-tokenize",function(b){b.language!=="jsx"&&b.language!=="tsx"||d(b.tokens)})})(W),(function(a){var r=a.util.clone(a.languages.typescript),r=(a.languages.tsx=a.languages.extend("jsx",r),delete a.languages.tsx.parameter,delete a.languages.tsx["literal-property"],a.languages.tsx.tag);r.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+r.pattern.source+")",r.pattern.flags),r.lookbehind=!0})(W),W.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},W.languages.swift["string-literal"].forEach(function(a){a.inside.interpolation.inside=W.languages.swift}),(function(a){a.languages.kotlin=a.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete a.languages.kotlin["class-name"];var r={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:a.languages.kotlin}};a.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:r},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:r},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete a.languages.kotlin.string,a.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),a.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),a.languages.kt=a.languages.kotlin,a.languages.kts=a.languages.kotlin})(W),W.languages.c=W.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),W.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),W.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},W.languages.c.string],char:W.languages.c.char,comment:W.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:W.languages.c}}}}),W.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete W.languages.c.boolean,W.languages.objectivec=W.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete W.languages.objectivec["class-name"],W.languages.objc=W.languages.objectivec,W.languages.reason=W.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),W.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete W.languages.reason.function,(function(a){for(var r=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,s=0;s<2;s++)r=r.replace(/<self>/g,function(){return r});r=r.replace(/<self>/g,function(){return/[^\s\S]/.source}),a.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+r),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},a.languages.rust["closure-params"].inside.rest=a.languages.rust,a.languages.rust.attribute.inside.string=a.languages.rust.string})(W),W.languages.go=W.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),W.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete W.languages.go["class-name"],(function(a){var r=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,s=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return r.source});a.languages.cpp=a.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return r.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:r,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),a.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return s})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),a.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:a.languages.cpp}}}}),a.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),a.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:a.languages.extend("cpp",{})}}),a.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},a.languages.cpp["base-clause"])})(W),W.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},W.languages.python["string-interpolation"].inside.interpolation.inside.rest=W.languages.python,W.languages.py=W.languages.python,W.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},W.languages.webmanifest=W.languages.json;var Qt={};i1(Qt,{dracula:()=>f1,duotoneDark:()=>g1,duotoneLight:()=>m1,github:()=>b1,gruvboxMaterialDark:()=>Z1,gruvboxMaterialLight:()=>$1,jettwaveDark:()=>U1,jettwaveLight:()=>F1,nightOwl:()=>v1,nightOwlLight:()=>S1,oceanicNext:()=>w1,okaidia:()=>A1,oneDark:()=>G1,oneLight:()=>V1,palenight:()=>T1,shadesOfPurple:()=>_1,synthwave84:()=>O1,ultramin:()=>D1,vsDark:()=>Np,vsLight:()=>L1});var c1={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},f1=c1,d1={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},g1=d1,h1={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},m1=h1,p1={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},b1=p1,y1={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},v1=y1,x1={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},S1=x1,$t={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},E1={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:$t.keyword}},{types:["attr-value"],style:{color:$t.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:$t.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:$t.primitive}},{types:["boolean"],style:{color:$t.boolean}},{types:["tag"],style:{color:$t.tag}},{types:["string"],style:{color:$t.string}},{types:["punctuation"],style:{color:$t.string}},{types:["selector","char","builtin","inserted"],style:{color:$t.char}},{types:["function"],style:{color:$t.function}},{types:["operator","entity","url","variable"],style:{color:$t.variable}},{types:["keyword"],style:{color:$t.keyword}},{types:["atrule","class-name"],style:{color:$t.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},w1=E1,N1={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},A1=N1,C1={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},T1=C1,R1={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},_1=R1,j1={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},O1=j1,k1={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},D1=k1,M1={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},Np=M1,z1={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},L1=z1,B1={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},U1=B1,H1={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},F1=H1,q1={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},G1=q1,Y1={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},V1=Y1,X1={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},Z1=X1,I1={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},$1=I1,Q1=a=>R.useCallback(r=>{var s=r,{className:o,style:c,line:f}=s,d=wp(s,["className","style","line"]);const p=Ro(vn({},d),{className:xp("token-line",o)});return typeof a=="object"&&"plain"in a&&(p.style=a.plain),typeof c=="object"&&(p.style=vn(vn({},p.style||{}),c)),p},[a]),K1=a=>{const r=R.useCallback(({types:s,empty:o})=>{if(a!=null){{if(s.length===1&&s[0]==="plain")return o!=null?{display:"inline-block"}:void 0;if(s.length===1&&o!=null)return a[s[0]]}return Object.assign(o!=null?{display:"inline-block"}:{},...s.map(c=>a[c]))}},[a]);return R.useCallback(s=>{var o=s,{token:c,className:f,style:d}=o,p=wp(o,["token","className","style"]);const b=Ro(vn({},p),{className:xp("token",...c.types,f),children:c.content,style:r(c)});return d!=null&&(b.style=vn(vn({},b.style||{}),d)),b},[r])},J1=/\r\n|\r|\n/,am=a=>{a.length===0?a.push({types:["plain"],content:`
13
13
  `,empty:!0}):a.length===1&&a[0].content===""&&(a[0].content=`
14
- `,a[0].empty=!0)},rm=(a,r)=>{const s=a.length;return s>0&&a[s-1]===r?a:a.concat(r)},W1=a=>{const r=[[]],s=[a],o=[0],c=[a.length];let f=0,d=0,p=[];const b=[p];for(;d>-1;){for(;(f=o[d]++)<c[d];){let m,S=r[d];const C=s[d][f];if(typeof C=="string"?(S=d>0?S:["plain"],m=C):(S=rm(S,C.type),C.alias&&(S=rm(S,C.alias)),m=C.content),typeof m!="string"){d++,r.push(S),s.push(m),o.push(0),c.push(m.length);continue}const _=m.split(J1),x=_.length;p.push({types:S,content:_[0]});for(let v=1;v<x;v++)am(p),b.push(p=[]),p.push({types:S,content:_[v]})}d--,r.pop(),s.pop(),o.pop(),c.pop()}return am(p),b},im=W1,P1=({prism:a,code:r,grammar:s,language:o})=>R.useMemo(()=>{if(s==null)return im([r]);const c={code:r,grammar:s,language:o,tokens:[]};return a.hooks.run("before-tokenize",c),c.tokens=a.tokenize(r,s),a.hooks.run("after-tokenize",c),im(c.tokens)},[r,s,o,a]),ex=(a,r)=>{const{plain:s}=a,o=a.styles.reduce((c,f)=>{const{languages:d,style:p}=f;return d&&!d.includes(r)||f.types.forEach(b=>{const m=vn(vn({},c[b]),p);c[b]=m}),c},{});return o.root=s,o.plain=Ro(vn({},s),{backgroundColor:void 0}),o},tx=ex,nx=({children:a,language:r,code:s,theme:o,prism:c})=>{const f=r.toLowerCase(),d=tx(o,f),p=Q1(d),b=K1(d),m=c.languages[f],S=P1({prism:c,language:f,code:s,grammar:m});return a({tokens:S,className:`prism-code language-${f}`,style:d!=null?d.root:{},getLineProps:p,getTokenProps:b})},lx=a=>R.createElement(nx,Ro(vn({},a),{prism:a.prism||W,theme:a.theme||Np,code:a.code,language:a.language}));const ax="modulepreload",rx=function(a){return"/"+a},om={},At=function(r,s,o){let c=Promise.resolve();if(s&&s.length>0){let b=function(m){return Promise.all(m.map(S=>Promise.resolve(S).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),p=d?.nonce||d?.getAttribute("nonce");c=b(s.map(m=>{if(m=rx(m),m in om)return;om[m]=!0;const S=m.endsWith(".css"),y=S?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${y}`))return;const C=document.createElement("link");if(C.rel=S?"stylesheet":ax,S||(C.as="script"),C.crossOrigin="",C.href=m,p&&C.setAttribute("nonce",p),document.head.appendChild(C),S)return new Promise((_,x)=>{C.addEventListener("load",_),C.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${m}`)))})}))}function f(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return c.then(d=>{for(const p of d||[])p.status==="rejected"&&f(p.reason);return r().catch(f)})},ro={};function Ap(a){if(!ro[a]){const s={bash:()=>At(()=>import("./prism-bash-DTkDXsAh.js"),[]),sh:()=>At(()=>import("./prism-bash-DTkDXsAh.js"),[]),shell:()=>At(()=>import("./prism-bash-DTkDXsAh.js"),[]),php:async()=>(await At(()=>import("./prism-markup-templating-Ct1xsyfA.js"),[]),At(()=>import("./prism-php-CU6Zo_1W.js").then(o=>o.p),[])),sql:()=>At(()=>import("./prism-sql-AgAyy5H_.js"),[]),ruby:()=>At(()=>import("./prism-ruby-BU9Ro5cR.js").then(o=>o.p),[]),java:()=>At(()=>import("./prism-java-Blsgme8U.js").then(o=>o.p),[]),scala:async()=>(await Ap("java"),At(()=>import("./prism-scala-BjNo2HkN.js"),[])),solidity:()=>At(()=>import("./prism-solidity-ChlixQd2.js").then(o=>o.p),[]),vim:()=>At(()=>import("./prism-vim-uciLQ2PQ.js"),[]),dart:()=>At(()=>import("./prism-dart-MjriiaMt.js"),[]),csharp:()=>At(()=>import("./prism-csharp-MxIkBOuT.js").then(o=>o.p),[]),protobuf:()=>At(()=>import("./prism-protobuf-DiQ_z8B5.js"),[]),hcl:()=>At(()=>import("./prism-hcl-a0Z8Hwk2.js").then(o=>o.p),[])}[a];if(!s)return console.warn(`No loader available for language: ${a}`),Promise.reject(new Error(`Unsupported language: ${a}`));ro[a]=s().then(()=>{}).catch(o=>{throw delete ro[a],console.warn(`Failed to load language: ${a}`,o),o})}return ro[a]}typeof global<"u"?global.Prism=W:typeof window<"u"&&(window.Prism=W);const sm=["markup","html","xml","svg","javascript","js","typescript","ts","jsx","tsx","css","c","cpp","swift","kotlin","objectivec","reason","rust","go","graphql","yaml","yml","json","markdown","md","python","py"];function ix(a,r){const[s,o]=R.useState(()=>sm.includes(r)||!!W.languages[r]);return R.useEffect(()=>{if(!s){if(sm.includes(r)){o(!0);return}Ap(r).then(()=>{o(!0)}).catch(()=>{o(!1)})}},[r,s]),{ready:s,actualLang:s?r:"text"}}const um=[{id:"github",label:"GitHub Light"},{id:"vsLight",label:"VS Light"},{id:"oneLight",label:"One Light"},{id:"gruvboxMaterialLight",label:"Gruvbox Material Light"},{id:"nightOwlLight",label:"Night Owl Light"}],cm=[{id:"vsDark",label:"VS Dark"},{id:"oneDark",label:"One Dark"},{id:"gruvboxMaterialDark",label:"Gruvbox Material Dark"},{id:"nightOwl",label:"Night Owl"},{id:"dracula",label:"Dracula"},{id:"okaidia",label:"Okaidia"}];function ox(a){return{...a,styles:a.styles.map(r=>({...r,style:{...r.style,background:void 0,backgroundColor:void 0}}))}}function sx(a){let r;switch(a){case"github":r=Qt.github;break;case"vsLight":r=Qt.vsLight;break;case"oneLight":r=Qt.oneLight;break;case"gruvboxMaterialLight":r=Qt.gruvboxMaterialLight;break;case"nightOwlLight":r=Qt.nightOwlLight;break;case"vsDark":r=Qt.vsDark;break;case"oneDark":r=Qt.oneDark;break;case"gruvboxMaterialDark":r=Qt.gruvboxMaterialDark;break;case"nightOwl":r=Qt.nightOwl;break;case"dracula":r=Qt.dracula;break;case"okaidia":r=Qt.okaidia;break;default:r=Qt.vsDark}return ox(r)}function ux(a){const r=Fv(a).toLowerCase(),s=gp(a),o={dockerfile:"docker",makefile:"makefile",".gitignore":"git",".env":"bash",".bashrc":"bash",".zshrc":"bash",".bash_profile":"bash",".profile":"bash"};return o[r]?o[r]:{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",json:"json",css:"css",scss:"css",html:"html",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",yml:"yaml",yaml:"yaml",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",php:"php",sql:"sql",xml:"xml",swift:"swift",kt:"kotlin",scala:"scala",svelte:"svelte",r:"r",lua:"lua",perl:"perl",dockerfile:"docker",makefile:"makefile",gitignore:"git",env:"bash",conf:"nginx",ini:"ini",toml:"toml",sol:"solidity",vim:"vim",dart:"dart",cs:"csharp",proto:"protobuf",tf:"hcl",tfvars:"hcl",hcl:"hcl"}[s||""]||"text"}const cx=Vn.memo(function({code:r,language:s,className:o,syntaxTheme:c="vsDark",filename:f="",renderToken:d,onMouseOver:p,onMouseOut:b}){const m=s||(f?ux(f):"text"),{actualLang:S}=ix(r,m),y=sx(c),C=R.useCallback(({style:_,tokens:x,getLineProps:v,getTokenProps:T})=>h.jsx("span",{className:o,style:{..._,background:"transparent",backgroundColor:"transparent"},onMouseOver:p,onMouseOut:b,children:x.map((N,A)=>h.jsx("span",{...v({line:N}),children:N.map((D,z)=>d?d(D,z,T):h.jsx("span",{...T({token:D})},z))},A))}),[o,p,b,d]);return h.jsx(lx,{code:r,language:S,theme:y,prism:W,children:C})}),xc=Vn.memo(function(r){const{handleMouseOver:s,handleMouseOut:o,isWordHighlighted:c}=Pv(),f=R.useCallback((d,p,b)=>{const m=b({token:d}),S=d.content.split(/( +)/);if(S.length===1&&S[0]&&!nm(S[0]))return h.jsx("span",{...m},p);const y=S.map((C,_)=>{if(!C)return null;if(nm(C)){const x=C.trim(),v=c(x);return h.jsx("span",{className:`word-token ${v?"word-highlight":""}`,"data-word":x,children:C},`${p}-${_}`)}return h.jsx("span",{children:C},`${p}-${_}`)});return h.jsx("span",{...m,children:y},p)},[c]);return h.jsx(cx,{...r,renderToken:f,onMouseOver:s,onMouseOut:o})}),Sc=Vn.memo(function({segments:r,className:s=""}){const o=R.useMemo(()=>r.map((c,f)=>{const d=c.type==="added"?"word-diff-added":c.type==="removed"?"word-diff-removed":"";return h.jsx("span",{className:d,children:c.value},f)}),[r]);return h.jsx("span",{className:s,children:o})}),fx=a=>{switch(a.type){case"add":return"bg-diff-addition-bg";case"delete":return"bg-diff-deletion-bg";default:return"bg-transparent"}},dx=a=>{switch(a.type){case"add":return"+";case"delete":return"-";default:return" "}},Cp=Vn.memo(({line:a,index:r,lineId:s,isCurrentLine:o=!1,hoveredLineIndex:c,selectedLineStyle:f,onMouseEnter:d,onMouseLeave:p,onMouseMove:b,onCommentButtonMouseDown:m,onCommentButtonMouseUp:S,syntaxTheme:y,onClick:C,filename:_,diffSegments:x})=>{const v=a.newLineNumber||a.oldLineNumber,T=c===r&&v,N=o?"keyboard-cursor":"";return h.jsxs("tr",{id:s,className:`group ${fx(a)} relative ${f} ${N} cursor-pointer`,onMouseEnter:d,onMouseLeave:p,onMouseMove:b,onClick:C,children:[h.jsx("td",{className:"w-[50px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top relative",children:a.oldLineNumber||""}),h.jsxs("td",{className:"w-[50px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top relative overflow-visible",children:[h.jsx("span",{className:"pr-5",children:a.newLineNumber||""}),T&&h.jsx(fo,{onMouseDown:m,onMouseUp:S})]}),h.jsx("td",{className:"p-0 w-full relative align-top",children:h.jsxs("div",{className:"flex items-center relative min-h-[16px]",children:[h.jsx("span",{className:`w-5 text-center text-github-text-muted flex-shrink-0 bg-github-bg-secondary border-r border-github-border ${a.type==="add"?"text-github-accent bg-diff-addition-bg":a.type==="delete"?"text-github-danger bg-diff-deletion-bg":""}`,children:dx(a)}),x?h.jsx(Sc,{segments:x,className:"flex-1 px-3 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word select-text"}):h.jsx(xc,{code:a.content,className:"flex-1 px-3 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word select-text [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit",syntaxTheme:y,filename:_})]})})]})});Cp.displayName="DiffLineRow";function gx({chunk:a,chunkIndex:r,comments:s,onAddComment:o,onGeneratePrompt:c,onRemoveComment:f,onUpdateComment:d,syntaxTheme:p,cursor:b=null,fileIndex:m=0,onLineClick:S,commentTrigger:y,onCommentTriggerHandled:C,filename:_}){const[x,v]=R.useState(null),[T,N]=R.useState(null),[A,D]=R.useState(!1),[z,L]=R.useState(null),[Q,Y]=R.useState(null);R.useEffect(()=>{if(y?.lineIndex!==void 0){const E=a.lines[y.lineIndex];if(E&&E.type!=="delete"){const M=E.newLineNumber;M&&(L({side:"new",lineNumber:M}),C?.())}}},[y,a.lines,C]),R.useEffect(()=>{if(A){const E=()=>{D(!1),v(null),N(null)};return document.addEventListener("mouseup",E),()=>{document.removeEventListener("mouseup",E)}}},[A]);const ce=R.useCallback((E,M)=>{z?.side===E&&z?.lineNumber===M?L(null):L({side:E,lineNumber:M})},[z]),ee=R.useCallback(()=>{L(null)},[]),oe=R.useCallback(async E=>{z!==null&&(await o(z.lineNumber,E,void 0,z.side),L(null))},[z,o]),le=(E,M)=>s.filter(k=>{const I=Array.isArray(k.line)?k.line[1]===E:k.line===E,$=!k.side||k.side===M;return I&&$}),P=E=>E.oldLine?.type==="delete"&&E.newLine?.type==="add"?E.newLineNumber?"right":"left":E.oldLine?.type==="delete"?"left":E.newLine?.type==="add"?"right":"full",se=(E,M)=>{const k=E==="old"?M.oldLineNumber:M.newLineNumber;if(!k)return"";if(A&&x&&T&&x.side===E&&T.side===E){const I=Math.min(x.lineNumber,T.lineNumber),$=Math.max(x.lineNumber,T.lineNumber);if(k>=I&&k<=$){let j="after:bg-blue-100 after:absolute after:inset-0 after:opacity-30 after:border-l-4 after:border-blue-500 after:pointer-events-none";return k===I&&(j+=" after:border-t-2"),k===$&&(j+=" after:border-b-2"),j}}if(z&&z.side===E){const I=Array.isArray(z.lineNumber)?z.lineNumber:[z.lineNumber,z.lineNumber],$=I[0],j=I[1];if($!==void 0&&j!==void 0&&k>=$&&k<=j)return"after:bg-diff-selected-bg after:absolute after:inset-0 after:border-l-5 after:border-l-diff-selected-border after:pointer-events-none"}return""},F=R.useCallback(E=>{const M=[];let k=a.oldStart,I=a.newStart,$=0;for(;$<E.length;){const j=E[$];if(!j){$++;continue}if(j.type==="normal")M.push({oldLine:j,newLine:{...j},oldLineNumber:j.oldLineNumber??k,newLineNumber:j.newLineNumber??I,oldLineOriginalIndex:$,newLineOriginalIndex:$}),k++,I++,$++;else if(j.type==="delete"){let U=$+1;for(;U<E.length&&E[U]?.type==="delete";)U++;const X=E.slice($,U),re=$,ie=[],fe=U;for(;U<E.length&&E[U]?.type==="add";){const ge=E[U];ge&&ie.push(ge),U++}const ue=Math.max(X.length,ie.length);for(let ge=0;ge<ue;ge++){const de=X[ge],ye=ie[ge];let Ne;de&&ye&&pp(de.content,ye.content)&&(Ne=mp(de.content,ye.content)),M.push({oldLine:de,newLine:ye,oldLineNumber:de?de.oldLineNumber??k+ge:void 0,newLineNumber:ye?ye.newLineNumber??I+ge:void 0,oldLineOriginalIndex:de?re+ge:void 0,newLineOriginalIndex:ye?fe+ge:void 0,wordLevelDiff:Ne})}k+=X.length,I+=ie.length,$=U}else j.type==="add"&&(M.push({newLine:j,newLineNumber:j.newLineNumber??I,newLineOriginalIndex:$}),I++,$++)}return M},[a.oldStart,a.newStart]),ae=R.useMemo(()=>F(a.lines),[a.lines,F]);return h.jsx("div",{className:"bg-github-bg-primary border border-github-border rounded-md overflow-hidden",children:h.jsx("table",{className:"w-full border-collapse font-mono text-sm leading-5",children:h.jsx("tbody",{children:ae.map((E,M)=>{const k=E.oldLineNumber?le(E.oldLineNumber,"old"):[],I=E.newLineNumber?le(E.newLineNumber,"new"):[],$=[...k,...I],j=E.oldLineOriginalIndex??-1,U=E.newLineOriginalIndex??-1,X=b?b.side==="left"&&j>=0?b.chunkIndex===r&&b.lineIndex===j:b.side==="right"&&U>=0?b.chunkIndex===r&&b.lineIndex===U:!1:!1,re=j>=0?`file-${m}-chunk-${r}-line-${j}-left`:void 0,ie=U>=0?`file-${m}-chunk-${r}-line-${U}-right`:void 0,fe=X&&b?.side==="left",ue=X&&b?.side==="right",ge="keyboard-cursor";return h.jsxs(Vn.Fragment,{children:[h.jsxs("tr",{className:"group cursor-pointer",onClick:de=>{if(!A){const ye=de.target,Ne=ye.closest("td:nth-child(1)")||ye.closest("td:nth-child(2)"),pe=ye.closest("td:nth-child(3)")||ye.closest("td:nth-child(4)");Ne&&j>=0?S?.(m,r,j,"left"):pe&&U>=0&&S?.(m,r,U,"right")}},onMouseEnter:de=>{const ye=de.target,Ne=ye.closest("td:nth-child(1)")||ye.closest("td:nth-child(2)"),pe=ye.closest("td:nth-child(3)")||ye.closest("td:nth-child(4)");Ne&&E.oldLineNumber?Y({side:"old",lineNumber:E.oldLineNumber}):pe&&E.newLineNumber&&Y({side:"new",lineNumber:E.newLineNumber})},onMouseMove:de=>{const ye=de.target,Ne=ye.closest("td:nth-child(1)")||ye.closest("td:nth-child(2)"),pe=ye.closest("td:nth-child(3)")||ye.closest("td:nth-child(4)");Ne&&E.oldLineNumber?(Q?.side!=="old"||Q?.lineNumber!==E.oldLineNumber)&&Y({side:"old",lineNumber:E.oldLineNumber}):pe&&E.newLineNumber&&(Q?.side!=="new"||Q?.lineNumber!==E.newLineNumber)&&Y({side:"new",lineNumber:E.newLineNumber}),A&&x&&(x.side==="old"&&E.oldLineNumber?N({side:"old",lineNumber:E.oldLineNumber}):x.side==="new"&&E.newLineNumber&&N({side:"new",lineNumber:E.newLineNumber}))},onMouseLeave:()=>Y(null),children:[h.jsxs("td",{id:re,className:`w-[60px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top relative overflow-visible ${fe?ge:""}`,children:[h.jsx("span",{className:"pr-5",children:E.oldLineNumber||""}),Q?.side==="old"&&Q?.lineNumber===E.oldLineNumber&&h.jsx(fo,{onMouseDown:de=>{de.stopPropagation(),E.oldLineNumber&&(v({side:"old",lineNumber:E.oldLineNumber}),N({side:"old",lineNumber:E.oldLineNumber}),D(!0))},onMouseUp:de=>{if(de.stopPropagation(),!E.oldLineNumber||!x){D(!1),v(null),N(null);return}const ye=T&&T.side==="old"?T.lineNumber:E.oldLineNumber;if(x.side!=="old"||x.lineNumber===ye)ce("old",E.oldLineNumber);else{const Ne=Math.min(x.lineNumber,ye),pe=Math.max(x.lineNumber,ye);ce("old",[Ne,pe])}D(!1),v(null),N(null)}})]}),h.jsx("td",{className:`w-1/2 p-0 align-top border-r border-github-border relative ${E.oldLine?.type==="delete"?"bg-diff-deletion-bg":E.oldLine?.type==="normal"?"bg-transparent":"bg-github-bg-secondary"} ${se("old",E)} ${fe?ge:""}`,children:E.oldLine&&h.jsx("div",{className:"flex items-center relative min-h-[20px] px-3",children:E.wordLevelDiff?h.jsx(Sc,{segments:E.wordLevelDiff.oldSegments,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word select-text"}):h.jsx(xc,{code:E.oldLine.content,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word select-text [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit",syntaxTheme:p,filename:_})})}),h.jsxs("td",{id:ie,className:`w-[60px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top relative overflow-visible ${ue?ge:""}`,children:[h.jsx("span",{className:"pr-5",children:E.newLineNumber||""}),Q?.side==="new"&&Q?.lineNumber===E.newLineNumber&&h.jsx(fo,{onMouseDown:de=>{de.stopPropagation(),E.newLineNumber&&(v({side:"new",lineNumber:E.newLineNumber}),N({side:"new",lineNumber:E.newLineNumber}),D(!0))},onMouseUp:de=>{if(de.stopPropagation(),!E.newLineNumber||!x){D(!1),v(null),N(null);return}const ye=T&&T.side==="new"?T.lineNumber:E.newLineNumber;if(x.side!=="new"||x.lineNumber===ye)ce("new",E.newLineNumber);else{const Ne=Math.min(x.lineNumber,ye),pe=Math.max(x.lineNumber,ye);ce("new",[Ne,pe])}D(!1),v(null),N(null)}})]}),h.jsx("td",{className:`w-1/2 p-0 align-top relative ${E.newLine?.type==="add"?"bg-diff-addition-bg":E.newLine?.type==="normal"?"bg-transparent":"bg-github-bg-secondary"} ${se("new",E)} ${ue?ge:""}`,children:E.newLine&&h.jsx("div",{className:"flex items-center relative min-h-[20px] px-3",children:E.wordLevelDiff?h.jsx(Sc,{segments:E.wordLevelDiff.newSegments,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word select-text"}):h.jsx(xc,{code:E.newLine.content,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word select-text [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit",syntaxTheme:p,filename:_})})})]}),$.length>0&&h.jsx("tr",{className:"bg-github-bg-secondary",children:h.jsx("td",{colSpan:4,className:"p-0 border-t border-github-border",children:$.map(de=>{const ye=de.side||"new";let Ne;return ye==="old"&&E.oldLineNumber?Ne="left":ye==="new"&&E.newLineNumber?Ne="right":Ne=P(E),h.jsx("div",{className:`flex ${Ne==="left"?"justify-start":Ne==="right"?"justify-end":"justify-center"}`,children:h.jsx("div",{className:`${Ne==="full"?"w-full":"w-1/2"} m-2 mx-4`,children:h.jsx(Dc,{comment:de,onGeneratePrompt:c,onRemoveComment:f,onUpdateComment:d})})},de.id)})})}),z&&(z.side==="old"&&z.lineNumber===E.oldLineNumber||z.side==="new"&&z.lineNumber===E.newLineNumber||Array.isArray(z.lineNumber)&&(z.side==="new"&&z.lineNumber[1]===E.newLineNumber||z.side==="old"&&z.lineNumber[1]===E.oldLineNumber))&&h.jsx("tr",{className:"bg-github-bg-secondary",children:h.jsx("td",{colSpan:4,className:"p-0",children:h.jsx("div",{className:`flex ${z.side==="old"?"justify-start":z.side==="new"?"justify-end":"justify-center"}`,children:h.jsx("div",{className:"w-1/2",children:h.jsx(bp,{onSubmit:oe,onCancel:ee})})})})})]},M)})})})})}function hx({chunk:a,chunkIndex:r,comments:s,onAddComment:o,onGeneratePrompt:c,onRemoveComment:f,onUpdateComment:d,mode:p="inline",syntaxTheme:b,cursor:m=null,fileIndex:S=0,onLineClick:y,commentTrigger:C,onCommentTriggerHandled:_,filename:x}){const[v,T]=R.useState(null),[N,A]=R.useState(null),[D,z]=R.useState(!1),[L,Q]=R.useState(null),[Y,ce]=R.useState(null);R.useEffect(()=>{if(C?.lineIndex!==void 0){const E=a.lines[C.lineIndex];if(E){const M=E.newLineNumber||E.oldLineNumber,k=E.type==="delete"?"old":"new";M&&(Q({side:k,lineNumber:M}),_?.())}}},[C,a.lines,_]),R.useEffect(()=>{if(D){const E=()=>{z(!1),T(null),A(null)};return document.addEventListener("mouseup",E),()=>{document.removeEventListener("mouseup",E)}}},[D]);const ee=R.useCallback((E,M)=>{L?.side===E&&L?.lineNumber===M?Q(null):Q({side:E,lineNumber:M})},[L]),oe=R.useCallback(()=>{Q(null)},[]),le=R.useCallback(async E=>{L!==null&&(await o(L.lineNumber,E,void 0,L.side),Q(null))},[L,o]),P=(E,M)=>s.filter(k=>{const I=Array.isArray(k.line)?k.line[1]===E:k.line===E,$=!k.side||k.side===M;return I&&$}),se=E=>{if(p==="inline")return"full";switch(E.type){case"delete":return"left";case"add":return"right";default:return"full"}},F=(E,M)=>{if(!E)return"";if(D&&v&&N){const k=Math.min(v,N),I=Math.max(v,N);if(E>=k&&E<=I){let $="after:bg-blue-100 after:absolute after:inset-0 after:opacity-30 after:border-l-4 after:border-blue-500 after:pointer-events-none";return E===k&&($+=" after:border-t-2"),E===I&&($+=" after:border-b-2"),$}}if(L&&L.side===M){const k=Array.isArray(L.lineNumber)?L.lineNumber[0]:L.lineNumber,I=Array.isArray(L.lineNumber)?L.lineNumber[1]:L.lineNumber;if(E>=k&&E<=I)return"after:bg-diff-selected-bg after:absolute after:inset-0 after:border-l-5 after:border-l-diff-selected-border after:pointer-events-none"}return""},ae=R.useMemo(()=>{const E=new Map,M=a.lines;let k=0;for(;k<M.length;){const I=M[k];if(!I){k++;continue}if(I.type==="delete"){let $=k+1;for(;$<M.length&&M[$]?.type==="delete";)$++;const j=M.slice(k,$),U=k,X=[];for(;$<M.length&&M[$]?.type==="add";){const ie=M[$];ie&&X.push({line:ie,index:$}),$++}const re=Math.max(j.length,X.length);for(let ie=0;ie<re;ie++){const fe=j[ie],ue=X[ie];if(fe&&ue&&pp(fe.content,ue.line.content)){const ge=mp(fe.content,ue.line.content);E.set(U+ie,ge.oldSegments),E.set(ue.index,ge.newSegments)}}k=$}else k++}return E},[a.lines]);return p==="side-by-side"?h.jsx(gx,{chunk:a,chunkIndex:r,comments:s,onAddComment:o,onGeneratePrompt:c,onRemoveComment:f,onUpdateComment:d,syntaxTheme:b,cursor:m,fileIndex:S,onLineClick:y,filename:x,commentTrigger:C,onCommentTriggerHandled:_}):h.jsx("div",{className:"bg-github-bg-primary",children:h.jsx("table",{className:"w-full border-collapse font-mono text-sm leading-5",children:h.jsx("tbody",{children:a.lines.map((E,M)=>{const k=E.newLineNumber||E.oldLineNumber||0,I=E.type==="delete"?"old":"new",$=L?Array.isArray(L.lineNumber)?L.lineNumber[1]:L.lineNumber:null,j=E.type==="delete"?E.oldLineNumber:E.newLineNumber,U=E.type==="delete"?"old":"new",X=j?P(j,U):[],re=`file-${S}-chunk-${r}-line-${M}`,ie=m&&m.chunkIndex===r&&m.lineIndex===M;return h.jsxs(Vn.Fragment,{children:[h.jsx(Cp,{line:E,index:M,lineId:re,isCurrentLine:ie||!1,hoveredLineIndex:Y,selectedLineStyle:F(E.newLineNumber||E.oldLineNumber,E.type==="delete"?"old":"new"),onMouseEnter:()=>{ce(M)},onMouseLeave:()=>ce(null),onMouseMove:()=>{if(D&&v){const fe=E.newLineNumber||E.oldLineNumber;fe&&A(fe)}},onCommentButtonMouseDown:fe=>{fe.stopPropagation();const ue=E.newLineNumber||E.oldLineNumber;ue&&(T(ue),A(ue),z(!0))},onCommentButtonMouseUp:fe=>{fe.stopPropagation();const ue=E.newLineNumber||E.oldLineNumber,ge=E.type==="delete"?"old":"new";if(!ue||!v){z(!1),T(null),A(null);return}const de=N||ue;if(v===de)ee(ge,ue);else{const ye=Math.min(v,de),Ne=Math.max(v,de);ee(ge,[ye,Ne])}z(!1),T(null),A(null)},syntaxTheme:b,filename:x,diffSegments:ae.get(M),onClick:()=>{const fe=E.type==="delete"?"left":"right";y?.(S,r,M,fe)}}),X.map(fe=>{const ue=se(E);return h.jsx("tr",{className:"bg-github-bg-secondary",children:h.jsx("td",{colSpan:3,className:"p-0 border-t border-github-border",children:h.jsx("div",{className:`flex ${ue==="left"?"justify-start":ue==="right"?"justify-end":"justify-center"}`,children:h.jsx("div",{className:`${ue==="full"?"w-full":"w-1/2"} m-2 mx-4`,children:h.jsx(Dc,{comment:fe,onGeneratePrompt:c,onRemoveComment:f,onUpdateComment:d})})})})},fe.id)}),L&&L.side===I&&$===k&&h.jsx("tr",{className:"bg-[var(--bg-secondary)]",children:h.jsx("td",{colSpan:3,className:"p-0",children:h.jsx("div",{className:`flex ${se(E)==="left"?"justify-start":se(E)==="right"?"justify-end":"justify-center"}`,children:h.jsx("div",{className:`${se(E)==="full"?"w-full":"w-1/2"}`,children:h.jsx(bp,{onSubmit:le,onCancel:oe})})})})})]},M)})})})})}function mx({file:a,mode:r="inline",baseCommitish:s,targetCommitish:o}){const c=a.status==="deleted",f=a.status==="added",d=a.status==="modified"||a.status==="renamed",p=s||"HEAD~1",b=o||"HEAD",[m,S]=R.useState({}),[y,C]=R.useState({}),_=async(N,A)=>{try{const D=N.naturalWidth,z=N.naturalHeight,Y=(await(await fetch(N.src)).blob()).size;A({width:D,height:z,size:Y})}catch(D){console.error("Failed to get image info:",D)}},x=N=>N?N<1024?`${N} B`:N<1024*1024?`${(N/1024).toFixed(1)} KB`:`${(N/(1024*1024)).toFixed(1)} MB`:"",v=N=>!N.width||!N.height?"":`W: ${N.width}px | H: ${N.height}px`,T={backgroundImage:`
14
+ `,a[0].empty=!0)},rm=(a,r)=>{const s=a.length;return s>0&&a[s-1]===r?a:a.concat(r)},W1=a=>{const r=[[]],s=[a],o=[0],c=[a.length];let f=0,d=0,p=[];const b=[p];for(;d>-1;){for(;(f=o[d]++)<c[d];){let m,S=r[d];const C=s[d][f];if(typeof C=="string"?(S=d>0?S:["plain"],m=C):(S=rm(S,C.type),C.alias&&(S=rm(S,C.alias)),m=C.content),typeof m!="string"){d++,r.push(S),s.push(m),o.push(0),c.push(m.length);continue}const _=m.split(J1),x=_.length;p.push({types:S,content:_[0]});for(let v=1;v<x;v++)am(p),b.push(p=[]),p.push({types:S,content:_[v]})}d--,r.pop(),s.pop(),o.pop(),c.pop()}return am(p),b},im=W1,P1=({prism:a,code:r,grammar:s,language:o})=>R.useMemo(()=>{if(s==null)return im([r]);const c={code:r,grammar:s,language:o,tokens:[]};return a.hooks.run("before-tokenize",c),c.tokens=a.tokenize(r,s),a.hooks.run("after-tokenize",c),im(c.tokens)},[r,s,o,a]),ex=(a,r)=>{const{plain:s}=a,o=a.styles.reduce((c,f)=>{const{languages:d,style:p}=f;return d&&!d.includes(r)||f.types.forEach(b=>{const m=vn(vn({},c[b]),p);c[b]=m}),c},{});return o.root=s,o.plain=Ro(vn({},s),{backgroundColor:void 0}),o},tx=ex,nx=({children:a,language:r,code:s,theme:o,prism:c})=>{const f=r.toLowerCase(),d=tx(o,f),p=Q1(d),b=K1(d),m=c.languages[f],S=P1({prism:c,language:f,code:s,grammar:m});return a({tokens:S,className:`prism-code language-${f}`,style:d!=null?d.root:{},getLineProps:p,getTokenProps:b})},lx=a=>R.createElement(nx,Ro(vn({},a),{prism:a.prism||W,theme:a.theme||Np,code:a.code,language:a.language}));const ax="modulepreload",rx=function(a){return"/"+a},om={},At=function(r,s,o){let c=Promise.resolve();if(s&&s.length>0){let b=function(m){return Promise.all(m.map(S=>Promise.resolve(S).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),p=d?.nonce||d?.getAttribute("nonce");c=b(s.map(m=>{if(m=rx(m),m in om)return;om[m]=!0;const S=m.endsWith(".css"),y=S?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${y}`))return;const C=document.createElement("link");if(C.rel=S?"stylesheet":ax,S||(C.as="script"),C.crossOrigin="",C.href=m,p&&C.setAttribute("nonce",p),document.head.appendChild(C),S)return new Promise((_,x)=>{C.addEventListener("load",_),C.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${m}`)))})}))}function f(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return c.then(d=>{for(const p of d||[])p.status==="rejected"&&f(p.reason);return r().catch(f)})},ro={};function Ap(a){if(!ro[a]){const s={bash:()=>At(()=>import("./prism-bash-DTkDXsAh.js"),[]),sh:()=>At(()=>import("./prism-bash-DTkDXsAh.js"),[]),shell:()=>At(()=>import("./prism-bash-DTkDXsAh.js"),[]),php:async()=>(await At(()=>import("./prism-markup-templating-Ct1xsyfA.js"),[]),At(()=>import("./prism-php-KTVLPyZ3.js").then(o=>o.p),[])),sql:()=>At(()=>import("./prism-sql-AgAyy5H_.js"),[]),ruby:()=>At(()=>import("./prism-ruby-BfQ5W8b2.js").then(o=>o.p),[]),java:()=>At(()=>import("./prism-java-BxkFoZjf.js").then(o=>o.p),[]),scala:async()=>(await Ap("java"),At(()=>import("./prism-scala-BjNo2HkN.js"),[])),solidity:()=>At(()=>import("./prism-solidity-Ck9mTXkq.js").then(o=>o.p),[]),vim:()=>At(()=>import("./prism-vim-uciLQ2PQ.js"),[]),dart:()=>At(()=>import("./prism-dart-MjriiaMt.js"),[]),csharp:()=>At(()=>import("./prism-csharp-Dc9gly1x.js").then(o=>o.p),[]),protobuf:()=>At(()=>import("./prism-protobuf-DiQ_z8B5.js"),[]),hcl:()=>At(()=>import("./prism-hcl-Cv91Cd6z.js").then(o=>o.p),[])}[a];if(!s)return console.warn(`No loader available for language: ${a}`),Promise.reject(new Error(`Unsupported language: ${a}`));ro[a]=s().then(()=>{}).catch(o=>{throw delete ro[a],console.warn(`Failed to load language: ${a}`,o),o})}return ro[a]}typeof global<"u"?global.Prism=W:typeof window<"u"&&(window.Prism=W);const sm=["markup","html","xml","svg","javascript","js","typescript","ts","jsx","tsx","css","c","cpp","swift","kotlin","objectivec","reason","rust","go","graphql","yaml","yml","json","markdown","md","python","py"];function ix(a,r){const[s,o]=R.useState(()=>sm.includes(r)||!!W.languages[r]);return R.useEffect(()=>{if(!s){if(sm.includes(r)){o(!0);return}Ap(r).then(()=>{o(!0)}).catch(()=>{o(!1)})}},[r,s]),{ready:s,actualLang:s?r:"text"}}const um=[{id:"github",label:"GitHub Light"},{id:"vsLight",label:"VS Light"},{id:"oneLight",label:"One Light"},{id:"gruvboxMaterialLight",label:"Gruvbox Material Light"},{id:"nightOwlLight",label:"Night Owl Light"}],cm=[{id:"vsDark",label:"VS Dark"},{id:"oneDark",label:"One Dark"},{id:"gruvboxMaterialDark",label:"Gruvbox Material Dark"},{id:"nightOwl",label:"Night Owl"},{id:"dracula",label:"Dracula"},{id:"okaidia",label:"Okaidia"}];function ox(a){return{...a,styles:a.styles.map(r=>({...r,style:{...r.style,background:void 0,backgroundColor:void 0}}))}}function sx(a){let r;switch(a){case"github":r=Qt.github;break;case"vsLight":r=Qt.vsLight;break;case"oneLight":r=Qt.oneLight;break;case"gruvboxMaterialLight":r=Qt.gruvboxMaterialLight;break;case"nightOwlLight":r=Qt.nightOwlLight;break;case"vsDark":r=Qt.vsDark;break;case"oneDark":r=Qt.oneDark;break;case"gruvboxMaterialDark":r=Qt.gruvboxMaterialDark;break;case"nightOwl":r=Qt.nightOwl;break;case"dracula":r=Qt.dracula;break;case"okaidia":r=Qt.okaidia;break;default:r=Qt.vsDark}return ox(r)}function ux(a){const r=Fv(a).toLowerCase(),s=gp(a),o={dockerfile:"docker",makefile:"makefile",".gitignore":"git",".env":"bash",".bashrc":"bash",".zshrc":"bash",".bash_profile":"bash",".profile":"bash"};return o[r]?o[r]:{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",json:"json",css:"css",scss:"css",html:"html",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",yml:"yaml",yaml:"yaml",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",php:"php",sql:"sql",xml:"xml",swift:"swift",kt:"kotlin",scala:"scala",svelte:"svelte",r:"r",lua:"lua",perl:"perl",dockerfile:"docker",makefile:"makefile",gitignore:"git",env:"bash",conf:"nginx",ini:"ini",toml:"toml",sol:"solidity",vim:"vim",dart:"dart",cs:"csharp",proto:"protobuf",tf:"hcl",tfvars:"hcl",hcl:"hcl"}[s||""]||"text"}const cx=Vn.memo(function({code:r,language:s,className:o,syntaxTheme:c="vsDark",filename:f="",renderToken:d,onMouseOver:p,onMouseOut:b}){const m=s||(f?ux(f):"text"),{actualLang:S}=ix(r,m),y=sx(c),C=R.useCallback(({style:_,tokens:x,getLineProps:v,getTokenProps:T})=>h.jsx("span",{className:o,style:{..._,background:"transparent",backgroundColor:"transparent"},onMouseOver:p,onMouseOut:b,children:x.map((N,A)=>h.jsx("span",{...v({line:N}),children:N.map((D,z)=>d?d(D,z,T):h.jsx("span",{...T({token:D})},z))},A))}),[o,p,b,d]);return h.jsx(lx,{code:r,language:S,theme:y,prism:W,children:C})}),xc=Vn.memo(function(r){const{handleMouseOver:s,handleMouseOut:o,isWordHighlighted:c}=Pv(),f=R.useCallback((d,p,b)=>{const m=b({token:d}),S=d.content.split(/( +)/);if(S.length===1&&S[0]&&!nm(S[0]))return h.jsx("span",{...m},p);const y=S.map((C,_)=>{if(!C)return null;if(nm(C)){const x=C.trim(),v=c(x);return h.jsx("span",{className:`word-token ${v?"word-highlight":""}`,"data-word":x,children:C},`${p}-${_}`)}return h.jsx("span",{children:C},`${p}-${_}`)});return h.jsx("span",{...m,children:y},p)},[c]);return h.jsx(cx,{...r,renderToken:f,onMouseOver:s,onMouseOut:o})}),Sc=Vn.memo(function({segments:r,className:s=""}){const o=R.useMemo(()=>r.map((c,f)=>{const d=c.type==="added"?"word-diff-added":c.type==="removed"?"word-diff-removed":"";return h.jsx("span",{className:d,children:c.value},f)}),[r]);return h.jsx("span",{className:s,children:o})}),fx=a=>{switch(a.type){case"add":return"bg-diff-addition-bg";case"delete":return"bg-diff-deletion-bg";default:return"bg-transparent"}},dx=a=>{switch(a.type){case"add":return"+";case"delete":return"-";default:return" "}},Cp=Vn.memo(({line:a,index:r,lineId:s,isCurrentLine:o=!1,hoveredLineIndex:c,selectedLineStyle:f,onMouseEnter:d,onMouseLeave:p,onMouseMove:b,onCommentButtonMouseDown:m,onCommentButtonMouseUp:S,syntaxTheme:y,onClick:C,filename:_,diffSegments:x})=>{const v=a.newLineNumber||a.oldLineNumber,T=c===r&&v,N=o?"keyboard-cursor":"";return h.jsxs("tr",{id:s,className:`group ${fx(a)} relative ${f} ${N} cursor-pointer`,onMouseEnter:d,onMouseLeave:p,onMouseMove:b,onClick:C,children:[h.jsx("td",{className:"w-[50px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top relative",children:a.oldLineNumber||""}),h.jsxs("td",{className:"w-[50px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top relative overflow-visible",children:[h.jsx("span",{className:"pr-5",children:a.newLineNumber||""}),T&&h.jsx(fo,{onMouseDown:m,onMouseUp:S})]}),h.jsx("td",{className:"p-0 w-full relative align-top",children:h.jsxs("div",{className:"flex items-center relative min-h-[16px]",children:[h.jsx("span",{className:`w-5 text-center text-github-text-muted flex-shrink-0 bg-github-bg-secondary border-r border-github-border ${a.type==="add"?"text-github-accent bg-diff-addition-bg":a.type==="delete"?"text-github-danger bg-diff-deletion-bg":""}`,children:dx(a)}),x?h.jsx(Sc,{segments:x,className:"flex-1 px-3 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word select-text"}):h.jsx(xc,{code:a.content,className:"flex-1 px-3 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word select-text [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit",syntaxTheme:y,filename:_})]})})]})});Cp.displayName="DiffLineRow";function gx({chunk:a,chunkIndex:r,comments:s,onAddComment:o,onGeneratePrompt:c,onRemoveComment:f,onUpdateComment:d,syntaxTheme:p,cursor:b=null,fileIndex:m=0,onLineClick:S,commentTrigger:y,onCommentTriggerHandled:C,filename:_}){const[x,v]=R.useState(null),[T,N]=R.useState(null),[A,D]=R.useState(!1),[z,L]=R.useState(null),[Q,Y]=R.useState(null);R.useEffect(()=>{if(y?.lineIndex!==void 0){const E=a.lines[y.lineIndex];if(E&&E.type!=="delete"){const M=E.newLineNumber;M&&(L({side:"new",lineNumber:M}),C?.())}}},[y,a.lines,C]),R.useEffect(()=>{if(A){const E=()=>{D(!1),v(null),N(null)};return document.addEventListener("mouseup",E),()=>{document.removeEventListener("mouseup",E)}}},[A]);const ce=R.useCallback((E,M)=>{z?.side===E&&z?.lineNumber===M?L(null):L({side:E,lineNumber:M})},[z]),ee=R.useCallback(()=>{L(null)},[]),oe=R.useCallback(async E=>{z!==null&&(await o(z.lineNumber,E,void 0,z.side),L(null))},[z,o]),le=(E,M)=>s.filter(k=>{const I=Array.isArray(k.line)?k.line[1]===E:k.line===E,$=!k.side||k.side===M;return I&&$}),P=E=>E.oldLine?.type==="delete"&&E.newLine?.type==="add"?E.newLineNumber?"right":"left":E.oldLine?.type==="delete"?"left":E.newLine?.type==="add"?"right":"full",se=(E,M)=>{const k=E==="old"?M.oldLineNumber:M.newLineNumber;if(!k)return"";if(A&&x&&T&&x.side===E&&T.side===E){const I=Math.min(x.lineNumber,T.lineNumber),$=Math.max(x.lineNumber,T.lineNumber);if(k>=I&&k<=$){let j="after:bg-blue-100 after:absolute after:inset-0 after:opacity-30 after:border-l-4 after:border-blue-500 after:pointer-events-none";return k===I&&(j+=" after:border-t-2"),k===$&&(j+=" after:border-b-2"),j}}if(z&&z.side===E){const I=Array.isArray(z.lineNumber)?z.lineNumber:[z.lineNumber,z.lineNumber],$=I[0],j=I[1];if($!==void 0&&j!==void 0&&k>=$&&k<=j)return"after:bg-diff-selected-bg after:absolute after:inset-0 after:border-l-5 after:border-l-diff-selected-border after:pointer-events-none"}return""},F=R.useCallback(E=>{const M=[];let k=a.oldStart,I=a.newStart,$=0;for(;$<E.length;){const j=E[$];if(!j){$++;continue}if(j.type==="normal")M.push({oldLine:j,newLine:{...j},oldLineNumber:j.oldLineNumber??k,newLineNumber:j.newLineNumber??I,oldLineOriginalIndex:$,newLineOriginalIndex:$}),k++,I++,$++;else if(j.type==="delete"){let U=$+1;for(;U<E.length&&E[U]?.type==="delete";)U++;const X=E.slice($,U),re=$,ie=[],fe=U;for(;U<E.length&&E[U]?.type==="add";){const ge=E[U];ge&&ie.push(ge),U++}const ue=Math.max(X.length,ie.length);for(let ge=0;ge<ue;ge++){const de=X[ge],ye=ie[ge];let Ne;de&&ye&&pp(de.content,ye.content)&&(Ne=mp(de.content,ye.content)),M.push({oldLine:de,newLine:ye,oldLineNumber:de?de.oldLineNumber??k+ge:void 0,newLineNumber:ye?ye.newLineNumber??I+ge:void 0,oldLineOriginalIndex:de?re+ge:void 0,newLineOriginalIndex:ye?fe+ge:void 0,wordLevelDiff:Ne})}k+=X.length,I+=ie.length,$=U}else j.type==="add"&&(M.push({newLine:j,newLineNumber:j.newLineNumber??I,newLineOriginalIndex:$}),I++,$++)}return M},[a.oldStart,a.newStart]),ae=R.useMemo(()=>F(a.lines),[a.lines,F]);return h.jsx("div",{className:"bg-github-bg-primary border border-github-border rounded-md overflow-hidden",children:h.jsx("table",{className:"w-full border-collapse font-mono text-sm leading-5",children:h.jsx("tbody",{children:ae.map((E,M)=>{const k=E.oldLineNumber?le(E.oldLineNumber,"old"):[],I=E.newLineNumber?le(E.newLineNumber,"new"):[],$=[...k,...I],j=E.oldLineOriginalIndex??-1,U=E.newLineOriginalIndex??-1,X=b?b.side==="left"&&j>=0?b.chunkIndex===r&&b.lineIndex===j:b.side==="right"&&U>=0?b.chunkIndex===r&&b.lineIndex===U:!1:!1,re=j>=0?`file-${m}-chunk-${r}-line-${j}-left`:void 0,ie=U>=0?`file-${m}-chunk-${r}-line-${U}-right`:void 0,fe=X&&b?.side==="left",ue=X&&b?.side==="right",ge="keyboard-cursor";return h.jsxs(Vn.Fragment,{children:[h.jsxs("tr",{className:"group cursor-pointer",onClick:de=>{if(!A){const ye=de.target,Ne=ye.closest("td:nth-child(1)")||ye.closest("td:nth-child(2)"),pe=ye.closest("td:nth-child(3)")||ye.closest("td:nth-child(4)");Ne&&j>=0?S?.(m,r,j,"left"):pe&&U>=0&&S?.(m,r,U,"right")}},onMouseEnter:de=>{const ye=de.target,Ne=ye.closest("td:nth-child(1)")||ye.closest("td:nth-child(2)"),pe=ye.closest("td:nth-child(3)")||ye.closest("td:nth-child(4)");Ne&&E.oldLineNumber?Y({side:"old",lineNumber:E.oldLineNumber}):pe&&E.newLineNumber&&Y({side:"new",lineNumber:E.newLineNumber})},onMouseMove:de=>{const ye=de.target,Ne=ye.closest("td:nth-child(1)")||ye.closest("td:nth-child(2)"),pe=ye.closest("td:nth-child(3)")||ye.closest("td:nth-child(4)");Ne&&E.oldLineNumber?(Q?.side!=="old"||Q?.lineNumber!==E.oldLineNumber)&&Y({side:"old",lineNumber:E.oldLineNumber}):pe&&E.newLineNumber&&(Q?.side!=="new"||Q?.lineNumber!==E.newLineNumber)&&Y({side:"new",lineNumber:E.newLineNumber}),A&&x&&(x.side==="old"&&E.oldLineNumber?N({side:"old",lineNumber:E.oldLineNumber}):x.side==="new"&&E.newLineNumber&&N({side:"new",lineNumber:E.newLineNumber}))},onMouseLeave:()=>Y(null),children:[h.jsxs("td",{id:re,className:`w-[60px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top relative overflow-visible ${fe?ge:""}`,children:[h.jsx("span",{className:"pr-5",children:E.oldLineNumber||""}),Q?.side==="old"&&Q?.lineNumber===E.oldLineNumber&&h.jsx(fo,{onMouseDown:de=>{de.stopPropagation(),E.oldLineNumber&&(v({side:"old",lineNumber:E.oldLineNumber}),N({side:"old",lineNumber:E.oldLineNumber}),D(!0))},onMouseUp:de=>{if(de.stopPropagation(),!E.oldLineNumber||!x){D(!1),v(null),N(null);return}const ye=T&&T.side==="old"?T.lineNumber:E.oldLineNumber;if(x.side!=="old"||x.lineNumber===ye)ce("old",E.oldLineNumber);else{const Ne=Math.min(x.lineNumber,ye),pe=Math.max(x.lineNumber,ye);ce("old",[Ne,pe])}D(!1),v(null),N(null)}})]}),h.jsx("td",{className:`w-1/2 p-0 align-top border-r border-github-border relative ${E.oldLine?.type==="delete"?"bg-diff-deletion-bg":E.oldLine?.type==="normal"?"bg-transparent":"bg-github-bg-secondary"} ${se("old",E)} ${fe?ge:""}`,children:E.oldLine&&h.jsx("div",{className:"flex items-center relative min-h-[20px] px-3",children:E.wordLevelDiff?h.jsx(Sc,{segments:E.wordLevelDiff.oldSegments,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word select-text"}):h.jsx(xc,{code:E.oldLine.content,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word select-text [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit",syntaxTheme:p,filename:_})})}),h.jsxs("td",{id:ie,className:`w-[60px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top relative overflow-visible ${ue?ge:""}`,children:[h.jsx("span",{className:"pr-5",children:E.newLineNumber||""}),Q?.side==="new"&&Q?.lineNumber===E.newLineNumber&&h.jsx(fo,{onMouseDown:de=>{de.stopPropagation(),E.newLineNumber&&(v({side:"new",lineNumber:E.newLineNumber}),N({side:"new",lineNumber:E.newLineNumber}),D(!0))},onMouseUp:de=>{if(de.stopPropagation(),!E.newLineNumber||!x){D(!1),v(null),N(null);return}const ye=T&&T.side==="new"?T.lineNumber:E.newLineNumber;if(x.side!=="new"||x.lineNumber===ye)ce("new",E.newLineNumber);else{const Ne=Math.min(x.lineNumber,ye),pe=Math.max(x.lineNumber,ye);ce("new",[Ne,pe])}D(!1),v(null),N(null)}})]}),h.jsx("td",{className:`w-1/2 p-0 align-top relative ${E.newLine?.type==="add"?"bg-diff-addition-bg":E.newLine?.type==="normal"?"bg-transparent":"bg-github-bg-secondary"} ${se("new",E)} ${ue?ge:""}`,children:E.newLine&&h.jsx("div",{className:"flex items-center relative min-h-[20px] px-3",children:E.wordLevelDiff?h.jsx(Sc,{segments:E.wordLevelDiff.newSegments,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word select-text"}):h.jsx(xc,{code:E.newLine.content,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word select-text [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit",syntaxTheme:p,filename:_})})})]}),$.length>0&&h.jsx("tr",{className:"bg-github-bg-secondary",children:h.jsx("td",{colSpan:4,className:"p-0 border-t border-github-border",children:$.map(de=>{const ye=de.side||"new";let Ne;return ye==="old"&&E.oldLineNumber?Ne="left":ye==="new"&&E.newLineNumber?Ne="right":Ne=P(E),h.jsx("div",{className:`flex ${Ne==="left"?"justify-start":Ne==="right"?"justify-end":"justify-center"}`,children:h.jsx("div",{className:`${Ne==="full"?"w-full":"w-1/2"} m-2 mx-4`,children:h.jsx(Dc,{comment:de,onGeneratePrompt:c,onRemoveComment:f,onUpdateComment:d})})},de.id)})})}),z&&(z.side==="old"&&z.lineNumber===E.oldLineNumber||z.side==="new"&&z.lineNumber===E.newLineNumber||Array.isArray(z.lineNumber)&&(z.side==="new"&&z.lineNumber[1]===E.newLineNumber||z.side==="old"&&z.lineNumber[1]===E.oldLineNumber))&&h.jsx("tr",{className:"bg-github-bg-secondary",children:h.jsx("td",{colSpan:4,className:"p-0",children:h.jsx("div",{className:`flex ${z.side==="old"?"justify-start":z.side==="new"?"justify-end":"justify-center"}`,children:h.jsx("div",{className:"w-1/2",children:h.jsx(bp,{onSubmit:oe,onCancel:ee})})})})})]},M)})})})})}function hx({chunk:a,chunkIndex:r,comments:s,onAddComment:o,onGeneratePrompt:c,onRemoveComment:f,onUpdateComment:d,mode:p="inline",syntaxTheme:b,cursor:m=null,fileIndex:S=0,onLineClick:y,commentTrigger:C,onCommentTriggerHandled:_,filename:x}){const[v,T]=R.useState(null),[N,A]=R.useState(null),[D,z]=R.useState(!1),[L,Q]=R.useState(null),[Y,ce]=R.useState(null);R.useEffect(()=>{if(C?.lineIndex!==void 0){const E=a.lines[C.lineIndex];if(E){const M=E.newLineNumber||E.oldLineNumber,k=E.type==="delete"?"old":"new";M&&(Q({side:k,lineNumber:M}),_?.())}}},[C,a.lines,_]),R.useEffect(()=>{if(D){const E=()=>{z(!1),T(null),A(null)};return document.addEventListener("mouseup",E),()=>{document.removeEventListener("mouseup",E)}}},[D]);const ee=R.useCallback((E,M)=>{L?.side===E&&L?.lineNumber===M?Q(null):Q({side:E,lineNumber:M})},[L]),oe=R.useCallback(()=>{Q(null)},[]),le=R.useCallback(async E=>{L!==null&&(await o(L.lineNumber,E,void 0,L.side),Q(null))},[L,o]),P=(E,M)=>s.filter(k=>{const I=Array.isArray(k.line)?k.line[1]===E:k.line===E,$=!k.side||k.side===M;return I&&$}),se=E=>{if(p==="inline")return"full";switch(E.type){case"delete":return"left";case"add":return"right";default:return"full"}},F=(E,M)=>{if(!E)return"";if(D&&v&&N){const k=Math.min(v,N),I=Math.max(v,N);if(E>=k&&E<=I){let $="after:bg-blue-100 after:absolute after:inset-0 after:opacity-30 after:border-l-4 after:border-blue-500 after:pointer-events-none";return E===k&&($+=" after:border-t-2"),E===I&&($+=" after:border-b-2"),$}}if(L&&L.side===M){const k=Array.isArray(L.lineNumber)?L.lineNumber[0]:L.lineNumber,I=Array.isArray(L.lineNumber)?L.lineNumber[1]:L.lineNumber;if(E>=k&&E<=I)return"after:bg-diff-selected-bg after:absolute after:inset-0 after:border-l-5 after:border-l-diff-selected-border after:pointer-events-none"}return""},ae=R.useMemo(()=>{const E=new Map,M=a.lines;let k=0;for(;k<M.length;){const I=M[k];if(!I){k++;continue}if(I.type==="delete"){let $=k+1;for(;$<M.length&&M[$]?.type==="delete";)$++;const j=M.slice(k,$),U=k,X=[];for(;$<M.length&&M[$]?.type==="add";){const ie=M[$];ie&&X.push({line:ie,index:$}),$++}const re=Math.max(j.length,X.length);for(let ie=0;ie<re;ie++){const fe=j[ie],ue=X[ie];if(fe&&ue&&pp(fe.content,ue.line.content)){const ge=mp(fe.content,ue.line.content);E.set(U+ie,ge.oldSegments),E.set(ue.index,ge.newSegments)}}k=$}else k++}return E},[a.lines]);return p==="side-by-side"?h.jsx(gx,{chunk:a,chunkIndex:r,comments:s,onAddComment:o,onGeneratePrompt:c,onRemoveComment:f,onUpdateComment:d,syntaxTheme:b,cursor:m,fileIndex:S,onLineClick:y,filename:x,commentTrigger:C,onCommentTriggerHandled:_}):h.jsx("div",{className:"bg-github-bg-primary",children:h.jsx("table",{className:"w-full border-collapse font-mono text-sm leading-5",children:h.jsx("tbody",{children:a.lines.map((E,M)=>{const k=E.newLineNumber||E.oldLineNumber||0,I=E.type==="delete"?"old":"new",$=L?Array.isArray(L.lineNumber)?L.lineNumber[1]:L.lineNumber:null,j=E.type==="delete"?E.oldLineNumber:E.newLineNumber,U=E.type==="delete"?"old":"new",X=j?P(j,U):[],re=`file-${S}-chunk-${r}-line-${M}`,ie=m&&m.chunkIndex===r&&m.lineIndex===M;return h.jsxs(Vn.Fragment,{children:[h.jsx(Cp,{line:E,index:M,lineId:re,isCurrentLine:ie||!1,hoveredLineIndex:Y,selectedLineStyle:F(E.newLineNumber||E.oldLineNumber,E.type==="delete"?"old":"new"),onMouseEnter:()=>{ce(M)},onMouseLeave:()=>ce(null),onMouseMove:()=>{if(D&&v){const fe=E.newLineNumber||E.oldLineNumber;fe&&A(fe)}},onCommentButtonMouseDown:fe=>{fe.stopPropagation();const ue=E.newLineNumber||E.oldLineNumber;ue&&(T(ue),A(ue),z(!0))},onCommentButtonMouseUp:fe=>{fe.stopPropagation();const ue=E.newLineNumber||E.oldLineNumber,ge=E.type==="delete"?"old":"new";if(!ue||!v){z(!1),T(null),A(null);return}const de=N||ue;if(v===de)ee(ge,ue);else{const ye=Math.min(v,de),Ne=Math.max(v,de);ee(ge,[ye,Ne])}z(!1),T(null),A(null)},syntaxTheme:b,filename:x,diffSegments:ae.get(M),onClick:()=>{const fe=E.type==="delete"?"left":"right";y?.(S,r,M,fe)}}),X.map(fe=>{const ue=se(E);return h.jsx("tr",{className:"bg-github-bg-secondary",children:h.jsx("td",{colSpan:3,className:"p-0 border-t border-github-border",children:h.jsx("div",{className:`flex ${ue==="left"?"justify-start":ue==="right"?"justify-end":"justify-center"}`,children:h.jsx("div",{className:`${ue==="full"?"w-full":"w-1/2"} m-2 mx-4`,children:h.jsx(Dc,{comment:fe,onGeneratePrompt:c,onRemoveComment:f,onUpdateComment:d})})})})},fe.id)}),L&&L.side===I&&$===k&&h.jsx("tr",{className:"bg-[var(--bg-secondary)]",children:h.jsx("td",{colSpan:3,className:"p-0",children:h.jsx("div",{className:`flex ${se(E)==="left"?"justify-start":se(E)==="right"?"justify-end":"justify-center"}`,children:h.jsx("div",{className:`${se(E)==="full"?"w-full":"w-1/2"}`,children:h.jsx(bp,{onSubmit:le,onCancel:oe})})})})})]},M)})})})})}function mx({file:a,mode:r="inline",baseCommitish:s,targetCommitish:o}){const c=a.status==="deleted",f=a.status==="added",d=a.status==="modified"||a.status==="renamed",p=s||"HEAD~1",b=o||"HEAD",[m,S]=R.useState({}),[y,C]=R.useState({}),_=async(N,A)=>{try{const D=N.naturalWidth,z=N.naturalHeight,Y=(await(await fetch(N.src)).blob()).size;A({width:D,height:z,size:Y})}catch(D){console.error("Failed to get image info:",D)}},x=N=>N?N<1024?`${N} B`:N<1024*1024?`${(N/1024).toFixed(1)} KB`:`${(N/(1024*1024)).toFixed(1)} MB`:"",v=N=>!N.width||!N.height?"":`W: ${N.width}px | H: ${N.height}px`,T={backgroundImage:`
15
15
  linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%),
16
16
  linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%)
17
- `,backgroundSize:"20px 20px",backgroundPosition:"0 0, 10px 10px",backgroundColor:"white"};return c?h.jsx("div",{className:"bg-github-bg-primary p-4",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"mb-2",children:h.jsx("span",{className:"text-github-danger font-medium",children:"Deleted Image"})}),h.jsxs("div",{className:"inline-block border border-github-border rounded-md p-4 bg-github-bg-secondary",children:[h.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"Previous version:"}),h.jsx("img",{src:`/api/blob/${a.oldPath||a.path}?ref=${p}`,alt:`Previous version of ${a.oldPath||a.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:T,onLoad:N=>_(N.currentTarget,S),onError:N=>{const A=N.target;A.style.display="none",A.nextElementSibling?.classList.remove("hidden")}}),h.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(m.width||m.size)&&h.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[v(m),v(m)&&x(m.size)&&" | ",x(m.size)]})]})]})}):f?h.jsx("div",{className:"bg-github-bg-primary p-4",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"mb-2",children:h.jsx("span",{className:"text-github-accent font-medium",children:"Added Image"})}),h.jsxs("div",{className:"inline-block border border-github-border rounded-md p-4 bg-github-bg-secondary",children:[h.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"New file:"}),h.jsx("img",{src:`/api/blob/${a.path}?ref=${b}`,alt:`New image ${a.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:T,onLoad:N=>_(N.currentTarget,C),onError:N=>{const A=N.target;A.style.display="none",A.nextElementSibling?.classList.remove("hidden")}}),h.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(y.width||y.size)&&h.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[v(y),v(y)&&x(y.size)&&" | ",x(y.size)]})]})]})}):d?r==="side-by-side"?h.jsxs("div",{className:"bg-github-bg-primary p-4",children:[h.jsx("div",{className:"text-center mb-4",children:h.jsx("span",{className:"text-github-text-primary font-medium",children:"Modified Image"})}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsx("div",{className:"text-center",children:h.jsxs("div",{className:"border border-github-border rounded-md p-4 bg-github-bg-secondary",children:[h.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"Previous version:"}),h.jsx("img",{src:`/api/blob/${a.oldPath||a.path}?ref=${p}`,alt:`Previous version of ${a.oldPath||a.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:T,onLoad:N=>_(N.currentTarget,S),onError:N=>{const A=N.target;A.style.display="none",A.nextElementSibling?.classList.remove("hidden")}}),h.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(m.width||m.size)&&h.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[v(m),v(m)&&x(m.size)&&" | ",x(m.size)]})]})}),h.jsx("div",{className:"text-center",children:h.jsxs("div",{className:"border border-github-border rounded-md p-4 bg-github-bg-secondary",children:[h.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"Current version:"}),h.jsx("img",{src:`/api/blob/${a.path}?ref=${b}`,alt:`Current version of ${a.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:T,onLoad:N=>_(N.currentTarget,C),onError:N=>{const A=N.target;A.style.display="none",A.nextElementSibling?.classList.remove("hidden")}}),h.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(y.width||y.size)&&h.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[v(y),v(y)&&x(y.size)&&" | ",x(y.size)]})]})})]})]}):h.jsxs("div",{className:"bg-github-bg-primary p-4",children:[h.jsx("div",{className:"text-center mb-4",children:h.jsx("span",{className:"text-github-text-primary font-medium",children:"Modified Image"})}),h.jsxs("div",{className:"space-y-6",children:[h.jsx("div",{className:"text-center",children:h.jsxs("div",{className:"border border-github-border rounded-md p-4 bg-github-bg-secondary inline-block",children:[h.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"Previous version:"}),h.jsx("img",{src:`/api/blob/${a.oldPath||a.path}?ref=${p}`,alt:`Previous version of ${a.oldPath||a.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:T,onLoad:N=>_(N.currentTarget,S),onError:N=>{const A=N.target;A.style.display="none",A.nextElementSibling?.classList.remove("hidden")}}),h.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(m.width||m.size)&&h.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[v(m),v(m)&&x(m.size)&&" | ",x(m.size)]})]})}),h.jsx("div",{className:"text-center",children:h.jsxs("div",{className:"border border-github-border rounded-md p-4 bg-github-bg-secondary inline-block",children:[h.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"Current version:"}),h.jsx("img",{src:`/api/blob/${a.path}?ref=${b}`,alt:`Current version of ${a.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:T,onLoad:N=>_(N.currentTarget,C),onError:N=>{const A=N.target;A.style.display="none",A.nextElementSibling?.classList.remove("hidden")}}),h.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(y.width||y.size)&&h.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[v(y),v(y)&&x(y.size)&&" | ",x(y.size)]})]})})]})]}):null}function px({file:a,comments:r,diffMode:s,reviewedFiles:o,onToggleReviewed:c,collapsedFiles:f,onToggleCollapsed:d,onToggleAllCollapsed:p,onAddComment:b,onGeneratePrompt:m,onRemoveComment:S,onUpdateComment:y,syntaxTheme:C,baseCommitish:_,targetCommitish:x,cursor:v=null,fileIndex:T=0,onLineClick:N,commentTrigger:A,onCommentTriggerHandled:D}){const z=f.has(a.path),[L,Q]=R.useState(!1),Y=ee=>{switch(ee){case"added":return h.jsx(sp,{size:16,className:"text-github-accent"});case"deleted":return h.jsx(up,{size:16,className:"text-github-danger"});case"renamed":return h.jsx(op,{size:16,className:"text-github-warning"});default:return h.jsx(ip,{size:16,className:"text-github-text-secondary"})}},ce=async(ee,oe,le,P,se)=>{try{await b(a.path,ee,oe,le,P,se)}catch(F){console.error("Failed to add comment:",F)}};return h.jsxs("div",{className:"bg-github-bg-primary",children:[h.jsxs("div",{className:"bg-github-bg-secondary border-t-2 border-t-github-accent border-b border-github-border px-5 py-4 flex items-center justify-between flex-wrap gap-3 sticky top-0 z-10",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[h.jsx("button",{onClick:ee=>{ee.altKey?p(!z):d(a.path)},className:"text-github-text-muted hover:text-github-text-primary transition-colors cursor-pointer",title:z?"Expand file (Alt+Click to expand all)":"Collapse file (Alt+Click to collapse all)",children:z?h.jsx(ap,{size:16}):h.jsx(Co,{size:16})}),Y(a.status),h.jsx("h2",{className:"text-sm font-mono text-github-text-primary m-0 overflow-hidden text-ellipsis whitespace-nowrap",children:a.path}),h.jsx("button",{className:`bg-transparent border-none cursor-pointer px-1.5 py-1 rounded text-sm transition-all hover:bg-github-bg-tertiary ${L?"text-github-accent":"text-github-text-secondary hover:text-github-text-primary"}`,onClick:()=>{navigator.clipboard.writeText(a.path).then(()=>{console.log("File path copied to clipboard:",a.path),Q(!0),setTimeout(()=>Q(!1),2e3)}).catch(ee=>{console.error("Failed to copy file path:",ee)})},title:"Copy file path",children:L?h.jsx(Ur,{size:14}):h.jsx(rp,{size:14})}),a.oldPath&&a.oldPath!==a.path&&h.jsxs("span",{className:"text-xs text-github-text-muted italic",children:["(renamed from ",a.oldPath,")"]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[h.jsxs("span",{className:"font-medium px-1 py-0.5 rounded text-github-accent bg-green-100/10",children:["+",a.additions]}),h.jsxs("span",{className:"font-medium px-1 py-0.5 rounded text-github-danger bg-red-100/10",children:["-",a.deletions]})]}),h.jsxs("button",{onClick:()=>c(a.path),className:`flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-all duration-200 ${o.has(a.path)?"bg-github-accent text-white":"dark:bg-slate-600 dark:text-white dark:border-slate-500 dark:hover:bg-slate-500 dark:hover:border-slate-400 bg-github-bg-secondary text-github-text-primary border border-github-border hover:bg-github-bg-tertiary hover:border-github-text-muted"}`,title:o.has(a.path)?"Mark as not reviewed":"Mark as reviewed",children:[o.has(a.path)?h.jsx(Ur,{size:14}):h.jsx(Mv,{size:14}),"Viewed"]})]})]}),!z&&h.jsx("div",{className:"overflow-y-auto",children:Gv(a.path)?h.jsx(mx,{file:a,mode:s,baseCommitish:_,targetCommitish:x}):a.chunks.map((ee,oe)=>h.jsxs("div",{id:`chunk-${a.path.replace(/[^a-zA-Z0-9]/g,"-")}-${oe}`,className:"border-b border-github-border",children:[h.jsx("div",{className:"bg-github-bg-tertiary px-3 py-2 border-b border-github-border",children:h.jsx("code",{className:"text-github-text-secondary text-xs font-mono",children:ee.header})}),h.jsx(hx,{chunk:ee,chunkIndex:oe,comments:r,onAddComment:(le,P,se,F)=>ce(le,P,se,ee.header,F),onGeneratePrompt:m,onRemoveComment:S,onUpdateComment:y,mode:s,syntaxTheme:C,cursor:v,fileIndex:T,onLineClick:N,commentTrigger:A?.chunkIndex===oe?A:null,onCommentTriggerHandled:D,filename:a.path})]},oe))})]})}function bx(a){const r={name:"",path:"",isDirectory:!0,children:[]};a.forEach(o=>{const c=o.path.split("/");let f=r;for(let d=0;d<c.length;d++){const p=c[d];if(!p)continue;const b=d===c.length-1,m=c.slice(0,d+1).join("/");f.children||(f.children=[]);let S=f.children.find(y=>y.name===p);S||(S={name:p,path:m,isDirectory:!b,children:b?void 0:[],file:b?o:void 0},f.children.push(S)),f=S}});const s=o=>{if(!o.isDirectory||!o.children)return o;if(o.children=o.children.map(s),o.children.length===1&&o.children[0]?.isDirectory&&o.children[0]?.children){const c=o.children[0];if(c)return o.name?{...o,name:`${o.name}/${c.name}`,path:c.path,children:c.children}:o}return o};return s(r)}function yx({files:a,onScrollToFile:r,comments:s,reviewedFiles:o,onToggleReviewed:c,selectedFileIndex:f}){const d=bx(a),p=L=>{if(!L.isDirectory||!L.children)return[];const Q=[];return L.path&&Q.push(L.path),L.children.forEach(Y=>{Q.push(...p(Y))}),Q},[b,m]=R.useState(()=>new Set(p(d))),[S,y]=R.useState(""),C=L=>s.filter(Q=>Q.file===L).length,_=L=>{if(!S.trim())return L;if(L.isDirectory&&L.children){const Q=L.children.map(Y=>_(Y)).filter(Y=>Y!==null);return Q.length>0?{...L,children:Q}:null}else if(L.file)return L.file.path.toLowerCase().includes(S.toLowerCase())?L:null;return null},x=_(d)||{...d,children:[]},v=L=>{switch(L){case"added":return h.jsx(sp,{size:16,className:"text-github-accent"});case"deleted":return h.jsx(up,{size:16,className:"text-github-danger"});case"renamed":return h.jsx(op,{size:16,className:"text-github-warning"});default:return h.jsx(ip,{size:16,className:"text-github-text-secondary"})}},T=L=>{m(Q=>{const Y=new Set(Q);return Y.has(L)?Y.delete(L):Y.add(L),Y})},N=p(d),A=b.size===N.length&&N.length>0,D=()=>{m(A?new Set:new Set(N))},z=(L,Q=0)=>{if(L.isDirectory&&L.children){const Y=b.has(L.path);return h.jsxs("div",{children:[L.name&&h.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 hover:bg-github-bg-tertiary cursor-pointer",style:{paddingLeft:`${Q*16+16}px`},onClick:()=>T(L.path),children:[Y?h.jsx(Co,{size:16}):h.jsx(ap,{size:16}),Y?h.jsx(hv,{size:16,className:"text-github-text-secondary"}):h.jsx(pv,{size:16,className:"text-github-text-secondary"}),h.jsx("span",{className:"text-sm text-github-text-primary font-medium flex-1 overflow-hidden text-ellipsis whitespace-nowrap",title:L.name,children:L.name})]}),(Y||!L.name)&&L.children.map(ce=>z(ce,Q+1))]},L.path)}else if(L.file){const Y=L.file,ce=C(Y.path),ee=o.has(Y.path),oe=a.findIndex(P=>P.path===Y.path),le=f!==null&&f===oe;return h.jsxs("div",{className:`flex items-center gap-2 px-4 py-2 hover:bg-github-bg-tertiary cursor-pointer transition-colors ${ee?"opacity-70":""} ${le?"bg-github-bg-tertiary":""}`,style:{paddingLeft:`${Q*16+16}px`},onClick:()=>r(Y.path),children:[h.jsx(dp,{checked:ee,onChange:()=>{c(Y.path)},title:ee?"Mark as not reviewed":"Mark as reviewed",className:"z-10"}),v(L.file.status),h.jsx("span",{className:`text-sm text-github-text-primary flex-1 overflow-hidden text-ellipsis whitespace-nowrap ${ee?"line-through text-github-text-muted":""}`,title:L.file.path,children:L.name}),ce>0&&h.jsxs("span",{className:"text-github-warning text-sm font-medium ml-auto flex items-center gap-1",children:[h.jsx(cp,{size:14}),ce]})]},Y.path)}return null};return h.jsxs("div",{className:"h-full flex flex-col",children:[h.jsxs("div",{className:"px-4 py-3 border-b border-github-border bg-github-bg-tertiary",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsxs("h3",{className:"text-sm font-semibold text-github-text-primary m-0",children:["Files changed (",a.length,")"]}),h.jsx("button",{onClick:D,className:"p-1 hover:bg-github-bg-primary rounded transition-colors",title:A?"Collapse all":"Expand all",children:A?h.jsx(lv,{size:16,className:"text-github-text-secondary"}):h.jsx(tv,{size:16,className:"text-github-text-secondary"})})]}),h.jsxs("div",{className:"relative",children:[h.jsx(Ov,{size:16,className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-github-text-muted"}),h.jsx("input",{type:"text",placeholder:"Filter files...",value:S,onChange:L=>y(L.target.value),className:"w-full pl-9 pr-3 py-2 text-sm bg-github-bg-primary border border-github-border rounded-md focus:outline-none focus:border-github-accent text-github-text-primary placeholder-github-text-muted"})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto",children:x.children?.map(L=>z(L))})]})}function vx({style:a}){return h.jsx("svg",{width:"98",height:"96",viewBox:"0, 0, 98, 96",style:a,xmlns:"http://www.w3.org/2000/svg","aria-label":"GitHub",role:"img",children:h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})})}function xx({isOpen:a,onClose:r}){const{enableScope:s,disableScope:o}=Ao();return Ye("escape",()=>r(),{enabled:a},[r,a]),R.useEffect(()=>(a?o("navigation"):s("navigation"),()=>{s("navigation")}),[a,s,o]),a?h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:r}),h.jsxs("div",{className:"relative bg-github-bg-primary border border-github-border rounded-lg shadow-lg max-w-4xl w-full mx-4 max-h-[80vh] overflow-y-auto",children:[h.jsxs("div",{className:"sticky top-0 bg-github-bg-primary border-b border-github-border px-6 py-4 flex items-center justify-between",children:[h.jsx("h2",{className:"text-lg font-semibold text-github-text-primary",children:"Keyboard Shortcuts"}),h.jsx("button",{onClick:r,className:"text-github-text-secondary hover:text-github-text-primary transition-colors","aria-label":"Close help modal",children:h.jsx(kc,{size:20})})]}),h.jsxs("div",{className:"px-6 py-4 grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsxs("section",{children:[h.jsx("h3",{className:"text-sm font-semibold text-github-text-primary mb-2",children:"Line Navigation"}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"j"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"↓"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Next line"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"k"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"↑"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Previous line"})]})]})]}),h.jsxs("section",{children:[h.jsx("h3",{className:"text-sm font-semibold text-github-text-primary mb-2",children:"File Navigation"}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"]"}),h.jsx("span",{className:"text-github-text-secondary",children:"Next file"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"["}),h.jsx("span",{className:"text-github-text-secondary",children:"Previous file"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"Shift"}),h.jsx("span",{className:"text-github-text-muted",children:"+"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"["})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Jump to first file"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"Shift"}),h.jsx("span",{className:"text-github-text-muted",children:"+"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"]"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Jump to last file"})]})]})]}),h.jsxs("section",{children:[h.jsx("h3",{className:"text-sm font-semibold text-github-text-primary mb-2",children:"Chunk Navigation"}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"n"}),h.jsx("span",{className:"text-github-text-secondary",children:"Next change chunk (added/deleted lines)"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"p"}),h.jsx("span",{className:"text-github-text-secondary",children:"Previous change chunk (added/deleted lines)"})]})]})]}),h.jsxs("section",{children:[h.jsx("h3",{className:"text-sm font-semibold text-github-text-primary mb-2",children:"Comment Navigation"}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"N"}),h.jsx("span",{className:"text-github-text-secondary",children:"Next comment"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"P"}),h.jsx("span",{className:"text-github-text-secondary",children:"Previous comment"})]})]})]}),h.jsxs("section",{children:[h.jsx("h3",{className:"text-sm font-semibold text-github-text-primary mb-2",children:"Side Navigation (Side-by-side mode)"}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"h"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"←"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Focus left side"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"l"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"→"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Focus right side"})]})]})]}),h.jsxs("section",{children:[h.jsx("h3",{className:"text-sm font-semibold text-github-text-primary mb-2",children:"Comment Management"}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"Shift"}),h.jsx("span",{className:"text-github-text-muted",children:"+"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"L"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"View all comments list"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"Shift"}),h.jsx("span",{className:"text-github-text-muted",children:"+"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"C"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Copy all comments prompt"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"Shift"}),h.jsx("span",{className:"text-github-text-muted",children:"+"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"D"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Delete all comments"})]})]})]}),h.jsxs("section",{children:[h.jsx("h3",{className:"text-sm font-semibold text-github-text-primary mb-2",children:"Actions"}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"v"}),h.jsx("span",{className:"text-github-text-secondary",children:"Toggle viewed state of current file"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"Shift"}),h.jsx("span",{className:"text-github-text-muted",children:"+"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"R"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Refresh diff when changes detected"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"c"}),h.jsx("span",{className:"text-github-text-secondary",children:"Add comment at current line"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"."}),h.jsx("span",{className:"text-github-text-secondary",children:"Move cursor to center of viewport"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"?"}),h.jsx("span",{className:"text-github-text-secondary",children:"Show/hide this help"})]})]})]}),h.jsx("div",{className:"pt-4 border-t border-github-border lg:col-span-2",children:h.jsx("p",{className:"text-xs text-github-text-secondary",children:"Shortcuts are disabled when typing in input fields."})})]})]})]}):null}function Sx({style:a}){return h.jsxs("svg",{style:a,viewBox:"0 0 720 190",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-label":"difit",role:"img",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M440.487 5.90627C432.164 9.01695 427.318 16.2817 427.318 25.649C427.318 35.9474 433.206 43.6458 442.714 45.7819C451.336 47.7188 459.606 44.3893 464.84 36.8737C466.923 33.8843 467.35 32.4073 467.606 27.3105C467.773 23.9957 467.492 20.0154 466.983 18.4654C465.699 14.5629 460.869 9.13088 456.854 7.07513C452.57 4.88086 444.73 4.32102 440.487 5.90627ZM596.658 6.653C588.927 9.55794 584.572 15.4908 583.887 24.0465C583.17 33.0212 586.83 39.8868 594.382 43.7278C603.739 48.4877 615.574 44.5081 620.482 34.9515C625.35 25.4728 622.15 13.4916 613.37 8.32678C608.986 5.74808 601.154 4.96365 596.658 6.653ZM368.585 7.68006C367.464 8.80629 367.302 12.903 367.302 40.2286V71.4878L363.832 68.1329C353.432 58.0787 335.595 52.668 319.246 54.6082C310.542 55.641 299.81 59.1369 293.3 63.0607C278.56 71.9427 266.453 89.5576 263.139 106.945C261.765 114.155 261.602 129.431 262.825 136.365C265.723 152.796 274.795 168.36 286.716 177.355C298.275 186.077 310.237 190 325.274 190C340.687 190 353.943 185.273 362.869 176.594L367.302 172.284V178.215C367.302 186.902 366.946 186.724 384.303 186.709C392.243 186.702 399.29 186.347 399.964 185.919C401.04 185.236 401.189 174.47 401.189 97.1224C401.189 23.7236 401.003 8.87842 400.068 7.74809C398.433 5.77021 370.547 5.71037 368.585 7.68006ZM526.937 7.94153C519.783 10.0325 515.359 12.5834 510.029 17.6867C501.959 25.4129 498.766 34.4597 498.766 49.5975V58.8517H490.659C484.378 58.8517 482.263 59.1418 481.268 60.1394C480.214 61.1976 479.986 63.6558 479.986 73.91C479.986 82.5264 480.289 86.6977 480.966 87.3764C481.601 88.0141 484.903 88.36 490.356 88.36H498.766V136.692C498.766 183.638 498.811 185.048 500.345 185.873C502.433 186.994 529.394 186.994 531.482 185.873C533.016 185.048 533.061 183.638 533.061 136.692V88.36H549.334C563.038 88.36 565.809 88.1568 566.89 87.0723C568.782 85.1723 568.782 62.0394 566.89 60.1394C565.808 59.0541 563.029 58.8517 549.231 58.8517H532.856L533.216 51.9721C533.604 44.5499 534.721 41.9147 538.546 39.3958C540.377 38.1901 543.049 37.904 554.661 37.6737C562.626 37.5155 569.018 37.0343 569.602 36.5483C570.892 35.4761 571.046 10.3579 569.777 7.9776C568.978 6.47923 567.918 6.39562 550.384 6.45054C535.269 6.49808 530.93 6.77431 526.937 7.94153ZM654.931 26.4834C653.136 27.7662 653.094 28.1572 653.094 43.3245V58.8517H644.567C633.342 58.8517 633.497 58.6443 633.497 73.6059C633.497 88.5674 633.342 88.36 644.567 88.36H653.094V122.636C653.094 159.998 653.439 163.935 657.362 171.354C661.848 179.838 669.111 184.99 680.857 188.022C687.996 189.866 707.647 189.269 714.309 187.007C719.756 185.158 719.86 184.87 719.969 171.298C720.082 157.364 720.441 157.791 709.174 158.48C695.386 159.324 689.341 156.938 687.388 149.883C686.927 148.214 686.58 134.435 686.577 117.663L686.572 88.36H702.068H717.564L718.87 86.3592C719.946 84.7108 720.129 82.3461 719.91 72.9575C719.719 64.8279 719.321 61.1689 718.522 60.2041C717.553 59.0345 715.315 58.8517 701.987 58.8517H686.572L686.546 43.8926C686.526 31.8556 686.28 28.613 685.288 27.2941C684.156 25.7884 682.945 25.6351 670.412 25.4129C658.94 25.2088 656.476 25.3793 654.931 26.4834ZM431.459 60.1394C430.316 61.2877 430.178 68.0001 430.188 121.82C430.197 168.838 430.429 182.667 431.232 184.262L432.264 186.311L446.657 186.535C458.941 186.725 461.242 186.567 462.353 185.452C463.521 184.279 463.655 177.845 463.655 122.786C463.655 68.0985 463.515 61.2877 462.372 60.1394C460.469 58.2287 433.362 58.2287 431.459 60.1394ZM587.799 60.4369C587.238 61.4894 586.954 82.56 586.954 123.084C586.954 177.502 587.093 184.285 588.236 185.434C590.138 187.342 616.431 187.342 618.333 185.434C619.476 184.285 619.615 177.447 619.615 122.482C619.615 75.6149 619.38 60.5828 618.636 59.8353C617.947 59.1443 613.344 58.8517 603.15 58.8517C589.644 58.8517 588.586 58.9607 587.799 60.4369ZM347.956 87.3469C362.023 93.9543 369.138 107.306 367.775 124.535C366.623 139.097 359.678 149.866 347.83 155.463C337.073 160.544 325.541 160.523 315.049 155.403C293.381 144.83 288.765 112.315 306.417 94.5961C313.92 87.0641 322.021 84.1412 334.301 84.5354C341.49 84.7666 343.224 85.124 347.956 87.3469Z",fill:"currentColor"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.42299 0.744751C4.61699 2.15275 2.03999 5.66375 0.956994 12.2768C-0.369006 20.3728 -0.294006 170.791 1.03899 176.572C2.29699 182.031 4.81699 185.308 9.65399 187.774C13.265 189.615 16.865 189.684 108.63 189.684C163.129 189.684 204.095 189.304 204.41 188.795C206 188.5 206 188.795 207.5 188C211.167 187.079 216.779 180.138 218.005 175.584C218.682 173.068 218.939 143.952 218.756 90.4718C218.487 11.7478 218.417 9.10275 216.535 6.62675C215.466 5.22075 213.441 3.19575 212.035 2.12675C209.546 0.23575 206.839 0.17975 110.978 0.0167504C55.373 -0.0782496 11.148 0.239751 9.42299 0.744751ZM203.778 14.8838C205.558 16.6638 205.509 172.577 203.728 175.005C202.577 176.574 198.865 176.688 156.978 176.446L111.478 176.184L111.226 138.684L110.974 101.184H84.059C69.255 101.184 56.808 101.52 56.397 101.931C55.986 102.343 60.674 107.82 66.814 114.104C72.954 120.388 77.978 126.202 77.978 127.026C77.978 129.577 74.769 134.267 71.896 135.916C69.609 137.229 68.75 137.278 66.704 136.217C63.533 134.572 28.705 99.1448 27.757 96.5998C27.36 95.5348 27.491 93.4308 28.049 91.9238C28.955 89.4768 68.498 49.6838 70.024 49.6838C70.366 49.6838 72.356 51.1627 74.447 52.9697C77.589 55.6867 78.118 56.6658 77.498 58.6198C77.086 59.9198 72.075 65.8308 66.363 71.7568C60.651 77.6818 55.978 83.0148 55.978 83.6068C55.978 84.3488 64.068 84.6838 81.952 84.6838H107.927H110.666C111.144 82.5 110.978 73.4537 110.978 46.2337V13.6838H156.778C191.067 13.6838 202.88 13.9858 203.778 14.8838ZM148.803 52.7217C146.51 54.0597 144.845 59.5997 145.74 62.9107C146.146 64.4107 150.657 69.9308 155.764 75.1788C161.411 80.9788 164.547 84.8988 163.764 85.1788C163.057 85.4318 151.549 85.7608 138.19 85.9108C117.896 86.1388 113.747 86.4308 112.956 87.6838C112.435 88.5088 112.002 91.7228 111.993 94.8268C111.982 99.0598 112.373 100.622 113.56 101.077C114.43 101.411 126.13 101.684 139.56 101.684C156.121 101.684 163.978 102.026 163.978 102.746C163.978 103.33 160.187 107.607 155.554 112.251C146.244 121.582 144.276 125.371 146.069 130.514C147.321 134.107 149.576 135.684 153.463 135.684C155.522 135.684 159.843 131.902 173.778 117.904C191.699 99.9008 194.978 96.0678 194.978 93.1208C194.978 91.1338 157.422 53.8238 154.163 52.5728C151.322 51.4818 150.908 51.4937 148.803 52.7217Z",fill:"currentColor"})]})}function Ex({shouldReload:a,isReloading:r,onReload:s,changeType:o,className:c=""}){if(!a)return null;const f=()=>{switch(o){case"commit":return"New commits available";case"staging":return"Staging changes detected";case"file":return"File changes detected";default:return"Changes detected"}};return h.jsxs("button",{onClick:s,disabled:r,className:`
17
+ `,backgroundSize:"20px 20px",backgroundPosition:"0 0, 10px 10px",backgroundColor:"white"};return c?h.jsx("div",{className:"bg-github-bg-primary p-4",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"mb-2",children:h.jsx("span",{className:"text-github-danger font-medium",children:"Deleted Image"})}),h.jsxs("div",{className:"inline-block border border-github-border rounded-md p-4 bg-github-bg-secondary",children:[h.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"Previous version:"}),h.jsx("img",{src:`/api/blob/${a.oldPath||a.path}?ref=${p}`,alt:`Previous version of ${a.oldPath||a.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:T,onLoad:N=>_(N.currentTarget,S),onError:N=>{const A=N.target;A.style.display="none",A.nextElementSibling?.classList.remove("hidden")}}),h.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(m.width||m.size)&&h.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[v(m),v(m)&&x(m.size)&&" | ",x(m.size)]})]})]})}):f?h.jsx("div",{className:"bg-github-bg-primary p-4",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"mb-2",children:h.jsx("span",{className:"text-github-accent font-medium",children:"Added Image"})}),h.jsxs("div",{className:"inline-block border border-github-border rounded-md p-4 bg-github-bg-secondary",children:[h.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"New file:"}),h.jsx("img",{src:`/api/blob/${a.path}?ref=${b}`,alt:`New image ${a.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:T,onLoad:N=>_(N.currentTarget,C),onError:N=>{const A=N.target;A.style.display="none",A.nextElementSibling?.classList.remove("hidden")}}),h.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(y.width||y.size)&&h.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[v(y),v(y)&&x(y.size)&&" | ",x(y.size)]})]})]})}):d?r==="side-by-side"?h.jsxs("div",{className:"bg-github-bg-primary p-4",children:[h.jsx("div",{className:"text-center mb-4",children:h.jsx("span",{className:"text-github-text-primary font-medium",children:"Modified Image"})}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsx("div",{className:"text-center",children:h.jsxs("div",{className:"border border-github-border rounded-md p-4 bg-github-bg-secondary",children:[h.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"Previous version:"}),h.jsx("img",{src:`/api/blob/${a.oldPath||a.path}?ref=${p}`,alt:`Previous version of ${a.oldPath||a.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:T,onLoad:N=>_(N.currentTarget,S),onError:N=>{const A=N.target;A.style.display="none",A.nextElementSibling?.classList.remove("hidden")}}),h.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(m.width||m.size)&&h.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[v(m),v(m)&&x(m.size)&&" | ",x(m.size)]})]})}),h.jsx("div",{className:"text-center",children:h.jsxs("div",{className:"border border-github-border rounded-md p-4 bg-github-bg-secondary",children:[h.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"Current version:"}),h.jsx("img",{src:`/api/blob/${a.path}?ref=${b}`,alt:`Current version of ${a.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:T,onLoad:N=>_(N.currentTarget,C),onError:N=>{const A=N.target;A.style.display="none",A.nextElementSibling?.classList.remove("hidden")}}),h.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(y.width||y.size)&&h.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[v(y),v(y)&&x(y.size)&&" | ",x(y.size)]})]})})]})]}):h.jsxs("div",{className:"bg-github-bg-primary p-4",children:[h.jsx("div",{className:"text-center mb-4",children:h.jsx("span",{className:"text-github-text-primary font-medium",children:"Modified Image"})}),h.jsxs("div",{className:"space-y-6",children:[h.jsx("div",{className:"text-center",children:h.jsxs("div",{className:"border border-github-border rounded-md p-4 bg-github-bg-secondary inline-block",children:[h.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"Previous version:"}),h.jsx("img",{src:`/api/blob/${a.oldPath||a.path}?ref=${p}`,alt:`Previous version of ${a.oldPath||a.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:T,onLoad:N=>_(N.currentTarget,S),onError:N=>{const A=N.target;A.style.display="none",A.nextElementSibling?.classList.remove("hidden")}}),h.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(m.width||m.size)&&h.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[v(m),v(m)&&x(m.size)&&" | ",x(m.size)]})]})}),h.jsx("div",{className:"text-center",children:h.jsxs("div",{className:"border border-github-border rounded-md p-4 bg-github-bg-secondary inline-block",children:[h.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"Current version:"}),h.jsx("img",{src:`/api/blob/${a.path}?ref=${b}`,alt:`Current version of ${a.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:T,onLoad:N=>_(N.currentTarget,C),onError:N=>{const A=N.target;A.style.display="none",A.nextElementSibling?.classList.remove("hidden")}}),h.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(y.width||y.size)&&h.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[v(y),v(y)&&x(y.size)&&" | ",x(y.size)]})]})})]})]}):null}function px({file:a,comments:r,diffMode:s,reviewedFiles:o,onToggleReviewed:c,collapsedFiles:f,onToggleCollapsed:d,onToggleAllCollapsed:p,onAddComment:b,onGeneratePrompt:m,onRemoveComment:S,onUpdateComment:y,syntaxTheme:C,baseCommitish:_,targetCommitish:x,cursor:v=null,fileIndex:T=0,onLineClick:N,commentTrigger:A,onCommentTriggerHandled:D}){const z=f.has(a.path),[L,Q]=R.useState(!1),Y=ee=>{switch(ee){case"added":return h.jsx(sp,{size:16,className:"text-github-accent"});case"deleted":return h.jsx(up,{size:16,className:"text-github-danger"});case"renamed":return h.jsx(op,{size:16,className:"text-github-warning"});default:return h.jsx(ip,{size:16,className:"text-github-text-secondary"})}},ce=async(ee,oe,le,P,se)=>{try{await b(a.path,ee,oe,le,P,se)}catch(F){console.error("Failed to add comment:",F)}};return h.jsxs("div",{className:"bg-github-bg-primary",children:[h.jsxs("div",{className:"bg-github-bg-secondary border-t-2 border-t-github-accent border-b border-github-border px-5 py-4 flex items-center justify-between flex-wrap gap-3 sticky top-0 z-10",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[h.jsx("button",{onClick:ee=>{ee.altKey?p(!z):d(a.path)},className:"text-github-text-muted hover:text-github-text-primary transition-colors cursor-pointer",title:z?"Expand file (Alt+Click to expand all)":"Collapse file (Alt+Click to collapse all)",children:z?h.jsx(ap,{size:16}):h.jsx(Co,{size:16})}),Y(a.status),h.jsx("h2",{className:"text-sm font-mono text-github-text-primary m-0 overflow-hidden text-ellipsis whitespace-nowrap",children:a.path}),h.jsx("button",{className:`bg-transparent border-none cursor-pointer px-1.5 py-1 rounded text-sm transition-all hover:bg-github-bg-tertiary ${L?"text-github-accent":"text-github-text-secondary hover:text-github-text-primary"}`,onClick:()=>{navigator.clipboard.writeText(a.path).then(()=>{console.log("File path copied to clipboard:",a.path),Q(!0),setTimeout(()=>Q(!1),2e3)}).catch(ee=>{console.error("Failed to copy file path:",ee)})},title:"Copy file path",children:L?h.jsx(Ur,{size:14}):h.jsx(rp,{size:14})}),a.oldPath&&a.oldPath!==a.path&&h.jsxs("span",{className:"text-xs text-github-text-muted italic",children:["(renamed from ",a.oldPath,")"]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[h.jsxs("span",{className:"font-medium px-1 py-0.5 rounded text-github-accent bg-green-100/10",children:["+",a.additions]}),h.jsxs("span",{className:"font-medium px-1 py-0.5 rounded text-github-danger bg-red-100/10",children:["-",a.deletions]})]}),h.jsxs("button",{onClick:()=>c(a.path),className:`flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-all duration-200 ${o.has(a.path)?"bg-github-accent text-white":"dark:bg-slate-600 dark:text-white dark:border-slate-500 dark:hover:bg-slate-500 dark:hover:border-slate-400 bg-github-bg-secondary text-github-text-primary border border-github-border hover:bg-github-bg-tertiary hover:border-github-text-muted"}`,title:o.has(a.path)?"Mark as not reviewed":"Mark as reviewed",children:[o.has(a.path)?h.jsx(Ur,{size:14}):h.jsx(Mv,{size:14}),"Viewed"]})]})]}),!z&&h.jsx("div",{className:"overflow-y-auto",children:Gv(a.path)?h.jsx(mx,{file:a,mode:s,baseCommitish:_,targetCommitish:x}):a.chunks.map((ee,oe)=>h.jsxs("div",{id:`chunk-${a.path.replace(/[^a-zA-Z0-9]/g,"-")}-${oe}`,className:"border-b border-github-border",children:[h.jsx("div",{className:"bg-github-bg-tertiary px-3 py-2 border-b border-github-border",children:h.jsx("code",{className:"text-github-text-secondary text-xs font-mono",children:ee.header})}),h.jsx(hx,{chunk:ee,chunkIndex:oe,comments:r,onAddComment:(le,P,se,F)=>ce(le,P,se,ee.header,F),onGeneratePrompt:m,onRemoveComment:S,onUpdateComment:y,mode:s,syntaxTheme:C,cursor:v,fileIndex:T,onLineClick:N,commentTrigger:A?.chunkIndex===oe?A:null,onCommentTriggerHandled:D,filename:a.path})]},oe))})]})}function bx(a){const r={name:"",path:"",isDirectory:!0,children:[]};a.forEach(o=>{const c=o.path.split("/");let f=r;for(let d=0;d<c.length;d++){const p=c[d];if(!p)continue;const b=d===c.length-1,m=c.slice(0,d+1).join("/");f.children||(f.children=[]);let S=f.children.find(y=>y.name===p);S||(S={name:p,path:m,isDirectory:!b,children:b?void 0:[],file:b?o:void 0},f.children.push(S)),f=S}});const s=o=>{if(!o.isDirectory||!o.children)return o;if(o.children=o.children.map(s),o.children.length===1&&o.children[0]?.isDirectory&&o.children[0]?.children){const c=o.children[0];if(c)return o.name?{...o,name:`${o.name}/${c.name}`,path:c.path,children:c.children}:o}return o};return s(r)}function yx({files:a,onScrollToFile:r,comments:s,reviewedFiles:o,onToggleReviewed:c,selectedFileIndex:f}){const d=bx(a),p=L=>{if(!L.isDirectory||!L.children)return[];const Q=[];return L.path&&Q.push(L.path),L.children.forEach(Y=>{Q.push(...p(Y))}),Q},[b,m]=R.useState(()=>new Set(p(d))),[S,y]=R.useState(""),C=L=>s.filter(Q=>Q.file===L).length,_=L=>{if(!S.trim())return L;if(L.isDirectory&&L.children){const Q=L.children.map(Y=>_(Y)).filter(Y=>Y!==null);return Q.length>0?{...L,children:Q}:null}else if(L.file)return L.file.path.toLowerCase().includes(S.toLowerCase())?L:null;return null},x=_(d)||{...d,children:[]},v=L=>{switch(L){case"added":return h.jsx(sp,{size:16,className:"text-github-accent"});case"deleted":return h.jsx(up,{size:16,className:"text-github-danger"});case"renamed":return h.jsx(op,{size:16,className:"text-github-warning"});default:return h.jsx(ip,{size:16,className:"text-github-text-secondary"})}},T=L=>{m(Q=>{const Y=new Set(Q);return Y.has(L)?Y.delete(L):Y.add(L),Y})},N=p(d),A=b.size===N.length&&N.length>0,D=()=>{m(A?new Set:new Set(N))},z=(L,Q=0)=>{if(L.isDirectory&&L.children){const Y=b.has(L.path);return h.jsxs("div",{children:[L.name&&h.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 hover:bg-github-bg-tertiary cursor-pointer",style:{paddingLeft:`${Q*16+16}px`},onClick:()=>T(L.path),children:[Y?h.jsx(Co,{size:16}):h.jsx(ap,{size:16}),Y?h.jsx(hv,{size:16,className:"text-github-text-secondary"}):h.jsx(pv,{size:16,className:"text-github-text-secondary"}),h.jsx("span",{className:"text-sm text-github-text-primary font-medium flex-1 overflow-hidden text-ellipsis whitespace-nowrap",title:L.name,children:L.name})]}),(Y||!L.name)&&L.children.map(ce=>z(ce,Q+1))]},L.path)}else if(L.file){const Y=L.file,ce=C(Y.path),ee=o.has(Y.path),oe=a.findIndex(P=>P.path===Y.path),le=f!==null&&f===oe;return h.jsxs("div",{className:`flex items-center gap-2 px-4 py-2 hover:bg-github-bg-tertiary cursor-pointer transition-colors ${ee?"opacity-70":""} ${le?"bg-github-bg-tertiary":""}`,style:{paddingLeft:`${Q*16+16}px`},onClick:()=>r(Y.path),children:[h.jsx(dp,{checked:ee,onChange:()=>{c(Y.path)},title:ee?"Mark as not reviewed":"Mark as reviewed",className:"z-10"}),v(L.file.status),h.jsx("span",{className:`text-sm text-github-text-primary flex-1 overflow-hidden text-ellipsis whitespace-nowrap ${ee?"line-through text-github-text-muted":""}`,title:L.file.path,children:L.name}),ce>0&&h.jsxs("span",{className:"text-github-warning text-sm font-medium ml-auto flex items-center gap-1",children:[h.jsx(cp,{size:14}),ce]})]},Y.path)}return null};return h.jsxs("div",{className:"h-full flex flex-col",children:[h.jsxs("div",{className:"px-4 py-3 border-b border-github-border bg-github-bg-tertiary",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsxs("h3",{className:"text-sm font-semibold text-github-text-primary m-0",children:["Files changed (",a.length,")"]}),h.jsx("button",{onClick:D,className:"p-1 hover:bg-github-bg-primary rounded transition-colors",title:A?"Collapse all":"Expand all",children:A?h.jsx(tv,{size:16,className:"text-github-text-secondary"}):h.jsx(lv,{size:16,className:"text-github-text-secondary"})})]}),h.jsxs("div",{className:"relative",children:[h.jsx(Ov,{size:16,className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-github-text-muted"}),h.jsx("input",{type:"text",placeholder:"Filter files...",value:S,onChange:L=>y(L.target.value),className:"w-full pl-9 pr-3 py-2 text-sm bg-github-bg-primary border border-github-border rounded-md focus:outline-none focus:border-github-accent text-github-text-primary placeholder-github-text-muted"})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto",children:x.children?.map(L=>z(L))})]})}function vx({style:a}){return h.jsx("svg",{width:"98",height:"96",viewBox:"0, 0, 98, 96",style:a,xmlns:"http://www.w3.org/2000/svg","aria-label":"GitHub",role:"img",children:h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})})}function xx({isOpen:a,onClose:r}){const{enableScope:s,disableScope:o}=Ao();return Ye("escape",()=>r(),{enabled:a},[r,a]),R.useEffect(()=>(a?o("navigation"):s("navigation"),()=>{s("navigation")}),[a,s,o]),a?h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:r}),h.jsxs("div",{className:"relative bg-github-bg-primary border border-github-border rounded-lg shadow-lg max-w-4xl w-full mx-4 max-h-[80vh] overflow-y-auto",children:[h.jsxs("div",{className:"sticky top-0 bg-github-bg-primary border-b border-github-border px-6 py-4 flex items-center justify-between",children:[h.jsx("h2",{className:"text-lg font-semibold text-github-text-primary",children:"Keyboard Shortcuts"}),h.jsx("button",{onClick:r,className:"text-github-text-secondary hover:text-github-text-primary transition-colors","aria-label":"Close help modal",children:h.jsx(kc,{size:20})})]}),h.jsxs("div",{className:"px-6 py-4 grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsxs("section",{children:[h.jsx("h3",{className:"text-sm font-semibold text-github-text-primary mb-2",children:"Line Navigation"}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"j"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"↓"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Next line"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"k"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"↑"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Previous line"})]})]})]}),h.jsxs("section",{children:[h.jsx("h3",{className:"text-sm font-semibold text-github-text-primary mb-2",children:"File Navigation"}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"]"}),h.jsx("span",{className:"text-github-text-secondary",children:"Next file"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"["}),h.jsx("span",{className:"text-github-text-secondary",children:"Previous file"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"Shift"}),h.jsx("span",{className:"text-github-text-muted",children:"+"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"["})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Jump to first file"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"Shift"}),h.jsx("span",{className:"text-github-text-muted",children:"+"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"]"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Jump to last file"})]})]})]}),h.jsxs("section",{children:[h.jsx("h3",{className:"text-sm font-semibold text-github-text-primary mb-2",children:"Chunk Navigation"}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"n"}),h.jsx("span",{className:"text-github-text-secondary",children:"Next change chunk (added/deleted lines)"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"p"}),h.jsx("span",{className:"text-github-text-secondary",children:"Previous change chunk (added/deleted lines)"})]})]})]}),h.jsxs("section",{children:[h.jsx("h3",{className:"text-sm font-semibold text-github-text-primary mb-2",children:"Comment Navigation"}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"N"}),h.jsx("span",{className:"text-github-text-secondary",children:"Next comment"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"P"}),h.jsx("span",{className:"text-github-text-secondary",children:"Previous comment"})]})]})]}),h.jsxs("section",{children:[h.jsx("h3",{className:"text-sm font-semibold text-github-text-primary mb-2",children:"Side Navigation (Side-by-side mode)"}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"h"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"←"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Focus left side"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"l"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"→"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Focus right side"})]})]})]}),h.jsxs("section",{children:[h.jsx("h3",{className:"text-sm font-semibold text-github-text-primary mb-2",children:"Comment Management"}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"Shift"}),h.jsx("span",{className:"text-github-text-muted",children:"+"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"L"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"View all comments list"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"Shift"}),h.jsx("span",{className:"text-github-text-muted",children:"+"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"C"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Copy all comments prompt"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"Shift"}),h.jsx("span",{className:"text-github-text-muted",children:"+"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"D"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Delete all comments"})]})]})]}),h.jsxs("section",{children:[h.jsx("h3",{className:"text-sm font-semibold text-github-text-primary mb-2",children:"Actions"}),h.jsxs("div",{className:"space-y-1",children:[h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"v"}),h.jsx("span",{className:"text-github-text-secondary",children:"Toggle viewed state of current file"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"Shift"}),h.jsx("span",{className:"text-github-text-muted",children:"+"}),h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"R"})]}),h.jsx("span",{className:"text-github-text-secondary",children:"Refresh diff when changes detected"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"c"}),h.jsx("span",{className:"text-github-text-secondary",children:"Add comment at current line"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"."}),h.jsx("span",{className:"text-github-text-secondary",children:"Move cursor to center of viewport"})]}),h.jsxs("div",{className:"flex justify-between text-sm",children:[h.jsx("kbd",{className:"px-2 py-1 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary font-mono",children:"?"}),h.jsx("span",{className:"text-github-text-secondary",children:"Show/hide this help"})]})]})]}),h.jsx("div",{className:"pt-4 border-t border-github-border lg:col-span-2",children:h.jsx("p",{className:"text-xs text-github-text-secondary",children:"Shortcuts are disabled when typing in input fields."})})]})]})]}):null}function Sx({style:a}){return h.jsxs("svg",{style:a,viewBox:"0 0 720 190",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-label":"difit",role:"img",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M440.487 5.90627C432.164 9.01695 427.318 16.2817 427.318 25.649C427.318 35.9474 433.206 43.6458 442.714 45.7819C451.336 47.7188 459.606 44.3893 464.84 36.8737C466.923 33.8843 467.35 32.4073 467.606 27.3105C467.773 23.9957 467.492 20.0154 466.983 18.4654C465.699 14.5629 460.869 9.13088 456.854 7.07513C452.57 4.88086 444.73 4.32102 440.487 5.90627ZM596.658 6.653C588.927 9.55794 584.572 15.4908 583.887 24.0465C583.17 33.0212 586.83 39.8868 594.382 43.7278C603.739 48.4877 615.574 44.5081 620.482 34.9515C625.35 25.4728 622.15 13.4916 613.37 8.32678C608.986 5.74808 601.154 4.96365 596.658 6.653ZM368.585 7.68006C367.464 8.80629 367.302 12.903 367.302 40.2286V71.4878L363.832 68.1329C353.432 58.0787 335.595 52.668 319.246 54.6082C310.542 55.641 299.81 59.1369 293.3 63.0607C278.56 71.9427 266.453 89.5576 263.139 106.945C261.765 114.155 261.602 129.431 262.825 136.365C265.723 152.796 274.795 168.36 286.716 177.355C298.275 186.077 310.237 190 325.274 190C340.687 190 353.943 185.273 362.869 176.594L367.302 172.284V178.215C367.302 186.902 366.946 186.724 384.303 186.709C392.243 186.702 399.29 186.347 399.964 185.919C401.04 185.236 401.189 174.47 401.189 97.1224C401.189 23.7236 401.003 8.87842 400.068 7.74809C398.433 5.77021 370.547 5.71037 368.585 7.68006ZM526.937 7.94153C519.783 10.0325 515.359 12.5834 510.029 17.6867C501.959 25.4129 498.766 34.4597 498.766 49.5975V58.8517H490.659C484.378 58.8517 482.263 59.1418 481.268 60.1394C480.214 61.1976 479.986 63.6558 479.986 73.91C479.986 82.5264 480.289 86.6977 480.966 87.3764C481.601 88.0141 484.903 88.36 490.356 88.36H498.766V136.692C498.766 183.638 498.811 185.048 500.345 185.873C502.433 186.994 529.394 186.994 531.482 185.873C533.016 185.048 533.061 183.638 533.061 136.692V88.36H549.334C563.038 88.36 565.809 88.1568 566.89 87.0723C568.782 85.1723 568.782 62.0394 566.89 60.1394C565.808 59.0541 563.029 58.8517 549.231 58.8517H532.856L533.216 51.9721C533.604 44.5499 534.721 41.9147 538.546 39.3958C540.377 38.1901 543.049 37.904 554.661 37.6737C562.626 37.5155 569.018 37.0343 569.602 36.5483C570.892 35.4761 571.046 10.3579 569.777 7.9776C568.978 6.47923 567.918 6.39562 550.384 6.45054C535.269 6.49808 530.93 6.77431 526.937 7.94153ZM654.931 26.4834C653.136 27.7662 653.094 28.1572 653.094 43.3245V58.8517H644.567C633.342 58.8517 633.497 58.6443 633.497 73.6059C633.497 88.5674 633.342 88.36 644.567 88.36H653.094V122.636C653.094 159.998 653.439 163.935 657.362 171.354C661.848 179.838 669.111 184.99 680.857 188.022C687.996 189.866 707.647 189.269 714.309 187.007C719.756 185.158 719.86 184.87 719.969 171.298C720.082 157.364 720.441 157.791 709.174 158.48C695.386 159.324 689.341 156.938 687.388 149.883C686.927 148.214 686.58 134.435 686.577 117.663L686.572 88.36H702.068H717.564L718.87 86.3592C719.946 84.7108 720.129 82.3461 719.91 72.9575C719.719 64.8279 719.321 61.1689 718.522 60.2041C717.553 59.0345 715.315 58.8517 701.987 58.8517H686.572L686.546 43.8926C686.526 31.8556 686.28 28.613 685.288 27.2941C684.156 25.7884 682.945 25.6351 670.412 25.4129C658.94 25.2088 656.476 25.3793 654.931 26.4834ZM431.459 60.1394C430.316 61.2877 430.178 68.0001 430.188 121.82C430.197 168.838 430.429 182.667 431.232 184.262L432.264 186.311L446.657 186.535C458.941 186.725 461.242 186.567 462.353 185.452C463.521 184.279 463.655 177.845 463.655 122.786C463.655 68.0985 463.515 61.2877 462.372 60.1394C460.469 58.2287 433.362 58.2287 431.459 60.1394ZM587.799 60.4369C587.238 61.4894 586.954 82.56 586.954 123.084C586.954 177.502 587.093 184.285 588.236 185.434C590.138 187.342 616.431 187.342 618.333 185.434C619.476 184.285 619.615 177.447 619.615 122.482C619.615 75.6149 619.38 60.5828 618.636 59.8353C617.947 59.1443 613.344 58.8517 603.15 58.8517C589.644 58.8517 588.586 58.9607 587.799 60.4369ZM347.956 87.3469C362.023 93.9543 369.138 107.306 367.775 124.535C366.623 139.097 359.678 149.866 347.83 155.463C337.073 160.544 325.541 160.523 315.049 155.403C293.381 144.83 288.765 112.315 306.417 94.5961C313.92 87.0641 322.021 84.1412 334.301 84.5354C341.49 84.7666 343.224 85.124 347.956 87.3469Z",fill:"currentColor"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.42299 0.744751C4.61699 2.15275 2.03999 5.66375 0.956994 12.2768C-0.369006 20.3728 -0.294006 170.791 1.03899 176.572C2.29699 182.031 4.81699 185.308 9.65399 187.774C13.265 189.615 16.865 189.684 108.63 189.684C163.129 189.684 204.095 189.304 204.41 188.795C206 188.5 206 188.795 207.5 188C211.167 187.079 216.779 180.138 218.005 175.584C218.682 173.068 218.939 143.952 218.756 90.4718C218.487 11.7478 218.417 9.10275 216.535 6.62675C215.466 5.22075 213.441 3.19575 212.035 2.12675C209.546 0.23575 206.839 0.17975 110.978 0.0167504C55.373 -0.0782496 11.148 0.239751 9.42299 0.744751ZM203.778 14.8838C205.558 16.6638 205.509 172.577 203.728 175.005C202.577 176.574 198.865 176.688 156.978 176.446L111.478 176.184L111.226 138.684L110.974 101.184H84.059C69.255 101.184 56.808 101.52 56.397 101.931C55.986 102.343 60.674 107.82 66.814 114.104C72.954 120.388 77.978 126.202 77.978 127.026C77.978 129.577 74.769 134.267 71.896 135.916C69.609 137.229 68.75 137.278 66.704 136.217C63.533 134.572 28.705 99.1448 27.757 96.5998C27.36 95.5348 27.491 93.4308 28.049 91.9238C28.955 89.4768 68.498 49.6838 70.024 49.6838C70.366 49.6838 72.356 51.1627 74.447 52.9697C77.589 55.6867 78.118 56.6658 77.498 58.6198C77.086 59.9198 72.075 65.8308 66.363 71.7568C60.651 77.6818 55.978 83.0148 55.978 83.6068C55.978 84.3488 64.068 84.6838 81.952 84.6838H107.927H110.666C111.144 82.5 110.978 73.4537 110.978 46.2337V13.6838H156.778C191.067 13.6838 202.88 13.9858 203.778 14.8838ZM148.803 52.7217C146.51 54.0597 144.845 59.5997 145.74 62.9107C146.146 64.4107 150.657 69.9308 155.764 75.1788C161.411 80.9788 164.547 84.8988 163.764 85.1788C163.057 85.4318 151.549 85.7608 138.19 85.9108C117.896 86.1388 113.747 86.4308 112.956 87.6838C112.435 88.5088 112.002 91.7228 111.993 94.8268C111.982 99.0598 112.373 100.622 113.56 101.077C114.43 101.411 126.13 101.684 139.56 101.684C156.121 101.684 163.978 102.026 163.978 102.746C163.978 103.33 160.187 107.607 155.554 112.251C146.244 121.582 144.276 125.371 146.069 130.514C147.321 134.107 149.576 135.684 153.463 135.684C155.522 135.684 159.843 131.902 173.778 117.904C191.699 99.9008 194.978 96.0678 194.978 93.1208C194.978 91.1338 157.422 53.8238 154.163 52.5728C151.322 51.4818 150.908 51.4937 148.803 52.7217Z",fill:"currentColor"})]})}function Ex({shouldReload:a,isReloading:r,onReload:s,changeType:o,className:c=""}){if(!a)return null;const f=()=>{switch(o){case"commit":return"New commits available";case"staging":return"Staging changes detected";case"file":return"File changes detected";default:return"Changes detected"}};return h.jsxs("button",{onClick:s,disabled:r,className:`
18
18
  flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md border ${c}
19
19
  ${r?"bg-github-text-primary text-github-bg-primary border-github-text-primary cursor-not-allowed":"bg-github-text-primary text-github-bg-primary border-github-text-primary"}
20
20
  `,title:`${f()} - Click to refresh`,children:[h.jsx(_v,{size:12,className:`${r?"animate-spin":""}`}),"Refresh"]})}function _o(){return typeof window<"u"}function Nl(a){return zc(a)?(a.nodeName||"").toLowerCase():"#document"}function Ut(a){var r;return(a==null||(r=a.ownerDocument)==null?void 0:r.defaultView)||window}function Sn(a){var r;return(r=(zc(a)?a.ownerDocument:a.document)||window.document)==null?void 0:r.documentElement}function zc(a){return _o()?a instanceof Node||a instanceof Ut(a).Node:!1}function Ze(a){return _o()?a instanceof Element||a instanceof Ut(a).Element:!1}function ut(a){return _o()?a instanceof HTMLElement||a instanceof Ut(a).HTMLElement:!1}function ho(a){return!_o()||typeof ShadowRoot>"u"?!1:a instanceof ShadowRoot||a instanceof Ut(a).ShadowRoot}const wx=new Set(["inline","contents"]);function Fr(a){const{overflow:r,overflowX:s,overflowY:o,display:c}=sn(a);return/auto|scroll|overlay|hidden|clip/.test(r+o+s)&&!wx.has(c)}const Nx=new Set(["table","td","th"]);function Ax(a){return Nx.has(Nl(a))}const Cx=[":popover-open",":modal"];function jo(a){return Cx.some(r=>{try{return a.matches(r)}catch{return!1}})}const Tx=["transform","translate","scale","rotate","perspective"],Rx=["transform","translate","scale","rotate","perspective","filter"],_x=["paint","layout","strict","content"];function Lc(a){const r=Oo(),s=Ze(a)?sn(a):a;return Tx.some(o=>s[o]?s[o]!=="none":!1)||(s.containerType?s.containerType!=="normal":!1)||!r&&(s.backdropFilter?s.backdropFilter!=="none":!1)||!r&&(s.filter?s.filter!=="none":!1)||Rx.some(o=>(s.willChange||"").includes(o))||_x.some(o=>(s.contain||"").includes(o))}function jx(a){let r=Yn(a);for(;ut(r)&&!Gn(r);){if(Lc(r))return r;if(jo(r))return null;r=Yn(r)}return null}function Oo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ox=new Set(["html","body","#document"]);function Gn(a){return Ox.has(Nl(a))}function sn(a){return Ut(a).getComputedStyle(a)}function ko(a){return Ze(a)?{scrollLeft:a.scrollLeft,scrollTop:a.scrollTop}:{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function Yn(a){if(Nl(a)==="html")return a;const r=a.assignedSlot||a.parentNode||ho(a)&&a.host||Sn(a);return ho(r)?r.host:r}function Tp(a){const r=Yn(a);return Gn(r)?a.ownerDocument?a.ownerDocument.body:a.body:ut(r)&&Fr(r)?r:Tp(r)}function wl(a,r,s){var o;r===void 0&&(r=[]),s===void 0&&(s=!0);const c=Tp(a),f=c===((o=a.ownerDocument)==null?void 0:o.body),d=Ut(c);if(f){const p=Ec(d);return r.concat(d,d.visualViewport||[],Fr(c)?c:[],p&&s?wl(p):[])}return r.concat(c,wl(c,[],s))}function Ec(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}const mo=Math.min,Zl=Math.max,po=Math.round,io=Math.floor,xn=a=>({x:a,y:a}),kx={left:"right",right:"left",bottom:"top",top:"bottom"},Dx={start:"end",end:"start"};function fm(a,r,s){return Zl(a,mo(r,s))}function Do(a,r){return typeof a=="function"?a(r):a}function Il(a){return a.split("-")[0]}function Mo(a){return a.split("-")[1]}function Rp(a){return a==="x"?"y":"x"}function _p(a){return a==="y"?"height":"width"}const Mx=new Set(["top","bottom"]);function xl(a){return Mx.has(Il(a))?"y":"x"}function jp(a){return Rp(xl(a))}function zx(a,r,s){s===void 0&&(s=!1);const o=Mo(a),c=jp(a),f=_p(c);let d=c==="x"?o===(s?"end":"start")?"right":"left":o==="start"?"bottom":"top";return r.reference[f]>r.floating[f]&&(d=bo(d)),[d,bo(d)]}function Lx(a){const r=bo(a);return[wc(a),r,wc(r)]}function wc(a){return a.replace(/start|end/g,r=>Dx[r])}const dm=["left","right"],gm=["right","left"],Bx=["top","bottom"],Ux=["bottom","top"];function Hx(a,r,s){switch(a){case"top":case"bottom":return s?r?gm:dm:r?dm:gm;case"left":case"right":return r?Bx:Ux;default:return[]}}function Fx(a,r,s,o){const c=Mo(a);let f=Hx(Il(a),s==="start",o);return c&&(f=f.map(d=>d+"-"+c),r&&(f=f.concat(f.map(wc)))),f}function bo(a){return a.replace(/left|right|bottom|top/g,r=>kx[r])}function qx(a){return{top:0,right:0,bottom:0,left:0,...a}}function Gx(a){return typeof a!="number"?qx(a):{top:a,right:a,bottom:a,left:a}}function yo(a){const{x:r,y:s,width:o,height:c}=a;return{width:o,height:c,top:s,left:r,right:r+o,bottom:s+c,x:r,y:s}}var Yx=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],vo=Yx.join(","),Op=typeof Element>"u",Fa=Op?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,xo=!Op&&Element.prototype.getRootNode?function(a){var r;return a==null||(r=a.getRootNode)===null||r===void 0?void 0:r.call(a)}:function(a){return a?.ownerDocument},So=function(r,s){var o;s===void 0&&(s=!0);var c=r==null||(o=r.getAttribute)===null||o===void 0?void 0:o.call(r,"inert"),f=c===""||c==="true",d=f||s&&r&&(typeof r.closest=="function"?r.closest("[inert]"):So(r.parentNode));return d},Vx=function(r){var s,o=r==null||(s=r.getAttribute)===null||s===void 0?void 0:s.call(r,"contenteditable");return o===""||o==="true"},kp=function(r,s,o){if(So(r))return[];var c=Array.prototype.slice.apply(r.querySelectorAll(vo));return s&&Fa.call(r,vo)&&c.unshift(r),c=c.filter(o),c},Eo=function(r,s,o){for(var c=[],f=Array.from(r);f.length;){var d=f.shift();if(!So(d,!1))if(d.tagName==="SLOT"){var p=d.assignedElements(),b=p.length?p:d.children,m=Eo(b,!0,o);o.flatten?c.push.apply(c,m):c.push({scopeParent:d,candidates:m})}else{var S=Fa.call(d,vo);S&&o.filter(d)&&(s||!r.includes(d))&&c.push(d);var y=d.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(d),C=!So(y,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(d));if(y&&C){var _=Eo(y===!0?d.children:y.children,!0,o);o.flatten?c.push.apply(c,_):c.push({scopeParent:d,candidates:_})}else f.unshift.apply(f,d.children)}}return c},Dp=function(r){return!isNaN(parseInt(r.getAttribute("tabindex"),10))},Mp=function(r){if(!r)throw new Error("No node provided");return r.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(r.tagName)||Vx(r))&&!Dp(r)?0:r.tabIndex},Xx=function(r,s){var o=Mp(r);return o<0&&s&&!Dp(r)?0:o},Zx=function(r,s){return r.tabIndex===s.tabIndex?r.documentOrder-s.documentOrder:r.tabIndex-s.tabIndex},zp=function(r){return r.tagName==="INPUT"},Ix=function(r){return zp(r)&&r.type==="hidden"},$x=function(r){var s=r.tagName==="DETAILS"&&Array.prototype.slice.apply(r.children).some(function(o){return o.tagName==="SUMMARY"});return s},Qx=function(r,s){for(var o=0;o<r.length;o++)if(r[o].checked&&r[o].form===s)return r[o]},Kx=function(r){if(!r.name)return!0;var s=r.form||xo(r),o=function(p){return s.querySelectorAll('input[type="radio"][name="'+p+'"]')},c;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")c=o(window.CSS.escape(r.name));else try{c=o(r.name)}catch(d){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",d.message),!1}var f=Qx(c,r.form);return!f||f===r},Jx=function(r){return zp(r)&&r.type==="radio"},Wx=function(r){return Jx(r)&&!Kx(r)},Px=function(r){var s,o=r&&xo(r),c=(s=o)===null||s===void 0?void 0:s.host,f=!1;if(o&&o!==r){var d,p,b;for(f=!!((d=c)!==null&&d!==void 0&&(p=d.ownerDocument)!==null&&p!==void 0&&p.contains(c)||r!=null&&(b=r.ownerDocument)!==null&&b!==void 0&&b.contains(r));!f&&c;){var m,S,y;o=xo(c),c=(m=o)===null||m===void 0?void 0:m.host,f=!!((S=c)!==null&&S!==void 0&&(y=S.ownerDocument)!==null&&y!==void 0&&y.contains(c))}}return f},hm=function(r){var s=r.getBoundingClientRect(),o=s.width,c=s.height;return o===0&&c===0},e2=function(r,s){var o=s.displayCheck,c=s.getShadowRoot;if(o==="full-native"&&"checkVisibility"in r){var f=r.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!f}if(getComputedStyle(r).visibility==="hidden")return!0;var d=Fa.call(r,"details>summary:first-of-type"),p=d?r.parentElement:r;if(Fa.call(p,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof c=="function"){for(var b=r;r;){var m=r.parentElement,S=xo(r);if(m&&!m.shadowRoot&&c(m)===!0)return hm(r);r.assignedSlot?r=r.assignedSlot:!m&&S!==r.ownerDocument?r=S.host:r=m}r=b}if(Px(r))return!r.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return hm(r);return!1},t2=function(r){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(r.tagName))for(var s=r.parentElement;s;){if(s.tagName==="FIELDSET"&&s.disabled){for(var o=0;o<s.children.length;o++){var c=s.children.item(o);if(c.tagName==="LEGEND")return Fa.call(s,"fieldset[disabled] *")?!0:!c.contains(r)}return!0}s=s.parentElement}return!1},Nc=function(r,s){return!(s.disabled||Ix(s)||e2(s,r)||$x(s)||t2(s))},Ac=function(r,s){return!(Wx(s)||Mp(s)<0||!Nc(r,s))},n2=function(r){var s=parseInt(r.getAttribute("tabindex"),10);return!!(isNaN(s)||s>=0)},Lp=function(r){var s=[],o=[];return r.forEach(function(c,f){var d=!!c.scopeParent,p=d?c.scopeParent:c,b=Xx(p,d),m=d?Lp(c.candidates):p;b===0?d?s.push.apply(s,m):s.push(p):o.push({documentOrder:f,tabIndex:b,item:c,isScope:d,content:m})}),o.sort(Zx).reduce(function(c,f){return f.isScope?c.push.apply(c,f.content):c.push(f.content),c},[]).concat(s)},zo=function(r,s){s=s||{};var o;return s.getShadowRoot?o=Eo([r],s.includeContainer,{filter:Ac.bind(null,s),flatten:!1,getShadowRoot:s.getShadowRoot,shadowRootFilter:n2}):o=kp(r,s.includeContainer,Ac.bind(null,s)),Lp(o)},l2=function(r,s){s=s||{};var o;return s.getShadowRoot?o=Eo([r],s.includeContainer,{filter:Nc.bind(null,s),flatten:!0,getShadowRoot:s.getShadowRoot}):o=kp(r,s.includeContainer,Nc.bind(null,s)),o},Bp=function(r,s){if(s=s||{},!r)throw new Error("No node provided");return Fa.call(r,vo)===!1?!1:Ac(s,r)};function Up(){const a=navigator.userAgentData;return a!=null&&a.platform?a.platform:navigator.platform}function Hp(){const a=navigator.userAgentData;return a&&Array.isArray(a.brands)?a.brands.map(r=>{let{brand:s,version:o}=r;return s+"/"+o}).join(" "):navigator.userAgent}function Fp(){return/apple/i.test(navigator.vendor)}function Cc(){const a=/android/i;return a.test(Up())||a.test(Hp())}function a2(){return Up().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function qp(){return Hp().includes("jsdom/")}const mm="data-floating-ui-focusable",r2="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function vl(a){let r=a.activeElement;for(;((s=r)==null||(s=s.shadowRoot)==null?void 0:s.activeElement)!=null;){var s;r=r.shadowRoot.activeElement}return r}function St(a,r){if(!a||!r)return!1;const s=r.getRootNode==null?void 0:r.getRootNode();if(a.contains(r))return!0;if(s&&ho(s)){let o=r;for(;o;){if(a===o)return!0;o=o.parentNode||o.host}}return!1}function Fn(a){return"composedPath"in a?a.composedPath()[0]:a.target}function ic(a,r){if(r==null)return!1;if("composedPath"in a)return a.composedPath().includes(r);const s=a;return s.target!=null&&r.contains(s.target)}function i2(a){return a.matches("html,body")}function Et(a){return a?.ownerDocument||document}function Bc(a){return ut(a)&&a.matches(r2)}function pm(a){return a?a.getAttribute("role")==="combobox"&&Bc(a):!1}function o2(a){if(!a||qp())return!0;try{return a.matches(":focus-visible")}catch{return!0}}function Tc(a){return a?a.hasAttribute(mm)?a:a.querySelector("["+mm+"]")||a:null}function Ba(a,r,s){return s===void 0&&(s=!0),a.filter(c=>{var f;return c.parentId===r&&(!s||((f=c.context)==null?void 0:f.open))}).flatMap(c=>[c,...Ba(a,c.id,s)])}function bm(a,r){var s;let o=[],c=(s=a.find(f=>f.id===r))==null?void 0:s.parentId;for(;c;){const f=a.find(d=>d.id===c);c=f?.parentId,f&&(o=o.concat(f))}return o}function oc(a){a.preventDefault(),a.stopPropagation()}function s2(a){return"nativeEvent"in a}function u2(a){return a.mozInputSource===0&&a.isTrusted?!0:Cc()&&a.pointerType?a.type==="click"&&a.buttons===1:a.detail===0&&!a.pointerType}function c2(a){return qp()?!1:!Cc()&&a.width===0&&a.height===0||Cc()&&a.width===1&&a.height===1&&a.pressure===0&&a.detail===0&&a.pointerType==="mouse"||a.width<1&&a.height<1&&a.pressure===0&&a.detail===0&&a.pointerType==="touch"}function Hr(a,r){const s=["mouse","pen"];return r||s.push("",void 0),s.includes(a)}var f2=typeof document<"u",d2=function(){},Bt=f2?R.useLayoutEffect:d2;const g2={...$m};function Xl(a){const r=R.useRef(a);return Bt(()=>{r.current=a}),r}const h2=g2.useInsertionEffect,m2=h2||(a=>a());function Lt(a){const r=R.useRef(()=>{});return m2(()=>{r.current=a}),R.useCallback(function(){for(var s=arguments.length,o=new Array(s),c=0;c<s;c++)o[c]=arguments[c];return r.current==null?void 0:r.current(...o)},[])}const qr=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Gp(a,r){const s=zo(a,qr()),o=s.length;if(o===0)return;const c=vl(Et(a)),f=s.indexOf(c),d=f===-1?r===1?0:o-1:f+r;return s[d]}function Yp(a){return Gp(Et(a).body,1)||a}function Vp(a){return Gp(Et(a).body,-1)||a}function Lr(a,r){const s=r||a.currentTarget,o=a.relatedTarget;return!o||!St(s,o)}function p2(a){zo(a,qr()).forEach(s=>{s.dataset.tabindex=s.getAttribute("tabindex")||"",s.setAttribute("tabindex","-1")})}function ym(a){a.querySelectorAll("[data-tabindex]").forEach(s=>{const o=s.dataset.tabindex;delete s.dataset.tabindex,o?s.setAttribute("tabindex",o):s.removeAttribute("tabindex")})}var Xp=Qm();function vm(a,r,s){let{reference:o,floating:c}=a;const f=xl(r),d=jp(r),p=_p(d),b=Il(r),m=f==="y",S=o.x+o.width/2-c.width/2,y=o.y+o.height/2-c.height/2,C=o[p]/2-c[p]/2;let _;switch(b){case"top":_={x:S,y:o.y-c.height};break;case"bottom":_={x:S,y:o.y+o.height};break;case"right":_={x:o.x+o.width,y};break;case"left":_={x:o.x-c.width,y};break;default:_={x:o.x,y:o.y}}switch(Mo(r)){case"start":_[d]-=C*(s&&m?-1:1);break;case"end":_[d]+=C*(s&&m?-1:1);break}return _}const b2=async(a,r,s)=>{const{placement:o="bottom",strategy:c="absolute",middleware:f=[],platform:d}=s,p=f.filter(Boolean),b=await(d.isRTL==null?void 0:d.isRTL(r));let m=await d.getElementRects({reference:a,floating:r,strategy:c}),{x:S,y}=vm(m,o,b),C=o,_={},x=0;for(let v=0;v<p.length;v++){const{name:T,fn:N}=p[v],{x:A,y:D,data:z,reset:L}=await N({x:S,y,initialPlacement:o,placement:C,strategy:c,middlewareData:_,rects:m,platform:d,elements:{reference:a,floating:r}});S=A??S,y=D??y,_={..._,[T]:{..._[T],...z}},L&&x<=50&&(x++,typeof L=="object"&&(L.placement&&(C=L.placement),L.rects&&(m=L.rects===!0?await d.getElementRects({reference:a,floating:r,strategy:c}):L.rects),{x:S,y}=vm(m,C,b)),v=-1)}return{x:S,y,placement:C,strategy:c,middlewareData:_}};async function Zp(a,r){var s;r===void 0&&(r={});const{x:o,y:c,platform:f,rects:d,elements:p,strategy:b}=a,{boundary:m="clippingAncestors",rootBoundary:S="viewport",elementContext:y="floating",altBoundary:C=!1,padding:_=0}=Do(r,a),x=Gx(_),T=p[C?y==="floating"?"reference":"floating":y],N=yo(await f.getClippingRect({element:(s=await(f.isElement==null?void 0:f.isElement(T)))==null||s?T:T.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(p.floating)),boundary:m,rootBoundary:S,strategy:b})),A=y==="floating"?{x:o,y:c,width:d.floating.width,height:d.floating.height}:d.reference,D=await(f.getOffsetParent==null?void 0:f.getOffsetParent(p.floating)),z=await(f.isElement==null?void 0:f.isElement(D))?await(f.getScale==null?void 0:f.getScale(D))||{x:1,y:1}:{x:1,y:1},L=yo(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:A,offsetParent:D,strategy:b}):A);return{top:(N.top-L.top+x.top)/z.y,bottom:(L.bottom-N.bottom+x.bottom)/z.y,left:(N.left-L.left+x.left)/z.x,right:(L.right-N.right+x.right)/z.x}}const y2=function(a){return a===void 0&&(a={}),{name:"flip",options:a,async fn(r){var s,o;const{placement:c,middlewareData:f,rects:d,initialPlacement:p,platform:b,elements:m}=r,{mainAxis:S=!0,crossAxis:y=!0,fallbackPlacements:C,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...T}=Do(a,r);if((s=f.arrow)!=null&&s.alignmentOffset)return{};const N=Il(c),A=xl(p),D=Il(p)===p,z=await(b.isRTL==null?void 0:b.isRTL(m.floating)),L=C||(D||!v?[bo(p)]:Lx(p)),Q=x!=="none";!C&&Q&&L.push(...Fx(p,v,x,z));const Y=[p,...L],ce=await Zp(r,T),ee=[];let oe=((o=f.flip)==null?void 0:o.overflows)||[];if(S&&ee.push(ce[N]),y){const F=zx(c,d,z);ee.push(ce[F[0]],ce[F[1]])}if(oe=[...oe,{placement:c,overflows:ee}],!ee.every(F=>F<=0)){var le,P;const F=(((le=f.flip)==null?void 0:le.index)||0)+1,ae=Y[F];if(ae&&(!(y==="alignment"?A!==xl(ae):!1)||oe.every(k=>xl(k.placement)===A?k.overflows[0]>0:!0)))return{data:{index:F,overflows:oe},reset:{placement:ae}};let E=(P=oe.filter(M=>M.overflows[0]<=0).sort((M,k)=>M.overflows[1]-k.overflows[1])[0])==null?void 0:P.placement;if(!E)switch(_){case"bestFit":{var se;const M=(se=oe.filter(k=>{if(Q){const I=xl(k.placement);return I===A||I==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(I=>I>0).reduce((I,$)=>I+$,0)]).sort((k,I)=>k[1]-I[1])[0])==null?void 0:se[0];M&&(E=M);break}case"initialPlacement":E=p;break}if(c!==E)return{reset:{placement:E}}}return{}}}},v2=new Set(["left","top"]);async function x2(a,r){const{placement:s,platform:o,elements:c}=a,f=await(o.isRTL==null?void 0:o.isRTL(c.floating)),d=Il(s),p=Mo(s),b=xl(s)==="y",m=v2.has(d)?-1:1,S=f&&b?-1:1,y=Do(r,a);let{mainAxis:C,crossAxis:_,alignmentAxis:x}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return p&&typeof x=="number"&&(_=p==="end"?x*-1:x),b?{x:_*S,y:C*m}:{x:C*m,y:_*S}}const S2=function(a){return a===void 0&&(a=0),{name:"offset",options:a,async fn(r){var s,o;const{x:c,y:f,placement:d,middlewareData:p}=r,b=await x2(r,a);return d===((s=p.offset)==null?void 0:s.placement)&&(o=p.arrow)!=null&&o.alignmentOffset?{}:{x:c+b.x,y:f+b.y,data:{...b,placement:d}}}}},E2=function(a){return a===void 0&&(a={}),{name:"shift",options:a,async fn(r){const{x:s,y:o,placement:c}=r,{mainAxis:f=!0,crossAxis:d=!1,limiter:p={fn:T=>{let{x:N,y:A}=T;return{x:N,y:A}}},...b}=Do(a,r),m={x:s,y:o},S=await Zp(r,b),y=xl(Il(c)),C=Rp(y);let _=m[C],x=m[y];if(f){const T=C==="y"?"top":"left",N=C==="y"?"bottom":"right",A=_+S[T],D=_-S[N];_=fm(A,_,D)}if(d){const T=y==="y"?"top":"left",N=y==="y"?"bottom":"right",A=x+S[T],D=x-S[N];x=fm(A,x,D)}const v=p.fn({...r,[C]:_,[y]:x});return{...v,data:{x:v.x-s,y:v.y-o,enabled:{[C]:f,[y]:d}}}}}};function Ip(a){const r=sn(a);let s=parseFloat(r.width)||0,o=parseFloat(r.height)||0;const c=ut(a),f=c?a.offsetWidth:s,d=c?a.offsetHeight:o,p=po(s)!==f||po(o)!==d;return p&&(s=f,o=d),{width:s,height:o,$:p}}function Uc(a){return Ze(a)?a:a.contextElement}function Ua(a){const r=Uc(a);if(!ut(r))return xn(1);const s=r.getBoundingClientRect(),{width:o,height:c,$:f}=Ip(r);let d=(f?po(s.width):s.width)/o,p=(f?po(s.height):s.height)/c;return(!d||!Number.isFinite(d))&&(d=1),(!p||!Number.isFinite(p))&&(p=1),{x:d,y:p}}const w2=xn(0);function $p(a){const r=Ut(a);return!Oo()||!r.visualViewport?w2:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function N2(a,r,s){return r===void 0&&(r=!1),!s||r&&s!==Ut(a)?!1:r}function $l(a,r,s,o){r===void 0&&(r=!1),s===void 0&&(s=!1);const c=a.getBoundingClientRect(),f=Uc(a);let d=xn(1);r&&(o?Ze(o)&&(d=Ua(o)):d=Ua(a));const p=N2(f,s,o)?$p(f):xn(0);let b=(c.left+p.x)/d.x,m=(c.top+p.y)/d.y,S=c.width/d.x,y=c.height/d.y;if(f){const C=Ut(f),_=o&&Ze(o)?Ut(o):o;let x=C,v=Ec(x);for(;v&&o&&_!==x;){const T=Ua(v),N=v.getBoundingClientRect(),A=sn(v),D=N.left+(v.clientLeft+parseFloat(A.paddingLeft))*T.x,z=N.top+(v.clientTop+parseFloat(A.paddingTop))*T.y;b*=T.x,m*=T.y,S*=T.x,y*=T.y,b+=D,m+=z,x=Ut(v),v=Ec(x)}}return yo({width:S,height:y,x:b,y:m})}function Lo(a,r){const s=ko(a).scrollLeft;return r?r.left+s:$l(Sn(a)).left+s}function Qp(a,r){const s=a.getBoundingClientRect(),o=s.left+r.scrollLeft-Lo(a,s),c=s.top+r.scrollTop;return{x:o,y:c}}function A2(a){let{elements:r,rect:s,offsetParent:o,strategy:c}=a;const f=c==="fixed",d=Sn(o),p=r?jo(r.floating):!1;if(o===d||p&&f)return s;let b={scrollLeft:0,scrollTop:0},m=xn(1);const S=xn(0),y=ut(o);if((y||!y&&!f)&&((Nl(o)!=="body"||Fr(d))&&(b=ko(o)),ut(o))){const _=$l(o);m=Ua(o),S.x=_.x+o.clientLeft,S.y=_.y+o.clientTop}const C=d&&!y&&!f?Qp(d,b):xn(0);return{width:s.width*m.x,height:s.height*m.y,x:s.x*m.x-b.scrollLeft*m.x+S.x+C.x,y:s.y*m.y-b.scrollTop*m.y+S.y+C.y}}function C2(a){return Array.from(a.getClientRects())}function T2(a){const r=Sn(a),s=ko(a),o=a.ownerDocument.body,c=Zl(r.scrollWidth,r.clientWidth,o.scrollWidth,o.clientWidth),f=Zl(r.scrollHeight,r.clientHeight,o.scrollHeight,o.clientHeight);let d=-s.scrollLeft+Lo(a);const p=-s.scrollTop;return sn(o).direction==="rtl"&&(d+=Zl(r.clientWidth,o.clientWidth)-c),{width:c,height:f,x:d,y:p}}const xm=25;function R2(a,r){const s=Ut(a),o=Sn(a),c=s.visualViewport;let f=o.clientWidth,d=o.clientHeight,p=0,b=0;if(c){f=c.width,d=c.height;const S=Oo();(!S||S&&r==="fixed")&&(p=c.offsetLeft,b=c.offsetTop)}const m=Lo(o);if(m<=0){const S=o.ownerDocument,y=S.body,C=getComputedStyle(y),_=S.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,x=Math.abs(o.clientWidth-y.clientWidth-_);x<=xm&&(f-=x)}else m<=xm&&(f+=m);return{width:f,height:d,x:p,y:b}}const _2=new Set(["absolute","fixed"]);function j2(a,r){const s=$l(a,!0,r==="fixed"),o=s.top+a.clientTop,c=s.left+a.clientLeft,f=ut(a)?Ua(a):xn(1),d=a.clientWidth*f.x,p=a.clientHeight*f.y,b=c*f.x,m=o*f.y;return{width:d,height:p,x:b,y:m}}function Sm(a,r,s){let o;if(r==="viewport")o=R2(a,s);else if(r==="document")o=T2(Sn(a));else if(Ze(r))o=j2(r,s);else{const c=$p(a);o={x:r.x-c.x,y:r.y-c.y,width:r.width,height:r.height}}return yo(o)}function Kp(a,r){const s=Yn(a);return s===r||!Ze(s)||Gn(s)?!1:sn(s).position==="fixed"||Kp(s,r)}function O2(a,r){const s=r.get(a);if(s)return s;let o=wl(a,[],!1).filter(p=>Ze(p)&&Nl(p)!=="body"),c=null;const f=sn(a).position==="fixed";let d=f?Yn(a):a;for(;Ze(d)&&!Gn(d);){const p=sn(d),b=Lc(d);!b&&p.position==="fixed"&&(c=null),(f?!b&&!c:!b&&p.position==="static"&&!!c&&_2.has(c.position)||Fr(d)&&!b&&Kp(a,d))?o=o.filter(S=>S!==d):c=p,d=Yn(d)}return r.set(a,o),o}function k2(a){let{element:r,boundary:s,rootBoundary:o,strategy:c}=a;const d=[...s==="clippingAncestors"?jo(r)?[]:O2(r,this._c):[].concat(s),o],p=d[0],b=d.reduce((m,S)=>{const y=Sm(r,S,c);return m.top=Zl(y.top,m.top),m.right=mo(y.right,m.right),m.bottom=mo(y.bottom,m.bottom),m.left=Zl(y.left,m.left),m},Sm(r,p,c));return{width:b.right-b.left,height:b.bottom-b.top,x:b.left,y:b.top}}function D2(a){const{width:r,height:s}=Ip(a);return{width:r,height:s}}function M2(a,r,s){const o=ut(r),c=Sn(r),f=s==="fixed",d=$l(a,!0,f,r);let p={scrollLeft:0,scrollTop:0};const b=xn(0);function m(){b.x=Lo(c)}if(o||!o&&!f)if((Nl(r)!=="body"||Fr(c))&&(p=ko(r)),o){const _=$l(r,!0,f,r);b.x=_.x+r.clientLeft,b.y=_.y+r.clientTop}else c&&m();f&&!o&&c&&m();const S=c&&!o&&!f?Qp(c,p):xn(0),y=d.left+p.scrollLeft-b.x-S.x,C=d.top+p.scrollTop-b.y-S.y;return{x:y,y:C,width:d.width,height:d.height}}function sc(a){return sn(a).position==="static"}function Em(a,r){if(!ut(a)||sn(a).position==="fixed")return null;if(r)return r(a);let s=a.offsetParent;return Sn(a)===s&&(s=s.ownerDocument.body),s}function Jp(a,r){const s=Ut(a);if(jo(a))return s;if(!ut(a)){let c=Yn(a);for(;c&&!Gn(c);){if(Ze(c)&&!sc(c))return c;c=Yn(c)}return s}let o=Em(a,r);for(;o&&Ax(o)&&sc(o);)o=Em(o,r);return o&&Gn(o)&&sc(o)&&!Lc(o)?s:o||jx(a)||s}const z2=async function(a){const r=this.getOffsetParent||Jp,s=this.getDimensions,o=await s(a.floating);return{reference:M2(a.reference,await r(a.floating),a.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function L2(a){return sn(a).direction==="rtl"}const B2={convertOffsetParentRelativeRectToViewportRelativeRect:A2,getDocumentElement:Sn,getClippingRect:k2,getOffsetParent:Jp,getElementRects:z2,getClientRects:C2,getDimensions:D2,getScale:Ua,isElement:Ze,isRTL:L2};function Wp(a,r){return a.x===r.x&&a.y===r.y&&a.width===r.width&&a.height===r.height}function U2(a,r){let s=null,o;const c=Sn(a);function f(){var p;clearTimeout(o),(p=s)==null||p.disconnect(),s=null}function d(p,b){p===void 0&&(p=!1),b===void 0&&(b=1),f();const m=a.getBoundingClientRect(),{left:S,top:y,width:C,height:_}=m;if(p||r(),!C||!_)return;const x=io(y),v=io(c.clientWidth-(S+C)),T=io(c.clientHeight-(y+_)),N=io(S),D={rootMargin:-x+"px "+-v+"px "+-T+"px "+-N+"px",threshold:Zl(0,mo(1,b))||1};let z=!0;function L(Q){const Y=Q[0].intersectionRatio;if(Y!==b){if(!z)return d();Y?d(!1,Y):o=setTimeout(()=>{d(!1,1e-7)},1e3)}Y===1&&!Wp(m,a.getBoundingClientRect())&&d(),z=!1}try{s=new IntersectionObserver(L,{...D,root:c.ownerDocument})}catch{s=new IntersectionObserver(L,D)}s.observe(a)}return d(!0),f}function H2(a,r,s,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:f=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:b=!1}=o,m=Uc(a),S=c||f?[...m?wl(m):[],...wl(r)]:[];S.forEach(N=>{c&&N.addEventListener("scroll",s,{passive:!0}),f&&N.addEventListener("resize",s)});const y=m&&p?U2(m,s):null;let C=-1,_=null;d&&(_=new ResizeObserver(N=>{let[A]=N;A&&A.target===m&&_&&(_.unobserve(r),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var D;(D=_)==null||D.observe(r)})),s()}),m&&!b&&_.observe(m),_.observe(r));let x,v=b?$l(a):null;b&&T();function T(){const N=$l(a);v&&!Wp(v,N)&&s(),v=N,x=requestAnimationFrame(T)}return s(),()=>{var N;S.forEach(A=>{c&&A.removeEventListener("scroll",s),f&&A.removeEventListener("resize",s)}),y?.(),(N=_)==null||N.disconnect(),_=null,b&&cancelAnimationFrame(x)}}const F2=S2,q2=E2,G2=y2,Y2=(a,r,s)=>{const o=new Map,c={platform:B2,...s},f={...c.platform,_c:o};return b2(a,r,{...c,platform:f})};var V2=typeof document<"u",X2=function(){},co=V2?R.useLayoutEffect:X2;function wo(a,r){if(a===r)return!0;if(typeof a!=typeof r)return!1;if(typeof a=="function"&&a.toString()===r.toString())return!0;let s,o,c;if(a&&r&&typeof a=="object"){if(Array.isArray(a)){if(s=a.length,s!==r.length)return!1;for(o=s;o--!==0;)if(!wo(a[o],r[o]))return!1;return!0}if(c=Object.keys(a),s=c.length,s!==Object.keys(r).length)return!1;for(o=s;o--!==0;)if(!{}.hasOwnProperty.call(r,c[o]))return!1;for(o=s;o--!==0;){const f=c[o];if(!(f==="_owner"&&a.$$typeof)&&!wo(a[f],r[f]))return!1}return!0}return a!==a&&r!==r}function Pp(a){return typeof window>"u"?1:(a.ownerDocument.defaultView||window).devicePixelRatio||1}function wm(a,r){const s=Pp(a);return Math.round(r*s)/s}function uc(a){const r=R.useRef(a);return co(()=>{r.current=a}),r}function Z2(a){a===void 0&&(a={});const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:c,elements:{reference:f,floating:d}={},transform:p=!0,whileElementsMounted:b,open:m}=a,[S,y]=R.useState({x:0,y:0,strategy:s,placement:r,middlewareData:{},isPositioned:!1}),[C,_]=R.useState(o);wo(C,o)||_(o);const[x,v]=R.useState(null),[T,N]=R.useState(null),A=R.useCallback(k=>{k!==Q.current&&(Q.current=k,v(k))},[]),D=R.useCallback(k=>{k!==Y.current&&(Y.current=k,N(k))},[]),z=f||x,L=d||T,Q=R.useRef(null),Y=R.useRef(null),ce=R.useRef(S),ee=b!=null,oe=uc(b),le=uc(c),P=uc(m),se=R.useCallback(()=>{if(!Q.current||!Y.current)return;const k={placement:r,strategy:s,middleware:C};le.current&&(k.platform=le.current),Y2(Q.current,Y.current,k).then(I=>{const $={...I,isPositioned:P.current!==!1};F.current&&!wo(ce.current,$)&&(ce.current=$,Xp.flushSync(()=>{y($)}))})},[C,r,s,le,P]);co(()=>{m===!1&&ce.current.isPositioned&&(ce.current.isPositioned=!1,y(k=>({...k,isPositioned:!1})))},[m]);const F=R.useRef(!1);co(()=>(F.current=!0,()=>{F.current=!1}),[]),co(()=>{if(z&&(Q.current=z),L&&(Y.current=L),z&&L){if(oe.current)return oe.current(z,L,se);se()}},[z,L,se,oe,ee]);const ae=R.useMemo(()=>({reference:Q,floating:Y,setReference:A,setFloating:D}),[A,D]),E=R.useMemo(()=>({reference:z,floating:L}),[z,L]),M=R.useMemo(()=>{const k={position:s,left:0,top:0};if(!E.floating)return k;const I=wm(E.floating,S.x),$=wm(E.floating,S.y);return p?{...k,transform:"translate("+I+"px, "+$+"px)",...Pp(E.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:I,top:$}},[s,p,E.floating,S.x,S.y]);return R.useMemo(()=>({...S,update:se,refs:ae,elements:E,floatingStyles:M}),[S,se,ae,E,M])}const I2=(a,r)=>({...F2(a),options:[a,r]}),$2=(a,r)=>({...q2(a),options:[a,r]}),Q2=(a,r)=>({...G2(a),options:[a,r]}),K2="data-floating-ui-focusable",Nm="active",Am="selected",J2={...$m};let Cm=!1,W2=0;const Tm=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+W2++;function P2(){const[a,r]=R.useState(()=>Cm?Tm():void 0);return Bt(()=>{a==null&&r(Tm())},[]),R.useEffect(()=>{Cm=!0},[]),a}const eS=J2.useId,Hc=eS||P2;function tS(){const a=new Map;return{emit(r,s){var o;(o=a.get(r))==null||o.forEach(c=>c(s))},on(r,s){a.has(r)||a.set(r,new Set),a.get(r).add(s)},off(r,s){var o;(o=a.get(r))==null||o.delete(s)}}}const nS=R.createContext(null),lS=R.createContext(null),Fc=()=>{var a;return((a=R.useContext(nS))==null?void 0:a.id)||null},Bo=()=>R.useContext(lS);function Ql(a){return"data-floating-ui-"+a}function Ct(a){a.current!==-1&&(clearTimeout(a.current),a.current=-1)}const Rm=Ql("safe-polygon");function cc(a,r,s){if(s&&!Hr(s))return 0;if(typeof a=="number")return a;if(typeof a=="function"){const o=a();return typeof o=="number"?o:o?.[r]}return a?.[r]}function fc(a){return typeof a=="function"?a():a}function aS(a,r){r===void 0&&(r={});const{open:s,onOpenChange:o,dataRef:c,events:f,elements:d}=a,{enabled:p=!0,delay:b=0,handleClose:m=null,mouseOnly:S=!1,restMs:y=0,move:C=!0}=r,_=Bo(),x=Fc(),v=Xl(m),T=Xl(b),N=Xl(s),A=Xl(y),D=R.useRef(),z=R.useRef(-1),L=R.useRef(),Q=R.useRef(-1),Y=R.useRef(!0),ce=R.useRef(!1),ee=R.useRef(()=>{}),oe=R.useRef(!1),le=Lt(()=>{var M;const k=(M=c.current.openEvent)==null?void 0:M.type;return k?.includes("mouse")&&k!=="mousedown"});R.useEffect(()=>{if(!p)return;function M(k){let{open:I}=k;I||(Ct(z),Ct(Q),Y.current=!0,oe.current=!1)}return f.on("openchange",M),()=>{f.off("openchange",M)}},[p,f]),R.useEffect(()=>{if(!p||!v.current||!s)return;function M(I){le()&&o(!1,I,"hover")}const k=Et(d.floating).documentElement;return k.addEventListener("mouseleave",M),()=>{k.removeEventListener("mouseleave",M)}},[d.floating,s,o,p,v,le]);const P=R.useCallback(function(M,k,I){k===void 0&&(k=!0),I===void 0&&(I="hover");const $=cc(T.current,"close",D.current);$&&!L.current?(Ct(z),z.current=window.setTimeout(()=>o(!1,M,I),$)):k&&(Ct(z),o(!1,M,I))},[T,o]),se=Lt(()=>{ee.current(),L.current=void 0}),F=Lt(()=>{if(ce.current){const M=Et(d.floating).body;M.style.pointerEvents="",M.removeAttribute(Rm),ce.current=!1}}),ae=Lt(()=>c.current.openEvent?["click","mousedown"].includes(c.current.openEvent.type):!1);R.useEffect(()=>{if(!p)return;function M(U){if(Ct(z),Y.current=!1,S&&!Hr(D.current)||fc(A.current)>0&&!cc(T.current,"open"))return;const X=cc(T.current,"open",D.current);X?z.current=window.setTimeout(()=>{N.current||o(!0,U,"hover")},X):s||o(!0,U,"hover")}function k(U){if(ae()){F();return}ee.current();const X=Et(d.floating);if(Ct(Q),oe.current=!1,v.current&&c.current.floatingContext){s||Ct(z),L.current=v.current({...c.current.floatingContext,tree:_,x:U.clientX,y:U.clientY,onClose(){F(),se(),ae()||P(U,!0,"safe-polygon")}});const ie=L.current;X.addEventListener("mousemove",ie),ee.current=()=>{X.removeEventListener("mousemove",ie)};return}(D.current!=="touch"||!St(d.floating,U.relatedTarget))&&P(U)}function I(U){ae()||c.current.floatingContext&&(v.current==null||v.current({...c.current.floatingContext,tree:_,x:U.clientX,y:U.clientY,onClose(){F(),se(),ae()||P(U)}})(U))}function $(){Ct(z)}function j(U){ae()||P(U,!1)}if(Ze(d.domReference)){const U=d.domReference,X=d.floating;return s&&U.addEventListener("mouseleave",I),C&&U.addEventListener("mousemove",M,{once:!0}),U.addEventListener("mouseenter",M),U.addEventListener("mouseleave",k),X&&(X.addEventListener("mouseleave",I),X.addEventListener("mouseenter",$),X.addEventListener("mouseleave",j)),()=>{s&&U.removeEventListener("mouseleave",I),C&&U.removeEventListener("mousemove",M),U.removeEventListener("mouseenter",M),U.removeEventListener("mouseleave",k),X&&(X.removeEventListener("mouseleave",I),X.removeEventListener("mouseenter",$),X.removeEventListener("mouseleave",j))}}},[d,p,a,S,C,P,se,F,o,s,N,_,T,v,c,ae,A]),Bt(()=>{var M;if(p&&s&&(M=v.current)!=null&&(M=M.__options)!=null&&M.blockPointerEvents&&le()){ce.current=!0;const I=d.floating;if(Ze(d.domReference)&&I){var k;const $=Et(d.floating).body;$.setAttribute(Rm,"");const j=d.domReference,U=_==null||(k=_.nodesRef.current.find(X=>X.id===x))==null||(k=k.context)==null?void 0:k.elements.floating;return U&&(U.style.pointerEvents=""),$.style.pointerEvents="none",j.style.pointerEvents="auto",I.style.pointerEvents="auto",()=>{$.style.pointerEvents="",j.style.pointerEvents="",I.style.pointerEvents=""}}}},[p,s,x,d,_,v,le]),Bt(()=>{s||(D.current=void 0,oe.current=!1,se(),F())},[s,se,F]),R.useEffect(()=>()=>{se(),Ct(z),Ct(Q),F()},[p,d.domReference,se,F]);const E=R.useMemo(()=>{function M(k){D.current=k.pointerType}return{onPointerDown:M,onPointerEnter:M,onMouseMove(k){const{nativeEvent:I}=k;function $(){!Y.current&&!N.current&&o(!0,I,"hover")}S&&!Hr(D.current)||s||fc(A.current)===0||oe.current&&k.movementX**2+k.movementY**2<2||(Ct(Q),D.current==="touch"?$():(oe.current=!0,Q.current=window.setTimeout($,fc(A.current))))}}},[S,o,s,N,A]);return R.useMemo(()=>p?{reference:E}:{},[p,E])}let _m=0;function La(a,r){r===void 0&&(r={});const{preventScroll:s=!1,cancelPrevious:o=!0,sync:c=!1}=r;o&&cancelAnimationFrame(_m);const f=()=>a?.focus({preventScroll:s});c?f():_m=requestAnimationFrame(f)}function dc(a,r){if(!a||!r)return!1;const s=r.getRootNode==null?void 0:r.getRootNode();if(a.contains(r))return!0;if(s&&ho(s)){let o=r;for(;o;){if(a===o)return!0;o=o.parentNode||o.host}}return!1}function rS(a){return"composedPath"in a?a.composedPath()[0]:a.target}function iS(a){return a?.ownerDocument||document}const Ha={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function jm(a){return a==="inert"?Ha.inert:a==="aria-hidden"?Ha["aria-hidden"]:Ha.none}let oo=new WeakSet,so={},gc=0;const oS=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,eb=a=>a&&(a.host||eb(a.parentNode)),sS=(a,r)=>r.map(s=>{if(a.contains(s))return s;const o=eb(s);return a.contains(o)?o:null}).filter(s=>s!=null);function uS(a,r,s,o){const c="data-floating-ui-inert",f=o?"inert":s?"aria-hidden":null,d=sS(r,a),p=new Set,b=new Set(d),m=[];so[c]||(so[c]=new WeakMap);const S=so[c];d.forEach(y),C(r),p.clear();function y(_){!_||p.has(_)||(p.add(_),_.parentNode&&y(_.parentNode))}function C(_){!_||b.has(_)||[].forEach.call(_.children,x=>{if(Nl(x)!=="script")if(p.has(x))C(x);else{const v=f?x.getAttribute(f):null,T=v!==null&&v!=="false",N=jm(f),A=(N.get(x)||0)+1,D=(S.get(x)||0)+1;N.set(x,A),S.set(x,D),m.push(x),A===1&&T&&oo.add(x),D===1&&x.setAttribute(c,""),!T&&f&&x.setAttribute(f,f==="inert"?"":"true")}})}return gc++,()=>{m.forEach(_=>{const x=jm(f),T=(x.get(_)||0)-1,N=(S.get(_)||0)-1;x.set(_,T),S.set(_,N),T||(!oo.has(_)&&f&&_.removeAttribute(f),oo.delete(_)),N||_.removeAttribute(c)}),gc--,gc||(Ha.inert=new WeakMap,Ha["aria-hidden"]=new WeakMap,Ha.none=new WeakMap,oo=new WeakSet,so={})}}function Om(a,r,s){r===void 0&&(r=!1),s===void 0&&(s=!1);const o=iS(a[0]).body;return uS(a.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,r,s)}const Uo={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},No=R.forwardRef(function(r,s){const[o,c]=R.useState();Bt(()=>{Fp()&&c("button")},[]);const f={ref:s,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[Ql("focus-guard")]:"",style:Uo};return h.jsx("span",{...r,...f})}),tb=R.createContext(null),km=Ql("portal");function cS(a){a===void 0&&(a={});const{id:r,root:s}=a,o=Hc(),c=nb(),[f,d]=R.useState(null),p=R.useRef(null);return Bt(()=>()=>{f?.remove(),queueMicrotask(()=>{p.current=null})},[f]),Bt(()=>{if(!o||p.current)return;const b=r?document.getElementById(r):null;if(!b)return;const m=document.createElement("div");m.id=o,m.setAttribute(km,""),b.appendChild(m),p.current=m,d(m)},[r,o]),Bt(()=>{if(s===null||!o||p.current)return;let b=s||c?.portalNode;b&&!zc(b)&&(b=b.current),b=b||document.body;let m=null;r&&(m=document.createElement("div"),m.id=r,b.appendChild(m));const S=document.createElement("div");S.id=o,S.setAttribute(km,""),b=m||b,b.appendChild(S),p.current=S,d(S)},[r,s,o,c]),f}function fS(a){const{children:r,id:s,root:o,preserveTabOrder:c=!0}=a,f=cS({id:s,root:o}),[d,p]=R.useState(null),b=R.useRef(null),m=R.useRef(null),S=R.useRef(null),y=R.useRef(null),C=d?.modal,_=d?.open,x=!!d&&!d.modal&&d.open&&c&&!!(o||f);return R.useEffect(()=>{if(!f||!c||C)return;function v(T){f&&Lr(T)&&(T.type==="focusin"?ym:p2)(f)}return f.addEventListener("focusin",v,!0),f.addEventListener("focusout",v,!0),()=>{f.removeEventListener("focusin",v,!0),f.removeEventListener("focusout",v,!0)}},[f,c,C]),R.useEffect(()=>{f&&(_||ym(f))},[_,f]),h.jsxs(tb.Provider,{value:R.useMemo(()=>({preserveTabOrder:c,beforeOutsideRef:b,afterOutsideRef:m,beforeInsideRef:S,afterInsideRef:y,portalNode:f,setFocusManagerState:p}),[c,f]),children:[x&&f&&h.jsx(No,{"data-type":"outside",ref:b,onFocus:v=>{if(Lr(v,f)){var T;(T=S.current)==null||T.focus()}else{const N=d?d.domReference:null,A=Vp(N);A?.focus()}}}),x&&f&&h.jsx("span",{"aria-owns":f.id,style:Uo}),f&&Xp.createPortal(r,f),x&&f&&h.jsx(No,{"data-type":"outside",ref:m,onFocus:v=>{if(Lr(v,f)){var T;(T=y.current)==null||T.focus()}else{const N=d?d.domReference:null,A=Yp(N);A?.focus(),d?.closeOnFocusOut&&d?.onOpenChange(!1,v.nativeEvent,"focus-out")}}})]})}const nb=()=>R.useContext(tb);function Dm(a){return R.useMemo(()=>r=>{a.forEach(s=>{s&&(s.current=r)})},a)}const dS=20;let Sl=[];function qc(){Sl=Sl.filter(a=>a.isConnected)}function gS(a){qc(),a&&Nl(a)!=="body"&&(Sl.push(a),Sl.length>dS&&(Sl=Sl.slice(-20)))}function Mm(){return qc(),Sl[Sl.length-1]}function hS(a){const r=qr();return Bp(a,r)?a:zo(a,r)[0]||a}function zm(a,r){var s;if(!r.current.includes("floating")&&!((s=a.getAttribute("role"))!=null&&s.includes("dialog")))return;const o=qr(),f=l2(a,o).filter(p=>{const b=p.getAttribute("data-tabindex")||"";return Bp(p,o)||p.hasAttribute("data-tabindex")&&!b.startsWith("-")}),d=a.getAttribute("tabindex");r.current.includes("floating")||f.length===0?d!=="0"&&a.setAttribute("tabindex","0"):(d!=="-1"||a.hasAttribute("data-tabindex")&&a.getAttribute("data-tabindex")!=="-1")&&(a.setAttribute("tabindex","-1"),a.setAttribute("data-tabindex","-1"))}const mS=R.forwardRef(function(r,s){return h.jsx("button",{...r,type:"button",ref:s,tabIndex:-1,style:Uo})});function pS(a){const{context:r,children:s,disabled:o=!1,order:c=["content"],guards:f=!0,initialFocus:d=0,returnFocus:p=!0,restoreFocus:b=!1,modal:m=!0,visuallyHiddenDismiss:S=!1,closeOnFocusOut:y=!0,outsideElementsInert:C=!1,getInsideElements:_=()=>[]}=a,{open:x,onOpenChange:v,events:T,dataRef:N,elements:{domReference:A,floating:D}}=r,z=Lt(()=>{var pe;return(pe=N.current.floatingContext)==null?void 0:pe.nodeId}),L=Lt(_),Q=typeof d=="number"&&d<0,Y=pm(A)&&Q,ce=oS(),ee=ce?f:!0,oe=!ee||ce&&C,le=Xl(c),P=Xl(d),se=Xl(p),F=Bo(),ae=nb(),E=R.useRef(null),M=R.useRef(null),k=R.useRef(!1),I=R.useRef(!1),$=R.useRef(-1),j=R.useRef(-1),U=ae!=null,X=Tc(D),re=Lt(function(pe){return pe===void 0&&(pe=X),pe?zo(pe,qr()):[]}),ie=Lt(pe=>{const ke=re(pe);return le.current.map(xe=>A&&xe==="reference"?A:X&&xe==="floating"?X:ke).filter(Boolean).flat()});R.useEffect(()=>{if(o||!m)return;function pe(xe){if(xe.key==="Tab"){St(X,vl(Et(X)))&&re().length===0&&!Y&&oc(xe);const Ve=ie(),Je=Fn(xe);le.current[0]==="reference"&&Je===A&&(oc(xe),xe.shiftKey?La(Ve[Ve.length-1]):La(Ve[1])),le.current[1]==="floating"&&Je===X&&xe.shiftKey&&(oc(xe),La(Ve[0]))}}const ke=Et(X);return ke.addEventListener("keydown",pe),()=>{ke.removeEventListener("keydown",pe)}},[o,A,X,m,le,Y,re,ie]),R.useEffect(()=>{if(o||!D)return;function pe(ke){const xe=Fn(ke),Je=re().indexOf(xe);Je!==-1&&($.current=Je)}return D.addEventListener("focusin",pe),()=>{D.removeEventListener("focusin",pe)}},[o,D,re]),R.useEffect(()=>{if(o||!y)return;function pe(){I.current=!0,setTimeout(()=>{I.current=!1})}function ke(Je){const Me=Je.relatedTarget,Tt=Je.currentTarget,ft=Fn(Je);queueMicrotask(()=>{const at=z(),Rt=!(St(A,Me)||St(D,Me)||St(Me,D)||St(ae?.portalNode,Me)||Me!=null&&Me.hasAttribute(Ql("focus-guard"))||F&&(Ba(F.nodesRef.current,at).find(Ht=>{var Ft,$e;return St((Ft=Ht.context)==null?void 0:Ft.elements.floating,Me)||St(($e=Ht.context)==null?void 0:$e.elements.domReference,Me)})||bm(F.nodesRef.current,at).find(Ht=>{var Ft,$e,Al;return[(Ft=Ht.context)==null?void 0:Ft.elements.floating,Tc(($e=Ht.context)==null?void 0:$e.elements.floating)].includes(Me)||((Al=Ht.context)==null?void 0:Al.elements.domReference)===Me})));if(Tt===A&&X&&zm(X,le),b&&Tt!==A&&!(ft!=null&&ft.isConnected)&&vl(Et(X))===Et(X).body){ut(X)&&X.focus();const Ht=$.current,Ft=re(),$e=Ft[Ht]||Ft[Ft.length-1]||X;ut($e)&&$e.focus()}if(N.current.insideReactTree){N.current.insideReactTree=!1;return}(Y||!m)&&Me&&Rt&&!I.current&&Me!==Mm()&&(k.current=!0,v(!1,Je,"focus-out"))})}const xe=!!(!F&&ae);function Ve(){Ct(j),N.current.insideReactTree=!0,j.current=window.setTimeout(()=>{N.current.insideReactTree=!1})}if(D&&ut(A))return A.addEventListener("focusout",ke),A.addEventListener("pointerdown",pe),D.addEventListener("focusout",ke),xe&&D.addEventListener("focusout",Ve,!0),()=>{A.removeEventListener("focusout",ke),A.removeEventListener("pointerdown",pe),D.removeEventListener("focusout",ke),xe&&D.removeEventListener("focusout",Ve,!0)}},[o,A,D,X,m,F,ae,v,y,b,re,Y,z,le,N]);const fe=R.useRef(null),ue=R.useRef(null),ge=Dm([fe,ae?.beforeInsideRef]),de=Dm([ue,ae?.afterInsideRef]);R.useEffect(()=>{var pe,ke;if(o||!D)return;const xe=Array.from((ae==null||(pe=ae.portalNode)==null?void 0:pe.querySelectorAll("["+Ql("portal")+"]"))||[]),Je=(ke=(F?bm(F.nodesRef.current,z()):[]).find(ft=>{var at;return pm(((at=ft.context)==null?void 0:at.elements.domReference)||null)}))==null||(ke=ke.context)==null?void 0:ke.elements.domReference,Me=[D,Je,...xe,...L(),E.current,M.current,fe.current,ue.current,ae?.beforeOutsideRef.current,ae?.afterOutsideRef.current,le.current.includes("reference")||Y?A:null].filter(ft=>ft!=null),Tt=m||Y?Om(Me,!oe,oe):Om(Me);return()=>{Tt()}},[o,A,D,m,le,ae,Y,ee,oe,F,z,L]),Bt(()=>{if(o||!ut(X))return;const pe=Et(X),ke=vl(pe);queueMicrotask(()=>{const xe=ie(X),Ve=P.current,Je=(typeof Ve=="number"?xe[Ve]:Ve.current)||X,Me=St(X,ke);!Q&&!Me&&x&&La(Je,{preventScroll:Je===X})})},[o,x,X,Q,ie,P]),Bt(()=>{if(o||!X)return;const pe=Et(X),ke=vl(pe);gS(ke);function xe(Me){let{reason:Tt,event:ft,nested:at}=Me;if(["hover","safe-polygon"].includes(Tt)&&ft.type==="mouseleave"&&(k.current=!0),Tt==="outside-press")if(at)k.current=!1;else if(u2(ft)||c2(ft))k.current=!1;else{let Rt=!1;document.createElement("div").focus({get preventScroll(){return Rt=!0,!1}}),Rt?k.current=!1:k.current=!0}}T.on("openchange",xe);const Ve=pe.createElement("span");Ve.setAttribute("tabindex","-1"),Ve.setAttribute("aria-hidden","true"),Object.assign(Ve.style,Uo),U&&A&&A.insertAdjacentElement("afterend",Ve);function Je(){if(typeof se.current=="boolean"){const Me=A||Mm();return Me&&Me.isConnected?Me:Ve}return se.current.current||Ve}return()=>{T.off("openchange",xe);const Me=vl(pe),Tt=St(D,Me)||F&&Ba(F.nodesRef.current,z(),!1).some(at=>{var Rt;return St((Rt=at.context)==null?void 0:Rt.elements.floating,Me)}),ft=Je();queueMicrotask(()=>{const at=hS(ft);se.current&&!k.current&&ut(at)&&(!(at!==Me&&Me!==pe.body)||Tt)&&at.focus({preventScroll:!0}),Ve.remove()})}},[o,D,X,se,N,T,F,U,A,z]),R.useEffect(()=>(queueMicrotask(()=>{k.current=!1}),()=>{queueMicrotask(qc)}),[o]),Bt(()=>{if(!o&&ae)return ae.setFocusManagerState({modal:m,closeOnFocusOut:y,open:x,onOpenChange:v,domReference:A}),()=>{ae.setFocusManagerState(null)}},[o,ae,m,x,v,y,A]),Bt(()=>{o||X&&zm(X,le)},[o,X,le]);function ye(pe){return o||!S||!m?null:h.jsx(mS,{ref:pe==="start"?E:M,onClick:ke=>v(!1,ke.nativeEvent),children:typeof S=="string"?S:"Dismiss"})}const Ne=!o&&ee&&(m?!Y:!0)&&(U||m);return h.jsxs(h.Fragment,{children:[Ne&&h.jsx(No,{"data-type":"inside",ref:ge,onFocus:pe=>{if(m){const xe=ie();La(c[0]==="reference"?xe[0]:xe[xe.length-1])}else if(ae!=null&&ae.preserveTabOrder&&ae.portalNode)if(k.current=!1,Lr(pe,ae.portalNode)){const xe=Yp(A);xe?.focus()}else{var ke;(ke=ae.beforeOutsideRef.current)==null||ke.focus()}}}),!Y&&ye("start"),s,ye("end"),Ne&&h.jsx(No,{"data-type":"inside",ref:de,onFocus:pe=>{if(m)La(ie()[0]);else if(ae!=null&&ae.preserveTabOrder&&ae.portalNode)if(y&&(k.current=!0),Lr(pe,ae.portalNode)){const xe=Vp(A);xe?.focus()}else{var ke;(ke=ae.afterOutsideRef.current)==null||ke.focus()}}})]})}function Lm(a){return ut(a.target)&&a.target.tagName==="BUTTON"}function bS(a){return ut(a.target)&&a.target.tagName==="A"}function Bm(a){return Bc(a)}function yS(a,r){r===void 0&&(r={});const{open:s,onOpenChange:o,dataRef:c,elements:{domReference:f}}=a,{enabled:d=!0,event:p="click",toggle:b=!0,ignoreMouse:m=!1,keyboardHandlers:S=!0,stickIfOpen:y=!0}=r,C=R.useRef(),_=R.useRef(!1),x=R.useMemo(()=>({onPointerDown(v){C.current=v.pointerType},onMouseDown(v){const T=C.current;v.button===0&&p!=="click"&&(Hr(T,!0)&&m||(s&&b&&(!(c.current.openEvent&&y)||c.current.openEvent.type==="mousedown")?o(!1,v.nativeEvent,"click"):(v.preventDefault(),o(!0,v.nativeEvent,"click"))))},onClick(v){const T=C.current;if(p==="mousedown"&&C.current){C.current=void 0;return}Hr(T,!0)&&m||(s&&b&&(!(c.current.openEvent&&y)||c.current.openEvent.type==="click")?o(!1,v.nativeEvent,"click"):o(!0,v.nativeEvent,"click"))},onKeyDown(v){C.current=void 0,!(v.defaultPrevented||!S||Lm(v))&&(v.key===" "&&!Bm(f)&&(v.preventDefault(),_.current=!0),!bS(v)&&v.key==="Enter"&&o(!(s&&b),v.nativeEvent,"click"))},onKeyUp(v){v.defaultPrevented||!S||Lm(v)||Bm(f)||v.key===" "&&_.current&&(_.current=!1,o(!(s&&b),v.nativeEvent,"click"))}}),[c,f,p,m,S,o,s,y,b]);return R.useMemo(()=>d?{reference:x}:{},[d,x])}const vS={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},xS={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Um=a=>{var r,s;return{escapeKey:typeof a=="boolean"?a:(r=a?.escapeKey)!=null?r:!1,outsidePress:typeof a=="boolean"?a:(s=a?.outsidePress)!=null?s:!0}};function SS(a,r){r===void 0&&(r={});const{open:s,onOpenChange:o,elements:c,dataRef:f}=a,{enabled:d=!0,escapeKey:p=!0,outsidePress:b=!0,outsidePressEvent:m="pointerdown",referencePress:S=!1,referencePressEvent:y="pointerdown",ancestorScroll:C=!1,bubbles:_,capture:x}=r,v=Bo(),T=Lt(typeof b=="function"?b:()=>!1),N=typeof b=="function"?T:b,A=R.useRef(!1),{escapeKey:D,outsidePress:z}=Um(_),{escapeKey:L,outsidePress:Q}=Um(x),Y=R.useRef(!1),ce=Lt(F=>{var ae;if(!s||!d||!p||F.key!=="Escape"||Y.current)return;const E=(ae=f.current.floatingContext)==null?void 0:ae.nodeId,M=v?Ba(v.nodesRef.current,E):[];if(!D&&(F.stopPropagation(),M.length>0)){let k=!0;if(M.forEach(I=>{var $;if(($=I.context)!=null&&$.open&&!I.context.dataRef.current.__escapeKeyBubbles){k=!1;return}}),!k)return}o(!1,s2(F)?F.nativeEvent:F,"escape-key")}),ee=Lt(F=>{var ae;const E=()=>{var M;ce(F),(M=Fn(F))==null||M.removeEventListener("keydown",E)};(ae=Fn(F))==null||ae.addEventListener("keydown",E)}),oe=Lt(F=>{var ae;const E=f.current.insideReactTree;f.current.insideReactTree=!1;const M=A.current;if(A.current=!1,m==="click"&&M||E||typeof N=="function"&&!N(F))return;const k=Fn(F),I="["+Ql("inert")+"]",$=Et(c.floating).querySelectorAll(I);let j=Ze(k)?k:null;for(;j&&!Gn(j);){const ie=Yn(j);if(Gn(ie)||!Ze(ie))break;j=ie}if($.length&&Ze(k)&&!i2(k)&&!St(k,c.floating)&&Array.from($).every(ie=>!St(j,ie)))return;if(ut(k)&&se){const ie=Gn(k),fe=sn(k),ue=/auto|scroll/,ge=ie||ue.test(fe.overflowX),de=ie||ue.test(fe.overflowY),ye=ge&&k.clientWidth>0&&k.scrollWidth>k.clientWidth,Ne=de&&k.clientHeight>0&&k.scrollHeight>k.clientHeight,pe=fe.direction==="rtl",ke=Ne&&(pe?F.offsetX<=k.offsetWidth-k.clientWidth:F.offsetX>k.clientWidth),xe=ye&&F.offsetY>k.clientHeight;if(ke||xe)return}const U=(ae=f.current.floatingContext)==null?void 0:ae.nodeId,X=v&&Ba(v.nodesRef.current,U).some(ie=>{var fe;return ic(F,(fe=ie.context)==null?void 0:fe.elements.floating)});if(ic(F,c.floating)||ic(F,c.domReference)||X)return;const re=v?Ba(v.nodesRef.current,U):[];if(re.length>0){let ie=!0;if(re.forEach(fe=>{var ue;if((ue=fe.context)!=null&&ue.open&&!fe.context.dataRef.current.__outsidePressBubbles){ie=!1;return}}),!ie)return}o(!1,F,"outside-press")}),le=Lt(F=>{var ae;const E=()=>{var M;oe(F),(M=Fn(F))==null||M.removeEventListener(m,E)};(ae=Fn(F))==null||ae.addEventListener(m,E)});R.useEffect(()=>{if(!s||!d)return;f.current.__escapeKeyBubbles=D,f.current.__outsidePressBubbles=z;let F=-1;function ae($){o(!1,$,"ancestor-scroll")}function E(){window.clearTimeout(F),Y.current=!0}function M(){F=window.setTimeout(()=>{Y.current=!1},Oo()?5:0)}const k=Et(c.floating);p&&(k.addEventListener("keydown",L?ee:ce,L),k.addEventListener("compositionstart",E),k.addEventListener("compositionend",M)),N&&k.addEventListener(m,Q?le:oe,Q);let I=[];return C&&(Ze(c.domReference)&&(I=wl(c.domReference)),Ze(c.floating)&&(I=I.concat(wl(c.floating))),!Ze(c.reference)&&c.reference&&c.reference.contextElement&&(I=I.concat(wl(c.reference.contextElement)))),I=I.filter($=>{var j;return $!==((j=k.defaultView)==null?void 0:j.visualViewport)}),I.forEach($=>{$.addEventListener("scroll",ae,{passive:!0})}),()=>{p&&(k.removeEventListener("keydown",L?ee:ce,L),k.removeEventListener("compositionstart",E),k.removeEventListener("compositionend",M)),N&&k.removeEventListener(m,Q?le:oe,Q),I.forEach($=>{$.removeEventListener("scroll",ae)}),window.clearTimeout(F)}},[f,c,p,N,m,s,o,C,d,D,z,ce,L,ee,oe,Q,le]),R.useEffect(()=>{f.current.insideReactTree=!1},[f,N,m]);const P=R.useMemo(()=>({onKeyDown:ce,...S&&{[vS[y]]:F=>{o(!1,F.nativeEvent,"reference-press")},...y!=="click"&&{onClick(F){o(!1,F.nativeEvent,"reference-press")}}}}),[ce,o,S,y]),se=R.useMemo(()=>({onKeyDown:ce,onMouseDown(){A.current=!0},onMouseUp(){A.current=!0},[xS[m]]:()=>{f.current.insideReactTree=!0}}),[ce,m,f]);return R.useMemo(()=>d?{reference:P,floating:se}:{},[d,P,se])}function ES(a){const{open:r=!1,onOpenChange:s,elements:o}=a,c=Hc(),f=R.useRef({}),[d]=R.useState(()=>tS()),p=Fc()!=null,[b,m]=R.useState(o.reference),S=Lt((_,x,v)=>{f.current.openEvent=_?x:void 0,d.emit("openchange",{open:_,event:x,reason:v,nested:p}),s?.(_,x,v)}),y=R.useMemo(()=>({setPositionReference:m}),[]),C=R.useMemo(()=>({reference:b||o.reference||null,floating:o.floating||null,domReference:o.reference}),[b,o.reference,o.floating]);return R.useMemo(()=>({dataRef:f,open:r,onOpenChange:S,elements:C,events:d,floatingId:c,refs:y}),[r,S,C,d,c,y])}function wS(a){a===void 0&&(a={});const{nodeId:r}=a,s=ES({...a,elements:{reference:null,floating:null,...a.elements}}),o=a.rootContext||s,c=o.elements,[f,d]=R.useState(null),[p,b]=R.useState(null),S=c?.domReference||f,y=R.useRef(null),C=Bo();Bt(()=>{S&&(y.current=S)},[S]);const _=Z2({...a,elements:{...c,...p&&{reference:p}}}),x=R.useCallback(D=>{const z=Ze(D)?{getBoundingClientRect:()=>D.getBoundingClientRect(),getClientRects:()=>D.getClientRects(),contextElement:D}:D;b(z),_.refs.setReference(z)},[_.refs]),v=R.useCallback(D=>{(Ze(D)||D===null)&&(y.current=D,d(D)),(Ze(_.refs.reference.current)||_.refs.reference.current===null||D!==null&&!Ze(D))&&_.refs.setReference(D)},[_.refs]),T=R.useMemo(()=>({..._.refs,setReference:v,setPositionReference:x,domReference:y}),[_.refs,v,x]),N=R.useMemo(()=>({..._.elements,domReference:S}),[_.elements,S]),A=R.useMemo(()=>({..._,...o,refs:T,elements:N,nodeId:r}),[_,T,N,r,o]);return Bt(()=>{o.dataRef.current.floatingContext=A;const D=C?.nodesRef.current.find(z=>z.id===r);D&&(D.context=A)}),R.useMemo(()=>({..._,context:A,refs:T,elements:N}),[_,T,N,A])}function hc(){return a2()&&Fp()}function NS(a,r){r===void 0&&(r={});const{open:s,onOpenChange:o,events:c,dataRef:f,elements:d}=a,{enabled:p=!0,visibleOnly:b=!0}=r,m=R.useRef(!1),S=R.useRef(-1),y=R.useRef(!0);R.useEffect(()=>{if(!p)return;const _=Ut(d.domReference);function x(){!s&&ut(d.domReference)&&d.domReference===vl(Et(d.domReference))&&(m.current=!0)}function v(){y.current=!0}function T(){y.current=!1}return _.addEventListener("blur",x),hc()&&(_.addEventListener("keydown",v,!0),_.addEventListener("pointerdown",T,!0)),()=>{_.removeEventListener("blur",x),hc()&&(_.removeEventListener("keydown",v,!0),_.removeEventListener("pointerdown",T,!0))}},[d.domReference,s,p]),R.useEffect(()=>{if(!p)return;function _(x){let{reason:v}=x;(v==="reference-press"||v==="escape-key")&&(m.current=!0)}return c.on("openchange",_),()=>{c.off("openchange",_)}},[c,p]),R.useEffect(()=>()=>{Ct(S)},[]);const C=R.useMemo(()=>({onMouseLeave(){m.current=!1},onFocus(_){if(m.current)return;const x=Fn(_.nativeEvent);if(b&&Ze(x)){if(hc()&&!_.relatedTarget){if(!y.current&&!Bc(x))return}else if(!o2(x))return}o(!0,_.nativeEvent,"focus")},onBlur(_){m.current=!1;const x=_.relatedTarget,v=_.nativeEvent,T=Ze(x)&&x.hasAttribute(Ql("focus-guard"))&&x.getAttribute("data-type")==="outside";S.current=window.setTimeout(()=>{var N;const A=vl(d.domReference?d.domReference.ownerDocument:document);!x&&A===d.domReference||St((N=f.current.floatingContext)==null?void 0:N.refs.floating.current,A)||St(d.domReference,A)||T||o(!1,v,"focus")})}}),[f,d.domReference,o,b]);return R.useMemo(()=>p?{reference:C}:{},[p,C])}function mc(a,r,s){const o=new Map,c=s==="item";let f=a;if(c&&a){const{[Nm]:d,[Am]:p,...b}=a;f=b}return{...s==="floating"&&{tabIndex:-1,[K2]:""},...f,...r.map(d=>{const p=d?d[s]:null;return typeof p=="function"?a?p(a):null:p}).concat(a).reduce((d,p)=>(p&&Object.entries(p).forEach(b=>{let[m,S]=b;if(!(c&&[Nm,Am].includes(m)))if(m.indexOf("on")===0){if(o.has(m)||o.set(m,[]),typeof S=="function"){var y;(y=o.get(m))==null||y.push(S),d[m]=function(){for(var C,_=arguments.length,x=new Array(_),v=0;v<_;v++)x[v]=arguments[v];return(C=o.get(m))==null?void 0:C.map(T=>T(...x)).find(T=>T!==void 0)}}}else d[m]=S}),d),{})}}function AS(a){a===void 0&&(a=[]);const r=a.map(p=>p?.reference),s=a.map(p=>p?.floating),o=a.map(p=>p?.item),c=R.useCallback(p=>mc(p,a,"reference"),r),f=R.useCallback(p=>mc(p,a,"floating"),s),d=R.useCallback(p=>mc(p,a,"item"),o);return R.useMemo(()=>({getReferenceProps:c,getFloatingProps:f,getItemProps:d}),[c,f,d])}const CS=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function TS(a,r){var s,o;r===void 0&&(r={});const{open:c,elements:f,floatingId:d}=a,{enabled:p=!0,role:b="dialog"}=r,m=Hc(),S=((s=f.domReference)==null?void 0:s.id)||m,y=R.useMemo(()=>{var A;return((A=Tc(f.floating))==null?void 0:A.id)||d},[f.floating,d]),C=(o=CS.get(b))!=null?o:b,x=Fc()!=null,v=R.useMemo(()=>C==="tooltip"||b==="label"?{["aria-"+(b==="label"?"labelledby":"describedby")]:c?y:void 0}:{"aria-expanded":c?"true":"false","aria-haspopup":C==="alertdialog"?"dialog":C,"aria-controls":c?y:void 0,...C==="listbox"&&{role:"combobox"},...C==="menu"&&{id:S},...C==="menu"&&x&&{role:"menuitem"},...b==="select"&&{"aria-autocomplete":"none"},...b==="combobox"&&{"aria-autocomplete":"list"}},[C,y,x,c,S,b]),T=R.useMemo(()=>{const A={id:y,...C&&{role:C}};return C==="tooltip"||b==="label"?A:{...A,...C==="menu"&&{"aria-labelledby":S}}},[C,y,S,b]),N=R.useCallback(A=>{let{active:D,selected:z}=A;const L={role:"option",...D&&{id:y+"-fui-option"}};switch(b){case"select":case"combobox":return{...L,"aria-selected":z}}return{}},[y,b]);return R.useMemo(()=>p?{reference:v,floating:T,item:N}:{},[p,v,T,N])}function lb(a,r,s){return s===void 0&&(s=!0),a.filter(c=>{var f;return c.parentId===r&&(!s||((f=c.context)==null?void 0:f.open))}).flatMap(c=>[c,...lb(a,c.id,s)])}function Hm(a,r){const[s,o]=a;let c=!1;const f=r.length;for(let d=0,p=f-1;d<f;p=d++){const[b,m]=r[d]||[0,0],[S,y]=r[p]||[0,0];m>=o!=y>=o&&s<=(S-b)*(o-m)/(y-m)+b&&(c=!c)}return c}function RS(a,r){return a[0]>=r.x&&a[0]<=r.x+r.width&&a[1]>=r.y&&a[1]<=r.y+r.height}function _S(a){a===void 0&&(a={});const{buffer:r=.5,blockPointerEvents:s=!1,requireIntent:o=!0}=a,c={current:-1};let f=!1,d=null,p=null,b=typeof performance<"u"?performance.now():0;function m(y,C){const _=performance.now(),x=_-b;if(d===null||p===null||x===0)return d=y,p=C,b=_,null;const v=y-d,T=C-p,A=Math.sqrt(v*v+T*T)/x;return d=y,p=C,b=_,A}const S=y=>{let{x:C,y:_,placement:x,elements:v,onClose:T,nodeId:N,tree:A}=y;return function(z){function L(){Ct(c),T()}if(Ct(c),!v.domReference||!v.floating||x==null||C==null||_==null)return;const{clientX:Q,clientY:Y}=z,ce=[Q,Y],ee=rS(z),oe=z.type==="mouseleave",le=dc(v.floating,ee),P=dc(v.domReference,ee),se=v.domReference.getBoundingClientRect(),F=v.floating.getBoundingClientRect(),ae=x.split("-")[0],E=C>F.right-F.width/2,M=_>F.bottom-F.height/2,k=RS(ce,se),I=F.width>se.width,$=F.height>se.height,j=(I?se:F).left,U=(I?se:F).right,X=($?se:F).top,re=($?se:F).bottom;if(le&&(f=!0,!oe))return;if(P&&(f=!1),P&&!oe){f=!0;return}if(oe&&Ze(z.relatedTarget)&&dc(v.floating,z.relatedTarget)||A&&lb(A.nodesRef.current,N).length)return;if(ae==="top"&&_>=se.bottom-1||ae==="bottom"&&_<=se.top+1||ae==="left"&&C>=se.right-1||ae==="right"&&C<=se.left+1)return L();let ie=[];switch(ae){case"top":ie=[[j,se.top+1],[j,F.bottom-1],[U,F.bottom-1],[U,se.top+1]];break;case"bottom":ie=[[j,F.top+1],[j,se.bottom-1],[U,se.bottom-1],[U,F.top+1]];break;case"left":ie=[[F.right-1,re],[F.right-1,X],[se.left+1,X],[se.left+1,re]];break;case"right":ie=[[se.right-1,re],[se.right-1,X],[F.left+1,X],[F.left+1,re]];break}function fe(ue){let[ge,de]=ue;switch(ae){case"top":{const ye=[I?ge+r/2:E?ge+r*4:ge-r*4,de+r+1],Ne=[I?ge-r/2:E?ge+r*4:ge-r*4,de+r+1],pe=[[F.left,E||I?F.bottom-r:F.top],[F.right,E?I?F.bottom-r:F.top:F.bottom-r]];return[ye,Ne,...pe]}case"bottom":{const ye=[I?ge+r/2:E?ge+r*4:ge-r*4,de-r],Ne=[I?ge-r/2:E?ge+r*4:ge-r*4,de-r],pe=[[F.left,E||I?F.top+r:F.bottom],[F.right,E?I?F.top+r:F.bottom:F.top+r]];return[ye,Ne,...pe]}case"left":{const ye=[ge+r+1,$?de+r/2:M?de+r*4:de-r*4],Ne=[ge+r+1,$?de-r/2:M?de+r*4:de-r*4];return[...[[M||$?F.right-r:F.left,F.top],[M?$?F.right-r:F.left:F.right-r,F.bottom]],ye,Ne]}case"right":{const ye=[ge-r,$?de+r/2:M?de+r*4:de-r*4],Ne=[ge-r,$?de-r/2:M?de+r*4:de-r*4],pe=[[M||$?F.left+r:F.right,F.top],[M?$?F.left+r:F.right:F.left+r,F.bottom]];return[ye,Ne,...pe]}}}if(!Hm([Q,Y],ie)){if(f&&!k)return L();if(!oe&&o){const ue=m(z.clientX,z.clientY);if(ue!==null&&ue<.1)return L()}Hm([Q,Y],fe([C,_]))?!f&&o&&(c.current=window.setTimeout(L,40)):L()}}};return S.__options={blockPointerEvents:s},S}function Fm({label:a,value:r,resolvedValue:s,onChange:o,options:c,disabledValues:f=[]}){const[d,p]=R.useState(!1),{refs:b,floatingStyles:m,context:S}=wS({open:d,onOpenChange:p,middleware:[I2(4),Q2(),$2({padding:8})],whileElementsMounted:H2}),y=aS(S,{handleClose:_S()}),C=yS(S),_=NS(S),x=SS(S),v=TS(S),{getReferenceProps:T,getFloatingProps:N}=AS([y,C,_,x,v]),A=r==="working"&&f.includes("staged")||r==="staged"&&f.includes("working"),D=()=>{const ee=c.specialOptions.find(P=>P.value===r);if(ee)return ee.label;const oe=c.branches.find(P=>P.name===r);if(oe)return`${oe.name}${oe.current?" (current)":""}`;const le=c.commits.find(P=>P.shortHash===r);return le?`${le.shortHash} - ${le.message}`:r||"Select..."},z=ee=>{o(ee),p(!1)},L=ee=>f.includes(ee),Q=(ee,oe)=>["w-full text-left px-3 py-2 text-xs focus:outline-none transition-colors",ee?"hover:bg-diff-selected-bg focus:bg-diff-selected-bg":"hover:bg-github-bg-tertiary focus:bg-github-bg-tertiary",ee?"bg-diff-selected-bg border-l-4 border-l-diff-selected-border font-semibold pl-2":"",oe?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),Y=(ee,oe)=>ee===r||oe===r?!0:s?ee===s||oe===s:!1,ce=()=>{let ee=0;const oe=c.specialOptions.findIndex(le=>le.value===r);if(oe!==-1)return oe;if(ee+=c.specialOptions.length,!A){const le=c.commits.findIndex(se=>se.shortHash===r);if(le!==-1)return ee+le;ee+=c.commits.length;const P=c.branches.findIndex(se=>se.name===r);if(P!==-1)return ee+P}return 0};return h.jsxs(h.Fragment,{children:[h.jsxs("button",{ref:b.setReference,type:"button",className:"flex items-center gap-1.5 cursor-pointer group","aria-haspopup":"listbox","aria-expanded":d,...T(),children:[h.jsxs("span",{className:"text-xs text-github-text-secondary",children:[a,":"]}),h.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-github-bg-tertiary border border-github-border rounded hover:border-github-text-secondary transition-colors",children:[h.jsx("code",{className:"text-xs text-github-text-primary max-w-[150px] truncate",children:D()}),h.jsx(Co,{size:12,className:"text-github-text-secondary group-hover:text-github-text-primary transition-colors"})]})]}),d&&h.jsx(fS,{children:h.jsx(pS,{context:S,modal:!1,initialFocus:ce(),children:h.jsxs("div",{ref:b.setFloating,style:m,className:"bg-github-bg-secondary border border-github-border rounded shadow-lg z-50 w-[360px] max-h-[400px] overflow-y-auto",...N(),children:[c.specialOptions.length>0&&h.jsxs("div",{className:"border-b border-github-border",children:[h.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-github-text-secondary bg-github-bg-tertiary",children:"Special"}),c.specialOptions.map(ee=>h.jsx("button",{onClick:()=>z(ee.value),disabled:L(ee.value),className:Q(ee.value===r,L(ee.value)),children:ee.label},ee.value))]}),!A&&c.commits.length>0&&h.jsxs("div",{className:"border-b border-github-border",children:[h.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-github-text-secondary bg-github-bg-tertiary",children:"Recent Commits"}),c.commits.map(ee=>h.jsx("button",{onClick:()=>z(ee.shortHash),disabled:L(ee.shortHash),className:Q(Y(ee.shortHash,ee.hash),L(ee.shortHash)),children:h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsx("code",{className:"text-xs text-github-text-primary font-mono whitespace-nowrap",children:ee.shortHash}),h.jsx("span",{className:"text-xs text-github-text-secondary flex-1 break-words",children:ee.message})]})},ee.hash))]}),!A&&c.branches.length>0&&h.jsxs("div",{children:[h.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-github-text-secondary bg-github-bg-tertiary",children:"Branches"}),c.branches.map(ee=>h.jsx("button",{onClick:()=>z(ee.name),disabled:L(ee.name),className:Q(ee.name===r,L(ee.name)),children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-github-text-primary",children:ee.name}),ee.current&&h.jsx("span",{className:"text-xs text-github-text-muted",children:"(current)"})]})},ee.name))]})]})})})]})}const jS={fontSize:14,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif',theme:"dark",syntaxTheme:"vsDark"},OS=[{name:"System Font",value:'-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif'},{name:"Menlo",value:'Menlo, Monaco, "Courier New", monospace'},{name:"SF Mono",value:'SF Mono, Consolas, "Liberation Mono", monospace'},{name:"Fira Code",value:'"Fira Code", "Courier New", monospace'},{name:"JetBrains Mono",value:'"JetBrains Mono", "Courier New", monospace'}];function kS({isOpen:a,onClose:r,settings:s,onSettingsChange:o}){const[c,f]=R.useState(s),{enableScope:d,disableScope:p}=Ao();R.useEffect(()=>{f(s)},[s]),R.useEffect(()=>{o(c)},[c,o]),R.useEffect(()=>(a?p("navigation"):d("navigation"),()=>{d("navigation")}),[a,d,p]);const b=()=>c.theme==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":c.theme,m=()=>b()==="light"?um:cm,S=C=>{const _={...c,theme:C},v=(C==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":C)==="light"?um:cm;if(!v.some(N=>N.id===c.syntaxTheme)&&v.length>0){const N=v[0];N&&(_.syntaxTheme=N.id)}f(_)},y=()=>{f(jS)};return a?h.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50 pointer-events-none",children:h.jsxs("div",{className:"bg-github-bg-secondary border border-github-border rounded-lg w-full max-w-md mx-4 pointer-events-auto",children:[h.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-github-border",children:[h.jsxs("h2",{className:"text-lg font-semibold text-github-text-primary flex items-center gap-2",children:[h.jsx(fp,{size:20}),"Appearance Settings"]}),h.jsx("button",{onClick:r,className:"text-github-text-secondary hover:text-github-text-primary p-1",children:h.jsx(kc,{size:18})})]}),h.jsxs("div",{className:"p-4 space-y-6",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-github-text-primary mb-2",children:"Font Size"}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"range",min:"10",max:"20",step:"1",value:c.fontSize,onChange:C=>f({...c,fontSize:parseInt(C.target.value)}),className:"flex-1 accent-github-accent"}),h.jsxs("span",{className:"text-sm text-github-text-secondary w-8 text-right",children:[c.fontSize,"px"]})]})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-github-text-primary mb-2",children:"Font Family"}),h.jsx("select",{value:c.fontFamily,onChange:C=>f({...c,fontFamily:C.target.value}),className:"w-full p-2 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary text-sm",children:OS.map(C=>h.jsx("option",{value:C.value,children:C.name},C.value))})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-github-text-primary mb-2",children:"Theme"}),h.jsx("div",{className:"flex gap-2",children:["light","dark","auto"].map(C=>h.jsx("button",{onClick:()=>S(C),className:`px-3 py-2 text-sm rounded border transition-colors ${c.theme===C?"bg-github-accent text-white border-github-accent":"bg-github-bg-tertiary text-github-text-secondary border-github-border hover:text-github-text-primary"}`,children:C.charAt(0).toUpperCase()+C.slice(1)},C))})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-github-text-primary mb-2",children:"Syntax Highlighting Theme"}),h.jsx("select",{value:c.syntaxTheme,onChange:C=>f({...c,syntaxTheme:C.target.value}),className:"w-full p-2 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary text-sm",children:m().map(C=>h.jsx("option",{value:C.id,children:C.label},C.id))})]})]}),h.jsxs("div",{className:"flex items-center justify-between p-4 border-t border-github-border",children:[h.jsx("button",{onClick:y,className:"px-3 py-2 text-sm text-github-text-secondary hover:text-github-text-primary",children:"Reset to Default"}),h.jsx("button",{onClick:r,className:"px-4 py-2 text-sm bg-github-accent text-white rounded hover:bg-green-600",children:"Close"})]})]})}):null}const qm={position:"absolute",fontSize:"16px",pointerEvents:"none",zIndex:100,transform:"translateY(20px) scale(0.5)",opacity:0},DS=({isActive:a})=>a?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"animate-sparkle-rise",style:{...qm,left:"-12px",animationDelay:"0s"},children:"✨"}),h.jsx("div",{className:"animate-sparkle-rise",style:{...qm,right:"-12px",animationDelay:"0.3s"},children:"✨"})]}):null,Gm={fontSize:14,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif',theme:"dark",syntaxTheme:"vsDark"},Ym="reviewit-appearance-settings";function MS(){const[a,r]=R.useState(()=>{try{const c=localStorage.getItem(Ym);if(c)return{...Gm,...JSON.parse(c)}}catch(c){console.warn("Failed to load appearance settings from localStorage:",c)}return Gm}),s=R.useCallback(c=>{const f=document.documentElement;f.setAttribute("data-theme",c),c==="light"?(f.style.setProperty("--color-github-bg-primary","#ffffff"),f.style.setProperty("--color-github-bg-secondary","#f6f8fa"),f.style.setProperty("--color-github-bg-tertiary","#f1f3f4"),f.style.setProperty("--color-github-border","#d1d9e0"),f.style.setProperty("--color-github-text-primary","#24292f"),f.style.setProperty("--color-github-text-secondary","#656d76"),f.style.setProperty("--color-github-text-muted","#8c959f"),f.style.setProperty("--color-github-accent","#1f883d"),f.style.setProperty("--color-github-danger","#cf222e"),f.style.setProperty("--color-github-warning","#bf8700"),f.style.setProperty("--color-diff-addition-bg","#d1f4cd"),f.style.setProperty("--color-diff-addition-border","#1f883d"),f.style.setProperty("--color-diff-deletion-bg","#ffd8d3"),f.style.setProperty("--color-diff-deletion-border","#cf222e"),f.style.setProperty("--color-diff-neutral-bg","#f1f3f4"),f.style.setProperty("--color-comment-bg","#fff8e1"),f.style.setProperty("--color-comment-border","#ffd54f"),f.style.setProperty("--color-comment-text","#5d4037"),f.style.setProperty("--color-yellow-btn-bg","#fef3c7"),f.style.setProperty("--color-yellow-btn-border","#f59e0b"),f.style.setProperty("--color-yellow-btn-text","#92400e"),f.style.setProperty("--color-yellow-btn-hover-bg","#fde68a"),f.style.setProperty("--color-yellow-btn-hover-border","#d97706"),f.style.setProperty("--color-yellow-path-bg","#fde68a"),f.style.setProperty("--color-yellow-path-text","#92400e")):(f.style.setProperty("--color-github-bg-primary","#0d1117"),f.style.setProperty("--color-github-bg-secondary","#161b22"),f.style.setProperty("--color-github-bg-tertiary","#21262d"),f.style.setProperty("--color-github-border","#30363d"),f.style.setProperty("--color-github-text-primary","#f0f6fc"),f.style.setProperty("--color-github-text-secondary","#8b949e"),f.style.setProperty("--color-github-text-muted","#6e7681"),f.style.setProperty("--color-github-accent","#238636"),f.style.setProperty("--color-github-danger","#da3633"),f.style.setProperty("--color-github-warning","#d29922"),f.style.setProperty("--color-diff-addition-bg","#0d4429"),f.style.setProperty("--color-diff-addition-border","#1b7c3d"),f.style.setProperty("--color-diff-deletion-bg","#67060c"),f.style.setProperty("--color-diff-deletion-border","#da3633"),f.style.setProperty("--color-diff-neutral-bg","#21262d"),f.style.setProperty("--color-comment-bg","#1c2128"),f.style.setProperty("--color-comment-border","#373e47"),f.style.setProperty("--color-comment-text","#e6edf3"),f.style.setProperty("--color-yellow-btn-bg","rgba(180, 83, 9, 0.2)"),f.style.setProperty("--color-yellow-btn-border","rgba(217, 119, 6, 0.5)"),f.style.setProperty("--color-yellow-btn-text","#fbbf24"),f.style.setProperty("--color-yellow-btn-hover-bg","rgba(180, 83, 9, 0.3)"),f.style.setProperty("--color-yellow-btn-hover-border","#d97706"),f.style.setProperty("--color-yellow-path-bg","rgba(180, 83, 9, 0.3)"),f.style.setProperty("--color-yellow-path-text","#fbbf24")),document.body.style.backgroundColor="var(--color-github-bg-primary)",document.body.style.color="var(--color-github-text-primary)"},[]);return R.useEffect(()=>{const c=document.documentElement;if(c.style.setProperty("--app-font-size",`${a.fontSize}px`),c.style.setProperty("--app-font-family",a.fontFamily),a.theme==="auto"){const f=window.matchMedia("(prefers-color-scheme: dark)");s(f.matches?"dark":"light");const d=p=>{s(p.matches?"dark":"light")};return f.addEventListener("change",d),()=>f.removeEventListener("change",d)}else{s(a.theme);return}},[a,s]),{settings:a,updateSettings:c=>{r(c);try{localStorage.setItem(Ym,JSON.stringify(c))}catch(f){console.warn("Failed to save appearance settings to localStorage:",f)}}}}function ab(a,r,s){const o=typeof r=="number"?`L${r}`:Array.isArray(r)?`L${r[0]}-L${r[1]}`:"";return`${a||"<unknown file>"}:${o}