@dcloudio/uni-cli-shared 3.0.0-alpha-4070720250804001 → 3.0.0-alpha-4070620250731002

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