mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-22 18:21:35 +03:00
e1e85dc2a5
* chore: fix ci and cleanup leftovers
1. removed leftover feature flags
2. remove zip/extract apis which are not used anymore
3. removed leftoever scopes
4. removed leftover allowlist and updater options
5. updated the example api
* remove leftover updater structs
* move updater under bundle and remove uneeded options
* fix cli on linux
* remove create_proxy
* clippy
* more clippy
* clippppy
* readd path api
* fix api example
* remove window allowlist
* remove window from allowlist config
* remove `all` allowlist option
* remove file_move
* lint
* fix windows build
* remvoe unused deps
* remvoe allowlist config option, move protocol to `security > asset_protocol`
* fix diffing features
* fmt and test
* fix scope alias
* change files
* android lint
* simplify allow_file impl
* Revert "simplify allow_file impl"
This reverts commit b8882f2fd0
.
* expose scopes
* remove unused error variants
* protocol-asset on docs.rs
* ignore reqwest on udeps
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
10 lines
18 KiB
JavaScript
10 lines
18 KiB
JavaScript
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const h of a.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&i(h)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerpolicy&&(a.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?a.credentials="include":r.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();function $(){}function rt(e){return e()}function Ge(){return Object.create(null)}function F(e){e.forEach(rt)}function pt(e){return typeof e=="function"}function ue(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let be;function gt(e,t){return be||(be=document.createElement("a")),be.href=t,e===be.href}function _t(e){return Object.keys(e).length===0}function vt(e,...t){if(e==null)return $;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function bt(e,t,n){e.$$.on_destroy.push(vt(t,n))}function o(e,t){e.appendChild(t)}function k(e,t,n){e.insertBefore(t,n||null)}function w(e){e.parentNode.removeChild(e)}function Xe(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function f(e){return document.createElement(e)}function yt(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function K(e){return document.createTextNode(e)}function g(){return K(" ")}function ot(){return K("")}function z(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function l(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function wt(e){return Array.from(e.childNodes)}function kt(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}class Et{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,i=null){this.e||(this.is_svg?this.e=yt(n.nodeName):this.e=f(n.nodeName),this.t=n,this.c(t)),this.i(i)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let n=0;n<this.n.length;n+=1)k(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(w)}}let ae;function ce(e){ae=e}function st(){if(!ae)throw new Error("Function called outside component initialization");return ae}function Ee(e){st().$$.on_mount.push(e)}function lt(e){st().$$.on_destroy.push(e)}const le=[],Ce=[],we=[],Ye=[],$t=Promise.resolve();let Me=!1;function xt(){Me||(Me=!0,$t.then(ct))}function We(e){we.push(e)}const Te=new Set;let ye=0;function ct(){const e=ae;do{for(;ye<le.length;){const t=le[ye];ye++,ce(t),Lt(t.$$)}for(ce(null),le.length=0,ye=0;Ce.length;)Ce.pop()();for(let t=0;t<we.length;t+=1){const n=we[t];Te.has(n)||(Te.add(n),n())}we.length=0}while(le.length);for(;Ye.length;)Ye.pop()();Me=!1,Te.clear(),ce(e)}function Lt(e){if(e.fragment!==null){e.update(),F(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(We)}}const ke=new Set;let U;function Ot(){U={r:0,c:[],p:U}}function St(){U.r||F(U.c),U=U.p}function Ie(e,t){e&&e.i&&(ke.delete(e),e.i(t))}function Je(e,t,n,i){if(e&&e.o){if(ke.has(e))return;ke.add(e),U.c.push(()=>{ke.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function Ke(e){e&&e.c()}function Ne(e,t,n,i){const{fragment:r,on_mount:a,on_destroy:h,after_update:c}=e.$$;r&&r.m(t,n),i||We(()=>{const u=a.map(rt).filter(pt);h?h.push(...u):F(u),e.$$.on_mount=[]}),c.forEach(We)}function Ae(e,t){const n=e.$$;n.fragment!==null&&(F(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Dt(e,t){e.$$.dirty[0]===-1&&(le.push(e),xt(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function Le(e,t,n,i,r,a,h,c=[-1]){const u=ae;ce(e);const d=e.$$={fragment:null,ctx:null,props:a,update:$,not_equal:r,bound:Ge(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:Ge(),dirty:c,skip_bound:!1,root:t.target||u.$$.root};h&&h(d.root);let E=!1;if(d.ctx=n?n(e,t.props||{},(v,O,...R)=>{const S=R.length?R[0]:O;return d.ctx&&r(d.ctx[v],d.ctx[v]=S)&&(!d.skip_bound&&d.bound[v]&&d.bound[v](S),E&&Dt(e,v)),O}):[],d.update(),E=!0,F(d.before_update),d.fragment=i?i(d.ctx):!1,t.target){if(t.hydrate){const v=wt(t.target);d.fragment&&d.fragment.l(v),v.forEach(w)}else d.fragment&&d.fragment.c();t.intro&&Ie(e.$$.fragment),Ne(e,t.target,t.anchor,t.customElement),ct()}ce(u)}class Oe{$destroy(){Ae(this,1),this.$destroy=$}$on(t,n){const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!_t(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const J=[];function Tt(e,t=$){let n;const i=new Set;function r(c){if(ue(e,c)&&(e=c,n)){const u=!J.length;for(const d of i)d[1](),J.push(d,e);if(u){for(let d=0;d<J.length;d+=2)J[d][0](J[d+1]);J.length=0}}}function a(c){r(c(e))}function h(c,u=$){const d=[c,u];return i.add(d),i.size===1&&(n=t(r)||$),c(e),()=>{i.delete(d),i.size===0&&(n(),n=null)}}return{set:r,update:a,subscribe:h}}function Ct(e){let t;return{c(){t=f("p"),t.innerHTML=`This is a demo of Tauri's API capabilities using the <code>@tauri-apps/api</code> package. It's used as the main validation app, serving as the test bed of our
|
|
development process. In the future, this app will be used on Tauri's integration
|
|
tests.`},m(n,i){k(n,t,i)},p:$,i:$,o:$,d(n){n&&w(t)}}}class Mt extends Oe{constructor(t){super(),Le(this,t,null,Ct,ue,{})}}var Wt=Object.defineProperty,at=(e,t)=>{for(var n in t)Wt(e,n,{get:t[n],enumerable:!0})},It={};at(It,{convertFileSrc:()=>At,invoke:()=>xe,transformCallback:()=>$e});function Nt(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function $e(e,t=!1){let n=Nt(),i=`_${n}`;return Object.defineProperty(window,i,{value:r=>(t&&Reflect.deleteProperty(window,i),e==null?void 0:e(r)),writable:!1,configurable:!0}),n}async function xe(e,t={}){return new Promise((n,i)=>{let r=$e(h=>{n(h),Reflect.deleteProperty(window,`_${a}`)},!0),a=$e(h=>{i(h),Reflect.deleteProperty(window,`_${r}`)},!0);window.__TAURI_IPC__({cmd:e,callback:r,error:a,...t})})}function At(e,t="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${t}.localhost/${n}`:`${t}://localhost/${n}`}var Pt={};at(Pt,{TauriEvent:()=>ft,emit:()=>ht,listen:()=>mt,once:()=>qt});async function Pe(e){return xe("tauri",e)}async function ut(e,t){return Pe({__tauriModule:"Event",message:{cmd:"unlisten",event:e,eventId:t}})}async function Rt(e,t,n){await Pe({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:n}})}async function dt(e,t,n){return Pe({__tauriModule:"Event",message:{cmd:"listen",event:e,windowLabel:t,handler:$e(n)}}).then(i=>async()=>ut(e,i))}async function Ht(e,t,n){return dt(e,t,i=>{n(i),ut(e,i.id).catch(()=>{})})}var ft=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e))(ft||{});async function mt(e,t){return dt(e,null,t)}async function qt(e,t){return Ht(e,null,t)}async function ht(e,t){return Rt(e,void 0,t)}function jt(e){let t,n,i,r,a,h,c,u;return{c(){t=f("div"),n=f("button"),n.textContent="Call Log API",i=g(),r=f("button"),r.textContent="Call Request (async) API",a=g(),h=f("button"),h.textContent="Send event to Rust",l(n,"class","btn"),l(n,"id","log"),l(r,"class","btn"),l(r,"id","request"),l(h,"class","btn"),l(h,"id","event")},m(d,E){k(d,t,E),o(t,n),o(t,i),o(t,r),o(t,a),o(t,h),c||(u=[z(n,"click",e[0]),z(r,"click",e[1]),z(h,"click",e[2])],c=!0)},p:$,i:$,o:$,d(d){d&&w(t),c=!1,F(u)}}}function Ut(e,t,n){let{onMessage:i}=t,r;Ee(async()=>{r=await mt("rust-event",i)}),lt(()=>{r&&r()});function a(){xe("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function h(){xe("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function c(){ht("js-event","this is the payload string")}return e.$$set=u=>{"onMessage"in u&&n(3,i=u.onMessage)},[a,h,c,i]}class zt extends Oe{constructor(t){super(),Le(this,t,Ut,jt,ue,{onMessage:3})}}function Ft(e){let t;return{c(){t=f("div"),t.innerHTML=`<div class="note-red grow">Not available for Linux</div>
|
|
<video id="localVideo" autoplay="" playsinline=""><track kind="captions"/></video>`,l(t,"class","flex flex-col gap-2")},m(n,i){k(n,t,i)},p:$,i:$,o:$,d(n){n&&w(t)}}}function Vt(e,t,n){let{onMessage:i}=t;const r=window.constraints={audio:!0,video:!0};function a(c){const u=document.querySelector("video"),d=c.getVideoTracks();i("Got stream with constraints:",r),i(`Using video device: ${d[0].label}`),window.stream=c,u.srcObject=c}function h(c){if(c.name==="ConstraintNotSatisfiedError"){const u=r.video;i(`The resolution ${u.width.exact}x${u.height.exact} px is not supported by your device.`)}else c.name==="PermissionDeniedError"&&i("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");i(`getUserMedia error: ${c.name}`,c)}return Ee(async()=>{try{const c=await navigator.mediaDevices.getUserMedia(r);a(c)}catch(c){h(c)}}),lt(()=>{window.stream.getTracks().forEach(function(c){c.stop()})}),e.$$set=c=>{"onMessage"in c&&n(0,i=c.onMessage)},[i]}class Bt extends Oe{constructor(t){super(),Le(this,t,Vt,Ft,ue,{onMessage:0})}}function Qe(e,t,n){const i=e.slice();return i[25]=t[n],i}function Ze(e,t,n){const i=e.slice();return i[28]=t[n],i}function Gt(e){let t;return{c(){t=f("span"),l(t,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){k(n,t,i)},d(n){n&&w(t)}}}function Xt(e){let t;return{c(){t=f("span"),l(t,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){k(n,t,i)},d(n){n&&w(t)}}}function Yt(e){let t,n;return{c(){t=K(`Switch to Dark mode
|
|
`),n=f("div"),l(n,"class","i-ph-moon")},m(i,r){k(i,t,r),k(i,n,r)},d(i){i&&w(t),i&&w(n)}}}function Jt(e){let t,n;return{c(){t=K(`Switch to Light mode
|
|
`),n=f("div"),l(n,"class","i-ph-sun")},m(i,r){k(i,t,r),k(i,n,r)},d(i){i&&w(t),i&&w(n)}}}function Kt(e){let t,n,i,r,a=e[28].label+"",h,c,u,d;function E(){return e[14](e[28])}return{c(){t=f("a"),n=f("div"),i=g(),r=f("p"),h=K(a),l(n,"class",e[28].icon+" mr-2"),l(t,"href","##"),l(t,"class",c="nv "+(e[1]===e[28]?"nv_selected":""))},m(v,O){k(v,t,O),o(t,n),o(t,i),o(t,r),o(r,h),u||(d=z(t,"click",E),u=!0)},p(v,O){e=v,O&2&&c!==(c="nv "+(e[1]===e[28]?"nv_selected":""))&&l(t,"class",c)},d(v){v&&w(t),u=!1,d()}}}function et(e){let t,n=e[28]&&Kt(e);return{c(){n&&n.c(),t=ot()},m(i,r){n&&n.m(i,r),k(i,t,r)},p(i,r){i[28]&&n.p(i,r)},d(i){n&&n.d(i),i&&w(t)}}}function tt(e){let t,n=e[25].html+"",i;return{c(){t=new Et(!1),i=ot(),t.a=i},m(r,a){t.m(n,r,a),k(r,i,a)},p(r,a){a&16&&n!==(n=r[25].html+"")&&t.p(n)},d(r){r&&w(i),r&&t.d()}}}function Qt(e){let t,n,i,r,a,h,c,u,d,E,v,O,R,S,Q,W,de,b,H,T,q,V,Z,ee,fe,me,p,_,C,I,N,te,j=e[1].label+"",Se,Re,he,ne,y,He,M,pe,qe,B,ge,je,ie,Ue,re,oe,De,ze;function Fe(s,D){return s[0]?Xt:Gt}let _e=Fe(e),A=_e(e);function Ve(s,D){return s[2]?Jt:Yt}let ve=Ve(e),P=ve(e),G=e[5],x=[];for(let s=0;s<G.length;s+=1)x[s]=et(Ze(e,G,s));var X=e[1].component;function Be(s){return{props:{onMessage:s[9],insecureRenderHtml:s[10]}}}X&&(y=new X(Be(e)));let Y=e[4],L=[];for(let s=0;s<Y.length;s+=1)L[s]=tt(Qe(e,Y,s));return{c(){t=f("div"),A.c(),n=g(),i=f("div"),r=f("aside"),a=f("img"),c=g(),u=f("a"),P.c(),d=g(),E=f("br"),v=g(),O=f("div"),R=g(),S=f("br"),Q=g(),W=f("a"),W.innerHTML=`Documentation
|
|
<span class="i-codicon-link-external"></span>`,de=g(),b=f("a"),b.innerHTML=`GitHub
|
|
<span class="i-codicon-link-external"></span>`,H=g(),T=f("a"),T.innerHTML=`Source
|
|
<span class="i-codicon-link-external"></span>`,q=g(),V=f("br"),Z=g(),ee=f("div"),fe=g(),me=f("br"),p=g(),_=f("div");for(let s=0;s<x.length;s+=1)x[s].c();C=g(),I=f("main"),N=f("div"),te=f("h1"),Se=K(j),Re=g(),he=f("div"),ne=f("div"),y&&Ke(y.$$.fragment),He=g(),M=f("div"),pe=f("div"),qe=g(),B=f("div"),ge=f("p"),ge.textContent="Console",je=g(),ie=f("div"),ie.innerHTML='<div class="i-codicon-clear-all"></div>',Ue=g(),re=f("div");for(let s=0;s<L.length;s+=1)L[s].c();l(t,"id","sidebarToggle"),l(t,"class","z-2000 display-none lt-sm:flex justify-center items-center absolute top-2 left-2 w-8 h-8 rd-8 bg-accent dark:bg-darkAccent active:bg-accentDark dark:active:bg-darkAccentDark"),l(a,"class","self-center p-7 cursor-pointer"),gt(a.src,h="tauri_logo.png")||l(a,"src",h),l(a,"alt","Tauri logo"),l(u,"href","##"),l(u,"class","nv justify-between h-8"),l(O,"class","bg-white/5 h-2px"),l(W,"class","nv justify-between h-8"),l(W,"target","_blank"),l(W,"href","https://tauri.app/v1/guides/"),l(b,"class","nv justify-between h-8"),l(b,"target","_blank"),l(b,"href","https://github.com/tauri-apps/tauri"),l(T,"class","nv justify-between h-8"),l(T,"target","_blank"),l(T,"href","https://github.com/tauri-apps/tauri/tree/dev/examples/api"),l(ee,"class","bg-white/5 h-2px"),l(_,"class","flex flex-col overflow-y-auto children-h-10 children-flex-none gap-1"),l(r,"id","sidebar"),l(r,"class","lt-sm:h-screen lt-sm:shadow-lg lt-sm:shadow lt-sm:transition-transform lt-sm:absolute lt-sm:z-1999 bg-darkPrimaryLighter transition-colors-250 overflow-hidden grid grid-rows-[min-content_auto] select-none px-2"),l(ne,"class","mr-2"),l(he,"class","overflow-y-auto"),l(N,"class","px-5 overflow-hidden grid grid-rows-[auto_1fr]"),l(pe,"class","bg-black/20 h-2px cursor-ns-resize"),l(ge,"class","font-semibold"),l(ie,"class","cursor-pointer h-85% rd-1 p-1 flex justify-center items-center hover:bg-hoverOverlay dark:hover:bg-darkHoverOverlay active:bg-hoverOverlay/25 dark:active:bg-darkHoverOverlay/25 "),l(B,"class","flex justify-between items-center px-2"),l(re,"class","px-2 overflow-y-auto all:font-mono code-block all:text-xs"),l(M,"id","console"),l(M,"class","select-none h-15rem grid grid-rows-[2px_2rem_1fr] gap-1 overflow-hidden"),l(I,"class","flex-1 bg-primary dark:bg-darkPrimary transition-transform transition-colors-250 grid grid-rows-[2fr_auto]"),l(i,"class","flex h-screen w-screen overflow-hidden children-pt8 children-pb-2 text-primaryText dark:text-darkPrimaryText")},m(s,D){k(s,t,D),A.m(t,null),k(s,n,D),k(s,i,D),o(i,r),o(r,a),o(r,c),o(r,u),P.m(u,null),o(r,d),o(r,E),o(r,v),o(r,O),o(r,R),o(r,S),o(r,Q),o(r,W),o(r,de),o(r,b),o(r,H),o(r,T),o(r,q),o(r,V),o(r,Z),o(r,ee),o(r,fe),o(r,me),o(r,p),o(r,_);for(let m=0;m<x.length;m+=1)x[m].m(_,null);o(i,C),o(i,I),o(I,N),o(N,te),o(te,Se),o(N,Re),o(N,he),o(he,ne),y&&Ne(y,ne,null),o(I,He),o(I,M),o(M,pe),o(M,qe),o(M,B),o(B,ge),o(B,je),o(B,ie),o(M,Ue),o(M,re);for(let m=0;m<L.length;m+=1)L[m].m(re,null);e[15](M),oe=!0,De||(ze=[z(u,"click",e[7]),z(pe,"mousedown",e[12]),z(ie,"click",e[11])],De=!0)},p(s,[D]){if(_e!==(_e=Fe(s))&&(A.d(1),A=_e(s),A&&(A.c(),A.m(t,null))),ve!==(ve=Ve(s))&&(P.d(1),P=ve(s),P&&(P.c(),P.m(u,null))),D&99){G=s[5];let m;for(m=0;m<G.length;m+=1){const se=Ze(s,G,m);x[m]?x[m].p(se,D):(x[m]=et(se),x[m].c(),x[m].m(_,null))}for(;m<x.length;m+=1)x[m].d(1);x.length=G.length}if((!oe||D&2)&&j!==(j=s[1].label+"")&&kt(Se,j),X!==(X=s[1].component)){if(y){Ot();const m=y;Je(m.$$.fragment,1,0,()=>{Ae(m,1)}),St()}X?(y=new X(Be(s)),Ke(y.$$.fragment),Ie(y.$$.fragment,1),Ne(y,ne,null)):y=null}if(D&16){Y=s[4];let m;for(m=0;m<Y.length;m+=1){const se=Qe(s,Y,m);L[m]?L[m].p(se,D):(L[m]=tt(se),L[m].c(),L[m].m(re,null))}for(;m<L.length;m+=1)L[m].d(1);L.length=Y.length}},i(s){oe||(y&&Ie(y.$$.fragment,s),oe=!0)},o(s){y&&Je(y.$$.fragment,s),oe=!1},d(s){s&&w(t),A.d(),s&&w(n),s&&w(i),P.d(),Xe(x,s),y&&Ae(y),Xe(L,s),e[15](null),De=!1,F(ze)}}}let nt=50;function it(e){const t=document.querySelector("html");e?t.classList.add("dark"):t.classList.remove("dark"),localStorage&&localStorage.setItem("theme",e?"dark":"")}function Zt(e,t){e.style.setProperty("--translate-x",`${t?"0":"-18.75"}rem`)}function en(e,t,n){let i;const r=navigator.userAgent.toLowerCase();r.includes("android")||r.includes("iphone");const a=[{label:"Welcome",component:Mt,icon:"i-ph-hand-waving"},{label:"Communication",component:zt,icon:"i-codicon-radio-tower"},{label:"WebRTC",component:Bt,icon:"i-ph-broadcast"}];let h=a[0];function c(p){n(1,h=p)}let u;Ee(()=>{n(2,u=localStorage&&localStorage.getItem("theme")=="dark"),it(u)});function d(){n(2,u=!u),it(u)}let E=Tt([]);bt(e,E,p=>n(4,i=p));function v(p){E.update(_=>[{html:`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> `+(typeof p=="string"?p:JSON.stringify(p,null,1))+"</pre>"},..._])}function O(p){E.update(_=>[{html:`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> `+p+"</pre>"},..._])}function R(){E.update(()=>[])}let S,Q,W;function de(p){W=p.clientY;const _=window.getComputedStyle(S);Q=parseInt(_.height,10);const C=N=>{const te=N.clientY-W,j=Q-te;n(3,S.style.height=`${j<nt?nt:j}px`,S)},I=()=>{document.removeEventListener("mouseup",I),document.removeEventListener("mousemove",C)};document.addEventListener("mouseup",I),document.addEventListener("mousemove",C)}let b=!1,H,T,q=!1,V=0,Z=0;const ee=(p,_,C)=>Math.min(Math.max(_,p),C);Ee(()=>{n(13,H=document.querySelector("#sidebar")),T=document.querySelector("#sidebarToggle"),document.addEventListener("click",p=>{T.contains(p.target)?n(0,b=!b):b&&!H.contains(p.target)&&n(0,b=!1)}),document.addEventListener("touchstart",p=>{if(T.contains(p.target))return;const _=p.touches[0].clientX;(0<_&&_<20&&!b||b)&&(q=!0,V=_)}),document.addEventListener("touchmove",p=>{if(q){const _=p.touches[0].clientX;Z=_;const C=(_-V)/10;H.style.setProperty("--translate-x",`-${ee(0,b?0-C:18.75-C,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(q){const p=(Z-V)/10;n(0,b=b?p>-(18.75/2):p>18.75/2)}q=!1})});const fe=p=>{c(p),n(0,b=!1)};function me(p){Ce[p?"unshift":"push"](()=>{S=p,n(3,S)})}return e.$$.update=()=>{if(e.$$.dirty&1){const p=document.querySelector("#sidebar");p&&Zt(p,b)}},[b,h,u,S,i,a,c,d,E,v,O,R,de,H,fe,me]}class tn extends Oe{constructor(t){super(),Le(this,t,en,Qt,ue,{})}}new tn({target:document.querySelector("#app")});
|