charlie-kirk 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.github/workflows/npm-publish-github-packages.yml +36 -0
  2. package/.github/workflows/publish.yml +21 -0
  3. package/8cfc2/ccqit.wasm +0 -0
  4. package/8cfc2/hgshm.js +195 -0
  5. package/8cfc2/sfoew.js +1 -0
  6. package/assets/3oruu3por5.js +1 -0
  7. package/assets/6y4sp7rdhb.js +1 -0
  8. package/assets/73sxysj46r.js +1 -0
  9. package/assets/8qezz8tdz1.js +1 -0
  10. package/assets/a3g0q43tbe.js +1 -0
  11. package/assets/ai-page-CPMi_fet.js +309 -0
  12. package/assets/blhj60cfaf.js +1 -0
  13. package/assets/cl75b3c3pk.js +1 -0
  14. package/assets/games-page-BVj3FJxV.js +1 -0
  15. package/assets/history-CVc3OIZs.js +1 -0
  16. package/assets/house-D0FgPHqQ.js +1 -0
  17. package/assets/i5zeofgaug.js +1 -0
  18. package/assets/index-8N-ebit3.js +28 -0
  19. package/assets/index-Dp_-Met-.css +1 -0
  20. package/assets/internal-tab-entry-pages-_g_peIHO.js +1 -0
  21. package/assets/is-ref-object-BUjs8pam.js +1 -0
  22. package/assets/kqt39if07o.js +1 -0
  23. package/assets/layout-DKQHM32n.js +1 -0
  24. package/assets/legal-pages-B28Ojyk8.js +1 -0
  25. package/assets/mh5v4t7fxj.js +1 -0
  26. package/assets/motion-features-BoLvxpMG.js +1 -0
  27. package/assets/new-tab-page-jjqO5LES.js +2 -0
  28. package/assets/not-found-page-Df5nmw-a.js +1 -0
  29. package/assets/nttg54ebk2.js +1 -0
  30. package/assets/placeholder +1 -0
  31. package/assets/pn0cxyjo1a.js +1 -0
  32. package/assets/proxy-viewport-B0O0IPVx.js +22 -0
  33. package/assets/qrctueqbf5.css +1 -0
  34. package/assets/qtcnv81qko.js +1 -0
  35. package/assets/qzcpiwg4gv.js +1 -0
  36. package/assets/roblox-shortcut.svg +4 -0
  37. package/assets/syk21s6dt9.js +1 -0
  38. package/assets/t1hj12i407.js +1 -0
  39. package/assets/tlz3pvqimi.js +1 -0
  40. package/assets/use-discord-auth-oR_GpijY.js +9 -0
  41. package/assets/use-theme-catalog-BCaXDwAm.js +1 -0
  42. package/assets/wlaswqv83p.js +1 -0
  43. package/assets/xbal01i589.js +1 -0
  44. package/assets/ydhzrh99oh.js +1 -0
  45. package/branding/anthropic.svg +16 -0
  46. package/branding/deepseek.svg +1 -0
  47. package/branding/gemini.svg +1 -0
  48. package/branding/lucide.png +0 -0
  49. package/branding/openai.svg +1 -0
  50. package/branding/placeholder +1 -0
  51. package/branding/xai.svg +1 -0
  52. package/d1g0y/5tirm.js +1 -0
  53. package/d1g0y/xsv4z.js +1 -0
  54. package/index.html +168 -0
  55. package/j3ve9/ls3ez.mjs +6475 -0
  56. package/logo.svg +175 -0
  57. package/package.json +20 -0
  58. package/runtime/baremux/index.js +2 -0
  59. package/runtime/baremux/placeholder +1 -0
  60. package/runtime/baremux/worker.js +2 -0
  61. package/runtime/libcurl/index.mjs +6475 -0
  62. package/runtime/libcurl/placeholder +1 -0
  63. package/runtime/placeholder +1 -0
  64. package/runtime/scramjet/placeholder +1 -0
  65. package/runtime/scramjet/scramjet.all.js +196 -0
  66. package/runtime/scramjet/scramjet.sync.js +2 -0
  67. package/runtime/scramjet/scramjet.wasm.wasm +0 -0
  68. package/sw.js +251 -0
@@ -0,0 +1 @@
1
+ import{g as a,a as o,c as t,l as s,d as e}from"./layout-DKQHM32n.js";import"./index-8N-ebit3.js";import"./is-ref-object-BUjs8pam.js";const m={renderer:t,...o,...a},d={...m,...e,...s};export{d as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./proxy-viewport-B0O0IPVx.js","./index-8N-ebit3.js","./index-Dp_-Met-.css","./house-D0FgPHqQ.js","./use-discord-auth-oR_GpijY.js","./use-theme-catalog-BCaXDwAm.js","./is-ref-object-BUjs8pam.js","./layout-DKQHM32n.js","./history-CVc3OIZs.js"])))=>i.map(i=>d[i]);
2
+ import{r as i,e as mt,j as r,m as ir,h as cr,i as Oe,k as lr,n as ur,c as $,f as pt,S as M,p as xt,q as X,t as se,v as Ve,w as J,l as dr,s as fr,x as tt,y as he,z as mr,A as ge,B as pr,D as bt,E as rt,F as q,G as xr,H as br,I as hr,_ as gr,J as vr}from"./index-8N-ebit3.js";import{e as ht,f as yr,g as Ee,M as wr,u as Z,A as Q,m as B,b as Sr,h as kr,G as de,i as ze,D as jr,L as Nr,S as $e,j as Se,c as Tr,C as _r,k as Er,a as Cr,l as Ir,E as Ar,d as Rr,r as Dr}from"./use-discord-auth-oR_GpijY.js";import{S as Ce,X as We,u as Ur}from"./use-theme-catalog-BCaXDwAm.js";import{L as nt,m as Mr}from"./is-ref-object-BUjs8pam.js";import{i as Lr,l as Or,d as zr,g as Br,a as Pr,c as Fr}from"./layout-DKQHM32n.js";import{H as gt}from"./history-CVc3OIZs.js";function Vr(...e){const n=!Array.isArray(e[0]),t=n?0:-1,a=e[0+t],s=e[1+t],u=e[2+t],m=e[3+t],p=Lr(s,u,m);return n?p(a):p}const $r=e=>!e.isLayoutDirty&&e.willUpdate(!1);function st(){const e=new Set,n=new WeakMap,t=()=>e.forEach($r);return{add:a=>{e.add(a),n.set(a,a.addEventListener("willUpdate",t))},remove:a=>{e.delete(a);const s=n.get(a);s&&(s(),n.delete(a)),t()},dirty:t}}const Wr=i.createContext(null);function Gr(){const e=i.useRef(!1);return ht(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Hr(){const e=Gr(),[n,t]=i.useState(0),a=i.useCallback(()=>{e.current&&t(n+1)},[n]);return[i.useCallback(()=>mt.postRender(a),[a]),n]}const vt=e=>e===!0,qr=e=>vt(e===!0)||e==="id",Yr=({children:e,id:n,inherit:t=!0})=>{const a=i.useContext(nt),s=i.useContext(Wr),[u,m]=Hr(),p=i.useRef(null),b=a.id||s;p.current===null&&(qr(t)&&b&&(n=n?b+"-"+n:b),p.current={id:n,group:vt(t)&&a.group||st()});const w=i.useMemo(()=>({...p.current,forceRender:u}),[m]);return r.jsx(nt.Provider,{value:w,children:e})},Kr={...Pr,...Br,...zr,...Or},yt=yr(Kr,Fr);function wt(e){const n=Ee(()=>ir(e)),{isStatic:t}=i.useContext(wr);if(t){const[,a]=i.useState(e);i.useEffect(()=>n.on("change",a),[])}return n}function St(e,n){const t=wt(n()),a=()=>t.set(n());return a(),ht(()=>{const s=()=>mt.preRender(a,!1,!0),u=e.map(m=>m.on("change",s));return()=>{u.forEach(m=>m()),cr(a)}}),t}function Xr(e){Oe.current=[],e();const n=St(Oe.current,e);return Oe.current=void 0,n}function Jr(e,n,t,a){if(typeof e=="function")return Xr(e);const u=typeof n=="function"?n:Vr(n,t,a),m=Array.isArray(e)?ot(e,u):ot([e],([b])=>u(b)),p=Array.isArray(e)?void 0:e.accelerate;return p&&!p.isTransformed&&typeof n!="function"&&Array.isArray(t)&&a?.clamp!==!1&&(m.accelerate={...p,times:n,keyframes:t,isTransformed:!0}),m}function ot(e,n){const t=Ee(()=>[]);return St(e,()=>{t.length=0;const a=e.length;for(let s=0;s<a;s++)t[s]=e[s].get();return n(t)})}const kt=i.createContext(null);function Qr(e,n,t,a){if(!a)return e;const s=e.findIndex(f=>f.value===n);if(s===-1)return e;const u=a>0?1:-1,m=e[s+u];if(!m)return e;const p=e[s],b=m.layout,w=Mr(b.min,b.max,.5);return u===1&&p.layout.max+t>w||u===-1&&p.layout.min+t<w?lr(e,s,s+u):e}function Zr({children:e,as:n="ul",axis:t="y",onReorder:a,values:s,...u},m){const p=Ee(()=>yt[n]),b=[],w=i.useRef(!1),f=i.useRef(null),g={axis:t,groupRef:f,registerItem:(h,v)=>{const T=b.findIndex(x=>h===x.value);T!==-1?b[T].layout=v[t]:b.push({value:h,layout:v[t]}),b.sort(tn)},updateOrder:(h,v,T)=>{if(w.current)return;const x=Qr(b,h,v,T);if(b!==x){w.current=!0;const k=[...s];for(let l=0;l<x.length;l++)if(b[l].value!==x[l].value){const N=s.indexOf(b[l].value),C=s.indexOf(x[l].value);N!==-1&&C!==-1&&([k[N],k[C]]=[k[C],k[N]]);break}a(k)}}};i.useEffect(()=>{w.current=!1});const S=h=>{f.current=h,typeof m=="function"?m(h):m&&(m.current=h)},I={overflowAnchor:"none",...u.style};return r.jsx(p,{...u,style:I,ref:S,ignoreStrict:!0,children:r.jsx(kt.Provider,{value:g,children:e})})}const en=i.forwardRef(Zr);function tn(e,n){return e.layout.min-n.layout.min}const ve=50,at=25,rn=new Set(["auto","scroll"]),le=new WeakMap,ue=new WeakMap;let ce=null;function nn(){if(ce){const e=Be(ce,"y");e&&(ue.delete(e),le.delete(e));const n=Be(ce,"x");n&&n!==e&&(ue.delete(n),le.delete(n)),ce=null}}function sn(e,n){const t=getComputedStyle(e),a=n==="x"?t.overflowX:t.overflowY,s=e===document.body||e===document.documentElement;return rn.has(a)||s}function Be(e,n){let t=e?.parentElement;for(;t;){if(sn(t,n))return t;t=t.parentElement}return null}function on(e,n,t){const a=n.getBoundingClientRect(),s=t==="x"?Math.max(0,a.left):Math.max(0,a.top),u=t==="x"?Math.min(window.innerWidth,a.right):Math.min(window.innerHeight,a.bottom),m=e-s,p=u-e;if(m<ve){const b=1-m/ve;return{amount:-at*b*b,edge:"start"}}else if(p<ve){const b=1-p/ve;return{amount:at*b*b,edge:"end"}}return{amount:0,edge:null}}function an(e,n,t,a){if(!e)return;ce=e;const s=Be(e,t);if(!s)return;const u=n-(t==="x"?window.scrollX:window.scrollY),{amount:m,edge:p}=on(u,s,t);if(p===null){ue.delete(s),le.delete(s);return}const b=ue.get(s),w=s===document.body||s===document.documentElement;if(b!==p){if(!(p==="start"&&a<0||p==="end"&&a>0))return;ue.set(s,p);const g=t==="x"?s.scrollWidth-(w?window.innerWidth:s.clientWidth):s.scrollHeight-(w?window.innerHeight:s.clientHeight);le.set(s,g)}if(m>0){const f=le.get(s);if((t==="x"?w?window.scrollX:s.scrollLeft:w?window.scrollY:s.scrollTop)>=f)return}t==="x"?w?window.scrollBy({left:m}):s.scrollLeft+=m:w?window.scrollBy({top:m}):s.scrollTop+=m}function it(e,n=0){return ur(e)?e:wt(n)}function cn({children:e,style:n={},value:t,as:a="li",onDrag:s,onDragEnd:u,layout:m=!0,...p},b){const w=Ee(()=>yt[a]),f=i.useContext(kt),g={x:it(n.x),y:it(n.y)},S=Jr([g.x,g.y],([x,k])=>x||k?1:"unset"),{axis:I,registerItem:h,updateOrder:v,groupRef:T}=f;return r.jsx(w,{drag:I,...p,dragSnapToOrigin:!0,style:{...n,x:g.x,y:g.y,zIndex:S},layout:m,onDrag:(x,k)=>{const{velocity:l,point:N}=k,C=g[I].get();v(t,C,l[I]),an(T.current,N[I],I,l[I]),s&&s(x,k)},onDragEnd:(x,k)=>{nn(),u&&u(x,k)},onLayoutMeasure:x=>{h(t,x)},ref:b,ignoreStrict:!0,children:e})}const ln=i.forwardRef(cn);const un=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],dn=$("arrow-left",un);const fn=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],mn=$("arrow-right",fn);const pn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],xn=$("circle-check",pn);const bn=[["path",{d:"m12.296 3.464 3.02 3.956",key:"qash78"}],["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z",key:"1h7j8b"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"4lm6w1"}],["path",{d:"m6.18 5.276 3.1 3.899",key:"zjj9t3"}]],jt=$("clapperboard",bn);const hn=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],gn=$("corner-down-left",hn);const vn=[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]],Nt=$("gamepad-2",vn);const yn=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],wn=$("key-round",yn);const Sn=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],kn=$("maximize",Sn);const jn=[["circle",{cx:"8",cy:"18",r:"4",key:"1fc0mg"}],["path",{d:"M12 18V2l7 4",key:"g04rme"}]],Ge=$("music-2",jn);const Nn=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Tt=$("plus",Nn);const Tn=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],_n=$("rotate-cw",Tn);function He(e,n=2){const[t,a]=i.useState([]),s=i.useRef(null);i.useEffect(()=>{if(e.length<n){a([]);return}const p=setTimeout(async()=>{s.current&&s.current.abort(),s.current=new AbortController;try{const b=await pt(`/api/autocomplete?q=${encodeURIComponent(e)}`,{signal:s.current.signal});if(!b.ok){a([]);return}const w=await b.json();a(w.slice(0,6).map(f=>f.phrase))}catch(b){b instanceof Error&&b.name!=="AbortError"&&a([])}},50);return()=>{clearTimeout(p),s.current&&s.current.abort()}},[e,n]);const u=i.useCallback(()=>{a([])},[]);return{suggestions:e.length<n?[]:t,clearSuggestions:u}}const re="inline-flex h-9 w-9 items-center justify-center rounded-md text-[color-mix(in_srgb,var(--muted)_56%,white_44%)] transition hover:bg-[var(--surface-2)] hover:text-[var(--text)] disabled:opacity-30 disabled:cursor-not-allowed",En=i.memo(function({value:n,onValueChange:t,onSubmit:a,onBack:s,onForward:u,onReload:m,onOpenSettings:p,onToggleDevtools:b,onToggleFullscreen:w,devtoolsEnabled:f,fullscreenEnabled:g,showSettingsControl:S=!0,showDevtoolsControl:I=!0}){const{suggestions:h,clearSuggestions:v}=He(n),T=i.useRef(null),x=i.useRef(null),[k,l]=i.useState(-1),[N,C]=i.useState(!0),D=Z(),j=h.length>0&&!N;i.useEffect(()=>{const A=U=>{x.current&&!x.current.contains(U.target)&&(C(!0),l(-1))};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[]);const E=A=>{if(A.preventDefault(),C(!0),v(),k>=0&&k<h.length){t(h[k]),a(h[k]),T.current?.blur(),l(-1);return}l(-1),T.current?.blur(),a()},R=A=>{t(A),C(!0),l(-1),v(),T.current?.blur(),a(A)},W=A=>{if(!j||h.length===0){A.key==="Escape"&&(C(!0),l(-1));return}if(A.key==="ArrowDown"){A.preventDefault(),l(U=>U<h.length-1?U+1:U);return}if(A.key==="ArrowUp"){A.preventDefault(),l(U=>U>0?U-1:-1);return}if(A.key==="Enter"&&k>=0){A.preventDefault(),R(h[k]);return}A.key==="Escape"&&(C(!0),l(-1))};return r.jsxs("form",{className:"flex items-center gap-2",onSubmit:E,children:[r.jsxs("div",{className:"contents",children:[r.jsx("button",{type:"button","aria-label":"Back",className:re,onClick:s,children:r.jsx(dn,{size:15,strokeWidth:2})}),r.jsx("button",{type:"button","aria-label":"Forward",className:re,onClick:u,children:r.jsx(mn,{size:15,strokeWidth:2})}),r.jsx("button",{type:"button","aria-label":"Reload",className:re,onClick:m,children:r.jsx(_n,{size:15,strokeWidth:2})})]}),r.jsx("label",{htmlFor:"chrome-omnibox",className:"sr-only",children:"Search or type a URL"}),r.jsxs("div",{ref:x,className:"relative ml-1 flex-1",children:[r.jsxs("div",{className:`flex h-9 items-center border border-[var(--border)] bg-[var(--surface-2)] px-3 ${j?"rounded-t-md":"rounded-md"}`,children:[r.jsx(Ce,{size:14,strokeWidth:2,className:"text-[var(--muted)]"}),r.jsx("input",{ref:T,id:"chrome-omnibox",type:"text",placeholder:"Search or type a URL",value:n,onChange:A=>{C(!1),l(-1),t(A.target.value)},onKeyDown:W,autoComplete:"off",className:"ml-2 h-full w-full bg-transparent text-sm text-[var(--text)] placeholder:text-[var(--muted)]/90 outline-none"})]}),r.jsx(Q,{children:j?r.jsx(B.div,{initial:D?!1:{opacity:0,y:-6},animate:{opacity:1,y:0},exit:D?{opacity:0}:{opacity:0,y:-6},transition:{duration:D?0:.08},className:"absolute left-0 right-0 z-50 overflow-hidden rounded-b-md border-x border-b border-[var(--border)] bg-[var(--surface)] shadow-[0_10px_30px_rgba(0,0,0,0.24)] backdrop-blur",children:h.map((A,U)=>r.jsx("button",{type:"button",onClick:()=>R(A),className:`w-full border-t border-[var(--border)] px-4 py-2.5 text-left text-sm transition-colors duration-150 first:border-t-0 ${U===k?"bg-[var(--autocomplete-selected-bg)] font-medium text-[var(--text)]":"text-[var(--text)]/90 hover:bg-[var(--autocomplete-selected-bg)]"}`,children:r.jsx("span",{className:"block truncate",children:A})},A))}):null})]}),r.jsx("button",{type:"button","aria-label":g?"Exit fullscreen":"Enter fullscreen","aria-pressed":g,className:`${re} ${g?"bg-[var(--surface-2)] text-[var(--accent)]":""}`,onClick:w,children:r.jsx(kn,{size:15,strokeWidth:2})}),I?r.jsx("button",{type:"button","aria-label":f?"Close DevTools":"Open DevTools","aria-pressed":f,className:`${re} ${f?"bg-[var(--surface-2)] text-[var(--accent)]":""}`,onClick:b,children:r.jsx(Sr,{size:15,strokeWidth:2})}):null,S?r.jsx("button",{type:"button","aria-label":"Settings",className:re,onClick:p,children:r.jsx(kr,{size:15,strokeWidth:2})}):null]})}),Cn=i.memo(function({tabs:n,onCreateTab:t,onActivateTab:a,onCloseTab:s,onSetTabOrder:u}){const[m,p]=i.useState({}),b=Z(),[w,f]=i.useState(null),g=n.map(x=>x.id),S=[.22,1,.36,1],I=Math.max(n.length,1),h=I>=9,v=I>=14,T=v?"2.75rem":h?"clamp(4.75rem, 10vw, 8.5rem)":"clamp(6.5rem, 14vw, 13.75rem)";return r.jsx(Yr,{id:"tab-strip-horizontal",children:r.jsxs("div",{className:"inline-flex max-w-full items-center overflow-hidden",children:[r.jsx(en,{axis:"x",values:g,onReorder:u,className:"flex items-center gap-0 overflow-hidden pl-0 pr-0 py-0.5",style:{"--tab-width":T},children:n.map(x=>{const k=`${x.id}:${x.faviconUrl??""}`,l=x.motion==="closing",N=x.motion==="opening"&&!b,C=b?{duration:0,layout:{duration:0}}:{duration:l?.2:.18,ease:S,layout:{duration:.24,ease:S}};return r.jsxs(ln,{value:x.id,as:"div",dragElastic:.04,dragMomentum:!1,dragTransition:{bounceStiffness:700,bounceDamping:34},onDragStart:()=>{f(x.id)},onDragEnd:()=>{f(null)},className:`group/tab relative h-9 w-[var(--tab-width)] shrink-0 cursor-grab transition-[opacity,box-shadow] duration-100 active:cursor-grabbing ${w===x.id?"z-40 opacity-100 shadow-[0_14px_32px_rgba(0,0,0,0.42)]":"z-0 opacity-100"}`,initial:N?{opacity:0,width:0}:!1,animate:{opacity:l?0:1,width:l?0:"var(--tab-width)"},transition:C,style:{overflow:"hidden",transformOrigin:"left center"},whileDrag:b?void 0:{scale:1.02,zIndex:40,transition:{duration:.16,ease:S}},layout:!0,children:[r.jsxs("button",{type:"button",onClick:()=>{w||a(x.id)},className:`relative h-full w-full rounded-t-[2.5px] border-r border-[var(--border)] text-left text-sm transition ${x.active?"bg-[var(--surface-2)] text-[var(--text)]":`bg-transparent text-[var(--muted)] hover:bg-[var(--surface-2)]/85 hover:text-[var(--text)] ${v?"px-0":h?"px-2 pr-7":"px-3 pr-9"}`} ${v?"px-0":h?"px-2 pr-7":"px-3 pr-9"}`,onAuxClick:D=>{D.button===1&&(D.preventDefault(),s(x.id))},title:v?x.title:void 0,children:[x.active?r.jsx("span",{className:"absolute inset-x-0 top-0 h-0.5 rounded-t-[2.5px] bg-[var(--accent)]"}):null,r.jsxs("span",{className:`flex h-full items-center ${v?"justify-center":"gap-2"}`,children:[x.faviconUrl?m[k]?r.jsx(de,{size:13,strokeWidth:2,className:"shrink-0 text-[var(--muted)]"}):r.jsx("img",{src:x.faviconUrl,alt:"",className:"h-4 w-4 shrink-0 rounded-[2px]",loading:"lazy",onError:()=>{p(D=>({...D,[k]:!0}))}}):r.jsx(de,{size:13,strokeWidth:2,className:"shrink-0 text-[var(--muted)]"}),v?null:r.jsx("span",{className:"block min-w-0 flex-1 truncate",children:x.title})]})]}),!v||x.active?r.jsx("button",{type:"button","aria-label":`Close ${x.title}`,onClick:()=>s(x.id),className:`absolute right-2 top-1/2 inline-flex h-4 w-4 -translate-y-1/2 items-center justify-center rounded-sm text-[var(--muted)] transition duration-200 hover:text-[var(--text)] ${v?"opacity-0 group-hover/tab:opacity-95 focus-visible:opacity-95":x.active?"opacity-95":"opacity-65"}`,children:r.jsx(We,{size:12,strokeWidth:2.2})}):null]},x.id)})}),r.jsx("button",{type:"button","aria-label":"New tab",onClick:t,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center border-l border-[var(--border)] text-[var(--accent)] transition duration-200 hover:bg-[var(--surface-2)]",children:r.jsx(Tt,{size:16,strokeWidth:2})})]})})}),In=i.memo(function({tabs:n,addressValue:t,devtoolsEnabled:a,fullscreenEnabled:s,onCreateTab:u,onActivateTab:m,onCloseTab:p,onSetTabOrder:b,onAddressChange:w,onAddressSubmit:f,onBack:g,onForward:S,onReload:I,onOpenSettings:h,onToggleDevtools:v,onToggleFullscreen:T,showSettingsControl:x=!0,showDevtoolsControl:k=!0}){const l=Z(),N=l?{duration:0}:{duration:.22,ease:[.22,1,.36,1]};return r.jsx(Q,{mode:"wait",initial:!1,children:r.jsxs(B.header,{className:"relative z-40 border-b border-[var(--border)] bg-[var(--surface)]/95 backdrop-blur",initial:l?!1:{opacity:0,y:-12},animate:{opacity:1,y:0},exit:l?void 0:{opacity:0,y:-8},transition:N,children:[r.jsx("div",{className:"border-b border-[var(--border)] px-0",children:r.jsx(Cn,{tabs:n,onCreateTab:u,onActivateTab:m,onCloseTab:p,onSetTabOrder:b})}),r.jsx("div",{className:"px-3 py-1.5",children:r.jsx(En,{value:t,onValueChange:w,onSubmit:f,onBack:g,onForward:S,onReload:I,onOpenSettings:h,onToggleDevtools:v,onToggleFullscreen:T,devtoolsEnabled:a,fullscreenEnabled:s,showSettingsControl:x,showDevtoolsControl:k})})]},"horizontal-shell")})}),ke={duration:.2,ease:[.22,1,.36,1]},_t={duration:.24,ease:[.22,1,.36,1]},je={opacity:0},Ne={opacity:1},Te={opacity:0},Et={opacity:0,y:-10,scale:.985},Ct={opacity:1,y:0,scale:1},It={opacity:0,y:-6,scale:.992};function An(e){const n=Math.max(0,Math.ceil(e/1e3)),t=Math.floor(n/60),a=n%60;return`${String(t).padStart(2,"0")}:${String(a).padStart(2,"0")}`}function Rn({open:e,busy:n,error:t,notice:a,isAuthenticated:s,userId:u,hasAvatar:m,isServerBooster:p,displayName:b,tier:w,pendingChallenge:f,onClose:g,onResetChallenge:S,onRequestCode:I,onVerifyCode:h,onSignOut:v}){const T=Z(),[x,k]=i.useState(""),[l,N]=i.useState(""),[C,D]=i.useState(()=>Date.now());i.useEffect(()=>{e&&N("")},[e,f]),i.useEffect(()=>{if(!e||!f)return;D(Date.now());const U=window.setInterval(()=>{D(Date.now())},1e3);return()=>{window.clearInterval(U)}},[e,f]);const j=i.useMemo(()=>s?"Discord Account":f?"Enter Discord Code":"Sign In With Discord",[s,f]),E=w&&w!=="free"?w:p?"Server Booster":"free",R=f?An(f.expiresAt-C):"",W=async U=>{U.preventDefault();const V=x.trim();V&&await I(V)},A=async U=>{U.preventDefault();const V=l.trim();V&&await h(V)};return r.jsx(Q,{initial:!1,children:e?r.jsxs(B.div,{className:"fixed inset-0 z-50 flex items-center justify-center p-3 sm:p-6",initial:T?!1:je,animate:Ne,exit:Te,transition:T?{duration:0}:ke,onClick:g,children:[r.jsx(B.div,{className:"absolute inset-0 bg-[rgba(6,10,18,0.48)] backdrop-blur-[8px]","aria-hidden":"true",initial:T?!1:je,animate:Ne,exit:Te,transition:T?{duration:0}:ke}),r.jsxs(B.section,{onClick:U=>U.stopPropagation(),role:"dialog","aria-modal":"true",initial:T?!1:Et,animate:Ct,exit:T?{opacity:0}:It,transition:T?{duration:0}:_t,className:"relative z-10 w-full max-w-xl overflow-hidden rounded-md border border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_58%,transparent)] shadow-[0_28px_68px_rgba(0,0,0,0.5)] backdrop-blur-xl",style:{fontFamily:"Manrope Variable, Geist Variable, ui-sans-serif, system-ui, sans-serif"},children:[r.jsxs("header",{className:"flex items-center justify-between border-b border-[color-mix(in_srgb,var(--border)_58%,transparent)] px-4 py-3 sm:px-6 sm:py-4",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_56%,transparent)] text-[var(--accent)]",children:r.jsx(ze,{size:16,strokeWidth:2.1})}),r.jsx("h2",{className:"text-base font-semibold text-[var(--text)] sm:text-lg",children:j})]}),r.jsx("button",{type:"button",onClick:g,className:"inline-flex h-9 w-9 items-center justify-center rounded-md border border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_56%,transparent)] text-[var(--muted)] transition hover:bg-[var(--surface-2)] hover:text-[var(--text)]","aria-label":"Close Discord sign in",children:r.jsx(We,{size:15,strokeWidth:2.2})})]}),r.jsxs("div",{className:"space-y-4 bg-[color-mix(in_srgb,var(--surface)_44%,transparent)] px-4 py-4 backdrop-blur-xl sm:px-6 sm:py-5",children:[s?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-4 py-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-[0.12em] text-[var(--muted)]",children:"Signed in as"}),r.jsxs("p",{className:"mt-1 flex items-center gap-2 text-sm font-semibold text-[var(--text)]",children:[r.jsx(jr,{userId:u,hasAvatar:m,sizeClassName:"h-5 w-5",iconSize:12}),b||"Discord account"]}),r.jsxs("p",{className:"mt-2 text-xs text-[var(--muted)]",children:["Tier: ",E]})]}),r.jsxs("button",{type:"button",onClick:()=>{v()},disabled:n,className:"inline-flex h-10 w-full items-center justify-center gap-2 rounded-md border border-[var(--border)] bg-[var(--surface)] px-3.5 text-sm font-semibold text-[var(--text)] transition hover:bg-[var(--surface-2)] disabled:cursor-not-allowed disabled:opacity-60",children:[r.jsx(Nr,{size:14}),"Sign Out"]})]}):f?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"rounded-md border border-[color-mix(in_srgb,var(--accent)_50%,var(--border))] bg-[color-mix(in_srgb,var(--accent)_12%,var(--surface))] px-4 py-3 text-sm text-[var(--text)]",children:[r.jsxs("p",{className:"flex items-center gap-2 font-semibold",children:[r.jsx(xn,{size:15}),"Code sent to ",f.deliveryTarget]}),r.jsxs("p",{className:"mt-2 text-xs text-[var(--muted)]",children:["Open your Discord DMs, then enter the 6-digit code. Expires in ",R,"."]})]}),r.jsxs("form",{className:"space-y-4",onSubmit:A,children:[r.jsx("input",{type:"text",value:l,onChange:U=>N(U.target.value.replace(/\D+/g,"").slice(0,6)),inputMode:"numeric",autoComplete:"one-time-code",placeholder:"6-digit code",className:"h-10 w-full rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 text-sm text-[var(--text)] outline-none transition focus:border-[var(--accent)]/65"}),r.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[r.jsxs("button",{type:"submit",disabled:n,className:"inline-flex h-10 items-center justify-center gap-2 rounded-md border border-[color-mix(in_srgb,var(--accent)_45%,var(--border))] bg-[color-mix(in_srgb,var(--accent)_14%,var(--surface))] px-3.5 text-sm font-semibold text-[var(--text)] transition hover:bg-[color-mix(in_srgb,var(--accent)_22%,var(--surface))] disabled:cursor-not-allowed disabled:opacity-60",children:[r.jsx(wn,{size:14}),"Verify Code"]}),r.jsx("button",{type:"button",onClick:S,disabled:n,className:"inline-flex h-10 items-center justify-center rounded-md border border-[var(--border)] bg-[var(--surface)] px-3.5 text-sm font-semibold text-[var(--text)] transition hover:bg-[var(--surface-2)] disabled:cursor-not-allowed disabled:opacity-60",children:"Use Different Discord"})]})]})]}):r.jsxs("form",{className:"space-y-4",onSubmit:W,children:[r.jsxs("div",{className:"rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-4 py-3 text-sm text-[var(--text)]",children:["Enter your Discord username to sign up. Lucide will DM you a one-time sign-in code through the bot. You must be in the"," ",r.jsx("a",{href:"https://discord.gg/ZDq3UYskkK",target:"_blank",rel:"noreferrer",className:"font-semibold text-[var(--accent)] underline underline-offset-4",children:"Discord server"})," ","for this to happen."]}),r.jsx("input",{type:"text",value:x,onChange:U=>k(U.target.value),autoComplete:"username",placeholder:"@yourdiscordname",className:"h-10 w-full rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 text-sm text-[var(--text)] outline-none transition focus:border-[var(--accent)]/65"}),r.jsxs("button",{type:"submit",disabled:n,className:"inline-flex h-10 w-full items-center justify-center gap-2 rounded-md border border-[color-mix(in_srgb,var(--accent)_45%,var(--border))] bg-[color-mix(in_srgb,var(--accent)_14%,var(--surface))] px-3.5 text-sm font-semibold text-[var(--text)] transition hover:bg-[color-mix(in_srgb,var(--accent)_22%,var(--surface))] disabled:cursor-not-allowed disabled:opacity-60",children:[r.jsx(ze,{size:14}),"Send Discord Code"]})]}),t?r.jsx("p",{className:"rounded-md border border-red-500/40 bg-red-500/10 px-3 py-2 text-sm text-red-200",children:t}):null,a?r.jsx("p",{className:"rounded-md border border-emerald-500/35 bg-emerald-500/10 px-3 py-2 text-sm text-emerald-200",children:a}):null]})]})]}):null})}const Pe=[{id:"movies",label:"Movies",icon:"movies",url:"https://dulo.tv/"},{id:"music",label:"Music",icon:"music",url:"https://mono.geeked.wtf"},{id:"games",label:"Games",icon:"games",url:"/g"},{id:"ai",label:"AI",icon:"ai",url:"/a"}],Dn=new Set(["lossless.wtf","www.lossless.wtf","monochrome.tf","www.monochrome.tf","monochrome.samidy.com","www.monochrome.samidy.com"]);function _e(e){return Dn.has(e.hostname)&&(e.hostname="mono.geeked.wtf",e.protocol="https:"),e}function qe(e){try{return _e(new URL(e)).toString()}catch{return e}}function fe(e){const n=e.trim();if(!n)return null;if(n.startsWith("/"))return n;const t=/^https?:\/\//i.test(n)?n:`https://${n}`;try{const a=new URL(t);return a.protocol!=="http:"&&a.protocol!=="https:"||!a.hostname.includes(".")?null:_e(a).toString()}catch{return null}}function At(e){if(!e)return[];try{const n=JSON.parse(e);return Array.isArray(n)?n.map(t=>{if(!t||typeof t!="object")return null;const a=typeof t.id=="string"?t.id.trim():"",s=typeof t.label=="string"?t.label.trim():"",u=typeof t.url=="string"?t.url.trim():"";if(!a||!s||!u)return null;const m=fe(u);return m?{id:a,label:s,url:m}:null}).filter(t=>!!t):[]}catch{return[]}}function Rt(){return typeof window>"u"?[]:At(window.localStorage.getItem(M.customShortcuts))}function Fe(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(`${M.customShortcuts}.hiddenDefaults`);if(!e)return{};const n=JSON.parse(e);if(!n||typeof n!="object")return{};const t=Object.entries(n).filter(([,a])=>typeof a=="boolean");return Object.fromEntries(t)}catch{return{}}}function Un(e){window.localStorage.setItem(`${M.customShortcuts}.hiddenDefaults`,JSON.stringify(e)),X("default-shortcut-visibility-updated")}function ct(e){window.localStorage.setItem(M.customShortcuts,JSON.stringify(e)),X("custom-shortcuts-updated")}function Dt(e){if(e.startsWith("/"))return null;try{const n=fe(e);if(!n)return null;const t=new URL(n).hostname;return t?xt(`/api/favicon/${encodeURIComponent(t)}`):null}catch{return null}}function Mn(){const e=Fe(),n=Rt(),t=Pe.filter(s=>!e[s.id]&&s.url).map(s=>{const u=fe(s.url);return u?{id:s.id,label:s.label,url:u,icon:s.icon,imageUrl:s.imageUrl,custom:!1}:null}).filter(Boolean),a=n.map(s=>{const u=fe(s.url);return u?{id:s.id,label:s.label,url:u,icon:"custom",imageUrl:void 0,custom:!0}:null}).filter(Boolean);return[...t,...a]}const Ln={movies:jt,music:Ge,games:Nt,ai:$e,history:gt,custom:de},On={movies:"text-[var(--accent)]",music:"text-[var(--accent)]",games:"text-[var(--accent)]",ai:"text-[var(--accent)]",history:"text-[var(--accent)]",custom:"text-[var(--accent)]"};function zn({item:e}){const[n,t]=i.useState(!1),a=Ln[e.icon],s=e.url?Dt(e.url):null,u=e.imageUrl??s;return e.icon==="custom"&&u&&!n?r.jsx("img",{src:u,alt:"",loading:"lazy",className:"h-7 w-7 rounded-full object-cover",onError:()=>t(!0)}):r.jsx(a,{size:20,strokeWidth:2,className:On[e.icon]})}function Bn({onNavigate:e}){const[n,t]=i.useState(()=>Rt()),[a,s]=i.useState(()=>Fe()),[u,m]=i.useState(!1),[p,b]=i.useState(""),[w,f]=i.useState(""),[g,S]=i.useState(null);i.useEffect(()=>{const l=N=>{if(N.key!==M.customShortcuts){N.key===`${M.customShortcuts}.hiddenDefaults`&&s(Fe());return}t(At(N.newValue))};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}},[]);const I=i.useMemo(()=>[...Pe.filter(l=>!a[l.id]),...n.map(l=>({id:l.id,label:l.label,icon:"custom",url:l.url}))],[n,a]),h=()=>{m(!1),b(""),f(""),S(null)},v=()=>{m(!0)},T=l=>{l.preventDefault();const N=p.trim();if(!N){S("Bookmark name is required.");return}const C=w.trim();if(!C){S("Bookmark URL is required.");return}const D=fe(C);if(!D){S("Invalid URL. Use http(s):// or an internal /route path.");return}const j={id:`custom-${Date.now().toString(36)}`,label:N,url:D};t(E=>{const R=[...E,j];return ct(R),R}),h()},x=l=>{t(N=>{const C=N.filter(D=>D.id!==l);return ct(C),C})},k=l=>{s(N=>{const C={...N,[l]:!0};return Un(C),C})};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mx-auto mt-6 flex max-w-[620px] flex-wrap justify-center gap-x-5 gap-y-6",children:[I.map(l=>{const N=()=>{if(l.url?.startsWith("/")){e?.(l.url);return}l.url&&e&&e(l.url)},C=l.icon==="custom",D=C||Pe.some(j=>j.id===l.id);return r.jsxs("div",{className:"group/shortcut relative",children:[D?r.jsx("button",{type:"button",onClick:j=>{j.stopPropagation(),C?x(l.id):k(l.id)},className:"absolute -right-1 -top-1 z-10 inline-flex h-5 w-5 items-center justify-center rounded-full border border-[var(--border)] bg-[var(--surface)] text-[11px] text-[var(--muted)] opacity-0 transition hover:text-[var(--text)] group-hover/shortcut:opacity-100 focus-visible:opacity-100","aria-label":`Delete ${l.label}`,title:"Delete bookmark",children:"x"}):null,r.jsxs("button",{type:"button",onClick:N,className:"group flex w-24 flex-col items-center gap-2 text-center",children:[r.jsx("span",{className:"flex h-14 w-14 items-center justify-center rounded-full border border-[var(--border)] bg-[var(--surface-2)] shadow-[0_0_0_1px_rgba(255,255,255,0.03)] transition group-hover:border-[var(--shortcut-hover-border)] group-hover:bg-[var(--shortcut-hover-bg)]",children:r.jsx(zn,{item:l})}),r.jsx("span",{className:"w-full truncate text-sm text-[var(--text)]/90",children:l.label})]})]},l.id)}),r.jsxs("button",{type:"button",onClick:v,className:"group flex w-24 flex-col items-center gap-2 text-center",children:[r.jsx("span",{className:"flex h-14 w-14 items-center justify-center rounded-full border border-[var(--border)] bg-[var(--surface-2)] shadow-[0_0_0_1px_rgba(255,255,255,0.03)] transition group-hover:border-[var(--shortcut-hover-border)] group-hover:bg-[var(--shortcut-hover-bg)]",children:r.jsx(Tt,{size:20,strokeWidth:2,className:"text-[var(--accent)]"})}),r.jsx("span",{className:"w-full truncate text-sm text-[var(--text)]/90",children:"Add"})]})]}),u?r.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/55 px-4",children:r.jsxs("form",{onSubmit:T,className:"w-full max-w-md rounded-md border border-[var(--border)] bg-[var(--surface)] p-4 shadow-[0_18px_60px_rgba(0,0,0,0.35)]",children:[r.jsx("h3",{className:"text-base font-semibold text-[var(--text)]",children:"Add Bookmark"}),r.jsxs("div",{className:"mt-3 space-y-3",children:[r.jsx("input",{type:"text",value:p,onChange:l=>{b(l.target.value),g&&S(null)},placeholder:"Bookmark name",className:"w-full rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 text-sm text-[var(--text)] outline-none transition placeholder:text-[var(--muted)]/60 focus:border-[var(--accent)]",autoFocus:!0}),r.jsx("input",{type:"text",value:w,onChange:l=>{f(l.target.value),g&&S(null)},placeholder:"https://example.com",className:"w-full rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 text-sm text-[var(--text)] outline-none transition placeholder:text-[var(--muted)]/60 focus:border-[var(--accent)]"}),g?r.jsx("p",{className:"text-xs text-red-400",children:g}):null]}),r.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[r.jsx("button",{type:"button",onClick:h,className:"rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 text-sm font-medium text-[var(--text)] transition hover:border-[var(--muted)]/45",children:"Cancel"}),r.jsx("button",{type:"submit",className:"rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 text-sm font-medium text-[var(--text)] transition hover:border-[var(--accent)]",children:"Save"})]})]})}):null]})}function Pn({value:e,searchEngineId:n,onValueChange:t,onSearchEngineChange:a,onSubmit:s,onNavigate:u,showShortcuts:m=!0}){const{suggestions:p,clearSuggestions:b}=He(e),[w,f]=i.useState(-1),[g,S]=i.useState(!1),[I,h]=i.useState(!1),v=Z(),T=i.useRef(null),x=i.useRef(null),k=i.useRef(null),l=p.length>0&&!g,N=Se.find(E=>E.id===n)??Se[0];i.useEffect(()=>{const E=R=>{x.current&&!x.current.contains(R.target)&&(S(!0),f(-1))};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[]),i.useEffect(()=>{if(!I)return;const E=W=>{k.current&&!k.current.contains(W.target)&&h(!1)},R=W=>{W.key==="Escape"&&h(!1)};return document.addEventListener("mousedown",E),document.addEventListener("keydown",R),()=>{document.removeEventListener("mousedown",E),document.removeEventListener("keydown",R)}},[I]);const C=E=>{E.preventDefault(),S(!0),f(-1),b(),s()},D=E=>{t(E),S(!0),f(-1),b(),u&&u(E)},j=E=>{!l||p.length===0||(E.key==="ArrowDown"?(E.preventDefault(),f(R=>R<p.length-1?R+1:R)):E.key==="ArrowUp"?(E.preventDefault(),f(R=>R>0?R-1:-1)):E.key==="Enter"&&w>=0?(E.preventDefault(),D(p[w])):E.key==="Escape"&&(S(!0),f(-1)))};return r.jsxs("section",{className:"w-full max-w-3xl text-center",children:[r.jsxs("div",{className:"mx-auto inline-block",children:[r.jsx("h1",{className:"brand-wordmark text-[64px] font-semibold tracking-tight text-[var(--accent)] leading-none",children:"lucide"}),r.jsx("div",{className:"underline-expand mt-4 h-1 w-full rounded-full bg-[var(--accent)]",style:{boxShadow:"0 0 18px color-mix(in srgb, var(--accent) 70%, transparent)"}})]}),r.jsxs("form",{onSubmit:C,className:"relative z-20 mx-auto mt-9 w-full max-w-[620px] px-3 sm:px-0",children:[r.jsx("label",{htmlFor:"newtab-search",className:"sr-only",children:"Search the web"}),r.jsxs("div",{className:`flex h-12 items-center border border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_56%,transparent)] px-5 shadow-[0_10px_30px_rgba(0,0,0,0.24)] backdrop-blur-xl transition hover:border-[var(--muted)]/45 focus-within:border-[var(--accent)]/70 ${l?"rounded-t-xl":"rounded-xl"}`,children:[r.jsx(Ce,{size:18,strokeWidth:2,className:"text-[var(--muted)]"}),r.jsx("input",{ref:T,id:"newtab-search",type:"text",value:e,onChange:E=>{S(!1),f(-1),t(E.target.value)},onKeyDown:j,placeholder:`Search ${N.name} or type a URL`,className:"ml-3 h-full w-full bg-transparent text-[15px] text-[var(--text)] placeholder:text-[var(--muted)]/90 outline-none",autoComplete:"off"}),r.jsxs("div",{ref:k,className:"relative ml-6 shrink-0",children:[r.jsxs("button",{type:"button",onClick:()=>h(E=>!E),className:"inline-flex h-7 items-center gap-1.5 rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-2.5 text-[11px] text-[var(--muted)] transition hover:border-[var(--muted)]/45 hover:text-[var(--text)]","aria-label":"Select search engine","aria-haspopup":"listbox","aria-expanded":I,children:[r.jsx("span",{className:"max-w-[88px] truncate",children:N.name}),r.jsx(Tr,{size:12,className:`transition ${I?"rotate-180":""}`})]}),r.jsx(Q,{children:I?r.jsx(B.div,{initial:v?!1:{opacity:0,y:-6},animate:{opacity:1,y:0},exit:v?{opacity:0}:{opacity:0,y:-6},transition:{duration:v?0:.06},className:"absolute right-0 z-50 mt-1.5 w-44 overflow-hidden rounded-b-xl border-x border-b border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_58%,transparent)] shadow-[0_10px_30px_rgba(0,0,0,0.24)] backdrop-blur-xl",children:r.jsx("div",{role:"listbox","aria-label":"Search engine",className:"max-h-56 overflow-y-auto p-1",children:Se.map(E=>{const R=E.id===N.id;return r.jsxs("button",{type:"button",role:"option","aria-selected":R,onClick:()=>{a(E.id),h(!1)},className:`flex w-full items-center justify-between rounded-md px-2.5 py-1.5 text-left text-xs transition ${R?"bg-[color-mix(in_srgb,var(--accent)_14%,transparent)] text-[var(--accent)]":"text-[var(--text)] hover:bg-[var(--surface-2)]"}`,children:[r.jsx("span",{children:E.name}),R?r.jsx(_r,{size:12}):null]},E.id)})})}):null})]})]}),r.jsx(Q,{children:l&&p.length>0?r.jsx(B.div,{ref:x,initial:v?!1:{opacity:0,y:-8},animate:{opacity:1,y:0},exit:v?{opacity:0}:{opacity:0,y:-8},transition:{duration:v?0:.08},className:"absolute left-0 right-0 z-30 mx-3 overflow-hidden rounded-b-xl border-x border-b border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_58%,transparent)] shadow-[0_10px_30px_rgba(0,0,0,0.24)] backdrop-blur-xl sm:mx-0",children:p.map((E,R)=>r.jsx("button",{type:"button",onClick:()=>D(E),className:`w-full border-t border-[var(--border)] px-5 py-3 text-left text-[15px] transition-colors duration-150 first:border-t-0 ${R===w?"bg-[var(--autocomplete-selected-bg)] font-medium text-[var(--text)]":"text-[var(--text)]/90 hover:bg-[var(--autocomplete-selected-bg)]"}`,children:r.jsx("span",{className:"block truncate",children:E})},E))}):null})]}),m?r.jsx(Bn,{onNavigate:u}):null]})}function Fn({open:e,onClose:n}){const t=Z();return r.jsx(Q,{initial:!1,children:e?r.jsxs(B.div,{className:"fixed inset-0 z-[75] flex items-center justify-center px-4 py-6",initial:t?!1:je,animate:Ne,exit:Te,transition:t?{duration:0}:ke,onClick:n,children:[r.jsx(B.div,{"aria-hidden":"true",className:"absolute inset-0 bg-[rgba(6,10,18,0.48)] backdrop-blur-[8px]",initial:t?!1:je,animate:Ne,exit:Te,transition:t?{duration:0}:ke}),r.jsxs(B.section,{role:"dialog","aria-modal":"true","aria-label":"Static build notice",onClick:a=>a.stopPropagation(),initial:t?!1:Et,animate:Ct,exit:t?{opacity:0}:It,transition:t?{duration:0}:_t,className:"w-full max-w-lg overflow-hidden rounded-md border border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_58%,transparent)] shadow-[0_30px_90px_rgba(0,0,0,0.42)] backdrop-blur-xl",children:[r.jsxs("header",{className:"flex items-start justify-between gap-4 border-b border-[color-mix(in_srgb,var(--border)_58%,transparent)] px-5 py-4",children:[r.jsxs("div",{children:[r.jsx("div",{className:"inline-flex h-10 w-10 items-center justify-center rounded-md border border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_56%,transparent)] text-[var(--accent)]",children:r.jsx(de,{size:18,strokeWidth:2.1})}),r.jsx("h2",{className:"mt-3 text-lg font-semibold text-[var(--text)]",children:"You are on a static build"}),r.jsxs("p",{className:"mt-2 text-sm leading-6 text-[var(--muted)]",children:["Some features and settings are limited on static builds. To get all features, find an official domain in the"," ",r.jsx("a",{href:"https://discord.gg/ZDq3UYskkK",target:"_blank",rel:"noreferrer",className:"text-[var(--accent)] underline underline-offset-4",children:"Discord server"}),"."]})]}),r.jsx("button",{type:"button",onClick:n,className:"inline-flex h-9 w-9 items-center justify-center rounded-md border border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_56%,transparent)] text-[var(--muted)] transition hover:bg-[var(--surface-2)] hover:text-[var(--text)]","aria-label":"Close notice",children:r.jsx(We,{size:15,strokeWidth:2.2})})]}),r.jsx("div",{className:"flex items-center justify-end border-t border-[color-mix(in_srgb,var(--border)_58%,transparent)] px-5 py-3",children:r.jsx("button",{type:"button",onClick:n,className:"rounded-md border border-[color-mix(in_srgb,var(--accent)_45%,var(--border))] bg-[color-mix(in_srgb,var(--accent)_14%,var(--surface))] px-3.5 py-2 text-sm font-semibold text-[var(--text)] transition hover:bg-[color-mix(in_srgb,var(--accent)_22%,var(--surface))]",children:"Continue"})})]})]}):null})}function Vn(e,n=1){const[t,a]=i.useState([]),s=i.useRef(null);i.useEffect(()=>{if(e.length<n){s.current?.abort(),a([]);return}let m=!1;const p=async()=>{s.current?.abort();const w=new AbortController;s.current=w;try{const f=await pt(`/api/music-search?q=${encodeURIComponent(e)}`,{signal:w.signal});if(!f.ok){m||a([]);return}const g=await f.json();m||a(Array.isArray(g.items)?g.items.slice(0,6):[])}catch(f){!m&&f instanceof Error&&f.name!=="AbortError"&&a([])}},b=window.setTimeout(p,25);return()=>{m=!0,window.clearTimeout(b),s.current?.abort()}},[n,e]);const u=i.useCallback(()=>{s.current?.abort(),a([])},[]);return{results:e.length<n?[]:t,clearResults:u}}function $n(e,n){const t=n.trim().toLowerCase();return t?e.label.toLowerCase().includes(t)||e.url.toLowerCase().includes(t):!0}const Wn={movies:jt,music:Ge,games:Nt,ai:$e,history:gt,custom:de};function Gn({item:e}){const[n,t]=i.useState(!1);if(e.kind==="music")return e.imageUrl&&!n?r.jsx("img",{src:e.imageUrl,alt:"",loading:"lazy",className:"h-8 w-8 rounded-md object-cover",onError:()=>t(!0)}):r.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-[var(--border)] bg-[var(--surface)] text-[var(--accent)]",children:r.jsx(Ge,{size:14,strokeWidth:2.1})});if(e.kind==="bookmark"){const a=Wn[e.shortcut.icon],s=e.shortcut.imageUrl??Dt(e.shortcut.url);return e.shortcut.icon==="custom"&&s&&!n?r.jsx("img",{src:s,alt:"",loading:"lazy",className:"h-8 w-8 rounded-md object-cover",onError:()=>t(!0)}):r.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-[var(--border)] bg-[var(--surface)] text-[var(--accent)]",children:r.jsx(a,{size:14,strokeWidth:2.1})})}return r.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-[var(--border)] bg-[var(--surface)] text-[var(--accent)]",children:e.kind==="ai"?r.jsx($e,{size:14,strokeWidth:2.1}):r.jsx(Ce,{size:14,strokeWidth:2.1})})}function Hn({open:e,searchEngineName:n,onClose:t,onNavigate:a}){const s=Z(),u=i.useRef(null),m=i.useRef([]),[p,b]=i.useState(""),[w,f]=i.useState(0),[g,S]=i.useState([]),{suggestions:I,clearSuggestions:h}=He(e?p:""),{results:v,clearResults:T}=Vn(e?p:"");i.useEffect(()=>{if(!e){b(""),f(0),h(),T();return}S(Mn()),window.setTimeout(()=>{u.current?.focus(),u.current?.select()},0)},[T,h,e]);const x=i.useMemo(()=>{const l=p.trim(),N=g.filter(j=>$n(j,l)).slice(0,l?6:8).map(j=>({id:`bookmark:${j.id}`,kind:"bookmark",title:j.label,subtitle:j.url,value:j.url,shortcut:j}));if(!l)return N;const C=I.filter(j=>j.trim().toLowerCase()!==l.toLowerCase()).slice(0,6).map(j=>({id:`suggestion:${j}`,kind:"suggestion",title:j,subtitle:`Search ${n}`,value:j})),D=v.map(j=>({id:`music:${j.kind}:${j.id}`,kind:"music",title:j.title,subtitle:`${j.subtitle} • ${j.source}`,value:j.href,imageUrl:j.imageUrl}));return[{id:`ai:${l}`,kind:"ai",title:`Ask AI: ${l}`,subtitle:"Send to Lucide AI",value:l},...D,{id:`query:${l}`,kind:"query",title:l,subtitle:`Open or search with ${n}`,value:l},...C,...N]},[v,p,n,g,I]);i.useEffect(()=>{f(l=>x.length===0?0:Math.min(l,x.length-1))},[x]),i.useEffect(()=>{if(!e||x.length===0)return;const l=m.current[w];l&&l.scrollIntoView({block:"nearest"})},[x.length,e,w]),i.useEffect(()=>{if(!e)return;const l=N=>{N.key==="Escape"&&(N.preventDefault(),t())};return window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l)}},[t,e]);const k=l=>{l&&(a(l),t())};return r.jsx(Q,{initial:!1,children:e?r.jsxs(B.div,{className:"fixed inset-0 z-50 flex items-center justify-center px-4 py-6",initial:s?!1:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:s?0:.08},onClick:t,children:[r.jsx(B.div,{"aria-hidden":"true",className:"absolute inset-0 bg-[rgba(6,10,18,0.48)] backdrop-blur-[8px]",initial:s?!1:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:s?0:.08}}),r.jsxs(B.section,{role:"dialog","aria-modal":"true","aria-label":"Spotlight search",onClick:l=>l.stopPropagation(),initial:s?!1:{opacity:0,y:-18,scale:.98},animate:{opacity:1,y:0,scale:1},exit:s?{opacity:0}:{opacity:0,y:-12,scale:.98},transition:{duration:s?0:.1},className:"w-full max-w-2xl overflow-hidden rounded-md border border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_58%,transparent)] shadow-[0_30px_90px_rgba(0,0,0,0.42)] backdrop-blur-xl",style:{fontFamily:"Manrope Variable, Geist Variable, ui-sans-serif, system-ui, sans-serif"},children:[r.jsx("div",{className:"border-b border-[var(--border)] px-5 py-4",children:r.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_56%,transparent)] px-4 py-3 shadow-[inset_0_1px_0_rgba(255,255,255,0.03)] backdrop-blur-xl",children:[r.jsx(Ce,{size:17,strokeWidth:2.1,className:"text-[var(--muted)]"}),r.jsx("input",{ref:u,type:"text",value:p,onChange:l=>{b(l.target.value),f(0)},onKeyDown:l=>{l.key==="ArrowDown"&&(l.preventDefault(),f(N=>x.length===0?0:Math.min(N+1,x.length-1))),l.key==="ArrowUp"&&(l.preventDefault(),f(N=>Math.max(N-1,0))),l.key==="Enter"&&(l.preventDefault(),k(x[w]))},placeholder:"Search the web, music, bookmarks, or jump somewhere",className:"h-full w-full bg-transparent text-[15px] text-[var(--text)] outline-none placeholder:text-[var(--muted)]/72",autoComplete:"off",spellCheck:!1})]})}),r.jsx("div",{className:"max-h-[26rem] overflow-hidden px-3 py-3",onWheel:l=>{l.preventDefault()},children:x.length>0?x.map((l,N)=>r.jsxs("button",{ref:C=>{m.current[N]=C},type:"button",onClick:()=>k(l),className:`flex w-full items-center gap-3 rounded-lg px-3 py-3 text-left transition ${N===w?"bg-[color-mix(in_srgb,var(--accent)_12%,var(--surface))] text-[var(--text)]":"text-[var(--text)]/92 hover:bg-[var(--surface-2)]"}`,children:[r.jsx(Gn,{item:l}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm font-semibold",children:l.title}),r.jsx("span",{className:"mt-0.5 block truncate text-xs text-[var(--muted)]",children:l.subtitle})]})]},l.id)):r.jsxs("div",{className:"px-3 py-8 text-center",children:[r.jsx("p",{className:"text-sm font-medium text-[var(--text)]",children:"Nothing matched that search."}),r.jsx("p",{className:"mt-1 text-xs text-[var(--muted)]",children:"Try a bookmark name, URL, or a web search."})]})}),r.jsx("div",{className:"flex items-center justify-end border-t border-[var(--border)] px-5 py-3 text-xs text-[var(--muted)]",children:r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(gn,{size:12,strokeWidth:2.2}),"Open selection"]})})]})]}):null})}const ne="New Tab",qn=[{id:"new-tab",title:ne,active:!0,motion:null,targetUrl:void 0,inputValue:""}],Ut=250,Yn=3e4;function Mt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(16).slice(2)}`}function Lt(e){if(se(e,typeof window<"u"?window.location.origin:void 0))return!0;try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function Kn(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(M.webHistory);if(!e)return[];const n=JSON.parse(e);return Array.isArray(n)?n.map(a=>{if(!a||typeof a!="object")return null;const s=a;if(typeof s.url!="string"||!Lt(s.url))return null;const u=Ot(s.url);return{id:typeof s.id=="string"?s.id:Mt(),url:u,title:typeof s.title=="string"&&s.title.trim()?s.title.trim():u,faviconUrl:typeof s.faviconUrl=="string"&&s.faviconUrl.trim()?s.faviconUrl:void 0,visitedAt:typeof s.visitedAt=="number"?s.visitedAt:Date.now()}}).filter(a=>a!==null).sort((a,s)=>s.visitedAt-a.visitedAt).slice(0,Ut):[]}catch{return[]}}function lt(e){if(!(typeof window>"u"))try{window.localStorage.setItem(M.webHistory,JSON.stringify(e.slice(0,Ut)))}catch{return}}function Ot(e){const n=se(e,typeof window<"u"?window.location.origin:void 0);return n||qe(e)}function Xn(e){const n=se(e,typeof window<"u"?window.location.origin:void 0);return n?Ve(n)?.title??n:e}function ut(e){if(typeof window>"u"||!Lt(e.url))return;const n=Ot(e.url),t=typeof e.visitedAt=="number"?e.visitedAt:Date.now(),a=e.title.trim()||Xn(n),s=Kn(),u=s[0];if(u&&u.url===n&&Math.abs(u.visitedAt-t)<=Yn){lt([{...u,title:a,faviconUrl:e.faviconUrl??u.faviconUrl,visitedAt:t},...s.slice(1)]);return}lt([{id:Mt(),url:n,title:a,faviconUrl:e.faviconUrl,visitedAt:t},...s])}const Jn=190,Qn=210;function Zn(e,n){switch(n.type){case"ACTIVATE":return e.map(t=>({...t,active:t.id===n.id}));case"CREATE":return[...e.map(t=>({...t,active:!1})),{id:n.id,title:ne,active:!0,motion:"opening",inputValue:""}];case"CLOSE_START":return e.length<=1?e:e.map(t=>t.id===n.id?{...t,motion:"closing"}:t);case"CLOSE_COMPLETE":{if(e.length<=1)return e.map(m=>({...m,motion:null}));const t=e.findIndex(m=>m.id===n.id);if(t===-1)return e;const a=e[t].active,s=e.filter(m=>m.id!==n.id);if(!a)return s;const u=Math.max(0,Math.min(t,s.length-1));return s.map((m,p)=>({...m,active:p===u}))}case"CLEAR_MOTION":return e.map(t=>t.id===n.id?{...t,motion:null}:t);case"RESET":return e.map(t=>t.id===n.id?{...t,title:ne,targetUrl:void 0,inputValue:"",faviconUrl:void 0}:t);case"UPDATE_INPUT":return e.map(t=>t.id===n.id?{...t,inputValue:n.value}:t);case"SET_ORDER":{const t=new Map(e.map(u=>[u.id,u])),a=n.ids.map(u=>t.get(u)).filter(u=>!!u);if(a.length===e.length)return a;const s=e.filter(u=>!n.ids.includes(u.id));return[...a,...s]}case"NAVIGATE":return e.map(t=>t.id===n.id?{...t,targetUrl:n.url,inputValue:n.url,title:n.title,faviconUrl:n.faviconUrl}:t);case"UPDATE_METADATA":return e.map(t=>t.id!==n.id?t:{...t,targetUrl:n.metadata.url?.trim()||t.targetUrl,inputValue:n.metadata.url?.trim()?n.metadata.url:t.inputValue,title:n.metadata.title?.trim()||t.title,faviconUrl:n.metadata.faviconUrl??t.faviconUrl});default:return e}}function es(e){if(!J().persistTabs)return e;try{const t=localStorage.getItem(M.tabs);if(!t)return e;const a=JSON.parse(t);if(Array.isArray(a)&&a.length>0)return a.map(s=>{const u={...s,motion:null},m=typeof s.targetUrl=="string"?s.targetUrl:"",p=typeof s.inputValue=="string"?s.inputValue:"",w=se(m||p,window.location.origin);if(!w)return u;const f=Ve(w);return f?{...u,targetUrl:w,inputValue:w,title:f.title,faviconUrl:f.faviconUrl}:u})}catch{}return e}function ts(e){let n=0;for(const t of e){const a=t.id.match(/^tab-(\d+)$/);if(a){const s=parseInt(a[1],10);s>n&&(n=s)}}return n+1}function rs(e){const[n,t]=i.useReducer(Zn,e,es);return i.useEffect(()=>{if(J().persistTabs)try{localStorage.setItem(M.tabs,JSON.stringify(n))}catch{}else localStorage.removeItem(M.tabs)},[n]),{tabs:n,activateTab:g=>t({type:"ACTIVATE",id:g}),createTab:()=>{const g=`tab-${ts(n)}`;return t({type:"CREATE",id:g}),X("tab-created"),setTimeout(()=>{t({type:"CLEAR_MOTION",id:g})},Jn),g},closeTab:g=>{t({type:"CLOSE_START",id:g}),X("tab-closed"),setTimeout(()=>{t({type:"CLOSE_COMPLETE",id:g})},Qn)},resetTab:g=>{t({type:"RESET",id:g}),X("tab-reset")},updateInput:(g,S)=>{t({type:"UPDATE_INPUT",id:g,value:S})},setTabOrder:g=>{t({type:"SET_ORDER",ids:g}),X("tab-order-updated")},navigateTab:(g,S,I,h)=>{t({type:"NAVIGATE",id:g,url:S,title:I,faviconUrl:h}),ut({url:S,title:I,faviconUrl:h}),X("tab-navigated")},updateTabMetadata:(g,S)=>{t({type:"UPDATE_METADATA",id:g,metadata:S}),typeof S.url=="string"&&S.url.trim()&&ut({url:S.url,title:S.title?.trim()||S.url,faviconUrl:S.faviconUrl})}}}function ns(e){const n=e.trim();if(!n)return"";try{return _e(new URL(n)).toString()}catch{}try{const a=new URL(`http://${n}`);if(a.hostname.includes("."))return _e(a).toString()}catch{}return Er()+encodeURIComponent(n)}function ss(e){if(typeof window>"u")return null;const n=se(e,window.location.origin);if(!n)return null;const t=Ve(n);return t?{url:n,title:t.title,faviconUrl:t.faviconUrl}:null}function zt(e){try{const n=new URL(qe(e)).hostname;return n?xt(`/api/favicon/${encodeURIComponent(n)}`):void 0}catch{return}}function dt(e){const n=ss(e);if(n)return n;const t=ns(e);if(!t)return null;let a=ne;try{a=new URL(qe(t)).hostname||ne}catch{a=ne}const s=zt(t);return{url:t,title:a,faviconUrl:s}}function os(e){const{tabs:n,activateTab:t,createTab:a,closeTab:s,resetTab:u,updateInput:m,setTabOrder:p,navigateTab:b,updateTabMetadata:w}=rs(e),f=i.useMemo(()=>n.find(T=>T.active)??n[0]??null,[n]);return{tabs:n,activeTab:f,activateTab:t,createTab:a,closeTab:s,resetActiveTab:()=>{f&&u(f.id)},updateActiveInput:T=>{f&&m(f.id,T)},setTabOrder:p,navigateTabById:(T,x)=>{const k=dt(x);return k?(b(T,k.url,k.title,k.faviconUrl),k.url):""},navigateActiveTab:T=>{if(!f)return"";const x=T??f.inputValue,k=dt(x);return k?(b(f.id,k.url,k.title,k.faviconUrl),k.url):""},updateTabFromFrame:(T,x)=>{const k=x.url?zt(x.url):void 0;w(T,{...x,faviconUrl:k})}}}function as(){const[e,n]=i.useState(!1),[t,a]=i.useState(0),s=i.useRef(null),u=i.useRef(null),m=i.useRef(0),p=()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},b=()=>{u.current!==null&&(window.clearTimeout(u.current),u.current=null)},w=()=>{b(),e||(m.current=Date.now()),n(!0),a(S=>S>.08?S:.08),s.current===null&&(s.current=window.setInterval(()=>{a(S=>S>=.86?S:Math.min(.86,S+Math.max((.86-S)*.14,.008)))},130))},f=()=>{n(!0),a(S=>Math.max(S,.93))},g=()=>{p(),b(),n(!0),a(1);const S=Date.now()-m.current,h=Math.max(0,320-S);u.current=window.setTimeout(()=>{n(!1),a(0),u.current=null},h+180)};return i.useEffect(()=>()=>{p(),b()},[]),{visible:e,progress:t,start:w,settle:f,done:g}}function is(e){const[n,t]=i.useState(null),a=i.useRef(null);return i.useEffect(()=>{a.current=n},[n]),{loadingTabId:n,startForTab:p=>{t(p),a.current=p,e.start()},settleForTab:p=>{a.current===p&&e.settle()},doneForTab:p=>{a.current===p&&(e.done(),t(null),a.current=null)}}}const cs=i.lazy(()=>gr(()=>import("./proxy-viewport-B0O0IPVx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url).then(e=>({default:e.ProxyViewport}))),ls="1",ft="1",ye="lucide-eruda-script",us="lucide-eruda-container",ds="https://cdn.jsdelivr.net/npm/eruda@3.4.3/eruda.js";function we(e){return bt(e.trim())}function fs({initialInternalPath:e,initialExternalUrl:n}={}){const{tabs:t,activeTab:a,activateTab:s,createTab:u,closeTab:m,resetActiveTab:p,setTabOrder:b,updateActiveInput:w,navigateTabById:f,navigateActiveTab:g,updateTabFromFrame:S}=os(qn),I=as(),h=is(I),v=Cr(),{activeTheme:T}=Ur(),[x,k]=i.useState(()=>J().newTabBehavior==="shortcuts"),[l,N]=i.useState(()=>J().searchEngine),[C,D]=i.useState(null),[j,E]=i.useState(()=>J().globalShortcutModifier),[R,W]=i.useState({}),[A,U]=i.useState(!1),[V,Ie]=i.useState({}),[Ae,ee]=i.useState(!1),[Bt,Pt]=i.useState(!1),[Ft,Vt]=i.useState(!1),G=i.useRef(new Map),P=i.useRef(new Map),te=i.useRef(new Map),oe=i.useRef(!1),Re=i.useRef(null),De=i.useRef({url:"",ts:0}),y=a?.id??"",L=a?.targetUrl?.trim()??"",Ye=y?R[y]??"":"",$t=Se.find(o=>o.id===l)?.name??"the web",Ke=L.length===0,Wt=vr(j,"F"),Xe=t.filter(o=>(o.targetUrl?.trim()??"").length>0),Gt=Xe.filter(o=>!we(o.targetUrl?.trim()??"")),Ht=Xe.filter(o=>we(o.targetUrl?.trim()??"")),qt=I.visible&&!!y&&h.loadingTabId===y,Yt=y?V[y]===!0:!1,Ue=v.session?.user?.adsDisabled===!0,Je=!v.sessionPending&&!Ue,me=i.useCallback(()=>{Je&&dr()},[Je]);i.useEffect(()=>{fr(v.sessionPending||Ue)},[Ue,v.sessionPending]);const pe=o=>{const c=o.trim();c&&(we(c)||xr())},Kt=i.useCallback(()=>{if(!y)return;const o=te.current.get(y);if(o&&o.index>0){o.index-=1;const d=o.entries[o.index];h.startForTab(y),f(y,d);return}G.current.get(y)?.contentWindow?.history.back()},[y,f,h]),Xt=i.useCallback(()=>{if(!y)return;const o=te.current.get(y);if(o&&o.index<o.entries.length-1){o.index+=1;const d=o.entries[o.index];h.startForTab(y),f(y,d);return}G.current.get(y)?.contentWindow?.history.forward()},[y,f,h]),ae=i.useCallback(()=>{if(!y)return;h.startForTab(y);const o=G.current.get(y);if(!o){h.doneForTab(y);return}if(we(L)){const c=tt(L),d=`${c}${c.includes("?")?"&":"?"}r=${Date.now()}`;o.src=d;return}try{o.contentWindow?.location.reload()}catch{h.doneForTab(y)}},[y,L,h]);i.useEffect(()=>{const o=()=>{const c=y?G.current.get(y):null;Vt(!!(c&&document.fullscreenElement===c))};return document.addEventListener("fullscreenchange",o),o(),()=>{document.removeEventListener("fullscreenchange",o)}},[y]),i.useEffect(()=>{const o=new Set(t.map(c=>c.id));for(const[c]of te.current.entries())o.has(c)||te.current.delete(c);for(const c of t){const d=c.targetUrl?.trim()??"";if(!d)continue;const _=te.current.get(c.id);if(!_){te.current.set(c.id,{entries:[d],index:0});continue}_.entries[_.index]!==d&&(_.entries=[..._.entries.slice(0,_.index+1),d],_.index=_.entries.length-1)}},[t]),i.useEffect(()=>{const o=new Set(t.map(c=>c.id));Ie(c=>{const d=Object.entries(c).filter(([_,z])=>z&&o.has(_));return d.length===Object.keys(c).length?c:Object.fromEntries(d)});for(const[c,d]of P.current.entries())o.has(c)||(window.clearTimeout(d),P.current.delete(c))},[t]),i.useEffect(()=>{const o=()=>{const c=J();k(c.newTabBehavior==="shortcuts"),N(c.searchEngine),E(c.globalShortcutModifier)};return window.addEventListener("storage",o),window.addEventListener(he,o),()=>{window.removeEventListener("storage",o),window.removeEventListener(he,o)}},[]),i.useEffect(()=>{let o=!1,c=null;const d=async()=>{const _=await Dr();if(o)return;const z=_?URL.createObjectURL(_):null;D(ie=>(ie&&URL.revokeObjectURL(ie),z)),c=z};return d(),window.addEventListener(he,d),()=>{o=!0,window.removeEventListener(he,d),c&&URL.revokeObjectURL(c)}},[]),i.useEffect(()=>{const o=c=>{c.defaultPrevented||c.isComposing||A||rt(c.target)||q(c,j,"F")&&(c.preventDefault(),ee(d=>!d))};return window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o)}},[j,A]),i.useEffect(()=>{const o=c=>{if(J().confirmLeave)return c.preventDefault(),c.returnValue="",""};return window.addEventListener("beforeunload",o),()=>window.removeEventListener("beforeunload",o)},[]),i.useEffect(()=>{v.sessionPending||Ke&&me()},[v.sessionPending,Ke,me]);const Jt=i.useCallback(()=>{window.localStorage.setItem(M.staticBuildNoticeVersion,ls),Pt(!1),me()},[me]);i.useEffect(()=>{(window.localStorage.getItem(M.firstVisitPromptVersion)??"")!==ft&&(window.localStorage.setItem(M.firstVisitPromptVersion,ft),v.openAuthModal())},[v.openAuthModal]);const Qt=i.useCallback(o=>{N(o),mr("searchEngine",o)},[]),Qe=i.useCallback(o=>{if(o)try{const c=o.contentWindow,d=o.contentDocument;c?.eruda?.destroy?.(),d?.getElementById(ye)?.remove(),d?.getElementById(us)?.remove()}catch{return}},[]),xe=i.useCallback(async o=>{const c=G.current.get(o);if(!c?.contentDocument||!c.contentWindow)return;const d=c.contentWindow,_=c.contentDocument,z=()=>{d.eruda&&(d.eruda.init(),d.eruda.show())};if(d.eruda){z();return}if(_.getElementById(ye))return;const O=_.createElement("script");O.id=ye,O.type="text/javascript",O.src=ds,O.crossOrigin="anonymous";try{if(O.addEventListener("load",()=>{P.current.delete(o),window.setTimeout(z,0)},{once:!0}),O.addEventListener("error",()=>{P.current.delete(o),O.remove()},{once:!0}),!_.head){P.current.delete(o),O.remove();return}_.head.appendChild(O)}catch{P.current.delete(o),O.remove()}const F=window.setTimeout(()=>{P.current.delete(o),_.getElementById(ye)?.remove()},15e3);P.current.set(o,F)},[]),Y=i.useCallback(()=>u(),[u]),be=i.useCallback(o=>{const c=o.trim();if(!c)return;const d=Date.now();if(De.current.url===c&&d-De.current.ts<750)return;De.current={url:c,ts:d},pe(c);const _=Y();h.startForTab(_),f(_,c)},[Y,f,h]),Me=i.useCallback(o=>{m(o)},[m]),Zt=i.useCallback(o=>{b(o)},[b]),er=i.useCallback(async()=>{const o=y?G.current.get(y):null;if(o){if(document.fullscreenElement===o){await document.exitFullscreen().catch(()=>{});return}await o.requestFullscreen().catch(()=>{})}},[y]),Ze=i.useCallback(()=>{const o=document.getElementById("chrome-omnibox");o&&(o.focus(),o.select())},[]),Le=i.useCallback(o=>{if(!y||t.length<=1)return;const c=t.findIndex(z=>z.id===y);if(c===-1)return;const d=(c+o+t.length)%t.length,_=t[d];_&&s(_.id)},[y,s,t]),H=i.useCallback((o,c)=>{if(o==="spotlight"){ee(d=>!d);return}if(o==="new-tab"){Y();return}if(o==="close-tab"){if(!y||t.length<=1)return;Me(y);return}if(o==="reload-tab"){ae();return}if(o==="focus-address-bar"){Ze();return}if(o==="next-tab"){Le(1);return}if(o==="previous-tab"){Le(-1);return}if(o==="tab-index"&&typeof c=="number"){const d=t[c-1];d&&s(d.id)}},[y,Le,s,Me,Y,Ze,ae,t]);i.useEffect(()=>{const o=c=>{if(!(c.defaultPrevented||c.isComposing)&&!(A||Ae)&&!rt(c.target)){for(let d=1;d<=9;d+=1)if(q(c,j,String(d))){if(!t[d-1])return;c.preventDefault(),H("tab-index",d);return}if(q(c,j,"T")){c.preventDefault(),H("new-tab");return}if(q(c,j,"W")){if(!y||t.length<=1)return;c.preventDefault(),H("close-tab");return}if(q(c,j,"R")){c.preventDefault(),H("reload-tab");return}if(q(c,j,"L")){c.preventDefault(),H("focus-address-bar");return}if(q(c,j,"ArrowRight")){c.preventDefault(),H("next-tab");return}q(c,j,"ArrowLeft")&&(c.preventDefault(),H("previous-tab"))}};return window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o)}},[y,j,H,A,Ae]),i.useEffect(()=>{if(oe.current)return;const c=new URLSearchParams(window.location.search).get("open"),_=(c?se(c,window.location.origin):null)??e;if(n){g(n),ge("/"),oe.current=!0;return}if(!_){oe.current=!0;return}Re.current=_,g(_),ge(_),oe.current=!0},[n,e,g]),i.useEffect(()=>{if(!oe.current)return;const o=Re.current;if(o){if(L!==o)return;Re.current=null}const c=bt(L)?L:"/";pr()!==c&&ge(c)},[L]),i.useEffect(()=>{const o=c=>{if(c.origin!==window.location.origin)return;const d=c.data;if(!d||typeof d!="object")return;const _=d.type;if(_===br){ee(F=>!F);return}if(_===hr){H(typeof d.action=="string"?d.action:"",typeof d.index=="number"?d.index:void 0);return}if(_==="open-new-tab"){const F=typeof d.decodedUrl=="string"?d.decodedUrl??"":typeof d.url=="string"?d.url??"":"";be(F);return}if(_==="lucide:go-home"){p(),ge("/");return}if(_==="lucide:open-external-window"){const F=d.href;if(typeof F!="string"||F.trim().length===0)return;window.open(F.trim(),"_blank","noopener,noreferrer");return}if(_!=="lucide:open-link")return;const z=d.href,ie=d.newTab===!0;if(typeof z!="string"||z.trim().length===0)return;const O=z.trim();if(pe(O),ie){const F=Y();h.startForTab(F),f(F,O);return}y&&h.startForTab(y),g(O)};return window.addEventListener("message",o),()=>{window.removeEventListener("message",o)}},[y,g,f,be,p,h]),i.useEffect(()=>{if(!("serviceWorker"in navigator))return;const o=c=>{const{data:d}=c;if(!d||d.type!=="open-new-tab")return;const _=typeof d.decodedUrl=="string"?d.decodedUrl:typeof d.url=="string"?d.url:"";be(_)};return navigator.serviceWorker.addEventListener("message",o),()=>{navigator.serviceWorker.removeEventListener("message",o)}},[be]);const tr=i.useCallback(()=>{U(!0)},[]),rr=i.useCallback(()=>{if(!y)return;const o=G.current.get(y);if(o){if(V[y]){const c=P.current.get(y);c!==void 0&&(window.clearTimeout(c),P.current.delete(y)),Qe(o),Ie(d=>{const _={...d};return delete _[y],_});return}Ie(c=>({...c,[y]:!0})),xe(y)}},[y,Qe,V,xe]);i.useEffect(()=>()=>{for(const o of P.current.values())window.clearTimeout(o);P.current.clear()},[]);const K=i.useCallback(o=>{const c=(o??a?.inputValue??"").trim();if(!c)return;pe(c);const d=g(c);if(d){if(d===L){ae();return}y&&h.startForTab(y)}},[a?.inputValue,y,L,ae,g,h]),nr=o=>{const c=o.trim();if(!c)return;pe(c);const d=Y();h.startForTab(d),f(d,c)},sr={tabs:t,addressValue:a?.inputValue??"",devtoolsEnabled:Yt,fullscreenEnabled:Ft,onCreateTab:Y,onActivateTab:s,onCloseTab:Me,onSetTabOrder:Zt,onAddressChange:w,onBack:Kt,onForward:Xt,onReload:ae,onOpenSettings:tr,onToggleDevtools:rr,onToggleFullscreen:()=>{er()},onAddressSubmit:o=>K(o),showSettingsControl:Ar,showDevtoolsControl:Ir},et="absolute inset-0 h-full w-full min-h-0 border-t border-[var(--border)] bg-[var(--surface)]",or=r.jsx("div",{className:"h-[2px] w-full bg-transparent",children:r.jsx("div",{className:`h-[2px] w-full origin-left bg-[var(--accent)] transition-opacity duration-180 ${qt?"opacity-100":"opacity-0"}`,style:{transform:`scaleX(${Math.max(0,Math.min(1,I.progress))})`}})}),ar=r.jsxs("main",{className:"relative min-h-0 flex-1 overflow-hidden",children:[r.jsx("div",{className:"relative flex h-full min-h-0 w-full",children:r.jsxs(i.Suspense,{fallback:null,children:[Gt.map(o=>r.jsx(cs,{tabId:o.id,active:o.id===y,visible:!!L&&o.id===y,interactive:!!L&&o.id===y,containerClassName:et,url:o.targetUrl??"",spotlightShortcut:Wt,globalShortcutModifier:j,preferredColorScheme:T.mode,onFrameReady:c=>{G.current.set(o.id,c)},onMetadataChange:c=>{S(o.id,c)},onLoadStateChange:c=>{if(c==="start"){o.id===y&&h.startForTab(o.id);return}if(c==="settle"){h.settleForTab(o.id);return}h.doneForTab(o.id),V[o.id]&&xe(o.id)},onRequestNewTab:nr},o.id)),Ht.map(o=>{const c=o.targetUrl?.trim()??"";return r.jsx("div",{"data-tab-id":o.id,className:`${et} ${L&&o.id===y?"opacity-100":"opacity-0 pointer-events-none"}`,children:r.jsx("iframe",{ref:d=>{G.current.set(o.id,d)},src:tt(c),title:o.title,allow:"display-capture; picture-in-picture; clipboard-write",className:"h-full w-full border-0",onLoad:()=>{h.doneForTab(o.id),V[o.id]&&xe(o.id)}})},o.id)})]})}),L?null:r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center px-6 py-10",children:[C?r.jsx("div",{className:"pointer-events-none absolute inset-0 bg-cover bg-center bg-no-repeat opacity-30",style:{backgroundImage:`url("${C}")`},"aria-hidden":"true"}):null,C?r.jsx("div",{className:"pointer-events-none absolute inset-0 bg-[linear-gradient(to_bottom,rgba(4,7,12,0.28),rgba(4,7,12,0.52))]","aria-hidden":"true"}):null,r.jsx("div",{className:"flex w-full flex-1 items-center justify-center",children:r.jsx("div",{className:"flex w-full max-w-[1400px] items-center justify-center gap-6 px-2 lg:px-6",children:r.jsx("div",{className:"flex min-w-0 flex-1 justify-center",children:r.jsx("div",{className:"flex w-full max-w-4xl flex-col items-center",children:r.jsx(Pn,{value:Ye,searchEngineId:l,showShortcuts:x,onValueChange:o=>{y&&W(c=>({...c,[y]:o}))},onSubmit:()=>{K(Ye)},onSearchEngineChange:Qt,onNavigate:o=>{K(o)}})})})})}),r.jsx("div",{className:"pointer-events-none fixed bottom-2 right-2 z-20",children:r.jsx("div",{className:"pointer-events-auto flex items-center gap-3 text-xs",style:{fontFamily:"Manrope Variable, Geist Variable, ui-sans-serif, system-ui, sans-serif",letterSpacing:"0.01em"},children:r.jsxs("div",{style:{color:T.mode==="dark"?"#eee":"#222"},className:"flex items-center gap-3",children:[r.jsxs("button",{type:"button",onClick:v.openAuthModal,className:"inline-flex items-center gap-1.5 font-semibold tracking-[0.02em] transition hover:opacity-80",children:[r.jsx(ze,{size:13}),r.jsx("span",{children:v.isAuthenticated?"Account":"Sign in"})]}),r.jsx("a",{href:"https://discord.gg/ZDq3UYskkK",target:"_blank",rel:"noreferrer",className:"font-semibold tracking-[0.02em] transition hover:opacity-80",children:"More links"}),r.jsx("button",{type:"button",onClick:()=>K("/t"),className:"font-semibold tracking-[0.02em] transition hover:opacity-80",children:"TOS"}),r.jsx("button",{type:"button",onClick:()=>K("/p"),className:"font-semibold tracking-[0.02em] transition hover:opacity-80",children:"Privacy"})]})})}),r.jsx("div",{className:"pointer-events-none fixed bottom-2 left-2 z-20",children:r.jsx("div",{className:"pointer-events-auto text-xs font-semibold tracking-[0.02em] text-[var(--muted)]",style:{fontFamily:"Manrope Variable, Geist Variable, ui-sans-serif, system-ui, sans-serif",letterSpacing:"0.01em"},children:"SVG build"})})]})]});return r.jsxs("div",{className:"app-grid-bg flex h-screen flex-col overflow-hidden text-[var(--text)]",children:[r.jsx(In,{...sr}),or,ar,r.jsx(Rr,{open:A,onClose:()=>U(!1),auth:v}),r.jsx(Fn,{open:Bt,onClose:Jt}),r.jsx(Hn,{open:Ae,searchEngineName:$t,onClose:()=>ee(!1),onNavigate:o=>{if(o.kind==="ai"){window.localStorage.setItem(M.aiPendingPrompt,o.value),K("/a"),ee(!1);return}K(o.value),ee(!1)}}),r.jsx(Rn,{open:v.modalOpen,busy:v.authBusy||v.sessionPending,error:v.authError,notice:v.authNotice,isAuthenticated:v.isAuthenticated,userId:v.session?.user?.id??null,hasAvatar:!!v.session?.user?.image,isServerBooster:!!v.session?.user?.isServerBooster,displayName:v.session?.user?.displayUsername??v.session?.user?.name??null,tier:v.session?.user?.tier??null,pendingChallenge:v.pendingChallenge,onClose:v.closeAuthModal,onResetChallenge:v.resetChallenge,onRequestCode:v.requestDiscordCode,onVerifyCode:v.verifyDiscordCode,onSignOut:v.signOut})]})}const vs=Object.freeze(Object.defineProperty({__proto__:null,NewTabPage:fs},Symbol.toStringTag,{value:"Module"}));export{fs as N,vs as a,_e as n};
@@ -0,0 +1 @@
1
+ import{j as e,L as o}from"./index-8N-ebit3.js";import{H as s}from"./house-D0FgPHqQ.js";function i(){const r=t=>{window.parent!==window&&(t.preventDefault(),window.parent.postMessage({type:"lucide:go-home"},window.location.origin))};return e.jsx("div",{className:"app-grid-bg flex min-h-screen items-center justify-center px-6 text-[var(--text)]",children:e.jsxs("div",{className:"w-full max-w-lg rounded-md border border-[var(--border)] bg-[var(--surface)] p-8 shadow-[0_18px_50px_rgba(0,0,0,0.25)]",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-[0.18em] text-[var(--muted)]",children:"Error 404"}),e.jsx("h1",{className:"mt-3 text-2xl font-semibold",children:"Page not found"}),e.jsx("p",{className:"mt-2 text-sm text-[var(--muted)]",children:"This route does not exist. It may have moved, or the URL might be incorrect."}),e.jsx("div",{className:"mt-6 flex flex-wrap gap-2",children:e.jsxs(o,{to:"/",onClick:r,className:"inline-flex items-center gap-2 rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 text-sm font-medium transition hover:border-[var(--muted)]/45",children:[e.jsx(s,{size:15,strokeWidth:2}),"Go Home"]})})]})})}export{i as NotFoundPage};