@teacss/core 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -348
- package/dist/index.d.ts +7 -1
- package/dist/index.js +21 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import e from"node:crypto";function t(e,t){Object.defineProperty(e,e.length,{configurable:!0,enumerable:!0,value:t,writable:!0})}function*n(e){if(Array.isArray(e))for(let t=0,n=e.length;t<n;t++)Object.hasOwn(e,t)&&(yield e[t])}const r=new Set([`>`,`+`,`~`]);function i(e){if(e===void 0)return!1;let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||e===`-`||e===`_`||t>=128}function a(e){if(e===void 0)return!1;let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||e===`_`||t>=128}function o(e,t){let n=e[t];if(n===`-`){let n=e[t+1];return n===`-`||n===`\\`||a(n)}return a(n)}function s(e,t){let n=/^(?:[\da-f]{1,6}(?:\r\n|[ \t\n\r\f])?|[^\n\r\f])/i.exec(e.slice(t+1));return n?t+1+n[0].length:void 0}function c(e,t){let n=t;if(e[n]===`\\`||o(e,n)){for(;n<e.length;){if(e[n]===`\\`){let t=s(e,n);if(t===void 0)return;n=t;continue}if(!i(e[n]))break;n++}return n>t?n:void 0}}function l(e){return e.replace(/\\([\da-f]{1,6})(?:\r\n|[ \t\n\r\f])?|\\([^\n\r\f])/gi,(e,t,n)=>{if(!t)return n;let r=Number.parseInt(t,16);return String.fromCodePoint(r===0||r>1114111||r>=55296&&r<=57343?65533:r)})}function u(e,t){let n=e[t];for(let r=t+1;r<e.length;r++){let t=e[r];if(t===n)return r+1;if(t===`\\`){let t=/^(?:[\da-f]{1,6}(?:\r\n|[ \t\n\r\f])?|\r\n|[\s\S])/i.exec(e.slice(r+1));if(!t)return;r+=t[0].length}else if(/[\n\r\f]/.test(t))return}}function d(e,t,n,r){if(e[t]!==n)return;let i=0;for(let a=t;a<e.length;a++){let t=e[a];if(t===`\\`){let t=s(e,a);if(t===void 0)return;a=t-1}else if(t===`/`&&e[a+1]===`*`){let t=e.indexOf(`*/`,a+2);if(t===-1)return;a=t+1}else if(t===`"`||t===`'`){let t=u(e,a);if(t===void 0)return;a=t-1}else if(t===n)i++;else if(t===r&&--i===0)return a+1}}function f(e,t){let n=t;for(;e[n]===`/`&&e[n+1]===`*`;){let t=e.indexOf(`*/`,n+2);if(t===-1)return n;n=t+2}return n}function p(e,t){let n=c(e,f(e,t+1));if(n!==void 0)return e[n]===`(`?d(e,n,`(`,`)`):n}function m(e,t){let n=f(e,t),r=n;if(e[n]===`*`&&!(e[n+1]===`/`&&n>t))n++;else{let t=c(e,n);t!==void 0&&(n=t)}let i=+(n>r);for(;n<e.length;){let t=f(e,n);if(t!==n){n=t;continue}let r=e[n];if(r===`.`||r===`#`){let t=c(e,r===`.`?f(e,n+1):n+1);if(t===void 0)return;n=t}else if(r===`[`){let t=d(e,n,`[`,`]`);if(t===void 0||!/[^ \t\n\r\f]/.test(e.slice(n+1,t-1).replace(/\/\*[\s\S]*?\*\//g,``)))return;n=t}else if(r===`:`){let t=p(e,n);if(t===void 0)return;n=t}else break;i++}return i>0?n:void 0}function h(e){let t=f(e,0);if(t===e.length)return!1;for(;t<e.length;){if(e[t]!==`:`)return!1;let n=p(e,t);if(n===void 0)return!1;t=f(e,n)}return!0}function g(e){if(!e)return!1;let t=0;for(;;){let n=m(e,t);if(n===void 0)return!1;if(t=f(e,n),t===e.length)return!0;if(!r.has(e[t])||(t=f(e,t+1),t===e.length))return!1}}const _=new Set([`before`,`after`,`first-line`,`first-letter`]);function v(e,t){let n=C(e,t);return n!==void 0&&_.has(n.name)}function y(e,t){let n=0,r=0,i;for(let a=0;a<e.length;a++){let o=e[a];if(i)o===`\\`?a++:o===i&&(i=void 0);else if(o===`\\`)a++;else if(o===`/`&&e[a+1]===`*`){let t=e.indexOf(`*/`,a+2);if(t===-1)return;a=t+1}else if(o===`"`||o===`'`)i=o;else if(o===`[`)n++;else if(o===`]`)n>0&&n--;else if(o===`(`)r++;else if(o===`)`)r>0&&r--;else if(o===`:`&&n===0&&r===0){let n=f(e,a+1);if(e[n]===`:`){if(t(a))return;a=n}else if(v(e,a)&&t(a))return}}}function b(e){let t=-1;return y(e,e=>(t=e,!0)),t}function x(e){let t=!0;return y(e,n=>!C(e,n)&&(t=!1,!0)),t}function S(e){let t=0;return y(e,()=>(t++,!1)),t}function C(e,t){let n=f(e,t+1);e[n]===`:`&&(n=f(e,n+1));let r=c(e,n);if(r!==void 0)return{end:r,name:l(e.slice(n,r)).toLowerCase()}}function w(e,t,n,r){let i=0,a;for(let o=t;o<n;o++){let s=e[o];if(a){s===`\\`?o++:s===a&&(a=void 0);continue}if(s===`\\`)o++;else if(s===`/`&&e[o+1]===`*`){let t=e.indexOf(`*/`,o+2);if(t===-1||t>=n)return!1;o=t+1}else if(s===`"`||s===`'`)a=s;else if(s===`(`)i++;else if(s===`)`){if(i--,i===0){let i=e.slice(t+1,o).replaceAll(/\/\*[\s\S]*?\*\//g,``),a=e.slice(o+1,n),s=f(a,0)===a.length;return/[^ \t\n\r\f]/.test(i)&&(s||r&&h(a))}if(i<0)return!1}}return!1}function T(e){let n=[],r=0,i=!1;if(y(e,a=>{r++;let o=C(e,a);return o?t(n,{...o,index:a}):i=!0,r>2}),r<=1)return!0;if(i||r!==2||n.length!==2)return!1;let[a,o]=n,s=a.name,c=o.name;return s!==`part`&&s!==`slotted`||e[f(e,a.index+1)]!==`:`||e[a.end]!==`(`||!w(e,a.end,o.index,s===`part`)?!1:c===`before`||c===`after`||c===`marker`||c===`placeholder`||c===`file-selector-button`||s===`part`&&(c===`first-line`||c===`first-letter`)}function E(e,t){let n=e;for(;n!==null&&n!==Object.prototype&&n!==Array.prototype&&n!==Function.prototype;){if(Object.hasOwn(n,t))return Reflect.get(e,t);n=Object.getPrototypeOf(n)}}function D(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function O(e=void 0){if(e===void 0)return[];if(!Array.isArray(e))return[e];for(let t=0,n=e.length;t<n;t++){if(Object.hasOwn(e,t))continue;let r=[],i=0;for(let t=0;t<n;t++)Object.hasOwn(e,t)&&D(r,i++,e[t]);return r}return e}function k(e){return Array.from(new Set(n(e)))}function A(e,r){let i=[];for(let a of n(e))i.findIndex(e=>r(a,e))===-1&&t(i,a);return i}function j(e){return typeof e==`string`}const M={">":` > `,_:` `,"+":` + `,"~":` ~ `};function N(e){let t=e[0];return t!==void 0&&Object.hasOwn(M,t)?M[t]:void 0}function P(e){let t=e.startsWith(`!`),n=t?e.slice(1):e,r;return r=n[0]===`:`&&n[f(n,1)]===`:`?`pseudo-element`:n[0]===`.`||n[0]===`#`?`self`:N(n)===void 0?n[0]===`[`?`arbitrary`:`named`:`target`,{raw:e,kind:r,negate:t,value:n}}function F(e){return Array.from(n(e),P)}function I(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`){let t=s(e,r);if(t===void 0)return!1;r=t-1;continue}if(i===`/`&&e[r+1]===`*`){let t=e.indexOf(`*/`,r+2);if(t===-1)return!1;r=t+1;continue}if(i===`"`||i===`'`){let t=u(e,r);if(t===void 0)return!1;r=t-1;continue}if(i===`[`||i===`(`){t(n,i);continue}if(i===`]`||i===`)`){if(n.pop()!==(i===`]`?`[`:`(`))return!1;continue}if(n.length===0&&/[,;{}>+~ \t\n\r\f]/.test(i))return!1}return n.length===0}function L(e){if(e.kind!==`self`&&e.kind!==`pseudo-element`&&e.kind!==`target`)return!1;let t=e.kind===`target`?e.value.slice(1):e.value;if(!t||e.kind===`self`&&t.length===1||!x(t)||!I(t))return!0;if(e.kind===`self`){let n=b(t);return e.negate&&n!==-1?!0:!g(n===-1?t:t.slice(0,n))}return!1}function ee(e){switch(e.kind){case`self`:{if(e.negate)return{suffix:`:not(${e.value})`};let t=b(e.value);return t===-1?{suffix:e.value}:{suffix:e.value.slice(0,t),pseudoElement:e.value.slice(t)}}case`pseudo-element`:return{pseudoElement:e.value};case`target`:{let t=N(e.value);if(t===void 0)return;let n=e.value.slice(1),r=b(n);return g(r===-1?n:n.slice(0,r))?r===-1?{combinator:`${t}${n}`}:{combinator:`${t}${n.slice(0,r)}`,pseudoElement:n.slice(r)}:void 0}default:return}}function te(e){let t={},n=E(e,`prefix`),r=E(e,`suffix`),i=E(e,`combinator`),a=E(e,`pseudoElement`),o=E(e,`parent`);return Object.defineProperties(t,{prefix:{configurable:!0,enumerable:n!==void 0,value:n,writable:!0},suffix:{configurable:!0,enumerable:r!==void 0,value:r,writable:!0},combinator:{configurable:!0,enumerable:i!==void 0,value:i,writable:!0},pseudoElement:{configurable:!0,enumerable:a!==void 0,value:a,writable:!0},parent:{configurable:!0,enumerable:o!==void 0,value:o,writable:!0}}),t}function ne(e){let t=e.suffix;if(!t)return e;let n=b(t);return n===-1?e:{...e,suffix:t.slice(0,n)||void 0,pseudoElement:`${t.slice(n)}${e.pseudoElement??``}`}}function re(e){let t=e.pseudoElement;if(!t)return e;let n=S(t);if(n>1&&!T(t))throw Error(`[Teacss] a token may use at most one pseudo-element, found ${n}`);return e}function ie(e,r=[],i){let a=O(e),o=O(r),s={conditions:a,theme:i},c=[],l=[];for(let e of n(a)){if(L(e)||e.negate&&(e.kind===`pseudo-element`||e.kind===`target`)){t(l,e);continue}if(e.kind===`self`||e.kind===`pseudo-element`||e.kind===`target`){let t=e.kind===`target`?e.value.slice(1):e.value,n=S(t);if(n>1&&!T(t))throw Error(`[Teacss] a token may use at most one pseudo-element, found ${n}`)}let r=ee(e);if(!r){for(let t of n(o))if(r=t(e,s),r||e.negate&&t({...e,raw:e.value,negate:!1},s))break}r?t(c,re(ne(te(r)))):t(l,e)}let u=c.map(e=>e.pseudoElement??``).join(``),d=S(u);if(d>1&&!T(u))throw Error(`[Teacss] a token may use at most one pseudo-element, found ${d}`);return{resolved:c,unresolved:l}}function ae(e,t){let r=Array.from(n(t),te),i=r.map(e=>e.prefix).filter(Boolean),a=r.map(e=>e.suffix).filter(Boolean),o=r.map(e=>e.combinator).filter(Boolean),s=r.map(e=>e.pseudoElement).filter(Boolean),c=r.map(e=>e.parent).filter(Boolean);return{selector:`${i.join(``)}${e}${a.join(``)}${o.join(``)}${s.join(``)}`,parents:c}}const R=1e4;function z(e,t){return e===t||Object.is(e,t)}var oe=class{nodes=new Map;oldest;newest;get size(){return this.nodes.size}peek(){return this.oldest?{done:!1,value:this.oldest.key}:{done:!0,value:void 0}}add(e){if(this.nodes.has(e))return;let t=e===0?0:e,n={key:t,older:this.newest};this.nodes.set(t,n),this.newest?this.newest.newer=n:this.oldest=n,this.newest=n}clear(){this.nodes.clear(),this.oldest=void 0,this.newest=void 0}delete(e){let t=this.nodes.get(e);return t?(this.nodes.delete(e),this.unlink(t),!0):!1}shift(){let e=this.oldest;return e?(this.nodes.delete(e.key),this.unlink(e),{done:!1,value:e.key}):{done:!0,value:void 0}}reset(e){this.clear();for(let t of e)this.add(t)}touch(e){let t=this.nodes.get(e);t&&t!==this.newest&&(this.unlink(t),t.older=this.newest,this.newest?this.newest.newer=t:this.oldest=t,this.newest=t)}unlink(e){e.older?e.older.newer=e.newer:this.oldest=e.newer,e.newer?e.newer.older=e.older:this.newest=e.older,e.older=void 0,e.newer=void 0}},se=class extends Map{assumeNoPrototypeBypass;maxEntries;order=new oe;retained=new Set;_revision=0;constructor(e=R,t,n=!1){if(super(),this.assumeNoPrototypeBypass=n,this.maxEntries=e,t)for(let[e,n]of t)this.set(e,n)}get revision(){return this._revision}get retainedSize(){return this.retained.size}isRetained(e){return this.retained.has(e)}clear(){super.clear(),this.order.clear(),this.retained.clear(),this._revision++}delete(e){this.reconcileOrder();let t=super.delete(e);return this.order.delete(e),this.retained.delete(e),this._revision++,t}set(e,t){this.reconcileOrder();let n=super.has(e);return super.set(e,t),!n&&!this.retained.has(e)&&this.order.add(e),this._revision++,this.enforceInstanceLimit(),this}getOrInsert(e,t){this.reconcileOrder();let n=super.get(e);return n!==void 0||super.has(e)?(this.enforceInstanceLimit(),n):(this.set(e,t),t)}getOrInsertComputed(e,t){if(typeof t!=`function`)throw TypeError(`Map insertion callback must be callable`);this.reconcileOrder();let n=super.get(e);if(n!==void 0||super.has(e))return this.enforceInstanceLimit(),n;let r=e===0?0:e,i=t(r);return this.set(r,i),i}setAndTouch(e,t,n=this.maxEntries){return this.reconcileOrder(),this.retained.has(e)?super.set(e,t):super.delete(e)?(super.set(e,t),this.order.touch(e)):(super.set(e,t),this.order.add(e)),this.size-this.retained.size>n&&this.deleteOldest(),this}replaceRetained(e,t){if(this._revision!==t)return!1;let n=new Map(e);if(this._revision!==t)return!1;this.reconcileOrder();for(let e of this.retained)n.has(e)||(super.delete(e),this.retained.delete(e));for(let[e,t]of n)this.order.delete(e),super.set(e,t),this.retained.add(e);return this.enforceInstanceLimit(),!0}deleteOldest(){this.reconcileEvictionOrder();let e=this.order.shift();for(;!e.done;){if(super.delete(e.value))return!0;this.resetOrder(),e=this.order.shift()}let t=this.firstOrdinaryKey();return!t.done&&super.delete(t.value)}enforceInstanceLimit(){for(;this.size-this.retained.size>this.maxEntries&&this.deleteOldest(););}reconcileOrder(){if(!this.assumeNoPrototypeBypass)for(let e of this.retained)super.has(e)||this.retained.delete(e);this.order.size!==this.size-this.retained.size&&this.resetOrder()}reconcileEvictionOrder(){if(this.assumeNoPrototypeBypass)return;let e=this.order.peek(),t=this.firstOrdinaryKey();(e.done!==t.done||!e.done&&!t.done&&!z(e.value,t.value))&&this.resetOrder()}firstOrdinaryKey(){for(let e of super.keys())if(!this.retained.has(e))return{done:!1,value:e};return{done:!0,value:void 0}}resetOrder(){this.order.reset(Array.from(super.keys()).filter(e=>!this.retained.has(e)))}},ce=class extends Set{assumeNoPrototypeBypass;maxEntries;order=new oe;constructor(e=R,t,n=!1){if(super(),this.assumeNoPrototypeBypass=n,this.maxEntries=e,t)for(let e of t)this.add(e)}add(e){this.reconcileOrder();let t=super.has(e);for(super.add(e),t||this.order.add(e);this.size>this.maxEntries&&this.size&&this.deleteOldest(););return this}addAndTouch(e,t=this.maxEntries){return this.reconcileOrder(),super.delete(e)?(super.add(e),this.order.touch(e)):(super.add(e),this.order.add(e)),this.size>t&&this.deleteOldest(),this}clear(){super.clear(),this.order.clear()}delete(e){this.reconcileOrder();let t=super.delete(e);return this.order.delete(e),t}deleteOldest(){this.reconcileEvictionOrder();let e=this.order.shift();for(;!e.done;){if(super.delete(e.value))return!0;this.order.reset(super.values()),e=this.order.shift()}let t=super.values().next();return!t.done&&super.delete(t.value)}reconcileOrder(){this.order.size!==this.size&&this.order.reset(super.values())}reconcileEvictionOrder(){if(this.assumeNoPrototypeBypass)return;let e=this.order.peek(),t=super.values().next();(e.done!==t.done||!e.done&&!t.done&&!z(e.value,t.value))&&this.order.reset(super.values())}};function le(e){let t=e.keys().next();t.done||e.delete(t.value)}function B(e,t,n,r){if(e instanceof se){e.setAndTouch(t,n,r??e.maxEntries);return}e.delete(t),e.set(t,n),e.size>(r??1e4)&&le(e)}function ue(e,t,n){if(e instanceof ce){e.addAndTouch(t,n??e.maxEntries);return}e.delete(t),e.add(t),e.size>(n??1e4)&&le(e)}const de=new WeakMap,fe=new WeakMap;function pe(e,t){fe.set(e,t)}function me(e){return e&&fe.get(e)}function he(e){return(t,n)=>{let r=[e.parent,t.parent].filter(Boolean).join(` $$ `)||t.parent;return n({...t,prefix:`${e.prefix}${t.prefix}`,selector:`${t.selector}${e.suffix}${e.combinator}`,pseudo:`${e.pseudoElement}${t.pseudo}`,parent:r,parentOrder:r===t.parent?t.parentOrder:void 0})}}function ge(e,t){return de.set(e,t),e}function _e(e){return de.has(e)}function ve(e,t){let n=de.get(e),r=de.get(t);if(!n||!r)return;let i=`${r.pseudoElement}${n.pseudoElement}`,a=S(i);if(a>1&&!T(i))throw Error(`[Teacss] a token may use at most one pseudo-element, found ${a}`);let o={prefix:`${n.prefix}${r.prefix}`,suffix:`${n.suffix}${r.suffix}`,combinator:`${n.combinator}${r.combinator}`,pseudoElement:i,parent:[n.parent,r.parent].filter(Boolean).join(` $$ `)||void 0};return ge({handle:he(o)},o)}function V(e,t){let n=e.length;n in e?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[n]=t}function ye(e,t,n=!1,r=t+1){let i=e[t];if(i!==`[`&&i!==`(`)return;let a=i===`[`?`]`:`)`,o=!1,s;for(let i=t+1;i<e.length;i++){let t=e[i];if(t===`
|
|
2
|
-
`||t===`\r`||t===`\u2028`||t===`\u2029`)return;if(o){t===`*`&&e[i+1]===`/`&&(o=!1,i++);continue}if(s){t===`\\`?i++:t===s&&(s=void 0);continue}if(i>=r&&/\s/.test(t))return;if(t===`\\`)i++;else if(t===`/`&&e[i+1]===`*`)o=!0,i++;else if(t===`"`||t===`'`||n&&t==="`")s=t;else if(t===`[`||t===`(`)a+=t===`[`?`]`:`)`;else if(t===a.at(-1)&&(a=a.slice(0,-1),!a))return i+1}}function
|
|
3
|
-
`||t===`\r`||t===`\u2028`||t===`\u2029`)return!1;if(t===`\\`)r++;else if(t===`[`)i=!0;else if(t===`]`&&i)i=!1;else if(t===`/`&&!i){for(r++;/[a-z]/i.test(e[r]??``);)r++;for(;/\s/.test(e[r]??``);)r++;return r===n}}return!1}function
|
|
4
|
-
`||n&&e[r]===`$`&&e[r+1]===`{`)return r+2;if(e[r]===`u`&&e[r+1]===`{`){let t=r+2;for(;/[0-9a-f]/i.test(e[t]??``);)t++;if(t>r+2&&e[t]===`}`)return t+1}return r+1}function
|
|
5
|
-
`||r===`\r`||r===`\u2028`||r===`\u2029`)&&(n.lineComment=!1),t+1):n.blockComment?r===`*`&&e[t+1]===`/`?(n.blockComment=!1,t+2):t+1:n.quote?r===`\\`?
|
|
6
|
-
`||c===`\r`||t&&c==="`")&&(n=s)}return n}function ut(e){for(let t of e)if((t.codePointAt(0)??0)>127)return!0;return!1}function dt(e,t,n=!1,r=0){let i=e.slice(r,t),a=lt(i,n),o=i.slice(a+1).trim();if(o.length===0)return!1;let s=o.split(/\s*(?:,|>|\+|~)\s*|\s+/).filter(Boolean),c=o.split(`,`).map(e=>e.trim());return/^@(?:-[a-z]+-)?[a-z][-\w]*\b/i.test(o)||/^%[-_a-z][-\w]*$/i.test(o)||/(?:^|[\s>+~,])(?:&|[-_a-z][-\w]*|\*)?(?:[.#](?=\S)|\[[^\]]*\])/i.test(o)||/(?:^|[\s>+~,])(?:\*|[-\w]+)\|(?:\*|[-\w]+)(?=$|[\s.#:[>+~,])/i.test(o)||/^(?:(?:[a-z][-\w]*)?|&):{1,2}[-\w(]/i.test(o)||/(?:^|[\s>+~,])\\[0-9a-f]{1,6}\s?/i.test(o)||ut(o)||n&&o.includes("${")||o.includes(`#{`)||o.includes(`@{`)||c.every(rt)||s.length>0&&s.every(e=>e===`*`||et.test(e))}function ft(e,t){let n=t+1;for(;/\s/.test(e[n]??``);)n++;let r=e[n];if(r!==`'`&&r!==`"`)return!1;for(n++;n<e.length;n++){let t=e[n];if(t===`\\`)n++;else if(t===r){for(n++;/\s/.test(e[n]??``);)n++;return e[n]===`:`}}return!1}function pt(e,t){let n=t+1;for(;/\s/.test(e[n]??``);)n++;return e.startsWith(`...`,n)}function mt(e,t){let n=0;for(t--;t>=0&&e[t]===`\\`;t--)n++;return n%2==1}function ht(e,t,n=0){let r=t-1;for(;r>=0&&/\s/.test(e[r]);)r--;if(r<0)return!1;if(Xe.includes(e[r]))return!0;let i=r+1;for(;r>=0&&/[\w$]/.test(e[r]);)r--;let a=e.slice(r+1,i);return Ze.has(a)||ct(e,t,n)}const gt=new Set([`catch`,`class`,`do`,`else`,`finally`,`switch`,`try`]),_t=/^(?:(?:await\s+)?using|break|class|const|continue|debugger|declare|do|enum|export|for|function|if|import|interface|let|namespace|return|switch|throw|try|type|var|while|with)(?=$|[\s;(){}])/,vt=/^(?:await\s+)?[$_\p{ID_Start}][$\p{ID_Continue}]*(?:\s*(?:(?:\.|\?\.)\s*#?[$_\p{ID_Start}][$\p{ID_Continue}]*|(?:\?\.)?\[[^\]]+\]))*\s*(?:(?:\?\.)?\(|\+\+|--|[-+*/%&|^]?=(?!=|>))/u,yt=/^(?:await\s+)?[$_\p{ID_Start}][$\p{ID_Continue}]*\s*(?:(?:\.|\?\.)\s*#?[$_\p{ID_Start}][$\p{ID_Continue}]*)+\s*$/u,bt=/^(?:await\s+)?[$_\p{ID_Start}][$\p{ID_Continue}]*(?:\s*(?:\.|\?\.)\s*#?[$_\p{ID_Start}][$\p{ID_Continue}]*)*\s*(?:\?\.)?\[[^\]]+\]\s*$/u,xt=/^new\s+(?:class\b|function\b|[$_\p{ID_Start}])/u,St=/^\([\s\S]*\)$/,Ct=/^\([\s\S]*\)\s*(?:\(|\?\.|\.)/,wt=/^(?:(?:await|delete|typeof|void)\s+\S|yield(?:\s+\S|\s*\*\s*\S))/u,Tt=/^(?:\+\+|--|!|~)\s*\S/u,Et=/^\[[\s\S]*\]\s*=(?!=|>)/,Dt=new Set([`as`,`in`,`instanceof`,`satisfies`]),Ot=/^(?:=(?!=|>)|\+=|-=|\*\*=|\*=|\/=|%=|&&=|&=|\|\|=|\|=|\^=|\?\?=|<<=|>>>=|>>=)/,kt=/^(?:(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[bB][01](?:_?[01])*|0[oO][0-7](?:_?[0-7])*)n?|(?:\d(?:_?\d)*)n|(?:\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|\d(?:_?\d)*(?:[eE][+-]?\d(?:_?\d)*)?)/;function At(e){let t={closers:[]},n=!1,r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=t.closers.length===0,s=H(e,i,t);if(s!==void 0){o&&(a===`(`||a===`[`)&&(n=!0),i=s;continue}if(!(t.closers.length>0)){if(a===`:`||a===`@`)return!n||r?void 0:a===`:`?`declaration`:`condition`;if(a===`!`&&i===e.length-1)return!n||r?void 0:`important`;/\s/u.test(a)?r=!0:n=!0}}}function jt(e,t){if(wt.test(e))return!0;if(!Tt.test(e))return!1;let n=At(e);return n===void 0||t&&n===`important`}function Mt(e,t){if(!Et.test(e))return!1;let n=At(e);return n===void 0||t&&n===`important`}function Nt(e,t){let n={closers:[]};for(let r=t;r<e.length;r++){let t=H(e,r,n);if(t!==void 0&&(r=t,n.closers.length===0))return r+1}}function Pt(e){let t={closers:[]},n=-1;for(let r=0;r<e.length;r++){let i=H(e,r,t);if(i!==void 0){r=i;continue}if(!(t.closers.length>0)){if(/\s/u.test(e[r]))return-1;n===-1&&(e[r]===`:`||e[r]===`@`)&&r>0&&(n=r)}}return n}function Ft(e,t){let n=t=>{for(;t<e.length&&/\s/u.test(e[t]);)t++;return t},r=0;for(;e[r]===`+`||e[r]===`-`;)r=n(r+1);let i=sn(e,r);i?.value===`await`&&/\s/u.test(e[i.end]??``)&&(r=n(i.end),i=sn(e,r));let a;if(i!==void 0)a=`identifier`,r=i.end;else if(e[r]===`[`||e[r]===`(`){let t=Nt(e,r);if(t===void 0)return!1;a=e[r]===`[`?`array`:`parenthesized`,r=t}else{let t=kt.exec(e.slice(r));if(t===null)return!1;a=`number`,r+=t[0].length}let o=!1,s=!1;for(;r<e.length;){let t=r;if(r=n(r),e[r]===`!`&&e[r+1]!==`=`){s=!0,r++;continue}if(e[r]===`(`||e.startsWith(`?.(`,r))return!0;if(e.startsWith(`?.`,r))r=n(r+2);else if(e[r]===`.`)r=n(r+1);else if(e[r]!==`[`){r=t;break}if(e[r]===`[`){let t=Nt(e,r);if(t===void 0)return!1;o=!0,s=!1,r=t;continue}if(e[r]===`#`&&r++,i=sn(e,r),i===void 0)return!1;o=!0,s=!1,r=i.end}if(r=n(r),e[r]===`(`||e.startsWith(`?.(`,r))return!0;if(o&&e.slice(r).trim().length===0)return!s||At(e)!==`important`||t;if(a===`array`&&!o)return!1;if(e.startsWith(`++`,r)||e.startsWith(`--`,r))return e.slice(r+2).trim().length===0;let c=Ot.exec(e.slice(r));return c!==null&&e.slice(r+c[0].length).trim().length>0}function It(e){let t=Pt(e),n=(t,n)=>{let r=t-1;for(;r>=0&&/\s/.test(e[r]);)r--;let i=t+n;for(;i<e.length&&/\s/.test(e[i]);)i++;return r>=0&&e[r]!==`:`&&i<e.length},r=(t,r,i)=>{let a=e[r-1]??``,o=e[i]??``;return!/\s/u.test(a)&&!`)!]`.includes(a)||!/\s/u.test(o)&&!`([`.includes(o)&&(t!==`in`&&t!==`instanceof`||!`!~+-`.includes(o))&&(t!==`as`&&t!==`satisfies`||o!==`-`)?!1:n(r,i-r)},i={closers:[]};for(let a=0;a<e.length;a++){let o=e[a],s=H(e,a,i);if(s!==void 0){a=s;continue}if(i.closers.length>0||t>=0&&a>t)continue;let c=e[a+1],l=sn(e,a);if(l!==void 0){if(Dt.has(l.value)&&r(l.value,a,l.end))return!0;a=l.end-1;continue}if((o===`?`||o===`<`||o===`>`)&&n(a,c===o||c===`=`||o===`?`&&c===`.`?2:1)||(o===`=`&&c===`=`||o===`!`&&c===`=`||o===`&`&&c===`&`||o===`|`&&c===`|`||o===`*`&&c===`*`)&&n(a,2)||`+-*/%&|^`.includes(o)&&(/\s/.test(e[a-1]??``)||/\s/.test(c??``))&&n(a,1)||o===`,`&&(/\s/.test(e[a-1]??``)||/\s/.test(c??``))&&n(a,1))return!0}return!1}function Lt(e,t){let n=He(e,t);if(n.kind===`open`)return!0;if(n.kind!==`close`)return!1;let r=Ge(e.slice(t+1,n.index));if(r.length===0)return!0;let i=r.length===1;return r.some(e=>_t.test(e)||vt.test(e)||yt.test(e)||bt.test(e)||Ft(e,i)||xt.test(e)||St.test(e)||Ct.test(e)||jt(e,i)||Mt(e,i)||It(e))}function Rt(e,t,n=0,r=0,i=``){if(`:|&=,(`.includes(i))return!1;let a=t-1;for(;a>=0&&/\s/.test(e[a]);)a--;let o=e.slice(n,t);if(at(e,t,n))return r>0||`:|&=,(`.includes(e[a]??``)?!1:it(e,t,n);if(/\bclass\b[^;]*$/.test(o))return ot(e,t,n);if(e[a]===`)`||e[a]===`>`)return e.slice(Math.max(n,a-1),a+1)!==`=>`;let s=a+1;for(;a>=0&&/[\w$]/.test(e[a]);)a--;let c=e.slice(a+1,s);return gt.has(c)?!0:ct(e,t,n)}function zt(){return{angleDepth:0,canEnd:!1,classParenRoles:[],forceRegex:!1,labelCandidate:!1,labelColon:-1,lastSignificant:``,lastWord:``,parenKinds:[],pendingFunctions:[],restrictedLineStatement:!1,statementStart:!0,typeDeclaration:!1}}const Bt=new Set([`abstract`,`async`,`declare`,`default`,`export`]),Vt=new Set([`abstract`,`asserts`,`extends`,`in`,`infer`,`is`,`keyof`,`new`,`readonly`,`typeof`,`unique`]);function Ht(e,t){let n=e.pendingFunctions.at(-1);n?.phase===`return-type`&&(n.typeCanEnd=!Vt.has(t))}function W(e,t,n){let r=e.pendingFunctions.at(-1);r?.phase===`return-type`&&(`|&?:=,(`.includes(t)||t===`[`||t===`<`?r.typeCanEnd=!1:(n||t===`]`||t===`>`||t===`)`)&&(r.typeCanEnd=!0))}function Ut(e){let t=e.pendingFunctions.at(-1);if(t)return t.phase===`after-params`?(e.pendingFunctions.pop(),t.kind):t.phase===`return-type`?t.typeCanEnd?(e.pendingFunctions.pop(),t.kind):`T`:`O`}function Wt(e,t){return!e.restrictedLineStatement&&!(e.typeDeclaration&&t===0&&e.canEnd)?!1:(e.canEnd=!1,e.forceRegex=!0,e.labelCandidate=!1,e.labelColon=-1,e.lastSignificant=``,e.lastWord=``,e.restrictedLineStatement=!1,e.statementStart=!0,e.typeDeclaration=!1,!0)}function Gt(e,t=!1){e.labelCandidate=!1,e.labelColon=-1,e.lastSignificant=`;`,e.lastWord=``,t||(e.pendingFunctions.length=0),e.restrictedLineStatement=!1,e.statementStart=!0,e.typeDeclaration=!1}function G(e,t){e.canEnd=!0,e.forceRegex=!1,e.labelCandidate=!1,e.labelColon=-1,e.lastSignificant=t,e.lastWord=``,e.statementStart=!1,W(e,t,!0)}function Kt(e,t,n){if(!n||/\s/.test(e[t-1]??``))return!1;let r=t+1;for(;/\s/.test(e[r]??``);)r++;return/[A-Z_$\p{ID_Start}]/u.test(e[r]??``)}function qt(e,n,r,i){let a=e[n],o=i?.lastWord??``;if(/\s/.test(a??``))return r;if(/[\w$\p{ID_Continue}]/u.test(a??``)){if(/[\w$\p{ID_Continue}]/u.test(e[n+1]??``))return r;let a=n;for(;a>0&&/[\w$\p{ID_Continue}]/u.test(e[a-1]??``);)a--;let o=e.slice(a,n+1),s=a-1;for(;s>=0&&/\s/.test(e[s]??``);)s--;let c=e[s]===`.`||e[s]===`#`;if(i){let e=i.statementStart;i.labelCandidate=e,i.labelColon=-1,i.lastSignificant=`word`,i.lastWord=c?``:o,!c&&o===`function`?t(i.pendingFunctions,{kind:e?`B`:`O`,phase:`before-params`,typeCanEnd:!1}):c||Ht(i,o),!c&&e&&(o===`type`||o===`import`||o===`interface`||o===`declare`||o===`export`)&&(i.typeDeclaration=!0),!c&&e&&(o===`break`||o===`continue`||o===`debugger`)&&(i.restrictedLineStatement=!0),i.statementStart=!c&&e&&Bt.has(o)}return c||!(Ze.has(o)||$e.has(o))}if(i&&(a!==`:`&&(i.labelCandidate=!1),a!==`{`&&(i.labelColon=-1),i.lastWord=``,i.statementStart=!1),/\d/.test(a??``)||a===`.`&&r&&/\d/.test(e[n-1]??``))return i&&(i.lastSignificant=`number`,W(i,a,!0)),!0;if(a===`]`)return i&&(i.lastSignificant=a,W(i,a,!0)),!0;if(a===`[`)return i&&(i.lastSignificant=a,W(i,a,!1)),!1;if(a===`(`){if(i){let e=i.pendingFunctions.at(-1);t(i.classParenRoles,o===`cn`?`C`:r||e?.phase===`before-params`||$e.has(o)?`O`:`T`),e?.phase===`before-params`?(e.phase=`params`,t(i.parenKinds,`F`)):t(i.parenKinds,$e.has(o)?`1`:`0`),i.forceRegex=!1,i.lastSignificant=a,W(i,a,!1)}return!1}if(a===`)`){if(i){i.classParenRoles.pop();let e=i.parenKinds.pop();if(i.forceRegex=e===`1`,e===`F`){let e=i.pendingFunctions.at(-1);e?.phase===`params`&&(e.phase=`after-params`)}i.lastSignificant=a,W(i,a,!0)}return!0}if(a===`<`)return i&&(Kt(e,n,r)&&i.angleDepth++,i.lastSignificant=a,W(i,a,!1)),!1;if(a===`>`)return i?.angleDepth?(i.angleDepth--,i.lastSignificant=a,W(i,a,!0),!0):(i&&(i.lastSignificant=a,W(i,a,!1)),!1);if(a===`+`||a===`-`)return i&&(i.lastSignificant=a),e[n-1]===a||e[n+1]===a?(i&&W(i,a,r),r):(i&&W(i,a,!1),!1);if(a===`:`&&i){let e=i.pendingFunctions.at(-1);return e?.phase===`after-params`&&(e.phase=`return-type`,e.typeCanEnd=!1),i.labelCandidate&&(i.labelColon=n),i.lastSignificant=a,W(i,a,!1),!1}return a===`!`&&e[n+1]!==`=`?(i&&(i.lastSignificant=a,W(i,a,r)),r):a===`}`||a===`'`||a===`"`||a==="`"?(i&&(i.lastSignificant=a,W(i,a,!0)),!0):(i&&(i.lastSignificant=a,W(i,a,!1)),!1)}function Jt(e,t,n=!1,r){if(e[t+1]===`/`||e[t+1]===`*`)return!1;if(n)return!0;if(r!==void 0)return!r;let i=t-1;for(;i>=0&&/\s/.test(e[i]);)i--;if(i<0)return!0;if((e[i]===`+`||e[i]===`-`)&&e[i-1]===e[i]||e[i]===`!`&&i>0&&/[\w$)\]]/.test(e[i-1]??``)||e[i]===`>`&&i>0&&/[\w$)>]/.test(e[i-1]??``))return!1;if(`=([{,:;!?&|+-*%^~<>`.includes(e[i]))return!0;let a=i+1;for(;i>=0&&/[\w$]/.test(e[i]);)i--;return Qe.has(e.slice(i+1,a))}function Yt(e,t){let n=!1;for(let r=t+1;r<e.length;r++){let t=e[r];if(t===`
|
|
7
|
-
`||t===`\r`||t===`\u2028`||t===`\u2029`)return{end:-1,failedUntil:r};if(t===`\\`)r++;else if(t===`[`)n=!0;else if(t===`]`)n=!1;else if(t===`/`&&!n){for(r++;/[a-z]/i.test(e[r]??``);)r++;return{end:r,failedUntil:r}}}return{end:-1,failedUntil:e.length}}function
|
|
8
|
-
`||l===`\r`||l===`\u2028`||l===`\u2029`)&&(o=!1);else if(a)l===`*`&&u===`/`&&(a=!1,i++);else if(c)l===`\\`?i++:l===c&&(c=void 0);else if(l===`/`&&u===`/`)o=!0,i++;else if(l===`/`&&u===`*`)a=!0,i++;else if(l===`'`||l===`"`||l==="`")c=l;else if(l===`<`)t(s,i);else if(l===`>`&&e[i-1]!==`=`){let e=s.pop();if(e!==void 0&&(r.set(e,i),e===n))return i}}for(let e of s)r.set(e,-1);return-1}function
|
|
9
|
-
`||n===`\r`||n===`\u2028`||n===`\u2029`)&&(s=!1);continue}if(a){n===`*`&&r===`/`&&(a=!1,p++);continue}if(f){n===`\\`?p++:n===f&&(f=void 0);continue}if(n===`/`&&r===`/`){s=!0,p++;continue}if(n===`/`&&r===`*`){a=!0,p++;continue}if(n===`'`||n===`"`||n==="`"){if(i.length===0&&u!==`constraint`&&u!=="default")return!1;f=n,d=!0;continue}if(n===`(`||n===`[`||n===`{`||n===`<`){if(i.length===0&&u!==`constraint`&&u!=="default")return!1;t(i,n===`(`?`)`:n===`[`?`]`:n===`{`?`}`:`>`),d=!0;continue}if(n===i.at(-1)){i.pop();continue}if(i.length>0||/\s/.test(n))continue;if(n===`,`)return!(u===`start`||u===`after-const`||(u===`constraint`||u==="default")&&!d);if(n===`=`){if(r===`>`){if(u!==`constraint`&&u!=="default")return!1;d=!0,p++;continue}if(u===`constraint`&&!d||u!==`after-name`&&u!==`constraint`)return!1;o=!0,u=`default`,d=!1;continue}let m=
|
|
10
|
-
`&&e[n]!==`\r`&&e[n]!==`\u2028`&&e[n]!==`\u2029`;)n++;else if(e[n]===`/`&&e[n+1]===`*`){let t=e.indexOf(`*/`,n+2);if(t===-1)return e.length;n=t+2}else break;return n}function
|
|
11
|
-
`||c===`\r`||c===`\u2028`||c===`\u2029`)&&(s.lineComment=!1,
|
|
12
|
-
`||c===`\r`||c===`\u2028`||c===`\u2029`)&&
|
|
13
|
-
`||t===`\r`||t===`\u2028`||t===`\u2029`)return n}return e.length}if(n){for(let r=t;r<e.length;r++){let t=e[r];if(t===`\\`)r=
|
|
14
|
-
`||t===`\r`||t===`\u2028`||t===`\u2029`)return r}return e.length}if(i)for(let n=t;n<e.length;n++){let t=e[n];if(t===`\\`)n=
|
|
15
|
-
`||k===`\r`||k===`\u2028`||k===`\u2029`)){l=void 0,d=-1,f=0,
|
|
16
|
-
`||k===`\r`||k===`\u2028`||k===`\u2029`){c=void 0,u=!1,d=-1,f=0,
|
|
17
|
-
`||k===`\r`||k===`\u2028`||k===`\u2029`)&&
|
|
18
|
-
`?t+2:t+1}function rr(e,t){let n=t;for(;/\s/.test(e[n]??``);)n++;if(e[n]!==`:`)return!1;for(n++;/\s/.test(e[n]??``);)n++;return e[n]===`[`&&ke(e,n)}const ir=new Set([`await`,`break`,`case`,`continue`,`debugger`,`delete`,`do`,`else`,`in`,`instanceof`,`new`,`of`,`return`,`throw`,`typeof`,`void`,`yield`]),ar=new Set([`for`,`if`,`while`,`with`]);function or(e,t){let n=0;for(;t>0&&e[--t]===`\\`;)n++;return n%2==1}function sr(e,t){let n=0;for(let r=t;r>=0;r--){let t=e[r];if(t===`"`||t===`'`||t==="`"){let n=r-1;for(;n>=0&&(e[n]!==t||or(e,n));)n--;if(n<0)return!1;r=n}else if(t===`/`&&e[r-1]===`*`){let t=e.lastIndexOf(`/*`,r-2);if(t<0)return!1;r=t}else if(t===`)`)n++;else if(t===`(`){if(n--,n!==0)continue;let t=r;for(;t>0&&/\s/.test(e[t-1]);)t--;let i=t;for(;i>0&&/[\w$]/.test(e[i-1]);)i--;return i>0&&/[\w$.]/.test(e[i-1])?!1:ar.has(e.slice(i,t))}}return!1}function cr(e,t){let n=0;for(let r=t;r>=0;r--){let t=e[r];if(t===`"`||t===`'`||t==="`"){let n=r-1;for(;n>=0&&(e[n]!==t||or(e,n));)n--;if(n<0)return-1;r=n}else if(t===`/`&&e[r-1]===`*`){let t=e.lastIndexOf(`/*`,r-2);if(t<0)return-1;r=t}else if(t===`}`)n++;else if(t===`{`&&(n--,n===0))return r}return-1}function lr(e,t){for(;t>0&&/\s/.test(e[t-1]);)t--;let n=t;for(;n>0&&/[\w$]/.test(e[n-1]);)n--;return{start:n,value:e.slice(n,t)}}function ur(e,t){let n=cr(e,t);if(n<0)return!1;let r=n;for(;r>0&&/\s/.test(e[r-1]);)r--;if(r===0)return!0;let i=e[r-1];if(i===`)`||i===`>`&&e[r-2]===`=`||`;{}:`.includes(i))return!0;let a=lr(e,r);return[`catch`,`class`,`do`,`else`,`finally`,`static`,`try`].includes(a.value)?!0:a.value?lr(e,a.start).value===`class`:!1}function dr(e,t){if(e[t+1]===`/`||e[t+1]===`*`||e[t-1]===`<`&&(e[t+1]===`>`||/[A-Z_$]/i.test(e[t+1]??``)))return!1;let n=t-1;for(;n>=0&&/\s/.test(e[n]);)n--;if(n<0)return!0;if((e[n]===`+`||e[n]===`-`)&&e[n-1]===e[n]||e[n]===`!`&&n>0&&/[\w$)\]]/.test(e[n-1]??``)||e[n]===`>`&&n>0&&/[\w$)>]/.test(e[n-1]??``))return!1;if(`=([{,:;!?&|+-*%^~<>`.includes(e[n])||e[n]===`)`&&sr(e,n)||e[n]===`}`&&ur(e,n))return!0;let r=n+1;for(;n>=0&&/[\w$]/.test(e[n]);)n--;let i=e.slice(n+1,r);return ir.has(i)?!0:i==="default"&&lr(e,n+1).value===`export`}function fr(e,t){let n=!1;for(let r=t+1;r<e.length;r++){let t=e[r];if(tr(t))return-1;if(t===`\\`)r++;else if(t===`[`)n=!0;else if(t===`]`)n=!1;else if(t===`/`&&!n){for(r++;/[a-z]/i.test(e[r]??``);)r++;return r}}return-1}function pr(e,t=!1){let n=[],r=[],i=[],a=!1,o=!1,s,c=-1,l,u=-1,d=!1,f=!1;function p(){f=!1,n.length=0,i=[],a=!1,o=!1,s=void 0,l=void 0}for(let m=0;m<e.length;m++){let h=e[m];if(!a&&!s&&h===`/`&&dr(e,m)){let t=fr(e,m);if(t!==-1){m=t-1,d=!1,f=!1;continue}}if(n.length===0){if(er(h)?f=d=!1:h===`/`&&(d=!0),h===`@`&&!e.startsWith(Un,m)&&!or(e,m)&&(f=m>0&&(!er(e[m-1])||e[m-1]===`}`)&&Kn.test(e.slice(m+1))),f&&h===`\\`){/\s/.test(e[m+1])&&(f=!1),m++;continue}h===`[`&&(V(n,m),o=d&&e[m-1]!==`:`&&e[m-1]!==`@`);continue}if(er(h)&&(u=m),tr(h)){p();continue}if((a||s)&&/\s/.test(h)&&(l??=ye(e,n.at(-1),!1,f?e.length:m),l===void 0)){p();continue}if(!a&&!s&&h===`/`&&o){p();continue}if(a){h===`*`&&e[m+1]===`/`&&(a=!1,m++);continue}if(s){h===`\\`?(tr(e[m+1])?p():er(e[m+1])&&(u=m+1),m++):h===s&&(V(i,[c+1,m]),s=void 0);continue}if(h===`/`&&e[m+1]===`*`)a=!0,m++;else if(h===`"`||h===`'`)s=h,c=m;else if(h===`\\`)tr(e[m+1])&&p(),er(e[m+1])&&(u=m+1),m++;else if(h===`[`)V(n,m);else if(h===`]`){let a=n.pop(),s=m+1,c=!1;if(u>a){let n=f||e[a-1]===`:`||e[a-1]===`@`,i=e[s]===`:`&&!!e[s+1]&&!Gn.test(e[s+1]);c=n&&!Oe(e,a)||i&&!(t&&rr(e,s)),c&&V(r,[a,s])}if(n.length===0){if(o=!1,l=void 0,!c)for(let[t,n]of i)for(let[i,a]of pr(e.slice(t,n)))V(r,[t+i,t+a]);i=[]}}}let m=[];for(let e of r.sort(([e,t],[n,r])=>e-n||r-t))(m.length===0||e[0]>=m.at(-1)[1])&&V(m,e);return m}const mr=/^(?:--?[\w-]+|[A-Z_$][\w$-]*|@teacss-skip-bracket-[\da-z]{6})$/i;function hr(e,t){let n=t;for(;n>0&&/[\w-]/.test(e[n-1]);)n--;if(n===t||e[n-1]!==`:`)return!1;let r=n-1,i=r;for(;i>0&&/[\w$@-]/.test(e[i-1]);)i--;if(!mr.test(e.slice(i,r)))return!1;let a=i-1;for(;a>=0&&/\s/.test(e[a]);)a--;return a<0||!`{,?`.includes(e[a])}function gr(e){let t=[],n=[],r=[],i=!1,a,o,s=-1,c,l=()=>{if(s<0||n.length===0)return;let e=n.at(-1);e.attached&&e.containsGroupBrace&&V(t,[e.start,s+1]),s=-1};for(let u=0;u<e.length;u++){let d=e[u];if(n.length===0){a?a!=="`"&&tr(d)?a=void 0:d===`\\`?u=nr(e,u):d===a?a=void 0:d===`(`&&hr(e,u)&&(V(n,{attached:!0,containsGroupBrace:!1,outerQuote:a,start:u}),c=void 0):d===`"`||d===`'`||d==="`"?a=d:d===`(`&&hr(e,u)&&(V(n,{attached:!0,containsGroupBrace:!1,outerQuote:void 0,start:u}),c=void 0);continue}if(tr(d)){l(),n.length=0,r.length=0,i=!1,o=void 0,a!=="`"&&(a=void 0),c=void 0;continue}if((o||i)&&/\s/.test(d)&&(c??=ye(e,n.at(-1).start,!0,u),c===void 0)){n.length=0,r.length=0,i=!1,o=void 0,s=-1;continue}if(o){d===`\\`?u=nr(e,u):d===o?o=void 0:d===`{`&&(n.at(-1).containsGroupBrace=!0);continue}if(i){d===`*`&&e[u+1]===`/`&&(i=!1,u++);continue}let f=n[0].outerQuote;if(d===`/`&&e[u+1]===`*`)i=!0,u++;else if(f&&d===f)l(),n.length=0,r.length=0,i=!1,a=void 0;else if(d===`"`||d===`'`||d==="`")o=d;else if(d===`\\`)u=nr(e,u);else if(r.length>0)d===`[`?V(r,`]`):d===`(`?V(r,`)`):d===r.at(-1)?(r.pop(),r.length===0?s=-1:d===`)`&&(s=u)):d===`{`&&(n.at(-1).containsGroupBrace=!0);else if(d===`[`)V(r,`]`);else if(d===`{`)n.at(-1).containsGroupBrace=!0;else if(d===`(`)V(n,{attached:hr(e,u),containsGroupBrace:!1,outerQuote:f,start:u});else if(d===`)`){let e=n.pop();e.attached&&e.containsGroupBrace&&V(t,[e.start,u+1]),e.containsGroupBrace&&n.length>0&&(n.at(-1).containsGroupBrace=!0),n.length===0&&(c=void 0)}}l();let u=[];for(let e of t.sort(([e,t],[n,r])=>e-n||r-t))(u.length===0||e[0]>=u.at(-1)[1])&&V(u,e);return u}function _r(e,t,n){if(!t.length)return e;let r=new Set(e.match(Wn)),i=[],a=0;for(let[o,s]of t){let t=e.slice(o,s),c=0,l;for(;l=`${Un}${Pn(c?`${t}:${c}`:t)}`,c++,r.has(l)||n.has(l)&&n.get(l)!==t;);n.set(l,t),V(i,e.slice(a,o)),V(i,l),a=s}return V(i,e.slice(a)),i.join(``)}function vr(e,t,n=!1){return _r(e,pr(e,n),t)}function yr(e,t){return _r(e,gr(e),t)}function br(e,t){let n=[],r=0;for(let t=0;t<e.length;t++){let i=e[t];if(i===`\\`){let i=e[t+1];r&&i&&(/['"`;{}]/.test(i)||r===2&&qn.test(i))?V(n,[t,t+2]):er(i)&&(r=0),t++}else er(i)?r===2&&qn.test(i)?V(n,[t,t+1]):r=0:i===`@`&&(r=Kn.test(e.slice(t+1))?2:1)}return _r(e,n,t)}function xr(e,t){let n=e;for(let e=0;e<t.size&&n.includes(Un);e++){let e=n.replace(Wn,e=>t.get(e)??e);if(e===n)break;n=e}return n}function Sr(e,t){let n=new Map;qn.test(e)&&(e=br(e,n)),e.includes(`[`)&&(e=vr(e,n,!0)),e.includes(`(`)&&(e=yr(e,n));let r=xn(e,t);e=r.code;for(let i=1;i<5&&r.nestedOpening;i++){let i=e;if(i.includes(`[`)&&(i=vr(i,n)),i.includes(`(`)&&(i=yr(i,n)),r=xn(i,t),r.code===i)break;e=r.code}e.includes(`[`)&&(e=vr(e,n)),e.includes(`(`)&&(e=yr(e,n)),e.includes(`\\`)&&(e=br(e,n));let i=e.split(Bn);return n.size?i.map(e=>e.includes(Un)?xr(e,n):e):i}const Cr={name:`@teacss/core/extractor-split`,order:0,extract({code:e,id:t}){return Sr(Zn(t)?e:$n(e,Xn(t)),Qn(t))}};var wr=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 K(e){return e instanceof wr}function Tr(e,t,n){if(Object.hasOwn(e,t)){if(!Reflect.set(e,t,n))throw TypeError(`Cannot assign event "${String(t)}"`)}else Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}function Er(){return{events:Object.create(null),emit(e,...t){let r=this.events,i=Array.from(n(Object.hasOwn(r,e)?r[e]:void 0));for(let e of i)e(...t)},on(e,r){let i=this.events,a=Object.hasOwn(i,e)?i[e]:void 0,o=Array.isArray(a)?a:[];o!==a&&Tr(i,e,o),t(o,r);let s=!0;return()=>{s&&=(Tr(i,e,Array.from(n(Object.hasOwn(i,e)?i[e]:void 0)).filter(e=>e!==r)),!1)}}}}const Dr=/^\[(.+?)~?="(.*)"\]$/,Or=/[\w\u00A0-\uFFFF%-?]/,kr=new RegExp(Dr.source,Dr.flags),Ar=/\.(css|postcss|sass|scss|less|stylus|styl)($|\?)/,jr=new RegExp(Or.source,Or.flags);function Mr(e){return e.match(Dr)}function Nr(e=``){return Or.test(e)}function Pr(e){return typeof e==`function`?{match:e}:e}function Fr(e){return e.length===3&&Object.hasOwn(e,0)&&Object.hasOwn(e,1)&&Object.hasOwn(e,2)}function Ir(e){return e!=null}function Lr(e){return e!=null&&(typeof e==`object`||typeof e==`function`)&&typeof e.then==`function`}function Rr(){}function zr(e,t){for(let n=0;n<t.length;n++){if(!Object.hasOwn(t,n))continue;let r=t[n],i=Object.hasOwn(r,2)?r[2]:void 0;if(i){let t=i;for(;t!==null&&t!==Object.prototype&&!Object.hasOwn(t,`layer`);)t=Object.getPrototypeOf(t);if(t!==null&&t!==Object.prototype){if(!Reflect.set(i,`layer`,e))throw TypeError(`Cannot assign rule layer`)}else D(i,`layer`,e)}else if(Object.hasOwn(r,2)){if(!Reflect.set(r,2,{layer:e}))throw TypeError(`Cannot assign rule metadata`)}else D(r,2,{layer:e})}return t}var Br=class{_map=new Map;get(e,t){let n=this._map.get(e);if(n)return n.get(t)}getFallback(e,t,n){let r=this._map.get(e);return r||(r=new Map,this._map.set(e,r)),r.has(t)||r.set(t,n),r.get(t)}set(e,t,n){let r=this._map.get(e);return r||(r=new Map,this._map.set(e,r)),r.set(t,n),this}has(e,t){return this._map.get(e)?.has(t)??!1}delete(e,t){let n=this._map.get(e);if(!n)return!1;let r=n.delete(t);return r&&n.size===0&&this._map.delete(e),r}deleteTop(e){return this._map.delete(e)}map(e){return Array.from(this._map.entries()).flatMap(([t,n])=>Array.from(n.entries()).map(([n,r])=>e(r,t,n)))}},Vr=class extends Map{getFallback(e,t){let n=this.get(e);return n===void 0&&!this.has(e)?(this.set(e,t),t):n}map(e){let t=[];return this.forEach((n,r)=>{D(t,t.length,e(n,r))}),t}flatMap(e){let r=[];return this.forEach((i,a)=>{for(let o of n(e(i,a)))t(r,o)}),r}};function Hr(e){if(!Object.hasOwn(e,0))return;let t=e[0];if(typeof t==`string`||typeof t==`symbol`)return[t,Object.hasOwn(e,1)?e[1]:void 0]}function Ur(e){return Reflect.ownKeys(e).filter(t=>Object.getOwnPropertyDescriptor(e,t)?.enumerable)}function Wr(e,t){if(Object.getOwnPropertyDescriptor(e,t)?.enumerable)return{value:Reflect.get(e,t)}}function Gr(e){let n=[];for(let r of Ur(e)){let i=Wr(e,r);i&&t(n,[r,i.value])}return n}function Kr(e){if(j(e))return e;let r=[];for(let i of Array.isArray(e)?n(e):Gr(e)){let e=Hr(i);e!==void 0&&e[1]!=null&&t(r,i)}return r}function qr(e){if(Array.isArray(e)){let t=Array.from(n(e));return t.every(e=>Array.isArray(e)&&e.length>0&&!Array.isArray(Object.hasOwn(e,0)?e[0]:void 0))||t.length===0?[t]:t.map(e=>Kr(e))}return[Kr(e)]}function Jr(e){let r=[],i,a;for(let o of n(e)){let e=Hr(o);if(!e)continue;let[n,s]=e;typeof n==`string`&&(n.startsWith(`$$`)||(n===`__virtual_key__`||i!==n||a!==s)&&(t(r,o),i=n,a=s))}return r}const Yr=`__virtual_key__`;function Xr(e,t){return t==null||typeof t==`function`||typeof e!=`string`?``:e===`__virtual_key__`?t?String(t):``:`${e}:${t};`}function Zr(e){if(e==null||e.length===0)return``;let t=``,r,i;for(let a of n(e)){let e=Hr(a);if(!e)continue;let[n,o]=e;typeof n==`string`&&(n.startsWith(`$$`)||(n===`__virtual_key__`||r!==n||i!==o)&&(t+=Xr(n,o),r=n,i=o))}return t}function q(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}const Qr=`$reset`;function $r(e,t,r=!1){let i=e,a=t;if(Array.isArray(a))return[...r&&Array.isArray(i)?n(i):[],...n(a)];if(q(a)&&Object.hasOwn(a,`$reset`)&&a.$reset)return ei(a);if(!q(a))return a;if(!q(i))return ei(a);let o={...i};return Ur(a).forEach(e=>{if(e===`$reset`)return;let t=Wr(a,e);if(!t)return;let n=t.value,i=Object.hasOwn(o,e)?Reflect.get(o,e):void 0;q(n)||Array.isArray(n)?D(o,e,$r(i,n,r)):D(o,e,n)}),o}function ei(e){if(Array.isArray(e))return Array.from(n(e),ei);if(q(e)){let t={};for(let n of Ur(e)){if(n===`$reset`)continue;let r=Wr(e,n);r&&D(t,n,ei(r.value))}return t}return e}function ti(e){return typeof e!=`object`||!e?e:ni(e)}function ni(e){if(Array.isArray(e)){let t=Array.from({length:e.length});for(let n=t.length-1;n>=0;n--)t[n]=Object.hasOwn(e,n)?ti(e[n]):void 0;return t}if(q(e)){let t=e,n={};for(let e of Ur(t)){let r=Wr(t,e);r&&D(n,e,ti(r.value))}return n}return e}function ri(e){return Object.hasOwn(e,0)&&j(e[0])}function ii(e){return Object.hasOwn(e,0)&&j(e[0])}const ai=Object.getOwnPropertyDescriptor(RegExp.prototype,`source`).get,oi=[[`d`,Object.getOwnPropertyDescriptor(RegExp.prototype,`hasIndices`)?.get],[`g`,Object.getOwnPropertyDescriptor(RegExp.prototype,`global`)?.get],[`i`,Object.getOwnPropertyDescriptor(RegExp.prototype,`ignoreCase`)?.get],[`m`,Object.getOwnPropertyDescriptor(RegExp.prototype,`multiline`)?.get],[`s`,Object.getOwnPropertyDescriptor(RegExp.prototype,`dotAll`)?.get],[`u`,Object.getOwnPropertyDescriptor(RegExp.prototype,`unicode`)?.get],[`v`,Object.getOwnPropertyDescriptor(RegExp.prototype,`unicodeSets`)?.get],[`y`,Object.getOwnPropertyDescriptor(RegExp.prototype,`sticky`)?.get]],si=Object.getOwnPropertyDescriptor(RegExp.prototype,`global`)?.get,ci=Object.getOwnPropertyDescriptor(RegExp.prototype,`sticky`)?.get,li=RegExp.prototype.exec;function J(e){return Reflect.apply(ai,e,[])}function ui(e){return!!(si&&Reflect.apply(si,e,[])||ci&&Reflect.apply(ci,e,[]))}function Y(e){let t=``;for(let[n,r]of oi)r&&Reflect.apply(r,e,[])&&(t+=n);return t}function di(e,t){let n=t.exec;if(!ui(t))return Reflect.apply(n,t,[e]);if(Object.getOwnPropertyDescriptor(t,`lastIndex`)?.writable===!1){if(n!==li)return Reflect.apply(n,t,[e]);let r=new RegExp(J(t),Y(t));return Reflect.apply(li,r,[e])}t.lastIndex=0;try{return Reflect.apply(n,t,[e])}finally{Object.getOwnPropertyDescriptor(t,`lastIndex`)?.writable!==!1&&(t.lastIndex=0)}}const fi=/^[a-z][a-z0-9-]*$/,pi={minAffix:4,maxDistance:1,minDistanceLength:6,segmentAffix:!0},mi={minAffix:3,maxDistance:1,minDistanceLength:0,segmentAffix:!1},hi={minAffix:3,maxDistance:2,minDistanceLength:0,segmentAffix:!1},gi=new Set([`about`,`blob`,`bun`,`chrome`,`data`,`deno`,`file`,`ftp`,`http`,`https`,`jsr`,`mailto`,`node`,`npm`,`tel`,`urn`,`vscode`,`virtual`,`ws`,`wss`]);function _i(e){let{body:t,important:n}=Me(e);return n?`${t}!`:t}function vi(e){let t=_i(e);if(!t||t.startsWith(`$`)||t.startsWith(`[`))return!1;let n=t.indexOf(`:`);if(n<=0||n===t.length-1)return!1;let r=t.slice(0,n);return!fi.test(r)||t.startsWith(`//`,n+1)?!1:!gi.has(r)}function yi(e){if(Y(e))return;let t=J(e);if(!t.startsWith(`^`))return;let n=1;for(;n<t.length&&/[A-Za-z0-9_-]/.test(t[n]);)n++;return t[n]===`:`&&n>1?t.slice(1,n):void 0}function bi(e,t){let n=Object.hasOwn(e,2)?e[2]:void 0,r=n;for(;r!=null&&r!==Object.prototype&&r!==Array.prototype&&r!==Function.prototype;){if(Object.hasOwn(r,t))return Reflect.get(n,t);r=Object.getPrototypeOf(r)}}function xi(e){return n(O(bi(e,`prefix`)||``))}function Si(e,t){for(let r of n(t))for(let t of xi(r))if(e.startsWith(t)&&di(e.slice(t.length),r[0]))return!0;return!1}const Ci=new WeakMap;function wi(e){let t=e.rulesStaticMap,r=Ci.get(t);if(r)return r;let i=new Map,a=new Set,o=new Set;for(let e of Object.keys(t)){let n=e.indexOf(`:`);if(n<=0)continue;let r=e.slice(0,n),a=Object.hasOwn(t,e)&&t[e];if(!a)continue;if(bi(a,`internal`)){o.add(r);continue}let s=i.get(r);s||(s=new Set,i.set(r,s)),s.add(e.slice(n+1))}for(let t of n(e.rulesDynamic)){let e=yi(t[0]);if(e!=null)for(let n of xi(t)){let r=(n+e).split(`:`,1)[0];bi(t,`internal`)?o.add(r):i.has(r)||a.add(r)}}let s={prefixValues:i,dynamicPrefixes:a,internalPrefixes:o};return Ci.set(t,s),s}function Ti(e,t,n){if(e===t)return 0;if(Math.abs(e.length-t.length)>n)return 1/0;let r=Array.from({length:t.length+1},(e,t)=>t),i=[...r];for(let a=1;a<=e.length;a++){i[0]=a;let o=a;for(let n=1;n<=t.length;n++){let s=e[a-1]===t[n-1]?0:1;i[n]=Math.min(r[n]+1,i[n-1]+1,r[n-1]+s),i[n]<o&&(o=i[n])}if(o>n)return 1/0;[r,i]=[i,r]}return r[t.length]<=n?r[t.length]:1/0}function Ei(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;return r}function Di(e,t){return(t.startsWith(e)?t[e.length]===`-`:t.endsWith(e)&&t[t.length-e.length-1]===`-`)&&(e.includes(`-`)||e.length>=6)}function Oi(e,t,n){if(e.length>=n.minDistanceLength){let r=Ti(e,t,n.maxDistance);if(r!==1/0)return r}let r=e.length<=t.length?e:t,i=e.length<=t.length?t:e;if(r.length>=n.minAffix&&(n.segmentAffix?Di(r,i):i.startsWith(r)||i.endsWith(r)||i.includes(r)))return 3+(i.length-r.length)/100;if(!n.segmentAffix&&Ei(e,t)>=n.minAffix)return 5+Math.abs(e.length-t.length)/100}function ki(e,t,n={}){let{body:r,important:i}=Me(e),a=r.indexOf(`:`);if(a<=0)return;let o=r.slice(0,a),s=r.slice(a+1),{prefixValues:c,dynamicPrefixes:l,internalPrefixes:u}=wi(t),d=[];if(c.has(o)||l.has(o)||u.has(o)||Si(r,t.rulesDynamic))for(let e of c.get(o)??[]){if(e===s)continue;let t=Oi(s,e,hi);t!==void 0&&V(d,{suggestion:`${o}:${e}`,score:t})}else{if(!n.confirmedIntent&&o.length<3)return;let e=new Set([...c.keys(),...l]);for(let t of e){let e=Oi(o,t,n.confirmedIntent?mi:pi);if(e===void 0)continue;let r=c.get(t)?.has(s)||l.has(t);V(d,{suggestion:`${t}:${s}`,score:r?e:e+10})}if(d.length===0)return}d.sort((e,t)=>e.score-t.score||(e.suggestion<t.suggestion?-1:1));let f=new Set,p=[];for(let{suggestion:e}of d)if(!(f.has(e)||e===r)&&(f.add(e),V(p,i?`${e}!`:e),p.length===3))break;return p}function Ai(e){let t=e.split(/\s+/);return t[0]===``&&t.shift(),t.at(-1)===``&&t.pop(),t}function ji(e){if(!e.includes(`[`))return Ai(e);let t=je(e);if(t.length===0)return Ai(e);let n=[],r=0,i=-1;for(let a=0;a<e.length;a++){let o=t[r];if(o&&a===o.start){i<0&&(i=a),a=o.end-1,r++;continue}/\s/.test(e[a])?(i>=0&&V(n,e.slice(i,a)),i=-1):i<0&&(i=a)}return i>=0&&V(n,e.slice(i)),n}function Mi(e){let t=``,n=0,r;for(let i=0;i<e.length;i++){let a=e[i];if(a===`\\`&&e[i+1]===`_`){t+=`_`,i++;continue}if(a===`\\`&&i+1<e.length){t+=a+e[++i];continue}if(r){a===r&&(r=void 0),t+=a===`_`&&n===0?` `:a;continue}if(a===`/`&&e[i+1]===`*`){let n=e.indexOf(`*/`,i+2);if(n===-1){t+=e.slice(i);break}t+=e.slice(i,n+2),i=n+1;continue}if(a===`"`||a===`'`){r=a,t+=a;continue}if(a===`(`?n++:a===`)`&&n>0&&n--,a===`_`&&n===0){t+=` `;continue}t+=a}return t}const Ni=new Set([`calc`,`clamp`,`max`,`min`]);function Pi(e){return e==null?!1:e===`\\`||/[-_a-zA-Z0-9]/.test(e)||e.charCodeAt(0)>=128}function Fi(e,t){if(t>0&&Pi(e[t-1])||!/[-_a-zA-Z]/.test(e[t]))return;let n=t+1;for(;/[-_a-zA-Z0-9]/.test(e[n]??``);)n++;return e[n]===`(`?{name:e.slice(t,n),open:n}:void 0}function Ii(e){let t=new Map,n=[],r=!1,i;for(let a=0;a<e.length;a++){let o=e[a];if(r){o===`*`&&e[a+1]===`/`&&(r=!1,a++);continue}if(i){o===`\\`?a++:o===i&&(i=void 0);continue}if(o===`\\`){a++;continue}if(o===`"`||o===`'`){i=o;continue}if(o===`/`&&e[a+1]===`*`){r=!0,a++;continue}o===`(`?V(n,a):o===`)`&&n.length>0&&t.set(n.pop(),a)}return t}function Li(e,t){let n=e[t];if(n===`"`||n===`'`){for(let r=t+1;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===n)return r+1;return e.length}if(n===`/`&&e[t+1]===`*`){let n=e.indexOf(`*/`,t+2);return n<0?e.length:n+2}}function Ri(e){let t=e.trimEnd();for(;t.endsWith(`*/`);){let e=t.lastIndexOf(`/*`);if(e<0)break;t=t.slice(0,e).trimEnd()}if(t.endsWith(`)`)||/(?:^|[\s,(+\-*/])(?:e|pi|nan|-?infinity)$/i.test(t))return!0;let n=/[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?(?:%|[a-z]+)?$/i.exec(t);if(n==null)return!1;let r=n.index;return r===0?!0:n[0].startsWith(`-`)&&t[r-1]===`-`?!1:/[\s,(+\-*/]/.test(t[r-1])}function zi(e,t,n){return e[t]!==`+`&&e[t]!==`-`||!/\d/.test(e[t+1]??``)?!1:/(?:^|[^-_a-zA-Z0-9.])(?:\d+(?:\.\d*)?|\.\d+)[eE]$/.test(n.trimEnd())}function Bi(e){if(!e.includes(`(`))return e;let t=Ii(e),n=[],r=``;for(let i=0;i<e.length;){let a=Li(e,i);if(a!=null){r+=e.slice(i,a),i=a;continue}let o=Fi(e,i);if(o!=null){let a=t.get(o.open);if(a==null){r+=e.slice(i);break}let s=o.name.toLowerCase();if(s===`url`){r+=e.slice(i,a+1),i=a+1;continue}if(Ni.has(s)){r+=`${o.name}(`,V(n,a),i=o.open+1;continue}r+=o.name,i=o.open;continue}let s=e[i],c=s===`+`||s===`-`||s===`*`||s===`/`,l=s===`/`&&e[i+1]===`*`;n.length>0&&c&&!l&&!zi(e,i,r)&&Ri(r)?(/\s/.test(r.at(-1)??``)||(r+=` `),r+=s,/\s/.test(e[i+1]??``)||(r+=` `)):r+=s,i===n.at(-1)&&n.pop(),i++}return r}function Vi(e){return e.length>=2&&e[0]===`[`&&e[e.length-1]===`]`}function Hi(e,t={}){let{calc:n=!0}=t,r=e;return Vi(r)&&(r=Mi(r.slice(1,-1))),n&&(r=Bi(r)),r}const Ui=new se(256,void 0,!0);function Wi(e){return[...n(e)]}function Gi(e,t,n){return n.some(n=>e.startsWith(n,t))}function Ki(e,t,n){let r=t-1;for(;r>0&&/[\w$-]/.test(e[r-1]);)r--;let i=r-1;for(;i>=0&&/\s/.test(e[i]);)i--;return e[i]===`(`&&n.some(t=>e.slice(i-t.length,i)===t)}function qi(e,t){let n=t+1;for(;/\s/.test(e[n]??``);)n++;return e[n]===`"`||e[n]===`'`||e[n]==="`"}function Ji(e,t){let n=new Set,r=[],i=[],a=[],o,s=()=>{let e=o?.bracketStarts.at(-1);if(e)e.containsCandidate=!0;else{let e=i.at(-1);e&&(e.containsCandidate=!0)}};for(let c=0;c<e.length;c++){let l=e[c],u=l===`[`&&(e[c-1]===`:`||e[c-1]===`@`);if(u||l===`[`&&!o){qi(e,c)&&(!u||ke(e,c)&&!Ki(e,c,t))&&n.add(c),V(i,{containsCandidate:!1,parentQuote:o,start:c}),o=void 0;continue}if(i.length!==0){if(o){if(l===`\\`)c++;else if(l===o.character){if(o.bracketStarts.some(e=>e.containsCandidate)){for(let e of o.bracketStarts)e.containsCandidate&&n.add(e.start);let e=i.at(-1);e&&(e.containsCandidate=!0)}o=void 0}else if(l===`[`)V(o.bracketStarts,{containsCandidate:!1,start:c});else if(l===`]`){let i=o.bracketStarts.pop();i&&Gi(e,c+1,t)?(V(r,{start:i.start,end:c+1}),n.delete(i.start),s()):i?.containsCandidate&&(n.add(i.start),s())}}else if(l===`"`||l===`'`||l==="`")o={bracketStarts:[],character:l},V(a,o);else if(l===`\\`)c++;else if(l===`]`){let a=i.pop(),l=a.start,u=c+1,d=n.has(l)||Ae(e,l,u)&&!Ki(e,l,t),f=(e[l-1]===`:`||e[l-1]===`@`||Gi(e,u,t))&&!d;f?(V(r,{start:l,end:u}),n.delete(l)):a.containsCandidate&&n.add(l),o=a.parentQuote,(f||a.containsCandidate)&&s()}}}for(let e of i)e.containsCandidate&&n.add(e.start);for(let e of a)for(let t of e.bracketStarts)t.containsCandidate&&n.add(t.start);let c=[];for(let e of r.sort((e,t)=>e.start-t.start||t.end-e.end))(!c.length||e.start>=c.at(-1).end)&&V(c,e);return{barrierStarts:n,ranges:c}}function Yi(e,t){let{barrierStarts:n,ranges:r}=Ji(e,t);if(r.length===0&&n.size===0)return e;let i=e.split(``);for(let e of n)i[e]=`$`;for(let e of r)for(let t=e.start+1;t<e.end-1;t++)i[t]=`$`;return i.join(``)}function Xi(e){let t=JSON.stringify(e),n=Ui.getOrInsertComputed(t,()=>{let t=[...e].sort((e,t)=>t.length-e.length).map(Dn).join(`|`),n=`\\[[^\\]]*?\\]`;return RegExp(t?`((?:[!@*<~\\w+:_-]|${n})+?)(${t})\\(((?:[~!@<>\\w\\s:/\\\\,%#.$?-]|${n})+?)\\)(?!\\s*?=>)`:`(?!)`,`gm`)});return n.lastIndex=0,n}function Zi(e=[`-`,`:`]){let t=Xi(Wi(e));return new RegExp(t.source,t.flags)}function Qi(e,t=[`-`,`:`],n=5){let r=Wi(t),i=Xi(r),a=!1,o=typeof e==`string`?e:e.original,s=o,c=new Set,l=new Map;if(n>0){let e=Yi(s,r),t;if(r.some(t=>e.includes(`${t}(`)))do{t=!1;let o=``,u=0;i.lastIndex=0;let d;for(;d=i.exec(e);){let e=d.index,[n,r,i,f]=d;a=!0,t=!0;let p=n.length,m=s.slice(e,e+r.length);c.add(m+i);let h=e+m.length+i.length+1,g=s.slice(h,h+f.length),_={length:p,items:[]};l.set(e,_);let v=0;for(let e of ji(g)){let t=g.indexOf(e,v),n=h+t;v=t+e.length;let r=l.get(n)?.items;r?l.delete(n):r=[{offset:n,length:e.length,className:e}];for(let e of r)e.className=e.className===`~`?i===`:`?`${m}${i}~`:m:e.className.replace(/^(!?)(.*)/,(e,t,n)=>`${t}${m}${i}${n}`),V(_.items,e)}o+=s.slice(u,e),o+=`$`.repeat(p),u=e+p}t&&(s=o+s.slice(u)),--n,t&&n&&(e=Yi(s,r))}while(t&&n)}let u=[...l].sort(([e],[t])=>e-t),d;if(typeof e==`string`){d=``;let t=0;for(let[n,r]of u)d+=e.slice(t,n),d+=r.items.map(e=>e.className).join(` `),t=n+r.length;d+=e.slice(t)}else{d=e;for(let[e,t]of u){let n=e+t.length;if(d.slice(e,n)!==o.slice(e,n))throw Error(`Cannot expand a variant group that overlaps an existing MagicString edit`)}for(let[e,t]of u)d.overwrite(e,e+t.length,t.items.map(e=>e.className).join(` `))}return{prefixes:Array.from(c),hasChanged:a,groupsByOffset:new Map(u),get expanded(){return d.toString()}}}function $i(e,t){let n=new Map,r=Wi(t).sort((e,t)=>t.length-e.length),i=ji(e).map(e=>{let t=r.find(t=>e.startsWith(t));if(!t)return e;let i=e.slice(t.length);if(n.has(t))return V(n.get(t),i),null;{let e=[i];return n.set(t,e),{prefix:t,items:e}}}).filter(Ir).map(e=>typeof e==`string`?e:`${e.prefix}(${e.items.join(` `)})`).join(` `);return i?`${/^\s/.test(e)?` `:``}${i}${/\s$/.test(e)?` `:``}`:e?` `:``}function ea(e,t=[`-`,`:`],n=5){let r=Qi(e,t,n);return typeof e==`string`?r.expanded:e}const ta=new Set;function na(e){if(!ta.has(e)){ta.add(e);try{console.warn(`[Teacss]`,e)}catch(t){throw ta.delete(e),t}}}function ra(e,t,n){let r=e;for(;r!==null&&r!==Object.prototype&&!Object.hasOwn(r,t);)r=Object.getPrototypeOf(r);if(r!==null&&r!==Object.prototype){if(!Reflect.set(e,t,n))throw TypeError(`Cannot assign rule metadata "${String(t)}"`)}else D(e,t,n)}function ia(e,t){let n=e;for(;n!==null&&n!==Object.prototype;){if(Object.hasOwn(n,t))return Reflect.get(e,t);n=Object.getPrototypeOf(n)}}function aa(e){let t=[void 0,void 0,void 0];for(let n=0;n<2;n++){if(!Object.hasOwn(e,n))throw TypeError(`[Teacss] invalid rule or shortcut entry: matcher and body must be own tuple values`);t[n]=e[n]}let r=Object.hasOwn(e,2)?e[2]:void 0;if(r!==void 0){let e={...r},i=Object.hasOwn(e,`prefix`)&&e.prefix;Array.isArray(i)&&(e.prefix=[...n(i)]),t[2]=e}return t}function oa(e){return Array.from(n(e),aa)}function sa(e){let n=Object.create(null),r=[];for(let[i,a]of e.entries()){let e=Object.hasOwn(a,2)?a[2]:void 0;if(e===void 0){if(e={},Object.hasOwn(a,2)){if(!Reflect.set(a,2,e))throw TypeError(`Cannot assign rule metadata`)}else D(a,2,e)}if(ra(e,`__index`,i),ri(a)){let t=O(ia(e,`prefix`)??``);for(let e of t)n[e+a[0]]=a}else t(r,a)}return r.reverse(),{rulesSize:e.length,rulesDynamic:r,rulesStaticMap:n}}function ca(e){let t=oa(e.rules),n=sa(t);e.rules=t,e.rulesSize=n.rulesSize,e.rulesDynamic=n.rulesDynamic,e.rulesStaticMap=n.rulesStaticMap}function X(e,t){return e!=null&&Object.hasOwn(e,t)?Reflect.get(e,t):void 0}function la(e){return[...n(O(e))]}function ua(e,t){for(let t=e.length;t>0;t--)Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:e[t-1],writable:!0});D(e,0,t)}function da(e){let n=new Set,r=[];for(let i of e){let e=i.name;n.has(e)||(n.add(e),t(r,i))}return r}function fa(e){return Array.from(e,(e,t)=>({index:t,order:E(e,`order`)||0,value:e})).sort((e,t)=>e.order-t.order||e.index-t.index).map(({value:e})=>e)}function pa(e,t){let n={...e};for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(t,e)?.enumerable)continue;let r=Reflect.get(t,e);r!==void 0&&D(n,e,r)}return n}function ma(e){return Array.from(n(O(e)),e=>Array.isArray(e)?[e]:Object.entries(e)).flat()}const ha=new WeakSet;function ga(e,t){let r={};for(let t of Reflect.ownKeys(e)){if(t===`name`||!Object.getOwnPropertyDescriptor(e,t)?.enumerable)continue;let i=Reflect.get(e,t);D(r,t,t===`prefix`&&Array.isArray(i)?[...n(i)]:i)}return D(r,`name`,t),r}async function _a(e){return va(e)}async function va(e,t){let n=typeof e==`function`?await e():await e;if(typeof n!=`object`||!n||Array.isArray(n))throw TypeError(`Invalid TeaCSS preset: expected an object, received ${n===null?`null`:Array.isArray(n)?`array`:typeof n}.`);t?.(n);let r=Object.hasOwn(n,`name`)?Reflect.get(n,`name`):void 0;if(typeof r!=`string`||r.trim()===``)throw TypeError(`Invalid TeaCSS preset: expected a non-empty string name.`);if(ha.has(n))return n;n=ga(n,r),ha.add(n);let i=X(n,`shortcuts`),a=X(n,`rules`),o=i?oa(ma(i)):void 0;n.shortcuts=o,n.rules=a?oa(a):void 0;let s=X(n,`prefix`),c=X(n,`layer`);if(s||c){let e=e=>{e[2]||={};let t=e[2];E(t,`prefix`)==null&&s&&D(t,`prefix`,[...O(s)]),E(t,`layer`)==null&&c&&D(t,`layer`,c)};o?.forEach(e),n.rules?.forEach(e)}return n}async function ya(e){return ba(e,new Set)}async function ba(e,t){let r=new Set(t),i=e=>{if(t.has(e))throw TypeError(`Circular TeaCSS preset reference detected.`);r.add(e)};i(e);let a=await va(e,i),o=X(a,`presets`);if(!o)return[a];let s=Array.from(n(O(o)),e=>Array.isArray(e)?[...n(e)]:[e]).flat();return[a,...(await Promise.all(s.map(e=>ba(e,r)))).flat()]}function xa(e){if(e.length===0)return{};let n=[],r=[],i=!1,a=!1,o=[],s=[];for(let c of e){let e=X(c,`pipeline`),l=X(c,`filesystem`),u=X(c,`inline`),d=e&&X(e,`include`),f=e&&X(e,`exclude`);e===!1?(a=!0,i=!0):i||(e!==void 0&&(a=!0),d&&t(n,d),f&&t(r,f)),l&&t(o,l),u&&t(s,u)}let c={};return i?c.pipeline=!1:a&&(c.pipeline={},n.length&&(c.pipeline.include=k(ja(n))),r.length&&(c.pipeline.exclude=k(ja(r)))),o.length&&(c.filesystem=k(o.flatMap(la))),s.length&&(c.inline=k(s.flatMap(la))),c}async function Sa(e={},t={}){let r=pa(t,e),i=X(r,`presets`)??[],a=Array.from(n(O(i)),la).flat(),o=da((await Promise.all(a.map(ya))).flat()),s=Array.from(o,e=>({enforce:X(e,`enforce`),preset:e})),c=[...s.filter(({enforce:e})=>e===`pre`),...s.filter(({enforce:e})=>e==null),...s.filter(({enforce:e})=>e===`post`)].map(({preset:e})=>e),l=[...c,r],u=[...l].reverse(),d=l.reduce((e,t)=>({...e,...X(t,`layers`)}),{...Be});function f(e){return k(l.flatMap(t=>la(X(t,e))))}let p=f(`extractors`),m=u.map(e=>X(e,`extractorDefault`)).find(e=>e!==void 0);m===void 0&&(m=Cr),m&&!p.includes(m)&&ua(p,m);let h=fa(p),g=oa(f(`rules`)),{rulesSize:_,rulesStaticMap:v,rulesDynamic:y}=sa(g),b=l.map(e=>X(e,`autocomplete`)),x=e=>b.flatMap(t=>la(X(t,e))),S={templates:k(x(`templates`)),extractors:fa(x(`extractors`)),shorthands:Aa(b.map(e=>X(e,`shorthands`)||{}))},C=f(`separators`);C.length||(C=[`:`,`-`]);let w=xa(f(`content`)),T=u.map(e=>X(e,`details`)).find(e=>e!==void 0),E=u.map(e=>X(e,`outputToCssLayers`)).find(e=>e!==void 0),D=u.map(e=>X(e,`sortLayers`)).find(e=>e!==void 0),A=X(r,`envMode`)||`build`,j={...r,mergeSelectors:X(r,`mergeSelectors`)??!0,warn:X(r,`warn`)??!0,unmatched:X(r,`unmatched`)??`off`,outputToCssLayers:E,sortLayers:D??(e=>e),blocklist:f(`blocklist`),presets:c,envMode:A,shortcutsLayer:X(r,`shortcutsLayer`)||`shortcuts`,layers:d,theme:ka(l.map(e=>X(e,`theme`))),rules:g,rulesSize:_,rulesDynamic:y,rulesStaticMap:v,preprocess:f(`preprocess`),postprocess:f(`postprocess`),preflights:f(`preflights`),autocomplete:S,variants:fa(f(`variants`).map(Pr)),shortcuts:oa(ma(f(`shortcuts`))).reverse(),extractors:h,safelist:f(`safelist`),separators:C,details:T??A===`dev`,content:w,transformers:da(f(`transformers`))},M=f(`extendTheme`);for(let e of M)j.theme=e(j.theme,j)||j.theme;let N=!1;for(let e of l){let t=X(e,`configResolved`);t!=null&&(N=!0,await t(j))}return N&&ca(j),j}function Ca(e){let t={};for(let n of Reflect.ownKeys(e))Object.getOwnPropertyDescriptor(e,n)?.enumerable&&Object.defineProperty(t,n,{configurable:!0,enumerable:!0,value:Reflect.get(e,n),writable:!0});return t}function wa(e,t,n){return Object.hasOwn(t,n)?Reflect.get(t,n):X(e,n)}function Ta(e){let t=Ca(e),n=wa(e,t,`templates`);n===void 0?delete t.templates:D(t,`templates`,O(n));let r=wa(e,t,`extractors`);if(r===void 0?delete t.extractors:D(t,`extractors`,O(r)),Object.hasOwn(e,`shorthands`)){let n=wa(e,t,`shorthands`);n===void 0?delete t.shorthands:D(t,`shorthands`,n)}return t}function Ea(e={},t={}){let n=X(e,`shorthands`),r=X(t,`shorthands`),i={...e},a={...t};delete i.shorthands,delete a.shorthands;let o=$r(i,a,!0);return(n!==void 0||r!==void 0)&&Object.defineProperty(o,"shorthands",{configurable:!0,enumerable:!0,value:{...n??{},...r??{}},writable:!0}),o}function Da(e){let t=Ca(e),n=wa(e,t,`entry`);return n===void 0?delete t.entry:D(t,`entry`,O(n)),t}function Oa(e){let t=[`shortcuts`,`preprocess`,`postprocess`,`extendTheme`,`separators`];return Array.from(n(e),e=>Object.entries(e).reduce((e,[n,r])=>{if(r===void 0)return e;let i=n===`autocomplete`&&r?Ta(r):n===`cli`&&r?Da(r):t.includes(n)?O(r):r;return{...e,[n]:i}},{})).reduce((e,t)=>{let n=X(e,`autocomplete`),r=X(t,`autocomplete`),i=X(e,`content`),a=X(t,`content`),o=X(e,`extractorDefault`),s=X(t,`extractorDefault`),c=X(e,`theme`),l=X(t,`theme`),u={...e},d={...t};delete u.autocomplete,delete u.content,delete u.extractorDefault,delete u.theme,delete d.autocomplete,delete d.content,delete d.extractorDefault,delete d.theme;let f=$r(u,d,!0);return(n||r)&&Object.defineProperty(f,"autocomplete",{configurable:!0,enumerable:!0,value:Ea(n,r),writable:!0}),(c||l)&&Object.defineProperty(f,"theme",{configurable:!0,enumerable:!0,value:ka([c,l]),writable:!0}),(i||a)&&Object.defineProperty(f,"content",{configurable:!0,enumerable:!0,value:xa([i||{},a||{}]),writable:!0}),(o!==void 0||s!==void 0)&&D(f,`extractorDefault`,s===void 0?o:s),f},{})}function ka(e){return e.reduce((e,t)=>{if(!t)return e;let n=ni(t);if(!q(n))return n;if(!q(e)){if(!Reflect.ownKeys(n).some(e=>Object.getOwnPropertyDescriptor(n,e)?.enumerable))return e;if(Object.hasOwn(n,`$reset`)&&Reflect.get(n,`$reset`))return $r({},n);throw TypeError(`[Teacss] cannot safely merge a plain theme into a non-plain theme; use extendTheme for a class-aware merge or $reset to replace it.`)}return $r(e,n)},{})}function Aa(e){return e.reduce((e,t)=>{let n=Object.create(null);for(let e of Object.keys(t)){if(!Object.hasOwn(t,e))continue;let r=t[e];if(Array.isArray(r)){let t=la(r);n[e]=t.length===1?t[0]??``:`(${t.join(`|`)})`}else n[e]=r}return{...e,...n}},{})}function ja(e){return e.flatMap(e=>la(Ma(e)))}function Ma(e){return Array.isArray(e)?e:e?[e]:[]}function Na(e){return e}function Pa(){let e=typeof process<`u`&&!!process.stdout;return{isNode:e,isVSCode:e&&!!process.env.VSCODE_CWD,isESLint:e&&!!process.env.ESLINT}}var Fa=`0.5.2`;const Ia=/[a-zA-Z0-9_-]/;function La(e,t){let n=e;for(;n!=null&&n!==Object.prototype&&n!==Array.prototype&&n!==Function.prototype;){if(Object.hasOwn(n,t))return Reflect.get(e,t);n=Object.getPrototypeOf(n)}}function Ra(e,n){if(n.length>0&&e.length>256/n.length)return null;let r=[];for(let i of e)for(let e of n)t(r,i+e);return r}function za(e){let t=!1,n=0,r=!1;for(let i=1;i<e.length;i++){let a=e[i];if(t)t=!1;else if(a===`\\`)t=!0;else if(r)a===`]`&&(r=!1);else if(a===`[`)r=!0;else if(a===`(`)n++;else if(a===`)`)n>0&&n--;else if(a===`|`&&n===0)return!0}return!1}function Ba(e,t){return e[t]===`:`&&!/[?*+{]/.test(e[t+1]??``)}function Va(e){if(!e.startsWith(`^`)||za(e))return null;let t=1;for(;t<e.length&&Ia.test(e[t]);)t++;if(t>1&&Ba(e,t))return[e.slice(1,t)];let n=Ha(e,1,`:`);if(!n||!Ba(e,n.end)||n.combos.some(e=>e.length===0||e.includes(`:`)))return null;let r=[...new Set(n.combos)];return r.length?r:null}function Ha(e,t,n,r=0){let i=[``];for(;t<e.length;){let a=e[t];if(n.includes(a))break;if(Ia.test(a)){let n=``;for(;t<e.length&&Ia.test(e[t]);)n+=e[t++];i=i.map(e=>e+n);continue}let o=null;if(a===`(`)o=r<64?Ua(e,t,r+1):null;else if(a===`[`)o=Wa(e,t);else return null;if(!o)return null;t=o.end;let s=o.combos;if(e[t]===`?`)s=[``,...s],t++;else if(e[t]===`*`||e[t]===`+`||e[t]===`{`)return null;let c=Ra(i,s);if(!c)return null;i=c}return{combos:i,end:t}}function Ua(e,n,r){if(n++,e.startsWith(`?:`,n))n+=2;else if(e[n]===`?`)return null;let i=[];for(;;){let a=Ha(e,n,`|)`,r);if(!a)return null;for(let e of a.combos)t(i,e);if(i.length>256)return null;if(n=a.end,e[n]===`|`){n++;continue}return e[n]===`)`?{combos:i,end:n+1}:null}}function Wa(e,n){if(n++,e[n]===`^`)return null;let r=[];for(;n<e.length&&e[n]!==`]`;){let i=e[n];if(i===`\\`||i===`-`||(t(r,i),r.length>256))return null;n++}return e[n]===`]`?{combos:r,end:n+1}:null}function Ga(e){if(La(e[2],`prefix`))return null;let[t]=e;return!(t instanceof RegExp)||Object.hasOwn(t,`exec`)||Object.getPrototypeOf(t)!==RegExp.prototype||t.exec!==li||Y(t)?null:Va(J(t))}function Ka(e){let n=e.map(e=>[e,Ga(e)]),r=new Map;for(let[,e]of n)if(e!==null)for(let t of e)r.has(t)||r.set(t,[]);let i=[];for(let[e,a]of n){if(a===null){t(i,e);for(let n of r.values())t(n,e);continue}for(let n of a)t(r.get(n),e)}return{map:r,fallback:i}}const Z=Object.freeze({shortcutsNoMerge:Symbol.for(`@teacss/core/shortcut-no-merge`),noMerge:Symbol.for(`@teacss/core/no-merge`),noScope:Symbol.for(`@teacss/core/no-scope`),variants:Symbol.for(`@teacss/core/variants`),parent:Symbol.for(`@teacss/core/parent`),selector:Symbol.for(`@teacss/core/selector`),layer:Symbol.for(`@teacss/core/layer`),sort:Symbol.for(`@teacss/core/sort`),body:Symbol.for(`@teacss/core/body`)});function qa(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}const Ja={px:1,rem:16,em:16,in:96,pt:96/72,pc:16,cm:96/2.54,mm:96/25.4,q:96/101.6},Ya=RegExp(`^[ \\t\\n\\r\\f]*([+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:e[+-]?\\d+)?)(${Object.keys(Ja).join(`|`)}|[sld]?v(?:[whib]|min|max)|cq(?:[whib]|min|max)|r?(?:ch|ex|cap|ic|lh)|%)?[ \\t\\n\\r\\f]*(?![\\s\\S])`,`i`);function Xa(e){let t=Ya.exec(e);if(!t)return null;let n=Number.parseFloat(t[1]),r=(t[2]??`px`).toLowerCase();if(Object.hasOwn(Ja,r)&&(n*=Ja[r],r=`px`),!Number.isFinite(n))return null;let i=r===`px`?Math.round(n*1e6)/1e6:n;return{unit:r,value:Number.isFinite(i)?i:n}}function Za(e){let t=!1,n=wo(e)[0];if(/["'\\/]|not/i.test(n)&&(n=n.replace(/"(?:\\[\s\S]|[^"\\])*(?:"|$)|'(?:\\[\s\S]|[^'\\])*(?:'|$)|\/\*[\s\S]*?(?:\*\/|$)|((?:[-\w\u0080-\uffff]|\\(?:[\da-f]{1,6}(?:\r\n|[ \t\n\r\f])?|[^\n\r\f]))+)|\\[\s\S]/gi,(e,n)=>n?(l(n).toLowerCase()===`not`&&(t=!0),n.includes(`\\`)?`_`:n):` `)),!/^@media(?=[ \t\n\r\f(])/i.test(n)||t)return null;let r=null;for(let e of n.matchAll(/\([ \t\n\r\f]*(min|max)-width[ \t\n\r\f]*:([^)]*)\)/gi)){let t=Xa(e[2]);if(t){if(/min/i.test(e[1]))return t;r??={unit:t.unit,value:-t.value}}}return r}function Qa(e,t){return e<t?-1:+(e>t)}function $a(e,t){return Qa(e??``,t??``)}function eo(e,t){for(let n of t)V(e,n)}function to(e,t){for(let t=e.length;t>0;t--)Object.hasOwn(e,t-1)?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:e[t-1],writable:!0}):delete e[t];D(e,0,t)}function no(e){let t=new wr;for(let n of e)t.setCount(n,e.getCount(n));return t}function ro(e){return K(e)?no(e):new Set(e)}function io(e,t,n){if(K(e)&&K(t)&&K(n)){for(let r of new Set([...t,...n])){let i=n.getCount(r),a=t.getCount(r);if(Object.is(i,a)&&n.has(r)===t.has(r))continue;let o=e.getCount(r)+(i-a);o>0||o===0&&i===0&&n.has(r)?e.setCount(r,o):e.delete(r)}return}for(let r of t)n.has(r)||e.delete(r);for(let r of n)t.has(r)||e.add(r)}function*ao(e,t){for(let n=0;n<e.length;n++){let r=t[n];r!=null&&(yield[e[n],r])}}function oo(e){if(e!==void 0&&(!Number.isSafeInteger(e)||e<1))throw RangeError(`tokenConcurrency must be a positive integer`)}function so(e,t){return Object.hasOwn(e,t)?Reflect.get(e,t):void 0}function co(e,t){if(Object.hasOwn(e,t))return Reflect.get(e,t);let n=Object.getPrototypeOf(e);if(n===null||n===Object.prototype)return;let r=Object.getOwnPropertyDescriptor(n,`constructor`)?.value;if(typeof r==`function`&&r!==Object)for(;n!==null&&n!==Object.prototype;){if(Object.hasOwn(n,t))return Reflect.get(e,t);n=Object.getPrototypeOf(n)}}function Q(e,t){return e?E(e,t):void 0}function $(e,t){return so(e,t)}function lo(e){let t=E(e,`parent`);return{body:E(e,`body`),handle:E(e,`handle`),layer:E(e,`layer`),order:E(e,`order`),parent:Array.isArray(t)?so(t,0):t,parentOrder:Array.isArray(t)?so(t,1):void 0,selector:E(e,`selector`),sort:E(e,`sort`),source:e}}function uo(e){if(e===null||typeof e!=`object`&&typeof e!=`function`)return;let t=Reflect.get(e,`then`);if(typeof t==`function`)return{then(n,r){return Reflect.apply(t,e,[n,r])}}}async function fo(e,t,n){if(t===void 0||t>=e.length)return await Promise.all(e.map(n));let r=Array(e.length),i=0,a=!1,o=Array.from({length:Math.min(t,e.length)},async()=>{for(;!a&&i<e.length;){let t=i++;try{let i=await n(e[t]);D(r,t,i)}catch(e){throw a=!0,e}}});return await Promise.all(o),r}function po(e,t){if(e===void 0)return;let n=is(t),r=n.startsWith(`[`),i=0,a,o=0,s=``;for(let t=0;t<e.length;t++){let c=e[t];if(a){c===`\\`?t++:c===a&&(a=void 0);continue}if(c===`/`&&e[t+1]===`*`){let n=e.indexOf(`*/`,t+2);if(n===-1)break;t=n+1;continue}if(c===`\\`){t++;continue}if(c===`"`||c===`'`){a=c;continue}if(i===0&&c===n[0]&&e.startsWith(n,t)){let i=e[t+n.length],a=i!==void 0&&(/[\w-]/.test(i)||i===`\\`||i.charCodeAt(0)>=128);if(r||!a){s+=`${e.slice(o,t)}&`,o=t+n.length,t=o-1;continue}}c===`[`?i++:c===`]`&&i>0&&i--}return s+e.slice(o)}function mo(e,t,n,r){let i=O(e).filter(ho),a=O(n).filter(ho);if(i.length!==a.length)return!1;for(let e=0;e<i.length;e++){let n=i[e],o=a[e];if(n[2]!==o[2]||po(n[1],t)!==po(o[1],r)||n[3]!==o[3]||Q(n[4],`layer`)!==Q(o[4],`layer`)||Q(n[4],`sort`)!==Q(o[4],`sort`)||!!Q(n[4],`noScope`)!=!!Q(o[4],`noScope`)||!!(n[6]??Q(n[4],`noMerge`))!=!!(o[6]??Q(o[4],`noMerge`)))return!1}return!0}function ho(e){return Array.isArray(e)&&Object.hasOwn(e,0)&&Object.hasOwn(e,1)&&Object.hasOwn(e,2)&&Object.hasOwn(e,3)&&Object.hasOwn(e,4)&&Object.hasOwn(e,5)&&Object.hasOwn(e,6)}function go(e){return Object.hasOwn(e,0)&&e[0]===Z.shortcutsNoMerge}function _o(e){for(let t=e.length-1;t>=0;t--){if(!Object.hasOwn(e,t))continue;let n=e[t];if(go(n))return Object.hasOwn(n,1)?n[1]:void 0}}function vo(e,t){let n=[...e,...t],r=[];for(let e=t.length-1;e>=0;e--)_e(t[e])&&V(r,t[e]);for(let t=e.length-1;t>=0;t--)_e(e[t])&&V(r,e[t]);if(r.length<2)return n;let i=r[0];for(let e=1;e<r.length;e++)i=ve(i,r[e])??i;let a=[],o=!1;for(let e of n)_e(e)?o||=(V(a,i),!0):V(a,e);return a}function yo(e){let t;for(let n of e)n.includes(`{`)&&(t??=[],V(t,n));if(!t)return e;for(let n of t){let t=ji(Tn(n));if(t.length===1&&t[0]===n)continue;let r=K(e)?e.getCount(n):1;e.delete(n);for(let n of t)K(e)?e.setCount(n,e.getCount(n)+r):e.add(n)}return e}function bo(e){let t=0;for(let[n,r]of e.matchAll(/\\(?:([\da-f]{1,6})(?:\r\n|[ \t\n\r\f])?|.)|(["'])(?:\\.|(?!\2)[^\\])*\2|\/\*.*?(?:\*\/|$)|[^:\\/"'-]+|./gis)){if(n.startsWith(`/*`)&&t!==2)continue;let e=r?Number.parseInt(r,16):n.charCodeAt(+(n[0]===`\\`));if(t===2&&(e|32)>=97&&(e|32)<=122)return!0;t=n===`:`?1:t===1&&e===45?2:0}return!1}function xo(e){let t=new Map,n=new Map,r=0,i;for(let a of e){let[o,s,c]=a;if(i!==void 0&&s!==i&&(t.clear(),n.clear()),i=s,c){e[r++]=a;continue}let l=o.length>0,u=l?t:n,d=u.get(s);if(!d){u.set(s,a),e[r++]=a;continue}l&&eo(d[0],o)}e.length=r}function So(e,t,n){let r=(e.get(t)??0)-(e.get(n)??0);if(r)return r;let i=Za(t),a=Za(n);if(i==null!=(a==null))return i==null?-1:1;if(i!=null&&a!=null){if(i.unit!==a.unit)return Qa(i.unit,a.unit);if(i.value!==a.value)return i.value-a.value}return Qa(t,n)}function Co(e,t,n=``){let r=wo(e);return`${r.join(`{`)}{${n}${t}${n}${`}`.repeat(r.length)}`}function wo(e){let t=[],n=0,r=!1,i=0,a,o=0;for(let s=0;s<e.length;s++){let c=e[s];r?c===`*`&&e[s+1]===`/`&&(r=!1,s++):a?c===`\\`?s++:c===a&&(a=void 0):c===`\\`?s++:c===`/`&&e[s+1]===`*`?(r=!0,s++):c===`"`||c===`'`?a=c:c===`(`?i++:c===`)`?i>0&&i--:c===`[`?n++:c===`]`?n>0&&n--:n===0&&i===0&&e.startsWith(` $$ `,s)&&(V(t,e.slice(o,s)),s+=3,o=s+1)}return V(t,e.slice(o)),t}function To(e){let t=[];if(!e.includes(`$$`))return t;let n=!1,r;for(let i=0;i<e.length;i++){let a=e[i];if(n){a===`*`&&e[i+1]===`/`&&(n=!1,i++);continue}if(r){a===`\\`?i++:a===r&&(r=void 0);continue}if(a===`/`&&e[i+1]===`*`){n=!0,i++;continue}if(a===`\\`){i++;continue}if(a===`"`||a===`'`){r=a;continue}if(!/\s/.test(a)||e[i+1]!==`$`||e[i+2]!==`$`||!/\s/.test(e[i+3]??``))continue;let o=i+4;for(;o<e.length&&/\s/.test(e[o]);)o++;V(t,[i,o]),i=o-2}return t}function Eo(e,t){let n=To(e);if(!n.length)return e;let r=0,i=``;for(let[a,o]of n)i+=e.slice(r,a),i+=a===0||a<r?t?`${t} `:``:t?` ${t} `:` `,r=o;return i+e.slice(r)}const Do=new Set([Function.prototype,Object.getPrototypeOf(async()=>{}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})]),Oo=new Set([`arguments`,`caller`,`length`,`name`,`prototype`]);function ko(e){return Reflect.ownKeys(e).every(e=>Oo.has(e))}function Ao(e){let t=e;for(;t!==null;){let e=Object.getOwnPropertyDescriptor(t,`exec`);if(e)return{configurable:!!e.configurable,enumerable:!!e.enumerable,get:`get`in e?e.get:void 0,owner:t,set:`set`in e?e.set:void 0,value:`value`in e?e.value:void 0,writable:`value`in e?!!e.writable:void 0};t=Object.getPrototypeOf(t)}}function jo(e,t){let n=Ao(e);return n?.owner===t?.owner&&n?.configurable===t?.configurable&&n?.enumerable===t?.enumerable&&n?.get===t?.get&&n?.set===t?.set&&n?.value===t?.value&&n?.writable===t?.writable}function Mo(e){return Reflect.ownKeys(e).every(e=>e===`lastIndex`)}function No(e,t=new WeakMap,n={}){if(e===null||typeof e!=`object`&&typeof e!=`function`)return{kind:`primitive`,value:e};if(n.functionsByIdentity&&typeof e==`function`)return{complete:ko(e),kind:`identity`,value:e};if(n.ignoreRegExpLastIndex&&e instanceof RegExp){let t=Ao(e);return{complete:t?.owner===RegExp.prototype&&t.value===li&&Object.getPrototypeOf(e)===RegExp.prototype&&Mo(e),exec:t,flags:Y(e),kind:`regexp-identity`,source:J(e),value:e}}let r=t.get(e);if(r)return r;let i=Object.getPrototypeOf(e),a=i===RegExp.prototype?e:void 0,o={complete:i===null||i===Object.prototype||i===Array.prototype||Do.has(i)||i===RegExp.prototype,kind:`object`,properties:[],prototype:i,regexpFlags:a&&Y(a),regexpSource:a&&J(a),value:e};t.set(e,o);for(let r of Reflect.ownKeys(e)){if(n.ignoreRegExpLastIndex&&a&&r===`lastIndex`)continue;let i=Object.getOwnPropertyDescriptor(e,r);if(!i)continue;let s={configurable:!!i.configurable,enumerable:!!i.enumerable,key:r};if(`value`in i){s.value=No(i.value,t,n),Fo(s.value)||(o.complete=!1);try{let a=Reflect.get(e,r);s.observedValue=No(a,t,n),(!Object.is(a,i.value)||!Fo(s.observedValue))&&(o.complete=!1)}catch{o.complete=!1}s.writable=!!i.writable}else o.complete=!1,s.get=i.get,s.set=i.set;V(o.properties,s)}return o}function Po(e,t,n=new Map){if(t.kind===`primitive`)return Object.is(e,t.value);if(t.kind===`identity`)return e===t.value&&(!t.complete||ko(t.value));if(t.kind===`regexp-identity`)return e===t.value&&e instanceof RegExp&&jo(e,t.exec)&&J(e)===t.source&&Y(e)===t.flags&&(!t.complete||Mo(e));if(e!==t.value||e===null||typeof e!=`object`&&typeof e!=`function`||Object.getPrototypeOf(e)!==t.prototype||t.regexpSource!==void 0&&(J(e)!==t.regexpSource||Y(e)!==t.regexpFlags))return!1;let r=n.get(t);if(r)return r===e;n.set(t,e);let i=Reflect.ownKeys(e).filter(e=>!(t.regexpSource!==void 0&&e===`lastIndex`&&!t.properties.some(t=>t.key===e)));if(i.length!==t.properties.length)return!1;for(let r=0;r<i.length;r++){let a=t.properties[r],o=i[r];if(o!==a.key)return!1;let s=Object.getOwnPropertyDescriptor(e,o);if(!s||!!s.configurable!==a.configurable||!!s.enumerable!==a.enumerable)return!1;if(`value`in s){if(a.value===void 0||!!s.writable!==a.writable||!Po(s.value,a.value,n))return!1;if(a.observedValue!==void 0){let t;try{t=Reflect.get(e,o)}catch{return!1}if(!Po(t,a.observedValue,n))return!1}}else if(a.value!==void 0||s.get!==a.get||s.set!==a.set)return!1}return!0}function Fo(e){return e.kind===`primitive`||e.complete}function Io(e){let t=Array(e.length);for(let n=0;n<e.length;n++){if(!Object.hasOwn(e,n))continue;let r=e[n],i=Object.hasOwn(r,2),a=i?r[2]:void 0,o=No(r[0],void 0,{functionsByIdentity:!0,ignoreRegExpLastIndex:!0}),s={body:r[1],bodySnapshot:No(r[1],void 0,{functionsByIdentity:!0,ignoreRegExpLastIndex:!0}),matcherFlags:r[0]instanceof RegExp?Y(r[0]):void 0,matcherSnapshot:o,matcherSource:r[0]instanceof RegExp?J(r[0]):void 0,matcher:r[0],meta:a,metaOwn:i,metaSnapshot:No(a,void 0,{functionsByIdentity:!0,ignoreRegExpLastIndex:!0}),rule:r};D(t,n,s)}return t}function Lo(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=Object.hasOwn(e,n);if(r!==Object.hasOwn(t,n))return!1;if(!r)continue;let i=e[n],a=t[n],o=Object.hasOwn(i,2),s=o?i[2]:void 0;if(!Object.hasOwn(i,0)||!Object.hasOwn(i,1)||o!==a.metaOwn||i!==a.rule||i[0]!==a.matcher||i[1]!==a.body||s!==a.meta||!Po(i[0],a.matcherSnapshot)||i[0]instanceof RegExp&&(J(i[0])!==a.matcherSource||Y(i[0])!==a.matcherFlags)||!Po(i[1],a.bodySnapshot)||!Po(s,a.metaSnapshot))return!1}return!0}function Ro(e){for(let t=0;t<e.length;t++){if(!Object.hasOwn(e,t))continue;let{bodySnapshot:n,matcherSnapshot:r,metaSnapshot:i}=e[t];if(!Fo(n)||!Fo(r)||!Fo(i))return!1}return!0}const zo=[`blocklist`,`details`,`envMode`,`extractors`,`layers`,`mergeSelectors`,`outputToCssLayers`,`postprocess`,`preflights`,`preprocess`,`safelist`,`separators`,`shortcuts`,`shortcutsLayer`,`sortLayers`,`theme`,`unmatched`,`variants`,`warn`];function Bo(e,t,n={}){let r=No(e[t],void 0,n);return{complete:Fo(r),isCurrent:e=>Po(e[t],r),key:t}}function Vo(e,t){let n=e;for(;n!==null&&n!==Object.prototype&&n!==Array.prototype&&n!==Function.prototype;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return{descriptor:e,owner:n};n=Object.getPrototypeOf(n)}}function Ho(e,t){let n=Vo(e,t);if(!n)return{complete:!0,value:No(void 0)};let{descriptor:r,owner:i}=n;if(!(`value`in r))return{complete:!1,configurable:!!r.configurable,enumerable:!!r.enumerable,get:r.get,owner:i,set:r.set};let a=No(r.value,void 0,{functionsByIdentity:!0,ignoreRegExpLastIndex:!0});return{complete:Fo(a),configurable:!!r.configurable,enumerable:!!r.enumerable,owner:i,value:a,writable:!!r.writable}}function Uo(e,t,n){let r=Vo(e,t);if(!r)return n.owner===void 0&&n.value!==void 0&&Po(void 0,n.value);let{descriptor:i,owner:a}=r;return a!==n.owner||!!i.configurable!==n.configurable||!!i.enumerable!==n.enumerable?!1:`value`in i?n.value!==void 0&&!!i.writable===n.writable&&Po(i.value,n.value):n.value===void 0&&i.get===n.get&&i.set===n.set}function Wo(e,t,n){let r=e[t];if(!Array.isArray(r))return Bo(e,t,{functionsByIdentity:!0,ignoreRegExpLastIndex:!0});let i=Array.from({length:r.length},(e,t)=>{let i=Object.hasOwn(r,t),a=i?r[t]:void 0;return{entry:a,own:i,values:i&&a!=null&&(typeof a==`object`||typeof a==`function`)?n.map(e=>Ho(a,e)):n.map(()=>Ho(Object.create(null),``))}}),a=new Set(n),o=i.every(({entry:e,own:t,values:n})=>{if(!t||e==null||typeof e!=`object`&&typeof e!=`function`)return!0;let r=Object.getPrototypeOf(e);return(r===Object.prototype||r===null)&&Reflect.ownKeys(e).every(e=>a.has(e))&&n.every(e=>e.complete)});return{complete:o,isCurrent(e){let s=e[t];if(s!==r||!Array.isArray(s)||s.length!==i.length)return!1;for(let e=0;e<i.length;e++){let t=i[e];if(Object.hasOwn(s,e)!==t.own)return!1;if(!t.own)continue;let r=s[e];if(r!==t.entry)return!1;if(r!=null&&(typeof r==`object`||typeof r==`function`)){if(o&&(Object.getPrototypeOf(r)!==Object.prototype&&Object.getPrototypeOf(r)!==null||!Reflect.ownKeys(r).every(e=>a.has(e))))return!1;for(let e=0;e<n.length;e++)if(!Uo(r,n[e],t.values[e]))return!1}}return!0},key:t}}function Go(e,t,n){let r=e[t];if(r==null||typeof r!=`object`&&typeof r!=`function`)return{complete:!0,isCurrent:e=>Object.is(e[t],r),key:t};let i=n.map(e=>Ho(r,e)),a=new Set(n),o=Object.getPrototypeOf(r),s=(o===Object.prototype||o===null)&&Reflect.ownKeys(r).every(e=>a.has(e))&&i.every(e=>e.complete);return{complete:s,isCurrent(e){let o=e[t];return o!==r||o==null||typeof o!=`object`&&typeof o!=`function`||s&&(Object.getPrototypeOf(o)!==Object.prototype&&Object.getPrototypeOf(o)!==null||!Reflect.ownKeys(o).every(e=>a.has(e)))?!1:n.every((e,t)=>Uo(o,e,i[t]))},key:t}}function Ko(e){return zo.map(t=>{switch(t){case`extractors`:return Wo(e,t,[`name`,`order`,`extract`]);case`preflights`:return Wo(e,t,[`getCSS`,`layer`]);case`variants`:return Wo(e,t,[`match`,`multiPass`,`order`]);case`outputToCssLayers`:return Go(e,t,[`allLayers`,`cssLayerName`]);case`shortcuts`:{let n=e.shortcuts,r=Io(n);return{complete:Ro(r),isCurrent:t=>t.shortcuts===e.shortcuts&&Lo(t.shortcuts,r),key:t}}case`sortLayers`:return Bo(e,t,{functionsByIdentity:!0,ignoreRegExpLastIndex:!0});case`blocklist`:case`postprocess`:case`preprocess`:case`safelist`:return Bo(e,t,{functionsByIdentity:!0,ignoreRegExpLastIndex:!0});default:return Bo(e,t)}})}function qo(e,t){return t.every(t=>t.isCurrent(e))}function Jo(e){return e.every(({complete:e})=>e)}function Yo({authoredOutputOrders:e,config:t,currentSelectors:r,layerSet:i,matched:a,minify:o,parentOrders:s,preflights:c,preflightsMap:l,scope:u,sheet:d,shortcutMergeOrders:f,resolveUnmatched:p}){let m=o?``:`
|
|
19
|
-
`,h=u?u.includes(`,`)?ts(u):[u]:void 0;if(h?.some(e=>!/[^ \t\n\r\f]/.test(e.replace(/\/\*[\s\S]*?\*\//g,``))))throw TypeError(`[Teacss] scope selector list must not contain empty selectors`);let g={...t.layers},_=t.mergeSelectors,v=t.sortLayers,y=e=>Object.hasOwn(g,e)?g[e]??0:0,b=e=>Array.from(n(Reflect.apply(v,t,[e.sort((e,t)=>y(e)-y(t)||Qa(e,t))]))),x=b(Array.from(i)),S=Object.create(null),C=i.size===1?i.values().next().value:void 0,w,T,E=t.outputToCssLayers,D=typeof E==`object`?co(E,`cssLayerName`):void 0,O=typeof E==`object`&&co(E,`allLayers`)?b(k([...Object.keys(g),...x])):void 0,A=new Map,j=e=>{let t=A.get(e);if(t!==void 0)return t;let n=e;D&&typeof E==`object`&&(n=Reflect.apply(D,E,[e]));let r=n===null?null:n??e;return A.set(e,r),r};if(E)for(let e of k([...x,...O??[]]))j(e);let M=t=>{let n=(e,t)=>e.ruleIndex-t.ruleIndex||e.sort-t.sort||$a(e.currentSelector,t.currentSelector)||Number(t.noScope)-Number(e.noScope)||Number(t.noMerge)-Number(e.noMerge)||$a(e.selector,t.selector)||$a(e.body,t.body)||0,i=(e,t)=>e.ruleIndex===t.ruleIndex&&e.sort===t.sort,a=[],o=new Map,s=t.flatMap(e=>f.get(e)?.components??[e]);for(let t of s){let s={authored:e.get(t),body:t[2],currentSelector:r.get(t)??t[5]?.currentSelector,item:t,noMerge:!!(t[6]??Q(t[4],`noMerge`)),noScope:!!Q(t[4],`noScope`),ruleIndex:t[0],selector:t[1],sort:Q(t[4],`sort`)||0},c=s.authored?.group;if(!c){V(a,{authoredGroup:void 0,records:[s],representative:s});continue}let l=o.get(c),u=l?.find(e=>i(e.records[0],s));if(u)V(u.records,s),n(s,u.representative)<0&&(u.representative=s);else{let e={authoredGroup:c,records:[s],representative:s};V(a,e),l?V(l,e):o.set(c,[e])}}for(let e of a)e.authoredGroup&&e.records.sort((e,t)=>e.authored.index-t.authored.index||n(e,t));a.sort((e,t)=>{let r=n(e.representative,t.representative);if(r)return r;let i=[...e.records].sort(n),a=[...t.records].sort(n),o=Math.min(i.length,a.length);for(let e=0;e<o;e++){let t=n(i[e],a[e]);if(t)return t}if(i.length!==a.length)return i.length-a.length;for(let r=0;r<e.records.length;r++){let i=n(e.records[r],t.records[r]);if(i)return i}return 0});let c=a.flatMap(e=>e.records.map(e=>e.item)),l=new Map;for(let e=0;e<c.length;e++){let t=c[e];l.set(t,e)}let u=new Set;for(let e of c){let t=f.get(e),n=t?.components;if(!t?.flatten||!t.original||!n?.length||u.has(t.group))continue;let r=l.get(n[0]);r!==void 0&&n.every((e,t)=>c[r+t]===e)&&u.add(t.group)}let d=new Set,p=[];for(let e of c){let t=f.get(e);if(!t||!u.has(t.group)){V(p,e);continue}d.has(t.group)||(d.add(t.group),V(p,t.original))}return p},N=()=>{if(T)return T;let e=new Map,t=Array.from(d).sort((e,t)=>So(s,e[0]||``,t[0]||``));for(let[n,r]of t)for(let t of r){let r=Q(t[4],`layer`)||`utilities`,i=e.get(r),a=i?.[i.length-1];a?.[0]===n?V(a[1],t):i?V(i,[n,[t]]):e.set(r,[[n,[t]]])}return d.clear(),T=e,e},P=e=>{if(C===void 0)return N().get(e)||[];if(e!==C)return[];if(w)return w;let t=Array.from(d).sort((e,t)=>So(s,e[0]||``,t[0]||``));return d.clear(),w=t,t},F=(e=ze)=>{if(Object.hasOwn(S,e))return S[e];let t=P(e).map(([e,t])=>{let n=[];for(let[,e,r,,i,,a]of M(t)){if(e===``)continue;let t=Q(i,`noScope`)?void 0:h,o=e&&ns(e,t);V(n,[o==null?[]:[[o,Q(i,`sort`)??0]],r,!!(a??Q(i,`noMerge`))||o!=null&&bo(o)])}if(!n.length)return;_&&xo(n);let r=[];for(let e=n.length-1;e>=0;e--){let[t,i]=n[e],a=t.length===1?t[0][0]:``;if(t.length>1){t.sort((e,t)=>e[1]-t[1]||$a(e[0],t[0]));let e=new Set,n=[];for(let[r]of t)r&&!e.has(r)&&(e.add(r),V(n,r));a=n.join(`,${m}`)}let o=a?`${a}{${i}}`:i;o&&V(r,o)}let i=Array.from(new Set(r)).reverse().join(m);return e?Co(e,i,m):i}).filter(Boolean).join(m);c&&(t=[l[e],t].filter(Boolean).join(m));let n;E&&t&&(n=j(e),n!==null&&(t=`@layer ${n}{${m}${t}${m}}`));let r=o?``:`/* layer: ${e}${n&&n!==e?`, alias: ${n}`:``} */${m}`;return S[e]=t?r+t:``},I=(e=x,t)=>{let r=Array.from(n(e)),i=new Set(n(t)),a=r.filter(e=>!i.has(e)),o=a.map(F).filter(Boolean);if(E){let e=k((O??a).map(j).filter(Ir));e.length>0&&to(o,`@layer ${e.join(`, `)};`)}return o.join(m)},L=async(e,t)=>{let n=await t(F(e));return S[e]=n,n},ee;return{get css(){return I()},layers:[...x],matched:a,getLayers:I,getLayer:F,setLayer:L,get diagnostics(){return ee??={unmatched:p()},ee}}}var Xo=class e{userConfig;defaults;version=Fa;events=Er();config=void 0;cache=new se(R,void 0,!0);blocked=new ce(R,void 0,!0);_warnedUnmatched=new ce(R);parentOrders=new Map;activatedRules=new Set;_dynamicIndex;_expansionIndex;_contextConfigs=new WeakMap;_expansionPrefixes=new WeakMap;_generationContexts=new WeakSet;_matchedStaticContexts=new WeakSet;_emptyStaticPayloads=new WeakSet;_configVersion=0;_collectionGeneration=0;_preparedConfigs=new WeakSet;_indexedRules;_indexedRuleSnapshot;_preparedCacheSnapshot;_preparedConfigMutable=!1;_preparedCacheReliable=!0;_startingGenerationParse=0;_startingInputCheck;_contextInputChecks=new WeakMap;_runtimeRevision=0;_variantCacheOwner={};_initialization;_constructedCSSResults=new WeakMap;_constructedCSSSequence=0;_parsedOutputOrders=new WeakMap;_rawUtilMetadata=new WeakMap;_stringifiedCurrentSelectors=new WeakMap;_stringifiedOutputOrders=new WeakMap;_stringifiedParentOrders=new WeakMap;_shortcutMergeOrders=new WeakMap;_utilParentOrders=new WeakMap;reportConfigObserverErrors(e){try{console.error(`[@teacss/core] Configuration observer failed:`,AggregateError(e,`Configuration observers failed`))}catch{}}dispatchConfig(e){let t=[];try{let r=this.events.events,i=Array.from(n(Object.hasOwn(r,`config`)?r.config:void 0));for(let n of i)try{let t=uo(n(e));t&&Promise.resolve(t).catch(e=>{this.reportConfigObserverErrors([e])})}catch(e){V(t,e)}}catch(e){V(t,e)}t.length&&this.reportConfigObserverErrors(t)}clearRuntimeCaches(e){e&&this._runtimeRevision++,this._expansionIndex=void 0,this._variantCacheOwner={},this.blocked.clear(),this._warnedUnmatched.clear(),this.parentOrders.clear(),this.activatedRules.clear(),this.cache.clear()}ensureRuleIndexesCurrent(e=!1){let t=!1,n=!1,r=!0;this._preparedConfigMutable&&e&&this._preparedCacheSnapshot&&(qo(this.config,this._preparedCacheSnapshot)||(n=!0,this._preparedCacheSnapshot=Ko(this.config),t=!0),r=Jo(this._preparedCacheSnapshot));let i=this._indexedRules===this.config.rules;if(!e&&i)return;let a=i&&!!this._indexedRuleSnapshot&&Lo(this.config.rules,this._indexedRuleSnapshot);(!i||!a)&&(n||=!!this._indexedRules,ca(this.config),this._indexedRules=this.config.rules,this._indexedRuleSnapshot=Io(this.config.rules),this._dynamicIndex=void 0,t=!0),this._preparedConfigMutable&&(r=r&&!!this._indexedRuleSnapshot&&Ro(this._indexedRuleSnapshot),this._preparedCacheReliable=r),t&&this.clearRuntimeCaches(n)}collectValidatedParentOrders(e,t){for(let n of e){let e=n[3],r=this._stringifiedParentOrders.get(n);if(e!=null&&r!=null){let n=t.get(e);(n===void 0||r<n)&&t.set(e,r)}}}transferOutputOrder(e,t){let n=this._parsedOutputOrders.get(e);n&&this._stringifiedOutputOrders.set(t,n)}recordStringifiedContext(e,t){t?.currentSelector!==void 0&&this._stringifiedCurrentSelectors.set(e,t.currentSelector)}copyStringifiedUtil(e,t,r=!1,i=!1){let a=e[4],o;if(a){let e=Object.getOwnPropertyDescriptors(a),t=Reflect.ownKeys(e),i=!0;for(let n of t){let t=e[n];if(t.writable!==!0||t.enumerable!==!0||t.configurable!==!0||!Object.hasOwn(t,`value`)){i=!1;break}}if(i){let r=Object.create(null);for(let i of t){let t=e[i].value;r[i]=(i===`prefix`||i===`autocomplete`)&&Array.isArray(t)?[...n(t)]:t}o=r}else{let i=Object.create(null);for(let o of t){let t=e[o];r&&(t={configurable:!!t.configurable,enumerable:!!t.enumerable,value:Object.hasOwn(t,`value`)?t.value:Reflect.get(a,o),writable:!0}),(o===`prefix`||o===`autocomplete`)&&Object.hasOwn(t,`value`)&&Array.isArray(t.value)&&(t={...t,value:[...n(t.value)]}),i[o]=Object.assign(Object.create(null),t)}o=Object.defineProperties(Object.create(null),i)}}let s=e[5];if(i){let n=[e[0],e[1],e[2],e[3],o,s,e[6]];return t&&this.transferStringifiedMetadata(e,n),n}let c=s?{...s,theme:ni(s.theme),variantHandlers:[...n(s.variantHandlers)],variantMatch:[s.variantMatch[0],s.variantMatch[1],[...n(s.variantMatch[2])],new Set(s.variantMatch[3])]}:void 0;s&&c&&(this._contextConfigs.set(c,this.getContextConfig(s)),Object.hasOwn(s,`rules`)?c.rules=s.rules?ni(O(s.rules)):s.rules:delete c.rules,Object.hasOwn(s,`shortcuts`)?c.shortcuts=s.shortcuts?ni(O(s.shortcuts)):s.shortcuts:delete c.shortcuts,Object.hasOwn(s,`variants`)?c.variants=s.variants?ni(O(s.variants)):s.variants:delete c.variants);let l=[e[0],e[1],e[2],e[3],o,c,e[6]];return t&&this.transferStringifiedMetadata(e,l),l}transferStringifiedMetadata(e,t){let n=this._stringifiedCurrentSelectors.get(e);n!==void 0&&this._stringifiedCurrentSelectors.set(t,n);let r=this._stringifiedOutputOrders.get(e);r&&this._stringifiedOutputOrders.set(t,r);let i=this._stringifiedParentOrders.get(e);i!==void 0&&this._stringifiedParentOrders.set(t,i)}copyValidatedStringifiedUtils(e,t,n=!1,r=!1){let i=e,a=i.map(e=>this.copyStringifiedUtil(e,t,n,r));if(t){let e,t;for(let o=0;o<i.length;o++){let s=this._shortcutMergeOrders.get(i[o]);if(!s)continue;if(!e||!t){e=new Map;for(let t=0;t<i.length;t++)e.set(i[t],a[t]);t=new Map}let c=e,l=t.get(s.group);if(!l){let e=e=>{let t=c.get(e);return t||(t=this.copyStringifiedUtil(e,!0,n,r),c.set(e,t)),t},i=s.components?.map(e),a=s.original?e(s.original):void 0;l={...s,components:i,group:{},original:a},t.set(s.group,l);for(let e of i??[])this._shortcutMergeOrders.set(e,l);a&&this._shortcutMergeOrders.set(a,l)}this._shortcutMergeOrders.set(a[o],l)}}return a}getExpansionIndex(e,t){let n=t?this._expansionIndex:void 0;if(n&&n.entries===e&&qa(n.slots,e))return n;let r=new Map,i=[],a=(e,t)=>{let n=r.get(e);n?V(n,t):r.set(e,[t])};for(let t=0;t<e.length;t++){if(!Object.hasOwn(e,t))continue;let n=e[t];if(!Array.isArray(n)||!Object.hasOwn(n,0)||!Object.hasOwn(n,1))continue;let r=Object.hasOwn(n,2)?n[2]:void 0;if(!j(n[0])){V(i,{entry:n,order:t});continue}let o=n[0],s=Q(r,`prefix`),c=s?O(s):void 0;if(!c){a(o,{candidateRank:0,entry:n,kind:`inherited`,order:t,prefix:void 0});continue}for(let e=0;e<c.length;e++)a(c[e]+o,{candidateRank:e,entry:n,kind:`fixed`,order:t,prefix:c[e]});a(o,{candidateRank:c.length,entry:n,kind:`inherited`,order:t,prefix:void 0,requiresPrefixes:c})}let o={dynamics:i,entries:e,slots:Array.from(e),statics:r};return t&&(this._expansionIndex=o),o}getDynamicIndex(e){return this._dynamicIndex?.config!==e&&(this._dynamicIndex={config:e,...Ka(e.rulesDynamic)}),this._dynamicIndex}constructor(e={},t={}){this.userConfig=e,this.defaults=t}async ensureInitialized(){this.config||(this._initialization||=Sa(this.userConfig,this.defaults).then(e=>{if(this.config)return;let t=e.rules,n=Io(t);this.config||(this.config=e,this._indexedRules=t,this._indexedRuleSnapshot=n,this.dispatchConfig(e))}).finally(()=>this._initialization=void 0),await this._initialization)}static constructPublic(e,t){return new Zo(e,t)}static async create(t={},n={}){let r=e.constructPublic(t,n);return await r.ensureInitialized(),r}async setConfig(e,t){e&&this.commitConfig(await this.prepareConfig(e,t))}async prepareConfig(t,n){await Promise.resolve();let r=++this._configVersion,i=n??this.defaults,a=await Sa(t,i),o=e.constructPublic(t,i);o.config=a,o._indexedRules=a.rules,o._indexedRuleSnapshot=Io(a.rules),o._preparedCacheSnapshot=Ko(a),o._preparedConfigMutable=!0,o._preparedCacheReliable=Jo(o._preparedCacheSnapshot)&&Ro(o._indexedRuleSnapshot);let s=Object.freeze({config:a,defaults:i,generator:o,userConfig:t,version:r});return this._preparedConfigs.add(s),s}commitConfig(e){if(!this._preparedConfigs.delete(e)||e.version!==this._configVersion)return!1;let t=e.generator,n=e.config;return t.config!==n||(t.ensureRuleIndexesCurrent(!0),t.config!==n)?!1:(this.defaults=e.defaults,this.userConfig=e.userConfig,this.clearRuntimeCaches(!0),this.config=n,this._indexedRules=t._indexedRules,this._indexedRuleSnapshot=t._indexedRuleSnapshot,this._preparedCacheSnapshot=t._preparedCacheSnapshot,this._preparedConfigMutable=t._preparedConfigMutable,this._preparedCacheReliable=t._preparedCacheReliable,this._dynamicIndex=void 0,this.dispatchConfig(this.config),!0)}async applyExtractors(e,t,n=new Set){return this.applyExtractorsCurrent(e,t,n)}async applyExtractorsCurrent(e,t,n){await this.ensureInitialized(),this.ensureRuleIndexesCurrent(this._preparedConfigMutable);let r=this.config,i=this._runtimeRevision,a=ro(n),o=ro(a),s;try{s=await this.applyExtractorsForConfig(r,e,t,o)}catch(a){if(this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0),this.config!==r||this._runtimeRevision!==i)return this.applyExtractorsCurrent(e,t,n);throw a}return this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0),this.config!==r||this._runtimeRevision!==i?this.applyExtractorsCurrent(e,t,n):(io(n,a,s),n)}async applyExtractorsForConfig(e,t,r,i){let a={original:t,code:t,id:r,extracted:i,envMode:e.envMode};for(let t of n(e.extractors)){let e=E(t,`extract`),r=await(e==null?void 0:Reflect.apply(e,t,[a]));if(r&&r!==i){if(K(r)&&K(i))for(let e of r)i.setCount(e,i.getCount(e)+r.getCount(e));else for(let e of Array.isArray(r)?n(r):r)i.add(e)}}return i}requireInitialized(e){if(this.config)return this.config;throw Error(`[Teacss] TeacssGenerator is not initialized; use await createGenerator() before calling ${e}().`)}makeContextForConfig(e,t,n){let r={rawSelector:e,currentSelector:t[1],theme:n.theme,generator:this,symbols:Z,variantHandlers:t[2],constructCSS:(...e)=>this.constructCustomCSS(r,...e),variantMatch:t};return this._contextConfigs.set(r,n),r}makeContext(e,t){return this.makeContextForConfig(e,t,this.requireInitialized(`makeContext`))}getContextConfig(e){return e&&this._contextConfigs.get(e)||this.requireInitialized(`this synchronous entrypoint`)}async parseToken(e,t){let n=this._startingGenerationParse>0,r=await this.parseTokenInternal(e,t,n,this._startingInputCheck);if(n||r?.length!==0||!this._emptyStaticPayloads.has(r))return r&&!n?this.copyValidatedStringifiedUtils(r,!0):r}async parseTokenInternal(e,t,r,i){await this.ensureInitialized(),i?.(),this.ensureRuleIndexesCurrent(this._preparedConfigMutable&&!r);let a=this.config,o=this._runtimeRevision,s=!this._preparedConfigMutable||this._preparedCacheReliable,c=s&&!t,l=()=>this.config!==a||this._runtimeRevision!==o,u=()=>(this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0),l()),d=()=>this.parseTokenInternal(e,t,r,i);if(s&&this.blocked.has(e)){ue(this.blocked,e);return}let f=e,p=c?this.cache.get(f):void 0;if(c&&(p!==void 0||this.cache.has(f))){B(this.cache,f,p);let e=p&&O(p);if(!e||e.length===0)return e;let t=!0;for(let n=0;n<e.length;n++)if(!ho(e[n])){t=!1;break}let n=t?e:e.filter(ho);if(n.length>0)return r||this.collectValidatedParentOrders(n,this.parentOrders),n;this.cache.delete(f)}let m=e,h=m;for(let t of n(a.preprocess)){let n;try{n=t(h)}catch(e){if(u())return d();throw e}if(l())return d();if(!n){c&&(ue(this.blocked,e),B(this.cache,f,null));return}h=n}let g;try{g=this.isBlocked(h)}catch(e){if(u())return d();throw e}if(l())return d();if(g){c&&(ue(this.blocked,e),B(this.cache,f,null));return}let _;try{_=await this.matchVariantsForConfig(m,h,a)}catch(e){if(u())return d();throw e}if(l())return d();try{_=_.filter(e=>e&&!this.isBlocked(e[1]))}catch(e){if(u())return d();throw e}if(l())return d();if(!_.length){c&&(ue(this.blocked,e),B(this.cache,f,null));return}let v=async e=>{let n=this.makeContextForConfig(m,[t||e[0],e[1],e[2],e[3]],a);r&&this._generationContexts.add(n),i&&this._contextInputChecks.set(n,i);try{a.details&&(n.variants=[...e[3]]);let t=await this.expandMatchedShortcut(n),r=t?await this.stringifyShortcuts(n.variantMatch,n,t[0],t[1],t[2]):(await this.parseUtil(n.variantMatch,n))?.flatMap(e=>this.stringifyUtil(e,n)).filter(Ir);return{direct:!t,utils:r,staticMatched:(a.unmatched===`warn`||a.unmatched===`error`)&&this._matchedStaticContexts.has(n)}}finally{r&&this._generationContexts.delete(n),this._contextInputChecks.delete(n)}},y;try{y=_.length===1?[await v(_[0])]:await Promise.all(_.map(e=>v(e)))}catch(e){if(u())return d();throw e}if(l()||this._preparedConfigMutable&&!r&&(this.ensureRuleIndexesCurrent(!0),l()))return d();let b=[],x={},S=0;for(let{direct:e,utils:t}of y)for(let n of t??[])e&&this._stringifiedOutputOrders.set(n,{group:x,index:S++}),V(b,n);if(b?.length)return r||this.collectValidatedParentOrders(b,this.parentOrders),c&&B(this.cache,f,b),b;if(y.some(({direct:e,staticMatched:t})=>e&&t))return this._emptyStaticPayloads.add(b),c&&B(this.cache,f,b),b;c&&B(this.cache,f,null)}parseTokenForGeneration(e,t){let n=this._startingInputCheck;this._startingInputCheck=t,this._startingGenerationParse++;try{return this.parseToken(e)}finally{this._startingGenerationParse--,this._startingInputCheck=n}}getCachedEquivalentTokens(e){this.config&&this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0);let t=this.cache.get(e);if(!t?.length)return[e];let n=new Set([e]);for(let[r,i]of this.cache.entries())i&&!r.endsWith(` -`)&&mo(i,r,t,e)&&n.add(r);return[...n]}async generate(e,t={}){let n=j(e)?void 0:++this._collectionGeneration,r=$(t,`isInputCurrent`);if(r!==void 0&&typeof r!=`function`)throw TypeError(`[@teacss/core] isInputCurrent must be a function.`);let i,a=r===void 0?void 0:()=>{if(i)throw i.error;try{let e=r();if(typeof e!=`boolean`)throw Promise.resolve(e).catch(Rr),TypeError(`[@teacss/core] isInputCurrent must return a boolean synchronously.`);if(!e)throw Error(`[@teacss/core] Generation input is no longer current.`)}catch(e){throw i={error:e},e}};return this.generateInternal(e,t,n,a)}async generateInternal(e,t,r,i){await this.ensureInitialized(),i?.(),this.ensureRuleIndexesCurrent(this._preparedConfigMutable);let a=this.config,o=this._runtimeRevision,s=!this._preparedConfigMutable||this._preparedCacheReliable,c=()=>(i?.(),this.config!==a||this._runtimeRevision!==o),l=()=>(this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0),c()),u=new Map,d=!s||r===void 0||!(this.cache instanceof se)?void 0:this.cache,f=d?.revision,p=$(t,`id`),m=$(t,`scope`),h=$(t,`preflights`),g=$(t,`safelist`),_=$(t,`minify`),v=$(t,`extendedInfo`),y=$(t,`tokenConcurrency`),b=h===void 0||h,x=g===void 0||g,S=_!==void 0&&_,C=v!==void 0&&v,w=()=>this.generateInternal(e,t,r,i);oo(y);let T;try{T=j(e)?await this.applyExtractorsForConfig(a,e,p,C?new wr:new Set):Array.isArray(e)?yo(new Set(n(e))):K(e)?yo(no(e)):yo(new Set(e))}catch(e){if(l())return w();throw e}if(c())return w();try{if(x){let e={generator:this,theme:a.theme};for(let t=0;t<a.safelist.length;t++){if(!Object.hasOwn(a.safelist,t))continue;let r=a.safelist[t],i=typeof r==`function`?r(e):r;for(let e of n(O(i))){let t=e.trim();if(!t)continue;let n=t.includes(`{`)?yo(new Set([t])):[t];for(let e of n)T.has(e)||T.add(e)}}}}catch(e){if(l())return w();throw e}if(c())return w();let D=S?``:`
|
|
20
|
-
`,k=new Set([ze]),A=C?new Map:new Set,M=new Map,N=[],P=new Map,F=Object.create(null),I=Array.from(T),L;try{L=await fo(I,y,e=>this.parseTokenForGeneration(e,i))}catch(e){if(l())return w();throw e}if(c())return w();let ee=0,te=d!==void 0,ne=a.unmatched===`warn`||a.unmatched===`error`,re=[];try{for(let e=0;e<I.length;e++){let t=I[e],n=L[e];if(n?.length===0&&this._emptyStaticPayloads.has(n)){L[e]=null;continue}if(n==null){ne&&vi(t)&&!this.blocked.has(t)&&!this.isBlocked(t)&&V(re,t);continue}let r=this.copyValidatedStringifiedUtils(n,!0,!0,!0);ee++,te&&!d.isRetained(t)&&(te=!1),A instanceof Map?A.set(t,{data:this.copyValidatedStringifiedUtils(r,!1),count:K(T)?T.getCount(t):-1}):A.add(t),this.collectValidatedParentOrders(r,P);for(let e of r){V(N,e);let t=e[3]||``,n=Q(e[4],`layer`);M.has(t)||M.set(t,[]),V(M.get(t),e),n&&k.add(n)}}}catch(e){if(l())return w();throw e}if(c())return w();for(let[e,t]of P){u.set(e,t);let n=this.parentOrders.get(e);(n===void 0||t<n)&&this.parentOrders.set(e,t)}try{await(async()=>{if(!b)return;let e=O(a.preflights);if(!e.length)return;let t={generator:this,generated:this.copyValidatedStringifiedUtils(N,!1),theme:a.theme},r=new Set,i=new Map;for(let t of n(e)){let e=E(t,`layer`)||`preflights`;k.add(e),r.add(e);let n=i.get(e);n?V(n,t):i.set(e,[t])}F=Object.assign(Object.create(null),Object.fromEntries(await Promise.all(Array.from(r).map(async e=>[e,(await Promise.all(O(i.get(e)||[]).map(async e=>{let n=E(e,`getCSS`);return n?await Reflect.apply(n,e,[t]):void 0}))).filter(Boolean).join(D)]))))})()}catch(e){if(l())return w();throw e}if(c())return w();let ie,ae,R=()=>(ie??=re.flatMap(e=>{let t=ki(e,a);return t===void 0?[]:[{token:e,suggestions:t}]}),ie);if(re.length&&a.unmatched!==`off`&&a.unmatched!==void 0){let e;try{e=await Promise.resolve().then(R),this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0)}catch(e){if(l())return w();throw e}if(c())return w();let t=({token:e,suggestions:t})=>t.length?`"${e}" (did you mean ${t.map(e=>`"${e}"`).join(`, `)}?)`:`"${e}"`;if(a.unmatched===`error`){if(e.length)throw Error(`[@teacss/core] ${e.length} token${e.length===1?``:`s`} matched no rule: ${e.map(t).join(`; `)}`)}else a.warn&&(ae=()=>{for(let n of e)if(i?.(),!this._warnedUnmatched.has(n.token)){if(console.warn(`[Teacss]`,`unmatched token ${t(n)}`),c())return;ue(this._warnedUnmatched,n.token)}})}let z;try{z=Yo({authoredOutputOrders:this._stringifiedOutputOrders,config:a,currentSelectors:this._stringifiedCurrentSelectors,layerSet:k,matched:A,minify:S,parentOrders:u,preflights:b,preflightsMap:F,scope:m,sheet:M,shortcutMergeOrders:this._shortcutMergeOrders,resolveUnmatched:R}),await Promise.resolve(),this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0)}catch(e){if(l())return w();throw e}if(c())return w();if(ae){try{ae(),await Promise.resolve(),this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0)}catch(e){if(l())return w();throw e}if(c())return w()}return d&&f!==void 0&&this.cache===d&&r===this._collectionGeneration&&(!te||ee!==d.retainedSize)&&d.replaceRetained(ao(I,L),f),z}async matchVariants(e,t){return this.matchVariantsCurrent(e,t)}async matchVariantsCurrent(e,t){await this.ensureInitialized(),this.ensureRuleIndexesCurrent(this._preparedConfigMutable);let n=this.config,r=this._runtimeRevision,i;try{i=await this.matchVariantsForConfig(e,t,n)}catch(i){if(this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0),this.config!==n||this._runtimeRevision!==r)return this.matchVariantsCurrent(e,t);throw i}return this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0),this.config!==n||this._runtimeRevision!==r?this.matchVariantsCurrent(e,t):i}async matchVariantsForConfig(e,t,r){let i={rawSelector:e,theme:r.theme,generator:this};pe(i,r===this.config?this._variantCacheOwner:r);let a=r.variants,o=async t=>{let r=!0,[,,s,c]=t;for(;r;){r=!1;let l=t[1];for(let e of n(a)){let a=E(e,`multiPass`)??!1;if(!a&&c.has(e))continue;let u=E(e,`match`);if(!u)continue;let d=Reflect.apply(u,e,[l,i]),f=uo(d),p=f?await f:d;if(p){if(j(p)){if(p===l)continue;p={matcher:p}}if(Array.isArray(p)){let r=Array.from(n(p));if(!r.length)continue;if(r.length===1)p=r[0];else{if(a)throw Error(`multiPass can not be used together with array return variants`);let n=r.map(n=>{let r=E(n,`matcher`)??l,i=[n,...s],a=new Set(c);return a.add(e),[t[0],r,i,a]});return(await Promise.all(n.map(e=>o(e)))).flat()}}t[1]=E(p,`matcher`)??l,to(s,p),c.add(e),r=!0;break}}if(!r)break;if(s.length>500)throw Error(`Too many variants applied to "${e}"`)}return[t]};return await o([e,t||e,[],new Set])}applyVariants(e,t=e[4],r=e[1],i=is(r),a){let o=Array.from(n(t),lo),s=o.length>1?o.sort((e,t)=>(e.order||0)-(t.order||0)):o,c=O(this.getContextConfig(a).postprocess),l={prefix:``,selector:i,pseudo:``,entries:s.length||c.length?ni(O(e[2])):e[2]},u=s.length?s.reduceRight((e,t)=>n=>{let r=E(n,`entries`)??[],i=E(n,`parent`),a=E(n,`parentOrder`),o=E(n,`selector`)??``,s=(t.body==null?void 0:Reflect.apply(t.body,t.source,[r]))||r,c=t.parent||i,l=t.selector==null?void 0:Reflect.apply(t.selector,t.source,[o,s]);return Reflect.apply(t.handle??as,t.source,[{...n,entries:s,selector:l??o,parent:c,parentOrder:t.parentOrder??(c===i?a:void 0),layer:t.layer||E(n,`layer`),sort:t.sort??E(n,`sort`)},e])},e=>e)(l):l,d=E(u,`parent`),f=E(u,`parentOrder`),p={selector:[E(u,`prefix`)??``,E(u,`selector`)??``,E(u,`pseudo`)??``].join(``),entries:E(u,`entries`)??[],parent:d,layer:E(u,`layer`),sort:E(u,`sort`),noMerge:E(u,`noMerge`)};d!=null&&f!=null&&this._utilParentOrders.set(p,f);let m=[p];for(let e of n(c)){let t=[];for(let r of m){let i=this._utilParentOrders.get(r),a=r.parent;i!=null&&this._utilParentOrders.delete(r);let o=e(r);if(Array.isArray(o))for(let e of n(o))e!=null&&(i!=null&&e.parent===a&&this._utilParentOrders.set(e,i),V(t,e));else{let e=o||r;i!=null&&e.parent===a&&this._utilParentOrders.set(e,i),V(t,e)}}m=t}return m}constructCustomCSS(e,t,n){let r=Kr(t);return this.constructNormalizedCSS(e,r,n)}constructNormalizedCSS(e,t,n){if(j(t))return t;let r=[];for(let e=0;e<t.length;e++){if(!Object.hasOwn(t,e))continue;let n=t[e];if(!Object.hasOwn(n,0))continue;let i=n[0];typeof i==`string`?V(r,n):i===Z.body&&V(r,[Yr,Object.hasOwn(n,1)?n[1]:void 0])}let i=this.applyVariants([0,n||e.rawSelector,r,void 0,e.variantHandlers],void 0,void 0,void 0,e).map(e=>{let{selector:t,entries:n,parent:r,layer:i,sort:a,noMerge:o}=e;return{body:Zr(n),layer:i,noMerge:o,parent:r,parentOrder:this._utilParentOrders.get(e),selector:t,sort:a}}).filter(e=>!!e.body);if(!i.length)return``;let a=i.map(e=>{let t=`${e.selector}{${e.body}}`;return e.parent?Co(e.parent,t):t}).join(``),o=e,s=this._constructedCSSResults.get(o);s||(s=new Map,this._constructedCSSResults.set(o,s));let c=a;return s.has(c)&&(c=`${a}\n${(++this._constructedCSSSequence).toString(2).replaceAll(`0`,` `).replaceAll(`1`,` `)}\n`),s.set(c,i),c}async parseUtil(e,t,n=!1,r){await this.ensureInitialized();let i=Object.hasOwn(t,`rules`),a=t.rules,o=a?.length;this.getContextConfig(t)===this.config&&this._preparedConfigMutable&&!this._generationContexts.has(t)&&this.ensureRuleIndexesCurrent(!0);let s=this.getContextConfig(t),c=s===this.config&&this._preparedConfigMutable&&!this._generationContexts.has(t),l=this._runtimeRevision,u=async e=>{let[i,a,o]=e;s.details&&(t.rules=t.rules??[]);let c={...t,currentSelector:a,variantHandlers:o,variantMatch:e};this._contextConfigs.set(c,s);let u;c.constructCSS=(...e)=>{if(!n||!t.variantHandlers.length)return this.constructCustomCSS(c,...e);let r=Kr(e[0]);if(!j(r)&&_o(r))return this.constructNormalizedCSS(c,r,e[1]);u||(u={...c,variantHandlers:vo(c.variantHandlers,t.variantHandlers)},this._contextConfigs.set(u,s));let i=this.constructNormalizedCSS(u,r,e[1]),a=this._constructedCSSResults.get(u)?.get(i);if(a){let e=this._constructedCSSResults.get(c);e||(e=new Map,this._constructedCSSResults.set(c,e)),e.set(i,a)}return i};let d=s.rulesStaticMap[a];if(r){d=void 0;let e=O(r);for(let t=s.rules.length-1;t>=0;t--){let n=s.rules[t];if(!ri(n)||n[0]!==a)continue;let r=Q(n[2],`prefix`);if(!r||O(r).some(t=>e.includes(t))){d=n;break}}}let f=d,p=()=>{let e=f;if(f=void 0,!(!e?.[1]||!n&&Q(e[2],`internal`)))return!n&&(s.unmatched===`warn`||s.unmatched===`error`)&&this._matchedStaticContexts.add(t),this.resolveCSSResult(i,e[1],e,c,l)},m=a.indexOf(`:`),h=this.getDynamicIndex(s),g=m>0&&h.map.get(a.slice(0,m))||h.fallback;for(let e of g){let[t,o,s]=e;if((Q(f?.[2],`__index`)??-1)>(Q(s,`__index`)??-1)){let e=p();if(e)return e}if(Q(s,`internal`)&&!n)continue;let u=[a],d=Q(s,`prefix`);if(d){let e=O(d);if(r){let t=O(r);if(!e.some(e=>t.includes(e)))continue}else if(u=e.filter(e=>a.startsWith(e)).map(e=>a.slice(e.length)),!u.length)continue}for(let n of u){let r=di(n,t);if(!r)continue;let a=o(r,c),s=uo(a),u=s?await s:a;if(!u)continue;if(typeof u==`object`||typeof u==`function`){let e=Array.isArray(u)?void 0:E(u,Symbol.asyncIterator);if(e){let t=[];for await(let n of{[Symbol.asyncIterator]:()=>Reflect.apply(e,u,[])})n&&V(t,n);u=t}else{let e=Array.isArray(u)?void 0:E(u,Symbol.iterator);if(e){let t=[];for(let n of{[Symbol.iterator]:()=>Reflect.apply(e,u,[])})n!=null&&V(t,n);u=t}}}let d=this.resolveCSSResult(i,u,e,c,l);if(d)return d}}return p()},d,f;try{let t=j(e)?await this.matchVariantsForConfig(e,void 0,s):[e];d=t.length===1?await u(t[0]):(await Promise.all(t.map(u))).flat().filter(Ir)}catch(e){f=[e]}if(c&&(this.ensureRuleIndexesCurrent(!0),this.config===s&&this._runtimeRevision!==l))return a&&o!==void 0?(a.length=o,t.rules=a):i?t.rules=a:delete t.rules,this.parseUtil(e,t,n,r);if(f)throw f[0];if(d?.length)return d}resolveCSSResult=(e,t,r,i,a)=>{let o=qr(t).filter(e=>e.length);if(o.length){let t=this.getContextConfig(i);t.details&&(t!==this.config||a===this._runtimeRevision)&&V(i.rules,r),t===this.config&&a===this._runtimeRevision&&i.generator.activatedRules.add(r);let s=r[2],c=Q(s,`__index`),l={},u=0,d=e=>(this._parsedOutputOrders.set(e,{group:l,index:u++}),e);return o.flatMap(t=>{if(j(t)){let e=this._constructedCSSResults.get(i)?.get(t);return e?e.map(e=>{let t=[c,e.body,s];return this._rawUtilMetadata.set(t,e),d(t)}):[d([c,t,s])]}let r=[],a=i.variantHandlers,o=s,l=e=>{a=[e,...a]},u=e=>{a=[...a,e]},f=e=>{o={...o,...e}};for(let e=0;e<t.length;e++){if(!Object.hasOwn(t,e))continue;let i=t[e],o=Object.hasOwn(i,0)?i[0]:void 0,s=()=>Object.hasOwn(i,1)?i[1]:void 0;switch(o){case Z.variants:{let e=s();if(typeof e==`function`){let t=e([...n(a)]);t&&(a=[...n(t)])}else a=[...n(e),...a];break}case Z.parent:l({parent:s()});break;case Z.selector:u({selector:s()});break;case Z.layer:l({layer:s()});break;case Z.sort:f({sort:s()});break;case Z.noMerge:f({noMerge:s()});break;case Z.noScope:f({noScope:s()});break;case Z.shortcutsNoMerge:V(r,i);break;case Z.body:V(r,[Yr,s()]);break;default:j(o)&&V(r,i)}}return[d([c,e,r,o,a])]})}};stringifyUtil(e,t){if(!e)return;let n=this.getContextConfig(t);if(Fr(e)){let r=this._rawUtilMetadata.get(e),i=e[2];if(r?.layer!==void 0||r?.sort!==void 0){let t={...e[2]??{}},n=Q(e[2],`layer`),a=Q(e[2],`sort`);delete t.layer,delete t.sort,i={...t,layer:r.layer??n,sort:r.sort??a}}let a=[e[0],r?.selector,r?.body??e[1],r?.parent,i,n.details?t:void 0,r?.noMerge];return this.transferOutputOrder(e,a),this.recordStringifiedContext(a,t),r?.parent!=null&&r.parentOrder!=null&&this._stringifiedParentOrders.set(a,r.parentOrder),[a]}let r=this.applyVariants(e,void 0,void 0,void 0,t),i=[];for(let a of r){let{selector:r,entries:o,parent:s,layer:c,sort:l,noMerge:u}=a,d=Zr(o);if(!d)continue;let f=e[3];if(c!==void 0||l!==void 0){let{layer:t,sort:n,...r}=e[3]??{};f={...r,layer:c??t,sort:l??n}}let p=[e[0],r,d,s,f,n.details?t:void 0,u];this.transferOutputOrder(e,p),this.recordStringifiedContext(p,t);let m=this._utilParentOrders.get(a);s!=null&&m!=null&&this._stringifiedParentOrders.set(p,m),V(i,p)}return i}async expandShortcut(e,t,n=5){return await this.ensureInitialized(),this.expandConfiguredExpansions(e,t,n,this.getContextConfig(t).shortcuts,`shortcut`)}async expandMatchedShortcut(e,t=5){return this.expandConfiguredExpansionsForInput(e.variantMatch,e,t,this.getContextConfig(e).shortcuts,`shortcut`)}async expandConfiguredExpansions(e,t,n,r,i,a,o){await this.ensureInitialized(),this.getContextConfig(t)===this.config&&this._preparedConfigMutable&&!this._generationContexts.has(t)&&this.ensureRuleIndexesCurrent(!0);let s=await this.expandConfiguredExpansionsForInput(e,t,n,r,i,a,o);if(!s)return;let c=[s[0],s[1]];return this._expansionPrefixes.set(c,s[2]),this._expansionPrefixes.set(c[0],s[2]),c}async expandConfiguredExpansionsForInput(e,t,r,i,a,o,s){let c=O(i);if(r<=0||!c.length)return;let l=this.getContextConfig(t),u=j(e)?e:e[1],d=l.details?e=>{t.shortcuts=t.shortcuts??[],V(t.shortcuts,e)}:Rr,f,p,m,h,g=s,_=this.getExpansionIndex(c,i===l.shortcuts),v,y=_.statics.get(u);if(y){for(let e of y)if((!e.requiresPrefixes||s&&e.requiresPrefixes.includes(s))&&e.entry[1]){v=e;break}}let b=v?v.order:1/0,x=[{prefix:s,value:u}];expansionLoop:for(let{entry:e,order:n}of _.dynamics){if(n>=b)break;let r=Object.hasOwn(e,2)?e[2]:void 0,i=x,a=Q(r,`prefix`);if(a){let e=O(a);if(i=e.filter(e=>u.startsWith(e)).map(e=>({prefix:e,value:u.slice(e.length)})),s&&e.includes(s)&&V(i,{prefix:s,value:u}),!i.length)continue}for(let n of i){if(j(e[0])){if(e[0]!==n.value)continue;p=e[1]}else{let r=di(n.value,e[0]);r&&(p=e[1](r,t))}if(p){g=n.prefix,f||=r,d(e);break expansionLoop}}}if(!p&&v){let e=v.entry;p=e[1],p&&(g=v.kind===`fixed`?v.prefix:s,f=Object.hasOwn(e,2)?e[2]:void 0,d(e))}if(p){let e=[...n(O(p))];m=e.filter(e=>j(e)).flatMap(e=>ji(ea(Tn(e.trim()),l.separators))).map(e=>({prefix:g,value:e})),h=e.filter(e=>!j(e)).map(e=>({handles:[],value:e}))}if(!p&&j(e)){let n=await this.matchVariantsForConfig(e,void 0,l);for(let e of n){let[n,c,l]=e;if(n!==c){let e=await this.expandConfiguredExpansions(c,t,r-1,i,a,o,s);if(e){let t=this._expansionPrefixes.get(e)??[];m??=[];for(let r=0;r<e[0].length;r++){let i=e[0][r];j(i)&&V(m,{prefix:t[r]??s,value:n.replace(c,()=>i)})}h??=[],eo(h,e[0].filter(e=>!j(e)).map(e=>({handles:[...e.handles,...l],value:e.value})))}}}}if(!m?.length&&!h?.length)return;let S=new Map,C=(m??[]).filter(({prefix:e,value:t})=>{let n=S.get(e);return n||(n=new Set,S.set(e,n)),!n.has(t)&&(n.add(t),!0)}),w=[...(await Promise.all(C.map(async({prefix:e,value:n})=>{let s=await this.expandConfiguredExpansions(n,t,r-1,i,a,o,e),c=s?void 0:await o?.(n,t,r-1),l=s??c;if(!l)return[{prefix:e,value:n}];let u=this._expansionPrefixes.get(l)??[];return l[0].map((t,n)=>({prefix:u[n]??e,value:t}))}))).flat(),...(h??[]).map(e=>({prefix:g,value:e}))].filter(({value:e})=>!!e);return[w.map(({value:e})=>e),f,w.map(({prefix:e})=>e)]}async stringifyShortcuts(e,t,n,r,i){await this.ensureInitialized();let a=this.getContextConfig(t),o=this._runtimeRevision,s=[];r={...r,layer:Q(r,`layer`)??a.shortcutsLayer};let c=i??this._expansionPrefixes.get(n)??[],l=new Vr,u=(await Promise.all(n.map(async(n,i)=>{let o=j(n)?await this.parseUtil(n,t,!0,c[i]??Q(r,`prefix`)):[[1/0,`{inline}`,Kr(n.value),void 0,n.handles]];return!o&&a.warn&&V(s,[i,`unmatched utility "${n}" in shortcut "${e[1]}"`]),o||[]}))).flat(1).filter(Boolean).sort((e,t)=>e[0]-t[0]);a.details&&t.rules&&t.rules.length>1&&t.rules.sort((e,t)=>(Q(e[2],`__index`)??1/0)-(Q(t[2],`__index`)??1/0));let[d,,f]=e,p=u.some(Fr),m={},h=0,g=[],_=e=>{let t=this._shortcutMergeOrders.get(e)?.components;if(!t?.length){this._stringifiedOutputOrders.set(e,{group:m,index:h++});return}let n;for(let e of t){let t={group:m,index:h++};n??=t,this._stringifiedOutputOrders.set(e,t)}n&&this._stringifiedOutputOrders.set(e,n)};for(let e of u){if(Fr(e)){let n=this._rawUtilMetadata.get(e),i={...e[2],...r,layer:n?.layer??Q(r,`layer`),sort:n?.sort??Q(r,`sort`)??Q(e[2],`sort`)},o=[e[0],n?.selector,n?.body??e[1],n?.parent,i,a.details?t:void 0,n?.noMerge];this.recordStringifiedContext(o,t),n?.parent!=null&&n.parentOrder!=null&&this._stringifiedParentOrders.set(o,n.parentOrder),_(o),V(g,o);continue}let n=_o(e[2]),i=n?e[4]:vo(e[4],f);for(let o of this.applyVariants(e,i,d,void 0,t)){let{selector:i,entries:s,parent:c,sort:u,noMerge:d,layer:f}=o,m=!!(d??Q(r,`noMerge`)??Q(e[3],`noMerge`)),h=!!(Q(r,`noScope`)??Q(e[3],`noScope`)),v=Q(r,`sort`),y=Q(r,`layer`),b=n?v??0:u??v??Q(e[3],`sort`)??0;if(p){let n=Zr(s);if(!n)continue;let l=[e[0],i,n,c,{...r,noMerge:m,noScope:h,sort:b,layer:f??y},a.details?t:void 0,void 0];this.recordStringifiedContext(l,t);let u=this._utilParentOrders.get(o);c!=null&&u!=null&&this._stringifiedParentOrders.set(l,u),_(l),V(g,l);continue}let x=l.getFallback(f??y,{ordered:[],streams:new Map}),S=x.streams.get(c);S||(S=[],x.streams.set(c,S));let C=S[S.length-1];(!C||C.selector!==i||C.noScope!==h)&&(C={entries:[],noScope:h,parent:c,parentOrder:void 0,selector:i},V(S,C),V(x.ordered,C)),V(C.entries,[s,m,b,e[0]]);let w=this._utilParentOrders.get(o);w!=null&&(C.parentOrder==null||w<C.parentOrder)&&(C.parentOrder=w)}}let v=l.flatMap((e,n)=>e.ordered.map(({entries:e,noScope:i,parentOrder:o,selector:s,parent:c})=>{let l=(e,l,u)=>{if(!u.length)return[];let d=-1/0,f=-1/0;for(let[,e,t]of u)d=Math.max(d,e),f=Math.max(f,t);let p=e&&u.length>1?u.map(([e,t,n])=>[e.map(e=>[e[0],e[1]]),t,n]):u,m=p.map(e=>e[0]);return(e?[m.flat(1)]:m).map((u,m)=>{let h=Zr(u);if(h){let u={...r,noMerge:l,noScope:i,sort:d,layer:n},g=[f,s,h,c,u,a.details?t:void 0,void 0];this.recordStringifiedContext(g,t),c!=null&&o!=null&&this._stringifiedParentOrders.set(g,o);let _=e?p:[p[m]],v={flatten:e,group:{}};return v.components=e&&_.length>1?_.map(([n,r,i])=>{let l=e?Zr(n):h;if(!l)return;let d=[i,s,l,c,{...u,sort:r},a.details?t:void 0,void 0];return this.recordStringifiedContext(d,t),c!=null&&o!=null&&this._stringifiedParentOrders.set(d,o),this._shortcutMergeOrders.set(d,v),d}).filter(Ir):void 0,v.original=g,this._shortcutMergeOrders.set(g,v),g}})},u=[],d=[],f=[],p=[];for(let[t,n,r,i]of e){let e=O(t).some(go);V(n?e?u:d:e?f:p,[t,r,i])}return[...l(!1,!0,u),...l(!0,!0,d),...l(!1,!1,f),...l(!0,!1,p)].filter(Ir)}).flat(1).filter(Boolean));for(let e of v)_(e);let y=g.concat(v);if(s.length){await Promise.resolve(),a===this.config&&this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0);for(let[,e]of s.sort((e,t)=>e[0]-t[0])){if(this._contextInputChecks.get(t)?.(),a!==this.config||o!==this._runtimeRevision)break;na(e)}}return y}isBlocked(e){if(!e)return!0;let{blocklist:t}=this.requireInitialized(`isBlocked`);for(let n=0;n<t.length;n++){if(!Object.hasOwn(t,n))continue;let r=t[n],i=Array.isArray(r)?Object.hasOwn(r,0)?r[0]:void 0:r;if(i!==void 0&&this.matchesBlocklist(i,e))return!0}return!1}getBlocked(e){let{blocklist:t}=this.requireInitialized(`getBlocked`);for(let n=0;n<t.length;n++){if(!Object.hasOwn(t,n))continue;let r=t[n],i=Array.isArray(r)?Object.hasOwn(r,0)?r[0]:void 0:r;if(i!==void 0&&this.matchesBlocklist(i,e))return[i,Array.isArray(r)&&Object.hasOwn(r,1)?r[1]:void 0]}}matchesBlocklist(e,t){return typeof e==`function`?!!e(t):j(e)?e===t:di(t,e)!==null}},Zo=class extends Xo{constructor(e={},t={}){super(e,t)}};async function Qo(e,t){return await Xo.create(e,t)}const $o=/\s\$\$\s+/g;function es(e){return To(e).length>0}function ts(e){let t=[],n=0,r=!1,i=0,a,o=0,s=0;for(let c=0;c<e.length;c++){let l=e[c];if(r)l===`*`&&e[c+1]===`/`&&(r=!1,c++);else if(a)l===`\\`?c++:l===a&&(a=void 0);else if(l===`/`&&e[c+1]===`*`)r=!0,c++;else if(l===`\\`){let t=c+1;for(;t<c+7&&/[\da-f]/i.test(e[t]??``);)t++;t>c+1?(/[ \t\n\r\f]/.test(e[t]??``)&&(e[t]===`\r`&&e[t+1]===`
|
|
21
|
-
`&&t++,t++),c=t-1):c++}else if(l===`"`||l===`'`)a=l;else if(l===`[`)n++;else if(l===`]`)n>0&&n--;else if(l===`(`)i++;else if(l===`)`)i>0&&i--;else if(l===`,`&&n===0&&i===0){
|
|
1
|
+
import e from"node:crypto";function t(e,t){Object.defineProperty(e,e.length,{configurable:!0,enumerable:!0,value:t,writable:!0})}function*n(e){if(Array.isArray(e))for(let t=0,n=e.length;t<n;t++)Object.hasOwn(e,t)&&(yield e[t])}const r=new Set([`>`,`+`,`~`]);function i(e){if(e===void 0)return!1;let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||e===`-`||e===`_`||t>=128}function a(e){if(e===void 0)return!1;let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||e===`_`||t>=128}function o(e,t){let n=e[t];if(n===`-`){let n=e[t+1];return n===`-`||n===`\\`||a(n)}return a(n)}function s(e,t){let n=/^(?:[\da-f]{1,6}(?:\r\n|[ \t\n\r\f])?|[^\n\r\f])/i.exec(e.slice(t+1));return n?t+1+n[0].length:void 0}function c(e,t){let n=t;if(e[n]===`\\`||o(e,n)){for(;n<e.length;){if(e[n]===`\\`){let t=s(e,n);if(t===void 0)return;n=t;continue}if(!i(e[n]))break;n++}return n>t?n:void 0}}function l(e){return e.replace(/\\([\da-f]{1,6})(?:\r\n|[ \t\n\r\f])?|\\([^\n\r\f])/gi,(e,t,n)=>{if(!t)return n;let r=Number.parseInt(t,16);return String.fromCodePoint(r===0||r>1114111||r>=55296&&r<=57343?65533:r)})}function u(e,t){let n=e[t];for(let r=t+1;r<e.length;r++){let t=e[r];if(t===n)return r+1;if(t===`\\`){let t=/^(?:[\da-f]{1,6}(?:\r\n|[ \t\n\r\f])?|\r\n|[\s\S])/i.exec(e.slice(r+1));if(!t)return;r+=t[0].length}else if(/[\n\r\f]/.test(t))return}}function d(e,t,n,r){if(e[t]!==n)return;let i=0;for(let a=t;a<e.length;a++){let t=e[a];if(t===`\\`){let t=s(e,a);if(t===void 0)return;a=t-1}else if(t===`/`&&e[a+1]===`*`){let t=e.indexOf(`*/`,a+2);if(t===-1)return;a=t+1}else if(t===`"`||t===`'`){let t=u(e,a);if(t===void 0)return;a=t-1}else if(t===n)i++;else if(t===r&&--i===0)return a+1}}function f(e,t){let n=t;for(;e[n]===`/`&&e[n+1]===`*`;){let t=e.indexOf(`*/`,n+2);if(t===-1)return n;n=t+2}return n}function p(e,t){let n=c(e,f(e,t+1));if(n!==void 0)return e[n]===`(`?d(e,n,`(`,`)`):n}function m(e,t){let n=f(e,t),r=n;if(e[n]===`*`&&!(e[n+1]===`/`&&n>t))n++;else{let t=c(e,n);t!==void 0&&(n=t)}let i=+(n>r);for(;n<e.length;){let t=f(e,n);if(t!==n){n=t;continue}let r=e[n];if(r===`.`||r===`#`){let t=c(e,r===`.`?f(e,n+1):n+1);if(t===void 0)return;n=t}else if(r===`[`){let t=d(e,n,`[`,`]`);if(t===void 0||!/[^ \t\n\r\f]/.test(e.slice(n+1,t-1).replace(/\/\*[\s\S]*?\*\//g,``)))return;n=t}else if(r===`:`){let t=p(e,n);if(t===void 0)return;n=t}else break;i++}return i>0?n:void 0}function h(e){let t=f(e,0);if(t===e.length)return!1;for(;t<e.length;){if(e[t]!==`:`)return!1;let n=p(e,t);if(n===void 0)return!1;t=f(e,n)}return!0}function g(e){if(!e)return!1;let t=0;for(;;){let n=m(e,t);if(n===void 0)return!1;if(t=f(e,n),t===e.length)return!0;if(!r.has(e[t])||(t=f(e,t+1),t===e.length))return!1}}const _=new Set([`before`,`after`,`first-line`,`first-letter`]);function v(e,t){let n=C(e,t);return n!==void 0&&_.has(n.name)}function y(e,t){let n=0,r=0,i;for(let a=0;a<e.length;a++){let o=e[a];if(i)o===`\\`?a++:o===i&&(i=void 0);else if(o===`\\`)a++;else if(o===`/`&&e[a+1]===`*`){let t=e.indexOf(`*/`,a+2);if(t===-1)return;a=t+1}else if(o===`"`||o===`'`)i=o;else if(o===`[`)n++;else if(o===`]`)n>0&&n--;else if(o===`(`)r++;else if(o===`)`)r>0&&r--;else if(o===`:`&&n===0&&r===0){let n=f(e,a+1);if(e[n]===`:`){if(t(a))return;a=n}else if(v(e,a)&&t(a))return}}}function b(e){let t=-1;return y(e,e=>(t=e,!0)),t}function x(e){let t=!0;return y(e,n=>!C(e,n)&&(t=!1,!0)),t}function S(e){let t=0;return y(e,()=>(t++,!1)),t}function C(e,t){let n=f(e,t+1);e[n]===`:`&&(n=f(e,n+1));let r=c(e,n);if(r!==void 0)return{end:r,name:l(e.slice(n,r)).toLowerCase()}}function w(e,t,n,r){let i=0,a;for(let o=t;o<n;o++){let s=e[o];if(a){s===`\\`?o++:s===a&&(a=void 0);continue}if(s===`\\`)o++;else if(s===`/`&&e[o+1]===`*`){let t=e.indexOf(`*/`,o+2);if(t===-1||t>=n)return!1;o=t+1}else if(s===`"`||s===`'`)a=s;else if(s===`(`)i++;else if(s===`)`){if(i--,i===0){let i=e.slice(t+1,o).replaceAll(/\/\*[\s\S]*?\*\//g,``),a=e.slice(o+1,n),s=f(a,0)===a.length;return/[^ \t\n\r\f]/.test(i)&&(s||r&&h(a))}if(i<0)return!1}}return!1}function T(e){let n=[],r=0,i=!1;if(y(e,a=>{r++;let o=C(e,a);return o?t(n,{...o,index:a}):i=!0,r>2}),r<=1)return!0;if(i||r!==2||n.length!==2)return!1;let[a,o]=n,s=a.name,c=o.name;return s!==`part`&&s!==`slotted`||e[f(e,a.index+1)]!==`:`||e[a.end]!==`(`||!w(e,a.end,o.index,s===`part`)?!1:c===`before`||c===`after`||c===`marker`||c===`placeholder`||c===`file-selector-button`||s===`part`&&(c===`first-line`||c===`first-letter`)}function E(e,t){let n=e;for(;n!==null&&n!==Object.prototype&&n!==Array.prototype&&n!==Function.prototype;){if(Object.hasOwn(n,t))return Reflect.get(e,t);n=Object.getPrototypeOf(n)}}function D(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function O(e=void 0){if(e===void 0)return[];if(!Array.isArray(e))return[e];for(let t=0,n=e.length;t<n;t++){if(Object.hasOwn(e,t))continue;let r=[],i=0;for(let t=0;t<n;t++)Object.hasOwn(e,t)&&D(r,i++,e[t]);return r}return e}function k(e){return Array.from(new Set(n(e)))}function A(e,r){let i=[];for(let a of n(e))i.findIndex(e=>r(a,e))===-1&&t(i,a);return i}function j(e){return typeof e==`string`}const M={">":` > `,_:` `,"+":` + `,"~":` ~ `};function ee(e){let t=e[0];return t!==void 0&&Object.hasOwn(M,t)?M[t]:void 0}function N(e){let t=e.startsWith(`!`),n=t?e.slice(1):e,r;return r=n[0]===`:`&&n[f(n,1)]===`:`?`pseudo-element`:n[0]===`.`||n[0]===`#`?`self`:ee(n)===void 0?n[0]===`[`?`arbitrary`:`named`:`target`,{raw:e,kind:r,negate:t,value:n}}function P(e){return Array.from(n(e),N)}function F(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`){let t=s(e,r);if(t===void 0)return!1;r=t-1;continue}if(i===`/`&&e[r+1]===`*`){let t=e.indexOf(`*/`,r+2);if(t===-1)return!1;r=t+1;continue}if(i===`"`||i===`'`){let t=u(e,r);if(t===void 0)return!1;r=t-1;continue}if(i===`[`||i===`(`){t(n,i);continue}if(i===`]`||i===`)`){if(n.pop()!==(i===`]`?`[`:`(`))return!1;continue}if(n.length===0&&/[,;{}>+~ \t\n\r\f]/.test(i))return!1}return n.length===0}function I(e){if(e.kind!==`self`&&e.kind!==`pseudo-element`&&e.kind!==`target`)return!1;let t=e.kind===`target`?e.value.slice(1):e.value;if(!t||e.kind===`self`&&t.length===1||!x(t)||!F(t))return!0;if(e.kind===`self`){let n=b(t);return e.negate&&n!==-1?!0:!g(n===-1?t:t.slice(0,n))}return!1}function te(e){switch(e.kind){case`self`:{if(e.negate)return{suffix:`:not(${e.value})`};let t=b(e.value);return t===-1?{suffix:e.value}:{suffix:e.value.slice(0,t),pseudoElement:e.value.slice(t)}}case`pseudo-element`:return{pseudoElement:e.value};case`target`:{let t=ee(e.value);if(t===void 0)return;let n=e.value.slice(1),r=b(n);return g(r===-1?n:n.slice(0,r))?r===-1?{combinator:`${t}${n}`}:{combinator:`${t}${n.slice(0,r)}`,pseudoElement:n.slice(r)}:void 0}default:return}}function ne(e){let t={},n=E(e,`prefix`),r=E(e,`suffix`),i=E(e,`combinator`),a=E(e,`pseudoElement`),o=E(e,`parent`);return Object.defineProperties(t,{prefix:{configurable:!0,enumerable:n!==void 0,value:n,writable:!0},suffix:{configurable:!0,enumerable:r!==void 0,value:r,writable:!0},combinator:{configurable:!0,enumerable:i!==void 0,value:i,writable:!0},pseudoElement:{configurable:!0,enumerable:a!==void 0,value:a,writable:!0},parent:{configurable:!0,enumerable:o!==void 0,value:o,writable:!0}}),t}function re(e){let t=e.suffix;if(!t)return e;let n=b(t);return n===-1?e:{...e,suffix:t.slice(0,n)||void 0,pseudoElement:`${t.slice(n)}${e.pseudoElement??``}`}}function ie(e){let t=e.pseudoElement;if(!t)return e;let n=S(t);if(n>1&&!T(t))throw Error(`[Teacss] a token may use at most one pseudo-element, found ${n}`);return e}function ae(e,r=[],i){let a=O(e),o=O(r),s={conditions:a,theme:i},c=[],l=[];for(let e of n(a)){if(I(e)||e.negate&&(e.kind===`pseudo-element`||e.kind===`target`)){t(l,e);continue}if(e.kind===`self`||e.kind===`pseudo-element`||e.kind===`target`){let t=e.kind===`target`?e.value.slice(1):e.value,n=S(t);if(n>1&&!T(t))throw Error(`[Teacss] a token may use at most one pseudo-element, found ${n}`)}let r=te(e);if(!r){for(let t of n(o))if(r=t(e,s),r||e.negate&&t({...e,raw:e.value,negate:!1},s))break}r?t(c,ie(re(ne(r)))):t(l,e)}let u=c.map(e=>e.pseudoElement??``).join(``),d=S(u);if(d>1&&!T(u))throw Error(`[Teacss] a token may use at most one pseudo-element, found ${d}`);return{resolved:c,unresolved:l}}function oe(e,t){let r=Array.from(n(t),ne),i=r.map(e=>e.prefix).filter(Boolean),a=r.map(e=>e.suffix).filter(Boolean),o=r.map(e=>e.combinator).filter(Boolean),s=r.map(e=>e.pseudoElement).filter(Boolean),c=r.map(e=>e.parent).filter(Boolean);return{selector:`${i.join(``)}${e}${a.join(``)}${o.join(``)}${s.join(``)}`,parents:c}}const L=1e4;function R(e,t){return e===t||Object.is(e,t)}var se=class{nodes=new Map;oldest;newest;get size(){return this.nodes.size}peek(){return this.oldest?{done:!1,value:this.oldest.key}:{done:!0,value:void 0}}add(e){if(this.nodes.has(e))return;let t=e===0?0:e,n={key:t,older:this.newest};this.nodes.set(t,n),this.newest?this.newest.newer=n:this.oldest=n,this.newest=n}clear(){this.nodes.clear(),this.oldest=void 0,this.newest=void 0}delete(e){let t=this.nodes.get(e);return t?(this.nodes.delete(e),this.unlink(t),!0):!1}shift(){let e=this.oldest;return e?(this.nodes.delete(e.key),this.unlink(e),{done:!1,value:e.key}):{done:!0,value:void 0}}reset(e){this.clear();for(let t of e)this.add(t)}touch(e){let t=this.nodes.get(e);t&&t!==this.newest&&(this.unlink(t),t.older=this.newest,this.newest?this.newest.newer=t:this.oldest=t,this.newest=t)}unlink(e){e.older?e.older.newer=e.newer:this.oldest=e.newer,e.newer?e.newer.older=e.older:this.newest=e.older,e.older=void 0,e.newer=void 0}},ce=class extends Map{assumeNoPrototypeBypass;maxEntries;order=new se;retained=new Set;_revision=0;constructor(e=L,t,n=!1){if(super(),this.assumeNoPrototypeBypass=n,this.maxEntries=e,t)for(let[e,n]of t)this.set(e,n)}get revision(){return this._revision}get retainedSize(){return this.retained.size}isRetained(e){return this.retained.has(e)}clear(){super.clear(),this.order.clear(),this.retained.clear(),this._revision++}delete(e){this.reconcileOrder();let t=super.delete(e);return this.order.delete(e),this.retained.delete(e),this._revision++,t}set(e,t){this.reconcileOrder();let n=super.has(e);return super.set(e,t),!n&&!this.retained.has(e)&&this.order.add(e),this._revision++,this.enforceInstanceLimit(),this}getOrInsert(e,t){this.reconcileOrder();let n=super.get(e);return n!==void 0||super.has(e)?(this.enforceInstanceLimit(),n):(this.set(e,t),t)}getOrInsertComputed(e,t){if(typeof t!=`function`)throw TypeError(`Map insertion callback must be callable`);this.reconcileOrder();let n=super.get(e);if(n!==void 0||super.has(e))return this.enforceInstanceLimit(),n;let r=e===0?0:e,i=t(r);return this.set(r,i),i}setAndTouch(e,t,n=this.maxEntries){return this.reconcileOrder(),this.retained.has(e)?super.set(e,t):super.delete(e)?(super.set(e,t),this.order.touch(e)):(super.set(e,t),this.order.add(e)),this.size-this.retained.size>n&&this.deleteOldest(),this}replaceRetained(e,t){if(this._revision!==t)return!1;let n=new Map(e);if(this._revision!==t)return!1;this.reconcileOrder();for(let e of this.retained)n.has(e)||(super.delete(e),this.retained.delete(e));for(let[e,t]of n)this.order.delete(e),super.set(e,t),this.retained.add(e);return this.enforceInstanceLimit(),!0}deleteOldest(){this.reconcileEvictionOrder();let e=this.order.shift();for(;!e.done;){if(super.delete(e.value))return!0;this.resetOrder(),e=this.order.shift()}let t=this.firstOrdinaryKey();return!t.done&&super.delete(t.value)}enforceInstanceLimit(){for(;this.size-this.retained.size>this.maxEntries&&this.deleteOldest(););}reconcileOrder(){if(!this.assumeNoPrototypeBypass)for(let e of this.retained)super.has(e)||this.retained.delete(e);this.order.size!==this.size-this.retained.size&&this.resetOrder()}reconcileEvictionOrder(){if(this.assumeNoPrototypeBypass)return;let e=this.order.peek(),t=this.firstOrdinaryKey();(e.done!==t.done||!e.done&&!t.done&&!R(e.value,t.value))&&this.resetOrder()}firstOrdinaryKey(){for(let e of super.keys())if(!this.retained.has(e))return{done:!1,value:e};return{done:!0,value:void 0}}resetOrder(){this.order.reset(Array.from(super.keys()).filter(e=>!this.retained.has(e)))}},le=class extends Set{assumeNoPrototypeBypass;maxEntries;order=new se;constructor(e=L,t,n=!1){if(super(),this.assumeNoPrototypeBypass=n,this.maxEntries=e,t)for(let e of t)this.add(e)}add(e){this.reconcileOrder();let t=super.has(e);for(super.add(e),t||this.order.add(e);this.size>this.maxEntries&&this.size&&this.deleteOldest(););return this}addAndTouch(e,t=this.maxEntries){return this.reconcileOrder(),super.delete(e)?(super.add(e),this.order.touch(e)):(super.add(e),this.order.add(e)),this.size>t&&this.deleteOldest(),this}clear(){super.clear(),this.order.clear()}delete(e){this.reconcileOrder();let t=super.delete(e);return this.order.delete(e),t}deleteOldest(){this.reconcileEvictionOrder();let e=this.order.shift();for(;!e.done;){if(super.delete(e.value))return!0;this.order.reset(super.values()),e=this.order.shift()}let t=super.values().next();return!t.done&&super.delete(t.value)}reconcileOrder(){this.order.size!==this.size&&this.order.reset(super.values())}reconcileEvictionOrder(){if(this.assumeNoPrototypeBypass)return;let e=this.order.peek(),t=super.values().next();(e.done!==t.done||!e.done&&!t.done&&!R(e.value,t.value))&&this.order.reset(super.values())}};function ue(e){let t=e.keys().next();t.done||e.delete(t.value)}function z(e,t,n,r){if(e instanceof ce){e.setAndTouch(t,n,r??e.maxEntries);return}e.delete(t),e.set(t,n),e.size>(r??1e4)&&ue(e)}function de(e,t,n){if(e instanceof le){e.addAndTouch(t,n??e.maxEntries);return}e.delete(t),e.add(t),e.size>(n??1e4)&&ue(e)}const fe=new WeakMap,pe=new WeakMap;function me(e,t){pe.set(e,t)}function he(e){return e&&pe.get(e)}function ge(e){return(t,n)=>{let r=[e.parent,t.parent].filter(Boolean).join(` $$ `)||t.parent;return n({...t,prefix:`${e.prefix}${t.prefix}`,selector:`${t.selector}${e.suffix}${e.combinator}`,pseudo:`${e.pseudoElement}${t.pseudo}`,parent:r,parentOrder:r===t.parent?t.parentOrder:void 0})}}function _e(e,t){return fe.set(e,t),e}function ve(e){return fe.has(e)}function ye(e,t){let n=fe.get(e),r=fe.get(t);if(!n||!r)return;let i=`${r.pseudoElement}${n.pseudoElement}`,a=S(i);if(a>1&&!T(i))throw Error(`[Teacss] a token may use at most one pseudo-element, found ${a}`);let o={prefix:`${n.prefix}${r.prefix}`,suffix:`${n.suffix}${r.suffix}`,combinator:`${n.combinator}${r.combinator}`,pseudoElement:i,parent:[n.parent,r.parent].filter(Boolean).join(` $$ `)||void 0};return _e({handle:ge(o)},o)}function B(e,t){let n=e.length;n in e?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[n]=t}function be(e,t,n=!1,r=t+1){let i=e[t];if(i!==`[`&&i!==`(`)return;let a=i===`[`?`]`:`)`,o=!1,s;for(let i=t+1;i<e.length;i++){let t=e[i];if(t===`
|
|
2
|
+
`||t===`\r`||t===`\u2028`||t===`\u2029`)return;if(o){t===`*`&&e[i+1]===`/`&&(o=!1,i++);continue}if(s){t===`\\`?i++:t===s&&(s=void 0);continue}if(i>=r&&/\s/.test(t))return;if(t===`\\`)i++;else if(t===`/`&&e[i+1]===`*`)o=!0,i++;else if(t===`"`||t===`'`||n&&t==="`")s=t;else if(t===`[`||t===`(`)a+=t===`[`?`]`:`)`;else if(t===a.at(-1)&&(a=a.slice(0,-1),!a))return i+1}}function xe(e,t){let n=0;for(;e[t-n-1]===`\\`;)n++;return n%2==1}const Se=/^(?:[\p{ID_Continue}$-]|\u200C|\u200D)+$/u,Ce=/^(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?|\d(?:_?\d)*\.|\.\d(?:_?\d)*)(?:e[+-]?\d(?:_?\d)*)?$/i;function we(e,t){let n=t-1;for(;n>=0&&/\s/.test(e[n]);)n--;return n>=0&&`{,`.includes(e[n])}function Te(e,t,n){let r=t+1;for(;/\s/.test(e[r]??``);)r++;if(e[r]!==`/`||e[r+1]===`/`||e[r+1]===`*`)return!1;let i=!1;for(r++;r<n;r++){let t=e[r];if(t===`
|
|
3
|
+
`||t===`\r`||t===`\u2028`||t===`\u2029`)return!1;if(t===`\\`)r++;else if(t===`[`)i=!0;else if(t===`]`&&i)i=!1;else if(t===`/`&&!i){for(r++;/[a-z]/i.test(e[r]??``);)r++;for(;/\s/.test(e[r]??``);)r++;return r===n}}return!1}function Ee(e,t){let n=0,r;for(let i=t;i>=0;i--){let a=e[i];if(r)a===r&&!xe(e,i)&&(r=void 0);else if(a===`"`||a===`'`||a==="`")r=a;else if(a===`]`)n++;else if(a===`[`&&(n--,we(e,i)&&(n===0||Te(e,i,t))))return i}}function De(e,t){let n=e[t];if(n===`"`||n===`'`||n==="`"){for(let r=t-1;r>=0;r--)if(e[r]===n&&!xe(e,r))return r;return}if(n===`]`)return Ee(e,t);let r=t;for(;r>0&&!/\s/.test(e[r-1])&&!`({,[`.includes(e[r-1]);)r--;let i=e.slice(r,t+1);return Se.test(i)||Ce.test(i)?r:void 0}function Oe(e,t){let n=t-1;for(;n>=0&&/\s/.test(e[n]);)n--;if(n<0)return!1;if(`=({,[`.includes(e[n]))return!0;if(e[n]!==`:`)return!1;for(n--;n>=0&&/\s/.test(e[n]);)n--;let r=De(e,n);if(r===void 0)return!1;for(n=r-1;n>=0&&/\s/.test(e[n]);)n--;return n>=0&&`{,[?`.includes(e[n])}function ke(e,t){return Oe(e,t)}function Ae(e,t){let n=t+1;for(;/\s/.test(e[n]??``);)n++;return e[n]!==`"`&&e[n]!==`'`&&e[n]!=="`"?!1:ke(e,t)}function je(e,t,n){if(!Ae(e,t))return!1;let r=t+1,i=0;for(;r<n-1;){for(;/\s/.test(e[r]??``);)r++;let t=e[r];if(t!==`"`&&t!==`'`&&t!=="`")return!1;r++;let a=!1;for(;r<n-1;){let n=e[r];if(n===`\\`)r+=2;else if(n===t){r++,a=!0;break}else r++}if(!a)return!1;for(i++;/\s/.test(e[r]??``);)r++;if(r===n-1)break;if(e[r]!==`,`)return!1;for(r++;/\s/.test(e[r]??``);)r++;if(r===n-1)break}return i!==0}function Me(e){let t=[],n=[],r=new Map,i=!1,a,o;for(let s=0;s<e.length;s++){let c=e[s];if(n.length===0){c===`\\`?(/\s/.test(e[s+1]??``)&&(a=void 0),s++):/\s/.test(c)?a=void 0:c===`"`||c===`'`?a=a===c?void 0:a??c:!a&&c===`[`&&B(n,s);continue}if((o||i)&&c===`[`&&/[:@\s]/.test(e[s-1])){B(n,s),r.set(s,o??i),i=!1,o=void 0;continue}if(i){c===`*`&&e[s+1]===`/`&&(i=!1,s++);continue}if(o){c===`\\`?s++:c===o&&(o=void 0);continue}if(c===`/`&&e[s+1]===`*`)i=!0,s++;else if(c===`"`||c===`'`)o=c;else if(c===`\\`)s++;else if(c===`[`)B(n,s);else if(c===`]`){let a=n.pop(),c=r.get(a);(/[:@]/.test(e[a-1])||e[s+1]===`:`)&&B(t,{end:s+1,start:a}),c===!0?i=!0:c&&(o=c)}}let s=[];for(let e of t.sort((e,t)=>e.start-t.start||t.end-e.end))(!s.length||e.start>=s.at(-1).end)&&B(s,e);return s}function Ne(e){let t=``,n,r=-1,i=-1,a=-1,o=[];for(let s=0;s<e.length;s++){let c=e[s];if(n){c===`\\`?s++:c===n&&(n=void 0);continue}if((t.length>0||i!==-1)&&c===`\\`){s++;continue}if(t.length>0&&(c===`"`||c===`'`)){n=c;continue}if((t.length>0||i!==-1)&&c===`/`&&e[s+1]===`*`){let t=e.indexOf(`*/`,s+2);if(t<0)break;s=t+1;continue}c===`(`||c===`[`?t+=c===`(`?`)`:`]`:c===t.at(-1)?t=t.slice(0,-1):t.length===0&&(c===`@`?(i===-1&&(i=s),B(o,s)):i===-1&&(c===`:`&&r===-1?r=s:c===`!`&&(a=s)))}let s=i===-1?e.length:i,c=e.slice(0,s),l=!1;s>0&&a===s-1&&(l=!0,c=c.slice(0,-1));let u=[];for(let t=0;t<o.length;t++){let n=o[t]+1,r=t+1<o.length?o[t+1]:e.length;B(u,e.slice(n,r))}return r!==-1&&r<s?{raw:e,body:c,property:e.slice(0,r),value:c.slice(r+1),keyword:!1,important:l,conditions:u}:{raw:e,body:c,keyword:!0,important:l,conditions:u}}function Pe(e,t={}){let{name:n=`at-condition`}=t,r={},i=new WeakMap,a=e=>{let t=e??r,n=i.get(t);return n||(n=new ce(L,void 0,!0),i.set(t,n)),n},o=(t,n,r)=>{let i=t.map(e=>`${e.length}:${e}`).join(``),o=a(r??n),s=o.get(i);if(s!==void 0)return z(o,i,s),s;let{resolved:c,unresolved:l}=ae(P(t),e,n);if(l.length>0||c.length===0)return z(o,i,null),null;let u=e=>c.map(t=>t[e]).filter(Boolean).join(``),d={prefix:u(`prefix`),suffix:u(`suffix`),combinator:u(`combinator`),pseudoElement:u(`pseudoElement`),parent:c.map(e=>e.parent).filter(Boolean).join(` $$ `)||void 0},f={...d,handle:ge(d)};return z(o,i,f),f};return{name:n,match(e,t){if(!e.includes(`@`))return;let n=Ne(e);if(n.conditions.length===0)return;let r=o(n.conditions,t?.theme,he(t));return r?_e({matcher:`${n.body}${n.important?`!`:``}`,handle:r.handle},r):void 0},multiPass:!1}}const Fe=Symbol.for(`@teacss/core/config-validators`);function Ie(e){if(!Object.hasOwn(e,Fe))return;let t=Reflect.get(e,Fe);if(!Array.isArray(t))throw TypeError(`[Teacss] invalid internal configuration validators`);for(let r of n(t))r(e)}const Le=`imports`,Re=`primitives`,ze=`properties`,Be=`preflights`,Ve=`shortcuts`,He=`utilities`,Ue=Object.freeze({[Le]:-200,[ze]:-150,[Be]:-100,[Ve]:-50,[Re]:-10,[He]:0});function V(e,n,r){let i=e[n];if(r.blockComment)return i===`*`&&e[n+1]===`/`?(r.blockComment=!1,n+1):n;if(r.quote)return i===`\\`?n+1:(i===r.quote&&(r.quote=void 0),n);if(r.closers.length>0&&i===`/`&&e[n+1]===`*`)return r.blockComment=!0,n+1;if(r.closers.length>0&&(i===`"`||i===`'`))return r.quote=i,n;if(i===`\\`)return n+1;if(i===`(`||i===`[`)return t(r.closers,i===`(`?`)`:`]`),n;if(i===r.closers.at(-1))return r.closers.pop(),n}function We(e,t,n=e.length){let r={closers:[]};for(let i=t+1;i<n;i++){let t=e[i],n=V(e,i,r);if(n!==void 0){i=n;continue}if(r.closers.length===0){if(t===`}`)return{index:i,kind:`close`};if(t===`{`)return{index:i,kind:`open`}}}return{index:n,kind:`limit`}}function Ge(e,t,n=e.length){let r={closers:[]},i=Ht();for(let a=t+1;a<n;a++){let t=e[a],n=V(e,a,r);if(n!==void 0){a=n;continue}if(!(r.closers.length>0)){if(t===`}`)return{index:a,kind:`close`};if(t===`{`)return{index:a,kind:`open`};if(t===`'`||t===`"`||t==="`"||t===`/`&&(e[a+1]===`/`||e[a+1]===`*`||Zt(e,a,i.forceRegex,i.canEnd)))return{index:a,kind:`host`};/\s/.test(t)||(i.forceRegex=!1),i.canEnd=Xt(e,a,i.canEnd,i)}}return{index:n,kind:`limit`}}const Ke=/[\s'"`;{},\])]/;function qe(e,t,n=e.length){if(e[t]!==`@`)return{conds:``,end:t};let r={closers:[]},i=t;for(;i<n;i++){let t=e[i],n=V(e,i,r);if(n!==void 0){i=n;continue}if(t===`/`&&(e[i+1]===`/`||e[i+1]===`*`)&&r.closers.length===0||Ke.test(t)&&r.closers.length===0)break}return{conds:e.slice(t,i),end:i}}function Je(e,n=!1){let r=[],i={closers:[]},a=0;for(let o=0;o<e.length;o++){let s=e[o],c=V(e,o,i);if(c!==void 0){o=c;continue}(s===`;`||n&&/\s/.test(s))&&i.closers.length===0&&(t(r,e.slice(a,o)),a=o+1)}return t(r,e.slice(a)),r.map(e=>e.trim()).filter(Boolean)}function Ye(e){let t={closers:[]},n=!1,r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=V(e,i,t);if(o!==void 0){i=o;continue}if(!(t.closers.length>0)){if(a===`<`&&$t(e,i))return!1;if(a===`;`)return!0;a===`:`?n=!0:a===`?`&&(r=!0)}}return n&&!r}function Xe(e,t){let n=Ge(e,t);if(n.kind!==`close`)return;let r=e.slice(t+1,n.index);if(!Ye(r))return;let i=Je(r,!0);if(i.length===0)return;let{conds:a,end:o}=qe(e,n.index+1);return{end:o,value:i.map(e=>`${e}${a}`).join(` `)}}function H(e,t,n=!1){let r=t+1;if(r>=e.length)return e.length;if(e[r]===`\r`&&e[r+1]===`
|
|
4
|
+
`||n&&e[r]===`$`&&e[r+1]===`{`)return r+2;if(e[r]===`u`&&e[r+1]===`{`){let t=r+2;for(;/[0-9a-f]/i.test(e[t]??``);)t++;if(t>r+2&&e[t]===`}`)return t+1}return r+1}function Ze(e,t,n){let r=e[t];return n.lineComment?((r===`
|
|
5
|
+
`||r===`\r`||r===`\u2028`||r===`\u2029`)&&(n.lineComment=!1),t+1):n.blockComment?r===`*`&&e[t+1]===`/`?(n.blockComment=!1,t+2):t+1:n.quote?r===`\\`?H(e,t):(r===n.quote&&(n.quote=void 0),t+1):r===`\\`?H(e,t):r===`/`&&e[t+1]===`*`?(n.blockComment=!0,t+2):r===`/`&&e[t+1]===`/`&&n.parenDepth===0?(n.lineComment=!0,t+2):(r===`'`||r===`"`?n.quote=r:r===`(`?n.parenDepth++:r===`)`&&n.parenDepth>0?n.parenDepth--:r===`{`&&n.parenDepth===0?n.depth++:r===`}`&&n.parenDepth===0&&n.depth--,t+1)}function Qe(e,t,n){let r={blockComment:!1,depth:1,lineComment:!1,parenDepth:0};for(let i=t+1;i<n;){let t=i;if(i=Ze(e,i,r),r.depth===0)return t}return-1}const $e=`=([{,:>)$?|&.!~+-*/%^<`,et=new Set(`as.assert.await.case.catch.class.const.default.delete.do.else.export.extends.finally.implements.import.in.instanceof.is.keyof.let.new.of.return.satisfies.static.throw.type.typeof.try.var.void.with.yield`.split(`.`)),tt=new Set([`await`,`case`,`delete`,`do`,`else`,`in`,`new`,`of`,`return`,`throw`,`typeof`,`void`,`yield`]),nt=new Set([`catch`,`for`,`if`,`switch`,`while`,`with`]),rt=/^(?:a|abbr|address|animate|animateMotion|animateTransform|annotation|area|article|aside|audio|b|base|bdi|bdo|blockquote|body|br|button|canvas|caption|circle|cite|clipPath|code|col|colgroup|data|datalist|dd|defs|del|desc|details|dfn|dialog|discard|div|dl|dt|ellipse|em|embed|feBlend|feColorMatrix|feComponentTransfer|feComposite|feConvolveMatrix|feDiffuseLighting|feDisplacementMap|feDistantLight|feDropShadow|feFlood|feFuncA|feFuncB|feFuncG|feFuncR|feGaussianBlur|feImage|feMerge|feMergeNode|feMorphology|feOffset|fePointLight|feSpecularLighting|feSpotLight|feTile|feTurbulence|fieldset|figcaption|figure|filter|footer|foreignObject|form|g|h[1-6]|head|header|hgroup|hr|html|i|iframe|image|img|input|ins|kbd|label|legend|li|line|linearGradient|link|maction|maligngroup|malignmark|main|map|mark|marker|mask|math|menu|meta|metadata|meter|menclose|merror|mfenced|mfrac|mglyph|mi|mlabeledtr|mlongdiv|mmultiscripts|mn|mo|mover|mpadded|mpath|mphantom|mprescripts|mroot|mrow|ms|mscarries|mscarry|msgroup|msline|mspace|msqrt|msrow|mstack|mstyle|msub|msubsup|msup|mtable|mtd|mtext|mtr|munder|munderover|nav|noscript|object|ol|optgroup|option|output|p|path|pattern|picture|polygon|polyline|pre|progress|q|radialGradient|rect|rp|rt|ruby|s|samp|script|search|section|select|selectedcontent|semantics|set|slot|small|source|span|stop|strong|style|sub|summary|sup|svg|switch|symbol|table|tbody|td|template|text|textPath|textarea|tfoot|th|thead|time|title|tr|track|tspan|u|ul|use|var|video|view|wbr|[a-z][-\w]*-[\w-]+)$/i,it=/^(?:--|-?)[_a-z][-\w]*$/i,at=/^[+-]?(?:(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)%$/i;function ot(e){if(/^(?:from|to)$/i.test(e)||at.test(e))return!0;let t=e.search(/\s/u);if(t<1)return!1;let n=e.slice(t).trim();return it.test(e.slice(0,t))&&at.test(n)}function st(e,t,n=0){let r=e.slice(n,t);return/(?:^|[;}\n\r])\s*(?:(?:export|default|declare|async)\s+)*function(?:\s*\*)?[\s\S]*$/.test(r)}function ct(e,t,n=0){return/\bfunction(?:\s*\*)?[\s\S]*$/.test(e.slice(n,t))}function lt(e,t,n=0){let r=e.slice(n,t);return/(?:^|[;{}\n\r])\s*(?:(?:export|default|declare|abstract)\s+)*(?:class|interface|namespace|enum|module|global)\b[^{};]*$/.test(r)}function ut(e,t,n=0){return/(?:^|[^\w$])(?:abstract\s+)?class\b[^{};]*$/.test(e.slice(n,t))}function dt(e,t,n=0){return lt(e,t,n)||ut(e,t,n)||ct(e,t,n)}function ft(e,t){let n=-1,r=0,i=0,a=0,o;for(let s=0;s<e.length;s++){let c=e[s];if(o){c===`\\`?s++:c===o&&(o=void 0);continue}if(i>0){c===`\\`?s++:c===`'`||c===`"`?o=c:c===`{`?i++:c===`}`&&i--;continue}if((t&&c===`$`||c===`#`||c===`@`)&&e[s+1]===`{`){i=1,s++;continue}if(c===`\\`){s++;continue}if(c===`'`||c===`"`){o=c;continue}c===`[`?r++:c===`]`&&r>0?r--:c===`(`?a++:c===`)`&&a>0?a--:r===0&&a===0&&(c===`;`||c===`{`||c===`}`||c===`
|
|
6
|
+
`||c===`\r`||t&&c==="`")&&(n=s)}return n}function pt(e){for(let t of e)if((t.codePointAt(0)??0)>127)return!0;return!1}function mt(e,t,n=!1,r=0){let i=e.slice(r,t),a=ft(i,n),o=i.slice(a+1).trim();if(o.length===0)return!1;let s=o.split(/\s*(?:,|>|\+|~)\s*|\s+/).filter(Boolean),c=o.split(`,`).map(e=>e.trim());return/^@(?:-[a-z]+-)?[a-z][-\w]*\b/i.test(o)||/^%[-_a-z][-\w]*$/i.test(o)||/(?:^|[\s>+~,])(?:&|[-_a-z][-\w]*|\*)?(?:[.#](?=\S)|\[[^\]]*\])/i.test(o)||/(?:^|[\s>+~,])(?:\*|[-\w]+)\|(?:\*|[-\w]+)(?=$|[\s.#:[>+~,])/i.test(o)||/^(?:(?:[a-z][-\w]*)?|&):{1,2}[-\w(]/i.test(o)||/(?:^|[\s>+~,])\\[0-9a-f]{1,6}\s?/i.test(o)||pt(o)||n&&o.includes("${")||o.includes(`#{`)||o.includes(`@{`)||c.every(ot)||s.length>0&&s.every(e=>e===`*`||rt.test(e))}function ht(e,t){let n=t+1;for(;/\s/.test(e[n]??``);)n++;let r=e[n];if(r!==`'`&&r!==`"`)return!1;for(n++;n<e.length;n++){let t=e[n];if(t===`\\`)n++;else if(t===r){for(n++;/\s/.test(e[n]??``);)n++;return e[n]===`:`}}return!1}function gt(e,t){let n=t+1;for(;/\s/.test(e[n]??``);)n++;return e.startsWith(`...`,n)}function _t(e,t){let n=0;for(t--;t>=0&&e[t]===`\\`;t--)n++;return n%2==1}function vt(e,t,n=0){let r=t-1;for(;r>=0&&/\s/.test(e[r]);)r--;if(r<0)return!1;if($e.includes(e[r]))return!0;let i=r+1;for(;r>=0&&/[\w$]/.test(e[r]);)r--;let a=e.slice(r+1,i);return et.has(a)||dt(e,t,n)}const yt=new Set([`catch`,`class`,`do`,`else`,`finally`,`switch`,`try`]),bt=/^(?:(?:await\s+)?using|break|class|const|continue|debugger|declare|do|enum|export|for|function|if|import|interface|let|namespace|return|switch|throw|try|type|var|while|with)(?=$|[\s;(){}])/,xt=/^(?:await\s+)?[$_\p{ID_Start}][$\p{ID_Continue}]*(?:\s*(?:(?:\.|\?\.)\s*#?[$_\p{ID_Start}][$\p{ID_Continue}]*|(?:\?\.)?\[[^\]]+\]))*\s*(?:(?:\?\.)?\(|\+\+|--|[-+*/%&|^]?=(?!=|>))/u,St=/^(?:await\s+)?[$_\p{ID_Start}][$\p{ID_Continue}]*\s*(?:(?:\.|\?\.)\s*#?[$_\p{ID_Start}][$\p{ID_Continue}]*)+\s*$/u,Ct=/^(?:await\s+)?[$_\p{ID_Start}][$\p{ID_Continue}]*(?:\s*(?:\.|\?\.)\s*#?[$_\p{ID_Start}][$\p{ID_Continue}]*)*\s*(?:\?\.)?\[[^\]]+\]\s*$/u,wt=/^new\s+(?:class\b|function\b|[$_\p{ID_Start}])/u,Tt=/^\([\s\S]*\)$/,Et=/^\([\s\S]*\)\s*(?:\(|\?\.|\.)/,Dt=/^(?:(?:await|delete|typeof|void)\s+\S|yield(?:\s+\S|\s*\*\s*\S))/u,Ot=/^(?:\+\+|--|!|~)\s*\S/u,kt=/^\[[\s\S]*\]\s*=(?!=|>)/,At=new Set([`as`,`in`,`instanceof`,`satisfies`]),jt=/^(?:=(?!=|>)|\+=|-=|\*\*=|\*=|\/=|%=|&&=|&=|\|\|=|\|=|\^=|\?\?=|<<=|>>>=|>>=)/,Mt=/^(?:(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[bB][01](?:_?[01])*|0[oO][0-7](?:_?[0-7])*)n?|(?:\d(?:_?\d)*)n|(?:\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|\d(?:_?\d)*(?:[eE][+-]?\d(?:_?\d)*)?)/;function Nt(e){let t={closers:[]},n=!1,r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=t.closers.length===0,s=V(e,i,t);if(s!==void 0){o&&(a===`(`||a===`[`)&&(n=!0),i=s;continue}if(!(t.closers.length>0)){if(a===`:`||a===`@`)return!n||r?void 0:a===`:`?`declaration`:`condition`;if(a===`!`&&i===e.length-1)return!n||r?void 0:`important`;/\s/u.test(a)?r=!0:n=!0}}}function Pt(e,t){if(Dt.test(e))return!0;if(!Ot.test(e))return!1;let n=Nt(e);return n===void 0||t&&n===`important`}function Ft(e,t){if(!kt.test(e))return!1;let n=Nt(e);return n===void 0||t&&n===`important`}function It(e,t){let n={closers:[]};for(let r=t;r<e.length;r++){let t=V(e,r,n);if(t!==void 0&&(r=t,n.closers.length===0))return r+1}}function Lt(e){let t={closers:[]},n=-1;for(let r=0;r<e.length;r++){let i=V(e,r,t);if(i!==void 0){r=i;continue}if(!(t.closers.length>0)){if(/\s/u.test(e[r]))return-1;n===-1&&(e[r]===`:`||e[r]===`@`)&&r>0&&(n=r)}}return n}function Rt(e,t){let n=t=>{for(;t<e.length&&/\s/u.test(e[t]);)t++;return t},r=0;for(;e[r]===`+`||e[r]===`-`;)r=n(r+1);let i=un(e,r);i?.value===`await`&&/\s/u.test(e[i.end]??``)&&(r=n(i.end),i=un(e,r));let a;if(i!==void 0)a=`identifier`,r=i.end;else if(e[r]===`[`||e[r]===`(`){let t=It(e,r);if(t===void 0)return!1;a=e[r]===`[`?`array`:`parenthesized`,r=t}else{let t=Mt.exec(e.slice(r));if(t===null)return!1;a=`number`,r+=t[0].length}let o=!1,s=!1;for(;r<e.length;){let t=r;if(r=n(r),e[r]===`!`&&e[r+1]!==`=`){s=!0,r++;continue}if(e[r]===`(`||e.startsWith(`?.(`,r))return!0;if(e.startsWith(`?.`,r))r=n(r+2);else if(e[r]===`.`)r=n(r+1);else if(e[r]!==`[`){r=t;break}if(e[r]===`[`){let t=It(e,r);if(t===void 0)return!1;o=!0,s=!1,r=t;continue}if(e[r]===`#`&&r++,i=un(e,r),i===void 0)return!1;o=!0,s=!1,r=i.end}if(r=n(r),e[r]===`(`||e.startsWith(`?.(`,r))return!0;if(o&&e.slice(r).trim().length===0)return!s||Nt(e)!==`important`||t;if(a===`array`&&!o)return!1;if(e.startsWith(`++`,r)||e.startsWith(`--`,r))return e.slice(r+2).trim().length===0;let c=jt.exec(e.slice(r));return c!==null&&e.slice(r+c[0].length).trim().length>0}function zt(e){let t=Lt(e),n=(t,n)=>{let r=t-1;for(;r>=0&&/\s/.test(e[r]);)r--;let i=t+n;for(;i<e.length&&/\s/.test(e[i]);)i++;return r>=0&&e[r]!==`:`&&i<e.length},r=(t,r,i)=>{let a=e[r-1]??``,o=e[i]??``;return!/\s/u.test(a)&&!`)!]`.includes(a)||!/\s/u.test(o)&&!`([`.includes(o)&&(t!==`in`&&t!==`instanceof`||!`!~+-`.includes(o))&&(t!==`as`&&t!==`satisfies`||o!==`-`)?!1:n(r,i-r)},i={closers:[]};for(let a=0;a<e.length;a++){let o=e[a],s=V(e,a,i);if(s!==void 0){a=s;continue}if(i.closers.length>0||t>=0&&a>t)continue;let c=e[a+1],l=un(e,a);if(l!==void 0){if(At.has(l.value)&&r(l.value,a,l.end))return!0;a=l.end-1;continue}if((o===`?`||o===`<`||o===`>`)&&n(a,c===o||c===`=`||o===`?`&&c===`.`?2:1)||(o===`=`&&c===`=`||o===`!`&&c===`=`||o===`&`&&c===`&`||o===`|`&&c===`|`||o===`*`&&c===`*`)&&n(a,2)||`+-*/%&|^`.includes(o)&&(/\s/.test(e[a-1]??``)||/\s/.test(c??``))&&n(a,1)||o===`,`&&(/\s/.test(e[a-1]??``)||/\s/.test(c??``))&&n(a,1))return!0}return!1}function Bt(e,t){let n=Ge(e,t);if(n.kind===`open`)return!0;if(n.kind!==`close`)return!1;let r=Je(e.slice(t+1,n.index));if(r.length===0)return!0;let i=r.length===1;return r.some(e=>bt.test(e)||xt.test(e)||St.test(e)||Ct.test(e)||Rt(e,i)||wt.test(e)||Tt.test(e)||Et.test(e)||Pt(e,i)||Ft(e,i)||zt(e))}function Vt(e,t,n=0,r=0,i=``){if(`:|&=,(`.includes(i))return!1;let a=t-1;for(;a>=0&&/\s/.test(e[a]);)a--;let o=e.slice(n,t);if(ct(e,t,n))return r>0||`:|&=,(`.includes(e[a]??``)?!1:st(e,t,n);if(/\bclass\b[^;]*$/.test(o))return lt(e,t,n);if(e[a]===`)`||e[a]===`>`)return e.slice(Math.max(n,a-1),a+1)!==`=>`;let s=a+1;for(;a>=0&&/[\w$]/.test(e[a]);)a--;let c=e.slice(a+1,s);return yt.has(c)?!0:dt(e,t,n)}function Ht(){return{angleDepth:0,canEnd:!1,classParenRoles:[],forceRegex:!1,labelCandidate:!1,labelColon:-1,lastSignificant:``,lastWord:``,parenKinds:[],pendingFunctions:[],restrictedLineStatement:!1,statementStart:!0,typeDeclaration:!1}}const Ut=new Set([`abstract`,`async`,`declare`,`default`,`export`]),Wt=new Set([`abstract`,`asserts`,`extends`,`in`,`infer`,`is`,`keyof`,`new`,`readonly`,`typeof`,`unique`]);function Gt(e,t){let n=e.pendingFunctions.at(-1);n?.phase===`return-type`&&(n.typeCanEnd=!Wt.has(t))}function U(e,t,n){let r=e.pendingFunctions.at(-1);r?.phase===`return-type`&&(`|&?:=,(`.includes(t)||t===`[`||t===`<`?r.typeCanEnd=!1:(n||t===`]`||t===`>`||t===`)`)&&(r.typeCanEnd=!0))}function Kt(e){let t=e.pendingFunctions.at(-1);if(t)return t.phase===`after-params`?(e.pendingFunctions.pop(),t.kind):t.phase===`return-type`?t.typeCanEnd?(e.pendingFunctions.pop(),t.kind):`T`:`O`}function qt(e,t){return!e.restrictedLineStatement&&!(e.typeDeclaration&&t===0&&e.canEnd)?!1:(e.canEnd=!1,e.forceRegex=!0,e.labelCandidate=!1,e.labelColon=-1,e.lastSignificant=``,e.lastWord=``,e.restrictedLineStatement=!1,e.statementStart=!0,e.typeDeclaration=!1,!0)}function Jt(e,t=!1){e.labelCandidate=!1,e.labelColon=-1,e.lastSignificant=`;`,e.lastWord=``,t||(e.pendingFunctions.length=0),e.restrictedLineStatement=!1,e.statementStart=!0,e.typeDeclaration=!1}function W(e,t){e.canEnd=!0,e.forceRegex=!1,e.labelCandidate=!1,e.labelColon=-1,e.lastSignificant=t,e.lastWord=``,e.statementStart=!1,U(e,t,!0)}function Yt(e,t,n){if(!n||/\s/.test(e[t-1]??``))return!1;let r=t+1;for(;/\s/.test(e[r]??``);)r++;return/[A-Z_$\p{ID_Start}]/u.test(e[r]??``)}function Xt(e,n,r,i){let a=e[n],o=i?.lastWord??``;if(/\s/.test(a??``))return r;if(/[\w$\p{ID_Continue}]/u.test(a??``)){if(/[\w$\p{ID_Continue}]/u.test(e[n+1]??``))return r;let a=n;for(;a>0&&/[\w$\p{ID_Continue}]/u.test(e[a-1]??``);)a--;let o=e.slice(a,n+1),s=a-1;for(;s>=0&&/\s/.test(e[s]??``);)s--;let c=e[s]===`.`||e[s]===`#`;if(i){let e=i.statementStart;i.labelCandidate=e,i.labelColon=-1,i.lastSignificant=`word`,i.lastWord=c?``:o,!c&&o===`function`?t(i.pendingFunctions,{kind:e?`B`:`O`,phase:`before-params`,typeCanEnd:!1}):c||Gt(i,o),!c&&e&&(o===`type`||o===`import`||o===`interface`||o===`declare`||o===`export`)&&(i.typeDeclaration=!0),!c&&e&&(o===`break`||o===`continue`||o===`debugger`)&&(i.restrictedLineStatement=!0),i.statementStart=!c&&e&&Ut.has(o)}return c||!(et.has(o)||nt.has(o))}if(i&&(a!==`:`&&(i.labelCandidate=!1),a!==`{`&&(i.labelColon=-1),i.lastWord=``,i.statementStart=!1),/\d/.test(a??``)||a===`.`&&r&&/\d/.test(e[n-1]??``))return i&&(i.lastSignificant=`number`,U(i,a,!0)),!0;if(a===`]`)return i&&(i.lastSignificant=a,U(i,a,!0)),!0;if(a===`[`)return i&&(i.lastSignificant=a,U(i,a,!1)),!1;if(a===`(`){if(i){let e=i.pendingFunctions.at(-1);t(i.classParenRoles,o===`cn`?`C`:r||e?.phase===`before-params`||nt.has(o)?`O`:`T`),e?.phase===`before-params`?(e.phase=`params`,t(i.parenKinds,`F`)):t(i.parenKinds,nt.has(o)?`1`:`0`),i.forceRegex=!1,i.lastSignificant=a,U(i,a,!1)}return!1}if(a===`)`){if(i){i.classParenRoles.pop();let e=i.parenKinds.pop();if(i.forceRegex=e===`1`,e===`F`){let e=i.pendingFunctions.at(-1);e?.phase===`params`&&(e.phase=`after-params`)}i.lastSignificant=a,U(i,a,!0)}return!0}if(a===`<`)return i&&(Yt(e,n,r)&&i.angleDepth++,i.lastSignificant=a,U(i,a,!1)),!1;if(a===`>`)return i?.angleDepth?(i.angleDepth--,i.lastSignificant=a,U(i,a,!0),!0):(i&&(i.lastSignificant=a,U(i,a,!1)),!1);if(a===`+`||a===`-`)return i&&(i.lastSignificant=a),e[n-1]===a||e[n+1]===a?(i&&U(i,a,r),r):(i&&U(i,a,!1),!1);if(a===`:`&&i){let e=i.pendingFunctions.at(-1);return e?.phase===`after-params`&&(e.phase=`return-type`,e.typeCanEnd=!1),i.labelCandidate&&(i.labelColon=n),i.lastSignificant=a,U(i,a,!1),!1}return a===`!`&&e[n+1]!==`=`?(i&&(i.lastSignificant=a,U(i,a,r)),r):a===`}`||a===`'`||a===`"`||a==="`"?(i&&(i.lastSignificant=a,U(i,a,!0)),!0):(i&&(i.lastSignificant=a,U(i,a,!1)),!1)}function Zt(e,t,n=!1,r){if(e[t+1]===`/`||e[t+1]===`*`)return!1;if(n)return!0;if(r!==void 0)return!r;let i=t-1;for(;i>=0&&/\s/.test(e[i]);)i--;if(i<0)return!0;if((e[i]===`+`||e[i]===`-`)&&e[i-1]===e[i]||e[i]===`!`&&i>0&&/[\w$)\]]/.test(e[i-1]??``)||e[i]===`>`&&i>0&&/[\w$)>]/.test(e[i-1]??``))return!1;if(`=([{,:;!?&|+-*%^~<>`.includes(e[i]))return!0;let a=i+1;for(;i>=0&&/[\w$]/.test(e[i]);)i--;return tt.has(e.slice(i+1,a))}function Qt(e,t){let n=!1;for(let r=t+1;r<e.length;r++){let t=e[r];if(t===`
|
|
7
|
+
`||t===`\r`||t===`\u2028`||t===`\u2029`)return{end:-1,failedUntil:r};if(t===`\\`)r++;else if(t===`[`)n=!0;else if(t===`]`)n=!1;else if(t===`/`&&!n){for(r++;/[a-z]/i.test(e[r]??``);)r++;return{end:r,failedUntil:r}}}return{end:-1,failedUntil:e.length}}function $t(e,t){let n=e[t+1]===`/`,r=t+(n?2:1),i=r;if(e[r]!==`>`){let t=e.codePointAt(r);if(t===void 0)return;let a=String.fromCodePoint(t);if(!sn.test(a))return;for(i+=a.length;i<e.length;){let t=e.codePointAt(i);if(t===void 0)break;let n=String.fromCodePoint(t);if(!cn.test(n)&&!`:.-`.includes(n))break;i+=n.length}let o=e[i];if(!/[\s/>]/.test(o??``)&&(o!==`<`||n))return}return{closing:n,name:e.slice(r,i),nameEnd:i}}function en(e,n,r){let i=r.get(n);if(i!==void 0)return i;let a=!1,o=!1,s=[],c;for(let i=n;i<e.length;i++){let l=e[i],u=e[i+1];if(o)(l===`
|
|
8
|
+
`||l===`\r`||l===`\u2028`||l===`\u2029`)&&(o=!1);else if(a)l===`*`&&u===`/`&&(a=!1,i++);else if(c)l===`\\`?i++:l===c&&(c=void 0);else if(l===`/`&&u===`/`)o=!0,i++;else if(l===`/`&&u===`*`)a=!0,i++;else if(l===`'`||l===`"`||l==="`")c=l;else if(l===`<`)t(s,i);else if(l===`>`&&e[i-1]!==`=`){let e=s.pop();if(e!==void 0&&(r.set(e,i),e===n))return i}}for(let e of s)r.set(e,-1);return-1}function tn(e,t,n){return!t.closing&&e[t.nameEnd]===`<`?en(e,t.nameEnd,n):-1}function nn(e,t=0){return{blockComment:!1,braceDepth:+!!e,braceKinds:[],declarationBoundary:t,expression:Ht(),failedRegexUntil:-1,kind:`host`,lineComment:!1,terminating:e}}function rn(e){let t=e.at(-1);t?.kind===`host`&&W(t.expression,`jsx`)}function an(e,t,n){for(let r=t+1;r<e.length;r++){let t=e[r];if(t===`\\`)r=H(e,r,n==="`")-1;else if(t===n)return r+1}return-1}const on=new Set(`break.case.catch.class.const.continue.debugger.default.delete.do.else.enum.export.extends.false.finally.for.function.if.import.in.instanceof.new.null.return.super.switch.this.throw.true.try.typeof.var.void.while.with`.split(`.`)),sn=/^[$_\p{ID_Start}]$/u,cn=/^(?:[$\p{ID_Continue}]|\u200c|\u200d)$/u;function ln(e,t){if(e[t]!==`\\`||e[t+1]!==`u`)return;if(e[t+2]===`{`){let n=0,r=t+3,i=0;for(;/^[0-9a-f]$/i.test(e[r]??``);){if(i=i*16+Number.parseInt(e[r],16),i>1114111)return;n++,r++}return n===0||e[r]!==`}`?void 0:{character:String.fromCodePoint(i),end:r+1}}let n=e.slice(t+2,t+6);if(/^[0-9a-f]{4}$/i.test(n))return{character:String.fromCodePoint(Number.parseInt(n,16)),end:t+6}}function un(e,n){let r=[],i=!1,a=n,o=!0;for(;a<e.length;){let n=ln(e,a),s=n?.character??String.fromCodePoint(e.codePointAt(a));if(!(o?sn.test(s):cn.test(s)))break;t(r,s),i||=n!==void 0,a=n?.end??a+s.length,o=!1}return o?void 0:{end:a,escaped:i,value:r.join(``)}}function dn(e,n,r){let i=[],a=!1,o=!1,s=!1,c=!0,l=!1,u=`start`,d=!1,f;for(let p=n+1;p<r;p++){let n=e[p],r=e[p+1];if(s){(n===`
|
|
9
|
+
`||n===`\r`||n===`\u2028`||n===`\u2029`)&&(s=!1);continue}if(a){n===`*`&&r===`/`&&(a=!1,p++);continue}if(f){n===`\\`?p++:n===f&&(f=void 0);continue}if(n===`/`&&r===`/`){s=!0,p++;continue}if(n===`/`&&r===`*`){a=!0,p++;continue}if(n===`'`||n===`"`||n==="`"){if(i.length===0&&u!==`constraint`&&u!=="default")return!1;f=n,d=!0;continue}if(n===`(`||n===`[`||n===`{`||n===`<`){if(i.length===0&&u!==`constraint`&&u!=="default")return!1;t(i,n===`(`?`)`:n===`[`?`]`:n===`{`?`}`:`>`),d=!0;continue}if(n===i.at(-1)){i.pop();continue}if(i.length>0||/\s/.test(n))continue;if(n===`,`)return!(u===`start`||u===`after-const`||(u===`constraint`||u==="default")&&!d);if(n===`=`){if(r===`>`){if(u!==`constraint`&&u!=="default")return!1;d=!0,p++;continue}if(u===`constraint`&&!d||u!==`after-name`&&u!==`constraint`)return!1;o=!0,u=`default`,d=!1;continue}let m=un(e,p);if(m){let e=m.value;if(u===`start`)!m.escaped&&e===`const`?u=`after-const`:(l=!0,c=!on.has(e),u=`after-name`);else if(u===`after-const`)l=!0,c=!on.has(e),u=`after-name`;else if(u===`after-name`){if(m.escaped||e!==`extends`)return!1;o=!0,u=`constraint`,d=!1}else d=!0;p=m.end-1}else{if(n===`/`||u!==`constraint`&&u!=="default")return!1;d=!0}}return!l||!c||!o||u===`after-const`||(u===`constraint`||u==="default")&&!d?!1:u===`after-name`||u===`constraint`||u==="default"}function fn(e,t){let n=t;for(;n<e.length;)if(/\s/.test(e[n]))n++;else if(e[n]===`/`&&e[n+1]===`/`)for(n+=2;n<e.length&&e[n]!==`
|
|
10
|
+
`&&e[n]!==`\r`&&e[n]!==`\u2028`&&e[n]!==`\u2029`;)n++;else if(e[n]===`/`&&e[n+1]===`*`){let t=e.indexOf(`*/`,n+2);if(t===-1)return e.length;n=t+2}else break;return n}function pn(e,t,n){let r=en(e,t,n);return r===-1||!dn(e,t,r)?-1:e[fn(e,r+1)]===`(`?r:-1}function mn(e,n,r){let i=new Set,a=[nn(!1)],o=0;for(;o<e.length;){let s=a.at(-1),c=e[o],l=e[o+1];if(s.kind===`template`){c===`\\`?o=H(e,o,!0):c==="`"?(a.pop(),rn(a),o++):c===`$`&&l===`{`?(t(a,nn(!0)),o+=2):o++;continue}if(s.kind===`element`){if(r===`auto`&&(c===`'`||c===`"`||c==="`")&&o>=s.failedQuoteUntil[c]){let t=an(e,o,c);if(t!==-1){o=t;continue}s.failedQuoteUntil[c]=e.length}if(r===`auto`&&c===`/`&&l===`*`&&o>=s.failedBlockCommentUntil){let t=e.indexOf(`*/`,o+2);if(t!==-1){o=t+2;continue}s.failedBlockCommentUntil=e.length}if(c===`{`){t(a,nn(!0,o+1)),o++;continue}if(c!==`<`){o++;continue}let i=$t(e,o);if(!i){o++;continue}t(a,{blockComment:!1,closing:i.closing,kind:`tag`,name:i.name,opening:o,typeEnd:tn(e,i,n)}),o=i.nameEnd;continue}if(s.kind===`tag`){if(s.blockComment){c===`*`&&l===`/`?(s.blockComment=!1,o+=2):o++;continue}if(s.quote){c===`\\`?o=H(e,o):(c===s.quote&&(s.quote=void 0),o++);continue}if(c===`/`&&l===`*`){s.blockComment=!0,o+=2;continue}if(c===`'`||c===`"`){s.quote=c,o++;continue}if(o<=s.typeEnd){o++;continue}if(c===`<`){a.pop();continue}if(c===`{`){t(a,nn(!0,o+1)),o++;continue}if(c!==`>`){o++;continue}let n=o-1;for(;/\s/.test(e[n]??``);)n--;let r=!s.closing&&e[n]===`/`;if(a.pop(),s.closing){let e=a.at(-1);e?.kind===`element`&&e.name===s.name&&(a.pop(),i.add(e.opening),rn(a))}else r?(i.add(s.opening),rn(a)):t(a,{failedBlockCommentUntil:-1,failedQuoteUntil:{'"':-1,"'":-1,"`":-1},kind:`element`,name:s.name,opening:s.opening});o++;continue}if(s.lineComment){(c===`
|
|
11
|
+
`||c===`\r`||c===`\u2028`||c===`\u2029`)&&(s.lineComment=!1,qt(s.expression,s.braceDepth)),o++;continue}if(s.blockComment){c===`*`&&l===`/`?(s.blockComment=!1,o+=2):o++;continue}if(s.quote){c===`\\`?o=H(e,o):(c===s.quote&&(s.quote=void 0,W(s.expression,`string`)),o++);continue}if(c===`/`&&l===`/`){s.lineComment=!0,o+=2;continue}if(c===`/`&&l===`*`){s.blockComment=!0,o+=2;continue}if(c===`'`||c===`"`){s.quote=c,o++;continue}if(c==="`"){t(a,{kind:`template`}),o++;continue}if(c===`\\`){let t=ln(e,o);if(t){o=t.end,W(s.expression,`word`);continue}}if(c===`/`&&o>=s.failedRegexUntil&&Zt(e,o,s.expression.forceRegex,s.expression.canEnd)){let t=Qt(e,o);if(t.end!==-1){o=t.end,W(s.expression,`regex`);continue}s.failedRegexUntil=t.failedUntil}if(c===`<`&&!s.expression.canEnd){let i=$t(e,o);if(i&&!i.closing){let s=r===`tsx`?pn(e,o,n):-1;if(s!==-1){o=s+1;continue}t(a,{blockComment:!1,closing:!1,kind:`tag`,name:i.name,opening:o,typeEnd:tn(e,i,n)}),o=i.nameEnd;continue}}if(c===`{`){let n=Kt(s.expression),r=s.expression.labelColon>=0,i=s.expression.statementStart&&(s.braceKinds.at(-1)===`B`||s.declarationBoundary>0||s.braceKinds.length===0&&Bt(e,o)),a=s.expression.forceRegex||r||i?`B`:n??(Vt(e,o,s.declarationBoundary,s.expression.parenKinds.length,s.expression.lastSignificant)?`B`:`O`);t(s.braceKinds,a),s.braceDepth++,s.expression.canEnd=!1,s.expression.forceRegex=!1,s.expression.labelCandidate=!1,s.expression.labelColon=-1,s.expression.lastSignificant=`{`,s.expression.lastWord=``,s.expression.statementStart=a===`B`,o++;continue}if(c===`}`&&s.braceDepth>0){if(s.braceDepth--,s.terminating&&s.braceDepth===0)a.pop();else{let e=s.braceKinds.pop();s.expression.canEnd=e!==`B`,s.expression.forceRegex=e===`B`,s.expression.labelCandidate=!1,s.expression.labelColon=-1,s.expression.lastSignificant=`}`,s.expression.lastWord=``,s.expression.statementStart=e===`B`,e===`B`&&(s.declarationBoundary=o+1)}o++;continue}if((c===`
|
|
12
|
+
`||c===`\r`||c===`\u2028`||c===`\u2029`)&&qt(s.expression,s.braceDepth)){o++;continue}/\s/.test(c)||(s.expression.forceRegex=!1),s.expression.canEnd=Xt(e,o,s.expression.canEnd,s.expression),c===`;`&&(Jt(s.expression,s.braceKinds.at(-1)===`T`),s.braceKinds.length===0&&(s.declarationBoundary=o+1)),o++}return i}function hn(e,t,n){return!t&&n.has(e)}function gn(e,t){for(;t>=0&&/\s/.test(e[t]??``);)t--;if(e[t]!==`=`)return!1;for(t--;t>=0&&/\s/.test(e[t]??``);)t--;let n=t+1;for(;t>=0&&/[\w$-]/.test(e[t]??``);)t--;let r=e.slice(t+1,n);return r===`class`||r===`className`}function _n(e,t){return gn(e,t-1)}function vn(e,t){let n=t-1;for(;n>=0&&/\s/.test(e[n]??``);)n--;return e[n]===`{`?gn(e,n-1):gn(e,n)}function yn(e){for(let t=e.classParenRoles.length-1;t>=0;t--){let n=e.classParenRoles[t];if(n!==`T`)return n===`C`}return!1}function bn(e,t,n){let r=t-1;for(;r>=0&&/\s/.test(e[r]??``);)r--;return e[r]===`(`?n.classParenRoles.at(-1)===`T`:e[r]===`[`||e[r]===`?`||e[r]===`:`||e[r]===`&`&&e[r-1]===`&`||e[r]===`|`&&e[r-1]===`|`}function xn(e,t,n,r,i){if(r===`block`){let n=e.indexOf(`*/`,t);return n===-1?e.length:n}if(r===`line`){for(let n=t;n<e.length;n++){let t=e[n];if(t===`
|
|
13
|
+
`||t===`\r`||t===`\u2028`||t===`\u2029`)return n}return e.length}if(n){for(let r=t;r<e.length;r++){let t=e[r];if(t===`\\`)r=H(e,r)-1;else if(t===n||t===`
|
|
14
|
+
`||t===`\r`||t===`\u2028`||t===`\u2029`)return r}return e.length}if(i)for(let n=t;n<e.length;n++){let t=e[n];if(t===`\\`)n=H(e,n,!0)-1;else if(t==="`"||t===`$`&&e[n+1]===`{`)return n}return e.length}function Sn(e,n,r){if(!e.includes(`{`))return e;let i=new Map,a=n!==`none`&&e.includes(`<`)?mn(e,i,n):new Set,o=``,s=0,c,l,u=!1,d=-1,f=0,p=[],m=0,h=-1,g=Ht(),_,v=0,y=!1,b=0,x=0,S,C=-1,w=[],T=[],E=[],D=[],O=-1;for(;s<e.length;){let k=e[s];if(_){let t=Ze(e,s,_);o+=e.slice(s,t),s=t,_.depth===0&&(_=void 0,v=t);continue}if(l){if(l===`line`&&(k===`
|
|
15
|
+
`||k===`\r`||k===`\u2028`||k===`\u2029`)){l=void 0,d=-1,f=0,qt(g,p.length)&&(m=s+1),o+=k,s++;continue}if(l===`block`&&k===`*`&&e[s+1]===`/`){l=void 0,d=-1,f=0,o+=`*/`,s+=2;continue}if(k!==`{`){o+=k,s++;continue}}else if(c){if(k===`
|
|
16
|
+
`||k===`\r`||k===`\u2028`||k===`\u2029`){c=void 0,u=!1,d=-1,f=0,W(g,`string`),o+=k,s++;continue}if(k===`\\`){let t=H(e,s);o+=e.slice(s,t),s=t;continue}if(k===c){c=void 0,u=!1,d=-1,f=0,W(g,`string`),o+=k,s++;continue}if(k!==`{`){o+=k,s++;continue}}else if(D.at(-1)?.inText){let n=D.at(-1);if(k===`\\`){let t=H(e,s,!0);o+=e.slice(s,t),s=t;continue}if(k==="`"){D.pop(),W(g,`template`),o+=k,s++;continue}if(k===`{`&&e[s-1]===`$`){n.groupLimit=-1,n.inText=!1,n.interpolationDepth=1,t(p,`I`),g.canEnd=!1,g.forceRegex=!1,g.lastSignificant=`{`,g.lastWord=``,o+=k,s++;continue}if(n.css){let t=Ze(e,s,n.css);o+=e.slice(s,t),s=t,n.css.depth===0&&(n.css=void 0,n.cssBoundary=t);continue}if(k!==`{`){o+=k,s++;continue}}else if(S===`text`){if(k===`{`){let r=n===`auto`?Xe(e,s):void 0;if(r){O===s&&o.length>0&&!/\s/.test(o.at(-1))&&(o+=` `),o+=r.value,O=r.end,s=r.end;continue}t(T,`T`),S=void 0,t(p,`J`),x++,t(w,!1),g.canEnd=!1,g.forceRegex=!1,g.lastSignificant=`{`,g.lastWord=``}else if(k===`<`&&(e[s+1]===`/`||e[s+1]===`>`||/[A-Z_$a-z]/.test(e[s+1]??``))){y=e[s+1]===`/`,S=`tag`;let t=$t(e,s);C=t?tn(e,t,i):-1}o+=k,s++;continue}else if(S===`tag`&&s<=C){o+=k,s++;continue}else if(S===`tag`&&k===`{`){t(T,`G`),S=void 0,t(p,`J`),x++,t(w,_n(e,s)),g.canEnd=!1,g.forceRegex=!1,g.lastSignificant=`{`,g.lastWord=``,o+=k,s++;continue}else if(S===`tag`&&k===`>`){let t=s-1;for(;/\s/.test(e[t]??``);)t--;let n=e[t]===`/`;y?b=Math.max(0,b-1):n||b++;let r=E.at(-1);r&&b===r.baseDepth&&(y||n)?(E.pop(),S=r.resumeExpression?void 0:b>0?`text`:void 0,W(g,`jsx`)):S=`text`,y=!1,C=-1,o+=k,s++;continue}else if(S===`tag`&&k!==`'`&&k!==`"`){o+=k,s++;continue}else if(k===`<`&&hn(s,g.canEnd,a)){t(E,{baseDepth:b,resumeExpression:x>0}),y=!1,S=`tag`;let n=$t(e,s);C=n?tn(e,n,i):-1,o+=k,s++;continue}else if(k===`\\`){let t=ln(e,s);if(t){o+=e.slice(s,t.end),s=t.end,W(g,`word`);continue}}else if(k===`'`||k===`"`){c=k,u=vn(e,s)||yn(g)||S===void 0&&w.at(-1)===!0&&bn(e,s,g),d=-1,f=s+1,o+=k,s++;continue}else if(k==="`"){t(D,{classLiteral:vn(e,s)||yn(g)||S===void 0&&w.at(-1)===!0&&bn(e,s,g),cssBoundary:s+1,groupLimit:-1,inText:!0,interpolationDepth:0}),o+=k,s++;continue}else if(k===`/`&&e[s+1]===`/`){l=`line`,d=-1,f=s+2,o+=`//`,s+=2;continue}else if(k===`/`&&e[s+1]===`*`){l=`block`,d=-1,f=s+2,o+=`/*`,s+=2;continue}else if(k===`/`&&s>=h&&Zt(e,s,g.forceRegex,g.canEnd)){let t=Qt(e,s);if(t.end!==-1){o+=e.slice(s,t.end),s=t.end,W(g,`regex`);continue}h=t.failedUntil}if(k===`}`){let e=p.pop(),t=D.at(-1);if(t&&!t.inText&&(t.interpolationDepth--,t.interpolationDepth===0&&(t.groupLimit=-1,t.inText=!0)),e===`J`&&(x--,w.pop(),S=T.at(-1)===`G`?`tag`:`text`,T.pop()),e===`T`){let e=g.pendingFunctions.at(-1);e?.phase===`return-type`&&(e.typeCanEnd=!0)}g.canEnd=e!==`B`,g.forceRegex=e===`B`,g.labelCandidate=!1,g.labelColon=-1,g.lastSignificant=`}`,g.lastWord=``,g.statementStart=e===`B`,e===`B`&&(m=s+1),o+=k,s++;continue}if(k!==`{`){(k===`
|
|
17
|
+
`||k===`\r`||k===`\u2028`||k===`\u2029`)&&qt(g,p.length)&&(m=s+1),/\s/.test(k)||(g.forceRegex=!1),g.canEnd=Xt(e,s,g.canEnd,g),k===`;`&&(Jt(g,p.at(-1)===`T`),p.length===0&&(m=s+1)),o+=k,s++;continue}let A=l===void 0&&c===void 0&&!D.at(-1)?.inText,j=A?Kt(g):void 0,M=A&&g.labelColon>=0,ee=A&&g.statementStart&&(p.at(-1)===`B`||m>0||p.length===0&&Bt(e,s));if(A&&(p.length>0||j!==void 0||M||ee||g.forceRegex||g.lastSignificant&&$e.includes(g.lastSignificant)||et.has(g.lastWord)||vt(e,s,Math.max(m,v))||ht(e,s)||gt(e,s))){let n=g.forceRegex||M||ee?`B`:j??(Vt(e,s,m,g.parenKinds.length,g.lastSignificant)?`B`:`O`);t(p,n);let r=D.at(-1);r&&!r.inText&&r.interpolationDepth++,g.canEnd=!1,g.forceRegex=!1,g.labelCandidate=!1,g.labelColon=-1,g.lastSignificant=`{`,g.lastWord=``,g.statementStart=n===`B`,o+=k,s++;continue}let N=D.at(-1),P=e.length;if(c||l?(d<s&&(d=xn(e,s+1,c,l,!1)),P=d):N?.inText&&(N.groupLimit<s&&(N.groupLimit=xn(e,s+1,void 0,void 0,!0)),P=N.groupLimit),(e[s-1]===`#`||e[s-1]===`@`)&&!_t(e,s-1)){let t=Qe(e,s,P);if(t!==-1){o+=e.slice(s,t+1),s=t+1;continue}}let F=N?.inText===!0,I=c===void 0&&l===void 0&&!F?Ge(e,s,P):We(e,s,P),te=I.kind===`close`?I.index:-1,ne=N===void 0||F||c!==void 0||l!==void 0,re=F?N.cssBoundary:c||l?f:v,ie=ne&&!u&&!(F&&N.classLiteral)&&mt(e,s,F,re),ae=ie?Qe(e,s,P):-1;if(ie&&(c===void 0&&l===void 0||ae!==-1)&&(ae===-1||e[ae+1]!==`@`)){let e={blockComment:!1,depth:1,lineComment:!1,parenDepth:0};F?N.css=e:_=e,o+=k,s++;continue}if(I.kind!==`close`){I.kind===`open`&&r&&(r.seen=!0),o+=e.slice(s,I.index),s=I.index,F?N.cssBoundary=I.index:c||l?f=I.index:v=I.index;continue}let oe=e.slice(s+1,te),{conds:L,end:R}=qe(e,te+1,P),se=Je(oe,!0);if(se.length===0){o+=k,s++;continue}O===s&&o.length>0&&!/\s/.test(o.at(-1))&&(o+=` `),o+=se.map(e=>`${e}${L}`).join(` `),O=R,F?N.cssBoundary=R:c||l?f=R:v=R,s=R}return o}function Cn(e){return Sn(e,`auto`)}function wn(e,t){let n={seen:!1};return{code:Sn(e,t,n),nestedOpening:n.seen}}const Tn=/^(?:--?[\w-]+|[A-Z_$][\w$-]*|@teacss-skip-bracket-[\da-z]{6})$/i;function En(e,t){let n=t;for(;n>0&&/[\w-]/.test(e[n-1]);)n--;if(n===t||e[n-1]!==`:`)return!1;let r=n-1,i=r;for(;i>0&&/[\w$@-]/.test(e[i-1]);)i--;if(!Tn.test(e.slice(i,r)))return!1;let a=i-1;for(;a>=0&&/\s/.test(e[a]);)a--;return a<0||!`{,?`.includes(e[a])}function Dn(e){let n=[],r=[],i=[],a=!1,o;for(let s=0;s<e.length;s++){let c=e[s],l=e[s+1];if(r.length===0){c===`(`&&En(e,s)&&t(r,{attached:!0,start:s});continue}if(a)c===`*`&&l===`/`&&(a=!1,s++);else if(o)c===`\\`?s++:c===o&&(o=void 0);else if(c===`\\`)s++;else if(c===`/`&&l===`*`)a=!0,s++;else if(c===`'`||c===`"`||c==="`")o=c;else if(i.length>0)c===`[`||c===`(`?t(i,c===`[`?`]`:`)`):c===i.at(-1)&&i.pop();else if(c===`[`)t(i,`]`);else if(c===`(`)t(r,{attached:En(e,s),start:s});else if(c===`)`){let e=r.pop();e.attached&&t(n,{end:s+1,start:e.start})}}let s=[];for(let e of n.sort((e,t)=>e.start-t.start||t.end-e.end))(s.length===0||e.start>=s.at(-1).end)&&t(s,e);return s}function On(e){let t={seen:!1},n=kn(e,t);for(let e=1;e<5&&t.seen;e++){t.seen=!1;let e=kn(n,t);if(e===n)break;n=e}return n}function kn(e,t){if(!e.includes(`{`))return e;let n=``,r=0,i=-1,a=0,o=0,s=e.includes(`[`)?Me(e):[],c=e.includes(`(`)?Dn(e):[],l={closers:[]};for(;r<e.length;){for(;a<s.length&&s[a].end<=r;)a++;for(;o<c.length&&c[o].end<=r;)o++;let u=a<s.length?s[a]:void 0,d=o<c.length?c[o]:void 0,f=u?.start===r?u:d?.start===r?d:void 0;if(f&&l.blockComment!==!0&&l.quote===void 0){n+=e.slice(r,f.end),r=f.end;continue}l.closers.length>0&&/\s/.test(e[r])&&(l.blockComment=!1,l.closers.length=0,l.quote=void 0);let p=V(e,r,l);if(p!==void 0){n+=e.slice(r,p+1),r=p+1;continue}let m=e[r];if(l.closers.length>0||m!==`{`){n+=m,r++;continue}let h=We(e,r);if(h.kind!==`close`){h.kind===`open`&&t&&(t.seen=!0),n+=e.slice(r,h.index),r=h.index;continue}let g=h.index,_=e.slice(r+1,g),{conds:v,end:y}=qe(e,g+1),b=Je(_,!0);if(b.length===0){n+=m,r++;continue}i===r&&n.length>0&&!/\s/.test(n.at(-1))&&(n+=` `),n+=b.map(e=>`${e}${v}`).join(` `),i=y,r=y}return n}function An(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function jn(e){let t=e.length,n=-1,r,i=``,a=e.charCodeAt(0);for(;++n<t;){if(r=e.charCodeAt(n),r===0){i+=`�`;continue}if(r>=1&&r<=31||r===127||n===0&&r>=48&&r<=57||n===1&&r>=48&&r<=57&&a===45){i+=`\\${r.toString(16)} `;continue}if(n===0&&t===1&&r===45){i+=`\\${e.charAt(n)}`;continue}if(r>=128||r===45||r===95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){i+=e.charAt(n);continue}i+=`\\${e.charAt(n)}`}return i}const Mn=jn,Nn=/^[\da-z]{6}$/,Pn=/\.(css|postcss|sass|scss|less|stylus|styl)($|\?)/;function Fn(e){return e.replace(/\?.*$/s,``)}function In(e){return Pn.test(e)}function Ln(e){let t,n,r=2166136261;for(t=0,n=e.length;t<n;t++)r^=e.charCodeAt(t),r+=(r<<1)+(r<<4)+(r<<7)+(r<<8)+(r<<24);return`00000${(r>>>0).toString(36)}`.slice(-6)}function Rn(e,t){let n=new Set,r=t.length+6;for(let i=0;i+r<=e.length;){let a=e.indexOf(t,i);if(a===-1||a+r>e.length)break;let o=e.slice(a,a+r);Nn.test(o.slice(t.length))&&n.add(o),i=a+1}return n}function zn(e){let t=e.keys().next().value;if(t===void 0||t.length<6)return;let n=t.slice(0,-6);if(n&&!/[\da-z]/.test(n[0])){for(let t of e.keys())if(t.length!==n.length+6||!t.startsWith(n)||!Nn.test(t.slice(n.length)))return;return RegExp(`${An(n)}[\\da-z]{6}`,`g`)}}function Bn(e,t,n,r){let i=Rn(e,r),a=new Set([...t.keys(),...i]);return e.replace(n,e=>{let n=0,o;for(;o=`${r}${Ln(n?`${e}:${n}`:e)}`,n++,(t.get(o)!==e||i.has(o))&&a.has(o););return a.add(o),t.set(o,e),o})}function Vn(e,t){let n=zn(t);if(n!==void 0)return e.replace(n,e=>t.get(e)??e);let r=[...t.keys()].filter(Boolean).sort((e,t)=>t.length-e.length);if(!r.length)return e;let i=new RegExp(r.map(An).join(`|`),`g`);return e.replace(i,e=>t.get(e)??e)}function Hn(e,t,n){try{let r=[];return String.prototype.replace.call(e,t,(...e)=>{let t=e.length>0&&typeof e.at(-1)==`object`,n=e[e.length-(t?3:2)];return Object.defineProperty(r,r.length,{configurable:!0,enumerable:!0,value:{args:e,end:n+String(e[0]).length,start:n},writable:!0}),e[0]}),Promise.all(r.map(async({args:e})=>n(e[0],...e.slice(1)))).then(t=>{let n=0,i=``;for(let a=0;a<r.length;a++){let o=r[a];o.start<n||(i+=e.slice(n,o.start)+t[a],n=o.end)}return i+e.slice(n)})}catch(e){return Promise.reject(e)}}const Un=/[\\:]?[\s'"`;{}]+/g,Wn=new RegExp(Un),Gn=/([\\:]?[\s"'`;<>]|:\(|\)"|\)\s)/g,Kn=`@teacss-skip-bracket-`,qn=/@teacss-skip-bracket-[\da-z]{6}/g,Jn=/[\s'"`;{}]/,Yn=/^!?[.#>_+~:]/,Xn=/[^\S\t\n\v\f\r \u2028\u2029]/;function Zn(e,t){return/[A-Z_$]/i.test(e[t+1]??``)}function Qn(e,t,n){if(n>0)return!0;if(!/\s/.test(e[t-1]??``))return!1;let r=t-1;for(;r>=0&&/\s/.test(e[r]);)r--;return e[r]!==`=`}function $n(e){return e!==void 0&&/\.html?$/i.test(e.split(/[?#]/,1)[0])}function er(e){return e!==void 0&&/\.(?:[cm]?[jt]sx?|mdx)$/i.test(e.split(/[?#]/,1)[0])}function tr(e){if(e===void 0)return`auto`;let t=e.split(/[?#]/,1)[0];return/\.(?:[cm]?ts)$/i.test(t)?`none`:/\.tsx$/i.test(t)?`tsx`:/\.(?:jsx|mdx)$/i.test(t)?`raw`:`auto`}function nr(e,t){let n=[],r=[],i=!1,a=0,o=!1,s=!1,c;for(let l=0;l<e.length;l++){let u=e[l],d=e[l+1];if(!o){if(e.startsWith(`<!--`,l)){let t=e.indexOf(`-->`,l+4);if(t===-1)break;l=t+2}else u===`<`&&Zn(e,l)&&(o=!0,r=[]);continue}if(s){ir(u)&&(s=!1);continue}if(i){u===`*`&&d===`/`&&(i=!1,l++);continue}if(c){u===`\\`?l++:u===c&&(c=void 0);continue}if(u===`/`&&d===`*`&&Qn(e,l,a)){i=!0,l++;continue}if(u===`/`&&d===`/`&&Qn(e,l,a)){s=!0,l++;continue}if(u===`"`||u===`'`||u==="`"){c=u;continue}if(a>0){u===`{`?a++:u===`}`&&a--;continue}if(u===`{`){a=1;continue}if(u===`>`){for(let e of r)B(n,e);r=[],o=!1;continue}if(!/\s/.test(e[l-1]??``)||e.slice(l,l+5).toLowerCase()!==`class`)continue;let f=l+5;for(;/\s/.test(e[f]??``);)f++;if(e[f]!==`=`)continue;for(f++;/\s/.test(e[f]??``);)f++;if(!e[f]||(t?/[\s"'`=<>]/:/[\s"'`={<>]/).test(e[f]))continue;let p=f+1;for(;p<e.length&&!/[ \t\n\r\f"'`=<>]/.test(e[p]);)p++;B(r,{end:p,start:l,valueStart:f}),l=p-1}if(n.length===0)return e;let l=[],u=0;for(let{end:t,start:r,valueStart:i}of n){let n=e.slice(i,t);B(l,e.slice(u,r)),B(l,` `.repeat(t-r-n.length-2)),B(l,`"${n}"`),u=t}return B(l,e.slice(u)),l.join(``)}function rr(e){if(!e)return!1;let t=e.charCodeAt(0);switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 34:case 39:case 59:case 96:case 123:case 125:return!0;default:return t>127&&Jn.test(e)}}function ir(e){let t=e?.charCodeAt(0);return t===10||t===13||t===8232||t===8233}function ar(e,t){return e[t+1]===`\r`&&e[t+2]===`
|
|
18
|
+
`?t+2:t+1}function or(e,t){let n=t;for(;/\s/.test(e[n]??``);)n++;if(e[n]!==`:`)return!1;for(n++;/\s/.test(e[n]??``);)n++;return e[n]===`[`&&Ae(e,n)}const sr=new Set([`await`,`break`,`case`,`continue`,`debugger`,`delete`,`do`,`else`,`in`,`instanceof`,`new`,`of`,`return`,`throw`,`typeof`,`void`,`yield`]),cr=new Set([`for`,`if`,`while`,`with`]);function lr(e,t){let n=0;for(;t>0&&e[--t]===`\\`;)n++;return n%2==1}function ur(e,t){let n=0;for(let r=t;r>=0;r--){let t=e[r];if(t===`"`||t===`'`||t==="`"){let n=r-1;for(;n>=0&&(e[n]!==t||lr(e,n));)n--;if(n<0)return!1;r=n}else if(t===`/`&&e[r-1]===`*`){let t=e.lastIndexOf(`/*`,r-2);if(t<0)return!1;r=t}else if(t===`)`)n++;else if(t===`(`){if(n--,n!==0)continue;let t=r;for(;t>0&&/\s/.test(e[t-1]);)t--;let i=t;for(;i>0&&/[\w$]/.test(e[i-1]);)i--;return i>0&&/[\w$.]/.test(e[i-1])?!1:cr.has(e.slice(i,t))}}return!1}function dr(e,t){let n=0;for(let r=t;r>=0;r--){let t=e[r];if(t===`"`||t===`'`||t==="`"){let n=r-1;for(;n>=0&&(e[n]!==t||lr(e,n));)n--;if(n<0)return-1;r=n}else if(t===`/`&&e[r-1]===`*`){let t=e.lastIndexOf(`/*`,r-2);if(t<0)return-1;r=t}else if(t===`}`)n++;else if(t===`{`&&(n--,n===0))return r}return-1}function fr(e,t){for(;t>0&&/\s/.test(e[t-1]);)t--;let n=t;for(;n>0&&/[\w$]/.test(e[n-1]);)n--;return{start:n,value:e.slice(n,t)}}function pr(e,t){let n=dr(e,t);if(n<0)return!1;let r=n;for(;r>0&&/\s/.test(e[r-1]);)r--;if(r===0)return!0;let i=e[r-1];if(i===`)`||i===`>`&&e[r-2]===`=`||`;{}:`.includes(i))return!0;let a=fr(e,r);return[`catch`,`class`,`do`,`else`,`finally`,`static`,`try`].includes(a.value)?!0:a.value?fr(e,a.start).value===`class`:!1}function mr(e,t){if(e[t+1]===`/`||e[t+1]===`*`||e[t-1]===`<`&&(e[t+1]===`>`||/[A-Z_$]/i.test(e[t+1]??``)))return!1;let n=t-1;for(;n>=0&&/\s/.test(e[n]);)n--;if(n<0)return!0;if((e[n]===`+`||e[n]===`-`)&&e[n-1]===e[n]||e[n]===`!`&&n>0&&/[\w$)\]]/.test(e[n-1]??``)||e[n]===`>`&&n>0&&/[\w$)>]/.test(e[n-1]??``))return!1;if(`=([{,:;!?&|+-*%^~<>`.includes(e[n])||e[n]===`)`&&ur(e,n)||e[n]===`}`&&pr(e,n))return!0;let r=n+1;for(;n>=0&&/[\w$]/.test(e[n]);)n--;let i=e.slice(n+1,r);return sr.has(i)?!0:i==="default"&&fr(e,n+1).value===`export`}function hr(e,t){let n=!1;for(let r=t+1;r<e.length;r++){let t=e[r];if(ir(t))return-1;if(t===`\\`)r++;else if(t===`[`)n=!0;else if(t===`]`)n=!1;else if(t===`/`&&!n){for(r++;/[a-z]/i.test(e[r]??``);)r++;return r}}return-1}function gr(e,t=!1){let n=[],r=[],i=[],a=!1,o=!1,s,c=-1,l,u=-1,d=!1,f=!1;function p(){f=!1,n.length=0,i=[],a=!1,o=!1,s=void 0,l=void 0}for(let m=0;m<e.length;m++){let h=e[m];if(!a&&!s&&h===`/`&&mr(e,m)){let t=hr(e,m);if(t!==-1){m=t-1,d=!1,f=!1;continue}}if(n.length===0){if(rr(h)?f=d=!1:h===`/`&&(d=!0),h===`@`&&!e.startsWith(Kn,m)&&!lr(e,m)&&(f=m>0&&(!rr(e[m-1])||e[m-1]===`}`)&&Yn.test(e.slice(m+1))),f&&h===`\\`){/\s/.test(e[m+1])&&(f=!1),m++;continue}h===`[`&&(B(n,m),o=d&&e[m-1]!==`:`&&e[m-1]!==`@`);continue}if(rr(h)&&(u=m),ir(h)){p();continue}if((a||s)&&/\s/.test(h)&&(l??=be(e,n.at(-1),!1,f?e.length:m),l===void 0)){p();continue}if(!a&&!s&&h===`/`&&o){p();continue}if(a){h===`*`&&e[m+1]===`/`&&(a=!1,m++);continue}if(s){h===`\\`?(ir(e[m+1])?p():rr(e[m+1])&&(u=m+1),m++):h===s&&(B(i,[c+1,m]),s=void 0);continue}if(h===`/`&&e[m+1]===`*`)a=!0,m++;else if(h===`"`||h===`'`)s=h,c=m;else if(h===`\\`)ir(e[m+1])&&p(),rr(e[m+1])&&(u=m+1),m++;else if(h===`[`)B(n,m);else if(h===`]`){let a=n.pop(),s=m+1,c=!1;if(u>a){let n=f||e[a-1]===`:`||e[a-1]===`@`,i=e[s]===`:`&&!!e[s+1]&&!Jn.test(e[s+1]);c=n&&!ke(e,a)||i&&!(t&&or(e,s)),c&&B(r,[a,s])}if(n.length===0){if(o=!1,l=void 0,!c)for(let[t,n]of i)for(let[i,a]of gr(e.slice(t,n)))B(r,[t+i,t+a]);i=[]}}}let m=[];for(let e of r.sort(([e,t],[n,r])=>e-n||r-t))(m.length===0||e[0]>=m.at(-1)[1])&&B(m,e);return m}const _r=/^(?:--?[\w-]+|[A-Z_$][\w$-]*|@teacss-skip-bracket-[\da-z]{6})$/i;function vr(e,t){let n=t;for(;n>0&&/[\w-]/.test(e[n-1]);)n--;if(n===t||e[n-1]!==`:`)return!1;let r=n-1,i=r;for(;i>0&&/[\w$@-]/.test(e[i-1]);)i--;if(!_r.test(e.slice(i,r)))return!1;let a=i-1;for(;a>=0&&/\s/.test(e[a]);)a--;return a<0||!`{,?`.includes(e[a])}function yr(e){let t=[],n=[],r=[],i=!1,a,o,s=-1,c,l=()=>{if(s<0||n.length===0)return;let e=n.at(-1);e.attached&&e.containsGroupBrace&&B(t,[e.start,s+1]),s=-1};for(let u=0;u<e.length;u++){let d=e[u];if(n.length===0){a?a!=="`"&&ir(d)?a=void 0:d===`\\`?u=ar(e,u):d===a?a=void 0:d===`(`&&vr(e,u)&&(B(n,{attached:!0,containsGroupBrace:!1,outerQuote:a,start:u}),c=void 0):d===`"`||d===`'`||d==="`"?a=d:d===`(`&&vr(e,u)&&(B(n,{attached:!0,containsGroupBrace:!1,outerQuote:void 0,start:u}),c=void 0);continue}if(ir(d)){l(),n.length=0,r.length=0,i=!1,o=void 0,a!=="`"&&(a=void 0),c=void 0;continue}if((o||i)&&/\s/.test(d)&&(c??=be(e,n.at(-1).start,!0,u),c===void 0)){n.length=0,r.length=0,i=!1,o=void 0,s=-1;continue}if(o){d===`\\`?u=ar(e,u):d===o?o=void 0:d===`{`&&(n.at(-1).containsGroupBrace=!0);continue}if(i){d===`*`&&e[u+1]===`/`&&(i=!1,u++);continue}let f=n[0].outerQuote;if(d===`/`&&e[u+1]===`*`)i=!0,u++;else if(f&&d===f)l(),n.length=0,r.length=0,i=!1,a=void 0;else if(d===`"`||d===`'`||d==="`")o=d;else if(d===`\\`)u=ar(e,u);else if(r.length>0)d===`[`?B(r,`]`):d===`(`?B(r,`)`):d===r.at(-1)?(r.pop(),r.length===0?s=-1:d===`)`&&(s=u)):d===`{`&&(n.at(-1).containsGroupBrace=!0);else if(d===`[`)B(r,`]`);else if(d===`{`)n.at(-1).containsGroupBrace=!0;else if(d===`(`)B(n,{attached:vr(e,u),containsGroupBrace:!1,outerQuote:f,start:u});else if(d===`)`){let e=n.pop();e.attached&&e.containsGroupBrace&&B(t,[e.start,u+1]),e.containsGroupBrace&&n.length>0&&(n.at(-1).containsGroupBrace=!0),n.length===0&&(c=void 0)}}l();let u=[];for(let e of t.sort(([e,t],[n,r])=>e-n||r-t))(u.length===0||e[0]>=u.at(-1)[1])&&B(u,e);return u}function br(e,t,n){if(!t.length)return e;let r=new Set(e.match(qn)),i=[],a=0;for(let[o,s]of t){let t=e.slice(o,s),c=0,l;for(;l=`${Kn}${Ln(c?`${t}:${c}`:t)}`,c++,r.has(l)||n.has(l)&&n.get(l)!==t;);n.set(l,t),B(i,e.slice(a,o)),B(i,l),a=s}return B(i,e.slice(a)),i.join(``)}function xr(e,t,n=!1){return br(e,gr(e,n),t)}function Sr(e,t){return br(e,yr(e),t)}function Cr(e,t){let n=[],r=0;for(let t=0;t<e.length;t++){let i=e[t];if(i===`\\`){let i=e[t+1];r&&i&&(/['"`;{}]/.test(i)||r===2&&Xn.test(i))?B(n,[t,t+2]):rr(i)&&(r=0),t++}else rr(i)?r===2&&Xn.test(i)?B(n,[t,t+1]):r=0:i===`@`&&(r=Yn.test(e.slice(t+1))?2:1)}return br(e,n,t)}function wr(e,t){let n=e;for(let e=0;e<t.size&&n.includes(Kn);e++){let e=n.replace(qn,e=>t.get(e)??e);if(e===n)break;n=e}return n}function Tr(e,t){let n=new Map;Xn.test(e)&&(e=Cr(e,n)),e.includes(`[`)&&(e=xr(e,n,!0)),e.includes(`(`)&&(e=Sr(e,n));let r=wn(e,t);e=r.code;for(let i=1;i<5&&r.nestedOpening;i++){let i=e;if(i.includes(`[`)&&(i=xr(i,n)),i.includes(`(`)&&(i=Sr(i,n)),r=wn(i,t),r.code===i)break;e=r.code}e.includes(`[`)&&(e=xr(e,n)),e.includes(`(`)&&(e=Sr(e,n)),e.includes(`\\`)&&(e=Cr(e,n));let i=e.split(Un);return n.size?i.map(e=>e.includes(Kn)?wr(e,n):e):i}const Er={name:`@teacss/core/extractor-split`,order:0,extract({code:e,id:t}){return Tr(er(t)?e:nr(e,$n(t)),tr(t))}};var Dr=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 G(e){return e instanceof Dr}function Or(e,t,n){if(Object.hasOwn(e,t)){if(!Reflect.set(e,t,n))throw TypeError(`Cannot assign event "${String(t)}"`)}else Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}function kr(){return{events:Object.create(null),emit(e,...t){let r=this.events,i=Array.from(n(Object.hasOwn(r,e)?r[e]:void 0));for(let e of i)e(...t)},on(e,r){let i=this.events,a=Object.hasOwn(i,e)?i[e]:void 0,o=Array.isArray(a)?a:[];o!==a&&Or(i,e,o),t(o,r);let s=!0;return()=>{s&&=(Or(i,e,Array.from(n(Object.hasOwn(i,e)?i[e]:void 0)).filter(e=>e!==r)),!1)}}}}const Ar=/^\[(.+?)~?="(.*)"\]$/,jr=/[\w\u00A0-\uFFFF%-?]/,Mr=new RegExp(Ar.source,Ar.flags),Nr=/\.(css|postcss|sass|scss|less|stylus|styl)($|\?)/,Pr=new RegExp(jr.source,jr.flags);function Fr(e){return e.match(Ar)}function Ir(e=``){return jr.test(e)}function Lr(e){return typeof e==`function`?{match:e}:e}function Rr(e){return e.length===3&&Object.hasOwn(e,0)&&Object.hasOwn(e,1)&&Object.hasOwn(e,2)}function zr(e){return e!=null}function Br(e){return e!=null&&(typeof e==`object`||typeof e==`function`)&&typeof e.then==`function`}function Vr(){}function Hr(e,t){for(let n=0;n<t.length;n++){if(!Object.hasOwn(t,n))continue;let r=t[n],i=Object.hasOwn(r,2)?r[2]:void 0;if(i){let t=i;for(;t!==null&&t!==Object.prototype&&!Object.hasOwn(t,`layer`);)t=Object.getPrototypeOf(t);if(t!==null&&t!==Object.prototype){if(!Reflect.set(i,`layer`,e))throw TypeError(`Cannot assign rule layer`)}else D(i,`layer`,e)}else if(Object.hasOwn(r,2)){if(!Reflect.set(r,2,{layer:e}))throw TypeError(`Cannot assign rule metadata`)}else D(r,2,{layer:e})}return t}var Ur=class{_map=new Map;get(e,t){let n=this._map.get(e);if(n)return n.get(t)}getFallback(e,t,n){let r=this._map.get(e);return r||(r=new Map,this._map.set(e,r)),r.has(t)||r.set(t,n),r.get(t)}set(e,t,n){let r=this._map.get(e);return r||(r=new Map,this._map.set(e,r)),r.set(t,n),this}has(e,t){return this._map.get(e)?.has(t)??!1}delete(e,t){let n=this._map.get(e);if(!n)return!1;let r=n.delete(t);return r&&n.size===0&&this._map.delete(e),r}deleteTop(e){return this._map.delete(e)}map(e){return Array.from(this._map.entries()).flatMap(([t,n])=>Array.from(n.entries()).map(([n,r])=>e(r,t,n)))}},Wr=class extends Map{getFallback(e,t){let n=this.get(e);return n===void 0&&!this.has(e)?(this.set(e,t),t):n}map(e){let t=[];return this.forEach((n,r)=>{D(t,t.length,e(n,r))}),t}flatMap(e){let r=[];return this.forEach((i,a)=>{for(let o of n(e(i,a)))t(r,o)}),r}};function Gr(e){if(!Object.hasOwn(e,0))return;let t=e[0];if(typeof t==`string`||typeof t==`symbol`)return[t,Object.hasOwn(e,1)?e[1]:void 0]}function Kr(e){return Reflect.ownKeys(e).filter(t=>Object.getOwnPropertyDescriptor(e,t)?.enumerable)}function qr(e,t){if(Object.getOwnPropertyDescriptor(e,t)?.enumerable)return{value:Reflect.get(e,t)}}function Jr(e){let n=[];for(let r of Kr(e)){let i=qr(e,r);i&&t(n,[r,i.value])}return n}function Yr(e){if(j(e))return e;let r=[];for(let i of Array.isArray(e)?n(e):Jr(e)){let e=Gr(i);e!==void 0&&e[1]!=null&&t(r,i)}return r}function Xr(e){if(Array.isArray(e)){let t=Array.from(n(e));return t.every(e=>Array.isArray(e)&&e.length>0&&!Array.isArray(Object.hasOwn(e,0)?e[0]:void 0))||t.length===0?[t]:t.map(e=>Yr(e))}return[Yr(e)]}function Zr(e){let r=[],i,a;for(let o of n(e)){let e=Gr(o);if(!e)continue;let[n,s]=e;typeof n==`string`&&(n.startsWith(`$$`)||(n===`__virtual_key__`||i!==n||a!==s)&&(t(r,o),i=n,a=s))}return r}const Qr=`__virtual_key__`;function $r(e,t){return t==null||typeof t==`function`||typeof e!=`string`?``:e===`__virtual_key__`?t?String(t):``:`${e}:${t};`}function ei(e){if(e==null||e.length===0)return``;let t=``,r,i;for(let a of n(e)){let e=Gr(a);if(!e)continue;let[n,o]=e;typeof n==`string`&&(n.startsWith(`$$`)||(n===`__virtual_key__`||r!==n||i!==o)&&(t+=$r(n,o),r=n,i=o))}return t}function K(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}const ti=`$reset`;function ni(e,t,r=!1){let i=e,a=t;if(Array.isArray(a))return[...r&&Array.isArray(i)?n(i):[],...n(a)];if(K(a)&&Object.hasOwn(a,`$reset`)&&a.$reset)return ri(a);if(!K(a))return a;if(!K(i))return ri(a);let o={...i};return Kr(a).forEach(e=>{if(e===`$reset`)return;let t=qr(a,e);if(!t)return;let n=t.value,i=Object.hasOwn(o,e)?Reflect.get(o,e):void 0;K(n)||Array.isArray(n)?D(o,e,ni(i,n,r)):D(o,e,n)}),o}function ri(e){if(Array.isArray(e))return Array.from(n(e),ri);if(K(e)){let t={};for(let n of Kr(e)){if(n===`$reset`)continue;let r=qr(e,n);r&&D(t,n,ri(r.value))}return t}return e}function ii(e){return typeof e!=`object`||!e?e:q(e)}function q(e){if(Array.isArray(e)){let t=Array.from({length:e.length});for(let n=t.length-1;n>=0;n--)t[n]=Object.hasOwn(e,n)?ii(e[n]):void 0;return t}if(K(e)){let t=e,n={};for(let e of Kr(t)){let r=qr(t,e);r&&D(n,e,ii(r.value))}return n}return e}function ai(e){return Object.hasOwn(e,0)&&j(e[0])}function oi(e){return Object.hasOwn(e,0)&&j(e[0])}const si=Object.getOwnPropertyDescriptor(RegExp.prototype,`source`).get,ci=[[`d`,Object.getOwnPropertyDescriptor(RegExp.prototype,`hasIndices`)?.get],[`g`,Object.getOwnPropertyDescriptor(RegExp.prototype,`global`)?.get],[`i`,Object.getOwnPropertyDescriptor(RegExp.prototype,`ignoreCase`)?.get],[`m`,Object.getOwnPropertyDescriptor(RegExp.prototype,`multiline`)?.get],[`s`,Object.getOwnPropertyDescriptor(RegExp.prototype,`dotAll`)?.get],[`u`,Object.getOwnPropertyDescriptor(RegExp.prototype,`unicode`)?.get],[`v`,Object.getOwnPropertyDescriptor(RegExp.prototype,`unicodeSets`)?.get],[`y`,Object.getOwnPropertyDescriptor(RegExp.prototype,`sticky`)?.get]],li=Object.getOwnPropertyDescriptor(RegExp.prototype,`global`)?.get,ui=Object.getOwnPropertyDescriptor(RegExp.prototype,`sticky`)?.get,di=RegExp.prototype.exec;function J(e){return Reflect.apply(si,e,[])}function fi(e){return!!(li&&Reflect.apply(li,e,[])||ui&&Reflect.apply(ui,e,[]))}function Y(e){let t=``;for(let[n,r]of ci)r&&Reflect.apply(r,e,[])&&(t+=n);return t}function pi(e,t){let n=t.exec;if(!fi(t))return Reflect.apply(n,t,[e]);if(Object.getOwnPropertyDescriptor(t,`lastIndex`)?.writable===!1){if(n!==di)return Reflect.apply(n,t,[e]);let r=new RegExp(J(t),Y(t));return Reflect.apply(di,r,[e])}t.lastIndex=0;try{return Reflect.apply(n,t,[e])}finally{Object.getOwnPropertyDescriptor(t,`lastIndex`)?.writable!==!1&&(t.lastIndex=0)}}const mi=/^[a-z][a-z0-9-]*$/,hi={minAffix:4,maxDistance:1,minDistanceLength:6,segmentAffix:!0},gi={minAffix:3,maxDistance:1,minDistanceLength:0,segmentAffix:!1},_i={minAffix:3,maxDistance:2,minDistanceLength:0,segmentAffix:!1},vi=new Set([`about`,`blob`,`bun`,`chrome`,`data`,`deno`,`file`,`ftp`,`http`,`https`,`jsr`,`mailto`,`node`,`npm`,`tel`,`urn`,`vscode`,`virtual`,`ws`,`wss`]);function yi(e){let{body:t,important:n}=Ne(e);return n?`${t}!`:t}function bi(e){let t=yi(e);if(!t||t.startsWith(`$`)||t.startsWith(`[`))return!1;let n=t.indexOf(`:`);if(n<=0||n===t.length-1)return!1;let r=t.slice(0,n);return!mi.test(r)||t.startsWith(`//`,n+1)?!1:!vi.has(r)}function xi(e){if(Y(e))return;let t=J(e);if(!t.startsWith(`^`))return;let n=1;for(;n<t.length&&/[A-Za-z0-9_-]/.test(t[n]);)n++;return t[n]===`:`&&n>1?t.slice(1,n):void 0}function Si(e,t){let n=Object.hasOwn(e,2)?e[2]:void 0,r=n;for(;r!=null&&r!==Object.prototype&&r!==Array.prototype&&r!==Function.prototype;){if(Object.hasOwn(r,t))return Reflect.get(n,t);r=Object.getPrototypeOf(r)}}function Ci(e){return n(O(Si(e,`prefix`)||``))}function wi(e,t){for(let r of n(t))for(let t of Ci(r))if(e.startsWith(t)&&pi(e.slice(t.length),r[0]))return!0;return!1}const Ti=new WeakMap;function Ei(e){let t=e.rulesStaticMap,r=Ti.get(t);if(r)return r;let i=new Map,a=new Set,o=new Set;for(let e of Object.keys(t)){let n=e.indexOf(`:`);if(n<=0)continue;let r=e.slice(0,n),a=Object.hasOwn(t,e)&&t[e];if(!a)continue;if(Si(a,`internal`)){o.add(r);continue}let s=i.get(r);s||(s=new Set,i.set(r,s)),s.add(e.slice(n+1))}for(let t of n(e.rulesDynamic)){let e=xi(t[0]);if(e!=null)for(let n of Ci(t)){let r=(n+e).split(`:`,1)[0];Si(t,`internal`)?o.add(r):i.has(r)||a.add(r)}}let s={prefixValues:i,dynamicPrefixes:a,internalPrefixes:o};return Ti.set(t,s),s}function Di(e,t,n){if(e===t)return 0;if(Math.abs(e.length-t.length)>n)return 1/0;let r=Array.from({length:t.length+1},(e,t)=>t),i=[...r];for(let a=1;a<=e.length;a++){i[0]=a;let o=a;for(let n=1;n<=t.length;n++){let s=e[a-1]===t[n-1]?0:1;i[n]=Math.min(r[n]+1,i[n-1]+1,r[n-1]+s),i[n]<o&&(o=i[n])}if(o>n)return 1/0;[r,i]=[i,r]}return r[t.length]<=n?r[t.length]:1/0}function Oi(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;return r}function ki(e,t){return(t.startsWith(e)?t[e.length]===`-`:t.endsWith(e)&&t[t.length-e.length-1]===`-`)&&(e.includes(`-`)||e.length>=6)}function Ai(e,t,n){if(e.length>=n.minDistanceLength){let r=Di(e,t,n.maxDistance);if(r!==1/0)return r}let r=e.length<=t.length?e:t,i=e.length<=t.length?t:e;if(r.length>=n.minAffix&&(n.segmentAffix?ki(r,i):i.startsWith(r)||i.endsWith(r)||i.includes(r)))return 3+(i.length-r.length)/100;if(!n.segmentAffix&&Oi(e,t)>=n.minAffix)return 5+Math.abs(e.length-t.length)/100}function ji(e,t,n={}){let{body:r,important:i}=Ne(e),a=r.indexOf(`:`);if(a<=0)return;let o=r.slice(0,a),s=r.slice(a+1),{prefixValues:c,dynamicPrefixes:l,internalPrefixes:u}=Ei(t),d=[];if(c.has(o)||l.has(o)||u.has(o)||wi(r,t.rulesDynamic))for(let e of c.get(o)??[]){if(e===s)continue;let t=Ai(s,e,_i);t!==void 0&&B(d,{suggestion:`${o}:${e}`,score:t})}else{if(!n.confirmedIntent&&o.length<3)return;let e=new Set([...c.keys(),...l]);for(let t of e){let e=Ai(o,t,n.confirmedIntent?gi:hi);if(e===void 0)continue;let r=c.get(t)?.has(s)||l.has(t);B(d,{suggestion:`${t}:${s}`,score:r?e:e+10})}if(d.length===0)return}d.sort((e,t)=>e.score-t.score||(e.suggestion<t.suggestion?-1:1));let f=new Set,p=[];for(let{suggestion:e}of d)if(!(f.has(e)||e===r)&&(f.add(e),B(p,i?`${e}!`:e),p.length===3))break;return p}function Mi(e){let t=e.split(/\s+/);return t[0]===``&&t.shift(),t.at(-1)===``&&t.pop(),t}function Ni(e){if(!e.includes(`[`))return Mi(e);let t=Me(e);if(t.length===0)return Mi(e);let n=[],r=0,i=-1;for(let a=0;a<e.length;a++){let o=t[r];if(o&&a===o.start){i<0&&(i=a),a=o.end-1,r++;continue}/\s/.test(e[a])?(i>=0&&B(n,e.slice(i,a)),i=-1):i<0&&(i=a)}return i>=0&&B(n,e.slice(i)),n}function Pi(e){let t=``,n=0,r;for(let i=0;i<e.length;i++){let a=e[i];if(a===`\\`&&e[i+1]===`_`){t+=`_`,i++;continue}if(a===`\\`&&i+1<e.length){t+=a+e[++i];continue}if(r){a===r&&(r=void 0),t+=a===`_`&&n===0?` `:a;continue}if(a===`/`&&e[i+1]===`*`){let n=e.indexOf(`*/`,i+2);if(n===-1){t+=e.slice(i);break}t+=e.slice(i,n+2),i=n+1;continue}if(a===`"`||a===`'`){r=a,t+=a;continue}if(a===`(`?n++:a===`)`&&n>0&&n--,a===`_`&&n===0){t+=` `;continue}t+=a}return t}const Fi=new Set([`calc`,`clamp`,`max`,`min`]);function Ii(e){return e==null?!1:e===`\\`||/[-_a-zA-Z0-9]/.test(e)||e.charCodeAt(0)>=128}function Li(e,t){if(t>0&&Ii(e[t-1])||!/[-_a-zA-Z]/.test(e[t]))return;let n=t+1;for(;/[-_a-zA-Z0-9]/.test(e[n]??``);)n++;return e[n]===`(`?{name:e.slice(t,n),open:n}:void 0}function Ri(e){let t=new Map,n=[],r=!1,i;for(let a=0;a<e.length;a++){let o=e[a];if(r){o===`*`&&e[a+1]===`/`&&(r=!1,a++);continue}if(i){o===`\\`?a++:o===i&&(i=void 0);continue}if(o===`\\`){a++;continue}if(o===`"`||o===`'`){i=o;continue}if(o===`/`&&e[a+1]===`*`){r=!0,a++;continue}o===`(`?B(n,a):o===`)`&&n.length>0&&t.set(n.pop(),a)}return t}function zi(e,t){let n=e[t];if(n===`"`||n===`'`){for(let r=t+1;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===n)return r+1;return e.length}if(n===`/`&&e[t+1]===`*`){let n=e.indexOf(`*/`,t+2);return n<0?e.length:n+2}}function Bi(e){let t=e.trimEnd();for(;t.endsWith(`*/`);){let e=t.lastIndexOf(`/*`);if(e<0)break;t=t.slice(0,e).trimEnd()}if(t.endsWith(`)`)||/(?:^|[\s,(+\-*/])(?:e|pi|nan|-?infinity)$/i.test(t))return!0;let n=/[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?(?:%|[a-z]+)?$/i.exec(t);if(n==null)return!1;let r=n.index;return r===0?!0:n[0].startsWith(`-`)&&t[r-1]===`-`?!1:/[\s,(+\-*/]/.test(t[r-1])}function Vi(e,t,n){return e[t]!==`+`&&e[t]!==`-`||!/\d/.test(e[t+1]??``)?!1:/(?:^|[^-_a-zA-Z0-9.])(?:\d+(?:\.\d*)?|\.\d+)[eE]$/.test(n.trimEnd())}function Hi(e){if(!e.includes(`(`))return e;let t=Ri(e),n=[],r=``;for(let i=0;i<e.length;){let a=zi(e,i);if(a!=null){r+=e.slice(i,a),i=a;continue}let o=Li(e,i);if(o!=null){let a=t.get(o.open);if(a==null){r+=e.slice(i);break}let s=o.name.toLowerCase();if(s===`url`){r+=e.slice(i,a+1),i=a+1;continue}if(Fi.has(s)){r+=`${o.name}(`,B(n,a),i=o.open+1;continue}r+=o.name,i=o.open;continue}let s=e[i],c=s===`+`||s===`-`||s===`*`||s===`/`,l=s===`/`&&e[i+1]===`*`;n.length>0&&c&&!l&&!Vi(e,i,r)&&Bi(r)?(/\s/.test(r.at(-1)??``)||(r+=` `),r+=s,/\s/.test(e[i+1]??``)||(r+=` `)):r+=s,i===n.at(-1)&&n.pop(),i++}return r}function Ui(e){return e.length>=2&&e[0]===`[`&&e[e.length-1]===`]`}function Wi(e,t={}){let{calc:n=!0}=t,r=e;return Ui(r)&&(r=Pi(r.slice(1,-1))),n&&(r=Hi(r)),r}const Gi=new ce(256,void 0,!0);function Ki(e){return[...n(e)]}function qi(e,t,n){return n.some(n=>e.startsWith(n,t))}function Ji(e,t,n){let r=t-1;for(;r>0&&/[\w$-]/.test(e[r-1]);)r--;let i=r-1;for(;i>=0&&/\s/.test(e[i]);)i--;return e[i]===`(`&&n.some(t=>e.slice(i-t.length,i)===t)}function Yi(e,t){let n=t+1;for(;/\s/.test(e[n]??``);)n++;return e[n]===`"`||e[n]===`'`||e[n]==="`"}function Xi(e,t){let n=new Set,r=[],i=[],a=[],o,s=()=>{let e=o?.bracketStarts.at(-1);if(e)e.containsCandidate=!0;else{let e=i.at(-1);e&&(e.containsCandidate=!0)}};for(let c=0;c<e.length;c++){let l=e[c],u=l===`[`&&(e[c-1]===`:`||e[c-1]===`@`);if(u||l===`[`&&!o){Yi(e,c)&&(!u||Ae(e,c)&&!Ji(e,c,t))&&n.add(c),B(i,{containsCandidate:!1,parentQuote:o,start:c}),o=void 0;continue}if(i.length!==0){if(o){if(l===`\\`)c++;else if(l===o.character){if(o.bracketStarts.some(e=>e.containsCandidate)){for(let e of o.bracketStarts)e.containsCandidate&&n.add(e.start);let e=i.at(-1);e&&(e.containsCandidate=!0)}o=void 0}else if(l===`[`)B(o.bracketStarts,{containsCandidate:!1,start:c});else if(l===`]`){let i=o.bracketStarts.pop();i&&qi(e,c+1,t)?(B(r,{start:i.start,end:c+1}),n.delete(i.start),s()):i?.containsCandidate&&(n.add(i.start),s())}}else if(l===`"`||l===`'`||l==="`")o={bracketStarts:[],character:l},B(a,o);else if(l===`\\`)c++;else if(l===`]`){let a=i.pop(),l=a.start,u=c+1,d=n.has(l)||je(e,l,u)&&!Ji(e,l,t),f=(e[l-1]===`:`||e[l-1]===`@`||qi(e,u,t))&&!d;f?(B(r,{start:l,end:u}),n.delete(l)):a.containsCandidate&&n.add(l),o=a.parentQuote,(f||a.containsCandidate)&&s()}}}for(let e of i)e.containsCandidate&&n.add(e.start);for(let e of a)for(let t of e.bracketStarts)t.containsCandidate&&n.add(t.start);let c=[];for(let e of r.sort((e,t)=>e.start-t.start||t.end-e.end))(!c.length||e.start>=c.at(-1).end)&&B(c,e);return{barrierStarts:n,ranges:c}}function Zi(e,t){let{barrierStarts:n,ranges:r}=Xi(e,t);if(r.length===0&&n.size===0)return e;let i=e.split(``);for(let e of n)i[e]=`$`;for(let e of r)for(let t=e.start+1;t<e.end-1;t++)i[t]=`$`;return i.join(``)}function Qi(e){let t=JSON.stringify(e),n=Gi.getOrInsertComputed(t,()=>{let t=[...e].sort((e,t)=>t.length-e.length).map(An).join(`|`),n=`\\[[^\\]]*?\\]`;return RegExp(t?`((?:[!@*<~\\w+:_-]|${n})+?)(${t})\\(((?:[~!@<>\\w\\s:/\\\\,%#.$?-]|${n})+?)\\)(?!\\s*?=>)`:`(?!)`,`gm`)});return n.lastIndex=0,n}function $i(e=[`-`,`:`]){let t=Qi(Ki(e));return new RegExp(t.source,t.flags)}function ea(e,t=[`-`,`:`],n=5){let r=Ki(t),i=Qi(r),a=!1,o=typeof e==`string`?e:e.original,s=o,c=new Set,l=new Map;if(n>0){let e=Zi(s,r),t;if(r.some(t=>e.includes(`${t}(`)))do{t=!1;let o=``,u=0;i.lastIndex=0;let d;for(;d=i.exec(e);){let e=d.index,[n,r,i,f]=d;a=!0,t=!0;let p=n.length,m=s.slice(e,e+r.length);c.add(m+i);let h=e+m.length+i.length+1,g=s.slice(h,h+f.length),_={length:p,items:[]};l.set(e,_);let v=0;for(let e of Ni(g)){let t=g.indexOf(e,v),n=h+t;v=t+e.length;let r=l.get(n)?.items;r?l.delete(n):r=[{offset:n,length:e.length,className:e}];for(let e of r)e.className=e.className===`~`?i===`:`?`${m}${i}~`:m:e.className.replace(/^(!?)(.*)/,(e,t,n)=>`${t}${m}${i}${n}`),B(_.items,e)}o+=s.slice(u,e),o+=`$`.repeat(p),u=e+p}t&&(s=o+s.slice(u)),--n,t&&n&&(e=Zi(s,r))}while(t&&n)}let u=[...l].sort(([e],[t])=>e-t),d;if(typeof e==`string`){d=``;let t=0;for(let[n,r]of u)d+=e.slice(t,n),d+=r.items.map(e=>e.className).join(` `),t=n+r.length;d+=e.slice(t)}else{d=e;for(let[e,t]of u){let n=e+t.length;if(d.slice(e,n)!==o.slice(e,n))throw Error(`Cannot expand a variant group that overlaps an existing MagicString edit`)}for(let[e,t]of u)d.overwrite(e,e+t.length,t.items.map(e=>e.className).join(` `))}return{prefixes:Array.from(c),hasChanged:a,groupsByOffset:new Map(u),get expanded(){return d.toString()}}}function ta(e,t){let n=new Map,r=Ki(t).sort((e,t)=>t.length-e.length),i=Ni(e).map(e=>{let t=r.find(t=>e.startsWith(t));if(!t)return e;let i=e.slice(t.length);if(n.has(t))return B(n.get(t),i),null;{let e=[i];return n.set(t,e),{prefix:t,items:e}}}).filter(zr).map(e=>typeof e==`string`?e:`${e.prefix}(${e.items.join(` `)})`).join(` `);return i?`${/^\s/.test(e)?` `:``}${i}${/\s$/.test(e)?` `:``}`:e?` `:``}function na(e,t=[`-`,`:`],n=5){let r=ea(e,t,n);return typeof e==`string`?r.expanded:e}const ra=new Set;function ia(e){if(!ra.has(e)){ra.add(e);try{console.warn(`[Teacss]`,e)}catch(t){throw ra.delete(e),t}}}function aa(e,t,n){let r=e;for(;r!==null&&r!==Object.prototype&&!Object.hasOwn(r,t);)r=Object.getPrototypeOf(r);if(r!==null&&r!==Object.prototype){if(!Reflect.set(e,t,n))throw TypeError(`Cannot assign rule metadata "${String(t)}"`)}else D(e,t,n)}function oa(e,t){let n=e;for(;n!==null&&n!==Object.prototype;){if(Object.hasOwn(n,t))return Reflect.get(e,t);n=Object.getPrototypeOf(n)}}function sa(e){let t=[void 0,void 0,void 0];for(let n=0;n<2;n++){if(!Object.hasOwn(e,n))throw TypeError(`[Teacss] invalid rule or shortcut entry: matcher and body must be own tuple values`);t[n]=e[n]}let r=Object.hasOwn(e,2)?e[2]:void 0;if(r!==void 0){let e={...r},i=Object.hasOwn(e,`prefix`)&&e.prefix;Array.isArray(i)&&(e.prefix=[...n(i)]),t[2]=e}return t}function ca(e){return Array.from(n(e),sa)}function la(e,n=!0){let r=Object.create(null),i=[];for(let[a,o]of e.entries()){let e=Object.hasOwn(o,2)?o[2]:void 0;if(e===void 0){if(e={},Object.hasOwn(o,2)){if(!Reflect.set(o,2,e))throw TypeError(`Cannot assign rule metadata`)}else D(o,2,e)}if(aa(e,`__index`,a),ai(o)){let t=O(oa(e,`prefix`)??``);for(let e of t){let t=e+o[0];if(n&&Ne(t).keyword)throw TypeError(`[Teacss] ordinary rule "${t}" is a bare name; use shortcuts or a declaration name (property:value).`);r[t]=o}}else t(i,o)}return i.reverse(),{rulesSize:e.length,rulesDynamic:i,rulesStaticMap:r}}function ua(e){let t=ca(e.rules),n=la(t);e.rules=t,e.rulesSize=n.rulesSize,e.rulesDynamic=n.rulesDynamic,e.rulesStaticMap=n.rulesStaticMap}function X(e,t){return e!=null&&Object.hasOwn(e,t)?Reflect.get(e,t):void 0}function da(e){return[...n(O(e))]}function fa(e,t){for(let t=e.length;t>0;t--)Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:e[t-1],writable:!0});D(e,0,t)}function pa(e){let n=new Set,r=[];for(let i of e){let e=i.name;n.has(e)||(n.add(e),t(r,i))}return r}function ma(e){return Array.from(e,(e,t)=>({index:t,order:E(e,`order`)||0,value:e})).sort((e,t)=>e.order-t.order||e.index-t.index).map(({value:e})=>e)}function ha(e,t){let n={...e};for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(t,e)?.enumerable)continue;let r=Reflect.get(t,e);r!==void 0&&D(n,e,r)}return n}function ga(e){return Array.from(n(O(e)),e=>Array.isArray(e)?[e]:Object.entries(e)).flat()}const _a=new WeakSet;function va(e,t){let r={};for(let t of Reflect.ownKeys(e)){if(t===`name`||!Object.getOwnPropertyDescriptor(e,t)?.enumerable)continue;let i=Reflect.get(e,t);D(r,t,t===`prefix`&&Array.isArray(i)?[...n(i)]:i)}return D(r,`name`,t),r}async function ya(e){return ba(e)}async function ba(e,t){let n=typeof e==`function`?await e():await e;if(typeof n!=`object`||!n||Array.isArray(n))throw TypeError(`Invalid TeaCSS preset: expected an object, received ${n===null?`null`:Array.isArray(n)?`array`:typeof n}.`);t?.(n);let r=Object.hasOwn(n,`name`)?Reflect.get(n,`name`):void 0;if(typeof r!=`string`||r.trim()===``)throw TypeError(`Invalid TeaCSS preset: expected a non-empty string name.`);if(_a.has(n))return n;n=va(n,r),_a.add(n);let i=X(n,`shortcuts`),a=X(n,`rules`),o=i?ca(ga(i)):void 0;n.shortcuts=o,n.rules=a?ca(a):void 0;let s=X(n,`prefix`),c=X(n,`layer`);if(s||c){let e=e=>{e[2]||={};let t=e[2];E(t,`prefix`)==null&&s&&D(t,`prefix`,[...O(s)]),E(t,`layer`)==null&&c&&D(t,`layer`,c)};o?.forEach(e),n.rules?.forEach(e)}return n}async function xa(e){return Sa(e,new Set)}async function Sa(e,t){let r=new Set(t),i=e=>{if(t.has(e))throw TypeError(`Circular TeaCSS preset reference detected.`);r.add(e)};i(e);let a=await ba(e,i),o=X(a,`presets`);if(!o)return[a];let s=Array.from(n(O(o)),e=>Array.isArray(e)?[...n(e)]:[e]).flat();return[a,...(await Promise.all(s.map(e=>Sa(e,r)))).flat()]}function Ca(e){if(e.length===0)return{};let n=[],r=[],i=!1,a=!1,o=[],s=[];for(let c of e){let e=X(c,`pipeline`),l=X(c,`filesystem`),u=X(c,`inline`),d=e&&X(e,`include`),f=e&&X(e,`exclude`);e===!1?(a=!0,i=!0):i||(e!==void 0&&(a=!0),d&&t(n,d),f&&t(r,f)),l&&t(o,l),u&&t(s,u)}let c={};return i?c.pipeline=!1:a&&(c.pipeline={},n.length&&(c.pipeline.include=k(Na(n))),r.length&&(c.pipeline.exclude=k(Na(r)))),o.length&&(c.filesystem=k(o.flatMap(da))),s.length&&(c.inline=k(s.flatMap(da))),c}async function wa(e={},t={}){let r=ha(t,e),i=X(r,`presets`)??[],a=Array.from(n(O(i)),da).flat(),o=pa((await Promise.all(a.map(xa))).flat()),s=Array.from(o,e=>({enforce:X(e,`enforce`),preset:e})),c=[...s.filter(({enforce:e})=>e===`pre`),...s.filter(({enforce:e})=>e==null),...s.filter(({enforce:e})=>e===`post`)].map(({preset:e})=>e),l=[...c,r],u=[...l].reverse(),d=l.reduce((e,t)=>({...e,...X(t,`layers`)}),{...Ue});function f(e){return k(l.flatMap(t=>da(X(t,e))))}let p=f(`extractors`),m=u.map(e=>X(e,`extractorDefault`)).find(e=>e!==void 0);m===void 0&&(m=Er),m&&!p.includes(m)&&fa(p,m);let h=ma(p),g=ca(f(`rules`)),{rulesSize:_,rulesStaticMap:v,rulesDynamic:y}=la(g,!1),b=l.map(e=>X(e,`autocomplete`)),x=e=>b.flatMap(t=>da(X(t,e))),S={templates:k(x(`templates`)),extractors:ma(x(`extractors`)),shorthands:Ma(b.map(e=>X(e,`shorthands`)||{}))},C=f(`separators`);C.length||(C=[`:`,`-`]);let w=Ca(f(`content`)),T=u.map(e=>X(e,`details`)).find(e=>e!==void 0),E=u.map(e=>X(e,`outputToCssLayers`)).find(e=>e!==void 0),D=u.map(e=>X(e,`sortLayers`)).find(e=>e!==void 0),A=X(r,`envMode`)||`build`,j={...r,mergeSelectors:X(r,`mergeSelectors`)??!0,warn:X(r,`warn`)??!0,unmatched:X(r,`unmatched`)??`off`,outputToCssLayers:E,sortLayers:D??(e=>e),blocklist:f(`blocklist`),presets:c,envMode:A,shortcutsLayer:X(r,`shortcutsLayer`)||`shortcuts`,layers:d,theme:ja(l.map(e=>X(e,`theme`))),rules:g,rulesSize:_,rulesDynamic:y,rulesStaticMap:v,preprocess:f(`preprocess`),postprocess:f(`postprocess`),preflights:f(`preflights`),autocomplete:S,variants:ma(f(`variants`).map(Lr)),shortcuts:ca(ga(f(`shortcuts`))).reverse(),extractors:h,safelist:f(`safelist`),separators:C,details:T??A===`dev`,content:w,transformers:pa(f(`transformers`))},M=f(`extendTheme`);for(let e of M)j.theme=e(j.theme,j)||j.theme;for(let e of l){let t=X(e,`configResolved`);t!=null&&await t(j)}return ua(j),Ie(j),j}function Ta(e){let t={};for(let n of Reflect.ownKeys(e))Object.getOwnPropertyDescriptor(e,n)?.enumerable&&Object.defineProperty(t,n,{configurable:!0,enumerable:!0,value:Reflect.get(e,n),writable:!0});return t}function Ea(e,t,n){return Object.hasOwn(t,n)?Reflect.get(t,n):X(e,n)}function Da(e){let t=Ta(e),n=Ea(e,t,`templates`);n===void 0?delete t.templates:D(t,`templates`,O(n));let r=Ea(e,t,`extractors`);if(r===void 0?delete t.extractors:D(t,`extractors`,O(r)),Object.hasOwn(e,`shorthands`)){let n=Ea(e,t,`shorthands`);n===void 0?delete t.shorthands:D(t,`shorthands`,n)}return t}function Oa(e={},t={}){let n=X(e,`shorthands`),r=X(t,`shorthands`),i={...e},a={...t};delete i.shorthands,delete a.shorthands;let o=ni(i,a,!0);return(n!==void 0||r!==void 0)&&Object.defineProperty(o,"shorthands",{configurable:!0,enumerable:!0,value:{...n??{},...r??{}},writable:!0}),o}function ka(e){let t=Ta(e),n=Ea(e,t,`entry`);return n===void 0?delete t.entry:D(t,`entry`,O(n)),t}function Aa(e){let t=[`shortcuts`,`preprocess`,`postprocess`,`extendTheme`,`separators`];return Array.from(n(e),e=>Object.entries(e).reduce((e,[n,r])=>{if(r===void 0)return e;let i=n===`autocomplete`&&r?Da(r):n===`cli`&&r?ka(r):t.includes(n)?O(r):r;return{...e,[n]:i}},{})).reduce((e,t)=>{let n=X(e,`autocomplete`),r=X(t,`autocomplete`),i=X(e,`content`),a=X(t,`content`),o=X(e,`extractorDefault`),s=X(t,`extractorDefault`),c=X(e,`theme`),l=X(t,`theme`),u={...e},d={...t};delete u.autocomplete,delete u.content,delete u.extractorDefault,delete u.theme,delete d.autocomplete,delete d.content,delete d.extractorDefault,delete d.theme;let f=ni(u,d,!0);return(n||r)&&Object.defineProperty(f,"autocomplete",{configurable:!0,enumerable:!0,value:Oa(n,r),writable:!0}),(c||l)&&Object.defineProperty(f,"theme",{configurable:!0,enumerable:!0,value:ja([c,l]),writable:!0}),(i||a)&&Object.defineProperty(f,"content",{configurable:!0,enumerable:!0,value:Ca([i||{},a||{}]),writable:!0}),(o!==void 0||s!==void 0)&&D(f,`extractorDefault`,s===void 0?o:s),f},{})}function ja(e){return e.reduce((e,t)=>{if(!t)return e;let n=q(t);if(!K(n))return n;if(!K(e)){if(!Reflect.ownKeys(n).some(e=>Object.getOwnPropertyDescriptor(n,e)?.enumerable))return e;if(Object.hasOwn(n,`$reset`)&&Reflect.get(n,`$reset`))return ni({},n);throw TypeError(`[Teacss] cannot safely merge a plain theme into a non-plain theme; use extendTheme for a class-aware merge or $reset to replace it.`)}return ni(e,n)},{})}function Ma(e){return e.reduce((e,t)=>{let n=Object.create(null);for(let e of Object.keys(t)){if(!Object.hasOwn(t,e))continue;let r=t[e];if(Array.isArray(r)){let t=da(r);n[e]=t.length===1?t[0]??``:`(${t.join(`|`)})`}else n[e]=r}return{...e,...n}},{})}function Na(e){return e.flatMap(e=>da(Pa(e)))}function Pa(e){return Array.isArray(e)?e:e?[e]:[]}function Fa(e){return e}function Ia(){let e=typeof process<`u`&&!!process.stdout;return{isNode:e,isVSCode:e&&!!process.env.VSCODE_CWD,isESLint:e&&!!process.env.ESLINT}}var La=`0.6.0`;const Ra=/[a-zA-Z0-9_-]/;function za(e,t){let n=e;for(;n!=null&&n!==Object.prototype&&n!==Array.prototype&&n!==Function.prototype;){if(Object.hasOwn(n,t))return Reflect.get(e,t);n=Object.getPrototypeOf(n)}}function Ba(e,n){if(n.length>0&&e.length>256/n.length)return null;let r=[];for(let i of e)for(let e of n)t(r,i+e);return r}function Va(e){let t=!1,n=0,r=!1;for(let i=1;i<e.length;i++){let a=e[i];if(t)t=!1;else if(a===`\\`)t=!0;else if(r)a===`]`&&(r=!1);else if(a===`[`)r=!0;else if(a===`(`)n++;else if(a===`)`)n>0&&n--;else if(a===`|`&&n===0)return!0}return!1}function Ha(e,t){return e[t]===`:`&&!/[?*+{]/.test(e[t+1]??``)}function Ua(e){if(!e.startsWith(`^`)||Va(e))return null;let t=1;for(;t<e.length&&Ra.test(e[t]);)t++;if(t>1&&Ha(e,t))return[e.slice(1,t)];let n=Wa(e,1,`:`);if(!n||!Ha(e,n.end)||n.combos.some(e=>e.length===0||e.includes(`:`)))return null;let r=[...new Set(n.combos)];return r.length?r:null}function Wa(e,t,n,r=0){let i=[``];for(;t<e.length;){let a=e[t];if(n.includes(a))break;if(Ra.test(a)){let n=``;for(;t<e.length&&Ra.test(e[t]);)n+=e[t++];i=i.map(e=>e+n);continue}let o=null;if(a===`(`)o=r<64?Ga(e,t,r+1):null;else if(a===`[`)o=Ka(e,t);else return null;if(!o)return null;t=o.end;let s=o.combos;if(e[t]===`?`)s=[``,...s],t++;else if(e[t]===`*`||e[t]===`+`||e[t]===`{`)return null;let c=Ba(i,s);if(!c)return null;i=c}return{combos:i,end:t}}function Ga(e,n,r){if(n++,e.startsWith(`?:`,n))n+=2;else if(e[n]===`?`)return null;let i=[];for(;;){let a=Wa(e,n,`|)`,r);if(!a)return null;for(let e of a.combos)t(i,e);if(i.length>256)return null;if(n=a.end,e[n]===`|`){n++;continue}return e[n]===`)`?{combos:i,end:n+1}:null}}function Ka(e,n){if(n++,e[n]===`^`)return null;let r=[];for(;n<e.length&&e[n]!==`]`;){let i=e[n];if(i===`\\`||i===`-`||(t(r,i),r.length>256))return null;n++}return e[n]===`]`?{combos:r,end:n+1}:null}function qa(e){if(za(e[2],`prefix`))return null;let[t]=e;return!(t instanceof RegExp)||Object.hasOwn(t,`exec`)||Object.getPrototypeOf(t)!==RegExp.prototype||t.exec!==di||Y(t)?null:Ua(J(t))}function Ja(e){let n=e.map(e=>[e,qa(e)]),r=new Map;for(let[,e]of n)if(e!==null)for(let t of e)r.has(t)||r.set(t,[]);let i=[];for(let[e,a]of n){if(a===null){t(i,e);for(let n of r.values())t(n,e);continue}for(let n of a)t(r.get(n),e)}return{map:r,fallback:i}}function Ya(e){let t=!1,n=!1,r=new WeakMap,i=new WeakMap,a=e=>e&&typeof e==`object`?i.get(e)??e:e,o=(e,s)=>{if(i.has(e))return e;let c=r.get(e);if(c)return c;let l=e=>s===`index`&&typeof e==`string`||s===`list`&&typeof e==`string`&&/^\d+$/.test(e)?`rule`:s===`rule`&&e===`2`?`meta`:s===`meta`&&e===`prefix`?`prefix`:void 0,u=new Proxy(e,{get(e,t,r){let i=Reflect.get(e,t,r),a=l(t);if(!a||typeof i!=`object`||!i)return i;let s=Object.getOwnPropertyDescriptor(e,t);return s&&!s.configurable&&`value`in s&&!s.writable?(n=!0,i):o(i,a)},getOwnPropertyDescriptor(e,t){let r=Reflect.getOwnPropertyDescriptor(e,t),i=l(t);return!r||!i||!(`value`in r)||r.value===null||typeof r.value!=`object`?r:!r.configurable&&!r.writable?(n=!0,r):{...r,value:o(r.value,i)}},set(e,n,r){return t=!0,Reflect.set(e,n,a(r))},defineProperty(e,n,r){return t=!0,Reflect.defineProperty(e,n,`value`in r?{...r,value:a(r.value)}:r)},deleteProperty(e,n){return t=!0,Reflect.deleteProperty(e,n)},setPrototypeOf(e,n){return t=!0,Reflect.setPrototypeOf(e,n)}});return r.set(e,u),i.set(u,e),u},s=e.rules,c=e.rulesStaticMap,l=e.rulesDynamic,u=()=>{e.rules=s=o(e.rules,`list`),e.rulesStaticMap=c=o(e.rulesStaticMap,`index`),e.rulesDynamic=l=o(e.rulesDynamic,`list`),t=!1,n=!1};return u(),{isCurrent:()=>!t&&!n&&e.rules===s&&e.rulesStaticMap===c&&e.rulesDynamic===l,refresh:u}}const Z=Object.freeze({shortcutsNoMerge:Symbol.for(`@teacss/core/shortcut-no-merge`),noMerge:Symbol.for(`@teacss/core/no-merge`),noScope:Symbol.for(`@teacss/core/no-scope`),variants:Symbol.for(`@teacss/core/variants`),parent:Symbol.for(`@teacss/core/parent`),selector:Symbol.for(`@teacss/core/selector`),layer:Symbol.for(`@teacss/core/layer`),sort:Symbol.for(`@teacss/core/sort`),body:Symbol.for(`@teacss/core/body`)});function Xa(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}const Za={px:1,rem:16,em:16,in:96,pt:96/72,pc:16,cm:96/2.54,mm:96/25.4,q:96/101.6},Qa=RegExp(`^[ \\t\\n\\r\\f]*([+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:e[+-]?\\d+)?)(${Object.keys(Za).join(`|`)}|[sld]?v(?:[whib]|min|max)|cq(?:[whib]|min|max)|r?(?:ch|ex|cap|ic|lh)|%)?[ \\t\\n\\r\\f]*(?![\\s\\S])`,`i`);function $a(e){let t=Qa.exec(e);if(!t)return null;let n=Number.parseFloat(t[1]),r=(t[2]??`px`).toLowerCase();if(Object.hasOwn(Za,r)&&(n*=Za[r],r=`px`),!Number.isFinite(n))return null;let i=r===`px`?Math.round(n*1e6)/1e6:n;return{unit:r,value:Number.isFinite(i)?i:n}}function eo(e){let t=!1,n=Oo(e)[0];if(/["'\\/]|not/i.test(n)&&(n=n.replace(/"(?:\\[\s\S]|[^"\\])*(?:"|$)|'(?:\\[\s\S]|[^'\\])*(?:'|$)|\/\*[\s\S]*?(?:\*\/|$)|((?:[-\w\u0080-\uffff]|\\(?:[\da-f]{1,6}(?:\r\n|[ \t\n\r\f])?|[^\n\r\f]))+)|\\[\s\S]/gi,(e,n)=>n?(l(n).toLowerCase()===`not`&&(t=!0),n.includes(`\\`)?`_`:n):` `)),!/^@media(?=[ \t\n\r\f(])/i.test(n)||t)return null;let r=null;for(let e of n.matchAll(/\([ \t\n\r\f]*(min|max)-width[ \t\n\r\f]*:([^)]*)\)/gi)){let t=$a(e[2]);if(t){if(/min/i.test(e[1]))return t;r??={unit:t.unit,value:-t.value}}}return r}function to(e,t){return e<t?-1:+(e>t)}function no(e,t){return to(e??``,t??``)}function ro(e,t){for(let n of t)B(e,n)}function io(e,t){for(let t=e.length;t>0;t--)Object.hasOwn(e,t-1)?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:e[t-1],writable:!0}):delete e[t];D(e,0,t)}function ao(e){let t=new Dr;for(let n of e)t.setCount(n,e.getCount(n));return t}function oo(e){return G(e)?ao(e):new Set(e)}function so(e,t,n){if(G(e)&&G(t)&&G(n)){for(let r of new Set([...t,...n])){let i=n.getCount(r),a=t.getCount(r);if(Object.is(i,a)&&n.has(r)===t.has(r))continue;let o=e.getCount(r)+(i-a);o>0||o===0&&i===0&&n.has(r)?e.setCount(r,o):e.delete(r)}return}for(let r of t)n.has(r)||e.delete(r);for(let r of n)t.has(r)||e.add(r)}function*co(e,t){for(let n=0;n<e.length;n++){let r=t[n];r!=null&&(yield[e[n],r])}}function lo(e){if(e!==void 0&&(!Number.isSafeInteger(e)||e<1))throw RangeError(`tokenConcurrency must be a positive integer`)}function uo(e,t){return Object.hasOwn(e,t)?Reflect.get(e,t):void 0}function fo(e,t){if(Object.hasOwn(e,t))return Reflect.get(e,t);let n=Object.getPrototypeOf(e);if(n===null||n===Object.prototype)return;let r=Object.getOwnPropertyDescriptor(n,`constructor`)?.value;if(typeof r==`function`&&r!==Object)for(;n!==null&&n!==Object.prototype;){if(Object.hasOwn(n,t))return Reflect.get(e,t);n=Object.getPrototypeOf(n)}}function Q(e,t){return e?E(e,t):void 0}function po(e,t){return uo(e,t)}function mo(e){let t=E(e,`parent`);return{body:E(e,`body`),handle:E(e,`handle`),layer:E(e,`layer`),order:E(e,`order`),parent:Array.isArray(t)?uo(t,0):t,parentOrder:Array.isArray(t)?uo(t,1):void 0,selector:E(e,`selector`),sort:E(e,`sort`),source:e}}function ho(e){if(e===null||typeof e!=`object`&&typeof e!=`function`)return;let t=Reflect.get(e,`then`);if(typeof t==`function`)return{then(n,r){return Reflect.apply(t,e,[n,r])}}}async function go(e,t,n){if(t===void 0||t>=e.length)return await Promise.all(e.map(n));let r=Array(e.length),i=0,a=!1,o=Array.from({length:Math.min(t,e.length)},async()=>{for(;!a&&i<e.length;){let t=i++;try{let i=await n(e[t]);D(r,t,i)}catch(e){throw a=!0,e}}});return await Promise.all(o),r}function _o(e,t){if(e===void 0)return;let n=ss(t),r=n.startsWith(`[`),i=0,a,o=0,s=``;for(let t=0;t<e.length;t++){let c=e[t];if(a){c===`\\`?t++:c===a&&(a=void 0);continue}if(c===`/`&&e[t+1]===`*`){let n=e.indexOf(`*/`,t+2);if(n===-1)break;t=n+1;continue}if(c===`\\`){t++;continue}if(c===`"`||c===`'`){a=c;continue}if(i===0&&c===n[0]&&e.startsWith(n,t)){let i=e[t+n.length],a=i!==void 0&&(/[\w-]/.test(i)||i===`\\`||i.charCodeAt(0)>=128);if(r||!a){s+=`${e.slice(o,t)}&`,o=t+n.length,t=o-1;continue}}c===`[`?i++:c===`]`&&i>0&&i--}return s+e.slice(o)}function vo(e,t,n,r){let i=O(e).filter(yo),a=O(n).filter(yo);if(i.length!==a.length)return!1;for(let e=0;e<i.length;e++){let n=i[e],o=a[e];if(n[2]!==o[2]||_o(n[1],t)!==_o(o[1],r)||n[3]!==o[3]||Q(n[4],`layer`)!==Q(o[4],`layer`)||Q(n[4],`sort`)!==Q(o[4],`sort`)||!!Q(n[4],`noScope`)!=!!Q(o[4],`noScope`)||!!(n[6]??Q(n[4],`noMerge`))!=!!(o[6]??Q(o[4],`noMerge`)))return!1}return!0}function yo(e){return Array.isArray(e)&&Object.hasOwn(e,0)&&Object.hasOwn(e,1)&&Object.hasOwn(e,2)&&Object.hasOwn(e,3)&&Object.hasOwn(e,4)&&Object.hasOwn(e,5)&&Object.hasOwn(e,6)}function bo(e){return Object.hasOwn(e,0)&&e[0]===Z.shortcutsNoMerge}function xo(e){for(let t=e.length-1;t>=0;t--){if(!Object.hasOwn(e,t))continue;let n=e[t];if(bo(n))return Object.hasOwn(n,1)?n[1]:void 0}}function So(e,t){let n=[...e,...t],r=[];for(let e=t.length-1;e>=0;e--)ve(t[e])&&B(r,t[e]);for(let t=e.length-1;t>=0;t--)ve(e[t])&&B(r,e[t]);if(r.length<2)return n;let i=r[0];for(let e=1;e<r.length;e++)i=ye(i,r[e])??i;let a=[],o=!1;for(let e of n)ve(e)?o||=(B(a,i),!0):B(a,e);return a}function Co(e){let t;for(let n of e)n.includes(`{`)&&(t??=[],B(t,n));if(!t)return e;for(let n of t){let t=Ni(On(n));if(t.length===1&&t[0]===n)continue;let r=G(e)?e.getCount(n):1;e.delete(n);for(let n of t)G(e)?e.setCount(n,e.getCount(n)+r):e.add(n)}return e}function wo(e){let t=0;for(let[n,r]of e.matchAll(/\\(?:([\da-f]{1,6})(?:\r\n|[ \t\n\r\f])?|.)|(["'])(?:\\.|(?!\2)[^\\])*\2|\/\*.*?(?:\*\/|$)|[^:\\/"'-]+|./gis)){if(n.startsWith(`/*`)&&t!==2)continue;let e=r?Number.parseInt(r,16):n.charCodeAt(+(n[0]===`\\`));if(t===2&&(e|32)>=97&&(e|32)<=122)return!0;t=n===`:`?1:t===1&&e===45?2:0}return!1}function To(e){let t=new Map,n=new Map,r=0,i;for(let a of e){let[o,s,c]=a;if(i!==void 0&&s!==i&&(t.clear(),n.clear()),i=s,c){e[r++]=a;continue}let l=o.length>0,u=l?t:n,d=u.get(s);if(!d){u.set(s,a),e[r++]=a;continue}l&&ro(d[0],o)}e.length=r}function Eo(e,t,n){let r=(e.get(t)??0)-(e.get(n)??0);if(r)return r;let i=eo(t),a=eo(n);if(i==null!=(a==null))return i==null?-1:1;if(i!=null&&a!=null){if(i.unit!==a.unit)return to(i.unit,a.unit);if(i.value!==a.value)return i.value-a.value}return to(t,n)}function Do(e,t,n=``){let r=Oo(e);return`${r.join(`{`)}{${n}${t}${n}${`}`.repeat(r.length)}`}function Oo(e){let t=[],n=0,r=!1,i=0,a,o=0;for(let s=0;s<e.length;s++){let c=e[s];r?c===`*`&&e[s+1]===`/`&&(r=!1,s++):a?c===`\\`?s++:c===a&&(a=void 0):c===`\\`?s++:c===`/`&&e[s+1]===`*`?(r=!0,s++):c===`"`||c===`'`?a=c:c===`(`?i++:c===`)`?i>0&&i--:c===`[`?n++:c===`]`?n>0&&n--:n===0&&i===0&&e.startsWith(` $$ `,s)&&(B(t,e.slice(o,s)),s+=3,o=s+1)}return B(t,e.slice(o)),t}function ko(e){let t=[];if(!e.includes(`$$`))return t;let n=!1,r;for(let i=0;i<e.length;i++){let a=e[i];if(n){a===`*`&&e[i+1]===`/`&&(n=!1,i++);continue}if(r){a===`\\`?i++:a===r&&(r=void 0);continue}if(a===`/`&&e[i+1]===`*`){n=!0,i++;continue}if(a===`\\`){i++;continue}if(a===`"`||a===`'`){r=a;continue}if(!/\s/.test(a)||e[i+1]!==`$`||e[i+2]!==`$`||!/\s/.test(e[i+3]??``))continue;let o=i+4;for(;o<e.length&&/\s/.test(e[o]);)o++;B(t,[i,o]),i=o-2}return t}function Ao(e,t){let n=ko(e);if(!n.length)return e;let r=0,i=``;for(let[a,o]of n)i+=e.slice(r,a),i+=a===0||a<r?t?`${t} `:``:t?` ${t} `:` `,r=o;return i+e.slice(r)}const jo=new Set([Function.prototype,Object.getPrototypeOf(async()=>{}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})]),Mo=new Set([`arguments`,`caller`,`length`,`name`,`prototype`]);function No(e){return Reflect.ownKeys(e).every(e=>Mo.has(e))}function Po(e){let t=e;for(;t!==null;){let e=Object.getOwnPropertyDescriptor(t,`exec`);if(e)return{configurable:!!e.configurable,enumerable:!!e.enumerable,get:`get`in e?e.get:void 0,owner:t,set:`set`in e?e.set:void 0,value:`value`in e?e.value:void 0,writable:`value`in e?!!e.writable:void 0};t=Object.getPrototypeOf(t)}}function Fo(e,t){let n=Po(e);return n?.owner===t?.owner&&n?.configurable===t?.configurable&&n?.enumerable===t?.enumerable&&n?.get===t?.get&&n?.set===t?.set&&n?.value===t?.value&&n?.writable===t?.writable}function Io(e){return Reflect.ownKeys(e).every(e=>e===`lastIndex`)}function Lo(e,t=new WeakMap,n={}){if(e===null||typeof e!=`object`&&typeof e!=`function`)return{kind:`primitive`,value:e};if(n.functionsByIdentity&&typeof e==`function`)return{complete:No(e),kind:`identity`,value:e};if(n.ignoreRegExpLastIndex&&e instanceof RegExp){let t=Po(e);return{complete:t?.owner===RegExp.prototype&&t.value===di&&Object.getPrototypeOf(e)===RegExp.prototype&&Io(e),exec:t,flags:Y(e),kind:`regexp-identity`,source:J(e),value:e}}let r=t.get(e);if(r)return r;let i=Object.getPrototypeOf(e),a=i===RegExp.prototype?e:void 0,o={complete:i===null||i===Object.prototype||i===Array.prototype||jo.has(i)||i===RegExp.prototype,kind:`object`,properties:[],prototype:i,regexpFlags:a&&Y(a),regexpSource:a&&J(a),value:e};t.set(e,o);for(let r of Reflect.ownKeys(e)){if(n.ignoreRegExpLastIndex&&a&&r===`lastIndex`)continue;let i=Object.getOwnPropertyDescriptor(e,r);if(!i)continue;let s={configurable:!!i.configurable,enumerable:!!i.enumerable,key:r};if(`value`in i){s.value=Lo(i.value,t,n),zo(s.value)||(o.complete=!1);try{let a=Reflect.get(e,r);s.observedValue=Lo(a,t,n),(!Object.is(a,i.value)||!zo(s.observedValue))&&(o.complete=!1)}catch{o.complete=!1}s.writable=!!i.writable}else o.complete=!1,s.get=i.get,s.set=i.set;B(o.properties,s)}return o}function Ro(e,t,n=new Map){if(t.kind===`primitive`)return Object.is(e,t.value);if(t.kind===`identity`)return e===t.value&&(!t.complete||No(t.value));if(t.kind===`regexp-identity`)return e===t.value&&e instanceof RegExp&&Fo(e,t.exec)&&J(e)===t.source&&Y(e)===t.flags&&(!t.complete||Io(e));if(e!==t.value||e===null||typeof e!=`object`&&typeof e!=`function`||Object.getPrototypeOf(e)!==t.prototype||t.regexpSource!==void 0&&(J(e)!==t.regexpSource||Y(e)!==t.regexpFlags))return!1;let r=n.get(t);if(r)return r===e;n.set(t,e);let i=Reflect.ownKeys(e).filter(e=>!(t.regexpSource!==void 0&&e===`lastIndex`&&!t.properties.some(t=>t.key===e)));if(i.length!==t.properties.length)return!1;for(let r=0;r<i.length;r++){let a=t.properties[r],o=i[r];if(o!==a.key)return!1;let s=Object.getOwnPropertyDescriptor(e,o);if(!s||!!s.configurable!==a.configurable||!!s.enumerable!==a.enumerable)return!1;if(`value`in s){if(a.value===void 0||!!s.writable!==a.writable||!Ro(s.value,a.value,n))return!1;if(a.observedValue!==void 0){let t;try{t=Reflect.get(e,o)}catch{return!1}if(!Ro(t,a.observedValue,n))return!1}}else if(a.value!==void 0||s.get!==a.get||s.set!==a.set)return!1}return!0}function zo(e){return e.kind===`primitive`||e.complete}function $(e){let t=Array(e.length);for(let n=0;n<e.length;n++){if(!Object.hasOwn(e,n))continue;let r=e[n],i=Object.hasOwn(r,2),a=i?r[2]:void 0,o=Lo(r[0],void 0,{functionsByIdentity:!0,ignoreRegExpLastIndex:!0}),s={body:r[1],bodySnapshot:Lo(r[1],void 0,{functionsByIdentity:!0,ignoreRegExpLastIndex:!0}),matcherFlags:r[0]instanceof RegExp?Y(r[0]):void 0,matcherSnapshot:o,matcherSource:r[0]instanceof RegExp?J(r[0]):void 0,matcher:r[0],meta:a,metaOwn:i,metaSnapshot:Lo(a,void 0,{functionsByIdentity:!0,ignoreRegExpLastIndex:!0}),rule:r};D(t,n,s)}return t}function Bo(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=Object.hasOwn(e,n);if(r!==Object.hasOwn(t,n))return!1;if(!r)continue;let i=e[n],a=t[n],o=Object.hasOwn(i,2),s=o?i[2]:void 0;if(!Object.hasOwn(i,0)||!Object.hasOwn(i,1)||o!==a.metaOwn||i!==a.rule||i[0]!==a.matcher||i[1]!==a.body||s!==a.meta||!Ro(i[0],a.matcherSnapshot)||i[0]instanceof RegExp&&(J(i[0])!==a.matcherSource||Y(i[0])!==a.matcherFlags)||!Ro(i[1],a.bodySnapshot)||!Ro(s,a.metaSnapshot))return!1}return!0}function Vo(e){for(let t=0;t<e.length;t++){if(!Object.hasOwn(e,t))continue;let{bodySnapshot:n,matcherSnapshot:r,metaSnapshot:i}=e[t];if(!zo(n)||!zo(r)||!zo(i))return!1}return!0}const Ho=[`blocklist`,`details`,`envMode`,`extractors`,`layers`,`mergeSelectors`,`outputToCssLayers`,`postprocess`,`preflights`,`preprocess`,`safelist`,`separators`,`shortcuts`,`shortcutsLayer`,`sortLayers`,`theme`,`unmatched`,`variants`,`warn`];function Uo(e,t,n={}){let r=Lo(e[t],void 0,n);return{complete:zo(r),isCurrent:e=>Ro(e[t],r),key:t}}function Wo(e,t){let n=e;for(;n!==null&&n!==Object.prototype&&n!==Array.prototype&&n!==Function.prototype;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return{descriptor:e,owner:n};n=Object.getPrototypeOf(n)}}function Go(e,t){let n=Wo(e,t);if(!n)return{complete:!0,value:Lo(void 0)};let{descriptor:r,owner:i}=n;if(!(`value`in r))return{complete:!1,configurable:!!r.configurable,enumerable:!!r.enumerable,get:r.get,owner:i,set:r.set};let a=Lo(r.value,void 0,{functionsByIdentity:!0,ignoreRegExpLastIndex:!0});return{complete:zo(a),configurable:!!r.configurable,enumerable:!!r.enumerable,owner:i,value:a,writable:!!r.writable}}function Ko(e,t,n){let r=Wo(e,t);if(!r)return n.owner===void 0&&n.value!==void 0&&Ro(void 0,n.value);let{descriptor:i,owner:a}=r;return a!==n.owner||!!i.configurable!==n.configurable||!!i.enumerable!==n.enumerable?!1:`value`in i?n.value!==void 0&&!!i.writable===n.writable&&Ro(i.value,n.value):n.value===void 0&&i.get===n.get&&i.set===n.set}function qo(e,t,n){let r=e[t];if(!Array.isArray(r))return Uo(e,t,{functionsByIdentity:!0,ignoreRegExpLastIndex:!0});let i=Array.from({length:r.length},(e,t)=>{let i=Object.hasOwn(r,t),a=i?r[t]:void 0;return{entry:a,own:i,values:i&&a!=null&&(typeof a==`object`||typeof a==`function`)?n.map(e=>Go(a,e)):n.map(()=>Go(Object.create(null),``))}}),a=new Set(n),o=i.every(({entry:e,own:t,values:n})=>{if(!t||e==null||typeof e!=`object`&&typeof e!=`function`)return!0;let r=Object.getPrototypeOf(e);return(r===Object.prototype||r===null)&&Reflect.ownKeys(e).every(e=>a.has(e))&&n.every(e=>e.complete)});return{complete:o,isCurrent(e){let s=e[t];if(s!==r||!Array.isArray(s)||s.length!==i.length)return!1;for(let e=0;e<i.length;e++){let t=i[e];if(Object.hasOwn(s,e)!==t.own)return!1;if(!t.own)continue;let r=s[e];if(r!==t.entry)return!1;if(r!=null&&(typeof r==`object`||typeof r==`function`)){if(o&&(Object.getPrototypeOf(r)!==Object.prototype&&Object.getPrototypeOf(r)!==null||!Reflect.ownKeys(r).every(e=>a.has(e))))return!1;for(let e=0;e<n.length;e++)if(!Ko(r,n[e],t.values[e]))return!1}}return!0},key:t}}function Jo(e,t,n){let r=e[t];if(r==null||typeof r!=`object`&&typeof r!=`function`)return{complete:!0,isCurrent:e=>Object.is(e[t],r),key:t};let i=n.map(e=>Go(r,e)),a=new Set(n),o=Object.getPrototypeOf(r),s=(o===Object.prototype||o===null)&&Reflect.ownKeys(r).every(e=>a.has(e))&&i.every(e=>e.complete);return{complete:s,isCurrent(e){let o=e[t];return o!==r||o==null||typeof o!=`object`&&typeof o!=`function`||s&&(Object.getPrototypeOf(o)!==Object.prototype&&Object.getPrototypeOf(o)!==null||!Reflect.ownKeys(o).every(e=>a.has(e)))?!1:n.every((e,t)=>Ko(o,e,i[t]))},key:t}}function Yo(e){return Ho.map(t=>{switch(t){case`extractors`:return qo(e,t,[`name`,`order`,`extract`]);case`preflights`:return qo(e,t,[`getCSS`,`layer`]);case`variants`:return qo(e,t,[`match`,`multiPass`,`order`]);case`outputToCssLayers`:return Jo(e,t,[`allLayers`,`cssLayerName`]);case`shortcuts`:{let n=e.shortcuts,r=$(n);return{complete:Vo(r),isCurrent:t=>t.shortcuts===e.shortcuts&&Bo(t.shortcuts,r),key:t}}case`sortLayers`:return Uo(e,t,{functionsByIdentity:!0,ignoreRegExpLastIndex:!0});case`blocklist`:case`postprocess`:case`preprocess`:case`safelist`:return Uo(e,t,{functionsByIdentity:!0,ignoreRegExpLastIndex:!0});default:return Uo(e,t)}})}function Xo(e,t){return t.every(t=>t.isCurrent(e))}function Zo(e){return e.every(({complete:e})=>e)}function Qo({authoredOutputOrders:e,config:t,currentSelectors:r,layerSet:i,matched:a,minify:o,parentOrders:s,preflights:c,preflightsMap:l,scope:u,sheet:d,shortcutMergeOrders:f,resolveUnmatched:p}){let m=o?``:`
|
|
19
|
+
`,h=u?u.includes(`,`)?is(u):[u]:void 0;if(h?.some(e=>!/[^ \t\n\r\f]/.test(e.replace(/\/\*[\s\S]*?\*\//g,``))))throw TypeError(`[Teacss] scope selector list must not contain empty selectors`);let g={...t.layers},_=t.mergeSelectors,v=t.sortLayers,y=e=>Object.hasOwn(g,e)?g[e]??0:0,b=e=>Array.from(n(Reflect.apply(v,t,[e.sort((e,t)=>y(e)-y(t)||to(e,t))]))),x=b(Array.from(i)),S=Object.create(null),C=i.size===1?i.values().next().value:void 0,w,T,E=t.outputToCssLayers,D=typeof E==`object`?fo(E,`cssLayerName`):void 0,O=typeof E==`object`&&fo(E,`allLayers`)?b(k([...Object.keys(g),...x])):void 0,A=new Map,j=e=>{let t=A.get(e);if(t!==void 0)return t;let n=e;D&&typeof E==`object`&&(n=Reflect.apply(D,E,[e]));let r=n===null?null:n??e;return A.set(e,r),r};if(E)for(let e of k([...x,...O??[]]))j(e);let M=t=>{let n=(e,t)=>e.ruleIndex-t.ruleIndex||e.sort-t.sort||no(e.currentSelector,t.currentSelector)||Number(t.noScope)-Number(e.noScope)||Number(t.noMerge)-Number(e.noMerge)||no(e.selector,t.selector)||no(e.body,t.body)||0,i=(e,t)=>e.ruleIndex===t.ruleIndex&&e.sort===t.sort,a=[],o=new Map,s=t.flatMap(e=>f.get(e)?.components??[e]);for(let t of s){let s={authored:e.get(t),body:t[2],currentSelector:r.get(t)??t[5]?.currentSelector,item:t,noMerge:!!(t[6]??Q(t[4],`noMerge`)),noScope:!!Q(t[4],`noScope`),ruleIndex:t[0],selector:t[1],sort:Q(t[4],`sort`)||0},c=s.authored?.group;if(!c){B(a,{authoredGroup:void 0,records:[s],representative:s});continue}let l=o.get(c),u=l?.find(e=>i(e.records[0],s));if(u)B(u.records,s),n(s,u.representative)<0&&(u.representative=s);else{let e={authoredGroup:c,records:[s],representative:s};B(a,e),l?B(l,e):o.set(c,[e])}}for(let e of a)e.authoredGroup&&e.records.sort((e,t)=>e.authored.index-t.authored.index||n(e,t));a.sort((e,t)=>{let r=n(e.representative,t.representative);if(r)return r;let i=[...e.records].sort(n),a=[...t.records].sort(n),o=Math.min(i.length,a.length);for(let e=0;e<o;e++){let t=n(i[e],a[e]);if(t)return t}if(i.length!==a.length)return i.length-a.length;for(let r=0;r<e.records.length;r++){let i=n(e.records[r],t.records[r]);if(i)return i}return 0});let c=a.flatMap(e=>e.records.map(e=>e.item)),l=new Map;for(let e=0;e<c.length;e++){let t=c[e];l.set(t,e)}let u=new Set;for(let e of c){let t=f.get(e),n=t?.components;if(!t?.flatten||!t.original||!n?.length||u.has(t.group))continue;let r=l.get(n[0]);r!==void 0&&n.every((e,t)=>c[r+t]===e)&&u.add(t.group)}let d=new Set,p=[];for(let e of c){let t=f.get(e);if(!t||!u.has(t.group)){B(p,e);continue}d.has(t.group)||(d.add(t.group),B(p,t.original))}return p},ee=()=>{if(T)return T;let e=new Map,t=Array.from(d).sort((e,t)=>Eo(s,e[0]||``,t[0]||``));for(let[n,r]of t)for(let t of r){let r=Q(t[4],`layer`)||`utilities`,i=e.get(r),a=i?.[i.length-1];a?.[0]===n?B(a[1],t):i?B(i,[n,[t]]):e.set(r,[[n,[t]]])}return d.clear(),T=e,e},N=e=>{if(C===void 0)return ee().get(e)||[];if(e!==C)return[];if(w)return w;let t=Array.from(d).sort((e,t)=>Eo(s,e[0]||``,t[0]||``));return d.clear(),w=t,t},P=(e=He)=>{if(Object.hasOwn(S,e))return S[e];let t=N(e).map(([e,t])=>{let n=[];for(let[,e,r,,i,,a]of M(t)){if(e===``)continue;let t=Q(i,`noScope`)?void 0:h,o=e&&as(e,t);B(n,[o==null?[]:[[o,Q(i,`sort`)??0]],r,!!(a??Q(i,`noMerge`))||o!=null&&wo(o)])}if(!n.length)return;_&&To(n);let r=[];for(let e=n.length-1;e>=0;e--){let[t,i]=n[e],a=t.length===1?t[0][0]:``;if(t.length>1){t.sort((e,t)=>e[1]-t[1]||no(e[0],t[0]));let e=new Set,n=[];for(let[r]of t)r&&!e.has(r)&&(e.add(r),B(n,r));a=n.join(`,${m}`)}let o=a?`${a}{${i}}`:i;o&&B(r,o)}let i=Array.from(new Set(r)).reverse().join(m);return e?Do(e,i,m):i}).filter(Boolean).join(m);c&&(t=[l[e],t].filter(Boolean).join(m));let n;E&&t&&(n=j(e),n!==null&&(t=`@layer ${n}{${m}${t}${m}}`));let r=o?``:`/* layer: ${e}${n&&n!==e?`, alias: ${n}`:``} */${m}`;return S[e]=t?r+t:``},F=(e=x,t)=>{let r=Array.from(n(e)),i=new Set(n(t)),a=r.filter(e=>!i.has(e)),o=a.map(P).filter(Boolean);if(E){let e=k((O??a).map(j).filter(zr));e.length>0&&io(o,`@layer ${e.join(`, `)};`)}return o.join(m)},I=async(e,t)=>{let n=await t(P(e));return S[e]=n,n},te;return{get css(){return F()},layers:[...x],matched:a,getLayers:F,getLayer:P,setLayer:I,get diagnostics(){return te??={unmatched:p()},te}}}var $o=class e{userConfig;defaults;version=La;events=kr();config=void 0;cache=new ce(L,void 0,!0);blocked=new le(L,void 0,!0);_warnedUnmatched=new le(L);parentOrders=new Map;activatedRules=new Set;_dynamicIndex;_expansionIndex;_contextConfigs=new WeakMap;_expansionPrefixes=new WeakMap;_expansionOwnership=new WeakMap;_generationContexts=new WeakSet;_matchedStaticContexts=new WeakSet;_emptyStaticPayloads=new WeakSet;_configVersion=0;_collectionGeneration=0;_preparedConfigs=new WeakSet;_indexedRules;_indexedRuleSnapshot;_ruleObservation;_indexedShortcuts;_indexedShortcutSnapshot;_preparedCacheSnapshot;_preparedConfigMutable=!1;_preparedCacheReliable=!0;_startingGenerationParse=0;_startingInputCheck;_contextInputChecks=new WeakMap;_runtimeRevision=0;_variantCacheOwner={};_initialization;_constructedCSSResults=new WeakMap;_constructedCSSSequence=0;_parsedOutputOrders=new WeakMap;_rawUtilMetadata=new WeakMap;_stringifiedCurrentSelectors=new WeakMap;_stringifiedOutputOrders=new WeakMap;_stringifiedParentOrders=new WeakMap;_shortcutMergeOrders=new WeakMap;_utilParentOrders=new WeakMap;reportConfigObserverErrors(e){try{console.error(`[@teacss/core] Configuration observer failed:`,AggregateError(e,`Configuration observers failed`))}catch{}}dispatchConfig(e){let t=[];try{let r=this.events.events,i=Array.from(n(Object.hasOwn(r,`config`)?r.config:void 0));for(let n of i)try{let t=ho(n(e));t&&Promise.resolve(t).catch(e=>{this.reportConfigObserverErrors([e])})}catch(e){B(t,e)}}catch(e){B(t,e)}t.length&&this.reportConfigObserverErrors(t)}clearRuntimeCaches(e){e&&this._runtimeRevision++,this._expansionIndex=void 0,this._variantCacheOwner={},this.blocked.clear(),this._warnedUnmatched.clear(),this.parentOrders.clear(),this.activatedRules.clear(),this.cache.clear()}ensureRuleIndexesCurrent(e=!1){let t=!this._preparedConfigMutable&&this._ruleObservation?.isCurrent(),n=!1,r=!1,i=!0;this._preparedConfigMutable&&e&&this._preparedCacheSnapshot&&(Xo(this.config,this._preparedCacheSnapshot)||(r=!0,this._preparedCacheSnapshot=Yo(this.config),n=!0),i=Zo(this._preparedCacheSnapshot)),e&&(this._indexedShortcuts!==this.config.shortcuts||!this._indexedShortcutSnapshot||!Bo(this.config.shortcuts,this._indexedShortcutSnapshot))&&(r||=!!this._indexedShortcuts,this._indexedShortcuts=this.config.shortcuts,this._indexedShortcutSnapshot=$(this.config.shortcuts),n=!0);let a=this._indexedRules===this.config.rules;if(!e&&a)return;let o=a&&(this._ruleObservation&&!this._preparedConfigMutable?t:!!this._indexedRuleSnapshot&&Bo(this.config.rules,this._indexedRuleSnapshot));(!a||!o)&&(r||=!!this._indexedRules,ua(this.config),this._ruleObservation?.refresh(),this._indexedRules=this.config.rules,this._indexedRuleSnapshot=$(this.config.rules),this._dynamicIndex=void 0,n=!0),this._preparedConfigMutable&&(i=i&&!!this._indexedRuleSnapshot&&Vo(this._indexedRuleSnapshot),this._preparedCacheReliable=i),n&&this.clearRuntimeCaches(r),this._ruleObservation?.refresh()}collectValidatedParentOrders(e,t){for(let n of e){let e=n[3],r=this._stringifiedParentOrders.get(n);if(e!=null&&r!=null){let n=t.get(e);(n===void 0||r<n)&&t.set(e,r)}}}transferOutputOrder(e,t){let n=this._parsedOutputOrders.get(e);n&&this._stringifiedOutputOrders.set(t,n)}recordStringifiedContext(e,t){t?.currentSelector!==void 0&&this._stringifiedCurrentSelectors.set(e,t.currentSelector)}copyStringifiedUtil(e,t,r=!1,i=!1){let a=e[4],o;if(a){let e=Object.getOwnPropertyDescriptors(a),t=Reflect.ownKeys(e),i=!0;for(let n of t){let t=e[n];if(t.writable!==!0||t.enumerable!==!0||t.configurable!==!0||!Object.hasOwn(t,`value`)){i=!1;break}}if(i){let r=Object.create(null);for(let i of t){let t=e[i].value;r[i]=(i===`prefix`||i===`autocomplete`)&&Array.isArray(t)?[...n(t)]:t}o=r}else{let i=Object.create(null);for(let o of t){let t=e[o];r&&(t={configurable:!!t.configurable,enumerable:!!t.enumerable,value:Object.hasOwn(t,`value`)?t.value:Reflect.get(a,o),writable:!0}),(o===`prefix`||o===`autocomplete`)&&Object.hasOwn(t,`value`)&&Array.isArray(t.value)&&(t={...t,value:[...n(t.value)]}),i[o]=Object.assign(Object.create(null),t)}o=Object.defineProperties(Object.create(null),i)}}let s=e[5];if(i){let n=[e[0],e[1],e[2],e[3],o,s,e[6]];return t&&this.transferStringifiedMetadata(e,n),n}let c=s?{...s,theme:q(s.theme),variantHandlers:[...n(s.variantHandlers)],variantMatch:[s.variantMatch[0],s.variantMatch[1],[...n(s.variantMatch[2])],new Set(s.variantMatch[3])]}:void 0;s&&c&&(this._contextConfigs.set(c,this.getContextConfig(s)),Object.hasOwn(s,`rules`)?c.rules=s.rules?q(O(s.rules)):s.rules:delete c.rules,Object.hasOwn(s,`shortcuts`)?c.shortcuts=s.shortcuts?q(O(s.shortcuts)):s.shortcuts:delete c.shortcuts,Object.hasOwn(s,`variants`)?c.variants=s.variants?q(O(s.variants)):s.variants:delete c.variants);let l=[e[0],e[1],e[2],e[3],o,c,e[6]];return t&&this.transferStringifiedMetadata(e,l),l}transferStringifiedMetadata(e,t){let n=this._stringifiedCurrentSelectors.get(e);n!==void 0&&this._stringifiedCurrentSelectors.set(t,n);let r=this._stringifiedOutputOrders.get(e);r&&this._stringifiedOutputOrders.set(t,r);let i=this._stringifiedParentOrders.get(e);i!==void 0&&this._stringifiedParentOrders.set(t,i)}copyValidatedStringifiedUtils(e,t,n=!1,r=!1){let i=e,a=i.map(e=>this.copyStringifiedUtil(e,t,n,r));if(t){let e,t;for(let o=0;o<i.length;o++){let s=this._shortcutMergeOrders.get(i[o]);if(!s)continue;if(!e||!t){e=new Map;for(let t=0;t<i.length;t++)e.set(i[t],a[t]);t=new Map}let c=e,l=t.get(s.group);if(!l){let e=e=>{let t=c.get(e);return t||(t=this.copyStringifiedUtil(e,!0,n,r),c.set(e,t)),t},i=s.components?.map(e),a=s.original?e(s.original):void 0;l={...s,components:i,group:{},original:a},t.set(s.group,l);for(let e of i??[])this._shortcutMergeOrders.set(e,l);a&&this._shortcutMergeOrders.set(a,l)}this._shortcutMergeOrders.set(a[o],l)}}return a}getExpansionIndex(e,t){let n=t?this._expansionIndex:void 0;if(n&&n.entries===e&&Xa(n.slots,e))return n;let r=new Map,i=[],a=(e,t)=>{let n=r.get(e);n?B(n,t):r.set(e,[t])};for(let t=0;t<e.length;t++){if(!Object.hasOwn(e,t))continue;let n=e[t];if(!Array.isArray(n)||!Object.hasOwn(n,0)||!Object.hasOwn(n,1))continue;let r=Object.hasOwn(n,2)?n[2]:void 0;if(!j(n[0])){B(i,{entry:n,order:t});continue}let o=n[0],s=Q(r,`prefix`),c=s?O(s):void 0;if(!c){a(o,{candidateRank:0,entry:n,kind:`inherited`,order:t,prefix:void 0});continue}for(let e=0;e<c.length;e++)a(c[e]+o,{candidateRank:e,entry:n,kind:`fixed`,order:t,prefix:c[e]});a(o,{candidateRank:c.length,entry:n,kind:`inherited`,order:t,prefix:void 0,requiresPrefixes:c})}let o={dynamics:i,entries:e,slots:Array.from(e),statics:r};return t&&(this._expansionIndex=o),o}getDynamicIndex(e){return this._dynamicIndex?.config!==e&&(this._dynamicIndex={config:e,...Ja(e.rulesDynamic)}),this._dynamicIndex}constructor(e={},t={}){this.userConfig=e,this.defaults=t}async ensureInitialized(){this.config||(this._initialization||=wa(this.userConfig,this.defaults).then(e=>{if(this.config)return;let t=Ya(e),n=e.rules,r=$(n),i=e.shortcuts,a=$(i);this.config||(this.config=e,this._ruleObservation=t,this._indexedRules=n,this._indexedRuleSnapshot=r,this._indexedShortcuts=i,this._indexedShortcutSnapshot=a,this.dispatchConfig(e))}).finally(()=>this._initialization=void 0),await this._initialization)}static constructPublic(e,t){return new es(e,t)}static async create(t={},n={}){let r=e.constructPublic(t,n);return await r.ensureInitialized(),r}async setConfig(e,t){e&&this.commitConfig(await this.prepareConfig(e,t))}async prepareConfig(t,n){await Promise.resolve();let r=++this._configVersion,i=n??this.defaults,a=await wa(t,i),o=e.constructPublic(t,i);o.config=a,o._indexedRules=a.rules,o._indexedRuleSnapshot=$(a.rules),o._indexedShortcuts=a.shortcuts,o._indexedShortcutSnapshot=$(a.shortcuts),o._preparedCacheSnapshot=Yo(a),o._preparedConfigMutable=!0,o._preparedCacheReliable=Zo(o._preparedCacheSnapshot)&&Vo(o._indexedRuleSnapshot);let s=Object.freeze({config:a,defaults:i,generator:o,userConfig:t,version:r});return this._preparedConfigs.add(s),s}commitConfig(e){if(!this._preparedConfigs.delete(e)||e.version!==this._configVersion)return!1;let t=e.generator,n=e.config;return t.config!==n||(t.ensureRuleIndexesCurrent(!0),Ie(n),t.config!==n)?!1:(this.defaults=e.defaults,this.userConfig=e.userConfig,this.clearRuntimeCaches(!0),this.config=n,this._ruleObservation=t._ruleObservation,this._indexedRules=t._indexedRules,this._indexedRuleSnapshot=t._indexedRuleSnapshot,this._indexedShortcuts=t._indexedShortcuts,this._indexedShortcutSnapshot=t._indexedShortcutSnapshot,this._preparedCacheSnapshot=t._preparedCacheSnapshot,this._preparedConfigMutable=t._preparedConfigMutable,this._preparedCacheReliable=t._preparedCacheReliable,this._dynamicIndex=void 0,this.dispatchConfig(this.config),!0)}async applyExtractors(e,t,n=new Set){return this.applyExtractorsCurrent(e,t,n)}async applyExtractorsCurrent(e,t,n){await this.ensureInitialized(),this.ensureRuleIndexesCurrent(this._preparedConfigMutable);let r=this.config,i=this._runtimeRevision,a=oo(n),o=oo(a),s;try{s=await this.applyExtractorsForConfig(r,e,t,o)}catch(a){if(this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0),this.config!==r||this._runtimeRevision!==i)return this.applyExtractorsCurrent(e,t,n);throw a}return this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0),this.config!==r||this._runtimeRevision!==i?this.applyExtractorsCurrent(e,t,n):(so(n,a,s),n)}async applyExtractorsForConfig(e,t,r,i){let a={original:t,code:t,id:r,extracted:i,envMode:e.envMode};for(let t of n(e.extractors)){let e=E(t,`extract`),r=await(e==null?void 0:Reflect.apply(e,t,[a]));if(r&&r!==i){if(G(r)&&G(i))for(let e of r)i.setCount(e,i.getCount(e)+r.getCount(e));else for(let e of Array.isArray(r)?n(r):r)i.add(e)}}return i}requireInitialized(e){if(this.config)return this.config;throw Error(`[Teacss] TeacssGenerator is not initialized; use await createGenerator() before calling ${e}().`)}makeContextForConfig(e,t,n){let r={rawSelector:e,currentSelector:t[1],theme:n.theme,generator:this,symbols:Z,variantHandlers:t[2],constructCSS:(...e)=>this.constructCustomCSS(r,...e),variantMatch:t};return this._contextConfigs.set(r,n),r}makeContext(e,t){return this.makeContextForConfig(e,t,this.requireInitialized(`makeContext`))}getContextConfig(e){return e&&this._contextConfigs.get(e)||this.requireInitialized(`this synchronous entrypoint`)}async parseToken(e,t){let n=this._startingGenerationParse>0,r=await this.parseTokenInternal(e,t,n,this._startingInputCheck);if(n||r?.length!==0||!this._emptyStaticPayloads.has(r))return r&&!n?this.copyValidatedStringifiedUtils(r,!0):r}async parseTokenInternal(e,t,r,i){await this.ensureInitialized(),i?.(),this.ensureRuleIndexesCurrent(!r);let a=this.config,o=this._runtimeRevision,s=!this._preparedConfigMutable||this._preparedCacheReliable,c=s&&!t,l=()=>this.config!==a||this._runtimeRevision!==o,u=()=>(this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0),l()),d=()=>this.parseTokenInternal(e,t,r,i);if(s&&this.blocked.has(e)){de(this.blocked,e);return}let f=e,p=c?this.cache.get(f):void 0;if(c&&(p!==void 0||this.cache.has(f))){z(this.cache,f,p);let e=p&&O(p);if(!e||e.length===0)return e;let t=!0;for(let n=0;n<e.length;n++)if(!yo(e[n])){t=!1;break}let n=t?e:e.filter(yo);if(n.length>0)return r||this.collectValidatedParentOrders(n,this.parentOrders),n;this.cache.delete(f)}let m=e,h=m;for(let t of n(a.preprocess)){let n;try{n=t(h)}catch(e){if(u())return d();throw e}if(l())return d();if(!n){c&&(de(this.blocked,e),z(this.cache,f,null));return}h=n}let g;try{g=this.isBlocked(h)}catch(e){if(u())return d();throw e}if(l())return d();if(g){c&&(de(this.blocked,e),z(this.cache,f,null));return}let _;try{_=await this.matchVariantsForConfig(m,h,a)}catch(e){if(u())return d();throw e}if(l())return d();try{_=_.filter(e=>e&&!this.isBlocked(e[1]))}catch(e){if(u())return d();throw e}if(l())return d();if(!_.length){c&&(de(this.blocked,e),z(this.cache,f,null));return}let v=async e=>{let n=this.makeContextForConfig(m,[t||e[0],e[1],e[2],e[3]],a);r&&this._generationContexts.add(n),i&&this._contextInputChecks.set(n,i);try{a.details&&(n.variants=[...e[3]]);let t=await this.expandMatchedShortcut(n),r=t?await this.stringifyShortcuts(n.variantMatch,n,t[0],t[1],t[2]):(await this.parseUtilWithOwnership(n.variantMatch,n,!1,void 0,m))?.flatMap(e=>this.stringifyUtil(e,n)).filter(zr);return{direct:!t,utils:r,staticMatched:(a.unmatched===`warn`||a.unmatched===`error`)&&this._matchedStaticContexts.has(n)}}finally{r&&this._generationContexts.delete(n),this._contextInputChecks.delete(n)}},y;try{y=_.length===1?[await v(_[0])]:await Promise.all(_.map(e=>v(e)))}catch(e){if(u())return d();throw e}if(l()||this._preparedConfigMutable&&!r&&(this.ensureRuleIndexesCurrent(!0),l()))return d();let b=[],x={},S=0;for(let{direct:e,utils:t}of y)for(let n of t??[])e&&this._stringifiedOutputOrders.set(n,{group:x,index:S++}),B(b,n);if(b?.length)return r||this.collectValidatedParentOrders(b,this.parentOrders),c&&z(this.cache,f,b),b;if(y.some(({direct:e,staticMatched:t})=>e&&t))return this._emptyStaticPayloads.add(b),c&&z(this.cache,f,b),b;c&&z(this.cache,f,null)}parseTokenForGeneration(e,t){let n=this._startingInputCheck;this._startingInputCheck=t,this._startingGenerationParse++;try{return this.parseToken(e)}finally{this._startingGenerationParse--,this._startingInputCheck=n}}getCachedEquivalentTokens(e){this.config&&this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0);let t=this.cache.get(e);if(!t?.length)return[e];let n=new Set([e]);for(let[r,i]of this.cache.entries())i&&!r.endsWith(` -`)&&vo(i,r,t,e)&&n.add(r);return[...n]}async generate(e,t={}){let n=j(e)?void 0:++this._collectionGeneration,r=po(t,`isInputCurrent`);if(r!==void 0&&typeof r!=`function`)throw TypeError(`[@teacss/core] isInputCurrent must be a function.`);let i,a=r===void 0?void 0:()=>{if(i)throw i.error;try{let e=r();if(typeof e!=`boolean`)throw Promise.resolve(e).catch(Vr),TypeError(`[@teacss/core] isInputCurrent must return a boolean synchronously.`);if(!e)throw Error(`[@teacss/core] Generation input is no longer current.`)}catch(e){throw i={error:e},e}};return this.generateInternal(e,t,n,a)}async generateInternal(e,t,r,i){await this.ensureInitialized(),i?.(),this.ensureRuleIndexesCurrent(!0);let a=this.config,o=this._runtimeRevision,s=!this._preparedConfigMutable||this._preparedCacheReliable,c=()=>(i?.(),this.config!==a||this._runtimeRevision!==o),l=()=>(this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0),c()),u=new Map,d=!s||r===void 0||!(this.cache instanceof ce)?void 0:this.cache,f=d?.revision,p=po(t,`id`),m=po(t,`scope`),h=po(t,`preflights`),g=po(t,`safelist`),_=po(t,`minify`),v=po(t,`extendedInfo`),y=po(t,`tokenConcurrency`),b=h===void 0||h,x=g===void 0||g,S=_!==void 0&&_,C=v!==void 0&&v,w=()=>this.generateInternal(e,t,r,i);lo(y);let T;try{T=j(e)?await this.applyExtractorsForConfig(a,e,p,C?new Dr:new Set):Array.isArray(e)?Co(new Set(n(e))):G(e)?Co(ao(e)):Co(new Set(e))}catch(e){if(l())return w();throw e}if(c())return w();try{if(x){let e={generator:this,theme:a.theme};for(let t=0;t<a.safelist.length;t++){if(!Object.hasOwn(a.safelist,t))continue;let r=a.safelist[t],i=typeof r==`function`?r(e):r;for(let e of n(O(i))){let t=e.trim();if(!t)continue;let n=t.includes(`{`)?Co(new Set([t])):[t];for(let e of n)T.has(e)||T.add(e)}}}}catch(e){if(l())return w();throw e}if(c())return w();let D=S?``:`
|
|
20
|
+
`,k=new Set([He]),A=C?new Map:new Set,M=new Map,ee=[],N=new Map,P=Object.create(null),F=Array.from(T),I;try{I=await go(F,y,e=>this.parseTokenForGeneration(e,i))}catch(e){if(l())return w();throw e}if(c())return w();let te=0,ne=d!==void 0,re=a.unmatched===`warn`||a.unmatched===`error`,ie=[];try{for(let e=0;e<F.length;e++){let t=F[e],n=I[e];if(n?.length===0&&this._emptyStaticPayloads.has(n)){I[e]=null;continue}if(n==null){re&&bi(t)&&!this.blocked.has(t)&&!this.isBlocked(t)&&B(ie,t);continue}let r=this.copyValidatedStringifiedUtils(n,!0,!0,!0);te++,ne&&!d.isRetained(t)&&(ne=!1),A instanceof Map?A.set(t,{data:this.copyValidatedStringifiedUtils(r,!1),count:G(T)?T.getCount(t):-1}):A.add(t),this.collectValidatedParentOrders(r,N);for(let e of r){B(ee,e);let t=e[3]||``,n=Q(e[4],`layer`);M.has(t)||M.set(t,[]),B(M.get(t),e),n&&k.add(n)}}}catch(e){if(l())return w();throw e}if(c())return w();for(let[e,t]of N){u.set(e,t);let n=this.parentOrders.get(e);(n===void 0||t<n)&&this.parentOrders.set(e,t)}try{await(async()=>{if(!b)return;let e=O(a.preflights);if(!e.length)return;let t={generator:this,generated:this.copyValidatedStringifiedUtils(ee,!1),theme:a.theme},r=new Set,i=new Map;for(let t of n(e)){let e=E(t,`layer`)||`preflights`;k.add(e),r.add(e);let n=i.get(e);n?B(n,t):i.set(e,[t])}P=Object.assign(Object.create(null),Object.fromEntries(await Promise.all(Array.from(r).map(async e=>[e,(await Promise.all(O(i.get(e)||[]).map(async e=>{let n=E(e,`getCSS`);return n?await Reflect.apply(n,e,[t]):void 0}))).filter(Boolean).join(D)]))))})()}catch(e){if(l())return w();throw e}if(c())return w();let ae,oe,L=()=>(ae??=ie.flatMap(e=>{let t=ji(e,a);return t===void 0?[]:[{token:e,suggestions:t}]}),ae);if(ie.length&&a.unmatched!==`off`&&a.unmatched!==void 0){let e;try{e=await Promise.resolve().then(L),this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0)}catch(e){if(l())return w();throw e}if(c())return w();let t=({token:e,suggestions:t})=>t.length?`"${e}" (did you mean ${t.map(e=>`"${e}"`).join(`, `)}?)`:`"${e}"`;if(a.unmatched===`error`){if(e.length)throw Error(`[@teacss/core] ${e.length} token${e.length===1?``:`s`} matched no rule: ${e.map(t).join(`; `)}`)}else a.warn&&(oe=()=>{for(let n of e)if(i?.(),!this._warnedUnmatched.has(n.token)){if(console.warn(`[Teacss]`,`unmatched token ${t(n)}`),c())return;de(this._warnedUnmatched,n.token)}})}let R;try{R=Qo({authoredOutputOrders:this._stringifiedOutputOrders,config:a,currentSelectors:this._stringifiedCurrentSelectors,layerSet:k,matched:A,minify:S,parentOrders:u,preflights:b,preflightsMap:P,scope:m,sheet:M,shortcutMergeOrders:this._shortcutMergeOrders,resolveUnmatched:L}),await Promise.resolve(),this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0)}catch(e){if(l())return w();throw e}if(c())return w();if(oe){try{oe(),await Promise.resolve(),this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0)}catch(e){if(l())return w();throw e}if(c())return w()}return d&&f!==void 0&&this.cache===d&&r===this._collectionGeneration&&(!ne||te!==d.retainedSize)&&d.replaceRetained(co(F,I),f),R}async matchVariants(e,t){return this.matchVariantsCurrent(e,t)}async matchVariantsCurrent(e,t){await this.ensureInitialized(),this.ensureRuleIndexesCurrent(this._preparedConfigMutable);let n=this.config,r=this._runtimeRevision,i;try{i=await this.matchVariantsForConfig(e,t,n)}catch(i){if(this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0),this.config!==n||this._runtimeRevision!==r)return this.matchVariantsCurrent(e,t);throw i}return this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0),this.config!==n||this._runtimeRevision!==r?this.matchVariantsCurrent(e,t):i}async matchVariantsForConfig(e,t,r){let i={rawSelector:e,theme:r.theme,generator:this};me(i,r===this.config?this._variantCacheOwner:r);let a=r.variants,o=async t=>{let r=!0,[,,s,c]=t;for(;r;){r=!1;let l=t[1];for(let e of n(a)){let a=E(e,`multiPass`)??!1;if(!a&&c.has(e))continue;let u=E(e,`match`);if(!u)continue;let d=Reflect.apply(u,e,[l,i]),f=ho(d),p=f?await f:d;if(p){if(j(p)){if(p===l)continue;p={matcher:p}}if(Array.isArray(p)){let r=Array.from(n(p));if(!r.length)continue;if(r.length===1)p=r[0];else{if(a)throw Error(`multiPass can not be used together with array return variants`);let n=r.map(n=>{let r=E(n,`matcher`)??l,i=[n,...s],a=new Set(c);return a.add(e),[t[0],r,i,a]});return(await Promise.all(n.map(e=>o(e)))).flat()}}t[1]=E(p,`matcher`)??l,io(s,p),c.add(e),r=!0;break}}if(!r)break;if(s.length>500)throw Error(`Too many variants applied to "${e}"`)}return[t]};return await o([e,t||e,[],new Set])}applyVariants(e,t=e[4],r=e[1],i=ss(r),a){let o=Array.from(n(t),mo),s=o.length>1?o.sort((e,t)=>(e.order||0)-(t.order||0)):o,c=O(this.getContextConfig(a).postprocess),l={prefix:``,selector:i,pseudo:``,entries:s.length||c.length?q(O(e[2])):e[2]},u=s.length?s.reduceRight((e,t)=>n=>{let r=E(n,`entries`)??[],i=E(n,`parent`),a=E(n,`parentOrder`),o=E(n,`selector`)??``,s=(t.body==null?void 0:Reflect.apply(t.body,t.source,[r]))||r,c=t.parent||i,l=t.selector==null?void 0:Reflect.apply(t.selector,t.source,[o,s]);return Reflect.apply(t.handle??cs,t.source,[{...n,entries:s,selector:l??o,parent:c,parentOrder:t.parentOrder??(c===i?a:void 0),layer:t.layer||E(n,`layer`),sort:t.sort??E(n,`sort`)},e])},e=>e)(l):l,d=E(u,`parent`),f=E(u,`parentOrder`),p={selector:[E(u,`prefix`)??``,E(u,`selector`)??``,E(u,`pseudo`)??``].join(``),entries:E(u,`entries`)??[],parent:d,layer:E(u,`layer`),sort:E(u,`sort`),noMerge:E(u,`noMerge`)};d!=null&&f!=null&&this._utilParentOrders.set(p,f);let m=[p];for(let e of n(c)){let t=[];for(let r of m){let i=this._utilParentOrders.get(r),a=r.parent;i!=null&&this._utilParentOrders.delete(r);let o=e(r);if(Array.isArray(o))for(let e of n(o))e!=null&&(i!=null&&e.parent===a&&this._utilParentOrders.set(e,i),B(t,e));else{let e=o||r;i!=null&&e.parent===a&&this._utilParentOrders.set(e,i),B(t,e)}}m=t}return m}constructCustomCSS(e,t,n){let r=Yr(t);return this.constructNormalizedCSS(e,r,n)}constructNormalizedCSS(e,t,n){if(j(t))return t;let r=[];for(let e=0;e<t.length;e++){if(!Object.hasOwn(t,e))continue;let n=t[e];if(!Object.hasOwn(n,0))continue;let i=n[0];typeof i==`string`?B(r,n):i===Z.body&&B(r,[Qr,Object.hasOwn(n,1)?n[1]:void 0])}let i=this.applyVariants([0,n||e.rawSelector,r,void 0,e.variantHandlers],void 0,void 0,void 0,e).map(e=>{let{selector:t,entries:n,parent:r,layer:i,sort:a,noMerge:o}=e;return{body:ei(n),layer:i,noMerge:o,parent:r,parentOrder:this._utilParentOrders.get(e),selector:t,sort:a}}).filter(e=>!!e.body);if(!i.length)return``;let a=i.map(e=>{let t=`${e.selector}{${e.body}}`;return e.parent?Do(e.parent,t):t}).join(``),o=e,s=this._constructedCSSResults.get(o);s||(s=new Map,this._constructedCSSResults.set(o,s));let c=a;return s.has(c)&&(c=`${a}\n${(++this._constructedCSSSequence).toString(2).replaceAll(`0`,` `).replaceAll(`1`,` `)}\n`),s.set(c,i),c}async parseUtil(e,t,n=!1,r){return this.parseUtilWithOwnership(e,t,n,r)}async parseUtilWithOwnership(e,t,n=!1,r,i=j(e)?e:e[0],a){let o=!Ne((a??``)+i).keyword;await this.ensureInitialized();let s=Object.hasOwn(t,`rules`),c=t.rules,l=c?.length;this.getContextConfig(t)===this.config&&!this._generationContexts.has(t)&&this.ensureRuleIndexesCurrent(!0);let u=this.getContextConfig(t),d=u===this.config&&this._preparedConfigMutable&&!this._generationContexts.has(t),f=this._runtimeRevision,p=async e=>{let[i,s,c]=e;if(!o||Ne((a??``)+s).keyword)return;u.details&&(t.rules=t.rules??[]);let l={...t,currentSelector:s,variantHandlers:c,variantMatch:e};this._contextConfigs.set(l,u);let d;l.constructCSS=(...e)=>{if(!n||!t.variantHandlers.length)return this.constructCustomCSS(l,...e);let r=Yr(e[0]);if(!j(r)&&xo(r))return this.constructNormalizedCSS(l,r,e[1]);d||(d={...l,variantHandlers:So(l.variantHandlers,t.variantHandlers)},this._contextConfigs.set(d,u));let i=this.constructNormalizedCSS(d,r,e[1]),a=this._constructedCSSResults.get(d)?.get(i);if(a){let e=this._constructedCSSResults.get(l);e||(e=new Map,this._constructedCSSResults.set(l,e)),e.set(i,a)}return i};let p=u.rulesStaticMap[s];if(r){p=void 0;let e=O(r);for(let t=u.rules.length-1;t>=0;t--){let n=u.rules[t];if(!ai(n)||n[0]!==s)continue;let r=Q(n[2],`prefix`);if(!r||O(r).some(t=>e.includes(t))){p=n;break}}}let m=p,h=()=>{let e=m;if(m=void 0,!(!e?.[1]||!n&&Q(e[2],`internal`)))return!n&&(u.unmatched===`warn`||u.unmatched===`error`)&&this._matchedStaticContexts.add(t),this.resolveCSSResult(i,e[1],e,l,f)},g=s.indexOf(`:`),_=this.getDynamicIndex(u),v=g>0&&_.map.get(s.slice(0,g))||_.fallback;for(let e of v){let[t,a,o]=e;if((Q(m?.[2],`__index`)??-1)>(Q(o,`__index`)??-1)){let e=h();if(e)return e}if(Q(o,`internal`)&&!n)continue;let c=[s],u=Q(o,`prefix`);if(u){let e=O(u);if(r){let t=O(r);if(!e.some(e=>t.includes(e)))continue}else if(c=e.filter(e=>s.startsWith(e)).map(e=>s.slice(e.length)),!c.length)continue}for(let n of c){let r=pi(n,t);if(!r)continue;let o=a(r,l),s=ho(o),c=s?await s:o;if(!c)continue;if(typeof c==`object`||typeof c==`function`){let e=Array.isArray(c)?void 0:E(c,Symbol.asyncIterator);if(e){let t=[];for await(let n of{[Symbol.asyncIterator]:()=>Reflect.apply(e,c,[])})n&&B(t,n);c=t}else{let e=Array.isArray(c)?void 0:E(c,Symbol.iterator);if(e){let t=[];for(let n of{[Symbol.iterator]:()=>Reflect.apply(e,c,[])})n!=null&&B(t,n);c=t}}}let u=this.resolveCSSResult(i,c,e,l,f);if(u)return u}}return h()},m,h;try{let t=j(e)?await this.matchVariantsForConfig(e,void 0,u):[e];m=t.length===1?await p(t[0]):(await Promise.all(t.map(p))).flat().filter(zr)}catch(e){h=[e]}if(d&&(this.ensureRuleIndexesCurrent(!0),this.config===u&&this._runtimeRevision!==f))return c&&l!==void 0?(c.length=l,t.rules=c):s?t.rules=c:delete t.rules,this.parseUtilWithOwnership(e,t,n,r,i,a);if(h)throw h[0];if(m?.length)return m}resolveCSSResult=(e,t,r,i,a)=>{let o=Xr(t).filter(e=>e.length);if(o.length){let t=this.getContextConfig(i);t.details&&(t!==this.config||a===this._runtimeRevision)&&B(i.rules,r),t===this.config&&a===this._runtimeRevision&&i.generator.activatedRules.add(r);let s=r[2],c=Q(s,`__index`),l={},u=0,d=e=>(this._parsedOutputOrders.set(e,{group:l,index:u++}),e);return o.flatMap(t=>{if(j(t)){let e=this._constructedCSSResults.get(i)?.get(t);return e?e.map(e=>{let t=[c,e.body,s];return this._rawUtilMetadata.set(t,e),d(t)}):[d([c,t,s])]}let r=[],a=i.variantHandlers,o=s,l=e=>{a=[e,...a]},u=e=>{a=[...a,e]},f=e=>{o={...o,...e}};for(let e=0;e<t.length;e++){if(!Object.hasOwn(t,e))continue;let i=t[e],o=Object.hasOwn(i,0)?i[0]:void 0,s=()=>Object.hasOwn(i,1)?i[1]:void 0;switch(o){case Z.variants:{let e=s();if(typeof e==`function`){let t=e([...n(a)]);t&&(a=[...n(t)])}else a=[...n(e),...a];break}case Z.parent:l({parent:s()});break;case Z.selector:u({selector:s()});break;case Z.layer:l({layer:s()});break;case Z.sort:f({sort:s()});break;case Z.noMerge:f({noMerge:s()});break;case Z.noScope:f({noScope:s()});break;case Z.shortcutsNoMerge:B(r,i);break;case Z.body:B(r,[Qr,s()]);break;default:j(o)&&B(r,i)}}return[d([c,e,r,o,a])]})}};stringifyUtil(e,t){if(!e)return;let n=this.getContextConfig(t);if(Rr(e)){let r=this._rawUtilMetadata.get(e),i=e[2];if(r?.layer!==void 0||r?.sort!==void 0){let t={...e[2]??{}},n=Q(e[2],`layer`),a=Q(e[2],`sort`);delete t.layer,delete t.sort,i={...t,layer:r.layer??n,sort:r.sort??a}}let a=[e[0],r?.selector,r?.body??e[1],r?.parent,i,n.details?t:void 0,r?.noMerge];return this.transferOutputOrder(e,a),this.recordStringifiedContext(a,t),r?.parent!=null&&r.parentOrder!=null&&this._stringifiedParentOrders.set(a,r.parentOrder),[a]}let r=this.applyVariants(e,void 0,void 0,void 0,t),i=[];for(let a of r){let{selector:r,entries:o,parent:s,layer:c,sort:l,noMerge:u}=a,d=ei(o);if(!d)continue;let f=e[3];if(c!==void 0||l!==void 0){let{layer:t,sort:n,...r}=e[3]??{};f={...r,layer:c??t,sort:l??n}}let p=[e[0],r,d,s,f,n.details?t:void 0,u];this.transferOutputOrder(e,p),this.recordStringifiedContext(p,t);let m=this._utilParentOrders.get(a);s!=null&&m!=null&&this._stringifiedParentOrders.set(p,m),B(i,p)}return i}async expandShortcut(e,t,n=5){return await this.ensureInitialized(),this.expandConfiguredExpansions(e,t,n,this.getContextConfig(t).shortcuts,`shortcut`)}async expandMatchedShortcut(e,t=5){let n=this.getContextConfig(e),r={config:n};return this.expandConfiguredExpansionsForInput(e.variantMatch,e,t,n.shortcuts,`shortcut`,void 0,void 0,r)}async expandConfiguredExpansions(e,t,n,r,i,a,o){await this.ensureInitialized();let s=this.getContextConfig(t);s===this.config&&!this._generationContexts.has(t)&&this.ensureRuleIndexesCurrent(!0);let c=r===s.shortcuts&&o===void 0?{config:s}:void 0,l=await this.expandConfiguredExpansionsForInput(e,t,n,r,i,a,o,c);if(!l)return;let u=[l[0],l[1]];return this._expansionPrefixes.set(u,l[2]),this._expansionPrefixes.set(u[0],l[2]),u}async expandConfiguredExpansionsForInput(e,t,r,i,a,o,s,c){let l=O(i);if(r<=0||!l.length)return;let u=this.getContextConfig(t),d=j(e)?e:e[1],f=u.details?e=>{t.shortcuts=t.shortcuts??[],B(t.shortcuts,e)}:Vr,p,m,h,g,_=s,v=this.getExpansionIndex(l,i===u.shortcuts),y,b=v.statics.get(d);if(b){for(let e of b)if((!e.requiresPrefixes||s&&e.requiresPrefixes.includes(s))&&(c&&!c.shortcuts&&(c.shortcuts=$(u.shortcuts)),e.entry[1])){y=e;break}}let x=y?y.order:1/0,S=[{prefix:s,value:d}];expansionLoop:for(let{entry:e,order:n}of v.dynamics){if(n>=x)break;let r=Object.hasOwn(e,2)?e[2]:void 0,i=S,a=Q(r,`prefix`);if(a){let e=O(a);if(i=e.filter(e=>d.startsWith(e)).map(e=>({prefix:e,value:d.slice(e.length)})),s&&e.includes(s)&&B(i,{prefix:s,value:d}),!i.length)continue}for(let n of i){if(c&&!c.shortcuts&&(c.shortcuts=$(u.shortcuts)),j(e[0])){if(e[0]!==n.value)continue;m=e[1]}else{let r=pi(n.value,e[0]);r&&(m=e[1](r,t))}if(m){_=n.prefix,p||=r,f(e);break expansionLoop}}}if(!m&&y){let e=y.entry;m=e[1],m&&(_=y.kind===`fixed`?y.prefix:s,p=Object.hasOwn(e,2)?e[2]:void 0,f(e))}if(m){let e=[...n(O(m))];h=e.filter(e=>j(e)).flatMap(e=>Ni(na(On(e.trim()),u.separators))).map(e=>({prefix:_,value:e})),g=e.filter(e=>!j(e)).map(e=>({handles:[],value:e}))}if(!m&&j(e)){let n=await this.matchVariantsForConfig(e,void 0,u);for(let e of n){let[n,l,u]=e;if(n!==l){let e=await this.expandConfiguredExpansionsForInput(l,t,r-1,i,a,o,s,c);if(e){let t=this._expansionPrefixes.get(e)??[];h??=[];for(let r=0;r<e[0].length;r++){let i=e[0][r];j(i)&&B(h,{prefix:t[r]??s,value:n.replace(l,()=>i)})}g??=[],ro(g,e[0].filter(e=>!j(e)).map(e=>({handles:[...e.handles,...u],value:e.value})))}}}}if(!h?.length&&!g?.length)return;let C=new Map,w=(h??[]).filter(({prefix:e,value:t})=>{let n=C.get(e);return n||(n=new Set,C.set(e,n)),!n.has(t)&&(n.add(t),!0)}),T=[...(await Promise.all(w.map(async({prefix:e,value:n})=>{let s=await this.expandConfiguredExpansionsForInput(n,t,r-1,i,a,o,e,c),l=s?void 0:await o?.(n,t,r-1),d=s??l;if(!d)return[{prefix:e,value:n}];let f=this._expansionPrefixes.get(d)??[],p=l&&this._expansionOwnership.get(l[0]),m=p?.authority.config===u&&!!p.authority.shortcuts&&Bo(u.shortcuts,p.authority.shortcuts);return d[0].map((t,n)=>({prefix:s?f[n]??e:m&&p.leaves[n]===t?p.prefixes[n]:void 0,value:t}))}))).flat(),...(g??[]).map(e=>({prefix:_,value:e}))].filter(({value:e})=>!!e),E=T.map(({value:e})=>e),D=T.map(({prefix:e})=>e);this._expansionPrefixes.set(E,D);let k=[E,p,D];return this._expansionPrefixes.set(k,D),c&&this._expansionOwnership.set(E,{authority:c,leaves:[...E],prefixes:[...D]}),k}async stringifyShortcuts(e,t,n,r,i){await this.ensureInitialized();let a=this.getContextConfig(t),o=this._runtimeRevision,s=[];r={...r,layer:Q(r,`layer`)??a.shortcutsLayer};let c=this._expansionOwnership.get(n),l=this._contextConfigs.get(t)===a&&c?.authority.config===a&&!!c.authority.shortcuts&&Bo(a.shortcuts,c.authority.shortcuts),u=new Wr,d=(await Promise.all(n.map(async(n,r)=>{let i=j(n)?await this.parseUtilWithOwnership(n,t,!0,l&&c.leaves[r]===n?c.prefixes[r]:void 0,n,l&&c.leaves[r]===n?c.prefixes[r]:void 0):[[1/0,`{inline}`,Yr(n.value),void 0,n.handles]];return!i&&a.warn&&B(s,[r,`unmatched utility "${n}" in shortcut "${e[1]}"`]),i||[]}))).flat(1).filter(Boolean).sort((e,t)=>e[0]-t[0]);a.details&&t.rules&&t.rules.length>1&&t.rules.sort((e,t)=>(Q(e[2],`__index`)??1/0)-(Q(t[2],`__index`)??1/0));let[f,,p]=e,m=d.some(Rr),h={},g=0,_=[],v=e=>{let t=this._shortcutMergeOrders.get(e)?.components;if(!t?.length){this._stringifiedOutputOrders.set(e,{group:h,index:g++});return}let n;for(let e of t){let t={group:h,index:g++};n??=t,this._stringifiedOutputOrders.set(e,t)}n&&this._stringifiedOutputOrders.set(e,n)};for(let e of d){if(Rr(e)){let n=this._rawUtilMetadata.get(e),i={...e[2],...r,layer:n?.layer??Q(r,`layer`),sort:n?.sort??Q(r,`sort`)??Q(e[2],`sort`)},o=[e[0],n?.selector,n?.body??e[1],n?.parent,i,a.details?t:void 0,n?.noMerge];this.recordStringifiedContext(o,t),n?.parent!=null&&n.parentOrder!=null&&this._stringifiedParentOrders.set(o,n.parentOrder),v(o),B(_,o);continue}let n=xo(e[2]),i=n?e[4]:So(e[4],p);for(let o of this.applyVariants(e,i,f,void 0,t)){let{selector:i,entries:s,parent:c,sort:l,noMerge:d,layer:f}=o,p=!!(d??Q(r,`noMerge`)??Q(e[3],`noMerge`)),h=!!(Q(r,`noScope`)??Q(e[3],`noScope`)),g=Q(r,`sort`),y=Q(r,`layer`),b=n?g??0:l??g??Q(e[3],`sort`)??0;if(m){let n=ei(s);if(!n)continue;let l=[e[0],i,n,c,{...r,noMerge:p,noScope:h,sort:b,layer:f??y},a.details?t:void 0,void 0];this.recordStringifiedContext(l,t);let u=this._utilParentOrders.get(o);c!=null&&u!=null&&this._stringifiedParentOrders.set(l,u),v(l),B(_,l);continue}let x=u.getFallback(f??y,{ordered:[],streams:new Map}),S=x.streams.get(c);S||(S=[],x.streams.set(c,S));let C=S[S.length-1];(!C||C.selector!==i||C.noScope!==h)&&(C={entries:[],noScope:h,parent:c,parentOrder:void 0,selector:i},B(S,C),B(x.ordered,C)),B(C.entries,[s,p,b,e[0]]);let w=this._utilParentOrders.get(o);w!=null&&(C.parentOrder==null||w<C.parentOrder)&&(C.parentOrder=w)}}let y=u.flatMap((e,n)=>e.ordered.map(({entries:e,noScope:i,parentOrder:o,selector:s,parent:c})=>{let l=(e,l,u)=>{if(!u.length)return[];let d=-1/0,f=-1/0;for(let[,e,t]of u)d=Math.max(d,e),f=Math.max(f,t);let p=e&&u.length>1?u.map(([e,t,n])=>[e.map(e=>[e[0],e[1]]),t,n]):u,m=p.map(e=>e[0]);return(e?[m.flat(1)]:m).map((u,m)=>{let h=ei(u);if(h){let u={...r,noMerge:l,noScope:i,sort:d,layer:n},g=[f,s,h,c,u,a.details?t:void 0,void 0];this.recordStringifiedContext(g,t),c!=null&&o!=null&&this._stringifiedParentOrders.set(g,o);let _=e?p:[p[m]],v={flatten:e,group:{}};return v.components=e&&_.length>1?_.map(([n,r,i])=>{let l=e?ei(n):h;if(!l)return;let d=[i,s,l,c,{...u,sort:r},a.details?t:void 0,void 0];return this.recordStringifiedContext(d,t),c!=null&&o!=null&&this._stringifiedParentOrders.set(d,o),this._shortcutMergeOrders.set(d,v),d}).filter(zr):void 0,v.original=g,this._shortcutMergeOrders.set(g,v),g}})},u=[],d=[],f=[],p=[];for(let[t,n,r,i]of e){let e=O(t).some(bo);B(n?e?u:d:e?f:p,[t,r,i])}return[...l(!1,!0,u),...l(!0,!0,d),...l(!1,!1,f),...l(!0,!1,p)].filter(zr)}).flat(1).filter(Boolean));for(let e of y)v(e);let b=_.concat(y);if(s.length){await Promise.resolve(),a===this.config&&this._preparedConfigMutable&&this.ensureRuleIndexesCurrent(!0);for(let[,e]of s.sort((e,t)=>e[0]-t[0])){if(this._contextInputChecks.get(t)?.(),a!==this.config||o!==this._runtimeRevision)break;ia(e)}}return b}isBlocked(e){if(!e)return!0;let{blocklist:t}=this.requireInitialized(`isBlocked`);for(let n=0;n<t.length;n++){if(!Object.hasOwn(t,n))continue;let r=t[n],i=Array.isArray(r)?Object.hasOwn(r,0)?r[0]:void 0:r;if(i!==void 0&&this.matchesBlocklist(i,e))return!0}return!1}getBlocked(e){let{blocklist:t}=this.requireInitialized(`getBlocked`);for(let n=0;n<t.length;n++){if(!Object.hasOwn(t,n))continue;let r=t[n],i=Array.isArray(r)?Object.hasOwn(r,0)?r[0]:void 0:r;if(i!==void 0&&this.matchesBlocklist(i,e))return[i,Array.isArray(r)&&Object.hasOwn(r,1)?r[1]:void 0]}}matchesBlocklist(e,t){return typeof e==`function`?!!e(t):j(e)?e===t:pi(t,e)!==null}},es=class extends $o{constructor(e={},t={}){super(e,t)}};async function ts(e,t){return await $o.create(e,t)}const ns=/\s\$\$\s+/g;function rs(e){return ko(e).length>0}function is(e){let t=[],n=0,r=!1,i=0,a,o=0,s=0;for(let c=0;c<e.length;c++){let l=e[c];if(r)l===`*`&&e[c+1]===`/`&&(r=!1,c++);else if(a)l===`\\`?c++:l===a&&(a=void 0);else if(l===`/`&&e[c+1]===`*`)r=!0,c++;else if(l===`\\`){let t=c+1;for(;t<c+7&&/[\da-f]/i.test(e[t]??``);)t++;t>c+1?(/[ \t\n\r\f]/.test(e[t]??``)&&(e[t]===`\r`&&e[t+1]===`
|
|
21
|
+
`&&t++,t++),c=t-1):c++}else if(l===`"`||l===`'`)a=l;else if(l===`[`)n++;else if(l===`]`)n>0&&n--;else if(l===`(`)i++;else if(l===`)`)i>0&&i--;else if(l===`,`&&n===0&&i===0){B(t,e.slice(o,s).replace(/^[ \t\n\r\f]+/,``)),o=c+1,s=o;continue}(r||a||!/[ \t\n\r\f]/.test(l))&&(s=c+1)}return B(t,e.slice(o,s).replace(/^[ \t\n\r\f]+/,``)),t}function as(e,t){return is(e).flatMap(e=>{let n=e.startsWith(`$$`)&&/\s/.test(e[2]??``)?` ${e}`:e;if(!t)return Ao(n);let r=rs(n);return t.map(t=>r?Ao(n,t):`${t} ${e}`)}).join(`,`)}const os=/^\[(.+?)(~?=)"(.*)"\]$/;function ss(e){return os.test(e)?e.replace(os,(e,t,n,r)=>`[${Mn(t)}${n}"${Mn(r)}"]`):`.${Mn(e)}`}function cs(e,t){return t(e)}const ls=e.hash??((t,n,r)=>e.createHash(t).update(n).digest(r));function us(e,t=8){return ls(`sha256`,e,`hex`).substring(0,t)}const ds=`@teacss-include`,fs=`@teacss-ignore`,ps=`@teacss-ide-include`,ms=`@teacss-placeholder`,hs=`@teacss-skip-start`,gs=`@teacss-skip-end`,_s=RegExp(`(//\\s*?${hs}\\s*?|\\/\\*\\s*?${hs}\\s*?\\*\\/|<!--\\s*?${hs}\\s*?-->)[\\s\\S]*?(//\\s*?${gs}\\s*?|\\/\\*\\s*?${gs}\\s*?\\*\\/|<!--\\s*?${gs}\\s*?-->)`,`g`),vs=[/^(?:virtual:)?tea(?::(.+))?\.css(\?.*)?$/],ys=`__ALL__`;export{Wr as BetterMap,ms as CSS_PLACEHOLDER,Dr as CountableSet,Ue as DEFAULT_LAYERS,fs as IGNORE_COMMENT,ds as INCLUDE_COMMENT,ps as INCLUDE_COMMENT_IDE,Le as LAYER_IMPORTS,ys as LAYER_MARK_ALL,Be as LAYER_PREFLIGHTS,Re as LAYER_PRIMITIVES,ze as LAYER_PROPERTIES,Ve as LAYER_SHORTCUTS,He as LAYER_UTILITIES,ti as RESET_KEY,_s as SKIP_COMMENT_RE,gs as SKIP_END_COMMENT,hs as SKIP_START_COMMENT,es as TeacssGenerator,Ur as TwoKeyMap,vs as VIRTUAL_ENTRY_ALIAS,Qr as VirtualKey,Mr as attributifyRE,oe as buildConditionSelector,Zr as clearIdenticalEntries,q as clone,ta as collapseVariantGroup,$a as comparableWidth,Eo as compareParentAtRules,Pe as createConditionVariant,ts as createGenerator,kr as createNanoEvents,Nr as cssIdRE,Wn as defaultSplitRE,Fa as definePreset,ji as diagnoseUnmatchedToken,Mn as e,ei as entriesToCss,An as escapeRegExp,jn as escapeSelector,On as expandClassGroups,Cn as expandGroups,Pi as expandUnderscores,na as expandVariantGroup,Er as extractorDefault,Er as extractorSplit,Ia as getEnvFlags,us as getHash,Fn as getPath,rs as hasScopePlaceholder,Ln as hash,Ui as isArbitrary,Fr as isAttributifySelector,G as isCountableSet,In as isCssId,K as isObject,Rr as isRawUtil,ai as isStaticRule,oi as isStaticShortcut,j as isString,Br as isThenable,bi as isTokenShaped,Ir as isValidSelector,g as isValidTargetSelector,$i as makeRegexClassGroup,Aa as mergeConfigs,ni as mergeDeep,Vr as noop,Wi as normalizeArbitraryValue,Yr as normalizeCSSEntries,Xr as normalizeCSSValues,Lr as normalizeVariant,zr as notNull,Ne as parseClassToken,N as parseCondition,P as parseConditions,ea as parseVariantGroup,ns as regexScopePlaceholder,Hn as replaceAsync,ae as resolveConditions,wa as resolveConfig,ya as resolvePreset,xa as resolvePresets,ga as resolveShortcuts,Vn as restoreSkipCode,Hi as spaceCalcOperators,Ni as splitClassTokens,Gn as splitWithVariantGroupRE,Z as symbols,O as toArray,ss as toEscapedSelector,yi as tokenConditionBase,Bn as transformSkipCode,k as uniq,A as uniqueBy,Pr as validateFilterRE,ia as warnOnce,Hr as withLayer};
|