@lemoncat7/dsh-theme-xiaohei 0.4.4 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -91
- package/docs/releases/0.4.5.md +21 -0
- package/docs/releases/0.4.6.md +17 -0
- package/docs/releases/README.md +14 -0
- package/docs/startup-audit-20261013.md +47 -0
- package/lib/bloub-heixiu/layout.d.ts +16 -0
- package/lib/bloub-heixiu/layout.js +14 -0
- package/lib/bloub-heixiu/runtime.js +41 -10
- package/lib/chrome/conversation-messages.js +17 -4
- package/lib/chrome/conversation-submissions.d.ts +3 -0
- package/lib/chrome/conversation-submissions.js +68 -0
- package/lib/chrome.js +2 -0
- package/lib/client.companion.js +100 -0
- package/lib/client.decorations.js +51 -0
- package/lib/client.js +113 -845
- package/lib/client.pose-chin-dark.js +4 -0
- package/lib/client.pose-chin-light.js +4 -0
- package/lib/client.pose-doze-dark.js +4 -0
- package/lib/client.pose-doze-light.js +4 -0
- package/lib/client.pose-halfpeek-dark.js +4 -0
- package/lib/client.pose-halfpeek-light.js +4 -0
- package/lib/client.pose-peek-dark.js +4 -0
- package/lib/client.pose-peek-light.js +4 -0
- package/lib/client.pose-seated-dark.js +4 -0
- package/lib/client.pose-seated-light.js +4 -0
- package/lib/client.rig-chin-dark.js +4 -0
- package/lib/client.rig-chin-light.js +4 -0
- package/lib/client.rig-halfpeek-dark.js +4 -0
- package/lib/client.rig-halfpeek-light.js +4 -0
- package/lib/client.rig-peek-dark.js +4 -0
- package/lib/client.rig-peek-light.js +4 -0
- package/lib/client.rig-seated-dark.js +4 -0
- package/lib/client.rig-seated-light.js +4 -0
- package/lib/companion-entry.d.ts +3 -0
- package/lib/companion-entry.js +3 -0
- package/lib/composer-draft-preview.d.ts +4 -0
- package/lib/composer-draft-preview.js +8 -0
- package/lib/decorations-entry.d.ts +3 -0
- package/lib/decorations-entry.js +18 -0
- package/lib/deferred-companion.d.ts +5 -0
- package/lib/deferred-companion.js +9 -0
- package/lib/deferred-decorations.d.ts +3 -0
- package/lib/deferred-decorations.js +51 -0
- package/lib/host-dom.d.ts +1 -1
- package/lib/host-dom.js +6 -2
- package/lib/plugin.js +13 -6
- package/lib/portal.js +1 -1
- package/lib/scene/character-assets.d.ts +13 -0
- package/lib/scene/character-assets.js +26 -0
- package/lib/scene/character-motion.js +14 -7
- package/lib/scene/ids.d.ts +5 -0
- package/lib/scene/ids.js +5 -0
- package/lib/scene/runtime.d.ts +1 -1
- package/lib/scene/runtime.js +2 -15
- package/lib/scene/styles.d.ts +1 -3
- package/lib/scene/styles.js +2 -8
- package/lib/scene/wallpaper-character-styles.js +1 -5
- package/lib/scene/wallpaper-character.d.ts +2 -1
- package/lib/scene/wallpaper-character.js +24 -15
- package/lib/sidebar-glass.js +1 -1
- package/package.json +4 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({ id: "@lemoncat7/dsh-theme-xiaohei", chunk: "client.companion.js", factory: (require) => { var module = { exports: {} }; var exports = module.exports;
|
|
2
|
+
"use strict";var Je=Object.defineProperty;var Fn=Object.getOwnPropertyDescriptor;var Cn=Object.getOwnPropertyNames;var zn=Object.prototype.hasOwnProperty;var Dn=(e,n)=>{for(var t in n)Je(e,t,{get:n[t],enumerable:!0})},Nn=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of Cn(n))!zn.call(e,o)&&o!==t&&Je(e,o,{get:()=>n[o],enumerable:!(i=Fn(n,o))||i.enumerable});return e};var Xn=e=>Nn(Je({},"__esModule",{value:!0}),e);var So={};Dn(So,{installComposerBloub:()=>An});module.exports=Xn(So);var $=Math.PI*2,I=(e,n=0,t=1)=>e<n?n:e>t?t:e,w=(e,n,t)=>e+(n-e)*t,_={easeOutCubic:e=>1-(1-e)**3,easeInOutCubic:e=>e<.5?4*e**3:1-(-2*e+2)**3/2,easeOutQuint:e=>1-(1-e)**5};function Q(e,n,t=0){let i=e/n*$;return .55*Math.sin(i+t)+.3*Math.sin(2*i+t*1.7+1.1)+.15*Math.sin(3*i+t*2.3+2.4)}function he(e){let n=e>>>0;return()=>{n=n+1831565813>>>0;let t=Math.imul(n^n>>>15,1|n);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}var b=e=>Math.round(e*100)/100;function et(e,n=.55,t=.62){let i=(e%360+360)%360,o=(1-Math.abs(2*t-1))*n,s=o*(1-Math.abs(i/60%2-1)),r=t-o/2,[a,c,u]=i<60?[o,s,0]:i<120?[s,o,0]:i<180?[0,o,s]:i<240?[0,s,o]:i<300?[s,0,o]:[o,0,s],l=p=>Math.round((p+r)*255).toString(16).padStart(2,"0");return`#${l(a)}${l(c)}${l(u)}`}function Rt(e,n,t,i,o=1){let s=e.phase+n*e.speed*$,r=Math.cos(e.tilt),a=Math.sin(e.tilt),c=Math.sqrt(Math.max(0,1-e.k*e.k)),u=64,l=e.sweep*$,p="",m="",f=null;for(let h=0;h<=u;h++){let x=s+h/u*l,y=Math.cos(x),d=Math.sin(x),v=e.a*(y*r+d*-a*e.k)+e.cx,k=e.a*(y*a+d*r*e.k)+e.cy,A=e.a*d*c<0,B=b(v*t),S=b(k*t),F=A!==f?"M":"L";A?m+=`${F}${B} ${S}`:p+=`${F}${B} ${S}`,f=A}let g=Math.cos(e.tilt)*e.a*t,M=Math.sin(e.tilt)*e.a*t;return{id:i,front:p,back:m,width:e.width*t,opacity:o,grad:{x1:b(e.cx*t-g),y1:b(e.cy*t-M),x2:b(e.cx*t+g),y2:b(e.cy*t+M),stops:[et(e.hue),et(e.hue+e.hueSpan*.5),et(e.hue+e.hueSpan)]}}}var W=he(659918),tt=Array.from({length:6},(e,n)=>({a:1.3+W()*.1,k:.05+W()*.4,tilt:n/6*Math.PI+W()*.5,speed:3+W()*.7,phase:W()*$,sweep:.6+W()*.25,hue:n*360/6+W()*30,hueSpan:60+W()*60,width:.05+W()*.012,cx:0,cy:.1})),Tt=Array.from({length:4},(e,n)=>({a:.78+n*.2,k:.05+n*.02,tilt:-.62+n*.05,speed:.3,phase:.06*n,sweep:.4,hue:95+n*62,hueSpan:100,width:.05,cx:0,cy:-.12})),nt=[-.557,-.013,.532],ot=.165,it=1.25,Ht=he(48879),Gn=Array.from({length:5},(e,n)=>({birth:n*.2,angle:Ht()*$,rho:.58+Ht()*.18}));function $t(e,n){let t=[];for(let i of Gn){let o=e-i.birth;if(o<0||o>.62)continue;let s=i.rho*Math.pow(.75,o*10),r=i.angle+o*100*Math.PI/180;t.push({x:Math.cos(r)*s*n,y:Math.sin(r)*s*n,r:(.04+.028*I(o/.55))*n,depth:I(1-s/.8),opacity:I(o/.06)*I((.62-o)/.08)})}return t}var Ot=he(49383),Bt=Array.from({length:4},(e,n)=>{let t=n-1.5;return{a:.85*(1+t*.03),k:.15/.85*(1+t*.16),tilt:34*Math.PI/180+t*.035,speed:210/360,phase:-n*.045+Ot()*.012,sweep:.34,hue:n*85+Ot()*20,hueSpan:80,width:.095,cx:0,cy:0}}),Lt=.129;var _t=-42,rt=1.003,Ft=.15,Ct=1.14,zt=.054;var Me=15.46,we=.186,ve=.412,Se={yaw:28.49,pitch:28.62,roll:-13},Te=e=>e*Math.PI/180;function $e(e,n,t){let i=Math.cos(t),o=Math.sin(t);return[[e[0]*i+n[0]*o,e[1]*i+n[1]*o,e[2]*i+n[2]*o],[n[0]*i-e[0]*o,n[1]*i-e[1]*o,n[2]*i-e[2]*o]]}function Be(e,n,t=Me){let i=[0,0,1],o=[1,0,0],s=[0,1,0];[i,o]=$e(i,o,Te(e.yaw)),[s,i]=$e(s,i,Te(e.pitch)),[o,s]=$e(o,s,Te(e.roll));let r=a=>{let[c,u]=$e(i,o,Te(t*a));return{x:c[0]*n,y:c[1]*n,a:u[0],b:u[1],c:s[0],d:s[1],depth:c[2]}};return[r(-1),r(1)]}var Dt=he(24301),Nt=(()=>{let e=[],n=1.4;for(;n<900;)e.push(n),n+=1.9+Dt()*2.7,Dt()<.18&&(e.push(n),n+=.24);return e})(),Un=.18;function Yn(e){e=(e%900+900)%900;for(let n=0;n<Nt.length;n++){let t=Nt[n];if(e<t)break;let i=(e-t)/Un;if(i>=0&&i<=1)return i<.45?1-i/.45:(i-.45)/.55}return 1}function Le(e,n={}){let{wander:t=1,blink:i=!0,float:o=!0}=n;return{dYaw:(Q(e,11.3,.4)*5.5+Q(e,3.7,2.1)*1.6)*t,dPitch:(Q(e,9.1,1.3)*4.2+Q(e,4.3,.7)*1.3)*t,dRoll:Q(e,13.7,3.2)*2.2*t,lid:i?Yn(e):1,driftX:o?Q(e,7.9,1.9)*.006:0,driftY:o?Q(e,5.3,.3)*.007:0,breath:o?1+Math.sin(e/3.4*Math.PI*2)*.005:1}}function Xt(e){return .06+.94*I(e)}var V=(e,n,t=0,i=1)=>({w:e,h:n,tilt:t,open:i}),U=(e,n,t=0,i=1)=>[V(e,n,t,i),V(e,n,-t,i)],st=[{id:"neutre",gaze:{...Se},split:Me,eyes:[V(we,ve),V(we,ve)]},{id:"attentif",gaze:{yaw:4,pitch:5,roll:-4},split:16,eyes:U(.21,.44)},{id:"surpris",gaze:{yaw:3,pitch:-3,roll:0},split:19,eyes:U(.45,.47)},{id:"excite",gaze:{yaw:6,pitch:-14,roll:0},split:19.5,eyes:U(.4,.56,-10)},{id:"heureux",gaze:{yaw:5,pitch:9,roll:0},split:17,eyes:U(.27,.17,14)},{id:"hilare",gaze:{yaw:4,pitch:14,roll:0},split:18,eyes:U(.34,.13,20)},{id:"colere",gaze:{yaw:3,pitch:7,roll:0},split:17,eyes:U(.34,.15,30)},{id:"triste",gaze:{yaw:3,pitch:-13,roll:0},split:16,eyes:U(.22,.4,-28)},{id:"effraye",gaze:{yaw:2,pitch:-20,roll:0},split:20.5,eyes:U(.4,.6)},{id:"mefiant",gaze:{yaw:12,pitch:6,roll:-6},split:16,eyes:[V(.21,.4),V(.22,.15)]},{id:"confus",gaze:{yaw:-14,pitch:3,roll:8},split:16.5,eyes:[V(.2,.44,-18),V(.28,.17,14)]},{id:"curieux",gaze:{yaw:16,pitch:-9,roll:-15},split:16.5,eyes:[V(.24,.46,-8),V(.2,.38,-8)]},{id:"fier",gaze:{yaw:5,pitch:17,roll:0},split:17,eyes:U(.3,.15,18)},{id:"timide",gaze:{yaw:-19,pitch:-14,roll:-7},split:14,eyes:U(.17,.3)},{id:"blase",gaze:{yaw:-22,pitch:2,roll:0},split:16,eyes:U(.3,.12)},{id:"somnolent",gaze:{yaw:6,pitch:-9,roll:-3},split:16,eyes:U(.2,.42,0,.42)}],$o=new Map(st.map(e=>[e.id,e]));var Gt=(e,n,t)=>({w:w(e.w,n.w,t),h:w(e.h,n.h,t),tilt:w(e.tilt??0,n.tilt??0,t),open:w(e.open,n.open,t)});function Ut(e,n,t){return{id:n.id,gaze:{yaw:w(e.gaze.yaw,n.gaze.yaw,t),pitch:w(e.gaze.pitch,n.gaze.pitch,t),roll:w(e.gaze.roll,n.gaze.roll,t)},split:w(e.split,n.split,t),eyes:[Gt(e.eyes[0],n.eyes[0],t),Gt(e.eyes[1],n.eyes[1],t)]}}var Yt={egg:[.8369,.8424,.8497,.8585,.8674,.8775,.8878,.8983,.9089,.9185,.9288,.9374,.9445,.9504,.9543,.9559,.9555,.9519,.9466,.9389,.9302,.9193,.9085,.8969,.8852,.8734,.8625,.8513,.8411,.8325,.8243,.8179,.8137,.8112,.8102,.8128,.8178,.8262,.8374,.8518,.8702,.8922,.9169,.9446,.9741,1.0023,1.0267,1.0433,1.0481,1.0393,1.0216,.997,.9697,.9418,.9169,.8949,.876,.8604,.849,.8394,.8337,.8314,.8305,.8326],hexagon:[.921,.9282,.9441,.9706,.9984,1.0059,.9896,.9562,.929,.9124,.9047,.9058,.9157,.9349,.9642,.9873,.9882,.9665,.9336,.9105,.8968,.8918,.8955,.908,.9293,.9611,.982,.9812,.959,.9282,.9089,.8978,.8964,.9026,.9189,.9439,.9778,.999,.9964,.9713,.9439,.9274,.9196,.9206,.9308,.9502,.9799,1.0121,1.0226,1.0071,.9752,.951,.9366,.9316,.9351,.9485,.9711,1.0026,1.0213,1.0155,.9863,.9547,.9347,.9232],triangle:[.7819,.8211,.8747,.944,1.0223,1.096,1.1401,1.134,1.0808,1.0047,.9265,.8603,.8104,.773,.745,.7273,.7151,.7118,.7148,.7245,.7427,.768,.8037,.8518,.9148,.9876,1.0583,1.1073,1.1109,1.0667,.994,.9164,.8482,.7948,.7555,.7261,.7056,.6925,.6859,.6869,.6938,.7084,.7305,.7615,.804,.8595,.9311,1.0092,1.0791,1.1171,1.1054,1.0501,.9779,.905,.845,.799,.7656,.7413,.7258,.716,.7146,.7204,.733,.7528]};var at=Array.from({length:64},(e,n)=>n/64*$),_e=at.map(Math.cos),Fe=at.map(Math.sin);function Ce(e,n={}){return{radii:[...Yt[e]],rot:0,cx:0,cy:0,sx:1,sy:1,...n}}function re(e,n={}){return{radii:new Array(64).fill(e),rot:0,cx:0,cy:0,sx:1,sy:1,...n}}function Vt(e,n,t,i){let o=i??{radii:new Array(64),rot:0,cx:0,cy:0,sx:1,sy:1};for(let r=0;r<64;r++)o.radii[r]=w(e.radii[r]??1,n.radii[r]??1,t);let s=n.rot-e.rot;for(;s>Math.PI;)s-=$;for(;s<-Math.PI;)s+=$;return o.rot=e.rot+s*t,o.cx=w(e.cx,n.cx,t),o.cy=w(e.cy,n.cy,t),o.sx=w(e.sx,n.sx,t),o.sy=w(e.sy,n.sy,t),o}function Ie(e,n,t=[]){let i=Math.cos(e.rot),o=Math.sin(e.rot);for(let s=0;s<64;s++){let r=e.radii[s]??1,a=r*(_e[s]??0),c=r*(Fe[s]??0),u=a*i-c*o,l=a*o+c*i,p=t[s]??{x:0,y:0};p.x=(u*e.sx+e.cx)*n,p.y=(l*e.sy+e.cy)*n,t[s]=p}return t.length=64,t}function qt(e,n=1/6){let t=e.length;if(t<3)return"";let i=e[0],o=`M${b(i.x)} ${b(i.y)}`;for(let s=0;s<t;s++){let r=e[(s-1+t)%t],a=e[s],c=e[(s+1)%t],u=e[(s+2)%t],l=a.x+(c.x-r.x)*n,p=a.y+(c.y-r.y)*n,m=c.x-(u.x-a.x)*n,f=c.y-(u.y-a.y)*n;o+=`C${b(l)} ${b(p)} ${b(m)} ${b(f)} ${b(c.x)} ${b(c.y)}`}return`${o}Z`}function se(e,n,t){let i=new Array(64).fill(0),o=e.length;for(let s=0;s<64;s++){let r=_e[s]??0,a=Fe[s]??0,c=0;for(let u=0;u<o;u++){let l=e[u],p=e[(u+1)%o],m=p.x-l.x,f=p.y-l.y,g=r*f-a*m;if(Math.abs(g)<1e-9)continue;let M=l.x-n,h=l.y-t,x=(M*f-h*m)/g,y=(M*a-h*r)/g;x>c&&y>=0&&y<=1&&(c=x)}i[s]=c}return i}function ae(e,n,t,i,o,s,r=96){let a=i-e,c=o-n,u=Math.hypot(a,c)||1e-6,l=Math.atan2(c,a),p=Math.acos(Math.max(-1,Math.min(1,(t-s)/u))),m=[];for(let f=0;f<=r/2;f++){let g=l+p+($-2*p)*f/(r/2);m.push({x:e+Math.cos(g)*t,y:n+Math.sin(g)*t})}for(let f=0;f<=r/2;f++){let g=l-p+2*p*f/(r/2);m.push({x:i+Math.cos(g)*s,y:o+Math.sin(g)*s})}return m}function ze(e,n){let t=e.length,i=(n/$%1+1)%1*t,o=Math.floor(i);return w(e[o%t]??1,e[(o+1)%t]??1,i-o)}function De(e,n=1,t=1){return at.map((i,o)=>{let s=Math.abs((_e[o]??0)/n)**e,r=Math.abs((Fe[o]??0)/t)**e;return(s+r)**(-1/e)})}function Wt(e){let n=new Array(64).fill(0);for(let t=0;t<64;t++){let i=_e[t]??0,o=Fe[t]??0,s=0;for(let r of e){let a=i*r.x+o*r.y,c=a*a-(r.x*r.x+r.y*r.y-r.r*r.r);if(c<0)continue;let u=a+Math.sqrt(c);u>s&&(s=u)}n[t]=s}return n}function Vn(e,n,t=10){let i=e.length,o=[],s=(r,a)=>{let c=a.x-r.x,u=a.y-r.y,l=Math.hypot(c,u)||1;return Math.atan2(-c/l,u/l)};for(let r=0;r<i;r++){let a=e[(r-1+i)%i],c=e[r],u=e[(r+1)%i],l=s(a,c),m=s(c,u)-l;for(;m>Math.PI;)m-=$;for(;m<-Math.PI;)m+=$;for(let f=0;f<=t;f++){let g=l+m*f/t;o.push({x:c.x+Math.cos(g)*n,y:c.y+Math.sin(g)*n})}}return o}function ct(e,n,t,i=0){let o=i*Math.PI/180,s=Array.from({length:e},(r,a)=>{let c=o+a/e*$;return{x:Math.cos(c)*(n-t),y:Math.sin(c)*(n-t)}});return se(Vn(s,t),0,0)}function Kt(e,n=1){if(e.length<3)return"";let t="";for(let i=0;i<e.length;i++){let o=e[i];t+=`${i===0?"M":"L"}${b(o.x*n)} ${b(o.y*n)}`}return`${t}Z`}function jt(e,n){let t=Math.max(e,.01)/2,i=Math.max(n,.01)/2,o=Math.min(t,i);return`M${b(-t)} ${b(-i+o)}A${b(o)} ${b(o)} 0 0 1 ${b(-t+o)} ${b(-i)}L${b(t-o)} ${b(-i)}A${b(o)} ${b(o)} 0 0 1 ${b(t)} ${b(-i+o)}L${b(t)} ${b(i-o)}A${b(o)} ${b(o)} 0 0 1 ${b(t-o)} ${b(i)}L${b(-t+o)} ${b(i)}A${b(o)} ${b(o)} 0 0 1 ${b(-t)} ${b(i-o)}Z`}function Ne(e,n=1){let t=Math.max(...e);if(t<=0)return e;let i=n/t;return e.map(o=>o*i)}var qn=Array.from({length:64},(e,n)=>n/64*Math.PI*2),Wn=Ne(qn.map(e=>1+.075*Math.cos(2*e+.5)+.035*Math.cos(3*e+2.1)),1.02),Kn=Ne(Wt([{x:-.44,y:.2,r:.54},{x:.46,y:.2,r:.5},{x:.02,y:.3,r:.6},{x:-.24,y:-.3,r:.48},{x:.3,y:-.24,r:.44}]),1.02),jn=Ne(se(ae(0,.28,.66,0,-.96,.05),0,0),1.04),Qn=se(ae(-.42,0,.62,.42,0,.62),0,0),Xe=[{id:"cercle",radii:new Array(64).fill(1)},{id:"galet",radii:Wn},{id:"squircle",radii:Ne(De(4.2),1.15)},{id:"capsule",radii:Qn},{id:"triangle",radii:ct(3,1.12,.34,-90)},{id:"hexagone",radii:ct(6,1.04,.26,0)},{id:"nuage",radii:Kn},{id:"goutte",radii:jn}],No=new Map(Xe.map(e=>[e.id,e]));var Zn=[{id:"encre",hex:"#0a0a0c"},{id:"brun",hex:"#8b5e3c"},{id:"rouge",hex:"#e8483f"},{id:"orange",hex:"#f08a24"},{id:"ambre",hex:"#f0b429"},{id:"vert",hex:"#3ecf8e"},{id:"turquoise",hex:"#2fbfa0"},{id:"bleu",hex:"#3b93f0"},{id:"violet",hex:"#8b5cf6"},{id:"rose",hex:"#e152b0"},{id:"gris",hex:"#a3a3a3"},{id:"creme",hex:"#f1efe9"}],Xo=new Map(Zn.map(e=>[e.id,e]));var ce=(e,n)=>[{w:e,h:n,open:1},{w:e,h:n,open:1}];function z(e={}){return{sil:re(1),offX:0,offY:0,gaze:{...Se},split:Me,eyes:ce(we,ve),eyeAlpha:1,bodyAlpha:1,dots:[],arcs:[],notif:null,dotsBehind:!1,...e}}var en=-.1875,Jn=se(ae(0,-.505,.132,0,.13,.075),0,en),eo=se(ae(0,-.2535,.1345,0,.2535,.1345),0,0),to=(e={})=>({radii:[...Jn],rot:0,cx:0,cy:en,sx:1,sy:1,...e}),no=(e={})=>({radii:[...eo],rot:0,cx:0,cy:0,sx:1,sy:1,...e}),oo=Kt(ae(0,0,.118,0,.172,.012)),Qt=.213;function Zt(e){return Ce("triangle",{rot:e,cx:-Qt*Math.sin(e),cy:Qt*Math.cos(e)})}function Jt(e,n){let t=((e-n*.5)/1.5%1+1)%1,i=t<.5?.5-.5*Math.cos(t*$):0;return I(i*2)}var ut=[{id:"idle",duration:2.4,morph:.45,blinkIn:!1,baseFace:!0,baseBody:!0,pose:()=>z()},{id:"thinking",duration:2.6,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!0,pose:e=>{let n=Jt(e,1),t=.3+.7*_.easeOutCubic(I(e/.3));return z({sil:re(ot*(1+(it-1)*n),{cx:nt[1]}),eyeAlpha:0,dots:[0,2].map(i=>{let o=Jt(e,i);return{x:nt[i]*t,y:0,r:ot*(1+(it-1)*o),opacity:.55+.45*o}})})}},{id:"wink",duration:1.6,morph:.3,blinkIn:!0,baseFace:!1,baseBody:!0,pose:()=>z({gaze:{yaw:-5.37,pitch:4.55,roll:6.7},split:16.25,eyes:[{w:.236,h:.464,open:1},{w:.447,h:.089,open:1}]})},{id:"wide",duration:1.8,morph:.55,blinkIn:!0,baseFace:!1,baseBody:!0,pose:()=>z({gaze:{yaw:6.92,pitch:-21.96,roll:11.6},split:18.43,eyes:ce(.356,.875)})},{id:"alert",duration:2.4,minDuration:2,morph:.45,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let n=I(e/1.5),t=_.easeInOutCubic(n)*.82-.087,i=e>1.6?I((e-1.6)/.4):0,o=t*(1-i)+.1*i,s=Math.sin(e*2.5*$)*.005,r=17.7*Math.PI/180;return z({sil:no({rot:r,cx:o,cy:-.325-s}),eyeAlpha:0,dots:[{x:o-Math.sin(r)*.58,y:-.325+Math.cos(r)*.58+s*2.8,r:.118,d:oo,rot:r*180/Math.PI,opacity:1}]})}},{id:"notify",duration:2.2,morph:.5,blinkIn:!0,baseFace:!1,baseBody:!0,pose:e=>{let n=I(e/.45),t=1+(Ct-1)*Math.sin(n*Math.PI)*(1-n*.35),i=Ft*(n<1?t:1),o=_t*Math.PI/180;return z({gaze:{yaw:-21.94,pitch:-5.82,roll:-12.2},split:18.89,eyes:ce(.505,.498),notif:{x:Math.cos(o)*rt,y:Math.sin(o)*rt,r:i,notch:i+zt}})}},{id:"exclaim",duration:2,morph:.45,baseFace:!1,baseBody:!1,blinkIn:!1,pose:()=>z({sil:to(),eyeAlpha:0,dots:[{x:-.012,y:.526,r:.113,opacity:1}]})},{id:"sleep",duration:2.4,morph:.5,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>z({sil:re(.1585,{cy:.11+Math.sin(e*($/.6))*.19}),eyeAlpha:0})},{id:"egg",duration:1.8,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!0,pose:()=>z({sil:Ce("egg"),gaze:{yaw:19.97,pitch:26.01,roll:-17.1},split:11.07,eyes:ce(.164,.385)})},{id:"hexagon",duration:1.6,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!0,pose:()=>z({sil:Ce("hexagon"),gaze:{yaw:23.11,pitch:24.42,roll:-13.3},split:13.37,eyes:ce(.177,.411)})},{id:"play",duration:2,morph:.5,baseFace:!1,baseBody:!1,blinkIn:!0,pose:e=>{let n=I(e/.35)*I((2.2-e)/.5);return z({sil:Zt(0),gaze:{yaw:12,pitch:-8,roll:-6},split:15,eyes:ce(.18,.34),arcs:Tt.map((t,i)=>({id:`sw${i}`,seed:{...t,cx:.45-e*.42},t:e,opacity:n}))})}},{id:"orbit",duration:3.4,minDuration:2.5,morph:.6,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let n=_.easeInOutCubic(I(e/.35)),t=-$*1.25*e*n,i=_.easeInOutCubic(I((e-1.6)/.9)),o=Zt(t),s=re(1,{rot:t}),r={radii:o.radii.map((c,u)=>c+(s.radii[u]-c)*i),rot:t,cx:o.cx*(1-i),cy:o.cy*(1-i),sx:1,sy:1},a=I(e/.8)*I((3.6-e)/.9);return z({sil:r,gaze:{yaw:Se.yaw+Math.sin(e*6.5)*65*(1-i),pitch:-4+i*32,roll:-13},eyes:ce(.18,.34+i*.07),arcs:tt.map((c,u)=>({id:`rg${u}`,seed:c,t:e,opacity:a*I((e-u*.13)/.3)}))})}},{id:"swirl",duration:1.3,minDuration:1.3,morph:.3,baseFace:!0,baseBody:!0,blinkIn:!0,pose:e=>z({arcs:tt.slice(0,3).map((n,t)=>({id:`sw${t}`,seed:n,t:e,opacity:I((e-t*.06)/.14)*I((1.22-e)/.34)}))})},{id:"burst",duration:2.6,minDuration:2.4,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let n=1-.834*_.easeOutQuint(I(e/.7)),t=_.easeOutQuint(I((e-1.7)/.7));return z({sil:re(n+(1-n)*t),eyeAlpha:I((e-1.85)/.4),dots:$t(e,1),dotsBehind:!0})}},{id:"comet",duration:2.4,minDuration:2.4,morph:.45,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let n=1-(1-Lt)*_.easeOutQuint(I(e/.55)),t=_.easeOutQuint(I((e-1.85)/.6)),i=I((e-.15)/.25)*I((1.95-e)/.3);return z({sil:re(n+(1-n)*t,{cy:Math.sin(I(e/1.7)*Math.PI)*.035}),eyeAlpha:I((e-2)/.35),arcs:Bt.map((o,s)=>({id:`cm${s}`,seed:o,t:e,opacity:i}))})}}],Z=new Map(ut.map(e=>[e.id,e]));var K=100,tn=5.5+1.6,nn=4.2+1.3,io=.006,ro=.007;function on(e,n,t){let i=[],o=Be(e.gaze,K,e.split);for(let s=0;s<2;s++){let r=o[s];if(r.depth<=.02)continue;let a=e.eyes[s],c=(a.tilt??0)*Math.PI/180,u=Math.cos(c),l=Math.sin(c),p=r.a*u+r.c*l,m=r.b*u+r.d*l,f=-r.a*l+r.c*u,g=-r.b*l+r.d*u,M=Math.max(a.w*K,.01)/2,h=Math.max(a.h*K,.01)/2,x=Math.min(M,h),y=h>M,d=y?h-x:M-x,v=ze(t,Math.atan2(r.y,r.x)-n.rot);i.push({x:r.x*v,y:r.y*v,ax:(y?f:p)*d,ay:(y?g:m)*d,r:x,m:[p,m,f,g]})}return i}function so(e,n,t,i,o){let s=i-n,r=o-t,a=s*s+r*r,c=1/0,u=0,l=0;for(let m=0;m<e.length;m++){let f=e[m],g=a>0?((f.x-n)*s+(f.y-t)*r)/a:0;g=g<0?0:g>1?1:g;let M=n+g*s-f.x,h=t+g*r-f.y,x=M*M+h*h;x<c&&(c=x,u=M,l=h)}let p=Math.sqrt(c);return{d:p,ux:p>1e-9?u/p:0,uy:p>1e-9?l/p:0}}var ao=Math.hypot(io,ro)*K;function rn(e,n,t,i){let o=1/0,s=0,r=0;for(let a of n){let c=a.x+t,u=a.y+i,l=so(e,c-a.ax,u-a.ay,c+a.ax,u+a.ay),[p,m,f,g]=a.m,M=a.r*Math.hypot(p*l.ux+m*l.uy,f*l.ux+g*l.uy)+ao;l.d-M<o&&(o=l.d-M,s=l.ux,r=l.uy)}return{marge:o,ux:s,uy:r}}var sn=12,co=8;function uo(e){if(!e.length)return{x:0,y:0};let n=(x,y)=>{let d=1/0;for(let v of e)d=Math.min(d,rn(v.contour,v.empreintes,x,y).marge);return d},t=1/0;for(let x of e)t=Math.min(t,rn(x.calContour,x.reference,0,0).marge);let i=0,o=0,s=e[0].empreintes;for(let x of s)i-=x.x/s.length,o-=x.y/s.length;let r=Math.max(.35*K,Math.hypot(i,o)*1.25);t=Math.min(t,n(i,o));let a=n(0,0);if(a>=t&&a>=0)return{x:0,y:0};let c=Math.max(t,0),u=0,l=0,p=1/0,m=0,f=0,g=a;for(let x=0;x<sn;x++){let y=x/sn*Math.PI*2,d=Math.cos(y),v=Math.sin(y);if(n(d*r,v*r)<c){for(let A of[.3,.6,1]){let B=n(d*r*A,v*r*A);B>g&&(g=B,m=d*r*A,f=v*r*A)}continue}let k=0,R=r;for(let A=0;A<co;A++){let B=(k+R)/2;n(d*B,v*B)>=c?R=B:k=B}R<p&&(p=R,u=d*R,l=v*R)}let M=p===1/0?m:u,h=p===1/0?f:l;return{x:+(M/K).toFixed(6),y:+(h/K).toFixed(6)}}function lo(e,n,t){return e.baseFace&&t?{gaze:t.gaze,split:t.split,eyes:t.eyes}:{gaze:n.gaze,split:n.split,eyes:n.eyes}}function po(e){let n=i=>JSON.stringify([i.gaze,i.split,i.eyes,i.sil.rot,i.sil.cx,i.sil.cy,i.sil.sx,i.sil.sy]);if(n(e.pose(0))===n(e.pose(e.duration)))return[0];let t=3;return Array.from({length:t},(i,o)=>o/(t-1)*e.duration)}function ho(e,n,t){let i=[];for(let o of po(e)){let s=e.pose(o),r=Ie({...s.sil,radii:n},K),a=Ie(s.sil,K),c=lo(e,s,t),u=[];for(let l of[-tn,tn])for(let p of[-nn,nn])u.push({...c,gaze:{yaw:c.gaze.yaw+l,pitch:c.gaze.pitch+p,roll:c.gaze.roll}});for(let l of u)i.push({empreintes:on(l,s.sil,n),reference:on(l,s.sil,s.sil.radii),contour:r,calContour:a})}return uo(i)}var lt={x:0,y:0},pt=(e,n)=>`${e}|${n??""}`;function mo(){return new Map(Xe.map(e=>{let n=new Map;for(let t of ut){if(!t.baseBody)continue;let i=t.baseFace?[null,...st]:[null];for(let o of i)n.set(pt(t.id,o?.id??null),ho(t,e.radii,o))}return[e.radii,n]}))}var fo,xo=new Set(Xe.map(e=>e.radii));function ht(e,n,t){if(!e||!xo.has(e))return lt;let i=(fo??=mo()).get(e);return i?i.get(pt(n,t))??i.get(pt(n,null))??lt:lt}var dt={yaw:0,pitch:0,mix:0,spin:0,wander:1},bo=(e,n,t)=>({yaw:w(e.yaw,n.yaw,t),pitch:w(e.pitch,n.pitch,t),mix:w(e.mix,n.mix,t),spin:w(e.spin,n.spin,t),wander:w(e.wander,n.wander,t)}),an=(e,n,t)=>({w:w(e.w,n.w,t),h:w(e.h,n.h,t),open:w(e.open,n.open,t),tilt:w(e.tilt??0,n.tilt??0,t)});function cn(e,n,t){let i=1-t;return{sil:Vt(e.sil,n.sil,t),offX:w(e.offX,n.offX,t),offY:w(e.offY,n.offY,t),gaze:{yaw:w(e.gaze.yaw,n.gaze.yaw,t),pitch:w(e.gaze.pitch,n.gaze.pitch,t),roll:w(e.gaze.roll,n.gaze.roll,t)},split:w(e.split,n.split,t),eyes:[an(e.eyes[0],n.eyes[0],t),an(e.eyes[1],n.eyes[1],t)],eyeAlpha:w(e.eyeAlpha,n.eyeAlpha,t),bodyAlpha:w(e.bodyAlpha,n.bodyAlpha,t),dots:[...e.dots.map(o=>({...o,opacity:o.opacity*i})),...n.dots.map(o=>({...o,opacity:o.opacity*t}))],arcs:[...e.arcs.map(o=>({...o,id:`a${o.id}`,opacity:o.opacity*i})),...n.arcs.map(o=>({...o,id:`b${o.id}`,opacity:o.opacity*t}))],notif:e.notif&&n.notif?{x:w(e.notif.x,n.notif.x,t),y:w(e.notif.y,n.notif.y,t),r:w(e.notif.r,n.notif.r,t),notch:w(e.notif.notch,n.notif.notch,t)}:n.notif?{...n.notif,r:n.notif.r*t,notch:n.notif.notch*t}:e.notif?{...e.notif,r:e.notif.r*i,notch:e.notif.notch*i}:null,dotsBehind:t<.5?e.dotsBehind:n.dotsBehind}}var Ge=class e{scale;cur;prev=null;departFige=null;tCur=0;tPrev=0;blinkAt=-10;pts=[];shape=null;shapePrev=null;shapeAt=-10;expr=null;exprPrev=null;exprAt=-10;look=dt;lookPrev=dt;lookAt=-10;lookMorph=.24;static SHAPE_MORPH=.45;static LOOK_MORPH=.24;constructor(n=100,t="idle",i=null,o=null){this.scale=n,this.cur=t,this.shape=i,this.expr=o}setExpression(n,t=0){n!==this.expr&&(this.exprPrev=this.expr,this.expr=n,this.exprAt=t)}exprAtTime(n){let t=this.expr,i=this.exprPrev;if(!t||!i)return t;let o=(n-this.exprAt)/e.SHAPE_MORPH;return o>=1?t:Ut(i,t,_.easeOutQuint(I(o)))}setShape(n,t=0){n!==this.shape&&(this.shapePrev=this.shape,this.shape=n,this.shapeAt=t)}shapeAtTime(n){let t=this.shape,i=this.shapePrev;if(!t||!i)return t;let o=(n-this.shapeAt)/e.SHAPE_MORPH;if(o>=1)return t;let s=_.easeOutQuint(I(o));return t.map((r,a)=>w(i[a]??r,r,s))}setLook(n,t,i=e.LOOK_MORPH){n&&!Number.isFinite(n.yaw+n.pitch+n.mix+n.spin+n.wander)||(this.lookPrev=this.lookAtTime(t),this.look=n??dt,this.lookAt=t,this.lookMorph=i)}lookAtTime(n){let t=(n-this.lookAt)/this.lookMorph;return t>=1?this.look:bo(this.lookPrev,this.look,_.easeOutQuint(I(t)))}posed(n,t,i,o){let s=n.pose(t);return n.baseBody&&i&&(s={...s,sil:{...s.sil,radii:i}}),n.baseFace&&o&&(s={...s,gaze:o.gaze,split:o.split,eyes:o.eyes}),s}decalageAtTime(n,t){let i=(s,r,a,c)=>{if(a===c)return c;let u=(n-s)/r;if(u>=1)return c;let l=_.easeOutQuint(I(u));return{x:w(a.x,c.x,l),y:w(a.y,c.y,l)}},o=s=>i(this.exprAt,e.SHAPE_MORPH,ht(s,t,this.exprPrev?.id??null),ht(s,t,this.expr?.id??null));return i(this.shapeAt,e.SHAPE_MORPH,o(this.shapePrev),o(this.shape))}get state(){return this.cur}reset(n,t){this.cur=n,this.prev=null,this.departFige=null,this.tCur=t,this.tPrev=t,this.blinkAt=-10}origine(n,t,i){if(this.departFige)return this.departFige;if(!this.prev)return null;let o=Z.get(this.prev);return this.posed(o,Math.max(0,n-this.tPrev),t,i)}poseComposee(n){let t=Z.get(this.cur),i=this.shapeAtTime(n),o=this.exprAtTime(n),s=this.posed(t,Math.max(0,n-this.tCur),i,o),r=n-this.tCur;if(r>=t.morph)return s;let a=this.origine(n,i,o);return a?cn(a,s,_.easeOutQuint(I(r/t.morph))):s}setState(n,t){if(n===this.cur)return;let i=Z.get(this.cur).morph,o=this.prev!==null&&t-this.tCur<i;this.departFige=o?this.poseComposee(t):null,this.prev=this.cur,this.tPrev=this.tCur,this.cur=n,this.tCur=t,Z.get(n)?.blinkIn&&(this.blinkAt=t)}sample(n){let t=this.scale,i=Z.get(this.cur),o=this.shapeAtTime(n),s=this.exprAtTime(n),r=this.posed(i,Math.max(0,n-this.tCur),o,s),a=this.decalageAtTime(n,this.cur),c=n-this.tCur,u=c<i.morph?this.origine(n,o,s):null;if(u){let O=_.easeOutQuint(I(c/i.morph));r=cn(u,r,O);let N=this.prev;if(N){let H=this.decalageAtTime(n,N);a={x:w(H.x,a.x,O),y:w(H.y,a.y,O)}}}let l=r.eyeAlpha>.01,p=this.lookAtTime(n),m=Le(n,{wander:l?p.wander:0,blink:l}),f={yaw:w(r.gaze.yaw,p.yaw,p.mix)+m.dYaw-p.spin,pitch:w(r.gaze.pitch,p.pitch,p.mix)+m.dPitch,roll:r.gaze.roll+m.dRoll},g=I((n-this.blinkAt)/.2),M=g<1?Math.abs(g*2-1):1,h=Math.min(m.lid,M),x=r.offX+m.driftX,y=r.offY+m.driftY,d={...r.sil,cx:r.sil.cx+x,cy:r.sil.cy+y,sy:r.sil.sy*m.breath},v=qt(Ie(d,t,this.pts)),k=(O,N)=>ze(r.sil.radii,Math.atan2(N,O)-r.sil.rot),R=[];if(r.eyeAlpha>.01){let O=Be(f,t,r.split);for(let N=0;N<2;N++){let H=O[N];if(H.depth<=.02)continue;let q=r.eyes[N],J=k(H.x,H.y),de=(q.tilt??0)*Math.PI/180,D=Math.cos(de),ee=Math.sin(de),me=H.a*D+H.c*ee,j=H.b*D+H.d*ee,te=-H.a*ee+H.c*D,fe=-H.b*ee+H.d*D,xe=Xt(Math.min(h,q.open));R.push({width:q.w*t,height:q.h*t,openMatrix:`matrix(${b(me)},${b(j)},${b(te)},${b(fe)},${b(H.x*J+(x+a.x)*t)},${b(H.y*J+(y+a.y)*t)})`,lid:Math.min(h,q.open),d:jt(q.w*t,q.h*t),matrix:`matrix(${b(me)},${b(j*xe)},${b(te)},${b(fe*xe)},${b(H.x*J+(x+a.x)*t)},${b(H.y*J+(y+a.y)*t)})`,alpha:r.eyeAlpha*I(H.depth/.12)})}}let A=r.dots.filter(O=>O.opacity>.01&&O.r>5e-4).map(O=>({...O,x:(O.x+x)*t,y:(O.y+y)*t,r:O.r*t})),B=r.notif?k(r.notif.x,r.notif.y):1,S=r.notif?(r.notif.x*B+x)*t:0,F=r.notif?(r.notif.y*B+y)*t:0,Y=r.notif?{x:S,y:F,r:r.notif.r*t}:null,T=r.notif?{x:S,y:F,r:r.notif.notch*t}:null;return{bodyPath:v,bodyAlpha:r.bodyAlpha,eyes:R,dots:A,dotsBehind:r.dotsBehind,arcs:r.arcs.filter(O=>O.opacity>.01).map(O=>Rt(O.seed,O.t,t,O.id,O.opacity)),notif:Y,notch:T}}};var ke=new WeakMap;function un(e,n){let t=e.defaultView;if(e.body===void 0||t===null||typeof t.MutationObserver!="function")return()=>{};let i=ke.get(e);if(i===void 0){let s=new Set,r={listeners:s,queued:!1,records:[]},a=()=>{if(r.queued=!1,delete r.frame,ke.get(e)!==r)return;let c=r.records;r.records=[];for(let u of[...s])try{u(c)}catch(l){t.setTimeout(()=>{throw l},0)}};r.observer=new t.MutationObserver((c=[])=>{r.records.push(...c),!r.queued&&(r.queued=!0,typeof t.requestAnimationFrame=="function"?r.frame=t.requestAnimationFrame(a):queueMicrotask(a))}),r.observer.observe(e.body,{childList:!0,subtree:!0}),ke.set(e,r),i=r}i.listeners.add(n);let o=!0;return()=>{if(!o)return;o=!1;let s=ke.get(e);s!==void 0&&(s.listeners.delete(n),!(s.listeners.size>0)&&(s.observer?.disconnect(),s.frame!==void 0&&t.cancelAnimationFrame(s.frame),ke.delete(e)))}}var mt="[data-slot='sidebar']",Pe={sidebar:mt,sidebarShell:`#root ${mt} > div`,sidebarColumn:`#root :has(> ${mt})`,composerCard:"#root [data-composer-card='true']",composerHeroMark:"#root .xiaohei-brand-mark[data-brand-context='hero']",composerHeroRow:"[class*='_headline']"};var Ue=De(2.2,1,.89).map((e,n,t)=>{let i=n/t.length*Math.PI*2,o=(s,r,a)=>{let c=Math.atan2(Math.sin(i-s),Math.cos(i-s));return a*Math.exp(-.5*(c/r)**2)};return e*(1+.016*Math.sin(i))+o(6.12,.12,.065)+o(3.3,.12,.065)+o(4.04,.1,.025)}),hn={id:"neutre",gaze:{yaw:0,pitch:-7,roll:-2},split:26,eyes:[{w:.355,h:.48,open:1},{w:.34,h:.465,open:1}]},ft=Math.max(...Ue.map((e,n)=>e*Math.sin(n/Ue.length*Math.PI*2)))*100,ue={x:0,y:0,sx:1,sy:1,roll:0,lid:1,cheer:0},Ve=["greet","hop","wiggle"],ln=e=>{let n=Math.max(0,Math.min(1,e));return n*n*(3-2*n)},yo=e=>({...ue,...e}),go=Object.keys(ue);function pn(e,n,t){if(n===0||n===e.length-1)return 0;let i=e[n-1],o=e[n],s=e[n+1],r=o.at-i.at,a=s.at-o.at,c=(o.pose[t]-i.pose[t])/r,u=(s.pose[t]-o.pose[t])/a;if(c*u<=0)return 0;let l=2*a+r,p=a+2*r;return(l+p)/(l/c+p/u)}var Ye=class{start=0;keys=[];hover=0;hoverAt=0;hoverFrom=0;hoverTo=0;get end(){return this.start+(this.keys.at(-1)?.at??0)}reset(){this.keys=[],this.hover=this.hoverFrom=this.hoverTo=0}settle(n){let t=this.track(n);this.start=n,this.keys=[{at:0,pose:t},{at:.22,pose:{...ue}}],this.aim(0,n)}aim(n,t){this.hover=this.hoverFrom+(this.hoverTo-this.hoverFrom)*ln((t-this.hoverAt)/.28),this.hoverFrom=this.hover,this.hoverTo=Math.max(-1,Math.min(1,n)),this.hoverAt=t}track(n){if(!this.keys.length||n>=this.end)return{...ue};let t=Math.max(0,n-this.start),i=this.keys[0];for(let o=1;o<this.keys.length;o++){let s=this.keys[o];if(t<=s.at){let r=s.at-i.at,a=(t-i.at)/r,c=a*a,u=c*a,l={...i.pose};for(let p of go)l[p]=(2*u-3*c+1)*i.pose[p]+(-2*u+3*c)*s.pose[p]+(u-2*c+a)*r*pn(this.keys,o-1,p)+(u-c)*r*pn(this.keys,o,p);return l}i=s}return{...ue}}play(n,t,i=1){let o=this.track(t),s=i<0?-1:1,r=[{at:0,pose:o}],a=(c,u)=>r.push({at:c,pose:yo(u)});n==="greet"?(a(.09,{lid:.25,sy:.99,cheer:.35}),a(.16,{lid:0,sy:.985,cheer:.35,roll:-2*s}),a(.26,{y:-2,sy:1.005,roll:1*s}),a(.43,{y:-7,sx:.99,sy:1.015,roll:3*s}),a(.67,{sx:1.018,sy:.982,roll:-1*s}),a(.95,{})):n==="hop"?(a(.12,{sx:1.065,sy:.94,lid:.85,roll:-2*s}),a(.23,{sx:.97,sy:1.045,y:-14,roll:2*s}),a(.4,{sx:.99,sy:1.02,y:-28,roll:3*s}),a(.57,{sy:1.015,y:-14,roll:1*s}),a(.69,{sx:1.06,sy:.94,lid:.55,cheer:.3}),a(.8,{sx:.985,sy:1.02}),a(1.02,{})):(a(.18,{x:-2*s,roll:-7*s}),a(.38,{x:2*s,roll:7*s}),a(.55,{x:-1*s,roll:-3*s,lid:.3,cheer:.2}),a(.64,{roll:-1*s,lid:0,cheer:.2}),a(.78,{}),a(.96,{})),this.start=t,this.keys=r}sample(n){let t=this.track(n);return this.hover=this.hoverFrom+(this.hoverTo-this.hoverFrom)*ln((n-this.hoverAt)/.28),t.roll+=this.hover*5,t.x+=this.hover*4,t}};var Eo="http://www.w3.org/2000/svg";function dn(e,n,t,i,o,s){let r=h=>e.createElementNS(Eo,h),a=(h,x)=>{for(let[y,d]of Object.entries(x)){let v=String(d);h.getAttribute(y)!==v&&h.setAttribute(y,v)}},c=r("g"),u=r("g");i.append(c),o.append(u);let l=r("mask"),p=r("rect"),m=r("circle"),f=r("circle");a(l,{id:`${n}-notification`,maskUnits:"userSpaceOnUse",x:-200,y:-200,width:400,height:400,"mask-type":"luminance"}),a(p,{x:-200,y:-200,width:400,height:400,fill:"white"}),a(m,{fill:"black",r:0,"data-heixiu-notch":""}),a(f,{fill:"#dca964",display:"none","data-heixiu-notification":""}),l.append(p,m),t.append(l),o.append(f);let g=Array.from({length:12},()=>{let h=r("path");return a(h,{display:"none","data-heixiu-particle":""}),u.append(h),h}),M=Array.from({length:12},(h,x)=>{let y=r("linearGradient"),d=r("path"),v=r("path");a(y,{id:`${n}-arc-${x}`,gradientUnits:"userSpaceOnUse"});let k=Array.from({length:3},()=>r("stop"));y.append(...k),t.append(y);for(let R of[d,v])a(R,{fill:"none","stroke-linecap":"round",stroke:`url(#${n}-arc-${x})`,display:"none","data-heixiu-orbit":""});return i.append(d),o.append(v),{gradient:y,back:d,fore:v,stops:k}});return h=>{h.notif&&h.notch?(a(s,{mask:`url(#${n}-notification)`}),a(m,{cx:h.notch.x,cy:h.notch.y,r:h.notch.r}),a(f,{display:"inline",cx:h.notif.x,cy:h.notif.y,r:h.notif.r})):(s.getAttribute("mask")&&s.removeAttribute("mask"),a(m,{r:0}),a(f,{display:"none"}));for(let[x,y]of g.entries()){let d=h.dots[x];if(!d){a(y,{display:"none"});continue}let v=h.dotsBehind?c:u;y.parentNode!==v&&v.append(y);let k=d.r;a(y,{display:"inline",d:d.d??`M${-k} 0a${k} ${k} 0 1 0 ${k*2} 0a${k} ${k} 0 1 0 ${-k*2} 0`,transform:`translate(${d.x} ${d.y}) rotate(${d.rot??0}) scale(${d.d?100:1})`,fill:d.color??"var(--heixiu-ink)",opacity:d.opacity*(d.depth??1)})}for(let[x,y]of M.entries()){let d=h.arcs[x];if(!d){a(y.back,{display:"none"}),a(y.fore,{display:"none"});continue}a(y.gradient,{x1:d.grad.x1,y1:d.grad.y1,x2:d.grad.x2,y2:d.grad.y2});for(let[v,k]of y.stops.entries())a(k,{offset:v/2,"stop-color":d.grad.stops[Math.min(v,d.grad.stops.length-1)]??"#ddd"});for(let[v,k]of[[y.back,d.back],[y.fore,d.front]])a(v,{display:"inline",d:k,"stroke-width":d.width,opacity:d.opacity})}}}var Mo="http://www.w3.org/2000/svg",wo=0;function mn(e,n){let t=Math.max(0,Math.min(1,(e-20)/12));return{rx:Math.max(.01,Math.min(e,38)*(1+.15*t)),ry:Math.max(.01,Math.min(n,62)*.96)}}function vo(e){if(e.length!==2)return 1;let n=e.map(l=>l.openMatrix.slice(7,-1).split(/[ ,]+/).map(Number)),[t,i]=n;if(!t||!i||t.length!==6||i.length!==6||[...t,...i].some(l=>!Number.isFinite(l)))return 1;let o=i[4]-t[4],s=i[5]-t[5],r=Math.hypot(o,s);if(r<1)return .1;let a=o/r,c=s/r,u=e.reduce((l,p,m)=>{let f=n[m],{rx:g,ry:M}=mn(p.width,p.height);return l+Math.hypot(g*(f[0]*a+f[1]*c),M*(f[2]*a+f[3]*c))},0);return Math.min(1,Math.max(.1,(r-10)/Math.max(1,u)))}function fn(e){let n=h=>e.createElementNS(Mo,h),t=(h,x)=>{for(let[y,d]of Object.entries(x)){let v=String(d);h.getAttribute(y)!==v&&h.setAttribute(y,v)}},i=n("svg"),o=n("defs"),s=n("clipPath"),r=n("path"),a=`xiaohei-bloub-${++wo}`;t(i,{viewBox:`${-158} ${-158} ${316} ${316}`,"aria-hidden":"true",focusable:"false"}),t(s,{id:`${a}-body`,clipPathUnits:"userSpaceOnUse"}),s.append(r),o.append(s);let c=n("g"),u=n("path"),l=n("g");t(u,{fill:"var(--heixiu-ink)",stroke:"var(--heixiu-outline)","stroke-width":1.2,"data-heixiu-body":""}),t(l,{"clip-path":`url(#${a}-body)`,fill:"none",stroke:"#f5f3db","stroke-width":10.5});let p=[n("path"),n("path")];for(let h of p)t(h,{"data-heixiu-eye":"","stroke-linecap":"round","stroke-linejoin":"round"});l.append(...p),c.append(u,l);let m=n("g");t(m,{"data-heixiu-character":""}),m.append(c),i.append(o,m);let f;function g(){if(f)return;let h=n("g"),x=n("g");m.insertBefore(h,c),m.append(x),f=dn(e,a,o,h,x,c)}function M(h,x=ue){t(m,{transform:`translate(${x.x} ${x.y+ft}) rotate(${x.roll}) scale(${x.sx} ${x.sy}) translate(0 ${-ft})`}),t(u,{d:h.bodyPath}),t(r,{d:h.bodyPath}),t(c,{opacity:h.bodyAlpha});let y=vo(h.eyes);for(let[d,v]of p.entries()){let k=h.eyes[d];if(!k){t(v,{opacity:0});continue}let R=mn(k.width,k.height),A=R.rx*y,B=R.ry*y,S=Math.max(0,Math.min(k.lid,x.lid)),F=-A*.26*x.cheer*(1-S),Y=F-B*S*1.3333,T=F+B*S*1.3333,O=`M${-A} 0C${-A} ${Y} ${A} ${Y} ${A} 0C${A} ${T} ${-A} ${T} ${-A} 0Z`;t(v,{d:O,transform:k.openMatrix,opacity:k.alpha,"stroke-width":Math.min(10.5,A*.28)})}f?.(h)}return{svg:i,render:M,prepareEffects:g}}function xn(e,n,t){let i=t>760&&e-n>=114;return{mode:i?"outside":"compact",size:i?96:52}}function bn(e,n,t,i){if(e.width<=0||e.height<=0||e.top+e.height>n.top)return;let o=i<=760?52:96,s=Math.max(t+6,e.left-o-(o===52?10:24));return{size:o,left:s-n.left,top:e.top+e.height/2-o/2-n.top}}function yn(e,n,t,i){let o=i?.size??t.size;return i?{left:e.left+n.left+i.left,top:e.top+n.top+i.top,width:o,height:o}:t.mode==="compact"?{left:e.left+n.left+4,top:e.top+n.top+6,width:o,height:o}:{left:e.left+n.left-18-o,top:e.top+e.height/2-o/2,width:o,height:o}}function gn(e,n){return!Number.isFinite(e)||!Number.isFinite(n)?{yaw:0,pitch:-7,mix:1,spin:0,wander:.35}:{yaw:Math.max(-14,Math.min(14,e/16)),pitch:-7-Math.max(-31,Math.min(9,n/16)),mix:1,spin:0,wander:0}}function En(e,n,t){if(!Number.isFinite(e)||!Number.isFinite(n))return{x:0,y:0};let i=Math.hypot(e,n),o=t?90:140;if(i>=o)return{x:0,y:0};let s=Math.max(0,Math.min(1,(i-o*.5)/(o*.5))),r=1-s*s*(3-2*s),a=Math.max(t?32:50,i);return{x:e/a*(t?2:5)*r,y:n/a*(t?1.5:3.5)*r}}var Mn=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function wn(e){let n,t,i=()=>n?.playState==="running",o=()=>Math.max(0,Math.min(1,n?.effect?.getComputedTiming().progress??0)),s=(c,u)=>["left","top","width","height"].every(l=>Math.abs(c[l]-u[l])<1);function r(c){if(!i()||!t)return c;let u=o(),l=p=>t.from[p]+(t.to[p]-t.from[p])*u;return{left:l("left"),top:l("top"),width:l("width"),height:l("height")}}function a(){n&&(n.onfinish=null,n.cancel(),n=void 0),t=void 0,e.dataset.flying="false"}return{get active(){return i()},capture:r,target(c){if(!i()||!t)return c;let u=o(),{from:l,to:p}=t,m=l.width/p.width*(1-u)+u,f=c.width/m,g=c.height/m,M=(l.left+l.width/2-p.left-p.width/2)*(1-u),h=(l.top+l.height/2-p.top-p.height/2)*(1-u);return{left:c.left-M+(c.width-f)/2,top:c.top-h+(c.height-g)/2,width:f,height:g}},move(c,u,l){if(!l&&i()&&t&&s(t.to,u))return;let p=i()&&t?Math.max(80,t.duration-Number(n.currentTime??0)):950;if(a(),!c||l||typeof e.animate!="function"||!c.width||!u.width)return;let m=c.left+c.width/2-u.left-u.width/2,f=c.top+c.height/2-u.top-u.height/2;if(Math.hypot(m,f)<4&&Math.abs(c.width-u.width)<1)return;t={from:Mn(c),to:Mn(u),duration:p},n=e.animate([{transform:`translate(${m}px, ${f}px) scale(${c.width/u.width})`},{transform:"translate(0px, 0px) scale(1)"}],{duration:p,easing:"cubic-bezier(.22,.75,.2,1)"}),e.dataset.flying="true";let g=n;g.onfinish=()=>{n===g&&a()}},cancel:a}}var vn=e=>Number.isFinite(e)?Math.max(0,Math.min(.999999,e)):.5;function Sn(e=Math.random){return 2e4+Math.floor(vn(e())*2e4)}function In(e,n,t=Math.random){if(e<=1)return 0;let i=n>=0&&n<e,o=Math.floor(vn(t())*(i?e-1:e));return i&&o>=n?o+1:o}var kn=`
|
|
3
|
+
#root [data-composer-card] > button.xiaohei-bloub {
|
|
4
|
+
all: unset;
|
|
5
|
+
--heixiu-ink: #111214;
|
|
6
|
+
--heixiu-outline: rgba(245,243,215,.16);
|
|
7
|
+
position: absolute;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
display: block;
|
|
10
|
+
width: 96px;
|
|
11
|
+
height: 96px;
|
|
12
|
+
min-width: 44px;
|
|
13
|
+
min-height: 44px;
|
|
14
|
+
right: calc(100% + 18px);
|
|
15
|
+
top: calc(50% - 48px);
|
|
16
|
+
margin: 0 !important;
|
|
17
|
+
padding: 0 !important;
|
|
18
|
+
border: 0 !important;
|
|
19
|
+
border-radius: 50%;
|
|
20
|
+
background: none !important;
|
|
21
|
+
box-shadow: none !important;
|
|
22
|
+
color: inherit;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
touch-action: manipulation;
|
|
25
|
+
user-select: none;
|
|
26
|
+
-webkit-tap-highlight-color: transparent;
|
|
27
|
+
/* Flight owns this transform. A CSS transition would replay cancelled
|
|
28
|
+
WAAPI transforms and corrupt the next target measurement. */
|
|
29
|
+
transition: none;
|
|
30
|
+
z-index: 3;
|
|
31
|
+
}
|
|
32
|
+
#root [data-composer-card] > button.xiaohei-bloub:focus-visible {
|
|
33
|
+
outline: 2px solid var(--dsw-alias-label-secondary);
|
|
34
|
+
outline-offset: -7px;
|
|
35
|
+
}
|
|
36
|
+
#root [data-composer-card] > button.xiaohei-bloub > .xiaohei-bloub-drift {
|
|
37
|
+
display: block;
|
|
38
|
+
width: 100%; height: 100%;
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
--heixiu-drift-x: 7px;
|
|
41
|
+
--heixiu-drift-y: 10px;
|
|
42
|
+
animation: xiaohei-bloub-float 14s cubic-bezier(.45,0,.55,1) infinite;
|
|
43
|
+
animation-play-state: paused;
|
|
44
|
+
}
|
|
45
|
+
#root [data-composer-card] > button.xiaohei-bloub[data-floating='true'] > .xiaohei-bloub-drift {
|
|
46
|
+
animation-play-state: running;
|
|
47
|
+
}
|
|
48
|
+
@keyframes xiaohei-bloub-float {
|
|
49
|
+
0%, 100% { transform: translate(calc(-1 * var(--heixiu-drift-x)), var(--heixiu-drift-y)); }
|
|
50
|
+
50% { transform: translate(var(--heixiu-drift-x), calc(-1 * var(--heixiu-drift-y))); }
|
|
51
|
+
}
|
|
52
|
+
#root [data-composer-card] > button.xiaohei-bloub > .xiaohei-bloub-drift > svg {
|
|
53
|
+
display: block;
|
|
54
|
+
width: 100%; height: 100%;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
transform: translate(var(--heixiu-follow-x, 0px), var(--heixiu-follow-y, 0px));
|
|
58
|
+
transition: transform 480ms cubic-bezier(.2,.75,.25,1);
|
|
59
|
+
}
|
|
60
|
+
#root [data-composer-card] > button.xiaohei-bloub:active > .xiaohei-bloub-drift > svg {
|
|
61
|
+
transform: translate(var(--heixiu-follow-x, 0px), var(--heixiu-follow-y, 0px)) scale(.98);
|
|
62
|
+
}
|
|
63
|
+
#root [data-composer-card][data-heixiu-dock='compact'] {
|
|
64
|
+
padding-inline-start: 64px !important;
|
|
65
|
+
}
|
|
66
|
+
#root [data-composer-card][data-heixiu-dock='compact'] > button.xiaohei-bloub {
|
|
67
|
+
width: 52px; height: 52px;
|
|
68
|
+
right: auto; left: 4px; top: 6px;
|
|
69
|
+
}
|
|
70
|
+
#root [data-composer-card][data-heixiu-dock='compact'] .xiaohei-bloub-drift {
|
|
71
|
+
--heixiu-drift-x: 2px;
|
|
72
|
+
--heixiu-drift-y: 3px;
|
|
73
|
+
}
|
|
74
|
+
#root [data-composer-card][data-heixiu-dock='welcome'] > button.xiaohei-bloub {
|
|
75
|
+
right: auto;
|
|
76
|
+
left: var(--heixiu-welcome-left);
|
|
77
|
+
top: var(--heixiu-welcome-top);
|
|
78
|
+
width: var(--heixiu-welcome-size);
|
|
79
|
+
height: var(--heixiu-welcome-size);
|
|
80
|
+
}
|
|
81
|
+
@media (max-width: 760px) {
|
|
82
|
+
#root [data-heixiu-hero-row] { box-sizing: border-box; padding-inline-start: 64px; max-width: 100%; }
|
|
83
|
+
#root [data-composer-card][data-heixiu-dock='welcome'] .xiaohei-bloub-drift {
|
|
84
|
+
--heixiu-drift-x: 2px;
|
|
85
|
+
--heixiu-drift-y: 4px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
#root [data-composer-card] > button.xiaohei-bloub[hidden] { display: none; }
|
|
89
|
+
@media (prefers-reduced-motion: reduce) {
|
|
90
|
+
#root [data-composer-card] > button.xiaohei-bloub { transition: none; transform: none; }
|
|
91
|
+
#root [data-composer-card] > button.xiaohei-bloub > .xiaohei-bloub-drift { animation: none; transform: none; }
|
|
92
|
+
#root [data-composer-card] > button.xiaohei-bloub > .xiaohei-bloub-drift > svg { transition: none; transform: none; }
|
|
93
|
+
}
|
|
94
|
+
@media print {
|
|
95
|
+
#root [data-composer-card] > button.xiaohei-bloub { display: none; }
|
|
96
|
+
#root [data-composer-card][data-heixiu-dock='compact'] { padding-inline-start: 12px !important; }
|
|
97
|
+
}
|
|
98
|
+
`;var Pn=["burst","egg","orbit","hexagon","wink","wide","exclaim","alert","sleep","thinking","notify"],xt=["burst","egg","orbit","hexagon","wink","wide","sleep"];function An(e=typeof document>"u"?void 0:document,n){let t=e?.defaultView;if(!e||!t)return()=>{};let i=e.createElement("style");i.textContent=kn,e.head.append(i);let o=e.createElement("button");o.className="xiaohei-bloub",o.type="button",o.setAttribute("aria-label","\u9017\u9017\u563F\u54BB"),o.title="\u5355\u51FB\u9017\u9017\u563F\u54BB \xB7 \u53CC\u51FB\u8F6E\u6362\u53D8\u5F62\uFF08\u952E\u76D8 Shift+Enter\uFF09";let s=fn(e),r=e.createElement("span");r.className="xiaohei-bloub-drift",r.append(s.svg),o.append(r);let a=wn(o),c=new Ge(100,"idle",Ue,hn),u=new Ye,l={yaw:0,pitch:-7,mix:1,spin:0,wander:.35},p=l;c.setLook(l,0),s.render(c.sample(0));let m=!1,f=!1,g=!0,M=null,h=null,x=null,y=null,d,v,k,R,A,B=-1/0,S=0,F,Y=2.5,T=0,O=0,N=1,H=!1,q=0,J="",de="",D,ee=-1,me=-1/0,j=n?.getSnapshot(),te,fe=t.innerWidth,xe=t.innerHeight,be=t.matchMedia("(prefers-reduced-motion: reduce)"),le=typeof t.ResizeObserver=="function"?new t.ResizeObserver(()=>{g=!0,ye()}):void 0,bt=typeof t.IntersectionObserver=="function"?new t.IntersectionObserver(E=>{let P=E.find(L=>L.target===o);P&&(f=P.isIntersecting,pe())}):void 0;function Ae(){o.dataset.floating="false",He(0,0),D!==void 0&&t.clearTimeout(D),D=void 0,a.cancel(),k!==void 0&&t.cancelAnimationFrame(k),A!==void 0&&t.clearTimeout(A),R!==void 0&&t.clearTimeout(R),k=void 0,A=void 0,R=void 0,F=void 0}function He(E,P){let L=En(E,P,t.innerWidth<=760||M?.dataset.heixiuDock==="compact"),G=`${L.x.toFixed(3)}px`,ie=`${L.y.toFixed(3)}px`;G!==J&&(o.style.setProperty("--heixiu-follow-x",G),J=G),ie!==de&&(o.style.setProperty("--heixiu-follow-y",ie),de=ie)}function X(){return!m&&f&&!!M?.isConnected&&!e.hidden&&!be.matches}function Oe(E=Sn()){D!==void 0&&t.clearTimeout(D),D=void 0,X()&&(D=t.setTimeout(()=>{if(D=void 0,!!X()){if(T||j?.running||a.active||Date.now()-me<5e3){Oe(5e3);return}oe(xt[In(xt.length,ee)],"ambient")}},E))}function ne(E){Y=Math.max(Y,S+E),!(!X()||k!==void 0||A!==void 0)&&(R!==void 0&&t.clearTimeout(R),R=void 0,F=void 0,k=t.requestAnimationFrame(yt))}function yt(E){if(k=void 0,!X()){Ae();return}F!==void 0&&(S+=Math.min(.05,Math.max(0,(E-F)/1e3))),F=E,T&&S>=T&&(H=!1,c.setLook(p,S),T=0,c.setState("idle",S),o.dataset.action="idle",Y=Math.max(Y,S+.65),j?.running&&oe("thinking","session",!0)),s.render(c.sample(S),u.sample(S)),S<Y||T||Le(S).lid<.99?A=t.setTimeout(()=>{A=void 0,X()&&(k=t.requestAnimationFrame(yt))},1e3/30):(F=void 0,R=t.setTimeout(()=>{R=void 0,ne(1)},8e3))}function pe(){X()?(o.dataset.floating="true",ne(1),j?.running&&!T&&oe("thinking","session",!0),D===void 0&&Oe()):(Ae(),be.matches&&(c.reset("idle",S),c.setLook(l,S,.001),T=0,H=!1,u.reset(),S+=1,s.render(c.sample(S)),o.dataset.action="idle"))}function Hn(){if(v=void 0,m)return;let E=e.querySelector(Pe.composerCard),P=e.querySelector(Pe.sidebarShell),L=e.querySelector(Pe.composerHeroMark),G=!1;if((M!==E||h!==P||x!==L)&&(M?.removeAttribute("data-heixiu-dock"),le?.disconnect(),y?.removeAttribute("data-heixiu-hero-row"),M=E,h=P,x=L,g=!0,y=x?.closest(Pe.composerHeroRow)??null,y?.setAttribute("data-heixiu-hero-row",""),M&&le?.observe(M),h&&le?.observe(h),x&&le?.observe(x),y&&le?.observe(y),G=!0),!M){o.remove(),f=!1,Ae();return}if(o.parentElement!==M||M.lastElementChild===o){let Qe=[...M.children].reverse().find(Ze=>Ze!==o);o.hidden=!0,M.insertBefore(o,Qe??null),bt?.observe(o),g=!0,G=!0}if(G){ye();return}if(!g)return;g=!1;let ie=a.active,Tn=fe!==t.innerWidth||xe!==t.innerHeight,$n=a.capture(d),ge=M.getBoundingClientRect(),Bn={left:M.clientLeft||0,top:M.clientTop||0},St=h?.getBoundingClientRect().right??0,It=xn(ge.left,St,t.innerWidth),kt=x?.getBoundingClientRect(),Re=kt&&bn(kt,ge,St,t.innerWidth),Ln=yn(ge,Bn,It,Re||void 0);if(He(0,0),Re)for(let[Qe,Ze]of Object.entries(Re)){let Pt=`--heixiu-welcome-${Qe}`,At=`${Ze}px`;o.style.getPropertyValue(Pt)!==At&&o.style.setProperty(Pt,At)}let Ee=Re?"welcome":It.mode,_n=!Tn&&(ie||!!te&&te!==Ee&&(te==="welcome"||Ee==="welcome"));te=Ee,fe=t.innerWidth,xe=t.innerHeight,M.dataset.heixiuDock!==Ee&&(M.dataset.heixiuDock=Ee),d=Ln,o.hidden=!1,f=ge.width>0&&ge.height>0&&d.top+d.height>0&&d.top<t.innerHeight,pe(),X()&&_n?a.move($n,d,be.matches):a.cancel()}function ye(){m||v!==void 0||(v=t.requestAnimationFrame(Hn))}let gt=E=>{if(!X()||a.active||!d?.width)return;if(E.pointerType==="touch"){We();return}if(E.timeStamp-B<1e3/30)return;B=E.timeStamp;let P=E.clientX-(d.left+d.width/2),L=E.clientY-(d.top+d.height/2);He(P,L),p=gn(P,L),!H&&(N=P<0?-1:1,u.aim(Math.abs(P)<90&&Math.abs(L)<90?P/60:0,S),c.setLook(p,S),ne(.8))},We=()=>{He(0,0),p=l,X()&&!H&&(u.aim(0,S),c.setLook(l,S),ne(.8))},Et=E=>{if(E.stopPropagation(),!X()||E.detail>1||H&&E.detail>0)return;let P=O++%(Ve.length+1);if(P===Ve.length){oe("exclaim","manual");return}let L=Ve[P];H=!1,c.setState("idle",S),c.setLook(p,S),u.play(L,S,N),o.dataset.action=L,o.dataset.actionSource="manual",Oe(),T=u.end,ne(T-S+.65)};function oe(E,P,L=!1){let G=Z.get(E);s.prepareEffects(),u.settle(S),H=!0,c.setLook(null,S),c.setState(E,S),o.dataset.action=E,ee=xt.findIndex(ie=>ie===E),o.dataset.actionSource=P,T=L?1/0:S+Math.max(G.duration,G.minDuration??0),ne(Math.max(G.duration,G.minDuration??0)+.65),Oe()}let Ke=E=>{E.stopPropagation(),X()&&oe(Pn[q++%Pn.length],"manual")},Mt=E=>{E.key==="Enter"&&E.shiftKey&&(E.preventDefault(),E.repeat||Ke(E))},je=()=>{g=!0,ye()},wt=E=>{M?.contains(E.target)&&(me=Date.now())},On=n?.subscribe(()=>{let E=n.getSnapshot(),P=E.sessionId!==j?.sessionId;if(j=E,o.dataset.sessionState=E.running?"running":"idle",!X()){(T===1/0||o.dataset.actionSource==="session"||P)&&(T=0,H=!1,c.setState("idle",S),c.setLook(p,S),o.dataset.action="idle");return}(P||T===1/0&&!E.running)&&(T=0,H=!1,c.setState("idle",S),c.setLook(p,S),o.dataset.action="idle",ne(.65)),!P&&E.notice?oe(E.notice,"session"):E.running&&(!T||o.dataset.actionSource!=="session")&&oe("thinking","session",!0)})??(()=>{}),Rn=un(e,E=>{E.length&&E.every(P=>(P.target.nodeType===1?P.target:P.target.parentElement)?.closest("[data-chat-flow], .xiaohei-bloub"))||ye()}),vt=E=>{let P=E.target;(P===e||P===t||P instanceof t.Element&&(P.contains(M)||P.contains(h)))&&je()};return e.addEventListener("pointermove",gt,{passive:!0}),e.addEventListener("pointerleave",We),e.addEventListener("visibilitychange",pe),e.addEventListener("input",wt,{passive:!0}),o.addEventListener("click",Et),o.addEventListener("dblclick",Ke),o.addEventListener("keydown",Mt),t.addEventListener("resize",je,{passive:!0}),t.addEventListener("scroll",vt,{passive:!0,capture:!0}),be.addEventListener("change",pe),ye(),()=>{m=!0,Ae(),Rn(),On(),le?.disconnect(),bt?.disconnect(),v!==void 0&&t.cancelAnimationFrame(v),e.removeEventListener("pointermove",gt),e.removeEventListener("pointerleave",We),e.removeEventListener("visibilitychange",pe),o.removeEventListener("click",Et),e.removeEventListener("input",wt),o.removeEventListener("dblclick",Ke),o.removeEventListener("keydown",Mt),t.removeEventListener("resize",je),t.removeEventListener("scroll",vt,!0),be.removeEventListener("change",pe),y?.removeAttribute("data-heixiu-hero-row"),M?.removeAttribute("data-heixiu-dock"),o.remove(),i.remove()}}
|
|
99
|
+
return module.exports; } });
|
|
100
|
+
//# sourceMappingURL=client.companion.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({ id: "@lemoncat7/dsh-theme-xiaohei", chunk: "client.decorations.js", factory: (require) => { var module = { exports: {} }; var exports = module.exports;
|
|
2
|
+
"use strict";var Q=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var Ae=Object.getOwnPropertyNames;var Ie=Object.prototype.hasOwnProperty;var Te=(e,r)=>{for(var t in r)Q(e,t,{get:r[t],enumerable:!0})},_e=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Ae(r))!Ie.call(e,o)&&o!==t&&Q(e,o,{get:()=>r[o],enumerable:!(i=Re(r,o))||i.enumerable});return e};var ke=e=>_e(Q({},"__esModule",{value:!0}),e);var De={};Te(De,{installDecorations:()=>Se});module.exports=ke(De);var B=new WeakMap;function oe(e,r){let t=e.defaultView;if(e.body===void 0||t===null||typeof t.MutationObserver!="function")return()=>{};let i=B.get(e);if(i===void 0){let a=new Set,n={listeners:a,queued:!1,records:[]},d=()=>{if(n.queued=!1,delete n.frame,B.get(e)!==n)return;let s=n.records;n.records=[];for(let u of[...a])try{u(s)}catch(h){t.setTimeout(()=>{throw h},0)}};n.observer=new t.MutationObserver((s=[])=>{n.records.push(...s),!n.queued&&(n.queued=!0,typeof t.requestAnimationFrame=="function"?n.frame=t.requestAnimationFrame(d):queueMicrotask(d))}),n.observer.observe(e.body,{childList:!0,subtree:!0}),B.set(e,n),i=n}i.listeners.add(r);let o=!0;return()=>{if(!o)return;o=!1;let a=B.get(e);a!==void 0&&(a.listeners.delete(r),!(a.listeners.size>0)&&(a.observer?.disconnect(),a.frame!==void 0&&t.cancelAnimationFrame(a.frame),B.delete(e)))}}var U="[data-slot='sidebar']",ee={sidebar:U,sidebarShell:`#root ${U} > div`,sidebarColumn:`#root :has(> ${U})`,composerCard:"#root [data-composer-card='true']",composerHeroMark:"#root .xiaohei-brand-mark[data-brand-context='hero']",composerHeroRow:"[class*='_headline']"};var se="dsh-theme-xiaohei/scene-layer";var W={pose:"hidden",left:0,top:0,width:0,height:0},te=.71,ce=.63,He=.44;function de(e){let{sidebar:r,scroll:t,flow:i,viewportWidth:o,viewportHeight:a,controls:n}=e,d=Math.min(r.bottom,a)-148,s=Math.max(r.top+24,96);if(d-s<130||r.right>i.left)return W;let u=i.right+56,h=Math.min(250,t.right-u-20,(d-s)*te,340*te);if(h>=190){let l=h/te;return{pose:"seated",left:t.right-h-16,top:s+(d-s-l)*.6,width:h,height:l}}let c=o>760?52:0,f=i.left-c-r.right;if(f>=66){let l=Math.min(104,f-12,(d-s)*ce),_=l/ce;return{pose:"peek",left:r.right-6,top:s+Math.min(160,(d-s-_)*.5),width:l,height:_}}if(r.right-r.left>100)return W;let p=r.left+7,m=Math.min(60,i.left-c-p-10);if(m<40)return W;let g=m/He,v=n.filter(l=>l.right>p&&l.left<p+m).map(l=>({start:Math.max(s,l.top-12),end:Math.min(d,l.bottom+12)})).filter(l=>l.end>l.start).sort((l,_)=>l.start-_.start),b=s,E={start:s,end:s};for(let l of[...v,{start:d,end:d}])l.start-b>E.end-E.start&&(E={start:b,end:l.start}),b=Math.max(b,l.end);return E.end-E.start<g+12?W:{pose:"halfpeek",left:p,top:E.start+(E.end-E.start-g)*.45,width:m,height:g}}function ue(e,r){let t="seated",i=e.now(),o,a=!0,n=!1,d=()=>{o!==void 0&&e.clearTimeout(o),o=void 0},s=c=>{c!==t&&(t=c,r(c))},u=()=>{if(d(),a||n||t==="doze")return;let c=t==="seated"?3e4:18e4;o=e.setTimeout(h,Math.max(1,i+c-e.now()))};function h(){if(o=void 0,a||n)return;let c=e.now()-i;s(c>=18e4?"doze":c>=3e4?"chin":"seated"),u()}return{get pose(){return t},activity(){if(a||n)return;let c=e.now();t==="seated"&&c-i<1e3||(i=c,t!=="seated"&&(s("seated"),u()))},setPaused(c){n||c===a||(a=c,d(),i=e.now(),s("seated"),a||u())},dispose(){n=!0,d()}}}var Y=["seated","peek","chin","doze","halfpeek"];function Le(e){let r=new Map;function t(i){let o=r.get(i);return o||(o=Promise.resolve().then(()=>e(i)).catch(a=>{throw r.delete(i),a}),r.set(i,o)),o}return{async pose(i,o){return(await t(`./client.pose-${i}-${o}.js`)).image},async rig(i,o){return i==="doze"||!Y.includes(i)?void 0:(await t(`./client.rig-${i}-${o}.js`)).rig}}}var G=Le(e=>require.async(e));function le(e,r,t=Math.random){let i,o=!1,a="",n,d=0,s=0,u=()=>{i!==void 0&&e.clearTimeout(i),i=void 0};function h(){a="",r(void 0,0),n&&!o&&(i=e.setTimeout(f,2800+t()*2800))}function c(p){let m=n?.[p];if(!m||o)return;u(),a=p;let g=e.performance.now(),v=()=>{if(i=void 0,!n||o)return;let b=Math.min(1,(e.performance.now()-g)/m.duration);if(r(a,b),b>=1){h();return}i=e.setTimeout(v,1e3/60)};v()}function f(){if(i=void 0,!n||o)return;let p=Object.keys(n).filter(v=>v!=="blink"&&v!=="attention"),m=p.filter(v=>v.startsWith("ear")),g=m.length&&d>=2?m[s++%m.length]:t()<.72&&n.blink||!p.length?"blink":p[Math.floor(t()*p.length)];g.startsWith("ear")?d=0:d++,c(g)}return{setClips(p){o||p===n||(u(),n=p,a="",d=0,s=0,r(void 0,0),n&&(i=e.setTimeout(f,1200+t()*800)))},attention(){a||c("attention")},dispose(){o=!0,u(),n=void 0,r(void 0,0)}}}var he=e=>{let r=Math.max(0,Math.min(1,e));return r*r*(3-2*r)};function ne(e){return e<=0||e>=1?0:e<.3?he(e/.3):e<.4?1:1-he((e-.4)/.6)}function me(e){return ne((e-.12)/.16)}var re={seated:[{left:[285,223],right:[326,224],upper:[302,188],lower:[310,276],iris:[309,230,13,20,0],skin:[315,258]},{left:[373,221],right:[421,226],upper:[387,186],lower:[393,277],iris:[393,228,15,22,0],skin:[391,261]}],peek:[{left:[80,214],right:[119,221],upper:[103,186],lower:[91,267],iris:[102,225,14,20,.25],skin:[110,253]},{left:[171,252],right:[210,265],upper:[195,221],lower:[175,300],iris:[186,260,15,20,.4],skin:[186,288]}],chin:[{left:[252,252],right:[290,247],upper:[266,223],lower:[287,297],iris:[278,258,14,19,-.3],skin:[291,285]},{left:[339,234],right:[387,227],upper:[358,196],lower:[365,280],iris:[361,235,15,21,-.25],skin:[367,269]}],halfpeek:[{left:[89,390],right:[159,395],upper:[116,337],lower:[110,471],iris:[116,401,23,30,.22],skin:[117,445]}]};function V(e,r){if(!Number.isFinite(e)||!Number.isFinite(r))return[0,0];let t=Math.max(1,Math.hypot(e,r));return[e/t,r/t]}function ie(e,r){let t=Math.max(0,Math.min(1,r)),i=(e.left[1]+e.right[1])/2,o=(e.lower[1]-i)*.24,a=[(e.left[0]+e.right[0])/2,i+o+(e.right[0]-e.left[0])*.18],n=d=>[d[0]+(a[0]-d[0])*t,d[1]+(a[1]-d[1])*t];return{upper:n(e.upper),lower:n(e.lower),left:[e.left[0],e.left[1]+o*t],right:[e.right[0],e.right[1]+o*t]}}function J(e,r,t){let i=0,o=1;for(let d=0;d<14;d++){let s=(i+o)/2,u=1-s;u*u*e.left[0]+2*u*s*r[0]+s*s*e.right[0]<t?i=s:o=s}let a=(i+o)/2,n=1-a;return n*n*e.left[1]+2*n*a*r[1]+a*a*e.right[1]}function fe(e,r,t){let i=Math.floor(t.left[0]-9),o=Math.ceil(t.right[0]+9),a=Math.floor(Math.min(t.upper[1],t.left[1],t.right[1])-5),n=Math.ceil(Math.max(t.lower[1],t.left[1],t.right[1])+5),d=o-i,s=n-a,u=()=>{let y=e.createElement("canvas");return y.width=d,y.height=s,y},h=u(),c=u(),f=u(),p=h.getContext("2d"),m=c.getContext("2d"),g=f.getContext("2d"),v=r.getImageData(0,0,r.canvas.width,r.canvas.height),b=(y,w)=>{let M=(Math.max(0,Math.min(v.height-1,Math.round(w/2)))*v.width+Math.max(0,Math.min(v.width-1,Math.round(y/2))))*4;return[v.data[M],v.data[M+1],v.data[M+2]]},E=b(...t.skin),l=p.createImageData(d,s),_=m.createImageData(d,s),k=y=>y.every((w,M)=>Math.abs(w-E[M])<25),z=(y,w,M)=>{if(k(M))return M;let P=[E[0]*.05,E[1]*.05,E[2]*.05],A=.05;for(let x of[6,12,20,30])for(let D=0;D<8;D++){let C=b(y+Math.cos(D*Math.PI/4)*x,w+Math.sin(D*Math.PI/4)*x);if(!k(C))continue;let H=1/x;A+=H;for(let T=0;T<3;T++)P[T]+=C[T]*H}return P.map(x=>Math.round(x/A))};for(let y=0;y<d;y++){let w=i+y,M=J(t,t.upper,w);for(let P=0;P<s;P++){let A=a+P,x=b(w,A),D=(P*d+y)*4,C=1-(x[0]+x[1]+x[2])/Math.max(1,E[0]+E[1]+E[2]),H=x[1]>x[0]*1.15&&x[1]>x[2]*1.12,q=A>=M-12&&A<=M+3&&!H?Math.max(0,Math.min(1,(C-.3)/.35)):0;l.data.set([...x,Math.round(q*255)],D),_.data.set([...z(w,A,x),255],D)}}p.putImageData(l,0,0),m.putImageData(_,0,0);let I=g.createImageData(d,s);for(let y=0;y<l.data.length;y+=4)I.data[y+3]=l.data[y+3]>4?255:0;g.putImageData(I,0,0);let R=u(),S=R.getContext("2d");for(let[y,w]of[[0,0],[-1,0],[1,0],[0,-1],[0,1]])S.drawImage(f,y,w);return g.drawImage(R,0,0),g.translate(-i,-a),g.beginPath(),g.moveTo(t.left[0]-7,t.left[1]),g.quadraticCurveTo(t.upper[0],t.upper[1]-4,t.right[0]+7,t.right[1]),g.quadraticCurveTo(t.lower[0],t.lower[1]+20,t.left[0]-7,t.left[1]),g.closePath(),g.fill(),m.globalCompositeOperation="destination-in",m.filter="blur(0.65px)",m.drawImage(f,0,0),m.filter="none",{ink:h,skin:c,left:i,top:a,width:d,height:s}}function pe(e,r,t){let i=e.canvas.ownerDocument,o=i.createElement("canvas");o.width=r.width,o.height=r.height;let a=o.getContext("2d",{willReadFrequently:!0});a.drawImage(r,0,0);let n=h=>{let c=a.getImageData(Math.round(h[0]/2),Math.round(h[1]/2),1,1).data;return[c[0],c[1],c[2]]},d=h=>`rgb(${h.map(c=>Math.round(c)).join(" ")})`,s=t.map(h=>{let[c,f,p,m,g]=h.iris,v=i.createElement("canvas");v.width=Math.ceil(p*2+4),v.height=Math.ceil(m*2+4);let b=v.getContext("2d");return b.translate(v.width/2,v.height/2),b.rotate(g),b.beginPath(),b.ellipse(0,0,p,m,0,0,Math.PI*2),b.clip(),b.rotate(-g),b.drawImage(r,0,0,r.width,r.height,-c,-f,r.width*2,r.height*2),{eye:h,iris:v,skin:n(h.skin),material:fe(i,a,h)}});function u(h,c){let{upper:f,lower:p,left:m,right:g}=ie(h,c);e.beginPath(),e.moveTo(...m),e.quadraticCurveTo(...f,...g),e.quadraticCurveTo(...p,...m),e.closePath()}return(h,c)=>{let[f,p]=V(...h);e.save(),e.scale(.5,.5);for(let{eye:m,iris:g,skin:v,material:b}of s){let[E,l,_,k]=m.iris;if(e.save(),e.drawImage(b.skin,b.left,b.top),e.save(),u(m,0),e.clip(),c<.999){e.save(),u(m,c),e.clip();let I=e.createLinearGradient(0,l-k,0,l+k),S=(v[0]+v[1]+v[2])/765>.65?[255,253,241]:[166,185,193];I.addColorStop(0,d(S.map(M=>M*.83))),I.addColorStop(.5,d(S)),e.fillStyle=I,e.fillRect(E-70,l-70,140,140);let y=f*_*.26,w=p*k*.13;e.drawImage(g,E-g.width/2+y,l-g.height/2+w),e.restore()}e.restore();let z=ie(m,c);for(let I=0;I<b.width;I++){let R=b.left+I,S=J({...m,left:z.left,right:z.right},z.upper,R)-J(m,m.upper,R);e.drawImage(b.ink,I,0,1,b.height,R,b.top+S,1,b.height)}e.restore()}e.restore()}}var F=[[284,328],[310,347],[324,373],[319,398],[307,423],[307,448],[319,464]];function ge(e,r,t,i){let o=Math.max(1,t-r),a=Math.max(0,Math.min(1,(t-e)/o));return a===0?0:Math.sin(i)*Math.min(20,o*.55)*a*a}function be(e,r){return e.reduce((t,i,o)=>{let a=t[o-1],n=(a?.angle??0)+(r[o]??0);if(!a)t.push({x:i[0],y:i[1],angle:n});else{let d=e[o-1],s=i[0]-d[0],u=i[1]-d[1],h=Math.cos(a.angle),c=Math.sin(a.angle);t.push({x:a.x+s*h-u*c,y:a.y+s*c+u*h,angle:n})}return t},[])}function we(e,r,t=F){let i=1/0,o=0,a=0;for(let n=0;n<t.length-1;n++){let d=t[n],s=t[n+1],u=s[0]-d[0],h=s[1]-d[1],c=Math.max(0,Math.min(1,((e-d[0])*u+(r-d[1])*h)/(u*u+h*h))),f=(e-d[0]-u*c)**2+(r-d[1]-h*c)**2;f<i&&(i=f,o=n,a=c)}return{x:e,y:r,bone:o,weight:a}}function ve(e,r,t=F){let i=0,o=0;for(let a=0;a<2;a++){let n=e.bone+a,d=t[n],s=r[n],u=a?e.weight:1-e.weight,h=e.x-d[0],c=e.y-d[1],f=Math.cos(s.angle),p=Math.sin(s.angle);i+=u*(s.x+h*f-c*p),o+=u*(s.y+h*p+c*f)}return[i,o]}function ae(e,r,t){let i=Math.max(0,Math.min(1,e)),o=Math.sin(Math.PI*i)**2;return Array.from({length:r},(a,n)=>o*(t?n?.12:0:.32)*Math.sin(i*Math.PI*(t?3:4)-n*(t?.65:1.1)))}function ye(e,r,t,i=[]){let o=t.get(r.layers.body.src),a=o?pe(e,o,i):void 0,n=r.layers.tail,d=[],s=[];if(n){let[c,f,p,m]=n.box,g=Math.ceil((p-c)/10),v=Math.ceil((m-f)/10);for(let b=0;b<=v;b++)for(let E=0;E<=g;E++)d.push(we(c+(p-c)*E/g,f+(m-f)*b/v));for(let b=0;b<v;b++)for(let E=0;E<g;E++){let l=b*(g+1)+E;s.push([l,l+1,l+g+1],[l+1,l+g+2,l+g+1])}}function u(c){let f=r.layers[c],p=f&&t.get(f.src);if(f&&p){let[m,g,v,b]=f.box;e.drawImage(p,m,g,v-m,b-g)}}function h(c){if(!n)return;let f=t.get(n.src);if(!f)return;if(c<=0||c>=1){u("tail");return}let p=be(F,ae(c,F.length,!0)),m=d.map(b=>ve(b,p)),[g,v]=n.box;for(let b of s){let[E,l,_]=b,k=d[E],z=d[l],I=d[_],R=m[E],S=m[l],y=m[_],w=z.x-k.x,M=z.y-k.y,P=I.x-k.x,A=I.y-k.y,x=w*A-M*P,D=((S[0]-R[0])*A-(y[0]-R[0])*M)/x,C=((S[1]-R[1])*A-(y[1]-R[1])*M)/x,H=((y[0]-R[0])*w-(S[0]-R[0])*P)/x,T=((y[1]-R[1])*w-(S[1]-R[1])*P)/x;e.save(),e.beginPath();let q=(R[0]+S[0]+y[0])/3,O=(R[1]+S[1]+y[1])/3;[R,S,y].forEach((L,$)=>{let X=L[0]-q,j=L[1]-O,N=1+1.2/Math.max(1,Math.hypot(X,j));$?e.lineTo(q+X*N,O+j*N):e.moveTo(q+X*N,O+j*N)}),e.closePath(),e.clip(),e.transform(D,C,H,T,R[0]-D*(k.x-g)-H*(k.y-v),R[1]-C*(k.x-g)-T*(k.y-v)),e.drawImage(f,0,0),e.restore()}}return(c,f,p=[0,0])=>{e.clearRect(0,0,r.size[0],r.size[1]);let m=c==="attention"?Math.max(0,Math.min(1,(f-.03)/.65)):f,g=ae(m,r.ears.length,!1);r.ears.forEach(([,b],E)=>{let l=r.layers["ear"+E],_=l&&t.get(l.src);if(!l||!_)return;let k=c==="attention"||c==="ear"+E?g[E]:0;if(Math.abs(k)<1e-8){u("ear"+E);return}let[z,I,R,S]=l.box;for(let y=0;y<_.height;y++){let w=I+y*(S-I)/_.height;e.drawImage(_,0,y,_.width,1,z+ge(w,I,b,k),w,R-z,(S-I)/_.height)}}),u("body"),h(c==="attention"?Math.max(0,Math.min(1,(f-.22)/.78)):c==="tail"?f:0);let v=c==="blink"?ne(f):c==="attention"?me(f):0;a?.(p,v)}}function Ee(e,r){let t=[0,0],i=[0,0],o,a=0,n=!1;function d(u){if(o=void 0,n)return;let h=Math.min(64,Math.max(0,u-a));a=u;let c=1-Math.exp(-h/95);t=[t[0]+(i[0]-t[0])*c,t[1]+(i[1]-t[1])*c];let f=Math.hypot(t[0]-i[0],t[1]-i[1])<.001;f&&(t=i),r(t),f||(o=e.requestAnimationFrame(d))}function s(){o!==void 0&&e.cancelAnimationFrame(o),o=void 0}return{target(u,h){n||(i=V(u,h),o===void 0&&Math.hypot(t[0]-i[0],t[1]-i[1])>=.001&&(a=e.performance.now(),o=e.requestAnimationFrame(d)))},reset(){s(),i=t=[0,0],r(t)},dispose(){n=!0,s()}}}function Ce(e){let r=e.defaultView,t=r.matchMedia("(prefers-reduced-motion: reduce)"),i=new Map,o=new Map,a=!1,n,d,s,u,h="",c="",f=0,p=!1,m=0,g="",v,b=-1/0,E=[0,0],l,_=0,k,z=()=>{u&&n&&(u(l,_,E),n.dataset.motion=l??"rig-rest")},I=Ee(r,C=>{E=C,z()}),R=()=>{v!==void 0&&r.clearTimeout(v),v=void 0};function S(C){if(o.has(C))return o.get(C);if(i.has(C))return Promise.resolve();let H=new r.Image;H.src=C;let T=H.decode().then(()=>{a||i.set(C,H)},()=>{}).finally(()=>o.delete(C));return o.set(C,T),T}let y=le(r,(C,H)=>{!s||!n||!u||(l=C,_=H,z())});function w(){if(a)return;let C=e.documentElement.dataset.xiaoheiAppearance==="light"?"light":"dark",H=e.documentElement.hasAttribute("data-xiaohei-sidebar-resizing"),T=!e.hidden&&!t.matches&&!H&&n?`${h}-${C}`:"";if(T===g&&c===C)return;g=T,R(),u=void 0,y.setClips(void 0),I.reset(),k=void 0,l=void 0,_=0;let q=++f;if(s?.remove(),s=void 0,n&&(n.dataset.motion="rest"),d=void 0,c=C,p=!1,!T||!n)return;let O=n;G.rig(h,C).then(async L=>{if(!L||a||q!==f||(await Promise.all(Object.values(L.layers).map(X=>S(X.src))),a||q!==f||Object.values(L.layers).some(X=>!i.get(X.src))))return;d=L,s=e.createElement("canvas"),s.className="xiaohei-character-motion",s.width=L.size[0],s.height=L.size[1];let $=s.getContext("2d");if(!$){s=void 0;return}O.append(s),u=ye($,L,i,re[h]),y.setClips({blink:{duration:280},...Object.fromEntries(L.ears.map((X,j)=>["ear"+j,{duration:1050}])),...L.layers.tail?{tail:{duration:2400}}:{},attention:{duration:2400}})}).catch(()=>{})}let M=C=>{if(!n||!u||C.pointerType!=="mouse")return;let H=r.performance.now();(!k||H-m>=100)&&(k=n.getBoundingClientRect(),m=H);let T=k,q=re[h];if(d&&q?.length){let L=Math.min(T.width/d.size[0],T.height/d.size[1]),$=q.reduce((Z,K)=>Z+K.iris[0],0)/q.length/2,X=q.reduce((Z,K)=>Z+K.iris[1],0)/q.length/2,j=T.left+$*L,N=T.top+(T.height-d.size[1]*L)/2+X*L;I.target((C.clientX-j)/Math.max(220,r.innerWidth*.32),(C.clientY-N)/Math.max(180,r.innerHeight*.32))}let O=C.clientX>=T.left-70&&C.clientX<=T.right+70&&C.clientY>=T.top-50&&C.clientY<=T.bottom+50;if(O||R(),O&&!p&&H-b>6e3){let L=f;v=r.setTimeout(()=>{v=void 0,!a&&p&&L===f&&(b=r.performance.now(),y.attention())},180)}p=O};t.addEventListener("change",w);let P=()=>{I.target(0,0),p=!1,R()},A=C=>{C.relatedTarget||P()},x=()=>{k=void 0};e.addEventListener("pointerout",A),r.addEventListener("blur",P),r.addEventListener("resize",x),e.addEventListener("visibilitychange",w),e.addEventListener("pointermove",M,{passive:!0});let D=new r.MutationObserver(w);return D.observe(e.documentElement,{attributes:!0,attributeFilter:["data-xiaohei-appearance","data-xiaohei-sidebar-resizing"]}),{setPose(C,H){(C!==n||h!==H)&&(R(),f++,g="",u=void 0,y.setClips(void 0),I.reset(),k=void 0,s?.remove(),s=void 0,d=void 0,n&&(n.dataset.motion="rest")),n=C,h=H,w()},dispose(){a=!0,R(),f++,y.dispose(),I.dispose(),s?.remove(),u=void 0,i.clear(),o.clear(),n&&(n.dataset.motion="rest"),t.removeEventListener("change",w),D.disconnect(),e.removeEventListener("visibilitychange",w),e.removeEventListener("pointermove",M),e.removeEventListener("pointerout",A),r.removeEventListener("blur",P),r.removeEventListener("resize",x)}}}var Me="dsh-theme-xiaohei/wallpaper-character";function xe(e=typeof document>"u"?void 0:document,r=G.pose){let t=e?.defaultView;if(!e||!t)return()=>{};let i=!1,o,a,n,d=[],s=!0,u={pose:"hidden",left:0,top:0,width:0,height:0},h=new Map,c=new Set,f=new Set,p=typeof t.matchMedia=="function"?Ce(e):void 0,m=ue({now:()=>t.performance.now(),setTimeout:(w,M)=>t.setTimeout(w,M),clearTimeout:w=>t.clearTimeout(w)},()=>l()),g=new WeakMap,v=typeof t.ResizeObserver=="function"?new t.ResizeObserver(w=>{for(let M of w){let P=g.get(M.target),A=M.contentRect.width,x=M.contentRect.height;g.set(M.target,{width:A,height:x}),(!P||P.width!==A||M.target===d[0]&&P.height!==x)&&(s=!0)}s&&(l(),_())}):void 0;function b(){if(i||!e)return;if(e.documentElement?.hasAttribute("data-xiaohei-sidebar-resizing")){s=!0,n&&n.dataset.pose!=="hidden"&&(n.dataset.pose="hidden"),m.setPaused(!0),p?.setPose(void 0,"hidden"),_();return}let w=e.getElementById(se),M=[e.querySelector(ee.sidebarShell),e.querySelector("[data-conversation-scroll]"),e.querySelector("[data-chat-flow]"),e.querySelector(ee.composerCard)];if(M.some((O,L)=>O!==d[L])){d=M,v?.disconnect();for(let O of d)O&&v?.observe(O);s=!0}if(!w){n?.remove(),n=void 0,m.setPaused(!0),p?.setPose(void 0,"hidden");return}if(!n||n.parentElement!==w){n?.remove(),e.getElementById(Me)?.remove(),n=e.createElement("div"),n.id=Me,n.className="xiaohei-wallpaper-character",n.setAttribute("aria-hidden","true"),n.dataset.pose="hidden";for(let O of Y){let L=e.createElement("span");L.className=`xiaohei-wallpaper-character__${O}`,n.append(L)}w.append(n),s=!0}if(!s){E();return}s=!1;let[P,A,x,D]=d;if(!P||!A||!D){u={...u,pose:"hidden"},E();return}let C=P.getBoundingClientRect(),H=C.width<100?[...P.querySelectorAll('button,a,input,[role="button"],[role="treeitem"]')].map(O=>O.getBoundingClientRect()).filter(O=>O.width>0&&O.height>0):[],T=D.getBoundingClientRect(),q=x?.getBoundingClientRect()??{left:T.left+16,right:T.right-16,top:0,bottom:0};u=de({sidebar:C,scroll:A.getBoundingClientRect(),flow:q,viewportWidth:t.innerWidth,viewportHeight:t.innerHeight,controls:H}),E()}function E(){if(!n||i)return;m.setPaused(e.hidden||u.pose!=="seated");let w=e.hidden?"hidden":u.pose==="seated"?m.pose:u.pose;if(w==="hidden"){n.dataset.pose!=="hidden"&&(n.dataset.pose="hidden"),p?.setPose(void 0,"hidden");return}let M=e.documentElement.dataset.xiaoheiAppearance==="light"?"light":"dark",P=`${w}-${M}`;if(!h.has(P)){p?.setPose(void 0,"hidden"),(u.pose!=="seated"||!["seated","chin","doze"].includes(n.dataset.pose??""))&&(n.dataset.pose="hidden"),!c.has(P)&&!f.has(P)&&(c.add(P),r(w,M).then(async x=>{if(i)return;let D=new t.Image;D.src=x,await D.decode(),!i&&(c.delete(P),h.set(P,x),l())}).catch(()=>{c.delete(P),f.add(P)}));return}let A=n.querySelector(`.xiaohei-wallpaper-character__${w}`);A.dataset.appearance!==M&&(A.style.setProperty(`--xiaohei-${w}-art`,`url("${h.get(P)}")`),A.dataset.appearance=M);for(let x of["left","top","width","height"]){let D=`${Math.round(u[x]*100)/100}px`;A.style[x]!==D&&(A.style[x]=D)}A.dataset.ready||(A.dataset.ready="true"),n.dataset.pose!==w&&(n.dataset.pose=w),p?.setPose(A,w)}function l(){i||o!==void 0||(o=t.requestAnimationFrame(()=>{o=void 0,b()}))}function _(){a!==void 0&&t.clearTimeout(a),a=t.setTimeout(()=>{a=void 0,s=!0,l()},240)}let k=oe(e,l),z=new t.MutationObserver(l);z.observe(e.documentElement,{attributes:!0,attributeFilter:["data-xiaohei-appearance"]});let I=()=>{s=!0,l(),_()};t.addEventListener("resize",I,{passive:!0});let R=()=>m.activity(),S=["pointermove","pointerdown","keydown","input","wheel"];for(let w of S)e.addEventListener(w,R,{passive:!0,capture:!0});let y=()=>{e.hidden&&m.setPaused(!0),l()};return e.addEventListener("visibilitychange",y),l(),()=>{i=!0,o!==void 0&&t.cancelAnimationFrame(o),a!==void 0&&t.clearTimeout(a),k(),v?.disconnect(),z.disconnect(),m.dispose(),p?.dispose();for(let w of S)e.removeEventListener(w,R,!0);e.removeEventListener("visibilitychange",y),t.removeEventListener("resize",I),n?.remove()}}var Pe=`
|
|
3
|
+
.xiaohei-wallpaper-character {
|
|
4
|
+
position: absolute;
|
|
5
|
+
inset: 0;
|
|
6
|
+
pointer-events: none;
|
|
7
|
+
user-select: none;
|
|
8
|
+
}
|
|
9
|
+
html[data-xiaohei-sidebar-resizing] .xiaohei-wallpaper-character {
|
|
10
|
+
visibility: hidden;
|
|
11
|
+
}
|
|
12
|
+
.xiaohei-wallpaper-character > span {
|
|
13
|
+
position: absolute;
|
|
14
|
+
display: block;
|
|
15
|
+
background-size: contain;
|
|
16
|
+
background-position: left center;
|
|
17
|
+
background-repeat: no-repeat;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
opacity: 0;
|
|
20
|
+
transition: opacity 220ms ease, transform 220ms cubic-bezier(.2,.8,.2,1);
|
|
21
|
+
}
|
|
22
|
+
.xiaohei-wallpaper-character .xiaohei-character-motion {
|
|
23
|
+
position: absolute; inset: 0; width: 100%; height: 100%;
|
|
24
|
+
object-fit: contain; object-position: left center; pointer-events: none;
|
|
25
|
+
}
|
|
26
|
+
.xiaohei-wallpaper-character > span[data-motion]:not([data-motion='rest']) {
|
|
27
|
+
background-image: none;
|
|
28
|
+
}
|
|
29
|
+
${Y.map(e=>`
|
|
30
|
+
.xiaohei-wallpaper-character__${e}[data-ready] {
|
|
31
|
+
background-image: var(--xiaohei-${e}-art);
|
|
32
|
+
}`).join(`
|
|
33
|
+
`)}
|
|
34
|
+
.xiaohei-wallpaper-character__peek,
|
|
35
|
+
.xiaohei-wallpaper-character__halfpeek {
|
|
36
|
+
transform: translateX(4px);
|
|
37
|
+
}
|
|
38
|
+
${Y.map(e=>`.xiaohei-wallpaper-character[data-pose='${e}'] > .xiaohei-wallpaper-character__${e}`).join(`,
|
|
39
|
+
`)} {
|
|
40
|
+
opacity: 1;
|
|
41
|
+
transform: none;
|
|
42
|
+
}
|
|
43
|
+
.xiaohei-wallpaper-character[data-pose='hidden'] > span {
|
|
44
|
+
transition: none;
|
|
45
|
+
}
|
|
46
|
+
@media (prefers-reduced-motion: reduce) {
|
|
47
|
+
.xiaohei-wallpaper-character > span { transition: none; transform: none; }
|
|
48
|
+
}
|
|
49
|
+
`;function Se(e){let r=e.createElement("style");r.id="dsh-theme-xiaohei/character-style",r.textContent=Pe,e.head.append(r);try{let t=xe(e);return()=>{t(),r.remove()}}catch(t){throw r.remove(),t}}
|
|
50
|
+
return module.exports; } });
|
|
51
|
+
//# sourceMappingURL=client.decorations.js.map
|