@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);
@@ -1833,13 +1874,16 @@ function queuePostFlushCb(cb) {
1833
1874
  }
1834
1875
  queueFlush();
1835
1876
  }
1836
- function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
1877
+ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
1837
1878
  if (!!(process.env.NODE_ENV !== "production")) {
1838
1879
  seen = seen || /* @__PURE__ */ new Map();
1839
1880
  }
1840
1881
  for (; i < queue.length; i++) {
1841
1882
  const cb = queue[i];
1842
1883
  if (cb && cb.pre) {
1884
+ if (instance && cb.id !== instance.uid) {
1885
+ continue;
1886
+ }
1843
1887
  if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) {
1844
1888
  continue;
1845
1889
  }
@@ -3119,9 +3163,17 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
3119
3163
  return false;
3120
3164
  }
3121
3165
  function updateHOCHostEl({ vnode, parent }, el) {
3122
- while (parent && parent.subTree === vnode) {
3123
- (vnode = parent.vnode).el = el;
3124
- parent = parent.parent;
3166
+ while (parent) {
3167
+ const root = parent.subTree;
3168
+ if (root.suspense && root.suspense.activeBranch === vnode) {
3169
+ root.el = vnode.el;
3170
+ }
3171
+ if (root === vnode) {
3172
+ (vnode = parent.vnode).el = el;
3173
+ parent = parent.parent;
3174
+ } else {
3175
+ break;
3176
+ }
3125
3177
  }
3126
3178
  }
3127
3179
 
@@ -3185,6 +3237,7 @@ function resolve(registry, name) {
3185
3237
  }
3186
3238
 
3187
3239
  const isSuspense = (type) => type.__isSuspense;
3240
+ let suspenseId = 0;
3188
3241
  const SuspenseImpl = {
3189
3242
  name: "Suspense",
3190
3243
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -3192,7 +3245,7 @@ const SuspenseImpl = {
3192
3245
  // on a vnode's type and calls the `process` method, passing in renderer
3193
3246
  // internals.
3194
3247
  __isSuspense: true,
3195
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
3248
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
3196
3249
  if (n1 == null) {
3197
3250
  mountSuspense(
3198
3251
  n2,
@@ -3200,7 +3253,7 @@ const SuspenseImpl = {
3200
3253
  anchor,
3201
3254
  parentComponent,
3202
3255
  parentSuspense,
3203
- isSVG,
3256
+ namespace,
3204
3257
  slotScopeIds,
3205
3258
  optimized,
3206
3259
  rendererInternals
@@ -3212,7 +3265,7 @@ const SuspenseImpl = {
3212
3265
  container,
3213
3266
  anchor,
3214
3267
  parentComponent,
3215
- isSVG,
3268
+ namespace,
3216
3269
  slotScopeIds,
3217
3270
  optimized,
3218
3271
  rendererInternals
@@ -3230,7 +3283,7 @@ function triggerEvent(vnode, name) {
3230
3283
  eventListener();
3231
3284
  }
3232
3285
  }
3233
- function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
3286
+ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
3234
3287
  const {
3235
3288
  p: patch,
3236
3289
  o: { createElement }
@@ -3243,7 +3296,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3243
3296
  container,
3244
3297
  hiddenContainer,
3245
3298
  anchor,
3246
- isSVG,
3299
+ namespace,
3247
3300
  slotScopeIds,
3248
3301
  optimized,
3249
3302
  rendererInternals
@@ -3255,7 +3308,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3255
3308
  null,
3256
3309
  parentComponent,
3257
3310
  suspense,
3258
- isSVG,
3311
+ namespace,
3259
3312
  slotScopeIds
3260
3313
  );
3261
3314
  if (suspense.deps > 0) {
@@ -3269,7 +3322,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3269
3322
  parentComponent,
3270
3323
  null,
3271
3324
  // fallback tree will not have suspense context
3272
- isSVG,
3325
+ namespace,
3273
3326
  slotScopeIds
3274
3327
  );
3275
3328
  setActiveBranch(suspense, vnode.ssFallback);
@@ -3277,7 +3330,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3277
3330
  suspense.resolve(false, true);
3278
3331
  }
3279
3332
  }
3280
- function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
3333
+ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
3281
3334
  const suspense = n2.suspense = n1.suspense;
3282
3335
  suspense.vnode = n2;
3283
3336
  n2.el = n1.el;
@@ -3294,29 +3347,31 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3294
3347
  null,
3295
3348
  parentComponent,
3296
3349
  suspense,
3297
- isSVG,
3350
+ namespace,
3298
3351
  slotScopeIds,
3299
3352
  optimized
3300
3353
  );
3301
3354
  if (suspense.deps <= 0) {
3302
3355
  suspense.resolve();
3303
3356
  } else if (isInFallback) {
3304
- patch(
3305
- activeBranch,
3306
- newFallback,
3307
- container,
3308
- anchor,
3309
- parentComponent,
3310
- null,
3311
- // fallback tree will not have suspense context
3312
- isSVG,
3313
- slotScopeIds,
3314
- optimized
3315
- );
3316
- setActiveBranch(suspense, newFallback);
3357
+ if (!isHydrating) {
3358
+ patch(
3359
+ activeBranch,
3360
+ newFallback,
3361
+ container,
3362
+ anchor,
3363
+ parentComponent,
3364
+ null,
3365
+ // fallback tree will not have suspense context
3366
+ namespace,
3367
+ slotScopeIds,
3368
+ optimized
3369
+ );
3370
+ setActiveBranch(suspense, newFallback);
3371
+ }
3317
3372
  }
3318
3373
  } else {
3319
- suspense.pendingId++;
3374
+ suspense.pendingId = suspenseId++;
3320
3375
  if (isHydrating) {
3321
3376
  suspense.isHydrating = false;
3322
3377
  suspense.activeBranch = pendingBranch;
@@ -3334,7 +3389,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3334
3389
  null,
3335
3390
  parentComponent,
3336
3391
  suspense,
3337
- isSVG,
3392
+ namespace,
3338
3393
  slotScopeIds,
3339
3394
  optimized
3340
3395
  );
@@ -3349,7 +3404,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3349
3404
  parentComponent,
3350
3405
  null,
3351
3406
  // fallback tree will not have suspense context
3352
- isSVG,
3407
+ namespace,
3353
3408
  slotScopeIds,
3354
3409
  optimized
3355
3410
  );
@@ -3363,7 +3418,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3363
3418
  anchor,
3364
3419
  parentComponent,
3365
3420
  suspense,
3366
- isSVG,
3421
+ namespace,
3367
3422
  slotScopeIds,
3368
3423
  optimized
3369
3424
  );
@@ -3376,7 +3431,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3376
3431
  null,
3377
3432
  parentComponent,
3378
3433
  suspense,
3379
- isSVG,
3434
+ namespace,
3380
3435
  slotScopeIds,
3381
3436
  optimized
3382
3437
  );
@@ -3394,7 +3449,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3394
3449
  anchor,
3395
3450
  parentComponent,
3396
3451
  suspense,
3397
- isSVG,
3452
+ namespace,
3398
3453
  slotScopeIds,
3399
3454
  optimized
3400
3455
  );
@@ -3402,7 +3457,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3402
3457
  } else {
3403
3458
  triggerEvent(n2, "onPending");
3404
3459
  suspense.pendingBranch = newBranch;
3405
- suspense.pendingId++;
3460
+ if (newBranch.shapeFlag & 512) {
3461
+ suspense.pendingId = newBranch.component.suspenseId;
3462
+ } else {
3463
+ suspense.pendingId = suspenseId++;
3464
+ }
3406
3465
  patch(
3407
3466
  null,
3408
3467
  newBranch,
@@ -3410,7 +3469,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3410
3469
  null,
3411
3470
  parentComponent,
3412
3471
  suspense,
3413
- isSVG,
3472
+ namespace,
3414
3473
  slotScopeIds,
3415
3474
  optimized
3416
3475
  );
@@ -3432,7 +3491,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3432
3491
  }
3433
3492
  }
3434
3493
  let hasWarned = false;
3435
- function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3494
+ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3436
3495
  if (!!(process.env.NODE_ENV !== "production") && true && !hasWarned) {
3437
3496
  hasWarned = true;
3438
3497
  console[console.info ? "info" : "log"](
@@ -3462,7 +3521,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3462
3521
  vnode,
3463
3522
  parent: parentSuspense,
3464
3523
  parentComponent,
3465
- isSVG,
3524
+ namespace,
3466
3525
  container,
3467
3526
  hiddenContainer,
3468
3527
  anchor,
@@ -3471,7 +3530,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3471
3530
  timeout: typeof timeout === "number" ? timeout : -1,
3472
3531
  activeBranch: null,
3473
3532
  pendingBranch: null,
3474
- isInFallback: true,
3533
+ isInFallback: !isHydrating,
3475
3534
  isHydrating,
3476
3535
  isUnmounted: false,
3477
3536
  effects: [],
@@ -3555,8 +3614,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3555
3614
  if (!suspense.pendingBranch) {
3556
3615
  return;
3557
3616
  }
3558
- const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
3617
+ const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
3559
3618
  triggerEvent(vnode2, "onFallback");
3619
+ const anchor2 = next(activeBranch);
3560
3620
  const mountFallback = () => {
3561
3621
  if (!suspense.isInFallback) {
3562
3622
  return;
@@ -3565,11 +3625,11 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3565
3625
  null,
3566
3626
  fallbackVNode,
3567
3627
  container2,
3568
- next(activeBranch),
3628
+ anchor2,
3569
3629
  parentComponent2,
3570
3630
  null,
3571
3631
  // fallback tree will not have suspense context
3572
- isSVG2,
3632
+ namespace2,
3573
3633
  slotScopeIds,
3574
3634
  optimized
3575
3635
  );
@@ -3632,7 +3692,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3632
3692
  // consider the comment placeholder case.
3633
3693
  hydratedEl ? null : next(instance.subTree),
3634
3694
  suspense,
3635
- isSVG,
3695
+ namespace,
3636
3696
  optimized
3637
3697
  );
3638
3698
  if (placeholder) {
@@ -3669,7 +3729,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3669
3729
  };
3670
3730
  return suspense;
3671
3731
  }
3672
- function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3732
+ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3673
3733
  const suspense = vnode.suspense = createSuspenseBoundary(
3674
3734
  vnode,
3675
3735
  parentSuspense,
@@ -3677,7 +3737,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
3677
3737
  node.parentNode,
3678
3738
  document.createElement("div"),
3679
3739
  null,
3680
- isSVG,
3740
+ namespace,
3681
3741
  slotScopeIds,
3682
3742
  optimized,
3683
3743
  rendererInternals,
@@ -4648,7 +4708,7 @@ const KeepAliveImpl = {
4648
4708
  }
4649
4709
  } = sharedContext;
4650
4710
  const storageContainer = createElement("div");
4651
- sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
4711
+ sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
4652
4712
  const instance2 = vnode.component;
4653
4713
  move(vnode, container, anchor, 0, parentSuspense);
4654
4714
  patch(
@@ -4658,7 +4718,7 @@ const KeepAliveImpl = {
4658
4718
  anchor,
4659
4719
  instance2,
4660
4720
  parentSuspense,
4661
- isSVG,
4721
+ namespace,
4662
4722
  vnode.slotScopeIds,
4663
4723
  optimized
4664
4724
  );
@@ -5846,7 +5906,7 @@ function useSlots() {
5846
5906
  function useAttrs() {
5847
5907
  return getContext().attrs;
5848
5908
  }
5849
- function useModel(props, name, options) {
5909
+ function useModel(props, name) {
5850
5910
  const i = getCurrentInstance();
5851
5911
  if (!!(process.env.NODE_ENV !== "production") && !i) {
5852
5912
  warn(`useModel() called without active instance.`);
@@ -5856,29 +5916,24 @@ function useModel(props, name, options) {
5856
5916
  warn(`useModel() called with prop "${name}" which is not declared.`);
5857
5917
  return ref();
5858
5918
  }
5859
- if (options && options.local) {
5860
- const proxy = ref(props[name]);
5861
- watch(
5862
- () => props[name],
5863
- (v) => proxy.value = v
5864
- );
5865
- watch(proxy, (value) => {
5866
- if (value !== props[name]) {
5867
- i.emit(`update:${name}`, value);
5868
- }
5869
- });
5870
- return proxy;
5871
- } else {
5872
- return {
5873
- __v_isRef: true,
5874
- get value() {
5875
- return props[name];
5876
- },
5877
- set value(value) {
5878
- i.emit(`update:${name}`, value);
5919
+ let localValue;
5920
+ watchSyncEffect(() => {
5921
+ localValue = props[name];
5922
+ });
5923
+ return customRef((track, trigger) => ({
5924
+ get() {
5925
+ track();
5926
+ return localValue;
5927
+ },
5928
+ set(value) {
5929
+ const rawProps = i.vnode.props;
5930
+ if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
5931
+ localValue = value;
5932
+ trigger();
5879
5933
  }
5880
- };
5881
- }
5934
+ i.emit(`update:${name}`, value);
5935
+ }
5936
+ }));
5882
5937
  }
5883
5938
  function getContext() {
5884
5939
  const i = getCurrentInstance();
@@ -6454,7 +6509,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6454
6509
  return vm;
6455
6510
  }
6456
6511
  }
6457
- Vue.version = `2.6.14-compat:${"3.4.0-alpha.4"}`;
6512
+ Vue.version = `2.6.14-compat:${"3.4.0-beta.1"}`;
6458
6513
  Vue.config = singletonApp.config;
6459
6514
  Vue.use = (p, ...options) => {
6460
6515
  if (p && isFunction(p.install)) {
@@ -6700,12 +6755,16 @@ function installCompatMount(app, context, render) {
6700
6755
  } else {
6701
6756
  container = selectorOrEl || document.createElement("div");
6702
6757
  }
6703
- const isSVG = container instanceof SVGElement;
6758
+ let namespace;
6759
+ if (container instanceof SVGElement)
6760
+ namespace = "svg";
6761
+ else if (typeof MathMLElement === "function" && container instanceof MathMLElement)
6762
+ namespace = "mathml";
6704
6763
  if (!!(process.env.NODE_ENV !== "production")) {
6705
6764
  context.reload = () => {
6706
6765
  const cloned = cloneVNode(vnode);
6707
6766
  cloned.component = null;
6708
- render(cloned, container, isSVG);
6767
+ render(cloned, container, namespace);
6709
6768
  };
6710
6769
  }
6711
6770
  if (hasNoRender && instance.render === emptyRender) {
@@ -6728,7 +6787,7 @@ function installCompatMount(app, context, render) {
6728
6787
  );
6729
6788
  }
6730
6789
  container.innerHTML = "";
6731
- render(vnode, container, isSVG);
6790
+ render(vnode, container, namespace);
6732
6791
  if (container instanceof Element) {
6733
6792
  container.removeAttribute("v-cloak");
6734
6793
  container.setAttribute("data-v-app", "");
@@ -6932,7 +6991,7 @@ function createAppAPI(render, hydrate) {
6932
6991
  context.directives[name] = directive;
6933
6992
  return app;
6934
6993
  },
6935
- mount(rootContainer, isHydrate, isSVG) {
6994
+ mount(rootContainer, isHydrate, namespace) {
6936
6995
  if (!isMounted) {
6937
6996
  if (!!(process.env.NODE_ENV !== "production") && rootContainer.__vue_app__) {
6938
6997
  warn(
@@ -6942,15 +7001,24 @@ function createAppAPI(render, hydrate) {
6942
7001
  }
6943
7002
  const vnode = createVNode(rootComponent, rootProps);
6944
7003
  vnode.appContext = context;
7004
+ if (namespace === true) {
7005
+ namespace = "svg";
7006
+ } else if (namespace === false) {
7007
+ namespace = void 0;
7008
+ }
6945
7009
  if (!!(process.env.NODE_ENV !== "production")) {
6946
7010
  context.reload = () => {
6947
- render(cloneVNode(vnode), rootContainer, isSVG);
7011
+ render(
7012
+ cloneVNode(vnode),
7013
+ rootContainer,
7014
+ namespace
7015
+ );
6948
7016
  };
6949
7017
  }
6950
7018
  if (isHydrate && hydrate) {
6951
7019
  hydrate(vnode, rootContainer);
6952
7020
  } else {
6953
- render(vnode, rootContainer, isSVG);
7021
+ render(vnode, rootContainer, namespace);
6954
7022
  }
6955
7023
  isMounted = true;
6956
7024
  app._container = rootContainer;
@@ -7415,11 +7483,12 @@ function validateProps(rawProps, props, instance) {
7415
7483
  key,
7416
7484
  resolvedValues[key],
7417
7485
  opt,
7486
+ !!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues,
7418
7487
  !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
7419
7488
  );
7420
7489
  }
7421
7490
  }
7422
- function validateProp(name, value, prop, isAbsent) {
7491
+ function validateProp(name, value, prop, props, isAbsent) {
7423
7492
  const { type, required, validator, skipCheck } = prop;
7424
7493
  if (required && isAbsent) {
7425
7494
  warn('Missing required prop: "' + name + '"');
@@ -7442,7 +7511,7 @@ function validateProp(name, value, prop, isAbsent) {
7442
7511
  return;
7443
7512
  }
7444
7513
  }
7445
- if (validator && !validator(value)) {
7514
+ if (validator && !validator(value, props)) {
7446
7515
  warn('Invalid prop: custom validator check failed for prop "' + name + '".');
7447
7516
  }
7448
7517
  }
@@ -7700,7 +7769,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7700
7769
  }
7701
7770
 
7702
7771
  let hasMismatch = false;
7703
- const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== "foreignObject";
7772
+ const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
7773
+ const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
7774
+ const getContainerType = (container) => {
7775
+ if (isSVGContainer(container))
7776
+ return "svg";
7777
+ if (isMathMLContainer(container))
7778
+ return "mathml";
7779
+ return void 0;
7780
+ };
7704
7781
  const isComment = (node) => node.nodeType === 8 /* COMMENT */;
7705
7782
  function createHydrationFunctions(rendererInternals) {
7706
7783
  const {
@@ -7718,7 +7795,7 @@ function createHydrationFunctions(rendererInternals) {
7718
7795
  } = rendererInternals;
7719
7796
  const hydrate = (vnode, container) => {
7720
7797
  if (!container.hasChildNodes()) {
7721
- !!(process.env.NODE_ENV !== "production") && warn(
7798
+ (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn(
7722
7799
  `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
7723
7800
  );
7724
7801
  patch(null, vnode, container);
@@ -7778,12 +7855,14 @@ function createHydrationFunctions(rendererInternals) {
7778
7855
  } else {
7779
7856
  if (node.data !== vnode.children) {
7780
7857
  hasMismatch = true;
7781
- !!(process.env.NODE_ENV !== "production") && warn(
7782
- `Hydration text mismatch:
7783
- - Server rendered: ${JSON.stringify(
7858
+ (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn(
7859
+ `Hydration text mismatch in`,
7860
+ node.parentNode,
7861
+ `
7862
+ - rendered on server: ${JSON.stringify(
7784
7863
  node.data
7785
7864
  )}
7786
- - Client rendered: ${JSON.stringify(vnode.children)}`
7865
+ - expected on client: ${JSON.stringify(vnode.children)}`
7787
7866
  );
7788
7867
  node.data = vnode.children;
7789
7868
  }
@@ -7869,7 +7948,7 @@ function createHydrationFunctions(rendererInternals) {
7869
7948
  null,
7870
7949
  parentComponent,
7871
7950
  parentSuspense,
7872
- isSVGContainer(container),
7951
+ getContainerType(container),
7873
7952
  optimized
7874
7953
  );
7875
7954
  if (isAsyncWrapper(vnode)) {
@@ -7904,13 +7983,13 @@ function createHydrationFunctions(rendererInternals) {
7904
7983
  vnode,
7905
7984
  parentComponent,
7906
7985
  parentSuspense,
7907
- isSVGContainer(parentNode(node)),
7986
+ getContainerType(parentNode(node)),
7908
7987
  slotScopeIds,
7909
7988
  optimized,
7910
7989
  rendererInternals,
7911
7990
  hydrateNode
7912
7991
  );
7913
- } else if (!!(process.env.NODE_ENV !== "production")) {
7992
+ } else if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) {
7914
7993
  warn("Invalid HostVNode type:", type, `(${typeof type})`);
7915
7994
  }
7916
7995
  }
@@ -7927,38 +8006,6 @@ function createHydrationFunctions(rendererInternals) {
7927
8006
  if (dirs) {
7928
8007
  invokeDirectiveHook(vnode, null, parentComponent, "created");
7929
8008
  }
7930
- if (props) {
7931
- if (forcePatch || !optimized || patchFlag & (16 | 32)) {
7932
- for (const key in props) {
7933
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
7934
- key[0] === ".") {
7935
- patchProp(
7936
- el,
7937
- key,
7938
- null,
7939
- props[key],
7940
- false,
7941
- void 0,
7942
- parentComponent
7943
- );
7944
- }
7945
- }
7946
- } else if (props.onClick) {
7947
- patchProp(
7948
- el,
7949
- "onClick",
7950
- null,
7951
- props.onClick,
7952
- false,
7953
- void 0,
7954
- parentComponent
7955
- );
7956
- }
7957
- }
7958
- let vnodeHooks;
7959
- if (vnodeHooks = props && props.onVnodeBeforeMount) {
7960
- invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7961
- }
7962
8009
  let needCallTransitionHooks = false;
7963
8010
  if (isTemplateNode(el)) {
7964
8011
  needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
@@ -7969,16 +8016,6 @@ function createHydrationFunctions(rendererInternals) {
7969
8016
  replaceNode(content, el, parentComponent);
7970
8017
  vnode.el = el = content;
7971
8018
  }
7972
- if (dirs) {
7973
- invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7974
- }
7975
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
7976
- queueEffectWithSuspense(() => {
7977
- vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7978
- needCallTransitionHooks && transition.enter(el);
7979
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7980
- }, parentSuspense);
7981
- }
7982
8019
  if (shapeFlag & 16 && // skip if element has innerHTML / textContent
7983
8020
  !(props && (props.innerHTML || props.textContent))) {
7984
8021
  let next = hydrateChildren(
@@ -7993,9 +8030,12 @@ function createHydrationFunctions(rendererInternals) {
7993
8030
  let hasWarned = false;
7994
8031
  while (next) {
7995
8032
  hasMismatch = true;
7996
- if (!!(process.env.NODE_ENV !== "production") && !hasWarned) {
8033
+ if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
7997
8034
  warn(
7998
- `Hydration children mismatch in <${vnode.type}>: server rendered element contains more child nodes than client vdom.`
8035
+ `Hydration children mismatch on`,
8036
+ el,
8037
+ `
8038
+ Server rendered element contains more child nodes than client vdom.`
7999
8039
  );
8000
8040
  hasWarned = true;
8001
8041
  }
@@ -8006,14 +8046,61 @@ function createHydrationFunctions(rendererInternals) {
8006
8046
  } else if (shapeFlag & 8) {
8007
8047
  if (el.textContent !== vnode.children) {
8008
8048
  hasMismatch = true;
8009
- !!(process.env.NODE_ENV !== "production") && warn(
8010
- `Hydration text content mismatch in <${vnode.type}>:
8011
- - Server rendered: ${el.textContent}
8012
- - Client rendered: ${vnode.children}`
8049
+ (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn(
8050
+ `Hydration text content mismatch on`,
8051
+ el,
8052
+ `
8053
+ - rendered on server: ${el.textContent}
8054
+ - expected on client: ${vnode.children}`
8013
8055
  );
8014
8056
  el.textContent = vnode.children;
8015
8057
  }
8016
8058
  }
8059
+ if (props) {
8060
+ if (!!(process.env.NODE_ENV !== "production") || forcePatch || !optimized || patchFlag & (16 | 32)) {
8061
+ for (const key in props) {
8062
+ if (!!(process.env.NODE_ENV !== "production") && propHasMismatch(el, key, props[key])) {
8063
+ hasMismatch = true;
8064
+ }
8065
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
8066
+ key[0] === ".") {
8067
+ patchProp(
8068
+ el,
8069
+ key,
8070
+ null,
8071
+ props[key],
8072
+ void 0,
8073
+ void 0,
8074
+ parentComponent
8075
+ );
8076
+ }
8077
+ }
8078
+ } else if (props.onClick) {
8079
+ patchProp(
8080
+ el,
8081
+ "onClick",
8082
+ null,
8083
+ props.onClick,
8084
+ void 0,
8085
+ void 0,
8086
+ parentComponent
8087
+ );
8088
+ }
8089
+ }
8090
+ let vnodeHooks;
8091
+ if (vnodeHooks = props && props.onVnodeBeforeMount) {
8092
+ invokeVNodeHook(vnodeHooks, parentComponent, vnode);
8093
+ }
8094
+ if (dirs) {
8095
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8096
+ }
8097
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
8098
+ queueEffectWithSuspense(() => {
8099
+ vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
8100
+ needCallTransitionHooks && transition.enter(el);
8101
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
8102
+ }, parentSuspense);
8103
+ }
8017
8104
  }
8018
8105
  return el.nextSibling;
8019
8106
  };
@@ -8037,9 +8124,12 @@ function createHydrationFunctions(rendererInternals) {
8037
8124
  continue;
8038
8125
  } else {
8039
8126
  hasMismatch = true;
8040
- if (!!(process.env.NODE_ENV !== "production") && !hasWarned) {
8127
+ if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
8041
8128
  warn(
8042
- `Hydration children mismatch in <${container.tagName.toLowerCase()}>: server rendered element contains fewer child nodes than client vdom.`
8129
+ `Hydration children mismatch on`,
8130
+ container,
8131
+ `
8132
+ Server rendered element contains fewer child nodes than client vdom.`
8043
8133
  );
8044
8134
  hasWarned = true;
8045
8135
  }
@@ -8050,7 +8140,7 @@ function createHydrationFunctions(rendererInternals) {
8050
8140
  null,
8051
8141
  parentComponent,
8052
8142
  parentSuspense,
8053
- isSVGContainer(container),
8143
+ getContainerType(container),
8054
8144
  slotScopeIds
8055
8145
  );
8056
8146
  }
@@ -8082,14 +8172,14 @@ function createHydrationFunctions(rendererInternals) {
8082
8172
  };
8083
8173
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
8084
8174
  hasMismatch = true;
8085
- !!(process.env.NODE_ENV !== "production") && warn(
8175
+ (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn(
8086
8176
  `Hydration node mismatch:
8087
- - Client vnode:`,
8088
- vnode.type,
8089
- `
8090
- - Server rendered DOM:`,
8177
+ - rendered on server:`,
8091
8178
  node,
8092
- node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``
8179
+ node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
8180
+ `
8181
+ - expected on client:`,
8182
+ vnode.type
8093
8183
  );
8094
8184
  vnode.el = null;
8095
8185
  if (isFragment) {
@@ -8113,7 +8203,7 @@ function createHydrationFunctions(rendererInternals) {
8113
8203
  next,
8114
8204
  parentComponent,
8115
8205
  parentSuspense,
8116
- isSVGContainer(container),
8206
+ getContainerType(container),
8117
8207
  slotScopeIds
8118
8208
  );
8119
8209
  return next;
@@ -8154,6 +8244,46 @@ function createHydrationFunctions(rendererInternals) {
8154
8244
  };
8155
8245
  return [hydrate, hydrateNode];
8156
8246
  }
8247
+ function propHasMismatch(el, key, clientValue) {
8248
+ let mismatchType;
8249
+ let mismatchKey;
8250
+ let actual;
8251
+ let expected;
8252
+ if (key === "class") {
8253
+ actual = el.className;
8254
+ expected = normalizeClass(clientValue);
8255
+ if (actual !== expected) {
8256
+ mismatchType = mismatchKey = `class`;
8257
+ }
8258
+ } else if (key === "style") {
8259
+ actual = el.getAttribute("style");
8260
+ expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
8261
+ if (actual !== expected) {
8262
+ mismatchType = mismatchKey = "style";
8263
+ }
8264
+ } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
8265
+ actual = el.hasAttribute(key) && el.getAttribute(key);
8266
+ expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? false : String(clientValue);
8267
+ if (actual !== expected) {
8268
+ mismatchType = `attribute`;
8269
+ mismatchKey = key;
8270
+ }
8271
+ }
8272
+ if (mismatchType) {
8273
+ const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
8274
+ warn(
8275
+ `Hydration ${mismatchType} mismatch on`,
8276
+ el,
8277
+ `
8278
+ - rendered on server: ${format(actual)}
8279
+ - expected on client: ${format(expected)}
8280
+ Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
8281
+ You should fix the source of the mismatch.`
8282
+ );
8283
+ return true;
8284
+ }
8285
+ return false;
8286
+ }
8157
8287
 
8158
8288
  let supported;
8159
8289
  let perf;
@@ -8205,6 +8335,10 @@ function initFeatureFlags() {
8205
8335
  !!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_PROD_DEVTOOLS__`);
8206
8336
  getGlobalThis().__VUE_PROD_DEVTOOLS__ = false;
8207
8337
  }
8338
+ if (typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ !== "boolean") {
8339
+ !!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`);
8340
+ getGlobalThis().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;
8341
+ }
8208
8342
  if (!!(process.env.NODE_ENV !== "production") && needWarn.length) {
8209
8343
  const multi = needWarn.length > 1;
8210
8344
  console.warn(
@@ -8245,7 +8379,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8245
8379
  setScopeId: hostSetScopeId = NOOP,
8246
8380
  insertStaticContent: hostInsertStaticContent
8247
8381
  } = options;
8248
- const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = !!(process.env.NODE_ENV !== "production") && isHmrUpdating ? false : !!n2.dynamicChildren) => {
8382
+ const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!(process.env.NODE_ENV !== "production") && isHmrUpdating ? false : !!n2.dynamicChildren) => {
8249
8383
  if (n1 === n2) {
8250
8384
  return;
8251
8385
  }
@@ -8268,9 +8402,9 @@ function baseCreateRenderer(options, createHydrationFns) {
8268
8402
  break;
8269
8403
  case Static:
8270
8404
  if (n1 == null) {
8271
- mountStaticNode(n2, container, anchor, isSVG);
8405
+ mountStaticNode(n2, container, anchor, namespace);
8272
8406
  } else if (!!(process.env.NODE_ENV !== "production")) {
8273
- patchStaticNode(n1, n2, container, isSVG);
8407
+ patchStaticNode(n1, n2, container, namespace);
8274
8408
  }
8275
8409
  break;
8276
8410
  case Fragment:
@@ -8281,7 +8415,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8281
8415
  anchor,
8282
8416
  parentComponent,
8283
8417
  parentSuspense,
8284
- isSVG,
8418
+ namespace,
8285
8419
  slotScopeIds,
8286
8420
  optimized
8287
8421
  );
@@ -8295,7 +8429,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8295
8429
  anchor,
8296
8430
  parentComponent,
8297
8431
  parentSuspense,
8298
- isSVG,
8432
+ namespace,
8299
8433
  slotScopeIds,
8300
8434
  optimized
8301
8435
  );
@@ -8307,7 +8441,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8307
8441
  anchor,
8308
8442
  parentComponent,
8309
8443
  parentSuspense,
8310
- isSVG,
8444
+ namespace,
8311
8445
  slotScopeIds,
8312
8446
  optimized
8313
8447
  );
@@ -8319,7 +8453,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8319
8453
  anchor,
8320
8454
  parentComponent,
8321
8455
  parentSuspense,
8322
- isSVG,
8456
+ namespace,
8323
8457
  slotScopeIds,
8324
8458
  optimized,
8325
8459
  internals
@@ -8332,7 +8466,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8332
8466
  anchor,
8333
8467
  parentComponent,
8334
8468
  parentSuspense,
8335
- isSVG,
8469
+ namespace,
8336
8470
  slotScopeIds,
8337
8471
  optimized,
8338
8472
  internals
@@ -8370,17 +8504,17 @@ function baseCreateRenderer(options, createHydrationFns) {
8370
8504
  n2.el = n1.el;
8371
8505
  }
8372
8506
  };
8373
- const mountStaticNode = (n2, container, anchor, isSVG) => {
8507
+ const mountStaticNode = (n2, container, anchor, namespace) => {
8374
8508
  [n2.el, n2.anchor] = hostInsertStaticContent(
8375
8509
  n2.children,
8376
8510
  container,
8377
8511
  anchor,
8378
- isSVG,
8512
+ namespace,
8379
8513
  n2.el,
8380
8514
  n2.anchor
8381
8515
  );
8382
8516
  };
8383
- const patchStaticNode = (n1, n2, container, isSVG) => {
8517
+ const patchStaticNode = (n1, n2, container, namespace) => {
8384
8518
  if (n2.children !== n1.children) {
8385
8519
  const anchor = hostNextSibling(n1.anchor);
8386
8520
  removeStaticNode(n1);
@@ -8388,7 +8522,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8388
8522
  n2.children,
8389
8523
  container,
8390
8524
  anchor,
8391
- isSVG
8525
+ namespace
8392
8526
  );
8393
8527
  } else {
8394
8528
  n2.el = n1.el;
@@ -8413,8 +8547,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8413
8547
  }
8414
8548
  hostRemove(anchor);
8415
8549
  };
8416
- const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8417
- isSVG = isSVG || n2.type === "svg";
8550
+ const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8551
+ if (n2.type === "svg") {
8552
+ namespace = "svg";
8553
+ } else if (n2.type === "math") {
8554
+ namespace = "mathml";
8555
+ }
8418
8556
  if (n1 == null) {
8419
8557
  mountElement(
8420
8558
  n2,
@@ -8422,7 +8560,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8422
8560
  anchor,
8423
8561
  parentComponent,
8424
8562
  parentSuspense,
8425
- isSVG,
8563
+ namespace,
8426
8564
  slotScopeIds,
8427
8565
  optimized
8428
8566
  );
@@ -8432,19 +8570,19 @@ function baseCreateRenderer(options, createHydrationFns) {
8432
8570
  n2,
8433
8571
  parentComponent,
8434
8572
  parentSuspense,
8435
- isSVG,
8573
+ namespace,
8436
8574
  slotScopeIds,
8437
8575
  optimized
8438
8576
  );
8439
8577
  }
8440
8578
  };
8441
- const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8579
+ const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8442
8580
  let el;
8443
8581
  let vnodeHook;
8444
- const { type, props, shapeFlag, transition, dirs } = vnode;
8582
+ const { props, shapeFlag, transition, dirs } = vnode;
8445
8583
  el = vnode.el = hostCreateElement(
8446
8584
  vnode.type,
8447
- isSVG,
8585
+ namespace,
8448
8586
  props && props.is,
8449
8587
  props
8450
8588
  );
@@ -8457,7 +8595,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8457
8595
  null,
8458
8596
  parentComponent,
8459
8597
  parentSuspense,
8460
- isSVG && type !== "foreignObject",
8598
+ resolveChildrenNamespace(vnode, namespace),
8461
8599
  slotScopeIds,
8462
8600
  optimized
8463
8601
  );
@@ -8474,7 +8612,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8474
8612
  key,
8475
8613
  null,
8476
8614
  props[key],
8477
- isSVG,
8615
+ namespace,
8478
8616
  vnode.children,
8479
8617
  parentComponent,
8480
8618
  parentSuspense,
@@ -8483,7 +8621,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8483
8621
  }
8484
8622
  }
8485
8623
  if ("value" in props) {
8486
- hostPatchProp(el, "value", null, props.value);
8624
+ hostPatchProp(el, "value", null, props.value, namespace);
8487
8625
  }
8488
8626
  if (vnodeHook = props.onVnodeBeforeMount) {
8489
8627
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
@@ -8541,7 +8679,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8541
8679
  }
8542
8680
  }
8543
8681
  };
8544
- const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => {
8682
+ const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
8545
8683
  for (let i = start; i < children.length; i++) {
8546
8684
  const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
8547
8685
  patch(
@@ -8551,13 +8689,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8551
8689
  anchor,
8552
8690
  parentComponent,
8553
8691
  parentSuspense,
8554
- isSVG,
8692
+ namespace,
8555
8693
  slotScopeIds,
8556
8694
  optimized
8557
8695
  );
8558
8696
  }
8559
8697
  };
8560
- const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8698
+ const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8561
8699
  const el = n2.el = n1.el;
8562
8700
  let { patchFlag, dynamicChildren, dirs } = n2;
8563
8701
  patchFlag |= n1.patchFlag & 16;
@@ -8577,7 +8715,6 @@ function baseCreateRenderer(options, createHydrationFns) {
8577
8715
  optimized = false;
8578
8716
  dynamicChildren = null;
8579
8717
  }
8580
- const areChildrenSVG = isSVG && n2.type !== "foreignObject";
8581
8718
  if (dynamicChildren) {
8582
8719
  patchBlockChildren(
8583
8720
  n1.dynamicChildren,
@@ -8585,7 +8722,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8585
8722
  el,
8586
8723
  parentComponent,
8587
8724
  parentSuspense,
8588
- areChildrenSVG,
8725
+ resolveChildrenNamespace(n2, namespace),
8589
8726
  slotScopeIds
8590
8727
  );
8591
8728
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -8599,7 +8736,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8599
8736
  null,
8600
8737
  parentComponent,
8601
8738
  parentSuspense,
8602
- areChildrenSVG,
8739
+ resolveChildrenNamespace(n2, namespace),
8603
8740
  slotScopeIds,
8604
8741
  false
8605
8742
  );
@@ -8613,16 +8750,16 @@ function baseCreateRenderer(options, createHydrationFns) {
8613
8750
  newProps,
8614
8751
  parentComponent,
8615
8752
  parentSuspense,
8616
- isSVG
8753
+ namespace
8617
8754
  );
8618
8755
  } else {
8619
8756
  if (patchFlag & 2) {
8620
8757
  if (oldProps.class !== newProps.class) {
8621
- hostPatchProp(el, "class", null, newProps.class, isSVG);
8758
+ hostPatchProp(el, "class", null, newProps.class, namespace);
8622
8759
  }
8623
8760
  }
8624
8761
  if (patchFlag & 4) {
8625
- hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG);
8762
+ hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
8626
8763
  }
8627
8764
  if (patchFlag & 8) {
8628
8765
  const propsToUpdate = n2.dynamicProps;
@@ -8636,7 +8773,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8636
8773
  key,
8637
8774
  prev,
8638
8775
  next,
8639
- isSVG,
8776
+ namespace,
8640
8777
  n1.children,
8641
8778
  parentComponent,
8642
8779
  parentSuspense,
@@ -8659,7 +8796,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8659
8796
  newProps,
8660
8797
  parentComponent,
8661
8798
  parentSuspense,
8662
- isSVG
8799
+ namespace
8663
8800
  );
8664
8801
  }
8665
8802
  if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
@@ -8669,7 +8806,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8669
8806
  }, parentSuspense);
8670
8807
  }
8671
8808
  };
8672
- const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {
8809
+ const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
8673
8810
  for (let i = 0; i < newChildren.length; i++) {
8674
8811
  const oldVNode = oldChildren[i];
8675
8812
  const newVNode = newChildren[i];
@@ -8694,13 +8831,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8694
8831
  null,
8695
8832
  parentComponent,
8696
8833
  parentSuspense,
8697
- isSVG,
8834
+ namespace,
8698
8835
  slotScopeIds,
8699
8836
  true
8700
8837
  );
8701
8838
  }
8702
8839
  };
8703
- const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
8840
+ const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
8704
8841
  if (oldProps !== newProps) {
8705
8842
  if (oldProps !== EMPTY_OBJ) {
8706
8843
  for (const key in oldProps) {
@@ -8710,7 +8847,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8710
8847
  key,
8711
8848
  oldProps[key],
8712
8849
  null,
8713
- isSVG,
8850
+ namespace,
8714
8851
  vnode.children,
8715
8852
  parentComponent,
8716
8853
  parentSuspense,
@@ -8730,7 +8867,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8730
8867
  key,
8731
8868
  prev,
8732
8869
  next,
8733
- isSVG,
8870
+ namespace,
8734
8871
  vnode.children,
8735
8872
  parentComponent,
8736
8873
  parentSuspense,
@@ -8739,11 +8876,11 @@ function baseCreateRenderer(options, createHydrationFns) {
8739
8876
  }
8740
8877
  }
8741
8878
  if ("value" in newProps) {
8742
- hostPatchProp(el, "value", oldProps.value, newProps.value);
8879
+ hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
8743
8880
  }
8744
8881
  }
8745
8882
  };
8746
- const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8883
+ const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8747
8884
  const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
8748
8885
  const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
8749
8886
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
@@ -8765,7 +8902,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8765
8902
  fragmentEndAnchor,
8766
8903
  parentComponent,
8767
8904
  parentSuspense,
8768
- isSVG,
8905
+ namespace,
8769
8906
  slotScopeIds,
8770
8907
  optimized
8771
8908
  );
@@ -8779,7 +8916,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8779
8916
  container,
8780
8917
  parentComponent,
8781
8918
  parentSuspense,
8782
- isSVG,
8919
+ namespace,
8783
8920
  slotScopeIds
8784
8921
  );
8785
8922
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -8806,14 +8943,14 @@ function baseCreateRenderer(options, createHydrationFns) {
8806
8943
  fragmentEndAnchor,
8807
8944
  parentComponent,
8808
8945
  parentSuspense,
8809
- isSVG,
8946
+ namespace,
8810
8947
  slotScopeIds,
8811
8948
  optimized
8812
8949
  );
8813
8950
  }
8814
8951
  }
8815
8952
  };
8816
- const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8953
+ const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8817
8954
  n2.slotScopeIds = slotScopeIds;
8818
8955
  if (n1 == null) {
8819
8956
  if (n2.shapeFlag & 512) {
@@ -8821,7 +8958,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8821
8958
  n2,
8822
8959
  container,
8823
8960
  anchor,
8824
- isSVG,
8961
+ namespace,
8825
8962
  optimized
8826
8963
  );
8827
8964
  } else {
@@ -8831,7 +8968,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8831
8968
  anchor,
8832
8969
  parentComponent,
8833
8970
  parentSuspense,
8834
- isSVG,
8971
+ namespace,
8835
8972
  optimized
8836
8973
  );
8837
8974
  }
@@ -8839,7 +8976,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8839
8976
  updateComponent(n1, n2, optimized);
8840
8977
  }
8841
8978
  };
8842
- const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {
8979
+ const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
8843
8980
  const compatMountInstance = initialVNode.isCompatRoot && initialVNode.component;
8844
8981
  const instance = compatMountInstance || (initialVNode.component = createComponentInstance(
8845
8982
  initialVNode,
@@ -8871,17 +9008,17 @@ function baseCreateRenderer(options, createHydrationFns) {
8871
9008
  const placeholder = instance.subTree = createVNode(Comment);
8872
9009
  processCommentNode(null, placeholder, container, anchor);
8873
9010
  }
8874
- return;
9011
+ } else {
9012
+ setupRenderEffect(
9013
+ instance,
9014
+ initialVNode,
9015
+ container,
9016
+ anchor,
9017
+ parentSuspense,
9018
+ namespace,
9019
+ optimized
9020
+ );
8875
9021
  }
8876
- setupRenderEffect(
8877
- instance,
8878
- initialVNode,
8879
- container,
8880
- anchor,
8881
- parentSuspense,
8882
- isSVG,
8883
- optimized
8884
- );
8885
9022
  if (!!(process.env.NODE_ENV !== "production")) {
8886
9023
  popWarningContext();
8887
9024
  endMeasure(instance, `mount`);
@@ -8910,7 +9047,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8910
9047
  instance.vnode = n2;
8911
9048
  }
8912
9049
  };
8913
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {
9050
+ const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
8914
9051
  const componentUpdateFn = () => {
8915
9052
  if (!instance.isMounted) {
8916
9053
  let vnodeHook;
@@ -8980,7 +9117,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8980
9117
  anchor,
8981
9118
  instance,
8982
9119
  parentSuspense,
8983
- isSVG
9120
+ namespace
8984
9121
  );
8985
9122
  if (!!(process.env.NODE_ENV !== "production")) {
8986
9123
  endMeasure(instance, `patch`);
@@ -9019,6 +9156,21 @@ function baseCreateRenderer(options, createHydrationFns) {
9019
9156
  initialVNode = container = anchor = null;
9020
9157
  } else {
9021
9158
  let { next, bu, u, parent, vnode } = instance;
9159
+ {
9160
+ const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
9161
+ if (nonHydratedAsyncRoot) {
9162
+ if (next) {
9163
+ next.el = vnode.el;
9164
+ updateComponentPreRender(instance, next, optimized);
9165
+ }
9166
+ nonHydratedAsyncRoot.asyncDep.then(() => {
9167
+ if (!instance.isUnmounted) {
9168
+ componentUpdateFn();
9169
+ }
9170
+ });
9171
+ return;
9172
+ }
9173
+ }
9022
9174
  let originNext = next;
9023
9175
  let vnodeHook;
9024
9176
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -9062,7 +9214,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9062
9214
  getNextHostNode(prevTree),
9063
9215
  instance,
9064
9216
  parentSuspense,
9065
- isSVG
9217
+ namespace
9066
9218
  );
9067
9219
  if (!!(process.env.NODE_ENV !== "production")) {
9068
9220
  endMeasure(instance, `patch`);
@@ -9123,10 +9275,10 @@ function baseCreateRenderer(options, createHydrationFns) {
9123
9275
  updateProps(instance, nextVNode.props, prevProps, optimized);
9124
9276
  updateSlots(instance, nextVNode.children, optimized);
9125
9277
  pauseTracking();
9126
- flushPreFlushCbs();
9278
+ flushPreFlushCbs(instance);
9127
9279
  resetTracking();
9128
9280
  };
9129
- const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
9281
+ const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
9130
9282
  const c1 = n1 && n1.children;
9131
9283
  const prevShapeFlag = n1 ? n1.shapeFlag : 0;
9132
9284
  const c2 = n2.children;
@@ -9140,7 +9292,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9140
9292
  anchor,
9141
9293
  parentComponent,
9142
9294
  parentSuspense,
9143
- isSVG,
9295
+ namespace,
9144
9296
  slotScopeIds,
9145
9297
  optimized
9146
9298
  );
@@ -9153,7 +9305,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9153
9305
  anchor,
9154
9306
  parentComponent,
9155
9307
  parentSuspense,
9156
- isSVG,
9308
+ namespace,
9157
9309
  slotScopeIds,
9158
9310
  optimized
9159
9311
  );
@@ -9177,7 +9329,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9177
9329
  anchor,
9178
9330
  parentComponent,
9179
9331
  parentSuspense,
9180
- isSVG,
9332
+ namespace,
9181
9333
  slotScopeIds,
9182
9334
  optimized
9183
9335
  );
@@ -9195,7 +9347,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9195
9347
  anchor,
9196
9348
  parentComponent,
9197
9349
  parentSuspense,
9198
- isSVG,
9350
+ namespace,
9199
9351
  slotScopeIds,
9200
9352
  optimized
9201
9353
  );
@@ -9203,7 +9355,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9203
9355
  }
9204
9356
  }
9205
9357
  };
9206
- const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
9358
+ const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9207
9359
  c1 = c1 || EMPTY_ARR;
9208
9360
  c2 = c2 || EMPTY_ARR;
9209
9361
  const oldLength = c1.length;
@@ -9219,7 +9371,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9219
9371
  null,
9220
9372
  parentComponent,
9221
9373
  parentSuspense,
9222
- isSVG,
9374
+ namespace,
9223
9375
  slotScopeIds,
9224
9376
  optimized
9225
9377
  );
@@ -9240,14 +9392,14 @@ function baseCreateRenderer(options, createHydrationFns) {
9240
9392
  anchor,
9241
9393
  parentComponent,
9242
9394
  parentSuspense,
9243
- isSVG,
9395
+ namespace,
9244
9396
  slotScopeIds,
9245
9397
  optimized,
9246
9398
  commonLength
9247
9399
  );
9248
9400
  }
9249
9401
  };
9250
- const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
9402
+ const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9251
9403
  let i = 0;
9252
9404
  const l2 = c2.length;
9253
9405
  let e1 = c1.length - 1;
@@ -9263,7 +9415,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9263
9415
  null,
9264
9416
  parentComponent,
9265
9417
  parentSuspense,
9266
- isSVG,
9418
+ namespace,
9267
9419
  slotScopeIds,
9268
9420
  optimized
9269
9421
  );
@@ -9283,7 +9435,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9283
9435
  null,
9284
9436
  parentComponent,
9285
9437
  parentSuspense,
9286
- isSVG,
9438
+ namespace,
9287
9439
  slotScopeIds,
9288
9440
  optimized
9289
9441
  );
@@ -9305,7 +9457,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9305
9457
  anchor,
9306
9458
  parentComponent,
9307
9459
  parentSuspense,
9308
- isSVG,
9460
+ namespace,
9309
9461
  slotScopeIds,
9310
9462
  optimized
9311
9463
  );
@@ -9375,7 +9527,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9375
9527
  null,
9376
9528
  parentComponent,
9377
9529
  parentSuspense,
9378
- isSVG,
9530
+ namespace,
9379
9531
  slotScopeIds,
9380
9532
  optimized
9381
9533
  );
@@ -9396,7 +9548,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9396
9548
  anchor,
9397
9549
  parentComponent,
9398
9550
  parentSuspense,
9399
- isSVG,
9551
+ namespace,
9400
9552
  slotScopeIds,
9401
9553
  optimized
9402
9554
  );
@@ -9626,13 +9778,21 @@ function baseCreateRenderer(options, createHydrationFns) {
9626
9778
  }
9627
9779
  return hostNextSibling(vnode.anchor || vnode.el);
9628
9780
  };
9629
- const render = (vnode, container, isSVG) => {
9781
+ const render = (vnode, container, namespace) => {
9630
9782
  if (vnode == null) {
9631
9783
  if (container._vnode) {
9632
9784
  unmount(container._vnode, null, null, true);
9633
9785
  }
9634
9786
  } else {
9635
- patch(container._vnode || null, vnode, container, null, null, null, isSVG);
9787
+ patch(
9788
+ container._vnode || null,
9789
+ vnode,
9790
+ container,
9791
+ null,
9792
+ null,
9793
+ null,
9794
+ namespace
9795
+ );
9636
9796
  }
9637
9797
  flushPreFlushCbs();
9638
9798
  flushPostFlushCbs();
@@ -9663,6 +9823,9 @@ function baseCreateRenderer(options, createHydrationFns) {
9663
9823
  createApp: createAppAPI(render, hydrate)
9664
9824
  };
9665
9825
  }
9826
+ function resolveChildrenNamespace({ type, props }, currentNamespace) {
9827
+ return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
9828
+ }
9666
9829
  function toggleRecurse({ effect, update }, allowed) {
9667
9830
  effect.allowRecurse = update.allowRecurse = allowed;
9668
9831
  }
@@ -9733,10 +9896,21 @@ function getSequence(arr) {
9733
9896
  }
9734
9897
  return result;
9735
9898
  }
9899
+ function locateNonHydratedAsyncRoot(instance) {
9900
+ const subComponent = instance.subTree.component;
9901
+ if (subComponent) {
9902
+ if (subComponent.asyncDep && !subComponent.asyncResolved) {
9903
+ return subComponent;
9904
+ } else {
9905
+ return locateNonHydratedAsyncRoot(subComponent);
9906
+ }
9907
+ }
9908
+ }
9736
9909
 
9737
9910
  const isTeleport = (type) => type.__isTeleport;
9738
9911
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
9739
9912
  const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
9913
+ const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
9740
9914
  const resolveTarget = (props, select) => {
9741
9915
  const targetSelector = props && props.to;
9742
9916
  if (isString(targetSelector)) {
@@ -9764,7 +9938,7 @@ const resolveTarget = (props, select) => {
9764
9938
  const TeleportImpl = {
9765
9939
  name: "Teleport",
9766
9940
  __isTeleport: true,
9767
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
9941
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
9768
9942
  const {
9769
9943
  mc: mountChildren,
9770
9944
  pc: patchChildren,
@@ -9786,7 +9960,11 @@ const TeleportImpl = {
9786
9960
  const targetAnchor = n2.targetAnchor = createText("");
9787
9961
  if (target) {
9788
9962
  insert(targetAnchor, target);
9789
- isSVG = isSVG || isTargetSVG(target);
9963
+ if (namespace === "svg" || isTargetSVG(target)) {
9964
+ namespace = "svg";
9965
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
9966
+ namespace = "mathml";
9967
+ }
9790
9968
  } else if (!!(process.env.NODE_ENV !== "production") && !disabled) {
9791
9969
  warn("Invalid Teleport target on mount:", target, `(${typeof target})`);
9792
9970
  }
@@ -9798,7 +9976,7 @@ const TeleportImpl = {
9798
9976
  anchor2,
9799
9977
  parentComponent,
9800
9978
  parentSuspense,
9801
- isSVG,
9979
+ namespace,
9802
9980
  slotScopeIds,
9803
9981
  optimized
9804
9982
  );
@@ -9817,7 +9995,11 @@ const TeleportImpl = {
9817
9995
  const wasDisabled = isTeleportDisabled(n1.props);
9818
9996
  const currentContainer = wasDisabled ? container : target;
9819
9997
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
9820
- isSVG = isSVG || isTargetSVG(target);
9998
+ if (namespace === "svg" || isTargetSVG(target)) {
9999
+ namespace = "svg";
10000
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
10001
+ namespace = "mathml";
10002
+ }
9821
10003
  if (dynamicChildren) {
9822
10004
  patchBlockChildren(
9823
10005
  n1.dynamicChildren,
@@ -9825,7 +10007,7 @@ const TeleportImpl = {
9825
10007
  currentContainer,
9826
10008
  parentComponent,
9827
10009
  parentSuspense,
9828
- isSVG,
10010
+ namespace,
9829
10011
  slotScopeIds
9830
10012
  );
9831
10013
  traverseStaticChildren(n1, n2, true);
@@ -9837,7 +10019,7 @@ const TeleportImpl = {
9837
10019
  currentAnchor,
9838
10020
  parentComponent,
9839
10021
  parentSuspense,
9840
- isSVG,
10022
+ namespace,
9841
10023
  slotScopeIds,
9842
10024
  false
9843
10025
  );
@@ -10523,20 +10705,29 @@ function createComponentInstance(vnode, parent, suspense) {
10523
10705
  let currentInstance = null;
10524
10706
  const getCurrentInstance = () => currentInstance || currentRenderingInstance;
10525
10707
  let internalSetCurrentInstance;
10526
- let globalCurrentInstanceSetters;
10527
- let settersKey = "__VUE_INSTANCE_SETTERS__";
10708
+ let setInSSRSetupState;
10528
10709
  {
10529
- if (!(globalCurrentInstanceSetters = getGlobalThis()[settersKey])) {
10530
- globalCurrentInstanceSetters = getGlobalThis()[settersKey] = [];
10531
- }
10532
- globalCurrentInstanceSetters.push((i) => currentInstance = i);
10533
- internalSetCurrentInstance = (instance) => {
10534
- if (globalCurrentInstanceSetters.length > 1) {
10535
- globalCurrentInstanceSetters.forEach((s) => s(instance));
10536
- } else {
10537
- globalCurrentInstanceSetters[0](instance);
10538
- }
10710
+ const g = getGlobalThis();
10711
+ const registerGlobalSetter = (key, setter) => {
10712
+ let setters;
10713
+ if (!(setters = g[key]))
10714
+ setters = g[key] = [];
10715
+ setters.push(setter);
10716
+ return (v) => {
10717
+ if (setters.length > 1)
10718
+ setters.forEach((set) => set(v));
10719
+ else
10720
+ setters[0](v);
10721
+ };
10539
10722
  };
10723
+ internalSetCurrentInstance = registerGlobalSetter(
10724
+ `__VUE_INSTANCE_SETTERS__`,
10725
+ (v) => currentInstance = v
10726
+ );
10727
+ setInSSRSetupState = registerGlobalSetter(
10728
+ `__VUE_SSR_SETTERS__`,
10729
+ (v) => isInSSRComponentSetup = v
10730
+ );
10540
10731
  }
10541
10732
  const setCurrentInstance = (instance) => {
10542
10733
  internalSetCurrentInstance(instance);
@@ -10560,13 +10751,13 @@ function isStatefulComponent(instance) {
10560
10751
  }
10561
10752
  let isInSSRComponentSetup = false;
10562
10753
  function setupComponent(instance, isSSR = false) {
10563
- isInSSRComponentSetup = isSSR;
10754
+ isSSR && setInSSRSetupState(isSSR);
10564
10755
  const { props, children } = instance.vnode;
10565
10756
  const isStateful = isStatefulComponent(instance);
10566
10757
  initProps(instance, props, isStateful, isSSR);
10567
10758
  initSlots(instance, children);
10568
10759
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
10569
- isInSSRComponentSetup = false;
10760
+ isSSR && setInSSRSetupState(false);
10570
10761
  return setupResult;
10571
10762
  }
10572
10763
  function setupStatefulComponent(instance, isSSR) {
@@ -11106,7 +11297,7 @@ function isMemoSame(cached, memo) {
11106
11297
  return true;
11107
11298
  }
11108
11299
 
11109
- const version = "3.4.0-alpha.4";
11300
+ const version = "3.4.0-beta.1";
11110
11301
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11111
11302
  const _ssrUtils = {
11112
11303
  createComponentInstance,
@@ -11129,6 +11320,7 @@ const compatUtils = _compatUtils ;
11129
11320
  const DeprecationTypes = DeprecationTypes$1 ;
11130
11321
 
11131
11322
  const svgNS = "http://www.w3.org/2000/svg";
11323
+ const mathmlNS = "http://www.w3.org/1998/Math/MathML";
11132
11324
  const doc = typeof document !== "undefined" ? document : null;
11133
11325
  const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
11134
11326
  const nodeOps = {
@@ -11141,8 +11333,8 @@ const nodeOps = {
11141
11333
  parent.removeChild(child);
11142
11334
  }
11143
11335
  },
11144
- createElement: (tag, isSVG, is, props) => {
11145
- const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0);
11336
+ createElement: (tag, namespace, is, props) => {
11337
+ const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
11146
11338
  if (tag === "select" && props && props.multiple != null) {
11147
11339
  el.setAttribute("multiple", props.multiple);
11148
11340
  }
@@ -11166,7 +11358,7 @@ const nodeOps = {
11166
11358
  // Reason: innerHTML.
11167
11359
  // Static content here can only come from compiled templates.
11168
11360
  // As long as the user only uses trusted templates, this is safe.
11169
- insertStaticContent(content, parent, anchor, isSVG, start, end) {
11361
+ insertStaticContent(content, parent, anchor, namespace, start, end) {
11170
11362
  const before = anchor ? anchor.previousSibling : parent.lastChild;
11171
11363
  if (start && (start === end || start.nextSibling)) {
11172
11364
  while (true) {
@@ -11175,9 +11367,9 @@ const nodeOps = {
11175
11367
  break;
11176
11368
  }
11177
11369
  } else {
11178
- templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content;
11370
+ templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
11179
11371
  const template = templateContainer.content;
11180
- if (isSVG) {
11372
+ if (namespace === "svg" || namespace === "mathml") {
11181
11373
  const wrapper = template.firstChild;
11182
11374
  while (wrapper.firstChild) {
11183
11375
  template.appendChild(wrapper.firstChild);
@@ -11824,7 +12016,8 @@ function patchStopImmediatePropagation(e, value) {
11824
12016
 
11825
12017
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11826
12018
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
11827
- const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
12019
+ const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
12020
+ const isSVG = namespace === "svg";
11828
12021
  if (key === "class") {
11829
12022
  patchClass(el, nextValue, isSVG);
11830
12023
  } else if (key === "style") {
@@ -11876,7 +12069,9 @@ function shouldSetAsProp(el, key, value, isSVG) {
11876
12069
  }
11877
12070
  if (key === "width" || key === "height") {
11878
12071
  const tag = el.tagName;
11879
- return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE");
12072
+ if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
12073
+ return false;
12074
+ }
11880
12075
  }
11881
12076
  if (isNativeOn(key) && isString(value)) {
11882
12077
  return false;
@@ -12713,7 +12908,7 @@ const createApp = (...args) => {
12713
12908
  }
12714
12909
  }
12715
12910
  container.innerHTML = "";
12716
- const proxy = mount(container, false, container instanceof SVGElement);
12911
+ const proxy = mount(container, false, resolveRootNamespace(container));
12717
12912
  if (container instanceof Element) {
12718
12913
  container.removeAttribute("v-cloak");
12719
12914
  container.setAttribute("data-v-app", "");
@@ -12732,14 +12927,22 @@ const createSSRApp = (...args) => {
12732
12927
  app.mount = (containerOrSelector) => {
12733
12928
  const container = normalizeContainer(containerOrSelector);
12734
12929
  if (container) {
12735
- return mount(container, true, container instanceof SVGElement);
12930
+ return mount(container, true, resolveRootNamespace(container));
12736
12931
  }
12737
12932
  };
12738
12933
  return app;
12739
12934
  };
12935
+ function resolveRootNamespace(container) {
12936
+ if (container instanceof SVGElement) {
12937
+ return "svg";
12938
+ }
12939
+ if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
12940
+ return "mathml";
12941
+ }
12942
+ }
12740
12943
  function injectNativeTagCheck(app) {
12741
12944
  Object.defineProperty(app.config, "isNativeTag", {
12742
- value: (tag) => isHTMLTag(tag) || isSVGTag(tag),
12945
+ value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
12743
12946
  writable: false
12744
12947
  });
12745
12948
  }
@@ -14158,12 +14361,12 @@ const errorMessages = {
14158
14361
  Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
14159
14362
  [45]: `Error parsing JavaScript expression: `,
14160
14363
  [46]: `<KeepAlive> expects exactly one child component.`,
14161
- [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.`,
14364
+ [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.`,
14162
14365
  // generic errors
14163
- [48]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
14164
- [49]: `ES module mode is not supported in this build of compiler.`,
14165
- [50]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
14166
- [51]: `"scopeId" option is only supported in module mode.`,
14366
+ [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
14367
+ [48]: `ES module mode is not supported in this build of compiler.`,
14368
+ [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
14369
+ [50]: `"scopeId" option is only supported in module mode.`,
14167
14370
  // just to fulfill types
14168
14371
  [52]: ``
14169
14372
  };
@@ -15427,6 +15630,7 @@ function createTransformContext(root, {
15427
15630
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
15428
15631
  const context = {
15429
15632
  // options
15633
+ filename,
15430
15634
  selfName: nameMatch && capitalize(camelize(nameMatch[1])),
15431
15635
  prefixIdentifiers,
15432
15636
  hoistStatic: hoistStatic2,
@@ -17646,7 +17850,7 @@ const transformOn$1 = (dir, node, context, augmentor) => {
17646
17850
  if (arg.isStatic) {
17647
17851
  let rawName = arg.content;
17648
17852
  if (!!(process.env.NODE_ENV !== "production") && rawName.startsWith("vnode")) {
17649
- context.onError(createCompilerError(47, arg.loc));
17853
+ context.onError(createCompilerError(51, arg.loc));
17650
17854
  }
17651
17855
  if (rawName.startsWith("vue:")) {
17652
17856
  rawName = `vnode-${rawName.slice(4)}`;
@@ -18127,24 +18331,26 @@ function baseCompile(source, options = {}) {
18127
18331
  const isModuleMode = options.mode === "module";
18128
18332
  {
18129
18333
  if (options.prefixIdentifiers === true) {
18130
- onError(createCompilerError(48));
18334
+ onError(createCompilerError(47));
18131
18335
  } else if (isModuleMode) {
18132
- onError(createCompilerError(49));
18336
+ onError(createCompilerError(48));
18133
18337
  }
18134
18338
  }
18135
18339
  const prefixIdentifiers = false;
18136
18340
  if (options.cacheHandlers) {
18137
- onError(createCompilerError(50));
18341
+ onError(createCompilerError(49));
18138
18342
  }
18139
18343
  if (options.scopeId && !isModuleMode) {
18140
- onError(createCompilerError(51));
18344
+ onError(createCompilerError(50));
18141
18345
  }
18142
- const ast = isString(source) ? baseParse(source, options) : source;
18346
+ const resolvedOptions = extend({}, options, {
18347
+ prefixIdentifiers
18348
+ });
18349
+ const ast = isString(source) ? baseParse(source, resolvedOptions) : source;
18143
18350
  const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
18144
18351
  transform(
18145
18352
  ast,
18146
- extend({}, options, {
18147
- prefixIdentifiers,
18353
+ extend({}, resolvedOptions, {
18148
18354
  nodeTransforms: [
18149
18355
  ...nodeTransforms,
18150
18356
  ...options.nodeTransforms || []
@@ -18158,12 +18364,7 @@ function baseCompile(source, options = {}) {
18158
18364
  )
18159
18365
  })
18160
18366
  );
18161
- return generate(
18162
- ast,
18163
- extend({}, options, {
18164
- prefixIdentifiers
18165
- })
18166
- );
18367
+ return generate(ast, resolvedOptions);
18167
18368
  }
18168
18369
 
18169
18370
  const noopDirectiveTransform = () => ({ props: [] });
@@ -18208,7 +18409,7 @@ function decodeHtmlBrowser(raw, asAttr = false) {
18208
18409
  const parserOptions = {
18209
18410
  parseMode: "html",
18210
18411
  isVoidTag,
18211
- isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag),
18412
+ isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
18212
18413
  isPreTag: (tag) => tag === "pre",
18213
18414
  decodeEntities: decodeHtmlBrowser ,
18214
18415
  isBuiltInComponent: (tag) => {