@unocss/runtime 0.39.3 → 0.40.0

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";(()=>{var Et=Object.defineProperty,vt=Object.defineProperties;var Rt=Object.getOwnPropertyDescriptors;var L=Object.getOwnPropertySymbols;var tt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable;var Y=(r,t,e)=>t in r?Et(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,V=(r,t)=>{for(var e in t||(t={}))tt.call(t,e)&&Y(r,e,t[e]);if(L)for(var e of L(t))et.call(t,e)&&Y(r,e,t[e]);return r},k=(r,t)=>vt(r,Rt(t));var rt=(r,t)=>{var e={};for(var n in r)tt.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&L)for(var n of L(r))t.indexOf(n)<0&&et.call(r,n)&&(e[n]=r[n]);return e};function wt(r){let t=r.length,e=-1,n,s="",i=r.charCodeAt(0);for(;++e<t;){if(n=r.charCodeAt(e),n===0){s+="\uFFFD";continue}if(n===44){s+="\\,";continue}if(n>=1&&n<=31||n===127||e===0&&n>=48&&n<=57||e===1&&n>=48&&n<=57&&i===45){s+=`\\${n.toString(16)} `;continue}if(e===0&&t===1&&n===45){s+=`\\${r.charAt(e)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){s+=r.charAt(e);continue}s+=`\\${r.charAt(e)}`}return s}var z=wt;function K(r){return typeof r=="string"?r:(Array.isArray(r)?r:Object.entries(r)).filter(t=>t[1]!=null)}function nt(r){return Array.isArray(r)?r.find(t=>!Array.isArray(t)||Array.isArray(t[0]))?r.map(t=>K(t)):[r]:[K(r)]}function Ut(r){return r.filter(([t,e],n)=>{if(t.startsWith("$$"))return!1;for(let s=n-1;s>=0;s--)if(r[s][0]===t&&r[s][1]===e)return!1;return!0})}function B(r){return r==null?"":Ut(r).map(([t,e])=>e!=null?`${t}:${e};`:void 0).filter(Boolean).join("")}function F(r){return r&&typeof r=="object"&&!Array.isArray(r)}function H(r,t){let e=r,n=t;if(Array.isArray(e)&&Array.isArray(n))return[...e,...n];if(Array.isArray(e))return[...e];let s=V({},e);return F(e)&&F(n)&&Object.keys(n).forEach(i=>{F(e[i])&&F(n[i])||Array.isArray(e[i])&&Array.isArray(n[i])?s[i]=H(e[i],n[i]):Object.assign(s,{[i]:n[i]})}),s}function j(r){let t,e,n;if(Array.isArray(r)){for(e=Array(t=r.length);t--;)e[t]=(n=r[t])&&typeof n=="object"?j(n):n;return e}if(Object.prototype.toString.call(r)==="[object Object]"){e={};for(t in r)t==="__proto__"?Object.defineProperty(e,t,{value:j(r[t]),configurable:!0,enumerable:!0,writable:!0}):e[t]=(n=r[t])&&typeof n=="object"?j(n):n;return e}return r}function st(r){return typeof r[0]=="string"}function it(r){return typeof r[0]=="string"}function O(r=[]){return Array.isArray(r)?r:[r]}function D(r){return Array.from(new Set(r))}var At=/(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-?]/,I="$$shortcut-no-merge";function ot(r=""){return At.test(r)}function at(r){return typeof r=="function"?{match:r}:r}function N(r){return r.length===3}function ct(r){return r!=null}function q(){}var G=class{_map=new Map;get(t,e){let n=this._map.get(t);if(n)return n.get(e)}getFallback(t,e,n){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.has(e)||s.set(e,n),s.get(e)}set(t,e,n){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.set(e,n),this}has(t,e){var n;return(n=this._map.get(t))==null?void 0:n.has(e)}delete(t,e){var n;return((n=this._map.get(t))==null?void 0:n.delete(e))||!1}deleteTop(t){return this._map.delete(t)}map(t){return Array.from(this._map.entries()).flatMap(([e,n])=>Array.from(n.entries()).map(([s,i])=>t(i,e,s)))}};var lt=/([!\w+:_/-]+?)([:-])\(((?:[~!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm;function ut(r){lt.lastIndex=0;let t=!1;do{let e=r.toString();r=r.replace(lt,(n,s,i,o)=>o.split(/\s/g).map(a=>a==="~"?s:a.replace(/^(!?)(.*)/,`$1${s}${i}$2`)).join(" ")),t=r.toString()!==e}while(t);return r}var ft=new Set;function pt(r){ft.has(r)||(console.warn("[unocss]",r),ft.add(r))}var $t=r=>r.split(/[\s'"`;>=]+/g).filter(ot),W={name:"split",order:0,extract({code:r}){return new Set($t(r))}};function dt(){return{events:{},emit(r,...t){(this.events[r]||[]).forEach(e=>e(...t))},on(r,t){return(this.events[r]=this.events[r]||[]).push(t),()=>this.events[r]=(this.events[r]||[]).filter(e=>e!==t)}}}function Mt(r){return O(r).flatMap(t=>Array.isArray(t)?[t]:Object.entries(t))}var Tt={preflights:-100,shortcuts:-10,default:0};function Z(r={},t={}){let e=Object.assign({},t,r),n=(e.presets||[]).flatMap(O),s=[...n.filter(c=>c.enforce==="pre"),...n.filter(c=>!c.enforce),...n.filter(c=>c.enforce==="post")],i=Object.assign(Tt,...n.map(c=>c.layers),r.layers);function o(c){return D([...s.flatMap(d=>O(d[c]||[])),...O(e[c]||[])])}let a=o("extractors");a.length||a.push(W),a.sort((c,d)=>(c.order||0)-(d.order||0));let l=o("rules"),p={},C=l.length;l.forEach((c,d)=>{st(c)&&(p[c[0]]=[d,c[1],c[2],c],delete l[d])});let u=j([...s.map(c=>c.theme||{}),e.theme||{}].reduce((c,d)=>H(c,d),{}));o("extendTheme").forEach(c=>c(u));let S={templates:D(s.map(c=>{var d;return O((d=c.autocomplete)==null?void 0:d.templates)}).flat()),extractors:s.map(c=>{var d;return O((d=c.autocomplete)==null?void 0:d.extractors)}).flat().sort((c,d)=>(c.order||0)-(d.order||0))};return k(V({mergeSelectors:!0,warn:!0,blocklist:[],sortLayers:c=>c},e),{presets:s,envMode:e.envMode||"build",shortcutsLayer:e.shortcutsLayer||"shortcuts",layers:i,theme:u,rulesSize:C,rulesDynamic:l,rulesStaticMap:p,preprocess:o("preprocess"),postprocess:o("postprocess"),preflights:o("preflights"),autocomplete:S,variants:o("variants").map(at),shortcuts:Mt(o("shortcuts")),extractors:a,safelist:o("safelist")})}var gt="0.39.3";var J=class{constructor(t={},e={}){this.userConfig=t;this.defaults=e;this.config=Z(t,e),this.events.emit("config",this.config)}version=gt;_cache=new Map;config;blocked=new Set;parentOrders=new Map;events=dt();setConfig(t,e){!t||(e&&(this.defaults=e),this.userConfig=t,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=Z(t,this.defaults),this.events.emit("config",this.config))}async applyExtractors(t,e,n=new Set){let s={get original(){return t},code:t,id:e};for(let i of this.config.extractors){let o=await i.extract(s);o==null||o.forEach(a=>n.add(a))}return n}makeContext(t,e){let n={rawSelector:t,currentSelector:e[1],theme:this.config.theme,generator:this,variantHandlers:e[2],constructCSS:(...s)=>this.constructCustomCSS(n,...s),variantMatch:e};return n}async parseToken(t,e){var l;if(this.blocked.has(t))return;let n=`${t}${e?` ${e}`:""}`;if(this._cache.has(n))return this._cache.get(n);let s=t;for(let p of this.config.preprocess)s=p(t);if(this.isBlocked(s)){this.blocked.add(t),this._cache.set(n,null);return}let i=this.matchVariants(t,s);if(!i||this.isBlocked(i[1])){this.blocked.add(t),this._cache.set(n,null);return}let o=this.makeContext(t,[e||i[0],i[1],i[2],i[3]]);this.config.details&&(o.variants=[...i[3]]);let a=this.expandShortcut(o.currentSelector,o);if(a){let p=await this.stringifyShortcuts(o.variantMatch,o,a[0],a[1]);if(p!=null&&p.length)return this._cache.set(n,p),p}else{let p=(l=await this.parseUtil(o.variantMatch,o))==null?void 0:l.map(C=>this.stringifyUtil(C,o)).filter(ct);if(p!=null&&p.length)return this._cache.set(n,p),p}this._cache.set(n,null)}async generate(t="",{id:e,scope:n,preflights:s=!0,safelist:i=!0,minify:o=!1}={}){let a=typeof t=="string"?await this.applyExtractors(t,e):t;i&&this.config.safelist.forEach(g=>a.add(g));let l=o?"":`
2
- `,p=new Set(["default"]),C=new Set,u=new Map,S={},c=Array.from(a).map(async g=>{var m;if(C.has(g))return;let h=await this.parseToken(g);if(h!=null){C.add(g);for(let b of h){let U=b[3]||"",f=(m=b[4])==null?void 0:m.layer;u.has(U)||u.set(U,[]),u.get(U).push(b),f&&p.add(f)}}}),d=(async()=>{if(!s)return;let g={generator:this,theme:this.config.theme},h=new Set(["default"]);this.config.preflights.forEach(({layer:m})=>{m&&(p.add(m),h.add(m))}),S=Object.fromEntries(await Promise.all(Array.from(h).map(async m=>{let U=(await Promise.all(this.config.preflights.filter(f=>(f.layer||"default")===m).map(async f=>await f.getCSS(g)))).filter(Boolean).join(l);return[m,U]})))})();await Promise.all([...c,d]);let A=this.config.sortLayers(Array.from(p).sort((g,h)=>(this.config.layers[g]??0)-(this.config.layers[h]??0)||g.localeCompare(h))),_={},x=g=>{if(_[g])return _[g];let h=Array.from(u).sort((m,b)=>{var U;return(this.parentOrders.get(m[0])??0)-(this.parentOrders.get(b[0])??0)||((U=m[0])==null?void 0:U.localeCompare(b[0]||""))||0}).map(([m,b])=>{let U=b.length,f=b.filter(y=>{var v;return(((v=y[4])==null?void 0:v.layer)||"default")===g}).sort((y,v)=>{var R,M,P,$;return y[0]-v[0]||(((R=y[4])==null?void 0:R.sort)||0)-(((M=v[4])==null?void 0:M.sort)||0)||((P=y[1])==null?void 0:P.localeCompare(v[1]||""))||(($=y[2])==null?void 0:$.localeCompare(v[2]||""))||0}).map(([,y,v,,R])=>[[[(y&&Ot(y,n))??"",(R==null?void 0:R.sort)??0]],v,!!(R!=null&&R.noMerge)]);if(!f.length)return;let E=f.reverse().map(([y,v,R],M)=>{if(!R&&this.config.mergeSelectors)for(let $=M+1;$<U;$++){let T=f[$];if(T&&!T[2]&&(y&&T[0]||y==null&&T[0]==null)&&T[1]===v)return y&&T[0]&&T[0].push(...y),null}let P=y?[...new Set(y.sort(($,T)=>{var X;return $[1]-T[1]||((X=$[0])==null?void 0:X.localeCompare(T[0]||""))||0}).map($=>$[0]).filter(Boolean))]:[];return P.length?`${P.join(`,${l}`)}{${v}}`:v}).filter(Boolean).reverse().join(l);return m?`${m}{${l}${E}${l}}`:E}).filter(Boolean).join(l);return s&&(h=[S[g],h].filter(Boolean).join(l)),_[g]=!o&&h?`/* layer: ${g} */${l}${h}`:h},w=(g=A,h)=>g.filter(m=>!(h!=null&&h.includes(m))).map(m=>x(m)||"").filter(Boolean).join(l);return{get css(){return w()},layers:A,getLayers:w,getLayer:x,matched:C}}matchVariants(t,e){let n=new Set,s=[],i=e||t,o=!1,a={rawSelector:t,theme:this.config.theme,generator:this};for(;;){o=!1;for(let l of this.config.variants){if(!l.multiPass&&n.has(l))continue;let p=l.match(i,a);if(!!p){typeof p=="string"&&(p={matcher:p}),i=p.matcher,Array.isArray(p.parent)&&this.parentOrders.set(p.parent[0],p.parent[1]),s.unshift(p),n.add(l),o=!0;break}}if(!o)break;if(s.length>500)throw new Error(`Too many variants applied to "${t}"`)}return[t,i,s,n]}applyVariants(t,e=t[4],n=t[1]){let s=[...e].sort((u,S)=>(u.order||0)-(S.order||0)),i=t[2],o=kt(n),a,l,p;s.forEach(u=>{var S,c;i=((S=u.body)==null?void 0:S.call(u,i))||i,o=((c=u.selector)==null?void 0:c.call(u,o,i))||o,a=Array.isArray(u.parent)?u.parent[0]:u.parent||a,l=u.layer||l,p=u.sort||p});let C={selector:Pt(o),entries:i,parent:a,layer:l,sort:p};for(let u of this.config.postprocess)u(C);return C}constructCustomCSS(t,e,n){let s=K(e);if(typeof s=="string")return s;let{selector:i,entries:o,parent:a}=this.applyVariants([0,n||t.rawSelector,s,void 0,t.variantHandlers]),l=`${i}{${B(o)}}`;return a?`${a}{${l}}`:l}async parseUtil(t,e,n=!1){var u,S;let[s,i,o]=typeof t=="string"?this.matchVariants(t):t,a=this.config.details?c=>{e.rules=e.rules??[],e.rules.push(c)}:q,l=this.config.rulesStaticMap[i];if(l&&l[1]&&(n||!((u=l[2])!=null&&u.internal))){a(l[3]);let c=l[0],d=K(l[1]),A=l[2];return typeof d=="string"?[[c,d,A]]:[[c,s,d,A,o]]}e.variantHandlers=o;let{rulesDynamic:p,rulesSize:C}=this.config;for(let c=C-1;c>=0;c--){let d=p[c];if(!d||((S=d[2])==null?void 0:S.internal)&&!n)continue;let[A,_,x]=d,w=i.match(A);if(!w)continue;let g=await _(w,e);if(!g)continue;a(d);let h=nt(g).filter(m=>m.length);if(h.length)return h.map(m=>typeof m=="string"?[c,m,x]:[c,s,m,x,o])}}stringifyUtil(t,e){if(!t)return;if(N(t))return[t[0],void 0,t[1],void 0,t[2],this.config.details?e:void 0];let{selector:n,entries:s,parent:i,layer:o,sort:a}=this.applyVariants(t),l=B(s);if(!l)return;let c=t[3]??{},{layer:p,sort:C}=c,u=rt(c,["layer","sort"]),S=k(V({},u),{layer:o??p,sort:a??C});return[t[0],n,l,i,S,this.config.details?e:void 0]}expandShortcut(t,e,n=3){if(n===0)return;let s=this.config.details?a=>{e.shortcuts=e.shortcuts??[],e.shortcuts.push(a)}:q,i,o;for(let a of this.config.shortcuts)if(it(a)){if(a[0]===t){i=i||a[2],o=a[1],s(a);break}}else{let l=t.match(a[0]);if(l&&(o=a[1](l,e)),o){i=i||a[2],s(a);break}}if(typeof o=="string"&&(o=ut(o).split(/\s+/g)),!!o)return[o.flatMap(a=>{var l;return((l=this.expandShortcut(a,e,n-1))==null?void 0:l[0])||[a]}).filter(a=>a!==""),i]}async stringifyShortcuts(t,e,n,s={layer:this.config.shortcutsLayer}){var C;let i=new G,o=(await Promise.all(D(n).map(async u=>{let S=await this.parseUtil(u,e,!0);return S||pt(`unmatched utility "${u}" in shortcut "${t[1]}"`),S||[]}))).flat(1).filter(Boolean).sort((u,S)=>u[0]-S[0]),[a,,l]=t,p=[];for(let u of o){if(N(u)){p.push([u[0],void 0,u[1],void 0,u[2],e]);continue}let{selector:S,entries:c,parent:d,sort:A}=this.applyVariants(u,[...u[4],...l],a);i.getFallback(S,d,[[],u[0]])[0].push([c,!!((C=u[3])!=null&&C.noMerge),A??0])}return p.concat(i.map(([u,S],c,d)=>{let A=(x,w,g)=>{let h=Math.max(...g.map(b=>b[1])),m=g.map(b=>b[0]);return(x?[m.flat(1)]:m).map(b=>{let U=B(b);if(U)return[S,c,U,d,k(V({},s),{noMerge:w,sort:h}),e]})};return[[u.filter(([,x])=>x).map(([x,,w])=>[x,w]),!0],[u.filter(([,x])=>!x).map(([x,,w])=>[x,w]),!1]].map(([x,w])=>[...A(!1,w,x.filter(([g])=>g.some(h=>h[0]===I))),...A(!0,w,x.filter(([g])=>g.every(h=>h[0]!==I)))])}).flat(2).filter(Boolean))}isBlocked(t){return!t||this.config.blocklist.some(e=>typeof e=="string"?e===t:e.test(t))}};function mt(r,t){return new J(r,t)}var yt=/ \$\$ /,Vt=r=>r.match(yt);function Ot(r,t){return Vt(r)?r.replace(yt,t?` ${t} `:" "):t?`${t} ${r}`:r}function Pt(r){let t=r.match(/::[\w-]+/g);return t&&(t.forEach(e=>r=r.replace(e,"")),r+=t.join("")),r}var ht=/^\[(.+?)(~?=)"(.*)"\]$/;function kt(r){return ht.test(r)?r.replace(ht,(t,e,n,s)=>`[${z(e)}${n}"${z(s)}"]`):`.${z(r)}`}var jt=r=>r.replace(/-(\w)/g,(t,e)=>e?e.toUpperCase():""),St=r=>r.charAt(0).toUpperCase()+r.slice(1),xt=r=>r.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase(),Ct=["Webkit","Moz","ms"];function bt(r){let t={};function e(n){let s=t[n];if(s)return s;let i=jt(n);if(i!=="filter"&&i in r)return t[n]=xt(i);i=St(i);for(let o=0;o<Ct.length;o++){let a=`${Ct[o]}${i}`;if(a in r)return t[n]=xt(St(a))}return n}return({entries:n})=>n.forEach(s=>{s[0].startsWith("--")||(s[0]=e(s[0]))})}function Q(r={}){var b,U;if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let t=window.__unocss||{},e=t==null?void 0:t.runtime,n=Object.assign(r.defaults||{},e);if(e!=null&&e.autoPrefix){let f=n.postprocess;f||(f=[]),Array.isArray(f)||(f=[f]),f.unshift(bt(document.createElement("div").style)),n.postprocess=f}(b=e==null?void 0:e.configResolved)==null||b.call(e,t,n);let s,i=!0,o,a=mt(t,n),l=new Set,p,C=[],u=()=>new Promise(f=>{C.push(f),p!=null&&clearTimeout(p),p=setTimeout(()=>c().then(()=>{let E=C;C=[],E.forEach(y=>y())}),0)});function S(f=document.body){if(f.nodeType!==1)return;let E=f;E.hasAttribute("un-cloak")&&E.removeAttribute("un-cloak"),E.querySelectorAll("[un-cloak]").forEach(y=>{y.removeAttribute("un-cloak")})}async function c(){let f=await a.generate(l);s||(s=document.createElement("style"),document.documentElement.prepend(s)),s.innerHTML=f.css,l=f.matched}async function d(f){let E=l.size;await a.applyExtractors(f,void 0,l),E!==l.size&&await u()}async function A(){let f=document.body&&document.body.outerHTML;f&&(await d(f),S())}let _=new MutationObserver(f=>{i||f.forEach(async E=>{if(E.target.nodeType!==1)return;let y=E.target;if(y!==s)if(E.type==="childList")E.addedNodes.forEach(async v=>{if(v.nodeType!==1)return;let R=v;o&&!o(R)||(await d(R.outerHTML),S(R))});else{if(o&&!o(y))return;if(E.attributeName!=="un-cloak"){let v=Array.from(y.attributes).map(M=>M.value?`${M.name}="${M.value}"`:M.name).join(" "),R=`<${y.tagName.toLowerCase()} ${v}>`;await d(R)}y.hasAttribute("un-cloak")&&y.removeAttribute("un-cloak")}})}),x=!1;function w(){if(x)return;let f=document.documentElement||document.body;!f||(_.observe(f,{childList:!0,subtree:!0,attributes:!0}),x=!0)}function g(){A(),w()}function h(){document.readyState==="loading"?window.addEventListener("DOMContentLoaded",g):g()}let m=window.__unocss_runtime=window.__unocss_runtime={version:a.version,uno:a,async extract(f){typeof f!="string"&&(f.forEach(E=>l.add(E)),f=""),await d(f)},extractAll:A,inspect(f){o=f},toggleObserver(f){f===void 0?i=!i:i=!!f,!x&&!i&&h()}};((U=e==null?void 0:e.ready)==null?void 0:U.call(e,m))!==!1&&(i=!1,h())}Q();})();
1
+ "use strict";(()=>{function ht(r){let t=r.length,e=-1,n,s="",i=r.charCodeAt(0);for(;++e<t;){if(n=r.charCodeAt(e),n===0){s+="\uFFFD";continue}if(n===44){s+="\\,";continue}if(n>=1&&n<=31||n===127||e===0&&n>=48&&n<=57||e===1&&n>=48&&n<=57&&i===45){s+=`\\${n.toString(16)} `;continue}if(e===0&&t===1&&n===45){s+=`\\${r.charAt(e)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){s+=r.charAt(e);continue}s+=`\\${r.charAt(e)}`}return s}var K=ht;function j(r){return typeof r=="string"?r:(Array.isArray(r)?r:Object.entries(r)).filter(t=>t[1]!=null)}function J(r){return Array.isArray(r)?r.find(t=>!Array.isArray(t)||Array.isArray(t[0]))?r.map(t=>j(t)):[r]:[j(r)]}function mt(r){return r.filter(([t,e],n)=>{if(t.startsWith("$$"))return!1;for(let s=n-1;s>=0;s--)if(r[s][0]===t&&r[s][1]===e)return!1;return!0})}function L(r){return r==null?"":mt(r).map(([t,e])=>e!=null?`${t}:${e};`:void 0).filter(Boolean).join("")}function D(r){return r&&typeof r=="object"&&!Array.isArray(r)}function z(r,t){let e=r,n=t;if(Array.isArray(e)&&Array.isArray(n))return[...e,...n];if(Array.isArray(e))return[...e];let s={...e};return D(e)&&D(n)&&Object.keys(n).forEach(i=>{D(e[i])&&D(n[i])||Array.isArray(e[i])&&Array.isArray(n[i])?s[i]=z(e[i],n[i]):Object.assign(s,{[i]:n[i]})}),s}function P(r){let t,e,n;if(Array.isArray(r)){for(e=Array(t=r.length);t--;)e[t]=(n=r[t])&&typeof n=="object"?P(n):n;return e}if(Object.prototype.toString.call(r)==="[object Object]"){e={};for(t in r)t==="__proto__"?Object.defineProperty(e,t,{value:P(r[t]),configurable:!0,enumerable:!0,writable:!0}):e[t]=(n=r[t])&&typeof n=="object"?P(n):n;return e}return r}function Q(r){return typeof r[0]=="string"}function X(r){return typeof r[0]=="string"}function O(r=[]){return Array.isArray(r)?r:[r]}function k(r){return Array.from(new Set(r))}var yt=/(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-?]/,F="$$shortcut-no-merge";function Y(r=""){return yt.test(r)}function tt(r){return typeof r=="function"?{match:r}:r}function B(r){return r.length===3}function et(r){return r!=null}function G(){}var H=class{_map=new Map;get(t,e){let n=this._map.get(t);if(n)return n.get(e)}getFallback(t,e,n){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.has(e)||s.set(e,n),s.get(e)}set(t,e,n){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.set(e,n),this}has(t,e){var n;return(n=this._map.get(t))==null?void 0:n.has(e)}delete(t,e){var n;return((n=this._map.get(t))==null?void 0:n.delete(e))||!1}deleteTop(t){return this._map.delete(t)}map(t){return Array.from(this._map.entries()).flatMap(([e,n])=>Array.from(n.entries()).map(([s,i])=>t(i,e,s)))}};var rt=/([!\w+:_/-]+?)([:-])\(((?:[~!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm;function nt(r){rt.lastIndex=0;let t=!1;do{let e=r.toString();r=r.replace(rt,(n,s,i,o)=>o.split(/\s/g).map(a=>a==="~"?s:a.replace(/^(!?)(.*)/,`$1${s}${i}$2`)).join(" ")),t=r.toString()!==e}while(t);return r}var st=new Set;function it(r){st.has(r)||(console.warn("[unocss]",r),st.add(r))}var St=r=>r.split(/[\s'"`;=]+/g).filter(Y),I={name:"split",order:0,extract({code:r}){return new Set(St(r))}};function ot(){return{events:{},emit(r,...t){(this.events[r]||[]).forEach(e=>e(...t))},on(r,t){return(this.events[r]=this.events[r]||[]).push(t),()=>this.events[r]=(this.events[r]||[]).filter(e=>e!==t)}}}function xt(r){return O(r).flatMap(t=>Array.isArray(t)?[t]:Object.entries(t))}var Ct={preflights:-100,shortcuts:-10,default:0};function N(r={},t={}){let e=Object.assign({},t,r),n=(e.presets||[]).flatMap(O),s=[...n.filter(l=>l.enforce==="pre"),...n.filter(l=>!l.enforce),...n.filter(l=>l.enforce==="post")],i=Object.assign(Ct,...n.map(l=>l.layers),r.layers);function o(l){return k([...s.flatMap(d=>O(d[l]||[])),...O(e[l]||[])])}let a=o("extractors");a.length||a.push(I),a.sort((l,d)=>(l.order||0)-(d.order||0));let c=o("rules"),u={},g=c.length;c.forEach((l,d)=>{Q(l)&&(u[l[0]]=[d,l[1],l[2],l],delete c[d])});let p=P([...s.map(l=>l.theme||{}),e.theme||{}].reduce((l,d)=>z(l,d),{}));o("extendTheme").forEach(l=>l(p));let x={templates:k(s.map(l=>{var d;return O((d=l.autocomplete)==null?void 0:d.templates)}).flat()),extractors:s.map(l=>{var d;return O((d=l.autocomplete)==null?void 0:d.extractors)}).flat().sort((l,d)=>(l.order||0)-(d.order||0))};return{mergeSelectors:!0,warn:!0,blocklist:[],sortLayers:l=>l,...e,presets:s,envMode:e.envMode||"build",shortcutsLayer:e.shortcutsLayer||"shortcuts",layers:i,theme:p,rulesSize:g,rulesDynamic:c,rulesStaticMap:u,preprocess:o("preprocess"),postprocess:o("postprocess"),preflights:o("preflights"),autocomplete:x,variants:o("variants").map(tt),shortcuts:xt(o("shortcuts")),extractors:a,safelist:o("safelist")}}var at="0.40.0";var q=class{constructor(t={},e={}){this.userConfig=t;this.defaults=e;this.config=N(t,e),this.events.emit("config",this.config)}version=at;_cache=new Map;config;blocked=new Set;parentOrders=new Map;events=ot();setConfig(t,e){!t||(e&&(this.defaults=e),this.userConfig=t,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=N(t,this.defaults),this.events.emit("config",this.config))}async applyExtractors(t,e,n=new Set){let s={get original(){return t},code:t,id:e};for(let i of this.config.extractors){let o=await i.extract(s);o==null||o.forEach(a=>n.add(a))}return n}makeContext(t,e){let n={rawSelector:t,currentSelector:e[1],theme:this.config.theme,generator:this,variantHandlers:e[2],constructCSS:(...s)=>this.constructCustomCSS(n,...s),variantMatch:e};return n}async parseToken(t,e){var c;if(this.blocked.has(t))return;let n=`${t}${e?` ${e}`:""}`;if(this._cache.has(n))return this._cache.get(n);let s=t;for(let u of this.config.preprocess)s=u(t);if(this.isBlocked(s)){this.blocked.add(t),this._cache.set(n,null);return}let i=this.matchVariants(t,s);if(!i||this.isBlocked(i[1])){this.blocked.add(t),this._cache.set(n,null);return}let o=this.makeContext(t,[e||i[0],i[1],i[2],i[3]]);this.config.details&&(o.variants=[...i[3]]);let a=this.expandShortcut(o.currentSelector,o);if(a){let u=await this.stringifyShortcuts(o.variantMatch,o,a[0],a[1]);if(u!=null&&u.length)return this._cache.set(n,u),u}else{let u=(c=await this.parseUtil(o.variantMatch,o))==null?void 0:c.map(g=>this.stringifyUtil(g,o)).filter(et);if(u!=null&&u.length)return this._cache.set(n,u),u}this._cache.set(n,null)}async generate(t="",{id:e,scope:n,preflights:s=!0,safelist:i=!0,minify:o=!1}={}){let a=typeof t=="string"?await this.applyExtractors(t,e):t;i&&this.config.safelist.forEach(h=>a.add(h));let c=o?"":`
2
+ `,u=new Set(["default"]),g=new Set,p=new Map,x={},l=Array.from(a).map(async h=>{var y;if(g.has(h))return;let m=await this.parseToken(h);if(m!=null){g.add(h);for(let b of m){let A=b[3]||"",f=(y=b[4])==null?void 0:y.layer;p.has(A)||p.set(A,[]),p.get(A).push(b),f&&u.add(f)}}}),d=(async()=>{if(!s)return;let h={generator:this,theme:this.config.theme},m=new Set(["default"]);this.config.preflights.forEach(({layer:y})=>{y&&(u.add(y),m.add(y))}),x=Object.fromEntries(await Promise.all(Array.from(m).map(async y=>{let A=(await Promise.all(this.config.preflights.filter(f=>(f.layer||"default")===y).map(async f=>await f.getCSS(h)))).filter(Boolean).join(c);return[y,A]})))})();await Promise.all([...l,d]);let E=this.config.sortLayers(Array.from(u).sort((h,m)=>(this.config.layers[h]??0)-(this.config.layers[m]??0)||h.localeCompare(m))),T={},C=h=>{if(T[h])return T[h];let m=Array.from(p).sort((y,b)=>{var A;return(this.parentOrders.get(y[0])??0)-(this.parentOrders.get(b[0])??0)||((A=y[0])==null?void 0:A.localeCompare(b[0]||""))||0}).map(([y,b])=>{let A=b.length,f=b.filter(S=>{var R;return(((R=S[4])==null?void 0:R.layer)||"default")===h}).sort((S,R)=>{var w,$,_,V;return S[0]-R[0]||(((w=S[4])==null?void 0:w.sort)||0)-((($=R[4])==null?void 0:$.sort)||0)||((_=S[1])==null?void 0:_.localeCompare(R[1]||""))||((V=S[2])==null?void 0:V.localeCompare(R[2]||""))||0}).map(([,S,R,,w])=>[[[(S&&vt(S,n))??"",(w==null?void 0:w.sort)??0]],R,!!(w!=null&&w.noMerge)]);if(!f.length)return;let v=f.reverse().map(([S,R,w],$)=>{if(!w&&this.config.mergeSelectors)for(let V=$+1;V<A;V++){let M=f[V];if(M&&!M[2]&&(S&&M[0]||S==null&&M[0]==null)&&M[1]===R)return S&&M[0]&&M[0].push(...S),null}let _=S?[...new Set(S.sort((V,M)=>{var Z;return V[1]-M[1]||((Z=V[0])==null?void 0:Z.localeCompare(M[0]||""))||0}).map(V=>V[0]).filter(Boolean))]:[];return _.length?`${_.join(`,${c}`)}{${R}}`:R}).filter(Boolean).reverse().join(c);return y?`${y}{${c}${v}${c}}`:v}).filter(Boolean).join(c);return s&&(m=[x[h],m].filter(Boolean).join(c)),T[h]=!o&&m?`/* layer: ${h} */${c}${m}`:m},U=(h=E,m)=>h.filter(y=>!(m!=null&&m.includes(y))).map(y=>C(y)||"").filter(Boolean).join(c);return{get css(){return U()},layers:E,getLayers:U,getLayer:C,matched:g}}matchVariants(t,e){let n=new Set,s=[],i=e||t,o=!1,a={rawSelector:t,theme:this.config.theme,generator:this};for(;;){o=!1;for(let c of this.config.variants){if(!c.multiPass&&n.has(c))continue;let u=c.match(i,a);if(!!u){typeof u=="string"&&(u={matcher:u}),i=u.matcher,s.push(u),n.add(c),o=!0;break}}if(!o)break;if(s.length>500)throw new Error(`Too many variants applied to "${t}"`)}return[t,i,s,n]}applyVariants(t,e=t[4],n=t[1]){let i=[...e].sort((u,g)=>(u.order||0)-(g.order||0)).reverse().reduce((u,g)=>p=>{var d,E;let x=((d=g.body)==null?void 0:d.call(g,p.entries))||p.entries,l=Array.isArray(g.parent)?g.parent:[g.parent,void 0];return(g.handle??Ut)({...p,entries:x,selector:((E=g.selector)==null?void 0:E.call(g,p.selector,x))||p.selector,parent:l[0]||p.parent,parentOrder:l[1]||p.parentOrder,layer:g.layer||p.layer,sort:g.sort||p.sort},u)},u=>u)({prefix:"",selector:wt(n),pseudo:"",entries:t[2]}),{parent:o,parentOrder:a}=i;o!=null&&a!=null&&this.parentOrders.set(o,a);let c={selector:Rt([i.prefix,i.selector,i.pseudo].join("")),entries:i.entries,parent:o,layer:i.layer,sort:i.sort};for(let u of this.config.postprocess)u(c);return c}constructCustomCSS(t,e,n){let s=j(e);if(typeof s=="string")return s;let{selector:i,entries:o,parent:a}=this.applyVariants([0,n||t.rawSelector,s,void 0,t.variantHandlers]),c=`${i}{${L(o)}}`;return a?`${a}{${c}}`:c}async parseUtil(t,e,n=!1){var p,x;let[s,i,o]=typeof t=="string"?this.matchVariants(t):t,a=this.config.details?l=>{e.rules=e.rules??[],e.rules.push(l)}:G,c=this.config.rulesStaticMap[i];if(c&&c[1]&&(n||!((p=c[2])!=null&&p.internal))){a(c[3]);let l=c[0],d=j(c[1]),E=c[2];return typeof d=="string"?[[l,d,E]]:[[l,s,d,E,o]]}e.variantHandlers=o;let{rulesDynamic:u,rulesSize:g}=this.config;for(let l=g-1;l>=0;l--){let d=u[l];if(!d||((x=d[2])==null?void 0:x.internal)&&!n)continue;let[E,T,C]=d,U=i.match(E);if(!U)continue;let h=await T(U,e);if(!h)continue;a(d);let m=J(h).filter(y=>y.length);if(m.length)return m.map(y=>typeof y=="string"?[l,y,C]:[l,s,y,C,o])}}stringifyUtil(t,e){if(!t)return;if(B(t))return[t[0],void 0,t[1],void 0,t[2],this.config.details?e:void 0];let{selector:n,entries:s,parent:i,layer:o,sort:a}=this.applyVariants(t),c=L(s);if(!c)return;let{layer:u,sort:g,...p}=t[3]??{},x={...p,layer:o??u,sort:a??g};return[t[0],n,c,i,x,this.config.details?e:void 0]}expandShortcut(t,e,n=3){if(n===0)return;let s=this.config.details?a=>{e.shortcuts=e.shortcuts??[],e.shortcuts.push(a)}:G,i,o;for(let a of this.config.shortcuts)if(X(a)){if(a[0]===t){i=i||a[2],o=a[1],s(a);break}}else{let c=t.match(a[0]);if(c&&(o=a[1](c,e)),o){i=i||a[2],s(a);break}}if(typeof o=="string"&&(o=nt(o).split(/\s+/g)),!!o)return[o.flatMap(a=>{var c;return((c=this.expandShortcut(a,e,n-1))==null?void 0:c[0])||[a]}).filter(a=>a!==""),i]}async stringifyShortcuts(t,e,n,s={layer:this.config.shortcutsLayer}){var g;let i=new H,o=(await Promise.all(k(n).map(async p=>{let x=await this.parseUtil(p,e,!0);return x||it(`unmatched utility "${p}" in shortcut "${t[1]}"`),x||[]}))).flat(1).filter(Boolean).sort((p,x)=>p[0]-x[0]),[a,,c]=t,u=[];for(let p of o){if(B(p)){u.push([p[0],void 0,p[1],void 0,p[2],e]);continue}let{selector:x,entries:l,parent:d,sort:E}=this.applyVariants(p,[...p[4],...c],a);i.getFallback(x,d,[[],p[0]])[0].push([l,!!((g=p[3])!=null&&g.noMerge),E??0])}return u.concat(i.map(([p,x],l,d)=>{let E=(C,U,h)=>{let m=Math.max(...h.map(b=>b[1])),y=h.map(b=>b[0]);return(C?[y.flat(1)]:y).map(b=>{let A=L(b);if(A)return[x,l,A,d,{...s,noMerge:U,sort:m},e]})};return[[p.filter(([,C])=>C).map(([C,,U])=>[C,U]),!0],[p.filter(([,C])=>!C).map(([C,,U])=>[C,U]),!1]].map(([C,U])=>[...E(!1,U,C.filter(([h])=>h.some(m=>m[0]===F))),...E(!0,U,C.filter(([h])=>h.every(m=>m[0]!==F)))])}).flat(2).filter(Boolean))}isBlocked(t){return!t||this.config.blocklist.some(e=>typeof e=="string"?e===t:e.test(t))}};function lt(r,t){return new q(r,t)}var ut=/ \$\$ /,Et=r=>r.match(ut);function vt(r,t){return Et(r)?r.replace(ut,t?` ${t} `:" "):t?`${t} ${r}`:r}function Rt(r){let t=r.match(/::[\w-]+/g);return t&&(t.forEach(e=>r=r.replace(e,"")),r+=t.join("")),r}var ct=/^\[(.+?)(~?=)"(.*)"\]$/;function wt(r){return ct.test(r)?r.replace(ct,(t,e,n,s)=>`[${K(e)}${n}"${K(s)}"]`):`.${K(r)}`}function Ut(r,t){return t(r)}var At=r=>r.replace(/-(\w)/g,(t,e)=>e?e.toUpperCase():""),ft=r=>r.charAt(0).toUpperCase()+r.slice(1),pt=r=>r.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase(),dt=["Webkit","Moz","ms"];function gt(r){let t={};function e(n){let s=t[n];if(s)return s;let i=At(n);if(i!=="filter"&&i in r)return t[n]=pt(i);i=ft(i);for(let o=0;o<dt.length;o++){let a=`${dt[o]}${i}`;if(a in r)return t[n]=pt(ft(a))}return n}return({entries:n})=>n.forEach(s=>{s[0].startsWith("--")||(s[0]=e(s[0]))})}function W(r={}){var b,A;if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let t=window.__unocss||{},e=t==null?void 0:t.runtime,n=Object.assign(r.defaults||{},e);if(e!=null&&e.autoPrefix){let f=n.postprocess;f||(f=[]),Array.isArray(f)||(f=[f]),f.unshift(gt(document.createElement("div").style)),n.postprocess=f}(b=e==null?void 0:e.configResolved)==null||b.call(e,t,n);let s,i=!0,o,a=lt(t,n),c=new Set,u,g=[],p=()=>new Promise(f=>{g.push(f),u!=null&&clearTimeout(u),u=setTimeout(()=>l().then(()=>{let v=g;g=[],v.forEach(S=>S())}),0)});function x(f=document.body){if(f.nodeType!==1)return;let v=f;v.hasAttribute("un-cloak")&&v.removeAttribute("un-cloak"),v.querySelectorAll("[un-cloak]").forEach(S=>{S.removeAttribute("un-cloak")})}async function l(){let f=await a.generate(c);s||(s=document.createElement("style"),document.documentElement.prepend(s)),s.innerHTML=f.css,c=f.matched}async function d(f){let v=c.size;await a.applyExtractors(f,void 0,c),v!==c.size&&await p()}async function E(){let f=document.body&&document.body.outerHTML;f&&(await d(f),x())}let T=new MutationObserver(f=>{i||f.forEach(async v=>{if(v.target.nodeType!==1)return;let S=v.target;if(S!==s)if(v.type==="childList")v.addedNodes.forEach(async R=>{if(R.nodeType!==1)return;let w=R;o&&!o(w)||(await d(w.outerHTML),x(w))});else{if(o&&!o(S))return;if(v.attributeName!=="un-cloak"){let R=Array.from(S.attributes).map($=>$.value?`${$.name}="${$.value}"`:$.name).join(" "),w=`<${S.tagName.toLowerCase()} ${R}>`;await d(w)}S.hasAttribute("un-cloak")&&S.removeAttribute("un-cloak")}})}),C=!1;function U(){if(C)return;let f=document.documentElement||document.body;!f||(T.observe(f,{childList:!0,subtree:!0,attributes:!0}),C=!0)}function h(){E(),U()}function m(){document.readyState==="loading"?window.addEventListener("DOMContentLoaded",h):h()}let y=window.__unocss_runtime=window.__unocss_runtime={version:a.version,uno:a,async extract(f){typeof f!="string"&&(f.forEach(v=>c.add(v)),f=""),await d(f)},extractAll:E,inspect(f){o=f},toggleObserver(f){f===void 0?i=!i:i=!!f,!C&&!i&&m()}};((A=e==null?void 0:e.ready)==null?void 0:A.call(e,y))!==!1&&(i=!1,m())}W();})();