9remote 0.1.58 → 0.1.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cli/index.js CHANGED
@@ -10,7 +10,7 @@ import fs from "fs";
10
10
  import os from "os";
11
11
  import { getConsistentMachineId } from "./utils/machineId.js";
12
12
  import { generateApiKeyWithMachine } from "./utils/apiKey.js";
13
- import { loadKey, saveKey, loadState, saveState, clearState, readAndClearCmd } from "./utils/state.js";
13
+ import { loadKey, saveKey, loadState, saveState, clearState, readAndClearCmd, writeCmd } from "./utils/state.js";
14
14
  import { createTempKey } from "./utils/token.js";
15
15
  import { checkAndUpdate, checkLatestVersion } from "./utils/updateChecker.js";
16
16
  import { spawnQuickTunnel, killCloudflared, resetRestartCounter, ensureCloudflared } from "./utils/cloudflared.js";
package/dist/cli.cjs CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  const __importMetaUrl = require('url').pathToFileURL(__filename).href;
3
- var zn=Object.create;var Dt=Object.defineProperty;var Zn=Object.getOwnPropertyDescriptor;var er=Object.getOwnPropertyNames;var tr=Object.getPrototypeOf,nr=Object.prototype.hasOwnProperty;var Y=(r,n)=>()=>(n||r((n={exports:{}}).exports,n),n.exports);var rr=(r,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of er(n))!nr.call(r,e)&&e!==t&&Dt(r,e,{get:()=>n[e],enumerable:!(o=Zn(n,e))||o.enumerable});return r};var M=(r,n,t)=>(t=r!=null?zn(tr(r)):{},rr(n||!r||!r.__esModule?Dt(t,"default",{value:r,enumerable:!0}):t,r));var pt=Y((vo,qt)=>{qt.exports={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}});var Zt=Y((wo,zt)=>{var vr=pt();function Xt(r){this.mode=vr.MODE_8BIT_BYTE,this.data=r}Xt.prototype={getLength:function(){return this.data.length},write:function(r){for(var n=0;n<this.data.length;n++)r.put(this.data.charCodeAt(n),8)}};zt.exports=Xt});var dt=Y((To,en)=>{var ee={glog:function(r){if(r<1)throw new Error("glog("+r+")");return ee.LOG_TABLE[r]},gexp:function(r){for(;r<0;)r+=255;for(;r>=256;)r-=255;return ee.EXP_TABLE[r]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for($=0;$<8;$++)ee.EXP_TABLE[$]=1<<$;var $;for($=8;$<256;$++)ee.EXP_TABLE[$]=ee.EXP_TABLE[$-4]^ee.EXP_TABLE[$-5]^ee.EXP_TABLE[$-6]^ee.EXP_TABLE[$-8];var $;for($=0;$<255;$++)ee.LOG_TABLE[ee.EXP_TABLE[$]]=$;var $;en.exports=ee});var ht=Y((Eo,tn)=>{var pe=dt();function Ye(r,n){if(r.length===void 0)throw new Error(r.length+"/"+n);for(var t=0;t<r.length&&r[t]===0;)t++;this.num=new Array(r.length-t+n);for(var o=0;o<r.length-t;o++)this.num[o]=r[o+t]}Ye.prototype={get:function(r){return this.num[r]},getLength:function(){return this.num.length},multiply:function(r){for(var n=new Array(this.getLength()+r.getLength()-1),t=0;t<this.getLength();t++)for(var o=0;o<r.getLength();o++)n[t+o]^=pe.gexp(pe.glog(this.get(t))+pe.glog(r.get(o)));return new Ye(n,0)},mod:function(r){if(this.getLength()-r.getLength()<0)return this;for(var n=pe.glog(this.get(0))-pe.glog(r.get(0)),t=new Array(this.getLength()),o=0;o<this.getLength();o++)t[o]=this.get(o);for(var e=0;e<r.getLength();e++)t[e]^=pe.gexp(pe.glog(r.get(e))+n);return new Ye(t,0).mod(r)}};tn.exports=Ye});var rn=Y((bo,nn)=>{nn.exports={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7}});var an=Y((_o,sn)=>{var J=pt(),on=ht(),wr=dt(),ce=rn(),j={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(r){for(var n=r<<10;j.getBCHDigit(n)-j.getBCHDigit(j.G15)>=0;)n^=j.G15<<j.getBCHDigit(n)-j.getBCHDigit(j.G15);return(r<<10|n)^j.G15_MASK},getBCHTypeNumber:function(r){for(var n=r<<12;j.getBCHDigit(n)-j.getBCHDigit(j.G18)>=0;)n^=j.G18<<j.getBCHDigit(n)-j.getBCHDigit(j.G18);return r<<12|n},getBCHDigit:function(r){for(var n=0;r!==0;)n++,r>>>=1;return n},getPatternPosition:function(r){return j.PATTERN_POSITION_TABLE[r-1]},getMask:function(r,n,t){switch(r){case ce.PATTERN000:return(n+t)%2===0;case ce.PATTERN001:return n%2===0;case ce.PATTERN010:return t%3===0;case ce.PATTERN011:return(n+t)%3===0;case ce.PATTERN100:return(Math.floor(n/2)+Math.floor(t/3))%2===0;case ce.PATTERN101:return n*t%2+n*t%3===0;case ce.PATTERN110:return(n*t%2+n*t%3)%2===0;case ce.PATTERN111:return(n*t%3+(n+t)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}},getErrorCorrectPolynomial:function(r){for(var n=new on([1],0),t=0;t<r;t++)n=n.multiply(new on([1,wr.gexp(t)],0));return n},getLengthInBits:function(r,n){if(1<=n&&n<10)switch(r){case J.MODE_NUMBER:return 10;case J.MODE_ALPHA_NUM:return 9;case J.MODE_8BIT_BYTE:return 8;case J.MODE_KANJI:return 8;default:throw new Error("mode:"+r)}else if(n<27)switch(r){case J.MODE_NUMBER:return 12;case J.MODE_ALPHA_NUM:return 11;case J.MODE_8BIT_BYTE:return 16;case J.MODE_KANJI:return 10;default:throw new Error("mode:"+r)}else if(n<41)switch(r){case J.MODE_NUMBER:return 14;case J.MODE_ALPHA_NUM:return 13;case J.MODE_8BIT_BYTE:return 16;case J.MODE_KANJI:return 12;default:throw new Error("mode:"+r)}else throw new Error("type:"+n)},getLostPoint:function(r){var n=r.getModuleCount(),t=0,o=0,e=0;for(o=0;o<n;o++)for(e=0;e<n;e++){for(var i=0,s=r.isDark(o,e),a=-1;a<=1;a++)if(!(o+a<0||n<=o+a))for(var c=-1;c<=1;c++)e+c<0||n<=e+c||a===0&&c===0||s===r.isDark(o+a,e+c)&&i++;i>5&&(t+=3+i-5)}for(o=0;o<n-1;o++)for(e=0;e<n-1;e++){var l=0;r.isDark(o,e)&&l++,r.isDark(o+1,e)&&l++,r.isDark(o,e+1)&&l++,r.isDark(o+1,e+1)&&l++,(l===0||l===4)&&(t+=3)}for(o=0;o<n;o++)for(e=0;e<n-6;e++)r.isDark(o,e)&&!r.isDark(o,e+1)&&r.isDark(o,e+2)&&r.isDark(o,e+3)&&r.isDark(o,e+4)&&!r.isDark(o,e+5)&&r.isDark(o,e+6)&&(t+=40);for(e=0;e<n;e++)for(o=0;o<n-6;o++)r.isDark(o,e)&&!r.isDark(o+1,e)&&r.isDark(o+2,e)&&r.isDark(o+3,e)&&r.isDark(o+4,e)&&!r.isDark(o+5,e)&&r.isDark(o+6,e)&&(t+=40);var u=0;for(e=0;e<n;e++)for(o=0;o<n;o++)r.isDark(o,e)&&u++;var f=Math.abs(100*u/n/n-50)/5;return t+=f*10,t}};sn.exports=j});var mt=Y((xo,cn)=>{cn.exports={L:1,M:0,Q:3,H:2}});var un=Y((So,ln)=>{var Ve=mt();function re(r,n){this.totalCount=r,this.dataCount=n}re.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];re.getRSBlocks=function(r,n){var t=re.getRsBlockTable(r,n);if(t===void 0)throw new Error("bad rs block @ typeNumber:"+r+"/errorCorrectLevel:"+n);for(var o=t.length/3,e=[],i=0;i<o;i++)for(var s=t[i*3+0],a=t[i*3+1],c=t[i*3+2],l=0;l<s;l++)e.push(new re(a,c));return e};re.getRsBlockTable=function(r,n){switch(n){case Ve.L:return re.RS_BLOCK_TABLE[(r-1)*4+0];case Ve.M:return re.RS_BLOCK_TABLE[(r-1)*4+1];case Ve.Q:return re.RS_BLOCK_TABLE[(r-1)*4+2];case Ve.H:return re.RS_BLOCK_TABLE[(r-1)*4+3];default:return}};ln.exports=re});var dn=Y((ko,pn)=>{function fn(){this.buffer=[],this.length=0}fn.prototype={get:function(r){var n=Math.floor(r/8);return(this.buffer[n]>>>7-r%8&1)==1},put:function(r,n){for(var t=0;t<n;t++)this.putBit((r>>>n-t-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(r){var n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),r&&(this.buffer[n]|=128>>>this.length%8),this.length++}};pn.exports=fn});var yn=Y((Ro,gn)=>{var Tr=Zt(),le=an(),Er=ht(),hn=un(),mn=dn();function oe(r,n){this.typeNumber=r,this.errorCorrectLevel=n,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}oe.prototype={addData:function(r){var n=new Tr(r);this.dataList.push(n),this.dataCache=null},isDark:function(r,n){if(r<0||this.moduleCount<=r||n<0||this.moduleCount<=n)throw new Error(r+","+n);return this.modules[r][n]},getModuleCount:function(){return this.moduleCount},make:function(){if(this.typeNumber<1){var r=1;for(r=1;r<40;r++){for(var n=hn.getRSBlocks(r,this.errorCorrectLevel),t=new mn,o=0,e=0;e<n.length;e++)o+=n[e].dataCount;for(var i=0;i<this.dataList.length;i++){var s=this.dataList[i];t.put(s.mode,4),t.put(s.getLength(),le.getLengthInBits(s.mode,r)),s.write(t)}if(t.getLengthInBits()<=o*8)break}this.typeNumber=r}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(r,n){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var t=0;t<this.moduleCount;t++){this.modules[t]=new Array(this.moduleCount);for(var o=0;o<this.moduleCount;o++)this.modules[t][o]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(r,n),this.typeNumber>=7&&this.setupTypeNumber(r),this.dataCache===null&&(this.dataCache=oe.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,n)},setupPositionProbePattern:function(r,n){for(var t=-1;t<=7;t++)if(!(r+t<=-1||this.moduleCount<=r+t))for(var o=-1;o<=7;o++)n+o<=-1||this.moduleCount<=n+o||(0<=t&&t<=6&&(o===0||o===6)||0<=o&&o<=6&&(t===0||t===6)||2<=t&&t<=4&&2<=o&&o<=4?this.modules[r+t][n+o]=!0:this.modules[r+t][n+o]=!1)},getBestMaskPattern:function(){for(var r=0,n=0,t=0;t<8;t++){this.makeImpl(!0,t);var o=le.getLostPoint(this);(t===0||r>o)&&(r=o,n=t)}return n},createMovieClip:function(r,n,t){var o=r.createEmptyMovieClip(n,t),e=1;this.make();for(var i=0;i<this.modules.length;i++)for(var s=i*e,a=0;a<this.modules[i].length;a++){var c=a*e,l=this.modules[i][a];l&&(o.beginFill(0,100),o.moveTo(c,s),o.lineTo(c+e,s),o.lineTo(c+e,s+e),o.lineTo(c,s+e),o.endFill())}return o},setupTimingPattern:function(){for(var r=8;r<this.moduleCount-8;r++)this.modules[r][6]===null&&(this.modules[r][6]=r%2===0);for(var n=8;n<this.moduleCount-8;n++)this.modules[6][n]===null&&(this.modules[6][n]=n%2===0)},setupPositionAdjustPattern:function(){for(var r=le.getPatternPosition(this.typeNumber),n=0;n<r.length;n++)for(var t=0;t<r.length;t++){var o=r[n],e=r[t];if(this.modules[o][e]===null)for(var i=-2;i<=2;i++)for(var s=-2;s<=2;s++)Math.abs(i)===2||Math.abs(s)===2||i===0&&s===0?this.modules[o+i][e+s]=!0:this.modules[o+i][e+s]=!1}},setupTypeNumber:function(r){for(var n=le.getBCHTypeNumber(this.typeNumber),t,o=0;o<18;o++)t=!r&&(n>>o&1)===1,this.modules[Math.floor(o/3)][o%3+this.moduleCount-8-3]=t;for(var e=0;e<18;e++)t=!r&&(n>>e&1)===1,this.modules[e%3+this.moduleCount-8-3][Math.floor(e/3)]=t},setupTypeInfo:function(r,n){for(var t=this.errorCorrectLevel<<3|n,o=le.getBCHTypeInfo(t),e,i=0;i<15;i++)e=!r&&(o>>i&1)===1,i<6?this.modules[i][8]=e:i<8?this.modules[i+1][8]=e:this.modules[this.moduleCount-15+i][8]=e;for(var s=0;s<15;s++)e=!r&&(o>>s&1)===1,s<8?this.modules[8][this.moduleCount-s-1]=e:s<9?this.modules[8][15-s-1+1]=e:this.modules[8][15-s-1]=e;this.modules[this.moduleCount-8][8]=!r},mapData:function(r,n){for(var t=-1,o=this.moduleCount-1,e=7,i=0,s=this.moduleCount-1;s>0;s-=2)for(s===6&&s--;;){for(var a=0;a<2;a++)if(this.modules[o][s-a]===null){var c=!1;i<r.length&&(c=(r[i]>>>e&1)===1);var l=le.getMask(n,o,s-a);l&&(c=!c),this.modules[o][s-a]=c,e--,e===-1&&(i++,e=7)}if(o+=t,o<0||this.moduleCount<=o){o-=t,t=-t;break}}}};oe.PAD0=236;oe.PAD1=17;oe.createData=function(r,n,t){for(var o=hn.getRSBlocks(r,n),e=new mn,i=0;i<t.length;i++){var s=t[i];e.put(s.mode,4),e.put(s.getLength(),le.getLengthInBits(s.mode,r)),s.write(e)}for(var a=0,c=0;c<o.length;c++)a+=o[c].dataCount;if(e.getLengthInBits()>a*8)throw new Error("code length overflow. ("+e.getLengthInBits()+">"+a*8+")");for(e.getLengthInBits()+4<=a*8&&e.put(0,4);e.getLengthInBits()%8!==0;)e.putBit(!1);for(;!(e.getLengthInBits()>=a*8||(e.put(oe.PAD0,8),e.getLengthInBits()>=a*8));)e.put(oe.PAD1,8);return oe.createBytes(e,o)};oe.createBytes=function(r,n){for(var t=0,o=0,e=0,i=new Array(n.length),s=new Array(n.length),a=0;a<n.length;a++){var c=n[a].dataCount,l=n[a].totalCount-c;o=Math.max(o,c),e=Math.max(e,l),i[a]=new Array(c);for(var u=0;u<i[a].length;u++)i[a][u]=255&r.buffer[u+t];t+=c;var f=le.getErrorCorrectPolynomial(l),d=new Er(i[a],f.getLength()-1),h=d.mod(f);s[a]=new Array(f.getLength()-1);for(var p=0;p<s[a].length;p++){var g=p+h.getLength()-s[a].length;s[a][p]=g>=0?h.get(g):0}}for(var T=0,k=0;k<n.length;k++)T+=n[k].totalCount;for(var _=new Array(T),x=0,b=0;b<o;b++)for(var A=0;A<n.length;A++)b<i[A].length&&(_[x++]=i[A][b]);for(var w=0;w<e;w++)for(var R=0;R<n.length;R++)w<s[R].length&&(_[x++]=s[R][w]);return _};gn.exports=oe});var Tn=Y((Ao,wn)=>{var br=yn(),vn=mt(),_r="\x1B[40m \x1B[0m",Je="\x1B[47m \x1B[0m",xr=function(r){return r?_r:Je},gt=function(r){return{times:function(n){return new Array(n).join(r)}}},Sr=function(r,n){for(var t=new Array(r),o=0;o<r;o++)t[o]=n;return t};wn.exports={error:vn.L,generate:function(r,n,t){typeof n=="function"&&(t=n,n={});var o=new br(-1,this.error);o.addData(r),o.make();var e="";if(n&&n.small){var i=!0,s=!1,a=o.getModuleCount(),c=o.modules.slice(),l=a%2===1;l&&c.push(Sr(a,s));var u={WHITE_ALL:"\u2588",WHITE_BLACK:"\u2580",BLACK_WHITE:"\u2584",BLACK_ALL:" "},f=gt(u.BLACK_WHITE).times(a+3),d=gt(u.WHITE_BLACK).times(a+3);e+=f+`
3
+ var Zn=Object.create;var Dt=Object.defineProperty;var er=Object.getOwnPropertyDescriptor;var tr=Object.getOwnPropertyNames;var nr=Object.getPrototypeOf,rr=Object.prototype.hasOwnProperty;var V=(r,n)=>()=>(n||r((n={exports:{}}).exports,n),n.exports);var or=(r,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of tr(n))!rr.call(r,e)&&e!==t&&Dt(r,e,{get:()=>n[e],enumerable:!(o=er(n,e))||o.enumerable});return r};var M=(r,n,t)=>(t=r!=null?Zn(nr(r)):{},or(n||!r||!r.__esModule?Dt(t,"default",{value:r,enumerable:!0}):t,r));var ht=V((wo,qt)=>{qt.exports={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}});var Zt=V((To,zt)=>{var wr=ht();function Xt(r){this.mode=wr.MODE_8BIT_BYTE,this.data=r}Xt.prototype={getLength:function(){return this.data.length},write:function(r){for(var n=0;n<this.data.length;n++)r.put(this.data.charCodeAt(n),8)}};zt.exports=Xt});var mt=V((Eo,en)=>{var ee={glog:function(r){if(r<1)throw new Error("glog("+r+")");return ee.LOG_TABLE[r]},gexp:function(r){for(;r<0;)r+=255;for(;r>=256;)r-=255;return ee.EXP_TABLE[r]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for($=0;$<8;$++)ee.EXP_TABLE[$]=1<<$;var $;for($=8;$<256;$++)ee.EXP_TABLE[$]=ee.EXP_TABLE[$-4]^ee.EXP_TABLE[$-5]^ee.EXP_TABLE[$-6]^ee.EXP_TABLE[$-8];var $;for($=0;$<255;$++)ee.LOG_TABLE[ee.EXP_TABLE[$]]=$;var $;en.exports=ee});var gt=V((bo,tn)=>{var pe=mt();function Ye(r,n){if(r.length===void 0)throw new Error(r.length+"/"+n);for(var t=0;t<r.length&&r[t]===0;)t++;this.num=new Array(r.length-t+n);for(var o=0;o<r.length-t;o++)this.num[o]=r[o+t]}Ye.prototype={get:function(r){return this.num[r]},getLength:function(){return this.num.length},multiply:function(r){for(var n=new Array(this.getLength()+r.getLength()-1),t=0;t<this.getLength();t++)for(var o=0;o<r.getLength();o++)n[t+o]^=pe.gexp(pe.glog(this.get(t))+pe.glog(r.get(o)));return new Ye(n,0)},mod:function(r){if(this.getLength()-r.getLength()<0)return this;for(var n=pe.glog(this.get(0))-pe.glog(r.get(0)),t=new Array(this.getLength()),o=0;o<this.getLength();o++)t[o]=this.get(o);for(var e=0;e<r.getLength();e++)t[e]^=pe.gexp(pe.glog(r.get(e))+n);return new Ye(t,0).mod(r)}};tn.exports=Ye});var rn=V((_o,nn)=>{nn.exports={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7}});var an=V((xo,sn)=>{var q=ht(),on=gt(),Tr=mt(),ce=rn(),j={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(r){for(var n=r<<10;j.getBCHDigit(n)-j.getBCHDigit(j.G15)>=0;)n^=j.G15<<j.getBCHDigit(n)-j.getBCHDigit(j.G15);return(r<<10|n)^j.G15_MASK},getBCHTypeNumber:function(r){for(var n=r<<12;j.getBCHDigit(n)-j.getBCHDigit(j.G18)>=0;)n^=j.G18<<j.getBCHDigit(n)-j.getBCHDigit(j.G18);return r<<12|n},getBCHDigit:function(r){for(var n=0;r!==0;)n++,r>>>=1;return n},getPatternPosition:function(r){return j.PATTERN_POSITION_TABLE[r-1]},getMask:function(r,n,t){switch(r){case ce.PATTERN000:return(n+t)%2===0;case ce.PATTERN001:return n%2===0;case ce.PATTERN010:return t%3===0;case ce.PATTERN011:return(n+t)%3===0;case ce.PATTERN100:return(Math.floor(n/2)+Math.floor(t/3))%2===0;case ce.PATTERN101:return n*t%2+n*t%3===0;case ce.PATTERN110:return(n*t%2+n*t%3)%2===0;case ce.PATTERN111:return(n*t%3+(n+t)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}},getErrorCorrectPolynomial:function(r){for(var n=new on([1],0),t=0;t<r;t++)n=n.multiply(new on([1,Tr.gexp(t)],0));return n},getLengthInBits:function(r,n){if(1<=n&&n<10)switch(r){case q.MODE_NUMBER:return 10;case q.MODE_ALPHA_NUM:return 9;case q.MODE_8BIT_BYTE:return 8;case q.MODE_KANJI:return 8;default:throw new Error("mode:"+r)}else if(n<27)switch(r){case q.MODE_NUMBER:return 12;case q.MODE_ALPHA_NUM:return 11;case q.MODE_8BIT_BYTE:return 16;case q.MODE_KANJI:return 10;default:throw new Error("mode:"+r)}else if(n<41)switch(r){case q.MODE_NUMBER:return 14;case q.MODE_ALPHA_NUM:return 13;case q.MODE_8BIT_BYTE:return 16;case q.MODE_KANJI:return 12;default:throw new Error("mode:"+r)}else throw new Error("type:"+n)},getLostPoint:function(r){var n=r.getModuleCount(),t=0,o=0,e=0;for(o=0;o<n;o++)for(e=0;e<n;e++){for(var i=0,s=r.isDark(o,e),a=-1;a<=1;a++)if(!(o+a<0||n<=o+a))for(var c=-1;c<=1;c++)e+c<0||n<=e+c||a===0&&c===0||s===r.isDark(o+a,e+c)&&i++;i>5&&(t+=3+i-5)}for(o=0;o<n-1;o++)for(e=0;e<n-1;e++){var l=0;r.isDark(o,e)&&l++,r.isDark(o+1,e)&&l++,r.isDark(o,e+1)&&l++,r.isDark(o+1,e+1)&&l++,(l===0||l===4)&&(t+=3)}for(o=0;o<n;o++)for(e=0;e<n-6;e++)r.isDark(o,e)&&!r.isDark(o,e+1)&&r.isDark(o,e+2)&&r.isDark(o,e+3)&&r.isDark(o,e+4)&&!r.isDark(o,e+5)&&r.isDark(o,e+6)&&(t+=40);for(e=0;e<n;e++)for(o=0;o<n-6;o++)r.isDark(o,e)&&!r.isDark(o+1,e)&&r.isDark(o+2,e)&&r.isDark(o+3,e)&&r.isDark(o+4,e)&&!r.isDark(o+5,e)&&r.isDark(o+6,e)&&(t+=40);var u=0;for(e=0;e<n;e++)for(o=0;o<n;o++)r.isDark(o,e)&&u++;var f=Math.abs(100*u/n/n-50)/5;return t+=f*10,t}};sn.exports=j});var yt=V((So,cn)=>{cn.exports={L:1,M:0,Q:3,H:2}});var un=V((ko,ln)=>{var Ve=yt();function re(r,n){this.totalCount=r,this.dataCount=n}re.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];re.getRSBlocks=function(r,n){var t=re.getRsBlockTable(r,n);if(t===void 0)throw new Error("bad rs block @ typeNumber:"+r+"/errorCorrectLevel:"+n);for(var o=t.length/3,e=[],i=0;i<o;i++)for(var s=t[i*3+0],a=t[i*3+1],c=t[i*3+2],l=0;l<s;l++)e.push(new re(a,c));return e};re.getRsBlockTable=function(r,n){switch(n){case Ve.L:return re.RS_BLOCK_TABLE[(r-1)*4+0];case Ve.M:return re.RS_BLOCK_TABLE[(r-1)*4+1];case Ve.Q:return re.RS_BLOCK_TABLE[(r-1)*4+2];case Ve.H:return re.RS_BLOCK_TABLE[(r-1)*4+3];default:return}};ln.exports=re});var dn=V((Ro,pn)=>{function fn(){this.buffer=[],this.length=0}fn.prototype={get:function(r){var n=Math.floor(r/8);return(this.buffer[n]>>>7-r%8&1)==1},put:function(r,n){for(var t=0;t<n;t++)this.putBit((r>>>n-t-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(r){var n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),r&&(this.buffer[n]|=128>>>this.length%8),this.length++}};pn.exports=fn});var yn=V((Ao,gn)=>{var Er=Zt(),le=an(),br=gt(),hn=un(),mn=dn();function oe(r,n){this.typeNumber=r,this.errorCorrectLevel=n,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}oe.prototype={addData:function(r){var n=new Er(r);this.dataList.push(n),this.dataCache=null},isDark:function(r,n){if(r<0||this.moduleCount<=r||n<0||this.moduleCount<=n)throw new Error(r+","+n);return this.modules[r][n]},getModuleCount:function(){return this.moduleCount},make:function(){if(this.typeNumber<1){var r=1;for(r=1;r<40;r++){for(var n=hn.getRSBlocks(r,this.errorCorrectLevel),t=new mn,o=0,e=0;e<n.length;e++)o+=n[e].dataCount;for(var i=0;i<this.dataList.length;i++){var s=this.dataList[i];t.put(s.mode,4),t.put(s.getLength(),le.getLengthInBits(s.mode,r)),s.write(t)}if(t.getLengthInBits()<=o*8)break}this.typeNumber=r}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(r,n){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var t=0;t<this.moduleCount;t++){this.modules[t]=new Array(this.moduleCount);for(var o=0;o<this.moduleCount;o++)this.modules[t][o]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(r,n),this.typeNumber>=7&&this.setupTypeNumber(r),this.dataCache===null&&(this.dataCache=oe.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,n)},setupPositionProbePattern:function(r,n){for(var t=-1;t<=7;t++)if(!(r+t<=-1||this.moduleCount<=r+t))for(var o=-1;o<=7;o++)n+o<=-1||this.moduleCount<=n+o||(0<=t&&t<=6&&(o===0||o===6)||0<=o&&o<=6&&(t===0||t===6)||2<=t&&t<=4&&2<=o&&o<=4?this.modules[r+t][n+o]=!0:this.modules[r+t][n+o]=!1)},getBestMaskPattern:function(){for(var r=0,n=0,t=0;t<8;t++){this.makeImpl(!0,t);var o=le.getLostPoint(this);(t===0||r>o)&&(r=o,n=t)}return n},createMovieClip:function(r,n,t){var o=r.createEmptyMovieClip(n,t),e=1;this.make();for(var i=0;i<this.modules.length;i++)for(var s=i*e,a=0;a<this.modules[i].length;a++){var c=a*e,l=this.modules[i][a];l&&(o.beginFill(0,100),o.moveTo(c,s),o.lineTo(c+e,s),o.lineTo(c+e,s+e),o.lineTo(c,s+e),o.endFill())}return o},setupTimingPattern:function(){for(var r=8;r<this.moduleCount-8;r++)this.modules[r][6]===null&&(this.modules[r][6]=r%2===0);for(var n=8;n<this.moduleCount-8;n++)this.modules[6][n]===null&&(this.modules[6][n]=n%2===0)},setupPositionAdjustPattern:function(){for(var r=le.getPatternPosition(this.typeNumber),n=0;n<r.length;n++)for(var t=0;t<r.length;t++){var o=r[n],e=r[t];if(this.modules[o][e]===null)for(var i=-2;i<=2;i++)for(var s=-2;s<=2;s++)Math.abs(i)===2||Math.abs(s)===2||i===0&&s===0?this.modules[o+i][e+s]=!0:this.modules[o+i][e+s]=!1}},setupTypeNumber:function(r){for(var n=le.getBCHTypeNumber(this.typeNumber),t,o=0;o<18;o++)t=!r&&(n>>o&1)===1,this.modules[Math.floor(o/3)][o%3+this.moduleCount-8-3]=t;for(var e=0;e<18;e++)t=!r&&(n>>e&1)===1,this.modules[e%3+this.moduleCount-8-3][Math.floor(e/3)]=t},setupTypeInfo:function(r,n){for(var t=this.errorCorrectLevel<<3|n,o=le.getBCHTypeInfo(t),e,i=0;i<15;i++)e=!r&&(o>>i&1)===1,i<6?this.modules[i][8]=e:i<8?this.modules[i+1][8]=e:this.modules[this.moduleCount-15+i][8]=e;for(var s=0;s<15;s++)e=!r&&(o>>s&1)===1,s<8?this.modules[8][this.moduleCount-s-1]=e:s<9?this.modules[8][15-s-1+1]=e:this.modules[8][15-s-1]=e;this.modules[this.moduleCount-8][8]=!r},mapData:function(r,n){for(var t=-1,o=this.moduleCount-1,e=7,i=0,s=this.moduleCount-1;s>0;s-=2)for(s===6&&s--;;){for(var a=0;a<2;a++)if(this.modules[o][s-a]===null){var c=!1;i<r.length&&(c=(r[i]>>>e&1)===1);var l=le.getMask(n,o,s-a);l&&(c=!c),this.modules[o][s-a]=c,e--,e===-1&&(i++,e=7)}if(o+=t,o<0||this.moduleCount<=o){o-=t,t=-t;break}}}};oe.PAD0=236;oe.PAD1=17;oe.createData=function(r,n,t){for(var o=hn.getRSBlocks(r,n),e=new mn,i=0;i<t.length;i++){var s=t[i];e.put(s.mode,4),e.put(s.getLength(),le.getLengthInBits(s.mode,r)),s.write(e)}for(var a=0,c=0;c<o.length;c++)a+=o[c].dataCount;if(e.getLengthInBits()>a*8)throw new Error("code length overflow. ("+e.getLengthInBits()+">"+a*8+")");for(e.getLengthInBits()+4<=a*8&&e.put(0,4);e.getLengthInBits()%8!==0;)e.putBit(!1);for(;!(e.getLengthInBits()>=a*8||(e.put(oe.PAD0,8),e.getLengthInBits()>=a*8));)e.put(oe.PAD1,8);return oe.createBytes(e,o)};oe.createBytes=function(r,n){for(var t=0,o=0,e=0,i=new Array(n.length),s=new Array(n.length),a=0;a<n.length;a++){var c=n[a].dataCount,l=n[a].totalCount-c;o=Math.max(o,c),e=Math.max(e,l),i[a]=new Array(c);for(var u=0;u<i[a].length;u++)i[a][u]=255&r.buffer[u+t];t+=c;var f=le.getErrorCorrectPolynomial(l),d=new br(i[a],f.getLength()-1),h=d.mod(f);s[a]=new Array(f.getLength()-1);for(var p=0;p<s[a].length;p++){var g=p+h.getLength()-s[a].length;s[a][p]=g>=0?h.get(g):0}}for(var T=0,k=0;k<n.length;k++)T+=n[k].totalCount;for(var _=new Array(T),x=0,b=0;b<o;b++)for(var A=0;A<n.length;A++)b<i[A].length&&(_[x++]=i[A][b]);for(var w=0;w<e;w++)for(var R=0;R<n.length;R++)w<s[R].length&&(_[x++]=s[R][w]);return _};gn.exports=oe});var Tn=V((Oo,wn)=>{var _r=yn(),vn=yt(),xr="\x1B[40m \x1B[0m",Je="\x1B[47m \x1B[0m",Sr=function(r){return r?xr:Je},vt=function(r){return{times:function(n){return new Array(n).join(r)}}},kr=function(r,n){for(var t=new Array(r),o=0;o<r;o++)t[o]=n;return t};wn.exports={error:vn.L,generate:function(r,n,t){typeof n=="function"&&(t=n,n={});var o=new _r(-1,this.error);o.addData(r),o.make();var e="";if(n&&n.small){var i=!0,s=!1,a=o.getModuleCount(),c=o.modules.slice(),l=a%2===1;l&&c.push(kr(a,s));var u={WHITE_ALL:"\u2588",WHITE_BLACK:"\u2580",BLACK_WHITE:"\u2584",BLACK_ALL:" "},f=vt(u.BLACK_WHITE).times(a+3),d=vt(u.WHITE_BLACK).times(a+3);e+=f+`
4
4
  `;for(var h=0;h<a;h+=2){e+=u.WHITE_ALL;for(var p=0;p<a;p++)c[h][p]===s&&c[h+1][p]===s?e+=u.WHITE_ALL:c[h][p]===s&&c[h+1][p]===i?e+=u.WHITE_BLACK:c[h][p]===i&&c[h+1][p]===s?e+=u.BLACK_WHITE:e+=u.BLACK_ALL;e+=u.WHITE_ALL+`
5
- `}l||(e+=d)}else{var g=gt(Je).times(o.getModuleCount()+3);e+=g+`
6
- `,o.modules.forEach(function(T){e+=Je,e+=T.map(xr).join(""),e+=Je+`
7
- `}),e+=g}t?t(e):console.log(e)},setErrorLevel:function(r){this.error=vn[r]||this.error}}});var En=Y((Le,yt)=>{(function(r,n){typeof Le=="object"&&typeof yt=="object"?yt.exports=n(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],n):typeof Le=="object"?Le["electron-machine-id"]=n(require("child_process"),require("crypto")):r["electron-machine-id"]=n(r.child_process,r.crypto)})(Le,function(r,n){return(function(t){function o(i){if(e[i])return e[i].exports;var s=e[i]={exports:{},id:i,loaded:!1};return t[i].call(s.exports,s,s.exports,o),s.loaded=!0,s.exports}var e={};return o.m=t,o.c=e,o.p="",o(0)})([function(t,o,e){t.exports=e(34)},function(t,o,e){var i=e(29)("wks"),s=e(33),a=e(2).Symbol,c=typeof a=="function",l=t.exports=function(u){return i[u]||(i[u]=c&&a[u]||(c?a:s)("Symbol."+u))};l.store=i},function(t,o){var e=t.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=e)},function(t,o,e){var i=e(9);t.exports=function(s){if(!i(s))throw TypeError(s+" is not an object!");return s}},function(t,o,e){t.exports=!e(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(t,o,e){var i=e(12),s=e(17);t.exports=e(4)?function(a,c,l){return i.f(a,c,s(1,l))}:function(a,c,l){return a[c]=l,a}},function(t,o){var e=t.exports={version:"2.4.0"};typeof __e=="number"&&(__e=e)},function(t,o,e){var i=e(14);t.exports=function(s,a,c){if(i(s),a===void 0)return s;switch(c){case 1:return function(l){return s.call(a,l)};case 2:return function(l,u){return s.call(a,l,u)};case 3:return function(l,u,f){return s.call(a,l,u,f)}}return function(){return s.apply(a,arguments)}}},function(t,o){var e={}.hasOwnProperty;t.exports=function(i,s){return e.call(i,s)}},function(t,o){t.exports=function(e){return typeof e=="object"?e!==null:typeof e=="function"}},function(t,o){t.exports={}},function(t,o){var e={}.toString;t.exports=function(i){return e.call(i).slice(8,-1)}},function(t,o,e){var i=e(3),s=e(26),a=e(32),c=Object.defineProperty;o.f=e(4)?Object.defineProperty:function(l,u,f){if(i(l),u=a(u,!0),i(f),s)try{return c(l,u,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(l[u]=f.value),l}},function(t,o,e){var i=e(42),s=e(15);t.exports=function(a){return i(s(a))}},function(t,o){t.exports=function(e){if(typeof e!="function")throw TypeError(e+" is not a function!");return e}},function(t,o){t.exports=function(e){if(e==null)throw TypeError("Can't call method on "+e);return e}},function(t,o,e){var i=e(9),s=e(2).document,a=i(s)&&i(s.createElement);t.exports=function(c){return a?s.createElement(c):{}}},function(t,o){t.exports=function(e,i){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:i}}},function(t,o,e){var i=e(12).f,s=e(8),a=e(1)("toStringTag");t.exports=function(c,l,u){c&&!s(c=u?c:c.prototype,a)&&i(c,a,{configurable:!0,value:l})}},function(t,o,e){var i=e(29)("keys"),s=e(33);t.exports=function(a){return i[a]||(i[a]=s(a))}},function(t,o){var e=Math.ceil,i=Math.floor;t.exports=function(s){return isNaN(s=+s)?0:(s>0?i:e)(s)}},function(t,o,e){var i=e(11),s=e(1)("toStringTag"),a=i((function(){return arguments})())=="Arguments",c=function(l,u){try{return l[u]}catch{}};t.exports=function(l){var u,f,d;return l===void 0?"Undefined":l===null?"Null":typeof(f=c(u=Object(l),s))=="string"?f:a?i(u):(d=i(u))=="Object"&&typeof u.callee=="function"?"Arguments":d}},function(t,o){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,o,e){var i=e(2),s=e(6),a=e(7),c=e(5),l="prototype",u=function(f,d,h){var p,g,T,k=f&u.F,_=f&u.G,x=f&u.S,b=f&u.P,A=f&u.B,w=f&u.W,R=_?s:s[d]||(s[d]={}),O=R[l],L=_?i:x?i[d]:(i[d]||{})[l];_&&(h=d);for(p in h)g=!k&&L&&L[p]!==void 0,g&&p in R||(T=g?L[p]:h[p],R[p]=_&&typeof L[p]!="function"?h[p]:A&&g?a(T,i):w&&L[p]==T?(function(F){var X=function(z,G,ie){if(this instanceof F){switch(arguments.length){case 0:return new F;case 1:return new F(z);case 2:return new F(z,G)}return new F(z,G,ie)}return F.apply(this,arguments)};return X[l]=F[l],X})(T):b&&typeof T=="function"?a(Function.call,T):T,b&&((R.virtual||(R.virtual={}))[p]=T,f&u.R&&O&&!O[p]&&c(O,p,T)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,o){t.exports=function(e){try{return!!e()}catch{return!0}}},function(t,o,e){t.exports=e(2).document&&document.documentElement},function(t,o,e){t.exports=!e(4)&&!e(24)(function(){return Object.defineProperty(e(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(t,o,e){"use strict";var i=e(28),s=e(23),a=e(57),c=e(5),l=e(8),u=e(10),f=e(45),d=e(18),h=e(52),p=e(1)("iterator"),g=!([].keys&&"next"in[].keys()),T="@@iterator",k="keys",_="values",x=function(){return this};t.exports=function(b,A,w,R,O,L,F){f(w,A,R);var X,z,G,ie=function(y){if(!g&&y in H)return H[y];switch(y){case k:return function(){return new w(this,y)};case _:return function(){return new w(this,y)}}return function(){return new w(this,y)}},ye=A+" Iterator",ue=O==_,Ae=!1,H=b.prototype,se=H[p]||H[T]||O&&H[O],W=se||ie(O),Oe=O?ue?ie("entries"):W:void 0,m=A=="Array"&&H.entries||se;if(m&&(G=h(m.call(new b)),G!==Object.prototype&&(d(G,ye,!0),i||l(G,p)||c(G,p,x))),ue&&se&&se.name!==_&&(Ae=!0,W=function(){return se.call(this)}),i&&!F||!g&&!Ae&&H[p]||c(H,p,W),u[A]=W,u[ye]=x,O)if(X={values:ue?W:ie(_),keys:L?W:ie(k),entries:Oe},F)for(z in X)z in H||a(H,z,X[z]);else s(s.P+s.F*(g||Ae),A,X);return X}},function(t,o){t.exports=!0},function(t,o,e){var i=e(2),s="__core-js_shared__",a=i[s]||(i[s]={});t.exports=function(c){return a[c]||(a[c]={})}},function(t,o,e){var i,s,a,c=e(7),l=e(41),u=e(25),f=e(16),d=e(2),h=d.process,p=d.setImmediate,g=d.clearImmediate,T=d.MessageChannel,k=0,_={},x="onreadystatechange",b=function(){var w=+this;if(_.hasOwnProperty(w)){var R=_[w];delete _[w],R()}},A=function(w){b.call(w.data)};p&&g||(p=function(w){for(var R=[],O=1;arguments.length>O;)R.push(arguments[O++]);return _[++k]=function(){l(typeof w=="function"?w:Function(w),R)},i(k),k},g=function(w){delete _[w]},e(11)(h)=="process"?i=function(w){h.nextTick(c(b,w,1))}:T?(s=new T,a=s.port2,s.port1.onmessage=A,i=c(a.postMessage,a,1)):d.addEventListener&&typeof postMessage=="function"&&!d.importScripts?(i=function(w){d.postMessage(w+"","*")},d.addEventListener("message",A,!1)):i=x in f("script")?function(w){u.appendChild(f("script"))[x]=function(){u.removeChild(this),b.call(w)}}:function(w){setTimeout(c(b,w,1),0)}),t.exports={set:p,clear:g}},function(t,o,e){var i=e(20),s=Math.min;t.exports=function(a){return a>0?s(i(a),9007199254740991):0}},function(t,o,e){var i=e(9);t.exports=function(s,a){if(!i(s))return s;var c,l;if(a&&typeof(c=s.toString)=="function"&&!i(l=c.call(s))||typeof(c=s.valueOf)=="function"&&!i(l=c.call(s))||!a&&typeof(c=s.toString)=="function"&&!i(l=c.call(s)))return l;throw TypeError("Can't convert object to primitive value")}},function(t,o){var e=0,i=Math.random();t.exports=function(s){return"Symbol(".concat(s===void 0?"":s,")_",(++e+i).toString(36))}},function(t,o,e){"use strict";function i(x){return x&&x.__esModule?x:{default:x}}function s(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function a(x){return(0,p.createHash)("sha256").update(x).digest("hex")}function c(x){switch(T){case"darwin":return x.split("IOPlatformUUID")[1].split(`
8
- `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return x.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return x.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return x.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function l(x){var b=c((0,h.execSync)(_[T]).toString());return x?b:a(b)}function u(x){return new d.default(function(b,A){return(0,h.exec)(_[T],{},function(w,R,O){if(w)return A(new Error("Error while obtaining machine id: "+w.stack));var L=c(R.toString());return b(x?L:a(L))})})}Object.defineProperty(o,"__esModule",{value:!0});var f=e(35),d=i(f);o.machineIdSync=l,o.machineId=u;var h=e(70),p=e(71),g=process,T=g.platform,k={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},_={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:k[s()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(t,o,e){t.exports={default:e(36),__esModule:!0}},function(t,o,e){e(66),e(68),e(69),e(67),t.exports=e(6).Promise},function(t,o){t.exports=function(){}},function(t,o){t.exports=function(e,i,s,a){if(!(e instanceof i)||a!==void 0&&a in e)throw TypeError(s+": incorrect invocation!");return e}},function(t,o,e){var i=e(13),s=e(31),a=e(62);t.exports=function(c){return function(l,u,f){var d,h=i(l),p=s(h.length),g=a(f,p);if(c&&u!=u){for(;p>g;)if(d=h[g++],d!=d)return!0}else for(;p>g;g++)if((c||g in h)&&h[g]===u)return c||g||0;return!c&&-1}}},function(t,h,e){var i=e(7),s=e(44),a=e(43),c=e(3),l=e(31),u=e(64),f={},d={},h=t.exports=function(p,g,T,k,_){var x,b,A,w,R=_?function(){return p}:u(p),O=i(T,k,g?2:1),L=0;if(typeof R!="function")throw TypeError(p+" is not iterable!");if(a(R)){for(x=l(p.length);x>L;L++)if(w=g?O(c(b=p[L])[0],b[1]):O(p[L]),w===f||w===d)return w}else for(A=R.call(p);!(b=A.next()).done;)if(w=s(A,O,b.value,g),w===f||w===d)return w};h.BREAK=f,h.RETURN=d},function(t,o){t.exports=function(e,i,s){var a=s===void 0;switch(i.length){case 0:return a?e():e.call(s);case 1:return a?e(i[0]):e.call(s,i[0]);case 2:return a?e(i[0],i[1]):e.call(s,i[0],i[1]);case 3:return a?e(i[0],i[1],i[2]):e.call(s,i[0],i[1],i[2]);case 4:return a?e(i[0],i[1],i[2],i[3]):e.call(s,i[0],i[1],i[2],i[3])}return e.apply(s,i)}},function(t,o,e){var i=e(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(s){return i(s)=="String"?s.split(""):Object(s)}},function(t,o,e){var i=e(10),s=e(1)("iterator"),a=Array.prototype;t.exports=function(c){return c!==void 0&&(i.Array===c||a[s]===c)}},function(t,o,e){var i=e(3);t.exports=function(s,a,c,l){try{return l?a(i(c)[0],c[1]):a(c)}catch(f){var u=s.return;throw u!==void 0&&i(u.call(s)),f}}},function(t,o,e){"use strict";var i=e(49),s=e(17),a=e(18),c={};e(5)(c,e(1)("iterator"),function(){return this}),t.exports=function(l,u,f){l.prototype=i(c,{next:s(1,f)}),a(l,u+" Iterator")}},function(t,o,e){var i=e(1)("iterator"),s=!1;try{var a=[7][i]();a.return=function(){s=!0},Array.from(a,function(){throw 2})}catch{}t.exports=function(c,l){if(!l&&!s)return!1;var u=!1;try{var f=[7],d=f[i]();d.next=function(){return{done:u=!0}},f[i]=function(){return d},c(f)}catch{}return u}},function(t,o){t.exports=function(e,i){return{value:i,done:!!e}}},function(t,o,e){var i=e(2),s=e(30).set,a=i.MutationObserver||i.WebKitMutationObserver,c=i.process,l=i.Promise,u=e(11)(c)=="process";t.exports=function(){var f,d,h,p=function(){var _,x;for(u&&(_=c.domain)&&_.exit();f;){x=f.fn,f=f.next;try{x()}catch(b){throw f?h():d=void 0,b}}d=void 0,_&&_.enter()};if(u)h=function(){c.nextTick(p)};else if(a){var g=!0,T=document.createTextNode("");new a(p).observe(T,{characterData:!0}),h=function(){T.data=g=!g}}else if(l&&l.resolve){var k=l.resolve();h=function(){k.then(p)}}else h=function(){s.call(i,p)};return function(_){var x={fn:_,next:void 0};d&&(d.next=x),f||(f=x,h()),d=x}}},function(t,o,e){var i=e(3),s=e(50),a=e(22),c=e(19)("IE_PROTO"),l=function(){},u="prototype",f=function(){var d,h=e(16)("iframe"),p=a.length,g=">";for(h.style.display="none",e(25).appendChild(h),h.src="javascript:",d=h.contentWindow.document,d.open(),d.write("<script>document.F=Object</script"+g),d.close(),f=d.F;p--;)delete f[u][a[p]];return f()};t.exports=Object.create||function(d,h){var p;return d!==null?(l[u]=i(d),p=new l,l[u]=null,p[c]=d):p=f(),h===void 0?p:s(p,h)}},function(t,o,e){var i=e(12),s=e(3),a=e(54);t.exports=e(4)?Object.defineProperties:function(c,l){s(c);for(var u,f=a(l),d=f.length,h=0;d>h;)i.f(c,u=f[h++],l[u]);return c}},function(t,o,e){var i=e(55),s=e(17),a=e(13),c=e(32),l=e(8),u=e(26),f=Object.getOwnPropertyDescriptor;o.f=e(4)?f:function(d,h){if(d=a(d),h=c(h,!0),u)try{return f(d,h)}catch{}if(l(d,h))return s(!i.f.call(d,h),d[h])}},function(t,o,e){var i=e(8),s=e(63),a=e(19)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(l){return l=s(l),i(l,a)?l[a]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?c:null}},function(t,o,e){var i=e(8),s=e(13),a=e(39)(!1),c=e(19)("IE_PROTO");t.exports=function(l,u){var f,d=s(l),h=0,p=[];for(f in d)f!=c&&i(d,f)&&p.push(f);for(;u.length>h;)i(d,f=u[h++])&&(~a(p,f)||p.push(f));return p}},function(t,o,e){var i=e(53),s=e(22);t.exports=Object.keys||function(a){return i(a,s)}},function(t,o){o.f={}.propertyIsEnumerable},function(t,o,e){var i=e(5);t.exports=function(s,a,c){for(var l in a)c&&s[l]?s[l]=a[l]:i(s,l,a[l]);return s}},function(t,o,e){t.exports=e(5)},function(t,o,e){var i=e(9),s=e(3),a=function(c,l){if(s(c),!i(l)&&l!==null)throw TypeError(l+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(c,l,u){try{u=e(7)(Function.call,e(51).f(Object.prototype,"__proto__").set,2),u(c,[]),l=!(c instanceof Array)}catch{l=!0}return function(f,d){return a(f,d),l?f.__proto__=d:u(f,d),f}})({},!1):void 0),check:a}},function(t,o,e){"use strict";var i=e(2),s=e(6),a=e(12),c=e(4),l=e(1)("species");t.exports=function(u){var f=typeof s[u]=="function"?s[u]:i[u];c&&f&&!f[l]&&a.f(f,l,{configurable:!0,get:function(){return this}})}},function(t,o,e){var i=e(3),s=e(14),a=e(1)("species");t.exports=function(c,l){var u,f=i(c).constructor;return f===void 0||(u=i(f)[a])==null?l:s(u)}},function(t,o,e){var i=e(20),s=e(15);t.exports=function(a){return function(c,l){var u,f,d=String(s(c)),h=i(l),p=d.length;return h<0||h>=p?a?"":void 0:(u=d.charCodeAt(h),u<55296||u>56319||h+1===p||(f=d.charCodeAt(h+1))<56320||f>57343?a?d.charAt(h):u:a?d.slice(h,h+2):(u-55296<<10)+(f-56320)+65536)}}},function(t,o,e){var i=e(20),s=Math.max,a=Math.min;t.exports=function(c,l){return c=i(c),c<0?s(c+l,0):a(c,l)}},function(t,o,e){var i=e(15);t.exports=function(s){return Object(i(s))}},function(t,o,e){var i=e(21),s=e(1)("iterator"),a=e(10);t.exports=e(6).getIteratorMethod=function(c){if(c!=null)return c[s]||c["@@iterator"]||a[i(c)]}},function(t,o,e){"use strict";var i=e(37),s=e(47),a=e(10),c=e(13);t.exports=e(27)(Array,"Array",function(l,u){this._t=c(l),this._i=0,this._k=u},function(){var l=this._t,u=this._k,f=this._i++;return!l||f>=l.length?(this._t=void 0,s(1)):u=="keys"?s(0,f):u=="values"?s(0,l[f]):s(0,[f,l[f]])},"values"),a.Arguments=a.Array,i("keys"),i("values"),i("entries")},function(t,o){},function(t,o,e){"use strict";var i,s,a,c=e(28),l=e(2),u=e(7),f=e(21),d=e(23),h=e(9),p=(e(3),e(14)),g=e(38),T=e(40),k=(e(58).set,e(60)),_=e(30).set,x=e(48)(),b="Promise",A=l.TypeError,R=l.process,w=l[b],R=l.process,O=f(R)=="process",L=function(){},F=!!(function(){try{var m=w.resolve(1),y=(m.constructor={})[e(1)("species")]=function(E){E(L,L)};return(O||typeof PromiseRejectionEvent=="function")&&m.then(L)instanceof y}catch{}})(),X=function(m,y){return m===y||m===w&&y===a},z=function(m){var y;return!(!h(m)||typeof(y=m.then)!="function")&&y},G=function(m){return X(w,m)?new ie(m):new s(m)},ie=s=function(m){var y,E;this.promise=new m(function(P,K){if(y!==void 0||E!==void 0)throw A("Bad Promise constructor");y=P,E=K}),this.resolve=p(y),this.reject=p(E)},ye=function(m){try{m()}catch(y){return{error:y}}},ue=function(m,y){if(!m._n){m._n=!0;var E=m._c;x(function(){for(var P=m._v,K=m._s==1,fe=0,ve=function(ae){var ne,Ke,Pe=K?ae.ok:ae.fail,Ce=ae.resolve,we=ae.reject,Ge=ae.domain;try{Pe?(K||(m._h==2&&se(m),m._h=1),Pe===!0?ne=P:(Ge&&Ge.enter(),ne=Pe(P),Ge&&Ge.exit()),ne===ae.promise?we(A("Promise-chain cycle")):(Ke=z(ne))?Ke.call(ne,Ce,we):Ce(ne)):we(P)}catch(Xn){we(Xn)}};E.length>fe;)ve(E[fe++]);m._c=[],m._n=!1,y&&!m._h&&Ae(m)})}},Ae=function(m){_.call(l,function(){var y,E,P,K=m._v;if(H(m)&&(y=ye(function(){O?R.emit("unhandledRejection",K,m):(E=l.onunhandledrejection)?E({promise:m,reason:K}):(P=l.console)&&P.error&&P.error("Unhandled promise rejection",K)}),m._h=O||H(m)?2:1),m._a=void 0,y)throw y.error})},H=function(m){if(m._h==1)return!1;for(var y,E=m._a||m._c,P=0;E.length>P;)if(y=E[P++],y.fail||!H(y.promise))return!1;return!0},se=function(m){_.call(l,function(){var y;O?R.emit("rejectionHandled",m):(y=l.onrejectionhandled)&&y({promise:m,reason:m._v})})},W=function(m){var y=this;y._d||(y._d=!0,y=y._w||y,y._v=m,y._s=2,y._a||(y._a=y._c.slice()),ue(y,!0))},Oe=function(m){var y,E=this;if(!E._d){E._d=!0,E=E._w||E;try{if(E===m)throw A("Promise can't be resolved itself");(y=z(m))?x(function(){var P={_w:E,_d:!1};try{y.call(m,u(Oe,P,1),u(W,P,1))}catch(K){W.call(P,K)}}):(E._v=m,E._s=1,ue(E,!1))}catch(P){W.call({_w:E,_d:!1},P)}}};F||(w=function(m){g(this,w,b,"_h"),p(m),i.call(this);try{m(u(Oe,this,1),u(W,this,1))}catch(y){W.call(this,y)}},i=function(m){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},i.prototype=e(56)(w.prototype,{then:function(m,y){var E=G(k(this,w));return E.ok=typeof m!="function"||m,E.fail=typeof y=="function"&&y,E.domain=O?R.domain:void 0,this._c.push(E),this._a&&this._a.push(E),this._s&&ue(this,!1),E.promise},catch:function(m){return this.then(void 0,m)}}),ie=function(){var m=new i;this.promise=m,this.resolve=u(Oe,m,1),this.reject=u(W,m,1)}),d(d.G+d.W+d.F*!F,{Promise:w}),e(18)(w,b),e(59)(b),a=e(6)[b],d(d.S+d.F*!F,b,{reject:function(m){var y=G(this),E=y.reject;return E(m),y.promise}}),d(d.S+d.F*(c||!F),b,{resolve:function(m){if(m instanceof w&&X(m.constructor,this))return m;var y=G(this),E=y.resolve;return E(m),y.promise}}),d(d.S+d.F*!(F&&e(46)(function(m){w.all(m).catch(L)})),b,{all:function(m){var y=this,E=G(y),P=E.resolve,K=E.reject,fe=ye(function(){var ve=[],ae=0,ne=1;T(m,!1,function(Ke){var Pe=ae++,Ce=!1;ve.push(void 0),ne++,y.resolve(Ke).then(function(we){Ce||(Ce=!0,ve[Pe]=we,--ne||P(ve))},K)}),--ne||P(ve)});return fe&&K(fe.error),E.promise},race:function(m){var y=this,E=G(y),P=E.reject,K=ye(function(){T(m,!1,function(fe){y.resolve(fe).then(E.resolve,P)})});return K&&P(K.error),E.promise}})},function(t,o,e){"use strict";var i=e(61)(!0);e(27)(String,"String",function(s){this._t=String(s),this._i=0},function(){var s,a=this._t,c=this._i;return c>=a.length?{value:void 0,done:!0}:(s=i(a,c),this._i+=s.length,{value:s,done:!1})})},function(t,o,e){e(65);for(var i=e(2),s=e(5),a=e(10),c=e(1)("toStringTag"),l=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],u=0;u<5;u++){var f=l[u],d=i[f],h=d&&d.prototype;h&&!h[c]&&s(h,c,f),a[f]=a.Array}},function(t,o){t.exports=require("child_process")},function(t,o){t.exports=require("crypto")}])})});var jt=(r=0)=>n=>`\x1B[${n+r}m`,Ut=(r=0)=>n=>`\x1B[${38+r};5;${n}m`,Ft=(r=0)=>(n,t,o)=>`\x1B[${38+r};2;${n};${t};${o}m`,C={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},ao=Object.keys(C.modifier),or=Object.keys(C.color),ir=Object.keys(C.bgColor),co=[...or,...ir];function sr(){let r=new Map;for(let[n,t]of Object.entries(C)){for(let[o,e]of Object.entries(t))C[o]={open:`\x1B[${e[0]}m`,close:`\x1B[${e[1]}m`},t[o]=C[o],r.set(e[0],e[1]);Object.defineProperty(C,n,{value:t,enumerable:!1})}return Object.defineProperty(C,"codes",{value:r,enumerable:!1}),C.color.close="\x1B[39m",C.bgColor.close="\x1B[49m",C.color.ansi=jt(),C.color.ansi256=Ut(),C.color.ansi16m=Ft(),C.bgColor.ansi=jt(10),C.bgColor.ansi256=Ut(10),C.bgColor.ansi16m=Ft(10),Object.defineProperties(C,{rgbToAnsi256:{value(n,t,o){return n===t&&t===o?n<8?16:n>248?231:Math.round((n-8)/247*24)+232:16+36*Math.round(n/255*5)+6*Math.round(t/255*5)+Math.round(o/255*5)},enumerable:!1},hexToRgb:{value(n){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(n.toString(16));if(!t)return[0,0,0];let[o]=t;o.length===3&&(o=[...o].map(i=>i+i).join(""));let e=Number.parseInt(o,16);return[e>>16&255,e>>8&255,e&255]},enumerable:!1},hexToAnsi256:{value:n=>C.rgbToAnsi256(...C.hexToRgb(n)),enumerable:!1},ansi256ToAnsi:{value(n){if(n<8)return 30+n;if(n<16)return 90+(n-8);let t,o,e;if(n>=232)t=((n-232)*10+8)/255,o=t,e=t;else{n-=16;let a=n%36;t=Math.floor(n/36)/5,o=Math.floor(a/6)/5,e=a%6/5}let i=Math.max(t,o,e)*2;if(i===0)return 30;let s=30+(Math.round(e)<<2|Math.round(o)<<1|Math.round(t));return i===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(n,t,o)=>C.ansi256ToAnsi(C.rgbToAnsi256(n,t,o)),enumerable:!1},hexToAnsi:{value:n=>C.ansi256ToAnsi(C.hexToAnsi256(n)),enumerable:!1}}),C}var ar=sr(),Z=ar;var We=M(require("node:process"),1),Gt=M(require("node:os"),1),ct=M(require("node:tty"),1);function V(r,n=globalThis.Deno?globalThis.Deno.args:We.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",o=n.indexOf(t+r),e=n.indexOf("--");return o!==-1&&(e===-1||o<e)}var{env:I}=We.default,He;V("no-color")||V("no-colors")||V("color=false")||V("color=never")?He=0:(V("color")||V("colors")||V("color=true")||V("color=always"))&&(He=1);function cr(){if("FORCE_COLOR"in I)return I.FORCE_COLOR==="true"?1:I.FORCE_COLOR==="false"?0:I.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(I.FORCE_COLOR,10),3)}function lr(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function ur(r,{streamIsTTY:n,sniffFlags:t=!0}={}){let o=cr();o!==void 0&&(He=o);let e=t?He:o;if(e===0)return 0;if(t){if(V("color=16m")||V("color=full")||V("color=truecolor"))return 3;if(V("color=256"))return 2}if("TF_BUILD"in I&&"AGENT_NAME"in I)return 1;if(r&&!n&&e===void 0)return 0;let i=e||0;if(I.TERM==="dumb")return i;if(We.default.platform==="win32"){let s=Gt.default.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in I)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in I)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in I)||I.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in I)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(I.TEAMCITY_VERSION)?1:0;if(I.COLORTERM==="truecolor"||I.TERM==="xterm-kitty"||I.TERM==="xterm-ghostty"||I.TERM==="wezterm")return 3;if("TERM_PROGRAM"in I){let s=Number.parseInt((I.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(I.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(I.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(I.TERM)||"COLORTERM"in I?1:i}function Kt(r,n={}){let t=ur(r,{streamIsTTY:r&&r.isTTY,...n});return lr(t)}var fr={stdout:Kt({isTTY:ct.default.isatty(1)}),stderr:Kt({isTTY:ct.default.isatty(2)})},Ht=fr;function Wt(r,n,t){let o=r.indexOf(n);if(o===-1)return r;let e=n.length,i=0,s="";do s+=r.slice(i,o)+n+t,i=o+e,o=r.indexOf(n,i);while(o!==-1);return s+=r.slice(i),s}function Qt(r,n,t,o){let e=0,i="";do{let s=r[o-1]==="\r";i+=r.slice(e,s?o-1:o)+n+(s?`\r
5
+ `}l||(e+=d)}else{var g=vt(Je).times(o.getModuleCount()+3);e+=g+`
6
+ `,o.modules.forEach(function(T){e+=Je,e+=T.map(Sr).join(""),e+=Je+`
7
+ `}),e+=g}t?t(e):console.log(e)},setErrorLevel:function(r){this.error=vn[r]||this.error}}});var En=V((Le,wt)=>{(function(r,n){typeof Le=="object"&&typeof wt=="object"?wt.exports=n(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],n):typeof Le=="object"?Le["electron-machine-id"]=n(require("child_process"),require("crypto")):r["electron-machine-id"]=n(r.child_process,r.crypto)})(Le,function(r,n){return(function(t){function o(i){if(e[i])return e[i].exports;var s=e[i]={exports:{},id:i,loaded:!1};return t[i].call(s.exports,s,s.exports,o),s.loaded=!0,s.exports}var e={};return o.m=t,o.c=e,o.p="",o(0)})([function(t,o,e){t.exports=e(34)},function(t,o,e){var i=e(29)("wks"),s=e(33),a=e(2).Symbol,c=typeof a=="function",l=t.exports=function(u){return i[u]||(i[u]=c&&a[u]||(c?a:s)("Symbol."+u))};l.store=i},function(t,o){var e=t.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=e)},function(t,o,e){var i=e(9);t.exports=function(s){if(!i(s))throw TypeError(s+" is not an object!");return s}},function(t,o,e){t.exports=!e(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(t,o,e){var i=e(12),s=e(17);t.exports=e(4)?function(a,c,l){return i.f(a,c,s(1,l))}:function(a,c,l){return a[c]=l,a}},function(t,o){var e=t.exports={version:"2.4.0"};typeof __e=="number"&&(__e=e)},function(t,o,e){var i=e(14);t.exports=function(s,a,c){if(i(s),a===void 0)return s;switch(c){case 1:return function(l){return s.call(a,l)};case 2:return function(l,u){return s.call(a,l,u)};case 3:return function(l,u,f){return s.call(a,l,u,f)}}return function(){return s.apply(a,arguments)}}},function(t,o){var e={}.hasOwnProperty;t.exports=function(i,s){return e.call(i,s)}},function(t,o){t.exports=function(e){return typeof e=="object"?e!==null:typeof e=="function"}},function(t,o){t.exports={}},function(t,o){var e={}.toString;t.exports=function(i){return e.call(i).slice(8,-1)}},function(t,o,e){var i=e(3),s=e(26),a=e(32),c=Object.defineProperty;o.f=e(4)?Object.defineProperty:function(l,u,f){if(i(l),u=a(u,!0),i(f),s)try{return c(l,u,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(l[u]=f.value),l}},function(t,o,e){var i=e(42),s=e(15);t.exports=function(a){return i(s(a))}},function(t,o){t.exports=function(e){if(typeof e!="function")throw TypeError(e+" is not a function!");return e}},function(t,o){t.exports=function(e){if(e==null)throw TypeError("Can't call method on "+e);return e}},function(t,o,e){var i=e(9),s=e(2).document,a=i(s)&&i(s.createElement);t.exports=function(c){return a?s.createElement(c):{}}},function(t,o){t.exports=function(e,i){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:i}}},function(t,o,e){var i=e(12).f,s=e(8),a=e(1)("toStringTag");t.exports=function(c,l,u){c&&!s(c=u?c:c.prototype,a)&&i(c,a,{configurable:!0,value:l})}},function(t,o,e){var i=e(29)("keys"),s=e(33);t.exports=function(a){return i[a]||(i[a]=s(a))}},function(t,o){var e=Math.ceil,i=Math.floor;t.exports=function(s){return isNaN(s=+s)?0:(s>0?i:e)(s)}},function(t,o,e){var i=e(11),s=e(1)("toStringTag"),a=i((function(){return arguments})())=="Arguments",c=function(l,u){try{return l[u]}catch{}};t.exports=function(l){var u,f,d;return l===void 0?"Undefined":l===null?"Null":typeof(f=c(u=Object(l),s))=="string"?f:a?i(u):(d=i(u))=="Object"&&typeof u.callee=="function"?"Arguments":d}},function(t,o){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,o,e){var i=e(2),s=e(6),a=e(7),c=e(5),l="prototype",u=function(f,d,h){var p,g,T,k=f&u.F,_=f&u.G,x=f&u.S,b=f&u.P,A=f&u.B,w=f&u.W,R=_?s:s[d]||(s[d]={}),O=R[l],L=_?i:x?i[d]:(i[d]||{})[l];_&&(h=d);for(p in h)g=!k&&L&&L[p]!==void 0,g&&p in R||(T=g?L[p]:h[p],R[p]=_&&typeof L[p]!="function"?h[p]:A&&g?a(T,i):w&&L[p]==T?(function(F){var X=function(z,G,ie){if(this instanceof F){switch(arguments.length){case 0:return new F;case 1:return new F(z);case 2:return new F(z,G)}return new F(z,G,ie)}return F.apply(this,arguments)};return X[l]=F[l],X})(T):b&&typeof T=="function"?a(Function.call,T):T,b&&((R.virtual||(R.virtual={}))[p]=T,f&u.R&&O&&!O[p]&&c(O,p,T)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,o){t.exports=function(e){try{return!!e()}catch{return!0}}},function(t,o,e){t.exports=e(2).document&&document.documentElement},function(t,o,e){t.exports=!e(4)&&!e(24)(function(){return Object.defineProperty(e(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(t,o,e){"use strict";var i=e(28),s=e(23),a=e(57),c=e(5),l=e(8),u=e(10),f=e(45),d=e(18),h=e(52),p=e(1)("iterator"),g=!([].keys&&"next"in[].keys()),T="@@iterator",k="keys",_="values",x=function(){return this};t.exports=function(b,A,w,R,O,L,F){f(w,A,R);var X,z,G,ie=function(y){if(!g&&y in H)return H[y];switch(y){case k:return function(){return new w(this,y)};case _:return function(){return new w(this,y)}}return function(){return new w(this,y)}},ye=A+" Iterator",ue=O==_,Ae=!1,H=b.prototype,se=H[p]||H[T]||O&&H[O],W=se||ie(O),Oe=O?ue?ie("entries"):W:void 0,m=A=="Array"&&H.entries||se;if(m&&(G=h(m.call(new b)),G!==Object.prototype&&(d(G,ye,!0),i||l(G,p)||c(G,p,x))),ue&&se&&se.name!==_&&(Ae=!0,W=function(){return se.call(this)}),i&&!F||!g&&!Ae&&H[p]||c(H,p,W),u[A]=W,u[ye]=x,O)if(X={values:ue?W:ie(_),keys:L?W:ie(k),entries:Oe},F)for(z in X)z in H||a(H,z,X[z]);else s(s.P+s.F*(g||Ae),A,X);return X}},function(t,o){t.exports=!0},function(t,o,e){var i=e(2),s="__core-js_shared__",a=i[s]||(i[s]={});t.exports=function(c){return a[c]||(a[c]={})}},function(t,o,e){var i,s,a,c=e(7),l=e(41),u=e(25),f=e(16),d=e(2),h=d.process,p=d.setImmediate,g=d.clearImmediate,T=d.MessageChannel,k=0,_={},x="onreadystatechange",b=function(){var w=+this;if(_.hasOwnProperty(w)){var R=_[w];delete _[w],R()}},A=function(w){b.call(w.data)};p&&g||(p=function(w){for(var R=[],O=1;arguments.length>O;)R.push(arguments[O++]);return _[++k]=function(){l(typeof w=="function"?w:Function(w),R)},i(k),k},g=function(w){delete _[w]},e(11)(h)=="process"?i=function(w){h.nextTick(c(b,w,1))}:T?(s=new T,a=s.port2,s.port1.onmessage=A,i=c(a.postMessage,a,1)):d.addEventListener&&typeof postMessage=="function"&&!d.importScripts?(i=function(w){d.postMessage(w+"","*")},d.addEventListener("message",A,!1)):i=x in f("script")?function(w){u.appendChild(f("script"))[x]=function(){u.removeChild(this),b.call(w)}}:function(w){setTimeout(c(b,w,1),0)}),t.exports={set:p,clear:g}},function(t,o,e){var i=e(20),s=Math.min;t.exports=function(a){return a>0?s(i(a),9007199254740991):0}},function(t,o,e){var i=e(9);t.exports=function(s,a){if(!i(s))return s;var c,l;if(a&&typeof(c=s.toString)=="function"&&!i(l=c.call(s))||typeof(c=s.valueOf)=="function"&&!i(l=c.call(s))||!a&&typeof(c=s.toString)=="function"&&!i(l=c.call(s)))return l;throw TypeError("Can't convert object to primitive value")}},function(t,o){var e=0,i=Math.random();t.exports=function(s){return"Symbol(".concat(s===void 0?"":s,")_",(++e+i).toString(36))}},function(t,o,e){"use strict";function i(x){return x&&x.__esModule?x:{default:x}}function s(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function a(x){return(0,p.createHash)("sha256").update(x).digest("hex")}function c(x){switch(T){case"darwin":return x.split("IOPlatformUUID")[1].split(`
8
+ `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return x.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return x.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return x.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function l(x){var b=c((0,h.execSync)(_[T]).toString());return x?b:a(b)}function u(x){return new d.default(function(b,A){return(0,h.exec)(_[T],{},function(w,R,O){if(w)return A(new Error("Error while obtaining machine id: "+w.stack));var L=c(R.toString());return b(x?L:a(L))})})}Object.defineProperty(o,"__esModule",{value:!0});var f=e(35),d=i(f);o.machineIdSync=l,o.machineId=u;var h=e(70),p=e(71),g=process,T=g.platform,k={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},_={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:k[s()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(t,o,e){t.exports={default:e(36),__esModule:!0}},function(t,o,e){e(66),e(68),e(69),e(67),t.exports=e(6).Promise},function(t,o){t.exports=function(){}},function(t,o){t.exports=function(e,i,s,a){if(!(e instanceof i)||a!==void 0&&a in e)throw TypeError(s+": incorrect invocation!");return e}},function(t,o,e){var i=e(13),s=e(31),a=e(62);t.exports=function(c){return function(l,u,f){var d,h=i(l),p=s(h.length),g=a(f,p);if(c&&u!=u){for(;p>g;)if(d=h[g++],d!=d)return!0}else for(;p>g;g++)if((c||g in h)&&h[g]===u)return c||g||0;return!c&&-1}}},function(t,h,e){var i=e(7),s=e(44),a=e(43),c=e(3),l=e(31),u=e(64),f={},d={},h=t.exports=function(p,g,T,k,_){var x,b,A,w,R=_?function(){return p}:u(p),O=i(T,k,g?2:1),L=0;if(typeof R!="function")throw TypeError(p+" is not iterable!");if(a(R)){for(x=l(p.length);x>L;L++)if(w=g?O(c(b=p[L])[0],b[1]):O(p[L]),w===f||w===d)return w}else for(A=R.call(p);!(b=A.next()).done;)if(w=s(A,O,b.value,g),w===f||w===d)return w};h.BREAK=f,h.RETURN=d},function(t,o){t.exports=function(e,i,s){var a=s===void 0;switch(i.length){case 0:return a?e():e.call(s);case 1:return a?e(i[0]):e.call(s,i[0]);case 2:return a?e(i[0],i[1]):e.call(s,i[0],i[1]);case 3:return a?e(i[0],i[1],i[2]):e.call(s,i[0],i[1],i[2]);case 4:return a?e(i[0],i[1],i[2],i[3]):e.call(s,i[0],i[1],i[2],i[3])}return e.apply(s,i)}},function(t,o,e){var i=e(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(s){return i(s)=="String"?s.split(""):Object(s)}},function(t,o,e){var i=e(10),s=e(1)("iterator"),a=Array.prototype;t.exports=function(c){return c!==void 0&&(i.Array===c||a[s]===c)}},function(t,o,e){var i=e(3);t.exports=function(s,a,c,l){try{return l?a(i(c)[0],c[1]):a(c)}catch(f){var u=s.return;throw u!==void 0&&i(u.call(s)),f}}},function(t,o,e){"use strict";var i=e(49),s=e(17),a=e(18),c={};e(5)(c,e(1)("iterator"),function(){return this}),t.exports=function(l,u,f){l.prototype=i(c,{next:s(1,f)}),a(l,u+" Iterator")}},function(t,o,e){var i=e(1)("iterator"),s=!1;try{var a=[7][i]();a.return=function(){s=!0},Array.from(a,function(){throw 2})}catch{}t.exports=function(c,l){if(!l&&!s)return!1;var u=!1;try{var f=[7],d=f[i]();d.next=function(){return{done:u=!0}},f[i]=function(){return d},c(f)}catch{}return u}},function(t,o){t.exports=function(e,i){return{value:i,done:!!e}}},function(t,o,e){var i=e(2),s=e(30).set,a=i.MutationObserver||i.WebKitMutationObserver,c=i.process,l=i.Promise,u=e(11)(c)=="process";t.exports=function(){var f,d,h,p=function(){var _,x;for(u&&(_=c.domain)&&_.exit();f;){x=f.fn,f=f.next;try{x()}catch(b){throw f?h():d=void 0,b}}d=void 0,_&&_.enter()};if(u)h=function(){c.nextTick(p)};else if(a){var g=!0,T=document.createTextNode("");new a(p).observe(T,{characterData:!0}),h=function(){T.data=g=!g}}else if(l&&l.resolve){var k=l.resolve();h=function(){k.then(p)}}else h=function(){s.call(i,p)};return function(_){var x={fn:_,next:void 0};d&&(d.next=x),f||(f=x,h()),d=x}}},function(t,o,e){var i=e(3),s=e(50),a=e(22),c=e(19)("IE_PROTO"),l=function(){},u="prototype",f=function(){var d,h=e(16)("iframe"),p=a.length,g=">";for(h.style.display="none",e(25).appendChild(h),h.src="javascript:",d=h.contentWindow.document,d.open(),d.write("<script>document.F=Object</script"+g),d.close(),f=d.F;p--;)delete f[u][a[p]];return f()};t.exports=Object.create||function(d,h){var p;return d!==null?(l[u]=i(d),p=new l,l[u]=null,p[c]=d):p=f(),h===void 0?p:s(p,h)}},function(t,o,e){var i=e(12),s=e(3),a=e(54);t.exports=e(4)?Object.defineProperties:function(c,l){s(c);for(var u,f=a(l),d=f.length,h=0;d>h;)i.f(c,u=f[h++],l[u]);return c}},function(t,o,e){var i=e(55),s=e(17),a=e(13),c=e(32),l=e(8),u=e(26),f=Object.getOwnPropertyDescriptor;o.f=e(4)?f:function(d,h){if(d=a(d),h=c(h,!0),u)try{return f(d,h)}catch{}if(l(d,h))return s(!i.f.call(d,h),d[h])}},function(t,o,e){var i=e(8),s=e(63),a=e(19)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(l){return l=s(l),i(l,a)?l[a]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?c:null}},function(t,o,e){var i=e(8),s=e(13),a=e(39)(!1),c=e(19)("IE_PROTO");t.exports=function(l,u){var f,d=s(l),h=0,p=[];for(f in d)f!=c&&i(d,f)&&p.push(f);for(;u.length>h;)i(d,f=u[h++])&&(~a(p,f)||p.push(f));return p}},function(t,o,e){var i=e(53),s=e(22);t.exports=Object.keys||function(a){return i(a,s)}},function(t,o){o.f={}.propertyIsEnumerable},function(t,o,e){var i=e(5);t.exports=function(s,a,c){for(var l in a)c&&s[l]?s[l]=a[l]:i(s,l,a[l]);return s}},function(t,o,e){t.exports=e(5)},function(t,o,e){var i=e(9),s=e(3),a=function(c,l){if(s(c),!i(l)&&l!==null)throw TypeError(l+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(c,l,u){try{u=e(7)(Function.call,e(51).f(Object.prototype,"__proto__").set,2),u(c,[]),l=!(c instanceof Array)}catch{l=!0}return function(f,d){return a(f,d),l?f.__proto__=d:u(f,d),f}})({},!1):void 0),check:a}},function(t,o,e){"use strict";var i=e(2),s=e(6),a=e(12),c=e(4),l=e(1)("species");t.exports=function(u){var f=typeof s[u]=="function"?s[u]:i[u];c&&f&&!f[l]&&a.f(f,l,{configurable:!0,get:function(){return this}})}},function(t,o,e){var i=e(3),s=e(14),a=e(1)("species");t.exports=function(c,l){var u,f=i(c).constructor;return f===void 0||(u=i(f)[a])==null?l:s(u)}},function(t,o,e){var i=e(20),s=e(15);t.exports=function(a){return function(c,l){var u,f,d=String(s(c)),h=i(l),p=d.length;return h<0||h>=p?a?"":void 0:(u=d.charCodeAt(h),u<55296||u>56319||h+1===p||(f=d.charCodeAt(h+1))<56320||f>57343?a?d.charAt(h):u:a?d.slice(h,h+2):(u-55296<<10)+(f-56320)+65536)}}},function(t,o,e){var i=e(20),s=Math.max,a=Math.min;t.exports=function(c,l){return c=i(c),c<0?s(c+l,0):a(c,l)}},function(t,o,e){var i=e(15);t.exports=function(s){return Object(i(s))}},function(t,o,e){var i=e(21),s=e(1)("iterator"),a=e(10);t.exports=e(6).getIteratorMethod=function(c){if(c!=null)return c[s]||c["@@iterator"]||a[i(c)]}},function(t,o,e){"use strict";var i=e(37),s=e(47),a=e(10),c=e(13);t.exports=e(27)(Array,"Array",function(l,u){this._t=c(l),this._i=0,this._k=u},function(){var l=this._t,u=this._k,f=this._i++;return!l||f>=l.length?(this._t=void 0,s(1)):u=="keys"?s(0,f):u=="values"?s(0,l[f]):s(0,[f,l[f]])},"values"),a.Arguments=a.Array,i("keys"),i("values"),i("entries")},function(t,o){},function(t,o,e){"use strict";var i,s,a,c=e(28),l=e(2),u=e(7),f=e(21),d=e(23),h=e(9),p=(e(3),e(14)),g=e(38),T=e(40),k=(e(58).set,e(60)),_=e(30).set,x=e(48)(),b="Promise",A=l.TypeError,R=l.process,w=l[b],R=l.process,O=f(R)=="process",L=function(){},F=!!(function(){try{var m=w.resolve(1),y=(m.constructor={})[e(1)("species")]=function(E){E(L,L)};return(O||typeof PromiseRejectionEvent=="function")&&m.then(L)instanceof y}catch{}})(),X=function(m,y){return m===y||m===w&&y===a},z=function(m){var y;return!(!h(m)||typeof(y=m.then)!="function")&&y},G=function(m){return X(w,m)?new ie(m):new s(m)},ie=s=function(m){var y,E;this.promise=new m(function(P,K){if(y!==void 0||E!==void 0)throw A("Bad Promise constructor");y=P,E=K}),this.resolve=p(y),this.reject=p(E)},ye=function(m){try{m()}catch(y){return{error:y}}},ue=function(m,y){if(!m._n){m._n=!0;var E=m._c;x(function(){for(var P=m._v,K=m._s==1,fe=0,ve=function(ae){var ne,Ke,Pe=K?ae.ok:ae.fail,Ce=ae.resolve,we=ae.reject,Ge=ae.domain;try{Pe?(K||(m._h==2&&se(m),m._h=1),Pe===!0?ne=P:(Ge&&Ge.enter(),ne=Pe(P),Ge&&Ge.exit()),ne===ae.promise?we(A("Promise-chain cycle")):(Ke=z(ne))?Ke.call(ne,Ce,we):Ce(ne)):we(P)}catch(zn){we(zn)}};E.length>fe;)ve(E[fe++]);m._c=[],m._n=!1,y&&!m._h&&Ae(m)})}},Ae=function(m){_.call(l,function(){var y,E,P,K=m._v;if(H(m)&&(y=ye(function(){O?R.emit("unhandledRejection",K,m):(E=l.onunhandledrejection)?E({promise:m,reason:K}):(P=l.console)&&P.error&&P.error("Unhandled promise rejection",K)}),m._h=O||H(m)?2:1),m._a=void 0,y)throw y.error})},H=function(m){if(m._h==1)return!1;for(var y,E=m._a||m._c,P=0;E.length>P;)if(y=E[P++],y.fail||!H(y.promise))return!1;return!0},se=function(m){_.call(l,function(){var y;O?R.emit("rejectionHandled",m):(y=l.onrejectionhandled)&&y({promise:m,reason:m._v})})},W=function(m){var y=this;y._d||(y._d=!0,y=y._w||y,y._v=m,y._s=2,y._a||(y._a=y._c.slice()),ue(y,!0))},Oe=function(m){var y,E=this;if(!E._d){E._d=!0,E=E._w||E;try{if(E===m)throw A("Promise can't be resolved itself");(y=z(m))?x(function(){var P={_w:E,_d:!1};try{y.call(m,u(Oe,P,1),u(W,P,1))}catch(K){W.call(P,K)}}):(E._v=m,E._s=1,ue(E,!1))}catch(P){W.call({_w:E,_d:!1},P)}}};F||(w=function(m){g(this,w,b,"_h"),p(m),i.call(this);try{m(u(Oe,this,1),u(W,this,1))}catch(y){W.call(this,y)}},i=function(m){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},i.prototype=e(56)(w.prototype,{then:function(m,y){var E=G(k(this,w));return E.ok=typeof m!="function"||m,E.fail=typeof y=="function"&&y,E.domain=O?R.domain:void 0,this._c.push(E),this._a&&this._a.push(E),this._s&&ue(this,!1),E.promise},catch:function(m){return this.then(void 0,m)}}),ie=function(){var m=new i;this.promise=m,this.resolve=u(Oe,m,1),this.reject=u(W,m,1)}),d(d.G+d.W+d.F*!F,{Promise:w}),e(18)(w,b),e(59)(b),a=e(6)[b],d(d.S+d.F*!F,b,{reject:function(m){var y=G(this),E=y.reject;return E(m),y.promise}}),d(d.S+d.F*(c||!F),b,{resolve:function(m){if(m instanceof w&&X(m.constructor,this))return m;var y=G(this),E=y.resolve;return E(m),y.promise}}),d(d.S+d.F*!(F&&e(46)(function(m){w.all(m).catch(L)})),b,{all:function(m){var y=this,E=G(y),P=E.resolve,K=E.reject,fe=ye(function(){var ve=[],ae=0,ne=1;T(m,!1,function(Ke){var Pe=ae++,Ce=!1;ve.push(void 0),ne++,y.resolve(Ke).then(function(we){Ce||(Ce=!0,ve[Pe]=we,--ne||P(ve))},K)}),--ne||P(ve)});return fe&&K(fe.error),E.promise},race:function(m){var y=this,E=G(y),P=E.reject,K=ye(function(){T(m,!1,function(fe){y.resolve(fe).then(E.resolve,P)})});return K&&P(K.error),E.promise}})},function(t,o,e){"use strict";var i=e(61)(!0);e(27)(String,"String",function(s){this._t=String(s),this._i=0},function(){var s,a=this._t,c=this._i;return c>=a.length?{value:void 0,done:!0}:(s=i(a,c),this._i+=s.length,{value:s,done:!1})})},function(t,o,e){e(65);for(var i=e(2),s=e(5),a=e(10),c=e(1)("toStringTag"),l=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],u=0;u<5;u++){var f=l[u],d=i[f],h=d&&d.prototype;h&&!h[c]&&s(h,c,f),a[f]=a.Array}},function(t,o){t.exports=require("child_process")},function(t,o){t.exports=require("crypto")}])})});var jt=(r=0)=>n=>`\x1B[${n+r}m`,Ut=(r=0)=>n=>`\x1B[${38+r};5;${n}m`,Ft=(r=0)=>(n,t,o)=>`\x1B[${38+r};2;${n};${t};${o}m`,C={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},co=Object.keys(C.modifier),ir=Object.keys(C.color),sr=Object.keys(C.bgColor),lo=[...ir,...sr];function ar(){let r=new Map;for(let[n,t]of Object.entries(C)){for(let[o,e]of Object.entries(t))C[o]={open:`\x1B[${e[0]}m`,close:`\x1B[${e[1]}m`},t[o]=C[o],r.set(e[0],e[1]);Object.defineProperty(C,n,{value:t,enumerable:!1})}return Object.defineProperty(C,"codes",{value:r,enumerable:!1}),C.color.close="\x1B[39m",C.bgColor.close="\x1B[49m",C.color.ansi=jt(),C.color.ansi256=Ut(),C.color.ansi16m=Ft(),C.bgColor.ansi=jt(10),C.bgColor.ansi256=Ut(10),C.bgColor.ansi16m=Ft(10),Object.defineProperties(C,{rgbToAnsi256:{value(n,t,o){return n===t&&t===o?n<8?16:n>248?231:Math.round((n-8)/247*24)+232:16+36*Math.round(n/255*5)+6*Math.round(t/255*5)+Math.round(o/255*5)},enumerable:!1},hexToRgb:{value(n){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(n.toString(16));if(!t)return[0,0,0];let[o]=t;o.length===3&&(o=[...o].map(i=>i+i).join(""));let e=Number.parseInt(o,16);return[e>>16&255,e>>8&255,e&255]},enumerable:!1},hexToAnsi256:{value:n=>C.rgbToAnsi256(...C.hexToRgb(n)),enumerable:!1},ansi256ToAnsi:{value(n){if(n<8)return 30+n;if(n<16)return 90+(n-8);let t,o,e;if(n>=232)t=((n-232)*10+8)/255,o=t,e=t;else{n-=16;let a=n%36;t=Math.floor(n/36)/5,o=Math.floor(a/6)/5,e=a%6/5}let i=Math.max(t,o,e)*2;if(i===0)return 30;let s=30+(Math.round(e)<<2|Math.round(o)<<1|Math.round(t));return i===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(n,t,o)=>C.ansi256ToAnsi(C.rgbToAnsi256(n,t,o)),enumerable:!1},hexToAnsi:{value:n=>C.ansi256ToAnsi(C.hexToAnsi256(n)),enumerable:!1}}),C}var cr=ar(),Z=cr;var We=M(require("node:process"),1),Gt=M(require("node:os"),1),ut=M(require("node:tty"),1);function J(r,n=globalThis.Deno?globalThis.Deno.args:We.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",o=n.indexOf(t+r),e=n.indexOf("--");return o!==-1&&(e===-1||o<e)}var{env:I}=We.default,He;J("no-color")||J("no-colors")||J("color=false")||J("color=never")?He=0:(J("color")||J("colors")||J("color=true")||J("color=always"))&&(He=1);function lr(){if("FORCE_COLOR"in I)return I.FORCE_COLOR==="true"?1:I.FORCE_COLOR==="false"?0:I.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(I.FORCE_COLOR,10),3)}function ur(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function fr(r,{streamIsTTY:n,sniffFlags:t=!0}={}){let o=lr();o!==void 0&&(He=o);let e=t?He:o;if(e===0)return 0;if(t){if(J("color=16m")||J("color=full")||J("color=truecolor"))return 3;if(J("color=256"))return 2}if("TF_BUILD"in I&&"AGENT_NAME"in I)return 1;if(r&&!n&&e===void 0)return 0;let i=e||0;if(I.TERM==="dumb")return i;if(We.default.platform==="win32"){let s=Gt.default.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in I)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in I)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in I)||I.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in I)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(I.TEAMCITY_VERSION)?1:0;if(I.COLORTERM==="truecolor"||I.TERM==="xterm-kitty"||I.TERM==="xterm-ghostty"||I.TERM==="wezterm")return 3;if("TERM_PROGRAM"in I){let s=Number.parseInt((I.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(I.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(I.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(I.TERM)||"COLORTERM"in I?1:i}function Kt(r,n={}){let t=fr(r,{streamIsTTY:r&&r.isTTY,...n});return ur(t)}var pr={stdout:Kt({isTTY:ut.default.isatty(1)}),stderr:Kt({isTTY:ut.default.isatty(2)})},Ht=pr;function Wt(r,n,t){let o=r.indexOf(n);if(o===-1)return r;let e=n.length,i=0,s="";do s+=r.slice(i,o)+n+t,i=o+e,o=r.indexOf(n,i);while(o!==-1);return s+=r.slice(i),s}function Qt(r,n,t,o){let e=0,i="";do{let s=r[o-1]==="\r";i+=r.slice(e,s?o-1:o)+n+(s?`\r
9
9
  `:`
10
10
  `)+t,e=o+1,o=r.indexOf(`
11
- `,e)}while(o!==-1);return i+=r.slice(e),i}var{stdout:Yt,stderr:Vt}=Ht,lt=Symbol("GENERATOR"),Te=Symbol("STYLER"),Ie=Symbol("IS_EMPTY"),Jt=["ansi","ansi","ansi256","ansi16m"],Ee=Object.create(null),pr=(r,n={})=>{if(n.level&&!(Number.isInteger(n.level)&&n.level>=0&&n.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=Yt?Yt.level:0;r.level=n.level===void 0?t:n.level};var dr=r=>{let n=(...t)=>t.join(" ");return pr(n,r),Object.setPrototypeOf(n,Me.prototype),n};function Me(r){return dr(r)}Object.setPrototypeOf(Me.prototype,Function.prototype);for(let[r,n]of Object.entries(Z))Ee[r]={get(){let t=Qe(this,ft(n.open,n.close,this[Te]),this[Ie]);return Object.defineProperty(this,r,{value:t}),t}};Ee.visible={get(){let r=Qe(this,this[Te],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var ut=(r,n,t,...o)=>r==="rgb"?n==="ansi16m"?Z[t].ansi16m(...o):n==="ansi256"?Z[t].ansi256(Z.rgbToAnsi256(...o)):Z[t].ansi(Z.rgbToAnsi(...o)):r==="hex"?ut("rgb",n,t,...Z.hexToRgb(...o)):Z[t][r](...o),hr=["rgb","hex","ansi256"];for(let r of hr){Ee[r]={get(){let{level:t}=this;return function(...o){let e=ft(ut(r,Jt[t],"color",...o),Z.color.close,this[Te]);return Qe(this,e,this[Ie])}}};let n="bg"+r[0].toUpperCase()+r.slice(1);Ee[n]={get(){let{level:t}=this;return function(...o){let e=ft(ut(r,Jt[t],"bgColor",...o),Z.bgColor.close,this[Te]);return Qe(this,e,this[Ie])}}}}var mr=Object.defineProperties(()=>{},{...Ee,level:{enumerable:!0,get(){return this[lt].level},set(r){this[lt].level=r}}}),ft=(r,n,t)=>{let o,e;return t===void 0?(o=r,e=n):(o=t.openAll+r,e=n+t.closeAll),{open:r,close:n,openAll:o,closeAll:e,parent:t}},Qe=(r,n,t)=>{let o=(...e)=>gr(o,e.length===1?""+e[0]:e.join(" "));return Object.setPrototypeOf(o,mr),o[lt]=r,o[Te]=n,o[Ie]=t,o},gr=(r,n)=>{if(r.level<=0||!n)return r[Ie]?"":n;let t=r[Te];if(t===void 0)return n;let{openAll:o,closeAll:e}=t;if(n.includes("\x1B"))for(;t!==void 0;)n=Wt(n,t.close,t.open),t=t.parent;let i=n.indexOf(`
12
- `);return i!==-1&&(n=Qt(n,e,o,i)),o+n+e};Object.defineProperties(Me.prototype,Ee);var yr=Me(),go=Me({level:Vt?Vt.level:0});var v=yr;var Mt=M(Tn(),1),ke=require("child_process"),ge=M(require("path"),1),Yn=require("url"),ot=M(require("fs"),1),Vn=M(require("os"),1);var bn=M(En(),1),vt=M(require("crypto"),1),{machineIdSync:kr}=bn.default;async function be(r=null){let n=r||process.env.MACHINE_ID_SALT||"9remote-salt";try{let t=kr();return vt.default.createHash("sha256").update(t+n).digest("hex").substring(0,16)}catch(t){return console.error("Error getting machine ID:",t),vt.default.randomUUID().replace(/-/g,"").substring(0,16)}}var _n=M(require("crypto"),1),Rr=process.env.API_KEY_SECRET||"9remote-api-key-secret";function Ar(){let r="abcdefghijklmnopqrstuvwxyz0123456789",n="";for(let t=0;t<4;t++)n+=r.charAt(Math.floor(Math.random()*r.length));return n}function Or(r,n){return _n.default.createHmac("sha256",Rr).update(r+n).digest("hex").slice(0,6)}function _e(r){let n=r.slice(0,8),t=Ar(),o=Or(n,t);return{key:`sk-${n}-${t}-${o}`,keyId:t}}var q=M(require("fs"),1),Ne=M(require("path"),1),xn=M(require("os"),1),$e=Ne.default.join(xn.default.homedir(),".9remote"),Tt=Ne.default.join($e,"state.json"),Et=Ne.default.join($e,"keys.json"),wt=Ne.default.join($e,"cmd.json");function bt(){q.default.existsSync($e)||q.default.mkdirSync($e,{recursive:!0})}function _t(r){try{bt(),q.default.writeFileSync(Tt,JSON.stringify(r,null,2))}catch(n){console.error("Error saving state:",n)}}function Sn(){try{q.default.existsSync(Tt)&&q.default.unlinkSync(Tt)}catch{}}function Be(){try{return bt(),q.default.existsSync(Et)?JSON.parse(q.default.readFileSync(Et,"utf8")):{machineId:null,key:null,name:"Default",createdAt:null}}catch{return{machineId:null,key:null,name:"Default",createdAt:null}}}function kn(){try{if(!q.default.existsSync(wt))return null;let r=JSON.parse(q.default.readFileSync(wt,"utf8"));return q.default.unlinkSync(wt),r.cmd}catch{return null}}function xe(r,n,t="Default"){try{bt();let o={machineId:r,key:n,name:t,createdAt:new Date().toISOString()};return q.default.writeFileSync(Et,JSON.stringify(o,null,2)),o}catch(o){return console.error("Error saving key:",o),null}}async function De(r,n){try{let t=await fetch(`${n}/api/temp-key/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:r,expiryMinutes:30})});if(!t.ok){let o=await t.json();throw new Error(o.error||"Failed to create temp key")}return await t.json()}catch(t){return console.error("Error creating temp key:",t),null}}var de=require("fs"),Rn=require("url"),An=require("child_process"),je=M(require("path"),1),xt=M(require("os"),1),Pr=je.default.dirname((0,Rn.fileURLToPath)(__importMetaUrl)),Q="9remote",On=`https://registry.npmjs.org/${Q}/latest`,Pn=3e3,Cr=8e3;function Cn(){return"0.1.58"}function In(r,n){let t=r.split(".").map(Number),o=n.split(".").map(Number);for(let e=0;e<3;e++){if(o[e]>t[e])return!0;if(o[e]<t[e])return!1}return!1}function Ir(){return process.env.CODESPACES==="true"||process.env.GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN?"GitHub Codespaces":(0,de.existsSync)("/.dockerenv")?"Docker":null}async function Mn(){try{let r=Cn();if(!r)return null;let n=await fetch(On,{signal:AbortSignal.timeout(Pn)});if(!n.ok)return null;let{version:t}=await n.json();return t&&In(r,t)?{current:r,latest:t}:null}catch{return null}}async function Ln(r=!1){if(r)return!1;let n=Cn();if(!n)return!1;let t=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],o=0,e=null,i=a=>{process.stdout.isTTY&&(process.stdout.write(`\r${t[0]} ${a}`),e=setInterval(()=>{process.stdout.write(`\r${t[o++%t.length]} ${a}`)},80))},s=()=>{e&&(clearInterval(e),e=null),process.stdout.isTTY&&process.stdout.write("\r\x1B[K")};return new Promise(a=>{let c=!1,l=f=>{c||(c=!0,s(),a(f))},u=setTimeout(()=>l(!1),Cr);i("Checking for updates..."),fetch(On,{signal:AbortSignal.timeout(Pn)}).then(f=>f.json()).then(f=>{if(c)return;clearTimeout(u);let d=f.version;if(!d||!In(n,d)){l(!1);return}s(),console.log(v.green(`\u2705 New version available: ${n} \u2192 ${d}`));let h=Ir();if(h){console.log(v.yellow(` \u26A0\uFE0F ${h} detected - manual update required`)),console.log(v.gray(` Run: npm install -g ${Q}@latest
11
+ `,e)}while(o!==-1);return i+=r.slice(e),i}var{stdout:Yt,stderr:Vt}=Ht,ft=Symbol("GENERATOR"),Te=Symbol("STYLER"),Ie=Symbol("IS_EMPTY"),Jt=["ansi","ansi","ansi256","ansi16m"],Ee=Object.create(null),dr=(r,n={})=>{if(n.level&&!(Number.isInteger(n.level)&&n.level>=0&&n.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=Yt?Yt.level:0;r.level=n.level===void 0?t:n.level};var hr=r=>{let n=(...t)=>t.join(" ");return dr(n,r),Object.setPrototypeOf(n,Me.prototype),n};function Me(r){return hr(r)}Object.setPrototypeOf(Me.prototype,Function.prototype);for(let[r,n]of Object.entries(Z))Ee[r]={get(){let t=Qe(this,dt(n.open,n.close,this[Te]),this[Ie]);return Object.defineProperty(this,r,{value:t}),t}};Ee.visible={get(){let r=Qe(this,this[Te],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var pt=(r,n,t,...o)=>r==="rgb"?n==="ansi16m"?Z[t].ansi16m(...o):n==="ansi256"?Z[t].ansi256(Z.rgbToAnsi256(...o)):Z[t].ansi(Z.rgbToAnsi(...o)):r==="hex"?pt("rgb",n,t,...Z.hexToRgb(...o)):Z[t][r](...o),mr=["rgb","hex","ansi256"];for(let r of mr){Ee[r]={get(){let{level:t}=this;return function(...o){let e=dt(pt(r,Jt[t],"color",...o),Z.color.close,this[Te]);return Qe(this,e,this[Ie])}}};let n="bg"+r[0].toUpperCase()+r.slice(1);Ee[n]={get(){let{level:t}=this;return function(...o){let e=dt(pt(r,Jt[t],"bgColor",...o),Z.bgColor.close,this[Te]);return Qe(this,e,this[Ie])}}}}var gr=Object.defineProperties(()=>{},{...Ee,level:{enumerable:!0,get(){return this[ft].level},set(r){this[ft].level=r}}}),dt=(r,n,t)=>{let o,e;return t===void 0?(o=r,e=n):(o=t.openAll+r,e=n+t.closeAll),{open:r,close:n,openAll:o,closeAll:e,parent:t}},Qe=(r,n,t)=>{let o=(...e)=>yr(o,e.length===1?""+e[0]:e.join(" "));return Object.setPrototypeOf(o,gr),o[ft]=r,o[Te]=n,o[Ie]=t,o},yr=(r,n)=>{if(r.level<=0||!n)return r[Ie]?"":n;let t=r[Te];if(t===void 0)return n;let{openAll:o,closeAll:e}=t;if(n.includes("\x1B"))for(;t!==void 0;)n=Wt(n,t.close,t.open),t=t.parent;let i=n.indexOf(`
12
+ `);return i!==-1&&(n=Qt(n,e,o,i)),o+n+e};Object.defineProperties(Me.prototype,Ee);var vr=Me(),yo=Me({level:Vt?Vt.level:0});var v=vr;var Mt=M(Tn(),1),ke=require("child_process"),ge=M(require("path"),1),Vn=require("url"),st=M(require("fs"),1),Jn=M(require("os"),1);var bn=M(En(),1),Tt=M(require("crypto"),1),{machineIdSync:Rr}=bn.default;async function be(r=null){let n=r||process.env.MACHINE_ID_SALT||"9remote-salt";try{let t=Rr();return Tt.default.createHash("sha256").update(t+n).digest("hex").substring(0,16)}catch(t){return console.error("Error getting machine ID:",t),Tt.default.randomUUID().replace(/-/g,"").substring(0,16)}}var _n=M(require("crypto"),1),Ar=process.env.API_KEY_SECRET||"9remote-api-key-secret";function Or(){let r="abcdefghijklmnopqrstuvwxyz0123456789",n="";for(let t=0;t<4;t++)n+=r.charAt(Math.floor(Math.random()*r.length));return n}function Pr(r,n){return _n.default.createHmac("sha256",Ar).update(r+n).digest("hex").slice(0,6)}function _e(r){let n=r.slice(0,8),t=Or(),o=Pr(n,t);return{key:`sk-${n}-${t}-${o}`,keyId:t}}var Q=M(require("fs"),1),Ne=M(require("path"),1),xn=M(require("os"),1),$e=Ne.default.join(xn.default.homedir(),".9remote"),Et=Ne.default.join($e,"state.json"),bt=Ne.default.join($e,"keys.json"),qe=Ne.default.join($e,"cmd.json");function Xe(){Q.default.existsSync($e)||Q.default.mkdirSync($e,{recursive:!0})}function _t(r){try{Xe(),Q.default.writeFileSync(Et,JSON.stringify(r,null,2))}catch(n){console.error("Error saving state:",n)}}function Sn(){try{Q.default.existsSync(Et)&&Q.default.unlinkSync(Et)}catch{}}function Be(){try{return Xe(),Q.default.existsSync(bt)?JSON.parse(Q.default.readFileSync(bt,"utf8")):{machineId:null,key:null,name:"Default",createdAt:null}}catch{return{machineId:null,key:null,name:"Default",createdAt:null}}}function kn(r){try{Xe(),Q.default.writeFileSync(qe,JSON.stringify({cmd:r,ts:Date.now()}))}catch{}}function Rn(){try{if(!Q.default.existsSync(qe))return null;let r=JSON.parse(Q.default.readFileSync(qe,"utf8"));return Q.default.unlinkSync(qe),r.cmd}catch{return null}}function xe(r,n,t="Default"){try{Xe();let o={machineId:r,key:n,name:t,createdAt:new Date().toISOString()};return Q.default.writeFileSync(bt,JSON.stringify(o,null,2)),o}catch(o){return console.error("Error saving key:",o),null}}async function De(r,n){try{let t=await fetch(`${n}/api/temp-key/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:r,expiryMinutes:30})});if(!t.ok){let o=await t.json();throw new Error(o.error||"Failed to create temp key")}return await t.json()}catch(t){return console.error("Error creating temp key:",t),null}}var de=require("fs"),An=require("url"),On=require("child_process"),je=M(require("path"),1),xt=M(require("os"),1),Cr=je.default.dirname((0,An.fileURLToPath)(__importMetaUrl)),Y="9remote",Pn=`https://registry.npmjs.org/${Y}/latest`,Cn=3e3,Ir=8e3;function In(){return"0.1.60"}function Mn(r,n){let t=r.split(".").map(Number),o=n.split(".").map(Number);for(let e=0;e<3;e++){if(o[e]>t[e])return!0;if(o[e]<t[e])return!1}return!1}function Mr(){return process.env.CODESPACES==="true"||process.env.GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN?"GitHub Codespaces":(0,de.existsSync)("/.dockerenv")?"Docker":null}async function Ln(){try{let r=In();if(!r)return null;let n=await fetch(Pn,{signal:AbortSignal.timeout(Cn)});if(!n.ok)return null;let{version:t}=await n.json();return t&&Mn(r,t)?{current:r,latest:t}:null}catch{return null}}async function $n(r=!1){if(r)return!1;let n=In();if(!n)return!1;let t=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],o=0,e=null,i=a=>{process.stdout.isTTY&&(process.stdout.write(`\r${t[0]} ${a}`),e=setInterval(()=>{process.stdout.write(`\r${t[o++%t.length]} ${a}`)},80))},s=()=>{e&&(clearInterval(e),e=null),process.stdout.isTTY&&process.stdout.write("\r\x1B[K")};return new Promise(a=>{let c=!1,l=f=>{c||(c=!0,s(),a(f))},u=setTimeout(()=>l(!1),Ir);i("Checking for updates..."),fetch(Pn,{signal:AbortSignal.timeout(Cn)}).then(f=>f.json()).then(f=>{if(c)return;clearTimeout(u);let d=f.version;if(!d||!Mn(n,d)){l(!1);return}s(),console.log(v.green(`\u2705 New version available: ${n} \u2192 ${d}`));let h=Mr();if(h){console.log(v.yellow(` \u26A0\uFE0F ${h} detected - manual update required`)),console.log(v.gray(` Run: npm install -g ${Y}@latest
13
13
  `)),l(!1);return}console.log(v.yellow(`\u{1F504} Auto-updating...
14
14
  `));let g=process.argv.slice(2).filter(b=>b!=="--skip-update").join(" "),T=process.platform,k,_;if(T==="win32"){let b=`@echo off
15
15
  echo \u{1F4E5} Downloading update...
@@ -18,66 +18,66 @@ timeout /t 2 /nobreak >nul
18
18
 
19
19
  echo \u{1F504} Installing new version...
20
20
  call npm cache clean --force >nul 2>&1
21
- call npm install -g ${Q}@latest --prefer-online
21
+ call npm install -g ${Y}@latest --prefer-online
22
22
 
23
23
  if %ERRORLEVEL% EQU 0 (
24
24
  echo \u2705 Update completed successfully
25
25
  echo \u{1F680} Restarting with new version...
26
- ${Q} ${g} --skip-update
26
+ ${Y} ${g} --skip-update
27
27
  ) else (
28
28
  echo \u274C Update failed
29
- echo \u{1F4A1} Try manually: npm install -g ${Q}
29
+ echo \u{1F4A1} Try manually: npm install -g ${Y}
30
30
  echo \u{1F504} Starting with current version...
31
- ${Q} ${g} --skip-update
31
+ ${Y} ${g} --skip-update
32
32
  )
33
- `;k=je.default.join(xt.default.tmpdir(),`${Q}-update.bat`),(0,de.writeFileSync)(k,b),_=["cmd.exe",["/c",k]]}else{let b=`#!/bin/bash
33
+ `;k=je.default.join(xt.default.tmpdir(),`${Y}-update.bat`),(0,de.writeFileSync)(k,b),_=["cmd.exe",["/c",k]]}else{let b=`#!/bin/bash
34
34
  echo "\u{1F4E5} Downloading update..."
35
35
  echo "\u23F3 Waiting for process to exit..."
36
36
  sleep 1
37
37
 
38
- pkill -f "${Q}" 2>/dev/null || true
38
+ pkill -f "${Y}" 2>/dev/null || true
39
39
  sleep 1
40
40
 
41
41
  echo "\u{1F504} Installing new version..."
42
42
  npm cache clean --force 2>/dev/null
43
43
 
44
44
  # Try to install with full output for debugging
45
- npm install -g ${Q}@latest --prefer-online 2>&1
45
+ npm install -g ${Y}@latest --prefer-online 2>&1
46
46
  EXIT_CODE=$?
47
47
 
48
48
  if [ $EXIT_CODE -eq 0 ]; then
49
49
  echo "\u2705 Update completed successfully"
50
50
  echo "\u{1F680} Restarting with new version..."
51
- ${Q} ${g} --skip-update
51
+ ${Y} ${g} --skip-update
52
52
  else
53
53
  echo "\u274C Update failed (exit code: $EXIT_CODE)"
54
- echo "\u{1F4A1} Update manually: npm install -g ${Q}@latest"
54
+ echo "\u{1F4A1} Update manually: npm install -g ${Y}@latest"
55
55
  echo "\u{1F504} Starting with current version..."
56
- ${Q} ${g} --skip-update
56
+ ${Y} ${g} --skip-update
57
57
  fi
58
- `;k=je.default.join(xt.default.tmpdir(),`${Q}-update.sh`),(0,de.writeFileSync)(k,b,{mode:493}),_=["sh",[k]]}(0,An.spawn)(_[0],_[1],{detached:!0,stdio:"inherit"}).unref(),process.exit(0)}).catch(()=>{clearTimeout(u),l(!1)})})}var N=M(require("fs"),1),he=M(require("path"),1),Nn=M(require("https"),1),me=M(require("os"),1),Xe=require("child_process"),St=null,Mr=null,Lr=null,Ue=he.default.join(me.default.homedir(),".9remote","bin"),$n="cloudflared",kt=me.default.platform()==="win32",$r=kt?`${$n}.exe`:$n,Se=he.default.join(Ue,$r),qe=he.default.join(me.default.homedir(),".9remote","cloudflared.pid"),Rt=!1,Nr=5,Br=6e4,Fe=[],At=null,Dr="https://github.com/cloudflare/cloudflared/releases/latest/download",jr={darwin:{x64:"cloudflared-darwin-amd64.tgz",arm64:"cloudflared-darwin-amd64.tgz"},win32:{x64:"cloudflared-windows-amd64.exe"},linux:{x64:"cloudflared-linux-amd64",arm64:"cloudflared-linux-arm64"}};function Ur(){let r=me.default.platform(),n=me.default.arch(),t=jr[r];if(!t)throw new Error(`Unsupported platform: ${r}`);let o=t[n];if(!o)throw new Error(`Unsupported architecture: ${n} for platform ${r}`);return`${Dr}/${o}`}async function Bn(r,n){return new Promise((t,o)=>{let e=N.default.createWriteStream(n);Nn.default.get(r,i=>{if([301,302].includes(i.statusCode)){e.close(),N.default.unlinkSync(n),Bn(i.headers.location,n).then(t).catch(o);return}if(i.statusCode!==200){e.close(),N.default.unlinkSync(n),o(new Error(`Download failed with status ${i.statusCode}`));return}i.pipe(e),e.on("finish",()=>{e.close(()=>t(n))}),e.on("error",s=>{e.close(),N.default.unlinkSync(n),o(s)})}).on("error",i=>{e.close(),N.default.existsSync(n)&&N.default.unlinkSync(n),o(i)})})}async function ze(){if(N.default.existsSync(Ue)||N.default.mkdirSync(Ue,{recursive:!0}),N.default.existsSync(Se))return kt||N.default.chmodSync(Se,"755"),Se;console.log("\u{1F4E5} Downloading tunnel binary...");let r=Ur(),n=r.endsWith(".tgz"),t=n?he.default.join(Ue,"cloudflared.tgz"):Se;try{return await Bn(r,t),n&&(console.log("\u2705 Extracting..."),(0,Xe.execSync)(`tar -xzf "${t}" -C "${Ue}"`,{stdio:"pipe"}),N.default.unlinkSync(t)),kt||N.default.chmodSync(Se,"755"),console.log("\u2705 cloudflared ready"),Se}catch(o){throw console.error("\u274C Failed to download cloudflared:",o.message),o}}function Fr(r){let n=/https:\/\/([a-z0-9-]+)\.trycloudflare\.com/gi,t=[];for(let o of r.matchAll(n))o[1]!=="api"&&t.push(`https://${o[1]}.trycloudflare.com`);return t.length?t[t.length-1]:null}async function Ze(r,n=null){let t=await ze(),o=N.default.mkdtempSync(he.default.join(me.default.tmpdir(),"9remote-quick-")),e=he.default.join(o,"config.yml");N.default.writeFileSync(e,`# quick-tunnel
59
- `,"utf8");let i=!1,s=()=>{if(!i){i=!0;try{N.default.rmSync(o,{recursive:!0,force:!0})}catch{}}},a=(0,Xe.spawn)(t,["tunnel","--url",`http://localhost:${r}`,"--config",e,"--no-autoupdate"],{detached:!1,windowsHide:!0,stdio:["ignore","pipe","pipe"]});return N.default.writeFileSync(qe,a.pid.toString()),Rt=!1,new Promise((c,l)=>{let u=!1,f=null,d=setTimeout(()=>{u||(u=!0,s(),l(new Error("Quick tunnel timed out after 90s")))},9e4),h=p=>{let g=p.toString(),T=Fr(g);if(T){if(!u){u=!0,f=T,clearTimeout(d),s(),c({child:a,tunnelUrl:T});return}T!==f&&(f=T,n?.(T))}};a.stdout.on("data",h),a.stderr.on("data",h),a.on("error",p=>{u||(u=!0,clearTimeout(d),s(),l(p))}),a.on("exit",p=>{if(s(),!u){u=!0,clearTimeout(d),l(new Error(`cloudflared exited with code ${p}`));return}if(!Rt&&At){let g=Date.now();Fe.push(g),Fe=Fe.filter(T=>T>g-Br),Fe.length<=Nr&&setTimeout(()=>At(r),2e3)}})})}function Ot(){try{if(N.default.existsSync(qe)){Rt=!0;let r=parseInt(N.default.readFileSync(qe,"utf8"));process.kill(r),N.default.unlinkSync(qe),console.log("\u2705 Cloudflared killed")}}catch{}}function Dn(){Fe=[],At=null,Lr=null,Kr()}function Kr(){St&&(clearInterval(St),St=null),Mr=null}var Pt=M(require("readline"),1),Un=M(require("http"),1);var jn=require("child_process"),Gr={screenRecording:"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture",accessibility:"x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"};function et(r){let n=Gr[r];n&&process.platform==="darwin"&&(0,jn.exec)(`open "${n}"`,()=>{})}var S={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",orange:"\x1B[38;2;230;138;110m",green:"\x1B[32m",red:"\x1B[31m",yellow:"\x1B[33m",cyan:"\x1B[36m",white:"\x1B[37m"},Hr=()=>Math.min(44,process.stdout.columns||44);function nt(r,n=null){let o=Hr()-2,e=(s="")=>{let a=s.replace(/\x1b\[[0-9;]*m/g,""),c=Math.max(0,o-a.length);return S.orange+"\u2551"+S.reset+s+" ".repeat(c)+S.orange+"\u2551"+S.reset},i=(s,a=c=>c)=>{let c=s.replace(/\x1b\[[0-9;]*m/g,""),l=Math.floor((o-c.length)/2),u=o-c.length-l;return S.orange+"\u2551"+S.reset+" ".repeat(l)+a(s)+" ".repeat(u)+S.orange+"\u2551"+S.reset};if(console.log(""),console.log(S.orange+"\u2554"+"\u2550".repeat(o)+"\u2557"+S.reset),console.log(e()),console.log(i(`\u{1F680} 9Remote v${r}`,s=>S.bold+S.orange+s+S.reset)),console.log(i("Remote terminal access from anywhere",s=>S.dim+s+S.reset)),console.log(e()),n){let s=`\u2B06 New version v${n} available!`;console.log(i(s,c=>S.yellow+S.bold+c+S.reset)),console.log(i("Run: npm i -g 9remote@latest",c=>S.dim+c+S.reset)),console.log(e())}console.log(S.orange+"\u255A"+"\u2550".repeat(o)+"\u255D"+S.reset),console.log("")}var Wr=[{label:"Preparing",desc:"Checking dependencies"},{label:"Connecting",desc:"Creating session"},{label:"Starting tunnel",desc:"Spawning cloudflared"},{label:"Ready",desc:"Tunnel is live"}],tt=0;function rt(r,n=!1){n&&tt>0&&process.stdout.write(`\x1B[${tt}A\x1B[0J`);let t=[];Wr.forEach((o,e)=>{e<r?t.push(` ${S.green}\u2713${S.reset} ${S.dim}${o.label}${S.reset}`):e===r?t.push(` ${S.orange}\u25CF${S.reset} ${S.bold}${o.label}${S.reset} ${S.dim}${o.desc}${S.reset}`):t.push(` ${S.dim}\u25CB ${o.label}${S.reset}`)}),t.forEach(o=>console.log(o)),tt=t.length}function Fn(){tt=0}function Ct(r,n,t=0,o="",e=null,i=null){return new Promise(s=>{let a=t,c=!0,l=process.platform==="win32",u=()=>{if(!c)return;process.stdout.write("\x1B[2J\x1B[H");let h=typeof o=="function"?o():o;h&&process.stdout.write(h+`
58
+ `;k=je.default.join(xt.default.tmpdir(),`${Y}-update.sh`),(0,de.writeFileSync)(k,b,{mode:493}),_=["sh",[k]]}(0,On.spawn)(_[0],_[1],{detached:!0,stdio:"inherit"}).unref(),process.exit(0)}).catch(()=>{clearTimeout(u),l(!1)})})}var N=M(require("fs"),1),he=M(require("path"),1),Bn=M(require("https"),1),me=M(require("os"),1),Ze=require("child_process"),St=null,Lr=null,$r=null,Ue=he.default.join(me.default.homedir(),".9remote","bin"),Nn="cloudflared",kt=me.default.platform()==="win32",Nr=kt?`${Nn}.exe`:Nn,Se=he.default.join(Ue,Nr),ze=he.default.join(me.default.homedir(),".9remote","cloudflared.pid"),Rt=!1,Br=5,Dr=6e4,Fe=[],At=null,jr="https://github.com/cloudflare/cloudflared/releases/latest/download",Ur={darwin:{x64:"cloudflared-darwin-amd64.tgz",arm64:"cloudflared-darwin-amd64.tgz"},win32:{x64:"cloudflared-windows-amd64.exe"},linux:{x64:"cloudflared-linux-amd64",arm64:"cloudflared-linux-arm64"}};function Fr(){let r=me.default.platform(),n=me.default.arch(),t=Ur[r];if(!t)throw new Error(`Unsupported platform: ${r}`);let o=t[n];if(!o)throw new Error(`Unsupported architecture: ${n} for platform ${r}`);return`${jr}/${o}`}async function Dn(r,n){return new Promise((t,o)=>{let e=N.default.createWriteStream(n);Bn.default.get(r,i=>{if([301,302].includes(i.statusCode)){e.close(),N.default.unlinkSync(n),Dn(i.headers.location,n).then(t).catch(o);return}if(i.statusCode!==200){e.close(),N.default.unlinkSync(n),o(new Error(`Download failed with status ${i.statusCode}`));return}i.pipe(e),e.on("finish",()=>{e.close(()=>t(n))}),e.on("error",s=>{e.close(),N.default.unlinkSync(n),o(s)})}).on("error",i=>{e.close(),N.default.existsSync(n)&&N.default.unlinkSync(n),o(i)})})}async function et(){if(N.default.existsSync(Ue)||N.default.mkdirSync(Ue,{recursive:!0}),N.default.existsSync(Se))return kt||N.default.chmodSync(Se,"755"),Se;console.log("\u{1F4E5} Downloading tunnel binary...");let r=Fr(),n=r.endsWith(".tgz"),t=n?he.default.join(Ue,"cloudflared.tgz"):Se;try{return await Dn(r,t),n&&(console.log("\u2705 Extracting..."),(0,Ze.execSync)(`tar -xzf "${t}" -C "${Ue}"`,{stdio:"pipe"}),N.default.unlinkSync(t)),kt||N.default.chmodSync(Se,"755"),console.log("\u2705 cloudflared ready"),Se}catch(o){throw console.error("\u274C Failed to download cloudflared:",o.message),o}}function Kr(r){let n=/https:\/\/([a-z0-9-]+)\.trycloudflare\.com/gi,t=[];for(let o of r.matchAll(n))o[1]!=="api"&&t.push(`https://${o[1]}.trycloudflare.com`);return t.length?t[t.length-1]:null}async function tt(r,n=null){let t=await et(),o=N.default.mkdtempSync(he.default.join(me.default.tmpdir(),"9remote-quick-")),e=he.default.join(o,"config.yml");N.default.writeFileSync(e,`# quick-tunnel
59
+ `,"utf8");let i=!1,s=()=>{if(!i){i=!0;try{N.default.rmSync(o,{recursive:!0,force:!0})}catch{}}},a=(0,Ze.spawn)(t,["tunnel","--url",`http://localhost:${r}`,"--config",e,"--no-autoupdate"],{detached:!1,windowsHide:!0,stdio:["ignore","pipe","pipe"]});return N.default.writeFileSync(ze,a.pid.toString()),Rt=!1,new Promise((c,l)=>{let u=!1,f=null,d=setTimeout(()=>{u||(u=!0,s(),l(new Error("Quick tunnel timed out after 90s")))},9e4),h=p=>{let g=p.toString(),T=Kr(g);if(T){if(!u){u=!0,f=T,clearTimeout(d),s(),c({child:a,tunnelUrl:T});return}T!==f&&(f=T,n?.(T))}};a.stdout.on("data",h),a.stderr.on("data",h),a.on("error",p=>{u||(u=!0,clearTimeout(d),s(),l(p))}),a.on("exit",p=>{if(s(),!u){u=!0,clearTimeout(d),l(new Error(`cloudflared exited with code ${p}`));return}if(!Rt&&At){let g=Date.now();Fe.push(g),Fe=Fe.filter(T=>T>g-Dr),Fe.length<=Br&&setTimeout(()=>At(r),2e3)}})})}function Ot(){try{if(N.default.existsSync(ze)){Rt=!0;let r=parseInt(N.default.readFileSync(ze,"utf8"));process.kill(r),N.default.unlinkSync(ze),console.log("\u2705 Cloudflared killed")}}catch{}}function jn(){Fe=[],At=null,$r=null,Gr()}function Gr(){St&&(clearInterval(St),St=null),Lr=null}var Pt=M(require("readline"),1),Fn=M(require("http"),1);var Un=require("child_process"),Hr={screenRecording:"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture",accessibility:"x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"};function nt(r){let n=Hr[r];n&&process.platform==="darwin"&&(0,Un.exec)(`open "${n}"`,()=>{})}var S={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",orange:"\x1B[38;2;230;138;110m",green:"\x1B[32m",red:"\x1B[31m",yellow:"\x1B[33m",cyan:"\x1B[36m",white:"\x1B[37m"},Wr=()=>Math.min(44,process.stdout.columns||44);function ot(r,n=null){let o=Wr()-2,e=(s="")=>{let a=s.replace(/\x1b\[[0-9;]*m/g,""),c=Math.max(0,o-a.length);return S.orange+"\u2551"+S.reset+s+" ".repeat(c)+S.orange+"\u2551"+S.reset},i=(s,a=c=>c)=>{let c=s.replace(/\x1b\[[0-9;]*m/g,""),l=Math.floor((o-c.length)/2),u=o-c.length-l;return S.orange+"\u2551"+S.reset+" ".repeat(l)+a(s)+" ".repeat(u)+S.orange+"\u2551"+S.reset};if(console.log(""),console.log(S.orange+"\u2554"+"\u2550".repeat(o)+"\u2557"+S.reset),console.log(e()),console.log(i(`\u{1F680} 9Remote v${r}`,s=>S.bold+S.orange+s+S.reset)),console.log(i("Remote terminal access from anywhere",s=>S.dim+s+S.reset)),console.log(e()),n){let s=`\u2B06 New version v${n} available!`;console.log(i(s,c=>S.yellow+S.bold+c+S.reset)),console.log(i("Run: npm i -g 9remote@latest",c=>S.dim+c+S.reset)),console.log(e())}console.log(S.orange+"\u255A"+"\u2550".repeat(o)+"\u255D"+S.reset),console.log("")}var Qr=[{label:"Preparing",desc:"Checking dependencies"},{label:"Connecting",desc:"Creating session"},{label:"Starting tunnel",desc:"Spawning cloudflared"},{label:"Ready",desc:"Tunnel is live"}],rt=0;function it(r,n=!1){n&&rt>0&&process.stdout.write(`\x1B[${rt}A\x1B[0J`);let t=[];Qr.forEach((o,e)=>{e<r?t.push(` ${S.green}\u2713${S.reset} ${S.dim}${o.label}${S.reset}`):e===r?t.push(` ${S.orange}\u25CF${S.reset} ${S.bold}${o.label}${S.reset} ${S.dim}${o.desc}${S.reset}`):t.push(` ${S.dim}\u25CB ${o.label}${S.reset}`)}),t.forEach(o=>console.log(o)),rt=t.length}function Kn(){rt=0}function Ct(r,n,t=0,o="",e=null,i=null){return new Promise(s=>{let a=t,c=!0,l=process.platform==="win32",u=()=>{if(!c)return;process.stdout.write("\x1B[2J\x1B[H");let h=typeof o=="function"?o():o;h&&process.stdout.write(h+`
60
60
  `),process.stdout.write(`${S.dim}${r}${S.reset}
61
61
 
62
- `),n.forEach((p,g)=>{let T=g===a?l?">":"\u2605":l?" ":"\u2606";console.log(g===a?` \x1B[7m${S.bold}${T} ${p.label}${S.reset}`:` ${T} ${p.label}`)})},f=()=>{if(c){if(c=!1,process.stdin.isTTY)try{process.stdin.setRawMode(!1)}catch{}process.stdin.removeListener("keypress",d),process.stdin.pause()}},d=(h,p)=>{!c||!p||(p.name==="up"?(a=(a-1+n.length)%n.length,u()):p.name==="down"?(a=(a+1)%n.length,u()):p.name==="return"?(f(),s(a)):p.name==="escape"?(f(),s(-1)):p.ctrl&&p.name==="c"&&(f(),i&&i(),process.exit(0)))};if(process.stdin.removeAllListeners("keypress"),Pt.default.emitKeypressEvents(process.stdin),process.stdin.isTTY)try{process.stdin.setRawMode(!0)}catch{s(-1);return}process.stdin.on("keypress",d),process.stdin.resume(),u(),e&&e(u)})}function Kn(r){return new Promise(n=>{if(process.stdin.isTTY)try{process.stdin.setRawMode(!1)}catch{}process.stdin.removeAllListeners("keypress");let t=Pt.default.createInterface({input:process.stdin,output:process.stdout});t.question(`${r} (y/N): `,o=>{t.close(),n(o.trim().toLowerCase()==="y")})})}function Gn(r,n){let t=null,o=!1,e=()=>{o||(t=Un.default.get(`http://localhost:${r}/api/ui/events`,i=>{let s="";i.on("data",a=>{s+=a.toString();let c=s.split(`
63
- `);s=c.pop();let l="";for(let u of c)if(u.startsWith("data: "))l=u.slice(6);else if(u===""&&l){try{let f=JSON.parse(l);n(f.type,f)}catch{}l=""}}),i.on("end",()=>{o||setTimeout(e,2e3)})}),t.on("error",()=>{o||setTimeout(e,2e3)}))};return e(),()=>{o=!0,t?.destroy()}}var Qr=process.argv.includes("--skip-update"),st=ge.default.dirname((0,Yn.fileURLToPath)(__importMetaUrl)),qo=ge.default.resolve(st,"../.."),Yr=ge.default.resolve(st,"../dist/server.cjs"),Hn=ge.default.resolve(st,"../index.js"),U="https://9remote.cc",B=2208,It=10,Wn=6e4,te=v.rgb(230,138,110),Jn=v.rgb(200,120,95);function Lt(){return"0.1.58"}function Vr(r,n="\u{1F4F1} Scan QR to connect:"){console.log(te(`
64
- ${n}`)),Mt.default.generate(r,{small:!0,type:"terminal",margin:0},t=>{console.log(t.trim())})}function Jr(r){return new Promise(n=>{Mt.default.generate(r,{small:!0,type:"terminal",margin:0},t=>{n(Jn("\u{1F4F1} Scan QR to connect:")+`
65
- `+t.trim())})})}async function qn(r,n){let t=await De(r,U);if(!t){console.log(v.red("\u274C Failed to create temp key"));return}let o=`${U}/login?k=${t.tempKey}`,e=Math.min(44,process.stdout.columns||55);D({step:4,tunnelUrl:n,oneTimeKey:t.tempKey,oneTimeKeyExpiresAt:t.expiresAt,permanentKey:r,qrUrl:o,workerUrl:U}),Vr(o),console.log(v.gray(`
62
+ `),n.forEach((p,g)=>{let T=g===a?l?">":"\u2605":l?" ":"\u2606";console.log(g===a?` \x1B[7m${S.bold}${T} ${p.label}${S.reset}`:` ${T} ${p.label}`)})},f=()=>{if(c){if(c=!1,process.stdin.isTTY)try{process.stdin.setRawMode(!1)}catch{}process.stdin.removeListener("keypress",d),process.stdin.pause()}},d=(h,p)=>{!c||!p||(p.name==="up"?(a=(a-1+n.length)%n.length,u()):p.name==="down"?(a=(a+1)%n.length,u()):p.name==="return"?(f(),s(a)):p.name==="escape"?(f(),s(-1)):p.ctrl&&p.name==="c"&&(f(),i&&i(),process.exit(0)))};if(process.stdin.removeAllListeners("keypress"),Pt.default.emitKeypressEvents(process.stdin),process.stdin.isTTY)try{process.stdin.setRawMode(!0)}catch{s(-1);return}process.stdin.on("keypress",d),process.stdin.resume(),u(),e&&e(u)})}function Gn(r){return new Promise(n=>{if(process.stdin.isTTY)try{process.stdin.setRawMode(!1)}catch{}process.stdin.removeAllListeners("keypress");let t=Pt.default.createInterface({input:process.stdin,output:process.stdout});t.question(`${r} (y/N): `,o=>{t.close(),n(o.trim().toLowerCase()==="y")})})}function Hn(r,n){let t=null,o=!1,e=()=>{o||(t=Fn.default.get(`http://localhost:${r}/api/ui/events`,i=>{let s="";i.on("data",a=>{s+=a.toString();let c=s.split(`
63
+ `);s=c.pop();let l="";for(let u of c)if(u.startsWith("data: "))l=u.slice(6);else if(u===""&&l){try{let f=JSON.parse(l);n(f.type,f)}catch{}l=""}}),i.on("end",()=>{o||setTimeout(e,2e3)})}),t.on("error",()=>{o||setTimeout(e,2e3)}))};return e(),()=>{o=!0,t?.destroy()}}var Yr=process.argv.includes("--skip-update"),ct=ge.default.dirname((0,Vn.fileURLToPath)(__importMetaUrl)),Xo=ge.default.resolve(ct,"../.."),Vr=ge.default.resolve(ct,"../dist/server.cjs"),Wn=ge.default.resolve(ct,"../index.js"),U="https://9remote.cc",B=2208,It=10,Qn=6e4,te=v.rgb(230,138,110),qn=v.rgb(200,120,95);function Lt(){return"0.1.60"}function Jr(r,n="\u{1F4F1} Scan QR to connect:"){console.log(te(`
64
+ ${n}`)),Mt.default.generate(r,{small:!0,type:"terminal",margin:0},t=>{console.log(t.trim())})}function qr(r){return new Promise(n=>{Mt.default.generate(r,{small:!0,type:"terminal",margin:0},t=>{n(qn("\u{1F4F1} Scan QR to connect:")+`
65
+ `+t.trim())})})}async function Xn(r,n){let t=await De(r,U);if(!t){console.log(v.red("\u274C Failed to create temp key"));return}let o=`${U}/login?k=${t.tempKey}`,e=Math.min(44,process.stdout.columns||55);D({step:4,tunnelUrl:n,oneTimeKey:t.tempKey,oneTimeKeyExpiresAt:t.expiresAt,permanentKey:r,qrUrl:o,workerUrl:U}),Jr(o),console.log(v.gray(`
66
66
  QR will expire in 30 minutes (one-time use)
67
- `)),console.log(te("\u2550".repeat(e)));let i="App URL",s=`${U}/login`;console.log(v.white(i.padEnd(14))+v.gray(s));let a="One-Time Key",c=t.tempKey;console.log(v.white(a.padEnd(14))+te.bold(c));let l="Key",u=r;console.log(v.white(l.padEnd(14))+v.gray(u)),console.log(te("\u2550".repeat(e)))}async function it(r,n,t){let o=Math.min(44,process.stdout.columns||44),e=[];if(r&&t){let i=await Jr(t);e.push(i),e.push(v.gray(`
67
+ `)),console.log(te("\u2550".repeat(e)));let i="App URL",s=`${U}/login`;console.log(v.white(i.padEnd(14))+v.gray(s));let a="One-Time Key",c=t.tempKey;console.log(v.white(a.padEnd(14))+te.bold(c));let l="Key",u=r;console.log(v.white(l.padEnd(14))+v.gray(u)),console.log(te("\u2550".repeat(e)))}async function at(r,n,t){let o=Math.min(44,process.stdout.columns||44),e=[];if(r&&t){let i=await qr(t);e.push(i),e.push(v.gray(`
68
68
  QR expires in 30 minutes (one-time use)
69
69
  `))}else e.push(v.gray(`
70
70
  (One-time key used \u2014 generate a new one from menu)
71
71
  `));return e.push(te("\u2550".repeat(o)),v.white("App URL".padEnd(14))+v.gray(`${U}/login`),v.white("One-Time Key".padEnd(14))+(r?te.bold(r)+v.dim(" (expires in 30m)"):v.gray("\u2014")),v.white("Key".padEnd(14))+v.dim(n),te("\u2550".repeat(o))),e.join(`
72
- `)}function at(r){try{process.platform==="win32"?(0,ke.execSync)(`for /f "tokens=5" %a in ('netstat -aon ^| findstr :${r}') do taskkill /F /PID %a`,{stdio:"ignore"}):(0,ke.execSync)(`lsof -ti:${r} | xargs kill -9 2>/dev/null || true`,{stdio:"ignore"})}catch{}}function $t(r,n){let t=[],o=null,e=!1,i=!0,s=()=>{i&&(at(B),i=!1);let a=process.env.NODE_ENV==="development"&&ot.default.existsSync(Hn),c=a?Hn:Yr;ot.default.existsSync(c)||(console.error(`\u274C Server not found: ${c}`),process.exit(1));let l={...process.env,PORT:String(B)};a||delete l.NODE_ENV,o=(0,ke.spawn)("node",[c],{cwd:ge.default.dirname(c),stdio:["ignore","inherit","inherit"],detached:!1,env:l}),o.on("exit",(u,f)=>{if(!e&&(u!==0||f)){console.log(v.red(`
73
- \u{1F4A5} Server crashed (code: ${u}, signal: ${f})`));let d=Date.now();for(t.push(d);t.length>0&&t[0]<d-Wn;)t.shift();t.length>It&&(console.log(v.red(`\u274C Too many restarts (${It} in ${Wn/1e3}s). Giving up.`)),process.exit(1)),console.log(v.yellow(`\u{1F504} Restarting server... (attempt ${t.length}/${It})`)),console.log(Jn("\u26A0\uFE0F [DEBUG] NOTE: Tunnel connection may be stale - will restart tunnel")),n&&(console.log(v.yellow("\u2705 Restarting tunnel connection...")),n()),setTimeout(()=>{s()},1e3)}}),o.on("error",u=>{console.log(v.red(`\u274C Server error: ${u.message}`))}),r&&r(o)};return s(),{getProcess:()=>o,shutdown:()=>{e=!0,o&&o.kill()}}}var Qn=!1;function Nt(r,n,t){Qn||(Qn=!0,process.on("SIGINT",async()=>{console.log(v.yellow(`
72
+ `)}function lt(r){try{process.platform==="win32"?(0,ke.execSync)(`for /f "tokens=5" %a in ('netstat -aon ^| findstr :${r}') do taskkill /F /PID %a`,{stdio:"ignore"}):(0,ke.execSync)(`lsof -ti:${r} | xargs kill -9 2>/dev/null || true`,{stdio:"ignore"})}catch{}}function $t(r,n){let t=[],o=null,e=!1,i=!0,s=()=>{i&&(lt(B),i=!1);let a=process.env.NODE_ENV==="development"&&st.default.existsSync(Wn),c=a?Wn:Vr;st.default.existsSync(c)||(console.error(`\u274C Server not found: ${c}`),process.exit(1));let l={...process.env,PORT:String(B)};a||delete l.NODE_ENV,o=(0,ke.spawn)("node",[c],{cwd:ge.default.dirname(c),stdio:["ignore","inherit","inherit"],detached:!1,env:l}),o.on("exit",(u,f)=>{if(!e&&(u!==0||f)){console.log(v.red(`
73
+ \u{1F4A5} Server crashed (code: ${u}, signal: ${f})`));let d=Date.now();for(t.push(d);t.length>0&&t[0]<d-Qn;)t.shift();t.length>It&&(console.log(v.red(`\u274C Too many restarts (${It} in ${Qn/1e3}s). Giving up.`)),process.exit(1)),console.log(v.yellow(`\u{1F504} Restarting server... (attempt ${t.length}/${It})`)),console.log(qn("\u26A0\uFE0F [DEBUG] NOTE: Tunnel connection may be stale - will restart tunnel")),n&&(console.log(v.yellow("\u2705 Restarting tunnel connection...")),n()),setTimeout(()=>{s()},1e3)}}),o.on("error",u=>{console.log(v.red(`\u274C Server error: ${u.message}`))}),r&&r(o)};return s(),{getProcess:()=>o,shutdown:()=>{e=!0,o&&o.kill()}}}var Yn=!1;function Nt(r,n,t){Yn||(Yn=!0,process.on("SIGINT",async()=>{console.log(v.yellow(`
74
74
 
75
- \u{1F6D1} Stopping server...`)),r.shutdown(),n&&n.kill(),at(B),Dn(),Sn(),console.log(v.green("\u2705 Server stopped")),process.exit(0)}))}function qr(){let r=Vn.default.networkInterfaces();for(let n of Object.values(r))for(let t of n)if(t.family==="IPv4"&&!t.internal)return t.address;return null}async function D(r){try{await fetch(`http://localhost:${B}/api/ui/state`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}catch{}}async function Re(r,n){let t=qr();try{await fetch(`${U}/api/session/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:r,tunnelUrl:n,localIp:t?`${t}:${B}`:null})})}catch{}}async function Xr(r){console.log(te(`
76
- \u{1F680} Starting server...`)),D({step:1});try{Ot(),await new Promise(i=>setTimeout(i,500))}catch{}try{let i=await fetch(`${U}/api/session/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:r})});if(!i.ok){let s=await i.text();return console.log(v.red(`\u274C Failed to create session: ${i.status} ${s.substring(0,200)}`)),null}}catch(i){return console.log(v.red(`\u274C Failed to create session: ${i.message}`)),null}let n=await Bt(),t=n?{getProcess:()=>null,shutdown:()=>{}}:$t(null,null);n||await new Promise(i=>setTimeout(i,2e3)),console.log(te("\u2705 Starting tunnel...")),D({step:2});let o,e;try{let i=await Ze(B,async s=>{console.log(te(`\u{1F504} Tunnel URL rotated: ${s}`)),await Re(r,s),D({tunnelUrl:s})});o=i.child,e=i.tunnelUrl}catch(i){return console.log(v.red(`\u274C Failed to start tunnel: ${i.message}`)),t.shutdown(),null}return await Re(r,e),_t({apiKey:r,tunnelUrl:e,serverPid:t.getProcess()?.pid,tunnelPid:o.pid}),{serverManager:t,tunnelProcess:o,tunnelUrl:e}}async function zr(){console.clear();let r=await be(),n=Be();if(!n.key){let{key:p}=_e(r);n=xe(r,p,"Default")}let t={getProcess:()=>null,shutdown:()=>{}},[o]=await Promise.all([Mn(),(async()=>{await Bt()||(t=$t(null,null),await new Promise(g=>setTimeout(g,2e3)))})()]),e=Lt();nt(e,o?.latest??null),Fn(),rt(0);try{Ot(),await new Promise(p=>setTimeout(p,300))}catch{}await ze(),rt(1,!0);try{let p=await fetch(`${U}/api/session/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:n.key})});if(!p.ok)throw new Error(`Session create failed: ${p.status}`)}catch(p){console.log(v.red(`
77
- \u274C Failed to connect: ${p.message}`)),process.exit(1)}rt(2,!0);let i,s;try{let p=await Ze(B,async g=>{await Re(n.key,g),await D({tunnelUrl:g})});i=p.child,s=p.tunnelUrl}catch(p){console.log(v.red(`
78
- \u274C Tunnel failed: ${p.message}`)),process.exit(1)}await Re(n.key,s),_t({apiKey:n.key,tunnelUrl:s,tunnelPid:i.pid});let a=await De(n.key,U),c=a?`${U}/login?k=${a.tempKey}`:`${U}/login`;await D({step:4,tunnelUrl:s,oneTimeKey:a?.tempKey||"",oneTimeKeyExpiresAt:a?.expiresAt||null,permanentKey:n.key,qrUrl:c,workerUrl:U});let l=a?.tempKey||"",u=c,f=await it(l,n.key,u),d=null,h=Gn(B,async(p,g)=>{if(p==="state"){let T=g.permanentKey||n.key,k=g.oneTimeKey!==void 0?g.oneTimeKey:l,_=g.qrUrl!==void 0?g.qrUrl:u;(k!==l||T!==n.key)&&(l=k,u=_,g.permanentKey&&(n={...n,key:g.permanentKey}),f=await it(l,n.key,u),d?.())}else p==="permissions"&&d?.()});Nt({getProcess:t.getProcess,shutdown:()=>{t.shutdown(),h()}},i,n.key),await eo(n,s,()=>f,p=>{f=p},p=>{d=p},()=>{t.shutdown(),at(B),h()})}async function Zr(){try{let r=await fetch(`http://localhost:${B}/api/ui/state`);if(r.ok)return!!(await r.json()).desktopEnabled}catch{}return!1}async function eo(r,n,t=()=>"",o=()=>{},e=()=>{},i=null){for(;;){let a=`Remote Desktop: ${await Zr()?v.green("ON"):v.gray("OFF")} \u25B6`,c=[{label:"Open Web UI"},{label:"New One-Time Key"},{label:"Regenerate Permanent Key"},{label:a},{label:v.gray("Exit")}],l=null;e(()=>l?.());let u=await Ct("Select action",c,0,t,f=>{l=f},i);if(u===0){let f=`http://localhost:${B}`,d=process.platform==="darwin"?"open":process.platform==="win32"?"start":"xdg-open";(0,ke.spawn)(d,[f],{detached:!0,stdio:"ignore"}).unref(),console.log(v.green(`
75
+ \u{1F6D1} Stopping server...`)),r.shutdown(),n&&n.kill(),lt(B),jn(),Sn(),console.log(v.green("\u2705 Server stopped")),process.exit(0)}))}function Xr(){let r=Jn.default.networkInterfaces();for(let n of Object.values(r))for(let t of n)if(t.family==="IPv4"&&!t.internal)return t.address;return null}async function D(r){try{await fetch(`http://localhost:${B}/api/ui/state`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}catch{}}async function Re(r,n){let t=Xr();try{await fetch(`${U}/api/session/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:r,tunnelUrl:n,localIp:t?`${t}:${B}`:null})})}catch{}}async function zr(r){console.log(te(`
76
+ \u{1F680} Starting server...`)),D({step:1});try{Ot(),await new Promise(i=>setTimeout(i,500))}catch{}try{let i=await fetch(`${U}/api/session/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:r})});if(!i.ok){let s=await i.text();return console.log(v.red(`\u274C Failed to create session: ${i.status} ${s.substring(0,200)}`)),null}}catch(i){return console.log(v.red(`\u274C Failed to create session: ${i.message}`)),null}let n=await Bt(),t=n?{getProcess:()=>null,shutdown:()=>{}}:$t(null,null);n||await new Promise(i=>setTimeout(i,2e3)),console.log(te("\u2705 Starting tunnel...")),D({step:2});let o,e;try{let i=await tt(B,async s=>{console.log(te(`\u{1F504} Tunnel URL rotated: ${s}`)),await Re(r,s),D({tunnelUrl:s})});o=i.child,e=i.tunnelUrl}catch(i){return console.log(v.red(`\u274C Failed to start tunnel: ${i.message}`)),t.shutdown(),null}return await Re(r,e),_t({apiKey:r,tunnelUrl:e,serverPid:t.getProcess()?.pid,tunnelPid:o.pid}),{serverManager:t,tunnelProcess:o,tunnelUrl:e}}async function Zr(){console.clear();let r=await be(),n=Be();if(!n.key){let{key:p}=_e(r);n=xe(r,p,"Default")}let t={getProcess:()=>null,shutdown:()=>{}},[o]=await Promise.all([Ln(),(async()=>{await Bt()||(t=$t(null,null),await new Promise(g=>setTimeout(g,2e3)))})()]),e=Lt();ot(e,o?.latest??null),Kn(),it(0);try{Ot(),await new Promise(p=>setTimeout(p,300))}catch{}await et(),it(1,!0);try{let p=await fetch(`${U}/api/session/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:n.key})});if(!p.ok)throw new Error(`Session create failed: ${p.status}`)}catch(p){console.log(v.red(`
77
+ \u274C Failed to connect: ${p.message}`)),process.exit(1)}it(2,!0);let i,s;try{let p=await tt(B,async g=>{await Re(n.key,g),await D({tunnelUrl:g})});i=p.child,s=p.tunnelUrl}catch(p){console.log(v.red(`
78
+ \u274C Tunnel failed: ${p.message}`)),process.exit(1)}await Re(n.key,s),_t({apiKey:n.key,tunnelUrl:s,tunnelPid:i.pid});let a=await De(n.key,U),c=a?`${U}/login?k=${a.tempKey}`:`${U}/login`;await D({step:4,tunnelUrl:s,oneTimeKey:a?.tempKey||"",oneTimeKeyExpiresAt:a?.expiresAt||null,permanentKey:n.key,qrUrl:c,workerUrl:U});let l=a?.tempKey||"",u=c,f=await at(l,n.key,u),d=null,h=Hn(B,async(p,g)=>{if(p==="state"){let T=g.permanentKey||n.key,k=g.oneTimeKey!==void 0?g.oneTimeKey:l,_=g.qrUrl!==void 0?g.qrUrl:u;(k!==l||T!==n.key)&&(l=k,u=_,g.permanentKey&&(n={...n,key:g.permanentKey}),f=await at(l,n.key,u),d?.())}else p==="permissions"&&d?.()});Nt({getProcess:t.getProcess,shutdown:()=>{t.shutdown(),h()}},i,n.key),await to(n,s,()=>f,p=>{f=p},p=>{d=p},()=>{t.shutdown(),lt(B),h()})}async function eo(){try{let r=await fetch(`http://localhost:${B}/api/ui/state`);if(r.ok)return!!(await r.json()).desktopEnabled}catch{}return!1}async function to(r,n,t=()=>"",o=()=>{},e=()=>{},i=null){for(;;){let a=`Remote Desktop: ${await eo()?v.green("ON"):v.gray("OFF")} \u25B6`,c=[{label:"Open Web UI"},{label:"New One-Time Key"},{label:"Regenerate Permanent Key"},{label:a},{label:v.gray("Exit")}],l=null;e(()=>l?.());let u=await Ct("Select action",c,0,t,f=>{l=f},i);if(u===0){let f=`http://localhost:${B}`,d=process.platform==="darwin"?"open":process.platform==="win32"?"start":"xdg-open";(0,ke.spawn)(d,[f],{detached:!0,stdio:"ignore"}).unref(),console.log(v.green(`
79
79
  \u{1F310} Opening ${f}
80
- `))}else if(u===1){let f=await De(r.key,U);if(f){let d=`${U}/login?k=${f.tempKey}`;o(await it(f.tempKey,r.key,d)),await D({oneTimeKey:f.tempKey,oneTimeKeyExpiresAt:f.expiresAt,qrUrl:d})}}else if(u===2){if(await Kn(v.yellow("\u26A0\uFE0F Replace current key and disconnect all sessions? Continue?"))){let d=await be(),{key:h}=_e(d);r=xe(d,h,r.name||"Default"),await D({permanentKey:r.key});let p=await De(r.key,U);if(p){let g=`${U}/login?k=${p.tempKey}`;o(await it(p.tempKey,r.key,g)),await D({oneTimeKey:p.tempKey,oneTimeKeyExpiresAt:p.expiresAt,qrUrl:g})}}}else u===3?await to():(at(B),console.log(v.gray(`
80
+ `))}else if(u===1){let f=await De(r.key,U);if(f){let d=`${U}/login?k=${f.tempKey}`;o(await at(f.tempKey,r.key,d)),await D({oneTimeKey:f.tempKey,oneTimeKeyExpiresAt:f.expiresAt,qrUrl:d})}}else if(u===2){if(await Gn(v.yellow("\u26A0\uFE0F Replace current key and disconnect all sessions? Continue?"))){let d=await be(),{key:h}=_e(d);r=xe(d,h,r.name||"Default"),await D({permanentKey:r.key});let p=await De(r.key,U);if(p){let g=`${U}/login?k=${p.tempKey}`;o(await at(p.tempKey,r.key,g)),await D({oneTimeKey:p.tempKey,oneTimeKeyExpiresAt:p.expiresAt,qrUrl:g})}}}else u===3?await no():(lt(B),console.log(v.gray(`
81
81
  Goodbye!
82
- `)),process.exit(0))}}async function to(){for(;;){let r=!1,n={screenRecording:!1,accessibility:!1};try{let s=await fetch(`http://localhost:${B}/api/ui/state`);if(s.ok){let a=await s.json();r=!!a.desktopEnabled,n={screenRecording:!!a.screenRecording,accessibility:!!a.accessibility}}}catch{}let t=`Toggle: ${r?v.green("ON \u2192 turn OFF"):v.gray("OFF \u2192 turn ON")}`,o=`Screen Recording ${n.screenRecording?v.green("\u2713"):v.red("\u2717 (click to grant)")}`,e=`Mouse & Keyboard control ${n.accessibility?v.green("\u2713"):v.red("\u2717 (click to grant)")}`,i=await Ct("Remote Desktop",[{label:t},{label:o},{label:e},{label:v.gray("\u2190 Back")}],0);if(i===0)try{await fetch(`http://localhost:${B}/api/desktop/toggle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:!r})})}catch{}else if(i===1&&!n.screenRecording)try{await fetch(`http://localhost:${B}/api/permissions/request`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"screenRecording"})})}catch{et("screenRecording")}else if(i===2&&!n.accessibility)try{await fetch(`http://localhost:${B}/api/permissions/request`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"accessibility"})})}catch{et("accessibility")}else if(i===3||i===-1)return}}async function no(){nt(Lt());let r=await be(),n=Be();if(!n.key){console.log(v.yellow("\u26A0\uFE0F No key found. Creating default key..."));let{key:a}=_e(r);n=xe(r,a,"Default"),console.log(v.green("\u2705 Default key created!"))}console.log(v.gray(`Using key: ${n.key.slice(0,20)}... (${n.name})`));let t=await Xr(n.key);t||process.exit(1);let{serverManager:o,tunnelProcess:e,tunnelUrl:i}=t;await qn(n.key,i),Nt(o,e,n.key),setupKeyRegenListener();let s=Date.now();setInterval(()=>{let a=Math.floor((Date.now()-s)/1e3),c=Math.floor(a/3600),l=Math.floor(a%3600/60),u=a%60;D({uptime:`${c}:${String(l).padStart(2,"0")}:${String(u).padStart(2,"0")}`})},5e3),await new Promise(()=>{})}function ro(r,n,t){let o=!1;setInterval(async()=>{if(o)return;let e=kn();if(e){o=!0;try{if(e==="stop-tunnel"){let i=r();i&&(i.kill(),n(null),console.log(v.yellow("\u{1F6D1} Tunnel stopped"))),await D({step:0,tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null})}if(e==="start-tunnel"){if(r()){o=!1;return}console.log(te("\u{1F680} Starting tunnel..."));try{await D({step:1}),await ze(),await D({step:2});let i=await fetch(`${U}/api/session/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t})});if(!i.ok)throw new Error(`Session create failed: ${i.status}`);await D({step:3});let s=await Ze(B,async a=>{await Re(t,a),await D({tunnelUrl:a})});n(s.child),await Re(t,s.tunnelUrl),await qn(t,s.tunnelUrl)}catch(i){console.log(v.red(`\u274C Failed to start tunnel: ${i.message}`)),await D({step:0})}}if(e==="regenerate-key"){let i=await be(),{key:s}=_e(i),a=Be();xe(i,s,a?.name||"Default"),await D({permanentKey:s}),console.log(v.green(`\u2705 Key regenerated: ${s}`))}}finally{o=!1}}},1e3)}async function Bt(){try{return(await fetch(`http://localhost:${B}/api/health`)).ok}catch{return!1}}async function oo(){nt(Lt());let r=await be(),n=Be();if(!n.key){let{key:a}=_e(r);n=xe(r,a,"Default")}let t=await Bt(),o=t?{getProcess:()=>null,shutdown:()=>{}}:$t(null,null);t||await new Promise(a=>setTimeout(a,2e3)),console.log(v.green(`
83
- \u{1F310} UI ready at http://localhost:${B}`));let e=null,i=()=>e,s=a=>{e=a};await D({permanentKey:n.key,step:0}),Nt(o,null,n.key),ro(i,s,n.key),process.argv.includes("--start")&&writeCmd("start-tunnel"),await new Promise(()=>{})}async function io(){if(await Ln(Qr))return;let n=process.argv[2];n==="ui"?await oo():n==="start"||process.argv.includes("--auto")?await no():await zr()}io().catch(console.error);
82
+ `)),process.exit(0))}}async function no(){for(;;){let r=!1,n={screenRecording:!1,accessibility:!1};try{let s=await fetch(`http://localhost:${B}/api/ui/state`);if(s.ok){let a=await s.json();r=!!a.desktopEnabled,n={screenRecording:!!a.screenRecording,accessibility:!!a.accessibility}}}catch{}let t=`Toggle: ${r?v.green("ON \u2192 turn OFF"):v.gray("OFF \u2192 turn ON")}`,o=`Screen Recording ${n.screenRecording?v.green("\u2713"):v.red("\u2717 (click to grant)")}`,e=`Mouse & Keyboard control ${n.accessibility?v.green("\u2713"):v.red("\u2717 (click to grant)")}`,i=await Ct("Remote Desktop",[{label:t},{label:o},{label:e},{label:v.gray("\u2190 Back")}],0);if(i===0)try{await fetch(`http://localhost:${B}/api/desktop/toggle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:!r})})}catch{}else if(i===1&&!n.screenRecording)try{await fetch(`http://localhost:${B}/api/permissions/request`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"screenRecording"})})}catch{nt("screenRecording")}else if(i===2&&!n.accessibility)try{await fetch(`http://localhost:${B}/api/permissions/request`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"accessibility"})})}catch{nt("accessibility")}else if(i===3||i===-1)return}}async function ro(){ot(Lt());let r=await be(),n=Be();if(!n.key){console.log(v.yellow("\u26A0\uFE0F No key found. Creating default key..."));let{key:a}=_e(r);n=xe(r,a,"Default"),console.log(v.green("\u2705 Default key created!"))}console.log(v.gray(`Using key: ${n.key.slice(0,20)}... (${n.name})`));let t=await zr(n.key);t||process.exit(1);let{serverManager:o,tunnelProcess:e,tunnelUrl:i}=t;await Xn(n.key,i),Nt(o,e,n.key),setupKeyRegenListener();let s=Date.now();setInterval(()=>{let a=Math.floor((Date.now()-s)/1e3),c=Math.floor(a/3600),l=Math.floor(a%3600/60),u=a%60;D({uptime:`${c}:${String(l).padStart(2,"0")}:${String(u).padStart(2,"0")}`})},5e3),await new Promise(()=>{})}function oo(r,n,t){let o=!1;setInterval(async()=>{if(o)return;let e=Rn();if(e){o=!0;try{if(e==="stop-tunnel"){let i=r();i&&(i.kill(),n(null),console.log(v.yellow("\u{1F6D1} Tunnel stopped"))),await D({step:0,tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null})}if(e==="start-tunnel"){if(r()){o=!1;return}console.log(te("\u{1F680} Starting tunnel..."));try{await D({step:1}),await et(),await D({step:2});let i=await fetch(`${U}/api/session/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t})});if(!i.ok)throw new Error(`Session create failed: ${i.status}`);await D({step:3});let s=await tt(B,async a=>{await Re(t,a),await D({tunnelUrl:a})});n(s.child),await Re(t,s.tunnelUrl),await Xn(t,s.tunnelUrl)}catch(i){console.log(v.red(`\u274C Failed to start tunnel: ${i.message}`)),await D({step:0})}}if(e==="regenerate-key"){let i=await be(),{key:s}=_e(i),a=Be();xe(i,s,a?.name||"Default"),await D({permanentKey:s}),console.log(v.green(`\u2705 Key regenerated: ${s}`))}}finally{o=!1}}},1e3)}async function Bt(){try{return(await fetch(`http://localhost:${B}/api/health`)).ok}catch{return!1}}async function io(){ot(Lt());let r=await be(),n=Be();if(!n.key){let{key:a}=_e(r);n=xe(r,a,"Default")}let t=await Bt(),o=t?{getProcess:()=>null,shutdown:()=>{}}:$t(null,null);t||await new Promise(a=>setTimeout(a,2e3)),console.log(v.green(`
83
+ \u{1F310} UI ready at http://localhost:${B}`));let e=null,i=()=>e,s=a=>{e=a};await D({permanentKey:n.key,step:0}),Nt(o,null,n.key),oo(i,s,n.key),process.argv.includes("--start")&&kn("start-tunnel"),await new Promise(()=>{})}async function so(){if(await $n(Yr))return;let n=process.argv[2];n==="ui"?await io():n==="start"||process.argv.includes("--auto")?await ro():await Zr()}so().catch(console.error);
@@ -1 +1 @@
1
- @import"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap";@import"https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap";@import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{box-sizing:border-box;margin:0;padding:0}html,body,#root{height:100%;width:100%;overflow:hidden}body{font-family:Inter,sans-serif;background-color:#333;color:#fff;-webkit-font-smoothing:antialiased;-webkit-user-select:none;-moz-user-select:none;user-select:none}input,textarea{accent-color:var(--brand-500)}button{-webkit-user-select:none;-moz-user-select:none;user-select:none}.dot-grid-bg{background-color:var(--dark-800);background-image:radial-gradient(circle at 15% 20%,rgba(255,87,10,.2) 0%,transparent 45%),radial-gradient(circle at 85% 80%,rgba(255,87,10,.12) 0%,transparent 45%),linear-gradient(rgba(255,255,255,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.04) 1px,transparent 1px);background-size:100% 100%,100% 100%,40px 40px,40px 40px}.dark-card,.glass-card{background:var(--dark-600);border:1px solid var(--dark-400);border-radius:var(--radius-brand)}.glass-btn{background:#ffffff0f;border:1px solid rgba(255,255,255,.1);border-radius:8px;transition:all .2s ease}.glass-btn:hover{background:#ffffff1a;border-color:#ffffff2e}.btn-primary{background:var(--brand-500);border-radius:var(--radius-brand);color:#fff;font-weight:600;transition:all .2s ease;box-shadow:0 4px 16px #ff570a33}.btn-primary:hover{background:var(--brand-600);transform:scale(1.02)}.btn-primary:disabled{background:#ff570a4d;cursor:not-allowed;transform:none;box-shadow:none}.btn-danger{background:#dc35451f;border:1px solid rgba(220,53,69,.25);border-radius:var(--radius-brand);color:#ff6b7a;font-weight:600;transition:all .2s ease}.btn-danger:hover{background:#dc354538;border-color:#dc354566}.brand-text{font-family:"Press Start 2P",monospace;color:var(--brand-500);letter-spacing:.05em}.material-symbols-outlined{font-variation-settings:"FILL" 0,"wght" 400,"GRAD" 0,"opsz" 24}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.top-0\.5{top:.125rem}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mt-0\.5{margin-top:.125rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.inline{display:inline}.flex{display:flex}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-44{height:11rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-full{height:100%}.h-px{height:1px}.min-h-0{min-height:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-11{width:2.75rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-44{width:11rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\[220px\]{max-width:220px}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.border-white\/5{border-color:#ffffff0d}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-orange-400{--tw-bg-opacity: 1;background-color:rgb(251 146 60 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/5{background-color:#ffffff0d}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-2{padding-bottom:.5rem}.pt-2{padding-top:.5rem}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-6xl{font-size:3.75rem;line-height:1}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.tracking-\[0\.18em\]{letter-spacing:.18em}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/20{color:#fff3}.text-white\/25{color:#ffffff40}.text-white\/30{color:#ffffff4d}.text-white\/40{color:#fff6}.text-white\/50{color:#ffffff80}.text-white\/60{color:#fff9}.text-white\/70{color:#ffffffb3}.text-white\/80{color:#fffc}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{--brand-500: #FF570A;--brand-600: #e04400;--brand-400: #ff6e33;--dark-400: #404040;--dark-500: #252525;--dark-600: #1a1a1a;--dark-700: #121212;--dark-800: #0d0d0d;--dark-100: #a0a0a0;--radius-brand: 12px;--radius-brand-lg: 16px}@keyframes pulse-ring{0%{transform:scale(.8);opacity:1}to{transform:scale(1.6);opacity:0}}.pulse-ring{animation:pulse-ring 1.4s ease-out infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.spin{animation:spin 1s linear infinite}@keyframes dot-bounce{0%,80%,to{transform:scale(.6);opacity:.4}40%{transform:scale(1);opacity:1}}.dot-bounce{animation:dot-bounce 1s ease-in-out infinite}.last\:border-0:last-child{border-width:0px}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:opacity-80:hover{opacity:.8}
1
+ @import"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap";@import"https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap";@import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{box-sizing:border-box;margin:0;padding:0}html,body,#root{height:100%;width:100%;overflow:hidden}body{font-family:Inter,sans-serif;background-color:#333;color:#fff;-webkit-font-smoothing:antialiased;-webkit-user-select:none;-moz-user-select:none;user-select:none}input,textarea{accent-color:var(--brand-500)}button{-webkit-user-select:none;-moz-user-select:none;user-select:none}.dot-grid-bg{background-color:var(--dark-800);background-image:radial-gradient(circle at 15% 20%,rgba(255,87,10,.2) 0%,transparent 45%),radial-gradient(circle at 85% 80%,rgba(255,87,10,.12) 0%,transparent 45%),linear-gradient(rgba(255,255,255,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.04) 1px,transparent 1px);background-size:100% 100%,100% 100%,40px 40px,40px 40px}.dark-card,.glass-card{background:var(--dark-600);border:1px solid var(--dark-400);border-radius:var(--radius-brand)}.glass-btn{background:#ffffff0f;border:1px solid rgba(255,255,255,.1);border-radius:8px;transition:all .2s ease}.glass-btn:hover{background:#ffffff1a;border-color:#ffffff2e}.btn-primary{background:var(--brand-500);border-radius:var(--radius-brand);color:#fff;font-weight:600;transition:all .2s ease;box-shadow:0 4px 16px #ff570a33}.btn-primary:hover{background:var(--brand-600);transform:scale(1.02)}.btn-primary:disabled{background:#ff570a4d;cursor:not-allowed;transform:none;box-shadow:none}.btn-danger{background:#dc35451f;border:1px solid rgba(220,53,69,.25);border-radius:var(--radius-brand);color:#ff6b7a;font-weight:600;transition:all .2s ease}.btn-danger:hover{background:#dc354538;border-color:#dc354566}.brand-text{font-family:"Press Start 2P",monospace;color:var(--brand-500);letter-spacing:.05em}.material-symbols-outlined{font-variation-settings:"FILL" 0,"wght" 400,"GRAD" 0,"opsz" 24}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.top-0\.5{top:.125rem}.z-50{z-index:50}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mt-0\.5{margin-top:.125rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.inline{display:inline}.flex{display:flex}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-44{height:11rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-full{height:100%}.h-px{height:1px}.min-h-0{min-height:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-11{width:2.75rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-44{width:11rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\[220px\]{max-width:220px}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.border-white\/5{border-color:#ffffff0d}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-orange-400{--tw-bg-opacity: 1;background-color:rgb(251 146 60 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/5{background-color:#ffffff0d}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-2{padding-bottom:.5rem}.pt-2{padding-top:.5rem}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-6xl{font-size:3.75rem;line-height:1}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-tight{line-height:1.25}.tracking-\[0\.18em\]{letter-spacing:.18em}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/20{color:#fff3}.text-white\/25{color:#ffffff40}.text-white\/30{color:#ffffff4d}.text-white\/40{color:#fff6}.text-white\/50{color:#ffffff80}.text-white\/60{color:#fff9}.text-white\/70{color:#ffffffb3}.text-white\/80{color:#fffc}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{--brand-500: #FF570A;--brand-600: #e04400;--brand-400: #ff6e33;--dark-400: #404040;--dark-500: #252525;--dark-600: #1a1a1a;--dark-700: #121212;--dark-800: #0d0d0d;--dark-100: #a0a0a0;--radius-brand: 12px;--radius-brand-lg: 16px}@keyframes pulse-ring{0%{transform:scale(.8);opacity:1}to{transform:scale(1.6);opacity:0}}.pulse-ring{animation:pulse-ring 1.4s ease-out infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.spin{animation:spin 1s linear infinite}@keyframes dot-bounce{0%,80%,to{transform:scale(.6);opacity:.4}40%{transform:scale(1);opacity:1}}.dot-bounce{animation:dot-bounce 1s ease-in-out infinite}.last\:border-0:last-child{border-width:0px}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:opacity-80:hover{opacity:.8}
@@ -0,0 +1,8 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function i(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(n){if(n.ep)return;n.ep=!0;const r=i(n);fetch(n.href,r)}})();var ue,B,jt,j,et,Ot,Vt,Jt,Ve,He,Ke,oe={},se=[],dn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,fe=Array.isArray;function F(e,t){for(var i in t)e[i]=t[i];return e}function Je(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function hn(e,t,i){var o,n,r,s={};for(r in t)r=="key"?o=t[r]:r=="ref"?n=t[r]:s[r]=t[r];if(arguments.length>2&&(s.children=arguments.length>3?ue.call(arguments,2):i),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)s[r]===void 0&&(s[r]=e.defaultProps[r]);return ne(e,s,o,n,null)}function ne(e,t,i,o,n){var r={type:e,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++jt,__i:-1,__u:0};return n==null&&B.vnode!=null&&B.vnode(r),r}function H(e){return e.children}function re(e,t){this.props=e,this.context=t}function G(e,t){if(t==null)return e.__?G(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if((i=e.__k[t])!=null&&i.__e!=null)return i.__e;return typeof e.type=="function"?G(e):null}function _n(e){if(e.__P&&e.__d){var t=e.__v,i=t.__e,o=[],n=[],r=F({},t);r.__v=t.__v+1,B.vnode&&B.vnode(r),Ye(e.__P,r,t,e.__n,e.__P.namespaceURI,32&t.__u?[i]:null,o,i??G(t),!!(32&t.__u),n),r.__v=t.__v,r.__.__k[r.__i]=r,Qt(o,r,n),t.__e=t.__=null,r.__e!=i&&Yt(r)}}function Yt(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Yt(e)}function tt(e){(!e.__d&&(e.__d=!0)&&j.push(e)&&!le.__r++||et!=B.debounceRendering)&&((et=B.debounceRendering)||Ot)(le)}function le(){try{for(var e,t=1;j.length;)j.length>t&&j.sort(Vt),e=j.shift(),t=j.length,_n(e)}finally{j.length=le.__r=0}}function Gt(e,t,i,o,n,r,s,l,a,f,h){var c,_,d,b,N,R,p,w=o&&o.__k||se,E=t.length;for(a=mn(i,t,w,a,E),c=0;c<E;c++)(d=i.__k[c])!=null&&(_=d.__i!=-1&&w[d.__i]||oe,d.__i=c,R=Ye(e,d,_,n,r,s,l,a,f,h),b=d.__e,d.ref&&_.ref!=d.ref&&(_.ref&&Ge(_.ref,null,d),h.push(d.ref,d.__c||b,d)),N==null&&b!=null&&(N=b),(p=!!(4&d.__u))||_.__k===d.__k?a=Wt(d,a,e,p):typeof d.type=="function"&&R!==void 0?a=R:b&&(a=b.nextSibling),d.__u&=-7);return i.__e=N,a}function mn(e,t,i,o,n){var r,s,l,a,f,h=i.length,c=h,_=0;for(e.__k=new Array(n),r=0;r<n;r++)(s=t[r])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[r]=ne(null,s,null,null,null):fe(s)?s=e.__k[r]=ne(H,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[r]=ne(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[r]=s,a=r+_,s.__=e,s.__b=e.__b+1,l=null,(f=s.__i=gn(s,i,a,c))!=-1&&(c--,(l=i[f])&&(l.__u|=2)),l==null||l.__v==null?(f==-1&&(n>h?_--:n<h&&_++),typeof s.type!="function"&&(s.__u|=4)):f!=a&&(f==a-1?_--:f==a+1?_++:(f>a?_--:_++,s.__u|=4))):e.__k[r]=null;if(c)for(r=0;r<h;r++)(l=i[r])!=null&&(2&l.__u)==0&&(l.__e==o&&(o=G(l)),Zt(l,l));return o}function Wt(e,t,i,o){var n,r;if(typeof e.type=="function"){for(n=e.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=e,t=Wt(n[r],t,i,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=G(e)),i.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function gn(e,t,i,o){var n,r,s,l=e.key,a=e.type,f=t[i],h=f!=null&&(2&f.__u)==0;if(f===null&&l==null||h&&l==f.key&&a==f.type)return i;if(o>(h?1:0)){for(n=i-1,r=i+1;n>=0||r<t.length;)if((f=t[s=n>=0?n--:r++])!=null&&(2&f.__u)==0&&l==f.key&&a==f.type)return s}return-1}function nt(e,t,i){t[0]=="-"?e.setProperty(t,i??""):e[t]=i==null?"":typeof i!="number"||dn.test(t)?i:i+"px"}function $(e,t,i,o,n){var r,s;e:if(t=="style")if(typeof i=="string")e.style.cssText=i;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)i&&t in i||nt(e.style,t,"");if(i)for(t in i)o&&i[t]==o[t]||nt(e.style,t,i[t])}else if(t[0]=="o"&&t[1]=="n")r=t!=(t=t.replace(Jt,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=i,i?o?i.u=o.u:(i.u=Ve,e.addEventListener(t,r?Ke:He,r)):e.removeEventListener(t,r?Ke:He,r);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=i??"";break e}catch{}typeof i=="function"||(i==null||i===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&i==1?"":i))}}function rt(e){return function(t){if(this.l){var i=this.l[t.type+e];if(t.t==null)t.t=Ve++;else if(t.t<i.u)return;return i(B.event?B.event(t):t)}}}function Ye(e,t,i,o,n,r,s,l,a,f){var h,c,_,d,b,N,R,p,w,E,y,x,m,C,v,g=t.type;if(t.constructor!==void 0)return null;128&i.__u&&(a=!!(32&i.__u),r=[l=t.__e=i.__e]),(h=B.__b)&&h(t);e:if(typeof g=="function")try{if(p=t.props,w=g.prototype&&g.prototype.render,E=(h=g.contextType)&&o[h.__c],y=h?E?E.props.value:h.__:o,i.__c?R=(c=t.__c=i.__c).__=c.__E:(w?t.__c=c=new g(p,y):(t.__c=c=new re(p,y),c.constructor=g,c.render=yn),E&&E.sub(c),c.state||(c.state={}),c.__n=o,_=c.__d=!0,c.__h=[],c._sb=[]),w&&c.__s==null&&(c.__s=c.state),w&&g.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=F({},c.__s)),F(c.__s,g.getDerivedStateFromProps(p,c.__s))),d=c.props,b=c.state,c.__v=t,_)w&&g.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),w&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(w&&g.getDerivedStateFromProps==null&&p!==d&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(p,y),t.__v==i.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(p,c.__s,y)===!1){t.__v!=i.__v&&(c.props=p,c.state=c.__s,c.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(k){k&&(k.__=t)}),se.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&s.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(p,c.__s,y),w&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(d,b,N)})}if(c.context=y,c.props=p,c.__P=e,c.__e=!1,x=B.__r,m=0,w)c.state=c.__s,c.__d=!1,x&&x(t),h=c.render(c.props,c.state,c.context),se.push.apply(c.__h,c._sb),c._sb=[];else do c.__d=!1,x&&x(t),h=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++m<25);c.state=c.__s,c.getChildContext!=null&&(o=F(F({},o),c.getChildContext())),w&&!_&&c.getSnapshotBeforeUpdate!=null&&(N=c.getSnapshotBeforeUpdate(d,b)),C=h!=null&&h.type===H&&h.key==null?Xt(h.props.children):h,l=Gt(e,fe(C)?C:[C],t,i,o,n,r,s,l,a,f),c.base=t.__e,t.__u&=-161,c.__h.length&&s.push(c),R&&(c.__E=c.__=null)}catch(k){if(t.__v=null,a||r!=null)if(k.then){for(t.__u|=a?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;r[r.indexOf(l)]=null,t.__e=l}else{for(v=r.length;v--;)Je(r[v]);ze(t)}else t.__e=i.__e,t.__k=i.__k,k.then||ze(t);B.__e(k,t,i)}else r==null&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):l=t.__e=pn(i.__e,t,i,o,n,r,s,a,f);return(h=B.diffed)&&h(t),128&t.__u?void 0:l}function ze(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ze))}function Qt(e,t,i){for(var o=0;o<i.length;o++)Ge(i[o],i[++o],i[++o]);B.__c&&B.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){B.__e(r,n.__v)}})}function Xt(e){return typeof e!="object"||e==null||e.__b>0?e:fe(e)?e.map(Xt):F({},e)}function pn(e,t,i,o,n,r,s,l,a){var f,h,c,_,d,b,N,R=i.props||oe,p=t.props,w=t.type;if(w=="svg"?n="http://www.w3.org/2000/svg":w=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),r!=null){for(f=0;f<r.length;f++)if((d=r[f])&&"setAttribute"in d==!!w&&(w?d.localName==w:d.nodeType==3)){e=d,r[f]=null;break}}if(e==null){if(w==null)return document.createTextNode(p);e=document.createElementNS(n,w,p.is&&p),l&&(B.__m&&B.__m(t,r),l=!1),r=null}if(w==null)R===p||l&&e.data==p||(e.data=p);else{if(r=r&&ue.call(e.childNodes),!l&&r!=null)for(R={},f=0;f<e.attributes.length;f++)R[(d=e.attributes[f]).name]=d.value;for(f in R)d=R[f],f=="dangerouslySetInnerHTML"?c=d:f=="children"||f in p||f=="value"&&"defaultValue"in p||f=="checked"&&"defaultChecked"in p||$(e,f,null,d,n);for(f in p)d=p[f],f=="children"?_=d:f=="dangerouslySetInnerHTML"?h=d:f=="value"?b=d:f=="checked"?N=d:l&&typeof d!="function"||R[f]===d||$(e,f,d,R[f],n);if(h)l||c&&(h.__html==c.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),Gt(t.type=="template"?e.content:e,fe(_)?_:[_],t,i,o,w=="foreignObject"?"http://www.w3.org/1999/xhtml":n,r,s,r?r[0]:i.__k&&G(i,0),l,a),r!=null)for(f=r.length;f--;)Je(r[f]);l||(f="value",w=="progress"&&b==null?e.removeAttribute("value"):b!=null&&(b!==e[f]||w=="progress"&&!b||w=="option"&&b!=R[f])&&$(e,f,b,R[f],n),f="checked",N!=null&&N!=e[f]&&$(e,f,N,R[f],n))}return e}function Ge(e,t,i){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(n){B.__e(n,i)}}function Zt(e,t,i){var o,n;if(B.unmount&&B.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Ge(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(r){B.__e(r,t)}o.base=o.__P=null}if(o=e.__k)for(n=0;n<o.length;n++)o[n]&&Zt(o[n],t,i||typeof e.type!="function");i||Je(e.__e),e.__c=e.__=e.__e=void 0}function yn(e,t,i){return this.constructor(e,i)}function wn(e,t,i){var o,n,r,s;t==document&&(t=document.documentElement),B.__&&B.__(e,t),n=(o=!1)?null:t.__k,r=[],s=[],Ye(t,e=t.__k=hn(H,null,[e]),n||oe,oe,t.namespaceURI,n?null:t.firstChild?ue.call(t.childNodes):null,r,n?n.__e:t.firstChild,o,s),Qt(r,e,s)}ue=se.slice,B={__e:function(e,t,i,o){for(var n,r,s;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&r.getDerivedStateFromError!=null&&(n.setState(r.getDerivedStateFromError(e)),s=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,o||{}),s=n.__d),s)return n.__E=n}catch(l){e=l}throw e}},jt=0,re.prototype.setState=function(e,t){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=F({},this.state),typeof e=="function"&&(e=e(F({},i),this.props)),e&&F(i,e),e!=null&&this.__v&&(t&&this._sb.push(t),tt(this))},re.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),tt(this))},re.prototype.render=H,j=[],Ot=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vt=function(e,t){return e.__v.__b-t.__v.__b},le.__r=0,Jt=/(PointerCapture)$|Capture$/i,Ve=0,He=rt(!1),Ke=rt(!0);var bn=0;function u(e,t,i,o,n,r){t||(t={});var s,l,a=t;if("ref"in a)for(l in a={},t)l=="ref"?s=t[l]:a[l]=t[l];var f={type:e,props:a,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--bn,__i:-1,__u:0,__source:n,__self:r};if(typeof e=="function"&&(s=e.defaultProps))for(l in s)a[l]===void 0&&(a[l]=s[l]);return B.vnode&&B.vnode(f),f}var X,M,ge,it,ae=0,$t=[],I=B,ot=I.__b,st=I.__r,lt=I.diffed,at=I.__c,ct=I.unmount,ut=I.__;function We(e,t){I.__h&&I.__h(M,e,ae||t),ae=0;var i=M.__H||(M.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function L(e){return ae=1,xn(nn,e)}function xn(e,t,i){var o=We(X++,2);if(o.t=e,!o.__c&&(o.__=[nn(void 0,t),function(l){var a=o.__N?o.__N[0]:o.__[0],f=o.t(a,l);a!==f&&(o.__N=[f,o.__[1]],o.__c.setState({}))}],o.__c=M,!M.__f)){var n=function(l,a,f){if(!o.__c.__H)return!0;var h=o.__c.__H.__.filter(function(_){return _.__c});if(h.every(function(_){return!_.__N}))return!r||r.call(this,l,a,f);var c=o.__c.props!==l;return h.some(function(_){if(_.__N){var d=_.__[0];_.__=_.__N,_.__N=void 0,d!==_.__[0]&&(c=!0)}}),r&&r.call(this,l,a,f)||c};M.__f=!0;var r=M.shouldComponentUpdate,s=M.componentWillUpdate;M.componentWillUpdate=function(l,a,f){if(this.__e){var h=r;r=void 0,n(l,a,f),r=h}s&&s.call(this,l,a,f)},M.shouldComponentUpdate=n}return o.__N||o.__}function ce(e,t){var i=We(X++,3);!I.__s&&tn(i.__H,t)&&(i.__=e,i.u=t,M.__H.__h.push(i))}function en(e){return ae=5,vn(function(){return{current:e}},[])}function vn(e,t){var i=We(X++,7);return tn(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function Nn(){for(var e;e=$t.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(ie),t.__h.some(je),t.__h=[]}catch(i){t.__h=[],I.__e(i,e.__v)}}}I.__b=function(e){M=null,ot&&ot(e)},I.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ut&&ut(e,t)},I.__r=function(e){st&&st(e),X=0;var t=(M=e.__c).__H;t&&(ge===M?(t.__h=[],M.__h=[],t.__.some(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(t.__h.some(ie),t.__h.some(je),t.__h=[],X=0)),ge=M},I.diffed=function(e){lt&&lt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&($t.push(t)!==1&&it===I.requestAnimationFrame||((it=I.requestAnimationFrame)||Cn)(Nn)),t.__H.__.some(function(i){i.u&&(i.__H=i.u),i.u=void 0})),ge=M=null},I.__c=function(e,t){t.some(function(i){try{i.__h.some(ie),i.__h=i.__h.filter(function(o){return!o.__||je(o)})}catch(o){t.some(function(n){n.__h&&(n.__h=[])}),t=[],I.__e(o,i.__v)}}),at&&at(e,t)},I.unmount=function(e){ct&&ct(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.some(function(o){try{ie(o)}catch(n){t=n}}),i.__H=void 0,t&&I.__e(t,i.__v))};var ft=typeof requestAnimationFrame=="function";function Cn(e){var t,i=function(){clearTimeout(o),ft&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(i,35);ft&&(t=requestAnimationFrame(i))}function ie(e){var t=M,i=e.__c;typeof i=="function"&&(e.__c=void 0,i()),M=t}function je(e){var t=M;e.__c=e.__(),M=t}function tn(e,t){return!e||e.length!==t.length||t.some(function(i,o){return i!==e[o]})}function nn(e,t){return typeof t=="function"?t(e):t}const En=[{icon:"download",label:"Preparing",desc:"Checking tunnel binary"},{icon:"cloud_sync",label:"Connecting",desc:"Creating session"},{icon:"lan",label:"Tunneling",desc:"Starting secure tunnel"},{icon:"check_circle",label:"Ready",desc:"Connected"}];function kn({currentStep:e}){const t=e-1;return u("div",{className:"glass-card p-5 flex flex-col gap-4",children:[u("span",{className:"text-xs text-white/50 font-medium uppercase tracking-wider",children:"Setting up connection"}),u("div",{className:"flex flex-col gap-3",children:En.map((i,o)=>{const n=o<t,r=o===t;return u("div",{className:"flex items-center gap-3",children:[u("div",{className:"w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",style:{background:n?"var(--brand-500)":r?"rgba(255,87,10,0.15)":"rgba(255,255,255,0.06)",border:r?"1.5px solid var(--brand-500)":"1.5px solid transparent"},children:n?u("span",{className:"material-symbols-outlined text-white",style:{fontSize:16},children:"check"}):r?u("span",{className:"flex gap-0.5 items-center",children:[0,1,2].map(s=>u("span",{className:"w-1 h-1 rounded-full bg-orange-400 dot-bounce",style:{animationDelay:`${s*.18}s`}},s))}):u("span",{className:"material-symbols-outlined text-white/20",style:{fontSize:16},children:i.icon})}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:`text-sm font-medium ${n?"text-white/60":r?"text-white":"text-white/25"}`,children:i.label}),u("p",{className:`text-xs mt-0.5 ${r?"text-white/40":"text-white/20"}`,children:i.desc})]}),n&&u("span",{className:"text-xs text-white/30 flex-shrink-0",children:"Done"}),r&&u("span",{className:"text-xs flex-shrink-0 px-2 py-0.5 rounded-full",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Running"})]},o)})})]})}function Sn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Y={},pe,dt;function Tn(){return dt||(dt=1,pe=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),pe}var ye={},z={},ht;function O(){if(ht)return z;ht=1;let e;const t=[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 z.getSymbolSize=function(o){if(!o)throw new Error('"version" cannot be null or undefined');if(o<1||o>40)throw new Error('"version" should be in range from 1 to 40');return o*4+17},z.getSymbolTotalCodewords=function(o){return t[o]},z.getBCHDigit=function(i){let o=0;for(;i!==0;)o++,i>>>=1;return o},z.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');e=o},z.isKanjiModeEnabled=function(){return typeof e<"u"},z.toSJIS=function(o){return e(o)},z}var we={},_t;function Qe(){return _t||(_t=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+i)}}e.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},e.from=function(o,n){if(e.isValid(o))return o;try{return t(o)}catch{return n}}})(we)),we}var be,mt;function Pn(){if(mt)return be;mt=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const i=Math.floor(t/8);return(this.buffer[i]>>>7-t%8&1)===1},put:function(t,i){for(let o=0;o<i;o++)this.putBit((t>>>i-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),t&&(this.buffer[i]|=128>>>this.length%8),this.length++}},be=e,be}var xe,gt;function Rn(){if(gt)return xe;gt=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,i,o,n){const r=t*this.size+i;this.data[r]=o,n&&(this.reservedBit[r]=!0)},e.prototype.get=function(t,i){return this.data[t*this.size+i]},e.prototype.xor=function(t,i,o){this.data[t*this.size+i]^=o},e.prototype.isReserved=function(t,i){return this.reservedBit[t*this.size+i]},xe=e,xe}var ve={},pt;function An(){return pt||(pt=1,(function(e){const t=O().getSymbolSize;e.getRowColCoords=function(o){if(o===1)return[];const n=Math.floor(o/7)+2,r=t(o),s=r===145?26:Math.ceil((r-13)/(2*n-2))*2,l=[r-7];for(let a=1;a<n-1;a++)l[a]=l[a-1]-s;return l.push(6),l.reverse()},e.getPositions=function(o){const n=[],r=e.getRowColCoords(o),s=r.length;for(let l=0;l<s;l++)for(let a=0;a<s;a++)l===0&&a===0||l===0&&a===s-1||l===s-1&&a===0||n.push([r[l],r[a]]);return n}})(ve)),ve}var Ne={},yt;function Bn(){if(yt)return Ne;yt=1;const e=O().getSymbolSize,t=7;return Ne.getPositions=function(o){const n=e(o);return[[0,0],[n-t,0],[0,n-t]]},Ne}var Ce={},wt;function Mn(){return wt||(wt=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},e.from=function(n){return e.isValid(n)?parseInt(n,10):void 0},e.getPenaltyN1=function(n){const r=n.size;let s=0,l=0,a=0,f=null,h=null;for(let c=0;c<r;c++){l=a=0,f=h=null;for(let _=0;_<r;_++){let d=n.get(c,_);d===f?l++:(l>=5&&(s+=t.N1+(l-5)),f=d,l=1),d=n.get(_,c),d===h?a++:(a>=5&&(s+=t.N1+(a-5)),h=d,a=1)}l>=5&&(s+=t.N1+(l-5)),a>=5&&(s+=t.N1+(a-5))}return s},e.getPenaltyN2=function(n){const r=n.size;let s=0;for(let l=0;l<r-1;l++)for(let a=0;a<r-1;a++){const f=n.get(l,a)+n.get(l,a+1)+n.get(l+1,a)+n.get(l+1,a+1);(f===4||f===0)&&s++}return s*t.N2},e.getPenaltyN3=function(n){const r=n.size;let s=0,l=0,a=0;for(let f=0;f<r;f++){l=a=0;for(let h=0;h<r;h++)l=l<<1&2047|n.get(f,h),h>=10&&(l===1488||l===93)&&s++,a=a<<1&2047|n.get(h,f),h>=10&&(a===1488||a===93)&&s++}return s*t.N3},e.getPenaltyN4=function(n){let r=0;const s=n.data.length;for(let a=0;a<s;a++)r+=n.data[a];return Math.abs(Math.ceil(r*100/s/5)-10)*t.N4};function i(o,n,r){switch(o){case e.Patterns.PATTERN000:return(n+r)%2===0;case e.Patterns.PATTERN001:return n%2===0;case e.Patterns.PATTERN010:return r%3===0;case e.Patterns.PATTERN011:return(n+r)%3===0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2===0;case e.Patterns.PATTERN101:return n*r%2+n*r%3===0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2===0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}e.applyMask=function(n,r){const s=r.size;for(let l=0;l<s;l++)for(let a=0;a<s;a++)r.isReserved(a,l)||r.xor(a,l,i(n,a,l))},e.getBestMask=function(n,r){const s=Object.keys(e.Patterns).length;let l=0,a=1/0;for(let f=0;f<s;f++){r(f),e.applyMask(f,n);const h=e.getPenaltyN1(n)+e.getPenaltyN2(n)+e.getPenaltyN3(n)+e.getPenaltyN4(n);e.applyMask(f,n),h<a&&(a=h,l=f)}return l}})(Ce)),Ce}var ee={},bt;function rn(){if(bt)return ee;bt=1;const e=Qe(),t=[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],i=[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 ee.getBlocksCount=function(n,r){switch(r){case e.L:return t[(n-1)*4+0];case e.M:return t[(n-1)*4+1];case e.Q:return t[(n-1)*4+2];case e.H:return t[(n-1)*4+3];default:return}},ee.getTotalCodewordsCount=function(n,r){switch(r){case e.L:return i[(n-1)*4+0];case e.M:return i[(n-1)*4+1];case e.Q:return i[(n-1)*4+2];case e.H:return i[(n-1)*4+3];default:return}},ee}var Ee={},Q={},xt;function In(){if(xt)return Q;xt=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let o=1;for(let n=0;n<255;n++)e[n]=o,t[o]=n,o<<=1,o&256&&(o^=285);for(let n=255;n<512;n++)e[n]=e[n-255]})(),Q.log=function(o){if(o<1)throw new Error("log("+o+")");return t[o]},Q.exp=function(o){return e[o]},Q.mul=function(o,n){return o===0||n===0?0:e[t[o]+t[n]]},Q}var vt;function Ln(){return vt||(vt=1,(function(e){const t=In();e.mul=function(o,n){const r=new Uint8Array(o.length+n.length-1);for(let s=0;s<o.length;s++)for(let l=0;l<n.length;l++)r[s+l]^=t.mul(o[s],n[l]);return r},e.mod=function(o,n){let r=new Uint8Array(o);for(;r.length-n.length>=0;){const s=r[0];for(let a=0;a<n.length;a++)r[a]^=t.mul(n[a],s);let l=0;for(;l<r.length&&r[l]===0;)l++;r=r.slice(l)}return r},e.generateECPolynomial=function(o){let n=new Uint8Array([1]);for(let r=0;r<o;r++)n=e.mul(n,new Uint8Array([1,t.exp(r)]));return n}})(Ee)),Ee}var ke,Nt;function Dn(){if(Nt)return ke;Nt=1;const e=Ln();function t(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(o){this.degree=o,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(o){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(o.length+this.degree);n.set(o);const r=e.mod(n,this.genPoly),s=this.degree-r.length;if(s>0){const l=new Uint8Array(this.degree);return l.set(r,s),l}return r},ke=t,ke}var Se={},Te={},Pe={},Ct;function on(){return Ct||(Ct=1,Pe.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),Pe}var D={},Et;function sn(){if(Et)return D;Et=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");const o="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r
2
+ ]))+`;D.KANJI=new RegExp(i,"g"),D.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),D.BYTE=new RegExp(o,"g"),D.NUMERIC=new RegExp(e,"g"),D.ALPHANUMERIC=new RegExp(t,"g");const n=new RegExp("^"+i+"$"),r=new RegExp("^"+e+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return D.testKanji=function(a){return n.test(a)},D.testNumeric=function(a){return r.test(a)},D.testAlphanumeric=function(a){return s.test(a)},D}var kt;function V(){return kt||(kt=1,(function(e){const t=on(),i=sn();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(r,s){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?r.ccBits[0]:s<27?r.ccBits[1]:r.ccBits[2]},e.getBestModeForData=function(r){return i.testNumeric(r)?e.NUMERIC:i.testAlphanumeric(r)?e.ALPHANUMERIC:i.testKanji(r)?e.KANJI:e.BYTE},e.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},e.isValid=function(r){return r&&r.bit&&r.ccBits};function o(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+n)}}e.from=function(r,s){if(e.isValid(r))return r;try{return o(r)}catch{return s}}})(Te)),Te}var St;function Un(){return St||(St=1,(function(e){const t=O(),i=rn(),o=Qe(),n=V(),r=on(),s=7973,l=t.getBCHDigit(s);function a(_,d,b){for(let N=1;N<=40;N++)if(d<=e.getCapacity(N,b,_))return N}function f(_,d){return n.getCharCountIndicator(_,d)+4}function h(_,d){let b=0;return _.forEach(function(N){const R=f(N.mode,d);b+=R+N.getBitsLength()}),b}function c(_,d){for(let b=1;b<=40;b++)if(h(_,b)<=e.getCapacity(b,d,n.MIXED))return b}e.from=function(d,b){return r.isValid(d)?parseInt(d,10):b},e.getCapacity=function(d,b,N){if(!r.isValid(d))throw new Error("Invalid QR Code version");typeof N>"u"&&(N=n.BYTE);const R=t.getSymbolTotalCodewords(d),p=i.getTotalCodewordsCount(d,b),w=(R-p)*8;if(N===n.MIXED)return w;const E=w-f(N,d);switch(N){case n.NUMERIC:return Math.floor(E/10*3);case n.ALPHANUMERIC:return Math.floor(E/11*2);case n.KANJI:return Math.floor(E/13);case n.BYTE:default:return Math.floor(E/8)}},e.getBestVersionForData=function(d,b){let N;const R=o.from(b,o.M);if(Array.isArray(d)){if(d.length>1)return c(d,R);if(d.length===0)return 1;N=d[0]}else N=d;return a(N.mode,N.getLength(),R)},e.getEncodedBits=function(d){if(!r.isValid(d)||d<7)throw new Error("Invalid QR Code version");let b=d<<12;for(;t.getBCHDigit(b)-l>=0;)b^=s<<t.getBCHDigit(b)-l;return d<<12|b}})(Se)),Se}var Re={},Tt;function qn(){if(Tt)return Re;Tt=1;const e=O(),t=1335,i=21522,o=e.getBCHDigit(t);return Re.getEncodedBits=function(r,s){const l=r.bit<<3|s;let a=l<<10;for(;e.getBCHDigit(a)-o>=0;)a^=t<<e.getBCHDigit(a)-o;return(l<<10|a)^i},Re}var Ae={},Be,Pt;function Fn(){if(Pt)return Be;Pt=1;const e=V();function t(i){this.mode=e.NUMERIC,this.data=i.toString()}return t.getBitsLength=function(o){return 10*Math.floor(o/3)+(o%3?o%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(o){let n,r,s;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),s=parseInt(r,10),o.put(s,10);const l=this.data.length-n;l>0&&(r=this.data.substr(n),s=parseInt(r,10),o.put(s,l*3+1))},Be=t,Be}var Me,Rt;function Hn(){if(Rt)return Me;Rt=1;const e=V(),t=["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 i(o){this.mode=e.ALPHANUMERIC,this.data=o}return i.getBitsLength=function(n){return 11*Math.floor(n/2)+6*(n%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(n){let r;for(r=0;r+2<=this.data.length;r+=2){let s=t.indexOf(this.data[r])*45;s+=t.indexOf(this.data[r+1]),n.put(s,11)}this.data.length%2&&n.put(t.indexOf(this.data[r]),6)},Me=i,Me}var Ie,At;function Kn(){if(At)return Ie;At=1;const e=V();function t(i){this.mode=e.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}return t.getBitsLength=function(o){return o*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(i){for(let o=0,n=this.data.length;o<n;o++)i.put(this.data[o],8)},Ie=t,Ie}var Le,Bt;function zn(){if(Bt)return Le;Bt=1;const e=V(),t=O();function i(o){this.mode=e.KANJI,this.data=o}return i.getBitsLength=function(n){return n*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(o){let n;for(n=0;n<this.data.length;n++){let r=t.toSJIS(this.data[n]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[n]+`
3
+ Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),o.put(r,13)}},Le=i,Le}var De={exports:{}},Mt;function jn(){return Mt||(Mt=1,(function(e){var t={single_source_shortest_paths:function(i,o,n){var r={},s={};s[o]=0;var l=t.PriorityQueue.make();l.push(o,0);for(var a,f,h,c,_,d,b,N,R;!l.empty();){a=l.pop(),f=a.value,c=a.cost,_=i[f]||{};for(h in _)_.hasOwnProperty(h)&&(d=_[h],b=c+d,N=s[h],R=typeof s[h]>"u",(R||N>b)&&(s[h]=b,l.push(h,b),r[h]=f))}if(typeof n<"u"&&typeof s[n]>"u"){var p=["Could not find a path from ",o," to ",n,"."].join("");throw new Error(p)}return r},extract_shortest_path_from_predecessor_list:function(i,o){for(var n=[],r=o;r;)n.push(r),i[r],r=i[r];return n.reverse(),n},find_path:function(i,o,n){var r=t.single_source_shortest_paths(i,o,n);return t.extract_shortest_path_from_predecessor_list(r,n)},PriorityQueue:{make:function(i){var o=t.PriorityQueue,n={},r;i=i||{};for(r in o)o.hasOwnProperty(r)&&(n[r]=o[r]);return n.queue=[],n.sorter=i.sorter||o.default_sorter,n},default_sorter:function(i,o){return i.cost-o.cost},push:function(i,o){var n={value:i,cost:o};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(De)),De.exports}var It;function On(){return It||(It=1,(function(e){const t=V(),i=Fn(),o=Hn(),n=Kn(),r=zn(),s=sn(),l=O(),a=jn();function f(p){return unescape(encodeURIComponent(p)).length}function h(p,w,E){const y=[];let x;for(;(x=p.exec(E))!==null;)y.push({data:x[0],index:x.index,mode:w,length:x[0].length});return y}function c(p){const w=h(s.NUMERIC,t.NUMERIC,p),E=h(s.ALPHANUMERIC,t.ALPHANUMERIC,p);let y,x;return l.isKanjiModeEnabled()?(y=h(s.BYTE,t.BYTE,p),x=h(s.KANJI,t.KANJI,p)):(y=h(s.BYTE_KANJI,t.BYTE,p),x=[]),w.concat(E,y,x).sort(function(C,v){return C.index-v.index}).map(function(C){return{data:C.data,mode:C.mode,length:C.length}})}function _(p,w){switch(w){case t.NUMERIC:return i.getBitsLength(p);case t.ALPHANUMERIC:return o.getBitsLength(p);case t.KANJI:return r.getBitsLength(p);case t.BYTE:return n.getBitsLength(p)}}function d(p){return p.reduce(function(w,E){const y=w.length-1>=0?w[w.length-1]:null;return y&&y.mode===E.mode?(w[w.length-1].data+=E.data,w):(w.push(E),w)},[])}function b(p){const w=[];for(let E=0;E<p.length;E++){const y=p[E];switch(y.mode){case t.NUMERIC:w.push([y,{data:y.data,mode:t.ALPHANUMERIC,length:y.length},{data:y.data,mode:t.BYTE,length:y.length}]);break;case t.ALPHANUMERIC:w.push([y,{data:y.data,mode:t.BYTE,length:y.length}]);break;case t.KANJI:w.push([y,{data:y.data,mode:t.BYTE,length:f(y.data)}]);break;case t.BYTE:w.push([{data:y.data,mode:t.BYTE,length:f(y.data)}])}}return w}function N(p,w){const E={},y={start:{}};let x=["start"];for(let m=0;m<p.length;m++){const C=p[m],v=[];for(let g=0;g<C.length;g++){const k=C[g],S=""+m+g;v.push(S),E[S]={node:k,lastCount:0},y[S]={};for(let P=0;P<x.length;P++){const T=x[P];E[T]&&E[T].node.mode===k.mode?(y[T][S]=_(E[T].lastCount+k.length,k.mode)-_(E[T].lastCount,k.mode),E[T].lastCount+=k.length):(E[T]&&(E[T].lastCount=k.length),y[T][S]=_(k.length,k.mode)+4+t.getCharCountIndicator(k.mode,w))}}x=v}for(let m=0;m<x.length;m++)y[x[m]].end=0;return{map:y,table:E}}function R(p,w){let E;const y=t.getBestModeForData(p);if(E=t.from(w,y),E!==t.BYTE&&E.bit<y.bit)throw new Error('"'+p+'" cannot be encoded with mode '+t.toString(E)+`.
4
+ Suggested mode is: `+t.toString(y));switch(E===t.KANJI&&!l.isKanjiModeEnabled()&&(E=t.BYTE),E){case t.NUMERIC:return new i(p);case t.ALPHANUMERIC:return new o(p);case t.KANJI:return new r(p);case t.BYTE:return new n(p)}}e.fromArray=function(w){return w.reduce(function(E,y){return typeof y=="string"?E.push(R(y,null)):y.data&&E.push(R(y.data,y.mode)),E},[])},e.fromString=function(w,E){const y=c(w,l.isKanjiModeEnabled()),x=b(y),m=N(x,E),C=a.find_path(m.map,"start","end"),v=[];for(let g=1;g<C.length-1;g++)v.push(m.table[C[g]].node);return e.fromArray(d(v))},e.rawSplit=function(w){return e.fromArray(c(w,l.isKanjiModeEnabled()))}})(Ae)),Ae}var Lt;function Vn(){if(Lt)return ye;Lt=1;const e=O(),t=Qe(),i=Pn(),o=Rn(),n=An(),r=Bn(),s=Mn(),l=rn(),a=Dn(),f=Un(),h=qn(),c=V(),_=On();function d(m,C){const v=m.size,g=r.getPositions(C);for(let k=0;k<g.length;k++){const S=g[k][0],P=g[k][1];for(let T=-1;T<=7;T++)if(!(S+T<=-1||v<=S+T))for(let A=-1;A<=7;A++)P+A<=-1||v<=P+A||(T>=0&&T<=6&&(A===0||A===6)||A>=0&&A<=6&&(T===0||T===6)||T>=2&&T<=4&&A>=2&&A<=4?m.set(S+T,P+A,!0,!0):m.set(S+T,P+A,!1,!0))}}function b(m){const C=m.size;for(let v=8;v<C-8;v++){const g=v%2===0;m.set(v,6,g,!0),m.set(6,v,g,!0)}}function N(m,C){const v=n.getPositions(C);for(let g=0;g<v.length;g++){const k=v[g][0],S=v[g][1];for(let P=-2;P<=2;P++)for(let T=-2;T<=2;T++)P===-2||P===2||T===-2||T===2||P===0&&T===0?m.set(k+P,S+T,!0,!0):m.set(k+P,S+T,!1,!0)}}function R(m,C){const v=m.size,g=f.getEncodedBits(C);let k,S,P;for(let T=0;T<18;T++)k=Math.floor(T/3),S=T%3+v-8-3,P=(g>>T&1)===1,m.set(k,S,P,!0),m.set(S,k,P,!0)}function p(m,C,v){const g=m.size,k=h.getEncodedBits(C,v);let S,P;for(S=0;S<15;S++)P=(k>>S&1)===1,S<6?m.set(S,8,P,!0):S<8?m.set(S+1,8,P,!0):m.set(g-15+S,8,P,!0),S<8?m.set(8,g-S-1,P,!0):S<9?m.set(8,15-S-1+1,P,!0):m.set(8,15-S-1,P,!0);m.set(g-8,8,1,!0)}function w(m,C){const v=m.size;let g=-1,k=v-1,S=7,P=0;for(let T=v-1;T>0;T-=2)for(T===6&&T--;;){for(let A=0;A<2;A++)if(!m.isReserved(k,T-A)){let K=!1;P<C.length&&(K=(C[P]>>>S&1)===1),m.set(k,T-A,K),S--,S===-1&&(P++,S=7)}if(k+=g,k<0||v<=k){k-=g,g=-g;break}}}function E(m,C,v){const g=new i;v.forEach(function(A){g.put(A.mode.bit,4),g.put(A.getLength(),c.getCharCountIndicator(A.mode,m)),A.write(g)});const k=e.getSymbolTotalCodewords(m),S=l.getTotalCodewordsCount(m,C),P=(k-S)*8;for(g.getLengthInBits()+4<=P&&g.put(0,4);g.getLengthInBits()%8!==0;)g.putBit(0);const T=(P-g.getLengthInBits())/8;for(let A=0;A<T;A++)g.put(A%2?17:236,8);return y(g,m,C)}function y(m,C,v){const g=e.getSymbolTotalCodewords(C),k=l.getTotalCodewordsCount(C,v),S=g-k,P=l.getBlocksCount(C,v),T=g%P,A=P-T,K=Math.floor(g/P),W=Math.floor(S/P),cn=W+1,Xe=K-W,un=new a(Xe);let de=0;const Z=new Array(P),Ze=new Array(P);let he=0;const fn=new Uint8Array(m.buffer);for(let J=0;J<P;J++){const me=J<A?W:cn;Z[J]=fn.slice(de,de+me),Ze[J]=un.encode(Z[J]),de+=me,he=Math.max(he,me)}const _e=new Uint8Array(g);let $e=0,U,q;for(U=0;U<he;U++)for(q=0;q<P;q++)U<Z[q].length&&(_e[$e++]=Z[q][U]);for(U=0;U<Xe;U++)for(q=0;q<P;q++)_e[$e++]=Ze[q][U];return _e}function x(m,C,v,g){let k;if(Array.isArray(m))k=_.fromArray(m);else if(typeof m=="string"){let K=C;if(!K){const W=_.rawSplit(m);K=f.getBestVersionForData(W,v)}k=_.fromString(m,K||40)}else throw new Error("Invalid data");const S=f.getBestVersionForData(k,v);if(!S)throw new Error("The amount of data is too big to be stored in a QR Code");if(!C)C=S;else if(C<S)throw new Error(`
5
+ The chosen QR Code version cannot contain this amount of data.
6
+ Minimum version required to store current data is: `+S+`.
7
+ `);const P=E(C,v,k),T=e.getSymbolSize(C),A=new o(T);return d(A,C),b(A),N(A,C),p(A,v,0),C>=7&&R(A,C),w(A,P),isNaN(g)&&(g=s.getBestMask(A,p.bind(null,A,v))),s.applyMask(g,A),p(A,v,g),{modules:A,version:C,errorCorrectionLevel:v,maskPattern:g,segments:k}}return ye.create=function(C,v){if(typeof C>"u"||C==="")throw new Error("No input text");let g=t.M,k,S;return typeof v<"u"&&(g=t.from(v.errorCorrectionLevel,t.M),k=f.from(v.version),S=s.from(v.maskPattern),v.toSJISFunc&&e.setToSJISFunction(v.toSJISFunc)),x(C,k,g,S)},ye}var Ue={},qe={},Dt;function ln(){return Dt||(Dt=1,(function(e){function t(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let o=i.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+i);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(r){return[r,r]}))),o.length===6&&o.push("F","F");const n=parseInt(o.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+o.slice(0,6).join("")}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const n=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,r=o.width&&o.width>=21?o.width:void 0,s=o.scale||4;return{width:r,scale:r?4:s,margin:n,color:{dark:t(o.color.dark||"#000000ff"),light:t(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(o,n){return n.width&&n.width>=o+n.margin*2?n.width/(o+n.margin*2):n.scale},e.getImageWidth=function(o,n){const r=e.getScale(o,n);return Math.floor((o+n.margin*2)*r)},e.qrToImageData=function(o,n,r){const s=n.modules.size,l=n.modules.data,a=e.getScale(s,r),f=Math.floor((s+r.margin*2)*a),h=r.margin*a,c=[r.color.light,r.color.dark];for(let _=0;_<f;_++)for(let d=0;d<f;d++){let b=(_*f+d)*4,N=r.color.light;if(_>=h&&d>=h&&_<f-h&&d<f-h){const R=Math.floor((_-h)/a),p=Math.floor((d-h)/a);N=c[l[R*s+p]?1:0]}o[b++]=N.r,o[b++]=N.g,o[b++]=N.b,o[b]=N.a}}})(qe)),qe}var Ut;function Jn(){return Ut||(Ut=1,(function(e){const t=ln();function i(n,r,s){n.clearRect(0,0,r.width,r.height),r.style||(r.style={}),r.height=s,r.width=s,r.style.height=s+"px",r.style.width=s+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(r,s,l){let a=l,f=s;typeof a>"u"&&(!s||!s.getContext)&&(a=s,s=void 0),s||(f=o()),a=t.getOptions(a);const h=t.getImageWidth(r.modules.size,a),c=f.getContext("2d"),_=c.createImageData(h,h);return t.qrToImageData(_.data,r,a),i(c,f,h),c.putImageData(_,0,0),f},e.renderToDataURL=function(r,s,l){let a=l;typeof a>"u"&&(!s||!s.getContext)&&(a=s,s=void 0),a||(a={});const f=e.render(r,s,a),h=a.type||"image/png",c=a.rendererOpts||{};return f.toDataURL(h,c.quality)}})(Ue)),Ue}var Fe={},qt;function Yn(){if(qt)return Fe;qt=1;const e=ln();function t(n,r){const s=n.a/255,l=r+'="'+n.hex+'"';return s<1?l+" "+r+'-opacity="'+s.toFixed(2).slice(1)+'"':l}function i(n,r,s){let l=n+r;return typeof s<"u"&&(l+=" "+s),l}function o(n,r,s){let l="",a=0,f=!1,h=0;for(let c=0;c<n.length;c++){const _=Math.floor(c%r),d=Math.floor(c/r);!_&&!f&&(f=!0),n[c]?(h++,c>0&&_>0&&n[c-1]||(l+=f?i("M",_+s,.5+d+s):i("m",a,0),a=0,f=!1),_+1<r&&n[c+1]||(l+=i("h",h),h=0)):a++}return l}return Fe.render=function(r,s,l){const a=e.getOptions(s),f=r.modules.size,h=r.modules.data,c=f+a.margin*2,_=a.color.light.a?"<path "+t(a.color.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",d="<path "+t(a.color.dark,"stroke")+' d="'+o(h,f,a.margin)+'"/>',b='viewBox="0 0 '+c+" "+c+'"',R='<svg xmlns="http://www.w3.org/2000/svg" '+(a.width?'width="'+a.width+'" height="'+a.width+'" ':"")+b+' shape-rendering="crispEdges">'+_+d+`</svg>
8
+ `;return typeof l=="function"&&l(null,R),R},Fe}var Ft;function Gn(){if(Ft)return Y;Ft=1;const e=Tn(),t=Vn(),i=Jn(),o=Yn();function n(r,s,l,a,f){const h=[].slice.call(arguments,1),c=h.length,_=typeof h[c-1]=="function";if(!_&&!e())throw new Error("Callback required as last argument");if(_){if(c<2)throw new Error("Too few arguments provided");c===2?(f=l,l=s,s=a=void 0):c===3&&(s.getContext&&typeof f>"u"?(f=a,a=void 0):(f=a,a=l,l=s,s=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(l=s,s=a=void 0):c===2&&!s.getContext&&(a=l,l=s,s=void 0),new Promise(function(d,b){try{const N=t.create(l,a);d(r(N,s,a))}catch(N){b(N)}})}try{const d=t.create(l,a);f(null,r(d,s,a))}catch(d){f(d)}}return Y.create=t.create,Y.toCanvas=n.bind(null,i.render),Y.toDataURL=n.bind(null,i.renderToDataURL),Y.toString=n.bind(null,function(r,s,l){return o.render(r,l)}),Y}var Wn=Gn();const Qn=Sn(Wn);function Oe({message:e,confirmLabel:t="Confirm",confirmDanger:i=!1,onConfirm:o,onCancel:n}){return u("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0,0,0,0.6)"},children:u("div",{className:"glass-card p-5 flex flex-col gap-4 w-72",children:[u("p",{className:"text-sm text-white text-center",children:e}),u("div",{className:"flex gap-2",children:[u("button",{onClick:n,className:"glass-btn flex-1 py-2 text-sm text-white/60 hover:text-white",children:"Cancel"}),u("button",{onClick:o,className:"flex-1 py-2 text-sm font-semibold rounded-xl",style:{background:i?"rgba(220,53,69,0.8)":"var(--brand-500)",color:"#fff"},children:t})]})]})})}const Ht="9remote.cc";function Xn(e){if(e<=0)return"Expired";const t=Math.floor(e/1e3),i=Math.floor(t/60),o=t%60;return`${String(i).padStart(2,"0")}:${String(o).padStart(2,"0")}`}function te({icon:e,onClick:t,title:i,danger:o}){return u("button",{onClick:t,title:i,className:"glass-btn w-7 h-7 flex items-center justify-center flex-shrink-0 text-white/50 hover:text-white",style:o?{color:"rgba(255,100,100,0.7)"}:{},children:u("span",{className:"material-symbols-outlined",style:{fontSize:15},children:e})})}function Zn({qrUrl:e,oneTimeKey:t,oneTimeKeyExpiresAt:i,permanentKey:o,onGenerateOneTimeKey:n,onRegenerateKey:r}){const s=en(null),[l,a]=L(null),[f,h]=L(null),[c,_]=L(null);ce(()=>{!e||!s.current||Qn.toCanvas(s.current,e,{width:160,margin:1,color:{dark:"#0f1923",light:"#ffffff"}}).catch(()=>{})},[e]),ce(()=>{if(!i){a(null);return}const b=()=>a(i-Date.now());b();const N=setInterval(b,1e3);return()=>clearInterval(N)},[i]);const d=(b,N)=>{navigator.clipboard.writeText(b).catch(()=>{}),h(N),setTimeout(()=>h(null),2e3)};return u(H,{children:[c==="oneTime"&&u(Oe,{message:"Generate a new one-time key? The current one will expire immediately.",confirmLabel:"Generate",onConfirm:()=>{_(null),n==null||n()},onCancel:()=>_(null)}),c==="regen"&&u(Oe,{message:"Regenerate permanent key? All existing sessions will be disconnected.",confirmLabel:"Regenerate",confirmDanger:!0,onConfirm:()=>{_(null),r==null||r()},onCancel:()=>_(null)}),u("div",{className:"glass-card p-5 flex flex-col items-center gap-4",children:[u("div",{className:"w-44 h-44 rounded-xl overflow-hidden bg-white p-2 flex items-center justify-center flex-shrink-0",children:e?u("canvas",{ref:s}):u("span",{className:"material-symbols-outlined text-gray-300 text-6xl",children:"qr_code_2"})}),u("a",{href:`https://${Ht}/login`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 hover:opacity-80 transition-opacity",children:[u("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 flex-shrink-0"}),u("span",{className:"text-xs text-white/60 font-medium",children:[Ht,"/login"]})]}),u("div",{className:"w-full h-px bg-white/5"}),u("div",{className:"w-full flex flex-col gap-1.5",children:[u("div",{className:"flex items-center justify-between px-0.5",children:[u("span",{className:"text-xs font-medium text-white/50",children:"One-Time Key"}),u("span",{className:"text-xs text-white/30",children:"Single use · expires"})]}),u("div",{className:"w-full flex items-center gap-2 dark-card px-3 py-2.5",children:[u("span",{className:"material-symbols-outlined text-white/30 flex-shrink-0",style:{fontSize:16},children:"timer"}),u("span",{className:"flex-1 font-mono font-bold tracking-[0.18em] text-base truncate",style:{color:t?"var(--brand-500)":"rgba(255,255,255,0.15)"},children:t||"• • • • • •"}),l!==null&&u("span",{className:`text-xs font-mono flex-shrink-0 ${l<=0?"text-red-400":"text-white/40"}`,children:Xn(l)}),t&&u(te,{icon:f==="oneTime"?"check":"content_copy",onClick:()=>d(t,"oneTime"),title:"Copy one-time key"}),u(te,{icon:"refresh",onClick:()=>_("oneTime"),title:"New one-time key"})]})]}),u("div",{className:"w-full flex flex-col gap-1.5",children:[u("div",{className:"flex items-center justify-between px-0.5",children:[u("span",{className:"text-xs font-medium text-white/50",children:"Permanent Key"}),u("span",{className:"text-xs text-white/30",children:"Reusable · no expiry"})]}),u("div",{className:"w-full flex items-center gap-2 dark-card px-3 py-2.5",children:[u("span",{className:"material-symbols-outlined text-white/30 flex-shrink-0",style:{fontSize:16},children:"key"}),u("span",{className:"flex-1 font-mono text-xs text-white/50 truncate",children:o||"— not set —"}),o&&u(te,{icon:f==="permanent"?"check":"content_copy",onClick:()=>d(o,"permanent"),title:"Copy permanent key"}),u(te,{icon:"autorenew",onClick:()=>_("regen"),title:"Regenerate permanent key",danger:!0})]})]})]})]})}const $n="https://docs.9remote.cc/",an={screenRecording:{label:"Screen Recording",icon:"screenshot_monitor",desc:"Capture screen content"},accessibility:{label:"Accessibility",icon:"accessibility_new",desc:"Control mouse & keyboard"}};function er({type:e,granted:t,onRequest:i}){const o=an[e]||{label:e,desc:""};return u("div",{className:"flex items-center gap-3 py-2 border-b border-white/5 last:border-0",children:[u("span",{className:`material-symbols-outlined flex-shrink-0 ${t?"text-green-400":"text-white/30"}`,style:{fontSize:18},children:t?"check_circle":"cancel"}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:`text-xs font-medium ${t?"text-white/80":"text-white/50"}`,children:o.label}),u("p",{className:"text-[10px] text-white/30 leading-4",children:o.desc})]}),!t&&u("button",{onClick:()=>i(e),className:"flex-shrink-0 text-xs px-2.5 py-1 rounded-lg font-medium",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Grant"})]})}function tr(){return u("div",{className:"glass-card p-4 flex items-center gap-3",children:[u("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(255,87,10,0.15)"},children:u("span",{className:"material-symbols-outlined",style:{fontSize:20,color:"var(--brand-400)"},children:"terminal"})}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:"text-sm font-semibold text-white",children:"Remote Terminal"}),u("p",{className:"text-xs text-white/40",children:"Full shell access · always on"})]}),u("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-full",style:{background:"rgba(74,222,128,0.1)"},children:[u("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400"}),u("span",{className:"text-xs text-green-400 font-medium",children:"On"})]})]})}function nr({enabled:e,onToggle:t,permissions:i,onRequestPermission:o}){const n=Object.entries(an);return u("div",{className:"glass-card p-4 flex flex-col gap-3",children:[u("div",{className:"flex items-center gap-3",children:[u("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:e?"rgba(255,87,10,0.15)":"rgba(255,255,255,0.05)"},children:u("span",{className:"material-symbols-outlined",style:{fontSize:20,color:e?"var(--brand-400)":"rgba(255,255,255,0.25)"},children:"desktop_windows"})}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:"text-sm font-semibold text-white",children:"Remote Desktop"}),u("p",{className:"text-xs text-white/40",children:"Control screen, mouse & keyboard"})]}),u("button",{onClick:t,className:"flex-shrink-0 w-11 h-6 rounded-full transition-all relative",style:{background:e?"var(--brand-500)":"rgba(255,255,255,0.1)"},children:u("span",{className:"absolute top-0.5 w-5 h-5 rounded-full bg-white transition-all",style:{left:e?"calc(100% - 22px)":"2px",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"}})})]}),e&&u("div",{className:"flex flex-col border-t border-white/5 pt-2",children:[u("p",{className:"text-[10px] text-white/30 uppercase tracking-wider mb-1",children:"System Permissions"}),n.map(([r])=>u(er,{type:r,granted:(i==null?void 0:i[r])??!1,onRequest:o},r))]})]})}function rr({version:e}){return e?u("div",{className:"px-5 py-2 flex items-center gap-2 border-b",style:{background:"rgba(255,87,10,0.08)",borderColor:"rgba(255,87,10,0.2)"},children:[u("span",{className:"material-symbols-outlined text-sm flex-shrink-0",style:{color:"var(--brand-400)"},children:"system_update"}),u("span",{className:"text-xs flex-1",style:{color:"var(--brand-400)"},children:["Version ",e," available"]}),u("button",{onClick:()=>fetch("/api/update",{method:"POST"}).catch(()=>{}),className:"flex-shrink-0 text-xs px-2 py-0.5 rounded font-medium",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Update"})]}):null}const ir=[{icon:"terminal",label:"Terminal",desc:"Full shell access"},{icon:"desktop_windows",label:"Desktop",desc:"Remote screen control"},{icon:"folder_open",label:"Files",desc:"Browse & edit files"}],or=[{icon:"qr_code_scanner",text:"Scan QR to connect instantly"},{icon:"wifi_off",text:"No port forwarding needed"},{icon:"devices",text:"Works on any device"}];function sr({onStart:e}){const[t,i]=L(!1),o=()=>{i(!0),e()};return u("div",{className:"flex-1 flex flex-col items-center justify-between px-6 py-6 overflow-y-auto",children:[u("div",{className:"flex flex-col items-center gap-2 text-center mt-2",children:[u("div",{className:"w-14 h-14 rounded-2xl flex items-center justify-center mb-1",style:{background:"var(--brand-500)",boxShadow:"0 8px 32px rgba(255,87,10,0.35)"},children:u("span",{className:"material-symbols-outlined text-white",style:{fontSize:30},children:"terminal"})}),u("h1",{className:"text-lg font-bold text-white tracking-tight",children:"9Remote"}),u("p",{className:"text-xs text-white/50 leading-5 max-w-[220px]",children:"Access your terminal, desktop & files from anywhere"})]}),u("div",{className:"flex gap-2 w-full mt-5",children:ir.map(n=>u("div",{className:"flex-1 dark-card flex flex-col items-center gap-1.5 py-3 px-1",children:[u("span",{className:"material-symbols-outlined text-white/70",style:{fontSize:22,color:"var(--brand-400)"},children:n.icon}),u("p",{className:"text-xs font-semibold text-white",children:n.label}),u("p",{className:"text-[10px] text-white/40 text-center leading-4",children:n.desc})]},n.label))}),u("div",{className:"flex flex-col gap-2 w-full mt-4",children:or.map(n=>u("div",{className:"flex items-center gap-2.5",children:[u("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:16,color:"var(--brand-400)"},children:n.icon}),u("span",{className:"text-xs text-white/60",children:n.text})]},n.text))}),u("button",{onClick:t?void 0:o,disabled:t,className:"btn-primary w-full py-3.5 flex items-center justify-center gap-2 text-sm font-semibold mt-6",style:{borderRadius:"var(--radius-brand)",opacity:t?.7:1},children:t?u(H,{children:[u("span",{className:"flex gap-0.5 items-center",children:[0,1,2].map(n=>u("span",{className:"w-1.5 h-1.5 rounded-full bg-white dot-bounce",style:{animationDelay:`${n*.18}s`}},n))}),"Connecting..."]}):u(H,{children:[u("span",{className:"material-symbols-outlined text-base",children:"play_arrow"}),"Connect"]})})]})}function lr({conn:e}){return u("div",{className:"flex items-center gap-3 py-2 border-b border-white/5 last:border-0",children:[u("div",{className:"w-2 h-2 rounded-full bg-green-400 flex-shrink-0"}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:"text-xs text-white font-medium truncate",children:e.ip||"Unknown"}),u("p",{className:"text-xs text-white/30",children:e.connectedAt?new Date(e.connectedAt).toLocaleTimeString():""})]}),u("span",{className:"text-xs text-white/30",children:e.type||"ws"})]})}function ar({step:e,tunnelUrl:t,oneTimeKey:i,oneTimeKeyExpiresAt:o,permanentKey:n,qrUrl:r,permissions:s,desktopEnabled:l,updateVersion:a,connections:f=[],version:h="",onRequestPermission:c,onDesktopToggle:_,onStop:d,onStart:b,onGenerateOneTimeKey:N,onRegenerateKey:R,logs:p=[]}){const[w,E]=L("connect"),[y,x]=L(!1),m=en(null),C=e===0,v=e>0&&e<4;return ce(()=>{var g;w==="log"&&((g=m.current)==null||g.scrollIntoView({behavior:"smooth"}))},[p,w]),u("div",{className:"h-full flex flex-col relative overflow-hidden",style:{background:"#333"},children:[u("div",{className:"flex-1 flex flex-col w-full min-h-0 dot-grid-bg overflow-hidden",style:{maxWidth:"672px",margin:"0 auto"},children:[u("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/5",children:[u("div",{className:"flex items-center gap-3",children:[u("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--brand-500)"},children:u("span",{className:"material-symbols-outlined text-white text-base",children:"terminal"})}),u("div",{className:"flex flex-col leading-tight",children:[u("span",{className:"brand-text text-xs",children:"9Remote"}),h&&u("span",{className:"text-[10px] text-white/30",children:["v",h]})]})]}),u("div",{className:"flex items-center gap-2",children:[u("button",{onClick:()=>window.open($n,"_blank"),className:"glass-btn w-7 h-7 flex items-center justify-center text-white/40 hover:text-white",children:u("span",{className:"material-symbols-outlined text-sm",children:"help_outline"})}),!C&&u("button",{onClick:()=>x(!0),className:"btn-danger px-3 h-7 flex items-center gap-1.5 text-xs font-medium",children:[u("span",{className:"material-symbols-outlined text-sm",children:"stop_circle"}),"Disconnect"]})]})]}),u(rr,{version:a}),C?u(sr,{onStart:b,connecting:!1}):v?u("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex flex-col gap-4",children:u(kn,{currentStep:e})}):u(H,{children:[u("div",{className:"flex px-5 gap-3 border-b border-white/5",children:[{id:"connect",label:"Connection"},{id:"log",label:"Logs"}].map(g=>u("button",{onClick:()=>E(g.id),className:"pb-2 text-xs font-medium border-b-2 transition-colors",style:w===g.id?{borderColor:"var(--brand-500)",color:"var(--brand-500)"}:{borderColor:"transparent",color:"rgba(255,255,255,0.4)"},children:g.label},g.id))}),u("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex flex-col gap-4",children:[w==="connect"&&u(H,{children:[u(Zn,{qrUrl:r,oneTimeKey:i,oneTimeKeyExpiresAt:o,permanentKey:n,tunnelUrl:t,onGenerateOneTimeKey:N,onRegenerateKey:R}),u(tr,{}),u(nr,{enabled:l,onToggle:_,permissions:s,onRequestPermission:c}),u("div",{className:"glass-card p-4 flex flex-col gap-1",children:[u("p",{className:"text-xs text-white/60 font-medium uppercase tracking-wider mb-2",children:["Clients",f.length>0?` (${f.length})`:""]}),f.length===0?u("p",{className:"text-xs text-white/30 text-center py-3",children:"No active connections"}):f.map((g,k)=>u(lr,{conn:g},k))]})]}),w==="log"&&u("div",{className:"flex-1 flex flex-col",children:p.length===0?u("p",{className:"text-xs text-white/30 text-center mt-8",children:"No logs yet"}):u("div",{className:"flex flex-col gap-0.5",children:[p.map((g,k)=>u("p",{className:"text-xs font-mono text-white/60 leading-5 break-all",children:g},k)),u("div",{ref:m})]})})]})]})]}),y&&u(Oe,{message:"Disconnect and stop the tunnel? Remote clients will be disconnected.",confirmLabel:"Disconnect",confirmDanger:!0,onConfirm:()=>{x(!1),d==null||d()},onCancel:()=>x(!1)})]})}const Kt={step:0,tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null,permanentKey:"",qrUrl:"",latency:null,uptime:null},cr={screenRecording:!1,accessibility:!1},zt=200;function ur(){const[e,t]=L(Kt),[i,o]=L(cr),[n,r]=L(!1),[s,l]=L([]),[a,f]=L(null),[h,c]=L([]),[_,d]=L("");ce(()=>{fetch("/api/version").then(x=>x.json()).then(x=>d(x.version??"")).catch(()=>{}),fetch("/api/ui/state").then(x=>x.json()).then(x=>{t({step:x.step??0,tunnelUrl:x.tunnelUrl??"",oneTimeKey:x.oneTimeKey??"",oneTimeKeyExpiresAt:x.oneTimeKeyExpiresAt??null,permanentKey:x.permanentKey??"",qrUrl:x.qrUrl??"",latency:x.latency??null,uptime:x.uptime??null}),o({screenRecording:x.screenRecording??!1,accessibility:x.accessibility??!1}),x.desktopEnabled!==void 0&&r(x.desktopEnabled)}).catch(()=>{});const y=new EventSource("/api/ui/events");return y.onmessage=x=>{try{const m=JSON.parse(x.data);m.type==="state"?t({step:m.step??0,tunnelUrl:m.tunnelUrl??"",oneTimeKey:m.oneTimeKey??"",oneTimeKeyExpiresAt:m.oneTimeKeyExpiresAt??null,permanentKey:m.permanentKey??"",qrUrl:m.qrUrl??"",latency:m.latency??null,uptime:m.uptime??null}):m.type==="log"?l(C=>{const v=[...C,m.message];return v.length>zt?v.slice(-zt):v}):m.type==="updateAvailable"?f(m.version):m.type==="permissions"?(o({screenRecording:m.screenRecording,accessibility:m.accessibility}),m.desktopEnabled!==void 0&&r(m.desktopEnabled)):m.type==="connections"&&c(m.connections??[])}catch{}},y.onerror=()=>{},()=>y.close()},[]);const b=async y=>{await fetch("/api/permissions/request",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:y})}).catch(()=>{})},N=()=>{fetch("/api/ui/stop",{method:"POST"}).catch(()=>{}),t(Kt)},R=()=>{fetch("/api/ui/start",{method:"POST"}).catch(()=>{})},p=async()=>{const y=await fetch("/api/key/one-time",{method:"POST"}).catch(()=>null);if(!(y!=null&&y.ok))return;const x=await y.json().catch(()=>null);x!=null&&x.oneTimeKey&&t(m=>({...m,oneTimeKey:x.oneTimeKey,oneTimeKeyExpiresAt:x.expiresAt,qrUrl:x.qrUrl??m.qrUrl}))},w=async()=>{const y=!n;r(y),await fetch("/api/desktop/toggle",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:y})}).catch(()=>{})},E=async()=>{const y=await fetch("/api/key/regenerate",{method:"POST"}).catch(()=>null);if(!(y!=null&&y.ok))return;const x=await y.json().catch(()=>null);x!=null&&x.permanentKey&&t(m=>({...m,permanentKey:x.permanentKey}))};return u(ar,{step:e.step,tunnelUrl:e.tunnelUrl,oneTimeKey:e.oneTimeKey,oneTimeKeyExpiresAt:e.oneTimeKeyExpiresAt,permanentKey:e.permanentKey,qrUrl:e.qrUrl,permissions:i,desktopEnabled:n,updateVersion:a,connections:h,onRequestPermission:b,onDesktopToggle:w,onStop:N,onStart:R,onGenerateOneTimeKey:p,onRegenerateKey:E,logs:s,version:_})}wn(u(ur,{}),document.getElementById("root"));
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
2
+ <rect width="24" height="24" rx="6" fill="#FF570A"/>
3
+ <polyline points="5 18 10.5 12 5 6" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <line x1="13" y1="18" x2="19" y2="18" stroke="#ffffff" stroke-width="2" stroke-linecap="round"/>
5
+ </svg>
@@ -4,12 +4,13 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>9Remote</title>
7
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
7
8
  <link rel="preconnect" href="https://fonts.googleapis.com" />
8
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
10
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
10
11
  <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet" />
11
- <script type="module" crossorigin src="/assets/index-CMD-4YxV.js"></script>
12
- <link rel="stylesheet" crossorigin href="/assets/index-D4GJ1wNn.css">
12
+ <script type="module" crossorigin src="/assets/index-Dh53-SjC.js"></script>
13
+ <link rel="stylesheet" crossorigin href="/assets/index-DOMz0Zx8.css">
13
14
  </head>
14
15
  <body>
15
16
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "9remote",
3
- "version": "0.1.58",
3
+ "version": "0.1.60",
4
4
  "type": "module",
5
5
  "description": "Remote terminal access from anywhere",
6
6
  "main": "index.js",
@@ -1,8 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function o(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(n){if(n.ep)return;n.ep=!0;const r=o(n);fetch(n.href,r)}})();var ue,B,Ot,O,et,jt,Vt,Jt,Ve,He,Ke,ie={},se=[],dn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,fe=Array.isArray;function F(e,t){for(var o in t)e[o]=t[o];return e}function Je(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function hn(e,t,o){var i,n,r,s={};for(r in t)r=="key"?i=t[r]:r=="ref"?n=t[r]:s[r]=t[r];if(arguments.length>2&&(s.children=arguments.length>3?ue.call(arguments,2):o),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)s[r]===void 0&&(s[r]=e.defaultProps[r]);return ne(e,s,i,n,null)}function ne(e,t,o,i,n){var r={type:e,props:t,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++Ot,__i:-1,__u:0};return n==null&&B.vnode!=null&&B.vnode(r),r}function H(e){return e.children}function re(e,t){this.props=e,this.context=t}function G(e,t){if(t==null)return e.__?G(e.__,e.__i+1):null;for(var o;t<e.__k.length;t++)if((o=e.__k[t])!=null&&o.__e!=null)return o.__e;return typeof e.type=="function"?G(e):null}function _n(e){if(e.__P&&e.__d){var t=e.__v,o=t.__e,i=[],n=[],r=F({},t);r.__v=t.__v+1,B.vnode&&B.vnode(r),Ye(e.__P,r,t,e.__n,e.__P.namespaceURI,32&t.__u?[o]:null,i,o??G(t),!!(32&t.__u),n),r.__v=t.__v,r.__.__k[r.__i]=r,Wt(i,r,n),t.__e=t.__=null,r.__e!=o&&Yt(r)}}function Yt(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Yt(e)}function tt(e){(!e.__d&&(e.__d=!0)&&O.push(e)&&!le.__r++||et!=B.debounceRendering)&&((et=B.debounceRendering)||jt)(le)}function le(){try{for(var e,t=1;O.length;)O.length>t&&O.sort(Vt),e=O.shift(),t=O.length,_n(e)}finally{O.length=le.__r=0}}function Gt(e,t,o,i,n,r,s,l,a,f,h){var c,_,d,b,N,P,y,m=i&&i.__k||se,g=t.length;for(a=mn(o,t,m,a,g),c=0;c<g;c++)(d=o.__k[c])!=null&&(_=d.__i!=-1&&m[d.__i]||ie,d.__i=c,P=Ye(e,d,_,n,r,s,l,a,f,h),b=d.__e,d.ref&&_.ref!=d.ref&&(_.ref&&Ge(_.ref,null,d),h.push(d.ref,d.__c||b,d)),N==null&&b!=null&&(N=b),(y=!!(4&d.__u))||_.__k===d.__k?a=Qt(d,a,e,y):typeof d.type=="function"&&P!==void 0?a=P:b&&(a=b.nextSibling),d.__u&=-7);return o.__e=N,a}function mn(e,t,o,i,n){var r,s,l,a,f,h=o.length,c=h,_=0;for(e.__k=new Array(n),r=0;r<n;r++)(s=t[r])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[r]=ne(null,s,null,null,null):fe(s)?s=e.__k[r]=ne(H,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[r]=ne(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[r]=s,a=r+_,s.__=e,s.__b=e.__b+1,l=null,(f=s.__i=gn(s,o,a,c))!=-1&&(c--,(l=o[f])&&(l.__u|=2)),l==null||l.__v==null?(f==-1&&(n>h?_--:n<h&&_++),typeof s.type!="function"&&(s.__u|=4)):f!=a&&(f==a-1?_--:f==a+1?_++:(f>a?_--:_++,s.__u|=4))):e.__k[r]=null;if(c)for(r=0;r<h;r++)(l=o[r])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=G(l)),Zt(l,l));return i}function Qt(e,t,o,i){var n,r;if(typeof e.type=="function"){for(n=e.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=e,t=Qt(n[r],t,o,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=G(e)),o.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function gn(e,t,o,i){var n,r,s,l=e.key,a=e.type,f=t[o],h=f!=null&&(2&f.__u)==0;if(f===null&&l==null||h&&l==f.key&&a==f.type)return o;if(i>(h?1:0)){for(n=o-1,r=o+1;n>=0||r<t.length;)if((f=t[s=n>=0?n--:r++])!=null&&(2&f.__u)==0&&l==f.key&&a==f.type)return s}return-1}function nt(e,t,o){t[0]=="-"?e.setProperty(t,o??""):e[t]=o==null?"":typeof o!="number"||dn.test(t)?o:o+"px"}function $(e,t,o,i,n){var r,s;e:if(t=="style")if(typeof o=="string")e.style.cssText=o;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(t in i)o&&t in o||nt(e.style,t,"");if(o)for(t in o)i&&o[t]==i[t]||nt(e.style,t,o[t])}else if(t[0]=="o"&&t[1]=="n")r=t!=(t=t.replace(Jt,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=o,o?i?o.u=i.u:(o.u=Ve,e.addEventListener(t,r?Ke:He,r)):e.removeEventListener(t,r?Ke:He,r);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=o??"";break e}catch{}typeof o=="function"||(o==null||o===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&o==1?"":o))}}function rt(e){return function(t){if(this.l){var o=this.l[t.type+e];if(t.t==null)t.t=Ve++;else if(t.t<o.u)return;return o(B.event?B.event(t):t)}}}function Ye(e,t,o,i,n,r,s,l,a,f){var h,c,_,d,b,N,P,y,m,g,p,A,x,C,v,w=t.type;if(t.constructor!==void 0)return null;128&o.__u&&(a=!!(32&o.__u),r=[l=t.__e=o.__e]),(h=B.__b)&&h(t);e:if(typeof w=="function")try{if(y=t.props,m=w.prototype&&w.prototype.render,g=(h=w.contextType)&&i[h.__c],p=h?g?g.props.value:h.__:i,o.__c?P=(c=t.__c=o.__c).__=c.__E:(m?t.__c=c=new w(y,p):(t.__c=c=new re(y,p),c.constructor=w,c.render=yn),g&&g.sub(c),c.state||(c.state={}),c.__n=i,_=c.__d=!0,c.__h=[],c._sb=[]),m&&c.__s==null&&(c.__s=c.state),m&&w.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=F({},c.__s)),F(c.__s,w.getDerivedStateFromProps(y,c.__s))),d=c.props,b=c.state,c.__v=t,_)m&&w.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),m&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(m&&w.getDerivedStateFromProps==null&&y!==d&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(y,p),t.__v==o.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(y,c.__s,p)===!1){t.__v!=o.__v&&(c.props=y,c.state=c.__s,c.__d=!1),t.__e=o.__e,t.__k=o.__k,t.__k.some(function(E){E&&(E.__=t)}),se.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&s.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(y,c.__s,p),m&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(d,b,N)})}if(c.context=p,c.props=y,c.__P=e,c.__e=!1,A=B.__r,x=0,m)c.state=c.__s,c.__d=!1,A&&A(t),h=c.render(c.props,c.state,c.context),se.push.apply(c.__h,c._sb),c._sb=[];else do c.__d=!1,A&&A(t),h=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++x<25);c.state=c.__s,c.getChildContext!=null&&(i=F(F({},i),c.getChildContext())),m&&!_&&c.getSnapshotBeforeUpdate!=null&&(N=c.getSnapshotBeforeUpdate(d,b)),C=h!=null&&h.type===H&&h.key==null?Xt(h.props.children):h,l=Gt(e,fe(C)?C:[C],t,o,i,n,r,s,l,a,f),c.base=t.__e,t.__u&=-161,c.__h.length&&s.push(c),P&&(c.__E=c.__=null)}catch(E){if(t.__v=null,a||r!=null)if(E.then){for(t.__u|=a?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;r[r.indexOf(l)]=null,t.__e=l}else{for(v=r.length;v--;)Je(r[v]);ze(t)}else t.__e=o.__e,t.__k=o.__k,E.then||ze(t);B.__e(E,t,o)}else r==null&&t.__v==o.__v?(t.__k=o.__k,t.__e=o.__e):l=t.__e=pn(o.__e,t,o,i,n,r,s,a,f);return(h=B.diffed)&&h(t),128&t.__u?void 0:l}function ze(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ze))}function Wt(e,t,o){for(var i=0;i<o.length;i++)Ge(o[i],o[++i],o[++i]);B.__c&&B.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){B.__e(r,n.__v)}})}function Xt(e){return typeof e!="object"||e==null||e.__b>0?e:fe(e)?e.map(Xt):F({},e)}function pn(e,t,o,i,n,r,s,l,a){var f,h,c,_,d,b,N,P=o.props||ie,y=t.props,m=t.type;if(m=="svg"?n="http://www.w3.org/2000/svg":m=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),r!=null){for(f=0;f<r.length;f++)if((d=r[f])&&"setAttribute"in d==!!m&&(m?d.localName==m:d.nodeType==3)){e=d,r[f]=null;break}}if(e==null){if(m==null)return document.createTextNode(y);e=document.createElementNS(n,m,y.is&&y),l&&(B.__m&&B.__m(t,r),l=!1),r=null}if(m==null)P===y||l&&e.data==y||(e.data=y);else{if(r=r&&ue.call(e.childNodes),!l&&r!=null)for(P={},f=0;f<e.attributes.length;f++)P[(d=e.attributes[f]).name]=d.value;for(f in P)d=P[f],f=="dangerouslySetInnerHTML"?c=d:f=="children"||f in y||f=="value"&&"defaultValue"in y||f=="checked"&&"defaultChecked"in y||$(e,f,null,d,n);for(f in y)d=y[f],f=="children"?_=d:f=="dangerouslySetInnerHTML"?h=d:f=="value"?b=d:f=="checked"?N=d:l&&typeof d!="function"||P[f]===d||$(e,f,d,P[f],n);if(h)l||c&&(h.__html==c.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),Gt(t.type=="template"?e.content:e,fe(_)?_:[_],t,o,i,m=="foreignObject"?"http://www.w3.org/1999/xhtml":n,r,s,r?r[0]:o.__k&&G(o,0),l,a),r!=null)for(f=r.length;f--;)Je(r[f]);l||(f="value",m=="progress"&&b==null?e.removeAttribute("value"):b!=null&&(b!==e[f]||m=="progress"&&!b||m=="option"&&b!=P[f])&&$(e,f,b,P[f],n),f="checked",N!=null&&N!=e[f]&&$(e,f,N,P[f],n))}return e}function Ge(e,t,o){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&t==null||(e.__u=e(t))}else e.current=t}catch(n){B.__e(n,o)}}function Zt(e,t,o){var i,n;if(B.unmount&&B.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Ge(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(r){B.__e(r,t)}i.base=i.__P=null}if(i=e.__k)for(n=0;n<i.length;n++)i[n]&&Zt(i[n],t,o||typeof e.type!="function");o||Je(e.__e),e.__c=e.__=e.__e=void 0}function yn(e,t,o){return this.constructor(e,o)}function wn(e,t,o){var i,n,r,s;t==document&&(t=document.documentElement),B.__&&B.__(e,t),n=(i=!1)?null:t.__k,r=[],s=[],Ye(t,e=t.__k=hn(H,null,[e]),n||ie,ie,t.namespaceURI,n?null:t.firstChild?ue.call(t.childNodes):null,r,n?n.__e:t.firstChild,i,s),Wt(r,e,s)}ue=se.slice,B={__e:function(e,t,o,i){for(var n,r,s;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&r.getDerivedStateFromError!=null&&(n.setState(r.getDerivedStateFromError(e)),s=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,i||{}),s=n.__d),s)return n.__E=n}catch(l){e=l}throw e}},Ot=0,re.prototype.setState=function(e,t){var o;o=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=F({},this.state),typeof e=="function"&&(e=e(F({},o),this.props)),e&&F(o,e),e!=null&&this.__v&&(t&&this._sb.push(t),tt(this))},re.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),tt(this))},re.prototype.render=H,O=[],jt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vt=function(e,t){return e.__v.__b-t.__v.__b},le.__r=0,Jt=/(PointerCapture)$|Capture$/i,Ve=0,He=rt(!1),Ke=rt(!0);var bn=0;function u(e,t,o,i,n,r){t||(t={});var s,l,a=t;if("ref"in a)for(l in a={},t)l=="ref"?s=t[l]:a[l]=t[l];var f={type:e,props:a,key:o,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--bn,__i:-1,__u:0,__source:n,__self:r};if(typeof e=="function"&&(s=e.defaultProps))for(l in s)a[l]===void 0&&(a[l]=s[l]);return B.vnode&&B.vnode(f),f}var X,M,ge,ot,ae=0,$t=[],I=B,it=I.__b,st=I.__r,lt=I.diffed,at=I.__c,ct=I.unmount,ut=I.__;function Qe(e,t){I.__h&&I.__h(M,e,ae||t),ae=0;var o=M.__H||(M.__H={__:[],__h:[]});return e>=o.__.length&&o.__.push({}),o.__[e]}function L(e){return ae=1,xn(nn,e)}function xn(e,t,o){var i=Qe(X++,2);if(i.t=e,!i.__c&&(i.__=[nn(void 0,t),function(l){var a=i.__N?i.__N[0]:i.__[0],f=i.t(a,l);a!==f&&(i.__N=[f,i.__[1]],i.__c.setState({}))}],i.__c=M,!M.__f)){var n=function(l,a,f){if(!i.__c.__H)return!0;var h=i.__c.__H.__.filter(function(_){return _.__c});if(h.every(function(_){return!_.__N}))return!r||r.call(this,l,a,f);var c=i.__c.props!==l;return h.some(function(_){if(_.__N){var d=_.__[0];_.__=_.__N,_.__N=void 0,d!==_.__[0]&&(c=!0)}}),r&&r.call(this,l,a,f)||c};M.__f=!0;var r=M.shouldComponentUpdate,s=M.componentWillUpdate;M.componentWillUpdate=function(l,a,f){if(this.__e){var h=r;r=void 0,n(l,a,f),r=h}s&&s.call(this,l,a,f)},M.shouldComponentUpdate=n}return i.__N||i.__}function ce(e,t){var o=Qe(X++,3);!I.__s&&tn(o.__H,t)&&(o.__=e,o.u=t,M.__H.__h.push(o))}function en(e){return ae=5,vn(function(){return{current:e}},[])}function vn(e,t){var o=Qe(X++,7);return tn(o.__H,t)&&(o.__=e(),o.__H=t,o.__h=e),o.__}function Nn(){for(var e;e=$t.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(oe),t.__h.some(Oe),t.__h=[]}catch(o){t.__h=[],I.__e(o,e.__v)}}}I.__b=function(e){M=null,it&&it(e)},I.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ut&&ut(e,t)},I.__r=function(e){st&&st(e),X=0;var t=(M=e.__c).__H;t&&(ge===M?(t.__h=[],M.__h=[],t.__.some(function(o){o.__N&&(o.__=o.__N),o.u=o.__N=void 0})):(t.__h.some(oe),t.__h.some(Oe),t.__h=[],X=0)),ge=M},I.diffed=function(e){lt&&lt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&($t.push(t)!==1&&ot===I.requestAnimationFrame||((ot=I.requestAnimationFrame)||Cn)(Nn)),t.__H.__.some(function(o){o.u&&(o.__H=o.u),o.u=void 0})),ge=M=null},I.__c=function(e,t){t.some(function(o){try{o.__h.some(oe),o.__h=o.__h.filter(function(i){return!i.__||Oe(i)})}catch(i){t.some(function(n){n.__h&&(n.__h=[])}),t=[],I.__e(i,o.__v)}}),at&&at(e,t)},I.unmount=function(e){ct&&ct(e);var t,o=e.__c;o&&o.__H&&(o.__H.__.some(function(i){try{oe(i)}catch(n){t=n}}),o.__H=void 0,t&&I.__e(t,o.__v))};var ft=typeof requestAnimationFrame=="function";function Cn(e){var t,o=function(){clearTimeout(i),ft&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(o,35);ft&&(t=requestAnimationFrame(o))}function oe(e){var t=M,o=e.__c;typeof o=="function"&&(e.__c=void 0,o()),M=t}function Oe(e){var t=M;e.__c=e.__(),M=t}function tn(e,t){return!e||e.length!==t.length||t.some(function(o,i){return o!==e[i]})}function nn(e,t){return typeof t=="function"?t(e):t}const En=[{icon:"download",label:"Preparing",desc:"Checking tunnel binary"},{icon:"cloud_sync",label:"Connecting",desc:"Creating session"},{icon:"lan",label:"Tunneling",desc:"Starting secure tunnel"},{icon:"check_circle",label:"Ready",desc:"Connected"}];function kn({currentStep:e}){const t=e-1;return u("div",{className:"glass-card p-5 flex flex-col gap-4",children:[u("span",{className:"text-xs text-white/50 font-medium uppercase tracking-wider",children:"Setting up connection"}),u("div",{className:"flex flex-col gap-3",children:En.map((o,i)=>{const n=i<t,r=i===t;return u("div",{className:"flex items-center gap-3",children:[u("div",{className:"w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",style:{background:n?"var(--brand-500)":r?"rgba(255,87,10,0.15)":"rgba(255,255,255,0.06)",border:r?"1.5px solid var(--brand-500)":"1.5px solid transparent"},children:n?u("span",{className:"material-symbols-outlined text-white",style:{fontSize:16},children:"check"}):r?u("span",{className:"flex gap-0.5 items-center",children:[0,1,2].map(s=>u("span",{className:"w-1 h-1 rounded-full bg-orange-400 dot-bounce",style:{animationDelay:`${s*.18}s`}},s))}):u("span",{className:"material-symbols-outlined text-white/20",style:{fontSize:16},children:o.icon})}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:`text-sm font-medium ${n?"text-white/60":r?"text-white":"text-white/25"}`,children:o.label}),u("p",{className:`text-xs mt-0.5 ${r?"text-white/40":"text-white/20"}`,children:o.desc})]}),n&&u("span",{className:"text-xs text-white/30 flex-shrink-0",children:"Done"}),r&&u("span",{className:"text-xs flex-shrink-0 px-2 py-0.5 rounded-full",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Running"})]},i)})})]})}function Sn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Y={},pe,dt;function Tn(){return dt||(dt=1,pe=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),pe}var ye={},z={},ht;function j(){if(ht)return z;ht=1;let e;const t=[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 z.getSymbolSize=function(i){if(!i)throw new Error('"version" cannot be null or undefined');if(i<1||i>40)throw new Error('"version" should be in range from 1 to 40');return i*4+17},z.getSymbolTotalCodewords=function(i){return t[i]},z.getBCHDigit=function(o){let i=0;for(;o!==0;)i++,o>>>=1;return i},z.setToSJISFunction=function(i){if(typeof i!="function")throw new Error('"toSJISFunc" is not a valid function.');e=i},z.isKanjiModeEnabled=function(){return typeof e<"u"},z.toSJIS=function(i){return e(i)},z}var we={},_t;function We(){return _t||(_t=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+o)}}e.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},e.from=function(i,n){if(e.isValid(i))return i;try{return t(i)}catch{return n}}})(we)),we}var be,mt;function Pn(){if(mt)return be;mt=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const o=Math.floor(t/8);return(this.buffer[o]>>>7-t%8&1)===1},put:function(t,o){for(let i=0;i<o;i++)this.putBit((t>>>o-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const o=Math.floor(this.length/8);this.buffer.length<=o&&this.buffer.push(0),t&&(this.buffer[o]|=128>>>this.length%8),this.length++}},be=e,be}var xe,gt;function Rn(){if(gt)return xe;gt=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,o,i,n){const r=t*this.size+o;this.data[r]=i,n&&(this.reservedBit[r]=!0)},e.prototype.get=function(t,o){return this.data[t*this.size+o]},e.prototype.xor=function(t,o,i){this.data[t*this.size+o]^=i},e.prototype.isReserved=function(t,o){return this.reservedBit[t*this.size+o]},xe=e,xe}var ve={},pt;function An(){return pt||(pt=1,(function(e){const t=j().getSymbolSize;e.getRowColCoords=function(i){if(i===1)return[];const n=Math.floor(i/7)+2,r=t(i),s=r===145?26:Math.ceil((r-13)/(2*n-2))*2,l=[r-7];for(let a=1;a<n-1;a++)l[a]=l[a-1]-s;return l.push(6),l.reverse()},e.getPositions=function(i){const n=[],r=e.getRowColCoords(i),s=r.length;for(let l=0;l<s;l++)for(let a=0;a<s;a++)l===0&&a===0||l===0&&a===s-1||l===s-1&&a===0||n.push([r[l],r[a]]);return n}})(ve)),ve}var Ne={},yt;function Bn(){if(yt)return Ne;yt=1;const e=j().getSymbolSize,t=7;return Ne.getPositions=function(i){const n=e(i);return[[0,0],[n-t,0],[0,n-t]]},Ne}var Ce={},wt;function Mn(){return wt||(wt=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},e.from=function(n){return e.isValid(n)?parseInt(n,10):void 0},e.getPenaltyN1=function(n){const r=n.size;let s=0,l=0,a=0,f=null,h=null;for(let c=0;c<r;c++){l=a=0,f=h=null;for(let _=0;_<r;_++){let d=n.get(c,_);d===f?l++:(l>=5&&(s+=t.N1+(l-5)),f=d,l=1),d=n.get(_,c),d===h?a++:(a>=5&&(s+=t.N1+(a-5)),h=d,a=1)}l>=5&&(s+=t.N1+(l-5)),a>=5&&(s+=t.N1+(a-5))}return s},e.getPenaltyN2=function(n){const r=n.size;let s=0;for(let l=0;l<r-1;l++)for(let a=0;a<r-1;a++){const f=n.get(l,a)+n.get(l,a+1)+n.get(l+1,a)+n.get(l+1,a+1);(f===4||f===0)&&s++}return s*t.N2},e.getPenaltyN3=function(n){const r=n.size;let s=0,l=0,a=0;for(let f=0;f<r;f++){l=a=0;for(let h=0;h<r;h++)l=l<<1&2047|n.get(f,h),h>=10&&(l===1488||l===93)&&s++,a=a<<1&2047|n.get(h,f),h>=10&&(a===1488||a===93)&&s++}return s*t.N3},e.getPenaltyN4=function(n){let r=0;const s=n.data.length;for(let a=0;a<s;a++)r+=n.data[a];return Math.abs(Math.ceil(r*100/s/5)-10)*t.N4};function o(i,n,r){switch(i){case e.Patterns.PATTERN000:return(n+r)%2===0;case e.Patterns.PATTERN001:return n%2===0;case e.Patterns.PATTERN010:return r%3===0;case e.Patterns.PATTERN011:return(n+r)%3===0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2===0;case e.Patterns.PATTERN101:return n*r%2+n*r%3===0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2===0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}e.applyMask=function(n,r){const s=r.size;for(let l=0;l<s;l++)for(let a=0;a<s;a++)r.isReserved(a,l)||r.xor(a,l,o(n,a,l))},e.getBestMask=function(n,r){const s=Object.keys(e.Patterns).length;let l=0,a=1/0;for(let f=0;f<s;f++){r(f),e.applyMask(f,n);const h=e.getPenaltyN1(n)+e.getPenaltyN2(n)+e.getPenaltyN3(n)+e.getPenaltyN4(n);e.applyMask(f,n),h<a&&(a=h,l=f)}return l}})(Ce)),Ce}var ee={},bt;function rn(){if(bt)return ee;bt=1;const e=We(),t=[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],o=[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 ee.getBlocksCount=function(n,r){switch(r){case e.L:return t[(n-1)*4+0];case e.M:return t[(n-1)*4+1];case e.Q:return t[(n-1)*4+2];case e.H:return t[(n-1)*4+3];default:return}},ee.getTotalCodewordsCount=function(n,r){switch(r){case e.L:return o[(n-1)*4+0];case e.M:return o[(n-1)*4+1];case e.Q:return o[(n-1)*4+2];case e.H:return o[(n-1)*4+3];default:return}},ee}var Ee={},W={},xt;function In(){if(xt)return W;xt=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let i=1;for(let n=0;n<255;n++)e[n]=i,t[i]=n,i<<=1,i&256&&(i^=285);for(let n=255;n<512;n++)e[n]=e[n-255]})(),W.log=function(i){if(i<1)throw new Error("log("+i+")");return t[i]},W.exp=function(i){return e[i]},W.mul=function(i,n){return i===0||n===0?0:e[t[i]+t[n]]},W}var vt;function Ln(){return vt||(vt=1,(function(e){const t=In();e.mul=function(i,n){const r=new Uint8Array(i.length+n.length-1);for(let s=0;s<i.length;s++)for(let l=0;l<n.length;l++)r[s+l]^=t.mul(i[s],n[l]);return r},e.mod=function(i,n){let r=new Uint8Array(i);for(;r.length-n.length>=0;){const s=r[0];for(let a=0;a<n.length;a++)r[a]^=t.mul(n[a],s);let l=0;for(;l<r.length&&r[l]===0;)l++;r=r.slice(l)}return r},e.generateECPolynomial=function(i){let n=new Uint8Array([1]);for(let r=0;r<i;r++)n=e.mul(n,new Uint8Array([1,t.exp(r)]));return n}})(Ee)),Ee}var ke,Nt;function Dn(){if(Nt)return ke;Nt=1;const e=Ln();function t(o){this.genPoly=void 0,this.degree=o,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(i){this.degree=i,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(i){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(i.length+this.degree);n.set(i);const r=e.mod(n,this.genPoly),s=this.degree-r.length;if(s>0){const l=new Uint8Array(this.degree);return l.set(r,s),l}return r},ke=t,ke}var Se={},Te={},Pe={},Ct;function on(){return Ct||(Ct=1,Pe.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),Pe}var D={},Et;function sn(){if(Et)return D;Et=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let o="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";o=o.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+o+`)(?:.|[\r
2
- ]))+`;D.KANJI=new RegExp(o,"g"),D.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),D.BYTE=new RegExp(i,"g"),D.NUMERIC=new RegExp(e,"g"),D.ALPHANUMERIC=new RegExp(t,"g");const n=new RegExp("^"+o+"$"),r=new RegExp("^"+e+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return D.testKanji=function(a){return n.test(a)},D.testNumeric=function(a){return r.test(a)},D.testAlphanumeric=function(a){return s.test(a)},D}var kt;function V(){return kt||(kt=1,(function(e){const t=on(),o=sn();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(r,s){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?r.ccBits[0]:s<27?r.ccBits[1]:r.ccBits[2]},e.getBestModeForData=function(r){return o.testNumeric(r)?e.NUMERIC:o.testAlphanumeric(r)?e.ALPHANUMERIC:o.testKanji(r)?e.KANJI:e.BYTE},e.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},e.isValid=function(r){return r&&r.bit&&r.ccBits};function i(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+n)}}e.from=function(r,s){if(e.isValid(r))return r;try{return i(r)}catch{return s}}})(Te)),Te}var St;function Un(){return St||(St=1,(function(e){const t=j(),o=rn(),i=We(),n=V(),r=on(),s=7973,l=t.getBCHDigit(s);function a(_,d,b){for(let N=1;N<=40;N++)if(d<=e.getCapacity(N,b,_))return N}function f(_,d){return n.getCharCountIndicator(_,d)+4}function h(_,d){let b=0;return _.forEach(function(N){const P=f(N.mode,d);b+=P+N.getBitsLength()}),b}function c(_,d){for(let b=1;b<=40;b++)if(h(_,b)<=e.getCapacity(b,d,n.MIXED))return b}e.from=function(d,b){return r.isValid(d)?parseInt(d,10):b},e.getCapacity=function(d,b,N){if(!r.isValid(d))throw new Error("Invalid QR Code version");typeof N>"u"&&(N=n.BYTE);const P=t.getSymbolTotalCodewords(d),y=o.getTotalCodewordsCount(d,b),m=(P-y)*8;if(N===n.MIXED)return m;const g=m-f(N,d);switch(N){case n.NUMERIC:return Math.floor(g/10*3);case n.ALPHANUMERIC:return Math.floor(g/11*2);case n.KANJI:return Math.floor(g/13);case n.BYTE:default:return Math.floor(g/8)}},e.getBestVersionForData=function(d,b){let N;const P=i.from(b,i.M);if(Array.isArray(d)){if(d.length>1)return c(d,P);if(d.length===0)return 1;N=d[0]}else N=d;return a(N.mode,N.getLength(),P)},e.getEncodedBits=function(d){if(!r.isValid(d)||d<7)throw new Error("Invalid QR Code version");let b=d<<12;for(;t.getBCHDigit(b)-l>=0;)b^=s<<t.getBCHDigit(b)-l;return d<<12|b}})(Se)),Se}var Re={},Tt;function qn(){if(Tt)return Re;Tt=1;const e=j(),t=1335,o=21522,i=e.getBCHDigit(t);return Re.getEncodedBits=function(r,s){const l=r.bit<<3|s;let a=l<<10;for(;e.getBCHDigit(a)-i>=0;)a^=t<<e.getBCHDigit(a)-i;return(l<<10|a)^o},Re}var Ae={},Be,Pt;function Fn(){if(Pt)return Be;Pt=1;const e=V();function t(o){this.mode=e.NUMERIC,this.data=o.toString()}return t.getBitsLength=function(i){return 10*Math.floor(i/3)+(i%3?i%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(i){let n,r,s;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),s=parseInt(r,10),i.put(s,10);const l=this.data.length-n;l>0&&(r=this.data.substr(n),s=parseInt(r,10),i.put(s,l*3+1))},Be=t,Be}var Me,Rt;function Hn(){if(Rt)return Me;Rt=1;const e=V(),t=["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 o(i){this.mode=e.ALPHANUMERIC,this.data=i}return o.getBitsLength=function(n){return 11*Math.floor(n/2)+6*(n%2)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(n){let r;for(r=0;r+2<=this.data.length;r+=2){let s=t.indexOf(this.data[r])*45;s+=t.indexOf(this.data[r+1]),n.put(s,11)}this.data.length%2&&n.put(t.indexOf(this.data[r]),6)},Me=o,Me}var Ie,At;function Kn(){if(At)return Ie;At=1;const e=V();function t(o){this.mode=e.BYTE,typeof o=="string"?this.data=new TextEncoder().encode(o):this.data=new Uint8Array(o)}return t.getBitsLength=function(i){return i*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(o){for(let i=0,n=this.data.length;i<n;i++)o.put(this.data[i],8)},Ie=t,Ie}var Le,Bt;function zn(){if(Bt)return Le;Bt=1;const e=V(),t=j();function o(i){this.mode=e.KANJI,this.data=i}return o.getBitsLength=function(n){return n*13},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(i){let n;for(n=0;n<this.data.length;n++){let r=t.toSJIS(this.data[n]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[n]+`
3
- Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),i.put(r,13)}},Le=o,Le}var De={exports:{}},Mt;function On(){return Mt||(Mt=1,(function(e){var t={single_source_shortest_paths:function(o,i,n){var r={},s={};s[i]=0;var l=t.PriorityQueue.make();l.push(i,0);for(var a,f,h,c,_,d,b,N,P;!l.empty();){a=l.pop(),f=a.value,c=a.cost,_=o[f]||{};for(h in _)_.hasOwnProperty(h)&&(d=_[h],b=c+d,N=s[h],P=typeof s[h]>"u",(P||N>b)&&(s[h]=b,l.push(h,b),r[h]=f))}if(typeof n<"u"&&typeof s[n]>"u"){var y=["Could not find a path from ",i," to ",n,"."].join("");throw new Error(y)}return r},extract_shortest_path_from_predecessor_list:function(o,i){for(var n=[],r=i;r;)n.push(r),o[r],r=o[r];return n.reverse(),n},find_path:function(o,i,n){var r=t.single_source_shortest_paths(o,i,n);return t.extract_shortest_path_from_predecessor_list(r,n)},PriorityQueue:{make:function(o){var i=t.PriorityQueue,n={},r;o=o||{};for(r in i)i.hasOwnProperty(r)&&(n[r]=i[r]);return n.queue=[],n.sorter=o.sorter||i.default_sorter,n},default_sorter:function(o,i){return o.cost-i.cost},push:function(o,i){var n={value:o,cost:i};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(De)),De.exports}var It;function jn(){return It||(It=1,(function(e){const t=V(),o=Fn(),i=Hn(),n=Kn(),r=zn(),s=sn(),l=j(),a=On();function f(y){return unescape(encodeURIComponent(y)).length}function h(y,m,g){const p=[];let A;for(;(A=y.exec(g))!==null;)p.push({data:A[0],index:A.index,mode:m,length:A[0].length});return p}function c(y){const m=h(s.NUMERIC,t.NUMERIC,y),g=h(s.ALPHANUMERIC,t.ALPHANUMERIC,y);let p,A;return l.isKanjiModeEnabled()?(p=h(s.BYTE,t.BYTE,y),A=h(s.KANJI,t.KANJI,y)):(p=h(s.BYTE_KANJI,t.BYTE,y),A=[]),m.concat(g,p,A).sort(function(C,v){return C.index-v.index}).map(function(C){return{data:C.data,mode:C.mode,length:C.length}})}function _(y,m){switch(m){case t.NUMERIC:return o.getBitsLength(y);case t.ALPHANUMERIC:return i.getBitsLength(y);case t.KANJI:return r.getBitsLength(y);case t.BYTE:return n.getBitsLength(y)}}function d(y){return y.reduce(function(m,g){const p=m.length-1>=0?m[m.length-1]:null;return p&&p.mode===g.mode?(m[m.length-1].data+=g.data,m):(m.push(g),m)},[])}function b(y){const m=[];for(let g=0;g<y.length;g++){const p=y[g];switch(p.mode){case t.NUMERIC:m.push([p,{data:p.data,mode:t.ALPHANUMERIC,length:p.length},{data:p.data,mode:t.BYTE,length:p.length}]);break;case t.ALPHANUMERIC:m.push([p,{data:p.data,mode:t.BYTE,length:p.length}]);break;case t.KANJI:m.push([p,{data:p.data,mode:t.BYTE,length:f(p.data)}]);break;case t.BYTE:m.push([{data:p.data,mode:t.BYTE,length:f(p.data)}])}}return m}function N(y,m){const g={},p={start:{}};let A=["start"];for(let x=0;x<y.length;x++){const C=y[x],v=[];for(let w=0;w<C.length;w++){const E=C[w],k=""+x+w;v.push(k),g[k]={node:E,lastCount:0},p[k]={};for(let T=0;T<A.length;T++){const S=A[T];g[S]&&g[S].node.mode===E.mode?(p[S][k]=_(g[S].lastCount+E.length,E.mode)-_(g[S].lastCount,E.mode),g[S].lastCount+=E.length):(g[S]&&(g[S].lastCount=E.length),p[S][k]=_(E.length,E.mode)+4+t.getCharCountIndicator(E.mode,m))}}A=v}for(let x=0;x<A.length;x++)p[A[x]].end=0;return{map:p,table:g}}function P(y,m){let g;const p=t.getBestModeForData(y);if(g=t.from(m,p),g!==t.BYTE&&g.bit<p.bit)throw new Error('"'+y+'" cannot be encoded with mode '+t.toString(g)+`.
4
- Suggested mode is: `+t.toString(p));switch(g===t.KANJI&&!l.isKanjiModeEnabled()&&(g=t.BYTE),g){case t.NUMERIC:return new o(y);case t.ALPHANUMERIC:return new i(y);case t.KANJI:return new r(y);case t.BYTE:return new n(y)}}e.fromArray=function(m){return m.reduce(function(g,p){return typeof p=="string"?g.push(P(p,null)):p.data&&g.push(P(p.data,p.mode)),g},[])},e.fromString=function(m,g){const p=c(m,l.isKanjiModeEnabled()),A=b(p),x=N(A,g),C=a.find_path(x.map,"start","end"),v=[];for(let w=1;w<C.length-1;w++)v.push(x.table[C[w]].node);return e.fromArray(d(v))},e.rawSplit=function(m){return e.fromArray(c(m,l.isKanjiModeEnabled()))}})(Ae)),Ae}var Lt;function Vn(){if(Lt)return ye;Lt=1;const e=j(),t=We(),o=Pn(),i=Rn(),n=An(),r=Bn(),s=Mn(),l=rn(),a=Dn(),f=Un(),h=qn(),c=V(),_=jn();function d(x,C){const v=x.size,w=r.getPositions(C);for(let E=0;E<w.length;E++){const k=w[E][0],T=w[E][1];for(let S=-1;S<=7;S++)if(!(k+S<=-1||v<=k+S))for(let R=-1;R<=7;R++)T+R<=-1||v<=T+R||(S>=0&&S<=6&&(R===0||R===6)||R>=0&&R<=6&&(S===0||S===6)||S>=2&&S<=4&&R>=2&&R<=4?x.set(k+S,T+R,!0,!0):x.set(k+S,T+R,!1,!0))}}function b(x){const C=x.size;for(let v=8;v<C-8;v++){const w=v%2===0;x.set(v,6,w,!0),x.set(6,v,w,!0)}}function N(x,C){const v=n.getPositions(C);for(let w=0;w<v.length;w++){const E=v[w][0],k=v[w][1];for(let T=-2;T<=2;T++)for(let S=-2;S<=2;S++)T===-2||T===2||S===-2||S===2||T===0&&S===0?x.set(E+T,k+S,!0,!0):x.set(E+T,k+S,!1,!0)}}function P(x,C){const v=x.size,w=f.getEncodedBits(C);let E,k,T;for(let S=0;S<18;S++)E=Math.floor(S/3),k=S%3+v-8-3,T=(w>>S&1)===1,x.set(E,k,T,!0),x.set(k,E,T,!0)}function y(x,C,v){const w=x.size,E=h.getEncodedBits(C,v);let k,T;for(k=0;k<15;k++)T=(E>>k&1)===1,k<6?x.set(k,8,T,!0):k<8?x.set(k+1,8,T,!0):x.set(w-15+k,8,T,!0),k<8?x.set(8,w-k-1,T,!0):k<9?x.set(8,15-k-1+1,T,!0):x.set(8,15-k-1,T,!0);x.set(w-8,8,1,!0)}function m(x,C){const v=x.size;let w=-1,E=v-1,k=7,T=0;for(let S=v-1;S>0;S-=2)for(S===6&&S--;;){for(let R=0;R<2;R++)if(!x.isReserved(E,S-R)){let K=!1;T<C.length&&(K=(C[T]>>>k&1)===1),x.set(E,S-R,K),k--,k===-1&&(T++,k=7)}if(E+=w,E<0||v<=E){E-=w,w=-w;break}}}function g(x,C,v){const w=new o;v.forEach(function(R){w.put(R.mode.bit,4),w.put(R.getLength(),c.getCharCountIndicator(R.mode,x)),R.write(w)});const E=e.getSymbolTotalCodewords(x),k=l.getTotalCodewordsCount(x,C),T=(E-k)*8;for(w.getLengthInBits()+4<=T&&w.put(0,4);w.getLengthInBits()%8!==0;)w.putBit(0);const S=(T-w.getLengthInBits())/8;for(let R=0;R<S;R++)w.put(R%2?17:236,8);return p(w,x,C)}function p(x,C,v){const w=e.getSymbolTotalCodewords(C),E=l.getTotalCodewordsCount(C,v),k=w-E,T=l.getBlocksCount(C,v),S=w%T,R=T-S,K=Math.floor(w/T),Q=Math.floor(k/T),cn=Q+1,Xe=K-Q,un=new a(Xe);let de=0;const Z=new Array(T),Ze=new Array(T);let he=0;const fn=new Uint8Array(x.buffer);for(let J=0;J<T;J++){const me=J<R?Q:cn;Z[J]=fn.slice(de,de+me),Ze[J]=un.encode(Z[J]),de+=me,he=Math.max(he,me)}const _e=new Uint8Array(w);let $e=0,U,q;for(U=0;U<he;U++)for(q=0;q<T;q++)U<Z[q].length&&(_e[$e++]=Z[q][U]);for(U=0;U<Xe;U++)for(q=0;q<T;q++)_e[$e++]=Ze[q][U];return _e}function A(x,C,v,w){let E;if(Array.isArray(x))E=_.fromArray(x);else if(typeof x=="string"){let K=C;if(!K){const Q=_.rawSplit(x);K=f.getBestVersionForData(Q,v)}E=_.fromString(x,K||40)}else throw new Error("Invalid data");const k=f.getBestVersionForData(E,v);if(!k)throw new Error("The amount of data is too big to be stored in a QR Code");if(!C)C=k;else if(C<k)throw new Error(`
5
- The chosen QR Code version cannot contain this amount of data.
6
- Minimum version required to store current data is: `+k+`.
7
- `);const T=g(C,v,E),S=e.getSymbolSize(C),R=new i(S);return d(R,C),b(R),N(R,C),y(R,v,0),C>=7&&P(R,C),m(R,T),isNaN(w)&&(w=s.getBestMask(R,y.bind(null,R,v))),s.applyMask(w,R),y(R,v,w),{modules:R,version:C,errorCorrectionLevel:v,maskPattern:w,segments:E}}return ye.create=function(C,v){if(typeof C>"u"||C==="")throw new Error("No input text");let w=t.M,E,k;return typeof v<"u"&&(w=t.from(v.errorCorrectionLevel,t.M),E=f.from(v.version),k=s.from(v.maskPattern),v.toSJISFunc&&e.setToSJISFunction(v.toSJISFunc)),A(C,E,w,k)},ye}var Ue={},qe={},Dt;function ln(){return Dt||(Dt=1,(function(e){function t(o){if(typeof o=="number"&&(o=o.toString()),typeof o!="string")throw new Error("Color should be defined as hex string");let i=o.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+o);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(r){return[r,r]}))),i.length===6&&i.push("F","F");const n=parseInt(i.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+i.slice(0,6).join("")}}e.getOptions=function(i){i||(i={}),i.color||(i.color={});const n=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,r=i.width&&i.width>=21?i.width:void 0,s=i.scale||4;return{width:r,scale:r?4:s,margin:n,color:{dark:t(i.color.dark||"#000000ff"),light:t(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},e.getScale=function(i,n){return n.width&&n.width>=i+n.margin*2?n.width/(i+n.margin*2):n.scale},e.getImageWidth=function(i,n){const r=e.getScale(i,n);return Math.floor((i+n.margin*2)*r)},e.qrToImageData=function(i,n,r){const s=n.modules.size,l=n.modules.data,a=e.getScale(s,r),f=Math.floor((s+r.margin*2)*a),h=r.margin*a,c=[r.color.light,r.color.dark];for(let _=0;_<f;_++)for(let d=0;d<f;d++){let b=(_*f+d)*4,N=r.color.light;if(_>=h&&d>=h&&_<f-h&&d<f-h){const P=Math.floor((_-h)/a),y=Math.floor((d-h)/a);N=c[l[P*s+y]?1:0]}i[b++]=N.r,i[b++]=N.g,i[b++]=N.b,i[b]=N.a}}})(qe)),qe}var Ut;function Jn(){return Ut||(Ut=1,(function(e){const t=ln();function o(n,r,s){n.clearRect(0,0,r.width,r.height),r.style||(r.style={}),r.height=s,r.width=s,r.style.height=s+"px",r.style.width=s+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(r,s,l){let a=l,f=s;typeof a>"u"&&(!s||!s.getContext)&&(a=s,s=void 0),s||(f=i()),a=t.getOptions(a);const h=t.getImageWidth(r.modules.size,a),c=f.getContext("2d"),_=c.createImageData(h,h);return t.qrToImageData(_.data,r,a),o(c,f,h),c.putImageData(_,0,0),f},e.renderToDataURL=function(r,s,l){let a=l;typeof a>"u"&&(!s||!s.getContext)&&(a=s,s=void 0),a||(a={});const f=e.render(r,s,a),h=a.type||"image/png",c=a.rendererOpts||{};return f.toDataURL(h,c.quality)}})(Ue)),Ue}var Fe={},qt;function Yn(){if(qt)return Fe;qt=1;const e=ln();function t(n,r){const s=n.a/255,l=r+'="'+n.hex+'"';return s<1?l+" "+r+'-opacity="'+s.toFixed(2).slice(1)+'"':l}function o(n,r,s){let l=n+r;return typeof s<"u"&&(l+=" "+s),l}function i(n,r,s){let l="",a=0,f=!1,h=0;for(let c=0;c<n.length;c++){const _=Math.floor(c%r),d=Math.floor(c/r);!_&&!f&&(f=!0),n[c]?(h++,c>0&&_>0&&n[c-1]||(l+=f?o("M",_+s,.5+d+s):o("m",a,0),a=0,f=!1),_+1<r&&n[c+1]||(l+=o("h",h),h=0)):a++}return l}return Fe.render=function(r,s,l){const a=e.getOptions(s),f=r.modules.size,h=r.modules.data,c=f+a.margin*2,_=a.color.light.a?"<path "+t(a.color.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",d="<path "+t(a.color.dark,"stroke")+' d="'+i(h,f,a.margin)+'"/>',b='viewBox="0 0 '+c+" "+c+'"',P='<svg xmlns="http://www.w3.org/2000/svg" '+(a.width?'width="'+a.width+'" height="'+a.width+'" ':"")+b+' shape-rendering="crispEdges">'+_+d+`</svg>
8
- `;return typeof l=="function"&&l(null,P),P},Fe}var Ft;function Gn(){if(Ft)return Y;Ft=1;const e=Tn(),t=Vn(),o=Jn(),i=Yn();function n(r,s,l,a,f){const h=[].slice.call(arguments,1),c=h.length,_=typeof h[c-1]=="function";if(!_&&!e())throw new Error("Callback required as last argument");if(_){if(c<2)throw new Error("Too few arguments provided");c===2?(f=l,l=s,s=a=void 0):c===3&&(s.getContext&&typeof f>"u"?(f=a,a=void 0):(f=a,a=l,l=s,s=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(l=s,s=a=void 0):c===2&&!s.getContext&&(a=l,l=s,s=void 0),new Promise(function(d,b){try{const N=t.create(l,a);d(r(N,s,a))}catch(N){b(N)}})}try{const d=t.create(l,a);f(null,r(d,s,a))}catch(d){f(d)}}return Y.create=t.create,Y.toCanvas=n.bind(null,o.render),Y.toDataURL=n.bind(null,o.renderToDataURL),Y.toString=n.bind(null,function(r,s,l){return i.render(r,l)}),Y}var Qn=Gn();const Wn=Sn(Qn);function je({message:e,confirmLabel:t="Confirm",confirmDanger:o=!1,onConfirm:i,onCancel:n}){return u("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0,0,0,0.6)"},children:u("div",{className:"glass-card p-5 flex flex-col gap-4 w-72",children:[u("p",{className:"text-sm text-white text-center",children:e}),u("div",{className:"flex gap-2",children:[u("button",{onClick:n,className:"glass-btn flex-1 py-2 text-sm text-white/60 hover:text-white",children:"Cancel"}),u("button",{onClick:i,className:"flex-1 py-2 text-sm font-semibold rounded-xl",style:{background:o?"rgba(220,53,69,0.8)":"var(--brand-500)",color:"#fff"},children:t})]})]})})}const Ht="9remote.cc";function Xn(e){if(e<=0)return"Expired";const t=Math.floor(e/1e3),o=Math.floor(t/60),i=t%60;return`${String(o).padStart(2,"0")}:${String(i).padStart(2,"0")}`}function te({icon:e,onClick:t,title:o,danger:i}){return u("button",{onClick:t,title:o,className:"glass-btn w-7 h-7 flex items-center justify-center flex-shrink-0 text-white/50 hover:text-white",style:i?{color:"rgba(255,100,100,0.7)"}:{},children:u("span",{className:"material-symbols-outlined",style:{fontSize:15},children:e})})}function Zn({qrUrl:e,oneTimeKey:t,oneTimeKeyExpiresAt:o,permanentKey:i,onGenerateOneTimeKey:n,onRegenerateKey:r}){const s=en(null),[l,a]=L(null),[f,h]=L(null),[c,_]=L(null);ce(()=>{!e||!s.current||Wn.toCanvas(s.current,e,{width:160,margin:1,color:{dark:"#0f1923",light:"#ffffff"}}).catch(()=>{})},[e]),ce(()=>{if(!o){a(null);return}const b=()=>a(o-Date.now());b();const N=setInterval(b,1e3);return()=>clearInterval(N)},[o]);const d=(b,N)=>{navigator.clipboard.writeText(b).catch(()=>{}),h(N),setTimeout(()=>h(null),2e3)};return u(H,{children:[c==="oneTime"&&u(je,{message:"Generate a new one-time key? The current one will expire immediately.",confirmLabel:"Generate",onConfirm:()=>{_(null),n==null||n()},onCancel:()=>_(null)}),c==="regen"&&u(je,{message:"Regenerate permanent key? All existing sessions will be disconnected.",confirmLabel:"Regenerate",confirmDanger:!0,onConfirm:()=>{_(null),r==null||r()},onCancel:()=>_(null)}),u("div",{className:"glass-card p-5 flex flex-col items-center gap-4",children:[u("div",{className:"w-44 h-44 rounded-xl overflow-hidden bg-white p-2 flex items-center justify-center flex-shrink-0",children:e?u("canvas",{ref:s}):u("span",{className:"material-symbols-outlined text-gray-300 text-6xl",children:"qr_code_2"})}),u("a",{href:`https://${Ht}/login`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 hover:opacity-80 transition-opacity",children:[u("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 flex-shrink-0"}),u("span",{className:"text-xs text-white/60 font-medium",children:[Ht,"/login"]})]}),u("div",{className:"w-full h-px bg-white/5"}),u("div",{className:"w-full flex flex-col gap-1.5",children:[u("div",{className:"flex items-center justify-between px-0.5",children:[u("span",{className:"text-xs font-medium text-white/50",children:"One-Time Key"}),u("span",{className:"text-xs text-white/30",children:"Single use · expires"})]}),u("div",{className:"w-full flex items-center gap-2 dark-card px-3 py-2.5",children:[u("span",{className:"material-symbols-outlined text-white/30 flex-shrink-0",style:{fontSize:16},children:"timer"}),u("span",{className:"flex-1 font-mono font-bold tracking-[0.18em] text-base truncate",style:{color:t?"var(--brand-500)":"rgba(255,255,255,0.15)"},children:t||"• • • • • •"}),l!==null&&u("span",{className:`text-xs font-mono flex-shrink-0 ${l<=0?"text-red-400":"text-white/40"}`,children:Xn(l)}),t&&u(te,{icon:f==="oneTime"?"check":"content_copy",onClick:()=>d(t,"oneTime"),title:"Copy one-time key"}),u(te,{icon:"refresh",onClick:()=>_("oneTime"),title:"New one-time key"})]})]}),u("div",{className:"w-full flex flex-col gap-1.5",children:[u("div",{className:"flex items-center justify-between px-0.5",children:[u("span",{className:"text-xs font-medium text-white/50",children:"Permanent Key"}),u("span",{className:"text-xs text-white/30",children:"Reusable · no expiry"})]}),u("div",{className:"w-full flex items-center gap-2 dark-card px-3 py-2.5",children:[u("span",{className:"material-symbols-outlined text-white/30 flex-shrink-0",style:{fontSize:16},children:"key"}),u("span",{className:"flex-1 font-mono text-xs text-white/50 truncate",children:i||"— not set —"}),i&&u(te,{icon:f==="permanent"?"check":"content_copy",onClick:()=>d(i,"permanent"),title:"Copy permanent key"}),u(te,{icon:"autorenew",onClick:()=>_("regen"),title:"Regenerate permanent key",danger:!0})]})]})]})]})}const $n="https://docs.9remote.cc/",an={screenRecording:{label:"Screen Recording",icon:"screenshot_monitor",desc:"Capture screen content"},accessibility:{label:"Accessibility",icon:"accessibility_new",desc:"Control mouse & keyboard"}};function er({type:e,granted:t,onRequest:o}){const i=an[e]||{label:e,desc:""};return u("div",{className:"flex items-center gap-3 py-2 border-b border-white/5 last:border-0",children:[u("span",{className:`material-symbols-outlined flex-shrink-0 ${t?"text-green-400":"text-white/30"}`,style:{fontSize:18},children:t?"check_circle":"cancel"}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:`text-xs font-medium ${t?"text-white/80":"text-white/50"}`,children:i.label}),u("p",{className:"text-[10px] text-white/30 leading-4",children:i.desc})]}),!t&&u("button",{onClick:()=>o(e),className:"flex-shrink-0 text-xs px-2.5 py-1 rounded-lg font-medium",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Grant"})]})}function tr(){return u("div",{className:"glass-card p-4 flex items-center gap-3",children:[u("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(255,87,10,0.15)"},children:u("span",{className:"material-symbols-outlined",style:{fontSize:20,color:"var(--brand-400)"},children:"terminal"})}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:"text-sm font-semibold text-white",children:"Remote Terminal"}),u("p",{className:"text-xs text-white/40",children:"Full shell access · always on"})]}),u("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-full",style:{background:"rgba(74,222,128,0.1)"},children:[u("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400"}),u("span",{className:"text-xs text-green-400 font-medium",children:"On"})]})]})}function nr({enabled:e,onToggle:t,permissions:o,onRequestPermission:i}){const n=Object.entries(an);return u("div",{className:"glass-card p-4 flex flex-col gap-3",children:[u("div",{className:"flex items-center gap-3",children:[u("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:e?"rgba(255,87,10,0.15)":"rgba(255,255,255,0.05)"},children:u("span",{className:"material-symbols-outlined",style:{fontSize:20,color:e?"var(--brand-400)":"rgba(255,255,255,0.25)"},children:"desktop_windows"})}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:"text-sm font-semibold text-white",children:"Remote Desktop"}),u("p",{className:"text-xs text-white/40",children:"Control screen, mouse & keyboard"})]}),u("button",{onClick:t,className:"flex-shrink-0 w-11 h-6 rounded-full transition-all relative",style:{background:e?"var(--brand-500)":"rgba(255,255,255,0.1)"},children:u("span",{className:"absolute top-0.5 w-5 h-5 rounded-full bg-white transition-all",style:{left:e?"calc(100% - 22px)":"2px",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"}})})]}),e&&u("div",{className:"flex flex-col border-t border-white/5 pt-2",children:[u("p",{className:"text-[10px] text-white/30 uppercase tracking-wider mb-1",children:"System Permissions"}),n.map(([r])=>u(er,{type:r,granted:(o==null?void 0:o[r])??!1,onRequest:i},r))]})]})}function rr({version:e}){return e?u("div",{className:"px-5 py-2 flex items-center gap-2 border-b",style:{background:"rgba(255,87,10,0.08)",borderColor:"rgba(255,87,10,0.2)"},children:[u("span",{className:"material-symbols-outlined text-sm flex-shrink-0",style:{color:"var(--brand-400)"},children:"system_update"}),u("span",{className:"text-xs flex-1",style:{color:"var(--brand-400)"},children:["Version ",e," available"]}),u("button",{onClick:()=>fetch("/api/update",{method:"POST"}).catch(()=>{}),className:"flex-shrink-0 text-xs px-2 py-0.5 rounded font-medium",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Update"})]}):null}const or=[{icon:"terminal",label:"Terminal",desc:"Full shell access"},{icon:"desktop_windows",label:"Desktop",desc:"Remote screen control"},{icon:"folder_open",label:"Files",desc:"Browse & edit files"}],ir=[{icon:"qr_code_scanner",text:"Scan QR to connect instantly"},{icon:"wifi_off",text:"No port forwarding needed"},{icon:"devices",text:"Works on any device"}];function sr({onStart:e}){const[t,o]=L(!1),i=()=>{o(!0),e()};return u("div",{className:"flex-1 flex flex-col items-center justify-between px-6 py-6 overflow-y-auto",children:[u("div",{className:"flex flex-col items-center gap-2 text-center mt-2",children:[u("div",{className:"w-14 h-14 rounded-2xl flex items-center justify-center mb-1",style:{background:"var(--brand-500)",boxShadow:"0 8px 32px rgba(255,87,10,0.35)"},children:u("span",{className:"material-symbols-outlined text-white",style:{fontSize:30},children:"terminal"})}),u("h1",{className:"text-lg font-bold text-white tracking-tight",children:"9Remote"}),u("p",{className:"text-xs text-white/50 leading-5 max-w-[220px]",children:"Access your terminal, desktop & files from anywhere"})]}),u("div",{className:"flex gap-2 w-full mt-5",children:or.map(n=>u("div",{className:"flex-1 dark-card flex flex-col items-center gap-1.5 py-3 px-1",children:[u("span",{className:"material-symbols-outlined text-white/70",style:{fontSize:22,color:"var(--brand-400)"},children:n.icon}),u("p",{className:"text-xs font-semibold text-white",children:n.label}),u("p",{className:"text-[10px] text-white/40 text-center leading-4",children:n.desc})]},n.label))}),u("div",{className:"flex flex-col gap-2 w-full mt-4",children:ir.map(n=>u("div",{className:"flex items-center gap-2.5",children:[u("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:16,color:"var(--brand-400)"},children:n.icon}),u("span",{className:"text-xs text-white/60",children:n.text})]},n.text))}),u("button",{onClick:t?void 0:i,disabled:t,className:"btn-primary w-full py-3.5 flex items-center justify-center gap-2 text-sm font-semibold mt-6",style:{borderRadius:"var(--radius-brand)",opacity:t?.7:1},children:t?u(H,{children:[u("span",{className:"flex gap-0.5 items-center",children:[0,1,2].map(n=>u("span",{className:"w-1.5 h-1.5 rounded-full bg-white dot-bounce",style:{animationDelay:`${n*.18}s`}},n))}),"Connecting..."]}):u(H,{children:[u("span",{className:"material-symbols-outlined text-base",children:"play_arrow"}),"Connect"]})})]})}function lr({conn:e}){return u("div",{className:"flex items-center gap-3 py-2 border-b border-white/5 last:border-0",children:[u("div",{className:"w-2 h-2 rounded-full bg-green-400 flex-shrink-0"}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:"text-xs text-white font-medium truncate",children:e.ip||"Unknown"}),u("p",{className:"text-xs text-white/30",children:e.connectedAt?new Date(e.connectedAt).toLocaleTimeString():""})]}),u("span",{className:"text-xs text-white/30",children:e.type||"ws"})]})}function ar({step:e,tunnelUrl:t,oneTimeKey:o,oneTimeKeyExpiresAt:i,permanentKey:n,qrUrl:r,permissions:s,desktopEnabled:l,updateVersion:a,connections:f=[],onRequestPermission:h,onDesktopToggle:c,onStop:_,onStart:d,onGenerateOneTimeKey:b,onRegenerateKey:N,logs:P=[]}){const[y,m]=L("connect"),[g,p]=L(!1),A=en(null),x=e===0,C=e>0&&e<4;return ce(()=>{var v;y==="log"&&((v=A.current)==null||v.scrollIntoView({behavior:"smooth"}))},[P,y]),u("div",{className:"h-full flex flex-col relative overflow-hidden",style:{background:"#333"},children:[u("div",{className:"flex-1 flex flex-col w-full max-w-sm mx-auto min-h-0 dot-grid-bg overflow-hidden",children:[u("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/5",children:[u("div",{className:"flex items-center gap-3",children:[u("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--brand-500)"},children:u("span",{className:"material-symbols-outlined text-white text-base",children:"terminal"})}),u("span",{className:"brand-text text-xs",children:"9Remote"})]}),u("div",{className:"flex items-center gap-2",children:[u("button",{onClick:()=>window.open($n,"_blank"),className:"glass-btn w-7 h-7 flex items-center justify-center text-white/40 hover:text-white",children:u("span",{className:"material-symbols-outlined text-sm",children:"help_outline"})}),!x&&u("button",{onClick:()=>p(!0),className:"btn-danger px-3 h-7 flex items-center gap-1.5 text-xs font-medium",children:[u("span",{className:"material-symbols-outlined text-sm",children:"stop_circle"}),"Disconnect"]})]})]}),u(rr,{version:a}),x?u(sr,{onStart:d,connecting:!1}):C?u("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex flex-col gap-4",children:u(kn,{currentStep:e})}):u(H,{children:[u("div",{className:"flex px-5 gap-3 border-b border-white/5",children:[{id:"connect",label:"Connection"},{id:"log",label:"Logs"}].map(v=>u("button",{onClick:()=>m(v.id),className:"pb-2 text-xs font-medium border-b-2 transition-colors",style:y===v.id?{borderColor:"var(--brand-500)",color:"var(--brand-500)"}:{borderColor:"transparent",color:"rgba(255,255,255,0.4)"},children:v.label},v.id))}),u("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex flex-col gap-4",children:[y==="connect"&&u(H,{children:[u(Zn,{qrUrl:r,oneTimeKey:o,oneTimeKeyExpiresAt:i,permanentKey:n,tunnelUrl:t,onGenerateOneTimeKey:b,onRegenerateKey:N}),u(tr,{}),u(nr,{enabled:l,onToggle:c,permissions:s,onRequestPermission:h}),u("div",{className:"glass-card p-4 flex flex-col gap-1",children:[u("p",{className:"text-xs text-white/60 font-medium uppercase tracking-wider mb-2",children:["Clients",f.length>0?` (${f.length})`:""]}),f.length===0?u("p",{className:"text-xs text-white/30 text-center py-3",children:"No active connections"}):f.map((v,w)=>u(lr,{conn:v},w))]})]}),y==="log"&&u("div",{className:"flex-1 flex flex-col",children:P.length===0?u("p",{className:"text-xs text-white/30 text-center mt-8",children:"No logs yet"}):u("div",{className:"flex flex-col gap-0.5",children:[P.map((v,w)=>u("p",{className:"text-xs font-mono text-white/60 leading-5 break-all",children:v},w)),u("div",{ref:A})]})})]})]})]}),g&&u(je,{message:"Disconnect and stop the tunnel? Remote clients will be disconnected.",confirmLabel:"Disconnect",confirmDanger:!0,onConfirm:()=>{p(!1),_==null||_()},onCancel:()=>p(!1)})]})}const Kt={step:0,tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null,permanentKey:"",qrUrl:"",latency:null,uptime:null},cr={screenRecording:!1,accessibility:!1},zt=200;function ur(){const[e,t]=L(Kt),[o,i]=L(cr),[n,r]=L(!1),[s,l]=L([]),[a,f]=L(null),[h,c]=L([]);ce(()=>{fetch("/api/ui/state").then(g=>g.json()).then(g=>{t({step:g.step??0,tunnelUrl:g.tunnelUrl??"",oneTimeKey:g.oneTimeKey??"",oneTimeKeyExpiresAt:g.oneTimeKeyExpiresAt??null,permanentKey:g.permanentKey??"",qrUrl:g.qrUrl??"",latency:g.latency??null,uptime:g.uptime??null}),i({screenRecording:g.screenRecording??!1,accessibility:g.accessibility??!1}),g.desktopEnabled!==void 0&&r(g.desktopEnabled)}).catch(()=>{});const m=new EventSource("/api/ui/events");return m.onmessage=g=>{try{const p=JSON.parse(g.data);p.type==="state"?t({step:p.step??0,tunnelUrl:p.tunnelUrl??"",oneTimeKey:p.oneTimeKey??"",oneTimeKeyExpiresAt:p.oneTimeKeyExpiresAt??null,permanentKey:p.permanentKey??"",qrUrl:p.qrUrl??"",latency:p.latency??null,uptime:p.uptime??null}):p.type==="log"?l(A=>{const x=[...A,p.message];return x.length>zt?x.slice(-zt):x}):p.type==="updateAvailable"?f(p.version):p.type==="permissions"?(i({screenRecording:p.screenRecording,accessibility:p.accessibility}),p.desktopEnabled!==void 0&&r(p.desktopEnabled)):p.type==="connections"&&c(p.connections??[])}catch{}},m.onerror=()=>{},()=>m.close()},[]);const _=async m=>{await fetch("/api/permissions/request",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:m})}).catch(()=>{})},d=()=>{fetch("/api/ui/stop",{method:"POST"}).catch(()=>{}),t(Kt)},b=()=>{fetch("/api/ui/start",{method:"POST"}).catch(()=>{})},N=async()=>{const m=await fetch("/api/key/one-time",{method:"POST"}).catch(()=>null);if(!(m!=null&&m.ok))return;const g=await m.json().catch(()=>null);g!=null&&g.oneTimeKey&&t(p=>({...p,oneTimeKey:g.oneTimeKey,oneTimeKeyExpiresAt:g.expiresAt,qrUrl:g.qrUrl??p.qrUrl}))},P=async()=>{const m=!n;r(m),await fetch("/api/desktop/toggle",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:m})}).catch(()=>{})},y=async()=>{const m=await fetch("/api/key/regenerate",{method:"POST"}).catch(()=>null);if(!(m!=null&&m.ok))return;const g=await m.json().catch(()=>null);g!=null&&g.permanentKey&&t(p=>({...p,permanentKey:g.permanentKey}))};return u(ar,{step:e.step,tunnelUrl:e.tunnelUrl,oneTimeKey:e.oneTimeKey,oneTimeKeyExpiresAt:e.oneTimeKeyExpiresAt,permanentKey:e.permanentKey,qrUrl:e.qrUrl,permissions:o,desktopEnabled:n,updateVersion:a,connections:h,onRequestPermission:_,onDesktopToggle:P,onStop:d,onStart:b,onGenerateOneTimeKey:N,onRegenerateKey:y,logs:s})}wn(u(ur,{}),document.getElementById("root"));