@vue/shared 3.2.46 → 3.3.0-alpha.1

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,601 +1,412 @@
1
1
  'use strict';
2
2
 
3
- /**
4
- * Make a map and return a function for checking if a key
5
- * is in that map.
6
- * IMPORTANT: all calls of this function must be prefixed with
7
- * \/\*#\_\_PURE\_\_\*\/
8
- * So that rollup can tree-shake them if necessary.
9
- */
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
10
5
  function makeMap(str, expectsLowerCase) {
11
- const map = Object.create(null);
12
- const list = str.split(',');
13
- for (let i = 0; i < list.length; i++) {
14
- map[list[i]] = true;
15
- }
16
- return expectsLowerCase ? val => !!map[val.toLowerCase()] : val => !!map[val];
6
+ const map = /* @__PURE__ */ Object.create(null);
7
+ const list = str.split(",");
8
+ for (let i = 0; i < list.length; i++) {
9
+ map[list[i]] = true;
10
+ }
11
+ return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
17
12
  }
18
13
 
19
- /**
20
- * dev only flag -> name mapping
21
- */
22
14
  const PatchFlagNames = {
23
- [1 /* PatchFlags.TEXT */]: `TEXT`,
24
- [2 /* PatchFlags.CLASS */]: `CLASS`,
25
- [4 /* PatchFlags.STYLE */]: `STYLE`,
26
- [8 /* PatchFlags.PROPS */]: `PROPS`,
27
- [16 /* PatchFlags.FULL_PROPS */]: `FULL_PROPS`,
28
- [32 /* PatchFlags.HYDRATE_EVENTS */]: `HYDRATE_EVENTS`,
29
- [64 /* PatchFlags.STABLE_FRAGMENT */]: `STABLE_FRAGMENT`,
30
- [128 /* PatchFlags.KEYED_FRAGMENT */]: `KEYED_FRAGMENT`,
31
- [256 /* PatchFlags.UNKEYED_FRAGMENT */]: `UNKEYED_FRAGMENT`,
32
- [512 /* PatchFlags.NEED_PATCH */]: `NEED_PATCH`,
33
- [1024 /* PatchFlags.DYNAMIC_SLOTS */]: `DYNAMIC_SLOTS`,
34
- [2048 /* PatchFlags.DEV_ROOT_FRAGMENT */]: `DEV_ROOT_FRAGMENT`,
35
- [-1 /* PatchFlags.HOISTED */]: `HOISTED`,
36
- [-2 /* PatchFlags.BAIL */]: `BAIL`
15
+ [1]: `TEXT`,
16
+ [2]: `CLASS`,
17
+ [4]: `STYLE`,
18
+ [8]: `PROPS`,
19
+ [16]: `FULL_PROPS`,
20
+ [32]: `HYDRATE_EVENTS`,
21
+ [64]: `STABLE_FRAGMENT`,
22
+ [128]: `KEYED_FRAGMENT`,
23
+ [256]: `UNKEYED_FRAGMENT`,
24
+ [512]: `NEED_PATCH`,
25
+ [1024]: `DYNAMIC_SLOTS`,
26
+ [2048]: `DEV_ROOT_FRAGMENT`,
27
+ [-1]: `HOISTED`,
28
+ [-2]: `BAIL`
37
29
  };
38
30
 
39
- /**
40
- * Dev only
41
- */
42
31
  const slotFlagsText = {
43
- [1 /* SlotFlags.STABLE */]: 'STABLE',
44
- [2 /* SlotFlags.DYNAMIC */]: 'DYNAMIC',
45
- [3 /* SlotFlags.FORWARDED */]: 'FORWARDED'
32
+ [1]: "STABLE",
33
+ [2]: "DYNAMIC",
34
+ [3]: "FORWARDED"
46
35
  };
47
36
 
48
- const GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +
49
- 'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +
50
- 'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';
51
- const isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED);
37
+ const GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt";
38
+ const isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
52
39
 
53
40
  const range = 2;
54
41
  function generateCodeFrame(source, start = 0, end = source.length) {
55
- // Split the content into individual lines but capture the newline sequence
56
- // that separated each line. This is important because the actual sequence is
57
- // needed to properly take into account the full line length for offset
58
- // comparison
59
- let lines = source.split(/(\r?\n)/);
60
- // Separate the lines and newline sequences into separate arrays for easier referencing
61
- const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);
62
- lines = lines.filter((_, idx) => idx % 2 === 0);
63
- let count = 0;
64
- const res = [];
65
- for (let i = 0; i < lines.length; i++) {
66
- count +=
67
- lines[i].length +
68
- ((newlineSequences[i] && newlineSequences[i].length) || 0);
69
- if (count >= start) {
70
- for (let j = i - range; j <= i + range || end > count; j++) {
71
- if (j < 0 || j >= lines.length)
72
- continue;
73
- const line = j + 1;
74
- res.push(`${line}${' '.repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);
75
- const lineLength = lines[j].length;
76
- const newLineSeqLength = (newlineSequences[j] && newlineSequences[j].length) || 0;
77
- if (j === i) {
78
- // push underline
79
- const pad = start - (count - (lineLength + newLineSeqLength));
80
- const length = Math.max(1, end > count ? lineLength - pad : end - start);
81
- res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));
82
- }
83
- else if (j > i) {
84
- if (end > count) {
85
- const length = Math.max(Math.min(end - count, lineLength), 1);
86
- res.push(` | ` + '^'.repeat(length));
87
- }
88
- count += lineLength + newLineSeqLength;
89
- }
90
- }
91
- break;
42
+ let lines = source.split(/(\r?\n)/);
43
+ const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);
44
+ lines = lines.filter((_, idx) => idx % 2 === 0);
45
+ let count = 0;
46
+ const res = [];
47
+ for (let i = 0; i < lines.length; i++) {
48
+ count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);
49
+ if (count >= start) {
50
+ for (let j = i - range; j <= i + range || end > count; j++) {
51
+ if (j < 0 || j >= lines.length)
52
+ continue;
53
+ const line = j + 1;
54
+ res.push(
55
+ `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`
56
+ );
57
+ const lineLength = lines[j].length;
58
+ const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;
59
+ if (j === i) {
60
+ const pad = start - (count - (lineLength + newLineSeqLength));
61
+ const length = Math.max(
62
+ 1,
63
+ end > count ? lineLength - pad : end - start
64
+ );
65
+ res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
66
+ } else if (j > i) {
67
+ if (end > count) {
68
+ const length = Math.max(Math.min(end - count, lineLength), 1);
69
+ res.push(` | ` + "^".repeat(length));
70
+ }
71
+ count += lineLength + newLineSeqLength;
92
72
  }
73
+ }
74
+ break;
93
75
  }
94
- return res.join('\n');
76
+ }
77
+ return res.join("\n");
95
78
  }
96
79
 
97
80
  function normalizeStyle(value) {
98
- if (isArray(value)) {
99
- const res = {};
100
- for (let i = 0; i < value.length; i++) {
101
- const item = value[i];
102
- const normalized = isString(item)
103
- ? parseStringStyle(item)
104
- : normalizeStyle(item);
105
- if (normalized) {
106
- for (const key in normalized) {
107
- res[key] = normalized[key];
108
- }
109
- }
81
+ if (isArray(value)) {
82
+ const res = {};
83
+ for (let i = 0; i < value.length; i++) {
84
+ const item = value[i];
85
+ const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
86
+ if (normalized) {
87
+ for (const key in normalized) {
88
+ res[key] = normalized[key];
110
89
  }
111
- return res;
112
- }
113
- else if (isString(value)) {
114
- return value;
115
- }
116
- else if (isObject(value)) {
117
- return value;
90
+ }
118
91
  }
92
+ return res;
93
+ } else if (isString(value)) {
94
+ return value;
95
+ } else if (isObject(value)) {
96
+ return value;
97
+ }
119
98
  }
120
99
  const listDelimiterRE = /;(?![^(]*\))/g;
121
100
  const propertyDelimiterRE = /:([^]+)/;
122
101
  const styleCommentRE = /\/\*.*?\*\//gs;
123
102
  function parseStringStyle(cssText) {
124
- const ret = {};
125
- cssText
126
- .replace(styleCommentRE, '')
127
- .split(listDelimiterRE)
128
- .forEach(item => {
129
- if (item) {
130
- const tmp = item.split(propertyDelimiterRE);
131
- tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
132
- }
133
- });
134
- return ret;
103
+ const ret = {};
104
+ cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
105
+ if (item) {
106
+ const tmp = item.split(propertyDelimiterRE);
107
+ tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
108
+ }
109
+ });
110
+ return ret;
135
111
  }
136
112
  function stringifyStyle(styles) {
137
- let ret = '';
138
- if (!styles || isString(styles)) {
139
- return ret;
140
- }
141
- for (const key in styles) {
142
- const value = styles[key];
143
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
144
- if (isString(value) || typeof value === 'number') {
145
- // only render valid values
146
- ret += `${normalizedKey}:${value};`;
147
- }
148
- }
113
+ let ret = "";
114
+ if (!styles || isString(styles)) {
149
115
  return ret;
116
+ }
117
+ for (const key in styles) {
118
+ const value = styles[key];
119
+ const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
120
+ if (isString(value) || typeof value === "number") {
121
+ ret += `${normalizedKey}:${value};`;
122
+ }
123
+ }
124
+ return ret;
150
125
  }
151
126
  function normalizeClass(value) {
152
- let res = '';
153
- if (isString(value)) {
154
- res = value;
155
- }
156
- else if (isArray(value)) {
157
- for (let i = 0; i < value.length; i++) {
158
- const normalized = normalizeClass(value[i]);
159
- if (normalized) {
160
- res += normalized + ' ';
161
- }
162
- }
127
+ let res = "";
128
+ if (isString(value)) {
129
+ res = value;
130
+ } else if (isArray(value)) {
131
+ for (let i = 0; i < value.length; i++) {
132
+ const normalized = normalizeClass(value[i]);
133
+ if (normalized) {
134
+ res += normalized + " ";
135
+ }
163
136
  }
164
- else if (isObject(value)) {
165
- for (const name in value) {
166
- if (value[name]) {
167
- res += name + ' ';
168
- }
169
- }
137
+ } else if (isObject(value)) {
138
+ for (const name in value) {
139
+ if (value[name]) {
140
+ res += name + " ";
141
+ }
170
142
  }
171
- return res.trim();
143
+ }
144
+ return res.trim();
172
145
  }
173
146
  function normalizeProps(props) {
174
- if (!props)
175
- return null;
176
- let { class: klass, style } = props;
177
- if (klass && !isString(klass)) {
178
- props.class = normalizeClass(klass);
179
- }
180
- if (style) {
181
- props.style = normalizeStyle(style);
182
- }
183
- return props;
147
+ if (!props)
148
+ return null;
149
+ let { class: klass, style } = props;
150
+ if (klass && !isString(klass)) {
151
+ props.class = normalizeClass(klass);
152
+ }
153
+ if (style) {
154
+ props.style = normalizeStyle(style);
155
+ }
156
+ return props;
184
157
  }
185
158
 
186
- // These tag configs are shared between compiler-dom and runtime-dom, so they
187
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Element
188
- const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +
189
- 'header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
190
- 'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +
191
- 'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +
192
- 'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +
193
- 'canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,' +
194
- 'th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,' +
195
- 'option,output,progress,select,textarea,details,dialog,menu,' +
196
- 'summary,template,blockquote,iframe,tfoot';
197
- // https://developer.mozilla.org/en-US/docs/Web/SVG/Element
198
- const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +
199
- 'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +
200
- 'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +
201
- 'feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +
202
- 'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +
203
- 'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +
204
- 'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +
205
- 'mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,' +
206
- 'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +
207
- 'text,textPath,title,tspan,unknown,use,view';
208
- const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';
209
- /**
210
- * Compiler only.
211
- * Do NOT use in runtime code paths unless behind `true` flag.
212
- */
213
- const isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS);
214
- /**
215
- * Compiler only.
216
- * Do NOT use in runtime code paths unless behind `true` flag.
217
- */
218
- const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);
219
- /**
220
- * Compiler only.
221
- * Do NOT use in runtime code paths unless behind `true` flag.
222
- */
223
- const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);
159
+ const 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";
160
+ const 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";
161
+ const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
162
+ const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
163
+ const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
164
+ const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
224
165
 
225
- /**
226
- * On the client we only need to offer special cases for boolean attributes that
227
- * have different names from their corresponding dom properties:
228
- * - itemscope -> N/A
229
- * - allowfullscreen -> allowFullscreen
230
- * - formnovalidate -> formNoValidate
231
- * - ismap -> isMap
232
- * - nomodule -> noModule
233
- * - novalidate -> noValidate
234
- * - readonly -> readOnly
235
- */
236
166
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
237
- const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
238
- /**
239
- * The full list is needed during SSR to produce the correct initial markup.
240
- */
241
- const isBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs +
242
- `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +
243
- `loop,open,required,reversed,scoped,seamless,` +
244
- `checked,muted,multiple,selected`);
245
- /**
246
- * Boolean attributes should be included if the value is truthy or ''.
247
- * e.g. `<select multiple>` compiles to `{ multiple: '' }`
248
- */
167
+ const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
168
+ const isBooleanAttr = /* @__PURE__ */ makeMap(
169
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
170
+ );
249
171
  function includeBooleanAttr(value) {
250
- return !!value || value === '';
172
+ return !!value || value === "";
251
173
  }
252
174
  const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
253
175
  const attrValidationCache = {};
254
176
  function isSSRSafeAttrName(name) {
255
- if (attrValidationCache.hasOwnProperty(name)) {
256
- return attrValidationCache[name];
257
- }
258
- const isUnsafe = unsafeAttrCharRE.test(name);
259
- if (isUnsafe) {
260
- console.error(`unsafe attribute name: ${name}`);
261
- }
262
- return (attrValidationCache[name] = !isUnsafe);
177
+ if (attrValidationCache.hasOwnProperty(name)) {
178
+ return attrValidationCache[name];
179
+ }
180
+ const isUnsafe = unsafeAttrCharRE.test(name);
181
+ if (isUnsafe) {
182
+ console.error(`unsafe attribute name: ${name}`);
183
+ }
184
+ return attrValidationCache[name] = !isUnsafe;
263
185
  }
264
186
  const propsToAttrMap = {
265
- acceptCharset: 'accept-charset',
266
- className: 'class',
267
- htmlFor: 'for',
268
- httpEquiv: 'http-equiv'
187
+ acceptCharset: "accept-charset",
188
+ className: "class",
189
+ htmlFor: "for",
190
+ httpEquiv: "http-equiv"
269
191
  };
270
- /**
271
- * Known attributes, this is used for stringification of runtime static nodes
272
- * so that we don't stringify bindings that cannot be set from HTML.
273
- * Don't also forget to allow `data-*` and `aria-*`!
274
- * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
275
- */
276
- const isKnownHtmlAttr = /*#__PURE__*/ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,` +
277
- `autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` +
278
- `border,buffered,capture,challenge,charset,checked,cite,class,code,` +
279
- `codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` +
280
- `coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` +
281
- `disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` +
282
- `formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` +
283
- `height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` +
284
- `ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +
285
- `manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +
286
- `open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +
287
- `referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +
288
- `selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +
289
- `start,step,style,summary,tabindex,target,title,translate,type,usemap,` +
290
- `value,width,wrap`);
291
- /**
292
- * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
293
- */
294
- const isKnownSvgAttr = /*#__PURE__*/ makeMap(`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,` +
295
- `arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,` +
296
- `baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,` +
297
- `clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,` +
298
- `color-interpolation-filters,color-profile,color-rendering,` +
299
- `contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,` +
300
- `descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,` +
301
- `dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,` +
302
- `fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,` +
303
- `font-family,font-size,font-size-adjust,font-stretch,font-style,` +
304
- `font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,` +
305
- `glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,` +
306
- `gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,` +
307
- `horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,` +
308
- `k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,` +
309
- `lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,` +
310
- `marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,` +
311
- `mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,` +
312
- `name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,` +
313
- `overflow,overline-position,overline-thickness,panose-1,paint-order,path,` +
314
- `pathLength,patternContentUnits,patternTransform,patternUnits,ping,` +
315
- `pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,` +
316
- `preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,` +
317
- `rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,` +
318
- `restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,` +
319
- `specularConstant,specularExponent,speed,spreadMethod,startOffset,` +
320
- `stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,` +
321
- `strikethrough-position,strikethrough-thickness,string,stroke,` +
322
- `stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,` +
323
- `stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,` +
324
- `systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,` +
325
- `text-decoration,text-rendering,textLength,to,transform,transform-origin,` +
326
- `type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,` +
327
- `unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,` +
328
- `v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,` +
329
- `vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,` +
330
- `writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,` +
331
- `xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,` +
332
- `xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`);
192
+ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
193
+ `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,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`
194
+ );
195
+ const isKnownSvgAttr = /* @__PURE__ */ makeMap(
196
+ `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,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
197
+ );
333
198
 
334
199
  const escapeRE = /["'&<>]/;
335
200
  function escapeHtml(string) {
336
- const str = '' + string;
337
- const match = escapeRE.exec(str);
338
- if (!match) {
339
- return str;
201
+ const str = "" + string;
202
+ const match = escapeRE.exec(str);
203
+ if (!match) {
204
+ return str;
205
+ }
206
+ let html = "";
207
+ let escaped;
208
+ let index;
209
+ let lastIndex = 0;
210
+ for (index = match.index; index < str.length; index++) {
211
+ switch (str.charCodeAt(index)) {
212
+ case 34:
213
+ escaped = "&quot;";
214
+ break;
215
+ case 38:
216
+ escaped = "&amp;";
217
+ break;
218
+ case 39:
219
+ escaped = "&#39;";
220
+ break;
221
+ case 60:
222
+ escaped = "&lt;";
223
+ break;
224
+ case 62:
225
+ escaped = "&gt;";
226
+ break;
227
+ default:
228
+ continue;
340
229
  }
341
- let html = '';
342
- let escaped;
343
- let index;
344
- let lastIndex = 0;
345
- for (index = match.index; index < str.length; index++) {
346
- switch (str.charCodeAt(index)) {
347
- case 34: // "
348
- escaped = '&quot;';
349
- break;
350
- case 38: // &
351
- escaped = '&amp;';
352
- break;
353
- case 39: // '
354
- escaped = '&#39;';
355
- break;
356
- case 60: // <
357
- escaped = '&lt;';
358
- break;
359
- case 62: // >
360
- escaped = '&gt;';
361
- break;
362
- default:
363
- continue;
364
- }
365
- if (lastIndex !== index) {
366
- html += str.slice(lastIndex, index);
367
- }
368
- lastIndex = index + 1;
369
- html += escaped;
230
+ if (lastIndex !== index) {
231
+ html += str.slice(lastIndex, index);
370
232
  }
371
- return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
233
+ lastIndex = index + 1;
234
+ html += escaped;
235
+ }
236
+ return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
372
237
  }
373
- // https://www.w3.org/TR/html52/syntax.html#comments
374
238
  const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
375
239
  function escapeHtmlComment(src) {
376
- return src.replace(commentStripRE, '');
240
+ return src.replace(commentStripRE, "");
377
241
  }
378
242
 
379
243
  function looseCompareArrays(a, b) {
380
- if (a.length !== b.length)
381
- return false;
382
- let equal = true;
383
- for (let i = 0; equal && i < a.length; i++) {
384
- equal = looseEqual(a[i], b[i]);
385
- }
386
- return equal;
244
+ if (a.length !== b.length)
245
+ return false;
246
+ let equal = true;
247
+ for (let i = 0; equal && i < a.length; i++) {
248
+ equal = looseEqual(a[i], b[i]);
249
+ }
250
+ return equal;
387
251
  }
388
252
  function looseEqual(a, b) {
389
- if (a === b)
390
- return true;
391
- let aValidType = isDate(a);
392
- let bValidType = isDate(b);
393
- if (aValidType || bValidType) {
394
- return aValidType && bValidType ? a.getTime() === b.getTime() : false;
253
+ if (a === b)
254
+ return true;
255
+ let aValidType = isDate(a);
256
+ let bValidType = isDate(b);
257
+ if (aValidType || bValidType) {
258
+ return aValidType && bValidType ? a.getTime() === b.getTime() : false;
259
+ }
260
+ aValidType = isSymbol(a);
261
+ bValidType = isSymbol(b);
262
+ if (aValidType || bValidType) {
263
+ return a === b;
264
+ }
265
+ aValidType = isArray(a);
266
+ bValidType = isArray(b);
267
+ if (aValidType || bValidType) {
268
+ return aValidType && bValidType ? looseCompareArrays(a, b) : false;
269
+ }
270
+ aValidType = isObject(a);
271
+ bValidType = isObject(b);
272
+ if (aValidType || bValidType) {
273
+ if (!aValidType || !bValidType) {
274
+ return false;
395
275
  }
396
- aValidType = isSymbol(a);
397
- bValidType = isSymbol(b);
398
- if (aValidType || bValidType) {
399
- return a === b;
276
+ const aKeysCount = Object.keys(a).length;
277
+ const bKeysCount = Object.keys(b).length;
278
+ if (aKeysCount !== bKeysCount) {
279
+ return false;
400
280
  }
401
- aValidType = isArray(a);
402
- bValidType = isArray(b);
403
- if (aValidType || bValidType) {
404
- return aValidType && bValidType ? looseCompareArrays(a, b) : false;
405
- }
406
- aValidType = isObject(a);
407
- bValidType = isObject(b);
408
- if (aValidType || bValidType) {
409
- /* istanbul ignore if: this if will probably never be called */
410
- if (!aValidType || !bValidType) {
411
- return false;
412
- }
413
- const aKeysCount = Object.keys(a).length;
414
- const bKeysCount = Object.keys(b).length;
415
- if (aKeysCount !== bKeysCount) {
416
- return false;
417
- }
418
- for (const key in a) {
419
- const aHasKey = a.hasOwnProperty(key);
420
- const bHasKey = b.hasOwnProperty(key);
421
- if ((aHasKey && !bHasKey) ||
422
- (!aHasKey && bHasKey) ||
423
- !looseEqual(a[key], b[key])) {
424
- return false;
425
- }
426
- }
281
+ for (const key in a) {
282
+ const aHasKey = a.hasOwnProperty(key);
283
+ const bHasKey = b.hasOwnProperty(key);
284
+ if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
285
+ return false;
286
+ }
427
287
  }
428
- return String(a) === String(b);
288
+ }
289
+ return String(a) === String(b);
429
290
  }
430
291
  function looseIndexOf(arr, val) {
431
- return arr.findIndex(item => looseEqual(item, val));
292
+ return arr.findIndex((item) => looseEqual(item, val));
432
293
  }
433
294
 
434
- /**
435
- * For converting {{ interpolation }} values to displayed strings.
436
- * @private
437
- */
438
295
  const toDisplayString = (val) => {
439
- return isString(val)
440
- ? val
441
- : val == null
442
- ? ''
443
- : isArray(val) ||
444
- (isObject(val) &&
445
- (val.toString === objectToString || !isFunction(val.toString)))
446
- ? JSON.stringify(val, replacer, 2)
447
- : String(val);
296
+ return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
448
297
  };
449
298
  const replacer = (_key, val) => {
450
- // can't use isRef here since @vue/shared has no deps
451
- if (val && val.__v_isRef) {
452
- return replacer(_key, val.value);
453
- }
454
- else if (isMap(val)) {
455
- return {
456
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val]) => {
457
- entries[`${key} =>`] = val;
458
- return entries;
459
- }, {})
460
- };
461
- }
462
- else if (isSet(val)) {
463
- return {
464
- [`Set(${val.size})`]: [...val.values()]
465
- };
466
- }
467
- else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
468
- return String(val);
469
- }
470
- return val;
299
+ if (val && val.__v_isRef) {
300
+ return replacer(_key, val.value);
301
+ } else if (isMap(val)) {
302
+ return {
303
+ [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
304
+ entries[`${key} =>`] = val2;
305
+ return entries;
306
+ }, {})
307
+ };
308
+ } else if (isSet(val)) {
309
+ return {
310
+ [`Set(${val.size})`]: [...val.values()]
311
+ };
312
+ } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
313
+ return String(val);
314
+ }
315
+ return val;
471
316
  };
472
317
 
473
- const EMPTY_OBJ = Object.freeze({})
474
- ;
318
+ const EMPTY_OBJ = Object.freeze({}) ;
475
319
  const EMPTY_ARR = Object.freeze([]) ;
476
- const NOOP = () => { };
477
- /**
478
- * Always return false.
479
- */
320
+ const NOOP = () => {
321
+ };
480
322
  const NO = () => false;
481
323
  const onRE = /^on[^a-z]/;
482
324
  const isOn = (key) => onRE.test(key);
483
- const isModelListener = (key) => key.startsWith('onUpdate:');
325
+ const isModelListener = (key) => key.startsWith("onUpdate:");
484
326
  const extend = Object.assign;
485
327
  const remove = (arr, el) => {
486
- const i = arr.indexOf(el);
487
- if (i > -1) {
488
- arr.splice(i, 1);
489
- }
328
+ const i = arr.indexOf(el);
329
+ if (i > -1) {
330
+ arr.splice(i, 1);
331
+ }
490
332
  };
491
333
  const hasOwnProperty = Object.prototype.hasOwnProperty;
492
334
  const hasOwn = (val, key) => hasOwnProperty.call(val, key);
493
335
  const isArray = Array.isArray;
494
- const isMap = (val) => toTypeString(val) === '[object Map]';
495
- const isSet = (val) => toTypeString(val) === '[object Set]';
496
- const isDate = (val) => toTypeString(val) === '[object Date]';
497
- const isRegExp = (val) => toTypeString(val) === '[object RegExp]';
498
- const isFunction = (val) => typeof val === 'function';
499
- const isString = (val) => typeof val === 'string';
500
- const isSymbol = (val) => typeof val === 'symbol';
501
- const isObject = (val) => val !== null && typeof val === 'object';
336
+ const isMap = (val) => toTypeString(val) === "[object Map]";
337
+ const isSet = (val) => toTypeString(val) === "[object Set]";
338
+ const isDate = (val) => toTypeString(val) === "[object Date]";
339
+ const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
340
+ const isFunction = (val) => typeof val === "function";
341
+ const isString = (val) => typeof val === "string";
342
+ const isSymbol = (val) => typeof val === "symbol";
343
+ const isObject = (val) => val !== null && typeof val === "object";
502
344
  const isPromise = (val) => {
503
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
345
+ return isObject(val) && isFunction(val.then) && isFunction(val.catch);
504
346
  };
505
347
  const objectToString = Object.prototype.toString;
506
348
  const toTypeString = (value) => objectToString.call(value);
507
349
  const toRawType = (value) => {
508
- // extract "RawType" from strings like "[object RawType]"
509
- return toTypeString(value).slice(8, -1);
350
+ return toTypeString(value).slice(8, -1);
510
351
  };
511
- const isPlainObject = (val) => toTypeString(val) === '[object Object]';
512
- const isIntegerKey = (key) => isString(key) &&
513
- key !== 'NaN' &&
514
- key[0] !== '-' &&
515
- '' + parseInt(key, 10) === key;
516
- const isReservedProp = /*#__PURE__*/ makeMap(
517
- // the leading comma is intentional so empty string "" is also included
518
- ',key,ref,ref_for,ref_key,' +
519
- 'onVnodeBeforeMount,onVnodeMounted,' +
520
- 'onVnodeBeforeUpdate,onVnodeUpdated,' +
521
- 'onVnodeBeforeUnmount,onVnodeUnmounted');
522
- const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
352
+ const isPlainObject = (val) => toTypeString(val) === "[object Object]";
353
+ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
354
+ const isReservedProp = /* @__PURE__ */ makeMap(
355
+ // the leading comma is intentional so empty string "" is also included
356
+ ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
357
+ );
358
+ const isBuiltInDirective = /* @__PURE__ */ makeMap(
359
+ "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
360
+ );
523
361
  const cacheStringFunction = (fn) => {
524
- const cache = Object.create(null);
525
- return ((str) => {
526
- const hit = cache[str];
527
- return hit || (cache[str] = fn(str));
528
- });
362
+ const cache = /* @__PURE__ */ Object.create(null);
363
+ return (str) => {
364
+ const hit = cache[str];
365
+ return hit || (cache[str] = fn(str));
366
+ };
529
367
  };
530
368
  const camelizeRE = /-(\w)/g;
531
- /**
532
- * @private
533
- */
534
369
  const camelize = cacheStringFunction((str) => {
535
- return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''));
370
+ return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
536
371
  });
537
372
  const hyphenateRE = /\B([A-Z])/g;
538
- /**
539
- * @private
540
- */
541
- const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1').toLowerCase());
542
- /**
543
- * @private
544
- */
545
- const capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
546
- /**
547
- * @private
548
- */
549
- const toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);
550
- // compare whether a value has changed, accounting for NaN.
373
+ const hyphenate = cacheStringFunction(
374
+ (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
375
+ );
376
+ const capitalize = cacheStringFunction(
377
+ (str) => str.charAt(0).toUpperCase() + str.slice(1)
378
+ );
379
+ const toHandlerKey = cacheStringFunction(
380
+ (str) => str ? `on${capitalize(str)}` : ``
381
+ );
551
382
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
552
383
  const invokeArrayFns = (fns, arg) => {
553
- for (let i = 0; i < fns.length; i++) {
554
- fns[i](arg);
555
- }
384
+ for (let i = 0; i < fns.length; i++) {
385
+ fns[i](arg);
386
+ }
556
387
  };
557
388
  const def = (obj, key, value) => {
558
- Object.defineProperty(obj, key, {
559
- configurable: true,
560
- enumerable: false,
561
- value
562
- });
389
+ Object.defineProperty(obj, key, {
390
+ configurable: true,
391
+ enumerable: false,
392
+ value
393
+ });
563
394
  };
564
- /**
565
- * "123-foo" will be parsed to 123
566
- * This is used for the .number modifier in v-model
567
- */
568
395
  const looseToNumber = (val) => {
569
- const n = parseFloat(val);
570
- return isNaN(n) ? val : n;
396
+ const n = parseFloat(val);
397
+ return isNaN(n) ? val : n;
571
398
  };
572
- /**
573
- * Only conerces number-like strings
574
- * "123-foo" will be returned as-is
575
- */
576
399
  const toNumber = (val) => {
577
- const n = isString(val) ? Number(val) : NaN;
578
- return isNaN(n) ? val : n;
400
+ const n = isString(val) ? Number(val) : NaN;
401
+ return isNaN(n) ? val : n;
579
402
  };
580
403
  let _globalThis;
581
404
  const getGlobalThis = () => {
582
- return (_globalThis ||
583
- (_globalThis =
584
- typeof globalThis !== 'undefined'
585
- ? globalThis
586
- : typeof self !== 'undefined'
587
- ? self
588
- : typeof window !== 'undefined'
589
- ? window
590
- : typeof global !== 'undefined'
591
- ? global
592
- : {}));
405
+ return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
593
406
  };
594
407
  const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;
595
408
  function genPropsAccessExp(name) {
596
- return identRE.test(name)
597
- ? `__props.${name}`
598
- : `__props[${JSON.stringify(name)}]`;
409
+ return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;
599
410
  }
600
411
 
601
412
  exports.EMPTY_ARR = EMPTY_ARR;