function P(r){if(arguments.length===0)throw new TypeError("`CSS.escape` requires an argument.");let e=String(r),s=e.length,n=-1,t,l="",o=e.charCodeAt(0);if(s===1&&o===45)return"\\"+e;for(;++n=1&&t<=31||t===127||n===0&&t>=48&&t<=57||n===1&&t>=48&&t<=57&&o===45){l+="\\"+t.toString(16)+" ";continue}if(t>=128||t===45||t===95||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122){l+=e.charAt(n);continue}l+="\\"+e.charAt(n)}return l}function O(r){return r.replace(/\\([\dA-Fa-f]{1,6}[\t\n\f\r ]?|[\S\s])/g,e=>e.length>2?String.fromCodePoint(Number.parseInt(e.slice(1).trim(),16)):e[1])}var F=new Map([["--font",["--font-weight","--font-size"]],["--inset",["--inset-shadow","--inset-ring"]],["--text",["--text-color","--text-underline-offset","--text-indent","--text-decoration-thickness","--text-decoration-color"]]]);function D(r,e){return(F.get(e)??[]).some(s=>r===s||r.startsWith(`${s}-`))}var _=class{constructor(e=new Map,s=new Set([])){this.values=e;this.keyframes=s}prefix=null;add(e,s,n=0){if(e.endsWith("-*")){if(s!=="initial")throw new Error(`Invalid theme value \`${s}\` for namespace \`${e}\``);e==="--*"?this.values.clear():this.clearNamespace(e.slice(0,-2),0)}if(n&4){let t=this.values.get(e);if(t&&!(t.options&4))return}s==="initial"?this.values.delete(e):this.values.set(e,{value:s,options:n})}keysInNamespaces(e){let s=[];for(let n of e){let t=`${n}-`;for(let l of this.values.keys())l.startsWith(t)&&l.indexOf("--",2)===-1&&(D(l,n)||s.push(l.slice(t.length)))}return s}get(e){for(let s of e){let n=this.values.get(s);if(n)return n.value}return null}hasDefault(e){return(this.getOptions(e)&4)===4}getOptions(e){return e=O(this.#n(e)),this.values.get(e)?.options??0}entries(){return this.prefix?Array.from(this.values,e=>(e[0]=this.#r(e[0]),e)):this.values.entries()}#r(e){return this.prefix?`--${this.prefix}-${e.slice(2)}`:e}#n(e){return this.prefix?`--${e.slice(3+this.prefix.length)}`:e}clearNamespace(e,s){let n=F.get(e)??[];e:for(let t of this.values.keys())if(t.startsWith(e)){if(s!==0&&(this.getOptions(t)&s)!==s)continue;for(let l of n)if(t.startsWith(l))continue e;this.values.delete(t)}}#e(e,s){for(let n of s){let t=e!==null?`${n}-${e}`:n;if(!this.values.has(t))if(e!==null&&e.includes(".")){if(t=`${n}-${e.replaceAll(".","_")}`,!this.values.has(t))continue}else continue;if(!D(t,n))return t}return null}#t(e){return this.values.has(e)?`var(${P(this.#r(e))})`:null}markUsedVariable(e){let s=O(this.#n(e)),n=this.values.get(s);n&&(n.options|=16)}resolve(e,s){let n=this.#e(e,s);if(!n)return null;let t=this.values.get(n);return t.options&1?t.value:this.#t(n)}resolveValue(e,s){let n=this.#e(e,s);return n?this.values.get(n).value:null}resolveWith(e,s,n=[]){let t=this.#e(e,s);if(!t)return null;let l={};for(let f of n){let a=`${t}${f}`,u=this.values.get(a);u&&(u.options&1?l[f]=u.value:l[f]=this.#t(a))}let o=this.values.get(t);return o.options&1?[o.value,l]:[this.#t(t),l]}namespace(e){let s=new Map,n=`${e}-`;for(let[t,l]of this.values)t===e?s.set(null,l.value):t.startsWith(`${n}-`)?s.set(t.slice(e.length),l.value):t.startsWith(n)&&s.set(t.slice(n.length),l.value);return s}addKeyframes(e){this.keyframes.add(e)}getKeyframes(){return Array.from(this.keyframes)}};var y=class extends Map{constructor(s){super();this.factory=s}get(s){let n=super.get(s);return n===void 0&&(n=this.factory(s,this),this.set(s,n)),n}};function V(r){return{kind:"word",value:r}}function ue(r,e){return{kind:"function",value:r,nodes:e}}function fe(r){return{kind:"separator",value:r}}function E(r,e,s=null){for(let n=0;n0){let i=V(t);n?n.nodes.push(i):e.push(i),t=""}let a=o,u=o+1;for(;u0){let u=V(t);a.nodes.push(u),t=""}s.length>0?n=s[s.length-1]:n=null;break}default:t+=String.fromCharCode(f)}}return t.length>0&&e.push(V(t)),e}function Z(r){let e=[];return E(J(r),s=>{if(!(s.kind!=="function"||s.value!=="var"))return E(s.nodes,n=>{n.kind!=="word"||n.value[0]!=="-"||n.value[1]!=="-"||e.push(n.value)}),1}),e}var me=64;function xe(r,e=[]){return{kind:"rule",selector:r,nodes:e}}function L(r,e="",s=[]){return{kind:"at-rule",name:r,params:e,nodes:s}}function re(r,e=[]){return r.charCodeAt(0)===me?v(r,e):xe(r,e)}function ne(r,e,s=!1){return{kind:"declaration",property:r,value:e,important:s}}function se(r){return{kind:"comment",value:r}}function Pe(r,e){return{kind:"context",context:r,nodes:e}}function De(r){return{kind:"at-root",nodes:r}}function b(r,e,s=[],n={}){for(let t=0;tnew Set),o=new Set,f=new Set,a=new y(()=>new Set);function u(i,g,p={},m=0){if(i.kind==="declaration"){if(i.property==="--tw-sort"||i.value===void 0||i.value===null)return;if(p.theme&&i.property[0]==="-"&&i.property[1]==="-"&&(p.keyframes||l.get(g).add(i)),i.value.includes("var("))if(p.theme&&i.property[0]==="-"&&i.property[1]==="-")for(let c of Z(i.value))a.get(c).add(i.property);else e.trackUsedVariables(i.value);if(i.property==="animation"){let c=i.value.split(/\s+/);for(let h of c)f.add(h)}g.push(i)}else if(i.kind==="rule")if(i.selector==="&")for(let c of i.nodes){let h=[];u(c,h,p,m+1),h.length>0&&g.push(...h)}else{let c={...i,nodes:[]};for(let h of i.nodes)u(h,c.nodes,p,m+1);c.nodes.length>0&&g.push(c)}else if(i.kind==="at-rule"&&i.name==="@property"&&m===0){if(t.has(i.params))return;t.add(i.params);let c={...i,nodes:[]};for(let h of i.nodes)u(h,c.nodes,p,m+1);g.push(c)}else if(i.kind==="at-rule"){i.name==="@keyframes"&&(p={...p,keyframes:!0});let c={...i,nodes:[]};for(let h of i.nodes)u(h,c.nodes,p,m+1);i.name==="@keyframes"&&p.theme&&o.add(c),(c.nodes.length>0||c.name==="@layer"||c.name==="@charset"||c.name==="@custom-media"||c.name==="@namespace"||c.name==="@import")&&g.push(c)}else if(i.kind==="at-root")for(let c of i.nodes){let h=[];u(c,h,p,0);for(let A of h)n.push(A)}else if(i.kind==="context")if(i.context.reference){if(s){let c=te(i.nodes,h=>h===s);if(c){let h=c.filter(x=>x.kind==="at-rule").map(x=>({...x,nodes:[]})).reverse(),A=s;for(let x of h)x.nodes=[A],A=x;let N=[];u(A,N,{...p,...i.context,reference:!1},m),g.push(...N)}}return}else for(let c of i.nodes)u(c,g,{...p,...i.context},m);else i.kind==="comment"&&g.push(i)}let d=[];for(let i of r)u(i,d,{},0);e:for(let[i,g]of l)for(let p of g){if(le(p.property,e.theme,a)){if(p.property.startsWith("--animate-")){let h=p.value.split(/\s+/);for(let A of h)f.add(A)}continue}let c=i.indexOf(p);if(i.splice(c,1),i.length===0){let h=te(d,A=>A.kind==="rule"&&A.nodes===i);if(!h||h.length===0)continue e;h.unshift({kind:"at-root",nodes:d});do{let A=h.pop();if(!A)break;let N=h[h.length-1];if(!N||N.kind!=="at-root"&&N.kind!=="at-rule")break;let x=N.nodes.indexOf(A);if(x===-1)break;N.nodes.splice(x,1)}while(!0);continue e}}for(let i of o)if(!f.has(i.params)){let g=n.indexOf(i);n.splice(g,1)}return d.concat(n)}function Fe(r){function e(n,t=0){let l="",o=" ".repeat(t);if(n.kind==="declaration")l+=`${o}${n.property}: ${n.value}${n.important?" !important":""}; `;else if(n.kind==="rule"){l+=`${o}${n.selector} { `;for(let f of n.nodes)l+=e(f,t+1);l+=`${o}} `}else if(n.kind==="at-rule"){if(n.nodes.length===0)return`${o}${n.name} ${n.params}; `;l+=`${o}${n.name}${n.params?` ${n.params} `:" "}{ `;for(let f of n.nodes)l+=e(f,t+1);l+=`${o}} `}else if(n.kind==="comment")l+=`${o}/*${n.value}*/ `;else if(n.kind==="context"||n.kind==="at-root")return"";return l}let s="";for(let n of r){let t=e(n);t!==""&&(s+=t)}return s}function te(r,e){let s=[];return b(r,(n,{path:t})=>{if(e(n))return s=[...t],2}),s}function le(r,e,s,n=new Set){if(n.has(r)||(n.add(r),e.getOptions(r)&24))return!0;{let l=s.get(r)??[];for(let o of l)if(le(o,e,s,n))return!0}return!1}var S=92,R=47,T=42,Ne=34,ke=39,ye=58,w=59,k=10,C=32,$=9,ie=123,K=125,W=40,oe=41,ve=91,Se=93,ae=45,U=64,Ce=33;function He(r){r=r.replaceAll(`\r `,` `);let e=[],s=[],n=[],t=null,l=null,o="",f="",a;for(let u=0;u0&&r[c]===i[i.length-1]&&(i=i.slice(0,-1));let m=I(o,p);if(!m)throw new Error("Invalid custom property, expected a value");t?t.nodes.push(m):e.push(m),o=""}else if(d===w&&o.charCodeAt(0)===U)l=v(o),t?t.nodes.push(l):e.push(l),o="",l=null;else if(d===w&&f[f.length-1]!==")"){let i=I(o);if(!i)throw o.length===0?new Error("Unexpected semicolon"):new Error(`Invalid declaration: \`${o.trim()}\``);t?t.nodes.push(i):e.push(i),o=""}else if(d===ie&&f[f.length-1]!==")")f+="}",l=re(o.trim()),t&&t.nodes.push(l),n.push(t),t=l,o="",l=null;else if(d===K&&f[f.length-1]!==")"){if(f==="")throw new Error("Missing opening {");if(f=f.slice(0,-1),o.length>0)if(o.charCodeAt(0)===U)l=v(o),t?t.nodes.push(l):e.push(l),o="",l=null;else{let g=o.indexOf(":");if(t){let p=I(o,g);if(!p)throw new Error(`Invalid declaration: \`${o.trim()}\``);t.nodes.push(p)}}let i=n.pop()??null;i===null&&t&&e.push(t),t=i,o="",l=null}else if(d===W)f+=")",o+="(";else if(d===oe){if(f[f.length-1]!==")")throw new Error("Missing opening (");f=f.slice(0,-1),o+=")"}else{if(o.length===0&&(d===C||d===k||d===$))continue;o+=String.fromCharCode(d)}}}if(o.charCodeAt(0)===U&&e.push(v(o)),f.length>0&&t){if(t.kind==="rule")throw new Error(`Missing closing } at ${t.selector}`);if(t.kind==="at-rule")throw new Error(`Missing closing } at ${t.name} ${t.params}`)}return s.length>0?s.concat(e):e}function v(r,e=[]){for(let s=5;s