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