@tempots/beatui 0.72.0 → 0.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";const e=require("@tempots/dom"),k=require("./deep-merge-DZxfgKqX.cjs"),$=require("./translations-hMQlZmD4.cjs"),X=require("@tempots/ui"),q=require("./notice-DP209Ed8.cjs"),pt=require("./use-form-DVJXMMoN.cjs");function P(t){if(typeof t!="string")return!1;const n=t.startsWith("#")?t.slice(1):t;return/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(n)}function z(t){if(typeof t!="string")return!1;const n=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,a=t.match(n);if(!a)return!1;const[,r,o,s]=a,l=parseInt(r,10),c=parseInt(o,10),i=parseInt(s,10);return l>=0&&l<=255&&c>=0&&c<=255&&i>=0&&i<=255}function Y(t){if(typeof t!="string")return!1;const n=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i,a=t.match(n);if(!a)return!1;const[,r,o,s,l]=a,c=parseInt(r,10),i=parseInt(o,10),u=parseInt(s,10),p=parseFloat(l);return c>=0&&c<=255&&i>=0&&i<=255&&u>=0&&u<=255&&p>=0&&p<=1}function G(t){if(typeof t!="string")return!1;const n=/^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/i,a=t.match(n);if(!a)return!1;const[,r,o,s]=a,l=parseInt(r,10),c=parseInt(o,10),i=parseInt(s,10);return l>=0&&l<=360&&c>=0&&c<=100&&i>=0&&i<=100}function gt(t){return P(t)||z(t)||Y(t)||G(t)}function K(t){if(!P(t))return null;let n=t.startsWith("#")?t.slice(1):t;return n.length===3&&(n=n.split("").map(a=>a+a).join("")),`#${n.toLowerCase()}`}function B(t,n,a){const r=o=>{const s=Math.round(Math.max(0,Math.min(255,o))).toString(16);return s.length===1?"0"+s:s};return`#${r(t)}${r(n)}${r(a)}`}function R(t){const n=K(t);if(!n)return null;const a=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return a?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null}function mt(t,n){const a=R(t),r=R(n);if(!a||!r)return null;const o=(u,p,d)=>{const[f,g,y]=[u,p,d].map(w=>(w=w/255,w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4)));return .2126*f+.7152*g+.0722*y},s=o(a.r,a.g,a.b),l=o(r.r,r.g,r.b),c=Math.max(s,l),i=Math.min(s,l);return(c+.05)/(i+.05)}function Q(t){if(!t)return[0,0,0,1];const a=t.trim().match(/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/);if(a){const u=a[1];if(u.length===8){const p=parseInt(u.slice(0,2),16),d=parseInt(u.slice(2,4),16),f=parseInt(u.slice(4,6),16),g=parseInt(u.slice(6,8),16)/255;return[p,d,f,g]}if(u.length===6)return[parseInt(u.slice(0,2),16),parseInt(u.slice(2,4),16),parseInt(u.slice(4,6),16),1];if(u.length===4){const p=parseInt(u[0]+u[0],16),d=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),g=parseInt(u[3]+u[3],16)/255;return[p,d,f,g]}if(u.length===3){const p=parseInt(u[0]+u[0],16),d=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16);return[p,d,f,1]}}const r=t.match(/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i);if(r)return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseFloat(r[4])];const o=t.match(/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);if(o)return[parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3],10),1];const s=t.match(/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(s){const u=parseFloat(s[1]),p=parseFloat(s[2]),d=parseFloat(s[3]),f=s[4]!=null?parseFloat(s[4]):1,[g,y,w]=j(u,p/100,d/100);return[g,y,w,f]}const l=t.match(/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(l){const u=parseFloat(l[1]),p=parseFloat(l[2])/100,d=parseFloat(l[3])/100,f=l[4]!=null?parseFloat(l[4]):1,[g,y,w]=tt(u,p,d);return[g,y,w,f]}const c=t.match(/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(c){const u=c[1],p=parseFloat(c[2]),d=parseFloat(c[3]),f=c[4]!=null?parseFloat(c[4]):1,g=u.endsWith("%")?Math.max(0,Math.min(1,parseFloat(u)/100)):Math.max(0,Math.min(1,parseFloat(u))),[y,w,b]=nt(g,p,d);return[y,w,b,f]}const i=R(t);return i?[i.r,i.g,i.b,1]:[0,0,0,1]}function Z(t,n,a,r){return`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(a)}, ${Math.max(0,Math.min(1,Math.round(r*100)/100))})`}function J(t){let n=t+1831565813;return function(){return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function j(t,n,a){t=(t%360+360)%360;const r=(1-Math.abs(2*a-1))*n,o=r*(1-Math.abs(t/60%2-1)),s=a-r/2;let l=0,c=0,i=0;return 0<=t&&t<60?[l,c,i]=[r,o,0]:60<=t&&t<120?[l,c,i]=[o,r,0]:120<=t&&t<180?[l,c,i]=[0,r,o]:180<=t&&t<240?[l,c,i]=[0,o,r]:240<=t&&t<300?[l,c,i]=[o,0,r]:[l,c,i]=[r,0,o],[Math.round((l+s)*255),Math.round((c+s)*255),Math.round((i+s)*255)]}function tt(t,n,a){t=(t%360+360)%360;const r=n+a;r>1&&(n/=r,a/=r);const[o,s,l]=j(t,1,.5).map(d=>d/255),c=1-n-a,i=o*c+n,u=s*c+n,p=l*c+n;return[Math.round(i*255),Math.round(u*255),Math.round(p*255)]}function L(t,n,a){t/=255,n/=255,a/=255;const r=Math.max(t,n,a),o=Math.min(t,n,a);let s=0,l=0;const c=(r+o)/2,i=r-o;if(i!==0){switch(l=c>.5?i/(2-r-o):i/(r+o),r){case t:s=(n-a)/i+(n<a?6:0);break;case n:s=(a-t)/i+2;break;default:s=(t-n)/i+4}s*=60}return[Math.round(s),Math.round(l*100),Math.round(c*100)]}function et(t,n,a){const[r]=L(t,n,a),o=t/255,s=n/255,l=a/255,c=Math.min(o,s,l),i=1-Math.max(o,s,l);return[r,Math.round(c*100),Math.round(i*100)]}function D(t){const n=t/255;return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function O(t){const n=t<=.0031308?12.92*t:1.055*Math.pow(t,.4166666666666667)-.055;return Math.round(Math.max(0,Math.min(1,n))*255)}function nt(t,n,a){const r=a*Math.PI/180,o=Math.cos(r)*n,s=Math.sin(r)*n,l=t+.3963377774*o+.2158037573*s,c=t-.1055613458*o-.0638541728*s,i=t-.0894841775*o-1.291485548*s,u=l*l*l,p=c*c*c,d=i*i*i,f=4.0767416621*u-3.3077115913*p+.2309699292*d,g=-1.2684380046*u+2.6097574011*p-.3413193965*d,y=-.0041960863*u-.7034186147*p+1.707614701*d;return[O(f),O(g),O(y)]}function rt(t,n,a){const r=D(t),o=D(n),s=D(a),l=.4122214708*r+.5363325363*o+.0514459929*s,c=.2119034982*r+.6806995451*o+.1073969566*s,i=.0883024619*r+.2817188376*o+.6299787005*s,u=Math.cbrt(l),p=Math.cbrt(c),d=Math.cbrt(i),f=.2104542553*u+.793617785*p-.0040720468*d,g=1.9779984951*u-2.428592205*p+.4505937099*d,y=.0259040371*u+.7827717662*p-.808675766*d,w=Math.sqrt(g*g+y*y);let b=Math.atan2(y,g)*180/Math.PI;return b<0&&(b+=360),[f,w,b]}function N(t,n,a,r,o,s){switch(o){case"hex":if(s){const l=i=>i.toString(16).padStart(2,"0"),c=Math.max(0,Math.min(255,Math.round(r*255)));return`#${l(t)}${l(n)}${l(a)}${l(c)}`}return B(t,n,a);case"rgb":return`rgb(${t}, ${n}, ${a})`;case"rgba":return`rgba(${t}, ${n}, ${a}, ${Math.round(r*100)/100})`;case"hsl":{const[l,c,i]=L(t,n,a);return`hsl(${l}, ${c}%, ${i}%)`}case"hsla":{const[l,c,i]=L(t,n,a);return`hsla(${l}, ${c}%, ${i}%, ${Math.round(r*100)/100})`}case"hwb":{const[l,c,i]=et(t,n,a);return r<1?`hwb(${l} ${c}% ${i}% / ${Math.round(r*100)/100})`:`hwb(${l} ${c}% ${i}%)`}case"oklch":{const[l,c,i]=rt(t,n,a),u=(Math.round(l*1e3)/1e3).toFixed(3),p=(Math.round(c*1e3)/1e3).toFixed(3),d=(Math.round(i*10)/10).toFixed(1),f=Math.round(r*100)/100;return s||r<1?`oklch(${u} ${p} ${d} / ${f})`:`oklch(${u} ${p} ${d})`}}}function S(t,n){return n?t==="rgb"?"rgba":t==="hsl"?"hsla":t:t==="rgba"?"rgb":t==="hsla"?"hsl":t}async function at(t){return new Promise((n,a)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>{const o=r.result;n(o.split(",")[1])},r.onerror=o=>a(o)})}function dt(t){return Promise.all(t.map(at))}function ht(t){if(t.length>=4){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71)return"image/png";if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===71&&t[1]===73&&t[2]===70)return"image/gif";if(t[0]===82&&t[1]===73&&t[2]===70&&t[3]===70&&t.length>=12&&t[8]===87&&t[9]===69&&t[10]===66&&t[11]===80)return"image/webp"}try{if(new TextDecoder("utf-8").decode(t.slice(0,256)).includes("<svg"))return"image/svg+xml"}catch{}return"application/octet-stream"}function ft(t){const n=k.$t(t??""),a=n.length,r=new Uint8Array(a);for(let o=0;o<a;o++)r[o]=n.charCodeAt(o);return r}function st(t){const{value:n,onChange:a,onInput:r,...o}=t,s=new Map,l=e.Value.toSignal(n).map(p=>p.map((d,f)=>{const g=s.get(d),y=ft(d??""),w=g?.type||ht(y),b=g?.name??`file-${f}`,x=y.buffer.slice(y.byteOffset,y.byteOffset+y.byteLength),h=new Blob([x],{type:w});return new File([h],b,{type:w})})),c=p=>d=>{p&&dt(d).then(f=>{for(const[g,y]of f.entries())s.set(y,{name:d[g].name,type:d[g].type});p(f)})},i=c(a),u=c(r);return k.FilesInput({...o,value:l,onChange:i,onInput:u})}function bt(t){const{value:n,onInput:a,onChange:r,...o}=t;return st({...o,maxFiles:1,value:e.Value.map(n,s=>s==null?[]:[s]),onChange:s=>{r?.(s[0])},onInput:s=>{a?.(s[0])}})}function yt(t,n){const[a,r,o]=t,s=a<<16^r<<8^o,l=J(s),c=6+Math.floor(l()*5),i=.18+l()*.06,u=[];for(let g=0;g<c;g++){const y=g/c*Math.PI*2,w=n*(1+(l()*2-1)*i),b=Math.cos(y)*w,x=Math.sin(y)*w;u.push({x:b,y:x})}const p=(u[0].x+u[c-1].x)/2,d=(u[0].y+u[c-1].y)/2;let f=`M ${p.toFixed(3)} ${d.toFixed(3)}`;for(let g=0;g<c;g++){const y=u[g],w=u[(g+1)%c],b=(y.x+w.x)/2,x=(y.y+w.y)/2;f+=` Q ${y.x.toFixed(3)} ${y.y.toFixed(3)} ${b.toFixed(3)} ${x.toFixed(3)}`}return f+=" Z",f}const wt=t=>{const{value:n,onBlur:a,onChange:r,onInput:o,displayValue:s,size:l,withAlpha:c}=t,i=e.Value.map(l??32,m=>m),u=e.Value.map(n,m=>Q(m??"#000000")),p=e.Value.map(u,([m,I,V])=>[m,I,V]),d=e.Value.map(u,([,,,m])=>m),f=e.prop(e.Value.get(d)??1),g=e.Value.map(c??!1,m=>m),y=e.Value.map(t.colorTextFormat??"rgb",m=>m),w=e.computedOf(p,f,y,g)(([m,I,V],T,A,F)=>N(m,I,V,T??1,S(A,F),F)),b=e.Value.map(t.colorTextFormat??"hex",m=>m),x=e.Value.map(i,m=>`${-m/2} ${-m/2} ${m} ${m}`),h=e.computedOf(p,i)((m,I)=>yt(m,I/2)),C=e.computedOf(p,f,g)(([m,I,V],T,A)=>A||T<1?Z(m,I,V,T):B(m,I,V)),_=e.html.div(e.attr.class("bc-color-swatch-input__control"),e.attr.class(e.Value.map(g,m=>m?"bc-color-swatch-input__control--alpha":"")),e.attr.style(e.computedOf(i)(m=>`min-width:${m+2}px;height:${m+2}px`)),e.svg.svg(e.attr.class("bc-color-swatch-input__svg"),e.svgAttr.viewBox(x),e.svg.path(e.svgAttr.d(h),e.svgAttr.fill(C))),e.html.input(e.attr.type("color"),$.CommonInputAttributes(t),e.attr.value(e.Value.map(p,([m,I,V])=>B(m,I,V))),e.attr.class("bc-input bc-color-swatch-input bc-color-swatch-input__native"),a!=null?e.on.blur(a):e.Empty,r!=null?e.on.change(m=>{const I=m.target.value;if(!r)return;const{r:V,g:T,b:A}=R(I)??{r:0,g:0,b:0},F=e.Value.get(f)??1,v=S(e.Value.get(b),e.Value.get(g)),U=N(V,T,A,F,v,e.Value.get(g));r(U)}):e.Empty,o!=null?e.on.input(m=>{const I=m.target.value;if(!o)return;const{r:V,g:T,b:A}=R(I)??{r:0,g:0,b:0},F=e.Value.get(f)??1,v=S(e.Value.get(b),e.Value.get(g)),U=N(V,T,A,F,v,e.Value.get(g));o(U)}):e.Empty)),M=e.When(g,()=>e.html.input(e.attr.type("range"),e.attr.class("bc-color-swatch-input__alpha"),e.attr.min(0),e.attr.max(1),e.attr.step(.01),e.attr.value(e.Value.map(f,m=>String(m??1))),e.attr.disabled(t.disabled),e.on.input(m=>{const I=parseFloat(m.target.value);f.set(I);const[V,T,A]=e.Value.get(p),F=S(e.Value.get(b),e.Value.get(g)),v=N(V,T,A,I,F,e.Value.get(g));o?.(v)}),e.on.change(m=>{const I=parseFloat(m.target.value);f.set(I);const[V,T,A]=e.Value.get(p),F=S(e.Value.get(b),e.Value.get(g)),v=N(V,T,A,I,F,e.Value.get(g));r?.(v)})));return $.InputContainer({baseContainer:!0,...t,growInput:!1,input:_,after:e.Fragment(e.When(s??!1,()=>e.html.span(e.attr.class("bc-color-swatch-input__rgb"),w)),M,t.after)})};function It(t,n,a){const r=["bc-card"];return t!=="default"&&r.push(`bc-card--${t}`),n!=="md"&&r.push(`bc-card--padding-${n}`),a!=="lg"&&r.push(`bc-card--rounded-${a}`),r.join(" ")}function xt({variant:t="default",size:n="md",roundedness:a="lg"}={},...r){return e.html.div(e.attr.class(e.computedOf(t,n,a)((o,s,l)=>It(o??"default",s??"md",l??"lg"))),...r)}const $t=({startEditing:t,value:n,onChange:a,placeholder:r,disabled:o})=>{const s=e.Value.deriveProp(t??!1),l=e.prop(!1),c=e.Value.map(o??!1,i=>i);return e.html.div(e.attr.class("bc-editable-text"),e.attr.class(e.Value.map(c,i=>i?"bc-editable-text--disabled":"")),e.aria.disabled(c),e.When(s,()=>e.html.input(e.attr.placeholder(r),e.attr.value(n),e.attr.class("bc-editable-text__input"),X.AutoSelect(),e.on.keydown(i=>{i.key==="Enter"?s.set(!1):i.key==="Escape"&&(l.set(!0),s.set(!1))}),e.on.blur(e.emitValue(i=>{if(s.set(!1),l.value){l.set(!1);return}a(i)}))),()=>e.html.span(e.on.click(()=>{e.Value.get(c)||s.set(!0)}),e.attr.class("bc-editable-text__display"),e.When(e.Value.map(n,i=>i!=null&&i.trim()!==""),()=>e.html.span(e.attr.class("bc-editable-text__text"),n),()=>e.html.span(e.attr.class("bc-editable-text__placeholder"),r)),e.When(e.Value.map(c,i=>!i),()=>e.html.button(e.attr.type("button"),e.attr.class("bc-editable-text__edit-button"),e.Use($.BeatUII18n,i=>e.aria.label(i.$.editLabel)),e.on.click(()=>s.set(!0)),$.Icon({icon:"line-md/pencil",color:"neutral"}))))))},Mt=t=>{const{value:n,onBlur:a,onChange:r,onInput:o,after:s,disabled:l}=t,c=k.NullableResetAfter(n,l,r??o);return $.InputContainer({...t,input:e.input.date($.CommonInputAttributes(t),e.attr.valueAsDate(n),e.attr.class("bc-input"),a!=null?e.on.blur(e.emitValue(a)):e.Empty,r!=null?e.on.change(e.emitValueAsNullableDate(r)):e.Empty,o!=null?e.on.input(e.emitValueAsNullableDate(o)):e.Empty),after:s!=null?e.Fragment(c,s):c})},Vt=t=>{const n=t.getFullYear(),a=t.getMonth()+1,r=t.getDate(),o=t.getHours(),s=t.getMinutes(),l=t.getSeconds();return`${n}-${a.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${o.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`},_t=t=>{const{value:n,onBlur:a,onChange:r,onInput:o,after:s,disabled:l}=t,c=e.Value.map(n,u=>u!=null?Vt(u):null),i=k.NullableResetAfter(n,l,r??o);return $.InputContainer({...t,input:e.input["datetime-local"]($.CommonInputAttributes(t),e.attr.value(e.Value.map(c,u=>u??null)),e.attr.class("bc-input"),a!=null?e.on.blur(e.emitValue(a)):e.Empty,r!=null?e.on.change(e.emitValueAsNullableDateTime(r)):e.Empty,o!=null?e.on.input(e.emitValueAsNullableDateTime(o)):e.Empty),after:s!=null?e.Fragment(i,s):i})},H=t=>typeof t=="string"&&t.trim()===""?null:t,ot=t=>t??"";function E(t){return n=>{const{value:a,onBlur:r,onChange:o,onInput:s,after:l,disabled:c,...i}=n,u=k.NullableResetAfter(a,c,o??s);return t({...i,disabled:c,value:e.Value.map(a,ot),onChange:o!=null?p=>o(H(p)):void 0,onInput:s!=null?p=>s(H(p)):void 0,onBlur:r,after:l!=null?e.Fragment(u,l):u})}}const Ct=E(q.EmailInput),Tt=E($.TextInput),At=E(q.PasswordInput),Ft=E(k.TextArea),kt=({value:t,onChange:n,onInput:a,onBlur:r,offLabel:o,onLabel:s,disabled:l=!1,size:c="md",id:i,color:u="primary",tabIndex:p=0})=>{const d=i??pt.sessionId("switch");function f(b,x){const h=["bc-switch",`bc-switch--size-${x}`,`bc-switch--${x}`];return b&&h.push("bc-switch--disabled"),h.join(" ")}function g(b){const x=b??"primary",h=new Map,C=$.backgroundValue(x,"solid","light"),_=$.backgroundValue(x,"solid","dark");return h.set("--switch-track-on-bg",C.backgroundColor),h.set("--switch-track-on-label",C.textColor),h.set("--switch-track-on-bg-dark",_.backgroundColor),h.set("--switch-track-on-label-dark",_.textColor),h.set("--switch-track-on-border-dark",$.borderColorValue(x,"dark")),Array.from(h.entries()).map(([M,m])=>`${M}: ${m}`).join("; ")}const y=()=>{e.Value.get(l)||(n?.(!e.Value.get(t)),a?.(!e.Value.get(t)))},w=b=>{e.Value.get(l)||(b.key===" "||b.key==="Enter")&&(b.preventDefault(),y())};return e.html.div(e.attr.class(e.computedOf(l??!1,c)((b,x)=>f(b??!1,x??"md"))),e.attr.style(e.computedOf(u)(b=>g(b))),e.attr.id(d),e.attr.role("switch"),e.attr.tabindex(e.computedOf(l??!1,p)((b,x)=>b?-1:x??0)),e.aria.checked(t),e.aria.disabled(l),e.on.click(y),e.on.keydown(w),r!=null?e.on.blur(r):null,e.html.div(e.attr.class("bc-switch__track"),e.attr.class(e.Value.map(t,b=>b?"bc-switch__track--on":"bc-switch__track--off")),o!=null?e.html.div(e.aria.hidden(!0),e.attr.class("bc-switch__track-label bc-switch__track-label--off"),e.attr.class(e.Value.map(t,b=>b?"bc-switch__track-label--hidden":"bc-switch__track-label--visible")),o):null,s!=null?e.html.div(e.attr.class("bc-switch__track-label bc-switch__track-label--on"),e.attr.class(e.Value.map(t,b=>b?"bc-switch__track-label--visible":"bc-switch__track-label--hidden")),s):null,X.ElementRect(b=>e.Use($.Locale,({direction:x})=>e.html.div(e.attr.class("bc-switch__thumb"),e.attr.class(e.Value.map(t,h=>h?"bc-switch__thumb--on":"bc-switch__thumb--off")),e.style.transform(e.computedOf(t,b,c,x)((h,{width:C},_,M)=>{const m=(()=>{switch(_){case"xs":return 5;case"sm":return 5.5;case"md":return 6;case"lg":return 7;case"xl":return 8}})(),I=M==="rtl"?`calc((var(--spacing-base) * ${m}) - ${C}px)`:`calc(${C}px - (var(--spacing-base) * ${m}))`;return h?`translateX(${I})`:"translateX(0)"})))))))},vt=E(k.UUIDInput),Nt="line-md:star-alt-filled",St="line-md:star-alt",lt=t=>{const{value:n,onChange:a,disabled:r,max:o=5,fullColor:s="yellow",emptyColor:l="neutral",fullIcon:c=Nt,emptyIcon:i=St,size:u="md",onBlur:p,rounding:d=1}=t,f=()=>{const h=e.Value.get(d);return h>0?h:1},g=h=>Math.min(Math.max(h,0),e.Value.get(o)),y=(h,C)=>{if(e.Value.get(r??!1))return;const M=h.currentTarget.getBoundingClientRect(),m=(h.clientX-M.left)/M.width,I=C-1+m,V=f(),T=Math.ceil(I/V)*V,A=g(T);a?.(A)},w=h=>{if(e.Value.get(r??!1))return;const C=f(),_=e.Value.get(n)??0;let M;switch(h.key){case"ArrowRight":case"ArrowUp":M=g(_+C);break;case"ArrowLeft":case"ArrowDown":M=g(_-C);break;case"Home":M=0;break;case"End":M=e.Value.get(o);break;default:return}h.preventDefault(),a?.(M)},b=e.Value.map(u,h=>`bc-icon--${h}`),x=({index:h,counter:C})=>e.html.span(e.attr.class("bc-rating-input__icon-container"),e.attr.class(b),$.Icon({icon:i,size:u,color:l,tone:"soft"},e.attr.class("bc-rating-input__icon-empty")),e.html.span(e.attr.class("bc-rating-input__icon-clipper"),e.attr.class(b),e.style.width(e.Value.map(n,_=>{const M=Math.floor(_);return M>h?"100%":M<h?"0%":`${(_-h)*100}%`})),$.Icon({icon:c,size:u,color:s,tone:"soft"},e.attr.class("bc-rating-input__icon-full"))),e.on.click(e.emit(_=>y(_,C),{preventDefault:!0,stopPropagation:!0})));return $.InputContainer({baseContainer:!0,growInput:!1,focusableSelector:'[role="slider"]',...t,input:e.html.div($.CommonInputAttributes(t),e.attr.class("bc-rating-input"),e.attr.role("slider"),e.attr.tabindex(e.Value.map(r??!1,h=>h?-1:0)),e.aria.disabled(r??!1),e.aria.valuemin(0),e.aria.valuemax(e.Value.map(o,h=>h??0)),e.aria.valuenow(e.Value.map(n,h=>h??0)),e.aria.valuetext(e.computedOf(n,o)((h,C)=>{const _=h??0,M=C??0;return`${String(_)} / ${String(M)}`})),e.on.keydown(w),p!=null?e.on.blur(p):null,e.Repeat(o,x))})},Rt=t=>{const{value:n,onChange:a,onInput:r,onBlur:o,after:s,disabled:l,...c}=t,i=k.NullableResetAfter(n,l,a??r);return lt({...c,value:e.Value.map(n,u=>u??0),onChange:a,onInput:r,onBlur:o,after:s!=null?e.Fragment(i,s):i})},Et=t=>{const{value:n,step:a,min:r,max:o,onBlur:s,onChange:l,onInput:c}=t;return $.InputContainer({...t,focusableSelector:'input[type="range"]',input:e.html.input(e.attr.type("range"),$.CommonInputAttributes(t),e.attr.min(r),e.attr.max(o),e.attr.step(a),e.attr.valueAsNumber(n),e.attr.class("bc-input bc-slider-input"),s!=null?e.on.blur(e.emitValueAsNumber(s)):e.Empty,l!=null?e.on.change(e.emitValueAsNumber(l)):e.Empty,c!=null?e.on.input(e.emitValueAsNumber(c)):e.Empty)})},Dt=t=>{const{value:n,step:a,min:r,max:o,onBlur:s,onChange:l,onInput:c}=t,i=e.Value.map(n,p=>{if(p!=null)return p;const d=r!=null?e.Value.get(r):void 0;return typeof d=="number"?d:0}),u=k.NullableResetAfter(n,t.disabled,l??c);return $.InputContainer({...t,focusableSelector:'input[type="range"]',after:u,input:e.html.input(e.attr.type("range"),$.CommonInputAttributes(t),e.attr.min(r),e.attr.max(o),e.attr.step(a),e.attr.valueAsNumber(i),e.attr.class("bc-input bc-slider-input"),s!=null?e.on.blur(e.emitValueAsNumber(s)):e.Empty,l!=null?e.on.change(e.emitValueAsNumber(p=>{l(p)})):e.Empty,c!=null?e.on.input(e.emitValueAsNumber(p=>{c(p)})):e.Empty)},e.Fragment())},Ot=E(k.UrlInput),W=["description","comment","notes","text"];function Bt(t){if(typeof t=="boolean")return W;const n=t["x:ui"];return n&&Array.isArray(n.textAreaTriggers)?[...W,...n.textAreaTriggers]:W}function ct(t){if(typeof t=="boolean")return;const n=t["x:ui"];if(n!=null&&(typeof n=="string"||typeof n=="object"&&n!==null))return n}function it(t,n){if(typeof t=="boolean")return;const a=ct(t);if(typeof a=="object"&&typeof a.widget=="string")return{widget:a.widget,source:"explicit-widget",options:a};const r=typeof a=="string"?a:typeof a=="object"&&typeof a.format=="string"?a.format:void 0;if(r)return{widget:r,source:"explicit-format",options:typeof a=="object"?a:void 0};if(typeof t.format=="string")return{widget:{datetime:"date-time",base64:"binary",bytes:"binary",iri:"uri","iri-reference":"uri-reference","idn-hostname":"hostname"}[t.format]||t.format,source:"schema-format"};if(t.contentMediaType==="text/markdown")return{widget:"markdown",source:"schema-media"};if(t.contentMediaType!=null||t.contentEncoding==="base64")return{widget:"binary",source:"schema-media",options:{mediaType:t.contentMediaType,encoding:t.contentEncoding}};if(t.enum!=null)return{widget:"enum",source:"constraints"};if(t.const!=null)return{widget:"const",source:"constraints"};if((t.type==="number"||t.type==="integer"||Array.isArray(t.type)&&t.type.some(s=>s==="number"||s==="integer"))&&t.minimum!=null&&t.maximum!=null)return t.maximum-t.minimum<=5&&t.minimum>=0&&t.minimum<=1&&(t.multipleOf==null||t.multipleOf>=1)?{widget:"rating",source:"constraints",options:{max:t.maximum}}:{widget:"slider",source:"constraints",options:{min:t.minimum,max:t.maximum,step:t.multipleOf}};if(t.type==="string"){if(t.minLength!=null&&t.minLength>20||t.maxLength!=null&&t.maxLength>100)return{widget:"textarea",source:"heuristics"};if(n){const s=n.toLowerCase();if(s.includes("password")||s.includes("secret"))return{widget:"password",source:"heuristics"};if(s.includes("email"))return{widget:"email",source:"heuristics"};if(s.includes("url")||s.includes("link"))return{widget:"url",source:"heuristics"};if(s.includes("color"))return{widget:"color",source:"heuristics"};if(Bt(t).some(c=>s.includes(c.toLowerCase())))return{widget:"textarea",source:"heuristics"}}}}class ut{widgets=new Map;typeMapping=new Map;register(n,a){if(this.widgets.set(n,a),a.supportedTypes)for(const r of a.supportedTypes)this.typeMapping.has(r)||this.typeMapping.set(r,[]),this.typeMapping.get(r).push(n),this.typeMapping.get(r).sort((o,s)=>{const l=this.widgets.get(o)?.priority||0;return(this.widgets.get(s)?.priority||0)-l})}unregister(n){const a=this.widgets.get(n);if(a&&(this.widgets.delete(n),a.supportedTypes))for(const r of a.supportedTypes){const o=this.typeMapping.get(r);if(o){const s=o.indexOf(n);s>=0&&o.splice(s,1),o.length===0&&this.typeMapping.delete(r)}}}get(n){return this.widgets.get(n)}getAll(){return new Map(this.widgets)}getForType(n){return(this.typeMapping.get(n)||[]).map(r=>this.widgets.get(r)).filter(Boolean)}findBestWidget(n){const a=it(n.definition,n.name);if(a?.widget){const o=this.widgets.get(a.widget);if(o)return{name:a.widget,registration:o,resolved:a}}const r=[];for(const[o,s]of this.widgets.entries())if(s.matcher)try{s.matcher(n)&&r.push({name:o,registration:s,priority:s.priority??0})}catch(l){console.warn(`Error in matcher for widget "${o}":`,l)}if(r.length>0){r.sort((s,l)=>l.priority-s.priority);const o=r[0];return{name:o.name,registration:o.registration,resolved:{widget:o.name,source:"heuristics"}}}if(typeof n.definition=="object"&&n.definition.type){const o=Array.isArray(n.definition.type)?n.definition.type[0]:n.definition.type,s=this.getForType(o);if(s.length>0){const l=this.typeMapping.get(o)[0];return{name:l,registration:s[0],resolved:{widget:l,source:"type-fallback"}}}}return null}}const Lt=new ut;function Ut(t,n,a){return{name:t,factory:n,displayName:a?.displayName||t,priority:a?.priority??100,...a}}function Wt(t,n,a){return{name:a?.name||`custom-${t}`,factory:n,displayName:a?.displayName||`${t} widget`,priority:a?.priority??75,matcher:r=>r.definition.format===t,...a}}function Ht(t,n,a,r){return{name:r?.name||`custom-${t}-${n}`,factory:a,displayName:r?.displayName||`${t}:${n} widget`,priority:r?.priority??80,matcher:o=>{const s=o.definition;return s.type===t&&s.format===n},...r}}function Pt(t){const n=t?.logPrefix??"WIDGET_DIAG",a=t?.filterFn??(()=>!0);return{name:"__diagnostic-widget__",factory:()=>null,displayName:"Diagnostic Widget (never matches)",priority:-1e3,matcher:r=>{if(!a(r))return!1;const o=r.definition,s={name:r.name,path:r.path.map(String),type:o?.type,hasRegistry:r.widgetRegistry!==void 0,definition:o};return console.log(`[${n}] name="${s.name??"ROOT"}" path=[${s.path.join(", ")}] type="${s.type??"unknown"}" hasRegistry=${s.hasRegistry}`),t?.onProcess?.(s),!1}}}exports.Base64Input=bt;exports.Base64sInput=st;exports.Card=xt;exports.ColorSwatchInput=wt;exports.EditableText=$t;exports.NullableDateInput=Mt;exports.NullableDateTimeInput=_t;exports.NullableEmailInput=Ct;exports.NullablePasswordInput=At;exports.NullableRatingInput=Rt;exports.NullableSliderInput=Dt;exports.NullableTextArea=Ft;exports.NullableTextInput=Tt;exports.NullableUUIDInput=vt;exports.NullableUrlInput=Ot;exports.RatingInput=lt;exports.SliderInput=Et;exports.Switch=kt;exports.WidgetRegistry=ut;exports.createDiagnosticWidget=Pt;exports.emptyToNull=H;exports.fileToBase64=at;exports.forFormat=Wt;exports.forTypeAndFormat=Ht;exports.forXUI=Ut;exports.formatColor=N;exports.getContrastRatio=mt;exports.getXUIConfig=ct;exports.globalWidgetRegistry=Lt;exports.hexToRgb=R;exports.hslToRgb=j;exports.hwbToRgb=tt;exports.isValidColor=gt;exports.isValidHexColor=P;exports.isValidHslColor=G;exports.isValidRgbColor=z;exports.isValidRgbaColor=Y;exports.linearToSrgb=O;exports.mulberry32=J;exports.normalizeHexColor=K;exports.nullToEmpty=ot;exports.oklchToRgb=nt;exports.parseAnyColor=Q;exports.resolveEffectiveFormat=S;exports.resolveWidget=it;exports.rgbToHex=B;exports.rgbToHsl=L;exports.rgbToHwb=et;exports.rgbToOklch=rt;exports.srgbToLinear=D;exports.toRgbaString=Z;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempots/beatui",
3
- "version": "0.72.0",
3
+ "version": "0.74.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.es.js",
@@ -118,22 +118,7 @@
118
118
  "peerDependencies": {
119
119
  "@tempots/dom": "35.0.0",
120
120
  "@tempots/std": "0.24.0",
121
- "@tempots/ui": "14.0.0",
122
- "tailwindcss": "4.1.17"
123
- },
124
- "peerDependenciesMeta": {
125
- "@tempots/dom": {
126
- "optional": false
127
- },
128
- "@tempots/std": {
129
- "optional": false
130
- },
131
- "@tempots/ui": {
132
- "optional": false
133
- },
134
- "tailwindcss": {
135
- "optional": true
136
- }
121
+ "@tempots/ui": "14.0.0"
137
122
  },
138
123
  "devDependencies": {
139
124
  "@eslint/js": "^9.39.1",
@@ -1 +0,0 @@
1
- "use strict";const e=require("@tempots/dom"),F=require("./deep-merge-DZxfgKqX.cjs"),M=require("./translations-hMQlZmD4.cjs"),X=require("@tempots/ui"),q=require("./notice-DP209Ed8.cjs"),pt=require("./use-form-DVJXMMoN.cjs");function P(t){if(typeof t!="string")return!1;const n=t.startsWith("#")?t.slice(1):t;return/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(n)}function z(t){if(typeof t!="string")return!1;const n=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,a=t.match(n);if(!a)return!1;const[,r,o,s]=a,l=parseInt(r,10),c=parseInt(o,10),u=parseInt(s,10);return l>=0&&l<=255&&c>=0&&c<=255&&u>=0&&u<=255}function Y(t){if(typeof t!="string")return!1;const n=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i,a=t.match(n);if(!a)return!1;const[,r,o,s,l]=a,c=parseInt(r,10),u=parseInt(o,10),i=parseInt(s,10),p=parseFloat(l);return c>=0&&c<=255&&u>=0&&u<=255&&i>=0&&i<=255&&p>=0&&p<=1}function K(t){if(typeof t!="string")return!1;const n=/^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/i,a=t.match(n);if(!a)return!1;const[,r,o,s]=a,l=parseInt(r,10),c=parseInt(o,10),u=parseInt(s,10);return l>=0&&l<=360&&c>=0&&c<=100&&u>=0&&u<=100}function mt(t){return P(t)||z(t)||Y(t)||K(t)}function Q(t){if(!P(t))return null;let n=t.startsWith("#")?t.slice(1):t;return n.length===3&&(n=n.split("").map(a=>a+a).join("")),`#${n.toLowerCase()}`}function O(t,n,a){const r=o=>{const s=Math.round(Math.max(0,Math.min(255,o))).toString(16);return s.length===1?"0"+s:s};return`#${r(t)}${r(n)}${r(a)}`}function R(t){const n=Q(t);if(!n)return null;const a=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return a?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null}function gt(t,n){const a=R(t),r=R(n);if(!a||!r)return null;const o=(i,p,d)=>{const[f,m,y]=[i,p,d].map(w=>(w=w/255,w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4)));return .2126*f+.7152*m+.0722*y},s=o(a.r,a.g,a.b),l=o(r.r,r.g,r.b),c=Math.max(s,l),u=Math.min(s,l);return(c+.05)/(u+.05)}function Z(t){if(!t)return[0,0,0,1];const a=t.trim().match(/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/);if(a){const i=a[1];if(i.length===8){const p=parseInt(i.slice(0,2),16),d=parseInt(i.slice(2,4),16),f=parseInt(i.slice(4,6),16),m=parseInt(i.slice(6,8),16)/255;return[p,d,f,m]}if(i.length===6)return[parseInt(i.slice(0,2),16),parseInt(i.slice(2,4),16),parseInt(i.slice(4,6),16),1];if(i.length===4){const p=parseInt(i[0]+i[0],16),d=parseInt(i[1]+i[1],16),f=parseInt(i[2]+i[2],16),m=parseInt(i[3]+i[3],16)/255;return[p,d,f,m]}if(i.length===3){const p=parseInt(i[0]+i[0],16),d=parseInt(i[1]+i[1],16),f=parseInt(i[2]+i[2],16);return[p,d,f,1]}}const r=t.match(/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i);if(r)return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseFloat(r[4])];const o=t.match(/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);if(o)return[parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3],10),1];const s=t.match(/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(s){const i=parseFloat(s[1]),p=parseFloat(s[2]),d=parseFloat(s[3]),f=s[4]!=null?parseFloat(s[4]):1,[m,y,w]=j(i,p/100,d/100);return[m,y,w,f]}const l=t.match(/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(l){const i=parseFloat(l[1]),p=parseFloat(l[2])/100,d=parseFloat(l[3])/100,f=l[4]!=null?parseFloat(l[4]):1,[m,y,w]=tt(i,p,d);return[m,y,w,f]}const c=t.match(/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(c){const i=c[1],p=parseFloat(c[2]),d=parseFloat(c[3]),f=c[4]!=null?parseFloat(c[4]):1,m=i.endsWith("%")?Math.max(0,Math.min(1,parseFloat(i)/100)):Math.max(0,Math.min(1,parseFloat(i))),[y,w,b]=nt(m,p,d);return[y,w,b,f]}const u=R(t);return u?[u.r,u.g,u.b,1]:[0,0,0,1]}function G(t,n,a,r){return`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(a)}, ${Math.max(0,Math.min(1,Math.round(r*100)/100))})`}function J(t){let n=t+1831565813;return function(){return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function j(t,n,a){t=(t%360+360)%360;const r=(1-Math.abs(2*a-1))*n,o=r*(1-Math.abs(t/60%2-1)),s=a-r/2;let l=0,c=0,u=0;return 0<=t&&t<60?[l,c,u]=[r,o,0]:60<=t&&t<120?[l,c,u]=[o,r,0]:120<=t&&t<180?[l,c,u]=[0,r,o]:180<=t&&t<240?[l,c,u]=[0,o,r]:240<=t&&t<300?[l,c,u]=[o,0,r]:[l,c,u]=[r,0,o],[Math.round((l+s)*255),Math.round((c+s)*255),Math.round((u+s)*255)]}function tt(t,n,a){t=(t%360+360)%360;const r=n+a;r>1&&(n/=r,a/=r);const[o,s,l]=j(t,1,.5).map(d=>d/255),c=1-n-a,u=o*c+n,i=s*c+n,p=l*c+n;return[Math.round(u*255),Math.round(i*255),Math.round(p*255)]}function L(t,n,a){t/=255,n/=255,a/=255;const r=Math.max(t,n,a),o=Math.min(t,n,a);let s=0,l=0;const c=(r+o)/2,u=r-o;if(u!==0){switch(l=c>.5?u/(2-r-o):u/(r+o),r){case t:s=(n-a)/u+(n<a?6:0);break;case n:s=(a-t)/u+2;break;default:s=(t-n)/u+4}s*=60}return[Math.round(s),Math.round(l*100),Math.round(c*100)]}function et(t,n,a){const[r]=L(t,n,a),o=t/255,s=n/255,l=a/255,c=Math.min(o,s,l),u=1-Math.max(o,s,l);return[r,Math.round(c*100),Math.round(u*100)]}function D(t){const n=t/255;return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function B(t){const n=t<=.0031308?12.92*t:1.055*Math.pow(t,.4166666666666667)-.055;return Math.round(Math.max(0,Math.min(1,n))*255)}function nt(t,n,a){const r=a*Math.PI/180,o=Math.cos(r)*n,s=Math.sin(r)*n,l=t+.3963377774*o+.2158037573*s,c=t-.1055613458*o-.0638541728*s,u=t-.0894841775*o-1.291485548*s,i=l*l*l,p=c*c*c,d=u*u*u,f=4.0767416621*i-3.3077115913*p+.2309699292*d,m=-1.2684380046*i+2.6097574011*p-.3413193965*d,y=-.0041960863*i-.7034186147*p+1.707614701*d;return[B(f),B(m),B(y)]}function rt(t,n,a){const r=D(t),o=D(n),s=D(a),l=.4122214708*r+.5363325363*o+.0514459929*s,c=.2119034982*r+.6806995451*o+.1073969566*s,u=.0883024619*r+.2817188376*o+.6299787005*s,i=Math.cbrt(l),p=Math.cbrt(c),d=Math.cbrt(u),f=.2104542553*i+.793617785*p-.0040720468*d,m=1.9779984951*i-2.428592205*p+.4505937099*d,y=.0259040371*i+.7827717662*p-.808675766*d,w=Math.sqrt(m*m+y*y);let b=Math.atan2(y,m)*180/Math.PI;return b<0&&(b+=360),[f,w,b]}function N(t,n,a,r,o,s){switch(o){case"hex":if(s){const l=u=>u.toString(16).padStart(2,"0"),c=Math.max(0,Math.min(255,Math.round(r*255)));return`#${l(t)}${l(n)}${l(a)}${l(c)}`}return O(t,n,a);case"rgb":return`rgb(${t}, ${n}, ${a})`;case"rgba":return`rgba(${t}, ${n}, ${a}, ${Math.round(r*100)/100})`;case"hsl":{const[l,c,u]=L(t,n,a);return`hsl(${l}, ${c}%, ${u}%)`}case"hsla":{const[l,c,u]=L(t,n,a);return`hsla(${l}, ${c}%, ${u}%, ${Math.round(r*100)/100})`}case"hwb":{const[l,c,u]=et(t,n,a);return r<1?`hwb(${l} ${c}% ${u}% / ${Math.round(r*100)/100})`:`hwb(${l} ${c}% ${u}%)`}case"oklch":{const[l,c,u]=rt(t,n,a),i=(Math.round(l*1e3)/1e3).toFixed(3),p=(Math.round(c*1e3)/1e3).toFixed(3),d=(Math.round(u*10)/10).toFixed(1),f=Math.round(r*100)/100;return s||r<1?`oklch(${i} ${p} ${d} / ${f})`:`oklch(${i} ${p} ${d})`}}}function S(t,n){return n?t==="rgb"?"rgba":t==="hsl"?"hsla":t:t==="rgba"?"rgb":t==="hsla"?"hsl":t}async function at(t){return new Promise((n,a)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>{const o=r.result;n(o.split(",")[1])},r.onerror=o=>a(o)})}function dt(t){return Promise.all(t.map(at))}function ht(t){if(t.length>=4){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71)return"image/png";if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===71&&t[1]===73&&t[2]===70)return"image/gif";if(t[0]===82&&t[1]===73&&t[2]===70&&t[3]===70&&t.length>=12&&t[8]===87&&t[9]===69&&t[10]===66&&t[11]===80)return"image/webp"}try{if(new TextDecoder("utf-8").decode(t.slice(0,256)).includes("<svg"))return"image/svg+xml"}catch{}return"application/octet-stream"}function ft(t){const n=F.$t(t??""),a=n.length,r=new Uint8Array(a);for(let o=0;o<a;o++)r[o]=n.charCodeAt(o);return r}function st(t){const{value:n,onChange:a,onInput:r,...o}=t,s=new Map,l=e.Value.toSignal(n).map(p=>p.map((d,f)=>{const m=s.get(d),y=ft(d??""),w=m?.type||ht(y),b=m?.name??`file-${f}`,x=y.buffer.slice(y.byteOffset,y.byteOffset+y.byteLength),h=new Blob([x],{type:w});return new File([h],b,{type:w})})),c=p=>d=>{p&&dt(d).then(f=>{for(const[m,y]of f.entries())s.set(y,{name:d[m].name,type:d[m].type});p(f)})},u=c(a),i=c(r);return F.FilesInput({...o,value:l,onChange:u,onInput:i})}function bt(t){const{value:n,onInput:a,onChange:r,...o}=t;return st({...o,maxFiles:1,value:e.Value.map(n,s=>s==null?[]:[s]),onChange:s=>{r?.(s[0])},onInput:s=>{a?.(s[0])}})}function yt(t,n){const[a,r,o]=t,s=a<<16^r<<8^o,l=J(s),c=6+Math.floor(l()*5),u=.18+l()*.06,i=[];for(let m=0;m<c;m++){const y=m/c*Math.PI*2,w=n*(1+(l()*2-1)*u),b=Math.cos(y)*w,x=Math.sin(y)*w;i.push({x:b,y:x})}const p=(i[0].x+i[c-1].x)/2,d=(i[0].y+i[c-1].y)/2;let f=`M ${p.toFixed(3)} ${d.toFixed(3)}`;for(let m=0;m<c;m++){const y=i[m],w=i[(m+1)%c],b=(y.x+w.x)/2,x=(y.y+w.y)/2;f+=` Q ${y.x.toFixed(3)} ${y.y.toFixed(3)} ${b.toFixed(3)} ${x.toFixed(3)}`}return f+=" Z",f}const wt=t=>{const{value:n,onBlur:a,onChange:r,onInput:o,displayValue:s,size:l,withAlpha:c}=t,u=e.Value.map(l??32,g=>g),i=e.Value.map(n,g=>Z(g??"#000000")),p=e.Value.map(i,([g,I,V])=>[g,I,V]),d=e.Value.map(i,([,,,g])=>g),f=e.prop(e.Value.get(d)??1),m=e.Value.map(c??!1,g=>g),y=e.Value.map(t.colorTextFormat??"rgb",g=>g),w=e.computedOf(p,f,y,m)(([g,I,V],T,A,k)=>N(g,I,V,T??1,S(A,k),k)),b=e.Value.map(t.colorTextFormat??"hex",g=>g),x=e.Value.map(u,g=>`${-g/2} ${-g/2} ${g} ${g}`),h=e.computedOf(p,u)((g,I)=>yt(g,I/2)),_=e.computedOf(p,f,m)(([g,I,V],T,A)=>A||T<1?G(g,I,V,T):O(g,I,V)),C=e.html.div(e.attr.class("bc-color-swatch-input__control"),e.attr.class(e.Value.map(m,g=>g?"bc-color-swatch-input__control--alpha":"")),e.attr.style(e.computedOf(u)(g=>`min-width:${g+2}px;height:${g+2}px`)),e.svg.svg(e.attr.class("bc-color-swatch-input__svg"),e.svgAttr.viewBox(x),e.svg.path(e.svgAttr.d(h),e.svgAttr.fill(_))),e.html.input(e.attr.type("color"),M.CommonInputAttributes(t),e.attr.value(e.Value.map(p,([g,I,V])=>O(g,I,V))),e.attr.class("bc-input bc-color-swatch-input bc-color-swatch-input__native"),a!=null?e.on.blur(a):e.Empty,r!=null?e.on.change(g=>{const I=g.target.value;if(!r)return;const{r:V,g:T,b:A}=R(I)??{r:0,g:0,b:0},k=e.Value.get(f)??1,v=S(e.Value.get(b),e.Value.get(m)),U=N(V,T,A,k,v,e.Value.get(m));r(U)}):e.Empty,o!=null?e.on.input(g=>{const I=g.target.value;if(!o)return;const{r:V,g:T,b:A}=R(I)??{r:0,g:0,b:0},k=e.Value.get(f)??1,v=S(e.Value.get(b),e.Value.get(m)),U=N(V,T,A,k,v,e.Value.get(m));o(U)}):e.Empty)),$=e.When(m,()=>e.html.input(e.attr.type("range"),e.attr.class("bc-color-swatch-input__alpha"),e.attr.min(0),e.attr.max(1),e.attr.step(.01),e.attr.value(e.Value.map(f,g=>String(g??1))),e.attr.disabled(t.disabled),e.on.input(g=>{const I=parseFloat(g.target.value);f.set(I);const[V,T,A]=e.Value.get(p),k=S(e.Value.get(b),e.Value.get(m)),v=N(V,T,A,I,k,e.Value.get(m));o?.(v)}),e.on.change(g=>{const I=parseFloat(g.target.value);f.set(I);const[V,T,A]=e.Value.get(p),k=S(e.Value.get(b),e.Value.get(m)),v=N(V,T,A,I,k,e.Value.get(m));r?.(v)})));return M.InputContainer({baseContainer:!0,...t,growInput:!1,input:C,after:e.Fragment(e.When(s??!1,()=>e.html.span(e.attr.class("bc-color-swatch-input__rgb"),w)),$,t.after)})};function It(t,n,a){const r=["bc-card"];return t!=="default"&&r.push(`bc-card--${t}`),n!=="md"&&r.push(`bc-card--padding-${n}`),a!=="lg"&&r.push(`bc-card--rounded-${a}`),r.join(" ")}function xt({variant:t="default",size:n="md",roundedness:a="lg"}={},...r){return e.html.div(e.attr.class(e.computedOf(t,n,a)((o,s,l)=>It(o??"default",s??"md",l??"lg"))),...r)}const Mt=({startEditing:t,value:n,onChange:a,placeholder:r,disabled:o})=>{const s=e.Value.deriveProp(t??!1),l=e.prop(!1),c=e.Value.map(o??!1,u=>u);return e.html.div(e.attr.class("bc-editable-text"),e.attr.class(e.Value.map(c,u=>u?"bc-editable-text--disabled":"")),e.aria.disabled(c),e.When(s,()=>e.html.input(e.attr.placeholder(r),e.attr.value(n),e.attr.class("bc-editable-text__input"),X.AutoSelect(),e.on.keydown(u=>{u.key==="Enter"?s.set(!1):u.key==="Escape"&&(l.set(!0),s.set(!1))}),e.on.blur(e.emitValue(u=>{if(s.set(!1),l.value){l.set(!1);return}a(u)}))),()=>e.html.span(e.on.click(()=>{e.Value.get(c)||s.set(!0)}),e.attr.class("bc-editable-text__display"),e.When(e.Value.map(n,u=>u!=null&&u.trim()!==""),()=>e.html.span(e.attr.class("bc-editable-text__text"),n),()=>e.html.span(e.attr.class("bc-editable-text__placeholder"),r)),e.When(e.Value.map(c,u=>!u),()=>e.html.button(e.attr.type("button"),e.attr.class("bc-editable-text__edit-button"),e.Use(M.BeatUII18n,u=>e.aria.label(u.$.editLabel)),e.on.click(()=>s.set(!0)),M.Icon({icon:"line-md/pencil",color:"neutral"}))))))},$t=t=>{const{value:n,onBlur:a,onChange:r,onInput:o,after:s,disabled:l}=t,c=F.NullableResetAfter(n,l,r??o);return M.InputContainer({...t,input:e.input.date(M.CommonInputAttributes(t),e.attr.valueAsDate(n),e.attr.class("bc-input"),a!=null?e.on.blur(e.emitValue(a)):e.Empty,r!=null?e.on.change(e.emitValueAsNullableDate(r)):e.Empty,o!=null?e.on.input(e.emitValueAsNullableDate(o)):e.Empty),after:s!=null?e.Fragment(c,s):c})},Vt=t=>{const n=t.getFullYear(),a=t.getMonth()+1,r=t.getDate(),o=t.getHours(),s=t.getMinutes(),l=t.getSeconds();return`${n}-${a.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${o.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`},Ct=t=>{const{value:n,onBlur:a,onChange:r,onInput:o,after:s,disabled:l}=t,c=e.Value.map(n,i=>i!=null?Vt(i):null),u=F.NullableResetAfter(n,l,r??o);return M.InputContainer({...t,input:e.input["datetime-local"](M.CommonInputAttributes(t),e.attr.value(e.Value.map(c,i=>i??null)),e.attr.class("bc-input"),a!=null?e.on.blur(e.emitValue(a)):e.Empty,r!=null?e.on.change(e.emitValueAsNullableDateTime(r)):e.Empty,o!=null?e.on.input(e.emitValueAsNullableDateTime(o)):e.Empty),after:s!=null?e.Fragment(u,s):u})},W=t=>typeof t=="string"&&t.trim()===""?null:t,ot=t=>t??"";function E(t){return n=>{const{value:a,onBlur:r,onChange:o,onInput:s,after:l,disabled:c,...u}=n,i=F.NullableResetAfter(a,c,o??s);return t({...u,disabled:c,value:e.Value.map(a,ot),onChange:o!=null?p=>o(W(p)):void 0,onInput:s!=null?p=>s(W(p)):void 0,onBlur:r,after:l!=null?e.Fragment(i,l):i})}}const _t=E(q.EmailInput),Tt=E(M.TextInput),At=E(q.PasswordInput),kt=E(F.TextArea),Ft=({value:t,onChange:n,onInput:a,onBlur:r,offLabel:o,onLabel:s,disabled:l=!1,size:c="md",id:u,color:i="primary",tabIndex:p=0})=>{const d=u??pt.sessionId("switch");function f(b,x){const h=["bc-switch",`bc-switch--size-${x}`,`bc-switch--${x}`];return b&&h.push("bc-switch--disabled"),h.join(" ")}function m(b){const x=b??"primary",h=new Map,_=M.backgroundValue(x,"solid","light"),C=M.backgroundValue(x,"solid","dark");return h.set("--switch-track-on-bg",_.backgroundColor),h.set("--switch-track-on-label",_.textColor),h.set("--switch-track-on-bg-dark",C.backgroundColor),h.set("--switch-track-on-label-dark",C.textColor),h.set("--switch-track-on-border-dark",M.borderColorValue(x,"dark")),Array.from(h.entries()).map(([$,g])=>`${$}: ${g}`).join("; ")}const y=()=>{e.Value.get(l)||(n?.(!e.Value.get(t)),a?.(!e.Value.get(t)))},w=b=>{e.Value.get(l)||(b.key===" "||b.key==="Enter")&&(b.preventDefault(),y())};return e.html.div(e.attr.class(e.computedOf(l??!1,c)((b,x)=>f(b??!1,x??"md"))),e.attr.style(e.computedOf(i)(b=>m(b))),e.attr.id(d),e.attr.role("switch"),e.attr.tabindex(e.computedOf(l??!1,p)((b,x)=>b?-1:x??0)),e.aria.checked(t),e.aria.disabled(l),e.on.click(y),e.on.keydown(w),r!=null?e.on.blur(r):null,e.html.div(e.attr.class("bc-switch__track"),e.attr.class(e.Value.map(t,b=>b?"bc-switch__track--on":"bc-switch__track--off")),o!=null?e.html.div(e.aria.hidden(!0),e.attr.class("bc-switch__track-label bc-switch__track-label--off"),e.attr.class(e.Value.map(t,b=>b?"bc-switch__track-label--hidden":"bc-switch__track-label--visible")),o):null,s!=null?e.html.div(e.attr.class("bc-switch__track-label bc-switch__track-label--on"),e.attr.class(e.Value.map(t,b=>b?"bc-switch__track-label--visible":"bc-switch__track-label--hidden")),s):null,X.ElementRect(b=>e.Use(M.Locale,({direction:x})=>e.html.div(e.attr.class("bc-switch__thumb"),e.attr.class(e.Value.map(t,h=>h?"bc-switch__thumb--on":"bc-switch__thumb--off")),e.style.transform(e.computedOf(t,b,c,x)((h,{width:_},C,$)=>{const g=(()=>{switch(C){case"xs":return 5;case"sm":return 5.5;case"md":return 6;case"lg":return 7;case"xl":return 8}})(),I=$==="rtl"?`calc((var(--spacing-base) * ${g}) - ${_}px)`:`calc(${_}px - (var(--spacing-base) * ${g}))`;return h?`translateX(${I})`:"translateX(0)"})))))))},vt=E(F.UUIDInput),Nt="line-md:star-alt-filled",St="line-md:star-alt",lt=t=>{const{value:n,onChange:a,disabled:r,max:o=5,fullColor:s="yellow",emptyColor:l="neutral",fullIcon:c=Nt,emptyIcon:u=St,size:i="md",onBlur:p,rounding:d=1}=t,f=()=>{const h=e.Value.get(d);return h>0?h:1},m=h=>Math.min(Math.max(h,0),e.Value.get(o)),y=(h,_)=>{if(e.Value.get(r??!1))return;const $=h.currentTarget.getBoundingClientRect(),g=(h.clientX-$.left)/$.width,I=_-1+g,V=f(),T=Math.ceil(I/V)*V,A=m(T);a?.(A)},w=h=>{if(e.Value.get(r??!1))return;const _=f(),C=e.Value.get(n)??0;let $;switch(h.key){case"ArrowRight":case"ArrowUp":$=m(C+_);break;case"ArrowLeft":case"ArrowDown":$=m(C-_);break;case"Home":$=0;break;case"End":$=e.Value.get(o);break;default:return}h.preventDefault(),a?.($)},b=e.Value.map(i,h=>`bc-icon--${h}`),x=({index:h,counter:_})=>e.html.span(e.attr.class("bc-rating-input__icon-container"),e.attr.class(b),M.Icon({icon:u,size:i,color:l,tone:"soft"},e.attr.class("bc-rating-input__icon-empty")),e.html.span(e.attr.class("bc-rating-input__icon-clipper"),e.attr.class(b),e.style.width(e.Value.map(n,C=>{const $=Math.floor(C);return $>h?"100%":$<h?"0%":`${(C-h)*100}%`})),M.Icon({icon:c,size:i,color:s,tone:"soft"},e.attr.class("bc-rating-input__icon-full"))),e.on.click(e.emit(C=>y(C,_),{preventDefault:!0,stopPropagation:!0})));return M.InputContainer({baseContainer:!0,growInput:!1,focusableSelector:'[role="slider"]',...t,input:e.html.div(M.CommonInputAttributes(t),e.attr.class("bc-rating-input"),e.attr.role("slider"),e.attr.tabindex(e.Value.map(r??!1,h=>h?-1:0)),e.aria.disabled(r??!1),e.aria.valuemin(0),e.aria.valuemax(e.Value.map(o,h=>h??0)),e.aria.valuenow(e.Value.map(n,h=>h??0)),e.aria.valuetext(e.computedOf(n,o)((h,_)=>{const C=h??0,$=_??0;return`${String(C)} / ${String($)}`})),e.on.keydown(w),p!=null?e.on.blur(p):null,e.Repeat(o,x))})},Rt=t=>{const{value:n,onChange:a,onInput:r,onBlur:o,after:s,disabled:l,...c}=t,u=F.NullableResetAfter(n,l,a??r);return lt({...c,value:e.Value.map(n,i=>i??0),onChange:a,onInput:r,onBlur:o,after:s!=null?e.Fragment(u,s):u})},Et=t=>{const{value:n,step:a,min:r,max:o,onBlur:s,onChange:l,onInput:c}=t;return M.InputContainer({...t,focusableSelector:'input[type="range"]',input:e.html.input(e.attr.type("range"),M.CommonInputAttributes(t),e.attr.min(r),e.attr.max(o),e.attr.step(a),e.attr.valueAsNumber(n),e.attr.class("bc-input bc-slider-input"),s!=null?e.on.blur(e.emitValueAsNumber(s)):e.Empty,l!=null?e.on.change(e.emitValueAsNumber(l)):e.Empty,c!=null?e.on.input(e.emitValueAsNumber(c)):e.Empty)})},Dt=t=>{const{value:n,step:a,min:r,max:o,onBlur:s,onChange:l,onInput:c}=t,u=e.Value.map(n,p=>{if(p!=null)return p;const d=r!=null?e.Value.get(r):void 0;return typeof d=="number"?d:0}),i=F.NullableResetAfter(n,t.disabled,l??c);return M.InputContainer({...t,focusableSelector:'input[type="range"]',after:i,input:e.html.input(e.attr.type("range"),M.CommonInputAttributes(t),e.attr.min(r),e.attr.max(o),e.attr.step(a),e.attr.valueAsNumber(u),e.attr.class("bc-input bc-slider-input"),s!=null?e.on.blur(e.emitValueAsNumber(s)):e.Empty,l!=null?e.on.change(e.emitValueAsNumber(p=>{l(p)})):e.Empty,c!=null?e.on.input(e.emitValueAsNumber(p=>{c(p)})):e.Empty)},e.Fragment())},Bt=E(F.UrlInput),H=["description","comment","notes","text"];function Ot(t){if(typeof t=="boolean")return H;const n=t["x:ui"];return n&&Array.isArray(n.textAreaTriggers)?[...H,...n.textAreaTriggers]:H}function ct(t){if(typeof t=="boolean")return;const n=t["x:ui"];if(n!=null&&(typeof n=="string"||typeof n=="object"&&n!==null))return n}function ut(t,n){if(typeof t=="boolean")return;const a=ct(t);if(typeof a=="object"&&typeof a.widget=="string")return{widget:a.widget,source:"explicit-widget",options:a};const r=typeof a=="string"?a:typeof a=="object"&&typeof a.format=="string"?a.format:void 0;if(r)return{widget:r,source:"explicit-format",options:typeof a=="object"?a:void 0};if(typeof t.format=="string")return{widget:{datetime:"date-time",base64:"binary",bytes:"binary",iri:"uri","iri-reference":"uri-reference","idn-hostname":"hostname"}[t.format]||t.format,source:"schema-format"};if(t.contentMediaType==="text/markdown")return{widget:"markdown",source:"schema-media"};if(t.contentMediaType!=null||t.contentEncoding==="base64")return{widget:"binary",source:"schema-media",options:{mediaType:t.contentMediaType,encoding:t.contentEncoding}};if(t.enum!=null)return{widget:"enum",source:"constraints"};if(t.const!=null)return{widget:"const",source:"constraints"};if((t.type==="number"||t.type==="integer"||Array.isArray(t.type)&&t.type.some(s=>s==="number"||s==="integer"))&&t.minimum!=null&&t.maximum!=null)return t.maximum-t.minimum<=5&&t.minimum>=0&&t.minimum<=1&&(t.multipleOf==null||t.multipleOf>=1)?{widget:"rating",source:"constraints",options:{max:t.maximum}}:{widget:"slider",source:"constraints",options:{min:t.minimum,max:t.maximum,step:t.multipleOf}};if(t.type==="string"){if(t.minLength!=null&&t.minLength>20||t.maxLength!=null&&t.maxLength>100)return{widget:"textarea",source:"heuristics"};if(n){const s=n.toLowerCase();if(s.includes("password")||s.includes("secret"))return{widget:"password",source:"heuristics"};if(s.includes("email"))return{widget:"email",source:"heuristics"};if(s.includes("url")||s.includes("link"))return{widget:"url",source:"heuristics"};if(s.includes("color"))return{widget:"color",source:"heuristics"};if(Ot(t).some(c=>s.includes(c.toLowerCase())))return{widget:"textarea",source:"heuristics"}}}}class it{widgets=new Map;typeMapping=new Map;register(n,a){if(this.widgets.set(n,a),a.supportedTypes)for(const r of a.supportedTypes)this.typeMapping.has(r)||this.typeMapping.set(r,[]),this.typeMapping.get(r).push(n),this.typeMapping.get(r).sort((o,s)=>{const l=this.widgets.get(o)?.priority||0;return(this.widgets.get(s)?.priority||0)-l})}unregister(n){const a=this.widgets.get(n);if(a&&(this.widgets.delete(n),a.supportedTypes))for(const r of a.supportedTypes){const o=this.typeMapping.get(r);if(o){const s=o.indexOf(n);s>=0&&o.splice(s,1),o.length===0&&this.typeMapping.delete(r)}}}get(n){return this.widgets.get(n)}getAll(){return new Map(this.widgets)}getForType(n){return(this.typeMapping.get(n)||[]).map(r=>this.widgets.get(r)).filter(Boolean)}findBestWidget(n){const a=ut(n.definition,n.name);if(a?.widget){const o=this.widgets.get(a.widget);if(o)return{name:a.widget,registration:o,resolved:a}}const r=[];for(const[o,s]of this.widgets.entries())if(s.matcher)try{s.matcher(n)&&r.push({name:o,registration:s,priority:s.priority??0})}catch(l){console.warn(`Error in matcher for widget "${o}":`,l)}if(r.length>0){r.sort((s,l)=>l.priority-s.priority);const o=r[0];return{name:o.name,registration:o.registration,resolved:{widget:o.name,source:"heuristics"}}}if(typeof n.definition=="object"&&n.definition.type){const o=Array.isArray(n.definition.type)?n.definition.type[0]:n.definition.type,s=this.getForType(o);if(s.length>0){const l=this.typeMapping.get(o)[0];return{name:l,registration:s[0],resolved:{widget:l,source:"type-fallback"}}}}return null}}const Lt=new it;function Ut(t,n,a){return{name:t,factory:n,displayName:a?.displayName||t,priority:a?.priority??100,...a}}function Ht(t,n,a){return{name:a?.name||`custom-${t}`,factory:n,displayName:a?.displayName||`${t} widget`,priority:a?.priority??75,matcher:r=>r.definition.format===t,...a}}function Wt(t,n,a,r){return{name:r?.name||`custom-${t}-${n}`,factory:a,displayName:r?.displayName||`${t}:${n} widget`,priority:r?.priority??80,matcher:o=>{const s=o.definition;return s.type===t&&s.format===n},...r}}exports.Base64Input=bt;exports.Base64sInput=st;exports.Card=xt;exports.ColorSwatchInput=wt;exports.EditableText=Mt;exports.NullableDateInput=$t;exports.NullableDateTimeInput=Ct;exports.NullableEmailInput=_t;exports.NullablePasswordInput=At;exports.NullableRatingInput=Rt;exports.NullableSliderInput=Dt;exports.NullableTextArea=kt;exports.NullableTextInput=Tt;exports.NullableUUIDInput=vt;exports.NullableUrlInput=Bt;exports.RatingInput=lt;exports.SliderInput=Et;exports.Switch=Ft;exports.WidgetRegistry=it;exports.emptyToNull=W;exports.fileToBase64=at;exports.forFormat=Ht;exports.forTypeAndFormat=Wt;exports.forXUI=Ut;exports.formatColor=N;exports.getContrastRatio=gt;exports.getXUIConfig=ct;exports.globalWidgetRegistry=Lt;exports.hexToRgb=R;exports.hslToRgb=j;exports.hwbToRgb=tt;exports.isValidColor=mt;exports.isValidHexColor=P;exports.isValidHslColor=K;exports.isValidRgbColor=z;exports.isValidRgbaColor=Y;exports.linearToSrgb=B;exports.mulberry32=J;exports.normalizeHexColor=Q;exports.nullToEmpty=ot;exports.oklchToRgb=nt;exports.parseAnyColor=Z;exports.resolveEffectiveFormat=S;exports.resolveWidget=ut;exports.rgbToHex=O;exports.rgbToHsl=L;exports.rgbToHwb=et;exports.rgbToOklch=rt;exports.srgbToLinear=D;exports.toRgbaString=G;