@bluepic/embed 0.4.0-next.136 → 0.4.0-next.138

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/dist/theme.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=["color-scheme","surface","surface-rgb","surface-1","surface-1-rgb","surface-2","surface-2-rgb","surface-3","surface-inverse","scrim","ink","ink-rgb","text","text-muted","text-faint","text-inverse","text-on-surface-rgb","text-on-inverse-rgb","border","border-strong","divider","border-rgb","fill","fill-hover","fill-active","field","field-hover","field-focus","hover","pressed","primary","primary-rgb","primary-hover","primary-active","on-primary","primary-text","primary-border","primary-soft","primary-soft-hover","focus-ring","focus-ring-width","focus-ring-offset","primary-dark","primary-dark-rgb","primary-light","primary-light-rgb","primary-bright","primary-bright-rgb","success","success-rgb","on-success","success-text","success-soft","success-border","success-dark-rgb","success-light-rgb","success-darker-rgb","warning","warning-rgb","on-warning","warning-text","warning-soft","warning-border","warning-dark-rgb","warning-light-rgb","warning-darker-rgb","error","error-rgb","on-error","error-text","error-soft","error-border","error-dark-rgb","error-light-rgb","error-darker-rgb","info","info-rgb","on-info","info-text","info-soft","info-border","info-dark-rgb","info-light-rgb","info-bright-rgb","shadow-1","shadow-2","shadow-3","radius-sm","radius-md","radius-lg","radius-full","font-family","font-family-heading","font-size","root-font-size","canvas","canvas-image","canvas-control","canvas-control-hover","on-canvas-control","disabled-opacity"],X="--bx-",so=[{label:"Surfaces",tokens:["surface","surface-1","surface-2","surface-3","surface-inverse","scrim"]},{label:"Text",tokens:["text","text-muted","text-faint","text-inverse"]},{label:"Borders",tokens:["border","border-strong","divider"]},{label:"Neutral fills",tokens:["fill","fill-hover","fill-active","field","field-hover","field-focus","hover","pressed"]},{label:"Primary",tokens:["primary","primary-hover","primary-active","on-primary","primary-text","primary-border","primary-soft","primary-soft-hover","focus-ring"]},{label:"Success",tokens:["success","on-success","success-text","success-soft","success-border"]},{label:"Warning",tokens:["warning","on-warning","warning-text","warning-soft","warning-border"]},{label:"Error",tokens:["error","on-error","error-text","error-soft","error-border"]},{label:"Info",tokens:["info","on-info","info-text","info-soft","info-border"]},{label:"Shape & type",tokens:["radius-sm","radius-md","radius-lg","radius-full","font-family","font-family-heading","font-size"]},{label:"Canvas",tokens:["canvas","canvas-control","on-canvas-control"]}],Or={dark:{surface:"#27262e",primary:"#4472c7"},light:{surface:"#f2f2f2",primary:"#124bba"}},io=[{key:"light",label:"Light",description:"Neutral light surfaces, Bluepic blue.",input:{version:2,preset:"light"}},{key:"dark",label:"Dark",description:"Neutral dark surfaces, Bluepic blue.",input:{version:2,preset:"dark"}},{key:"midnight",label:"Midnight",description:"Near-black with cool, slightly tinted surfaces.",input:{version:2,surface:"#0f1117",primary:"#7da8f7",tint:.35}},{key:"paper",label:"Paper",description:"Warm off-white, ink-black actions, crisp corners.",input:{version:2,surface:"#fbf8f1",primary:"#1f1f1f",radius:"sm"}},{key:"slate",label:"Slate",description:"Blue-grey dark surfaces with a teal accent.",input:{version:2,surface:"#1e2530",primary:"#4fd1c5",tint:.4}},{key:"sand",label:"Sand",description:"Soft sand surfaces with a terracotta accent, rounded.",input:{version:2,surface:"#f3ede3",primary:"#b5562c",radius:"lg"}},{key:"forest",label:"Forest",description:"Deep green surfaces with a mint accent.",input:{version:2,surface:"#0e1f17",primary:"#7ad39a",tint:.5}},{key:"ocean",label:"Ocean",description:"Cool light surfaces with a deep blue accent, pill shapes.",input:{version:2,surface:"#eef4fb",primary:"#0b5cad",tint:.3,radius:"full"}},{key:"graphite",label:"Graphite",description:"Pure black, high contrast, sharp corners — signage and dark brands.",input:{version:2,surface:"#000000",primary:"#ffffff",radius:"none",contrast:"high"}},{key:"plum",label:"Plum",description:"Deep aubergine surfaces with a warm coral accent.",input:{version:2,surface:"#1f1423",primary:"#ff7a59",tint:.45,radius:"lg"}},{key:"linen",label:"Linen",description:"Soft white linen with a muted navy accent, rounded.",input:{version:2,surface:"#f7f7f4",primary:"#2f3e5c",tint:.15,radius:"lg"}}],Br={success:"#28a552",warning:"#d9a400",error:"#dc2f2f",info:"#3b82f6"},I=Object.freeze({r:255,g:255,b:255,a:1}),Z=Object.freeze({r:0,g:0,b:0,a:1}),Pr=[I,Object.freeze({r:17,g:17,b:17,a:1})],dr=(o,e,t)=>o<e?e:o>t?t:o,w=o=>dr(o,0,1),m=(o,e=0)=>Number.isFinite(o)?o:e,x=(o,e,t,a=1)=>({r:o,g:e,b:t,a}),O=o=>Math.round(dr(m(o),0,255)),ir=o=>O(o).toString(16).padStart(2,"0"),lo={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Fr=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/,uo=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(deg|turn|rad|grad)?$/,bo=/^(rgba?|hsla?)\(\s*(.*?)\s*\)$/;function mr(o){if(o==="none")return{value:0,percent:!1};const e=o.endsWith("%"),t=e?o.slice(0,-1):o;if(!Fr.test(t))return null;const a=Number(t);return Number.isFinite(a)?{value:a,percent:e}:null}function gr(o){const e=mr(o);return e?dr(e.percent?e.value*255/100:e.value,0,255):null}function go(o){const e=mr(o);return e?w(e.percent?e.value/100:e.value):null}function Dr(o){const e=mr(o);return e?w(e.value/100):null}function fo(o){if(o==="none")return 0;const e=uo.exec(o);if(!e)return null;let t=Number(e[1]);if(!Number.isFinite(t))return null;switch(e[2]){case"turn":t*=360;break;case"rad":t*=180/Math.PI;break;case"grad":t*=.9;break}return t%=360,t<0&&(t+=360),t}function po(o){if(o.includes(",")){if(o.includes("/"))return null;const n=o.split(",").map(c=>c.trim());return n.length!==3&&n.length!==4||n.some(c=>c===""||/\s/.test(c))?null:{ch:[n[0],n[1],n[2]],alpha:n[3]}}const e=o.split("/");if(e.length>2)return null;const t=e[0].trim().split(/\s+/);if(t.length!==3)return null;let a;return e.length===2&&(a=e[1].trim(),a===""||/\s/.test(a))?null:{ch:[t[0],t[1],t[2]],alpha:a}}function ho(o,e,t){const a=n=>{const c=(n+o/30)%12,s=e*Math.min(t,1-t);return t-s*Math.max(-1,Math.min(c-3,9-c,1))};return[a(0)*255,a(8)*255,a(4)*255]}function H(o){if(typeof o!="string")return null;const e=o.trim().toLowerCase();if(!e)return null;if(e==="transparent")return x(0,0,0,0);const t=lo[e];if(t!==void 0)return x(t>>16,t>>8&255,t&255,1);if(e[0]==="#"){const n=e.slice(1);if(!/^[0-9a-f]+$/.test(n))return null;const c=i=>parseInt(n[i],16),s=i=>parseInt(n.slice(i,i+2),16);switch(n.length){case 3:return x(c(0)*17,c(1)*17,c(2)*17,1);case 4:return x(c(0)*17,c(1)*17,c(2)*17,c(3)*17/255);case 6:return x(s(0),s(2),s(4),1);case 8:return x(s(0),s(2),s(4),s(6)/255);default:return null}}const a=bo.exec(e);if(a){const n=po(a[2]);if(!n)return null;const c=n.alpha===void 0?1:go(n.alpha);if(c===null)return null;if(a[1]==="rgb"||a[1]==="rgba"){const v=gr(n.ch[0]),D=gr(n.ch[1]),p=gr(n.ch[2]);return v===null||D===null||p===null?null:x(v,D,p,c)}const s=fo(n.ch[0]),i=Dr(n.ch[1]),d=Dr(n.ch[2]);if(s===null||i===null||d===null)return null;const[b,N,g]=ho(s,i,d);return x(b,N,g,c)}if(e.includes(",")){const n=e.split(",").map(d=>d.trim());if(n.length!==3||!n.every(d=>Fr.test(d)))return null;const[c,s,i]=n.map(d=>dr(Number(d),0,255));return x(c,s,i,1)}return null}function q(o){const e=w(o);return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function fr(o){const e=w(o);return e<=.0031308?e*12.92:1.055*Math.pow(e,1/2.4)-.055}function mo(o,e,t){const a=.4122214708*o+.5363325363*e+.0514459929*t,n=.2119034982*o+.6806995451*e+.1073969566*t,c=.0883024619*o+.2817188376*e+.6299787005*t,s=Math.cbrt(a),i=Math.cbrt(n),d=Math.cbrt(c);return{L:.2104542553*s+.793617785*i-.0040720468*d,a:1.9779984951*s-2.428592205*i+.4505937099*d,b:.0259040371*s+.7827717662*i-.808675766*d}}function pr(o,e,t){const a=o+.3963377774*e+.2158037573*t,n=o-.1055613458*e-.0638541728*t,c=o-.0894841775*e-1.291485548*t,s=a*a*a,i=n*n*n,d=c*c*c;return[4.0767416621*s-3.3077115913*i+.2309699292*d,-1.2684380046*s+2.6097574011*i-.3413193965*d,-.0041960863*s-.7034186147*i+1.707614701*d]}function lr(o){return mo(q(o.r/255),q(o.g/255),q(o.b/255))}const vo=1e-6;function Gr(o){const e=Math.hypot(o.a,o.b);let t=e<vo?0:Math.atan2(o.b,o.a)*180/Math.PI;return t<0&&(t+=360),t>=360&&(t-=360),{l:o.L,c:e,h:t}}function hr(o,e,t){const a=t*Math.PI/180;return{L:o,a:e*Math.cos(a),b:e*Math.sin(a)}}const G=1e-6,Rr=o=>o[0]>=-G&&o[0]<=1+G&&o[1]>=-G&&o[1]<=1+G&&o[2]>=-G&&o[2]<=1+G;function er(o,e,t,a){const n=w(m(o));let c=Math.max(0,m(e));const s=m(t);let i=hr(n,c,s),d=pr(i.L,i.a,i.b);if(!Rr(d)){let b=0,N=c;for(let g=0;g<24;g++){const v=(b+N)/2,D=hr(n,v,s);Rr(pr(D.L,D.a,D.b))?b=v:N=v}c=b,i=hr(n,c,s),d=pr(i.L,i.a,i.b)}return x(fr(d[0])*255,fr(d[1])*255,fr(d[2])*255,w(m(a,1)))}function J(o){const e=Gr(lr(o));return{l:e.l,c:e.c,h:e.h,a:w(m(o.a,1))}}function ur(o){return er(o.l,o.c,o.h,o.a)}function yo(o){const e=w(m(o.a,1)),t=`#${ir(o.r)}${ir(o.g)}${ir(o.b)}`;return e<1?`${t}${ir(e*255)}`:t}function vr(o){const e=w(m(o.a,1)),t=O(o.r),a=O(o.g),n=O(o.b);return e>=1?`rgb(${t}, ${a}, ${n})`:`rgba(${t}, ${a}, ${n}, ${Number(e.toFixed(3))})`}function Wr(o){return`${O(o.r)}, ${O(o.g)}, ${O(o.b)}`}function rr(o){return .2126*q(m(o.r)/255)+.7152*q(m(o.g)/255)+.0722*q(m(o.b)/255)}function y(o,e){const t=e.a>=1?e:x(e.r,e.g,e.b,1),a=o.a<1?br(o,t):o,n=rr(a),c=rr(t),s=Math.max(n,c),i=Math.min(n,c);return(s+.05)/(i+.05)}function br(o,e){const t=w(m(o.a,1)),a=w(m(e.a,1)),n=t+a*(1-t);if(n<=0)return x(0,0,0,0);const c=a*(1-t)/n,s=t/n;return x(o.r*s+e.r*c,o.g*s+e.g*c,o.b*s+e.b*c,n)}function or(o,e,t){const a=w(m(t));if(a<=0)return x(o.r,o.g,o.b,w(m(o.a,1)));if(a>=1)return x(e.r,e.g,e.b,w(m(e.a,1)));const n=w(m(o.a,1)),c=w(m(e.a,1)),s=lr(o),i=lr(e),d=n+(c-n)*a,b=d>0?n*(1-a)/d:1-a,N=d>0?c*a/d:a,g={L:s.L*b+i.L*N,a:s.a*b+i.a*N,b:s.b*b+i.b*N},v=Gr(g);return er(v.l,v.c,v.h,d)}function P(o,e){return x(o.r,o.g,o.b,w(m(e,1)))}function ko(o){return lr(o).L}function C(o,e){const t=J(o);return er(w(t.l+m(e)),t.c,t.h,t.a)}function xo(o,e){const t=J(o);return er(w(m(e)),t.c,t.h,t.a)}const wo=[1,.75,.5,.25,0],Io=24;function z(o,e,t,a="auto"){const n=m(t,1);if(y(o,e)>=n)return o;const c=J(o),s=x(e.r,e.g,e.b,1),i=rr(s),d=(f,$)=>er(f,$,c.h,c.a),b=f=>y(f,s),N=f=>rr(f.a<1?br(f,s):f),g=f=>x(Math.round(f.r),Math.round(f.g),Math.round(f.b),f.a),v=f=>{const $=f==="lighter"?1:0,R=_=>f==="lighter"?N(_)>=i:N(_)<=i,L=_=>R(_)&&b(_)>=n,K=_=>L(_)&&L(g(_));let U=null;for(const _ of wo){const j=c.c*_,Y=d($,j),tr=b(Y);if((!U||tr>U.ratio)&&(U={color:Y,ratio:tr}),!K(Y))continue;let nr=c.l,V=$;for(let cr=0;cr<Io;cr++){const B=(nr+V)/2;K(d(B,j))?V=B:nr=B}const ar=d(V,j);return{color:ar,ratio:b(ar)}}return U};if(a==="lighter"||a==="darker")return v(a).color;const D=b(d(1,0)),p=b(d(0,0));return v(D>=p?"lighter":"darker").color}function zr(o){return y(I,o)>=y(Z,o)}function Zr(o,e=Pr){const t=e.length?e:Pr;let a=t[0],n=-1;for(const c of t){const s=y(c,o);s>n&&(n=s,a=c)}return x(a.r,a.g,a.b,a.a)}const So=Object.freeze(Object.defineProperty({__proto__:null,BLACK:Z,WHITE:I,adjustL:C,bestOn:Zr,composite:br,contrastRatio:y,ensureContrast:z,formatHex:yo,formatRgb:vr,formatTriplet:Wr,fromOklch:ur,isDarkSurface:zr,lightness:ko,mix:or,parseColor:H,relativeLuminance:rr,setL:xo,toOklch:J,withAlpha:P},Symbol.toStringTag,{value:"Module"})),Mo={none:["0px","0px","0px","0px"],sm:["3px","4px","6px","9999px"],md:["4px","6px","10px","9999px"],lg:["6px","10px","16px","9999px"],full:["10px","16px","24px","9999px"]},To="url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMik7IiAvPgogIDxyZWN0IHg9IjUwJSIgeT0iMCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgyNTUsIDI1NSwgMjU1LCAwKTsiIC8+CiAgPHJlY3QgeD0iNTAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgyNTUsIDI1NSwgMjU1LCAwLjIpOyIgLz4KICA8cmVjdCB4PSIwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMCk7IiAvPgo8L3N2Zz4=')",$o="url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDAsIDAsIDAsIDAuMSk7IiAvPgogIDxyZWN0IHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMCwgMCwgMCwgMC4xKTsiIC8+Cjwvc3ZnPg==')";function Ao(o,e){const t=o==="dark",a=e?.06:0;return{text:e?1:t?.92:.88,textMuted:e?.85:t?.66:.62,textFaint:e?.68:t?.46:.42,border:(t?.12:.1)+(e?.18:0),borderStrong:(t?.28:.22)+(e?.25:0),divider:(t?.1:.08)+(e?.15:0),fill:(t?.09:.06)+a,fillHover:(t?.14:.1)+a,fillActive:(t?.2:.15)+a,field:(t?.07:.04)+a,fieldHover:(t?.1:.06)+a,fieldFocus:(t?.1:.05)+a,hover:(t?.07:.05)+a,pressed:(t?.12:.09)+a,soft:(t?.18:.12)+(e?.08:0),softHover:(t?.26:.2)+(e?.08:0),elevationMin:e?1.3:t?1.18:1.06}}const h=o=>vr(o),S=o=>Wr(o),T=(o,e)=>vr(P(o,e)),Ur=o=>({r:Math.round(o.r),g:Math.round(o.g),b:Math.round(o.b),a:o.a});function W(o,e,t,a,n=c=>c){let c=t,s=Ur(n(or(o,e,c))),i=0;for(;y(s,o)<a&&c<1&&i++<40;)c=Math.min(1,c+.02),s=Ur(n(or(o,e,c)));return P(s,1)}function jr(o,e,t){if(t<=0)return o;const a=J(o),n=J(e);return ur({l:a.l,c:Math.min(.03,.03*t)+a.c*(1-t),h:n.h,a:a.a})}function Eo(o){var Tr,$r,Ar,Er,Nr,Cr,_r;const e={version:2,...o??{}},t=Or[e.preset??"dark"],a=[];let n=H(e.surface)??null;n||(e.surface&&a.push({token:"surface",reason:`unparsable surface "${e.surface}", using preset`}),n=H(t.surface)),n=P(n,1);let c=H(e.primary)??null;c||(e.primary&&a.push({token:"primary",reason:`unparsable primary "${e.primary}", using preset`}),c=H(t.primary)),c=P(c,1);const s=zr(n)?"dark":"light",i=s==="dark",d=e.contrast==="high",b=Ao(s,d),N=Math.max(0,Math.min(1,e.tint??0)),g=d?7:4.5,v=d?4.5:3,p=jr(i?I:{r:17,g:17,b:17,a:1},c,N);let f,$,R;const L=l=>jr(l,c,N);if(i){const l=y(I,n)>=6?I:Z;f=W(n,l,.07,b.elevationMin,L),$=W(f,l,.05,1.12,L),R=W($,l,.05,1.12,L)}else{const l=y(I,n);if(l>=b.elevationMin*1.01){const u=l>=1.149995?1.1:b.elevationMin;f=W(n,I,.5,u,L),$=y(I,f)>=1.03?W(f,I,.6,1.03,L):P(I,1),R=L(or($,Z,.035))}(!f||y(f,n)<b.elevationMin)&&(f=W(n,Z,.03,b.elevationMin,L),$=P(I,1),R=L(or($,Z,.05)))}if(!f||!$||!R)throw new Error("theme: elevation ladder not resolved");const K=ur(i?{l:.94,c:0,h:0,a:1}:{l:.28,c:0,h:0,a:1}),U=Zr(K),_=l=>[n,f,$,R].reduce((u,E)=>y(l,E)<y(l,u)?E:u,n),j=(l,u,E)=>{let M=l,F=0;for(;y(P(p,M),_(P(p,M)))<u&&M<1&&F++<25;)M=Math.min(1,M+.04);return M!==l&&a.push({token:E,reason:`raised opacity ${l}→${M.toFixed(2)} to reach ${u}:1 on surfaces`}),M},Y=j(b.text,g,"text"),tr=j(b.textMuted,g,"text-muted"),nr=j(b.textFaint,v,"text-faint"),V=(()=>{const l=y(I,c),u=y({r:17,g:17,b:17,a:1},c);if(l>=g)return I;const E=u>l?{r:17,g:17,b:17,a:1}:I;return Math.max(l,u)<g&&a.push({token:"on-primary",reason:`neither white nor black reaches ${g}:1 on primary (best ${Math.max(l,u).toFixed(2)}:1)`}),E})(),ar=C(c,i?.06:-.06),cr=C(c,i?.1:-.1),B=z(c,n,g,"auto");y(B,n)>y(c,n)+.01&&a.push({token:"primary-text",reason:`primary lightened/darkened to reach ${g}:1 as text on surface`});const Jr=z(c,n,v,"auto"),Kr=z(c,n,v,"auto"),sr=l=>{const u=H(Br[l]),E=y(I,u),M=y({r:17,g:17,b:17,a:1},u),F=E>=g?I:M>E?{r:17,g:17,b:17,a:1}:I;return{base:u,on:F,text:z(u,n,g,"auto"),soft:P(u,b.soft),border:z(u,n,v,"auto"),dark:C(u,-.1),light:C(u,.12),darker:C(u,-.18),bright:C(u,.22)}},Yr=sr("success"),Vr=sr("warning"),Qr=sr("error"),Xr=sr("info"),[ro,oo,eo,to]=Mo[e.radius??"md"],kr="'Inter', sans-serif",xr=l=>{var u;return(u=l==null?void 0:l.name)!=null&&u.trim()?`'${l.name.trim().replace(/'/g,"\\'")}', ${kr}`:kr},wr=xr((Tr=e.fonts)==null?void 0:Tr.ui),no=($r=e.fonts)!=null&&$r.heading?xr(e.fonts.heading):wr,ao=Array.from(new Set([(Er=(Ar=e.fonts)==null?void 0:Ar.ui)==null?void 0:Er.src,(Cr=(Nr=e.fonts)==null?void 0:Nr.heading)==null?void 0:Cr.src].filter(l=>!!l&&/^https?:\/\//.test(l)))),Ir=(_r=e.font)!=null&&_r.size&&e.font.size>0?e.font.size:14,A={"color-scheme":s,surface:h(n),"surface-rgb":S(n),"surface-1":h(f),"surface-1-rgb":S(f),"surface-2":h($),"surface-2-rgb":S($),"surface-3":h(R),"surface-inverse":h(K),scrim:"rgba(0, 0, 0, 0.5)",ink:h(p),"ink-rgb":S(p),text:T(p,Y),"text-muted":T(p,tr),"text-faint":T(p,nr),"text-inverse":h(U),"text-on-surface-rgb":S(p),"text-on-inverse-rgb":S(U),border:T(p,b.border),"border-strong":T(p,b.borderStrong),divider:T(p,b.divider),"border-rgb":S(p),fill:T(p,b.fill),"fill-hover":T(p,b.fillHover),"fill-active":T(p,b.fillActive),field:T(p,b.field),"field-hover":T(p,b.fieldHover),"field-focus":T(p,b.fieldFocus),hover:T(p,b.hover),pressed:T(p,b.pressed),primary:h(c),"primary-rgb":S(c),"primary-hover":h(ar),"primary-active":h(cr),"on-primary":h(V),"primary-text":h(B),"primary-border":h(Jr),"primary-soft":T(c,b.soft),"primary-soft-hover":T(c,b.softHover),"focus-ring":h(Kr),"focus-ring-width":d?"3px":"2px","focus-ring-offset":"2px","primary-dark":h(C(c,-.1)),"primary-dark-rgb":S(C(c,-.1)),"primary-light":h(C(c,.1)),"primary-light-rgb":S(C(c,.1)),"primary-bright":h(C(c,.2)),"primary-bright-rgb":S(C(c,.2)),"shadow-1":i?"0 1px 2px rgba(0, 0, 0, 0.4)":"0 1px 2px rgba(0, 0, 0, 0.08)","shadow-2":i?"0 6px 20px rgba(0, 0, 0, 0.45)":"0 6px 20px rgba(0, 0, 0, 0.12)","shadow-3":i?"0 12px 40px rgba(0, 0, 0, 0.5)":"0 12px 40px rgba(0, 0, 0, 0.16)","radius-sm":ro,"radius-md":oo,"radius-lg":eo,"radius-full":to,"font-family":wr,"font-family-heading":no,"font-size":`${Ir}px`,"root-font-size":String(Ir),canvas:i?"rgba(0, 0, 0, 0.25)":"rgba(0, 0, 0, 0.04)","canvas-image":i?To:$o,"canvas-control":"rgba(0, 0, 0, 0.45)","canvas-control-hover":"rgba(0, 0, 0, 0.6)","on-canvas-control":"#ffffff","disabled-opacity":"0.55"};for(const[l,u]of[["success",Yr],["warning",Vr],["error",Qr],["info",Xr]])A[l]=h(u.base),A[`${l}-rgb`]=S(u.base),A[`on-${l}`]=h(u.on),A[`${l}-text`]=h(u.text),A[`${l}-soft`]=h(u.soft),A[`${l}-border`]=h(u.border),A[`${l}-dark-rgb`]=S(u.dark),A[`${l}-light-rgb`]=S(u.light),l==="info"?A["info-bright-rgb"]=S(u.bright):A[`${l}-darker-rgb`]=S(u.darker);if(e.overrides)for(const[l,u]of Object.entries(e.overrides)){if(!u||!Q.includes(l))continue;A[l]=u;const E=`${l}-rgb`;if(Q.includes(E)){const M=H(u);M&&(A[E]=S(M))}}for(const l of Q)A[l]===void 0&&(A[l]="");const Sr=A,Mr=l=>H(Sr[l]),k=(l,u,E,M)=>{const F=Mr(u),Lr=Mr(E),Hr=F&&Lr?y(F,br(Lr,n)):0;return{label:l,fg:u,bg:E,ratio:Math.round(Hr*100)/100,min:M,pass:Hr>=M}},co=[k("Text on surface","text","surface",g),k("Muted text on surface","text-muted","surface",g),k("Faint text on surface","text-faint","surface",v),k("Text on cards (surface-1)","text","surface-1",g),k("Text on popovers (surface-2)","text","surface-2",g),k("Cards distinguishable from surface","surface-1","surface",b.elevationMin),k("Popovers distinguishable from cards","surface-2","surface-1",i?1.12:1),k("Strong border on surface","border-strong","surface",d?3:1.5),k("Text on primary","on-primary","primary",g),k("Primary as text on surface","primary-text","surface",g),k("Primary border on surface","primary-border","surface",v),k("Focus ring on surface","focus-ring","surface",v),k("Success text on surface","success-text","surface",g),k("Warning text on surface","warning-text","surface",g),k("Error text on surface","error-text","surface",g),k("Info text on surface","info-text","surface",g),k("Text on success","on-success","success",g),k("Text on warning","on-warning","warning",g),k("Text on error","on-error","error",g),k("Text on tooltip","text-inverse","surface-inverse",g)];return{input:e,mode:s,tokens:Sr,report:{mode:s,checks:co,adjustments:a},fontUrls:ao}}const r=o=>`var(${X}${o})`,yr={"root-font-size":r("root-font-size"),"font-family":r("font-family"),"bx-focus-ring-color":r("focus-ring"),"bx-focus-ring-width":r("focus-ring-width"),"bx-focus-ring-offset":r("focus-ring-offset"),"app-background-color":r("surface"),"app-background-color-rgb":r("surface-rgb"),"app-divider-color":r("divider"),"secondary-color-rgb":r("surface-2-rgb"),"editor-view-background-color":r("surface"),"fields-view-background-color":"transparent","live-view-background-color":"transparent","popup-background-color":r("surface-1"),"bluepic-embed-editor-border":`1px solid ${r("border")}`,"bluepic-embed-editor-border-radius":r("radius-lg"),"primary-color-base":r("primary-rgb"),"primary-color-dark":r("primary-dark-rgb"),"primary-color-light":r("primary-light-rgb"),"primary-color-bright":r("primary-bright-rgb"),"info-color-base":r("info-rgb"),"info-color-dark":r("info-dark-rgb"),"info-color-light":r("info-light-rgb"),"info-color-bright":r("info-bright-rgb"),"success-color-base":r("success-rgb"),"success-color-light":r("success-light-rgb"),"success-color-dark":r("success-dark-rgb"),"success-color-darker":r("success-darker-rgb"),"error-color-base":r("error-rgb"),"error-color-light":r("error-light-rgb"),"error-color-dark":r("error-dark-rgb"),"error-color-darker":r("error-darker-rgb"),"warning-color-base":r("warning-rgb"),"warning-color-light":r("warning-light-rgb"),"warning-color-dark":r("warning-dark-rgb"),"warning-color-darker":r("warning-darker-rgb"),"text-color-base":r("text-on-surface-rgb"),"text-color-alt":r("text-on-inverse-rgb"),"border-color-base":r("border-rgb"),"background-color-base":r("surface-rgb"),"priinfomary-color-base":r("info-rgb"),"primainfory-color-bright":r("primary-bright-rgb"),"primary-color":r("primary"),"info-color":r("info"),"bx-primary-color":r("primary"),"bx-text-color":r("text"),"bx-modal-color":r("surface-1"),"bx-card-color":r("surface-1"),"upload-background-color":r("field"),"upload-text-color-title":r("text"),"upload-text-color-description":r("text-muted"),"input-background-color":r("field"),"input-background-color-hover":r("field-hover"),"input-background-color-focus":r("field-focus"),"input-border-color":"transparent","input-border-color-hover":"transparent","input-border-color-focus":r("primary-border"),"input-shadow-focus-color":r("focus-ring"),"input-bordered-border-color":r("border-strong"),"input-bordered-border-color-hover":r("border-strong"),"input-bordered-border-color-focus":r("primary-border"),"input-outline-color-focus":r("focus-ring"),"input-border-color-disabled":r("border"),"input-opacity-disabled":r("disabled-opacity"),"input-ghost-border-color-hover":r("border"),"input-ghost-border-color-focus":r("primary-border"),"input-number-ctrl-separator-color":r("divider"),"input-number-ctrl-color":r("text-muted"),"input-number-ctrl-color-hover":r("text"),"input-number-ctrl-background-color-hover":r("hover"),"input-state-active-background-color":r("primary-soft"),"input-state-active-background-color-hover":r("primary-soft"),"input-state-active-background-color-focus":r("primary-soft"),"input-state-active-border-color":r("primary-border"),"input-state-active-border-color-hover":r("primary-border"),"input-state-active-border-color-focus":r("primary-border"),"input-state-success-background-color":r("success-soft"),"input-state-success-background-color-hover":r("success-soft"),"input-state-success-background-color-focus":r("success-soft"),"input-state-success-border-color":r("success-border"),"input-state-success-border-color-hover":r("success-border"),"input-state-success-border-color-focus":r("success-border"),"input-state-error-background-color":r("error-soft"),"input-state-error-background-color-hover":r("error-soft"),"input-state-error-background-color-focus":r("error-soft"),"input-state-error-border-color":r("error-border"),"input-state-error-border-color-hover":r("error-border"),"input-state-error-border-color-focus":r("error-border"),"input-state-warning-background-color":r("warning-soft"),"input-state-warning-background-color-hover":r("warning-soft"),"input-state-warning-background-color-focus":r("warning-soft"),"input-state-warning-border-color":r("warning-border"),"input-state-warning-border-color-hover":r("warning-border"),"input-state-warning-border-color-focus":r("warning-border"),"card-background-color":r("surface-1"),"card-background-color-hover":r("surface-2"),"card-border-color":r("border"),"card-header-divider-color":r("divider"),"card-footer-divider-color":r("divider"),"card-footer-background-color":r("hover"),"select-background-color":r("field"),"select-background-color-hover":r("field-hover"),"select-background-color-focus":r("field-focus"),"select-border":"1px solid transparent","select-border-hover":"1px solid transparent","select-border-focus":`1px solid ${r("primary-border")}`,"select-color":r("text"),"select-color-hover":r("text"),"select-color-focus":r("text"),"select-button-background-color":r("fill"),"select-button-background-color-hover":r("fill-hover"),"select-item-border":`2px solid ${r("primary-border")}`,"checkbox-background-color":r("field"),"checkbox-border-color":r("border-strong"),"checkbox-border-color-hover":r("primary-border"),"checkbox-outline-color-focus":r("focus-ring"),"checkbox-border-color-focus":r("primary-border"),"checkbox-background-color-checked":r("primary"),"checkbox-border-color-checked":"transparent","checkbox-background-color-checked-hover":r("primary-hover"),"checkbox-border-color-checked-hover":"transparent","checkbox-symbol-color":r("text-faint"),"checkbox-symbol-color-checked":r("on-primary"),"checkbox-secondary-background-color":r("fill"),"checkbox-secondary-background-color-hover":r("fill-hover"),"checkbox-secondary-background-color-checked":r("fill-active"),"checkbox-secondary-border":`1px solid ${r("border")}`,"checkbox-secondary-border-hover":`1px solid ${r("border-strong")}`,"checkbox-secondary-border-checked":`1px solid ${r("border-strong")}`,"checkbox-secondary-symbol-color":r("text-muted"),"checkbox-secondary-symbol-color-checked":r("primary-text"),"popover-background-color":r("surface-2"),"popover-border-color":r("border"),"popover-border":`1px solid ${r("border")}`,"popover-arrow-border-color":r("border"),"popover-without-darkened-bg-background-color":r("surface-2-rgb"),"popover-without-darkened-bg-box-shadow":r("shadow-2"),"tooltip-background-color":r("surface-inverse"),"tooltip-text-color":r("text-inverse"),"tooltip-border-color":"transparent","menu-item-color":r("text"),"menu-item-color-active":r("primary-text"),"menu-item-background-color":"transparent","menu-item-background-color-active":r("primary-soft"),"menu-item-background-color-hover":r("hover"),"menu-item-background-color-active-hover":r("primary-soft-hover"),"menu-divider":`1px solid ${r("divider")}`,"labeled-text-color":r("text-muted"),"label-background-color":r("fill"),"list-divider":`1px solid ${r("divider")}`,"list-item-background-color-hover":r("hover"),"empty-text-color":r("text-faint"),"tag-background-color":r("fill"),"tag-color":r("text"),"tag-border-color":r("border"),"tag-error-background-color":r("error-soft"),"tag-error-color":r("error-text"),"tag-error-border-color":r("error-border"),"tag-success-background-color":r("success-soft"),"tag-success-color":r("success-text"),"tag-success-border-color":r("success-border"),"tag-warning-background-color":r("warning-soft"),"tag-warning-color":r("warning-text"),"tag-warning-border-color":r("warning-border"),"tag-info-background-color":r("info-soft"),"tag-info-color":r("info-text"),"tag-info-border-color":r("info-border"),"alert-background-color":r("fill"),"alert-color":r("text"),"alert-border-color":r("border"),"alert-icon-color":r("text-muted"),"alert-info-background-color":r("info-soft"),"alert-info-color":r("info-text"),"alert-info-icon-color":r("info-text"),"alert-info-border-color":r("info-border"),"alert-success-background-color":r("success-soft"),"alert-success-color":r("success-text"),"alert-success-icon-color":r("success-text"),"alert-success-border-color":r("success-border"),"alert-warning-background-color":r("warning-soft"),"alert-warning-color":r("warning-text"),"alert-warning-icon-color":r("warning-text"),"alert-warning-border-color":r("warning-border"),"alert-error-background-color":r("error-soft"),"alert-error-color":r("error-text"),"alert-error-icon-color":r("error-text"),"alert-error-border-color":r("error-border"),"slider-body-background-color":r("fill-active"),"slider-body-background-color-hover":r("fill-active"),"slider-body-background-color-focus":r("fill-active"),"slider-thumb-background-color":r("primary"),"slider-thumb-background-color-hover":r("primary-hover"),"slider-thumb-background-color-focus":r("primary-hover"),"slider-thumb-box-shadow":r("shadow-1"),"slider-value-background-color":r("primary"),"slider-value-background-color-hover":r("primary"),"slider-value-background-color-focus":r("primary"),"progress-background-color":r("fill"),"progress-value-color":r("primary"),"tab-color":r("text-muted"),"tab-color-active":r("primary-text"),"tab-segment-background-color":r("fill"),"tab-segment-background-color-active":r("surface-2"),"tab-segment-color":r("text-muted"),"tab-segment-color-active":r("text"),"tab-inline-item-background-color-hover":r("hover"),"tab-item-active-box-shadow":r("shadow-1"),"switch-background-color":r("fill-active"),"switch-border":"none","switch-thumb-background-color":r("surface-3"),"switch-thumb-border":"none","switch-thumb-shadow":r("shadow-1"),"switch-border-hover":"none","switch-background-color-hover":r("fill-active"),"switch-thumb-background-color-hover":r("surface-3"),"switch-thumb-border-hover":"none","switch-active-background-color":r("primary"),"switch-active-border":"none","switch-active-thumb-background-color":r("on-primary"),"switch-active-thumb-border":"none","switch-active-thumb-shadow":r("shadow-1"),"switch-active-background-color-hover":r("primary-hover"),"switch-active-border-hover":"none","switch-active-thumb-background-color-hover":r("on-primary"),"switch-active-thumb-border-hover":"none","radio-background-color":"transparent","radio-background-color-active":r("primary"),"radio-background-color-hover":"transparent","radio-border":`1px solid ${r("border-strong")}`,"radio-border-active":`1px solid ${r("primary")}`,"radio-border-color-hover":r("primary-border"),"radio-symbol-color":r("on-primary"),"radio-label-color":r("text"),"radio-label-color-active":r("text"),"button-background-color":"transparent","button-background-color-hover":r("hover"),"button-background-color-focus":r("hover"),"button-border":"none","button-border-hover":"none","button-border-focus":"none","button-text-color":r("text"),"button-text-color-hover":r("text"),"button-text-color-focus":r("text"),"button-box-shadow":"none","button-box-shadow-hover":"none","button-border-radius":r("radius-md"),"button-active-background-color":r("primary"),"button-active-text-color":r("on-primary"),"button-active-border":"none","button-active-box-shadow":"none","button-active-background-color-hover":r("primary-hover"),"button-active-text-color-hover":r("on-primary"),"button-active-border-hover":"none","button-active-box-shadow-hover":"none","button-secondary-background-color":r("fill"),"button-secondary-background-color-hover":r("fill-hover"),"button-secondary-background-color-focus":r("fill-hover"),"button-secondary-border":"1px solid transparent","button-secondary-border-hover":"1px solid transparent","button-secondary-border-focus":"1px solid transparent","button-secondary-text-color":r("text"),"button-secondary-text-color-hover":r("text"),"button-secondary-text-color-focus":r("text"),"button-secondary-box-shadow":"none","button-secondary-box-shadow-hover":"none","button-secondary-active-background-color":r("fill-active"),"button-secondary-active-background-color-hover":r("fill-active"),"button-secondary-active-background-color-focus":r("fill-active"),"button-secondary-active-border":"1px solid transparent","button-secondary-active-border-hover":"1px solid transparent","button-secondary-active-border-focus":"1px solid transparent","button-secondary-active-text-color":r("text"),"button-secondary-active-text-color-hover":r("text"),"button-secondary-active-text-color-focus":r("text"),"button-secondary-active-box-shadow":"none","button-secondary-active-box-shadow-hover":"none","button-tertiary-background-color":"transparent","button-tertiary-background-color-hover":r("hover"),"button-tertiary-background-color-focus":r("hover"),"button-tertiary-border":`1px solid ${r("border-strong")}`,"button-tertiary-border-hover":`1px solid ${r("border-strong")}`,"button-tertiary-border-focus":`1px solid ${r("border-strong")}`,"button-tertiary-text-color":r("text"),"button-tertiary-text-color-hover":r("text"),"button-tertiary-text-color-focus":r("text"),"button-tertiary-box-shadow":"none","button-tertiary-box-shadow-hover":"none","button-tertiary-box-shadow-focus":"none","button-tertiary-active-background-color":r("primary"),"button-tertiary-active-background-color-hover":r("primary-hover"),"button-tertiary-active-background-color-focus":r("primary-hover"),"button-tertiary-active-border":`1px solid ${r("primary")}`,"button-tertiary-active-border-hover":`1px solid ${r("primary")}`,"button-tertiary-active-border-focus":`1px solid ${r("primary")}`,"button-tertiary-active-text-color":r("on-primary"),"button-tertiary-active-text-color-hover":r("on-primary"),"button-tertiary-active-text-color-focus":r("on-primary"),"button-tertiary-active-box-shadow":"none","button-tertiary-active-box-shadow-hover":"none","button-tertiary-active-box-shadow-focus":"none","button-quaternary-background-color":"transparent","button-quaternary-background-color-hover":"transparent","button-quaternary-text-color":r("text-muted"),"button-quaternary-text-color-hover":r("text"),"button-quaternary-active-background-color":"transparent","button-quaternary-active-background-color-hover":"transparent","button-quaternary-active-text-color":r("text"),"button-quaternary-active-text-color-hover":r("text"),"button-state-active-background-color":r("primary-soft"),"button-state-active-background-color-hover":r("primary-soft-hover"),"button-state-active-background-color-active":r("primary-soft"),"button-state-active-background-color-active-hover":r("primary-soft-hover"),"button-state-active-background-color-solid":r("primary"),"button-state-active-background-color-solid-hover":r("primary-hover"),"button-state-active-border-color":r("primary-border"),"button-state-active-border-color-hover":r("primary-border"),"button-state-active-text-color":r("primary-text"),"button-state-active-text-color-tertiary":r("primary-text"),"button-state-success-background-color":r("success-soft"),"button-state-success-background-color-hover":r("success-soft"),"button-state-success-background-color-active":r("success-soft"),"button-state-success-background-color-active-hover":r("success-soft"),"button-state-success-background-color-solid":r("success"),"button-state-success-background-color-solid-hover":r("success"),"button-state-success-border-color":r("success-border"),"button-state-success-border-color-hover":r("success-border"),"button-state-success-text-color":r("success-text"),"button-state-success-text-color-tertiary":r("success-text"),"button-state-error-background-color":r("error-soft"),"button-state-error-background-color-hover":r("error-soft"),"button-state-error-background-color-active":r("error-soft"),"button-state-error-background-color-active-hover":r("error-soft"),"button-state-error-background-color-solid":r("error"),"button-state-error-background-color-solid-hover":r("error"),"button-state-error-border-color":r("error-border"),"button-state-error-border-color-hover":r("error-border"),"button-state-error-text-color":r("error-text"),"button-state-error-text-color-tertiary":r("error-text"),"button-state-warning-background-color":r("warning-soft"),"button-state-warning-background-color-hover":r("warning-soft"),"button-state-warning-background-color-active":r("warning-soft"),"button-state-warning-background-color-active-hover":r("warning-soft"),"button-state-warning-background-color-solid":r("warning"),"button-state-warning-background-color-solid-hover":r("warning"),"button-state-warning-border-color":r("warning-border"),"button-state-warning-border-color-hover":r("warning-border"),"button-state-warning-text-color":r("warning-text"),"button-state-warning-text-color-tertiary":r("warning-text"),"message-body-background-color":r("surface-2"),"message-body-text-color":r("text"),"message-body-border":`1px solid ${r("border")}`,"canvas-background-color":r("canvas"),"canvas-background-image":r("canvas-image"),"canvas-btn-background-color":r("canvas-control"),"canvas-btn-background-color-hover":r("canvas-control-hover"),"canvas-btn-color":r("on-canvas-control"),"btn-color":r("on-canvas-control"),"gallery-card-background-color":r("surface-1"),"gallery-card-background-color-hover":r("surface-2"),"gallery-card-border":`1px solid ${r("border")}`,"gallery-action-btn-background-color":r("scrim"),"gallery-action-btn-color":"#ffffff","gallery-card-name-text-color":r("text"),"gallery-card-description-text-color":r("text-muted"),"spinner-color":r("text")},No=new Set(Object.keys(yr).filter(o=>`--${o}`.startsWith(X)&&Q.includes(`--${o}`.slice(X.length)))),Co=Object.entries(yr).filter(([o])=>!No.has(o));function qr(o){const e={};for(const[t,a]of Object.entries(o.tokens))a!==""&&(e[`${X}${t}`]=a);for(const[t,a]of Co)e[`--${t}`]=a;if(o.input.customStyle)for(const[t,a]of Object.entries(o.input.customStyle))t==="key"||a==null||a===""||(e[t.startsWith("--")?t:`--${t}`]=String(a));return e}function _o(o,e){const t=Array.isArray(e)?e.join(", "):e,a=qr(o),n=Object.entries(a).map(([c,s])=>`${c}: ${s};`).join(" ");return`${t} { color-scheme: ${o.mode}; ${n} }`}function Lo(o){return!!o&&typeof o=="object"&&o.version===2}function Ho(o){const e=o??{},t=e["editor-view-background-color"]||(e["app-background-color-rgb"]?`rgb(${e["app-background-color-rgb"]})`:void 0)||e["popup-background-color"],a=e["primary-color-base"]?`rgb(${e["primary-color-base"]})`:void 0,n=H(t)?t:void 0,c=H(a)?a:void 0,s=typeof e.key=="string"&&e.key.endsWith("-wcag"),i={version:2};return n&&(i.surface=n),c&&(i.primary=c),s&&(i.contrast="high"),typeof e.key=="string"&&(i.preset=e.key.startsWith("light")?"light":"dark"),i}exports.LEGACY_BRIDGE=yr;exports.SEMANTIC_PREFIX=X;exports.SEMANTIC_TOKEN_GROUPS=so;exports.SEMANTIC_TOKEN_NAMES=Q;exports.STATUS_BASES=Br;exports.THEME_HOUSE_PRESETS=io;exports.THEME_PRESETS=Or;exports.looksLikeThemeInput=Lo;exports.resolveTheme=Eo;exports.themeColor=So;exports.themeInputFromLegacyCustomStyle=Ho;exports.themeToCssText=_o;exports.themeToCssVars=qr;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=["color-scheme","surface","surface-rgb","surface-1","surface-1-rgb","surface-2","surface-2-rgb","surface-3","surface-inverse","scrim","ink","ink-rgb","text","text-muted","text-faint","text-inverse","text-on-surface-rgb","text-on-inverse-rgb","border","border-strong","divider","border-rgb","fill","fill-hover","fill-active","field","field-hover","field-focus","hover","pressed","primary","primary-rgb","primary-hover","primary-active","on-primary","primary-text","primary-border","primary-soft","primary-soft-hover","focus-ring","focus-ring-width","focus-ring-offset","primary-dark","primary-dark-rgb","primary-light","primary-light-rgb","primary-bright","primary-bright-rgb","success","success-rgb","on-success","success-text","success-soft","success-border","success-dark-rgb","success-light-rgb","success-darker-rgb","warning","warning-rgb","on-warning","warning-text","warning-soft","warning-border","warning-dark-rgb","warning-light-rgb","warning-darker-rgb","error","error-rgb","on-error","error-text","error-soft","error-border","error-dark-rgb","error-light-rgb","error-darker-rgb","info","info-rgb","on-info","info-text","info-soft","info-border","info-dark-rgb","info-light-rgb","info-bright-rgb","shadow-1","shadow-2","shadow-3","radius-sm","radius-md","radius-lg","radius-full","font-family","font-family-heading","font-size","root-font-size","canvas","canvas-image","canvas-control","canvas-control-hover","on-canvas-control","disabled-opacity"],X="--bx-",so=[{label:"Surfaces",tokens:["surface","surface-1","surface-2","surface-3","surface-inverse","scrim"]},{label:"Text",tokens:["text","text-muted","text-faint","text-inverse"]},{label:"Borders",tokens:["border","border-strong","divider"]},{label:"Neutral fills",tokens:["fill","fill-hover","fill-active","field","field-hover","field-focus","hover","pressed"]},{label:"Primary",tokens:["primary","primary-hover","primary-active","on-primary","primary-text","primary-border","primary-soft","primary-soft-hover","focus-ring"]},{label:"Success",tokens:["success","on-success","success-text","success-soft","success-border"]},{label:"Warning",tokens:["warning","on-warning","warning-text","warning-soft","warning-border"]},{label:"Error",tokens:["error","on-error","error-text","error-soft","error-border"]},{label:"Info",tokens:["info","on-info","info-text","info-soft","info-border"]},{label:"Shape & type",tokens:["radius-sm","radius-md","radius-lg","radius-full","font-family","font-family-heading","font-size"]},{label:"Canvas",tokens:["canvas","canvas-control","on-canvas-control"]}],Or={dark:{surface:"#27262e",primary:"#4472c7"},light:{surface:"#f2f2f2",primary:"#124bba"}},io=[{key:"light",label:"Light",description:"Neutral light surfaces, Bluepic blue.",input:{version:2,preset:"light"}},{key:"dark",label:"Dark",description:"Neutral dark surfaces, Bluepic blue.",input:{version:2,preset:"dark"}},{key:"midnight",label:"Midnight",description:"Near-black with cool, slightly tinted surfaces.",input:{version:2,surface:"#0f1117",primary:"#7da8f7",tint:.35}},{key:"paper",label:"Paper",description:"Warm off-white, ink-black actions, crisp corners.",input:{version:2,surface:"#fbf8f1",primary:"#1f1f1f",radius:"sm"}},{key:"slate",label:"Slate",description:"Blue-grey dark surfaces with a teal accent.",input:{version:2,surface:"#1e2530",primary:"#4fd1c5",tint:.4}},{key:"sand",label:"Sand",description:"Soft sand surfaces with a terracotta accent, rounded.",input:{version:2,surface:"#f3ede3",primary:"#b5562c",radius:"lg"}},{key:"forest",label:"Forest",description:"Deep green surfaces with a mint accent.",input:{version:2,surface:"#0e1f17",primary:"#7ad39a",tint:.5}},{key:"ocean",label:"Ocean",description:"Cool light surfaces with a deep blue accent, pill shapes.",input:{version:2,surface:"#eef4fb",primary:"#0b5cad",tint:.3,radius:"full"}},{key:"graphite",label:"Graphite",description:"Pure black, high contrast, sharp corners — signage and dark brands.",input:{version:2,surface:"#000000",primary:"#ffffff",radius:"none",contrast:"high"}},{key:"plum",label:"Plum",description:"Deep aubergine surfaces with a warm coral accent.",input:{version:2,surface:"#1f1423",primary:"#ff7a59",tint:.45,radius:"lg"}},{key:"linen",label:"Linen",description:"Soft white linen with a muted navy accent, rounded.",input:{version:2,surface:"#f7f7f4",primary:"#2f3e5c",tint:.15,radius:"lg"}}],Br={success:"#28a552",warning:"#d9a400",error:"#dc2f2f",info:"#3b82f6"},I=Object.freeze({r:255,g:255,b:255,a:1}),Z=Object.freeze({r:0,g:0,b:0,a:1}),Pr=[I,Object.freeze({r:17,g:17,b:17,a:1})],dr=(o,e,t)=>o<e?e:o>t?t:o,w=o=>dr(o,0,1),m=(o,e=0)=>Number.isFinite(o)?o:e,x=(o,e,t,a=1)=>({r:o,g:e,b:t,a}),O=o=>Math.round(dr(m(o),0,255)),ir=o=>O(o).toString(16).padStart(2,"0"),lo={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Fr=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/,uo=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(deg|turn|rad|grad)?$/,bo=/^(rgba?|hsla?)\(\s*(.*?)\s*\)$/;function mr(o){if(o==="none")return{value:0,percent:!1};const e=o.endsWith("%"),t=e?o.slice(0,-1):o;if(!Fr.test(t))return null;const a=Number(t);return Number.isFinite(a)?{value:a,percent:e}:null}function gr(o){const e=mr(o);return e?dr(e.percent?e.value*255/100:e.value,0,255):null}function go(o){const e=mr(o);return e?w(e.percent?e.value/100:e.value):null}function Dr(o){const e=mr(o);return e?w(e.value/100):null}function fo(o){if(o==="none")return 0;const e=uo.exec(o);if(!e)return null;let t=Number(e[1]);if(!Number.isFinite(t))return null;switch(e[2]){case"turn":t*=360;break;case"rad":t*=180/Math.PI;break;case"grad":t*=.9;break}return t%=360,t<0&&(t+=360),t}function po(o){if(o.includes(",")){if(o.includes("/"))return null;const n=o.split(",").map(c=>c.trim());return n.length!==3&&n.length!==4||n.some(c=>c===""||/\s/.test(c))?null:{ch:[n[0],n[1],n[2]],alpha:n[3]}}const e=o.split("/");if(e.length>2)return null;const t=e[0].trim().split(/\s+/);if(t.length!==3)return null;let a;return e.length===2&&(a=e[1].trim(),a===""||/\s/.test(a))?null:{ch:[t[0],t[1],t[2]],alpha:a}}function ho(o,e,t){const a=n=>{const c=(n+o/30)%12,s=e*Math.min(t,1-t);return t-s*Math.max(-1,Math.min(c-3,9-c,1))};return[a(0)*255,a(8)*255,a(4)*255]}function H(o){if(typeof o!="string")return null;const e=o.trim().toLowerCase();if(!e)return null;if(e==="transparent")return x(0,0,0,0);const t=lo[e];if(t!==void 0)return x(t>>16,t>>8&255,t&255,1);if(e[0]==="#"){const n=e.slice(1);if(!/^[0-9a-f]+$/.test(n))return null;const c=i=>parseInt(n[i],16),s=i=>parseInt(n.slice(i,i+2),16);switch(n.length){case 3:return x(c(0)*17,c(1)*17,c(2)*17,1);case 4:return x(c(0)*17,c(1)*17,c(2)*17,c(3)*17/255);case 6:return x(s(0),s(2),s(4),1);case 8:return x(s(0),s(2),s(4),s(6)/255);default:return null}}const a=bo.exec(e);if(a){const n=po(a[2]);if(!n)return null;const c=n.alpha===void 0?1:go(n.alpha);if(c===null)return null;if(a[1]==="rgb"||a[1]==="rgba"){const v=gr(n.ch[0]),D=gr(n.ch[1]),p=gr(n.ch[2]);return v===null||D===null||p===null?null:x(v,D,p,c)}const s=fo(n.ch[0]),i=Dr(n.ch[1]),d=Dr(n.ch[2]);if(s===null||i===null||d===null)return null;const[b,N,g]=ho(s,i,d);return x(b,N,g,c)}if(e.includes(",")){const n=e.split(",").map(d=>d.trim());if(n.length!==3||!n.every(d=>Fr.test(d)))return null;const[c,s,i]=n.map(d=>dr(Number(d),0,255));return x(c,s,i,1)}return null}function q(o){const e=w(o);return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function fr(o){const e=w(o);return e<=.0031308?e*12.92:1.055*Math.pow(e,1/2.4)-.055}function mo(o,e,t){const a=.4122214708*o+.5363325363*e+.0514459929*t,n=.2119034982*o+.6806995451*e+.1073969566*t,c=.0883024619*o+.2817188376*e+.6299787005*t,s=Math.cbrt(a),i=Math.cbrt(n),d=Math.cbrt(c);return{L:.2104542553*s+.793617785*i-.0040720468*d,a:1.9779984951*s-2.428592205*i+.4505937099*d,b:.0259040371*s+.7827717662*i-.808675766*d}}function pr(o,e,t){const a=o+.3963377774*e+.2158037573*t,n=o-.1055613458*e-.0638541728*t,c=o-.0894841775*e-1.291485548*t,s=a*a*a,i=n*n*n,d=c*c*c;return[4.0767416621*s-3.3077115913*i+.2309699292*d,-1.2684380046*s+2.6097574011*i-.3413193965*d,-.0041960863*s-.7034186147*i+1.707614701*d]}function lr(o){return mo(q(o.r/255),q(o.g/255),q(o.b/255))}const vo=1e-6;function Gr(o){const e=Math.hypot(o.a,o.b);let t=e<vo?0:Math.atan2(o.b,o.a)*180/Math.PI;return t<0&&(t+=360),t>=360&&(t-=360),{l:o.L,c:e,h:t}}function hr(o,e,t){const a=t*Math.PI/180;return{L:o,a:e*Math.cos(a),b:e*Math.sin(a)}}const G=1e-6,Rr=o=>o[0]>=-G&&o[0]<=1+G&&o[1]>=-G&&o[1]<=1+G&&o[2]>=-G&&o[2]<=1+G;function er(o,e,t,a){const n=w(m(o));let c=Math.max(0,m(e));const s=m(t);let i=hr(n,c,s),d=pr(i.L,i.a,i.b);if(!Rr(d)){let b=0,N=c;for(let g=0;g<24;g++){const v=(b+N)/2,D=hr(n,v,s);Rr(pr(D.L,D.a,D.b))?b=v:N=v}c=b,i=hr(n,c,s),d=pr(i.L,i.a,i.b)}return x(fr(d[0])*255,fr(d[1])*255,fr(d[2])*255,w(m(a,1)))}function J(o){const e=Gr(lr(o));return{l:e.l,c:e.c,h:e.h,a:w(m(o.a,1))}}function ur(o){return er(o.l,o.c,o.h,o.a)}function yo(o){const e=w(m(o.a,1)),t=`#${ir(o.r)}${ir(o.g)}${ir(o.b)}`;return e<1?`${t}${ir(e*255)}`:t}function vr(o){const e=w(m(o.a,1)),t=O(o.r),a=O(o.g),n=O(o.b);return e>=1?`rgb(${t}, ${a}, ${n})`:`rgba(${t}, ${a}, ${n}, ${Number(e.toFixed(3))})`}function Wr(o){return`${O(o.r)}, ${O(o.g)}, ${O(o.b)}`}function rr(o){return .2126*q(m(o.r)/255)+.7152*q(m(o.g)/255)+.0722*q(m(o.b)/255)}function y(o,e){const t=e.a>=1?e:x(e.r,e.g,e.b,1),a=o.a<1?br(o,t):o,n=rr(a),c=rr(t),s=Math.max(n,c),i=Math.min(n,c);return(s+.05)/(i+.05)}function br(o,e){const t=w(m(o.a,1)),a=w(m(e.a,1)),n=t+a*(1-t);if(n<=0)return x(0,0,0,0);const c=a*(1-t)/n,s=t/n;return x(o.r*s+e.r*c,o.g*s+e.g*c,o.b*s+e.b*c,n)}function or(o,e,t){const a=w(m(t));if(a<=0)return x(o.r,o.g,o.b,w(m(o.a,1)));if(a>=1)return x(e.r,e.g,e.b,w(m(e.a,1)));const n=w(m(o.a,1)),c=w(m(e.a,1)),s=lr(o),i=lr(e),d=n+(c-n)*a,b=d>0?n*(1-a)/d:1-a,N=d>0?c*a/d:a,g={L:s.L*b+i.L*N,a:s.a*b+i.a*N,b:s.b*b+i.b*N},v=Gr(g);return er(v.l,v.c,v.h,d)}function P(o,e){return x(o.r,o.g,o.b,w(m(e,1)))}function ko(o){return lr(o).L}function C(o,e){const t=J(o);return er(w(t.l+m(e)),t.c,t.h,t.a)}function xo(o,e){const t=J(o);return er(w(m(e)),t.c,t.h,t.a)}const wo=[1,.75,.5,.25,0],Io=24;function z(o,e,t,a="auto"){const n=m(t,1);if(y(o,e)>=n)return o;const c=J(o),s=x(e.r,e.g,e.b,1),i=rr(s),d=(f,A)=>er(f,A,c.h,c.a),b=f=>y(f,s),N=f=>rr(f.a<1?br(f,s):f),g=f=>x(Math.round(f.r),Math.round(f.g),Math.round(f.b),f.a),v=f=>{const A=f==="lighter"?1:0,R=L=>f==="lighter"?N(L)>=i:N(L)<=i,_=L=>R(L)&&b(L)>=n,K=L=>_(L)&&_(g(L));let j=null;for(const L of wo){const U=c.c*L,Y=d(A,U),tr=b(Y);if((!j||tr>j.ratio)&&(j={color:Y,ratio:tr}),!K(Y))continue;let nr=c.l,V=A;for(let cr=0;cr<Io;cr++){const B=(nr+V)/2;K(d(B,U))?V=B:nr=B}const ar=d(V,U);return{color:ar,ratio:b(ar)}}return j};if(a==="lighter"||a==="darker")return v(a).color;const D=b(d(1,0)),p=b(d(0,0));return v(D>=p?"lighter":"darker").color}function zr(o){return y(I,o)>=y(Z,o)}function Zr(o,e=Pr){const t=e.length?e:Pr;let a=t[0],n=-1;for(const c of t){const s=y(c,o);s>n&&(n=s,a=c)}return x(a.r,a.g,a.b,a.a)}const So=Object.freeze(Object.defineProperty({__proto__:null,BLACK:Z,WHITE:I,adjustL:C,bestOn:Zr,composite:br,contrastRatio:y,ensureContrast:z,formatHex:yo,formatRgb:vr,formatTriplet:Wr,fromOklch:ur,isDarkSurface:zr,lightness:ko,mix:or,parseColor:H,relativeLuminance:rr,setL:xo,toOklch:J,withAlpha:P},Symbol.toStringTag,{value:"Module"})),Mo={none:["0px","0px","0px","0px"],sm:["3px","4px","6px","9999px"],md:["4px","6px","10px","9999px"],lg:["6px","10px","16px","9999px"],full:["10px","16px","24px","9999px"]},To="url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMDcpOyIgLz4KICA8cmVjdCB4PSI1MCUiIHk9IjAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMCk7IiAvPgogIDxyZWN0IHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMC4wNyk7IiAvPgogIDxyZWN0IHg9IjAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgyNTUsIDI1NSwgMjU1LCAwKTsiIC8+Cjwvc3ZnPg==')",Ao="url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDAsIDAsIDAsIDAuMDQ1KTsiIC8+CiAgPHJlY3QgeD0iNTAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgwLCAwLCAwLCAwLjA0NSk7IiAvPgo8L3N2Zz4=')";function $o(o,e){const t=o==="dark",a=e?.06:0;return{text:e?1:t?.92:.88,textMuted:e?.85:t?.66:.62,textFaint:e?.68:t?.46:.42,border:(t?.12:.1)+(e?.18:0),borderStrong:(t?.28:.22)+(e?.25:0),divider:(t?.1:.08)+(e?.15:0),fill:(t?.09:.06)+a,fillHover:(t?.14:.1)+a,fillActive:(t?.2:.15)+a,field:(t?.07:.04)+a,fieldHover:(t?.1:.06)+a,fieldFocus:(t?.1:.05)+a,hover:(t?.07:.05)+a,pressed:(t?.12:.09)+a,soft:(t?.18:.12)+(e?.08:0),softHover:(t?.26:.2)+(e?.08:0),elevationMin:e?1.3:t?1.18:1.06}}const h=o=>vr(o),S=o=>Wr(o),T=(o,e)=>vr(P(o,e)),jr=o=>({r:Math.round(o.r),g:Math.round(o.g),b:Math.round(o.b),a:o.a});function W(o,e,t,a,n=c=>c){let c=t,s=jr(n(or(o,e,c))),i=0;for(;y(s,o)<a&&c<1&&i++<40;)c=Math.min(1,c+.02),s=jr(n(or(o,e,c)));return P(s,1)}function Ur(o,e,t){if(t<=0)return o;const a=J(o),n=J(e);return ur({l:a.l,c:Math.min(.03,.03*t)+a.c*(1-t),h:n.h,a:a.a})}function Eo(o){var Tr,Ar,$r,Er,Nr,Cr,Lr;const e={version:2,...o??{}},t=Or[e.preset??"dark"],a=[];let n=H(e.surface)??null;n||(e.surface&&a.push({token:"surface",reason:`unparsable surface "${e.surface}", using preset`}),n=H(t.surface)),n=P(n,1);let c=H(e.primary)??null;c||(e.primary&&a.push({token:"primary",reason:`unparsable primary "${e.primary}", using preset`}),c=H(t.primary)),c=P(c,1);const s=zr(n)?"dark":"light",i=s==="dark",d=e.contrast==="high",b=$o(s,d),N=Math.max(0,Math.min(1,e.tint??0)),g=d?7:4.5,v=d?4.5:3,p=Ur(i?I:{r:17,g:17,b:17,a:1},c,N);let f,A,R;const _=l=>Ur(l,c,N);if(i){const l=y(I,n)>=6?I:Z;f=W(n,l,.07,b.elevationMin,_),A=W(f,l,.05,1.12,_),R=W(A,l,.05,1.12,_)}else{const l=y(I,n);if(l>=b.elevationMin*1.01){const u=l>=1.149995?1.1:b.elevationMin;f=W(n,I,.5,u,_),A=y(I,f)>=1.03?W(f,I,.6,1.03,_):P(I,1),R=_(or(A,Z,.035))}(!f||y(f,n)<b.elevationMin)&&(f=W(n,Z,.03,b.elevationMin,_),A=P(I,1),R=_(or(A,Z,.05)))}if(!f||!A||!R)throw new Error("theme: elevation ladder not resolved");const K=ur(i?{l:.94,c:0,h:0,a:1}:{l:.28,c:0,h:0,a:1}),j=Zr(K),L=l=>[n,f,A,R].reduce((u,E)=>y(l,E)<y(l,u)?E:u,n),U=(l,u,E)=>{let M=l,F=0;for(;y(P(p,M),L(P(p,M)))<u&&M<1&&F++<25;)M=Math.min(1,M+.04);return M!==l&&a.push({token:E,reason:`raised opacity ${l}→${M.toFixed(2)} to reach ${u}:1 on surfaces`}),M},Y=U(b.text,g,"text"),tr=U(b.textMuted,g,"text-muted"),nr=U(b.textFaint,v,"text-faint"),V=(()=>{const l=y(I,c),u=y({r:17,g:17,b:17,a:1},c);if(l>=g)return I;const E=u>l?{r:17,g:17,b:17,a:1}:I;return Math.max(l,u)<g&&a.push({token:"on-primary",reason:`neither white nor black reaches ${g}:1 on primary (best ${Math.max(l,u).toFixed(2)}:1)`}),E})(),ar=C(c,i?.06:-.06),cr=C(c,i?.1:-.1),B=z(c,n,g,"auto");y(B,n)>y(c,n)+.01&&a.push({token:"primary-text",reason:`primary lightened/darkened to reach ${g}:1 as text on surface`});const Jr=z(c,n,v,"auto"),Kr=z(c,n,v,"auto"),sr=l=>{const u=H(Br[l]),E=y(I,u),M=y({r:17,g:17,b:17,a:1},u),F=E>=g?I:M>E?{r:17,g:17,b:17,a:1}:I;return{base:u,on:F,text:z(u,n,g,"auto"),soft:P(u,b.soft),border:z(u,n,v,"auto"),dark:C(u,-.1),light:C(u,.12),darker:C(u,-.18),bright:C(u,.22)}},Yr=sr("success"),Vr=sr("warning"),Qr=sr("error"),Xr=sr("info"),[ro,oo,eo,to]=Mo[e.radius??"md"],kr="'Inter', sans-serif",xr=l=>{var u;return(u=l==null?void 0:l.name)!=null&&u.trim()?`'${l.name.trim().replace(/'/g,"\\'")}', ${kr}`:kr},wr=xr((Tr=e.fonts)==null?void 0:Tr.ui),no=(Ar=e.fonts)!=null&&Ar.heading?xr(e.fonts.heading):wr,ao=Array.from(new Set([(Er=($r=e.fonts)==null?void 0:$r.ui)==null?void 0:Er.src,(Cr=(Nr=e.fonts)==null?void 0:Nr.heading)==null?void 0:Cr.src].filter(l=>!!l&&/^https?:\/\//.test(l)))),Ir=(Lr=e.font)!=null&&Lr.size&&e.font.size>0?e.font.size:14,$={"color-scheme":s,surface:h(n),"surface-rgb":S(n),"surface-1":h(f),"surface-1-rgb":S(f),"surface-2":h(A),"surface-2-rgb":S(A),"surface-3":h(R),"surface-inverse":h(K),scrim:"rgba(0, 0, 0, 0.5)",ink:h(p),"ink-rgb":S(p),text:T(p,Y),"text-muted":T(p,tr),"text-faint":T(p,nr),"text-inverse":h(j),"text-on-surface-rgb":S(p),"text-on-inverse-rgb":S(j),border:T(p,b.border),"border-strong":T(p,b.borderStrong),divider:T(p,b.divider),"border-rgb":S(p),fill:T(p,b.fill),"fill-hover":T(p,b.fillHover),"fill-active":T(p,b.fillActive),field:T(p,b.field),"field-hover":T(p,b.fieldHover),"field-focus":T(p,b.fieldFocus),hover:T(p,b.hover),pressed:T(p,b.pressed),primary:h(c),"primary-rgb":S(c),"primary-hover":h(ar),"primary-active":h(cr),"on-primary":h(V),"primary-text":h(B),"primary-border":h(Jr),"primary-soft":T(c,b.soft),"primary-soft-hover":T(c,b.softHover),"focus-ring":h(Kr),"focus-ring-width":d?"3px":"2px","focus-ring-offset":"2px","primary-dark":h(C(c,-.1)),"primary-dark-rgb":S(C(c,-.1)),"primary-light":h(C(c,.1)),"primary-light-rgb":S(C(c,.1)),"primary-bright":h(C(c,.2)),"primary-bright-rgb":S(C(c,.2)),"shadow-1":i?"0 1px 2px rgba(0, 0, 0, 0.4)":"0 1px 2px rgba(0, 0, 0, 0.08)","shadow-2":i?"0 6px 20px rgba(0, 0, 0, 0.45)":"0 6px 20px rgba(0, 0, 0, 0.12)","shadow-3":i?"0 12px 40px rgba(0, 0, 0, 0.5)":"0 12px 40px rgba(0, 0, 0, 0.16)","radius-sm":ro,"radius-md":oo,"radius-lg":eo,"radius-full":to,"font-family":wr,"font-family-heading":no,"font-size":`${Ir}px`,"root-font-size":String(Ir),canvas:i?"rgba(0, 0, 0, 0.25)":"rgba(0, 0, 0, 0.04)","canvas-image":i?To:Ao,"canvas-control":"rgba(0, 0, 0, 0.45)","canvas-control-hover":"rgba(0, 0, 0, 0.6)","on-canvas-control":"#ffffff","disabled-opacity":"0.55"};for(const[l,u]of[["success",Yr],["warning",Vr],["error",Qr],["info",Xr]])$[l]=h(u.base),$[`${l}-rgb`]=S(u.base),$[`on-${l}`]=h(u.on),$[`${l}-text`]=h(u.text),$[`${l}-soft`]=h(u.soft),$[`${l}-border`]=h(u.border),$[`${l}-dark-rgb`]=S(u.dark),$[`${l}-light-rgb`]=S(u.light),l==="info"?$["info-bright-rgb"]=S(u.bright):$[`${l}-darker-rgb`]=S(u.darker);if(e.overrides)for(const[l,u]of Object.entries(e.overrides)){if(!u||!Q.includes(l))continue;$[l]=u;const E=`${l}-rgb`;if(Q.includes(E)){const M=H(u);M&&($[E]=S(M))}}for(const l of Q)$[l]===void 0&&($[l]="");const Sr=$,Mr=l=>H(Sr[l]),k=(l,u,E,M)=>{const F=Mr(u),_r=Mr(E),Hr=F&&_r?y(F,br(_r,n)):0;return{label:l,fg:u,bg:E,ratio:Math.round(Hr*100)/100,min:M,pass:Hr>=M}},co=[k("Text on surface","text","surface",g),k("Muted text on surface","text-muted","surface",g),k("Faint text on surface","text-faint","surface",v),k("Text on cards (surface-1)","text","surface-1",g),k("Text on popovers (surface-2)","text","surface-2",g),k("Cards distinguishable from surface","surface-1","surface",b.elevationMin),k("Popovers distinguishable from cards","surface-2","surface-1",i?1.12:1),k("Strong border on surface","border-strong","surface",d?3:1.5),k("Text on primary","on-primary","primary",g),k("Primary as text on surface","primary-text","surface",g),k("Primary border on surface","primary-border","surface",v),k("Focus ring on surface","focus-ring","surface",v),k("Success text on surface","success-text","surface",g),k("Warning text on surface","warning-text","surface",g),k("Error text on surface","error-text","surface",g),k("Info text on surface","info-text","surface",g),k("Text on success","on-success","success",g),k("Text on warning","on-warning","warning",g),k("Text on error","on-error","error",g),k("Text on tooltip","text-inverse","surface-inverse",g)];return{input:e,mode:s,tokens:Sr,report:{mode:s,checks:co,adjustments:a},fontUrls:ao}}const r=o=>`var(${X}${o})`,yr={"root-font-size":r("root-font-size"),"font-family":r("font-family"),"bx-focus-ring-color":r("focus-ring"),"bx-focus-ring-width":r("focus-ring-width"),"bx-focus-ring-offset":r("focus-ring-offset"),"app-background-color":r("surface"),"app-background-color-rgb":r("surface-rgb"),"app-divider-color":r("divider"),"secondary-color-rgb":r("surface-2-rgb"),"editor-view-background-color":r("surface"),"fields-view-background-color":"transparent","live-view-background-color":"transparent","popup-background-color":r("surface-1"),"bluepic-embed-editor-border":`1px solid ${r("border")}`,"bluepic-embed-editor-border-radius":r("radius-lg"),"primary-color-base":r("primary-rgb"),"primary-color-dark":r("primary-dark-rgb"),"primary-color-light":r("primary-light-rgb"),"primary-color-bright":r("primary-bright-rgb"),"info-color-base":r("info-rgb"),"info-color-dark":r("info-dark-rgb"),"info-color-light":r("info-light-rgb"),"info-color-bright":r("info-bright-rgb"),"success-color-base":r("success-rgb"),"success-color-light":r("success-light-rgb"),"success-color-dark":r("success-dark-rgb"),"success-color-darker":r("success-darker-rgb"),"error-color-base":r("error-rgb"),"error-color-light":r("error-light-rgb"),"error-color-dark":r("error-dark-rgb"),"error-color-darker":r("error-darker-rgb"),"warning-color-base":r("warning-rgb"),"warning-color-light":r("warning-light-rgb"),"warning-color-dark":r("warning-dark-rgb"),"warning-color-darker":r("warning-darker-rgb"),"text-color-base":r("text-on-surface-rgb"),"text-color-alt":r("text-on-inverse-rgb"),"border-color-base":r("border-rgb"),"background-color-base":r("surface-rgb"),"priinfomary-color-base":r("info-rgb"),"primainfory-color-bright":r("primary-bright-rgb"),"primary-color":r("primary"),"info-color":r("info"),"bx-primary-color":r("primary"),"bx-text-color":r("text"),"bx-modal-color":r("surface-1"),"bx-card-color":r("surface-1"),"upload-background-color":r("field"),"upload-text-color-title":r("text"),"upload-text-color-description":r("text-muted"),"input-background-color":r("field"),"input-background-color-hover":r("field-hover"),"input-background-color-focus":r("field-focus"),"input-border-color":"transparent","input-border-color-hover":"transparent","input-border-color-focus":r("primary-border"),"input-shadow-focus-color":r("focus-ring"),"input-bordered-border-color":r("border-strong"),"input-bordered-border-color-hover":r("border-strong"),"input-bordered-border-color-focus":r("primary-border"),"input-outline-color-focus":r("focus-ring"),"input-border-color-disabled":r("border"),"input-opacity-disabled":r("disabled-opacity"),"input-ghost-border-color-hover":r("border"),"input-ghost-border-color-focus":r("primary-border"),"input-number-ctrl-separator-color":r("divider"),"input-number-ctrl-color":r("text-muted"),"input-number-ctrl-color-hover":r("text"),"input-number-ctrl-background-color-hover":r("hover"),"input-state-active-background-color":r("primary-soft"),"input-state-active-background-color-hover":r("primary-soft"),"input-state-active-background-color-focus":r("primary-soft"),"input-state-active-border-color":r("primary-border"),"input-state-active-border-color-hover":r("primary-border"),"input-state-active-border-color-focus":r("primary-border"),"input-state-success-background-color":r("success-soft"),"input-state-success-background-color-hover":r("success-soft"),"input-state-success-background-color-focus":r("success-soft"),"input-state-success-border-color":r("success-border"),"input-state-success-border-color-hover":r("success-border"),"input-state-success-border-color-focus":r("success-border"),"input-state-error-background-color":r("error-soft"),"input-state-error-background-color-hover":r("error-soft"),"input-state-error-background-color-focus":r("error-soft"),"input-state-error-border-color":r("error-border"),"input-state-error-border-color-hover":r("error-border"),"input-state-error-border-color-focus":r("error-border"),"input-state-warning-background-color":r("warning-soft"),"input-state-warning-background-color-hover":r("warning-soft"),"input-state-warning-background-color-focus":r("warning-soft"),"input-state-warning-border-color":r("warning-border"),"input-state-warning-border-color-hover":r("warning-border"),"input-state-warning-border-color-focus":r("warning-border"),"card-background-color":r("surface-1"),"card-background-color-hover":r("surface-2"),"card-border-color":r("border"),"card-header-divider-color":r("divider"),"card-footer-divider-color":r("divider"),"card-footer-background-color":r("hover"),"select-background-color":r("field"),"select-background-color-hover":r("field-hover"),"select-background-color-focus":r("field-focus"),"select-border":"1px solid transparent","select-border-hover":"1px solid transparent","select-border-focus":`1px solid ${r("primary-border")}`,"select-color":r("text"),"select-color-hover":r("text"),"select-color-focus":r("text"),"select-button-background-color":r("fill"),"select-button-background-color-hover":r("fill-hover"),"select-item-border":`2px solid ${r("primary-border")}`,"checkbox-background-color":r("field"),"checkbox-border-color":r("border-strong"),"checkbox-border-color-hover":r("primary-border"),"checkbox-outline-color-focus":r("focus-ring"),"checkbox-border-color-focus":r("primary-border"),"checkbox-background-color-checked":r("primary"),"checkbox-border-color-checked":"transparent","checkbox-background-color-checked-hover":r("primary-hover"),"checkbox-border-color-checked-hover":"transparent","checkbox-symbol-color":r("text-faint"),"checkbox-symbol-color-checked":r("on-primary"),"checkbox-secondary-background-color":r("fill"),"checkbox-secondary-background-color-hover":r("fill-hover"),"checkbox-secondary-background-color-checked":r("fill-active"),"checkbox-secondary-border":`1px solid ${r("border")}`,"checkbox-secondary-border-hover":`1px solid ${r("border-strong")}`,"checkbox-secondary-border-checked":`1px solid ${r("border-strong")}`,"checkbox-secondary-symbol-color":r("text-muted"),"checkbox-secondary-symbol-color-checked":r("primary-text"),"popover-background-color":r("surface-2"),"popover-border-color":r("border"),"popover-border":`1px solid ${r("border")}`,"popover-arrow-border-color":r("border"),"popover-without-darkened-bg-background-color":r("surface-2-rgb"),"popover-without-darkened-bg-box-shadow":r("shadow-2"),"tooltip-background-color":r("surface-inverse"),"tooltip-text-color":r("text-inverse"),"tooltip-border-color":"transparent","menu-item-color":r("text"),"menu-item-color-active":r("primary-text"),"menu-item-background-color":"transparent","menu-item-background-color-active":r("primary-soft"),"menu-item-background-color-hover":r("hover"),"menu-item-background-color-active-hover":r("primary-soft-hover"),"menu-divider":`1px solid ${r("divider")}`,"labeled-text-color":r("text-muted"),"label-background-color":r("fill"),"list-divider":`1px solid ${r("divider")}`,"list-item-background-color-hover":r("hover"),"empty-text-color":r("text-faint"),"tag-background-color":r("fill"),"tag-color":r("text"),"tag-border-color":r("border"),"tag-error-background-color":r("error-soft"),"tag-error-color":r("error-text"),"tag-error-border-color":r("error-border"),"tag-success-background-color":r("success-soft"),"tag-success-color":r("success-text"),"tag-success-border-color":r("success-border"),"tag-warning-background-color":r("warning-soft"),"tag-warning-color":r("warning-text"),"tag-warning-border-color":r("warning-border"),"tag-info-background-color":r("info-soft"),"tag-info-color":r("info-text"),"tag-info-border-color":r("info-border"),"alert-background-color":r("fill"),"alert-color":r("text"),"alert-border-color":r("border"),"alert-icon-color":r("text-muted"),"alert-info-background-color":r("info-soft"),"alert-info-color":r("info-text"),"alert-info-icon-color":r("info-text"),"alert-info-border-color":r("info-border"),"alert-success-background-color":r("success-soft"),"alert-success-color":r("success-text"),"alert-success-icon-color":r("success-text"),"alert-success-border-color":r("success-border"),"alert-warning-background-color":r("warning-soft"),"alert-warning-color":r("warning-text"),"alert-warning-icon-color":r("warning-text"),"alert-warning-border-color":r("warning-border"),"alert-error-background-color":r("error-soft"),"alert-error-color":r("error-text"),"alert-error-icon-color":r("error-text"),"alert-error-border-color":r("error-border"),"slider-body-background-color":r("fill-active"),"slider-body-background-color-hover":r("fill-active"),"slider-body-background-color-focus":r("fill-active"),"slider-thumb-background-color":r("primary"),"slider-thumb-background-color-hover":r("primary-hover"),"slider-thumb-background-color-focus":r("primary-hover"),"slider-thumb-box-shadow":r("shadow-1"),"slider-value-background-color":r("primary"),"slider-value-background-color-hover":r("primary"),"slider-value-background-color-focus":r("primary"),"progress-background-color":r("fill"),"progress-value-color":r("primary"),"tab-color":r("text-muted"),"tab-color-active":r("primary-text"),"tab-segment-background-color":r("fill"),"tab-segment-background-color-active":r("surface-2"),"tab-segment-color":r("text-muted"),"tab-segment-color-active":r("text"),"tab-inline-item-background-color-hover":r("hover"),"tab-item-active-box-shadow":r("shadow-1"),"switch-background-color":r("fill-active"),"switch-border":"none","switch-thumb-background-color":r("surface-3"),"switch-thumb-border":"none","switch-thumb-shadow":r("shadow-1"),"switch-border-hover":"none","switch-background-color-hover":r("fill-active"),"switch-thumb-background-color-hover":r("surface-3"),"switch-thumb-border-hover":"none","switch-active-background-color":r("primary"),"switch-active-border":"none","switch-active-thumb-background-color":r("on-primary"),"switch-active-thumb-border":"none","switch-active-thumb-shadow":r("shadow-1"),"switch-active-background-color-hover":r("primary-hover"),"switch-active-border-hover":"none","switch-active-thumb-background-color-hover":r("on-primary"),"switch-active-thumb-border-hover":"none","radio-background-color":"transparent","radio-background-color-active":r("primary"),"radio-background-color-hover":"transparent","radio-border":`1px solid ${r("border-strong")}`,"radio-border-active":`1px solid ${r("primary")}`,"radio-border-color-hover":r("primary-border"),"radio-symbol-color":r("on-primary"),"radio-label-color":r("text"),"radio-label-color-active":r("text"),"button-background-color":"transparent","button-background-color-hover":r("hover"),"button-background-color-focus":r("hover"),"button-border":"none","button-border-hover":"none","button-border-focus":"none","button-text-color":r("text"),"button-text-color-hover":r("text"),"button-text-color-focus":r("text"),"button-box-shadow":"none","button-box-shadow-hover":"none","button-border-radius":r("radius-md"),"button-active-background-color":r("primary"),"button-active-text-color":r("on-primary"),"button-active-border":"none","button-active-box-shadow":"none","button-active-background-color-hover":r("primary-hover"),"button-active-text-color-hover":r("on-primary"),"button-active-border-hover":"none","button-active-box-shadow-hover":"none","button-secondary-background-color":r("fill"),"button-secondary-background-color-hover":r("fill-hover"),"button-secondary-background-color-focus":r("fill-hover"),"button-secondary-border":"1px solid transparent","button-secondary-border-hover":"1px solid transparent","button-secondary-border-focus":"1px solid transparent","button-secondary-text-color":r("text"),"button-secondary-text-color-hover":r("text"),"button-secondary-text-color-focus":r("text"),"button-secondary-box-shadow":"none","button-secondary-box-shadow-hover":"none","button-secondary-active-background-color":r("fill-active"),"button-secondary-active-background-color-hover":r("fill-active"),"button-secondary-active-background-color-focus":r("fill-active"),"button-secondary-active-border":"1px solid transparent","button-secondary-active-border-hover":"1px solid transparent","button-secondary-active-border-focus":"1px solid transparent","button-secondary-active-text-color":r("text"),"button-secondary-active-text-color-hover":r("text"),"button-secondary-active-text-color-focus":r("text"),"button-secondary-active-box-shadow":"none","button-secondary-active-box-shadow-hover":"none","button-tertiary-background-color":"transparent","button-tertiary-background-color-hover":r("hover"),"button-tertiary-background-color-focus":r("hover"),"button-tertiary-border":`1px solid ${r("border-strong")}`,"button-tertiary-border-hover":`1px solid ${r("border-strong")}`,"button-tertiary-border-focus":`1px solid ${r("border-strong")}`,"button-tertiary-text-color":r("text"),"button-tertiary-text-color-hover":r("text"),"button-tertiary-text-color-focus":r("text"),"button-tertiary-box-shadow":"none","button-tertiary-box-shadow-hover":"none","button-tertiary-box-shadow-focus":"none","button-tertiary-active-background-color":r("primary"),"button-tertiary-active-background-color-hover":r("primary-hover"),"button-tertiary-active-background-color-focus":r("primary-hover"),"button-tertiary-active-border":`1px solid ${r("primary")}`,"button-tertiary-active-border-hover":`1px solid ${r("primary")}`,"button-tertiary-active-border-focus":`1px solid ${r("primary")}`,"button-tertiary-active-text-color":r("on-primary"),"button-tertiary-active-text-color-hover":r("on-primary"),"button-tertiary-active-text-color-focus":r("on-primary"),"button-tertiary-active-box-shadow":"none","button-tertiary-active-box-shadow-hover":"none","button-tertiary-active-box-shadow-focus":"none","button-quaternary-background-color":"transparent","button-quaternary-background-color-hover":"transparent","button-quaternary-text-color":r("text-muted"),"button-quaternary-text-color-hover":r("text"),"button-quaternary-active-background-color":"transparent","button-quaternary-active-background-color-hover":"transparent","button-quaternary-active-text-color":r("text"),"button-quaternary-active-text-color-hover":r("text"),"button-state-active-background-color":r("primary-soft"),"button-state-active-background-color-hover":r("primary-soft-hover"),"button-state-active-background-color-active":r("primary-soft"),"button-state-active-background-color-active-hover":r("primary-soft-hover"),"button-state-active-background-color-solid":r("primary"),"button-state-active-background-color-solid-hover":r("primary-hover"),"button-state-active-border-color":r("primary-border"),"button-state-active-border-color-hover":r("primary-border"),"button-state-active-text-color":r("primary-text"),"button-state-active-text-color-tertiary":r("primary-text"),"button-state-success-background-color":r("success-soft"),"button-state-success-background-color-hover":r("success-soft"),"button-state-success-background-color-active":r("success-soft"),"button-state-success-background-color-active-hover":r("success-soft"),"button-state-success-background-color-solid":r("success"),"button-state-success-background-color-solid-hover":r("success"),"button-state-success-border-color":r("success-border"),"button-state-success-border-color-hover":r("success-border"),"button-state-success-text-color":r("success-text"),"button-state-success-text-color-tertiary":r("success-text"),"button-state-error-background-color":r("error-soft"),"button-state-error-background-color-hover":r("error-soft"),"button-state-error-background-color-active":r("error-soft"),"button-state-error-background-color-active-hover":r("error-soft"),"button-state-error-background-color-solid":r("error"),"button-state-error-background-color-solid-hover":r("error"),"button-state-error-border-color":r("error-border"),"button-state-error-border-color-hover":r("error-border"),"button-state-error-text-color":r("error-text"),"button-state-error-text-color-tertiary":r("error-text"),"button-state-warning-background-color":r("warning-soft"),"button-state-warning-background-color-hover":r("warning-soft"),"button-state-warning-background-color-active":r("warning-soft"),"button-state-warning-background-color-active-hover":r("warning-soft"),"button-state-warning-background-color-solid":r("warning"),"button-state-warning-background-color-solid-hover":r("warning"),"button-state-warning-border-color":r("warning-border"),"button-state-warning-border-color-hover":r("warning-border"),"button-state-warning-text-color":r("warning-text"),"button-state-warning-text-color-tertiary":r("warning-text"),"message-body-background-color":r("surface-2"),"message-body-text-color":r("text"),"message-body-border":`1px solid ${r("border")}`,"canvas-background-color":r("canvas"),"canvas-background-image":r("canvas-image"),"canvas-btn-background-color":r("canvas-control"),"canvas-btn-background-color-hover":r("canvas-control-hover"),"canvas-btn-color":r("on-canvas-control"),"btn-color":r("on-canvas-control"),"gallery-card-background-color":r("surface-1"),"gallery-card-background-color-hover":r("surface-2"),"gallery-card-border":`1px solid ${r("border")}`,"gallery-action-btn-background-color":r("scrim"),"gallery-action-btn-color":"#ffffff","gallery-card-name-text-color":r("text"),"gallery-card-description-text-color":r("text-muted"),"spinner-color":r("text")},No=new Set(Object.keys(yr).filter(o=>`--${o}`.startsWith(X)&&Q.includes(`--${o}`.slice(X.length)))),Co=Object.entries(yr).filter(([o])=>!No.has(o));function qr(o){const e={};for(const[t,a]of Object.entries(o.tokens))a!==""&&(e[`${X}${t}`]=a);for(const[t,a]of Co)e[`--${t}`]=a;if(o.input.customStyle)for(const[t,a]of Object.entries(o.input.customStyle))t==="key"||a==null||a===""||(e[t.startsWith("--")?t:`--${t}`]=String(a));return e}function Lo(o,e){const t=Array.isArray(e)?e.join(", "):e,a=qr(o),n=Object.entries(a).map(([c,s])=>`${c}: ${s};`).join(" ");return`${t} { color-scheme: ${o.mode}; ${n} }`}function _o(o){return!!o&&typeof o=="object"&&o.version===2}function Ho(o){const e=o??{},t=e["editor-view-background-color"]||(e["app-background-color-rgb"]?`rgb(${e["app-background-color-rgb"]})`:void 0)||e["popup-background-color"],a=e["primary-color-base"]?`rgb(${e["primary-color-base"]})`:void 0,n=H(t)?t:void 0,c=H(a)?a:void 0,s=typeof e.key=="string"&&e.key.endsWith("-wcag"),i={version:2};return n&&(i.surface=n),c&&(i.primary=c),s&&(i.contrast="high"),typeof e.key=="string"&&(i.preset=e.key.startsWith("light")?"light":"dark"),i}exports.LEGACY_BRIDGE=yr;exports.SEMANTIC_PREFIX=X;exports.SEMANTIC_TOKEN_GROUPS=so;exports.SEMANTIC_TOKEN_NAMES=Q;exports.STATUS_BASES=Br;exports.THEME_HOUSE_PRESETS=io;exports.THEME_PRESETS=Or;exports.looksLikeThemeInput=_o;exports.resolveTheme=Eo;exports.themeColor=So;exports.themeInputFromLegacyCustomStyle=Ho;exports.themeToCssText=Lo;exports.themeToCssVars=qr;
package/dist/theme.mjs CHANGED
@@ -140,7 +140,7 @@ const sr = [
140
140
  "on-canvas-control",
141
141
  /* disabled */
142
142
  "disabled-opacity"
143
- ], ir = "--bx-", Ao = [
143
+ ], ir = "--bx-", To = [
144
144
  { label: "Surfaces", tokens: ["surface", "surface-1", "surface-2", "surface-3", "surface-inverse", "scrim"] },
145
145
  { label: "Text", tokens: ["text", "text-muted", "text-faint", "text-inverse"] },
146
146
  { label: "Borders", tokens: ["border", "border-strong", "divider"] },
@@ -338,7 +338,7 @@ function lo(o) {
338
338
  const e = mr(o);
339
339
  return e ? w(e.percent ? e.value / 100 : e.value) : null;
340
340
  }
341
- function Pr(o) {
341
+ function Dr(o) {
342
342
  const e = mr(o);
343
343
  return e ? w(e.value / 100) : null;
344
344
  }
@@ -412,10 +412,10 @@ function _(o) {
412
412
  const c = n.alpha === void 0 ? 1 : lo(n.alpha);
413
413
  if (c === null) return null;
414
414
  if (a[1] === "rgb" || a[1] === "rgba") {
415
- const v = gr(n.ch[0]), D = gr(n.ch[1]), p = gr(n.ch[2]);
416
- return v === null || D === null || p === null ? null : x(v, D, p, c);
415
+ const v = gr(n.ch[0]), P = gr(n.ch[1]), p = gr(n.ch[2]);
416
+ return v === null || P === null || p === null ? null : x(v, P, p, c);
417
417
  }
418
- const s = uo(n.ch[0]), i = Pr(n.ch[1]), d = Pr(n.ch[2]);
418
+ const s = uo(n.ch[0]), i = Dr(n.ch[1]), d = Dr(n.ch[2]);
419
419
  if (s === null || i === null || d === null) return null;
420
420
  const [b, C, g] = go(s, i, d);
421
421
  return x(b, C, g, c);
@@ -465,17 +465,17 @@ function hr(o, e, t) {
465
465
  const a = t * Math.PI / 180;
466
466
  return { L: o, a: e * Math.cos(a), b: e * Math.sin(a) };
467
467
  }
468
- const W = 1e-6, Dr = (o) => o[0] >= -W && o[0] <= 1 + W && o[1] >= -W && o[1] <= 1 + W && o[2] >= -W && o[2] <= 1 + W;
468
+ const W = 1e-6, Pr = (o) => o[0] >= -W && o[0] <= 1 + W && o[1] >= -W && o[1] <= 1 + W && o[2] >= -W && o[2] <= 1 + W;
469
469
  function rr(o, e, t, a) {
470
470
  const n = w(m(o));
471
471
  let c = Math.max(0, m(e));
472
472
  const s = m(t);
473
473
  let i = hr(n, c, s), d = pr(i.L, i.a, i.b);
474
- if (!Dr(d)) {
474
+ if (!Pr(d)) {
475
475
  let b = 0, C = c;
476
476
  for (let g = 0; g < 24; g++) {
477
- const v = (b + C) / 2, D = hr(n, v, s);
478
- Dr(pr(D.L, D.a, D.b)) ? b = v : C = v;
477
+ const v = (b + C) / 2, P = hr(n, v, s);
478
+ Pr(pr(P.L, P.a, P.b)) ? b = v : C = v;
479
479
  }
480
480
  c = b, i = hr(n, c, s), d = pr(i.L, i.a, i.b);
481
481
  }
@@ -519,13 +519,13 @@ function X(o, e, t) {
519
519
  const n = w(m(o.a, 1)), c = w(m(e.a, 1)), s = lr(o), i = lr(e), d = n + (c - n) * a, b = d > 0 ? n * (1 - a) / d : 1 - a, C = d > 0 ? c * a / d : a, g = { L: s.L * b + i.L * C, a: s.a * b + i.a * C, b: s.b * b + i.b * C }, v = Or(g);
520
520
  return rr(v.l, v.c, v.h, d);
521
521
  }
522
- function P(o, e) {
522
+ function D(o, e) {
523
523
  return x(o.r, o.g, o.b, w(m(e, 1)));
524
524
  }
525
525
  function mo(o) {
526
526
  return lr(o).L;
527
527
  }
528
- function E(o, e) {
528
+ function L(o, e) {
529
529
  const t = J(o);
530
530
  return rr(w(t.l + m(e)), t.c, t.h, t.a);
531
531
  }
@@ -537,13 +537,13 @@ const yo = [1, 0.75, 0.5, 0.25, 0], ko = 24;
537
537
  function G(o, e, t, a = "auto") {
538
538
  const n = m(t, 1);
539
539
  if (y(o, e) >= n) return o;
540
- const c = J(o), s = x(e.r, e.g, e.b, 1), i = Q(s), d = (f, T) => rr(f, T, c.h, c.a), b = (f) => y(f, s), C = (f) => Q(f.a < 1 ? br(f, s) : f), g = (f) => x(Math.round(f.r), Math.round(f.g), Math.round(f.b), f.a), v = (f) => {
541
- const T = f === "lighter" ? 1 : 0, j = (L) => f === "lighter" ? C(L) >= i : C(L) <= i, H = (L) => j(L) && b(L) >= n, Y = (L) => H(L) && H(g(L));
540
+ const c = J(o), s = x(e.r, e.g, e.b, 1), i = Q(s), d = (f, A) => rr(f, A, c.h, c.a), b = (f) => y(f, s), C = (f) => Q(f.a < 1 ? br(f, s) : f), g = (f) => x(Math.round(f.r), Math.round(f.g), Math.round(f.b), f.a), v = (f) => {
541
+ const A = f === "lighter" ? 1 : 0, j = (E) => f === "lighter" ? C(E) >= i : C(E) <= i, H = (E) => j(E) && b(E) >= n, Y = (E) => H(E) && H(g(E));
542
542
  let R = null;
543
- for (const L of yo) {
544
- const U = c.c * L, K = d(T, U), or = b(K);
543
+ for (const E of yo) {
544
+ const U = c.c * E, K = d(A, U), or = b(K);
545
545
  if ((!R || or > R.ratio) && (R = { color: K, ratio: or }), !Y(K)) continue;
546
- let er = c.l, V = T;
546
+ let er = c.l, V = A;
547
547
  for (let nr = 0; nr < ko; nr++) {
548
548
  const B = (er + V) / 2;
549
549
  Y(d(B, U)) ? V = B : er = B;
@@ -554,8 +554,8 @@ function G(o, e, t, a = "auto") {
554
554
  return R;
555
555
  };
556
556
  if (a === "lighter" || a === "darker") return v(a).color;
557
- const D = b(d(1, 0)), p = b(d(0, 0));
558
- return v(D >= p ? "lighter" : "darker").color;
557
+ const P = b(d(1, 0)), p = b(d(0, 0));
558
+ return v(P >= p ? "lighter" : "darker").color;
559
559
  }
560
560
  function Fr(o) {
561
561
  return y(I, o) >= y(Z, o);
@@ -573,7 +573,7 @@ const Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
573
573
  __proto__: null,
574
574
  BLACK: Z,
575
575
  WHITE: I,
576
- adjustL: E,
576
+ adjustL: L,
577
577
  bestOn: Wr,
578
578
  composite: br,
579
579
  contrastRatio: y,
@@ -589,14 +589,14 @@ const Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
589
589
  relativeLuminance: Q,
590
590
  setL: vo,
591
591
  toOklch: J,
592
- withAlpha: P
592
+ withAlpha: D
593
593
  }, Symbol.toStringTag, { value: "Module" })), xo = {
594
594
  none: ["0px", "0px", "0px", "0px"],
595
595
  sm: ["3px", "4px", "6px", "9999px"],
596
596
  md: ["4px", "6px", "10px", "9999px"],
597
597
  lg: ["6px", "10px", "16px", "9999px"],
598
598
  full: ["10px", "16px", "24px", "9999px"]
599
- }, wo = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMik7IiAvPgogIDxyZWN0IHg9IjUwJSIgeT0iMCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgyNTUsIDI1NSwgMjU1LCAwKTsiIC8+CiAgPHJlY3QgeD0iNTAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgyNTUsIDI1NSwgMjU1LCAwLjIpOyIgLz4KICA8cmVjdCB4PSIwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMCk7IiAvPgo8L3N2Zz4=')", Io = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDAsIDAsIDAsIDAuMSk7IiAvPgogIDxyZWN0IHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMCwgMCwgMCwgMC4xKTsiIC8+Cjwvc3ZnPg==')";
599
+ }, wo = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMDcpOyIgLz4KICA8cmVjdCB4PSI1MCUiIHk9IjAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMCk7IiAvPgogIDxyZWN0IHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMC4wNyk7IiAvPgogIDxyZWN0IHg9IjAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgyNTUsIDI1NSwgMjU1LCAwKTsiIC8+Cjwvc3ZnPg==')", Io = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDAsIDAsIDAsIDAuMDQ1KTsiIC8+CiAgPHJlY3QgeD0iNTAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgwLCAwLCAwLCAwLjA0NSk7IiAvPgo8L3N2Zz4=')";
600
600
  function Mo(o, e) {
601
601
  const t = o === "dark", a = e ? 0.06 : 0;
602
602
  return {
@@ -619,50 +619,50 @@ function Mo(o, e) {
619
619
  elevationMin: e ? 1.3 : t ? 1.18 : 1.06
620
620
  };
621
621
  }
622
- const h = (o) => vr(o), M = (o) => Br(o), $ = (o, e) => vr(P(o, e)), jr = (o) => ({ r: Math.round(o.r), g: Math.round(o.g), b: Math.round(o.b), a: o.a });
622
+ const h = (o) => vr(o), M = (o) => Br(o), $ = (o, e) => vr(D(o, e)), jr = (o) => ({ r: Math.round(o.r), g: Math.round(o.g), b: Math.round(o.b), a: o.a });
623
623
  function z(o, e, t, a, n = (c) => c) {
624
624
  let c = t, s = jr(n(X(o, e, c))), i = 0;
625
625
  for (; y(s, o) < a && c < 1 && i++ < 40; )
626
626
  c = Math.min(1, c + 0.02), s = jr(n(X(o, e, c)));
627
- return P(s, 1);
627
+ return D(s, 1);
628
628
  }
629
629
  function Rr(o, e, t) {
630
630
  if (t <= 0) return o;
631
631
  const a = J(o), n = J(e);
632
632
  return ur({ l: a.l, c: Math.min(0.03, 0.03 * t) + a.c * (1 - t), h: n.h, a: a.a });
633
633
  }
634
- function Eo(o) {
635
- var Sr, $r, Tr, Ar, Nr, Cr, Er;
634
+ function Lo(o) {
635
+ var Sr, $r, Ar, Tr, Nr, Cr, Lr;
636
636
  const e = { version: 2, ...o ?? {} }, t = no[e.preset ?? "dark"], a = [];
637
637
  let n = _(e.surface) ?? null;
638
- n || (e.surface && a.push({ token: "surface", reason: `unparsable surface "${e.surface}", using preset` }), n = _(t.surface)), n = P(n, 1);
638
+ n || (e.surface && a.push({ token: "surface", reason: `unparsable surface "${e.surface}", using preset` }), n = _(t.surface)), n = D(n, 1);
639
639
  let c = _(e.primary) ?? null;
640
- c || (e.primary && a.push({ token: "primary", reason: `unparsable primary "${e.primary}", using preset` }), c = _(t.primary)), c = P(c, 1);
640
+ c || (e.primary && a.push({ token: "primary", reason: `unparsable primary "${e.primary}", using preset` }), c = _(t.primary)), c = D(c, 1);
641
641
  const s = Fr(n) ? "dark" : "light", i = s === "dark", d = e.contrast === "high", b = Mo(s, d), C = Math.max(0, Math.min(1, e.tint ?? 0)), g = d ? 7 : 4.5, v = d ? 4.5 : 3, p = Rr(i ? I : { r: 17, g: 17, b: 17, a: 1 }, c, C);
642
- let f, T, j;
642
+ let f, A, j;
643
643
  const H = (l) => Rr(l, c, C);
644
644
  if (i) {
645
645
  const l = y(I, n) >= 6 ? I : Z;
646
- f = z(n, l, 0.07, b.elevationMin, H), T = z(f, l, 0.05, 1.12, H), j = z(T, l, 0.05, 1.12, H);
646
+ f = z(n, l, 0.07, b.elevationMin, H), A = z(f, l, 0.05, 1.12, H), j = z(A, l, 0.05, 1.12, H);
647
647
  } else {
648
648
  const l = y(I, n);
649
649
  if (l >= b.elevationMin * 1.01) {
650
650
  const u = l >= 1.149995 ? 1.1 : b.elevationMin;
651
- f = z(n, I, 0.5, u, H), T = y(I, f) >= 1.03 ? z(f, I, 0.6, 1.03, H) : P(I, 1), j = H(X(T, Z, 0.035));
651
+ f = z(n, I, 0.5, u, H), A = y(I, f) >= 1.03 ? z(f, I, 0.6, 1.03, H) : D(I, 1), j = H(X(A, Z, 0.035));
652
652
  }
653
- (!f || y(f, n) < b.elevationMin) && (f = z(n, Z, 0.03, b.elevationMin, H), T = P(I, 1), j = H(X(T, Z, 0.05)));
653
+ (!f || y(f, n) < b.elevationMin) && (f = z(n, Z, 0.03, b.elevationMin, H), A = D(I, 1), j = H(X(A, Z, 0.05)));
654
654
  }
655
- if (!f || !T || !j) throw new Error("theme: elevation ladder not resolved");
656
- const Y = ur(i ? { l: 0.94, c: 0, h: 0, a: 1 } : { l: 0.28, c: 0, h: 0, a: 1 }), R = Wr(Y), L = (l) => [n, f, T, j].reduce((u, N) => y(l, N) < y(l, u) ? N : u, n), U = (l, u, N) => {
655
+ if (!f || !A || !j) throw new Error("theme: elevation ladder not resolved");
656
+ const Y = ur(i ? { l: 0.94, c: 0, h: 0, a: 1 } : { l: 0.28, c: 0, h: 0, a: 1 }), R = Wr(Y), E = (l) => [n, f, A, j].reduce((u, N) => y(l, N) < y(l, u) ? N : u, n), U = (l, u, N) => {
657
657
  let S = l, F = 0;
658
- for (; y(P(p, S), L(P(p, S))) < u && S < 1 && F++ < 25; ) S = Math.min(1, S + 0.04);
658
+ for (; y(D(p, S), E(D(p, S))) < u && S < 1 && F++ < 25; ) S = Math.min(1, S + 0.04);
659
659
  return S !== l && a.push({ token: N, reason: `raised opacity ${l}→${S.toFixed(2)} to reach ${u}:1 on surfaces` }), S;
660
660
  }, K = U(b.text, g, "text"), or = U(b.textMuted, g, "text-muted"), er = U(b.textFaint, v, "text-faint"), V = (() => {
661
661
  const l = y(I, c), u = y({ r: 17, g: 17, b: 17, a: 1 }, c);
662
662
  if (l >= g) return I;
663
663
  const N = u > l ? { r: 17, g: 17, b: 17, a: 1 } : I;
664
664
  return Math.max(l, u) < g && a.push({ token: "on-primary", reason: `neither white nor black reaches ${g}:1 on primary (best ${Math.max(l, u).toFixed(2)}:1)` }), N;
665
- })(), tr = E(c, i ? 0.06 : -0.06), nr = E(c, i ? 0.1 : -0.1), B = G(c, n, g, "auto");
665
+ })(), tr = L(c, i ? 0.06 : -0.06), nr = L(c, i ? 0.1 : -0.1), B = G(c, n, g, "auto");
666
666
  y(B, n) > y(c, n) + 0.01 && a.push({ token: "primary-text", reason: `primary lightened/darkened to reach ${g}:1 as text on surface` });
667
667
  const Gr = G(c, n, v, "auto"), Zr = G(c, n, v, "auto"), ar = (l) => {
668
668
  const u = _(ao[l]), N = y(I, u), S = y({ r: 17, g: 17, b: 17, a: 1 }, u), F = N >= g ? I : S > N ? { r: 17, g: 17, b: 17, a: 1 } : I;
@@ -670,24 +670,24 @@ function Eo(o) {
670
670
  base: u,
671
671
  on: F,
672
672
  text: G(u, n, g, "auto"),
673
- soft: P(u, b.soft),
673
+ soft: D(u, b.soft),
674
674
  border: G(u, n, v, "auto"),
675
- dark: E(u, -0.1),
676
- light: E(u, 0.12),
677
- darker: E(u, -0.18),
678
- bright: E(u, 0.22)
675
+ dark: L(u, -0.1),
676
+ light: L(u, 0.12),
677
+ darker: L(u, -0.18),
678
+ bright: L(u, 0.22)
679
679
  };
680
680
  }, qr = ar("success"), Jr = ar("warning"), Yr = ar("error"), Kr = ar("info"), [Vr, Qr, Xr, ro] = xo[e.radius ?? "md"], yr = "'Inter', sans-serif", kr = (l) => {
681
681
  var u;
682
682
  return (u = l == null ? void 0 : l.name) != null && u.trim() ? `'${l.name.trim().replace(/'/g, "\\'")}', ${yr}` : yr;
683
- }, xr = kr((Sr = e.fonts) == null ? void 0 : Sr.ui), oo = ($r = e.fonts) != null && $r.heading ? kr(e.fonts.heading) : xr, eo = Array.from(new Set([(Ar = (Tr = e.fonts) == null ? void 0 : Tr.ui) == null ? void 0 : Ar.src, (Cr = (Nr = e.fonts) == null ? void 0 : Nr.heading) == null ? void 0 : Cr.src].filter((l) => !!l && /^https?:\/\//.test(l)))), wr = (Er = e.font) != null && Er.size && e.font.size > 0 ? e.font.size : 14, A = {
683
+ }, xr = kr((Sr = e.fonts) == null ? void 0 : Sr.ui), oo = ($r = e.fonts) != null && $r.heading ? kr(e.fonts.heading) : xr, eo = Array.from(new Set([(Tr = (Ar = e.fonts) == null ? void 0 : Ar.ui) == null ? void 0 : Tr.src, (Cr = (Nr = e.fonts) == null ? void 0 : Nr.heading) == null ? void 0 : Cr.src].filter((l) => !!l && /^https?:\/\//.test(l)))), wr = (Lr = e.font) != null && Lr.size && e.font.size > 0 ? e.font.size : 14, T = {
684
684
  "color-scheme": s,
685
685
  surface: h(n),
686
686
  "surface-rgb": M(n),
687
687
  "surface-1": h(f),
688
688
  "surface-1-rgb": M(f),
689
- "surface-2": h(T),
690
- "surface-2-rgb": M(T),
689
+ "surface-2": h(A),
690
+ "surface-2-rgb": M(A),
691
691
  "surface-3": h(j),
692
692
  "surface-inverse": h(Y),
693
693
  scrim: "rgba(0, 0, 0, 0.5)",
@@ -723,12 +723,12 @@ function Eo(o) {
723
723
  "focus-ring": h(Zr),
724
724
  "focus-ring-width": d ? "3px" : "2px",
725
725
  "focus-ring-offset": "2px",
726
- "primary-dark": h(E(c, -0.1)),
727
- "primary-dark-rgb": M(E(c, -0.1)),
728
- "primary-light": h(E(c, 0.1)),
729
- "primary-light-rgb": M(E(c, 0.1)),
730
- "primary-bright": h(E(c, 0.2)),
731
- "primary-bright-rgb": M(E(c, 0.2)),
726
+ "primary-dark": h(L(c, -0.1)),
727
+ "primary-dark-rgb": M(L(c, -0.1)),
728
+ "primary-light": h(L(c, 0.1)),
729
+ "primary-light-rgb": M(L(c, 0.1)),
730
+ "primary-bright": h(L(c, 0.2)),
731
+ "primary-bright-rgb": M(L(c, 0.2)),
732
732
  "shadow-1": i ? "0 1px 2px rgba(0, 0, 0, 0.4)" : "0 1px 2px rgba(0, 0, 0, 0.08)",
733
733
  "shadow-2": i ? "0 6px 20px rgba(0, 0, 0, 0.45)" : "0 6px 20px rgba(0, 0, 0, 0.12)",
734
734
  "shadow-3": i ? "0 12px 40px rgba(0, 0, 0, 0.5)" : "0 12px 40px rgba(0, 0, 0, 0.16)",
@@ -754,20 +754,20 @@ function Eo(o) {
754
754
  ["error", Yr],
755
755
  ["info", Kr]
756
756
  ])
757
- A[l] = h(u.base), A[`${l}-rgb`] = M(u.base), A[`on-${l}`] = h(u.on), A[`${l}-text`] = h(u.text), A[`${l}-soft`] = h(u.soft), A[`${l}-border`] = h(u.border), A[`${l}-dark-rgb`] = M(u.dark), A[`${l}-light-rgb`] = M(u.light), l === "info" ? A["info-bright-rgb"] = M(u.bright) : A[`${l}-darker-rgb`] = M(u.darker);
757
+ T[l] = h(u.base), T[`${l}-rgb`] = M(u.base), T[`on-${l}`] = h(u.on), T[`${l}-text`] = h(u.text), T[`${l}-soft`] = h(u.soft), T[`${l}-border`] = h(u.border), T[`${l}-dark-rgb`] = M(u.dark), T[`${l}-light-rgb`] = M(u.light), l === "info" ? T["info-bright-rgb"] = M(u.bright) : T[`${l}-darker-rgb`] = M(u.darker);
758
758
  if (e.overrides)
759
759
  for (const [l, u] of Object.entries(e.overrides)) {
760
760
  if (!u || !sr.includes(l)) continue;
761
- A[l] = u;
761
+ T[l] = u;
762
762
  const N = `${l}-rgb`;
763
763
  if (sr.includes(N)) {
764
764
  const S = _(u);
765
- S && (A[N] = M(S));
765
+ S && (T[N] = M(S));
766
766
  }
767
767
  }
768
- for (const l of sr) A[l] === void 0 && (A[l] = "");
769
- const Ir = A, Mr = (l) => _(Ir[l]), k = (l, u, N, S) => {
770
- const F = Mr(u), Lr = Mr(N), Hr = F && Lr ? y(F, br(Lr, n)) : 0;
768
+ for (const l of sr) T[l] === void 0 && (T[l] = "");
769
+ const Ir = T, Mr = (l) => _(Ir[l]), k = (l, u, N, S) => {
770
+ const F = Mr(u), Er = Mr(N), Hr = F && Er ? y(F, br(Er, n)) : 0;
771
771
  return { label: l, fg: u, bg: N, ratio: Math.round(Hr * 100) / 100, min: S, pass: Hr >= S };
772
772
  }, to = [
773
773
  k("Text on surface", "text", "surface", g),
@@ -1263,7 +1263,7 @@ const r = (o) => `var(${ir}${o})`, zr = {
1263
1263
  ), $o = Object.entries(
1264
1264
  zr
1265
1265
  ).filter(([o]) => !So.has(o));
1266
- function To(o) {
1266
+ function Ao(o) {
1267
1267
  const e = {};
1268
1268
  for (const [t, a] of Object.entries(o.tokens))
1269
1269
  a !== "" && (e[`${ir}${t}`] = a);
@@ -1274,8 +1274,8 @@ function To(o) {
1274
1274
  t === "key" || a == null || a === "" || (e[t.startsWith("--") ? t : `--${t}`] = String(a));
1275
1275
  return e;
1276
1276
  }
1277
- function Lo(o, e) {
1278
- const t = Array.isArray(e) ? e.join(", ") : e, a = To(o), n = Object.entries(a).map(([c, s]) => `${c}: ${s};`).join(" ");
1277
+ function Eo(o, e) {
1278
+ const t = Array.isArray(e) ? e.join(", ") : e, a = Ao(o), n = Object.entries(a).map(([c, s]) => `${c}: ${s};`).join(" ");
1279
1279
  return `${t} { color-scheme: ${o.mode}; ${n} }`;
1280
1280
  }
1281
1281
  function Ho(o) {
@@ -1288,15 +1288,15 @@ function _o(o) {
1288
1288
  export {
1289
1289
  zr as LEGACY_BRIDGE,
1290
1290
  ir as SEMANTIC_PREFIX,
1291
- Ao as SEMANTIC_TOKEN_GROUPS,
1291
+ To as SEMANTIC_TOKEN_GROUPS,
1292
1292
  sr as SEMANTIC_TOKEN_NAMES,
1293
1293
  ao as STATUS_BASES,
1294
1294
  No as THEME_HOUSE_PRESETS,
1295
1295
  no as THEME_PRESETS,
1296
1296
  Ho as looksLikeThemeInput,
1297
- Eo as resolveTheme,
1297
+ Lo as resolveTheme,
1298
1298
  Co as themeColor,
1299
1299
  _o as themeInputFromLegacyCustomStyle,
1300
- Lo as themeToCssText,
1301
- To as themeToCssVars
1300
+ Eo as themeToCssText,
1301
+ Ao as themeToCssVars
1302
1302
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluepic/embed",
3
- "version": "0.4.0-next.136",
3
+ "version": "0.4.0-next.138",
4
4
  "description": "Bluepic embed sdk",
5
5
  "type": "module",
6
6
  "sideEffects": false,