@liftkit-vue/core 0.1.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.
Files changed (43) hide show
  1. package/README.md +181 -0
  2. package/dist/core.css +1 -0
  3. package/dist/index.cjs +273 -0
  4. package/dist/index.mjs +5592 -0
  5. package/package.json +58 -0
  6. package/src/css/align-items.css +21 -0
  7. package/src/css/align-self.css +24 -0
  8. package/src/css/aspect-ratios.css +35 -0
  9. package/src/css/background-colors.css +951 -0
  10. package/src/css/border-color.css +241 -0
  11. package/src/css/border-radius.css +49 -0
  12. package/src/css/border-style.css +20 -0
  13. package/src/css/border-width.css +41 -0
  14. package/src/css/borders.css +33 -0
  15. package/src/css/breaks.css +5 -0
  16. package/src/css/column-span.css +47 -0
  17. package/src/css/cursor.css +3 -0
  18. package/src/css/display.css +21 -0
  19. package/src/css/flexboxes.css +128 -0
  20. package/src/css/gaps.css +42 -0
  21. package/src/css/height.css +27 -0
  22. package/src/css/index.css +36 -0
  23. package/src/css/justify-content.css +23 -0
  24. package/src/css/justify-items.css +20 -0
  25. package/src/css/liftkit-core.css +465 -0
  26. package/src/css/liftkitvars.css +378 -0
  27. package/src/css/lk-components.css +498 -0
  28. package/src/css/margins.css +947 -0
  29. package/src/css/opacity.css +87 -0
  30. package/src/css/overflow.css +27 -0
  31. package/src/css/padding.css +1041 -0
  32. package/src/css/pointer-events.css +3 -0
  33. package/src/css/position.css +21 -0
  34. package/src/css/scale.css +23 -0
  35. package/src/css/scrim.css +10 -0
  36. package/src/css/shadows.css +31 -0
  37. package/src/css/text-alignment.css +19 -0
  38. package/src/css/text-color.css +721 -0
  39. package/src/css/text-columns.css +4 -0
  40. package/src/css/typography.css +493 -0
  41. package/src/css/whitespace.css +3 -0
  42. package/src/css/width.css +7 -0
  43. package/src/css/z-index.css +25 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,273 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue");/**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */function ne(t){return t<0?-1:t===0?0:1}function Se(t,e,n){return(1-n)*t+n*e}function Wt(t,e,n){return n<t?t:n>e?e:n}function We(t,e,n){return n<t?t:n>e?e:n}function lt(t){return t=t%360,t<0&&(t=t+360),t}function Gt(t,e){return lt(e-t)<=180?1:-1}function Yt(t,e){return 180-Math.abs(Math.abs(t-e)-180)}function rt(t,e){const n=t[0]*e[0][0]+t[1]*e[0][1]+t[2]*e[0][2],a=t[0]*e[1][0]+t[1]*e[1][1]+t[2]*e[1][2],o=t[0]*e[2][0]+t[1]*e[2][1]+t[2]*e[2][2];return[n,a,o]}/**
17
+ * @license
18
+ * Copyright 2021 Google LLC
19
+ *
20
+ * Licensed under the Apache License, Version 2.0 (the "License");
21
+ * you may not use this file except in compliance with the License.
22
+ * You may obtain a copy of the License at
23
+ *
24
+ * http://www.apache.org/licenses/LICENSE-2.0
25
+ *
26
+ * Unless required by applicable law or agreed to in writing, software
27
+ * distributed under the License is distributed on an "AS IS" BASIS,
28
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
+ * See the License for the specific language governing permissions and
30
+ * limitations under the License.
31
+ */const Jt=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],Kt=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],Xt=[95.047,100,108.883];function ut(t,e,n){return(255<<24|(t&255)<<16|(e&255)<<8|n&255)>>>0}function Pt(t){const e=Ie(t[0]),n=Ie(t[1]),a=Ie(t[2]);return ut(e,n,a)}function xt(t){return t>>16&255}function _t(t){return t>>8&255}function Et(t){return t&255}function Zt(t,e,n){const a=Kt,o=a[0][0]*t+a[0][1]*e+a[0][2]*n,s=a[1][0]*t+a[1][1]*e+a[1][2]*n,i=a[2][0]*t+a[2][1]*e+a[2][2]*n,c=Ie(o),l=Ie(s),d=Ie(i);return ut(c,l,d)}function Qt(t){const e=Ee(xt(t)),n=Ee(_t(t)),a=Ee(Et(t));return rt([e,n,a],Jt)}function en(t){const e=ye(t),n=Ie(e);return ut(n,n,n)}function at(t){const e=Qt(t)[1];return 116*Tt(e/100)-16}function ye(t){return 100*nn((t+16)/116)}function ot(t){return Tt(t/100)*116-16}function Ee(t){const e=t/255;return e<=.040449936?e/12.92*100:Math.pow((e+.055)/1.055,2.4)*100}function Ie(t){const e=t/100;let n=0;return e<=.0031308?n=e*12.92:n=1.055*Math.pow(e,1/2.4)-.055,Wt(0,255,Math.round(n*255))}function tn(){return Xt}function Tt(t){const e=.008856451679035631,n=24389/27;return t>e?Math.pow(t,1/3):(n*t+16)/116}function nn(t){const e=.008856451679035631,n=24389/27,a=t*t*t;return a>e?a:(116*t-16)/n}/**
32
+ * @license
33
+ * Copyright 2021 Google LLC
34
+ *
35
+ * Licensed under the Apache License, Version 2.0 (the "License");
36
+ * you may not use this file except in compliance with the License.
37
+ * You may obtain a copy of the License at
38
+ *
39
+ * http://www.apache.org/licenses/LICENSE-2.0
40
+ *
41
+ * Unless required by applicable law or agreed to in writing, software
42
+ * distributed under the License is distributed on an "AS IS" BASIS,
43
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44
+ * See the License for the specific language governing permissions and
45
+ * limitations under the License.
46
+ */class de{static make(e=tn(),n=200/Math.PI*ye(50)/100,a=50,o=2,s=!1){const i=e,c=i[0]*.401288+i[1]*.650173+i[2]*-.051461,l=i[0]*-.250268+i[1]*1.204414+i[2]*.045854,d=i[0]*-.002079+i[1]*.048952+i[2]*.953127,u=.8+o/10,h=u>=.9?Se(.59,.69,(u-.9)*10):Se(.525,.59,(u-.8)*10);let w=s?1:u*(1-1/3.6*Math.exp((-n-42)/92));w=w>1?1:w<0?0:w;const k=u,g=[w*(100/c)+1-w,w*(100/l)+1-w,w*(100/d)+1-w],p=1/(5*n+1),b=p*p*p*p,m=1-b,v=b*n+.1*m*m*Math.cbrt(5*n),P=ye(a)/e[1],f=1.48+Math.sqrt(P),x=.725/Math.pow(P,.2),L=x,M=[Math.pow(v*g[0]*c/100,.42),Math.pow(v*g[1]*l/100,.42),Math.pow(v*g[2]*d/100,.42)],B=[400*M[0]/(M[0]+27.13),400*M[1]/(M[1]+27.13),400*M[2]/(M[2]+27.13)],T=(2*B[0]+B[1]+.05*B[2])*x;return new de(P,T,x,L,h,k,g,v,Math.pow(v,.25),f)}constructor(e,n,a,o,s,i,c,l,d,u){this.n=e,this.aw=n,this.nbb=a,this.ncb=o,this.c=s,this.nc=i,this.rgbD=c,this.fl=l,this.fLRoot=d,this.z=u}}de.DEFAULT=de.make();/**
47
+ * @license
48
+ * Copyright 2021 Google LLC
49
+ *
50
+ * Licensed under the Apache License, Version 2.0 (the "License");
51
+ * you may not use this file except in compliance with the License.
52
+ * You may obtain a copy of the License at
53
+ *
54
+ * http://www.apache.org/licenses/LICENSE-2.0
55
+ *
56
+ * Unless required by applicable law or agreed to in writing, software
57
+ * distributed under the License is distributed on an "AS IS" BASIS,
58
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
59
+ * See the License for the specific language governing permissions and
60
+ * limitations under the License.
61
+ */class J{constructor(e,n,a,o,s,i,c,l,d){this.hue=e,this.chroma=n,this.j=a,this.q=o,this.m=s,this.s=i,this.jstar=c,this.astar=l,this.bstar=d}distance(e){const n=this.jstar-e.jstar,a=this.astar-e.astar,o=this.bstar-e.bstar,s=Math.sqrt(n*n+a*a+o*o);return 1.41*Math.pow(s,.63)}static fromInt(e){return J.fromIntInViewingConditions(e,de.DEFAULT)}static fromIntInViewingConditions(e,n){const a=(e&16711680)>>16,o=(e&65280)>>8,s=e&255,i=Ee(a),c=Ee(o),l=Ee(s),d=.41233895*i+.35762064*c+.18051042*l,u=.2126*i+.7152*c+.0722*l,h=.01932141*i+.11916382*c+.95034478*l,w=.401288*d+.650173*u-.051461*h,k=-.250268*d+1.204414*u+.045854*h,g=-.002079*d+.048952*u+.953127*h,p=n.rgbD[0]*w,b=n.rgbD[1]*k,m=n.rgbD[2]*g,v=Math.pow(n.fl*Math.abs(p)/100,.42),P=Math.pow(n.fl*Math.abs(b)/100,.42),f=Math.pow(n.fl*Math.abs(m)/100,.42),x=ne(p)*400*v/(v+27.13),L=ne(b)*400*P/(P+27.13),M=ne(m)*400*f/(f+27.13),B=(11*x+-12*L+M)/11,T=(x+L-2*M)/9,$=(20*x+20*L+21*M)/20,N=(40*x+20*L+M)/20,H=Math.atan2(T,B)*180/Math.PI,R=H<0?H+360:H>=360?H-360:H,ie=R*Math.PI/180,se=N*n.nbb,ce=100*Math.pow(se/n.aw,n.c*n.z),ke=4/n.c*Math.sqrt(ce/100)*(n.aw+4)*n.fLRoot,be=R<20.14?R+360:R,Me=.25*(Math.cos(be*Math.PI/180+2)+3.8),xe=5e4/13*Me*n.nc*n.ncb*Math.sqrt(B*B+T*T)/($+.305),Be=Math.pow(xe,.9)*Math.pow(1.64-Math.pow(.29,n.n),.73),Re=Be*Math.sqrt(ce/100),ze=Re*n.fLRoot,je=50*Math.sqrt(Be*n.c/(n.aw+4)),et=(1+100*.007)*ce/(1+.007*ce),He=1/.0228*Math.log(1+.0228*ze),qt=He*Math.cos(ie),Ut=He*Math.sin(ie);return new J(R,Re,ce,ke,ze,je,et,qt,Ut)}static fromJch(e,n,a){return J.fromJchInViewingConditions(e,n,a,de.DEFAULT)}static fromJchInViewingConditions(e,n,a,o){const s=4/o.c*Math.sqrt(e/100)*(o.aw+4)*o.fLRoot,i=n*o.fLRoot,c=n/Math.sqrt(e/100),l=50*Math.sqrt(c*o.c/(o.aw+4)),d=a*Math.PI/180,u=(1+100*.007)*e/(1+.007*e),h=1/.0228*Math.log(1+.0228*i),w=h*Math.cos(d),k=h*Math.sin(d);return new J(a,n,e,s,i,l,u,w,k)}static fromUcs(e,n,a){return J.fromUcsInViewingConditions(e,n,a,de.DEFAULT)}static fromUcsInViewingConditions(e,n,a,o){const s=n,i=a,c=Math.sqrt(s*s+i*i),d=(Math.exp(c*.0228)-1)/.0228/o.fLRoot;let u=Math.atan2(i,s)*(180/Math.PI);u<0&&(u+=360);const h=e/(1-(e-100)*.007);return J.fromJchInViewingConditions(h,d,u,o)}toInt(){return this.viewed(de.DEFAULT)}viewed(e){const n=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),a=Math.pow(n/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),o=this.hue*Math.PI/180,s=.25*(Math.cos(o+2)+3.8),i=e.aw*Math.pow(this.j/100,1/e.c/e.z),c=s*(5e4/13)*e.nc*e.ncb,l=i/e.nbb,d=Math.sin(o),u=Math.cos(o),h=23*(l+.305)*a/(23*c+11*a*u+108*a*d),w=h*u,k=h*d,g=(460*l+451*w+288*k)/1403,p=(460*l-891*w-261*k)/1403,b=(460*l-220*w-6300*k)/1403,m=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),v=ne(g)*(100/e.fl)*Math.pow(m,1/.42),P=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),f=ne(p)*(100/e.fl)*Math.pow(P,1/.42),x=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),L=ne(b)*(100/e.fl)*Math.pow(x,1/.42),M=v/e.rgbD[0],B=f/e.rgbD[1],T=L/e.rgbD[2],$=1.86206786*M-1.01125463*B+.14918677*T,N=.38752654*M+.62144744*B-.00897398*T,A=-.0158415*M-.03412294*B+1.04996444*T;return Zt($,N,A)}static fromXyzInViewingConditions(e,n,a,o){const s=.401288*e+.650173*n-.051461*a,i=-.250268*e+1.204414*n+.045854*a,c=-.002079*e+.048952*n+.953127*a,l=o.rgbD[0]*s,d=o.rgbD[1]*i,u=o.rgbD[2]*c,h=Math.pow(o.fl*Math.abs(l)/100,.42),w=Math.pow(o.fl*Math.abs(d)/100,.42),k=Math.pow(o.fl*Math.abs(u)/100,.42),g=ne(l)*400*h/(h+27.13),p=ne(d)*400*w/(w+27.13),b=ne(u)*400*k/(k+27.13),m=(11*g+-12*p+b)/11,v=(g+p-2*b)/9,P=(20*g+20*p+21*b)/20,f=(40*g+20*p+b)/20,L=Math.atan2(v,m)*180/Math.PI,M=L<0?L+360:L>=360?L-360:L,B=M*Math.PI/180,T=f*o.nbb,$=100*Math.pow(T/o.aw,o.c*o.z),N=4/o.c*Math.sqrt($/100)*(o.aw+4)*o.fLRoot,A=M<20.14?M+360:M,H=1/4*(Math.cos(A*Math.PI/180+2)+3.8),ie=5e4/13*H*o.nc*o.ncb*Math.sqrt(m*m+v*v)/(P+.305),se=Math.pow(ie,.9)*Math.pow(1.64-Math.pow(.29,o.n),.73),ce=se*Math.sqrt($/100),ke=ce*o.fLRoot,be=50*Math.sqrt(se*o.c/(o.aw+4)),Me=(1+100*.007)*$/(1+.007*$),Ce=Math.log(1+.0228*ke)/.0228,xe=Ce*Math.cos(B),Be=Ce*Math.sin(B);return new J(M,ce,$,N,ke,be,Me,xe,Be)}xyzInViewingConditions(e){const n=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),a=Math.pow(n/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),o=this.hue*Math.PI/180,s=.25*(Math.cos(o+2)+3.8),i=e.aw*Math.pow(this.j/100,1/e.c/e.z),c=s*(5e4/13)*e.nc*e.ncb,l=i/e.nbb,d=Math.sin(o),u=Math.cos(o),h=23*(l+.305)*a/(23*c+11*a*u+108*a*d),w=h*u,k=h*d,g=(460*l+451*w+288*k)/1403,p=(460*l-891*w-261*k)/1403,b=(460*l-220*w-6300*k)/1403,m=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),v=ne(g)*(100/e.fl)*Math.pow(m,1/.42),P=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),f=ne(p)*(100/e.fl)*Math.pow(P,1/.42),x=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),L=ne(b)*(100/e.fl)*Math.pow(x,1/.42),M=v/e.rgbD[0],B=f/e.rgbD[1],T=L/e.rgbD[2],$=1.86206786*M-1.01125463*B+.14918677*T,N=.38752654*M+.62144744*B-.00897398*T,A=-.0158415*M-.03412294*B+1.04996444*T;return[$,N,A]}}/**
62
+ * @license
63
+ * Copyright 2021 Google LLC
64
+ *
65
+ * Licensed under the Apache License, Version 2.0 (the "License");
66
+ * you may not use this file except in compliance with the License.
67
+ * You may obtain a copy of the License at
68
+ *
69
+ * http://www.apache.org/licenses/LICENSE-2.0
70
+ *
71
+ * Unless required by applicable law or agreed to in writing, software
72
+ * distributed under the License is distributed on an "AS IS" BASIS,
73
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
74
+ * See the License for the specific language governing permissions and
75
+ * limitations under the License.
76
+ */class _{static sanitizeRadians(e){return(e+Math.PI*8)%(Math.PI*2)}static trueDelinearized(e){const n=e/100;let a=0;return n<=.0031308?a=n*12.92:a=1.055*Math.pow(n,1/2.4)-.055,a*255}static chromaticAdaptation(e){const n=Math.pow(Math.abs(e),.42);return ne(e)*400*n/(n+27.13)}static hueOf(e){const n=rt(e,_.SCALED_DISCOUNT_FROM_LINRGB),a=_.chromaticAdaptation(n[0]),o=_.chromaticAdaptation(n[1]),s=_.chromaticAdaptation(n[2]),i=(11*a+-12*o+s)/11,c=(a+o-2*s)/9;return Math.atan2(c,i)}static areInCyclicOrder(e,n,a){const o=_.sanitizeRadians(n-e),s=_.sanitizeRadians(a-e);return o<s}static intercept(e,n,a){return(n-e)/(a-e)}static lerpPoint(e,n,a){return[e[0]+(a[0]-e[0])*n,e[1]+(a[1]-e[1])*n,e[2]+(a[2]-e[2])*n]}static setCoordinate(e,n,a,o){const s=_.intercept(e[o],n,a[o]);return _.lerpPoint(e,s,a)}static isBounded(e){return 0<=e&&e<=100}static nthVertex(e,n){const a=_.Y_FROM_LINRGB[0],o=_.Y_FROM_LINRGB[1],s=_.Y_FROM_LINRGB[2],i=n%4<=1?0:100,c=n%2===0?0:100;if(n<4){const l=i,d=c,u=(e-l*o-d*s)/a;return _.isBounded(u)?[u,l,d]:[-1,-1,-1]}else if(n<8){const l=i,d=c,u=(e-d*a-l*s)/o;return _.isBounded(u)?[d,u,l]:[-1,-1,-1]}else{const l=i,d=c,u=(e-l*a-d*o)/s;return _.isBounded(u)?[l,d,u]:[-1,-1,-1]}}static bisectToSegment(e,n){let a=[-1,-1,-1],o=a,s=0,i=0,c=!1,l=!0;for(let d=0;d<12;d++){const u=_.nthVertex(e,d);if(u[0]<0)continue;const h=_.hueOf(u);if(!c){a=u,o=u,s=h,i=h,c=!0;continue}(l||_.areInCyclicOrder(s,h,i))&&(l=!1,_.areInCyclicOrder(s,n,h)?(o=u,i=h):(a=u,s=h))}return[a,o]}static midpoint(e,n){return[(e[0]+n[0])/2,(e[1]+n[1])/2,(e[2]+n[2])/2]}static criticalPlaneBelow(e){return Math.floor(e-.5)}static criticalPlaneAbove(e){return Math.ceil(e-.5)}static bisectToLimit(e,n){const a=_.bisectToSegment(e,n);let o=a[0],s=_.hueOf(o),i=a[1];for(let c=0;c<3;c++)if(o[c]!==i[c]){let l=-1,d=255;o[c]<i[c]?(l=_.criticalPlaneBelow(_.trueDelinearized(o[c])),d=_.criticalPlaneAbove(_.trueDelinearized(i[c]))):(l=_.criticalPlaneAbove(_.trueDelinearized(o[c])),d=_.criticalPlaneBelow(_.trueDelinearized(i[c])));for(let u=0;u<8&&!(Math.abs(d-l)<=1);u++){const h=Math.floor((l+d)/2),w=_.CRITICAL_PLANES[h],k=_.setCoordinate(o,w,i,c),g=_.hueOf(k);_.areInCyclicOrder(s,n,g)?(i=k,d=h):(o=k,s=g,l=h)}}return _.midpoint(o,i)}static inverseChromaticAdaptation(e){const n=Math.abs(e),a=Math.max(0,27.13*n/(400-n));return ne(e)*Math.pow(a,1/.42)}static findResultByJ(e,n,a){let o=Math.sqrt(a)*11;const s=de.DEFAULT,i=1/Math.pow(1.64-Math.pow(.29,s.n),.73),l=.25*(Math.cos(e+2)+3.8)*(5e4/13)*s.nc*s.ncb,d=Math.sin(e),u=Math.cos(e);for(let h=0;h<5;h++){const w=o/100,k=n===0||o===0?0:n/Math.sqrt(w),g=Math.pow(k*i,1/.9),b=s.aw*Math.pow(w,1/s.c/s.z)/s.nbb,m=23*(b+.305)*g/(23*l+11*g*u+108*g*d),v=m*u,P=m*d,f=(460*b+451*v+288*P)/1403,x=(460*b-891*v-261*P)/1403,L=(460*b-220*v-6300*P)/1403,M=_.inverseChromaticAdaptation(f),B=_.inverseChromaticAdaptation(x),T=_.inverseChromaticAdaptation(L),$=rt([M,B,T],_.LINRGB_FROM_SCALED_DISCOUNT);if($[0]<0||$[1]<0||$[2]<0)return 0;const N=_.Y_FROM_LINRGB[0],A=_.Y_FROM_LINRGB[1],H=_.Y_FROM_LINRGB[2],R=N*$[0]+A*$[1]+H*$[2];if(R<=0)return 0;if(h===4||Math.abs(R-a)<.002)return $[0]>100.01||$[1]>100.01||$[2]>100.01?0:Pt($);o=o-(R-a)*o/(2*R)}return 0}static solveToInt(e,n,a){if(n<1e-4||a<1e-4||a>99.9999)return en(a);e=lt(e);const o=e/180*Math.PI,s=ye(a),i=_.findResultByJ(o,n,s);if(i!==0)return i;const c=_.bisectToLimit(s,o);return Pt(c)}static solveToCam(e,n,a){return J.fromInt(_.solveToInt(e,n,a))}}_.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]];_.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]];_.Y_FROM_LINRGB=[.2126,.7152,.0722];_.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776];/**
77
+ * @license
78
+ * Copyright 2021 Google LLC
79
+ *
80
+ * Licensed under the Apache License, Version 2.0 (the "License");
81
+ * you may not use this file except in compliance with the License.
82
+ * You may obtain a copy of the License at
83
+ *
84
+ * http://www.apache.org/licenses/LICENSE-2.0
85
+ *
86
+ * Unless required by applicable law or agreed to in writing, software
87
+ * distributed under the License is distributed on an "AS IS" BASIS,
88
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
89
+ * See the License for the specific language governing permissions and
90
+ * limitations under the License.
91
+ */class q{static from(e,n,a){return new q(_.solveToInt(e,n,a))}static fromInt(e){return new q(e)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(e){this.setInternalState(_.solveToInt(e,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(e){this.setInternalState(_.solveToInt(this.internalHue,e,this.internalTone))}get tone(){return this.internalTone}set tone(e){this.setInternalState(_.solveToInt(this.internalHue,this.internalChroma,e))}constructor(e){this.argb=e;const n=J.fromInt(e);this.internalHue=n.hue,this.internalChroma=n.chroma,this.internalTone=at(e),this.argb=e}setInternalState(e){const n=J.fromInt(e);this.internalHue=n.hue,this.internalChroma=n.chroma,this.internalTone=at(e),this.argb=e}inViewingConditions(e){const a=J.fromInt(this.toInt()).xyzInViewingConditions(e),o=J.fromXyzInViewingConditions(a[0],a[1],a[2],de.make());return q.from(o.hue,o.chroma,ot(a[1]))}}/**
92
+ * @license
93
+ * Copyright 2021 Google LLC
94
+ *
95
+ * Licensed under the Apache License, Version 2.0 (the "License");
96
+ * you may not use this file except in compliance with the License.
97
+ * You may obtain a copy of the License at
98
+ *
99
+ * http://www.apache.org/licenses/LICENSE-2.0
100
+ *
101
+ * Unless required by applicable law or agreed to in writing, software
102
+ * distributed under the License is distributed on an "AS IS" BASIS,
103
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
104
+ * See the License for the specific language governing permissions and
105
+ * limitations under the License.
106
+ */class dt{static harmonize(e,n){const a=q.fromInt(e),o=q.fromInt(n),s=Yt(a.hue,o.hue),i=Math.min(s*.5,15),c=lt(a.hue+i*Gt(a.hue,o.hue));return q.from(c,a.chroma,a.tone).toInt()}static hctHue(e,n,a){const o=dt.cam16Ucs(e,n,a),s=J.fromInt(o),i=J.fromInt(e);return q.from(s.hue,i.chroma,at(e)).toInt()}static cam16Ucs(e,n,a){const o=J.fromInt(e),s=J.fromInt(n),i=o.jstar,c=o.astar,l=o.bstar,d=s.jstar,u=s.astar,h=s.bstar,w=i+(d-i)*a,k=c+(u-c)*a,g=l+(h-l)*a;return J.fromUcs(w,k,g).toInt()}}/**
107
+ * @license
108
+ * Copyright 2022 Google LLC
109
+ *
110
+ * Licensed under the Apache License, Version 2.0 (the "License");
111
+ * you may not use this file except in compliance with the License.
112
+ * You may obtain a copy of the License at
113
+ *
114
+ * http://www.apache.org/licenses/LICENSE-2.0
115
+ *
116
+ * Unless required by applicable law or agreed to in writing, software
117
+ * distributed under the License is distributed on an "AS IS" BASIS,
118
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
119
+ * See the License for the specific language governing permissions and
120
+ * limitations under the License.
121
+ */class G{static ratioOfTones(e,n){return e=We(0,100,e),n=We(0,100,n),G.ratioOfYs(ye(e),ye(n))}static ratioOfYs(e,n){const a=e>n?e:n,o=a===n?e:n;return(a+5)/(o+5)}static lighter(e,n){if(e<0||e>100)return-1;const a=ye(e),o=n*(a+5)-5,s=G.ratioOfYs(o,a),i=Math.abs(s-n);if(s<n&&i>.04)return-1;const c=ot(o)+.4;return c<0||c>100?-1:c}static darker(e,n){if(e<0||e>100)return-1;const a=ye(e),o=(a+5)/n-5,s=G.ratioOfYs(a,o),i=Math.abs(s-n);if(s<n&&i>.04)return-1;const c=ot(o)-.4;return c<0||c>100?-1:c}static lighterUnsafe(e,n){const a=G.lighter(e,n);return a<0?100:a}static darkerUnsafe(e,n){const a=G.darker(e,n);return a<0?0:a}}/**
122
+ * @license
123
+ * Copyright 2023 Google LLC
124
+ *
125
+ * Licensed under the Apache License, Version 2.0 (the "License");
126
+ * you may not use this file except in compliance with the License.
127
+ * You may obtain a copy of the License at
128
+ *
129
+ * http://www.apache.org/licenses/LICENSE-2.0
130
+ *
131
+ * Unless required by applicable law or agreed to in writing, software
132
+ * distributed under the License is distributed on an "AS IS" BASIS,
133
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
134
+ * See the License for the specific language governing permissions and
135
+ * limitations under the License.
136
+ */class mt{static isDisliked(e){const n=Math.round(e.hue)>=90&&Math.round(e.hue)<=111,a=Math.round(e.chroma)>16,o=Math.round(e.tone)<65;return n&&a&&o}static fixIfDisliked(e){return mt.isDisliked(e)?q.from(e.hue,e.chroma,70):e}}/**
137
+ * @license
138
+ * Copyright 2022 Google LLC
139
+ *
140
+ * Licensed under the Apache License, Version 2.0 (the "License");
141
+ * you may not use this file except in compliance with the License.
142
+ * You may obtain a copy of the License at
143
+ *
144
+ * http://www.apache.org/licenses/LICENSE-2.0
145
+ *
146
+ * Unless required by applicable law or agreed to in writing, software
147
+ * distributed under the License is distributed on an "AS IS" BASIS,
148
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149
+ * See the License for the specific language governing permissions and
150
+ * limitations under the License.
151
+ */class I{static fromPalette(e){return new I(e.name??"",e.palette,e.tone,e.isBackground??!1,e.background,e.secondBackground,e.contrastCurve,e.toneDeltaPair)}constructor(e,n,a,o,s,i,c,l){if(this.name=e,this.palette=n,this.tone=a,this.isBackground=o,this.background=s,this.secondBackground=i,this.contrastCurve=c,this.toneDeltaPair=l,this.hctCache=new Map,!s&&i)throw new Error(`Color ${e} has secondBackgrounddefined, but background is not defined.`);if(!s&&c)throw new Error(`Color ${e} has contrastCurvedefined, but background is not defined.`);if(s&&!c)throw new Error(`Color ${e} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(e){return this.getHct(e).toInt()}getHct(e){const n=this.hctCache.get(e);if(n!=null)return n;const a=this.getTone(e),o=this.palette(e).getHct(a);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(e,o),o}getTone(e){const n=e.contrastLevel<0;if(this.toneDeltaPair){const a=this.toneDeltaPair(e),o=a.roleA,s=a.roleB,i=a.delta,c=a.polarity,l=a.stayTogether,u=this.background(e).getTone(e),h=c==="nearer"||c==="lighter"&&!e.isDark||c==="darker"&&e.isDark,w=h?o:s,k=h?s:o,g=this.name===w.name,p=e.isDark?1:-1,b=w.contrastCurve.get(e.contrastLevel),m=k.contrastCurve.get(e.contrastLevel),v=w.tone(e);let P=G.ratioOfTones(u,v)>=b?v:I.foregroundTone(u,b);const f=k.tone(e);let x=G.ratioOfTones(u,f)>=m?f:I.foregroundTone(u,m);return n&&(P=I.foregroundTone(u,b),x=I.foregroundTone(u,m)),(x-P)*p>=i||(x=We(0,100,P+i*p),(x-P)*p>=i||(P=We(0,100,x-i*p))),50<=P&&P<60?p>0?(P=60,x=Math.max(x,P+i*p)):(P=49,x=Math.min(x,P+i*p)):50<=x&&x<60&&(l?p>0?(P=60,x=Math.max(x,P+i*p)):(P=49,x=Math.min(x,P+i*p)):p>0?x=60:x=49),g?P:x}else{let a=this.tone(e);if(this.background==null)return a;const o=this.background(e).getTone(e),s=this.contrastCurve.get(e.contrastLevel);if(G.ratioOfTones(o,a)>=s||(a=I.foregroundTone(o,s)),n&&(a=I.foregroundTone(o,s)),this.isBackground&&50<=a&&a<60&&(G.ratioOfTones(49,o)>=s?a=49:a=60),this.secondBackground){const[i,c]=[this.background,this.secondBackground],[l,d]=[i(e).getTone(e),c(e).getTone(e)],[u,h]=[Math.max(l,d),Math.min(l,d)];if(G.ratioOfTones(u,a)>=s&&G.ratioOfTones(h,a)>=s)return a;const w=G.lighter(u,s),k=G.darker(h,s),g=[];return w!==-1&&g.push(w),k!==-1&&g.push(k),I.tonePrefersLightForeground(l)||I.tonePrefersLightForeground(d)?w<0?100:w:g.length===1?g[0]:k<0?0:k}return a}}static foregroundTone(e,n){const a=G.lighterUnsafe(e,n),o=G.darkerUnsafe(e,n),s=G.ratioOfTones(a,e),i=G.ratioOfTones(o,e);if(I.tonePrefersLightForeground(e)){const l=Math.abs(s-i)<.1&&s<n&&i<n;return s>=n||s>=i||l?a:o}else return i>=n||i>=s?o:a}static tonePrefersLightForeground(e){return Math.round(e)<60}static toneAllowsLightForeground(e){return Math.round(e)<=49}static enableLightForeground(e){return I.tonePrefersLightForeground(e)&&!I.toneAllowsLightForeground(e)?49:e}}/**
152
+ * @license
153
+ * Copyright 2021 Google LLC
154
+ *
155
+ * Licensed under the Apache License, Version 2.0 (the "License");
156
+ * you may not use this file except in compliance with the License.
157
+ * You may obtain a copy of the License at
158
+ *
159
+ * http://www.apache.org/licenses/LICENSE-2.0
160
+ *
161
+ * Unless required by applicable law or agreed to in writing, software
162
+ * distributed under the License is distributed on an "AS IS" BASIS,
163
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
164
+ * See the License for the specific language governing permissions and
165
+ * limitations under the License.
166
+ */class Z{static fromInt(e){const n=q.fromInt(e);return Z.fromHct(n)}static fromHct(e){return new Z(e.hue,e.chroma,e)}static fromHueAndChroma(e,n){const a=new rn(e,n).create();return new Z(e,n,a)}constructor(e,n,a){this.hue=e,this.chroma=n,this.keyColor=a,this.cache=new Map}tone(e){let n=this.cache.get(e);return n===void 0&&(n=q.from(this.hue,this.chroma,e).toInt(),this.cache.set(e,n)),n}getHct(e){return q.fromInt(this.tone(e))}}class rn{constructor(e,n){this.hue=e,this.requestedChroma=n,this.chromaCache=new Map,this.maxChromaValue=200}create(){let o=0,s=100;for(;o<s;){const i=Math.floor((o+s)/2),c=this.maxChroma(i)<this.maxChroma(i+1);if(this.maxChroma(i)>=this.requestedChroma-.01)if(Math.abs(o-50)<Math.abs(s-50))s=i;else{if(o===i)return q.from(this.hue,this.requestedChroma,o);o=i}else c?o=i+1:s=i}return q.from(this.hue,this.requestedChroma,o)}maxChroma(e){if(this.chromaCache.has(e))return this.chromaCache.get(e);const n=q.from(this.hue,this.maxChromaValue,e).chroma;return this.chromaCache.set(e,n),n}}/**
167
+ * @license
168
+ * Copyright 2023 Google LLC
169
+ *
170
+ * Licensed under the Apache License, Version 2.0 (the "License");
171
+ * you may not use this file except in compliance with the License.
172
+ * You may obtain a copy of the License at
173
+ *
174
+ * http://www.apache.org/licenses/LICENSE-2.0
175
+ *
176
+ * Unless required by applicable law or agreed to in writing, software
177
+ * distributed under the License is distributed on an "AS IS" BASIS,
178
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
179
+ * See the License for the specific language governing permissions and
180
+ * limitations under the License.
181
+ */class V{constructor(e,n,a,o){this.low=e,this.normal=n,this.medium=a,this.high=o}get(e){return e<=-1?this.low:e<0?Se(this.low,this.normal,(e- -1)/1):e<.5?Se(this.normal,this.medium,(e-0)/.5):e<1?Se(this.medium,this.high,(e-.5)/.5):this.high}}/**
182
+ * @license
183
+ * Copyright 2023 Google LLC
184
+ *
185
+ * Licensed under the Apache License, Version 2.0 (the "License");
186
+ * you may not use this file except in compliance with the License.
187
+ * You may obtain a copy of the License at
188
+ *
189
+ * http://www.apache.org/licenses/LICENSE-2.0
190
+ *
191
+ * Unless required by applicable law or agreed to in writing, software
192
+ * distributed under the License is distributed on an "AS IS" BASIS,
193
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
194
+ * See the License for the specific language governing permissions and
195
+ * limitations under the License.
196
+ */class ae{constructor(e,n,a,o,s){this.roleA=e,this.roleB=n,this.delta=a,this.polarity=o,this.stayTogether=s}}/**
197
+ * @license
198
+ * Copyright 2022 Google LLC
199
+ *
200
+ * Licensed under the Apache License, Version 2.0 (the "License");
201
+ * you may not use this file except in compliance with the License.
202
+ * You may obtain a copy of the License at
203
+ *
204
+ * http://www.apache.org/licenses/LICENSE-2.0
205
+ *
206
+ * Unless required by applicable law or agreed to in writing, software
207
+ * distributed under the License is distributed on an "AS IS" BASIS,
208
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
209
+ * See the License for the specific language governing permissions and
210
+ * limitations under the License.
211
+ */var Ne;(function(t){t[t.MONOCHROME=0]="MONOCHROME",t[t.NEUTRAL=1]="NEUTRAL",t[t.TONAL_SPOT=2]="TONAL_SPOT",t[t.VIBRANT=3]="VIBRANT",t[t.EXPRESSIVE=4]="EXPRESSIVE",t[t.FIDELITY=5]="FIDELITY",t[t.CONTENT=6]="CONTENT",t[t.RAINBOW=7]="RAINBOW",t[t.FRUIT_SALAD=8]="FRUIT_SALAD"})(Ne||(Ne={}));/**
212
+ * @license
213
+ * Copyright 2022 Google LLC
214
+ *
215
+ * Licensed under the Apache License, Version 2.0 (the "License");
216
+ * you may not use this file except in compliance with the License.
217
+ * You may obtain a copy of the License at
218
+ *
219
+ * http://www.apache.org/licenses/LICENSE-2.0
220
+ *
221
+ * Unless required by applicable law or agreed to in writing, software
222
+ * distributed under the License is distributed on an "AS IS" BASIS,
223
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
224
+ * See the License for the specific language governing permissions and
225
+ * limitations under the License.
226
+ */function Te(t){return t.variant===Ne.FIDELITY||t.variant===Ne.CONTENT}function z(t){return t.variant===Ne.MONOCHROME}function an(t,e,n,a){let o=n,s=q.from(t,e,n);if(s.chroma<e){let i=s.chroma;for(;s.chroma<e;){o+=a?-1:1;const c=q.from(t,e,o);if(i>c.chroma||Math.abs(c.chroma-e)<.4)break;const l=Math.abs(c.chroma-e),d=Math.abs(s.chroma-e);l<d&&(s=c),i=Math.max(i,c.chroma)}}return o}class C{static highestSurface(e){return e.isDark?C.surfaceBright:C.surfaceDim}}C.contentAccentToneDelta=15;C.primaryPaletteKeyColor=I.fromPalette({name:"primary_palette_key_color",palette:t=>t.primaryPalette,tone:t=>t.primaryPalette.keyColor.tone});C.secondaryPaletteKeyColor=I.fromPalette({name:"secondary_palette_key_color",palette:t=>t.secondaryPalette,tone:t=>t.secondaryPalette.keyColor.tone});C.tertiaryPaletteKeyColor=I.fromPalette({name:"tertiary_palette_key_color",palette:t=>t.tertiaryPalette,tone:t=>t.tertiaryPalette.keyColor.tone});C.neutralPaletteKeyColor=I.fromPalette({name:"neutral_palette_key_color",palette:t=>t.neutralPalette,tone:t=>t.neutralPalette.keyColor.tone});C.neutralVariantPaletteKeyColor=I.fromPalette({name:"neutral_variant_palette_key_color",palette:t=>t.neutralVariantPalette,tone:t=>t.neutralVariantPalette.keyColor.tone});C.background=I.fromPalette({name:"background",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0});C.onBackground=I.fromPalette({name:"on_background",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>C.background,contrastCurve:new V(3,3,4.5,7)});C.surface=I.fromPalette({name:"surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0});C.surfaceDim=I.fromPalette({name:"surface_dim",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:new V(87,87,80,75).get(t.contrastLevel),isBackground:!0});C.surfaceBright=I.fromPalette({name:"surface_bright",palette:t=>t.neutralPalette,tone:t=>t.isDark?new V(24,24,29,34).get(t.contrastLevel):98,isBackground:!0});C.surfaceContainerLowest=I.fromPalette({name:"surface_container_lowest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new V(4,4,2,0).get(t.contrastLevel):100,isBackground:!0});C.surfaceContainerLow=I.fromPalette({name:"surface_container_low",palette:t=>t.neutralPalette,tone:t=>t.isDark?new V(10,10,11,12).get(t.contrastLevel):new V(96,96,96,95).get(t.contrastLevel),isBackground:!0});C.surfaceContainer=I.fromPalette({name:"surface_container",palette:t=>t.neutralPalette,tone:t=>t.isDark?new V(12,12,16,20).get(t.contrastLevel):new V(94,94,92,90).get(t.contrastLevel),isBackground:!0});C.surfaceContainerHigh=I.fromPalette({name:"surface_container_high",palette:t=>t.neutralPalette,tone:t=>t.isDark?new V(17,17,21,25).get(t.contrastLevel):new V(92,92,88,85).get(t.contrastLevel),isBackground:!0});C.surfaceContainerHighest=I.fromPalette({name:"surface_container_highest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new V(22,22,26,30).get(t.contrastLevel):new V(90,90,84,80).get(t.contrastLevel),isBackground:!0});C.onSurface=I.fromPalette({name:"on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>C.highestSurface(t),contrastCurve:new V(4.5,7,11,21)});C.surfaceVariant=I.fromPalette({name:"surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:90,isBackground:!0});C.onSurfaceVariant=I.fromPalette({name:"on_surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?80:30,background:t=>C.highestSurface(t),contrastCurve:new V(3,4.5,7,11)});C.inverseSurface=I.fromPalette({name:"inverse_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:20});C.inverseOnSurface=I.fromPalette({name:"inverse_on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?20:95,background:t=>C.inverseSurface,contrastCurve:new V(4.5,7,11,21)});C.outline=I.fromPalette({name:"outline",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?60:50,background:t=>C.highestSurface(t),contrastCurve:new V(1.5,3,4.5,7)});C.outlineVariant=I.fromPalette({name:"outline_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:80,background:t=>C.highestSurface(t),contrastCurve:new V(1,1,3,4.5)});C.shadow=I.fromPalette({name:"shadow",palette:t=>t.neutralPalette,tone:t=>0});C.scrim=I.fromPalette({name:"scrim",palette:t=>t.neutralPalette,tone:t=>0});C.surfaceTint=I.fromPalette({name:"surface_tint",palette:t=>t.primaryPalette,tone:t=>t.isDark?80:40,isBackground:!0});C.primary=I.fromPalette({name:"primary",palette:t=>t.primaryPalette,tone:t=>z(t)?t.isDark?100:0:t.isDark?80:40,isBackground:!0,background:t=>C.highestSurface(t),contrastCurve:new V(3,4.5,7,7),toneDeltaPair:t=>new ae(C.primaryContainer,C.primary,10,"nearer",!1)});C.onPrimary=I.fromPalette({name:"on_primary",palette:t=>t.primaryPalette,tone:t=>z(t)?t.isDark?10:90:t.isDark?20:100,background:t=>C.primary,contrastCurve:new V(4.5,7,11,21)});C.primaryContainer=I.fromPalette({name:"primary_container",palette:t=>t.primaryPalette,tone:t=>Te(t)?t.sourceColorHct.tone:z(t)?t.isDark?85:25:t.isDark?30:90,isBackground:!0,background:t=>C.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new ae(C.primaryContainer,C.primary,10,"nearer",!1)});C.onPrimaryContainer=I.fromPalette({name:"on_primary_container",palette:t=>t.primaryPalette,tone:t=>Te(t)?I.foregroundTone(C.primaryContainer.tone(t),4.5):z(t)?t.isDark?0:100:t.isDark?90:30,background:t=>C.primaryContainer,contrastCurve:new V(3,4.5,7,11)});C.inversePrimary=I.fromPalette({name:"inverse_primary",palette:t=>t.primaryPalette,tone:t=>t.isDark?40:80,background:t=>C.inverseSurface,contrastCurve:new V(3,4.5,7,7)});C.secondary=I.fromPalette({name:"secondary",palette:t=>t.secondaryPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>C.highestSurface(t),contrastCurve:new V(3,4.5,7,7),toneDeltaPair:t=>new ae(C.secondaryContainer,C.secondary,10,"nearer",!1)});C.onSecondary=I.fromPalette({name:"on_secondary",palette:t=>t.secondaryPalette,tone:t=>z(t)?t.isDark?10:100:t.isDark?20:100,background:t=>C.secondary,contrastCurve:new V(4.5,7,11,21)});C.secondaryContainer=I.fromPalette({name:"secondary_container",palette:t=>t.secondaryPalette,tone:t=>{const e=t.isDark?30:90;return z(t)?t.isDark?30:85:Te(t)?an(t.secondaryPalette.hue,t.secondaryPalette.chroma,e,!t.isDark):e},isBackground:!0,background:t=>C.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new ae(C.secondaryContainer,C.secondary,10,"nearer",!1)});C.onSecondaryContainer=I.fromPalette({name:"on_secondary_container",palette:t=>t.secondaryPalette,tone:t=>z(t)?t.isDark?90:10:Te(t)?I.foregroundTone(C.secondaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>C.secondaryContainer,contrastCurve:new V(3,4.5,7,11)});C.tertiary=I.fromPalette({name:"tertiary",palette:t=>t.tertiaryPalette,tone:t=>z(t)?t.isDark?90:25:t.isDark?80:40,isBackground:!0,background:t=>C.highestSurface(t),contrastCurve:new V(3,4.5,7,7),toneDeltaPair:t=>new ae(C.tertiaryContainer,C.tertiary,10,"nearer",!1)});C.onTertiary=I.fromPalette({name:"on_tertiary",palette:t=>t.tertiaryPalette,tone:t=>z(t)?t.isDark?10:90:t.isDark?20:100,background:t=>C.tertiary,contrastCurve:new V(4.5,7,11,21)});C.tertiaryContainer=I.fromPalette({name:"tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>{if(z(t))return t.isDark?60:49;if(!Te(t))return t.isDark?30:90;const e=t.tertiaryPalette.getHct(t.sourceColorHct.tone);return mt.fixIfDisliked(e).tone},isBackground:!0,background:t=>C.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new ae(C.tertiaryContainer,C.tertiary,10,"nearer",!1)});C.onTertiaryContainer=I.fromPalette({name:"on_tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>z(t)?t.isDark?0:100:Te(t)?I.foregroundTone(C.tertiaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>C.tertiaryContainer,contrastCurve:new V(3,4.5,7,11)});C.error=I.fromPalette({name:"error",palette:t=>t.errorPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>C.highestSurface(t),contrastCurve:new V(3,4.5,7,7),toneDeltaPair:t=>new ae(C.errorContainer,C.error,10,"nearer",!1)});C.onError=I.fromPalette({name:"on_error",palette:t=>t.errorPalette,tone:t=>t.isDark?20:100,background:t=>C.error,contrastCurve:new V(4.5,7,11,21)});C.errorContainer=I.fromPalette({name:"error_container",palette:t=>t.errorPalette,tone:t=>t.isDark?30:90,isBackground:!0,background:t=>C.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new ae(C.errorContainer,C.error,10,"nearer",!1)});C.onErrorContainer=I.fromPalette({name:"on_error_container",palette:t=>t.errorPalette,tone:t=>z(t)?t.isDark?90:10:t.isDark?90:30,background:t=>C.errorContainer,contrastCurve:new V(3,4.5,7,11)});C.primaryFixed=I.fromPalette({name:"primary_fixed",palette:t=>t.primaryPalette,tone:t=>z(t)?40:90,isBackground:!0,background:t=>C.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new ae(C.primaryFixed,C.primaryFixedDim,10,"lighter",!0)});C.primaryFixedDim=I.fromPalette({name:"primary_fixed_dim",palette:t=>t.primaryPalette,tone:t=>z(t)?30:80,isBackground:!0,background:t=>C.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new ae(C.primaryFixed,C.primaryFixedDim,10,"lighter",!0)});C.onPrimaryFixed=I.fromPalette({name:"on_primary_fixed",palette:t=>t.primaryPalette,tone:t=>z(t)?100:10,background:t=>C.primaryFixedDim,secondBackground:t=>C.primaryFixed,contrastCurve:new V(4.5,7,11,21)});C.onPrimaryFixedVariant=I.fromPalette({name:"on_primary_fixed_variant",palette:t=>t.primaryPalette,tone:t=>z(t)?90:30,background:t=>C.primaryFixedDim,secondBackground:t=>C.primaryFixed,contrastCurve:new V(3,4.5,7,11)});C.secondaryFixed=I.fromPalette({name:"secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>z(t)?80:90,isBackground:!0,background:t=>C.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new ae(C.secondaryFixed,C.secondaryFixedDim,10,"lighter",!0)});C.secondaryFixedDim=I.fromPalette({name:"secondary_fixed_dim",palette:t=>t.secondaryPalette,tone:t=>z(t)?70:80,isBackground:!0,background:t=>C.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new ae(C.secondaryFixed,C.secondaryFixedDim,10,"lighter",!0)});C.onSecondaryFixed=I.fromPalette({name:"on_secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>10,background:t=>C.secondaryFixedDim,secondBackground:t=>C.secondaryFixed,contrastCurve:new V(4.5,7,11,21)});C.onSecondaryFixedVariant=I.fromPalette({name:"on_secondary_fixed_variant",palette:t=>t.secondaryPalette,tone:t=>z(t)?25:30,background:t=>C.secondaryFixedDim,secondBackground:t=>C.secondaryFixed,contrastCurve:new V(3,4.5,7,11)});C.tertiaryFixed=I.fromPalette({name:"tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>z(t)?40:90,isBackground:!0,background:t=>C.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new ae(C.tertiaryFixed,C.tertiaryFixedDim,10,"lighter",!0)});C.tertiaryFixedDim=I.fromPalette({name:"tertiary_fixed_dim",palette:t=>t.tertiaryPalette,tone:t=>z(t)?30:80,isBackground:!0,background:t=>C.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new ae(C.tertiaryFixed,C.tertiaryFixedDim,10,"lighter",!0)});C.onTertiaryFixed=I.fromPalette({name:"on_tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>z(t)?100:10,background:t=>C.tertiaryFixedDim,secondBackground:t=>C.tertiaryFixed,contrastCurve:new V(4.5,7,11,21)});C.onTertiaryFixedVariant=I.fromPalette({name:"on_tertiary_fixed_variant",palette:t=>t.tertiaryPalette,tone:t=>z(t)?90:30,background:t=>C.tertiaryFixedDim,secondBackground:t=>C.tertiaryFixed,contrastCurve:new V(3,4.5,7,11)});/**
227
+ * @license
228
+ * Copyright 2021 Google LLC
229
+ *
230
+ * Licensed under the Apache License, Version 2.0 (the "License");
231
+ * you may not use this file except in compliance with the License.
232
+ * You may obtain a copy of the License at
233
+ *
234
+ * http://www.apache.org/licenses/LICENSE-2.0
235
+ *
236
+ * Unless required by applicable law or agreed to in writing, software
237
+ * distributed under the License is distributed on an "AS IS" BASIS,
238
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
239
+ * See the License for the specific language governing permissions and
240
+ * limitations under the License.
241
+ */class le{static of(e){return new le(e,!1)}static contentOf(e){return new le(e,!0)}static fromColors(e){return le.createPaletteFromColors(!1,e)}static contentFromColors(e){return le.createPaletteFromColors(!0,e)}static createPaletteFromColors(e,n){const a=new le(n.primary,e);if(n.secondary){const o=new le(n.secondary,e);a.a2=o.a1}if(n.tertiary){const o=new le(n.tertiary,e);a.a3=o.a1}if(n.error){const o=new le(n.error,e);a.error=o.a1}if(n.neutral){const o=new le(n.neutral,e);a.n1=o.n1}if(n.neutralVariant){const o=new le(n.neutralVariant,e);a.n2=o.n2}return a}constructor(e,n){const a=q.fromInt(e),o=a.hue,s=a.chroma;n?(this.a1=Z.fromHueAndChroma(o,s),this.a2=Z.fromHueAndChroma(o,s/3),this.a3=Z.fromHueAndChroma(o+60,s/2),this.n1=Z.fromHueAndChroma(o,Math.min(s/12,4)),this.n2=Z.fromHueAndChroma(o,Math.min(s/6,8))):(this.a1=Z.fromHueAndChroma(o,Math.max(48,s)),this.a2=Z.fromHueAndChroma(o,16),this.a3=Z.fromHueAndChroma(o+60,24),this.n1=Z.fromHueAndChroma(o,4),this.n2=Z.fromHueAndChroma(o,8)),this.error=Z.fromHueAndChroma(25,84)}}/**
242
+ * @license
243
+ * Copyright 2021 Google LLC
244
+ *
245
+ * Licensed under the Apache License, Version 2.0 (the "License");
246
+ * you may not use this file except in compliance with the License.
247
+ * You may obtain a copy of the License at
248
+ *
249
+ * http://www.apache.org/licenses/LICENSE-2.0
250
+ *
251
+ * Unless required by applicable law or agreed to in writing, software
252
+ * distributed under the License is distributed on an "AS IS" BASIS,
253
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
254
+ * See the License for the specific language governing permissions and
255
+ * limitations under the License.
256
+ */function Lt(t){const e=xt(t),n=_t(t),a=Et(t),o=[e.toString(16),n.toString(16),a.toString(16)];for(const[s,i]of o.entries())i.length===1&&(o[s]="0"+i);return"#"+o.join("")}function tt(t){t=t.replace("#","");const e=t.length===3,n=t.length===6,a=t.length===8;if(!e&&!n&&!a)throw new Error("unexpected hex "+t);let o=0,s=0,i=0;return e?(o=he(t.slice(0,1).repeat(2)),s=he(t.slice(1,2).repeat(2)),i=he(t.slice(2,3).repeat(2))):n?(o=he(t.slice(0,2)),s=he(t.slice(2,4)),i=he(t.slice(4,6))):a&&(o=he(t.slice(2,4)),s=he(t.slice(4,6)),i=he(t.slice(6,8))),(255<<24|(o&255)<<16|(s&255)<<8|i&255)>>>0}function he(t){return parseInt(t,16)}/**
257
+ * @license
258
+ * Copyright 2021 Google LLC
259
+ *
260
+ * Licensed under the Apache License, Version 2.0 (the "License");
261
+ * you may not use this file except in compliance with the License.
262
+ * You may obtain a copy of the License at
263
+ *
264
+ * http://www.apache.org/licenses/LICENSE-2.0
265
+ *
266
+ * Unless required by applicable law or agreed to in writing, software
267
+ * distributed under the License is distributed on an "AS IS" BASIS,
268
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
269
+ * See the License for the specific language governing permissions and
270
+ * limitations under the License.
271
+ */function on(t,e){let n=e.value;const a=n,o=t;n=dt.harmonize(a,o);const i=le.of(n).a1;return{color:e,value:n,light:{color:i.tone(40),onColor:i.tone(100),colorContainer:i.tone(90),onColorContainer:i.tone(10)},dark:{color:i.tone(80),onColor:i.tone(20),colorContainer:i.tone(30),onColorContainer:i.tone(90)}}}function re(t){return t<0?-1:t===0?0:1}function $e(t,e,n){return(1-n)*t+n*e}function sn(t,e,n){return n<t?t:n>e?e:n}function Ge(t,e,n){return n<t?t:n>e?e:n}function Mt(t){return t=t%360,t<0&&(t=t+360),t}function ht(t){return t=t%360,t<0&&(t=t+360),t}function cn(t,e){return ht(e-t)<=180?1:-1}function Vt(t,e){return 180-Math.abs(Math.abs(t-e)-180)}function st(t,e){const n=t[0]*e[0][0]+t[1]*e[0][1]+t[2]*e[0][2],a=t[0]*e[1][0]+t[1]*e[1][1]+t[2]*e[1][2],o=t[0]*e[2][0]+t[1]*e[2][1]+t[2]*e[2][2];return[n,a,o]}const St=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],ln=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],ft=[95.047,100,108.883];function Ye(t,e,n){return(255<<24|(t&255)<<16|(e&255)<<8|n&255)>>>0}function Bt(t){const e=De(t[0]),n=De(t[1]),a=De(t[2]);return Ye(e,n,a)}function un(t){return t>>24&255}function Je(t){return t>>16&255}function Ke(t){return t>>8&255}function Xe(t){return t&255}function $t(t,e,n){const a=ln,o=a[0][0]*t+a[0][1]*e+a[0][2]*n,s=a[1][0]*t+a[1][1]*e+a[1][2]*n,i=a[2][0]*t+a[2][1]*e+a[2][2]*n,c=De(o),l=De(s),d=De(i);return Ye(c,l,d)}function dn(t){const e=ge(Je(t)),n=ge(Ke(t)),a=ge(Xe(t));return st([e,n,a],St)}function mn(t,e,n){const a=ft,o=(t+16)/116,s=e/500+o,i=o-n/200,c=Ue(s),l=Ue(o),d=Ue(i),u=c*a[0],h=l*a[1],w=d*a[2];return $t(u,h,w)}function hn(t){const e=ge(Je(t)),n=ge(Ke(t)),a=ge(Xe(t)),o=St,s=o[0][0]*e+o[0][1]*n+o[0][2]*a,i=o[1][0]*e+o[1][1]*n+o[1][2]*a,c=o[2][0]*e+o[2][1]*n+o[2][2]*a,l=ft,d=s/l[0],u=i/l[1],h=c/l[2],w=Ae(d),k=Ae(u),g=Ae(h),p=116*k-16,b=500*(w-k),m=200*(k-g);return[p,b,m]}function fn(t){const e=ve(t),n=De(e);return Ye(n,n,n)}function it(t){const e=dn(t)[1];return 116*Ae(e/100)-16}function ve(t){return 100*Ue((t+16)/116)}function ct(t){return Ae(t/100)*116-16}function ge(t){const e=t/255;return e<=.040449936?e/12.92*100:Math.pow((e+.055)/1.055,2.4)*100}function De(t){const e=t/100;let n=0;return e<=.0031308?n=e*12.92:n=1.055*Math.pow(e,1/2.4)-.055,sn(0,255,Math.round(n*255))}function pn(){return ft}function Ae(t){const e=.008856451679035631,n=24389/27;return t>e?Math.pow(t,1/3):(n*t+16)/116}function Ue(t){const e=.008856451679035631,n=24389/27,a=t*t*t;return a>e?a:(116*t-16)/n}class me{static make(e=pn(),n=200/Math.PI*ve(50)/100,a=50,o=2,s=!1){const i=e,c=i[0]*.401288+i[1]*.650173+i[2]*-.051461,l=i[0]*-.250268+i[1]*1.204414+i[2]*.045854,d=i[0]*-.002079+i[1]*.048952+i[2]*.953127,u=.8+o/10,h=u>=.9?$e(.59,.69,(u-.9)*10):$e(.525,.59,(u-.8)*10);let w=s?1:u*(1-1/3.6*Math.exp((-n-42)/92));w=w>1?1:w<0?0:w;const k=u,g=[w*(100/c)+1-w,w*(100/l)+1-w,w*(100/d)+1-w],p=1/(5*n+1),b=p*p*p*p,m=1-b,v=b*n+.1*m*m*Math.cbrt(5*n),P=ve(a)/e[1],f=1.48+Math.sqrt(P),x=.725/Math.pow(P,.2),L=x,M=[Math.pow(v*g[0]*c/100,.42),Math.pow(v*g[1]*l/100,.42),Math.pow(v*g[2]*d/100,.42)],B=[400*M[0]/(M[0]+27.13),400*M[1]/(M[1]+27.13),400*M[2]/(M[2]+27.13)],T=(2*B[0]+B[1]+.05*B[2])*x;return new me(P,T,x,L,h,k,g,v,Math.pow(v,.25),f)}constructor(e,n,a,o,s,i,c,l,d,u){this.n=e,this.aw=n,this.nbb=a,this.ncb=o,this.c=s,this.nc=i,this.rgbD=c,this.fl=l,this.fLRoot=d,this.z=u}}me.DEFAULT=me.make();class K{constructor(e,n,a,o,s,i,c,l,d){this.hue=e,this.chroma=n,this.j=a,this.q=o,this.m=s,this.s=i,this.jstar=c,this.astar=l,this.bstar=d}distance(e){const n=this.jstar-e.jstar,a=this.astar-e.astar,o=this.bstar-e.bstar,s=Math.sqrt(n*n+a*a+o*o);return 1.41*Math.pow(s,.63)}static fromInt(e){return K.fromIntInViewingConditions(e,me.DEFAULT)}static fromIntInViewingConditions(e,n){const a=(e&16711680)>>16,o=(e&65280)>>8,s=e&255,i=ge(a),c=ge(o),l=ge(s),d=.41233895*i+.35762064*c+.18051042*l,u=.2126*i+.7152*c+.0722*l,h=.01932141*i+.11916382*c+.95034478*l,w=.401288*d+.650173*u-.051461*h,k=-.250268*d+1.204414*u+.045854*h,g=-.002079*d+.048952*u+.953127*h,p=n.rgbD[0]*w,b=n.rgbD[1]*k,m=n.rgbD[2]*g,v=Math.pow(n.fl*Math.abs(p)/100,.42),P=Math.pow(n.fl*Math.abs(b)/100,.42),f=Math.pow(n.fl*Math.abs(m)/100,.42),x=re(p)*400*v/(v+27.13),L=re(b)*400*P/(P+27.13),M=re(m)*400*f/(f+27.13),B=(11*x+-12*L+M)/11,T=(x+L-2*M)/9,$=(20*x+20*L+21*M)/20,N=(40*x+20*L+M)/20,A=Math.atan2(T,B)*180/Math.PI,H=A<0?A+360:A>=360?A-360:A,R=H*Math.PI/180,ie=N*n.nbb,se=100*Math.pow(ie/n.aw,n.c*n.z),ce=4/n.c*Math.sqrt(se/100)*(n.aw+4)*n.fLRoot,ke=H<20.14?H+360:H,be=.25*(Math.cos(ke*Math.PI/180+2)+3.8),Me=5e4/13*be*n.nc*n.ncb*Math.sqrt(B*B+T*T)/($+.305),Ce=Math.pow(Me,.9)*Math.pow(1.64-Math.pow(.29,n.n),.73),xe=Ce*Math.sqrt(se/100),Be=xe*n.fLRoot,Re=50*Math.sqrt(Ce*n.c/(n.aw+4)),ze=(1+100*.007)*se/(1+.007*se),je=1/.0228*Math.log(1+.0228*Be),et=je*Math.cos(R),He=je*Math.sin(R);return new K(H,xe,se,ce,Be,Re,ze,et,He)}static fromJch(e,n,a){return K.fromJchInViewingConditions(e,n,a,me.DEFAULT)}static fromJchInViewingConditions(e,n,a,o){const s=4/o.c*Math.sqrt(e/100)*(o.aw+4)*o.fLRoot,i=n*o.fLRoot,c=n/Math.sqrt(e/100),l=50*Math.sqrt(c*o.c/(o.aw+4)),d=a*Math.PI/180,u=(1+100*.007)*e/(1+.007*e),h=1/.0228*Math.log(1+.0228*i),w=h*Math.cos(d),k=h*Math.sin(d);return new K(a,n,e,s,i,l,u,w,k)}static fromUcs(e,n,a){return K.fromUcsInViewingConditions(e,n,a,me.DEFAULT)}static fromUcsInViewingConditions(e,n,a,o){const s=n,i=a,c=Math.sqrt(s*s+i*i),l=(Math.exp(c*.0228)-1)/.0228/o.fLRoot;let d=Math.atan2(i,s)*(180/Math.PI);d<0&&(d+=360);const u=e/(1-(e-100)*.007);return K.fromJchInViewingConditions(u,l,d,o)}toInt(){return this.viewed(me.DEFAULT)}viewed(e){const n=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),a=Math.pow(n/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),o=this.hue*Math.PI/180,s=.25*(Math.cos(o+2)+3.8),i=e.aw*Math.pow(this.j/100,1/e.c/e.z),c=s*(5e4/13)*e.nc*e.ncb,l=i/e.nbb,d=Math.sin(o),u=Math.cos(o),h=23*(l+.305)*a/(23*c+11*a*u+108*a*d),w=h*u,k=h*d,g=(460*l+451*w+288*k)/1403,p=(460*l-891*w-261*k)/1403,b=(460*l-220*w-6300*k)/1403,m=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),v=re(g)*(100/e.fl)*Math.pow(m,1/.42),P=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),f=re(p)*(100/e.fl)*Math.pow(P,1/.42),x=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),L=re(b)*(100/e.fl)*Math.pow(x,1/.42),M=v/e.rgbD[0],B=f/e.rgbD[1],T=L/e.rgbD[2],$=1.86206786*M-1.01125463*B+.14918677*T,N=.38752654*M+.62144744*B-.00897398*T,A=-.0158415*M-.03412294*B+1.04996444*T;return $t($,N,A)}static fromXyzInViewingConditions(e,n,a,o){const s=.401288*e+.650173*n-.051461*a,i=-.250268*e+1.204414*n+.045854*a,c=-.002079*e+.048952*n+.953127*a,l=o.rgbD[0]*s,d=o.rgbD[1]*i,u=o.rgbD[2]*c,h=Math.pow(o.fl*Math.abs(l)/100,.42),w=Math.pow(o.fl*Math.abs(d)/100,.42),k=Math.pow(o.fl*Math.abs(u)/100,.42),g=re(l)*400*h/(h+27.13),p=re(d)*400*w/(w+27.13),b=re(u)*400*k/(k+27.13),m=(11*g+-12*p+b)/11,v=(g+p-2*b)/9,P=(20*g+20*p+21*b)/20,f=(40*g+20*p+b)/20,x=Math.atan2(v,m)*180/Math.PI,L=x<0?x+360:x>=360?x-360:x,M=L*Math.PI/180,B=f*o.nbb,T=100*Math.pow(B/o.aw,o.c*o.z),$=4/o.c*Math.sqrt(T/100)*(o.aw+4)*o.fLRoot,N=L<20.14?L+360:L,A=1/4*(Math.cos(N*Math.PI/180+2)+3.8),H=5e4/13*A*o.nc*o.ncb*Math.sqrt(m*m+v*v)/(P+.305),R=Math.pow(H,.9)*Math.pow(1.64-Math.pow(.29,o.n),.73),ie=R*Math.sqrt(T/100),se=ie*o.fLRoot,ce=50*Math.sqrt(R*o.c/(o.aw+4)),ke=(1+100*.007)*T/(1+.007*T),be=Math.log(1+.0228*se)/.0228,Me=be*Math.cos(M),Ce=be*Math.sin(M);return new K(L,ie,T,$,se,ce,ke,Me,Ce)}xyzInViewingConditions(e){const n=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),a=Math.pow(n/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),o=this.hue*Math.PI/180,s=.25*(Math.cos(o+2)+3.8),i=e.aw*Math.pow(this.j/100,1/e.c/e.z),c=s*(5e4/13)*e.nc*e.ncb,l=i/e.nbb,d=Math.sin(o),u=Math.cos(o),h=23*(l+.305)*a/(23*c+11*a*u+108*a*d),w=h*u,k=h*d,g=(460*l+451*w+288*k)/1403,p=(460*l-891*w-261*k)/1403,b=(460*l-220*w-6300*k)/1403,m=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),v=re(g)*(100/e.fl)*Math.pow(m,1/.42),P=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),f=re(p)*(100/e.fl)*Math.pow(P,1/.42),x=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),L=re(b)*(100/e.fl)*Math.pow(x,1/.42),M=v/e.rgbD[0],B=f/e.rgbD[1],T=L/e.rgbD[2],$=1.86206786*M-1.01125463*B+.14918677*T,N=.38752654*M+.62144744*B-.00897398*T,A=-.0158415*M-.03412294*B+1.04996444*T;return[$,N,A]}}class E{static sanitizeRadians(e){return(e+Math.PI*8)%(Math.PI*2)}static trueDelinearized(e){const n=e/100;let a=0;return n<=.0031308?a=n*12.92:a=1.055*Math.pow(n,1/2.4)-.055,a*255}static chromaticAdaptation(e){const n=Math.pow(Math.abs(e),.42);return re(e)*400*n/(n+27.13)}static hueOf(e){const n=st(e,E.SCALED_DISCOUNT_FROM_LINRGB),a=E.chromaticAdaptation(n[0]),o=E.chromaticAdaptation(n[1]),s=E.chromaticAdaptation(n[2]),i=(11*a+-12*o+s)/11,c=(a+o-2*s)/9;return Math.atan2(c,i)}static areInCyclicOrder(e,n,a){const o=E.sanitizeRadians(n-e),s=E.sanitizeRadians(a-e);return o<s}static intercept(e,n,a){return(n-e)/(a-e)}static lerpPoint(e,n,a){return[e[0]+(a[0]-e[0])*n,e[1]+(a[1]-e[1])*n,e[2]+(a[2]-e[2])*n]}static setCoordinate(e,n,a,o){const s=E.intercept(e[o],n,a[o]);return E.lerpPoint(e,s,a)}static isBounded(e){return 0<=e&&e<=100}static nthVertex(e,n){const a=E.Y_FROM_LINRGB[0],o=E.Y_FROM_LINRGB[1],s=E.Y_FROM_LINRGB[2],i=n%4<=1?0:100,c=n%2===0?0:100;if(n<4){const l=i,d=c,u=(e-l*o-d*s)/a;return E.isBounded(u)?[u,l,d]:[-1,-1,-1]}else if(n<8){const l=i,d=c,u=(e-d*a-l*s)/o;return E.isBounded(u)?[d,u,l]:[-1,-1,-1]}else{const l=i,d=c,u=(e-l*a-d*o)/s;return E.isBounded(u)?[l,d,u]:[-1,-1,-1]}}static bisectToSegment(e,n){let a=[-1,-1,-1],o=a,s=0,i=0,c=!1,l=!0;for(let d=0;d<12;d++){const u=E.nthVertex(e,d);if(u[0]<0)continue;const h=E.hueOf(u);if(!c){a=u,o=u,s=h,i=h,c=!0;continue}(l||E.areInCyclicOrder(s,h,i))&&(l=!1,E.areInCyclicOrder(s,n,h)?(o=u,i=h):(a=u,s=h))}return[a,o]}static midpoint(e,n){return[(e[0]+n[0])/2,(e[1]+n[1])/2,(e[2]+n[2])/2]}static criticalPlaneBelow(e){return Math.floor(e-.5)}static criticalPlaneAbove(e){return Math.ceil(e-.5)}static bisectToLimit(e,n){const a=E.bisectToSegment(e,n);let o=a[0],s=E.hueOf(o),i=a[1];for(let c=0;c<3;c++)if(o[c]!==i[c]){let l=-1,d=255;o[c]<i[c]?(l=E.criticalPlaneBelow(E.trueDelinearized(o[c])),d=E.criticalPlaneAbove(E.trueDelinearized(i[c]))):(l=E.criticalPlaneAbove(E.trueDelinearized(o[c])),d=E.criticalPlaneBelow(E.trueDelinearized(i[c])));for(let u=0;u<8&&!(Math.abs(d-l)<=1);u++){const h=Math.floor((l+d)/2),w=E.CRITICAL_PLANES[h],k=E.setCoordinate(o,w,i,c),g=E.hueOf(k);E.areInCyclicOrder(s,n,g)?(i=k,d=h):(o=k,s=g,l=h)}}return E.midpoint(o,i)}static inverseChromaticAdaptation(e){const n=Math.abs(e),a=Math.max(0,27.13*n/(400-n));return re(e)*Math.pow(a,1/.42)}static findResultByJ(e,n,a){let o=Math.sqrt(a)*11;const s=me.DEFAULT,i=1/Math.pow(1.64-Math.pow(.29,s.n),.73),c=.25*(Math.cos(e+2)+3.8)*(5e4/13)*s.nc*s.ncb,l=Math.sin(e),d=Math.cos(e);for(let u=0;u<5;u++){const h=o/100,w=n===0||o===0?0:n/Math.sqrt(h),k=Math.pow(w*i,1/.9),g=s.aw*Math.pow(h,1/s.c/s.z)/s.nbb,p=23*(g+.305)*k/(23*c+11*k*d+108*k*l),b=p*d,m=p*l,v=(460*g+451*b+288*m)/1403,P=(460*g-891*b-261*m)/1403,f=(460*g-220*b-6300*m)/1403,x=E.inverseChromaticAdaptation(v),L=E.inverseChromaticAdaptation(P),M=E.inverseChromaticAdaptation(f),B=st([x,L,M],E.LINRGB_FROM_SCALED_DISCOUNT);if(B[0]<0||B[1]<0||B[2]<0)return 0;const T=E.Y_FROM_LINRGB[0],$=E.Y_FROM_LINRGB[1],N=E.Y_FROM_LINRGB[2],A=T*B[0]+$*B[1]+N*B[2];if(A<=0)return 0;if(u===4||Math.abs(A-a)<.002)return B[0]>100.01||B[1]>100.01||B[2]>100.01?0:Bt(B);o=o-(A-a)*o/(2*A)}return 0}static solveToInt(e,n,a){if(n<1e-4||a<1e-4||a>99.9999)return fn(a);e=ht(e);const o=e/180*Math.PI,s=ve(a),i=E.findResultByJ(o,n,s);if(i!==0)return i;const c=E.bisectToLimit(s,o);return Bt(c)}static solveToCam(e,n,a){return K.fromInt(E.solveToInt(e,n,a))}}E.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]];E.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]];E.Y_FROM_LINRGB=[.2126,.7152,.0722];E.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776];class U{static from(e,n,a){return new U(E.solveToInt(e,n,a))}static fromInt(e){return new U(e)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(e){this.setInternalState(E.solveToInt(e,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(e){this.setInternalState(E.solveToInt(this.internalHue,e,this.internalTone))}get tone(){return this.internalTone}set tone(e){this.setInternalState(E.solveToInt(this.internalHue,this.internalChroma,e))}constructor(e){this.argb=e;const n=K.fromInt(e);this.internalHue=n.hue,this.internalChroma=n.chroma,this.internalTone=it(e),this.argb=e}setInternalState(e){const n=K.fromInt(e);this.internalHue=n.hue,this.internalChroma=n.chroma,this.internalTone=it(e),this.argb=e}inViewingConditions(e){const n=K.fromInt(this.toInt()).xyzInViewingConditions(e),a=K.fromXyzInViewingConditions(n[0],n[1],n[2],me.make());return U.from(a.hue,a.chroma,ct(n[1]))}}class pt{static harmonize(e,n){const a=U.fromInt(e),o=U.fromInt(n),s=Vt(a.hue,o.hue),i=Math.min(s*.5,15),c=ht(a.hue+i*cn(a.hue,o.hue));return U.from(c,a.chroma,a.tone).toInt()}static hctHue(e,n,a){const o=pt.cam16Ucs(e,n,a),s=K.fromInt(o),i=K.fromInt(e);return U.from(s.hue,i.chroma,it(e)).toInt()}static cam16Ucs(e,n,a){const o=K.fromInt(e),s=K.fromInt(n),i=o.jstar,c=o.astar,l=o.bstar,d=s.jstar,u=s.astar,h=s.bstar,w=i+(d-i)*a,k=c+(u-c)*a,g=l+(h-l)*a;return K.fromUcs(w,k,g).toInt()}}class Y{static ratioOfTones(e,n){return e=Ge(0,100,e),n=Ge(0,100,n),Y.ratioOfYs(ve(e),ve(n))}static ratioOfYs(e,n){const a=e>n?e:n,o=a===n?e:n;return(a+5)/(o+5)}static lighter(e,n){if(e<0||e>100)return-1;const a=ve(e),o=n*(a+5)-5,s=Y.ratioOfYs(o,a),i=Math.abs(s-n);if(s<n&&i>.04)return-1;const c=ct(o)+.4;return c<0||c>100?-1:c}static darker(e,n){if(e<0||e>100)return-1;const a=ve(e),o=(a+5)/n-5,s=Y.ratioOfYs(a,o),i=Math.abs(s-n);if(s<n&&i>.04)return-1;const c=ct(o)-.4;return c<0||c>100?-1:c}static lighterUnsafe(e,n){const a=Y.lighter(e,n);return a<0?100:a}static darkerUnsafe(e,n){const a=Y.darker(e,n);return a<0?0:a}}class gt{static isDisliked(e){const n=Math.round(e.hue)>=90&&Math.round(e.hue)<=111,a=Math.round(e.chroma)>16,o=Math.round(e.tone)<65;return n&&a&&o}static fixIfDisliked(e){return gt.isDisliked(e)?U.from(e.hue,e.chroma,70):e}}class D{static fromPalette(e){return new D(e.name??"",e.palette,e.tone,e.isBackground??!1,e.background,e.secondBackground,e.contrastCurve,e.toneDeltaPair)}constructor(e,n,a,o,s,i,c,l){if(this.name=e,this.palette=n,this.tone=a,this.isBackground=o,this.background=s,this.secondBackground=i,this.contrastCurve=c,this.toneDeltaPair=l,this.hctCache=new Map,!s&&i)throw new Error(`Color ${e} has secondBackgrounddefined, but background is not defined.`);if(!s&&c)throw new Error(`Color ${e} has contrastCurvedefined, but background is not defined.`);if(s&&!c)throw new Error(`Color ${e} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(e){return this.getHct(e).toInt()}getHct(e){const n=this.hctCache.get(e);if(n!=null)return n;const a=this.getTone(e),o=this.palette(e).getHct(a);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(e,o),o}getTone(e){const n=e.contrastLevel<0;if(this.toneDeltaPair){const a=this.toneDeltaPair(e),o=a.roleA,s=a.roleB,i=a.delta,c=a.polarity,l=a.stayTogether,d=this.background(e).getTone(e),u=c==="nearer"||c==="lighter"&&!e.isDark||c==="darker"&&e.isDark,h=u?o:s,w=u?s:o,k=this.name===h.name,g=e.isDark?1:-1,p=h.contrastCurve.get(e.contrastLevel),b=w.contrastCurve.get(e.contrastLevel),m=h.tone(e);let v=Y.ratioOfTones(d,m)>=p?m:D.foregroundTone(d,p);const P=w.tone(e);let f=Y.ratioOfTones(d,P)>=b?P:D.foregroundTone(d,b);return n&&(v=D.foregroundTone(d,p),f=D.foregroundTone(d,b)),(f-v)*g>=i||(f=Ge(0,100,v+i*g),(f-v)*g>=i||(v=Ge(0,100,f-i*g))),50<=v&&v<60?g>0?(v=60,f=Math.max(f,v+i*g)):(v=49,f=Math.min(f,v+i*g)):50<=f&&f<60&&(l?g>0?(v=60,f=Math.max(f,v+i*g)):(v=49,f=Math.min(f,v+i*g)):g>0?f=60:f=49),k?v:f}else{let a=this.tone(e);if(this.background==null)return a;const o=this.background(e).getTone(e),s=this.contrastCurve.get(e.contrastLevel);if(Y.ratioOfTones(o,a)>=s||(a=D.foregroundTone(o,s)),n&&(a=D.foregroundTone(o,s)),this.isBackground&&50<=a&&a<60&&(Y.ratioOfTones(49,o)>=s?a=49:a=60),this.secondBackground){const[i,c]=[this.background,this.secondBackground],[l,d]=[i(e).getTone(e),c(e).getTone(e)],[u,h]=[Math.max(l,d),Math.min(l,d)];if(Y.ratioOfTones(u,a)>=s&&Y.ratioOfTones(h,a)>=s)return a;const w=Y.lighter(u,s),k=Y.darker(h,s),g=[];return w!==-1&&g.push(w),k!==-1&&g.push(k),D.tonePrefersLightForeground(l)||D.tonePrefersLightForeground(d)?w<0?100:w:g.length===1?g[0]:k<0?0:k}return a}}static foregroundTone(e,n){const a=Y.lighterUnsafe(e,n),o=Y.darkerUnsafe(e,n),s=Y.ratioOfTones(a,e),i=Y.ratioOfTones(o,e);if(D.tonePrefersLightForeground(e)){const c=Math.abs(s-i)<.1&&s<n&&i<n;return s>=n||s>=i||c?a:o}else return i>=n||i>=s?o:a}static tonePrefersLightForeground(e){return Math.round(e)<60}static toneAllowsLightForeground(e){return Math.round(e)<=49}static enableLightForeground(e){return D.tonePrefersLightForeground(e)&&!D.toneAllowsLightForeground(e)?49:e}}class ee{static fromInt(e){const n=U.fromInt(e);return ee.fromHct(n)}static fromHct(e){return new ee(e.hue,e.chroma,e)}static fromHueAndChroma(e,n){const a=new gn(e,n).create();return new ee(e,n,a)}constructor(e,n,a){this.hue=e,this.chroma=n,this.keyColor=a,this.cache=new Map}tone(e){let n=this.cache.get(e);return n===void 0&&(n=U.from(this.hue,this.chroma,e).toInt(),this.cache.set(e,n)),n}getHct(e){return U.fromInt(this.tone(e))}}class gn{constructor(e,n){this.hue=e,this.requestedChroma=n,this.chromaCache=new Map,this.maxChromaValue=200}create(){let e=0,n=100;for(;e<n;){const a=Math.floor((e+n)/2),o=this.maxChroma(a)<this.maxChroma(a+1);if(this.maxChroma(a)>=this.requestedChroma-.01)if(Math.abs(e-50)<Math.abs(n-50))n=a;else{if(e===a)return U.from(this.hue,this.requestedChroma,e);e=a}else o?e=a+1:n=a}return U.from(this.hue,this.requestedChroma,e)}maxChroma(e){if(this.chromaCache.has(e))return this.chromaCache.get(e);const n=U.from(this.hue,this.maxChromaValue,e).chroma;return this.chromaCache.set(e,n),n}}class S{constructor(e,n,a,o){this.low=e,this.normal=n,this.medium=a,this.high=o}get(e){return e<=-1?this.low:e<0?$e(this.low,this.normal,(e- -1)/1):e<.5?$e(this.normal,this.medium,(e-0)/.5):e<1?$e(this.medium,this.high,(e-.5)/.5):this.high}}class oe{constructor(e,n,a,o,s){this.roleA=e,this.roleB=n,this.delta=a,this.polarity=o,this.stayTogether=s}}var Fe;(function(t){t[t.MONOCHROME=0]="MONOCHROME",t[t.NEUTRAL=1]="NEUTRAL",t[t.TONAL_SPOT=2]="TONAL_SPOT",t[t.VIBRANT=3]="VIBRANT",t[t.EXPRESSIVE=4]="EXPRESSIVE",t[t.FIDELITY=5]="FIDELITY",t[t.CONTENT=6]="CONTENT",t[t.RAINBOW=7]="RAINBOW",t[t.FRUIT_SALAD=8]="FRUIT_SALAD"})(Fe||(Fe={}));function Le(t){return t.variant===Fe.FIDELITY||t.variant===Fe.CONTENT}function j(t){return t.variant===Fe.MONOCHROME}function kn(t,e,n,a){let o=n,s=U.from(t,e,n);if(s.chroma<e){let i=s.chroma;for(;s.chroma<e;){o+=a?-1:1;const c=U.from(t,e,o);if(i>c.chroma||Math.abs(c.chroma-e)<.4)break;const l=Math.abs(c.chroma-e),d=Math.abs(s.chroma-e);l<d&&(s=c),i=Math.max(i,c.chroma)}}return o}class y{static highestSurface(e){return e.isDark?y.surfaceBright:y.surfaceDim}}y.contentAccentToneDelta=15;y.primaryPaletteKeyColor=D.fromPalette({name:"primary_palette_key_color",palette:t=>t.primaryPalette,tone:t=>t.primaryPalette.keyColor.tone});y.secondaryPaletteKeyColor=D.fromPalette({name:"secondary_palette_key_color",palette:t=>t.secondaryPalette,tone:t=>t.secondaryPalette.keyColor.tone});y.tertiaryPaletteKeyColor=D.fromPalette({name:"tertiary_palette_key_color",palette:t=>t.tertiaryPalette,tone:t=>t.tertiaryPalette.keyColor.tone});y.neutralPaletteKeyColor=D.fromPalette({name:"neutral_palette_key_color",palette:t=>t.neutralPalette,tone:t=>t.neutralPalette.keyColor.tone});y.neutralVariantPaletteKeyColor=D.fromPalette({name:"neutral_variant_palette_key_color",palette:t=>t.neutralVariantPalette,tone:t=>t.neutralVariantPalette.keyColor.tone});y.background=D.fromPalette({name:"background",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0});y.onBackground=D.fromPalette({name:"on_background",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>y.background,contrastCurve:new S(3,3,4.5,7)});y.surface=D.fromPalette({name:"surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0});y.surfaceDim=D.fromPalette({name:"surface_dim",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:new S(87,87,80,75).get(t.contrastLevel),isBackground:!0});y.surfaceBright=D.fromPalette({name:"surface_bright",palette:t=>t.neutralPalette,tone:t=>t.isDark?new S(24,24,29,34).get(t.contrastLevel):98,isBackground:!0});y.surfaceContainerLowest=D.fromPalette({name:"surface_container_lowest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new S(4,4,2,0).get(t.contrastLevel):100,isBackground:!0});y.surfaceContainerLow=D.fromPalette({name:"surface_container_low",palette:t=>t.neutralPalette,tone:t=>t.isDark?new S(10,10,11,12).get(t.contrastLevel):new S(96,96,96,95).get(t.contrastLevel),isBackground:!0});y.surfaceContainer=D.fromPalette({name:"surface_container",palette:t=>t.neutralPalette,tone:t=>t.isDark?new S(12,12,16,20).get(t.contrastLevel):new S(94,94,92,90).get(t.contrastLevel),isBackground:!0});y.surfaceContainerHigh=D.fromPalette({name:"surface_container_high",palette:t=>t.neutralPalette,tone:t=>t.isDark?new S(17,17,21,25).get(t.contrastLevel):new S(92,92,88,85).get(t.contrastLevel),isBackground:!0});y.surfaceContainerHighest=D.fromPalette({name:"surface_container_highest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new S(22,22,26,30).get(t.contrastLevel):new S(90,90,84,80).get(t.contrastLevel),isBackground:!0});y.onSurface=D.fromPalette({name:"on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>y.highestSurface(t),contrastCurve:new S(4.5,7,11,21)});y.surfaceVariant=D.fromPalette({name:"surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:90,isBackground:!0});y.onSurfaceVariant=D.fromPalette({name:"on_surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?80:30,background:t=>y.highestSurface(t),contrastCurve:new S(3,4.5,7,11)});y.inverseSurface=D.fromPalette({name:"inverse_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:20});y.inverseOnSurface=D.fromPalette({name:"inverse_on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?20:95,background:t=>y.inverseSurface,contrastCurve:new S(4.5,7,11,21)});y.outline=D.fromPalette({name:"outline",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?60:50,background:t=>y.highestSurface(t),contrastCurve:new S(1.5,3,4.5,7)});y.outlineVariant=D.fromPalette({name:"outline_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:80,background:t=>y.highestSurface(t),contrastCurve:new S(1,1,3,4.5)});y.shadow=D.fromPalette({name:"shadow",palette:t=>t.neutralPalette,tone:t=>0});y.scrim=D.fromPalette({name:"scrim",palette:t=>t.neutralPalette,tone:t=>0});y.surfaceTint=D.fromPalette({name:"surface_tint",palette:t=>t.primaryPalette,tone:t=>t.isDark?80:40,isBackground:!0});y.primary=D.fromPalette({name:"primary",palette:t=>t.primaryPalette,tone:t=>j(t)?t.isDark?100:0:t.isDark?80:40,isBackground:!0,background:t=>y.highestSurface(t),contrastCurve:new S(3,4.5,7,7),toneDeltaPair:t=>new oe(y.primaryContainer,y.primary,10,"nearer",!1)});y.onPrimary=D.fromPalette({name:"on_primary",palette:t=>t.primaryPalette,tone:t=>j(t)?t.isDark?10:90:t.isDark?20:100,background:t=>y.primary,contrastCurve:new S(4.5,7,11,21)});y.primaryContainer=D.fromPalette({name:"primary_container",palette:t=>t.primaryPalette,tone:t=>Le(t)?t.sourceColorHct.tone:j(t)?t.isDark?85:25:t.isDark?30:90,isBackground:!0,background:t=>y.highestSurface(t),contrastCurve:new S(1,1,3,4.5),toneDeltaPair:t=>new oe(y.primaryContainer,y.primary,10,"nearer",!1)});y.onPrimaryContainer=D.fromPalette({name:"on_primary_container",palette:t=>t.primaryPalette,tone:t=>Le(t)?D.foregroundTone(y.primaryContainer.tone(t),4.5):j(t)?t.isDark?0:100:t.isDark?90:30,background:t=>y.primaryContainer,contrastCurve:new S(3,4.5,7,11)});y.inversePrimary=D.fromPalette({name:"inverse_primary",palette:t=>t.primaryPalette,tone:t=>t.isDark?40:80,background:t=>y.inverseSurface,contrastCurve:new S(3,4.5,7,7)});y.secondary=D.fromPalette({name:"secondary",palette:t=>t.secondaryPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>y.highestSurface(t),contrastCurve:new S(3,4.5,7,7),toneDeltaPair:t=>new oe(y.secondaryContainer,y.secondary,10,"nearer",!1)});y.onSecondary=D.fromPalette({name:"on_secondary",palette:t=>t.secondaryPalette,tone:t=>j(t)?t.isDark?10:100:t.isDark?20:100,background:t=>y.secondary,contrastCurve:new S(4.5,7,11,21)});y.secondaryContainer=D.fromPalette({name:"secondary_container",palette:t=>t.secondaryPalette,tone:t=>{const e=t.isDark?30:90;return j(t)?t.isDark?30:85:Le(t)?kn(t.secondaryPalette.hue,t.secondaryPalette.chroma,e,!t.isDark):e},isBackground:!0,background:t=>y.highestSurface(t),contrastCurve:new S(1,1,3,4.5),toneDeltaPair:t=>new oe(y.secondaryContainer,y.secondary,10,"nearer",!1)});y.onSecondaryContainer=D.fromPalette({name:"on_secondary_container",palette:t=>t.secondaryPalette,tone:t=>j(t)?t.isDark?90:10:Le(t)?D.foregroundTone(y.secondaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>y.secondaryContainer,contrastCurve:new S(3,4.5,7,11)});y.tertiary=D.fromPalette({name:"tertiary",palette:t=>t.tertiaryPalette,tone:t=>j(t)?t.isDark?90:25:t.isDark?80:40,isBackground:!0,background:t=>y.highestSurface(t),contrastCurve:new S(3,4.5,7,7),toneDeltaPair:t=>new oe(y.tertiaryContainer,y.tertiary,10,"nearer",!1)});y.onTertiary=D.fromPalette({name:"on_tertiary",palette:t=>t.tertiaryPalette,tone:t=>j(t)?t.isDark?10:90:t.isDark?20:100,background:t=>y.tertiary,contrastCurve:new S(4.5,7,11,21)});y.tertiaryContainer=D.fromPalette({name:"tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>{if(j(t))return t.isDark?60:49;if(!Le(t))return t.isDark?30:90;const e=t.tertiaryPalette.getHct(t.sourceColorHct.tone);return gt.fixIfDisliked(e).tone},isBackground:!0,background:t=>y.highestSurface(t),contrastCurve:new S(1,1,3,4.5),toneDeltaPair:t=>new oe(y.tertiaryContainer,y.tertiary,10,"nearer",!1)});y.onTertiaryContainer=D.fromPalette({name:"on_tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>j(t)?t.isDark?0:100:Le(t)?D.foregroundTone(y.tertiaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>y.tertiaryContainer,contrastCurve:new S(3,4.5,7,11)});y.error=D.fromPalette({name:"error",palette:t=>t.errorPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>y.highestSurface(t),contrastCurve:new S(3,4.5,7,7),toneDeltaPair:t=>new oe(y.errorContainer,y.error,10,"nearer",!1)});y.onError=D.fromPalette({name:"on_error",palette:t=>t.errorPalette,tone:t=>t.isDark?20:100,background:t=>y.error,contrastCurve:new S(4.5,7,11,21)});y.errorContainer=D.fromPalette({name:"error_container",palette:t=>t.errorPalette,tone:t=>t.isDark?30:90,isBackground:!0,background:t=>y.highestSurface(t),contrastCurve:new S(1,1,3,4.5),toneDeltaPair:t=>new oe(y.errorContainer,y.error,10,"nearer",!1)});y.onErrorContainer=D.fromPalette({name:"on_error_container",palette:t=>t.errorPalette,tone:t=>j(t)?t.isDark?90:10:t.isDark?90:30,background:t=>y.errorContainer,contrastCurve:new S(3,4.5,7,11)});y.primaryFixed=D.fromPalette({name:"primary_fixed",palette:t=>t.primaryPalette,tone:t=>j(t)?40:90,isBackground:!0,background:t=>y.highestSurface(t),contrastCurve:new S(1,1,3,4.5),toneDeltaPair:t=>new oe(y.primaryFixed,y.primaryFixedDim,10,"lighter",!0)});y.primaryFixedDim=D.fromPalette({name:"primary_fixed_dim",palette:t=>t.primaryPalette,tone:t=>j(t)?30:80,isBackground:!0,background:t=>y.highestSurface(t),contrastCurve:new S(1,1,3,4.5),toneDeltaPair:t=>new oe(y.primaryFixed,y.primaryFixedDim,10,"lighter",!0)});y.onPrimaryFixed=D.fromPalette({name:"on_primary_fixed",palette:t=>t.primaryPalette,tone:t=>j(t)?100:10,background:t=>y.primaryFixedDim,secondBackground:t=>y.primaryFixed,contrastCurve:new S(4.5,7,11,21)});y.onPrimaryFixedVariant=D.fromPalette({name:"on_primary_fixed_variant",palette:t=>t.primaryPalette,tone:t=>j(t)?90:30,background:t=>y.primaryFixedDim,secondBackground:t=>y.primaryFixed,contrastCurve:new S(3,4.5,7,11)});y.secondaryFixed=D.fromPalette({name:"secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>j(t)?80:90,isBackground:!0,background:t=>y.highestSurface(t),contrastCurve:new S(1,1,3,4.5),toneDeltaPair:t=>new oe(y.secondaryFixed,y.secondaryFixedDim,10,"lighter",!0)});y.secondaryFixedDim=D.fromPalette({name:"secondary_fixed_dim",palette:t=>t.secondaryPalette,tone:t=>j(t)?70:80,isBackground:!0,background:t=>y.highestSurface(t),contrastCurve:new S(1,1,3,4.5),toneDeltaPair:t=>new oe(y.secondaryFixed,y.secondaryFixedDim,10,"lighter",!0)});y.onSecondaryFixed=D.fromPalette({name:"on_secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>10,background:t=>y.secondaryFixedDim,secondBackground:t=>y.secondaryFixed,contrastCurve:new S(4.5,7,11,21)});y.onSecondaryFixedVariant=D.fromPalette({name:"on_secondary_fixed_variant",palette:t=>t.secondaryPalette,tone:t=>j(t)?25:30,background:t=>y.secondaryFixedDim,secondBackground:t=>y.secondaryFixed,contrastCurve:new S(3,4.5,7,11)});y.tertiaryFixed=D.fromPalette({name:"tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>j(t)?40:90,isBackground:!0,background:t=>y.highestSurface(t),contrastCurve:new S(1,1,3,4.5),toneDeltaPair:t=>new oe(y.tertiaryFixed,y.tertiaryFixedDim,10,"lighter",!0)});y.tertiaryFixedDim=D.fromPalette({name:"tertiary_fixed_dim",palette:t=>t.tertiaryPalette,tone:t=>j(t)?30:80,isBackground:!0,background:t=>y.highestSurface(t),contrastCurve:new S(1,1,3,4.5),toneDeltaPair:t=>new oe(y.tertiaryFixed,y.tertiaryFixedDim,10,"lighter",!0)});y.onTertiaryFixed=D.fromPalette({name:"on_tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>j(t)?100:10,background:t=>y.tertiaryFixedDim,secondBackground:t=>y.tertiaryFixed,contrastCurve:new S(4.5,7,11,21)});y.onTertiaryFixedVariant=D.fromPalette({name:"on_tertiary_fixed_variant",palette:t=>t.tertiaryPalette,tone:t=>j(t)?90:30,background:t=>y.tertiaryFixedDim,secondBackground:t=>y.tertiaryFixed,contrastCurve:new S(3,4.5,7,11)});class X{static of(e){return new X(e,!1)}static contentOf(e){return new X(e,!0)}static fromColors(e){return X.createPaletteFromColors(!1,e)}static contentFromColors(e){return X.createPaletteFromColors(!0,e)}static createPaletteFromColors(e,n){const a=new X(n.primary,e);if(n.secondary){const o=new X(n.secondary,e);a.a2=o.a1}if(n.tertiary){const o=new X(n.tertiary,e);a.a3=o.a1}if(n.error){const o=new X(n.error,e);a.error=o.a1}if(n.neutral){const o=new X(n.neutral,e);a.n1=o.n1}if(n.neutralVariant){const o=new X(n.neutralVariant,e);a.n2=o.n2}return a}constructor(e,n){const a=U.fromInt(e),o=a.hue,s=a.chroma;n?(this.a1=ee.fromHueAndChroma(o,s),this.a2=ee.fromHueAndChroma(o,s/3),this.a3=ee.fromHueAndChroma(o+60,s/2),this.n1=ee.fromHueAndChroma(o,Math.min(s/12,4)),this.n2=ee.fromHueAndChroma(o,Math.min(s/6,8))):(this.a1=ee.fromHueAndChroma(o,Math.max(48,s)),this.a2=ee.fromHueAndChroma(o,16),this.a3=ee.fromHueAndChroma(o+60,24),this.n1=ee.fromHueAndChroma(o,4),this.n2=ee.fromHueAndChroma(o,8)),this.error=ee.fromHueAndChroma(25,84)}}class bn{fromInt(e){return hn(e)}toInt(e){return mn(e[0],e[1],e[2])}distance(e,n){const a=e[0]-n[0],o=e[1]-n[1],s=e[2]-n[2];return a*a+o*o+s*s}}const Cn=10,yn=3;class vn{static quantize(e,n,a){const o=new Map,s=new Array,i=new Array,c=new bn;let l=0;for(let v=0;v<e.length;v++){const P=e[v],f=o.get(P);f===void 0?(l++,s.push(c.fromInt(P)),i.push(P),o.set(P,1)):o.set(P,f+1)}const d=new Array;for(let v=0;v<l;v++){const P=i[v],f=o.get(P);f!==void 0&&(d[v]=f)}let u=Math.min(a,l);n.length>0&&(u=Math.min(u,n.length));const h=new Array;for(let v=0;v<n.length;v++)h.push(c.fromInt(n[v]));const w=u-h.length;if(n.length===0&&w>0)for(let v=0;v<w;v++){const P=Math.random()*100,f=Math.random()*201+-100,x=Math.random()*201+-100;h.push(new Array(P,f,x))}const k=new Array;for(let v=0;v<l;v++)k.push(Math.floor(Math.random()*u));const g=new Array;for(let v=0;v<u;v++){g.push(new Array);for(let P=0;P<u;P++)g[v].push(0)}const p=new Array;for(let v=0;v<u;v++){p.push(new Array);for(let P=0;P<u;P++)p[v].push(new wn)}const b=new Array;for(let v=0;v<u;v++)b.push(0);for(let v=0;v<Cn;v++){for(let M=0;M<u;M++){for(let B=M+1;B<u;B++){const T=c.distance(h[M],h[B]);p[B][M].distance=T,p[B][M].index=M,p[M][B].distance=T,p[M][B].index=B}p[M].sort();for(let B=0;B<u;B++)g[M][B]=p[M][B].index}let P=0;for(let M=0;M<l;M++){const B=s[M],T=k[M],$=h[T],N=c.distance(B,$);let A=N,H=-1;for(let R=0;R<u;R++){if(p[T][R].distance>=4*N)continue;const ie=c.distance(B,h[R]);ie<A&&(A=ie,H=R)}H!==-1&&Math.abs(Math.sqrt(A)-Math.sqrt(N))>yn&&(P++,k[M]=H)}if(P===0&&v!==0)break;const f=new Array(u).fill(0),x=new Array(u).fill(0),L=new Array(u).fill(0);for(let M=0;M<u;M++)b[M]=0;for(let M=0;M<l;M++){const B=k[M],T=s[M],$=d[M];b[B]+=$,f[B]+=T[0]*$,x[B]+=T[1]*$,L[B]+=T[2]*$}for(let M=0;M<u;M++){const B=b[M];if(B===0){h[M]=[0,0,0];continue}const T=f[M]/B,$=x[M]/B,N=L[M]/B;h[M]=[T,$,N]}}const m=new Map;for(let v=0;v<u;v++){const P=b[v];if(P===0)continue;const f=c.toInt(h[v]);m.has(f)||m.set(f,P)}return m}}class wn{constructor(){this.distance=-1,this.index=-1}}class Pn{static quantize(e){const n=new Map;for(let a=0;a<e.length;a++){const o=e[a];un(o)<255||n.set(o,(n.get(o)??0)+1)}return n}}const qe=5,ue=33,Ve=35937,Q={RED:"red",GREEN:"green",BLUE:"blue"};class Mn{constructor(e=[],n=[],a=[],o=[],s=[],i=[]){this.weights=e,this.momentsR=n,this.momentsG=a,this.momentsB=o,this.moments=s,this.cubes=i}quantize(e,n){this.constructHistogram(e),this.computeMoments();const a=this.createBoxes(n);return this.createResult(a.resultCount)}constructHistogram(e){this.weights=Array.from({length:Ve}).fill(0),this.momentsR=Array.from({length:Ve}).fill(0),this.momentsG=Array.from({length:Ve}).fill(0),this.momentsB=Array.from({length:Ve}).fill(0),this.moments=Array.from({length:Ve}).fill(0);const n=Pn.quantize(e);for(const[a,o]of n.entries()){const s=Je(a),i=Ke(a),c=Xe(a),l=8-qe,d=(s>>l)+1,u=(i>>l)+1,h=(c>>l)+1,w=this.getIndex(d,u,h);this.weights[w]=(this.weights[w]??0)+o,this.momentsR[w]+=o*s,this.momentsG[w]+=o*i,this.momentsB[w]+=o*c,this.moments[w]+=o*(s*s+i*i+c*c)}}computeMoments(){for(let e=1;e<ue;e++){const n=Array.from({length:ue}).fill(0),a=Array.from({length:ue}).fill(0),o=Array.from({length:ue}).fill(0),s=Array.from({length:ue}).fill(0),i=Array.from({length:ue}).fill(0);for(let c=1;c<ue;c++){let l=0,d=0,u=0,h=0,w=0;for(let k=1;k<ue;k++){const g=this.getIndex(e,c,k);l+=this.weights[g],d+=this.momentsR[g],u+=this.momentsG[g],h+=this.momentsB[g],w+=this.moments[g],n[k]+=l,a[k]+=d,o[k]+=u,s[k]+=h,i[k]+=w;const p=this.getIndex(e-1,c,k);this.weights[g]=this.weights[p]+n[k],this.momentsR[g]=this.momentsR[p]+a[k],this.momentsG[g]=this.momentsG[p]+o[k],this.momentsB[g]=this.momentsB[p]+s[k],this.moments[g]=this.moments[p]+i[k]}}}}createBoxes(e){this.cubes=Array.from({length:e}).fill(0).map(()=>new Bn);const n=Array.from({length:e}).fill(0);this.cubes[0].r0=0,this.cubes[0].g0=0,this.cubes[0].b0=0,this.cubes[0].r1=ue-1,this.cubes[0].g1=ue-1,this.cubes[0].b1=ue-1;let a=e,o=0;for(let s=1;s<e;s++){this.cut(this.cubes[o],this.cubes[s])?(n[o]=this.cubes[o].vol>1?this.variance(this.cubes[o]):0,n[s]=this.cubes[s].vol>1?this.variance(this.cubes[s]):0):(n[o]=0,s--),o=0;let i=n[0];for(let c=1;c<=s;c++)n[c]>i&&(i=n[c],o=c);if(i<=0){a=s+1;break}}return new In(e,a)}createResult(e){const n=[];for(let a=0;a<e;++a){const o=this.cubes[a],s=this.volume(o,this.weights);if(s>0){const i=Math.round(this.volume(o,this.momentsR)/s),c=Math.round(this.volume(o,this.momentsG)/s),l=Math.round(this.volume(o,this.momentsB)/s),d=255<<24|(i&255)<<16|(c&255)<<8|l&255;n.push(d)}}return n}variance(e){const n=this.volume(e,this.momentsR),a=this.volume(e,this.momentsG),o=this.volume(e,this.momentsB),s=this.moments[this.getIndex(e.r1,e.g1,e.b1)]-this.moments[this.getIndex(e.r1,e.g1,e.b0)]-this.moments[this.getIndex(e.r1,e.g0,e.b1)]+this.moments[this.getIndex(e.r1,e.g0,e.b0)]-this.moments[this.getIndex(e.r0,e.g1,e.b1)]+this.moments[this.getIndex(e.r0,e.g1,e.b0)]+this.moments[this.getIndex(e.r0,e.g0,e.b1)]-this.moments[this.getIndex(e.r0,e.g0,e.b0)],i=n*n+a*a+o*o,c=this.volume(e,this.weights);return s-i/c}cut(e,n){const a=this.volume(e,this.momentsR),o=this.volume(e,this.momentsG),s=this.volume(e,this.momentsB),i=this.volume(e,this.weights),c=this.maximize(e,Q.RED,e.r0+1,e.r1,a,o,s,i),l=this.maximize(e,Q.GREEN,e.g0+1,e.g1,a,o,s,i),d=this.maximize(e,Q.BLUE,e.b0+1,e.b1,a,o,s,i);let u;const h=c.maximum,w=l.maximum,k=d.maximum;if(h>=w&&h>=k){if(c.cutLocation<0)return!1;u=Q.RED}else w>=h&&w>=k?u=Q.GREEN:u=Q.BLUE;switch(n.r1=e.r1,n.g1=e.g1,n.b1=e.b1,u){case Q.RED:e.r1=c.cutLocation,n.r0=e.r1,n.g0=e.g0,n.b0=e.b0;break;case Q.GREEN:e.g1=l.cutLocation,n.r0=e.r0,n.g0=e.g1,n.b0=e.b0;break;case Q.BLUE:e.b1=d.cutLocation,n.r0=e.r0,n.g0=e.g0,n.b0=e.b1;break;default:throw new Error("unexpected direction "+u)}return e.vol=(e.r1-e.r0)*(e.g1-e.g0)*(e.b1-e.b0),n.vol=(n.r1-n.r0)*(n.g1-n.g0)*(n.b1-n.b0),!0}maximize(e,n,a,o,s,i,c,l){const d=this.bottom(e,n,this.momentsR),u=this.bottom(e,n,this.momentsG),h=this.bottom(e,n,this.momentsB),w=this.bottom(e,n,this.weights);let k=0,g=-1,p=0,b=0,m=0,v=0;for(let P=a;P<o;P++){if(p=d+this.top(e,n,P,this.momentsR),b=u+this.top(e,n,P,this.momentsG),m=h+this.top(e,n,P,this.momentsB),v=w+this.top(e,n,P,this.weights),v===0)continue;let f=(p*p+b*b+m*m)*1,x=v*1,L=f/x;p=s-p,b=i-b,m=c-m,v=l-v,v!==0&&(f=(p*p+b*b+m*m)*1,x=v*1,L+=f/x,L>k&&(k=L,g=P))}return new Dn(g,k)}volume(e,n){return n[this.getIndex(e.r1,e.g1,e.b1)]-n[this.getIndex(e.r1,e.g1,e.b0)]-n[this.getIndex(e.r1,e.g0,e.b1)]+n[this.getIndex(e.r1,e.g0,e.b0)]-n[this.getIndex(e.r0,e.g1,e.b1)]+n[this.getIndex(e.r0,e.g1,e.b0)]+n[this.getIndex(e.r0,e.g0,e.b1)]-n[this.getIndex(e.r0,e.g0,e.b0)]}bottom(e,n,a){switch(n){case Q.RED:return-a[this.getIndex(e.r0,e.g1,e.b1)]+a[this.getIndex(e.r0,e.g1,e.b0)]+a[this.getIndex(e.r0,e.g0,e.b1)]-a[this.getIndex(e.r0,e.g0,e.b0)];case Q.GREEN:return-a[this.getIndex(e.r1,e.g0,e.b1)]+a[this.getIndex(e.r1,e.g0,e.b0)]+a[this.getIndex(e.r0,e.g0,e.b1)]-a[this.getIndex(e.r0,e.g0,e.b0)];case Q.BLUE:return-a[this.getIndex(e.r1,e.g1,e.b0)]+a[this.getIndex(e.r1,e.g0,e.b0)]+a[this.getIndex(e.r0,e.g1,e.b0)]-a[this.getIndex(e.r0,e.g0,e.b0)];default:throw new Error("unexpected direction $direction")}}top(e,n,a,o){switch(n){case Q.RED:return o[this.getIndex(a,e.g1,e.b1)]-o[this.getIndex(a,e.g1,e.b0)]-o[this.getIndex(a,e.g0,e.b1)]+o[this.getIndex(a,e.g0,e.b0)];case Q.GREEN:return o[this.getIndex(e.r1,a,e.b1)]-o[this.getIndex(e.r1,a,e.b0)]-o[this.getIndex(e.r0,a,e.b1)]+o[this.getIndex(e.r0,a,e.b0)];case Q.BLUE:return o[this.getIndex(e.r1,e.g1,a)]-o[this.getIndex(e.r1,e.g0,a)]-o[this.getIndex(e.r0,e.g1,a)]+o[this.getIndex(e.r0,e.g0,a)];default:throw new Error("unexpected direction $direction")}}getIndex(e,n,a){return(e<<qe*2)+(e<<qe+1)+e+(n<<qe)+n+a}}class Bn{constructor(e=0,n=0,a=0,o=0,s=0,i=0,c=0){this.r0=e,this.r1=n,this.g0=a,this.g1=o,this.b0=s,this.b1=i,this.vol=c}}class In{constructor(e,n){this.requestedCount=e,this.resultCount=n}}class Dn{constructor(e,n){this.cutLocation=e,this.maximum=n}}class xn{static quantize(e,n){const a=new Mn().quantize(e,n);return vn.quantize(e,a,n)}}class pe{get primary(){return this.props.primary}get onPrimary(){return this.props.onPrimary}get primaryContainer(){return this.props.primaryContainer}get onPrimaryContainer(){return this.props.onPrimaryContainer}get secondary(){return this.props.secondary}get onSecondary(){return this.props.onSecondary}get secondaryContainer(){return this.props.secondaryContainer}get onSecondaryContainer(){return this.props.onSecondaryContainer}get tertiary(){return this.props.tertiary}get onTertiary(){return this.props.onTertiary}get tertiaryContainer(){return this.props.tertiaryContainer}get onTertiaryContainer(){return this.props.onTertiaryContainer}get error(){return this.props.error}get onError(){return this.props.onError}get errorContainer(){return this.props.errorContainer}get onErrorContainer(){return this.props.onErrorContainer}get background(){return this.props.background}get onBackground(){return this.props.onBackground}get surface(){return this.props.surface}get onSurface(){return this.props.onSurface}get surfaceVariant(){return this.props.surfaceVariant}get onSurfaceVariant(){return this.props.onSurfaceVariant}get outline(){return this.props.outline}get outlineVariant(){return this.props.outlineVariant}get shadow(){return this.props.shadow}get scrim(){return this.props.scrim}get inverseSurface(){return this.props.inverseSurface}get inverseOnSurface(){return this.props.inverseOnSurface}get inversePrimary(){return this.props.inversePrimary}static light(e){return pe.lightFromCorePalette(X.of(e))}static dark(e){return pe.darkFromCorePalette(X.of(e))}static lightContent(e){return pe.lightFromCorePalette(X.contentOf(e))}static darkContent(e){return pe.darkFromCorePalette(X.contentOf(e))}static lightFromCorePalette(e){return new pe({primary:e.a1.tone(40),onPrimary:e.a1.tone(100),primaryContainer:e.a1.tone(90),onPrimaryContainer:e.a1.tone(10),secondary:e.a2.tone(40),onSecondary:e.a2.tone(100),secondaryContainer:e.a2.tone(90),onSecondaryContainer:e.a2.tone(10),tertiary:e.a3.tone(40),onTertiary:e.a3.tone(100),tertiaryContainer:e.a3.tone(90),onTertiaryContainer:e.a3.tone(10),error:e.error.tone(40),onError:e.error.tone(100),errorContainer:e.error.tone(90),onErrorContainer:e.error.tone(10),background:e.n1.tone(99),onBackground:e.n1.tone(10),surface:e.n1.tone(99),onSurface:e.n1.tone(10),surfaceVariant:e.n2.tone(90),onSurfaceVariant:e.n2.tone(30),outline:e.n2.tone(50),outlineVariant:e.n2.tone(80),shadow:e.n1.tone(0),scrim:e.n1.tone(0),inverseSurface:e.n1.tone(20),inverseOnSurface:e.n1.tone(95),inversePrimary:e.a1.tone(80)})}static darkFromCorePalette(e){return new pe({primary:e.a1.tone(80),onPrimary:e.a1.tone(20),primaryContainer:e.a1.tone(30),onPrimaryContainer:e.a1.tone(90),secondary:e.a2.tone(80),onSecondary:e.a2.tone(20),secondaryContainer:e.a2.tone(30),onSecondaryContainer:e.a2.tone(90),tertiary:e.a3.tone(80),onTertiary:e.a3.tone(20),tertiaryContainer:e.a3.tone(30),onTertiaryContainer:e.a3.tone(90),error:e.error.tone(80),onError:e.error.tone(20),errorContainer:e.error.tone(30),onErrorContainer:e.error.tone(80),background:e.n1.tone(10),onBackground:e.n1.tone(90),surface:e.n1.tone(10),onSurface:e.n1.tone(90),surfaceVariant:e.n2.tone(30),onSurfaceVariant:e.n2.tone(80),outline:e.n2.tone(60),outlineVariant:e.n2.tone(30),shadow:e.n1.tone(0),scrim:e.n1.tone(0),inverseSurface:e.n1.tone(90),inverseOnSurface:e.n1.tone(20),inversePrimary:e.a1.tone(40)})}constructor(e){this.props=e}toJSON(){return{...this.props}}}const _n={desired:4,fallbackColorARGB:4282549748,filter:!0};function En(t,e){return t.score>e.score?-1:t.score<e.score?1:0}class te{constructor(){}static score(e,n){const{desired:a,fallbackColorARGB:o,filter:s}={..._n,...n},i=[],c=new Array(360).fill(0);let l=0;for(const[k,g]of e.entries()){const p=U.fromInt(k);i.push(p);const b=Math.floor(p.hue);c[b]+=g,l+=g}const d=new Array(360).fill(0);for(let k=0;k<360;k++){const g=c[k]/l;for(let p=k-14;p<k+16;p++){const b=Mt(p);d[b]+=g}}const u=new Array;for(const k of i){const g=Mt(Math.round(k.hue)),p=d[g];if(s&&(k.chroma<te.CUTOFF_CHROMA||p<=te.CUTOFF_EXCITED_PROPORTION))continue;const b=p*100*te.WEIGHT_PROPORTION,m=k.chroma<te.TARGET_CHROMA?te.WEIGHT_CHROMA_BELOW:te.WEIGHT_CHROMA_ABOVE,v=(k.chroma-te.TARGET_CHROMA)*m,P=b+v;u.push({hct:k,score:P})}u.sort(En);const h=[];for(let k=90;k>=15;k--){h.length=0;for(const{hct:g}of u)if(h.find(p=>Vt(g.hue,p.hue)<k)||h.push(g),h.length>=a)break;if(h.length>=a)break}const w=[];h.length===0&&w.push(o);for(const k of h)w.push(k.toInt());return w}}te.TARGET_CHROMA=48;te.WEIGHT_PROPORTION=.7;te.WEIGHT_CHROMA_ABOVE=.3;te.WEIGHT_CHROMA_BELOW=.1;te.CUTOFF_CHROMA=5;te.CUTOFF_EXCITED_PROPORTION=.01;function F(t){const e=Je(t),n=Ke(t),a=Xe(t),o=[e.toString(16),n.toString(16),a.toString(16)];for(const[s,i]of o.entries())i.length===1&&(o[s]="0"+i);return"#"+o.join("")}function Tn(t){t=t.replace("#","");const e=t.length===3,n=t.length===6,a=t.length===8;if(!e&&!n&&!a)throw new Error("unexpected hex "+t);let o=0,s=0,i=0;return e?(o=fe(t.slice(0,1).repeat(2)),s=fe(t.slice(1,2).repeat(2)),i=fe(t.slice(2,3).repeat(2))):n?(o=fe(t.slice(0,2)),s=fe(t.slice(2,4)),i=fe(t.slice(4,6))):a&&(o=fe(t.slice(2,4)),s=fe(t.slice(4,6)),i=fe(t.slice(6,8))),(255<<24|(o&255)<<16|(s&255)<<8|i&255)>>>0}function fe(t){return parseInt(t,16)}async function Ln(t){const e=await new Promise((o,s)=>{const i=document.createElement("canvas"),c=i.getContext("2d");if(!c){s(new Error("Could not get canvas context"));return}const l=()=>{i.width=t.width,i.height=t.height,c.drawImage(t,0,0);let u=[0,0,t.width,t.height];const h=t.dataset.area;h&&/^\d+(\s*,\s*\d+){3}$/.test(h)&&(u=h.split(/\s*,\s*/).map(b=>parseInt(b,10)));const[w,k,g,p]=u;o(c.getImageData(w,k,g,p).data)},d=()=>{s(new Error("Image load failed"))};t.complete?l():(t.onload=l,t.onerror=d)}),n=[];for(let o=0;o<e.length;o+=4){const s=e[o],i=e[o+1],c=e[o+2];if(e[o+3]<255)continue;const l=Ye(s,i,c);n.push(l)}const a=xn.quantize(n,128);return te.score(a)[0]}function At(t,e=[]){const n=X.of(t);return{source:t,schemes:{light:pe.light(t),dark:pe.dark(t)},palettes:{primary:n.a1,secondary:n.a2,tertiary:n.a3,neutral:n.n1,neutralVariant:n.n2,error:n.error},customColors:e.map(a=>Vn(t,a))}}async function It(t,e=[]){const n=await Ln(t);return At(n,e)}function Vn(t,e){let n=e.value;const a=n,o=t;e.blend&&(n=pt.harmonize(a,o));const s=X.of(n).a1;return{color:e,value:n,light:{color:s.tone(40),onColor:s.tone(100),colorContainer:s.tone(90),onColorContainer:s.tone(10)},dark:{color:s.tone(80),onColor:s.tone(20),colorContainer:s.tone(30),onColorContainer:s.tone(90)}}}function nt(t){let e=JSON.parse(JSON.stringify(t.schemes));for(let n in e)for(let a in e[n])e[n][a]=F(e[n][a]);return e.dark.surfaceDim=F(t.palettes.neutral.tone(6)),e.dark.surface=F(t.palettes.neutral.tone(6)),e.dark.surfaceBright=F(t.palettes.neutral.tone(24)),e.dark.surfaceContainerLowest=F(t.palettes.neutral.tone(4)),e.dark.surfaceContainerLow=F(t.palettes.neutral.tone(10)),e.dark.surfaceContainer=F(t.palettes.neutral.tone(12)),e.dark.surfaceContainerHigh=F(t.palettes.neutral.tone(17)),e.dark.surfaceContainerHighest=F(t.palettes.neutral.tone(22)),e.dark.onSurface=F(t.palettes.neutral.tone(90)),e.dark.onSurfaceVariant=F(t.palettes.neutralVariant.tone(80)),e.dark.outline=F(t.palettes.neutralVariant.tone(60)),e.dark.outlineVariant=F(t.palettes.neutralVariant.tone(30)),e.light.surfaceDim=F(t.palettes.neutral.tone(87)),e.light.surface=F(t.palettes.neutral.tone(98)),e.light.surfaceBright=F(t.palettes.neutral.tone(98)),e.light.surfaceContainerLowest=F(t.palettes.neutral.tone(100)),e.light.surfaceContainerLow=F(t.palettes.neutral.tone(96)),e.light.surfaceContainer=F(t.palettes.neutral.tone(94)),e.light.surfaceContainerHigh=F(t.palettes.neutral.tone(92)),e.light.surfaceContainerHighest=F(t.palettes.neutral.tone(90)),e.light.onSurface=F(t.palettes.neutral.tone(10)),e.light.onSurfaceVariant=F(t.palettes.neutralVariant.tone(30)),e.light.outline=F(t.palettes.neutralVariant.tone(50)),e.light.outlineVariant=F(t.palettes.neutralVariant.tone(80)),e}async function Sn(t){const e=t,n={light:{},dark:{}};try{if(typeof e=="string"&&/^\#[0-9a-f]+$/i.test(e)){let i=At(Tn(e));return nt(i)}if(e.src){let i=await It(e);return nt(i)}let a=new Blob;if(typeof e=="string"&&(a=await fetch(e).then(i=>i.blob())),e.size&&(a=e),e.files&&e.files[0]&&(a=e.files[0]),e.target&&e.target.files&&e.target.files[0]&&(a=e.target.files[0]),!a.size)return n;let o=new Image(64);o.src=URL.createObjectURL(a);let s=await It(o);return nt(s)}catch{return n}}globalThis.materialDynamicColors=Sn;const $n=globalThis.materialDynamicColors,kt=Symbol("liftkit-theme"),Nt={primary:"#004ee7",onPrimary:"#ffffff",primaryContainer:"#dce1ff",onPrimaryContainer:"#001550",secondary:"#595d72",onSecondary:"#ffffff",secondaryContainer:"#dee1f9",onSecondaryContainer:"#161b2c",tertiary:"#75546f",onTertiary:"#ffffff",tertiaryContainer:"#ffd7f5",onTertiaryContainer:"#2c122a",error:"#ba1a1a",onError:"#ffffff",errorContainer:"#ffdad6",onErrorContainer:"#410002",background:"#fefbff",onBackground:"#1b1b1f",surface:"#fbf8fd",onSurface:"#1b1b1f",surfaceVariant:"#e2e1ec",onSurfaceVariant:"#45464f",outline:"#767680",outlineVariant:"#c6c5d0",shadow:"#000000",scrim:"#000000",inverseSurface:"#303034",inverseOnSurface:"#f2f0f4",inversePrimary:"#b6c4ff",surfaceDim:"#dbd9de",surfaceBright:"#fbf8fd",surfaceContainerLowest:"#ffffff",surfaceContainerLow:"#f5f3f7",surfaceContainer:"#efedf1",surfaceContainerHigh:"#eae7ec",surfaceContainerHighest:"#e4e1e6",warning:"#e3aa00",onWarning:"#281b00",warningContainer:"#ffdfa0",onWarningContainer:"#261a00",success:"#41ca82",onSuccess:"#002311",successContainer:"#77fbae",onSuccessContainer:"#002110",info:"#9bb0ff",onInfo:"#001754",infoContainer:"#dce1ff",onInfoContainer:"#001550"},An={...Nt},Nn={primary:"#035eff",secondary:"#badcff",tertiary:"#00ddfe",neutral:"#000000",neutralvariant:"#3f4f5b",error:"#dd305c",warning:"#feb600",success:"#0cfecd",info:"#175bfc"};function O(t){return t?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():""}class Fn{constructor(e,n){const a=Z.fromHueAndChroma(e,n);for(let o=1;o<=99;o++)this[`_${o}`]=Lt(a.tone(o))}}function Ft(t){const e=r.ref({light:{...Nt},dark:{...An}}),n=r.ref({...Nn,...t}),a=r.ref("auto"),o=r.ref("light");function s(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function i(){o.value=a.value==="auto"?s():a.value}function c(g){a.value=g,i()}let l=null;function d(){a.value==="auto"&&i()}async function u(g){const p={...e.value.light},b={...e.value.dark};Object.keys(g).forEach(m=>{const v=tt(g[m]),P=q.fromInt(v),f=new Fn(P.hue,P.chroma);switch(m){case"neutral":Object.assign(p,{background:f._99,onBackground:f._10,surfaceDim:f._87,surface:f._98,surfaceBright:f._98,surfaceContainerLowest:"white",surfaceContainerLow:f._96,surfaceContainer:f._94,surfaceContainerHigh:f._92,surfaceContainerHighest:f._90,onSurface:f._10,inverseSurface:f._20,inverseOnSurface:f._95}),Object.assign(b,{background:f._10,onBackground:f._85,surfaceContainerLowest:f._4,surfaceDim:f._6,surface:f._6,surfaceContainerLow:f._10,surfaceContainer:f._12,surfaceContainerHigh:f._17,surfaceContainerHighest:f._22,surfaceBright:f._24,onSurface:f._90,inverseSurface:f._98,inverseOnSurface:f._10});break;case"neutralvariant":Object.assign(p,{surfaceVariant:f._80,onSurfaceVariant:f._40,outline:f._60,outlineVariant:f._90}),Object.assign(b,{surfaceVariant:f._20,onSurfaceVariant:f._60,outline:f._50,outlineVariant:f._30});break;case"primary":Object.assign(p,{[m]:f._40,[`on${O(m)}`]:f._98,[`${m}Container`]:f._90,[`on${O(m)}Container`]:f._10,[`${m}Fixed`]:f._90,[`${m}FixedDim`]:f._80,[`on${O(m)}Fixed`]:f._10,[`on${O(m)}FixedVariant`]:f._30,inversePrimary:f._80}),Object.assign(b,{[m]:f._80,[`on${O(m)}`]:f._20,[`${m}Container`]:f._30,[`on${O(m)}Container`]:f._90,[`${m}Fixed`]:f._90,[`${m}FixedDim`]:f._80,[`on${O(m)}Fixed`]:f._10,[`on${O(m)}FixedVariant`]:f._30,inversePrimary:f._80});break;case"secondary":case"tertiary":Object.assign(p,{[m]:f._40,[`on${O(m)}`]:f._98,[`${m}Container`]:f._90,[`on${O(m)}Container`]:f._10,[`${m}Fixed`]:f._90,[`${m}FixedDim`]:f._80,[`on${O(m)}Fixed`]:f._10,[`on${O(m)}FixedVariant`]:f._30}),Object.assign(b,{[m]:f._80,[`on${O(m)}`]:f._20,[`${m}Container`]:f._30,[`on${O(m)}Container`]:f._90,[`${m}Fixed`]:f._90,[`${m}FixedDim`]:f._80,[`on${O(m)}Fixed`]:f._10,[`on${O(m)}FixedVariant`]:f._30}),Object.assign(p,{[m]:f._40,[`on${O(m)}`]:f._98,[`${m}Container`]:f._90,[`on${O(m)}Container`]:f._10}),Object.assign(b,{[m]:f._80,[`on${O(m)}`]:f._20,[`${m}Container`]:f._30,[`on${O(m)}Container`]:f._90});break;default:Object.assign(p,{[m]:f._40,[`on${O(m)}`]:f._98,[`${m}Container`]:f._90,[`on${O(m)}Container`]:f._10}),Object.assign(b,{[m]:f._80,[`on${O(m)}`]:f._20,[`${m}Container`]:f._30,[`on${O(m)}Container`]:f._90})}}),e.value={light:p,dark:b}}async function h(g){const p={};try{const b=await $n(g);p.primary=b.light.primary,p.secondary=b.light.secondary,p.tertiary=b.light.tertiary,p.neutral=b.light.surfaceContainer;const m={info:{color:"#175bfc",name:"info"},warning:{color:"#ffbf00",name:"warning"},success:{color:"#42cb83",name:"success"}};Object.keys(m).forEach(v=>{const P=tt(g),f={value:tt(m[v].color),blend:!0,name:m[v].name},x=on(P,f),L=Lt(x.value);p[v]=L}),n.value={...n.value,...p}}catch(b){console.error(b)}}function w(){if(typeof document>"u")return;const g=document.documentElement;Object.keys(e.value.light).forEach(p=>{g.style.setProperty(`--light__${p.toLowerCase()}_lkv`,e.value.light[p])}),Object.keys(e.value.dark).forEach(p=>{g.style.setProperty(`--dark__${p.toLowerCase()}_lkv`,e.value.dark[p])}),o.value==="dark"&&Object.keys(e.value.dark).forEach(p=>{g.style.setProperty(`--light__${p.toLowerCase()}_lkv`,e.value.dark[p])})}r.watch([e,o],w,{deep:!0}),r.onMounted(()=>{typeof window<"u"&&(l=window.matchMedia("(prefers-color-scheme: dark)"),l.addEventListener("change",d),i()),u(n.value)}),r.onUnmounted(()=>{l&&(l.removeEventListener("change",d),l=null)}),r.watch(n,g=>{u(g)},{deep:!0});const k={theme:e,updateTheme:u,updateThemeFromMaster:h,palette:n,colorMode:o,colorModePreference:a,setColorMode:c};return r.provide(kt,k),k}function Ot(){const t=r.inject(kt);if(!t)throw new Error("useTheme() must be used inside a component wrapped with provideTheme()");return t}const bt=Symbol("liftkit-dropdown");let _e=null;function On(t){_e&&_e!==t&&_e.close(),_e=t}function Dt(t){_e===t&&(_e=null)}function Rt(){const t=r.ref(!1),e=r.ref(null),n=r.ref(null);let a=null;function o(d){t.value=d,d&&a?On(a):!d&&a&&Dt(a)}function s(){o(!t.value)}function i(d){n.value&&!n.value.contains(d.target)&&e.value&&!e.value.contains(d.target)&&o(!1)}function c(d){var u;d.key==="Escape"&&t.value&&(o(!1),(u=e.value)==null||u.focus())}r.onMounted(()=>{a={close:()=>o(!1)},document.addEventListener("mousedown",i),document.addEventListener("keydown",c)}),r.onBeforeUnmount(()=>{a&&Dt(a),document.removeEventListener("mousedown",i),document.removeEventListener("keydown",c)});const l={open:t,setOpen:o,toggle:s,triggerRef:e,contentRef:n};return r.provide(bt,l),l}function Ct(){const t=r.inject(bt);if(!t)throw new Error("useDropdown() must be used inside a Dropdown component");return t}const zt=["primary","onprimary","primarycontainer","onprimarycontainer","secondary","onsecondary","secondarycontainer","onsecondarycontainer","tertiary","ontertiary","tertiarycontainer","ontertiarycontainer","error","onerror","errorcontainer","onerrorcontainer","background","onbackground","surface","onsurface","surfacevariant","onsurfacevariant","shadow","inversesurface","scrim","inverseonsurface","inverseprimary","success","onsuccess","successcontainer","onsuccesscontainer","warning","onwarning","warningcontainer","onwarningcontainer","info","oninfo","infocontainer","oninfocontainer","primaryfixed","onprimaryfixed","primaryfixeddim","onprimaryfixedvariant","secondaryfixed","onsecondaryfixed","secondaryfixeddim","onsecondaryfixedvariant","tertiaryfixed","ontertiaryfixed","tertiaryfixeddim","ontertiaryfixedvariant","surfacedim","surfacebright","surfacecontainerlowest","surfacecontainerlow","surfacecontainer","surfacecontainerhigh","surfacecontainerhighest","outline","outlinevariant"],Rn=["primary","secondary","tertiary","error","warning","info","success","primarycontainer","secondarycontainer","tertiarycontainer","errorcontainer","warningcontainer","infocontainer","successcontainer","surface","surfacecontainerlowest","surfacecontainerlow","surfacecontainerhigh","surfacecontainerhighest","surfacevariant","inversesurface","background"],zn=["primary","primarycontainer","secondary","secondarycontainer","tertiary","tertiarycontainer","error","errorcontainer","success","successcontainer","warning","warningcontainer","info","infocontainer","background","surface","surfacevariant","surfacecontainerlowest","surfacecontainerlow","surfacecontainer","surfacecontainerhigh","surfacecontainerhighest","inversesurface","primaryfixed","secondaryfixed","tertiaryfixed"];function jn(){return zt.filter(t=>!zn.includes(t))}function we(t){const e=t.startsWith("on")||t.startsWith("inverseon"),n=t.startsWith("on"),a=t.endsWith("fixed"),o=t.endsWith("dim"),s=t.endsWith("variant");function i(l){switch(a){case!0:switch(n){case!0:return l.slice(2);case!1:return`on${l}`}case!1:switch(o){case!0:return`on${l.slice(0,-3)}variant`;case!1:switch(s){case!0:return`on${l.slice(0,-8)}fixed`;case!1:return`on${l}`}}}}var c;switch(e){case!1:switch(t){case"surfacecontainerlowest":case"surfacecontainerlow":case"surfacecontainer":case"surfacecontainerhigh":case"surfacecontainerhighest":case"surfacedim":case"surfacebright":c="onsurface";break;case"inversesurface":c="inverseonsurface";break;case"inverseprimary":c="onprimarycontainer";break;case"shadow":case"scrim":c="white";break;case"primaryfixeddim":case"secondaryfixeddim":case"tertiaryfixeddim":case"onprimaryfixed":case"onsecondaryfixed":case"ontertiaryfixed":case"onprimaryfixedvariant":case"onsecondaryfixedvariant":case"ontertiaryfixedvariant":c=i(t);break;case"outline":case"outlinevariant":c="onsurfacevariant";break;default:c=`on${t}`;break}break;default:switch(t){case"inverseonsurface":c="inversesurface";break;default:c=t.slice(2)}}return c}function W(t,e){const n={};return Object.entries(t).forEach(([a,o])=>{if(o==null||typeof o=="function"||typeof o=="object")return;const s=a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();n[`data-lk-${e}-${s}`]=String(o)}),n}const Hn=r.defineComponent({__name:"LkTheme",props:{sourceColor:{default:void 0},colorMode:{default:"auto"},palette:{default:void 0}},setup(t,{expose:e}){const n=t,a=r.computed(()=>{const s={};return n.palette&&Object.assign(s,n.palette),s}),o=Ft(a.value);return o.setColorMode(n.colorMode),n.sourceColor&&o.updateThemeFromMaster(n.sourceColor),e({theme:o}),(s,i)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:"lk-theme"},s.$attrs),[r.renderSlot(s.$slots,"default")],16))}}),qn={key:0,class:"position-fixed",style:{zIndex:1e3}},Un={key:0,class:"lk-theme-drawer"},Wn={class:"lk-theme-drawer-card shadow-lg mb-2xl"},Gn={class:"lk-theme-drawer-scroll"},Yn={class:"lk-column",style:{gap:"var(--lk-size-md)"}},Jn={class:"lk-row",style:{"align-items":"center","justify-content":"space-between"}},Kn={xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",style:{display:"block"}},Xn={class:"lk-theme-code-block position-relative"},Zn={style:{"font-size":"0.618em",overflow:"auto"}},Qn={xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",style:{display:"block"}},er={class:"caption color-onsurfacevariant mb-xs"},tr={class:"lk-row",style:{gap:"var(--lk-size-xs)"}},nr=["onClick"],rr={class:"lk-row",style:{"align-items":"start",gap:"var(--lk-size-md)"}},ar=["name","value","onInput"],or={class:"lk-column"},sr=["for"],ir={class:"caption color-onsurfacevariant mb-xs"},cr=["name","value","onInput"],lr={class:"lk-column"},ur=["for"],dr={class:"caption color-onsurfacevariant mb-xs"},mr=["name","value","onInput"],hr={class:"lk-column"},fr=["for"],pr={class:"caption color-onsurfacevariant mb-xs"},gr=r.defineComponent({__name:"LkThemeController",setup(t){const{palette:e,updateTheme:n,updateThemeFromMaster:a,colorMode:o,colorModePreference:s,setColorMode:i}=Ot(),c=["primary","secondary","tertiary"],l=["error","warning","success","info"],d=["neutral","neutralvariant"];r.computed(()=>Object.keys(e.value).map(p=>({key:p,value:e.value[p]})));const u=r.ref(!1);function h(p,b){p==="master"?a(b):e.value={...e.value,[p]:b}}function w(p){i(p)}async function k(){try{const p=`const palette = ${JSON.stringify(e.value,null,2)}
272
+ const colorMode = '${o.value}'`;await navigator.clipboard.writeText(p),alert("Code copied")}catch(p){console.error("Failed to copy palette:",p)}}function g(p){return{primary:"Main brand color, used for most UI elements.",secondary:"Desaturated variant of primary.",tertiary:"Your accent color. Defaults to complementary hue to primary.",error:"A pink or red, indicating problems.",warning:"An orange or yellow, indicating caution.",success:"A green, indicating success.",info:"A blue, indicating neutral information.",neutral:"Backgrounds, surfaces, outlines, and default text color",neutralvariant:"Surface variant, outline variant, and text color variant"}[p]||""}return(p,b)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[u.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",qn,[r.createElementVNode("button",{class:"lk-theme-controller-trigger shadow-xl",style:{position:"fixed",zIndex:1e3,top:"var(--lk-size-xs)",left:"var(--lk-size-xs)"},onClick:b[0]||(b[0]=m=>u.value=!0)},[...b[3]||(b[3]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"2 2 20 20",fill:"currentColor"},[r.createElementVNode("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10a2.5 2.5 0 0 0 2.5-2.5c0-.61-.23-1.21-.64-1.67a.528.528 0 0 1-.13-.33c0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9m-5.5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m3-4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m3 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})],-1)])])])),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[u.value?(r.openBlock(),r.createElementBlock("div",Un,[r.createElementVNode("div",Wn,[r.createElementVNode("div",Gn,[r.createElementVNode("div",Yn,[r.createElementVNode("div",Jn,[b[5]||(b[5]=r.createElementVNode("h2",{class:"body-bold"},"Theme Controller",-1)),r.createElementVNode("button",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:"#e8e0e5",border:"none",borderRadius:"50%",width:"36px",height:"36px",cursor:"pointer",padding:"0"},onClick:b[1]||(b[1]=m=>u.value=!1),"aria-label":"Close"},[(r.openBlock(),r.createElementBlock("svg",Kn,[...b[4]||(b[4]=[r.createElementVNode("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",fill:"#1b1b1f"},null,-1)])]))])]),r.createElementVNode("div",null,[b[7]||(b[7]=r.createElementVNode("h2",{class:"label mb-xs"},"Config",-1)),b[8]||(b[8]=r.createElementVNode("p",{class:"caption color-onsurfacevariant mb-xs"}," Copy and paste this snippet into your theme config to update your project to match the current configuration. ",-1)),r.createElementVNode("div",Xn,[r.createElementVNode("pre",Zn,"const palette = "+r.toDisplayString(JSON.stringify(r.unref(e),null,2))+`
273
+ const colorMode = '`+r.toDisplayString(r.unref(o))+"'",1),r.createElementVNode("button",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:"#e8e0e5",border:"none",borderRadius:"50%",width:"36px",height:"36px",cursor:"pointer",padding:"0",position:"absolute",top:"1em",right:"1em"},onClick:k},[(r.openBlock(),r.createElementBlock("svg",Qn,[...b[6]||(b[6]=[r.createElementVNode("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",fill:"#1b1b1f"},null,-1)])]))])])]),r.createElementVNode("div",null,[b[9]||(b[9]=r.createElementVNode("h2",{class:"capline mb-lg color-onsurfacevariant"},"Mode",-1)),r.createElementVNode("p",er," Current: "+r.toDisplayString(r.unref(o))+" "+r.toDisplayString(r.unref(s)==="auto"?"(auto)":""),1),r.createElementVNode("div",tr,[(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(["auto","light","dark"],m=>r.createElementVNode("button",{key:m,class:r.normalizeClass(["lk-mode-button",{active:r.unref(s)===m}]),onClick:v=>w(m)},r.toDisplayString(m),11,nr)),64))])]),r.createElementVNode("div",null,[b[11]||(b[11]=r.createElementVNode("h2",{class:"capline mb-lg color-onsurfacevariant"},"Globals",-1)),r.createElementVNode("div",rr,[r.createElementVNode("input",{type:"color",name:"master",class:"lk-color-input",onInput:b[2]||(b[2]=m=>h("master",m.target.value))},null,32),b[10]||(b[10]=r.createElementVNode("div",{class:"lk-column"},[r.createElementVNode("label",{class:"label mb-xs",for:"master"},"master"),r.createElementVNode("p",{class:"caption color-onsurfacevariant mb-xs"},[r.createTextVNode(" The seed color. "),r.createElementVNode("strong",{class:"color-error"},"If you edit this, all other color tokens will reset.")])],-1))])]),r.createElementVNode("div",null,[b[12]||(b[12]=r.createElementVNode("h2",{class:"capline mb-lg color-onsurfacevariant"},"Brand",-1)),(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(c,m=>r.createElementVNode("div",{key:m,class:"lk-row mb-sm",style:{"align-items":"start",gap:"var(--lk-size-md)"}},[r.createElementVNode("input",{type:"color",name:m,value:r.unref(e)[m],class:"lk-color-input",onInput:v=>h(m,v.target.value)},null,40,ar),r.createElementVNode("div",or,[r.createElementVNode("label",{class:"caption-bold mono mb-2xs",for:m},r.toDisplayString(m),9,sr),r.createElementVNode("p",ir,r.toDisplayString(g(m)),1)])])),64))]),r.createElementVNode("div",null,[b[13]||(b[13]=r.createElementVNode("h2",{class:"capline color-onsurfacevariant mb-lg"},"Semantic",-1)),(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(l,m=>r.createElementVNode("div",{key:m,class:"lk-row mb-sm",style:{"align-items":"start",gap:"var(--lk-size-md)"}},[r.createElementVNode("input",{type:"color",name:m,value:r.unref(e)[m],class:"lk-color-input",onInput:v=>h(m,v.target.value)},null,40,cr),r.createElementVNode("div",lr,[r.createElementVNode("label",{class:"caption-bold mono mb-2xs",for:m},r.toDisplayString(m),9,ur),r.createElementVNode("p",dr,r.toDisplayString(g(m)),1)])])),64))]),r.createElementVNode("div",null,[b[14]||(b[14]=r.createElementVNode("h2",{class:"capline color-onsurfacevariant mb-lg"},"Layout",-1)),(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(d,m=>r.createElementVNode("div",{key:m,class:"lk-row mb-sm",style:{"align-items":"start",gap:"var(--lk-size-md)"}},[r.createElementVNode("input",{type:"color",name:m,value:r.unref(e)[m],class:"lk-color-input",onInput:v=>h(m,v.target.value)},null,40,mr),r.createElementVNode("div",hr,[r.createElementVNode("label",{class:"caption-bold mono mb-xs",for:m},r.toDisplayString(m),9,fr),r.createElementVNode("p",pr,r.toDisplayString(g(m)),1)])])),64))])])])])])):r.createCommentVNode("",!0)]))],64))}}),yt=(t,e)=>{const n=t.__vccOpts||t;for(const[a,o]of e)n[a]=o;return n},kr=yt(gr,[["__scopeId","data-v-186889e9"]]),br=r.defineComponent({inheritAttrs:!1,__name:"LkContainer",props:{maxWidth:{default:"md"}},setup(t){const e=t,n=r.computed(()=>W({maxWidth:e.maxWidth},"container"));return(a,o)=>(r.openBlock(),r.createElementBlock("div",r.normalizeProps(r.guardReactiveProps({...a.$attrs,...n.value})),[r.renderSlot(a.$slots,"default")],16))}}),Cr=r.defineComponent({inheritAttrs:!1,__name:"LkColumn",props:{alignItems:{default:"stretch"},justifyContent:{default:"start"},gap:{},wrapChildren:{type:Boolean},defaultChildBehavior:{}},setup(t){const e=t,n=r.computed(()=>W({alignItems:e.alignItems,justifyContent:e.justifyContent,gap:e.gap,wrapChildren:e.wrapChildren,defaultChildBehavior:e.defaultChildBehavior},"column"));return(a,o)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({...a.$attrs,...n.value},{"data-lk-component":"column"}),[r.renderSlot(a.$slots,"default")],16))}}),vt=r.defineComponent({inheritAttrs:!1,__name:"LkRow",props:{alignItems:{default:"start"},justifyContent:{default:"start"},gap:{},wrapChildren:{type:Boolean},defaultChildBehavior:{}},setup(t){const e=t,n=r.computed(()=>W({alignItems:e.alignItems,justifyContent:e.justifyContent,gap:e.gap,wrapChildren:e.wrapChildren,defaultChildBehavior:e.defaultChildBehavior},"row"));return(a,o)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({...a.$attrs,...n.value},{"data-lk-component":"row"}),[r.renderSlot(a.$slots,"default")],16))}}),yr={"data-lk-component":"section"},vr=r.defineComponent({inheritAttrs:!1,__name:"LkSection",props:{padding:{},px:{},py:{},pt:{},pb:{},pl:{},pr:{}},setup(t){const e=t,n=r.computed(()=>W({padding:e.padding,px:e.px,py:e.py,pt:e.pt,pb:e.pb,pl:e.pl,pr:e.pr},"section"));return(a,o)=>(r.openBlock(),r.createElementBlock("section",r.normalizeProps(r.guardReactiveProps({...a.$attrs,...n.value})),[r.createElementVNode("div",yr,[r.renderSlot(a.$slots,"default")])],16))}}),wr=r.defineComponent({inheritAttrs:!1,__name:"LkGrid",props:{columns:{default:2},gap:{default:"md"},autoResponsive:{type:Boolean,default:!1},class:{}},setup(t){const e=t,n=r.useSlots(),a=r.computed(()=>W({autoResponsive:e.autoResponsive,gap:e.gap},"grid")),o=r.computed(()=>e.class?{}:{gridTemplateColumns:`repeat(${e.columns}, 1fr)`}),s=r.computed(()=>!!n.default),i=r.computed(()=>s.value?0:e.class?e.columns:e.columns*2);return(c,l)=>{const d=r.resolveComponent("LkPlaceholderBlock");return r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"grid"},{...c.$attrs,...a.value},{class:e.class,style:o.value}),[r.renderSlot(c.$slots,"default"),s.value?r.createCommentVNode("",!0):(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(i.value,u=>(r.openBlock(),r.createBlock(d,{key:u}))),128))],16)}}}),Pr={"data-lk-component":"placeholder-block"},Mr=r.defineComponent({inheritAttrs:!1,__name:"LkPlaceholderBlock",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Pr))}}),Br=r.defineComponent({inheritAttrs:!1,__name:"LkHeading",props:{tag:{default:"h2"},fontClass:{default:"display2-bold"},fontColor:{},class:{}},setup(t){const e=t,n=r.computed(()=>W({},"heading")),a=r.computed(()=>{const o=[];return e.fontClass&&o.push(e.fontClass),e.fontColor&&o.push(`color-${e.fontColor}`),e.class&&o.push(e.class),o.join(" ")});return(o,s)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.tag),r.mergeProps({"data-lk-component":"heading",class:a.value},{...o.$attrs,...n.value}),{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),_:3},16,["class"]))}}),wt=r.defineComponent({inheritAttrs:!1,__name:"LkText",props:{tag:{default:"div"},fontClass:{},color:{},class:{}},setup(t){const e=t,n=r.computed(()=>{const a=[];return e.fontClass&&a.push(e.fontClass),e.color&&a.push(`color-${e.color}`),e.class&&a.push(e.class),a.join(" ")});return(a,o)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.tag),r.mergeProps({"data-lk-component":"text",class:n.value},a.$attrs),{default:r.withCtx(()=>[r.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),Ir=["data-lk-badge-scale","data-lk-badge-color"],Dr={"data-lk-component":"slot","data-lk-slot":"icon"},xr={"data-lk-icon-element":"wrapper"},_r=r.defineComponent({inheritAttrs:!1,__name:"LkBadge",props:{icon:{default:"roller-coaster"},color:{default:"surface"},scale:{default:"md"},iconStrokeWidth:{default:0},scrim:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>we(e.color)),a=r.computed(()=>{switch(e.scale){case"lg":return 1;case"md":default:return 1.5}}),o=r.computed(()=>e.iconStrokeWidth||a.value);return(s,i)=>{const c=r.resolveComponent("LkIcon");return r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"badge","data-lk-badge-scale":e.scale,"data-lk-badge-color":`lk-${e.color}`},s.$attrs),[r.createElementVNode("div",Dr,[r.createElementVNode("div",xr,[r.createVNode(c,{name:e.icon,color:n.value,"stroke-width":o.value},null,8,["name","color","stroke-width"])])]),e.scrim?(r.openBlock(),r.createElementBlock("div",{key:0,"data-lk-component":"badge-scrim",class:r.normalizeClass(`bg-${n.value}`)},null,2)):r.createCommentVNode("",!0)],16,Ir)}}}),Er=["data-lk-icon-offset","data-lk-icon-font-class"],Tr=["stroke","stroke-width"],Pe=r.defineComponent({inheritAttrs:!1,__name:"LkIcon",props:{name:{default:"roller-coaster"},fontClass:{},color:{default:"onsurface"},display:{},strokeWidth:{default:2},opticShift:{type:Boolean,default:!1}},setup(t){const e=t;return r.computed(()=>({width:"1em",height:"1em",color:`var(--lk-${e.color})`,strokeWidth:e.strokeWidth})),(n,a)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"icon","data-lk-icon-offset":e.opticShift,"data-lk-icon-font-class":e.fontClass},n.$attrs),[r.renderSlot(n.$slots,"default",{},()=>[(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:`var(--lk-${e.color})`,"stroke-width":e.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,Tr))])],16,Er))}}),Lr=["src","alt"],Vr=r.defineComponent({inheritAttrs:!1,__name:"LkImage",props:{aspect:{default:"auto"},borderRadius:{},objectFit:{default:"fill"},width:{default:"auto"},height:{default:"auto"},src:{},alt:{default:""}},setup(t){const e=t,n=r.computed(()=>W({aspect:e.aspect,borderRadius:e.borderRadius,objectFit:e.objectFit,width:e.width,height:e.height},"image"));return(a,o)=>(r.openBlock(),r.createElementBlock("img",r.mergeProps({"data-lk-component":"image"},{...a.$attrs,...n.value},{src:e.src,alt:e.alt}),null,16,Lr))}}),Sr=r.defineComponent({inheritAttrs:!1,__name:"LkSticker",props:{fontClass:{default:"label"},bgColor:{default:"primarycontainer"},class:{}},setup(t){const e=t,n=r.computed(()=>we(e.bgColor)),a=r.computed(()=>{const o=[`bg-${e.bgColor}`,`color-${n.value}`];return e.class&&o.push(e.class),o.join(" ")});return(o,s)=>{const i=r.resolveComponent("LkText");return r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"sticker",class:a.value},o.$attrs),[r.createVNode(i,{"font-class":e.fontClass},{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default",{},()=>[s[0]||(s[0]=r.createTextVNode("Sticker",-1))])]),_:3},8,["font-class"])],16)}}}),Oe=r.defineComponent({inheritAttrs:!1,__name:"LkStateLayer",props:{bgColor:{default:"currentColor"},forcedState:{}},setup(t){const e=t,n=r.computed(()=>e.bgColor!=="currentColor"?`bg-${e.bgColor}`:""),a=r.computed(()=>e.bgColor==="currentColor"?{backgroundColor:"currentColor"}:{});return(o,s)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"state-layer",class:n.value,style:a.value},e.forcedState?{"data-lk-forced-state":e.forcedState}:{}),null,16))}}),$r=["data-lk-material-type"],Ar={key:0},Nr={key:1},Fr=r.defineComponent({inheritAttrs:!1,__name:"LkMaterialLayer",props:{zIndex:{default:0},type:{},materialProps:{}},setup(t){const e=t;r.computed(()=>e.materialProps&&e.type?W(e.materialProps,e.type):{});const n=r.computed(()=>e.materialProps),a=r.computed(()=>{var u,h;return{opacity:((u=n.value)==null?void 0:u.tintOpacity)||.2,backgroundColor:`var(--lk-${((h=n.value)==null?void 0:h.tint)||"transparent"})`}}),o=r.computed(()=>{var h;return{"--blur-thick":"var(--lk-size-lg)","--blur-normal":"var(--lk-size-md)","--blur-thin":"var(--lk-size-xs)",zIndex:1,isolation:"isolate",backdropFilter:`blur(var(--blur-${((h=n.value)==null?void 0:h.thickness)||"normal"}))`}}),s=r.computed(()=>{var u;return{background:((u=n.value)==null?void 0:u.lightExpression)||"none",mixBlendMode:"soft-light",opacity:1}}),i=r.computed(()=>{var h;switch(((h=n.value)==null?void 0:h.thickness)||"normal"){case"thick":return .8;case"normal":return .6;case"thin":return .4;default:return .6}}),c=r.computed(()=>({backgroundColor:"var(--lk-surface)",opacity:i.value})),l=r.computed(()=>e.materialProps),d=r.computed(()=>{var u;return{backgroundColor:(u=l.value)!=null&&u.bgColor?`var(--lk-${l.value.bgColor})`:"var(--lk-surface)"}});return(u,h)=>{var w,k;return r.openBlock(),r.createElementBlock("div",{"data-lk-component":"material-layer","data-lk-material-type":e.type,style:r.normalizeStyle({zIndex:e.zIndex})},[e.type==="glass"?(r.openBlock(),r.createElementBlock("div",Ar,[r.createElementVNode("div",{"data-lk-material-sublayer":"texture",style:r.normalizeStyle(o.value)},[(w=n.value)!=null&&w.tint?(r.openBlock(),r.createElementBlock("div",{key:0,"data-lk-material-sublayer":"tint",style:r.normalizeStyle(a.value)},[(k=n.value)!=null&&k.light?(r.openBlock(),r.createElementBlock("div",{key:0,"data-lk-material-sublayer":"light",style:r.normalizeStyle(s.value)},null,4)):r.createCommentVNode("",!0)],4)):r.createCommentVNode("",!0)],4),r.createElementVNode("div",{"data-lk-material-sublayer":"base-glass-fill",style:r.normalizeStyle(c.value)},null,4)])):r.createCommentVNode("",!0),e.type==="flat"?(r.openBlock(),r.createElementBlock("div",Nr,[r.createElementVNode("div",{"data-lk-material-sublayer":"bgColor",style:r.normalizeStyle(d.value)},null,4)])):r.createCommentVNode("",!0)],12,$r)}}}),Or=yt(Fr,[["__scopeId","data-v-909bf003"]]),Rr=["data-lk-card-optical-correction"],zr={"data-lk-component":"slot","data-lk-slot":"children"},jr=["data-lk-material-bg-color"],Ze=r.defineComponent({inheritAttrs:!1,__name:"LkCard",props:{scaleFactor:{default:"body"},variant:{default:"fill"},material:{default:"flat"},materialProps:{default:()=>({})},opticalCorrection:{default:"none"},isClickable:{type:Boolean,default:!1},bgColor:{},isScrollable:{type:Boolean,default:!1}},setup(t){const e=t,n=r.useAttrs(),a=r.computed(()=>W({scaleFactor:e.scaleFactor,variant:e.variant,material:e.material},"card")),o=r.computed(()=>{const i=[];return e.isClickable&&i.push("clickable"),i.join(" ")}),s=r.computed(()=>e.variant==="fill"?e.bgColor:"transparent");return(i,c)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"card",class:o.value},{...a.value,...r.unref(n)}),[r.createElementVNode("div",{"data-lk-card-element":"padding-box",class:r.normalizeClass(t.isScrollable?"overflow-auto":""),"data-lk-card-optical-correction":t.opticalCorrection},[r.createElementVNode("div",zr,[r.renderSlot(i.$slots,"default")])],10,Rr),t.material==="glass"?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,"data-lk-component":"material-layer","data-lk-material-layer-type":"glass"},r.unref(W)(t.materialProps,"material")),null,16)):r.createCommentVNode("",!0),t.material==="flat"?(r.openBlock(),r.createElementBlock("div",{key:1,"data-lk-component":"material-layer","data-lk-material-layer-type":"flat","data-lk-material-bg-color":s.value},null,8,jr)):r.createCommentVNode("",!0)],16))}}),Hr=r.defineComponent({__name:"LkDropdown",setup(t){const{open:e,toggle:n,setOpen:a}=Rt();return(o,s)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"dropdown"},o.$attrs),[r.renderSlot(o.$slots,"default",{isOpen:r.unref(e),toggle:r.unref(n),close:()=>r.unref(a)(!1)})],16))}}),qr=["aria-expanded"],Ur=r.defineComponent({__name:"LkDropdownTrigger",setup(t){const{open:e,toggle:n,triggerRef:a}=Ct(),o=r.ref(null);r.onMounted(()=>{if(o.value){const i=o.value.firstElementChild;i?a.value=i:a.value=o.value}}),r.onBeforeUnmount(()=>{a.value=null});function s(){n()}return(i,c)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"localRef",ref:o,"data-lk-component":"dropdown-trigger","aria-expanded":r.unref(e),"aria-haspopup":"menu",onClick:s},[r.renderSlot(i.$slots,"default")],8,qr))}}),Wr=["data-isactive","data-lk-dropdown-trigger-quadrant"],Gr=r.defineComponent({__name:"LkDropdownMenu",props:{scaleFactor:{default:"body"}},setup(t){const{open:e,triggerRef:n,contentRef:a}=Ct(),o=r.ref(null),s=r.ref({}),i=r.ref("bottom-left");function c(){if(!n.value)return;const l=n.value.getBoundingClientRect(),d=window.innerWidth,u=window.innerHeight,h=l.top<u/2,w=l.left<d/2;switch(h?i.value=w?"bottom-left":"bottom-right":i.value=w?"top-left":"top-right",i.value){case"top-left":s.value={top:`${l.top+window.scrollY}px`,left:`${l.left+window.scrollX}px`};break;case"top-right":s.value={top:`${l.top+window.scrollY}px`,left:`${l.right+window.scrollX}px`};break;case"bottom-right":s.value={top:`${l.bottom+window.scrollY}px`,left:`${l.right+window.scrollX}px`};break;case"bottom-left":default:s.value={top:`${l.bottom+window.scrollY}px`,left:`${l.left+window.scrollX}px`};break}}return r.watch(e,l=>{l&&c()}),r.onMounted(()=>{o.value&&(a.value=o.value)}),r.onBeforeUnmount(()=>{a.value=null}),(l,d)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.unref(e)&&r.unref(n)?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"localContentRef",ref:o,style:r.normalizeStyle(s.value),role:"menu","data-lk-component":"dropdown-menu","data-isactive":r.unref(e),"data-lk-dropdown-trigger-quadrant":i.value},[r.createVNode(Ze,{class:"shadow-xl","scale-factor":t.scaleFactor},{default:r.withCtx(()=>[r.createElementVNode("div",{"data-lk-component":"column","data-lk-column-gap":"none",class:r.normalizeClass(t.scaleFactor)},[r.renderSlot(l.$slots,"default")],2)]),_:3},8,["scale-factor"])],12,Wr)):r.createCommentVNode("",!0)]))}}),Yr=["name","value"],Jr=["value"],Qe=Symbol("liftkit-select"),Kr=r.defineComponent({__name:"LkSelect",props:{modelValue:{default:""},options:{default:()=>[]},name:{},label:{},labelPosition:{default:"default"},helpText:{},placeholderText:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,a=e,o=r.ref(!1),s=r.ref(null),i=r.ref(null),c=r.ref(null),l=r.ref(n.modelValue);r.watch(()=>n.modelValue,m=>{l.value=m??""});function d(m){o.value=m}function u(){d(!o.value)}function h(m){l.value=m,a("update:modelValue",m),d(!1)}let w=null;r.watch(o,m=>{m&&(w={close:()=>d(!1)},window.dispatchEvent(new CustomEvent("lk-select-opened",{detail:w})))});function k(m){w&&m.detail!==w&&o.value&&d(!1)}function g(m){i.value&&!i.value.contains(m.target)&&s.value&&!s.value.contains(m.target)&&d(!1)}function p(m){var v;m.key==="Escape"&&o.value&&(d(!1),(v=s.value)==null||v.focus())}r.onMounted(()=>{document.addEventListener("mousedown",g),document.addEventListener("keydown",p),window.addEventListener("lk-select-opened",k)}),r.onBeforeUnmount(()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",p),window.removeEventListener("lk-select-opened",k)});const b=r.computed(()=>n.options);return r.provide(Qe,{open:o,setOpen:d,toggle:u,triggerRef:s,contentRef:i,selectedValue:l,setSelectedValue:h,options:b,name:n.name}),(m,v)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"select"},m.$attrs),[r.createElementVNode("select",{ref_key:"hiddenSelectRef",ref:c,name:t.name,value:l.value,tabindex:"-1","aria-hidden":"true",style:{position:"absolute",left:"-9999px",width:"1px",height:"1px",opacity:"0","pointer-events":"none"}},[v[0]||(v[0]=r.createElementVNode("option",{value:"",disabled:""},null,-1)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.options,P=>(r.openBlock(),r.createElementBlock("option",{key:P.value,value:P.value},r.toDisplayString(P.label),9,Jr))),128))],8,Yr),r.renderSlot(m.$slots,"default",{isOpen:o.value,toggle:u,selectedValue:l.value,setSelectedValue:h})],16))}}),Xr=["aria-expanded"],Zr=r.defineComponent({__name:"LkSelectTrigger",setup(t){const e=r.inject(Qe);if(!e)throw new Error("LkSelectTrigger must be used inside an LkSelect component");const{open:n,toggle:a,triggerRef:o}=e,s=r.ref(null);r.onMounted(()=>{if(s.value){const c=s.value.firstElementChild;c?o.value=c:o.value=s.value}}),r.onBeforeUnmount(()=>{o.value=null});function i(){a()}return(c,l)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"localRef",ref:s,"data-lk-component":"select-trigger","aria-expanded":r.unref(n),"aria-haspopup":"menu",onClick:i},[r.renderSlot(c.$slots,"default")],8,Xr))}}),Qr=["data-isactive"],ea=r.defineComponent({__name:"LkSelectMenu",props:{scaleFactor:{default:"body"}},setup(t){const e=r.inject(Qe);if(!e)throw new Error("LkSelectMenu must be used inside an LkSelect component");const{open:n,triggerRef:a,contentRef:o}=e,s=r.ref(null),i=r.ref({});function c(){if(!a.value)return;const l=a.value.getBoundingClientRect();i.value={top:`${l.bottom+window.scrollY}px`,left:`${l.left+window.scrollX}px`}}return r.watch(n,l=>{l&&c()}),r.onMounted(()=>{s.value&&(o.value=s.value)}),r.onBeforeUnmount(()=>{o.value=null}),(l,d)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.unref(n)&&r.unref(a)?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"localContentRef",ref:s,style:r.normalizeStyle(i.value),role:"menu","data-lk-component":"select-menu","data-isactive":r.unref(n)},[r.createVNode(Ze,{class:"shadow-xl","scale-factor":t.scaleFactor},{default:r.withCtx(()=>[r.createElementVNode("div",{"data-lk-component":"column","data-lk-column-gap":"none",class:r.normalizeClass(t.scaleFactor)},[r.renderSlot(l.$slots,"default")],2)]),_:3},8,["scale-factor"])],12,Qr)):r.createCommentVNode("",!0)]))}}),ta=["data-selected"],na={"data-lk-menu-item-element":"content-wrap"},ra=["data-lk-state-layer-forced-state"],aa=r.defineComponent({__name:"LkSelectOption",props:{value:{}},setup(t){const e=t,n=r.inject(Qe);if(!n)throw new Error("LkSelectOption must be used inside an LkSelect component");const{selectedValue:a,setSelectedValue:o}=n,s=r.computed(()=>a.value===e.value);function i(){o(e.value)}function c(l){(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),i())}return(l,d)=>(r.openBlock(),r.createElementBlock("div",{role:"menuitem","data-lk-component":"menu-item",tabindex:0,"data-selected":s.value,style:r.normalizeStyle({cursor:"pointer",fontWeight:s.value?"bold":"normal"}),class:"select-option",onClick:i,onKeydown:c},[r.renderSlot(l.$slots,"startIcon"),r.createElementVNode("p",na,[r.renderSlot(l.$slots,"default")]),r.renderSlot(l.$slots,"endIcon"),r.createElementVNode("div",{"data-lk-component":"state-layer","data-lk-state-layer-forced-state":s.value?"active":void 0},null,8,ra)],44,ta))}}),oa={"data-lk-component":"row","data-lk-row-align-items":"center"},sa={key:0,"data-lk-slot":"snackbar-icon"},ia={"data-lk-slot":"snackbar-text"},ca={"data-lk-component":"row"},la={key:0,"data-lk-slot":"snackbar-actions"},ua={key:1,"data-lk-slot":"snackbar-icon-actions"},da=r.defineComponent({inheritAttrs:!1,__name:"LkSnackbar",props:{globalColor:{},message:{default:"Notification text goes here."},modelValue:{type:Boolean,default:!0},autoDismiss:{default:0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,a=e,o=r.useAttrs(),s=r.ref(n.modelValue);let i=null;r.watch(()=>n.modelValue,h=>{s.value=h,h&&n.autoDismiss>0&&c()});function c(){l(),n.autoDismiss>0&&(i=setTimeout(()=>{s.value=!1,a("update:modelValue",!1)},n.autoDismiss))}function l(){i&&(clearTimeout(i),i=null)}r.onMounted(()=>{s.value&&n.autoDismiss>0&&c()}),r.onUnmounted(()=>{l()});const d=r.computed(()=>W({globalColor:n.globalColor,message:n.message},"snackbar")),u=r.computed(()=>{if(n.globalColor)return we(n.globalColor)});return(h,w)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[s.value?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,"data-lk-component":"snackbar"},{...d.value,...r.unref(o)}),[r.createVNode(Ze,{"scale-factor":h.$slots.icon?"subheading":"body","bg-color":t.globalColor,"optical-correction":h.$slots.icon?"none":"y",class:"shadow-sm"},{default:r.withCtx(()=>[r.createElementVNode("div",oa,[h.$slots.icon?(r.openBlock(),r.createElementBlock("div",sa,[r.renderSlot(h.$slots,"icon",{onColor:u.value})])):r.createCommentVNode("",!0),r.createElementVNode("div",ia,[r.renderSlot(h.$slots,"default",{onColor:u.value,globalColor:t.globalColor},()=>[r.createElementVNode("p",null,r.toDisplayString(t.message),1)])]),r.createElementVNode("div",ca,[h.$slots.action?(r.openBlock(),r.createElementBlock("div",la,[r.renderSlot(h.$slots,"action",{onColor:u.value,globalColor:t.globalColor})])):r.createCommentVNode("",!0),h.$slots.iconAction?(r.openBlock(),r.createElementBlock("div",ua,[r.renderSlot(h.$slots,"iconAction",{onColor:u.value,globalColor:t.globalColor})])):r.createCommentVNode("",!0)])])]),_:3},8,["scale-factor","bg-color","optical-correction"])],16)):r.createCommentVNode("",!0)]))}}),ma={class:"navbar-desktop"},ha={"data-lk-component":"row","data-lk-row-align-items":"center","data-lk-row-gap":"sm"},fa=["href"],pa=["alt","src"],ga={"data-lk-component":"row"},ka={"data-lk-component":"row","data-lk-slot":"nav-buttons"},ba={"data-lk-component":"row","data-lk-slot":"nav-dropdowns"},Ca={"data-lk-component":"row","data-lk-navbar-el":"nav-menu-end"},ya={"data-lk-slot":"nav-icon-buttons"},va={"data-lk-slot":"nav-cta-buttons"},wa={"data-lk-navbar-el":"nav-menu"},Pa=["aria-expanded"],Ma=["href"],Ba=["alt","src"],Ia={"data-lk-component":"column"},Da={"data-lk-component":"column"},xa={"data-lk-component":"column",class:"flex-h gap-sm"},_a={key:0,"data-lk-component":"material-layer","data-lk-material-layer-type":"glass"},Ea=r.defineComponent({inheritAttrs:!1,__name:"LkNavbar",props:{material:{default:"flat"},homeHref:{default:"/"},logoSrc:{default:"/logotype.svg"},logoAlt:{default:""}},setup(t){const e=t,n=r.useAttrs(),a=r.ref(!1);function o(){a.value=!a.value}const s=r.computed(()=>W({material:e.material},"navbar"));return(i,c)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"navbar"},{...s.value,...r.unref(n)}),[r.createElementVNode("div",ma,[r.createElementVNode("div",ha,[r.renderSlot(i.$slots,"brand",{},()=>[r.createElementVNode("a",{href:t.homeHref},[r.createElementVNode("img",{alt:t.logoAlt,src:t.logoSrc,"data-lk-component":"image","data-lk-image-height":"md"},null,8,pa)],8,fa)])]),r.createElementVNode("div",ga,[r.createElementVNode("div",ka,[r.renderSlot(i.$slots,"navButtons")]),r.createElementVNode("div",ba,[r.renderSlot(i.$slots,"navDropdowns")])]),r.createElementVNode("div",Ca,[r.createElementVNode("div",ya,[r.renderSlot(i.$slots,"iconButtons")]),r.createElementVNode("div",va,[r.renderSlot(i.$slots,"ctaButtons")])])]),r.createElementVNode("div",wa,[r.createElementVNode("div",{"data-lk-component":"column","data-lk-column-align-items":"start",class:r.normalizeClass(["navbar-mobile",{active:a.value}])},[r.createElementVNode("button",{class:"navbar-menu-toggle",type:"button","aria-label":"Toggle menu","aria-expanded":a.value,onClick:o},[r.renderSlot(i.$slots,"menuIcon",{},()=>[c[0]||(c[0]=r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[r.createElementVNode("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),r.createElementVNode("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),r.createElementVNode("line",{x1:"3",y1:"18",x2:"21",y2:"18"})],-1))])],8,Pa),r.renderSlot(i.$slots,"mobileBrand",{},()=>[r.createElementVNode("a",{href:t.homeHref},[r.createElementVNode("img",{alt:t.logoAlt,src:t.logoSrc,"data-lk-component":"image","data-lk-image-width":"md","data-lk-image-height":"md"},null,8,Ba)],8,Ma)]),r.withDirectives(r.createElementVNode("div",Ia,[r.renderSlot(i.$slots,"navButtons")],512),[[r.vShow,a.value]]),r.withDirectives(r.createElementVNode("div",Da,[r.renderSlot(i.$slots,"navDropdowns")],512),[[r.vShow,a.value]]),r.withDirectives(r.createElementVNode("div",null,[r.renderSlot(i.$slots,"iconButtons")],512),[[r.vShow,a.value]]),r.withDirectives(r.createElementVNode("div",xa,[r.renderSlot(i.$slots,"ctaButtons")],512),[[r.vShow,a.value]])],2)]),t.material==="glass"?(r.openBlock(),r.createElementBlock("div",_a)):r.createCommentVNode("",!0)],16))}}),Ta={"data-lk-button-content-wrap":"true"},La={key:0,"data-lk-icon-position":"start"},Va={"data-lk-button-child":"button-text"},Sa={key:1,"data-lk-icon-position":"end"},$a=r.defineComponent({inheritAttrs:!1,__name:"LkButton",props:{label:{default:"Button"},variant:{default:"fill"},color:{default:"primary"},size:{default:"md"},material:{},startIcon:{},endIcon:{},opticIconShift:{type:Boolean,default:!0},modifiers:{},stateLayerOverride:{}},setup(t){const e=t,n=r.computed(()=>W({variant:e.variant,color:e.color,size:e.size,startIcon:e.startIcon,endIcon:e.endIcon,opticIconShift:e.opticIconShift},"button")),a=r.computed(()=>we(e.color)),o=r.computed(()=>{let c="";switch(e.variant){case"fill":c=`bg-${e.color} color-${a.value}`;break;case"outline":case"text":c=`color-${e.color}`;break;default:c=`bg-${e.color} color-${a.value}`;break}return e.modifiers&&(c+=` ${e.modifiers}`),c}),s=r.computed(()=>e.stateLayerOverride?e.stateLayerOverride:{bgColor:e.variant==="fill"?a.value:e.color}),i=r.computed(()=>e.variant==="fill"?a.value:e.color);return(c,l)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({...c.$attrs,...n.value},{type:"button","data-lk-component":"button",class:`${o.value} ${t.modifiers||""}`}),[r.createElementVNode("div",Ta,[t.startIcon?(r.openBlock(),r.createElementBlock("div",La,[r.createVNode(Pe,{name:t.startIcon,color:i.value,"data-lk-icon-position":"start"},null,8,["name","color"])])):r.createCommentVNode("",!0),r.createElementVNode("span",Va,r.toDisplayString(t.label??"Button"),1),t.endIcon?(r.openBlock(),r.createElementBlock("div",Sa,[r.createVNode(Pe,{name:t.endIcon,color:i.value,"data-lk-icon-position":"end"},null,8,["name","color"])])):r.createCommentVNode("",!0)]),r.createVNode(Oe,r.normalizeProps(r.guardReactiveProps(s.value)),null,16)],16))}}),Aa=r.defineComponent({inheritAttrs:!1,__name:"LkIconButton",props:{icon:{default:"roller-coaster"},variant:{default:"fill"},color:{default:"primary"},size:{default:"md"},fontClass:{default:"body"}},setup(t){const e=t,n=r.computed(()=>W({variant:e.variant,color:e.color,size:e.size},"icon-button")),a=r.computed(()=>we(e.color)),o=r.computed(()=>{switch(e.fontClass){case"display1":case"display2":case"title1":return 1.5;case"subheading":case"label":case"caption":case"capline":return 2;default:return 1.75}}),s=r.computed(()=>{switch(e.variant){case"outline":case"text":return e.color;case"fill":return a.value;default:return a.value}});return(i,c)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({"data-lk-component":"icon-button",type:"button"},{...i.$attrs,...n.value},{class:`${t.fontClass}`}),[r.createElementVNode("div",null,[r.createVNode(Pe,{name:t.icon,color:s.value,"stroke-width":o.value},null,8,["name","color","stroke-width"])]),r.createVNode(Oe,{"bg-color":s.value},null,8,["bg-color"])],16))}}),Na=["title"],Fa={"data-lk-menu-item-element":"content-wrap"},Oa=r.defineComponent({inheritAttrs:!1,__name:"LkMenuItem",props:{startIcon:{},endIcon:{},fontClass:{default:"body"},title:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"menu-item",title:t.title},e.$attrs),[t.startIcon?(r.openBlock(),r.createBlock(Pe,r.mergeProps({key:0},t.startIcon,{"data-lk-icon-position":"start"}),null,16)):r.createCommentVNode("",!0),r.createElementVNode("p",Fa,[r.renderSlot(e.$slots,"default")]),t.endIcon?(r.openBlock(),r.createBlock(Pe,r.mergeProps({key:1},t.endIcon,{"data-lk-icon-position":"end"}),null,16)):r.createCommentVNode("",!0),r.createVNode(Oe)],16,Na))}}),Ra=["data-lk-switch-state"],za=["data-lk-switch-state"],ja=r.defineComponent({inheritAttrs:!1,__name:"LkSwitch",props:{modelValue:{type:Boolean,default:!1},offColor:{default:"surfacevariant"},onColor:{default:"primary"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,a=e,o=r.computed(()=>we(n.offColor)),s=r.computed(()=>we(n.onColor));function i(){a("update:modelValue",!n.modelValue)}const c=r.computed(()=>n.modelValue?"on":"off"),l=r.computed(()=>({"--switch-off-color":`var(--lk-${n.offColor})`,"--switch-on-color":`var(--lk-${n.onColor})`,"--switch-thumb-off-color":`var(--lk-${o.value})`,"--switch-thumb-on-color":`var(--lk-${s.value})`}));return(d,u)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"switch"},{...d.$attrs,style:l.value},{"data-lk-switch-state":c.value,onClick:i}),[r.createElementVNode("div",{"data-lk-component":"switch-thumb","data-lk-switch-state":c.value},null,8,za)],16,Ra))}}),Ha=yt(ja,[["__scopeId","data-v-9150e6cf"]]),qa=["for"],Ua=["data-lk-input-help-text","data-help-text"],Wa=["for"],Ga=["name","id","placeholder","value"],Ya=r.defineComponent({inheritAttrs:!1,__name:"LkTextInput",props:{modelValue:{default:""},labelPosition:{default:"default"},helpText:{},placeholder:{default:"Placeholder"},name:{default:"Label"},endIcon:{default:"search"},labelBackgroundColor:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,a=e,o=r.computed(()=>W({labelPosition:n.labelPosition},"text-input"));function s(c){const l=c.target;a("update:modelValue",l.value)}const i=r.computed(()=>{let c="body";return n.labelBackgroundColor&&(c+=` bg-${n.labelBackgroundColor}`),n.modelValue&&(c+=" on-field-with-value-set"),c});return(c,l)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"text-input"},{...c.$attrs,...o.value}),[t.labelPosition==="default"?(r.openBlock(),r.createElementBlock("label",{key:0,for:t.name,class:"label"},r.toDisplayString(t.name),9,qa)):r.createCommentVNode("",!0),r.createElementVNode("div",{"data-lk-text-input-el":"input-wrap","data-lk-input-help-text":t.helpText?"true":"false","data-help-text":t.helpText},[t.labelPosition==="on-input"?(r.openBlock(),r.createElementBlock("label",{key:0,for:t.name,class:r.normalizeClass(i.value)},r.toDisplayString(t.name),11,Wa)):r.createCommentVNode("",!0),r.createElementVNode("input",{type:"text",name:t.name,id:t.name,placeholder:t.labelPosition!=="on-input"?t.placeholder:"",value:t.modelValue,onInput:s},null,40,Ga),r.createVNode(Oe),r.createVNode(Pe,{name:t.endIcon},null,8,["name"])],8,Ua),t.helpText?(r.openBlock(),r.createBlock(vt,{key:1,"align-items":"center"},{default:r.withCtx(()=>[r.createVNode(Pe,{name:"info","font-class":"capline",color:"outline","optic-shift":!0}),r.createVNode(wt,{color:"outline","font-class":"caption",class:"m-left-2xs"},{default:r.withCtx(()=>[...l[0]||(l[0]=[r.createTextVNode(" Help text goes here ",-1)])]),_:1})]),_:1})):r.createCommentVNode("",!0)],16))}}),Ja={"data-lk-slot":"child"},jt=r.defineComponent({inheritAttrs:!1,__name:"LkTabLink",props:{selected:{type:Boolean,default:!1},fontClass:{default:"body"},indicatorClass:{default:"lk-indicator"}},setup(t){const e=t,n=r.computed(()=>W({selected:e.selected,fontClass:e.fontClass,indicatorClass:e.indicatorClass},"tab-link")),a=r.computed(()=>e.selected?{fontWeight:700}:{});return(o,s)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"tab-link"},{...o.$attrs,...n.value}),[r.createElementVNode("div",Ja,[r.createVNode(wt,{"font-class":t.fontClass,style:r.normalizeStyle(a.value)},{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),_:3},8,["font-class","style"])]),r.createElementVNode("div",{class:r.normalizeClass(t.indicatorClass)},null,2)],16))}}),Ht=r.defineComponent({inheritAttrs:!1,__name:"LkTabMenu",props:{tabLinks:{default:()=>["Tab Link 1","Tab Link 2","Tab Link 3"]},alignItems:{},justifyContent:{},activeTab:{default:0}},emits:["update:activeTab"],setup(t,{emit:e}){const n=t,a=e,o=r.computed(()=>W({alignItems:n.alignItems,justifyContent:n.justifyContent,activeTab:n.activeTab},"tab-menu"));function s(i){a("update:activeTab",i)}return(i,c)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"tab-menu"},{...i.$attrs,...o.value}),[r.createVNode(vt,{"align-items":t.alignItems,"justify-content":t.justifyContent},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.tabLinks,(l,d)=>(r.openBlock(),r.createBlock(jt,{key:d,selected:d===t.activeTab,onClick:u=>s(d)},{default:r.withCtx(()=>[r.createElementVNode("div",null,r.toDisplayString(l??"Tab Link"),1)]),_:2},1032,["selected","onClick"]))),128))]),_:1},8,["align-items","justify-content"])],16))}}),Ka=["data-lk-tabs-content-scrollable"],Xa=["data-lk-tabs-content-scrollable"],Za=r.defineComponent({inheritAttrs:!1,__name:"LkTabs",props:{tabLinks:{},scrollableContent:{type:Boolean,default:!1},defaultTab:{default:0}},emits:["activeTabChange"],setup(t,{emit:e}){const n=t,a=e,o=r.ref(n.defaultTab);function s(c){o.value=c}r.watch(o,c=>{a("activeTabChange",c)}),r.provide("lk-tabs",{activeTab:o,setActiveTab:s});const i=r.computed(()=>W({activeTab:o.value},"tabs"));return(c,l)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"tabs","data-lk-tabs-content-scrollable":t.scrollableContent||void 0},{...c.$attrs,...i.value}),[r.createVNode(Ht,{"tab-links":t.tabLinks,"justify-content":"start","align-items":"stretch","active-tab":o.value,"onUpdate:activeTab":s},null,8,["tab-links","active-tab"]),r.createElementVNode("div",{"data-lk-tabs-el":"tab-content","data-lk-tabs-content-scrollable":t.scrollableContent||void 0},[r.renderSlot(c.$slots,"default",{activeTab:o.value})],8,Xa)],16,Ka))}}),Qa=r.defineComponent({inheritAttrs:!1,__name:"LkTabContent",props:{index:{}},setup(t){const e=t,n=r.inject("lk-tabs",null),a=r.computed(()=>n?n.activeTab.value===e.index:!0);return(o,s)=>r.withDirectives((r.openBlock(),r.createElementBlock("div",r.mergeProps({"data-lk-component":"tab-content"},o.$attrs),[r.renderSlot(o.$slots,"default")],16)),[[r.vShow,a.value]])}});exports.DROPDOWN_INJECTION_KEY=bt;exports.LkBadge=_r;exports.LkButton=$a;exports.LkCard=Ze;exports.LkColors=zt;exports.LkColorsWithOnTokens=Rn;exports.LkColumn=Cr;exports.LkContainer=br;exports.LkDropdown=Hr;exports.LkDropdownMenu=Gr;exports.LkDropdownTrigger=Ur;exports.LkGrid=wr;exports.LkHeading=Br;exports.LkIcon=Pe;exports.LkIconButton=Aa;exports.LkImage=Vr;exports.LkMaterialLayer=Or;exports.LkMenuItem=Oa;exports.LkNavbar=Ea;exports.LkPlaceholderBlock=Mr;exports.LkRow=vt;exports.LkSection=vr;exports.LkSelect=Kr;exports.LkSelectMenu=ea;exports.LkSelectOption=aa;exports.LkSelectTrigger=Zr;exports.LkSnackbar=da;exports.LkStateLayer=Oe;exports.LkSticker=Sr;exports.LkSwitch=Ha;exports.LkTabContent=Qa;exports.LkTabLink=jt;exports.LkTabMenu=Ht;exports.LkTabs=Za;exports.LkText=wt;exports.LkTextInput=Ya;exports.LkTheme=Hn;exports.LkThemeController=kr;exports.THEME_INJECTION_KEY=kt;exports.getColorsWithoutOnTokens=jn;exports.getOnToken=we;exports.propsToDataAttrs=W;exports.provideDropdown=Rt;exports.provideTheme=Ft;exports.useDropdown=Ct;exports.useTheme=Ot;