mirror of
https://github.com/imezx/Warp.git
synced 2025-04-24 07:00:03 +00:00
3 lines
80 KiB
JavaScript
3 lines
80 KiB
JavaScript
|
function ts(e,t){const n=Object.create(null),s=e.split(",");for(let r=0;r<s.length;r++)n[s[r]]=!0;return t?r=>!!n[r.toLowerCase()]:r=>!!n[r]}const te={},dt=[],Pe=()=>{},Wi=()=>!1,Vi=/^on[^a-z]/,Bt=e=>Vi.test(e),ns=e=>e.startsWith("onUpdate:"),ie=Object.assign,ss=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},qi=Object.prototype.hasOwnProperty,z=(e,t)=>qi.call(e,t),j=Array.isArray,ht=e=>pn(e)==="[object Map]",Tr=e=>pn(e)==="[object Set]",K=e=>typeof e=="function",se=e=>typeof e=="string",rs=e=>typeof e=="symbol",ee=e=>e!==null&&typeof e=="object",Ar=e=>ee(e)&&K(e.then)&&K(e.catch),Sr=Object.prototype.toString,pn=e=>Sr.call(e),zi=e=>pn(e).slice(8,-1),Or=e=>pn(e)==="[object Object]",is=e=>se(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Pt=ts(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),gn=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Yi=/-(\w)/g,Le=gn(e=>e.replace(Yi,(t,n)=>n?n.toUpperCase():"")),Ji=/\B([A-Z])/g,lt=gn(e=>e.replace(Ji,"-$1").toLowerCase()),mn=gn(e=>e.charAt(0).toUpperCase()+e.slice(1)),en=gn(e=>e?`on${mn(e)}`:""),Lt=(e,t)=>!Object.is(e,t),Fn=(e,t)=>{for(let n=0;n<e.length;n++)e[n](t)},sn=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},Xi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Qi=e=>{const t=se(e)?Number(e):NaN;return isNaN(t)?e:t};let Is;const kn=()=>Is||(Is=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function os(e){if(j(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=se(s)?to(s):os(s);if(r)for(const i in r)t[i]=r[i]}return t}else{if(se(e))return e;if(ee(e))return e}}const Zi=/;(?![^(]*\))/g,Gi=/:([^]+)/,eo=/\/\*[^]*?\*\//g;function to(e){const t={};return e.replace(eo,"").split(Zi).forEach(n=>{if(n){const s=n.split(Gi);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function ls(e){let t="";if(se(e))t=e;else if(j(e))for(let n=0;n<e.length;n++){const s=ls(e[n]);s&&(t+=s+" ")}else if(ee(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const no="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",so=ts(no);function Pr(e){return!!e||e===""}const ya=e=>se(e)?e:e==null?"":j(e)||ee(e)&&(e.toString===Sr||!K(e.toString))?JSON.stringify(e,Rr,2):String(e),Rr=(e,t)=>t&&t.__v_isRef?Rr(e,t.value):ht(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r])=>(n[`${s} =>`]=r,n),{})}:Tr(t)?{[`Set(${t.size})`]:[...t.values()]}:ee(t)&&!j(t)&&!Or(t)?String(t):t;let ye;class ro{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=ye,!t&&ye&&(this.index=(ye.scopes||(ye.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=ye;try{return ye=this,t()}finally{ye=n}}}on(){ye=this}off(){ye=this.parent}stop(t){if(this._active){let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.scopes)for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0,this._active=!1}}}function io(e,t=ye){t&&t.active&&t.effects.push(e)}function Ir(){return ye}function oo(e){ye&&ye.cleanups.push(e)}const cs=e=>{const t=new Set(e);return t.w=0,t.n=0,t},Fr=e=>(e.w&ze)>0,Mr=e=>(e.n&ze)>0,lo=({deps:e})=>{if(e.length)for(let t=0;t<e.length;t++)e[t].w|=ze},co=e=>{const{deps:t}=e;if(t.length){let n=0;for(let s=0;s<t.length;s++){const r=t[s];Fr(r)&&!Mr(r)?r.delete(e):t[n++]=r,r.w&=~ze,r.n&=~ze}t.length=n}},rn=new WeakMap;let St=0,ze=1;const Kn=30;let Se;const rt=Symbol(""),Wn=Symbol("");class as{constructor(t,n=null,s){this.fn=t,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,io(this,s)}run(){if(!this.active)return this.fn();let t=Se,n=We;for(;t;){if(t===this)return;t=t.parent}try{return this.parent=Se,Se=this,We=!0,ze=1<<++St,St<=Kn?lo(this):Fs(this),this.fn()}finally{St<=Kn&&co(this),ze=1<<--St
|
||
|
`),l=l.slice(0,-1),o&&(l=l.replace(/^ *(\$|>) /gm,"").trim()),da(l).then(()=>{n.classList.add("copied"),clearTimeout(e.get(n));const c=setTimeout(()=>{n.classList.remove("copied"),n.blur(),e.delete(n)},2e3);e.set(n,c)})}})}}async function da(e){try{return navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea"),n=document.activeElement;t.value=e,t.setAttribute("readonly",""),t.style.contain="strict",t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt";const s=document.getSelection(),r=s?s.rangeCount>0&&s.getRangeAt(0):null;document.body.appendChild(t),t.select(),t.selectionStart=0,t.selectionEnd=e.length,document.execCommand("copy"),document.body.removeChild(t),r&&(s.removeAllRanges(),s.addRange(r)),n&&n.focus()}}function Va(e,t){let n=[],s=!0;const r=i=>{if(s){s=!1;return}n.forEach(o=>document.head.removeChild(o)),n=[],i.forEach(o=>{const l=xr(o);document.head.appendChild(l),n.push(l)})};Zr(()=>{const i=e.data,o=t.value,l=i&&i.description,c=i&&i.frontmatter.head||[];document.title=ji(o,i);const u=l||o.description;let d=document.querySelector("meta[name=description]");d?d.setAttribute("content",u):xr(["meta",{name:"description",content:u}]),r(Di(o.head,pa(c)))})}function xr([e,t,n]){const s=document.createElement(e);for(const r in t)s.setAttribute(r,t[r]);return n&&(s.innerHTML=n),s}function ha(e){return e[0]==="meta"&&e[1]&&e[1].name==="description"}function pa(e){return e.filter(t=>!ha(t))}const Un=new Set,Ui=()=>document.createElement("link"),ga=e=>{const t=Ui();t.rel="prefetch",t.href=e,document.head.appendChild(t)},ma=e=>{const t=new XMLHttpRequest;t.open("GET",e,t.withCredentials=!0),t.send()};let Gt;const _a=Ee&&(Gt=Ui())&&Gt.relList&&Gt.relList.supports&&Gt.relList.supports("prefetch")?ga:ma;function qa(){if(!Ee||!window.IntersectionObserver)return;let e;if((e=navigator.connection)&&(e.saveData||/2g/.test(e.effectiveType)))return;const t=window.requestIdleCallback||setTimeout;let n=null;const s=()=>{n&&n.disconnect(),n=new IntersectionObserver(i=>{i.forEach(o=>{if(o.isIntersecting){const l=o.target;n.unobserve(l);const{pathname:c}=l;if(!Un.has(c)){Un.add(c);const u=ca(c);u&&_a(u)}}})}),t(()=>{document.querySelectorAll("#app a").forEach(i=>{const{hostname:o,pathname:l}=new URL(i.href instanceof SVGAnimatedString?i.href.animVal:i.href,i.baseURI),c=l.match(/\.\w+$/);c&&c[0]!==".html"||i.target!=="_blank"&&o===location.hostname&&(l!==location.pathname?n.observe(i):Un.add(l))})})};xt(s);const r=Bi();qe(()=>r.path,s),Sn(()=>{n&&n.disconnect()})}export{aa as $,wa as A,hl as B,Ca as C,xa as D,Kr as E,pe as F,Da as G,ae as H,Ea as I,Ni as J,Bi as K,Ul as L,_t as M,os as N,wn as O,$a as P,Pa as Q,bn as R,Ha as S,Ai as T,Sl as U,Fa as V,Aa as W,Ia as X,Sa as Y,Va as Z,La as _,Ci as a,ja as a0,ia as a1,Ua as a2,ka as a3,st as a4,Ma as a5,Ba as a6,ca as a7,Na as a8,qa as a9,Wa as aa,Ka as ab,Gn as ac,bi as b,Oa as c,si as d,Ra as e,yr as f,ce as g,be as h,Gc as i,xt as j,wi as k,Vr as l,va as m,ls as n,_i as o,ba as p,Zc as q,Ta as r,Ee as s,ya as t,oa as u,Bc as v,Zo as w,qe as x,Zr as y,Sn as z};
|