@estjs/shared 0.0.15-beta.13 → 0.0.15-beta.17

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.
@@ -1,3 +1,401 @@
1
- 'use strict';var d=e=>e!==null&&typeof e=="object";function A(e){return c.call(e)==="[object Promise]"}var p=Array.isArray;function i(e){return typeof e=="string"}function f(e){return typeof e=="number"}function y(e){return e===null}function E(e){return typeof e=="symbol"}function M(e){return c.call(e)==="[object Set]"}function N(e){return c.call(e)==="[object WeakMap]"}function C(e){return c.call(e)==="[object WeakSet]"}function L(e){return c.call(e)==="[object Map]"}function z(e){return e==null}var O=e=>typeof e=="function";function H(e){return e===false||e===null||e===void 0}var j=e=>["string","number","boolean","symbol","undefined"].includes(typeof e)||y(e);function R(e){return e instanceof HTMLElement}var P=e=>c.call(e)==="[object Object]";function _(e){return !i(e)||e===""?false:!Number.isNaN(Number(e))}function F(e){return typeof e=="undefined"}function B(e){return typeof e=="boolean"}function G(e){return Number.isNaN(e)}var c=Object.prototype.toString,U=Object.prototype.hasOwnProperty,$=Object.assign,h=(e,t)=>U.call(e,t);function q(e){return p(e)?e:[e]}var W=(e,t)=>!Object.is(e,t),D=Function.prototype;function I(e,t){return i(e)?e.indexOf(t)===0:false}function Y(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="",n=e.length;for(let o=0;o<8;o++)t+=e.charAt(Math.floor(Math.random()*n));return t}function X(){return typeof window!="undefined"&&typeof document!="undefined"}var m=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},K=Object.freeze({}),J=Object.freeze([]),V=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90,k,Z=()=>k||(k=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var Q=/\B([A-Z])/g,g=m(e=>e.replaceAll(Q,"-$1").toLowerCase()),ee=/[_-](\w)/g,te=m(e=>(e=e.replaceAll(/^[_-]+|[_-]+$/g,""),e=e.replaceAll(/[_-]+/g,"-"),e.replaceAll(ee,(t,n)=>n.toUpperCase()))),ne=m(e=>e.charAt(0).toUpperCase()+e.slice(1));function oe(e,...t){console.warn(`[Essor warn]: ${e}`,...t);}function re(e,...t){console.info(`[Essor info]: ${e}`,...t);}function b(e,...t){console.error(`[Essor error]: ${e}`,...t);}var ie=/["&'<>]/;function se(e){let t=`${e}`,n=ie.exec(t);if(!n)return t;let o="",r,a,u=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#39;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}u!==a&&(o+=t.slice(u,a)),u=a+1,o+=r;}return u!==a?o+t.slice(u,a):o}var ae=/^-?>|<!--|-->|--!>|<!-$/g;function le(e){return e.replaceAll(ae,"")}var ce=/[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;function pe(e,t){return e.replaceAll(ce,n=>t?n==='"'?'\\\\\\"':`\\\\${n}`:`\\${n}`)}function s(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return n=>n in t}var T="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ue=s(T),me=s(`${T},async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);function de(e){return !!e||e===""}var fe=/[\t\n\f "'/=>]/,x={};function ge(e){if(h(x,e))return x[e];let t=fe.test(e);return t&&__DEV__&&b(`unsafe attribute name: ${e}`),x[e]=!t}var he={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},be=s("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap"),xe=s("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan");function ye(e){if(e==null)return false;let t=typeof e;return t==="string"||t==="number"||t==="boolean"}var ke="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",Te="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,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,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",we="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",Se="beforeinput,click,dblclick,contextmenu,focusin,focusout,input,keydown,keyup,mousedown,mousemove,mouseout,mouseover,mouseup,pointerdown,pointermove,pointerout,pointerover,pointerup,touchend,touchmove,touchstart",ve="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Ae="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Ee=s(ke),Me=s(Te),Ne=s(we),Ce=s(ve),Le=s(Ae),ze=s(Se);function Oe(e){return typeof HTMLInputElement!="undefined"&&e instanceof HTMLInputElement}function He(e){return typeof HTMLSelectElement!="undefined"&&e instanceof HTMLSelectElement}function je(e){return typeof HTMLTextAreaElement!="undefined"&&e instanceof HTMLTextAreaElement}function Re(e){return typeof HTMLFormElement!="undefined"&&e instanceof HTMLFormElement}function Pe(e){return typeof Text!="undefined"&&e instanceof Text}function _e(e){return typeof Node!="undefined"&&e instanceof Node}var Fe=/;(?![^(]*\))/g,Be=/:([\s\S]+)/,Ge=/\/\*[\s\S]*?\*\//g;function w(e){let t={};return e.replaceAll(Ge,"").split(Fe).forEach(n=>{if(n){let o=n.split(Be);o.length>1&&(t[o[0].trim()]=o[1].trim());}}),t}function S(e){if(p(e)){let t={};for(let n of e){let o=i(n)?w(n):S(n);if(o)for(let r in o)t[r]=o[r];}return t}if(i(e)||d(e))return e}function Ue(e){if(!e)return "";if(i(e))return e;let t="";for(let n in e){let o=e[n];if(i(o)||f(o)){let r=n.startsWith("--")?n:g(n);t+=`${r}:${o};`;}}return t}function v(e){if(e==null)return "";if(i(e))return e.trim();if(p(e))return e.map(v).filter(Boolean).join(" ");if(d(e)){let t=0;for(let r in e)e[r]&&t++;if(t===0)return "";let n=new Array(t),o=0;for(let r in e)e[r]&&(n[o++]=r);return n.join(" ")}return String(e).trim()}function $e(e){if(!e)return "";if(i(e))return e;let t="";for(let n in e){let o=e[n];if(i(o)||f(o)){let r=n.startsWith("--")?n:g(n);t+=`${r}:${o};`;}}return t}
2
- exports.EMPTY_ARR=J;exports.EMPTY_OBJ=K;exports.cacheStringFunction=m;exports.camelCase=te;exports.capitalize=ne;exports.coerceArray=q;exports.error=b;exports.escapeHTML=se;exports.escapeHTMLComment=le;exports.extend=$;exports.generateUniqueId=Y;exports.getEscapedCssVarName=pe;exports.getGlobalThis=Z;exports.hasChanged=W;exports.hasOwn=h;exports.includeBooleanAttr=de;exports.info=re;exports.isArray=p;exports.isBoolean=B;exports.isBooleanAttr=me;exports.isBrowser=X;exports.isDelegatedEvent=ze;exports.isFalsy=H;exports.isFunction=O;exports.isHTMLElement=R;exports.isHTMLTag=Ee;exports.isHtmlFormElement=Re;exports.isHtmlInputElement=Oe;exports.isHtmlSelectElement=He;exports.isHtmlTextAreaElement=je;exports.isKnownHtmlAttr=be;exports.isKnownSvgAttr=xe;exports.isMap=L;exports.isMathMLTag=Ne;exports.isNaN=G;exports.isNil=z;exports.isNode=_e;exports.isNull=y;exports.isNumber=f;exports.isObject=d;exports.isOn=V;exports.isPlainObject=P;exports.isPrimitive=j;exports.isPromise=A;exports.isRenderAbleAttrValue=ye;exports.isSSRSafeAttrName=ge;exports.isSVGTag=Me;exports.isSelfClosingTag=Le;exports.isSet=M;exports.isSpecialBooleanAttr=ue;exports.isString=i;exports.isStringNumber=_;exports.isSymbol=E;exports.isTextNode=Pe;exports.isUndefined=F;exports.isVoidTag=Ce;exports.isWeakMap=N;exports.isWeakSet=C;exports.kebabCase=g;exports.noop=D;exports.normalizeClassName=v;exports.normalizeStyle=S;exports.parseStyleString=w;exports.propsToAttrMap=he;exports.startsWith=I;exports.styleObjectToString=$e;exports.styleToString=Ue;exports.warn=oe;//# sourceMappingURL=shared.cjs.js.map
1
+ 'use strict';
2
+
3
+ // src/is.ts
4
+ var isObject = (val) => val !== null && typeof val === "object";
5
+ function isPromise(val) {
6
+ return _toString.call(val) === "[object Promise]";
7
+ }
8
+ var isArray = Array.isArray;
9
+ function isString(val) {
10
+ return typeof val === "string";
11
+ }
12
+ function isNumber(val) {
13
+ return typeof val === "number";
14
+ }
15
+ function isNull(val) {
16
+ return val === null;
17
+ }
18
+ function isSymbol(val) {
19
+ return typeof val === "symbol";
20
+ }
21
+ function isSet(val) {
22
+ return _toString.call(val) === "[object Set]";
23
+ }
24
+ function isWeakMap(val) {
25
+ return _toString.call(val) === "[object WeakMap]";
26
+ }
27
+ function isWeakSet(val) {
28
+ return _toString.call(val) === "[object WeakSet]";
29
+ }
30
+ function isMap(val) {
31
+ return _toString.call(val) === "[object Map]";
32
+ }
33
+ function isNil(val) {
34
+ return val === null || val === void 0;
35
+ }
36
+ var isFunction = (val) => typeof val === "function";
37
+ function isFalsy(val) {
38
+ return val === false || val === null || val === void 0;
39
+ }
40
+ var isPrimitive = (val) => val == null || typeof val === "string" || typeof val === "number" || typeof val === "boolean" || typeof val === "symbol" || typeof val === "undefined";
41
+ function isHTMLElement(val) {
42
+ return val instanceof HTMLElement;
43
+ }
44
+ var isPlainObject = (val) => _toString.call(val) === "[object Object]";
45
+ function isStringNumber(val) {
46
+ if (!isString(val) || val === "") {
47
+ return false;
48
+ }
49
+ return !Number.isNaN(Number(val));
50
+ }
51
+ function isUndefined(val) {
52
+ return typeof val === "undefined";
53
+ }
54
+ function isBoolean(val) {
55
+ return typeof val === "boolean";
56
+ }
57
+ function isNaN(val) {
58
+ return Number.isNaN(val);
59
+ }
60
+ function isBigint(val) {
61
+ return typeof val === "bigint";
62
+ }
63
+
64
+ // src/base.ts
65
+ var _toString = Object.prototype.toString;
66
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
67
+ var extend = Object.assign;
68
+ var hasOwn = (val, key) => hasOwnProperty.call(val, key);
69
+ function coerceArray(data) {
70
+ return isArray(data) ? data : [data];
71
+ }
72
+ var hasChanged = (value, oldValue) => !Object.is(value, oldValue);
73
+ var noop = Function.prototype;
74
+ function startsWith(str, searchString) {
75
+ if (!isString(str)) {
76
+ return false;
77
+ }
78
+ return str.indexOf(searchString) === 0;
79
+ }
80
+ function generateUniqueId() {
81
+ return Math.random().toString(36).slice(2, 10);
82
+ }
83
+ function isBrowser() {
84
+ return typeof window !== "undefined" && typeof document !== "undefined";
85
+ }
86
+ var cacheStringFunction = (fn) => {
87
+ const cache = /* @__PURE__ */ Object.create(null);
88
+ return ((str) => {
89
+ const hit = cache[str];
90
+ return hit || (cache[str] = fn(str));
91
+ });
92
+ };
93
+ var EMPTY_OBJ = Object.freeze({});
94
+ var EMPTY_ARR = Object.freeze([]);
95
+ var isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && key.charCodeAt(2) >= 65 && // uppercase letter A-Z
96
+ key.charCodeAt(2) <= 90;
97
+ var _globalThis;
98
+ var getGlobalThis = () => {
99
+ return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
100
+ };
101
+
102
+ // src/string.ts
103
+ var hyphenateRE = /\B([A-Z])/g;
104
+ var kebabCase = cacheStringFunction(
105
+ (str) => str.replaceAll(hyphenateRE, "-$1").toLowerCase()
106
+ );
107
+ var camelizeRE = /[_-](\w)/g;
108
+ var camelCase = cacheStringFunction((str) => {
109
+ str = str.replaceAll(/^[_-]+|[_-]+$/g, "");
110
+ str = str.replaceAll(/[_-]+/g, "-");
111
+ return str.replaceAll(camelizeRE, (_, c) => c.toUpperCase());
112
+ });
113
+ var capitalize = cacheStringFunction(
114
+ (str) => {
115
+ return str.charAt(0).toUpperCase() + str.slice(1);
116
+ }
117
+ );
118
+
119
+ // src/logger.ts
120
+ function warn(msg, ...args) {
121
+ console.warn(`[Essor warn]: ${msg}`, ...args);
122
+ }
123
+ function info(msg, ...args) {
124
+ console.info(`[Essor info]: ${msg}`, ...args);
125
+ }
126
+ function error(msg, ...args) {
127
+ console.error(`[Essor error]: ${msg}`, ...args);
128
+ }
129
+
130
+ // src/escape.ts
131
+ var escapeRE = /["&'<>]/;
132
+ function escapeHTML(string) {
133
+ const str = `${string}`;
134
+ const match = escapeRE.exec(str);
135
+ if (!match) {
136
+ return str;
137
+ }
138
+ let html = "";
139
+ let escaped;
140
+ let index;
141
+ let lastIndex = 0;
142
+ for (index = match.index; index < str.length; index++) {
143
+ switch (str.charCodeAt(index)) {
144
+ case 34:
145
+ escaped = "&quot;";
146
+ break;
147
+ case 38:
148
+ escaped = "&amp;";
149
+ break;
150
+ case 39:
151
+ escaped = "&#39;";
152
+ break;
153
+ case 60:
154
+ escaped = "&lt;";
155
+ break;
156
+ case 62:
157
+ escaped = "&gt;";
158
+ break;
159
+ default:
160
+ continue;
161
+ }
162
+ if (lastIndex !== index) {
163
+ html += str.slice(lastIndex, index);
164
+ }
165
+ lastIndex = index + 1;
166
+ html += escaped;
167
+ }
168
+ return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
169
+ }
170
+ var commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
171
+ function escapeHTMLComment(src) {
172
+ return src.replaceAll(commentStripRE, "");
173
+ }
174
+ var cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
175
+ function getEscapedCssVarName(key, doubleEscape) {
176
+ return key.replaceAll(
177
+ cssVarNameEscapeSymbolsRE,
178
+ (s) => doubleEscape ? s === '"' ? '\\\\\\"' : `\\\\${s}` : `\\${s}`
179
+ );
180
+ }
181
+
182
+ // src/dom.ts
183
+ function makeMap(str) {
184
+ const map = /* @__PURE__ */ Object.create(null);
185
+ for (const key of str.split(",")) {
186
+ map[key] = 1;
187
+ }
188
+ return (val) => val in map;
189
+ }
190
+ var specialBooleanAttrs = "itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";
191
+ var isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
192
+ var isBooleanAttr = /* @__PURE__ */ makeMap(
193
+ `${specialBooleanAttrs},async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
194
+ );
195
+ function includeBooleanAttr(value) {
196
+ return !!value || value === "";
197
+ }
198
+ var unsafeAttrCharRE = /[\t\n\f "'/=>]/;
199
+ var attrValidationCache = {};
200
+ function isSSRSafeAttrName(name) {
201
+ if (hasOwn(attrValidationCache, name)) {
202
+ return attrValidationCache[name];
203
+ }
204
+ const isUnsafe = unsafeAttrCharRE.test(name);
205
+ if (isUnsafe) {
206
+ if (__DEV__) {
207
+ error(`unsafe attribute name: ${name}`);
208
+ }
209
+ }
210
+ return attrValidationCache[name] = !isUnsafe;
211
+ }
212
+ var propsToAttrMap = {
213
+ acceptCharset: "accept-charset",
214
+ className: "class",
215
+ htmlFor: "for",
216
+ httpEquiv: "http-equiv"
217
+ };
218
+ var isKnownHtmlAttr = /* @__PURE__ */ makeMap(
219
+ "accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap"
220
+ );
221
+ var isKnownSvgAttr = /* @__PURE__ */ makeMap(
222
+ "xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan"
223
+ );
224
+ var HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
225
+ var SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,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,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
226
+ var MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
227
+ var DELEGATED_EVENTS = "beforeinput,click,dblclick,contextmenu,focusin,focusout,input,keydown,keyup,mousedown,mousemove,mouseout,mouseover,mouseup,pointerdown,pointermove,pointerout,pointerover,pointerup,touchend,touchmove,touchstart";
228
+ var VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
229
+ var isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
230
+ var isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
231
+ var isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
232
+ var isSelfClosingTag = /* @__PURE__ */ makeMap(VOID_TAGS);
233
+ var isDelegatedEvent = /* @__PURE__ */ makeMap(DELEGATED_EVENTS);
234
+
235
+ // src/dom-types.ts
236
+ function isHtmlInputElement(val) {
237
+ return val instanceof HTMLInputElement;
238
+ }
239
+ function isHtmlSelectElement(val) {
240
+ return val instanceof HTMLSelectElement;
241
+ }
242
+ function isHtmlTextAreaElement(val) {
243
+ return val instanceof HTMLTextAreaElement;
244
+ }
245
+ function isHtmlFormElement(val) {
246
+ return val instanceof HTMLFormElement;
247
+ }
248
+ function isTextNode(val) {
249
+ return val instanceof Text;
250
+ }
251
+ function isNode(val) {
252
+ return val instanceof Node;
253
+ }
254
+
255
+ // src/normalize.ts
256
+ var STYLE_SEPARATOR_REGEX = /;(?![^(]*\))/g;
257
+ var PROPERTY_VALUE_SEPARATOR_REGEX = /:([\s\S]+)/;
258
+ var STYLE_COMMENT_REGEX = /\/\*[\s\S]*?\*\//g;
259
+ function parseStyleString(cssText) {
260
+ const styleObject = {};
261
+ cssText.replaceAll(STYLE_COMMENT_REGEX, "").split(STYLE_SEPARATOR_REGEX).forEach((styleItem) => {
262
+ if (styleItem) {
263
+ const parts = styleItem.split(PROPERTY_VALUE_SEPARATOR_REGEX);
264
+ if (parts.length > 1) {
265
+ styleObject[parts[0].trim()] = parts[1].trim();
266
+ }
267
+ }
268
+ });
269
+ return styleObject;
270
+ }
271
+ function normalizeStyle(styleValue) {
272
+ if (isArray(styleValue)) {
273
+ const normalizedStyleObject = {};
274
+ for (const styleItem of styleValue) {
275
+ const normalizedItem = isString(styleItem) ? parseStyleString(styleItem) : normalizeStyle(styleItem);
276
+ if (normalizedItem) {
277
+ for (const key in normalizedItem) {
278
+ normalizedStyleObject[key] = normalizedItem[key];
279
+ }
280
+ }
281
+ }
282
+ return normalizedStyleObject;
283
+ }
284
+ if (isString(styleValue) || isObject(styleValue)) {
285
+ return styleValue;
286
+ }
287
+ return void 0;
288
+ }
289
+ function styleToString(styleValue) {
290
+ if (!styleValue) {
291
+ return "";
292
+ }
293
+ if (isString(styleValue)) {
294
+ return styleValue;
295
+ }
296
+ let cssText = "";
297
+ for (const propName in styleValue) {
298
+ const propValue = styleValue[propName];
299
+ if (isString(propValue) || isNumber(propValue)) {
300
+ const normalizedPropName = propName.startsWith("--") ? propName : kebabCase(propName);
301
+ cssText += `${normalizedPropName}:${propValue};`;
302
+ }
303
+ }
304
+ return cssText;
305
+ }
306
+ function normalizeClassName(classValue) {
307
+ if (classValue == null) {
308
+ return "";
309
+ }
310
+ if (isString(classValue)) {
311
+ return classValue.trim();
312
+ }
313
+ if (isArray(classValue)) {
314
+ return classValue.map(normalizeClassName).filter(Boolean).join(" ");
315
+ }
316
+ if (isObject(classValue)) {
317
+ let count = 0;
318
+ for (const key in classValue) {
319
+ if (classValue[key]) count++;
320
+ }
321
+ if (count === 0) return "";
322
+ const result = new Array(count);
323
+ let index = 0;
324
+ for (const key in classValue) {
325
+ if (classValue[key]) {
326
+ result[index++] = key;
327
+ }
328
+ }
329
+ return result.join(" ");
330
+ }
331
+ return String(classValue).trim();
332
+ }
333
+
334
+ exports.EMPTY_ARR = EMPTY_ARR;
335
+ exports.EMPTY_OBJ = EMPTY_OBJ;
336
+ exports.cacheStringFunction = cacheStringFunction;
337
+ exports.camelCase = camelCase;
338
+ exports.capitalize = capitalize;
339
+ exports.coerceArray = coerceArray;
340
+ exports.error = error;
341
+ exports.escapeHTML = escapeHTML;
342
+ exports.escapeHTMLComment = escapeHTMLComment;
343
+ exports.extend = extend;
344
+ exports.generateUniqueId = generateUniqueId;
345
+ exports.getEscapedCssVarName = getEscapedCssVarName;
346
+ exports.getGlobalThis = getGlobalThis;
347
+ exports.hasChanged = hasChanged;
348
+ exports.hasOwn = hasOwn;
349
+ exports.includeBooleanAttr = includeBooleanAttr;
350
+ exports.info = info;
351
+ exports.isArray = isArray;
352
+ exports.isBigint = isBigint;
353
+ exports.isBoolean = isBoolean;
354
+ exports.isBooleanAttr = isBooleanAttr;
355
+ exports.isBrowser = isBrowser;
356
+ exports.isDelegatedEvent = isDelegatedEvent;
357
+ exports.isFalsy = isFalsy;
358
+ exports.isFunction = isFunction;
359
+ exports.isHTMLElement = isHTMLElement;
360
+ exports.isHTMLTag = isHTMLTag;
361
+ exports.isHtmlFormElement = isHtmlFormElement;
362
+ exports.isHtmlInputElement = isHtmlInputElement;
363
+ exports.isHtmlSelectElement = isHtmlSelectElement;
364
+ exports.isHtmlTextAreaElement = isHtmlTextAreaElement;
365
+ exports.isKnownHtmlAttr = isKnownHtmlAttr;
366
+ exports.isKnownSvgAttr = isKnownSvgAttr;
367
+ exports.isMap = isMap;
368
+ exports.isMathMLTag = isMathMLTag;
369
+ exports.isNaN = isNaN;
370
+ exports.isNil = isNil;
371
+ exports.isNode = isNode;
372
+ exports.isNull = isNull;
373
+ exports.isNumber = isNumber;
374
+ exports.isObject = isObject;
375
+ exports.isOn = isOn;
376
+ exports.isPlainObject = isPlainObject;
377
+ exports.isPrimitive = isPrimitive;
378
+ exports.isPromise = isPromise;
379
+ exports.isSSRSafeAttrName = isSSRSafeAttrName;
380
+ exports.isSVGTag = isSVGTag;
381
+ exports.isSelfClosingTag = isSelfClosingTag;
382
+ exports.isSet = isSet;
383
+ exports.isSpecialBooleanAttr = isSpecialBooleanAttr;
384
+ exports.isString = isString;
385
+ exports.isStringNumber = isStringNumber;
386
+ exports.isSymbol = isSymbol;
387
+ exports.isTextNode = isTextNode;
388
+ exports.isUndefined = isUndefined;
389
+ exports.isWeakMap = isWeakMap;
390
+ exports.isWeakSet = isWeakSet;
391
+ exports.kebabCase = kebabCase;
392
+ exports.noop = noop;
393
+ exports.normalizeClassName = normalizeClassName;
394
+ exports.normalizeStyle = normalizeStyle;
395
+ exports.parseStyleString = parseStyleString;
396
+ exports.propsToAttrMap = propsToAttrMap;
397
+ exports.startsWith = startsWith;
398
+ exports.styleToString = styleToString;
399
+ exports.warn = warn;
400
+ //# sourceMappingURL=shared.cjs.js.map
3
401
  //# sourceMappingURL=shared.cjs.js.map