@vue/compat 3.4.0-alpha.4 → 3.4.0-beta.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.
@@ -190,6 +190,20 @@ function parseStringStyle(cssText) {
190
190
  });
191
191
  return ret;
192
192
  }
193
+ function stringifyStyle(styles) {
194
+ let ret = "";
195
+ if (!styles || isString(styles)) {
196
+ return ret;
197
+ }
198
+ for (const key in styles) {
199
+ const value = styles[key];
200
+ const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
201
+ if (isString(value) || typeof value === "number") {
202
+ ret += `${normalizedKey}:${value};`;
203
+ }
204
+ }
205
+ return ret;
206
+ }
193
207
  function normalizeClass(value) {
194
208
  let res = "";
195
209
  if (isString(value)) {
@@ -225,16 +239,27 @@ function normalizeProps(props) {
225
239
 
226
240
  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";
227
241
  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";
242
+ const MATH_TAGS = "math,maction,annotation,annotation-xml,menclose,merror,mfenced,mfrac,mi,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,semantics,mspace,msqrt,mstyle,msub,msup,msubsup,mtable,mtd,mtext,mtr,munder,munderover";
228
243
  const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
229
244
  const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
230
245
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
246
+ const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
231
247
  const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
232
248
 
233
249
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
234
250
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
251
+ const isBooleanAttr = /* @__PURE__ */ makeMap(
252
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
253
+ );
235
254
  function includeBooleanAttr(value) {
236
255
  return !!value || value === "";
237
256
  }
257
+ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
258
+ `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`
259
+ );
260
+ const isKnownSvgAttr = /* @__PURE__ */ makeMap(
261
+ `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`
262
+ );
238
263
 
239
264
  function looseCompareArrays(a, b) {
240
265
  if (a.length !== b.length)
@@ -296,20 +321,29 @@ const replacer = (_key, val) => {
296
321
  return replacer(_key, val.value);
297
322
  } else if (isMap(val)) {
298
323
  return {
299
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
300
- entries[`${key} =>`] = val2;
301
- return entries;
302
- }, {})
324
+ [`Map(${val.size})`]: [...val.entries()].reduce(
325
+ (entries, [key, val2], i) => {
326
+ entries[stringifySymbol(key, i) + " =>"] = val2;
327
+ return entries;
328
+ },
329
+ {}
330
+ )
303
331
  };
304
332
  } else if (isSet(val)) {
305
333
  return {
306
- [`Set(${val.size})`]: [...val.values()]
334
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
307
335
  };
336
+ } else if (isSymbol(val)) {
337
+ return stringifySymbol(val);
308
338
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
309
339
  return String(val);
310
340
  }
311
341
  return val;
312
342
  };
343
+ const stringifySymbol = (v, i = "") => {
344
+ var _a;
345
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
346
+ };
313
347
 
314
348
  function warn$1(msg, ...args) {
315
349
  console.warn(`[Vue warn] ${msg}`, ...args);
@@ -758,8 +792,13 @@ class BaseReactiveHandler {
758
792
  return isReadonly2;
759
793
  } else if (key === "__v_isShallow") {
760
794
  return shallow;
761
- } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
762
- return target;
795
+ } else if (key === "__v_raw") {
796
+ if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
797
+ // this means the reciever is a user proxy of the reactive proxy
798
+ Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
799
+ return target;
800
+ }
801
+ return;
763
802
  }
764
803
  const targetIsArray = isArray(target);
765
804
  if (!isReadonly2) {
@@ -795,17 +834,19 @@ class MutableReactiveHandler extends BaseReactiveHandler {
795
834
  }
796
835
  set(target, key, value, receiver) {
797
836
  let oldValue = target[key];
798
- if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
799
- return false;
800
- }
801
837
  if (!this._shallow) {
838
+ const isOldValueReadonly = isReadonly(oldValue);
802
839
  if (!isShallow(value) && !isReadonly(value)) {
803
840
  oldValue = toRaw(oldValue);
804
841
  value = toRaw(value);
805
842
  }
806
843
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
807
- oldValue.value = value;
808
- return true;
844
+ if (isOldValueReadonly) {
845
+ return false;
846
+ } else {
847
+ oldValue.value = value;
848
+ return true;
849
+ }
809
850
  }
810
851
  }
811
852
  const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
@@ -1827,13 +1868,16 @@ function queuePostFlushCb(cb) {
1827
1868
  }
1828
1869
  queueFlush();
1829
1870
  }
1830
- function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
1871
+ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
1831
1872
  {
1832
1873
  seen = seen || /* @__PURE__ */ new Map();
1833
1874
  }
1834
1875
  for (; i < queue.length; i++) {
1835
1876
  const cb = queue[i];
1836
1877
  if (cb && cb.pre) {
1878
+ if (instance && cb.id !== instance.uid) {
1879
+ continue;
1880
+ }
1837
1881
  if (checkRecursiveUpdates(seen, cb)) {
1838
1882
  continue;
1839
1883
  }
@@ -3110,9 +3154,17 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
3110
3154
  return false;
3111
3155
  }
3112
3156
  function updateHOCHostEl({ vnode, parent }, el) {
3113
- while (parent && parent.subTree === vnode) {
3114
- (vnode = parent.vnode).el = el;
3115
- parent = parent.parent;
3157
+ while (parent) {
3158
+ const root = parent.subTree;
3159
+ if (root.suspense && root.suspense.activeBranch === vnode) {
3160
+ root.el = vnode.el;
3161
+ }
3162
+ if (root === vnode) {
3163
+ (vnode = parent.vnode).el = el;
3164
+ parent = parent.parent;
3165
+ } else {
3166
+ break;
3167
+ }
3116
3168
  }
3117
3169
  }
3118
3170
 
@@ -3176,6 +3228,7 @@ function resolve(registry, name) {
3176
3228
  }
3177
3229
 
3178
3230
  const isSuspense = (type) => type.__isSuspense;
3231
+ let suspenseId = 0;
3179
3232
  const SuspenseImpl = {
3180
3233
  name: "Suspense",
3181
3234
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -3183,7 +3236,7 @@ const SuspenseImpl = {
3183
3236
  // on a vnode's type and calls the `process` method, passing in renderer
3184
3237
  // internals.
3185
3238
  __isSuspense: true,
3186
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
3239
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
3187
3240
  if (n1 == null) {
3188
3241
  mountSuspense(
3189
3242
  n2,
@@ -3191,7 +3244,7 @@ const SuspenseImpl = {
3191
3244
  anchor,
3192
3245
  parentComponent,
3193
3246
  parentSuspense,
3194
- isSVG,
3247
+ namespace,
3195
3248
  slotScopeIds,
3196
3249
  optimized,
3197
3250
  rendererInternals
@@ -3203,7 +3256,7 @@ const SuspenseImpl = {
3203
3256
  container,
3204
3257
  anchor,
3205
3258
  parentComponent,
3206
- isSVG,
3259
+ namespace,
3207
3260
  slotScopeIds,
3208
3261
  optimized,
3209
3262
  rendererInternals
@@ -3221,7 +3274,7 @@ function triggerEvent(vnode, name) {
3221
3274
  eventListener();
3222
3275
  }
3223
3276
  }
3224
- function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
3277
+ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
3225
3278
  const {
3226
3279
  p: patch,
3227
3280
  o: { createElement }
@@ -3234,7 +3287,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3234
3287
  container,
3235
3288
  hiddenContainer,
3236
3289
  anchor,
3237
- isSVG,
3290
+ namespace,
3238
3291
  slotScopeIds,
3239
3292
  optimized,
3240
3293
  rendererInternals
@@ -3246,7 +3299,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3246
3299
  null,
3247
3300
  parentComponent,
3248
3301
  suspense,
3249
- isSVG,
3302
+ namespace,
3250
3303
  slotScopeIds
3251
3304
  );
3252
3305
  if (suspense.deps > 0) {
@@ -3260,7 +3313,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3260
3313
  parentComponent,
3261
3314
  null,
3262
3315
  // fallback tree will not have suspense context
3263
- isSVG,
3316
+ namespace,
3264
3317
  slotScopeIds
3265
3318
  );
3266
3319
  setActiveBranch(suspense, vnode.ssFallback);
@@ -3268,7 +3321,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3268
3321
  suspense.resolve(false, true);
3269
3322
  }
3270
3323
  }
3271
- function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
3324
+ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
3272
3325
  const suspense = n2.suspense = n1.suspense;
3273
3326
  suspense.vnode = n2;
3274
3327
  n2.el = n1.el;
@@ -3285,29 +3338,31 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3285
3338
  null,
3286
3339
  parentComponent,
3287
3340
  suspense,
3288
- isSVG,
3341
+ namespace,
3289
3342
  slotScopeIds,
3290
3343
  optimized
3291
3344
  );
3292
3345
  if (suspense.deps <= 0) {
3293
3346
  suspense.resolve();
3294
3347
  } else if (isInFallback) {
3295
- patch(
3296
- activeBranch,
3297
- newFallback,
3298
- container,
3299
- anchor,
3300
- parentComponent,
3301
- null,
3302
- // fallback tree will not have suspense context
3303
- isSVG,
3304
- slotScopeIds,
3305
- optimized
3306
- );
3307
- setActiveBranch(suspense, newFallback);
3348
+ if (!isHydrating) {
3349
+ patch(
3350
+ activeBranch,
3351
+ newFallback,
3352
+ container,
3353
+ anchor,
3354
+ parentComponent,
3355
+ null,
3356
+ // fallback tree will not have suspense context
3357
+ namespace,
3358
+ slotScopeIds,
3359
+ optimized
3360
+ );
3361
+ setActiveBranch(suspense, newFallback);
3362
+ }
3308
3363
  }
3309
3364
  } else {
3310
- suspense.pendingId++;
3365
+ suspense.pendingId = suspenseId++;
3311
3366
  if (isHydrating) {
3312
3367
  suspense.isHydrating = false;
3313
3368
  suspense.activeBranch = pendingBranch;
@@ -3325,7 +3380,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3325
3380
  null,
3326
3381
  parentComponent,
3327
3382
  suspense,
3328
- isSVG,
3383
+ namespace,
3329
3384
  slotScopeIds,
3330
3385
  optimized
3331
3386
  );
@@ -3340,7 +3395,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3340
3395
  parentComponent,
3341
3396
  null,
3342
3397
  // fallback tree will not have suspense context
3343
- isSVG,
3398
+ namespace,
3344
3399
  slotScopeIds,
3345
3400
  optimized
3346
3401
  );
@@ -3354,7 +3409,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3354
3409
  anchor,
3355
3410
  parentComponent,
3356
3411
  suspense,
3357
- isSVG,
3412
+ namespace,
3358
3413
  slotScopeIds,
3359
3414
  optimized
3360
3415
  );
@@ -3367,7 +3422,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3367
3422
  null,
3368
3423
  parentComponent,
3369
3424
  suspense,
3370
- isSVG,
3425
+ namespace,
3371
3426
  slotScopeIds,
3372
3427
  optimized
3373
3428
  );
@@ -3385,7 +3440,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3385
3440
  anchor,
3386
3441
  parentComponent,
3387
3442
  suspense,
3388
- isSVG,
3443
+ namespace,
3389
3444
  slotScopeIds,
3390
3445
  optimized
3391
3446
  );
@@ -3393,7 +3448,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3393
3448
  } else {
3394
3449
  triggerEvent(n2, "onPending");
3395
3450
  suspense.pendingBranch = newBranch;
3396
- suspense.pendingId++;
3451
+ if (newBranch.shapeFlag & 512) {
3452
+ suspense.pendingId = newBranch.component.suspenseId;
3453
+ } else {
3454
+ suspense.pendingId = suspenseId++;
3455
+ }
3397
3456
  patch(
3398
3457
  null,
3399
3458
  newBranch,
@@ -3401,7 +3460,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3401
3460
  null,
3402
3461
  parentComponent,
3403
3462
  suspense,
3404
- isSVG,
3463
+ namespace,
3405
3464
  slotScopeIds,
3406
3465
  optimized
3407
3466
  );
@@ -3423,7 +3482,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3423
3482
  }
3424
3483
  }
3425
3484
  let hasWarned = false;
3426
- function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3485
+ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3427
3486
  if (!hasWarned) {
3428
3487
  hasWarned = true;
3429
3488
  console[console.info ? "info" : "log"](
@@ -3453,7 +3512,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3453
3512
  vnode,
3454
3513
  parent: parentSuspense,
3455
3514
  parentComponent,
3456
- isSVG,
3515
+ namespace,
3457
3516
  container,
3458
3517
  hiddenContainer,
3459
3518
  anchor,
@@ -3462,7 +3521,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3462
3521
  timeout: typeof timeout === "number" ? timeout : -1,
3463
3522
  activeBranch: null,
3464
3523
  pendingBranch: null,
3465
- isInFallback: true,
3524
+ isInFallback: !isHydrating,
3466
3525
  isHydrating,
3467
3526
  isUnmounted: false,
3468
3527
  effects: [],
@@ -3546,8 +3605,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3546
3605
  if (!suspense.pendingBranch) {
3547
3606
  return;
3548
3607
  }
3549
- const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
3608
+ const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
3550
3609
  triggerEvent(vnode2, "onFallback");
3610
+ const anchor2 = next(activeBranch);
3551
3611
  const mountFallback = () => {
3552
3612
  if (!suspense.isInFallback) {
3553
3613
  return;
@@ -3556,11 +3616,11 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3556
3616
  null,
3557
3617
  fallbackVNode,
3558
3618
  container2,
3559
- next(activeBranch),
3619
+ anchor2,
3560
3620
  parentComponent2,
3561
3621
  null,
3562
3622
  // fallback tree will not have suspense context
3563
- isSVG2,
3623
+ namespace2,
3564
3624
  slotScopeIds,
3565
3625
  optimized
3566
3626
  );
@@ -3623,7 +3683,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3623
3683
  // consider the comment placeholder case.
3624
3684
  hydratedEl ? null : next(instance.subTree),
3625
3685
  suspense,
3626
- isSVG,
3686
+ namespace,
3627
3687
  optimized
3628
3688
  );
3629
3689
  if (placeholder) {
@@ -3660,7 +3720,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3660
3720
  };
3661
3721
  return suspense;
3662
3722
  }
3663
- function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3723
+ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3664
3724
  const suspense = vnode.suspense = createSuspenseBoundary(
3665
3725
  vnode,
3666
3726
  parentSuspense,
@@ -3668,7 +3728,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
3668
3728
  node.parentNode,
3669
3729
  document.createElement("div"),
3670
3730
  null,
3671
- isSVG,
3731
+ namespace,
3672
3732
  slotScopeIds,
3673
3733
  optimized,
3674
3734
  rendererInternals,
@@ -4610,7 +4670,7 @@ const KeepAliveImpl = {
4610
4670
  }
4611
4671
  } = sharedContext;
4612
4672
  const storageContainer = createElement("div");
4613
- sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
4673
+ sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
4614
4674
  const instance2 = vnode.component;
4615
4675
  move(vnode, container, anchor, 0, parentSuspense);
4616
4676
  patch(
@@ -4620,7 +4680,7 @@ const KeepAliveImpl = {
4620
4680
  anchor,
4621
4681
  instance2,
4622
4682
  parentSuspense,
4623
- isSVG,
4683
+ namespace,
4624
4684
  vnode.slotScopeIds,
4625
4685
  optimized
4626
4686
  );
@@ -5808,7 +5868,7 @@ function useSlots() {
5808
5868
  function useAttrs() {
5809
5869
  return getContext().attrs;
5810
5870
  }
5811
- function useModel(props, name, options) {
5871
+ function useModel(props, name) {
5812
5872
  const i = getCurrentInstance();
5813
5873
  if (!i) {
5814
5874
  warn(`useModel() called without active instance.`);
@@ -5818,29 +5878,24 @@ function useModel(props, name, options) {
5818
5878
  warn(`useModel() called with prop "${name}" which is not declared.`);
5819
5879
  return ref();
5820
5880
  }
5821
- if (options && options.local) {
5822
- const proxy = ref(props[name]);
5823
- watch(
5824
- () => props[name],
5825
- (v) => proxy.value = v
5826
- );
5827
- watch(proxy, (value) => {
5828
- if (value !== props[name]) {
5829
- i.emit(`update:${name}`, value);
5830
- }
5831
- });
5832
- return proxy;
5833
- } else {
5834
- return {
5835
- __v_isRef: true,
5836
- get value() {
5837
- return props[name];
5838
- },
5839
- set value(value) {
5840
- i.emit(`update:${name}`, value);
5881
+ let localValue;
5882
+ watchSyncEffect(() => {
5883
+ localValue = props[name];
5884
+ });
5885
+ return customRef((track, trigger) => ({
5886
+ get() {
5887
+ track();
5888
+ return localValue;
5889
+ },
5890
+ set(value) {
5891
+ const rawProps = i.vnode.props;
5892
+ if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
5893
+ localValue = value;
5894
+ trigger();
5841
5895
  }
5842
- };
5843
- }
5896
+ i.emit(`update:${name}`, value);
5897
+ }
5898
+ }));
5844
5899
  }
5845
5900
  function getContext() {
5846
5901
  const i = getCurrentInstance();
@@ -6414,7 +6469,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6414
6469
  return vm;
6415
6470
  }
6416
6471
  }
6417
- Vue.version = `2.6.14-compat:${"3.4.0-alpha.4"}`;
6472
+ Vue.version = `2.6.14-compat:${"3.4.0-beta.1"}`;
6418
6473
  Vue.config = singletonApp.config;
6419
6474
  Vue.use = (p, ...options) => {
6420
6475
  if (p && isFunction(p.install)) {
@@ -6659,12 +6714,16 @@ function installCompatMount(app, context, render) {
6659
6714
  } else {
6660
6715
  container = selectorOrEl || document.createElement("div");
6661
6716
  }
6662
- const isSVG = container instanceof SVGElement;
6717
+ let namespace;
6718
+ if (container instanceof SVGElement)
6719
+ namespace = "svg";
6720
+ else if (typeof MathMLElement === "function" && container instanceof MathMLElement)
6721
+ namespace = "mathml";
6663
6722
  {
6664
6723
  context.reload = () => {
6665
6724
  const cloned = cloneVNode(vnode);
6666
6725
  cloned.component = null;
6667
- render(cloned, container, isSVG);
6726
+ render(cloned, container, namespace);
6668
6727
  };
6669
6728
  }
6670
6729
  if (hasNoRender && instance.render === emptyRender) {
@@ -6687,7 +6746,7 @@ function installCompatMount(app, context, render) {
6687
6746
  );
6688
6747
  }
6689
6748
  container.innerHTML = "";
6690
- render(vnode, container, isSVG);
6749
+ render(vnode, container, namespace);
6691
6750
  if (container instanceof Element) {
6692
6751
  container.removeAttribute("v-cloak");
6693
6752
  container.setAttribute("data-v-app", "");
@@ -6889,7 +6948,7 @@ function createAppAPI(render, hydrate) {
6889
6948
  context.directives[name] = directive;
6890
6949
  return app;
6891
6950
  },
6892
- mount(rootContainer, isHydrate, isSVG) {
6951
+ mount(rootContainer, isHydrate, namespace) {
6893
6952
  if (!isMounted) {
6894
6953
  if (rootContainer.__vue_app__) {
6895
6954
  warn(
@@ -6899,15 +6958,24 @@ function createAppAPI(render, hydrate) {
6899
6958
  }
6900
6959
  const vnode = createVNode(rootComponent, rootProps);
6901
6960
  vnode.appContext = context;
6961
+ if (namespace === true) {
6962
+ namespace = "svg";
6963
+ } else if (namespace === false) {
6964
+ namespace = void 0;
6965
+ }
6902
6966
  {
6903
6967
  context.reload = () => {
6904
- render(cloneVNode(vnode), rootContainer, isSVG);
6968
+ render(
6969
+ cloneVNode(vnode),
6970
+ rootContainer,
6971
+ namespace
6972
+ );
6905
6973
  };
6906
6974
  }
6907
6975
  if (isHydrate && hydrate) {
6908
6976
  hydrate(vnode, rootContainer);
6909
6977
  } else {
6910
- render(vnode, rootContainer, isSVG);
6978
+ render(vnode, rootContainer, namespace);
6911
6979
  }
6912
6980
  isMounted = true;
6913
6981
  app._container = rootContainer;
@@ -7372,11 +7440,12 @@ function validateProps(rawProps, props, instance) {
7372
7440
  key,
7373
7441
  resolvedValues[key],
7374
7442
  opt,
7443
+ shallowReadonly(resolvedValues) ,
7375
7444
  !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
7376
7445
  );
7377
7446
  }
7378
7447
  }
7379
- function validateProp(name, value, prop, isAbsent) {
7448
+ function validateProp(name, value, prop, props, isAbsent) {
7380
7449
  const { type, required, validator, skipCheck } = prop;
7381
7450
  if (required && isAbsent) {
7382
7451
  warn('Missing required prop: "' + name + '"');
@@ -7399,7 +7468,7 @@ function validateProp(name, value, prop, isAbsent) {
7399
7468
  return;
7400
7469
  }
7401
7470
  }
7402
- if (validator && !validator(value)) {
7471
+ if (validator && !validator(value, props)) {
7403
7472
  warn('Invalid prop: custom validator check failed for prop "' + name + '".');
7404
7473
  }
7405
7474
  }
@@ -7657,7 +7726,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7657
7726
  }
7658
7727
 
7659
7728
  let hasMismatch = false;
7660
- const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== "foreignObject";
7729
+ const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
7730
+ const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
7731
+ const getContainerType = (container) => {
7732
+ if (isSVGContainer(container))
7733
+ return "svg";
7734
+ if (isMathMLContainer(container))
7735
+ return "mathml";
7736
+ return void 0;
7737
+ };
7661
7738
  const isComment = (node) => node.nodeType === 8 /* COMMENT */;
7662
7739
  function createHydrationFunctions(rendererInternals) {
7663
7740
  const {
@@ -7736,11 +7813,13 @@ function createHydrationFunctions(rendererInternals) {
7736
7813
  if (node.data !== vnode.children) {
7737
7814
  hasMismatch = true;
7738
7815
  warn(
7739
- `Hydration text mismatch:
7740
- - Server rendered: ${JSON.stringify(
7816
+ `Hydration text mismatch in`,
7817
+ node.parentNode,
7818
+ `
7819
+ - rendered on server: ${JSON.stringify(
7741
7820
  node.data
7742
7821
  )}
7743
- - Client rendered: ${JSON.stringify(vnode.children)}`
7822
+ - expected on client: ${JSON.stringify(vnode.children)}`
7744
7823
  );
7745
7824
  node.data = vnode.children;
7746
7825
  }
@@ -7826,7 +7905,7 @@ function createHydrationFunctions(rendererInternals) {
7826
7905
  null,
7827
7906
  parentComponent,
7828
7907
  parentSuspense,
7829
- isSVGContainer(container),
7908
+ getContainerType(container),
7830
7909
  optimized
7831
7910
  );
7832
7911
  if (isAsyncWrapper(vnode)) {
@@ -7861,7 +7940,7 @@ function createHydrationFunctions(rendererInternals) {
7861
7940
  vnode,
7862
7941
  parentComponent,
7863
7942
  parentSuspense,
7864
- isSVGContainer(parentNode(node)),
7943
+ getContainerType(parentNode(node)),
7865
7944
  slotScopeIds,
7866
7945
  optimized,
7867
7946
  rendererInternals,
@@ -7884,38 +7963,6 @@ function createHydrationFunctions(rendererInternals) {
7884
7963
  if (dirs) {
7885
7964
  invokeDirectiveHook(vnode, null, parentComponent, "created");
7886
7965
  }
7887
- if (props) {
7888
- if (forcePatch || !optimized || patchFlag & (16 | 32)) {
7889
- for (const key in props) {
7890
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
7891
- key[0] === ".") {
7892
- patchProp(
7893
- el,
7894
- key,
7895
- null,
7896
- props[key],
7897
- false,
7898
- void 0,
7899
- parentComponent
7900
- );
7901
- }
7902
- }
7903
- } else if (props.onClick) {
7904
- patchProp(
7905
- el,
7906
- "onClick",
7907
- null,
7908
- props.onClick,
7909
- false,
7910
- void 0,
7911
- parentComponent
7912
- );
7913
- }
7914
- }
7915
- let vnodeHooks;
7916
- if (vnodeHooks = props && props.onVnodeBeforeMount) {
7917
- invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7918
- }
7919
7966
  let needCallTransitionHooks = false;
7920
7967
  if (isTemplateNode(el)) {
7921
7968
  needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
@@ -7926,16 +7973,6 @@ function createHydrationFunctions(rendererInternals) {
7926
7973
  replaceNode(content, el, parentComponent);
7927
7974
  vnode.el = el = content;
7928
7975
  }
7929
- if (dirs) {
7930
- invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7931
- }
7932
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
7933
- queueEffectWithSuspense(() => {
7934
- vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7935
- needCallTransitionHooks && transition.enter(el);
7936
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7937
- }, parentSuspense);
7938
- }
7939
7976
  if (shapeFlag & 16 && // skip if element has innerHTML / textContent
7940
7977
  !(props && (props.innerHTML || props.textContent))) {
7941
7978
  let next = hydrateChildren(
@@ -7952,7 +7989,10 @@ function createHydrationFunctions(rendererInternals) {
7952
7989
  hasMismatch = true;
7953
7990
  if (!hasWarned) {
7954
7991
  warn(
7955
- `Hydration children mismatch in <${vnode.type}>: server rendered element contains more child nodes than client vdom.`
7992
+ `Hydration children mismatch on`,
7993
+ el,
7994
+ `
7995
+ Server rendered element contains more child nodes than client vdom.`
7956
7996
  );
7957
7997
  hasWarned = true;
7958
7998
  }
@@ -7964,13 +8004,50 @@ function createHydrationFunctions(rendererInternals) {
7964
8004
  if (el.textContent !== vnode.children) {
7965
8005
  hasMismatch = true;
7966
8006
  warn(
7967
- `Hydration text content mismatch in <${vnode.type}>:
7968
- - Server rendered: ${el.textContent}
7969
- - Client rendered: ${vnode.children}`
8007
+ `Hydration text content mismatch on`,
8008
+ el,
8009
+ `
8010
+ - rendered on server: ${el.textContent}
8011
+ - expected on client: ${vnode.children}`
7970
8012
  );
7971
8013
  el.textContent = vnode.children;
7972
8014
  }
7973
8015
  }
8016
+ if (props) {
8017
+ {
8018
+ for (const key in props) {
8019
+ if (propHasMismatch(el, key, props[key])) {
8020
+ hasMismatch = true;
8021
+ }
8022
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
8023
+ key[0] === ".") {
8024
+ patchProp(
8025
+ el,
8026
+ key,
8027
+ null,
8028
+ props[key],
8029
+ void 0,
8030
+ void 0,
8031
+ parentComponent
8032
+ );
8033
+ }
8034
+ }
8035
+ }
8036
+ }
8037
+ let vnodeHooks;
8038
+ if (vnodeHooks = props && props.onVnodeBeforeMount) {
8039
+ invokeVNodeHook(vnodeHooks, parentComponent, vnode);
8040
+ }
8041
+ if (dirs) {
8042
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8043
+ }
8044
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
8045
+ queueEffectWithSuspense(() => {
8046
+ vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
8047
+ needCallTransitionHooks && transition.enter(el);
8048
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
8049
+ }, parentSuspense);
8050
+ }
7974
8051
  }
7975
8052
  return el.nextSibling;
7976
8053
  };
@@ -7996,7 +8073,10 @@ function createHydrationFunctions(rendererInternals) {
7996
8073
  hasMismatch = true;
7997
8074
  if (!hasWarned) {
7998
8075
  warn(
7999
- `Hydration children mismatch in <${container.tagName.toLowerCase()}>: server rendered element contains fewer child nodes than client vdom.`
8076
+ `Hydration children mismatch on`,
8077
+ container,
8078
+ `
8079
+ Server rendered element contains fewer child nodes than client vdom.`
8000
8080
  );
8001
8081
  hasWarned = true;
8002
8082
  }
@@ -8007,7 +8087,7 @@ function createHydrationFunctions(rendererInternals) {
8007
8087
  null,
8008
8088
  parentComponent,
8009
8089
  parentSuspense,
8010
- isSVGContainer(container),
8090
+ getContainerType(container),
8011
8091
  slotScopeIds
8012
8092
  );
8013
8093
  }
@@ -8041,12 +8121,12 @@ function createHydrationFunctions(rendererInternals) {
8041
8121
  hasMismatch = true;
8042
8122
  warn(
8043
8123
  `Hydration node mismatch:
8044
- - Client vnode:`,
8045
- vnode.type,
8046
- `
8047
- - Server rendered DOM:`,
8124
+ - rendered on server:`,
8048
8125
  node,
8049
- node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``
8126
+ node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
8127
+ `
8128
+ - expected on client:`,
8129
+ vnode.type
8050
8130
  );
8051
8131
  vnode.el = null;
8052
8132
  if (isFragment) {
@@ -8070,7 +8150,7 @@ function createHydrationFunctions(rendererInternals) {
8070
8150
  next,
8071
8151
  parentComponent,
8072
8152
  parentSuspense,
8073
- isSVGContainer(container),
8153
+ getContainerType(container),
8074
8154
  slotScopeIds
8075
8155
  );
8076
8156
  return next;
@@ -8111,6 +8191,46 @@ function createHydrationFunctions(rendererInternals) {
8111
8191
  };
8112
8192
  return [hydrate, hydrateNode];
8113
8193
  }
8194
+ function propHasMismatch(el, key, clientValue) {
8195
+ let mismatchType;
8196
+ let mismatchKey;
8197
+ let actual;
8198
+ let expected;
8199
+ if (key === "class") {
8200
+ actual = el.className;
8201
+ expected = normalizeClass(clientValue);
8202
+ if (actual !== expected) {
8203
+ mismatchType = mismatchKey = `class`;
8204
+ }
8205
+ } else if (key === "style") {
8206
+ actual = el.getAttribute("style");
8207
+ expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
8208
+ if (actual !== expected) {
8209
+ mismatchType = mismatchKey = "style";
8210
+ }
8211
+ } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
8212
+ actual = el.hasAttribute(key) && el.getAttribute(key);
8213
+ expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? false : String(clientValue);
8214
+ if (actual !== expected) {
8215
+ mismatchType = `attribute`;
8216
+ mismatchKey = key;
8217
+ }
8218
+ }
8219
+ if (mismatchType) {
8220
+ const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
8221
+ warn(
8222
+ `Hydration ${mismatchType} mismatch on`,
8223
+ el,
8224
+ `
8225
+ - rendered on server: ${format(actual)}
8226
+ - expected on client: ${format(expected)}
8227
+ Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
8228
+ You should fix the source of the mismatch.`
8229
+ );
8230
+ return true;
8231
+ }
8232
+ return false;
8233
+ }
8114
8234
 
8115
8235
  let supported;
8116
8236
  let perf;
@@ -8179,7 +8299,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8179
8299
  setScopeId: hostSetScopeId = NOOP,
8180
8300
  insertStaticContent: hostInsertStaticContent
8181
8301
  } = options;
8182
- const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
8302
+ const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
8183
8303
  if (n1 === n2) {
8184
8304
  return;
8185
8305
  }
@@ -8202,9 +8322,9 @@ function baseCreateRenderer(options, createHydrationFns) {
8202
8322
  break;
8203
8323
  case Static:
8204
8324
  if (n1 == null) {
8205
- mountStaticNode(n2, container, anchor, isSVG);
8325
+ mountStaticNode(n2, container, anchor, namespace);
8206
8326
  } else {
8207
- patchStaticNode(n1, n2, container, isSVG);
8327
+ patchStaticNode(n1, n2, container, namespace);
8208
8328
  }
8209
8329
  break;
8210
8330
  case Fragment:
@@ -8215,7 +8335,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8215
8335
  anchor,
8216
8336
  parentComponent,
8217
8337
  parentSuspense,
8218
- isSVG,
8338
+ namespace,
8219
8339
  slotScopeIds,
8220
8340
  optimized
8221
8341
  );
@@ -8229,7 +8349,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8229
8349
  anchor,
8230
8350
  parentComponent,
8231
8351
  parentSuspense,
8232
- isSVG,
8352
+ namespace,
8233
8353
  slotScopeIds,
8234
8354
  optimized
8235
8355
  );
@@ -8241,7 +8361,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8241
8361
  anchor,
8242
8362
  parentComponent,
8243
8363
  parentSuspense,
8244
- isSVG,
8364
+ namespace,
8245
8365
  slotScopeIds,
8246
8366
  optimized
8247
8367
  );
@@ -8253,7 +8373,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8253
8373
  anchor,
8254
8374
  parentComponent,
8255
8375
  parentSuspense,
8256
- isSVG,
8376
+ namespace,
8257
8377
  slotScopeIds,
8258
8378
  optimized,
8259
8379
  internals
@@ -8266,7 +8386,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8266
8386
  anchor,
8267
8387
  parentComponent,
8268
8388
  parentSuspense,
8269
- isSVG,
8389
+ namespace,
8270
8390
  slotScopeIds,
8271
8391
  optimized,
8272
8392
  internals
@@ -8304,17 +8424,17 @@ function baseCreateRenderer(options, createHydrationFns) {
8304
8424
  n2.el = n1.el;
8305
8425
  }
8306
8426
  };
8307
- const mountStaticNode = (n2, container, anchor, isSVG) => {
8427
+ const mountStaticNode = (n2, container, anchor, namespace) => {
8308
8428
  [n2.el, n2.anchor] = hostInsertStaticContent(
8309
8429
  n2.children,
8310
8430
  container,
8311
8431
  anchor,
8312
- isSVG,
8432
+ namespace,
8313
8433
  n2.el,
8314
8434
  n2.anchor
8315
8435
  );
8316
8436
  };
8317
- const patchStaticNode = (n1, n2, container, isSVG) => {
8437
+ const patchStaticNode = (n1, n2, container, namespace) => {
8318
8438
  if (n2.children !== n1.children) {
8319
8439
  const anchor = hostNextSibling(n1.anchor);
8320
8440
  removeStaticNode(n1);
@@ -8322,7 +8442,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8322
8442
  n2.children,
8323
8443
  container,
8324
8444
  anchor,
8325
- isSVG
8445
+ namespace
8326
8446
  );
8327
8447
  } else {
8328
8448
  n2.el = n1.el;
@@ -8347,8 +8467,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8347
8467
  }
8348
8468
  hostRemove(anchor);
8349
8469
  };
8350
- const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8351
- isSVG = isSVG || n2.type === "svg";
8470
+ const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8471
+ if (n2.type === "svg") {
8472
+ namespace = "svg";
8473
+ } else if (n2.type === "math") {
8474
+ namespace = "mathml";
8475
+ }
8352
8476
  if (n1 == null) {
8353
8477
  mountElement(
8354
8478
  n2,
@@ -8356,7 +8480,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8356
8480
  anchor,
8357
8481
  parentComponent,
8358
8482
  parentSuspense,
8359
- isSVG,
8483
+ namespace,
8360
8484
  slotScopeIds,
8361
8485
  optimized
8362
8486
  );
@@ -8366,19 +8490,19 @@ function baseCreateRenderer(options, createHydrationFns) {
8366
8490
  n2,
8367
8491
  parentComponent,
8368
8492
  parentSuspense,
8369
- isSVG,
8493
+ namespace,
8370
8494
  slotScopeIds,
8371
8495
  optimized
8372
8496
  );
8373
8497
  }
8374
8498
  };
8375
- const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8499
+ const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8376
8500
  let el;
8377
8501
  let vnodeHook;
8378
- const { type, props, shapeFlag, transition, dirs } = vnode;
8502
+ const { props, shapeFlag, transition, dirs } = vnode;
8379
8503
  el = vnode.el = hostCreateElement(
8380
8504
  vnode.type,
8381
- isSVG,
8505
+ namespace,
8382
8506
  props && props.is,
8383
8507
  props
8384
8508
  );
@@ -8391,7 +8515,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8391
8515
  null,
8392
8516
  parentComponent,
8393
8517
  parentSuspense,
8394
- isSVG && type !== "foreignObject",
8518
+ resolveChildrenNamespace(vnode, namespace),
8395
8519
  slotScopeIds,
8396
8520
  optimized
8397
8521
  );
@@ -8408,7 +8532,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8408
8532
  key,
8409
8533
  null,
8410
8534
  props[key],
8411
- isSVG,
8535
+ namespace,
8412
8536
  vnode.children,
8413
8537
  parentComponent,
8414
8538
  parentSuspense,
@@ -8417,7 +8541,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8417
8541
  }
8418
8542
  }
8419
8543
  if ("value" in props) {
8420
- hostPatchProp(el, "value", null, props.value);
8544
+ hostPatchProp(el, "value", null, props.value, namespace);
8421
8545
  }
8422
8546
  if (vnodeHook = props.onVnodeBeforeMount) {
8423
8547
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
@@ -8475,7 +8599,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8475
8599
  }
8476
8600
  }
8477
8601
  };
8478
- const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => {
8602
+ const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
8479
8603
  for (let i = start; i < children.length; i++) {
8480
8604
  const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
8481
8605
  patch(
@@ -8485,13 +8609,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8485
8609
  anchor,
8486
8610
  parentComponent,
8487
8611
  parentSuspense,
8488
- isSVG,
8612
+ namespace,
8489
8613
  slotScopeIds,
8490
8614
  optimized
8491
8615
  );
8492
8616
  }
8493
8617
  };
8494
- const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8618
+ const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8495
8619
  const el = n2.el = n1.el;
8496
8620
  let { patchFlag, dynamicChildren, dirs } = n2;
8497
8621
  patchFlag |= n1.patchFlag & 16;
@@ -8511,7 +8635,6 @@ function baseCreateRenderer(options, createHydrationFns) {
8511
8635
  optimized = false;
8512
8636
  dynamicChildren = null;
8513
8637
  }
8514
- const areChildrenSVG = isSVG && n2.type !== "foreignObject";
8515
8638
  if (dynamicChildren) {
8516
8639
  patchBlockChildren(
8517
8640
  n1.dynamicChildren,
@@ -8519,7 +8642,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8519
8642
  el,
8520
8643
  parentComponent,
8521
8644
  parentSuspense,
8522
- areChildrenSVG,
8645
+ resolveChildrenNamespace(n2, namespace),
8523
8646
  slotScopeIds
8524
8647
  );
8525
8648
  {
@@ -8533,7 +8656,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8533
8656
  null,
8534
8657
  parentComponent,
8535
8658
  parentSuspense,
8536
- areChildrenSVG,
8659
+ resolveChildrenNamespace(n2, namespace),
8537
8660
  slotScopeIds,
8538
8661
  false
8539
8662
  );
@@ -8547,16 +8670,16 @@ function baseCreateRenderer(options, createHydrationFns) {
8547
8670
  newProps,
8548
8671
  parentComponent,
8549
8672
  parentSuspense,
8550
- isSVG
8673
+ namespace
8551
8674
  );
8552
8675
  } else {
8553
8676
  if (patchFlag & 2) {
8554
8677
  if (oldProps.class !== newProps.class) {
8555
- hostPatchProp(el, "class", null, newProps.class, isSVG);
8678
+ hostPatchProp(el, "class", null, newProps.class, namespace);
8556
8679
  }
8557
8680
  }
8558
8681
  if (patchFlag & 4) {
8559
- hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG);
8682
+ hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
8560
8683
  }
8561
8684
  if (patchFlag & 8) {
8562
8685
  const propsToUpdate = n2.dynamicProps;
@@ -8570,7 +8693,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8570
8693
  key,
8571
8694
  prev,
8572
8695
  next,
8573
- isSVG,
8696
+ namespace,
8574
8697
  n1.children,
8575
8698
  parentComponent,
8576
8699
  parentSuspense,
@@ -8593,7 +8716,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8593
8716
  newProps,
8594
8717
  parentComponent,
8595
8718
  parentSuspense,
8596
- isSVG
8719
+ namespace
8597
8720
  );
8598
8721
  }
8599
8722
  if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
@@ -8603,7 +8726,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8603
8726
  }, parentSuspense);
8604
8727
  }
8605
8728
  };
8606
- const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {
8729
+ const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
8607
8730
  for (let i = 0; i < newChildren.length; i++) {
8608
8731
  const oldVNode = oldChildren[i];
8609
8732
  const newVNode = newChildren[i];
@@ -8628,13 +8751,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8628
8751
  null,
8629
8752
  parentComponent,
8630
8753
  parentSuspense,
8631
- isSVG,
8754
+ namespace,
8632
8755
  slotScopeIds,
8633
8756
  true
8634
8757
  );
8635
8758
  }
8636
8759
  };
8637
- const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
8760
+ const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
8638
8761
  if (oldProps !== newProps) {
8639
8762
  if (oldProps !== EMPTY_OBJ) {
8640
8763
  for (const key in oldProps) {
@@ -8644,7 +8767,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8644
8767
  key,
8645
8768
  oldProps[key],
8646
8769
  null,
8647
- isSVG,
8770
+ namespace,
8648
8771
  vnode.children,
8649
8772
  parentComponent,
8650
8773
  parentSuspense,
@@ -8664,7 +8787,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8664
8787
  key,
8665
8788
  prev,
8666
8789
  next,
8667
- isSVG,
8790
+ namespace,
8668
8791
  vnode.children,
8669
8792
  parentComponent,
8670
8793
  parentSuspense,
@@ -8673,11 +8796,11 @@ function baseCreateRenderer(options, createHydrationFns) {
8673
8796
  }
8674
8797
  }
8675
8798
  if ("value" in newProps) {
8676
- hostPatchProp(el, "value", oldProps.value, newProps.value);
8799
+ hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
8677
8800
  }
8678
8801
  }
8679
8802
  };
8680
- const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8803
+ const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8681
8804
  const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
8682
8805
  const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
8683
8806
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
@@ -8701,7 +8824,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8701
8824
  fragmentEndAnchor,
8702
8825
  parentComponent,
8703
8826
  parentSuspense,
8704
- isSVG,
8827
+ namespace,
8705
8828
  slotScopeIds,
8706
8829
  optimized
8707
8830
  );
@@ -8715,7 +8838,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8715
8838
  container,
8716
8839
  parentComponent,
8717
8840
  parentSuspense,
8718
- isSVG,
8841
+ namespace,
8719
8842
  slotScopeIds
8720
8843
  );
8721
8844
  {
@@ -8729,14 +8852,14 @@ function baseCreateRenderer(options, createHydrationFns) {
8729
8852
  fragmentEndAnchor,
8730
8853
  parentComponent,
8731
8854
  parentSuspense,
8732
- isSVG,
8855
+ namespace,
8733
8856
  slotScopeIds,
8734
8857
  optimized
8735
8858
  );
8736
8859
  }
8737
8860
  }
8738
8861
  };
8739
- const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8862
+ const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8740
8863
  n2.slotScopeIds = slotScopeIds;
8741
8864
  if (n1 == null) {
8742
8865
  if (n2.shapeFlag & 512) {
@@ -8744,7 +8867,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8744
8867
  n2,
8745
8868
  container,
8746
8869
  anchor,
8747
- isSVG,
8870
+ namespace,
8748
8871
  optimized
8749
8872
  );
8750
8873
  } else {
@@ -8754,7 +8877,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8754
8877
  anchor,
8755
8878
  parentComponent,
8756
8879
  parentSuspense,
8757
- isSVG,
8880
+ namespace,
8758
8881
  optimized
8759
8882
  );
8760
8883
  }
@@ -8762,7 +8885,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8762
8885
  updateComponent(n1, n2, optimized);
8763
8886
  }
8764
8887
  };
8765
- const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {
8888
+ const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
8766
8889
  const compatMountInstance = initialVNode.isCompatRoot && initialVNode.component;
8767
8890
  const instance = compatMountInstance || (initialVNode.component = createComponentInstance(
8768
8891
  initialVNode,
@@ -8794,17 +8917,17 @@ function baseCreateRenderer(options, createHydrationFns) {
8794
8917
  const placeholder = instance.subTree = createVNode(Comment);
8795
8918
  processCommentNode(null, placeholder, container, anchor);
8796
8919
  }
8797
- return;
8920
+ } else {
8921
+ setupRenderEffect(
8922
+ instance,
8923
+ initialVNode,
8924
+ container,
8925
+ anchor,
8926
+ parentSuspense,
8927
+ namespace,
8928
+ optimized
8929
+ );
8798
8930
  }
8799
- setupRenderEffect(
8800
- instance,
8801
- initialVNode,
8802
- container,
8803
- anchor,
8804
- parentSuspense,
8805
- isSVG,
8806
- optimized
8807
- );
8808
8931
  {
8809
8932
  popWarningContext();
8810
8933
  endMeasure(instance, `mount`);
@@ -8833,7 +8956,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8833
8956
  instance.vnode = n2;
8834
8957
  }
8835
8958
  };
8836
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {
8959
+ const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
8837
8960
  const componentUpdateFn = () => {
8838
8961
  if (!instance.isMounted) {
8839
8962
  let vnodeHook;
@@ -8903,7 +9026,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8903
9026
  anchor,
8904
9027
  instance,
8905
9028
  parentSuspense,
8906
- isSVG
9029
+ namespace
8907
9030
  );
8908
9031
  {
8909
9032
  endMeasure(instance, `patch`);
@@ -8942,6 +9065,21 @@ function baseCreateRenderer(options, createHydrationFns) {
8942
9065
  initialVNode = container = anchor = null;
8943
9066
  } else {
8944
9067
  let { next, bu, u, parent, vnode } = instance;
9068
+ {
9069
+ const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
9070
+ if (nonHydratedAsyncRoot) {
9071
+ if (next) {
9072
+ next.el = vnode.el;
9073
+ updateComponentPreRender(instance, next, optimized);
9074
+ }
9075
+ nonHydratedAsyncRoot.asyncDep.then(() => {
9076
+ if (!instance.isUnmounted) {
9077
+ componentUpdateFn();
9078
+ }
9079
+ });
9080
+ return;
9081
+ }
9082
+ }
8945
9083
  let originNext = next;
8946
9084
  let vnodeHook;
8947
9085
  {
@@ -8985,7 +9123,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8985
9123
  getNextHostNode(prevTree),
8986
9124
  instance,
8987
9125
  parentSuspense,
8988
- isSVG
9126
+ namespace
8989
9127
  );
8990
9128
  {
8991
9129
  endMeasure(instance, `patch`);
@@ -9046,10 +9184,10 @@ function baseCreateRenderer(options, createHydrationFns) {
9046
9184
  updateProps(instance, nextVNode.props, prevProps, optimized);
9047
9185
  updateSlots(instance, nextVNode.children, optimized);
9048
9186
  pauseTracking();
9049
- flushPreFlushCbs();
9187
+ flushPreFlushCbs(instance);
9050
9188
  resetTracking();
9051
9189
  };
9052
- const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
9190
+ const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
9053
9191
  const c1 = n1 && n1.children;
9054
9192
  const prevShapeFlag = n1 ? n1.shapeFlag : 0;
9055
9193
  const c2 = n2.children;
@@ -9063,7 +9201,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9063
9201
  anchor,
9064
9202
  parentComponent,
9065
9203
  parentSuspense,
9066
- isSVG,
9204
+ namespace,
9067
9205
  slotScopeIds,
9068
9206
  optimized
9069
9207
  );
@@ -9076,7 +9214,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9076
9214
  anchor,
9077
9215
  parentComponent,
9078
9216
  parentSuspense,
9079
- isSVG,
9217
+ namespace,
9080
9218
  slotScopeIds,
9081
9219
  optimized
9082
9220
  );
@@ -9100,7 +9238,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9100
9238
  anchor,
9101
9239
  parentComponent,
9102
9240
  parentSuspense,
9103
- isSVG,
9241
+ namespace,
9104
9242
  slotScopeIds,
9105
9243
  optimized
9106
9244
  );
@@ -9118,7 +9256,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9118
9256
  anchor,
9119
9257
  parentComponent,
9120
9258
  parentSuspense,
9121
- isSVG,
9259
+ namespace,
9122
9260
  slotScopeIds,
9123
9261
  optimized
9124
9262
  );
@@ -9126,7 +9264,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9126
9264
  }
9127
9265
  }
9128
9266
  };
9129
- const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
9267
+ const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9130
9268
  c1 = c1 || EMPTY_ARR;
9131
9269
  c2 = c2 || EMPTY_ARR;
9132
9270
  const oldLength = c1.length;
@@ -9142,7 +9280,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9142
9280
  null,
9143
9281
  parentComponent,
9144
9282
  parentSuspense,
9145
- isSVG,
9283
+ namespace,
9146
9284
  slotScopeIds,
9147
9285
  optimized
9148
9286
  );
@@ -9163,14 +9301,14 @@ function baseCreateRenderer(options, createHydrationFns) {
9163
9301
  anchor,
9164
9302
  parentComponent,
9165
9303
  parentSuspense,
9166
- isSVG,
9304
+ namespace,
9167
9305
  slotScopeIds,
9168
9306
  optimized,
9169
9307
  commonLength
9170
9308
  );
9171
9309
  }
9172
9310
  };
9173
- const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
9311
+ const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9174
9312
  let i = 0;
9175
9313
  const l2 = c2.length;
9176
9314
  let e1 = c1.length - 1;
@@ -9186,7 +9324,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9186
9324
  null,
9187
9325
  parentComponent,
9188
9326
  parentSuspense,
9189
- isSVG,
9327
+ namespace,
9190
9328
  slotScopeIds,
9191
9329
  optimized
9192
9330
  );
@@ -9206,7 +9344,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9206
9344
  null,
9207
9345
  parentComponent,
9208
9346
  parentSuspense,
9209
- isSVG,
9347
+ namespace,
9210
9348
  slotScopeIds,
9211
9349
  optimized
9212
9350
  );
@@ -9228,7 +9366,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9228
9366
  anchor,
9229
9367
  parentComponent,
9230
9368
  parentSuspense,
9231
- isSVG,
9369
+ namespace,
9232
9370
  slotScopeIds,
9233
9371
  optimized
9234
9372
  );
@@ -9298,7 +9436,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9298
9436
  null,
9299
9437
  parentComponent,
9300
9438
  parentSuspense,
9301
- isSVG,
9439
+ namespace,
9302
9440
  slotScopeIds,
9303
9441
  optimized
9304
9442
  );
@@ -9319,7 +9457,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9319
9457
  anchor,
9320
9458
  parentComponent,
9321
9459
  parentSuspense,
9322
- isSVG,
9460
+ namespace,
9323
9461
  slotScopeIds,
9324
9462
  optimized
9325
9463
  );
@@ -9549,13 +9687,21 @@ function baseCreateRenderer(options, createHydrationFns) {
9549
9687
  }
9550
9688
  return hostNextSibling(vnode.anchor || vnode.el);
9551
9689
  };
9552
- const render = (vnode, container, isSVG) => {
9690
+ const render = (vnode, container, namespace) => {
9553
9691
  if (vnode == null) {
9554
9692
  if (container._vnode) {
9555
9693
  unmount(container._vnode, null, null, true);
9556
9694
  }
9557
9695
  } else {
9558
- patch(container._vnode || null, vnode, container, null, null, null, isSVG);
9696
+ patch(
9697
+ container._vnode || null,
9698
+ vnode,
9699
+ container,
9700
+ null,
9701
+ null,
9702
+ null,
9703
+ namespace
9704
+ );
9559
9705
  }
9560
9706
  flushPreFlushCbs();
9561
9707
  flushPostFlushCbs();
@@ -9586,6 +9732,9 @@ function baseCreateRenderer(options, createHydrationFns) {
9586
9732
  createApp: createAppAPI(render, hydrate)
9587
9733
  };
9588
9734
  }
9735
+ function resolveChildrenNamespace({ type, props }, currentNamespace) {
9736
+ return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
9737
+ }
9589
9738
  function toggleRecurse({ effect, update }, allowed) {
9590
9739
  effect.allowRecurse = update.allowRecurse = allowed;
9591
9740
  }
@@ -9656,10 +9805,21 @@ function getSequence(arr) {
9656
9805
  }
9657
9806
  return result;
9658
9807
  }
9808
+ function locateNonHydratedAsyncRoot(instance) {
9809
+ const subComponent = instance.subTree.component;
9810
+ if (subComponent) {
9811
+ if (subComponent.asyncDep && !subComponent.asyncResolved) {
9812
+ return subComponent;
9813
+ } else {
9814
+ return locateNonHydratedAsyncRoot(subComponent);
9815
+ }
9816
+ }
9817
+ }
9659
9818
 
9660
9819
  const isTeleport = (type) => type.__isTeleport;
9661
9820
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
9662
9821
  const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
9822
+ const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
9663
9823
  const resolveTarget = (props, select) => {
9664
9824
  const targetSelector = props && props.to;
9665
9825
  if (isString(targetSelector)) {
@@ -9687,7 +9847,7 @@ const resolveTarget = (props, select) => {
9687
9847
  const TeleportImpl = {
9688
9848
  name: "Teleport",
9689
9849
  __isTeleport: true,
9690
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
9850
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
9691
9851
  const {
9692
9852
  mc: mountChildren,
9693
9853
  pc: patchChildren,
@@ -9709,7 +9869,11 @@ const TeleportImpl = {
9709
9869
  const targetAnchor = n2.targetAnchor = createText("");
9710
9870
  if (target) {
9711
9871
  insert(targetAnchor, target);
9712
- isSVG = isSVG || isTargetSVG(target);
9872
+ if (namespace === "svg" || isTargetSVG(target)) {
9873
+ namespace = "svg";
9874
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
9875
+ namespace = "mathml";
9876
+ }
9713
9877
  } else if (!disabled) {
9714
9878
  warn("Invalid Teleport target on mount:", target, `(${typeof target})`);
9715
9879
  }
@@ -9721,7 +9885,7 @@ const TeleportImpl = {
9721
9885
  anchor2,
9722
9886
  parentComponent,
9723
9887
  parentSuspense,
9724
- isSVG,
9888
+ namespace,
9725
9889
  slotScopeIds,
9726
9890
  optimized
9727
9891
  );
@@ -9740,7 +9904,11 @@ const TeleportImpl = {
9740
9904
  const wasDisabled = isTeleportDisabled(n1.props);
9741
9905
  const currentContainer = wasDisabled ? container : target;
9742
9906
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
9743
- isSVG = isSVG || isTargetSVG(target);
9907
+ if (namespace === "svg" || isTargetSVG(target)) {
9908
+ namespace = "svg";
9909
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
9910
+ namespace = "mathml";
9911
+ }
9744
9912
  if (dynamicChildren) {
9745
9913
  patchBlockChildren(
9746
9914
  n1.dynamicChildren,
@@ -9748,7 +9916,7 @@ const TeleportImpl = {
9748
9916
  currentContainer,
9749
9917
  parentComponent,
9750
9918
  parentSuspense,
9751
- isSVG,
9919
+ namespace,
9752
9920
  slotScopeIds
9753
9921
  );
9754
9922
  traverseStaticChildren(n1, n2, true);
@@ -9760,7 +9928,7 @@ const TeleportImpl = {
9760
9928
  currentAnchor,
9761
9929
  parentComponent,
9762
9930
  parentSuspense,
9763
- isSVG,
9931
+ namespace,
9764
9932
  slotScopeIds,
9765
9933
  false
9766
9934
  );
@@ -10444,10 +10612,14 @@ function createComponentInstance(vnode, parent, suspense) {
10444
10612
  let currentInstance = null;
10445
10613
  const getCurrentInstance = () => currentInstance || currentRenderingInstance;
10446
10614
  let internalSetCurrentInstance;
10615
+ let setInSSRSetupState;
10447
10616
  {
10448
10617
  internalSetCurrentInstance = (i) => {
10449
10618
  currentInstance = i;
10450
10619
  };
10620
+ setInSSRSetupState = (v) => {
10621
+ isInSSRComponentSetup = v;
10622
+ };
10451
10623
  }
10452
10624
  const setCurrentInstance = (instance) => {
10453
10625
  internalSetCurrentInstance(instance);
@@ -10471,13 +10643,13 @@ function isStatefulComponent(instance) {
10471
10643
  }
10472
10644
  let isInSSRComponentSetup = false;
10473
10645
  function setupComponent(instance, isSSR = false) {
10474
- isInSSRComponentSetup = isSSR;
10646
+ isSSR && setInSSRSetupState(isSSR);
10475
10647
  const { props, children } = instance.vnode;
10476
10648
  const isStateful = isStatefulComponent(instance);
10477
10649
  initProps(instance, props, isStateful, isSSR);
10478
10650
  initSlots(instance, children);
10479
10651
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
10480
- isInSSRComponentSetup = false;
10652
+ isSSR && setInSSRSetupState(false);
10481
10653
  return setupResult;
10482
10654
  }
10483
10655
  function setupStatefulComponent(instance, isSSR) {
@@ -11001,7 +11173,7 @@ function isMemoSame(cached, memo) {
11001
11173
  return true;
11002
11174
  }
11003
11175
 
11004
- const version = "3.4.0-alpha.4";
11176
+ const version = "3.4.0-beta.1";
11005
11177
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11006
11178
  const ssrUtils = null;
11007
11179
  const resolveFilter = resolveFilter$1 ;
@@ -11016,6 +11188,7 @@ const compatUtils = _compatUtils ;
11016
11188
  const DeprecationTypes = DeprecationTypes$1 ;
11017
11189
 
11018
11190
  const svgNS = "http://www.w3.org/2000/svg";
11191
+ const mathmlNS = "http://www.w3.org/1998/Math/MathML";
11019
11192
  const doc = typeof document !== "undefined" ? document : null;
11020
11193
  const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
11021
11194
  const nodeOps = {
@@ -11028,8 +11201,8 @@ const nodeOps = {
11028
11201
  parent.removeChild(child);
11029
11202
  }
11030
11203
  },
11031
- createElement: (tag, isSVG, is, props) => {
11032
- const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0);
11204
+ createElement: (tag, namespace, is, props) => {
11205
+ const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
11033
11206
  if (tag === "select" && props && props.multiple != null) {
11034
11207
  el.setAttribute("multiple", props.multiple);
11035
11208
  }
@@ -11053,7 +11226,7 @@ const nodeOps = {
11053
11226
  // Reason: innerHTML.
11054
11227
  // Static content here can only come from compiled templates.
11055
11228
  // As long as the user only uses trusted templates, this is safe.
11056
- insertStaticContent(content, parent, anchor, isSVG, start, end) {
11229
+ insertStaticContent(content, parent, anchor, namespace, start, end) {
11057
11230
  const before = anchor ? anchor.previousSibling : parent.lastChild;
11058
11231
  if (start && (start === end || start.nextSibling)) {
11059
11232
  while (true) {
@@ -11062,9 +11235,9 @@ const nodeOps = {
11062
11235
  break;
11063
11236
  }
11064
11237
  } else {
11065
- templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content;
11238
+ templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
11066
11239
  const template = templateContainer.content;
11067
- if (isSVG) {
11240
+ if (namespace === "svg" || namespace === "mathml") {
11068
11241
  const wrapper = template.firstChild;
11069
11242
  while (wrapper.firstChild) {
11070
11243
  template.appendChild(wrapper.firstChild);
@@ -11704,7 +11877,8 @@ function patchStopImmediatePropagation(e, value) {
11704
11877
 
11705
11878
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11706
11879
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
11707
- const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11880
+ const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11881
+ const isSVG = namespace === "svg";
11708
11882
  if (key === "class") {
11709
11883
  patchClass(el, nextValue, isSVG);
11710
11884
  } else if (key === "style") {
@@ -11756,7 +11930,9 @@ function shouldSetAsProp(el, key, value, isSVG) {
11756
11930
  }
11757
11931
  if (key === "width" || key === "height") {
11758
11932
  const tag = el.tagName;
11759
- return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE");
11933
+ if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
11934
+ return false;
11935
+ }
11760
11936
  }
11761
11937
  if (isNativeOn(key) && isString(value)) {
11762
11938
  return false;
@@ -12559,7 +12735,7 @@ const createApp = (...args) => {
12559
12735
  }
12560
12736
  }
12561
12737
  container.innerHTML = "";
12562
- const proxy = mount(container, false, container instanceof SVGElement);
12738
+ const proxy = mount(container, false, resolveRootNamespace(container));
12563
12739
  if (container instanceof Element) {
12564
12740
  container.removeAttribute("v-cloak");
12565
12741
  container.setAttribute("data-v-app", "");
@@ -12578,14 +12754,22 @@ const createSSRApp = (...args) => {
12578
12754
  app.mount = (containerOrSelector) => {
12579
12755
  const container = normalizeContainer(containerOrSelector);
12580
12756
  if (container) {
12581
- return mount(container, true, container instanceof SVGElement);
12757
+ return mount(container, true, resolveRootNamespace(container));
12582
12758
  }
12583
12759
  };
12584
12760
  return app;
12585
12761
  };
12762
+ function resolveRootNamespace(container) {
12763
+ if (container instanceof SVGElement) {
12764
+ return "svg";
12765
+ }
12766
+ if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
12767
+ return "mathml";
12768
+ }
12769
+ }
12586
12770
  function injectNativeTagCheck(app) {
12587
12771
  Object.defineProperty(app.config, "isNativeTag", {
12588
- value: (tag) => isHTMLTag(tag) || isSVGTag(tag),
12772
+ value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
12589
12773
  writable: false
12590
12774
  });
12591
12775
  }
@@ -14003,12 +14187,12 @@ const errorMessages = {
14003
14187
  Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
14004
14188
  [45]: `Error parsing JavaScript expression: `,
14005
14189
  [46]: `<KeepAlive> expects exactly one child component.`,
14006
- [47]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
14190
+ [51]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
14007
14191
  // generic errors
14008
- [48]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
14009
- [49]: `ES module mode is not supported in this build of compiler.`,
14010
- [50]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
14011
- [51]: `"scopeId" option is only supported in module mode.`,
14192
+ [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
14193
+ [48]: `ES module mode is not supported in this build of compiler.`,
14194
+ [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
14195
+ [50]: `"scopeId" option is only supported in module mode.`,
14012
14196
  // just to fulfill types
14013
14197
  [52]: ``
14014
14198
  };
@@ -15271,6 +15455,7 @@ function createTransformContext(root, {
15271
15455
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
15272
15456
  const context = {
15273
15457
  // options
15458
+ filename,
15274
15459
  selfName: nameMatch && capitalize(camelize(nameMatch[1])),
15275
15460
  prefixIdentifiers,
15276
15461
  hoistStatic: hoistStatic2,
@@ -17488,7 +17673,7 @@ const transformOn$1 = (dir, node, context, augmentor) => {
17488
17673
  if (arg.isStatic) {
17489
17674
  let rawName = arg.content;
17490
17675
  if (rawName.startsWith("vnode")) {
17491
- context.onError(createCompilerError(47, arg.loc));
17676
+ context.onError(createCompilerError(51, arg.loc));
17492
17677
  }
17493
17678
  if (rawName.startsWith("vue:")) {
17494
17679
  rawName = `vnode-${rawName.slice(4)}`;
@@ -17969,24 +18154,26 @@ function baseCompile(source, options = {}) {
17969
18154
  const isModuleMode = options.mode === "module";
17970
18155
  {
17971
18156
  if (options.prefixIdentifiers === true) {
17972
- onError(createCompilerError(48));
18157
+ onError(createCompilerError(47));
17973
18158
  } else if (isModuleMode) {
17974
- onError(createCompilerError(49));
18159
+ onError(createCompilerError(48));
17975
18160
  }
17976
18161
  }
17977
18162
  const prefixIdentifiers = false;
17978
18163
  if (options.cacheHandlers) {
17979
- onError(createCompilerError(50));
18164
+ onError(createCompilerError(49));
17980
18165
  }
17981
18166
  if (options.scopeId && !isModuleMode) {
17982
- onError(createCompilerError(51));
18167
+ onError(createCompilerError(50));
17983
18168
  }
17984
- const ast = isString(source) ? baseParse(source, options) : source;
18169
+ const resolvedOptions = extend({}, options, {
18170
+ prefixIdentifiers
18171
+ });
18172
+ const ast = isString(source) ? baseParse(source, resolvedOptions) : source;
17985
18173
  const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
17986
18174
  transform(
17987
18175
  ast,
17988
- extend({}, options, {
17989
- prefixIdentifiers,
18176
+ extend({}, resolvedOptions, {
17990
18177
  nodeTransforms: [
17991
18178
  ...nodeTransforms,
17992
18179
  ...options.nodeTransforms || []
@@ -18000,12 +18187,7 @@ function baseCompile(source, options = {}) {
18000
18187
  )
18001
18188
  })
18002
18189
  );
18003
- return generate(
18004
- ast,
18005
- extend({}, options, {
18006
- prefixIdentifiers
18007
- })
18008
- );
18190
+ return generate(ast, resolvedOptions);
18009
18191
  }
18010
18192
 
18011
18193
  const noopDirectiveTransform = () => ({ props: [] });
@@ -18050,7 +18232,7 @@ function decodeHtmlBrowser(raw, asAttr = false) {
18050
18232
  const parserOptions = {
18051
18233
  parseMode: "html",
18052
18234
  isVoidTag,
18053
- isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag),
18235
+ isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
18054
18236
  isPreTag: (tag) => tag === "pre",
18055
18237
  decodeEntities: decodeHtmlBrowser ,
18056
18238
  isBuiltInComponent: (tag) => {