@unocss/runtime 0.53.6 → 0.54.1

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/core.global.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{function Ee(t){let e=t.length,r=-1,n,s="",i=t.charCodeAt(0);for(;++r<e;){if(n=t.charCodeAt(r),n===0){s+="\uFFFD";continue}if(n===44){s+="\\,";continue}if(n>=1&&n<=31||n===127||r===0&&n>=48&&n<=57||r===1&&n>=48&&n<=57&&i===45){s+=`\\${n.toString(16)} `;continue}if(r===0&&e===1&&n===45){s+=`\\${t.charAt(r)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){s+=t.charAt(r);continue}s+=`\\${t.charAt(r)}`}return s}var H=Ee;function A(t=[]){return Array.isArray(t)?t:[t]}function P(t){return Array.from(new Set(t))}function E(t){return typeof t=="string"}function L(t){return E(t)?t:(Array.isArray(t)?t:Object.entries(t)).filter(e=>e[1]!=null)}function ee(t){return Array.isArray(t)?t.find(e=>!Array.isArray(e)||Array.isArray(e[0]))?t.map(e=>L(e)):[t]:[L(t)]}function Re(t){return t.filter(([e,r],n)=>{if(e.startsWith("$$"))return!1;for(let s=n-1;s>=0;s--)if(t[s][0]===e&&t[s][1]===r)return!1;return!0})}function F(t){return t==null?"":Re(t).map(([e,r])=>r!=null?`${e}:${r};`:void 0).filter(Boolean).join("")}function G(t){return t&&typeof t=="object"&&!Array.isArray(t)}function Y(t,e,r=!1){let n=t,s=e;if(Array.isArray(s))return r&&Array.isArray(s)?[...n,...s]:[...s];let i={...n};return G(n)&&G(s)&&Object.keys(s).forEach(o=>{G(n[o])&&G(s[o])||Array.isArray(n[o])&&Array.isArray(s[o])?i[o]=Y(n[o],s[o],r):Object.assign(i,{[o]:s[o]})}),i}function k(t){let e,r,n;if(Array.isArray(t)){for(r=Array(e=t.length);e--;)r[e]=(n=t[e])&&typeof n=="object"?k(n):n;return r}if(Object.prototype.toString.call(t)==="[object Object]"){r={};for(e in t)e==="__proto__"?Object.defineProperty(r,e,{value:k(t[e]),configurable:!0,enumerable:!0,writable:!0}):r[e]=(n=t[e])&&typeof n=="object"?k(n):n;return r}return t}function te(t){return E(t[0])}function re(t){return E(t[0])}var q="$$shortcut-no-merge";function ne(t){return typeof t=="function"?{match:t}:t}function Z(t){return t.length===3}function se(t){return t!=null}function ie(){}var B=class{_map=new Map;get(e,r){let n=this._map.get(e);if(n)return n.get(r)}getFallback(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.has(r)||s.set(r,n),s.get(r)}set(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.set(r,n),this}has(e,r){return this._map.get(e)?.has(r)}delete(e,r){return this._map.get(e)?.delete(r)||!1}deleteTop(e){return this._map.delete(e)}map(e){return Array.from(this._map.entries()).flatMap(([r,n])=>Array.from(n.entries()).map(([s,i])=>e(i,r,s)))}};var I={};function ve(t=["-",":"]){let e=t.join("|");return I[e]||(I[e]=new RegExp(`((?:[!@<~\\w+:_/-]|\\[&?>?:?\\S*\\])+?)(${e})\\(((?:[~!<>\\w\\s:/\\\\,%#.$?-]|\\[.*?\\])+?)\\)(?!\\s*?=>)`,"gm")),I[e].lastIndex=0,I[e]}function we(t,e=["-",":"],r=5){let n=ve(e),s=!1,i=t.toString(),o=new Set;do{let l=i;i=i.replace(n,(f,u,a,d)=>e.includes(a)?(o.add(u+a),d.split(/\s/g).filter(Boolean).map(y=>y==="~"?u:y.replace(/^(!?)(.*)/,`$1${u}${a}$2`)).join(" ")):f),s=i!==l,r-=1}while(s&&r);return{prefixes:Array.from(o),expanded:i,hasChanged:s}}function oe(t,e=["-",":"],r=5){let{expanded:n}=we(t.toString(),e,r);return typeof t=="string"?n:t.length()?t.overwrite(0,t.original.length,n):t}var ae=new Set;function ce(t){ae.has(t)||(console.warn("[unocss]",t),ae.add(t))}var le=/[\\:]?[\s'"`;{}]+/g;function Ae(t){return[...new Set(t.split(le))]}var z={name:"@unocss/core/extractor-split",order:0,extract({code:t}){return Ae(t)}};function ue(){return{events:{},emit(t,...e){(this.events[t]||[]).forEach(r=>r(...e))},on(t,e){return(this.events[t]=this.events[t]||[]).push(e),()=>this.events[t]=(this.events[t]||[]).filter(r=>r!==e)}}}var N="default",W="preflights",Ue="shortcuts",fe={[W]:-100,[Ue]:-10,[N]:0};function de(t){return A(t).flatMap(e=>Array.isArray(e)?[e]:Object.entries(e))}var pe="_uno_resolved";function Me(t){if(pe in t)return t;t={...t},Object.defineProperty(t,pe,{value:!0,enumerable:!1});let e=t.shortcuts?de(t.shortcuts):void 0;if(t.shortcuts=e,t.prefix||t.layer){let r=n=>{n[2]||(n[2]={});let s=n[2];s.prefix==null&&t.prefix&&(s.prefix=A(t.prefix)),s.layer==null&&t.layer&&(s.layer=t.layer)};e?.forEach(r),t.rules?.forEach(r)}return t}function he(t){let e=Me(t);if(!e.presets)return[e];let r=(e.presets||[]).flatMap(A).flatMap(he);return[e,...r]}function J(t={},e={}){let r=Object.assign({},e,t),n=P((r.presets||[]).flatMap(A).flatMap(he)),s=[...n.filter(c=>c.enforce==="pre"),...n.filter(c=>!c.enforce),...n.filter(c=>c.enforce==="post")],i=[...s,r],o=[...i].reverse(),l=Object.assign({},fe,...i.map(c=>c.layers));function f(c){return P(i.flatMap(x=>A(x[c]||[])))}let u=f("extractors"),a=o.find(c=>c.extractorDefault!==void 0)?.extractorDefault;a===void 0&&(a=z),a&&!u.includes(a)&&u.unshift(a),u.sort((c,x)=>(c.order||0)-(x.order||0));let d=f("rules"),y={},C=d.length,v=d.map((c,x)=>{if(te(c)){A(c[2]?.prefix||"").forEach(U=>{y[U+c[0]]=[x,c[1],c[2],c]});return}return[x,...c]}).filter(Boolean).reverse(),w=Ve(i.map(c=>c.theme)),S=f("extendTheme");for(let c of S)w=c(w)||w;let b={templates:P(i.flatMap(c=>A(c.autocomplete?.templates))),extractors:i.flatMap(c=>A(c.autocomplete?.extractors)).sort((c,x)=>(c.order||0)-(x.order||0))},T=f("separators");T.length||(T=[":","-"]);let h={mergeSelectors:!0,warn:!0,blocklist:[],sortLayers:c=>c,...r,presets:s,envMode:r.envMode||"build",shortcutsLayer:r.shortcutsLayer||"shortcuts",layers:l,theme:w,rulesSize:C,rulesDynamic:v,rulesStaticMap:y,preprocess:f("preprocess"),postprocess:f("postprocess"),preflights:f("preflights"),autocomplete:b,variants:f("variants").map(ne).sort((c,x)=>(c.order||0)-(x.order||0)),shortcuts:de(f("shortcuts")).reverse(),extractors:u,safelist:f("safelist"),separators:T};for(let c of i)c?.configResolved?.(h);return h}function Ve(t){return t.map(e=>e?k(e):{}).reduce((e,r)=>Y(e,r),{})}var me="0.53.6";var Q=class{constructor(e={},r={}){this.userConfig=e;this.defaults=r;this.config=J(e,r),this.events.emit("config",this.config)}version=me;_cache=new Map;config;blocked=new Set;parentOrders=new Map;events=ue();setConfig(e,r){e&&(r&&(this.defaults=r),this.userConfig=e,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=J(e,this.defaults),this.events.emit("config",this.config))}async applyExtractors(e,r,n=new Set){let s={original:e,code:e,id:r,extracted:n};for(let i of this.config.extractors){let o=await i.extract?.(s);if(o)for(let l of o)n.add(l)}return n}makeContext(e,r){let n={rawSelector:e,currentSelector:r[1],theme:this.config.theme,generator:this,variantHandlers:r[2],constructCSS:(...s)=>this.constructCustomCSS(n,...s),variantMatch:r};return n}async parseToken(e,r){if(this.blocked.has(e))return;let n=`${e}${r?` ${r}`:""}`;if(this._cache.has(n))return this._cache.get(n);let s=e;for(let u of this.config.preprocess)s=u(e);if(this.isBlocked(s)){this.blocked.add(e),this._cache.set(n,null);return}let i=await this.matchVariants(e,s);if(!i||this.isBlocked(i[1])){this.blocked.add(e),this._cache.set(n,null);return}let o=this.makeContext(e,[r||i[0],i[1],i[2],i[3]]);this.config.details&&(o.variants=[...i[3]]);let l=await this.expandShortcut(o.currentSelector,o),f=l?await this.stringifyShortcuts(o.variantMatch,o,l[0],l[1]):(await this.parseUtil(o.variantMatch,o))?.map(u=>this.stringifyUtil(u,o)).filter(se);if(f?.length)return this._cache.set(n,f),f;this._cache.set(n,null)}async generate(e,r={}){let{id:n,scope:s,preflights:i=!0,safelist:o=!0,minify:l=!1}=r,f=E(e)?await this.applyExtractors(e,n):Array.isArray(e)?new Set(e):e;o&&this.config.safelist.forEach(h=>f.add(h));let u=l?"":`
2
- `,a=new Set([N]),d=new Set,y=new Map,C={},v=Array.from(f).map(async h=>{if(d.has(h))return;let c=await this.parseToken(h);if(c!=null){d.add(h);for(let x of c){let R=x[3]||"",U=x[4]?.layer;y.has(R)||y.set(R,[]),y.get(R).push(x),U&&a.add(U)}}});await Promise.all(v),await(async()=>{if(!i)return;let h={generator:this,theme:this.config.theme},c=new Set([]);this.config.preflights.forEach(({layer:x=W})=>{a.add(x),c.add(x)}),C=Object.fromEntries(await Promise.all(Array.from(c).map(async x=>{let U=(await Promise.all(this.config.preflights.filter(_=>(_.layer||W)===x).map(async _=>await _.getCSS(h)))).filter(Boolean).join(u);return[x,U]})))})();let w=this.config.sortLayers(Array.from(a).sort((h,c)=>(this.config.layers[h]??0)-(this.config.layers[c]??0)||h.localeCompare(c))),S={},b=h=>{if(S[h])return S[h];let c=Array.from(y).sort((R,U)=>(this.parentOrders.get(R[0])??0)-(this.parentOrders.get(U[0])??0)||R[0]?.localeCompare(U[0]||"")||0).map(([R,U])=>{let _=U.length,D=U.filter(p=>(p[4]?.layer||N)===h).sort((p,g)=>p[0]-g[0]||(p[4]?.sort||0)-(g[4]?.sort||0)||p[5]?.currentSelector?.localeCompare(g[5]?.currentSelector??"")||p[1]?.localeCompare(g[1]||"")||p[2]?.localeCompare(g[2]||"")||0).map(([,p,g,,M,,V])=>[[[(p&&Oe(p,s))??"",M?.sort??0]],g,!!(V??M?.noMerge)]);if(!D.length)return;let K=D.reverse().map(([p,g,M],V)=>{if(!M&&this.config.mergeSelectors)for(let O=V+1;O<_;O++){let $=D[O];if($&&!$[2]&&(p&&$[0]||p==null&&$[0]==null)&&$[1]===g)return p&&$[0]&&$[0].push(...p),null}let j=p?P(p.sort((O,$)=>O[1]-$[1]||O[0]?.localeCompare($[0]||"")||0).map(O=>O[0]).filter(Boolean)):[];return j.length?`${j.join(`,${u}`)}{${g}}`:g}).filter(Boolean).reverse().join(u);if(!R)return K;let m=R.split(" $$ ");return`${m.join("{")}{${u}${K}${u}}${m.map(p=>"").join("}")}`}).filter(Boolean).join(u);i&&(c=[C[h],c].filter(Boolean).join(u));let x=l?"":`/* layer: ${h} */${u}`;return S[h]=c?x+c:""},T=(h=w,c)=>h.filter(x=>!c?.includes(x)).map(x=>b(x)||"").filter(Boolean).join(u);return{get css(){return T()},layers:w,matched:d,getLayers:T,getLayer:b}}async matchVariants(e,r){let n=new Set,s=[],i=r||e,o=!1,l={rawSelector:e,theme:this.config.theme,generator:this};for(;;){o=!1;for(let f of this.config.variants){if(!f.multiPass&&n.has(f))continue;let u=await f.match(i,l);if(u){E(u)&&(u={matcher:u}),i=u.matcher,s.unshift(u),n.add(f),o=!0;break}}if(!o)break;if(s.length>500)throw new Error(`Too many variants applied to "${e}"`)}return[e,i,s,n]}applyVariants(e,r=e[4],n=e[1]){let i=r.slice().sort((u,a)=>(u.order||0)-(a.order||0)).reduceRight((u,a)=>d=>{let y=a.body?.(d.entries)||d.entries,C=Array.isArray(a.parent)?a.parent:[a.parent,void 0];return(a.handle??De)({...d,entries:y,selector:a.selector?.(d.selector,y)||d.selector,parent:C[0]||d.parent,parentOrder:C[1]||d.parentOrder,layer:a.layer||d.layer,sort:a.sort||d.sort},u)},u=>u)({prefix:"",selector:Pe(n),pseudo:"",entries:e[2]}),{parent:o,parentOrder:l}=i;o!=null&&l!=null&&this.parentOrders.set(o,l);let f={selector:[i.prefix,i.selector,i.pseudo].join(""),entries:i.entries,parent:o,layer:i.layer,sort:i.sort,noMerge:i.noMerge};for(let u of this.config.postprocess)u(f);return f}constructCustomCSS(e,r,n){let s=L(r);if(E(s))return s;let{selector:i,entries:o,parent:l}=this.applyVariants([0,n||e.rawSelector,s,void 0,e.variantHandlers]),f=`${i}{${F(o)}}`;return l?`${l}{${f}}`:f}async parseUtil(e,r,n=!1,s){let[i,o,l]=E(e)?await this.matchVariants(e):e;this.config.details&&(r.rules=r.rules??[]);let f=this.config.rulesStaticMap[o];if(f&&f[1]&&(n||!f[2]?.internal)){this.config.details&&r.rules.push(f[3]);let a=f[0],d=L(f[1]),y=f[2];return E(d)?[[a,d,y]]:[[a,i,d,y,l]]}r.variantHandlers=l;let{rulesDynamic:u}=this.config;for(let[a,d,y,C]of u){if(C?.internal&&!n)continue;let v=o;if(C?.prefix){let T=A(C.prefix);if(s){let h=A(s);if(!T.some(c=>h.includes(c)))continue}else{let h=T.find(c=>o.startsWith(c));if(h==null)continue;v=o.slice(h.length)}}let w=v.match(d);if(!w)continue;let S=await y(w,r);if(!S)continue;this.config.details&&r.rules.push([d,y,C]);let b=ee(S).filter(T=>T.length);if(b.length)return b.map(T=>E(T)?[a,T,C]:[a,i,T,C,l])}}stringifyUtil(e,r){if(!e)return;if(Z(e))return[e[0],void 0,e[1],void 0,e[2],this.config.details?r:void 0,void 0];let{selector:n,entries:s,parent:i,layer:o,sort:l,noMerge:f}=this.applyVariants(e),u=F(s);if(!u)return;let{layer:a,sort:d,...y}=e[3]??{},C={...y,layer:o??a,sort:l??d};return[e[0],n,u,i,C,this.config.details?r:void 0,f]}async expandShortcut(e,r,n=5){if(n===0)return;let s=this.config.details?l=>{r.shortcuts=r.shortcuts??[],r.shortcuts.push(l)}:ie,i,o;for(let l of this.config.shortcuts){let f=e;if(l[2]?.prefix){let a=A(l[2].prefix).find(d=>e.startsWith(d));if(a==null)continue;f=e.slice(a.length)}if(re(l)){if(l[0]===f){i=i||l[2],o=l[1],s(l);break}}else{let u=f.match(l[0]);if(u&&(o=l[1](u,r)),o){i=i||l[2],s(l);break}}}if(E(o)&&(o=oe(o.trim()).split(/\s+/g)),!o){let[l,f]=E(e)?await this.matchVariants(e):e;if(l!==f){let u=await this.expandShortcut(f,r,n-1);u&&(o=u[0].map(a=>E(a)?l.replace(f,a):a))}}if(o)return[(await Promise.all(o.map(async l=>(E(l)?(await this.expandShortcut(l,r,n-1))?.[0]:void 0)||[l]))).flat(1).filter(Boolean),i]}async stringifyShortcuts(e,r,n,s={layer:this.config.shortcutsLayer}){let i=new B,o=(await Promise.all(P(n).map(async a=>{let d=E(a)?await this.parseUtil(a,r,!0,s.prefix):[[Number.POSITIVE_INFINITY,"{inline}",L(a),void 0,[]]];return d||ce(`unmatched utility "${a}" in shortcut "${e[1]}"`),d||[]}))).flat(1).filter(Boolean).sort((a,d)=>a[0]-d[0]),[l,,f]=e,u=[];for(let a of o){if(Z(a)){u.push([a[0],void 0,a[1],void 0,a[2],r,void 0]);continue}let{selector:d,entries:y,parent:C,sort:v,noMerge:w}=this.applyVariants(a,[...a[4],...f],l);i.getFallback(d,C,[[],a[0]])[0].push([y,!!(w??a[3]?.noMerge),v??0])}return u.concat(i.map(([a,d],y,C)=>{let v=(S,b,T)=>{let h=Math.max(...T.map(x=>x[1])),c=T.map(x=>x[0]);return(S?[c.flat(1)]:c).map(x=>{let R=F(x);if(R)return[d,y,R,C,{...s,noMerge:b,sort:h},r,void 0]})};return[[a.filter(([,S])=>S).map(([S,,b])=>[S,b]),!0],[a.filter(([,S])=>!S).map(([S,,b])=>[S,b]),!1]].map(([S,b])=>[...v(!1,b,S.filter(([T])=>T.some(h=>h[0]===q))),...v(!0,b,S.filter(([T])=>T.every(h=>h[0]!==q)))])}).flat(2).filter(Boolean))}isBlocked(e){return!e||this.config.blocklist.some(r=>E(r)?r===e:r.test(e))}};function xe(t,e){return new Q(t,e)}var _e=/\s\$\$\s+/g;function je(t){return t.match(/\s\$\$\s/)}function Oe(t,e){return je(t)?t.replace(_e,e?` ${e} `:" "):e?`${e} ${t}`:t}var ge=/^\[(.+?)(~?=)"(.*)"\]$/;function Pe(t){return ge.test(t)?t.replace(ge,(e,r,n,s)=>`[${H(r)}${n}"${H(s)}"]`):`.${H(t)}`}function De(t,e){return e(t)}function Le(t){return t.replace(/-(\w)/g,(e,r)=>r?r.toUpperCase():"")}function ye(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Se(t){return t.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase()}var Te=["Webkit","Moz","ms"];function Ce(t){let e={};function r(n){let s=e[n];if(s)return s;let i=Le(n);if(i!=="filter"&&i in t)return e[n]=Se(i);i=ye(i);for(let o=0;o<Te.length;o++){let l=`${Te[o]}${i}`;if(l in t)return e[n]=Se(ye(l))}return n}return({entries:n})=>n.forEach(s=>{s[0].startsWith("--")||(s[0]=r(s[0]))})}function be(t){return t.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<")}function X(t={}){if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let e=window,r=window.document,n=()=>r.documentElement,s=e.__unocss||{},i=Object.assign({},t,s.runtime),o=i.defaults||{},l=i.cloakAttribute??"un-cloak";i.autoPrefix&&(o.postprocess=A(o.postprocess)).unshift(Ce(r.createElement("div").style)),i.configResolved?.(s,o);let f=xe(s,o),u=new Map,a=!0,d=new Set,y,C,v=[],w=()=>new Promise(m=>{v.push(m),C!=null&&clearTimeout(C),C=setTimeout(()=>T().then(()=>{let p=v;v=[],p.forEach(g=>g())}),0)});function S(m){if(m.nodeType!==1)return;let p=m;p.hasAttribute(l)&&p.removeAttribute(l),p.querySelectorAll(`[${l}]`).forEach(g=>{g.removeAttribute(l)})}function b(m,p){let g=u.get(m);if(!g)if(g=r.createElement("style"),g.setAttribute("data-unocss-runtime-layer",m),u.set(m,g),p==null)n().prepend(g);else{let M=b(p),V=M.parentNode;V?V.insertBefore(g,M.nextSibling):n().prepend(g)}return g}async function T(){let m=await f.generate(d);return m.layers.reduce((p,g)=>(b(g,p).innerHTML=m.getLayer(g)??"",g),void 0),d=m.matched,{...m,getStyleElement:p=>u.get(p),getStyleElements:()=>u}}async function h(m){let p=d.size;await f.applyExtractors(m,void 0,d),p!==d.size&&await w()}async function c(){let m=r.body,p=m&&m.outerHTML;p&&(await h(`${p} ${be(p)}`),S(n()),S(m))}let x=new MutationObserver(m=>{a||m.forEach(async p=>{if(p.target.nodeType!==1)return;let g=p.target;for(let M of u)if(g===M[1])return;if(p.type==="childList")p.addedNodes.forEach(async M=>{if(M.nodeType!==1)return;let V=M;y&&!y(V)||(await h(V.outerHTML),S(V))});else{if(y&&!y(g))return;if(p.attributeName!==l){let M=Array.from(g.attributes).map(j=>j.value?`${j.name}="${j.value}"`:j.name).join(" "),V=`<${g.tagName.toLowerCase()} ${M}>`;await h(V)}g.hasAttribute(l)&&g.removeAttribute(l)}})}),R=!1;function U(){if(R)return;let m=n()||r.body;m&&(x.observe(m,{childList:!0,subtree:!0,attributes:!0}),R=!0)}function _(){i.bypassDefined&&ke(f.blocked),c(),U()}function D(){r.readyState==="loading"?e.addEventListener("DOMContentLoaded",_):_()}let K=e.__unocss_runtime=e.__unocss_runtime={version:f.version,uno:f,async extract(m){E(m)||(m.forEach(p=>d.add(p)),m=""),await h(m)},extractAll:c,inspect(m){y=m},toggleObserver(m){m===void 0?a=!a:a=!!m,!R&&!a&&D()},update:T};i.ready?.(K)!==!1&&(a=!1,D())}function ke(t=new Set){for(let e=0;e<document.styleSheets.length;e++){let r=document.styleSheets[e],n;try{if(n=r.cssRules||r.rules,!n)continue;Array.from(n).flatMap(s=>s.selectorText?.split(/,/g)||[]).forEach(s=>{s&&(s=s.trim(),s.startsWith(".")&&(s=s.slice(1)),t.add(s))})}catch{continue}}return t}X();})();
1
+ "use strict";(()=>{function Re(t){let e=t.length,r=-1,n,s="",i=t.charCodeAt(0);for(;++r<e;){if(n=t.charCodeAt(r),n===0){s+="\uFFFD";continue}if(n===44){s+="\\,";continue}if(n>=1&&n<=31||n===127||r===0&&n>=48&&n<=57||r===1&&n>=48&&n<=57&&i===45){s+=`\\${n.toString(16)} `;continue}if(r===0&&e===1&&n===45){s+=`\\${t.charAt(r)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){s+=t.charAt(r);continue}s+=`\\${t.charAt(r)}`}return s}var G=Re;function w(t=[]){return Array.isArray(t)?t:[t]}function P(t){return Array.from(new Set(t))}function R(t){return typeof t=="string"}function L(t){return R(t)?t:(Array.isArray(t)?t:Object.entries(t)).filter(e=>e[1]!=null)}function ee(t){return Array.isArray(t)?t.find(e=>!Array.isArray(e)||Array.isArray(e[0]))?t.map(e=>L(e)):[t]:[L(t)]}function Ee(t){return t.filter(([e,r],n)=>{if(e.startsWith("$$"))return!1;for(let s=n-1;s>=0;s--)if(t[s][0]===e&&t[s][1]===r)return!1;return!0})}function F(t){return t==null?"":Ee(t).map(([e,r])=>r!=null?`${e}:${r};`:void 0).filter(Boolean).join("")}function K(t){return t&&typeof t=="object"&&!Array.isArray(t)}function Y(t,e,r=!1){let n=t,s=e;if(Array.isArray(s))return r&&Array.isArray(s)?[...n,...s]:[...s];let i={...n};return K(n)&&K(s)&&Object.keys(s).forEach(a=>{K(n[a])&&K(s[a])||Array.isArray(n[a])&&Array.isArray(s[a])?i[a]=Y(n[a],s[a],r):Object.assign(i,{[a]:s[a]})}),i}function k(t){let e,r,n;if(Array.isArray(t)){for(r=Array(e=t.length);e--;)r[e]=(n=t[e])&&typeof n=="object"?k(n):n;return r}if(Object.prototype.toString.call(t)==="[object Object]"){r={};for(e in t)e==="__proto__"?Object.defineProperty(r,e,{value:k(t[e]),configurable:!0,enumerable:!0,writable:!0}):r[e]=(n=t[e])&&typeof n=="object"?k(n):n;return r}return t}function te(t){return R(t[0])}function re(t){return R(t[0])}var q="$$shortcut-no-merge";function ne(t){return typeof t=="function"?{match:t}:t}function Z(t){return t.length===3}function se(t){return t!=null}function ie(){}var N=class{_map=new Map;get(e,r){let n=this._map.get(e);if(n)return n.get(r)}getFallback(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.has(r)||s.set(r,n),s.get(r)}set(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.set(r,n),this}has(e,r){return this._map.get(e)?.has(r)}delete(e,r){return this._map.get(e)?.delete(r)||!1}deleteTop(e){return this._map.delete(e)}map(e){return Array.from(this._map.entries()).flatMap(([r,n])=>Array.from(n.entries()).map(([s,i])=>e(i,r,s)))}};var B={};function ve(t=["-",":"]){let e=t.join("|");return B[e]||(B[e]=new RegExp(`((?:[!@<~\\w+:_/-]|\\[&?>?:?\\S*\\])+?)(${e})\\(((?:[~!<>\\w\\s:/\\\\,%#.$?-]|\\[.*?\\])+?)\\)(?!\\s*?=>)`,"gm")),B[e].lastIndex=0,B[e]}function Ae(t,e=["-",":"],r=5){let n=ve(e),s,i=t.toString(),a=new Set,l=new Map;do s=!1,i=i.replace(n,(c,o,p,x,C)=>{if(!e.includes(p))return c;s=!0,a.add(o+p);let A=C+o.length+p.length+1,E={length:c.length,items:[]};l.set(C,E);for(let S of[...x.matchAll(/\S+/g)]){let b=A+S.index,T=l.get(b)?.items;T?l.delete(b):T=[{offset:b,length:S[0].length,className:S[0]}];for(let h of T)h.className=h.className==="~"?o:h.className.replace(/^(!?)(.*)/,`$1${o}${p}$2`),E.items.push(h)}return"$".repeat(c.length)}),r-=1;while(s&&r);let f;if(typeof t=="string"){f="";let c=0;for(let[o,p]of l)f+=t.slice(c,o),f+=p.items.map(x=>x.className).join(" "),c=o+p.length;f+=t.slice(c)}else{f=t;for(let[c,o]of l)f.overwrite(c,c+o.length,o.items.map(p=>p.className).join(" "))}return{prefixes:Array.from(a),hasChanged:s,groupsByOffset:l,get expanded(){return f.toString()}}}function oe(t,e=["-",":"],r=5){let n=Ae(t,e,r);return typeof t=="string"?n.expanded:t}var ae=new Set;function ce(t){ae.has(t)||(console.warn("[unocss]",t),ae.add(t))}var le=/[\\:]?[\s'"`;{}]+/g;function we(t){return[...new Set(t.split(le))]}var I={name:"@unocss/core/extractor-split",order:0,extract({code:t}){return we(t)}};function ue(){return{events:{},emit(t,...e){(this.events[t]||[]).forEach(r=>r(...e))},on(t,e){return(this.events[t]=this.events[t]||[]).push(e),()=>this.events[t]=(this.events[t]||[]).filter(r=>r!==e)}}}var z="default",W="preflights",Me="shortcuts",Ue="imports",fe={[Ue]:-200,[W]:-100,[Me]:-10,[z]:0};function de(t){return w(t).flatMap(e=>Array.isArray(e)?[e]:Object.entries(e))}var pe="_uno_resolved";function Ve(t){if(pe in t)return t;t={...t},Object.defineProperty(t,pe,{value:!0,enumerable:!1});let e=t.shortcuts?de(t.shortcuts):void 0;if(t.shortcuts=e,t.prefix||t.layer){let r=n=>{n[2]||(n[2]={});let s=n[2];s.prefix==null&&t.prefix&&(s.prefix=w(t.prefix)),s.layer==null&&t.layer&&(s.layer=t.layer)};e?.forEach(r),t.rules?.forEach(r)}return t}function he(t){let e=Ve(t);if(!e.presets)return[e];let r=(e.presets||[]).flatMap(w).flatMap(he);return[e,...r]}function J(t={},e={}){let r=Object.assign({},e,t),n=P((r.presets||[]).flatMap(w).flatMap(he)),s=[...n.filter(u=>u.enforce==="pre"),...n.filter(u=>!u.enforce),...n.filter(u=>u.enforce==="post")],i=[...s,r],a=[...i].reverse(),l=Object.assign({},fe,...i.map(u=>u.layers));function f(u){return P(i.flatMap(y=>w(y[u]||[])))}let c=f("extractors"),o=a.find(u=>u.extractorDefault!==void 0)?.extractorDefault;o===void 0&&(o=I),o&&!c.includes(o)&&c.unshift(o),c.sort((u,y)=>(u.order||0)-(y.order||0));let p=f("rules"),x={},C=p.length,A=p.map((u,y)=>{if(te(u)){w(u[2]?.prefix||"").forEach(M=>{x[M+u[0]]=[y,u[1],u[2],u]});return}return[y,...u]}).filter(Boolean).reverse(),E=$e(i.map(u=>u.theme)),S=f("extendTheme");for(let u of S)E=u(E)||E;let b={templates:P(i.flatMap(u=>w(u.autocomplete?.templates))),extractors:i.flatMap(u=>w(u.autocomplete?.extractors)).sort((u,y)=>(u.order||0)-(y.order||0)),shorthands:_e(i.map(u=>u.autocomplete?.shorthands||{}))},T=f("separators");T.length||(T=[":","-"]);let h={mergeSelectors:!0,warn:!0,blocklist:[],sortLayers:u=>u,...r,presets:s,envMode:r.envMode||"build",shortcutsLayer:r.shortcutsLayer||"shortcuts",layers:l,theme:E,rulesSize:C,rulesDynamic:A,rulesStaticMap:x,preprocess:f("preprocess"),postprocess:f("postprocess"),preflights:f("preflights"),autocomplete:b,variants:f("variants").map(ne).sort((u,y)=>(u.order||0)-(y.order||0)),shortcuts:de(f("shortcuts")).reverse(),extractors:c,safelist:f("safelist"),separators:T};for(let u of i)u?.configResolved?.(h);return h}function $e(t){return t.map(e=>e?k(e):{}).reduce((e,r)=>Y(e,r),{})}function _e(t){return t.reduce((e,r)=>{let n={};for(let s in r){let i=r[s];Array.isArray(i)?n[s]=`(${i.join("|")})`:n[s]=i}return{...e,...n}},{})}var me="0.54.1";var Q=class{constructor(e={},r={}){this.userConfig=e;this.defaults=r;this.config=J(e,r),this.events.emit("config",this.config)}version=me;_cache=new Map;config;blocked=new Set;parentOrders=new Map;events=ue();setConfig(e,r){e&&(r&&(this.defaults=r),this.userConfig=e,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=J(e,this.defaults),this.events.emit("config",this.config))}async applyExtractors(e,r,n=new Set){let s={original:e,code:e,id:r,extracted:n};for(let i of this.config.extractors){let a=await i.extract?.(s);if(a)for(let l of a)n.add(l)}return n}makeContext(e,r){let n={rawSelector:e,currentSelector:r[1],theme:this.config.theme,generator:this,variantHandlers:r[2],constructCSS:(...s)=>this.constructCustomCSS(n,...s),variantMatch:r};return n}async parseToken(e,r){if(this.blocked.has(e))return;let n=`${e}${r?` ${r}`:""}`;if(this._cache.has(n))return this._cache.get(n);let s=e;for(let c of this.config.preprocess)s=c(e);if(this.isBlocked(s)){this.blocked.add(e),this._cache.set(n,null);return}let i=await this.matchVariants(e,s);if(!i||this.isBlocked(i[1])){this.blocked.add(e),this._cache.set(n,null);return}let a=this.makeContext(e,[r||i[0],i[1],i[2],i[3]]);this.config.details&&(a.variants=[...i[3]]);let l=await this.expandShortcut(a.currentSelector,a),f=l?await this.stringifyShortcuts(a.variantMatch,a,l[0],l[1]):(await this.parseUtil(a.variantMatch,a))?.map(c=>this.stringifyUtil(c,a)).filter(se);if(f?.length)return this._cache.set(n,f),f;this._cache.set(n,null)}async generate(e,r={}){let{id:n,scope:s,preflights:i=!0,safelist:a=!0,minify:l=!1}=r,f=R(e)?await this.applyExtractors(e,n):Array.isArray(e)?new Set(e):e;a&&this.config.safelist.forEach(h=>f.add(h));let c=l?"":`
2
+ `,o=new Set([z]),p=new Set,x=new Map,C={},A=Array.from(f).map(async h=>{if(p.has(h))return;let u=await this.parseToken(h);if(u!=null){p.add(h);for(let y of u){let v=y[3]||"",M=y[4]?.layer;x.has(v)||x.set(v,[]),x.get(v).push(y),M&&o.add(M)}}});await Promise.all(A),await(async()=>{if(!i)return;let h={generator:this,theme:this.config.theme},u=new Set([]);this.config.preflights.forEach(({layer:y=W})=>{o.add(y),u.add(y)}),C=Object.fromEntries(await Promise.all(Array.from(u).map(async y=>{let M=(await Promise.all(this.config.preflights.filter(_=>(_.layer||W)===y).map(async _=>await _.getCSS(h)))).filter(Boolean).join(c);return[y,M]})))})();let E=this.config.sortLayers(Array.from(o).sort((h,u)=>(this.config.layers[h]??0)-(this.config.layers[u]??0)||h.localeCompare(u))),S={},b=h=>{if(S[h])return S[h];let u=Array.from(x).sort((v,M)=>(this.parentOrders.get(v[0])??0)-(this.parentOrders.get(M[0])??0)||v[0]?.localeCompare(M[0]||"")||0).map(([v,M])=>{let _=M.length,D=M.filter(d=>(d[4]?.layer||z)===h).sort((d,g)=>d[0]-g[0]||(d[4]?.sort||0)-(g[4]?.sort||0)||d[5]?.currentSelector?.localeCompare(g[5]?.currentSelector??"")||d[1]?.localeCompare(g[1]||"")||d[2]?.localeCompare(g[2]||"")||0).map(([,d,g,,U,,V])=>[[[(d&&De(d,s))??"",U?.sort??0]],g,!!(V??U?.noMerge)]);if(!D.length)return;let H=D.reverse().map(([d,g,U],V)=>{if(!U&&this.config.mergeSelectors)for(let j=V+1;j<_;j++){let $=D[j];if($&&!$[2]&&(d&&$[0]||d==null&&$[0]==null)&&$[1]===g)return d&&$[0]&&$[0].push(...d),null}let O=d?P(d.sort((j,$)=>j[1]-$[1]||j[0]?.localeCompare($[0]||"")||0).map(j=>j[0]).filter(Boolean)):[];return O.length?`${O.join(`,${c}`)}{${g}}`:g}).filter(Boolean).reverse().join(c);if(!v)return H;let m=v.split(" $$ ");return`${m.join("{")}{${c}${H}${c}}${m.map(d=>"").join("}")}`}).filter(Boolean).join(c);i&&(u=[C[h],u].filter(Boolean).join(c));let y=l?"":`/* layer: ${h} */${c}`;return S[h]=u?y+u:""},T=(h=E,u)=>h.filter(y=>!u?.includes(y)).map(y=>b(y)||"").filter(Boolean).join(c);return{get css(){return T()},layers:E,matched:p,getLayers:T,getLayer:b}}async matchVariants(e,r){let n=new Set,s=[],i=r||e,a=!1,l={rawSelector:e,theme:this.config.theme,generator:this};for(;;){a=!1;for(let f of this.config.variants){if(!f.multiPass&&n.has(f))continue;let c=await f.match(i,l);if(c){if(R(c)){if(c===i)continue;c={matcher:c}}i=c.matcher,s.unshift(c),n.add(f),a=!0;break}}if(!a)break;if(s.length>500)throw new Error(`Too many variants applied to "${e}"`)}return[e,i,s,n]}applyVariants(e,r=e[4],n=e[1]){let i=r.slice().sort((c,o)=>(c.order||0)-(o.order||0)).reduceRight((c,o)=>p=>{let x=o.body?.(p.entries)||p.entries,C=Array.isArray(o.parent)?o.parent:[o.parent,void 0];return(o.handle??ke)({...p,entries:x,selector:o.selector?.(p.selector,x)||p.selector,parent:C[0]||p.parent,parentOrder:C[1]||p.parentOrder,layer:o.layer||p.layer,sort:o.sort||p.sort},c)},c=>c)({prefix:"",selector:Le(n),pseudo:"",entries:e[2]}),{parent:a,parentOrder:l}=i;a!=null&&l!=null&&this.parentOrders.set(a,l);let f={selector:[i.prefix,i.selector,i.pseudo].join(""),entries:i.entries,parent:a,layer:i.layer,sort:i.sort,noMerge:i.noMerge};for(let c of this.config.postprocess)c(f);return f}constructCustomCSS(e,r,n){let s=L(r);if(R(s))return s;let{selector:i,entries:a,parent:l}=this.applyVariants([0,n||e.rawSelector,s,void 0,e.variantHandlers]),f=`${i}{${F(a)}}`;return l?`${l}{${f}}`:f}async parseUtil(e,r,n=!1,s){let[i,a,l]=R(e)?await this.matchVariants(e):e;this.config.details&&(r.rules=r.rules??[]);let f=this.config.rulesStaticMap[a];if(f&&f[1]&&(n||!f[2]?.internal)){this.config.details&&r.rules.push(f[3]);let o=f[0],p=L(f[1]),x=f[2];return R(p)?[[o,p,x]]:[[o,i,p,x,l]]}r.variantHandlers=l;let{rulesDynamic:c}=this.config;for(let[o,p,x,C]of c){if(C?.internal&&!n)continue;let A=a;if(C?.prefix){let T=w(C.prefix);if(s){let h=w(s);if(!T.some(u=>h.includes(u)))continue}else{let h=T.find(u=>a.startsWith(u));if(h==null)continue;A=a.slice(h.length)}}let E=A.match(p);if(!E)continue;let S=await x(E,r);if(!S)continue;this.config.details&&r.rules.push([p,x,C]);let b=ee(S).filter(T=>T.length);if(b.length)return b.map(T=>R(T)?[o,T,C]:[o,i,T,C,l])}}stringifyUtil(e,r){if(!e)return;if(Z(e))return[e[0],void 0,e[1],void 0,e[2],this.config.details?r:void 0,void 0];let{selector:n,entries:s,parent:i,layer:a,sort:l,noMerge:f}=this.applyVariants(e),c=F(s);if(!c)return;let{layer:o,sort:p,...x}=e[3]??{},C={...x,layer:a??o,sort:l??p};return[e[0],n,c,i,C,this.config.details?r:void 0,f]}async expandShortcut(e,r,n=5){if(n===0)return;let s=this.config.details?l=>{r.shortcuts=r.shortcuts??[],r.shortcuts.push(l)}:ie,i,a;for(let l of this.config.shortcuts){let f=e;if(l[2]?.prefix){let o=w(l[2].prefix).find(p=>e.startsWith(p));if(o==null)continue;f=e.slice(o.length)}if(re(l)){if(l[0]===f){i=i||l[2],a=l[1],s(l);break}}else{let c=f.match(l[0]);if(c&&(a=l[1](c,r)),a){i=i||l[2],s(l);break}}}if(R(a)&&(a=oe(a.trim()).split(/\s+/g)),!a){let[l,f]=R(e)?await this.matchVariants(e):e;if(l!==f){let c=await this.expandShortcut(f,r,n-1);c&&(a=c[0].map(o=>R(o)?l.replace(f,o):o))}}if(a)return[(await Promise.all(a.map(async l=>(R(l)?(await this.expandShortcut(l,r,n-1))?.[0]:void 0)||[l]))).flat(1).filter(Boolean),i]}async stringifyShortcuts(e,r,n,s={layer:this.config.shortcutsLayer}){let i=new N,a=(await Promise.all(P(n).map(async o=>{let p=R(o)?await this.parseUtil(o,r,!0,s.prefix):[[Number.POSITIVE_INFINITY,"{inline}",L(o),void 0,[]]];return p||ce(`unmatched utility "${o}" in shortcut "${e[1]}"`),p||[]}))).flat(1).filter(Boolean).sort((o,p)=>o[0]-p[0]),[l,,f]=e,c=[];for(let o of a){if(Z(o)){c.push([o[0],void 0,o[1],void 0,o[2],r,void 0]);continue}let{selector:p,entries:x,parent:C,sort:A,noMerge:E}=this.applyVariants(o,[...o[4],...f],l);i.getFallback(p,C,[[],o[0]])[0].push([x,!!(E??o[3]?.noMerge),A??0])}return c.concat(i.map(([o,p],x,C)=>{let A=(S,b,T)=>{let h=Math.max(...T.map(y=>y[1])),u=T.map(y=>y[0]);return(S?[u.flat(1)]:u).map(y=>{let v=F(y);if(v)return[p,x,v,C,{...s,noMerge:b,sort:h},r,void 0]})};return[[o.filter(([,S])=>S).map(([S,,b])=>[S,b]),!0],[o.filter(([,S])=>!S).map(([S,,b])=>[S,b]),!1]].map(([S,b])=>[...A(!1,b,S.filter(([T])=>T.some(h=>h[0]===q))),...A(!0,b,S.filter(([T])=>T.every(h=>h[0]!==q)))])}).flat(2).filter(Boolean))}isBlocked(e){return!e||this.config.blocklist.some(r=>R(r)?r===e:r.test(e))}};function ye(t,e){return new Q(t,e)}var je=/\s\$\$\s+/g;function Pe(t){return t.match(/\s\$\$\s/)}function De(t,e){return Pe(t)?t.replace(je,e?` ${e} `:" "):e?`${e} ${t}`:t}var ge=/^\[(.+?)(~?=)"(.*)"\]$/;function Le(t){return ge.test(t)?t.replace(ge,(e,r,n,s)=>`[${G(r)}${n}"${G(s)}"]`):`.${G(t)}`}function ke(t,e){return e(t)}function He(t){return t.replace(/-(\w)/g,(e,r)=>r?r.toUpperCase():"")}function xe(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Se(t){return t.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase()}var Te=["Webkit","Moz","ms"];function Ce(t){let e={};function r(n){let s=e[n];if(s)return s;let i=He(n);if(i!=="filter"&&i in t)return e[n]=Se(i);i=xe(i);for(let a=0;a<Te.length;a++){let l=`${Te[a]}${i}`;if(l in t)return e[n]=Se(xe(l))}return n}return({entries:n})=>n.forEach(s=>{s[0].startsWith("--")||(s[0]=r(s[0]))})}function be(t){return t.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<")}function X(t={}){if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let e=window,r=window.document,n=()=>r.documentElement,s=e.__unocss||{},i=Object.assign({},t,s.runtime),a=i.defaults||{},l=i.cloakAttribute??"un-cloak";i.autoPrefix&&(a.postprocess=w(a.postprocess)).unshift(Ce(r.createElement("div").style)),i.configResolved?.(s,a);let f=ye(s,a),c=new Map,o=!0,p=new Set,x,C,A=[],E=()=>new Promise(m=>{A.push(m),C!=null&&clearTimeout(C),C=setTimeout(()=>T().then(()=>{let d=A;A=[],d.forEach(g=>g())}),0)});function S(m){if(m.nodeType!==1)return;let d=m;d.hasAttribute(l)&&d.removeAttribute(l),d.querySelectorAll(`[${l}]`).forEach(g=>{g.removeAttribute(l)})}function b(m,d){let g=c.get(m);if(!g)if(g=r.createElement("style"),g.setAttribute("data-unocss-runtime-layer",m),c.set(m,g),d==null)n().prepend(g);else{let U=b(d),V=U.parentNode;V?V.insertBefore(g,U.nextSibling):n().prepend(g)}return g}async function T(){let m=await f.generate(p);return m.layers.reduce((d,g)=>(b(g,d).innerHTML=m.getLayer(g)??"",g),void 0),p=m.matched,{...m,getStyleElement:d=>c.get(d),getStyleElements:()=>c}}async function h(m){let d=p.size;await f.applyExtractors(m,void 0,p),d!==p.size&&await E()}async function u(){let m=r.body,d=m&&m.outerHTML;d&&(await h(`${d} ${be(d)}`),S(n()),S(m))}let y=new MutationObserver(m=>{o||m.forEach(async d=>{if(d.target.nodeType!==1)return;let g=d.target;for(let U of c)if(g===U[1])return;if(d.type==="childList")d.addedNodes.forEach(async U=>{if(U.nodeType!==1)return;let V=U;x&&!x(V)||(await h(V.outerHTML),S(V))});else{if(x&&!x(g))return;if(d.attributeName!==l){let U=Array.from(g.attributes).map(O=>O.value?`${O.name}="${O.value}"`:O.name).join(" "),V=`<${g.tagName.toLowerCase()} ${U}>`;await h(V)}g.hasAttribute(l)&&g.removeAttribute(l)}})}),v=!1;function M(){if(v)return;let m=n()||r.body;m&&(y.observe(m,{childList:!0,subtree:!0,attributes:!0}),v=!0)}function _(){i.bypassDefined&&Ge(f.blocked),u(),M()}function D(){r.readyState==="loading"?e.addEventListener("DOMContentLoaded",_):_()}let H=e.__unocss_runtime=e.__unocss_runtime={version:f.version,uno:f,async extract(m){R(m)||(m.forEach(d=>p.add(d)),m=""),await h(m)},extractAll:u,inspect(m){x=m},toggleObserver(m){m===void 0?o=!o:o=!!m,!v&&!o&&D()},update:T};i.ready?.(H)!==!1&&(o=!1,D())}function Ge(t=new Set){for(let e=0;e<document.styleSheets.length;e++){let r=document.styleSheets[e],n;try{if(n=r.cssRules||r.rules,!n)continue;Array.from(n).flatMap(s=>s.selectorText?.split(/,/g)||[]).forEach(s=>{s&&(s=s.trim(),s.startsWith(".")&&(s=s.slice(1)),t.add(s))})}catch{continue}}return t}X();})();