9remote 0.1.60 → 0.1.61

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
@@ -822,6 +822,10 @@ async function startUiMode() {
822
822
  keyData = saveKey(machineId, key, "Default");
823
823
  }
824
824
 
825
+ // Parse --theme flag
826
+ const themeArg = process.argv.find(arg => arg.startsWith("--theme="));
827
+ const theme = themeArg ? themeArg.split("=")[1] : null;
828
+
825
829
  // Start server only (no tunnel yet — wait for UI Connect button)
826
830
  const alreadyRunning = await isServerRunning();
827
831
  const serverManager = alreadyRunning
@@ -837,8 +841,8 @@ async function startUiMode() {
837
841
  const getActiveTunnel = () => activeTunnel;
838
842
  const setActiveTunnel = (t) => { activeTunnel = t; };
839
843
 
840
- // Push permanentKey to UI so Welcome screen can display it
841
- await pushUiState({ permanentKey: keyData.key, step: 0 });
844
+ // Push permanentKey + theme to UI so Welcome screen can display it
845
+ await pushUiState({ permanentKey: keyData.key, step: 0, theme });
842
846
 
843
847
  setupExitHandler(serverManager, null, keyData.key);
844
848
  setupCmdPoller(getActiveTunnel, setActiveTunnel, keyData.key);
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 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
- `;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=vt(Je).times(o.getModuleCount()+3);e+=g+`
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 dt=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=dt();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=dt(),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 hn=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(),dn=un(),mn=hn();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=dn.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=dn.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),h=new br(i[a],f.getLength()-1),d=h.mod(f);s[a]=new Array(f.getLength()-1);for(var p=0;p<s[a].length;p++){var g=p+d.getLength()-s[a].length;s[a][p]=g>=0?d.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),h=vt(u.WHITE_BLACK).times(a+3);e+=f+`
4
+ `;for(var d=0;d<a;d+=2){e+=u.WHITE_ALL;for(var p=0;p<a;p++)c[d][p]===s&&c[d+1][p]===s?e+=u.WHITE_ALL:c[d][p]===s&&c[d+1][p]===i?e+=u.WHITE_BLACK:c[d][p]===i&&c[d+1][p]===s?e+=u.BLACK_WHITE:e+=u.BLACK_ALL;e+=u.WHITE_ALL+`
5
+ `}l||(e+=h)}else{var g=vt(Je).times(o.getModuleCount()+3);e+=g+`
6
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
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,h;return l===void 0?"Undefined":l===null?"Null":typeof(f=c(u=Object(l),s))=="string"?f:a?i(u):(h=i(u))=="Object"&&typeof u.callee=="function"?"Arguments":h}},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,h,d){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[h]||(s[h]={}),O=R[l],L=_?i:x?i[h]:(i[h]||{})[l];_&&(d=h);for(p in d)g=!k&&L&&L[p]!==void 0,g&&p in R||(T=g?L[p]:d[p],R[p]=_&&typeof L[p]!="function"?d[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),h=e(18),d=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=d(m.call(new b)),G!==Object.prototype&&(h(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),h=e(2),d=h.process,p=h.setImmediate,g=h.clearImmediate,T=h.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)(d)=="process"?i=function(w){d.nextTick(c(b,w,1))}:T?(s=new T,a=s.port2,s.port1.onmessage=A,i=c(a.postMessage,a,1)):h.addEventListener&&typeof postMessage=="function"&&!h.importScripts?(i=function(w){h.postMessage(w+"","*")},h.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,d.execSync)(_[T]).toString());return x?b:a(b)}function u(x){return new h.default(function(b,A){return(0,d.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),h=i(f);o.machineIdSync=l,o.machineId=u;var d=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 h,d=i(l),p=s(d.length),g=a(f,p);if(c&&u!=u){for(;p>g;)if(h=d[g++],h!=h)return!0}else for(;p>g;g++)if((c||g in d)&&d[g]===u)return c||g||0;return!c&&-1}}},function(t,d,e){var i=e(7),s=e(44),a=e(43),c=e(3),l=e(31),u=e(64),f={},h={},d=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===h)return w}else for(A=R.call(p);!(b=A.next()).done;)if(w=s(A,O,b.value,g),w===f||w===h)return w};d.BREAK=f,d.RETURN=h},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],h=f[i]();h.next=function(){return{done:u=!0}},f[i]=function(){return h},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,h,d,p=function(){var _,x;for(u&&(_=c.domain)&&_.exit();f;){x=f.fn,f=f.next;try{x()}catch(b){throw f?d():h=void 0,b}}h=void 0,_&&_.enter()};if(u)d=function(){c.nextTick(p)};else if(a){var g=!0,T=document.createTextNode("");new a(p).observe(T,{characterData:!0}),d=function(){T.data=g=!g}}else if(l&&l.resolve){var k=l.resolve();d=function(){k.then(p)}}else d=function(){s.call(i,p)};return function(_){var x={fn:_,next:void 0};h&&(h.next=x),f||(f=x,d()),h=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 h,d=e(16)("iframe"),p=a.length,g=">";for(d.style.display="none",e(25).appendChild(d),d.src="javascript:",h=d.contentWindow.document,h.open(),h.write("<script>document.F=Object</script"+g),h.close(),f=h.F;p--;)delete f[u][a[p]];return f()};t.exports=Object.create||function(h,d){var p;return h!==null?(l[u]=i(h),p=new l,l[u]=null,p[c]=h):p=f(),d===void 0?p:s(p,d)}},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),h=f.length,d=0;h>d;)i.f(c,u=f[d++],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(h,d){if(h=a(h),d=c(d,!0),u)try{return f(h,d)}catch{}if(l(h,d))return s(!i.f.call(h,d),h[d])}},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,h=s(l),d=0,p=[];for(f in h)f!=c&&i(h,f)&&p.push(f);for(;u.length>d;)i(h,f=u[d++])&&(~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,h){return a(f,h),l?f.__proto__=h:u(f,h),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,h=String(s(c)),d=i(l),p=h.length;return d<0||d>=p?a?"":void 0:(u=h.charCodeAt(d),u<55296||u>56319||d+1===p||(f=h.charCodeAt(d+1))<56320||f>57343?a?h.charAt(d):u:a?h.slice(d,d+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),h=e(23),d=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!(!d(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)}),h(h.G+h.W+h.F*!F,{Promise:w}),e(18)(w,b),e(59)(b),a=e(6)[b],h(h.S+h.F*!F,b,{reject:function(m){var y=G(this),E=y.reject;return E(m),y.promise}}),h(h.S+h.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}}),h(h.S+h.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],h=i[f],d=h&&h.prototype;d&&!d[c]&&s(d,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,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
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),hr=(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 hr(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,ht(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=ht(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=ht(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}}}),ht=(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 he=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.61"}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,he.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 h=f.version;if(!h||!Mn(n,h)){l(!1);return}s(),console.log(v.green(`\u2705 New version available: ${n} \u2192 ${h}`));let d=Mr();if(d){console.log(v.yellow(` \u26A0\uFE0F ${d} 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...
@@ -30,7 +30,7 @@ if %ERRORLEVEL% EQU 0 (
30
30
  echo \u{1F504} Starting with current version...
31
31
  ${Y} ${g} --skip-update
32
32
  )
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
33
+ `;k=je.default.join(xt.default.tmpdir(),`${Y}-update.bat`),(0,he.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
@@ -55,12 +55,12 @@ else
55
55
  echo "\u{1F504} Starting with current version..."
56
56
  ${Y} ${g} --skip-update
57
57
  fi
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+`
58
+ `;k=je.default.join(xt.default.tmpdir(),`${Y}-update.sh`),(0,he.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),de=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=de.default.join(me.default.homedir(),".9remote","bin"),Nn="cloudflared",kt=me.default.platform()==="win32",Nr=kt?`${Nn}.exe`:Nn,Se=de.default.join(Ue,Nr),ze=de.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?de.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(de.default.join(me.default.tmpdir(),"9remote-quick-")),e=de.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,h=setTimeout(()=>{u||(u=!0,s(),l(new Error("Quick tunnel timed out after 90s")))},9e4),d=p=>{let g=p.toString(),T=Kr(g);if(T){if(!u){u=!0,f=T,clearTimeout(h),s(),c({child:a,tunnelUrl:T});return}T!==f&&(f=T,n?.(T))}};a.stdout.on("data",d),a.stderr.on("data",d),a.on("error",p=>{u||(u=!0,clearTimeout(h),s(),l(p))}),a.on("exit",p=>{if(s(),!u){u=!0,clearTimeout(h),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 d=typeof o=="function"?o():o;d&&process.stdout.write(d+`
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 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(`
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",h),process.stdin.pause()}},h=(d,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",h),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.61"}function Jr(r,n="\u{1F4F1} Scan QR to connect:"){console.log(te(`
64
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
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)
@@ -70,14 +70,14 @@ QR expires in 30 minutes (one-time use)
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
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(`
73
+ \u{1F4A5} Server crashed (code: ${u}, signal: ${f})`));let h=Date.now();for(t.push(h);t.length>0&&t[0]<h-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
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
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
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(`
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),h=null,d=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),h?.())}else p==="permissions"&&h?.()});Nt({getProcess:t.getProcess,shutdown:()=>{t.shutdown(),d()}},i,n.key),await to(n,s,()=>f,p=>{f=p},p=>{h=p},()=>{t.shutdown(),lt(B),d()})}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}`,h=process.platform==="darwin"?"open":process.platform==="win32"?"start":"xdg-open";(0,ke.spawn)(h,[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 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(`
80
+ `))}else if(u===1){let f=await De(r.key,U);if(f){let h=`${U}/login?k=${f.tempKey}`;o(await at(f.tempKey,r.key,h)),await D({oneTimeKey:f.tempKey,oneTimeKeyExpiresAt:f.expiresAt,qrUrl:h})}}else if(u===2){if(await Gn(v.yellow("\u26A0\uFE0F Replace current key and disconnect all sessions? Continue?"))){let h=await be(),{key:d}=_e(h);r=xe(h,d,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 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);
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:l}=_e(r);n=xe(r,l,"Default")}let t=process.argv.find(l=>l.startsWith("--theme=")),o=t?t.split("=")[1]:null,e=await Bt(),i=e?{getProcess:()=>null,shutdown:()=>{}}:$t(null,null);e||await new Promise(l=>setTimeout(l,2e3)),console.log(v.green(`
83
+ \u{1F310} UI ready at http://localhost:${B}`));let s=null,a=()=>s,c=l=>{s=l};await D({permanentKey:n.key,step:0,theme:o}),Nt(i,null,n.key),oo(a,c,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);
@@ -0,0 +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:var(--bg-main);color:var(--text-main);-webkit-font-smoothing:antialiased;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:background-color .3s ease,color .3s ease}input,textarea{accent-color:var(--brand-500)}button{-webkit-user-select:none;-moz-user-select:none;user-select:none}.dot-grid-bg{background:var(--bg-main);transition:background-color .3s ease}.dark-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-brand);transition:background-color .3s ease,border-color .3s ease}.glass-card{background:var(--glass-bg);border:1px solid var(--glass-border);border-radius:var(--radius-brand);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);transition:all .3s ease}.glass-btn{background:var(--glass-bg);border:1px solid var(--glass-border);border-radius:8px;transition:all .2s ease}.glass-btn:hover{background:var(--glass-hover);border-color:var(--border)}.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}.visible{visibility:visible}.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}.hidden{display:none}.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-96{width:24rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-2xl{max-width:42rem}.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}.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))}.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}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.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))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.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;--radius-brand: 12px;--radius-brand-lg: 16px}:root[data-theme=light]{--bg-main: #FBF9F6;--bg-alt: #F5F1ED;--surface: #FFFFFF;--sidebar: rgba(246, 246, 246, .8);--border: rgba(0, 0, 0, .1);--text-main: #383733;--text-muted: #75736E;--glass-bg: rgba(255, 255, 255, .6);--glass-border: rgba(0, 0, 0, .08);--glass-hover: rgba(255, 255, 255, .8);--header-shadow: 0 1px 3px rgba(0, 0, 0, .06)}:root[data-theme=dark]{--bg-main: #191918;--bg-alt: #1F1F1E;--surface: #242423;--sidebar: rgba(30, 30, 30, .8);--border: rgba(255, 255, 255, .1);--text-main: #ECEBE8;--text-muted: #9E9D99;--glass-bg: rgba(36, 36, 35, .6);--glass-border: rgba(255, 255, 255, .1);--glass-hover: rgba(36, 36, 35, .8);--header-shadow: 0 1px 3px rgba(0, 0, 0, .3)}@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\:opacity-80:hover{opacity:.8}@media(min-width:768px){.md\:flex{display:flex}.md\:hidden{display:none}.md\:max-w-6xl{max-width:72rem}.md\:flex-row{flex-direction:row}.md\:flex-col{flex-direction:column}}
@@ -0,0 +1,8 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.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,j,et,Vt,Jt,Yt,Ve,He,ze,se={},le=[],hn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,de=Array.isArray;function F(t,e){for(var o in e)t[o]=e[o];return t}function Je(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function mn(t,e,o){var i,n,r,s={};for(r in e)r=="key"?i=e[r]:r=="ref"?n=e[r]:s[r]=e[r];if(arguments.length>2&&(s.children=arguments.length>3?ue.call(arguments,2):o),typeof t=="function"&&t.defaultProps!=null)for(r in t.defaultProps)s[r]===void 0&&(s[r]=t.defaultProps[r]);return re(t,s,i,n,null)}function re(t,e,o,i,n){var r={type:t,props:e,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 K(t){return t.children}function oe(t,e){this.props=t,this.context=e}function G(t,e){if(e==null)return t.__?G(t.__,t.__i+1):null;for(var o;e<t.__k.length;e++)if((o=t.__k[e])!=null&&o.__e!=null)return o.__e;return typeof t.type=="function"?G(t):null}function _n(t){if(t.__P&&t.__d){var e=t.__v,o=e.__e,i=[],n=[],r=F({},e);r.__v=e.__v+1,B.vnode&&B.vnode(r),Ye(t.__P,r,e,t.__n,t.__P.namespaceURI,32&e.__u?[o]:null,i,o??G(e),!!(32&e.__u),n),r.__v=e.__v,r.__.__k[r.__i]=r,Xt(i,r,n),e.__e=e.__=null,r.__e!=o&&Gt(r)}}function Gt(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),Gt(t)}function tt(t){(!t.__d&&(t.__d=!0)&&j.push(t)&&!ae.__r++||et!=B.debounceRendering)&&((et=B.debounceRendering)||Vt)(ae)}function ae(){try{for(var t,e=1;j.length;)j.length>e&&j.sort(Jt),t=j.shift(),e=j.length,_n(t)}finally{j.length=ae.__r=0}}function Qt(t,e,o,i,n,r,s,l,a,d,h){var c,_,f,v,C,P,y,b=i&&i.__k||le,k=e.length;for(a=gn(o,e,b,a,k),c=0;c<k;c++)(f=o.__k[c])!=null&&(_=f.__i!=-1&&b[f.__i]||se,f.__i=c,P=Ye(t,f,_,n,r,s,l,a,d,h),v=f.__e,f.ref&&_.ref!=f.ref&&(_.ref&&Ge(_.ref,null,f),h.push(f.ref,f.__c||v,f)),C==null&&v!=null&&(C=v),(y=!!(4&f.__u))||_.__k===f.__k?a=Wt(f,a,t,y):typeof f.type=="function"&&P!==void 0?a=P:v&&(a=v.nextSibling),f.__u&=-7);return o.__e=C,a}function gn(t,e,o,i,n){var r,s,l,a,d,h=o.length,c=h,_=0;for(t.__k=new Array(n),r=0;r<n;r++)(s=e[r])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=t.__k[r]=re(null,s,null,null,null):de(s)?s=t.__k[r]=re(K,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=t.__k[r]=re(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):t.__k[r]=s,a=r+_,s.__=t,s.__b=t.__b+1,l=null,(d=s.__i=pn(s,o,a,c))!=-1&&(c--,(l=o[d])&&(l.__u|=2)),l==null||l.__v==null?(d==-1&&(n>h?_--:n<h&&_++),typeof s.type!="function"&&(s.__u|=4)):d!=a&&(d==a-1?_--:d==a+1?_++:(d>a?_--:_++,s.__u|=4))):t.__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)),$t(l,l));return i}function Wt(t,e,o,i){var n,r;if(typeof t.type=="function"){for(n=t.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=t,e=Wt(n[r],e,o,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=G(t)),o.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function pn(t,e,o,i){var n,r,s,l=t.key,a=t.type,d=e[o],h=d!=null&&(2&d.__u)==0;if(d===null&&l==null||h&&l==d.key&&a==d.type)return o;if(i>(h?1:0)){for(n=o-1,r=o+1;n>=0||r<e.length;)if((d=e[s=n>=0?n--:r++])!=null&&(2&d.__u)==0&&l==d.key&&a==d.type)return s}return-1}function nt(t,e,o){e[0]=="-"?t.setProperty(e,o??""):t[e]=o==null?"":typeof o!="number"||hn.test(e)?o:o+"px"}function ee(t,e,o,i,n){var r,s;e:if(e=="style")if(typeof o=="string")t.style.cssText=o;else{if(typeof i=="string"&&(t.style.cssText=i=""),i)for(e in i)o&&e in o||nt(t.style,e,"");if(o)for(e in o)i&&o[e]==i[e]||nt(t.style,e,o[e])}else if(e[0]=="o"&&e[1]=="n")r=e!=(e=e.replace(Yt,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=o,o?i?o.u=i.u:(o.u=Ve,t.addEventListener(e,r?ze:He,r)):t.removeEventListener(e,r?ze:He,r);else{if(n=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=o??"";break e}catch{}typeof o=="function"||(o==null||o===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&o==1?"":o))}}function rt(t){return function(e){if(this.l){var o=this.l[e.type+t];if(e.t==null)e.t=Ve++;else if(e.t<o.u)return;return o(B.event?B.event(e):e)}}}function Ye(t,e,o,i,n,r,s,l,a,d){var h,c,_,f,v,C,P,y,b,k,N,A,x,p,g,m=e.type;if(e.constructor!==void 0)return null;128&o.__u&&(a=!!(32&o.__u),r=[l=e.__e=o.__e]),(h=B.__b)&&h(e);e:if(typeof m=="function")try{if(y=e.props,b=m.prototype&&m.prototype.render,k=(h=m.contextType)&&i[h.__c],N=h?k?k.props.value:h.__:i,o.__c?P=(c=e.__c=o.__c).__=c.__E:(b?e.__c=c=new m(y,N):(e.__c=c=new oe(y,N),c.constructor=m,c.render=vn),k&&k.sub(c),c.state||(c.state={}),c.__n=i,_=c.__d=!0,c.__h=[],c._sb=[]),b&&c.__s==null&&(c.__s=c.state),b&&m.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=F({},c.__s)),F(c.__s,m.getDerivedStateFromProps(y,c.__s))),f=c.props,v=c.state,c.__v=e,_)b&&m.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),b&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(b&&m.getDerivedStateFromProps==null&&y!==f&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(y,N),e.__v==o.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(y,c.__s,N)===!1){e.__v!=o.__v&&(c.props=y,c.state=c.__s,c.__d=!1),e.__e=o.__e,e.__k=o.__k,e.__k.some(function(E){E&&(E.__=e)}),le.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&s.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(y,c.__s,N),b&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(f,v,C)})}if(c.context=N,c.props=y,c.__P=t,c.__e=!1,A=B.__r,x=0,b)c.state=c.__s,c.__d=!1,A&&A(e),h=c.render(c.props,c.state,c.context),le.push.apply(c.__h,c._sb),c._sb=[];else do c.__d=!1,A&&A(e),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())),b&&!_&&c.getSnapshotBeforeUpdate!=null&&(C=c.getSnapshotBeforeUpdate(f,v)),p=h!=null&&h.type===K&&h.key==null?Zt(h.props.children):h,l=Qt(t,de(p)?p:[p],e,o,i,n,r,s,l,a,d),c.base=e.__e,e.__u&=-161,c.__h.length&&s.push(c),P&&(c.__E=c.__=null)}catch(E){if(e.__v=null,a||r!=null)if(E.then){for(e.__u|=a?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;r[r.indexOf(l)]=null,e.__e=l}else{for(g=r.length;g--;)Je(r[g]);je(e)}else e.__e=o.__e,e.__k=o.__k,E.then||je(e);B.__e(E,e,o)}else r==null&&e.__v==o.__v?(e.__k=o.__k,e.__e=o.__e):l=e.__e=yn(o.__e,e,o,i,n,r,s,a,d);return(h=B.diffed)&&h(e),128&e.__u?void 0:l}function je(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(je))}function Xt(t,e,o){for(var i=0;i<o.length;i++)Ge(o[i],o[++i],o[++i]);B.__c&&B.__c(e,t),t.some(function(n){try{t=n.__h,n.__h=[],t.some(function(r){r.call(n)})}catch(r){B.__e(r,n.__v)}})}function Zt(t){return typeof t!="object"||t==null||t.__b>0?t:de(t)?t.map(Zt):F({},t)}function yn(t,e,o,i,n,r,s,l,a){var d,h,c,_,f,v,C,P=o.props||se,y=e.props,b=e.type;if(b=="svg"?n="http://www.w3.org/2000/svg":b=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),r!=null){for(d=0;d<r.length;d++)if((f=r[d])&&"setAttribute"in f==!!b&&(b?f.localName==b:f.nodeType==3)){t=f,r[d]=null;break}}if(t==null){if(b==null)return document.createTextNode(y);t=document.createElementNS(n,b,y.is&&y),l&&(B.__m&&B.__m(e,r),l=!1),r=null}if(b==null)P===y||l&&t.data==y||(t.data=y);else{if(r=r&&ue.call(t.childNodes),!l&&r!=null)for(P={},d=0;d<t.attributes.length;d++)P[(f=t.attributes[d]).name]=f.value;for(d in P)f=P[d],d=="dangerouslySetInnerHTML"?c=f:d=="children"||d in y||d=="value"&&"defaultValue"in y||d=="checked"&&"defaultChecked"in y||ee(t,d,null,f,n);for(d in y)f=y[d],d=="children"?_=f:d=="dangerouslySetInnerHTML"?h=f:d=="value"?v=f:d=="checked"?C=f:l&&typeof f!="function"||P[d]===f||ee(t,d,f,P[d],n);if(h)l||c&&(h.__html==c.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),Qt(e.type=="template"?t.content:t,de(_)?_:[_],e,o,i,b=="foreignObject"?"http://www.w3.org/1999/xhtml":n,r,s,r?r[0]:o.__k&&G(o,0),l,a),r!=null)for(d=r.length;d--;)Je(r[d]);l||(d="value",b=="progress"&&v==null?t.removeAttribute("value"):v!=null&&(v!==t[d]||b=="progress"&&!v||b=="option"&&v!=P[d])&&ee(t,d,v,P[d],n),d="checked",C!=null&&C!=t[d]&&ee(t,d,C,P[d],n))}return t}function Ge(t,e,o){try{if(typeof t=="function"){var i=typeof t.__u=="function";i&&t.__u(),i&&e==null||(t.__u=t(e))}else t.current=e}catch(n){B.__e(n,o)}}function $t(t,e,o){var i,n;if(B.unmount&&B.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Ge(i,null,e)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(r){B.__e(r,e)}i.base=i.__P=null}if(i=t.__k)for(n=0;n<i.length;n++)i[n]&&$t(i[n],e,o||typeof t.type!="function");o||Je(t.__e),t.__c=t.__=t.__e=void 0}function vn(t,e,o){return this.constructor(t,o)}function bn(t,e,o){var i,n,r,s;e==document&&(e=document.documentElement),B.__&&B.__(t,e),n=(i=!1)?null:e.__k,r=[],s=[],Ye(e,t=e.__k=mn(K,null,[t]),n||se,se,e.namespaceURI,n?null:e.firstChild?ue.call(e.childNodes):null,r,n?n.__e:e.firstChild,i,s),Xt(r,t,s)}ue=le.slice,B={__e:function(t,e,o,i){for(var n,r,s;e=e.__;)if((n=e.__c)&&!n.__)try{if((r=n.constructor)&&r.getDerivedStateFromError!=null&&(n.setState(r.getDerivedStateFromError(t)),s=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(t,i||{}),s=n.__d),s)return n.__E=n}catch(l){t=l}throw t}},Ot=0,oe.prototype.setState=function(t,e){var o;o=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=F({},this.state),typeof t=="function"&&(t=t(F({},o),this.props)),t&&F(o,t),t!=null&&this.__v&&(e&&this._sb.push(e),tt(this))},oe.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),tt(this))},oe.prototype.render=K,j=[],Vt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Jt=function(t,e){return t.__v.__b-e.__v.__b},ae.__r=0,Yt=/(PointerCapture)$|Capture$/i,Ve=0,He=rt(!1),ze=rt(!0);var wn=0;function u(t,e,o,i,n,r){e||(e={});var s,l,a=e;if("ref"in a)for(l in a={},e)l=="ref"?s=e[l]:a[l]=e[l];var d={type:t,props:a,key:o,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--wn,__i:-1,__u:0,__source:n,__self:r};if(typeof t=="function"&&(s=t.defaultProps))for(l in s)a[l]===void 0&&(a[l]=s[l]);return B.vnode&&B.vnode(d),d}var X,I,ge,ot,ce=0,en=[],M=B,it=M.__b,st=M.__r,lt=M.diffed,at=M.__c,ct=M.unmount,ut=M.__;function Qe(t,e){M.__h&&M.__h(I,t,ce||e),ce=0;var o=I.__H||(I.__H={__:[],__h:[]});return t>=o.__.length&&o.__.push({}),o.__[t]}function L(t){return ce=1,xn(rn,t)}function xn(t,e,o){var i=Qe(X++,2);if(i.t=t,!i.__c&&(i.__=[rn(void 0,e),function(l){var a=i.__N?i.__N[0]:i.__[0],d=i.t(a,l);a!==d&&(i.__N=[d,i.__[1]],i.__c.setState({}))}],i.__c=I,!I.__f)){var n=function(l,a,d){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,d);var c=i.__c.props!==l;return h.some(function(_){if(_.__N){var f=_.__[0];_.__=_.__N,_.__N=void 0,f!==_.__[0]&&(c=!0)}}),r&&r.call(this,l,a,d)||c};I.__f=!0;var r=I.shouldComponentUpdate,s=I.componentWillUpdate;I.componentWillUpdate=function(l,a,d){if(this.__e){var h=r;r=void 0,n(l,a,d),r=h}s&&s.call(this,l,a,d)},I.shouldComponentUpdate=n}return i.__N||i.__}function Z(t,e){var o=Qe(X++,3);!M.__s&&nn(o.__H,e)&&(o.__=t,o.u=e,I.__H.__h.push(o))}function tn(t){return ce=5,Nn(function(){return{current:t}},[])}function Nn(t,e){var o=Qe(X++,7);return nn(o.__H,e)&&(o.__=t(),o.__H=e,o.__h=t),o.__}function Cn(){for(var t;t=en.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(ie),e.__h.some(Ke),e.__h=[]}catch(o){e.__h=[],M.__e(o,t.__v)}}}M.__b=function(t){I=null,it&&it(t)},M.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ut&&ut(t,e)},M.__r=function(t){st&&st(t),X=0;var e=(I=t.__c).__H;e&&(ge===I?(e.__h=[],I.__h=[],e.__.some(function(o){o.__N&&(o.__=o.__N),o.u=o.__N=void 0})):(e.__h.some(ie),e.__h.some(Ke),e.__h=[],X=0)),ge=I},M.diffed=function(t){lt&&lt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(en.push(e)!==1&&ot===M.requestAnimationFrame||((ot=M.requestAnimationFrame)||kn)(Cn)),e.__H.__.some(function(o){o.u&&(o.__H=o.u),o.u=void 0})),ge=I=null},M.__c=function(t,e){e.some(function(o){try{o.__h.some(ie),o.__h=o.__h.filter(function(i){return!i.__||Ke(i)})}catch(i){e.some(function(n){n.__h&&(n.__h=[])}),e=[],M.__e(i,o.__v)}}),at&&at(t,e)},M.unmount=function(t){ct&&ct(t);var e,o=t.__c;o&&o.__H&&(o.__H.__.some(function(i){try{ie(i)}catch(n){e=n}}),o.__H=void 0,e&&M.__e(e,o.__v))};var dt=typeof requestAnimationFrame=="function";function kn(t){var e,o=function(){clearTimeout(i),dt&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(o,35);dt&&(e=requestAnimationFrame(o))}function ie(t){var e=I,o=t.__c;typeof o=="function"&&(t.__c=void 0,o()),I=e}function Ke(t){var e=I;t.__c=t.__(),I=e}function nn(t,e){return!t||t.length!==e.length||e.some(function(o,i){return o!==t[i]})}function rn(t,e){return typeof e=="function"?e(t):e}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 Sn({currentStep:t}){const e=t-1;return u("div",{className:"glass-card p-5 flex flex-col gap-4",children:[u("span",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--text-muted)"},children:"Setting up connection"}),u("div",{className:"flex flex-col gap-3",children:En.map((o,i)=>{const n=i<e,r=i===e;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)":"var(--glass-bg)",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",style:{fontSize:16,color:"var(--text-muted)",opacity:.3},children:o.icon})}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:"text-sm font-medium",style:{color:n?"var(--text-muted)":r?"var(--text-main)":"var(--text-muted)",opacity:n||r?1:.4},children:o.label}),u("p",{className:"text-xs mt-0.5",style:{color:"var(--text-muted)",opacity:r?.7:.4},children:o.desc})]}),n&&u("span",{className:"text-xs flex-shrink-0",style:{color:"var(--text-muted)"},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 Tn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Y={},pe,ft;function Pn(){return ft||(ft=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 t;const e=[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 e[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.');t=i},z.isKanjiModeEnabled=function(){return typeof t<"u"},z.toSJIS=function(i){return t(i)},z}var ve={},mt;function We(){return mt||(mt=1,(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+o)}}t.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},t.from=function(i,n){if(t.isValid(i))return i;try{return e(i)}catch{return n}}})(ve)),ve}var be,_t;function Rn(){if(_t)return be;_t=1;function t(){this.buffer=[],this.length=0}return t.prototype={get:function(e){const o=Math.floor(e/8);return(this.buffer[o]>>>7-e%8&1)===1},put:function(e,o){for(let i=0;i<o;i++)this.putBit((e>>>o-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const o=Math.floor(this.length/8);this.buffer.length<=o&&this.buffer.push(0),e&&(this.buffer[o]|=128>>>this.length%8),this.length++}},be=t,be}var we,gt;function An(){if(gt)return we;gt=1;function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return t.prototype.set=function(e,o,i,n){const r=e*this.size+o;this.data[r]=i,n&&(this.reservedBit[r]=!0)},t.prototype.get=function(e,o){return this.data[e*this.size+o]},t.prototype.xor=function(e,o,i){this.data[e*this.size+o]^=i},t.prototype.isReserved=function(e,o){return this.reservedBit[e*this.size+o]},we=t,we}var xe={},pt;function Bn(){return pt||(pt=1,(function(t){const e=O().getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];const n=Math.floor(i/7)+2,r=e(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()},t.getPositions=function(i){const n=[],r=t.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}})(xe)),xe}var Ne={},yt;function In(){if(yt)return Ne;yt=1;const t=O().getSymbolSize,e=7;return Ne.getPositions=function(i){const n=t(i);return[[0,0],[n-e,0],[0,n-e]]},Ne}var Ce={},vt;function Mn(){return vt||(vt=1,(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(n){const r=n.size;let s=0,l=0,a=0,d=null,h=null;for(let c=0;c<r;c++){l=a=0,d=h=null;for(let _=0;_<r;_++){let f=n.get(c,_);f===d?l++:(l>=5&&(s+=e.N1+(l-5)),d=f,l=1),f=n.get(_,c),f===h?a++:(a>=5&&(s+=e.N1+(a-5)),h=f,a=1)}l>=5&&(s+=e.N1+(l-5)),a>=5&&(s+=e.N1+(a-5))}return s},t.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 d=n.get(l,a)+n.get(l,a+1)+n.get(l+1,a)+n.get(l+1,a+1);(d===4||d===0)&&s++}return s*e.N2},t.getPenaltyN3=function(n){const r=n.size;let s=0,l=0,a=0;for(let d=0;d<r;d++){l=a=0;for(let h=0;h<r;h++)l=l<<1&2047|n.get(d,h),h>=10&&(l===1488||l===93)&&s++,a=a<<1&2047|n.get(h,d),h>=10&&(a===1488||a===93)&&s++}return s*e.N3},t.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)*e.N4};function o(i,n,r){switch(i){case t.Patterns.PATTERN000:return(n+r)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return r%3===0;case t.Patterns.PATTERN011:return(n+r)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2===0;case t.Patterns.PATTERN101:return n*r%2+n*r%3===0;case t.Patterns.PATTERN110:return(n*r%2+n*r%3)%2===0;case t.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}t.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))},t.getBestMask=function(n,r){const s=Object.keys(t.Patterns).length;let l=0,a=1/0;for(let d=0;d<s;d++){r(d),t.applyMask(d,n);const h=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(d,n),h<a&&(a=h,l=d)}return l}})(Ce)),Ce}var te={},bt;function on(){if(bt)return te;bt=1;const t=We(),e=[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 te.getBlocksCount=function(n,r){switch(r){case t.L:return e[(n-1)*4+0];case t.M:return e[(n-1)*4+1];case t.Q:return e[(n-1)*4+2];case t.H:return e[(n-1)*4+3];default:return}},te.getTotalCodewordsCount=function(n,r){switch(r){case t.L:return o[(n-1)*4+0];case t.M:return o[(n-1)*4+1];case t.Q:return o[(n-1)*4+2];case t.H:return o[(n-1)*4+3];default:return}},te}var ke={},W={},wt;function Ln(){if(wt)return W;wt=1;const t=new Uint8Array(512),e=new Uint8Array(256);return(function(){let i=1;for(let n=0;n<255;n++)t[n]=i,e[i]=n,i<<=1,i&256&&(i^=285);for(let n=255;n<512;n++)t[n]=t[n-255]})(),W.log=function(i){if(i<1)throw new Error("log("+i+")");return e[i]},W.exp=function(i){return t[i]},W.mul=function(i,n){return i===0||n===0?0:t[e[i]+e[n]]},W}var xt;function Dn(){return xt||(xt=1,(function(t){const e=Ln();t.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]^=e.mul(i[s],n[l]);return r},t.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]^=e.mul(n[a],s);let l=0;for(;l<r.length&&r[l]===0;)l++;r=r.slice(l)}return r},t.generateECPolynomial=function(i){let n=new Uint8Array([1]);for(let r=0;r<i;r++)n=t.mul(n,new Uint8Array([1,e.exp(r)]));return n}})(ke)),ke}var Ee,Nt;function Un(){if(Nt)return Ee;Nt=1;const t=Dn();function e(o){this.genPoly=void 0,this.degree=o,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(i){this.degree=i,this.genPoly=t.generateECPolynomial(this.degree)},e.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=t.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},Ee=e,Ee}var Se={},Te={},Pe={},Ct;function sn(){return Ct||(Ct=1,Pe.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),Pe}var D={},kt;function ln(){if(kt)return D;kt=1;const t="[0-9]+",e="[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(t,"g"),D.ALPHANUMERIC=new RegExp(e,"g");const n=new RegExp("^"+o+"$"),r=new RegExp("^"+t+"$"),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 Et;function V(){return Et||(Et=1,(function(t){const e=sn(),o=ln();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(r,s){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?r.ccBits[0]:s<27?r.ccBits[1]:r.ccBits[2]},t.getBestModeForData=function(r){return o.testNumeric(r)?t.NUMERIC:o.testAlphanumeric(r)?t.ALPHANUMERIC:o.testKanji(r)?t.KANJI:t.BYTE},t.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},t.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 t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+n)}}t.from=function(r,s){if(t.isValid(r))return r;try{return i(r)}catch{return s}}})(Te)),Te}var St;function qn(){return St||(St=1,(function(t){const e=O(),o=on(),i=We(),n=V(),r=sn(),s=7973,l=e.getBCHDigit(s);function a(_,f,v){for(let C=1;C<=40;C++)if(f<=t.getCapacity(C,v,_))return C}function d(_,f){return n.getCharCountIndicator(_,f)+4}function h(_,f){let v=0;return _.forEach(function(C){const P=d(C.mode,f);v+=P+C.getBitsLength()}),v}function c(_,f){for(let v=1;v<=40;v++)if(h(_,v)<=t.getCapacity(v,f,n.MIXED))return v}t.from=function(f,v){return r.isValid(f)?parseInt(f,10):v},t.getCapacity=function(f,v,C){if(!r.isValid(f))throw new Error("Invalid QR Code version");typeof C>"u"&&(C=n.BYTE);const P=e.getSymbolTotalCodewords(f),y=o.getTotalCodewordsCount(f,v),b=(P-y)*8;if(C===n.MIXED)return b;const k=b-d(C,f);switch(C){case n.NUMERIC:return Math.floor(k/10*3);case n.ALPHANUMERIC:return Math.floor(k/11*2);case n.KANJI:return Math.floor(k/13);case n.BYTE:default:return Math.floor(k/8)}},t.getBestVersionForData=function(f,v){let C;const P=i.from(v,i.M);if(Array.isArray(f)){if(f.length>1)return c(f,P);if(f.length===0)return 1;C=f[0]}else C=f;return a(C.mode,C.getLength(),P)},t.getEncodedBits=function(f){if(!r.isValid(f)||f<7)throw new Error("Invalid QR Code version");let v=f<<12;for(;e.getBCHDigit(v)-l>=0;)v^=s<<e.getBCHDigit(v)-l;return f<<12|v}})(Se)),Se}var Re={},Tt;function Fn(){if(Tt)return Re;Tt=1;const t=O(),e=1335,o=21522,i=t.getBCHDigit(e);return Re.getEncodedBits=function(r,s){const l=r.bit<<3|s;let a=l<<10;for(;t.getBCHDigit(a)-i>=0;)a^=e<<t.getBCHDigit(a)-i;return(l<<10|a)^o},Re}var Ae={},Be,Pt;function Hn(){if(Pt)return Be;Pt=1;const t=V();function e(o){this.mode=t.NUMERIC,this.data=o.toString()}return e.getBitsLength=function(i){return 10*Math.floor(i/3)+(i%3?i%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.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=e,Be}var Ie,Rt;function zn(){if(Rt)return Ie;Rt=1;const t=V(),e=["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=t.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=e.indexOf(this.data[r])*45;s+=e.indexOf(this.data[r+1]),n.put(s,11)}this.data.length%2&&n.put(e.indexOf(this.data[r]),6)},Ie=o,Ie}var Me,At;function jn(){if(At)return Me;At=1;const t=V();function e(o){this.mode=t.BYTE,typeof o=="string"?this.data=new TextEncoder().encode(o):this.data=new Uint8Array(o)}return e.getBitsLength=function(i){return i*8},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(o){for(let i=0,n=this.data.length;i<n;i++)o.put(this.data[i],8)},Me=e,Me}var Le,Bt;function Kn(){if(Bt)return Le;Bt=1;const t=V(),e=O();function o(i){this.mode=t.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=e.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:{}},It;function On(){return It||(It=1,(function(t){var e={single_source_shortest_paths:function(o,i,n){var r={},s={};s[i]=0;var l=e.PriorityQueue.make();l.push(i,0);for(var a,d,h,c,_,f,v,C,P;!l.empty();){a=l.pop(),d=a.value,c=a.cost,_=o[d]||{};for(h in _)_.hasOwnProperty(h)&&(f=_[h],v=c+f,C=s[h],P=typeof s[h]>"u",(P||C>v)&&(s[h]=v,l.push(h,v),r[h]=d))}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=e.single_source_shortest_paths(o,i,n);return e.extract_shortest_path_from_predecessor_list(r,n)},PriorityQueue:{make:function(o){var i=e.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}}};t.exports=e})(De)),De.exports}var Mt;function Vn(){return Mt||(Mt=1,(function(t){const e=V(),o=Hn(),i=zn(),n=jn(),r=Kn(),s=ln(),l=O(),a=On();function d(y){return unescape(encodeURIComponent(y)).length}function h(y,b,k){const N=[];let A;for(;(A=y.exec(k))!==null;)N.push({data:A[0],index:A.index,mode:b,length:A[0].length});return N}function c(y){const b=h(s.NUMERIC,e.NUMERIC,y),k=h(s.ALPHANUMERIC,e.ALPHANUMERIC,y);let N,A;return l.isKanjiModeEnabled()?(N=h(s.BYTE,e.BYTE,y),A=h(s.KANJI,e.KANJI,y)):(N=h(s.BYTE_KANJI,e.BYTE,y),A=[]),b.concat(k,N,A).sort(function(p,g){return p.index-g.index}).map(function(p){return{data:p.data,mode:p.mode,length:p.length}})}function _(y,b){switch(b){case e.NUMERIC:return o.getBitsLength(y);case e.ALPHANUMERIC:return i.getBitsLength(y);case e.KANJI:return r.getBitsLength(y);case e.BYTE:return n.getBitsLength(y)}}function f(y){return y.reduce(function(b,k){const N=b.length-1>=0?b[b.length-1]:null;return N&&N.mode===k.mode?(b[b.length-1].data+=k.data,b):(b.push(k),b)},[])}function v(y){const b=[];for(let k=0;k<y.length;k++){const N=y[k];switch(N.mode){case e.NUMERIC:b.push([N,{data:N.data,mode:e.ALPHANUMERIC,length:N.length},{data:N.data,mode:e.BYTE,length:N.length}]);break;case e.ALPHANUMERIC:b.push([N,{data:N.data,mode:e.BYTE,length:N.length}]);break;case e.KANJI:b.push([N,{data:N.data,mode:e.BYTE,length:d(N.data)}]);break;case e.BYTE:b.push([{data:N.data,mode:e.BYTE,length:d(N.data)}])}}return b}function C(y,b){const k={},N={start:{}};let A=["start"];for(let x=0;x<y.length;x++){const p=y[x],g=[];for(let m=0;m<p.length;m++){const E=p[m],w=""+x+m;g.push(w),k[w]={node:E,lastCount:0},N[w]={};for(let S=0;S<A.length;S++){const T=A[S];k[T]&&k[T].node.mode===E.mode?(N[T][w]=_(k[T].lastCount+E.length,E.mode)-_(k[T].lastCount,E.mode),k[T].lastCount+=E.length):(k[T]&&(k[T].lastCount=E.length),N[T][w]=_(E.length,E.mode)+4+e.getCharCountIndicator(E.mode,b))}}A=g}for(let x=0;x<A.length;x++)N[A[x]].end=0;return{map:N,table:k}}function P(y,b){let k;const N=e.getBestModeForData(y);if(k=e.from(b,N),k!==e.BYTE&&k.bit<N.bit)throw new Error('"'+y+'" cannot be encoded with mode '+e.toString(k)+`.
4
+ Suggested mode is: `+e.toString(N));switch(k===e.KANJI&&!l.isKanjiModeEnabled()&&(k=e.BYTE),k){case e.NUMERIC:return new o(y);case e.ALPHANUMERIC:return new i(y);case e.KANJI:return new r(y);case e.BYTE:return new n(y)}}t.fromArray=function(b){return b.reduce(function(k,N){return typeof N=="string"?k.push(P(N,null)):N.data&&k.push(P(N.data,N.mode)),k},[])},t.fromString=function(b,k){const N=c(b,l.isKanjiModeEnabled()),A=v(N),x=C(A,k),p=a.find_path(x.map,"start","end"),g=[];for(let m=1;m<p.length-1;m++)g.push(x.table[p[m]].node);return t.fromArray(f(g))},t.rawSplit=function(b){return t.fromArray(c(b,l.isKanjiModeEnabled()))}})(Ae)),Ae}var Lt;function Jn(){if(Lt)return ye;Lt=1;const t=O(),e=We(),o=Rn(),i=An(),n=Bn(),r=In(),s=Mn(),l=on(),a=Un(),d=qn(),h=Fn(),c=V(),_=Vn();function f(x,p){const g=x.size,m=r.getPositions(p);for(let E=0;E<m.length;E++){const w=m[E][0],S=m[E][1];for(let T=-1;T<=7;T++)if(!(w+T<=-1||g<=w+T))for(let R=-1;R<=7;R++)S+R<=-1||g<=S+R||(T>=0&&T<=6&&(R===0||R===6)||R>=0&&R<=6&&(T===0||T===6)||T>=2&&T<=4&&R>=2&&R<=4?x.set(w+T,S+R,!0,!0):x.set(w+T,S+R,!1,!0))}}function v(x){const p=x.size;for(let g=8;g<p-8;g++){const m=g%2===0;x.set(g,6,m,!0),x.set(6,g,m,!0)}}function C(x,p){const g=n.getPositions(p);for(let m=0;m<g.length;m++){const E=g[m][0],w=g[m][1];for(let S=-2;S<=2;S++)for(let T=-2;T<=2;T++)S===-2||S===2||T===-2||T===2||S===0&&T===0?x.set(E+S,w+T,!0,!0):x.set(E+S,w+T,!1,!0)}}function P(x,p){const g=x.size,m=d.getEncodedBits(p);let E,w,S;for(let T=0;T<18;T++)E=Math.floor(T/3),w=T%3+g-8-3,S=(m>>T&1)===1,x.set(E,w,S,!0),x.set(w,E,S,!0)}function y(x,p,g){const m=x.size,E=h.getEncodedBits(p,g);let w,S;for(w=0;w<15;w++)S=(E>>w&1)===1,w<6?x.set(w,8,S,!0):w<8?x.set(w+1,8,S,!0):x.set(m-15+w,8,S,!0),w<8?x.set(8,m-w-1,S,!0):w<9?x.set(8,15-w-1+1,S,!0):x.set(8,15-w-1,S,!0);x.set(m-8,8,1,!0)}function b(x,p){const g=x.size;let m=-1,E=g-1,w=7,S=0;for(let T=g-1;T>0;T-=2)for(T===6&&T--;;){for(let R=0;R<2;R++)if(!x.isReserved(E,T-R)){let H=!1;S<p.length&&(H=(p[S]>>>w&1)===1),x.set(E,T-R,H),w--,w===-1&&(S++,w=7)}if(E+=m,E<0||g<=E){E-=m,m=-m;break}}}function k(x,p,g){const m=new o;g.forEach(function(R){m.put(R.mode.bit,4),m.put(R.getLength(),c.getCharCountIndicator(R.mode,x)),R.write(m)});const E=t.getSymbolTotalCodewords(x),w=l.getTotalCodewordsCount(x,p),S=(E-w)*8;for(m.getLengthInBits()+4<=S&&m.put(0,4);m.getLengthInBits()%8!==0;)m.putBit(0);const T=(S-m.getLengthInBits())/8;for(let R=0;R<T;R++)m.put(R%2?17:236,8);return N(m,x,p)}function N(x,p,g){const m=t.getSymbolTotalCodewords(p),E=l.getTotalCodewordsCount(p,g),w=m-E,S=l.getBlocksCount(p,g),T=m%S,R=S-T,H=Math.floor(m/S),Q=Math.floor(w/S),un=Q+1,Xe=H-Q,dn=new a(Xe);let fe=0;const $=new Array(S),Ze=new Array(S);let he=0;const fn=new Uint8Array(x.buffer);for(let J=0;J<S;J++){const _e=J<R?Q:un;$[J]=fn.slice(fe,fe+_e),Ze[J]=dn.encode($[J]),fe+=_e,he=Math.max(he,_e)}const me=new Uint8Array(m);let $e=0,U,q;for(U=0;U<he;U++)for(q=0;q<S;q++)U<$[q].length&&(me[$e++]=$[q][U]);for(U=0;U<Xe;U++)for(q=0;q<S;q++)me[$e++]=Ze[q][U];return me}function A(x,p,g,m){let E;if(Array.isArray(x))E=_.fromArray(x);else if(typeof x=="string"){let H=p;if(!H){const Q=_.rawSplit(x);H=d.getBestVersionForData(Q,g)}E=_.fromString(x,H||40)}else throw new Error("Invalid data");const w=d.getBestVersionForData(E,g);if(!w)throw new Error("The amount of data is too big to be stored in a QR Code");if(!p)p=w;else if(p<w)throw new Error(`
5
+ The chosen QR Code version cannot contain this amount of data.
6
+ Minimum version required to store current data is: `+w+`.
7
+ `);const S=k(p,g,E),T=t.getSymbolSize(p),R=new i(T);return f(R,p),v(R),C(R,p),y(R,g,0),p>=7&&P(R,p),b(R,S),isNaN(m)&&(m=s.getBestMask(R,y.bind(null,R,g))),s.applyMask(m,R),y(R,g,m),{modules:R,version:p,errorCorrectionLevel:g,maskPattern:m,segments:E}}return ye.create=function(p,g){if(typeof p>"u"||p==="")throw new Error("No input text");let m=e.M,E,w;return typeof g<"u"&&(m=e.from(g.errorCorrectionLevel,e.M),E=d.from(g.version),w=s.from(g.maskPattern),g.toSJISFunc&&t.setToSJISFunction(g.toSJISFunc)),A(p,E,m,w)},ye}var Ue={},qe={},Dt;function an(){return Dt||(Dt=1,(function(t){function e(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("")}}t.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:e(i.color.dark||"#000000ff"),light:e(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},t.getScale=function(i,n){return n.width&&n.width>=i+n.margin*2?n.width/(i+n.margin*2):n.scale},t.getImageWidth=function(i,n){const r=t.getScale(i,n);return Math.floor((i+n.margin*2)*r)},t.qrToImageData=function(i,n,r){const s=n.modules.size,l=n.modules.data,a=t.getScale(s,r),d=Math.floor((s+r.margin*2)*a),h=r.margin*a,c=[r.color.light,r.color.dark];for(let _=0;_<d;_++)for(let f=0;f<d;f++){let v=(_*d+f)*4,C=r.color.light;if(_>=h&&f>=h&&_<d-h&&f<d-h){const P=Math.floor((_-h)/a),y=Math.floor((f-h)/a);C=c[l[P*s+y]?1:0]}i[v++]=C.r,i[v++]=C.g,i[v++]=C.b,i[v]=C.a}}})(qe)),qe}var Ut;function Yn(){return Ut||(Ut=1,(function(t){const e=an();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")}}t.render=function(r,s,l){let a=l,d=s;typeof a>"u"&&(!s||!s.getContext)&&(a=s,s=void 0),s||(d=i()),a=e.getOptions(a);const h=e.getImageWidth(r.modules.size,a),c=d.getContext("2d"),_=c.createImageData(h,h);return e.qrToImageData(_.data,r,a),o(c,d,h),c.putImageData(_,0,0),d},t.renderToDataURL=function(r,s,l){let a=l;typeof a>"u"&&(!s||!s.getContext)&&(a=s,s=void 0),a||(a={});const d=t.render(r,s,a),h=a.type||"image/png",c=a.rendererOpts||{};return d.toDataURL(h,c.quality)}})(Ue)),Ue}var Fe={},qt;function Gn(){if(qt)return Fe;qt=1;const t=an();function e(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,d=!1,h=0;for(let c=0;c<n.length;c++){const _=Math.floor(c%r),f=Math.floor(c/r);!_&&!d&&(d=!0),n[c]?(h++,c>0&&_>0&&n[c-1]||(l+=d?o("M",_+s,.5+f+s):o("m",a,0),a=0,d=!1),_+1<r&&n[c+1]||(l+=o("h",h),h=0)):a++}return l}return Fe.render=function(r,s,l){const a=t.getOptions(s),d=r.modules.size,h=r.modules.data,c=d+a.margin*2,_=a.color.light.a?"<path "+e(a.color.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",f="<path "+e(a.color.dark,"stroke")+' d="'+i(h,d,a.margin)+'"/>',v='viewBox="0 0 '+c+" "+c+'"',P='<svg xmlns="http://www.w3.org/2000/svg" '+(a.width?'width="'+a.width+'" height="'+a.width+'" ':"")+v+' shape-rendering="crispEdges">'+_+f+`</svg>
8
+ `;return typeof l=="function"&&l(null,P),P},Fe}var Ft;function Qn(){if(Ft)return Y;Ft=1;const t=Pn(),e=Jn(),o=Yn(),i=Gn();function n(r,s,l,a,d){const h=[].slice.call(arguments,1),c=h.length,_=typeof h[c-1]=="function";if(!_&&!t())throw new Error("Callback required as last argument");if(_){if(c<2)throw new Error("Too few arguments provided");c===2?(d=l,l=s,s=a=void 0):c===3&&(s.getContext&&typeof d>"u"?(d=a,a=void 0):(d=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(f,v){try{const C=e.create(l,a);f(r(C,s,a))}catch(C){v(C)}})}try{const f=e.create(l,a);d(null,r(f,s,a))}catch(f){d(f)}}return Y.create=e.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 Wn=Qn();const Xn=Tn(Wn);function Oe({message:t,confirmLabel:e="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-center",style:{color:"var(--text-main)"},children:t}),u("div",{className:"flex gap-2",children:[u("button",{onClick:n,className:"glass-btn flex-1 py-2 text-sm",style:{color:"var(--text-muted)"},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:e})]})]})})}const Ht="9remote.cc";function Zn(t){if(t<=0)return"Expired";const e=Math.floor(t/1e3),o=Math.floor(e/60),i=e%60;return`${String(o).padStart(2,"0")}:${String(i).padStart(2,"0")}`}function ne({icon:t,onClick:e,title:o,danger:i}){return u("button",{onClick:e,title:o,className:"glass-btn w-7 h-7 flex items-center justify-center flex-shrink-0",style:i?{color:"rgba(255,100,100,0.7)"}:{color:"var(--text-muted)"},children:u("span",{className:"material-symbols-outlined",style:{fontSize:15},children:t})})}function zt({qrUrl:t,oneTimeKey:e,oneTimeKeyExpiresAt:o,permanentKey:i,onGenerateOneTimeKey:n,onRegenerateKey:r}){const s=tn(null),[l,a]=L(null),[d,h]=L(null),[c,_]=L(null);Z(()=>{!t||!s.current||Xn.toCanvas(s.current,t,{width:160,margin:1,color:{dark:"#0f1923",light:"#ffffff"}}).catch(()=>{})},[t]),Z(()=>{if(!o){a(null);return}const v=()=>a(o-Date.now());v();const C=setInterval(v,1e3);return()=>clearInterval(C)},[o]);const f=(v,C)=>{navigator.clipboard.writeText(v).catch(()=>{}),h(C),setTimeout(()=>h(null),2e3)};return u(K,{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:t?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 font-medium",style:{color:"var(--text-muted)"},children:[Ht,"/login"]})]}),u("div",{className:"w-full h-px",style:{background:"var(--border)"}}),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",style:{color:"var(--text-muted)"},children:"One-Time Key"}),u("span",{className:"text-xs",style:{color:"var(--text-muted)"},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 flex-shrink-0",style:{fontSize:16,color:"var(--text-muted)"},children:"timer"}),u("span",{className:"flex-1 font-mono font-bold tracking-[0.18em] text-base truncate",style:{color:e?"var(--brand-500)":"var(--border)"},children:e||"• • • • • •"}),l!==null&&u("span",{className:`text-xs font-mono flex-shrink-0 ${l<=0?"text-red-400":""}`,style:l>0?{color:"var(--text-muted)"}:{},children:Zn(l)}),e&&u(ne,{icon:d==="oneTime"?"check":"content_copy",onClick:()=>f(e,"oneTime"),title:"Copy one-time key"}),u(ne,{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",style:{color:"var(--text-muted)"},children:"Permanent Key"}),u("span",{className:"text-xs",style:{color:"var(--text-muted)"},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 flex-shrink-0",style:{fontSize:16,color:"var(--text-muted)"},children:"key"}),u("span",{className:"flex-1 font-mono text-xs truncate",style:{color:"var(--text-muted)"},children:i||"— not set —"}),i&&u(ne,{icon:d==="permanent"?"check":"content_copy",onClick:()=>f(i,"permanent"),title:"Copy permanent key"}),u(ne,{icon:"autorenew",onClick:()=>_("regen"),title:"Regenerate permanent key",danger:!0})]})]})]})]})}const $n="https://docs.9remote.cc/",cn={screenRecording:{label:"Screen Recording",icon:"screenshot_monitor",desc:"Capture screen content"},accessibility:{label:"Accessibility",icon:"accessibility_new",desc:"Control mouse & keyboard"}};function er({type:t,granted:e,onRequest:o}){const i=cn[t]||{label:t,desc:""};return u("div",{className:"flex items-center gap-3 py-2 border-b last:border-0",style:{borderColor:"var(--border)"},children:[u("span",{className:`material-symbols-outlined flex-shrink-0 ${e?"text-green-400":""}`,style:{fontSize:18,color:e?void 0:"var(--text-muted)"},children:e?"check_circle":"cancel"}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:"text-xs font-medium",style:{color:e?"var(--text-main)":"var(--text-muted)"},children:i.label}),u("p",{className:"text-[10px] leading-4",style:{color:"var(--text-muted)"},children:i.desc})]}),!e&&u("button",{onClick:()=>o(t),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",style:{color:"var(--text-main)"},children:"Remote Terminal"}),u("p",{className:"text-xs",style:{color:"var(--text-muted)"},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:t,onToggle:e,permissions:o,onRequestPermission:i}){const n=Object.entries(cn);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:t?"rgba(255,87,10,0.15)":"var(--glass-bg)"},children:u("span",{className:"material-symbols-outlined",style:{fontSize:20,color:t?"var(--brand-400)":"var(--text-muted)"},children:"desktop_windows"})}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:"text-sm font-semibold",style:{color:"var(--text-main)"},children:"Remote Desktop"}),u("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Control screen, mouse & keyboard"})]}),u("button",{onClick:e,className:"flex-shrink-0 w-11 h-6 rounded-full transition-all relative",style:{background:t?"var(--brand-500)":"var(--border)"},children:u("span",{className:"absolute top-0.5 w-5 h-5 rounded-full bg-white transition-all",style:{left:t?"calc(100% - 22px)":"2px",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"}})})]}),t&&u("div",{className:"flex flex-col border-t pt-2",style:{borderColor:"var(--border)"},children:[u("p",{className:"text-[10px] uppercase tracking-wider mb-1",style:{color:"var(--text-muted)"},children:"System Permissions"}),n.map(([r])=>u(er,{type:r,granted:(o==null?void 0:o[r])??!1,onRequest:i},r))]})]})}function rr({version:t}){return t?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 ",t," 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:t}){const[e,o]=L(!1),i=()=>{o(!0),t()};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 tracking-tight",style:{color:"var(--text-main)"},children:"9Remote"}),u("p",{className:"text-xs leading-5 max-w-[220px]",style:{color:"var(--text-muted)"},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",style:{fontSize:22,color:"var(--brand-400)"},children:n.icon}),u("p",{className:"text-xs font-semibold",style:{color:"var(--text-main)"},children:n.label}),u("p",{className:"text-[10px] text-center leading-4",style:{color:"var(--text-muted)"},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",style:{color:"var(--text-muted)"},children:n.text})]},n.text))}),u("button",{onClick:e?void 0:i,disabled:e,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:e?.7:1},children:e?u(K,{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(K,{children:[u("span",{className:"material-symbols-outlined text-base",children:"play_arrow"}),"Connect"]})})]})}function lr({conn:t}){return u("div",{className:"flex items-center gap-3 py-2 border-b last:border-0",style:{borderColor:"var(--border)"},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 font-medium truncate",style:{color:"var(--text-main)"},children:t.ip||"Unknown"}),u("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:t.connectedAt?new Date(t.connectedAt).toLocaleTimeString():""})]}),u("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:t.type||"ws"})]})}function ar({step:t,tunnelUrl:e,oneTimeKey:o,oneTimeKeyExpiresAt:i,permanentKey:n,qrUrl:r,permissions:s,desktopEnabled:l,updateVersion:a,connections:d=[],version:h="",onRequestPermission:c,onDesktopToggle:_,onStop:f,onStart:v,onGenerateOneTimeKey:C,onRegenerateKey:P,logs:y=[],theme:b,onToggleTheme:k}){const[N,A]=L("connect"),[x,p]=L(!1),g=tn(null),m=t===0,E=t>0&&t<4;return Z(()=>{var w;N==="log"&&((w=g.current)==null||w.scrollIntoView({behavior:"smooth"}))},[y,N]),u("div",{className:"h-full flex flex-col relative overflow-hidden",style:{background:"var(--bg-main)"},children:[u("div",{className:"flex-1 flex flex-col w-full min-h-0 dot-grid-bg overflow-hidden md:max-w-6xl",style:{margin:"0 auto"},children:[u("div",{className:"flex items-center justify-between px-5 py-4",style:{boxShadow:"var(--header-shadow)",backdropFilter:"blur(10px)"},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]",style:{color:"var(--text-muted)"},children:["v",h]})]})]}),u("div",{className:"flex items-center gap-2",children:[u("button",{onClick:k,className:"glass-btn w-7 h-7 flex items-center justify-center",style:{color:"var(--text-muted)"},title:b==="dark"?"Switch to light mode":"Switch to dark mode",children:u("span",{className:"material-symbols-outlined text-sm",children:b==="dark"?"light_mode":"dark_mode"})}),u("button",{onClick:()=>window.open($n,"_blank"),className:"glass-btn w-7 h-7 flex items-center justify-center",style:{color:"var(--text-muted)"},children:u("span",{className:"material-symbols-outlined text-sm",children:"help_outline"})}),!m&&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}),m?u(sr,{onStart:v,connecting:!1}):E?u("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex flex-col gap-4 max-w-2xl mx-auto w-full",children:u(Sn,{currentStep:t})}):u("div",{className:"flex-1 flex flex-col md:flex-row min-h-0",children:[u("div",{className:"hidden md:flex md:flex-col sidebar w-96 flex-shrink-0 overflow-y-auto p-5 gap-4",children:u(zt,{qrUrl:r,oneTimeKey:o,oneTimeKeyExpiresAt:i,permanentKey:n,tunnelUrl:e,onGenerateOneTimeKey:C,onRegenerateKey:P})}),u("div",{className:"flex-1 flex flex-col min-h-0",children:[u("div",{className:"flex px-5 pt-3 gap-3",style:{borderColor:"var(--border)"},children:[{id:"connect",label:"Connection"},{id:"log",label:"Logs"}].map(w=>u("button",{onClick:()=>A(w.id),className:"py-2 text-xs font-medium border-b-2 transition-colors",style:N===w.id?{borderColor:"var(--brand-500)",color:"var(--brand-500)"}:{borderColor:"transparent",color:"var(--text-muted)"},children:w.label},w.id))}),u("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex flex-col gap-4",children:[N==="connect"&&u(K,{children:[u("div",{className:"md:hidden",children:u(zt,{qrUrl:r,oneTimeKey:o,oneTimeKeyExpiresAt:i,permanentKey:n,tunnelUrl:e,onGenerateOneTimeKey:C,onRegenerateKey:P})}),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 font-medium uppercase tracking-wider mb-2",style:{color:"var(--text-muted)"},children:["Clients",d.length>0?` (${d.length})`:""]}),d.length===0?u("p",{className:"text-xs text-center py-3",style:{color:"var(--text-muted)"},children:"No active connections"}):d.map((w,S)=>u(lr,{conn:w},S))]})]}),N==="log"&&u("div",{className:"flex-1 flex flex-col",children:y.length===0?u("p",{className:"text-xs text-center mt-8",style:{color:"var(--text-muted)"},children:"No logs yet"}):u("div",{className:"flex flex-col gap-0.5",children:[y.map((w,S)=>u("p",{className:"text-xs font-mono leading-5 break-all",style:{color:"var(--text-muted)"},children:w},S)),u("div",{ref:g})]})})]})]})]})]}),x&&u(Oe,{message:"Disconnect and stop the tunnel? Remote clients will be disconnected.",confirmLabel:"Disconnect",confirmDanger:!0,onConfirm:()=>{p(!1),f==null||f()},onCancel:()=>p(!1)})]})}const jt={step:0,tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null,permanentKey:"",qrUrl:"",latency:null,uptime:null},cr={screenRecording:!1,accessibility:!1},Kt=200;function ur(){const[t,e]=L(jt),[o,i]=L(cr),[n,r]=L(!1),[s,l]=L([]),[a,d]=L(null),[h,c]=L([]),[_,f]=L(""),[v,C]=L(()=>localStorage.getItem("9remote-theme")||"dark");Z(()=>{document.documentElement.setAttribute("data-theme",v),localStorage.setItem("9remote-theme",v)},[v]);const P=()=>{C(p=>p==="dark"?"light":"dark")};Z(()=>{fetch("/api/version").then(g=>g.json()).then(g=>f(g.version??"")).catch(()=>{}),fetch("/api/ui/state").then(g=>g.json()).then(g=>{e({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),g.theme&&(g.theme==="light"||g.theme==="dark")&&C(g.theme)}).catch(()=>{});const p=new EventSource("/api/ui/events");return p.onmessage=g=>{try{const m=JSON.parse(g.data);m.type==="state"?e({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(E=>{const w=[...E,m.message];return w.length>Kt?w.slice(-Kt):w}):m.type==="updateAvailable"?d(m.version):m.type==="permissions"?(i({screenRecording:m.screenRecording,accessibility:m.accessibility}),m.desktopEnabled!==void 0&&r(m.desktopEnabled)):m.type==="connections"&&c(m.connections??[])}catch{}},p.onerror=()=>{},()=>p.close()},[]);const y=async p=>{await fetch("/api/permissions/request",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:p})}).catch(()=>{})},b=()=>{fetch("/api/ui/stop",{method:"POST"}).catch(()=>{}),e(jt)},k=()=>{fetch("/api/ui/start",{method:"POST"}).catch(()=>{})},N=async()=>{const p=await fetch("/api/key/one-time",{method:"POST"}).catch(()=>null);if(!(p!=null&&p.ok))return;const g=await p.json().catch(()=>null);g!=null&&g.oneTimeKey&&e(m=>({...m,oneTimeKey:g.oneTimeKey,oneTimeKeyExpiresAt:g.expiresAt,qrUrl:g.qrUrl??m.qrUrl}))},A=async()=>{const p=!n;r(p),await fetch("/api/desktop/toggle",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:p})}).catch(()=>{})},x=async()=>{const p=await fetch("/api/key/regenerate",{method:"POST"}).catch(()=>null);if(!(p!=null&&p.ok))return;const g=await p.json().catch(()=>null);g!=null&&g.permanentKey&&e(m=>({...m,permanentKey:g.permanentKey}))};return u(ar,{step:t.step,tunnelUrl:t.tunnelUrl,oneTimeKey:t.oneTimeKey,oneTimeKeyExpiresAt:t.oneTimeKeyExpiresAt,permanentKey:t.permanentKey,qrUrl:t.qrUrl,permissions:o,desktopEnabled:n,updateVersion:a,connections:h,onRequestPermission:y,onDesktopToggle:A,onStop:b,onStart:k,onGenerateOneTimeKey:N,onRegenerateKey:x,logs:s,version:_,theme:v,onToggleTheme:P})}bn(u(ur,{}),document.getElementById("root"));
@@ -1,5 +1,5 @@
1
1
  <!doctype html>
2
- <html lang="en">
2
+ <html lang="en" data-theme="dark">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -9,8 +9,13 @@
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
10
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
11
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" />
12
- <script type="module" crossorigin src="/assets/index-Dh53-SjC.js"></script>
13
- <link rel="stylesheet" crossorigin href="/assets/index-DOMz0Zx8.css">
12
+ <script>
13
+ // Apply saved theme before render to prevent flash
14
+ const savedTheme = localStorage.getItem("9remote-theme") || "dark";
15
+ document.documentElement.setAttribute("data-theme", savedTheme);
16
+ </script>
17
+ <script type="module" crossorigin src="/assets/index-DmCl6A_6.js"></script>
18
+ <link rel="stylesheet" crossorigin href="/assets/index-BfTPkO8b.css">
14
19
  </head>
15
20
  <body>
16
21
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "9remote",
3
- "version": "0.1.60",
3
+ "version": "0.1.61",
4
4
  "type": "module",
5
5
  "description": "Remote terminal access from anywhere",
6
6
  "main": "index.js",
@@ -1 +0,0 @@
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}
@@ -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"]'))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"));