Files
trok/internal/web/dist/assets/index-5XdRZXKz.js
2025-03-10 17:21:34 +05:30

2 lines
15 KiB
JavaScript

(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))l(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&l(i)}).observe(document,{childList:!0,subtree:!0});function s(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 l(n){if(n.ep)return;n.ep=!0;const r=s(n);fetch(n.href,r)}})();const ne=!1,le=(e,t)=>e===t,E={equals:le};let re=K;const m=1,k=2,D={owned:null,cleanups:null,context:null,owner:null};var h=null;let j=null,oe=null,u=null,a=null,b=null,O=0;function ie(e,t){const s=u,l=h,n=e.length===0,r=t===void 0?l:t,i=n?D:{owned:null,cleanups:null,context:r?r.context:null,owner:r},o=n?e:()=>e(()=>I(()=>S(i)));h=i,u=null;try{return $(o,!0)}finally{u=s,h=l}}function ce(e,t){t=t?Object.assign({},E,t):E;const s={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},l=n=>(typeof n=="function"&&(n=n(s.value)),q(s,n));return[H.bind(s),l]}function v(e,t,s){const l=G(e,t,!1,m);L(l)}function P(e,t,s){s=s?Object.assign({},E,s):E;const l=G(e,t,!0,0);return l.observers=null,l.observerSlots=null,l.comparator=s.equals||void 0,L(l),H.bind(l)}function I(e){if(u===null)return e();const t=u;u=null;try{return e()}finally{u=t}}function H(){if(this.sources&&this.state)if(this.state===m)L(this);else{const e=a;a=null,$(()=>z(this),!1),a=e}if(u){const e=this.observers?this.observers.length:0;u.sources?(u.sources.push(this),u.sourceSlots.push(e)):(u.sources=[this],u.sourceSlots=[e]),this.observers?(this.observers.push(u),this.observerSlots.push(u.sources.length-1)):(this.observers=[u],this.observerSlots=[u.sources.length-1])}return this.value}function q(e,t,s){let l=e.value;return(!e.comparator||!e.comparator(l,t))&&(e.value=t,e.observers&&e.observers.length&&$(()=>{for(let n=0;n<e.observers.length;n+=1){const r=e.observers[n],i=j&&j.running;i&&j.disposed.has(r),(i?!r.tState:!r.state)&&(r.pure?a.push(r):b.push(r),r.observers&&X(r)),i||(r.state=m)}if(a.length>1e6)throw a=[],new Error},!1)),t}function L(e){if(!e.fn)return;S(e);const t=O;ue(e,e.value,t)}function ue(e,t,s){let l;const n=h,r=u;u=h=e;try{l=e.fn(t)}catch(i){return e.pure&&(e.state=m,e.owned&&e.owned.forEach(S),e.owned=null),e.updatedAt=s+1,Z(i)}finally{u=r,h=n}(!e.updatedAt||e.updatedAt<=s)&&(e.updatedAt!=null&&"observers"in e?q(e,l):e.value=l,e.updatedAt=s)}function G(e,t,s,l=m,n){const r={fn:e,state:l,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:h,context:h?h.context:null,pure:s};return h===null||h!==D&&(h.owned?h.owned.push(r):h.owned=[r]),r}function F(e){if(e.state===0)return;if(e.state===k)return z(e);if(e.suspense&&I(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<O);)e.state&&t.push(e);for(let s=t.length-1;s>=0;s--)if(e=t[s],e.state===m)L(e);else if(e.state===k){const l=a;a=null,$(()=>z(e,t[0]),!1),a=l}}function $(e,t){if(a)return e();let s=!1;t||(a=[]),b?s=!0:b=[],O++;try{const l=e();return fe(s),l}catch(l){s||(b=null),a=null,Z(l)}}function fe(e){if(a&&(K(a),a=null),e)return;const t=b;b=null,t.length&&$(()=>re(t),!1)}function K(e){for(let t=0;t<e.length;t++)F(e[t])}function z(e,t){e.state=0;for(let s=0;s<e.sources.length;s+=1){const l=e.sources[s];if(l.sources){const n=l.state;n===m?l!==t&&(!l.updatedAt||l.updatedAt<O)&&F(l):n===k&&z(l,t)}}}function X(e){for(let t=0;t<e.observers.length;t+=1){const s=e.observers[t];s.state||(s.state=k,s.pure?a.push(s):b.push(s),s.observers&&X(s))}}function S(e){let t;if(e.sources)for(;e.sources.length;){const s=e.sources.pop(),l=e.sourceSlots.pop(),n=s.observers;if(n&&n.length){const r=n.pop(),i=s.observerSlots.pop();l<n.length&&(r.sourceSlots[i]=l,n[l]=r,s.observerSlots[l]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)S(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)S(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function ae(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Z(e,t=h){throw ae(e)}function A(e,t){return I(()=>e(t||{}))}function de(e,t,s){let l=s.length,n=t.length,r=l,i=0,o=0,c=t[n-1].nextSibling,f=null;for(;i<n||o<r;){if(t[i]===s[o]){i++,o++;continue}for(;t[n-1]===s[r-1];)n--,r--;if(n===i){const d=r<l?o?s[o-1].nextSibling:s[r-o]:c;for(;o<r;)e.insertBefore(s[o++],d)}else if(r===o)for(;i<n;)(!f||!f.has(t[i]))&&t[i].remove(),i++;else if(t[i]===s[r-1]&&s[o]===t[n-1]){const d=t[--n].nextSibling;e.insertBefore(s[o++],t[i++].nextSibling),e.insertBefore(s[--r],d),t[n]=s[r]}else{if(!f){f=new Map;let p=o;for(;p<r;)f.set(s[p],p++)}const d=f.get(t[i]);if(d!=null)if(o<d&&d<r){let p=i,y=1,C;for(;++p<n&&p<r&&!((C=f.get(t[p]))==null||C!==d+y);)y++;if(y>d-o){const g=t[i];for(;o<d;)e.insertBefore(s[o++],g)}else e.replaceChild(s[o++],t[i++])}else i++;else t[i++].remove()}}}const R="_$DX_DELEGATE";function he(e,t,s,l={}){let n;return ie(r=>{n=r,t===document?e():_(t,e(),t.firstChild?null:void 0,s)},l.owner),()=>{n(),t.textContent=""}}function w(e,t,s,l){let n;const r=()=>{const o=document.createElement("template");return o.innerHTML=e,o.content.firstChild},i=()=>(n||(n=r())).cloneNode(!0);return i.cloneNode=i,i}function pe(e,t=window.document){const s=t[R]||(t[R]=new Set);for(let l=0,n=e.length;l<n;l++){const r=e[l];s.has(r)||(s.add(r),t.addEventListener(r,be))}}function M(e,t,s){s==null?e.removeAttribute(t):e.setAttribute(t,s)}function _(e,t,s,l){if(s!==void 0&&!l&&(l=[]),typeof t!="function")return T(e,t,l,s);v(n=>T(e,t(),n,s),l)}function be(e){let t=e.target;const s=`$$${e.type}`,l=e.target,n=e.currentTarget,r=c=>Object.defineProperty(e,"target",{configurable:!0,value:c}),i=()=>{const c=t[s];if(c&&!t.disabled){const f=t[`${s}Data`];if(f!==void 0?c.call(t,f,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&r(t.host),!0},o=()=>{for(;i()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const c=e.composedPath();r(c[0]);for(let f=0;f<c.length-2&&(t=c[f],!!i());f++){if(t._$host){t=t._$host,o();break}if(t.parentNode===n)break}}else o();r(l)}function T(e,t,s,l,n){for(;typeof s=="function";)s=s();if(t===s)return s;const r=typeof t,i=l!==void 0;if(e=i&&s[0]&&s[0].parentNode||e,r==="string"||r==="number"){if(r==="number"&&(t=t.toString(),t===s))return s;if(i){let o=s[0];o&&o.nodeType===3?o.data!==t&&(o.data=t):o=document.createTextNode(t),s=x(e,s,l,o)}else s!==""&&typeof s=="string"?s=e.firstChild.data=t:s=e.textContent=t}else if(t==null||r==="boolean")s=x(e,s,l);else{if(r==="function")return v(()=>{let o=t();for(;typeof o=="function";)o=o();s=T(e,o,s,l)}),()=>s;if(Array.isArray(t)){const o=[],c=s&&Array.isArray(s);if(B(o,t,s,n))return v(()=>s=T(e,o,s,l,!0)),()=>s;if(o.length===0){if(s=x(e,s,l),i)return s}else c?s.length===0?U(e,o,l):de(e,s,o):(s&&x(e),U(e,o));s=o}else if(t.nodeType){if(Array.isArray(s)){if(i)return s=x(e,s,l,t);x(e,s,null,t)}else s==null||s===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);s=t}}return s}function B(e,t,s,l){let n=!1;for(let r=0,i=t.length;r<i;r++){let o=t[r],c=s&&s[e.length],f;if(!(o==null||o===!0||o===!1))if((f=typeof o)=="object"&&o.nodeType)e.push(o);else if(Array.isArray(o))n=B(e,o,c)||n;else if(f==="function")if(l){for(;typeof o=="function";)o=o();n=B(e,Array.isArray(o)?o:[o],Array.isArray(c)?c:[c])||n}else e.push(o),n=!0;else{const d=String(o);c&&c.nodeType===3&&c.data===d?e.push(c):e.push(document.createTextNode(d))}}return n}function U(e,t,s=null){for(let l=0,n=t.length;l<n;l++)e.insertBefore(t[l],s)}function x(e,t,s,l){if(s===void 0)return e.textContent="";const n=l||document.createTextNode("");if(t.length){let r=!1;for(let i=t.length-1;i>=0;i--){const o=t[i];if(n!==o){const c=o.parentNode===e;!r&&!i?c?e.replaceChild(n,o):e.insertBefore(n,s):c&&o.remove()}else r=!0}}else e.insertBefore(n,s);return[n]}var me=w('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 24 24"stroke-width=1.5 stroke=currentColor><path stroke-linecap=round stroke-linejoin=round d="M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 0 1 1.037-.443 48.282 48.282 0 0 0 5.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z">'),ge=w('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 24 24"stroke-width=1.5 stroke=currentColor><path stroke-linecap=round stroke-linejoin=round d="M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z">'),xe=w('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 24 24"stroke-width=1.5 stroke=currentColor><path stroke-linecap=round stroke-linejoin=round d="M11.35 3.836c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m8.9-4.414c.376.023.75.05 1.124.08 1.131.094 1.976 1.057 1.976 2.192V16.5A2.25 2.25 0 0 1 18 18.75h-2.25m-7.5-10.5H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V18.75m-7.5-10.5h6.375c.621 0 1.125.504 1.125 1.125v9.375m-8.25-3 1.5 1.5 3-3.75">');const ve=e=>(()=>{var t=me();return v(()=>M(t,"class",e.class)),t})(),we=e=>(()=>{var t=ge();return v(()=>M(t,"class",e.class)),t})(),ye=e=>(()=>{var t=xe();return v(()=>M(t,"class",e.class)),t})();var Se=w('<div class="md:flex md:h-screen md:w-screen py-8 justify-center items-center antialiased"><div class="mx-auto lg:max-w-5xl"><div class="mx-5 md:mx-0 flex flex-col justify-center items-center"><h1 class="text-7xl text-zinc-700 font-koulen">TROK</h1><h3 class="text-lg text-zinc-500 font-koulen">EXPOSE. SHARE. ACCESS.</h3></div><div class="mx-5 md:mx-0 h-10 border-gray-200 border-l border-r"></div><div class="mx-5 md:mx-0 border-t border-gray-200 border-l border-r"><div class=md:flex><div class="px-5 py-10 border-b border-gray-200 md:border-r md:w-5/12"><h2 class="text-4xl text-zinc-700 font-koulen">Accessing your<br>local service should<br>be simple</h2><p class="mt-5 text-md/10 text-gray-500">It&apos;s like&nbsp;<span class="font-mono bg-zinc-100 px-1 py-0.5 rounded">ngrok</span>&nbsp;but simpler. Just log in, run the command, and get a shareable URL to access your local service from anywhere. No complex setup—just instant, secure tunneling to the internet.</p></div><div class="px-5 py-10 border-b border-gray-200 flex-1 md:w-7/12"><h3 class="text-3xl text-zinc-700 font-koulen">Install</h3><p class="mt-1 text-sm/6 text-gray-500">Install trok to your machine using shell:</p><button class="text-xs md:text rounded bg-zinc-100 p-2 mt-2 flex cursor-pointer"><div class="grow mr-10 text-zinc-600 text-left font-mono">$ curl -fsSL https://trok.cloud/install.sh | sh</div></button><div class="mt-2 text-xs/6 text-gray-500"><p>This will download the trok binary to the path you ran the script from.<br>Run it with&nbsp;<span class="font-mono text-sm/6 rounded bg-zinc-100 p-1 inline">./trok</span>&nbsp;on any system</p></div></div></div></div><div class="mx-5 md:mx-0 h-5 border-l border-gray-200 border-r"></div><div class="mx-5 md:mx-0 border-t border-gray-200 border-l border-r"><div class="px-5 pt-10"><h3 class="font-koulen text-zinc-600 text-xl">USING TROK:</h3></div><div class="md:flex sm:gap-5 border-gray-200 border-b"><div class="md:w-1/3 p-5 pb-10"><div class="rounded border border-zinc-300 bg-zinc-100 p-2 pb-8 h-40 mb-5"><div class="flex gap-1 items-center"><div class="border border-zinc-400 w-3 h-3 rounded-full"></div><div class="border border-zinc-400 w-3 h-3 rounded-full"></div><div class="border border-zinc-400 w-3 h-3 rounded-full"></div></div><p class="font-mono text-zinc-700 font-bold text-sm pt-4">> $ trok client -a :3000</p><p class="font-mono text-zinc-400 text-sm">started Trok client on trok.cloud</p><p class="font-mono text-zinc-400 text-sm">[CMD] EHLO [ARG] trok.cloud</p></div><h3 class="font-koulen text-zinc-700 text-3xl">1. Expose</h3><p class="mt-1 text-sm/6 text-gray-500">provide the local port you want to share, and it&apos;ll generate a URL.</p></div><div class="md:w-1/3 p-5 pb-10"><div class="relative p-2 flex h-40 mb-5"><div class="rounded-tr-lg rounded-br-lg rounded-bl-lg border border-gray-200 bg-zinc-50 p-2 pb-10 mb-2 h-20">hey here take a look at my project...</div></div><h3 class="font-koulen text-zinc-700 text-3xl">2. Share</h3><p class="mt-1 text-sm/6 text-gray-500">share the URL with your friends.</p></div><div class="md:w-1/3 p-5 pb-10"><div class="rounded border border-zinc-300 bg-zinc-100 p-2 pb-8 h-40 mb-5"><div class="flex gap-1 items-center"><div class="flex gap-1"><div class="border border-zinc-400 w-3 h-3 rounded-full"></div><div class="border border-zinc-400 w-3 h-3 rounded-full"></div><div class="border border-zinc-400 w-3 h-3 rounded-full"></div></div><div class="border flex items-center border-zinc-400 w-full h-4 rounded-sm"><span class="text-xs text-zinc-400 px-1 -mt-[1px]">https://awesome-project.trok.cloud</span></div></div><div class="flex justify-center items-center h-full font-mono text-zinc-400 text-sm">🎉 your awesome project 🎉</div></div><h3 class="font-koulen text-zinc-700 text-3xl">3. Access</h3><p class="mt-1 text-sm/6 text-gray-500">access your local service from anywhere.</p></div></div></div><div class="mx-5 md:mx-0 h-10 border-gray-200 border-l border-r">'),$e=w('<span class="w-10 mr-1">copied!'),Ce=w('<span class="w-10 mr-1">');function Ae(){const e="curl -fsSL https://trok.cloud/install.sh | sh",[t,s]=ce(!1),l=()=>{navigator.clipboard.writeText(e),s(!0),setTimeout(()=>{s(!1)},1300)};return(()=>{var n=Se(),r=n.firstChild,i=r.firstChild,o=i.nextSibling,c=o.nextSibling,f=c.firstChild,d=f.firstChild,p=d.nextSibling,y=p.firstChild,C=y.nextSibling,g=C.nextSibling;g.firstChild;var J=c.nextSibling,Q=J.nextSibling,W=Q.firstChild,Y=W.nextSibling,ee=Y.firstChild,te=ee.nextSibling,V=te.firstChild,se=V.firstChild;return g.$$click=l,_(g,(()=>{var N=P(()=>!!t());return()=>N()?$e():Ce()})(),null),_(g,(()=>{var N=P(()=>!!t());return()=>N()?A(ye,{class:"h-5 w-5 text-zinc-500"}):A(we,{class:"h-5 w-5 text-zinc-500"})})(),null),_(V,A(ve,{class:"w-6 h-6 mr-2"}),se),n})()}pe(["click"]);const _e=document.getElementById("root");he(()=>A(Ae,{}),_e);