9remote 0.1.58 → 0.1.59
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/dist/cli.cjs
CHANGED
|
@@ -9,7 +9,7 @@ var zn=Object.create;var Dt=Object.defineProperty;var Zn=Object.getOwnPropertyDe
|
|
|
9
9
|
`:`
|
|
10
10
|
`)+t,e=o+1,o=r.indexOf(`
|
|
11
11
|
`,e)}while(o!==-1);return i+=r.slice(e),i}var{stdout:Yt,stderr:Vt}=Ht,lt=Symbol("GENERATOR"),Te=Symbol("STYLER"),Ie=Symbol("IS_EMPTY"),Jt=["ansi","ansi","ansi256","ansi16m"],Ee=Object.create(null),pr=(r,n={})=>{if(n.level&&!(Number.isInteger(n.level)&&n.level>=0&&n.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=Yt?Yt.level:0;r.level=n.level===void 0?t:n.level};var dr=r=>{let n=(...t)=>t.join(" ");return pr(n,r),Object.setPrototypeOf(n,Me.prototype),n};function Me(r){return dr(r)}Object.setPrototypeOf(Me.prototype,Function.prototype);for(let[r,n]of Object.entries(Z))Ee[r]={get(){let t=Qe(this,ft(n.open,n.close,this[Te]),this[Ie]);return Object.defineProperty(this,r,{value:t}),t}};Ee.visible={get(){let r=Qe(this,this[Te],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var ut=(r,n,t,...o)=>r==="rgb"?n==="ansi16m"?Z[t].ansi16m(...o):n==="ansi256"?Z[t].ansi256(Z.rgbToAnsi256(...o)):Z[t].ansi(Z.rgbToAnsi(...o)):r==="hex"?ut("rgb",n,t,...Z.hexToRgb(...o)):Z[t][r](...o),hr=["rgb","hex","ansi256"];for(let r of hr){Ee[r]={get(){let{level:t}=this;return function(...o){let e=ft(ut(r,Jt[t],"color",...o),Z.color.close,this[Te]);return Qe(this,e,this[Ie])}}};let n="bg"+r[0].toUpperCase()+r.slice(1);Ee[n]={get(){let{level:t}=this;return function(...o){let e=ft(ut(r,Jt[t],"bgColor",...o),Z.bgColor.close,this[Te]);return Qe(this,e,this[Ie])}}}}var mr=Object.defineProperties(()=>{},{...Ee,level:{enumerable:!0,get(){return this[lt].level},set(r){this[lt].level=r}}}),ft=(r,n,t)=>{let o,e;return t===void 0?(o=r,e=n):(o=t.openAll+r,e=n+t.closeAll),{open:r,close:n,openAll:o,closeAll:e,parent:t}},Qe=(r,n,t)=>{let o=(...e)=>gr(o,e.length===1?""+e[0]:e.join(" "));return Object.setPrototypeOf(o,mr),o[lt]=r,o[Te]=n,o[Ie]=t,o},gr=(r,n)=>{if(r.level<=0||!n)return r[Ie]?"":n;let t=r[Te];if(t===void 0)return n;let{openAll:o,closeAll:e}=t;if(n.includes("\x1B"))for(;t!==void 0;)n=Wt(n,t.close,t.open),t=t.parent;let i=n.indexOf(`
|
|
12
|
-
`);return i!==-1&&(n=Qt(n,e,o,i)),o+n+e};Object.defineProperties(Me.prototype,Ee);var yr=Me(),go=Me({level:Vt?Vt.level:0});var v=yr;var Mt=M(Tn(),1),ke=require("child_process"),ge=M(require("path"),1),Yn=require("url"),ot=M(require("fs"),1),Vn=M(require("os"),1);var bn=M(En(),1),vt=M(require("crypto"),1),{machineIdSync:kr}=bn.default;async function be(r=null){let n=r||process.env.MACHINE_ID_SALT||"9remote-salt";try{let t=kr();return vt.default.createHash("sha256").update(t+n).digest("hex").substring(0,16)}catch(t){return console.error("Error getting machine ID:",t),vt.default.randomUUID().replace(/-/g,"").substring(0,16)}}var _n=M(require("crypto"),1),Rr=process.env.API_KEY_SECRET||"9remote-api-key-secret";function Ar(){let r="abcdefghijklmnopqrstuvwxyz0123456789",n="";for(let t=0;t<4;t++)n+=r.charAt(Math.floor(Math.random()*r.length));return n}function Or(r,n){return _n.default.createHmac("sha256",Rr).update(r+n).digest("hex").slice(0,6)}function _e(r){let n=r.slice(0,8),t=Ar(),o=Or(n,t);return{key:`sk-${n}-${t}-${o}`,keyId:t}}var q=M(require("fs"),1),Ne=M(require("path"),1),xn=M(require("os"),1),$e=Ne.default.join(xn.default.homedir(),".9remote"),Tt=Ne.default.join($e,"state.json"),Et=Ne.default.join($e,"keys.json"),wt=Ne.default.join($e,"cmd.json");function bt(){q.default.existsSync($e)||q.default.mkdirSync($e,{recursive:!0})}function _t(r){try{bt(),q.default.writeFileSync(Tt,JSON.stringify(r,null,2))}catch(n){console.error("Error saving state:",n)}}function Sn(){try{q.default.existsSync(Tt)&&q.default.unlinkSync(Tt)}catch{}}function Be(){try{return bt(),q.default.existsSync(Et)?JSON.parse(q.default.readFileSync(Et,"utf8")):{machineId:null,key:null,name:"Default",createdAt:null}}catch{return{machineId:null,key:null,name:"Default",createdAt:null}}}function kn(){try{if(!q.default.existsSync(wt))return null;let r=JSON.parse(q.default.readFileSync(wt,"utf8"));return q.default.unlinkSync(wt),r.cmd}catch{return null}}function xe(r,n,t="Default"){try{bt();let o={machineId:r,key:n,name:t,createdAt:new Date().toISOString()};return q.default.writeFileSync(Et,JSON.stringify(o,null,2)),o}catch(o){return console.error("Error saving key:",o),null}}async function De(r,n){try{let t=await fetch(`${n}/api/temp-key/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:r,expiryMinutes:30})});if(!t.ok){let o=await t.json();throw new Error(o.error||"Failed to create temp key")}return await t.json()}catch(t){return console.error("Error creating temp key:",t),null}}var de=require("fs"),Rn=require("url"),An=require("child_process"),je=M(require("path"),1),xt=M(require("os"),1),Pr=je.default.dirname((0,Rn.fileURLToPath)(__importMetaUrl)),Q="9remote",On=`https://registry.npmjs.org/${Q}/latest`,Pn=3e3,Cr=8e3;function Cn(){return"0.1.
|
|
12
|
+
`);return i!==-1&&(n=Qt(n,e,o,i)),o+n+e};Object.defineProperties(Me.prototype,Ee);var yr=Me(),go=Me({level:Vt?Vt.level:0});var v=yr;var Mt=M(Tn(),1),ke=require("child_process"),ge=M(require("path"),1),Yn=require("url"),ot=M(require("fs"),1),Vn=M(require("os"),1);var bn=M(En(),1),vt=M(require("crypto"),1),{machineIdSync:kr}=bn.default;async function be(r=null){let n=r||process.env.MACHINE_ID_SALT||"9remote-salt";try{let t=kr();return vt.default.createHash("sha256").update(t+n).digest("hex").substring(0,16)}catch(t){return console.error("Error getting machine ID:",t),vt.default.randomUUID().replace(/-/g,"").substring(0,16)}}var _n=M(require("crypto"),1),Rr=process.env.API_KEY_SECRET||"9remote-api-key-secret";function Ar(){let r="abcdefghijklmnopqrstuvwxyz0123456789",n="";for(let t=0;t<4;t++)n+=r.charAt(Math.floor(Math.random()*r.length));return n}function Or(r,n){return _n.default.createHmac("sha256",Rr).update(r+n).digest("hex").slice(0,6)}function _e(r){let n=r.slice(0,8),t=Ar(),o=Or(n,t);return{key:`sk-${n}-${t}-${o}`,keyId:t}}var q=M(require("fs"),1),Ne=M(require("path"),1),xn=M(require("os"),1),$e=Ne.default.join(xn.default.homedir(),".9remote"),Tt=Ne.default.join($e,"state.json"),Et=Ne.default.join($e,"keys.json"),wt=Ne.default.join($e,"cmd.json");function bt(){q.default.existsSync($e)||q.default.mkdirSync($e,{recursive:!0})}function _t(r){try{bt(),q.default.writeFileSync(Tt,JSON.stringify(r,null,2))}catch(n){console.error("Error saving state:",n)}}function Sn(){try{q.default.existsSync(Tt)&&q.default.unlinkSync(Tt)}catch{}}function Be(){try{return bt(),q.default.existsSync(Et)?JSON.parse(q.default.readFileSync(Et,"utf8")):{machineId:null,key:null,name:"Default",createdAt:null}}catch{return{machineId:null,key:null,name:"Default",createdAt:null}}}function kn(){try{if(!q.default.existsSync(wt))return null;let r=JSON.parse(q.default.readFileSync(wt,"utf8"));return q.default.unlinkSync(wt),r.cmd}catch{return null}}function xe(r,n,t="Default"){try{bt();let o={machineId:r,key:n,name:t,createdAt:new Date().toISOString()};return q.default.writeFileSync(Et,JSON.stringify(o,null,2)),o}catch(o){return console.error("Error saving key:",o),null}}async function De(r,n){try{let t=await fetch(`${n}/api/temp-key/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:r,expiryMinutes:30})});if(!t.ok){let o=await t.json();throw new Error(o.error||"Failed to create temp key")}return await t.json()}catch(t){return console.error("Error creating temp key:",t),null}}var de=require("fs"),Rn=require("url"),An=require("child_process"),je=M(require("path"),1),xt=M(require("os"),1),Pr=je.default.dirname((0,Rn.fileURLToPath)(__importMetaUrl)),Q="9remote",On=`https://registry.npmjs.org/${Q}/latest`,Pn=3e3,Cr=8e3;function Cn(){return"0.1.59"}function In(r,n){let t=r.split(".").map(Number),o=n.split(".").map(Number);for(let e=0;e<3;e++){if(o[e]>t[e])return!0;if(o[e]<t[e])return!1}return!1}function Ir(){return process.env.CODESPACES==="true"||process.env.GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN?"GitHub Codespaces":(0,de.existsSync)("/.dockerenv")?"Docker":null}async function Mn(){try{let r=Cn();if(!r)return null;let n=await fetch(On,{signal:AbortSignal.timeout(Pn)});if(!n.ok)return null;let{version:t}=await n.json();return t&&In(r,t)?{current:r,latest:t}:null}catch{return null}}async function Ln(r=!1){if(r)return!1;let n=Cn();if(!n)return!1;let t=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],o=0,e=null,i=a=>{process.stdout.isTTY&&(process.stdout.write(`\r${t[0]} ${a}`),e=setInterval(()=>{process.stdout.write(`\r${t[o++%t.length]} ${a}`)},80))},s=()=>{e&&(clearInterval(e),e=null),process.stdout.isTTY&&process.stdout.write("\r\x1B[K")};return new Promise(a=>{let c=!1,l=f=>{c||(c=!0,s(),a(f))},u=setTimeout(()=>l(!1),Cr);i("Checking for updates..."),fetch(On,{signal:AbortSignal.timeout(Pn)}).then(f=>f.json()).then(f=>{if(c)return;clearTimeout(u);let d=f.version;if(!d||!In(n,d)){l(!1);return}s(),console.log(v.green(`\u2705 New version available: ${n} \u2192 ${d}`));let h=Ir();if(h){console.log(v.yellow(` \u26A0\uFE0F ${h} detected - manual update required`)),console.log(v.gray(` Run: npm install -g ${Q}@latest
|
|
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...
|
|
@@ -60,7 +60,7 @@ fi
|
|
|
60
60
|
`),process.stdout.write(`${S.dim}${r}${S.reset}
|
|
61
61
|
|
|
62
62
|
`),n.forEach((p,g)=>{let T=g===a?l?">":"\u2605":l?" ":"\u2606";console.log(g===a?` \x1B[7m${S.bold}${T} ${p.label}${S.reset}`:` ${T} ${p.label}`)})},f=()=>{if(c){if(c=!1,process.stdin.isTTY)try{process.stdin.setRawMode(!1)}catch{}process.stdin.removeListener("keypress",d),process.stdin.pause()}},d=(h,p)=>{!c||!p||(p.name==="up"?(a=(a-1+n.length)%n.length,u()):p.name==="down"?(a=(a+1)%n.length,u()):p.name==="return"?(f(),s(a)):p.name==="escape"?(f(),s(-1)):p.ctrl&&p.name==="c"&&(f(),i&&i(),process.exit(0)))};if(process.stdin.removeAllListeners("keypress"),Pt.default.emitKeypressEvents(process.stdin),process.stdin.isTTY)try{process.stdin.setRawMode(!0)}catch{s(-1);return}process.stdin.on("keypress",d),process.stdin.resume(),u(),e&&e(u)})}function Kn(r){return new Promise(n=>{if(process.stdin.isTTY)try{process.stdin.setRawMode(!1)}catch{}process.stdin.removeAllListeners("keypress");let t=Pt.default.createInterface({input:process.stdin,output:process.stdout});t.question(`${r} (y/N): `,o=>{t.close(),n(o.trim().toLowerCase()==="y")})})}function Gn(r,n){let t=null,o=!1,e=()=>{o||(t=Un.default.get(`http://localhost:${r}/api/ui/events`,i=>{let s="";i.on("data",a=>{s+=a.toString();let c=s.split(`
|
|
63
|
-
`);s=c.pop();let l="";for(let u of c)if(u.startsWith("data: "))l=u.slice(6);else if(u===""&&l){try{let f=JSON.parse(l);n(f.type,f)}catch{}l=""}}),i.on("end",()=>{o||setTimeout(e,2e3)})}),t.on("error",()=>{o||setTimeout(e,2e3)}))};return e(),()=>{o=!0,t?.destroy()}}var Qr=process.argv.includes("--skip-update"),st=ge.default.dirname((0,Yn.fileURLToPath)(__importMetaUrl)),qo=ge.default.resolve(st,"../.."),Yr=ge.default.resolve(st,"../dist/server.cjs"),Hn=ge.default.resolve(st,"../index.js"),U="https://9remote.cc",B=2208,It=10,Wn=6e4,te=v.rgb(230,138,110),Jn=v.rgb(200,120,95);function Lt(){return"0.1.
|
|
63
|
+
`);s=c.pop();let l="";for(let u of c)if(u.startsWith("data: "))l=u.slice(6);else if(u===""&&l){try{let f=JSON.parse(l);n(f.type,f)}catch{}l=""}}),i.on("end",()=>{o||setTimeout(e,2e3)})}),t.on("error",()=>{o||setTimeout(e,2e3)}))};return e(),()=>{o=!0,t?.destroy()}}var Qr=process.argv.includes("--skip-update"),st=ge.default.dirname((0,Yn.fileURLToPath)(__importMetaUrl)),qo=ge.default.resolve(st,"../.."),Yr=ge.default.resolve(st,"../dist/server.cjs"),Hn=ge.default.resolve(st,"../index.js"),U="https://9remote.cc",B=2208,It=10,Wn=6e4,te=v.rgb(230,138,110),Jn=v.rgb(200,120,95);function Lt(){return"0.1.59"}function Vr(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 Jr(r){return new Promise(n=>{Mt.default.generate(r,{small:!0,type:"terminal",margin:0},t=>{n(Jn("\u{1F4F1} Scan QR to connect:")+`
|
|
65
65
|
`+t.trim())})})}async function qn(r,n){let t=await De(r,U);if(!t){console.log(v.red("\u274C Failed to create temp key"));return}let o=`${U}/login?k=${t.tempKey}`,e=Math.min(44,process.stdout.columns||55);D({step:4,tunnelUrl:n,oneTimeKey:t.tempKey,oneTimeKeyExpiresAt:t.expiresAt,permanentKey:r,qrUrl:o,workerUrl:U}),Vr(o),console.log(v.gray(`
|
|
66
66
|
QR will expire in 30 minutes (one-time use)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap";@import"https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap";@import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{box-sizing:border-box;margin:0;padding:0}html,body,#root{height:100%;width:100%;overflow:hidden}body{font-family:Inter,sans-serif;background-color:#333;color:#fff;-webkit-font-smoothing:antialiased;-webkit-user-select:none;-moz-user-select:none;user-select:none}input,textarea{accent-color:var(--brand-500)}button{-webkit-user-select:none;-moz-user-select:none;user-select:none}.dot-grid-bg{background-color:var(--dark-800);background-image:radial-gradient(circle at 15% 20%,rgba(255,87,10,.2) 0%,transparent 45%),radial-gradient(circle at 85% 80%,rgba(255,87,10,.12) 0%,transparent 45%),linear-gradient(rgba(255,255,255,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.04) 1px,transparent 1px);background-size:100% 100%,100% 100%,40px 40px,40px 40px}.dark-card,.glass-card{background:var(--dark-600);border:1px solid var(--dark-400);border-radius:var(--radius-brand)}.glass-btn{background:#ffffff0f;border:1px solid rgba(255,255,255,.1);border-radius:8px;transition:all .2s ease}.glass-btn:hover{background:#ffffff1a;border-color:#ffffff2e}.btn-primary{background:var(--brand-500);border-radius:var(--radius-brand);color:#fff;font-weight:600;transition:all .2s ease;box-shadow:0 4px 16px #ff570a33}.btn-primary:hover{background:var(--brand-600);transform:scale(1.02)}.btn-primary:disabled{background:#ff570a4d;cursor:not-allowed;transform:none;box-shadow:none}.btn-danger{background:#dc35451f;border:1px solid rgba(220,53,69,.25);border-radius:var(--radius-brand);color:#ff6b7a;font-weight:600;transition:all .2s ease}.btn-danger:hover{background:#dc354538;border-color:#dc354566}.brand-text{font-family:"Press Start 2P",monospace;color:var(--brand-500);letter-spacing:.05em}.material-symbols-outlined{font-variation-settings:"FILL" 0,"wght" 400,"GRAD" 0,"opsz" 24}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.top-0\.5{top:.125rem}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mt-0\.5{margin-top:.125rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.inline{display:inline}.flex{display:flex}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-44{height:11rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-full{height:100%}.h-px{height:1px}.min-h-0{min-height:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-11{width:2.75rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-44{width:11rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\[220px\]{max-width:220px}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.border-white\/5{border-color:#ffffff0d}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-orange-400{--tw-bg-opacity: 1;background-color:rgb(251 146 60 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/5{background-color:#ffffff0d}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-2{padding-bottom:.5rem}.pt-2{padding-top:.5rem}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-6xl{font-size:3.75rem;line-height:1}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.tracking-\[0\.18em\]{letter-spacing:.18em}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/20{color:#fff3}.text-white\/25{color:#ffffff40}.text-white\/30{color:#ffffff4d}.text-white\/40{color:#fff6}.text-white\/50{color:#ffffff80}.text-white\/60{color:#fff9}.text-white\/70{color:#ffffffb3}.text-white\/80{color:#fffc}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{--brand-500: #FF570A;--brand-600: #e04400;--brand-400: #ff6e33;--dark-400: #404040;--dark-500: #252525;--dark-600: #1a1a1a;--dark-700: #121212;--dark-800: #0d0d0d;--dark-100: #a0a0a0;--radius-brand: 12px;--radius-brand-lg: 16px}@keyframes pulse-ring{0%{transform:scale(.8);opacity:1}to{transform:scale(1.6);opacity:0}}.pulse-ring{animation:pulse-ring 1.4s ease-out infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.spin{animation:spin 1s linear infinite}@keyframes dot-bounce{0%,80%,to{transform:scale(.6);opacity:.4}40%{transform:scale(1);opacity:1}}.dot-bounce{animation:dot-bounce 1s ease-in-out infinite}.last\:border-0:last-child{border-width:0px}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:opacity-80:hover{opacity:.8}
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap";@import"https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap";@import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{box-sizing:border-box;margin:0;padding:0}html,body,#root{height:100%;width:100%;overflow:hidden}body{font-family:Inter,sans-serif;background-color:#333;color:#fff;-webkit-font-smoothing:antialiased;-webkit-user-select:none;-moz-user-select:none;user-select:none}input,textarea{accent-color:var(--brand-500)}button{-webkit-user-select:none;-moz-user-select:none;user-select:none}.dot-grid-bg{background-color:var(--dark-800);background-image:radial-gradient(circle at 15% 20%,rgba(255,87,10,.2) 0%,transparent 45%),radial-gradient(circle at 85% 80%,rgba(255,87,10,.12) 0%,transparent 45%),linear-gradient(rgba(255,255,255,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.04) 1px,transparent 1px);background-size:100% 100%,100% 100%,40px 40px,40px 40px}.dark-card,.glass-card{background:var(--dark-600);border:1px solid var(--dark-400);border-radius:var(--radius-brand)}.glass-btn{background:#ffffff0f;border:1px solid rgba(255,255,255,.1);border-radius:8px;transition:all .2s ease}.glass-btn:hover{background:#ffffff1a;border-color:#ffffff2e}.btn-primary{background:var(--brand-500);border-radius:var(--radius-brand);color:#fff;font-weight:600;transition:all .2s ease;box-shadow:0 4px 16px #ff570a33}.btn-primary:hover{background:var(--brand-600);transform:scale(1.02)}.btn-primary:disabled{background:#ff570a4d;cursor:not-allowed;transform:none;box-shadow:none}.btn-danger{background:#dc35451f;border:1px solid rgba(220,53,69,.25);border-radius:var(--radius-brand);color:#ff6b7a;font-weight:600;transition:all .2s ease}.btn-danger:hover{background:#dc354538;border-color:#dc354566}.brand-text{font-family:"Press Start 2P",monospace;color:var(--brand-500);letter-spacing:.05em}.material-symbols-outlined{font-variation-settings:"FILL" 0,"wght" 400,"GRAD" 0,"opsz" 24}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.top-0\.5{top:.125rem}.z-50{z-index:50}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mt-0\.5{margin-top:.125rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.inline{display:inline}.flex{display:flex}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-44{height:11rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-full{height:100%}.h-px{height:1px}.min-h-0{min-height:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-11{width:2.75rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-44{width:11rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\[220px\]{max-width:220px}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.border-white\/5{border-color:#ffffff0d}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-orange-400{--tw-bg-opacity: 1;background-color:rgb(251 146 60 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/5{background-color:#ffffff0d}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-2{padding-bottom:.5rem}.pt-2{padding-top:.5rem}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-6xl{font-size:3.75rem;line-height:1}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-tight{line-height:1.25}.tracking-\[0\.18em\]{letter-spacing:.18em}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/20{color:#fff3}.text-white\/25{color:#ffffff40}.text-white\/30{color:#ffffff4d}.text-white\/40{color:#fff6}.text-white\/50{color:#ffffff80}.text-white\/60{color:#fff9}.text-white\/70{color:#ffffffb3}.text-white\/80{color:#fffc}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{--brand-500: #FF570A;--brand-600: #e04400;--brand-400: #ff6e33;--dark-400: #404040;--dark-500: #252525;--dark-600: #1a1a1a;--dark-700: #121212;--dark-800: #0d0d0d;--dark-100: #a0a0a0;--radius-brand: 12px;--radius-brand-lg: 16px}@keyframes pulse-ring{0%{transform:scale(.8);opacity:1}to{transform:scale(1.6);opacity:0}}.pulse-ring{animation:pulse-ring 1.4s ease-out infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.spin{animation:spin 1s linear infinite}@keyframes dot-bounce{0%,80%,to{transform:scale(.6);opacity:.4}40%{transform:scale(1);opacity:1}}.dot-bounce{animation:dot-bounce 1s ease-in-out infinite}.last\:border-0:last-child{border-width:0px}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:opacity-80:hover{opacity:.8}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function i(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(n){if(n.ep)return;n.ep=!0;const r=i(n);fetch(n.href,r)}})();var ue,B,jt,j,et,Ot,Vt,Jt,Ve,He,Ke,oe={},se=[],dn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,fe=Array.isArray;function F(e,t){for(var i in t)e[i]=t[i];return e}function Je(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function hn(e,t,i){var o,n,r,s={};for(r in t)r=="key"?o=t[r]:r=="ref"?n=t[r]:s[r]=t[r];if(arguments.length>2&&(s.children=arguments.length>3?ue.call(arguments,2):i),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)s[r]===void 0&&(s[r]=e.defaultProps[r]);return ne(e,s,o,n,null)}function ne(e,t,i,o,n){var r={type:e,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++jt,__i:-1,__u:0};return n==null&&B.vnode!=null&&B.vnode(r),r}function H(e){return e.children}function re(e,t){this.props=e,this.context=t}function G(e,t){if(t==null)return e.__?G(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if((i=e.__k[t])!=null&&i.__e!=null)return i.__e;return typeof e.type=="function"?G(e):null}function _n(e){if(e.__P&&e.__d){var t=e.__v,i=t.__e,o=[],n=[],r=F({},t);r.__v=t.__v+1,B.vnode&&B.vnode(r),Ye(e.__P,r,t,e.__n,e.__P.namespaceURI,32&t.__u?[i]:null,o,i??G(t),!!(32&t.__u),n),r.__v=t.__v,r.__.__k[r.__i]=r,Qt(o,r,n),t.__e=t.__=null,r.__e!=i&&Yt(r)}}function Yt(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Yt(e)}function tt(e){(!e.__d&&(e.__d=!0)&&j.push(e)&&!le.__r++||et!=B.debounceRendering)&&((et=B.debounceRendering)||Ot)(le)}function le(){try{for(var e,t=1;j.length;)j.length>t&&j.sort(Vt),e=j.shift(),t=j.length,_n(e)}finally{j.length=le.__r=0}}function Gt(e,t,i,o,n,r,s,l,a,f,h){var c,_,d,b,N,R,p,w=o&&o.__k||se,E=t.length;for(a=mn(i,t,w,a,E),c=0;c<E;c++)(d=i.__k[c])!=null&&(_=d.__i!=-1&&w[d.__i]||oe,d.__i=c,R=Ye(e,d,_,n,r,s,l,a,f,h),b=d.__e,d.ref&&_.ref!=d.ref&&(_.ref&&Ge(_.ref,null,d),h.push(d.ref,d.__c||b,d)),N==null&&b!=null&&(N=b),(p=!!(4&d.__u))||_.__k===d.__k?a=Wt(d,a,e,p):typeof d.type=="function"&&R!==void 0?a=R:b&&(a=b.nextSibling),d.__u&=-7);return i.__e=N,a}function mn(e,t,i,o,n){var r,s,l,a,f,h=i.length,c=h,_=0;for(e.__k=new Array(n),r=0;r<n;r++)(s=t[r])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[r]=ne(null,s,null,null,null):fe(s)?s=e.__k[r]=ne(H,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[r]=ne(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[r]=s,a=r+_,s.__=e,s.__b=e.__b+1,l=null,(f=s.__i=gn(s,i,a,c))!=-1&&(c--,(l=i[f])&&(l.__u|=2)),l==null||l.__v==null?(f==-1&&(n>h?_--:n<h&&_++),typeof s.type!="function"&&(s.__u|=4)):f!=a&&(f==a-1?_--:f==a+1?_++:(f>a?_--:_++,s.__u|=4))):e.__k[r]=null;if(c)for(r=0;r<h;r++)(l=i[r])!=null&&(2&l.__u)==0&&(l.__e==o&&(o=G(l)),Zt(l,l));return o}function Wt(e,t,i,o){var n,r;if(typeof e.type=="function"){for(n=e.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=e,t=Wt(n[r],t,i,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=G(e)),i.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function gn(e,t,i,o){var n,r,s,l=e.key,a=e.type,f=t[i],h=f!=null&&(2&f.__u)==0;if(f===null&&l==null||h&&l==f.key&&a==f.type)return i;if(o>(h?1:0)){for(n=i-1,r=i+1;n>=0||r<t.length;)if((f=t[s=n>=0?n--:r++])!=null&&(2&f.__u)==0&&l==f.key&&a==f.type)return s}return-1}function nt(e,t,i){t[0]=="-"?e.setProperty(t,i??""):e[t]=i==null?"":typeof i!="number"||dn.test(t)?i:i+"px"}function $(e,t,i,o,n){var r,s;e:if(t=="style")if(typeof i=="string")e.style.cssText=i;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)i&&t in i||nt(e.style,t,"");if(i)for(t in i)o&&i[t]==o[t]||nt(e.style,t,i[t])}else if(t[0]=="o"&&t[1]=="n")r=t!=(t=t.replace(Jt,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=i,i?o?i.u=o.u:(i.u=Ve,e.addEventListener(t,r?Ke:He,r)):e.removeEventListener(t,r?Ke:He,r);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=i??"";break e}catch{}typeof i=="function"||(i==null||i===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&i==1?"":i))}}function rt(e){return function(t){if(this.l){var i=this.l[t.type+e];if(t.t==null)t.t=Ve++;else if(t.t<i.u)return;return i(B.event?B.event(t):t)}}}function Ye(e,t,i,o,n,r,s,l,a,f){var h,c,_,d,b,N,R,p,w,E,y,x,m,C,v,g=t.type;if(t.constructor!==void 0)return null;128&i.__u&&(a=!!(32&i.__u),r=[l=t.__e=i.__e]),(h=B.__b)&&h(t);e:if(typeof g=="function")try{if(p=t.props,w=g.prototype&&g.prototype.render,E=(h=g.contextType)&&o[h.__c],y=h?E?E.props.value:h.__:o,i.__c?R=(c=t.__c=i.__c).__=c.__E:(w?t.__c=c=new g(p,y):(t.__c=c=new re(p,y),c.constructor=g,c.render=yn),E&&E.sub(c),c.state||(c.state={}),c.__n=o,_=c.__d=!0,c.__h=[],c._sb=[]),w&&c.__s==null&&(c.__s=c.state),w&&g.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=F({},c.__s)),F(c.__s,g.getDerivedStateFromProps(p,c.__s))),d=c.props,b=c.state,c.__v=t,_)w&&g.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),w&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(w&&g.getDerivedStateFromProps==null&&p!==d&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(p,y),t.__v==i.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(p,c.__s,y)===!1){t.__v!=i.__v&&(c.props=p,c.state=c.__s,c.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(k){k&&(k.__=t)}),se.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&s.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(p,c.__s,y),w&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(d,b,N)})}if(c.context=y,c.props=p,c.__P=e,c.__e=!1,x=B.__r,m=0,w)c.state=c.__s,c.__d=!1,x&&x(t),h=c.render(c.props,c.state,c.context),se.push.apply(c.__h,c._sb),c._sb=[];else do c.__d=!1,x&&x(t),h=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++m<25);c.state=c.__s,c.getChildContext!=null&&(o=F(F({},o),c.getChildContext())),w&&!_&&c.getSnapshotBeforeUpdate!=null&&(N=c.getSnapshotBeforeUpdate(d,b)),C=h!=null&&h.type===H&&h.key==null?Xt(h.props.children):h,l=Gt(e,fe(C)?C:[C],t,i,o,n,r,s,l,a,f),c.base=t.__e,t.__u&=-161,c.__h.length&&s.push(c),R&&(c.__E=c.__=null)}catch(k){if(t.__v=null,a||r!=null)if(k.then){for(t.__u|=a?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;r[r.indexOf(l)]=null,t.__e=l}else{for(v=r.length;v--;)Je(r[v]);ze(t)}else t.__e=i.__e,t.__k=i.__k,k.then||ze(t);B.__e(k,t,i)}else r==null&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):l=t.__e=pn(i.__e,t,i,o,n,r,s,a,f);return(h=B.diffed)&&h(t),128&t.__u?void 0:l}function ze(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ze))}function Qt(e,t,i){for(var o=0;o<i.length;o++)Ge(i[o],i[++o],i[++o]);B.__c&&B.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){B.__e(r,n.__v)}})}function Xt(e){return typeof e!="object"||e==null||e.__b>0?e:fe(e)?e.map(Xt):F({},e)}function pn(e,t,i,o,n,r,s,l,a){var f,h,c,_,d,b,N,R=i.props||oe,p=t.props,w=t.type;if(w=="svg"?n="http://www.w3.org/2000/svg":w=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),r!=null){for(f=0;f<r.length;f++)if((d=r[f])&&"setAttribute"in d==!!w&&(w?d.localName==w:d.nodeType==3)){e=d,r[f]=null;break}}if(e==null){if(w==null)return document.createTextNode(p);e=document.createElementNS(n,w,p.is&&p),l&&(B.__m&&B.__m(t,r),l=!1),r=null}if(w==null)R===p||l&&e.data==p||(e.data=p);else{if(r=r&&ue.call(e.childNodes),!l&&r!=null)for(R={},f=0;f<e.attributes.length;f++)R[(d=e.attributes[f]).name]=d.value;for(f in R)d=R[f],f=="dangerouslySetInnerHTML"?c=d:f=="children"||f in p||f=="value"&&"defaultValue"in p||f=="checked"&&"defaultChecked"in p||$(e,f,null,d,n);for(f in p)d=p[f],f=="children"?_=d:f=="dangerouslySetInnerHTML"?h=d:f=="value"?b=d:f=="checked"?N=d:l&&typeof d!="function"||R[f]===d||$(e,f,d,R[f],n);if(h)l||c&&(h.__html==c.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),Gt(t.type=="template"?e.content:e,fe(_)?_:[_],t,i,o,w=="foreignObject"?"http://www.w3.org/1999/xhtml":n,r,s,r?r[0]:i.__k&&G(i,0),l,a),r!=null)for(f=r.length;f--;)Je(r[f]);l||(f="value",w=="progress"&&b==null?e.removeAttribute("value"):b!=null&&(b!==e[f]||w=="progress"&&!b||w=="option"&&b!=R[f])&&$(e,f,b,R[f],n),f="checked",N!=null&&N!=e[f]&&$(e,f,N,R[f],n))}return e}function Ge(e,t,i){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(n){B.__e(n,i)}}function Zt(e,t,i){var o,n;if(B.unmount&&B.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Ge(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(r){B.__e(r,t)}o.base=o.__P=null}if(o=e.__k)for(n=0;n<o.length;n++)o[n]&&Zt(o[n],t,i||typeof e.type!="function");i||Je(e.__e),e.__c=e.__=e.__e=void 0}function yn(e,t,i){return this.constructor(e,i)}function wn(e,t,i){var o,n,r,s;t==document&&(t=document.documentElement),B.__&&B.__(e,t),n=(o=!1)?null:t.__k,r=[],s=[],Ye(t,e=t.__k=hn(H,null,[e]),n||oe,oe,t.namespaceURI,n?null:t.firstChild?ue.call(t.childNodes):null,r,n?n.__e:t.firstChild,o,s),Qt(r,e,s)}ue=se.slice,B={__e:function(e,t,i,o){for(var n,r,s;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&r.getDerivedStateFromError!=null&&(n.setState(r.getDerivedStateFromError(e)),s=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,o||{}),s=n.__d),s)return n.__E=n}catch(l){e=l}throw e}},jt=0,re.prototype.setState=function(e,t){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=F({},this.state),typeof e=="function"&&(e=e(F({},i),this.props)),e&&F(i,e),e!=null&&this.__v&&(t&&this._sb.push(t),tt(this))},re.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),tt(this))},re.prototype.render=H,j=[],Ot=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vt=function(e,t){return e.__v.__b-t.__v.__b},le.__r=0,Jt=/(PointerCapture)$|Capture$/i,Ve=0,He=rt(!1),Ke=rt(!0);var bn=0;function u(e,t,i,o,n,r){t||(t={});var s,l,a=t;if("ref"in a)for(l in a={},t)l=="ref"?s=t[l]:a[l]=t[l];var f={type:e,props:a,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--bn,__i:-1,__u:0,__source:n,__self:r};if(typeof e=="function"&&(s=e.defaultProps))for(l in s)a[l]===void 0&&(a[l]=s[l]);return B.vnode&&B.vnode(f),f}var X,M,ge,it,ae=0,$t=[],I=B,ot=I.__b,st=I.__r,lt=I.diffed,at=I.__c,ct=I.unmount,ut=I.__;function We(e,t){I.__h&&I.__h(M,e,ae||t),ae=0;var i=M.__H||(M.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function L(e){return ae=1,xn(nn,e)}function xn(e,t,i){var o=We(X++,2);if(o.t=e,!o.__c&&(o.__=[nn(void 0,t),function(l){var a=o.__N?o.__N[0]:o.__[0],f=o.t(a,l);a!==f&&(o.__N=[f,o.__[1]],o.__c.setState({}))}],o.__c=M,!M.__f)){var n=function(l,a,f){if(!o.__c.__H)return!0;var h=o.__c.__H.__.filter(function(_){return _.__c});if(h.every(function(_){return!_.__N}))return!r||r.call(this,l,a,f);var c=o.__c.props!==l;return h.some(function(_){if(_.__N){var d=_.__[0];_.__=_.__N,_.__N=void 0,d!==_.__[0]&&(c=!0)}}),r&&r.call(this,l,a,f)||c};M.__f=!0;var r=M.shouldComponentUpdate,s=M.componentWillUpdate;M.componentWillUpdate=function(l,a,f){if(this.__e){var h=r;r=void 0,n(l,a,f),r=h}s&&s.call(this,l,a,f)},M.shouldComponentUpdate=n}return o.__N||o.__}function ce(e,t){var i=We(X++,3);!I.__s&&tn(i.__H,t)&&(i.__=e,i.u=t,M.__H.__h.push(i))}function en(e){return ae=5,vn(function(){return{current:e}},[])}function vn(e,t){var i=We(X++,7);return tn(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function Nn(){for(var e;e=$t.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(ie),t.__h.some(je),t.__h=[]}catch(i){t.__h=[],I.__e(i,e.__v)}}}I.__b=function(e){M=null,ot&&ot(e)},I.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ut&&ut(e,t)},I.__r=function(e){st&&st(e),X=0;var t=(M=e.__c).__H;t&&(ge===M?(t.__h=[],M.__h=[],t.__.some(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(t.__h.some(ie),t.__h.some(je),t.__h=[],X=0)),ge=M},I.diffed=function(e){lt&<(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&($t.push(t)!==1&&it===I.requestAnimationFrame||((it=I.requestAnimationFrame)||Cn)(Nn)),t.__H.__.some(function(i){i.u&&(i.__H=i.u),i.u=void 0})),ge=M=null},I.__c=function(e,t){t.some(function(i){try{i.__h.some(ie),i.__h=i.__h.filter(function(o){return!o.__||je(o)})}catch(o){t.some(function(n){n.__h&&(n.__h=[])}),t=[],I.__e(o,i.__v)}}),at&&at(e,t)},I.unmount=function(e){ct&&ct(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.some(function(o){try{ie(o)}catch(n){t=n}}),i.__H=void 0,t&&I.__e(t,i.__v))};var ft=typeof requestAnimationFrame=="function";function Cn(e){var t,i=function(){clearTimeout(o),ft&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(i,35);ft&&(t=requestAnimationFrame(i))}function ie(e){var t=M,i=e.__c;typeof i=="function"&&(e.__c=void 0,i()),M=t}function je(e){var t=M;e.__c=e.__(),M=t}function tn(e,t){return!e||e.length!==t.length||t.some(function(i,o){return i!==e[o]})}function nn(e,t){return typeof t=="function"?t(e):t}const En=[{icon:"download",label:"Preparing",desc:"Checking tunnel binary"},{icon:"cloud_sync",label:"Connecting",desc:"Creating session"},{icon:"lan",label:"Tunneling",desc:"Starting secure tunnel"},{icon:"check_circle",label:"Ready",desc:"Connected"}];function kn({currentStep:e}){const t=e-1;return u("div",{className:"glass-card p-5 flex flex-col gap-4",children:[u("span",{className:"text-xs text-white/50 font-medium uppercase tracking-wider",children:"Setting up connection"}),u("div",{className:"flex flex-col gap-3",children:En.map((i,o)=>{const n=o<t,r=o===t;return u("div",{className:"flex items-center gap-3",children:[u("div",{className:"w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",style:{background:n?"var(--brand-500)":r?"rgba(255,87,10,0.15)":"rgba(255,255,255,0.06)",border:r?"1.5px solid var(--brand-500)":"1.5px solid transparent"},children:n?u("span",{className:"material-symbols-outlined text-white",style:{fontSize:16},children:"check"}):r?u("span",{className:"flex gap-0.5 items-center",children:[0,1,2].map(s=>u("span",{className:"w-1 h-1 rounded-full bg-orange-400 dot-bounce",style:{animationDelay:`${s*.18}s`}},s))}):u("span",{className:"material-symbols-outlined text-white/20",style:{fontSize:16},children:i.icon})}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:`text-sm font-medium ${n?"text-white/60":r?"text-white":"text-white/25"}`,children:i.label}),u("p",{className:`text-xs mt-0.5 ${r?"text-white/40":"text-white/20"}`,children:i.desc})]}),n&&u("span",{className:"text-xs text-white/30 flex-shrink-0",children:"Done"}),r&&u("span",{className:"text-xs flex-shrink-0 px-2 py-0.5 rounded-full",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Running"})]},o)})})]})}function Sn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Y={},pe,dt;function Tn(){return dt||(dt=1,pe=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),pe}var ye={},z={},ht;function O(){if(ht)return z;ht=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return z.getSymbolSize=function(o){if(!o)throw new Error('"version" cannot be null or undefined');if(o<1||o>40)throw new Error('"version" should be in range from 1 to 40');return o*4+17},z.getSymbolTotalCodewords=function(o){return t[o]},z.getBCHDigit=function(i){let o=0;for(;i!==0;)o++,i>>>=1;return o},z.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');e=o},z.isKanjiModeEnabled=function(){return typeof e<"u"},z.toSJIS=function(o){return e(o)},z}var we={},_t;function Qe(){return _t||(_t=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+i)}}e.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},e.from=function(o,n){if(e.isValid(o))return o;try{return t(o)}catch{return n}}})(we)),we}var be,mt;function Pn(){if(mt)return be;mt=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const i=Math.floor(t/8);return(this.buffer[i]>>>7-t%8&1)===1},put:function(t,i){for(let o=0;o<i;o++)this.putBit((t>>>i-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),t&&(this.buffer[i]|=128>>>this.length%8),this.length++}},be=e,be}var xe,gt;function Rn(){if(gt)return xe;gt=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,i,o,n){const r=t*this.size+i;this.data[r]=o,n&&(this.reservedBit[r]=!0)},e.prototype.get=function(t,i){return this.data[t*this.size+i]},e.prototype.xor=function(t,i,o){this.data[t*this.size+i]^=o},e.prototype.isReserved=function(t,i){return this.reservedBit[t*this.size+i]},xe=e,xe}var ve={},pt;function An(){return pt||(pt=1,(function(e){const t=O().getSymbolSize;e.getRowColCoords=function(o){if(o===1)return[];const n=Math.floor(o/7)+2,r=t(o),s=r===145?26:Math.ceil((r-13)/(2*n-2))*2,l=[r-7];for(let a=1;a<n-1;a++)l[a]=l[a-1]-s;return l.push(6),l.reverse()},e.getPositions=function(o){const n=[],r=e.getRowColCoords(o),s=r.length;for(let l=0;l<s;l++)for(let a=0;a<s;a++)l===0&&a===0||l===0&&a===s-1||l===s-1&&a===0||n.push([r[l],r[a]]);return n}})(ve)),ve}var Ne={},yt;function Bn(){if(yt)return Ne;yt=1;const e=O().getSymbolSize,t=7;return Ne.getPositions=function(o){const n=e(o);return[[0,0],[n-t,0],[0,n-t]]},Ne}var Ce={},wt;function Mn(){return wt||(wt=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},e.from=function(n){return e.isValid(n)?parseInt(n,10):void 0},e.getPenaltyN1=function(n){const r=n.size;let s=0,l=0,a=0,f=null,h=null;for(let c=0;c<r;c++){l=a=0,f=h=null;for(let _=0;_<r;_++){let d=n.get(c,_);d===f?l++:(l>=5&&(s+=t.N1+(l-5)),f=d,l=1),d=n.get(_,c),d===h?a++:(a>=5&&(s+=t.N1+(a-5)),h=d,a=1)}l>=5&&(s+=t.N1+(l-5)),a>=5&&(s+=t.N1+(a-5))}return s},e.getPenaltyN2=function(n){const r=n.size;let s=0;for(let l=0;l<r-1;l++)for(let a=0;a<r-1;a++){const f=n.get(l,a)+n.get(l,a+1)+n.get(l+1,a)+n.get(l+1,a+1);(f===4||f===0)&&s++}return s*t.N2},e.getPenaltyN3=function(n){const r=n.size;let s=0,l=0,a=0;for(let f=0;f<r;f++){l=a=0;for(let h=0;h<r;h++)l=l<<1&2047|n.get(f,h),h>=10&&(l===1488||l===93)&&s++,a=a<<1&2047|n.get(h,f),h>=10&&(a===1488||a===93)&&s++}return s*t.N3},e.getPenaltyN4=function(n){let r=0;const s=n.data.length;for(let a=0;a<s;a++)r+=n.data[a];return Math.abs(Math.ceil(r*100/s/5)-10)*t.N4};function i(o,n,r){switch(o){case e.Patterns.PATTERN000:return(n+r)%2===0;case e.Patterns.PATTERN001:return n%2===0;case e.Patterns.PATTERN010:return r%3===0;case e.Patterns.PATTERN011:return(n+r)%3===0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2===0;case e.Patterns.PATTERN101:return n*r%2+n*r%3===0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2===0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}e.applyMask=function(n,r){const s=r.size;for(let l=0;l<s;l++)for(let a=0;a<s;a++)r.isReserved(a,l)||r.xor(a,l,i(n,a,l))},e.getBestMask=function(n,r){const s=Object.keys(e.Patterns).length;let l=0,a=1/0;for(let f=0;f<s;f++){r(f),e.applyMask(f,n);const h=e.getPenaltyN1(n)+e.getPenaltyN2(n)+e.getPenaltyN3(n)+e.getPenaltyN4(n);e.applyMask(f,n),h<a&&(a=h,l=f)}return l}})(Ce)),Ce}var ee={},bt;function rn(){if(bt)return ee;bt=1;const e=Qe(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return ee.getBlocksCount=function(n,r){switch(r){case e.L:return t[(n-1)*4+0];case e.M:return t[(n-1)*4+1];case e.Q:return t[(n-1)*4+2];case e.H:return t[(n-1)*4+3];default:return}},ee.getTotalCodewordsCount=function(n,r){switch(r){case e.L:return i[(n-1)*4+0];case e.M:return i[(n-1)*4+1];case e.Q:return i[(n-1)*4+2];case e.H:return i[(n-1)*4+3];default:return}},ee}var Ee={},Q={},xt;function In(){if(xt)return Q;xt=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let o=1;for(let n=0;n<255;n++)e[n]=o,t[o]=n,o<<=1,o&256&&(o^=285);for(let n=255;n<512;n++)e[n]=e[n-255]})(),Q.log=function(o){if(o<1)throw new Error("log("+o+")");return t[o]},Q.exp=function(o){return e[o]},Q.mul=function(o,n){return o===0||n===0?0:e[t[o]+t[n]]},Q}var vt;function Ln(){return vt||(vt=1,(function(e){const t=In();e.mul=function(o,n){const r=new Uint8Array(o.length+n.length-1);for(let s=0;s<o.length;s++)for(let l=0;l<n.length;l++)r[s+l]^=t.mul(o[s],n[l]);return r},e.mod=function(o,n){let r=new Uint8Array(o);for(;r.length-n.length>=0;){const s=r[0];for(let a=0;a<n.length;a++)r[a]^=t.mul(n[a],s);let l=0;for(;l<r.length&&r[l]===0;)l++;r=r.slice(l)}return r},e.generateECPolynomial=function(o){let n=new Uint8Array([1]);for(let r=0;r<o;r++)n=e.mul(n,new Uint8Array([1,t.exp(r)]));return n}})(Ee)),Ee}var ke,Nt;function Dn(){if(Nt)return ke;Nt=1;const e=Ln();function t(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(o){this.degree=o,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(o){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(o.length+this.degree);n.set(o);const r=e.mod(n,this.genPoly),s=this.degree-r.length;if(s>0){const l=new Uint8Array(this.degree);return l.set(r,s),l}return r},ke=t,ke}var Se={},Te={},Pe={},Ct;function on(){return Ct||(Ct=1,Pe.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),Pe}var D={},Et;function sn(){if(Et)return D;Et=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");const o="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r
|
|
2
|
+
]))+`;D.KANJI=new RegExp(i,"g"),D.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),D.BYTE=new RegExp(o,"g"),D.NUMERIC=new RegExp(e,"g"),D.ALPHANUMERIC=new RegExp(t,"g");const n=new RegExp("^"+i+"$"),r=new RegExp("^"+e+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return D.testKanji=function(a){return n.test(a)},D.testNumeric=function(a){return r.test(a)},D.testAlphanumeric=function(a){return s.test(a)},D}var kt;function V(){return kt||(kt=1,(function(e){const t=on(),i=sn();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(r,s){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?r.ccBits[0]:s<27?r.ccBits[1]:r.ccBits[2]},e.getBestModeForData=function(r){return i.testNumeric(r)?e.NUMERIC:i.testAlphanumeric(r)?e.ALPHANUMERIC:i.testKanji(r)?e.KANJI:e.BYTE},e.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},e.isValid=function(r){return r&&r.bit&&r.ccBits};function o(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+n)}}e.from=function(r,s){if(e.isValid(r))return r;try{return o(r)}catch{return s}}})(Te)),Te}var St;function Un(){return St||(St=1,(function(e){const t=O(),i=rn(),o=Qe(),n=V(),r=on(),s=7973,l=t.getBCHDigit(s);function a(_,d,b){for(let N=1;N<=40;N++)if(d<=e.getCapacity(N,b,_))return N}function f(_,d){return n.getCharCountIndicator(_,d)+4}function h(_,d){let b=0;return _.forEach(function(N){const R=f(N.mode,d);b+=R+N.getBitsLength()}),b}function c(_,d){for(let b=1;b<=40;b++)if(h(_,b)<=e.getCapacity(b,d,n.MIXED))return b}e.from=function(d,b){return r.isValid(d)?parseInt(d,10):b},e.getCapacity=function(d,b,N){if(!r.isValid(d))throw new Error("Invalid QR Code version");typeof N>"u"&&(N=n.BYTE);const R=t.getSymbolTotalCodewords(d),p=i.getTotalCodewordsCount(d,b),w=(R-p)*8;if(N===n.MIXED)return w;const E=w-f(N,d);switch(N){case n.NUMERIC:return Math.floor(E/10*3);case n.ALPHANUMERIC:return Math.floor(E/11*2);case n.KANJI:return Math.floor(E/13);case n.BYTE:default:return Math.floor(E/8)}},e.getBestVersionForData=function(d,b){let N;const R=o.from(b,o.M);if(Array.isArray(d)){if(d.length>1)return c(d,R);if(d.length===0)return 1;N=d[0]}else N=d;return a(N.mode,N.getLength(),R)},e.getEncodedBits=function(d){if(!r.isValid(d)||d<7)throw new Error("Invalid QR Code version");let b=d<<12;for(;t.getBCHDigit(b)-l>=0;)b^=s<<t.getBCHDigit(b)-l;return d<<12|b}})(Se)),Se}var Re={},Tt;function qn(){if(Tt)return Re;Tt=1;const e=O(),t=1335,i=21522,o=e.getBCHDigit(t);return Re.getEncodedBits=function(r,s){const l=r.bit<<3|s;let a=l<<10;for(;e.getBCHDigit(a)-o>=0;)a^=t<<e.getBCHDigit(a)-o;return(l<<10|a)^i},Re}var Ae={},Be,Pt;function Fn(){if(Pt)return Be;Pt=1;const e=V();function t(i){this.mode=e.NUMERIC,this.data=i.toString()}return t.getBitsLength=function(o){return 10*Math.floor(o/3)+(o%3?o%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(o){let n,r,s;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),s=parseInt(r,10),o.put(s,10);const l=this.data.length-n;l>0&&(r=this.data.substr(n),s=parseInt(r,10),o.put(s,l*3+1))},Be=t,Be}var Me,Rt;function Hn(){if(Rt)return Me;Rt=1;const e=V(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(o){this.mode=e.ALPHANUMERIC,this.data=o}return i.getBitsLength=function(n){return 11*Math.floor(n/2)+6*(n%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(n){let r;for(r=0;r+2<=this.data.length;r+=2){let s=t.indexOf(this.data[r])*45;s+=t.indexOf(this.data[r+1]),n.put(s,11)}this.data.length%2&&n.put(t.indexOf(this.data[r]),6)},Me=i,Me}var Ie,At;function Kn(){if(At)return Ie;At=1;const e=V();function t(i){this.mode=e.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}return t.getBitsLength=function(o){return o*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(i){for(let o=0,n=this.data.length;o<n;o++)i.put(this.data[o],8)},Ie=t,Ie}var Le,Bt;function zn(){if(Bt)return Le;Bt=1;const e=V(),t=O();function i(o){this.mode=e.KANJI,this.data=o}return i.getBitsLength=function(n){return n*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(o){let n;for(n=0;n<this.data.length;n++){let r=t.toSJIS(this.data[n]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[n]+`
|
|
3
|
+
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),o.put(r,13)}},Le=i,Le}var De={exports:{}},Mt;function jn(){return Mt||(Mt=1,(function(e){var t={single_source_shortest_paths:function(i,o,n){var r={},s={};s[o]=0;var l=t.PriorityQueue.make();l.push(o,0);for(var a,f,h,c,_,d,b,N,R;!l.empty();){a=l.pop(),f=a.value,c=a.cost,_=i[f]||{};for(h in _)_.hasOwnProperty(h)&&(d=_[h],b=c+d,N=s[h],R=typeof s[h]>"u",(R||N>b)&&(s[h]=b,l.push(h,b),r[h]=f))}if(typeof n<"u"&&typeof s[n]>"u"){var p=["Could not find a path from ",o," to ",n,"."].join("");throw new Error(p)}return r},extract_shortest_path_from_predecessor_list:function(i,o){for(var n=[],r=o;r;)n.push(r),i[r],r=i[r];return n.reverse(),n},find_path:function(i,o,n){var r=t.single_source_shortest_paths(i,o,n);return t.extract_shortest_path_from_predecessor_list(r,n)},PriorityQueue:{make:function(i){var o=t.PriorityQueue,n={},r;i=i||{};for(r in o)o.hasOwnProperty(r)&&(n[r]=o[r]);return n.queue=[],n.sorter=i.sorter||o.default_sorter,n},default_sorter:function(i,o){return i.cost-o.cost},push:function(i,o){var n={value:i,cost:o};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(De)),De.exports}var It;function On(){return It||(It=1,(function(e){const t=V(),i=Fn(),o=Hn(),n=Kn(),r=zn(),s=sn(),l=O(),a=jn();function f(p){return unescape(encodeURIComponent(p)).length}function h(p,w,E){const y=[];let x;for(;(x=p.exec(E))!==null;)y.push({data:x[0],index:x.index,mode:w,length:x[0].length});return y}function c(p){const w=h(s.NUMERIC,t.NUMERIC,p),E=h(s.ALPHANUMERIC,t.ALPHANUMERIC,p);let y,x;return l.isKanjiModeEnabled()?(y=h(s.BYTE,t.BYTE,p),x=h(s.KANJI,t.KANJI,p)):(y=h(s.BYTE_KANJI,t.BYTE,p),x=[]),w.concat(E,y,x).sort(function(C,v){return C.index-v.index}).map(function(C){return{data:C.data,mode:C.mode,length:C.length}})}function _(p,w){switch(w){case t.NUMERIC:return i.getBitsLength(p);case t.ALPHANUMERIC:return o.getBitsLength(p);case t.KANJI:return r.getBitsLength(p);case t.BYTE:return n.getBitsLength(p)}}function d(p){return p.reduce(function(w,E){const y=w.length-1>=0?w[w.length-1]:null;return y&&y.mode===E.mode?(w[w.length-1].data+=E.data,w):(w.push(E),w)},[])}function b(p){const w=[];for(let E=0;E<p.length;E++){const y=p[E];switch(y.mode){case t.NUMERIC:w.push([y,{data:y.data,mode:t.ALPHANUMERIC,length:y.length},{data:y.data,mode:t.BYTE,length:y.length}]);break;case t.ALPHANUMERIC:w.push([y,{data:y.data,mode:t.BYTE,length:y.length}]);break;case t.KANJI:w.push([y,{data:y.data,mode:t.BYTE,length:f(y.data)}]);break;case t.BYTE:w.push([{data:y.data,mode:t.BYTE,length:f(y.data)}])}}return w}function N(p,w){const E={},y={start:{}};let x=["start"];for(let m=0;m<p.length;m++){const C=p[m],v=[];for(let g=0;g<C.length;g++){const k=C[g],S=""+m+g;v.push(S),E[S]={node:k,lastCount:0},y[S]={};for(let P=0;P<x.length;P++){const T=x[P];E[T]&&E[T].node.mode===k.mode?(y[T][S]=_(E[T].lastCount+k.length,k.mode)-_(E[T].lastCount,k.mode),E[T].lastCount+=k.length):(E[T]&&(E[T].lastCount=k.length),y[T][S]=_(k.length,k.mode)+4+t.getCharCountIndicator(k.mode,w))}}x=v}for(let m=0;m<x.length;m++)y[x[m]].end=0;return{map:y,table:E}}function R(p,w){let E;const y=t.getBestModeForData(p);if(E=t.from(w,y),E!==t.BYTE&&E.bit<y.bit)throw new Error('"'+p+'" cannot be encoded with mode '+t.toString(E)+`.
|
|
4
|
+
Suggested mode is: `+t.toString(y));switch(E===t.KANJI&&!l.isKanjiModeEnabled()&&(E=t.BYTE),E){case t.NUMERIC:return new i(p);case t.ALPHANUMERIC:return new o(p);case t.KANJI:return new r(p);case t.BYTE:return new n(p)}}e.fromArray=function(w){return w.reduce(function(E,y){return typeof y=="string"?E.push(R(y,null)):y.data&&E.push(R(y.data,y.mode)),E},[])},e.fromString=function(w,E){const y=c(w,l.isKanjiModeEnabled()),x=b(y),m=N(x,E),C=a.find_path(m.map,"start","end"),v=[];for(let g=1;g<C.length-1;g++)v.push(m.table[C[g]].node);return e.fromArray(d(v))},e.rawSplit=function(w){return e.fromArray(c(w,l.isKanjiModeEnabled()))}})(Ae)),Ae}var Lt;function Vn(){if(Lt)return ye;Lt=1;const e=O(),t=Qe(),i=Pn(),o=Rn(),n=An(),r=Bn(),s=Mn(),l=rn(),a=Dn(),f=Un(),h=qn(),c=V(),_=On();function d(m,C){const v=m.size,g=r.getPositions(C);for(let k=0;k<g.length;k++){const S=g[k][0],P=g[k][1];for(let T=-1;T<=7;T++)if(!(S+T<=-1||v<=S+T))for(let A=-1;A<=7;A++)P+A<=-1||v<=P+A||(T>=0&&T<=6&&(A===0||A===6)||A>=0&&A<=6&&(T===0||T===6)||T>=2&&T<=4&&A>=2&&A<=4?m.set(S+T,P+A,!0,!0):m.set(S+T,P+A,!1,!0))}}function b(m){const C=m.size;for(let v=8;v<C-8;v++){const g=v%2===0;m.set(v,6,g,!0),m.set(6,v,g,!0)}}function N(m,C){const v=n.getPositions(C);for(let g=0;g<v.length;g++){const k=v[g][0],S=v[g][1];for(let P=-2;P<=2;P++)for(let T=-2;T<=2;T++)P===-2||P===2||T===-2||T===2||P===0&&T===0?m.set(k+P,S+T,!0,!0):m.set(k+P,S+T,!1,!0)}}function R(m,C){const v=m.size,g=f.getEncodedBits(C);let k,S,P;for(let T=0;T<18;T++)k=Math.floor(T/3),S=T%3+v-8-3,P=(g>>T&1)===1,m.set(k,S,P,!0),m.set(S,k,P,!0)}function p(m,C,v){const g=m.size,k=h.getEncodedBits(C,v);let S,P;for(S=0;S<15;S++)P=(k>>S&1)===1,S<6?m.set(S,8,P,!0):S<8?m.set(S+1,8,P,!0):m.set(g-15+S,8,P,!0),S<8?m.set(8,g-S-1,P,!0):S<9?m.set(8,15-S-1+1,P,!0):m.set(8,15-S-1,P,!0);m.set(g-8,8,1,!0)}function w(m,C){const v=m.size;let g=-1,k=v-1,S=7,P=0;for(let T=v-1;T>0;T-=2)for(T===6&&T--;;){for(let A=0;A<2;A++)if(!m.isReserved(k,T-A)){let K=!1;P<C.length&&(K=(C[P]>>>S&1)===1),m.set(k,T-A,K),S--,S===-1&&(P++,S=7)}if(k+=g,k<0||v<=k){k-=g,g=-g;break}}}function E(m,C,v){const g=new i;v.forEach(function(A){g.put(A.mode.bit,4),g.put(A.getLength(),c.getCharCountIndicator(A.mode,m)),A.write(g)});const k=e.getSymbolTotalCodewords(m),S=l.getTotalCodewordsCount(m,C),P=(k-S)*8;for(g.getLengthInBits()+4<=P&&g.put(0,4);g.getLengthInBits()%8!==0;)g.putBit(0);const T=(P-g.getLengthInBits())/8;for(let A=0;A<T;A++)g.put(A%2?17:236,8);return y(g,m,C)}function y(m,C,v){const g=e.getSymbolTotalCodewords(C),k=l.getTotalCodewordsCount(C,v),S=g-k,P=l.getBlocksCount(C,v),T=g%P,A=P-T,K=Math.floor(g/P),W=Math.floor(S/P),cn=W+1,Xe=K-W,un=new a(Xe);let de=0;const Z=new Array(P),Ze=new Array(P);let he=0;const fn=new Uint8Array(m.buffer);for(let J=0;J<P;J++){const me=J<A?W:cn;Z[J]=fn.slice(de,de+me),Ze[J]=un.encode(Z[J]),de+=me,he=Math.max(he,me)}const _e=new Uint8Array(g);let $e=0,U,q;for(U=0;U<he;U++)for(q=0;q<P;q++)U<Z[q].length&&(_e[$e++]=Z[q][U]);for(U=0;U<Xe;U++)for(q=0;q<P;q++)_e[$e++]=Ze[q][U];return _e}function x(m,C,v,g){let k;if(Array.isArray(m))k=_.fromArray(m);else if(typeof m=="string"){let K=C;if(!K){const W=_.rawSplit(m);K=f.getBestVersionForData(W,v)}k=_.fromString(m,K||40)}else throw new Error("Invalid data");const S=f.getBestVersionForData(k,v);if(!S)throw new Error("The amount of data is too big to be stored in a QR Code");if(!C)C=S;else if(C<S)throw new Error(`
|
|
5
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
6
|
+
Minimum version required to store current data is: `+S+`.
|
|
7
|
+
`);const P=E(C,v,k),T=e.getSymbolSize(C),A=new o(T);return d(A,C),b(A),N(A,C),p(A,v,0),C>=7&&R(A,C),w(A,P),isNaN(g)&&(g=s.getBestMask(A,p.bind(null,A,v))),s.applyMask(g,A),p(A,v,g),{modules:A,version:C,errorCorrectionLevel:v,maskPattern:g,segments:k}}return ye.create=function(C,v){if(typeof C>"u"||C==="")throw new Error("No input text");let g=t.M,k,S;return typeof v<"u"&&(g=t.from(v.errorCorrectionLevel,t.M),k=f.from(v.version),S=s.from(v.maskPattern),v.toSJISFunc&&e.setToSJISFunction(v.toSJISFunc)),x(C,k,g,S)},ye}var Ue={},qe={},Dt;function ln(){return Dt||(Dt=1,(function(e){function t(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let o=i.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+i);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(r){return[r,r]}))),o.length===6&&o.push("F","F");const n=parseInt(o.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+o.slice(0,6).join("")}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const n=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,r=o.width&&o.width>=21?o.width:void 0,s=o.scale||4;return{width:r,scale:r?4:s,margin:n,color:{dark:t(o.color.dark||"#000000ff"),light:t(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(o,n){return n.width&&n.width>=o+n.margin*2?n.width/(o+n.margin*2):n.scale},e.getImageWidth=function(o,n){const r=e.getScale(o,n);return Math.floor((o+n.margin*2)*r)},e.qrToImageData=function(o,n,r){const s=n.modules.size,l=n.modules.data,a=e.getScale(s,r),f=Math.floor((s+r.margin*2)*a),h=r.margin*a,c=[r.color.light,r.color.dark];for(let _=0;_<f;_++)for(let d=0;d<f;d++){let b=(_*f+d)*4,N=r.color.light;if(_>=h&&d>=h&&_<f-h&&d<f-h){const R=Math.floor((_-h)/a),p=Math.floor((d-h)/a);N=c[l[R*s+p]?1:0]}o[b++]=N.r,o[b++]=N.g,o[b++]=N.b,o[b]=N.a}}})(qe)),qe}var Ut;function Jn(){return Ut||(Ut=1,(function(e){const t=ln();function i(n,r,s){n.clearRect(0,0,r.width,r.height),r.style||(r.style={}),r.height=s,r.width=s,r.style.height=s+"px",r.style.width=s+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(r,s,l){let a=l,f=s;typeof a>"u"&&(!s||!s.getContext)&&(a=s,s=void 0),s||(f=o()),a=t.getOptions(a);const h=t.getImageWidth(r.modules.size,a),c=f.getContext("2d"),_=c.createImageData(h,h);return t.qrToImageData(_.data,r,a),i(c,f,h),c.putImageData(_,0,0),f},e.renderToDataURL=function(r,s,l){let a=l;typeof a>"u"&&(!s||!s.getContext)&&(a=s,s=void 0),a||(a={});const f=e.render(r,s,a),h=a.type||"image/png",c=a.rendererOpts||{};return f.toDataURL(h,c.quality)}})(Ue)),Ue}var Fe={},qt;function Yn(){if(qt)return Fe;qt=1;const e=ln();function t(n,r){const s=n.a/255,l=r+'="'+n.hex+'"';return s<1?l+" "+r+'-opacity="'+s.toFixed(2).slice(1)+'"':l}function i(n,r,s){let l=n+r;return typeof s<"u"&&(l+=" "+s),l}function o(n,r,s){let l="",a=0,f=!1,h=0;for(let c=0;c<n.length;c++){const _=Math.floor(c%r),d=Math.floor(c/r);!_&&!f&&(f=!0),n[c]?(h++,c>0&&_>0&&n[c-1]||(l+=f?i("M",_+s,.5+d+s):i("m",a,0),a=0,f=!1),_+1<r&&n[c+1]||(l+=i("h",h),h=0)):a++}return l}return Fe.render=function(r,s,l){const a=e.getOptions(s),f=r.modules.size,h=r.modules.data,c=f+a.margin*2,_=a.color.light.a?"<path "+t(a.color.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",d="<path "+t(a.color.dark,"stroke")+' d="'+o(h,f,a.margin)+'"/>',b='viewBox="0 0 '+c+" "+c+'"',R='<svg xmlns="http://www.w3.org/2000/svg" '+(a.width?'width="'+a.width+'" height="'+a.width+'" ':"")+b+' shape-rendering="crispEdges">'+_+d+`</svg>
|
|
8
|
+
`;return typeof l=="function"&&l(null,R),R},Fe}var Ft;function Gn(){if(Ft)return Y;Ft=1;const e=Tn(),t=Vn(),i=Jn(),o=Yn();function n(r,s,l,a,f){const h=[].slice.call(arguments,1),c=h.length,_=typeof h[c-1]=="function";if(!_&&!e())throw new Error("Callback required as last argument");if(_){if(c<2)throw new Error("Too few arguments provided");c===2?(f=l,l=s,s=a=void 0):c===3&&(s.getContext&&typeof f>"u"?(f=a,a=void 0):(f=a,a=l,l=s,s=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(l=s,s=a=void 0):c===2&&!s.getContext&&(a=l,l=s,s=void 0),new Promise(function(d,b){try{const N=t.create(l,a);d(r(N,s,a))}catch(N){b(N)}})}try{const d=t.create(l,a);f(null,r(d,s,a))}catch(d){f(d)}}return Y.create=t.create,Y.toCanvas=n.bind(null,i.render),Y.toDataURL=n.bind(null,i.renderToDataURL),Y.toString=n.bind(null,function(r,s,l){return o.render(r,l)}),Y}var Wn=Gn();const Qn=Sn(Wn);function Oe({message:e,confirmLabel:t="Confirm",confirmDanger:i=!1,onConfirm:o,onCancel:n}){return u("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0,0,0,0.6)"},children:u("div",{className:"glass-card p-5 flex flex-col gap-4 w-72",children:[u("p",{className:"text-sm text-white text-center",children:e}),u("div",{className:"flex gap-2",children:[u("button",{onClick:n,className:"glass-btn flex-1 py-2 text-sm text-white/60 hover:text-white",children:"Cancel"}),u("button",{onClick:o,className:"flex-1 py-2 text-sm font-semibold rounded-xl",style:{background:i?"rgba(220,53,69,0.8)":"var(--brand-500)",color:"#fff"},children:t})]})]})})}const Ht="9remote.cc";function Xn(e){if(e<=0)return"Expired";const t=Math.floor(e/1e3),i=Math.floor(t/60),o=t%60;return`${String(i).padStart(2,"0")}:${String(o).padStart(2,"0")}`}function te({icon:e,onClick:t,title:i,danger:o}){return u("button",{onClick:t,title:i,className:"glass-btn w-7 h-7 flex items-center justify-center flex-shrink-0 text-white/50 hover:text-white",style:o?{color:"rgba(255,100,100,0.7)"}:{},children:u("span",{className:"material-symbols-outlined",style:{fontSize:15},children:e})})}function Zn({qrUrl:e,oneTimeKey:t,oneTimeKeyExpiresAt:i,permanentKey:o,onGenerateOneTimeKey:n,onRegenerateKey:r}){const s=en(null),[l,a]=L(null),[f,h]=L(null),[c,_]=L(null);ce(()=>{!e||!s.current||Qn.toCanvas(s.current,e,{width:160,margin:1,color:{dark:"#0f1923",light:"#ffffff"}}).catch(()=>{})},[e]),ce(()=>{if(!i){a(null);return}const b=()=>a(i-Date.now());b();const N=setInterval(b,1e3);return()=>clearInterval(N)},[i]);const d=(b,N)=>{navigator.clipboard.writeText(b).catch(()=>{}),h(N),setTimeout(()=>h(null),2e3)};return u(H,{children:[c==="oneTime"&&u(Oe,{message:"Generate a new one-time key? The current one will expire immediately.",confirmLabel:"Generate",onConfirm:()=>{_(null),n==null||n()},onCancel:()=>_(null)}),c==="regen"&&u(Oe,{message:"Regenerate permanent key? All existing sessions will be disconnected.",confirmLabel:"Regenerate",confirmDanger:!0,onConfirm:()=>{_(null),r==null||r()},onCancel:()=>_(null)}),u("div",{className:"glass-card p-5 flex flex-col items-center gap-4",children:[u("div",{className:"w-44 h-44 rounded-xl overflow-hidden bg-white p-2 flex items-center justify-center flex-shrink-0",children:e?u("canvas",{ref:s}):u("span",{className:"material-symbols-outlined text-gray-300 text-6xl",children:"qr_code_2"})}),u("a",{href:`https://${Ht}/login`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 hover:opacity-80 transition-opacity",children:[u("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 flex-shrink-0"}),u("span",{className:"text-xs text-white/60 font-medium",children:[Ht,"/login"]})]}),u("div",{className:"w-full h-px bg-white/5"}),u("div",{className:"w-full flex flex-col gap-1.5",children:[u("div",{className:"flex items-center justify-between px-0.5",children:[u("span",{className:"text-xs font-medium text-white/50",children:"One-Time Key"}),u("span",{className:"text-xs text-white/30",children:"Single use · expires"})]}),u("div",{className:"w-full flex items-center gap-2 dark-card px-3 py-2.5",children:[u("span",{className:"material-symbols-outlined text-white/30 flex-shrink-0",style:{fontSize:16},children:"timer"}),u("span",{className:"flex-1 font-mono font-bold tracking-[0.18em] text-base truncate",style:{color:t?"var(--brand-500)":"rgba(255,255,255,0.15)"},children:t||"• • • • • •"}),l!==null&&u("span",{className:`text-xs font-mono flex-shrink-0 ${l<=0?"text-red-400":"text-white/40"}`,children:Xn(l)}),t&&u(te,{icon:f==="oneTime"?"check":"content_copy",onClick:()=>d(t,"oneTime"),title:"Copy one-time key"}),u(te,{icon:"refresh",onClick:()=>_("oneTime"),title:"New one-time key"})]})]}),u("div",{className:"w-full flex flex-col gap-1.5",children:[u("div",{className:"flex items-center justify-between px-0.5",children:[u("span",{className:"text-xs font-medium text-white/50",children:"Permanent Key"}),u("span",{className:"text-xs text-white/30",children:"Reusable · no expiry"})]}),u("div",{className:"w-full flex items-center gap-2 dark-card px-3 py-2.5",children:[u("span",{className:"material-symbols-outlined text-white/30 flex-shrink-0",style:{fontSize:16},children:"key"}),u("span",{className:"flex-1 font-mono text-xs text-white/50 truncate",children:o||"— not set —"}),o&&u(te,{icon:f==="permanent"?"check":"content_copy",onClick:()=>d(o,"permanent"),title:"Copy permanent key"}),u(te,{icon:"autorenew",onClick:()=>_("regen"),title:"Regenerate permanent key",danger:!0})]})]})]})]})}const $n="https://docs.9remote.cc/",an={screenRecording:{label:"Screen Recording",icon:"screenshot_monitor",desc:"Capture screen content"},accessibility:{label:"Accessibility",icon:"accessibility_new",desc:"Control mouse & keyboard"}};function er({type:e,granted:t,onRequest:i}){const o=an[e]||{label:e,desc:""};return u("div",{className:"flex items-center gap-3 py-2 border-b border-white/5 last:border-0",children:[u("span",{className:`material-symbols-outlined flex-shrink-0 ${t?"text-green-400":"text-white/30"}`,style:{fontSize:18},children:t?"check_circle":"cancel"}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:`text-xs font-medium ${t?"text-white/80":"text-white/50"}`,children:o.label}),u("p",{className:"text-[10px] text-white/30 leading-4",children:o.desc})]}),!t&&u("button",{onClick:()=>i(e),className:"flex-shrink-0 text-xs px-2.5 py-1 rounded-lg font-medium",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Grant"})]})}function tr(){return u("div",{className:"glass-card p-4 flex items-center gap-3",children:[u("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(255,87,10,0.15)"},children:u("span",{className:"material-symbols-outlined",style:{fontSize:20,color:"var(--brand-400)"},children:"terminal"})}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:"text-sm font-semibold text-white",children:"Remote Terminal"}),u("p",{className:"text-xs text-white/40",children:"Full shell access · always on"})]}),u("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-full",style:{background:"rgba(74,222,128,0.1)"},children:[u("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400"}),u("span",{className:"text-xs text-green-400 font-medium",children:"On"})]})]})}function nr({enabled:e,onToggle:t,permissions:i,onRequestPermission:o}){const n=Object.entries(an);return u("div",{className:"glass-card p-4 flex flex-col gap-3",children:[u("div",{className:"flex items-center gap-3",children:[u("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:e?"rgba(255,87,10,0.15)":"rgba(255,255,255,0.05)"},children:u("span",{className:"material-symbols-outlined",style:{fontSize:20,color:e?"var(--brand-400)":"rgba(255,255,255,0.25)"},children:"desktop_windows"})}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:"text-sm font-semibold text-white",children:"Remote Desktop"}),u("p",{className:"text-xs text-white/40",children:"Control screen, mouse & keyboard"})]}),u("button",{onClick:t,className:"flex-shrink-0 w-11 h-6 rounded-full transition-all relative",style:{background:e?"var(--brand-500)":"rgba(255,255,255,0.1)"},children:u("span",{className:"absolute top-0.5 w-5 h-5 rounded-full bg-white transition-all",style:{left:e?"calc(100% - 22px)":"2px",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"}})})]}),e&&u("div",{className:"flex flex-col border-t border-white/5 pt-2",children:[u("p",{className:"text-[10px] text-white/30 uppercase tracking-wider mb-1",children:"System Permissions"}),n.map(([r])=>u(er,{type:r,granted:(i==null?void 0:i[r])??!1,onRequest:o},r))]})]})}function rr({version:e}){return e?u("div",{className:"px-5 py-2 flex items-center gap-2 border-b",style:{background:"rgba(255,87,10,0.08)",borderColor:"rgba(255,87,10,0.2)"},children:[u("span",{className:"material-symbols-outlined text-sm flex-shrink-0",style:{color:"var(--brand-400)"},children:"system_update"}),u("span",{className:"text-xs flex-1",style:{color:"var(--brand-400)"},children:["Version ",e," available"]}),u("button",{onClick:()=>fetch("/api/update",{method:"POST"}).catch(()=>{}),className:"flex-shrink-0 text-xs px-2 py-0.5 rounded font-medium",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Update"})]}):null}const ir=[{icon:"terminal",label:"Terminal",desc:"Full shell access"},{icon:"desktop_windows",label:"Desktop",desc:"Remote screen control"},{icon:"folder_open",label:"Files",desc:"Browse & edit files"}],or=[{icon:"qr_code_scanner",text:"Scan QR to connect instantly"},{icon:"wifi_off",text:"No port forwarding needed"},{icon:"devices",text:"Works on any device"}];function sr({onStart:e}){const[t,i]=L(!1),o=()=>{i(!0),e()};return u("div",{className:"flex-1 flex flex-col items-center justify-between px-6 py-6 overflow-y-auto",children:[u("div",{className:"flex flex-col items-center gap-2 text-center mt-2",children:[u("div",{className:"w-14 h-14 rounded-2xl flex items-center justify-center mb-1",style:{background:"var(--brand-500)",boxShadow:"0 8px 32px rgba(255,87,10,0.35)"},children:u("span",{className:"material-symbols-outlined text-white",style:{fontSize:30},children:"terminal"})}),u("h1",{className:"text-lg font-bold text-white tracking-tight",children:"9Remote"}),u("p",{className:"text-xs text-white/50 leading-5 max-w-[220px]",children:"Access your terminal, desktop & files from anywhere"})]}),u("div",{className:"flex gap-2 w-full mt-5",children:ir.map(n=>u("div",{className:"flex-1 dark-card flex flex-col items-center gap-1.5 py-3 px-1",children:[u("span",{className:"material-symbols-outlined text-white/70",style:{fontSize:22,color:"var(--brand-400)"},children:n.icon}),u("p",{className:"text-xs font-semibold text-white",children:n.label}),u("p",{className:"text-[10px] text-white/40 text-center leading-4",children:n.desc})]},n.label))}),u("div",{className:"flex flex-col gap-2 w-full mt-4",children:or.map(n=>u("div",{className:"flex items-center gap-2.5",children:[u("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:16,color:"var(--brand-400)"},children:n.icon}),u("span",{className:"text-xs text-white/60",children:n.text})]},n.text))}),u("button",{onClick:t?void 0:o,disabled:t,className:"btn-primary w-full py-3.5 flex items-center justify-center gap-2 text-sm font-semibold mt-6",style:{borderRadius:"var(--radius-brand)",opacity:t?.7:1},children:t?u(H,{children:[u("span",{className:"flex gap-0.5 items-center",children:[0,1,2].map(n=>u("span",{className:"w-1.5 h-1.5 rounded-full bg-white dot-bounce",style:{animationDelay:`${n*.18}s`}},n))}),"Connecting..."]}):u(H,{children:[u("span",{className:"material-symbols-outlined text-base",children:"play_arrow"}),"Connect"]})})]})}function lr({conn:e}){return u("div",{className:"flex items-center gap-3 py-2 border-b border-white/5 last:border-0",children:[u("div",{className:"w-2 h-2 rounded-full bg-green-400 flex-shrink-0"}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:"text-xs text-white font-medium truncate",children:e.ip||"Unknown"}),u("p",{className:"text-xs text-white/30",children:e.connectedAt?new Date(e.connectedAt).toLocaleTimeString():""})]}),u("span",{className:"text-xs text-white/30",children:e.type||"ws"})]})}function ar({step:e,tunnelUrl:t,oneTimeKey:i,oneTimeKeyExpiresAt:o,permanentKey:n,qrUrl:r,permissions:s,desktopEnabled:l,updateVersion:a,connections:f=[],version:h="",onRequestPermission:c,onDesktopToggle:_,onStop:d,onStart:b,onGenerateOneTimeKey:N,onRegenerateKey:R,logs:p=[]}){const[w,E]=L("connect"),[y,x]=L(!1),m=en(null),C=e===0,v=e>0&&e<4;return ce(()=>{var g;w==="log"&&((g=m.current)==null||g.scrollIntoView({behavior:"smooth"}))},[p,w]),u("div",{className:"h-full flex flex-col relative overflow-hidden",style:{background:"#333"},children:[u("div",{className:"flex-1 flex flex-col w-full min-h-0 dot-grid-bg overflow-hidden",style:{maxWidth:"672px",margin:"0 auto"},children:[u("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/5",children:[u("div",{className:"flex items-center gap-3",children:[u("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--brand-500)"},children:u("span",{className:"material-symbols-outlined text-white text-base",children:"terminal"})}),u("div",{className:"flex flex-col leading-tight",children:[u("span",{className:"brand-text text-xs",children:"9Remote"}),h&&u("span",{className:"text-[10px] text-white/30",children:["v",h]})]})]}),u("div",{className:"flex items-center gap-2",children:[u("button",{onClick:()=>window.open($n,"_blank"),className:"glass-btn w-7 h-7 flex items-center justify-center text-white/40 hover:text-white",children:u("span",{className:"material-symbols-outlined text-sm",children:"help_outline"})}),!C&&u("button",{onClick:()=>x(!0),className:"btn-danger px-3 h-7 flex items-center gap-1.5 text-xs font-medium",children:[u("span",{className:"material-symbols-outlined text-sm",children:"stop_circle"}),"Disconnect"]})]})]}),u(rr,{version:a}),C?u(sr,{onStart:b,connecting:!1}):v?u("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex flex-col gap-4",children:u(kn,{currentStep:e})}):u(H,{children:[u("div",{className:"flex px-5 gap-3 border-b border-white/5",children:[{id:"connect",label:"Connection"},{id:"log",label:"Logs"}].map(g=>u("button",{onClick:()=>E(g.id),className:"pb-2 text-xs font-medium border-b-2 transition-colors",style:w===g.id?{borderColor:"var(--brand-500)",color:"var(--brand-500)"}:{borderColor:"transparent",color:"rgba(255,255,255,0.4)"},children:g.label},g.id))}),u("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex flex-col gap-4",children:[w==="connect"&&u(H,{children:[u(Zn,{qrUrl:r,oneTimeKey:i,oneTimeKeyExpiresAt:o,permanentKey:n,tunnelUrl:t,onGenerateOneTimeKey:N,onRegenerateKey:R}),u(tr,{}),u(nr,{enabled:l,onToggle:_,permissions:s,onRequestPermission:c}),u("div",{className:"glass-card p-4 flex flex-col gap-1",children:[u("p",{className:"text-xs text-white/60 font-medium uppercase tracking-wider mb-2",children:["Clients",f.length>0?` (${f.length})`:""]}),f.length===0?u("p",{className:"text-xs text-white/30 text-center py-3",children:"No active connections"}):f.map((g,k)=>u(lr,{conn:g},k))]})]}),w==="log"&&u("div",{className:"flex-1 flex flex-col",children:p.length===0?u("p",{className:"text-xs text-white/30 text-center mt-8",children:"No logs yet"}):u("div",{className:"flex flex-col gap-0.5",children:[p.map((g,k)=>u("p",{className:"text-xs font-mono text-white/60 leading-5 break-all",children:g},k)),u("div",{ref:m})]})})]})]})]}),y&&u(Oe,{message:"Disconnect and stop the tunnel? Remote clients will be disconnected.",confirmLabel:"Disconnect",confirmDanger:!0,onConfirm:()=>{x(!1),d==null||d()},onCancel:()=>x(!1)})]})}const Kt={step:0,tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null,permanentKey:"",qrUrl:"",latency:null,uptime:null},cr={screenRecording:!1,accessibility:!1},zt=200;function ur(){const[e,t]=L(Kt),[i,o]=L(cr),[n,r]=L(!1),[s,l]=L([]),[a,f]=L(null),[h,c]=L([]),[_,d]=L("");ce(()=>{fetch("/api/version").then(x=>x.json()).then(x=>d(x.version??"")).catch(()=>{}),fetch("/api/ui/state").then(x=>x.json()).then(x=>{t({step:x.step??0,tunnelUrl:x.tunnelUrl??"",oneTimeKey:x.oneTimeKey??"",oneTimeKeyExpiresAt:x.oneTimeKeyExpiresAt??null,permanentKey:x.permanentKey??"",qrUrl:x.qrUrl??"",latency:x.latency??null,uptime:x.uptime??null}),o({screenRecording:x.screenRecording??!1,accessibility:x.accessibility??!1}),x.desktopEnabled!==void 0&&r(x.desktopEnabled)}).catch(()=>{});const y=new EventSource("/api/ui/events");return y.onmessage=x=>{try{const m=JSON.parse(x.data);m.type==="state"?t({step:m.step??0,tunnelUrl:m.tunnelUrl??"",oneTimeKey:m.oneTimeKey??"",oneTimeKeyExpiresAt:m.oneTimeKeyExpiresAt??null,permanentKey:m.permanentKey??"",qrUrl:m.qrUrl??"",latency:m.latency??null,uptime:m.uptime??null}):m.type==="log"?l(C=>{const v=[...C,m.message];return v.length>zt?v.slice(-zt):v}):m.type==="updateAvailable"?f(m.version):m.type==="permissions"?(o({screenRecording:m.screenRecording,accessibility:m.accessibility}),m.desktopEnabled!==void 0&&r(m.desktopEnabled)):m.type==="connections"&&c(m.connections??[])}catch{}},y.onerror=()=>{},()=>y.close()},[]);const b=async y=>{await fetch("/api/permissions/request",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:y})}).catch(()=>{})},N=()=>{fetch("/api/ui/stop",{method:"POST"}).catch(()=>{}),t(Kt)},R=()=>{fetch("/api/ui/start",{method:"POST"}).catch(()=>{})},p=async()=>{const y=await fetch("/api/key/one-time",{method:"POST"}).catch(()=>null);if(!(y!=null&&y.ok))return;const x=await y.json().catch(()=>null);x!=null&&x.oneTimeKey&&t(m=>({...m,oneTimeKey:x.oneTimeKey,oneTimeKeyExpiresAt:x.expiresAt,qrUrl:x.qrUrl??m.qrUrl}))},w=async()=>{const y=!n;r(y),await fetch("/api/desktop/toggle",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:y})}).catch(()=>{})},E=async()=>{const y=await fetch("/api/key/regenerate",{method:"POST"}).catch(()=>null);if(!(y!=null&&y.ok))return;const x=await y.json().catch(()=>null);x!=null&&x.permanentKey&&t(m=>({...m,permanentKey:x.permanentKey}))};return u(ar,{step:e.step,tunnelUrl:e.tunnelUrl,oneTimeKey:e.oneTimeKey,oneTimeKeyExpiresAt:e.oneTimeKeyExpiresAt,permanentKey:e.permanentKey,qrUrl:e.qrUrl,permissions:i,desktopEnabled:n,updateVersion:a,connections:h,onRequestPermission:b,onDesktopToggle:w,onStop:N,onStart:R,onGenerateOneTimeKey:p,onRegenerateKey:E,logs:s,version:_})}wn(u(ur,{}),document.getElementById("root"));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2
|
+
<rect width="24" height="24" rx="6" fill="#FF570A"/>
|
|
3
|
+
<polyline points="5 18 10.5 12 5 6" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<line x1="13" y1="18" x2="19" y2="18" stroke="#ffffff" stroke-width="2" stroke-linecap="round"/>
|
|
5
|
+
</svg>
|
package/dist/ui/index.html
CHANGED
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>9Remote</title>
|
|
7
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
8
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
8
9
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
9
10
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
|
|
10
11
|
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet" />
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
12
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-Dh53-SjC.js"></script>
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DOMz0Zx8.css">
|
|
13
14
|
</head>
|
|
14
15
|
<body>
|
|
15
16
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function o(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(n){if(n.ep)return;n.ep=!0;const r=o(n);fetch(n.href,r)}})();var ue,B,Ot,O,et,jt,Vt,Jt,Ve,He,Ke,ie={},se=[],dn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,fe=Array.isArray;function F(e,t){for(var o in t)e[o]=t[o];return e}function Je(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function hn(e,t,o){var i,n,r,s={};for(r in t)r=="key"?i=t[r]:r=="ref"?n=t[r]:s[r]=t[r];if(arguments.length>2&&(s.children=arguments.length>3?ue.call(arguments,2):o),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)s[r]===void 0&&(s[r]=e.defaultProps[r]);return ne(e,s,i,n,null)}function ne(e,t,o,i,n){var r={type:e,props:t,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++Ot,__i:-1,__u:0};return n==null&&B.vnode!=null&&B.vnode(r),r}function H(e){return e.children}function re(e,t){this.props=e,this.context=t}function G(e,t){if(t==null)return e.__?G(e.__,e.__i+1):null;for(var o;t<e.__k.length;t++)if((o=e.__k[t])!=null&&o.__e!=null)return o.__e;return typeof e.type=="function"?G(e):null}function _n(e){if(e.__P&&e.__d){var t=e.__v,o=t.__e,i=[],n=[],r=F({},t);r.__v=t.__v+1,B.vnode&&B.vnode(r),Ye(e.__P,r,t,e.__n,e.__P.namespaceURI,32&t.__u?[o]:null,i,o??G(t),!!(32&t.__u),n),r.__v=t.__v,r.__.__k[r.__i]=r,Wt(i,r,n),t.__e=t.__=null,r.__e!=o&&Yt(r)}}function Yt(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Yt(e)}function tt(e){(!e.__d&&(e.__d=!0)&&O.push(e)&&!le.__r++||et!=B.debounceRendering)&&((et=B.debounceRendering)||jt)(le)}function le(){try{for(var e,t=1;O.length;)O.length>t&&O.sort(Vt),e=O.shift(),t=O.length,_n(e)}finally{O.length=le.__r=0}}function Gt(e,t,o,i,n,r,s,l,a,f,h){var c,_,d,b,N,P,y,m=i&&i.__k||se,g=t.length;for(a=mn(o,t,m,a,g),c=0;c<g;c++)(d=o.__k[c])!=null&&(_=d.__i!=-1&&m[d.__i]||ie,d.__i=c,P=Ye(e,d,_,n,r,s,l,a,f,h),b=d.__e,d.ref&&_.ref!=d.ref&&(_.ref&&Ge(_.ref,null,d),h.push(d.ref,d.__c||b,d)),N==null&&b!=null&&(N=b),(y=!!(4&d.__u))||_.__k===d.__k?a=Qt(d,a,e,y):typeof d.type=="function"&&P!==void 0?a=P:b&&(a=b.nextSibling),d.__u&=-7);return o.__e=N,a}function mn(e,t,o,i,n){var r,s,l,a,f,h=o.length,c=h,_=0;for(e.__k=new Array(n),r=0;r<n;r++)(s=t[r])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[r]=ne(null,s,null,null,null):fe(s)?s=e.__k[r]=ne(H,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[r]=ne(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[r]=s,a=r+_,s.__=e,s.__b=e.__b+1,l=null,(f=s.__i=gn(s,o,a,c))!=-1&&(c--,(l=o[f])&&(l.__u|=2)),l==null||l.__v==null?(f==-1&&(n>h?_--:n<h&&_++),typeof s.type!="function"&&(s.__u|=4)):f!=a&&(f==a-1?_--:f==a+1?_++:(f>a?_--:_++,s.__u|=4))):e.__k[r]=null;if(c)for(r=0;r<h;r++)(l=o[r])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=G(l)),Zt(l,l));return i}function Qt(e,t,o,i){var n,r;if(typeof e.type=="function"){for(n=e.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=e,t=Qt(n[r],t,o,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=G(e)),o.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function gn(e,t,o,i){var n,r,s,l=e.key,a=e.type,f=t[o],h=f!=null&&(2&f.__u)==0;if(f===null&&l==null||h&&l==f.key&&a==f.type)return o;if(i>(h?1:0)){for(n=o-1,r=o+1;n>=0||r<t.length;)if((f=t[s=n>=0?n--:r++])!=null&&(2&f.__u)==0&&l==f.key&&a==f.type)return s}return-1}function nt(e,t,o){t[0]=="-"?e.setProperty(t,o??""):e[t]=o==null?"":typeof o!="number"||dn.test(t)?o:o+"px"}function $(e,t,o,i,n){var r,s;e:if(t=="style")if(typeof o=="string")e.style.cssText=o;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(t in i)o&&t in o||nt(e.style,t,"");if(o)for(t in o)i&&o[t]==i[t]||nt(e.style,t,o[t])}else if(t[0]=="o"&&t[1]=="n")r=t!=(t=t.replace(Jt,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=o,o?i?o.u=i.u:(o.u=Ve,e.addEventListener(t,r?Ke:He,r)):e.removeEventListener(t,r?Ke:He,r);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=o??"";break e}catch{}typeof o=="function"||(o==null||o===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&o==1?"":o))}}function rt(e){return function(t){if(this.l){var o=this.l[t.type+e];if(t.t==null)t.t=Ve++;else if(t.t<o.u)return;return o(B.event?B.event(t):t)}}}function Ye(e,t,o,i,n,r,s,l,a,f){var h,c,_,d,b,N,P,y,m,g,p,A,x,C,v,w=t.type;if(t.constructor!==void 0)return null;128&o.__u&&(a=!!(32&o.__u),r=[l=t.__e=o.__e]),(h=B.__b)&&h(t);e:if(typeof w=="function")try{if(y=t.props,m=w.prototype&&w.prototype.render,g=(h=w.contextType)&&i[h.__c],p=h?g?g.props.value:h.__:i,o.__c?P=(c=t.__c=o.__c).__=c.__E:(m?t.__c=c=new w(y,p):(t.__c=c=new re(y,p),c.constructor=w,c.render=yn),g&&g.sub(c),c.state||(c.state={}),c.__n=i,_=c.__d=!0,c.__h=[],c._sb=[]),m&&c.__s==null&&(c.__s=c.state),m&&w.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=F({},c.__s)),F(c.__s,w.getDerivedStateFromProps(y,c.__s))),d=c.props,b=c.state,c.__v=t,_)m&&w.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),m&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(m&&w.getDerivedStateFromProps==null&&y!==d&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(y,p),t.__v==o.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(y,c.__s,p)===!1){t.__v!=o.__v&&(c.props=y,c.state=c.__s,c.__d=!1),t.__e=o.__e,t.__k=o.__k,t.__k.some(function(E){E&&(E.__=t)}),se.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&s.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(y,c.__s,p),m&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(d,b,N)})}if(c.context=p,c.props=y,c.__P=e,c.__e=!1,A=B.__r,x=0,m)c.state=c.__s,c.__d=!1,A&&A(t),h=c.render(c.props,c.state,c.context),se.push.apply(c.__h,c._sb),c._sb=[];else do c.__d=!1,A&&A(t),h=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++x<25);c.state=c.__s,c.getChildContext!=null&&(i=F(F({},i),c.getChildContext())),m&&!_&&c.getSnapshotBeforeUpdate!=null&&(N=c.getSnapshotBeforeUpdate(d,b)),C=h!=null&&h.type===H&&h.key==null?Xt(h.props.children):h,l=Gt(e,fe(C)?C:[C],t,o,i,n,r,s,l,a,f),c.base=t.__e,t.__u&=-161,c.__h.length&&s.push(c),P&&(c.__E=c.__=null)}catch(E){if(t.__v=null,a||r!=null)if(E.then){for(t.__u|=a?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;r[r.indexOf(l)]=null,t.__e=l}else{for(v=r.length;v--;)Je(r[v]);ze(t)}else t.__e=o.__e,t.__k=o.__k,E.then||ze(t);B.__e(E,t,o)}else r==null&&t.__v==o.__v?(t.__k=o.__k,t.__e=o.__e):l=t.__e=pn(o.__e,t,o,i,n,r,s,a,f);return(h=B.diffed)&&h(t),128&t.__u?void 0:l}function ze(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ze))}function Wt(e,t,o){for(var i=0;i<o.length;i++)Ge(o[i],o[++i],o[++i]);B.__c&&B.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){B.__e(r,n.__v)}})}function Xt(e){return typeof e!="object"||e==null||e.__b>0?e:fe(e)?e.map(Xt):F({},e)}function pn(e,t,o,i,n,r,s,l,a){var f,h,c,_,d,b,N,P=o.props||ie,y=t.props,m=t.type;if(m=="svg"?n="http://www.w3.org/2000/svg":m=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),r!=null){for(f=0;f<r.length;f++)if((d=r[f])&&"setAttribute"in d==!!m&&(m?d.localName==m:d.nodeType==3)){e=d,r[f]=null;break}}if(e==null){if(m==null)return document.createTextNode(y);e=document.createElementNS(n,m,y.is&&y),l&&(B.__m&&B.__m(t,r),l=!1),r=null}if(m==null)P===y||l&&e.data==y||(e.data=y);else{if(r=r&&ue.call(e.childNodes),!l&&r!=null)for(P={},f=0;f<e.attributes.length;f++)P[(d=e.attributes[f]).name]=d.value;for(f in P)d=P[f],f=="dangerouslySetInnerHTML"?c=d:f=="children"||f in y||f=="value"&&"defaultValue"in y||f=="checked"&&"defaultChecked"in y||$(e,f,null,d,n);for(f in y)d=y[f],f=="children"?_=d:f=="dangerouslySetInnerHTML"?h=d:f=="value"?b=d:f=="checked"?N=d:l&&typeof d!="function"||P[f]===d||$(e,f,d,P[f],n);if(h)l||c&&(h.__html==c.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),Gt(t.type=="template"?e.content:e,fe(_)?_:[_],t,o,i,m=="foreignObject"?"http://www.w3.org/1999/xhtml":n,r,s,r?r[0]:o.__k&&G(o,0),l,a),r!=null)for(f=r.length;f--;)Je(r[f]);l||(f="value",m=="progress"&&b==null?e.removeAttribute("value"):b!=null&&(b!==e[f]||m=="progress"&&!b||m=="option"&&b!=P[f])&&$(e,f,b,P[f],n),f="checked",N!=null&&N!=e[f]&&$(e,f,N,P[f],n))}return e}function Ge(e,t,o){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&t==null||(e.__u=e(t))}else e.current=t}catch(n){B.__e(n,o)}}function Zt(e,t,o){var i,n;if(B.unmount&&B.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Ge(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(r){B.__e(r,t)}i.base=i.__P=null}if(i=e.__k)for(n=0;n<i.length;n++)i[n]&&Zt(i[n],t,o||typeof e.type!="function");o||Je(e.__e),e.__c=e.__=e.__e=void 0}function yn(e,t,o){return this.constructor(e,o)}function wn(e,t,o){var i,n,r,s;t==document&&(t=document.documentElement),B.__&&B.__(e,t),n=(i=!1)?null:t.__k,r=[],s=[],Ye(t,e=t.__k=hn(H,null,[e]),n||ie,ie,t.namespaceURI,n?null:t.firstChild?ue.call(t.childNodes):null,r,n?n.__e:t.firstChild,i,s),Wt(r,e,s)}ue=se.slice,B={__e:function(e,t,o,i){for(var n,r,s;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&r.getDerivedStateFromError!=null&&(n.setState(r.getDerivedStateFromError(e)),s=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,i||{}),s=n.__d),s)return n.__E=n}catch(l){e=l}throw e}},Ot=0,re.prototype.setState=function(e,t){var o;o=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=F({},this.state),typeof e=="function"&&(e=e(F({},o),this.props)),e&&F(o,e),e!=null&&this.__v&&(t&&this._sb.push(t),tt(this))},re.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),tt(this))},re.prototype.render=H,O=[],jt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vt=function(e,t){return e.__v.__b-t.__v.__b},le.__r=0,Jt=/(PointerCapture)$|Capture$/i,Ve=0,He=rt(!1),Ke=rt(!0);var bn=0;function u(e,t,o,i,n,r){t||(t={});var s,l,a=t;if("ref"in a)for(l in a={},t)l=="ref"?s=t[l]:a[l]=t[l];var f={type:e,props:a,key:o,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--bn,__i:-1,__u:0,__source:n,__self:r};if(typeof e=="function"&&(s=e.defaultProps))for(l in s)a[l]===void 0&&(a[l]=s[l]);return B.vnode&&B.vnode(f),f}var X,M,ge,ot,ae=0,$t=[],I=B,it=I.__b,st=I.__r,lt=I.diffed,at=I.__c,ct=I.unmount,ut=I.__;function Qe(e,t){I.__h&&I.__h(M,e,ae||t),ae=0;var o=M.__H||(M.__H={__:[],__h:[]});return e>=o.__.length&&o.__.push({}),o.__[e]}function L(e){return ae=1,xn(nn,e)}function xn(e,t,o){var i=Qe(X++,2);if(i.t=e,!i.__c&&(i.__=[nn(void 0,t),function(l){var a=i.__N?i.__N[0]:i.__[0],f=i.t(a,l);a!==f&&(i.__N=[f,i.__[1]],i.__c.setState({}))}],i.__c=M,!M.__f)){var n=function(l,a,f){if(!i.__c.__H)return!0;var h=i.__c.__H.__.filter(function(_){return _.__c});if(h.every(function(_){return!_.__N}))return!r||r.call(this,l,a,f);var c=i.__c.props!==l;return h.some(function(_){if(_.__N){var d=_.__[0];_.__=_.__N,_.__N=void 0,d!==_.__[0]&&(c=!0)}}),r&&r.call(this,l,a,f)||c};M.__f=!0;var r=M.shouldComponentUpdate,s=M.componentWillUpdate;M.componentWillUpdate=function(l,a,f){if(this.__e){var h=r;r=void 0,n(l,a,f),r=h}s&&s.call(this,l,a,f)},M.shouldComponentUpdate=n}return i.__N||i.__}function ce(e,t){var o=Qe(X++,3);!I.__s&&tn(o.__H,t)&&(o.__=e,o.u=t,M.__H.__h.push(o))}function en(e){return ae=5,vn(function(){return{current:e}},[])}function vn(e,t){var o=Qe(X++,7);return tn(o.__H,t)&&(o.__=e(),o.__H=t,o.__h=e),o.__}function Nn(){for(var e;e=$t.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(oe),t.__h.some(Oe),t.__h=[]}catch(o){t.__h=[],I.__e(o,e.__v)}}}I.__b=function(e){M=null,it&&it(e)},I.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ut&&ut(e,t)},I.__r=function(e){st&&st(e),X=0;var t=(M=e.__c).__H;t&&(ge===M?(t.__h=[],M.__h=[],t.__.some(function(o){o.__N&&(o.__=o.__N),o.u=o.__N=void 0})):(t.__h.some(oe),t.__h.some(Oe),t.__h=[],X=0)),ge=M},I.diffed=function(e){lt&<(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&($t.push(t)!==1&&ot===I.requestAnimationFrame||((ot=I.requestAnimationFrame)||Cn)(Nn)),t.__H.__.some(function(o){o.u&&(o.__H=o.u),o.u=void 0})),ge=M=null},I.__c=function(e,t){t.some(function(o){try{o.__h.some(oe),o.__h=o.__h.filter(function(i){return!i.__||Oe(i)})}catch(i){t.some(function(n){n.__h&&(n.__h=[])}),t=[],I.__e(i,o.__v)}}),at&&at(e,t)},I.unmount=function(e){ct&&ct(e);var t,o=e.__c;o&&o.__H&&(o.__H.__.some(function(i){try{oe(i)}catch(n){t=n}}),o.__H=void 0,t&&I.__e(t,o.__v))};var ft=typeof requestAnimationFrame=="function";function Cn(e){var t,o=function(){clearTimeout(i),ft&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(o,35);ft&&(t=requestAnimationFrame(o))}function oe(e){var t=M,o=e.__c;typeof o=="function"&&(e.__c=void 0,o()),M=t}function Oe(e){var t=M;e.__c=e.__(),M=t}function tn(e,t){return!e||e.length!==t.length||t.some(function(o,i){return o!==e[i]})}function nn(e,t){return typeof t=="function"?t(e):t}const En=[{icon:"download",label:"Preparing",desc:"Checking tunnel binary"},{icon:"cloud_sync",label:"Connecting",desc:"Creating session"},{icon:"lan",label:"Tunneling",desc:"Starting secure tunnel"},{icon:"check_circle",label:"Ready",desc:"Connected"}];function kn({currentStep:e}){const t=e-1;return u("div",{className:"glass-card p-5 flex flex-col gap-4",children:[u("span",{className:"text-xs text-white/50 font-medium uppercase tracking-wider",children:"Setting up connection"}),u("div",{className:"flex flex-col gap-3",children:En.map((o,i)=>{const n=i<t,r=i===t;return u("div",{className:"flex items-center gap-3",children:[u("div",{className:"w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",style:{background:n?"var(--brand-500)":r?"rgba(255,87,10,0.15)":"rgba(255,255,255,0.06)",border:r?"1.5px solid var(--brand-500)":"1.5px solid transparent"},children:n?u("span",{className:"material-symbols-outlined text-white",style:{fontSize:16},children:"check"}):r?u("span",{className:"flex gap-0.5 items-center",children:[0,1,2].map(s=>u("span",{className:"w-1 h-1 rounded-full bg-orange-400 dot-bounce",style:{animationDelay:`${s*.18}s`}},s))}):u("span",{className:"material-symbols-outlined text-white/20",style:{fontSize:16},children:o.icon})}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:`text-sm font-medium ${n?"text-white/60":r?"text-white":"text-white/25"}`,children:o.label}),u("p",{className:`text-xs mt-0.5 ${r?"text-white/40":"text-white/20"}`,children:o.desc})]}),n&&u("span",{className:"text-xs text-white/30 flex-shrink-0",children:"Done"}),r&&u("span",{className:"text-xs flex-shrink-0 px-2 py-0.5 rounded-full",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Running"})]},i)})})]})}function Sn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Y={},pe,dt;function Tn(){return dt||(dt=1,pe=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),pe}var ye={},z={},ht;function j(){if(ht)return z;ht=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return z.getSymbolSize=function(i){if(!i)throw new Error('"version" cannot be null or undefined');if(i<1||i>40)throw new Error('"version" should be in range from 1 to 40');return i*4+17},z.getSymbolTotalCodewords=function(i){return t[i]},z.getBCHDigit=function(o){let i=0;for(;o!==0;)i++,o>>>=1;return i},z.setToSJISFunction=function(i){if(typeof i!="function")throw new Error('"toSJISFunc" is not a valid function.');e=i},z.isKanjiModeEnabled=function(){return typeof e<"u"},z.toSJIS=function(i){return e(i)},z}var we={},_t;function We(){return _t||(_t=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+o)}}e.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},e.from=function(i,n){if(e.isValid(i))return i;try{return t(i)}catch{return n}}})(we)),we}var be,mt;function Pn(){if(mt)return be;mt=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const o=Math.floor(t/8);return(this.buffer[o]>>>7-t%8&1)===1},put:function(t,o){for(let i=0;i<o;i++)this.putBit((t>>>o-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const o=Math.floor(this.length/8);this.buffer.length<=o&&this.buffer.push(0),t&&(this.buffer[o]|=128>>>this.length%8),this.length++}},be=e,be}var xe,gt;function Rn(){if(gt)return xe;gt=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,o,i,n){const r=t*this.size+o;this.data[r]=i,n&&(this.reservedBit[r]=!0)},e.prototype.get=function(t,o){return this.data[t*this.size+o]},e.prototype.xor=function(t,o,i){this.data[t*this.size+o]^=i},e.prototype.isReserved=function(t,o){return this.reservedBit[t*this.size+o]},xe=e,xe}var ve={},pt;function An(){return pt||(pt=1,(function(e){const t=j().getSymbolSize;e.getRowColCoords=function(i){if(i===1)return[];const n=Math.floor(i/7)+2,r=t(i),s=r===145?26:Math.ceil((r-13)/(2*n-2))*2,l=[r-7];for(let a=1;a<n-1;a++)l[a]=l[a-1]-s;return l.push(6),l.reverse()},e.getPositions=function(i){const n=[],r=e.getRowColCoords(i),s=r.length;for(let l=0;l<s;l++)for(let a=0;a<s;a++)l===0&&a===0||l===0&&a===s-1||l===s-1&&a===0||n.push([r[l],r[a]]);return n}})(ve)),ve}var Ne={},yt;function Bn(){if(yt)return Ne;yt=1;const e=j().getSymbolSize,t=7;return Ne.getPositions=function(i){const n=e(i);return[[0,0],[n-t,0],[0,n-t]]},Ne}var Ce={},wt;function Mn(){return wt||(wt=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},e.from=function(n){return e.isValid(n)?parseInt(n,10):void 0},e.getPenaltyN1=function(n){const r=n.size;let s=0,l=0,a=0,f=null,h=null;for(let c=0;c<r;c++){l=a=0,f=h=null;for(let _=0;_<r;_++){let d=n.get(c,_);d===f?l++:(l>=5&&(s+=t.N1+(l-5)),f=d,l=1),d=n.get(_,c),d===h?a++:(a>=5&&(s+=t.N1+(a-5)),h=d,a=1)}l>=5&&(s+=t.N1+(l-5)),a>=5&&(s+=t.N1+(a-5))}return s},e.getPenaltyN2=function(n){const r=n.size;let s=0;for(let l=0;l<r-1;l++)for(let a=0;a<r-1;a++){const f=n.get(l,a)+n.get(l,a+1)+n.get(l+1,a)+n.get(l+1,a+1);(f===4||f===0)&&s++}return s*t.N2},e.getPenaltyN3=function(n){const r=n.size;let s=0,l=0,a=0;for(let f=0;f<r;f++){l=a=0;for(let h=0;h<r;h++)l=l<<1&2047|n.get(f,h),h>=10&&(l===1488||l===93)&&s++,a=a<<1&2047|n.get(h,f),h>=10&&(a===1488||a===93)&&s++}return s*t.N3},e.getPenaltyN4=function(n){let r=0;const s=n.data.length;for(let a=0;a<s;a++)r+=n.data[a];return Math.abs(Math.ceil(r*100/s/5)-10)*t.N4};function o(i,n,r){switch(i){case e.Patterns.PATTERN000:return(n+r)%2===0;case e.Patterns.PATTERN001:return n%2===0;case e.Patterns.PATTERN010:return r%3===0;case e.Patterns.PATTERN011:return(n+r)%3===0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2===0;case e.Patterns.PATTERN101:return n*r%2+n*r%3===0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2===0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}e.applyMask=function(n,r){const s=r.size;for(let l=0;l<s;l++)for(let a=0;a<s;a++)r.isReserved(a,l)||r.xor(a,l,o(n,a,l))},e.getBestMask=function(n,r){const s=Object.keys(e.Patterns).length;let l=0,a=1/0;for(let f=0;f<s;f++){r(f),e.applyMask(f,n);const h=e.getPenaltyN1(n)+e.getPenaltyN2(n)+e.getPenaltyN3(n)+e.getPenaltyN4(n);e.applyMask(f,n),h<a&&(a=h,l=f)}return l}})(Ce)),Ce}var ee={},bt;function rn(){if(bt)return ee;bt=1;const e=We(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],o=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return ee.getBlocksCount=function(n,r){switch(r){case e.L:return t[(n-1)*4+0];case e.M:return t[(n-1)*4+1];case e.Q:return t[(n-1)*4+2];case e.H:return t[(n-1)*4+3];default:return}},ee.getTotalCodewordsCount=function(n,r){switch(r){case e.L:return o[(n-1)*4+0];case e.M:return o[(n-1)*4+1];case e.Q:return o[(n-1)*4+2];case e.H:return o[(n-1)*4+3];default:return}},ee}var Ee={},W={},xt;function In(){if(xt)return W;xt=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let i=1;for(let n=0;n<255;n++)e[n]=i,t[i]=n,i<<=1,i&256&&(i^=285);for(let n=255;n<512;n++)e[n]=e[n-255]})(),W.log=function(i){if(i<1)throw new Error("log("+i+")");return t[i]},W.exp=function(i){return e[i]},W.mul=function(i,n){return i===0||n===0?0:e[t[i]+t[n]]},W}var vt;function Ln(){return vt||(vt=1,(function(e){const t=In();e.mul=function(i,n){const r=new Uint8Array(i.length+n.length-1);for(let s=0;s<i.length;s++)for(let l=0;l<n.length;l++)r[s+l]^=t.mul(i[s],n[l]);return r},e.mod=function(i,n){let r=new Uint8Array(i);for(;r.length-n.length>=0;){const s=r[0];for(let a=0;a<n.length;a++)r[a]^=t.mul(n[a],s);let l=0;for(;l<r.length&&r[l]===0;)l++;r=r.slice(l)}return r},e.generateECPolynomial=function(i){let n=new Uint8Array([1]);for(let r=0;r<i;r++)n=e.mul(n,new Uint8Array([1,t.exp(r)]));return n}})(Ee)),Ee}var ke,Nt;function Dn(){if(Nt)return ke;Nt=1;const e=Ln();function t(o){this.genPoly=void 0,this.degree=o,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(i){this.degree=i,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(i){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(i.length+this.degree);n.set(i);const r=e.mod(n,this.genPoly),s=this.degree-r.length;if(s>0){const l=new Uint8Array(this.degree);return l.set(r,s),l}return r},ke=t,ke}var Se={},Te={},Pe={},Ct;function on(){return Ct||(Ct=1,Pe.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),Pe}var D={},Et;function sn(){if(Et)return D;Et=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let o="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";o=o.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+o+`)(?:.|[\r
|
|
2
|
-
]))+`;D.KANJI=new RegExp(o,"g"),D.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),D.BYTE=new RegExp(i,"g"),D.NUMERIC=new RegExp(e,"g"),D.ALPHANUMERIC=new RegExp(t,"g");const n=new RegExp("^"+o+"$"),r=new RegExp("^"+e+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return D.testKanji=function(a){return n.test(a)},D.testNumeric=function(a){return r.test(a)},D.testAlphanumeric=function(a){return s.test(a)},D}var kt;function V(){return kt||(kt=1,(function(e){const t=on(),o=sn();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(r,s){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?r.ccBits[0]:s<27?r.ccBits[1]:r.ccBits[2]},e.getBestModeForData=function(r){return o.testNumeric(r)?e.NUMERIC:o.testAlphanumeric(r)?e.ALPHANUMERIC:o.testKanji(r)?e.KANJI:e.BYTE},e.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},e.isValid=function(r){return r&&r.bit&&r.ccBits};function i(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+n)}}e.from=function(r,s){if(e.isValid(r))return r;try{return i(r)}catch{return s}}})(Te)),Te}var St;function Un(){return St||(St=1,(function(e){const t=j(),o=rn(),i=We(),n=V(),r=on(),s=7973,l=t.getBCHDigit(s);function a(_,d,b){for(let N=1;N<=40;N++)if(d<=e.getCapacity(N,b,_))return N}function f(_,d){return n.getCharCountIndicator(_,d)+4}function h(_,d){let b=0;return _.forEach(function(N){const P=f(N.mode,d);b+=P+N.getBitsLength()}),b}function c(_,d){for(let b=1;b<=40;b++)if(h(_,b)<=e.getCapacity(b,d,n.MIXED))return b}e.from=function(d,b){return r.isValid(d)?parseInt(d,10):b},e.getCapacity=function(d,b,N){if(!r.isValid(d))throw new Error("Invalid QR Code version");typeof N>"u"&&(N=n.BYTE);const P=t.getSymbolTotalCodewords(d),y=o.getTotalCodewordsCount(d,b),m=(P-y)*8;if(N===n.MIXED)return m;const g=m-f(N,d);switch(N){case n.NUMERIC:return Math.floor(g/10*3);case n.ALPHANUMERIC:return Math.floor(g/11*2);case n.KANJI:return Math.floor(g/13);case n.BYTE:default:return Math.floor(g/8)}},e.getBestVersionForData=function(d,b){let N;const P=i.from(b,i.M);if(Array.isArray(d)){if(d.length>1)return c(d,P);if(d.length===0)return 1;N=d[0]}else N=d;return a(N.mode,N.getLength(),P)},e.getEncodedBits=function(d){if(!r.isValid(d)||d<7)throw new Error("Invalid QR Code version");let b=d<<12;for(;t.getBCHDigit(b)-l>=0;)b^=s<<t.getBCHDigit(b)-l;return d<<12|b}})(Se)),Se}var Re={},Tt;function qn(){if(Tt)return Re;Tt=1;const e=j(),t=1335,o=21522,i=e.getBCHDigit(t);return Re.getEncodedBits=function(r,s){const l=r.bit<<3|s;let a=l<<10;for(;e.getBCHDigit(a)-i>=0;)a^=t<<e.getBCHDigit(a)-i;return(l<<10|a)^o},Re}var Ae={},Be,Pt;function Fn(){if(Pt)return Be;Pt=1;const e=V();function t(o){this.mode=e.NUMERIC,this.data=o.toString()}return t.getBitsLength=function(i){return 10*Math.floor(i/3)+(i%3?i%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(i){let n,r,s;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),s=parseInt(r,10),i.put(s,10);const l=this.data.length-n;l>0&&(r=this.data.substr(n),s=parseInt(r,10),i.put(s,l*3+1))},Be=t,Be}var Me,Rt;function Hn(){if(Rt)return Me;Rt=1;const e=V(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function o(i){this.mode=e.ALPHANUMERIC,this.data=i}return o.getBitsLength=function(n){return 11*Math.floor(n/2)+6*(n%2)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(n){let r;for(r=0;r+2<=this.data.length;r+=2){let s=t.indexOf(this.data[r])*45;s+=t.indexOf(this.data[r+1]),n.put(s,11)}this.data.length%2&&n.put(t.indexOf(this.data[r]),6)},Me=o,Me}var Ie,At;function Kn(){if(At)return Ie;At=1;const e=V();function t(o){this.mode=e.BYTE,typeof o=="string"?this.data=new TextEncoder().encode(o):this.data=new Uint8Array(o)}return t.getBitsLength=function(i){return i*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(o){for(let i=0,n=this.data.length;i<n;i++)o.put(this.data[i],8)},Ie=t,Ie}var Le,Bt;function zn(){if(Bt)return Le;Bt=1;const e=V(),t=j();function o(i){this.mode=e.KANJI,this.data=i}return o.getBitsLength=function(n){return n*13},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(i){let n;for(n=0;n<this.data.length;n++){let r=t.toSJIS(this.data[n]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[n]+`
|
|
3
|
-
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),i.put(r,13)}},Le=o,Le}var De={exports:{}},Mt;function On(){return Mt||(Mt=1,(function(e){var t={single_source_shortest_paths:function(o,i,n){var r={},s={};s[i]=0;var l=t.PriorityQueue.make();l.push(i,0);for(var a,f,h,c,_,d,b,N,P;!l.empty();){a=l.pop(),f=a.value,c=a.cost,_=o[f]||{};for(h in _)_.hasOwnProperty(h)&&(d=_[h],b=c+d,N=s[h],P=typeof s[h]>"u",(P||N>b)&&(s[h]=b,l.push(h,b),r[h]=f))}if(typeof n<"u"&&typeof s[n]>"u"){var y=["Could not find a path from ",i," to ",n,"."].join("");throw new Error(y)}return r},extract_shortest_path_from_predecessor_list:function(o,i){for(var n=[],r=i;r;)n.push(r),o[r],r=o[r];return n.reverse(),n},find_path:function(o,i,n){var r=t.single_source_shortest_paths(o,i,n);return t.extract_shortest_path_from_predecessor_list(r,n)},PriorityQueue:{make:function(o){var i=t.PriorityQueue,n={},r;o=o||{};for(r in i)i.hasOwnProperty(r)&&(n[r]=i[r]);return n.queue=[],n.sorter=o.sorter||i.default_sorter,n},default_sorter:function(o,i){return o.cost-i.cost},push:function(o,i){var n={value:o,cost:i};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(De)),De.exports}var It;function jn(){return It||(It=1,(function(e){const t=V(),o=Fn(),i=Hn(),n=Kn(),r=zn(),s=sn(),l=j(),a=On();function f(y){return unescape(encodeURIComponent(y)).length}function h(y,m,g){const p=[];let A;for(;(A=y.exec(g))!==null;)p.push({data:A[0],index:A.index,mode:m,length:A[0].length});return p}function c(y){const m=h(s.NUMERIC,t.NUMERIC,y),g=h(s.ALPHANUMERIC,t.ALPHANUMERIC,y);let p,A;return l.isKanjiModeEnabled()?(p=h(s.BYTE,t.BYTE,y),A=h(s.KANJI,t.KANJI,y)):(p=h(s.BYTE_KANJI,t.BYTE,y),A=[]),m.concat(g,p,A).sort(function(C,v){return C.index-v.index}).map(function(C){return{data:C.data,mode:C.mode,length:C.length}})}function _(y,m){switch(m){case t.NUMERIC:return o.getBitsLength(y);case t.ALPHANUMERIC:return i.getBitsLength(y);case t.KANJI:return r.getBitsLength(y);case t.BYTE:return n.getBitsLength(y)}}function d(y){return y.reduce(function(m,g){const p=m.length-1>=0?m[m.length-1]:null;return p&&p.mode===g.mode?(m[m.length-1].data+=g.data,m):(m.push(g),m)},[])}function b(y){const m=[];for(let g=0;g<y.length;g++){const p=y[g];switch(p.mode){case t.NUMERIC:m.push([p,{data:p.data,mode:t.ALPHANUMERIC,length:p.length},{data:p.data,mode:t.BYTE,length:p.length}]);break;case t.ALPHANUMERIC:m.push([p,{data:p.data,mode:t.BYTE,length:p.length}]);break;case t.KANJI:m.push([p,{data:p.data,mode:t.BYTE,length:f(p.data)}]);break;case t.BYTE:m.push([{data:p.data,mode:t.BYTE,length:f(p.data)}])}}return m}function N(y,m){const g={},p={start:{}};let A=["start"];for(let x=0;x<y.length;x++){const C=y[x],v=[];for(let w=0;w<C.length;w++){const E=C[w],k=""+x+w;v.push(k),g[k]={node:E,lastCount:0},p[k]={};for(let T=0;T<A.length;T++){const S=A[T];g[S]&&g[S].node.mode===E.mode?(p[S][k]=_(g[S].lastCount+E.length,E.mode)-_(g[S].lastCount,E.mode),g[S].lastCount+=E.length):(g[S]&&(g[S].lastCount=E.length),p[S][k]=_(E.length,E.mode)+4+t.getCharCountIndicator(E.mode,m))}}A=v}for(let x=0;x<A.length;x++)p[A[x]].end=0;return{map:p,table:g}}function P(y,m){let g;const p=t.getBestModeForData(y);if(g=t.from(m,p),g!==t.BYTE&&g.bit<p.bit)throw new Error('"'+y+'" cannot be encoded with mode '+t.toString(g)+`.
|
|
4
|
-
Suggested mode is: `+t.toString(p));switch(g===t.KANJI&&!l.isKanjiModeEnabled()&&(g=t.BYTE),g){case t.NUMERIC:return new o(y);case t.ALPHANUMERIC:return new i(y);case t.KANJI:return new r(y);case t.BYTE:return new n(y)}}e.fromArray=function(m){return m.reduce(function(g,p){return typeof p=="string"?g.push(P(p,null)):p.data&&g.push(P(p.data,p.mode)),g},[])},e.fromString=function(m,g){const p=c(m,l.isKanjiModeEnabled()),A=b(p),x=N(A,g),C=a.find_path(x.map,"start","end"),v=[];for(let w=1;w<C.length-1;w++)v.push(x.table[C[w]].node);return e.fromArray(d(v))},e.rawSplit=function(m){return e.fromArray(c(m,l.isKanjiModeEnabled()))}})(Ae)),Ae}var Lt;function Vn(){if(Lt)return ye;Lt=1;const e=j(),t=We(),o=Pn(),i=Rn(),n=An(),r=Bn(),s=Mn(),l=rn(),a=Dn(),f=Un(),h=qn(),c=V(),_=jn();function d(x,C){const v=x.size,w=r.getPositions(C);for(let E=0;E<w.length;E++){const k=w[E][0],T=w[E][1];for(let S=-1;S<=7;S++)if(!(k+S<=-1||v<=k+S))for(let R=-1;R<=7;R++)T+R<=-1||v<=T+R||(S>=0&&S<=6&&(R===0||R===6)||R>=0&&R<=6&&(S===0||S===6)||S>=2&&S<=4&&R>=2&&R<=4?x.set(k+S,T+R,!0,!0):x.set(k+S,T+R,!1,!0))}}function b(x){const C=x.size;for(let v=8;v<C-8;v++){const w=v%2===0;x.set(v,6,w,!0),x.set(6,v,w,!0)}}function N(x,C){const v=n.getPositions(C);for(let w=0;w<v.length;w++){const E=v[w][0],k=v[w][1];for(let T=-2;T<=2;T++)for(let S=-2;S<=2;S++)T===-2||T===2||S===-2||S===2||T===0&&S===0?x.set(E+T,k+S,!0,!0):x.set(E+T,k+S,!1,!0)}}function P(x,C){const v=x.size,w=f.getEncodedBits(C);let E,k,T;for(let S=0;S<18;S++)E=Math.floor(S/3),k=S%3+v-8-3,T=(w>>S&1)===1,x.set(E,k,T,!0),x.set(k,E,T,!0)}function y(x,C,v){const w=x.size,E=h.getEncodedBits(C,v);let k,T;for(k=0;k<15;k++)T=(E>>k&1)===1,k<6?x.set(k,8,T,!0):k<8?x.set(k+1,8,T,!0):x.set(w-15+k,8,T,!0),k<8?x.set(8,w-k-1,T,!0):k<9?x.set(8,15-k-1+1,T,!0):x.set(8,15-k-1,T,!0);x.set(w-8,8,1,!0)}function m(x,C){const v=x.size;let w=-1,E=v-1,k=7,T=0;for(let S=v-1;S>0;S-=2)for(S===6&&S--;;){for(let R=0;R<2;R++)if(!x.isReserved(E,S-R)){let K=!1;T<C.length&&(K=(C[T]>>>k&1)===1),x.set(E,S-R,K),k--,k===-1&&(T++,k=7)}if(E+=w,E<0||v<=E){E-=w,w=-w;break}}}function g(x,C,v){const w=new o;v.forEach(function(R){w.put(R.mode.bit,4),w.put(R.getLength(),c.getCharCountIndicator(R.mode,x)),R.write(w)});const E=e.getSymbolTotalCodewords(x),k=l.getTotalCodewordsCount(x,C),T=(E-k)*8;for(w.getLengthInBits()+4<=T&&w.put(0,4);w.getLengthInBits()%8!==0;)w.putBit(0);const S=(T-w.getLengthInBits())/8;for(let R=0;R<S;R++)w.put(R%2?17:236,8);return p(w,x,C)}function p(x,C,v){const w=e.getSymbolTotalCodewords(C),E=l.getTotalCodewordsCount(C,v),k=w-E,T=l.getBlocksCount(C,v),S=w%T,R=T-S,K=Math.floor(w/T),Q=Math.floor(k/T),cn=Q+1,Xe=K-Q,un=new a(Xe);let de=0;const Z=new Array(T),Ze=new Array(T);let he=0;const fn=new Uint8Array(x.buffer);for(let J=0;J<T;J++){const me=J<R?Q:cn;Z[J]=fn.slice(de,de+me),Ze[J]=un.encode(Z[J]),de+=me,he=Math.max(he,me)}const _e=new Uint8Array(w);let $e=0,U,q;for(U=0;U<he;U++)for(q=0;q<T;q++)U<Z[q].length&&(_e[$e++]=Z[q][U]);for(U=0;U<Xe;U++)for(q=0;q<T;q++)_e[$e++]=Ze[q][U];return _e}function A(x,C,v,w){let E;if(Array.isArray(x))E=_.fromArray(x);else if(typeof x=="string"){let K=C;if(!K){const Q=_.rawSplit(x);K=f.getBestVersionForData(Q,v)}E=_.fromString(x,K||40)}else throw new Error("Invalid data");const k=f.getBestVersionForData(E,v);if(!k)throw new Error("The amount of data is too big to be stored in a QR Code");if(!C)C=k;else if(C<k)throw new Error(`
|
|
5
|
-
The chosen QR Code version cannot contain this amount of data.
|
|
6
|
-
Minimum version required to store current data is: `+k+`.
|
|
7
|
-
`);const T=g(C,v,E),S=e.getSymbolSize(C),R=new i(S);return d(R,C),b(R),N(R,C),y(R,v,0),C>=7&&P(R,C),m(R,T),isNaN(w)&&(w=s.getBestMask(R,y.bind(null,R,v))),s.applyMask(w,R),y(R,v,w),{modules:R,version:C,errorCorrectionLevel:v,maskPattern:w,segments:E}}return ye.create=function(C,v){if(typeof C>"u"||C==="")throw new Error("No input text");let w=t.M,E,k;return typeof v<"u"&&(w=t.from(v.errorCorrectionLevel,t.M),E=f.from(v.version),k=s.from(v.maskPattern),v.toSJISFunc&&e.setToSJISFunction(v.toSJISFunc)),A(C,E,w,k)},ye}var Ue={},qe={},Dt;function ln(){return Dt||(Dt=1,(function(e){function t(o){if(typeof o=="number"&&(o=o.toString()),typeof o!="string")throw new Error("Color should be defined as hex string");let i=o.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+o);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(r){return[r,r]}))),i.length===6&&i.push("F","F");const n=parseInt(i.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+i.slice(0,6).join("")}}e.getOptions=function(i){i||(i={}),i.color||(i.color={});const n=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,r=i.width&&i.width>=21?i.width:void 0,s=i.scale||4;return{width:r,scale:r?4:s,margin:n,color:{dark:t(i.color.dark||"#000000ff"),light:t(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},e.getScale=function(i,n){return n.width&&n.width>=i+n.margin*2?n.width/(i+n.margin*2):n.scale},e.getImageWidth=function(i,n){const r=e.getScale(i,n);return Math.floor((i+n.margin*2)*r)},e.qrToImageData=function(i,n,r){const s=n.modules.size,l=n.modules.data,a=e.getScale(s,r),f=Math.floor((s+r.margin*2)*a),h=r.margin*a,c=[r.color.light,r.color.dark];for(let _=0;_<f;_++)for(let d=0;d<f;d++){let b=(_*f+d)*4,N=r.color.light;if(_>=h&&d>=h&&_<f-h&&d<f-h){const P=Math.floor((_-h)/a),y=Math.floor((d-h)/a);N=c[l[P*s+y]?1:0]}i[b++]=N.r,i[b++]=N.g,i[b++]=N.b,i[b]=N.a}}})(qe)),qe}var Ut;function Jn(){return Ut||(Ut=1,(function(e){const t=ln();function o(n,r,s){n.clearRect(0,0,r.width,r.height),r.style||(r.style={}),r.height=s,r.width=s,r.style.height=s+"px",r.style.width=s+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(r,s,l){let a=l,f=s;typeof a>"u"&&(!s||!s.getContext)&&(a=s,s=void 0),s||(f=i()),a=t.getOptions(a);const h=t.getImageWidth(r.modules.size,a),c=f.getContext("2d"),_=c.createImageData(h,h);return t.qrToImageData(_.data,r,a),o(c,f,h),c.putImageData(_,0,0),f},e.renderToDataURL=function(r,s,l){let a=l;typeof a>"u"&&(!s||!s.getContext)&&(a=s,s=void 0),a||(a={});const f=e.render(r,s,a),h=a.type||"image/png",c=a.rendererOpts||{};return f.toDataURL(h,c.quality)}})(Ue)),Ue}var Fe={},qt;function Yn(){if(qt)return Fe;qt=1;const e=ln();function t(n,r){const s=n.a/255,l=r+'="'+n.hex+'"';return s<1?l+" "+r+'-opacity="'+s.toFixed(2).slice(1)+'"':l}function o(n,r,s){let l=n+r;return typeof s<"u"&&(l+=" "+s),l}function i(n,r,s){let l="",a=0,f=!1,h=0;for(let c=0;c<n.length;c++){const _=Math.floor(c%r),d=Math.floor(c/r);!_&&!f&&(f=!0),n[c]?(h++,c>0&&_>0&&n[c-1]||(l+=f?o("M",_+s,.5+d+s):o("m",a,0),a=0,f=!1),_+1<r&&n[c+1]||(l+=o("h",h),h=0)):a++}return l}return Fe.render=function(r,s,l){const a=e.getOptions(s),f=r.modules.size,h=r.modules.data,c=f+a.margin*2,_=a.color.light.a?"<path "+t(a.color.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",d="<path "+t(a.color.dark,"stroke")+' d="'+i(h,f,a.margin)+'"/>',b='viewBox="0 0 '+c+" "+c+'"',P='<svg xmlns="http://www.w3.org/2000/svg" '+(a.width?'width="'+a.width+'" height="'+a.width+'" ':"")+b+' shape-rendering="crispEdges">'+_+d+`</svg>
|
|
8
|
-
`;return typeof l=="function"&&l(null,P),P},Fe}var Ft;function Gn(){if(Ft)return Y;Ft=1;const e=Tn(),t=Vn(),o=Jn(),i=Yn();function n(r,s,l,a,f){const h=[].slice.call(arguments,1),c=h.length,_=typeof h[c-1]=="function";if(!_&&!e())throw new Error("Callback required as last argument");if(_){if(c<2)throw new Error("Too few arguments provided");c===2?(f=l,l=s,s=a=void 0):c===3&&(s.getContext&&typeof f>"u"?(f=a,a=void 0):(f=a,a=l,l=s,s=void 0))}else{if(c<1)throw new Error("Too few arguments provided");return c===1?(l=s,s=a=void 0):c===2&&!s.getContext&&(a=l,l=s,s=void 0),new Promise(function(d,b){try{const N=t.create(l,a);d(r(N,s,a))}catch(N){b(N)}})}try{const d=t.create(l,a);f(null,r(d,s,a))}catch(d){f(d)}}return Y.create=t.create,Y.toCanvas=n.bind(null,o.render),Y.toDataURL=n.bind(null,o.renderToDataURL),Y.toString=n.bind(null,function(r,s,l){return i.render(r,l)}),Y}var Qn=Gn();const Wn=Sn(Qn);function je({message:e,confirmLabel:t="Confirm",confirmDanger:o=!1,onConfirm:i,onCancel:n}){return u("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0,0,0,0.6)"},children:u("div",{className:"glass-card p-5 flex flex-col gap-4 w-72",children:[u("p",{className:"text-sm text-white text-center",children:e}),u("div",{className:"flex gap-2",children:[u("button",{onClick:n,className:"glass-btn flex-1 py-2 text-sm text-white/60 hover:text-white",children:"Cancel"}),u("button",{onClick:i,className:"flex-1 py-2 text-sm font-semibold rounded-xl",style:{background:o?"rgba(220,53,69,0.8)":"var(--brand-500)",color:"#fff"},children:t})]})]})})}const Ht="9remote.cc";function Xn(e){if(e<=0)return"Expired";const t=Math.floor(e/1e3),o=Math.floor(t/60),i=t%60;return`${String(o).padStart(2,"0")}:${String(i).padStart(2,"0")}`}function te({icon:e,onClick:t,title:o,danger:i}){return u("button",{onClick:t,title:o,className:"glass-btn w-7 h-7 flex items-center justify-center flex-shrink-0 text-white/50 hover:text-white",style:i?{color:"rgba(255,100,100,0.7)"}:{},children:u("span",{className:"material-symbols-outlined",style:{fontSize:15},children:e})})}function Zn({qrUrl:e,oneTimeKey:t,oneTimeKeyExpiresAt:o,permanentKey:i,onGenerateOneTimeKey:n,onRegenerateKey:r}){const s=en(null),[l,a]=L(null),[f,h]=L(null),[c,_]=L(null);ce(()=>{!e||!s.current||Wn.toCanvas(s.current,e,{width:160,margin:1,color:{dark:"#0f1923",light:"#ffffff"}}).catch(()=>{})},[e]),ce(()=>{if(!o){a(null);return}const b=()=>a(o-Date.now());b();const N=setInterval(b,1e3);return()=>clearInterval(N)},[o]);const d=(b,N)=>{navigator.clipboard.writeText(b).catch(()=>{}),h(N),setTimeout(()=>h(null),2e3)};return u(H,{children:[c==="oneTime"&&u(je,{message:"Generate a new one-time key? The current one will expire immediately.",confirmLabel:"Generate",onConfirm:()=>{_(null),n==null||n()},onCancel:()=>_(null)}),c==="regen"&&u(je,{message:"Regenerate permanent key? All existing sessions will be disconnected.",confirmLabel:"Regenerate",confirmDanger:!0,onConfirm:()=>{_(null),r==null||r()},onCancel:()=>_(null)}),u("div",{className:"glass-card p-5 flex flex-col items-center gap-4",children:[u("div",{className:"w-44 h-44 rounded-xl overflow-hidden bg-white p-2 flex items-center justify-center flex-shrink-0",children:e?u("canvas",{ref:s}):u("span",{className:"material-symbols-outlined text-gray-300 text-6xl",children:"qr_code_2"})}),u("a",{href:`https://${Ht}/login`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 hover:opacity-80 transition-opacity",children:[u("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 flex-shrink-0"}),u("span",{className:"text-xs text-white/60 font-medium",children:[Ht,"/login"]})]}),u("div",{className:"w-full h-px bg-white/5"}),u("div",{className:"w-full flex flex-col gap-1.5",children:[u("div",{className:"flex items-center justify-between px-0.5",children:[u("span",{className:"text-xs font-medium text-white/50",children:"One-Time Key"}),u("span",{className:"text-xs text-white/30",children:"Single use · expires"})]}),u("div",{className:"w-full flex items-center gap-2 dark-card px-3 py-2.5",children:[u("span",{className:"material-symbols-outlined text-white/30 flex-shrink-0",style:{fontSize:16},children:"timer"}),u("span",{className:"flex-1 font-mono font-bold tracking-[0.18em] text-base truncate",style:{color:t?"var(--brand-500)":"rgba(255,255,255,0.15)"},children:t||"• • • • • •"}),l!==null&&u("span",{className:`text-xs font-mono flex-shrink-0 ${l<=0?"text-red-400":"text-white/40"}`,children:Xn(l)}),t&&u(te,{icon:f==="oneTime"?"check":"content_copy",onClick:()=>d(t,"oneTime"),title:"Copy one-time key"}),u(te,{icon:"refresh",onClick:()=>_("oneTime"),title:"New one-time key"})]})]}),u("div",{className:"w-full flex flex-col gap-1.5",children:[u("div",{className:"flex items-center justify-between px-0.5",children:[u("span",{className:"text-xs font-medium text-white/50",children:"Permanent Key"}),u("span",{className:"text-xs text-white/30",children:"Reusable · no expiry"})]}),u("div",{className:"w-full flex items-center gap-2 dark-card px-3 py-2.5",children:[u("span",{className:"material-symbols-outlined text-white/30 flex-shrink-0",style:{fontSize:16},children:"key"}),u("span",{className:"flex-1 font-mono text-xs text-white/50 truncate",children:i||"— not set —"}),i&&u(te,{icon:f==="permanent"?"check":"content_copy",onClick:()=>d(i,"permanent"),title:"Copy permanent key"}),u(te,{icon:"autorenew",onClick:()=>_("regen"),title:"Regenerate permanent key",danger:!0})]})]})]})]})}const $n="https://docs.9remote.cc/",an={screenRecording:{label:"Screen Recording",icon:"screenshot_monitor",desc:"Capture screen content"},accessibility:{label:"Accessibility",icon:"accessibility_new",desc:"Control mouse & keyboard"}};function er({type:e,granted:t,onRequest:o}){const i=an[e]||{label:e,desc:""};return u("div",{className:"flex items-center gap-3 py-2 border-b border-white/5 last:border-0",children:[u("span",{className:`material-symbols-outlined flex-shrink-0 ${t?"text-green-400":"text-white/30"}`,style:{fontSize:18},children:t?"check_circle":"cancel"}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:`text-xs font-medium ${t?"text-white/80":"text-white/50"}`,children:i.label}),u("p",{className:"text-[10px] text-white/30 leading-4",children:i.desc})]}),!t&&u("button",{onClick:()=>o(e),className:"flex-shrink-0 text-xs px-2.5 py-1 rounded-lg font-medium",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Grant"})]})}function tr(){return u("div",{className:"glass-card p-4 flex items-center gap-3",children:[u("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(255,87,10,0.15)"},children:u("span",{className:"material-symbols-outlined",style:{fontSize:20,color:"var(--brand-400)"},children:"terminal"})}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:"text-sm font-semibold text-white",children:"Remote Terminal"}),u("p",{className:"text-xs text-white/40",children:"Full shell access · always on"})]}),u("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-full",style:{background:"rgba(74,222,128,0.1)"},children:[u("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400"}),u("span",{className:"text-xs text-green-400 font-medium",children:"On"})]})]})}function nr({enabled:e,onToggle:t,permissions:o,onRequestPermission:i}){const n=Object.entries(an);return u("div",{className:"glass-card p-4 flex flex-col gap-3",children:[u("div",{className:"flex items-center gap-3",children:[u("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:e?"rgba(255,87,10,0.15)":"rgba(255,255,255,0.05)"},children:u("span",{className:"material-symbols-outlined",style:{fontSize:20,color:e?"var(--brand-400)":"rgba(255,255,255,0.25)"},children:"desktop_windows"})}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:"text-sm font-semibold text-white",children:"Remote Desktop"}),u("p",{className:"text-xs text-white/40",children:"Control screen, mouse & keyboard"})]}),u("button",{onClick:t,className:"flex-shrink-0 w-11 h-6 rounded-full transition-all relative",style:{background:e?"var(--brand-500)":"rgba(255,255,255,0.1)"},children:u("span",{className:"absolute top-0.5 w-5 h-5 rounded-full bg-white transition-all",style:{left:e?"calc(100% - 22px)":"2px",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"}})})]}),e&&u("div",{className:"flex flex-col border-t border-white/5 pt-2",children:[u("p",{className:"text-[10px] text-white/30 uppercase tracking-wider mb-1",children:"System Permissions"}),n.map(([r])=>u(er,{type:r,granted:(o==null?void 0:o[r])??!1,onRequest:i},r))]})]})}function rr({version:e}){return e?u("div",{className:"px-5 py-2 flex items-center gap-2 border-b",style:{background:"rgba(255,87,10,0.08)",borderColor:"rgba(255,87,10,0.2)"},children:[u("span",{className:"material-symbols-outlined text-sm flex-shrink-0",style:{color:"var(--brand-400)"},children:"system_update"}),u("span",{className:"text-xs flex-1",style:{color:"var(--brand-400)"},children:["Version ",e," available"]}),u("button",{onClick:()=>fetch("/api/update",{method:"POST"}).catch(()=>{}),className:"flex-shrink-0 text-xs px-2 py-0.5 rounded font-medium",style:{background:"rgba(255,87,10,0.15)",color:"var(--brand-400)"},children:"Update"})]}):null}const or=[{icon:"terminal",label:"Terminal",desc:"Full shell access"},{icon:"desktop_windows",label:"Desktop",desc:"Remote screen control"},{icon:"folder_open",label:"Files",desc:"Browse & edit files"}],ir=[{icon:"qr_code_scanner",text:"Scan QR to connect instantly"},{icon:"wifi_off",text:"No port forwarding needed"},{icon:"devices",text:"Works on any device"}];function sr({onStart:e}){const[t,o]=L(!1),i=()=>{o(!0),e()};return u("div",{className:"flex-1 flex flex-col items-center justify-between px-6 py-6 overflow-y-auto",children:[u("div",{className:"flex flex-col items-center gap-2 text-center mt-2",children:[u("div",{className:"w-14 h-14 rounded-2xl flex items-center justify-center mb-1",style:{background:"var(--brand-500)",boxShadow:"0 8px 32px rgba(255,87,10,0.35)"},children:u("span",{className:"material-symbols-outlined text-white",style:{fontSize:30},children:"terminal"})}),u("h1",{className:"text-lg font-bold text-white tracking-tight",children:"9Remote"}),u("p",{className:"text-xs text-white/50 leading-5 max-w-[220px]",children:"Access your terminal, desktop & files from anywhere"})]}),u("div",{className:"flex gap-2 w-full mt-5",children:or.map(n=>u("div",{className:"flex-1 dark-card flex flex-col items-center gap-1.5 py-3 px-1",children:[u("span",{className:"material-symbols-outlined text-white/70",style:{fontSize:22,color:"var(--brand-400)"},children:n.icon}),u("p",{className:"text-xs font-semibold text-white",children:n.label}),u("p",{className:"text-[10px] text-white/40 text-center leading-4",children:n.desc})]},n.label))}),u("div",{className:"flex flex-col gap-2 w-full mt-4",children:ir.map(n=>u("div",{className:"flex items-center gap-2.5",children:[u("span",{className:"material-symbols-outlined flex-shrink-0",style:{fontSize:16,color:"var(--brand-400)"},children:n.icon}),u("span",{className:"text-xs text-white/60",children:n.text})]},n.text))}),u("button",{onClick:t?void 0:i,disabled:t,className:"btn-primary w-full py-3.5 flex items-center justify-center gap-2 text-sm font-semibold mt-6",style:{borderRadius:"var(--radius-brand)",opacity:t?.7:1},children:t?u(H,{children:[u("span",{className:"flex gap-0.5 items-center",children:[0,1,2].map(n=>u("span",{className:"w-1.5 h-1.5 rounded-full bg-white dot-bounce",style:{animationDelay:`${n*.18}s`}},n))}),"Connecting..."]}):u(H,{children:[u("span",{className:"material-symbols-outlined text-base",children:"play_arrow"}),"Connect"]})})]})}function lr({conn:e}){return u("div",{className:"flex items-center gap-3 py-2 border-b border-white/5 last:border-0",children:[u("div",{className:"w-2 h-2 rounded-full bg-green-400 flex-shrink-0"}),u("div",{className:"flex-1 min-w-0",children:[u("p",{className:"text-xs text-white font-medium truncate",children:e.ip||"Unknown"}),u("p",{className:"text-xs text-white/30",children:e.connectedAt?new Date(e.connectedAt).toLocaleTimeString():""})]}),u("span",{className:"text-xs text-white/30",children:e.type||"ws"})]})}function ar({step:e,tunnelUrl:t,oneTimeKey:o,oneTimeKeyExpiresAt:i,permanentKey:n,qrUrl:r,permissions:s,desktopEnabled:l,updateVersion:a,connections:f=[],onRequestPermission:h,onDesktopToggle:c,onStop:_,onStart:d,onGenerateOneTimeKey:b,onRegenerateKey:N,logs:P=[]}){const[y,m]=L("connect"),[g,p]=L(!1),A=en(null),x=e===0,C=e>0&&e<4;return ce(()=>{var v;y==="log"&&((v=A.current)==null||v.scrollIntoView({behavior:"smooth"}))},[P,y]),u("div",{className:"h-full flex flex-col relative overflow-hidden",style:{background:"#333"},children:[u("div",{className:"flex-1 flex flex-col w-full max-w-sm mx-auto min-h-0 dot-grid-bg overflow-hidden",children:[u("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/5",children:[u("div",{className:"flex items-center gap-3",children:[u("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--brand-500)"},children:u("span",{className:"material-symbols-outlined text-white text-base",children:"terminal"})}),u("span",{className:"brand-text text-xs",children:"9Remote"})]}),u("div",{className:"flex items-center gap-2",children:[u("button",{onClick:()=>window.open($n,"_blank"),className:"glass-btn w-7 h-7 flex items-center justify-center text-white/40 hover:text-white",children:u("span",{className:"material-symbols-outlined text-sm",children:"help_outline"})}),!x&&u("button",{onClick:()=>p(!0),className:"btn-danger px-3 h-7 flex items-center gap-1.5 text-xs font-medium",children:[u("span",{className:"material-symbols-outlined text-sm",children:"stop_circle"}),"Disconnect"]})]})]}),u(rr,{version:a}),x?u(sr,{onStart:d,connecting:!1}):C?u("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex flex-col gap-4",children:u(kn,{currentStep:e})}):u(H,{children:[u("div",{className:"flex px-5 gap-3 border-b border-white/5",children:[{id:"connect",label:"Connection"},{id:"log",label:"Logs"}].map(v=>u("button",{onClick:()=>m(v.id),className:"pb-2 text-xs font-medium border-b-2 transition-colors",style:y===v.id?{borderColor:"var(--brand-500)",color:"var(--brand-500)"}:{borderColor:"transparent",color:"rgba(255,255,255,0.4)"},children:v.label},v.id))}),u("div",{className:"flex-1 overflow-y-auto px-5 py-4 flex flex-col gap-4",children:[y==="connect"&&u(H,{children:[u(Zn,{qrUrl:r,oneTimeKey:o,oneTimeKeyExpiresAt:i,permanentKey:n,tunnelUrl:t,onGenerateOneTimeKey:b,onRegenerateKey:N}),u(tr,{}),u(nr,{enabled:l,onToggle:c,permissions:s,onRequestPermission:h}),u("div",{className:"glass-card p-4 flex flex-col gap-1",children:[u("p",{className:"text-xs text-white/60 font-medium uppercase tracking-wider mb-2",children:["Clients",f.length>0?` (${f.length})`:""]}),f.length===0?u("p",{className:"text-xs text-white/30 text-center py-3",children:"No active connections"}):f.map((v,w)=>u(lr,{conn:v},w))]})]}),y==="log"&&u("div",{className:"flex-1 flex flex-col",children:P.length===0?u("p",{className:"text-xs text-white/30 text-center mt-8",children:"No logs yet"}):u("div",{className:"flex flex-col gap-0.5",children:[P.map((v,w)=>u("p",{className:"text-xs font-mono text-white/60 leading-5 break-all",children:v},w)),u("div",{ref:A})]})})]})]})]}),g&&u(je,{message:"Disconnect and stop the tunnel? Remote clients will be disconnected.",confirmLabel:"Disconnect",confirmDanger:!0,onConfirm:()=>{p(!1),_==null||_()},onCancel:()=>p(!1)})]})}const Kt={step:0,tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null,permanentKey:"",qrUrl:"",latency:null,uptime:null},cr={screenRecording:!1,accessibility:!1},zt=200;function ur(){const[e,t]=L(Kt),[o,i]=L(cr),[n,r]=L(!1),[s,l]=L([]),[a,f]=L(null),[h,c]=L([]);ce(()=>{fetch("/api/ui/state").then(g=>g.json()).then(g=>{t({step:g.step??0,tunnelUrl:g.tunnelUrl??"",oneTimeKey:g.oneTimeKey??"",oneTimeKeyExpiresAt:g.oneTimeKeyExpiresAt??null,permanentKey:g.permanentKey??"",qrUrl:g.qrUrl??"",latency:g.latency??null,uptime:g.uptime??null}),i({screenRecording:g.screenRecording??!1,accessibility:g.accessibility??!1}),g.desktopEnabled!==void 0&&r(g.desktopEnabled)}).catch(()=>{});const m=new EventSource("/api/ui/events");return m.onmessage=g=>{try{const p=JSON.parse(g.data);p.type==="state"?t({step:p.step??0,tunnelUrl:p.tunnelUrl??"",oneTimeKey:p.oneTimeKey??"",oneTimeKeyExpiresAt:p.oneTimeKeyExpiresAt??null,permanentKey:p.permanentKey??"",qrUrl:p.qrUrl??"",latency:p.latency??null,uptime:p.uptime??null}):p.type==="log"?l(A=>{const x=[...A,p.message];return x.length>zt?x.slice(-zt):x}):p.type==="updateAvailable"?f(p.version):p.type==="permissions"?(i({screenRecording:p.screenRecording,accessibility:p.accessibility}),p.desktopEnabled!==void 0&&r(p.desktopEnabled)):p.type==="connections"&&c(p.connections??[])}catch{}},m.onerror=()=>{},()=>m.close()},[]);const _=async m=>{await fetch("/api/permissions/request",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:m})}).catch(()=>{})},d=()=>{fetch("/api/ui/stop",{method:"POST"}).catch(()=>{}),t(Kt)},b=()=>{fetch("/api/ui/start",{method:"POST"}).catch(()=>{})},N=async()=>{const m=await fetch("/api/key/one-time",{method:"POST"}).catch(()=>null);if(!(m!=null&&m.ok))return;const g=await m.json().catch(()=>null);g!=null&&g.oneTimeKey&&t(p=>({...p,oneTimeKey:g.oneTimeKey,oneTimeKeyExpiresAt:g.expiresAt,qrUrl:g.qrUrl??p.qrUrl}))},P=async()=>{const m=!n;r(m),await fetch("/api/desktop/toggle",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:m})}).catch(()=>{})},y=async()=>{const m=await fetch("/api/key/regenerate",{method:"POST"}).catch(()=>null);if(!(m!=null&&m.ok))return;const g=await m.json().catch(()=>null);g!=null&&g.permanentKey&&t(p=>({...p,permanentKey:g.permanentKey}))};return u(ar,{step:e.step,tunnelUrl:e.tunnelUrl,oneTimeKey:e.oneTimeKey,oneTimeKeyExpiresAt:e.oneTimeKeyExpiresAt,permanentKey:e.permanentKey,qrUrl:e.qrUrl,permissions:o,desktopEnabled:n,updateVersion:a,connections:h,onRequestPermission:_,onDesktopToggle:P,onStop:d,onStart:b,onGenerateOneTimeKey:N,onRegenerateKey:y,logs:s})}wn(u(ur,{}),document.getElementById("root"));
|