tailwind-material-colors
Version:
TailwindCSS Plugin to use the Material 3 Color System with Tailwind
308 lines • 98.8 kB
JavaScript
/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function t(t){return t<0?-1:0===t?0:1}function e(t,e,r){return(1-r)*t+r*e}function r(t,e,r){return r<t?t:r>e?e:r}function n(t){return(t%=360)<0&&(t+=360),t}function a(t){return(t%=360)<0&&(t+=360),t}function o(t,e){return[t[0]*e[0][0]+t[1]*e[0][1]+t[2]*e[0][2],t[0]*e[1][0]+t[1]*e[1][1]+t[2]*e[1][2],t[0]*e[2][0]+t[1]*e[2][1]+t[2]*e[2][2]]}
/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/const i=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],s=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],c=[95.047,100,108.883];function l(t,e,r){return(255<<24|(255&t)<<16|(255&e)<<8|255&r)>>>0}function u(t){return l(y(t[0]),y(t[1]),y(t[2]))}function h(t){return t>>16&255}function d(t){return t>>8&255}function f(t){return 255&t}function m(t){const e=function(t){return o([b(h(t)),b(d(t)),b(f(t))],i)}(t)[1];return 116*k(e/100)-16}function g(t){return 100*function(t){const e=24389/27,r=t*t*t;return r>216/24389?r:(116*t-16)/e}
/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/((t+16)/116)}function p(t){return 116*k(t/100)-16}function b(t){const e=t/255;return e<=.040449936?e/12.92*100:100*Math.pow((e+.055)/1.055,2.4)}function y(t){const e=t/100;let r=0;return r=e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,n=0,a=255,(o=Math.round(255*r))<n?n:o>a?a:o;var n,a,o}function k(t){const e=24389/27;return t>216/24389?Math.pow(t,1/3):(e*t+16)/116}class w{static make(t=function(){return c}(),r=200/Math.PI*g(50)/100,n=50,a=2,o=!1){const i=t,s=.401288*i[0]+.650173*i[1]+-.051461*i[2],l=-.250268*i[0]+1.204414*i[1]+.045854*i[2],u=-.002079*i[0]+.048952*i[1]+.953127*i[2],h=.8+a/10,d=h>=.9?e(.59,.69,10*(h-.9)):e(.525,.59,10*(h-.8));let f=o?1:h*(1-1/3.6*Math.exp((-r-42)/92));f=f>1?1:f<0?0:f;const m=h,p=[f*(100/s)+1-f,f*(100/l)+1-f,f*(100/u)+1-f],b=1/(5*r+1),y=b*b*b*b,k=1-y,v=y*r+.1*k*k*Math.cbrt(5*r),M=g(n)/t[1],C=1.48+Math.sqrt(M),P=.725/Math.pow(M,.2),x=P,I=[Math.pow(v*p[0]*s/100,.42),Math.pow(v*p[1]*l/100,.42),Math.pow(v*p[2]*u/100,.42)],D=[400*I[0]/(I[0]+27.13),400*I[1]/(I[1]+27.13),400*I[2]/(I[2]+27.13)];return new w(M,(2*D[0]+D[1]+.05*D[2])*P,P,x,d,m,p,v,Math.pow(v,.25),C)}constructor(t,e,r,n,a,o,i,s,c,l){this.n=t,this.aw=e,this.nbb=r,this.ncb=n,this.c=a,this.nc=o,this.rgbD=i,this.fl=s,this.fLRoot=c,this.z=l}}w.DEFAULT=w.make();
/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class v{constructor(t,e,r,n,a,o,i,s,c){this.hue=t,this.chroma=e,this.j=r,this.q=n,this.m=a,this.s=o,this.jstar=i,this.astar=s,this.bstar=c}distance(t){const e=this.jstar-t.jstar,r=this.astar-t.astar,n=this.bstar-t.bstar,a=Math.sqrt(e*e+r*r+n*n);return 1.41*Math.pow(a,.63)}static fromInt(t){return v.fromIntInViewingConditions(t,w.DEFAULT)}static fromIntInViewingConditions(e,r){const n=(65280&e)>>8,a=255&e,o=b((16711680&e)>>16),i=b(n),s=b(a),c=.41233895*o+.35762064*i+.18051042*s,l=.2126*o+.7152*i+.0722*s,u=.01932141*o+.11916382*i+.95034478*s,h=.401288*c+.650173*l-.051461*u,d=-.250268*c+1.204414*l+.045854*u,f=-.002079*c+.048952*l+.953127*u,m=r.rgbD[0]*h,g=r.rgbD[1]*d,p=r.rgbD[2]*f,y=Math.pow(r.fl*Math.abs(m)/100,.42),k=Math.pow(r.fl*Math.abs(g)/100,.42),w=Math.pow(r.fl*Math.abs(p)/100,.42),M=400*t(m)*y/(y+27.13),C=400*t(g)*k/(k+27.13),P=400*t(p)*w/(w+27.13),x=(11*M+-12*C+P)/11,I=(M+C-2*P)/9,D=(20*M+20*C+21*P)/20,A=(40*M+20*C+P)/20,_=180*Math.atan2(I,x)/Math.PI,O=_<0?_+360:_>=360?_-360:_,S=O*Math.PI/180,T=A*r.nbb,B=100*Math.pow(T/r.aw,r.c*r.z),H=4/r.c*Math.sqrt(B/100)*(r.aw+4)*r.fLRoot,$=O<20.14?O+360:O,F=5e4/13*(.25*(Math.cos($*Math.PI/180+2)+3.8))*r.nc*r.ncb*Math.sqrt(x*x+I*I)/(D+.305),j=Math.pow(F,.9)*Math.pow(1.64-Math.pow(.29,r.n),.73),L=j*Math.sqrt(B/100),R=L*r.fLRoot,E=50*Math.sqrt(j*r.c/(r.aw+4)),V=(1+100*.007)*B/(1+.007*B),N=1/.0228*Math.log(1+.0228*R),q=N*Math.cos(S),z=N*Math.sin(S);return new v(O,L,B,H,R,E,V,q,z)}static fromJch(t,e,r){return v.fromJchInViewingConditions(t,e,r,w.DEFAULT)}static fromJchInViewingConditions(t,e,r,n){const a=4/n.c*Math.sqrt(t/100)*(n.aw+4)*n.fLRoot,o=e*n.fLRoot,i=e/Math.sqrt(t/100),s=50*Math.sqrt(i*n.c/(n.aw+4)),c=r*Math.PI/180,l=(1+100*.007)*t/(1+.007*t),u=1/.0228*Math.log(1+.0228*o),h=u*Math.cos(c),d=u*Math.sin(c);return new v(r,e,t,a,o,s,l,h,d)}static fromUcs(t,e,r){return v.fromUcsInViewingConditions(t,e,r,w.DEFAULT)}static fromUcsInViewingConditions(t,e,r,n){const a=e,o=r,i=Math.sqrt(a*a+o*o),s=(Math.exp(.0228*i)-1)/.0228/n.fLRoot;let c=Math.atan2(o,a)*(180/Math.PI);c<0&&(c+=360);const l=t/(1-.007*(t-100));return v.fromJchInViewingConditions(l,s,c,n)}toInt(){return this.viewed(w.DEFAULT)}viewed(e){const r=0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100),n=Math.pow(r/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),a=this.hue*Math.PI/180,o=.25*(Math.cos(a+2)+3.8),i=e.aw*Math.pow(this.j/100,1/e.c/e.z),c=o*(5e4/13)*e.nc*e.ncb,u=i/e.nbb,h=Math.sin(a),d=Math.cos(a),f=23*(u+.305)*n/(23*c+11*n*d+108*n*h),m=f*d,g=f*h,p=(460*u+451*m+288*g)/1403,b=(460*u-891*m-261*g)/1403,k=(460*u-220*m-6300*g)/1403,w=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),v=t(p)*(100/e.fl)*Math.pow(w,1/.42),M=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),C=t(b)*(100/e.fl)*Math.pow(M,1/.42),P=Math.max(0,27.13*Math.abs(k)/(400-Math.abs(k))),x=t(k)*(100/e.fl)*Math.pow(P,1/.42),I=v/e.rgbD[0],D=C/e.rgbD[1],A=x/e.rgbD[2],_=function(t,e,r){const n=s,a=n[0][0]*t+n[0][1]*e+n[0][2]*r,o=n[1][0]*t+n[1][1]*e+n[1][2]*r,i=n[2][0]*t+n[2][1]*e+n[2][2]*r;return l(y(a),y(o),y(i))}(1.86206786*I-1.01125463*D+.14918677*A,.38752654*I+.62144744*D-.00897398*A,-.0158415*I-.03412294*D+1.04996444*A);return _}static fromXyzInViewingConditions(e,r,n,a){const o=.401288*e+.650173*r-.051461*n,i=-.250268*e+1.204414*r+.045854*n,s=-.002079*e+.048952*r+.953127*n,c=a.rgbD[0]*o,l=a.rgbD[1]*i,u=a.rgbD[2]*s,h=Math.pow(a.fl*Math.abs(c)/100,.42),d=Math.pow(a.fl*Math.abs(l)/100,.42),f=Math.pow(a.fl*Math.abs(u)/100,.42),m=400*t(c)*h/(h+27.13),g=400*t(l)*d/(d+27.13),p=400*t(u)*f/(f+27.13),b=(11*m+-12*g+p)/11,y=(m+g-2*p)/9,k=(20*m+20*g+21*p)/20,w=(40*m+20*g+p)/20,M=180*Math.atan2(y,b)/Math.PI,C=M<0?M+360:M>=360?M-360:M,P=C*Math.PI/180,x=w*a.nbb,I=100*Math.pow(x/a.aw,a.c*a.z),D=4/a.c*Math.sqrt(I/100)*(a.aw+4)*a.fLRoot,A=C<20.14?C+360:C,_=5e4/13*(1/4*(Math.cos(A*Math.PI/180+2)+3.8))*a.nc*a.ncb*Math.sqrt(b*b+y*y)/(k+.305),O=Math.pow(_,.9)*Math.pow(1.64-Math.pow(.29,a.n),.73),S=O*Math.sqrt(I/100),T=S*a.fLRoot,B=50*Math.sqrt(O*a.c/(a.aw+4)),H=(1+100*.007)*I/(1+.007*I),$=Math.log(1+.0228*T)/.0228,F=$*Math.cos(P),j=$*Math.sin(P);return new v(C,S,I,D,T,B,H,F,j)}xyzInViewingConditions(e){const r=0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100),n=Math.pow(r/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),a=this.hue*Math.PI/180,o=.25*(Math.cos(a+2)+3.8),i=e.aw*Math.pow(this.j/100,1/e.c/e.z),s=o*(5e4/13)*e.nc*e.ncb,c=i/e.nbb,l=Math.sin(a),u=Math.cos(a),h=23*(c+.305)*n/(23*s+11*n*u+108*n*l),d=h*u,f=h*l,m=(460*c+451*d+288*f)/1403,g=(460*c-891*d-261*f)/1403,p=(460*c-220*d-6300*f)/1403,b=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),y=t(m)*(100/e.fl)*Math.pow(b,1/.42),k=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),w=t(g)*(100/e.fl)*Math.pow(k,1/.42),v=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),M=t(p)*(100/e.fl)*Math.pow(v,1/.42),C=y/e.rgbD[0],P=w/e.rgbD[1],x=M/e.rgbD[2];return[1.86206786*C-1.01125463*P+.14918677*x,.38752654*C+.62144744*P-.00897398*x,-.0158415*C-.03412294*P+1.04996444*x]}}
/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class M{static sanitizeRadians(t){return(t+8*Math.PI)%(2*Math.PI)}static trueDelinearized(t){const e=t/100;let r=0;return r=e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,255*r}static chromaticAdaptation(e){const r=Math.pow(Math.abs(e),.42);return 400*t(e)*r/(r+27.13)}static hueOf(t){const e=o(t,M.SCALED_DISCOUNT_FROM_LINRGB),r=M.chromaticAdaptation(e[0]),n=M.chromaticAdaptation(e[1]),a=M.chromaticAdaptation(e[2]),i=(11*r+-12*n+a)/11,s=(r+n-2*a)/9;return Math.atan2(s,i)}static areInCyclicOrder(t,e,r){return M.sanitizeRadians(e-t)<M.sanitizeRadians(r-t)}static intercept(t,e,r){return(e-t)/(r-t)}static lerpPoint(t,e,r){return[t[0]+(r[0]-t[0])*e,t[1]+(r[1]-t[1])*e,t[2]+(r[2]-t[2])*e]}static setCoordinate(t,e,r,n){const a=M.intercept(t[n],e,r[n]);return M.lerpPoint(t,a,r)}static isBounded(t){return 0<=t&&t<=100}static nthVertex(t,e){const r=M.Y_FROM_LINRGB[0],n=M.Y_FROM_LINRGB[1],a=M.Y_FROM_LINRGB[2],o=e%4<=1?0:100,i=e%2==0?0:100;if(e<4){const e=o,s=i,c=(t-e*n-s*a)/r;return M.isBounded(c)?[c,e,s]:[-1,-1,-1]}if(e<8){const e=o,s=i,c=(t-s*r-e*a)/n;return M.isBounded(c)?[s,c,e]:[-1,-1,-1]}{const e=o,s=i,c=(t-e*r-s*n)/a;return M.isBounded(c)?[e,s,c]:[-1,-1,-1]}}static bisectToSegment(t,e){let r=[-1,-1,-1],n=r,a=0,o=0,i=!1,s=!0;for(let c=0;c<12;c++){const l=M.nthVertex(t,c);if(l[0]<0)continue;const u=M.hueOf(l);i?(s||M.areInCyclicOrder(a,u,o))&&(s=!1,M.areInCyclicOrder(a,e,u)?(n=l,o=u):(r=l,a=u)):(r=l,n=l,a=u,o=u,i=!0)}return[r,n]}static midpoint(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2,(t[2]+e[2])/2]}static criticalPlaneBelow(t){return Math.floor(t-.5)}static criticalPlaneAbove(t){return Math.ceil(t-.5)}static bisectToLimit(t,e){const r=M.bisectToSegment(t,e);let n=r[0],a=M.hueOf(n),o=r[1];for(let t=0;t<3;t++)if(n[t]!==o[t]){let r=-1,i=255;n[t]<o[t]?(r=M.criticalPlaneBelow(M.trueDelinearized(n[t])),i=M.criticalPlaneAbove(M.trueDelinearized(o[t]))):(r=M.criticalPlaneAbove(M.trueDelinearized(n[t])),i=M.criticalPlaneBelow(M.trueDelinearized(o[t])));for(let s=0;s<8&&!(Math.abs(i-r)<=1);s++){const s=Math.floor((r+i)/2),c=M.CRITICAL_PLANES[s],l=M.setCoordinate(n,c,o,t),u=M.hueOf(l);M.areInCyclicOrder(a,e,u)?(o=l,i=s):(n=l,a=u,r=s)}}return M.midpoint(n,o)}static inverseChromaticAdaptation(e){const r=Math.abs(e),n=Math.max(0,27.13*r/(400-r));return t(e)*Math.pow(n,1/.42)}static findResultByJ(t,e,r){let n=11*Math.sqrt(r);const a=w.DEFAULT,i=1/Math.pow(1.64-Math.pow(.29,a.n),.73),s=.25*(Math.cos(t+2)+3.8)*(5e4/13)*a.nc*a.ncb,c=Math.sin(t),l=Math.cos(t);for(let t=0;t<5;t++){const h=n/100,d=0===e||0===n?0:e/Math.sqrt(h),f=Math.pow(d*i,1/.9),m=a.aw*Math.pow(h,1/a.c/a.z)/a.nbb,g=23*(m+.305)*f/(23*s+11*f*l+108*f*c),p=g*l,b=g*c,y=(460*m+451*p+288*b)/1403,k=(460*m-891*p-261*b)/1403,w=(460*m-220*p-6300*b)/1403,v=o([M.inverseChromaticAdaptation(y),M.inverseChromaticAdaptation(k),M.inverseChromaticAdaptation(w)],M.LINRGB_FROM_SCALED_DISCOUNT);if(v[0]<0||v[1]<0||v[2]<0)return 0;const C=M.Y_FROM_LINRGB[0],P=M.Y_FROM_LINRGB[1],x=M.Y_FROM_LINRGB[2],I=C*v[0]+P*v[1]+x*v[2];if(I<=0)return 0;if(4===t||Math.abs(I-r)<.002)return v[0]>100.01||v[1]>100.01||v[2]>100.01?0:u(v);n-=(I-r)*n/(2*I)}return 0}static solveToInt(t,e,r){if(e<1e-4||r<1e-4||r>99.9999)return function(t){const e=y(g(t));return l(e,e,e)}(r);const n=(t=a(t))/180*Math.PI,o=g(r),i=M.findResultByJ(n,e,o);if(0!==i)return i;return u(M.bisectToLimit(o,n))}static solveToCam(t,e,r){return v.fromInt(M.solveToInt(t,e,r))}}M.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],M.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],M.Y_FROM_LINRGB=[.2126,.7152,.0722],M.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];
/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class C{static from(t,e,r){return new C(M.solveToInt(t,e,r))}static fromInt(t){return new C(t)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(t){this.setInternalState(M.solveToInt(t,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(t){this.setInternalState(M.solveToInt(this.internalHue,t,this.internalTone))}get tone(){return this.internalTone}set tone(t){this.setInternalState(M.solveToInt(this.internalHue,this.internalChroma,t))}constructor(t){this.argb=t;const e=v.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=m(t),this.argb=t}setInternalState(t){const e=v.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=m(t),this.argb=t}inViewingConditions(t){const e=v.fromInt(this.toInt()).xyzInViewingConditions(t),r=v.fromXyzInViewingConditions(e[0],e[1],e[2],w.make());return C.from(r.hue,r.chroma,p(e[1]))}}
/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class P{static harmonize(t,e){const r=C.fromInt(t),n=C.fromInt(e),o=(i=r.hue,s=n.hue,180-Math.abs(Math.abs(i-s)-180));var i,s;const c=Math.min(.5*o,15),l=a(r.hue+c*(u=r.hue,a(n.hue-u)<=180?1:-1));var u;return C.from(l,r.chroma,r.tone).toInt()}static hctHue(t,e,r){const n=P.cam16Ucs(t,e,r),a=v.fromInt(n),o=v.fromInt(t);return C.from(a.hue,o.chroma,m(t)).toInt()}static cam16Ucs(t,e,r){const n=v.fromInt(t),a=v.fromInt(e),o=n.jstar,i=n.astar,s=n.bstar,c=o+(a.jstar-o)*r,l=i+(a.astar-i)*r,u=s+(a.bstar-s)*r;return v.fromUcs(c,l,u).toInt()}}
/**
* @license
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class x{static ratioOfTones(t,e){return t=r(0,100,t),e=r(0,100,e),x.ratioOfYs(g(t),g(e))}static ratioOfYs(t,e){const r=t>e?t:e;return(r+5)/((r===e?t:e)+5)}static lighter(t,e){if(t<0||t>100)return-1;const r=g(t),n=e*(r+5)-5,a=x.ratioOfYs(n,r),o=Math.abs(a-e);if(a<e&&o>.04)return-1;const i=p(n)+.4;return i<0||i>100?-1:i}static darker(t,e){if(t<0||t>100)return-1;const r=g(t),n=(r+5)/e-5,a=x.ratioOfYs(r,n),o=Math.abs(a-e);if(a<e&&o>.04)return-1;const i=p(n)-.4;return i<0||i>100?-1:i}static lighterUnsafe(t,e){const r=x.lighter(t,e);return r<0?100:r}static darkerUnsafe(t,e){const r=x.darker(t,e);return r<0?0:r}}
/**
* @license
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class I{static isDisliked(t){const e=Math.round(t.hue)>=90&&Math.round(t.hue)<=111,r=Math.round(t.chroma)>16,n=Math.round(t.tone)<65;return e&&r&&n}static fixIfDisliked(t){return I.isDisliked(t)?C.from(t.hue,t.chroma,70):t}}
/**
* @license
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class D{static fromPalette(t){return new D(t.name??"",t.palette,t.tone,t.isBackground??!1,t.background,t.secondBackground,t.contrastCurve,t.toneDeltaPair)}constructor(t,e,r,n,a,o,i,s){if(this.name=t,this.palette=e,this.tone=r,this.isBackground=n,this.background=a,this.secondBackground=o,this.contrastCurve=i,this.toneDeltaPair=s,this.hctCache=new Map,!a&&o)throw new Error(`Color ${t} has secondBackgrounddefined, but background is not defined.`);if(!a&&i)throw new Error(`Color ${t} has contrastCurvedefined, but background is not defined.`);if(a&&!i)throw new Error(`Color ${t} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(t){return this.getHct(t).toInt()}getHct(t){const e=this.hctCache.get(t);if(null!=e)return e;const r=this.getTone(t),n=this.palette(t).getHct(r);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(t,n),n}getTone(t){const e=t.contrastLevel<0;if(this.toneDeltaPair){const n=this.toneDeltaPair(t),a=n.roleA,o=n.roleB,i=n.delta,s=n.polarity,c=n.stayTogether,l=this.background(t).getTone(t),u="nearer"===s||"lighter"===s&&!t.isDark||"darker"===s&&t.isDark,h=u?a:o,d=u?o:a,f=this.name===h.name,m=t.isDark?1:-1,g=h.contrastCurve.getContrast(t.contrastLevel),p=d.contrastCurve.getContrast(t.contrastLevel),b=h.tone(t);let y=x.ratioOfTones(l,b)>=g?b:D.foregroundTone(l,g);const k=d.tone(t);let w=x.ratioOfTones(l,k)>=p?k:D.foregroundTone(l,p);return e&&(y=D.foregroundTone(l,g),w=D.foregroundTone(l,p)),(w-y)*m>=i||(w=r(0,100,y+i*m),(w-y)*m>=i||(y=r(0,100,w-i*m))),50<=y&&y<60?m>0?(y=60,w=Math.max(w,y+i*m)):(y=49,w=Math.min(w,y+i*m)):50<=w&&w<60&&(c?m>0?(y=60,w=Math.max(w,y+i*m)):(y=49,w=Math.min(w,y+i*m)):w=m>0?60:49),f?y:w}{let r=this.tone(t);if(null==this.background)return r;const n=this.background(t).getTone(t),a=this.contrastCurve.getContrast(t.contrastLevel);if(x.ratioOfTones(n,r)>=a||(r=D.foregroundTone(n,a)),e&&(r=D.foregroundTone(n,a)),this.isBackground&&50<=r&&r<60&&(r=x.ratioOfTones(49,n)>=a?49:60),this.secondBackground){const[e,n]=[this.background,this.secondBackground],[o,i]=[e(t).getTone(t),n(t).getTone(t)],[s,c]=[Math.max(o,i),Math.min(o,i)];if(x.ratioOfTones(s,r)>=a&&x.ratioOfTones(c,r)>=a)return r;const l=x.lighter(s,a),u=x.darker(c,a),h=[];-1!==l&&h.push(l),-1!==u&&h.push(u);return D.tonePrefersLightForeground(o)||D.tonePrefersLightForeground(i)?l<0?100:l:1===h.length?h[0]:u<0?0:u}return r}}static foregroundTone(t,e){const r=x.lighterUnsafe(t,e),n=x.darkerUnsafe(t,e),a=x.ratioOfTones(r,t),o=x.ratioOfTones(n,t);if(D.tonePrefersLightForeground(t)){const t=Math.abs(a-o)<.1&&a<e&&o<e;return a>=e||a>=o||t?r:n}return o>=e||o>=a?n:r}static tonePrefersLightForeground(t){return Math.round(t)<60}static toneAllowsLightForeground(t){return Math.round(t)<=49}static enableLightForeground(t){return D.tonePrefersLightForeground(t)&&!D.toneAllowsLightForeground(t)?49:t}}
/**
* @license
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var A;!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"}(A||(A={}));
/**
* @license
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class _{constructor(t,e,r,n){this.low=t,this.normal=e,this.medium=r,this.high=n}getContrast(t){return t<=-1?this.low:t<0?e(this.low,this.normal,(t- -1)/1):t<.5?e(this.normal,this.medium,(t-0)/.5):t<1?e(this.medium,this.high,(t-.5)/.5):this.high}}
/**
* @license
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class O{constructor(t,e,r,n,a){this.roleA=t,this.roleB=e,this.delta=r,this.polarity=n,this.stayTogether=a}}
/**
* @license
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/function S(t){return t.variant===A.FIDELITY||t.variant===A.CONTENT}function T(t){return t.variant===A.MONOCHROME}function B(t,e){const r=t.inViewingConditions(function(t){return w.make(void 0,void 0,t.isDark?30:80,void 0,void 0)}(e));return D.tonePrefersLightForeground(t.tone)&&!D.toneAllowsLightForeground(r.tone)?D.enableLightForeground(t.tone):D.enableLightForeground(r.tone)}class H{static highestSurface(t){return t.isDark?H.surfaceBright:H.surfaceDim}}H.contentAccentToneDelta=15,H.primaryPaletteKeyColor=D.fromPalette({name:"primary_palette_key_color",palette:t=>t.primaryPalette,tone:t=>t.primaryPalette.keyColor.tone}),H.secondaryPaletteKeyColor=D.fromPalette({name:"secondary_palette_key_color",palette:t=>t.secondaryPalette,tone:t=>t.secondaryPalette.keyColor.tone}),H.tertiaryPaletteKeyColor=D.fromPalette({name:"tertiary_palette_key_color",palette:t=>t.tertiaryPalette,tone:t=>t.tertiaryPalette.keyColor.tone}),H.neutralPaletteKeyColor=D.fromPalette({name:"neutral_palette_key_color",palette:t=>t.neutralPalette,tone:t=>t.neutralPalette.keyColor.tone}),H.neutralVariantPaletteKeyColor=D.fromPalette({name:"neutral_variant_palette_key_color",palette:t=>t.neutralVariantPalette,tone:t=>t.neutralVariantPalette.keyColor.tone}),H.background=D.fromPalette({name:"background",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0}),H.onBackground=D.fromPalette({name:"on_background",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>H.background,contrastCurve:new _(3,3,4.5,7)}),H.surface=D.fromPalette({name:"surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0}),H.surfaceDim=D.fromPalette({name:"surface_dim",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:87,isBackground:!0}),H.surfaceBright=D.fromPalette({name:"surface_bright",palette:t=>t.neutralPalette,tone:t=>t.isDark?24:98,isBackground:!0}),H.surfaceContainerLowest=D.fromPalette({name:"surface_container_lowest",palette:t=>t.neutralPalette,tone:t=>t.isDark?4:100,isBackground:!0}),H.surfaceContainerLow=D.fromPalette({name:"surface_container_low",palette:t=>t.neutralPalette,tone:t=>t.isDark?10:96,isBackground:!0}),H.surfaceContainer=D.fromPalette({name:"surface_container",palette:t=>t.neutralPalette,tone:t=>t.isDark?12:94,isBackground:!0}),H.surfaceContainerHigh=D.fromPalette({name:"surface_container_high",palette:t=>t.neutralPalette,tone:t=>t.isDark?17:92,isBackground:!0}),H.surfaceContainerHighest=D.fromPalette({name:"surface_container_highest",palette:t=>t.neutralPalette,tone:t=>t.isDark?22:90,isBackground:!0}),H.onSurface=D.fromPalette({name:"on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>H.highestSurface(t),contrastCurve:new _(4.5,7,11,21)}),H.surfaceVariant=D.fromPalette({name:"surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:90,isBackground:!0}),H.onSurfaceVariant=D.fromPalette({name:"on_surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?80:30,background:t=>H.highestSurface(t),contrastCurve:new _(3,4.5,7,11)}),H.inverseSurface=D.fromPalette({name:"inverse_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:20}),H.inverseOnSurface=D.fromPalette({name:"inverse_on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?20:95,background:t=>H.inverseSurface,contrastCurve:new _(4.5,7,11,21)}),H.outline=D.fromPalette({name:"outline",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?60:50,background:t=>H.highestSurface(t),contrastCurve:new _(1.5,3,4.5,7)}),H.outlineVariant=D.fromPalette({name:"outline_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:80,background:t=>H.highestSurface(t),contrastCurve:new _(1,1,3,7)}),H.shadow=D.fromPalette({name:"shadow",palette:t=>t.neutralPalette,tone:t=>0}),H.scrim=D.fromPalette({name:"scrim",palette:t=>t.neutralPalette,tone:t=>0}),H.surfaceTint=D.fromPalette({name:"surface_tint",palette:t=>t.primaryPalette,tone:t=>t.isDark?80:40,isBackground:!0}),H.primary=D.fromPalette({name:"primary",palette:t=>t.primaryPalette,tone:t=>T(t)?t.isDark?100:0:t.isDark?80:40,isBackground:!0,background:t=>H.highestSurface(t),contrastCurve:new _(3,4.5,7,11),toneDeltaPair:t=>new O(H.primaryContainer,H.primary,15,"nearer",!1)}),H.onPrimary=D.fromPalette({name:"on_primary",palette:t=>t.primaryPalette,tone:t=>T(t)?t.isDark?10:90:t.isDark?20:100,background:t=>H.primary,contrastCurve:new _(4.5,7,11,21)}),H.primaryContainer=D.fromPalette({name:"primary_container",palette:t=>t.primaryPalette,tone:t=>S(t)?B(t.sourceColorHct,t):T(t)?t.isDark?85:25:t.isDark?30:90,isBackground:!0,background:t=>H.highestSurface(t),contrastCurve:new _(1,1,3,7),toneDeltaPair:t=>new O(H.primaryContainer,H.primary,15,"nearer",!1)}),H.onPrimaryContainer=D.fromPalette({name:"on_primary_container",palette:t=>t.primaryPalette,tone:t=>S(t)?D.foregroundTone(H.primaryContainer.tone(t),4.5):T(t)?t.isDark?0:100:t.isDark?90:10,background:t=>H.primaryContainer,contrastCurve:new _(4.5,7,11,21)}),H.inversePrimary=D.fromPalette({name:"inverse_primary",palette:t=>t.primaryPalette,tone:t=>t.isDark?40:80,background:t=>H.inverseSurface,contrastCurve:new _(3,4.5,7,11)}),H.secondary=D.fromPalette({name:"secondary",palette:t=>t.secondaryPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>H.highestSurface(t),contrastCurve:new _(3,4.5,7,11),toneDeltaPair:t=>new O(H.secondaryContainer,H.secondary,15,"nearer",!1)}),H.onSecondary=D.fromPalette({name:"on_secondary",palette:t=>t.secondaryPalette,tone:t=>T(t)?t.isDark?10:100:t.isDark?20:100,background:t=>H.secondary,contrastCurve:new _(4.5,7,11,21)}),H.secondaryContainer=D.fromPalette({name:"secondary_container",palette:t=>t.secondaryPalette,tone:t=>{const e=t.isDark?30:90;if(T(t))return t.isDark?30:85;if(!S(t))return e;let r=function(t,e,r,n){let a=r,o=C.from(t,e,r);if(o.chroma<e){let r=o.chroma;for(;o.chroma<e;){a+=n?-1:1;const i=C.from(t,e,a);if(r>i.chroma)break;if(Math.abs(i.chroma-e)<.4)break;Math.abs(i.chroma-e)<Math.abs(o.chroma-e)&&(o=i),r=Math.max(r,i.chroma)}}return a}(t.secondaryPalette.hue,t.secondaryPalette.chroma,e,!t.isDark);return r=B(t.secondaryPalette.getHct(r),t),r},isBackground:!0,background:t=>H.highestSurface(t),contrastCurve:new _(1,1,3,7),toneDeltaPair:t=>new O(H.secondaryContainer,H.secondary,15,"nearer",!1)}),H.onSecondaryContainer=D.fromPalette({name:"on_secondary_container",palette:t=>t.secondaryPalette,tone:t=>S(t)?D.foregroundTone(H.secondaryContainer.tone(t),4.5):t.isDark?90:10,background:t=>H.secondaryContainer,contrastCurve:new _(4.5,7,11,21)}),H.tertiary=D.fromPalette({name:"tertiary",palette:t=>t.tertiaryPalette,tone:t=>T(t)?t.isDark?90:25:t.isDark?80:40,isBackground:!0,background:t=>H.highestSurface(t),contrastCurve:new _(3,4.5,7,11),toneDeltaPair:t=>new O(H.tertiaryContainer,H.tertiary,15,"nearer",!1)}),H.onTertiary=D.fromPalette({name:"on_tertiary",palette:t=>t.tertiaryPalette,tone:t=>T(t)?t.isDark?10:90:t.isDark?20:100,background:t=>H.tertiary,contrastCurve:new _(4.5,7,11,21)}),H.tertiaryContainer=D.fromPalette({name:"tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>{if(T(t))return t.isDark?60:49;if(!S(t))return t.isDark?30:90;const e=B(t.tertiaryPalette.getHct(t.sourceColorHct.tone),t),r=t.tertiaryPalette.getHct(e);return I.fixIfDisliked(r).tone},isBackground:!0,background:t=>H.highestSurface(t),contrastCurve:new _(1,1,3,7),toneDeltaPair:t=>new O(H.tertiaryContainer,H.tertiary,15,"nearer",!1)}),H.onTertiaryContainer=D.fromPalette({name:"on_tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>T(t)?t.isDark?0:100:S(t)?D.foregroundTone(H.tertiaryContainer.tone(t),4.5):t.isDark?90:10,background:t=>H.tertiaryContainer,contrastCurve:new _(4.5,7,11,21)}),H.error=D.fromPalette({name:"error",palette:t=>t.errorPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>H.highestSurface(t),contrastCurve:new _(3,4.5,7,11),toneDeltaPair:t=>new O(H.errorContainer,H.error,15,"nearer",!1)}),H.onError=D.fromPalette({name:"on_error",palette:t=>t.errorPalette,tone:t=>t.isDark?20:100,background:t=>H.error,contrastCurve:new _(4.5,7,11,21)}),H.errorContainer=D.fromPalette({name:"error_container",palette:t=>t.errorPalette,tone:t=>t.isDark?30:90,isBackground:!0,background:t=>H.highestSurface(t),contrastCurve:new _(1,1,3,7),toneDeltaPair:t=>new O(H.errorContainer,H.error,15,"nearer",!1)}),H.onErrorContainer=D.fromPalette({name:"on_error_container",palette:t=>t.errorPalette,tone:t=>t.isDark?90:10,background:t=>H.errorContainer,contrastCurve:new _(4.5,7,11,21)}),H.primaryFixed=D.fromPalette({name:"primary_fixed",palette:t=>t.primaryPalette,tone:t=>T(t)?40:90,isBackground:!0,background:t=>H.highestSurface(t),contrastCurve:new _(1,1,3,7),toneDeltaPair:t=>new O(H.primaryFixed,H.primaryFixedDim,10,"lighter",!0)}),H.primaryFixedDim=D.fromPalette({name:"primary_fixed_dim",palette:t=>t.primaryPalette,tone:t=>T(t)?30:80,isBackground:!0,background:t=>H.highestSurface(t),contrastCurve:new _(1,1,3,7),toneDeltaPair:t=>new O(H.primaryFixed,H.primaryFixedDim,10,"lighter",!0)}),H.onPrimaryFixed=D.fromPalette({name:"on_primary_fixed",palette:t=>t.primaryPalette,tone:t=>T(t)?100:10,background:t=>H.primaryFixedDim,secondBackground:t=>H.primaryFixed,contrastCurve:new _(4.5,7,11,21)}),H.onPrimaryFixedVariant=D.fromPalette({name:"on_primary_fixed_variant",palette:t=>t.primaryPalette,tone:t=>T(t)?90:30,background:t=>H.primaryFixedDim,secondBackground:t=>H.primaryFixed,contrastCurve:new _(3,4.5,7,11)}),H.secondaryFixed=D.fromPalette({name:"secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>T(t)?80:90,isBackground:!0,background:t=>H.highestSurface(t),contrastCurve:new _(1,1,3,7),toneDeltaPair:t=>new O(H.secondaryFixed,H.secondaryFixedDim,10,"lighter",!0)}),H.secondaryFixedDim=D.fromPalette({name:"secondary_fixed_dim",palette:t=>t.secondaryPalette,tone:t=>T(t)?70:80,isBackground:!0,background:t=>H.highestSurface(t),contrastCurve:new _(1,1,3,7),toneDeltaPair:t=>new O(H.secondaryFixed,H.secondaryFixedDim,10,"lighter",!0)}),H.onSecondaryFixed=D.fromPalette({name:"on_secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>10,background:t=>H.secondaryFixedDim,secondBackground:t=>H.secondaryFixed,contrastCurve:new _(4.5,7,11,21)}),H.onSecondaryFixedVariant=D.fromPalette({name:"on_secondary_fixed_variant",palette:t=>t.secondaryPalette,tone:t=>T(t)?25:30,background:t=>H.secondaryFixedDim,secondBackground:t=>H.secondaryFixed,contrastCurve:new _(3,4.5,7,11)}),H.tertiaryFixed=D.fromPalette({name:"tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>T(t)?40:90,isBackground:!0,background:t=>H.highestSurface(t),contrastCurve:new _(1,1,3,7),toneDeltaPair:t=>new O(H.tertiaryFixed,H.tertiaryFixedDim,10,"lighter",!0)}),H.tertiaryFixedDim=D.fromPalette({name:"tertiary_fixed_dim",palette:t=>t.tertiaryPalette,tone:t=>T(t)?30:80,isBackground:!0,background:t=>H.highestSurface(t),contrastCurve:new _(1,1,3,7),toneDeltaPair:t=>new O(H.tertiaryFixed,H.tertiaryFixedDim,10,"lighter",!0)}),H.onTertiaryFixed=D.fromPalette({name:"on_tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>T(t)?100:10,background:t=>H.tertiaryFixedDim,secondBackground:t=>H.tertiaryFixed,contrastCurve:new _(4.5,7,11,21)}),H.onTertiaryFixedVariant=D.fromPalette({name:"on_tertiary_fixed_variant",palette:t=>t.tertiaryPalette,tone:t=>T(t)?90:30,background:t=>H.tertiaryFixedDim,secondBackground:t=>H.tertiaryFixed,contrastCurve:new _(3,4.5,7,11)});
/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class ${static fromInt(t){const e=C.fromInt(t);return $.fromHct(e)}static fromHct(t){return new $(t.hue,t.chroma,t)}static fromHueAndChroma(t,e){return new $(t,e,$.createKeyColor(t,e))}constructor(t,e,r){this.hue=t,this.chroma=e,this.keyColor=r,this.cache=new Map}static createKeyColor(t,e){let r=C.from(t,e,50),n=Math.abs(r.chroma-e);for(let a=1;a<50;a+=1){if(Math.round(e)===Math.round(r.chroma))return r;const o=C.from(t,e,50+a),i=Math.abs(o.chroma-e);i<n&&(n=i,r=o);const s=C.from(t,e,50-a),c=Math.abs(s.chroma-e);c<n&&(n=c,r=s)}return r}tone(t){let e=this.cache.get(t);return void 0===e&&(e=C.from(this.hue,this.chroma,t).toInt(),this.cache.set(t,e)),e}getHct(t){return C.fromInt(this.tone(t))}}
/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class F{static of(t){return new F(t,!1)}static contentOf(t){return new F(t,!0)}static fromColors(t){return F.createPaletteFromColors(!1,t)}static contentFromColors(t){return F.createPaletteFromColors(!0,t)}static createPaletteFromColors(t,e){const r=new F(e.primary,t);if(e.secondary){const n=new F(e.secondary,t);r.a2=n.a1}if(e.tertiary){const n=new F(e.tertiary,t);r.a3=n.a1}if(e.error){const n=new F(e.error,t);r.error=n.a1}if(e.neutral){const n=new F(e.neutral,t);r.n1=n.n1}if(e.neutralVariant){const n=new F(e.neutralVariant,t);r.n2=n.n2}return r}constructor(t,e){const r=C.fromInt(t),n=r.hue,a=r.chroma;e?(this.a1=$.fromHueAndChroma(n,a),this.a2=$.fromHueAndChroma(n,a/3),this.a3=$.fromHueAndChroma(n+60,a/2),this.n1=$.fromHueAndChroma(n,Math.min(a/12,4)),this.n2=$.fromHueAndChroma(n,Math.min(a/6,8))):(this.a1=$.fromHueAndChroma(n,Math.max(48,a)),this.a2=$.fromHueAndChroma(n,16),this.a3=$.fromHueAndChroma(n+60,24),this.n1=$.fromHueAndChroma(n,4),this.n2=$.fromHueAndChroma(n,8)),this.error=$.fromHueAndChroma(25,84)}}
/**
* @license
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class j{constructor(t){this.sourceColorArgb=t.sourceColorArgb,this.variant=t.variant,this.contrastLevel=t.contrastLevel,this.isDark=t.isDark,this.sourceColorHct=C.fromInt(t.sourceColorArgb),this.primaryPalette=t.primaryPalette,this.secondaryPalette=t.secondaryPalette,this.tertiaryPalette=t.tertiaryPalette,this.neutralPalette=t.neutralPalette,this.neutralVariantPalette=t.neutralVariantPalette,this.errorPalette=$.fromHueAndChroma(25,84)}static getRotatedHue(t,e,r){const n=t.hue;if(e.length!==r.length)throw new Error(`mismatch between hue length ${e.length} & rotations ${r.length}`);if(1===r.length)return a(t.hue+r[0]);const o=e.length;for(let t=0;t<=o-2;t++){const o=e[t],i=e[t+1];if(o<n&&n<i)return a(n+r[t])}return n}}
/**
* @license
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class L{constructor(t){this.input=t,this.hctsByTempCache=[],this.hctsByHueCache=[],this.tempsByHctCache=new Map,this.inputRelativeTemperatureCache=-1,this.complementCache=null}get hctsByTemp(){if(this.hctsByTempCache.length>0)return this.hctsByTempCache;const t=this.hctsByHue.concat([this.input]),e=this.tempsByHct;return t.sort(((t,r)=>e.get(t)-e.get(r))),this.hctsByTempCache=t,t}get warmest(){return this.hctsByTemp[this.hctsByTemp.length-1]}get coldest(){return this.hctsByTemp[0]}analogous(t=5,e=12){const r=Math.round(this.input.hue),a=this.hctsByHue[r];let o=this.relativeTemperature(a);const i=[a];let s=0;for(let t=0;t<360;t++){const e=n(r+t),a=this.hctsByHue[e],i=this.relativeTemperature(a),c=Math.abs(i-o);o=i,s+=c}let c=1;const l=s/e;let u=0;for(o=this.relativeTemperature(a);i.length<e;){const t=n(r+c),a=this.hctsByHue[t],s=this.relativeTemperature(a);u+=Math.abs(s-o);let h=u>=i.length*l,d=1;for(;h&&i.length<e;){i.push(a);h=u>=(i.length+d)*l,d++}if(o=s,c++,c>360){for(;i.length<e;)i.push(a);break}}const h=[this.input],d=Math.floor((t-1)/2);for(let t=1;t<d+1;t++){let e=0-t;for(;e<0;)e=i.length+e;e>=i.length&&(e%=i.length),h.splice(0,0,i[e])}const f=t-d-1;for(let t=1;t<f+1;t++){let e=t;for(;e<0;)e=i.length+e;e>=i.length&&(e%=i.length),h.push(i[e])}return h}get complement(){if(null!=this.complementCache)return this.complementCache;const t=this.coldest.hue,e=this.tempsByHct.get(this.coldest),r=this.warmest.hue,n=this.tempsByHct.get(this.warmest)-e,o=L.isBetween(this.input.hue,t,r),i=o?r:t,s=o?t:r;let c=1e3,l=this.hctsByHue[Math.round(this.input.hue)];const u=1-this.inputRelativeTemperature;for(let t=0;t<=360;t+=1){const r=a(i+1*t);if(!L.isBetween(r,i,s))continue;const o=this.hctsByHue[Math.round(r)],h=(this.tempsByHct.get(o)-e)/n,d=Math.abs(u-h);d<c&&(c=d,l=o)}return this.complementCache=l,this.complementCache}relativeTemperature(t){const e=this.tempsByHct.get(this.warmest)-this.tempsByHct.get(this.coldest),r=this.tempsByHct.get(t)-this.tempsByHct.get(this.coldest);return 0===e?.5:r/e}get inputRelativeTemperature(){return this.inputRelativeTemperatureCache>=0||(this.inputRelativeTemperatureCache=this.relativeTemperature(this.input)),this.inputRelativeTemperatureCache}get tempsByHct(){if(this.tempsByHctCache.size>0)return this.tempsByHctCache;const t=this.hctsByHue.concat([this.input]),e=new Map;for(const r of t)e.set(r,L.rawTemperature(r));return this.tempsByHctCache=e,e}get hctsByHue(){if(this.hctsByHueCache.length>0)return this.hctsByHueCache;const t=[];for(let e=0;e<=360;e+=1){const r=C.from(e,this.input.chroma,this.input.tone);t.push(r)}return this.hctsByHueCache=t,this.hctsByHueCache}static isBetween(t,e,r){return e<r?e<=t&&t<=r:e<=t||t<=r}static rawTemperature(t){const e=function(t){const e=b(h(t)),r=b(d(t)),n=b(f(t)),a=i,o=a[0][0]*e+a[0][1]*r+a[0][2]*n,s=a[1][0]*e+a[1][1]*r+a[1][2]*n,l=a[2][0]*e+a[2][1]*r+a[2][2]*n,u=s/c[1],m=l/c[2],g=k(o/c[0]),p=k(u);return[116*p-16,500*(g-p),200*(p-k(m))]}(t.toInt()),r=a(180*Math.atan2(e[2],e[1])/Math.PI),n=Math.sqrt(e[1]*e[1]+e[2]*e[2]);return.02*Math.pow(n,1.07)*Math.cos(a(r-50)*Math.PI/180)-.5}}
/**
* @license
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under