tailwind-material-colors
Version:
TailwindCSS Plugin to use the Material 3 Color System with Tailwind
308 lines • 85.5 kB
JavaScript
"use strict";
/**
* @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 h(t){return l(b(t[0]),b(t[1]),b(t[2]))}function u(t){return t>>16&255}function m(t){return t>>8&255}function f(t){return 255&t}function d(t){const e=function(t){return o([y(u(t)),y(m(t)),y(f(t))],i)}(t)[1];return 116*w(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*w(t/100)-16}function y(t){const e=t/255;return e<=.040449936?e/12.92*100:100*Math.pow((e+.055)/1.055,2.4)}function b(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 w(t){const e=24389/27;return t>216/24389?Math.pow(t,1/3):(e*t+16)/116}class k{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],h=-.002079*i[0]+.048952*i[1]+.953127*i[2],u=.8+a/10,m=u>=.9?e(.59,.69,10*(u-.9)):e(.525,.59,10*(u-.8));let f=o?1:u*(1-1/3.6*Math.exp((-r-42)/92));f=f>1?1:f<0?0:f;const d=u,p=[f*(100/s)+1-f,f*(100/l)+1-f,f*(100/h)+1-f],y=1/(5*r+1),b=y*y*y*y,w=1-b,M=b*r+.1*w*w*Math.cbrt(5*r),C=g(n)/t[1],P=1.48+Math.sqrt(C),v=.725/Math.pow(C,.2),D=v,x=[Math.pow(M*p[0]*s/100,.42),Math.pow(M*p[1]*l/100,.42),Math.pow(M*p[2]*h/100,.42)],I=[400*x[0]/(x[0]+27.13),400*x[1]/(x[1]+27.13),400*x[2]/(x[2]+27.13)];return new k(C,(2*I[0]+I[1]+.05*I[2])*v,v,D,m,d,p,M,Math.pow(M,.25),P)}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}}k.DEFAULT=k.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 M{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 M.fromIntInViewingConditions(t,k.DEFAULT)}static fromIntInViewingConditions(e,r){const n=(65280&e)>>8,a=255&e,o=y((16711680&e)>>16),i=y(n),s=y(a),c=.41233895*o+.35762064*i+.18051042*s,l=.2126*o+.7152*i+.0722*s,h=.01932141*o+.11916382*i+.95034478*s,u=.401288*c+.650173*l-.051461*h,m=-.250268*c+1.204414*l+.045854*h,f=-.002079*c+.048952*l+.953127*h,d=r.rgbD[0]*u,g=r.rgbD[1]*m,p=r.rgbD[2]*f,b=Math.pow(r.fl*Math.abs(d)/100,.42),w=Math.pow(r.fl*Math.abs(g)/100,.42),k=Math.pow(r.fl*Math.abs(p)/100,.42),C=400*t(d)*b/(b+27.13),P=400*t(g)*w/(w+27.13),v=400*t(p)*k/(k+27.13),D=(11*C+-12*P+v)/11,x=(C+P-2*v)/9,I=(20*C+20*P+21*v)/20,A=(40*C+20*P+v)/20,T=180*Math.atan2(x,D)/Math.PI,_=T<0?T+360:T>=360?T-360:T,B=_*Math.PI/180,H=A*r.nbb,O=100*Math.pow(H/r.aw,r.c*r.z),F=4/r.c*Math.sqrt(O/100)*(r.aw+4)*r.fLRoot,S=_<20.14?_+360:_,L=5e4/13*(.25*(Math.cos(S*Math.PI/180+2)+3.8))*r.nc*r.ncb*Math.sqrt(D*D+x*x)/(I+.305),R=Math.pow(L,.9)*Math.pow(1.64-Math.pow(.29,r.n),.73),E=R*Math.sqrt(O/100),j=E*r.fLRoot,N=50*Math.sqrt(R*r.c/(r.aw+4)),V=(1+100*.007)*O/(1+.007*O),z=1/.0228*Math.log(1+.0228*j),U=z*Math.cos(B),q=z*Math.sin(B);return new M(_,E,O,F,j,N,V,U,q)}static fromJch(t,e,r){return M.fromJchInViewingConditions(t,e,r,k.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),h=1/.0228*Math.log(1+.0228*o),u=h*Math.cos(c),m=h*Math.sin(c);return new M(r,e,t,a,o,s,l,u,m)}static fromUcs(t,e,r){return M.fromUcsInViewingConditions(t,e,r,k.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 M.fromJchInViewingConditions(l,s,c,n)}toInt(){return this.viewed(k.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,h=i/e.nbb,u=Math.sin(a),m=Math.cos(a),f=23*(h+.305)*n/(23*c+11*n*m+108*n*u),d=f*m,g=f*u,p=(460*h+451*d+288*g)/1403,y=(460*h-891*d-261*g)/1403,w=(460*h-220*d-6300*g)/1403,k=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),M=t(p)*(100/e.fl)*Math.pow(k,1/.42),C=Math.max(0,27.13*Math.abs(y)/(400-Math.abs(y))),P=t(y)*(100/e.fl)*Math.pow(C,1/.42),v=Math.max(0,27.13*Math.abs(w)/(400-Math.abs(w))),D=t(w)*(100/e.fl)*Math.pow(v,1/.42),x=M/e.rgbD[0],I=P/e.rgbD[1],A=D/e.rgbD[2],T=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(b(a),b(o),b(i))}(1.86206786*x-1.01125463*I+.14918677*A,.38752654*x+.62144744*I-.00897398*A,-.0158415*x-.03412294*I+1.04996444*A);return T}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,h=a.rgbD[2]*s,u=Math.pow(a.fl*Math.abs(c)/100,.42),m=Math.pow(a.fl*Math.abs(l)/100,.42),f=Math.pow(a.fl*Math.abs(h)/100,.42),d=400*t(c)*u/(u+27.13),g=400*t(l)*m/(m+27.13),p=400*t(h)*f/(f+27.13),y=(11*d+-12*g+p)/11,b=(d+g-2*p)/9,w=(20*d+20*g+21*p)/20,k=(40*d+20*g+p)/20,C=180*Math.atan2(b,y)/Math.PI,P=C<0?C+360:C>=360?C-360:C,v=P*Math.PI/180,D=k*a.nbb,x=100*Math.pow(D/a.aw,a.c*a.z),I=4/a.c*Math.sqrt(x/100)*(a.aw+4)*a.fLRoot,A=P<20.14?P+360:P,T=5e4/13*(1/4*(Math.cos(A*Math.PI/180+2)+3.8))*a.nc*a.ncb*Math.sqrt(y*y+b*b)/(w+.305),_=Math.pow(T,.9)*Math.pow(1.64-Math.pow(.29,a.n),.73),B=_*Math.sqrt(x/100),H=B*a.fLRoot,O=50*Math.sqrt(_*a.c/(a.aw+4)),F=(1+100*.007)*x/(1+.007*x),S=Math.log(1+.0228*H)/.0228,L=S*Math.cos(v),R=S*Math.sin(v);return new M(P,B,x,I,H,O,F,L,R)}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),h=Math.cos(a),u=23*(c+.305)*n/(23*s+11*n*h+108*n*l),m=u*h,f=u*l,d=(460*c+451*m+288*f)/1403,g=(460*c-891*m-261*f)/1403,p=(460*c-220*m-6300*f)/1403,y=Math.max(0,27.13*Math.abs(d)/(400-Math.abs(d))),b=t(d)*(100/e.fl)*Math.pow(y,1/.42),w=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),k=t(g)*(100/e.fl)*Math.pow(w,1/.42),M=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),C=t(p)*(100/e.fl)*Math.pow(M,1/.42),P=b/e.rgbD[0],v=k/e.rgbD[1],D=C/e.rgbD[2];return[1.86206786*P-1.01125463*v+.14918677*D,.38752654*P+.62144744*v-.00897398*D,-.0158415*P-.03412294*v+1.04996444*D]}}
/**
* @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 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,C.SCALED_DISCOUNT_FROM_LINRGB),r=C.chromaticAdaptation(e[0]),n=C.chromaticAdaptation(e[1]),a=C.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 C.sanitizeRadians(e-t)<C.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=C.intercept(t[n],e,r[n]);return C.lerpPoint(t,a,r)}static isBounded(t){return 0<=t&&t<=100}static nthVertex(t,e){const r=C.Y_FROM_LINRGB[0],n=C.Y_FROM_LINRGB[1],a=C.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 C.isBounded(c)?[c,e,s]:[-1,-1,-1]}if(e<8){const e=o,s=i,c=(t-s*r-e*a)/n;return C.isBounded(c)?[s,c,e]:[-1,-1,-1]}{const e=o,s=i,c=(t-e*r-s*n)/a;return C.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=C.nthVertex(t,c);if(l[0]<0)continue;const h=C.hueOf(l);i?(s||C.areInCyclicOrder(a,h,o))&&(s=!1,C.areInCyclicOrder(a,e,h)?(n=l,o=h):(r=l,a=h)):(r=l,n=l,a=h,o=h,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=C.bisectToSegment(t,e);let n=r[0],a=C.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=C.criticalPlaneBelow(C.trueDelinearized(n[t])),i=C.criticalPlaneAbove(C.trueDelinearized(o[t]))):(r=C.criticalPlaneAbove(C.trueDelinearized(n[t])),i=C.criticalPlaneBelow(C.trueDelinearized(o[t])));for(let s=0;s<8&&!(Math.abs(i-r)<=1);s++){const s=Math.floor((r+i)/2),c=C.CRITICAL_PLANES[s],l=C.setCoordinate(n,c,o,t),h=C.hueOf(l);C.areInCyclicOrder(a,e,h)?(o=l,i=s):(n=l,a=h,r=s)}}return C.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=k.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 u=n/100,m=0===e||0===n?0:e/Math.sqrt(u),f=Math.pow(m*i,1/.9),d=a.aw*Math.pow(u,1/a.c/a.z)/a.nbb,g=23*(d+.305)*f/(23*s+11*f*l+108*f*c),p=g*l,y=g*c,b=(460*d+451*p+288*y)/1403,w=(460*d-891*p-261*y)/1403,k=(460*d-220*p-6300*y)/1403,M=o([C.inverseChromaticAdaptation(b),C.inverseChromaticAdaptation(w),C.inverseChromaticAdaptation(k)],C.LINRGB_FROM_SCALED_DISCOUNT);if(M[0]<0||M[1]<0||M[2]<0)return 0;const P=C.Y_FROM_LINRGB[0],v=C.Y_FROM_LINRGB[1],D=C.Y_FROM_LINRGB[2],x=P*M[0]+v*M[1]+D*M[2];if(x<=0)return 0;if(4===t||Math.abs(x-r)<.002)return M[0]>100.01||M[1]>100.01||M[2]>100.01?0:h(M);n-=(x-r)*n/(2*x)}return 0}static solveToInt(t,e,r){if(e<1e-4||r<1e-4||r>99.9999)return function(t){const e=b(g(t));return l(e,e,e)}(r);const n=(t=a(t))/180*Math.PI,o=g(r),i=C.findResultByJ(n,e,o);if(0!==i)return i;return h(C.bisectToLimit(o,n))}static solveToCam(t,e,r){return M.fromInt(C.solveToInt(t,e,r))}}C.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],C.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],C.Y_FROM_LINRGB=[.2126,.7152,.0722],C.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 P{static from(t,e,r){return new P(C.solveToInt(t,e,r))}static fromInt(t){return new P(t)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(t){this.setInternalState(C.solveToInt(t,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(t){this.setInternalState(C.solveToInt(this.internalHue,t,this.internalTone))}get tone(){return this.internalTone}set tone(t){this.setInternalState(C.solveToInt(this.internalHue,this.internalChroma,t))}constructor(t){this.argb=t;const e=M.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=d(t),this.argb=t}setInternalState(t){const e=M.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=d(t),this.argb=t}inViewingConditions(t){const e=M.fromInt(this.toInt()).xyzInViewingConditions(t),r=M.fromXyzInViewingConditions(e[0],e[1],e[2],k.make());return P.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 v{static harmonize(t,e){const r=P.fromInt(t),n=P.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*(h=r.hue,a(n.hue-h)<=180?1:-1));var h;return P.from(l,r.chroma,r.tone).toInt()}static hctHue(t,e,r){const n=v.cam16Ucs(t,e,r),a=M.fromInt(n),o=M.fromInt(t);return P.from(a.hue,o.chroma,d(t)).toInt()}static cam16Ucs(t,e,r){const n=M.fromInt(t),a=M.fromInt(e),o=n.jstar,i=n.astar,s=n.bstar,c=o+(a.jstar-o)*r,l=i+(a.astar-i)*r,h=s+(a.bstar-s)*r;return M.fromUcs(c,l,h).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 D{static ratioOfTones(t,e){return t=r(0,100,t),e=r(0,100,e),D.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=D.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=D.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=D.lighter(t,e);return r<0?100:r}static darkerUnsafe(t,e){const r=D.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 x{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 x.isDisliked(t)?P.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 I{static fromPalette(t){return new I(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),h="nearer"===s||"lighter"===s&&!t.isDark||"darker"===s&&t.isDark,u=h?a:o,m=h?o:a,f=this.name===u.name,d=t.isDark?1:-1,g=u.contrastCurve.getContrast(t.contrastLevel),p=m.contrastCurve.getContrast(t.contrastLevel),y=u.tone(t);let b=D.ratioOfTones(l,y)>=g?y:I.foregroundTone(l,g);const w=m.tone(t);let k=D.ratioOfTones(l,w)>=p?w:I.foregroundTone(l,p);return e&&(b=I.foregroundTone(l,g),k=I.foregroundTone(l,p)),(k-b)*d>=i||(k=r(0,100,b+i*d),(k-b)*d>=i||(b=r(0,100,k-i*d))),50<=b&&b<60?d>0?(b=60,k=Math.max(k,b+i*d)):(b=49,k=Math.min(k,b+i*d)):50<=k&&k<60&&(c?d>0?(b=60,k=Math.max(k,b+i*d)):(b=49,k=Math.min(k,b+i*d)):k=d>0?60:49),f?b:k}{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(D.ratioOfTones(n,r)>=a||(r=I.foregroundTone(n,a)),e&&(r=I.foregroundTone(n,a)),this.isBackground&&50<=r&&r<60&&(r=D.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(D.ratioOfTones(s,r)>=a&&D.ratioOfTones(c,r)>=a)return r;const l=D.lighter(s,a),h=D.darker(c,a),u=[];-1!==l&&u.push(l),-1!==h&&u.push(h);return I.tonePrefersLightForeground(o)||I.tonePrefersLightForeground(i)?l<0?100:l:1===u.length?u[0]:h<0?0:h}return r}}static foregroundTone(t,e){const r=D.lighterUnsafe(t,e),n=D.darkerUnsafe(t,e),a=D.ratioOfTones(r,t),o=D.ratioOfTones(n,t);if(I.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 I.tonePrefersLightForeground(t)&&!I.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 T{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 _{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 B(t){return t.variant===A.FIDELITY||t.variant===A.CONTENT}function H(t){return t.variant===A.MONOCHROME}function O(t,e){const r=t.inViewingConditions(function(t){return k.make(void 0,void 0,t.isDark?30:80,void 0,void 0)}(e));return I.tonePrefersLightForeground(t.tone)&&!I.toneAllowsLightForeground(r.tone)?I.enableLightForeground(t.tone):I.enableLightForeground(r.tone)}class F{static highestSurface(t){return t.isDark?F.surfaceBright:F.surfaceDim}}F.contentAccentToneDelta=15,F.primaryPaletteKeyColor=I.fromPalette({name:"primary_palette_key_color",palette:t=>t.primaryPalette,tone:t=>t.primaryPalette.keyColor.tone}),F.secondaryPaletteKeyColor=I.fromPalette({name:"secondary_palette_key_color",palette:t=>t.secondaryPalette,tone:t=>t.secondaryPalette.keyColor.tone}),F.tertiaryPaletteKeyColor=I.fromPalette({name:"tertiary_palette_key_color",palette:t=>t.tertiaryPalette,tone:t=>t.tertiaryPalette.keyColor.tone}),F.neutralPaletteKeyColor=I.fromPalette({name:"neutral_palette_key_color",palette:t=>t.neutralPalette,tone:t=>t.neutralPalette.keyColor.tone}),F.neutralVariantPaletteKeyColor=I.fromPalette({name:"neutral_variant_palette_key_color",palette:t=>t.neutralVariantPalette,tone:t=>t.neutralVariantPalette.keyColor.tone}),F.background=I.fromPalette({name:"background",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0}),F.onBackground=I.fromPalette({name:"on_background",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>F.background,contrastCurve:new T(3,3,4.5,7)}),F.surface=I.fromPalette({name:"surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0}),F.surfaceDim=I.fromPalette({name:"surface_dim",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:87,isBackground:!0}),F.surfaceBright=I.fromPalette({name:"surface_bright",palette:t=>t.neutralPalette,tone:t=>t.isDark?24:98,isBackground:!0}),F.surfaceContainerLowest=I.fromPalette({name:"surface_container_lowest",palette:t=>t.neutralPalette,tone:t=>t.isDark?4:100,isBackground:!0}),F.surfaceContainerLow=I.fromPalette({name:"surface_container_low",palette:t=>t.neutralPalette,tone:t=>t.isDark?10:96,isBackground:!0}),F.surfaceContainer=I.fromPalette({name:"surface_container",palette:t=>t.neutralPalette,tone:t=>t.isDark?12:94,isBackground:!0}),F.surfaceContainerHigh=I.fromPalette({name:"surface_container_high",palette:t=>t.neutralPalette,tone:t=>t.isDark?17:92,isBackground:!0}),F.surfaceContainerHighest=I.fromPalette({name:"surface_container_highest",palette:t=>t.neutralPalette,tone:t=>t.isDark?22:90,isBackground:!0}),F.onSurface=I.fromPalette({name:"on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>F.highestSurface(t),contrastCurve:new T(4.5,7,11,21)}),F.surfaceVariant=I.fromPalette({name:"surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:90,isBackground:!0}),F.onSurfaceVariant=I.fromPalette({name:"on_surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?80:30,background:t=>F.highestSurface(t),contrastCurve:new T(3,4.5,7,11)}),F.inverseSurface=I.fromPalette({name:"inverse_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:20}),F.inverseOnSurface=I.fromPalette({name:"inverse_on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?20:95,background:t=>F.inverseSurface,contrastCurve:new T(4.5,7,11,21)}),F.outline=I.fromPalette({name:"outline",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?60:50,background:t=>F.highestSurface(t),contrastCurve:new T(1.5,3,4.5,7)}),F.outlineVariant=I.fromPalette({name:"outline_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:80,background:t=>F.highestSurface(t),contrastCurve:new T(1,1,3,7)}),F.shadow=I.fromPalette({name:"shadow",palette:t=>t.neutralPalette,tone:t=>0}),F.scrim=I.fromPalette({name:"scrim",palette:t=>t.neutralPalette,tone:t=>0}),F.surfaceTint=I.fromPalette({name:"surface_tint",palette:t=>t.primaryPalette,tone:t=>t.isDark?80:40,isBackground:!0}),F.primary=I.fromPalette({name:"primary",palette:t=>t.primaryPalette,tone:t=>H(t)?t.isDark?100:0:t.isDark?80:40,isBackground:!0,background:t=>F.highestSurface(t),contrastCurve:new T(3,4.5,7,11),toneDeltaPair:t=>new _(F.primaryContainer,F.primary,15,"nearer",!1)}),F.onPrimary=I.fromPalette({name:"on_primary",palette:t=>t.primaryPalette,tone:t=>H(t)?t.isDark?10:90:t.isDark?20:100,background:t=>F.primary,contrastCurve:new T(4.5,7,11,21)}),F.primaryContainer=I.fromPalette({name:"primary_container",palette:t=>t.primaryPalette,tone:t=>B(t)?O(t.sourceColorHct,t):H(t)?t.isDark?85:25:t.isDark?30:90,isBackground:!0,background:t=>F.highestSurface(t),contrastCurve:new T(1,1,3,7),toneDeltaPair:t=>new _(F.primaryContainer,F.primary,15,"nearer",!1)}),F.onPrimaryContainer=I.fromPalette({name:"on_primary_container",palette:t=>t.primaryPalette,tone:t=>B(t)?I.foregroundTone(F.primaryContainer.tone(t),4.5):H(t)?t.isDark?0:100:t.isDark?90:10,background:t=>F.primaryContainer,contrastCurve:new T(4.5,7,11,21)}),F.inversePrimary=I.fromPalette({name:"inverse_primary",palette:t=>t.primaryPalette,tone:t=>t.isDark?40:80,background:t=>F.inverseSurface,contrastCurve:new T(3,4.5,7,11)}),F.secondary=I.fromPalette({name:"secondary",palette:t=>t.secondaryPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>F.highestSurface(t),contrastCurve:new T(3,4.5,7,11),toneDeltaPair:t=>new _(F.secondaryContainer,F.secondary,15,"nearer",!1)}),F.onSecondary=I.fromPalette({name:"on_secondary",palette:t=>t.secondaryPalette,tone:t=>H(t)?t.isDark?10:100:t.isDark?20:100,background:t=>F.secondary,contrastCurve:new T(4.5,7,11,21)}),F.secondaryContainer=I.fromPalette({name:"secondary_container",palette:t=>t.secondaryPalette,tone:t=>{const e=t.isDark?30:90;if(H(t))return t.isDark?30:85;if(!B(t))return e;let r=function(t,e,r,n){let a=r,o=P.from(t,e,r);if(o.chroma<e){let r=o.chroma;for(;o.chroma<e;){a+=n?-1:1;const i=P.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=O(t.secondaryPalette.getHct(r),t),r},isBackground:!0,background:t=>F.highestSurface(t),contrastCurve:new T(1,1,3,7),toneDeltaPair:t=>new _(F.secondaryContainer,F.secondary,15,"nearer",!1)}),F.onSecondaryContainer=I.fromPalette({name:"on_secondary_container",palette:t=>t.secondaryPalette,tone:t=>B(t)?I.foregroundTone(F.secondaryContainer.tone(t),4.5):t.isDark?90:10,background:t=>F.secondaryContainer,contrastCurve:new T(4.5,7,11,21)}),F.tertiary=I.fromPalette({name:"tertiary",palette:t=>t.tertiaryPalette,tone:t=>H(t)?t.isDark?90:25:t.isDark?80:40,isBackground:!0,background:t=>F.highestSurface(t),contrastCurve:new T(3,4.5,7,11),toneDeltaPair:t=>new _(F.tertiaryContainer,F.tertiary,15,"nearer",!1)}),F.onTertiary=I.fromPalette({name:"on_tertiary",palette:t=>t.tertiaryPalette,tone:t=>H(t)?t.isDark?10:90:t.isDark?20:100,background:t=>F.tertiary,contrastCurve:new T(4.5,7,11,21)}),F.tertiaryContainer=I.fromPalette({name:"tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>{if(H(t))return t.isDark?60:49;if(!B(t))return t.isDark?30:90;const e=O(t.tertiaryPalette.getHct(t.sourceColorHct.tone),t),r=t.tertiaryPalette.getHct(e);return x.fixIfDisliked(r).tone},isBackground:!0,background:t=>F.highestSurface(t),contrastCurve:new T(1,1,3,7),toneDeltaPair:t=>new _(F.tertiaryContainer,F.tertiary,15,"nearer",!1)}),F.onTertiaryContainer=I.fromPalette({name:"on_tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>H(t)?t.isDark?0:100:B(t)?I.foregroundTone(F.tertiaryContainer.tone(t),4.5):t.isDark?90:10,background:t=>F.tertiaryContainer,contrastCurve:new T(4.5,7,11,21)}),F.error=I.fromPalette({name:"error",palette:t=>t.errorPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>F.highestSurface(t),contrastCurve:new T(3,4.5,7,11),toneDeltaPair:t=>new _(F.errorContainer,F.error,15,"nearer",!1)}),F.onError=I.fromPalette({name:"on_error",palette:t=>t.errorPalette,tone:t=>t.isDark?20:100,background:t=>F.error,contrastCurve:new T(4.5,7,11,21)}),F.errorContainer=I.fromPalette({name:"error_container",palette:t=>t.errorPalette,tone:t=>t.isDark?30:90,isBackground:!0,background:t=>F.highestSurface(t),contrastCurve:new T(1,1,3,7),toneDeltaPair:t=>new _(F.errorContainer,F.error,15,"nearer",!1)}),F.onErrorContainer=I.fromPalette({name:"on_error_container",palette:t=>t.errorPalette,tone:t=>t.isDark?90:10,background:t=>F.errorContainer,contrastCurve:new T(4.5,7,11,21)}),F.primaryFixed=I.fromPalette({name:"primary_fixed",palette:t=>t.primaryPalette,tone:t=>H(t)?40:90,isBackground:!0,background:t=>F.highestSurface(t),contrastCurve:new T(1,1,3,7),toneDeltaPair:t=>new _(F.primaryFixed,F.primaryFixedDim,10,"lighter",!0)}),F.primaryFixedDim=I.fromPalette({name:"primary_fixed_dim",palette:t=>t.primaryPalette,tone:t=>H(t)?30:80,isBackground:!0,background:t=>F.highestSurface(t),contrastCurve:new T(1,1,3,7),toneDeltaPair:t=>new _(F.primaryFixed,F.primaryFixedDim,10,"lighter",!0)}),F.onPrimaryFixed=I.fromPalette({name:"on_primary_fixed",palette:t=>t.primaryPalette,tone:t=>H(t)?100:10,background:t=>F.primaryFixedDim,secondBackground:t=>F.primaryFixed,contrastCurve:new T(4.5,7,11,21)}),F.onPrimaryFixedVariant=I.fromPalette({name:"on_primary_fixed_variant",palette:t=>t.primaryPalette,tone:t=>H(t)?90:30,background:t=>F.primaryFixedDim,secondBackground:t=>F.primaryFixed,contrastCurve:new T(3,4.5,7,11)}),F.secondaryFixed=I.fromPalette({name:"secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>H(t)?80:90,isBackground:!0,background:t=>F.highestSurface(t),contrastCurve:new T(1,1,3,7),toneDeltaPair:t=>new _(F.secondaryFixed,F.secondaryFixedDim,10,"lighter",!0)}),F.secondaryFixedDim=I.fromPalette({name:"secondary_fixed_dim",palette:t=>t.secondaryPalette,tone:t=>H(t)?70:80,isBackground:!0,background:t=>F.highestSurface(t),contrastCurve:new T(1,1,3,7),toneDeltaPair:t=>new _(F.secondaryFixed,F.secondaryFixedDim,10,"lighter",!0)}),F.onSecondaryFixed=I.fromPalette({name:"on_secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>10,background:t=>F.secondaryFixedDim,secondBackground:t=>F.secondaryFixed,contrastCurve:new T(4.5,7,11,21)}),F.onSecondaryFixedVariant=I.fromPalette({name:"on_secondary_fixed_variant",palette:t=>t.secondaryPalette,tone:t=>H(t)?25:30,background:t=>F.secondaryFixedDim,secondBackground:t=>F.secondaryFixed,contrastCurve:new T(3,4.5,7,11)}),F.tertiaryFixed=I.fromPalette({name:"tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>H(t)?40:90,isBackground:!0,background:t=>F.highestSurface(t),contrastCurve:new T(1,1,3,7),toneDeltaPair:t=>new _(F.tertiaryFixed,F.tertiaryFixedDim,10,"lighter",!0)}),F.tertiaryFixedDim=I.fromPalette({name:"tertiary_fixed_dim",palette:t=>t.tertiaryPalette,tone:t=>H(t)?30:80,isBackground:!0,background:t=>F.highestSurface(t),contrastCurve:new T(1,1,3,7),toneDeltaPair:t=>new _(F.tertiaryFixed,F.tertiaryFixedDim,10,"lighter",!0)}),F.onTertiaryFixed=I.fromPalette({name:"on_tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>H(t)?100:10,background:t=>F.tertiaryFixedDim,secondBackground:t=>F.tertiaryFixed,contrastCurve:new T(4.5,7,11,21)}),F.onTertiaryFixedVariant=I.fromPalette({name:"on_tertiary_fixed_variant",palette:t=>t.tertiaryPalette,tone:t=>H(t)?90:30,background:t=>F.tertiaryFixedDim,secondBackground:t=>F.tertiaryFixed,contrastCurve:new T(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 S{static fromInt(t){const e=P.fromInt(t);return S.fromHct(e)}static fromHct(t){return new S(t.hue,t.chroma,t)}static fromHueAndChroma(t,e){return new S(t,e,S.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=P.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=P.from(t,e,50+a),i=Math.abs(o.chroma-e);i<n&&(n=i,r=o);const s=P.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=P.from(this.hue,this.chroma,t).toInt(),this.cache.set(t,e)),e}getHct(t){return P.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 L{static of(t){return new L(t,!1)}static contentOf(t){return new L(t,!0)}static fromColors(t){return L.createPaletteFromColors(!1,t)}static contentFromColors(t){return L.createPaletteFromColors(!0,t)}static createPaletteFromColors(t,e){const r=new L(e.primary,t);if(e.secondary){const n=new L(e.secondary,t);r.a2=n.a1}if(e.tertiary){const n=new L(e.tertiary,t);r.a3=n.a1}if(e.error){const n=new L(e.error,t);r.error=n.a1}if(e.neutral){const n=new L(e.neutral,t);r.n1=n.n1}if(e.neutralVariant){const n=new L(e.neutralVariant,t);r.n2=n.n2}return r}constructor(t,e){const r=P.fromInt(t),n=r.hue,a=r.chroma;e?(this.a1=S.fromHueAndChroma(n,a),this.a2=S.fromHueAndChroma(n,a/3),this.a3=S.fromHueAndChroma(n+60,a/2),this.n1=S.fromHueAndChroma(n,Math.min(a/12,4)),this.n2=S.fromHueAndChroma(n,Math.min(a/6,8))):(this.a1=S.fromHueAndChroma(n,Math.max(48,a)),this.a2=S.fromHueAndChroma(n,16),this.a3=S.fromHueAndChroma(n+60,24),this.n1=S.fromHueAndChroma(n,4),this.n2=S.fromHueAndChroma(n,8)),this.error=S.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 R{constructor(t){this.sourceColorArgb=t.sourceColorArgb,this.variant=t.variant,this.contrastLevel=t.contrastLevel,this.isDark=t.isDark,this.sourceColorHct=P.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=S.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 E{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 h=0;for(o=this.relativeTemperature(a);i.length<e;){const t=n(r+c),a=this.hctsByHue[t],s=this.relativeTemperature(a);h+=Math.abs(s-o);let u=h>=i.length*l,m=1;for(;u&&i.length<e;){i.push(a);u=h>=(i.length+m)*l,m++}if(o=s,c++,c>360){for(;i.length<e;)i.push(a);break}}const u=[this.input],m=Math.floor((t-1)/2);for(let t=1;t<m+1;t++){let e=0-t;for(;e<0;)e=i.length+e;e>=i.length&&(e%=i.length),u.splice(0,0,i[e])}const f=t-m-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),u.push(i[e])}return u}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=E.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 h=1-this.inputRelativeTemperature;for(let t=0;t<=360;t+=1){const r=a(i+1*t);if(!E.isBetween(r,i,s))continue;const o=this.hctsByHue[Math.round(r)],u=(this.tempsByHct.get(o)-e)/n,m=Math.abs(h-u);m<c&&(c=m,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,E.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=P.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=y(u(t)),r=y(m(t)),n=y(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,h=s/c[1],d=l/c[2],g=w(o/c[0]),p=w(h);return[116*p-16,500*(g-p),200*(p-w(d))]}(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
* limit