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