shweet 0.0.19 → 0.0.22
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/dist/index.d.ts +37 -5
- package/dist/index.js +8 -8
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ declare const isFN: (v: any) => v is Function;
|
|
|
2
2
|
declare const isAsync: (v: any) => v is Function;
|
|
3
3
|
declare const isPromise: (v: any) => v is Function;
|
|
4
4
|
declare const isNumber: (value: any) => boolean;
|
|
5
|
-
declare const isDict: (val: any) => boolean;
|
|
6
5
|
declare const isPlainObject: (value: any) => boolean;
|
|
7
6
|
declare const isArraybuff: (val: any) => val is string | ArrayBuffer | Uint8Array<ArrayBufferLike>;
|
|
8
7
|
declare const isClassOrId: (k: string) => boolean;
|
|
@@ -25,7 +24,6 @@ declare const is_isAsync: typeof isAsync;
|
|
|
25
24
|
declare const is_isBool: typeof isBool;
|
|
26
25
|
declare const is_isClassOrId: typeof isClassOrId;
|
|
27
26
|
declare const is_isDefined: typeof isDefined;
|
|
28
|
-
declare const is_isDict: typeof isDict;
|
|
29
27
|
declare const is_isFN: typeof isFN;
|
|
30
28
|
declare const is_isInt: typeof isInt;
|
|
31
29
|
declare const is_isNotNull: typeof isNotNull;
|
|
@@ -40,7 +38,27 @@ declare const is_isStr: typeof isStr;
|
|
|
40
38
|
declare const is_isUndefined: typeof isUndefined;
|
|
41
39
|
declare const is_isWindow: typeof isWindow;
|
|
42
40
|
declare namespace is {
|
|
43
|
-
export {
|
|
41
|
+
export {
|
|
42
|
+
is_isArr as isArr,
|
|
43
|
+
is_isArraybuff as isArraybuff,
|
|
44
|
+
is_isAsync as isAsync,
|
|
45
|
+
is_isBool as isBool,
|
|
46
|
+
is_isClassOrId as isClassOrId,
|
|
47
|
+
is_isDefined as isDefined,
|
|
48
|
+
is_isFN as isFN,
|
|
49
|
+
is_isInt as isInt,
|
|
50
|
+
is_isNotNull as isNotNull,
|
|
51
|
+
is_isNotWindow as isNotWindow,
|
|
52
|
+
is_isNull as isNull,
|
|
53
|
+
is_isNum as isNum,
|
|
54
|
+
is_isNumber as isNumber,
|
|
55
|
+
is_isObj as isObj,
|
|
56
|
+
is_isPlainObject as isPlainObject,
|
|
57
|
+
is_isPromise as isPromise,
|
|
58
|
+
is_isStr as isStr,
|
|
59
|
+
is_isUndefined as isUndefined,
|
|
60
|
+
is_isWindow as isWindow,
|
|
61
|
+
};
|
|
44
62
|
}
|
|
45
63
|
|
|
46
64
|
type V = string | number | boolean;
|
|
@@ -107,9 +125,20 @@ declare class __ {
|
|
|
107
125
|
static get is(): typeof is;
|
|
108
126
|
static get return(): typeof returner;
|
|
109
127
|
static sleep: (ms?: number) => Promise<unknown>;
|
|
128
|
+
static get screen(): "xs" | "sm" | "smd" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
129
|
+
bytes(bytes: number): string;
|
|
130
|
+
static format(val: any): Formatteer;
|
|
110
131
|
}
|
|
111
132
|
declare class returner {
|
|
112
|
-
static
|
|
133
|
+
static arr(val: any): any[];
|
|
134
|
+
static num(val: any, iferr?: any): number;
|
|
135
|
+
}
|
|
136
|
+
declare class Formatteer {
|
|
137
|
+
val: any;
|
|
138
|
+
constructor(val: any);
|
|
139
|
+
get px(): string;
|
|
140
|
+
get rem(): string;
|
|
141
|
+
get pr(): string;
|
|
113
142
|
}
|
|
114
143
|
|
|
115
144
|
declare class _Var {
|
|
@@ -168,6 +197,7 @@ interface mtype {
|
|
|
168
197
|
xl?: CSSValue;
|
|
169
198
|
xxl?: CSSValue;
|
|
170
199
|
no_hover?: CSSValue;
|
|
200
|
+
mobile?: CSSValue;
|
|
171
201
|
print?: CSSValue;
|
|
172
202
|
dark?: CSSValue;
|
|
173
203
|
screen?: CSSValue;
|
|
@@ -205,6 +235,7 @@ declare class Medyas<T extends Medyas<T>, Q = Record<string, any>> {
|
|
|
205
235
|
get XL(): T;
|
|
206
236
|
get XXL(): T;
|
|
207
237
|
get NO_HOVER(): T;
|
|
238
|
+
get MOBILE(): T;
|
|
208
239
|
get PRINT(): T;
|
|
209
240
|
get SCREEN(): T;
|
|
210
241
|
get DARK(): T;
|
|
@@ -723,4 +754,5 @@ declare class Shweet {
|
|
|
723
754
|
}
|
|
724
755
|
declare function fileName(path: string): string;
|
|
725
756
|
|
|
726
|
-
export {
|
|
757
|
+
export { Medyas, Shweet, Value, Var, __, f, fileName, log, med, media, ps, supports, v };
|
|
758
|
+
export type { CSS, CSSValue, CSSinR, KFCSS, VarType, atCSS, fontFace };
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var tn=Object.defineProperty;var An=(n,C)=>{for(var $ in C)tn(n,$,{get:C[$],enumerable:!0,configurable:!0,set:(T)=>C[$]=()=>T})};var Jn={};An(Jn,{isWindow:()=>_n,isUndefined:()=>fn,isStr:()=>t,isPromise:()=>Vn,isPlainObject:()=>on,isObj:()=>d,isNumber:()=>_,isNum:()=>Tn,isNull:()=>x,isNotWindow:()=>Zn,isNotNull:()=>yn,isInt:()=>Wn,isFN:()=>v,isDict:()=>zn,isDefined:()=>B,isClassOrId:()=>$n,isBool:()=>gn,isAsync:()=>Pn,isArraybuff:()=>un,isArr:()=>Z});var v=(n)=>typeof n==="function",Pn=(n)=>n.constructor.name==="AsyncFunction",Vn=(n)=>!!n&&typeof n.then==="function",_=(n)=>{return!isNaN(parseFloat(n))&&isFinite(n)},zn=(n)=>{return typeof n==="object"&&n!==null&&!Array.isArray(n)},on=(n)=>{return typeof n==="object"&&n!==null&&Object.getPrototypeOf(n)===Object.prototype},un=(n)=>{return n instanceof Uint8Array||n instanceof ArrayBuffer||typeof n==="string"},$n=(n)=>{return n.startsWith(".")||n.startsWith("#")},gn=(n)=>typeof n==="boolean",t=(n)=>typeof n==="string",Z=(n)=>Array.isArray(n),d=(n)=>typeof n==="object",Tn=(n)=>typeof n==="number",x=(n)=>n===null,yn=(n)=>n===null,fn=(n)=>typeof n==="undefined",B=(n)=>typeof n!=="undefined",Wn=(n)=>{return Number.isInteger(Number(n))},_n=typeof window!=="undefined",Zn=typeof window==="undefined";var Qn=(n)=>{return Z(n)?n:[n]};class c{static set i(n){console.info(...Qn(n))}static set e(n){console.error(...Qn(n))}static set w(n){console.info(...Qn(n))}}var dn=(n)=>Array.from({length:n},(C,$)=>$),Ln="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Hn="abcdefghijklmnopqrstuvwxyz";var a=(n)=>JSON.stringify(n),En=(n)=>{return JSON.parse(n)},A=(n)=>{if(n.startsWith("webkit"))n="-"+n;return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()},p=(n)=>{let C=Ln+Hn,$=dn(10).join("");return Array.from({length:n},(T,J)=>C+(J?$:"")).reduce((T,J)=>{return T+=J.charAt(Math.floor(Math.random()*J.length))},"")},cn=(n=6,C)=>{if(!C)return Math.floor(Math.random()*n);return Math.round(Math.random()*(C-n)+n)},On=()=>{let n=[...Ln,...Hn],C=cn(0,n.length);return n[C]};class H extends Map{obj(n){n&&G(n).forEach(([C,$])=>this.set(C,$))}map(n){n.forEach((C,$)=>{if(C instanceof H)this.set($,C);else if(Z(C)){if(this.lacks($))this.set($,[]);this.get($).push(...C)}else if(d(C))this.ass($,C);else this.set($,C)})}ass(n,C){if(!this.has(n))this.set(n,{});X(this.get(n),C)}lacks(n){return!this.has(n)}init(n,C){return this.has(n)?this.get(n):this.set(n,C).get(n)}}var{values:P,keys:h,entries:G}=Object;var X=Object.assign,Dn=(n,C)=>Object.hasOwn(n,C),Nn=(n)=>{return Object.keys(n).length};class bn{static rand(n=6,C){if(C)return Math.floor(Math.random()*(C-n+1)+n);return Math.floor(Math.random()*n)+1-1}static fill(n,C=null){return Array(n).fill(C)}static new({dom:n,id:C,inner:$}){let T=document.createElement(n);if(C)T.id=C;if($)T.innerHTML=$;return T}static randFrom(n){if(Array.isArray(n)){let C=n.length,$=this.rand(0,C-1);return n[$]}else if(typeof n=="object"){let C=h(n),$=C.length,T=this.rand(0,$-1);return C[T]}}static randomAZ=On;static makeID=p;static class(n,C){let $=C;if(n?.class)$.push(...Z(n.class)?n.class:[n.class]);n.class=C}static get O(){return{vals:P,keys:h,items:G,has:Dn,ass:X,len:(n={})=>h(n).length}}static get is(){return Jn}static get return(){return Fn}static sleep=(n=1000)=>new Promise((C)=>setTimeout(C,n))}class Fn{static array(n){return Z(n)?n:[n]}}var Bn={xs:"480px",sm:"480px",smd:"624px",md:"768px",lg:"1024px",xl:"1280px",xxl:"1536px"};class N{static default="xs";static prop=G(Bn).reduce((n,[C,$],T)=>{return n[C]=`(${T==0?"max-width":"min-width"}: ${$})`,n},{});static extra={no_hover:"(pointer: coarse)",print:"print",screen:"screen",dark:"(prefers-color-scheme: dark)"};constructor(n,C={}){let $=N.default,T={};if(n!==void 0)i(T,$,n,$);G(C).forEach(([J,E])=>{i(T,J,E,$)}),X(this,T)}static get breakpoints(){return En(a(Bn))}}var i=(n,C,$,T)=>{if($!==void 0)if($ instanceof N)G($).forEach(([J,E])=>{if(T!==C)if(C!==J)if(T===J)i(n,C,E,T);else i(n,`${C}-${J}`,E,T);else i(n,J,E,T);else i(n,J,E,T)});else n[C]=$};function j(n,C){if(C)return new N(n,C);return new N(void 0,n)}function ln(n){if(this._prefix)return j({[this._prefix]:n});else return j({xs:n})}function Y(n){return new this.constructor({prefix:n,values:this._values,data:this.data})}class s{_prefix;data;_values;constructor({prefix:n,data:C,values:$}={data:{},values:{}}){this._prefix=n,this._values=$,G($).forEach(([T,J])=>{if(!this._values[T])this._values[T]=j({});X(this._values[T],J)}),this.data=C}get XS(){return Y.call(this,"xs")}get SM(){return Y.call(this,"sm")}get SMD(){return Y.call(this,"smd")}get MD(){return Y.call(this,"md")}get LG(){return Y.call(this,"lg")}get XL(){return Y.call(this,"xl")}get XXL(){return Y.call(this,"xxl")}get NO_HOVER(){return Y.call(this,"no_hover")}get PRINT(){return Y.call(this,"print")}get SCREEN(){return Y.call(this,"screen")}get DARK(){return Y.call(this,"dark")}set _value(n){G(n).forEach(([C,$])=>{if(!this._values[C])this._values[C]=j({});X(this._values[C],ln.call(this,$))})}get _value(){return this._values}}class K{k="";fallback;var="";value;constructor(n={},C){if(Nn(n)){let[$,T]=G(n)[0];this.k=$,this.var="--"+A($),this.value=T instanceof N?T:j(T,{}),this.fallback=C}else this.value=j({})}__(n){if(n)this.fallback=n;let C=this.fallback;if(C)return`var(${this.var}, ${Q(C)})`;else return`var(${this.var})`}new(n,C){return new K({[this.k]:n instanceof N?n:Q(n)},C)}}var vn=(n,C)=>{return new K(n,C)};var Q=(n,C={unit:"rem"})=>{let{rem:$,second:T,quote:J,degree:E,percent:q,delimeter:U,unit:R,delimeter_arr:L}=C;if(fn(n)||x(n)||!J&&n==="")return"";let g=Z(n)?n:[n];if(!g.length)return"";return g.filter((S)=>B(S)).map((S)=>{if(Z(S))return U=L||", ",Q(S,{...C,delimeter:" "});if(S instanceof K)return S.__();if(J)S=String(S);if(Tn(S))if($)return`${S}${R?R:"rem"}`;else if(E)return`${S}deg`;else if(q)return`${S}%`;else if(T)return`${S}s`;else return String(S);if(t(S))if(S.includes("("))return S;else if(J)return`'${S}'`;else return S;return""}).filter((S)=>B(S)&&S!=="").join(U||" ")};var Xn=new Set(["transitionDuration","transitionDelay","animationDelay","animationDuration"]),xn=new Set([...Xn,"zIndex","opacity","aspectRatio","order","flexShrink","flexGrow","flex","fillOpacity","lineClamp","order","scale","webkitLineClamp","animationIterationCount","animationTimingFunction","transitionTimingFunction","columnCount","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd"]),pn=new Set(["content"]),an=new Set(["transitionProperty"]),z=(n,C,$="rem")=>{let T=Q(C,{rem:!xn.has(n),second:Xn.has(n),quote:pn.has(n),delimeter:an.has(n)?", ":" ",unit:$});return`${A(n)}: ${T};`};class e{value;__;constructor(n){if(this.value=new H,t(n))this.value.set(n,[]);else G(n).forEach(([C,$])=>{this.value.set(`${C}:${$}`,[])});this.__=(...C)=>{return this.value.forEach(($)=>{$.push(...C)}),this}}}function sn(n){return new e(n).__}var o=(n)=>{if(v(n))return o(n());if(n instanceof N)return n;if(n instanceof K)return j(n.__(),{});return j(n,{})},en=(n)=>{n.value.forEach((C,$)=>{n.value.set($,C.map((T)=>{let J={};return G(T).forEach(([E,q])=>{if(B(q))J[E]=o(q)}),J}))})},Sn=(n,C=[])=>{let $=[];if(Z(n))return Sn(n[0],$);if(n instanceof K)return Sn(P(n.value),$);return $.push(String(n)),$};class qn{base;constructor(n){this.base=n}props(n,C,$){let T=["animation","animationName"].includes(C);return G($).forEach(([J,E])=>{if(T)$[J]=this.addPrefixToAnimation(n,E);else $[J]=E}),$}addPrefixToAnimation(n,C){if(C instanceof K)this.saveAnim(n,C);else if(Z(C))return C[0]=this.addPrefixToAnimation(n,C[0]),C;else if(t(C)&&!C.includes("("))return C.split(", ").map((J)=>{let E=J.split(" "),q=E[0],U=E.slice(1).join(" "),R=`${this.base.PREFIX}${q}`;return this.base.ANIM.init(R,new Set).add(n),`${this.base.PREFIX}${q} ${U}`.trim()}).join(", ");return C}saveAnim(n,C){Sn(C).forEach(($)=>{this.base.ANIM.init(`${this.base.PREFIX}${$}`,new Set).add(n)})}process(n,C,$,T,J){if($ instanceof K)this.saveAnim(n,$),T.ass($.var,this.props(n,$.var,o($.value)));else if(C.startsWith(":")||C.startsWith(",")||C.startsWith("[")){if(C.startsWith("::before")||C.startsWith("::after")){if(Z($)){if(!$.some((q)=>("content"in q)))$.push({content:""})}}this.set(n+C,$,J)}else if(C.startsWith(" ")){let q=C.match(/^.*?\w/gm)?.[0].slice(0,-1),U=C.replaceAll(/, /gm,`, ${n}${q}`);this.set(n+U,$,J)}else if($n(C))this.set(n+C,$,J);else T.set(C,this.props(n,C,o($)))}set(n,C,$){if(!d(C))return;let T=new H;if(C instanceof K)this.saveAnim(n,C),T.ass(C.var,this.props(n,C.var,o(C.value)));else if(C instanceof s)G(C._value).forEach(([E,q])=>{if(B(q))T.set(E,this.props(n,E,o(q)))});else if(C instanceof e)en(C),T.init("supports",[]).push(C);else if(Z(C))C.forEach((E)=>{this.set(n,E,$)});else G(C).forEach(([E,q])=>{return this.process(n,E,q,T,$)});let J=$.init(n,new H);T.forEach((E,q)=>{if(q==="supports")$.init(n,new H).init(q,[])?.push(...E);else J.set(q,E)})}}class r{PRE;EXPORT;UNIT;PS;PREFIX;ARR=new H;CID=new H;DATA=new H;ANIM=new H;IMPORTED=[];constructor(n="",C="",$,T){this.PRE=n;this.EXPORT=$;this.UNIT=T;this.PREFIX=C?C+"_":C,this.PS=new qn(this)}get(n,C,$){let T=n.PRE+C;if(n.DATA.has(T))return T;else if(C in n)return n[C];else return n.PRE+C}set(n,C,$){return!1}get css(){return new Proxy(this,this)}load(n){return this.IMPORTED.push(n),this}}class V extends r{set(n,C,$){let T=n.PRE+C;return n.PS.set(T,$,n.DATA),!0}}class k extends r{webkit;constructor(n="",C=!0,$){super("",n,!1,$);this.webkit=C}set(n,C,$){let T=n.PREFIX+C,J=Z($)?$:[$],E=new H;if(J.forEach((q)=>{G(q).forEach(([U,R])=>{let L=_(U)?`${U}%`:U;n.PS.set(L,R,E)})}),n.ANIM.init(T,new Set),n.DATA.set(`@keyframes ${T}`,E),this.webkit)n.DATA.set(`@-webkit-keyframes ${T}`,E);return!0}}class m extends r{constructor(n=""){super("@",n)}set(n,C,$){return n.ARR.init(n.PRE+C,new Set).add($),n}}class l extends r{constructor(n=""){super("@font-face",n);this.ARR.set(this.PRE,new Set)}set(n,C,$){let T=G({fontFamily:C,...$}).map(([J,E])=>{return z(J,E,this.UNIT)});return n.ARR.get(n.PRE)?.add(T.join(`
|
|
3
|
-
`)),!0}}var
|
|
4
|
-
`));else{let O=
|
|
2
|
+
var Vn=Object.defineProperty;var Pn=(n,C)=>{for(var $ in C)Vn(n,$,{get:C[$],enumerable:!0,configurable:!0,set:(f)=>C[$]=()=>f})};var Qn={};Pn(Qn,{isWindow:()=>dn,isUndefined:()=>Jn,isStr:()=>h,isPromise:()=>zn,isPlainObject:()=>un,isObj:()=>d,isNumber:()=>_,isNum:()=>fn,isNull:()=>x,isNotWindow:()=>Ln,isNotNull:()=>_n,isInt:()=>Wn,isFN:()=>v,isDefined:()=>X,isClassOrId:()=>$n,isBool:()=>Rn,isAsync:()=>on,isArraybuff:()=>yn,isArr:()=>L});var v=(n)=>typeof n==="function",on=(n)=>n.constructor.name==="AsyncFunction",zn=(n)=>!!n&&typeof n.then==="function",_=(n)=>{return!isNaN(parseFloat(n))&&isFinite(n)},un=(n)=>{return typeof n==="object"&&n!==null&&Object.getPrototypeOf(n)===Object.prototype&&!Array.isArray(n)},yn=(n)=>{return n instanceof Uint8Array||n instanceof ArrayBuffer||typeof n==="string"},$n=(n)=>{return n.startsWith(".")||n.startsWith("#")},Rn=(n)=>typeof n==="boolean",h=(n)=>typeof n==="string",L=(n)=>Array.isArray(n),d=(n)=>typeof n==="object",fn=(n)=>typeof n==="number",x=(n)=>n===null,_n=(n)=>n===null,Jn=(n)=>typeof n==="undefined",X=(n)=>typeof n!=="undefined",Wn=(n)=>{return Number.isInteger(Number(n))},dn=typeof window!=="undefined",Ln=typeof window==="undefined";var En=(n)=>{return L(n)?n:[n]};class c{static set i(n){console.info(...En(n))}static set e(n){console.error(...En(n))}static set w(n){console.info(...En(n))}}var cn=(n)=>Array.from({length:n},(C,$)=>$),Zn="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Hn="abcdefghijklmnopqrstuvwxyz";var a=(n)=>JSON.stringify(n),Tn=(n)=>{return JSON.parse(n)},On=(n)=>{return n.replace(/-([a-z])/g,(C,$)=>$.toUpperCase())},A=(n)=>{if(n.startsWith("webkit"))n="-"+n;return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()},p=(n)=>{let C=Zn+Hn,$=cn(10).join("");return Array.from({length:n},(f,Q)=>C+(Q?$:"")).reduce((f,Q)=>{return f+=Q.charAt(Math.floor(Math.random()*Q.length))},"")},rn=(n=6,C)=>{if(!C)return Math.floor(Math.random()*n);return Math.round(Math.random()*(C-n)+n)},Bn=()=>{let n=[...Zn,...Hn],C=rn(0,n.length);return n[C]};class H extends Map{obj(n){n&&U(n).forEach(([C,$])=>this.set(C,$))}map(n){n.forEach((C,$)=>{if(C instanceof H)this.set($,C);else if(L(C)){if(this.lacks($))this.set($,[]);this.get($).push(...C)}else if(d(C))this.ass($,C);else this.set($,C)})}ass(n,C){if(!this.has(n))this.set(n,{});Y(this.get(n),C)}lacks(n){return!this.has(n)}init(n,C){return this.has(n)?this.get(n):this.set(n,C).get(n)}}var{values:V,keys:I,entries:U}=Object;var Y=Object.assign,Dn=(n,C)=>Object.hasOwn(n,C),Nn=(n)=>{return Object.keys(n).length};class Fn{static rand(n=6,C){if(C)return Math.floor(Math.random()*(C-n+1)+n);return Math.floor(Math.random()*n)+1-1}static fill(n,C=null){return Array(n).fill(C)}static new({dom:n,id:C,inner:$}){let f=document.createElement(n);if(C)f.id=C;if($)f.innerHTML=$;return f}static randFrom(n){if(Array.isArray(n)){let C=n.length,$=this.rand(0,C-1);return n[$]}else if(typeof n=="object"){let C=I(n),$=C.length,f=this.rand(0,$-1);return C[f]}}static randomAZ=Bn;static makeID=p;static class(n,C){let $=C;if(n?.class)$.push(...L(n.class)?n.class:[n.class]);n.class=C}static get O(){return{vals:V,keys:I,items:U,has:Dn,ass:Y,len:(n={})=>I(n).length}}static get is(){return Qn}static get return(){return bn}static sleep=(n=1000)=>new Promise((C)=>setTimeout(C,n));static get screen(){let{innerWidth:n}=window,C={xs:n<=480,sm:n>=480,smd:n>=624,md:n>=768,lg:n>=1024,xl:n>=1280,xxl:n>=1536},$=U(C).reverse();for(let f=0;f<$.length;f++){let[Q,E]=$[f];if(E)return Q}return}bytes(n){if(n===0)return"0 Bytes";let C=1024,$=["Bytes","KB","MB","GB"],f=Math.floor(Math.log(n)/Math.log(C));return parseFloat((n/Math.pow(C,f)).toFixed(2))+" "+$[f]}static format(n){return new Xn(n)}}class bn{static arr(n){return L(n)?n:[n]}static num(n,C=0){let $=parseFloat(n);return isNaN($)?C:$}}class Xn{val;constructor(n){this.val=n}get px(){return`${this.val}px`}get rem(){return`${this.val}rem`}get pr(){return`${this.val}%`}}var Yn={xs:"480px",sm:"480px",smd:"624px",md:"768px",lg:"1024px",xl:"1280px",xxl:"1536px"};class D{static default="xs";static prop=U(Yn).reduce((n,[C,$],f)=>{return n[C]=`(${f==0?"max-width":"min-width"}: ${$})`,n},{});static extra={no_hover:"(pointer: coarse)",mobile:"(pointer: coarse)",print:"print",screen:"screen",dark:"(prefers-color-scheme: dark)"};constructor(n,C={}){let $=D.default,f={};if(n!==void 0)i(f,$,n,$);U(C).forEach(([Q,E])=>{i(f,Q,E,$)}),Y(this,f)}static get breakpoints(){return Tn(a(Yn))}}var i=(n,C,$,f)=>{if($!==void 0)if($ instanceof D)U($).forEach(([Q,E])=>{if(f!==C)if(C!==Q)if(f===Q)i(n,C,E,f);else i(n,`${C}-${Q}`,E,f);else i(n,Q,E,f);else i(n,Q,E,f)});else n[C]=$};function t(n,C){if(C)return new D(n,C);return new D(void 0,n)}function vn(n){if(this._prefix)return t({[this._prefix]:n});else return t({xs:n})}function b(n){return new this.constructor({prefix:n,values:this._values,data:this.data})}class s{_prefix;data;_values;constructor({prefix:n,data:C,values:$}={data:{},values:{}}){this._prefix=n,this._values=$,U($).forEach(([f,Q])=>{if(!this._values[f])this._values[f]=t({});Y(this._values[f],Q)}),this.data=C}get XS(){return b.call(this,"xs")}get SM(){return b.call(this,"sm")}get SMD(){return b.call(this,"smd")}get MD(){return b.call(this,"md")}get LG(){return b.call(this,"lg")}get XL(){return b.call(this,"xl")}get XXL(){return b.call(this,"xxl")}get NO_HOVER(){return b.call(this,"no_hover")}get MOBILE(){return b.call(this,"no_hover")}get PRINT(){return b.call(this,"print")}get SCREEN(){return b.call(this,"screen")}get DARK(){return b.call(this,"dark")}set _value(n){U(n).forEach(([C,$])=>{if(!this._values[C])this._values[C]=t({});Y(this._values[C],vn.call(this,$))})}get _value(){return this._values}}class j{k="";fallback;var="";value;constructor(n={},C){if(Nn(n)){let[$,f]=U(n)[0];this.k=$,this.var="--"+A($),this.value=f instanceof D?f:t(f,{}),this.fallback=C}else this.value=t({})}__(n){if(n)this.fallback=n;let C=this.fallback;if(C)return`var(${this.var}, ${T(C)})`;else return`var(${this.var})`}new(n,C){return new j({[this.k]:n instanceof D?n:T(n)},C)}}var xn=(n,C)=>{return new j(n,C)};var T=(n,C={unit:"rem"})=>{let{rem:$,second:f,quote:Q,degree:E,percent:S,delimeter:G,unit:g,delimeter_arr:Z}=C;if(Jn(n)||x(n)||!Q&&n==="")return"";let R=L(n)?n:[n];if(!R.length)return"";return R.filter((q)=>X(q)).map((q)=>{if(L(q))return G=Z||", ",T(q,{...C,delimeter:" "});if(q instanceof j)return q.__();if(Q)q=String(q);if(fn(q))if($)return`${q}${g?g:"rem"}`;else if(E)return`${q}deg`;else if(S)return`${q}%`;else if(f)return`${q}s`;else return String(q);if(h(q))if(q.includes("("))return q;else if(Q)return`'${q}'`;else return q;return""}).filter((q)=>X(q)&&q!=="").join(G||" ")};var tn=new Set(["transitionDuration","transitionDelay","animationDelay","animationDuration"]),pn=new Set([...tn,"zIndex","opacity","aspectRatio","order","flexShrink","flexGrow","flex","fillOpacity","lineClamp","order","scale","webkitLineClamp","animationIterationCount","animationTimingFunction","transitionTimingFunction","columnCount","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd"]),an=new Set(["content"]),sn=new Set(["transitionProperty"]),o=(n,C,$="rem")=>{let f=T(C,{rem:!pn.has(n),second:tn.has(n),quote:an.has(n),delimeter:sn.has(n)?", ":" ",unit:$});return`${A(n)}: ${f};`};class e{value;__;constructor(n){if(this.value=new H,h(n))this.value.set(n,[]);else U(n).forEach(([C,$])=>{this.value.set(`${C}:${$}`,[])});this.__=(...C)=>{return this.value.forEach(($)=>{$.push(...C)}),this}}}function en(n){return new e(n).__}var z=(n)=>{if(v(n))return z(n());if(n instanceof D)return n;if(n instanceof j)return t(n.__(),{});return t(n,{})};function nC(n){let C={};return n.split(";").map(($)=>$.trim()).filter(($)=>$!=="").forEach(($)=>{let[f,Q]=$.split(":").map((S)=>S.trim()),E=On(f);if(!isNaN(Number(Q))&&isFinite(Number(Q)))C[E]=Number(Q);else C[E]=Q}),C}var CC=(n)=>{n.value.forEach((C,$)=>{n.value.set($,C.map((f)=>{let Q={};return U(f).forEach(([E,S])=>{if(X(S))Q[E]=z(S)}),Q}))})},qn=(n,C=[])=>{let $=[];if(L(n))return qn(n[0],$);if(n instanceof j)return qn(V(n.value),$);return $.push(String(n)),$};class Sn{base;constructor(n){this.base=n}props(n,C,$){let f=["animation","animationName"].includes(C);return U($).forEach(([Q,E])=>{if(f)$[Q]=this.addPrefixToAnimation(n,E);else $[Q]=E}),$}addPrefixToAnimation(n,C){if(C instanceof j)this.saveAnim(n,C);else if(L(C))return C[0]=this.addPrefixToAnimation(n,C[0]),C;else if(h(C)&&!C.includes("("))return C.split(", ").map((Q)=>{let E=Q.split(" "),S=E[0],G=E.slice(1).join(" "),g=`${this.base.PREFIX}${S}`;return this.base.ANIM.init(g,new Set).add(n),`${this.base.PREFIX}${S} ${G}`.trim()}).join(", ");return C}saveAnim(n,C){qn(C).forEach(($)=>{this.base.ANIM.init(`${this.base.PREFIX}${$}`,new Set).add(n)})}process(n,C,$,f,Q){if($ instanceof j)this.saveAnim(n,$),f.ass($.var,this.props(n,$.var,z($.value)));else if(C.startsWith(":")||C.startsWith(",")||C.startsWith("[")){if(C.startsWith("::before")||C.startsWith("::after")){if(L($)){if(!$.some((S)=>("content"in S)))$.push({content:""})}}this.set(n+C,$,Q)}else if(C.startsWith(" ")){let S=C.match(/^.*?\w/gm)?.[0].slice(0,-1),G=C.replaceAll(/, /gm,`, ${n}${S}`);this.set(n+G,$,Q)}else if($n(C))this.set(n+C,$,Q);else f.set(C,this.props(n,C,z($)))}set(n,C,$){if(!d(C)&&!h(C))return;let f=new H;if(C instanceof j)this.saveAnim(n,C),f.ass(C.var,this.props(n,C.var,z(C.value)));else if(C instanceof s)U(C._value).forEach(([E,S])=>{if(X(S))f.set(E,this.props(n,E,z(S)))});else if(C instanceof e)CC(C),f.init("supports",[]).push(C);else if(L(C))C.forEach((E)=>{this.set(n,E,$)});else if(h(C)){let E=nC(C);this.set(n,E,$)}else U(C).forEach(([E,S])=>{return this.process(n,E,S,f,$)});let Q=$.init(n,new H);f.forEach((E,S)=>{if(S==="supports")$.init(n,new H).init(S,[])?.push(...E);else Q.set(S,E)})}}class r{PRE;EXPORT;UNIT;PS;PREFIX;ARR=new H;CID=new H;DATA=new H;ANIM=new H;IMPORTED=[];constructor(n="",C="",$,f){this.PRE=n;this.EXPORT=$;this.UNIT=f;this.PREFIX=C?C+"_":C,this.PS=new Sn(this)}get(n,C,$){let f=n.PRE+C;if(n.DATA.has(f))return f;else if(C in n)return n[C];else return n.PRE+C}set(n,C,$){return!1}get css(){return new Proxy(this,this)}load(n){return this.IMPORTED.push(n),this}}class P extends r{set(n,C,$){let f=n.PRE+C;return n.PS.set(f,$,n.DATA),!0}}class m extends r{webkit;constructor(n="",C=!0,$){super("",n,!1,$);this.webkit=C}set(n,C,$){let f=n.PREFIX+C,Q=L($)?$:[$],E=new H;if(Q.forEach((S)=>{U(S).forEach(([G,g])=>{let Z=_(G)?`${G}%`:G;n.PS.set(Z,g,E)})}),n.ANIM.init(f,new Set),n.DATA.set(`@keyframes ${f}`,E),this.webkit)n.DATA.set(`@-webkit-keyframes ${f}`,E);return!0}}class l extends r{constructor(n=""){super("@",n)}set(n,C,$){return n.ARR.init(n.PRE+C,new Set).add($),n}}class k extends r{constructor(n=""){super("@font-face",n);this.ARR.set(this.PRE,new Set)}set(n,C,$){let f=U({fontFamily:C,...$}).map(([Q,E])=>{return o(Q,E,this.UNIT)});return n.ARR.get(n.PRE)?.add(f.join(`
|
|
3
|
+
`)),!0}}var jn=Array.from;class gn{shweet;shaker;include;CID=new H;css="";constructor(n,C=[],$=[]){this.shweet=n;this.shaker=C;this.include=$}load(n,C="rem"){let $=D.default,f=D.prop;Y(f,D.extra);let Q=new H,E={},S={},G={},g=new Set,Z={},R={};I(f).forEach((q)=>{Z[q]={}});for(let q of V(this.shweet))if(q instanceof P){if(!q.DATA.size)continue;this.ClassID(q,E,S,n),q.ANIM.forEach((N,W)=>{N.forEach((F)=>{Q.init(W,new Set).add(F)})})}else if(q instanceof m)this.KF(q,G,Q);else if(q instanceof l)this.AT(q,g);else if(q instanceof k)this.FONT(q,g);return U(E).forEach(([q,N])=>{if(!Z[q])Z[q]={};U(N).forEach(([W,F])=>{let O=F.join(", ");if(!Z[q][O])Z[q][O]=[];Z[q][O].push(W)})}),U(S).forEach(([q,N])=>{U(N).forEach(([W,F])=>{if(!R[W])R[W]={};U(F).forEach(([O,B])=>{let K=`@supports(${q})`;if(!R[W][K])R[W][K]={};let M=B.join(", ");if(!R[W][K][M])R[W][K][M]=new Set;R[W][K][M].add(O)})})}),U(Z).forEach(([q,N])=>{let W=[],F=[];if(U(N).forEach(([O,B])=>{if(B.some((M)=>{return M.startsWith("animation")||M.startsWith("transition")}))F.push(u(O,B));else W.push(u(O,B))}),F.length)W.unshift(...F);if(G[q])U(G[q]).forEach(([O,B])=>{W.push(u(O,B))});if(R[q])U(R[q]).forEach(([O,B])=>{let K=U(B).map(([M,w])=>{return u(M,[...w])});W.push(u(O,K))});if(W.length)if(g.add(`/* -------------- ${q+(q===$?" ( default )":"")} */`),q===$)g.add(W.join(`
|
|
4
|
+
`));else{let O=q.split("-").map((B)=>f[B]).join(" and ");g.add(`@media ${O} {
|
|
5
5
|
${W.join(`
|
|
6
6
|
`)}
|
|
7
|
-
}`)}}),this.css=[...
|
|
8
|
-
`),this}ClassID(n,C,$,
|
|
9
|
-
${
|
|
10
|
-
}`)}),n.IMPORTED.forEach((
|
|
7
|
+
}`)}}),this.css=[...g].join(`
|
|
8
|
+
`),this}ClassID(n,C,$,f){let Q=(E,S,G,g,Z)=>{U(S).forEach(([R,q])=>{this.push(Z,G,R,g,o(E,q,n.UNIT))})};n.DATA.forEach((E,S)=>{let G=fC(S,n.PREFIX),g=this.getCID(S,n.PREFIX,f);E.forEach((Z,R)=>{if(R==="supports"){if(L(Z))Z.forEach((q)=>{q.value.forEach((N,W)=>{if(!(W in $))$[W]={};N.forEach((F)=>{U(F).forEach(([O,B])=>{Q(O,B,G,g,$[W])})})})})}else Q(R,Z,G,g,C)})}),n.IMPORTED.forEach((E)=>{this.ClassID(E,C,$,E.EXPORT)})}KF(n,C,$){let f=(Q,E,S)=>{Kn(C,Q,E),C[Q][E].push(S)};n.DATA.forEach((Q,E)=>{Q.forEach((S,G)=>{let g={};S.forEach((Z,R)=>{if(R==="supports")c.e=["@supports not supported in @keyframes",{error:"support in keyframes"}];else U(Z).forEach(([q,N])=>{if(this.shaker.length){let W=E.split(" ")[1];if($.has(W)){if([...$.get(W)].some((B)=>{return this.getCID(B,"",!1,!1)})){if(!(q in g))g[q]=[];g[q].push(o(R,N,n.UNIT))}}}else{if(!(q in g))g[q]=[];g[q].push(o(R,N,n.UNIT))}})}),U(g).forEach(([Z,R])=>{f(Z,E,u(G,R))})})}),n.IMPORTED.forEach((Q)=>{this.KF(Q,C,$)})}AT(n,C){for(let[$,f]of n.ARR)f.forEach((Q)=>{let E=Q.includes("(")?Q:`"${Q}"`;C.add(`${$} ${E.trim()};`)});n.IMPORTED.forEach(($)=>{this.AT($,C)})}FONT(n,C){(n.ARR.get("@font-face")??new Set).forEach((Q)=>{C.add(`@font-face {
|
|
9
|
+
${Q}
|
|
10
|
+
}`)}),n.IMPORTED.forEach((Q)=>{this.FONT(Q,C)})}getCID(n,C,$,f=!0){let Q=/\.(?![0-9])([a-zA-Z0-9_-]+)(?![^{]*})/g,E=/#(?![0-9])([a-zA-Z0-9_-]+)(?![^{]*})/g,S=/\b([a-zA-Z][a-zA-Z0-9]*)\b(?![^{}]*})/g,G=[...new Set(Un(n,Q)),...new Set(Un(n,E))];if(f&&X($)&&$)G.forEach((g)=>{this.CID.init(g.replaceAll("-","_"),new Set).add(C+g)});return G.push(...new Set(Un(n,S))),G.some((g)=>this.shaker.includes(g)||this.include.includes(g))}push(n,C,$,f,Q){if(!(this.shaker.length&&C.startsWith(".")||this.shaker.length&&C.startsWith("#"))||f)Kn(n,$,Q),$C(n,$,Q,C)}}var u=(n,C)=>{return`${n} {
|
|
11
11
|
${C.join(`
|
|
12
12
|
`)}
|
|
13
|
-
}`},Gn=(n,C)=>{return Yn(n.matchAll(C),($)=>$[1])},jn=(n,C,$)=>{try{if(!n[C])n[C]={},n[C][$]=[];if(!n[C][$])n[C][$]=[]}catch(T){c.e=[`property "${C}" not found!`,{error:"@ensurePropsInitialized"}]}},nC=(n,C,$,T)=>{if(!n[C])n[C]={[$]:T.split(",").map((J)=>J.trim())};else n[C][$].push(...T.split(",").map((J)=>J.trim()))},CC=(n,C)=>{if(C)return n.replaceAll(/\.|\#/g,($)=>$+C);return n};import{mkdirSync as $C,writeFileSync as TC,existsSync as Kn}from"node:fs";var nn=(n,C="")=>{if(Kn(n))return!0;return TC(n,C,{flag:"wx"}),!0},Cn=(n)=>{if(Kn(n))return!0;return $C(n,{recursive:!0}),!0};import{writeFileSync as hn}from"node:fs";function f(n){return function(...C){return{[n]:C}}}class Mn{static attr(n){let[C,$]=G(n)[0];return f(`[${C}="${$}"]`)}static after(n=""){return f("::after"+n)}static before(n=""){return f("::before"+n)}static backdrop(n=""){return f("::backdrop"+n)}static cue(n=""){return f("::cue"+n)}static cueRegion(n=""){return f("::cue-region"+n)}static firstLetter(n=""){return f("::first-letter"+n)}static firstLine(n=""){return f("::first-line"+n)}static marker(n=""){return f("::marker"+n)}static part(n=""){return f("::part"+n)}static placeholder(n=""){return f("::placeholder"+n)}static selection(n=""){return f("::selection"+n)}static slotted(n=""){return f("::slotted"+n)}static spellingError(n=""){return f("::spelling-error"+n)}static targetText(n=""){return f("::target-text"+n)}static viewTransition(n=""){return f("::view-transition"+n)}static viewTransitionGroup(n=""){return f("::view-transition-group"+n)}static viewTransitionImagePair(n=""){return f("::view-transition-image-pair"+n)}static viewTransitionNew(n=""){return f("::view-transition-new"+n)}static viewTransitionOld(n=""){return f("::view-transition-old"+n)}static scrollbar(n=""){return f("::-webkit-scrollbar"+n)}static scrollbarThumb(n=""){return f("::-webkit-scrollbar-thumb"+n)}static scrollbarTrack(n=""){return f("::-webkit-scrollbar-track"+n)}static scrollbarCorner(n=""){return f("::-webkit-scrollbar-corner"+n)}static active(n=""){return f(":active"+n)}static anyLink(n=""){return f(":any-link"+n)}static autofill(n=""){return f(":autofill"+n)}static blank(n=""){return f(":blank"+n)}static checked(n=""){return f(":checked"+n)}static current(n=""){return f(":current"+n)}static default(n=""){return f(":default"+n)}static defined(n=""){return f(":defined"+n)}static disabled(n=""){return f(":disabled"+n)}static empty(n=""){return f(":empty"+n)}static enabled(n=""){return f(":enabled"+n)}static first(n=""){return f(":first"+n)}static firstChild(n=""){return f(":first-child"+n)}static firstOfType(n=""){return f(":first-of-type"+n)}static fullscreen(n=""){return f(":fullscreen"+n)}static future(n=""){return f(":future"+n)}static focus(n=""){return f(":focus"+n)}static focusVisible(n=""){return f(":focus-visible"+n)}static focusWithin(n=""){return f(":focus-within"+n)}static host(n=""){return f(":host"+n)}static hover(n=""){return f(":hover"+n)}static indeterminate(n=""){return f(":indeterminate"+n)}static inRange(n=""){return f(":in-range"+n)}static invalid(n=""){return f(":invalid"+n)}static lastChild(n=""){return f(":last-child"+n)}static lastOfType(n=""){return f(":last-of-type"+n)}static left(n=""){return f(":left"+n)}static link(n=""){return f(":link"+n)}static localLink(n=""){return f(":local-link"+n)}static modal(n=""){return f(":modal"+n)}static onlyChild(n=""){return f(":only-child"+n)}static onlyOfType(n=""){return f(":only-of-type"+n)}static optional(n=""){return f(":optional"+n)}static outOfRange(n=""){return f(":out-of-range"+n)}static past(n=""){return f(":past"+n)}static pictureInPicture(n=""){return f(":picture-in-picture"+n)}static placeholderShown(n=""){return f(":placeholder-shown"+n)}static paused(n=""){return f(":paused"+n)}static playing(n=""){return f(":playing"+n)}static readOnly(n=""){return f(":read-only"+n)}static readWrite(n=""){return f(":read-write"+n)}static required(n=""){return f(":required"+n)}static right(n=""){return f(":right"+n)}static root(n=""){return f(":root"+n)}static scope(n=""){return f(":scope"+n)}static target(n=""){return f(":target"+n)}static targetWithin(n=""){return f(":target-within"+n)}static userInvalid(n=""){return f(":user-invalid"+n)}static valid(n=""){return f(":valid"+n)}static visited(n=""){return f(":visited"+n)}static dir(n){return f(`:dir(${n})`)}static has(n){return f(`:has(${n})`)}static host_(n){return f(`:host(${n})`)}static hostContext(n){return f(`:host-context(${n})`)}static is(n){return f(`:is(${n})`)}static lang(n){return f(`:lang(${n})`)}static not(n){return f(`:not(${n})`)}static nthChild(n){return f(`:nth-child(${n})`)}static nthCol(n){return f(`:nth-col(${n})`)}static nthLastChild(n){return f(`:nth-last-child(${n})`)}static nthLastCol(n){return f(`:nth-last-col(${n})`)}static nthLastOfType(n){return f(`:nth-last-of-type(${n})`)}static nthOfType(n){return f(`:nth-of-type(${n})`)}static state(n){return f(`:state(${n})`)}static where(n){return f(`:where(${n})`)}static and(n){return f(", "+n)}static child(n){return f(" > "+n)}static desc(n){return f(" "+n)}static next(n){return f(" + "+n)}static general(n){return f(" ~ "+n)}static withClass(n){if(!n.startsWith("."))throw Error("should start with . or # - class / id");return f(n)}}class In{static minmax(n,C){return`minmax(${Q([n,C],{rem:!0,delimeter:", "})})`}static fitContent(n){return`fit-content(${Q([n],{rem:!0})})`}static repeat(n,...C){return`repeat(${Q([n,Q([C],{rem:!0})],{delimeter:", "})})`}}class wn extends In{static attr(n,C,$){return`attr(${Q([n,C,$])})`}static blur(n){return`blur(${Q([n],{rem:!0})})`}static brightness(n){return`brightness(${Q([n])})`}static calc(...n){return`calc(${Q(n,{rem:!0})})`}static circle(n,C){return`circle(${Q([n,C],{rem:!0})})`}static clamp(n,C,$){return`clamp(${Q([n,C,$],{rem:!0,delimeter:", "})})`}static colorMix(n,C,$){return`color-mix(${Q([n,Q(Z(C)?C:[C]),Q(Z($)?$:[$])],{delimeter:", "})})`}static conicGradient(...n){return`conic-gradient(${Q(n,{delimeter:", "})})`}static contrast(n){return`contrast(${Q([n])})`}static cubicBezier(n,C,$,T){return`cubic-bezier(${Q([n,C,$,T],{delimeter:", "})})`}static dropShadow(...n){return`drop-shadow(${Q(n,{rem:!0})})`}static grayscale(n){return`grayscale(${Q([n])})`}static hsl(n,C,$){return`hsl(${Q([n,C,$])})`}static hsla(n,C,$,T){return`hsl(${Q([n,C,$,T?["/",T]:T])})`}static hueRotate(n){return`hue-rotate(${Q([n],{degree:!0})})`}static inset(...n){return`inset(${Q(n,{rem:!0})})`}static invert(n){return`invert(${Q([n])})`}static linearGradient(...n){return`linear-gradient(${Q(n,{delimeter:", "})})`}static matrix(n,C,$,T,J,E){return`matrix(${Q([n,C,$,T,J,E],{delimeter:", "})})`}static matrix3d(n,C,$,T){return`matrix3d(${Q([n,C,$,T],{delimeter:", "})})`}static max(...n){return`max(${Q(n,{rem:!0,delimeter:", "})})`}static min(...n){return`min(${Q(n,{rem:!0,delimeter:", "})})`}static opacity(n){return`opacity(${Q([n])})`}static path(n){return`path(${Q([n],{quote:!0})})`}static clipPath(n,C){return`path(${Q([n,Q([C],{quote:!0})],{delimeter:", "})})`}static perspective(n){return`perspective(${Q([n])})`}static polygon(...n){return`polygon(${Q(n,{percent:!0,delimeter:", "})})`}static ray(...n){return`ray(${Q(n,{degree:!0})})`}static radialGradient(...n){return`radial-gradient(${Q(n,{delimeter_arr:", ",percent:!0,delimeter:", "})})`}static repeatingConicGradient(...n){return`repeating-conic-gradient(${Q(n,{degree:!0,delimeter:", "})})`}static repeatingLinearGradient(...n){return`repeating-linear-gradient(${Q(n,{degree:!0,delimeter:", "})})`}static repeatingRadialGradient(...n){return`repeating-radial-gradient(${Q(n,{degree:!0,delimeter:", "})})`}static rgb(n,C,$){return`rgb(${Q([n,C,$])})`}static rgba(n,C,$,T){return`rgba(${Q([n,C,$,T?["/",T]:void 0],{delimeter_arr:" "})})`}static rotate(n){return`rotate(${Q([n],{degree:!0})})`}static rotate3d(n,C,$,T){return`rotate3d(${Q([Q([n,C,$],{delimeter:", "}),T],{degree:!0,delimeter:", "})})`}static rotateX(n){return`rotateX(${Q([n],{degree:!0})})`}static rotateY(n){return`rotateY(${Q([n],{degree:!0})})`}static rotateZ(n){return`rotateZ(${Q([n],{degree:!0})})`}static saturate(...n){return`saturate(${Q(n)})`}static scale(n,C){return`scale(${Q([n,C],{delimeter:", "})})`}static scale3d(n,C,$){return`scale3d(${Q([n,C,$],{delimeter:", "})})`}static scaleX(n){return`scaleX(${Q([n])})`}static scaleY(n){return`scaleY(${Q([n])})`}static scaleZ(n){return`scaleZ(${Q([n])})`}static sepia(n){return`sepia(${Q([n])})`}static skew(...n){return`skew(${Q(n,{degree:!0,delimeter:", "})})`}static skewX(n){return`skewX(${Q([n],{degree:!0})})`}static skewY(n){return`skewY(${Q([n],{degree:!0})})`}static steps(n,C){return`steps(${Q([n,C],{delimeter:", "})})`}static translate(...n){return`translate(${Q(n,{rem:!0,delimeter:", "})})`}static translate3d(...n){return`translate3d(${Q(n,{rem:!0,delimeter:", "})})`}static translateX(n){return`translateX(${Q([n],{rem:!0})})`}static translateY(n){return`translateY(${Q([n],{rem:!0})})`}static translateZ(...n){return`translateZ(${Q(n,{rem:!0,delimeter:", "})})`}static url(n){return`url(${Q([n],{quote:!0})})`}static var(n,C=""){n="--"+A(n);let $=C?", "+Q([C],{rem:!0,delimeter:", "}):"";return`var(${Q([n],{rem:!0})}${$})`}}var fC={important:" !important",visible:"visible",hidden:"hidden",auto:"auto",none:"none",clip:"clip",scroll:"scroll",initial:"initial",inherit:"inherit",flex:"flex",center:"center",flex_start:"flex-start",flex_end:"flex-end",space_evenly:"space-evenly",stretch:"stretch",wrap:"wrap",column:"column",column_reverse:"column-reverse",row:"row",row_reverse:"row-reverse",space_between:"space-between",space_around:"space-around",pr100:"100%",pr50:"50%",i100vh:"100vh",i100vw:"100vw",block:"block",sticky:"sticky",fixed:"fixed",absolute:"absolute",relative:"relative",pointer:"pointer",grabbing:"grabbing",checkbox:"checkbox",solid:"solid",inset:"inset",bold:"bold",currentColor:"currentColor",forwards:"forwards",text:"text",norepeat:"no-repeat",nowrap:"nowrap",difference:"difference",preserve3d:"preserve-3d"};class JC{path;name;prefix;exportMap;_imported=new Set;save;constructor({__filename:n,name:C,prefix:$,Shweet:T=[],exportMap:J,webkitKeyframes:E,unit:q="rem"}){this.path=n,this.name=C||qC(n),this.prefix=$??"",this.exportMap=J;let U=Z(T)?T:[T];SC.call(this,this.prefix,U,E,J,q);let R=this;Object.assign(this,{get shweet(){return R}}),this.save=({dir:L,mapDir:g,mapName:S="index",minify:b=!0,shaker:W=[],include:F=[]})=>{let O=B(J)?J:!!g,D=new Rn(this,W,F).load(O),M=Z(L)?L:[L],I=b?QC(D.css):D.css;if(M.forEach((w)=>{if(!w)return;let y=w.endsWith("/")?"":"/",Un=w+y+this.name+".css";Cn(w+y),nn(Un),hn(Un,I||"/* --------------*/")}),g){let w=g.endsWith("/")?"":"/",y=g+w+S+".js";Cn(g+w),nn(y),EC(y,D.CID)}return this}}get imported(){return[...this._imported]}}var QC=(n)=>{return n.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s*([{}:;,])\s*/g,"$1").replace(/\s*([>~+])\s*/g,"$1").trim()},EC=(n,C)=>{let $={};C.forEach((J)=>{G(J).forEach(([E,q])=>{if(!$[E])$[E]=[q];else $[E].push(q)})});let T=[...C.entries()].map(([J,E])=>{return`${J}="${[...E].join(" ")}"`}).sort((J,E)=>J.localeCompare(E,void 0,{numeric:!0}));hn(n,T.length?`export const ${T.join()};`:"export {}");return};function SC(n,C,$=!1,T,J){let E={d:new V("",n,T,J),i:new V("#",n,T,J),c:new V(".",n,T,J),kf:new k(n,$,J),at:new m,font:new l};C.forEach((q)=>{this._imported.add(q.path),q._imported.forEach((U)=>{this._imported.add(U)}),h(E).forEach((U)=>{E[U].load(q[U])})}),h(E).forEach((q)=>{E[q]=E[q].css}),X(this,E)}function qC(n){return n.split("/").slice(-1)[0].split(".")[0]}export{fC as v,sn as supports,Mn as ps,N as media,j as med,c as log,qC as fileName,wn as f,bn as __,vn as Var,Q as Value,JC as Shweet,s as Medyas};
|
|
13
|
+
}`},Un=(n,C)=>{return jn(n.matchAll(C),($)=>$[1])},Kn=(n,C,$)=>{try{if(!n[C])n[C]={},n[C][$]=[];if(!n[C][$])n[C][$]=[]}catch(f){c.e=[`property "${C}" not found!`,{error:"@ensurePropsInitialized"}]}},$C=(n,C,$,f)=>{if(!n[C])n[C]={[$]:f.split(",").map((Q)=>Q.trim())};else n[C][$].push(...f.split(",").map((Q)=>Q.trim()))},fC=(n,C)=>{if(C)return n.replaceAll(/\.|\#/g,($)=>$+C);return n};import{mkdirSync as JC,writeFileSync as QC,existsSync as Mn}from"fs";var nn=(n,C="")=>{if(Mn(n))return!0;return QC(n,C,{flag:"wx"}),!0},Cn=(n)=>{if(Mn(n))return!0;return JC(n,{recursive:!0}),!0};import{writeFileSync as An}from"fs";function J(n){return function(...C){return{[n]:C}}}class hn{static attr(n){let[C,$]=U(n)[0];return J(`[${C}="${$}"]`)}static after(n=""){return J("::after"+n)}static before(n=""){return J("::before"+n)}static backdrop(n=""){return J("::backdrop"+n)}static cue(n=""){return J("::cue"+n)}static cueRegion(n=""){return J("::cue-region"+n)}static firstLetter(n=""){return J("::first-letter"+n)}static firstLine(n=""){return J("::first-line"+n)}static marker(n=""){return J("::marker"+n)}static part(n=""){return J("::part"+n)}static placeholder(n=""){return J("::placeholder"+n)}static selection(n=""){return J("::selection"+n)}static slotted(n=""){return J("::slotted"+n)}static spellingError(n=""){return J("::spelling-error"+n)}static targetText(n=""){return J("::target-text"+n)}static viewTransition(n=""){return J("::view-transition"+n)}static viewTransitionGroup(n=""){return J("::view-transition-group"+n)}static viewTransitionImagePair(n=""){return J("::view-transition-image-pair"+n)}static viewTransitionNew(n=""){return J("::view-transition-new"+n)}static viewTransitionOld(n=""){return J("::view-transition-old"+n)}static scrollbar(n=""){return J("::-webkit-scrollbar"+n)}static scrollbarThumb(n=""){return J("::-webkit-scrollbar-thumb"+n)}static scrollbarTrack(n=""){return J("::-webkit-scrollbar-track"+n)}static scrollbarCorner(n=""){return J("::-webkit-scrollbar-corner"+n)}static active(n=""){return J(":active"+n)}static anyLink(n=""){return J(":any-link"+n)}static autofill(n=""){return J(":autofill"+n)}static blank(n=""){return J(":blank"+n)}static checked(n=""){return J(":checked"+n)}static current(n=""){return J(":current"+n)}static default(n=""){return J(":default"+n)}static defined(n=""){return J(":defined"+n)}static disabled(n=""){return J(":disabled"+n)}static empty(n=""){return J(":empty"+n)}static enabled(n=""){return J(":enabled"+n)}static first(n=""){return J(":first"+n)}static firstChild(n=""){return J(":first-child"+n)}static firstOfType(n=""){return J(":first-of-type"+n)}static fullscreen(n=""){return J(":fullscreen"+n)}static future(n=""){return J(":future"+n)}static focus(n=""){return J(":focus"+n)}static focusVisible(n=""){return J(":focus-visible"+n)}static focusWithin(n=""){return J(":focus-within"+n)}static host(n=""){return J(":host"+n)}static hover(n=""){return J(":hover"+n)}static indeterminate(n=""){return J(":indeterminate"+n)}static inRange(n=""){return J(":in-range"+n)}static invalid(n=""){return J(":invalid"+n)}static lastChild(n=""){return J(":last-child"+n)}static lastOfType(n=""){return J(":last-of-type"+n)}static left(n=""){return J(":left"+n)}static link(n=""){return J(":link"+n)}static localLink(n=""){return J(":local-link"+n)}static modal(n=""){return J(":modal"+n)}static onlyChild(n=""){return J(":only-child"+n)}static onlyOfType(n=""){return J(":only-of-type"+n)}static optional(n=""){return J(":optional"+n)}static outOfRange(n=""){return J(":out-of-range"+n)}static past(n=""){return J(":past"+n)}static pictureInPicture(n=""){return J(":picture-in-picture"+n)}static placeholderShown(n=""){return J(":placeholder-shown"+n)}static paused(n=""){return J(":paused"+n)}static playing(n=""){return J(":playing"+n)}static readOnly(n=""){return J(":read-only"+n)}static readWrite(n=""){return J(":read-write"+n)}static required(n=""){return J(":required"+n)}static right(n=""){return J(":right"+n)}static root(n=""){return J(":root"+n)}static scope(n=""){return J(":scope"+n)}static target(n=""){return J(":target"+n)}static targetWithin(n=""){return J(":target-within"+n)}static userInvalid(n=""){return J(":user-invalid"+n)}static valid(n=""){return J(":valid"+n)}static visited(n=""){return J(":visited"+n)}static dir(n){return J(`:dir(${n})`)}static has(n){return J(`:has(${n})`)}static host_(n){return J(`:host(${n})`)}static hostContext(n){return J(`:host-context(${n})`)}static is(n){return J(`:is(${n})`)}static lang(n){return J(`:lang(${n})`)}static not(n){return J(`:not(${n})`)}static nthChild(n){return J(`:nth-child(${n})`)}static nthCol(n){return J(`:nth-col(${n})`)}static nthLastChild(n){return J(`:nth-last-child(${n})`)}static nthLastCol(n){return J(`:nth-last-col(${n})`)}static nthLastOfType(n){return J(`:nth-last-of-type(${n})`)}static nthOfType(n){return J(`:nth-of-type(${n})`)}static state(n){return J(`:state(${n})`)}static where(n){return J(`:where(${n})`)}static and(n){return J(", "+n)}static child(n){return J(" > "+n)}static desc(n){return J(" "+n)}static next(n){return J(" + "+n)}static general(n){return J(" ~ "+n)}static withClass(n){if(!n.startsWith("."))throw Error("should start with . or # - class / id");return J(n)}}class wn{static minmax(n,C){return`minmax(${T([n,C],{rem:!0,delimeter:", "})})`}static fitContent(n){return`fit-content(${T([n],{rem:!0})})`}static repeat(n,...C){return`repeat(${T([n,T([C],{rem:!0})],{delimeter:", "})})`}}class In extends wn{static attr(n,C,$){return`attr(${T([n,C,$])})`}static blur(n){return`blur(${T([n],{rem:!0})})`}static brightness(n){return`brightness(${T([n])})`}static calc(...n){return`calc(${T(n,{rem:!0})})`}static circle(n,C){return`circle(${T([n,C],{rem:!0})})`}static clamp(n,C,$){return`clamp(${T([n,C,$],{rem:!0,delimeter:", "})})`}static colorMix(n,C,$){return`color-mix(${T([n,T(L(C)?C:[C]),T(L($)?$:[$])],{delimeter:", "})})`}static conicGradient(...n){return`conic-gradient(${T(n,{delimeter:", "})})`}static contrast(n){return`contrast(${T([n])})`}static cubicBezier(n,C,$,f){return`cubic-bezier(${T([n,C,$,f],{delimeter:", "})})`}static dropShadow(...n){return`drop-shadow(${T(n,{rem:!0})})`}static grayscale(n){return`grayscale(${T([n])})`}static hsl(n,C,$){return`hsl(${T([n,C,$])})`}static hsla(n,C,$,f){return`hsl(${T([n,C,$,f?["/",f]:f])})`}static hueRotate(n){return`hue-rotate(${T([n],{degree:!0})})`}static inset(...n){return`inset(${T(n,{rem:!0})})`}static invert(n){return`invert(${T([n])})`}static linearGradient(...n){return`linear-gradient(${T(n,{delimeter:", "})})`}static matrix(n,C,$,f,Q,E){return`matrix(${T([n,C,$,f,Q,E],{delimeter:", "})})`}static matrix3d(n,C,$,f){return`matrix3d(${T([n,C,$,f],{delimeter:", "})})`}static max(...n){return`max(${T(n,{rem:!0,delimeter:", "})})`}static min(...n){return`min(${T(n,{rem:!0,delimeter:", "})})`}static opacity(n){return`opacity(${T([n])})`}static path(n){return`path(${T([n],{quote:!0})})`}static clipPath(n,C){return`path(${T([n,T([C],{quote:!0})],{delimeter:", "})})`}static perspective(n){return`perspective(${T([n])})`}static polygon(...n){return`polygon(${T(n,{percent:!0,delimeter:", "})})`}static ray(...n){return`ray(${T(n,{degree:!0})})`}static radialGradient(...n){return`radial-gradient(${T(n,{delimeter_arr:", ",percent:!0,delimeter:", "})})`}static repeatingConicGradient(...n){return`repeating-conic-gradient(${T(n,{degree:!0,delimeter:", "})})`}static repeatingLinearGradient(...n){return`repeating-linear-gradient(${T(n,{degree:!0,delimeter:", "})})`}static repeatingRadialGradient(...n){return`repeating-radial-gradient(${T(n,{degree:!0,delimeter:", "})})`}static rgb(n,C,$){return`rgb(${T([n,C,$])})`}static rgba(n,C,$,f){return`rgba(${T([n,C,$,f?["/",f]:void 0],{delimeter_arr:" "})})`}static rotate(n){return`rotate(${T([n],{degree:!0})})`}static rotate3d(n,C,$,f){return`rotate3d(${T([T([n,C,$],{delimeter:", "}),f],{degree:!0,delimeter:", "})})`}static rotateX(n){return`rotateX(${T([n],{degree:!0})})`}static rotateY(n){return`rotateY(${T([n],{degree:!0})})`}static rotateZ(n){return`rotateZ(${T([n],{degree:!0})})`}static saturate(...n){return`saturate(${T(n)})`}static scale(n,C){return`scale(${T([n,C],{delimeter:", "})})`}static scale3d(n,C,$){return`scale3d(${T([n,C,$],{delimeter:", "})})`}static scaleX(n){return`scaleX(${T([n])})`}static scaleY(n){return`scaleY(${T([n])})`}static scaleZ(n){return`scaleZ(${T([n])})`}static sepia(n){return`sepia(${T([n])})`}static skew(...n){return`skew(${T(n,{degree:!0,delimeter:", "})})`}static skewX(n){return`skewX(${T([n],{degree:!0})})`}static skewY(n){return`skewY(${T([n],{degree:!0})})`}static steps(n,C){return`steps(${T([n,C],{delimeter:", "})})`}static translate(...n){return`translate(${T(n,{rem:!0,delimeter:", "})})`}static translate3d(...n){return`translate3d(${T(n,{rem:!0,delimeter:", "})})`}static translateX(n){return`translateX(${T([n],{rem:!0})})`}static translateY(n){return`translateY(${T([n],{rem:!0})})`}static translateZ(...n){return`translateZ(${T(n,{rem:!0,delimeter:", "})})`}static url(n){return`url(${T([n],{quote:!0})})`}static var(n,C=""){n="--"+A(n);let $=C?", "+T([C],{rem:!0,delimeter:", "}):"";return`var(${T([n],{rem:!0})}${$})`}}var EC={important:" !important",visible:"visible",hidden:"hidden",auto:"auto",none:"none",clip:"clip",scroll:"scroll",initial:"initial",inherit:"inherit",flex:"flex",center:"center",flex_start:"flex-start",flex_end:"flex-end",space_evenly:"space-evenly",stretch:"stretch",wrap:"wrap",column:"column",column_reverse:"column-reverse",row:"row",row_reverse:"row-reverse",space_between:"space-between",space_around:"space-around",pr100:"100%",pr50:"50%",i100vh:"100vh",i100vw:"100vw",block:"block",sticky:"sticky",fixed:"fixed",absolute:"absolute",relative:"relative",pointer:"pointer",grabbing:"grabbing",checkbox:"checkbox",solid:"solid",inset:"inset",bold:"bold",currentColor:"currentColor",forwards:"forwards",text:"text",norepeat:"no-repeat",nowrap:"nowrap",difference:"difference",preserve3d:"preserve-3d"};class TC{path;name;prefix;exportMap;_imported=new Set;save;constructor({__filename:n,name:C,prefix:$,Shweet:f=[],exportMap:Q,webkitKeyframes:E,unit:S="rem"}){this.path=n,this.name=C||gC(n),this.prefix=$??"",this.exportMap=Q;let G=L(f)?f:[f];UC.call(this,this.prefix,G,E,Q,S);let g=this;Object.assign(this,{get shweet(){return g}}),this.save=({dir:Z,mapDir:R,mapName:q="index",minify:N=!0,shaker:W=[],include:F=[]})=>{let O=X(Q)?Q:!!R,B=new gn(this,W,F).load(O),K=L(Z)?Z:[Z],M=N?qC(B.css):B.css;if(K.forEach((w)=>{if(!w)return;let y=w.endsWith("/")?"":"/",Gn=w+y+this.name+".css";Cn(w+y),nn(Gn),An(Gn,M||"/* --------------*/")}),R){let w=R.endsWith("/")?"":"/",y=R+w+q+".js";Cn(R+w),nn(y),SC(y,B.CID)}return this}}get imported(){return[...this._imported]}}var qC=(n)=>{return n.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s*([{}:;,])\s*/g,"$1").replace(/\s*([>~+])\s*/g,"$1").trim()},SC=(n,C)=>{let $={};C.forEach((Q)=>{U(Q).forEach(([E,S])=>{if(!$[E])$[E]=[S];else $[E].push(S)})});let f=[...C.entries()].map(([Q,E])=>{return`${Q}="${[...E].join(" ")}"`}).sort((Q,E)=>Q.localeCompare(E,void 0,{numeric:!0}));An(n,f.length?`export const ${f.join()};`:"export {}");return};function UC(n,C,$=!1,f,Q){let E={d:new P("",n,f,Q),i:new P("#",n,f,Q),c:new P(".",n,f,Q),kf:new m(n,$,Q),at:new l,font:new k};C.forEach((S)=>{this._imported.add(S.path),S._imported.forEach((G)=>{this._imported.add(G)}),I(E).forEach((G)=>{E[G].load(S[G])})}),I(E).forEach((S)=>{E[S]=E[S].css}),Y(this,E)}function gC(n){return n.split("/").slice(-1)[0].split(".")[0]}export{EC as v,en as supports,hn as ps,D as media,t as med,c as log,gC as fileName,In as f,Fn as __,xn as Var,T as Value,TC as Shweet,s as Medyas};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shweet",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "CSS in TS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "latest",
|
|
35
35
|
"@types/bun": "latest",
|
|
36
|
-
"rollup-plugin-dts": "^6.
|
|
36
|
+
"rollup-plugin-dts": "^6.2.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"typescript": "^5.8.2"
|