UNPKG

vue-material-you

Version:

Material design 3 UI framework for Vue 3

197 lines 59.7 kB
(function(p,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],r):(p=typeof globalThis<"u"?globalThis:p||self,r(p.VueMaterialYou={},p.Vue,p.VueRouter))})(this,function(p,r,Rt){"use strict";const Zn="";/** * @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 q(e){return e<0?-1:e===0?0:1}function kt(e,t,n){return(1-n)*e+n*t}function le(e,t,n){return n<e?e:n>t?t:n}function _t(e){return e=e%360,e<0&&(e=e+360),e}function ue(e,t){return _t(t-e)<=180?1:-1}function de(e,t){return 180-Math.abs(Math.abs(e-t)-180)}function gt(e,t){const n=e[0]*t[0][0]+e[1]*t[0][1]+e[2]*t[0][2],o=e[0]*t[1][0]+e[1]*t[1][1]+e[2]*t[1][2],a=e[0]*t[2][0]+e[1]*t[2][1]+e[2]*t[2][2];return[n,o,a]}/** * @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 me=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],fe=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],he=[95.047,100,108.883];function bt(e,t,n){return(255<<24|(e&255)<<16|(t&255)<<8|n&255)>>>0}function Ot(e){const t=X(e[0]),n=X(e[1]),o=X(e[2]);return bt(t,n,o)}function Lt(e){return e>>16&255}function St(e){return e>>8&255}function Dt(e){return e&255}function _e(e,t,n){const o=fe,a=o[0][0]*e+o[0][1]*t+o[0][2]*n,s=o[1][0]*e+o[1][1]*t+o[1][2]*n,i=o[2][0]*e+o[2][1]*t+o[2][2]*n,c=X(a),l=X(s),d=X(i);return bt(c,l,d)}function ge(e){const t=Q(Lt(e)),n=Q(St(e)),o=Q(Dt(e));return gt([t,n,o],me)}function be(e){const t=st(e),n=X(t);return bt(n,n,n)}function pt(e){const t=ge(e)[1];return 116*ye(t/100)-16}function st(e){return 100*Ie((e+16)/116)}function Q(e){const t=e/255;return t<=.040449936?t/12.92*100:Math.pow((t+.055)/1.055,2.4)*100}function X(e){const t=e/100;let n=0;return t<=.0031308?n=t*12.92:n=1.055*Math.pow(t,1/2.4)-.055,le(0,255,Math.round(n*255))}function pe(){return he}function ye(e){const t=.008856451679035631,n=24389/27;return e>t?Math.pow(e,1/3):(n*e+16)/116}function Ie(e){const t=.008856451679035631,n=24389/27,o=e*e*e;return o>t?o:(116*e-16)/n}/** * @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 N{constructor(t,n,o,a,s,i,c,l,d,m){this.n=t,this.aw=n,this.nbb=o,this.ncb=a,this.c=s,this.nc=i,this.rgbD=c,this.fl=l,this.fLRoot=d,this.z=m}static make(t=pe(),n=200/Math.PI*st(50)/100,o=50,a=2,s=!1){const i=t,c=i[0]*.401288+i[1]*.650173+i[2]*-.051461,l=i[0]*-.250268+i[1]*1.204414+i[2]*.045854,d=i[0]*-.002079+i[1]*.048952+i[2]*.953127,m=.8+a/10,f=m>=.9?kt(.59,.69,(m-.9)*10):kt(.525,.59,(m-.8)*10);let h=s?1:m*(1-1/3.6*Math.exp((-n-42)/92));h=h>1?1:h<0?0:h;const g=m,b=[h*(100/c)+1-h,h*(100/l)+1-h,h*(100/d)+1-h],y=1/(5*n+1),I=y*y*y*y,P=1-I,w=I*n+.1*P*P*Math.cbrt(5*n),k=st(o)/t[1],H=1.48+Math.sqrt(k),O=.725/Math.pow(k,.2),B=O,C=[Math.pow(w*b[0]*c/100,.42),Math.pow(w*b[1]*l/100,.42),Math.pow(w*b[2]*d/100,.42)],R=[400*C[0]/(C[0]+27.13),400*C[1]/(C[1]+27.13),400*C[2]/(C[2]+27.13)],$=(2*R[0]+R[1]+.05*R[2])*O;return new N(k,$,O,B,f,g,b,w,Math.pow(w,.25),H)}}N.DEFAULT=N.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,n,o,a,s,i,c,l,d){this.hue=t,this.chroma=n,this.j=o,this.q=a,this.m=s,this.s=i,this.jstar=c,this.astar=l,this.bstar=d}distance(t){const n=this.jstar-t.jstar,o=this.astar-t.astar,a=this.bstar-t.bstar,s=Math.sqrt(n*n+o*o+a*a);return 1.41*Math.pow(s,.63)}static fromInt(t){return M.fromIntInViewingConditions(t,N.DEFAULT)}static fromIntInViewingConditions(t,n){const o=(t&16711680)>>16,a=(t&65280)>>8,s=t&255,i=Q(o),c=Q(a),l=Q(s),d=.41233895*i+.35762064*c+.18051042*l,m=.2126*i+.7152*c+.0722*l,f=.01932141*i+.11916382*c+.95034478*l,h=.401288*d+.650173*m-.051461*f,g=-.250268*d+1.204414*m+.045854*f,b=-.002079*d+.048952*m+.953127*f,y=n.rgbD[0]*h,I=n.rgbD[1]*g,P=n.rgbD[2]*b,w=Math.pow(n.fl*Math.abs(y)/100,.42),k=Math.pow(n.fl*Math.abs(I)/100,.42),H=Math.pow(n.fl*Math.abs(P)/100,.42),O=q(y)*400*w/(w+27.13),B=q(I)*400*k/(k+27.13),C=q(P)*400*H/(H+27.13),R=(11*O+-12*B+C)/11,$=(O+B-2*C)/9,x=(20*O+20*B+21*C)/20,at=(40*O+20*B+C)/20,J=Math.atan2($,R)*180/Math.PI,F=J<0?J+360:J>=360?J-360:J,re=F*Math.PI/180,Un=at*n.nbb,it=100*Math.pow(Un/n.aw,n.c*n.z),qn=4/n.c*Math.sqrt(it/100)*(n.aw+4)*n.fLRoot,Gn=F<20.14?F+360:F,Yn=.25*(Math.cos(Gn*Math.PI/180+2)+3.8),Wn=5e4/13*Yn*n.nc*n.ncb*Math.sqrt(R*R+$*$)/(x+.305),ae=Math.pow(Wn,.9)*Math.pow(1.64-Math.pow(.29,n.n),.73),ie=ae*Math.sqrt(it/100),se=ie*n.fLRoot,Hn=50*Math.sqrt(ae*n.c/(n.aw+4)),Jn=(1+100*.007)*it/(1+.007*it),ce=1/.0228*Math.log(1+.0228*se),Xn=ce*Math.cos(re),Qn=ce*Math.sin(re);return new M(F,ie,it,qn,se,Hn,Jn,Xn,Qn)}static fromJch(t,n,o){return M.fromJchInViewingConditions(t,n,o,N.DEFAULT)}static fromJchInViewingConditions(t,n,o,a){const s=4/a.c*Math.sqrt(t/100)*(a.aw+4)*a.fLRoot,i=n*a.fLRoot,c=n/Math.sqrt(t/100),l=50*Math.sqrt(c*a.c/(a.aw+4)),d=o*Math.PI/180,m=(1+100*.007)*t/(1+.007*t),f=1/.0228*Math.log(1+.0228*i),h=f*Math.cos(d),g=f*Math.sin(d);return new M(o,n,t,s,i,l,m,h,g)}static fromUcs(t,n,o){return M.fromUcsInViewingConditions(t,n,o,N.DEFAULT)}static fromUcsInViewingConditions(t,n,o,a){const s=n,i=o,c=Math.sqrt(s*s+i*i),d=(Math.exp(c*.0228)-1)/.0228/a.fLRoot;let m=Math.atan2(i,s)*(180/Math.PI);m<0&&(m+=360);const f=t/(1-(t-100)*.007);return M.fromJchInViewingConditions(f,d,m,a)}toInt(){return this.viewed(N.DEFAULT)}viewed(t){const n=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),o=Math.pow(n/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),a=this.hue*Math.PI/180,s=.25*(Math.cos(a+2)+3.8),i=t.aw*Math.pow(this.j/100,1/t.c/t.z),c=s*(5e4/13)*t.nc*t.ncb,l=i/t.nbb,d=Math.sin(a),m=Math.cos(a),f=23*(l+.305)*o/(23*c+11*o*m+108*o*d),h=f*m,g=f*d,b=(460*l+451*h+288*g)/1403,y=(460*l-891*h-261*g)/1403,I=(460*l-220*h-6300*g)/1403,P=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),w=q(b)*(100/t.fl)*Math.pow(P,1/.42),k=Math.max(0,27.13*Math.abs(y)/(400-Math.abs(y))),H=q(y)*(100/t.fl)*Math.pow(k,1/.42),O=Math.max(0,27.13*Math.abs(I)/(400-Math.abs(I))),B=q(I)*(100/t.fl)*Math.pow(O,1/.42),C=w/t.rgbD[0],R=H/t.rgbD[1],$=B/t.rgbD[2],x=1.86206786*C-1.01125463*R+.14918677*$,at=.38752654*C+.62144744*R-.00897398*$,ht=-.0158415*C-.03412294*R+1.04996444*$;return _e(x,at,ht)}}/** * @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 sanitizeRadians(t){return(t+Math.PI*8)%(Math.PI*2)}static trueDelinearized(t){const n=t/100;let o=0;return n<=.0031308?o=n*12.92:o=1.055*Math.pow(n,1/2.4)-.055,o*255}static chromaticAdaptation(t){const n=Math.pow(Math.abs(t),.42);return q(t)*400*n/(n+27.13)}static hueOf(t){const n=gt(t,_.SCALED_DISCOUNT_FROM_LINRGB),o=_.chromaticAdaptation(n[0]),a=_.chromaticAdaptation(n[1]),s=_.chromaticAdaptation(n[2]),i=(11*o+-12*a+s)/11,c=(o+a-2*s)/9;return Math.atan2(c,i)}static areInCyclicOrder(t,n,o){const a=_.sanitizeRadians(n-t),s=_.sanitizeRadians(o-t);return a<s}static intercept(t,n,o){return(n-t)/(o-t)}static lerpPoint(t,n,o){return[t[0]+(o[0]-t[0])*n,t[1]+(o[1]-t[1])*n,t[2]+(o[2]-t[2])*n]}static setCoordinate(t,n,o,a){const s=_.intercept(t[a],n,o[a]);return _.lerpPoint(t,s,o)}static isBounded(t){return 0<=t&&t<=100}static nthVertex(t,n){const o=_.Y_FROM_LINRGB[0],a=_.Y_FROM_LINRGB[1],s=_.Y_FROM_LINRGB[2],i=n%4<=1?0:100,c=n%2===0?0:100;if(n<4){const l=i,d=c,m=(t-l*a-d*s)/o;return _.isBounded(m)?[m,l,d]:[-1,-1,-1]}else if(n<8){const l=i,d=c,m=(t-d*o-l*s)/a;return _.isBounded(m)?[d,m,l]:[-1,-1,-1]}else{const l=i,d=c,m=(t-l*o-d*a)/s;return _.isBounded(m)?[l,d,m]:[-1,-1,-1]}}static bisectToSegment(t,n){let o=[-1,-1,-1],a=o,s=0,i=0,c=!1,l=!0;for(let d=0;d<12;d++){const m=_.nthVertex(t,d);if(m[0]<0)continue;const f=_.hueOf(m);if(!c){o=m,a=m,s=f,i=f,c=!0;continue}(l||_.areInCyclicOrder(s,f,i))&&(l=!1,_.areInCyclicOrder(s,n,f)?(a=m,i=f):(o=m,s=f))}return[o,a]}static midpoint(t,n){return[(t[0]+n[0])/2,(t[1]+n[1])/2,(t[2]+n[2])/2]}static criticalPlaneBelow(t){return Math.floor(t-.5)}static criticalPlaneAbove(t){return Math.ceil(t-.5)}static bisectToLimit(t,n){const o=_.bisectToSegment(t,n);let a=o[0],s=_.hueOf(a),i=o[1];for(let c=0;c<3;c++)if(a[c]!==i[c]){let l=-1,d=255;a[c]<i[c]?(l=_.criticalPlaneBelow(_.trueDelinearized(a[c])),d=_.criticalPlaneAbove(_.trueDelinearized(i[c]))):(l=_.criticalPlaneAbove(_.trueDelinearized(a[c])),d=_.criticalPlaneBelow(_.trueDelinearized(i[c])));for(let m=0;m<8&&!(Math.abs(d-l)<=1);m++){const f=Math.floor((l+d)/2),h=_.CRITICAL_PLANES[f],g=_.setCoordinate(a,h,i,c),b=_.hueOf(g);_.areInCyclicOrder(s,n,b)?(i=g,d=f):(a=g,s=b,l=f)}}return _.midpoint(a,i)}static inverseChromaticAdaptation(t){const n=Math.abs(t),o=Math.max(0,27.13*n/(400-n));return q(t)*Math.pow(o,1/.42)}static findResultByJ(t,n,o){let a=Math.sqrt(o)*11;const s=N.DEFAULT,i=1/Math.pow(1.64-Math.pow(.29,s.n),.73),l=.25*(Math.cos(t+2)+3.8)*(5e4/13)*s.nc*s.ncb,d=Math.sin(t),m=Math.cos(t);for(let f=0;f<5;f++){const h=a/100,g=n===0||a===0?0:n/Math.sqrt(h),b=Math.pow(g*i,1/.9),I=s.aw*Math.pow(h,1/s.c/s.z)/s.nbb,P=23*(I+.305)*b/(23*l+11*b*m+108*b*d),w=P*m,k=P*d,H=(460*I+451*w+288*k)/1403,O=(460*I-891*w-261*k)/1403,B=(460*I-220*w-6300*k)/1403,C=_.inverseChromaticAdaptation(H),R=_.inverseChromaticAdaptation(O),$=_.inverseChromaticAdaptation(B),x=gt([C,R,$],_.LINRGB_FROM_SCALED_DISCOUNT);if(x[0]<0||x[1]<0||x[2]<0)return 0;const at=_.Y_FROM_LINRGB[0],ht=_.Y_FROM_LINRGB[1],J=_.Y_FROM_LINRGB[2],F=at*x[0]+ht*x[1]+J*x[2];if(F<=0)return 0;if(f===4||Math.abs(F-o)<.002)return x[0]>100.01||x[1]>100.01||x[2]>100.01?0:Ot(x);a=a-(F-o)*a/(2*F)}return 0}static solveToInt(t,n,o){if(n<1e-4||o<1e-4||o>99.9999)return be(o);t=_t(t);const a=t/180*Math.PI,s=st(o),i=_.findResultByJ(a,n,s);if(i!==0)return i;const c=_.bisectToLimit(s,a);return Ot(c)}static solveToCam(t,n,o){return M.fromInt(_.solveToInt(t,n,o))}}_.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],_.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],_.Y_FROM_LINRGB=[.2126,.7152,.0722],_.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776];/** * @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){this.argb=t;const n=M.fromInt(t);this.internalHue=n.hue,this.internalChroma=n.chroma,this.internalTone=pt(t),this.argb=t}static from(t,n,o){return new V(_.solveToInt(t,n,o))}static fromInt(t){return new V(t)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(t){this.setInternalState(_.solveToInt(t,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(t){this.setInternalState(_.solveToInt(this.internalHue,t,this.internalTone))}get tone(){return this.internalTone}set tone(t){this.setInternalState(_.solveToInt(this.internalHue,this.internalChroma,t))}setInternalState(t){const n=M.fromInt(t);this.internalHue=n.hue,this.internalChroma=n.chroma,this.internalTone=pt(t),this.argb=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 yt{static harmonize(t,n){const o=V.fromInt(t),a=V.fromInt(n),s=de(o.hue,a.hue),i=Math.min(s*.5,15),c=_t(o.hue+i*ue(o.hue,a.hue));return V.from(c,o.chroma,o.tone).toInt()}static hctHue(t,n,o){const a=yt.cam16Ucs(t,n,o),s=M.fromInt(a),i=M.fromInt(t);return V.from(s.hue,i.chroma,pt(t)).toInt()}static cam16Ucs(t,n,o){const a=M.fromInt(t),s=M.fromInt(n),i=a.jstar,c=a.astar,l=a.bstar,d=s.jstar,m=s.astar,f=s.bstar,h=i+(d-i)*o,g=c+(m-c)*o,b=l+(f-l)*o;return M.fromUcs(h,g,b).toInt()}}/** * @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,n){this.hue=t,this.chroma=n,this.cache=new Map}static fromInt(t){const n=V.fromInt(t);return v.fromHueAndChroma(n.hue,n.chroma)}static fromHueAndChroma(t,n){return new v(t,n)}tone(t){let n=this.cache.get(t);return n===void 0&&(n=V.from(this.hue,this.chroma,t).toInt(),this.cache.set(t,n)),n}}/** * @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 j{constructor(t,n){const o=V.fromInt(t),a=o.hue,s=o.chroma;n?(this.a1=v.fromHueAndChroma(a,s),this.a2=v.fromHueAndChroma(a,s/3),this.a3=v.fromHueAndChroma(a+60,s/2),this.n1=v.fromHueAndChroma(a,Math.min(s/12,4)),this.n2=v.fromHueAndChroma(a,Math.min(s/6,8))):(this.a1=v.fromHueAndChroma(a,Math.max(48,s)),this.a2=v.fromHueAndChroma(a,16),this.a3=v.fromHueAndChroma(a+60,24),this.n1=v.fromHueAndChroma(a,4),this.n2=v.fromHueAndChroma(a,8)),this.error=v.fromHueAndChroma(25,84)}static of(t){return new j(t,!1)}static contentOf(t){return new j(t,!0)}}/** * @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 z{constructor(t){this.props=t}get primary(){return this.props.primary}get onPrimary(){return this.props.onPrimary}get primaryContainer(){return this.props.primaryContainer}get onPrimaryContainer(){return this.props.onPrimaryContainer}get secondary(){return this.props.secondary}get onSecondary(){return this.props.onSecondary}get secondaryContainer(){return this.props.secondaryContainer}get onSecondaryContainer(){return this.props.onSecondaryContainer}get tertiary(){return this.props.tertiary}get onTertiary(){return this.props.onTertiary}get tertiaryContainer(){return this.props.tertiaryContainer}get onTertiaryContainer(){return this.props.onTertiaryContainer}get error(){return this.props.error}get onError(){return this.props.onError}get errorContainer(){return this.props.errorContainer}get onErrorContainer(){return this.props.onErrorContainer}get background(){return this.props.background}get onBackground(){return this.props.onBackground}get surface(){return this.props.surface}get onSurface(){return this.props.onSurface}get surfaceVariant(){return this.props.surfaceVariant}get onSurfaceVariant(){return this.props.onSurfaceVariant}get outline(){return this.props.outline}get outlineVariant(){return this.props.outlineVariant}get shadow(){return this.props.shadow}get scrim(){return this.props.scrim}get inverseSurface(){return this.props.inverseSurface}get inverseOnSurface(){return this.props.inverseOnSurface}get inversePrimary(){return this.props.inversePrimary}static light(t){return z.lightFromCorePalette(j.of(t))}static dark(t){return z.darkFromCorePalette(j.of(t))}static lightContent(t){return z.lightFromCorePalette(j.contentOf(t))}static darkContent(t){return z.darkFromCorePalette(j.contentOf(t))}static lightFromCorePalette(t){return new z({primary:t.a1.tone(40),onPrimary:t.a1.tone(100),primaryContainer:t.a1.tone(90),onPrimaryContainer:t.a1.tone(10),secondary:t.a2.tone(40),onSecondary:t.a2.tone(100),secondaryContainer:t.a2.tone(90),onSecondaryContainer:t.a2.tone(10),tertiary:t.a3.tone(40),onTertiary:t.a3.tone(100),tertiaryContainer:t.a3.tone(90),onTertiaryContainer:t.a3.tone(10),error:t.error.tone(40),onError:t.error.tone(100),errorContainer:t.error.tone(90),onErrorContainer:t.error.tone(10),background:t.n1.tone(99),onBackground:t.n1.tone(10),surface:t.n1.tone(99),onSurface:t.n1.tone(10),surfaceVariant:t.n2.tone(90),onSurfaceVariant:t.n2.tone(30),outline:t.n2.tone(50),outlineVariant:t.n2.tone(80),shadow:t.n1.tone(0),scrim:t.n1.tone(0),inverseSurface:t.n1.tone(20),inverseOnSurface:t.n1.tone(95),inversePrimary:t.a1.tone(80)})}static darkFromCorePalette(t){return new z({primary:t.a1.tone(80),onPrimary:t.a1.tone(20),primaryContainer:t.a1.tone(30),onPrimaryContainer:t.a1.tone(90),secondary:t.a2.tone(80),onSecondary:t.a2.tone(20),secondaryContainer:t.a2.tone(30),onSecondaryContainer:t.a2.tone(90),tertiary:t.a3.tone(80),onTertiary:t.a3.tone(20),tertiaryContainer:t.a3.tone(30),onTertiaryContainer:t.a3.tone(90),error:t.error.tone(80),onError:t.error.tone(20),errorContainer:t.error.tone(30),onErrorContainer:t.error.tone(80),background:t.n1.tone(10),onBackground:t.n1.tone(90),surface:t.n1.tone(10),onSurface:t.n1.tone(90),surfaceVariant:t.n2.tone(30),onSurfaceVariant:t.n2.tone(80),outline:t.n2.tone(60),outlineVariant:t.n2.tone(30),shadow:t.n1.tone(0),scrim:t.n1.tone(0),inverseSurface:t.n1.tone(90),inverseOnSurface:t.n1.tone(20),inversePrimary:t.a1.tone(40)})}toJSON(){return Object.assign({},this.props)}}/** * @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 $t=e=>{const t=Lt(e),n=St(e),o=Dt(e),a=[t.toString(16),n.toString(16),o.toString(16)];for(const[s,i]of a.entries())i.length===1&&(a[s]="0"+i);return"#"+a.join("")},Te=e=>{e=e.replace("#","");const t=e.length===3,n=e.length===6,o=e.length===8;if(!t&&!n&&!o)throw new Error("unexpected hex "+e);let a=0,s=0,i=0;return t?(a=U(e.slice(0,1).repeat(2)),s=U(e.slice(1,2).repeat(2)),i=U(e.slice(2,3).repeat(2))):n?(a=U(e.slice(0,2)),s=U(e.slice(2,4)),i=U(e.slice(4,6))):o&&(a=U(e.slice(2,4)),s=U(e.slice(4,6)),i=U(e.slice(6,8))),(255<<24|(a&255)<<16|(s&255)<<8|i&255)>>>0};function U(e){return parseInt(e,16)}/** * @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 Ce(e,t=[]){const n=j.of(e);return{source:e,schemes:{light:z.light(e),dark:z.dark(e)},palettes:{primary:n.a1,secondary:n.a2,tertiary:n.a3,neutral:n.n1,neutralVariant:n.n2,error:n.error},customColors:t.map(o=>Me(e,o))}}function Me(e,t){let n=t.value;const o=n,a=e;t.blend&&(n=yt.harmonize(o,a));const i=j.of(n).a1;return{color:t,value:n,light:{color:i.tone(40),onColor:i.tone(100),colorContainer:i.tone(90),onColorContainer:i.tone(10)},dark:{color:i.tone(80),onColor:i.tone(20),colorContainer:i.tone(30),onColorContainer:i.tone(90)}}}function Ae(e,t){var n,o;const a=(t==null?void 0:t.target)||document.body,i=((n=t==null?void 0:t.dark)!==null&&n!==void 0?n:!1)?e.schemes.dark:e.schemes.light;if(It(a,i),t!=null&&t.brightnessSuffix&&(It(a,e.schemes.dark,"-dark"),It(a,e.schemes.light,"-light")),t!=null&&t.paletteTones){const c=(o=t==null?void 0:t.paletteTones)!==null&&o!==void 0?o:[];for(const[l,d]of Object.entries(e.palettes)){const m=l.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();for(const f of c){const h=`--md-ref-palette-${m}-${m}${f}`,g=$t(d.tone(f));a.style.setProperty(h,g)}}}}function It(e,t,n=""){for(const[o,a]of Object.entries(t.toJSON())){const s=o.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=$t(a);e.style.setProperty(`--md-sys-color-${s}${n}`,i)}}const ve={light:{"--vmu-color-disabled":"31, 31, 31"},dark:{"--vmu-color-disabled":"227, 227, 227"}},Tt={INVALID_HEX:"Invalid HEX color. Please use a valid HEX (eg. #12F349) color.",NO_TARGET_ELEMENT:"Could not find the target element for the color module."},E=r.reactive({userMode:"auto",systemMode:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"});function we(e){const t=e.matches;E.systemMode=t?"dark":"light"}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",we);const ct=r.computed(()=>E.userMode==="auto"?E.systemMode==="dark":E.userMode==="dark");function xe(e){E.userMode=e}const Ee=r.computed({get:()=>E.userMode,set:e=>xe(e)});function Vt(e){return/^#[0-9A-F]{6}$/i.test(e)}function Re(e){const t=e.trim(),n="0x"+t[1]+t[2],o="0x"+t[3]+t[4],a="0x"+t[5]+t[6];return`${Number(n)}, ${Number(o)}, ${Number(a)}`}const lt=r.ref("#000000");function Ct(e){const t=document.getElementById("vmu-colors");if(!t)throw new Error(Tt.NO_TARGET_ELEMENT);const n=Ce(Te(lt.value)),o=document.createElement("div");Ae(n,{target:o,dark:e});const a=o.style.cssText.split(";").map(i=>{const[c,l]=i.split(":");return l?{key:c,value:Re(l)}:{key:null,value:null}}).map(({key:i,value:c})=>c?`${i.replace("md-sys","vmu")}: ${c}`:"").join(`; `),s=Object.entries(ve[e?"dark":"light"]).map(([i,c])=>`${i}: ${c}`).join(`; `);t.innerHTML=`* { ${a} ${s}}`}function ke(e){if(!Vt(e))throw new Error(Tt.INVALID_HEX);lt.value=e,Ct(ct.value)}const Oe=r.computed({get:()=>lt.value,set:e=>ke(e)});function Le(e){if(!Vt(e))throw new Error(Tt.INVALID_HEX);if(lt.value=e,!document.getElementById("vmu-colors")){const n=document.createElement("style");n.id="vmu-colors",document.head.appendChild(n)}Ct(ct.value),r.watch(ct,()=>{Ct(ct.value)})}function Se(){return Oe}function De(){return Ee}const $e=Object.freeze(Object.defineProperty({__proto__:null,default:{actions:{cancel:"Cancel"}}},Symbol.toStringTag,{value:"Module"}));class Pt extends Error{constructor(t){super(t),this.name="[VueMaterialYou] Error"}}function Bt(e,t){const n=Object.assign({},e);for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(typeof t[o]=="object"?n[o]=Bt(n[o],t[o]):n[o]=t[o]);return n}const Ft={};Object.entries(Object.assign({"./dialog.yaml":$e})).forEach(([e,t])=>{const n=e.match(/\.\/(.+)\.yaml/);Ft[n?n[1]:""]=t.default});const Mt=r.ref(Ft);function Ve(e){Mt.value=Bt(Mt.value,e)}function Nt(e){return r.computed(()=>{const t=e.split(".");let n=Mt.value;for(const o of t)if(n=n[o],!n)throw new Pt(`Message '${e}' not found.`);if(typeof n!="string")throw new Pt(`Incomplete message key path for: ${e}`);return n})}function Pe(e){return{type:void 0,default:typeof e=="object"?()=>e:e}}function Be(e){return{type:void 0,default:typeof e=="object"?()=>e:e,required:!0}}function Fe(e){return{type:Boolean,default:e}}const u={boolean:Fe,generic:Pe,required:Be},ot={"vmu-elevation-1":"_vmu-elevation-1_1t115_1","vmu-elevation-2":"_vmu-elevation-2_1t115_5","vmu-elevation-3":"_vmu-elevation-3_1t115_9","vmu-elevation-4":"_vmu-elevation-4_1t115_13","vmu-elevation-5":"_vmu-elevation-5_1t115_17",button:"_button_1t115_21",button_small:"_button_small_1t115_61",button_small_icon:"_button_small_icon_1t115_65",button_medium:"_button_medium_1t115_69",button_medium_icon:"_button_medium_icon_1t115_73",button_large:"_button_large_1t115_77",button_large_icon:"_button_large_icon_1t115_80",button_filled:"_button_filled_1t115_83",button_outlined:"_button_outlined_1t115_99",button_text:"_button_text_1t115_115",button_elevated:"_button_elevated_1t115_125",button_tonal:"_button_tonal_1t115_146",button__loader:"_button__loader_1t115_172"},ut={mountedOn:null};function jt(){return ut}function Ne(e,t,n){ut.icon||(ut.icon={component:e,key:t,defaults:n})}function je(e){ut.mountedOn=e}const Z=r.defineComponent({name:"VmIcon",props:{icon:u.generic(),props:u.generic({})},setup(e,{slots:t}){const{icon:n}=jt();return()=>{var o;if(n)return r.h(n.component,{...n.defaults,...e.props,[n.key]:e.icon,key:e.icon?e.icon:void 0},(o=t.default)==null?void 0:o.call(t))}}}),ze=`<svg xmlns="http://www.w3.org/2000/svg" width="1.5em" height="1.5em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"> <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"> <path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity=".3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"> <animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0" /> </path> <path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"> <animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0" /> <animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12" /> </path> </g> </svg>`;function zt(e,t){return e!==t?Math.min(e,t):e/2}function Ue(e,t,n,o,a){const s=t/2,i=n/2,c=o>s?(o-s)*2+t:(s-o)*2+t,l=a>i?(a-i)*2+n:(i-a)*2+n;return Math.max(c,l)/e*1.5}function qe(){let e,t;const n=r.reactive({pos:{x:0,y:0},size:0,opacity:0,scale:0,transition:"transform"}),o=r.computed(()=>({"--ripple-pos-x":`${n.pos.x}px`,"--ripple-pos-y":`${n.pos.y}px`,"--ripple-width":`${n.size}px`,"--ripple-height":`${n.size}px`,"--ripple-opacity":`${n.opacity}`,"--ripple-scale":`${n.scale}`,"--transition-property":`${n.transition}`}));let a;function s(l){const d=l.target;if(!d)return;clearTimeout(t),clearTimeout(e);const{clientX:m,clientY:f}=l instanceof MouseEvent?l:l.touches[0],{left:h,top:g,width:b,height:y}=d.getBoundingClientRect(),I={x:m-h,y:f-g};n.pos=I,n.size=zt(b,y),n.transition="transform",n.opacity=.2,n.scale=Ue(n.size,b,y,n.pos.x,n.pos.y),a=new Date}function i(l){const d=l.target;if(!d)return;const{width:m,height:f}=d.getBoundingClientRect(),h=new Date,b=250-Math.max((h==null?void 0:h.getMilliseconds())-(a==null?void 0:a.getMilliseconds()),0);e=setTimeout(()=>{n.transition="opacity",n.opacity=0,t=setTimeout(()=>{n.scale=0,n.size=zt(m,f),n.pos={x:0,y:0}},250)},b)}return{rippleStyleObject:o,events:{onPointerdown:s,onPointerup:i,onPointerleave:i}}}const Ge={sheet:"_sheet_t8ew2_1"},Ut=r.defineComponent({name:"Sheet",props:{component:u.generic("div"),disableRipple:u.boolean(!1)},setup(e,{slots:t}){const{rippleStyleObject:n,events:o}=qe();return()=>{var a,s;return e.disableRipple?r.h(e.component,{},(a=t.default)==null?void 0:a.call(t)):r.h(e.component,{class:Ge.sheet,style:n.value,...o},(s=t.default)==null?void 0:s.call(t))}}}),At=r.defineComponent({name:"VmButton",props:{disabled:u.boolean(),href:u.generic(),icon:u.generic(null),loading:u.boolean(),reset:u.boolean(),size:u.generic("large"),submit:u.boolean(),type:u.generic("filled")},setup(e,{slots:t}){const n={filled:"on-primary",outlined:"primary",text:"primary",elevated:"primary",tonal:"on-secondary-container"},o=r.computed(()=>[e.icon?ot[`button_${e.size}_icon`]:ot[`button_${e.size}`],ot.button,ot[`button_${e.type}`],`vmu-ripple-${n[e.type]} vmu-text-label-${e.size}`]),a=r.computed(()=>({color:e.loading?"transparent":void 0})),s=r.computed(()=>e.submit?"submit":e.reset?"reset":"button");return()=>r.h(Ut,{component:e.href?"a":"button",href:e.href,type:s.value,disabled:e.disabled||e.loading,class:o.value,style:a.value},()=>{var i,c;return[e.icon?[r.h(Z,{icon:e.icon}),(i=t.default)==null?void 0:i.call(t)]:(c=t.default)==null?void 0:c.call(t),e.loading&&r.h("span",{class:ot.button__loader,innerHTML:ze,"aria-hidden":!0})]})}});function Ye(e,t){return r.computed({get:()=>e.modelValue,set:o=>t("update:modelValue",o)})}function L(){return e=>!0}function dt(e=20){return[...Array(e)].map(()=>Math.random().toString(36)[2]).join("")}function We(e){return r.computed(()=>e.id?e.id:`identity_${dt()}`)}const G=r.ref([]);function He(e,t){const n=jt();function o(){if(!G.value.find(i=>i===e.value)){G.value.push(e.value);const i=n.mountedOn;if(!i)return;i.inert=!0,i.ariaHidden="true"}}function a(){G.value=G.value.filter(i=>i!==e.value)}t.value&&o(),r.watch(t,i=>{i?o():a()});const s=r.computed(()=>G.value[G.value.length-1]===e.value);return{dialogs:G,isLast:s}}const Je={scrim:"_scrim_1dzpl_1"},qt=r.ref(window.innerHeight),Gt=r.ref(window.innerWidth);function Xe(){qt.value=window.innerHeight,Gt.value=window.innerWidth}window.addEventListener("resize",Xe);function Qe(){return{height:qt,width:Gt}}const Ze=r.defineComponent({name:"Scrim",props:{id:u.generic(),isLast:u.boolean(!1),open:u.boolean(!1),style:u.generic(),zIndex:u.generic(100)},emits:{"update:modelValue":L(),open:L()},setup(e,{emit:t,slots:n,attrs:o}){async function a(){await r.nextTick(),t("open")}const{height:s}=Qe(),i=r.computed(()=>[e.style,{zIndex:e.zIndex,height:`${s.value}px`}]),c=r.computed(()=>({...o,id:e.id,style:i.value,tabindex:e.isLast?void 0:-1,role:"dialog","aria-hidden":!e.isLast,"aria-modal":"true","aria-labelledby":`${e.id}_title`,"aria-describedby":`${e.id}_description`}));return()=>r.h(r.Teleport,{to:"body"},r.h(r.Transition,{name:"vmu-scrim",onBeforeEnter:a},()=>e.open&&r.h("div",{class:Je.scrim,...c.value},n.default&&n.default())))}}),Y={content:"_content_trg8q_1",fullscreenContent:"_fullscreenContent_trg8q_10",title:"_title_trg8q_19",actions:"_actions_trg8q_23",icon:"_icon_trg8q_30",header:"_header_trg8q_37",header___title:"_header___title_trg8q_44",header___close:"_header___close_trg8q_52"},Ke=r.defineComponent({name:"DialogTitle",props:{dialogId:u.generic(),title:u.generic(),icon:u.generic()},setup(e){return()=>r.h("h1",{id:`${e.dialogId}_title`,class:["vmu-text-headline-small vmu-text-on-surface",Y.title],style:{textAlign:e.icon?"center":"left"}},e.title)}}),tn=r.defineComponent({name:"DialogDescription",props:{dialogId:u.generic(),description:u.generic()},setup(e){return()=>r.h("p",{id:`${e.dialogId}_description`,class:"vmu-text-body-medium vmu-text-on-surface"},e.description)}}),en=r.defineComponent({name:"DialogIcon",props:{icon:u.generic()},setup(e){return()=>e.icon&&r.h("div",{class:Y.icon},r.h(Z,{icon:e.icon,props:{width:24,height:24}}))}}),nn=r.defineComponent({name:"DialogActions",props:{actions:u.generic([])},setup(e){return()=>r.h("div",{class:Y.actions},e.actions.map(t=>r.h(At,{type:"text",onClick:t.handler},()=>t.name)))}}),on=r.defineComponent({name:"DialogContent",props:{attributes:u.generic(),isOpen:u.boolean(!1)},emits:{close:L()},setup(e,{slots:t,emit:n}){const o=r.ref(0),a=r.ref(),s=new ResizeObserver(i=>{i[0]&&(o.value=i[0].target.scrollHeight)});return r.watch(a,()=>{a.value&&(o.value=a.value.scrollHeight,s.observe(a.value))}),r.onBeforeUnmount(()=>{s.disconnect()}),()=>r.h(r.Transition,{name:"vmu-dialog-content",onBeforeLeave:()=>n("close")},()=>{var i,c;return e.isOpen&&r.h("div",{ref:a,class:[Y.content,"vmu-text-on-surface",(i=e.attributes)==null?void 0:i.class],style:`--vmu-max-height: ${o.value}px`,...e.attributes},(c=t.default)==null?void 0:c.call(t))})}}),rn=r.defineComponent({name:"DialogFullscreenContent",props:{isOpen:u.boolean(!1),attributes:u.generic()},emits:{close:L()},setup(e,{slots:t,emit:n}){return()=>r.h(r.Transition,{name:"vmu-fullscreen-dialog-content",onBeforeLeave:()=>{n("close")}},()=>{var o;return e.isOpen&&r.h("div",{...e.attributes,class:[Y.fullscreenContent,"vmu-text-on-surface",(o=e.attributes)==null?void 0:o.class]},t.default&&t.default())})}}),an=`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"> <path fill="currentColor" d="M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6Z" /> </svg>`,sn=r.defineComponent({name:"DialogFullscreenHeader",props:{dialogId:u.generic(),title:u.generic(),actions:u.generic([])},emits:{close:L()},setup(e,{emit:t}){return()=>r.h("div",{class:Y.header},[r.h("button",{class:Y.header___close,"aria-label":Nt("dialog.actions.cancel").value,onClick:()=>t("close"),innerHTML:an}),r.h("h1",{id:`${e.dialogId}_title`,class:["vmu-text-title-large vmu-text-on-surface",Y.header___title]},e.title),e.actions.map(n=>r.h(At,{type:"text",onClick:n.handler},()=>n.name))])}}),cn=r.defineComponent({name:"VmDialog",inheritAttrs:!1,props:{id:u.generic(),zIndex:u.generic(100),modelValue:u.boolean(!1),fullscreen:u.boolean(!1),style:u.generic(),title:u.generic(),description:u.generic(),icon:u.generic(),showCloseAction:u.boolean(!1),actions:u.generic([])},emits:{"update:modelValue":L()},setup(e,{emit:t,attrs:n,slots:o}){const a=We(e),s=Ye(e,t),{isLast:i}=He(a,s),c=r.ref(!1),l=r.ref(!1);s.value&&(c.value=!0,l.value=!0),r.watch(s,h=>{h?c.value=!0:l.value=!1});async function d(){l.value=!0}async function m(){await r.nextTick(),c.value=!1}const f=r.computed(()=>{if(!e.showCloseAction)return e.actions;const h={name:Nt("dialog.actions.cancel").value,handler:()=>s.value=!1};return[...e.actions,h]});return()=>r.h(Ze,{open:c.value,id:a.value,isLast:i.value,onOpen:d},()=>e.fullscreen?r.h(rn,{attributes:n,isOpen:l.value,onClose:m},()=>[r.h(sn,{dialogId:a.value,title:e.title,actions:f.value,onClose:()=>s.value=!1}),o.default&&o.default()]):r.h(on,{attributes:n,isOpen:l.value,onClose:m},()=>[r.h(en,{icon:e.icon}),r.h(Ke,{dialogId:a.value,title:e.title,icon:e.icon}),r.h(tn,{dialogId:a.value,description:e.description}),o.default&&o.default(),r.h(nn,{actions:f.value})]))}}),W="vue-material-you-inspector",ln="Vue Material You",un="rounded_corner",dn="https://registry.npmjs.org/vue-material-you",vt=[{id:"quick-settings",label:"Quick Settings"},{id:"forms",label:"\u{1F9FE} Forms",children:[]}],mt={};let T;function mn(e){mt.forms=e,Object.entries(e).forEach(([t,n])=>{const{state:o,validity:a}=n;mt[t]={"input state":Object.entries(o).map(([s,i])=>({key:s,value:i})),"input validity":Object.entries(a).map(([s,i])=>({key:s,value:i}))}}),T==null||T.sendInspectorState(W)}function Yt(e,t){const n=vt.find(o=>o.id===e);!n||!n.children||(n.children.push(t),T==null||T.sendInspectorTree(W))}function Wt(e,t){const n=vt.find(o=>o.id===e);n&&n.children&&(n.children=n.children.filter(o=>o.id!==t)),T==null||T.sendInspectorTree(W)}function fn(e){T=e,T.addInspector({id:W,label:ln,icon:un}),T.on.getInspectorTree(t=>{t.inspectorId===W&&(t.rootNodes=vt)}),T.on.getInspectorState(t=>{t.inspectorId===W&&(mt[t.nodeId]&&(t.state=mt[t.nodeId]),t.nodeId==="quick-settings"&&(t.state={"dark mode":[{key:"settings",value:E,editable:!0},{key:"isDarkMode",value:E.userMode==="light"?!1:E.userMode==="dark"||E.systemMode==="dark",editable:!0}]}))}),T.on.editInspectorState(t=>{if(t.inspectorId===W&&t.nodeId==="quick-settings"){const{path:n,state:o}=t;switch(n[0]){case"settings":E.userMode=o.value;break;case"isDarkMode":E.userMode=o.value?"dark":"light";break}}}),r.watch(E,()=>{T==null||T.sendInspectorState(W)})}const Ht=Symbol("REGISTER_INPUT"),Jt=Symbol("DEREGISTER_INPUT"),Xt=Symbol("UPDATE_INPUT_VALUE"),Qt=Symbol("VALIDATION_STATE");function wt(e){return!!(e==null||typeof e=="string"&&e===""||Array.isArray(e)&&e.length===0||typeof e=="object"&&Object.keys(e).length===0)}const K=r.reactive({});async function xt(e,t){let n=!0;if(Array.isArray(t))for(const o of t){const a=await o(e);if(a!==!0){n=a;break}}else n=await t(e);return n}function Zt(e,t){const n=r.computed(()=>e.id?e.id:`form_${dt(5)}`),o=r.reactive({}),a=r.reactive({}),s=r.reactive({});r.provide(Qt,s);async function i(m,f){o[m]=f,s[m]={...s[m],valid:await xt(f,a[m])}}r.provide(Xt,i);async function c(m){m.preventDefault();let f=!1;for(const h of Object.entries(o)){const[g,b]=h;s[g]={touched:!0,valid:await xt(b,a[g])},s[g].valid!==!0&&(f=!0)}f?t("invalid",{state:o,validity:s}):t("valid",{state:o,validity:s})}function l(m,f,h){o[m]=f,a[m]=h,s[m]={valid:!0,touched:!wt(f)}}r.provide(Ht,l);function d(m){delete o[m]}return r.provide(Jt,d),(process.env.NODE_ENV==="development"||__VUE_PROD_DEVTOOLS__)&&(K[n.value]={state:o,validity:s},Yt("forms",{id:n.value,label:n.value}),r.watch(n,(m,f)=>{Wt("forms",m),Yt("forms",{id:f,label:f}),delete K[m],K[f]={state:o,validity:s}}),r.watch(K,()=>{mn(K)}),r.onBeforeUnmount(()=>{delete K[n.value],Wt("forms",n.value)})),{state:o,rules:a,validity:s,handleSubmit:c,id:n}}const hn=r.defineComponent({name:"VmuForm",props:{id:u.generic()},emits:{valid:L(),invalid:L()},setup(e,{slots:t,emit:n}){const{handleSubmit:o,id:a}=Zt(e,n);return()=>{var s;return r.h("form",{id:a.value,onSubmit:o},(s=t.default)==null?void 0:s.call(t))}}});function Kt(e,t){const n=r.computed({get:()=>e.modelValue,set:g=>t("update:modelValue",g)}),o=dt(5),a=r.computed(()=>e.id?e.id:`input_${o}`),s=r.computed(()=>e.name?e.name:`input_name_${o}`),i=r.inject(Ht,g=>0),c=r.inject(Jt,g=>0);i(s.value,n.value,e.rules),r.watch(s,g=>{c(g),i(g,n,e.rules)}),r.watch(()=>e.rules,()=>{d(s.value,n.value)});const l=r.inject(Qt,r.reactive({[s.value]:{valid:!0,touched:!wt(n.value)}})),d=r.inject(Xt,async(g,b)=>{l[g]={...l[g],valid:await xt(b,e.rules)}});r.watch(n,g=>{e.max&&typeof g=="string"&&g.length>e.max?n.value=g.slice(0,e.max):d(s.value,g)});const m=r.computed(()=>l[s.value].touched?l[s.value].valid:!0),f=r.computed(()=>l[s.value].touched);function h(){l[s.value].touched=!0,d(s.value,n.value)}return{id:a,name:s,model:n,isValid:m,isClear:f,handleChange:h}}function ft(e,t="#69DCA4"){console.log(`%cVue Material You%c ${e}`,"color: #D0E8D7; background-color: #364B3F; border-radius:4px; padding:2px 10px;",`color:${t}`)}function S(e){const t=r.inject(e);if(t===void 0)throw new Error(`Injection key ${e.toString()} is not defined`);return t}const A={container:"_container_d4003_1",container_error:"_container_error_d4003_16",container_leadingIcon:"_container_leadingIcon_d4003_28",container_trailingIcon:"_container_trailingIcon_d4003_31",icon:"_icon_d4003_35",icon_error:"_icon_error_d4003_42",icon_leading:"_icon_leading_d4003_45",icon_trailing:"_icon_trailing_d4003_49",label:"_label_d4003_54",label_populated:"_label_populated_d4003_66",label_notEmpty:"_label_notEmpty_d4003_71",label_leadingIcon:"_label_leadingIcon_d4003_75",label_error:"_label_error_d4003_78",supportingText:"_supportingText_d4003_82",supportingText_error:"_supportingText_error_d4003_91"},rt=Symbol("ERROR"),_n=r.defineComponent({name:"InputContainer",props:{leadingIcon:u.generic(),trailingIcon:u.generic()},setup(e,{slots:t}){const n=S(rt),o=r.computed(()=>({[A.container]:!0,[A.container_leadingIcon]:!!e.leadingIcon,[A.container_trailingIcon]:!!e.trailingIcon,[A.container_error]:n.value}));return()=>{var a;return r.h("div",{class:o.value},(a=t.default)==null?void 0:a.call(t))}}}),te=r.defineComponent({name:"InputIcon",props:{icon:u.generic(),isLeading:u.boolean()},setup(e){const t=S(rt);return()=>e.icon&&r.h(Z,{"aria-hidden":!0,icon:e.icon,class:[A.icon,e.isLeading?A.icon_leading:A.icon_trailing,t.value?A.icon_error:""]})}}),gn=r.defineComponent({name:"InputLabel",props:{id:u.generic(),label:u.generic(),isFocused:u.boolean(),model:u.generic(),leadingIcon:u.generic()},setup(e){const t=S(rt),n=r.computed(()=>({[A.label]:!0,[`${A.label_populated} vmu-text-body-small`]:e.isFocused,[`${A.label_notEmpty} vmu-text-body-small`]:!wt(e.model),[A.label_leadingIcon]:!!e.leadingIcon,[A.label_error]:t.value}));return()=>{var o;return r.h("label",{class:n.value,for:e.id},(o=e.label)!=null?o:"")}}}),bn=r.defineComponent({name:"InputSupportingText",props:{text:u.generic(),count:u.generic(0),max:u.generic()},setup(e){const t=S(rt);return()=>r.h("div",{class:["vmu-text-body-small",A.supportingText,t.value?A.supportingText_error:""]},[r.h("div",{},e.text),e.max&&r.h("div",{},`${e.count}/${e.max}`)])}}),pn=r.defineComponent({name:"VmuInput",inheritAttrs:!1,props:{id:u.generic(),name:u.generic(),modelValue:u.generic(),label:u.generic(),ariaLabel:u.generic(),rules:u.generic([]),leadingIcon:u.generic(),trailingIcon:u.generic(),supportingText:u.generic(),max:u.generic(),placeholder:u.generic(),type:u.generic("text")},emits:{"update:modelValue":L()},setup(e,{emit:t}){const{model:n,handleChange:o,id:a,isValid:s,name:i}=Kt(e,t),c=r.computed(()=>typeof s.value=="string");r.provide(rt,c),!e.label&&!e.ariaLabel&&ft(`VmuInput ${i.value}: A label or aria-label is required for accessibility.`,"#FFAAAA");function l(b){var y;n.value=(y=b.target)==null?void 0:y.value}const d=r.ref(!1);function m(){d.value=!0}function f(){d.value=!1,o()}const h=r.computed(()=>typeof s.value=="string"?s.value:e.supportingText?e.supportingText:"");function g(b){b.preventDefault();const y=document.getElementById(a.value);y&&y.focus()}return()=>{var b;return r.h("div",{},[r.h(_n,{leadingIcon:e.leadingIcon,trailingIcon:e.trailingIcon,onMousedown:g},()=>[r.h(te,{icon:e.leadingIcon,isLeading:!0}),r.h(gn,{label:e.label,id:a.value,is