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