@vue/shared 3.2.39 → 3.2.41

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