PageSourceSearch

https://www.virgilabloh.com/_next/static/chunks/app/usmnt/page-6a9…?dpl=dpl_EKDRFWZoojdCqAfdbDBz7vaWVzuw

js virgilabloh.com collected 2026-10-03 21:26:29 UTC 422,811 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[316],{706:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>dB});var r=n(5155),i=n(7202),a=n(2115),o=n(308),l=n(4847),s=n(2619),c=n.n(s),d=n(1247),u=n(4631),h=n(9945);let p="[ VAA_ARCHIVE ]",m="DATE: ",f="TIME: ",g="MEMBERSHIP",x="CANARY YELLOW",v="900px",y="--aj1-header-chrome-height",w=(0,o.i7)(["from{opacity:0;}to{opacity:1;}"]),b=o.Ay.span.withConfig({componentId:"sc-52ac0cb8-0"})(["opacity:0;animation:"," 0.12s ease-out forwards;animation-delay:","s;"],w,e=>{let{$delaySec:t}=e;return t}),k=o.Ay.div.withConfig({componentId:"sc-52ac0cb8-1"})(["position:fixed;top:-","px;left:0;z-index:500;width:100%;display:flex;flex-direction:column;align-items:stretch;"],48),C=o.Ay.div.withConfig({componentId:"sc-52ac0cb8-2"})(["flex-shrink:0;height:","px;width:100%;"],48),M=o.Ay.header.withConfig({componentId:"sc-52ac0cb8-3"})(["position:relative;width:100%;"]),S=o.Ay.div.withConfig({componentId:"sc-52ac0cb8-4"})(["position:relative;z-index:0;display:flex;width:100%;flex-direction:column;padding:12px 12px 6px;background-color:",";color:",";transition:background-color 0.16s ease-out,color 0.16s ease-out;"],e=>{let{$chrome:t}=e;return"default"===t?"transparent":"membership"===t?"#1C4A96":"canary"===t?"#fdf050":"red"===t?"#f00":"transparent"},e=>{let{theme:t,$chrome:n}=e;return"default"===n?t.colors.text:"membership"===n?"#FFFFFF":"canary"===n?"#1e1e1e":"red"===n?"#fff":"hsl(calc(95deg + var(--aj1-footer-hue-rotate, 0deg)) 97% 55%)"}),j=o.Ay.div.withConfig({componentId:"sc-52ac0cb8-5"})(["display:flex;flex-direction:column;transition:background-color ",";"],d.LT),I=(0,o.Ay)(c()).withConfig({componentId:"sc-52ac0cb8-6"})(["display:block;color:inherit;text-decoration:none;"]),A=(0,o.Ay)(c()).withConfig({componentId:"sc-52ac0cb8-7"})(["display:contents;color:inherit;text-decoration:none;"]),P=(0,o.Ay)(c()).withConfig({componentId:"sc-52ac0cb8-8"})(["display:inline;color:inherit;text-decoration:none;&:hover{text-decoration:underline;}"]),R=o.Ay.a.withConfig({componentId:"sc-52ac0cb8-9"})(["display:inline;color:inherit;text-decoration:none;&:hover{text-decoration:underline;}"]),E=o.Ay.span.withConfig({componentId:"sc-52ac0cb8-10"})(["display:inline-block;font-size:1.2em;line-height:1;vertical-align:baseline;"]);function L(){return(0,r.jsx)(E,{"aria-hidden":!0,children:"↗"})}let z=o.Ay.div.withConfig({componentId:"sc-52ac0cb8-11"})(['display:flex;justify-content:space-between;align-items:baseline;gap:0.75rem;width:100%;padding:0 2px;font-family:"Simon Mono",monospace;font-size:10px;color:inherit;text-transform:uppercase;transition:color ',";@media (max-width:899px){justify-content:flex-end;gap:20px;}@media (min-width:","){display:grid;grid-template-columns:repeat(24,1fr);grid-template-rows:auto;grid-auto-flow:row;column-gap:0;row-gap:0;align-items:baseline;padding:0;gap:0;}"],d.LT,v),D=o.Ay.div.withConfig({componentId:"sc-52ac0cb8-12"})(["box-sizing:border-box;padding-left:4px;white-space:pre-line;text-align:",";line-height:1.1;flex-shrink:0;align-self:baseline;@media (max-width:","){display:",";}@media (min-width:","){min-width:0;grid-row:1;","}"],e=>{let{$align:t="left"}=e;return t},"1099px",e=>{let{$hideBelow1100:t}=e;return t?"none":"block"},v,e=>{let{$gridColumnWide:t}=e;return null!=t&&""!==t?(0,o.AH)(["grid-column:",";"],t):""}),T=(0,o.Ay)(D).withConfig({componentId:"sc-52ac0cb8-13"})(["@media (max-width:899px){margin-right:auto;}"]),B=(0,o.Ay)(D).withConfig({componentId:"sc-52ac0cb8-14"})(["white-space:nowrap;"]),F=o.Ay.div.withConfig({componentId:"sc-52ac0cb8-15"})(["width:100%;height:8px;margin-top:4px;margin-bottom:-4px;box-sizing:border-box;border-top:1px dashed currentColor;border-left:1px dashed currentColor;border-right:1px dashed currentColor;opacity:0.6;transition:border-color ",";@media (min-width:700px){border-top:0.5px dashed currentColor;border-left:0.5px dashed currentColor;border-right:0.5px dashed currentColor;opacity:1;}"],d.LT),W=o.Ay.div.withConfig({componentId:"sc-52ac0cb8-16"})(['width:100%;padding:0 4px;font-family:"Simon Mono",monospace;font-size:10px;line-height:1.1;color:inherit;text-transform:uppercase;transition:color ',";"],d.LT);function O(){let e,t=e=0+.035*p.length+.21000000000000002,n=e+=.035*m.length,r=e+=.08,i=e+=.035*f.length,a=e+=.21000000000000002;e+=.035*g.length;let o=e+=.21000000000000002;return e+=.035*x.length,{archiveBase:0,dateLabelBase:t,dateValueDelay:n,timeLabelBase:r,timeValueDelay:i,membershipBase:a,canaryBase:o,bottomBase:e+=.21000000000000002}}function Y(e){var t,n,i,o;let{linkTo:l,articleProgress:s=0,isFooterFullyVisible:c=!1,animateText:d=!0}=e,{track:v}=(0,h.s)(),[w,E]=(0,a.useState)(null),[Y,N]=(0,a.useState)(!1),[G,U]=(0,a.useState)(!1),[H,q]=(0,a.useState)(!1),V=(0,a.useRef)(null);(0,a.useLayoutEffect)(()=>{let e=V.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().height;document.documentElement.style.setProperty(y,"".concat(Math.round(1e3*t)/1e3,"px"))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let X=G?"membership":H?"canary":c?"footerHue":s>=1||Y?"red":"default";(0,a.useEffect)(()=>{let e=()=>E(function(e){let t=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0"),r=e.getFullYear(),i=e.getHours(),a=i>=12?"PM":"AM";0==(i%=12)&&(i=12);let o=String(i).padStart(2,"0"),l=String(e.getMinutes()).padStart(2,"0"),s=String(e.getSeconds()).padStart(2,"0");return{date:"".concat(t,"/").concat(n,"/").concat(r),time:"".concat(o,":").concat(l,":").concat(s," ").concat(a)}}(new Date));e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[]);let $=(0,a.useMemo)(O,[]),_=d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(T,{$gridColumnWide:"1 / 7",children:(0,r.jsx)(u.W,{text:p,baseDelay:$.archiveBase,letterDelay:.035})}),(0,r.jsx)(D,{$hideBelow1100:!0,$gridColumnWide:"7 / 10",children:(0,r.jsxs)("span",{style:{whiteSpace:"nowrap"},children:[(0,r.jsx)(u.W,{text:m,baseDelay:$.dateLabelBase,letterDelay:.035}),(0,r.jsx)(b,{$delaySec:$.dateValueDelay,children:null!=(t=null==w?void 0:w.date)?t:"--/--/----"})]})}),(0,r.jsx)(D,{$hideBelow1100:!0,$gridColumnWide:"10 / 18",children:(0,r.jsxs)("span",{style:{whiteSpace:"nowrap"},children:[(0,r.jsx)(u.W,{text:f,baseDelay:$.timeLabelBase,letterDelay:.035}),(0,r.jsx)(b,{$delaySec:$.timeValueDelay,children:null!=(n=null==w?void 0:w.time)?n:"--:--:-- --"})]})})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(T,{$gridColumnWide:"1 / 7",children:"[ VAA_ARCHIVE ]"}),(0,r.jsx)(D,{$hideBelow1100:!0,$gridColumnWide:"7 / 10",children:(0,r.jsxs)("span",{style:{whiteSpace:"nowrap"},children:["DATE: ",null!=(i=null==w?void 0:w.date)?i:"--/--/----"]})}),(0,r.jsx)(D,{$hideBelow1100:!0,$gridColumnWide:"10 / 18",children:(0,r.jsxs)("span",{style:{whiteSpace:"nowrap"},children:["TIME: ",null!=(o=null==w?void 0:w.time)?o:"--:--:-- --"]})})]}),Z=(0,r.jsx)(P,{href:"/",onMouseEnter:()=>U(!0),onMouseLeave:()=>U(!1),onClick:()=>v("Nav Link Clicked",{source:"aj1_header",destination:"/"}),children:d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(L,{}),(0,r.jsx)(u.W,{text:g,baseDelay:$.membershipBase,letterDelay:.035})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(L,{}),"MEMBERSHIP"]})}),J=(0,r.jsx)(R,{href:"https://canary---yellow.com/",target:"_blank",rel:"noopener noreferrer",onMouseEnter:()=>q(!0),onMouseLeave:()=>q(!1),onClick:()=>v("Nav Link Clicked",{source:"aj1_header",destination:"https://canary---yellow.com/"}),children:d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(L,{}),(0,r.jsx)(u.W,{text:x,baseDelay:$.canaryBase,letterDelay:.035})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(L,{}),"CANARY\xa0YELLOW"]})}),K=d?(0,r.jsx)(u.W,{text:"NIKE X2---U.S. M.N.T.",baseDelay:$.bottomBase,letterDelay:.035}):(0,r.jsx)(r.Fragment,{children:"NIKE X2---U.S. M.N.T."}),Q=(0,r.jsxs)(j,{children:[(0,r.jsxs)(z,{children:[l?(0,r.jsx)(A,{href:l,"aria-label":"Go to home",children:_}):_,(0,r.jsx)(D,{$gridColumnWide:"-9 / -4",children:Z}),(0,r.jsx)(B,{$gridColumnWide:"-4 / -1",children:J})]}),l?(0,r.jsxs)(I,{href:l,"aria-label":"Go to home",children:[(0,r.jsx)(F,{"aria-hidden":!0}),(0,r.jsx)(W,{children:K})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(F,{"aria-hidden":!0}),(0,r.jsx)(W,{children:K})]})]});return(0,r.jsxs)(k,{onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),children:[(0,r.jsx)(C,{"aria-hidden":!0}),(0,r.jsx)(M,{children:(0,r.jsx)(S,{ref:V,$chrome:X,"data-aj1-header-stack":"",children:Q})})]})}let N=o.Ay.h1.withConfig({componentId:"sc-fc9d764a-0"})(["position:absolute;top:46px;left:0;width:100%;font-size:calc(var(--vw) * 19.55vw - 0.2rem);font-weight:700;letter-spacing:-0.06em;color:",";text-align:left;line-height:0.8;margin:0;margin-left:-0.04em;padding-left:3px;transition:color ",";display:flex;flex-direction:column;align-items:flex-start;gap:0;margin-bottom:4rem;@media (min-width:720px){padding-left:18px;font-size:calc(var(--vw) * 24.55vw - 0.2rem);}"],e=>{let{theme:t}=e;return t.colors.text},d.LT),G=(0,o.Ay)(N).withConfig({componentId:"sc-fc9d764a-1"})(["cursor:",";top:",";@media (min-width:720px){font-size:calc(var(--vw) * 12.55vw - 0.1rem);margin-left:-0.08em;display:flex;flex-direction:column;white-space:nowrap;margin-bottom:0;}"],e=>{let{$pointerCursor:t=!0}=e;return t?"pointer":"default"},e=>{let{$variant:t}=e;return"rest"===t?"0":"46px"}),U=o.Ay.span.withConfig({componentId:"sc-fc9d764a-2"})(["display:block;white-space:nowrap;"]),H=o.Ay.div.withConfig({componentId:"sc-fc9d764a-3"})(["position:fixed;left:0;right:0;bottom:calc( ","px + env(safe-area-inset-bottom,0px) );padding:0 ",";box-sizing:border-box;pointer-events:none;font-weight:700;letter-spacing:-0.06em;color:",";line-height:",";font-size:calc(var(--vw) * 19.55vw - 0.2rem);@media (min-width:720px){font-size:calc(var(--vw) * 12.55vw - 0.1rem);}",""],65,e=>{let{theme:t}=e;return t.spacing.page},e=>{let{theme:t}=e;return t.colors.text},.8,e=>{let{$bandVariant:t}=e;return"bottom-band-nike"===t&&(0,o.AH)(["@media (max-width:719px){bottom:calc( ","px + env(safe-area-inset-bottom,0px) + ","em );}"],65,1.6)}),q=o.Ay.div.withConfig({componentId:"sc-fc9d764a-4"})(["display:flex;justify-content:space-between;align-items:flex-end;width:100%;"]),V=o.Ay.div.withConfig({componentId:"sc-fc9d764a-5"})(["display:flex;flex-direction:column;align-items:stretch;width:100%;@media (min-width:720px){display:none;}"]),X=(0,o.Ay)(q).withConfig({componentId:"sc-fc9d764a-6"})(["display:none;@media (min-width:720px){display:flex;}"]),$=o.Ay.div.withConfig({componentId:"sc-fc9d764a-7"})(["display:flex;justify-content:flex-start;width:100%;"]),_=o.Ay.div.withConfig({componentId:"sc-fc9d764a-8"})(["display:flex;justify-content:flex-end;width:100%;"]),Z=o.Ay.span.withConfig({componentId:"sc-fc9d764a-9"})(["display:flex;flex-direction:column;align-items:flex-start;line-height:inherit;"]),J=o.Ay.span.withConfig({componentId:"sc-fc9d764a-10"})(["display:flex;flex-direction:column;align-items:flex-start;line-height:inherit;text-align:left;"]),K=o.Ay.span.withConfig({componentId:"sc-fc9d764a-11"})(["display:inline-block;margin-left:",";opacity:",";transition:opacity "," ease ",";"],e=>{let{$tightLeft:t,$spaceBefore:n,$marginLeftEm:r}=e;return t?"-0.12em":null!=r?"".concat(r,"em"):n?"0.15em":"0"},e=>{let{$active:t}=e;return+!!t},e=>{let{$opacityMs:t=120}=e;return"".concat(t,"ms")},e=>{let{$opacityDelayMs:t=0}=e;return"".concat(t,"ms")}),Q="V.A.A.",ee="Nike X2",et="U.S.",en="M.N.T.",er="".concat(et," ").concat(en),ei=Q.length,ea=ee.length,eo=ei+3+ea+er.length;function el(e){if(e<=1)return 0;let t=eo-2;return t<=1?.04:.04+(e-2)/Math.max(1,t-1)*.38}function es(e){let{pointerCursor:t=!0,variant:n="full",scrollProgress:i=0,articleProgress:a=0,showBehindVaaPrefix:o=!0,onTitleClick:l}=e,s="vaa-for"===n||"full"===n,c="rest"===n||"full"===n,d="bottom-band"===n||"bottom-band-nike"===n||"full"===n,u="bottom-band"===n||"bottom-band-usmnt"===n||"full"===n,h="bottom-band"===n||"bottom-band-usmnt"===n||"full"===n,p=o||i>0,m=i>0,f=t&&!(i>0)&&"bottom-band"!==n&&"bottom-band-nike"!==n&&"bottom-band-usmnt"!==n,g=d||u?(0,r.jsxs)(H,{$bandVariant:n,children:[(0,r.jsxs)(V,{children:[d?(0,r.jsx)($,{children:(0,r.jsx)(U,{children:ee.split("").map((e,t)=>(0,r.jsx)(K,{$active:i>=el(ei+3+t),$spaceBefore:"X"===e,children:e},"mobile-nike-".concat(t)))})}):null,u?(0,r.jsx)(_,{children:(0,r.jsxs)(J,{children:[(0,r.jsx)(U,{children:et.split("").map((e,t)=>(0,r.jsx)(K,{$active:i>=el(ei+3+ea+t),children:e},"mobile-us-".concat(t)))}),(0,r.jsx)(U,{children:en.split("").map((e,t)=>(0,r.jsx)(K,{$active:i>=el(ei+3+ea+et.length+1+t),children:e},"mobile-mnt-".concat(t)))})]})}):null]}),h?(0,r.jsxs)(X,{children:[(0,r.jsx)(Z,{children:(0,r.jsx)(U,{children:ee.split("").map((e,t)=>(0,r.jsx)(K,{$active:i>=el(ei+3+t),$spaceBefore:"X"===e,children:e},t))})}),(0,r.jsxs)(J,{children:[(0,r.jsx)(U,{children:et.split("").map((e,t)=>(0,r.jsx)(K,{$active:i>=el(ei+3+ea+t),children:e},t))}),(0,r.jsx)(U,{children:en.split("").map((e,t)=>(0,r.jsx)(K,{$active:i>=el(ei+3+ea+et.length+1+t),children:e},t))})]})]}):null]}):null;return"bottom-band"===n||"bottom-band-nike"===n||"bottom-band-usmnt"===n?g:(0,r.jsxs)(G,{$variant:n,$pointerCursor:f,onClick:l?()=>{a>=1||l()}:void 0,children:[s&&(0,r.jsx)(U,{children:Q.split("").map((e,t)=>(0,r.jsx)(K,{$active:("vaa-for"!==n||!(t<=1)||!!p)&&i>
1=el(t),$tightLeft:"."===e&&1===t,$marginLeftEm:"."===e&&3===t?.07:void 0,$spaceBefore:!1,$opacityMs:"vaa-for"===n&&t<=1?m?120:500:void 0,$opacityDelayMs:"vaa-for"===n&&1===t?200*!m:void 0,children:e},t))}),c&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(U,{children:"For".split("").map((e,t)=>(0,r.jsx)(K,{$active:i>=el(ei+t),children:e},t))})}),g]})}let ec="#ffffff22",ed=(0,o.i7)(["from{opacity:0;}to{opacity:1;}"]),eu=o.Ay.div.withConfig({componentId:"sc-ab4e6b0f-0"})(["position:absolute;inset:0;z-index:0;overflow:hidden;pointer-events:none;background:",";"],"#060c00"),eh=o.Ay.div.withConfig({componentId:"sc-ab4e6b0f-1"})(["position:absolute;top:0;bottom:0;left:12px;right:12px;z-index:0;pointer-events:none;background-image:repeating-linear-gradient( 180deg,"," 0,"," 1px,transparent 1px,transparent 4px );mask-image:repeating-linear-gradient( 90deg,black 0,black 1px,transparent 1px,transparent calc(100% / ",") ),linear-gradient( 90deg,transparent calc(100% - 1px),black calc(100% - 1px),black 100% );mask-composite:add,add;-webkit-mask-image:repeating-linear-gradient( 90deg,black 0,black 1px,transparent 1px,transparent calc(100% / ",") ),linear-gradient( 90deg,transparent calc(100% - 1px),black calc(100% - 1px),black 100% );-webkit-mask-composite:source-over,source-over;@media (min-width:","){mask-image:repeating-linear-gradient( 90deg,black 0,black 1px,transparent 1px,transparent calc(100% / ",") ),linear-gradient( 90deg,transparent calc(100% - 1px),black calc(100% - 1px),black 100% );-webkit-mask-image:repeating-linear-gradient( 90deg,black 0,black 1px,transparent 1px,transparent calc(100% / ",") ),linear-gradient( 90deg,transparent calc(100% - 1px),black calc(100% - 1px),black 100% );}"],ec,ec,12,12,"900px",24,24),ep=o.Ay.div.withConfig({componentId:"sc-ab4e6b0f-2"})(["position:absolute;inset:0;z-index:1;height:100%;pointer-events:none;opacity:0.4;color:#91fc1e;"]),em=o.Ay.div.withConfig({componentId:"sc-ab4e6b0f-3"})(['position:absolute;bottom:-2vw;right:calc(var(--vw) * -4vw);line-height:0;width:calc(var(--vw) * 100vw);aspect-ratio:1973 / 530;pointer-events:none;background-color:currentColor;mask-image:url("/images/vaa_outline.png");mask-mode:alpha;mask-size:contain;mask-repeat:no-repeat;mask-position:right bottom;-webkit-mask-image:url("/images/vaa_outline.png");-webkit-mask-size:contain;-webkit-mask-repeat:no-repeat;-webkit-mask-position:right bottom;opacity:0;animation:'," 0.6s ease-out 1.4s forwards;@media (min-width:700px){width:calc(var(--vw) * 64vw);}"],ed);function ef(e){let{showGhostLogo:t=!0}=e;return(0,r.jsxs)(eu,{"aria-hidden":!0,children:[(0,r.jsx)(eh,{}),t?(0,r.jsx)(ep,{children:(0,r.jsx)(em,{})}):null]})}o.Ay.div.withConfig({componentId:"sc-ab4e6b0f-4"})(["position:absolute;inset:0;z-index:0;filter:hue-rotate(var(--aj1-footer-hue-rotate,0deg));"]);var eg=n(5339),ex=n(7548),ev=n(74),ey=n(855);let ew={u:.475,v:.52};function eb(){return{foilOpacity:.49,foilContrast:3.46,foilSaturation:1.68,patternScale:1.18,stickerScale:1.5,animationSpeed:1.12,curlTightness:.5,embossStrength:1.15,embossEps:.0032,embossEdge:.16,liquidNormalStrength:2.4,fresnelStrength:.08,specGlintStrength:1.4,specSheenStrength:.18,lightShadeMin:.55,lightShadeMax:1.65,curlPeelDepth:1.45,curlCameraBias:1.45,rippleAmplitude:.4,rippleFrequency:22,light1Intensity:ey.I.light1.intensity,light2Intensity:ey.I.light2.intensity,light1Position:[...ey.I.light1.position],light2Position:[...ey.I.light2.position]}}let ek=(0,ev.eU)(eb());function eC(){return{phase:"idle",elapsed:0,ballUid:-1,rippleAmplitude:0,rippleFrequency:0,rippleProgress:0,ripplePulseElapsed:0,consumeProgress:0}}let eM=(0,ev.eU)(eC());var eS=n(6748);let ej="usmnt-crash-isolation-v16",eI={soccerBall:!0,ballGoal:!0,markerPens:!0,markerShadow:!0,ballTrailComposite:!1,footerFoilRipple:!0,footerBallCursors:!1,goalNetShader:!0,heroProductCycle:!0,galleryVideo:!0};function eA(e){return{...eI,ballGoal:!(e<=eS.PU)}}let eP={soccerBall:{label:"Soccer ball scene",hint:"WebGL renderer, DRACO GLTF, physics, marker-style lit shadows."},ballGoal:{label:"Goal GLB",hint:"goal.glb mesh, cage collision, net catch physics. Desktop only (>700px)."},markerPens:{label:"Marker pens",hint:"Pen GLTF + 1024\xb2 draw-surface canvas textures in ball scene."},markerShadow:{label:"Marker contact shadows",hint:"PCF shadow map + page ShadowMaterial receiver for pen and ball."},ballTrailComposite:{label:"Ball motion trails",hint:"Multi render-target composite when trails mode is on (Space)."},footerFoilRipple:{label:"Footer foil swallow ripple",hint:"Extra fragment shader + abyss atom updates from ball physics."},footerBallCursors:{label:"Footer ball cursors",hint:"Per-frame Jotai updates of ball positions for footer foil."},goalNetShader:{label:"Goal net GPU deformation",hint:"onBeforeCompile vertex displacement for in-net balls."},heroProductCycle:{label:"Hero product cycling",hint:"8-product texture swaps during intro / scroll top."},galleryVideo:{label:"Gallery video",hint:"MP4 decode in footnote gallery (usmnt-only)."}},eR=(0,ev.eU)(eA(1024)),eE=(0,ev.eU)(e=>e(eR),(e,t,n)=>{let r=e(eR),i="function"==typeof n?n(r):{...r,...n};t(eR,i);try{localStorage.setItem(ej,JSON.stringify(i))}catch(e){}}),eL=(0,ev.eU)(!1);var ez=n(7508);let eD=ey.I.curl.max,eT=Math.max(1e-6,ey.I.curl.reference),eB=eD/eT;function eF(e){let t=(e%360+360)%360;return t>95&&t<265?-1:1}function eW(){let e=(0,i.md)(l.u),t=(0,i.md)(ek),n=(0,i.md)(eM),o=(0,i.md)(eE),s=(0,i.md)(eL),c=(0,a.useRef)(s);c.current=s;let d=(0,a.useRef)(t),u=(0,a.useRef)(n),h=(0,a.useRef)(o);h.current=o;let p=(0,a.useRef)(null),m=(0,a.useRef)(null),f=(0,a.useRef)(null),g=(0,a.useRef)(null),x=(0,a.useRef)(null),v=(0,a.useRef)(null),y=(0,a.useRef)(null),w=(0,a.useRef)(0),b=(0,a.useRef)(eD/eT*1.5),k=(0,a.useRef)(295),C=(0,a.useRef)(!1),M=(0,a.useRef)(0),S=(0,a.useRef)(0),j=(0,a.useRef)(0),I=(0,a.useRef)(0),A=(0,a.useRef)(0),P=(0,a.useRef)({x:.5,y:.5}),R=(0,a.useRef)({x:.5,y:.5}),E=(0,a.useRef)({x:.5,y:.5}),L=(0,a.useRef)(0),z=(0,a.useRef)(!1),D=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{d.current=t},[t]),(0,a.useEffect)(()=>{u.current=n},[n]),(0,a.useEffect)(()=>{let t=p.current;if(!t)return;let n=new eg.Z58;f.current=n;let r=new eg.qUd(-1,1,1,-1,.1,10);r.position.z=2,g.current=r;let i=new ex.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:e});(0,ez.h)(i,e),i.setPixelRatio(Math.min(window.devicePixelRatio,2)),i.setClearColor(0,0),i.domElement.style.width="100%",i.domElement.style.height="100%",i.domElement.style.display="block",t.appendChild(i.domElement),m.current=i;let a=new eg.Tap,o=e=>{let t=x.current,n=null!=e?e:y.current,r=null==n?void 0:n.image;if(!t||!(null==r?void 0:r.width)||!(null==r?void 0:r.height))return;let i=window.innerHeight>window.innerWidth,a=d.current.stickerScale*(i?.65:1),{extraScale:o,rotateZRad:l}=function(){var e;let t=(e=window.innerWidth/window.innerHeight)>=1?0:e<=.5?1:(1-e)/.5;return{extraScale:eg.cj9.lerp(1,1.6,t),rotateZRad:eg.cj9.lerp(0,eg.cj9.degToRad(-32),t)}}();t.scale.set(r.width/r.height*a*o,a*o,1),t.rotation.z=l},l=a.load("/images/reaper.png",e=>
1{e.colorSpace=eg.er$,e.needsUpdate=!0,o(e)});y.current=l;let s=new eg.BKk({vertexShader:"\n  uniform sampler2D uFoilMap;\n  uniform float uCurlAmount;\n  uniform float uCurlMax;\n  uniform float uCurlGeomBoost;\n  uniform float uCurlTightness;\n  uniform float uCurlOrigin;\n  uniform float uCurlOriginEdge;\n  uniform float uCurlAngleDeg;\n  /** +1 / -1 — cylinder winding from effective peel angle (JS), keeps roll toward camera. */\n  uniform float uCurlRollSign;\n  uniform float uCurlPeelDepth;\n  uniform float uCurlCameraBias;\n  uniform float uPlaneWidth;\n  uniform float uPlaneHeight;\n\n  varying vec2 vUv;\n  varying vec3 vViewPosition;\n  varying vec3 vViewNormal;\n  varying vec3 vViewTangentX;\n  varying vec3 vViewTangentY;\n\n  vec3 applyCurl(vec2 p) {\n    // Normalized drive 0–1 from JS range [0, uCurlMax] (legacy shader clamped at 1, ignoring extra).\n    float curlT = clamp(abs(uCurlAmount) / max(uCurlMax, 0.0001), 0.0, 1.0);\n    if (curlT < 0.0001) return vec3(p, 0.0);\n    // Stronger peel when config curl.max > reference (default boost = 1).\n    float g = max(uCurlGeomBoost, 0.0001);\n\n    // Diagonal peel axis: 30deg from top-right toward bottom-left.\n    float angle = radians(uCurlAngleDeg);\n    vec2 dir = normalize(vec2(-cos(angle), -sin(angle)));\n    vec2 nrm = vec2(-dir.y, dir.x);\n\n    float maxReach = 0.5 * (abs(dir.x) * uPlaneWidth + abs(dir.y) * uPlaneHeight);\n    // Extend peel depth so more of the foil area participates in the curl.\n    float peelDepth = mix(0.0, maxReach * uCurlPeelDepth * g, curlT);\n    float peelFront = maxReach - peelDepth;\n\n    float u = dot(p, dir);\n    float v = dot(p, nrm);\n    float local = u - peelFront;\n    float maxLocal = max(0.0001, maxReach - peelFront);\n    // Very subtle feather at peel front: removes seam without changing curl character.\n    float blendBand = maxLocal * 0.1;\n    float rollFrac = clamp(local / maxLocal, 0.0, 1.0);\n    float frontBlend = smoothstep(-blendBand, blendBand, local);\n\n    // Sticker-like peel roll with adjustable tightness.\n    float radius = mix(0.02, 0.4, 1.0 - uCurlTightness);\n    float maxTheta = mix(0.2, 8.2 * g, curlT);\n    float theta = rollFrac * maxTheta * uCurlRollSign;\n\n    float uCurled = peelFront + sin(theta) * radius;\n    vec2 xy = dir * uCurled + nrm * v;\n\n    vec3 flatPos = vec3(p, 0.0);\n    vec3 curledPos = vec3(xy, 0.0);\n    // Bias peel toward camera so curl reads as forward (not back).\n    curledPos.z += (1.0 - cos(theta)) * radius * uCurlCameraBias + rollFrac * curlT * 0.07 * g;\n\n    // Tiny bow along peel cross-axis only (world-X bow reads as a wave on a diagonal peel).\n    float vNorm = clamp(abs(v) / max(0.0001, maxReach), 0.0, 1.0);\n    curledPos.z += (1.0 - vNorm) * 0.08 * curlT * smoothstep(0.2, 1.0, rollFrac) * g;\n    vec3 pos = mix(flatPos, curledPos, frontBlend);\n    return pos;\n  }\n\n  void main() {\n    vUv = uv;\n    vec2 p = position.xy;\n    vec3 pos = applyCurl(p);\n\n    // Curl-aware normal from finite differences of curled surface.\n    float eps = 0.0015;\n    float xMax = uPlaneWidth * 0.5;\n    float yMax = uPlaneHeight * 0.5;\n    vec3 tangentX = (p.x + eps > xMax)\n      ? (pos - applyCurl(p - vec2(eps, 0.0)))\n      : (applyCurl(p + vec2(eps, 0.0)) - pos);\n    vec3 tangentY = (p.y + eps > yMax)\n      ? (pos - applyCurl(p - vec2(0.0, eps)))\n      : (applyCurl(p + vec2(0.0, eps)) - pos);\n    vec3 tangentXView = normalize((modelViewMatrix * vec4(tangentX, 0.0)).xyz);\n    vec3 tangentYView = normalize((modelViewMatrix * vec4(tangentY, 0.0)).xyz);\n    vec3 curlNormalView = normalize(cross(tangentXView, tangentYView));\n\n    vec4 viewPos = modelViewMatrix * vec4(pos, 1.0);\n    // Face the camera; avoid z-sign flip at grazing angles (corner shimmer).\n    vec3 V = normalize(-viewPos.xyz);\n    float ndv = dot(curlNormalView, V);\n    if (ndv < 0.0) curlNormalView = -curlNormalView;\n    ndv = abs(dot(curlNormalView, V));\n    if (ndv < 0.14) {\n      curlNormalView = normalize(mix(curlNormalView, V, 0.38));\n    }\n    vViewPosition = viewPos.xyz;\n    vViewNormal = curlNormalView;\n    vViewTangentX = tangentXView;\n    vViewTangentY = tangentYView;\n    gl_Position = projectionMatrix * viewPos;\n  }\n",fragmentShader:"\n  uniform sampler2D uFoilMap;\n  uniform float uTime;
1\n  uniform vec2 uMouseUv;\n  uniform float uMouseMotion;\n  uniform float uRippleAmplitude;\n  uniform float uRippleFrequency;\n  uniform float uRippleProgress;\n  uniform vec2 uRippleCenter;\n\n  varying vec2 vUv;\n\n  /** Expanding pulse ripples from swallow — a few wave fronts, amplitude decays in JS. */\n  vec2 swallowPulseRipple(vec2 uv) {\n    if (uRippleAmplitude < 0.001) return uv;\n    vec2 d = uv - uRippleCenter;\n    float r = length(d);\n    if (r < 1e-5) return uv;\n\n    float amp = clamp(uRippleAmplitude, 0.0, 2.0);\n    float t = clamp(uRippleProgress, 0.0, 1.0);\n    float expand = t * 0.58;\n    vec2 dir = d / (r + 1e-4);\n    float freq = max(uRippleFrequency, 4.0);\n\n    float w1 = sin((r - expand) * freq * 6.28318)\n             * exp(-abs(r - expand) * 4.8);\n    float w2 = sin((r - expand * 0.74 + 0.035) * freq * 5.2)\n             * exp(-abs(r - expand * 0.74 + 0.035) * 5.4);\n    float w3 = sin((r - expand * 0.48 + 0.07) * freq * 4.6)\n             * exp(-abs(r - expand * 0.48 + 0.07) * 6.2);\n\n    float waves = (w1 + w2 * 0.7 + w3 * 0.45) * amp * (1.0 - t * 0.35);\n    return uv + dir * waves * 0.011;\n  }\n\n  /** Local bulge + ripple around pointer — liquid metal surface tension. */\n  vec2 liquidDistort(vec2 uv, vec2 center, float amount) {\n    vec2 d = uv - center;\n    float r = length(d);\n    vec2 dir = d / (r + 1e-4);\n    vec2 tan = vec2(-dir.y, dir.x);\n    float pool = exp(-r * r * 12.0) * amount;\n    float ripple = sin(r * 26.0 - uTime * 3.4) * 0.18\n                 + sin(r * 11.0 + uTime * 2.1) * 0.1;\n    return uv\n      + dir * pool * 0.052\n      + tan * pool * ripple * 0.028\n      + dir * pool * pool * 0.018;\n  }\n\n  void main() {\n    vec4 baseSample = texture2D(uFoilMap, vUv);\n    if (baseSample.a < 0.01) discard;\n\n    float motion = clamp(uMouseMotion, 0.0, 1.0);\n    vec2 sampleUv = swallowPulseRipple(vUv);\n    if (motion > 0.001) {\n      float amount = mix(0.28, 1.0, motion);\n      sampleUv = liquidDistort(sampleUv, uMouseUv, amount);\n    }\n\n    vec4 texSample = texture2D(uFoilMap, sampleUv);\n    float texLuma = dot(texSample.rgb, vec3(0.299, 0.587, 0.114));\n    float darkTransparency = mix(0.94, 1.0, smoothstep(0.0, 0.45, texLuma));\n    gl_FragColor = vec4(texSample.rgb, texSample.a * darkTransparency);\n  }\n",transparent:!0,side:eg.$EB,uniforms:{uFoilMap:{value:l},uTime:{value:0},uMouseUv:{value:new eg.I9Y(.5,.5)},uMouseMotion:{value:0},uCurlAmount:{value:1},uCurlMax:{value:eD},uCurlGeomBoost:{value:eB},uCurlTightness:{value:d.current.curlTightness},uCurlOrigin:{value:.5},uCurlOriginEdge:{value:1},uCurlAngleDeg:{value:295},uCurlRollSign:{value:1},uCurlPeelDepth:{value:d.current.curlPeelDepth},uCurlCameraBias:{value:d.current.curlCameraBias},uPlaneWidth:{value:1.1},uPlaneHeight:{value:1.1},uRippleAmplitude:{value:d.current.rippleAmplitude},uRippleFrequency:{value:d.current.rippleFrequency},uRippleProgress:{value:0},uRippleCenter:{value:new eg.I9Y(ew.u,ew.v)}}});v.current=s;let T=new eg.eaF(new eg.bdM(1.2,1.2,220,220),s);x.current=T,n.add(T),o();let B=()=>{let e=t.getBoundingClientRect(),n=Math.max(1,Math.floor(e.width)),a=Math.max(1,Math.floor(e.height));i.setSize(n,a,!1);let l=n/a;l>=1?(r.left=-l,r.right=l,r.top=1,r.bottom=-1):(r.left=-1,r.right=1,r.top=1/l,r.bottom=-(1/l)),r.updateProjectionMatrix(),o(),T.position.y=l>=1||l<=.5?0:(1-l)/.5*0},F=()=>{if(c.current)return;let e=t.closest("footer");if(!e)return;let n=e.getBoundingClientRect(),r=window.innerHeight;w.current=Math.max(0,Math.min(1,(r-n.top)/Math.max(r+n.height,1)))},W=0,O=d.current.stickerScale,Y=performance.now(),N=()=>{if(c.current){W=requestAnimationFrame(N);return}performance.now();let e=v.current;if(e){let n=d.current,r=h.current.footerFoilRipple?u.current:{rippleAmplitude:0,rippleFrequency:0,rippleProgress:0};e.uniforms.uCurlTightness.value=n.curlTightness,e.uniforms.uCurlPeelDepth.value=n.curlPeelDepth,e.uniforms.uCurlCameraBias.value=n.curlCameraBias,e.uniforms.uRippleAmplitude.value=r.rippleAmplitude,e.uniforms.uRippleFrequency.value=r.rippleFrequency,e.uniforms.uRippleProgress.value=r.rippleProgress,n.stickerScale!==O&&(O=n.stickerScale,o()),D.current=function(e){let t=e.getBoundingClientRect();return!(t.width<=0)&&!(t.height<=0)&&t.bottom>0&&t.top<window.innerHeight&&t.right>0&&t.left<window.innerWidth}(t);let i=R.current,a=P.current;if(z.current||C.current){i.x+=(a.x-i.x)*.14,i.y+=(a.y-i.y)*.14;let e=Math.hypot(i.x-E.current.x,i.y-E.current.y);L.current+=(Math.min(1,14*e)-L.current)*.18}else L.current+=(0-L.current)*.12;e.uniforms.uMouseUv.value.set(i.x,i.y),e.uniforms.uMouseMotion.value=L.current,E.current.x=i.x,E.current.y=i.y;let l=performance.now()/1e3*n.animationSpeed;e.uniforms.uTime.value=l;let s=Math.max(0,Math.min(1,(w.current-0)/.55)),c=eD/eT*1.5*(1-s*s*(3-2*s));C.current?j.current=I.current:j.current+=(0-j.current)*.048;let p=Math.max(0,Math.min(eD,c+j.current));b.current+=(p-b.current)*.065,e.uniforms.uCurlAmount.value=b.current;let m=295+(C.current?A.current:0);C.current?(k.current=m,e.uniforms.uCurlAngleDeg.value=m,e.uniforms.uCurlRollSign.value=eF(m)):(k.current+=(m-k.current)*.08,e.uniforms.uCurlAngleDeg.value=k.current,e.uniforms.uCurlRollSign.value=eF(k.current))}i.render(n,r),W=requestAnimationFrame(N)},G=(e,n)=>{let r=t.getBoundingClientRect();!(r.width<=0)&&!(r.height<=0)&&e>=r.left&&e<=r.right&&n>=r.top&&n<=r.bottom&&(P.current.x=eg.cj9.clamp((e-r.left)/r.width,0,1),P.current.y=eg.cj9.clamp(1-(n-r.top)/r.height,0,1))},U=e=>{G(e.clientX,e.clientY),C.current=!0,M.current=e.clientX,S.current=e.clientY,I.current=0,j.current=0,A.current=0,i.domElement.style.cursor="grabbing","touch"!==e.pointerType&&i.domElement.setPointerCapture(e.pointerId)},H=e=>{if(G(e.clientX,e.clientY),!C.current)return;let t=e.clientX-M.current,n=e.clientY-S.current,r="touch"===e.pointerType?3:1,i=Math.hypot(t,n);i<4?A.current=0:A.current=180*Math.atan2(-n,t)/Math.PI+60,I.current=.002*i*r},q=()=>{A.current=0,C.current=!1,i.domElement.style.cursor="grab"},V=e=>{q(),"touch"!==e.pointerType&&i.domElement.hasPointerCapture(e.pointerId)&&i.domElement.releasePointerCapture(e.pointerId)},X=e=>{q(),"touch"!==e.pointerType&&i.domElement.hasPointerCapture(e.pointerId)&&i.domElement.releasePointerCapture(e.pointerId)},$=e=>{z.current=!0,G(e.clientX,e.clientY)},_=()=>{z.current=!1};B(),F();let Z=new ResizeObserver(B);Z.observe(t),window.addEventListener("resize",B),i.domElement.addEventListener("pointerenter",$),i.domElement.addEventListener("pointerleave",_),i.domElement.style.cursor="grab",i.domElement.style.touchAction="pan-y",i.domElement.addEventListener("pointerdown",U),i.domElement.addEventListener("pointermove",H),i.domElement.addEventListener("pointerup",V),i.domElement.addEventListener("pointercancel",X);let J=e=>{if(c.current)return;let n=t.getBoundingClientRect(),r=e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>
1=n.top&&e.clientY<=n.bottom;z.current=r,r&&G(e.clientX,e.clientY)};return window.addEventListener("mousemove",J,{passive:!0}),window.addEventListener("scroll",F,{passive:!0}),window.addEventListener("resize",F),W=requestAnimationFrame(N),()=>{cancelAnimationFrame(W),i.domElement.removeEventListener("pointerdown",U),i.domElement.removeEventListener("pointermove",H),i.domElement.removeEventListener("pointerup",V),i.domElement.removeEventListener("pointercancel",X),window.removeEventListener("mousemove",J),window.removeEventListener("scroll",F),window.removeEventListener("resize",F),window.removeEventListener("resize",B),i.domElement.removeEventListener("pointerenter",$),i.domElement.removeEventListener("pointerleave",_),Z.disconnect(),T.geometry.dispose(),s.dispose();let e=y.current;null==e||e.dispose(),i.dispose(),i.domElement.remove(),x.current=null,v.current=null,y.current=null,f.current=null,g.current=null,m.current=null}},[e]),(0,r.jsx)("div",{id:"usmnt-footer-foil",ref:p,style:{width:"100%",height:"100%",pointerEvents:"auto"}})}var eO=n(3350),eY=n(4177);let eN=(0,ev.eU)([]);function eG(){let[e,t]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{t(function(e){let t;(null==t||""===t)&&(t=window.location.hostname);let n=t.toLowerCase();return!!("localhost"===n||"127.0.0.1"===n||"[::1]"===n||/^\d{1,3}(\.\d{1,3}){3}$/.test(n)||n.endsWith(".vercel.app"))}())},[]),e}let eU=(0,ev.eU)(!1),eH="usmnt:dismiss-gallery-hover";function eq(e,t){let n=function(e,t){let n=new eg.VCu(e,t);return n.format=eg.zdS,n.type=eg.bkx,n}(e,t);return new eg.nWS(e,t,{format:eg.GWd,type:eg.OUM,colorSpace:eg.er$,depthTexture:n,depthBuffer:!0})}let eV=new eg.Q1f(38/255,72/255,118/255);function eX(e,t,n,r,i){e.chromaticUniforms.blueColor.value.setRGB(t/255,n/255,r/255),e.chromaticUniforms.blueMix.value=i}function e$(e,t,n){e.chromaticUniforms.coreDarkness.value=t,e.chromaticUniforms.innerCoreDarkness.value=n}let e_={lightDirX:.85,lightDirY:.75,lightDirZ:.95,lightDistance:480,ambientIntensity:1.9,keyLightIntensity:2.2,keyLightColorR:255,keyLightColorG:255,keyLightColorB:255,shadowIntensity:.62,shadowRadius:14,shadowBias:0,shadowNormalBias:.02,receiveOpacity:.43,shadowColorR:47,shadowColorG:28,shadowColorB:12,shadowColorMix:.92,receiverPlaneZ:-.255,frustumPadding:1.3,ballCastShadow:!0,penCastShadow:!0,outerShadowOpacityMul:1.43,outerShadowCoreDarkness:1.32};function eZ(){return{...e_}}let eJ=Object.keys(e_),eK=[{key:"ambientIntensity",label:"ambient",min:0,max:3,step:.05},{key:"lightDirX",label:"dir x",min:-2,max:2,step:.05},{key:"lightDirY",label:"dir y",min:-2,max:2,step:.05},{key:"lightDirZ",label:"dir z",min:.1,max:2,step:.05},{key:"lightDistance",label:"distance",min:50,max:600,step:5},{key:"keyLightIntensity",label:"key light",min:0,max:6,step:.05},{key:"keyLightColorR",label:"key r",min:0,max:255,step:1},{key:"keyLightColorG",label:"key g",min:0,max:255,step:1},{key:"keyLightColorB",label:"key b",min:0,max:255,step:1}],eQ=[{key:"shadowIntensity",label:"strength",min:0,max:1,step:.01},{key:"shadowRadius",label:"blur",min:0,max:20,step:.5},{key:"shadowBias",label:"bias",min:-.01,max:.01,step:5e-4},{key:"shadowNormalBias",label:"normal bias",min:0,max:.1,step:.002}],e0=[{key:"outerShadowOpacityMul",label:"opacity",min:0,max:2,step:.01},{key:"outerShadowCoreDarkness",label:"core dark",min:0,max:1.5,step:.01}],e1=[{key:"receiveOpacity",label:"opacity",min:0,max:1,step:.01},{key:"shadowColorR",label:"shadow r",min:0,max:255,step:1},{key:"shadowColorG",label:"shadow g",min:0,max:255,step:1},{key:"shadowColorB",label:"shadow b",min:0,max:255,step:1},{key:"shadowColorMix",label:"shadow tint",min:0,max:1,step:.01},{key:"receiverPlaneZ",label:"plane z",min:-.5,max:.5,step:.005},{key:"frustumPadding",label:"frustum pad",min:1,max:2.5,step:.05}];function e2(e){let t=e.getBoundingClientRect();if(t.width<=0||t.height<=0)return{width:1,height:1};let n=Math.min(window.devicePixelRatio,1),r=Math.max(1,Math.round(t.width*n)),i=Math.max(1,Math.round(t.height*n)),a=Math.max(r,i);if(a>1024){let e=1024/a;r=Math.max(1,Math.round(r*e)),i=Math.max(1,Math.round(i*e))}return{width:r,height:i}}function e5(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:80,r=n*Math.tan(t.fov*Math.PI/360),i=r*t.as
1pect;e.position.set(0,0,-n),e.scale.set(2*i,2*r,1),e.quaternion.identity(),e.updateMatrixWorld(!0)}e_.receiveOpacity,e_.shadowRadius;let e3=new eg.Pq0,e4=new eg.Q1f;function e6(e){e.traverse(e=>{e.layers.enable(1)})}function e8(e,t,n){e.traverse(e=>{if(e instanceof eg.eaF)for(let r of Array.isArray(e.material)?e.material:[e.material])r.colorWrite=t,r.depthWrite=n})}let e9=new eg.Pq0,e7=new eg.Pq0,te=new eg.kn4;function tt(e,t){var n;let r=null!=(n=t.padding)?n:1.3,{halfW:i,halfH:a}=function(e,t,n,r){let i=r*Math.tan(n*Math.PI/360);return{halfW:e/Math.max(1,t)*i,halfH:i}}(t.viewportWidth,t.viewportHeight,t.fovDeg,t.cameraZ),o=-a*r,l=a*r;e.target.updateMatrixWorld(!0),e.updateMatrixWorld(!0);let s=e.shadow.camera;s.position.setFromMatrixPosition(e.matrixWorld),e.target.getWorldPosition(e9),s.lookAt(e9),s.updateMatrixWorld(!0),te.copy(e.shadow.camera.matrixWorldInverse);let c=1/0,d=-1/0,u=1/0,h=-1/0,p=1/0,m=-1/0;for(let e of[-i*r,i*r])for(let t of[o,l])for(let n of[-96,48])e7.set(e,t,n).applyMatrix4(te),c=Math.min(c,e7.x),d=Math.max(d,e7.x),u=Math.min(u,e7.y),h=Math.max(h,e7.y),p=Math.min(p,e7.z),m=Math.max(m,e7.z);let f=e.shadow.camera;f.left=c-6,f.right=d+6,f.top=h+6,f.bottom=u-6,f.near=Math.max(.5,-m+12),f.far=-p+12,f.updateProjectionMatrix()}function tn(e,t){e.add(t),e.add(t.target)}function tr(e){e.traverse(e=>{if(!(e instanceof eg.eaF))return;e.castShadow=!0,e.receiveShadow=!1,e.frustumCulled=!1;let t=function(e){var t;for(let t of e)if((t instanceof eg._4j||t instanceof eg.uSd)&&(t.map||t.alphaMap||t.transparent))return t;return null!=(t=e.find(Boolean))?t:e[0]}(Array.isArray(e.material)?e.material:[e.material]);t&&function(e,t){var n;if((t instanceof eg._4j||t instanceof eg.uSd)&&(t.side=eg.$EB),t.transparent||t.opacity<1||t.alphaMap||"alphaTest"in t&&t.alphaTest>0||0){let r="alphaTest"in t?Math.max(t.alphaTest,.04):.04;(t.transparent||t.opacity<1)&&"alphaTest"in t&&(t.alphaTest=r);let i=new eg.CSG({depthPacking:eg.N5j,alphaTest:r,side:eg.$EB});t.map&&(i.map=t.map,i.alphaMap=null!=(n=t.alphaMap)?n:t.map),e.customDepthMaterial=i;return}e.customDepthMaterial=new eg.CSG({side:eg.$EB})}(e,t)})}function ti(e){e6(e),tr(e)}function ta(e){e6(e),th(e),tr(e)}function to(e){e.traverse(e=>{e instanceof eg.eaF&&(e.castShadow=!1,delete e.customDepthMaterial)})}
1function tl(e,t){e.position.z=t.receiverPlaneZ,ts(e,Math.min(1,t.receiveOpacity*t.outerShadowOpacityMul));let n=e.material;!Array.isArray(n)&&td(n)&&(eX(n,t.shadowColorR,t.shadowColorG,t.shadowColorB,t.shadowColorMix),e$(n,t.outerShadowCoreDarkness,.58))}function ts(e,t){let n=e.material;if(!Array.isArray(n))if(td(n))n.opacity=t,n.chromaticUniforms.baseOpacity.value=t;else n instanceof eg.q2&&(n.opacity=t)}function tc(e,t,n,r){var i,a,o;r&&(r.intensity=t.ambientIntensity),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:250,r=t.clone().normalize();e.position.copy(r.multiplyScalar(n)),e.target.position.set(0,0,0)}(e,e3.set(t.lightDirX,t.lightDirY,t.lightDirZ),t.lightDistance),i=t.keyLightColorR,a=t.keyLightColorG,o=t.keyLightColorB,e4.setRGB(i/255,a/255,o/255),e4.convertSRGBToLinear(),e.color.copy(e4),e.intensity=t.keyLightIntensity,e.castShadow=!0,e.shadow.intensity=t.shadowIntensity,e.shadow.radius=t.shadowRadius,e.shadow.bias=t.shadowBias,e.shadow.normalBias=t.shadowNormalBias,n&&tl(n,t)}function td(e){return e instanceof eg.q2&&"chromaticUniforms"in e&&null!=e.chromaticUniforms}function tu(e,t){e.traverse(e=>{e instanceof eg.eaF&&(e.castShadow=t)})}function th(e){e.traverse(e=>{e instanceof eg.eaF&&(e.receiveShadow=!0)})}let tp={offscreenX:.18,offscreenY:.14,z:-20,intensity:5.4,colorR:90,colorG:68,colorB:35};function tm(){return{...tp}}let tf=Object.keys(tp),tg=[{key:"offscreenX",label:"offscreen x",min:0,max:.6,step:.01},{key:"offscreenY",label:"offscreen y",min:0,max:.6,step:.01},{key:"z",label:"z",min:-120,max:120,step:1},{key:"intensity",label:"intensity",min:0,max:12,step:.1},{key:"colorR",label:"color r",min:0,max:255,step:1},{key:"colorG",label:"color g",min:0,max:255,step:1},{key:"colorB",label:"color b",min:0,max:255,step:1}];function tx(e){let t=Math.round(e.colorR).toString(16).padStart(2,"0"),n=Math.round(e.colorG).toString(16).padStart(2,"0"),r=Math.round(e.colorB).toString(16).padStart(2,"0");return"#".concat(t).concat(n).concat(r)}var tv=n(1762);let ty={tileWidth:512,waveCycles:.1,wavePower:1.08,streakStrength:.12,gapFloor:.88,wavePhaseWobble:.42,waveEnvelope:.32,waveCrossRipple:.24,patternScaleBase:.22,patternScaleSpeed:.06,speedRefPxS:2200,strokeOpacityMin:.96,strokeOpacityMax:.94,underlayAlpha:.14},tw={...ty},tb=new Set;function tk(){let e=tw;return[e.tileWidth,e.waveCycles,e.wavePower,e.streakStrength,e.gapFloor,e.wavePhaseWobble,e.waveEnvelope,e.waveCrossRipple].join(":")}let tC=[{key:"tileWidth",label:"tile width",min:128,max:1024,step:16},{key:"waveCycles",label:"streak freq",min:.35,max:4,step:.05},{key:"wavePower",label:"streak sharp",min:.6,max:3,step:.05},{key:"streakStrength",label:"streak dark",min:.15,max:1,step:.01},{key:"gapFloor",label:"gap floor",min:0,max:.35,step:.01},{key:"wavePhaseWobble",label:"streak wobble",min:0,max:1.2,step:.02},{key:"waveEnvelope",label:"streak breathe",min:0,max:.8,step:.02},{key:"waveCrossRipple",label:"streak ripple",min:0,max:.8,step:.02},{key:"patternScaleBase",label:"scale base",min:.08,max:.6,step:.01},{key:"patternScaleSpeed",label:"scale speed",min:0,max:.35,step:.01},{key:"speedRefPxS",label:"speed ref",min:400,max:6e3,step:50},{key:"strokeOpacityMin",label:"opacity fast",min:.5,max:1,step:.01},{key:"strokeOpacityMax",label:"opacity slow",min:.5,max:1,step:.01},{key:"underlayAlpha",label:"underlay",min:0,max:.35,step:.01}];var tM=n(5081);let tS={alongNoise:0,alongNoiseFreq:.09,crossNoise:0,crossNoiseFreq:.18,imageMapStrength:0,imageMapStretchAlong:1,imageMapStretchCross:1},tj={...tS},tI="",tA=null,tP={width:0,height:0},tR=0,tE=new Set;function tL(){for(let e of tE)e()}function tz(){let e=tj;return[e.alongNoise,e.alongNoiseFreq,e.crossNoise,e.crossNoiseFreq,e.imageMapStrength,e.imageMapStretchAlong,e.imageMapStretchCross,tI,tP.width,tP.height].join(":")}function tD(e){let t=e.trim().toLowerCase();return t===tM.d7.toLowerCase()||t===tM.Nt.toLowerCase()}let tT=[{key:"alongNoise",label:"noise along",min:0,max:1,step:.01},{key:"alongNoiseFreq",label:"along freq",min:.01,max:.5,step:.01}
1,{key:"crossNoise",label:"noise cross",min:0,max:1,step:.01},{key:"crossNoiseFreq",label:"cross freq",min:.01,max:.8,step:.01},{key:"imageMapStrength",label:"map strength",min:0,max:1,step:.01},{key:"imageMapStretchAlong",label:"map stretch x",min:.1,max:8,step:.05},{key:"imageMapStretchCross",label:"map stretch y",min:.1,max:4,step:.05}];function tB(e){let t=43758.5453*Math.sin(127.1*e+311.7);return t-Math.floor(t)}let tF=new Map;function tW(e,t,n,r){return t<=0?1:Math.max(.05,1+t*(.5*Math.sin(e*n+r)+.65*(tB(e*n*2.7+1.9*r)-.5)))}function tO(e,t,n){var r,i;let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4?arguments[4]:void 0;if(!("setTransform"in e))return;let l=180*n/Math.PI,s=null!=(r=null==o?void 0:o.translateX)?r:0,c=null!=(i=null==o?void 0:o.translateY)?i:0;e.setTransform(new DOMMatrix().rotateSelf(l).scaleSelf(a,1).translateSelf(-t-s,c))}let tY=Math.PI/2;function tN(e,t,n){let r=t-e;for(;r>Math.PI;)r-=2*Math.PI;for(;r<-Math.PI;)r+=2*Math.PI;return e+r*n}function tG(e,t){return{along:tB(.017*e+3.1*t)*Math.PI*2,cross:tB(.023*e+5.7*t+1.3)*Math.PI*2,wave:tB(.031*e+2.3*t+2.7)*Math.PI*2,mapAlong:2*tB(.011*e+4.1*t),mapCross:.5*tB(.019*e+6.3*t+3.9)}}function tU(e,t){let n=tj,r=Math.max(.25,tw.waveCycles),i=0,a=0;return n.alongNoise>0&&(i+=e.along/Math.max(.01,n.alongNoiseFreq)),n.crossNoise>0&&(a+=e.cross/Math.max(.01,n.crossNoiseFreq)),i+=e.wave/(2*Math.PI)*t/r,n.imageMapStrength>0&&n.imageMapStretchAlong>0&&(i+=e.mapAlong/n.imageMapStretchAlong*t),n.imageMapStrength>0&&n.imageMapStretchCross>0&&(a+=e.mapCross*t/n.imageMapStretchCross),{translateX:i,translateY:a}}let tH={roughness:.82,metalness:0,clearcoat:.08,clearcoatRoughness:.72,sheen:.24,sheenRoughness:.78,envMapIntensity:.85};function tq(e,t){void 0!==t.roughness&&(e.roughness=t.roughness),void 0!==t.metalness&&(e.metalness=t.metalness),void 0!==t.clearcoat&&(e.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(e.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.sheen&&(e.sheen=t.sheen),void 0!==t.sheenRoughness&&(e.sheenRoughness=t.sheenRoughness),void 0!==t.sheenColor&&e.sheenColor.set(t.sheenColor),void 0!==t.ior&&(e.ior=t.ior),void 0!==t.reflectivity&&(e.reflectivity=t.reflectivity),void 0!==t.envMapIntensity&&(e.envMapIntensity=t.envMapIntensity)}function tV(e,t){e.traverse(e=>{if(!(e instanceof eg.eaF))return;let n=(Array.isArray(e.material)?e.material:[e.material]).map((n,r)=>{let i="function"==typeof t?t(e,n,r):t,a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e instanceof eg.uSd)return tq(e,t),e;let n=new eg.uSd;return n.name=e.name,n.color.copy(e.color),n.emissive.copy(e.emissive),n.emissiveIntensity=e.emissiveIntensity,n.map=e.map,n.emissiveMap=e.emissiveMap,n.normalMap=e.normalMap,n.normalScale.copy(e.normalScale),n.roughnessMap=e.roughnessMap,n.metalnessMap=e.metalnessMap,n.aoMap=e.aoMap,n.alphaMap=e.alphaMap,n.lightMap=e.lightMap,n.bumpMap=e.bumpMap,n.bumpScale=e.bumpScale,n.displacementMap=e.displacementMap,n.displacementScale=e.displacementScale,n.displacementBias=e.displacementBias,n.roughness=e.roughness,n.metalness=e.metalness,n.transparent=e.transparent,n.opacity=e.opacity,n.alphaTest=e.alphaTest,n.side=e.side,n.depthWrite=e.depthWrite,n.depthTest=e.depthTest,n.vertexColors=e.vertexColors,n.wireframe=e.wireframe,n.envMap=e.envMap,n.envMapIntensity=e.envMapIntensity,n.onBeforeCompile=e.onBeforeCompile,n.customProgramCacheKey=e.customProgramCacheKey,tq(n,t),n.needsUpdate=!0,n}(n,i);return a!==n&&n.dispose(),a});e.material=1===n.length?n[0]:n})}function tX(e){tV(e,(e,t)=>(function(e,t){let n="".concat(e.name,":").concat(t.name).toLowerCase();return/gold|band|ring/.test(n)?{metalness:.92,roughness:.35,clearcoat:.35,clearcoatRoughness:.28,envMapIntensity:1.1}:/tip|blue|felt|nib/.test(n)?{metalness:0,roughness:.7,clearcoat:0,sheen:.18,sheenRoughness:.82,envMapIntensity:.75}:/barrel|clear|body|plastic|tube|glass/.test(n)?{metalness:0,roughness:.1,clearcoat:.92,clearcoatRoughness:.12,ior:1.46,envMapIntensity:1.15}:{metalness:.04,roughness:.48,clearcoat:.22,clearcoatRoughness:.42,envMapIntensity:.9}})(e,t))}
1let t$="/images/usmnt/marker.glb",t_=["Blue_Tip","tip","Tip"];async function tZ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t$,n=(await e.loadAsync(t)).scene;tX(n);let r=new eg.YJl;r.add(n),n.traverse(e=>{e instanceof eg.eaF&&(e.castShadow=!0,e.receiveShadow=!1)});let i=new eg.NRn().setFromObject(n).getSize(new eg.Pq0),a=Math.max(i.x,i.y,i.z,.001);n.scale.setScalar(.64/a),n.updateMatrixWorld(!0);let o=new eg.NRn().setFromObject(n),l=o.getCenter(new eg.Pq0);n.position.sub(l),n.updateMatrixWorld(!0);let s=function(e){for(let t of t_){let n=e.getObjectByName(t);if(n)return n}let t=null;return e.traverse(e=>{!t&&e.name.toLowerCase().includes("tip")&&(t=e)}),t}(n),c=new eg.Pq0,d=new eg.Pq0(0,1,0),u=[{axis:"x",length:i.x},{axis:"y",length:i.y},{axis:"z",length:i.z}];u.sort((e,t)=>t.length-e.length);let h=u[0].axis;if(s){n.updateWorldMatrix(!0,!0);let e=s.getWorldPosition(new eg.Pq0);c.copy(n.worldToLocal(e))}else{let e=(o.max[h]-o.min[h])*.5;c.set(0,0,0),c[h]=e}d.set(0,0,0),d[h]=c[h]<=0?1:-1;let p=o.max[h]-o.min[h],m=c.clone(),f=m.clone().add(d.clone().normalize().multiplyScalar(.25*p));return n.position.sub(m),f.sub(m),c.set(0,0,0),{group:r,tipAnchorLocal:c,dragAnchorLocal:f,dragAxisLocal:d}}var tJ=n(6916);let tK=null;function tQ(e,t,n){if(0===n)return;let r=e.width,i=e.height;if(r<=0||i<=0)return;let a=Math.abs(n);if(a>=i)return void t.clearRect(0,0,r,i);let o=(tK||(tK=document.createElement("canvas")),(tK.width!==r||tK.height!==i)&&(tK.width=r,tK.height=i),tK.getContext("2d",{alpha:!0}));if(!o)return void t.clearRect(0,0,r,i);o.clearRect(0,0,r,i),n>0?o.drawImage(e,0,n,r,i-a,0,0,r,i-a):o.drawImage(e,0,0,r,i-a,0,a,r,i-a),t.clearRect(0,0,r,i),t.drawImage(tK,0,0)}function t0(e,t,n,r){var i;let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:32;if(!e)return!0;let o=Math.max(0,Math.min(t-1,Math.floor(n))),l=Math.max(0,Math.min(Math.floor(r),Math.floor(e.length/t)-1));return(null!=(i=e[l*t+o])?i:0)<a}function t1(e,t){let n=43758.5453*Math.sin(12.9898*e+78.233*t);return n-Math.floor(n)}function t2(e,t){var n;let r=Math.floor(e),i=Math.floor(t),a=t-i,o=t6(e-r),l=t6(a),s=t1(r,i),c=t1(r+1,i),d=t1(r,i+1),u=t1(r+1,i+1);return(n=s+(c-s)*o)+(d+(u-d)*o-n)*l}function t5(e,t){let n=t2(.07*e,.07*t),r=t2(.11*e+17.3,.09*t+5.1),i=t2(.13*e+31.7,.15*t+11.9);return{spawn:n,length:r,drop:i,width:t2(.17*e+47.2,.19*t+23.4),phase:t2(.23*e+61.5,.21*t+37.8)}}function t3(){return{drips:[]}}function t4(e){e.drips=[]}function t6(e){let t=Math.min(1,Math.max(0,e));return t*t*(3-2*t)}function t8(e,t,n){for(let r of e.drips)if(22>Math.hypot(r.x-t,r.y-n))return!0;return!1}function t9(e,t){return Math.min(1,Math.max(0,(t-e.y)/Math.max(e.maxDrop,1)))}function t7(e,t){return 1.5+-.5*t9(e,t)}function ne(e,t){let n=t9(e,t),r=e.noiseSeed;return(.55*Math.sin(n*Math.PI*2.4+r)+.28*Math.sin(n*Math.PI*5.7+2.17*r)+.17*Math.sin(n*Math.PI*11.3+.61*r))*.8}function nt(e,t){let n=t5(e.x,e.y),r=n.length>=.68,i=r?6+9*n.drop:18+56*n.drop,a=Math.min(t,(r?.55:2)+n.length*(r?.95:4));return{x:e.x,y:e.y,drop:0,maxDrop:i,lastPaintedDrop:0,width:(.85+2.6*n.width)*4,noiseSeed:n.phase*Math.PI*2,durationSec:Math.max(.05,a),elapsedSec:0}}function nn(e,t,n,r,i){let a=Math.max(0,t.deadlineSec-t.nowSec);if(a<=0||e.drips.length>=4)return!1;let o=r+.92*i;return!t8(e,n,o)&&(e.drips.push(nt({x:n,y:o},a)),!0)}function nr(e,t,n,r,i,a){let o=Math.max(0,i.deadlineSec-i.nowSec);if(o<=0)return;let l=a&&a.width===n&&a.height===r?function(e){let{width:t,height:n,data:r}=e,i=new Uint8ClampedArray(t*n);for(let e=0,t=3;e<i.length;e++,t+=4)i[e]=r[t];return i}(a):null;if(!(0>=Math.max(0,4-e.drips.length)))for(let i of function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(t<=0||n<=0)return[];let{data:i}=e.getImageData(0,0,t,n),a=[],o=null!=r&&r.length===t*n;for(let e=7;e<n-14;e+=7)for(let l=7;l<t-7;l+=7){let s=e*t+l;i[4*s+3]<48||o&&r[s]>=48||i[((e+7)*t+l)*4+3]>28||a.push({x:l,y:e,opacity:function(e,t,n,r,i){let a=0;for(let o=-1;o<=1;o++)for(let l=-1;l<=1;l++){let s=r+l,c=i+o;s<0||c<0||s>=t||c>=n||(a=Math.max(a,e[(c*t+s)*4+3]))}return a}(i,t,n,l,e)})}return a.sort((e,t)=>
1t.opacity-e.opacity),a}(t,n,r,l)){if(e.drips.length>=4)break;if(t8(e,i.x,i.y))continue;let{spawn:t}=t5(i.x,i.y);t<.75||e.drips.push(nt(i,o))}}function ni(e,t,n,r,i,a,o){let l=arguments.length>7&&void 0!==arguments[7]&&arguments[7];if(o.nowSec>=o.deadlineSec||0===e.drips.length)return e.drips.length>0&&(e.drips=[],!0);if(l)return!1;let s=!1,c=Math.max(a,1/240);for(let n of e.drips){let e=n.drop;n.elapsedSec=Math.min(n.durationSec,n.elapsedSec+c);let r=t6(n.elapsedSec/n.durationSec);n.drop=n.maxDrop*r,n.drop>e+1e-4&&(!function(e,t,n){let r=t.y+t.lastPaintedDrop,i=t.y+t.drop;if(!(i<=r+.25)){if(e.save(),e.fillStyle=n,e.globalAlpha=1,t.maxDrop<=16)for(let n=r;n<i;n+=3){let r=n+1.5,i=t7(t,r),a=.26*t.width*i,o=t.x+ne(t,r);e.beginPath(),e.arc(o,r,a,0,2*Math.PI),e.fill()}else{let n=t7(t,i),a=.38*t.width*n,o=.85*a;for(let n=r;n<i;n+=3){let r=Math.min(i,n+3),a=(n+r)*.5,l=t7(t,a),s=.32*t.width*l,c=t.x+ne(t,a);e.fillRect(c-s,n,2*s,r-n+o)}e.beginPath(),e.arc(t.x+ne(t,i),i,a,0,2*Math.PI),e.fill()}e.restore(),t.lastPaintedDrop=t.drop}}(t,n,i),s=!0)}let d=e.drips.length;return e.drips=e.drips.filter(e=>e.elapsedSec<e.durationSec-.001),e.drips.length!==d&&(s=!0),s}let na={groundZ:-.02,hoverLift:.014,drawContactOffset:0},no={...na},nl=[{key:"groundZ",label:"ground z",min:-1,max:.5,step:.001},{key:"hoverLift",label:"hover lift",min:0,max:.12,step:.001},{key:"drawContactOffset",label:"draw offset",min:-.02,max:.02,step:5e-4}],ns="markerInkMaterialInvert",nc=new WeakMap,nd=new WeakMap,nu="/* marker_ink_invert */",nh="\n".concat(nu,"\ngl_FragColor.rgb = vec3(1.0) - gl_FragColor.rgb;\n");function np(e,t){(e instanceof eg.V9B||e instanceof eg._4j||e instanceof eg.uSd)&&(!function(e){if(nc.has(e))return;nc.set(e,e.onBeforeCompile),nd.set(e,e.customProgramCacheKey),e.onBeforeCompile=(t,n)=>{var r;null==(r=nc.get(e))||r.call(e,t,n),e.userData[ns]&&function(e){if(e.fragmentShader.includes(nu))return;let t="".concat(nh,"\n");for(let n of["#include <colorspace_fragment>","#include <dithering_fragment>","#include <tonemapping_fragment>","#include <opaque_fragment>"])if(e.fragmentShader.includes(n)){e.fragmentShader=e.fragmentShader.replace(n,t+n);return}}(t)};let t=nd.get(e);e.customProgramCacheKey=function(){var e;let n=null!=(e=null==t?void 0:t.call(this))?e:"";return"".concat(n,"|markerInkInv:").concat(+!!this.userData[ns])}}(e),e.userData[ns]!==t&&(e.userData[ns]=t,e.needsUpdate=!0))}function nm(e,t){if(!e)return;let n=e.material;if(Array.isArray(n)){for(let e of n)np(e,t);return}np(n,t)}let nf=1,ng=0,nx=1,nv=0,ny=36;function nw(e){let t=-.05;return(0,tM.En)()&&(t+=tM.VI),Math.max(0,Math.min(1,e+t))}function nb(){let{underlayAlpha:e}=tw;return nw(e+((0,tM.En)()?tM.Cu:0))}let nk=new WeakMap;function nC(e,t){var n;let r,i=nk.get(e);i||(i=new Map,nk.set(e,i));let a=(n=t,r="".concat(n,":").concat(tk()),tD(n)&&(r+=":".concat(tz())),r),o=i.get(a);return o||(o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#000000",n=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#000000",n=tw,r=Math.max(64,Math.round(n.tileWidth)),i=(e="".concat(15,":").concat(t,":").concat(tk()),tD(t)&&(e+=":".concat(tz())),e),a=tF.get(i);if(a)return a;let[o,l,s]=function(e){let t=function(e){let t=e.trim();return/^#[0-9a-fA-F]{6}$/.test(t)?[parseInt(t.slice(1,3),16),parseInt(t.slice(3,5),16),parseInt(t.slice(5,7),16)]:/^#[0-9a-fA-F]{3}$/.test(t)?[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]:null}(e);if(t)return t;if("undefined"==typeof document)return[0,0,0];let n=document.createElement("span");n.style.color=e,document.documentElement.appendChild(n);let r=getComputedStyle(n).color;document.documentElement.removeChild(n);let i=r.match(/[\d.]+/g);return!i||i.length<3?[0,0,0]:[Math.round(Number(i[0])),Math.round(Number(i[1])),Math.round(Number(i[2]))]}(t),c=document.createElement("canvas");c.width=r,c.height=64;let d=c.getContext("2d");if(!d)return tF.set(i,c),c;let u=d.createImageData(r,64),{data:h}=u,p=1-n.streakStrength,m=tD(t);for(let e=0;e<64;e++){let t=Math.abs(e-32)/32,i=t<.12?.82+t/.12*.18:t>.9?.78+(1-t)/.1*.22:1;for(let t=0;t<r;t++){let a=t/r,c=(e-32)/32,d=n.wavePhaseWobble*Math.PI*(Math.sin(a*Math.PI*2)+.42*Math.sin(a*Math.PI*4)),u=n.waveCrossRipple*Math.PI*c*Math.sin(a*Math.PI*2),f=Math.sin(a*Math.PI*2*n.waveCycles+d+u),g=1-n.waveEnvelope+n.waveEnvelope*(.5+.5*Math.sin(a*Math.PI*2)),x=p+n.streakStrength*g*Math.pow(Math.max(0,f),n.wavePower),v=(n.gapFloor+x*(1-n.gapFloor))*i;m&&(v=function(e,t,n,r,i,a){let o=tj,l=e;if(l*=tW(t,o.alongNoise,o.alongNoiseFreq,0)*tW(n,o.crossNoise,o.crossNoiseFreq,0),o.imageMapStrength>0){let e=function(e,t){if(!tA||tP.width<=0||tP.height<=0)return 1;let n=e-Math.floor(e),r=Math.max(0,Math.min(1,t)),i=Math.min(tP.width-1,Math.floor(n*tP.width));return tA[Math.min(tP.height-1,Math.floor(r*tP.height))*tP.width+i]/255}(t/r*o.imageMapStretchAlong,n/64*o.imageMapStretchCross);l*=1-o.imageMapStrength+o.imageMapStrength*e}return Math.max(0,Math.min(1,l))}(v,t,e,r,0,0));let y=(e*r+t)*4;h[y]=o,h[y+1]=l,h[y+2]=s,h[y+3]=Math.floor(255*v)}}return d.putImageData(u,0,0),tF.set(i,c),c}(t),r=e.createPattern(n,"repeat");if(!r)throw Error("Could not create marker stripe pattern");return r}(e,t),i.set(a,o)),o}function nM(e){let{speedRefPxS:t}=tw;return .34+.66*Math.min(1,Math.max(0,e/t))}function nS(e){let{patternScaleBase:t,patternScaleSpeed:n}=tw;return t+(1-e)*n}function nj(e,t){var n;let{strokeOpacityMin:r,strokeOpacityMax:i,speedRefPxS:a}=tw,o=i-Math.min(1,Math.max(0,t/a))*(i-r),l=null!=(n=e.inkOpacityEased)?n:o,s=l+(o-l)*.045;return e.inkOpacityEased=s,s}function nI(e,t,n,r,i){let a=1-i,o=3*a*a*(t.x-e.x)+6*a*i*(n.x-t.x)+3*i*i*(r.x-n.x);return Math.atan2(3*a*a*(t.y-e.y)+6*a*i*(n.y-t.y)+3*i*i*(r.y-n.y),o)}function nA(e,t,n){var r,i,a;let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=15.4224;return(0,tM.En)()&&(l*=tM.JB),l*=nf,o&&null!=e&&null!=t&&null!=n&&(l*=1+(.55*Math.sin(.071*(r=e)+.003*(i=t)+.002*(a=n))+.45*Math.sin(.019*r+.005*i-.004*a+2.1))*((0,tM.En)()?.05:.03)),l}function nP(e,t,n,r,i){var a,o,l;let s=nA(),c=.5*s,d=null!=(a=t.inkPathPx)?a:0;t.inkPathPx=d+s;let u=d+.5*s,h=nC(e,i),p=nM(0),m=nj(t,0),f=null!=(l=null!=(o=t.prevSegmentAngleRad)?o:t.lastTangentRad)?l:0,g=nE(i,t,f,u,0===d);return e.beginPath(),e.arc(n,r,c,0,2*Math.PI),e.fillStyle=i,e.globalAlpha=nb(),e.fill(),tO(h,u,0,nS(p),g),e.fillStyle=h,e.globalAlpha=nw(m),e.fill(),e.globalAlpha=1,c}function nR(){return Math.max(64,Math.round(tw.tileWidth))}function nE(e,t,n,r,i){if(tD(e))return tU(function(e,t,n,r){var i,a,o;if(r||!e.yellowLineInstance){let r=tG(n,t);return e.yellowLineInstance=r,e.prevSegmentAngleRad=t,r}let l=e.yellowLineInstance,s=null!=(i=e.prevSegmentAngleRad)?i:t,c=.04+.96*Math.min(1,function(e,t){let n=e-t;for(;n>Math.PI;)n-=2*Math.PI;for(;n<-Math.PI;)n+=2*Math.PI;return Math.abs(n)}(t,s)/tY),d=tG(n,t),u={along:tN(l.along,d.along,c),cross:tN(l.cross,d.cross,c),wave:tN(l.wave,d.wave,c),mapAlong:(a=l.mapAlong,a+(d.mapAlong-a)*c),mapCross:(o=l.mapCross,o+(d.mapCross-o)*c)};return e.yellowLineInstance=u,e.prevSegmentAngleRad=t,u}(t,n,r,i),nR())}function nL(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:nA();e.strokeStyle=t,e.fillStyle=t,e.lineWidth=n,e.globalAlpha=1,e.globalCompositeOperation="source-over"}function nz(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:nA(),a=arguments.length>5?arguments[5]:void 0,o=nC(e,n);e.save(),e.translate(t.x,t.y),e.rotate("start"===r?t.angleRad+Math.PI:t.angleRad),e.beginPath(),e.arc(0,0,.5*i,-Math.PI/2,Math.PI/2),e.fillStyle=n,e.globalAlpha=nb(),e.fill(),tO(o,t.pathMidPx,t.angleRad,nS(t.density),a),e.fillStyle=o,e.globalAlpha=nw(t.o
1pacity),e.fill(),e.restore()}function nD(e,t,n,r,i,a){let o=!(arguments.length>6)||void 0===arguments[6]||arguments[6],l=(0,tJ.Bt)(t,n,r);if(!l)return!1;if(o){var s;let n=Math.hypot(l.p2.x-l.p1.x,l.p2.y-l.p1.y),r=null!=(s=t.inkPathPx)?s:0,o=r+.5*n;t.inkPathPx=r+n;let c=function(e,t){var n;let r=null!=(n=e.inkSpeedEased)?n:t,i=r+(t-r)*.16;return e.inkSpeedEased=i,i}(t,i),d=nM(c),u=nj(t,c),h=nI(l.p1,l.cp1,l.cp2,l.p2,.5),p=nA(o,(l.p1.x+l.p2.x)*.5,(l.p1.y+l.p2.y)*.5,!0),m=nC(e,a),f=nE(a,t,h,o,0===r);e.lineCap="butt",e.lineJoin="round",e.lineWidth=p,e.beginPath(),e.moveTo(l.p1.x,l.p1.y),e.bezierCurveTo(l.cp1.x,l.cp1.y,l.cp2.x,l.cp2.y,l.p2.x,l.p2.y),e.strokeStyle=a,e.globalAlpha=nb(),e.stroke(),tO(m,o,h,nS(d),f),e.strokeStyle=m,e.globalAlpha=nw(u),e.stroke(),e.globalAlpha=1;let g=nI(l.p1,l.cp1,l.cp2,l.p2,0);t.lastTangentRad=nI(l.p1,l.cp1,l.cp2,l.p2,1);let x=nA(r,l.p1.x,l.p1.y,!0);nz(e,{x:l.p1.x,y:l.p1.y,angleRad:g,pathMidPx:r,opacity:u,density:d},a,"start",x,f)}return(0,tJ.rQ)(t,n),!0}function nT(e,t,n){e.last=t,e.prev=null,e.stampAngle=null,e.lastInkWorld={x:n.point.x,y:n.point.y,z:n.point.z}}function nB(e,t){let n=e.material;n.map=t,n.transparent=!0,n.opacity=1,n.alphaTest=.02,n.depthWrite=!1,n.side=eg.$EB,n.needsUpdate=!0}function nF(e){e.colorSpace=eg.er$,e.premultiplyAlpha=!1,e.generateMipmaps=!1,e.minFilter=eg.k6q,e.magFilter=eg.k6q,e.needsUpdate=!0}function nW(e,t){let n=document.createElement("canvas");n.width=e,n.height=t;let r=n.getContext("2d",{alpha:!0,desynchronized:!0});return r?(r.clearRect(0,0,e,t),{inkCanvas:n,inkContext:r}):null}function nO(e,t,n){let r=nW(t,n);if(!r)return null;r.inkContext.drawImage(e.inkCanvas,0,0,t,n),e.texture.dispose();let i=new eg.GOR(r.inkCanvas);return nF(i),{...r,texture:i,width:t,height:n}}class nY{bringInkLayersToFront(e,t){let n=(0,tM.En)();if("overlay"===e){this.overlayInkStackGen+=2;let e=1e4+this.overlayInkStackGen,t=e-1;this.overlayMesh&&(this.overlayMesh.renderOrder=n?t:e),this.overlayYellowMesh&&(this.overlayYellowMesh.renderOrder=n?e:t);return}if("ground"===e){this.groundInkStackGen+=2;let e=5e3+this.groundInkStackGen,t=e-1;this.groundMesh&&(this.groundMesh.renderOrder=n?t:e),this.groundYellowMesh&&(this.groundYellowMesh.renderOrder=n?e:t);return}if("ball"===e&&null!=t){var r;let e=(null!=(r=this.ballInkStackGen.get(t))?r:0)+2;this.ballInkStackGen.set(t,e);let i=5002+e,a=i-1,o=this.ballInkLayers.get(t);if(!o)return;o.overlayMesh.renderOrder=n?a:i,o.yellowOverlayMesh.renderOrder=n?i:a}}usingYellowInkLayer(){return(0,tM.En)()}activeOverlayInkLayer(){return(this.ensureOverlayLayer(),this.usingYellowInkLayer())?this.ensureOverlayYellowLayer():this.overlayLayer}activeGroundInkLayer(){return this.ensureGroundLayer()?this.usingYellowInkLayer()?this.ensureGroundYellowLayer():this.groundLayer:null}activeBallInkLayer(e){let t=this.ballInkLayers.get(e);return t?this.usingYellowInkLayer()?{inkCanvas:t.yellowInkCanvas,inkContext:t.yellowInkContext,texture:t.yellowTexture,width:t.width,height:t.height,overlayMesh:t.yellowOverlayMesh}:t:null}ballYellowSnapshotLayer(e){return{inkCanvas:e.yellowInkCanvas,inkContext:e.yellowInkContext,texture:e.yellowTexture,width:e.width,height:e.height}}setInkColor(e){this.inkColor=e}syncSiteInvertPresentation(e){let t=(0,tM.En)(),n=(0,tM.d1)();if(this.siteInvertedActive!==t)this.siteInvertedActive=t,t?(this.overlayDrips=t3(),this.groundDrips=t3(),this.ballDrips.clear(),this.extendInvertDripSession()):this.clearAllDripStates();else if(!t){let e=(0,tM.mS)();this.inkColor!==e&&this.setInkColor(e),this.syncInkMaterialInvert();return}if(this.setInkColor(n),this.syncInkMaterialInvert(),this.ensureOverlayYellowLayer(),this.ensureGroundYellowLayer(),!t)return;let r=this.inkDripsScrollPaused,i=this.invertDripTiming(),a=!1,o=this.overlayYellowLayer;o&&(a=ni(this.overlayDrips,o.inkContext,o.width,o.height,n,e,i,r)||a);let l=this.groundYellowLayer;for(let[t,o]of(l&&(a=ni(this.groundDrips,l.inkContext,l.width,l.height,n,e,i,r)||a),this.ballInkLayers)){let l=this.ballDrips.get(t);l||(l=t3(),this.ballDrips.set(t,l)),a=ni(l,o.yellowInkContext,o.width,o.height,n,e,i,r)||a}
1a&&(this.markInkTexturePending(),this.inkCanvasDirty=!0)}notifyDwellInkDripAtAnchor(e,t,n,r,i,a){if(!(0,tM.En)()||this.inkDripsScrollPaused)return;this.extendInvertDripSession();let o=this.invertDripTiming(),l=!1;if("overlay"===t&&this.overlayYellowLayer){let t=this.overlayDrips.drips.length;nr(this.overlayDrips,this.overlayYellowLayer.inkContext,this.overlayYellowLayer.width,this.overlayYellowLayer.height,o,e.overlayYellow),nn(this.overlayDrips,o,r,i,a)?l=!0:this.overlayDrips.drips.length>t&&(l=!0)}else if("ground"===t&&this.groundYellowLayer){let t=this.groundDrips.drips.length;nr(this.groundDrips,this.groundYellowLayer.inkContext,this.groundYellowLayer.width,this.groundYellowLayer.height,o,e.groundYellow),nn(this.groundDrips,o,r,i,a)?l=!0:this.groundDrips.drips.length>t&&(l=!0)}else if("ball"===t&&null!=n){var s;let t=this.ballInkLayers.get(n);if(!t)return;let c=this.ballDrips.get(n);c||(c=t3(),this.ballDrips.set(n,c));let d=null!=(s=e.ballsYellow.get(n))?s:null,u=c.drips.length;nr(c,t.yellowInkContext,t.width,t.height,o,d),nn(c,o,r,i,a)?l=!0:c.drips.length>u&&(l=!0)}l&&(this.markInkTexturePending(),this.inkCanvasDirty=!0)}notifyInvertDripAfterDrawing(e){if(!(0,tM.En)()||this.inkDripsScrollPaused)return;this.extendInvertDripSession();let t=this.invertDripTiming(),n=!1;if(this.overlayYellowLayer){let r=this.overlayDrips.drips.length;nr(this.overlayDrips,this.overlayYellowLayer.inkContext,this.overlayYellowLayer.width,this.overlayYellowLayer.height,t,e.overlayYellow),this.overlayDrips.drips.length>r&&(n=!0)}if(this.groundYellowLayer){let r=this.groundDrips.drips.length;nr(this.groundDrips,this.groundYellowLayer.inkContext,this.groundYellowLayer.width,this.groundYellowLayer.height,t,e.groundYellow),this.groundDrips.drips.length>r&&(n=!0)}for(let[i,a]of this.ballInkLayers){var r;let o=null!=(r=e.ballsYellow.get(i))?r:null,l=this.ballDrips.get(i);l||(l=t3(),this.ballDrips.set(i,l));let s=l.drips.length;nr(l,a.yellowInkContext,a.width,a.height,t,o),l.drips.length!==s&&(n=!0)}n&&(this.markInkTexturePending(),this.inkCanvasDirty=!0)}extendInvertDripSession(){let e=performance.now()/1e3;this.invertDripDeadlineSec=Math.max(this.invertDripDeadlineSec,e+10)}invertDripTiming(){return{nowSec:performance.now()/1e3,deadlineSec:this.invertDripDeadlineSec}}clearAllDripStates(){this.invertDripDeadlineSec=0,this.overlayDrips=t3(),this.groundDrips=t3(),this.ballDrips.clear()}stopActiveDripAnimations(){for(let e of(t4(this.overlayDrips),t4(this.groundDrips),this.ballDrips.values()))t4(e)}isInkDripsScrollPaused(){return this.inkDripsScrollPaused}syncInkMaterialInvert(){let e=(0,tM.Yt)();if(this.yellowInkMaterialInvertActive!==e)for(let t of(this.yellowInkMaterialInvertActive=e,nm(this.overlayYellowMesh,e),nm(this.groundYellowMesh,e),this.ballInkLayers.values()))nm(t.yellowOverlayMesh,e);for(let e of(nm(this.overlayMesh,!1),nm(this.groundMesh,!1),this.ballInkLayers.values()))nm(e.overlayMesh,!1)}createGroundPlane(e,t){let n=null!=this.groundMesh&&(this.groundWorldHalfW!==e||this.groundWorldHalfH!==t);if(this.groundWorldHalfW=e,this.groundWorldHalfH=t,n&&(this.groundResized=!0),this.groundMesh)return this.groundMesh.geometry.dispose(),this.groundMesh.geometry=new eg.bdM(2*e,2*t),this.groundMesh.position.z=no.groundZ,this.groundYellowMesh&&(this.groundYellowMesh.geometry.dispose(),this.groundYellowMesh.geometry=this.groundMesh.geometry.clone(),this.groundYellowMesh.position.copy(this.groundMesh.position)),this.groundMesh;let r=new eg.V9B({transparent:!0,opacity:0,depthWrite:!1}),i=new eg.eaF(new eg.bdM(2*e,2*t),r);return i.position.set(0,0,no.groundZ),i.name="marker-ground",i.frustumCulled=!1,i.renderOrder=5e3,this.scene.add(i),this.groundMesh=i,i}registerBallMeshes(e,t,n){if(this.ballMeshes.set(e,t),this.ballAttachGroups.set(e,n),this.ballDrawTargetsCache=null,t.length>0){var r,i;let a=null!=(i=null==(r=t.find(e=>e.geometry))?void 0:r.geometry)?i:null;a&&this.ensureBallInkLayer(e,a,n)}}registerBallInkSurface(e,t,n){this.ballSharedGeometry=n,this.ballAttachGroups.set(e,t),this.ballDrawTargetsCache=null,this.ensureBallInkLayer(e,n,t)}registerBallInstancer(e,t){this.ballInstancer=e,this.ballInstanceUidResolver=t,this.ballDrawTargetsCache=null}unregisterBall(e){this.ballMeshes.delete(e),this.ballAttachGroups.delete(e),this.ballDrawTargetsCache=null,this.ballDrips.delete(e);let t=this.ballInkLayers.get(e);t&&(t.overlayMesh.removeFromParent(),t.yellowOverlayMesh.removeFromParent(),t.overlayMesh.material.dispose(),t.yellowOverlayMesh.material.dispose(),t.texture.dispose(),t.yellowTexture.dispose(),this.ballInkLayers.delete(e))}syncBallInkOverlayMatrices(){for(let[e,t]of this.ballInkLayers){let n=this.ballAttachGroups.get(e);if(!n)continue;let r=!0;for(let e=n;e;e=e.parent)if(!e.visible){r=!1;break}n.updateMatrixWorld(!0),t.overlayMesh.visible=r,t.overlayMesh.matrix.copy(n.matrixWorld),t.yellowOverlayMesh.visible=r,t.yellowOverlayMesh.matrix.copy(n.matrixWorld)}}collectBallDrawTargets(){if(this.ballDrawTargetsCache)return this.ballDrawTargetsCache;let e=[];for(let[t,n]of(this.ballInstancer&&e.push(this.ballInstancer),this.ballMeshes))for(let r of n)r.userData.markerBallUid=t,e.push(r);for(let t of this.ballInkLayers.values())e.push(t.overlayMesh);return this.ballDrawTargetsCache=e,e}ballUidFromIntersection(e){if(e.object instanceof eg.ZLX&&null!=e.instanceId){var t,n;return null!=(n=null==(t=this.ballInstanceUidResolver)?void 0:t.call(this,e.instanceId))?n:null}let r=e.object.userData.markerBallUid;if(null!=r)return r;for(let t of this.ballInkLayers.values())if(t.overlayMesh===e.object)return t.uid;return null}worldNormalFromIntersection(e){if(!e.face)return new eg.Pq0(0,0,1);let t=e.face.normal.clone();return e.object instanceof eg.ZLX&&null!=e.instanceId?(e.object.getMatrixAt(e.instanceId,this.ballInstanceMatrix),t.transformDirection(this.ballInstanceMatrix).normalize()):t.transformDirection(e.object.matrixWorld).normalize()}pickBallIntersection(e,t){let{requireUv:n=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.collectBallDrawTargets();if(0===r.length)return null;for(let i of(this.raycaster.setFromCamera(this.ndcFromClient(e,t),this.camera),this.raycaster.intersectObjects(r,!1)))if(i.face&&(i.object instanceof eg.eaF||i.object instanceof eg.ZLX)&&(!n||i.uv)&&null!=this.ballUidFromIntersection(i))return i;return null}raycastBallDrawFromClient(e,t){var n,r;let i=this.pickBallIntersection(e,t,{requireUv:!0});if(!(null==i?void 0:i.uv))return null;let a=this.ballUidFromIntersection(i);if(null==a)return null;let o=null!=(r=null==(n=this.ballInkLayers.get(a))?void 0:n.overlayMesh)?r:i.object instanceof eg.eaF?i.object:null;return o?this.hitFromIntersection(i,"ball",o,a):null}ensureBallInkLayer(e,t,n){let r=this.ballInkLayers.get(e);if(r)return r;let i=nW(1024,1024),a=nW(1024,1024);if(!i||!a)return null;let o=new eg.GOR(i.inkCanvas);nF(o);let l=new eg.GOR(a.inkCanvas);nF(l);let s=new eg.V9B({map:o,transparent:!0,opacity:1,alphaTest:.02,depthWrite:!1,depthTest:!0,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-8}),c=new eg.eaF(t,s);c.name="marker-ball-ink-".concat(e),c.matrixAutoUpdate=!1,c.renderOrder=5002,c.frustumCulled=!1,this.scene.add(c),e6(c);let d=function(e){let t=new eg.uSd({map:e,color:0xffffff,transparent:!0,opacity:1,alphaTest:.02,depthWrite:!1,depthTest:!0,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-8});return tq(t,tH),t.needsUpdate=!0,t}(l),u=new eg.eaF(t,d);
1u.name="marker-ball-ink-yellow-".concat(e),u.matrixAutoUpdate=!1,u.renderOrder=5003,u.frustumCulled=!1,u.receiveShadow=!0,this.scene.add(u),e6(u),th(u),this.ballDrawTargetsCache=null;let h={...i,texture:o,overlayMesh:c,uid:e,width:1024,height:1024,yellowInkCanvas:a.inkCanvas,yellowInkContext:a.inkContext,yellowTexture:l,yellowOverlayMesh:u};this.ballInkLayers.set(e,h),nm(c,!1),nm(u,(0,tM.Yt)());let p=this.ballAttachGroups.get(e);return p&&(p.updateMatrixWorld(!0),c.matrix.copy(p.matrixWorld),u.matrix.copy(p.matrixWorld)),h}registerDrawOccluder(e){this.drawOccluders.set(e.uuid,e)}ensureOverlayMesh(){if(this.overlayMesh)return this.overlayMesh;let e=new eg.V9B({transparent:!0,opacity:1,depthWrite:!1,depthTest:!1}),t=new eg.eaF(new eg.bdM(1,1),e);return t.name="marker-viewport-overlay",t.frustumCulled=!1,t.renderOrder=1e4,this.overlayMesh=t,t}ensureOverlayLayer(){let e=this.overlayMesh;if(!e)return null;let{width:t,height:n}=e2(this.canvasEl),r=this.overlayLayer;if(r&&r.width===t&&r.height===n)return r;if(r){this.overlayResized=!0,this.clearInkUndoHistory();let i=nO(r,t,n);if(!i)return null;let a=e.material;if(a.map=i.texture,a.needsUpdate=!0,this.overlayLayer=i,this.overlayYellowLayer){let e=nO(this.overlayYellowLayer,t,n);if(e&&this.overlayYellowMesh){let t=this.overlayYellowMesh.material;t.map=e.texture,t.needsUpdate=!0,this.overlayYellowLayer=e}}return i}let i=nW(t,n);if(!i)return null;let a=new eg.GOR(i.inkCanvas);nF(a);let o=e.material;return o.map=a,o.needsUpdate=!0,this.overlayLayer={...i,texture:a,width:t,height:n},this.overlayLayer}ensureOverlayYellowMesh(){if(this.overlayYellowMesh)return this.overlayYellowMesh;let e=new eg.V9B({transparent:!0,opacity:1,depthWrite:!1,depthTest:!1}),t=new eg.eaF(new eg.bdM(1,1),e);return t.name="marker-viewport-overlay-yellow",t.frustumCulled=!1,t.renderOrder=10001,this.overlayYellowMesh=t,t.parent!==this.camera&&this.camera.add(t),t}ensureOverlayYellowLayer(){let e=this.ensureOverlayYellowMesh(),{width:t,height:n}=e2(this.canvasEl),r=this.overlayYellowLayer;if(r&&r.width===t&&r.height===n)return r;if(r){this.overlayResized=!0,this.clearInkUndoHistory();let i=nO(r,t,n);if(!i)return null;let a=e.material;return a.map=i.texture,a.needsUpdate=!0,this.overlayYellowLayer=i,i}let i=nW(t,n);if(!i)return null;let a=new eg.GOR(i.inkCanvas);nF(a);let o=e.material;return o.map=a,o.needsUpdate=!0,nm(e,(0,tM.Yt)()),this.overlayYellowLayer={...i,texture:a,width:t,height:n},this.overlayYellowLayer}ensureGroundLayer(){if(!this.groundMesh)return null;if(this.resizeGroundLayerIfNeeded(),this.groundLayer)return this.groundLayer;let{width:e,height:t}=e2(this.canvasEl),n=nW(e,t);if(!n)return null;let r=function(e,t,n){let{data:r}=e.getImageData(0,0,t,n),i=new Uint8ClampedArray(t*n);for(let e=0,t=0;e<r.length;e+=4,t++)i[t]=r[e+3];return i}(n.inkContext,e,t),i=new eg.GOR(n.inkCanvas);return nF(i),nB(this.groundMesh,i),this.groundLayer={...n,texture:i,mesh:this.groundMesh,width:e,height:t,groundBaseAlpha:r},this.groundScrollY=window.scrollY,this.groundScrollRemainderPx=0,this.groundLayer}ensureGroundYellowMesh(){if(!this.groundMesh)return null;if(this.groundYellowMesh)return this.groundYellowMesh.position.copy(this.groundMesh.position),this.groundYellowMesh;let e=new eg.V9B({transparent:!0,opacity:1,alphaTest:.02,depthWrite:!1,side:eg.$EB}),t=new eg.eaF(this.groundMesh.geometry,e);return t.position.copy(this.groundMesh.position),t.name="marker-ground-yellow",t.frustumCulled=!1,t.renderOrder=5001,this.scene.add(t),this.groundYellowMesh=t,t}ensureGroundYellowLayer(){if(!this.ensureGroundLayer())return null;let e=this.ensureGroundYellowMesh();if(!e)return null;let{width:t,height:n}=e2(this.canvasEl),r=this.groundYellowLayer;if(r&&r.width===t&&r.height===n)return r;if(r){this.groundResized=!0,this.clearInkUndoHistory();let i=nO(r,t,n);return i?(nB(e,i.texture),nm(e,(0,tM.Yt)()),this.groundYellowLayer=i,i):null}let i=nW(t,n);if(!i)return null;let a=new eg.GOR(i.inkCanvas);return nF(a),nB(e,a),nm(e,(0,tM.Yt)()),this.groundYellowLayer={...i,texture:a,width:t,height:n},this.groundYellowLayer}resizeGroundLayerIfNeeded(){if(!this.groundLayer)return;let{width:e,height:t}=e2(this.canvasEl);if(e===this.groundLayer.width&&t===this.groundLayer.height)return;let n=this.groundLayer;this.groundResized=!0,this.clearInkUndoHistory();let r=nO(n,e,t);if(r&&this.groundMesh&&(nB(this.groundMesh,r.texture),this.groundLayer={...r,mesh:this.groundMesh,groundBaseAlpha:function(e,t,n,r,i){let a=new Uint8ClampedArray(r*i);for(let o=0;o<i;o++)for(let l=0;l<r;l++){let s=Math.min(t-1,Math.floor(l/r*t)),c=Math.min(n-1,Math.floor(o/i*n));a[o*r+l]=e[c*t+s]}return a}(n.groundBaseAlpha,n.width,n.height,e,t)},this.groundScrollY=window.scrollY,this.groundScrollRemainderPx=0,this.groundYellowLayer)){let n=nO(this.groundYellowLayer,e,t);n&&this.groundYellowMesh&&(nB(this.groundYellowMesh,n.texture),this.groundYellowLayer=n)}}syncGroundScroll(e){let t=this.groundLayer;if(!t)return this.groundScrollY=e,this.groundScrollRemainderPx=0,!1;let n=e-this.groundScrollY;if(.01>Math.abs(n))return this.inkDripsScrollPaused=!1,!1;this.stopActiveDripAnimations(),this.inkDripsScrollPaused=!0;let r=this.canvasEl.getBoundingClientRect(),i=n*(r.height>0?t.height/r.height:1)+this.groundScrollRemainderPx,a=i>0?Math.floor(i):i<0?Math.ceil(i):0;return this.groundScrollRemainderPx=i-a,0!==a&&(tQ(t.inkCanvas,t.inkContext,a),this.groundYellowLayer&&(tQ(this.groundYellowLayer.inkCanvas,this.groundYellowLayer.inkContext,a),this.groundYellowLayer.texture.needsUpdate=!0)),t.texture.needsUpdate=!0,this.inkCanvasDirty=!0,this.groundScrollY=e,!0}syncGroundCanvas(e){this.resizeGroundLayerIfNeeded();let t=null!=e?e:window.scrollY;return this.syncGroundScroll(t)}syncViewportOverlay(){e5(this.ensureOverlayMesh(),this.camera),this.ensureOverlayLayer(),e5(this.ensureOverlayYellowMesh(),this.camera),this.ensureOverlayYellowLayer()}consumeOverlayResize(){return!!this.overlayResized&&(this.overlayResized=!1,!0)}consumeGroundResize(){return!!this.groundResized&&(this.groundResized=!1,!0)}
1captureInkUndoSnapshot(){this.ensureOverlayLayer(),this.ensureOverlayYellowLayer(),this.ensureGroundLayer(),this.ensureGroundYellowLayer();let e=new Map,t=new Map;for(let[n,r]of this.ballInkLayers){let i=this.captureLayerSnapshot(r);i&&e.set(n,i);let a=this.captureLayerSnapshot(this.ballYellowSnapshotLayer(r));a&&t.set(n,a)}return{overlay:this.captureLayerSnapshot(this.overlayLayer),overlayYellow:this.captureLayerSnapshot(this.overlayYellowLayer),ground:this.captureLayerSnapshot(this.groundLayer),groundYellow:this.captureLayerSnapshot(this.groundYellowLayer),balls:e,ballsYellow:t}}commitInkUndoSnapshot(e){this.inkUndoStack.push(e),this.inkUndoStack.length>48&&this.inkUndoStack.shift()}undoLastInkStroke(){if(0===this.inkUndoStack.length)return!1;let e=this.inkUndoStack.pop();return this.restoreInkUndoSnapshot(e),!0}clearInkUndoHistory(){this.inkUndoStack.length=0}captureLayerSnapshot(e){return e?e.inkContext.getImageData(0,0,e.width,e.height):null}restoreLayerSnapshot(e,t){e&&t&&t.width===e.width&&t.height===e.height&&(e.inkContext.putImageData(t,0,0),e.texture.needsUpdate=!0,this.inkCanvasDirty=!0)}restoreInkUndoSnapshot(e){for(let[r,i]of(this.restoreLayerSnapshot(this.overlayLayer,e.overlay),this.restoreLayerSnapshot(this.overlayYellowLayer,e.overlayYellow),this.restoreLayerSnapshot(this.groundLayer,e.ground),this.restoreLayerSnapshot(this.groundYellowLayer,e.groundYellow),this.ballInkLayers)){var t,n;this.restoreLayerSnapshot(i,null!=(t=e.balls.get(r))?t:null),this.restoreLayerSnapshot(this.ballYellowSnapshotLayer(i),null!=(n=e.ballsYellow.get(r))?n:null)}}ndcFromClient(e,t){let n=this.canvasEl.getBoundingClientRect();return this.pointerNdc.set((e-n.left)/n.width*2-1,-(2*((t-n.top)/n.height))+1),this.pointerNdc}intersectMeshes(e,t,n){var r;return 0===e.length?null:(this.raycaster.setFromCamera(this.ndcFromClient(t,n),this.camera),null!=(r=this.raycaster.intersectObjects(e,!1).find(e=>!!e.face&&(e.object instanceof eg.eaF||e.object instanceof eg.ZLX)))?r:null)}raycastPenGroundFromClient(e,t){if(!this.groundMesh)return null;let n=this.intersectMeshes([this.groundMesh],e,t);if(!n)return null;let r=n.face?n.face.normal.clone().transformDirection(this.groundMesh.matrixWorld).normalize():new eg.Pq0(0,0,1);return{mesh:this.groundMesh,point:n.point.clone(),normal:r}}raycastPenOverlayFromClient(e,t){this.syncViewportOverlay();let n=this.overlayMesh;if(!n)return null;let r=this.intersectMeshes([n],e,t);if(!r)return null;let i=r.face?r.face.normal.clone().transformDirection(n.matrixWorld).normalize():new eg.Pq0(0,0,1);return{mesh:n,point:r.point.clone(),normal:i}}raycastPenFromClient(e,t){let n=this.pickBallIntersection(e,t);if(n){var r;let e=null!=(r=this.ballUidFromIntersection(n))?r:void 0,t=this.worldNormalFromIntersection(n);return{mesh:n.object,point:n.point.clone(),normal:t,ballUid:e}}return this.raycastPenGroundFromClient(e,t)}raycastGroundFromClient(e,t){if(this.syncGroundCanvas(),!this.groundMesh)return null;let n=this.intersectMeshes([this.groundMesh],e,t);return(null==n?void 0:n.uv)?this.hitFromIntersection(n,"ground",this.groundMesh):null}raycastDrawFromClient(e,t){let n=this.raycastBallDrawFromClient(e,t);if(n)return n;if(this.syncGroundCanvas(),!this.groundMesh)return null;let r=this.intersectMeshes([this.groundMesh],e,t);return(null==r?void 0:r.uv)?this.hitFromIntersection(r,"ground",this.groundMesh):null}raycastDragFromClient(e,t){let n=this.raycastBallDrawFromClient(e,t);if(n)return{penHit:{mesh:n.mesh,point:n.point,normal:n.normal,ballUid:n.ballUid},drawHit:n};let r=this.raycastPenGroundFromClient(e,t);if(this.syncGroundCanvas(),!this.groundMesh)return{penHit:r,drawHit:null};let i=this.intersectMeshes([this.groundMesh],e,t);return{penHit:r,drawHit:(null==i?void 0:i.uv)!=null?this.hitFromIntersection(i,"ground",this.groundMesh):null}}raycastFromClient(e,t){let n=this.raycastPenFromClient(e,t);return n?{surface:"overlay",mesh:n.mesh,uv:new eg.I9Y(.5,.5),point:n.point,normal:n.normal}:null}raycastOverlayDrawFromClient(e,t){this.syncViewportOverlay();let n=this.overlayMesh;if(!n)return null;let r=this.intersectMeshes([n],e,t);return(null==r?void 0:r.uv)?this.hitFromIntersection(r,"overlay",n):null}hitFromIntersection(e,t,n,r){let i=this.worldNormalFromIntersection(e);return{surface:t,mesh:n,uv:e.uv.clone(),point:e.point.clone(),normal:i,ballUid:r}}getPointerPlaneHit(e,t,n,r){let i=this.canvasEl.getBoundingClientRect();if(i.width<=0||i.height<=0)return null;this.pointerNdc.set((e-i.left)/i.width*2-1,-(2*((t-i.top)/i.height))+1),this.raycaster.setFromCamera(this.pointerNdc,this.camera);let a=new eg.Zcv().setFromNormalAndCoplanarPoint(r.clone().normalize(),n),o=new eg.Pq0,l=this.raycaster.ray.intersectPlane(a,o);return l?l.clone():null}uvToCanvasPoint(e,t){return{x:e.x*t.width,y:(1-e.y)*t.height}}drawPoint(e,t,n){return"ground"===e.surface?function(e,t,n,r,i){let a=i.getBoundingClientRect();return a.width<=0||a.height<=0?{x:0,y:0}:{x:(e-a.left)/a.width*n,y:(t-a.top)/a.height*r}}(n.clientX,n.clientY,t.width,t.height,this.canvasEl):function(e,t,n,r,i){let a=i.getBoundingClientRect();return a.width<=0||a.height<=0?{x:0,y:0}:{x:(e-a.left)/a.width*n,y:(t-a.top)/a.height*r}}(n.clientX,n.clientY,t.width,t.height,this.canvasEl)}canvasPointFromCursor(e,t,n){return"ball"===e.surface?this.uvToCanvasPoint(e.uv,t):this.drawPoint(e,t,n)}seedStrokeAnchorAtClient(e,t,n){let r=this.raycastDrawFromClient(e,t);if(!r)return null;let i={clientX:e,clientY:t};if("ball"===r.surface){var a,o,l,s;if(null==r.ballUid)return null;let e=this.ballAttachGroups.get(r.ballUid),t=null!=(s=null!=(l=this.ballSharedGeometry)?l:null==(o=this.ballMeshes.get(r.ballUid))||null==(a=o.find(e=>e.geometry))?void 0:a.geometry)?s:null;if(!e||!t)return null;
1let c=this.ensureBallInkLayer(r.ballUid,t,e);return c?(nT(n,this.canvasPointFromCursor(r,c,i),r),n.inkSpeedEased=0,this.bringInkLayersToFront("ball",r.ballUid),{surface:"ball",ballUid:r.ballUid}):null}if("ground"===r.surface){let e=this.ensureGroundLayer();return e?(n.last=this.canvasPointFromCursor(r,e,i),n.prev=null,n.stampAngle=null,n.lastInkWorld=void 0,n.inkSpeedEased=0,this.bringInkLayersToFront("ground",null),{surface:"ground"}):null}let c=this.ensureOverlayLayer();return c?(n.last=this.canvasPointFromCursor(r,c,i),n.prev=null,n.stampAngle=null,n.lastInkWorld=void 0,n.inkSpeedEased=0,this.bringInkLayersToFront("overlay",null),{surface:"overlay"}):null}drawMarkerDwellAtAnchor(e,t,n){if(!e||!n.last)return 0;if("ball"===e){if(null==t)return 0;let e=this.activeBallInkLayer(t);if(!e)return 0;nL(e.inkContext,this.inkColor);let r=nP(e.inkContext,n,n.last.x,n.last.y,this.inkColor);return this.markInkTexturePending(),r}if("ground"===e){let e=this.activeGroundInkLayer(),t=this.groundLayer;if(!e||!t)return 0;let r=n.last;if(!t0(t.groundBaseAlpha,e.width,r.x,r.y))return 0;nL(e.inkContext,this.inkColor);let i=nP(e.inkContext,n,r.x,r.y,this.inkColor);return this.markInkTexturePending(),i}let r=this.activeOverlayInkLayer();if(!r)return 0;nL(r.inkContext,this.inkColor);let i=nP(r.inkContext,n,n.last.x,n.last.y,this.inkColor);return this.markInkTexturePending(),i}finalizeStrokeEndCap(e,t,n){var r,i,a;let o=e.last,l=e.lastTangentRad;if(!o||null==l)return;let s=null!=(r=e.inkPathPx)?r:0;if(s<=0)return;let c=null!=(i=e.inkOpacityEased)?i:tw.strokeOpacityMax,d=nM(null!=(a=e.inkSpeedEased)?a:0),u=null;if("ball"===t){if(null==n)return;u=this.activeBallInkLayer(n)}else if("ground"===t){let e=this.groundLayer;if((u=this.activeGroundInkLayer())&&e&&!t0(e.groundBaseAlpha,u.width,o.x,o.y))return}else u=this.activeOverlayInkLayer();if(!u)return;nL(u.inkContext,this.inkColor);let h=nA(s,o.x,o.y,!0),p=function(e,t){if(tD(e)&&t.yellowLineInstance)return tU(t.yellowLineInstance,nR())}(this.inkColor,e);nz(u.inkContext,{x:o.x,y:o.y,angleRad:l,pathMidPx:s,opacity:c,density:d},this.inkColor,"end",h,p),this.markInkTexturePending()}drawStreakAtHit(e,t,n,r,i,a,o){if(!o)return n;let l=this.raycastDrawFromClient(o.clientX,o.clientY);if(!l)return n;let s="ball"!==(e=l).surface||null!=e.ballUid&&e.ballUid===r,c=n===e.surface&&s;if("ball"===e.surface){var d,u,h,p;if(null==e.ballUid)return n;let r=this.ballAttachGroups.get(e.ballUid),l=null!=(p=null!=(h=this.ballSharedGeometry)?h:null==(u=this.ballMeshes.get(e.ballUid))||null==(d=u.find(e=>e.geometry))?void 0:d.geometry)?p:null;if(!r||!l)return n;this.ensureBallInkLayer(e.ballUid,l,r);let s=this.activeBallInkLayer(e.ballUid);return s?this.drawStreakOnLayer(e,s,t,n,c,i,a,o):n}if("ground"===e.surface){let r=this.activeGroundInkLayer();return r?this.drawStreakOnLayer(e,r,t,n,c,i,a,o):n}let m=this.activeOverlayInkLayer();return m?this.drawStreakOnLayer(e,m,t,n,c,i,a,o):n}consumeInkCanvasDirty(){let e=this.inkCanvasDirty;return this.inkCanvasDirty=!1,e}flushInkTextures(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.inkTexturesPending&&(this.inkFlushFrame++,e||this.inkFlushFrame%2==0))for(let e of(this.inkTexturesPending=!1,this.overlayLayer&&(this.overlayLayer.texture.needsUpdate=!0),this.overlayYellowLayer&&(this.overlayYellowLayer.texture.needsUpdate=!0),this.groundLayer&&(this.groundLayer.texture.needsUpdate=!0),this.groundYellowLayer&&(this.groundYellowLayer.texture.needsUpdate=!0),this.ballInkLayers.values()))e.texture.needsUpdate=!0,e.yellowTexture.needsUpdate=!0}markInkTexturePending(){this.inkTexturesPending=!0}drawStreakOnLayer(e,t,n,r,i,a,o,l){let s=this.canvasPointFromCursor(e,t,l);return i&&n.last?(Math.hypot(s.x-n.last.x,s.y-n.last.y)>4096&&(n.prev=null,n.stampAngle=null),"ground"===e.surface&&this.groundLayer&&!t0(this.groundLayer.groundBaseAlpha,t.width,s.x,s.y))?(nL(t.inkContext,this.inkColor),nD(t.inkContext,n,s,1.5,o,this.inkColor,!1)):(nL(t.inkContext,this.inkColor),nD(t.inkContext,n,s,1.5,o,this.inkColor),"ball"===e.surface&&(n.lastInkWorld={x:e.point.x,y:e.point.y,z:e.point.z}),this.markInkTexturePending()):("ball"===e.surface?nT(n,s,e):(n.last=s,n.prev=null,n.stampAngle=null,n.lastInkWorld=void 0),n.inkSpeedEased=o),e.surface}dispose(){var e,t,n,r;for(let i of(this.overlayMesh&&(this.camera.remove(this.overlayMesh),this.overlayMesh.geometry.dispose(),this.overlayMesh.material.dispose(),this.overlayMesh=null),null==(e=this.overlayLayer)||e.texture.dispose(),this.overlayLayer=null,this.overlayYellowMesh&&(this.camera.remove(this.overlayYellowMesh),this.overlayYellowMesh.geometry.dispose(),this.overlayYellowMesh.material.dispose(),this.overlayYellowMesh=null),null==(t=this.overlayYellowLayer)||t.texture.dispose(),this.overlayYellowLayer=null,this.groundMesh&&(this.scene.remove(this.groundMesh),this.groundMesh.geometry.dispose(),this.groundMesh.material.dispose(),this.groundMesh=null),null==(n=this.groundLayer)||n.texture.dispose(),this.groundLayer=null,this.groundYellowMesh&&(this.scene.remove(this.groundYellowMesh),this.groundYellowMesh.geometry.dispose(),this.groundYellowMesh.material.dispose(),this.groundYellowMesh=null),null==(r=this.groundYellowLayer)||r.texture.dispose(),this.groundYellowLayer=null,this.ballInkLayers.values())
1)i.overlayMesh.removeFromParent(),i.yellowOverlayMesh.removeFromParent(),i.overlayMesh.material.dispose(),i.yellowOverlayMesh.material.dispose(),i.texture.dispose(),i.yellowTexture.dispose();this.ballInkLayers.clear(),this.ballMeshes.clear(),this.ballAttachGroups.clear(),this.drawOccluders.clear(),this.clearInkUndoHistory()}constructor(e,t,n){this.raycaster=new eg.tBo,this.pointerNdc=new eg.I9Y,this.overlayMesh=null,this.overlayLayer=null,this.overlayYellowMesh=null,this.overlayYellowLayer=null,this.overlayResized=!1,this.groundMesh=null,this.groundLayer=null,this.groundYellowMesh=null,this.groundYellowLayer=null,this.groundResized=!1,this.groundScrollY=0,this.groundScrollRemainderPx=0,this.groundWorldHalfW=1,this.groundWorldHalfH=1,this.ballMeshes=new Map,this.ballAttachGroups=new Map,this.ballSharedGeometry=null,this.ballInstancer=null,this.ballInstanceUidResolver=null,this.ballInkLayers=new Map,this.ballDrawTargetsCache=null,this.ballInstanceMatrix=new eg.kn4,this.drawOccluders=new Map,this.inkCanvasDirty=!1,this.inkTexturesPending=!1,this.inkFlushFrame=0,this.inkUndoStack=[],this.inkColor=tM.td,this.siteInvertedActive=null,this.invertDripDeadlineSec=0,this.overlayDrips=t3(),this.groundDrips=t3(),this.ballDrips=new Map,this.yellowInkMaterialInvertActive=null,this.inkDripsScrollPaused=!1,this.overlayInkStackGen=0,this.groundInkStackGen=0,this.ballInkStackGen=new Map,this.scene=e,this.camera=t,this.canvasEl=n,t.parent!==e&&e.add(t);let r=this.ensureOverlayMesh();r.parent!==this.camera&&this.camera.add(r)}}let nN={liftAngleBase:eg.cj9.degToRad(32),liftAngleMax:eg.cj9.degToRad(52),liftSpeedFactor:.06,directionLerpSpeed:20,rotationLerpSpeed:48,liftAngleLerpSpeed:26,minTangentMoveWorld:2e-4,surfaceContactOffset:.003};function nG(e,t){e.smoothedLiftAngle=0,e.smoothedWorldQuaternion.copy(t),e.rotationInitialized=!1,e.pickupBlend=1}let nU=new eg.Pq0,nH=new eg.Pq0,nq=new eg.Pq0,nV=new eg.Pq0,nX=new eg.Pq0,n$=new eg.PTz,n_=new eg.Pq0,nZ=new eg.Pq0,nJ=new eg.Pq0(1,0,0),nK=new eg.Pq0(0,-1,0),nQ=Math.PI/4,n0=3*Math.PI/4,n1=(nQ+n0)/2,n2=eg.cj9.degToRad(18),n5=eg.cj9.degToRad(45),n3=eg.cj9.degToRad(54),n4=eg.cj9.degToRad(58);function n6(e,t,n){t.copy(nJ).sub(nH.copy(e).multiplyScalar(nJ.dot(e))),1e-9>=t.lengthSq()&&t.copy(nK).cross(e),t.normalize(),n.crossVectors(t,e).normalize().negate()}function n8(e,t){0>e.dot(t)&&(e.x=-e.x,e.y=-e.y,e.z=-e.z,e.w=-e.w)}function n9(e,t){return(n6(t,n_,nZ),nU.copy(e).sub(nH.copy(t).multiplyScalar(e.dot(t))),1e-9>=nU.lengthSq())?nQ:(nU.normalize(),Math.atan2(nU.dot(nZ),nU.dot(n_)))}function n7(e,t,n,r,i,a){let o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:n5,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:.003,s=arguments.length>8?arguments[8]:void 0;n6(t,n_,nZ),nq.copy(n_).multiplyScalar(Math.cos(n)).addScaledVector(nZ,Math.sin(n)).normalize(),nU.copy(nq).multiplyScalar(Math.cos(o)).addScaledVector(nH.copy(t).normalize(),Math.sin(o)).normalize();let c=i.clone().normalize();if(s){let e=c.clone().applyQuaternion(s).normalize(),t=new eg.PTz().setFromUnitVectors(e,nU);n$.copy(t).multiply(s),n8(n$,s)}else n$.setFromUnitVectors(c,nU);return nV.copy(r).multiplyScalar(a).applyQuaternion(n$),nX.copy(e).addScaledVector(t,l).sub(nV),{worldPosition:nX.clone(),worldQuaternion:n$.clone()}}function re(e,t,n){var r;if(n.copy(e).sub(t.clone().multiplyScalar(e.dot(t))),1e-9>=n.lengthSq())return n.set(1,0,0);n.normalize(),n6(t,n_,nZ),nU.copy(n).sub(nH.copy(t).multiplyScalar(n.dot(t)));let i=nU.length();if(i<=1e-9)return n.copy(n_).multiplyScalar(Math.cos(n1)).addScaledVector(nZ,Math.sin(n1)).normalize();nU.multiplyScalar(1/i);let a=nU.dot(n_),o=(r=Math.atan2(nU.dot(nZ),a))<nQ?nQ+(r-nQ)*.07:r>n0?n0+(r-n0)*.07:r<nQ+n2?nQ+n2*eg.cj9.smootherstep((r-nQ)/n2,0,1):r>n0-n2?n0-n2*eg.cj9.smootherstep((n0-r)/n2,0,1):r;return n.copy(n_).multiplyScalar(Math.cos(o)).addScaledVector(nZ,Math.sin(o)).normalize()}var rt=n(5310);let rn="siteInvertExempt",rr=new WeakMap,ri=new WeakMap,ra="/* site_invert_exempt */",ro="\n".concat(ra,"\ngl_FragColor.rgb = vec3(1.0) - gl_FragColor.rgb;\n");function rl(e,t){e&&e.traverse(e=>{if(e instanceof eg.eaF)for(let n of Array.isArray(e.material)?e.material:[e.material])!function(e,t){(e instanceof eg._4j||e instanceof eg.uSd)&&(!function(e){if(rr.has(e))return;rr.set(e,e.onBeforeCompile),ri.set(e,e.customProgramCacheKey),e.onBeforeCompile=(t,n)=>{var r;null==(r=rr.get(e))||r.call(e,t,n),e.userData[rn]&&function(e){if(e.fragmentShader.includes(ra))return;let t="".concat(ro,"\n");for(let n of["#include <colorspace_fragment>","#include <dithering_fragment>","#include <tonemapping_fragment>","#include <opaque_fragment>"])if(e.fragmentShader.includes(n)){e.fragmentShader=e.fragmentShader.replace(n,t+n);return}}(t)};let t=ri.get(e);e.customProgramCacheKey=function(){var e;let n=null!=(e=null==t?void 0:t.call(this))?e:"";return"".concat(n,"|siteInvExempt:").concat(+!!this.userData[rn])}}(e),e.userData[rn]!==t&&(e.userData[rn]=t,e.needsUpdate=!0))}(n,t)})}let rs=new WeakMap;function rc(e,t){e&&e.traverse(e=>{if(e instanceof eg.eaF)for(let i of Array.isArray(e.material)?e.material:[e.material]){var n,r;n=i,r=t,"Material.002"===n.name&&(n instanceof eg._4j||n instanceof eg.uSd)&&(rs.has(n)||rs.set(n,n.color.clone()),r?n.color.set(tM.d7):n.color.copy(rs.get(n)),n.needsUpdate=!0)}})}let rd=null,ru=null,rh=null,rp=null,rm=!1,rf=null;function rg(){if("undefined"==typeof document)return null;if(rd)return rd;let e=document.createElement("audio");return e.src="/audio/marker.mp3",e.loop=!0,e.preload="auto",Object.assign(e.style,{position:"fixed",width:"0",height:"0",opacity:"0",pointerEvents:"none"}),document.body.appendChild(e),rd=e,e}function rx(){null!=rf&&(clearTimeout(rf),rf=null)}function rv(e,t,n,r){let i=e.currentTime;t.gain.cancelScheduledValues(i),t.gain.setValueAtTime(t.gain.value,i),t.gain.linearRampToValueAtTime(n,i+r)}function ry(){rx(),rm=!1;let e=rd;if(e&&(e.pause(),e.currentTime=0,ru&&rp)){let e=ru.currentTime;rp.gain.cancelScheduledValues(e),rp.gain.setValueAtTime(0,e)}}async function rw(){let e=rg();if(!e)return;let{ctx:t,gain:n}=(ru&&rp||(rh=(ru=new AudioContext).createMediaElementSource(e),rp=ru.createGain(),rh.connect(rp),rp.connect(ru.destination)),{ctx:ru,gain:rp});if("suspended"===t.state)try{await t.resume()}catch(e){return}if(rx(),e.paused&&(e.loop=!0,e.currentTime=function(e){let t=e.duration&&Number.isFinite(e.duration)?e.duration:1.2;return t<=.05?0:Math.random()*t}
1(e)),rv(t,n,1,.1),rm=!0,e.paused)try{await e.play()}catch(e){rm=!1,ry()}}function rb(){var e;null==(e=rg())||e.load()}let rk=!1;function rC(){rk=!1;let e=rd;if(!e||!ru||!rp||!rm&&e.paused)return void ry();rm=!1,rv(ru,rp,0,.1),rx(),rf=window.setTimeout(()=>{if(rf=null,e.pause(),e.currentTime=0,ru&&rp){let e=ru.currentTime;rp.gain.cancelScheduledValues(e),rp.gain.setValueAtTime(0,e)}},130)}let rM="<defs><filter id='cs' x='-70%' y='-70%' width='240%' height='240%' color-interpolation-filters='sRGB'>"+"<feDropShadow dx='0' dy='1' stdDeviation='".concat(3,"' flood-color='%23000000' flood-opacity='0.55'/>")+"</filter></defs>";function rS(e){return"<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'>"+rM+"<g filter='url(%23cs)'>"+e+"</g></svg>"}function rj(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"default";return'url("data:image/svg+xml,'.concat(encodeURIComponent(e),'") ').concat(t," ").concat(n,", ").concat(r)}let rI="/images/usmnt/cap.glb",rA=rj(rS(function(e,t){return"<path d='".concat(e,"' fill='none' stroke='%23ffffff' stroke-width='").concat(4.5,"' stroke-linecap='round'/>")+"<path d='".concat(e,"' fill='none' stroke='%231e1e1e' stroke-width='").concat(2.5,"' stroke-linecap='round'/>")}("M6 6 L18 18 M18 6 L6 18",2.5)),12,12,"pointer");function rP(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;if("undefined"==typeof document)return null;let t=document.querySelector(tv.PR);if(!t)return null;let n=t.getBoundingClientRect();return n.width<=1||n.height<=1?null:{x:n.left+.5*n.width,y:n.top-e-10}}async function rR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rI,n=(await e.loadAsync(t)).scene;tX(n),n.traverse(e=>{e instanceof eg.eaF&&(e.castShadow=!0,e.receiveShadow=!0)});let r=new eg.NRn().setFromObject(n,!0).getSize(new eg.Pq0),i=Math.max(r.x,r.y,r.z,.001);n.scale.setScalar(1/i),n.updateMatrixWorld(!0);let a=new eg.NRn().setFromObject(n,!0).getCenter(new eg.Pq0);n.position.sub(a);let o=new eg.YJl;return o.name="marker-cap",o.add(n),o.visible=!1,o.renderOrder=6e3,o}let rE={amount:1.02,bend:.2,falloff:.83,amplitude:.71,y:.46,x:56},rL={...rE},rz=[{key:"amount",label:"amount",min:0,max:1.5,step:.01},{key:"bend",label:"bend",min:0,max:1,step:.01},{key:"falloff",label:"falloff",min:.15,max:1.5,step:.01},{key:"amplitude",label:"amplitude",min:.05,max:.75,step:.01},{key:"y",label:"y",min:-1,max:1,step:.01},{key:"x",label:"x",min:-90,max:90,step:1}],rD=!1,rT="markerBottleSqueezePatched",rB="/* marker_bottle_squeeze_v6 */",rF=new WeakMap,rW=new Set;function rO(e){return .2+(1-e)*.25}function rY(e,t){e.uAmountMul.value=t.amount,e.uPinchDepth.value=t.amplitude,e.uBulgeBend.value=t.bend,e.uFalloff.value=e.baseFalloff*t.falloff,e.uBarrelMaskInner.value=rO(t.bend),e.uBarrelAxis.value.copy(function(e,t,n){let r=eg.cj9.degToRad(n),i=Math.cos(r),a=Math.sin(r);return e.clone().multiplyScalar(i).addScaledVector(t,a).normalize()}(e.baseBarrelAxis,e.baseBulgeAxis,t.x)),e.uBarrelMaskAxis.value.copy(e.baseBarrelAxis),e.uPinchAxis.value.copy(e.basePinchAxis),e.uBulgeAxis.value.copy(e.baseBulgeAxis),e.pinchAxis.copy(e.basePinchAxis),function(e,t){var n;let r=(n=e.uBarrelHalf.value,t.y*n),i=e.pinchHalf*(.94+.05*t.bend),a=e.center.clone().addScaledVector(e.baseBarrelAxis,r);e.uPinchOrigin.value.copy(a),e.uCenterA.value.copy(a).addScaledVector(e.pinchAxis,i),e.uCenterB.value.copy(a).addScaledVector(e.pinchAxis,-i)}(e,t)}function rN(e){rW.add(e);let t=rF.get(e);t?rY(t,rL):(t=function(e){var t;e.updateMatrixWorld(!0);let n=new eg.NRn().setFromObject(e),r=n.getSize(new eg.Pq0),i=n.getCenter(new eg.Pq0),a=[{axis:new eg.Pq0(1,0,0),len:r.x},{axis:new eg.Pq0(0,1,0),len:r.y},{axis:new eg.Pq0(0,0,1),len:r.z}].sort((e,t)=>t.len-e.len),o=a[0].axis.clone().normalize(),l=a[1].axis.clone().normalize(),s=new eg.Pq0().crossVectors(o,l);1e-4>s.lengthSq()&&s.copy(a[2].axis),s.normalize();let c=.5*a[1].len,d=a[1].len,u=Math.max(.52*c,.04),h=.5*a[0].len,p=rL,m=(t=h,p.y*t),f=i.clone().addScaledVector(o,m),g={uSqueeze:{value:0},uAmountMul:{value:p.amount},uPinchDepth:{value:p.amplitude},uBulgeBend:{value:p.bend},uCenterA:{value:new eg.Pq0},uCenterB:{value:new eg.Pq0},uFalloff:{value:u*p.falloff},baseFalloff:u,uPinchOrigin:{value:f.clone()},uPinchAxis:{value:l.clone()},uBarrelAxis:{value:o.clone()},uBarrelMaskAxis:{value:o.clone()},uBulgeAxis:{value:s.clone()},uBarrelHalf:{value:h},uBarrelMaskInner:{value:rO(p.bend)},pinchHalf:c,pinchDimLen:d,center:i.clone(),baseBarrelAxis:o.clone(),basePinchAxis:l.clone(),baseBulgeAxis:s.clone(),pinchAxis:l.clone()};return rY(g,p),g}(e),rF.set(e,t)),e.traverse(e=>{if(e instanceof eg.eaF)for(let n of Array.isArray(e.material)?e.material:[e.material])(n instanceof eg._4j||n instanceof eg.uSd)&&function(e,t){var n,r;if(e.userData[rT]===t)return;let i=null!=(n=e.userData.markerBottleSqueezeBaseObc)?n:e.onBeforeCompile;e.userData.markerBottleSqueezeBaseObc||(e.userData.markerBottleSqueezeBaseObc=i);let a=null!=(r=e.userData.markerBottleSqueezeBaseKey)?r:e.customProgramCacheKey;e.userData.markerBottleSqueezeBaseKey||(e.userData.markerBottleSqueezeBaseKey=a),e.userData[rT]=t,e.onBeforeCompile=(n,r)=>{null==i||i.call(e,n,r),n.uniforms.uMarkerBottleSqueeze=t.uSqueeze,n.uniforms.uMarkerSqueezeAmountMul=t.uAmountMul,n.uniforms.uMarkerPinchDepth=t.uPinchDepth,n.uniforms.uMarkerBulgeBend=t.uBulgeBend,n.uniforms.uMarkerSqueezeCenterA=t.uCenterA,n.uniforms.uMarkerSqueezeCenterB=t.uCenterB,n.uniforms.uMarkerSqueezeFalloff=t.uFalloff,n.uniforms.uMarkerPinchOrigin=t.uPinchOrigin,n.uniforms.uMarkerPinchAxis=t.uPinchAxis,n.uniforms.uMarkerBarrelAxis=t.uBarrelAxis,n.uniforms.uMarkerBarrelMaskAxis=t.uBarrelMaskAxis,n.uniforms.uMarkerBulgeAxis=t.uBulgeAxis,n.uniforms.uMarkerBarrelHalf=t.uBarrelHalf,n.uniforms.uMarkerBarrelMaskInner=t.uBarrelMaskInner,n.vertexShader.includes(rB)||(n.vertexShader=n.vertexShader.replace("#include <common>","#include <common>\n".concat(rB,"\nuniform float uMarkerBottleSqueeze;\nuniform float uMarkerSqueezeAmountMul;\nuniform float uMarkerPinchDepth;\nuniform float uMarkerBulgeBend;\nuniform vec3 uMarkerSqueezeCenterA;\nuniform vec3 uMarkerSqueezeCenterB;\nuniform float uMarkerSqueezeFalloff;\nuniform vec3 uMarkerPinchOrigin;\nuniform vec3 uMarkerPinchAxis;\nuniform vec3 uMarkerBarrelAxis;\nuniform vec3 uMarkerBarrelMaskAxis;\nuniform vec3 uMarkerBulgeAxis;\nuniform float uMarkerBarrelHalf;\nuniform float uMarkerBarrelMaskInner;")),n.vertexShader=n.vertexShader.replace("#include <begin_vertex>","#include <begin_vertex>\n".concat("\n{\n  vec3 sqPos = transformed;\n  float sqAmt = uMarkerBottleSqueeze;\n  if (sqAmt >
1 0.0001) {\n    vec3 cylinderAxis = normalize(uMarkerBarrelAxis);\n    vec3 maskAxis = normalize(uMarkerBarrelMaskAxis);\n    vec3 pinchAxis = normalize(uMarkerPinchAxis);\n    vec3 bulgeAxis = normalize(uMarkerBulgeAxis);\n    vec3 rel = sqPos - uMarkerPinchOrigin;\n\n    float alongMask = dot(rel, maskAxis);\n    vec3 barrelPart = maskAxis * alongMask;\n    vec3 crossRel = rel - barrelPart;\n\n    // Pinch/bulge always in the fixed cross-section — x only tilts cylinder falloff.\n    float pinchComp = dot(crossRel, pinchAxis);\n    float bulgeComp = dot(crossRel, bulgeAxis);\n\n    // Two infinite cylinders — axis parallel to barrel, anchored on opposite faces.\n    vec3 cA = uMarkerSqueezeCenterA;\n    vec3 cB = uMarkerSqueezeCenterB;\n    vec3 toA = sqPos - cA;\n    vec3 radialA = toA - cylinderAxis * dot(toA, cylinderAxis);\n    vec3 toB = sqPos - cB;\n    vec3 radialB = toB - cylinderAxis * dot(toB, cylinderAxis);\n    float radialA_dist = length(radialA);\n    float radialB_dist = length(radialB);\n\n    float falloff = max(uMarkerSqueezeFalloff, 0.0001);\n    float cylA = exp(-(radialA_dist * radialA_dist) / (falloff * falloff));\n    float cylB = exp(-(radialB_dist * radialB_dist) / (falloff * falloff));\n\n    float onA = smoothstep(-0.008, 0.05, pinchComp);\n    float onB = smoothstep(-0.008, 0.05, -pinchComp);\n    float wA = cylA * onA;\n    float wB = cylB * onB;\n\n    float barrelHalf = max(uMarkerBarrelHalf, 0.0001);\n    float barrelMask = smoothstep(1.0, uMarkerBarrelMaskInner, abs(alongMask) / barrelHalf);\n\n    float press = sqAmt * uMarkerSqueezeAmountMul * uMarkerPinchDepth;\n    float amtA = wA * press * barrelMask;\n    float amtB = wB * press * barrelMask;\n\n    float newPinchComp = pinchComp;\n    if (pinchComp > 0.0) {\n      newPinchComp = pinchComp * max(0.15, 1.0 - amtA);\n    } else if (pinchComp < 0.0) {\n      newPinchComp = pinchComp * max(0.15, 1.0 - amtB);\n    }\n\n    float oldPinch = max(abs(pinchComp), 0.0001);\n    float newPinch = max(abs(newPinchComp), 0.0001);\n    float bulgeScale = mix(\n      1.0,\n      clamp(oldPinch / newPinch, 1.0, 2.5),\n      clamp(uMarkerBulgeBend, 0.0, 1.0)\n    );\n    float newBulgeComp = bulgeComp * bulgeScale;\n\n    vec3 newCross = pinchAxis * newPinchComp + bulgeAxis * newBulgeComp;\n    transformed = uMarkerPinchOrigin + barrelPart + newCross;\n  }\n}\n")))},e.customProgramCacheKey=function(){var e;let t=null!=(e=null==a?void 0:a.call(this))?e:"";return"".concat(t,"|markerBottleSqueeze:v6")},e.needsUpdate=!0}(n,t)})}let rG=new eg.PTz,rU=new eg.Pq0(0,0,1),rH=new eg.PTz().setFromAxisAngle(new eg.Pq0(1,0,0),Math.PI/2),rq=(e,t,n,r)=>{let i=r*Math.tan(n*Math.PI/360);return{halfW:e/t*i,halfH:i}};class rV{getDrawSurfaces(){return this.drawSurfaces}consumeInkCanvasDirty(){return this.drawSurfaces.consumeInkCanvasDirty()}setInkColor(e){this.drawSurfaces.setInkColor(e)}syncInkPresentation(e){this.drawSurfaces.syncGroundCanvas(this.ctx.scrollBase()),this.drawSurfaces.syncSiteInvertPresentation(e);let t=(0,tM.En)();this.siteInvertModelsActive!==t&&(!(this.markers.length>0)||!this.cursorMarkerVisible||this.rollIn||this.rollOut||this.markerVariantSwap?this.markerVariantSwap||(this.siteInvertModelsActive=t,this.applyPenVariant(t),this.applyCapVariant(t),this.refreshMarkerShadowSetup()):this.beginMarkerVariantSwap(t)),this.invertTemplateParts?this.siteInvertPenMaterialsActive&&(this.siteInvertPenMaterialsActive=!1,this.applyPenMaterial002Invert(!1)):this.siteInvertPenMaterialsActive!==(0,tM.RN)()&&(this.siteInvertPenMaterialsActive=(0,tM.RN)(),this.applyPenMaterial002Invert((0,tM.RN)()));let n=(0,tM.RN)()&&null!==this.invertTemplateParts;this.siteInvertExemptActive!==n&&(this.siteInvertExemptActive=n,this.applySiteInvertExempt(n),this.refreshMarkerShadowSetup())}refreshMarkerShadowSetup(){if(this.penShadowCastEnabled){for(let e of this.markers)ti(e.penMesh);for(let e of(this.capGroup&&ta(this.capGroup),[this.capGroupNormal,this.capGroupInvert]))e&&ta(e)}}applySiteInvertExempt(e){for(let t of(this.invertTemplateParts&&rl(this.invertTemplateParts.group,e),this.capGroupInvert&&rl(this.capGroupInvert,e),this.markers))rl(t.penMesh,e)}applyPenMaterial002Invert(e){for(let t of(this.normalTemplateParts&&rc(this.normalTemplateParts.group,e),this.markers))rc(t.penMesh,e)}clonePenFromTemplate(e){let t=e.group.clone(!0);return rN(t),this.penShadowCastEnabled?ti(t):to(t),t}disposePenMesh(e){e.traverse(e=>{if(e instanceof eg.eaF)for(let t of(e.geometry.dispose(),Array.isArray(e.material)?e.material:[e.material]))t.dispose()})}applyPenVariant(e){var t;let n=e&&null!=(t=this.invertTemplateParts)?t:this.normalTemplateParts;if(n)for(let e of(this.templateParts=n,this.markers)){let t=e.penMesh,r=this.clonePenFromTemplate(n);e.meshGroup.remove(t),e.meshGroup.add(r),e.penMesh=r,e.tipAnchorLocal.copy(n.tipAnchorLocal),e.dragAnchorLocal.copy(n.dragAnchorLocal),e.dragAxisLocal.copy(n.dragAxisLocal),this.disposePenMesh(t)}}setPenTemplates(e,t){for(this.normalTemplateParts=e,this.invertTemplateParts=t,to(e.group),to(t.group),this.siteInvertModelsActive=null,this.siteInvertPenMaterialsActive=null,this.siteInvertExemptActive=null,this.applyPenVariant((0,tM.En)()),this.refreshMarkerShadowSetup();this.pendingSpawnCount>0;)this.pendingSpawnCount--,this.spawnAtViewportCenter()}setTemplate(e){this.setPenTemplates(e,e)}mountCapMesh(e){this.penShadowCastEnabled?ta(e):(e6(e),to(e)),e.visible=!1,this.scene.add(e)}setCapMeshes(e,t){for(let e of[this.capGroupNormal,this.capGroupInvert])e&&(this.scene.remove(e),this.disposeCapMesh(e));this.capGroupNormal=e,this.capGroupInvert=t,this.mountCapMesh(e),this.mountCapMesh(t),this.siteInvertModelsActive=null,this.siteInvertExemptActive=null,this.applyCapVariant((0,tM.En)()),this.cursorMarkerVisible&&this.showCap()}applyCapVariant(e){var t,n;let r=e?this.capGroupInvert:this.capGroupNormal,i=e?this.capGroupNormal:this.capGroupInvert;if(!r)return;let a=null!=(n=null==(t=this.capGroup)?void 0:t.visible)&&n,o=this.capReveal,l=this.capReversing;i&&(i.visible=!1),this.capGroup=r,this.capReveal=o,this.capReversing=l,r.visible=a,this.penShadowCastEnabled&&ta(r)}setCapMesh(e){this.setCapMeshes(e,e)}disposeCapMesh(e){e.traverse(e=>{if(e instanceof eg.eaF)for(let t of(e.geometry.dispose(),Array.isArray(e.material)?e.material:[e.material]))t.dispose()})}showCap(){this.capGroup&&(this.capGroup.visible=!0,this.capReveal=0,this.capReversing=!1)}hideCap(){this.capGroup&&(this.capGroup.visible=!1,this.capReveal=0,this.capReversing=!1)}pixelWorldScale(e){return e/window.innerHeight*2*(this.ctx.cameraZ()*Math.tan(this.ctx.cameraFov()*Math.PI/360))}screenToWorldXY(e,t){let n=window.innerWidth,r=window.innerHeight,i=this.ctx.cameraZ()*Math.tan(this.ctx.cameraFov()*Math.PI/360);return new eg.I9Y((e-.5*n)/n*2*(n/r*i),(.5*r-t)/r*2*i)}capRevealEased(){return eg.cj9.smootherstep(this.capReveal,0,1)}syncCapAboveFoil(e){let t=this.capGroup;if(!(null==t?void 0:t.visible)||!rP())return;let n=1-Math.exp(-5.5*e);if(this.capReversing){if(this.capReveal=Math.max(0,this.capReveal-n),this.capReveal<=.001){this.capReveal=0,this.capReversing=!1,this.hideCap();return}}else this.capReveal=Math.min(1,this.capReveal+n);let r=this.capRevealEased(),i=this.markerCapScreenPositionAtReveal(r),a=this.screenToWorldXY(i.x,i.y),o=this.markerInvertScaleMul(),l=2.5*this.pixelWorldScale(54)*o*r;t.position.set(a.x+.6,a.y,.64),t.scale.setScalar(l),t.rotation.set(Math.PI+Math.PI/2,Math.PI/2,0)}beginMarkerVariantSwap(e){this.markerVariantSwap={phase:"out",elapsed:0,targetYellow:e},this.variantSwapZRad=0,this.variantSwapScaleMul=1}finishMarkerVariantSwap(){for(let e of(this.markerVariantSwap=null,this.variantSwapZRad=0,this.variantSwapScaleMul=1,this.markers))e.meshGroup.quaternion.identity()}cancelMarkerVariantSwap(e){this.markerVariantSwap&&(e&&(this.siteInvertModelsActive=this.markerVariantSwap.targetYellow,this.applyPenVariant(this.markerVariantSwap.targetYellow),this.applyCapVariant(this.markerVariantSwap.targetYellow),this.refreshMarkerShadowSetup()),this.finishMarkerVariantSwap())}tickMarkerVariantSwap(e){var t;let n=this.markerVariantSwap;if(!n)return;n.elapsed+=e;let r="out"===n.phase?.1:.25,i=(t=Math.min(1,n.elapsed/r),eg.cj9.smoothstep(eg.cj9.clamp(t,0,1),0,1)),a=2*Math.PI;if("out"===n.phase){this.variantSwapZRad=i*a,this.variantSwapScaleMul=1-i,n.elapsed>=r&&(this.siteInvertModelsActive=n.targetYellow,this.applyPenVariant(n.targetYellow),this.applyCapVariant(n.targetYellow),this.refreshMarkerShadowSetup(),n.phase="in",n.elapsed=0,this.variantSwapZRad=a,this.variantSwapScaleMul=0);return}this.variantSwapZRad=(1-i)*a,this.variantSwapScaleMul=i,n.elapsed>=r&&this.finishMarkerVariantSwap()}isMarkerVariantSwapping(){return null!=this.markerVariantSwap}setPenModelsVisible(e){for(let t of this.markers)t.meshGroup.visible=e}setPenShadowCast(e){for(let t of(this.penShadowCastEnabled=e,this.markers))e?ti(t.penMesh):to(t.penMesh);for(let t of[this.capGroup,this.capGroupNormal,this.capGroupInvert])t&&(e?ta(t):to(t))}isTemplateReady(){return null!=this.templateParts}isDragging(){return this.drag.active}dragHasMoved(){return this.drag.active&&this.drag.moved}hasMarkers(){return this.markers.length>0}isCursorMarkerVisible(){return this.cursorMarkerVisible&&this.hasMarkers()}isMarkerInteractionEnabled(){return this.isCursorMarkerVisible()}
1shouldHideSystemCursor(){return this.isCursorMarkerVisible()&&this.pointerClient.valid&&!this.ctx.disabled()&&!this.markerParked&&!this.rollIn&&!this.rollOut&&!this.capAttractActive}isRollingIn(){return null!=this.rollIn}isRollingOut(){return null!=this.rollOut}isCapAttractActive(){return this.capAttractActive}isInCapAttractZone(e){let t=window.innerWidth;return!(t<=0)&&e<=.1*t}isMarkerAtCapRest(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,t=this.getCursorMarker();if(!t||!this.isCursorMarkerVisible())return!1;let n=this.markerRollInStartScreenPosition();return Math.hypot(t.followScreen.x-n.x,t.followScreen.y-n.y)<=e}shouldShowCapDismissPointer(e){return!(!this.isCursorMarkerVisible()||this.ctx.disabled())&&!!this.markerGrabbedByMove&&this.isInCapAttractZone(e)&&this.isMarkerAtCapRest()}handlePointerMove(e,t){if(!this.isCursorMarkerVisible()||this.ctx.disabled()){this.capAttractActive=!1,this.capAttract=null;return}if(!(this.drag.active||this.rollOut||(0,tv.Uw)(e,t))){if(this.isInCapAttractZone(e)){if(!this.capAttractActive){this.capAttractActive=!0,this.cancelRollIn(),this.unpark(),this.pointerClient.valid=!1;let e=this.getCursorMarker();e&&(this.capAttract={entryX:e.followScreen.x,entryY:e.followScreen.y,progress:0})}return}this.capAttractActive&&(this.capAttractActive=!1,this.capAttract=null),this.rollIn||(this.setPointerClient(e,t),this.markerGrabbedByMove=!0)}}tryDismissZonePointerDown(e){return!(!e.isPrimary||this.ctx.disabled())&&!!this.isCursorMarkerVisible()&&!!this.markerGrabbedByMove&&!!this.isInCapAttractZone(e.clientX)&&(this.beginRollOut(),!0)}isParked(){return this.markerParked}parkAtClient(e,t){if(this.drag.active||this.ctx.disabled())return;let n=this.getCursorMarker();if(!n)return;let r=this.drawSurfaces.raycastPenFromClient(e,t);if(!(null==r?void 0:r.ballUid))return;this.markerParked=!0,n.contactBlend=0,this.setPointerClient(e,t),this.snapMarkerFollow(n,e,t),this.freezeIdlePose(n,r.point,r.normal,n.restDirection),n.originalDirectionWorld.copy(n.restDirection);let i=this.docPosFromClient(e,t);n.pos.x=i.x,n.pos.y=i.y}unpark(){this.markerParked&&(this.markerParked=!1)}setPointerClient(e,t){this.pointerClient.x=e,this.pointerClient.y=t,this.pointerClient.valid=!0}getCursorMarker(){return this.markers.length>0?this.markers[this.markers.length-1]:null}cancelDrag(){if(!this.drag.active)return;let e=this.drag.marker;this.drag.active=!1,this.drag.marker=null,this.drag.pointerId=-1,this.pendingInkUndoSnapshot=null,this.pendingInkUndoNeedsCapture=!1,this.drag.lastWorldPoint=null,this.drag.lastWorldNormal=null,this.drag.lastDirectionPoint=null,e&&(this.clearStroke(e),this.restoreIdlePose(e)),rC(),this.drawSurfaces.flushInkTextures(!0)}cancelRollIn(){this.rollIn=null}cancelRollOut(){this.rollOut=null,this.capReversing=!1}markerRadiusPx(){return .42*this.ctx.ballRadiusPx()}markerInvertScaleMul(){return(0,tM.En)()?.7:1}markerVisualScale(){let e=window.innerWidth,t=window.innerHeight;return 3.1499999999999995*((e,t,n,r,i)=>{let{halfH:a}=rq(t,n,r,i);return e/n*2*a})(2.55*this.markerRadiusPx()*4,e,t,this.ctx.cameraFov(),this.ctx.cameraZ())*this.markerInvertScaleMul()}markerScreenPos(e){let t=this.ctx.scrollBase();return{x:e.pos.x,y:e.pos.y-t}}docPosFromClient(e,t){return{x:e,y:this.ctx.scrollBase()+t}}setPointerNdc(e,t){let n=this.canvasEl.getBoundingClientRect();return!(n.width<=0)&&!(n.height<=0)&&(this.pointerNdc.set((e-n.left)/n.width*2-1,-(2*((t-n.top)/n.height))+1),!0)}screenDistToWorldPoint(e,t,n){let r=this.clientFromWorld(n);return r?Math.hypot(e-r.clientX,t-r.clientY):1/0}clientFromWorld(e){let t=this.canvasEl.getBoundingClientRect();return t.width<=0||t.height<=0?null:(this.tmpProjected.copy(e).project(this.camera),{clientX:t.left+(this.tmpProjected.x+1)*.5*t.width,clientY:t.top+(-this.tmpProjected.y+1)*.5*t.height})}markerTipWorld(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.group.position,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.group.quaternion,r=e.group.scale.x;return this.tmpTipWorld.copy(e.tipAnchorLocal).multiplyScalar(r).applyQuaternion(n).add(t)}markerRevealScaleMul(e){var t,n;return(null==(t=this.rollIn)?void 0:t.marker)===e&&this.capReveal<.999||(null==(n=this.rollOut)?void 0:n.marker)===e&&(this.capReversing||this.capReveal<.999)?this.capRevealEased():1}positionGroupForTipAt(e,t,n,r,i,a){let o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,l=this.markerVisualScale()*o;this.tmpAxis.copy(e.tipAnchorLocal).multiplyScalar(l).applyQuaternion(i),a.copy(t).addScaledVector(n,r).sub(this.tmpAxis)}initMarkerAtScreenNeutral(e,t,n){let r=this.drawSurfaces.raycastPenFromClient(t,n);if(!r)return;e.restDirection.set(1,0,0),re(e.restDirection,r.normal,e.restDirection),e.originalDirectionWorld.copy(e.restDirection);let i=no,a=r.ballUid?nN.surfaceContactOffset:i.drawContactOffset;e.group.quaternion.copy(rH),e.meshGroup.quaternion.identity(),this.positionGroupForTipAt(e,r.point,r.normal,a,rH,e.group.position),e.lastTipWorld=this.markerTipWorld(e).clone(),e.lastWorldNormal=r.normal.clone()}markerAtPoint(e,t){if(!this.setPointerNdc(e,t))return null;this.raycaster.setFromCamera(this.pointerNdc,this.camera);let n=null,r=1/0;for(let i of this.markers){if(!i.group.visible)continue;let a=this.raycaster.intersectObject(i.group,!0)[0];if(!a)continue;let o=this.screenDistToWorldPoint(e,t,a.point);o<r&&(n=i,r=o)}return n?{marker:n,dist:r}:null}isPointerOverCap(e,t){let n=this.capGroup;return!(!this.cursorMarkerVisible||!(null==n?void 0:n.visible)||this.ctx.disabled())&&!!this.setPointerNdc(e,t)&&(this.raycaster.setFromCamera(this.pointerNdc,this.camera),this.raycaster.intersectObject(n,!0).length>0)}tryCapPointerDown(e){return!(!e.isPrimary||this.ctx.disabled())&&!!this.isPointerOverCap(e.clientX,e.clientY)&&(this.beginRollOut(),!0)}markerCapScreenPositionAtReveal(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=rP(),i=(0,tv.J3)(),a=.01*window.innerWidth,o=135*this.markerInvertScaleMul()*.5*n;return{x:(null!=(e=null==r?void 0:r.x)?e:i.clientX)+a,y:(null!=(t=null==r?void 0:r.y
1)?t:i.clientY)-o}}markerCapScreenPosition(){return this.markerCapScreenPositionAtReveal(1)}markerRollInStartScreenPosition(){let e=this.markerCapScreenPositionAtReveal(1);return{x:e.x,y:e.y-.05*window.innerHeight}}beginRollOut(){var e;if(this.rollOut)return;let t=this.getCursorMarker();if(!t||!this.cursorMarkerVisible)return;this.cancelDrag(),this.rollIn=null,this.markerParked=!1,this.capAttractActive=!1,this.capAttract=null,this.pointerClient.valid=!1;let n=this.markerRollInStartScreenPosition();t.followScreen.x=n.x,t.followScreen.y=n.y,t.meshGroup.quaternion.identity(),t.group.quaternion.copy(rH),t.contactBlend=1,(null==(e=this.capGroup)?void 0:e.visible)||(this.capReveal=1),this.capReversing=!0,this.rollOut={marker:t,slotX:n.x,slotY:n.y}}spawnAtClient(e,t,n){if(this.markers.length>=16)return null;let r=this.docPosFromClient(e,t);return this.spawnAtDoc(r.x,r.y,n)}spawnAtViewportCenter(){let e=window.innerWidth,t=window.innerHeight;return this.spawnAtDoc(.5*e,this.ctx.scrollBase()+.5*t)}spawnAtDoc(e,t,n){if(this.markers.length>=16)return null;if(!this.templateParts)return this.pendingSpawnCount++,null;let r=this.templateParts.group.clone(!0);rN(r),this.penShadowCastEnabled?ti(r):to(r);let i=new eg.YJl,a=new eg.YJl;a.add(r),i.add(a),i.visible=!0,e6(i),this.scene.add(i);let o={uid:this.nextUid++,group:i,meshGroup:a,penMesh:r,tipAnchorLocal:this.templateParts.tipAnchorLocal.clone(),dragAnchorLocal:this.templateParts.dragAnchorLocal.clone(),dragAxisLocal:this.templateParts.dragAxisLocal.clone(),penDragState:{dragDirectionWorld:new eg.Pq0(1,0,0),dragDirectionTargetWorld:new eg.Pq0(1,0,0),smoothedWorldQuaternion:new eg.PTz,smoothedLiftAngle:nN.liftAngleBase,rotationInitialized:!1,pickupBlend:1,pickupDurationSec:.05,pickupStartWorldPosition:new eg.Pq0,pickupStartWorldRotation:new eg.PTz},pos:{x:e,y:t},strokeState:{last:null,prev:null,stampAngle:null},activeDrawSurface:null,activeDrawBallUid:null,lastTipWorld:null,lastWorldNormal:null,placedOnSurface:!1,restDirection:new eg.Pq0(1,0,0),originalDirectionWorld:new eg.Pq0(1,0,0),hasIdlePose:!1,idleWorldPosition:new eg.Pq0,idleWorldQuaternion:new eg.PTz,followScreen:{x:e,y:t-this.ctx.scrollBase()},hingeHeading:0,easedSurfaceNormal:new eg.Pq0(0,0,1),surfaceNormalEaseInitialized:!1,contactBlend:1,bottleSqueeze:0};this.markers.push(o),o.meshGroup.visible=!0,this.cursorMarkerVisible=!0,(0,rt.s)(!0);let l=t-this.ctx.scrollBase();return(null==n?void 0:n.skipIdlePose)?this.initMarkerAtScreenNeutral(o,e,l):this.placeMarkerAtScreen(o,e,l),this.pointerClient.x=e,this.pointerClient.y=l,this.pointerClient.valid=!0,o}handleSpawnEvent(e){if(this.ctx.disabled())return;let t=this.getCursorMarker();if(t&&this.cursorMarkerVisible)return void this.beginRollOut();let n=window.innerWidth,r=window.innerHeight,i=.5*n,a=.5*r,o=this.markerRollInStartScreenPosition(),l=t;if(l)l.meshGroup.visible=!0,this.cursorMarkerVisible=!0,(0,rt.s)(!0),this.snapMarkerFollow(l,o.x,o.y);else if(!(l=this.spawnAtClient(o.x,o.y,{skipIdlePose:!0})))return;this.markerParked=!1,this.cancelDrag(),l.meshGroup.quaternion.identity(),l.group.quaternion.copy(rH),l.contactBlend=1,this.markerGrabbedByMove=!1,this.pointerClient.valid=!1,this.syncMarkerRollIn(l,o.x,o.y,i,a,0,1/60,0),this.rollIn={marker:l,startX:o.x,startY:o.y,targetX:i,targetY:a},this.showCap()}handleFoilCycle(){if(this.ctx.disabled())return;let e=this.isCursorMarkerVisible(),t=(0,tM.MT)();if(!e){(0,tM.wy)(!1),this.handleSpawnEvent();return}if(!t)return void(0,tM.wy)(!0);(0,tM.wy)(!1),this.beginRollOut()}hideCursorMarker(){let e=this.getCursorMarker();e&&(this.cancelMarkerVariantSwap(!0),this.cancelDrag(),this.rollIn=null,this.rollOut=null,this.capAttractActive=!1,this.capAttract=null,this.markerParked=!1,e.meshGroup.visible=!1,this.cursorMarkerVisible=!1,(0,rt.s)(!1),this.pointerClient.valid=!1,this.markerGrabbedByMove=!1,this.hideCap())}removeCursorMarker(){let e=this.getCursorMarker();e&&(this.cancelMarkerVariantSwap(!0),this.cancelDrag(),this.rollIn=null,this.rollOut=null,this.capAttractActive=!1,this.capAttract=null,this.markerParked=!1,this.disposeMarkerEntity(e),this.markers=this.markers.filter(t=>t!==e),this.cursorMarkerVisible=!1,(0,rt.s)(!1),this.pointerClient.valid=!1,this.markerGrabbedByMove=!1,this.hideCap())}disposeMarkerEntity(e){this.scene.remove(e.group),e.penMesh.traverse(e=>{if(e instanceof eg.eaF)for(let t of(e.geometry.dispose(),Array.isArray(e.material)?e.material:[e.material]))t.dispose()})}easeContactBlend(e,t,n){let r=1-Math.exp(-11*n);e.contactBlend=eg.cj9.lerp(e.contactBlend,t,r),1e-4>Math.abs(e.contactBlend-t)&&(e.contactBlend=t)}easeMarkerSurfaceNormal(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;if(this.tmpContactNormal.copy(t).normalize(),e.surfaceNormalEaseInitialized){let t=1-Math.exp(-r*n);e.easedSurfaceNormal.lerp(this.tmpContactNormal,t).normalize()}else e.easedSurfaceNormal.copy(this.tmpContactNormal),e.surfaceNormalEaseInitialized=!0;return e.easedSurfaceNormal}applyEasedMarkerPose(e,t,n,r){var i,a;let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:18;n8(n,e.group.quaternion);let l=(null==(i=this.rollIn)?void 0:i.marker)===e||(null==(a=this.rollOut)?void 0:a.marker)===e?1:1-Math.exp(-o*r);if(l>=1-1e-5){e.group.position.copy(t),e.group.quaternion.copy(n);return}e.group.position.lerp(t,l),e.group.quaternion.slerp(n,l)}easeMeshGroupRollToIdentity(e,t){if(this.markerVariantSwap)return;let n=e.meshGroup.quaternion;if(n.x*n.x+n.y*n.y+n.z*n.z+(n.w-1)*(n.w-1)<1e-8)return void n.identity();let r=1-Math.exp(-14*t);n.slerp(rG,r)}computeHoverPose(e,t,n,r,i,a){let o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:n5,{worldPosition:l,worldQuaternion:s}=n7(t,n,e.hingeHeading,e.tipAnchorLocal,e.dragAxisLocal,r,o,void 0,e.group.quaternion);i.copy(l),a.copy(s);let c=Math.abs(n.z)>.9?no.hoverLift:nN.surfaceContactOffset*r;i.addScaledVector(n,c)}snapMarkerFollow(e,t,n){e.followScreen.x=t,e.followScreen.y=n}freezeIdlePose(e,t,n,r){let i=this.markerVisualScale();re(r,n,e.restDirection);let a=n9(e.restDirection,n),{worldPosition:o,worldQuaternion:l}
1=n7(t,n,a,e.tipAnchorLocal,e.dragAxisLocal,i);e.hingeHeading=a,e.easedSurfaceNormal.copy(n),e.surfaceNormalEaseInitialized=!0,e.idleWorldPosition.copy(o),e.idleWorldQuaternion.copy(l),e.hasIdlePose=!0,e.placedOnSurface=!0,e.group.position.copy(o),e.group.quaternion.copy(l),e.lastTipWorld=this.markerTipWorld(e,o,l).clone(),e.lastWorldNormal=n.clone()}placeMarkerAtScreen(e,t,n){let r=this.drawSurfaces.raycastPenFromClient(t,n);r&&(e.restDirection.set(1,0,0),this.freezeIdlePose(e,r.point,r.normal,e.restDirection),e.originalDirectionWorld.copy(e.restDirection))}restoreIdlePose(e){e.hasIdlePose&&(e.group.position.copy(e.idleWorldPosition),e.group.quaternion.copy(e.idleWorldQuaternion))}tryPointerDown(e){var t,n,r,i;let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.isPrimary||this.ctx.disabled()||this.markerParked||this.rollIn||this.rollOut)return!1;let o=this.getCursorMarker();if(!o)return!1;this.setPointerClient(e.clientX,e.clientY);let l=this.drawSurfaces.raycastPenFromClient(e.clientX,e.clientY);if((null==l?void 0:l.ballUid)&&!a)return!1;let s=null!=(t=null==l?void 0:l.point)?t:o.lastTipWorld,c=null!=(r=null!=(n=null==l?void 0:l.normal)?n:o.lastWorldNormal)?r:new eg.Pq0(0,0,1);if(!s)return!1;this.snapMarkerFollow(o,e.clientX,e.clientY),this.clearStroke(o);let d=this.drawSurfaces.seedStrokeAnchorAtClient(e.clientX,e.clientY,o.strokeState);return d&&(o.activeDrawSurface=d.surface,o.activeDrawBallUid="ball"===d.surface&&null!=(i=d.ballUid)?i:null),this.pendingInkUndoSnapshot=null,this.pendingInkUndoNeedsCapture=!0,this.strokeInkDrawn=!1,this.drag.active=!0,this.drag.marker=o,this.drag.pointerId=e.pointerId,this.drag.pointerX=e.clientX,this.drag.pointerY=e.clientY,this.drag.startX=e.clientX,this.drag.startY=e.clientY,this.drag.moved=!1,this.drag.lastMoveTimeMs=performance.now(),this.drag.lastWorldPoint=s.clone(),this.drag.lastWorldNormal=c.clone(),this.drag.lastDirectionPoint=s.clone(),this.drag.lastPointerSampleX=e.clientX,this.drag.lastPointerSampleY=e.clientY,o.surfaceNormalEaseInitialized||(o.easedSurfaceNormal.copy(c),o.surfaceNormalEaseInitialized=!0),rb(),!0}tryPointerMove(e){return!!this.drag.active&&e.pointerId===this.drag.pointerId&&(this.drag.pointerX=e.clientX,this.drag.pointerY=e.clientY,Math.hypot(e.clientX-this.drag.startX,e.clientY-this.drag.startY)>6&&(this.drag.moved=!0,this.markerGrabbedByMove=!0),!0)}tryPointerUp(e){if(!this.drag.active||e.pointerId!==this.drag.pointerId)return null;let t=this.drag.marker,n=this.drag.moved;if(this.drag.active=!1,this.drag.marker=null,this.drag.pointerId=-1,this.pendingInkUndoSnapshot&&((n||this.strokeInkDrawn)&&(this.drawSurfaces.commitInkUndoSnapshot(this.pendingInkUndoSnapshot),this.drawSurfaces.notifyInvertDripAfterDrawing(this.pendingInkUndoSnapshot)),this.pendingInkUndoSnapshot=null),this.pendingInkUndoNeedsCapture=!1,this.strokeInkDrawn=!1,!t)return{moved:n};rC(),nf=1,ng=0,nx=1,nv=0,ny=36,this.clearStroke(t,!0);let r=this.docPosFromClient(e.clientX,e.clientY);t.pos.x=r.x,t.pos.y=r.y;let i=this.drawSurfaces.raycastPenFromClient(e.clientX,e.clientY);if(!(i&&this.drag.lastWorldPoint&&this.drag.lastWorldNormal)&&i){let e=this.markerVisualScale(),{worldPosition:n,worldQuaternion:r}=n7(i.point,i.normal,t.hingeHeading,t.tipAnchorLocal,t.dragAxisLocal,e,void 0,void 0,t.group.quaternion);t.idleWorldPosition.copy(n),t.idleWorldQuaternion.copy(r),nG(t.penDragState,r),t.lastTipWorld=this.markerTipWorld(t,n,r).clone(),t.lastWorldNormal=i.normal.clone()}else nG(t.penDragState,t.group.quaternion);return this.setPointerClient(e.clientX,e.clientY),this.snapMarkerFollow(t,e.clientX,e.clientY),this.drag.lastWorldPoint=null,this.drag.lastWorldNormal=null,this.drag.lastDirectionPoint=null,this.drawSurfaces.flushInkTextures(!0),{moved:n}}tryPointerCancel(e){if(!this.drag.active||e.pointerId!==this.drag.pointerId)return!1;let t=this.drag.marker;return this.drag.active=!1,this.drag.marker=null,this.drag.pointerId=-1,this.pendingInkUndoSnapshot=null,this.pendingInkUndoNeedsCapture=!1,this.drag.lastWorldPoint=null,this.drag.lastWorldNormal=null,this.drag.lastDirectionPoint=null,t&&(this.clearStroke(t),this.restoreIdlePose(t)),rC(),this.drawSurfaces.flushInkTextures(!0),!0}finalizeStrokeEndCap(e){e.activeDrawSurface&&this.drawSurfaces.finalizeStrokeEndCap(e.strokeState,e.activeDrawSurface,e.activeDrawBallUid)}clearStroke(e){var t;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n&&this.finalizeStrokeEndCap(e),(t=e.strokeState).yellowLineInstance=void 0,t.prevSegmentAngleRad=void 0,e.activeDrawSurface=null,e.activeDrawBallUid=null,e.strokeState.last=null,e.strokeState.prev=null,e.strokeState.stampAngle=null,e.strokeState.inkSpeedEased=void 0,e.strokeState.inkPathPx=void 0,e.strokeState.inkOpacityEased=void 0,e.strokeState.lastInkWorld=void 0,e.strokeState.lastTangentRad=void 0}breakStroke(e,t,n){e.activeDrawSurface=t,e.activeDrawBallUid="ball"===t&&null!=n?n:null,e.strokeState.last=null,e.strokeState.prev=null,e.strokeState.stampAngle=null,e.strokeState.lastInkWorld=void 0,e.strokeState.lastTangentRad=void 0}ensurePendingInkSnapshot(){this.pendingInkUndoNeedsCapture&&(this.pendingInkUndoSnapsh
1ot=this.drawSurfaces.captureInkUndoSnapshot(),this.pendingInkUndoNeedsCapture=!1)}appendInvertDripsDuringStroke(){this.pendingInkUndoSnapshot&&this.drawSurfaces.notifyInvertDripAfterDrawing(this.pendingInkUndoSnapshot)}drawFromHit(e,t,n,r,i){var a;this.ensurePendingInkSnapshot(),e.activeDrawSurface=this.drawSurfaces.drawStreakAtHit(t,e.strokeState,e.activeDrawSurface,e.activeDrawBallUid,n,r,i),e.activeDrawBallUid="ball"===t.surface&&null!=(a=t.ballUid)?a:null,this.strokeInkDrawn=!0,this.appendInvertDripsDuringStroke()}updateDraggedMarker(e,t){var n,r,i,a,o;let l=Math.max(t,1/240);this.easeContactBlend(e,0,l);let s=this.drawSurfaces.raycastPenFromClient(this.drag.pointerX,this.drag.pointerY),c=null!=(n=null==s?void 0:s.normal)?n:this.drag.lastWorldNormal,d=this.drag.lastWorldPoint,u=d&&c?this.drawSurfaces.getPointerPlaneHit(this.drag.pointerX,this.drag.pointerY,d,c):null,h=null!=(r=null==s?void 0:s.point)?r:u;if(!h||!c)return;let p=Math.hypot(this.drag.pointerX-this.drag.lastPointerSampleX,this.drag.pointerY-this.drag.lastPointerSampleY),m=p>.12;!function(e,t){let n=(0,tM.En)()?1.3:1.1;if(t)return(0,tM.En)()?!function(){if(nf<=1.0001){nf=1,ng=0;return}ng<=0&&(nx=nf,ng=5);let e=(5- --ng)/5;nf=1+(nx-1)*(1-e),ng<=0&&(nf=1,ng=0)}():(nf=1+(nf-1)*(1-Math.min(1,e/.03)))<=1.0001&&(nf=1);ng=0,nv+=90*(nf=Math.min(n,nf+(n-1)/1*e))*e}(l,m),p>2048&&e.activeDrawSurface&&this.breakStroke(e,e.activeDrawSurface);let f=!!(null==s?void 0:s.ballUid),g=this.drag.pointerX,x=this.drag.pointerY,v=e.followScreen.x,y=e.followScreen.y,w=g-v,b=x-y;if(Math.hypot(w,b)>.12){let e=1-Math.exp(-((0,tM.En)()?40:12)*l);v+=w*e,y+=b*e}else v=g,y=x;e.followScreen.x=v,e.followScreen.y=y,this.applyMarkerHingeFollowPose(e,v,y,g,x,h,c,f,l,!1,this.isInvertDrag(e)?{dx:this.drag.pointerX-this.drag.lastPointerSampleX,dy:this.drag.pointerY-this.drag.lastPointerSampleY}:void 0),e.meshGroup.quaternion.identity();let k=this.markerTipWorld(e,e.group.position,e.group.quaternion).clone(),C={clientX:this.drag.pointerX,clientY:this.drag.pointerY},M=Math.hypot(C.clientX-this.drag.startX,C.clientY-this.drag.startY),S=l>0?p/l:0;if(!m&&e.activeDrawSurface&&e.strokeState.last){this.ensurePendingInkSnapshot();let t=this.drawSurfaces.drawMarkerDwellAtAnchor(e.activeDrawSurface,e.activeDrawBallUid,e.strokeState);t>0&&(this.strokeInkDrawn=!0,this.appendInvertDripsDuringStroke(),!(nv<ny)&&(ny+=36,1)&&this.pendingInkUndoSnapshot&&e.strokeState.last&&this.drawSurfaces.notifyDwellInkDripAtAnchor(this.pendingInkUndoSnapshot,e.activeDrawSurface,e.activeDrawBallUid,e.strokeState.last.x,e.strokeState.last.y,t))}else if(M>0){let t=this.drawSurfaces.raycastDrawFromClient(C.clientX,C.clientY);if(p<=2048)if(t){let n=e.lastTipWorld&&l>0?e.lastTipWorld.distanceTo(k)/l:0;this.drawFromHit(e,t,n,S,C)}else e.activeDrawSurface&&this.breakStroke(e,e.activeDrawSurface,null!=(i=e.activeDrawBallUid)?i:void 0);else t?this.breakStroke(e,t.surface,t.ballUid):e.activeDrawSurface&&this.breakStroke(e,e.activeDrawSurface,null!=(a=e.activeDrawBallUid)?a:void 0)}(o=M>0&&m)!==rk&&(rk=o,o?rw():rC()),this.drag.lastPointerSampleX=this.drag.pointerX,this.drag.lastPointerSampleY=this.drag.pointerY,e.lastTipWorld=k,e.lastWorldNormal=c.clone(),this.drag.lastWorldPoint=h.clone();let j=this.docPosFromClient(this.drag.pointerX,this.drag.pointerY);e.pos.x=j.x,e.pos.y=j.y}screenDeltaToSurfaceTangent(e,t,n,r){let i=window.innerWidth,a=window.innerHeight,{halfW:o,halfH:l}=rq(i,a,this.ctx.cameraFov(),this.ctx.cameraZ());r.set(e/i*2*o,-t/a*2*l,0),r.addScaledVector(n,-r.dot(n)),r.lengthSq()>1e-9?r.normalize():(r.set(1,0,0),r.addScaledVector(n,-r.dot(n)),r.lengthSq()>1e-9?r.normalize():r.set(1,0,0))}updateCapAttract(e,t){let n=Math.max(t,1/240),r=this.markerRollInStartScreenPosition(),i=.1*window.innerHeight;this.capAttract||(this.capAttract={entryX:e.followScreen.x,entryY:e.followScreen.y,progress:0});let a=this.capAttract,{entryX:o,entryY:l}=a,s=1-Math.exp(-9*n);a.progress=eg.cj9.clamp(a.progress+(1-a.progress)*s,0,1);let c=a.progress,d=o+(r.x-o)*c,u=l+(r.y-l)*c-Math.sin(Math.PI*c)*i;e.followScreen.x=d,e.followScreen.y=u,this.easeMeshGroupRollToIdentity(e,n
1),this.syncMarkerRollIn(e,d,u,r.x,r.y,0,n)}updateRollIn(e,t){if(!this.rollIn||this.rollIn.marker!==e)return;let n=this.rollIn,r=Math.max(t,1/240),{startX:i,startY:a,targetX:o,targetY:l}=n;e.followScreen.x=i,e.followScreen.y=a,this.syncMarkerRollIn(e,i,a,o,l,0,r),this.capReveal>=.999&&(this.syncMarkerRollIn(e,i,a,i,a,0,r),this.rollIn=null,this.pointerClient.valid=!1)}updateRollOut(e,t){var n;if(!this.rollOut||this.rollOut.marker!==e)return;let r=this.rollOut,i=Math.max(t,1/240),{slotX:a,slotY:o}=r;if(this.capReversing&&!(null==(n=this.capGroup)?void 0:n.visible)){let e=1-Math.exp(-5.5*i);this.capReveal=Math.max(0,this.capReveal-e),this.capReveal<=.001&&(this.capReveal=0,this.capReversing=!1)}e.followScreen.x=a,e.followScreen.y=o,this.syncMarkerRollIn(e,a,o,a,o,0,i),this.easeMeshGroupRollToIdentity(e,i),this.capReversing||(this.rollOut=null,this.removeCursorMarker())}isInvertDrag(e){return(0,tM.En)()&&this.drag.active&&this.drag.marker===e}applyMarkerHingeFollowPose(e,t,n,r,i,a,o,l,s,c,d){var u,h;let p=this.isInvertDrag(e),m=this.drag.active&&this.drag.marker===e,f=(0,tM.En)(),g=p?33.333333333333336:10,x=m||f?n4:n5,v=this.easeMarkerSurfaceNormal(e,o,s,g),y=null!=(u=null==d?void 0:d.dx)?u:r-t,w=null!=(h=null==d?void 0:d.dy)?h:i-n;if(Math.hypot(y,w)>(p?.05:.25)){this.screenDeltaToSurfaceTangent(y,w,v,this.tmpAxis);let t=n9(this.tmpAxis,v),n=1-Math.exp(-(p?16:g)*s);e.hingeHeading=function(e,t,n){let r=Math.atan2(Math.sin(t-e),Math.cos(t-e));return e+r*Math.max(0,Math.min(1,n))}(e.hingeHeading,t,n)}let b=this.markerVisualScale(),k=no,C=l?nN.surfaceContactOffset:k.drawContactOffset,M=m?eg.cj9.lerp(n3,x,e.contactBlend):x,{worldPosition:S,worldQuaternion:j}=n7(a,v,e.hingeHeading,e.tipAnchorLocal,e.dragAxisLocal,b,M,C,e.group.quaternion);this.tmpDisplayPos.copy(S),this.tmpDisplayQuat.copy(j);let I=Math.abs(v.z)>.9?k.hoverLift:nN.surfaceContactOffset*b,A=m?e.contactBlend:1;A>1e-4&&this.tmpDisplayPos.addScaledVector(v,I*A),this.applyEasedMarkerPose(e,this.tmpDisplayPos,this.tmpDisplayQuat,s,p?60:18),c&&(e.idleWorldPosition.copy(this.tmpDisplayPos),e.idleWorldQuaternion.copy(this.tmpDisplayQuat),e.hasIdlePose=!0,e.placedOnSurface=!0,e.lastTipWorld=this.markerTipWorld(e,e.group.position,e.group.quaternion).clone(),e.lastWorldNormal=o.clone());let P=this.docPosFromClient(t,n);e.pos.x=P.x,e.pos.y=P.y}syncMarkerRollIn(e,t,n,r,i,a,o){var l,s,c,d;let u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1;e.meshGroup.quaternion.identity();let h=this.drawSurfaces.raycastPenFromClient(t,n),p=null!=(s=null!=(l=null==h?void 0:h.normal)?l:e.lastWorldNormal)?s:new eg.Pq0(0,0,1),m=null!=(c=null==h?void 0:h.point)?c:e.lastTipWorld,f=!h&&m&&p?this.drawSurfaces.getPointerPlaneHit(t,n,m,p):null,g=null!=(d=null==h?void 0:h.point)?d:f;if(!g||!p)return;let x=no,v=(null==h?void 0:h.ballUid)?nN.surfaceContactOffset:x.drawContactOffset;this.positionGroupForTipAt(e,g,p,v,rH,this.tmpContactPoint,u);let y=eg.cj9.clamp(a,0,1);y<=0?(this.tmpDisplayPos.copy(this.tmpContactPoint),this.tmpDisplayQuat.copy(rH)):(this.sampleHoverPoseAtScreen(e,t,n,r,i,g,p,this.tmpHoverPos,this.tmpHoverQuat),this.tmpDisplayPos.lerpVectors(this.tmpContactPoint,this.tmpHoverPos,y),this.tmpDisplayQuat.copy(rH).slerp(this.tmpHoverQuat,y)),this.applyEasedMarkerPose(e,this.tmpDisplayPos,this.tmpDisplayQuat,o),e.lastTipWorld=this.markerTipWorld(e,e.group.position,e.group.quaternion).clone(),e.lastWorldNormal=p.clone();let w=this.docPosFromClient(t,n);e.pos.x=w.x,e.pos.y=w.y}sampleHoverPoseAtScreen(e,t,n,r,i,a,o,l,s){let c=e.hingeHeading,d=r-t,u=i-n;Math.hypot(d,u)>.25&&(this.screenDeltaToSurfaceTangent(d,u,o,this.tmpAxis),c=n9(this.tmpAxis,o));let h=e.hingeHeading;e.hingeHeading=c,this.computeHoverPose(e,a,o,this.markerVisualScale(),l,s),e.hingeHeading=h}syncMarkerAtScreen(e,t,n,r,i,a){var o,l,s;this.easeContactBlend(e,1,a);let c=this.drawSurfaces.raycastPenFromClient(t,n),d=null!=(o=null==c?void 0:c.normal)?o:e.lastWorldNormal,u=null!=(l=null==c?void 0:c.point)?l:e.lastTipWorld,h=!c&&u&&d?this.drawSurfaces.getPointerPlaneHit(t,n,u,d):null,p=null!=(s=null==c?void 0:c.point)?s:h;p&&d&&(this.applyMarkerHingeFollowPose(e,t,n,r,i,p,d,!!(null==c?void 0:c.ballUid),a,!0),e.contactBlend>=.999&&nG(e.penDragState,e.group.quaternion))}updateCursorFollow(e,t){if(!this.pointerClient.valid||this.ctx.disabled())return;let n=this.pointerClient.x,r=this.pointerClient.y,i=Math.max(t,1/240),a=e.followScreen.x,o=e.followScreen.y,l=n-a,s=r-o;if(Math.hypot(l,s)>.12){let e=1-Math.exp(-12*i);a+=l*e,o+=s*e}else a=n,o=r;e.followScreen.x=a,e.followScreen.y=o,this.syncMarkerAtScreen(e,a,o,n,r,i),this.easeMeshGroupRollToIdentity(e,i)}updateIdleMarker(e){this.restoreIdlePose(e)}ensureGroundPlane(){let{halfW:e,halfH:t}=rq(window.innerWidth,window.innerHeight,this.ctx.cameraFov(),this.ctx.cameraZ());this.drawSurfaces.createGroundPlane(e,t)}breakStrokeOnSurfaceResize(){let e=!1;if(this.drawSurfaces.consumeOverlayResize()&&(e=!0),this.drawSurfaces.consumeGroundResize()&&(e=!0),e)for(let e of this.markers)e.activeDrawSurface&&this.breakStroke(e,e.activeDrawSurface)}breakStrokeOnGroundScroll(){if(this.drawSurfaces.syncGroundCanvas(this.ctx.scrollBase()))for(let e of this.markers)"ground"===e.activeDrawSurface&&this.breakStroke(e,e.activeDrawSurface)}step(e){this.ensureGroundPlane(),this.breakStrokeOnSurfaceResize(),this.drawSurfaces.syncViewportOverlay(),this.breakStrokeOnGroundScroll()}tickMarkerBottleSqueeze(e,t){let n=rD&&e===this.getCursorMarker()||this.drag.active&&this.drag.marker===e&&(0,tM.En)();e.bottleSqueeze=function(e,t,n){let r=e+(!!t-e)*(1-Math.exp(-(t?9:12)*n));return!t&&r<.002?0:r}(e.bottleSqueeze,n,t),function(e,t){if(!e)return;let n=rF.get(e);n&&(n.uSqueeze.value=Math.max(0,Math.min(1,t)),rY(n,rL))}(e.penMesh,e.bottleSqueeze)}updatePosesAndDraw(e){let t=Math.max(e,1/240);for(let i of(this.tickMarkerVariantSwap(t),this.syncCapAboveFoil(t),this.ensureGroundPlane(),this.breakStrokeOnSurfaceResize(),this.drawSurfaces.syncViewportOverlay(),this.breakStrokeOnGroundScroll(),this.markers)){var n,r;this.tickMarkerBottleSqueeze(i,t),this.drag.active&&this.drag.marker===i?this.updateDraggedMarker(i,e):(null==(n=this.rollOut)?void 0:n.marker)===i?this.updateRollOut(i,e):(null==(r=this.rollIn)?void 0:r.marker)===i?this.updateRollIn(i,e):this.capAttractActive&&i===this.getCursorMarker()?this.updateCapAttract(i,e):i!==this.getCursorMarker()||this.markerParked?this.updateIdleMarker(i):this.updateCursorFollow(i,e)}this.drawSurfaces.flushInkTextures(!this.drag.active)}syncTransforms(){let e=this.markerVisualScale();for(let t of this.markers){t.meshGroup.position.set(0,0,0);let n=this.markerRevealScaleMul(t);t.group.scale.setScalar(e),t.meshGroup.scale.setScalar(n*this.variantSwapScaleMul),0!==this.variantSwapZRad&&t.meshGroup.quaternion.setFromAxisAngle(rU,this.variantSwapZRad)}}collectShadowCasterCenters(e){for(let t of this.markers){if(!t.meshGroup.visible)continue;t.group.updateWorldMatrix(!0,!1);let n=this.markerTipWorld(t);e.push({x:n.x,y:n.y})}let t=this.capGroup;(null==t?void 0:t.visible)&&(t.updateWorldMatrix(!0,!1),this.tmpHoverPos.setFromMatrixPosition(t.matrixWorld),e.push({x:this.tmpHoverPos.x,y:this.tmpHoverPos.y}))}enableShadowCompositeLayers(){for(let e of this.markers)e6(e.group);this.capGroup&&e6(this.capGroup)}setShadowCastersPassWrite(e,t){var n;for(let n of this.markers)n.meshGroup.visible&&e8(n.penMesh,e,t);(null==(n=this.capGroup)?void 0:n.visible)&&e8(this.capGroup,e,t)}tryUndoInk(){if(this.ctx.disabled()||this.drag.active||!this.drawSurfaces.undoLastInkStroke())return!1;for(let e of this.markers)this.clearStroke(e);return!0}registerBallMeshes(e,t,n){this.drawSurfaces.registerBallMeshes(e,t,n)}registerBallInkSurface(e,t,n){this.drawSurfaces.registerBallInkSurface(e,t,n)}registerBallInstancer(e,t){this.drawSurfaces.registerBallInstancer(e,t)}syncBallInkOverlayMatrices(){this.drawSurfaces.syncBallInkOverlayMatrices()}unregisterBall(e){this.drawSurfaces.unregisterBall(e)}registerDrawOccluder(e){this.drawSurfaces.registerDrawOccluder(e)}dispose(){for(let e of(ry(),null==rd||rd.remove(),rd=null,rh=null,rp=null,null==ru||ru.close(),ru=null,(0,rt.s)(!1),this.hideCap(),this.capGroup&&(this.scene.remove(this.capGroup),this.disposeCapMesh(this.capGroup),this.capGroup=null),this.cursorMarkerVisible=!1,this.markers))this.disposeMarkerEntity(e);this.markers=[],this.drawSurfaces.dispose()}constructor(e,t,n,r){this.markers=[],this.nextUid=0,this.drag={active:!1,marker:null,pointerId:-1,pointerX:0,pointerY:0,startX:0,startY:0,moved:!1,lastMoveTimeMs:0,lastWorldPoint:null,lastWorldNormal:null,lastDirectionPoint:null,lastPointerSampleX:0,lastPointerSampleY:0},this.templateParts=null,this.normalTemplateParts=null,this.invertTemplateParts=null,this.capGroup=null,this.capGroupNormal=null,this.capGroupInvert=null,this.capReveal=0,this.capReversing=!1,this.pendingSpawnCount=0,this.markerParked=!1,this.cursorMarkerVisible=!1,this.penShadowCastEnabled=!0,this.rollIn=null,this.rollOut=null,this.markerVariantSwap=null,this.variantSwapZRad=0,this.variantSwapScaleMul=1,this.capAttractActive=!1,this.markerGrabbedByMove=!1,this.capAttract=null,this.siteInvertPenMaterialsActive=null,this.siteInvertModelsActive=null,this.siteInvertExemptActive=null,this.pointerClient={x:0,y:0,valid:!1},this.raycaster=new eg.tBo,this.pointerNdc=new eg.I9Y,this.tmpAxis=new eg.Pq0,this.tmpTipWorld=new eg.Pq0,this.tmpProjected=new eg.Pq0,this.tmpHoverPos=new eg.Pq0,this.tmpHoverQuat=new eg.PTz,this.tmpDisplayPos=new eg.Pq0,this.tmpDisplayQuat=new eg.PTz,this.tmpContactNormal=new eg.Pq0,this.tmpContactPoint=new eg.Pq0,this.pendingInkUndoSnapsh
1ot=null,this.pendingInkUndoNeedsCapture=!1,this.strokeInkDrawn=!1,this.scene=e,this.camera=t,this.canvasEl=n,this.ctx=r,this.drawSurfaces=new nY(e,t,n)}}let rX=new eg.kn4().makeScale(0,0,0);function r$(e){e.updateMatrixWorld(!0);let t=null;return e.traverse(e=>{!t&&e instanceof eg.eaF&&(t=e)}),t}function r_(e,t){for(let n of t)!(n.instanceSlot<0)&&n.meshPivot&&function(e,t,n,r){if(!r)return e.mesh.setMatrixAt(t,e.hiddenMatrix);n.updateMatrixWorld(!0),e.mesh.setMatrixAt(t,n.matrixWorld)}(e,n.instanceSlot,n.meshPivot,n.visible);e.mesh.instanceMatrix.needsUpdate=!0}let rZ=null,rJ=null;async function rK(){try{let e=new AudioContext,t=await fetch("/audio/kick.m4a"),n=await t.arrayBuffer(),r=await e.decodeAudioData(n),i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3.8/3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3.1,r=e.sampleRate,i=Math.floor(r*t),a=e.createBuffer(2,i,r);for(let e=0;e<2;e++){let t=a.getChannelData(e);for(let e=0;e<i;e++){let r=Math.pow(1-e/i,n);t[e]=(2*Math.random()-1)*r}}return a}(e);return{ctx:e,buffer:r,impulse:i}}catch(e){return null}}async function rQ(){return rZ||(rJ||(rJ=rK()),rZ=await rJ)}let r0=" fill='%231e1e1e' stroke='%23ffffff' stroke-width='1' stroke-linejoin='round' stroke-linecap='round'",r1=rS("<rect x='6' y='5' width='4' height='14' rx='1'".concat(r0,"/>")+"<rect x='14' y='5' width='4' height='14' rx='1'".concat(r0,"/>")),r2=rS("<path d='M9 6.5v11l9-5.5-9-5.5z'".concat(r0,"/>")),r5=rS("<rect x='10' y='3' width='4' height='8' rx='1'".concat(r0,"/>")+"<polygon points='6,11 18,11 12,21'".concat(r0,"/>")),r3=rj(r1),r4=rj(r2),r6=rj(r5),r8=null;function r9(){return"pause"===r8?r3:"play"===r8?r4:"scroll"===r8?r6:""}let r7=!1,ie=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=Math.abs(e);if(n<55)return!1;let r=Math.min(.82,(.06+.76*Math.min(1,n/3200))*t);return!(r<.02)&&((async()=>{let e=await rQ();if(!e)return;let{ctx:t,buffer:n,impulse:i}=e;if("suspended"===t.state)try{await t.resume()}catch(e){return}let a=t.createBufferSource();a.buffer=n;let o=t.createBiquadFilter();o.type="lowpass",o.frequency.value=2900,o.Q.value=.65;let l=t.createBiquadFilter();l.type="peaking",l.frequency.value=420,l.Q.value=.9,l.gain.value=2.2;let s=t.createConvolver();s.buffer=i,s.normalize=!1;let c=t.createGain();c.gain.value=.38;let d=t.createGain();d.gain.value=1.24/3;let u=t.createGain();u.gain.value=1;let h=t.createGain();h.gain.value=r,a.connect(o),o.connect(l),l.connect(c),l.connect(s),s.connect(d),c.connect(u),d.connect(u),u.connect(h),h.connect(t.destination);let p=t.currentTime;a.start(p),a.stop(p+n.duration+4.4/3)})(),!0)},it=e=>Math.max(0,Math.min(1,e)),ir=e=>1-(1-it(e))**2,ii=e=>it(e)**2,ia="usmen-soccer-ball-spawn",io="usmen-soccer-ball-remove",il="usmen-goal-scroll-zone",is="--usmen-goal-zone-top",ic="--usmen-goal-zone-height";new eg.Pq0(0,.38,1).normalize();let id=(e,t,n)=>Math.min(n,Math.max(t,e)),iu=(e,t,n)=>{let r=id((n-e)/(t-e),0,1);return r*r*(3-2*r)},ih=new eg.Pq0(-1,0,0),ip=new eg.Pq0(1,0,0),im=new eg.Pq0(0,-1,0),ig=new eg.Pq0(0,1,0),ix=new eg.Pq0(0,0,-1),iv=new eg.Pq0(0,0,1),iy=(e,t,n,r,i,a)=>{let o=1/0;for(let l of[{outward:ih,project:n=>n.set(t.min.x,id(e.y,t.min.y,t.max.y),id(e.z,t.min.z,t.max.z))},{outward:ip,project:n=>n.set(t.max.x,id(e.y,t.min.y,t.max.y),id(e.z,t.min.z,t.max.z))},{outward:im,project:n=>n.set(id(e.x,t.min.x,t.max.x),t.min.y,id(e.z,t.min.z,t.max.z))},{outward:ig,project:n=>n.set(id(e.x,t.min.x,t.max.x),t.max.y,id(e.z,t.min.z,t.max.z))},{outward:ix,project:n=>n.set(id(e.x,t.min.x,t.max.x),id(e.y,t.min.y,t.max.y),t.min.z)},{outward:iv,project:n=>n.set(id(e.x,t.min.x,t.max.x),id(e.y,t.min.y,t.max.y),t.max.z)}]){if(l.outward.dot(n)>.85||l.outward.dot(r)>.85||l.outward.dot(i)>.85)continue;l.project(a);let t=e.distanceTo(a);t<o&&(o=t)}return o},iw=e=>68+16*id((e-680)/440,0,1),ib=(e,t,n,r)=>{let i=r*Math.tan(n*Math.PI/360);return{halfW:e/t*i,halfH:i}},ik=(e,t,n,r,i,a)=>{let{halfW:o,halfH:l}=ib(n,r,i,a);return{x:(e-.5*n)/n*2*o,y:(.5*r-t)/r*2*l}},iC=(e,t,n,r,i)=>{let{halfH:a}=ib(t,n,r,i);return e/n*2*a},iM=(e,t,n,r,i,a,o)=>{let{halfW:l,halfH:s}=ib(r,i,a,o);
1return{x:e/(2*l)*r+.5*r,y:.5*i-t/(2*s)*i+n}},iS={tx:0,ty:114,tz:48,rotX:-90,rotY:0,rotZ:180,scale:345,lastScreenFrac:.88,fov:40,cameraZ:330,ballScale:.7,grabLiftTarget:9.5,grabLiftRate:9,grabSqueezeRate:6,grabSqueezeBulge:.38},ij={corRealLow:.76,corRealHigh:1,corSlopePerMs:.03,wallCorFactor:.46,groundCorFactor:1,frictionPerSecond:.45,stopDecel:30,liftGravity:2100,liftMinDelta:0,liftVzK:3.5,liftMaxVz:297,liftRestVz:35,scrollMomentumTransfer:.25,scrollMomentumMax:2600,kickGain:1.15,tapKickSpeed:950},iI=[{label:"BOUNCE",sliders:[{key:"corRealLow",label:"cor low",min:0,max:1,step:.01},{key:"corRealHigh",label:"cor high",min:0,max:1,step:.01},{key:"corSlopePerMs",label:"cor slope",min:0,max:.03,step:.001},{key:"wallCorFactor",label:"wall bounce",min:0,max:1,step:.01},{key:"groundCorFactor",label:"floor bounce",min:0,max:1,step:.01}]},{label:"HOP",sliders:[{key:"liftMinDelta",label:"hop min Δv",min:0,max:800,step:5},{key:"liftVzK",label:"hop gain",min:0,max:40,step:.5},{key:"liftMaxVz",label:"hop max vz",min:0,max:1500,step:10},{key:"liftRestVz",label:"hop settle vz",min:0,max:300,step:5},{key:"liftGravity",label:"hop gravity",min:500,max:12e3,step:50}]},{label:"ROLL",sliders:[{key:"frictionPerSecond",label:"friction",min:0,max:2,step:.01},{key:"stopDecel",label:"stop decel",min:0,max:200,step:1},{key:"scrollMomentumTransfer",label:"scroll kick",min:0,max:2,step:.05},{key:"scrollMomentumMax",label:"scroll max",min:0,max:6e3,step:50},{key:"kickGain",label:"kick gain",min:.2,max:3,step:.05},{key:"tapKickSpeed",label:"tap kick",min:0,max:3e3,step:25}]}],iA=()=>{let e=document.getElementById("aj1-main-footer");return null!=e&&e.getBoundingClientRect().top<=2},iP=()=>{let e=document.getElementById("aj1-main-footer"),t=(()=>{let e=document.documentElement,t=parseFloat(getComputedStyle(e).getPropertyValue(is)),n=parseFloat(getComputedStyle(e).getPropertyValue(ic));if(Number.isFinite(t)&&t>0&&Number.isFinite(n)&&n>0)return{top:t,height:n};let r=document.getElementById(il);if(!r)return null;let i=r.getBoundingClientRect();return{top:i.top+window.scrollY,height:i.height||r.offsetHeight}})();if(e&&t){let n=e.offsetHeight||t.height;return t.top-n}if(e){let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t}return 1/0},iR=null,iE=[{sliders:[{key:"tx",label:"pos x",min:-1500,max:1500,step:1},{key:"ty",label:"pos y",min:-1500,max:1500,step:1},{key:"tz",label:"pos z",min:-1500,max:1500,step:1},{key:"rotX",label:"rot x\xb0",min:-180,max:180,step:1},{key:"rotY",label:"rot y\xb0",min:-180,max:180,step:1},{key:"rotZ",label:"rot z\xb0",min:-180,max:180,step:1},{key:"scale",label:"scale",min:20,max:2e3,step:1},{key:"lastScreenFrac",label:"screen frac",min:0,max:1,step:.01}]},{label:"CAMERA",sliders:[{key:"fov",label:"fov\xb0",min:5,max:90,step:.5},{key:"cameraZ",label:"cam z",min:200,max:5e3,step:10}]},{label:"BALL",sliders:[{key:"ballScale",label:"ball scale",min:.25,max:3,step:.05},{key:"grabLiftTarget",label:"drag lift px",min:0,max:120,step:1},{key:"grabLiftRate",label:"drag lift rate",min:1,max:30,step:.5},{key:"grabSqueezeRate",label:"deform rate",min:1,max:30,step:.5},{key:"grabSqueezeBulge",label:"deform bulge",min:0,max:1,step:.01}]}];function iL(e){let{disabled:t=!1}=e,n=(0,a.useRef)(null),o=(0,a.useRef)(null),s=(0,i.md)(l.u),c=(0,a.useRef)(s);c.current=s;let d=(0,i.Xr)(eN),u=(0,a.useRef)(d);u.current=d;let h=(0,i.Xr)(eU),p=(0,a.useRef)(h);p.current=h;let m=(0,i.md)(eM),f=(0,i.Xr)(eM),g=(0,a.useRef)(m),x=(0,a.useRef)(f),v=(0,a.useRef)([]);g.current=m,x.current=f;let[y,w]=(0,a.useState)(!1),b=(0,a.useRef)(t);b.current=t;let k=(0,i.md)(eL),C=(0,a.useRef)(k);C.current=k;let M=(0,i.md)(eE),S=(0,a.useRef)(M);S.current=M;let j=eG(),[I,A]=(0,a.useState)(!1),[P,R]=(0,a.useState)(iS),E=(0,a.useRef)(iS),L=e=>{E.current=e,R(e)},[z,D]=(0,a.useState)(!1),[T,B]=(0,a.useState)(""),[F,W]=(0,a.useState)(eZ),O=(0,a.useRef)(eZ()),Y=(0,a.useRef)(null),N=(0,a.useRef)(null),G=e=>{var t;let n={...e};O.current=n,W(n);let r=Y.current;r&&(r.intensity=n.ambientIntensity),null==(t=N.current)||t.call(N,n)},[U,H]=(0,a.useState)(tm),q=(0,a.useRef)(tm()),V=(0,a.useRef)(null),X=(0,a.useRef)(null),$=e=>{var t;let n={...e};q.current=n,H(n),null==(t=X.current)||t.call(X,n)},_=e=>{let t=e.trim();if(!t)return!1;try{let e=JSON.parse(t);if(!e||"object"!=typeof e||Array.isArray(e))return!1;let n=eJ.some(t=>t in e),r=tf.some(t=>t in e);if(!n&&!r)return!1;return n&&G(function(e,t){let n={...e};for(let e of eJ){let r=t[e];void 0!==r&&typeof r==typeof n[e]&&Object.assign(n,{[e]:r})}return n}(O.current,e)),r&&$(function(e,t){let n={...e};for(let e of tf){let r=t[e];void 0!==r&&typeof r==typeof n[e]&&Object.assign(n,{[e]:r})}return n}(q.current,e)),!0}catch(e){return!1}},[Z,J]=(0,a.useState)(!1),[K,Q]=(0,a.useState)(ij),ee=(0,a.useRef)(ij),et=e=>{ee.current=e,Q(e)},[en,er]=(0,a.useState)(!1),[ei,ea]=(0,a.useState)(ty),eo=(0,a.useRef)(ty),el=e=>{eo.current=e,ea(e),function(e){for(let t of(tw={...tw,...e},tb))t()}(e)};(0,a.useEffect)(()=>{var e;return e=()=>{let e=tw;eo.current=e,ea({...e})},tb.add(e),()=>tb.delete(e)},[]);let[es,ec]=(0,a.useState)(!1),[ed,eu]=(0,a.useState)(rE),eh=(0,a.useRef)(rE),ep=e=>{eh.current=e,eu(e);let t=rL={...rL,...e};for(let e of rW){let n=rF.get(e);n&&rY(n,t)}};(0,a.useEffect)(()=>
1(rD=es,()=>{rD=!1}),[es]);let[em,ef]=(0,a.useState)(!1),[ev,ey]=(0,a.useState)(tS),eb=(0,a.useRef)(tS),[ek,ej]=(0,a.useState)(""),eI=e=>{eb.current=e,ey(e),tj={...tj,...e},tL()},eA=e=>{ej(e),function(e){let t=e.trim();if(t===tI)return;if(tI=t,tR+=1,tA=null,tP={width:0,height:0},!t)return tL();let n=tR,r=new Image;r.crossOrigin="anonymous",r.onload=()=>{n===tR&&(!function(e){let t=Math.max(1,e.naturalWidth||e.width),n=Math.max(1,e.naturalHeight||e.height),r=document.createElement("canvas");r.width=t,r.height=n;let i=r.getContext("2d");if(!i)return;i.drawImage(e,0,0,t,n);let{data:a}=i.getImageData(0,0,t,n),o=new Uint8Array(t*n);for(let e=0;e<o.length;e++){let t=4*e;o[e]=Math.round(.299*a[t]+.587*a[t+1]+.114*a[t+2])}tA=o,tP={width:t,height:n}}(r),tL())},r.onerror=()=>{n===tR&&(tA=null,tP={width:0,height:0},tL())},r.src=t}(e)};(0,a.useEffect)(()=>{var e;return e=()=>{let e=tj;eb.current=e,ey({...e}),ej(tI)},tE.add(e),()=>tE.delete(e)},[]);let[eP,eR]=(0,a.useState)(!1),[eD,eT]=(0,a.useState)(na),eB=(0,a.useRef)(na),eF=e=>{eB.current=e,eT(e),no={...no,...e}};return(0,a.useEffect)(()=>{let e=n.current;if(!e)return;let t=!1,r=()=>{var e;return e=window.innerWidth,S.current.ballGoal&&!(e<=eS.PU)},i=S.current.markerShadow,a=new eg.Z58,l=E.current,s=new eg.ubm(l.fov,window.innerWidth/window.innerHeight,1,5e3);s.position.set(0,0,l.cameraZ),s.lookAt(0,0,0);let d=window.innerWidth<=eS.PU,h=new ex.WebGLRenderer({alpha:!0,antialias:!d,preserveDrawingBuffer:!0,powerPreference:d?"low-power":"default"});h.setSize(window.innerWidth,window.innerHeight),h.setPixelRatio(d?1:Math.min(window.devicePixelRatio,2)),h.setClearColor(0,0),h.outputColorSpace=eg.er$,i&&(h.shadowMap.enabled=!0,h.shadowMap.type=eg.QP0),e.appendChild(h.domElement),o.current=h;let m=O.current,f=new eg.$p8(0xffffff,m.ambientIntensity);a.add(f),Y.current=f;let y=new eg.ZyN(0xffffff,1);y.layers.enable(1);let k=null;i?(!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e_;e.shadow.mapSize.set(2048,2048),tc(e,n),t&&tt(e,{...t,padding:n.frustumPadding})}(y,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,fovDeg:l.fov,cameraZ:l.cameraZ},m),tn(a,y),k=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e_,t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e_.receiveOpacity;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.2,t={blueColor:{value:eV.clone()},blueMix:{value:.65},baseOpacity:{value:e},casterCenters:{value:Array(16).fill(0)},casterCount:{value:0},coreRadius:{value:78},coreDarkness:{value:.72},innerCoreRadiusScale:{value:.5},innerCoreDarkness:{value:.58}},n=new eg.q2({color:0xffffff,opacity:e});return n.chromaticUniforms=t,n.customProgramCacheKey=()=>"chromatic-shadow-receive-v13",n.onBeforeCompile=e=>{Object.assign(e.uniforms,t),e.vertexShader="varying vec3 vWorldPos;\n"+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include <begin_vertex>","#include <begin_vertex>\n{\n	vec4 chromaticWorldPos = vec4( transformed, 1.0 );\n	#ifdef USE_BATCHING\n		chromaticWorldPos = batchingMatrix * chromaticWorldPos;\n	#endif\n	#ifdef USE_INSTANCING\n		chromaticWorldPos = instanceMatrix * chromaticWorldPos;\n	#endif\n	vWorldPos = ( modelMatrix * chromaticWorldPos ).xyz;\n}"),e.fragmentShader="uniform vec3 blueColor;\nuniform float blueMix;\nuniform float baseOpacity;\nuniform float casterCenters[".concat(16,"];\nuniform int casterCount;\nuniform float coreRadius;\nuniform float coreDarkness;\nuniform float innerCoreRadiusScale;\nuniform float innerCoreDarkness;\nvarying vec3 vWorldPos;\n")+e.fragmentShader,e.fragmentShader=e.fragmentShader.replace("gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );","#if NUM_DIR_LIGHT_SHADOWS > 0\n	float shadowBlue = 1.0 - getShadowMask();\n	float proximityOuter = 0.0;\n	float proximityInner = 0.0;\n	for ( int i = 0; i < ".concat(8,"; i ++ ) {\n		if ( i >= casterCount ) break;\n		vec2 casterCenter = vec2(\n			casterCenters[i * 2],\n			casterCenters[i * 2 + 1]\n		);\n		float d = length( vWorldPos.xy - casterCenter );\n		proximityOuter = max(\n			proximityOuter,\n			1.0 - smoothstep( 0.0, coreRadius, d )\n		);\n		proximityInner = max(\n			proximityInner,\n			1.0 - smoothstep(\n				0.0,\n				coreRadius * innerCoreRadiusScale,\n				d\n			)\n		);\n	}\n	float centerBoost =\n		1.0\n		+ coreDarkness * proximityOuter\n		+ innerCoreDarkness * proximityInner;\n	float shadowStrength = clamp(\n		shadowBlue * blueMix * centerBoost * baseOpacity,\n		0.0,\n		1.0\n	);\n	// White-lit RT factors for trail composite multiply (not transparent tint).\n	vec3 tintedDark = mix( vec3( 1.0 ), blueColor, shadowStrength );\n	vec3 multiply = mix( vec3( 1.0 ), tintedDark, shadowStrength );\n	gl_FragColor = vec4( multiply, 1.0 );\n#else\n	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n#endif"))},n}(e)}(e.receiveOpacity);eX(t,e.shadowColorR,e.shadowColorG,e.shadowColorB,e.shadowColorMix);let n=new eg.eaF(new eg.bdM(2400,2400),t);return n.name="marker-shadow-receiver",n.position.z=e.receiverPlaneZ,n.receiveShadow=!0,n.frustumCulled=!1,n.layers.set(1),n}(m),a.add(k),tc(y,m,k,f)):(tc(y,m,null,f),tn(a,y));let M=new eg.ZyN(0xffffff,.6);M.position.set(-.7,-.4,.6),a.add(M);let j=new eg.ZyN(0xffffff,1);a.add(j),a.add(j.target),V.current=j;let I=e=>{var t,n,r,i;let a=V.current;if(!a)return;let o=window.innerWidth,l=window.innerHeight,s=E.current,c=ik(-o*e.offscreenX,l*(1+e.offscreenY),o,l,s.fov,s.cameraZ),d=ik(.5*o,.5*l,o,l,s.fov,s.cameraZ);t=c.x,n=c.y,r=d.x,i=d.y,a.intensity=e.intensity,a.color.setRGB(e.colorR/255,e.colorG/255,e.colorB/255),a.color.convertSRGBToLinear(),a.position.set(t,n,e.z),a.target.position.set(r,i,0),a.target.updateMatrixWorld()};X.current=I,I(q.current);let A=()=>window.scrollY,P={current:iw(window.innerWidth)},R=e=>({x:e.pos.x,y:e.pos.y-A()}),L=[],z=0,D=[],T=0,B=0,F=!1,W=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0;if((null==n?void 0:n.some(e=>e.goalNetCatchActive))||T>=1)return;let r=performance.now();!(r-B<100)&&ie(e,t)&&(T+=1,B=r)},G=null,U=null,H=!1,$=null,_=null,Z=null,J=null,K=new eg.NRn,Q=null,et=new eg.kn4,en=new eg.Pq0,er=new eg.Pq0,ei=new eg.Pq0,ea=new eg.Pq0,eo=new eg.Pq0,el=new eg.Pq0,es=new eg.Pq0,ec=new eg.Pq0,ed=new eg.NRn,eu=new eg.kn4,eh=new eg.Pq0,ep=new eg.Pq0,em=new eg.Pq0,ef=new eg.Pq0,ev=new eg.Pq0,ey=new eg.Pq0,eb=new eg.Pq0,ek=new eg.Pq0,eM=new eg.Pq0,ej=new eg.Pq0,eI=[],eA=null,eP=new eg.NRn,eR=new eg.Pq0(0,0,1),eE=new eg.Pq0,eL=new eg.Pq0,ez=e=>{e.onBeforeCompile=e=>{e.uniforms.uBallCount={value:0},e.uniforms.uBallCenters={value:Array.from({length:8},()=>new eg.Pq0)},e.uniforms.uBallDirs={value:Array.from({length:8},()=>new eg.Pq0)},e.uniforms.uBallPush={value:Array(8).fill(0)},e.uniforms.uBallRadii={value:Array(8).fill(0)},e.vertexShader=e.vertexShader.replace("#include <common>","#include <common>\nuniform int uBallCount;\nuniform vec3 uBallCenters[".concat(8,"];\nuniform vec3 uBallDirs[").concat(8,"];\nuniform float uBallPush[").concat(8,"];\nuniform float uBallRadii[").concat(8,"];")),e.vertexShader=e.vertexShader.replace("#include <begin_vertex>","#include <begin_vertex>\nfor (int gi = 0; gi < ".concat(8,"; gi++) {\n  if (gi >= uBallCount) break;\n  vec3 gDelta = transformed - uBallCenters[gi];\n  float gDist = length(gDelta);\n  float gR = uBallRadii[gi];\n  if (gR <= 0.0) continue;\n  float gInfluence = 1.0 - smoothstep(gR, gR * ").concat("2.2",", gDist);\n  if (gInfluence > 0.0) {\n    transformed += uBallDirs[gi] * uBallPush[gi] * gInfluence;\n  }\n  vec3 gDelta2 = transformed - uBallCenters[gi];\n  float gDist2 = length(gDelta2);\n  if (gDist2 < gR) {\n    vec3 gDir2 = gDist2 > 1e-4 ? gDelta2 / gDist2 : vec3(0.0, 0.0, -1.0);\n    transformed = uBallCenters[gi] + gDir2 * gR;\n  }\n}")),Q=e.uniforms},e.customProgramCacheKey=()=>"goal-net-deform-v2",e.needsUpdate=!0},eD=e=>{},eT=(e,t)=>
1{i&&k&&(th(e.modelGroup),e6(e.group),G&&tu(G.mesh,t.ballCastShadow))},eB=e=>{if(i&&k&&G){var t;tu(G.mesh,e.ballCastShadow),tr(t=G.mesh),th(t)}},eF=()=>{_&&(tu(_,!1),_.traverse(e=>{e instanceof eg.eaF&&(e.castShadow=!1,delete e.customDepthMaterial)}))},eW=e=>{if(!G||!U||e.instanceSlot>=0)return;let{modelAnchor:t,meshPivot:n}=function(e){let t=new eg.YJl;t.position.copy(e.modelRoot.position),t.quaternion.copy(e.modelRoot.quaternion),t.scale.copy(e.modelRoot.scale);let n=new eg.YJl;return n.position.copy(e.mesh.position),n.quaternion.copy(e.mesh.quaternion),n.scale.copy(e.mesh.scale),t.add(n),{modelAnchor:t,meshPivot:n}}(U);e.modelGroup.add(t),e.meshPivot=n;let r=function(e,t){if(e.uidToSlot.has(t))return e.uidToSlot.get(t);let n=e.freeSlots.pop();return null==n?null:(e.uidToSlot.set(t,n),e.slotToUid[n]=t,n)}(G,e.uid);null!=r&&(e.instanceSlot=r,r_(G,[{instanceSlot:e.instanceSlot,meshPivot:e.meshPivot,visible:e.group.visible}]))},eN=(e,t)=>{let n=new eg.YJl,r=new eg.YJl;n.add(r),n.visible=!1,a.add(n);let i={uid:z++,group:n,modelGroup:r,pos:{x:e,y:t},vel:{x:0,y:0},z:0,vz:0,squeeze:0,squeezeSeed:100*Math.random(),materialUniforms:[],wallsActive:!1,lastScreen:{x:e,y:t-A()},goalInNet:!1,goalWorldDelta:0,goalWorldDirX:0,goalWorldDirY:0,goalWorldDirZ:0,goalNetCatchActive:!1,instanceSlot:-1,meshPivot:null};return H&&(eW(i),i.group.visible=!0,eT(i,O.current)),L.push(i),eD(i),i},eG=(e,t)=>{let n=ee.current,r=Math.abs(e)*(.11/P.current);return id(n.corRealLow-n.corSlopePerMs*r,n.corRealHigh,n.corRealLow)*t},eU=(e,t)=>{let n=ee.current;if(t<=n.liftMinDelta)return;let r=Math.min(n.liftVzK*Math.sqrt(t-n.liftMinDelta),n.liftMaxVz);e.vz=Math.max(e.vz,r)},eZ=()=>{let e=window.innerWidth,t=window.innerHeight;return iw(e),E.current.ballScale,eN(.78*e,A()+.55*t)},eJ=e=>{let t=window.innerWidth,n=window.innerHeight,r=P.current,i=A(),a=eN(id(e+(Math.random()-.5)*t*.22,r,t-r),i+n+r+.42*n);return a.vel.x=(Math.random()-.5)*550,a.vel.y=-(.25*(2400+1800*Math.random())),a.vz=(850+750*Math.random())*.25,a.lastScreen=R(a),a},eK=v.current,eQ=window.innerWidth;iw(eQ),E.current.ballScale,eN(.78*eQ,A()+3*window.innerHeight);let e0=new rV(a,s,h.domElement,{scrollBase:A,ballRadiusPx:()=>P.current,cameraFov:()=>E.current.fov,cameraZ:()=>E.current.cameraZ,disabled:()=>b.current||!S.current.markerPens}),e1=e=>{if(i&&k){for(let t of(tc(y,e,k,f),tt(y,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,fovDeg:E.current.fov,cameraZ:E.current.cameraZ,padding:e.frustumPadding}),L))eT(t,e);eB(e),e0.setPenShadowCast(e.penCastShadow),e0.enableShadowCompositeLayers(),eF()}};for(let e of(N.current=e1,e1(O.current),L))eD(e);eD=e=>{G&&e.meshPivot&&e0.registerBallInkSurface(e.uid,e.meshPivot,G.geometry)};let e2=null,e5=!1,e3=e=>null!=e.meshPivot&&e.modelGroup.children.length>0,e4=e=>S.current.markerPens&&(0,rt.o)()&&e.uid!==e2,e9={y:A()},e7=0,te=!1,ti=0,ta=new eY.Z;ta.setDecoderPath("/draco/");let to=new eO.B;to.setDRACOLoader(ta),Promise.all([tZ(to,t$),tZ(to,"/images/usmnt/yellow.glb"),rR(to,rI),rR(to,"/images/usmnt/yellowcap.glb")]).then(e=>{let[n,r,i,a]=e;t||(e0.setPenTemplates(n,r),e0.setCapMeshes(i,a),e1(O.current))}).catch(e=>{console.warn("[SoccerBall] Could not load marker pen/cap models",e)}),to.load("/images/usmnt/soccer.glb",e=>{if(t)return;let n=e.scene,r=new eg.NRn().setFromObject(n,!0),i=r.getSize(new eg.Pq0),o=r.getCenter(new eg.Pq0),l=Math.max(i.x,i.y,i.z)/2,s=l>0?1/l:1;if(n.position.sub(o).multiplyScalar(s),n.scale.setScalar(s),tV(n,tH),n.traverse(e=>{if(e instanceof eg.eaF)for(let t of Array.isArray(e.material)?e.material:[e.material])t.transparent=!1,t.depthWrite=!0,t.depthTest=!0}),!(G=function(e,t){let n=r$(e);if(!n)return null;let r=n.geometry,i=n.material,a=new eg.ZLX(r,i,500);a.name="soccer-ball-instancer",a.frustumCulled=!1,a.count=500;let o=new Int32Array(t).fill(-1),l=[];for(let e=t-1;e>=0;e--)l.push(e);for(let e=0;e<t;e++)a.setMatrixAt(e,rX);return a.instanceMatrix.needsUpdate=!0,{mesh:a,geometry:r,material:i,maxCount:t,uidToSlot:new Map,slotToUid:o,freeSlots:l,hiddenMatrix:rX.clone()}}(n,500)))return void console.warn("[SoccerBall] Could not create ball instancer");let c=r$(n);if(!c)return void console.warn("[SoccerBall] Could not find ball draw mesh");for(let e of(U={modelRoot:{position:n.position.clone(),quaternion:n.quaternion.clone(),scale:n.scale.clone()},mesh:{position:c.position.clone(),quaternion:c.quaternion.clone(),scale:c.scale.clone()}},a.add(G.mesh),e6(G.mesh),eB(O.current),e0.registerBallInstancer(G.mesh,e=>G?function(e,t){if(t<0||t>=e.maxCount)return null;let n=e.slotToUid[t];return n>=0?n:null}(G,e):null),H=!0,L))eW(e),e.group.visible=!0,eT(e,O.current),eD(e);e1(O.current),w(!0)}),r()&&to.load("/images/usmnt/goal.glb",e=>{if(t)return;let n=e.scene;n.updateMatrixWorld(!0);let r=new eg.NRn().setFromObject(n),o=r.getSize(new eg.Pq0),l=r.getCenter(new eg.Pq0),s=1/(Math.max(o.x,o.y,o.z)||1);n.scale.multiplyScalar(s),n.position.copy(l).multiplyScalar(-s),(_=new eg.YJl).add(n),($=new eg.YJl).add(_),a.add($),n.traverse(e=>{var t;if(!(e instanceof eg.eaF))return;e.frustumCulled=!1;let n=e.name.toLowerCase();if("bounds"===n){Z=e,e.visible=!1;let t=e.geometry;t.computeBoundingBox(),eP.copy(t.boundingBox);let n=eP.getCenter(new eg.Pq0),r=t.attributes.position,i=t.index,a=new Map;if(r&&i)for(let e=0;e<i.count;e+=3){ey.fromBufferAttribute(r,i.getX(e)),eb.fromBufferAttribute(r,i.getX(e+1)),ek.fromBufferAttribute(r,i.getX(e+2)),eg.lMl.getNormal(ey,eb,ek,ef);let t=[ef.x.toFixed(4),ef.y.toFixed(4),ef.z.toFixed(4)].join(",");if(a.has(t))continue;let o=new eg.Zcv().setFromNormalAndCoplanarPoint(ef,ey);0>o.distanceToPoint(n)&&o.negate(),a.set(t,o)}eI.push(...a.values());let o=.92;for(let e of eI){let t=Math.max(-e.normal.y,-e.normal.z);t>o&&(o=t,eA=e)}let l=[new eg.Pq0(1,0,0),new eg.Pq0(-1,0,0),new eg.Pq0(0,1,0),new eg.Pq0(0,-1,0),new eg.Pq0(0,0,1),new eg.Pq0(0,0,-1)],s=[];for(let e of l)eI.some(t=>t.normal.dot(e)>.92)||s.push(e.clone().negate());s.length>0&&(s.sort((e,t)=>
1Math.abs(t.z)-Math.abs(e.z)||Math.abs(t.y)-Math.abs(e.y)),eR.copy(s[0]));return}let r=Array.isArray(e.material)?"":null!=(t=e.material.name)?t:"";if(n.includes("net")||r.toLowerCase().includes("net"))for(let t of(J=e,e.geometry.computeBoundingBox(),e.geometry.boundingBox&&K.copy(e.geometry.boundingBox),Array.isArray(e.material)?e.material:[e.material]))t.side=eg.$EB,S.current.goalNetShader&&ez(t);S.current.markerPens&&"bounds"!==n&&e0.registerDrawOccluder(e)}),i&&eF()});let tp=()=>void(iR=null);window.addEventListener("resize",tp);let tm=()=>{if(!$||!_)return;if(!r()){$.visible=!1;return}let e=E.current,t=window.innerWidth,n=window.innerHeight,i=((e,t,n,r)=>{if(!iA())return null;let i=n+140+r,a=Math.min(1,Math.max(0,(e-(iA()?(null==iR&&(iR=iP()),iR):(iR=null,iP())))/Math.max(+n,1)));return i+(n*t-i)*(1-(1-id(a,0,1))**3)})(A(),e.lastScreenFrac,n,e.ty);if($.visible=null!=i,null==i)return;let a=ik(t/2+e.tx,i-e.ty,t,n,e.fov,e.cameraZ);$.position.set(a.x,a.y,e.tz),_.rotation.set(e.rotX*Math.PI/180,e.rotY*Math.PI/180,e.rotZ*Math.PI/180),_.scale.setScalar(e.scale),$.updateWorldMatrix(!0,!0)},tf=e=>-e.normal.dot(eL)>.85,tg=(e,t,n,r,i,a)=>{if(0===eI.length)return{hit:!1,wallContact:!1,vwx:r,vwy:i,vwz:a};e.updateWorldMatrix(!0,!1),eu.copy(e.matrixWorld).invert(),eh.copy(t).applyMatrix4(eu),ev.setFromMatrixScale(e.matrixWorld);let o=n/(Math.max(ev.x,ev.y,ev.z)||1),l=o+.01;if(!((e,t)=>{let n=1.5*t;for(let t of[{p:e.x,min:eP.min.x,max:eP.max.x,open:Math.abs(eR.x)>.85,frontSign:Math.sign(eR.x),down:eL.x},{p:e.y,min:eP.min.y,max:eP.max.y,open:Math.abs(eR.y)>.85,frontSign:Math.sign(eR.y),down:eL.y},{p:e.z,min:eP.min.z,max:eP.max.z,open:Math.abs(eR.z)>.85,frontSign:Math.sign(eR.z),down:eL.z}])if(t.open){let e=t.frontSign>0?t.min:t.max,r=t.frontSign>0?t.max:t.min;if(t.frontSign*t.p<t.frontSign*e-n||t.frontSign*t.p>t.frontSign*r+2*n)return!1}else if(Math.abs(t.down)>.85){if(t.down>0){if(t.p<t.min-n)return!1}else if(t.p>t.max+n)return!1}else if(t.p<t.min-n||t.p>t.max+n)return!1;return!0})(eh,o)&&!((e,t)=>{if(!eA)return!1;let n=eA.distanceToPoint(e);if(n>.25*t||n<-(2.5*t))return!1;let r=1.5*t,i=eA.normal;return Math.abs(i.y)>.85?e.x>=eP.min.x-r&&e.x<=eP.max.x+r&&e.z>=eP.min.z-r&&e.z<=eP.max.z+r:Math.abs(i.z)>.85?e.x>=eP.min.x-r&&e.x<=eP.max.x+r&&e.y>=eP.min.y-r&&e.y<=eP.max.y+r:e.y>=eP.min.y-r&&e.y<=eP.max.y+r&&e.z>=eP.min.z-r&&e.z<=eP.max.z+r})(eh,o))return{hit:!1,wallContact:!1,vwx:r,vwy:i,vwz:a};let s=!1,c=!1,d=1/0;for(let e=0;e<4;e++)for(let e of eI){if(tf(e))continue;let t=e.distanceToPoint(eh);if(e===eA&&t<0){if(t<=-l)continue;eh.addScaledVector(e.normal,-l-t),t<d&&(d=t),s=!0;continue}t>=l||t<=-l||(eh.addScaledVector(e.normal,l-t),t<d&&(d=t),s=!0)}if(!s)return{hit:!1,wallContact:!1,vwx:r,vwy:i,vwz:a};for(let e of eI)if(!tf(e)&&e.distanceToPoint(eh)<1.2*l){c=!0;break}t.copy(eh).applyMatrix4(e.matrixWorld);let u=null;for(let e of(d=1/0,eh.copy(t).applyMatrix4(eu),eI)){if(tf(e))continue;let t=e.distanceToPoint(eh);t<d&&(d=t,u=e)}let h=r,p=i,m=a;if(u){ef.copy(u.normal).multiplyScalar(-1),ef.transformDirection(e.matrixWorld).normalize();let t=h*ef.x+p*ef.y+m*ef.z;t>0&&(h-=t*ef.x,p-=t*ef.y,m-=t*ef.z)}return{hit:!0,wallContact:c,vwx:h,vwy:p,vwz:m}},tx={active:!1,ball:null,pointerId:-1,offsetX:0,offsetY:0,pointerX:0,pointerY:0,startX:0,startY:0,moved:!1},ty=e=>{let t=L.indexOf(e);if(t<0)return;let n=g.current;"idle"!==n.phase&&e.uid===n.ballUid&&x.current(eC()),tx.active&&tx.ball===e&&(tY(tx.moved),tG()),a.remove(e.group),e.group.traverse(e=>{if(e instanceof eg.eaF)for(let t of Array.isArray(e.material)?e.material:[e.material])null==t||t.dis
1pose()}),G&&e.instanceSlot>=0&&function(e,t){let n=e.uidToSlot.get(t);null!=n&&(e.uidToSlot.delete(t),e.slotToUid[n]=-1,e.freeSlots.push(n),e.mesh.setMatrixAt(n,e.hiddenMatrix),e.mesh.instanceMatrix.needsUpdate=!0)}(G,e.uid),e0.unregisterBall(e.uid),L.splice(t,1)},tw=null,tb=null,tk=()=>{let e=document.getElementById("aj1-main-footer"),t=document.getElementById("usmnt-footer-foil");if(!e){tw=null,tb=null;return}let n=e.getBoundingClientRect();if(n.width<=0||n.height<=0){tw=null,tb=null;return}tb=n;let r=null==t?void 0:t.getBoundingClientRect(),i=r&&r.width>0&&r.height>0?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ew;return{x:e.left+e.width*t.u,y:e.top+e.height*(1-t.v)}}(r):{x:n.left+.5*n.width,y:n.top+.5*n.height};tw={x:i.x,docY:A()+i.y}},tC=e=>{if(!tw||e.z>6||e.squeeze>.08)return!1;let t=.5*Math.min(window.innerWidth,window.innerHeight)*.15,n=e.pos.x-tw.x,r=e.pos.y-tw.docY;return n*n+r*r<=t*t},tM=e=>{let t=g.current;return"idle"!==t.phase&&e.uid===t.ballUid},tS=e=>{let t=g.current;return"consume"===t.phase&&e.uid===t.ballUid},tj=e=>{tw&&(e.pos.x=tw.x,e.pos.y=tw.docY,e.vel.x=0,e.vel.y=0)},tI=e=>e<=.45?1:1-ii((e-.45)/.55),tA=(e,t,n,r)=>{if(g.current,tM(e))return;let i=window.innerWidth,a=window.innerHeight,o=P.current,l=A(),{pos:s,vel:c}=e;if(!e.wallsActive){let t=R(e);t.x>=o&&t.x<=i-o&&t.y>=o&&t.y<=a-o&&(e.wallsActive=!0)}if(tx.active&&tx.ball===e){let n=e.wallsActive?id(tx.pointerX+tx.offsetX,o,i-o):tx.pointerX+tx.offsetX,r=e.wallsActive?id(l+tx.pointerY+tx.offsetY,l+o,l+a-o):l+tx.pointerY+tx.offsetY;t>0&&(c.x=id((n-s.x)/t,-10200,10200),c.y=id((r-s.y)/t,-10200,10200)),s.x=n,s.y=r;let d=E.current,u=1-Math.exp(-d.grabLiftRate*t);e.z+=(d.grabLiftTarget-e.z)*u,e.vz=0;let h=1-Math.exp(-d.grabSqueezeRate*t);e.squeeze+=(1-e.squeeze)*h}else{let d=E.current.grabSqueezeRate;if(e.squeeze*=Math.exp(-d*t),e.squeeze<.002&&(e.squeeze=0),e.wallsActive&&(c.y+=r),tw&&tb){let n=R(e),r=2.4*o,i=id(n.x,tb.left,tb.right),a=id(n.y,tb.top,tb.bottom),l=Math.hypot(n.x-i,n.y-a);if(l<=r){let n=tw.x-s.x,i=tw.docY-s.y,a=Math.hypot(n,i);if(a>.45*o){let s=id(1-l/r,0,1),d=1800*s*id(a/Math.max(.38*tb.height,2*o),.22,1)*(tC(e)?3.2:1);c.x+=n/a*d*t,c.y+=i/a*d*t}}}if(s.x+=c.x*t,s.y+=c.y*t,e.z>0||0!==e.vz){let n=ee.current;e.vz>n.liftMaxVz&&(e.vz=n.liftMaxVz),e.vz-=n.liftGravity*t,e.z+=e.vz*t,e.z<=0&&(e.z=0,e.vz=-e.vz*eG(e.vz,n.groundCorFactor),e.vz<n.liftRestVz&&(e.vz=0))}let u=ee.current,h=Math.hypot(c.x,c.y);if(h>0){let e=h*Math.exp(-u.frictionPerSecond*t),n=(e=Math.max(0,e-u.stopDecel*t))>1?e/h:0;c.x*=n,c.y*=n}if(e.wallsActive){if(s.x<o){if(s.x=o,c.x<0){let t=-c.x,n=eG(c.x,u.wallCorFactor);eU(e,t*(1+n)),c.x=-c.x*n,W(t,.72,[e])}}else if(s.x>i-o&&(s.x=i-o,c.x>0)){let t=c.x,n=eG(c.x,u.wallCorFactor);eU(e,t*(1+n)),c.x=-c.x*n,W(t,.72,[e])}let t=l+o,r=l+a-o;if(s.y<t){s.y=t;let r=c.y-n;if(r<0){let t=-r,i=eG(r,u.wallCorFactor);eU(e,t*(1+i)),c.y=n-r*i,W(t,.72,[e])}}else if(s.y>r){s.y=r;let t=c.y-n;if(t>0){let r=eG(t,u.wallCorFactor);eU(e,t*(1+r)),c.y=n-t*r,W(t,.72,[e])}}}let p=Math.hypot(c.x,c.y);if(p>10200){let e=10200/p;c.x*=e,c.y*=e}}},tP=new eg.Pq0,tR=new eg.PTz,tE=e=>{let t=P.current,n=R(e),r=n.x-e.lastScreen.x,i=n.y-e.lastScreen.y;e.lastScreen.x=n.x,e.lastScreen.y=n.y;let a=Math.hypot(r,i);a<.05||(tP.set(i,r,0).normalize(),tR.setFromAxisAngle(tP,a/t),e.modelGroup.quaternion.premultiply(tR))},tL=[],tz=(e,t)=>{let n=performance.now();for(tL.push({t:n,x:e,y:t});tL.length>0&&n-tL[0].t>200;)tL.shift()},tD=()=>{let e=performance.now(),t=tL.filter(t=>e-t.t<=100);if(t.length<2)return{vx:0,vy:0};let n=t[0],r=t[t.length-1],i=(r.t-n.t)/1e3;return i<=.005?{vx:0,vy:0}:{vx:(r.x-n.x)/i,vy:(r.y-n.y)/i}},tT=()=>{window.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()},{capture:!0,once:!0})},tB=null,tF=e=>{document.body.style.userSelect=e?"none":"",e?(tB||((tB=document.createElement("div")).setAttribute("aria-hidden","true"),tB.dataset.usmntDragShield="true",Object.assign(tB.style,{position:"fixed",inset:"0",zIndex:"9999",pointerEvents:"auto",background:"transparent"}),document.body.appendChild(tB)),tB.style.display="block",tO(!0)):tB&&(tB.style.display="none",tO(!1)),S.current.markerPens&&e0.shouldHideSystemCursor(
1)?(document.documentElement.style.cursor="none",tB&&(tB.style.cursor="none")):e&&(document.documentElement.style.cursor="grabbing",tB&&(tB.style.cursor="grabbing"))},tW=null,tO=e=>{p.current(e),e&&window.dispatchEvent(new Event(eH))},tY=e=>{e?(tO(!0),null!=tW&&clearTimeout(tW),tW=window.setTimeout(()=>{tO(!1),tW=null},2e3)):(null!=tW&&(clearTimeout(tW),tW=null),tO(!1))},tN=()=>{if(!S.current.markerPens)return;if(!(0,rt.o)()){for(let e of(e2=null,e5=!1,L))e3(e)&&(e.group.visible=!0);return}let e=!e5;for(let t of(e5=!0,0===L.length?e2=eZ().uid:(e||null==e2||!L.some(e=>e.uid===e2))&&(e2=(()=>{let e=L.filter(e3),t=e.length>0?e:L,n=.5*window.innerWidth,r=.5*window.innerHeight,i=t[0],a=1/0;for(let e of t){let t=R(e),o=Math.hypot(t.x-n,t.y-r);o<a&&(i=e,a=o)}return i})().uid),L))e3(t)&&(t.group.visible=t.uid===e2);tx.active&&tx.ball&&tx.ball.uid!==e2&&(tY(!1),tG())},tG=(e,t)=>{tx.active=!1,tx.ball=null,tx.pointerId=-1,tF(!1),null!=e&&null!=t?tq(e,t):document.documentElement.style.cursor=r9()},tU=(e,t,n)=>{let r=P.current,i=null,a=1/0;for(let o of L){if(e4(o))continue;let l=R(o),s=Math.hypot(e-l.x,t-l.y);s<=r*n&&s<a&&(i=o,a=s)}return i},tq=(e,t)=>{if(tx.active||e0.isDragging())return;if(b.current){document.documentElement.style.cursor=r9();return}if(S.current.markerPens&&e0.shouldShowCapDismissPointer(e)){document.documentElement.style.cursor="pointer";return}if(S.current.markerPens&&e0.isPointerOverCap(e,t)){document.documentElement.style.cursor=rA;return}if(S.current.markerPens&&e0.shouldHideSystemCursor()){document.documentElement.style.cursor="none";return}let n=H&&null!=tU(e,t,1.05);document.documentElement.style.cursor=n?"pointer":r9()},tX=e=>e instanceof Element&&(null!=e.closest("[data-soccer-shadow-panel]")||null!=e.closest("[data-marker-streak-panel]")||null!=e.closest("[data-marker-ground-panel]")),t_=()=>{tF(tx.active||e0.dragHasMoved())},tJ=()=>{tx.active||e0.isDragging()||(document.body.style.userSelect="")},tK=e=>{e0.isMarkerInteractionEnabled()&&(tX(e.target)||e.preventDefault())},tQ=e=>{e0.isDragging()&&(tX(e.target)||e.preventDefault())},t0=e=>{if(tX(e.target)||(0,tv.te)(e.target)||C.current||(F||(F=!0,rQ(),rb()),tz(e.clientX,e.clientY),!e.isPrimary||b.current))return;if(S.current.markerPens&&e0.tryDismissZonePointerDown(e)||S.current.markerPens&&e0.tryCapPointerDown(e)){e1(O.current),document.documentElement.style.cursor=r9(),e.preventDefault();return}let t=H?tU(e.clientX,e.clientY,1.05):null;if(t){S.current.markerPens&&e0.unpark();let n=g.current;"idle"!==n.phase&&t.uid===n.ballUid&&x.current(eC()),tx.active=!0,tx.ball=t,tx.pointerId=e.pointerId,tx.offsetX=t.pos.x-e.clientX,tx.offsetY=t.pos.y-A()-e.clientY,tx.pointerX=e.clientX,tx.pointerY=e.clientY,tx.startX=e.clientX,tx.startY=e.clientY,tx.moved=!1,tO(!0),tF(!0),S.current.markerPens&&e0.isMarkerInteractionEnabled()&&e0.tryPointerDown(e,!0)&&(document.body.style.userSelect="none"),e.preventDefault();return}if(S.current.markerPens&&e0.isMarkerInteractionEnabled()&&e0.tryPointerDown(e)){document.body.style.userSelect="none";return}},t1=-1,t2=-1,t5=e=>{var t,n;if(C.current)return;"mouse"===e.pointerType&&(t1=e.clientX,t2=e.clientY),tz(e.clientX,e.clientY),S.current.markerPens&&(e0.handlePointerMove(e.clientX,e.clientY),t=e.clientX,n=e.clientY,!S.current.markerPens||!e0.isMarkerInteractionEnabled()||e0.isCapAttractActive()||tx.active||e0.isDragging()||(H&&null!=tU(t,n,1.05)?e0.parkAtClient(t,n):e0.unpark()));let r=S.current.markerPens&&e0.tryPointerMove(e),i=tx.active&&e.pointerId===tx.pointerId;if(i&&(tx.pointerX=e.clientX,tx.pointerY=e.clientY,Math.hypot(e.clientX-tx.startX,e.clientY-tx.startY)>6&&(tx.moved=!0)),r||i){e.cancelable&&e.preventDefault(),r&&e0.dragHasMoved()&&t_();return}e.isPrimary&&tq(e.clientX,e.clientY)},t3=e=>{"mouse"!==e.pointerType||tx.active||e0.isDragging()||null==e.relatedTarget&&(S.current.markerPens&&e0.shouldHideSystemCursor()?document.documentElement.style.cursor="none":document.documentElement.style.cursor=r9())},t4=e=>{(tx.active||e0.dragHasMoved())&&e.cancelable&&e.preventDefault()},t6=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!H||L.length>=500)return;let n=eN(e.pos.x,e.pos.y);n.wallsActive=e.wallsActive,n.modelGroup.quaternion.copy(e.modelGroup.quaternion);let r=Math.random()*Math.PI*2,i=Math.cos(r),a=Math.sin(r),o=e.vel.x,l=e.vel.y,s=3600*t;e.vel.x=3600*i,e.vel.y=3600*a,n.vel.x=-i*s,n.vel.y=-a*s,eU(e,Math.hypot(e.vel.x-o,e.vel.y-l)),eU(n,s),e1(O.current)},t8=e=>{if(tX(e.target))return;let t=e0.tryPointerUp(e),n=tx.active&&e.pointerId===tx.pointerId;if(t&&(t_(),tJ()),n){let n=tx.ball,r=tx.moved;tG(e.clientX,e.clientY),tY(r),r&&tT();let{vx:i,vy:a}=tD();if(tL=[],!n)return;if(!r)return void t6(n,.25);let o=Math.hypot(i,a);if(o>120){let e=Math.min(o*ee.current.kickGain,8400),t=n.vel.x,r=n.vel.y;n.vel.x=i/o*e,n.vel.y=a/o*e;let l=Math.hypot(n.vel.x-t,n.vel.y-r);eU(n,l),W(l)}else n.vel.x=0,n.vel.y=0;return void(t&&(t.moved&&tT(),tq(e.clientX,e.clientY)))}if(t){t.moved&&tT(),tq(e.clientX,e.clientY);return}if(!e.isPrimary||b.current||!H)return;let r=tU(e.clientX,e.clientY,1);if(!r){tL=[];return}let i=e.clientX-r.pos.x,a=R(r),o=e.clientY-a.y,{vx:l,vy:s}=tD();tL=[];let c=r.vel.x,d=r.vel.y,u=Math.hypot(l,s);if(u<120){let e=Math.hypot(i,o);if(e>1){let t=ee.current.tapKickSpeed;r.vel.x=-i/e*t,r.vel.y=-o/e*t}else{let e=Math.random()*Math.PI*2,t=ee.current.tapKickSpeed;r.vel.x=Math.cos(e)*t,r.vel.y=Math.sin(e)*t}}else{let e=id(u*ee.current.kickGain,420,8400);r.vel.x=l/u*e,r.vel.y=s/u*e}let h=Math.hypot(r.vel.x-c,r.vel.y-d);eU(r,h),W(h)},t9=e=>{let t=e0.tryPointerCancel(e),n=tx.active&&e.pointerId===tx.pointerId;if(t&&(t_(),tJ()),n){let t=tx.moved,n=tx.ball;tG(e.clientX,e.clientY),tY(t),n&&(n.vel.x=0,n.vel.y=0),tL=[]}};window.addEventListener("pointerdown",t0,{passive:!1,capture:!0}),window.addEventListener("pointermove",t5,{passive:!1}),window.addEventListener("pointerup",t8,{passive:!0}),window.addEventListener("pointercancel",t9,{passive:!0}),window.addEventListener("pointerout",t3),window.addEventListener("touchmove",t4,{passive:!1}),window.addEventListener("dragstart",tK,{capture:!0}),window.addEventListener("selectstart",tQ,{capture:!0});let t7=e=>{if(e.repeat)return;let t=e.target,n=t instanceof Element&&t.closest("input, textarea, select, [contenteditable='true'], [role='textbox']");if("z"===e.key.toLowerCase()&&(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey&&!n){e0.tryUndoInk()&&e.preventDefault();return}"b"!==e.key.toLowerCase()||e.metaKey||e.ctrlKey||e.altKey||n||(window.dispatchEvent(new Event(ia)),e.preventDefault())};window.addEventListener("keydown",t7);let ne=null,nt=!1,nn=A(),nr=(e,t)=>
1{for(let n of L)e8(n.modelGroup,e,t);S.current.markerPens&&e0.setShadowCastersPassWrite(e,t)},ni=()=>(ne||(ne=function(e,t){let n=!0,r=eq(e,t),i=eq(e,t),a=new eg.Z58,o=new eg.qUd(-1,1,1,-1,0,1),l=new eg.BKk({uniforms:{tAccum:{value:r.texture},tShadow:{value:i.texture},tAccumDepth:{value:r.depthTexture},tShadowDepth:{value:i.depthTexture}},vertexShader:"\n  varying vec2 vUv;\n  void main() {\n    vUv = uv;\n    gl_Position = vec4(position.xy, 0.0, 1.0);\n  }\n",fragmentShader:"\n  uniform sampler2D tAccum;\n  uniform sampler2D tShadow;\n  uniform sampler2D tAccumDepth;\n  uniform sampler2D tShadowDepth;\n  varying vec2 vUv;\n\n  void main() {\n    vec4 accum = texture2D(tAccum, vUv);\n    vec4 shadow = texture2D(tShadow, vUv);\n    float accumDepth = texture2D(tAccumDepth, vUv).x;\n    float shadowDepth = texture2D(tShadowDepth, vUv).x;\n\n    if (shadow.r > 0.999 && shadow.g > 0.999 && shadow.b > 0.999) {\n      gl_FragColor = accum;\n      return;\n    }\n\n    // Ball and ground receiver share z≈0 — depth delta is sub‑texel; alpha wins.\n    bool hasBall = accum.a > 0.004;\n    bool ballOccludes = accumDepth < shadowDepth + 0.001;\n    if (hasBall || ballOccludes) {\n      gl_FragColor = accum;\n      return;\n    }\n\n    vec3 multiplied = accum.rgb * shadow.rgb;\n    float shadowLift = 1.0 - min(\n      shadow.r,\n      min( shadow.g, shadow.b )\n    );\n    vec3 groundShadow = vec3( 1.0 ) - shadow.rgb;\n    vec3 outRgb = mix( groundShadow, multiplied, step( 0.002, accum.a ) );\n    float outAlpha = accum.a > 0.002 ? accum.a : shadowLift;\n    gl_FragColor = vec4( outRgb, outAlpha );\n  }\n",depthTest:!1,depthWrite:!1,transparent:!0}),s=new eg.eaF(new eg.bdM(2,2),l);return a.add(s),{markAccumClear:()=>{n=!0},resize:(e,t)=>{r.setSize(e,t),i.setSize(e,t)},render:(e,t,s,c,d)=>{e.setRenderTarget(r),e.setClearColor(0,0),n?(e.autoClear=!0,e.autoClearColor=!0,e.autoClearDepth=!0,e.clear(!0,!0,!0),n=!1):(e.autoClearColor=!1,e.autoClearDepth=!0),c(()=>e.render(t,s)),e.setRenderTarget(i),e.setClearColor(0xffffff,1),e.autoClear=!0,e.autoClearColor=!0,e.autoClearDepth=!0,e.clear(!0,!0,!0),d(()=>e.render(t,s)),l.uniforms.tAccum.value=r.texture,l.uniforms.tShadow.value=i.texture,l.uniforms.tAccumDepth.value=r.depthTexture,l.uniforms.tShadowDepth.value=i.depthTexture,e.setRenderTarget(null),e.setClearColor(0,0),e.autoClear=!0,e.autoClearColor=!0,e.autoClearDepth=!0,e.clear(!0,!0,!0),e.render(a,o)},dispose:()=>{var e,t;null==(e=r.depthTexture)||e.dispose(),null==(t=i.depthTexture)||t.dispose(),r.dispose(),i.dispose(),l.dispose(),s.geometry.dispose()}}}(h.domElement.width,h.domElement.height)),ne),na=()=>{let e=window.innerWidth,t=window.innerHeight;P.current=iw(e),h.setSize(e,t),s.aspect=e/t,s.updateProjectionMatrix(),null==ne||ne.resize(h.domElement.width,h.domElement.height);let n=P.current,r=A(),i=window.innerHeight;for(let e of L)e.wallsActive&&(e.pos.x=id(e.pos.x,n,window.innerWidth-n),e.pos.y=id(e.pos.y,r+n,r+i-n))};window.addEventListener("resize",na);let no=()=>{if(H&&!(L.length>=500)){if(0===L.length)return void eZ();t6(L[L.length-1],.25)}},nl=()=>{0!==L.length&&ty(L[L.length-1])},ns=e=>{if(!S.current.markerPens)return;let t=e.detail,n=e0.isCursorMarkerVisible();if(e0.handleSpawnEvent(t),e1(O.current),tN(),e0.isCursorMarkerVisible())r8=null,document.documentElement.style.cursor=e0.shouldHideSystemCursor()?"none":r9();else n&&(document.documentElement.style.cursor=r9())},nc=()=>{if(!S.current.markerPens)return;let e=e0.isCursorMarkerVisible();if(e0.handleFoilCycle(),e1(O.current),tN(),e0.isCursorMarkerVisible())r8=null,document.documentElement.style.cursor=e0.shouldHideSystemCursor()?"none":r9();else e&&(document.documentElement.style.cursor=r9())};window.addEventListener(ia,no),window.addEventListener(io,nl),window.addEventListener(tv.TN,ns),window.addEventListener(tv.yX,nc);let nd=()=>{tN(),e0.isCursorMarkerVisible()||(document.documentElement.style.cursor=r9())};window.addEventListener("usmnt-marker-open-change",nd);let nu=0,nh=performance.now(),np=()=>
1{if(C.current){nu=requestAnimationFrame(np);return}T=0;let e=performance.now(),t=id((e-nh)/1e3,0,.05);nh=e;let n=E.current;P.current=iw(window.innerWidth)*n.ballScale;let i=!b.current,o=performance.now();for(let e=eK.length-1;e>=0;e--)eK[e].atMs<=o&&(eJ(eK[e].screenX),eK.splice(e,1));if(i)for(let e of((e=>{let t=A(),n=e>0?(t-e9.y)/e:0;e9.y=t,n=id(n,-2600,2600);let i=0;{let e=45>=Math.abs(n)&&Math.abs(ti)>45,t=e&&Math.abs(ti)>=90;if(Math.abs(n)>=90)te=!0,Math.abs(n)>Math.abs(e7)&&(e7=n);else if(te)if(e){if(t){let e=ee.current;i=id(-e7*e.scrollMomentumTransfer,-e.scrollMomentumMax,e.scrollMomentumMax)}te=!1,e7=0}else 45>=Math.abs(n)&&45>=Math.abs(ti)&&(te=!1,e7=0);ti=n}for(let t of(tk(),L))e4(t)||tA(t,e,n,i);S.current.markerPens&&e0.step(e),(()=>{let e=2*P.current;for(let t=0;t<L.length;t++)for(let n=t+1;n<L.length;n++){let r=L[t],i=L[n];if(e4(r)||e4(i))continue;let a=i.pos.x-r.pos.x,o=i.pos.y-r.pos.y,l=i.z-r.z,s=Math.hypot(a,o,l);if(s>=e)continue;if(s>.001)a/=s,o/=s,l/=s;else{let e=Math.random()*Math.PI*2;a=Math.cos(e),o=Math.sin(e),l=0}let c=tx.active&&tx.ball===r,d=tx.active&&tx.ball===i,u=e-s;c?(i.pos.x+=a*u,i.pos.y+=o*u,i.z=Math.max(0,i.z+l*u)):d?(r.pos.x-=a*u,r.pos.y-=o*u,r.z=Math.max(0,r.z-l*u)):(r.pos.x-=a*u/2,r.pos.y-=o*u/2,r.z=Math.max(0,r.z-l*u/2),i.pos.x+=a*u/2,i.pos.y+=o*u/2,i.z=Math.max(0,i.z+l*u/2));let h=(i.vel.x-r.vel.x)*a+(i.vel.y-r.vel.y)*o+(i.vz-r.vz)*l;if(h>=0)continue;let p=-h,m=-(1+eG(h,ee.current.wallCorFactor))*h;c?(i.vel.x+=a*m,i.vel.y+=o*m,i.vz+=l*m,eU(i,m)):d?(r.vel.x-=a*m,r.vel.y-=o*m,r.vz-=l*m,eU(r,m)):(r.vel.x-=a*m/2,r.vel.y-=o*m/2,r.vz-=l*m/2,i.vel.x+=a*m/2,i.vel.y+=o*m/2,i.vz+=l*m/2,eU(r,m/2),eU(i,m/2)),W(p,.48,[r,i])}})(),r()&&(e=>{for(let e of L)e.goalInNet=!1,e.goalWorldDelta=0,e.goalWorldDirX=0,e.goalWorldDirY=0,e.goalWorldDirZ=0,e.goalNetCatchActive=!1;if(!$||!_||!Z)return;tm();let t=E.current,n=window.innerWidth,r=window.innerHeight,i=A(),a=iC(P.current,n,r,t.fov,t.cameraZ),{halfW:o,halfH:l}=ib(n,r,t.fov,t.cameraZ),s=2*o/n,c=2*l/r,d=2/a;for(let o of(J&&(ed.setFromObject(J),J.updateWorldMatrix(!0,!1),et.copy(J.matrixWorld).invert(),Z.updateWorldMatrix(!0,!1),ei.copy(eR).transformDirection(Z.matrixWorld).transformDirection(et).normalize(),ea.set(0,0,-1).transformDirection(et).normalize(),eo.set(0,0,1).transformDirection(et).normalize()),Z.updateWorldMatrix(!0,!1),eu.copy(Z.matrixWorld).invert(),eL.set(0,-1,0).transformDirection(eu).normalize(),eE.copy(eR).transformDirection(Z.matrixWorld),1e-8>=eE.lengthSq()?eE.set(0,1,0):eE.normalize(),L)){if(tx.active&&tx.ball===o||tM(o))continue;let l=R(o),u=ik(l.x,l.y,n,r,t.fov,t.cameraZ);ej.set(u.x,u.y,o.z*d);let h=l.y-o.vel.y*e,p=ik(l.x-o.vel.x*e,h,n,r,t.fov,t.cameraZ),m=Math.max(0,(o.z-o.vz*e)*d);eM.set(p.x,p.y,m);let f=o.vel.x*s,g=-o.vel.y*c,x=o.vz*d;ep.copy(eM),em.subVectors(ej,eM);let v=em.length();o.goalWorldDelta=v,v>1e-6&&(o.goalWorldDirX=em.x/v,o.goalWorldDirY=em.y/v,o.goalWorldDirZ=em.z/v);let y=Math.min(8,Math.max(1,Math.ceil(v/(.3*a))));em.multiplyScalar(1/y);let w=!1;for(let e=0;e<y;e++){ep.add(em);let e=tg(Z,ep,a,f,g,x);f=e.vwx,g=e.vwy,x=e.vwz,w=w||e.wallContact}if(J&&!w){J.updateWorldMatrix(!0,!1),et.copy(J.matrixWorld).invert(),en.copy(ep).applyMatrix4(et),ev.setFromMatrixScale(J.matrixWorld);let t=(ev.x+ev.y+ev.z)/3||1,n=a/t,r=iy(en,K,ei,ea,eo,el),i=r===1/0?0:Math.max(0,1-iu(n,2.2*n,r));if(i>0&&Math.max(o.goalWorldDelta/t,o.goalWorldDelta<=1e-6?.65*n:0)>1e-6){let t=Math.exp(-6*e*i);f*=t,g*=t,o.goalNetCatchActive=!0}}let b=f*eE.x+g*eE.y+x*eE.z;if(w&&b<12){let t=28*e;ep.addScaledVector(eE,t),f+=eE.x*t*.5,g+=eE.y*t*.5,x+=eE.z*t*.5}let k=iM(ep.x,ep.y,i,n,r,t.fov,t.cameraZ);if(o.pos.x=k.x,o.pos.y=k.y,o.z=Math.max(0,ep.z/d),o.vel.x=f/s,o.vel.y=-g/c,o.vz=x/d,J){let e=ep.x,t=ep.y;o.goalInNet=e>=ed.min.x&&e<=ed.max.x&&t>=ed.min.y&&t<=ed.max.y}}})(e)})(t),g.current,L))tM(e)||e4(e)||tE(e);else{for(let e of(e9.y=A(),ti=0,e7=0,te=!1,L)){let t=R(e);e.lastScreen.x=t.x,e.lastScreen.y=t.y}tx.active&&(tY(tx.moved),tG()),e0.cancelDrag()}tk();let l=g.current;if((l.ripplePulseElapsed>0||l.rippleAmplitude>.001)&&l.ripplePulseElapsed<1){let e=l.ripplePulseElapsed+t,n=Math.min(1,e/1);l={...l,ripplePulseElapsed:e,rippleProgress:n,rippleAmplitude:1.4*(1-n),rippleFrequency:9}}else l.rippleAmplitude>.001&&(l={...l,rippleAmplitude:0,rippleProgress:1});if("consume"===l.phase){let e=l.elapsed+t,n=L.find(e=>e.uid===l.ballUid),r=Math.min(1,e/.3);if(n&&((e,t)=>{let n=P.current,r=1.05*n;if(e.vz=0,t<.45)tj(e),e.z=r*ir(t/.45);else{let i=(t-.45)/.55;if(e.z=r*(1-ii(i)),tw){let t=.28*n*(1-ii(i)),r=i*Math.PI*1.1;e.pos.x=tw.x+Math.cos(r)*t,e.pos.y=tw.docY+Math.sin(r)*t}e.vel.x=0,e.vel.y=0}})(n,r),l={...l,elapsed:e,consumeProgress:r},e>=.3){let e=n?R(n).x:.5*window.innerWidth;n&&ty(n),eK.push({atMs:performance.now()+5e3,screenX:e}),l={...l,phase:"idle",elapsed:0,ballUid:-1,consumeProgress:0}}}else if("center"===l.phase){let e=l.elapsed+t,n=L.find(e=>e.uid===l.ballUid);n&&((e,t,n)=>{if(!tw)return;let r=P.current,i=it(t/1.5),a=tw.x-e.pos.x,o=tw.docY-e.pos.y;
1if(Math.hypot(a,o)>1e-4){let t=1-Math.exp(-(8+14*i)*n);e.pos.x+=a*t,e.pos.y+=o*t}else e.pos.x=tw.x,e.pos.y=tw.docY;e.vel.x=0,e.vel.y=0,e.vz=0,e.z=.55*r*(1-.4*ir(i))*Math.abs(Math.sin(t/1.5*Math.PI*1))})(n,e,t);let r=ir(Math.min(1,e/.45));l={...l,elapsed:e,rippleAmplitude:1.4*r,rippleFrequency:9,rippleProgress:0},e>=1.5&&(n&&tj(n),l={...l,phase:"consume",elapsed:0,consumeProgress:0,rippleAmplitude:1.4,rippleFrequency:9,rippleProgress:0,ripplePulseElapsed:0})}else{let e=null;for(let t of L)if(!tM(t)&&tC(t)){e=t;break}e&&(tx.active&&tx.ball===e&&(tY(tx.moved),tG()),l={phase:"center",elapsed:0,ballUid:e.uid,rippleAmplitude:0,rippleFrequency:9,rippleProgress:0,ripplePulseElapsed:0,consumeProgress:0})}x.current(S.current.footerFoilRipple?l:eC()),g.current=S.current.footerFoilRipple?l:eC();let d=performance.now()/1e3,p=E.current.grabSqueezeBulge,m=window.innerWidth,v=window.innerHeight;I(q.current);let w=iC(P.current,m,v,n.fov,n.cameraZ);for(let e of(tN(),L)){let t="consume"===l.phase&&e.uid===l.ballUid,r=t?tI(l.consumeProgress):1,i=R(e),a=ik(i.x,i.y,m,v,n.fov,n.cameraZ);for(let t of(e.group.position.set(a.x,a.y,0),e.group.scale.setScalar(w),e.materialUniforms))t.uSqueeze.value=e.squeeze,t.uSqueezeTime.value=d,t.uSqueezeBulge.value=p,t.uMelt.value=0,t.uMeltTime.value=d,t.uSinkClipActive.value=0,t.uSinkClipY.value=-1e6;if(t){let t=1+.004*e.z;e.modelGroup.scale.setScalar(t*r),e.modelGroup.position.z=2*e.z/w;let n=l.consumeProgress;if(n>.45){let t=(n-.45)/.55*Math.PI*1.1;e.modelGroup.rotation.set(0,0,t)}continue}e.modelGroup.scale.setScalar(1+.004*e.z),e.modelGroup.position.z=2*e.z/w}G&&(r_(G,L.map(e=>({instanceSlot:e.instanceSlot,meshPivot:e.meshPivot,visible:e.group.visible&&e.instanceSlot>=0}))),S.current.markerPens&&e0.syncBallInkOverlayMatrices());let M=L.filter(e=>!e4(e)).map(e=>{let t=R(e);return{uid:e.uid,x:t.x,y:t.y,radius:P.current,vx:e.vel.x,vy:e.vel.y}});if(S.current.footerBallCursors&&u.current(M),$&&_&&r()&&(tm(),J&&Q)){et.copy(J.matrixWorld).invert();let e=er.setFromMatrixScale(J.matrixWorld),t=(e.x+e.y+e.z)/3||1;ec.setFromMatrixPosition($.matrixWorld);let{halfW:r,halfH:i}=ib(m,v,n.fov,n.cameraZ),a=2*r/m,o=2*i/v,l=2/w,s=w/t,c=L.filter(e=>e.goalInNet).map(e=>{let t=e.group.position.x-ec.x,n=e.group.position.y-ec.y;return{b:e,d2:t*t+n*n}}).sort((e,t)=>e.d2-t.d2).slice(0,8),d=Q.uBallCenters.value,u=Q.uBallDirs.value,h=Q.uBallPush.value,p=Q.uBallRadii.value,f=0;for(let{b:e}of c)d[f].set(e.group.position.x,e.group.position.y,2*e.z).applyMatrix4(et),p[f]=s,e.goalWorldDelta>1e-6?es.set(e.goalWorldDirX,e.goalWorldDirY,e.goalWorldDirZ):es.set(e.vel.x*a,-e.vel.y*o,e.vz*l),es.lengthSq()>1e-8?es.normalize():es.set(0,0,-1),u[f].copy(es).transformDirection(et),h[f]=Math.max(e.goalWorldDelta/t,e.goalWorldDelta<=1e-6?.65*s:0),f++;Q.uBallCount.value=f}s.fov=n.fov,s.position.z=n.cameraZ,s.updateProjectionMatrix(),s.lookAt(0,0,0),S.current.markerPens&&(e0.syncInkPresentation(t),e0.updatePosesAndDraw(t),e0.syncTransforms(),t1>=0&&(e0.isCapAttractActive()||e0.isMarkerAtCapRest())&&tq(t1,t2)),a.updateMatrixWorld(!0);let j=A(),z=j!==nn;nn=j;let B=S.current.markerPens&&(e0.consumeInkCanvasDirty()||z);if(k){let e=O.current;for(let t of(tc(y,e,k,f),tt(y,{viewportWidth:m,viewportHeight:v,fovDeg:n.fov,cameraZ:n.cameraZ,padding:e.frustumPadding}),D.length=0,L))if(t.group.visible&&!tS(t)){let e=R(t),r=ik(e.x,e.y,m,v,n.fov,n.cameraZ);D.push({x:r.x,y:r.y})}S.current.markerPens&&e0.collectShadowCasterCenters(D),function(e,t){if(!e)return;let n=e.material;if(!Array.isArray(n)&&td(n)){let e=n.chromaticUniforms.casterCenters.value,r=Math.min(t.length,8);for(let n=0;n<r;n++)e[2*n]=t[n].x,e[2*n+1]=t[n].y;for(let t=2*r;t<16;t++)e[t]=0;n.chromaticUniforms.casterCount.value=r}}(k,D)}let F=c.current,Y=S.current.markerShadow&&null!=k,N=F||Y;N!==nt&&(nt=N,N&&ni().markAccumClear()),h.setRenderTarget(null),N?(B&&!F&&ni().markAccumClear(),Y&&!F&&ni().markAccumClear(),ni().render(h,a,s,e=>{k&&(k.visible=!1),e(),k&&(k.visible=!0)},()=>(()=>{if(!k)return;let e=O.current;(e=>{if(!k)return;let t=Math.min(1,O.current.receiveOpacity*e);ts(k,t)})(e.outerShadowOpacityMul);var t=k,n=e.outerShadowCoreDarkness;let r=t.material;!Array.isArray(r)&&td(r)&&e$(r,n,0);let i=s.layers.mask;s.layers.disableAll(),s.layers.enable(1),nr(!1,!1),h.shadowMap.autoUpdate=!0,h.render(a,s),nr(!0,!0),s.layers.mask=i,k&&tl(k,O.current)})())):h.render(a,s),nu=requestAnimationFrame(np)};return nu=requestAnimationFrame(np),()=>{t=!0,iR=null,N.current=null,X.current=null,v.current.length=0,cancelAnimationFrame(nu),null!=tW&&clearTimeout(tW),p.current(!1),tx.active&&tG(),e0.cancelDrag(),e0.dispose(),document.documentElement.style.cursor=r9(),document.body.style.userSelect="",null==tB||tB.remove(),tB=null,window.removeEventListener("pointerdown",t0,{capture:!0}),window.removeEventListener("pointermove",t5),window.removeEventListener("pointerup",t8),window.removeEventListener("pointercancel",t9),window.removeEventListener("pointerout",t3),window.removeEventListener("touchmove",t4),window.removeEventListener("dragstart",tK,{capture:!0}),window.removeEventListener("selectstart",tQ,{capture:!0}),document.body.style.userSelect="",window.removeEventListener("keydown",t7),window.removeEventListener("resize",tp),window.removeEventListener("resize",na),window.removeEventListener(ia,no),window.removeEventListener(io,nl),window.removeEventListener(tv.TN,ns),window.removeEventListener(tv.yX,nc),window.removeEventListener("usmnt-marker-open-change",nd),u.current([]),x.current(eC()),V.current=null,Y.current=null,ta.dispose(),null==ne||ne.dispose(),ne=null;let e=new Set;G&&(e.add(G.geometry),a.remove(G.mesh)),a.traverse(t=>{if(!(t instanceof eg.ZLX)&&t instanceof eg.eaF){if(!e.has(t.geometry)){var n;null==(n=t.geometry)||n.dispose()}
1(Array.isArray(t.material)?t.material:[t.material]).forEach(e=>null==e?void 0:e.dispose())}}),G&&(G.mesh.dispose(),G=null),o.current=null,h.domElement.remove(),h.dispose()}},[]),(0,a.useEffect)(()=>{let e=o.current;e&&(0,ez.h)(e,s)},[s]),(0,a.useEffect)(()=>{let e=e=>{if(e.repeat||"m"!==e.key.toLowerCase())return;let t=e.target;t instanceof Element&&t.closest("input, textarea, select, [contenteditable='true'], [role='textbox']")||(e.preventDefault(),(0,tv.hV)())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),(0,a.useEffect)(()=>{if(!j)return;let e=e=>{if(e.repeat)return;let t="/"===e.key,n="g"===e.key.toLowerCase(),r="p"===e.key.toLowerCase(),i="n"===e.key.toLowerCase(),a="b"===e.key.toLowerCase(),o="l"===e.key.toLowerCase();if(!t&&!n&&!r&&!i&&!a&&!o)return;let l=e.target;l instanceof Element&&l.closest("input, textarea, select, [contenteditable='true'], [role='textbox']")||(e.preventDefault(),t?D(e=>!e):n?A(e=>!e):r?J(e=>!e):i?er(e=>!e):a?ec(e=>!e):ef(e=>!e))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[j]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{ref:n,"aria-hidden":!0,style:{position:"fixed",inset:0,zIndex:1e4,pointerEvents:"none",opacity:y&&!t?1:0,transition:"opacity ".concat(600,"ms ease")}}),j&&z&&(0,r.jsxs)("div",{"data-soccer-shadow-panel":!0,style:{position:"fixed",top:16,right:16,zIndex:10001,width:260,maxHeight:"calc(100vh - 32px)",overflowY:"auto",padding:"12px 14px",background:"rgba(20, 20, 22, 0.92)",color:"#eee",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:11,lineHeight:1.4,borderRadius:8,pointerEvents:"auto",userSelect:"none"},children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:8},children:[(0,r.jsx)("strong",{children:"SHADOWS"}),(0,r.jsx)("span",{style:{opacity:.5},children:"/ to close"})]}),!M.markerShadow&&(0,r.jsx)("div",{style:{marginBottom:10,padding:"6px 8px",borderRadius:4,background:"rgba(255, 180, 80, 0.12)",color:"#f5c88a",lineHeight:1.35},children:"Marker contact shadows are off in crash isolation. Enable them (Shift+C) and reload."}),[{label:"LIGHT",sliders:eK},{label:"BALL + MARKER",sliders:eQ},{label:"BIG SHADOW",sliders:e0},{label:"GROUND",sliders:e1}].map((e,t)=>(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:{margin:t>0?"10px 0 6px":"0 0 6px",opacity:.55,fontSize:10,letterSpacing:"0.06em"},children:e.label}),e.sliders.map(e=>{let{key:t,label:n,min:i,max:a,step:o}=e;return(0,r.jsxs)("label",{style:{display:"block",marginBottom:6,cursor:"pointer"},children:[(0,r.jsxs)("span",{style:{display:"flex",justifyContent:"space-between",marginBottom:1},children:[(0,r.jsx)("span",{children:n}),(0,r.jsx)("span",{style:{opacity:.7},children:F[t].toFixed(o>=1?0:3)})]}),(0,r.jsx)("input",{type:"range",min:i,max:a,step:o,value:F[t],onChange:e=>G({...{...O.current},[t]:Number(e.target.value)}),style:{width:"100%",display:"block"}})]},t)})]},e.label)),(0,r.jsxs)("div",{style:{margin:"10px 0 6px",opacity:.55,fontSize:10,letterSpacing:"0.06em",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,r.jsx)("span",{children:"CORNER DEBUG LIGHT"}),(0,r.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,opacity:.85},children:[(0,r.jsx)("span",{style:{width:12,height:12,borderRadius:2,background:tx(U),border:"1px solid rgba(255,255,255,0.25)"}}),tx(U)]})]}),tg.map(e=>{let{key:t,label:n,min:i,max:a,step:o}=e;return(0,r.jsxs)("label",{style:{display:"block",marginBottom:6,cursor:"pointer"},children:[(0,r.jsxs)("span",{style:{display:"flex",justifyContent:"space-between",marginBottom:1},children:[(0,r.jsx)("span",{children:n}),(0,r.jsx)("span",{style:{opacity:.7},children:U[t].toFixed(o>=1?0:2)})]}),(0,r.jsx)("input",{type:"range",min:i,max:a,step:o,value:U[t],onChange:e=>$({...{...q.current},[t]:Number(e.target.value)}),style:{width:"100%",display:"block"}})]},t)}),(0,r.jsx)("button",{type:"button",onClick:()=>$(tm()),style:{width:"100%",marginBottom:8,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"reset corner light"}),(0,r.jsx)("div",{style:{margin:"10px 0 6px",opacity:.55,fontSize:10,letterSpacing:"0.06em"},children:"CASTERS"}),(0,r.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6,cursor:"pointer"},children:[(0,r.jsx)("input",{type:"checkbox",checked:F.ballCastShadow,onChange:e=>G({...{...O.current},ballCastShadow:e.target.checked})}),(0,r.jsx)("span",{children:"ball casts shadow"})]}),(0,r.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6,cursor:"pointer"},children:[(0,r.jsx)("input",{type:"checkbox",checked:F.penCastShadow,onChange:e=>G({...{...O.current},penCastShadow:e.target.checked})}),(0,r.jsx)("span",{children:"marker casts shadow"})]}),(0,r.jsx)("div",{style:{margin:"10px 0 6px",opacity:.55,fontSize:10,letterSpacing:"0.06em"},children:"PASTE JSON"}),(0,r.jsx)("textarea",{value:T,onChange:e=>B(e.target.value),placeholder:"Paste shadow panel JSON…",rows:5,spellCheck:!1,style:{width:"100%",marginBottom:6,padding:"6px 8px",boxSizing:"border-box",resize:"vertical",background:"rgba(0,0,0,0.35)",color:"#eee",border:"1px solid #555",borderRadius:4,fontFamily:"inherit",fontSize:10,lineHeight:1.35}}),(0,r.jsxs)("div",{style:{display:"flex",gap:6,marginBottom:8},children:[(0,r.jsx)("button",{type:"button",onClick:()=>{_(T)||console.warn("[shadow panel] paste: no recognized shadow panel keys")},style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"apply pasted"}),(0,r.jsx)("button",{type:"button",onClick:()=>{var e;null==(e=navigator.clipboard)||e.readText().then(e=>{B(e),_(e)})},style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"paste + apply"})]}),(0,r.jsxs)("div",{style:{display:"flex",gap:6,marginTop:4},children:[(0,r.jsx)("button",{type:"button",onClick:()=>{var e;let t={...O.current,...q.current};null==(e=navigator.clipboard)||e.writeText(JSON.stringify(t,null,2)),console.log("[shadow panel]",t)},style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"copy values"}),(0,r.jsx)("button",{type:"button",onClick:()=>G(eZ()),style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"reset"})]})]}
1),j&&I&&(0,r.jsxs)("div",{"data-soccer-shadow-panel":!0,style:{position:"fixed",top:16,left:16,zIndex:10001,width:260,padding:"12px 14px",background:"rgba(20, 20, 22, 0.92)",color:"#eee",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:11,lineHeight:1.4,borderRadius:8,pointerEvents:"auto",userSelect:"none"},children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:8},children:[(0,r.jsx)("strong",{children:"GOAL"}),(0,r.jsx)("span",{style:{opacity:.5},children:"g to close"})]}),iE.map((e,t)=>(0,r.jsxs)("div",{children:[e.label&&(0,r.jsx)("div",{style:{margin:t>0?"10px 0 6px":"0 0 6px",opacity:.55,fontSize:10,letterSpacing:"0.06em"},children:e.label}),e.sliders.map(e=>{let{key:t,label:n,min:i,max:a,step:o}=e;return(0,r.jsxs)("label",{style:{display:"block",marginBottom:6,cursor:"pointer"},children:[(0,r.jsxs)("span",{style:{display:"flex",justifyContent:"space-between",marginBottom:1},children:[(0,r.jsx)("span",{children:n}),(0,r.jsx)("span",{style:{opacity:.7},children:P[t].toFixed(o>=1?0:2)})]}),(0,r.jsx)("input",{type:"range",min:i,max:a,step:o,value:P[t],onChange:e=>L({...E.current,[t]:Number(e.target.value)}),style:{width:"100%",display:"block"}})]},t)})]},t)),(0,r.jsxs)("div",{style:{display:"flex",gap:6,marginTop:4},children:[(0,r.jsx)("button",{type:"button",onClick:()=>{var e;let t=E.current;null==(e=navigator.clipboard)||e.writeText(JSON.stringify(t,null,2)),console.log("[goal transform]",t)},style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"copy values"}),(0,r.jsx)("button",{type:"button",onClick:()=>L(iS),style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"reset"})]})]}),j&&Z&&(0,r.jsxs)("div",{"data-soccer-shadow-panel":!0,style:{position:"fixed",bottom:16,right:16,zIndex:10001,width:260,maxHeight:"calc(100vh - 32px)",overflowY:"auto",padding:"12px 14px",background:"rgba(20, 20, 22, 0.92)",color:"#eee",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:11,lineHeight:1.4,borderRadius:8,pointerEvents:"auto",userSelect:"none"},children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:8},children:[(0,r.jsx)("strong",{children:"PHYSICS"}),(0,r.jsx)("span",{style:{opacity:.5},children:"p to close"})]}),iI.map(e=>(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:{margin:"10px 0 6px",opacity:.55,fontSize:10,letterSpacing:"0.06em"},children:e.label}),e.sliders.map(e=>{let{key:t,label:n,min:i,max:a,step:o}=e;return(0,r.jsxs)("label",{style:{display:"block",marginBottom:6,cursor:"pointer"},children:[(0,r.jsxs)("span",{style:{display:"flex",justifyContent:"space-between",marginBottom:1},children:[(0,r.jsx)("span",{children:n}),(0,r.jsx)("span",{style:{opacity:.7},children:K[t].toFixed(o>=1?0:3)})]}),(0,r.jsx)("input",{type:"range",min:i,max:a,step:o,value:K[t],onChange:e=>et({...ee.current,[t]:Number(e.target.value)}),style:{width:"100%",display:"block"}})]},t)})]},e.label)),(0,r.jsxs)("div",{style:{display:"flex",gap:6,marginTop:4},children:[(0,r.jsx)("button",{type:"button",onClick:()=>{var e;let t=ee.current;null==(e=navigator.clipboard)||e.writeText(JSON.stringify(t,null,2)),console.log("[ball physics]",t)},style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"copy values"}),(0,r.jsx)("button",{type:"button",onClick:()=>et(ij),style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"reset"})]})]}),j&&en&&(0,r.jsxs)("div",{"data-marker-streak-panel":!0,style:{position:"fixed",bottom:16,left:16,zIndex:10001,width:260,maxHeight:"calc(100vh - 32px)",overflowY:"auto",padding:"12px 14px",background:"rgba(20, 20, 22, 0.92)",color:"#eee",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:11,lineHeight:1.4,borderRadius:8,pointerEvents:"auto",userSelect:"none"},children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:8},children:[(0,r.jsx)("strong",{children:"MARKER INK"}),(0,r.jsx)("span",{style:{opacity:.5},children:"n to close"})]}),tC.map(e=>{let{key:t,label:n,min:i,max:a,step:o}=e;return(0,r.jsxs)("label",{style:{display:"block",marginBottom:6,cursor:"pointer"},children:[(0,r.jsxs)("span",{style:{display:"flex",justifyContent:"space-between",marginBottom:1},children:[(0,r.jsx)("span",{children:n}),(0,r.jsx)("span",{style:{opacity:.7},children:ei[t].toFixed(o>=1?0:3)})]}),(0,r.jsx)("input",{type:"range",min:i,max:a,step:o,value:ei[t],onChange:e=>el({...eo.current,[t]:Number(e.target.value)}),style:{width:"100%",display:"block"}})]},t)}),(0,r.jsxs)("div",{style:{display:"flex",gap:6,marginTop:4},children:[(0,r.jsx)("button",{type:"button",onClick:()=>{var e;let t=eo.current;null==(e=navigator.clipboard)||e.writeText(JSON.stringify(t,null,2)),console.log("[marker streak]",t)},style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"copy values"}),(0,r.jsx)("button",{type:"button",onClick:()=>el({...ty}),style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"reset"})]})]}),j&&es&&(0,r.jsxs)("div",{"data-marker-squeeze-panel":!0,style:{position:"fixed",bottom:16,left:284,zIndex:10001,width:260,maxHeight:"calc(100vh - 32px)",overflowY:"auto",padding:"12px 14px",background:"rgba(20, 20, 22, 0.92)",color:"#eee",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:11,lineHeight:1.4,borderRadius:8,pointerEvents:"auto",userSelect:"none"},children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:8},children:[(0,r.jsx)("strong",{children:"BOTTLE SQUEEZE"}),(0,r.jsx)("span",{style:{opacity:.5},children:"b to close"})]}),(0,r.jsx)("div",{style:{marginBottom:10,opacity:.65,lineHeight:1.35},children:"Yellow marker squeeze preview — panel open holds full squeeze on cursor pen."}),rz.map(e=>{let{key:t,label:n,min:i,max:a,step:o}=e;return(0,r.jsxs)("label",{style:{display:"block",marginBottom:6,cursor:"pointer"},children:[(0,r.jsxs)("span",{style:{display:"flex",justifyContent:"space-between",marginBottom:1},children:[(0,r.jsx)("span",{children:n}),(0,r.jsx)("span",{style:{opacity:.7},children:ed[t].toFixed(o>=1?0:3)})]}),(0,r.jsx)("input",{type:"range",min:i,max:a,step:o,value:ed[t],onChange:e=>ep({...eh.current,[t]:Number(e.target.value)}),style:{width:"100%",display:"block"}})]},t)}),(0,r.jsxs)("div",{style:{display:"flex",gap:6,marginTop:4},children:[(0,r.jsx)("button",{type:"button",onClick:()=>{var e;let t=eh.current;null==(e=navigator.clipboard)||e.writeText(JSON.stringify(t,null,2)),console.log("[marker squeeze]",t)},style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"copy values"}),(0,r.jsx)("button",{type:"button",onClick:()=>{rL={...rE},ep({...rE})},style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"reset"})]})]}),j&&em&&(0,r.jsxs)("div",{"data-marker-yellow-line-panel":!0,style:{position:"fixed",bottom:16,left:552,zIndex:10001,width:260,maxHeight:"calc(100vh - 32px)",overflowY:"auto",padding:"12px 14px",background:"rgba(20, 20, 22, 0.92)",color:"#eee",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:11,lineHeight:1.4,borderRadius:8,pointerEvents:"auto",userSelect:"none"},children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:8},children:[(0,r.jsx)("strong",{children:"YELLOW LINE"}),(0,r.jsx)("span",{style:{opacity:.5},children:"l to close"})]}),(0,r.jsx)("div",{style:{marginBottom:10,opacity:.65,lineHeight:1.35},children:"Yellow ink streak quality — noise on both axes + stretched image map. Hold Y for yellow marker while testing."}),tT.map(e=>{let{key:t,label:n,min:i,max:a,step:o}=e;return(0,r.jsxs)("label",{style:{display:"block",marginBottom:6,cursor:"pointer"},children:[(0,r.jsxs)("span",{style:{display:"flex",justifyContent:"space-between",marginBottom:1},children:[(0,r.jsx)("span",{children:n}),(0,r.jsx)("span",{style:{opacity:.7},children:ev[t].toFixed(o>=1?0:3)})]}),(0,r.jsx)("input",{type:"range",min:i,max:a,step:o,value:ev[t],onChange:e=>eI({...eb.current,[t]:Number(e.target.value)}),style:{width:"100%",display:"block"}})]},t)}),(0,r.jsxs)("label",{style:{display:"block",marginBottom:8},children:[(0,r.jsx)("span",{style:{display:"block",marginBottom:4},children:"image map url"}),(0,r.jsx)("input",{type:"text",value:ek,placeholder:"/images/...",onChange:e=>eA(e.target.value),style:{width:"100%",boxSizing:"border-box",padding:"4px 6px",background:"#111",color:"#eee",border:"1px solid #555",borderRadius:4,fontFamily:"inherit",fontSize:11}})]}),(0,r.jsxs)("label",{style:{display:"block",marginBottom:8},children:[(0,r.jsx)("span",{style:{display:"block",marginBottom:4},children:"upload map"}),(0,r.jsx)("input",{type:"file",accept:"image/*",onChange:e=>{var t;let n=null==(t=e.target.files)?void 0:t[0];n&&eA(URL.createObjectURL(n))},style:{width:"100%",fontSize:11}})]}),(0,r.jsxs)("div",{style:{display:"flex",gap:6,marginTop:4},children:[(0,r.jsx)("button",{type:"button",onClick:()=>{var e;let t={...eb.current,imageMapUrl:ek};null==(e=navigator.clipboard)||e.writeText(JSON.stringify(t,null,2)),console.log("[yellow line]",t)},style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"copy values"}),(0,r.jsx)("button",{type:"button",onClick:()=>{tj={...tS},tL(),eI({...tS}),eA("")},style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"reset"})]})]}),j&&eP&&(0,r.jsxs)("div",{"data-marker-ground-panel":!0,style:{position:"fixed",bottom:16,right:16,zIndex:10001,width:260,maxHeight:"calc(100vh - 32px)",overflowY:"auto",padding:"12px 14px",background:"rgba(20, 20, 22, 0.92)",color:"#eee",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:11,lineHeight:1.4,borderRadius:8,pointerEvents:"auto",userSelect:"none"},children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:8},children:[(0,r.jsx)("strong",{children:"MARKER GROUND"}),(0,r.jsx)("span",{style:{opacity:.5},children:"tuning"})]}),(0,r.jsx)("div",{style:{marginBottom:10,opacity:.65,lineHeight:1.35},children:"Tip touches ground z while drawing; hover lift while following."}),nl.map(e=>{let{key:t,label:n,min:i,max:a,step:o}=e;return(0,r.jsxs)("label",{style:{display:"block",marginBottom:6,cursor:"pointer"},children:[(0,r.jsxs)("span",{style:{display:"flex",justifyContent:"space-between",marginBottom:1},children:[(0,r.jsx)("span",{children:n}),(0,r.jsx)("span",{style:{opacity:.7},children:eD[t].toFixed(o>=1?0:3)})]}),(0,r.jsx)("input",{type:"range",min:i,max:a,step:o,value:eD[t],onChange:e=>eF({...eB.current,[t]:Number(e.target.value)}),style:{width:"100%",display:"block"}})]},t)}),(0,r.jsxs)("div",{style:{display:"flex",gap:6,marginTop:4},children:[(0,r.jsx)("button",{type:"button",onClick:()=>{var e;let t=eB.current;null==(e=navigator.clipboard)||e.writeText(JSON.stringify(t,null,2)),console.log("[marker ground]",t)},style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"copy values"}),(0,r.jsx)("button",{type:"button",onClick:()=>eF({...na}),style:{flex:1,padding:"4px 0",background:"#333",color:"#eee",border:"1px solid #555",borderRadius:4,cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"reset"})]})]})]})}let iz=o.Ay.div.withConfig({componentId:"sc-83b3d06c-0"})(["position:fixed;bottom:0;left:0;right:0;width:100%;z-index:60;pointer-events:none;transform:translateY(","px);transition:transform ",";isolation:isolate;"],e=>{let{$articleSlidePx:t}=e;return t}
1,d.LT),iD=o.Ay.div.withConfig({componentId:"sc-83b3d06c-1"})(["width:100%;height:8px;margin-bottom:4px;box-sizing:border-box;border-bottom:1px dashed ",";border-left:1px dashed ",";border-right:1px dashed ",";transition:border-color ",";"],e=>{let{theme:t,$isFooterVisible:n}=e;return n?"#91fc1e66":t.colors.text},e=>{let{theme:t,$isFooterVisible:n}=e;return n?"#91fc1e66":t.colors.text},e=>{let{theme:t,$isFooterVisible:n}=e;return n?"#91fc1e66":t.colors.text},d.LT),iT=o.Ay.footer.withConfig({componentId:"sc-83b3d06c-2"})(["position:relative;z-index:1;padding:",';font-family:"Simon Mono",monospace;font-size:10px;color:',";white-space:pre-line;transition:color ",";filter:hue-rotate(var(--aj1-footer-hue-rotate,0deg));pointer-events:auto;"],e=>{let{theme:t}=e;return t.spacing.page},e=>{let{theme:t,$isFooterVisible:n}=e;return n?"#91fc1e":t.colors.text},d.LT),iB=o.Ay.div.withConfig({componentId:"sc-83b3d06c-3"})(["position:relative;z-index:1;"]),iF="ARCHIVE ID: VAA-2026-002",iW="DESIGNER(S): VARIOUS ARTISTS",iO=o.Ay.div.withConfig({componentId:"sc-83b3d06c-4"})(["margin:0;padding:0;opacity:",";transition:opacity ",";"],e=>{let{$opacity:t}=e;return t},d.LT),iY=o.Ay.div.withConfig({componentId:"sc-83b3d06c-5"})(["display:flex;flex-direction:row;flex-wrap:wrap;align-items:baseline;justify-content:space-between;column-gap:16px;row-gap:0;width:100%;"]),iN=o.Ay.span.withConfig({componentId:"sc-83b3d06c-6"})(["min-width:0;"]),iG=o.Ay.div.withConfig({componentId:"sc-83b3d06c-7"})(["display:flex;flex-direction:row;flex-wrap:wrap;align-items:baseline;justify-content:flex-end;gap:0;flex-shrink:0;"]),iU='\n  font-family: "Simon Mono", monospace;\n  font-size: 10px;\n  font-weight: 500;\n  letter-spacing: 0.04em;\n  text-transform: uppercase;\n  color: inherit;\n  text-decoration: none;\n  white-space: nowrap;\n  pointer-events: auto;\n  transition:\n    opacity '.concat(d.LT,",\n    color ").concat(d.LT,";\n  &:hover {\n    text-decoration: underline;\n  }\n"),iH=o.Ay.a.withConfig({componentId:"sc-83b3d06c-8"})(["",""],iU),iq=o.Ay.button.withConfig({componentId:"sc-83b3d06c-9"})([""," border:none;background:none;padding:0;margin:0;cursor:pointer;text-align:inherit;"],iU),iV=o.Ay.span.withConfig({componentId:"sc-83b3d06c-10"})(['font-family:"Simon Mono",monospace;font-size:10px;letter-spacing:0.06em;opacity:0.45;user-select:none;']),iX=o.Ay.span.withConfig({componentId:"sc-83b3d06c-11"})(["display:inline-flex;align-items:baseline;gap:0;white-space:nowrap;"]),i$=()=>{window.dispatchEvent(new Event(ia))},i_=()=>{window.dispatchEvent(new Event(io))},iZ=2/3;function iJ(e){let{dockMotionProgress:t=0,footerRestoreProgress:n=0,onOpenZine:i}=e,[o,l]=(0,a.useState)(!1),s=Math.min(1,Math.max(0,t)),c=Math.min(1,Math.max(0,n)),d=(s>=.5?0:s<=.25?1:1-(s-.25)/.25)*(1-c)+iZ*c,h=(s>=.5?0:s<=.25?1-s/.25:0)*(1-c)+iZ*c,p=(iF.length+1)*.035,m=(iF.length+1+iW.length+1)*.035;return(0,a.useEffect)(()=>{let e=document.getElementById("aj1-main-footer");if(!e)return;let t=new IntersectionObserver(e=>{let[t]=e;l(t.isIntersecting)},{threshold:.01});return t.observe(e),()=>t.disconnect()},[]),(0,r.jsx)(iz,{$articleSlidePx:30*s*(1-c),children:(0,r.jsx)(iT,{$isFooterVisible:o,children:(0,r.jsxs)(iB,{children:[(0,r.jsx)(iD,{$isFooterVisible:o,"aria-hidden":!0}),(0,r.jsxs)(iY,{children:[(0,r.jsx)(iN,{children:(0,r.jsx)(u.W,{text:iF,baseDelay:0,letterDelay:.035})}),(0,r.jsxs)(iG,{children:[(0,r.jsxs)(iX,{children:[(0,r.jsx)(iq,{type:"button","aria-label":"Spawn another ball",onClick:i$,children:"BALL"}),(0,r.jsx)(iq,{type:"button","aria-label":"Spawn another ball",onClick:i$,children:"[+]"}),(0,r.jsx)(iq,{type:"button","aria-label":"Remove a ball",onClick:i_,children:"[-]"})]}),(0,r.jsxs)(iV,{"aria-hidden":!0,children:[" ","---"," "]}),i?(0,r.jsx)(iq,{type:"button",onClick:i,children:"OPEN CATALOG"}):(0,r.jsx)(iH,{href:"#",children:"OPEN CATALOG"})]})]}),(0,r.jsx)(iO,{$opacity:d,children:(0,r.jsx)(u.W,{text:iW,baseDelay:p,letterDelay:.035})}),(0,r.jsx)(iO,{$opacity:h,children:(0,r.jsx)(u.W,{text:"MATERIALS: TEXTILE, LEATHER, SUEDE, FOAM, RUBBER, AIR",baseDelay:m,letterDelay:.035})})]})})})}let iK="".concat(700,"px"),iQ=o.Ay.footer.withConfig({componentId:"sc-83b3d06c-12"})(["position:relative;z-index:55;width:100%;height:100vh;display:flex;justify-content:space-between;align-items:stretch;padding:","px 12px ","px;filter:hue-rotate(var(--aj1-footer-hue-rotate,0deg));overflow-x:clip;overflow-y:hidden;pointer-events:none;"],40,76),i0=o.Ay.span.withConfig({componentId:"sc-83b3d06c-13"})(["font-family:Helvetica,-apple-system,BlinkMacSystemFont,sans-serif;font-weight:700;font-style:normal;font-size:11.6vh;line-height:81%;letter-spacing:-0.06em;text-align:justify;text-transform:uppercase;color:#91fc1e;transition:color ",";white-space:nowrap;@media (max-width:700px){font-size:8vh;}"],d.LT),i1=o.Ay.span.withConfig({componentId:"sc-83b3d06c-14"})(["display:inline-block;opacity:",";transition:opacity 0.12s ease;"],e=>{let{$active:t}=e;return+!!t}),i2=o.Ay.div.withConfig({componentId:"sc-83b3d06c-15"})(["display:flex;flex-direction:column;gap:0;transform:translateY(100%) rotate(-90deg);transform-origin:top left;"]),i5=(0,o.Ay)(i2).withConfig({componentId:"sc-83b3d06c-16"})(["transform:translateX(100%) translateY(100%) rotate(-90deg) translateY(-100%);"]),i3=o.Ay.div.withConfig({componentId:"sc-83b3d06c-17"})(["display:flex;justify-content:",";width:100%;"],e=>{let{$spaceBetween:t}=e;return t?"space-between":"flex-start"}),i4=(0,o.Ay)(i3).withConfig({componentId:"sc-83b3d06c-18"})(["@media (max-width:","){","}"],iK,e=>{let{$rightDuplicate:t}=e;return t&&(0,o.AH)(["justify-content:flex-end;"])}),i6=o.Ay.div.withConfig({componentId:"sc-83b3d06c-19"})(["display:flex;align-items:flex-end;justify-content:flex-start;position:relative;z-index:2;pointer-events:none;"]),i8=o.Ay.div.withConfig({componentId:"sc-83b3d06c-20"})(["position:absolute;right:12px;bottom:","px;display:flex;align-items:flex-end;justify-content:flex-end;z-index:2;pointer-events:none;@media (max-width:","){top:var(",",48px);align-items:flex-start;}"],76,iK,y),i9=o.Ay.div.withConfig({componentId:"sc-83b3d06c-21"})(["position:absolute;top:0;bottom:0;left:50%;width:100vw;transform:translateX(-50%);pointer-events:auto;z-index:3;"]),i7="come",ae="back",at="for more at a",an="later date",ar=i7.length+ae.length+at.length+an.length;function ai(e){let{text:t,startIndex:n,progress:i}=e;return(0,r.jsx)(i0,{children:t.split("").map((e,a)=>{var o;return(0,r.jsx)(i1,{$active:i>=(o=n+a,ar<=1?.02:.02+o/(ar-1)*.26),children:" "===e?"\xa0":e},"".concat(t,"-").concat(a))})})}let aa=()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i3,{$spaceBetween:!0,children:[(0,r.jsx)(i0,{children:i7}),(0,r.jsx)(i0,{children:ae})]}),(0,r.jsx)(i3,{children:(0,r.jsx)(i0,{children:at})}),(0,r.jsx)(i3,{children:(0,r.jsx)(i0,{children:an})})]}),ao=e=>{let{progress:t,lastRowRightDuplicate:n}=e,i=i7.length+ae.length,a=i+at.length,o=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ai,{text:i7,startIndex:0,progress:t}),(0,r.jsx)(ai,{text:ae,startIndex:i7.length,progress:t})]}),l=(0,r.jsx)(ai,{text:an,startIndex:a,progress:t});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i3,{$spaceBetween:!0,children:o}),(0,r.jsx)(i3,{children:(0,r.jsx)(ai,{text:at,startIndex:i,progress:t})}),n?(0,r.jsx)(i4,{$rightDuplicate:!0,children:l}):(0,r.jsx)(i3,{children:l})]})},al=(0,a.forwardRef)(function(e,t){let{right:n=!1,progress:i}=e;return(0,r.jsx)(n?i5:i2,{ref:t,children:(0,r.jsx)(ao,{progress:i,lastRowRightDuplicate:n})})}),as=o.Ay.div.withConfig({componentId:"sc-83b3d06c-22"})(["position:absolute;visibility:hidden;pointer-events:none;display:flex;flex-direction:column;width:max-content;"]);function ac(){let e=(0,a.useRef)(null),t=(0,a.useRef)(null),n=(0,a.useRef)(null),o=(0,a.useRef)(null),[l,s]=(0,a.useState)(0),[c,d]=(0,a.useState)(0),[u,h]=(0,a.useState)(null),p=(0,i.md)(eL),m=(0,a.useRef)(p);return m.current=p,(0,a.useEffect)(()=>{let e=t.current;if(!e)return;let n=()=>{e&&s(e.offsetWidth)};n();let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[]),(0,a.useLayoutEffect)(()=>{let t=()=>{if(!(window.innerWidth<=700))return void h(null);let t=e.current,r=n.current,i=o.current;if(!t||!r||!i)return;let a=function(e){let t=parseFloat(e.trim()||"");return Number.isFinite(t)?t:0}(getComputedStyle(document.documentElement).getPropertyValue(y)),l=t.getBoundingClientRect(),s=i.getBoundingClientRect().top-l.top;h(r.offsetTop+((a>0?a:48)-s))};t();let r=new ResizeObserver(t),i=e.current,a=o.current;return i&&r.observe(i),a&&r.observe(a),document.querySelectorAll("[data-aj1-header-stack]").forEach(e
1=>r.observe(e)),window.addEventListener("resize",t),()=>{r.disconnect(),window.removeEventListener("resize",t)}},[]),(0,a.useEffect)(()=>{let t=e.current;if(!t)return;let n=()=>{if(m.current)return;let e=t.getBoundingClientRect(),n=window.innerHeight;d(Math.max(0,Math.min(1,(n-e.top)/Math.max(n+e.height,1))))};n();let r=new ResizeObserver(n);return r.observe(t),window.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n),()=>{r.disconnect(),window.removeEventListener("scroll",n),window.removeEventListener("resize",n)}},[]),(0,a.useEffect)(()=>{let e=0,t=0,n=0,r=e=>{m.current||(t=(Math.max(0,Math.min(1,e.clientY/window.innerHeight))-.5)*120)},i=()=>{if(!m.current){n+=(t-n)*.08;let e="".concat(n.toFixed(2),"deg");document.documentElement.style.setProperty("--aj1-footer-hue-rotate",e)}e=requestAnimationFrame(i)};return window.addEventListener("mousemove",r,{passive:!0}),e=requestAnimationFrame(i),()=>{cancelAnimationFrame(e),window.removeEventListener("mousemove",r),document.documentElement.style.setProperty("--aj1-footer-hue-rotate","0deg")}},[]),(0,r.jsxs)(iQ,{ref:e,id:"aj1-main-footer",$minHeight:l>0?l:void 0,children:[(0,r.jsx)(ef,{}),(0,r.jsx)(as,{ref:t,"aria-hidden":!0,children:(0,r.jsx)(aa,{})}),(0,r.jsx)(i9,{"aria-hidden":!0,children:(0,r.jsx)(eW,{})}),(0,r.jsx)(i6,{children:(0,r.jsx)(al,{progress:c})}),(0,r.jsx)(i8,{ref:n,style:null!=u?{top:"".concat(u,"px")}:void 0,children:(0,r.jsx)(al,{ref:o,right:!0,progress:c})})]})}var ad=n(3555);let au=o.Ay.div.withConfig({componentId:"sc-6c684346-0"})(["position:fixed;left:",";bottom:calc( ","px + env(safe-area-inset-bottom,0px) );width:min(96px,max(48px,calc(100vw / 24)));aspect-ratio:25 / 24;z-index:58;pointer-events:auto;overflow:hidden;transform:translateY(","px);transition:transform ",";"],e=>{let{theme:t}=e;return t.spacing.page},65,e=>{let{$articleSlidePx:t}=e;return t},d.LT),ah=o.Ay.div.withConfig({componentId:"sc-6c684346-1"})(["position:absolute;inset:0;pointer-events:none;"]),ap=o.Ay.button.withConfig({componentId:"sc-6c684346-2"})(["position:absolute;inset:0;z-index:1;margin:0;padding:0;border:none;border-radius:0;cursor:pointer;background:transparent;-webkit-tap-highlight-color:transparent;"]);function am(e){let{dockMotionProgress:t=0,footerRestoreProgress:n=0}=e,o=(0,i.md)(l.u),s=(0,a.useRef)(null),c=(0,a.useRef)(null),d=(0,a.useRef)(null),u=Math.min(1,Math.max(0,t)),h=Math.min(1,Math.max(0,n)),[p,m]=(0,a.useState)("Reveal marker");(0,a.useEffect)(()=>{let e=()=>{(0,rt.o)()?(0,tM.MT)()?m("Hide marker"):m("Yellow marker"):m("Reveal marker")};return e(),window.addEventListener("usmnt-marker-open-change",e),window.addEventListener(tM.GE,e),()=>{window.removeEventListener("usmnt-marker-open-change",e),window.removeEventListener(tM.GE,e)}},[]);let f=(0,a.useCallback)(e=>{var t;e.preventDefault(),e.stopPropagation(),null==(t=d.current)||t.pulseBrightRainbow(),(0,tv.hV)()},[]);return(0,a.useEffect)(()=>{let e=c.current;if(!e)return;let{destroy:t,pulseBrightRainbow:n}=(0,ad.Zd)({container:e,pointerSpace:"window",preserveBuffer:o});return d.current={pulseBrightRainbow:n},()=>{d.current=null,t()}},[o]),(0,r.jsxs)(au,{ref:s,$articleSlidePx:30*u*(1-h),"data-usmnt-dragon-foil":!0,children:[(0,r.jsx)(ah,{ref:c,"aria-hidden":!0}),(0,r.jsx)(ap,{type:"button","aria-label":p,onClick:f})]})}let af=(0,o.i7)(["from{opacity:0;}to{opacity:var(--graphic-opacity,0.2);}"]),ag="#00000022",ax="12px",av="900px",ay=o.Ay.div.withConfig({componentId:"sc-b91e9051-0"})(["position:absolute;top:20vh;right:0;left:auto;margin-right:-4vw;pointer-events:none;line-height:0;width:calc(100vw * 5 / 12);opacity:0.7;img{width:100%;height:auto;display:block;transform:scaleX(-1);}@media (min-width:","){width:calc(100vw * 5 / 24);}@media (max-width:700px){display:none;}"],av),aw=o.Ay.div.withConfig({componentId:"sc-b91e9051-1"})(["--graphic-opacity:",";position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:0;overflow:hidden;"],e=>{let{$graphicOpacity:t}=e;return t}),ab=o.Ay.div.withConfig({componentId:"sc-b91e9051-2"})(["position:absolute;top:0;bottom:0;left:",";right:",";background-image:repeating-linear-gradient( 180deg,"," 0,"," 1px,transparent 1px,transparent 4px );mask-image:repeating-linear-gradient( 90deg,black 0,black 1px,transparent 1px,transparent calc(100% / ",") ),linear-gradient( 90deg,transparent calc(100% - 1px),black calc(100% - 1px),black 100% );mask-composite:add,add;-webkit-mask-image:repeating-linear-gradient( 90deg,black 0,black 1px,transparent 1px,transparent calc(100% / ",") ),linear-gradient( 90deg,transparent calc(100% - 1px),black calc(100% - 1px),black 100% );-webkit-mask-composite:source-over,source-over;@media (min-width:","){mask-image:repeating-linear-gradient( 90deg,black 0,black 1px,transparent 1px,transparent calc(100% / ",") ),linear-gradient( 90deg,transparent calc(100% - 1px),black calc(100% - 1px),black 100% );-webkit-mask-image:repeating-linear-gradient( 90deg,black 0,black 1px,transparent 1px,transparent calc(100% / ",") ),linear-gradient( 90deg,transparent calc(100% - 1px),black calc(100% - 1px),black 100% );}"],ax,ax,ag,ag,12,12,av,24,24),ak=o.Ay.div.withConfig({componentId:"sc-b91e9051-3"})(["opacity:0.4;height:100%;"]),aC=o.Ay.div.withConfig({componentId:"sc-b91e9051-4"})(["@media (max-width:699px){display:none;}position:absolute;top:calc(var(--initial-vh,100vh));left:calc(var(--vw) * -8vw);opacity:0;animation:"," 0.6s ease-out 1.4s forwards;transition:opacity ",";transform:translateY(-100%);@media (min-width:700px){top:-3.5vw;transform:none;}img,svg{display:block;width:calc(var(--vw) * 100vw);height:auto;@media (min-width:700px){width:calc(var(--vw) * 64vw);}}"],af,d.LT),aM=o.Ay.div.withConfig({componentId:"sc-b91e9051-5"})(["position:absolute;top:calc(var(--initial-vh,100vh));right:calc(var(--vw) * -8vw);opacity:0;animation:"," 0.6s ease-out 1.4s forwards;transition:opacity ",";transform:translateY(-100%);@media (min-width:700px){top:auto;bottom:-2vw;transform:none;}img,svg{display:block;width:calc(var(--vw) * 100vw);height:auto;@media (min-width:700px){width:calc(var(--vw) * 64vw);}}"],af,d.LT);function aS(){return(0,r.jsxs)(aw,{"aria-hidden":!0,$graphicOpacity:1,children:[(0,r.jsx)(ab,{"aria-hidden":!0}
1),(0,r.jsx)(ay,{"aria-hidden":!0,children:(0,r.jsx)("img",{src:"/images/aj1-article/article-sneaker-outline.svg",alt:"",width:258,height:219,decoding:"async"})}),(0,r.jsxs)(ak,{children:[(0,r.jsx)(aC,{children:(0,r.jsx)("img",{src:"/images/vaa_outline.png",alt:"","aria-hidden":!0})}),(0,r.jsx)(aM,{children:(0,r.jsx)("img",{src:"/images/vaa_outline.png",alt:"","aria-hidden":!0})})]})]})}var aj=n(634);let aI={curl:{amount:0,tightness:1,origin:0,originEdge:0},materials:{matteRoughness:.25,reflectiveStrength:.37,bevelSize:6e-4,bevelStrength:1.6,foilSaturation:.11,foilOpacity:0,foilContrast:1.68},camera:{fov:20,position:[0,0,50]},animation:{scrollMotionLerp:.425,swapScaleInFrom:1.03,swapScaleInMs:380,introRevealMs:5e3,heroFadeInMs:1500,introFoilDelayMs:4250,introFoilFrom:1,introFoilTo:0,introContrastFrom:3,introContrastTo:0,introCycleFpsFrom:10,introCycleFpsTo:6,introCycleIntervalMaxMs:1200,spaceBurstFoil:2,spaceBurstContrast:4,spaceBurstMs:2e3,introMouseOrbits:1.25,introMouseRadius:1,introMouseSpeed:1/3}};function aA(){return{exposure:1.07,ambient:1.38,light1Intensity:.1,light2Intensity:.1,matteRoughness:.21,foilOpacity:0,grainAmount:1,bevelStrength:4.1,foilContrast:1.3}}function aP(e,t){return t<=500?e.mobileSrc:e.src}function aR(e){return{desktop:{...e.desktop},mobile:{...e.mobile}}}let aE={rugby:{desktop:{xStart:.5202457609615977,yStart:.6626566587056543,scaleStart:2.73,xEnd:.4772624055351203,yEnd:.5833856939607958,scaleEnd:.96,rotationEnd:20.3},mobile:{xStart:.5252952463882806,yStart:.6910615123007536,scaleStart:4.59,xEnd:.6610965920472762,yEnd:.611,scaleEnd:2.29,rotationEnd:18.9}},shoe:{desktop:{xStart:.6550841631172971,yStart:.7154394648460847,scaleStart:2.68,rotationStart:-10.5,xEnd:.4489321388435279,yEnd:.6838407096288865,scaleEnd:1.22,rotationEnd:2},mobile:{xStart:.7201780703132554,yStart:.7520292991902692,scaleStart:4.92,rotationStart:30.3,xEnd:.7093269407155796,yEnd:.666,scaleEnd:2.98,rotationEnd:11.2}},bag:{desktop:{xStart:.4307748773583253,yStart:.8017249233261381,scaleStart:3.37,xEnd:.49222480430622345,yEnd:.619,scaleEnd:.79,rotationEnd:31.2},mobile:{xStart:.2569399706742978,yStart:.6711671082478388,scaleStart:4.041969813523372,xEnd:.577606032326612,yEnd:.582,scaleEnd:1.86,rotationEnd:-2.6}},polo:{desktop:{xStart:.560115031584867,yStart:.9918478788993988,scaleStart:2.84,xEnd:.4976370468135657,yEnd:.5987703063142227,scaleEnd:.8,rotationEnd:9.1},mobile:{xStart:.5881685978464404,yStart:.854,scaleStart:4.53,rotationStart:40.4,xEnd:.7264606307592144,yEnd:.583,scaleEnd:2.03,rotationEnd:8.4}},windbreaker:{desktop:{xStart:.5675649338550247,yStart:.5222179136517243,scaleStart:2.29,xEnd:.5028485423900465,yEnd:.602401213676024,scaleEnd:.98,rotationEnd:26.8},mobile:{xStart:.49,yStart:.535,scaleStart:4.73,rotationStart:24.2,xEnd:.504543169515513,yEnd:.622,scaleEnd:2.22,rotationEnd:-2.6}},jersey:{desktop:{xStart:.6089605406484372,yStart:.25762799715031387,scaleStart:3.89,xEnd:.4890357890488183,yEnd:.6214918505516551,scaleEnd:.86,rotationEnd:-.7},mobile:{xStart:.6089605406484372,yStart:.696,scaleStart:3.89,xEnd:.422,yEnd:.601,scaleEnd:2.31,rotationEnd:-52.6}},"shoe-sole":{desktop:{xStart:.8131211769485586,yStart:.594,scaleStart:3.44,rotationStart:-37.1,xEnd:.4845185878690666,yEnd:.6170059506409565,scaleEnd:1.2,rotationEnd:-5.7},mobile:{xStart:.59,yStart:.7751971565716639,scaleStart:5.71,rotationStart:28.7,xEnd:.464,yEnd:.612,scaleEnd:2.68,rotationEnd:21.6}},"polo-back":{desktop:{xStart:.4315683032612968,yStart:.6304248413443944,scaleStart:3.25,rotationStart:20.7,xEnd:.4907962239583336,yEnd:.5987008212136409,scaleEnd:.86,rotationEnd:-.7},mobile:{xStart:-.1414166975664166,yStart:.6585578021768845,scaleStart:4.53,xEnd:.5942059983473559,yEnd:.608,scaleEnd:1.97}}};function aL(e){let t=aE[null!=e?e:"rugby"];return aR(null!=t?t:aE.rugby)}aR(aE.rugby);let az=[{id:"rugby",label:"Rugby",src:"/images/usmnt/rugby.png",mobileSrc:"/images/usmnt/mobile/rugby.png",tuning:aL("rugby")},{id:"shoe",label:"Shoe",src:"/images/usmnt/shoe.png",mobileSrc:"/images/usmnt/mobile/shoe.png",tuning:aL("shoe")},{id:"bag",label:"Bag",src:"/images/usmnt/bag.png",mobileSrc:"/images/usmnt/mobile/bag.png",tuning:aL("bag")},{id:"polo",label:"Polo",src:"/images/usmnt/polo.png",mobileSrc:"/images/usmnt/mobile/polo.png",tuning:aL("polo")},{id:"windbreaker",label:"Windbreaker",src:"/images/usmnt/windbreaker.png",mobileSrc:"/images/usmnt/mobile/windbreaker.png",tuning:aL("windbreaker")},{id:"jersey",label:"Jersey",src:"/images/usmnt/jersey.png",mobileSrc:"/images/usmnt/mobile/jersey.png",tuning:aL("jersey")},{id:"shoe-sole",label:"Shoe sole",src:"/images/usmnt/shoe-sole.png",mobileSrc:"/images/usmnt/mobile/shoe-sole.png",tuning:aL("shoe-sole")},{id:"polo-back",label:"Polo back",src:"/images/usmnt/polo-back.png",mobileSrc:"/images/usmnt/mobile/polo-back.png",tuning:aL("polo-back")}],aD=["rugby","shoe","bag","polo","polo-back","windbreaker","jersey","shoe-sole"];function aT(e){let t=new Set(az.map(e=>e.id)),n=new Set,r=[];for(let i of e)t.has(i)&&!n.has(i)&&(r.push(i),n.add(i));for(let e of az)n.has(e.id)||r.push(e.id);return r}function aB(e){return e.map(e=>az.findIndex(t=>t.id===e)).filter(e=>e>=0)}function aF(e){return e<=eS.PU?"mobile":"desktop"}function aW(e){return e<.5?"start":"end"}let aO=1.01/2.68;function aY(e){let t=Math.max(0,Math.min(1,e));return 1-(1-t)*(1-t)}function aN(e){return Math.max(0,Math.min(1,e))}function aG(e){var t;return null!=(t=e.rotationStart)?t:0}function aU(e){var t;return null!=(t=e.rotationEnd)?t:0}function aH(e,t){var n,r,i,a,o,l;let s=function(e){let t=aN(e);return t>=.5?1:aY(t/.5)}(t),c=(n=e.scaleStart,(r=e.scaleEnd)>=.5?r:Math.max(.5,n*aO));return{xRatio:(i=e.xStart,i+(e.xEnd-i)*s),yRatio:(a=e.yStart,a+(e.yEnd-a)*s),scale:(o=e.scaleStart)+(c-o)*s,rotation:(l=aG(e),l+(aU(e)-l)*s)}}function aq(e,t,n){let r=e[t];return"start"===n?{x:r.xStart,y:r.yStart,scale:r.scaleStart,rotation:aG(r)}:{x:r.xEnd,y:r.yEnd,scale:r.scaleEnd,rotation:aU(r)}}function aV(e,t,n,r){let i=e[t],a="start"===n?{...i,...null!=r.x?{xStart:r.x}:{},...null!=r.y?{yStart:r.y}:{},...null!=r.scale?{scaleStart:r.scale}:{},...null!=r.rotation?{rotationStart:r.rotation}:{}}:{...i,...null!=r.x?{xEnd:r.x}:{},...null!=r.y?{yEnd:r.y}:{},...null!=r.scale?{scaleEnd:r.scale}:{},...null!=r.rotation?{rotationEnd:r.rotation}:{}};return{...e,[t]:a}}var aX=n(789);let a$=aB([...aD]),a_=1e3/aI.animation.introCycleFpsTo,aZ=aI.animation.introCycleIntervalMaxMs,{introRevealMs:aJ,heroFadeInMs:aK,introFoilDelayMs:aQ,introFoilFrom:a0,introFoilTo:a1,introContrastFrom:a2,introContrastTo:a5,introCycleFpsFrom:a3,spaceBurstFoil:a4,spaceBurstContrast:a6,spaceBurstMs:a8,introMouseOrbits:a9,introMouseRadius:a7,introMouseSpeed:oe}=aI.animation,ot=aJ-aQ,on=1e3/a3,or=[4,5,5],oi=[-4,5,5];function oa(e){return!!(0,aX.i)(e)||e instanceof Element&&null!=e.closest('a, button, input, textarea, select, option, label, [role="button"], [role="link"], [contenteditable="true"], [data-soccer-shadow-
1panel], [data-soccer-goal-panel], [data-soccer-physics-panel], [data-marker-streak-panel], [data-marker-ground-panel], footer')}let oo=aL(),ol=e=>{e.format=eg.GWd,e.premultiplyAlpha=!1,e.colorSpace=eg.er$,e.needsUpdate=!0},os=(e,t,n)=>{let r=e.image;if(!t||!(null==r?void 0:r.width)||!(null==r?void 0:r.height))return;let i=r.width/r.height;n.current=i;let a=new eg.bdM(i,1,2,2);t.geometry.dispose(),t.geometry=a},oc={matteRoughness:.8,reflectiveStrength:.8,bevelSize:.004,bevelStrength:5,foilSaturation:1.92,foilOpacity:.12,foilContrast:1,cameraFov:20,cameraPosition:[0,0,50]};function od(e){var t,n;let{scrollT:o=0,articleProgress:s=0,productTunings:c,forcedProductIndex:d=null,cycleProductIndices:u,onTuningDrag:h,curlAmount:p=0,curlTightness:m=0,curlOrigin:f=0,curlOriginEdge:g=0,matteRoughness:x=oc.matteRoughness,reflectiveStrength:v=oc.reflectiveStrength,bevelSize:y=oc.bevelSize,bevelStrength:w=oc.bevelStrength,foilSaturation:b=oc.foilSaturation,foilOpacity:k=oc.foilOpacity,foilContrast:C=oc.foilContrast,displayTuning:M,cameraFov:S=oc.cameraFov,cameraPosition:j=oc.cameraPosition,onShoeFadeInComplete:I,heroProductCycleDisabled:A=!1}=e,P=(0,i.md)(l.u),R=(0,i.md)(eL),E=(0,a.useRef)(R);E.current=R;let{themeIndex:L}=(0,aj.B)(),[z,D]=(0,a.useState)(!1),T=(0,a.useRef)(!1);T.current=z;let[B,F]=(0,a.useState)(!1),[W,O]=(0,a.useState)(!1),Y=(0,a.useRef)(null),N=(0,a.useRef)(null),G=(0,a.useRef)(null),U=(0,a.useRef)(null),H=(0,a.useRef)(null),q=(0,a.useRef)(null),V=(0,a.useRef)(null),X=(0,a.useRef)(null),$=(0,a.useRef)(null),_=(0,a.useRef)(null),Z=(0,a.useRef)(!1),J=(0,a.useRef)([]),K=(0,a.useRef)(null!=(t=a$[0])?t:0),Q=(0,a.useRef)(0),ee=(0,a.useRef)(0),et=(0,a.useRef)(null!=u?u:a$),en=(0,a.useRef)(()=>{}),er=(0,a.useRef)(!1),ei=(0,a.useRef)(!1),ea=(0,a.useRef)(I);ea.current=I;let eo=(0,a.useRef)({paused:!1,totalPausedMs:0,pauseStartedMs:null}),el=(0,a.useRef)(null),es=(0,a.useRef)(!1),ec=(0,a.useRef)(null),ed=(0,a.useRef)(!1),eu=(0,a.useRef)(!1);(0,a.useEffect)(()=>{let e=()=>{let e=window.innerWidth<=eS.PU;eu.current=e,ed.current=window.innerWidth<=500,F(e)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let eh=(0,a.useCallback)(()=>{var e;ei.current||(ei.current=!0,null!=ec.current&&(clearTimeout(ec.current),ec.current=null),null==(e=ea.current)||e.call(ea))},[]),ep=(0,a.useRef)(o),em=(0,a.useRef)(s),ef=(0,a.useRef)(!1),ev=(0,a.useRef)(0),ey=(0,a.useRef)(0),ew=(0,a.useRef)(0),eb=(0,a.useRef)(0),ek=(0,a.useRef)(0),eC=(0,a.useRef)(null!=c?c:[]),eM=(0,a.useRef)(null!=M?M:aA()),ej=(0,a.useRef)(d),eI=(0,a.useRef)(A),eA=(0,a.useRef)(h);ep.current=o,em.current=s,(0,a.useEffect)(()=>{var e;s>=.5&&(es.current=!1,r8=null),s<1||((e=eo.current).paused=!1,e.totalPausedMs=0,e.pauseStartedMs=null,es.current=!1,r8=null)},[s]),eC.current=null!=c?c:[],eM.current=null!=M?M:aA(),ej.current=d,eI.current=A,eA.current=h,et.current=u&&u.length>0?u:a$;let eP=(0,a.useRef)({x:0,y:0}),eR=(0,a.useRef)({x:0,y:0}),eE=(0,a.useRef)(1),eD=(0,a.useRef)(0),eT=(0,a.useRef)(0),eB=(0,a.useRef)(0),eF=(0,a.useRef)(null!=(n=a$[0])?n:0),eW=(0,a.useRef)(null),eO=(0,a.useRef)(null),eY=(0,a.useRef)(0),eN=(0,a.useRef)(null),eG=(0,a.useRef)(0),eU=(0,a.useRef)(0),eH=(0,a.useRef)(aI.animation.scrollMotionLerp);eH.current=aI.animation.scrollMotionLerp;let eq=(0,a.useCallback)(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=eN.current;if(null!=r){let t=Math.min(1,(e-r)/a8);if(t>=1)return eN.current=null,{foil:eG.current,contrast:eU.current};let n=aY(t);return{foil:a4+(eG.current-a4)*n,contrast:a6+(eU.current-a6)*n}}let i=eO.current;if(null!=i){let e=n-i;if(e<aJ){if(e<aQ)return{foil:a0,contrast:a2};let t=function(e){let t=Math.max(0,Math.min(1,e));return t*t}(Math.min(1,(e-aQ)/ot));return{foil:a0+(a1-a0)*t,contrast:a2+(a5-a2)*t}}}return{foil:t.foilOpacity,contrast:t.foilContrast}},[]),eV=(0,a.useCallback)(e=>{let t=eO.current;if(null==t)return a_;let n=Math.min(1,(e-t)/aJ);return n>=1?a_:on+(a_-on)*aY(n)},[]),eX=(0,a.useCallback)(e=>{let t=eO.current;if(null==t)return null;let n=e-t;if(n>=aJ)return null;let r=n/aJ*a9*oe*Math.PI*2;return{x:Math.cos(r)*a7,y:Math.sin(r)*a7}},[]),e$=(0,a.useRef)({width:0,height:0}),e_=(0,a.useCallback)(()=>
1{if("undefined"==typeof document)return{width:0,height:0};if(Y.current){let e=Y.current.getBoundingClientRect();if(e.width>0&&e.height>0)return e$.current={width:e.width,height:e.height},e$.current}return e$.current={width:window.innerWidth,height:window.innerHeight},e$.current},[]),eZ=(0,a.useCallback)(()=>{let e=V.current;if(null==e)return 50;let{width:t,height:n}=e_();return(0,eS.Zt)(e,t,n,S)},[S,e_]),eJ=(0,a.useCallback)(()=>{var e,t,n;if(!Y.current)return;Z.current=!1,er.current=!1,eO.current=null,eY.current=0,eN.current=null,D(!1);let r=new eg.Z58;N.current=r;let{width:i,height:a}=e_(),o=new eg.ubm(S,i>0&&a>0?i/a:window.innerWidth/window.innerHeight,.1,1e3);o.position.set(j[0],j[1],j[2]),G.current=o;let l=window.innerWidth<=eS.PU;eu.current=l;let s=new ex.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!l});s.setSize(i||window.innerWidth,a||window.innerHeight),s.setPixelRatio(l?1:Math.min(window.devicePixelRatio,2)),s.setClearColor(0,0),s.outputColorSpace=eg.er$,Y.current.appendChild(s.domElement),U.current=s;let c=i>0&&a>0?i/a:window.innerWidth/window.innerHeight,d=new eg.bdM(c,1,2,2),u=new eg.Tap,h=new eg.GYF(new Uint8Array([128,128,255,255]),1,1,eg.GWd);h.needsUpdate=!0,_.current=h,K.current=null!=(e=et.current[0])?e:0,ee.current=0,Q.current="undefined"!=typeof performance?performance.now():0,ed.current=window.innerWidth<=500;let p=window.innerWidth,m=Array(az.length);az.forEach((e,t)=>{m[t]=u.load(aP(e,p),e=>{ol(e),eY.current+=1,eY.current>=az.length&&(Z.current=!0,eO.current=performance.now(),Q.current=eO.current),t===K.current&&os(e,H.current,V)})}),J.current=m;let f=null!=(n=null!=(t=m[K.current])?t:m.find(e=>null!=e))?n:null;X.current=f,$.current=f;let g=null!=M?M:aA(),x=l?0:g.grainAmount,w=new eg.BKk({vertexShader:"\n  uniform float uCurlAmount;\n  uniform float uCurlTightness;\n  uniform float uCurlOrigin;\n  uniform float uCurlOriginEdge;\n  uniform float uAspect;\n\n  varying vec2 vUv;\n  varying vec3 vWorldPosition;\n  varying vec3 vWorldNormal;\n  varying vec3 vWorldTangent;\n  varying vec3 vWorldBitangent;\n\n  // Page curl: commented out — using flat plane\n  // vec3 applyCurl(vec2 p) { ... }\n  void main() {\n    vUv = uv;\n    vec2 p = position.xy;\n    vec3 pos = vec3(p, 0.0);\n    vec3 flatNormal = vec3(0.0, 0.0, 1.0);\n    vec3 flatTangent = vec3(1.0, 0.0, 0.0);\n    vec3 flatBitangent = vec3(0.0, 1.0, 0.0);\n    vec4 worldPos = modelMatrix * vec4(pos, 1.0);\n    vWorldPosition = worldPos.xyz;\n    vWorldNormal = normalize((modelMatrix * vec4(flatNormal, 0.0)).xyz);\n    vWorldTangent = normalize((modelMatrix * vec4(flatTangent, 0.0)).xyz);\n    vWorldBitangent = normalize((modelMatrix * vec4(flatBitangent, 0.0)).xyz);\n    gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n  }\n",fragmentShader:"\n  uniform sampler2D map;\n  uniform sampler2D uFoilMap;\n  uniform sampler2D uNormalMap;\n  uniform float matteRoughness;\n  uniform float reflectiveStrength;\n  uniform vec3 uCameraPosition;\n  uniform vec3 uLight1Position;\n  uniform float uLight1Intensity;\n  uniform vec3 uLight2Position;\n  uniform float uLight2Intensity;\n  uniform float uTime;\n  uniform float uScrollOffset;\n  uniform vec2  uMouse;\n  uniform float uBevelSize;\n  uniform float uBevelStrength;\n  uniform float uFoilSaturation;\n  uniform float uFoilOpacity;\n  uniform float uFoilContrast;\n  uniform float uDisplayExposure;\n  uniform float uAmbient;\n  uniform float uGrainAmount;\n\n  varying vec2 vUv;\n  varying vec3 vWorldPosition;\n  varying vec3 vWorldNormal;\n  varying vec3 vWorldTangent;\n  varying vec3 vWorldBitangent;\n\n  vec3 hueToRgb(float h) {\n    h = fract(h);\n    float r = abs(h * 6.0 - 3.0) - 1.0;\n    float g = 2.0 - abs(h * 6.0 - 2.0);\n    float b = 2.0 - abs(h * 6.0 - 4.0);\n    return clamp(vec3(r, g, b), 0.0, 1.0);\n  }\n\n  // Hard Light: foil acts as the light source painted over the shoe.\n  // blend = 0.5 → no change; < 0.5 → darkens (multiply); > 0.5 → brightens (screen).\n  vec3 hardLight(vec3 base, vec3 blend) {\n    vec3 dark   = 2.0 * base * blend;\n    vec3 bright = 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);\n    return mix(dark, bright, step(0.5, blend));\n  }\n\n  float hash12(vec2 p) {\n    return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);\n  }\n\n  void main() {\n    vec4 texColor = texture2D(map, vUv);\n    if (texColor.a < 0.01) discard;\n\n    // Flat product photos: skip AJ1 lighting/bevel when foil is disabled.\n    if (uFoilOpacity < 0.001) {\n      vec3 linear = texColor.rgb * uDisplayExposure;
1\n      gl_FragColor = linearToOutputTexel(vec4(linear, texColor.a));\n      return;\n    }\n\n    vec3 N = normalize(vWorldNormal);\n    vec3 V = normalize(uCameraPosition - vWorldPosition);\n    vec3 L1 = normalize(uLight1Position - vWorldPosition);\n    vec3 L2 = normalize(uLight2Position - vWorldPosition);\n\n    // True normal map from shoe_normal.jpg in tangent space.\n    vec3 normalTex = texture2D(uNormalMap, vUv).xyz * 2.0 - 1.0;\n    normalTex.y = -normalTex.y; // Flip Y for expected tangent orientation.\n    mat3 tbn = mat3(\n      normalize(vWorldTangent),\n      normalize(vWorldBitangent),\n      normalize(vWorldNormal)\n    );\n    vec3 bumpN = normalize(tbn * normalTex);\n\n    float NdotV = max(dot(bumpN, V), 0.0);\n    float litDiffuse =\n      max(dot(bumpN, L1), 0.0) * uLight1Intensity +\n      max(dot(bumpN, L2), 0.0) * uLight2Intensity;\n    float ambient = uAmbient;\n    float diffuse = ambient + clamp(litDiffuse, 0.0, 2.4) * 1.262;\n\n    float matte = 1.0 - matteRoughness * 0.2;\n    vec3 baseColor = texColor.rgb * matte * diffuse;\n\n    // ── Holographic foil ─────────────────────────────────────────────\n    // Mask from photo luminance; wide smoothstep avoids posterized complement bands.\n    vec3 foilTex = texture2D(uFoilMap, vUv).rgb;\n    float rawFoil = dot(foilTex, vec3(0.299, 0.587, 0.114));\n    float foilStrength = smoothstep(0.1, 0.95, rawFoil);\n\n    vec3  R     = reflect(-V, bumpN);\n    float fresnel = pow(1.0 - NdotV, 2.5);\n\n    // ── Angle-dependent hue — NO atan, so no \xb1π wrap discontinuity ──\n    float PI2     = 6.28318530718;\n    float viewHue = fract(R.x * 2.2 + R.y * 1.6 + R.z * 0.5 + uTime * 0.02\n                          + uScrollOffset + uMouse.x * 0.8 + uMouse.y * 0.5);\n\n    // Multi-frequency diffraction bands (reduced weight vs AJ1 — less blocky interference).\n    float g1 = sin((vUv.x *  7.0 + vUv.y *  3.0) * PI2);\n    float g2 = sin((vUv.x *  2.0 - vUv.y *  6.0) * PI2);\n    float g3 = sin((vUv.x * 10.0 + vUv.y *  7.0) * PI2);\n    float hue = fract(viewHue + g1 * 0.09 + g2 * 0.06 + g3 * 0.025 + fresnel * 0.06);\n\n    // Continuous hue — subtle luminance drift instead of a hard +0.5 complement flip.\n    float effectiveHue = fract(hue + (1.0 - foilStrength) * 0.07);\n\n    // Vivid, saturated rainbow\n    vec3 rainbow = hueToRgb(effectiveHue);\n    float luma = dot(rainbow, vec3(0.299, 0.587, 0.114));\n    rainbow = clamp(mix(vec3(luma), rainbow, uFoilSaturation), 0.0, 1.0);\n\n    // ── Foil stamp bevel: bump-map the edges of the foil mask ──\n    vec2 foilGrad = vec2(\n      texture2D(uFoilMap, vUv + vec2( uBevelSize, 0.0)).r - texture2D(uFoilMap, vUv + vec2(-uBevelSize, 0.0)).r,\n      texture2D(uFoilMap, vUv + vec2(0.0,  uBevelSize)).r - texture2D(uFoilMap, vUv + vec2(0.0, -uBevelSize)).r\n    );\n    float bevelMagnitude = length(foilGrad);\n    float bevel = (foilGrad.x - foilGrad.y) * bevelMagnitude * uBevelStrength * 0.45;\n    vec3 baseColor_beveled = baseColor + baseColor * bevel;\n\n    // ── Hard Light blend: foil tints the shoe without covering it ──\n    float metalDiff = mix(0.15, 1.0, pow(diffuse, 1.4));\n    float tintStr   = (0.38 + fresnel * 0.52) * metalDiff * uFoilContrast;\n    vec3  foilTint  = mix(vec3(0.5), rainbow, tintStr);\n\n    vec3 foilColor = hardLight(baseColor_beveled, foilTint);\n\n    // ── Additive light-driven specular so bumps read under moving lights ──\n    vec3 H1 = normalize(L1 + V);\n    vec3 H2 = normalize(L2 + V);\n    float sGlint =\n      pow(max(dot(bumpN, H1), 0.0), 96.0) * uLight1Intensity * 2.1 +\n      pow(max(dot(bumpN, H2), 0.0), 96.0) * uLight2Intensity * 2.1;\n    float sSheen =\n      pow(max(dot(bumpN, H1), 0.0), 22.0) * uLight1Intensity * 0.24 +\n      pow(max(dot(bumpN, H2), 0.0), 22.0) * uLight2Intensity * 0.24;\n    vec3 specColor = mix(rainbow, vec3(1.0), 0.6);\n    foilColor += specColor * sGlint + rainbow * sSheen * 0.45;\n\n    // ── Foil grain — coarse hash noise, stronger when foil is active (intro) ──\n    float foilGrainA = hash12(vUv * 1800.0 + vec2(uTime * 4.55, -uTime * 3.15));\n    float foilGrainB = hash12(vUv * 3200.0 + vec2(-uTime * 2.1, uTime * 4.25));\n    float foilGrain = ((foilGrainA + foilGrainB) * 0.5 - 0.5) * 0.22 * uGrainAmount;\n    foilColor += vec3(foilGrain) * foilStrength * uFoilOpacity;\n\n    // ── Composite ──\n    // Use beveled base outside the foil area, foil overlay inside it\n    vec3 finalBase = mix(baseColor, baseColor_beveled, foilStrength);\n    vec3 composited = mix(finalBase, foilColor, foilStrength * uFoilOpacity);
1\n\n    // ── Shadow saturation: boost saturation in darker areas only ──\n    float compLuma = dot(composited, vec3(0.299, 0.587, 0.114));\n    float inShadow = 1.0 - smoothstep(0.0, 0.4, compLuma);\n    float shadowSatBoost = inShadow * 0.22;\n    composited = clamp(compLuma + (composited - compLuma) * (1.0 + shadowSatBoost), 0.0, 1.0);\n\n    // ── Film grain — value noise with bilinear interp to avoid stripes; stronger dark/light mix ──\n    const float GRAIN_FREQ = 3000.0;\n    vec2  grainCell  = floor(vUv * GRAIN_FREQ);\n    vec2  grainFrac  = fract(vUv * GRAIN_FREQ);\n    vec2  g       = grainFrac * grainFrac * (3.0 - 2.0 * grainFrac); // smoothstep for smooth blending\n    float h00     = fract(sin(dot(grainCell,              vec2(127.1, 311.7))) * 43758.5453);\n    float h10     = fract(sin(dot(grainCell + vec2(1,0),  vec2(269.5, 183.3))) * 43758.5453);\n    float h01     = fract(sin(dot(grainCell + vec2(0,1),  vec2(419.2, 371.9))) * 43758.5453);\n    float h11     = fract(sin(dot(grainCell + vec2(1,1),  vec2(83.7, 97.1))) * 43758.5453);\n    float grain   = mix(mix(h00, h10, g.x), mix(h01, h11, g.x), g.y);\n    float grainAdd = (grain - 0.5) * 0.14 * uGrainAmount;\n    float inDark = 1.0 - smoothstep(0.0, 0.1, compLuma);\n    grainAdd = mix(grainAdd, max(0.0, grainAdd), inDark);\n    grainAdd *= mix(1.0, 1.8, foilStrength * uFoilOpacity);\n    composited += grainAdd;\n\n    composited = clamp(composited * uDisplayExposure, 0.0, 1.0);\n    gl_FragColor = linearToOutputTexel(vec4(composited, texColor.a));\n  }\n",uniforms:{map:{value:f},uFoilMap:{value:f},uNormalMap:{value:h},uTime:{value:0},uScrollOffset:{value:0},uMouse:{value:new eg.I9Y(0,0)},uBevelSize:{value:y},uBevelStrength:{value:g.bevelStrength},uFoilSaturation:{value:b},uFoilOpacity:{value:a0},uFoilContrast:{value:a2},uDisplayExposure:{value:g.exposure},uAmbient:{value:g.ambient},uGrainAmount:{value:x},matteRoughness:{value:g.matteRoughness},reflectiveStrength:{value:v},uCameraPosition:{value:o.position},uCurlAmount:{value:0},uCurlTightness:{value:0},uCurlOrigin:{value:0},uCurlOriginEdge:{value:0},uAspect:{value:c},uLight1Position:{value:new eg.Pq0(...or)},uLight1Intensity:{value:g.light1Intensity},uLight2Position:{value:new eg.Pq0(...oi)},uLight2Intensity:{value:g.light2Intensity}},transparent:!0,alphaTest:.01,side:eg.$EB,depthWrite:!0,toneMapped:!1}),k=new eg.BKk({vertexShader:"\n  uniform float uCurlAmount;\n  uniform float uCurlTightness;\n  uniform float uCurlOrigin;\n  uniform float uCurlOriginEdge;\n  uniform float uAspect;\n\n  // Page curl: commented out — flat plane only\n  // vec3 applyCurl(vec2 p) {\n  //   float width = uAspect;\n  //   float height = 1.0;\n  //   float PI = 3.14159265359;\n  //   float apexX = (uCurlOriginEdge > 0.5) ? (width * 0.5) : (-width * 0.5);\n  //   float apexY = mix(height * 0.5, -height * 0.5, uCurlOrigin);\n  //   ...\n  //   return mix(vec3(p, 0.0), curled, min(1.0, amountAtVertex));\n  // }\n\n  varying vec2 vUv;\n\n  void main() {\n    vUv = uv;\n    vec2 p = position.xy;\n    vec3 pos = vec3(p, 0.0); /* flat; curl commented out */\n    gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n  }\n",fragmentShader:"\n  uniform sampler2D map;\n  varying vec2 vUv;\n\n  void main() {\n    vec4 texColor = texture2D(map, vUv);\n    if (texColor.a < 0.01) discard;\n    gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n  }\n",uniforms:{map:{value:f},uCurlAmount:{value:0},uCurlTightness:{value:0},uCurlOrigin:{value:0},uCurlOriginEdge:{value:0},uAspect:{value:c}},side:eg.$EB});q.current=k;let C=new eg.eaF(d,w);return C.customDepthMaterial=k,r.add(C),H.current=C,()=>{s.domElement.remove(),s.dispose(),m.forEach(e=>null==e?void 0:e.dispose()),h.dispose(),w.dispose(),k.dispose(),d.dispose()}},[e_]);(0,a.useEffect)(()=>{let e=eJ();return()=>{null==e||e(),N.current=null,G.current=null,U.current=null,H.current=null,q.current=null,X.current=null,$.current=null,_.current=null,Z.current=!1,er.current=!1,eO.current=null,eY.current=0,eN.current=null}},[eJ]),(0,a.useEffect)(()=>{let e=()=>{var e;let t=H.current,n=q.current,r=J.current;if(!t||!n||0===r.length)return;let i=window.innerWidth<=500;
1if(i===ed.current)return;ed.current=i;let a=window.innerWidth,o=K.current,l=new eg.Tap,s=eu.current;if([...r].forEach(e=>null==e?void 0:e.dispose()),s){let e=az[o];if(!e)return;let r=Array(az.length);r[o]=l.load(aP(e,a),e=>{ol(e),os(e,H.current,V)}),J.current=r;let i=r[o];if(!i)return;let s=t.material;s.uniforms.map.value=i,s.uniforms.uFoilMap.value=i,n.uniforms.map.value=i,X.current=i,$.current=i;return}eY.current=0,Z.current=!1;let c=Array(az.length);az.forEach((e,t)=>{c[t]=l.load(aP(e,a),e=>{ol(e),eY.current+=1,eY.current>=az.length&&(Z.current=!0),t===o&&os(e,H.current,V)})}),J.current=c;let d=t.material,u=null!=(e=c[o])?e:c.find(e=>null!=e);u&&(d.uniforms.map.value=u,d.uniforms.uFoilMap.value=u,n.uniforms.map.value=u,X.current=u,$.current=u)};window.addEventListener("resize",e);let t=Y.current,n=new ResizeObserver(e);return t&&n.observe(t),()=>{window.removeEventListener("resize",e),n.disconnect()}},[]),(0,a.useEffect)(()=>{let e=U.current;e&&(0,ez.h)(e,P)},[P]),(0,a.useEffect)(()=>{null!=d&&en.current(d)},[d]),(0,a.useEffect)(()=>{let e=et.current;if(0!==e.length){if(!e.includes(K.current)){ee.current=0,en.current(e[0]);return}ee.current=e.indexOf(K.current)}},[u]),(0,a.useEffect)(()=>{if(null==d||!h)return;let e=e=>e instanceof Element&&e.closest("[data-tuning-panel]"),t=!1,n=0,r=0,i=null,a=a=>{0===a.button&&(e(a.target)||(t=!0,O(!0),i=a.pointerId,n=a.clientX,r=a.clientY,a.preventDefault(),a.stopPropagation()))},o=e=>{if(!t||e.pointerId!==i)return;let a=e.clientX-n,o=e.clientY-r;if(n=e.clientX,r=e.clientY,0!==a||0!==o)h(d,a/Math.max(window.innerWidth,1),-o/Math.max(window.innerHeight,1)),e.preventDefault()},l=e=>{e.pointerId===i&&(t=!1,O(!1),i=null)},s=t=>{e(t.target)||(t.preventDefault(),t.stopPropagation())};return window.addEventListener("pointerdown",a,{capture:!0}),window.addEventListener("pointermove",o),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),window.addEventListener("click",s,{capture:!0}),()=>{window.removeEventListener("pointerdown",a,{capture:!0}),window.removeEventListener("pointermove",o),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l),window.removeEventListener("click",s,{capture:!0})}},[d,h]),(0,a.useEffect)(()=>{if(null==d)return;let e=document.documentElement,t=e.style.cursor;return e.style.cursor=W?"grabbing":"grab",()=>{e.style.cursor=t}},[d,W]),(0,a.useEffect)(()=>{let e,t=U.current,n=N.current,r=G.current,i=H.current;if(!t||!n||!r||!i)return;let a=i.material,o=q.current,l=new eg.Tap,s=new Set,c=(e,t)=>{K.current=e,a.uniforms.map.value=t,a.uniforms.uFoilMap.value=t,o&&(o.uniforms.map.value=t),X.current=t,$.current=t,os(t,H.current,V)},d=e=>{let t=J.current;if(K.current===e)return;let n=t[e];if(n)return void c(e,n);if(!eu.current||s.has(e))return;let r=az[e];if(!r)return;s.add(e);let i=window.innerWidth;l.load(aP(r,i),n=>{s.delete(e),ol(n),t[e]=n,c(e,n)})};en.current=d;let u=()=>{E.current||eu.current&&em.current>=1||(()=>{var e,o,l,s,c,u,h;let x=performance.now(),w=(h=eo.current,h.paused&&null!=h.pauseStartedMs?h.pauseStartedMs-h.totalPausedMs:x-h.totalPausedMs),k=em.current>=1;if(eu.current&&k)return;!k&&ef.current&&(ef.current=!1);let C=eM.current;if(k&&!ef.current){ef.current=!0,ev.current=w/1e3,ey.current=ep.current;let e=Math.max(document.body.scrollHeight-window.innerHeight,1);ew.current=window.scrollY/e*4;let t=eq(x,C,w);eb.current=t.foil,ek.current=t.contrast}a.uniforms.uTime.value=k?ev.current:w/1e3;let M=aY(aN(k?ey.current:ep.current)),I=ej.current,A=J.current;if(A.some(e=>null!=e)&&Z.current){if(null!=I&&I>=0&&I<A.length)d(I);else if(!k&&!eI.current&&!eo.current.paused){let e=et.current;if(e.length>1){let t=eV(w);w-Q.current>=t+(aZ-t)*M&&(Q.current=w,ee.current=(ee.current+1)%e.length,d(e[ee.current]))}}}let P=eR.current,R=eP.current;if(!k){let e=eX(w);e?(P.x=e.x,P.y=e.y):(P.x+=(R.x-P.x)*.06,P.y+=(R.y-P.y)*.06)}a.uniforms.uMouse.value.set(P.x,P.y),a.uniforms.uLight1Position.value.set(or[0]+-(12*P.x*1)*M,or[1]+-(12*P.y*1)*M,or[2]),a.uniforms.uLight2Position.value.set(oi[0]+-(12*P.x*1.5)*M,oi[1]+-(12*P.y*1.5)*M,oi[2]);let E=Math.max(document.body.scrollHeight-window.innerHeight,1);a.uniforms.uScrollOffset.value=k?ew.current:window.scrollY/E*4,a.uniforms.uDisplayExposure.value=C.exposure,a.uniforms.uAmbient.value=C.ambient,a.uniforms.uGrainAmount.value=eu.current?0:C.grainAmount,a.uniforms.matteRoughness.value=C.matteRoughness,a.uniforms.reflectiveStrength.value=v,a.uniforms.uBevelSize.value=y,a.uniforms.uBevelStrength.value=C.bevelStrength,a.uniforms.uFoilSaturation.value=b;let{foil:L,contrast:z}=k?{foil:eb.current,contrast:ek.current}:eq(x,C,w);a.uniforms.uFoilOpacity.value=L,a.uniforms.uFoilContrast.value=z,a.uniforms.uLight1Intensity.value=C.light1Intensity,a.uniforms.uLight2Intensity.value=C.light2Intensity,a.uniforms.uCameraPosition.value.copy(r.position),a.uniforms.uCurlAmount.value=p,a.uniforms.uCurlTightness.value=m,a.uniforms.uCurlOrigin.value=f,a.uniforms.uCurlOriginEdge.value=g;let T=q.current,B=i.geometry;T&&(T.uniforms.uCurlAmount.value=p,T.uniforms.uCurlTightness.value=m,T.uniforms.uCurlOrigin.value=f,T.uniforms.uCurlOriginEdge.value=g,T.uniforms.uAspect.value=null!=(l=null==B||null==(o=B.parameters)?void 0:o.width)?l:1),a.uniforms.uAspect.value=null!=(s=null==B||null==(e=B.parameters)?void 0:e.width)?s:1;let{width:F,height:W}=e_(),O=K.current,Y=null!=(c=eC.current[O])?c:oo,N=null!=I,G=function(e,t,n){var r,i,a,o;let l=aH(e.desktop,t),s=aH(e.mobile,t),c=(0,eS.c2)(n);return{xRatio:(r=l.xRatio,r+(s.xRatio-r)*c),yRatio:(i=l.yRatio,i+(s.yRatio-i)*c),scale:(a=l.scale,a+(s.scale-a)*c),rotation:(o=l.rotation,o+(s.rotation-o)*c)}}(Y,k?ey.current:ep.current,F),U=null!=(u=V.current)?u:1,H=(0,eS.Zt)(U,F,W,S),X=j[2]/50,$=H*X,_=(0,eS.u9)(G.xRatio,G.yRatio,0,$,{width:F,height:W},S),en=(0,eS.t_)(G.scale,U,0,$,{width:F,height:W},S),ei=Z.current&&!er.current,ea=eu.current?1:Math.max(.02,Math.min(1,eH.current)),el=(e,t)=>
11e-5>Math.abs(t-e)?t:e+(t-e)*ea,es=O!==eF.current;N||ei||es?(eF.current=O,eE.current=en,eD.current=_.x,eT.current=_.y,eB.current=G.rotation,!es||ei||N||eo.current.paused||(eW.current=w)):k||(eE.current=el(eE.current,en),eD.current=el(eD.current,_.x),eT.current=el(eT.current,_.y),eB.current=el(eB.current,G.rotation));let ec=1,ed=eW.current;if(null!=ed){let{swapScaleInFrom:e,swapScaleInMs:t}=aI.animation,n=Math.min(1,(w-ed)/t);ec=e+(1-e)*aY(n),n>=1&&(eW.current=null)}let eh=aN(k?ey.current:ep.current),eg=-(2*P.x)*eh,ex=W>0?F/W*.01:0,eA=-P.y*ex*eh;i.position.set(eD.current,eT.current+eA,0),i.scale.setScalar(eE.current*ec),i.rotation.z=(eB.current+eg)*Math.PI/180,r.fov=S,r.position.set(j[0],j[1],H*X),r.updateProjectionMatrix(),t.render(n,r),Z.current&&!er.current&&(er.current=!0,D(!0))})(),e=requestAnimationFrame(u)};return e=requestAnimationFrame(u),()=>cancelAnimationFrame(e)},[p,m,f,g,x,v,S,j,M,e_,eZ,eq,eV,eX]),(0,a.useEffect)(()=>{let e=e=>{let t;if("Space"!==e.code&&" "!==e.key||e.repeat||eu.current||(t=e.target)instanceof Element&&t.closest("input, textarea, select, [contenteditable='true'], [role='textbox']")||!Z.current)return;let n=eM.current,r=performance.now(),i=eq(r,n);eG.current=i.foil,eU.current=i.contrast,eN.current=r};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[eq]),(0,a.useEffect)(()=>{let e="function"==typeof window.matchMedia?window.matchMedia("(pointer: coarse)"):null,t=()=>{var t;return!(0,rt.o)()&&!E.current&&!(null!=(t=null==e?void 0:e.matches)&&t)&&Z.current&&em.current<.5&&!(eu.current&&em.current>=1)&&null==ej.current&&T.current},n=(e,t)=>(null!=el.current||(el.current=function(){let e=document.createElement("canvas"),t=e.getContext("2d",{willReadFrequently:!0}),n=null,r=(r,i,a)=>{if(!r)return 0;let o=(r=>{if(!t)return null;let i=r.image;if(!i||!("width"in i)||!i.width||!("height"in i)||!i.height)return null;if(n&&n.source===i&&n.width===i.width&&n.height===i.height)return n;e.width=i.width,e.height=i.height,t.clearRect(0,0,i.width,i.height),t.drawImage(i,0,0,i.width,i.height);let a=t.getImageData(0,0,i.width,i.height).data;return n={source:i,width:i.width,height:i.height,data:a}})(r);if(!o)return 0;let l=Math.min(o.width-1,Math.max(0,Math.floor(i*o.width))),s=(Math.min(o.height-1,Math.max(0,Math.floor((1-a)*o.height)))*o.width+l)*4+3;return o.data[s]/255},i=new eg.tBo,a=new eg.I9Y;return{hitOpaqueAtClient:(e,t,n,o,l)=>{if(!n||!o||!l)return!1;a.x=e/Math.max(window.innerWidth,1)*2-1,a.y=-(t/Math.max(window.innerHeight,1)*2-1),i.setFromCamera(a,o);let s=i.intersectObject(n,!1)[0];return!!(null==s?void 0:s.uv)&&r(l,s.uv.x,s.uv.y)>=.01},sampleAlpha:r}}()),el.current.hitOpaqueAtClient(e,t,H.current,G.current,X.current)),r=()=>{document.documentElement.style.cursor=r9()},i=-1,a=-1,o=(e,o)=>{if(i=e,a=o,!t()||oa(document.elementFromPoint(e,o))){es.current=!1,r8=null,r();return}let l=n(e,o);if(es.current=l,!l){r8=null,r();return}r8=ep.current<=0?"scroll":eo.current.paused?"play":"pause",r()},l=e=>{"mouse"===e.pointerType&&o(e.clientX,e.clientY)},s=()=>{i<0||a<0||o(i,a)},c=e=>{if("mouse"!==e.pointerType||0!==e.button||!t()||oa(e.target)||!n(e.clientX,e.clientY)||ep.current<=0)return;e.preventDefault(),e.stopImmediatePropagation();let i=performance.now(),a=eo.current;a.paused?(a.paused&&(null!=a.pauseStartedMs&&(a.totalPausedMs+=i-a.pauseStartedMs),a.paused=!1,a.pauseStartedMs=null),r8="pause"):(a.paused||(a.paused=!0,a.pauseStartedMs=i),r8="play"),r(),r7=!0},d=()=>{es.current=!1,r8=null};window.addEventListener("pointermove",l,{passive:!0}),window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("scroll",s,{passive:!0}),window.addEventListener("blur",d);let u=()=>{(0,rt.o)()&&(d(),r())};return window.addEventListener("usmnt-marker-open-change",u),()=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("scroll",s),window.removeEventListener("blur",d),window.removeEventListener("usmnt-marker-open-change",u),r8=null}},[]),(0,a.useEffect)(()=>{let e=e=>{E.current||(eP.current.x=e.clientX/window.innerWidth*2-1,eP.current.y=-(e.clientY/window.innerHeight*2-1))},t=()=>{eP.current.x=0,eP.current.y=0};return window.addEventListener("mousemove",e),window.addEventListener("mouseleave",t),window.addEventListener("blur",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseleave",t),window.removeEventListener("blur",t)}},[]),(0,a.useEffect)(()=>
1{if(z)return ec.current=setTimeout(eh,aK+80),()=>{null!=ec.current&&(clearTimeout(ec.current),ec.current=null)}},[z,eh]),(0,a.useEffect)(()=>{let e,t={width:0,height:0},n=()=>{let e=U.current,n=G.current;if(!e||!n)return;let{width:r,height:i}=e_();r>0&&i>0&&(n.aspect=r/i,n.updateProjectionMatrix(),e.setSize(r,i),t={width:r,height:i})},r=()=>{let r=window.innerWidth<=eS.PU;eu.current=r,F(r),null!=e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=void 0;let{width:i,height:a}=e_();if(r&&t.width>0&&i===t.width&&80>Math.abs(a-t.height))return;let o=U.current;o&&o.setPixelRatio(r?1:Math.min(window.devicePixelRatio,2)),n()})};n(),window.addEventListener("resize",r);let i=Y.current,a=new ResizeObserver(r);return i&&a.observe(i),a.observe(document.documentElement),()=>{null!=e&&cancelAnimationFrame(e),window.removeEventListener("resize",r),a.disconnect()}},[e_]);let eK=B&&s>=1;return(0,r.jsx)("div",{ref:Y,className:"shoe-canvas-container",style:{position:"fixed",top:0,left:0,right:0,bottom:0,height:"calc(var(--initial-vh, 100vh) * 1.2)",minHeight:"100dvh",zIndex:5,pointerEvents:"none",filter:1===L?"hue-rotate(28deg) contrast(1.2)":2===L?"hue-rotate(160deg)":"none",opacity:z&&!eK?1:0,visibility:eK?"hidden":"visible",transition:eK?"none":"opacity ".concat(aK,"ms ease")},onTransitionEnd:e=>{e.target===e.currentTarget&&"opacity"===e.propertyName&&eh()}})}var ou=n(2757);function oh(e){return!!(0,aX.i)(e)||e instanceof Element&&null!=e.closest('a, button, input, textarea, select, option, label, [role="button"], [role="link"], [contenteditable="true"], [data-soccer-shadow-panel], [data-soccer-goal-panel], [data-soccer-physics-panel], [data-marker-streak-panel], [data-marker-ground-panel], footer')}let op=o.Ay.div.withConfig({componentId:"sc-eddf1fec-0"})(["height:","vh;height:","dvh;flex-shrink:0;pointer-events:none;@media (max-width:700px){height:calc( var(--initial-vh,100vh) * "," );}",""],220,220,e=>{let{$mobileMultiplier:t=2.6}=e;return t},e=>{let{$mobilePortraitMultiplier:t}=e;return null!=t&&(0,o.AH)(["@media (max-width:700px) and (orientation:portrait){height:calc(var(--initial-vh,100vh) * ",");}"],t)}),om=o.Ay.div.withConfig({componentId:"sc-eddf1fec-1"})(["height:0;flex-shrink:0;pointer-events:none;position:absolute;@media (max-width:700px){height:calc( var(--initial-vh,100vh) * "," );}"],1.5),of=(0,a.forwardRef)(function(e,t){let{articleRef:n,onProgressChange:o,onArticleProgressChange:l,onArticleDockMotionProgressChange:s,resetToInitialTrigger:c,scrollOffsetVh:d=0,mobileProxyHeightMultiplier:u=2.6,mobilePortraitProxyHeightMultiplier:h,onShoeFadeInComplete:p,productTunings:m,forcedProductIndex:f,cycleProductIndices:g,onTuningDrag:x,displayTuning:v,introClickScrollDisabled:y=!1,heroProductCycleDisabled:w=!1}=e,b=(0,a.useRef)(null),k=(0,a.useRef)(()=>{}),C=(0,a.useRef)(()=>0),M=(0,a.useRef)(0),S=(0,a.useRef)(y),j=(0,a.useRef)(u),I=(0,a.useRef)(h),A=(0,i.md)(eL),P=(0,a.useRef)(A);P.current=A,j.current=u,I.current=h,S.current=y,C.current=()=>{var e;let t=window.innerWidth<=700,n=j.current;t&&"function"==typeof window.matchMedia&&window.matchMedia("(orientation: portrait)").matches&&null!=I.current&&(n=I.current);let r=t?(0,ou.k)()*n:2.2*window.innerHeight;return Math.max(0,Math.round(((null==(e=b.current)?void 0:e.getBoundingClientRect().height)||r)-(t?(0,ou.k)():window.innerHeight)))},k.current=()=>{window.scrollTo({top:C.current(),behavior:"smooth"})},(0,a.useImperativeHandle)(t,()=>({scrollToShoeSequenceTarget:()=>k.current()}),[]);let[R,E]=(0,a.useState)(0),[L,z]=(0,a.useState)(0),D=(0,a.useRef)(null!=c?c:-1),T=(0,a.useRef)(d),B=(0,a.useRef)(n);T.current=d,B.current=n,(0,a.useEffect)(()=>{let e=null!=c?c:-1;e<=D.current||(D.current=e,E(0))},[c]);let F=(0,a.useRef)(f);F.current=f,(0,a.useEffect)(()=>{let e=()=>{if(S.current||null!=F.current||M.current>=1)return!1;let e=C.current();return window.scrollY<=e+4},t=null,n=n=>{!P.current&&n.isPrimary&&e()&&(oh(n.target)||(t={pointerId:n.pointerId,startX:n.clientX,startY:n.clientY,cancelled:!1}))},r=e=>{if(P.current||!t||e.pointerId!==t.pointerId)return;let n=e.clientX-t.startX,r=e.clientY-t.startY;n*n+r*r>100&&(t.cancelled=!0)},i=n=>{if(!t||n.pointerId!==t.pointerId)return;let r=t;t=null,!(r.cancelled||function(){let e=r7;return r7=!1,e}())&&e()&&(oh(n.target)||k.current())},a=e=>{var n;n=e.pointerId,(null==t?void 0:t.pointerId)===n&&(t=null)};return window.addEventListener("pointerdown",n,{passive:!0}),window.addEventListener("pointermove",r,{passive:!0}),window.addEventListener("pointerup",i,{passive:!0}),window.addEventListener("pointercancel",a,{passive:!0}),()=>{window.removeEventListener("pointerdown",n),window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",i),window.removeEventListener("pointercancel",a)}},[u,h,y]);let W=(0,a.useRef)(null);(0,a.useEffect)(()=>{W.current=()=>{var e;let t=window.innerWidth<=700,n=t?(0,ou.k)():window.innerHeight,r=window.scrollY,i=Math.max(0,r-T.current/100*n),a=0,o=0,l=null==(e=B.current)?void 0:e.current;if(l){let e=Math.max(0,n-l.getBoundingClientRect().top);a=Math.max(0,Math.min(1,e/Math.max(n,1e-6))),o=Math.min(1,e/Math.max(.5*n,1e-6))}if(t){let e=Math.max(0,r);return{t:Math.max(0,Math.min(1,e/(1.5*n))),scrollY:e,articleProgress:a,articleDockMotionProgress:o}}let s=Math.max(0,Math.min(1,i/(2.2*n)));return a=Math.max(a,Math.max(0,(s-.7)/.30000000000000004)),{t:s,scrollY:i,articleProgress:a,articleDockMotionProgress:o}}},[d]),(0,a.useEffect)(()=>{let e=!1,t=window.innerWidth,n=()=>{!P.current&&(e||(e=!0,requestAnimationFrame(()=>{e=!1;let t=W.current;if(!t)return;let n=t();M.current=n.articleProgress,E(n.t),z(n.articleProgress),null==o||o(n.t,n.scrollY),null==l||l(n.articleProgress),null==s||s(n.articleDockMotionProgress)})))},r=()=>{let e=window.innerWidth;e!==t&&(t=e,n())};return n(),window.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",r),()=>{window.removeEventListener("scroll",n),window.removeEventListener("resize",r)}},[o,l,s]);let{curl:O,materials:Y,camera:N}=aI;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(op,{ref:b,$mobileMultiplier:u,$mobilePortraitMultiplier:null!=h?h:null}),(0,r.jsx)(om,{}),(0,r.jsx)(od,{scrollT:R,articleProgress:L,productTunings:m,forcedProductIndex:f,cycleProductIndices:g,onTuningDrag:x,displayTuning:v,curlAmount:O.amount,curlTightness:O.tightness,curlOrigin:O.origin,curlOriginEdge:O.originEdge,matteRoughness:Y.matteRoughness,reflectiveStrength:Y.reflectiveStrength,bevelSize:Y.bevelSize,bevelStrength:Y.bevelStrength,foilSaturation:Y.foilSaturation,foilOpacity:Y.foilOpacity,foilContrast:Y.foilContrast,cameraFov:N.fov,cameraPosition:[...N.position],onShoeFadeInComplete:p,heroProductCycleDisabled:w})]})});var og=n(828);let ox=['If you find this sort of drama compelling, you\'ll love "Zidane, a 20th century portrait," a 2006 work by Douglas Gordon and Phillippe Parreno that presents a full match shot with multiple cameras synchronized throughout the stadium and focused entirely on the movements of Zin\xe9dine Zidane.',"Peter Drury Best Commentary Moments That Give Us SHIVERS (No Music). Uploaded by TD Football, Dec 10, 2019.","VAA™ for Nike X2 and USMNT, worn pre-match for a recent friendly.","Designed by James Rich Steers and George Steers and launched from the Brown shipyard into the East River in 1851.","b. 1942, San Diego, CA. AKA Mr. America's Cup. AKA Big Bad Dennis.","The actual cup's nickname. The trophy is an ornate, sterling silver ewer made by English jeweler Garrard & 
1Co in 1848.","Books by Dennis Conner.","Books by Dennis Conner.","Charming!","Nike developed a boating collection of its own in 1987, presumably at least partly in response to the burgeoning popularity of sailing brands.","Formed in the early 90s, Dem Dare was a loose collective of rappers, DJs, producers, artists, and dancers with a strong affinity for Polo and a focus on Black excellence and the pursuit of education and wellness.","Reggieknow drew the hand-made flyers for Dem Dare parties—posters that depicted young Black kids dipped in Polo and adjacent brands, and that Virgil Abloh cited as a formative fashion-house influence.",void 0,"\"The name Lo-Lifes came about in 1988 when I got caught talking to a girl after I just got another girl's phone number. The girl said to me, 'You're a low life!' in a disrespectful manner. My reply ? 'You're right. I wear Lo every day and Lo is my life.' Then everybody said, 'That's right, we are Lo-Lifes!' It was never officially voted on or anything, it was just the name we lived by.\" — Thirstin Howl III","Bury Me With the Lo On. 2017. Dir. Thirstin Howl III and Tom Gould.","Bury Me With the Lo On, by Thirstin Howl III and Tom Gould. Victory Editions, 2017.","b. January 18, Queens, NY. OG Lo-Life and dedicated spokesman for the lifestyle.",'The "P-Wing" debuted in the 1992 Stadium collection.','The "Cookie" crest arrived in the late 1980s and takes its colloquial name from its circular shape.',void 0,"TRUE LO-LIFE STORIES EP1: Part One: The Polo Crest Sweaters at Bergdorf Goodman (featuring) Rack-Lo. Uploaded by RACK-LO May 17, 2024.","HOW LO CAN YOU GO? (EPISODE 1) EXCLUSIVE ITEMS... Uploaded by THIRSTIN HOWL III on Dec 5, 2010.","Fan-made highlight packages—a sprawling genre of video folk art key to sports fandom—often edit found footage with commercial software and unbridled enthusiasm.","Four Favorites with LeBron James and Kevin Hart. Uploaded by Letterboxd on Sep 1, 2025. Not surprising that Goodfellas and The Godfather turn up in LeBron's list of all-time favorite films.",'b. 1939, the Bronx, NY. "People ask how can a Jewish kid from the Bronx do preppy clothes? Does it have to do with class and money? No, it has to do with dreams."',void 0,"Maldini and Rom\xe1rio, two all-time greats, squared off in matching Tiempos. Brazil would win the match 3-2 on penalties. It was the first World Cup final to finish 0-0.","UNC was a factory for top-flight women's players—no USWNT that has won a World Cup has done so without a Tar Heel on the roster. Also happens to also be Michael Jordan's alma mater.",'"Michael vs. Mia." 1997. What greater seal of superstardom does America offer than a shared bill with His Airness in a sports drink commercial?',"In 1999, she broke the record for most goals scored internationally. She finished her career with 158 goals and sits third all-time.","The original Air Zoom M9, released in 1999. A grail of women's football boots.","Across a few prolific years, Virgil's work with Nike often sought to highlight the achievements of their women athletes by showcasing them in marketing campaigns, and, in the case of Serena Williams, designing some of her on-court apparel.","The Cupertino of performance footwear. About an hour away from Venice, Montebelluna has been known for shoe design and production since the 13th century. Post-World War II, it became the global hub for performance outdoor footwear, from hiking to skiing. While many brands have since moved production to manage costs, it remains an R&D center. When Nike decided to get serious about football in the 90s, they set up shop in Montebelluna, and their bleeding edge boots are still developed there by a team of 27 designers and technicians today.","Took ages to perfect.",'One of the two techniques V built his first collaboration with Nike, "The Ten," around. "Ghosting" refers to making functional elements transparent in order to highlight how the object was constructed. He used this technique throughout his practice—at Louis Vuitton, with Vitra, Pioneer, Rimowa, and others.',"Bicycle Wheel. Marcel Duchamp, 1913. Metal wheel mounted on painted wood stool. Originally produced in Paris. Possibly his very first readymade.","The Physical Impossibility of Death in the Mind of Someone Living. Damien Hirst, 1991. Tiger shark, glass, steel, 5% formaldehyde solution.\n\nCommissioned by Charles Saatchi, the work is brutally simple: a dead tiger shark, sourced through an Australian fisherman, suspended in a tank.","In his work with Nike, V explored this dynamic in depth. His take on the Air Jordan 2, for instance, was based on a pair from Nike's archive, game-worn and signed by Michael Jordan. Over time, the foam in this pair's midsole had degraded, as all sneakers do. V embraced the entropy, had this archive pair 3D scanned, and pushed Nike to figure out how to replicate that natural decay at scale.",void 0,"The Bondi Blue iMac G3, designed by Jony Ive and team and released in 1998. The first major product rolled out under Steve Jobs' second tenure as Apple CEO.","Taking Time, by Azzedine Ala\xefa and Dontaien Grau. Rizzoli, 2020."],ov={"12-interview":{text:'"How Reggieknow Paved a Way for Kanye West and Virgil Abloh." Lei Takanashi for Complex, 2020.',href:"https://www.complex.com/style/a/lei-takanashi/reggieknow-paving-the-way-for-virgil-abloh-kanye-west",linkLabel:"Read on Complex"}};function oy(e){if(!e)return;if("string"==typeof e){let t=e.trim();return t?{text:t}:void 0}let t=e.text.trim();return t?{text:t,href:e.href,linkLabel:e.linkLabel}:void 0}function ow(e){let t=oy(ov[e]);if(t)return t;let n=parseInt(e,10)-1;if(!(n<0)&&!(n>=ox.length))return oy(ox[n])}var ob=n(9285),ok=n(1404);function oC(e){var t;let n=null!=(t=e.split("/").pop())?t:"";try{return decodeURIComponent(n)}catch(e){return n}}let oM="calc(100vw - ".concat(24,"px)"),oS=Math.ceil(11*1.4),oj=o.Ay.div.withConfig({componentId:"sc-2108b71a-0"})(["position:fixed;inset:0;z-index:1000;background:transparent;cursor:default;"]),oI=o.Ay.div.withConfig({componentId:"sc-2108b71a-1"})(["position:fixed;inset:0;z-index:900;pointer-events:none;& > *{pointer-events:auto;}
1"]),oA=(0,o.i7)(["from{opacity:0;transform:scale(0.92);}to{opacity:1;transform:scale(1);}"]),oP=o.Ay.div.withConfig({componentId:"sc-2108b71a-2"})(["position:fixed;inset:0;pointer-events:none;transform-origin:",";animation:scaleIn 0.22s ease-out forwards;& > *{pointer-events:auto;}@keyframes scaleIn{from{transform:scale(0);}to{transform:scale(1);}}"],e=>{let{$originX:t,$originY:n}=e;return"".concat(t,"px ").concat(n,"px")}),oR=o.Ay.div.withConfig({componentId:"sc-2108b71a-3"})(["position:fixed;left:auto;top:",";right:",";width:",";height:",";min-width:",";min-height:0;max-width:",";max-height:",";z-index:1001;background:#1d1d1d;border-radius:10px;display:flex;flex-direction:column;overflow-x:hidden;overflow-y:",";transition:",";"," @media (max-width:","px){","}"],e=>{let{$top:t,$contentAutoHeight:n,$isHoverPeek:r,$maximized:i}=e;return i?"".concat(lw,"px"):n&&!r?"50%":"".concat(t,"px")},e=>{let{$right:t,$maximized:n}=e;return n?"".concat(lw,"px"):"".concat(t,"px")},e=>{let{$width:t,$maximized:n}=e;return n?"calc(100vw - ".concat(2*lw,"px)"):"".concat(t,"px")},e=>{let{$height:t,$contentAutoHeight:n,$maximized:r}=e;return r?"calc(100vh - ".concat(2*lw,"px)"):n?"auto":"".concat(t,"px")},e=>{let{$minWidth:t,$maximized:n}=e;return n?"0":"".concat(null!=t?t:320,"px")},e=>{let{$maximized:t}=e;return t?"none":"".concat(100*ly,"vw")},e=>{let{$isHoverPeek:t,$maximized:n}=e;return n||t?"none":"".concat(100*ly,"vh")},e=>{let{$contentAutoHeight:t}=e;return t?"auto":"hidden"},e=>{let{$isDragging:t,$suppressOpenLayoutTransition:n,$contentAutoHeight:r,$isHoverPeek:i,$maximized:a}=e;return t||a||i||n||r?"none":"width 0.3s ease, height 0.3s ease"},e=>{let{$isHoverPeek:t,$hoverPeekOriginX:n,$hoverPeekOriginY:r,$contentAutoHeight:i}=e;return t?(0,o.AH)(["transform-origin:","px ","px;animation:"," 0.18s ease-out forwards;"],null!=n?n:0,null!=r?r:0,oA):i&&!t?(0,o.AH)(["transform:translateY(-50%);"]):""},699,e=>{let{$isHoverPeek:t}=e;return!t&&"\n      width: ".concat(oM,";\n      right: ").concat(12,"px;\n      max-width: none;\n      min-width: 0;\n    ")}),oE=o.Ay.div.withConfig({componentId:"sc-2108b71a-4"})(["position:absolute;z-index:10;touch-action:none;user-select:none;cursor:grab;&:active{cursor:grabbing;}",""],e=>{let{$placement:t}=e;return"left"===t?"\n    left: 0;\n    top: 0;\n    bottom: 0;\n    width: ".concat(10,"px;\n  "):"right"===t?"\n    right: 0;\n    top: 0;\n    bottom: 0;\n    width: ".concat(10,"px;\n  "):"\n    left: 0;\n    right: 0;\n    bottom: 0;\n    height: ".concat(10,"px;\n  ")}),oL=o.Ay.div.withConfig({componentId:"sc-2108b71a-5"})(["display:flex;align-items:center;justify-content:space-between;padding:2px 6px;background:#252525;cursor:grab;flex-shrink:0;user-select:none;position:relative;z-index:12;&:active{cursor:grabbing;}"]),oz=o.Ay.div.withConfig({componentId:"sc-2108b71a-6"})(["display:flex;align-items:center;gap:3px;flex-shrink:1;"]),oD=o.Ay.div.withConfig({componentId:"sc-2108b71a-7"})(["display:flex;align-items:center;gap:3px;flex-shrink:0;"]),oT=o.Ay.span.withConfig({componentId:"sc-2108b71a-8"})(["font-size:10px;color:#ccc;font-family:monospace;max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]),oB=o.Ay.button.withConfig({componentId:"sc-2108b71a-9"})(["width:12px;height:12px;min-width:12px;min-height:12px;padding:0;border:none;background:#888;color:#000;cursor:pointer;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background 0.15s;&:hover{background:#666;}&:active{background:#777;}svg{width:6px;height:6px;}"]),oF=o.Ay.button.withConfig({componentId:"sc-2108b71a-10"})(["width:20px;height:20px;border:none;background:transparent;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:4px;flex-shrink:0;line-height:0;& > svg{display:block;flex-shrink:0;}"]),oW=(0,o.Ay)(oF).withConfig({componentId:"sc-2108b71a-11"})(["margin-right:6px;"]),oO=o.Ay.button.withConfig({componentId:"sc-2108b71a-12"})(["padding:5px 10px 4px;border:none;background:transparent;color:#fff;font-size:9px;font-weight:500;letter-spacing:0.05em;cursor:pointer;border-radius:4px;transition:background 0.15s;&:hover{background:rgba(255,255,255,0.1);}"]),oY=(0,o.Ay)(oO).withConfig({componentId:"sc-2108b71a-13"})(["border-radius:999px;background:rgba(255,255,255,0.1);&:hover{background:rgba(255,255,255,0.2);}&:active{background:rgba(255,255,255,0.25);}"]),oN=[2,6,12,20],oG=o.Ay.div.withConfig({componentId:"sc-2108b71a-14"})(["position:relative;display:flex;align-items:center;justify-content:center;width:20px;height:20px;cursor:ns-resize;touch-action:none;user-select:none;flex-shrink:0;"]),oU=o.Ay.div.withConfig({componentId:"sc-2108b71a-15"})(["position:absolute;
1left:50%;top:50%;transform:translate(-50%,-50%);width:","px;height:","px;box-sizing:border-box;border-radius:50%;border:1px solid ",";opacity:0.7;pointer-events:none;"],14,14,e=>{let{$color:t}=e;return t}),oH=o.Ay.div.withConfig({componentId:"sc-2108b71a-16"})(["position:relative;z-index:1;width:","px;height:","px;border-radius:50%;border:1px solid rgba(255,255,255,0.2);background:",";flex-shrink:0;"],e=>{let{$size:t}=e;return Math.max(4,Math.min(20,1.2*t))},e=>{let{$size:t}=e;return Math.max(4,Math.min(20,1.2*t))},e=>{let{$color:t}=e;return t}),oq=o.Ay.div.withConfig({componentId:"sc-2108b71a-17"})(["position:relative;flex-shrink:0;"]),oV=o.Ay.div.withConfig({componentId:"sc-2108b71a-18"})(["position:absolute;top:100%;right:0;margin-top:4px;z-index:1100;box-shadow:0 4px 16px rgba(0,0,0,0.5);"]),oX=o.Ay.div.withConfig({componentId:"sc-2108b71a-19"})(["display:flex;flex-direction:column;gap:6px;padding:4px;background:#2a2a2a;border-radius:4px;border:1px solid #444;"]),o$=o.Ay.div.withConfig({componentId:"sc-2108b71a-20"})(["display:flex;align-items:stretch;gap:4px;"]),o_=o.Ay.div.withConfig({componentId:"sc-2108b71a-21"})(["display:flex;align-items:center;justify-content:space-between;gap:6px;padding-bottom:2px;border-bottom:1px solid #444;"]),oZ=o.Ay.button.withConfig({componentId:"sc-2108b71a-22"})(["flex:1;min-width:0;height:20px;padding:0;border:none;border-radius:4px;background:",';display:flex;align-items:center;justify-content:center;cursor:pointer;&::after{content:"";width:',"px;height:","px;border-radius:50%;background:",";border:1px solid rgba(255,255,255,0.25);box-sizing:border-box;}"],e=>{let{$active:t}=e;return t?"rgba(255,255,255,0.12)":"transparent"},e=>{let{$dotSize:t}=e;return t},e=>{let{$dotSize:t}=e;return t},e=>{let{$color:t}=e;return t}),oJ=o.Ay.div.withConfig({componentId:"sc-2108b71a-23"})(["width:100px;height:100px;background:linear-gradient(to bottom,transparent 0%,black 100%),linear-gradient( to right,white 0%,hsl(",",100%,50%) 100% );border-radius:2px;cursor:crosshair;touch-action:none;user-select:none;position:relative;"],e=>{let{$hue:t}=e;return t}),oK=o.Ay.div.withConfig({componentId:"sc-2108b71a-24"})(["position:absolute;left:","%;top:","%;transform:translate(-50%,-50%);width:12px;height:12px;border:2px solid white;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.5);pointer-events:none;"],e=>{let{$x:t}=e;return t},e=>{let{$y:t}=e;return t}),oQ=o.Ay.div.withConfig({componentId:"sc-2108b71a-25"})(["width:14px;height:100px;background:linear-gradient( to bottom,#f00 0%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,#f00 100% );border-radius:2px;cursor:ns-resize;touch-action:none;user-select:none;position:relative;"]),o0=o.Ay.div.withConfig({componentId:"sc-2108b71a-26"})(["position:absolute;left:-2px;right:-2px;top:","%;transform:translateY(-50%);height:4px;border:2px solid white;border-radius:1px;box-shadow:0 0 0 1px rgba(0,0,0,0.5);pointer-events:none;"],e=>{let{$y:t}=e;return t}),o1=o.Ay.div.withConfig({componentId:"sc-2108b71a-27"})(["flex:",";display:flex;align-items:",";overflow:hidden;min-height:0;"],e=>{let{$fill:t}=e;return t?"1 1 auto":"0 0 auto"},e=>{let{$fill:t}=e;return t?"stretch":"flex-start"}),o2=o.Ay.div.withConfig({componentId:"sc-2108b71a-28"})(["flex:1;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;background:#1d1d1d;padding:6px;padding-top:0;min-width:0;overflow:hidden;position:relative;"]),o5=o.Ay.div.withConfig({componentId:"sc-2108b71a-29"})(["flex:",";width:",";height:",";min-height:0;max-width:",";margin-inline:auto;display:flex;align-items:center;justify-content:center;position:relative;border-radius:6px;overflow:",";background:#1d1d1d;"],e=>{let{$fill:t}=e;return t?"1 1 auto":"0 0 auto"},e=>{let{$displayW:t,$fill:n}=e;return n?"100%":"".concat(t,"px")},e=>{let{$displayH:t,$fill:n}=e;return n?"auto":"".concat(t,"px")},e=>{let{$fill:t}=e;return t?"100%":"calc(100% - 1px)"},e=>{let{$fill:t}=e;return t?"auto":"hidden"}),o3=o.Ay.div.withConfig({componentId:"sc-2108b71a-30"})(["position:",";inset:",";flex:none;width:",";height:",";margin:",";"],e=>{let{$maximized:t}=e;return t?"relative":"absolute"},e=>{let{$maximized:t}=e;return t?"auto":"0"},e=>{let{$maximized:t,$w:n}=e;return t&&n?"".concat(n,"px"):"100%"},e=>{let{$maximized:t,$h:n}=e;return t&&n?"".concat(n,"px"):"100%"},e=>{let{$maximized:t}=e;return t?"auto":"0"}),o4=o.Ay.p.withConfig({componentId:"sc-2108b71a-31"})(["flex-shrink:0;margin:",'px 0 0;padding:0;width:100%;font-size:11px;line-height:1.4;color:#fff;font-family:"Simon Mono","ABC Simon Mono Trial",monospace;'],6),o6=o.Ay.a.withConfig({componentId:"sc-2108b71a-32"})(["color:inherit;text-decoration:underline;text-underline-offset:0.12em;&:hover{opacity:0.85;}"]),o8=(0,o.Ay)(o6).withConfig({componentId:"sc-2108b71a-33"})(["display:block;margin-top:",'px;font-size:11px;line-height:1.4;color:#fff;&:link,&:visited{color:#fff;}font-family:"Simon Mono","ABC Simon Mono Trial",monospace;'],4),o9=o.Ay.div.withConfig({componentId:"sc-2108b71a-34"})(["flex-shrink:0;width:100%;"]),o7=o.Ay.div.withConfig({componentId:"sc-2108b71a-35"})(["position:absolute;
1left:-9999px;top:0;visibility:hidden;pointer-events:none;width:","px;box-sizing:border-box;padding-bottom:","px;"],e=>{let{$widthPx:t}=e;return t},6),le=o.Ay.div.withConfig({componentId:"sc-2108b71a-36"})(["flex:0 0 auto;width:100%;max-height:","px;min-height:0;overflow:hidden;padding-top:","px;box-sizing:border-box;"],e=>{let{$maxHeightPx:t}=e;return t},6),lt=o.Ay.p.withConfig({componentId:"sc-2108b71a-37"})(['margin:0;padding:0;width:100%;font-size:11px;line-height:1.4;color:#fff;font-family:"Simon Mono","ABC Simon Mono Trial",monospace;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:',";text-overflow:ellipsis;word-break:break-word;"],e=>{let{$lineClamp:t}=e;return t}),ln=o.Ay.div.withConfig({componentId:"sc-2108b71a-38"})(["position:absolute;inset:0;display:flex;align-items:center;justify-content:center;filter:",";"],e=>{let{$inverted:t}=e;return t?"invert(1)":"none"}),lr=o.Ay.div.withConfig({componentId:"sc-2108b71a-39"})(["position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;pointer-events:none;"," "," "," @keyframes fadeOut{from{opacity:1;}to{opacity:0;}}@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}"],e=>{let{$preloadHidden:t}=e;return t&&"opacity: 0;"},e=>{let{$fadeOut:t}=e;return t&&"\n    animation: fadeOut 0.4s ease-out forwards;\n  "},e=>{let{$fadeIn:t}=e;return t&&"\n    animation: fadeIn 0.4s ease-out forwards;\n  "}),li=(0,o.Ay)(lr).withConfig({componentId:"sc-2108b71a-40"})(["z-index:2;"]),la=o.Ay.img.withConfig({componentId:"sc-2108b71a-41"})(["position:absolute;inset:-1px;width:calc(100% + 2px);height:calc(100% + 2px);object-fit:",";display:block;"],e=>{let{$cover:t}=e;return t?"cover":"contain"}),lo=o.Ay.canvas.withConfig({componentId:"sc-2108b71a-42"})(["position:absolute;inset:0;width:100%;height:100%;cursor:",";pointer-events:",";touch-action:none;visibility:",";"],e=>{let{$active:t}=e;return t?"crosshair":"default"},e=>{let{$active:t}=e;return t?"auto":"none"},e=>{let{$hidden:t}=e;return t?"hidden":"visible"}),ll=o.Ay.img.withConfig({componentId:"sc-2108b71a-43"})(["position:absolute;inset:-1px;z-index:0;width:calc(100% + 2px);height:calc(100% + 2px);object-fit:",";display:block;"],e=>{let{$cover:t}=e;return t?"cover":"contain"}),ls=o.Ay.video.withConfig({componentId:"sc-2108b71a-44"})(["position:absolute;inset:-1px;z-index:0;width:calc(100% + 2px);height:calc(100% + 2px);object-fit:",";display:block;background:#000;"],e=>{let{$cover:t}=e;return t?"cover":"contain"}),lc=o.Ay.video.withConfig({componentId:"sc-2108b71a-45"})(["position:absolute;inset:-1px;width:calc(100% + 2px);height:calc(100% + 2px);object-fit:cover;display:block;pointer-events:none;"]),ld=o.Ay.div.withConfig({componentId:"sc-2108b71a-46"})(["box-sizing:border-box;width:100px;flex-shrink:0;align-self:",";height:",";min-height:0;overflow:hidden;display:flex;flex-direction:column;"],e=>{let{$fill:t}=e;return t?"stretch":"flex-start"},e=>{let{$heightPx:t,$fill:n}=e;return n?"auto":"".concat(t,"px")}),lu=o.Ay.div.withConfig({componentId:"sc-2108b71a-47"})(["box-sizing:border-box;width:100px;flex-shrink:0;background:#1d1d1d;overflow-y:auto;padding:8px;padding-top:0;padding-left:2px;display:flex;flex-direction:column;gap:16px;",""],e=>{let{$fillParent:t}=e;return t&&"\n    flex: 1;\n    min-height: 0;\n    height: 100%;\n    width: 100%;\n  "}),lh=o.Ay.button.withConfig({componentId:"sc-2108b71a-48"})(["position:relative;width:calc(100% - 1px);max-width:calc(100% - 1px);aspect-ratio:",";padding:0;border:1px solid ",";background:#222;cursor:pointer;overflow:hidden;border-radius:4px;flex-shrink:0;&:hover{border-color:rgba(255,255,255,0.5);}img{position:absolute;inset:-1px;width:calc(100% + 2px);height:calc(100% + 2px);object-fit:cover;display:block;}"],e=>{let{$aspectRatio:t}=e;return t},e=>{let{$selected:t}=e;return t?"#91fc1e":"transparent"}),lp=o.Ay.div.withConfig({componentId:"sc-2108b71a-49"})(["position:absolute;inset:0;z-index:2;display:flex;align-items:center;justify-content:center;pointer-events:none;"]),lm=o.Ay.div.withConfig({componentId:"sc-2108b71a-50"})(["box-sizing:border-box;width:60px;height:60px;border-radius:50%;background:#cccccc66;display:flex;align-items:center;justify-content:center;flex-shrink:0;
1"]),lf=o.Ay.svg.withConfig({componentId:"sc-2108b71a-51"})(["display:block;width:30px;height:30px;flex-shrink:0;transform:translateX(2px);"]);function lg(){return(0,r.jsx)(lp,{"aria-hidden":!0,children:(0,r.jsx)(lm,{children:(0,r.jsx)(lf,{viewBox:"0 0 30 30","aria-hidden":!0,children:(0,r.jsx)("polygon",{points:"10,5 10,25 23,15",fill:"#000"})})})})}let lx=o.Ay.span.withConfig({componentId:"sc-2108b71a-52"})(["display:block;font-size:9px;color:#888;font-family:monospace;margin-top:1px;text-align:center;"]),lv=o.Ay.div.withConfig({componentId:"sc-2108b71a-53"})(["display:flex;flex-direction:column;align-items:center;"]),ly=.9,lw=12;function lb(e,t,n){return t?Math.max(n,e+12+240):n}function lk(e,t,n,r){if(!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0||n<=0||r<=0)return{displayedW:Math.max(1,Math.round(n)),displayedH:Math.max(1,Math.round(r))};let i=Math.min(n/e,r/t);return{displayedW:Math.max(1,Math.floor(e*i)),displayedH:Math.max(1,Math.floor(t*i))}}function lC(e,t,n){let{thumbColPx:r,maxWindowW:i,maxWindowH:a,chrome:o,fixedWindowW:l,maxWindowWidthCap:s,minWindowW:c=320}=n,d=r+12,u=Math.max(48,a-o.titleBarPx-o.captionBlockPx-2),h=e=>{let t=e;return null!=s&&(t=Math.min(t,s)),Math.max(Math.min(c,i),Math.min(i,t))};if(null!=l){let n=h(l),{displayedW:r,displayedH:i}=lk(e,t,Math.max(48,n-d),u);return{width:n,height:o.titleBarPx+i+o.captionBlockPx,displayedW:r,displayedH:i}}let{displayedW:p,displayedH:m}=lk(e,t,Math.max(48,i-d),u),f=h(d+p),g=Math.max(48,f-d);return{displayedW:p,displayedH:m}=lk(e,t,g,u),{width:f=h(d+p),height:o.titleBarPx+m+o.captionBlockPx,displayedW:p,displayedH:m}}function lM(e,t,n,r){let i,a,o=window.innerWidth,l=window.innerHeight,s=e.left+e.width/2-t/2;return s=Math.round(Math.min(Math.max(8,s),o-t-8)),"below"===r?(a="below",(i=e.bottom+lS)+n>l-8&&(i=Math.max(8,l-n-8))):"above"===r?(a="above",(i=e.top-n-lS)<8&&(i=8)):(i=e.bottom+lS)+n>l-8?(i=Math.max(8,e.top-n-lS),a="above"):a="below",{right:o-s-t,top:i,placement:a}}let lS=8;function lj(e){let{text:t,maxHeightPx:n}=e,i=(0,a.useRef)(null),[o,l]=(0,a.useState)(6);return(0,a.useLayoutEffect)(()=>{let e=i.current;if(!e)return;let t=()=>{let t=e.clientHeight;if(t<4)return;let n=Math.max(1,Math.min(6,Math.floor(Math.max(0,t-6)/oS)));l(e=>e===n?e:n)};t();let n=new ResizeObserver(()=>{requestAnimationFrame(t)});return n.observe(e),()=>n.disconnect()},[t,n]),(0,r.jsx)(le,{ref:i,$maxHeightPx:n,children:(0,r.jsx)(lt,{$lineClamp:o,title:t,children:t})})}function lI(e){let{href:t,label:n}=e;return(0,r.jsx)(o8,{href:t,target:"_blank",rel:"noopener noreferrer",children:n})}function lA(e){var t,n,o,l;let{isOpen:s,onClose:c,clickOrigin:d,hoverAnchor:u,footnoteId:p,onHoverPreviewDismiss:m,onHoverPreviewMouseEnter:f,onHoverPreviewMouseLeave:g,onExpandFromPeek:x}=e,{track:v}=(0,h.s)(),y=(0,i.md)(eE),w=!!(u&&!s),b=(0,a.useMemo)(()=>[...(0,ob.ib)(p,{hoverPeek:w})],[p,w]),k=(0,a.useMemo)(()=>{var e;return null==(e=ow(p))?void 0:e.text},[p]),C=(0,a.useMemo)(()=>{var e;return null==(e=ow(p))?void 0:e.href},[p]),M=(0,a.useMemo)(()=>{var e;return null==(e=ow(p))?void 0:e.linkLabel},[p]),S=!!(C&&M),j=(0,a.useMemo)(()=>(null==k?void 0:k.trim())?12+6*oS:6,[k]),[I,A]=(0,a.useState)(!1);(0,a.useLayoutEffect)(()=>{let e=()=>A(window.innerWidth<700);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let P=b.length,R=P>1,E=100*!!R,L=(0,a.useCallback)(e=>b[Math.max(0,Math.min(P-1,e))],[b,P]),z=(0,a.useCallback)(e=>L(e).src,[L]),D=(0,a.useRef)(new Map),[T,B]=(0,a.useState)(0),F=(0,a.useCallback)((e,t,n)=>{if(!Number.isFinite(t)||!Number.isFinite(n)||t<2||n<2)return;let r=Math.max(0,Math.min(P-1,e)),i=D.current.get(r);i&&i.w===t&&i.h===n||(D.current.set(r,{w:t,h:n}),B(e=>e+1))},[P]),W=(0,a.useCallback)(e=>{if(e.pause(),e.readyState>=1)try{e.currentTime=.001}catch(e){}},[]),O=(0,a.useCallback)(e=>{let t=Math.max(0,Math.min(P-1,e)),n=D.current.get(t);if(n)return n;let r=b[t];return{w:r.w,h:r.h}},[b,P]),Y=(0,a.useCallback)(e=>oC(z(e)),[z]),N=s||null!=u,[G,U]=(0,a.useState)(!1),[H,q]=(0,a.useState)({w:0,h:0}),[V,X]=(0,a.useState)({right:0,top:0}),[$,_]=(0,a.useState)({width:900,height:600}),[Z,J]=(0,a.useState)({w:480,h:320}),[K,Q]=(0,a.useState)(0),[ee,et]=(0,a.useState)(null),[en,er]=(0,a.useState)(!1),[ei,ea]=(0,a.useState)(!1),[eo,el]=(0,a.useState)(!1),[es,ec]=(0,a.useState)(!1),[ed,eu]=(0,a.useState)(!1),[eh,ep]=(0,a.useState)(!1),[em,ef]=(0,a.useState)(3),[eg,ex]=(0,a.useState)(152),[ev,ey]=(0,a.useState)(100),[ew,eb]=(0,a.useState)(100),ek=(0,ok.O)(),[eC,eM]=(0,a.useState)(!1),[eS,ej]=(0,a.useState)(!0),eI=(0,a.useId)().replace(/:/g,""),eA="aj1-invert-split-".concat(eI),eP=(0,a.useRef)(null),eR=(0,a.useRef)(null),eL=(0,a.useRef)(null),ez=(0,a.useRef)(null),eD=(0,a.useRef)(null),eT=(0,a.useRef)(null),eB=(0,a.useRef)(null),eF=(0,a.useRef)(null),eW=(0,a.useRef)(null),eO=(0,a.useRef)(null),eY=(0,a.useRef)(null),eN=(0,a.useRef)(null),eG=(0,a.useRef)(null),eU=(0,a.useRef)(null),eH=(0,a.useRef)(null),[eq,eV]=(0,a.useState)(0),eX=(0,a.useRef)(!1),e$=(0,a.useRef)(null),e_=(0,a.useRef)(null),eZ=(0,a.useRef)(!1),eJ=(0,a.useRef)(new Map),eK=(0,a.useRef)(!1),eQ=(0,a.useRef)(null);(0,a.useLayoutEffect)(()=>
1{if(!s&&!u||!R)return void eV(0);let e=eY.current;if(!e)return;let t=()=>{let t=e.offsetHeight;t>0&&eV(t)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[s,u,R,K,T,k,Z.w,Z.h]);let e0=(0,a.useCallback)(e=>{w||G||(e.preventDefault(),eM(!0),eT.current={startX:e.clientX,startY:e.clientY,startRight:V.right,startTop:V.top})},[V,w,G]);(0,a.useEffect)(()=>{if(!s||u)return;let e=e=>{eT.current&&X({right:eT.current.startRight-(e.clientX-eT.current.startX),top:eT.current.startTop+(e.clientY-eT.current.startY)})},t=()=>{eT.current=null,eM(!1)};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[s,u]),(0,a.useEffect)(()=>{s||U(!1)},[s]),(0,a.useEffect)(()=>{if(!s&&!u)return void ej(!0);if(s){Q(e=>Math.min(e,Math.max(0,P-1))),ej(!0);let e=window.setTimeout(()=>ej(!1),220);return()=>window.clearTimeout(e)}ej(!0);let e=window.setTimeout(()=>ej(!1),200);return()=>window.clearTimeout(e)},[s,u,P]),(0,a.useEffect)(()=>{u||(eQ.current=null)},[u]),(0,a.useEffect)(()=>{eQ.current=null},[p]);let e1=(0,a.useCallback)(()=>{var e,t;let n=eN.current,r=n&&n.offsetHeight>0?n.offsetHeight:32,i=null!=(t=null!=(e=eU.current)?e:eG.current)?t:null;return{titleBarPx:r,captionBlockPx:i&&i.offsetHeight>0?i.offsetHeight:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(null==e?void 0:e.trim())?12+Math.max(1,Math.ceil(e.length/68))*oS+(t?4+oS:0):6}(e,t)}(k,S)}},[k,S]),e2=(0,a.useCallback)(()=>{if(!s&&!u)return;let e=window.innerWidth,t=window.innerHeight,n=e<700,{w:r,h:i}=O(K),a=e1(),o=!!(k&&k.trim()),l=Math.floor(e*ly),c=Math.floor(t*ly);if(w&&u){let e=function(e,t,n,r,i,a){window.innerWidth;let o=window.innerHeight,{w:l,h:s}=t,c=Math.floor(o*ly);if(!Number.isFinite(l)||!Number.isFinite(s)||l<=0||s<=0){let{right:t,top:n,placement:r}=lM(e,500,280,i);return{width:500,height:280,right:t,top:n,placement:r,displayedW:320,displayedH:200}}let d=lC(l,s,{thumbColPx:n,maxWindowW:500,maxWindowH:c,chrome:r,maxWindowWidthCap:500,minWindowW:a}),{right:u,top:h,placement:p}=lM(e,d.width,d.height,i);return{width:d.width,height:d.height,right:u,top:h,placement:p,displayedW:d.displayedW,displayedH:d.displayedH}}(u,{w:r,h:i},E,a,eQ.current,lb(E,o,220));null==eQ.current&&(eQ.current=e.placement),_(t=>t.width===e.width&&t.height===e.height?t:{width:e.width,height:e.height}),J(t=>t.w===e.displayedW&&t.h===e.displayedH?t:{w:e.displayedW,h:e.displayedH});let t=eQ.current,{right:n,top:l}=lM(u,e.width,e.height,t),s={right:n,top:l};X(e=>e.right===s.right&&e.top===s.top?e:s);return}if(!s||G)return;let d=lC(r,i,{thumbColPx:E,maxWindowW:l,maxWindowH:c,chrome:a,minWindowW:lb(E,o,150),fixedWindowW:n?Math.round(e-24):void 0});_(e=>e.width===d.width&&e.height===d.height?e:{width:d.width,height:d.height}),J(e=>e.w===d.displayedW&&e.h===d.displayedH?e:{w:d.displayedW,h:d.displayedH}),X({right:n?12:Math.round((e-d.width)/2),top:0})},[s,w,u,K,O,E,e1,k,G]);(0,a.useLayoutEffect)(()=>{e2(),e2()},[e2,T]),(0,a.useLayoutEffect)(()=>{if(!s&&!u)return;let e=new ResizeObserver(()=>e2()),t=eN.current,n=eG.current,r=eU.current;return t&&e.observe(t),n&&e.observe(n),r&&e.observe(r),()=>e.disconnect()},[s,u,e2,k]),(0,a.useEffect)(()=>{if(!s&&!u)return;let e=()=>e2();return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[s,u,e2]),(0,a.useEffect)(()=>{D.current.clear(),B(e=>e+1),Q(0),et(null),er(!1),ea(!1),el(!1),eJ.current.clear()}
1,[p]),(0,a.useEffect)(()=>{let e=eF.current,t=null===ee||ei?K:ee;if(e&&y.galleryVideo&&(0,ob.aF)(L(t))){if(s&&!w)return void e.play().catch(()=>{});e.pause(),W(e)}},[s,w,K,ee,ei,p,L,W,y.galleryVideo]),(0,a.useLayoutEffect)(()=>{if(!G)return;let e=eW.current;if(!e)return;let t=()=>q(t=>t.w===e.clientWidth&&t.h===e.clientHeight?t:{w:e.clientWidth,h:e.clientHeight});t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[G]);let e5=(0,a.useRef)({w:0,h:0});(0,a.useEffect)(()=>{if(!s&&!u||!eO.current||!eB.current)return;let e=new ResizeObserver(e=>{var t,n,r;let{width:i,height:a}=null!=(n=null==(t=e[0])?void 0:t.contentRect)?n:{},o=eB.current;if(!i||!a||!o)return;let l=e5.current.w,s=e5.current.h;if(Math.round(l)===Math.round(i)&&Math.round(s)===Math.round(a)&&l>0&&s>0)return;let c=o.getContext("2d");if(o.width=i,o.height=a,e5.current={w:i,h:a},eK.current)eK.current=!1;else if(c&&l>0&&s>0){let e=null;try{e=c.getImageData(0,0,l,s)}catch(e){}if(e){let t=document.createElement("canvas");t.width=l,t.height=s,null==(r=t.getContext("2d"))||r.putImageData(e,0,0),c.drawImage(t,0,0,l,s,0,0,i,a)}}});return e.observe(eO.current),()=>e.disconnect()},[s,u,K,ee]),(0,a.useEffect)(()=>{if(!ei||null===ee)return;let e=window.setTimeout(()=>el(!0),220);return()=>window.clearTimeout(e)},[ei,ee]),(0,a.useEffect)(()=>{let e=null!==ee&&eo&&en;if(!s&&!u||!eB.current||null!==ee&&!e)return;let t=eB.current,n=t.getContext("2d");if(!n)return;let r=eJ.current.get(K);requestAnimationFrame(()=>{requestAnimationFrame(()=>{let{w:e,h:i}=e5.current;if(!(e<=0)&&!(i<=0))if(r){var a;let{w:o,h:l,data:s}=r,c=document.createElement("canvas");c.width=o,c.height=l,null==(a=c.getContext("2d"))||a.putImageData(s,0,0);let d=t.width||e,u=t.height||i;n.drawImage(c,0,0,o,l,0,0,d,u)}else n.clearRect(0,0,t.width||e,t.height||i)})})},[s,u,K,ee,en,ei,eo]);let e3=(0,a.useCallback)((e,t)=>{let n=eB.current;if(!n)return null;let r=n.getBoundingClientRect(),i=r.width,a=r.height;if(i<1e-6||a<1e-6)return null;let o=n.width/i,l=n.height/a;return{x:(e-r.left)*o,y:(t-r.top)*l}},[]),e4=(0,a.useCallback)(()=>{let e=eB.current;if(!e)return em;let t=e.getBoundingClientRect(),n=t.width,r=t.height;return n<1e-6||r<1e-6?em:(e.width/n+e.height/r)/2*em},[em]),e6=(0,a.useMemo)(()=>{let{r:e,g:t,b:n}=(0,og.M)(eg,ev,ew);return"rgb(".concat(e,", ").concat(t,", ").concat(n,")")},[eg,ev,ew]),e8=(0,a.useCallback)(e=>{var t;let n=null==(t=eB.current)?void 0:t.getContext("2d");if(!n||!e$.current)return;n.strokeStyle=e6,n.lineWidth=e4(),n.lineCap="round",n.lineJoin="round";let r={last:e$.current,prev:e_.current};(0,tJ.Jb)(n,r,e),e$.current=r.last,e_.current=r.prev},[e4,e6]),e9=(0,a.useCallback)(e=>{if(!ed)return;e.preventDefault();let t=e3(e.clientX,e.clientY);if(t){var n;e.currentTarget.setPointerCapture(e.pointerId),eX.current=!0,e$.current=t,e_.current=null;let r=null==(n=eB.current)?void 0:n.getContext("2d");r&&(r.strokeStyle=e6,r.lineWidth=e4(),r.lineCap="round",r.lineJoin="round",r.beginPath(),r.moveTo(t.x,t.y))}},[ed,e4,e3,e6]),e7=(0,a.useCallback)(e=>{if(!ed||!eX.current)return;let t=e.nativeEvent;for(let e of"function"==typeof t.getCoalescedEvents?t.getCoalescedEvents():[t]){let t=e3(e.clientX,e.clientY);t&&e8(t)}},[ed,e3,e8]),te=(0,a.useCallback)(e=>{if(e)try{e.currentTarget.releasePointerCapture(e.pointerId)}catch(e){}eX.current=!1,e$.current=null,e_.current=null},[]),tt=(0,a.useCallback)((e,t)=>{if(w&&x){t.stopPropagation(),e!==K&&(eK.current=!1,er(!0),ea(!0),el(!0),et(null),Q(e)),x(t.clientX,t.clientY,p);return}if(e===K)return;let n=eB.current;if(n){let e=n.width,t=n.height;if(e>0&&t>0)try{let r=n.getContext("2d");if(r){let n=r.getImageData(0,0,e,t);eJ.current.set(K,{w:e,h:t,data:n})}}catch(e){}}eK.current=!0,er(!1),ea(!1),el(!1),et(K),Q(e)},[K,w,x,p]),tn=(0,a.useCallback)(()=>{eu(e=>!e),ep(!1)},[]);(0,a.useEffect)(()=>{if(!eh||!ed)return;let e=e=>{let t=eP.current,n=e.target;t&&n instanceof Node&&(t.contains(n)||ep(!1))};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[eh,ed]);let tr=(0,a.useCallback)(e=>{0===e.button&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),eR.current={startX:e.clientX,startY:e.clientY,startSize:em})},[em]),ti=(0,a.useCallback)(e=>{if(!eR.current)return;let{startY:t,startSize:n}=eR.current;ef(Math.max(1,Math.min(24,n+Math.round((t-e.clientY)/3))))},[]),ta=(0,a.useCallback)(e=>{if(!eR.current)return;let{startX:t,startY:n}=eR.current,r=e.clientX-t,i=Math.hypot(r,e.clientY-n)<("touch"===e.pointerType?12:5);eR.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch(e){}i&&ep(e=>!e)},[]),to=(0,a.useCallback)((e,t)=>{let n=eL.current;if(!n)return;let r=n.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e-r.left)/r.width)),a=Math.max(0,Math.min(1,(t-r.top)/r.height));ey(Math.round(100*i)),eb(Math.round((1-a)*100))},[]),tl=(0,a.useCallback)(e=>{let t=ez.current;if(!t)return;let n=t.getBoundingClientRect();ex(Math.round(360*Math.max(0,Math.min(1,(e-n.top)/n.height)))%360)},[]),ts=(0,a.useCallback)(e=>{0===e.button&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),eD.current="sb",to(e.clientX,e.clientY))},[to]),tc=(0,a.useCallback)(e=>{"sb"===eD.current&&to(e.clientX,e.clientY)},[to]),td=(0,a.useCallback)(e=>{if("sb"===eD.current){eD.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch(e){}}},[]),tu=(0,a.useCallback)(e=>{0===e.button&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),eD.current="hue",tl(e.clientY))},[tl]),th=(0,a.useCallback)(e=>{"hue"===eD.current&&tl(e.clientY)},[tl]),tp=(0,a.useCallback)(e=>{if("hue"===eD.current){eD.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch(e){}}},[]),tm=(0,a.useCallback)(()=>{let e=eB.current;if(!e)return;let t=e.getContext("2d"),n=e.width||e5.current.w,r=e.height||e5.current.h;t&&n>0&&r>0&&t.clearRect(0,0,n,r)},[]),tf=(0,a.useCallback)(()=>{v("AJ1 Gallery Inverted",{inverted:!es}),ec(e=>!e)},[es,v]),tg=(0,a.useCallback)(async()=>{let e=L(K);if((0,ob.aF)(e))return(await fetch(e.src)).blob();let t=eB.current,n=z(K),r=(null==t?void 0:t.width)||e5.current.w,i=(null==t?void 0:t.height)||e5.current.h;if(!t||r<=0||i<=0)return(await fetch(n)).blob();let a=document.createElement("canvas");a.width=r,a.height=i;let o=a.getContext("2d");if(!o)return(await fetch(n)).blob();let l=await new Promise((e,t)=>
1{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>e(r),r.onerror=t,r.src=n}),s=l.naturalWidth,c=l.naturalHeight,d=Math.min(r/s,i/c),u=s*d,h=c*d;return es&&(o.filter="invert(1)"),o.drawImage(l,0,0,s,c,(r-u)/2,(i-h)/2,u,h),o.filter="none",o.drawImage(t,0,0),new Promise((e,t)=>{a.toBlob(n=>n?e(n):t(Error("toBlob failed")),"image/png")})},[K,es,L]),tx=(0,a.useCallback)(async()=>{var e,t,n,r,i,a,o;try{let i=L(K),a=await tg(),o="FIG_00.".concat(String(K+1).padStart(2,"0")),l=(0,ob.aF)(i)?new File([a],oC(i.src),{type:a.type||"video/mp4"}):new File([a],"".concat(o,".png"),{type:"image/png"});if(null==(e=(t=navigator).canShare)?void 0:e.call(t,{files:[l]}))await navigator.share({title:"FIG 00.".concat(String(K+1).padStart(2,"0")),files:[l],text:"Sent from the Virgil Abloh Archive"});else{let e=URL.createObjectURL(a);await (null==(n=(r=navigator).share)?void 0:n.call(r,{title:"FIG 00.".concat(String(K+1).padStart(2,"0")),url:e,text:"Sent from the Virgil Abloh Archive"})),URL.revokeObjectURL(e)}v("AJ1 Image Shared",{surface:"gallery",footnote_index:K})}catch(t){let e=z(K);if(null==(i=navigator.clipboard)?void 0:i.write)try{let e=await tg();await navigator.clipboard.write([new ClipboardItem({"image/png":e})])}catch(t){null==(a=navigator.clipboard)||a.writeText(e)}else null==(o=navigator.clipboard)||o.writeText(e)}},[K,tg,v,L,z]),tv=(0,a.useCallback)(async()=>{try{let e=L(K),t=await tg(),n=document.createElement("a");n.href=URL.createObjectURL(t),n.download=(0,ob.aF)(e)?oC(e.src):"FIG_00.".concat(String(K+1).padStart(2,"0"),".png"),n.click(),URL.revokeObjectURL(n.href),v("AJ1 Image Saved",{surface:"gallery",footnote_index:K})}catch(e){window.open(z(K),"_blank")}},[K,tg,v,L,z]),ty=(0,a.useCallback)(e=>{eZ.current=e.target===e.currentTarget},[]),tw=(0,a.useCallback)(e=>{e.target===e.currentTarget&&eZ.current&&c()},[c]),tb=(0,a.useCallback)(()=>{s?c():null==m||m()},[s,c,m]),tk=(0,a.useCallback)(()=>{U(e=>!e)},[]),tC=(0,a.useCallback)(e=>{w&&!ed&&x&&(e.stopPropagation(),x(e.clientX,e.clientY,p))},[w,ed,x,p]),tM=(0,a.useMemo)(()=>{if(!u||s||"undefined"==typeof globalThis||!("innerWidth"in globalThis))return null;let e=globalThis.innerWidth-V.right-$.width,t=V.top,n="above"===eQ.current?u.top-t:u.bottom-t;return{x:u.left+u.width/2-e,y:n}},[u,s,V.right,V.top,$.width,$.height]);if(!N)return null;let tS=e=>"FIG ".concat(String(e+1).padStart(2,"0")),tj=null===ee||null!==ee&&!ei,tI=null===ee||ei?K:ee,tA=L(tI),tP=y.galleryVideo&&(0,ob.aF)(tA),tR=tP?(0,ob.VC)(tA):void 0,tE=y.galleryVideo&&(0,ob.aF)(L(K)),tL=null!==ee&&eo&&en,tz=(()=>{let{w:e,h:t}=O(tI),n=H.w,r=H.h;if(!(n>0)||!(r>0)||!(e>0)||!(t>0))return{w:n,h:r};let i=Math.max(n/e,r/t);return{w:Math.round(e*i),h:Math.round(t*i)}})(),tD=(s||w)&&!G,tT=Math.max(48,$.width-E-12),tB=null!=(t=null==d?void 0:d.x)?t:"undefined"!=typeof globalThis&&"innerWidth"in globalThis?globalThis.innerWidth/2:0,tF=null!=(n=null==d?void 0:d.y)?n:"undefined"!=typeof globalThis&&"innerHeight"in globalThis?globalThis.innerHeight/2:0,tW=(0,r.jsxs)(oR,{ref:eH,$right:V.right,$top:V.top,$width:$.width,$height:$.height,$isDragging:eC,$suppressOpenLayoutTransition:eS,$isHoverPeek:w,$contentAutoHeight:tD,$maximized:G,$minWidth:w?320:150,$hoverPeekOriginX:w?null!=(o=null==tM?void 0:tM.x)?o:$.width/2:void 0,$hoverPeekOriginY:w?null!=(l=null==tM?void 0:tM.y)?l:0:void 0,onClick:e=>e.stopPropagation(),children:[s&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(oE,{$placement:"left","aria-hidden":!0,onMouseDown:e0}),(0,r.jsx)(oE,{$placement:"right","aria-hidden":!0,onMouseDown:e0}),(0,r.jsx)(oE,{$placement:"bottom","aria-hidden":!0,onMouseDown:e0})]}),(0,r.jsxs)(oL,{ref:eN,onMouseDown:s?e0:void 0,children:[(0,r.jsxs)(oz,{children:[(0,r.jsx)(oB,{onClick:tb,type:"button","aria-label":"Close",children:(0,r.jsx)("svg",{viewBox:"0 0 14 14",fill:"none",children:(0,r.jsx)("path",{d:"M1 1l12 12M13 1L1 13",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}),s&&(0,r.jsx)(oB,{onClick:tk,type:"button","aria-label":G?"Restore":"Fullscreen",children:(0,r.jsx)("svg",{viewBox:"0 0 14 14",fill:"none",children:(0,r.jsx)("path",{d:"M1 5V1h4M13 5V1H9M1 9v4h4M13 9v4H9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,r.jsx)(oT,{children:Y(K)})]}),(0,r.jsxs)(oD,{children:[ed&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(oF,{onClick:tm,type:"button","aria-label":"Clear drawing",title:"Clear drawing",children:(0,r.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 6 6",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,
1children:(0,r.jsxs)("g",{transform:"translate(0.35714 0.35714)",children:[(0,r.jsx)("circle",{cx:"2.64286",cy:"2.64286",r:"2.5",stroke:"#D9D9D9",strokeWidth:"0.285714"}),(0,r.jsx)("path",{d:"M1.49 1.49L3.79 3.79M3.79 1.49L1.49 3.79",stroke:"#D9D9D9",strokeWidth:"0.285714",strokeLinecap:"round"})]})})}),(0,r.jsxs)(oq,{ref:eP,children:[(0,r.jsxs)(oG,{onPointerDown:tr,onPointerMove:ti,onPointerUp:ta,onPointerCancel:ta,title:"Drag to resize brush, tap for color",children:[(0,r.jsx)(oU,{$color:e6,"aria-hidden":!0}),(0,r.jsx)(oH,{$size:em,$color:e6})]}),eh&&(0,r.jsx)(oV,{onClick:e=>e.stopPropagation(),children:(0,r.jsxs)(oX,{children:[ek&&(0,r.jsx)(o_,{role:"group","aria-label":"Brush size",onPointerDown:e=>e.stopPropagation(),children:oN.map(e=>{let t=Math.max(4,Math.min(20,1.2*e));return(0,r.jsx)(oZ,{type:"button",$active:em===e,$dotSize:t,$color:e6,"aria-label":"Brush size ".concat(e),"aria-pressed":em===e,onClick:t=>{t.stopPropagation(),ef(e)}},e)})}),(0,r.jsxs)(o$,{children:[(0,r.jsx)(oJ,{ref:eL,$hue:eg,onPointerDown:ts,onPointerMove:tc,onPointerUp:td,onPointerCancel:td,title:"Saturation & brightness",children:(0,r.jsx)(oK,{$x:ev/100*100,$y:(1-ew/100)*100})}),(0,r.jsx)(oQ,{ref:ez,onPointerDown:tu,onPointerMove:th,onPointerUp:tp,onPointerCancel:tp,title:"Hue",children:(0,r.jsx)(o0,{$y:eg/360*100})})]})]})})]})]}),(0,r.jsx)(oF,{onClick:tn,type:"button","aria-label":"Draw",children:(0,r.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 6 6",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:(0,r.jsxs)("g",{transform:"translate(0.35714 0.35714)",children:[(0,r.jsx)("circle",{cx:"2.64286",cy:"2.64286",r:"2.5",stroke:"#D9D9D9",strokeWidth:"0.285714"}),(0,r.jsx)("path",{d:"M3.23228 3.00002L2.643 1.42859L2.08645 3.00002H3.23228Z",fill:ed?"#22c55e":"#D9D9D9"}),(0,r.jsx)("path",{d:"M1.42871 4.85716L2.08645 3.00002M3.92871 4.85716C3.65479 4.12671 3.44653 3.57134 3.23228 3.00002M3.23228 3.00002C3.05381 2.52408 2.87118 2.03708 2.643 1.42859L2.08645 3.00002M3.23228 3.00002H2.08645",stroke:"#D9D9D9",strokeWidth:"0.285714",strokeLinejoin:"round"})]})})}),(0,r.jsx)(oW,{onClick:tf,type:"button","aria-label":"Invert",children:(0,r.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 6 6",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("linearGradient",{id:eA,x1:"0",y1:"0",x2:"1",y2:"1",gradientUnits:"objectBoundingBox",children:[(0,r.jsx)("stop",{offset:"50%",stopColor:"#ffffff"}),(0,r.jsx)("stop",{offset:"50%",stopColor:"#000000"})]})}),(0,r.jsx)("g",{transform:"translate(0.35714 0.35714)",children:(0,r.jsx)("circle",{cx:"2.64286",cy:"2.64286",r:"2.5",fill:"url(#".concat(eA,")"),stroke:"#D9D9D9",strokeWidth:"0.285714"})})]})}),(0,r.jsx)(oF,{onClick:tx,type:"button","aria-label":"Share",children:(0,r.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,r.jsx)("path",{d:"M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8"}),(0,r.jsx)("polyline",{points:"16 6 12 2 8 6"}),(0,r.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"15"})]})}),(0,r.jsx)(oY,{onClick:tv,children:tE?"SAVE VIDEO":"SAVE IMG"})]})]}),(0,r.jsxs)(o1,{$fill:G,children:[(0,r.jsxs)(o2,{ref:eY,children:[(0,r.jsx)(o5,{ref:eW,$displayW:Z.w,$displayH:Z.h,$fill:G,onClick:tC,style:w&&!ed&&x?{cursor:"zoom-in"}:void 0,children:(0,r.jsxs)(o3,{ref:eO,$maximized:G,$w:tz.w,$h:tz.h,children:[(0,r.jsxs)(ln,{$inverted:es&&null===ee,children:[tP?(0,r.jsx)(ls,{ref:eF,src:tA.src,poster:tR,$cover:G,muted:w,playsInline:!0,preload:s&&!w?"auto":"none",controls:s&&!w,loop:s&&!w,style:{visibility:tj?"visible":"hidden"},onLoadedMetadata:e=>{let t=e.currentTarget;F(tI,t.videoWidth,t.videoHeight),(w||!s)&&W(t)},onLoadedData:e=>{(w||!s)&&W(e.currentTarget)}}):(0,r.jsx)(ll,{src:z(tI),alt:tS(tI),$cover:G,style:{visibility:tj?"visible":"hidden"},onLoad:e=>F(tI,e.currentTarget.naturalWidth,e.currentTarget.naturalHeight)}),null!==ee&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(lr,{$preloadHidden:!tL,$fadeIn:tL,onAnimationEnd:e=>{e.target===e.currentTarget&&(et(null),er(!1),ea(!1),el(!1))},children:(0,r.jsx)(la,{src:z(K),alt:tS(K),$cover:G,onLoad:e=>
1{F(K,e.currentTarget.naturalWidth,e.currentTarget.naturalHeight),er(!0)}})}),!ei&&(0,r.jsx)(li,{$fadeOut:!0,onAnimationEnd:e=>{e.target===e.currentTarget&&ea(!0)},children:(0,r.jsx)(la,{src:z(ee),alt:tS(ee),$cover:G})})]})]}),w&&tP&&tj&&null===ee&&(0,r.jsx)(lg,{}),(0,r.jsx)(lo,{ref:eB,$active:ed,$hidden:null!==ee,onPointerDown:e9,onPointerMove:e7,onPointerUp:te,onPointerCancel:te})]})}),(0,r.jsx)(o9,{ref:eG,children:k?(0,r.jsxs)(r.Fragment,{children:[I?(0,r.jsx)(lj,{text:k,maxHeightPx:j}):(0,r.jsx)(o4,{children:k}),C&&M?(0,r.jsx)(lI,{href:C,label:M}):null]}):null})]}),R?tD||G?(0,r.jsx)(ld,{$heightPx:eq>0?eq:280,$fill:G,children:(0,r.jsx)(lu,{$fillParent:!0,children:b.map((e,t)=>{let{w:n,h:i}=O(t),a=i>0&&Number.isFinite(n/i)?n/i:4/3;return(0,r.jsxs)(lv,{children:[(0,r.jsx)(lh,{$selected:K===t,$aspectRatio:a,onClick:e=>tt(t,e),type:"button",children:y.galleryVideo&&(0,ob.aF)(e)?(0,ob.VC)(e)?(0,r.jsx)("img",{src:(0,ob.VC)(e),alt:"",onLoad:e=>F(t,e.currentTarget.naturalWidth,e.currentTarget.naturalHeight)}):(0,r.jsx)(lc,{src:e.src,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":!0}):(0,r.jsx)("img",{src:z(t),alt:tS(t),onLoad:e=>F(t,e.currentTarget.naturalWidth,e.currentTarget.naturalHeight)})}),(0,r.jsx)(lx,{children:tS(t)})]},z(t))})})}):(0,r.jsx)(lu,{children:b.map((e,t)=>{let{w:n,h:i}=O(t),a=i>0&&Number.isFinite(n/i)?n/i:4/3;return(0,r.jsxs)(lv,{children:[(0,r.jsx)(lh,{$selected:K===t,$aspectRatio:a,onClick:e=>
1tt(t,e),type:"button",children:y.galleryVideo&&(0,ob.aF)(e)?(0,ob.VC)(e)?(0,r.jsx)("img",{src:(0,ob.VC)(e),alt:"",onLoad:e=>F(t,e.currentTarget.naturalWidth,e.currentTarget.naturalHeight)}):(0,r.jsx)(lc,{src:e.src,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":!0}):(0,r.jsx)("img",{src:z(t),alt:tS(t),onLoad:e=>F(t,e.currentTarget.naturalWidth,e.currentTarget.naturalHeight)})}),(0,r.jsx)(lx,{children:tS(t)})]},z(t))})}):null]}),k?(0,r.jsxs)(o7,{ref:eU,$widthPx:tT,"aria-hidden":!0,children:[(0,r.jsx)(o4,{children:k}),C&&M?(0,r.jsx)(lI,{href:C,label:M}):null]}):null]});return s?(0,r.jsx)(oj,{onClick:tw,onMouseDown:ty,children:(0,r.jsx)(oP,{$originX:tB,$originY:tF,children:tW})}):(0,r.jsx)(oI,{onMouseEnter:f,onMouseLeave:g,children:tW})}var lP=n(6136);let lR=(0,a.createContext)(null),lE="700px",lL="900px",lz="12px",lD="#00000015";function lT(e){let t=Array.from({length:e},(t,n)=>{let r=(n+1)*100/e;return'<line x1="'.concat(r,'%" y1="0" x2="').concat(r,'%" y2="100%" stroke="').concat(lD,'" stroke-width="1" stroke-dasharray="2 2" stroke-linecap="butt" vector-effect="non-scaling-stroke"/>')}).join("");return'url("data:image/svg+xml;charset=utf-8,'.concat(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" preserveAspectRatio="none">'.concat(t,"</svg>")),'")')}let lB=lT(12),lF=lT(24),lW=0/(parseInt(lL,10)-parseInt(lE,10)),lO=3e3-parseInt(lL,10),lY="/images/usmnt/arch.svg",lN="/images/aj1-article/article-sneaker-outline.svg",lG="/images/vaa_outline.png",lU=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-0"})(['grid-column:1 / -1;display:flex;justify-content:space-between;align-items:baseline;font-family:"Simon Mono","ABC Simon Mono Trial",monospace;font-weight:400;font-style:normal;font-size:10.68px;line-height:120%;letter-spacing:-0.03em;text-transform:uppercase;color:',";transition:color ",";padding-bottom:0.2em;@media (min-width:","){grid-column:4 / -4;}"],e=>{let{theme:t}=e;return t.colors.text},d.LT,lL),lH=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-1"})(["grid-column:1 / -1;width:100%;height:8px;box-sizing:border-box;border-top:1px dashed ",";border-left:1px dashed ",";border-right:1px dashed ",";margin-bottom:12px;@media (min-width:700px){border-top-width:1px;border-left-width:1px;border-right-width:1px;grid-column:2 / -2;}@media (min-width:","){grid-column:4 / -4;}"],lD,lD,lD,lL),lq=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-2"})(['grid-column:1 / -1;display:grid;grid-template-columns:subgrid;font-family:"Simon Mono","ABC Simon Mono Trial",monospace;font-weight:400;font-style:normal;font-size:',"px;line-height:120%;letter-spacing:-0.03em;color:",";transition:color ",";@media (min-width:","){font-size:min( ","px,calc( ","px + (100vw - ",") * "," ) );}@media (min-width:","){font-size:min( ","px,calc( ","px + (100vw - ",") * "," / "," ) );--article-shoe-display-width:calc( (100vw - 2 * ",") / "," * 12 * 0.62 * 1.8 );}"],14,e=>{let{theme:t}=e;return t.colors.text},d.LT,lE,14,14,lE,lW,lL,22,14,lL,8,lO,lz,24),lV=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-3"})(["grid-column:1 / -1;margin-bottom:4px;@media (min-width:","){grid-column:7 / 19;}"],lL),lX=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-4"})(["grid-column:2 / -1;width:100%;height:8px;box-sizing:border-box;border-bottom:1px dashed ",";border-left:1px dashed ",";border-right:1px dashed ",";margin-top:2em;margin-bottom:10px;@media (min-width:","){grid-column:6 / 19;}"],lD,lD,lD,lL),l$=o.Ay.blockquote.withConfig({componentId:"sc-e8dc6b46-5"})(["position:relative;grid-column:2 / -1;margin:0;padding-left:0.06em;font-family:Helvetica,-apple-system,BlinkMacSystemFont,sans-serif;font-weight:700;font-style:normal;font-size:23px;line-height:95%;letter-spacing:-0.03em;color:",";transition:color ",";&::before{content:'\"'; position: absolute; left: -0.45em; top: -0.03em; line-height: 1; font-weight: 700; font-family: inherit; color: inherit; pointer-events: none; } @media (min-width: ",") { grid-column: 6 / 18; font-size: clamp(30px, 3vw, 65px); }"],e=>{let{theme:t}=e;return t.colors.text},d.LT,lL),l_=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-6"})(["grid-column:1 / -1;margin-top:2em;display:grid;grid-template-columns:subgrid;overflow:visible;@media (min-width:","){grid-template-rows:auto auto auto;align-items:start;
1--mia-title-font-size:clamp(30px,3vw,65px);--mia-title-line-height:0.95;--mia-title-margin-bottom:22px;}"],lL),lZ=(0,o.Ay)(l_).withConfig({componentId:"sc-e8dc6b46-7"})(["@media (min-width:","){margin-bottom:60px;}"],lL),lJ=o.Ay.h2.withConfig({componentId:"sc-e8dc6b46-8"})(["margin:0;margin-bottom:22px;font-family:Helvetica,-apple-system,BlinkMacSystemFont,sans-serif;font-weight:700;font-style:normal;font-size:clamp(30px,3vw,65px);line-height:95%;letter-spacing:-0.03em;text-transform:uppercase;color:",";transition:color ",";grid-column:1 / -1;@media (min-width:","){grid-column:13 / -1;grid-row:1;align-self:start;font-size:var(--mia-title-font-size);line-height:var(--mia-title-line-height);margin-bottom:var(--mia-title-margin-bottom);}@media (max-width:700px){font-size:calc(12px + 6vw);}"],e=>{let{theme:t}=e;return t.colors.text},d.LT,lL),lK=(0,o.Ay)(lJ).withConfig({componentId:"sc-e8dc6b46-9"})(["@media (max-width:calc("," - 1px)){margin-top:1em;}"],lL),lQ=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-10"})(["min-width:0;grid-column:1 / -1;position:relative;overflow:visible;@media (min-width:","){grid-column:13 / -1;grid-row:2;}"],lL),l0=(0,o.Ay)(lQ).withConfig({componentId:"sc-e8dc6b46-11"})(["margin-top:1.25em;@media (min-width:","){margin-top:0;grid-row:3;}"],lL),l1=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-12"})(['grid-column:2 / -1;display:flex;justify-content:space-between;align-items:baseline;font-family:"Simon Mono","ABC Simon Mono Trial",monospace;font-weight:400;font-size:10.68px;line-height:120%;letter-spacing:-0.03em;text-transform:uppercase;color:',";margin-top:-6px;margin-bottom:30px;padding:0 4px;transition:color ",";@media (min-width:","){grid-column:6 / 19;}"],e=>{let{theme:t}=e;return t.colors.text},d.LT,lL),l2=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-13"})(["grid-column:2 / -1;width:100%;height:8px;box-sizing:border-box;border-top:1px dashed ",";border-left:1px dashed ",";border-right:1px dashed ",";margin-top:10px;margin-bottom:2px;@media (min-width:","){grid-column:6 / 19;}"],lD,lD,lD,lL),l5=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-14"})(["grid-column:1 / -1;display:grid;grid-template-columns:subgrid;@media (min-width:","){grid-template-rows:auto auto;align-items:start;}"],lL),l3=o.Ay.h3.withConfig({componentId:"sc-e8dc6b46-15"})(["font-family:Helvetica,-apple-system,BlinkMacSystemFont,sans-serif;font-weight:700;font-style:normal;font-size:64px;line-height:86%;letter-spacing:-0.04em;leading-trim:cap;text-align:justify;text-transform:uppercase;color:",";margin-top:1em;margin-bottom:24px;transition:color ",";grid-column:1 / -1;@media (min-width:","){grid-column:1 / 11;grid-row:1;}@media (max-width:700px){font-size:calc(12px + 6vw);}"],e=>{let{theme:t}=e;return t.colors.text},d.LT,lL),l4=o.Ay.span.withConfig({componentId:"sc-e8dc6b46-16"})(["display:flex;flex-direction:column;width:100%;"]),l6=o.Ay.span.withConfig({componentId:"sc-e8dc6b46-17"})(["display:flex;justify-content:space-between;align-items:baseline;gap:0.25em;width:100%;"]),l8=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-18"})(["grid-column:1 / -1;position:relative;height:0;overflow:visible;pointer-events:none;"]),l9=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-19"})(["position:absolute;right:calc(var(--vw) * -8vw);bottom:-100px;opacity:0.6;opacity:0.6;line-height:0;img{display:block;width:calc(var(--vw) * 100vw);height:auto;@media (min-width:700px){width:calc(var(--vw) * 64vw);}}"]),l7=(0,o.Ay)(l9).withConfig({componentId:"sc-e8dc6b46-20"})(["left:0;right:auto;bottom:-35px;z-index:2;img{width:calc(var(--vw) * 110vw);transform:translateX(-23%);@media (min-width:700px){width:calc(var(--vw) * 70.4vw);}}"]),se=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-21"})(["grid-column:1 / -1;@media (min-width:","){margin-bottom:60px;grid-column:1 / 12;grid-row:2;}"],lL),st=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-22"})(["grid-column:1 / -1;align-self:start;margin-top:1.25em;@media (min-width:","){grid-column:13 / -1;grid-row:2;margin-top:0;align-self:start;}"],lL),sn=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-23"})(["display:none;@media (min-width:","){display:block;position:relative;grid-column:1 / -1;height:30vw;pointer-events:none;}"],lL),sr=o.Ay.img.withConfig({componentId:"sc-e8dc6b46-24"})(["display:none;@media (min-width:","){display:block;position:absolute;inset:0;margin:auto;width:calc(var(--article-shoe-display-width) * 0.55125);height:auto;opacity:1;transform:translate( ","vw,-5% ) rotate( ","deg );transform-origin:50% 50%;will-change:transform;}"],lL,e=>{let{$revealT:t}=e;return(1-t)*12},e=>{let{$revealT:t}=e;return 10+(1-(1-Math.max(0,Math.min(1,t)))**3)*60}),si=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-25"})(["display:none;@media (min-width:","){display:block;margin-top:164px;margin-left:calc(100vw / 24);line-height:0;pointer-events:none;width:var(--article-shoe-display-width);}"],lL),sa=(0,o.Ay)(si).withConfig({componentId:"sc-e8dc6b46-26"})(["@media (min-width:","){position:absolute;top:200px;left:calc(100vw / 24);margin-top:0;z-index:0;img{transform:none;}}"],lL),so=(0,o.Ay)(si).withConfig({componentId:"sc-e8dc6b46-27"})(["@media (min-width:","){position:relative;z-index:2;margin-top:-136px;}"],lL),sl=o.Ay.img.withConfig({componentId:"sc-e8dc6b46-28"})(["display:block;width:100%;height:auto;opacity:0.7;transform:translateY(-50%);"]),ss=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-29"})(["display:none;@media (min-width:","){display:block;position:absolute;top:50%;right:calc(-100vw / 24);transform:translateY(-50%);line-height:0;opacity:0.7;pointer-events:none;width:calc(62% * 1.8 / 2);}img{display:block;width:100%;height:auto;}"],lL),sc=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-30"})(["position:absolute;inset:0;z-index:1;background-color:#fff;opacity:",";pointer-events:none;transition:opacity 0.32s ease-out;"],e=>{let{$opacity:t}=e;return t}),sd=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-31"})(["position:absolute;inset:0;z-index:0;pointer-events:none;backdrop-filter:blur(15px);-webkit-backdrop-filter:blur(15px);@media (max-width:700px){backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);}"]),su=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-32"})(["position:absolute;top:0;bottom:0;left:",";right:",";z-index:1;pointer-events:none;transform:translateZ(0);background-image:",";background-repeat:no-repeat;background-size:100% 100%;@media (min-width:","){background-image:",";}"],lz,lz,lB,lL,lF),sh=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-33"})(["position:relative;z-index:2;width:100%;display:grid;grid-template-columns:repeat(",",1fr);gap:0;@media (min-width:","){grid-template-columns:repeat(",",1fr);}"],12,lL,24),sp=o.Ay.section.withConfig({componentId:"sc-e8dc6b46-34"})(["position:relative;z-index:45;width:100%;padding:min(8vh,80px) "," 120px;pointer-events:auto;border-top:1px solid #eee;@media (max-width:700px){padding:min(8vh,80px) "," 100px;}"],lz,lz),sm=o.Ay.p.withConfig({componentId:"sc-e8dc6b46-35"})(["margin-bottom:1.25em;&:last-child{margin-bottom:0;}"]),sf=(0,o.AH)(["overflow:hidden;border-radius:6px;width:calc(100% - 1px);max-width:calc(100% - 1px);min-width:0;position:relative;box-sizing:border-box;"]),sg=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-36"})(["",""],sf),sx=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-37"})(["grid-column:1 / -1;display:grid;grid-template-columns:subgrid;align-items:start;margin-top:2.5em;overflow:visible;
1"]),sv=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-38"})(["grid-column:1 / -1;@media (max-width:calc("," - 1px)){order:2;}@media (min-width:","){grid-column:7 / 19;order:unset;}"],lL,lL),sy=o.Ay.figure.withConfig({componentId:"sc-e8dc6b46-39"})(["margin:0;grid-column:1 / -1;margin-top:1.25em;min-width:0;position:relative;z-index:0;overflow:visible;@media (max-width:calc("," - 1px)){order:1;margin-top:1.25em;}@media (min-width:","){grid-column:21 / -1;margin-top:0;order:unset;padding-left:7px;box-sizing:border-box;}figcaption{position:relative;z-index:1;}"],lL,lL),sw=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-40"})(["position:relative;width:100%;overflow:visible;","{position:relative;z-index:1;}"],sg),sb=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-41"})(["position:absolute;z-index:0;top:calc(100% + 90px);left:calc(40vw - ",");line-height:0;opacity:0.6;pointer-events:none;@media (min-width:","){left:calc( 40vw - "," - (20 / 24) * (100vw - 2 * ",") - 7px );}img{display:block;width:calc(var(--vw) * 100vw);height:auto;@media (min-width:700px){width:calc(var(--vw) * 64vw);}}"],lz,lL,lz,lz),sk=o.Ay.figure.withConfig({componentId:"sc-e8dc6b46-42"})(["margin:0;grid-column:1 / -1;margin-top:1.25em;min-width:0;position:relative;overflow:visible;@media (max-width:calc("," - 1px)){order:3;margin-top:20px;margin-bottom:0;}@media (min-width:","){grid-column:1 / 5;margin-top:0;order:unset;padding-right:7px;box-sizing:border-box;align-self:end;}"],lL,lL),sC=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-43"})(["position:relative;width:100%;overflow:visible;"]),sM=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-44"})(["display:none;@media (min-width:","){display:block;margin-left:calc(-100vw / 24 - 30px);margin-bottom:24px;transform:translateY(50px);line-height:0;opacity:0.7;pointer-events:none;width:calc(62% * 1.8 * 2.3 * 1.05);}img{display:block;width:100%;height:auto;transform:translateY(-50%);}"],lL),sS=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-45"})(["grid-column:1 / -1;position:relative;@media (min-width:","){grid-column:1 / 12;grid-row:2 / -1;align-self:start;}"],lL),sj=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-46"})(["display:flex;flex-direction:column;gap:18px;width:100%;@media (min-width:","){display:grid;grid-template-columns:1fr 1fr;column-gap:14px;row-gap:0;align-items:start;}"],lL),sI=(0,o.Ay)(sS).withConfig({componentId:"sc-e8dc6b46-47"})(["margin-top:20px;@media (min-width:","){margin-top:0;","{position:relative;z-index:1;}}"],lL,sj),sA=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-48"})(["@media (min-width:","){position:relative;","{position:relative;z-index:1;}}"],lL,sj),sP=(0,o.Ay)(sS).withConfig({componentId:"sc-e8dc6b46-49"})(["@media (min-width:","){","{position:relative;z-index:1;}}"],lL,sj),sR=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-50"})(["display:flex;flex-direction:column;gap:18px;align-items:flex-start;min-width:0;width:100%;"]),sE=o.Ay.figure.withConfig({componentId:"sc-e8dc6b46-51"})(["margin:0;width:100%;max-width:100%;min-width:0;box-sizing:border-box;"]),sL=o.Ay.img.withConfig({componentId:"sc-e8dc6b46-52"})(["display:block;width:calc(100% + 2px);max-width:none;height:auto;margin-left:-1px;vertical-align:top;cursor:",";"],e=>{let{$clickable:t}=e;return t?"pointer":"default"}),sz=(0,o.AH)(['width:calc(100% - 1px);max-width:calc(100% - 1px);margin-top:6px;font-family:"Simon Mono","ABC Simon Mono Trial",monospace;font-weight:400;font-size:10.68px;line-height:120%;letter-spacing:-0.03em;text-align:left;color:',";transition:color ",";word-break:break-all;"],e=>{let{theme:t}=e;return t.colors.text},d.LT),sD=o.Ay.figcaption.withConfig({componentId:"sc-e8dc6b46-53"})(["",""],sz),sT=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-54"})([""," aspect-ratio:",";@media (min-width:","){flex:1;min-height:0;}"],sf,e=>{let{$aspectRatio:t}=e;return t},lL),sB=(0,o.Ay)(sL).withConfig({componentId:"sc-e8dc6b46-55"})(["margin-left:0;position:absolute;inset:-1px;width:calc(100% + 2px);height:calc(100% + 2px);object-fit:cover;"]),sF=o.Ay.div.withConfig({componentId:"sc-e8dc6b46-56"})(["grid-column:1 / -1;display:grid;grid-template-columns:1fr;gap:12px;margin-top:1.25em;margin-bottom:1.25em;@media (min-width:","){grid-template-columns:subgrid;column-gap:0;align-items:stretch;}"],lL),sW=o.Ay.figure.withConfig({componentId:"sc-e8dc6b46-57"})(["margin:0;grid-column:1 / -1;min-width:0;@media (min-width:","){grid-column:",";padding-right:7px;box-sizing:border-box;min-height:0;height:100%;align-self:stretch;display:flex;flex-direction:column;}"],lL,e=>{let{$wide:t=!0}=e;return t?"1 / 15":"1 / 11"}),sO=o.Ay.figure.withConfig({componentId:"sc-e8dc6b46-58"})(["margin:0;grid-column:1 / -1;min-width:0;@media (min-width:","){grid-column:",";padding-left:7px;box-sizing:border-box;min-height:0;height:100%;align-self:stretch;display:flex;flex-direction:column;}"],lL,e=>{let{$wide:t=!1}=e;return t?"11 / -1":"15 / -1"}),sY="/images/usmnt/top",sN="".concat(sY,"/DennisWinner.jpg"),sG="".concat(sY,"/StarsAndStripes.jpg"),sU=[{src:"/images/usmnt/DemDarePlugger_RegNoc.jpg",label:"DemDarePlugger_RegNoc.jpg",alt:"Dem Dare event flyer illustration"},{src:"/images/usmnt/LL-crew.png",label:"LL-crew.png",alt:"Lo-Lifes crew photograph"}
1,{src:"/images/usmnt/harold_hunter_1.jpg",label:"harold_hunter_1.jpg",alt:"Harold Hunter wearing USA cap and polo shirt"}],sH=[{src:"/images/usmnt/QUALIFIED.png",label:"QUALIFIED.png",alt:"USMNT qualified graphic"},{src:"/images/usmnt/LockerROomUSMNT.png",label:"LockerROomUSMNT.png",alt:"USMNT locker room photograph"},{src:"/images/usmnt/Striker%20and%20Pele.jpg",label:"Striker and Pele.jpg",alt:"Striker and Pel\xe9 photograph"}],sq=o.Ay.span.withConfig({componentId:"sc-e8dc6b46-59"})(["display:inline;box-decoration-break:clone;-webkit-box-decoration-break:clone;background-image:linear-gradient(currentColor,currentColor);background-size:100% 1px;background-position:0 calc(100% - 0.08em);background-repeat:no-repeat;transition:background-size 0.18s ease;"]),sV=o.Ay.span.withConfig({componentId:"sc-e8dc6b46-60"})(['cursor:pointer;position:relative;display:inline;padding:0.06em 0.12em 0.06em;margin:0 -0.12em;transition:background-color 0.18s ease,color 0.18s ease;box-decoration-break:clone;-webkit-box-decoration-break:clone;&[data-hovered="true"] ',"{background-size:100% 0;}"],sq),sX=o.Ay.sup.withConfig({componentId:"sc-e8dc6b46-61"})(["font-size:0.68em;font-weight:600;margin-left:0.08em;line-height:0;position:relative;top:-0.05em;"]);function s$(e){let{word:t,displayNumber:n,footnoteId:i,onOpenGallery:o,showReferenceNumber:l=!0}=e,s=(0,a.useContext)(lR),[c,d]=(0,a.useState)(0),[u,h]=(0,a.useState)(!1),p=(200+23*function(e){let t=0;for(let n=0;n<e.length;n++)t+=e.charCodeAt(n);return t%12}(n))%360;return(0,r.jsxs)(sV,{"data-footnote-id":i,"data-hovered":u?"true":"false",style:{backgroundColor:u?"hsl(".concat((p+30*c)%360," 72% 42%)"):"transparent",color:u?"#fff":"inherit"},onMouseEnter:e=>{var t;d(e=>(e+1)%12),h(!0);let n=e.currentTarget.getBoundingClientRect();null==s||null==(t=s.onFootnoteGalleryHoverEnter)||t.call(s,{anchor:{top:n.top,left:n.left,bottom:n.bottom,width:n.width},footnoteId:i})},onMouseLeave:()=>{var e;h(!1),null==s||null==(e=s.onFootnoteGalleryHoverLeave)||e.call(s)},onClick:e=>{e.preventDefault(),e.stopPropagation(),o(e.clientX,e.clientY,i)},children:[(0,r.jsx)(sq,{children:t}),l?(0,r.jsx)(sX,{"aria-label":"Reference ".concat(n),children:n}):null]})}function s_(e){let{word:t,n,onOpenGallery:i,showReferenceNumber:a=!0,galleryId:o}=e;return i?(0,r.jsx)(s$,{word:t,displayNumber:n,footnoteId:null!=o?o:n,onOpenGallery:i,showReferenceNumber:a}):(0,r.jsxs)(r.Fragment,{children:[t,(0,r.jsx)(sX,{"aria-label":"Reference ".concat(n),children:n})]})}let sZ="/images/usmnt/dennis",sJ=[{src:"".concat(sZ,"/Fremantle.jpg"),label:"Fremantle.jpg",alt:"Nike Freemantle foulweather jacket, 1987"},{src:"".concat(sZ,"/CelebratoryBuds.png"),label:"CelebratoryBuds.png",alt:"Stars & Stripes crew celebration photograph"},{src:"".concat(sZ,"/DC_Salute.jpg"),label:"DC_Salute.jpg",alt:"Dennis Conner aboard Stars & Stripes"}],sK=[{src:"".concat(sZ,"/StarsAndSails.jpg"),label:"StarsAndSails.jpg",alt:"Stars & Stripes racing photograph"},{src:"".concat(sZ,"/WorldBron.png"),label:"WorldBron.png",alt:"LeBron James V.A.A. football jersey photograph",revealsMarker:!0}],sQ=(0,a.forwardRef)(function(e,t){let{articleProgress:n=0,onOpenGallery:o,onFootnoteGalleryHoverEnter:l,onFootnoteGalleryHoverLeave:s}=e,c=(0,a.useRef)(null),d=(0,a.useCallback)(e=>{c.current=e,"function"==typeof t?t(e):t&&(t.current=e)},[t]);(0,lP.HU)(c,lP.a5);let u=(0,a.useRef)(null),[h,p]=(0,a.useState)(0),m=(0,i.md)(eL),f=(0,a.useRef)(m);return f.current=m,(0,a.useEffect)(()=>{let e=u.current;if(!e)return;let t=parseInt(lL,10),n=()=>
1{if(f.current)return;if(window.innerWidth<t)return void p(0);let n=e.getBoundingClientRect(),r=window.innerHeight;p(Math.max(0,Math.min(1,(r-n.top)/(r-.25*r))))};return n(),window.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n),()=>{window.removeEventListener("scroll",n),window.removeEventListener("resize",n)}},[]),(0,r.jsx)(lR.Provider,{value:{onFootnoteGalleryHoverEnter:l,onFootnoteGalleryHoverLeave:s},children:(0,r.jsxs)(sp,{ref:d,children:[(0,r.jsx)(sd,{"aria-hidden":!0}),(0,r.jsx)(sc,{$opacity:n>=1?1:.5,"aria-hidden":!0}),(0,r.jsx)(su,{"aria-hidden":!0}),(0,r.jsxs)(sh,{children:[(0,r.jsxs)(lU,{children:[(0,r.jsx)("span",{children:"title: AMERICAN OPTIMISTS"}),(0,r.jsx)("span",{children:"tc: n/a \xa0 pc: n/a"})]}),(0,r.jsx)(lH,{}),(0,r.jsxs)(lq,{children:[(0,r.jsx)(lV,{children:(0,r.jsxs)(sm,{children:["Football never stops. The clock ticks even during goal celebrations, play continues through most injuries, and even set pieces twitch with off-ball movement. The minutes before kick-off are about as still as the game gets. Players line up on the pitch in steely silence and the camera"," ",(0,r.jsx)(s_,{word:"lingers in their faces",n:"01",onOpenGallery:o})," ","as the anthems swell. Perhaps"," ",(0,r.jsx)(s_,{word:"Peter Drury",n:"02",onOpenGallery:o})," ","is on the mic, delivering a charmingly florid preface to the match that’s about to unfold. Nike’s X2 collection, a set of national pairings between clubs and designers, celebrates these moments of tension, focused on gear meant for"," ",(0,r.jsx)(s_,{word:"pre-match rituals like warm-ups and national anthems",n:"03",onOpenGallery:o}),". For the 2026 Men’s World Cup, V.A.A.™ has designed a range of apparel and footwear that filters the recent history of American sportswear and its relationship with football through Virgil’s design codes."]},"essay-open")}),(0,r.jsxs)(sF,{children:[(0,r.jsxs)(sW,{$wide:!1,children:[(0,r.jsx)(sT,{$aspectRatio:"1081 / 1379",children:(0,r.jsx)(sB,{src:sN,alt:"Dennis Conner holding the America's Cup trophy",loading:"lazy",decoding:"async"})}),(0,r.jsx)(sD,{children:"DennisWinner.jpg"})]}),(0,r.jsxs)(sO,{$wide:!0,children:[(0,r.jsx)(sT,{$aspectRatio:"1650 / 1382",children:(0,r.jsx)(sB,{src:sG,alt:"Stars & Stripes logo",loading:"lazy",decoding:"async"})}),(0,r.jsx)(sD,{children:"StarsAndStripes.jpg"})]})]}),(0,r.jsx)(l8,{"aria-hidden":!0,children:(0,r.jsx)(l9,{children:(0,r.jsx)("img",{src:lG,alt:"",decoding:"async"})})}),(0,r.jsxs)(lZ,{children:[(0,r.jsx)(lJ,{children:"BIG BAD DENNIS"}),(0,r.jsxs)(lQ,{children:[(0,r.jsxs)(sm,{children:["In 1851, the schooner"," ",(0,r.jsx)(s_,{word:"America",n:"04",onOpenGallery:o}),", representing the New York Yacht Club, sailed across the Atlantic to race a bunch of British yachts around the Isle of Wight. America smoked them so thoroughly that it was immortalized in the name of the race we still call the America’s Cup. It’s worth taking a moment to outline how unique a competition it is. It is the oldest active competition in organized sport. It has no fixed schedule, but is typically raced every three or four years. The defending champion determines the rules of the next cup, from the location, to the timing, to which class of boats will be raced. Any aspiring champions have to compete amongst themselves in the Challenger Selection Series for the right to face the defender. These structural advantages are a big part of why the New York Yacht Club defended the cup for 132 years, and why it was such a big deal that"," ",(0,r.jsx)(s_,{word:"Dennis Conner",n:"05",onOpenGallery:o})," ","and his team lost it to Australia II and John Bertand of the Royal Perth Yacht Club in 1983."]},"essay-dennis-america"),(0,r.jsxs)(sm,{children:["Conner wasted no time mounting a challenge to reclaim the"," ",(0,r.jsx)(s_,{word:"Auld Mug",n:"06",onOpenGallery:o}),", and there was no skipper in the world better prepared to do so. In the lead up to the 1980 America’s Cup, Conner was credited with professionalizing the competition, becoming the first skipper to pay his team and insist on a full-time commitment, training 300 days a year with multiple boats. He was a fanatical competitor and had a keen sense of narrative, co-authoring numerous books on sailing with titles like"," ",(0,r.jsx)(s_,{word:"No Excuse To Lose",n:"07",onOpenGallery:o}),". This comeback story, paired with live coverage on ESPN and the arrival of luxury sponsors, elevated the profile of the competition and made Conner a"," ",(0,r.jsx)(s_,{word:"celebrity",n:"08",onOpenGallery:o}),". When he beat Kookaburra III in Perth in 1987 to reclaim the cup, he was given a hero’s welcome, even from the Australian supporters—Conner’s victory was greeted with a sign that read"," ",(0,r.jsx)(s_,{word:"Well done Dennis you bastard.",n:"09",onOpenGallery:o})," "]},"essay-dennis-conner"),(0,r.jsx)(sm,{children:"America loves a dynasty, but not as much as it loves triumphant underdogs, especially ones with swag as indelible as Conner and his team’s."},"essay-dennis-dynasty")]}),(0,r.jsxs)(sI,{children:[(0,r.jsxs)(sj,{children:[(0,r.jsx)(sR,{children:sJ.map(e=>(0,r.jsxs)(sE,{children:[(0,r.jsx)(sg,{children:(0,r.jsx)(sL,{src:e.src,alt:e.alt,loading:"lazy",decoding:"async"})}),(0,r.jsx)(sD,{children:e.label})]},e.label))}),(0,r.jsx)(sR,{children:sK.map(e=>{let t="revealsMarker"in e&&!0===e.revealsMarker;return(0,r.jsxs)(sE,{children:[(0,r.jsx)(sg,{children:(0,r.jsx)(sL,{src:e.src,alt:e.alt,loading:"lazy",decoding:"async",$clickable:t,role:t?"button":void 0,"aria-label":t?"Reveal marker":void 0,onClick:t?e=>(0,tv.gX)(e.clientX,e.clientY):void 0})}),(0,r.jsx)(sD,{children:e.label})]},e.label)})})]}
1),(0,r.jsx)(sa,{"aria-hidden":!0,children:(0,r.jsx)(sl,{src:lY,alt:"",decoding:"async"})})]}),(0,r.jsxs)(l0,{children:[(0,r.jsx)(ss,{"aria-hidden":!0,children:(0,r.jsx)("img",{src:lN,alt:"",decoding:"async"})}),(0,r.jsx)(sm,{children:"Conner’s syndicate was called Stars & Stripes, and photographs from the 1987 race capture a crew united yet individually expressive. A Washington Post article published the week before the race refers to them as “ragtag amateurs” who “have the freedom to say what they think and wear what they please.” Most of them wore white, and the pieces that really stood out were a team jacket, optic white with thin red and blue striping around the trunk, and a cap emblazoned with the team logo that features the same sort of billowing flag motif that dominates this year’s USMNT home kit. Photos from the 1987 race were foundational for the V.A.A.™ X2 collection—those jackets were canvases bright and wide as sails, primed to be coded with patches, crests, and text."},"essay-dennis-stars"),(0,r.jsxs)(sm,{children:["Coverage of Conner’s redemptive campaign raised sailing’s prominence in popular culture, turning a niche hobby for the wealthy into a mainstream sport, boosting the appeal of preppy, nautically-coded American fashion: Polo Ralph Lauren, Nautica, Helly Hansen. Crisp, clean, technical, and vibrant, already steeped in the semiotics of toney leisure pursuits like sailing, redolent with the visual cues Conner’s revenge arc pumped through the media. In 1987, Nike released its one and only"," ",(0,r.jsx)(s_,{word:"boating range",n:"10",onOpenGallery:o}),", drafting off the sudden popularity of the sport and its attendant lifestyle. The Freemantle jacket from this collection became the basis for the Staff Jacket from the V.A.A.™ X2 collection. This was a moment of hybridity, where one set of signifiers bled into another—the kind of slippage between spheres that animated so much of V’s thinking and output."]},"essay-dennis-nike")]})]}),(0,r.jsxs)(sF,{children:[(0,r.jsxs)(sW,{children:[(0,r.jsx)(sT,{$aspectRatio:"1652 / 1351",children:(0,r.jsx)(sB,{src:"/images/usmnt/Lo-Lifes_Team_crop.jpg",alt:"Lo-Lifes crew team photograph",loading:"lazy",decoding:"async"})}),(0,r.jsx)(sD,{children:"Lo-Lifes_Team_crop.jpg"})]}),(0,r.jsxs)(sO,{children:[(0,r.jsx)(sT,{$aspectRatio:"1081 / 1351",children:(0,r.jsx)(sB,{src:"/images/usmnt/ChrisRichards_Anthem.jpg",alt:"Chris Richards singing the national anthem",loading:"lazy",decoding:"async"})}),(0,r.jsx)(sD,{children:"ChrisRichards_Anthem.jpg"})]})]}),(0,r.jsx)(l8,{"aria-hidden":!0,children:(0,r.jsx)(l9,{children:(0,r.jsx)("img",{src:lG,alt:"",decoding:"async"})})}),(0,r.jsxs)(l5,{children:[(0,r.jsx)(l3,{children:(0,r.jsxs)(l4,{children:[(0,r.jsxs)(l6,{children:[(0,r.jsx)("span",{children:"A"}),(0,r.jsx)("span",{children:"Bunch"}),(0,r.jsx)("span",{children:"Of"})]}),(0,r.jsxs)(l6,{children:[(0,r.jsx)("span",{children:"Dudes,"}),(0,r.jsx)("span",{children:"(fly)"})]}),(0,r.jsx)("span",{children:"Together"})]})}),(0,r.jsxs)(se,{children:[(0,r.jsx)(sm,{children:"Anyone growing up in America in the 90s couldn't help but be familiar with these lifestyle and sportswear brands and their iconography. The Polo horse crest was the most prominent of a set of symbols that were simply part of the visual firmament, drip-fed via advertising and readily accessible even in small-town department stores. These clothes were designed with country clubs in mind, but the potency of their branding made them widely coveted, and the late 80s and early 90s saw kids far outside their target demographics finding themselves in these brands and claiming them as their own."},"essay-america-brands"),(0,r.jsxs)(sm,{children:["Growing up just outside Chicago, Virgil was activated by hand-drawn flyers for Dem Dare's parties. Formed in the early 90s,"," ",(0,r.jsx)(s_,{word:"Dem Dare",n:"11",onOpenGallery:o})," ","was a loose collective of rappers, DJs, producers, artists, and dancers with a strong affinity for Polo and a focus on Black excellence and the pursuit of education and wellness. The posters were drawn by founding member"," ",(0,r.jsx)(s_,{word:"Reggieknow",
1n:"12",onOpenGallery:o})," ","and depicted young Black kids dipped in Polo and adjacent brands. In an"," ",(0,r.jsx)(s_,{word:"interview",n:"12",galleryId:"12-interview",showReferenceNumber:!1,onOpenGallery:o})," ","with Complex's Lei Takanashi, Virgil spoke of the influence that these posters had on him: “I think a lot of stories are told from New York's and L.A.'s subcultures, but Dem Dare was ours. That Polo culture was an important movement that Reg spearheaded, and he developed the idea of Black kids in Polo with dreads. This is before the internet. Those flyers and the Dem Dare aesthetic, that was a fashion house to me.” This flashpoint of inspiration showed up time and again in Virgil's work. It's no coincidence that Pyrex Vision, his first major foray into fashion and brand building, was made by screenprinting on repurposed Rugby Ralph Lauren flannels. V would close the loop by working with Reggie at Louis Vuitton, tapping him to develop characters and animations for a film called"," ",(0,r.jsx)(s_,{word:"The Adventures of Zoooom and Friends",n:"13",onOpenGallery:o}),", released in support of the Spring/Summer 2021 collection."]},"essay-virgil-dem-dare"),(0,r.jsxs)(sm,{children:["Dem Dare, the"," ",(0,r.jsx)(s_,{word:"Lo Lifes",n:"14",onOpenGallery:o}),", and similar crews gave Polo a sort of credibility that Ralph Lauren never could have predicted. They became the face of an undersung segment of the brand's popularity: Black and Latino kids growing up in urban centers, often in low-income neighborhoods. In other words, they made it hip-hop, contributing massively to the brand's reach and relevance at a time when Black aesthetics and art were pop culturally ascendant. They broadened the brand's base and contributed incalculably to its longevity. These kids were some of the brand's loudest evangelists, dedicated to wearing as much Polo as they possibly could. Today, Polo acknowledges and embraces these crews, but that wasn't always the case. Key to the Lo Life lifestyle was that most of their gear was stolen—“racked” or “boosted” from major Manhattan department stores. Narrating a short"," ",(0,r.jsx)(s_,{word:"documentary",n:"15",onOpenGallery:o})," ","made to accompany his book"," ",(0,r.jsx)(s_,{word:"Bury Me With the Lo On",n:"16",onOpenGallery:o}),","," ",(0,r.jsx)(s_,{word:"Thirstin Howl III",n:"17",onOpenGallery:o})," ","explained that the idea was really just to take up space and make everything fresh, to move as a platoon drenched in the latest, hardest-to-get Polo—“a bunch of dudes, fly together.” These were friends first and foremost who did virtually everything as a unit, sometimes 60 or more deep, meeting at the Empire Roller Rink in Crown Heights before mobbing into the city to take over a Times Square movie theater or rush a Bloomingdale's for its"," ",(0,r.jsx)(s_,{word:"P-Wings",n:"18",onOpenGallery:o})," ","and"," ",(0,r.jsx)(s_,{word:"Cookies",n:"19",onOpenGallery:o}),". Howl described the look of crews heading into the city as “a united front of Polo Ralph Lauren garments emblazoned with various patches, crests, and silks.” They evoked a"," ",(0,r.jsx)(s_,{word:"team with no sport",n:"20",onOpenGallery:o}),", all clearly affiliated but each with their own variation on the theme, not quite monolithic in vibe. Since so much Polo gear is athletic in nature, the effect is similar to that of a football team warming up pre-match, each player using the same kit of parts slightly differently."]},"essay-lolifes-credibility"),(0,r.jsxs)(sm,{children:["Racking Polo might not technically be a sport, but Lo Lifes sure treated it and talked about it like one. If you enjoyed watching Michael Jordan and Dennis Rodman break down their greatest performance play by play in The Last Dance, you might also dig hearing Rack-Lo"," ",(0,r.jsx)(s_,{word:"recount",n:"21",onOpenGallery:o})," ","particularly fruitful trips to Bergdorf Goodman on his YouTube channel. Howl's"," ",(0,r.jsx)(s_,{word:"How Lo Can You Go",n:"22",onOpenGallery:o})," ","videos surveying his collection are edited to a similar effect as a fan-made"," ",(0,r.jsx)(s_,{word:"highlights package",n:"23",onOpenGallery:o}
1),"—a sprawling genre of video folk art key to sports fandom that thwarts copyright laws with commercial software and unbridled enthusiasm."]},"essay-racking"),(0,r.jsxs)(sm,{children:["Dem Dare's recoding of genteel signifiers and the Lo Lifes' self-perception as outsiders taking what they wanted is totally consonant with the same American sporting ethos Conner embodied. They were certainly underdogs, born into tough circumstances and facing structural disadvantages in the form of racism and poverty. The notion that anything desired must be taken is precisely the stuff of half-time pep talks and post-game truisms, from the smallest rural high schools, to colleges with stadiums that seat six-figure crowds, to Madison Square Garden. The Lo Lifes were outsiders demanding a piece of the good life in the mode of beloved American arrivistes, like the"," ",(0,r.jsx)(s_,{word:"wise guy protagonists of Martin Scorsese",n:"24",onOpenGallery:o})," ","or"," ",(0,r.jsx)(s_,{word:"Ralph Lauren himself",n:"25",onOpenGallery:o}),"."]},"essay-american-ethos"),(0,r.jsx)(sm,{children:"That's not the worst analogy for the USMNT, either. America's first experience with a contemporary World Cup was Italia '90, a tournament for which few expected they'd qualify. Football was not a popular sport by any stretch in America in 1990, but the country rallied around that squad of collegiate athletes and semi-pros. Their kits were basic but effective, and items like their caps became signifiers for a moment of nothing-to-lose enthusiasm in a novel sporting arena. The Americans may have lost all three of their group stage matches, but many of them went on to play in Europe, further priming the nation for the 1994 tournament, which had already been awarded to the US back in 1988. Impressed by the success of the 1984 Los Angeles Olympics, FIFA wagered a World Cup held on American soil would be huge in developing the sport commercially. FIFA stipulated that the US had to follow the World Cup with the establishment of a unified professional league, and thus the MLS was born."},"essay-usmnt"),(0,r.jsxs)(sm,{children:["In '94, US Soccer welcomed the world in all-American fashion with"," ",(0,r.jsx)(s_,{word:"Striker",n:"26",onOpenGallery:o}),", an affable cartoon dog mascot designed by Warner Brothers. The USMNT fared better this time around, upsetting Colombia to get out of the group stage before losing to eventual champions Brazil in the Round of 16, and the tournament itself was a resounding success, smashing World Cup attendance records. It was a major turning point for Nike in football, too. Nike had been making football boots since the 80s but truly established itself as a force on the pitch during the '94 tournament. The final was played in Pasadena, on hallowed collegiate sporting ground at the Rose Bowl, and when the Italian and Brazilian sides took the pitch, almost half of them were wearing"," ",(0,r.jsx)(s_,{word:"Tiempo Premiers",n:"27",onOpenGallery:o}),". In 1995, Nike became US Soccer's official kit sponsor, and the two have been intertwined since."]},"essay-usmnt-94")]}),(0,r.jsx)(st,{children:(0,r.jsxs)(sA,{children:[(0,r.jsxs)(sj,{children:[(0,r.jsx)(sR,{children:sU.map(e=>(0,r.jsxs)(sE,{children:[(0,r.jsx)(sg,{children:(0,r.jsx)(sL,{src:e.src,alt:e.alt,loading:"lazy",decoding:"async"})}),(0,r.jsx)(sD,{children:e.label})]},e.label))}),(0,r.jsx)(sR,{children:sH.map(e=>(0,r.jsxs)(sE,{children:[(0,r.jsx)(sg,{children:(0,r.jsx)(sL,{src:e.src,alt:e.alt,loading:"lazy",decoding:"async"})}),(0,r.jsx)(sD,{children:e.label})]},e.label))})]}),(0,r.jsx)(so,{"aria-hidden":!0,children:(0,r.jsx)(sl,{src:lY,alt:"",decoding:"async"})})]})})]}),(0,r.jsx)(sn,{ref:u,"aria-hidden":!0,children:(0,r.jsx)(sr,{src:"/images/usmnt/shoebottom.png",alt:"",decoding:"async",$revealT:h})}),(0,r.jsxs)(l_,{children:[(0,r.jsxs)(sP,{children:[(0,r.jsxs)(sj,{children:[(0,r.jsxs)(sR,{children:[(0,r.jsxs)(sE,{children:[(0,r.jsx)(sg,{children:(0,r.jsx)(sL,{src:"/images/usmnt/Mia1.jpg",alt:"Mia Hamm photograph",loading:"lazy",decoding:"async"})}),(0,r.jsx)(sD,{children:"Mia1.jpg"})]}),(0,r.jsxs)(sE,{children:[(0,r.jsx)(sg,{children:(0,r.jsx)(sL,{src:"/images/usmnt/b%26w_9.png",alt:"Black and white Mia Hamm photograph",loading:"lazy",decoding:"async"})}),(0,r.jsx)(sD,{children:"b&w_9.png"})]}),(0,r.jsxs)(sE,{children:[(0,r.jsx)(sg,{children:(0,r.jsx)(sL,{src:"/images/usmnt/kneeslide.jpg",alt:"Mia Hamm knee slide celebration photograph",loading:"lazy",decoding:"async"})}),(0,r.jsx)(sD,{children:"kneeslide.jpg"})]})]}),(0,r.jsxs)(sR,{children:[(0,r.jsxs)(sE,{children:[(0,r.jsx)(sg,{children:(0,r.jsx)(sL,{src:"/images/usmnt/UNCBlueMia.png",alt:"Mia Hamm in UNC blue photograph",loading:"lazy",decoding:"async"})}),(0,r.jsx)(sD,{children:"UNCBlueMia.png"})]}),(0,r.jsxs)(sE,{children:[(0,r.jsx)(sg,{children:(0,r.jsx)(sL,{src:"/images/usmnt/Mia_Gooooooaaaaaaaaal.jpg",alt:"Mia Hamm goal celebration photograph",loading:"lazy",decoding:"async"})}),(0,r.jsx)(sD,{children:"Mia_Gooooooaaaaaaaaal.jpg"})]})]})]}
1),(0,r.jsx)(l7,{"aria-hidden":!0,children:(0,r.jsx)("img",{src:lG,alt:"",decoding:"async"})})]}),(0,r.jsx)(lK,{children:"MIA DOING WORK"}),(0,r.jsxs)(lQ,{children:[(0,r.jsx)(ss,{"aria-hidden":!0,children:(0,r.jsx)("img",{src:lN,alt:"",decoding:"async"})}),(0,r.jsx)(sm,{children:"Striker, charming as he was, wasn’t what the country needed to really get into football. Americans needed a superstar, and they found one in Mia Hamm. While the USMNT entered international football competing against national sides with decades of experience and infrastructure, the American women have always dominated. They won the first Women’s World Cup in China in 1991, placed third in 1995, and won Olympic gold in 1996."},"essay-striker"),(0,r.jsxs)(sm,{children:["Hamm came from a military family and moved frequently, developing an affinity for football as a young girl living in Florence. She was first capped internationally in 1987 when she was 15, played at"," ",(0,r.jsx)(s_,{word:"UNC",n:"28",onOpenGallery:o})," ","under legendary coach Anson Dorrance, and was a fixture in the USWNT first team by the 1991 World Cup. Hamm was the full package, playing with a lethal combination of pace, stamina, technique, and creativity. Despite her prodigious goal-scoring she was unselfish, creating for others almost as often as she scored herself. By the mid-90s she was starring in"," ",(0,r.jsx)(s_,{word:"Gatorade ads",n:"29",onOpenGallery:o})," ","opposite Michael Jordan, setting"," ",(0,r.jsx)(s_,{word:"milestones",n:"30",onOpenGallery:o})," ","for both men and women in the international game, and inspiring young American kids—girls and boys alike—to want to play like Mia."]},"essay-hamm"),(0,r.jsxs)(sm,{children:["In 1997, she began working with Nike on the"," ",(0,r.jsx)(s_,{word:"Air Zoom M9",n:"31",onOpenGallery:o}),", Nike’s first boot made specifically for women. This was the beginning of the end of the “shrink it and pink it” era of women’s sportswear, when brands finally began to approach women’s product as a primary concern rather than an afterthought. The M9 was built from the ground up on a new last engineered for a woman’s foot. In an interview with Bloomberg, Hamm remembers telling Nike about a tour in Brazil marked by torrential rainfalls that left her kangaroo leather boots totally waterlogged, which led to swapping out the traditional leather upper for KNG 100, a less absorbent synthetic. The result was a boot that was light, durable, and corrected many of the fit issues women experienced when playing in men’s boots. Aesthetically, it’s one of the most underrated designs in Nike’s locker. The original was mostly black, per Hamm’s preference, and the toe stitching arced concentrically like ripples on a pond. Pops of red show up on the instep, the studs, and on Hamm’s logo, embroidered on the flip side of the foldover tongue."]},"essay-hamm-m9"),(0,r.jsx)(sm,{children:"The M9 arrived in time for the 1999 Women’s World Cup, once again played at home in America. The USWNT faced China, once again at the Rose Bowl, eventually winning on penalties after a brutal 120 minutes of scoreless football. Hamm took the fourth of the USWNT’s five penalties, coolly slotting a low shot to Chinese keeper Gao Hong’s left to give her team the lead. About a minute later, Brandi Chastain buried the clinching penalty to give the USWNT their second World Cup, ripping her shirt off and dropping to her knees in what’s become an indelible moment in the American sports canon. She, too, was wearing a pair of M9s."},"essay-1999")]})]}),(0,r.jsx)(lX,{}),(0,r.jsx)(l$,{children:'An apex predator put on pause through engineering and chemistry in order to provoke wonder and reflection."'}),(0,r.jsx)(l2,{}),(0,r.jsxs)(l1,{children:[(0,r.jsx)("span",{children:"pq #001"}),(0,r.jsx)("span",{children:"106 characters"})]}),(0,r.jsxs)(sx,{children:[(0,r.jsxs)(sk,{children:[(0,r.jsxs)(sC,{children:[(0,r.jsx)(sM,{"aria-hidden":!0,children:(0,r.jsx)("img",{src:lY,alt:"",decoding:"async"})}),(0,r.jsx)(sg,{children:(0,r.jsx)(sL,{src:"/images/usmnt/dennis/PulisicRugby.jpg",alt:"Christian Pulisic in V.A.A. football shirt",loading:"lazy",decoding:"async"})})]}),(0,r.jsx)(sD,{children:"PulisicRugby.jpg"})]}),(0,r.jsxs)(sv,{children:[(0,r.jsxs)(sm,{children:["In honor of Hamm, and in the tradition of"," ",(0,r.jsx)(s_,{word:"Virgil’s longstanding commitment to working with women athletes at Nike",n:"32",onOpenGallery:o}),", V.A.A.™ chose the only women’s sneaker silhouette in the X2 collection: an update of the M9, reworked with Nike’s new Cryoshot midsole."]},"essay-honor"),(0,r.jsxs)(sm,{children:["For the 2026 tournament, stateside for the first time since ’94, Nike’s boot savants in"," ",(0,r.jsx)(s_,{word:"Montebelluna",n:"33",onOpenGallery:o})," ","developed Cryoshot, a new method for casualizing performance boots. Rather than replacing the tooling and studs with a typical rubber sole, Cryoshot builds around them, encasing the studs in transparent TPU that"," ",(0,r.jsx)(s_,{word:"took ages to perfect",n:"34",onOpenGallery:o}),"."]},"essay-cryoshot"),(0,r.jsxs)(sm,{children:["Transparency was a major motif in Virgil’s work, both with Nike and in his own practice. In a sense, the Cryoshot project is Nike cat
1ching up to one of Virgil’s core codes:",(0,r.jsx)(s_,{word:"ghosting",n:"35",onOpenGallery:o}),". The difference is that transparency is used here not to reveal but to frame. Icing the studs shifts their purpose from practical to aesthetic. Putting the functional on display is inherently"," ",(0,r.jsx)(s_,{word:"Duchampy",n:"36",onOpenGallery:o}),", which V would no doubt appreciate, but a more era-appropriate comparison might be"," ",(0,r.jsx)(s_,{word:"The Physical Impossibility of Death in the Mind of Someone Living",n:"37",onOpenGallery:o}),": An apex predator put on pause through engineering and chemistry in order to provoke wonder and reflection."]},"essay-transparency"),(0,r.jsxs)(sm,{children:["Cryoshot, by its team’s own admission, is about memory, and therefore about the"," ",(0,r.jsx)(s_,{word:"passage of time",n:"38",onOpenGallery:o}),". Says Michele Galasso, Lead Footwear Developer for Nike in Montebelluna: “Football boots exist on this interesting spectrum of memento and performance equipment. It’s reserved for the pitch. Over time, once you stop playing, it turns into a beautiful piece of memorabilia, like a museum piece. We wanted it to be possible to wear these boots every day.” Nostalgia is a bittersweet, and what’s most interesting about the Cryoshot project is how well these sneakers work on their own, independent of their respective histories. Like the pulsar wave on the cover of"," ",(0,r.jsx)(s_,{word:"Unknown Pleasures",n:"39",onOpenGallery:o}),", the encased studs have their own inherent appeal. These origin stories are interesting, they add depth, but even without, they work as pure, freestanding objects."]},"essay-memory"),(0,r.jsxs)(sm,{children:["So, instead of the shark suspended in formaldehyde, maybe we should compare the Cryoshot to another totem of late 90s transparent design: the"," ",(0,r.jsx)(s_,{word:"Bondi Blue iMac G3",n:"40",onOpenGallery:o}),", which used a colorful translucent enclosure to make the personal computer attractive, approachable, fashionable—one of the most inherently optimistic industrial designs ever produced. Jony Ive once noted that,"," ",(0,r.jsx)(s_,{word:"the interesting thing about accurately measuring abstract ideas, such as time, is that it necessarily involves a craftsman.",n:"41",onOpenGallery:o})," ","He was speaking more about clocks and watches, but in the case of the Cryoshot, it took some of Nike’s finest craftspeople, operating from a historical wellspring of technical innovation, to figure out how to adapt these sneakers for daily duty without removing a crucial part of their character. The result is an everyday sneaker that doubles as a museum vitrine, a mobile tribute to the boots’ high-intensity origins and the players like Hamm and Chastain who gave them their aura."]},"essay-imac")]}),(0,r.jsxs)(sy,{children:[(0,r.jsxs)(sw,{children:[(0,r.jsx)(sb,{"aria-hidden":!0,children:(0,r.jsx)("img",{src:lG,alt:"",decoding:"async"})}),(0,r.jsx)(sg,{children:(0,r.jsx)(sL,{src:"/images/usmnt/Transparency-Ghosting.jpg",alt:"",loading:"lazy",decoding:"async"})})]}),(0,r.jsx)(sD,{children:"Transparency-Ghosting.jpg"})]})]})]})]})]})})});var s0=n(7909),s1=n(7650),s2=n(1846),s5=n(3216);let s3=[2,6,12,20],s4=o.Ay.button.withConfig({componentId:"sc-867466f0-0"})(["width:20px;height:20px;border:none;background:transparent;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:4px;flex-shrink:0;line-height:0;& > svg{display:block;flex-shrink:0;}"]),s6=o.Ay.div.withConfig({componentId:"sc-867466f0-1"})(["position:relative;display:flex;align-items:center;justify-content:center;width:20px;height:20px;cursor:ns-resize;touch-action:none;user-select:none;flex-shrink:0;"]),s8=o.Ay.div.withConfig({componentId:"sc-867466f0-2"})(["position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:","px;height:","px;box-sizing:border-box;border-radius:50%;border:1px solid ",";opacity:0.7;pointer-events:none;"],14,14,e=>{let{$color:t}=e;return t}),s9=o.Ay.div.withConfig({componentId:"sc-867466f0-3"})(["position:relative;z-index:1;width:","px;height:","px;border-radius:50%;border:1px solid rgba(255,255,255,0.2);background:",";flex-shrink:0;"],e=>{let{$size:t}=e;return Math.max(4,Math.min(20,1.2*t))},e=>{let{$size:t}=e;return Math.max(4,Math.min(20,1.2*t))},e=>{let{$color:t}=e;return t}),s7=o.Ay.div.withConfig({componentId:"sc-867466f0-4"})(["position:relative;flex-shrink:0;"]),ce=o.Ay.div.withConfig({componentId:"sc-867466f0-5"})(["position:absolute;top:100%;right:0;margin-top:4px;z-index:1100;box-shadow:0 4px 16px rgba(0,0,0,0.5);"]),ct=o.Ay.div.withConfig({componentId:"sc-867466f0-6"})(["display:flex;flex-direction:column;gap:6px;padding:4px;background:#2a2a2a;border-radius:4px;border:1px solid #444;"]),cn=o.Ay.div.withConfig({componentId:"sc-867466f0-7"})(["display:flex;align-items:stretch;gap:4px;"]),cr=o.Ay.div.withConfig({componentId:"sc-867466f0-8"})(["display:flex;align-items:center;justify-content:space-between;gap:0px;padding-bottom:2px;border-bottom:1px solid #444;"]),ci=o.Ay.button.withConfig({componentId:"sc-867466f0-9"})(["flex:1;min-width:0;height:20px;padding:0;border:none;border-radius:4px;background:",';display:flex;align-items:center;justify-content:center;cursor:pointer;&::after{content:"";width:',"px;height:","px;border-radius:50%;background:",";border:1px solid rgba(255,255,255,0.25);box-sizing:border-box;}"],e=>{let{$active:t}=e;return t?"rgba(255,255,255,0.12)":"transparent"},e=>{let{$dotSize:t}=e;return t},e=>{let{$dotSize:t}=e;return t},e=>{let{$color:t}=e;return t}),ca=o.Ay.div.withConfig({componentId:"sc-867466f0-10"})(["width:100px;height:100px;background:linear-gradient(to bottom,transparent 0%,black 100%),linear-gradient( to right,white 0%,hsl(",",100%,50%) 100% );border-radius:2px;cursor:crosshair;touch-action:none;user-select:none;position:relative;"],e=>{let{$hue:t}=e;return t}),co=o.Ay.div.withConfig({componentId:"sc-867466f0-11"})(["position:absolute;
1left:","%;top:","%;transform:translate(-50%,-50%);width:12px;height:12px;border:2px solid white;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,0.5);pointer-events:none;"],e=>{let{$x:t}=e;return t},e=>{let{$y:t}=e;return t}),cl=o.Ay.div.withConfig({componentId:"sc-867466f0-12"})(["width:14px;height:100px;background:linear-gradient( to bottom,#f00 0%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,#f00 100% );border-radius:2px;cursor:ns-resize;touch-action:none;user-select:none;position:relative;"]),cs=o.Ay.div.withConfig({componentId:"sc-867466f0-13"})(["position:absolute;left:-2px;right:-2px;top:","%;transform:translateY(-50%);height:4px;border:2px solid white;border-radius:1px;box-shadow:0 0 0 1px rgba(0,0,0,0.5);pointer-events:none;"],e=>{let{$y:t}=e;return t}),cc=o.Ay.div.withConfig({componentId:"sc-867466f0-14"})(["display:flex;align-items:center;gap:3px;"]);function cd(){let[e]=(0,i.fp)(s5.JK),[t]=(0,i.fp)(s5.fs),[n,o]=(0,i.fp)(s5.F8),[l,s]=(0,i.fp)(s5.ez),[c,d]=(0,i.fp)(s5.sg),[u,h]=(0,i.fp)(s5.RA),[p,m]=(0,i.fp)(s5.RY),f=(0,ok.O)(),g=(0,a.useMemo)(()=>{let{r:e,g:t,b:n}=(0,og.M)(l,c,u);return"rgb(".concat(e,", ").concat(t,", ").concat(n,")")},[l,c,u]),x=(0,a.useRef)(null),v=(0,a.useRef)(null),y=(0,a.useRef)(null),w=(0,a.useRef)(null),b=(0,a.useRef)(null),k=(0,a.useCallback)(()=>{(0,s2.dS)(t)},[t]);(0,a.useEffect)(()=>{if(!p||!e)return;let t=e=>{let t=x.current,n=e.target;t&&n instanceof Node&&(t.contains(n)||m(!1))};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},[p,e,m]);let C=(0,a.useCallback)(e=>{0===e.button&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),w.current={startX:e.clientX,startY:e.clientY,startSize:n})},[n]),M=(0,a.useCallback)(e=>{if(!w.current)return;let{startY:t,startSize:n}=w.current;o(Math.max(1,Math.min(24,n+Math.round((t-e.clientY)/3))))},[o]),S=(0,a.useCallback)(e=>{if(!w.current)return;let{startX:t,startY:n}=w.current,r=e.clientX-t,i=Math.hypot(r,e.clientY-n)<("touch"===e.pointerType?12:5);w.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch(e){}i&&m(e=>!e)},[m]),j=(0,a.useCallback)((e,t)=>{let n=v.current;if(!n)return;let r=n.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e-r.left)/r.width)),a=Math.max(0,Math.min(1,(t-r.top)/r.height));d(Math.round(100*i)),h(Math.round((1-a)*100))},[h,d]),I=(0,a.useCallback)(e=>{let t=y.current;if(!t)return;let n=t.getBoundingClientRect();s(Math.round(360*Math.max(0,Math.min(1,(e-n.top)/n.height)))%360)},[s]),A=(0,a.useCallback)(e=>{0===e.button&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),b.current="sb",j(e.clientX,e.clientY))},[j]),P=(0,a.useCallback)(e=>{"sb"===b.current&&j(e.clientX,e.clientY)},[j]),R=(0,a.useCallback)(e=>{if("sb"===b.current){b.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch(e){}}},[]),E=(0,a.useCallback)(e=>{0===e.button&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),b.current="hue",I(e.clientY))},[I]),L=(0,a.useCallback)(e=>{"hue"===b.current&&I(e.clientY)},[I]),z=(0,a.useCallback)(e=>{if("hue"===b.current){b.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch(e){}}},[]);return e?(0,r.jsxs)(cc,{children:[(0,r.jsx)(s4,{onClick:k,type:"button","aria-label":"Clear drawing",title:"Clear drawing",children:(0,r.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 6 6",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:(0,r.jsxs)("g",{transform:"translate(0.35714 0.35714)",children:[(0,r.jsx)("circle",{cx:"2.64286",cy:"2.64286",r:"2.5",stroke:"#D9D9D9",strokeWidth:"0.285714"}),(0,r.jsx)("path",{d:"M1.49 1.49L3.79 3.79M3.79 1.49L1.49 3.79",stroke:"#D9D9D9",strokeWidth:"0.285714",strokeLinecap:"round"})]})})}),(0,r.jsxs)(s7,{ref:x,children:[(0,r.jsxs)(s6,{onPointerDown:C,onPointerMove:M,onPointerUp:S,onPointerCancel:S,title:"Drag to resize brush, tap for color",children:[(0,r.jsx)(s8,{$color:g,"aria-hidden":!0}),(0,r.jsx)(s9,{$size:n,$color:g})]}),p&&(0,r.jsx)(ce,{onClick:e=>e.stopPropagation(),children:(0,r.jsxs)(ct,{children:[f&&(0,r.jsx)(cr,{role:"group","aria-label":"Brush size",onPointerDown:e=>e.stopPropagation(),children:s3.map(e=>{let t=Math.max(4,Math.min(20,1.2*e));return(0,r.jsx)(ci,{type:"button",$active:n===e,$dotSize:t,$color:g,"aria-label":"Brush size ".concat(e),"aria-pressed":n===e,onClick:t=>{t.stopPropagation(),o(e)}},e)})}),(0,r.jsxs)(cn,{children:[(0,r.jsx)(ca,{ref:v,$hue:l,onPointerDown:A,onPointerMove:P,onPointerUp:R,onPointerCancel:R,title:"Saturation & brightness",children:(0,r.jsx)(co,{$x:c/100*100,$y:(1-u/100)*100}
1)}),(0,r.jsx)(cl,{ref:y,onPointerDown:E,onPointerMove:L,onPointerUp:z,onPointerCancel:z,title:"Hue",children:(0,r.jsx)(cs,{$y:l/360*100})})]})]})})]})]}):null}var cu=n(9710),ch=n(1317);let cp=o.Ay.div.withConfig({componentId:"sc-378dbfa2-0"})(["display:flex;align-items:center;justify-content:space-between;padding:1px 5px;border-radius:12px;background:#252525;flex-shrink:0;user-select:none;position:absolute;left:50%;transform:translateX(-50%);top:30px;width:500px;max-width:calc(100vw - 24px);box-sizing:border-box;z-index:2601;pointer-events:auto;"]),cm=o.Ay.div.withConfig({componentId:"sc-378dbfa2-1"})(["display:flex;align-items:center;gap:3px;min-width:0;flex-shrink:1;"]),cf=o.Ay.div.withConfig({componentId:"sc-378dbfa2-2"})(["display:flex;align-items:center;gap:3px;flex-shrink:0;"]),cg=o.Ay.span.withConfig({componentId:"sc-378dbfa2-3"})(["font-size:10px;color:#ccc;font-family:monospace;max-width:min(180px,32vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]),cx=o.Ay.button.withConfig({componentId:"sc-378dbfa2-4"})(["width:12px;height:12px;min-width:12px;min-height:12px;padding:0;border:none;background:#888;color:#000;cursor:pointer;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background 0.15s;&:hover{background:#666;}&:active{background:#777;}svg{width:6px;height:6px;}"]),cv=o.Ay.button.withConfig({componentId:"sc-378dbfa2-5"})(["width:20px;height:20px;border:none;background:transparent;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:4px;flex-shrink:0;line-height:0;& > svg{display:block;flex-shrink:0;}"]),cy=(0,o.Ay)(cv).withConfig({componentId:"sc-378dbfa2-6"})(["color:",";",""],e=>{let{$active:t,$iconFg:n}=e;return t?n:"#d9d9d9"},e=>{let{$active:t,$brushBg:n}=e;return t?(0,o.AH)(["background:",";"],n):""}),cw=o.Ay.button.withConfig({componentId:"sc-378dbfa2-7"})(["padding:5px 10px;border:none;background:rgba(255,255,255,0.1);color:#fff;font-size:9px;font-weight:500;letter-spacing:0.05em;cursor:pointer;border-radius:999px;transition:background 0.15s;&:hover{background:rgba(255,255,255,0.2);}&:active{background:rgba(255,255,255,0.25);}"]);async function cb(e){let t=await (0,cu.QU)();if(t){let n=(0,s5.vc)(e).replace(/[^\w.-]+/g,"_");return{blob:t,filename:n.length>0?"".concat(n.slice(0,80),"_view.png"):"zine_view.png"}}return(0,s2.pk)(e)}function ck(e){let{onClose:t}=e,[n]=(0,i.fp)(s5.fs),[o,l]=(0,i.fp)(s5.JK),[,s]=(0,i.fp)(s5.RY),c=(0,i.md)(s5.ez),d=(0,i.md)(s5.sg),u=(0,i.md)(s5.RA),{track:p}=(0,h.s)(),m=(0,s5.vc)(n),{brushCss:f,iconFg:g}=(0,a.useMemo)(()=>{let{r:e,g:t,b:n}=(0,og.M)(c,d,u);return{brushCss:"rgb(".concat(e,", ").concat(t,", ").concat(n,")"),iconFg:(0,ch.A)(e,t,n)}},[c,d,u]),x=(0,a.useCallback)(()=>{l(e=>!e),s(!1)},[l,s]),v=(0,a.useCallback)(async()=>{try{let e=await cb(n);if(!e)return;let t=document.createElement("a");t.href=URL.createObjectURL(e.blob),t.download=e.filename,t.click(),URL.revokeObjectURL(t.href),p("AJ1 Image Saved",{surface:"zine",page_index:n})}catch(e){}},[n,p]),y=(0,a.useCallback)(async()=>{var e,t,r,i,a;try{let a=await cb(n);if(!a)return;let o=new File([a.blob],a.filename,{type:"image/png"});if(null==(e=(t=navigator).canShare)?void 0:e.call(t,{files:[o]}))await navigator.share({title:a.filename.replace(/\.png$/i,""),files:[o],text:"Sent from the Virgil Abloh Archive"});else{let e=URL.createObjectURL(a.blob);await (null==(r=(i=navigator).share)?void 0:r.call(i,{title:a.filename.replace(/\.png$/i,""),url:e,text:"Sent from the Virgil Abloh Archive"})),URL.revokeObjectURL(e)}p("AJ1 Image Shared",{surface:"zine",page_index:n})}catch(e){try{let e=await cb(n);if(!(null==e?void 0:e.blob)||!(null==(a=navigator.clipboard)?void 0:a.write))return;await navigator.clipboard.write([new ClipboardItem({"image/png":e.blob})])}catch(e){}}},[n,p]);return(0,r.jsxs)(cp,{role:"toolbar","aria-label":"Zine",children:[(0,r.jsxs)(cm,{children:[(0,r.jsx)(cx,{onClick:t,type:"button","aria-label":"Close",children:(0,r.jsx)("svg",{viewBox:"0 0 14 14",fill:"none",children:(0,r.jsx)("path",{d:"M1 1l12 12M13 1L1 13",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}),(0,r.jsx)(cg,{title:m,children:m||"—"})]}),(0,r.jsxs)(cf,{children:[(0,r.jsx)(cd,{}),(0,r.jsx)(cy,{onClick:x,type:"button","aria-label":o?"Stop drawing":"Draw",title:o?"Stop drawing":"Draw on page",$active:o,$brushBg:f,$iconFg:g,children:(0,r.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 6 6",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,
1children:(0,r.jsxs)("g",{transform:"translate(0.35714 0.35714)",children:[(0,r.jsx)("circle",{cx:"2.64286",cy:"2.64286",r:"2.5",stroke:"currentColor",strokeWidth:"0.285714"}),(0,r.jsx)("path",{d:"M3.23228 3.00002L2.643 1.42859L2.08645 3.00002H3.23228Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M1.42871 4.85716L2.08645 3.00002M3.92871 4.85716C3.65479 4.12671 3.44653 3.57134 3.23228 3.00002M3.23228 3.00002C3.05381 2.52408 2.87118 2.03708 2.643 1.42859L2.08645 3.00002M3.23228 3.00002H2.08645",stroke:"currentColor",strokeWidth:"0.285714",strokeLinejoin:"round"})]})})}),(0,r.jsx)(cv,{onClick:y,type:"button","aria-label":"Share",children:(0,r.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,r.jsx)("path",{d:"M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8"}),(0,r.jsx)("polyline",{points:"16 6 12 2 8 6"}),(0,r.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"15"})]})}),(0,r.jsx)(cw,{type:"button",onClick:v,children:"SAVE IMG"})]})]})}var cC=n(6375),cM=n(1217),cS=n(3165);let cj=(0,s0.default)(()=>Promise.all([n.e(274),n.e(720),n.e(768)]).then(n.bind(n,9768)).then(e=>({default:e.ZineCanvasRoot})),{loadableGenerated:{webpack:()=>[9768]},ssr:!1,loading:()=>null}),cI=(0,o.i7)(["from{opacity:0;}to{opacity:1;}"]),cA=(0,o.i7)(["from{opacity:1;}to{opacity:0;}"]),cP=o.Ay.div.withConfig({componentId:"sc-d30b8768-0"})(["position:fixed;inset:0;z-index:2500;pointer-events:none;background:transparent;",""],e=>{let{$exiting:t,$skipExitFade:n,$introActive:r}=e;return t&&n?(0,o.AH)(["opacity:0;animation:none;"]):t?(0,o.AH)(["animation:"," 0.28s ease-out forwards;"],cA):r?(0,o.AH)(["animation:"," ","s cubic-bezier(0.22,1,0.36,1) forwards;"],cI,cS.$):(0,o.AH)(["opacity:0;animation:none;"])}),cR=o.Ay.div.withConfig({componentId:"sc-d30b8768-1"})(["position:absolute;inset:0;z-index:1;padding-top:","px;box-sizing:border-box;pointer-events:",";background:transparent;opacity:",";visibility:",";"],0,e=>{let{$introActive:t}=e;return t?"auto":"none"},e=>{let{$introActive:t}=e;return+!!t},e=>{let{$introActive:t}=e;return t?"visible":"hidden"});function cE(e){let{open:t,onClose:n,onExited:o}=e,[l,s]=(0,a.useState)(!1),[c,d]=(0,a.useState)(!1),[u,h]=(0,a.useState)(!1),p=(0,a.useRef)(t),m=(0,a.useRef)(n);m.current=n;let f=(0,a.useRef)(o);f.current=o;let g=(0,i.Xr)(s5.JK),x=(0,i.Xr)(s5.RY),v=(0,i.md)(cC.C),y=(0,a.useRef)(v);(0,a.useEffect)(()=>{v&&!y.current&&(0,cM.ip)(),y.current=v},[v]);let w=(0,a.useCallback)(()=>{g(!1),x(!1),d(!0),window.setTimeout(()=>{var e;d(!1),s(!1),m.current(),null==(e=f.current)||e.call(f)},300)},[x,g]);if((0,a.useEffect)(()=>{let e=p.current;p.current=t,t&&!e&&(h(!1),s(!0),d(!1))},[t]),(0,a.useEffect)(()=>{l&&h(!0)},[l]),(0,a.useEffect)(()=>{t||!l||c||w()},[t,l,c,w]),(0,a.useEffect)(()=>{if(!l||c)return;let e=e=>{"Escape"===e.key&&w()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l,c,w]),(0,a.useEffect)(()=>{if(!l||c||!v)return;let e=window.setTimeout(()=>{requestAnimationFrame(()=>{window.dispatchEvent(new Event("resize"))})},1e3*cS.$);return()=>clearTimeout(e)},[l,c,v]),!l)return null;let b=c&&!u,k=(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(cP,{$exiting:c,$skipExitFade:b,$introActive:v,role:"presentation","data-zine-overlay":"",children:[(0,r.jsx)(ck,{onClose:w}),(0,r.jsx)(cR,{$introActive:v,children:(0,r.jsx)(cj,{onCloseOnEmptyClick:w})})]})});return"undefined"==typeof document?null:(0,s1.createPortal)(k,document.body)}let cL=o.Ay.div.withConfig({componentId:"sc-ecf09dc6-0"})(["position:fixed;bottom:12px;right:12px;z-index:9999;width:min(360px,calc(100vw - 24px));max-height:min(90vh,calc(100dvh - 24px));overflow-y:auto;padding:12px 14px;background:rgba(0,0,0,0.88);color:#fff;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11px;border-radius:8px;box-shadow:0 8px 32px rgba(0,0,0,0.35);pointer-events:auto;@media (max-width:","px){left:0;right:0;bottom:0;width:100%;max-width:none;height:50vh;max-height:50vh;border-radius:10px 10px 0 0;}"],699),cz=o.Ay.div.withConfig({componentId:"sc-ecf09dc6-1"})(["font-weight:700;margin-bottom:8px;letter-spacing:-0.02em;"]),cD=o.Ay.div.withConfig({componentId:"sc-ecf09dc6-2"})(["display:inline-block;padding:3px 8px;margin-bottom:8px;border-radius:4px;background:rgba(255,255,255,0.14);font-weight:600;text-transform:uppercase;letter-spacing:0.06em;font-size:10px;"]),cT=o.Ay.div.withConfig({componentId:"sc-ecf09dc6-3"})(["opacity:0.55;margin-bottom:10px;line-height:1.35;"]),cB=o.Ay.div.withConfig({componentId:"sc-ecf09dc6-4"})(["margin-bottom:10px;"]),cF=o.Ay.div.withConfig({componentId:"sc-ecf09dc6-5"})(["opacity:0.65;margin-bottom:6px;font-size:10px;text-transform:uppercase;letter-spacing:0.04em;"]),cW=o.Ay.label.withConfig({componentId:"sc-ecf09dc6-6"})(["display:grid;grid-template-columns:36px 1fr 52px;align-items:center;gap:8px;margin-bottom:6px;"]),cO=o.Ay.input.withConfig({componentId:"sc-ecf09dc6-7"})(["width:100%;accent-color:#fff;"]),cY=o.Ay.span.withConfig({componentId:"sc-ecf09dc6-8"})(["text-align:right;opacity:0.85;"]),cN=o.Ay.div.withConfig({componentId:"sc-ecf09dc6-9"})(["display:flex;flex-direction:column;gap:4px;margin-bottom:10px;"]),cG=o.Ay.div.withConfig({componentId:"sc-ecf09dc6-10"})(["display:grid;grid-template-columns:24px 22px 1fr;align-items:center;gap:6px;padding:5px 6px;border:1px solid ",";border-radius:4px;background:",";color:#fff;font:inherit;cursor:pointer;&:hover{background:rgba(255,255,255,0.14);}"],e=>{let{$active:t,$dragOver:n}=e;return n?"rgba(255,255,255,0.55)":t?"rgba(255,255,255,0.45)":"rgba(255,255,255,0.12)"},e=>{let{$active:t,$dragOver:n}=e;return n?"rgba(255,255,255,0.2)":t?"rgba(255,255,255,0.16)":"rgba(255,255,255,0.05)"}),cU=o.Ay.button.withConfig({componentId:"sc-ecf09dc6-11"})(["display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:3px;background:rgba(255,255,255,0.06);color:rgba(255,255,255,0.5);font:inherit;font-size:12px;line-height:1;cursor:grab;touch-action:none;user-select:none;&:hover{background:rgba(255,255,255,0.14);color:rgba(255,255,255,0.85);}&:active{cursor:grabbing;}"]),cH=o.Ay.span.withConfig({componentId:"sc-ecf09dc6-12"})(["opacity:0.45;font-weight:600;text-align:right;"]),cq=o.Ay.span.withConfig({componentId:"sc-ecf09dc6-13"})(["min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]),cV=o.Ay.div.withConfig({componentId:"sc-ecf09dc6-14"})(["display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:8px;"]),cX=o.Ay.button.withConfig({componentId:"sc-ecf09dc6-15"})(["padding:6px 8px;border:1px solid ",";border-radius:4px;background:",";color:#fff;font:inherit;font-weight:",";cursor:pointer;text-transform:capitalize;&:hover{background:rgba(255,255,255,0.14);}"],e=>{let{$active:t}=e;return t?"rgba(255,255,255,0.5)":"rgba(255,255,255,0.18)"},e=>{let{$active:t}=e;return t?"rgba(255,255,255,0.2)":"rgba(255,255,255,0.06)"},e=>{let{$active:t}=e;return t?700:400}),c$=o.Ay.div.withConfig({componentId:"sc-ecf09dc6-16"})(["opacity:0.55;margin-bottom:10px;line-height:1.4;font-size:10px;"]),c_=o.Ay.div.withConfig({componentId:"sc-ecf09dc6-17"})(["display:flex;gap:8px;margin-top:12px;flex-wrap:wrap;"]),cZ=o.Ay.button.withConfig({componentId:"sc-ecf09dc6-18"})(["flex:1;min-width:90px;padding:6px 10px;border:1px solid rgba(255,255,255,0.25);border-radius:4px;background:rgba(255,255,255,0.08);color:#fff;font:inherit;cursor:pointer;&:hover{background:rgba(255,255,255,0.16);}"]),cJ=o.Ay.span.withConfig({componentId:"sc-ecf09dc6-19"})(["align-self:center;opacity:0.7;"]);function cK(e){return az.findIndex(t=>t.id===e)}function cQ(e){var t,n;return null!=(n=null==(t=az.find(t=>
1t.id===e))?void 0:t.label)?n:e}function c0(e){let{open:t,onClose:n,tunings:i,onChange:o,activeIndex:l,onActiveIndexChange:s,cycleProductIds:c,onCycleOrderChange:d,scrollT:u,displayTuning:h,onDisplayTuningChange:p,tuningContext:m,tuningContextLocked:f,onTuningContextChange:g}=e,[x,v]=(0,a.useState)(!1),[y,w]=(0,a.useState)({width:0,height:0}),[b,k]=(0,a.useState)(null),[C,M]=(0,a.useState)(null),S=(0,a.useMemo)(()=>aW(u),[u]),j=(0,a.useMemo)(()=>aF(y.width),[y.width]),I=(0,a.useMemo)(()=>(0,eS.c2)(y.width),[y.width]);(0,a.useEffect)(()=>{let e=()=>{w({width:window.innerWidth,height:window.innerHeight})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,a.useEffect)(()=>{let e=e=>{if(e.repeat)return;let r=e.target;if(null==r?void 0:r.closest("input, textarea, select, [contenteditable='true'], [role='textbox']"))return;let i=e.key>="1"&&e.key<="8"?Number(e.key)-1:null;if(null!=i&&c[i]){e.preventDefault();let r=cK(c[i]);return r<0?void 0:t&&l===r?void n():void s(r)}"Escape"===e.key&&(e.preventDefault(),n())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l,c,s,n,t]);let A=(0,a.useCallback)((e,t)=>{if(e===t)return;let n=c.indexOf(e),r=c.indexOf(t);if(n<0||r<0)return;let i=[...c];i.splice(n,1),i.splice(r,0,e),d(i)},[c,d]),P=(0,a.useCallback)((e,t)=>{null!=l&&o(i.map((n,r)=>r===l?aV(n,m,S,{[e]:t}):n))},[l,S,o,m,i]),R=(0,a.useCallback)((e,t)=>{null!=l&&o(i.map((n,r)=>{var i,a,o;return r===l?(i=n,a=e,o=t,{...i,[o]:{...i[a]}}):n}))},[l,o,i]),E=(0,a.useCallback)((e,t)=>{p({...h,[e]:t})},[h,p]),L=(0,a.useCallback)(async()=>{let e=JSON.stringify({cycleProductIds:c,display:h,products:az.map((e,t)=>({id:e.id,label:e.label,desktop:i[t].desktop,mobile:i[t].mobile}))},null,2);try{await navigator.clipboard.writeText(e),v(!0),window.setTimeout(()=>v(!1),2e3)}catch(t){window.prompt("Copy tuning JSON:",e)}},[c,h,i]);if(!t)return null;let z=null!=l?az[l]:null,D=null!=l?aq(i[l],m,S):null;return(0,r.jsxs)(cL,{"data-tuning-panel":!0,children:[(0,r.jsx)(cz,{children:"Product tuning"}),(0,r.jsx)(cT,{children:"Keys 1–8 select by cycle slot \xb7 drag ⠿ to reorder \xb7 click row to select \xb7 canvas drag for x/y \xb7 scroll top/bottom = start/end"}),(0,r.jsxs)(cB,{children:[(0,r.jsx)(cF,{children:"Display & lighting"}),(0,r.jsx)(cT,{style:{marginBottom:8},children:"foilOpacity 0 = flat photo. Exposure is a linear fine-tune (leave at 1.0 for source PNG colors)."}),(0,r.jsxs)(cW,{children:[(0,r.jsx)("span",{children:"exp"}),(0,r.jsx)(cO,{type:"range",min:.5,max:2,step:.01,value:h.exposure,onChange:e=>E("exposure",Number(e.target.value))}),(0,r.jsx)(cY,{children:h.exposure.toFixed(2)})]}),(0,r.jsxs)(cW,{children:[(0,r.jsx)("span",{children:"amb"}),(0,r.jsx)(cO,{type:"range",min:0,max:1.5,step:.01,value:h.ambient,onChange:e=>E("ambient",Number(e.target.value))}),(0,r.jsx)(cY,{children:h.ambient.toFixed(2)})]}),(0,r.jsxs)(cW,{children:[(0,r.jsx)("span",{children:"L1"}),(0,r.jsx)(cO,{type:"range",min:0,max:2,step:.01,value:h.light1Intensity,onChange:e=>E("light1Intensity",Number(e.target.value))}),(0,r.jsx)(cY,{children:h.light1Intensity.toFixed(2)})]}),(0,r.jsxs)(cW,{children:[(0,r.jsx)("span",{children:"L2"}),(0,r.jsx)(cO,{type:"range",min:0,max:2,step:.01,value:h.light2Intensity,onChange:e=>E("light2Intensity",Number(e.target.value))}),(0,r.jsx)(cY,{children:h.light2Intensity.toFixed(2)})]}),(0,r.jsxs)(cW,{children:[(0,r.jsx)("span",{children:"matte"}),(0,r.jsx)(cO,{type:"range",min:0,max:1,step:.01,value:h.matteRoughness,onChange:e=>E("matteRoughness",Number(e.target.value))}),(0,r.jsx)(cY,{children:h.matteRoughness.toFixed(2)})]}),(0,r.jsxs)(cW,{children:[(0,r.jsx)("span",{children:"foil"}),(0,r.jsx)(cO,{type:"range",min:0,max:1,step:.01,value:h.foilOpacity,onChange:e=>E("foilOpacity",Number(e.target.value))}),(0,r.jsx)(cY,{children:h.foilOpacity.toFixed(2)})]}),(0,r.jsxs)(cW,{children:[(0,r.jsx)("span",{children:"grain"}),(0,r.jsx)(cO,{type:"range",min:0,max:1,step:.01,value:h.grainAmount,onChange:e=>E("grainAmount",Number(e.target.value))}),(0,r.jsx)(cY,{children:h.grainAmount.toFixed(2)})]}),(0,r.jsxs)(cW,{children:[(0,r.jsx)("span",{children:"bevel"}),(0,r.jsx)(cO,{type:"range",min:0,max:5,step:.01,value:h.bevelStrength,onChange:e=>E("bevelStrength",Number(e.target.value))}),(0,r.jsx)(cY,{children:h.bevelStrength.toFixed(2)})]}),(0,r.jsxs)(cW,{children:[(0,r.jsx)("span",{children:"con"}),(0,r.jsx)(cO,{type:"range",min:0,max:3,step:.01,value:h.foilContrast,onChange:e=>E("foilContrast",Number(e.target.value))}),(0,r.jsx)(cY,{children:h.foilContrast.toFixed(2)})]})]}),(0,r.jsxs)(cB,{children:[(0,r.jsx)(cF,{children:"Editing context"}),(0,r.jsxs)(cV,{children:[(0,r.jsx)(cX,{type:"button",$active:"desktop"===m,onClick:()=>g("desktop",!0),children:"Desktop"}),(0,r.jsx)(cX,{type:"button",$active:"mobile"===m,onClick:()=>g("mobile",!0),children:"Mobile"})]}),(0,r.jsxs)(c$,{children:["Viewport: ",y.width," \xd7 ",y.height," \xb7 blend t=",I.toFixed(2),(0,r.jsx)("br",{}),"Auto: ",j,f?" \xb7 locked to ".concat(m):" \xb7 following auto",f?(0,r.jsxs)(r.Fragment,{children:[" ","\xb7"," ",(0,r.jsx)("button",{type:"button",style:{background:"none",border:"none",color:"inherit",curs
1or:"pointer",textDecoration:"underline",padding:0,font:"inherit"},onClick:()=>g(j,!1),children:"unlock"})]}):(0,r.jsxs)(r.Fragment,{children:[" ","\xb7"," ",(0,r.jsx)("button",{type:"button",style:{background:"none",border:"none",color:"inherit",cursor:"pointer",textDecoration:"underline",padding:0,font:"inherit"},onClick:()=>g(j,!1),children:"sync auto"})]})]})]}),(0,r.jsxs)(cB,{children:[(0,r.jsx)(cF,{children:"Products & cycle order"}),(0,r.jsx)(cN,{children:c.map((e,t)=>{let n=cK(e),i=n===l;return(0,r.jsxs)(cG,{$active:i,$dragOver:C===e&&b!==e,onClick:()=>s(n),onDragOver:t=>{t.preventDefault(),b&&b!==e&&M(e)},onDragLeave:()=>{C===e&&M(null)},onDrop:t=>{t.preventDefault(),b&&A(b,e),k(null),M(null)},children:[(0,r.jsx)(cU,{type:"button","aria-label":"Drag ".concat(cQ(e)," to reorder"),draggable:!0,onClick:e=>e.stopPropagation(),onDragStart:t=>{t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e),k(e)},onDragEnd:()=>{k(null),M(null)},children:"⠿"}),(0,r.jsx)(cH,{children:t+1}),(0,r.jsx)(cq,{children:cQ(e)})]},e)})})]}),z&&D?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(cz,{children:[l+1,". ",z.label]}),(0,r.jsxs)(cD,{children:[m," \xb7 ",S," \xb7 scroll ","".concat(Math.round(100*aN(u)),"%")]}),(0,r.jsxs)(cB,{children:[(0,r.jsx)(cF,{children:"X (screen center)"}),(0,r.jsxs)(cW,{children:[(0,r.jsx)("span",{children:"val"}),(0,r.jsx)(cO,{type:"range",min:-.2,max:1.5,step:.001,value:D.x,onChange:e=>P("x",Number(e.target.value))}),(0,r.jsx)(cY,{children:D.x.toFixed(3)})]})]}),(0,r.jsxs)(cB,{children:[(0,r.jsx)(cF,{children:"Y (screen center)"}),(0,r.jsxs)(cW,{children:[(0,r.jsx)("span",{children:"val"}),(0,r.jsx)(cO,{type:"range",min:-.2,max:1.5,step:.001,value:D.y,onChange:e=>P("y",Number(e.target.value))}),(0,r.jsx)(cY,{children:D.y.toFixed(3)})]})]}),(0,r.jsxs)(cB,{children:[(0,r.jsx)(cF,{children:"Width fraction"}),(0,r.jsxs)(cW,{children:[(0,r.jsx)("span",{children:"val"}),(0,r.jsx)(cO,{type:"range",min:.05,max:6,step:.01,value:D.scale,onChange:e=>P("scale",Number(e.target.value))}),(0,r.jsx)(cY,{children:D.scale.toFixed(2)})]})]}),(0,r.jsxs)(cB,{children:[(0,r.jsx)(cF,{children:"Rotation (degrees)"}),(0,r.jsx)(cT,{style:{marginBottom:6},children:"\xb1180\xb0 is the same pose. Use beyond \xb1180 for full spins (e.g. 0 → 270)."}),(0,r.jsxs)(cW,{children:[(0,r.jsx)("span",{children:"val"}),(0,r.jsx)(cO,{type:"range",min:-360,max:360,step:.1,value:D.rotation,onChange:e=>P("rotation",Number(e.target.value))}),(0,r.jsxs)(cY,{children:[D.rotation.toFixed(1),"\xb0"]})]})]}),(0,r.jsxs)(c_,{children:[(0,r.jsx)(cZ,{type:"button",onClick:()=>R("desktop","mobile"),children:"Desktop → mobile"}),(0,r.jsx)(cZ,{type:"button",onClick:()=>R("mobile","desktop"),children:"Mobile → desktop"})]})]}):null,(0,r.jsxs)(c_,{children:[(0,r.jsx)(cZ,{type:"button",onClick:L,children:"Copy all"}),(0,r.jsx)(cZ,{type:"button",onClick:n,children:"Close"}),x?(0,r.jsx)(cJ,{children:"Copied"}):null]})]})}let c1=o.Ay.div.withConfig({componentId:"sc-8485c71e-0"})(["position:fixed;bottom:12px;left:12px;z-index:9999;width:min(320px,calc(100vw - 24px));max-height:min(90vh,calc(100dvh - 24px));overflow-y:auto;padding:12px 14px;background:rgba(0,0,0,0.88);color:#fff;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11px;border-radius:8px;box-shadow:0 8px 32px rgba(0,0,0,0.35);pointer-events:auto;"]),c2=o.Ay.div.withConfig({componentId:"sc-8485c71e-1"})(["display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;"]),c5=o.Ay.div.withConfig({componentId:"sc-8485c71e-2"})(["font-weight:700;letter-spacing:-0.02em;"]),c3=o.Ay.button.withConfig({componentId:"sc-8485c71e-3"})(["border:1px solid rgba(255,255,255,0.25);background:rgba(255,255,255,0.08);color:#fff;font:inherit;font-size:10px;padding:3px 8px;border-radius:4px;cursor:pointer;"]),c4=o.Ay.div.withConfig({componentId:"sc-8485c71e-4"})(["opacity:0.55;margin-bottom:10px;line-height:1.35;"]),c6=o.Ay.div.withConfig({componentId:"sc-8485c71e-5"})(["margin-bottom:10px;"]),c8=o.Ay.div.withConfig({componentId:"sc-8485c71e-6"})(["opacity:0.65;margin-bottom:6px;font-size:10px;text-transform:uppercase;letter-spacing:0.04em;"]),c9=o.Ay.label.withConfig({componentId:"sc-8485c71e-7"})(["display:grid;grid-template-columns:52px 1fr 52px;align-items:center;gap:8px;margin-bottom:6px;"]),c7=o.Ay.input.withConfig({componentId:"sc-8485c71e-8"})(["width:100%;accent-color:#91fc1e;"]),de=o.Ay.span.withConfig({componentId:"sc-8485c71e-9"})(["text-align:right;opacity:0.85;"]),dt=o.Ay.div.withConfig({componentId:"sc-8485c71e-10"})(["display:flex;gap:8px;margin-top:8px;"]),dn=o.Ay.button.withConfig({componentId:"sc-8485c71e-11"})(["flex:1;border:1px solid rgba(255,255,255,0.2);background:rgba(255,255,255,0.08);color:#fff;font:inherit;font-size:10px;padding:6px 8px;border-radius:4px;cursor:pointer;"]),dr=o.Ay.span.withConfig({componentId:"sc-8485c71e-12"})(["align-self:center;opacity:0.7;font-size:10px;"]);function di(e){let{open:t,onClose:n}=e,[o,l]=(0,i.fp)(ek),[s,c]=(0,a.useState)(!1),d=(0,a.useCallback)((e,t)=>{l(n=>({...n,[e]:t}))},[l]),u=(0,a.useCallback)((e,t,n)=>{l(r=>{let i=[...r[e]];return i[t]=n,{...r,[e]:i}})},[l]);(0,a.useEffect)(()=>
1{if(!t)return;let e=e=>{if(e.repeat)return;let t=e.target;null!=t&&t.closest("input, textarea, select, [contenteditable='true'], [role='textbox']")||"Escape"===e.key&&(e.preventDefault(),n())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,n]);let h=(0,a.useCallback)(async()=>{await navigator.clipboard.writeText(JSON.stringify(o,null,2)),c(!0),window.setTimeout(()=>c(!1),1500)},[o]),p=(0,a.useCallback)(()=>{l(eb())},[l]);return t?(0,r.jsxs)(c1,{children:[(0,r.jsxs)(c2,{children:[(0,r.jsx)(c5,{children:"Footer foil"}),(0,r.jsx)(c3,{type:"button",onClick:n,children:"Close"})]}),(0,r.jsx)(c4,{children:"Alt+Shift+F toggles this panel. Escape closes."}),(0,r.jsxs)(c6,{children:[(0,r.jsx)(c8,{children:"Foil"}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"foil"}),(0,r.jsx)(c7,{type:"range",min:0,max:1,step:.01,value:o.foilOpacity,onChange:e=>d("foilOpacity",Number(e.target.value))}),(0,r.jsx)(de,{children:o.foilOpacity.toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"con"}),(0,r.jsx)(c7,{type:"range",min:0,max:5,step:.01,value:o.foilContrast,onChange:e=>d("foilContrast",Number(e.target.value))}),(0,r.jsx)(de,{children:o.foilContrast.toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"sat"}),(0,r.jsx)(c7,{type:"range",min:0,max:3,step:.01,value:o.foilSaturation,onChange:e=>d("foilSaturation",Number(e.target.value))}),(0,r.jsx)(de,{children:o.foilSaturation.toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"pattern"}),(0,r.jsx)(c7,{type:"range",min:.01,max:2,step:.01,value:o.patternScale,onChange:e=>d("patternScale",Number(e.target.value))}),(0,r.jsx)(de,{children:o.patternScale.toFixed(2)})]})]}),(0,r.jsxs)(c6,{children:[(0,r.jsx)(c8,{children:"Depth"}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"emboss"}),(0,r.jsx)(c7,{type:"range",min:0,max:3,step:.01,value:o.embossStrength,onChange:e=>d("embossStrength",Number(e.target.value))}),(0,r.jsx)(de,{children:o.embossStrength.toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"eps"}),(0,r.jsx)(c7,{type:"range",min:5e-4,max:.02,step:1e-4,value:o.embossEps,onChange:e=>d("embossEps",Number(e.target.value))}),(0,r.jsx)(de,{children:o.embossEps.toFixed(4)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"edge"}),(0,r.jsx)(c7,{type:"range",min:0,max:.5,step:.01,value:o.embossEdge,onChange:e=>d("embossEdge",Number(e.target.value))}),(0,r.jsx)(de,{children:o.embossEdge.toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"liquid"}),(0,r.jsx)(c7,{type:"range",min:0,max:4,step:.01,value:o.liquidNormalStrength,onChange:e=>d("liquidNormalStrength",Number(e.target.value))}),(0,r.jsx)(de,{children:o.liquidNormalStrength.toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"peel"}),(0,r.jsx)(c7,{type:"range",min:0,max:3,step:.01,value:o.curlPeelDepth,onChange:e=>d("curlPeelDepth",Number(e.target.value))}),(0,r.jsx)(de,{children:o.curlPeelDepth.toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"curlZ"}),(0,r.jsx)(c7,{type:"range",min:0,max:3,step:.01,value:o.curlCameraBias,onChange:e=>d("curlCameraBias",Number(e.target.value))}),(0,r.jsx)(de,{children:o.curlCameraBias.toFixed(2)})]})]}),(0,r.jsxs)(c6,{children:[(0,r.jsx)(c8,{children:"Surface"}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"fresnel"}),(0,r.jsx)(c7,{type:"range",min:0,max:.3,step:.005,value:o.fresnelStrength,onChange:e=>d("fresnelStrength",Number(e.target.value))}),(0,r.jsx)(de,{children:o.fresnelStrength.toFixed(3)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"glint"}),(0,r.jsx)(c7,{type:"range",min:0,max:4,step:.01,value:o.specGlintStrength,onChange:e=>d("specGlintStrength",Number(e.target.value))}),(0,r.jsx)(de,{children:o.specGlintStrength.toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"sheen"}),(0,r.jsx)(c7,{type:"range",min:0,max:1,step:.01,value:o.specSheenStrength,onChange:e=>d("specSheenStrength",Number(e.target.value))}),(0,r.jsx)(de,{children:o.specSheenStrength.toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"shade−"}
1),(0,r.jsx)(c7,{type:"range",min:0,max:1.5,step:.01,value:o.lightShadeMin,onChange:e=>d("lightShadeMin",Number(e.target.value))}),(0,r.jsx)(de,{children:o.lightShadeMin.toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"shade+"}),(0,r.jsx)(c7,{type:"range",min:.5,max:3,step:.01,value:o.lightShadeMax,onChange:e=>d("lightShadeMax",Number(e.target.value))}),(0,r.jsx)(de,{children:o.lightShadeMax.toFixed(2)})]})]}),(0,r.jsxs)(c6,{children:[(0,r.jsx)(c8,{children:"Ripple"}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"amp"}),(0,r.jsx)(c7,{type:"range",min:0,max:2,step:.01,value:o.rippleAmplitude,onChange:e=>d("rippleAmplitude",Number(e.target.value))}),(0,r.jsx)(de,{children:o.rippleAmplitude.toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"freq"}),(0,r.jsx)(c7,{type:"range",min:1,max:80,step:.5,value:o.rippleFrequency,onChange:e=>d("rippleFrequency",Number(e.target.value))}),(0,r.jsx)(de,{children:o.rippleFrequency.toFixed(1)})]})]}),(0,r.jsxs)(c6,{children:[(0,r.jsx)(c8,{children:"Sticker"}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"scale"}),(0,r.jsx)(c7,{type:"range",min:.5,max:3,step:.01,value:o.stickerScale,onChange:e=>d("stickerScale",Number(e.target.value))}),(0,r.jsx)(de,{children:o.stickerScale.toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"speed"}),(0,r.jsx)(c7,{type:"range",min:0,max:3,step:.01,value:o.animationSpeed,onChange:e=>d("animationSpeed",Number(e.target.value))}),(0,r.jsx)(de,{children:o.animationSpeed.toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"curl"}),(0,r.jsx)(c7,{type:"range",min:0,max:1,step:.01,value:o.curlTightness,onChange:e=>d("curlTightness",Number(e.target.value))}),(0,r.jsx)(de,{children:o.curlTightness.toFixed(2)})]})]}),(0,r.jsxs)(c6,{children:[(0,r.jsx)(c8,{children:"Lights"}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"L1"}),(0,r.jsx)(c7,{type:"range",min:0,max:5,step:.01,value:o.light1Intensity,onChange:e=>d("light1Intensity",Number(e.target.value))}),(0,r.jsx)(de,{children:o.light1Intensity.toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"L2"}),(0,r.jsx)(c7,{type:"range",min:0,max:5,step:.01,value:o.light2Intensity,onChange:e=>d("light2Intensity",Number(e.target.value))}),(0,r.jsx)(de,{children:o.light2Intensity.toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"L1 x"}),(0,r.jsx)(c7,{type:"range",min:-20,max:20,step:.01,value:o.light1Position[0],onChange:e=>u("light1Position",0,Number(e.target.value))}),(0,r.jsx)(de,{children:o.light1Position[0].toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"L1 y"}),(0,r.jsx)(c7,{type:"range",min:-20,max:20,step:.01,value:o.light1Position[1],onChange:e=>u("light1Position",1,Number(e.target.value))}),(0,r.jsx)(de,{children:o.light1Position[1].toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"L2 x"}),(0,r.jsx)(c7,{type:"range",min:-20,max:20,step:.01,value:o.light2Position[0],onChange:e=>u("light2Position",0,Number(e.target.value))}),(0,r.jsx)(de,{children:o.light2Position[0].toFixed(2)})]}),(0,r.jsxs)(c9,{children:[(0,r.jsx)("span",{children:"L2 y"}),(0,r.jsx)(c7,{type:"range",min:-20,max:20,step:.01,value:o.light2Position[1],onChange:e=>u("light2Position",1,Number(e.target.value))}),(0,r.jsx)(de,{children:o.light2Position[1].toFixed(2)})]})]}),(0,r.jsxs)(dt,{children:[(0,r.jsx)(dn,{type:"button",onClick:h,children:"Copy JSON"}),(0,r.jsx)(dn,{type:"button",onClick:p,children:"Reset"}),s?(0,r.jsx)(dr,{children:"Copied"}):null]})]}):null}let da=o.Ay.div.withConfig({componentId:"sc-16ab8b89-0"})(["position:fixed;bottom:12px;left:12px;z-index:10001;width:min(340px,calc(100vw - 24px));max-height:min(70vh,calc(100dvh - 24px));overflow-y:auto;padding:12px 14px;background:rgba(0,0,0,0.92);color:#fff;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11px;border-radius:8px;box-shadow:0 8px 32px rgba(0,0,0,0.45);pointer-events:auto;@media (max-width:","px){bottom:0;left:0;right:0;width:100%;max-height:55vh;border-radius:10px 10px 0 0;}"],699),dl=o.Ay.div.withConfig({componentId:"sc-16ab8b89-1"})(["font-weight:700;margin-bottom:6px;"]),ds=o.Ay.div.withConfig({componentId:"sc-16ab8b89-2"})(["opacity:0.55;margin-bottom:10px;line-height:1.35;"]),dc=o.Ay.label.withConfig({componentId:"sc-16ab8b89-3"})(["display:grid;grid-template-columns:18px 1fr;gap:8px;align-items:start;margin-bottom:8px;
1cursor:pointer;"]),dd=o.Ay.div.withConfig({componentId:"sc-16ab8b89-4"})(["line-height:1.35;"]),du=o.Ay.div.withConfig({componentId:"sc-16ab8b89-5"})(["font-weight:600;"]),dh=o.Ay.div.withConfig({componentId:"sc-16ab8b89-6"})(["opacity:0.5;margin-top:2px;font-size:10px;"]),dp=o.Ay.div.withConfig({componentId:"sc-16ab8b89-7"})(["display:flex;gap:8px;margin-top:10px;"]),dm=o.Ay.button.withConfig({componentId:"sc-16ab8b89-8"})(["flex:1;padding:6px 8px;border:1px solid rgba(255,255,255,0.2);border-radius:4px;background:rgba(255,255,255,0.08);color:#fff;font:inherit;font-size:10px;cursor:pointer;"]);function df(e){let{open:t,onClose:n}=e,[o,l]=(0,i.fp)(eE),s=(0,a.useCallback)((e,t)=>{l(n=>({...n,[e]:t}))},[l]),c=(0,a.useCallback)(()=>{l(eA(window.innerWidth))},[l]),d=(0,a.useCallback)(()=>{l({soccerBall:!0,ballGoal:!0,markerPens:!0,ballTrailComposite:!0,footerFoilRipple:!0,footerBallCursors:!0,goalNetShader:!0,heroProductCycle:!0,galleryVideo:!0})},[l]);return t?(0,r.jsxs)(da,{"data-crash-isolation-panel":!0,children:[(0,r.jsx)(dl,{children:"Crash isolation (/usmnt)"}),(0,r.jsx)(ds,{children:"Toggle usmnt-only systems (not on /aj1). Shift+C or Alt+Shift+C \xb7 reload after changing soccer ball scene flags."}),Object.keys(eP).map(e=>{let t=eP[e];return(0,r.jsxs)(dc,{children:[(0,r.jsx)("input",{type:"checkbox",checked:o[e],onChange:t=>s(e,t.target.checked)}),(0,r.jsxs)(dd,{children:[(0,r.jsx)(du,{children:t.label}),(0,r.jsx)(dh,{children:t.hint})]})]},e)}),(0,r.jsxs)(dp,{children:[(0,r.jsx)(dm,{type:"button",onClick:c,children:"Mobile defaults"}),(0,r.jsx)(dm,{type:"button",onClick:d,children:"Enable all"}),(0,r.jsx)(dm,{type:"button",onClick:n,children:"Close"})]})]}):null}function dg(e){return e instanceof Element&&null!=e.closest("[data-zine-overlay]")}var dx=n(1963);let dv=o.Ay.div.withConfig({componentId:"sc-828d6b71-0"})(["position:relative;overflow-x:clip;color:#1e1e1e;"]),dy=o.Ay.div.withConfig({componentId:"sc-828d6b71-1"})(["position:fixed;inset:0;z-index:1;background-color:#fff;pointer-events:none;"]),dw=(0,o.AH)(["@media (max-width:","px){visibility:",";}"],700,e=>{let{$heroHidden:t}=e;return t?"hidden":"visible"}),db=o.Ay.main.withConfig({componentId:"sc-828d6b71-2"})(["position:fixed;inset:0;z-index:1;pointer-events:none;padding:",";display:flex;flex-direction:column;justify-content:space-between;",""],e=>{let{theme:t}=e;return t.spacing.page},dw),dk=o.Ay.div.withConfig({componentId:"sc-828d6b71-3"})(["position:relative;z-index:25;display:flex;flex-direction:column;justify-content:space-between;flex:1;"]),dC=o.Ay.div.withConfig({componentId:"sc-828d6b71-4"})(["height:0.5vh;height:0.5dvh;flex-shrink:0;@media (max-width:700px){height:0;}"]),dM=o.Ay.section.withConfig({componentId:"sc-828d6b71-5"})(["position:relative;flex:0 0 auto;display:flex;justify-content:flex-start;align-items:flex-start;padding:1rem 0;width:100%;"]),dS=o.Ay.div.withConfig({componentId:"sc-828d6b71-6"})(["position:relative;font-size:calc(var(--vw) * 19.55vw - 0.2rem);line-height:0.8;min-height:calc(46px + 0.8em);width:100%;@media (min-width:720px){font-size:calc(var(--vw) * 12.55vw - 0.1rem);}"]),dj=o.Ay.section.withConfig({componentId:"sc-828d6b71-7"})(["position:relative;z-index:3;padding:0;display:flex;flex-direction:column;background-color:transparent;overflow-x:clip;pointer-events:none;"]),dI=o.Ay.div.withConfig({componentId:"sc-828d6b71-8"})(["position:relative;width:100%;display:flex;flex-direction:column;"]),dA=o.Ay.div.withConfig({componentId:"sc-828d6b71-9"})(["flex-shrink:0;position:relative;z-index:55;"]),dP=o.Ay.div.withConfig({componentId:"sc-828d6b71-10"})(["height:","vh;height:","dvh;flex-shrink:0;position:relative;"],100,100),dR=o.Ay.div.withConfig({componentId:"sc-828d6b71-11"})(["position:absolute;inset:0;pointer-events:none;"]),dE=o.Ay.div.withConfig({componentId:"sc-828d6b71-12"})(["position:sticky;top:0;z-index:55;pointer-events:none;"]),dL=o.Ay.div.withConfig({componentId:"sc-828d6b71-13"})(["position:fixed;inset:0;top:0;z-index:2;pointer-events:none;padding:",";display:flex;flex-direction:column;justify-content:space-between;",""],e=>{let{theme:t}=e;return t.spacing.page},dw),dz=o.Ay.div.withConfig({componentId:"sc-828d6b71-14"})(["position:fixed;inset:0;z-index:30;pointer-events:none;padding:",";display:flex;flex-direction:column;justify-content:space-between;"," ",""],e=>{let{theme:t}=e;return t.spacing.page},dw,e=>{let{$tuningActive:t,$overlayInteractive:n=!0}=e;return t?(0,o.AH)(["&,& > *{pointer-events:none !important;}"]):(0,o.AH)(["& > *{pointer-events:auto;}@media (max-width:","px){& > *{pointer-events:",";}}"],700,n?"auto":"none")}),dD=o.Ay.div.withConfig({componentId:"sc-828d6b71-15"})(["",""],e=>{let{$tuningActive:t}=e;return t&&(0,o.AH)(["pointer-events:none !important;"])}),dT=o.Ay.div.withConfig({componentId:"sc-828d6b71-16"})(["visibility:hidden;pointer-events:none;z-index:500;position:fixed;left:0;top:0;width:100%;@media (max-width:700px){min-height:32px;}"]);function dB(){var e,t;let n=(0,i.Xr)(l.u),o=(0,i.Xr)(eL),s=(0,i.Xr)(cC.C),c=(0,i.md)(eL),d=(0,a.useRef)(c);d.current=c;let u=(0,i.md)(eE),h=(0,i.Xr)(eE);(0,a.useLayoutEffect)(()=>
1{h(function(e){try{let t=localStorage.getItem(ej);if(!t)return eA(e);let n=JSON.parse(t);if("object"!=typeof n||null==n)return eA(e);return{...eA(e),...n}}catch(t){return eA(e)}}(window.innerWidth))},[h]);let p=(0,i.md)(eL),m=(0,a.useRef)(p);m.current=p,(0,a.useEffect)(()=>{if(!p)return;let e=window.scrollY,{body:t}=document,n={bodyOverflow:t.style.overflow,bodyPosition:t.style.position,bodyTop:t.style.top,bodyWidth:t.style.width,htmlOverflow:document.documentElement.style.overflow};t.style.overflow="hidden",t.style.position="fixed",t.style.top="-".concat(e,"px"),t.style.width="100%",document.documentElement.style.overflow="hidden";let r=e=>{dg(e.target)||e.preventDefault()},i=()=>{m.current&&window.scrollTo(0,e)},a=e=>{dg(e.target)||e.stopImmediatePropagation()};return window.addEventListener("scroll",i,{passive:!0}),document.addEventListener("wheel",r,{capture:!0,passive:!1}),document.addEventListener("touchmove",r,{capture:!0,passive:!1}),document.addEventListener("mousemove",a,{capture:!0}),document.addEventListener("pointermove",a,{capture:!0}),()=>{t.style.overflow=n.bodyOverflow,t.style.position=n.bodyPosition,t.style.top=n.bodyTop,t.style.width=n.bodyWidth,document.documentElement.style.overflow=n.htmlOverflow,window.removeEventListener("scroll",i),document.removeEventListener("wheel",r,!0),document.removeEventListener("touchmove",r,!0),document.removeEventListener("mousemove",a,!0),document.removeEventListener("pointermove",a,!0),window.scrollTo(0,e)}},[p]);let f=(0,a.useRef)(null),g=(0,a.useRef)(null),x=(0,a.useRef)(null),[v,y]=(0,a.useState)(0),[w,b]=(0,a.useState)(0),[k,C]=(0,a.useState)(0),[M,S]=(0,a.useState)(!1),[j,I]=(0,a.useState)(!1),[A,P]=(0,a.useState)(null),[R,E]=(0,a.useState)(null),[L,z]=(0,a.useState)(null),D=(0,a.useRef)(null),[T,B]=(0,a.useState)(!1),[F,W]=(0,a.useState)(!1),O=(0,i.md)(eU),N=(0,a.useRef)(O);N.current=O;let[G,U]=(0,a.useState)(!1),[H,q]=(0,a.useState)(()=>az.map(e=>aL(e.id))),[V,X]=(0,a.useState)(()=>aA()),[$,_]=(0,a.useState)(()=>aT([...aD])),Z=(0,a.useCallback)(e=>{_(aT(e))},[]),J=(0,a.useMemo)(()=>aB($),[$]),[K,Q]=(0,a.useState)(!1),[ee,et]=(0,a.useState)(!1),[en,er]=(0,a.useState)(!1),ei=eG(),[ea,eo]=(0,a.useState)(null),[el,ec]=(0,a.useState)("desktop"),[ed,eu]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(ed)return;let e=()=>ec(aF(window.innerWidth));return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ed]);let eh=(0,a.useCallback)((e,t)=>{ec(e),eu(t)},[]),ep=(0,a.useCallback)(()=>{Q(!1),eo(null)},[]);!function(e,t,n){let r=!(arguments.length>3)||void 0===arguments[3]||arguments[3];(0,a.useEffect)(()=>{if(!r)return;let i=r=>{if(r.repeat)return;let i=r.target;if(null==i?void 0:i.closest("input, textarea, select, [contenteditable='true'], [role='textbox']"))return;let a="KeyC"===r.code&&!r.metaKey&&!r.ctrlKey,o=a&&r.shiftKey&&!r.altKey,l=a&&r.altKey&&r.shiftKey;if(o||l){r.preventDefault(),t();return}"Escape"===r.key&&e&&n()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[e,t,n,r])}(en,(0,a.useCallback)(()=>{er(e=>!e)},[]),()=>er(!1),ei),(0,a.useEffect)(()=>{if(!ei)return;let e=e=>{if(e.repeat)return;let t=e.target;(null==t||!t.closest("input, textarea, select, [contenteditable='true'], [role='textbox']"))&&e.altKey&&e.shiftKey&&"KeyF"===e.code&&(e.preventDefault(),et(e=>!e))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[ei]);let em=(0,a.useCallback)(e=>{eo(e),null!=e&&ei&&Q(!0)},[ei]),ef=(0,a.useCallback)((e,t,n)=>{let r=aW(v);q(i=>i.map((i,a)=>{if(a!==e)return i;let o=aq(i,el,r);return aV(i,el,r,{x:o.x+t,y:o.y+n})}))},[v,el]),{trackGalleryOpen:eg,trackGalleryClose:ex,trackZineOpen:ev,trackZineClose:ey}=(0,dx._)({scrollProgress:v,articleProgress:w,galleryOpen:j,galleryOpenFootnoteId:L,zineOpen:G,splatOpen:!1}),ew=(0,a.useRef)(j),eb=(0,a.useRef)(G),ek=(0,a.useRef)(ex),eC=(0,a.useRef)(ey);ew.current=j,eb.current=G,ek.current=ex,eC.current=ey,(0,a.useEffect)(()=>()=>{ew.current&&ek.current(),eb.current&&eC.current()},[]);let eM=(0,a.useCallback)(e=>y(e),[]),eS=(0,a.useCallback)(()=>B(!0),[]),eI=(0,a.useCallback)(e=>b(e),[]),eP=(0,a.useCallback)(e=>C(e),[]),eR=(0,a.useCallback)(()=>{null!=D.current&&(clearTimeout(D.current),D.current=null)},[]),ez=(0,a.useCallback)(e=>{F&&!N.current&&(eR(),E(e))},[eR,F]),eD=(0,a.useCallback)(()=>{eR(),D.current=setTimeout(()=>{E(null),D.current=null},200)},[eR]),eT=(0,a.useCallback)(()=>{eR()},[eR]),eB=(0,a.useCallback)(()=>{s(!1),U(!0),ev()},[ev,s]);(0,a.useEffect)(()=>
1{if(!G)return void s(!1);s(!1);let e=!1,t=window.setTimeout(()=>{e||(o(!0),requestAnimationFrame(()=>{e||s(!0)}))},cC.b);return()=>{e=!0,window.clearTimeout(t)}},[G,s,o]);let eF=(0,a.useCallback)(()=>{o(!1),s(!1)},[o,s]),eW=(0,a.useCallback)((e,t,n)=>{eR(),E(null),j&&ex(),z(n),P({x:e,y:t}),I(!0),eg(n)},[eR,j,ex,eg]),eO=(0,a.useCallback)(()=>{ex(),I(!1),z(null),P(null)},[ex]),eY=(0,a.useCallback)(()=>{eR(),E(null)},[eR]);(0,a.useEffect)(()=>()=>eR(),[eR]),(0,a.useEffect)(()=>{O&&(eR(),E(null))},[O,eR]),(0,a.useEffect)(()=>{let e=()=>{eR(),E(null)};return window.addEventListener(eH,e),()=>window.removeEventListener(eH,e)},[eR]),(0,a.useEffect)(()=>()=>{o(!1),s(!1)},[o,s]),(0,a.useEffect)(()=>{let e=window.matchMedia("(pointer: coarse)"),t=()=>{let t=e.matches,n=window.innerWidth<900;W(!t&&!n)};return t(),e.addEventListener("change",t),window.addEventListener("resize",t),()=>{e.removeEventListener("change",t),window.removeEventListener("resize",t)}},[]),(0,a.useEffect)(()=>{F||(eR(),E(null))},[F,eR]);let eN=(0,a.useCallback)(()=>{ey(),U(!1)},[ey]);(0,a.useEffect)(()=>{let e=e=>{if("Space"!==e.code&&" "!==e.key||e.repeat)return;let t=e.target;!t||t.closest("input, textarea, select, [contenteditable='true'], [role='textbox']")||(e.preventDefault(),n(e=>!e))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]),(0,a.useEffect)(()=>{let e=document.getElementById("aj1-main-footer");if(!e)return;let t=()=>{d.current||S(e.getBoundingClientRect().top<=2)};return t(),window.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t),()=>{window.removeEventListener("scroll",t),window.removeEventListener("resize",t)}},[]),(0,a.useEffect)(()=>{let e=g.current;if(!e)return;let t=()=>{if(d.current)return;let t=e.getBoundingClientRect(),n=t.top+window.scrollY,r=t.height||e.offsetHeight;document.documentElement.style.setProperty(is,"".concat(n,"px")),document.documentElement.style.setProperty(ic,"".concat(r,"px"))};t();let n=new ResizeObserver(t);return n.observe(e),window.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t),()=>{n.disconnect(),window.removeEventListener("scroll",t),window.removeEventListener("resize",t),document.documentElement.style.removeProperty(is),document.documentElement.style.removeProperty(ic)}},[]);let eq=w>=1,eV=!eq&&v<.01;return(0,r.jsxs)(dv,{children:[(0,r.jsx)(dy,{"aria-hidden":!0}),(0,r.jsx)(db,{$heroHidden:eq,children:(0,r.jsx)(aS,{})}),(0,r.jsx)(dT,{"aria-hidden":!0,children:(0,r.jsx)(Y,{animateText:!1,articleProgress:w,isFooterFullyVisible:M})}),(0,r.jsxs)(dL,{$heroHidden:eq,children:[(0,r.jsx)(dk,{children:(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",flex:1},children:(0,r.jsx)(dM,{children:(0,r.jsx)(es,{variant:"vaa-for",scrollProgress:v,articleProgress:w,showBehindVaaPrefix:T,pointerCursor:!1})})})}),(0,r.jsx)(es,{variant:"bottom-band-usmnt",scrollProgress:v,pointerCursor:!1})]}),(0,r.jsx)(dD,{$tuningActive:K,children:(0,r.jsx)(Y,{articleProgress:w,isFooterFullyVisible:M})}),(0,r.jsxs)(dz,{$tuningActive:K,$heroHidden:eq,$overlayInteractive:eV,children:[(0,r.jsx)(dk,{children:(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[(0,r.jsx)(dS,{"aria-hidden":!0}),(0,r.jsx)(dM,{children:(0,r.jsx)(es,{variant:"rest",scrollProgress:v,articleProgress:w,pointerCursor:!1})})]})}),(0,r.jsx)(es,{variant:"bottom-band-nike",scrollProgress:v,pointerCursor:!1})]}),(0,r.jsxs)(dI,{children:[(0,r.jsx)(dC,{}),(0,r.jsx)(dj,{children:(0,r.jsx)(of,{ref:x,articleRef:f,onProgressChange:eM,onArticleProgressChange:eI,onArticleDockMotionProgressChange:eP,onShoeFadeInComplete:eS,resetToInitialTrigger:0,scrollOffsetVh:0,mobileProxyHeightMultiplier:2.4,mobilePortraitProxyHeightMultiplier:1.9,productTunings:H,cycleProductIndices:J,forcedProductIndex:K&&null!=ea?ea:null,onTuningDrag:ef,displayTuning:V,heroProductCycleDisabled:!u.heroProductCycle,introClickScrollDisabled:K||G||j||ee})}),(0,r.jsx)(sQ,{ref:f,articleProgress:w,onOpenGallery:eW,onFootnoteGalleryHoverEnter:ez,onFootnoteGalleryHoverLeave:eD}),(0,r.jsxs)(dA,{children:[(0,r.jsx)(dE,{children:(0,r.jsx)(ac,{})}),(0,r.jsx)(dP,{children:(0,r.jsx)(dR,{ref:g,id:il,"aria-hidden":!0})})]})]}),(0,r.jsx)(iJ,{dockMotionProgress:k,footerRestoreProgress:+!!M,onOpenZine:eB}),u.soccerBall?(0,r.jsx)(iL,{disabled:G||j||K}):null,(0,r.jsx)(cE,{open:G,onClose:eN,onExited:eF}),(0,r.jsx)(am,{dockMotionProgress:k,footerRestoreProgress:+!!M}),(0,r.jsx)(lA,{isOpen:j,onClose:eO,clickOrigin:A,hoverAnchor:j||!F?null:null!=(e=null==R?void 0:R.anchor)?e:null,footnoteId:j?null!=L?L:"01":null!=(t=null==R?void 0:R.footnoteId)?t:"01",onHoverPreviewDismiss:eY,onHoverPreviewMouseEnter:eT,onHoverPreviewMouseLeave:eD,onExpandFromPeek:eW}),ei?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c0,{open:K,onClose:ep,tunings:H,onChange:q,activeIndex:ea,onActiveIndexChange:em,cycleProductIds:$,onCycleOrderChange:Z,scrollT:v,tuningContext:el,tuningContextLocked:ed,onTuningContextChange:eh,displayTuning:V,onDisplayTuningChange:X}),(0,r.jsx)(di,{open:ee,onClose:()=>et(!1)}),(0,r.jsx)(df,{open:en,onClose:()=>er(!1)})]}):null]})}},1217:(e,t,n)=>{"use strict";n.d(t,{d4:()=>a,gj:()=>o,ip:()=>i});let r=0;function i(){r=12}function a(){return r>0}function o(){r>0&&(r-=1)}}
1,1593:(e,t,n)=>{"use strict";n.d(t,{H:()=>o,X:()=>h});var r=n(6748);let i=-10*Math.PI/180,a=-Math.PI/2;function o(e){return e<=r.PU}function l(e,t,n,r){let i=Math.cos(r),a=Math.sin(r);return[e*i+n*a,t,-e*a+n*i]}function s(e,t,n,r){let i=Math.cos(r),a=Math.sin(r);return[e,t*i-n*a,t*a+n*i]}function c(e,t){let[n,r,i]=e;return[n*t,r*t,i*t]}function d(){let e=l(.64,0,0,Math.PI/2);return s(...l(...e,a),i)}function u(){let e=l(.64,0,0,-Math.PI/2);return s(...l(...e,a),i)}function h(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=0===e||e===r,l=i&&o?1:0,s=(n?1.38:3.35)-l,h=(n?2.65:3.35)-l;if(t){if(o){if(0===e){let e=c(d(),a);return{position:[e[0],0,h],target:e}}let t=c(u(),a);return{position:[t[0],0,h],target:t}}return{position:[0,0,h],target:[0,0,0]}}if(o){if(0===e)return{position:[-.5,1,s],target:c(d(),a)};let t=c(u(),a);return{position:[-.5+t[0],1,s],target:t}}return{position:[-.5,1,s],target:[0,0,0]}}},1846:(e,t,n)=>{"use strict";n.d(t,{Lc:()=>m,OD:()=>d,ZR:()=>p,dS:()=>v,eq:()=>c,pk:()=>w,q_:()=>h,vz:()=>u,wd:()=>f,zR:()=>g});var r=n(5339),i=n(6916),a=n(3216);function o(e,t){return"".concat(e,":").concat(t)}let l=new Map,s=new Set;function c(){return{w:768,h:768}}function d(e,t){let n=o(e,t),i=l.get(n);if(!i){let e=document.createElement("canvas");e.width=768,e.height=768;let t=new r.GOR(e);t.colorSpace=r.er$,t.needsUpdate=!0,t.minFilter=t.magFilter=r.k6q,i={canvas:e,texture:t,seeded:!1,baseForClear:null},l.set(n,i)}return i}function u(e,t,n){if(!n)return;let r=d(e,t);if(r.seeded)return;let i=r.canvas.getContext("2d");if(i)try{i.drawImage(n,0,0,768,768),r.seeded=!0,r.baseForClear=n,r.texture.needsUpdate=!0}catch(e){}}function h(e){s.add(e)}function p(e){s.delete(e)}function m(){return Array.from(s)}function f(e,t,n,r,i){let a=d(e,t).canvas.getContext("2d");a&&(a.strokeStyle=i,a.lineWidth=r,a.lineCap="round",a.lineJoin="round",a.beginPath(),a.moveTo(n.x,n.y))}function g(e,t,n,r,a,o){let l=d(e,t),s=l.canvas.getContext("2d");s&&r.last&&(s.strokeStyle=o,s.lineWidth=a,s.lineCap="round",s.lineJoin="round",(0,i.Jb)(s,r,n),l.texture.needsUpdate=!0)}function x(e,t){let n=l.get(o(e,t));if(!(null==n?void 0:n.baseForClear))return;let r=n.canvas.getContext("2d");if(r)try{r.clearRect(0,0,768,768),r.drawImage(n.baseForClear,0,0,768,768),n.texture.needsUpdate=!0}catch(e){}}function v(e){let t=a.Bd.length;if(0===t)return;if(e<=0)return void x(0,"front");if(e>=t)return void x(t-1,"back");let n=Math.min(Math.max(e,0),t-1);x(n,"front"),x(n,"back")}async function y(e,t){let n=l.get(o(e,t));return n?new Promise(e=>{n.canvas.toBlob(t=>e(t),"image/png")}):null}async function w(e){let t=a.Bd.length;if(0===t)return null;let{w:n,h:r}=c();if(e<=0){let e=a.Bd[0];if(!e)return null;let t=await y(0,"front");return t?{blob:t,filename:"".concat(e.front,".png")}:null}if(e>=t){let e=t-1,n=a.Bd[e];if(!n)return null;let r=await y(e,"back");return r?{blob:r,filename:"".concat(n.back,".png")}:null}let i=Math.min(Math.max(e,0),t-1),o=a.Bd[i];if(!o)return null;let l=document.createElement("canvas");l.width=2*n,l.height=r;let s=l.getContext("2d");if(!s)return null;let u=d(i,"front"),h=d(i,"back");s.drawImage(u.canvas,0,0),s.drawImage(h.canvas,n,0);let p=await new Promise(e=>{l.toBlob(t=>e(t),"image/png")});return p?{blob:p,filename:"".concat(o.front,"_").concat(o.back,".png")}:null}},3216:(e,t,n)=>{"use strict";n.d(t,{Bd:()=>k,C$:()=>x,F8:()=>u,JK:()=>d,KS:()=>w,O2:()=>v,RA:()=>m,RY:()=>f,Vj:()=>b,ez:()=>h,fs:()=>c,g4:()=>g,kD:()=>y,nn:()=>s,sg:()=>p,vc:()=>C});var r=n(74),i=n(1593);let a="/images/usmnt/zine",o="".concat(a,"/mobile"),l=["Cover","P1","P2","P3","P4","P5","P6","P7","P8","P9","P10","Back-cover"];function s(e){let t=(0,i.H)(window.innerWidth);return"".concat(t?o:a,"/").concat(encodeURIComponent(e),".").concat("jpg")}let c=(0,r.eU)(0);(0,r.eU)(!1);let d=(0,r.eU)(!1),u=(0,r.eU)(3),h=(0,r.eU)(152),p=(0,r.eU)(100),m=(0,r.eU)(100),f=(0,r.eU)(!1),g=(0,r.eU)({active:!1,pageIndex:null,progress:0}),x=(0,r.eU)(!0),v=(0,r.eU)(!0),y=(0,r.eU)(.42),w=(0,r.eU)(.25);function b(e,t){let n=k.length,r=new Set;r.add(0),e>=n-1-2&&r.add(n-1);let i=Math.max(0,e-2),a=Math.min(n-1,e+2);for(let e=i;e<=a;e++)r.add(e);if(t.active&&null!=t.pageIndex){let e=t.pageIndex;for(let t=Math.max(0,e-1);t<=Math.min(n-1,e+1);t++)r.add(t)}return r}let k=[];k.push({front:l[0],back:l[1]});for(let e=2;e<l.length-2;e+=2)k.push({front:l[e],back:l[e+1]});function C(e){let t=k.length;if(0===t)return"";let n=k[function(e){let t=k.length;return 0===t||e<=0?0:e>=t?t-1:Math.min(e,t-1)}(e)];return n?e<=0?"".concat(n.front,".").concat("jpg"):e>=t?"".concat(n.back,".").concat("jpg"):"".concat(n.front,".").concat("jpg"," \xb7 ").concat(n.back,".").concat("jpg"):""}k.push({front:l[l.length-2],back:l[l.length-1]})},4847:(e,t,n)=>{"use strict";n.d(t,{u:()=>r});let r=(0,n(74).eU)(!1)},6375:(e,t,n)=>{"use strict";n.d(t,{C:()=>a,b:()=>i});var r=n(74);let i=600,a=(0,r.eU)(!1)},6505:(e,t,n)=>{Promise.resolve().then(n.bind(n,706))}
1,6748:(e,t,n)=>{"use strict";n.d(t,{PU:()=>r,Zt:()=>i,c2:()=>o,t_:()=>s,u9:()=>l});let r=700;function i(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:20;return!Number.isFinite(e)||e<=0||t<=0||n<=0?50:e/(2*Math.tan(r*Math.PI/180/2)*(t/n))}function a(e,t,n,r,i){let a=Math.tan(i*Math.PI/180/2)*Math.max(t-e,.12);return{halfWidth:n/r*a,halfHeight:a}}function o(e){if(e<=r)return 1;if(e>=900)return 0;let t=(900-e)/(900-r);return t*t*(3-2*t)}function l(e,t,n,r,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:20,{halfWidth:l,halfHeight:s}=a(n,r,i.width,i.height,o);return{x:(e-.5)*2*l,y:(t-.5)*2*s}}function s(e,t,n,r,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:20,{halfWidth:l}=a(n,r,i.width,i.height,o);return t>0?2*l*e/t:e}},9710:(e,t,n)=>{"use strict";n.d(t,{QU:()=>o,d4:()=>i,w$:()=>a});let r=null;function i(e){r=e}function a(){r=null}async function o(){var e;return await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e()))),null!=(e=null==r?void 0:r())?e:null}}},e=>{e.O(0,[831,367,708,619,202,810,158,235,441,255,358],()=>e(e.s=6505)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.