Files
DeviceManager/apps/manager/build/_app/immutable/nodes/0.460d8064.js

294 lines
98 KiB
JavaScript

import{c as Gn,a as jn,t as Yn,h as Xn,g as qn}from "../chunks/share.0727875d.js";import{_ as ke}from "../chunks/preload-helper.a4192956.js";import{r as Nt,s as Ct,f as L,l as V,a as S,g as P,h as M,m as W,d as k,c as F,u as lt,j as C,i as R,v as _,w as ct,x as K,n as G,y as tt,z as Lt,A as q,B as $t,e as vt,C as ee,k as Jn,D as bt,E as Ee,F as Ie,G as ve,H as Ce,I as En,o as Ue,p as Le,J as Kn,K as Ve,L as We,M as Et,N as Me,O as nn,t as Zn,P as Qn,Q as xn}from "../chunks/scheduler.f5cfe514.js";import{S as Pt,i as Dt,a as X,g as ce,t as Z,c as ue,f as kt,b as Bt,d as Ut,m as Vt,e as Wt,h as tr,j as er}from "../chunks/index.c2fc59c9.js";import{s as zt,p as In,i as vn,a as Zt,d as rn,b as an,c as on,e as Cn,u as Ln,t as se,f as nr,g as rr}from "../chunks/connection.5cd615cd.js";import{s as ne,f as sn,a as jt,e as ar,b as or}from "../chunks/index.085a7975.js";import{t as Pn,a as It}from "../chunks/title.f08fecde.js";import{L as Ht,l as Te,a as Dn,b as sr,d as An,s as On}from "../chunks/i18n-svelte.4af892db.js";import{c as Ot,s as ze,C as $e,l as He,a as Mn,o as lr}from "../chunks/undo-redo.825f6805.js";import{e as we}from "../chunks/each.94f093eb.js";import{p as ir}from "../chunks/stores.a124d468.js";import{K as cr}from "../chunks/keymap-codes.fc236303.js";import{v as ln,j as Ge}from "../chunks/singletons.de2fb98c.js";const ur=!0,fr=ur,hr=!0,dr="always",mr=async({url:e,data:t,fetch:n})=>{const r=new URLSearchParams(e.search).get("import");return{...t,importFile:r?await Gn(r,n):void 0}},mo=Object.freeze(Object.defineProperty({__proto__:null,load:mr,prerender:hr,trailingSlash:dr},Symbol.toStringTag,{value:"Module"}));/**
* @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 gt(e){return e<0?-1:e===0?0:1}function le(e,t,n){return(1-n)*e+n*t}function pr(e,t,n){return n<e?e:n>t?t:n}function ye(e,t,n){return n<e?e:n>t?t:n}function je(e){return e=e%360,e<0&&(e=e+360),e}function _r(e,t){return je(t-e)<=180?1:-1}function gr(e,t){return 180-Math.abs(Math.abs(e-t)-180)}function Re(e,t){const n=e[0]*t[0][0]+e[1]*t[0][1]+e[2]*t[0][2],r=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,r,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 br=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],kr=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],Tr=[95.047,100,108.883];function Ye(e,t,n){return(255<<24|(e&255)<<16|(t&255)<<8|n&255)>>>0}function cn(e){const t=Qt(e[0]),n=Qt(e[1]),r=Qt(e[2]);return Ye(t,n,r)}function wn(e){return e>>16&255}function Rn(e){return e>>8&255}function Nn(e){return e&255}function yr(e,t,n){const r=kr,a=r[0][0]*e+r[0][1]*t+r[0][2]*n,o=r[1][0]*e+r[1][1]*t+r[1][2]*n,s=r[2][0]*e+r[2][1]*t+r[2][2]*n,c=Qt(a),l=Qt(o),i=Qt(s);return Ye(c,l,i)}function Er(e){const t=te(wn(e)),n=te(Rn(e)),r=te(Nn(e));return Re([t,n,r],br)}function Ir(e){const t=Yt(e),n=Qt(t);return Ye(n,n,n)}function Ne(e){const t=Er(e)[1];return 116*Sn(t/100)-16}function Yt(e){return 100*Cr((e+16)/116)}function Se(e){return Sn(e/100)*116-16}function te(e){const t=e/255;return t<=.040449936?t/12.92*100:Math.pow((t+.055)/1.055,2.4)*100}function Qt(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,pr(0,255,Math.round(n*255))}function vr(){return Tr}function Sn(e){const t=.008856451679035631,n=24389/27;return e>t?Math.pow(e,1/3):(n*e+16)/116}function Cr(e){const t=.008856451679035631,n=24389/27,r=e*e*e;return r>t?r:(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 Mt{static make(t=vr(),n=200/Math.PI*Yt(50)/100,r=50,a=2,o=!1){const s=t,c=s[0]*.401288+s[1]*.650173+s[2]*-.051461,l=s[0]*-.250268+s[1]*1.204414+s[2]*.045854,i=s[0]*-.002079+s[1]*.048952+s[2]*.953127,u=.8+a/10,d=u>=.9?le(.59,.69,(u-.9)*10):le(.525,.59,(u-.8)*10);let b=o?1:u*(1-1/3.6*Math.exp((-n-42)/92));b=b>1?1:b<0?0:b;const m=u,v=[b*(100/c)+1-b,b*(100/l)+1-b,b*(100/i)+1-b],g=1/(5*n+1),y=g*g*g*g,I=1-y,E=y*n+.1*I*I*Math.cbrt(5*n),p=Yt(r)/t[1],h=1.48+Math.sqrt(p),f=.725/Math.pow(p,.2),D=f,O=[Math.pow(E*v[0]*c/100,.42),Math.pow(E*v[1]*l/100,.42),Math.pow(E*v[2]*i/100,.42)],w=[400*O[0]/(O[0]+27.13),400*O[1]/(O[1]+27.13),400*O[2]/(O[2]+27.13)],N=(2*w[0]+w[1]+.05*w[2])*f;return new Mt(p,N,f,D,d,m,v,E,Math.pow(E,.25),h)}constructor(t,n,r,a,o,s,c,l,i,u){this.n=t,this.aw=n,this.nbb=r,this.ncb=a,this.c=o,this.nc=s,this.rgbD=c,this.fl=l,this.fLRoot=i,this.z=u}}Mt.DEFAULT=Mt.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 ot{constructor(t,n,r,a,o,s,c,l,i){this.hue=t,this.chroma=n,this.j=r,this.q=a,this.m=o,this.s=s,this.jstar=c,this.astar=l,this.bstar=i}distance(t){const n=this.jstar-t.jstar,r=this.astar-t.astar,a=this.bstar-t.bstar,o=Math.sqrt(n*n+r*r+a*a);return 1.41*Math.pow(o,.63)}static fromInt(t){return ot.fromIntInViewingConditions(t,Mt.DEFAULT)}static fromIntInViewingConditions(t,n){const r=(t&16711680)>>16,a=(t&65280)>>8,o=t&255,s=te(r),c=te(a),l=te(o),i=.41233895*s+.35762064*c+.18051042*l,u=.2126*s+.7152*c+.0722*l,d=.01932141*s+.11916382*c+.95034478*l,b=.401288*i+.650173*u-.051461*d,m=-.250268*i+1.204414*u+.045854*d,v=-.002079*i+.048952*u+.953127*d,g=n.rgbD[0]*b,y=n.rgbD[1]*m,I=n.rgbD[2]*v,E=Math.pow(n.fl*Math.abs(g)/100,.42),p=Math.pow(n.fl*Math.abs(y)/100,.42),h=Math.pow(n.fl*Math.abs(I)/100,.42),f=gt(g)*400*E/(E+27.13),D=gt(y)*400*p/(p+27.13),O=gt(I)*400*h/(h+27.13),w=(11*f+-12*D+O)/11,N=(f+D-2*O)/9,$=(20*f+20*D+21*O)/20,Q=(40*f+20*D+O)/20,U=Math.atan2(N,w)*180/Math.PI,x=U<0?U+360:U>=360?U-360:U,J=x*Math.PI/180,z=Q*n.nbb,Y=100*Math.pow(z/n.aw,n.c*n.z),nt=4/n.c*Math.sqrt(Y/100)*(n.aw+4)*n.fLRoot,yt=x<20.14?x+360:x,dt=.25*(Math.cos(yt*Math.PI/180+2)+3.8),wt=5e4/13*dt*n.nc*n.ncb*Math.sqrt(w*w+N*N)/($+.305),ut=Math.pow(wt,.9)*Math.pow(1.64-Math.pow(.29,n.n),.73),mt=ut*Math.sqrt(Y/100),pt=mt*n.fLRoot,Xt=50*Math.sqrt(ut*n.c/(n.aw+4)),At=(1+100*.007)*Y/(1+.007*Y),qt=1/.0228*Math.log(1+.0228*pt),ae=qt*Math.cos(J),Rt=qt*Math.sin(J);return new ot(x,mt,Y,nt,pt,Xt,At,ae,Rt)}static fromJch(t,n,r){return ot.fromJchInViewingConditions(t,n,r,Mt.DEFAULT)}static fromJchInViewingConditions(t,n,r,a){const o=4/a.c*Math.sqrt(t/100)*(a.aw+4)*a.fLRoot,s=n*a.fLRoot,c=n/Math.sqrt(t/100),l=50*Math.sqrt(c*a.c/(a.aw+4)),i=r*Math.PI/180,u=(1+100*.007)*t/(1+.007*t),d=1/.0228*Math.log(1+.0228*s),b=d*Math.cos(i),m=d*Math.sin(i);return new ot(r,n,t,o,s,l,u,b,m)}static fromUcs(t,n,r){return ot.fromUcsInViewingConditions(t,n,r,Mt.DEFAULT)}static fromUcsInViewingConditions(t,n,r,a){const o=n,s=r,c=Math.sqrt(o*o+s*s),i=(Math.exp(c*.0228)-1)/.0228/a.fLRoot;let u=Math.atan2(s,o)*(180/Math.PI);u<0&&(u+=360);const d=t/(1-(t-100)*.007);return ot.fromJchInViewingConditions(d,i,u,a)}toInt(){return this.viewed(Mt.DEFAULT)}viewed(t){const n=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(n/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),a=this.hue*Math.PI/180,o=.25*(Math.cos(a+2)+3.8),s=t.aw*Math.pow(this.j/100,1/t.c/t.z),c=o*(5e4/13)*t.nc*t.ncb,l=s/t.nbb,i=Math.sin(a),u=Math.cos(a),d=23*(l+.305)*r/(23*c+11*r*u+108*r*i),b=d*u,m=d*i,v=(460*l+451*b+288*m)/1403,g=(460*l-891*b-261*m)/1403,y=(460*l-220*b-6300*m)/1403,I=Math.max(0,27.13*Math.abs(v)/(400-Math.abs(v))),E=gt(v)*(100/t.fl)*Math.pow(I,1/.42),p=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),h=gt(g)*(100/t.fl)*Math.pow(p,1/.42),f=Math.max(0,27.13*Math.abs(y)/(400-Math.abs(y))),D=gt(y)*(100/t.fl)*Math.pow(f,1/.42),O=E/t.rgbD[0],w=h/t.rgbD[1],N=D/t.rgbD[2],$=1.86206786*O-1.01125463*w+.14918677*N,Q=.38752654*O+.62144744*w-.00897398*N,H=-.0158415*O-.03412294*w+1.04996444*N;return yr($,Q,H)}static fromXyzInViewingConditions(t,n,r,a){const o=.401288*t+.650173*n-.051461*r,s=-.250268*t+1.204414*n+.045854*r,c=-.002079*t+.048952*n+.953127*r,l=a.rgbD[0]*o,i=a.rgbD[1]*s,u=a.rgbD[2]*c,d=Math.pow(a.fl*Math.abs(l)/100,.42),b=Math.pow(a.fl*Math.abs(i)/100,.42),m=Math.pow(a.fl*Math.abs(u)/100,.42),v=gt(l)*400*d/(d+27.13),g=gt(i)*400*b/(b+27.13),y=gt(u)*400*m/(m+27.13),I=(11*v+-12*g+y)/11,E=(v+g-2*y)/9,p=(20*v+20*g+21*y)/20,h=(40*v+20*g+y)/20,D=Math.atan2(E,I)*180/Math.PI,O=D<0?D+360:D>=360?D-360:D,w=O*Math.PI/180,N=h*a.nbb,$=100*Math.pow(N/a.aw,a.c*a.z),Q=4/a.c*Math.sqrt($/100)*(a.aw+4)*a.fLRoot,H=O<20.14?O+360:O,U=1/4*(Math.cos(H*Math.PI/180+2)+3.8),J=5e4/13*U*a.nc*a.ncb*Math.sqrt(I*I+E*E)/(p+.305),z=Math.pow(J,.9)*Math.pow(1.64-Math.pow(.29,a.n),.73),Y=z*Math.sqrt($/100),nt=Y*a.fLRoot,yt=50*Math.sqrt(z*a.c/(a.aw+4)),dt=(1+100*.007)*$/(1+.007*$),ht=Math.log(1+.0228*nt)/.0228,wt=ht*Math.cos(w),ut=ht*Math.sin(w);return new ot(O,Y,$,Q,nt,yt,dt,wt,ut)}xyzInViewingConditions(t){const n=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(n/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),a=this.hue*Math.PI/180,o=.25*(Math.cos(a+2)+3.8),s=t.aw*Math.pow(this.j/100,1/t.c/t.z),c=o*(5e4/13)*t.nc*t.ncb,l=s/t.nbb,i=Math.sin(a),u=Math.cos(a),d=23*(l+.305)*r/(23*c+11*r*u+108*r*i),b=d*u,m=d*i,v=(460*l+451*b+288*m)/1403,g=(460*l-891*b-261*m)/1403,y=(460*l-220*b-6300*m)/1403,I=Math.max(0,27.13*Math.abs(v)/(400-Math.abs(v))),E=gt(v)*(100/t.fl)*Math.pow(I,1/.42),p=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),h=gt(g)*(100/t.fl)*Math.pow(p,1/.42),f=Math.max(0,27.13*Math.abs(y)/(400-Math.abs(y))),D=gt(y)*(100/t.fl)*Math.pow(f,1/.42),O=E/t.rgbD[0],w=h/t.rgbD[1],N=D/t.rgbD[2],$=1.86206786*O-1.01125463*w+.14918677*N,Q=.38752654*O+.62144744*w-.00897398*N,H=-.0158415*O-.03412294*w+1.04996444*N;return[$,Q,H]}}/**
* @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 B{static sanitizeRadians(t){return(t+Math.PI*8)%(Math.PI*2)}static trueDelinearized(t){const n=t/100;let r=0;return n<=.0031308?r=n*12.92:r=1.055*Math.pow(n,1/2.4)-.055,r*255}static chromaticAdaptation(t){const n=Math.pow(Math.abs(t),.42);return gt(t)*400*n/(n+27.13)}static hueOf(t){const n=Re(t,B.SCALED_DISCOUNT_FROM_LINRGB),r=B.chromaticAdaptation(n[0]),a=B.chromaticAdaptation(n[1]),o=B.chromaticAdaptation(n[2]),s=(11*r+-12*a+o)/11,c=(r+a-2*o)/9;return Math.atan2(c,s)}static areInCyclicOrder(t,n,r){const a=B.sanitizeRadians(n-t),o=B.sanitizeRadians(r-t);return a<o}static intercept(t,n,r){return(n-t)/(r-t)}static lerpPoint(t,n,r){return[t[0]+(r[0]-t[0])*n,t[1]+(r[1]-t[1])*n,t[2]+(r[2]-t[2])*n]}static setCoordinate(t,n,r,a){const o=B.intercept(t[a],n,r[a]);return B.lerpPoint(t,o,r)}static isBounded(t){return 0<=t&&t<=100}static nthVertex(t,n){const r=B.Y_FROM_LINRGB[0],a=B.Y_FROM_LINRGB[1],o=B.Y_FROM_LINRGB[2],s=n%4<=1?0:100,c=n%2===0?0:100;if(n<4){const l=s,i=c,u=(t-l*a-i*o)/r;return B.isBounded(u)?[u,l,i]:[-1,-1,-1]}else if(n<8){const l=s,i=c,u=(t-i*r-l*o)/a;return B.isBounded(u)?[i,u,l]:[-1,-1,-1]}else{const l=s,i=c,u=(t-l*r-i*a)/o;return B.isBounded(u)?[l,i,u]:[-1,-1,-1]}}static bisectToSegment(t,n){let r=[-1,-1,-1],a=r,o=0,s=0,c=!1,l=!0;for(let i=0;i<12;i++){const u=B.nthVertex(t,i);if(u[0]<0)continue;const d=B.hueOf(u);if(!c){r=u,a=u,o=d,s=d,c=!0;continue}(l||B.areInCyclicOrder(o,d,s))&&(l=!1,B.areInCyclicOrder(o,n,d)?(a=u,s=d):(r=u,o=d))}return[r,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 r=B.bisectToSegment(t,n);let a=r[0],o=B.hueOf(a),s=r[1];for(let c=0;c<3;c++)if(a[c]!==s[c]){let l=-1,i=255;a[c]<s[c]?(l=B.criticalPlaneBelow(B.trueDelinearized(a[c])),i=B.criticalPlaneAbove(B.trueDelinearized(s[c]))):(l=B.criticalPlaneAbove(B.trueDelinearized(a[c])),i=B.criticalPlaneBelow(B.trueDelinearized(s[c])));for(let u=0;u<8&&!(Math.abs(i-l)<=1);u++){const d=Math.floor((l+i)/2),b=B.CRITICAL_PLANES[d],m=B.setCoordinate(a,b,s,c),v=B.hueOf(m);B.areInCyclicOrder(o,n,v)?(s=m,i=d):(a=m,o=v,l=d)}}return B.midpoint(a,s)}static inverseChromaticAdaptation(t){const n=Math.abs(t),r=Math.max(0,27.13*n/(400-n));return gt(t)*Math.pow(r,1/.42)}static findResultByJ(t,n,r){let a=Math.sqrt(r)*11;const o=Mt.DEFAULT,s=1/Math.pow(1.64-Math.pow(.29,o.n),.73),l=.25*(Math.cos(t+2)+3.8)*(5e4/13)*o.nc*o.ncb,i=Math.sin(t),u=Math.cos(t);for(let d=0;d<5;d++){const b=a/100,m=n===0||a===0?0:n/Math.sqrt(b),v=Math.pow(m*s,1/.9),y=o.aw*Math.pow(b,1/o.c/o.z)/o.nbb,I=23*(y+.305)*v/(23*l+11*v*u+108*v*i),E=I*u,p=I*i,h=(460*y+451*E+288*p)/1403,f=(460*y-891*E-261*p)/1403,D=(460*y-220*E-6300*p)/1403,O=B.inverseChromaticAdaptation(h),w=B.inverseChromaticAdaptation(f),N=B.inverseChromaticAdaptation(D),$=Re([O,w,N],B.LINRGB_FROM_SCALED_DISCOUNT);if($[0]<0||$[1]<0||$[2]<0)return 0;const Q=B.Y_FROM_LINRGB[0],H=B.Y_FROM_LINRGB[1],U=B.Y_FROM_LINRGB[2],x=Q*$[0]+H*$[1]+U*$[2];if(x<=0)return 0;if(d===4||Math.abs(x-r)<.002)return $[0]>100.01||$[1]>100.01||$[2]>100.01?0:cn($);a=a-(x-r)*a/(2*x)}return 0}static solveToInt(t,n,r){if(n<1e-4||r<1e-4||r>99.9999)return Ir(r);t=je(t);const a=t/180*Math.PI,o=Yt(r),s=B.findResultByJ(a,n,o);if(s!==0)return s;const c=B.bisectToLimit(o,a);return cn(c)}static solveToCam(t,n,r){return ot.fromInt(B.solveToInt(t,n,r))}}B.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]];B.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]];B.Y_FROM_LINRGB=[.2126,.7152,.0722];B.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 st{static from(t,n,r){return new st(B.solveToInt(t,n,r))}static fromInt(t){return new st(t)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(t){this.setInternalState(B.solveToInt(t,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(t){this.setInternalState(B.solveToInt(this.internalHue,t,this.internalTone))}get tone(){return this.internalTone}set tone(t){this.setInternalState(B.solveToInt(this.internalHue,this.internalChroma,t))}constructor(t){this.argb=t;const n=ot.fromInt(t);this.internalHue=n.hue,this.internalChroma=n.chroma,this.internalTone=Ne(t),this.argb=t}setInternalState(t){const n=ot.fromInt(t);this.internalHue=n.hue,this.internalChroma=n.chroma,this.internalTone=Ne(t),this.argb=t}inViewingConditions(t){const r=ot.fromInt(this.toInt()).xyzInViewingConditions(t),a=ot.fromXyzInViewingConditions(r[0],r[1],r[2],Mt.make());return st.from(a.hue,a.chroma,Se(r[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 Xe{static harmonize(t,n){const r=st.fromInt(t),a=st.fromInt(n),o=gr(r.hue,a.hue),s=Math.min(o*.5,15),c=je(r.hue+s*_r(r.hue,a.hue));return st.from(c,r.chroma,r.tone).toInt()}static hctHue(t,n,r){const a=Xe.cam16Ucs(t,n,r),o=ot.fromInt(a),s=ot.fromInt(t);return st.from(o.hue,s.chroma,Ne(t)).toInt()}static cam16Ucs(t,n,r){const a=ot.fromInt(t),o=ot.fromInt(n),s=a.jstar,c=a.astar,l=a.bstar,i=o.jstar,u=o.astar,d=o.bstar,b=s+(i-s)*r,m=c+(u-c)*r,v=l+(d-l)*r;return ot.fromUcs(b,m,v).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 at{static ratioOfTones(t,n){return t=ye(0,100,t),n=ye(0,100,n),at.ratioOfYs(Yt(t),Yt(n))}static ratioOfYs(t,n){const r=t>n?t:n,a=r===n?t:n;return(r+5)/(a+5)}static lighter(t,n){if(t<0||t>100)return-1;const r=Yt(t),a=n*(r+5)-5,o=at.ratioOfYs(a,r),s=Math.abs(o-n);if(o<n&&s>.04)return-1;const c=Se(a)+.4;return c<0||c>100?-1:c}static darker(t,n){if(t<0||t>100)return-1;const r=Yt(t),a=(r+5)/n-5,o=at.ratioOfYs(r,a),s=Math.abs(o-n);if(o<n&&s>.04)return-1;const c=Se(a)-.4;return c<0||c>100?-1:c}static lighterUnsafe(t,n){const r=at.lighter(t,n);return r<0?100:r}static darkerUnsafe(t,n){const r=at.darker(t,n);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 qe{static isDisliked(t){const n=Math.round(t.hue)>=90&&Math.round(t.hue)<=111,r=Math.round(t.chroma)>16,a=Math.round(t.tone)<65;return n&&r&&a}static fixIfDisliked(t){return qe.isDisliked(t)?st.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 A{static fromPalette(t){return new A(t.name??"",t.palette,t.tone,t.isBackground??!1,t.background,t.secondBackground,t.contrastCurve,t.toneDeltaPair)}constructor(t,n,r,a,o,s,c,l){if(this.name=t,this.palette=n,this.tone=r,this.isBackground=a,this.background=o,this.secondBackground=s,this.contrastCurve=c,this.toneDeltaPair=l,this.hctCache=new Map,!o&&s)throw new Error(`Color ${t} has secondBackgrounddefined, but background is not defined.`);if(!o&&c)throw new Error(`Color ${t} has contrastCurvedefined, but background is not defined.`);if(o&&!c)throw new Error(`Color ${t} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(t){return this.getHct(t).toInt()}getHct(t){const n=this.hctCache.get(t);if(n!=null)return n;const r=this.getTone(t),a=this.palette(t).getHct(r);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(t,a),a}getTone(t){const n=t.contrastLevel<0;if(this.toneDeltaPair){const r=this.toneDeltaPair(t),a=r.roleA,o=r.roleB,s=r.delta,c=r.polarity,l=r.stayTogether,u=this.background(t).getTone(t),d=c==="nearer"||c==="lighter"&&!t.isDark||c==="darker"&&t.isDark,b=d?a:o,m=d?o:a,v=this.name===b.name,g=t.isDark?1:-1,y=b.contrastCurve.getContrast(t.contrastLevel),I=m.contrastCurve.getContrast(t.contrastLevel),E=b.tone(t);let p=at.ratioOfTones(u,E)>=y?E:A.foregroundTone(u,y);const h=m.tone(t);let f=at.ratioOfTones(u,h)>=I?h:A.foregroundTone(u,I);return n&&(p=A.foregroundTone(u,y),f=A.foregroundTone(u,I)),(f-p)*g>=s||(f=ye(0,100,p+s*g),(f-p)*g>=s||(p=ye(0,100,f-s*g))),50<=p&&p<60?g>0?(p=60,f=Math.max(f,p+s*g)):(p=49,f=Math.min(f,p+s*g)):50<=f&&f<60&&(l?g>0?(p=60,f=Math.max(f,p+s*g)):(p=49,f=Math.min(f,p+s*g)):g>0?f=60:f=49),v?p:f}else{let r=this.tone(t);if(this.background==null)return r;const a=this.background(t).getTone(t),o=this.contrastCurve.getContrast(t.contrastLevel);if(at.ratioOfTones(a,r)>=o||(r=A.foregroundTone(a,o)),n&&(r=A.foregroundTone(a,o)),this.isBackground&&50<=r&&r<60&&(at.ratioOfTones(49,a)>=o?r=49:r=60),this.secondBackground){const[s,c]=[this.background,this.secondBackground],[l,i]=[s(t).getTone(t),c(t).getTone(t)],[u,d]=[Math.max(l,i),Math.min(l,i)];if(at.ratioOfTones(u,r)>=o&&at.ratioOfTones(d,r)>=o)return r;const b=at.lighter(u,o),m=at.darker(d,o),v=[];return b!==-1&&v.push(b),m!==-1&&v.push(m),A.tonePrefersLightForeground(l)||A.tonePrefersLightForeground(i)?b<0?100:b:v.length===1?v[0]:m<0?0:m}return r}}static foregroundTone(t,n){const r=at.lighterUnsafe(t,n),a=at.darkerUnsafe(t,n),o=at.ratioOfTones(r,t),s=at.ratioOfTones(a,t);if(A.tonePrefersLightForeground(t)){const l=Math.abs(o-s)<.1&&o<n&&s<n;return o>=n||o>=s||l?r:a}else return s>=n||s>=o?a:r}static tonePrefersLightForeground(t){return Math.round(t)<60}static toneAllowsLightForeground(t){return Math.round(t)<=49}static enableLightForeground(t){return A.tonePrefersLightForeground(t)&&!A.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 ie;(function(e){e[e.MONOCHROME=0]="MONOCHROME",e[e.NEUTRAL=1]="NEUTRAL",e[e.TONAL_SPOT=2]="TONAL_SPOT",e[e.VIBRANT=3]="VIBRANT",e[e.EXPRESSIVE=4]="EXPRESSIVE",e[e.FIDELITY=5]="FIDELITY",e[e.CONTENT=6]="CONTENT",e[e.RAINBOW=7]="RAINBOW",e[e.FRUIT_SALAD=8]="FRUIT_SALAD"})(ie||(ie={}));/**
* @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 j{constructor(t,n,r,a){this.low=t,this.normal=n,this.medium=r,this.high=a}getContrast(t){return t<=-1?this.low:t<0?le(this.low,this.normal,(t- -1)/1):t<.5?le(this.normal,this.medium,(t-0)/.5):t<1?le(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 Tt{constructor(t,n,r,a,o){this.roleA=t,this.roleB=n,this.delta=r,this.polarity=a,this.stayTogether=o}}/**
* @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 re(e){return e.variant===ie.FIDELITY||e.variant===ie.CONTENT}function et(e){return e.variant===ie.MONOCHROME}function Lr(e,t,n,r){let a=n,o=st.from(e,t,n);if(o.chroma<t){let s=o.chroma;for(;o.chroma<t;){a+=r?-1:1;const c=st.from(e,t,a);if(s>c.chroma||Math.abs(c.chroma-t)<.4)break;const l=Math.abs(c.chroma-t),i=Math.abs(o.chroma-t);l<i&&(o=c),s=Math.max(s,c.chroma)}}return a}function Pr(e){return Mt.make(void 0,void 0,e.isDark?30:80,void 0,void 0)}function Je(e,t){const n=e.inViewingConditions(Pr(t));return A.tonePrefersLightForeground(e.tone)&&!A.toneAllowsLightForeground(n.tone)?A.enableLightForeground(e.tone):A.enableLightForeground(n.tone)}class T{static highestSurface(t){return t.isDark?T.surfaceBright:T.surfaceDim}}T.contentAccentToneDelta=15;T.primaryPaletteKeyColor=A.fromPalette({name:"primary_palette_key_color",palette:e=>e.primaryPalette,tone:e=>e.primaryPalette.keyColor.tone});T.secondaryPaletteKeyColor=A.fromPalette({name:"secondary_palette_key_color",palette:e=>e.secondaryPalette,tone:e=>e.secondaryPalette.keyColor.tone});T.tertiaryPaletteKeyColor=A.fromPalette({name:"tertiary_palette_key_color",palette:e=>e.tertiaryPalette,tone:e=>e.tertiaryPalette.keyColor.tone});T.neutralPaletteKeyColor=A.fromPalette({name:"neutral_palette_key_color",palette:e=>e.neutralPalette,tone:e=>e.neutralPalette.keyColor.tone});T.neutralVariantPaletteKeyColor=A.fromPalette({name:"neutral_variant_palette_key_color",palette:e=>e.neutralVariantPalette,tone:e=>e.neutralVariantPalette.keyColor.tone});T.background=A.fromPalette({name:"background",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0});T.onBackground=A.fromPalette({name:"on_background",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>T.background,contrastCurve:new j(3,3,4.5,7)});T.surface=A.fromPalette({name:"surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0});T.surfaceDim=A.fromPalette({name:"surface_dim",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:87,isBackground:!0});T.surfaceBright=A.fromPalette({name:"surface_bright",palette:e=>e.neutralPalette,tone:e=>e.isDark?24:98,isBackground:!0});T.surfaceContainerLowest=A.fromPalette({name:"surface_container_lowest",palette:e=>e.neutralPalette,tone:e=>e.isDark?4:100,isBackground:!0});T.surfaceContainerLow=A.fromPalette({name:"surface_container_low",palette:e=>e.neutralPalette,tone:e=>e.isDark?10:96,isBackground:!0});T.surfaceContainer=A.fromPalette({name:"surface_container",palette:e=>e.neutralPalette,tone:e=>e.isDark?12:94,isBackground:!0});T.surfaceContainerHigh=A.fromPalette({name:"surface_container_high",palette:e=>e.neutralPalette,tone:e=>e.isDark?17:92,isBackground:!0});T.surfaceContainerHighest=A.fromPalette({name:"surface_container_highest",palette:e=>e.neutralPalette,tone:e=>e.isDark?22:90,isBackground:!0});T.onSurface=A.fromPalette({name:"on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>T.highestSurface(e),contrastCurve:new j(4.5,7,11,21)});T.surfaceVariant=A.fromPalette({name:"surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:90,isBackground:!0});T.onSurfaceVariant=A.fromPalette({name:"on_surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?80:30,background:e=>T.highestSurface(e),contrastCurve:new j(3,4.5,7,11)});T.inverseSurface=A.fromPalette({name:"inverse_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:20});T.inverseOnSurface=A.fromPalette({name:"inverse_on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?20:95,background:e=>T.inverseSurface,contrastCurve:new j(4.5,7,11,21)});T.outline=A.fromPalette({name:"outline",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?60:50,background:e=>T.highestSurface(e),contrastCurve:new j(1.5,3,4.5,7)});T.outlineVariant=A.fromPalette({name:"outline_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:80,background:e=>T.highestSurface(e),contrastCurve:new j(1,1,3,7)});T.shadow=A.fromPalette({name:"shadow",palette:e=>e.neutralPalette,tone:e=>0});T.scrim=A.fromPalette({name:"scrim",palette:e=>e.neutralPalette,tone:e=>0});T.surfaceTint=A.fromPalette({name:"surface_tint",palette:e=>e.primaryPalette,tone:e=>e.isDark?80:40,isBackground:!0});T.primary=A.fromPalette({name:"primary",palette:e=>e.primaryPalette,tone:e=>et(e)?e.isDark?100:0:e.isDark?80:40,isBackground:!0,background:e=>T.highestSurface(e),contrastCurve:new j(3,4.5,7,11),toneDeltaPair:e=>new Tt(T.primaryContainer,T.primary,15,"nearer",!1)});T.onPrimary=A.fromPalette({name:"on_primary",palette:e=>e.primaryPalette,tone:e=>et(e)?e.isDark?10:90:e.isDark?20:100,background:e=>T.primary,contrastCurve:new j(4.5,7,11,21)});T.primaryContainer=A.fromPalette({name:"primary_container",palette:e=>e.primaryPalette,tone:e=>re(e)?Je(e.sourceColorHct,e):et(e)?e.isDark?85:25:e.isDark?30:90,isBackground:!0,background:e=>T.highestSurface(e),contrastCurve:new j(1,1,3,7),toneDeltaPair:e=>new Tt(T.primaryContainer,T.primary,15,"nearer",!1)});T.onPrimaryContainer=A.fromPalette({name:"on_primary_container",palette:e=>e.primaryPalette,tone:e=>re(e)?A.foregroundTone(T.primaryContainer.tone(e),4.5):et(e)?e.isDark?0:100:e.isDark?90:10,background:e=>T.primaryContainer,contrastCurve:new j(4.5,7,11,21)});T.inversePrimary=A.fromPalette({name:"inverse_primary",palette:e=>e.primaryPalette,tone:e=>e.isDark?40:80,background:e=>T.inverseSurface,contrastCurve:new j(3,4.5,7,11)});T.secondary=A.fromPalette({name:"secondary",palette:e=>e.secondaryPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>T.highestSurface(e),contrastCurve:new j(3,4.5,7,11),toneDeltaPair:e=>new Tt(T.secondaryContainer,T.secondary,15,"nearer",!1)});T.onSecondary=A.fromPalette({name:"on_secondary",palette:e=>e.secondaryPalette,tone:e=>et(e)?e.isDark?10:100:e.isDark?20:100,background:e=>T.secondary,contrastCurve:new j(4.5,7,11,21)});T.secondaryContainer=A.fromPalette({name:"secondary_container",palette:e=>e.secondaryPalette,tone:e=>{const t=e.isDark?30:90;if(et(e))return e.isDark?30:85;if(!re(e))return t;let n=Lr(e.secondaryPalette.hue,e.secondaryPalette.chroma,t,!e.isDark);return n=Je(e.secondaryPalette.getHct(n),e),n},isBackground:!0,background:e=>T.highestSurface(e),contrastCurve:new j(1,1,3,7),toneDeltaPair:e=>new Tt(T.secondaryContainer,T.secondary,15,"nearer",!1)});T.onSecondaryContainer=A.fromPalette({name:"on_secondary_container",palette:e=>e.secondaryPalette,tone:e=>re(e)?A.foregroundTone(T.secondaryContainer.tone(e),4.5):e.isDark?90:10,background:e=>T.secondaryContainer,contrastCurve:new j(4.5,7,11,21)});T.tertiary=A.fromPalette({name:"tertiary",palette:e=>e.tertiaryPalette,tone:e=>et(e)?e.isDark?90:25:e.isDark?80:40,isBackground:!0,background:e=>T.highestSurface(e),contrastCurve:new j(3,4.5,7,11),toneDeltaPair:e=>new Tt(T.tertiaryContainer,T.tertiary,15,"nearer",!1)});T.onTertiary=A.fromPalette({name:"on_tertiary",palette:e=>e.tertiaryPalette,tone:e=>et(e)?e.isDark?10:90:e.isDark?20:100,background:e=>T.tertiary,contrastCurve:new j(4.5,7,11,21)});T.tertiaryContainer=A.fromPalette({name:"tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>{if(et(e))return e.isDark?60:49;if(!re(e))return e.isDark?30:90;const t=Je(e.tertiaryPalette.getHct(e.sourceColorHct.tone),e),n=e.tertiaryPalette.getHct(t);return qe.fixIfDisliked(n).tone},isBackground:!0,background:e=>T.highestSurface(e),contrastCurve:new j(1,1,3,7),toneDeltaPair:e=>new Tt(T.tertiaryContainer,T.tertiary,15,"nearer",!1)});T.onTertiaryContainer=A.fromPalette({name:"on_tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>et(e)?e.isDark?0:100:re(e)?A.foregroundTone(T.tertiaryContainer.tone(e),4.5):e.isDark?90:10,background:e=>T.tertiaryContainer,contrastCurve:new j(4.5,7,11,21)});T.error=A.fromPalette({name:"error",palette:e=>e.errorPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>T.highestSurface(e),contrastCurve:new j(3,4.5,7,11),toneDeltaPair:e=>new Tt(T.errorContainer,T.error,15,"nearer",!1)});T.onError=A.fromPalette({name:"on_error",palette:e=>e.errorPalette,tone:e=>e.isDark?20:100,background:e=>T.error,contrastCurve:new j(4.5,7,11,21)});T.errorContainer=A.fromPalette({name:"error_container",palette:e=>e.errorPalette,tone:e=>e.isDark?30:90,isBackground:!0,background:e=>T.highestSurface(e),contrastCurve:new j(1,1,3,7),toneDeltaPair:e=>new Tt(T.errorContainer,T.error,15,"nearer",!1)});T.onErrorContainer=A.fromPalette({name:"on_error_container",palette:e=>e.errorPalette,tone:e=>e.isDark?90:10,background:e=>T.errorContainer,contrastCurve:new j(4.5,7,11,21)});T.primaryFixed=A.fromPalette({name:"primary_fixed",palette:e=>e.primaryPalette,tone:e=>et(e)?40:90,isBackground:!0,background:e=>T.highestSurface(e),contrastCurve:new j(1,1,3,7),toneDeltaPair:e=>new Tt(T.primaryFixed,T.primaryFixedDim,10,"lighter",!0)});T.primaryFixedDim=A.fromPalette({name:"primary_fixed_dim",palette:e=>e.primaryPalette,tone:e=>et(e)?30:80,isBackground:!0,background:e=>T.highestSurface(e),contrastCurve:new j(1,1,3,7),toneDeltaPair:e=>new Tt(T.primaryFixed,T.primaryFixedDim,10,"lighter",!0)});T.onPrimaryFixed=A.fromPalette({name:"on_primary_fixed",palette:e=>e.primaryPalette,tone:e=>et(e)?100:10,background:e=>T.primaryFixedDim,secondBackground:e=>T.primaryFixed,contrastCurve:new j(4.5,7,11,21)});T.onPrimaryFixedVariant=A.fromPalette({name:"on_primary_fixed_variant",palette:e=>e.primaryPalette,tone:e=>et(e)?90:30,background:e=>T.primaryFixedDim,secondBackground:e=>T.primaryFixed,contrastCurve:new j(3,4.5,7,11)});T.secondaryFixed=A.fromPalette({name:"secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>et(e)?80:90,isBackground:!0,background:e=>T.highestSurface(e),contrastCurve:new j(1,1,3,7),toneDeltaPair:e=>new Tt(T.secondaryFixed,T.secondaryFixedDim,10,"lighter",!0)});T.secondaryFixedDim=A.fromPalette({name:"secondary_fixed_dim",palette:e=>e.secondaryPalette,tone:e=>et(e)?70:80,isBackground:!0,background:e=>T.highestSurface(e),contrastCurve:new j(1,1,3,7),toneDeltaPair:e=>new Tt(T.secondaryFixed,T.secondaryFixedDim,10,"lighter",!0)});T.onSecondaryFixed=A.fromPalette({name:"on_secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>10,background:e=>T.secondaryFixedDim,secondBackground:e=>T.secondaryFixed,contrastCurve:new j(4.5,7,11,21)});T.onSecondaryFixedVariant=A.fromPalette({name:"on_secondary_fixed_variant",palette:e=>e.secondaryPalette,tone:e=>et(e)?25:30,background:e=>T.secondaryFixedDim,secondBackground:e=>T.secondaryFixed,contrastCurve:new j(3,4.5,7,11)});T.tertiaryFixed=A.fromPalette({name:"tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>et(e)?40:90,isBackground:!0,background:e=>T.highestSurface(e),contrastCurve:new j(1,1,3,7),toneDeltaPair:e=>new Tt(T.tertiaryFixed,T.tertiaryFixedDim,10,"lighter",!0)});T.tertiaryFixedDim=A.fromPalette({name:"tertiary_fixed_dim",palette:e=>e.tertiaryPalette,tone:e=>et(e)?30:80,isBackground:!0,background:e=>T.highestSurface(e),contrastCurve:new j(1,1,3,7),toneDeltaPair:e=>new Tt(T.tertiaryFixed,T.tertiaryFixedDim,10,"lighter",!0)});T.onTertiaryFixed=A.fromPalette({name:"on_tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>et(e)?100:10,background:e=>T.tertiaryFixedDim,secondBackground:e=>T.tertiaryFixed,contrastCurve:new j(4.5,7,11,21)});T.onTertiaryFixedVariant=A.fromPalette({name:"on_tertiary_fixed_variant",palette:e=>e.tertiaryPalette,tone:e=>et(e)?90:30,background:e=>T.tertiaryFixedDim,secondBackground:e=>T.tertiaryFixed,contrastCurve:new j(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 ft{static fromInt(t){const n=st.fromInt(t);return ft.fromHct(n)}static fromHct(t){return new ft(t.hue,t.chroma,t)}static fromHueAndChroma(t,n){return new ft(t,n,ft.createKeyColor(t,n))}constructor(t,n,r){this.hue=t,this.chroma=n,this.keyColor=r,this.cache=new Map}static createKeyColor(t,n){let a=st.from(t,n,50),o=Math.abs(a.chroma-n);for(let s=1;s<50;s+=1){if(Math.round(n)===Math.round(a.chroma))return a;const c=st.from(t,n,50+s),l=Math.abs(c.chroma-n);l<o&&(o=l,a=c);const i=st.from(t,n,50-s),u=Math.abs(i.chroma-n);u<o&&(o=u,a=i)}return a}tone(t){let n=this.cache.get(t);return n===void 0&&(n=st.from(this.hue,this.chroma,t).toInt(),this.cache.set(t,n)),n}getHct(t){return st.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 it{static of(t){return new it(t,!1)}static contentOf(t){return new it(t,!0)}static fromColors(t){return it.createPaletteFromColors(!1,t)}static contentFromColors(t){return it.createPaletteFromColors(!0,t)}static createPaletteFromColors(t,n){const r=new it(n.primary,t);if(n.secondary){const a=new it(n.secondary,t);r.a2=a.a1}if(n.tertiary){const a=new it(n.tertiary,t);r.a3=a.a1}if(n.error){const a=new it(n.error,t);r.error=a.a1}if(n.neutral){const a=new it(n.neutral,t);r.n1=a.n1}if(n.neutralVariant){const a=new it(n.neutralVariant,t);r.n2=a.n2}return r}constructor(t,n){const r=st.fromInt(t),a=r.hue,o=r.chroma;n?(this.a1=ft.fromHueAndChroma(a,o),this.a2=ft.fromHueAndChroma(a,o/3),this.a3=ft.fromHueAndChroma(a+60,o/2),this.n1=ft.fromHueAndChroma(a,Math.min(o/12,4)),this.n2=ft.fromHueAndChroma(a,Math.min(o/6,8))):(this.a1=ft.fromHueAndChroma(a,Math.max(48,o)),this.a2=ft.fromHueAndChroma(a,16),this.a3=ft.fromHueAndChroma(a+60,24),this.n1=ft.fromHueAndChroma(a,4),this.n2=ft.fromHueAndChroma(a,8)),this.error=ft.fromHueAndChroma(25,84)}}/**
* @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 Ft{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 Ft.lightFromCorePalette(it.of(t))}static dark(t){return Ft.darkFromCorePalette(it.of(t))}static lightContent(t){return Ft.lightFromCorePalette(it.contentOf(t))}static darkContent(t){return Ft.darkFromCorePalette(it.contentOf(t))}static lightFromCorePalette(t){return new Ft({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 Ft({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)})}constructor(t){this.props=t}toJSON(){return{...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.
*/function Fn(e){const t=wn(e),n=Rn(e),r=Nn(e),a=[t.toString(16),n.toString(16),r.toString(16)];for(const[o,s]of a.entries())s.length===1&&(a[o]="0"+s);return"#"+a.join("")}function Dr(e){e=e.replace("#","");const t=e.length===3,n=e.length===6,r=e.length===8;if(!t&&!n&&!r)throw new Error("unexpected hex "+e);let a=0,o=0,s=0;return t?(a=St(e.slice(0,1).repeat(2)),o=St(e.slice(1,2).repeat(2)),s=St(e.slice(2,3).repeat(2))):n?(a=St(e.slice(0,2)),o=St(e.slice(2,4)),s=St(e.slice(4,6))):r&&(a=St(e.slice(2,4)),o=St(e.slice(4,6)),s=St(e.slice(6,8))),(255<<24|(a&255)<<16|(o&255)<<8|s&255)>>>0}function St(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 Ar(e,t=[]){const n=it.of(e);return{source:e,schemes:{light:Ft.light(e),dark:Ft.dark(e)},palettes:{primary:n.a1,secondary:n.a2,tertiary:n.a3,neutral:n.n1,neutralVariant:n.n2,error:n.error},customColors:t.map(r=>Or(e,r))}}function Or(e,t){let n=t.value;const r=n,a=e;t.blend&&(n=Xe.harmonize(r,a));const s=it.of(n).a1;return{color:t,value:n,light:{color:s.tone(40),onColor:s.tone(100),colorContainer:s.tone(90),onColorContainer:s.tone(10)},dark:{color:s.tone(80),onColor:s.tone(20),colorContainer:s.tone(30),onColorContainer:s.tone(90)}}}function Mr(e,t){const n=t?.target||document.body,a=t?.dark??!1?e.schemes.dark:e.schemes.light;if(Oe(n,a),t?.brightnessSuffix&&(Oe(n,e.schemes.dark,"-dark"),Oe(n,e.schemes.light,"-light")),t?.paletteTones){const o=t?.paletteTones??[];for(const[s,c]of Object.entries(e.palettes)){const l=s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();for(const i of o){const u=`--md-ref-palette-${l}-${l}${i}`,d=Fn(c.tone(i));n.style.setProperty(u,d)}}}}function Oe(e,t,n=""){for(const[r,a]of Object.entries(t.toJSON())){const o=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),s=Fn(a);e.style.setProperty(`--md-sys-color-${o}${n}`,s)}}const Bn=(e,t)=>{let n,r;const a=Pn(e,{interactive:!0,trigger:"click",onShow(o){r=o.popper.querySelector(".tippy-content"),r.classList.add("active"),n??=new t({target:r})},onHidden(){n?.$destroy(),r?.classList.remove("active"),n=void 0}});return{destroy(){a.destroy()}}};function wr(e,t="one"){const n={charaVersion:1,type:"layout",device:t,layout:[[],[],[]]};for(const r of e.split(`
`)){const[a,o,s]=r.substring(1).split(",").map(Number);n.layout[Number(a)-1][Number(o)]=Number(s)}return n}function Rr(e){return/^(A[123],\d+,\d+\n?)+$/.test(e)}function ge(e){const t=URL.createObjectURL(new Blob([JSON.stringify(e)],{type:"application/json"})),n=document.createElement("a");n.setAttribute("download",`${e.type}-${Nt(zt)?.device}-${new Date().toISOString()}.json`),n.href=t,n.setAttribute("target","_blank"),n.click(),URL.revokeObjectURL(t)}function Nr(){ge({charaVersion:1,type:"backup",history:[[Vn(),Un(),Wn()]]})}function Un(){return{charaVersion:1,type:"layout",device:Nt(zt)?.device,layout:Nt(He).map(e=>e.map(t=>t.action))}}function Vn(){return{charaVersion:1,type:"chords",chords:Nt(Mn).map(e=>[e.actions,e.phrase])}}function Wn(){return{charaVersion:1,type:"settings",settings:Nt(ze).map(e=>e.value)}}async function Sr(e){const t=e.target.files[0];if(!t)return;const n=await t.text();t.name.endsWith(".json")?Fe(JSON.parse(n)):Rr(n)&&Fe(wr(n))}function Fe(e){if(e.charaVersion!==1)throw new Error("Incompatible backup");switch(e.type){case"backup":{const t=e.history[0];if(t[1].device!==Nt(zt)?.device)throw new Error("Backup is incompatible with this device");Ot.update(n=>(n.push(...un(t[0]),...hn(t[1]),...fn(t[2])),n));break}case"chords":{Ot.update(t=>(t.push(...un()),t));break}case"layout":{Ot.update(t=>(t.push(...hn(e)),t));break}case"settings":{Ot.update(t=>(t.push(...fn(e)),t));break}default:throw new Error(`Unknown backup type "${e.type}"`)}}function un(e){return[]}function fn(e){const t=[];for(const[n,r]of e.settings.entries())Nt(ze)[n].value!==r&&t.push({type:$e.Setting,id:n,setting:r});return t}function hn(e){const t=[];for(const[n,r]of e.layout.entries())for(const[a,o]of r.entries())Nt(He)[n][a].action!==o&&t.push({type:$e.Layout,layer:n,id:a,action:o});return t}function Fr(e){let t,n,r,a,o=e[0].backup.TITLE()+"",s,c,l,i,u=e[0].backup.DISCLAIMER()+"",d,b,m,v,g=e[0].backup.INDIVIDUAL()+"",y,I,E,p,h="piano",f,D=e[0].configure.chords.TITLE()+"",O,w,N,$,Q="keyboard",H,U=e[0].configure.layout.TITLE()+"",x,J,z,Y,nt="settings",yt,dt=e[0].configure.settings.TITLE()+"",ht,wt,ut,mt,pt,Xt="save",At=e[0].backup.DOWNLOAD()+"",qt,ae,Rt,xt,Jt,Ke="settings_backup_restore",oe=e[0].backup.RESTORE()+"",fe,Pe,Ze;return{c(){t=L("section"),n=L("h2"),r=L("label"),a=L("input"),s=V(o),c=S(),l=L("p"),i=L("i"),d=V(u),b=S(),m=L("fieldset"),v=L("legend"),y=V(g),I=S(),E=L("button"),p=L("span"),p.textContent=h,f=S(),O=V(D),w=S(),N=L("button"),$=L("span"),$.textContent=Q,H=S(),x=V(U),J=S(),z=L("button"),Y=L("span"),Y.textContent=nt,yt=S(),ht=V(dt),wt=S(),ut=L("div"),mt=L("button"),pt=L("span"),pt.textContent=Xt,qt=V(At),ae=S(),Rt=L("label"),xt=L("input"),Jt=L("span"),Jt.textContent=Ke,fe=V(oe),this.h()},l(_t){t=P(_t,"SECTION",{class:!0});var rt=M(t);n=P(rt,"H2",{class:!0});var Qe=M(n);r=P(Qe,"LABEL",{class:!0});var De=M(r);a=P(De,"INPUT",{type:!0,class:!0}),s=W(De,o),De.forEach(k),Qe.forEach(k),c=F(rt),l=P(rt,"P",{class:!0});var xe=M(l);i=P(xe,"I",{});var tn=M(i);d=W(tn,u),tn.forEach(k),xe.forEach(k),b=F(rt),m=P(rt,"FIELDSET",{class:!0});var Gt=M(m);v=P(Gt,"LEGEND",{});var en=M(v);y=W(en,g),en.forEach(k),I=F(Gt),E=P(Gt,"BUTTON",{});var he=M(E);p=P(he,"SPAN",{class:!0,"data-svelte-h":!0}),lt(p)!=="svelte-wkbair"&&(p.textContent=h),f=F(he),O=W(he,D),he.forEach(k),w=F(Gt),N=P(Gt,"BUTTON",{});var de=M(N);$=P(de,"SPAN",{class:!0,"data-svelte-h":!0}),lt($)!=="svelte-1sytia5"&&($.textContent=Q),H=F(de),x=W(de,U),de.forEach(k),J=F(Gt),z=P(Gt,"BUTTON",{});var me=M(z);Y=P(me,"SPAN",{class:!0,"data-svelte-h":!0}),lt(Y)!=="svelte-k4cu01"&&(Y.textContent=nt),yt=F(me),ht=W(me,dt),me.forEach(k),Gt.forEach(k),wt=F(rt),ut=P(rt,"DIV",{class:!0});var pe=M(ut);mt=P(pe,"BUTTON",{class:!0});var Ae=M(mt);pt=P(Ae,"SPAN",{class:!0,"data-svelte-h":!0}),lt(pt)!=="svelte-1tcm1gh"&&(pt.textContent=Xt),qt=W(Ae,At),Ae.forEach(k),ae=F(pe),Rt=P(pe,"LABEL",{class:!0});var _e=M(Rt);xt=P(_e,"INPUT",{type:!0,class:!0}),Jt=P(_e,"SPAN",{class:!0,"data-svelte-h":!0}),lt(Jt)!=="svelte-1je4tbf"&&(Jt.textContent=Ke),fe=W(_e,oe),_e.forEach(k),pe.forEach(k),rt.forEach(k),this.h()},h(){C(a,"type","checkbox"),C(a,"class","svelte-1kun7u7"),C(r,"class","svelte-1kun7u7"),C(n,"class","svelte-1kun7u7"),C(l,"class","disclaimer svelte-1kun7u7"),C(p,"class","icon"),C($,"class","icon"),C(Y,"class","icon"),C(m,"class","svelte-1kun7u7"),C(pt,"class","icon"),C(mt,"class","primary"),C(xt,"type","file"),C(xt,"class","svelte-1kun7u7"),C(Jt,"class","icon"),C(Rt,"class","button"),C(ut,"class","save svelte-1kun7u7"),C(t,"class","svelte-1kun7u7")},m(_t,rt){R(_t,t,rt),_(t,n),_(n,r),_(r,a),_(r,s),_(t,c),_(t,l),_(l,i),_(i,d),_(t,b),_(t,m),_(m,v),_(v,y),_(m,I),_(m,E),_(E,p),_(E,f),_(E,O),_(m,w),_(m,N),_(N,$),_(N,H),_(N,x),_(m,J),_(m,z),_(z,Y),_(z,yt),_(z,ht),_(t,wt),_(t,ut),_(ut,mt),_(mt,pt),_(mt,qt),_(ut,ae),_(ut,Rt),_(Rt,xt),_(Rt,Jt),_(Rt,fe),Pe||(Ze=[ct(In.call(null,a,"backup")),K(E,"click",e[1]),K(N,"click",e[2]),K(z,"click",e[3]),K(mt,"click",Nr),K(xt,"input",Sr)],Pe=!0)},p(_t,[rt]){rt&1&&o!==(o=_t[0].backup.TITLE()+"")&&G(s,o),rt&1&&u!==(u=_t[0].backup.DISCLAIMER()+"")&&G(d,u),rt&1&&g!==(g=_t[0].backup.INDIVIDUAL()+"")&&G(y,g),rt&1&&D!==(D=_t[0].configure.chords.TITLE()+"")&&G(O,D),rt&1&&U!==(U=_t[0].configure.layout.TITLE()+"")&&G(x,U),rt&1&&dt!==(dt=_t[0].configure.settings.TITLE()+"")&&G(ht,dt),rt&1&&At!==(At=_t[0].backup.DOWNLOAD()+"")&&G(qt,At),rt&1&&oe!==(oe=_t[0].backup.RESTORE()+"")&&G(fe,oe)},i:tt,o:tt,d(_t){_t&&k(t),Pe=!1,Lt(Ze)}}}function Br(e,t,n){let r;return q(e,Ht,c=>n(0,r=c)),[r,()=>ge(Vn()),()=>ge(Un()),()=>ge(Wn())]}class Ur extends Pt{constructor(t){super(),Dt(this,t,Br,Fr,Ct,{})}}function dn(e){let t,n=e[3].company+"",r,a,o=e[3].device+"",s,c,l=e[3].chipset+"",i,u,d,b,m=e[3].version+"",v,g,y;return{c(){t=L("p"),r=V(n),a=S(),s=V(o),c=S(),i=V(l),u=S(),d=L("br"),b=V(`
Version `),v=V(m),this.h()},l(I){t=P(I,"P",{class:!0});var E=M(t);r=W(E,n),a=F(E),s=W(E,o),c=F(E),i=W(E,l),u=F(E),d=P(E,"BR",{}),b=W(E,`
Version `),v=W(E,m),E.forEach(k),this.h()},h(){C(t,"class","svelte-mp0aiu")},m(I,E){R(I,t,E),_(t,r),_(t,a),_(t,s),_(t,c),_(t,i),_(t,u),_(t,d),_(t,b),_(t,v),y=!0},p(I,E){(!y||E&8)&&n!==(n=I[3].company+"")&&G(r,n),(!y||E&8)&&o!==(o=I[3].device+"")&&G(s,o),(!y||E&8)&&l!==(l=I[3].chipset+"")&&G(i,l),(!y||E&8)&&m!==(m=I[3].version+"")&&G(v,m)},i(I){y||(I&&$t(()=>{y&&(g||(g=kt(t,ne,{},!0)),g.run(1))}),y=!0)},o(I){I&&(g||(g=kt(t,ne,{},!1)),g.run(0)),y=!1},d(I){I&&k(t),I&&g&&g.end()}}}function Vr(e){let t,n,r,a,o,s,c,l,i,u,d,b,m,v,g;function y(h,f){return h[3]?zr:Wr}let I=y(e),E=I(e),p=e[1]&&mn(e);return{c(){t=L("div"),E.c(),n=S(),r=L("div"),a=L("a"),o=V("terminal"),c=S(),l=L("button"),i=V("settings_power"),b=S(),p&&p.c(),m=vt(),this.h()},l(h){t=P(h,"DIV",{class:!0});var f=M(t);E.l(f),n=F(f),r=P(f,"DIV",{class:!0,style:!0});var D=M(r);a=P(D,"A",{href:!0,title:!0,class:!0});var O=M(a);o=W(O,"terminal"),O.forEach(k),c=F(D),l=P(D,"BUTTON",{class:!0,title:!0});var w=M(l);i=W(w,"settings_power"),w.forEach(k),D.forEach(k),f.forEach(k),b=F(h),p&&p.l(h),m=vt(),this.h()},h(){C(a,"href","/terminal"),C(a,"title",s=e[2].deviceManager.TERMINAL()),C(a,"class","icon"),ee(a,"disabled",e[3]===void 0),C(l,"class","icon svelte-mp0aiu"),C(l,"title",u=e[2].deviceManager.bootMenu.TITLE()),l.disabled=d=e[3]===void 0,C(r,"class","row svelte-mp0aiu"),Jn(r,"justify-content","flex-end"),C(t,"class","row svelte-mp0aiu")},m(h,f){R(h,t,f),E.m(t,null),_(t,n),_(t,r),_(r,a),_(a,o),_(r,c),_(r,l),_(l,i),R(h,b,f),p&&p.m(h,f),R(h,m,f),v||(g=[K(a,"click",e[6]),K(l,"click",e[7])],v=!0)},p(h,f){I===(I=y(h))&&E?E.p(h,f):(E.d(1),E=I(h),E&&(E.c(),E.m(t,n))),f&4&&s!==(s=h[2].deviceManager.TERMINAL())&&C(a,"title",s),f&8&&ee(a,"disabled",h[3]===void 0),f&4&&u!==(u=h[2].deviceManager.bootMenu.TITLE())&&C(l,"title",u),f&8&&d!==(d=h[3]===void 0)&&(l.disabled=d),h[1]?p?(p.p(h,f),f&2&&X(p,1)):(p=mn(h),p.c(),X(p,1),p.m(m.parentNode,m)):p&&(ce(),Z(p,1,1,()=>{p=null}),ue())},d(h){h&&(k(t),k(b),k(m)),E.d(),p&&p.d(h),v=!1,Lt(g)}}}function Wr(e){let t,n,r="usb",a=e[2].deviceManager.CONNECT()+"",o,s,c;return{c(){t=L("button"),n=L("span"),n.textContent=r,o=V(a),this.h()},l(l){t=P(l,"BUTTON",{class:!0});var i=M(t);n=P(i,"SPAN",{class:!0,"data-svelte-h":!0}),lt(n)!=="svelte-1d6v1js"&&(n.textContent=r),o=W(i,a),i.forEach(k),this.h()},h(){C(n,"class","icon"),C(t,"class","error svelte-mp0aiu")},m(l,i){R(l,t,i),_(t,n),_(t,o),s||(c=K(t,"click",e[5]),s=!0)},p(l,i){i&4&&a!==(a=l[2].deviceManager.CONNECT()+"")&&G(o,a)},d(l){l&&k(t),s=!1,c()}}}function zr(e){let t,n,r="usb_off",a=e[2].deviceManager.DISCONNECT()+"",o,s,c;return{c(){t=L("button"),n=L("span"),n.textContent=r,o=V(a),this.h()},l(l){t=P(l,"BUTTON",{class:!0});var i=M(t);n=P(i,"SPAN",{class:!0,"data-svelte-h":!0}),lt(n)!=="svelte-1kw21q"&&(n.textContent=r),o=W(i,a),i.forEach(k),this.h()},h(){C(n,"class","icon"),C(t,"class","secondary svelte-mp0aiu")},m(l,i){R(l,t,i),_(t,n),_(t,o),s||(c=K(t,"click",e[4]),s=!0)},p(l,i){i&4&&a!==(a=l[2].deviceManager.DISCONNECT()+"")&&G(o,a)},d(l){l&&k(t),s=!1,c()}}}function mn(e){let t,n,r,a,o,s=e[2].deviceManager.bootMenu.TITLE()+"",c,l,i,u,d="restart_alt",b=e[2].deviceManager.bootMenu.REBOOT()+"",m,v,g,y,I="rule_settings",E=e[2].deviceManager.bootMenu.BOOTLOADER()+"",p,h,f,D,O;return{c(){t=L("div"),r=S(),a=L("dialog"),o=L("h3"),c=V(s),l=S(),i=L("button"),u=L("span"),u.textContent=d,m=V(b),v=S(),g=L("button"),y=L("span"),y.textContent=I,p=V(E),this.h()},l(w){t=P(w,"DIV",{class:!0,role:!0,tabindex:!0}),M(t).forEach(k),r=F(w),a=P(w,"DIALOG",{class:!0});var N=M(a);o=P(N,"H3",{class:!0});var $=M(o);c=W($,s),$.forEach(k),l=F(N),i=P(N,"BUTTON",{class:!0});var Q=M(i);u=P(Q,"SPAN",{class:!0,"data-svelte-h":!0}),lt(u)!=="svelte-18cah9t"&&(u.textContent=d),m=W(Q,b),Q.forEach(k),v=F(N),g=P(N,"BUTTON",{class:!0});var H=M(g);y=P(H,"SPAN",{class:!0,"data-svelte-h":!0}),lt(y)!=="svelte-1hohlc4"&&(y.textContent=I),p=W(H,E),H.forEach(k),N.forEach(k),this.h()},h(){C(t,"class","backdrop svelte-mp0aiu"),C(t,"role","button"),C(t,"tabindex","-1"),C(o,"class","svelte-mp0aiu"),C(u,"class","icon"),C(i,"class","svelte-mp0aiu"),C(y,"class","icon"),C(g,"class","svelte-mp0aiu"),a.open=!0,C(a,"class","svelte-mp0aiu")},m(w,N){R(w,t,N),R(w,r,N),R(w,a,N),_(a,o),_(o,c),_(a,l),_(a,i),_(i,u),_(i,m),_(a,v),_(a,g),_(g,y),_(g,p),f=!0,D||(O=[K(t,"click",e[8]),K(t,"keypress",e[9]),K(i,"click",e[10]),K(g,"click",e[11])],D=!0)},p(w,N){(!f||N&4)&&s!==(s=w[2].deviceManager.bootMenu.TITLE()+"")&&G(c,s),(!f||N&4)&&b!==(b=w[2].deviceManager.bootMenu.REBOOT()+"")&&G(m,b),(!f||N&4)&&E!==(E=w[2].deviceManager.bootMenu.BOOTLOADER()+"")&&G(p,E)},i(w){f||(w&&$t(()=>{f&&(n||(n=kt(t,sn,{duration:250},!0)),n.run(1))}),w&&$t(()=>{f&&(h||(h=kt(a,ne,{duration:250},!0)),h.run(1))}),f=!0)},o(w){w&&(n||(n=kt(t,sn,{duration:250},!1)),n.run(0)),w&&(h||(h=kt(a,ne,{duration:250},!1)),h.run(0)),f=!1},d(w){w&&(k(t),k(r),k(a)),w&&n&&n.end(),w&&h&&h.end(),D=!1,Lt(O)}}}function $r(e){let t,n,r,a=e[2].deviceManager.TITLE()+"",o,s,c,l=e[2].deviceManager.AUTO_CONNECT()+"",i,u,d,b,m,v,g=e[3]&&dn(e),y=Vr(e);return{c(){t=L("section"),n=L("div"),r=L("h2"),o=V(a),s=S(),c=L("label"),i=V(l),u=L("input"),d=S(),g&&g.c(),b=S(),y&&y.c(),this.h()},l(I){t=P(I,"SECTION",{class:!0});var E=M(t);n=P(E,"DIV",{class:!0});var p=M(n);r=P(p,"H2",{class:!0});var h=M(r);o=W(h,a),h.forEach(k),s=F(p),c=P(p,"LABEL",{});var f=M(c);i=W(f,l),u=P(f,"INPUT",{type:!0}),f.forEach(k),p.forEach(k),d=F(E),g&&g.l(E),b=F(E),y&&y.l(E),E.forEach(k),this.h()},h(){C(r,"class","svelte-mp0aiu"),C(u,"type","checkbox"),C(n,"class","row svelte-mp0aiu"),C(t,"class","svelte-mp0aiu")},m(I,E){R(I,t,E),_(t,n),_(n,r),_(r,o),_(n,s),_(n,c),_(c,i),_(c,u),_(t,d),g&&g.m(t,null),_(t,b),y&&y.m(t,null),m||(v=ct(In.call(null,u,"autoConnect")),m=!0)},p(I,[E]){E&4&&a!==(a=I[2].deviceManager.TITLE()+"")&&G(o,a),E&4&&l!==(l=I[2].deviceManager.AUTO_CONNECT()+"")&&G(i,l),I[3]?g?(g.p(I,E),E&8&&X(g,1)):(g=dn(I),g.c(),X(g,1),g.m(t,b)):g&&(ce(),Z(g,1,1,()=>{g=null}),ue()),y.p(I,E)},i(I){X(g)},o(I){Z(g)},d(I){I&&k(t),g&&g.d(),y&&y.d(),m=!1,v()}}}function Hr(e,t,n){let r,a;q(e,Ht,g=>n(2,r=g)),q(e,zt,g=>n(3,a=g));let o=!1,s=!1;return[o,s,r,a,()=>{a?.forget(),bt(zt,a=void 0,a)},()=>vn(!0),()=>n(0,o=!o),()=>n(1,s=!s),()=>n(1,s=!s),g=>{g.key==="Enter"&&n(1,s=!s)},()=>{a?.reboot(),bt(zt,a=void 0,a)},()=>{a?.bootloader(),bt(zt,a=void 0,a)}]}class Gr extends Pt{constructor(t){super(),Dt(this,t,Hr,$r,Ct,{})}}function pn(e,t,n){const r=e.slice();return r[5]=t[n].href,r[6]=t[n].title,r[7]=t[n].icon,r[9]=n,r}function _n(e){let t,n,r=e[7]+"",a,o,s=e[6]+"",c,l,i,u,d;return{c(){t=L("a"),n=L("span"),a=V(r),o=S(),c=V(s),l=S(),this.h()},l(b){t=P(b,"A",{href:!0,class:!0});var m=M(t);n=P(m,"SPAN",{class:!0});var v=M(n);a=W(v,r),v.forEach(k),o=F(m),c=W(m,s),l=F(m),m.forEach(k),this.h()},h(){C(n,"class","icon"),C(t,"href",i=e[5]),C(t,"class","svelte-1hx2o0l"),ee(t,"active",e[1].url.pathname.startsWith(e[5]))},m(b,m){R(b,t,m),_(t,n),_(n,a),_(t,o),_(t,c),_(t,l),u||(d=ct(It.call(null,t,{shortcut:`shift+${e[9]+1}`})),u=!0)},p(b,m){e=b,m&1&&r!==(r=e[7]+"")&&G(a,r),m&1&&s!==(s=e[6]+"")&&G(c,s),m&1&&i!==(i=e[5])&&C(t,"href",i),m&3&&ee(t,"active",e[1].url.pathname.startsWith(e[5]))},d(b){b&&k(t),u=!1,d()}}}function jr(e){let t,n,r,a=we(e[0]),o=[];for(let l=0;l<a.length;l+=1)o[l]=_n(pn(e,a,l));const s=e[4].default,c=Ee(s,e,e[3],null);return{c(){t=L("nav");for(let l=0;l<o.length;l+=1)o[l].c();n=S(),c&&c.c(),this.h()},l(l){t=P(l,"NAV",{class:!0});var i=M(t);for(let u=0;u<o.length;u+=1)o[u].l(i);i.forEach(k),n=F(l),c&&c.l(l),this.h()},h(){C(t,"class","svelte-1hx2o0l")},m(l,i){R(l,t,i);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(t,null);R(l,n,i),c&&c.m(l,i),r=!0},p(l,[i]){if(i&3){a=we(l[0]);let u;for(u=0;u<a.length;u+=1){const d=pn(l,a,u);o[u]?o[u].p(d,i):(o[u]=_n(d),o[u].c(),o[u].m(t,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=a.length}c&&c.p&&(!r||i&8)&&Ie(c,s,l,l[3],r?Ce(s,l[3],i,null):ve(l[3]),null)},i(l){r||(X(c,l),r=!0)},o(l){Z(c,l),r=!1},d(l){l&&(k(t),k(n)),En(o,l),c&&c.d(l)}}}function Yr(e,t,n){let r,a,o;q(e,Ht,l=>n(2,a=l)),q(e,ir,l=>n(1,o=l));let{$$slots:s={},$$scope:c}=t;return e.$$set=l=>{"$$scope"in l&&n(3,c=l.$$scope)},e.$$.update=()=>{e.$$.dirty&4&&n(0,r=[{href:"/config/chords/",title:a.configure.chords.TITLE(),icon:"piano"},{href:"/config/layout/",title:a.configure.layout.TITLE(),icon:"keyboard"},{href:"/config/settings/",title:a.configure.settings.TITLE(),icon:"settings"}])},[r,o,a,c,s]}class Xr extends Pt{constructor(t){super(),Dt(this,t,Yr,jr,Ct,{})}}function qr(e){let t,n;const r=e[2].default,a=Ee(r,e,e[1],null);return{c(){t=L("dialog"),a&&a.c(),this.h()},l(o){t=P(o,"DIALOG",{class:!0});var s=M(t);a&&a.l(s),s.forEach(k),this.h()},h(){C(t,"class","svelte-1v51nso")},m(o,s){R(o,t,s),a&&a.m(t,null),e[3](t),n=!0},p(o,[s]){a&&a.p&&(!n||s&2)&&Ie(a,r,o,o[1],n?Ce(r,o[1],s,null):ve(o[1]),null)},i(o){n||(X(a,o),n=!0)},o(o){Z(a,o),n=!1},d(o){o&&k(t),a&&a.d(o),e[3](null)}}}function Jr(e,t,n){let{$$slots:r={},$$scope:a}=t;Ue(()=>{o.showModal()});let o;function s(c){Le[c?"unshift":"push"](()=>{o=c,n(0,o)})}return e.$$set=c=>{"$$scope"in c&&n(1,a=c.$$scope)},[o,a,r,s]}class Kr extends Pt{constructor(t){super(),Dt(this,t,Jr,qr,Ct,{})}}function gn(e){let t,n;return{c(){t=L("p"),n=new Ve(!1),this.h()},l(r){t=P(r,"P",{});var a=M(t);n=We(a,!1),a.forEach(k),this.h()},h(){n.a=null},m(r,a){R(r,t,a),n.m(e[1],t)},p(r,a){a&2&&n.p(r[1])},d(r){r&&k(t)}}}function Zr(e){let t,n,r,a,o,s,c,l,i,u,d,b,m=e[1]&&gn(e);return{c(){t=L("h1"),n=new Ve(!1),r=S(),m&&m.c(),a=S(),o=L("div"),s=L("button"),c=V(e[2]),l=S(),i=L("button"),u=V(e[3]),this.h()},l(v){t=P(v,"H1",{class:!0});var g=M(t);n=We(g,!1),g.forEach(k),r=F(v),m&&m.l(v),a=F(v),o=P(v,"DIV",{class:!0});var y=M(o);s=P(y,"BUTTON",{});var I=M(s);c=W(I,e[2]),I.forEach(k),l=F(y),i=P(y,"BUTTON",{class:!0});var E=M(i);u=W(E,e[3]),E.forEach(k),y.forEach(k),this.h()},h(){n.a=null,C(t,"class","svelte-8y6zrd"),C(i,"class","primary"),C(o,"class","buttons svelte-8y6zrd")},m(v,g){R(v,t,g),n.m(e[0],t),R(v,r,g),m&&m.m(v,g),R(v,a,g),R(v,o,g),_(o,s),_(s,c),_(o,l),_(o,i),_(i,u),d||(b=[K(s,"click",e[5]),K(i,"click",e[6])],d=!0)},p(v,g){g&1&&n.p(v[0]),v[1]?m?m.p(v,g):(m=gn(v),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null),g&4&&G(c,v[2]),g&8&&G(u,v[3])},d(v){v&&(k(t),k(r),k(a),k(o)),m&&m.d(v),d=!1,Lt(b)}}}function Qr(e){let t,n;return t=new Kr({props:{$$slots:{default:[Zr]},$$scope:{ctx:e}}}),{c(){Bt(t.$$.fragment)},l(r){Ut(t.$$.fragment,r)},m(r,a){Vt(t,r,a),n=!0},p(r,[a]){const o={};a&143&&(o.$$scope={dirty:a,ctx:r}),t.$set(o)},i(r){n||(X(t.$$.fragment,r),n=!0)},o(r){Z(t.$$.fragment,r),n=!1},d(r){Wt(t,r)}}}function xr(e,t,n){let{title:r}=t,{message:a}=t,{abortTitle:o}=t,{confirmTitle:s}=t;const c=Kn(),l=()=>c("abort"),i=()=>c("confirm");return e.$$set=u=>{"title"in u&&n(0,r=u.title),"message"in u&&n(1,a=u.message),"abortTitle"in u&&n(2,o=u.abortTitle),"confirmTitle"in u&&n(3,s=u.confirmTitle)},[r,a,o,s,c,l,i]}class ta extends Pt{constructor(t){super(),Dt(this,t,xr,Qr,Ct,{title:0,message:1,abortTitle:2,confirmTitle:3})}}async function ea(e,t,n,r){const a=new ta({target:document.body,props:{title:e,message:t,confirmTitle:n,abortTitle:r}});let o;const s=new Promise(l=>{o=l});a.$on("abort",()=>o(!1)),a.$on("confirm",()=>o(!0));const c=await s;return a.$destroy(),c}function bn(e){let t,n,r="bolt",a=e[2].saveActions.APPLY()+"",o,s,c,l,i,u;return{c(){t=L("button"),n=L("span"),n.textContent=r,o=V(a),this.h()},l(d){t=P(d,"BUTTON",{class:!0});var b=M(t);n=P(b,"SPAN",{class:!0,"data-svelte-h":!0}),lt(n)!=="svelte-26p827"&&(n.textContent=r),o=W(b,a),b.forEach(k),this.h()},h(){C(n,"class","icon"),C(t,"class","click-me svelte-13796cg")},m(d,b){R(d,t,b),_(t,n),_(t,o),l=!0,i||(u=[K(t,"click",e[5]),ct(s=It.call(null,t,{title:e[2].changes.TITLE(),shortcut:"ctrl+s"}))],i=!0)},p(d,b){(!l||b&4)&&a!==(a=d[2].saveActions.APPLY()+"")&&G(o,a),s&&Et(s.update)&&b&4&&s.update.call(null,{title:d[2].changes.TITLE(),shortcut:"ctrl+s"})},i(d){l||(d&&$t(()=>{l&&(c||(c=kt(t,jt,{x:8},!0)),c.run(1))}),l=!0)},o(d){d&&(c||(c=kt(t,jt,{x:8},!1)),c.run(0)),l=!1},d(d){d&&k(t),d&&c&&c.end(),i=!1,Lt(u)}}}function na(e){let t,n,r,a,o,s,c,l,i,u,d,b,m,v="save",g,y,I,E,p,h=e[1].length!==0&&bn(e);return{c(){t=L("button"),n=V("undo"),o=S(),s=L("button"),c=V("redo"),u=S(),d=L("div"),b=S(),m=L("button"),m.textContent=v,y=S(),h&&h.c(),I=vt(),this.h()},l(f){t=P(f,"BUTTON",{class:!0});var D=M(t);n=W(D,"undo"),D.forEach(k),o=F(f),s=P(f,"BUTTON",{class:!0});var O=M(s);c=W(O,"redo"),O.forEach(k),u=F(f),d=P(f,"DIV",{class:!0}),M(d).forEach(k),b=F(f),m=P(f,"BUTTON",{class:!0,"data-svelte-h":!0}),lt(m)!=="svelte-8sije8"&&(m.textContent=v),y=F(f),h&&h.l(f),I=vt(),this.h()},h(){C(t,"class","icon"),t.disabled=r=e[1].length===0,C(s,"class","icon"),s.disabled=l=e[0].length===0,C(d,"class","separator svelte-13796cg"),C(m,"class","icon")},m(f,D){R(f,t,D),_(t,n),R(f,o,D),R(f,s,D),_(s,c),R(f,u,D),R(f,d,D),R(f,b,D),R(f,m,D),R(f,y,D),h&&h.m(f,D),R(f,I,D),E||(p=[ct(a=It.call(null,t,{title:e[2].saveActions.UNDO(),shortcut:"ctrl+z"})),K(t,"click",e[3]),ct(i=It.call(null,s,{title:e[2].saveActions.REDO(),shortcut:"ctrl+y"})),K(s,"click",e[4]),ct(g=It.call(null,m,{title:e[2].saveActions.SAVE(),shortcut:"ctrl+shift+s"})),K(m,"click",e[6])],E=!0)},p(f,[D]){D&2&&r!==(r=f[1].length===0)&&(t.disabled=r),a&&Et(a.update)&&D&4&&a.update.call(null,{title:f[2].saveActions.UNDO(),shortcut:"ctrl+z"}),D&1&&l!==(l=f[0].length===0)&&(s.disabled=l),i&&Et(i.update)&&D&4&&i.update.call(null,{title:f[2].saveActions.REDO(),shortcut:"ctrl+y"}),g&&Et(g.update)&&D&4&&g.update.call(null,{title:f[2].saveActions.SAVE(),shortcut:"ctrl+shift+s"}),f[1].length!==0?h?(h.p(f,D),D&2&&X(h,1)):(h=bn(f),h.c(),X(h,1),h.m(I.parentNode,I)):h&&(ce(),Z(h,1,1,()=>{h=null}),ue())},i(f){X(h)},o(f){Z(h)},d(f){f&&(k(t),k(o),k(s),k(u),k(d),k(b),k(m),k(y),k(I)),h&&h.d(f),E=!1,Lt(p)}}}function ra(e,t,n){let r,a,o,s,c,l,i,u,d,b,m;q(e,Zt,p=>n(7,r=p)),q(e,Ot,p=>n(1,a=p)),q(e,zt,p=>n(8,o=p)),q(e,ze,p=>n(9,s=p)),q(e,rn,p=>n(10,c=p)),q(e,Mn,p=>n(11,l=p)),q(e,an,p=>n(12,i=p)),q(e,He,p=>n(13,u=p)),q(e,on,p=>n(14,d=p)),q(e,lr,p=>n(15,b=p)),q(e,Ht,p=>n(2,m=p));function v(p){p.shiftKey?Ot.set([]):(n(0,y=[a.pop(),...y]),Ot.update(h=>h))}function g(){const[p,...h]=y;Ot.update(f=>(f.push(p),f)),n(0,y=h)}let y=[];async function I(){const p=o;if(p){bt(Zt,r="uploading",r);for(const[h,{actions:f,phrase:D}]of b.chords)if(D.length>0){if(h!==JSON.stringify(f)){if(await p.getChordPhrase(f)!==void 0&&!await ea(m.configure.chords.conflict.TITLE(),m.configure.chords.conflict.DESCRIPTION(f.map(w=>`<kbd>${cr[w].id}</kbd>`).join(" ")),m.configure.chords.conflict.CONFIRM(),m.configure.chords.conflict.ABORT())){Ot.update(w=>w.filter(N=>!(N.type===$e.Chord&&JSON.stringify(N.id)===h)));continue}await p.deleteChord({actions:JSON.parse(h)})}await p.setChord({actions:f,phrase:D})}else await p.deleteChord({actions:f});for(const[h,f]of b.layout.entries())for(const[D,O]of f)await p.setLayoutKey(h+1,D,O);for(const[h,f]of b.settings)await p.setSetting(h,f);bt(on,d=u.map(h=>h.map(({action:f})=>f)),d),bt(an,i=l.map(({actions:h,phrase:f})=>({actions:h,phrase:f})).filter(({phrase:h})=>h.length>1),i),bt(rn,c=s.map(({value:h})=>h),c),bt(Ot,a=[],a),bt(Zt,r="done",r)}}async function E(){bt(Zt,r="uploading",r);const p=6e3,h=performance.now();await new Promise(f=>{function D(){const O=performance.now()-h;Cn.set({max:p,current:O}),O>=p?f():requestAnimationFrame(D)}requestAnimationFrame(D)}),o&&(await o.commit(),bt(Ot,a=[],a)),bt(Zt,r="done",r)}return[y,a,m,v,g,I,E]}class aa extends Pt{constructor(t){super(),Dt(this,t,ra,na,Ct,{})}}function oa(e){e[8]=e[9].default}function kn(e){let t,n="share",r,a,o,s,c="print",l,i,u,d,b,m,v,g;return{c(){t=L("button"),t.textContent=n,o=S(),s=L("button"),s.textContent=c,u=S(),d=L("div"),this.h()},l(y){t=P(y,"BUTTON",{class:!0,"data-svelte-h":!0}),lt(t)!=="svelte-1n97s3u"&&(t.textContent=n),o=F(y),s=P(y,"BUTTON",{class:!0,"data-svelte-h":!0}),lt(s)!=="svelte-1qaz7dv"&&(s.textContent=c),u=F(y),d=P(y,"DIV",{class:!0}),M(d).forEach(k),this.h()},h(){C(t,"class","icon svelte-f5owx0"),C(s,"class","icon svelte-f5owx0"),C(d,"class","separator svelte-f5owx0")},m(y,I){R(y,t,I),R(y,o,I),R(y,s,I),R(y,u,I),R(y,d,I),m=!0,v||(g=[ct(r=It.call(null,t,{title:e[3].share.TITLE()})),K(t,"click",Yn),ct(l=It.call(null,s,{title:e[3].print.TITLE()})),K(s,"click",e[6])],v=!0)},p(y,I){r&&Et(r.update)&&I&8&&r.update.call(null,{title:y[3].share.TITLE()}),l&&Et(l.update)&&I&8&&l.update.call(null,{title:y[3].print.TITLE()})},i(y){m||(y&&$t(()=>{m&&(a||(a=kt(t,jt,{x:-8},!0)),a.run(1))}),y&&$t(()=>{m&&(i||(i=kt(s,jt,{x:-8},!0)),i.run(1))}),y&&$t(()=>{m&&(b||(b=kt(d,ne,{},!0)),b.run(1))}),m=!0)},o(y){y&&(a||(a=kt(t,jt,{x:-8},!1)),a.run(0)),y&&(i||(i=kt(s,jt,{x:-8},!1)),i.run(0)),y&&(b||(b=kt(d,ne,{},!1)),b.run(0)),m=!1},d(y){y&&(k(t),k(o),k(s),k(u),k(d)),y&&a&&a.end(),y&&i&&i.end(),y&&b&&b.end(),v=!1,Lt(g)}}}function sa(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:ca,then:ia,catch:la,value:9,blocks:[,,,]};return Xn(ke(()=>import("../chunks/PwaStatus.05ed2454.js"),["../chunks/PwaStatus.05ed2454.js","../chunks/scheduler.f5cfe514.js","../chunks/index.c2fc59c9.js","../chunks/preload-helper.a4192956.js","../chunks/index.c76aaf45.js","../assets/PwaStatus.ae828e08.css"],import.meta.url),r),{c(){t=vt(),r.block.c()},l(a){t=vt(),r.block.l(a)},m(a, o){R(a,t,o),r.block.m(a,r.anchor=o),r.mount=()=>t.parentNode,r.anchor=t,n=!0},p(a, o){e=a},i(a){n||(X(r.block),n=!0)},o(a){for(let o=0; o<3; o+=1){const s=r.blocks[o];Z(s)}n=!1},d(a){a&&k(t),r.block.d(a),r.token=null,r=null}}}function la(e){return{c:tt,l:tt,m:tt,i:tt,o:tt,d:tt}}function ia(e){oa(e);let t,n;return t=new e[8]({}),{c(){Bt(t.$$.fragment)},l(r){Ut(t.$$.fragment,r)},m(r, a){Vt(t,r,a),n=!0},i(r){n||(X(t.$$.fragment,r),n=!0)},o(r){Z(t.$$.fragment,r),n=!1},d(r){Wt(t,r)}}}function ca(e){return{c:tt,l:tt,m:tt,i:tt,o:tt,d:tt}}function Tn(e){let t,n,r,a,o;function s(i, u){return i[1].backup?fa:ua}let c=s(e),l=c(e);return{c(){t=L("button"),l.c(),this.h()},l(i){t=P(i,"BUTTON",{class:!0});var u=M(t);l.l(u),u.forEach(k),this.h()},h(){C(t,"class",n="icon "+e[5]+" svelte-f5owx0")},m(i, u){R(i,t,u),l.m(t,null),a||(o=[ct(r=It.call(null,t,{title:e[3].backup.TITLE()})),ct(Bn.call(null,t,Ur))],a=!0)},p(i, u){c!==(c=s(i))&&(l.d(1),l=c(i),l&&(l.c(),l.m(t,null))),u&32&&n!==(n="icon "+i[5]+" svelte-f5owx0")&&C(t,"class",n),r&&Et(r.update)&&u&8&&r.update.call(null,{title:i[3].backup.TITLE()})},d(i){i&&k(t),l.d(),a=!1,Lt(o)}}}function ua(e){let t;return{c(){t=V("history_toggle_off")},l(n){t=W(n,"history_toggle_off")},m(n, r){R(n,t,r)},d(n){n&&k(t)}}}function fa(e){let t;return{c(){t=V("history")},l(n){t=W(n,"history")},m(n, r){R(n,t,r)},d(n){n&&k(t)}}}function ha(e){let t,n,r,a,o,s,c,l,i,u,d,b="cable",m,v,g,y;r=new aa({}),o=new Xr({});let I=e[2]&&kn(e),E={}.TAURI_FAMILY===void 0&&sa(e),p=e[4]&&Tn(e);return{c(){t=L("nav"),n=L("div"),Bt(r.$$.fragment),a=S(),Bt(o.$$.fragment),s=S(),c=L("div"),I&&I.c(),l=S(),E&&E.c(),i=S(),p&&p.c(),u=S(),d=L("button"),d.textContent=b,this.h()},l(h){t=P(h,"NAV",{class:!0});var f=M(t);n=P(f,"DIV",{class:!0});var D=M(n);Ut(r.$$.fragment,D),D.forEach(k),a=F(f),Ut(o.$$.fragment,f),s=F(f),c=P(f,"DIV",{class:!0});var O=M(c);I&&I.l(O),l=F(O),E&&E.l(O),i=F(O),p&&p.l(O),u=F(O),d=P(O,"BUTTON",{class:!0,"data-svelte-h":!0}),lt(d)!=="svelte-1v2t87w"&&(d.textContent=b),O.forEach(k),f.forEach(k),this.h()},h(){C(n,"class","actions svelte-f5owx0"),C(d,"class","icon connect svelte-f5owx0"),ee(d,"error",e[4]===void 0),C(c,"class","actions svelte-f5owx0"),C(t,"class","svelte-f5owx0")},m(h, f){R(h,t,f),_(t,n),Vt(r,n,null),_(t,a),Vt(o,t,null),_(t,s),_(t,c),I&&I.m(c,null),_(c,l),E&&E.m(c,null),_(c,i),p&&p.m(c,null),_(c,u),_(c,d),e[7](d),v=!0,g||(y=[ct(m=It.call(null,d,{title:e[3].deviceManager.TITLE()})),ct(Bn.call(null,d,Gr))],g=!0)},p(h, [f]){h[2]?I?(I.p(h,f),f&4&&X(I,1)):(I=kn(h),I.c(),X(I,1),I.m(c,l)):I&&(ce(),Z(I,1,1,()=>{I=null}),ue()),h[4]?p?p.p(h,f):(p=Tn(h),p.c(),p.m(c,u)):p&&(p.d(1),p=null),m&&Et(m.update)&&f&8&&m.update.call(null,{title:h[3].deviceManager.TITLE()}),(!v||f&16)&&ee(d,"error",h[4]===void 0)},i(h){v||(X(r.$$.fragment,h),X(o.$$.fragment,h),X(I),X(E),v=!0)},o(h){Z(r.$$.fragment,h),Z(o.$$.fragment,h),Z(I),Z(E),v=!1},d(h){h&&k(t),Wt(r),Wt(o),I&&I.d(),E&&E.d(),p&&p.d(),e[7](null),g=!1,Lt(y)}}}function da(e, t, n){let r,a,o,s,c;q(e,Ln, d=>n(1,r=d)),q(e,jn, d=>n(2,a=d)),q(e,Ht, d=>n(3,o=d)),q(e,zt, d=>n(4,s=d)),q(e,Zt, d=>n(5,c=d)),Ue(async()=>{r.autoConnect||l.click()});let l;const i=()=>print();function u(d){Le[d?"unshift":"push"](()=>{l=d,n(0,l)})}return[l,r,a,o,s,c,i,u]}class ma extends Pt{constructor(t){super(),Dt(this,t,da,ha,Ct,{})}}function pa(e){let t,n,r=e[0].browserWarning.TITLE()+"",a,o,s,c=e[0].browserWarning.INFO_SERIAL_PREFIX()+"",l,i,u=e[0].browserWarning.INFO_SERIAL_INFIX()+"",d,b=e[0].browserWarning.INFO_SERIAL_SUFFIX()+"",m,v,g=e[0].browserWarning.INFO_BROWSER_PREFIX()+"",y,I,E,p=e[0].browserWarning.INFO_BROWSER_INFIX()+"",h,f=e[0].browserWarning.INFO_BROWSER_SUFFIX()+"",D,O,w,N,$=e[0].browserWarning.DOWNLOAD_APP()+"",Q;return{c(){t=L("dialog"),n=L("h1"),a=V(r),o=S(),s=L("p"),l=V(c),i=L("a"),d=V(u),m=V(b),v=S(),y=V(g),I=S(),E=L("a"),h=V(p),D=V(f),O=S(),w=L("div"),N=L("a"),Q=V($),this.h()},l(H){t=P(H,"DIALOG",{class:!0});var U=M(t);n=P(U,"H1",{class:!0});var x=M(n);a=W(x,r),x.forEach(k),o=F(U),s=P(U,"P",{class:!0});var J=M(s);l=W(J,c),i=P(J,"A",{class:!0,target:!0,href:!0});var z=M(i);d=W(z,u),z.forEach(k),m=W(J,b),v=F(J),y=W(J,g),I=F(J),E=P(J,"A",{href:!0,target:!0,class:!0});var Y=M(E);h=W(Y,p),Y.forEach(k),D=W(J,f),J.forEach(k),O=F(U),w=P(U,"DIV",{class:!0});var nt=M(w);N=P(nt,"A",{href:!0,target:!0,class:!0});var yt=M(N);Q=W(yt,$),yt.forEach(k),nt.forEach(k),U.forEach(k),this.h()},h(){C(n,"class","svelte-6mulel"),C(i,"class","normal svelte-6mulel"),C(i,"target","_blank"),C(i,"href","https://developer.mozilla.org/en-US/docs/Web/API/Web_Serial_API#browser_compatibility"),C(E,"href","https://github.com/brave/brave-browser/issues/13902"),C(E,"target","_blank"),C(E,"class","svelte-6mulel"),C(s,"class","svelte-6mulel"),C(N,"href","https://github.com/Theaninova/dotio/releases"),C(N,"target","_blank"),C(N,"class","svelte-6mulel"),C(w,"class","svelte-6mulel"),t.open=!0,C(t,"class","svelte-6mulel")},m(H, U){R(H,t,U),_(t,n),_(n,a),_(t,o),_(t,s),_(s,l),_(s,i),_(i,d),_(s,m),_(s,v),_(s,y),_(s,I),_(s,E),_(E,h),_(s,D),_(t,O),_(t,w),_(w,N),_(N,Q)},p(H, [U]){U&1&&r!==(r=H[0].browserWarning.TITLE()+"")&&G(a,r),U&1&&c!==(c=H[0].browserWarning.INFO_SERIAL_PREFIX()+"")&&G(l,c),U&1&&u!==(u=H[0].browserWarning.INFO_SERIAL_INFIX()+"")&&G(d,u),U&1&&b!==(b=H[0].browserWarning.INFO_SERIAL_SUFFIX()+"")&&G(m,b),U&1&&g!==(g=H[0].browserWarning.INFO_BROWSER_PREFIX()+"")&&G(y,g),U&1&&p!==(p=H[0].browserWarning.INFO_BROWSER_INFIX()+"")&&G(h,p),U&1&&f!==(f=H[0].browserWarning.INFO_BROWSER_SUFFIX()+"")&&G(D,f),U&1&&$!==($=H[0].browserWarning.DOWNLOAD_APP()+"")&&G(Q,$)},i:tt,o:tt,d(H){H&&k(t)}}}function _a(e, t, n){let r;return q(e,Ht, a=>n(0,r=a)),[r]}class ga extends Pt{constructor(t){super(),Dt(this,t,_a,pa,Ct,{})}}const zn= e=>({}),$n={TITLE:"CharaChorder Gerätemanager",DESCRIPTION:"Gerätemanager und Konfigurationstool für CharaChorder Geräte.",saveActions:{UNDO:"Rückgängig (<kbd class='icon'>shift</kbd> halten um alle Änderungen rückgängig zu machen)",REDO:"Wiederholen",APPLY:"Anwenden",SAVE:"Änderungen auf das Gerät schreiben"},sync:{TITLE_READ:"Neueste Änderungen werden abgerufen",TITLE_WRITE:"Änderungen werden gebrannt",DISCLAIMER_WRITE:"Das Brennen von Änderungen ist nur für Layouts und Einstellungen erforderlich wenn diese Neustarts überdauern sollen. Bei Akkorden passiert das brennen automatisch beim anwenden."},backup:{TITLE:"Sicherungskopie",INDIVIDUAL:"Einzeldateien",DISCLAIMER:"Sicherungskopien verlassen unter keinen Umständen diesen Computer und werden nie mit uns geteilt oder auf Server hochgeladen.",DOWNLOAD:"Vollständig Speichern",RESTORE:"Wiederherstellen"},modal:{CLOSE:"Schließen"},actionSearch:{PLACEHOLDER:"Nach Aktionen suchen",CURRENT_ACTION:"Aktuelle Aktion",DELETE:"Entfernen",filter:{ALL:"Alle"}},share:{TITLE:"Teilen",URL_COPIED:"Teilbare URL kopiert!",EXTRA_DOWNLOAD:"Als Datei herunterladen"},print:{TITLE:"Drucken"},profile:{TITLE:"Profil",LANGUAGE:"Sprache",theme:{TITLE:"Darstellung",COLOR_SCHEME:"Farbschema",DARK_MODE:"Dunkel",LIGHT_MODE:"Hell"}},deviceManager:{TITLE:"Gerät",AUTO_CONNECT:"Automatisch Verbinden",CONNECT:"Verbinden",DISCONNECT:"Entfernen",TERMINAL:"Konsole",APPLY_SETTINGS:"Änderungen auf das Gerät brennen",bootMenu:{TITLE:"Bootmenü",REBOOT:"Neustarten",BOOTLOADER:"Bootloader"}},browserWarning:{TITLE:"Warnung",INFO_SERIAL_PREFIX:"Der aktuell genutzte Browser wird aufgrund der speziellen Voraussetzung für Kommunikation über die ",INFO_SERIAL_INFIX:"serielle Schnittstelle",INFO_SERIAL_SUFFIX:" nicht unterstützt.",INFO_BROWSER_PREFIX:"Auch wenn alle Chromium-basieren Desktop Browser diese Voraussetzung grundsätzlich erfüllen, haben einige Browser ",INFO_BROWSER_INFIX:"wie zum Beispiel Brave",INFO_BROWSER_SUFFIX:" sich bewusst dazu entschieden die API zu deaktivieren.",DOWNLOAD_APP:"Desktop-app herunterladen"},changes:{TITLE:"Änderungen importieren",ALL_CHANGES:"Alle Änderungen",layout:{TITLE:"{0} veränderte Belegung{{:|en}}",LAYER:"{changes} Belegung{{changes:|en}} in Ebene {layer} ändern"},settings:{TITLE:"{0} Einstellung{{|en}} anpassen"},chords:{TITLE:"{0} Akkorde",NEW_CHORDS:"{0} neue Akkord{{|e}} hinzufügen",CHANGED_CHORDS:"{0} Akkord{{|e}} ersetzen",DELETED_CHORDS:"{0} Akkord{{|e}} zum löschen markieren"}},configure:{chords:{TITLE:"Akkorde",HOLD_KEYS:"Akkord halten",NEW_CHORD:"Neuer Akkord",search:{PLACEHOLDER:"{0} Akkord{{|e}} durchsuchen"},conflict:{TITLE:"Akkordkonflikt",DESCRIPTION:"Der Akkord {0} würde einen bereits existierenden Akkord überschreiben. Wirklich fortfahren?",CONFIRM:"Überschreiben",ABORT:"Überspringen"}},layout:{TITLE:"Layout"},settings:{TITLE:"Einstellungen"}},plugin:{editor:{RUN:"Ausführen"}}},ba=Object.freeze(Object.defineProperty({__proto__:null,default:$n},Symbol.toStringTag,{value:"Module"})),Hn={TITLE:"CharaChorder Device Manager",DESCRIPTION:"The device manager and configuration tool for CharaChorder devices.",saveActions:{UNDO:"Undo (hold <kbd class='icon'>shift</kbd> to undo all changes)",REDO:"Redo",APPLY:"Apply",SAVE:"Burn changes to your device"},backup:{TITLE:"Local Backup",INDIVIDUAL:"Individual backups",DISCLAIMER:"Backups remain on your computer and are never shared with us or uploaded to our servers.",DOWNLOAD:"Full Backup",RESTORE:"Restore"},sync:{TITLE_READ:"Reading latest changes",TITLE_WRITE:"Burning changes to device",DISCLAIMER_WRITE:"Burning is only necessary if you want your layout or settings to persist across reboots. Chords always persist automatically on apply."},modal:{CLOSE:"Close"},actionSearch:{PLACEHOLDER:"Search for actions",CURRENT_ACTION:"Current action",DELETE:"Remove",filter:{ALL:"All"}},share:{TITLE:"Share",URL_COPIED:"Sharable URL copied!",EXTRA_DOWNLOAD:"Download as file"},print:{TITLE:"Print"},profile:{TITLE:"Profile",LANGUAGE:"Language",theme:{TITLE:"Theme",COLOR_SCHEME:"Color scheme",DARK_MODE:"Dark",LIGHT_MODE:"Light"}},deviceManager:{TITLE:"Device",AUTO_CONNECT:"Auto-connect",CONNECT:"Connect",DISCONNECT:"Disconnect",TERMINAL:"Terminal",APPLY_SETTINGS:"Flash changes to device",bootMenu:{TITLE:"Boot Menu",REBOOT:"Reboot",BOOTLOADER:"Bootloader"}},browserWarning:{TITLE:"Warning",INFO_SERIAL_PREFIX:"Your current browser is not supported due to this site's unique requirement for ",INFO_SERIAL_INFIX:"serial connections",INFO_SERIAL_SUFFIX:".",INFO_BROWSER_PREFIX:"Though all chromium-based desktop browsers fulfill this requirement, some derivations such as Brave ",INFO_BROWSER_INFIX:"have been known to disable the API intentionally",INFO_BROWSER_SUFFIX:".",DOWNLOAD_APP:"Download the desktop app"},changes:{TITLE:"Import changes",ALL_CHANGES:"All changes",layout:{TITLE:"{0} layout change{{|s}}",LAYER:"Update {changes} key{{changes:|s}} in layer {layer}"},settings:{TITLE:"Update {0} setting{{|s}}"},chords:{TITLE:"{0} chords",NEW_CHORDS:"Add {0} new chord{{|s}}",CHANGED_CHORDS:"Replace {0} chord{{|s}}",DELETED_CHORDS:"Mark {0} chord{{|s}} for deletion"}},configure:{chords:{TITLE:"Chords",HOLD_KEYS:"Hold chord",NEW_CHORD:"New chord",search:{PLACEHOLDER:"Search {0} chord{{|s}}"},conflict:{TITLE:"Chord conflict",DESCRIPTION:"Your chord {0} conflicts with an existing chord. Are you sure you want to overwrite this chord?",CONFIRM:"Overwrite",ABORT:"Skip"}},layout:{TITLE:"Layout"},settings:{TITLE:"Settings"}},plugin:{editor:{RUN:"Run"}}},ka=Object.freeze(Object.defineProperty({__proto__:null,default:Hn},Symbol.toStringTag,{value:"Module"})),Ta={de:$n,en:Hn},ya= e=>{Te[e]||(Te[e]=Ta[e],Ea(e))},Ea= e=>void(Dn[e]=zn()),Ia={de:()=>ke(()=>Promise.resolve().then(()=>ba),void 0,import.meta.url),en:()=>ke(()=>Promise.resolve().then(()=>ka),void 0,import.meta.url)},va=(e, t)=>Te[e]={...Te[e],...t},Ca=async e=>(await Ia[e]()).default,La=async e=>{va(e,await Ca(e)),Pa(e)},Pa= e=>void(Dn[e]=zn());function Da(e, t, n){const r=e.slice();return r[9]=t[n],r}function Aa(e){let t,n="light_mode",r,a,o;return{c(){t=L("button"),t.textContent=n,this.h()},l(s){t=P(s,"BUTTON",{class:!0,"data-svelte-h":!0}),lt(t)!=="svelte-1jn44gg"&&(t.textContent=n),this.h()},h(){C(t,"class","icon svelte-1khtm7g")},m(s, c){R(s,t,c),a||(o=[ct(r=It.call(null,t,{title:e[3].profile.theme.LIGHT_MODE()})),K(t,"click",e[4])],a=!0)},p(s, c){r&&Et(r.update)&&c&8&&r.update.call(null,{title:s[3].profile.theme.LIGHT_MODE()})},d(s){s&&k(t),a=!1,Lt(o)}}}function Oa(e){let t,n="dark_mode",r,a,o;return{c(){t=L("button"),t.textContent=n,this.h()},l(s){t=P(s,"BUTTON",{class:!0,"data-svelte-h":!0}),lt(t)!=="svelte-f5c4og"&&(t.textContent=n),this.h()},h(){C(t,"class","icon svelte-1khtm7g")},m(s, c){R(s,t,c),a||(o=[ct(r=It.call(null,t,{title:e[3].profile.theme.DARK_MODE()})),K(t,"click",e[4])],a=!0)},p(s, c){r&&Et(r.update)&&c&8&&r.update.call(null,{title:s[3].profile.theme.DARK_MODE()})},d(s){s&&k(t),a=!1,Lt(o)}}}function Ma(e){let t,n;return{c(){t=L("option"),n=V(e[9]),this.h()},l(r){t=P(r,"OPTION",{});var a=M(t);n=W(a,e[9]),a.forEach(k),this.h()},h(){t.__value=e[9],Me(t,t.__value)},m(r, a){R(r,t,a),_(t,n)},p:tt,d(r){r&&k(t)}}}function wa(e){let t,n,r,a,o,s="commit",c,l,i,u,d='<a href="https://github.com/CharaChorder/DeviceManager/issues" rel="noreferrer" target="_blank" class="svelte-1khtm7g"><span class="icon svelte-1khtm7g">bug_report</span> File an issue</a>',b,m,v,g,y,I,E,p,h,f,D,O,w,N,$;function Q(z, Y){if(z[2].mode==="light")return Oa;if(z[2].mode==="dark")return Aa}let H=Q(e),U=H&&H(e),x=we(sr),J=[];for(let z=0; z<x.length; z+=1)J[z]=Ma(Da(e,x,z));return{c(){t=L("footer"),n=L("ul"),r=L("li"),a=L("a"),o=L("span"),o.textContent=s,c=V(" v"),l=V(ln),i=S(),u=L("li"),u.innerHTML=d,b=S(),m=L("ul"),v=L("li"),g=L("input"),I=S(),E=L("li"),U&&U.c(),p=S(),h=L("li"),f=L("button"),D=V(`translate
`),O=L("select");for(let z=0;z<J.length;z+=1)J[z].c();this.h()},l(z){t=P(z,"FOOTER",{class:!0});var Y=M(t);n=P(Y,"UL",{class:!0});var nt=M(n);r=P(nt,"LI",{});var yt=M(r);a=P(yt,"A",{href:!0,rel:!0,target:!0,class:!0});var dt=M(a);o=P(dt,"SPAN",{class:!0,"data-svelte-h":!0}),lt(o)!=="svelte-12xlk8t"&&(o.textContent=s),c=W(dt," v"),l=W(dt,ln),dt.forEach(k),yt.forEach(k),i=F(nt),u=P(nt,"LI",{"data-svelte-h":!0}),lt(u)!=="svelte-17enmor"&&(u.innerHTML=d),nt.forEach(k),b=F(Y),m=P(Y,"UL",{class:!0});var ht=M(m);v=P(ht,"LI",{});var wt=M(v);g=P(wt,"INPUT",{type:!0,class:!0}),wt.forEach(k),I=F(ht),E=P(ht,"LI",{});var ut=M(E);U&&U.l(ut),ut.forEach(k),p=F(ht),h=P(ht,"LI",{});var mt=M(h);f=P(mt,"BUTTON",{class:!0});var pt=M(f);D=W(pt,`translate
`),O=P(pt,"SELECT",{class:!0});var Xt=M(O);for(let At=0;At<J.length;At+=1)J[At].l(Xt);Xt.forEach(k),pt.forEach(k),mt.forEach(k),ht.forEach(k),Y.forEach(k),this.h()},h(){C(o,"class","icon svelte-1khtm7g"),C(a,"href","https://github.com/CharaChorder/DeviceManager"),C(a,"rel","noreferrer"),C(a,"target","_blank"),C(a,"class","svelte-1khtm7g"),C(n,"class","svelte-1khtm7g"),C(g,"type","color"),C(g,"class","svelte-1khtm7g"),C(O,"class","svelte-1khtm7g"),e[0]===void 0&&$t(()=>e[6].call(O)),C(f,"class","icon svelte-1khtm7g"),C(m,"class","svelte-1khtm7g"),C(t,"class","svelte-1khtm7g")},m(z,Y){R(z,t,Y),_(t,n),_(n,r),_(r,a),_(a,o),_(a,c),_(a,l),_(n,i),_(n,u),_(t,b),_(t,m),_(m,v),_(v,g),Me(g,e[2].color),_(m,I),_(m,E),U&&U.m(E,null),_(m,p),_(m,h),_(h,f),_(f,D),_(f,O);for(let nt=0;nt<J.length;nt+=1)J[nt]&&J[nt].m(O,null);nn(O,e[0],!0),e[7](O),N||($=[ct(y=It.call(null,g,{title:e[3].profile.theme.COLOR_SCHEME()})),K(g,"input",e[5]),K(O,"change",e[6]),ct(w=It.call(null,f,{title:e[3].profile.LANGUAGE()})),K(f,"click",e[8])],N=!0)},p(z,[Y]){y&&Et(y.update)&&Y&8&&y.update.call(null,{title:z[3].profile.theme.COLOR_SCHEME()}),Y&4&&Me(g,z[2].color),H===(H=Q(z))&&U?U.p(z,Y):(U&&U.d(1),U=H&&H(z),U&&(U.c(),U.m(E,null))),Y&1&&nn(O,z[0]),w&&Et(w.update)&&Y&8&&w.update.call(null,{title:z[3].profile.LANGUAGE()})},i:tt,o:tt,d(z){z&&k(t),U&&U.d(),En(J,z),e[7](null),N=!1,Lt($)}}}function Ra(e,t,n){let r,a;q(e,se,b=>n(2,r=b)),q(e,Ht,b=>n(3,a=b));let o=localStorage.getItem("locale")||An();function s(){const b=r.mode==="light"?"dark":"light";document.startViewTransition?document.startViewTransition(async()=>{bt(se,r.mode=b,r),await Zn()}):bt(se,r.mode=b,r)}let c;function l(){r.color=this.value,se.set(r)}function i(){o=Qn(this),n(0,o)}function u(b){Le[b?"unshift":"push"](()=>{c=b,n(1,c)})}const d=()=>c.click();return e.$$.update=()=>{e.$$.dirty&1&&(async()=>(localStorage.setItem("locale",o),await La(o),On(o)))()},[o,c,r,a,s,l,i,u,d]}class Na extends Pt{constructor(t){super(),Dt(this,t,Ra,wa,Ct,{})}}const be=nr("os-layout",{}),Be=new Set;function Sa({code:e,key:t}){const n=[...Be];Be.add(e);const r=JSON.stringify([...n.sort(),e]);r in Nt(be)||Nt(be)[JSON.stringify([e])]===t||be.update(a=>(a[r]=t,a))}function Fa({code:e}){Be.delete(e)}function Ba(){"keyboard"in navigator&&navigator.keyboard.getLayoutMap().then(e=>{be.update(t=>(Object.assign(t,Object.fromEntries([...e.entries()].map(([n,r])=>[JSON.stringify([n]),r]))),t))}),window.addEventListener("keydown",Sa),window.addEventListener("keyup",Fa)}const Ua=Ge("goto"),Va=Ge("before_navigate"),Wa=Ge("after_navigate");function yn(e){let t,n,r,a,o,s;const c=e[5].default,l=Ee(c,e,e[4],null);return{c(){t=L("main"),l&&l.c()},l(i){t=P(i,"MAIN",{});var u=M(t);l&&l.l(u),u.forEach(k)},m(i,u){R(i,t,u),l&&l.m(t,null),a=!0,o||(s=K(t,"outroend",function(){Et(e[2])&&e[2].apply(this,arguments)}),o=!0)},p(i,u){e=i,l&&l.p&&(!a||u&16)&&Ie(l,c,e,e[4],a?Ce(c,e[4],u,null):ve(e[4]),null)},i(i){a||(X(l,i),i&&$t(()=>{a&&(r&&r.end(1),n=tr(t,jt,{x:e[0]*24,duration:150,easing:ar}),n.start())}),a=!0)},o(i){Z(l,i),n&&n.invalidate(),i&&(r=er(t,jt,{x:e[1]*24,duration:150,easing:or})),a=!1},d(i){i&&k(t),l&&l.d(i),i&&r&&r.end(),o=!1,s()}}}function za(e){let t,n,r=!e[3]&&yn(e);return{c(){r&&r.c(),t=vt()},l(a){r&&r.l(a),t=vt()},m(a,o){r&&r.m(a,o),R(a,t,o),n=!0},p(a,[o]){a[3]?r&&(ce(),Z(r,1,1,()=>{r=null}),ue()):r?(r.p(a,o),o&8&&X(r,1)):(r=yn(a),r.c(),X(r,1),r.m(t.parentNode,t))},i(a){n||(X(r),n=!0)},o(a){Z(r),n=!1},d(a){a&&k(t),r&&r.d(a)}}}function $a(e,t,n){let{$$slots:r={},$$scope:a}=t,o=0,s=0,c,l,i=!1;const u=["/config/chords/","/config/layout/","/config/settings/"];return Va(d=>{const b=d.from?.url.pathname,m=d.to?.url.pathname;if(n(3,i=!0),!(b&&m&&u.includes(b)&&u.includes(m))){n(0,o=0),n(1,s=0);return}const v=u.indexOf(b),g=u.indexOf(m);n(0,o=v>g?-1:1),n(1,s=v>g?1:-1),l=new Promise(y=>{n(2,c=y)})}),Wa(async()=>{await l,n(3,i=!1)}),e.$$set=d=>{"$$scope"in d&&n(4,a=d.$$scope)},[o,s,c,i,a,r]}class Ha extends Pt{constructor(t){super(),Dt(this,t,$a,za,Ct,{})}}function Ga(e){let t,n=e[2].sync.TITLE_WRITE()+"",r,a,o,s=e[2].sync.DISCLAIMER_WRITE()+"",c;return{c(){t=L("h2"),r=V(n),a=S(),o=L("p"),c=V(s)},l(l){t=P(l,"H2",{});var i=M(t);r=W(i,n),i.forEach(k),a=F(l),o=P(l,"P",{});var u=M(o);c=W(u,s),u.forEach(k)},m(l,i){R(l,t,i),_(t,r),R(l,a,i),R(l,o,i),_(o,c)},p(l,i){i&4&&n!==(n=l[2].sync.TITLE_WRITE()+"")&&G(r,n),i&4&&s!==(s=l[2].sync.DISCLAIMER_WRITE()+"")&&G(c,s)},d(l){l&&(k(t),k(a),k(o))}}}function ja(e){let t,n=e[2].sync.TITLE_READ()+"",r;return{c(){t=L("h2"),r=V(n)},l(a){t=P(a,"H2",{});var o=M(t);r=W(o,n),o.forEach(k)},m(a,o){R(a,t,o),_(t,r)},p(a,o){o&4&&n!==(n=a[2].sync.TITLE_READ()+"")&&G(r,n)},d(a){a&&k(t)}}}function Ya(e){let t,n,r,a,o;function s(i,u){return i[1]==="downloading"?ja:Ga}let c=s(e),l=c(e);return{c(){t=L("dialog"),l.c(),n=S(),r=L("progress"),this.h()},l(i){t=P(i,"DIALOG",{class:!0});var u=M(t);l.l(u),n=F(u),r=P(u,"PROGRESS",{max:!0,class:!0}),M(r).forEach(k),u.forEach(k),this.h()},h(){C(r,"max",a=e[3]?.max??1),r.value=o=e[3]?.current??1,C(r,"class","svelte-1xbxmaz"),C(t,"class","svelte-1xbxmaz")},m(i,u){R(i,t,u),l.m(t,null),_(t,n),_(t,r),e[5](t)},p(i,[u]){c===(c=s(i))&&l?l.p(i,u):(l.d(1),l=c(i),l&&(l.c(),l.m(t,n))),u&8&&a!==(a=i[3]?.max??1)&&C(r,"max",a),u&8&&o!==(o=i[3]?.current??1)&&(r.value=o)},i:tt,o:tt,d(i){i&&k(t),l.d(),e[5](null)}}}function Xa(e,t,n){let r,a,o;q(e,Zt,u=>n(4,r=u)),q(e,Ht,u=>n(2,a=u)),q(e,Cn,u=>n(3,o=u));async function s(u){await new Promise(d=>setTimeout(d,150)),r===u&&(!l.open&&(r==="uploading"||r==="downloading")?(n(1,c=r),l.showModal(),l.animate([{opacity:0},{opacity:1}],{duration:250,easing:"ease"})):l.open&&l.animate([{opacity:1},{opacity:0}],{duration:250,easing:"ease"}).addEventListener("finish",()=>{l.close()}))}let c,l;function i(u){Le[u?"unshift":"push"](()=>{l=u,n(0,l)})}return e.$$.update=()=>{e.$$.dirty&17&&l&&s(r)},[l,c,a,o,r,i]}class qa extends Pt{constructor(t){super(),Dt(this,t,Xa,Ya,Ct,{})}}const{document:Kt}=qn;function Ja(e){let t;const n=e[2].default,r=Ee(n,e,e[3],null);return{c(){r&&r.c()},l(a){r&&r.l(a)},m(a,o){r&&r.m(a,o),t=!0},p(a,o){r&&r.p&&(!t||o&8)&&Ie(r,n,a,a[3],t?Ce(n,a[3],o,null):ve(a[3]),null)},i(a){t||(X(r,a),t=!0)},o(a){Z(r,a),t=!1},d(a){r&&r.d(a)}}}function Ka(e){let t,n;return t=new ga({}),{c(){Bt(t.$$.fragment)},l(r){Ut(t.$$.fragment,r)},m(r,a){Vt(t,r,a),n=!0},i(r){n||(X(t.$$.fragment,r),n=!0)},o(r){Z(t.$$.fragment,r),n=!1},d(r){Wt(t,r)}}}function Za(e){let t,n,r,a,o,s,c,l,i,u,d,b,m,v,g,y,I,E;Kt.title=r=e[1].TITLE(),i=new qa({}),d=new ma({}),m=new Ha({props:{$$slots:{default:[Ja]},$$scope:{ctx:e}}}),g=new Na({});let p={}.TAURI_FAMILY===void 0&&fr&&!("serial"in navigator)&&Ka();return{c(){t=new Ve(!1),n=vt(),a=L("meta"),s=L("meta"),l=S(),Bt(i.$$.fragment),u=S(),Bt(d.$$.fragment),b=S(),Bt(m.$$.fragment),v=S(),Bt(g.$$.fragment),y=S(),p&&p.c(),I=vt(),this.h()},l(h){const f=xn("svelte-1o8823w",Kt.head);t=We(f,!1),n=vt(),a=P(f,"META",{name:!0,content:!0}),s=P(f,"META",{name:!0,content:!0}),f.forEach(k),l=F(h),Ut(i.$$.fragment,h),u=F(h),Ut(d.$$.fragment,h),b=F(h),Ut(m.$$.fragment,h),v=F(h),Ut(g.$$.fragment,h),y=F(h),p&&p.l(h),I=vt(),this.h()},h(){t.a=n,C(a,"name","description"),C(a,"content",o=e[1].DESCRIPTION()),C(s,"name","theme-color"),C(s,"content",c=e[0].themeColor)},m(h,f){t.m(Qa,Kt.head),_(Kt.head,n),_(Kt.head,a),_(Kt.head,s),R(h,l,f),Vt(i,h,f),R(h,u,f),Vt(d,h,f),R(h,b,f),Vt(m,h,f),R(h,v,f),Vt(g,h,f),R(h,y,f),p&&p.m(h,f),R(h,I,f),E=!0},p(h,[f]){(!E||f&2)&&r!==(r=h[1].TITLE())&&(Kt.title=r),(!E||f&2&&o!==(o=h[1].DESCRIPTION()))&&C(a,"content",o),(!E||f&1&&c!==(c=h[0].themeColor))&&C(s,"content",c);const D={};f&8&&(D.$$scope={dirty:f,ctx:h}),m.$set(D)},i(h){E||(X(i.$$.fragment,h),X(d.$$.fragment,h),X(m.$$.fragment,h),X(g.$$.fragment,h),X(p),E=!0)},o(h){Z(i.$$.fragment,h),Z(d.$$.fragment,h),Z(m.$$.fragment,h),Z(g.$$.fragment,h),Z(p),E=!1},d(h){h&&(t.d(),k(l),k(u),k(b),k(v),k(y),k(I)),k(n),k(a),k(s),Wt(i,h),Wt(d,h),Wt(m,h),Wt(g,h),p&&p.d(h)}}}let Qa="";function xa(e,t,n){let r,a;q(e,Ln,i=>n(4,r=i)),q(e,Ht,i=>n(1,a=i));let{$$slots:o={},$$scope:s}=t;const c=localStorage.getItem("locale")||An();ya(c),On(c),Ba(),Pn.setDefaultProps({animation:"shift-away",theme:"surface-variant",allowHTML:!0,duration:250,maxWidth:"none",arrow:!0});let{data:l}=t;return Ue(async()=>{if(se.subscribe(i=>{const u=Ar(Dr(i.color)),d=i.mode==="dark";Mr(u,{target:document.body,dark:d})}),{}.TAURI_FAMILY===void 0){const{initPwa:i}=await ke(()=>import("../chunks/pwa-setup.6abc10da.js"),["../chunks/pwa-setup.6abc10da.js","../chunks/preload-helper.a4192956.js"],import.meta.url);await i()}if(r.autoConnect&&await rr()&&await vn(),l.importFile){Fe(l.importFile);const i=new URL(location.href);i.searchParams.delete("import"),await Ua(i.href,{replaceState:!0})}}),e.$$set= i=>{"data"in i&&n(0,l=i.data),"$$scope"in i&&n(3,s=i.$$scope)},[l,a,o,s]}class po extends Pt{constructor(t){super(),Dt(this,t,xa,Za,Ct,{data:0})}}export{po as component,mo as universal};