1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8fd3a31c-f03d-471e-afb2-2fc79e5c8b88",e._sentryDebugIdIdentifier="sentry-dbid-8fd3a31c-f03d-471e-afb2-2fc79e5c8b88")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[485],{6612:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(95155),a=n(12115),i=n(6420),l=n(45014);function o(e){let{cardData:t,onDismiss:n}=e,o=t?"".concat(t.card_type):null,[s,c]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{if(!o)return;c(!1);let e=requestAnimationFrame(()=>c(!0));return()=>cancelAnimationFrame(e)},[o]),!t||!(0,l.E)(t))return null;let u="mind_reply"===t.card_type;return(0,r.jsx)("div",{"data-fam-motion":!0,style:{position:"relative",width:"100%",...(0,i.lU)(s)},children:(0,r.jsxs)("div",{style:u?{width:"100%",position:"relative"}:{width:"100%",background:"color-mix(in srgb, var(--fam-card-bg) 95%, transparent)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",borderRadius:12,overflow:"hidden",position:"relative"},children:[(0,r.jsx)("button",{onClick:n,"aria-label":"Close card",style:{position:"absolute",top:u?14:8,right:u?14:8,zIndex:30,background:u?"color-mix(in srgb, var(--fam-accent, #6ea8ff) 14%, transparent)":"color-mix(in srgb, var(--fam-hint) 20%, transparent)",color:u?"var(--fam-accent, #6ea8ff)":"var(--fam-hint)",border:u?"1px solid color-mix(in srgb, var(--fam-accent, #6ea8ff) 35%, transparent)":"none",borderRadius:u?9:"50%",width:28,height:28,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:(0,r.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})}),(0,r.jsx)("div",{style:u?void 0:{paddingLeft:12,paddingRight:12,paddingTop:8,paddingBottom:10},children:(0,r.jsx)(l.Ay,{cardData:t})})]})})}},20743:(e,t,n)=>{"use strict";function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={engine:"three",...t};try{console.info("[AvatarStage]",e,n)}catch(e){}try{window.dispatchEvent(new CustomEvent("fam_unity_telemetry",{detail:{event:e,detail:n,ts:Date.now()}}))}catch(e){}}n.d(t,{k:()=>r})},32344:(e,t,n)=>{"use strict";n.d(t,{CZ:()=>i,EA:()=>r,Y8:()=>a});let r=9/16,a="".concat(9," / ").concat(16),i="min(100vw, calc(100dvh * ".concat(9," / ").concat(16,"))");"min(100vw, calc(100dvh * ".concat(9," / ").concat(19.5,"))")},33987:e=>{function t(e){return Promise.resolve().then(()=>{var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}t.keys=()=>[],t.resolve=t,t.id=33987,e.exports=t},52061:(e,t,n)=>{"use strict";n.d(t,{Y9:()=>o,No:()=>s});var r=n(38540),a=n(67731),i=n(23540);let l=function(e){return((null!=e?e:"").trim()||"https://pub-593b45d2c4fc478ab01a09b2472f207c.r2.dev/v14").replace(/\/$/,"")}("https://pub-593b45d2c4fc478ab01a09b2472f207c.r2.dev/v14");class o extends Error{constructor(e){super("No bundle session for ".concat(e)),this.kind="profile"}}async function s(e,t){var n,s;let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=function(){let e=window.location.hostname;if("localhost"!==e&&"127.0.0.1"!==e)return null;try{let e=new URLSearchParams(window.location.search).get("modelBase");return e&&sessionStorage.setItem("fam_model_base",e),null!=e?e:sessionStorage.getItem("fam_model_base")}catch(e){return null}}(),d=u,h=!u&&("walletLocked"===e.model.kind||(null==(n=e.anims)?void 0:n.kind)==="walletLocked");if(h){let n=Date.now()+4e3;for(;!t()&&Date.now()<n;)await new Promise(e=>setTimeout(e,100));let r=t();c.remint&&(0,i.KP)();let l=r?await (0,i.TL)(r,a.$G):null;if(!(d=null!=(s=null==l?void 0:l.base)?s:null))throw new o(e.key)}let m={bundleBase:d,publicBase:l},f=e=>"".concat((null!=u?u:"").replace(/\/$/,""),"/").concat(e);return{modelUrl:u&&"walletLocked"===e.model.kind?f(e.model.file):(0,r.LL)(e.model,m),animsUrl:e.anims?u&&"walletLocked"===e.anims.kind?f(e.anims.file):(0,r.LL)(e.anims,m):void 0,bundleBase:d,needsSession:h}}},53868:(e,t,n)=>{"use strict";n.d(t,{A:()=>eP});var r,a,i,l,o,s=n(95155),c=n(12115),u=n(91190),d=n(5208),h=n(86985),m=n(58387),f=n(23540),p=n(6612),g=n(45014);let v="var(--fam-accent, #6ea8ff)",y="fam_cp_layout_v2";function b(){var e,t,n,r,a;let{projectedPath:i,currentChainStep:l,setProjectedPath:o}=(0,u.useAvatar)(),[d,h]=(0,c.useState)(!0),[m,f]=(0,c.useState)(0),[p,g]=(0,c.useState)(null);(0,c.useEffect)(()=>{let e=()=>h(!0);return window.addEventListener("fam_chain_reopen",e),()=>window.removeEventListener("fam_chain_reopen",e)},[]);let b=(0,c.useRef)(null),w=(0,c.useRef)(null),x=(0,c.useRef)(null);(0,c.useEffect)(()=>{w.current=p},[p]),(0,c.useEffect)(()=>{try{let e=localStorage.getItem(y);if(e){let t=JSON.parse(e);t&&"number"==typeof t.right&&"number"==typeof t.top&&"number"==typeof t.width&&g(t)}}catch(e){}},[]);let M=(e,t,n)=>Math.max(t,Math.min(e,Math.max(t,n))),k=(0,c.useCallback)(e=>{var t,n;let r=x.current,a=b.current;if(!r||!a)return;let i=a.offsetParent,l=null!=(t=null==i?void 0:i.clientWidth)?t:window.innerWidth,o=null!=(n=null==i?void 0:i.clientHeight)?n:window.innerHeight;if("move"===r.mode){let t=a.offsetWidth,n=a.offsetHeight,i=M(r.or-(e.clientX-r.sx),4,l-t-4),s=M(r.ot+(e.clientY-r.sy),4,o-n-4);g(e=>{var t;return{right:i,top:s,width:null!=(t=null==e?void 0:e.width)?t:r.ow,height:null==e?void 0:e.he
1ight}})}else{let t=l-r.or-r.ow,n=r.ot,a=M(e.clientX-t,140,480),i=Math.max(110,o-n-8),s=M(e.clientY-n,110,i);g({right:Math.max(4,l-t-a),top:n,width:a,height:s})}},[]),_=(0,c.useCallback)(()=>{window.removeEventListener("pointermove",k);let e=w.current;if(e)try{localStorage.setItem(y,JSON.stringify(e))}catch(e){}x.current=null},[k]),S=e=>t=>{var n,r,a,i,l,o,s,c;t.preventDefault(),t.stopPropagation();let u=b.current;u&&(x.current={mode:e,sx:t.clientX,sy:t.clientY,or:null!=(l=null==(n=w.current)?void 0:n.right)?l:400,ot:null!=(o=null==(r=w.current)?void 0:r.top)?o:64,ow:null!=(s=null==(a=w.current)?void 0:a.width)?s:u.offsetWidth,oh:null!=(c=null==(i=w.current)?void 0:i.height)?c:u.offsetHeight},window.addEventListener("pointermove",k),window.addEventListener("pointerup",_,{once:!0}))},E=null!=(e=null==i?void 0:i.steps)?e:[];if(0===E.length)return null;let R=[{label:"Recommended",steps:E},...null!=(t=null==i?void 0:i.alternates)?t:[]],P=Math.min(m,R.length-1),j=0===P,L=R[P].steps,T=E.length,N=Math.max(0,Math.min(l,T-1)),z=null!=(n=null==p?void 0:p.right)?n:400,I=null!=(r=null==p?void 0:p.top)?r:64,A=null!=(a=null==p?void 0:p.width)?a:199,C=(0,s.jsx)("span",{onPointerDown:S("move"),className:"pointer-events-auto select-none flex-none",style:{cursor:"move",opacity:.5,fontSize:12,lineHeight:1,padding:"0 2px"},title:"Drag to move","aria-label":"Drag to move",children:"â ¿"});return(0,s.jsxs)("div",{ref:b,className:"absolute z-[13] pointer-events-none flex flex-col items-end gap-2",style:{right:z,top:"calc(env(safe-area-inset-top) + ".concat(I,"px)"),width:A},children:[(0,s.jsx)("style",{children:"\n @keyframes cp-glow {\n 0%, 100% { box-shadow: 0 0 4px color-mix(in srgb, ".concat(v," 55%, transparent); opacity: 0.85; }\n 50% { box-shadow: 0 0 11px color-mix(in srgb, ").concat(v," 95%, transparent); opacity: 1; }\n }\n @keyframes cp-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }\n ")}),!d&&(0,s.jsxs)("div",{className:"pointer-events-auto inline-flex items-center gap-2 rounded-full px-3 py-1.5 text-[11.5px] font-semibold",style:{background:"rgba(10,10,16,0.55)",color:v,border:"1px solid color-mix(in srgb, ".concat(v," 22%, transparent)"),backdropFilter:"blur(10px)",boxShadow:"0 4px 22px -10px color-mix(in srgb, ".concat(v," 70%, transparent)"),animation:"cp-fade 0.4s ease-out"},children:[C,(0,s.jsxs)("button",{onClick:()=>h(!0),className:"inline-flex items-center gap-2","aria-label":"Show the projected path",children:[(0,s.jsx)("span",{"aria-hidden":!0,style:{opacity:.9},children:"\uD83E\uDDED"}),(0,s.jsxs)("span",{style:{opacity:.85},children:[T,"-step plan"]}),(0,s.jsx)("span",{className:"flex items-center gap-1 ml-0.5","aria-hidden":!0,children:E.map((e,t)=>(0,s.jsx)("span",{style:{width:5,height:5,borderRadius:9999,background:t<=N?v:"color-mix(in srgb, ".concat(v," 22%, transparent)"),animation:t===N?"cp-glow 1.9s ease-in-out infinite":void 0}},t))}),(0,s.jsxs)("span",{className:"ml-0.5",style:{opacity:.55},children:[N+1,"/",T," â¸"]})]})]}),d&&(0,s.jsxs)("div",{className:"pointer-events-auto relative rounded-2xl p-3 w-full overflow-y-auto overflow-x-hidden",style:{background:"rgba(12,12,20,0.82)",border:"1px solid color-mix(in srgb, ".concat(v," 22%, transparent)"),backdropFilter:"blur(14px)",boxShadow:"0 10px 34px -12px color-mix(in srgb, ".concat(v," 60%, transparent)"),animation:"cp-fade 0.25s ease-out",height:(null==p?void 0:p.height)?p.height:void 0,maxHeight:(null==p?void 0:p.height)?void 0:"calc(100vh - ".concat(I,"px - 24px)")},children:[(0,s.jsx)("span",{onPointerDown:S("move"),className:"absolute top-0 left-0 pointer-events-auto select-none",style:{cursor:"move",opacity:.45,fontSize:12,lineHeight:1,padding:3},title:"Drag to move","aria-label":"Drag to move",children:"â ¿"}),(0,s.jsx)("span",{onPointerDown:S("resize"),className:"absolute bottom-0 right-0 pointer-events-auto select-none",style:{cursor:"nwse-resize",opacity:.4,fontSize:11,lineHeight:1,padding:2},title:"Drag to resize","aria-label":"Resize",children:"â¢"}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-2 pl-5",children:[(0,s.jsx)("span",{"aria-hidden":!0,
1className:"text-[13px] flex-none",children:"\uD83E\uDDED"}),(0,s.jsx)("span",{className:"text-[12px] font-bold tracking-tight truncate flex-1 min-w-0",style:{color:v},children:"The path ahead"}),(0,s.jsx)("button",{onClick:()=>h(!1),className:"flex-none text-[15px] leading-none opacity-55 hover:opacity-100","aria-label":"Collapse",children:"â"}),(0,s.jsx)("button",{onClick:()=>{(null==i?void 0:i.running)?h(!1):o(null)},className:"flex-none text-[14px] leading-none opacity-45 hover:opacity-100","aria-label":(null==i?void 0:i.running)?"Hide â still running, reopen from the pill":"Dismiss",title:(null==i?void 0:i.running)?"Hide â it keeps running; tap the pill to bring it back":"Dismiss",children:"\xd7"})]}),R.length>1&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-2.5",children:R.map((e,t)=>{let n=t===P;return(0,s.jsxs)("button",{onClick:()=>f(t),className:"text-[10.5px] font-semibold rounded-full px-2.5 py-1 transition-all",style:{color:n?"#06070d":v,background:n?v:"color-mix(in srgb, ".concat(v," 9%, transparent)"),border:"1px solid color-mix(in srgb, ".concat(v," ").concat(22*!n,"%, transparent)")},children:[0===t?"â
":"",e.label]},t)})}),(0,s.jsx)("ol",{className:"flex flex-col",children:L.map((e,t)=>
1{let n=e.status,r="completed"===n||j&&!n&&t<N,a="in_progress"===n||j&&!n&&t===N,i="error"===n,l=!r&&!a&&!i,o=t===L.length-1,c=i?"#f87171":v;return(0,s.jsxs)("li",{className:"flex items-stretch gap-2.5",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center flex-none",style:{width:12},children:[(0,s.jsx)("span",{"aria-hidden":!0,style:{width:9,height:9,marginTop:4,borderRadius:9999,background:r||a||i?c:"transparent",border:"1.5px solid ".concat(r||a||i?c:"color-mix(in srgb, ".concat(v," 38%, transparent)")),animation:a?"cp-glow 1.9s ease-in-out infinite":void 0}}),!o&&(0,s.jsx)("span",{style:{flex:1,width:1.5,marginTop:2,marginBottom:2,background:"color-mix(in srgb, ".concat(v," ").concat(r?45:16,"%, transparent)")}})]}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 pb-2.5",children:[(0,s.jsxs)("div",{className:"text-[12.5px] font-semibold leading-snug",style:{color:"#fff",opacity:l?.72:1},children:[r&&(0,s.jsx)("span",{"aria-hidden":!0,style:{color:v,marginRight:4},children:"â"}),e.step,a&&(0,s.jsx)("span",{className:"ml-1.5 text-[10px] font-normal",style:{color:v},children:"runningâ¦"}),!a&&e.time_band&&(0,s.jsx)("span",{className:"ml-1.5 text-[10.5px] font-normal opacity-50",children:e.time_band})]}),e.skill&&(0,s.jsxs)("span",{className:"inline-flex items-center mt-1 rounded px-1.5 py-0.5 text-[9.5px] font-semibold leading-none",style:{color:v,background:"color-mix(in srgb, ".concat(v," 13%, transparent)")},title:"Powered by ".concat(e.skill),children:["via ",e.skill]}),e.equipped&&(0,s.jsx)("span",{className:"inline-flex items-center mt-1 ml-1 rounded px-1.5 py-0.5 text-[9.5px] font-semibold leading-none",style:{color:"#f5a623",background:"color-mix(in srgb, #f5a623 16%, transparent)"},title:"Your Mind just equipped this skill to do it",children:"â¡ just equipped"}),r&&e.result?(0,s.jsxs)("div",{className:"text-[11px] leading-snug opacity-70 mt-0.5",style:{color:"#fff"},children:[e.result.slice(0,90),e.result.length>90?"â¦":""]}):e.outcome&&(0,s.jsx)("div",{className:"text-[11px] leading-snug opacity-55 mt-0.5",style:{color:"#fff"},children:e.outcome}),r&&e.link&&(0,s.jsx)("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"inline-flex items-center gap-1 mt-1 rounded px-2 py-0.5 text-[10.5px] font-semibold leading-none",style:{color:v,background:"color-mix(in srgb, ".concat(v," 14%, transparent)")},children:"â Open result"})]})]},t)})}),(null==i?void 0:i.done)?(0,s.jsx)("div",{className:"mt-1 w-full rounded-xl px-3 py-2 text-[12px] font-bold text-center",style:{background:"color-mix(in srgb, ".concat(v," 14%, transparent)"),color:v},children:"â Path complete"}):(null==i?void 0:i.manual)?(0,s.jsx)("div",{className:"mt-1 w-full rounded-xl px-3 py-2 text-[12px] font-semibold text-center",style:{background:"color-mix(in srgb, ".concat(v," 10%, transparent)"),color:v},children:"In progress"}):(null==i?void 0:i.running)?(0,s.jsx)("div",{className:"mt-1 w-full rounded-xl px-3 py-2 text-[12px] font-semibold text-center",style:{background:"color-mix(in srgb, ".concat(v," 10%, transparent)"),color:v},children:"Running the planâ¦"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>{var e,t,n=j?"Let's go with the recommended plan. Start with: \"".concat(null!=(t=null==(e=L[0])?void 0:e.step)?t:"",'".'):"Let's go with the \"".concat(R[P].label,'" direction. Plan: ').concat(L.map(e=>e.step).join(" â "),". Start with the first step.");try{window.dispatchEvent(new CustomEvent("fam_card_action",{detail:{prompt:n}}))}catch(e){}},className:"mt-1 w-full rounded-xl px-3 py-2 text-[12px] font-bold transition-all hover:brightness-110",style:{background:v,color:"#06070d",boxShadow:"0 0 18px -6px ".concat(v)},children:j?"Go with this plan â":"Go with â".concat(R[P].label,"â â")}),(0,s.jsx)("div",{className:"mt-2 pr-4 text-[10px] opacity-40",style:{color:"#fff"},children:R.length>1?"Tap a direction to see its full path. Choosing one kicks it off.":"Recommended path â nothing runs until you choose it."})]})]})]})}let w={rain:80,snow:60,sun:0,storm:120,fog:12,cloudy:22};function x(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];e.phase=Math.random()*Math.PI*2,"rain"===t||"storm"===t?(e.x=Math.random()*(n+100)-50,e.y=a?Math.random()*r:-10,e.vx="storm"===t?3:1.5,e.vy="storm"===t?20+10*Math.random():10+8*Math.random(),e.size=.8+.8*Math.random(),e.opacity=.5+.4*Math.random()):"snow"===t?(e.x=Math.random()*n,e.y=a?Math.random()*r:-10,e.vx=(Math.random()-.5)*.3,e.vy=.8+1.5*Math.random(),e.size=1.5+2.5*Math.random(),e.opacity=.6+.4*Math.random()):"sun"===t?(e.x=Math.random()*n,e.y=a?Math.random()*r:r+10,e.vx=(Math.random()-.5)*.4,e.vy=-(.4+.6*Math.random()),e.size=1.5+2.5*Math.random(),e.opacity=.4+.5*Math.random()):("fog"===t||"cloudy"===t)&&(e.x=a?Math.random()*n:Math.random()>.5?-100:n+100,e.y="cloudy"===t?Math.random()*r*.33:Math.random()*r,e.vx=("cloudy"===t?.2:.15)*(Math.random()>.5?1:-1),e.vy=(Math.random()-.5)*.04,e.size="cloudy"===t?90+90*Math.random():55+65*Math.random(),e.opacity="cloudy"===t?.22+.18*Math.random():.07+.07*Math.random())}function M(e){let{weather:t,durationMs:n=45e3,onDone:r}=e,a=(0,c.useRef)(null),i=(0,c.useRef)(null),l=(0,c.useRef)(r);return((0,c.useEffect)(()=>{l.current=r},[r]),(0,c.useEffect)(()=>
1{if(!t)return;let e=a.current;if(!e)return;let r=e.getContext("2d");if(!r)return;let o=()=>{e.width=e.offsetWidth,e.height=e.offsetHeight};o();let s=new ResizeObserver(o);s.observe(e);let c=()=>e.width,u=()=>e.height,d=Array.from({length:w[t]},()=>{let e={x:0,y:0,vx:0,vy:0,size:0,opacity:0,phase:0};return x(e,t,c(),u(),!0),e}),h=-1,m=0,f=4e3+4e3*Math.random(),p=e=>{h<0&&(h=e,m=e);let a=e-h,o=Math.min(e-m,50);if(m=e,a>=n){var s;r.clearRect(0,0,c(),u()),null==(s=l.current)||s.call(l);return}let g=1;if(a<2e3?g=a/2e3:a>n-5e3&&(g=(n-a)/5e3),g=Math.max(0,Math.min(1,g)),r.clearRect(0,0,c(),u()),"storm"===t&&(f-=o)<=0&&(r.fillStyle="rgba(255,255,255,".concat(.35*g,")"),r.fillRect(0,0,c(),u()),f=4e3+6e3*Math.random()),"cloudy"===t){let e=.33*u(),t=r.createLinearGradient(0,0,0,e);t.addColorStop(0,"rgba(200,210,225,".concat(.38*g,")")),t.addColorStop(.6,"rgba(190,200,215,".concat(.22*g,")")),t.addColorStop(1,"rgba(180,190,205,0)"),r.fillStyle=t,r.fillRect(0,0,c(),e)}if("sun"===t){let e=.5*c(),t=.06*u(),n=18e-5*a,i=1+.06*Math.sin(8e-4*a);r.save();let l=r.createRadialGradient(e,t,0,e,t,160*i);l.addColorStop(0,"rgba(255,210,60,".concat(.1*g,")")),l.addColorStop(.5,"rgba(255,180,30,".concat(.05*g,")")),l.addColorStop(1,"rgba(255,160,0,0)"),r.beginPath(),r.arc(e,t,160*i,0,2*Math.PI),r.fillStyle=l,r.fill();let o=80*i;for(let a=0;a<14;a++){let i=n+2*Math.PI/14*a,l=e+30*Math.cos(i-.07),s=t+30*Math.sin(i-.07),c=e+30*Math.cos(i+.07),u=t+30*Math.sin(i+.07),d=e+Math.cos(i)*o,h=t+Math.sin(i)*o,m=r.createLinearGradient(e+30*Math.cos(i),t+30*Math.sin(i),d,h);m.addColorStop(0,"rgba(255,235,100,".concat(.85*g,")")),m.addColorStop(1,"rgba(255,200,40,0)"),r.beginPath(),r.moveTo(l,s),r.lineTo(d,h),r.lineTo(c,u),r.closePath(),r.fillStyle=m,r.fill()}let s=r.createRadialGradient(e,t,0,e,t,50);s.addColorStop(0,"rgba(255,250,160,".concat(.6*g,")")),s.addColorStop(.6,"rgba(255,220,60,".concat(.3*g,")")),s.addColorStop(1,"rgba(255,180,20,0)"),r.beginPath(),r.arc(e,t,50,0,2*Math.PI),r.fillStyle=s,r.fill();let d=r.createRadialGradient(e-7,t-7,2,e,t,28);d.addColorStop(0,"rgba(255,255,230,".concat(g,")")),d.addColorStop(.5,"rgba(255,225,70,".concat(g,")")),d.addColorStop(1,"rgba(245,165,20,".concat(.9*g,")")),r.beginPath(),r.arc(e,t,28,0,2*Math.PI),r.fillStyle=d,r.fill(),r.restore()}for(let e of d){let n=c(),i=u();if("snow"===t?e.x+=e.vx+.35*Math.sin(.001*a+e.phase):e.x+=e.vx,e.y+=e.vy,"rain"===t||"storm"===t)(e.y>i+20||e.x>n+50)&&x(e,t,n,i);else if("snow"===t)e.y>i+e.size&&x(e,t,n,i),e.x<-e.size&&(e.x=n+e.size),e.x>n+e.size&&(e.x=-e.size);else if("sun"===t)e.y<-e.size&&x(e,t,n,i);else if("cloudy"===t){let t=.33*i;e.x>n+e.size&&(e.x=-e.size),e.x<-e.size&&(e.x=n+e.size),e.y>t+e.size&&(e.y=-e.size),e.y<-e.size&&(e.y=t+e.size)}else"fog"===t&&(e.x>n+e.size&&(e.x=-e.size),e.x<-e.size&&(e.x=n+e.size),e.y>i+e.size&&(e.y=-e.size),e.y<-e.size&&(e.y=i+e.size));let l=g*e.opacity;if("rain"===t||"storm"===t){r.beginPath(),r.moveTo(e.x,e.y);let n=Math.min(3*e.vy,18);r.lineTo(e.x+2*e.vx,e.y+n),r.strokeStyle="storm"===t?"rgba(140,190,255,".concat(l,")"):"rgba(175,215,255,".concat(l,")"),r.lineWidth=e.size,r.stroke()}else if("snow"===t)r.beginPath(),r.arc(e.x,e.y,e.size,0,2*Math.PI),r.fillStyle="rgba(255,255,255,".concat(l,")"),r.fill();else if("sun"===t)r.beginPath(),r.arc(e.x,e.y,e.size,0,2*Math.PI),r.fillStyle="rgba(255,235,80,".concat(l,")"),r.fill();else if("fog"===t||"cloudy"===t){let n=r.createRadialGradient(e.x,e.y,0,e.x,e.y,e.size);"cloudy"===t?(n.addColorStop(0,"rgba(235,238,245,".concat(l,")")),n.addColorStop(1,"rgba(235,238,245,0)")):(n.addColorStop(0,"rgba(220,232,248,".concat(l,")")),n.addColorStop(1,"rgba(220,232,248,0)")),r.beginPath(),r.arc(e.x,e.y,e.size,0,2*Math.PI),r.fillStyle=n,r.fill()}}i.current=requestAnimationFrame(p)};return i.current=requestAnimationFrame(p),()=>{null!==i.current&&cancelAnimationFrame(i.current),s.disconnect(),r.clearRect(0,0,c(),u())}},[t,n]),t)?(0,s.jsx)("canvas",{ref:a,style:{position:"absolute",inset:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:2}}):null}var k=n(34533),_=n(71289),S=n(30206),E=n(45171),R=n(6011);let P="https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@".concat("0.10.35","/wasm"),j="undefined"!=typeof navigator&&/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),L=j?"https://storage.googleapis.com/mediapipe-models/object_detector/efficientdet_lite0/float32/1/efficientdet_lite0.tflite":"https://storage.googleapis.com/mediapipe-models/object_detector/efficientdet_lite2/float32/1/efficientdet_lite2.tflite",T=null,N=null;async function z(){return T||N||(N=(async()=>{let e=await R.Ps.forVisionTasks(P);return T=await R.uG.createFromOptions(e,{baseOptions:{modelAssetPath:L,delegate:j?"CPU":"GPU"},scoreThreshold:.45,maxResults:12,runningMode:"IMAGE"})})())}async function I(e){if(e.readyState<2||0===e.videoWidth)return[];try{let n=(await z()).detect(e),r=new Set;for(let e of n.detections){var t;let n=null==(t=e.categories[0])?void 0:t.categoryName;n&&r.add(n)}return Array.from(r)}catch(e){return console.warn("[ObjectDetection] detect error:",e),[]}}function A(e,t){return e?125:t?2500:1500}let C=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(n,Math.max(t,e))},U=180/Math.PI;function D(e){let t=(t,n)=>(e(t)+e(n))/2,n=t("mouthSmileLeft","mouthSmileRight"),r=t("mouthFrownLeft","mouthFrownRight"),a=t("browDownLeft","browDownRight"),i=t("browOuterUpLeft","browOuterUpRight"),l=e("browInnerUp"),o=e("jawOpen"),s=t("eyeWideLeft","eyeWideRight"),c=t("eyeBlinkLeft","eyeBlinkRight");return o>.4&&(s>.4||i>.5)?{expression:"surprised",confidence:Math.max(o,s,i)}:n>.45?{expression:"smiling",confidence:n}:r>.25||l>.5&&n<.15?{expression:"frowning",confidence:Math.max(r,l)}:a>.4&&n<.15?{expression:"concentrating",confidence:a}:c>.6?{expression:"eyes_closed",confidence:c}:null}let F=e=>{if(0===e.length)return 0;let t=[...e].sort((e,t)=>
1e-t),n=t.length>>1;return t.length%2?t[n]:(t[n-1]+t[n])/2};function B(e,t){if(0===e.length)return[];let n=[e[0]],r=e[0],a=0;for(let i=1;i<e.length;i++){let l=e[i];if(0===a){Math.abs(l.v-n[0].v)>=t?(a=Math.sign(l.v-n[0].v),r=l):Math.abs(l.v-n[0].v)>Math.abs(r.v-n[0].v)&&(r=l);continue}if((l.v-r.v)*a>0){r=l;continue}Math.abs(l.v-r.v)>=t&&(n.push(r),a=-a,r=l)}0!==a&&n.push(r);let i=e[e.length-1];return n[n.length-1]!==i&&n.push(i),n}let W=(e,t)=>C(.5+.5*(e-t)/t,.5,1),O=e=>Math.round(1e3*e)/1e3,G=["mouthSmile","mouthFrown","browDown","browInnerUp","eyeWide","jawOpen","cheekSquint","gazeH","gazeV"];class H{static emptyBaseline(){let e={};for(let t of[...G,"yaw","pitch"])e[t]=[];return e}push(e){var t,n;let r=e.timeMs,a=e.blendshapes;if(!e.present||!a)return this.head=[],this.ema=null,this.lastT=r,this.state={...this.state,presence:!1,expression:null,confidence:0,smile:0,valence:0,attention:0},{state:this.state,events:[]};let i=e=>{var t;return null!=(t=a[e])?t:0},l=(e,t)=>(i(e)+i(t))/2,o={mouthSmile:l("mouthSmileLeft","mouthSmileRight"),mouthFrown:l("mouthFrownLeft","mouthFrownRight"),browDown:l("browDownLeft","browDownRight"),browInnerUp:i("browInnerUp"),eyeWide:l("eyeWideLeft","eyeWideRight"),jawOpen:i("jawOpen"),cheekSquint:l("cheekSquintLeft","cheekSquintRight"),gazeH:Math.max(l("eyeLookOutLeft","eyeLookInRight"),l("eyeLookInLeft","eyeLookOutRight")),gazeV:Math.max(l("eyeLookUpLeft","eyeLookUpRight"),l("eyeLookDownLeft","eyeLookDownRight")),yaw:0,pitch:0},s=e.matrix&&e.matrix.length>=16?function(e){let t=(t,n)=>e[4*n+t],n=e=>{let n=Math.hypot(t(0,e),t(1,e),t(2,e))||1;return[t(0,e)/n,t(1,e)/n,t(2,e)/n]},r=n(0),a=n(1),i=n(2),l=i[0],o=i[1],s=i[2],c=r[1],u=a[1];return{yawDeg:Math.atan2(l,s)*U,pitchDeg:Math.asin(C(-o,-1,1))*U,rollDeg:Math.atan2(c,u)*U}}(e.matrix):null;if(s&&(o.yaw=s.yawDeg,o.pitch=s.pitchDeg),!this.baseline){for(let e of(null===this.baselineStart&&(this.baselineStart=r),Object.keys(o)))this.baselineFrames[e].push(o[e]);if(r-this.baselineStart>=3e3&&this.baselineFrames.mouthSmile.length>=10){let e={};for(let t of Object.keys(this.baselineFrames))e[t]=F(this.baselineFrames[t]);this.baseline=e,this.baselineFrames=H.emptyBaseline()}}let c=this.baseline,u=e=>c?c[e]:0,d=e=>C((o[e]-u(e))/Math.max(.001,1-u(e))),h=d("mouthSmile");h=C(h+.15*d("cheekSquint")*h);let m=C(.6*d("mouthFrown")+.4*d("browDown")),f=C(h-m,-1,1),p=1-C(Math.max(s?Math.max(Math.abs(o.yaw-u("yaw"))/35,Math.abs(o.pitch-u("pitch"))/25):0,Math.max(o.gazeH-u("gazeH"),o.gazeV-u("gazeV"))/.5));if(this.ema&&null!==this.lastT){let e=1-Math.exp(-Math.max(0,r-this.lastT)/250);this.ema={smile:this.ema.smile+e*(h-this.ema.smile),valence:this.ema.valence+e*(f-this.ema.valence),attention:this.ema.attention+e*(p-this.ema.attention)}}else this.ema={smile:h,valence:f,attention:p};this.lastT=r;let g=D(i);this.state={presence:!0,expression:null!=(t=null==g?void 0:g.expression)?t:null,confidence:null!=(n=null==g?void 0:g.confidence)?n:0,smile:this.ema.smile,valence:this.ema.valence,attention:this.ema.attention,baselineReady:!!c};let v=[];if(s){this.head.push({t:r,yaw:o.yaw,pitch:o.pitch});let e=r-1500;for(;this.head.length&&this.head[0].t<e;)this.head.shift();let t=this.detectHead(r);t&&v.push(t)}return{state:this.state,events:v}}recent(e,t,n){var r;let a=Math.max(e-t,(null!=(r=this.lastFired[n])?r:-1/0)+1500);return this.head.filter(e=>e.t>=a)}canFire(e,t){let n=this.lastFired[e];return void 0===n||t-n>=1500}detectHead(e){if(this.canFire("nod",e)){let t=this.recent(e,1200,"nod"),n=B(t.map(e=>({t:e.t,v:e.pitch})),3);for(let r=1;r+1<n.length;r++){let a=Math.min(Math.abs(n[r].v-n[r-1].v),Math.abs(n[r+1].v-n[r].v));if(a<8)continue;let i=t.filter(e=>e.t>=n[r-1].t&&e.t<=n[r+1].t).map(e=>e.yaw);if(!(Math.max(...i)-Math.min(...i)>Math.max(6,a/2)))return this.fire("nod",W(a,8),e)}}if(this.canFire("shake",e)){let t=this.recent(e,1500,"shake"),n=B(t.map(e=>({t:e.t,v:e.yaw})),3);for(let r=1;r+2<n.length;r++){let a=Math.abs(n[r].v-n[r-1].v),i=Math.abs(n[r+1].v-n[r].v),l=Math.abs(n[r+2].v-n[r+1].v);if(i<10||a<5||l<5)continue;let o=t.filter(e=>e.t>=n[r-1].t&&e.t<=n[r+2].t).map(e=>e.pitch);if(!(Math.max(...o)-Math.min(...o)>Math.max(6,i/2)))return this.fire("shake",W(i,10),e)}}return null}fire(e,t,n){return this.lastFired[e]=n,this.head=this.head.slice(-1),{event:e,confidence:O(t),timeMs:n}}constructor(){this.baselineFrames=H.emptyBaseline(),this.baselineStart=null,this.baseline=null,this.head=[],this.lastFired={},this.ema=null,this.lastT=null,this.state={presence:!1,expression:null,confidence:0,smile:0,valence:0,attention:0,baselineReady:!1}}}
1class V{shouldSend(e,t){let n=this.last;return(!!(!n||n.presence!==e.presence||n.expression!==e.expression||Math.abs(n.smile-e.smile)>=.2||Math.abs(n.valence-e.valence)>=.2||Math.abs(n.attention-e.attention)>=.2)||!(t-this.lastAt<2e3))&&(this.last={...e},this.lastAt=t,!0)}constructor(){this.last=null,this.lastAt=-1/0}}class X{push(e,t,n){if(e!==this.current&&(this.current=e,this.reads=0,this.firedThisHold=!1),!e)return null;this.reads++;let r="Thumb_Up"===e?"thumbs_up":"Thumb_Down"===e?"thumbs_down":"Open_Palm"===e?"wave":null;if(!r||this.firedThisHold||"wave"===r&&this.reads<2)return null;let a=this.lastFired[r];return void 0!==a&&n-a<1500?null:(this.lastFired[r]=n,this.firedThisHold=!0,{event:r,confidence:O(C(t)),timeMs:n})}constructor(){this.current=null,this.reads=0,this.firedThisHold=!1,this.lastFired={}}}let Y="undefined"!=typeof navigator&&/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),$=new Map;async function q(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=$.get(e);return t||(t=(async()=>{let t=await R.Ps.forVisionTasks(P);return R.pR.createFromOptions(t,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",delegate:Y?"CPU":"GPU"},outputFaceBlendshapes:!0,...e?{outputFacialTransformationMatrixes:!0}:{},runningMode:"VIDEO",numFaces:1})})(),$.set(e,t)),t}async function Z(e,t){if(e.readyState<2||0===e.videoWidth)return null;try{var n,r;let a=null==(r=(await q()).detectForVideo(e,t).faceBlendshapes)||null==(n=r[0])?void 0:n.categories;if(!a||0===a.length)return null;let i=new Map;for(let e of a)e.categoryName&&i.set(e.categoryName,e.score);return D(e=>{var t;return null!=(t=i.get(e))?t:0})}catch(e){return console.warn("[FaceExpression] detect error:",e),null}}async function J(e,t){if(e.readyState<2||0===e.videoWidth)return null;try{var n,r,a,i;let l=(await q(!0)).detectForVideo(e,t),o=null==(r=l.faceBlendshapes)||null==(n=r[0])?void 0:n.categories;if(!o||0===o.length)return{present:!1,blendshapes:null,matrix:null};let s={};for(let e of o)e.categoryName&&(s[e.categoryName]=e.score);let c=null==(i=l.facialTransformationMatrixes)||null==(a=i[0])?void 0:a.data;return{present:!0,blendshapes:s,matrix:c&&c.length>=16?Array.from(c):null}}catch(e){return console.warn("[FaceExpression] detect error:",e),null}}var K=n(32003),Q=n(32344);let ee="undefined"!=typeof navigator&&/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),et=null,en=null;async function er(){return et||en||(en=(async()=>{let e=await R.Ps.forVisionTasks(P);return et=await R.S$.createFromOptions(e,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/gesture_recognizer/gesture_recognizer/float16/1/gesture_recognizer.task",delegate:ee?"CPU":"GPU"},runningMode:"VIDEO",numHands:1})})())}async function ea(e,t){if(e.readyState<2||0===e.videoWidth)return null;try{var n,r;let a=null==(r=(await er()).recognizeForVideo(e,t).gestures)||null==(n=r[0])?void 0:n[0];if(!a||!a.categoryName||"None"===a.categoryName||a.score<.5)return null;return{gesture:a.categoryName,confidence:a.score}}catch(e){return console.warn("[GestureDetection] detect error:",e),null}}let ei="undefined"!=typeof navigator&&/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),el=null,eo=null;async function es(){return el||eo||(eo=(async()=>{let e=await R.Ps.forVisionTasks(P);return el=await R.Pi.createFromOptions(e,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/pose_landmarker/pose_landmarker_lite/float16/1/pose_landmarker_lite.task",delegate:ei?"CPU":"GPU"},runningMode:"VIDEO",numPoses:1})})())}async function ec(e,t){if(e.readyState<2||0===e.videoWidth)return null;try{var n;let r=null==(n=(await es()).detectForVideo(e,t).landmarks)?void 0:n[0];if(!r||r.length<17)return null;let a=e=>{var t,n;return null!=(n=null==(t=r[e])?void 0:t.visibility)?n:0},i=e=>a(e)>.5,l=r[0],o=Math.min(r[11].y,r[12].y),s=(e,t)=>{let n=r[e],a=r[t];return Math.hypot(n.x-a.x,n.y-a.y)};if(i(15)&&i(0)&&.15>s(15,0)||i(16)&&i(0)&&.15>s(16,0))return{posture:"hand_near_face",confidence:Math.min(a(0),Math.max(a(15),a(16)))};if(i(15)&&i(16)&&l&&r[15].y<o&&r[16].y<o)return{posture:"hands_raised",confidence:Math.min(a(15),a(16))};return null}catch(e){return console.warn("[PoseDetection] detect error:",e),null}}let eu="undefined"!=typeof navigator&&/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),ed=null,eh=null;async function em(){return ed||eh||(eh=(async()=>{let e=await R.Ps.forVisionTasks(P);return ed=await R.DU.createFromOptions(e,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/image_classifier/efficientnet_lite0/float32/1/efficientnet_lite0.tflite",delegate:eu?"CPU":"GPU"},maxResults:1,runningMode:"IMAGE"})})())}async function ef(e){if(e.readyState<2||0===e.videoWidth)return null;try{var t,n,r;let a=null==(r=(await em()).classify(e).classifications)||null==(n=r[0])||null==(t=n.categories)?void 0:t[0];if(!a||!a.categoryName||a.score<.35)return null;return{scene:a.categoryName,confidence:a.score}}catch(e){return console.warn("[SceneClassification] classify error:",e),null}}var ep=n(67731),eg=n(95704);let ev=ep.oi,ey="/unity-build/web".replace(/\/$/,""),eb=(0,ep.xy)(null!=(i=null!=(a=null!=(r=eg.env.NEXT_PUBLIC_UNITY_SHELL_DESKTOP_BUILD_VER)?r:"20260902a-thinkfreeze")?a:"20260902a-thinkfreeze")?i:ep.zg),ew=(0,ep.xy)(null!=(o=null!=(l=eg.env.NEXT_PUBLIC_UNITY_SHELL_MOBILE_BUILD_VER)?l:"20260902a-thinkfreeze")?o:ep.zg),ex=new Set(["bayc","businesslady","capguy","fia","moca","nike","abby"]);function eM(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6?arguments[6]:void 0;try{let o=new URL(e,window.location.href);return t&&o.searchParams.set("initialAvatar",t),o.searchParams.set("unityBuildRev",n),l&&o.searchParams.set("bundleBaseUrl",l),r&&o.searchParams.set("env",r),a&&o.searchParams.set("liveFrame","1"),i&&(o.searchParams.set("disableUnityCache","1"),o.searchParams.set("cacheBust",String(Date.now()))),o.toString()}catch(u){let l=e.includes("?")?"&":"?",o=r?"&env=".concat(encodeURIComponent(r)):"",s=i?"&disableUnityCache=1&cacheBust=".concat(Date.now()):"",c=t?"initialAvatar=".concat(encodeURIComponent(t),"&"):"";return"".concat(e).concat(l).concat(c,"unityBuildRev=").concat(encodeURIComponent(n)).concat(o).concat(a?"&liveFrame=1":"").concat(s)}}function ek(e){return/\/(?:web|index|web\.html|index\.html|extension\.html)(?:[?#].*)?$/i.test(e)}function e_(e){let t=/^(?:ape|bayc)(\d+)$/i.exec((null!=e?e:"").trim());return t?Number(t[1]):null}function eS(e){try{let t=new URL(e,window.location.href);return t.search="",t.hash="",t.pathname=t.pathname.replace(/\/(?:web|web\.html|index\.html|extension\.html)$/i,""),t.toString().replace(/\/$/,"")}catch(e){return null}}function eE(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={event:e,detail:t,ts:Date.now()};try{console.info("[UnityTelemetry]",e,t),window.dispatchEvent(new CustomEvent("fam_unity_telemetry",{detail:n}))}catch(e){}}function eR(e){let t=(0,k.Sp)();return t&&ex.has(t)?t:ex.has(e)?e:"bayc"}function eP(){let{backgroundOverride:e,unityEnvironmentOverride:t=null,unityBaseOverride:n,liveFrame:r=!1,disableBackgroun
1dMedia:a=!1,onUnityStatus:i,showLoadingOverlay:l=!1,hideCardOverlay:o=!1,hidePathPreview:v=!1,paused:y=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{state:w,currentGesture:x,cardData:R,setCardData:P,arMode:j,setArMode:L,avatarName:T,setAnimationDuration:N,voiceClientRef:C,imageCaptureTrigger:U,setImageCaptureTrigger:D}=(0,u.useAvatar)(),{jwt:F}=(0,d.A)(),B=(0,c.useRef)(F);B.current=F;let[W,G]=(0,c.useState)(!1);(0,c.useEffect)(()=>G(!0),[]);let Y=m.S3&&W&&(0,m.NT)(T),$=(0,c.useRef)(null),ee=(0,c.useRef)(null),et=(0,c.useRef)(null),en=(0,c.useRef)(!1),ei=(0,c.useRef)(null),el=(0,c.useRef)(null),eo=(0,c.useRef)(null),eu=(0,c.useRef)(null),ed=(0,c.useRef)(null),eh=(0,c.useRef)(null),eg=(0,c.useRef)(null),ex=(0,c.useRef)(T);ex.current=T;let eP=(0,c.useRef)(null),ej=(0,c.useRef)(null),[eL,eT]=(0,c.useState)(null),[eN,ez]=(0,c.useState)(!1),eI=(0,c.useRef)(null);(0,c.useEffect)(()=>{let e=e=>{let t=e.detail;(null==t?void 0:t.type)&&(eI.current&&(clearTimeout(eI.current),eI.current=null),ez(!1),eT(t.type))};return window.addEventListener("fam_weather",e),()=>window.removeEventListener("fam_weather",e)},[]),(0,c.useEffect)(()=>()=>{eI.current&&clearTimeout(eI.current)},[]);let eA=(null==R?void 0:R.card_type)==="weather";(0,c.useEffect)(()=>{eA||!eL||eI.current||(ez(!0),eI.current=setTimeout(()=>{eT(null),ez(!1),eI.current=null},750))},[eA,eL]);let eC=(0,c.useRef)(null),[eU,eD]=(0,c.useState)(()=>(0,E.im)((0,k.Pm)())),[eF,eB]=(0,c.useState)(!1),[eW,eO]=(0,c.useState)(!1),eG=(0,c.useRef)(j);eG.current=j;let[eH,eV]=(0,c.useState)(()=>{if(window.innerWidth<768)return{right:16,bottom:76};if("new"===document.documentElement.dataset.ui){let e=window.innerWidth/2+window.innerHeight*Q.EA/2;return{right:Math.max(16,Math.round(window.innerWidth-e+12)),bottom:76}}return{right:380,bottom:76}}),eX=(0,c.useRef)(null),[eY,e$]=(0,c.useState)(void 0),eq=(0,c.useRef)(void 0),[eZ,eJ]=(0,c.useState)(!1),[eK,eQ]=(0,c.useState)(!1),e0=(0,c.useRef)(!1),e1=(0,c.useRef)(!1),e2=(0,c.useRef)(null),e5=(0,c.useRef)(0),e4=(0,c.useRef)(!1),e3=(0,c.useRef)(!1),e6=(0,c.useRef)(i);e6.current=i;let e8=()=>{e2.current&&(clearTimeout(e2.current),e2.current=null)},e9=()=>{if(!eq.current||e4.current||e3.current)return;e5.current=Date.now(),e8();let e=()=>{var t;if(e4.current||e3.current){e2.current=null;return}let n=Date.now()-e5.current;if(n<3e4){e2.current=setTimeout(e,3e4-n);return}e2.current=null,e3.current=!0,eB(!0),null==(t=e6.current)||t.call(e6,"unity-error",{reason:"unity_boot_stalled",src:eq.current})};e2.current=setTimeout(e,3e4)};(0,c.useEffect)(()=>{eq.current=eY},[eY]),(0,c.useEffect)(()=>{if(Y||m.S3&&!W)return;let e=n||ey,a=n=>{var a;if(e1.current&&eq.current)return;e1.current=!0,(0,S.Gy)("unity_iframe_load_start"),(0,S.Au)({avatar:n});let l=null!=t?t:(0,k.Tk)(window.location.pathname),o=(0,f.VX)(),s=null!=(a=null==o?void 0:o.base)?a:null;$.current=s,ee.current=o?{base:o.base,apes:o.apes}:null;let c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ey,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5?arguments[5]:void 0,l=t.trim(),o="undefined"!=typeof navigator&&/iPhone|iPad|iPod|Android|Mobile/i.test(navigator.userAgent),s=o?ek(l)?ep.VG:l||ep.VG:l||ev,c=o?ew:eb;return ek(s)?eM(s,e,c,n,r,a,i):eM("".concat(s.replace(/\/$/,""),"/").concat(o?"unity-build-mobile/web.html":"unity-build/web.html","?v=").concat(c),e,c,n,r,a,i)}(n,e,l,r,function(){let e=new URLSearchParams(window.location.search);return"1"===e.get("disableUnityCache")||"true"===e.get("disableUnityCache")}(),s);eq.current=c,e$(c),eJ(!0),eE("unity_iframe_load_start",{src:c,initialAvatar:n}),null==i||i("iframe-loading",{src:c,initialAvatar:n})};et.current=()=>{e1.current=!1,eq.current=void 0,e4.current=!1,eQ(!1),e3.current=!1,eB(!1),eg.current=null,eh.current=null,e8(),a(ex.current)};let l=ex.current;if(!(l&&/^(?:ape|bayc)\d*$/i.test(l.trim()))||(0,f.VX)())return void a(l);let o=!1,s=()=>{o||(o=!0,a(ex.current))},c=setTimeout(s,4e3),u=null,d=()=>{let e=B.current;e&&e!==u&&(u=e,(0,f.TL)(e,ep.$G).then(e=>{e&&(clearTimeout(c),s())}))};d();let h=setInterval(()=>{if(o)return void clearInterval(h);d()},100);return()=>{clearTimeout(c),clearInterval(h)}},[n,t,r,i,Y,W]),(0,c.useEffect)(()=>
1{if(Y||!F)return;let e=!1,t=async()=>{var t,n,r,a,i;let l=await (0,f.TL)(F,ep.$G);if(e||!l)return;l.base!==$.current&&($.current=l.base,null==(a=ei.current)||null==(r=a.contentWindow)||r.postMessage({type:"setBundleBaseUrl",url:l.base},"*"));let o=e_(ex.current);null!==o&&!(null!=(i=null==(t=ee.current)?void 0:t.apes.includes(o))&&i)&&l.apes.includes(o)&&(null==(n=et.current)||n.call(et))};t();let n=()=>void t();return window.addEventListener(f.Td,n),()=>{e=!0,window.removeEventListener(f.Td,n)}},[F,Y]),(0,c.useEffect)(()=>{var e,t;if(Y)return;let n=e_(T);if(null===n||!eq.current||(null==(e=ee.current)?void 0:e.apes.includes(n)))return;let r=(0,f.VX)();(null==r?void 0:r.apes.includes(n))&&(null==(t=et.current)||t.call(et))},[T,Y]),(0,c.useEffect)(()=>{!Y&&eY&&function(e){if("undefined"==typeof document)return;let t=eS(e);if(!t)return;let n=new URL(e,window.location.href);if("1"===n.searchParams.get("disableUnityCache"))return;let r=n.searchParams.get("unityBuildRev")||eb;!function(e,t,n){let r;try{r=new URL(e,window.location.href)}catch(e){return}if(r.origin!==window.location.origin||Array.from(document.head.querySelectorAll("link[data-fam-unity-prefetch]")).some(e=>e.href===r.href))return;let a=document.createElement("link");a.rel=t,n&&(a.as=n),a.href=r.href,a.setAttribute("data-fam-unity-prefetch","true"),document.head.appendChild(a)}("".concat(t,"/Build/unity_build.loader.js?v=").concat(encodeURIComponent(r)),"preload","script")}(eY)},[eY,Y]),(0,c.useEffect)(()=>{if(!Y&&eY&&!e4.current&&!e3.current)return e9(),()=>{e8()}},[eY,Y]),(0,c.useEffect)(()=>{if(Y)return;let e=()=>{var e,t;e0.current=!0,null==(t=ei.current)||null==(e=t.contentWindow)||e.postMessage({type:"unityStart"},"*")};return window.addEventListener("pointerdown",e,{once:!0,passive:!0}),window.addEventListener("touchstart",e,{once:!0,passive:!0}),window.addEventListener("keydown",e,{once:!0}),()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("touchstart",e),window.removeEventListener("keydown",e)}},[Y]),(0,c.useEffect)(()=>{if(eo.current&&(eo.current.getTracks().forEach(e=>e.stop()),eo.current=null),j){var e;((null==(e=navigator.mediaDevices)?void 0:e.getUserMedia)?navigator.mediaDevices.getUserMedia({video:{facingMode:"user"},audio:!1}):Promise.reject(Error("getUserMedia not available"))).then(e=>{eo.current=e,el.current&&(el.current.srcObject=e,el.current.play())}).catch(e=>{console.warn("[PiP] camera access denied:",e),L(!1),eO(!0),setTimeout(()=>eO(!1),4e3)})}else el.current&&(el.current.srcObject=null)},[j,L]),(0,c.useEffect)(()=>{if(!U)return;if(!j)return void D(null);let e=el.current,t=C.current;e&&t&&(async()=>{let n=((e,t,n,r)=>{eP.current||(eP.current=document.createElement("canvas"));let a=eP.current;a.width=t,a.height=n;let i=a.getContext("2d");return!i||e.readyState<2?null:(i.drawImage(e,0,0,t,n),a.toDataURL("image/jpeg",r/100).replace(/^data:image\/jpeg;base64,/,""))})(e,640,480,75);n&&eG.current&&t.sendImageCapture(n,"front"),D(null)})()},[U,j]);let e7="undefined"!=typeof navigator&&/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);return(0,c.useEffect)(()=>{if(ej.current&&(clearInterval(ej.current),ej.current=null),!j)return;e7||z().catch(()=>{});let e=setTimeout(()=>{ej.current=setInterval(async()=>{let e=el.current,t=C.current;if(!e||!t)return;let n=await I(e);n.length>0&&(console.log("[ObjectDetection] detected:",n.join(", ")),t.sendEnvironmentObjects(n))},5e3)},1e4*!!e7);return()=>{clearTimeout(e),ej.current&&(clearInterval(ej.current),ej.current=null)}},[j]),(0,c.useEffect)(()=>{if(!j)return;let e=[],t="",n="",r="",a="",i=0,l=()=>{let e=el.current,t=C.current;return e&&t&&e.readyState>=2?{video:e,client:t}:null},o=K.G&&(0,K.l)(),s=o?new X:null,c=setTimeout(()=>{if(e7||function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];q(e).catch(()=>{})}(o),o){let t=new H,n=new V,r=!1,a=0,i=0,o=performance.now();e.push(setInterval(async()=>{if(r)return;let e=l();if(e){r=!0;try{var s;let r=performance.now(),l=await J(e.video,r);if(a+=performance.now()-r,i++,r-o>3e4&&(console.debug("[FaceSignals] face lane ".concat((a/i).toFixed(1)," ms/frame over ").concat(i," frames")),a=0,i=0,o=r),!l)return;let c=t.push({timeMs:r,...l});for(let t of c.events)e.client.sendFaceEvent(t.event,t.confidence);
1n.shouldSend(c.state,r)&&e.client.sendFaceState(c.state.expression,c.state.confidence,{presence:(s=c.state).presence,smile:O(s.smile),valence:O(s.valence),attention:O(s.attention)})}finally{r=!1}}},A(!0,e7)))}else e.push(setInterval(async()=>{let e=l();if(!e)return;let n=await Z(e.video,performance.now());n&&n.expression!==t?(t=n.expression,e.client.sendFaceState(n.expression,n.confidence)):n||(t="")},A(!1,e7)));e7||er().catch(()=>{}),e.push(setInterval(async()=>{let e=l();if(!e)return;let t=await ea(e.video,performance.now()),n=performance.now();if(s){var r,o;let a=s.push(null!=(r=null==t?void 0:t.gesture)?r:null,null!=(o=null==t?void 0:t.confidence)?o:0,n);a&&e.client.sendFaceEvent(a.event,a.confidence)}if(!t){a="";return}(t.gesture!==a||n-i>3e3)&&(a=t.gesture,i=n,e.client.sendGesture(t.gesture,t.confidence))},e7?1200:700)),e7||(es().catch(()=>{}),e.push(setInterval(async()=>{let e=l();if(!e)return;let t=await ec(e.video,performance.now());t&&t.posture!==n?(n=t.posture,e.client.sendPose(t.posture,t.confidence)):t||(n="")},4e3)),em().catch(()=>{}),e.push(setInterval(async()=>{let e=l();if(!e)return;let t=await ef(e.video);t&&t.scene!==r&&(r=t.scene,e.client.sendScene(t.scene,t.confidence))},8e3)))},8e3*!!e7);return()=>{clearTimeout(c),e.forEach(clearInterval)}},[j]),(0,c.useEffect)(()=>{if(!Y)if("gesture"===w&&(null==x?void 0:x.animationName)){var e,t,n,r;eC.current&&(clearTimeout(eC.current),eC.current=null);let a=(null==(e=x.animationNames)?void 0:e.length)?x.animationNames:[x.animationName],i=null!=(r=x.traceId)?r:"no-trace";console.log("[ANIM ".concat(i,"] -> Unity playAnimation: [").concat(a.join(", "),'] category: "').concat(x.category||"",'"')),null==(n=ei.current)||null==(t=n.contentWindow)||t.postMessage({type:"playAnimation",name:x.animationName,names:a,category:x.category||"",traceId:i},"*")}else eC.current&&clearTimeout(eC.current),eC.current=setTimeout(()=>{var e,t;eC.current=null,null==(t=ei.current)||null==(e=t.contentWindow)||e.postMessage({type:"setAvatarState",state:w},"*")},200)},[w,x,Y]),(0,c.useEffect)(()=>{if(Y)return;let n=e=>{var t,n;null==(n=ei.current)||null==(t=n.contentWindow)||t.postMessage(e,"*")},l=()=>{},o=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=t?"env":"mp4",a=t||null,i=eh.current;return(!!e||!i||i.mode!==r||i.id!==a)&&("env"===r&&(null==i?void 0:i.mode)==="env"&&i.id&&i.id!==a&&n({type:"hideEnvironment"}),eh.current={mode:r,id:a},t?n({type:"setEnvironment",id:t,environmentId:t}):n({type:"hideEnvironment"}),!0)},s=e=>{if(t)return void n({type:"setBackgroundMedia",url:""});n({type:"setBackgroundMedia",url:e})},c=e=>{e&&eg.current!==e&&(eg.current=e,n({type:"setAvatar",name:e}))},u=()=>{var i;let u=ex.current,d=(0,E.im)((0,k.Pm)());eD(d);let h=eR(u),m=a||t?"":(0,_.uq)("".concat(window.location.origin,"/avatars/").concat(h,"-background.mp4")),f=eY?eS(eY):null,p=f?"".concat(f,"/StreamingAssets/avatars"):"";($.current||p)&&n({type:"setBundleBaseUrl",url:null!=(i=$.current)?i:p}),n({type:"setLiveFrameMode",enabled:r}),c(u),n({type:"setBackground",color:null!=e?e:d.unityBackground}),s(m);let g=o();l(),clearTimeout(eu.current),eu.current=setTimeout(()=>{let i=ex.current,u=eR(i),h=a||t?"":(0,_.uq)("".concat(window.location.origin,"/avatars/").concat(u,"-background.mp4"));p&&n({type:"setBundleBaseUrl",url:p}),n({type:"setLiveFrameMode",enabled:r}),c(i),n({type:"setBackground",color:null!=e?e:d.unityBackground}),s(h),o(g),l()},1e3)};u();let d=()=>u(),h=e=>{var t,r,a,o,s,c,d,h;if(e.source===(null==(t=ei.current)?void 0:t.contentWindow)){if((null==(r=e.data)?void 0:r.type)==="unityReady"&&(e4.current=!0,eQ(!0),e8(),(0,S.Gy)("unity_ready"),(0,S.xP)("unity_iframe_to_ready","unity_iframe_load_start","unity_ready"),eE("unity_ready",e.data),null==i||i("unity-ready",e.data),eh.current=null,eg.current=null,$.current&&n({type:"setBundleBaseUrl",url:$.current}),u(),ed.current&&clearTimeout(ed.current),ed.current=setTimeout(()=>{u(),l()},500)),(null==(a=e.data)?void 0:a.type)==="unityError"&&(e3.current=!0,eB(!0),e8(),eE("unity_avatar_bundle_error",e.data),null==i||i("unity-error",e.data)),(null==(o=e.data)?void 0:o.type)==="unityTelemetry"&&"string"==typeof e.data.event){if(eE(e.data.event,e.data),"unity_loader_timeout"!==e.data.event&&(e.data.event.startsWith("unity_loader_")||e.data.event.startsWith("unity_avatar_"))&&e9(),"unity_avatar_bundle_error"===e.data.event){let t=e.data;null!==e_((null!=(d=t.bundle)?d:"").replace(/^avatar_/,""))&&/403/.test(null!=(h=t.error)?h:"")&&!en.current&&B.current&&(en.current=!0,(0,f.KP)(),(0,f.TL)(B.current,ep.$G).then(e=>{var t;e&&(null==(t=et.current)||t.call(et))}))}let t=e.data.detail,n="unity_avatar_bundle_error"===e.data.event&&!e4.current&&(null==t?void 0:t.phase)==="createUnityInstance";("unity_loader_error"===e.data.event||n)&&(e3.current=!0,eB(!0),e8(),null==i||i("unity-error",e.data))}(null==(s=e.data)?void 0:s.type)==="animationStarted"&&"number"==typeof e.data.duration&&(eE("unity_animation_started",e.data),console.log("[ANIM ".concat(e.data.traceId||"no-trace",'] Unity reports clip "').concat(e.data.clip,'" duration: ').concat(e.data.duration.toFixed(1),"s")),N(e.data.duration,"string"==typeof e.data.clip?e.data.clip:void 0)),(null==(c=e.data)?void 0:c.type)==="animationSkipped"&&eE("unity_animation_skipped",e.data)}},m=null,p=()=>{m&&clearTimeout(m),m=setTimeout(u,250)};return window.addEventListener("message",h),window.addEventListener("fam_settings_changed",d),window.addEventListener("resize",p),()=>{window.removeEventListener("message",h),window.removeEventListener("fam_settings_changed",d),window.removeEventListener("resize",p),m&&clearTimeout(m),eu.current&&clearTimeout(eu.current),ed.current&&(clearTimeout(ed.current),ed.current=null)}},[j,T,t,r,a,i,Y]),(0,s.jsxs)(s.Fragment,{children:[j&&(0,s.jsx)("div",{style:{position:"absolute",bottom:eH.bottom,right:eH.right,width:120,height:160,zIndex:15,borderRadius:14,boxShadow:"0 4px 24px rgba(0,0,0,0.6)",border:"2px s
1olid rgba(255,255,255,0.18)",overflow:"hidden",cursor:"grab",touchAction:"none"},onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),eX.current={startX:e.clientX,startY:e.clientY,startRight:eH.right,startBottom:eH.bottom}},onPointerMove:e=>{var t,n;if(!eX.current)return;let r=e.clientX-eX.current.startX,a=e.clientY-eX.current.startY,i=e.currentTarget.parentElement,l=null!=(t=null==i?void 0:i.offsetWidth)?t:window.innerWidth,o=null!=(n=null==i?void 0:i.offsetHeight)?n:window.innerHeight;eV({right:Math.max(0,Math.min(l-120,eX.current.startRight-r)),bottom:Math.max(0,Math.min(o-160,eX.current.startBottom-a))})},onPointerUp:()=>{eX.current=null},children:(0,s.jsx)("video",{ref:el,playsInline:!0,muted:!0,style:{width:"100%",height:"100%",objectFit:"cover",transform:"scaleX(-1)",display:"block"}})}),eF?(0,s.jsx)("div",{className:r?"absolute inset-y-0 left-1/2 -translate-x-1/2 flex items-center justify-center":"absolute inset-0 flex items-center justify-center",style:{zIndex:2,background:null!=e?e:eU.unityBackground,...r?{width:Q.CZ,maxWidth:"100vw"}:{}},children:(0,s.jsx)("p",{className:"text-white/60 text-sm text-center px-8",children:"Avatar couldn't load â check your connection and refresh."})}):(0,s.jsxs)("div",{className:r?"absolute inset-y-0 left-1/2 -translate-x-1/2 pointer-events-none":"absolute pointer-events-none",style:r?{zIndex:2,background:null!=e?e:eU.unityBackground,width:Q.CZ,maxWidth:"100vw",overflow:"hidden"}:t?{top:0,bottom:0,left:"50%",transform:"translateX(-50%)",aspectRatio:Q.Y8,maxWidth:"100%",overflow:"hidden",zIndex:2}:{inset:0,zIndex:2},children:[l&&!eK&&(0,s.jsxs)("div",{className:"absolute inset-0 z-[3] flex flex-col items-center justify-center gap-3 text-white/60",style:{pointerEvents:"none"},children:[(0,s.jsx)("span",{"aria-hidden":"true",className:"h-6 w-6 animate-spin rounded-full border-2 border-white/20 border-t-white/70",style:{width:24,height:24,border:"2px solid rgba(255,255,255,0.22)",borderTopColor:"rgba(255,255,255,0.72)",borderRadius:"50%"}}),(0,s.jsx)("span",{className:"text-sm",children:"Loading companionâ¦"})]}),Y?(0,s.jsx)(h.A,{avatarName:T,paused:y,onReady:e=>{var t;e4.current=!0,eQ(!0),(0,S.Gy)("unity_ready"),null==(t=e6.current)||t.call(e6,"unity-ready",{engine:"three",...e});try{window.postMessage({type:"unityReady",engine:"three"},window.location.origin)}catch(e){}},onError:e=>{var t;("webgl"===e.kind||"context_lost"===e.kind)&&(e3.current=!0,eB(!0)),null==(t=e6.current)||t.call(e6,"unity-error",{engine:"three",...e})}}):(0,s.jsx)("iframe",{ref:ei,src:eZ?eY:void 0,suppressHydrationWarning:!0,loading:"eager",onLoad:()=>{if(eE("unity_iframe_loaded",{src:eY}),null==i||i("iframe-loaded",{src:eY}),e0.current){var e,t;null==(t=ei.current)||null==(e=t.contentWindow)||e.postMessage({type:"unityStart"},"*")}},onError:()=>null==i?void 0:i("unity-error",{src:eY}),className:"absolute border-none block pointer-events-none",style:{background:"transparent",opacity:+!!eK,transition:"opacity 450ms ease-in",filter:a?"none":"url(#black-to-alpha-strict)",WebkitFilter:a?"none":"url(#black-to-alpha-strict)",top:0,height:"100%",left:"50%",transform:"translateX(-50%)",width:t?"100vw":"100%"},allow:"autoplay; camera",title:"FAMBOT Avatar"})]}),eW&&(0,s.jsx)("div",{style:{position:"absolute",top:56,left:"50%",transform:"translateX(-50%)",zIndex:20,background:"rgba(0,0,0,0.75)",color:"#fff",fontSize:12,fontWeight:500,padding:"6px 14px",borderRadius:8,whiteSpace:"nowrap",pointerEvents:"none"},children:"Camera not available â check browser permissions"}),eL&&(0,s.jsx)("div",{className:"absolute inset-0 pointer-events-none z-[10]",style:{opacity:+!eN,transition:"opacity 700ms ease-out"},children:(0,s.jsx)(M,{weather:eL,onDone:()=>eT(null)})}),!o&&R&&(0,g.ZR)(R.card_type)&&(0,g.E)(R)&&(0,s.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2 z-[15]",style:{width:"90%",maxWidth:400},children:(0,s.jsx)(p.A,{cardData:R,onDismiss:()=>P(null)})}),!v&&(0,s.jsx)(b,{})]})}},58387:(e,t,n)=>{"use strict";n.d(t,{NT:()=>o,S3:()=>i});var r=n(38540);let a="all".trim().toLowerCase(),i="1"===a||"all"===a,l="fam_three_avatar";function o(e,t){return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.search;if(!i)return!1;if("all"===a)return!0;try{let t=new URLSearchParams(e);if(t.has("ambientBg"))return!0;let n=t.get("threeAvatar");if("1"===n)return sessionStorage.setItem(l,"1"),!0;if("0"===n)return sessionStorage.removeItem(l),!1;return"1"===sessionStorage.getItem(l)}catch(e){return!1}}(t)&&(0,r.zQ)(e)}},67731:(e,t,n)=>{"use strict";n.d(t,{VG:()=>i,oi:()=>a,zg:()=>l,$G:()=>o,xy:()=>s});let r=JSON.parse('{"Wm":"/unity-build/web.html","AQ":"/unity-build-mobile/web","lP":"20260902a-thinkfreeze","bx":"unity-webgl-20260902a-thinkfreeze"}'),a=r.Wm,i=r.AQ||r.Wm,l=r.lP,o=r.bx;function s(e){return e&&"unknown"!==e?e:l}},86985:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(95155),a=n(67909),i=n(12115),l=n(38540),o=n(20743),s=n(5208),c=n(91190),u=n(23540),d=n(52061);let h=(0,a.default)(()=>Promise.all([n.e(4076),n.e(4846),n.e(2888),n.e(557),n.e(9222)]).then(n.bind(n,99222)),{loadableGenerated:{webpack:()=>[99222]},ssr:!1});function m(e){let{avatarName:t,onReady:n,onError:a,frameOverride:m,debug:f,standalone:p,stageRef:g,paused:v=!1}=e,{jwt:y}=(0,s.A)(),{state:b,currentGesture:w,setAnimationDuration:x,voiceClientRef:M}=(0,c.useAvatar)(),k=(0,i.useRef)(null),_=(0,i.useRef)(y);(0,i.useEffect)(()=>{_.current=y},[y]);let[S,E]=(0,i.useState)(!1);(0,i.useEffect)(()=>E(!0),[]);let[R,P]=(0,i.useState)(!1),j=(0,i.useRef)(null),L=(0,i.useRef)(null),T=(0,i.useRef)(null),N=(0,i.useRef)({onReady:n,onError:a});N.current={onReady:n,onError:a};let z=(0,i.useCallback)(e=>{k.current=e,g&&(g.current=e),P(!!e)},[g]),I=(0,i.useCallback)(async e=>{let t,n=k.current;if(!n)return;let r=(0,l.Fp)(e);if(r){try{t=await (0,d.No)(r,()=>_.current)}catch(t){if(t instanceof d.Y9){var a,i;let n={kind:t.kind,message:t.message};
1(0,o.k)("unity_avatar_bundle_error",{avatar:e,error:n.message}),null==(a=(i=N.current).onError)||a.call(i,n);return}throw t}n.setBundleBase(t.bundleBase);try{await n.loadAvatar(e,{modelUrl:t.modelUrl,animsUrl:t.animsUrl,profile:r})}catch(a){if(403===(null==a?void 0:a.status)&&t.needsSession&&j.current!==e&&_.current){j.current=e;let t=await (0,d.No)(r,()=>_.current,{remint:!0}).catch(()=>null);(null==t?void 0:t.bundleBase)&&(n.setBundleBase(t.bundleBase),await n.loadAvatar(e,{modelUrl:t.modelUrl,animsUrl:t.animsUrl,profile:r}).catch(()=>{}))}}}},[]);return((0,i.useEffect)(()=>{R&&I(t)},[t,I,R]),(0,i.useEffect)(()=>{let e=()=>{let e=(0,l.Fp)(t);(null==e?void 0:e.model.kind)==="walletLocked"&&I(t)};return window.addEventListener(u.Td,e),()=>window.removeEventListener(u.Td,e)},[t,I]),(0,i.useEffect)(()=>{if(p)return;let e=k.current;if(e)if("gesture"===b&&(null==w?void 0:w.animationName)){var t,n;L.current&&(clearTimeout(L.current),L.current=null);let r=(null==(t=w.animationNames)?void 0:t.length)?w.animationNames:[w.animationName];e.playClips(r,{traceId:null!=(n=w.traceId)?n:"no-trace",category:w.category||""})}else L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{var e;L.current=null,null==(e=k.current)||e.setState(b)},200)},[b,w,p]),(0,i.useEffect)(()=>{var e,t,n,r;if(p)return;let a=null!=(n=null==(t=M.current)||null==(e=t.getPlaybackAnalyser)?void 0:e.call(t))?n:null;a!==T.current&&(T.current=a,null==(r=k.current)||r.setMouthSource(a))},[b,p,M]),(0,i.useEffect)(()=>()=>{L.current&&clearTimeout(L.current)},[]),S)?(0,r.jsx)(h,{ref:z,gaze:"viewer",paused:v,debug:f,frameOverride:m,onReady:e=>{var t,n;return null==(t=(n=N.current).onReady)?void 0:t.call(n,e)},onError:e=>{var t,n;return null==(t=(n=N.current).onError)?void 0:t.call(n,e)},onAnimationStarted:e=>{e.oneShot&&x(e.duration,e.clip)}}):null}}}]);
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.