@unocss/runtime 66.6.7 → 66.6.8

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 X="default",le="preflights",we="shortcuts",$e="imports",Ae={[$e]:-200,[le]:-100,[we]:-10,[X]:0},Ce=/[\\:]?[\s'"`;{}]+/g;function Me(t){return t.split(Ce)}var Ee={name:"@unocss/core/extractor-split",order:0,extract({code:t}){return Me(t)}};function k(t=[]){return Array.isArray(t)?t:[t]}function N(t){return Array.from(new Set(t))}function re(t,e){return t.reduce((r,n)=>(r.findIndex(s=>e(n,s))===-1&&r.push(n),r),[])}function O(t){return typeof t=="string"}var fe=class extends Set{constructor(t){if(super(),this._map=new Map,t)for(let e of t)this.add(e)}add(t){return this._map.set(t,(this._map.get(t)??0)+1),super.add(t)}delete(t){return this._map.has(t)?(this._map.delete(t),super.delete(t)):!1}clear(){this._map.clear(),super.clear()}getCount(t){return this._map.get(t)??0}setCount(t,e){return this._map.set(t,e),super.add(t)}};function Z(t){return t instanceof fe}function _e(t){let e=t.length,r=-1,n,s="",a=t.charCodeAt(0);for(;++r<e;){if(n=t.charCodeAt(r),n===0){s+="\uFFFD";continue}if(n===37){s+="\\%";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&&a===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 J=_e;function Re(){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)}}}function Le(t){return typeof t=="function"?{match:t}:t}function ne(t){return t.length===3}function H(t){return t!=null}function Oe(){}var ke=class{constructor(){this._map=new Map}get(t,e){let r=this._map.get(t);if(r)return r.get(e)}getFallback(t,e,r){let n=this._map.get(t);return n||(n=new Map,this._map.set(t,n)),n.has(e)||n.set(e,r),n.get(e)}set(t,e,r){let n=this._map.get(t);return n||(n=new Map,this._map.set(t,n)),n.set(e,r),this}has(t,e){return this._map.get(t)?.has(e)}delete(t,e){return this._map.get(t)?.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(([n,s])=>t(s,e,n)))}},je=class extends Map{getFallback(t,e){let r=this.get(t);return r===void 0?(this.set(t,e),e):r}map(t){let e=[];return this.forEach((r,n)=>{e.push(t(r,n))}),e}flatMap(t){let e=[];return this.forEach((r,n)=>{e.push(...t(r,n))}),e}};function q(t){return O(t)?t:(Array.isArray(t)?t:Object.entries(t)).filter(e=>e[1]!=null)}function Te(t){return Array.isArray(t)?t.find(e=>!Array.isArray(e)||Array.isArray(e[0]))?t.map(e=>q(e)):[t]:[q(t)]}function Pe(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})}var Ue="__virtual_key__";function Q(t){return t==null?"":Pe(t).map(([e,r])=>r!=null&&typeof r!="function"?e!=="__virtual_key__"?`${e}:${r};`:r:void 0).filter(Boolean).join("")}function z(t){return t&&typeof t=="object"&&!Array.isArray(t)}function ue(t,e,r=!1){let n=t,s=e;if(Array.isArray(s))return r&&Array.isArray(s)?[...n,...s]:[...s];let a={...n};return z(n)&&z(s)&&Object.keys(s).forEach(f=>{z(n[f])&&z(s[f])||Array.isArray(n[f])&&Array.isArray(s[f])?a[f]=ue(n[f],s[f],r):Object.assign(a,{[f]:s[f]})}),a}function Y(t){let e,r,n;if(Array.isArray(t)){for(r=Array.from({length:e=t.length});e--;)r[e]=(n=t[e])&&typeof n=="object"?Y(n):n;return r}if(Object.prototype.toString.call(t)==="[object Object]"){r={};for(e in t)e==="__proto__"?Object.defineProperty(r,e,{value:Y(t[e]),configurable:!0,enumerable:!0,writable:!0}):r[e]=(n=t[e])&&typeof n=="object"?Y(n):n;return r}return t}function Ve(t){return O(t[0])}function De(t){return O(t[0])}var W={};function Ge(t=["-",":"]){let e=t.join("|");return W[e]||(W[e]=new RegExp(`((?:[!@*<~\\w+:_-]|\\[&?>?:?\\S*\\])+?)(${e})\\(((?:[~!<>\\w\\s:/\\\\,%#.$?-]|\\[[^\\]]*?\\])+?)\\)(?!\\s*?=>)`,"gm")),W[e].lastIndex=0,W[e]}function Ne(t,e=["-",":"],r=5){let n=Ge(e),s,a=t.toString(),f=new Set,u=new Map;do s=!1,a=a.replace(n,(i,o,l,h,g)=>{if(!e.includes(l))return i;s=!0,f.add(o+l);let d=g+o.length+l.length+1,M={length:i.length,items:[]};u.set(g,M);for(let A of[...h.matchAll(/\S+/g)]){let C=d+A.index,v=u.get(C)?.items;v?u.delete(C):v=[{offset:C,length:A[0].length,className:A[0]}];for(let S of v)S.className=S.className==="~"?l===":"?`${o}${l}~`:o:S.className.replace(/^(!?)(.*)/,`$1${o}${l}$2`),M.items.push(S)}return"$".repeat(i.length)}),r-=1;while(s&&r);let c;if(typeof t=="string"){c="";let i=0;for(let[o,l]of u)c+=t.slice(i,o),c+=l.items.map(h=>h.className).join(" "),i=o+l.length;c+=t.slice(i)}else{c=t;for(let[i,o]of u)c.overwrite(i,i+o.length,o.items.map(l=>l.className).join(" "))}return{prefixes:Array.from(f),hasChanged:s,groupsByOffset:u,get expanded(){return c.toString()}}}function Fe(t,e=["-",":"],r=5){let n=Ne(t,e,r);return typeof t=="string"?n.expanded:t}var se=new Set;function Be(t){se.has(t)||(console.warn("[unocss]",t),se.add(t))}function pe(t){return k(t).flatMap(e=>Array.isArray(e)?[e]:Object.entries(e))}var oe="_uno_resolved";async function Ie(t){let e=typeof t=="function"?await t():await t;if(oe in e)return e;e={...e},Object.defineProperty(e,oe,{value:!0,enumerable:!1});let r=e.shortcuts?pe(e.shortcuts):void 0;if(e.shortcuts=r,e.prefix||e.layer){let n=s=>{s[2]||(s[2]={});let a=s[2];a.prefix==null&&e.prefix&&(a.prefix=k(e.prefix)),a.layer==null&&e.layer&&(a.layer=e.layer)};r?.forEach(n),e.rules?.forEach(n)}return e}async function he(t){let e=await Ie(t);return e.presets?[e,...(await Promise.all((e.presets||[]).flatMap(k).flatMap(he))).flat()]:[e]}function He(t){if(t.length===0)return{};let e=[],r=[],n=!1,s=[],a=[];for(let u of t){if(u.pipeline===!1){n=!0;break}else u.pipeline?.include&&e.push(u.pipeline.include),u.pipeline?.exclude&&r.push(u.pipeline.exclude);u.filesystem&&s.push(u.filesystem),u.inline&&a.push(u.inline)}let f={pipeline:n?!1:{include:N(ae(...e)),exclude:N(ae(...r))}};return s.length&&(f.filesystem=N(s.flat())),a.length&&(f.inline=N(a.flat())),f}async function ie(t={},e={}){let r=Object.assign({},e,t),n=re((await Promise.all((r.presets||[]).flatMap(k).flatMap(he))).flat(),(p,y)=>p.name===y.name),s=[...n.filter(p=>p.enforce==="pre"),...n.filter(p=>!p.enforce),...n.filter(p=>p.enforce==="post")],a=[...s,r],f=[...a].reverse(),u=Object.assign({},Ae,...a.map(p=>p.layers));function c(p){return N(a.flatMap(y=>k(y[p]||[])))}let i=c("extractors"),o=f.find(p=>p.extractorDefault!==void 0)?.extractorDefault;o===void 0&&(o=Ee),o&&!i.includes(o)&&i.unshift(o),i.sort((p,y)=>(p.order||0)-(y.order||0));let l=c("rules"),h=l.length,g={},d=[];for(let[p,y]of l.entries()){let _=y[2]??(y[2]={});_.__index=p,Ve(y)?k(_.prefix??"").forEach(V=>{g[V+y[0]]=y}):d.unshift(y)}let M={templates:N(a.flatMap(p=>k(p.autocomplete?.templates))),extractors:a.flatMap(p=>k(p.autocomplete?.extractors)).sort((p,y)=>(p.order||0)-(y.order||0)),shorthands:We(a.map(p=>p.autocomplete?.shorthands||{}))},A=c("separators");A.length||(A=[":","-"]);let C=He(c("content")),v={mergeSelectors:!0,warn:!0,sortLayers:p=>p,...r,blocklist:c("blocklist"),presets:s,envMode:r.envMode||"build",shortcutsLayer:r.shortcutsLayer||"shortcuts",layers:u,theme:ze(a.map(p=>p.theme)),rules:l,rulesSize:h,rulesDynamic:d,rulesStaticMap:g,preprocess:c("preprocess"),postprocess:c("postprocess"),preflights:c("preflights"),autocomplete:M,variants:c("variants").map(Le).sort((p,y)=>(p.order||0)-(y.order||0)),shortcuts:pe(c("shortcuts")).reverse(),extractors:i,safelist:c("safelist"),separators:A,details:r.details??r.envMode==="dev",content:C,transformers:re(c("transformers"),(p,y)=>p.name===y.name)},S=c("extendTheme");for(let p of S)v.theme=p(v.theme,v)||v.theme;for(let p of a)p?.configResolved?.(v);return v}function ze(t){return t.map(e=>e?Y(e):{}).reduce((e,r)=>ue(e,r),{})}function We(t){return t.reduce((e,r)=>{let n={};for(let s in r){let a=r[s];Array.isArray(a)?n[s]=`(${a.join("|")})`:n[s]=a}return{...e,...n}},{})}function ae(...t){return t.flatMap(Ye)}function Ye(t){return Array.isArray(t)?t:t?[t]:[]}var qe="66.6.7",U={shortcutsNoMerge:"$$symbol-shortcut-no-merge",noMerge:"$$symbol-no-merge",noScope:"$$symbol-no-scope",variants:"$$symbol-variants",parent:"$$symbol-parent",selector:"$$symbol-selector",layer:"$$symbol-layer",sort:"$$symbol-sort",body:"$$symbol-body"},Ke=class de{constructor(e={},r={}){this.userConfig=e,this.defaults=r,this.version=qe,this.events=Re(),this.config=void 0,this.cache=new Map,this.blocked=new Set,this.parentOrders=new Map,this.activatedRules=new Set,this.resolveCSSResult=(n,s,a,f)=>{let u=Te(s).filter(c=>c.length);if(u.length){this.config.details&&f.rules.push(a),f.generator.activatedRules.add(a);let c=a[2];return u.map(i=>{if(O(i))return[c.__index,i,c];let o=f.variantHandlers,l=c,h=d=>{o=[d,...o]},g=d=>{l={...l,...d}};for(let d of i)switch(d[0]){case U.variants:typeof d[1]=="function"?o=d[1](o)||o:o=[...k(d[1]),...o];break;case U.parent:h({parent:d[1]});break;case U.selector:h({selector:d[1]});break;case U.layer:h({layer:d[1]});break;case U.sort:g({sort:d[1]});break;case U.noMerge:g({noMerge:d[1]});break;case U.noScope:g({noScope:d[1]});break;case U.body:d[0]=Ue;break}return[c.__index,n,i,l,o]})}}}static async create(e={},r={}){let n=new de(e,r);return n.config=await ie(n.userConfig,n.defaults),n.events.emit("config",n.config),n}async setConfig(e,r){e&&(r&&(this.defaults=r),this.userConfig=e,this.blocked.clear(),this.parentOrders.clear(),this.activatedRules.clear(),this.cache.clear(),this.config=await ie(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,envMode:this.config.envMode};for(let a of this.config.extractors){let f=await a.extract?.(s);if(f)if(Z(f)&&Z(n))for(let u of f)n.setCount(u,n.getCount(u)+f.getCount(u));else for(let u of f)n.add(u)}return n}makeContext(e,r){let n={rawSelector:e,currentSelector:r[1],theme:this.config.theme,generator:this,symbols:U,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=this.config.preprocess.reduce((c,i)=>i(c)??c,e);if(this.isBlocked(s)){this.blocked.add(e),this.cache.set(n,null);return}let a=await this.matchVariants(e,s);if(a.every(c=>!c||this.isBlocked(c[1]))){this.blocked.add(e),this.cache.set(n,null);return}let f=async c=>{let i=this.makeContext(e,[r||c[0],c[1],c[2],c[3]]);this.config.details&&(i.variants=[...c[3]]);let o=await this.expandShortcut(i.currentSelector,i);return o?await this.stringifyShortcuts(i.variantMatch,i,o[0],o[1]):(await this.parseUtil(i.variantMatch,i))?.flatMap(l=>this.stringifyUtil(l,i)).filter(H)},u=(await Promise.all(a.map(c=>f(c)))).flat().filter(c=>!!c);if(u?.length)return this.cache.set(n,u),u;this.cache.set(n,null)}async generate(e,r={}){let{id:n,scope:s,preflights:a=!0,safelist:f=!0,minify:u=!1,extendedInfo:c=!1}=r,i=O(e)?await this.applyExtractors(e,n,c?new fe:new Set):Array.isArray(e)?new Set(e):e;if(f){let b={generator:this,theme:this.config.theme};this.config.safelist.flatMap(x=>typeof x=="function"?x(b):x).forEach(x=>{let w=x.trim();w&&!i.has(w)&&i.add(w)})}let o=u?"":`
1
+ "use strict";(()=>{var X="default",le="preflights",we="shortcuts",$e="imports",Ae={[$e]:-200,[le]:-100,[we]:-10,[X]:0},Ce=/[\\:]?[\s'"`;{}]+/g;function Me(t){return t.split(Ce)}var Ee={name:"@unocss/core/extractor-split",order:0,extract({code:t}){return Me(t)}};function k(t=[]){return Array.isArray(t)?t:[t]}function N(t){return Array.from(new Set(t))}function re(t,e){return t.reduce((r,n)=>(r.findIndex(s=>e(n,s))===-1&&r.push(n),r),[])}function O(t){return typeof t=="string"}var fe=class extends Set{constructor(t){if(super(),this._map=new Map,t)for(let e of t)this.add(e)}add(t){return this._map.set(t,(this._map.get(t)??0)+1),super.add(t)}delete(t){return this._map.has(t)?(this._map.delete(t),super.delete(t)):!1}clear(){this._map.clear(),super.clear()}getCount(t){return this._map.get(t)??0}setCount(t,e){return this._map.set(t,e),super.add(t)}};function Z(t){return t instanceof fe}function _e(t){let e=t.length,r=-1,n,s="",a=t.charCodeAt(0);for(;++r<e;){if(n=t.charCodeAt(r),n===0){s+="\uFFFD";continue}if(n===37){s+="\\%";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&&a===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 J=_e;function Re(){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)}}}function Le(t){return typeof t=="function"?{match:t}:t}function ne(t){return t.length===3}function H(t){return t!=null}function Oe(){}var ke=class{constructor(){this._map=new Map}get(t,e){let r=this._map.get(t);if(r)return r.get(e)}getFallback(t,e,r){let n=this._map.get(t);return n||(n=new Map,this._map.set(t,n)),n.has(e)||n.set(e,r),n.get(e)}set(t,e,r){let n=this._map.get(t);return n||(n=new Map,this._map.set(t,n)),n.set(e,r),this}has(t,e){return this._map.get(t)?.has(e)}delete(t,e){return this._map.get(t)?.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(([n,s])=>t(s,e,n)))}},je=class extends Map{getFallback(t,e){let r=this.get(t);return r===void 0?(this.set(t,e),e):r}map(t){let e=[];return this.forEach((r,n)=>{e.push(t(r,n))}),e}flatMap(t){let e=[];return this.forEach((r,n)=>{e.push(...t(r,n))}),e}};function q(t){return O(t)?t:(Array.isArray(t)?t:Object.entries(t)).filter(e=>e[1]!=null)}function Te(t){return Array.isArray(t)?t.some(e=>!Array.isArray(e)||Array.isArray(e[0]))?t.map(e=>q(e)):[t]:[q(t)]}function Pe(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})}var Ue="__virtual_key__";function Q(t){return t==null?"":Pe(t).map(([e,r])=>r!=null&&typeof r!="function"?e!=="__virtual_key__"?`${e}:${r};`:r:void 0).filter(Boolean).join("")}function z(t){return t&&typeof t=="object"&&!Array.isArray(t)}function ue(t,e,r=!1){let n=t,s=e;if(Array.isArray(s))return r&&Array.isArray(s)?[...n,...s]:[...s];let a={...n};return z(n)&&z(s)&&Object.keys(s).forEach(f=>{z(n[f])&&z(s[f])||Array.isArray(n[f])&&Array.isArray(s[f])?a[f]=ue(n[f],s[f],r):Object.assign(a,{[f]:s[f]})}),a}function Y(t){let e,r,n;if(Array.isArray(t)){for(r=Array.from({length:e=t.length});e--;)r[e]=(n=t[e])&&typeof n=="object"?Y(n):n;return r}if(Object.prototype.toString.call(t)==="[object Object]"){r={};for(e in t)e==="__proto__"?Object.defineProperty(r,e,{value:Y(t[e]),configurable:!0,enumerable:!0,writable:!0}):r[e]=(n=t[e])&&typeof n=="object"?Y(n):n;return r}return t}function Ve(t){return O(t[0])}function De(t){return O(t[0])}var W={};function Ge(t=["-",":"]){let e=t.join("|");return W[e]||(W[e]=new RegExp(`((?:[!@*<~\\w+:_-]|\\[&?>?:?\\S*\\])+?)(${e})\\(((?:[~!<>\\w\\s:/\\\\,%#.$?-]|\\[[^\\]]*?\\])+?)\\)(?!\\s*?=>)`,"gm")),W[e].lastIndex=0,W[e]}function Ne(t,e=["-",":"],r=5){let n=Ge(e),s,a=t.toString(),f=new Set,u=new Map;do s=!1,a=a.replace(n,(i,o,l,h,g)=>{if(!e.includes(l))return i;s=!0,f.add(o+l);let d=g+o.length+l.length+1,M={length:i.length,items:[]};u.set(g,M);for(let A of[...h.matchAll(/\S+/g)]){let C=d+A.index,v=u.get(C)?.items;v?u.delete(C):v=[{offset:C,length:A[0].length,className:A[0]}];for(let S of v)S.className=S.className==="~"?l===":"?`${o}${l}~`:o:S.className.replace(/^(!?)(.*)/,`$1${o}${l}$2`),M.items.push(S)}return"$".repeat(i.length)}),r-=1;while(s&&r);let c;if(typeof t=="string"){c="";let i=0;for(let[o,l]of u)c+=t.slice(i,o),c+=l.items.map(h=>h.className).join(" "),i=o+l.length;c+=t.slice(i)}else{c=t;for(let[i,o]of u)c.overwrite(i,i+o.length,o.items.map(l=>l.className).join(" "))}return{prefixes:Array.from(f),hasChanged:s,groupsByOffset:u,get expanded(){return c.toString()}}}function Fe(t,e=["-",":"],r=5){let n=Ne(t,e,r);return typeof t=="string"?n.expanded:t}var se=new Set;function Be(t){se.has(t)||(console.warn("[unocss]",t),se.add(t))}function pe(t){return k(t).flatMap(e=>Array.isArray(e)?[e]:Object.entries(e))}var oe="_uno_resolved";async function Ie(t){let e=typeof t=="function"?await t():await t;if(oe in e)return e;e={...e},Object.defineProperty(e,oe,{value:!0,enumerable:!1});let r=e.shortcuts?pe(e.shortcuts):void 0;if(e.shortcuts=r,e.prefix||e.layer){let n=s=>{s[2]||(s[2]={});let a=s[2];a.prefix==null&&e.prefix&&(a.prefix=k(e.prefix)),a.layer==null&&e.layer&&(a.layer=e.layer)};r?.forEach(n),e.rules?.forEach(n)}return e}async function he(t){let e=await Ie(t);return e.presets?[e,...(await Promise.all((e.presets||[]).flatMap(k).flatMap(he))).flat()]:[e]}function He(t){if(t.length===0)return{};let e=[],r=[],n=!1,s=[],a=[];for(let u of t){if(u.pipeline===!1){n=!0;break}else u.pipeline?.include&&e.push(u.pipeline.include),u.pipeline?.exclude&&r.push(u.pipeline.exclude);u.filesystem&&s.push(u.filesystem),u.inline&&a.push(u.inline)}let f={pipeline:n?!1:{include:N(ae(...e)),exclude:N(ae(...r))}};return s.length&&(f.filesystem=N(s.flat())),a.length&&(f.inline=N(a.flat())),f}async function ie(t={},e={}){let r=Object.assign({},e,t),n=re((await Promise.all((r.presets||[]).flatMap(k).flatMap(he))).flat(),(p,y)=>p.name===y.name),s=[...n.filter(p=>p.enforce==="pre"),...n.filter(p=>!p.enforce),...n.filter(p=>p.enforce==="post")],a=[...s,r],f=[...a].reverse(),u=Object.assign({},Ae,...a.map(p=>p.layers));function c(p){return N(a.flatMap(y=>k(y[p]||[])))}let i=c("extractors"),o=f.find(p=>p.extractorDefault!==void 0)?.extractorDefault;o===void 0&&(o=Ee),o&&!i.includes(o)&&i.unshift(o),i.sort((p,y)=>(p.order||0)-(y.order||0));let l=c("rules"),h=l.length,g={},d=[];for(let[p,y]of l.entries()){let _=y[2]??(y[2]={});_.__index=p,Ve(y)?k(_.prefix??"").forEach(V=>{g[V+y[0]]=y}):d.unshift(y)}let M={templates:N(a.flatMap(p=>k(p.autocomplete?.templates))),extractors:a.flatMap(p=>k(p.autocomplete?.extractors)).sort((p,y)=>(p.order||0)-(y.order||0)),shorthands:We(a.map(p=>p.autocomplete?.shorthands||{}))},A=c("separators");A.length||(A=[":","-"]);let C=He(c("content")),v={mergeSelectors:!0,warn:!0,sortLayers:p=>p,...r,blocklist:c("blocklist"),presets:s,envMode:r.envMode||"build",shortcutsLayer:r.shortcutsLayer||"shortcuts",layers:u,theme:ze(a.map(p=>p.theme)),rules:l,rulesSize:h,rulesDynamic:d,rulesStaticMap:g,preprocess:c("preprocess"),postprocess:c("postprocess"),preflights:c("preflights"),autocomplete:M,variants:c("variants").map(Le).sort((p,y)=>(p.order||0)-(y.order||0)),shortcuts:pe(c("shortcuts")).reverse(),extractors:i,safelist:c("safelist"),separators:A,details:r.details??r.envMode==="dev",content:C,transformers:re(c("transformers"),(p,y)=>p.name===y.name)},S=c("extendTheme");for(let p of S)v.theme=p(v.theme,v)||v.theme;for(let p of a)p?.configResolved?.(v);return v}function ze(t){return t.map(e=>e?Y(e):{}).reduce((e,r)=>ue(e,r),{})}function We(t){return t.reduce((e,r)=>{let n={};for(let s in r){let a=r[s];Array.isArray(a)?n[s]=`(${a.join("|")})`:n[s]=a}return{...e,...n}},{})}function ae(...t){return t.flatMap(Ye)}function Ye(t){return Array.isArray(t)?t:t?[t]:[]}var qe="66.6.8",U={shortcutsNoMerge:"$$symbol-shortcut-no-merge",noMerge:"$$symbol-no-merge",noScope:"$$symbol-no-scope",variants:"$$symbol-variants",parent:"$$symbol-parent",selector:"$$symbol-selector",layer:"$$symbol-layer",sort:"$$symbol-sort",body:"$$symbol-body"},Ke=class de{constructor(e={},r={}){this.userConfig=e,this.defaults=r,this.version=qe,this.events=Re(),this.config=void 0,this.cache=new Map,this.blocked=new Set,this.parentOrders=new Map,this.activatedRules=new Set,this.resolveCSSResult=(n,s,a,f)=>{let u=Te(s).filter(c=>c.length);if(u.length){this.config.details&&f.rules.push(a),f.generator.activatedRules.add(a);let c=a[2];return u.map(i=>{if(O(i))return[c.__index,i,c];let o=f.variantHandlers,l=c,h=d=>{o=[d,...o]},g=d=>{l={...l,...d}};for(let d of i)switch(d[0]){case U.variants:typeof d[1]=="function"?o=d[1](o)||o:o=[...k(d[1]),...o];break;case U.parent:h({parent:d[1]});break;case U.selector:h({selector:d[1]});break;case U.layer:h({layer:d[1]});break;case U.sort:g({sort:d[1]});break;case U.noMerge:g({noMerge:d[1]});break;case U.noScope:g({noScope:d[1]});break;case U.body:d[0]=Ue;break}return[c.__index,n,i,l,o]})}}}static async create(e={},r={}){let n=new de(e,r);return n.config=await ie(n.userConfig,n.defaults),n.events.emit("config",n.config),n}async setConfig(e,r){e&&(r&&(this.defaults=r),this.userConfig=e,this.blocked.clear(),this.parentOrders.clear(),this.activatedRules.clear(),this.cache.clear(),this.config=await ie(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,envMode:this.config.envMode};for(let a of this.config.extractors){let f=await a.extract?.(s);if(f)if(Z(f)&&Z(n))for(let u of f)n.setCount(u,n.getCount(u)+f.getCount(u));else for(let u of f)n.add(u)}return n}makeContext(e,r){let n={rawSelector:e,currentSelector:r[1],theme:this.config.theme,generator:this,symbols:U,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=this.config.preprocess.reduce((c,i)=>i(c)??c,e);if(this.isBlocked(s)){this.blocked.add(e),this.cache.set(n,null);return}let a=await this.matchVariants(e,s);if(a.every(c=>!c||this.isBlocked(c[1]))){this.blocked.add(e),this.cache.set(n,null);return}let f=async c=>{let i=this.makeContext(e,[r||c[0],c[1],c[2],c[3]]);this.config.details&&(i.variants=[...c[3]]);let o=await this.expandShortcut(i.currentSelector,i);return o?await this.stringifyShortcuts(i.variantMatch,i,o[0],o[1]):(await this.parseUtil(i.variantMatch,i))?.flatMap(l=>this.stringifyUtil(l,i)).filter(H)},u=(await Promise.all(a.map(c=>f(c)))).flat().filter(c=>!!c);if(u?.length)return this.cache.set(n,u),u;this.cache.set(n,null)}async generate(e,r={}){let{id:n,scope:s,preflights:a=!0,safelist:f=!0,minify:u=!1,extendedInfo:c=!1}=r,i=O(e)?await this.applyExtractors(e,n,c?new fe:new Set):Array.isArray(e)?new Set(e):e;if(f){let b={generator:this,theme:this.config.theme};this.config.safelist.flatMap(x=>typeof x=="function"?x(b):x).forEach(x=>{let w=x.trim();w&&!i.has(w)&&i.add(w)})}let o=u?"":`
2
2
  `,l=new Set([X]),h=c?new Map:new Set,g=new Map,d={},M=Array.from(i).map(async b=>{if(h.has(b))return;let x=await this.parseToken(b);if(x!=null){h instanceof Map?h.set(b,{data:x,count:Z(i)?i.getCount(b):-1}):h.add(b);for(let w of x){let T=w[3]||"",j=w[4]?.layer;g.has(T)||g.set(T,[]),g.get(T).push(w),j&&l.add(j)}}});await Promise.all(M),await(async()=>{if(!a)return;let b={generator:this,theme:this.config.theme},x=new Set([]);this.config.preflights.forEach(({layer:w=le})=>{l.add(w),x.add(w)}),d=Object.fromEntries(await Promise.all(Array.from(x).map(async w=>[w,(await Promise.all(this.config.preflights.filter(T=>(T.layer||"preflights")===w).map(async T=>await T.getCSS(b)))).filter(Boolean).join(o)])))})();let A=b=>this.config.sortLayers(b.sort((x,w)=>(this.config.layers[x]??0)-(this.config.layers[w]??0)||x.localeCompare(w))),C=A(Array.from(l)),v={},S=this.config.outputToCssLayers,p=b=>{let x=b;return typeof S=="object"&&(x=S.cssLayerName?.(b)),x===null?null:x??b},y=(b=X)=>{if(v[b])return v[b];let x=Array.from(g).sort((j,m)=>(this.parentOrders.get(j[0])??0)-(this.parentOrders.get(m[0])??0)||j[0]?.localeCompare(m[0]||"")||0).map(([j,m])=>{let $=m.length,E=m.filter(L=>(L[4]?.layer||"default")===b).sort((L,D)=>L[0]-D[0]||(L[4]?.sort||0)-(D[4]?.sort||0)||L[5]?.currentSelector?.localeCompare(D[5]?.currentSelector??"")||L[1]?.localeCompare(D[1]||"")||L[2]?.localeCompare(D[2]||"")||0).map(([,L,D,,I,,K])=>[[[(L&&!I?.noScope?Je(L,s):L)??"",I?.sort??0]],D,!!(K??I?.noMerge)]);if(!E.length)return;let R=E.reverse().map(([L,D,I],K)=>{if(!I&&this.config.mergeSelectors)for(let F=K+1;F<$;F++){let G=E[F];if(G&&!G[2]&&(L&&G[0]||L==null&&G[0]==null)&&G[1]===D)return L&&G[0]&&G[0].push(...L),null}let te=L?N(L.sort((F,G)=>F[1]-G[1]||F[0]?.localeCompare(G[0]||"")||0).map(F=>F[0]).filter(Boolean)):[];return te.length?`${te.join(`,${o}`)}{${D}}`:D}).filter(Boolean),P=Array.from(new Set(R)).reverse().join(o);if(!j)return P;let B=j.split(" $$ ");return`${B.join("{")}{${o}${P}${o}${"}".repeat(B.length)}`}).filter(Boolean).join(o);a&&(x=[d[b],x].filter(Boolean).join(o));let w;S&&x&&(w=p(b),w!==null&&(x=`@layer ${w}{${o}${x}${o}}`));let T=u?"":`/* layer: ${b}${w&&w!==b?`, alias: ${w}`:""} */${o}`;return v[b]=x?T+x:""},_=(b=C,x)=>{let w=b.filter(j=>!x?.includes(j)),T=w.map(y).filter(Boolean);if(S){let j=w;typeof S=="object"&&S.allLayers&&(j=A(Object.keys(this.config.layers))),j.length>0&&T.unshift(`@layer ${j.map(p).filter(H).join(", ")};`)}return T.join(o)};return{get css(){return _()},layers:C,matched:h,getLayers:_,getLayer:y,setLayer:async(b,x)=>{let w=await x(y(b));return v[b]=w,w}}}async matchVariants(e,r){let n={rawSelector:e,theme:this.config.theme,generator:this},s=async a=>{let f=!0,[,,u,c]=a;for(;f;){f=!1;let i=a[1];for(let o of this.config.variants){if(!o.multiPass&&c.has(o))continue;let l=await o.match(i,n);if(l){if(O(l)){if(l===i)continue;l={matcher:l}}if(Array.isArray(l)){if(!l.length)continue;if(l.length===1)l=l[0];else{if(o.multiPass)throw new Error("multiPass can not be used together with array return variants");let h=l.map(g=>{let d=g.matcher??i,M=[g,...u],A=new Set(c);return A.add(o),[a[0],d,M,A]});return(await Promise.all(h.map(g=>s(g)))).flat()}}a[1]=l.matcher??i,u.unshift(l),c.add(o),f=!0;break}}if(!f)break;if(u.length>500)throw new Error(`Too many variants applied to "${e}"`)}return[a]};return await s([e,r||e,[],new Set])}applyVariants(e,r=e[4],n=e[1]){let s=r.slice().sort((c,i)=>(c.order||0)-(i.order||0)).reduceRight((c,i)=>o=>{let l=i.body?.(o.entries)||o.entries,h=Array.isArray(i.parent)?i.parent:[i.parent,void 0],g=i.selector?.(o.selector,l);return(i.handle??Xe)({...o,entries:l,selector:g||o.selector,parent:h[0]||o.parent,parentOrder:h[1]||o.parentOrder,layer:i.layer||o.layer,sort:i.sort||o.sort},c)},c=>c)({prefix:"",selector:Qe(n),pseudo:"",entries:e[2]}),{parent:a,parentOrder:f}=s;a!=null&&f!=null&&this.parentOrders.set(a,f);let u={selector:[s.prefix,s.selector,s.pseudo].join(""),entries:s.entries,parent:a,layer:s.layer,sort:s.sort,noMerge:s.noMerge};return this.config.postprocess.reduce((c,i)=>{let o=[];for(let l of c){let h=i(l);Array.isArray(h)?o.push(...h.filter(H)):o.push(h||l)}return o},[u])}constructCustomCSS(e,r,n){let s=q(r);return O(s)?s:this.applyVariants([0,n||e.rawSelector,s,void 0,e.variantHandlers]).map(({selector:a,entries:f,parent:u})=>{let c=`${a}{${Q(f)}}`;return u?`${u}{${c}}`:c}).join("")}async parseUtil(e,r,n=!1,s){let a=O(e)?await this.matchVariants(e):[e],f=async([c,i,o])=>{this.config.details&&(r.rules=r.rules??[]);let l={...r,variantHandlers:o},h=this.config.rulesStaticMap[i];if(h&&h[1]&&(n||!h[2]?.internal))return this.resolveCSSResult(c,h[1],h,l);for(let g of this.config.rulesDynamic){let[d,M,A]=g;if(A?.internal&&!n)continue;let C=i;if(A?.prefix){let y=k(A.prefix);if(s){let _=k(s);if(!y.some(V=>_.includes(V)))continue}else{let _=y.find(V=>i.startsWith(V));if(_==null)continue;C=i.slice(_.length)}}let v=C.match(d);if(!v)continue;let S=await M(v,l);if(!S)continue;if(typeof S!="string")if(Symbol.asyncIterator in S){let y=[];for await(let _ of S)_&&y.push(_);S=y}else Symbol.iterator in S&&!Array.isArray(S)&&(S=Array.from(S).filter(H));let p=this.resolveCSSResult(c,S,g,l);if(p)return p}},u=(await Promise.all(a.map(c=>f(c)))).flat().filter(c=>!!c);if(u.length)return u}stringifyUtil(e,r){if(!e)return;if(ne(e))return[[e[0],void 0,e[1],void 0,e[2],this.config.details?r:void 0,void 0]];let n=this.applyVariants(e),s=[];for(let a of n){let{selector:f,entries:u,parent:c,layer:i,sort:o,noMerge:l}=a,h=Q(u);if(!h)continue;let{layer:g,sort:d,...M}=e[3]??{},A={...M,layer:i??g,sort:o??d};s.push([e[0],f,h,c,A,this.config.details?r:void 0,l])}return s}async expandShortcut(e,r,n=5){if(n===0)return;let s=this.config.details?i=>{r.shortcuts=r.shortcuts??[],r.shortcuts.push(i)}:Oe,a,f,u,c;for(let i of this.config.shortcuts){let o=e;if(i[2]?.prefix){let l=k(i[2].prefix).find(h=>e.startsWith(h));if(l==null)continue;o=e.slice(l.length)}if(De(i)){if(i[0]===o){a=a||i[2],f=i[1],s(i);break}}else{let l=o.match(i[0]);if(l&&(f=i[1](l,r)),f){a=a||i[2],s(i);break}}}if(f&&(u=N(k(f).filter(O).map(i=>Fe(i.trim()).split(/\s+/g)).flat()),c=k(f).filter(i=>!O(i)).map(i=>({handles:[],value:i}))),!f){let i=O(e)?await this.matchVariants(e):[e];for(let o of i){let[l,h,g]=o;if(l!==h){let d=await this.expandShortcut(h,r,n-1);d&&(u=d[0].filter(O).map(M=>l.replace(h,M)),c=d[0].filter(M=>!O(M)).map(M=>({handles:[...M.handles,...g],value:M.value})))}}}if(!(!u?.length&&!c?.length))return[[await Promise.all(k(u).map(async i=>(await this.expandShortcut(i,r,n-1))?.[0]||[i])),c].flat(2).filter(i=>!!i),a]}async stringifyShortcuts(e,r,n,s={layer:this.config.shortcutsLayer}){let a=new je,f=(await Promise.all(N(n).map(async o=>{let l=O(o)?await this.parseUtil(o,r,!0,s.prefix):[[Number.POSITIVE_INFINITY,"{inline}",q(o.value),void 0,o.handles]];return!l&&this.config.warn&&Be(`unmatched utility "${o}" in shortcut "${e[1]}"`),l||[]}))).flat(1).filter(Boolean).sort((o,l)=>o[0]-l[0]),[u,,c]=e,i=[];for(let o of f){if(ne(o)){i.push([o[0],void 0,o[1],void 0,o[2],r,void 0]);continue}let l=Object.fromEntries(o[2])[U.shortcutsNoMerge],h=[...o[4],...l?[]:c];for(let{selector:g,entries:d,parent:M,sort:A,noMerge:C,layer:v}of this.applyVariants(o,h,u))a.getFallback(v??s.layer,new ke).getFallback(g,M,[[],o[0]])[0].push([d,!!(C??o[3]?.noMerge),A??0])}return i.concat(a.flatMap((o,l)=>o.map(([h,g],d,M)=>{let A=(C,v,S)=>{let p=Math.max(...S.map(_=>_[1])),y=S.map(_=>_[0]);return(C?[y.flat(1)]:y).map(_=>{let V=Q(_);if(V)return[g,d,V,M,{...s,noMerge:v,sort:p,layer:l},r,void 0]})};return[[h.filter(([,C])=>C).map(([C,,v])=>[C,v]),!0],[h.filter(([,C])=>!C).map(([C,,v])=>[C,v]),!1]].map(([C,v])=>[...A(!1,v,C.filter(([S])=>S.some(p=>p[0]===U.shortcutsNoMerge))),...A(!0,v,C.filter(([S])=>S.every(p=>p[0]!==U.shortcutsNoMerge)))])}).flat(2).filter(Boolean)))}isBlocked(e){return!e||this.config.blocklist.map(r=>Array.isArray(r)?r[0]:r).some(r=>typeof r=="function"?r(e):O(r)?r===e:r.test(e))}getBlocked(e){let r=this.config.blocklist.find(n=>{let s=Array.isArray(n)?n[0]:n;return typeof s=="function"?s(e):O(s)?s===e:s.test(e)});return r?Array.isArray(r)?r:[r,void 0]:void 0}};async function me(t,e){return await Ke.create(t,e)}var ge=/\s\$\$\s+/g;function Ze(t){return ge.test(t)}function Je(t,e){return Ze(t)?t.replace(ge,e?` ${e} `:" "):e?`${e} ${t}`:t}var ce=/^\[(.+?)(~?=)"(.*)"\]$/;function Qe(t){return ce.test(t)?t.replace(ce,(e,r,n,s)=>`[${J(r)}${n}"${J(s)}"]`):`.${J(t)}`}function Xe(t,e){return e(t)}function et(t){return t.replace(/-(\w)/g,(e,r)=>r?r.toUpperCase():"")}function ye(t){return t.charAt(0).toUpperCase()+t.slice(1)}function ve(t){return t.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase()}var Se=["Webkit","Moz","ms"];function be(t){let e={};function r(n){let s=e[n];if(s)return s;let a=et(n);if(a!=="filter"&&a in t)return e[n]=ve(a);a=ye(a);for(let f=0;f<Se.length;f++){let u=`${Se[f]}${a}`;if(u in t)return e[n]=ve(ye(u))}return n}return({entries:n})=>n.forEach(s=>{s[0].startsWith("--")||(s[0]=r(s[0]))})}function xe(t){return t.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<")}async function ee(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||{},a=Object.assign({},t,s.runtime),f=a.defaults||{},u=a.cloakAttribute??"un-cloak";a.autoPrefix&&(f.postprocess=k(f.postprocess)).unshift(be(r.createElement("div").style)),a.configResolved?.(s,f);let c=await me(s,f),i=m=>{let $=t.rootElement?.();if($){$.appendChild(m);return}a.inject?a.inject(m):n().prepend(m)},o=()=>a.rootElement?a.rootElement():r.body,l=new Map,h=!0,g=new Set,d,M,A=[],C=()=>new Promise(m=>{A.push(m),M!=null&&clearTimeout(M),M=setTimeout(()=>p().then(()=>{let $=A;A=[],$.forEach(E=>E())}),0)});function v(m,$=!1){if(m.nodeType!==1)return;let E=m;E.hasAttribute(u)&&E.removeAttribute(u),$&&E.querySelectorAll(`[${u}]`).forEach(R=>{R.removeAttribute(u)})}function S(m,$){let E=l.get(m);if(!E)if(E=r.createElement("style"),E.setAttribute("data-unocss-runtime-layer",m),l.set(m,E),$==null)i(E);else{let R=S($),P=R.parentNode;P?P.insertBefore(E,R.nextSibling):i(E)}return E}async function p(){let m=[...g],$=await c.generate(m);return $.layers.reduce((R,P)=>(S(P,R).innerHTML=$.getLayer(P)??"",P),void 0),m.filter(R=>!$.matched.has(R)).forEach(R=>g.delete(R)),{...$,getStyleElement:R=>l.get(R),getStyleElements:()=>l}}async function y(m){let $=g.size;await c.applyExtractors(m,void 0,g),$!==g.size&&await C()}async function _(m=o()){let $=m&&m.outerHTML;$&&(await y(`${$} ${xe($)}`),v(n()),v(m,!0))}let V=new MutationObserver(m=>{h||m.forEach(async $=>{if($.target.nodeType!==1)return;let E=$.target;for(let R of l)if(E===R[1])return;if($.type==="childList")$.addedNodes.forEach(async R=>{if(R.nodeType!==1)return;let P=R;d&&!d(P)||(await y(P.outerHTML),v(P))});else{if(d&&!d(E))return;if($.attributeName!==u){let R=Array.from(E.attributes).map(B=>B.value?`${B.name}="${B.value}"`:B.name).join(" "),P=`<${E.tagName.toLowerCase()} ${R}>`;await y(P)}v(E)}})}),b=!1;function x(){if(b)return;let m=a.observer?.target?a.observer.target():o();m&&(V.observe(m,{childList:!0,subtree:!0,attributes:!0,attributeFilter:a.observer?.attributeFilter}),b=!0)}function w(){a.bypassDefined&&tt(c.blocked),_(),x()}function T(){r.readyState==="loading"?e.addEventListener("DOMContentLoaded",w):w()}let j=e.__unocss_runtime=e.__unocss_runtime={version:c.version,uno:c,async extract(m){O(m)||(m.forEach($=>g.add($)),m=""),await y(m)},extractAll:_,inspect(m){d=m},toggleObserver(m){m===void 0?h=!h:h=!!m,!b&&!h&&T()},update:p,presets:e.__unocss_runtime?.presets??{}};a.ready?.(j)!==!1&&(h=!1,T())}function tt(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}ee();})();