@vue/runtime-dom 3.6.0-beta.4 → 3.6.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1780 +1,1424 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-beta.4
3
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
- * @license MIT
5
- **/
6
- 'use strict';
7
-
8
- Object.defineProperty(exports, '__esModule', { value: true });
9
-
10
- var runtimeCore = require('@vue/runtime-core');
11
- var shared = require('@vue/shared');
2
+ * @vue/runtime-dom v3.6.0-beta.5
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/
6
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
7
+ let _vue_runtime_core = require("@vue/runtime-core");
8
+ let _vue_shared = require("@vue/shared");
12
9
 
10
+ //#region packages/runtime-dom/src/nodeOps.ts
13
11
  let policy = void 0;
14
12
  const tt = typeof window !== "undefined" && window.trustedTypes;
15
- if (tt) {
16
- try {
17
- policy = /* @__PURE__ */ tt.createPolicy("vue", {
18
- createHTML: (val) => val
19
- });
20
- } catch (e) {
21
- }
22
- }
13
+ if (tt) try {
14
+ policy = /* @__PURE__ */ tt.createPolicy("vue", { createHTML: (val) => val });
15
+ } catch (e) {}
23
16
  const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
24
17
  const svgNS = "http://www.w3.org/2000/svg";
25
18
  const mathmlNS = "http://www.w3.org/1998/Math/MathML";
26
19
  const doc = typeof document !== "undefined" ? document : null;
27
20
  const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
28
21
  const nodeOps = {
29
- insert: (child, parent, anchor) => {
30
- parent.insertBefore(child, anchor || null);
31
- },
32
- remove: (child) => {
33
- const parent = child.parentNode;
34
- if (parent) {
35
- parent.removeChild(child);
36
- }
37
- },
38
- createElement: (tag, namespace, is, props) => {
39
- const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
40
- if (tag === "select" && props && props.multiple != null) {
41
- el.setAttribute("multiple", props.multiple);
42
- }
43
- return el;
44
- },
45
- createText: (text) => doc.createTextNode(text),
46
- createComment: (text) => doc.createComment(text),
47
- setText: (node, text) => {
48
- node.nodeValue = text;
49
- },
50
- setElementText: (el, text) => {
51
- el.textContent = text;
52
- },
53
- parentNode: (node) => node.parentNode,
54
- nextSibling: (node) => node.nextSibling,
55
- querySelector: (selector) => doc.querySelector(selector),
56
- setScopeId(el, id) {
57
- el.setAttribute(id, "");
58
- },
59
- // __UNSAFE__
60
- // Reason: innerHTML.
61
- // Static content here can only come from compiled templates.
62
- // As long as the user only uses trusted templates, this is safe.
63
- insertStaticContent(content, parent, anchor, namespace, start, end) {
64
- const before = anchor ? anchor.previousSibling : parent.lastChild;
65
- if (start && (start === end || start.nextSibling)) {
66
- while (true) {
67
- parent.insertBefore(start.cloneNode(true), anchor);
68
- if (start === end || !(start = start.nextSibling)) break;
69
- }
70
- } else {
71
- templateContainer.innerHTML = unsafeToTrustedHTML(
72
- namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
73
- );
74
- const template = templateContainer.content;
75
- if (namespace === "svg" || namespace === "mathml") {
76
- const wrapper = template.firstChild;
77
- while (wrapper.firstChild) {
78
- template.appendChild(wrapper.firstChild);
79
- }
80
- template.removeChild(wrapper);
81
- }
82
- parent.insertBefore(template, anchor);
83
- }
84
- return [
85
- // first
86
- before ? before.nextSibling : parent.firstChild,
87
- // last
88
- anchor ? anchor.previousSibling : parent.lastChild
89
- ];
90
- }
22
+ insert: (child, parent, anchor) => {
23
+ parent.insertBefore(child, anchor || null);
24
+ },
25
+ remove: (child) => {
26
+ const parent = child.parentNode;
27
+ if (parent) parent.removeChild(child);
28
+ },
29
+ createElement: (tag, namespace, is, props) => {
30
+ const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
31
+ if (tag === "select" && props && props.multiple != null) el.setAttribute("multiple", props.multiple);
32
+ return el;
33
+ },
34
+ createText: (text) => doc.createTextNode(text),
35
+ createComment: (text) => doc.createComment(text),
36
+ setText: (node, text) => {
37
+ node.nodeValue = text;
38
+ },
39
+ setElementText: (el, text) => {
40
+ el.textContent = text;
41
+ },
42
+ parentNode: (node) => node.parentNode,
43
+ nextSibling: (node) => node.nextSibling,
44
+ querySelector: (selector) => doc.querySelector(selector),
45
+ setScopeId(el, id) {
46
+ el.setAttribute(id, "");
47
+ },
48
+ insertStaticContent(content, parent, anchor, namespace, start, end) {
49
+ const before = anchor ? anchor.previousSibling : parent.lastChild;
50
+ if (start && (start === end || start.nextSibling)) while (true) {
51
+ parent.insertBefore(start.cloneNode(true), anchor);
52
+ if (start === end || !(start = start.nextSibling)) break;
53
+ }
54
+ else {
55
+ templateContainer.innerHTML = unsafeToTrustedHTML(namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content);
56
+ const template = templateContainer.content;
57
+ if (namespace === "svg" || namespace === "mathml") {
58
+ const wrapper = template.firstChild;
59
+ while (wrapper.firstChild) template.appendChild(wrapper.firstChild);
60
+ template.removeChild(wrapper);
61
+ }
62
+ parent.insertBefore(template, anchor);
63
+ }
64
+ return [before ? before.nextSibling : parent.firstChild, anchor ? anchor.previousSibling : parent.lastChild];
65
+ }
91
66
  };
92
67
 
68
+ //#endregion
69
+ //#region packages/runtime-dom/src/components/Transition.ts
93
70
  const TRANSITION = "transition";
94
71
  const ANIMATION = "animation";
95
- const vtcKey = /* @__PURE__ */ Symbol("_vtc");
72
+ const vtcKey = Symbol("_vtc");
96
73
  const DOMTransitionPropsValidators = {
97
- name: String,
98
- type: String,
99
- css: {
100
- type: Boolean,
101
- default: true
102
- },
103
- duration: [String, Number, Object],
104
- enterFromClass: String,
105
- enterActiveClass: String,
106
- enterToClass: String,
107
- appearFromClass: String,
108
- appearActiveClass: String,
109
- appearToClass: String,
110
- leaveFromClass: String,
111
- leaveActiveClass: String,
112
- leaveToClass: String
74
+ name: String,
75
+ type: String,
76
+ css: {
77
+ type: Boolean,
78
+ default: true
79
+ },
80
+ duration: [
81
+ String,
82
+ Number,
83
+ Object
84
+ ],
85
+ enterFromClass: String,
86
+ enterActiveClass: String,
87
+ enterToClass: String,
88
+ appearFromClass: String,
89
+ appearActiveClass: String,
90
+ appearToClass: String,
91
+ leaveFromClass: String,
92
+ leaveActiveClass: String,
93
+ leaveToClass: String
113
94
  };
114
- const TransitionPropsValidators = /* @__PURE__ */ shared.extend(
115
- {},
116
- runtimeCore.BaseTransitionPropsValidators,
117
- DOMTransitionPropsValidators
118
- );
95
+ const TransitionPropsValidators = /* @__PURE__ */ (0, _vue_shared.extend)({}, _vue_runtime_core.BaseTransitionPropsValidators, DOMTransitionPropsValidators);
96
+ /**
97
+ * Wrap logic that attaches extra properties to Transition in a function
98
+ * so that it can be annotated as pure
99
+ */
119
100
  const decorate$1 = (t) => {
120
- t.displayName = "Transition";
121
- t.props = TransitionPropsValidators;
122
- return t;
101
+ t.displayName = "Transition";
102
+ t.props = TransitionPropsValidators;
103
+ return t;
123
104
  };
124
- const Transition = /* @__PURE__ */ decorate$1(
125
- (props, { slots }) => runtimeCore.h(runtimeCore.BaseTransition, resolveTransitionProps(props), slots)
126
- );
105
+ /**
106
+ * DOM Transition is a higher-order-component based on the platform-agnostic
107
+ * base Transition component, with DOM-specific logic.
108
+ */
109
+ const Transition = /* @__PURE__ */ decorate$1((props, { slots }) => (0, _vue_runtime_core.h)(_vue_runtime_core.BaseTransition, resolveTransitionProps(props), slots));
110
+ /**
111
+ * #3227 Incoming hooks may be merged into arrays when wrapping Transition
112
+ * with custom HOCs.
113
+ */
127
114
  const callHook = (hook, args = []) => {
128
- if (shared.isArray(hook)) {
129
- hook.forEach((h2) => h2(...args));
130
- } else if (hook) {
131
- hook(...args);
132
- }
115
+ if ((0, _vue_shared.isArray)(hook)) hook.forEach((h) => h(...args));
116
+ else if (hook) hook(...args);
133
117
  };
118
+ /**
119
+ * Check if a hook expects a callback (2nd arg), which means the user
120
+ * intends to explicitly control the end of the transition.
121
+ */
134
122
  const hasExplicitCallback = (hook) => {
135
- return hook ? shared.isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
123
+ return hook ? (0, _vue_shared.isArray)(hook) ? hook.some((h) => h.length > 1) : hook.length > 1 : false;
136
124
  };
137
125
  function resolveTransitionProps(rawProps) {
138
- const baseProps = {};
139
- for (const key in rawProps) {
140
- if (!(key in DOMTransitionPropsValidators)) {
141
- baseProps[key] = rawProps[key];
142
- }
143
- }
144
- if (rawProps.css === false) {
145
- return baseProps;
146
- }
147
- const {
148
- name = "v",
149
- type,
150
- duration,
151
- enterFromClass = `${name}-enter-from`,
152
- enterActiveClass = `${name}-enter-active`,
153
- enterToClass = `${name}-enter-to`,
154
- appearFromClass = enterFromClass,
155
- appearActiveClass = enterActiveClass,
156
- appearToClass = enterToClass,
157
- leaveFromClass = `${name}-leave-from`,
158
- leaveActiveClass = `${name}-leave-active`,
159
- leaveToClass = `${name}-leave-to`
160
- } = rawProps;
161
- const durations = normalizeDuration(duration);
162
- const enterDuration = durations && durations[0];
163
- const leaveDuration = durations && durations[1];
164
- const {
165
- onBeforeEnter,
166
- onEnter,
167
- onEnterCancelled,
168
- onLeave,
169
- onLeaveCancelled,
170
- onBeforeAppear = onBeforeEnter,
171
- onAppear = onEnter,
172
- onAppearCancelled = onEnterCancelled
173
- } = baseProps;
174
- const finishEnter = (el, isAppear, done, isCancelled) => {
175
- el._enterCancelled = isCancelled;
176
- removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
177
- removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
178
- done && done();
179
- };
180
- const finishLeave = (el, done) => {
181
- el._isLeaving = false;
182
- removeTransitionClass(el, leaveFromClass);
183
- removeTransitionClass(el, leaveToClass);
184
- removeTransitionClass(el, leaveActiveClass);
185
- done && done();
186
- };
187
- const makeEnterHook = (isAppear) => {
188
- return (el, done) => {
189
- const hook = isAppear ? onAppear : onEnter;
190
- const resolve = () => finishEnter(el, isAppear, done);
191
- callHook(hook, [el, resolve]);
192
- nextFrame(() => {
193
- removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
194
- addTransitionClass(el, isAppear ? appearToClass : enterToClass);
195
- if (!hasExplicitCallback(hook)) {
196
- whenTransitionEnds(el, type, enterDuration, resolve);
197
- }
198
- });
199
- };
200
- };
201
- return shared.extend(baseProps, {
202
- onBeforeEnter(el) {
203
- callHook(onBeforeEnter, [el]);
204
- addTransitionClass(el, enterFromClass);
205
- addTransitionClass(el, enterActiveClass);
206
- },
207
- onBeforeAppear(el) {
208
- callHook(onBeforeAppear, [el]);
209
- addTransitionClass(el, appearFromClass);
210
- addTransitionClass(el, appearActiveClass);
211
- },
212
- onEnter: makeEnterHook(false),
213
- onAppear: makeEnterHook(true),
214
- onLeave(el, done) {
215
- el._isLeaving = true;
216
- const resolve = () => finishLeave(el, done);
217
- addTransitionClass(el, leaveFromClass);
218
- if (!el._enterCancelled) {
219
- forceReflow(el);
220
- addTransitionClass(el, leaveActiveClass);
221
- } else {
222
- addTransitionClass(el, leaveActiveClass);
223
- forceReflow(el);
224
- }
225
- nextFrame(() => {
226
- if (!el._isLeaving) {
227
- return;
228
- }
229
- removeTransitionClass(el, leaveFromClass);
230
- addTransitionClass(el, leaveToClass);
231
- if (!hasExplicitCallback(onLeave)) {
232
- whenTransitionEnds(el, type, leaveDuration, resolve);
233
- }
234
- });
235
- callHook(onLeave, [el, resolve]);
236
- },
237
- onEnterCancelled(el) {
238
- finishEnter(el, false, void 0, true);
239
- callHook(onEnterCancelled, [el]);
240
- },
241
- onAppearCancelled(el) {
242
- finishEnter(el, true, void 0, true);
243
- callHook(onAppearCancelled, [el]);
244
- },
245
- onLeaveCancelled(el) {
246
- finishLeave(el);
247
- callHook(onLeaveCancelled, [el]);
248
- }
249
- });
126
+ const baseProps = {};
127
+ for (const key in rawProps) if (!(key in DOMTransitionPropsValidators)) baseProps[key] = rawProps[key];
128
+ if (rawProps.css === false) return baseProps;
129
+ const { name = "v", type, duration, enterFromClass = `${name}-enter-from`, enterActiveClass = `${name}-enter-active`, enterToClass = `${name}-enter-to`, appearFromClass = enterFromClass, appearActiveClass = enterActiveClass, appearToClass = enterToClass, leaveFromClass = `${name}-leave-from`, leaveActiveClass = `${name}-leave-active`, leaveToClass = `${name}-leave-to` } = rawProps;
130
+ const durations = normalizeDuration(duration);
131
+ const enterDuration = durations && durations[0];
132
+ const leaveDuration = durations && durations[1];
133
+ const { onBeforeEnter, onEnter, onEnterCancelled, onLeave, onLeaveCancelled, onBeforeAppear = onBeforeEnter, onAppear = onEnter, onAppearCancelled = onEnterCancelled } = baseProps;
134
+ const finishEnter = (el, isAppear, done, isCancelled) => {
135
+ el._enterCancelled = isCancelled;
136
+ removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
137
+ removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
138
+ done && done();
139
+ };
140
+ const finishLeave = (el, done) => {
141
+ el._isLeaving = false;
142
+ removeTransitionClass(el, leaveFromClass);
143
+ removeTransitionClass(el, leaveToClass);
144
+ removeTransitionClass(el, leaveActiveClass);
145
+ done && done();
146
+ };
147
+ const makeEnterHook = (isAppear) => {
148
+ return (el, done) => {
149
+ const hook = isAppear ? onAppear : onEnter;
150
+ const resolve = () => finishEnter(el, isAppear, done);
151
+ callHook(hook, [el, resolve]);
152
+ nextFrame(() => {
153
+ removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
154
+ addTransitionClass(el, isAppear ? appearToClass : enterToClass);
155
+ if (!hasExplicitCallback(hook)) whenTransitionEnds(el, type, enterDuration, resolve);
156
+ });
157
+ };
158
+ };
159
+ return (0, _vue_shared.extend)(baseProps, {
160
+ onBeforeEnter(el) {
161
+ callHook(onBeforeEnter, [el]);
162
+ addTransitionClass(el, enterFromClass);
163
+ addTransitionClass(el, enterActiveClass);
164
+ },
165
+ onBeforeAppear(el) {
166
+ callHook(onBeforeAppear, [el]);
167
+ addTransitionClass(el, appearFromClass);
168
+ addTransitionClass(el, appearActiveClass);
169
+ },
170
+ onEnter: makeEnterHook(false),
171
+ onAppear: makeEnterHook(true),
172
+ onLeave(el, done) {
173
+ el._isLeaving = true;
174
+ const resolve = () => finishLeave(el, done);
175
+ addTransitionClass(el, leaveFromClass);
176
+ if (!el._enterCancelled) {
177
+ forceReflow(el);
178
+ addTransitionClass(el, leaveActiveClass);
179
+ } else {
180
+ addTransitionClass(el, leaveActiveClass);
181
+ forceReflow(el);
182
+ }
183
+ nextFrame(() => {
184
+ if (!el._isLeaving) return;
185
+ removeTransitionClass(el, leaveFromClass);
186
+ addTransitionClass(el, leaveToClass);
187
+ if (!hasExplicitCallback(onLeave)) whenTransitionEnds(el, type, leaveDuration, resolve);
188
+ });
189
+ callHook(onLeave, [el, resolve]);
190
+ },
191
+ onEnterCancelled(el) {
192
+ finishEnter(el, false, void 0, true);
193
+ callHook(onEnterCancelled, [el]);
194
+ },
195
+ onAppearCancelled(el) {
196
+ finishEnter(el, true, void 0, true);
197
+ callHook(onAppearCancelled, [el]);
198
+ },
199
+ onLeaveCancelled(el) {
200
+ finishLeave(el);
201
+ callHook(onLeaveCancelled, [el]);
202
+ }
203
+ });
250
204
  }
251
205
  function normalizeDuration(duration) {
252
- if (duration == null) {
253
- return null;
254
- } else if (shared.isObject(duration)) {
255
- return [NumberOf(duration.enter), NumberOf(duration.leave)];
256
- } else {
257
- const n = NumberOf(duration);
258
- return [n, n];
259
- }
206
+ if (duration == null) return null;
207
+ else if ((0, _vue_shared.isObject)(duration)) return [NumberOf(duration.enter), NumberOf(duration.leave)];
208
+ else {
209
+ const n = NumberOf(duration);
210
+ return [n, n];
211
+ }
260
212
  }
261
213
  function NumberOf(val) {
262
- const res = shared.toNumber(val);
263
- return res;
214
+ return (0, _vue_shared.toNumber)(val);
264
215
  }
265
216
  function addTransitionClass(el, cls) {
266
- cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
267
- (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
217
+ cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
218
+ (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
268
219
  }
269
220
  function removeTransitionClass(el, cls) {
270
- cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
271
- const _vtc = el[vtcKey];
272
- if (_vtc) {
273
- _vtc.delete(cls);
274
- if (!_vtc.size) {
275
- el[vtcKey] = void 0;
276
- }
277
- }
221
+ cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
222
+ const _vtc = el[vtcKey];
223
+ if (_vtc) {
224
+ _vtc.delete(cls);
225
+ if (!_vtc.size) el[vtcKey] = void 0;
226
+ }
278
227
  }
279
228
  function nextFrame(cb) {
280
- requestAnimationFrame(() => {
281
- requestAnimationFrame(cb);
282
- });
229
+ requestAnimationFrame(() => {
230
+ requestAnimationFrame(cb);
231
+ });
283
232
  }
284
233
  let endId = 0;
285
234
  function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
286
- const id = el._endId = ++endId;
287
- const resolveIfNotStale = () => {
288
- if (id === el._endId) {
289
- resolve();
290
- }
291
- };
292
- if (explicitTimeout != null) {
293
- return setTimeout(resolveIfNotStale, explicitTimeout);
294
- }
295
- const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
296
- if (!type) {
297
- return resolve();
298
- }
299
- const endEvent = type + "end";
300
- let ended = 0;
301
- const end = () => {
302
- el.removeEventListener(endEvent, onEnd);
303
- resolveIfNotStale();
304
- };
305
- const onEnd = (e) => {
306
- if (e.target === el && ++ended >= propCount) {
307
- end();
308
- }
309
- };
310
- setTimeout(() => {
311
- if (ended < propCount) {
312
- end();
313
- }
314
- }, timeout + 1);
315
- el.addEventListener(endEvent, onEnd);
235
+ const id = el._endId = ++endId;
236
+ const resolveIfNotStale = () => {
237
+ if (id === el._endId) resolve();
238
+ };
239
+ if (explicitTimeout != null) return setTimeout(resolveIfNotStale, explicitTimeout);
240
+ const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
241
+ if (!type) return resolve();
242
+ const endEvent = type + "end";
243
+ let ended = 0;
244
+ const end = () => {
245
+ el.removeEventListener(endEvent, onEnd);
246
+ resolveIfNotStale();
247
+ };
248
+ const onEnd = (e) => {
249
+ if (e.target === el && ++ended >= propCount) end();
250
+ };
251
+ setTimeout(() => {
252
+ if (ended < propCount) end();
253
+ }, timeout + 1);
254
+ el.addEventListener(endEvent, onEnd);
316
255
  }
317
256
  function getTransitionInfo(el, expectedType) {
318
- const styles = window.getComputedStyle(el);
319
- const getStyleProperties = (key) => (styles[key] || "").split(", ");
320
- const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
321
- const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
322
- const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
323
- const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
324
- const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
325
- const animationTimeout = getTimeout(animationDelays, animationDurations);
326
- let type = null;
327
- let timeout = 0;
328
- let propCount = 0;
329
- if (expectedType === TRANSITION) {
330
- if (transitionTimeout > 0) {
331
- type = TRANSITION;
332
- timeout = transitionTimeout;
333
- propCount = transitionDurations.length;
334
- }
335
- } else if (expectedType === ANIMATION) {
336
- if (animationTimeout > 0) {
337
- type = ANIMATION;
338
- timeout = animationTimeout;
339
- propCount = animationDurations.length;
340
- }
341
- } else {
342
- timeout = Math.max(transitionTimeout, animationTimeout);
343
- type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
344
- propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
345
- }
346
- const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
347
- getStyleProperties(`${TRANSITION}Property`).toString()
348
- );
349
- return {
350
- type,
351
- timeout,
352
- propCount,
353
- hasTransform
354
- };
257
+ const styles = window.getComputedStyle(el);
258
+ const getStyleProperties = (key) => (styles[key] || "").split(", ");
259
+ const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
260
+ const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
261
+ const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
262
+ const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
263
+ const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
264
+ const animationTimeout = getTimeout(animationDelays, animationDurations);
265
+ let type = null;
266
+ let timeout = 0;
267
+ let propCount = 0;
268
+ if (expectedType === TRANSITION) {
269
+ if (transitionTimeout > 0) {
270
+ type = TRANSITION;
271
+ timeout = transitionTimeout;
272
+ propCount = transitionDurations.length;
273
+ }
274
+ } else if (expectedType === ANIMATION) {
275
+ if (animationTimeout > 0) {
276
+ type = ANIMATION;
277
+ timeout = animationTimeout;
278
+ propCount = animationDurations.length;
279
+ }
280
+ } else {
281
+ timeout = Math.max(transitionTimeout, animationTimeout);
282
+ type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
283
+ propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
284
+ }
285
+ const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(getStyleProperties(`${TRANSITION}Property`).toString());
286
+ return {
287
+ type,
288
+ timeout,
289
+ propCount,
290
+ hasTransform
291
+ };
355
292
  }
356
293
  function getTimeout(delays, durations) {
357
- while (delays.length < durations.length) {
358
- delays = delays.concat(delays);
359
- }
360
- return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
294
+ while (delays.length < durations.length) delays = delays.concat(delays);
295
+ return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
361
296
  }
362
297
  function toMs(s) {
363
- if (s === "auto") return 0;
364
- return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
298
+ if (s === "auto") return 0;
299
+ return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
365
300
  }
366
301
  function forceReflow(el) {
367
- const targetDocument = el ? el.ownerDocument : document;
368
- return targetDocument.body.offsetHeight;
302
+ return (el ? el.ownerDocument : document).body.offsetHeight;
369
303
  }
370
304
 
305
+ //#endregion
306
+ //#region packages/runtime-dom/src/modules/class.ts
371
307
  function patchClass(el, value, isSVG) {
372
- const transitionClasses = el[vtcKey];
373
- if (transitionClasses) {
374
- value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
375
- }
376
- if (value == null) {
377
- el.removeAttribute("class");
378
- } else if (isSVG) {
379
- el.setAttribute("class", value);
380
- } else {
381
- el.className = value;
382
- }
308
+ const transitionClasses = el[vtcKey];
309
+ if (transitionClasses) value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
310
+ if (value == null) el.removeAttribute("class");
311
+ else if (isSVG) el.setAttribute("class", value);
312
+ else el.className = value;
383
313
  }
384
314
 
385
- const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
386
- const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
315
+ //#endregion
316
+ //#region packages/runtime-dom/src/directives/vShow.ts
317
+ const vShowOriginalDisplay = Symbol("_vod");
318
+ const vShowHidden = Symbol("_vsh");
387
319
  const vShow = {
388
- // used for prop mismatch check during hydration
389
- name: "show",
390
- beforeMount(el, { value }, { transition }) {
391
- el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
392
- if (transition && value) {
393
- transition.beforeEnter(el);
394
- } else {
395
- setDisplay(el, value);
396
- }
397
- },
398
- mounted(el, { value }, { transition }) {
399
- if (transition && value) {
400
- transition.enter(el);
401
- }
402
- },
403
- updated(el, { value, oldValue }, { transition }) {
404
- if (!value === !oldValue) return;
405
- if (transition) {
406
- if (value) {
407
- transition.beforeEnter(el);
408
- setDisplay(el, true);
409
- transition.enter(el);
410
- } else {
411
- transition.leave(el, () => {
412
- setDisplay(el, false);
413
- });
414
- }
415
- } else {
416
- setDisplay(el, value);
417
- }
418
- },
419
- beforeUnmount(el, { value }) {
420
- setDisplay(el, value);
421
- }
320
+ name: "show",
321
+ beforeMount(el, { value }, { transition }) {
322
+ el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
323
+ if (transition && value) transition.beforeEnter(el);
324
+ else setDisplay(el, value);
325
+ },
326
+ mounted(el, { value }, { transition }) {
327
+ if (transition && value) transition.enter(el);
328
+ },
329
+ updated(el, { value, oldValue }, { transition }) {
330
+ if (!value === !oldValue) return;
331
+ if (transition) if (value) {
332
+ transition.beforeEnter(el);
333
+ setDisplay(el, true);
334
+ transition.enter(el);
335
+ } else transition.leave(el, () => {
336
+ setDisplay(el, false);
337
+ });
338
+ else setDisplay(el, value);
339
+ },
340
+ beforeUnmount(el, { value }) {
341
+ setDisplay(el, value);
342
+ }
422
343
  };
423
344
  function setDisplay(el, value) {
424
- el.style.display = value ? el[vShowOriginalDisplay] : "none";
425
- el[vShowHidden] = !value;
345
+ el.style.display = value ? el[vShowOriginalDisplay] : "none";
346
+ el[vShowHidden] = !value;
426
347
  }
427
348
  function initVShowForSSR() {
428
- vShow.getSSRProps = ({ value }) => {
429
- if (!value) {
430
- return { style: { display: "none" } };
431
- }
432
- };
349
+ vShow.getSSRProps = ({ value }) => {
350
+ if (!value) return { style: { display: "none" } };
351
+ };
433
352
  }
434
353
 
435
- const CSS_VAR_TEXT = /* @__PURE__ */ Symbol("");
436
- function useCssVars(getter) {
437
- return;
438
- }
354
+ //#endregion
355
+ //#region packages/runtime-dom/src/helpers/useCssVars.ts
356
+ const CSS_VAR_TEXT = Symbol("");
357
+ /**
358
+ * Runtime helper for SFC's CSS variable injection feature.
359
+ * @private
360
+ */
361
+ function useCssVars(getter) {}
439
362
 
363
+ //#endregion
364
+ //#region packages/runtime-dom/src/modules/style.ts
440
365
  const displayRE = /(?:^|;)\s*display\s*:/;
441
366
  function patchStyle(el, prev, next) {
442
- const style = el.style;
443
- const isCssString = shared.isString(next);
444
- let hasControlledDisplay = false;
445
- if (next && !isCssString) {
446
- if (prev) {
447
- if (!shared.isString(prev)) {
448
- for (const key in prev) {
449
- if (next[key] == null) {
450
- setStyle(style, key, "");
451
- }
452
- }
453
- } else {
454
- for (const prevStyle of prev.split(";")) {
455
- const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
456
- if (next[key] == null) {
457
- setStyle(style, key, "");
458
- }
459
- }
460
- }
461
- }
462
- for (const key in next) {
463
- if (key === "display") {
464
- hasControlledDisplay = true;
465
- }
466
- setStyle(style, key, next[key]);
467
- }
468
- } else {
469
- if (isCssString) {
470
- if (prev !== next) {
471
- const cssVarText = style[CSS_VAR_TEXT];
472
- if (cssVarText) {
473
- next += ";" + cssVarText;
474
- }
475
- style.cssText = next;
476
- hasControlledDisplay = displayRE.test(next);
477
- }
478
- } else if (prev) {
479
- el.removeAttribute("style");
480
- }
481
- }
482
- if (vShowOriginalDisplay in el) {
483
- el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
484
- if (el[vShowHidden]) {
485
- style.display = "none";
486
- }
487
- }
367
+ const style = el.style;
368
+ const isCssString = (0, _vue_shared.isString)(next);
369
+ let hasControlledDisplay = false;
370
+ if (next && !isCssString) {
371
+ if (prev) if (!(0, _vue_shared.isString)(prev)) {
372
+ for (const key in prev) if (next[key] == null) setStyle(style, key, "");
373
+ } else for (const prevStyle of prev.split(";")) {
374
+ const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
375
+ if (next[key] == null) setStyle(style, key, "");
376
+ }
377
+ for (const key in next) {
378
+ if (key === "display") hasControlledDisplay = true;
379
+ setStyle(style, key, next[key]);
380
+ }
381
+ } else if (isCssString) {
382
+ if (prev !== next) {
383
+ const cssVarText = style[CSS_VAR_TEXT];
384
+ if (cssVarText) next += ";" + cssVarText;
385
+ style.cssText = next;
386
+ hasControlledDisplay = displayRE.test(next);
387
+ }
388
+ } else if (prev) el.removeAttribute("style");
389
+ if (vShowOriginalDisplay in el) {
390
+ el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
391
+ if (el[vShowHidden]) style.display = "none";
392
+ }
488
393
  }
489
394
  const importantRE = /\s*!important$/;
490
395
  function setStyle(style, name, rawVal) {
491
- if (shared.isArray(rawVal)) {
492
- rawVal.forEach((v) => setStyle(style, name, v));
493
- } else {
494
- const val = rawVal == null ? "" : String(rawVal);
495
- if (name.startsWith("--")) {
496
- style.setProperty(name, val);
497
- } else {
498
- const prefixed = autoPrefix(style, name);
499
- if (importantRE.test(val)) {
500
- style.setProperty(
501
- shared.hyphenate(prefixed),
502
- val.replace(importantRE, ""),
503
- "important"
504
- );
505
- } else {
506
- style[prefixed] = val;
507
- }
508
- }
509
- }
396
+ if ((0, _vue_shared.isArray)(rawVal)) rawVal.forEach((v) => setStyle(style, name, v));
397
+ else {
398
+ const val = rawVal == null ? "" : String(rawVal);
399
+ if (name.startsWith("--")) style.setProperty(name, val);
400
+ else {
401
+ const prefixed = autoPrefix(style, name);
402
+ if (importantRE.test(val)) style.setProperty((0, _vue_shared.hyphenate)(prefixed), val.replace(importantRE, ""), "important");
403
+ else style[prefixed] = val;
404
+ }
405
+ }
510
406
  }
511
- const prefixes = ["Webkit", "Moz", "ms"];
407
+ const prefixes = [
408
+ "Webkit",
409
+ "Moz",
410
+ "ms"
411
+ ];
512
412
  const prefixCache = {};
513
413
  function autoPrefix(style, rawName) {
514
- const cached = prefixCache[rawName];
515
- if (cached) {
516
- return cached;
517
- }
518
- let name = runtimeCore.camelize(rawName);
519
- if (name !== "filter" && name in style) {
520
- return prefixCache[rawName] = name;
521
- }
522
- name = shared.capitalize(name);
523
- for (let i = 0; i < prefixes.length; i++) {
524
- const prefixed = prefixes[i] + name;
525
- if (prefixed in style) {
526
- return prefixCache[rawName] = prefixed;
527
- }
528
- }
529
- return rawName;
414
+ const cached = prefixCache[rawName];
415
+ if (cached) return cached;
416
+ let name = (0, _vue_runtime_core.camelize)(rawName);
417
+ if (name !== "filter" && name in style) return prefixCache[rawName] = name;
418
+ name = (0, _vue_shared.capitalize)(name);
419
+ for (let i = 0; i < prefixes.length; i++) {
420
+ const prefixed = prefixes[i] + name;
421
+ if (prefixed in style) return prefixCache[rawName] = prefixed;
422
+ }
423
+ return rawName;
530
424
  }
531
425
 
426
+ //#endregion
427
+ //#region packages/runtime-dom/src/modules/attrs.ts
532
428
  const xlinkNS = "http://www.w3.org/1999/xlink";
533
- function patchAttr(el, key, value, isSVG, instance, isBoolean = shared.isSpecialBooleanAttr(key)) {
534
- if (isSVG && key.startsWith("xlink:")) {
535
- if (value == null) {
536
- el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
537
- } else {
538
- el.setAttributeNS(xlinkNS, key, value);
539
- }
540
- } else {
541
- if (value == null || isBoolean && !shared.includeBooleanAttr(value)) {
542
- el.removeAttribute(key);
543
- } else {
544
- el.setAttribute(
545
- key,
546
- isBoolean ? "" : shared.isSymbol(value) ? String(value) : value
547
- );
548
- }
549
- }
429
+ function patchAttr(el, key, value, isSVG, instance, isBoolean = (0, _vue_shared.isSpecialBooleanAttr)(key)) {
430
+ if (isSVG && key.startsWith("xlink:")) if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
431
+ else el.setAttributeNS(xlinkNS, key, value);
432
+ else if (value == null || isBoolean && !(0, _vue_shared.includeBooleanAttr)(value)) el.removeAttribute(key);
433
+ else el.setAttribute(key, isBoolean ? "" : (0, _vue_shared.isSymbol)(value) ? String(value) : value);
550
434
  }
551
435
 
436
+ //#endregion
437
+ //#region packages/runtime-dom/src/modules/props.ts
552
438
  function patchDOMProp(el, key, value, parentComponent, attrName) {
553
- if (key === "innerHTML" || key === "textContent") {
554
- if (value != null) {
555
- el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
556
- }
557
- return;
558
- }
559
- const tag = el.tagName;
560
- if (key === "value" && shared.canSetValueDirectly(tag)) {
561
- const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
562
- const newValue = value == null ? (
563
- // #11647: value should be set as empty string for null and undefined,
564
- // but <input type="checkbox"> should be set as 'on'.
565
- el.type === "checkbox" ? "on" : ""
566
- ) : String(value);
567
- if (oldValue !== newValue || !("_value" in el)) {
568
- el.value = newValue;
569
- }
570
- if (value == null) {
571
- el.removeAttribute(key);
572
- }
573
- el._value = value;
574
- return;
575
- }
576
- let needRemove = false;
577
- if (value === "" || value == null) {
578
- const type = typeof el[key];
579
- if (type === "boolean") {
580
- value = shared.includeBooleanAttr(value);
581
- } else if (value == null && type === "string") {
582
- value = "";
583
- needRemove = true;
584
- } else if (type === "number") {
585
- value = 0;
586
- needRemove = true;
587
- }
588
- }
589
- try {
590
- el[key] = value;
591
- } catch (e) {
592
- }
593
- needRemove && el.removeAttribute(attrName || key);
439
+ if (key === "innerHTML" || key === "textContent") {
440
+ if (value != null) el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
441
+ return;
442
+ }
443
+ const tag = el.tagName;
444
+ if (key === "value" && (0, _vue_shared.canSetValueDirectly)(tag)) {
445
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
446
+ const newValue = value == null ? el.type === "checkbox" ? "on" : "" : String(value);
447
+ if (oldValue !== newValue || !("_value" in el)) el.value = newValue;
448
+ if (value == null) el.removeAttribute(key);
449
+ el._value = value;
450
+ return;
451
+ }
452
+ let needRemove = false;
453
+ if (value === "" || value == null) {
454
+ const type = typeof el[key];
455
+ if (type === "boolean") value = (0, _vue_shared.includeBooleanAttr)(value);
456
+ else if (value == null && type === "string") {
457
+ value = "";
458
+ needRemove = true;
459
+ } else if (type === "number") {
460
+ value = 0;
461
+ needRemove = true;
462
+ }
463
+ }
464
+ try {
465
+ el[key] = value;
466
+ } catch (e) {}
467
+ needRemove && el.removeAttribute(attrName || key);
594
468
  }
595
469
 
470
+ //#endregion
471
+ //#region packages/runtime-dom/src/modules/events.ts
596
472
  function addEventListener(el, event, handler, options) {
597
- el.addEventListener(event, handler, options);
473
+ el.addEventListener(event, handler, options);
598
474
  }
599
475
  function removeEventListener(el, event, handler, options) {
600
- el.removeEventListener(event, handler, options);
476
+ el.removeEventListener(event, handler, options);
601
477
  }
602
- const veiKey = /* @__PURE__ */ Symbol("_vei");
478
+ const veiKey = Symbol("_vei");
603
479
  function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
604
- const invokers = el[veiKey] || (el[veiKey] = {});
605
- const existingInvoker = invokers[rawName];
606
- if (nextValue && existingInvoker) {
607
- existingInvoker.value = nextValue;
608
- } else {
609
- const [name, options] = parseName(rawName);
610
- if (nextValue) {
611
- const invoker = invokers[rawName] = createInvoker(
612
- nextValue,
613
- instance
614
- );
615
- addEventListener(el, name, invoker, options);
616
- } else if (existingInvoker) {
617
- removeEventListener(el, name, existingInvoker, options);
618
- invokers[rawName] = void 0;
619
- }
620
- }
480
+ const invokers = el[veiKey] || (el[veiKey] = {});
481
+ const existingInvoker = invokers[rawName];
482
+ if (nextValue && existingInvoker) existingInvoker.value = nextValue;
483
+ else {
484
+ const [name, options] = parseName(rawName);
485
+ if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(nextValue, instance), options);
486
+ else if (existingInvoker) {
487
+ removeEventListener(el, name, existingInvoker, options);
488
+ invokers[rawName] = void 0;
489
+ }
490
+ }
621
491
  }
622
492
  const optionsModifierRE = /(?:Once|Passive|Capture)$/;
623
493
  function parseName(name) {
624
- let options;
625
- if (optionsModifierRE.test(name)) {
626
- options = {};
627
- let m;
628
- while (m = name.match(optionsModifierRE)) {
629
- name = name.slice(0, name.length - m[0].length);
630
- options[m[0].toLowerCase()] = true;
631
- }
632
- }
633
- const event = name[2] === ":" ? name.slice(3) : shared.hyphenate(name.slice(2));
634
- return [event, options];
494
+ let options;
495
+ if (optionsModifierRE.test(name)) {
496
+ options = {};
497
+ let m;
498
+ while (m = name.match(optionsModifierRE)) {
499
+ name = name.slice(0, name.length - m[0].length);
500
+ options[m[0].toLowerCase()] = true;
501
+ }
502
+ }
503
+ return [name[2] === ":" ? name.slice(3) : (0, _vue_shared.hyphenate)(name.slice(2)), options];
635
504
  }
636
505
  let cachedNow = 0;
637
506
  const p = /* @__PURE__ */ Promise.resolve();
638
507
  const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
639
508
  function createInvoker(initialValue, instance) {
640
- const invoker = (e) => {
641
- if (!e._vts) {
642
- e._vts = Date.now();
643
- } else if (e._vts <= invoker.attached) {
644
- return;
645
- }
646
- runtimeCore.callWithAsyncErrorHandling(
647
- patchStopImmediatePropagation(e, invoker.value),
648
- instance,
649
- 5,
650
- [e]
651
- );
652
- };
653
- invoker.value = initialValue;
654
- invoker.attached = getNow();
655
- return invoker;
509
+ const invoker = (e) => {
510
+ if (!e._vts) e._vts = Date.now();
511
+ else if (e._vts <= invoker.attached) return;
512
+ (0, _vue_runtime_core.callWithAsyncErrorHandling)(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
513
+ };
514
+ invoker.value = initialValue;
515
+ invoker.attached = getNow();
516
+ return invoker;
656
517
  }
657
518
  function patchStopImmediatePropagation(e, value) {
658
- if (shared.isArray(value)) {
659
- const originalStop = e.stopImmediatePropagation;
660
- e.stopImmediatePropagation = () => {
661
- originalStop.call(e);
662
- e._stopped = true;
663
- };
664
- return value.map(
665
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
666
- );
667
- } else {
668
- return value;
669
- }
519
+ if ((0, _vue_shared.isArray)(value)) {
520
+ const originalStop = e.stopImmediatePropagation;
521
+ e.stopImmediatePropagation = () => {
522
+ originalStop.call(e);
523
+ e._stopped = true;
524
+ };
525
+ return value.map((fn) => (e) => !e._stopped && fn && fn(e));
526
+ } else return value;
670
527
  }
671
528
 
529
+ //#endregion
530
+ //#region packages/runtime-dom/src/patchProp.ts
672
531
  const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
673
- const isSVG = namespace === "svg";
674
- if (key === "class") {
675
- patchClass(el, nextValue, isSVG);
676
- } else if (key === "style") {
677
- patchStyle(el, prevValue, nextValue);
678
- } else if (shared.isOn(key)) {
679
- if (!shared.isModelListener(key)) {
680
- patchEvent(el, key, prevValue, nextValue, parentComponent);
681
- }
682
- } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
683
- patchDOMProp(el, key, nextValue);
684
- if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
685
- patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
686
- }
687
- } else if (
688
- // #11081 force set props for possible async custom element
689
- el._isVueCE && (/[A-Z]/.test(key) || !shared.isString(nextValue))
690
- ) {
691
- patchDOMProp(el, shared.camelize(key), nextValue, parentComponent, key);
692
- } else {
693
- if (key === "true-value") {
694
- el._trueValue = nextValue;
695
- } else if (key === "false-value") {
696
- el._falseValue = nextValue;
697
- }
698
- patchAttr(el, key, nextValue, isSVG);
699
- }
532
+ const isSVG = namespace === "svg";
533
+ if (key === "class") patchClass(el, nextValue, isSVG);
534
+ else if (key === "style") patchStyle(el, prevValue, nextValue);
535
+ else if ((0, _vue_shared.isOn)(key)) {
536
+ if (!(0, _vue_shared.isModelListener)(key)) patchEvent(el, key, prevValue, nextValue, parentComponent);
537
+ } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
538
+ patchDOMProp(el, key, nextValue, parentComponent);
539
+ if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
540
+ } else if (el._isVueCE && (/[A-Z]/.test(key) || !(0, _vue_shared.isString)(nextValue))) patchDOMProp(el, (0, _vue_shared.camelize)(key), nextValue, parentComponent, key);
541
+ else {
542
+ if (key === "true-value") el._trueValue = nextValue;
543
+ else if (key === "false-value") el._falseValue = nextValue;
544
+ patchAttr(el, key, nextValue, isSVG, parentComponent);
545
+ }
700
546
  };
701
547
  function shouldSetAsProp(el, key, value, isSVG) {
702
- if (isSVG) {
703
- if (key === "innerHTML" || key === "textContent") {
704
- return true;
705
- }
706
- if (key in el && shared.isNativeOn(key) && shared.isFunction(value)) {
707
- return true;
708
- }
709
- return false;
710
- }
711
- if (shared.shouldSetAsAttr(el.tagName, key)) {
712
- return false;
713
- }
714
- if (shared.isNativeOn(key) && shared.isString(value)) {
715
- return false;
716
- }
717
- return key in el;
548
+ if (isSVG) {
549
+ if (key === "innerHTML" || key === "textContent") return true;
550
+ if (key in el && (0, _vue_shared.isNativeOn)(key) && (0, _vue_shared.isFunction)(value)) return true;
551
+ return false;
552
+ }
553
+ if ((0, _vue_shared.shouldSetAsAttr)(el.tagName, key)) return false;
554
+ if ((0, _vue_shared.isNativeOn)(key) && (0, _vue_shared.isString)(value)) return false;
555
+ return key in el;
718
556
  }
719
557
 
558
+ //#endregion
559
+ //#region packages/runtime-dom/src/apiCustomElement.ts
720
560
  const REMOVAL = {};
721
- // @__NO_SIDE_EFFECTS__
561
+ /* @__NO_SIDE_EFFECTS__ */
722
562
  function defineCustomElement(options, extraOptions, _createApp) {
723
- let Comp = runtimeCore.defineComponent(options, extraOptions);
724
- if (shared.isPlainObject(Comp)) Comp = shared.extend({}, Comp, extraOptions);
725
- class VueCustomElement extends VueElement {
726
- constructor(initialProps) {
727
- super(Comp, initialProps, _createApp);
728
- }
729
- }
730
- VueCustomElement.def = Comp;
731
- return VueCustomElement;
563
+ let Comp = (0, _vue_runtime_core.defineComponent)(options, extraOptions);
564
+ if ((0, _vue_shared.isPlainObject)(Comp)) Comp = (0, _vue_shared.extend)({}, Comp, extraOptions);
565
+ class VueCustomElement extends VueElement {
566
+ constructor(initialProps) {
567
+ super(Comp, initialProps, _createApp);
568
+ }
569
+ }
570
+ VueCustomElement.def = Comp;
571
+ return VueCustomElement;
732
572
  }
733
- const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
734
- return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
573
+ const defineSSRCustomElement = ((options, extraOptions) => {
574
+ return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
735
575
  });
736
- const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
576
+ const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {};
577
+ var VueElementBase = class VueElementBase extends BaseClass {
578
+ constructor(def, props = {}, createAppFn) {
579
+ super();
580
+ this._isVueCE = true;
581
+ this._instance = null;
582
+ this._app = null;
583
+ this._connected = false;
584
+ this._resolved = false;
585
+ this._numberProps = null;
586
+ this._styleChildren = /* @__PURE__ */ new WeakSet();
587
+ this._patching = false;
588
+ this._dirty = false;
589
+ this._ob = null;
590
+ this._def = def;
591
+ this._props = props;
592
+ this._createApp = createAppFn;
593
+ this._nonce = def.nonce;
594
+ if (this._needsHydration()) this._root = this.shadowRoot;
595
+ else if (def.shadowRoot !== false) {
596
+ this.attachShadow((0, _vue_shared.extend)({}, def.shadowRootOptions, { mode: "open" }));
597
+ this._root = this.shadowRoot;
598
+ } else this._root = this;
599
+ }
600
+ connectedCallback() {
601
+ if (!this.isConnected) return;
602
+ if (!this.shadowRoot && !this._resolved) this._parseSlots();
603
+ this._connected = true;
604
+ let parent = this;
605
+ while (parent = parent && (parent.parentNode || parent.host)) if (parent instanceof VueElementBase) {
606
+ this._parent = parent;
607
+ break;
608
+ }
609
+ if (!this._instance) if (this._resolved) this._mountComponent(this._def);
610
+ else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
611
+ this._pendingResolve = void 0;
612
+ this._resolveDef();
613
+ });
614
+ else this._resolveDef();
615
+ }
616
+ disconnectedCallback() {
617
+ this._connected = false;
618
+ (0, _vue_runtime_core.nextTick)(() => {
619
+ if (!this._connected) {
620
+ if (this._ob) {
621
+ this._ob.disconnect();
622
+ this._ob = null;
623
+ }
624
+ this._unmount();
625
+ if (this._teleportTargets) {
626
+ this._teleportTargets.clear();
627
+ this._teleportTargets = void 0;
628
+ }
629
+ }
630
+ });
631
+ }
632
+ _setParent(parent = this._parent) {
633
+ if (parent && this._instance) {
634
+ this._instance.parent = parent._instance;
635
+ this._inheritParentContext(parent);
636
+ }
637
+ }
638
+ _inheritParentContext(parent = this._parent) {
639
+ if (parent && this._app) Object.setPrototypeOf(this._app._context.provides, parent._instance.provides);
640
+ }
641
+ _processMutations(mutations) {
642
+ for (const m of mutations) this._setAttr(m.attributeName);
643
+ }
644
+ /**
645
+ * resolve inner component definition (handle possible async component)
646
+ */
647
+ _resolveDef() {
648
+ if (this._pendingResolve) return;
649
+ for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
650
+ this._ob = new MutationObserver(this._processMutations.bind(this));
651
+ this._ob.observe(this, { attributes: true });
652
+ const resolve = (def) => {
653
+ this._resolved = true;
654
+ this._pendingResolve = void 0;
655
+ const { props, styles } = def;
656
+ let numberProps;
657
+ if (props && !(0, _vue_shared.isArray)(props)) for (const key in props) {
658
+ const opt = props[key];
659
+ if (opt === Number || opt && opt.type === Number) {
660
+ if (key in this._props) this._props[key] = (0, _vue_shared.toNumber)(this._props[key]);
661
+ (numberProps || (numberProps = Object.create(null)))[(0, _vue_shared.camelize)(key)] = true;
662
+ }
663
+ }
664
+ this._numberProps = numberProps;
665
+ this._resolveProps(def);
666
+ if (this.shadowRoot) this._applyStyles(styles);
667
+ this._mountComponent(def);
668
+ };
669
+ const asyncDef = this._def.__asyncLoader;
670
+ if (asyncDef) {
671
+ const { configureApp } = this._def;
672
+ this._pendingResolve = asyncDef().then((def) => {
673
+ def.configureApp = configureApp;
674
+ this._def = def;
675
+ resolve(def);
676
+ });
677
+ } else resolve(this._def);
678
+ }
679
+ _mountComponent(def) {
680
+ this._mount(def);
681
+ this._processExposed();
682
+ }
683
+ _processExposed() {
684
+ const exposed = this._instance && this._instance.exposed;
685
+ if (!exposed) return;
686
+ for (const key in exposed) if (!(0, _vue_shared.hasOwn)(this, key)) Object.defineProperty(this, key, { get: () => (0, _vue_runtime_core.unref)(exposed[key]) });
687
+ }
688
+ _processInstance() {
689
+ this._instance.ce = this;
690
+ this._instance.isCE = true;
691
+ const dispatch = (event, args) => {
692
+ this.dispatchEvent(new CustomEvent(event, (0, _vue_shared.isPlainObject)(args[0]) ? (0, _vue_shared.extend)({ detail: args }, args[0]) : { detail: args }));
693
+ };
694
+ this._instance.emit = (event, ...args) => {
695
+ dispatch(event, args);
696
+ if ((0, _vue_shared.hyphenate)(event) !== event) dispatch((0, _vue_shared.hyphenate)(event), args);
697
+ };
698
+ this._setParent();
699
+ }
700
+ _resolveProps(def) {
701
+ const { props } = def;
702
+ const declaredPropKeys = (0, _vue_shared.isArray)(props) ? props : Object.keys(props || {});
703
+ for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
704
+ for (const key of declaredPropKeys.map(_vue_shared.camelize)) Object.defineProperty(this, key, {
705
+ get() {
706
+ return this._getProp(key);
707
+ },
708
+ set(val) {
709
+ this._setProp(key, val, true, !this._patching);
710
+ }
711
+ });
712
+ }
713
+ _setAttr(key) {
714
+ if (key.startsWith("data-v-")) return;
715
+ const has = this.hasAttribute(key);
716
+ let value = has ? this.getAttribute(key) : REMOVAL;
717
+ const camelKey = (0, _vue_shared.camelize)(key);
718
+ if (has && this._numberProps && this._numberProps[camelKey]) value = (0, _vue_shared.toNumber)(value);
719
+ this._setProp(camelKey, value, false, true);
720
+ }
721
+ /**
722
+ * @internal
723
+ */
724
+ _getProp(key) {
725
+ return this._props[key];
726
+ }
727
+ /**
728
+ * @internal
729
+ */
730
+ _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
731
+ if (val !== this._props[key]) {
732
+ this._dirty = true;
733
+ if (val === REMOVAL) delete this._props[key];
734
+ else {
735
+ this._props[key] = val;
736
+ if (key === "key" && this._app && this._app._ceVNode) this._app._ceVNode.key = val;
737
+ }
738
+ if (shouldUpdate && this._instance) this._update();
739
+ if (shouldReflect) {
740
+ const ob = this._ob;
741
+ if (ob) {
742
+ this._processMutations(ob.takeRecords());
743
+ ob.disconnect();
744
+ }
745
+ if (val === true) this.setAttribute((0, _vue_shared.hyphenate)(key), "");
746
+ else if (typeof val === "string" || typeof val === "number") this.setAttribute((0, _vue_shared.hyphenate)(key), val + "");
747
+ else if (!val) this.removeAttribute((0, _vue_shared.hyphenate)(key));
748
+ ob && ob.observe(this, { attributes: true });
749
+ }
750
+ }
751
+ }
752
+ _applyStyles(styles, owner) {
753
+ if (!styles) return;
754
+ if (owner) {
755
+ if (owner === this._def || this._styleChildren.has(owner)) return;
756
+ this._styleChildren.add(owner);
757
+ }
758
+ const nonce = this._nonce;
759
+ for (let i = styles.length - 1; i >= 0; i--) {
760
+ const s = document.createElement("style");
761
+ if (nonce) s.setAttribute("nonce", nonce);
762
+ s.textContent = styles[i];
763
+ this.shadowRoot.prepend(s);
764
+ }
765
+ }
766
+ /**
767
+ * Only called when shadowRoot is false
768
+ */
769
+ _parseSlots() {
770
+ const slots = this._slots = {};
771
+ let n;
772
+ while (n = this.firstChild) {
773
+ const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
774
+ (slots[slotName] || (slots[slotName] = [])).push(n);
775
+ this.removeChild(n);
776
+ }
777
+ }
778
+ /**
779
+ * Only called when shadowRoot is false
780
+ */
781
+ _renderSlots() {
782
+ const outlets = this._getSlots();
783
+ const scopeId = this._instance.type.__scopeId;
784
+ const slotReplacements = /* @__PURE__ */ new Map();
785
+ for (let i = 0; i < outlets.length; i++) {
786
+ const o = outlets[i];
787
+ const slotName = o.getAttribute("name") || "default";
788
+ const content = this._slots[slotName];
789
+ const parent = o.parentNode;
790
+ const replacementNodes = [];
791
+ if (content) for (const n of content) {
792
+ if (scopeId && n.nodeType === 1) {
793
+ const id = scopeId + "-s";
794
+ const walker = document.createTreeWalker(n, 1);
795
+ n.setAttribute(id, "");
796
+ let child;
797
+ while (child = walker.nextNode()) child.setAttribute(id, "");
798
+ }
799
+ parent.insertBefore(n, o);
800
+ replacementNodes.push(n);
801
+ }
802
+ else while (o.firstChild) {
803
+ const child = o.firstChild;
804
+ parent.insertBefore(child, o);
805
+ replacementNodes.push(child);
806
+ }
807
+ parent.removeChild(o);
808
+ slotReplacements.set(o, replacementNodes);
809
+ }
810
+ this._updateSlotNodes(slotReplacements);
811
+ }
812
+ /**
813
+ * @internal
814
+ */
815
+ _getSlots() {
816
+ const roots = [this];
817
+ if (this._teleportTargets) roots.push(...this._teleportTargets);
818
+ const slots = /* @__PURE__ */ new Set();
819
+ for (const root of roots) {
820
+ const found = root.querySelectorAll("slot");
821
+ for (let i = 0; i < found.length; i++) slots.add(found[i]);
822
+ }
823
+ return Array.from(slots);
824
+ }
825
+ /**
826
+ * @internal
827
+ */
828
+ _injectChildStyle(comp) {
829
+ this._applyStyles(comp.styles, comp);
830
+ }
831
+ /**
832
+ * @internal
833
+ */
834
+ _beginPatch() {
835
+ this._patching = true;
836
+ this._dirty = false;
837
+ }
838
+ /**
839
+ * @internal
840
+ */
841
+ _endPatch() {
842
+ this._patching = false;
843
+ if (this._dirty && this._instance) this._update();
844
+ }
845
+ /**
846
+ * @internal
847
+ */
848
+ _hasShadowRoot() {
849
+ return this._def.shadowRoot !== false;
850
+ }
851
+ /**
852
+ * @internal
853
+ */
854
+ _removeChildStyle(comp) {}
855
+ };
856
+ var VueElement = class extends VueElementBase {
857
+ constructor(def, props = {}, createAppFn = createApp) {
858
+ super(def, props, createAppFn);
859
+ }
860
+ _needsHydration() {
861
+ if (this.shadowRoot && this._createApp !== createApp) return true;
862
+ return false;
863
+ }
864
+ _mount(def) {
865
+ this._app = this._createApp(def);
866
+ this._inheritParentContext();
867
+ if (def.configureApp) def.configureApp(this._app);
868
+ this._app._ceVNode = this._createVNode();
869
+ this._app.mount(this._root);
870
+ }
871
+ _update() {
872
+ if (!this._app) return;
873
+ const vnode = this._createVNode();
874
+ vnode.appContext = this._app._context;
875
+ render(vnode, this._root);
876
+ }
877
+ _unmount() {
878
+ if (this._app) this._app.unmount();
879
+ if (this._instance && this._instance.ce) this._instance.ce = void 0;
880
+ this._app = this._instance = null;
881
+ }
882
+ /**
883
+ * Only called when shadowRoot is false
884
+ */
885
+ _updateSlotNodes(replacements) {}
886
+ _createVNode() {
887
+ const baseProps = {};
888
+ if (!this.shadowRoot) baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
889
+ const vnode = (0, _vue_runtime_core.createVNode)(this._def, (0, _vue_shared.extend)(baseProps, this._props));
890
+ if (!this._instance) vnode.ce = (instance) => {
891
+ this._instance = instance;
892
+ this._processInstance();
893
+ };
894
+ return vnode;
895
+ }
737
896
  };
738
- class VueElementBase extends BaseClass {
739
- constructor(def, props = {}, createAppFn) {
740
- super();
741
- this._isVueCE = true;
742
- /**
743
- * @internal
744
- */
745
- this._instance = null;
746
- /**
747
- * @internal
748
- */
749
- this._app = null;
750
- this._connected = false;
751
- this._resolved = false;
752
- this._numberProps = null;
753
- this._styleChildren = /* @__PURE__ */ new WeakSet();
754
- this._patching = false;
755
- this._dirty = false;
756
- this._ob = null;
757
- this._def = def;
758
- this._props = props;
759
- this._createApp = createAppFn;
760
- this._nonce = def.nonce;
761
- if (this._needsHydration()) {
762
- this._root = this.shadowRoot;
763
- } else {
764
- if (def.shadowRoot !== false) {
765
- this.attachShadow(
766
- shared.extend({}, def.shadowRootOptions, {
767
- mode: "open"
768
- })
769
- );
770
- this._root = this.shadowRoot;
771
- } else {
772
- this._root = this;
773
- }
774
- }
775
- }
776
- connectedCallback() {
777
- if (!this.isConnected) return;
778
- if (!this.shadowRoot && !this._resolved) {
779
- this._parseSlots();
780
- }
781
- this._connected = true;
782
- let parent = this;
783
- while (parent = parent && (parent.parentNode || parent.host)) {
784
- if (parent instanceof VueElementBase) {
785
- this._parent = parent;
786
- break;
787
- }
788
- }
789
- if (!this._instance) {
790
- if (this._resolved) {
791
- this._mountComponent(this._def);
792
- } else {
793
- if (parent && parent._pendingResolve) {
794
- this._pendingResolve = parent._pendingResolve.then(() => {
795
- this._pendingResolve = void 0;
796
- this._resolveDef();
797
- });
798
- } else {
799
- this._resolveDef();
800
- }
801
- }
802
- }
803
- }
804
- disconnectedCallback() {
805
- this._connected = false;
806
- runtimeCore.nextTick(() => {
807
- if (!this._connected) {
808
- if (this._ob) {
809
- this._ob.disconnect();
810
- this._ob = null;
811
- }
812
- this._unmount();
813
- if (this._teleportTargets) {
814
- this._teleportTargets.clear();
815
- this._teleportTargets = void 0;
816
- }
817
- }
818
- });
819
- }
820
- _setParent(parent = this._parent) {
821
- if (parent && this._instance) {
822
- this._instance.parent = parent._instance;
823
- this._inheritParentContext(parent);
824
- }
825
- }
826
- _inheritParentContext(parent = this._parent) {
827
- if (parent && this._app) {
828
- Object.setPrototypeOf(
829
- this._app._context.provides,
830
- parent._instance.provides
831
- );
832
- }
833
- }
834
- _processMutations(mutations) {
835
- for (const m of mutations) {
836
- this._setAttr(m.attributeName);
837
- }
838
- }
839
- /**
840
- * resolve inner component definition (handle possible async component)
841
- */
842
- _resolveDef() {
843
- if (this._pendingResolve) {
844
- return;
845
- }
846
- for (let i = 0; i < this.attributes.length; i++) {
847
- this._setAttr(this.attributes[i].name);
848
- }
849
- this._ob = new MutationObserver(this._processMutations.bind(this));
850
- this._ob.observe(this, { attributes: true });
851
- const resolve = (def) => {
852
- this._resolved = true;
853
- this._pendingResolve = void 0;
854
- const { props, styles } = def;
855
- let numberProps;
856
- if (props && !shared.isArray(props)) {
857
- for (const key in props) {
858
- const opt = props[key];
859
- if (opt === Number || opt && opt.type === Number) {
860
- if (key in this._props) {
861
- this._props[key] = shared.toNumber(this._props[key]);
862
- }
863
- (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[shared.camelize(key)] = true;
864
- }
865
- }
866
- }
867
- this._numberProps = numberProps;
868
- this._resolveProps(def);
869
- if (this.shadowRoot) {
870
- this._applyStyles(styles);
871
- }
872
- this._mountComponent(def);
873
- };
874
- const asyncDef = this._def.__asyncLoader;
875
- if (asyncDef) {
876
- const { configureApp } = this._def;
877
- this._pendingResolve = asyncDef().then((def) => {
878
- def.configureApp = configureApp;
879
- this._def = def;
880
- resolve(def);
881
- });
882
- } else {
883
- resolve(this._def);
884
- }
885
- }
886
- _mountComponent(def) {
887
- this._mount(def);
888
- this._processExposed();
889
- }
890
- _processExposed() {
891
- const exposed = this._instance && this._instance.exposed;
892
- if (!exposed) return;
893
- for (const key in exposed) {
894
- if (!shared.hasOwn(this, key)) {
895
- Object.defineProperty(this, key, {
896
- // unwrap ref to be consistent with public instance behavior
897
- get: () => runtimeCore.unref(exposed[key])
898
- });
899
- }
900
- }
901
- }
902
- _processInstance() {
903
- this._instance.ce = this;
904
- this._instance.isCE = true;
905
- const dispatch = (event, args) => {
906
- this.dispatchEvent(
907
- new CustomEvent(
908
- event,
909
- shared.isPlainObject(args[0]) ? shared.extend({ detail: args }, args[0]) : { detail: args }
910
- )
911
- );
912
- };
913
- this._instance.emit = (event, ...args) => {
914
- dispatch(event, args);
915
- if (shared.hyphenate(event) !== event) {
916
- dispatch(shared.hyphenate(event), args);
917
- }
918
- };
919
- this._setParent();
920
- }
921
- _resolveProps(def) {
922
- const { props } = def;
923
- const declaredPropKeys = shared.isArray(props) ? props : Object.keys(props || {});
924
- for (const key of Object.keys(this)) {
925
- if (key[0] !== "_" && declaredPropKeys.includes(key)) {
926
- this._setProp(key, this[key]);
927
- }
928
- }
929
- for (const key of declaredPropKeys.map(shared.camelize)) {
930
- Object.defineProperty(this, key, {
931
- get() {
932
- return this._getProp(key);
933
- },
934
- set(val) {
935
- this._setProp(key, val, true, !this._patching);
936
- }
937
- });
938
- }
939
- }
940
- _setAttr(key) {
941
- if (key.startsWith("data-v-")) return;
942
- const has = this.hasAttribute(key);
943
- let value = has ? this.getAttribute(key) : REMOVAL;
944
- const camelKey = shared.camelize(key);
945
- if (has && this._numberProps && this._numberProps[camelKey]) {
946
- value = shared.toNumber(value);
947
- }
948
- this._setProp(camelKey, value, false, true);
949
- }
950
- /**
951
- * @internal
952
- */
953
- _getProp(key) {
954
- return this._props[key];
955
- }
956
- /**
957
- * @internal
958
- */
959
- _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
960
- if (val !== this._props[key]) {
961
- this._dirty = true;
962
- if (val === REMOVAL) {
963
- delete this._props[key];
964
- } else {
965
- this._props[key] = val;
966
- if (key === "key" && this._app && this._app._ceVNode) {
967
- this._app._ceVNode.key = val;
968
- }
969
- }
970
- if (shouldUpdate && this._instance) {
971
- this._update();
972
- }
973
- if (shouldReflect) {
974
- const ob = this._ob;
975
- if (ob) {
976
- this._processMutations(ob.takeRecords());
977
- ob.disconnect();
978
- }
979
- if (val === true) {
980
- this.setAttribute(shared.hyphenate(key), "");
981
- } else if (typeof val === "string" || typeof val === "number") {
982
- this.setAttribute(shared.hyphenate(key), val + "");
983
- } else if (!val) {
984
- this.removeAttribute(shared.hyphenate(key));
985
- }
986
- ob && ob.observe(this, { attributes: true });
987
- }
988
- }
989
- }
990
- _applyStyles(styles, owner) {
991
- if (!styles) return;
992
- if (owner) {
993
- if (owner === this._def || this._styleChildren.has(owner)) {
994
- return;
995
- }
996
- this._styleChildren.add(owner);
997
- }
998
- const nonce = this._nonce;
999
- for (let i = styles.length - 1; i >= 0; i--) {
1000
- const s = document.createElement("style");
1001
- if (nonce) s.setAttribute("nonce", nonce);
1002
- s.textContent = styles[i];
1003
- this.shadowRoot.prepend(s);
1004
- }
1005
- }
1006
- /**
1007
- * Only called when shadowRoot is false
1008
- */
1009
- _parseSlots() {
1010
- const slots = this._slots = {};
1011
- let n;
1012
- while (n = this.firstChild) {
1013
- const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
1014
- (slots[slotName] || (slots[slotName] = [])).push(n);
1015
- this.removeChild(n);
1016
- }
1017
- }
1018
- /**
1019
- * Only called when shadowRoot is false
1020
- */
1021
- _renderSlots() {
1022
- const outlets = this._getSlots();
1023
- const scopeId = this._instance.type.__scopeId;
1024
- const slotReplacements = /* @__PURE__ */ new Map();
1025
- for (let i = 0; i < outlets.length; i++) {
1026
- const o = outlets[i];
1027
- const slotName = o.getAttribute("name") || "default";
1028
- const content = this._slots[slotName];
1029
- const parent = o.parentNode;
1030
- const replacementNodes = [];
1031
- if (content) {
1032
- for (const n of content) {
1033
- if (scopeId && n.nodeType === 1) {
1034
- const id = scopeId + "-s";
1035
- const walker = document.createTreeWalker(n, 1);
1036
- n.setAttribute(id, "");
1037
- let child;
1038
- while (child = walker.nextNode()) {
1039
- child.setAttribute(id, "");
1040
- }
1041
- }
1042
- parent.insertBefore(n, o);
1043
- replacementNodes.push(n);
1044
- }
1045
- } else {
1046
- while (o.firstChild) {
1047
- const child = o.firstChild;
1048
- parent.insertBefore(child, o);
1049
- replacementNodes.push(child);
1050
- }
1051
- }
1052
- parent.removeChild(o);
1053
- slotReplacements.set(o, replacementNodes);
1054
- }
1055
- this._updateSlotNodes(slotReplacements);
1056
- }
1057
- /**
1058
- * @internal
1059
- */
1060
- _getSlots() {
1061
- const roots = [this];
1062
- if (this._teleportTargets) {
1063
- roots.push(...this._teleportTargets);
1064
- }
1065
- const slots = /* @__PURE__ */ new Set();
1066
- for (const root of roots) {
1067
- const found = root.querySelectorAll("slot");
1068
- for (let i = 0; i < found.length; i++) {
1069
- slots.add(found[i]);
1070
- }
1071
- }
1072
- return Array.from(slots);
1073
- }
1074
- /**
1075
- * @internal
1076
- */
1077
- _injectChildStyle(comp) {
1078
- this._applyStyles(comp.styles, comp);
1079
- }
1080
- /**
1081
- * @internal
1082
- */
1083
- _beginPatch() {
1084
- this._patching = true;
1085
- this._dirty = false;
1086
- }
1087
- /**
1088
- * @internal
1089
- */
1090
- _endPatch() {
1091
- this._patching = false;
1092
- if (this._dirty && this._instance) {
1093
- this._update();
1094
- }
1095
- }
1096
- /**
1097
- * @internal
1098
- */
1099
- _hasShadowRoot() {
1100
- return this._def.shadowRoot !== false;
1101
- }
1102
- /**
1103
- * @internal
1104
- */
1105
- _removeChildStyle(comp) {
1106
- }
1107
- }
1108
- class VueElement extends VueElementBase {
1109
- constructor(def, props = {}, createAppFn = createApp) {
1110
- super(def, props, createAppFn);
1111
- }
1112
- _needsHydration() {
1113
- if (this.shadowRoot && this._createApp !== createApp) {
1114
- return true;
1115
- }
1116
- return false;
1117
- }
1118
- _mount(def) {
1119
- this._app = this._createApp(def);
1120
- this._inheritParentContext();
1121
- if (def.configureApp) {
1122
- def.configureApp(this._app);
1123
- }
1124
- this._app._ceVNode = this._createVNode();
1125
- this._app.mount(this._root);
1126
- }
1127
- _update() {
1128
- if (!this._app) return;
1129
- const vnode = this._createVNode();
1130
- vnode.appContext = this._app._context;
1131
- render(vnode, this._root);
1132
- }
1133
- _unmount() {
1134
- if (this._app) {
1135
- this._app.unmount();
1136
- }
1137
- if (this._instance && this._instance.ce) {
1138
- this._instance.ce = void 0;
1139
- }
1140
- this._app = this._instance = null;
1141
- }
1142
- /**
1143
- * Only called when shadowRoot is false
1144
- */
1145
- _updateSlotNodes(replacements) {
1146
- }
1147
- _createVNode() {
1148
- const baseProps = {};
1149
- if (!this.shadowRoot) {
1150
- baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
1151
- }
1152
- const vnode = runtimeCore.createVNode(this._def, shared.extend(baseProps, this._props));
1153
- if (!this._instance) {
1154
- vnode.ce = (instance) => {
1155
- this._instance = instance;
1156
- this._processInstance();
1157
- };
1158
- }
1159
- return vnode;
1160
- }
1161
- }
1162
897
  function useHost(caller) {
1163
- const { hasInstance, value } = runtimeCore.useInstanceOption("ce", true);
1164
- const el = value;
1165
- if (el) {
1166
- return el;
1167
- }
1168
- return null;
898
+ const { hasInstance, value } = (0, _vue_runtime_core.useInstanceOption)("ce", true);
899
+ const el = value;
900
+ if (el) return el;
901
+ return null;
1169
902
  }
903
+ /**
904
+ * Retrieve the shadowRoot of the current custom element. Only usable in setup()
905
+ * of a `defineCustomElement` component.
906
+ */
1170
907
  function useShadowRoot() {
1171
- const el = useHost();
1172
- return el && el.shadowRoot;
908
+ const el = useHost();
909
+ return el && el.shadowRoot;
1173
910
  }
1174
911
 
912
+ //#endregion
913
+ //#region packages/runtime-dom/src/helpers/useCssModule.ts
1175
914
  function useCssModule(name = "$style") {
1176
- {
1177
- const { hasInstance, value: type } = runtimeCore.useInstanceOption("type", true);
1178
- if (!hasInstance) {
1179
- return shared.EMPTY_OBJ;
1180
- }
1181
- const modules = type.__cssModules;
1182
- if (!modules) {
1183
- return shared.EMPTY_OBJ;
1184
- }
1185
- const mod = modules[name];
1186
- if (!mod) {
1187
- return shared.EMPTY_OBJ;
1188
- }
1189
- return mod;
1190
- }
915
+ {
916
+ const { hasInstance, value: type } = (0, _vue_runtime_core.useInstanceOption)("type", true);
917
+ if (!hasInstance) return _vue_shared.EMPTY_OBJ;
918
+ const modules = type.__cssModules;
919
+ if (!modules) return _vue_shared.EMPTY_OBJ;
920
+ const mod = modules[name];
921
+ if (!mod) return _vue_shared.EMPTY_OBJ;
922
+ return mod;
923
+ }
1191
924
  }
1192
925
 
926
+ //#endregion
927
+ //#region packages/runtime-dom/src/components/TransitionGroup.ts
1193
928
  const positionMap = /* @__PURE__ */ new WeakMap();
1194
929
  const newPositionMap = /* @__PURE__ */ new WeakMap();
1195
- const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
1196
- const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
930
+ const moveCbKey = Symbol("_moveCb");
931
+ const enterCbKey = Symbol("_enterCb");
932
+ /**
933
+ * Wrap logic that modifies TransitionGroup properties in a function
934
+ * so that it can be annotated as pure
935
+ */
1197
936
  const decorate = (t) => {
1198
- delete t.props.mode;
1199
- return t;
937
+ delete t.props.mode;
938
+ return t;
1200
939
  };
1201
940
  const TransitionGroupImpl = /* @__PURE__ */ decorate({
1202
- name: "TransitionGroup",
1203
- props: /* @__PURE__ */ shared.extend({}, TransitionPropsValidators, {
1204
- tag: String,
1205
- moveClass: String
1206
- }),
1207
- setup(props, { slots }) {
1208
- const instance = runtimeCore.getCurrentInstance();
1209
- const state = runtimeCore.useTransitionState();
1210
- let prevChildren;
1211
- let children;
1212
- runtimeCore.onUpdated(() => {
1213
- if (!prevChildren.length) {
1214
- return;
1215
- }
1216
- const moveClass = props.moveClass || `${props.name || "v"}-move`;
1217
- if (!hasCSSTransform(
1218
- prevChildren[0].el,
1219
- instance.vnode.el,
1220
- moveClass
1221
- )) {
1222
- prevChildren = [];
1223
- return;
1224
- }
1225
- prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
1226
- prevChildren.forEach(recordPosition);
1227
- const movedChildren = prevChildren.filter(applyTranslation);
1228
- forceReflow(instance.vnode.el);
1229
- movedChildren.forEach((c) => {
1230
- const el = c.el;
1231
- handleMovedChildren(el, moveClass);
1232
- });
1233
- prevChildren = [];
1234
- });
1235
- return () => {
1236
- const rawProps = runtimeCore.toRaw(props);
1237
- const cssTransitionProps = resolveTransitionProps(rawProps);
1238
- let tag = rawProps.tag || runtimeCore.Fragment;
1239
- prevChildren = [];
1240
- if (children) {
1241
- for (let i = 0; i < children.length; i++) {
1242
- const child = children[i];
1243
- if (child.el && child.el instanceof Element) {
1244
- prevChildren.push(child);
1245
- runtimeCore.setTransitionHooks(
1246
- child,
1247
- runtimeCore.resolveTransitionHooks(
1248
- child,
1249
- cssTransitionProps,
1250
- state,
1251
- instance
1252
- )
1253
- );
1254
- positionMap.set(child, {
1255
- left: child.el.offsetLeft,
1256
- top: child.el.offsetTop
1257
- });
1258
- }
1259
- }
1260
- }
1261
- children = slots.default ? runtimeCore.getTransitionRawChildren(slots.default()) : [];
1262
- for (let i = 0; i < children.length; i++) {
1263
- const child = children[i];
1264
- if (child.key != null) {
1265
- runtimeCore.setTransitionHooks(
1266
- child,
1267
- runtimeCore.resolveTransitionHooks(child, cssTransitionProps, state, instance)
1268
- );
1269
- }
1270
- }
1271
- return runtimeCore.createVNode(tag, null, children);
1272
- };
1273
- }
941
+ name: "TransitionGroup",
942
+ props: /* @__PURE__ */ (0, _vue_shared.extend)({}, TransitionPropsValidators, {
943
+ tag: String,
944
+ moveClass: String
945
+ }),
946
+ setup(props, { slots }) {
947
+ const instance = (0, _vue_runtime_core.getCurrentInstance)();
948
+ const state = (0, _vue_runtime_core.useTransitionState)();
949
+ let prevChildren;
950
+ let children;
951
+ (0, _vue_runtime_core.onUpdated)(() => {
952
+ if (!prevChildren.length) return;
953
+ const moveClass = props.moveClass || `${props.name || "v"}-move`;
954
+ if (!hasCSSTransform(prevChildren[0].el, instance.vnode.el, moveClass)) {
955
+ prevChildren = [];
956
+ return;
957
+ }
958
+ prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
959
+ prevChildren.forEach(recordPosition);
960
+ const movedChildren = prevChildren.filter(applyTranslation);
961
+ forceReflow(instance.vnode.el);
962
+ movedChildren.forEach((c) => {
963
+ const el = c.el;
964
+ handleMovedChildren(el, moveClass);
965
+ });
966
+ prevChildren = [];
967
+ });
968
+ return () => {
969
+ const rawProps = (0, _vue_runtime_core.toRaw)(props);
970
+ const cssTransitionProps = resolveTransitionProps(rawProps);
971
+ let tag = rawProps.tag || _vue_runtime_core.Fragment;
972
+ prevChildren = [];
973
+ if (children) for (let i = 0; i < children.length; i++) {
974
+ const child = children[i];
975
+ if (child.el && child.el instanceof Element) {
976
+ prevChildren.push(child);
977
+ (0, _vue_runtime_core.setTransitionHooks)(child, (0, _vue_runtime_core.resolveTransitionHooks)(child, cssTransitionProps, state, instance));
978
+ positionMap.set(child, {
979
+ left: child.el.offsetLeft,
980
+ top: child.el.offsetTop
981
+ });
982
+ }
983
+ }
984
+ children = slots.default ? (0, _vue_runtime_core.getTransitionRawChildren)(slots.default()) : [];
985
+ for (let i = 0; i < children.length; i++) {
986
+ const child = children[i];
987
+ if (child.key != null) (0, _vue_runtime_core.setTransitionHooks)(child, (0, _vue_runtime_core.resolveTransitionHooks)(child, cssTransitionProps, state, instance));
988
+ }
989
+ return (0, _vue_runtime_core.createVNode)(tag, null, children);
990
+ };
991
+ }
1274
992
  });
1275
993
  const TransitionGroup = TransitionGroupImpl;
1276
994
  function callPendingCbs(el) {
1277
- if (el[moveCbKey]) {
1278
- el[moveCbKey]();
1279
- }
1280
- if (el[enterCbKey]) {
1281
- el[enterCbKey]();
1282
- }
995
+ if (el[moveCbKey]) el[moveCbKey]();
996
+ if (el[enterCbKey]) el[enterCbKey]();
1283
997
  }
1284
998
  function recordPosition(c) {
1285
- newPositionMap.set(c, {
1286
- left: c.el.offsetLeft,
1287
- top: c.el.offsetTop
1288
- });
999
+ newPositionMap.set(c, {
1000
+ left: c.el.offsetLeft,
1001
+ top: c.el.offsetTop
1002
+ });
1289
1003
  }
1290
1004
  function applyTranslation(c) {
1291
- if (baseApplyTranslation(
1292
- positionMap.get(c),
1293
- newPositionMap.get(c),
1294
- c.el
1295
- )) {
1296
- return c;
1297
- }
1005
+ if (baseApplyTranslation(positionMap.get(c), newPositionMap.get(c), c.el)) return c;
1298
1006
  }
1299
1007
  function baseApplyTranslation(oldPos, newPos, el) {
1300
- const dx = oldPos.left - newPos.left;
1301
- const dy = oldPos.top - newPos.top;
1302
- if (dx || dy) {
1303
- const s = el.style;
1304
- s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
1305
- s.transitionDuration = "0s";
1306
- return true;
1307
- }
1308
- return false;
1008
+ const dx = oldPos.left - newPos.left;
1009
+ const dy = oldPos.top - newPos.top;
1010
+ if (dx || dy) {
1011
+ const s = el.style;
1012
+ s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
1013
+ s.transitionDuration = "0s";
1014
+ return true;
1015
+ }
1016
+ return false;
1309
1017
  }
1310
1018
  function hasCSSTransform(el, root, moveClass) {
1311
- const clone = el.cloneNode();
1312
- const _vtc = el[vtcKey];
1313
- if (_vtc) {
1314
- _vtc.forEach((cls) => {
1315
- cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
1316
- });
1317
- }
1318
- moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
1319
- clone.style.display = "none";
1320
- const container = root.nodeType === 1 ? root : root.parentNode;
1321
- container.appendChild(clone);
1322
- const { hasTransform } = getTransitionInfo(clone);
1323
- container.removeChild(clone);
1324
- return hasTransform;
1019
+ const clone = el.cloneNode();
1020
+ const _vtc = el[vtcKey];
1021
+ if (_vtc) _vtc.forEach((cls) => {
1022
+ cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
1023
+ });
1024
+ moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
1025
+ clone.style.display = "none";
1026
+ const container = root.nodeType === 1 ? root : root.parentNode;
1027
+ container.appendChild(clone);
1028
+ const { hasTransform } = getTransitionInfo(clone);
1029
+ container.removeChild(clone);
1030
+ return hasTransform;
1325
1031
  }
1326
1032
  const handleMovedChildren = (el, moveClass) => {
1327
- const style = el.style;
1328
- addTransitionClass(el, moveClass);
1329
- style.transform = style.webkitTransform = style.transitionDuration = "";
1330
- const cb = el[moveCbKey] = (e) => {
1331
- if (e && e.target !== el) {
1332
- return;
1333
- }
1334
- if (!e || e.propertyName.endsWith("transform")) {
1335
- el.removeEventListener("transitionend", cb);
1336
- el[moveCbKey] = null;
1337
- removeTransitionClass(el, moveClass);
1338
- }
1339
- };
1340
- el.addEventListener("transitionend", cb);
1033
+ const style = el.style;
1034
+ addTransitionClass(el, moveClass);
1035
+ style.transform = style.webkitTransform = style.transitionDuration = "";
1036
+ const cb = el[moveCbKey] = (e) => {
1037
+ if (e && e.target !== el) return;
1038
+ if (!e || e.propertyName.endsWith("transform")) {
1039
+ el.removeEventListener("transitionend", cb);
1040
+ el[moveCbKey] = null;
1041
+ removeTransitionClass(el, moveClass);
1042
+ }
1043
+ };
1044
+ el.addEventListener("transitionend", cb);
1341
1045
  };
1342
1046
 
1047
+ //#endregion
1048
+ //#region packages/runtime-dom/src/directives/vModel.ts
1343
1049
  const getModelAssigner = (vnode) => {
1344
- const fn = vnode.props["onUpdate:modelValue"] || false;
1345
- return shared.isArray(fn) ? (value) => shared.invokeArrayFns(fn, value) : fn;
1050
+ const fn = vnode.props["onUpdate:modelValue"] || false;
1051
+ return (0, _vue_shared.isArray)(fn) ? (value) => (0, _vue_shared.invokeArrayFns)(fn, value) : fn;
1346
1052
  };
1347
1053
  function onCompositionStart(e) {
1348
- e.target.composing = true;
1054
+ e.target.composing = true;
1349
1055
  }
1350
1056
  function onCompositionEnd(e) {
1351
- const target = e.target;
1352
- if (target.composing) {
1353
- target.composing = false;
1354
- target.dispatchEvent(new Event("input"));
1355
- }
1057
+ const target = e.target;
1058
+ if (target.composing) {
1059
+ target.composing = false;
1060
+ target.dispatchEvent(new Event("input"));
1061
+ }
1356
1062
  }
1357
- const assignKey = /* @__PURE__ */ Symbol("_assign");
1063
+ const assignKey = Symbol("_assign");
1358
1064
  const vModelText = {
1359
- created(el, { modifiers: { lazy, trim, number } }, vnode) {
1360
- el[assignKey] = getModelAssigner(vnode);
1361
- vModelTextInit(
1362
- el,
1363
- trim,
1364
- number || !!(vnode.props && vnode.props.type === "number"),
1365
- lazy
1366
- );
1367
- },
1368
- // set value on mounted so it's after min/max for type="range"
1369
- mounted(el, { value }) {
1370
- el.value = value == null ? "" : value;
1371
- },
1372
- beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
1373
- el[assignKey] = getModelAssigner(vnode);
1374
- vModelTextUpdate(el, oldValue, value, trim, number, lazy);
1375
- }
1065
+ created(el, { modifiers: { lazy, trim, number } }, vnode) {
1066
+ el[assignKey] = getModelAssigner(vnode);
1067
+ vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
1068
+ },
1069
+ mounted(el, { value }) {
1070
+ el.value = value == null ? "" : value;
1071
+ },
1072
+ beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
1073
+ el[assignKey] = getModelAssigner(vnode);
1074
+ vModelTextUpdate(el, oldValue, value, trim, number, lazy);
1075
+ }
1376
1076
  };
1377
1077
  function castValue(value, trim, number) {
1378
- if (trim) value = value.trim();
1379
- if (number) value = shared.looseToNumber(value);
1380
- return value;
1078
+ if (trim) value = value.trim();
1079
+ if (number) value = (0, _vue_shared.looseToNumber)(value);
1080
+ return value;
1381
1081
  }
1082
+ /**
1083
+ * @internal
1084
+ */
1382
1085
  const vModelTextInit = (el, trim, number, lazy, set) => {
1383
- addEventListener(el, lazy ? "change" : "input", (e) => {
1384
- if (e.target.composing) return;
1385
- (0, el[assignKey])(
1386
- castValue(el.value, trim, number || el.type === "number")
1387
- );
1388
- });
1389
- if (trim || number) {
1390
- addEventListener(el, "change", () => {
1391
- el.value = castValue(el.value, trim, number || el.type === "number");
1392
- });
1393
- }
1394
- if (!lazy) {
1395
- addEventListener(el, "compositionstart", onCompositionStart);
1396
- addEventListener(el, "compositionend", onCompositionEnd);
1397
- addEventListener(el, "change", onCompositionEnd);
1398
- }
1086
+ addEventListener(el, lazy ? "change" : "input", (e) => {
1087
+ if (e.target.composing) return;
1088
+ (set || el[assignKey])(castValue(el.value, trim, number || el.type === "number"));
1089
+ });
1090
+ if (trim || number) addEventListener(el, "change", () => {
1091
+ el.value = castValue(el.value, trim, number || el.type === "number");
1092
+ });
1093
+ if (!lazy) {
1094
+ addEventListener(el, "compositionstart", onCompositionStart);
1095
+ addEventListener(el, "compositionend", onCompositionEnd);
1096
+ addEventListener(el, "change", onCompositionEnd);
1097
+ }
1399
1098
  };
1099
+ /**
1100
+ * @internal
1101
+ */
1400
1102
  const vModelTextUpdate = (el, oldValue, value, trim, number, lazy) => {
1401
- if (el.composing) return;
1402
- const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? shared.looseToNumber(el.value) : el.value;
1403
- const newValue = value == null ? "" : value;
1404
- if (elValue === newValue) {
1405
- return;
1406
- }
1407
- if (document.activeElement === el && el.type !== "range") {
1408
- if (lazy && value === oldValue) {
1409
- return;
1410
- }
1411
- if (trim && el.value.trim() === newValue) {
1412
- return;
1413
- }
1414
- }
1415
- el.value = newValue;
1103
+ if (el.composing) return;
1104
+ const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? (0, _vue_shared.looseToNumber)(el.value) : el.value;
1105
+ const newValue = value == null ? "" : value;
1106
+ if (elValue === newValue) return;
1107
+ if (document.activeElement === el && el.type !== "range") {
1108
+ if (lazy && value === oldValue) return;
1109
+ if (trim && el.value.trim() === newValue) return;
1110
+ }
1111
+ el.value = newValue;
1416
1112
  };
1417
1113
  const vModelCheckbox = {
1418
- // #4096 array checkboxes need to be deep traversed
1419
- deep: true,
1420
- created(el, _, vnode) {
1421
- el[assignKey] = getModelAssigner(vnode);
1422
- vModelCheckboxInit(el);
1423
- },
1424
- // set initial checked on mount to wait for true-value/false-value
1425
- mounted(el, binding, vnode) {
1426
- vModelCheckboxUpdate(
1427
- el,
1428
- binding.oldValue,
1429
- binding.value,
1430
- vnode.props.value
1431
- );
1432
- },
1433
- beforeUpdate(el, binding, vnode) {
1434
- el[assignKey] = getModelAssigner(vnode);
1435
- vModelCheckboxUpdate(
1436
- el,
1437
- binding.oldValue,
1438
- binding.value,
1439
- vnode.props.value
1440
- );
1441
- }
1114
+ deep: true,
1115
+ created(el, _, vnode) {
1116
+ el[assignKey] = getModelAssigner(vnode);
1117
+ vModelCheckboxInit(el);
1118
+ },
1119
+ mounted(el, binding, vnode) {
1120
+ vModelCheckboxUpdate(el, binding.oldValue, binding.value, vnode.props.value);
1121
+ },
1122
+ beforeUpdate(el, binding, vnode) {
1123
+ el[assignKey] = getModelAssigner(vnode);
1124
+ vModelCheckboxUpdate(el, binding.oldValue, binding.value, vnode.props.value);
1125
+ }
1442
1126
  };
1127
+ /**
1128
+ * @internal
1129
+ */
1443
1130
  const vModelCheckboxInit = (el, set) => {
1444
- addEventListener(el, "change", () => {
1445
- const assign = el[assignKey];
1446
- const modelValue = el._modelValue;
1447
- const elementValue = getValue(el);
1448
- const checked = el.checked;
1449
- if (shared.isArray(modelValue)) {
1450
- const index = shared.looseIndexOf(modelValue, elementValue);
1451
- const found = index !== -1;
1452
- if (checked && !found) {
1453
- assign(modelValue.concat(elementValue));
1454
- } else if (!checked && found) {
1455
- const filtered = [...modelValue];
1456
- filtered.splice(index, 1);
1457
- assign(filtered);
1458
- }
1459
- } else if (shared.isSet(modelValue)) {
1460
- const cloned = new Set(modelValue);
1461
- if (checked) {
1462
- cloned.add(elementValue);
1463
- } else {
1464
- cloned.delete(elementValue);
1465
- }
1466
- assign(cloned);
1467
- } else {
1468
- assign(getCheckboxValue(el, checked));
1469
- }
1470
- });
1131
+ addEventListener(el, "change", () => {
1132
+ const assign = set || el[assignKey];
1133
+ const modelValue = el._modelValue;
1134
+ const elementValue = getValue(el);
1135
+ const checked = el.checked;
1136
+ if ((0, _vue_shared.isArray)(modelValue)) {
1137
+ const index = (0, _vue_shared.looseIndexOf)(modelValue, elementValue);
1138
+ const found = index !== -1;
1139
+ if (checked && !found) assign(modelValue.concat(elementValue));
1140
+ else if (!checked && found) {
1141
+ const filtered = [...modelValue];
1142
+ filtered.splice(index, 1);
1143
+ assign(filtered);
1144
+ }
1145
+ } else if ((0, _vue_shared.isSet)(modelValue)) {
1146
+ const cloned = new Set(modelValue);
1147
+ if (checked) cloned.add(elementValue);
1148
+ else cloned.delete(elementValue);
1149
+ assign(cloned);
1150
+ } else assign(getCheckboxValue(el, checked));
1151
+ });
1471
1152
  };
1153
+ /**
1154
+ * @internal
1155
+ */
1472
1156
  const vModelCheckboxUpdate = (el, oldValue, value, rawValue = getValue(el)) => {
1473
- el._modelValue = value;
1474
- let checked;
1475
- if (shared.isArray(value)) {
1476
- checked = shared.looseIndexOf(value, rawValue) > -1;
1477
- } else if (shared.isSet(value)) {
1478
- checked = value.has(rawValue);
1479
- } else {
1480
- if (value === oldValue) return;
1481
- checked = shared.looseEqual(value, getCheckboxValue(el, true));
1482
- }
1483
- if (el.checked !== checked) {
1484
- el.checked = checked;
1485
- }
1157
+ el._modelValue = value;
1158
+ let checked;
1159
+ if ((0, _vue_shared.isArray)(value)) checked = (0, _vue_shared.looseIndexOf)(value, rawValue) > -1;
1160
+ else if ((0, _vue_shared.isSet)(value)) checked = value.has(rawValue);
1161
+ else {
1162
+ if (value === oldValue) return;
1163
+ checked = (0, _vue_shared.looseEqual)(value, getCheckboxValue(el, true));
1164
+ }
1165
+ if (el.checked !== checked) el.checked = checked;
1486
1166
  };
1487
1167
  const vModelRadio = {
1488
- created(el, { value }, vnode) {
1489
- el.checked = shared.looseEqual(value, vnode.props.value);
1490
- el[assignKey] = getModelAssigner(vnode);
1491
- addEventListener(el, "change", () => {
1492
- el[assignKey](getValue(el));
1493
- });
1494
- },
1495
- beforeUpdate(el, { value, oldValue }, vnode) {
1496
- el[assignKey] = getModelAssigner(vnode);
1497
- if (value !== oldValue) {
1498
- el.checked = shared.looseEqual(value, vnode.props.value);
1499
- }
1500
- }
1168
+ created(el, { value }, vnode) {
1169
+ el.checked = (0, _vue_shared.looseEqual)(value, vnode.props.value);
1170
+ el[assignKey] = getModelAssigner(vnode);
1171
+ addEventListener(el, "change", () => {
1172
+ el[assignKey](getValue(el));
1173
+ });
1174
+ },
1175
+ beforeUpdate(el, { value, oldValue }, vnode) {
1176
+ el[assignKey] = getModelAssigner(vnode);
1177
+ if (value !== oldValue) el.checked = (0, _vue_shared.looseEqual)(value, vnode.props.value);
1178
+ }
1501
1179
  };
1502
1180
  const vModelSelect = {
1503
- // <select multiple> value need to be deep traversed
1504
- deep: true,
1505
- created(el, { value, modifiers: { number } }, vnode) {
1506
- vModelSelectInit(el, value, number);
1507
- el[assignKey] = getModelAssigner(vnode);
1508
- },
1509
- // set value in mounted & updated because <select> relies on its children
1510
- // <option>s.
1511
- mounted(el, { value }) {
1512
- vModelSetSelected(el, value);
1513
- },
1514
- beforeUpdate(el, _binding, vnode) {
1515
- el[assignKey] = getModelAssigner(vnode);
1516
- },
1517
- updated(el, { value }) {
1518
- vModelSetSelected(el, value);
1519
- }
1181
+ deep: true,
1182
+ created(el, { value, modifiers: { number } }, vnode) {
1183
+ vModelSelectInit(el, value, number);
1184
+ el[assignKey] = getModelAssigner(vnode);
1185
+ },
1186
+ mounted(el, { value }) {
1187
+ vModelSetSelected(el, value);
1188
+ },
1189
+ beforeUpdate(el, _binding, vnode) {
1190
+ el[assignKey] = getModelAssigner(vnode);
1191
+ },
1192
+ updated(el, { value }) {
1193
+ vModelSetSelected(el, value);
1194
+ }
1520
1195
  };
1196
+ /**
1197
+ * @internal
1198
+ */
1521
1199
  const vModelSelectInit = (el, value, number, set) => {
1522
- const isSetModel = shared.isSet(value);
1523
- addEventListener(el, "change", () => {
1524
- const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
1525
- (o) => number ? shared.looseToNumber(getValue(o)) : getValue(o)
1526
- );
1527
- (0, el[assignKey])(
1528
- el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
1529
- );
1530
- el._assigning = true;
1531
- runtimeCore.nextTick(() => {
1532
- el._assigning = false;
1533
- });
1534
- });
1200
+ const isSetModel = (0, _vue_shared.isSet)(value);
1201
+ addEventListener(el, "change", () => {
1202
+ const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? (0, _vue_shared.looseToNumber)(getValue(o)) : getValue(o));
1203
+ (set || el[assignKey])(el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]);
1204
+ el._assigning = true;
1205
+ (0, _vue_runtime_core.nextTick)(() => {
1206
+ el._assigning = false;
1207
+ });
1208
+ });
1535
1209
  };
1210
+ /**
1211
+ * @internal
1212
+ */
1536
1213
  const vModelSetSelected = (el, value) => {
1537
- if (el._assigning) return;
1538
- const isMultiple = el.multiple;
1539
- const isArrayValue = shared.isArray(value);
1540
- if (isMultiple && !isArrayValue && !shared.isSet(value)) {
1541
- return;
1542
- }
1543
- for (let i = 0, l = el.options.length; i < l; i++) {
1544
- const option = el.options[i];
1545
- const optionValue = getValue(option);
1546
- if (isMultiple) {
1547
- if (isArrayValue) {
1548
- const optionType = typeof optionValue;
1549
- if (optionType === "string" || optionType === "number") {
1550
- option.selected = value.some((v) => String(v) === String(optionValue));
1551
- } else {
1552
- option.selected = shared.looseIndexOf(value, optionValue) > -1;
1553
- }
1554
- } else {
1555
- option.selected = value.has(optionValue);
1556
- }
1557
- } else if (shared.looseEqual(getValue(option), value)) {
1558
- if (el.selectedIndex !== i) el.selectedIndex = i;
1559
- return;
1560
- }
1561
- }
1562
- if (!isMultiple && el.selectedIndex !== -1) {
1563
- el.selectedIndex = -1;
1564
- }
1214
+ if (el._assigning) return;
1215
+ const isMultiple = el.multiple;
1216
+ const isArrayValue = (0, _vue_shared.isArray)(value);
1217
+ if (isMultiple && !isArrayValue && !(0, _vue_shared.isSet)(value)) return;
1218
+ for (let i = 0, l = el.options.length; i < l; i++) {
1219
+ const option = el.options[i];
1220
+ const optionValue = getValue(option);
1221
+ if (isMultiple) if (isArrayValue) {
1222
+ const optionType = typeof optionValue;
1223
+ if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
1224
+ else option.selected = (0, _vue_shared.looseIndexOf)(value, optionValue) > -1;
1225
+ } else option.selected = value.has(optionValue);
1226
+ else if ((0, _vue_shared.looseEqual)(getValue(option), value)) {
1227
+ if (el.selectedIndex !== i) el.selectedIndex = i;
1228
+ return;
1229
+ }
1230
+ }
1231
+ if (!isMultiple && el.selectedIndex !== -1) el.selectedIndex = -1;
1565
1232
  };
1233
+ /**
1234
+ * @internal retrieve raw value set via :value bindings
1235
+ */
1566
1236
  function getValue(el) {
1567
- return "_value" in el ? el._value : el.value;
1237
+ return "_value" in el ? el._value : el.value;
1568
1238
  }
1569
1239
  function getCheckboxValue(el, checked) {
1570
- const key = checked ? "_trueValue" : "_falseValue";
1571
- if (key in el) {
1572
- return el[key];
1573
- }
1574
- const attr = checked ? "true-value" : "false-value";
1575
- if (el.hasAttribute(attr)) {
1576
- return el.getAttribute(attr);
1577
- }
1578
- return checked;
1240
+ const key = checked ? "_trueValue" : "_falseValue";
1241
+ if (key in el) return el[key];
1242
+ const attr = checked ? "true-value" : "false-value";
1243
+ if (el.hasAttribute(attr)) return el.getAttribute(attr);
1244
+ return checked;
1579
1245
  }
1580
1246
  const vModelDynamic = {
1581
- created(el, binding, vnode) {
1582
- callModelHook(el, binding, vnode, null, "created");
1583
- },
1584
- mounted(el, binding, vnode) {
1585
- callModelHook(el, binding, vnode, null, "mounted");
1586
- },
1587
- beforeUpdate(el, binding, vnode, prevVNode) {
1588
- callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
1589
- },
1590
- updated(el, binding, vnode, prevVNode) {
1591
- callModelHook(el, binding, vnode, prevVNode, "updated");
1592
- }
1247
+ created(el, binding, vnode) {
1248
+ callModelHook(el, binding, vnode, null, "created");
1249
+ },
1250
+ mounted(el, binding, vnode) {
1251
+ callModelHook(el, binding, vnode, null, "mounted");
1252
+ },
1253
+ beforeUpdate(el, binding, vnode, prevVNode) {
1254
+ callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
1255
+ },
1256
+ updated(el, binding, vnode, prevVNode) {
1257
+ callModelHook(el, binding, vnode, prevVNode, "updated");
1258
+ }
1593
1259
  };
1594
1260
  function resolveDynamicModel(tagName, type) {
1595
- switch (tagName) {
1596
- case "SELECT":
1597
- return vModelSelect;
1598
- case "TEXTAREA":
1599
- return vModelText;
1600
- default:
1601
- switch (type) {
1602
- case "checkbox":
1603
- return vModelCheckbox;
1604
- case "radio":
1605
- return vModelRadio;
1606
- default:
1607
- return vModelText;
1608
- }
1609
- }
1261
+ switch (tagName) {
1262
+ case "SELECT": return vModelSelect;
1263
+ case "TEXTAREA": return vModelText;
1264
+ default: switch (type) {
1265
+ case "checkbox": return vModelCheckbox;
1266
+ case "radio": return vModelRadio;
1267
+ default: return vModelText;
1268
+ }
1269
+ }
1610
1270
  }
1611
1271
  function callModelHook(el, binding, vnode, prevVNode, hook) {
1612
- const modelToUse = resolveDynamicModel(
1613
- el.tagName,
1614
- vnode.props && vnode.props.type
1615
- );
1616
- const fn = modelToUse[hook];
1617
- fn && fn(el, binding, vnode, prevVNode);
1272
+ const fn = resolveDynamicModel(el.tagName, vnode.props && vnode.props.type)[hook];
1273
+ fn && fn(el, binding, vnode, prevVNode);
1618
1274
  }
1619
1275
  function initVModelForSSR() {
1620
- vModelText.getSSRProps = ({ value }) => ({ value });
1621
- vModelRadio.getSSRProps = ({ value }, vnode) => {
1622
- if (vnode.props && shared.looseEqual(vnode.props.value, value)) {
1623
- return { checked: true };
1624
- }
1625
- };
1626
- vModelCheckbox.getSSRProps = ({ value }, vnode) => {
1627
- if (shared.isArray(value)) {
1628
- if (vnode.props && shared.looseIndexOf(value, vnode.props.value) > -1) {
1629
- return { checked: true };
1630
- }
1631
- } else if (shared.isSet(value)) {
1632
- if (vnode.props && value.has(vnode.props.value)) {
1633
- return { checked: true };
1634
- }
1635
- } else if (value) {
1636
- return { checked: true };
1637
- }
1638
- };
1639
- vModelDynamic.getSSRProps = (binding, vnode) => {
1640
- if (typeof vnode.type !== "string") {
1641
- return;
1642
- }
1643
- const modelToUse = resolveDynamicModel(
1644
- // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
1645
- vnode.type.toUpperCase(),
1646
- vnode.props && vnode.props.type
1647
- );
1648
- if (modelToUse.getSSRProps) {
1649
- return modelToUse.getSSRProps(binding, vnode);
1650
- }
1651
- };
1276
+ vModelText.getSSRProps = ({ value }) => ({ value });
1277
+ vModelRadio.getSSRProps = ({ value }, vnode) => {
1278
+ if (vnode.props && (0, _vue_shared.looseEqual)(vnode.props.value, value)) return { checked: true };
1279
+ };
1280
+ vModelCheckbox.getSSRProps = ({ value }, vnode) => {
1281
+ if ((0, _vue_shared.isArray)(value)) {
1282
+ if (vnode.props && (0, _vue_shared.looseIndexOf)(value, vnode.props.value) > -1) return { checked: true };
1283
+ } else if ((0, _vue_shared.isSet)(value)) {
1284
+ if (vnode.props && value.has(vnode.props.value)) return { checked: true };
1285
+ } else if (value) return { checked: true };
1286
+ };
1287
+ vModelDynamic.getSSRProps = (binding, vnode) => {
1288
+ if (typeof vnode.type !== "string") return;
1289
+ const modelToUse = resolveDynamicModel(vnode.type.toUpperCase(), vnode.props && vnode.props.type);
1290
+ if (modelToUse.getSSRProps) return modelToUse.getSSRProps(binding, vnode);
1291
+ };
1652
1292
  }
1653
1293
 
1654
- const systemModifiers = ["ctrl", "shift", "alt", "meta"];
1294
+ //#endregion
1295
+ //#region packages/runtime-dom/src/directives/vOn.ts
1296
+ const systemModifiers = [
1297
+ "ctrl",
1298
+ "shift",
1299
+ "alt",
1300
+ "meta"
1301
+ ];
1655
1302
  const modifierGuards = {
1656
- stop: (e) => e.stopPropagation(),
1657
- prevent: (e) => e.preventDefault(),
1658
- self: (e) => e.target !== e.currentTarget,
1659
- ctrl: (e) => !e.ctrlKey,
1660
- shift: (e) => !e.shiftKey,
1661
- alt: (e) => !e.altKey,
1662
- meta: (e) => !e.metaKey,
1663
- left: (e) => "button" in e && e.button !== 0,
1664
- middle: (e) => "button" in e && e.button !== 1,
1665
- right: (e) => "button" in e && e.button !== 2,
1666
- exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
1303
+ stop: (e) => e.stopPropagation(),
1304
+ prevent: (e) => e.preventDefault(),
1305
+ self: (e) => e.target !== e.currentTarget,
1306
+ ctrl: (e) => !e.ctrlKey,
1307
+ shift: (e) => !e.shiftKey,
1308
+ alt: (e) => !e.altKey,
1309
+ meta: (e) => !e.metaKey,
1310
+ left: (e) => "button" in e && e.button !== 0,
1311
+ middle: (e) => "button" in e && e.button !== 1,
1312
+ right: (e) => "button" in e && e.button !== 2,
1313
+ exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
1667
1314
  };
1315
+ /**
1316
+ * @private
1317
+ */
1668
1318
  const withModifiers = (fn, modifiers) => {
1669
- const cache = fn._withMods || (fn._withMods = {});
1670
- const cacheKey = modifiers.join(".");
1671
- return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
1672
- for (let i = 0; i < modifiers.length; i++) {
1673
- const guard = modifierGuards[modifiers[i]];
1674
- if (guard && guard(event, modifiers)) return;
1675
- }
1676
- return fn(event, ...args);
1677
- }));
1319
+ const cache = fn._withMods || (fn._withMods = {});
1320
+ const cacheKey = modifiers.join(".");
1321
+ return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
1322
+ for (let i = 0; i < modifiers.length; i++) {
1323
+ const guard = modifierGuards[modifiers[i]];
1324
+ if (guard && guard(event, modifiers)) return;
1325
+ }
1326
+ return fn(event, ...args);
1327
+ }));
1678
1328
  };
1679
1329
  const keyNames = {
1680
- esc: "escape",
1681
- space: " ",
1682
- up: "arrow-up",
1683
- left: "arrow-left",
1684
- right: "arrow-right",
1685
- down: "arrow-down",
1686
- delete: "backspace"
1330
+ esc: "escape",
1331
+ space: " ",
1332
+ up: "arrow-up",
1333
+ left: "arrow-left",
1334
+ right: "arrow-right",
1335
+ down: "arrow-down",
1336
+ delete: "backspace"
1687
1337
  };
1338
+ /**
1339
+ * @private
1340
+ */
1688
1341
  const withKeys = (fn, modifiers) => {
1689
- const cache = fn._withKeys || (fn._withKeys = {});
1690
- const cacheKey = modifiers.join(".");
1691
- return cache[cacheKey] || (cache[cacheKey] = ((event) => {
1692
- if (!("key" in event)) {
1693
- return;
1694
- }
1695
- const eventKey = shared.hyphenate(event.key);
1696
- if (modifiers.some(
1697
- (k) => k === eventKey || keyNames[k] === eventKey
1698
- )) {
1699
- return fn(event);
1700
- }
1701
- }));
1342
+ const cache = fn._withKeys || (fn._withKeys = {});
1343
+ const cacheKey = modifiers.join(".");
1344
+ return cache[cacheKey] || (cache[cacheKey] = ((event) => {
1345
+ if (!("key" in event)) return;
1346
+ const eventKey = (0, _vue_shared.hyphenate)(event.key);
1347
+ if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) return fn(event);
1348
+ }));
1702
1349
  };
1703
1350
 
1704
- const rendererOptions = /* @__PURE__ */ shared.extend({ patchProp }, nodeOps);
1351
+ //#endregion
1352
+ //#region packages/runtime-dom/src/index.ts
1353
+ const rendererOptions = /* @__PURE__ */ (0, _vue_shared.extend)({ patchProp }, nodeOps);
1705
1354
  let renderer;
1706
1355
  let enabledHydration = false;
1707
1356
  function ensureRenderer() {
1708
- return renderer || (renderer = runtimeCore.createRenderer(rendererOptions));
1357
+ return renderer || (renderer = (0, _vue_runtime_core.createRenderer)(rendererOptions));
1709
1358
  }
1710
1359
  function ensureHydrationRenderer() {
1711
- renderer = enabledHydration ? renderer : runtimeCore.createHydrationRenderer(rendererOptions);
1712
- enabledHydration = true;
1713
- return renderer;
1360
+ renderer = enabledHydration ? renderer : (0, _vue_runtime_core.createHydrationRenderer)(rendererOptions);
1361
+ enabledHydration = true;
1362
+ return renderer;
1714
1363
  }
1715
1364
  const render = ((...args) => {
1716
- ensureRenderer().render(...args);
1365
+ ensureRenderer().render(...args);
1717
1366
  });
1718
1367
  const hydrate = ((...args) => {
1719
- ensureHydrationRenderer().hydrate(...args);
1368
+ ensureHydrationRenderer().hydrate(...args);
1720
1369
  });
1721
1370
  const createApp = ((...args) => {
1722
- const app = ensureRenderer().createApp(...args);
1723
- const { mount } = app;
1724
- app.mount = (containerOrSelector) => {
1725
- const container = normalizeContainer(containerOrSelector);
1726
- if (!container) return;
1727
- const component = app._component;
1728
- if (!shared.isFunction(component) && !component.render && !component.template) {
1729
- component.template = container.innerHTML;
1730
- }
1731
- if (container.nodeType === 1) {
1732
- container.textContent = "";
1733
- }
1734
- const proxy = mount(container, false, resolveRootNamespace(container));
1735
- if (container instanceof Element) {
1736
- container.removeAttribute("v-cloak");
1737
- container.setAttribute("data-v-app", "");
1738
- }
1739
- return proxy;
1740
- };
1741
- return app;
1371
+ const app = ensureRenderer().createApp(...args);
1372
+ const { mount } = app;
1373
+ app.mount = (containerOrSelector) => {
1374
+ const container = normalizeContainer(containerOrSelector);
1375
+ if (!container) return;
1376
+ const component = app._component;
1377
+ if (!(0, _vue_shared.isFunction)(component) && !component.render && !component.template) component.template = container.innerHTML;
1378
+ if (container.nodeType === 1) container.textContent = "";
1379
+ const proxy = mount(container, false, resolveRootNamespace(container));
1380
+ if (container instanceof Element) {
1381
+ container.removeAttribute("v-cloak");
1382
+ container.setAttribute("data-v-app", "");
1383
+ }
1384
+ return proxy;
1385
+ };
1386
+ return app;
1742
1387
  });
1743
1388
  const createSSRApp = ((...args) => {
1744
- const app = ensureHydrationRenderer().createApp(...args);
1745
- const { mount } = app;
1746
- app.mount = (containerOrSelector) => {
1747
- const container = normalizeContainer(containerOrSelector);
1748
- if (container) {
1749
- return mount(container, true, resolveRootNamespace(container));
1750
- }
1751
- };
1752
- return app;
1389
+ (0, _vue_runtime_core.setIsHydratingEnabled)(true);
1390
+ const app = ensureHydrationRenderer().createApp(...args);
1391
+ const { mount } = app;
1392
+ app.mount = (containerOrSelector) => {
1393
+ const container = normalizeContainer(containerOrSelector);
1394
+ if (container) return mount(container, true, resolveRootNamespace(container));
1395
+ };
1396
+ return app;
1753
1397
  });
1754
1398
  function resolveRootNamespace(container) {
1755
- if (container instanceof SVGElement) {
1756
- return "svg";
1757
- }
1758
- if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
1759
- return "mathml";
1760
- }
1399
+ if (container instanceof SVGElement) return "svg";
1400
+ if (typeof MathMLElement === "function" && container instanceof MathMLElement) return "mathml";
1761
1401
  }
1402
+ /**
1403
+ * @internal
1404
+ */
1762
1405
  function normalizeContainer(container) {
1763
- if (shared.isString(container)) {
1764
- const res = document.querySelector(container);
1765
- return res;
1766
- }
1767
- return container;
1406
+ if ((0, _vue_shared.isString)(container)) return document.querySelector(container);
1407
+ return container;
1768
1408
  }
1769
1409
  let ssrDirectiveInitialized = false;
1410
+ /**
1411
+ * @internal
1412
+ */
1770
1413
  const initDirectivesForSSR = () => {
1771
- if (!ssrDirectiveInitialized) {
1772
- ssrDirectiveInitialized = true;
1773
- initVModelForSSR();
1774
- initVShowForSSR();
1775
- }
1776
- } ;
1414
+ if (!ssrDirectiveInitialized) {
1415
+ ssrDirectiveInitialized = true;
1416
+ initVModelForSSR();
1417
+ initVShowForSSR();
1418
+ }
1419
+ };
1777
1420
 
1421
+ //#endregion
1778
1422
  exports.Transition = Transition;
1779
1423
  exports.TransitionGroup = TransitionGroup;
1780
1424
  exports.VueElement = VueElement;
@@ -1800,6 +1444,9 @@ exports.vModelText = vModelText;
1800
1444
  exports.vShow = vShow;
1801
1445
  exports.withKeys = withKeys;
1802
1446
  exports.withModifiers = withModifiers;
1803
- Object.keys(runtimeCore).forEach(function (k) {
1804
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = runtimeCore[k];
1447
+ Object.keys(_vue_runtime_core).forEach(function (k) {
1448
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
1449
+ enumerable: true,
1450
+ get: function () { return _vue_runtime_core[k]; }
1451
+ });
1805
1452
  });