mirror of
https://github.com/Macrame-App/Macrame
synced 2025-12-29 07:19:26 +00:00
44 lines
55 KiB
JavaScript
44 lines
55 KiB
JavaScript
import{c as pe,N as gn,_ as mt,O as en,a as xe,r as ft,o as tn,b as nn,d as re,e as z,k as O,g as B,j as V,t as J,u as F,A as ce,f as j,h as G,q,P as hn,l as we,F as Fe,i as wn,I as gt,s as ht,x as wt,Q as pn,K as mn,w as bn,v as vn,S as yn,T as kn,B as It}from"./index-oAtpp-VZ.js";import{_ as rn}from"./DialogComp-CyRyORDj.js";import{A as En}from"./AccordionComp-D0eDAM6d.js";/**
|
|
* @license @tabler/icons-vue v3.31.0 - MIT
|
|
*
|
|
* This source code is licensed under the MIT license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/var Cn=pe("outline","device-desktop","IconDeviceDesktop",[["path",{d:"M3 5a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1v-10z",key:"svg-0"}],["path",{d:"M7 20h10",key:"svg-1"}],["path",{d:"M9 16v4",key:"svg-2"}],["path",{d:"M15 16v4",key:"svg-3"}]]);/**
|
|
* @license @tabler/icons-vue v3.31.0 - MIT
|
|
*
|
|
* This source code is licensed under the MIT license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/var In=pe("outline","device-mobile","IconDeviceMobile",[["path",{d:"M6 5a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2v-14z",key:"svg-0"}],["path",{d:"M11 4h2",key:"svg-1"}],["path",{d:"M12 17v.01",key:"svg-2"}]]);/**
|
|
* @license @tabler/icons-vue v3.31.0 - MIT
|
|
*
|
|
* This source code is licensed under the MIT license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/var Sn=pe("outline","device-tablet","IconDeviceTablet",[["path",{d:"M5 4a1 1 0 0 1 1 -1h12a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-12a1 1 0 0 1 -1 -1v-16z",key:"svg-0"}],["path",{d:"M11 17a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}]]);/**
|
|
* @license @tabler/icons-vue v3.31.0 - MIT
|
|
*
|
|
* This source code is licensed under the MIT license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/var An=pe("outline","device-unknown","IconDeviceUnknown",[["path",{d:"M5 5a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M12 16v.01",key:"svg-1"}],["path",{d:"M12 13a2 2 0 0 0 .914 -3.782a1.98 1.98 0 0 0 -2.414 .483",key:"svg-2"}]]);/**
|
|
* @license @tabler/icons-vue v3.31.0 - MIT
|
|
*
|
|
* This source code is licensed under the MIT license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/var Mn=pe("outline","link-off","IconLinkOff",[["path",{d:"M9 15l3 -3m2 -2l1 -1",key:"svg-0"}],["path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}],["path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463",key:"svg-3"}]]);/**
|
|
* @license @tabler/icons-vue v3.31.0 - MIT
|
|
*
|
|
* This source code is licensed under the MIT license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/var Bn=pe("outline","plug-connected-x","IconPlugConnectedX",[["path",{d:"M20 16l-4 4",key:"svg-0"}],["path",{d:"M7 12l5 5l-1.5 1.5a3.536 3.536 0 1 1 -5 -5l1.5 -1.5z",key:"svg-1"}],["path",{d:"M17 12l-5 -5l1.5 -1.5a3.536 3.536 0 1 1 5 5l-1.5 1.5z",key:"svg-2"}],["path",{d:"M3 21l2.5 -2.5",key:"svg-3"}],["path",{d:"M18.5 5.5l2.5 -2.5",key:"svg-4"}],["path",{d:"M10 11l-2 2",key:"svg-5"}],["path",{d:"M13 14l-2 2",key:"svg-6"}],["path",{d:"M16 16l4 4",key:"svg-7"}]]);/**
|
|
* @license @tabler/icons-vue v3.31.0 - MIT
|
|
*
|
|
* This source code is licensed under the MIT license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/var Re=pe("outline","reload","IconReload",[["path",{d:"M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1 7.935 1.007 9.425 4.747",key:"svg-0"}],["path",{d:"M20 4v5h-5",key:"svg-1"}]]),Ie={},Ve,St;function _n(){return St||(St=1,Ve=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Ve}var je={},le={},At;function me(){if(At)return le;At=1;let o;const r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return le.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},le.getSymbolTotalCodewords=function(n){return r[n]},le.getBCHDigit=function(s){let n=0;for(;s!==0;)n++,s>>>=1;return n},le.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');o=n},le.isKanjiModeEnabled=function(){return typeof o<"u"},le.toSJIS=function(n){return o(n)},le}var He={},Mt;function bt(){return Mt||(Mt=1,function(o){o.L={bit:1},o.M={bit:0},o.Q={bit:3},o.H={bit:2};function r(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"l":case"low":return o.L;case"m":case"medium":return o.M;case"q":case"quartile":return o.Q;case"h":case"high":return o.H;default:throw new Error("Unknown EC Level: "+s)}}o.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},o.from=function(n,e){if(o.isValid(n))return n;try{return r(n)}catch{return e}}}(He)),He}var Ke,Bt;function Rn(){if(Bt)return Ke;Bt=1;function o(){this.buffer=[],this.length=0}return o.prototype={get:function(r){const s=Math.floor(r/8);return(this.buffer[s]>>>7-r%8&1)===1},put:function(r,s){for(let n=0;n<s;n++)this.putBit((r>>>s-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){const s=Math.floor(this.length/8);this.buffer.length<=s&&this.buffer.push(0),r&&(this.buffer[s]|=128>>>this.length%8),this.length++}},Ke=o,Ke}var $e,_t;function Tn(){if(_t)return $e;_t=1;function o(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=new Uint8Array(r*r),this.reservedBit=new Uint8Array(r*r)}return o.prototype.set=function(r,s,n,e){const t=r*this.size+s;this.data[t]=n,e&&(this.reservedBit[t]=!0)},o.prototype.get=function(r,s){return this.data[r*this.size+s]},o.prototype.xor=function(r,s,n){this.data[r*this.size+s]^=n},o.prototype.isReserved=function(r,s){return this.reservedBit[r*this.size+s]},$e=o,$e}var Ge={},Rt;function Nn(){return Rt||(Rt=1,function(o){const r=me().getSymbolSize;o.getRowColCoords=function(n){if(n===1)return[];const e=Math.floor(n/7)+2,t=r(n),l=t===145?26:Math.ceil((t-13)/(2*e-2))*2,f=[t-7];for(let d=1;d<e-1;d++)f[d]=f[d-1]-l;return f.push(6),f.reverse()},o.getPositions=function(n){const e=[],t=o.getRowColCoords(n),l=t.length;for(let f=0;f<l;f++)for(let d=0;d<l;d++)f===0&&d===0||f===0&&d===l-1||f===l-1&&d===0||e.push([t[f],t[d]]);return e}}(Ge)),Ge}var Ye={},Tt;function Pn(){if(Tt)return Ye;Tt=1;const o=me().getSymbolSize,r=7;return Ye.getPositions=function(n){const e=o(n);return[[0,0],[e-r,0],[0,e-r]]},Ye}var Je={},Nt;function Dn(){return Nt||(Nt=1,function(o){o.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const r={N1:3,N2:3,N3:40,N4:10};o.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7},o.from=function(e){return o.isValid(e)?parseInt(e,10):void 0},o.getPenaltyN1=function(e){const t=e.size;let l=0,f=0,d=0,b=null,m=null;for(let g=0;g<t;g++){f=d=0,b=m=null;for(let i=0;i<t;i++){let u=e.get(g,i);u===b?f++:(f>=5&&(l+=r.N1+(f-5)),b=u,f=1),u=e.get(i,g),u===m?d++:(d>=5&&(l+=r.N1+(d-5)),m=u,d=1)}f>=5&&(l+=r.N1+(f-5)),d>=5&&(l+=r.N1+(d-5))}return l},o.getPenaltyN2=function(e){const t=e.size;let l=0;for(let f=0;f<t-1;f++)for(let d=0;d<t-1;d++){const b=e.get(f,d)+e.get(f,d+1)+e.get(f+1,d)+e.get(f+1,d+1);(b===4||b===0)&&l++}return l*r.N2},o.getPenaltyN3=function(e){const t=e.size;let l=0,f=0,d=0;for(let b=0;b<t;b++){f=d=0;for(let m=0;m<t;m++)f=f<<1&2047|e.get(b,m),m>=10&&(f===1488||f===93)&&l++,d=d<<1&2047|e.get(m,b),m>=10&&(d===1488||d===93)&&l++}return l*r.N3},o.getPenaltyN4=function(e){let t=0;const l=e.data.length;for(let d=0;d<l;d++)t+=e.data[d];return Math.abs(Math.ceil(t*100/l/5)-10)*r.N4};function s(n,e,t){switch(n){case o.Patterns.PATTERN000:return(e+t)%2===0;case o.Patterns.PATTERN001:return e%2===0;case o.Patterns.PATTERN010:return t%3===0;case o.Patterns.PATTERN011:return(e+t)%3===0;case o.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(t/3))%2===0;case o.Patterns.PATTERN101:return e*t%2+e*t%3===0;case o.Patterns.PATTERN110:return(e*t%2+e*t%3)%2===0;case o.Patterns.PATTERN111:return(e*t%3+(e+t)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}o.applyMask=function(e,t){const l=t.size;for(let f=0;f<l;f++)for(let d=0;d<l;d++)t.isReserved(d,f)||t.xor(d,f,s(e,d,f))},o.getBestMask=function(e,t){const l=Object.keys(o.Patterns).length;let f=0,d=1/0;for(let b=0;b<l;b++){t(b),o.applyMask(b,e);const m=o.getPenaltyN1(e)+o.getPenaltyN2(e)+o.getPenaltyN3(e)+o.getPenaltyN4(e);o.applyMask(b,e),m<d&&(d=m,f=b)}return f}}(Je)),Je}var Le={},Pt;function on(){if(Pt)return Le;Pt=1;const o=bt(),r=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],s=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Le.getBlocksCount=function(e,t){switch(t){case o.L:return r[(e-1)*4+0];case o.M:return r[(e-1)*4+1];case o.Q:return r[(e-1)*4+2];case o.H:return r[(e-1)*4+3];default:return}},Le.getTotalCodewordsCount=function(e,t){switch(t){case o.L:return s[(e-1)*4+0];case o.M:return s[(e-1)*4+1];case o.Q:return s[(e-1)*4+2];case o.H:return s[(e-1)*4+3];default:return}},Le}var We={},_e={},Dt;function Ln(){if(Dt)return _e;Dt=1;const o=new Uint8Array(512),r=new Uint8Array(256);return function(){let n=1;for(let e=0;e<255;e++)o[e]=n,r[n]=e,n<<=1,n&256&&(n^=285);for(let e=255;e<512;e++)o[e]=o[e-255]}(),_e.log=function(n){if(n<1)throw new Error("log("+n+")");return r[n]},_e.exp=function(n){return o[n]},_e.mul=function(n,e){return n===0||e===0?0:o[r[n]+r[e]]},_e}var Lt;function xn(){return Lt||(Lt=1,function(o){const r=Ln();o.mul=function(n,e){const t=new Uint8Array(n.length+e.length-1);for(let l=0;l<n.length;l++)for(let f=0;f<e.length;f++)t[l+f]^=r.mul(n[l],e[f]);return t},o.mod=function(n,e){let t=new Uint8Array(n);for(;t.length-e.length>=0;){const l=t[0];for(let d=0;d<e.length;d++)t[d]^=r.mul(e[d],l);let f=0;for(;f<t.length&&t[f]===0;)f++;t=t.slice(f)}return t},o.generateECPolynomial=function(n){let e=new Uint8Array([1]);for(let t=0;t<n;t++)e=o.mul(e,new Uint8Array([1,r.exp(t)]));return e}}(We)),We}var Qe,xt;function Un(){if(xt)return Qe;xt=1;const o=xn();function r(s){this.genPoly=void 0,this.degree=s,this.degree&&this.initialize(this.degree)}return r.prototype.initialize=function(n){this.degree=n,this.genPoly=o.generateECPolynomial(this.degree)},r.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const e=new Uint8Array(n.length+this.degree);e.set(n);const t=o.mod(e,this.genPoly),l=this.degree-t.length;if(l>0){const f=new Uint8Array(this.degree);return f.set(t,l),f}return t},Qe=r,Qe}var Xe={},Ze={},et={},Ut;function sn(){return Ut||(Ut=1,et.isValid=function(r){return!isNaN(r)&&r>=1&&r<=40}),et}var te={},qt;function an(){if(qt)return te;qt=1;const o="[0-9]+",r="[A-Z $%*+\\-./:]+";let s="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";s=s.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+s+`)(?:.|[\r
|
|
]))+`;te.KANJI=new RegExp(s,"g"),te.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),te.BYTE=new RegExp(n,"g"),te.NUMERIC=new RegExp(o,"g"),te.ALPHANUMERIC=new RegExp(r,"g");const e=new RegExp("^"+s+"$"),t=new RegExp("^"+o+"$"),l=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return te.testKanji=function(d){return e.test(d)},te.testNumeric=function(d){return t.test(d)},te.testAlphanumeric=function(d){return l.test(d)},te}var Ot;function be(){return Ot||(Ot=1,function(o){const r=sn(),s=an();o.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},o.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},o.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},o.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},o.MIXED={bit:-1},o.getCharCountIndicator=function(t,l){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!r.isValid(l))throw new Error("Invalid version: "+l);return l>=1&&l<10?t.ccBits[0]:l<27?t.ccBits[1]:t.ccBits[2]},o.getBestModeForData=function(t){return s.testNumeric(t)?o.NUMERIC:s.testAlphanumeric(t)?o.ALPHANUMERIC:s.testKanji(t)?o.KANJI:o.BYTE},o.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},o.isValid=function(t){return t&&t.bit&&t.ccBits};function n(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return o.NUMERIC;case"alphanumeric":return o.ALPHANUMERIC;case"kanji":return o.KANJI;case"byte":return o.BYTE;default:throw new Error("Unknown mode: "+e)}}o.from=function(t,l){if(o.isValid(t))return t;try{return n(t)}catch{return l}}}(Ze)),Ze}var zt;function qn(){return zt||(zt=1,function(o){const r=me(),s=on(),n=bt(),e=be(),t=sn(),l=7973,f=r.getBCHDigit(l);function d(i,u,a){for(let c=1;c<=40;c++)if(u<=o.getCapacity(c,a,i))return c}function b(i,u){return e.getCharCountIndicator(i,u)+4}function m(i,u){let a=0;return i.forEach(function(c){const h=b(c.mode,u);a+=h+c.getBitsLength()}),a}function g(i,u){for(let a=1;a<=40;a++)if(m(i,a)<=o.getCapacity(a,u,e.MIXED))return a}o.from=function(u,a){return t.isValid(u)?parseInt(u,10):a},o.getCapacity=function(u,a,c){if(!t.isValid(u))throw new Error("Invalid QR Code version");typeof c>"u"&&(c=e.BYTE);const h=r.getSymbolTotalCodewords(u),E=s.getTotalCodewordsCount(u,a),N=(h-E)*8;if(c===e.MIXED)return N;const p=N-b(c,u);switch(c){case e.NUMERIC:return Math.floor(p/10*3);case e.ALPHANUMERIC:return Math.floor(p/11*2);case e.KANJI:return Math.floor(p/13);case e.BYTE:default:return Math.floor(p/8)}},o.getBestVersionForData=function(u,a){let c;const h=n.from(a,n.M);if(Array.isArray(u)){if(u.length>1)return g(u,h);if(u.length===0)return 1;c=u[0]}else c=u;return d(c.mode,c.getLength(),h)},o.getEncodedBits=function(u){if(!t.isValid(u)||u<7)throw new Error("Invalid QR Code version");let a=u<<12;for(;r.getBCHDigit(a)-f>=0;)a^=l<<r.getBCHDigit(a)-f;return u<<12|a}}(Xe)),Xe}var tt={},Ft;function On(){if(Ft)return tt;Ft=1;const o=me(),r=1335,s=21522,n=o.getBCHDigit(r);return tt.getEncodedBits=function(t,l){const f=t.bit<<3|l;let d=f<<10;for(;o.getBCHDigit(d)-n>=0;)d^=r<<o.getBCHDigit(d)-n;return(f<<10|d)^s},tt}var nt={},it,Vt;function zn(){if(Vt)return it;Vt=1;const o=be();function r(s){this.mode=o.NUMERIC,this.data=s.toString()}return r.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(n){let e,t,l;for(e=0;e+3<=this.data.length;e+=3)t=this.data.substr(e,3),l=parseInt(t,10),n.put(l,10);const f=this.data.length-e;f>0&&(t=this.data.substr(e),l=parseInt(t,10),n.put(l,f*3+1))},it=r,it}var rt,jt;function Fn(){if(jt)return rt;jt=1;const o=be(),r=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function s(n){this.mode=o.ALPHANUMERIC,this.data=n}return s.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let l=r.indexOf(this.data[t])*45;l+=r.indexOf(this.data[t+1]),e.put(l,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},rt=s,rt}var ot,Ht;function Vn(){if(Ht)return ot;Ht=1;const o=be();function r(s){this.mode=o.BYTE,typeof s=="string"?this.data=new TextEncoder().encode(s):this.data=new Uint8Array(s)}return r.getBitsLength=function(n){return n*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(s){for(let n=0,e=this.data.length;n<e;n++)s.put(this.data[n],8)},ot=r,ot}var st,Kt;function jn(){if(Kt)return st;Kt=1;const o=be(),r=me();function s(n){this.mode=o.KANJI,this.data=n}return s.getBitsLength=function(e){return e*13},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(n){let e;for(e=0;e<this.data.length;e++){let t=r.toSJIS(this.data[e]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
|
|
Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),n.put(t,13)}},st=s,st}var at={exports:{}},$t;function Hn(){return $t||($t=1,function(o){var r={single_source_shortest_paths:function(s,n,e){var t={},l={};l[n]=0;var f=r.PriorityQueue.make();f.push(n,0);for(var d,b,m,g,i,u,a,c,h;!f.empty();){d=f.pop(),b=d.value,g=d.cost,i=s[b]||{};for(m in i)i.hasOwnProperty(m)&&(u=i[m],a=g+u,c=l[m],h=typeof l[m]>"u",(h||c>a)&&(l[m]=a,f.push(m,a),t[m]=b))}if(typeof e<"u"&&typeof l[e]>"u"){var E=["Could not find a path from ",n," to ",e,"."].join("");throw new Error(E)}return t},extract_shortest_path_from_predecessor_list:function(s,n){for(var e=[],t=n;t;)e.push(t),s[t],t=s[t];return e.reverse(),e},find_path:function(s,n,e){var t=r.single_source_shortest_paths(s,n,e);return r.extract_shortest_path_from_predecessor_list(t,e)},PriorityQueue:{make:function(s){var n=r.PriorityQueue,e={},t;s=s||{};for(t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e.queue=[],e.sorter=s.sorter||n.default_sorter,e},default_sorter:function(s,n){return s.cost-n.cost},push:function(s,n){var e={value:s,cost:n};this.queue.push(e),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};o.exports=r}(at)),at.exports}var Gt;function Kn(){return Gt||(Gt=1,function(o){const r=be(),s=zn(),n=Fn(),e=Vn(),t=jn(),l=an(),f=me(),d=Hn();function b(E){return unescape(encodeURIComponent(E)).length}function m(E,N,p){const w=[];let D;for(;(D=E.exec(p))!==null;)w.push({data:D[0],index:D.index,mode:N,length:D[0].length});return w}function g(E){const N=m(l.NUMERIC,r.NUMERIC,E),p=m(l.ALPHANUMERIC,r.ALPHANUMERIC,E);let w,D;return f.isKanjiModeEnabled()?(w=m(l.BYTE,r.BYTE,E),D=m(l.KANJI,r.KANJI,E)):(w=m(l.BYTE_KANJI,r.BYTE,E),D=[]),N.concat(p,w,D).sort(function(S,C){return S.index-C.index}).map(function(S){return{data:S.data,mode:S.mode,length:S.length}})}function i(E,N){switch(N){case r.NUMERIC:return s.getBitsLength(E);case r.ALPHANUMERIC:return n.getBitsLength(E);case r.KANJI:return t.getBitsLength(E);case r.BYTE:return e.getBitsLength(E)}}function u(E){return E.reduce(function(N,p){const w=N.length-1>=0?N[N.length-1]:null;return w&&w.mode===p.mode?(N[N.length-1].data+=p.data,N):(N.push(p),N)},[])}function a(E){const N=[];for(let p=0;p<E.length;p++){const w=E[p];switch(w.mode){case r.NUMERIC:N.push([w,{data:w.data,mode:r.ALPHANUMERIC,length:w.length},{data:w.data,mode:r.BYTE,length:w.length}]);break;case r.ALPHANUMERIC:N.push([w,{data:w.data,mode:r.BYTE,length:w.length}]);break;case r.KANJI:N.push([w,{data:w.data,mode:r.BYTE,length:b(w.data)}]);break;case r.BYTE:N.push([{data:w.data,mode:r.BYTE,length:b(w.data)}])}}return N}function c(E,N){const p={},w={start:{}};let D=["start"];for(let v=0;v<E.length;v++){const S=E[v],C=[];for(let y=0;y<S.length;y++){const A=S[y],I=""+v+y;C.push(I),p[I]={node:A,lastCount:0},w[I]={};for(let M=0;M<D.length;M++){const k=D[M];p[k]&&p[k].node.mode===A.mode?(w[k][I]=i(p[k].lastCount+A.length,A.mode)-i(p[k].lastCount,A.mode),p[k].lastCount+=A.length):(p[k]&&(p[k].lastCount=A.length),w[k][I]=i(A.length,A.mode)+4+r.getCharCountIndicator(A.mode,N))}}D=C}for(let v=0;v<D.length;v++)w[D[v]].end=0;return{map:w,table:p}}function h(E,N){let p;const w=r.getBestModeForData(E);if(p=r.from(N,w),p!==r.BYTE&&p.bit<w.bit)throw new Error('"'+E+'" cannot be encoded with mode '+r.toString(p)+`.
|
|
Suggested mode is: `+r.toString(w));switch(p===r.KANJI&&!f.isKanjiModeEnabled()&&(p=r.BYTE),p){case r.NUMERIC:return new s(E);case r.ALPHANUMERIC:return new n(E);case r.KANJI:return new t(E);case r.BYTE:return new e(E)}}o.fromArray=function(N){return N.reduce(function(p,w){return typeof w=="string"?p.push(h(w,null)):w.data&&p.push(h(w.data,w.mode)),p},[])},o.fromString=function(N,p){const w=g(N,f.isKanjiModeEnabled()),D=a(w),v=c(D,p),S=d.find_path(v.map,"start","end"),C=[];for(let y=1;y<S.length-1;y++)C.push(v.table[S[y]].node);return o.fromArray(u(C))},o.rawSplit=function(N){return o.fromArray(g(N,f.isKanjiModeEnabled()))}}(nt)),nt}var Yt;function $n(){if(Yt)return je;Yt=1;const o=me(),r=bt(),s=Rn(),n=Tn(),e=Nn(),t=Pn(),l=Dn(),f=on(),d=Un(),b=qn(),m=On(),g=be(),i=Kn();function u(v,S){const C=v.size,y=t.getPositions(S);for(let A=0;A<y.length;A++){const I=y[A][0],M=y[A][1];for(let k=-1;k<=7;k++)if(!(I+k<=-1||C<=I+k))for(let _=-1;_<=7;_++)M+_<=-1||C<=M+_||(k>=0&&k<=6&&(_===0||_===6)||_>=0&&_<=6&&(k===0||k===6)||k>=2&&k<=4&&_>=2&&_<=4?v.set(I+k,M+_,!0,!0):v.set(I+k,M+_,!1,!0))}}function a(v){const S=v.size;for(let C=8;C<S-8;C++){const y=C%2===0;v.set(C,6,y,!0),v.set(6,C,y,!0)}}function c(v,S){const C=e.getPositions(S);for(let y=0;y<C.length;y++){const A=C[y][0],I=C[y][1];for(let M=-2;M<=2;M++)for(let k=-2;k<=2;k++)M===-2||M===2||k===-2||k===2||M===0&&k===0?v.set(A+M,I+k,!0,!0):v.set(A+M,I+k,!1,!0)}}function h(v,S){const C=v.size,y=b.getEncodedBits(S);let A,I,M;for(let k=0;k<18;k++)A=Math.floor(k/3),I=k%3+C-8-3,M=(y>>k&1)===1,v.set(A,I,M,!0),v.set(I,A,M,!0)}function E(v,S,C){const y=v.size,A=m.getEncodedBits(S,C);let I,M;for(I=0;I<15;I++)M=(A>>I&1)===1,I<6?v.set(I,8,M,!0):I<8?v.set(I+1,8,M,!0):v.set(y-15+I,8,M,!0),I<8?v.set(8,y-I-1,M,!0):I<9?v.set(8,15-I-1+1,M,!0):v.set(8,15-I-1,M,!0);v.set(y-8,8,1,!0)}function N(v,S){const C=v.size;let y=-1,A=C-1,I=7,M=0;for(let k=C-1;k>0;k-=2)for(k===6&&k--;;){for(let _=0;_<2;_++)if(!v.isReserved(A,k-_)){let X=!1;M<S.length&&(X=(S[M]>>>I&1)===1),v.set(A,k-_,X),I--,I===-1&&(M++,I=7)}if(A+=y,A<0||C<=A){A-=y,y=-y;break}}}function p(v,S,C){const y=new s;C.forEach(function(_){y.put(_.mode.bit,4),y.put(_.getLength(),g.getCharCountIndicator(_.mode,v)),_.write(y)});const A=o.getSymbolTotalCodewords(v),I=f.getTotalCodewordsCount(v,S),M=(A-I)*8;for(y.getLengthInBits()+4<=M&&y.put(0,4);y.getLengthInBits()%8!==0;)y.putBit(0);const k=(M-y.getLengthInBits())/8;for(let _=0;_<k;_++)y.put(_%2?17:236,8);return w(y,v,S)}function w(v,S,C){const y=o.getSymbolTotalCodewords(S),A=f.getTotalCodewordsCount(S,C),I=y-A,M=f.getBlocksCount(S,C),k=y%M,_=M-k,X=Math.floor(y/M),Z=Math.floor(I/M),ye=Z+1,Se=X-Z,Ae=new d(Se);let fe=0;const ge=new Array(M),he=new Array(M);let se=0;const Ne=new Uint8Array(v.buffer);for(let ne=0;ne<M;ne++){const Ee=ne<_?Z:ye;ge[ne]=Ne.slice(fe,fe+Ee),he[ne]=Ae.encode(ge[ne]),fe+=Ee,se=Math.max(se,Ee)}const ae=new Uint8Array(y);let ke=0,$,Y;for($=0;$<se;$++)for(Y=0;Y<M;Y++)$<ge[Y].length&&(ae[ke++]=ge[Y][$]);for($=0;$<Se;$++)for(Y=0;Y<M;Y++)ae[ke++]=he[Y][$];return ae}function D(v,S,C,y){let A;if(Array.isArray(v))A=i.fromArray(v);else if(typeof v=="string"){let X=S;if(!X){const Z=i.rawSplit(v);X=b.getBestVersionForData(Z,C)}A=i.fromString(v,X||40)}else throw new Error("Invalid data");const I=b.getBestVersionForData(A,C);if(!I)throw new Error("The amount of data is too big to be stored in a QR Code");if(!S)S=I;else if(S<I)throw new Error(`
|
|
The chosen QR Code version cannot contain this amount of data.
|
|
Minimum version required to store current data is: `+I+`.
|
|
`);const M=p(S,C,A),k=o.getSymbolSize(S),_=new n(k);return u(_,S),a(_),c(_,S),E(_,C,0),S>=7&&h(_,S),N(_,M),isNaN(y)&&(y=l.getBestMask(_,E.bind(null,_,C))),l.applyMask(y,_),E(_,C,y),{modules:_,version:S,errorCorrectionLevel:C,maskPattern:y,segments:A}}return je.create=function(S,C){if(typeof S>"u"||S==="")throw new Error("No input text");let y=r.M,A,I;return typeof C<"u"&&(y=r.from(C.errorCorrectionLevel,r.M),A=b.from(C.version),I=l.from(C.maskPattern),C.toSJISFunc&&o.setToSJISFunction(C.toSJISFunc)),D(S,A,y,I)},je}var ut={},lt={},Jt;function un(){return Jt||(Jt=1,function(o){function r(s){if(typeof s=="number"&&(s=s.toString()),typeof s!="string")throw new Error("Color should be defined as hex string");let n=s.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+s);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(t){return[t,t]}))),n.length===6&&n.push("F","F");const e=parseInt(n.join(""),16);return{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:e&255,hex:"#"+n.slice(0,6).join("")}}o.getOptions=function(n){n||(n={}),n.color||(n.color={});const e=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,t=n.width&&n.width>=21?n.width:void 0,l=n.scale||4;return{width:t,scale:t?4:l,margin:e,color:{dark:r(n.color.dark||"#000000ff"),light:r(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},o.getScale=function(n,e){return e.width&&e.width>=n+e.margin*2?e.width/(n+e.margin*2):e.scale},o.getImageWidth=function(n,e){const t=o.getScale(n,e);return Math.floor((n+e.margin*2)*t)},o.qrToImageData=function(n,e,t){const l=e.modules.size,f=e.modules.data,d=o.getScale(l,t),b=Math.floor((l+t.margin*2)*d),m=t.margin*d,g=[t.color.light,t.color.dark];for(let i=0;i<b;i++)for(let u=0;u<b;u++){let a=(i*b+u)*4,c=t.color.light;if(i>=m&&u>=m&&i<b-m&&u<b-m){const h=Math.floor((i-m)/d),E=Math.floor((u-m)/d);c=g[f[h*l+E]?1:0]}n[a++]=c.r,n[a++]=c.g,n[a++]=c.b,n[a]=c.a}}}(lt)),lt}var Wt;function Gn(){return Wt||(Wt=1,function(o){const r=un();function s(e,t,l){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=l,t.width=l,t.style.height=l+"px",t.style.width=l+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}o.render=function(t,l,f){let d=f,b=l;typeof d>"u"&&(!l||!l.getContext)&&(d=l,l=void 0),l||(b=n()),d=r.getOptions(d);const m=r.getImageWidth(t.modules.size,d),g=b.getContext("2d"),i=g.createImageData(m,m);return r.qrToImageData(i.data,t,d),s(g,b,m),g.putImageData(i,0,0),b},o.renderToDataURL=function(t,l,f){let d=f;typeof d>"u"&&(!l||!l.getContext)&&(d=l,l=void 0),d||(d={});const b=o.render(t,l,d),m=d.type||"image/png",g=d.rendererOpts||{};return b.toDataURL(m,g.quality)}}(ut)),ut}var ct={},Qt;function Yn(){if(Qt)return ct;Qt=1;const o=un();function r(e,t){const l=e.a/255,f=t+'="'+e.hex+'"';return l<1?f+" "+t+'-opacity="'+l.toFixed(2).slice(1)+'"':f}function s(e,t,l){let f=e+t;return typeof l<"u"&&(f+=" "+l),f}function n(e,t,l){let f="",d=0,b=!1,m=0;for(let g=0;g<e.length;g++){const i=Math.floor(g%t),u=Math.floor(g/t);!i&&!b&&(b=!0),e[g]?(m++,g>0&&i>0&&e[g-1]||(f+=b?s("M",i+l,.5+u+l):s("m",d,0),d=0,b=!1),i+1<t&&e[g+1]||(f+=s("h",m),m=0)):d++}return f}return ct.render=function(t,l,f){const d=o.getOptions(l),b=t.modules.size,m=t.modules.data,g=b+d.margin*2,i=d.color.light.a?"<path "+r(d.color.light,"fill")+' d="M0 0h'+g+"v"+g+'H0z"/>':"",u="<path "+r(d.color.dark,"stroke")+' d="'+n(m,b,d.margin)+'"/>',a='viewBox="0 0 '+g+" "+g+'"',h='<svg xmlns="http://www.w3.org/2000/svg" '+(d.width?'width="'+d.width+'" height="'+d.width+'" ':"")+a+' shape-rendering="crispEdges">'+i+u+`</svg>
|
|
`;return typeof f=="function"&&f(null,h),h},ct}var Xt;function Jn(){if(Xt)return Ie;Xt=1;const o=_n(),r=$n(),s=Gn(),n=Yn();function e(t,l,f,d,b){const m=[].slice.call(arguments,1),g=m.length,i=typeof m[g-1]=="function";if(!i&&!o())throw new Error("Callback required as last argument");if(i){if(g<2)throw new Error("Too few arguments provided");g===2?(b=f,f=l,l=d=void 0):g===3&&(l.getContext&&typeof b>"u"?(b=d,d=void 0):(b=d,d=f,f=l,l=void 0))}else{if(g<1)throw new Error("Too few arguments provided");return g===1?(f=l,l=d=void 0):g===2&&!l.getContext&&(d=f,f=l,l=void 0),new Promise(function(u,a){try{const c=r.create(f,d);u(t(c,l,d))}catch(c){a(c)}})}try{const u=r.create(f,d);b(null,t(u,l,d))}catch(u){b(u)}}return Ie.create=r.create,Ie.toCanvas=e.bind(null,s.render),Ie.toDataURL=e.bind(null,s.renderToDataURL),Ie.toString=e.bind(null,function(t,l,f){return n.render(t,f)}),Ie}var Wn=Jn();const Qn=gn(Wn),Xn={class:"device-overview"},Zn={class:"flex flex-wrap items-start gap-4 mcrm-block block__light"},ei={class:"flex items-center justify-between w-full gap-4 mb-4"},ti={class:"flex gap-4"},ni={class:"grid gap-2"},ii={class:"grid grid-cols-[auto_1fr] gap-2"},ri={class:"w-full truncate"},oi={class:"grid py-4"},si={class:"space-y-2"},ai={class:"grid gap-4 py-4 pl-6"},ui={key:0},li={class:"inline-flex items-center gap-2"},ci={class:"p-1 border rounded-sm"},di={class:"inline-flex flex-wrap items-center gap-2 w-fit"},fi={class:"flex items-center gap-1 p-1 text-sm border rounded-sm"},gi={class:"grid gap-4"},hi={class:"font-mono text-4xl tracking-wide"},wi={__name:"ServerView",setup(o){const r=en(),s=xe(),n=xe(),e=ft({ip:""}),t=ft({devices:[],pinlink:!1,poll:!1});tn(async()=>{r.serverGetRemotes(),r.$subscribe((g,i)=>{i.remote!==t.devices&&(t.devices=r.remote)}),l()}),nn(()=>{l(),Object.keys(t.devices).length==0&&!t.poll&&(t.poll=setInterval(()=>{r.serverGetRemotes()},1e3)),Object.keys(t.devices).length>0&&t.poll&&(clearInterval(t.poll),t.poll=!1)});async function l(){const g=await r.serverGetIP();e.ip=g,Qn.toCanvas(n.value,`${e.ip}/devices`,i=>{i&&console.log("QRCode error: ",i)})}async function f(g){const i=await r.serverStartLink(g);t.pinlink={uuid:g,pin:i},s.value.toggleDialog(!0),d(),setTimeout(()=>{b()},6e4)}function d(){const g=setInterval(()=>{ht.post(wt()+"/device/link/poll",{uuid:t.pinlink.uuid}).then(i=>{i.data||(clearInterval(g),b(),r.serverGetRemotes())})},1e3)}function b(){t.pinlink=!1,s.value&&s.value.toggleDialog(!1)}function m(g){ht.post(wt()+"/device/link/remove",{uuid:g}).then(i=>{i.data&&r.serverGetRemotes()})}return(g,i)=>(z(),re("div",Xn,[O(ce,{variant:"info"},{default:V(()=>[i[1]||(i[1]=B("strong",null,"This is a server!",-1)),B("em",null,"UUID: "+J(F(r).uuid()),1)]),_:1}),B("div",Zn,[B("h4",ei,[B("span",ti,[O(F(hn)),q(J(Object.keys(t.devices).length)+" "+J(Object.keys(t.devices).length==1?"Device":"Devices"),1)]),t.poll?j("",!0):(z(),G(we,{key:0,variant:"primary",onClick:i[0]||(i[0]=u=>F(r).serverGetRemotes())},{default:V(()=>[O(F(Re))]),_:1}))]),Object.keys(t.devices).length>0?(z(!0),re(Fe,{key:0},wn(t.devices,(u,a)=>(z(),re("div",{key:a,class:"mcrm-block block__dark block-size__sm w-64 grid !gap-4 content-start"},[B("div",ni,[B("h5",ii,[u.settings.type=="unknown"?(z(),G(F(An),{key:0})):j("",!0),u.settings.type=="mobile"?(z(),G(F(In),{key:1})):j("",!0),u.settings.type=="tablet"?(z(),G(F(Sn),{key:2})):j("",!0),u.settings.type=="desktop"?(z(),G(F(Cn),{key:3})):j("",!0),B("span",ri,J(u.settings.name),1)]),B("em",null,J(a),1)]),u.key?(z(),re(Fe,{key:0},[O(ce,{variant:"success"},{default:V(()=>i[2]||(i[2]=[q("Authorized")])),_:1}),O(we,{variant:"danger",onClick:c=>m(a)},{default:V(()=>[O(F(Mn)),i[3]||(i[3]=q("Unlink device "))]),_:2},1032,["onClick"])],64)):(z(),re(Fe,{key:1},[O(ce,{variant:"warning"},{default:V(()=>i[4]||(i[4]=[q("Unauthorized")])),_:1}),O(we,{variant:"primary",onClick:c=>f(a)},{default:V(()=>[O(F(gt)),i[5]||(i[5]=q("Link device "))]),_:2},1032,["onClick"])],64)),t.pinlink.uuid==a?(z(),G(ce,{key:2,variant:"info"},{default:V(()=>[q("One time pin: "+J(t.pinlink.pin),1)]),_:1})):j("",!0)]))),128)):j("",!0),O(En,{class:"w-full mt-8 border-t border-t-white/50",title:"How to connect a device?",open:Object.keys(t.devices).length==0},{default:V(()=>[B("div",oi,[B("ul",si,[B("li",null,[i[8]||(i[8]=q(" Scan the QR code with the remote device. ")),B("div",ai,[B("canvas",{ref_key:"serverQr",ref:n},null,512),B("p",null,[i[6]||(i[6]=q(" Or manually type the IP address: ")),i[7]||(i[7]=B("br",null,null,-1)),B("strong",null,J(e.ip)+"/devices",1)])])]),i[14]||(i[14]=B("li",null,' The device will automatically request access, if you see "Access requested" on the device. ',-1)),t.poll?j("",!0):(z(),re("li",ui,[B("div",li,[i[9]||(i[9]=q(" Click the ")),B("span",ci,[O(F(Re),{class:"size-4"})]),i[10]||(i[10]=q(" to reload the devices. "))])])),B("li",null,[B("div",di,[i[12]||(i[12]=q(" Click on ")),B("span",fi,[O(F(gt),{class:"size-4"}),i[11]||(i[11]=q(" Link device "))]),i[13]||(i[13]=q(" A one-time-pin will be shown in a dialog. "))])]),i[15]||(i[15]=B("li",null,"Enter the pin on the remote device.",-1)),i[16]||(i[16]=B("li",null," Congratulations! You have linked a device! You can now start using panels on that device. ",-1))])])]),_:1},8,["open"]),O(rn,{ref_key:"pinDialog",ref:s},{content:V(()=>[B("div",gi,[i[17]||(i[17]=B("h3",null,"Pin code",-1)),B("span",hi,J(t.pinlink.pin),1)])]),_:1},512)])]))}},pi=mt(wi,[["__scopeId","data-v-0a3f2b41"]]);var mi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bi(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var pt={exports:{}};(function(o,r){(function(s,n){var e="1.0.37",t="",l="?",f="function",d="undefined",b="object",m="string",g="major",i="model",u="name",a="type",c="vendor",h="version",E="architecture",N="console",p="mobile",w="tablet",D="smarttv",v="wearable",S="embedded",C=500,y="Amazon",A="Apple",I="ASUS",M="BlackBerry",k="Browser",_="Chrome",X="Edge",Z="Firefox",ye="Google",Se="Huawei",Ae="LG",fe="Microsoft",ge="Motorola",he="Opera",se="Samsung",Ne="Sharp",ae="Sony",ke="Xiaomi",$="Zebra",Y="Facebook",ne="Chromium OS",Ee="Mac OS",cn=function(P,x){var T={};for(var U in P)x[U]&&x[U].length%2===0?T[U]=x[U].concat(P[U]):T[U]=P[U];return T},Pe=function(P){for(var x={},T=0;T<P.length;T++)x[P[T].toUpperCase()]=P[T];return x},yt=function(P,x){return typeof P===m?Me(x).indexOf(Me(P))!==-1:!1},Me=function(P){return P.toLowerCase()},dn=function(P){return typeof P===m?P.replace(/[^\d\.]/g,t).split(".")[0]:n},qe=function(P,x){if(typeof P===m)return P=P.replace(/^\s\s*/,t),typeof x===d?P:P.substring(0,C)},Be=function(P,x){for(var T=0,U,ue,ee,L,R,ie;T<x.length&&!R;){var ze=x[T],Ct=x[T+1];for(U=ue=0;U<ze.length&&!R&&ze[U];)if(R=ze[U++].exec(P),R)for(ee=0;ee<Ct.length;ee++)ie=R[++ue],L=Ct[ee],typeof L===b&&L.length>0?L.length===2?typeof L[1]==f?this[L[0]]=L[1].call(this,ie):this[L[0]]=L[1]:L.length===3?typeof L[1]===f&&!(L[1].exec&&L[1].test)?this[L[0]]=ie?L[1].call(this,ie,L[2]):n:this[L[0]]=ie?ie.replace(L[1],L[2]):n:L.length===4&&(this[L[0]]=ie?L[3].call(this,ie.replace(L[1],L[2])):n):this[L]=ie||n;T+=2}},Oe=function(P,x){for(var T in x)if(typeof x[T]===b&&x[T].length>0){for(var U=0;U<x[T].length;U++)if(yt(x[T][U],P))return T===l?n:T}else if(yt(x[T],P))return T===l?n:T;return P},fn={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},kt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Et={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,h],[/opios[\/ ]+([\w\.]+)/i],[h,[u,he+" Mini"]],[/\bopr\/([\w\.]+)/i],[h,[u,he]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[h,[u,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[u,h],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[u,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[h,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[h,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[u,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[h,[u,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[h,[u,"Smart Lenovo "+k]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+k],h],[/\bfocus\/([\w\.]+)/i],[h,[u,Z+" Focus"]],[/\bopt\/([\w\.]+)/i],[h,[u,he+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[h,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[h,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[h,[u,he+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[h,[u,"MIUI "+k]],[/fxios\/([-\w\.]+)/i],[h,[u,Z]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+k]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+k],h],[/samsungbrowser\/([\w\.]+)/i],[h,[u,se+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],h],[/metasr[\/ ]?([\d\.]+)/i],[h,[u,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[u,"Sogou Mobile"],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[u,h],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,Y],h],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[u,h],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[u,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[h,[u,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[u,_+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,_+" WebView"],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[u,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,h],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[h,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[h,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[h,Oe,fn]],[/(webkit|khtml)\/([\w\.]+)/i],[u,h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[u,Z+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[u,h],[/(cobalt)\/([\w\.]+)/i],[u,[h,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[E,"amd64"]],[/(ia32(?=;))/i],[[E,Me]],[/((?:i[346]|x)86)[;\)]/i],[[E,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[E,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[E,"armhf"]],[/windows (ce|mobile); ppc;/i],[[E,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[E,/ower/,t,Me]],[/(sun4\w)[;\)]/i],[[E,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[E,Me]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[i,[c,se],[a,w]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[i,[c,se],[a,p]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[i,[c,A],[a,p]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[i,[c,A],[a,w]],[/(macintosh);/i],[i,[c,A]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[i,[c,Ne],[a,p]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[i,[c,Se],[a,w]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[i,[c,Se],[a,p]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[i,/_/g," "],[c,ke],[a,p]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[i,/_/g," "],[c,ke],[a,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[i,[c,"OPPO"],[a,p]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[i,[c,"Vivo"],[a,p]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[i,[c,"Realme"],[a,p]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[i,[c,ge],[a,p]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[i,[c,ge],[a,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[i,[c,Ae],[a,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[i,[c,Ae],[a,p]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[i,[c,"Lenovo"],[a,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[i,/_/g," "],[c,"Nokia"],[a,p]],[/(pixel c)\b/i],[i,[c,ye],[a,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[i,[c,ye],[a,p]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[i,[c,ae],[a,p]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[i,"Xperia Tablet"],[c,ae],[a,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[i,[c,"OnePlus"],[a,p]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[i,[c,y],[a,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[i,/(.+)/g,"Fire Phone $1"],[c,y],[a,p]],[/(playbook);[-\w\),; ]+(rim)/i],[i,c,[a,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[i,[c,M],[a,p]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[i,[c,I],[a,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[i,[c,I],[a,p]],[/(nexus 9)/i],[i,[c,"HTC"],[a,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[c,[i,/_/g," "],[a,p]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[i,[c,"Acer"],[a,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[i,[c,"Meizu"],[a,p]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[i,[c,"Ulefone"],[a,p]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[c,i,[a,p]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[c,i,[a,w]],[/(surface duo)/i],[i,[c,fe],[a,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[i,[c,"Fairphone"],[a,p]],[/(u304aa)/i],[i,[c,"AT&T"],[a,p]],[/\bsie-(\w*)/i],[i,[c,"Siemens"],[a,p]],[/\b(rct\w+) b/i],[i,[c,"RCA"],[a,w]],[/\b(venue[\d ]{2,7}) b/i],[i,[c,"Dell"],[a,w]],[/\b(q(?:mv|ta)\w+) b/i],[i,[c,"Verizon"],[a,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[i,[c,"Barnes & Noble"],[a,w]],[/\b(tm\d{3}\w+) b/i],[i,[c,"NuVision"],[a,w]],[/\b(k88) b/i],[i,[c,"ZTE"],[a,w]],[/\b(nx\d{3}j) b/i],[i,[c,"ZTE"],[a,p]],[/\b(gen\d{3}) b.+49h/i],[i,[c,"Swiss"],[a,p]],[/\b(zur\d{3}) b/i],[i,[c,"Swiss"],[a,w]],[/\b((zeki)?tb.*\b) b/i],[i,[c,"Zeki"],[a,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[c,"Dragon Touch"],i,[a,w]],[/\b(ns-?\w{0,9}) b/i],[i,[c,"Insignia"],[a,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[i,[c,"NextBook"],[a,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[c,"Voice"],i,[a,p]],[/\b(lvtel\-)?(v1[12]) b/i],[[c,"LvTel"],i,[a,p]],[/\b(ph-1) /i],[i,[c,"Essential"],[a,p]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[i,[c,"Envizen"],[a,w]],[/\b(trio[-\w\. ]+) b/i],[i,[c,"MachSpeed"],[a,w]],[/\btu_(1491) b/i],[i,[c,"Rotor"],[a,w]],[/(shield[\w ]+) b/i],[i,[c,"Nvidia"],[a,w]],[/(sprint) (\w+)/i],[c,i,[a,p]],[/(kin\.[onetw]{3})/i],[[i,/\./g," "],[c,fe],[a,p]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[i,[c,$],[a,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[i,[c,$],[a,p]],[/smart-tv.+(samsung)/i],[c,[a,D]],[/hbbtv.+maple;(\d+)/i],[[i,/^/,"SmartTV"],[c,se],[a,D]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[c,Ae],[a,D]],[/(apple) ?tv/i],[c,[i,A+" TV"],[a,D]],[/crkey/i],[[i,_+"cast"],[c,ye],[a,D]],[/droid.+aft(\w+)( bui|\))/i],[i,[c,y],[a,D]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[i,[c,Ne],[a,D]],[/(bravia[\w ]+)( bui|\))/i],[i,[c,ae],[a,D]],[/(mitv-\w{5}) bui/i],[i,[c,ke],[a,D]],[/Hbbtv.*(technisat) (.*);/i],[c,i,[a,D]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[c,qe],[i,qe],[a,D]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[a,D]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[c,i,[a,N]],[/droid.+; (shield) bui/i],[i,[c,"Nvidia"],[a,N]],[/(playstation [345portablevi]+)/i],[i,[c,ae],[a,N]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[i,[c,fe],[a,N]],[/((pebble))app/i],[c,i,[a,v]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[i,[c,A],[a,v]],[/droid.+; (glass) \d/i],[i,[c,ye],[a,v]],[/droid.+; (wt63?0{2,3})\)/i],[i,[c,$],[a,v]],[/(quest( 2| pro)?)/i],[i,[c,Y],[a,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[c,[a,S]],[/(aeobc)\b/i],[i,[c,y],[a,S]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[i,[a,p]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[i,[a,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[a,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[a,p]],[/(android[-\w\. ]{0,9});.+buil/i],[i,[c,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[u,X+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[u,h],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[h,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,h],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[u,[h,Oe,kt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[h,Oe,kt],[u,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,Ee],[h,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[h,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,h],[/\(bb(10);/i],[h,[u,M]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[h,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[u,Z+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[h,[u,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[h,[u,"watchOS"]],[/crkey\/([\d\.]+)/i],[h,[u,_+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[u,ne],h],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,h],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],h],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[u,h]]},Q=function(P,x){if(typeof P===b&&(x=P,P=n),!(this instanceof Q))return new Q(P,x).getResult();var T=typeof s!==d&&s.navigator?s.navigator:n,U=P||(T&&T.userAgent?T.userAgent:t),ue=T&&T.userAgentData?T.userAgentData:n,ee=x?cn(Et,x):Et,L=T&&T.userAgent==U;return this.getBrowser=function(){var R={};return R[u]=n,R[h]=n,Be.call(R,U,ee.browser),R[g]=dn(R[h]),L&&T&&T.brave&&typeof T.brave.isBrave==f&&(R[u]="Brave"),R},this.getCPU=function(){var R={};return R[E]=n,Be.call(R,U,ee.cpu),R},this.getDevice=function(){var R={};return R[c]=n,R[i]=n,R[a]=n,Be.call(R,U,ee.device),L&&!R[a]&&ue&&ue.mobile&&(R[a]=p),L&&R[i]=="Macintosh"&&T&&typeof T.standalone!==d&&T.maxTouchPoints&&T.maxTouchPoints>2&&(R[i]="iPad",R[a]=w),R},this.getEngine=function(){var R={};return R[u]=n,R[h]=n,Be.call(R,U,ee.engine),R},this.getOS=function(){var R={};return R[u]=n,R[h]=n,Be.call(R,U,ee.os),L&&!R[u]&&ue&&ue.platform!="Unknown"&&(R[u]=ue.platform.replace(/chrome os/i,ne).replace(/macos/i,Ee)),R},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return U},this.setUA=function(R){return U=typeof R===m&&R.length>C?qe(R,C):R,this},this.setUA(U),this};Q.VERSION=e,Q.BROWSER=Pe([u,h,g]),Q.CPU=Pe([E]),Q.DEVICE=Pe([i,c,a,N,p,D,w,v,S]),Q.ENGINE=Q.OS=Pe([u,h]),o.exports&&(r=o.exports=Q),r.UAParser=Q;var Ce=typeof s!==d&&(s.jQuery||s.Zepto);if(Ce&&!Ce.ua){var De=new Q;Ce.ua=De.getResult(),Ce.ua.get=function(){return De.getUA()},Ce.ua.set=function(P){De.setUA(P);var x=De.getResult();for(var T in x)Ce.ua[T]=x[T]}}})(typeof window=="object"?window:mi)})(pt,pt.exports);var vi=pt.exports;const yi=bi(vi),oe={CONSOLE:"console",DESKTOP:void 0,EMBEDDED:"embedded",MOBILE:"mobile",SMART_TV:"smarttv",TABLET:"tablet",WEARABLE:"wearable"},ve={ANDROID:"Android",IOS:"iOS",LINUX:"Linux",MAC_OS:"Mac OS",WINDOWS_PHONE:"Windows Phone",WINDOWS:"Windows"},H={CHROME:"Chrome",CHROMIUM:"Chromium",EDGE:"Edge",FIREFOX:"Firefox",IE:"IE",INTERNET_EXPLORER:"Internet Explorer",MIUI:"MIUI Browser",MOBILE_SAFARI:"Mobile Safari",OPERA:"Opera",SAFARI:"Safari",SAMSUNG_BROWSER:"Samsung Browser",YANDEX:"Yandex"},Te=new yi,W=Te.getDevice(),de=Te.getOS(),K=Te.getBrowser();Te.getEngine();const vt=Te.getUA(),Ue=()=>/iPad/.test(vt),ln=()=>de.name===ve.WINDOWS&&de.version==="10"&&vt.indexOf("Edg/")!==-1;de.name,ve.ANDROID;K.name,H.CHROME;K.name,H.CHROMIUM;W.type,oe.CONSOLE;W.type,oe.DESKTOP;K.name===H.EDGE||ln();ln();K.name,H.EDGE;/electron/.test(vt.toLowerCase());W.type,oe.EMBEDDED;K.name,H.FIREFOX;K.name===H.INTERNET_EXPLORER||(K.name,H.IE);de.name===ve.IOS||Ue();de.name,ve.LINUX;de.name,ve.MAC_OS;K.name,H.MIUI;W.type===oe.MOBILE||W.type===oe.TABLET||Ue();W.type,oe.MOBILE;K.name===H.MOBILE_SAFARI||Ue();K.name,H.OPERA;K.name===H.SAFARI||(K.name,H.MOBILE_SAFARI);K.name,H.SAMSUNG_BROWSER;W.type,oe.SMART_TV;W.type===oe.TABLET||Ue();W.type,oe.WEARABLE;de.name,ve.WINDOWS;de.name,ve.WINDOWS_PHONE;K.name,H.YANDEX;const ki=()=>W.model,Zt=()=>W.type||"desktop",dt=()=>W.vendor,Ei={class:"server-overview"},Ci={class:"grid gap-4 mcrm-block block__light"},Ii={class:"flex items-center justify-between gap-4 text-lg"},Si={class:"flex gap-4"},Ai={class:"grid gap-2"},Mi={class:"mb-4"},Bi={class:"font-semibold"},_i={class:"inline-flex flex-wrap items-center gap-2 w-fit"},Ri={class:"flex items-center gap-1 p-1 text-sm border rounded-sm"},Ti={key:0,class:"grid grid-cols-[2rem_1fr] gap-2"},Ni={class:"grid w-64 gap-4"},Pi={__name:"RemoteView",setup(o){const r=en(),s=xe(),n=xe(),e=ft({host:"",port:window.__CONFIG__.MCRM__PORT,status:!1,link:!1,inputPin:"",encryptedKey:"",key:""});tn(async()=>{e.host=window.location.host}),nn(()=>{e.status||t(),e.status==="authorized"&&e.inputPin&&(e.inputPin="")});async function t(m=!0){const g=await r.remoteCheckServerAccess();return e.status=g,g==="unlinked"||g==="unauthorized"?(m&&l(),!0):r.key()?(await r.remoteHandshake(r.key())?e.key=r.key():(r.removeDeviceKey(),e.status="unlinked",m&&l()),!0):(e.status="unauthorized",!0)}function l(){let m=`${dt()?dt():"Unknown"} ${dt()?ki():Zt()}`;r.remoteRequestServerAccess(m,Zt()).then(g=>{g.data&&(e.status=g.data,f())})}function f(){e.link="checking",r.remotePingLink(m=>{e.link=!0,e.encryptedKey=m,s.value.toggleDialog(!0),n.value.focus()})}async function d(){const m=kn(e.inputPin,e.encryptedKey);await r.remoteHandshake(m)&&(r.setDeviceKey(m),e.key=m,s.value.toggleDialog(!1),e.status="authorized")}function b(){ht.post(wt()+"/device/link/remove",yn({uuid:r.uuid()})).then(m=>{m.data&&t(!1)})}return(m,g)=>(z(),re("div",Ei,[O(ce,{variant:"info"},{default:V(()=>[g[5]||(g[5]=B("strong",null,"This is a remote device.",-1)),B("em",null,"UUID: "+J(F(r).uuid()),1)]),_:1}),B("div",Ci,[B("h4",Ii,[B("span",Si,[O(F(pn)),g[6]||(g[6]=q("Server"))]),O(we,{variant:"primary",onClick:g[0]||(g[0]=i=>t())},{default:V(()=>[O(F(Re))]),_:1})]),B("p",null,[g[7]||(g[7]=q(" Connected to: ")),B("strong",null,J(e.host),1)]),e.status==="authorized"?(z(),G(ce,{key:0,variant:"success"},{default:V(()=>g[8]||(g[8]=[q("Authorized")])),_:1})):j("",!0),e.status==="unlinked"?(z(),G(ce,{key:1,variant:"warning"},{default:V(()=>g[9]||(g[9]=[q("Not linked")])),_:1})):j("",!0),e.status==="unauthorized"?(z(),G(ce,{key:2,variant:"info"},{default:V(()=>[B("div",Ai,[g[17]||(g[17]=B("strong",null,"Access requested",-1)),B("ul",Mi,[B("li",null,[g[10]||(g[10]=q(" Navigate to ")),B("em",Bi,"http://localhost:"+J(e.port)+"/devices",1),g[11]||(g[11]=q(". "))]),B("li",null,[B("div",_i,[g[13]||(g[13]=q(" Click on ")),B("span",Ri,[O(F(gt),{class:"size-4"}),g[12]||(g[12]=q(" Link device "))])])]),g[14]||(g[14]=B("li",null,"Enter the the pin shown on the desktop in the dialog that will appear.",-1))]),e.link=="checking"?(z(),re("div",Ti,[O(F(Re),{class:"animate-spin"}),g[15]||(g[15]=q(" Checking server for link... "))])):j("",!0),e.link===!1?(z(),G(we,{key:1,variant:"subtle",onClick:g[1]||(g[1]=i=>f()),class:"w-fit"},{default:V(()=>[O(F(Re)),g[16]||(g[16]=q("Check for server link "))]),_:1})):j("",!0)])]),_:1})):j("",!0),e.status==="authorized"?(z(),G(we,{key:3,variant:"danger",onClick:g[2]||(g[2]=i=>b())},{default:V(()=>[O(F(Bn)),g[18]||(g[18]=q(" Disconnect "))]),_:1})):j("",!0)]),O(rn,{ref_key:"linkPinDialog",ref:s},{content:V(()=>[B("div",Ni,[g[20]||(g[20]=B("h3",null,"Server link pin:",-1)),B("form",{class:"grid gap-4",onSubmit:g[4]||(g[4]=mn(i=>d(),["prevent"]))},[bn(B("input",{ref_key:"linkPinInput",ref:n,class:"input",id:"input-pin",type:"text",pattern:"[0-9]{4}","onUpdate:modelValue":g[3]||(g[3]=i=>e.inputPin=i),autocomplete:"off"},null,512),[[vn,e.inputPin]]),O(we,{variant:"primary"},{default:V(()=>g[19]||(g[19]=[q("Enter")])),_:1})],32)])]),_:1},512)]))}},Di=mt(Pi,[["__scopeId","data-v-6973a9f0"]]),Li={id:"devices-view",class:"panel"},xi={class:"panel__title"},Ui={class:"grid gap-8 pr-2 panel__content"},qi={__name:"DevicesView",setup(o){return(r,s)=>(z(),re("div",Li,[B("h1",xi,J(F(It)()?"Remote devices":"Server"),1),B("div",Ui,[F(It)()?(z(),G(pi,{key:0})):(z(),G(Di,{key:1}))])]))}},Vi=mt(qi,[["__scopeId","data-v-860af40f"]]);export{Vi as default};
|
|
//# sourceMappingURL=DevicesView-C9HVDkwf.js.map
|