var t,e,n=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)},r=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n};class a{constructor(n,r,a){t.set(this,void 0),e.set(this,void 0),this.id=n,this.name=r,this.type=a.type,this.blob=a}async hash(a="SHA-256",s="hex"){if(!n(this,t)||n(this,e)!==a){const n=await new Response(this.blob).arrayBuffer(),s=await crypto.subtle.digest(a,n);r(this,e,a),r(this,t,Array.from(new Uint8Array(s)))}switch(s){default:case"array":return n(this,t);case"hex":return n(this,t).map(t=>t.toString(16).padStart(2,"0")).join("")}}}t=new WeakMap,e=new WeakMap;const s=(t,e="#fff",n="#fff")=>{const r=c(t),a=c(e),s=c(n);if(!r||!a||!s)return null;const i=s,o=h(r,r);return{c300:f(u(r,i,.7)),c400:f(u(r,i,.85)),c500:f(r),c600:f(u(r,o,.87)),c700:f(u(r,o,.7)),con1:f(Object.assign(Object.assign({},a),{a:.87})),con2:f(Object.assign(Object.assign({},a),{a:.6})),con3:f(Object.assign(Object.assign({},a),{a:.38})),con4:f(Object.assign(Object.assign({},a),{a:.1}))}},c=t=>t.startsWith("#")?i(t):o(t),i=t=>{const e=t.replace(/^#([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,(t,e,n,r,a)=>{const s=null!=a?a:"f";return"#"+e+e+n+n+r+r+s+s});var n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(e);if(!n)return null;const r=parseInt(n[4],16);return{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16),a:isNaN(r)?1:r/255}},o=t=>{const e=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d\.]+))?\)$/);return e?{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10),a:parseFloat(e[4])}:null},f=t=>{const e=t=>Math.round(t).toString(16).padStart(2,"0");return`#${`${e(t.r)}${e(t.g)}${e(t.b)}`}${1==t.a?"":e(255*t.a)}`},u=(t,e,n=.5)=>{const r=2*n-1,a=t.a-e.a,s=((r*a==-1?r:(r+a)/(1+r*a))+1)/2,c=1-s;return{r:s*t.r+c*e.r,g:s*t.g+c*e.g,b:s*t.b+c*e.b,a:t.a*n+e.a*(1-n)}},h=(t,e)=>({r:t.r*e.r/255,g:t.g*e.g/255,b:t.b*e.b/255,a:1}),p=(t,e)=>(t%e+e)%e,d=(t,e)=>{const n=document.createElement("bce-ripple"),r=t.getBoundingClientRect();n.x=e.clientX-r.left,n.y=e.clientY-r.top,t.appendChild(n),setTimeout(()=>n.parentElement.removeChild(n),500)};export{a as B,s as c,p as m,d as r};