@stencil/core 5.0.0-next.0 → 5.0.0-rc.0

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 (58) hide show
  1. package/README.md +94 -0
  2. package/bin/stencil.mjs +1 -1
  3. package/dist/app-data/index.d.ts +2 -0
  4. package/dist/{runtime/app-data → app-data}/index.js +23 -15
  5. package/dist/{runtime/app-globals → app-globals}/index.js +1 -2
  6. package/dist/client-ClM4H9-P.mjs +2496 -0
  7. package/dist/compiler/browser.d.ts +1573 -0
  8. package/dist/compiler/browser.js +16998 -0
  9. package/dist/compiler/index.d.mts +284 -7
  10. package/dist/compiler/index.mjs +3 -9
  11. package/dist/compiler/utils/index.d.mts +272 -3
  12. package/dist/compiler/utils/index.mjs +4 -5
  13. package/dist/{transpile-CJQcQEVa.mjs → compiler-DFanjq9z.mjs} +20984 -15554
  14. package/dist/declarations/stencil-ext-modules.d.ts +8 -8
  15. package/dist/declarations/stencil-public-compiler.d.ts +1016 -840
  16. package/dist/declarations/stencil-public-compiler.js +3 -5
  17. package/dist/declarations/stencil-public-docs.d.ts +441 -376
  18. package/dist/declarations/stencil-public-docs.js +0 -0
  19. package/dist/declarations/stencil-public-runtime.d.ts +361 -113
  20. package/dist/fragment-Di1hWOC8.mjs +4 -0
  21. package/dist/helpers-Cpp3qc3u.mjs +524 -0
  22. package/dist/{index-szczUd2l.d.mts → index-DvfFOkiJ.d.mts} +1466 -2044
  23. package/dist/{stencil-private-Cgcr414u.d.ts → index-XQHZl0MW.d.ts} +308 -114
  24. package/dist/index-aBMJC5F9.d.mts +104 -0
  25. package/dist/index.d.mts +14 -2
  26. package/dist/index.mjs +171 -4
  27. package/dist/jsx-runtime.d.mts +24 -0
  28. package/dist/jsx-runtime.mjs +3 -0
  29. package/dist/mock-doc.mjs +2 -3
  30. package/dist/{node-sys-BGURUNOZ.mjs → node-DJP8JuAS.mjs} +176 -197
  31. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  32. package/dist/{client-DR9zhmKG.mjs → runtime/client/lazy.js} +3780 -2652
  33. package/dist/runtime/client/{index.d.ts → runtime.d.ts} +516 -227
  34. package/dist/runtime/client/{index.js → runtime.js} +3588 -2856
  35. package/dist/runtime/index.d.ts +90 -72
  36. package/dist/runtime/index.js +3461 -2837
  37. package/dist/runtime/server/index.d.mts +243 -219
  38. package/dist/runtime/server/index.mjs +3763 -3352
  39. package/dist/runtime/server/runner.d.mts +114 -47
  40. package/dist/runtime/server/runner.mjs +12710 -763
  41. package/dist/signals/index.d.ts +58 -0
  42. package/dist/signals/index.js +182 -0
  43. package/dist/sys/node/index.d.mts +1 -3
  44. package/dist/sys/node/index.mjs +2 -7
  45. package/dist/sys/node/worker.d.mts +1 -1
  46. package/dist/sys/node/worker.mjs +3 -12
  47. package/dist/testing/index.d.mts +4763 -12
  48. package/dist/testing/index.mjs +7939 -619
  49. package/dist/util-C-H1H84W.mjs +731 -0
  50. package/dist/validation-ByYYKvnS.mjs +825 -0
  51. package/package.json +91 -59
  52. package/dist/chunk-ClPoSABd.mjs +0 -21
  53. package/dist/index-Bxo2jCf6.d.mts +0 -77
  54. package/dist/runtime/app-data/index.d.ts +0 -30
  55. package/dist/serialize-BJvhE9aQ.mjs +0 -775
  56. package/dist/validation-BdcPruW_.mjs +0 -1451
  57. /package/{LICENSE.md → LICENSE} +0 -0
  58. /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
@@ -0,0 +1,4 @@
1
+ //#region src/runtime/fragment.ts
2
+ const Fragment = (_, children) => children;
3
+ //#endregion
4
+ export { Fragment as t };
@@ -0,0 +1,524 @@
1
+ const MEMBER_FLAGS = {
2
+ String: 1,
3
+ Number: 2,
4
+ Boolean: 4,
5
+ Any: 8,
6
+ Unknown: 16,
7
+ State: 32,
8
+ Method: 64,
9
+ Event: 128,
10
+ Element: 256,
11
+ ReflectAttr: 512,
12
+ Mutable: 1024,
13
+ Getter: 2048,
14
+ Setter: 4096,
15
+ Prop: 31,
16
+ HasAttribute: 31,
17
+ PropLike: 63
18
+ };
19
+ const WATCH_FLAGS = { Immediate: 1 };
20
+ const EVENT_FLAGS = {
21
+ Cancellable: 1,
22
+ Composed: 2,
23
+ Bubbles: 4
24
+ };
25
+ const LISTENER_FLAGS = {
26
+ Passive: 1,
27
+ Capture: 2,
28
+ TargetDocument: 4,
29
+ TargetWindow: 8,
30
+ TargetBody: 16
31
+ };
32
+ const HOST_FLAGS = {
33
+ hasConnected: 1,
34
+ hasRendered: 2,
35
+ isWaitingForChildren: 4,
36
+ isConstructingInstance: 8,
37
+ isQueuedForUpdate: 16,
38
+ hasInitializedComponent: 32,
39
+ hasLoadedComponent: 64,
40
+ isWatchReady: 128,
41
+ isListenReady: 256,
42
+ needsRerender: 512,
43
+ /**
44
+ * Set once this component's real (lazy-loaded) `connectedCallback` has fired for
45
+ * the first time. Lets a descendant skip creating/awaiting a connect-promise for
46
+ * an ancestor that's already connected. See {@link HostRef.$onFirstConnectResolve$}.
47
+ */
48
+ hasFiredConnected: 1024,
49
+ /**
50
+ * Set when a lazy component's dynamic `import()` fails to resolve a
51
+ * constructor. Distinct from `hasInitializedComponent` being unset, which
52
+ * is true while an initialization attempt is merely queued/in-flight.
53
+ */
54
+ hasFailedLoad: 2048,
55
+ devOnRender: 4096,
56
+ devOnDidLoad: 8192
57
+ };
58
+ const CF_scopedCssEncapsulation = 2;
59
+ /**
60
+ * A set of flags used for bitwise calculations against {@link ComponentRuntimeMeta#$flags$}.
61
+ *
62
+ * These flags should only be used in conjunction with {@link ComponentRuntimeMeta#$flags$}.
63
+ * They should _not_ be used for calculations against other fields/numbers
64
+ */
65
+ const CMP_FLAGS = {
66
+ /**
67
+ * Used to determine if a component is using the shadow DOM.
68
+ * e.g. `shadow: true | {}` is set on the `@Component()` decorator
69
+ */
70
+ shadowDomEncapsulation: 1,
71
+ /**
72
+ * Used to determine if a component is using scoped stylesheets
73
+ * e.g. `scoped: true` is set on the `@Component()` decorator
74
+ */
75
+ scopedCssEncapsulation: CF_scopedCssEncapsulation,
76
+ /**
77
+ * Used to determine if a component does not use the shadow DOM _and_ has `<slot/>` tags in its markup.
78
+ */
79
+ hasSlotRelocation: 4,
80
+ /**
81
+ * Determines if `delegatesFocus` is enabled for a component that uses the shadow DOM.
82
+ * e.g. `shadow: { delegatesFocus: true }` is set on the `@Component()` decorator
83
+ */
84
+ shadowDelegatesFocus: 16,
85
+ /**
86
+ * Determines if `mode` is set on the `@Component()` decorator
87
+ */
88
+ hasMode: 32,
89
+ /**
90
+ * Determines if styles must be scoped - i.e. the component uses scoped stylesheets.
91
+ */
92
+ needsScopedEncapsulation: CF_scopedCssEncapsulation,
93
+ /**
94
+ * Determines if a component is form-associated or not. This is set based on
95
+ * options passed to the `@Component` decorator.
96
+ */
97
+ formAssociated: 64,
98
+ /**
99
+ * Determines if a `shadow: true` component needs
100
+ * to have its styles scoped during SSR as opposed to using DSD.
101
+ */
102
+ shadowNeedsScopedCss: 128,
103
+ /**
104
+ * Determines if a component has a `<slot>` in its template.
105
+ */
106
+ hasSlot: 256,
107
+ /**
108
+ * Determines if a component uses modern class property declarations.
109
+ */
110
+ hasModernPropertyDecls: 512,
111
+ /**
112
+ * Determines if `slotAssignment` is set to `'manual'` for a component that uses the shadow DOM.
113
+ * e.g. `shadow: { slotAssignment: 'manual' }` is set on the `@Component()` decorator
114
+ */
115
+ shadowSlotAssignmentManual: 1024,
116
+ /**
117
+ * Determines if the shadow DOM mode is 'closed'.
118
+ * e.g. `encapsulation: { type: 'shadow', mode: 'closed' }` is set on the `@Component()` decorator
119
+ */
120
+ shadowModeClosed: 2048,
121
+ /**
122
+ * Determines if the component should patch child node accessors for slot handling.
123
+ * e.g. `encapsulation: { type: 'none', patches: ['children'] }`
124
+ */
125
+ patchChildren: 4096,
126
+ /**
127
+ * Determines if the component should patch cloneNode() for slot handling.
128
+ * e.g. `encapsulation: { type: 'none', patches: ['clone'] }`
129
+ */
130
+ patchClone: 8192,
131
+ /**
132
+ * Determines if the component should patch appendChild/insertBefore for slot handling.
133
+ * e.g. `encapsulation: { type: 'none', patches: ['insert'] }`
134
+ */
135
+ patchInsert: 16384,
136
+ /**
137
+ * Determines if the component should apply all slot patches.
138
+ * e.g. `encapsulation: { type: 'none', patches: ['all'] }`
139
+ * Equivalent to the global `experimentalSlotFixes` config option.
140
+ */
141
+ patchAll: 32768,
142
+ /**
143
+ * Determines if `clonable` is enabled for a component that uses the shadow DOM.
144
+ * e.g. `encapsulation: { type: 'shadow', clonable: true }` is set on the `@Component()` decorator
145
+ */
146
+ shadowClonable: 65536,
147
+ /**
148
+ * Determines if `serializable` is enabled for a component that uses the shadow DOM.
149
+ * e.g. `encapsulation: { type: 'shadow', serializable: true }` is set on the `@Component()` decorator
150
+ */
151
+ shadowSerializable: 1 << 17
152
+ };
153
+ /**
154
+ * Default style mode id
155
+ */
156
+ const DEFAULT_STYLE_MODE = "$";
157
+ /**
158
+ * Namespaces
159
+ */
160
+ const SVG_NS = "http://www.w3.org/2000/svg";
161
+ const HTML_NS = "http://www.w3.org/1999/xhtml";
162
+ const XLINK_NS = "http://www.w3.org/1999/xlink";
163
+ /**
164
+ * File names and value
165
+ */
166
+ const COLLECTION_MANIFEST_FILE_NAME = "collection-manifest.json";
167
+ const COLLECTION_APP_DATA_FILE_NAME = "app-data.js";
168
+ /**
169
+ * Constant for the 'copy' output target
170
+ */
171
+ const COPY = "copy";
172
+ /**
173
+ * Constant for the 'custom' output target
174
+ */
175
+ const CUSTOM = "custom";
176
+ /**
177
+ * Constant for the 'loader-bundle' output target
178
+ * (formerly 'dist' in v4)
179
+ */
180
+ const LOADER_BUNDLE = "loader-bundle";
181
+ /**
182
+ * Constant for the 'standalone' output target
183
+ * (formerly 'dist-custom-elements' in v4)
184
+ */
185
+ const STANDALONE = "standalone";
186
+ /**
187
+ * Constant for the 'ssr' output target
188
+ * (formerly 'dist-hydrate-script' in v4)
189
+ */
190
+ const SSR = "ssr";
191
+ /**
192
+ * Constant for the 'ssr-wasm' output target.
193
+ * Compiles the SSR script to a WASM binary via javy for use in any WASM-capable host
194
+ * (PHP, Java, Ruby, Go, etc.) without requiring a JavaScript runtime.
195
+ */
196
+ const SSR_WASM = "ssr-wasm";
197
+ /**
198
+ * Constant for the 'collection' output target
199
+ * (formerly 'dist-collection' sub-output in v4)
200
+ *
201
+ * Contains transpiled source + metadata for downstream Stencil projects
202
+ * to re-compile/bundle.
203
+ */
204
+ const COLLECTION = "collection";
205
+ /**
206
+ * Constant for the 'types' output target
207
+ * (formerly 'dist-types' sub-output in v4)
208
+ */
209
+ const TYPES = "types";
210
+ /**
211
+ * Constant for the 'global-style' output target
212
+ * Outputs global styles to a unified location available to all distributions.
213
+ */
214
+ const GLOBAL_STYLE = "global-style";
215
+ /**
216
+ * Constant for the 'assets' output target
217
+ * Copies component assetsDirs to a unified location available to all distributions.
218
+ */
219
+ const ASSETS = "assets";
220
+ /**
221
+ * Internal constant for the 'dist-lazy' output target
222
+ * (used by loader-bundle and www)
223
+ */
224
+ const DIST_LAZY = "dist-lazy";
225
+ /**
226
+ * Constant for the 'docs-custom' output target
227
+ */
228
+ const DOCS_CUSTOM = "docs-custom";
229
+ /**
230
+ * Constant for the 'docs-json' output target
231
+ */
232
+ const DOCS_JSON = "docs-json";
233
+ /**
234
+ * Constant for the 'docs-readme' output target
235
+ */
236
+ const DOCS_README = "docs-readme";
237
+ /**
238
+ * Constant for the 'docs-vscode' output target
239
+ */
240
+ const DOCS_VSCODE = "docs-vscode";
241
+ /**
242
+ * Constant for the 'docs-custom-elements-manifest' output target
243
+ */
244
+ const DOCS_CUSTOM_ELEMENTS_MANIFEST = "docs-custom-elements-manifest";
245
+ /**
246
+ * Constant for the 'docs-agent-skill' output target
247
+ */
248
+ const DOCS_AGENT_SKILL = "docs-agent-skill";
249
+ /**
250
+ * Constant for the 'stats' output target
251
+ */
252
+ const STATS = "stats";
253
+ /**
254
+ * Constant for the 'www' output target
255
+ */
256
+ const WWW = "www";
257
+ /**
258
+ * Valid output targets to specify in a Stencil config.
259
+ *
260
+ * Note that some internal output targets (e.g. `DIST_LAZY`, `DIST_GLOBAL_STYLES`)
261
+ * are programmatically created by the compiler and are not user-configurable.
262
+ *
263
+ * In v5, `TYPES` and `COLLECTION` are auto-generated in production builds unless explicitly configured.
264
+ */
265
+ const VALID_CONFIG_OUTPUT_TARGETS = [
266
+ "www",
267
+ LOADER_BUNDLE,
268
+ STANDALONE,
269
+ "ssr",
270
+ SSR_WASM,
271
+ COLLECTION,
272
+ TYPES,
273
+ GLOBAL_STYLE,
274
+ ASSETS,
275
+ "dist",
276
+ "dist-custom-elements",
277
+ "dist-hydrate-script",
278
+ "dist-collection",
279
+ "dist-types",
280
+ DOCS_JSON,
281
+ DOCS_README,
282
+ DOCS_VSCODE,
283
+ DOCS_CUSTOM,
284
+ DOCS_CUSTOM_ELEMENTS_MANIFEST,
285
+ DOCS_AGENT_SKILL,
286
+ COPY,
287
+ CUSTOM,
288
+ STATS
289
+ ];
290
+ const GENERATED_DTS = "components.d.ts";
291
+ const STYLE_EXT = [
292
+ "css",
293
+ "scss",
294
+ "sass",
295
+ "pcss",
296
+ "styl",
297
+ "stylus",
298
+ "less"
299
+ ];
300
+ /**
301
+ * DOM Node types
302
+ *
303
+ * See https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
304
+ *
305
+ * Note: this is a duplicate of the `NODE_TYPES` enum in mock-doc, it's
306
+ * copied over here so that we do not need to introduce a dependency on the
307
+ * mock-doc bundle in the runtime. See
308
+ * https://github.com/stenciljs/core/pull/5705 for more details.
309
+ */
310
+ const NODE_TYPES = {
311
+ ELEMENT_NODE: 1,
312
+ ATTRIBUTE_NODE: 2,
313
+ TEXT_NODE: 3,
314
+ CDATA_SECTION_NODE: 4,
315
+ ENTITY_REFERENCE_NODE: 5,
316
+ ENTITY_NODE: 6,
317
+ PROCESSING_INSTRUCTION_NODE: 7,
318
+ COMMENT_NODE: 8,
319
+ DOCUMENT_NODE: 9,
320
+ DOCUMENT_TYPE_NODE: 10,
321
+ DOCUMENT_FRAGMENT_NODE: 11,
322
+ NOTATION_NODE: 12
323
+ };
324
+ //#endregion
325
+ //#region src/utils/query-nonce-meta-tag-content.ts
326
+ /**
327
+ * Helper method for querying a `meta` tag that contains a nonce value
328
+ * out of a DOM's head.
329
+ *
330
+ * @param doc The DOM containing the `head` to query against
331
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
332
+ * exists or the tag has no content.
333
+ */
334
+ function queryNonceMetaTagContent(doc) {
335
+ return doc.head?.querySelector("meta[name=\"csp-nonce\"]")?.getAttribute("content") ?? void 0;
336
+ }
337
+ //#endregion
338
+ //#region src/utils/helpers.ts
339
+ /**
340
+ * Check if a value is defined (not null and not undefined).
341
+ *
342
+ * @param v - the value to check
343
+ * @returns true if the value is defined
344
+ */
345
+ const isDef = (v) => v != null && v !== void 0;
346
+ /**
347
+ * Convert a string from PascalCase to dash-case
348
+ *
349
+ * @param str the string to convert
350
+ * @returns a converted string
351
+ */
352
+ const toDashCase = (str) => str.replace(/([A-Z0-9])/g, (match) => ` ${match[0]}`).trim().split(" ").join("-").toLowerCase();
353
+ /**
354
+ * Convert a string from dash-case / kebab-case to PascalCase (or CamelCase,
355
+ * or whatever you call it!)
356
+ *
357
+ * @param str a string to convert
358
+ * @returns a converted string
359
+ */
360
+ const dashToPascalCase = (str) => str.toLowerCase().split("-").map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join("");
361
+ /**
362
+ * Convert a string to 'camelCase'
363
+ *
364
+ * @param str the string to convert
365
+ * @returns the converted string
366
+ */
367
+ const toCamelCase = (str) => {
368
+ const pascalCase = dashToPascalCase(str);
369
+ return pascalCase.charAt(0).toLowerCase() + pascalCase.slice(1);
370
+ };
371
+ /**
372
+ * Capitalize the first letter of a string
373
+ *
374
+ * @param str the string to capitalize
375
+ * @returns a capitalized string
376
+ */
377
+ const toTitleCase = (str) => str.charAt(0).toUpperCase() + str.slice(1);
378
+ /**
379
+ * Escapes all occurrences of a specified pattern in a string.
380
+ * This function replaces all matches of a given pattern in the input text with a specified replacement string.
381
+ * It can handle both string and regular expression patterns and allows toggling between global and single-match replacements.
382
+ *
383
+ * @param text - The input string to process.
384
+ * @param pattern - The pattern to search for in the input string. Can be a regular expression or a string.
385
+ * @param replacement - The string to replace each match with.
386
+ * @param replaceAll - Whether to replace all occurrences (true) or just the first occurrence (false). Defaults to true.
387
+ * @returns The processed string with the replacements applied.
388
+ */
389
+ const escapeWithPattern = (text, pattern, replacement, replaceAll = true) => {
390
+ let regex;
391
+ if (typeof pattern === "string") {
392
+ const escaped = pattern.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
393
+ regex = new RegExp(escaped, replaceAll ? "g" : "");
394
+ } else {
395
+ const flags = pattern.flags;
396
+ const hasG = flags.includes("g");
397
+ const newFlags = replaceAll ? hasG ? flags : flags + "g" : hasG ? flags.replace(/g/g, "") : flags;
398
+ regex = new RegExp(pattern.source, newFlags);
399
+ }
400
+ return text.replace(regex, replacement);
401
+ };
402
+ /**
403
+ * This is just a no-op, don't expect it to do anything.
404
+ */
405
+ const noop = () => {};
406
+ /**
407
+ * Check whether a value is a 'complex type', defined here as an object or a
408
+ * function.
409
+ *
410
+ * @param o the value to check
411
+ * @returns whether it's a complex type or not
412
+ */
413
+ const isComplexType = (o) => {
414
+ o = typeof o;
415
+ return o === "object" || o === "function";
416
+ };
417
+ /**
418
+ * Sort an array without mutating it in-place (as `Array.prototype.sort`
419
+ * unfortunately does)
420
+ *
421
+ * @param array the array you'd like to sort
422
+ * @param prop a function for deriving sortable values (strings or numbers)
423
+ * from array members
424
+ * @returns a new array of all items `x` in `array` ordered by `prop(x)`
425
+ */
426
+ const sortBy = (array, prop) => {
427
+ return array.slice().sort((a, b) => {
428
+ const nameA = prop(a);
429
+ const nameB = prop(b);
430
+ if (nameA < nameB) return -1;
431
+ if (nameA > nameB) return 1;
432
+ return 0;
433
+ });
434
+ };
435
+ /**
436
+ * A polyfill of sorts for `Array.prototype.flat` which will return the result
437
+ * of calling that method if present and, if not, return an equivalent based on
438
+ * `Array.prototype.reduce`.
439
+ *
440
+ * @param array the array to flatten (one level)
441
+ * @returns a flattened array
442
+ */
443
+ const flatOne = (array) => {
444
+ if (array.flat) return array.flat(1);
445
+ return array.reduce((result, item) => {
446
+ result.push(...item);
447
+ return result;
448
+ }, []);
449
+ };
450
+ /**
451
+ * Deduplicate an array, retaining items at the earliest position in which
452
+ * they appear.
453
+ *
454
+ * So `unique([1,3,2,1,1,4])` would be `[1,3,2,4]`.
455
+ *
456
+ * @param array the array to deduplicate
457
+ * @param predicate an optional function used to generate the key used to
458
+ * determine uniqueness
459
+ * @returns a new, deduplicated array
460
+ */
461
+ const unique = (array, predicate = (i) => i) => {
462
+ const set = /* @__PURE__ */ new Set();
463
+ return array.filter((item) => {
464
+ const key = predicate(item);
465
+ if (key == null) return true;
466
+ if (set.has(key)) return false;
467
+ set.add(key);
468
+ return true;
469
+ });
470
+ };
471
+ /**
472
+ * Merge elements of an array into an existing array, using a predicate to
473
+ * determine uniqueness and only adding elements when they are not present in
474
+ * the first array.
475
+ *
476
+ * **Note**: this mutates the target array! This is intentional to avoid
477
+ * unnecessary array allocation, but be sure that it's what you want!
478
+ *
479
+ * @param target the target array, to which new unique items should be added
480
+ * @param newItems a list of new items, some (or all!) of which may be added
481
+ * @param mergeWith a predicate function which reduces the items in `target`
482
+ * and `newItems` to a value which can be equated with `===` for the purposes
483
+ * of determining uniqueness
484
+ */
485
+ function mergeIntoWith(target, newItems, mergeWith) {
486
+ for (const item of newItems) if (!target.find((existingItem) => mergeWith(existingItem) === mergeWith(item))) target.push(item);
487
+ }
488
+ /**
489
+ * A utility for building an object from an iterable very similar to
490
+ * `Object.fromEntries`
491
+ *
492
+ * @param entries an iterable object holding entries (key-value tuples) to
493
+ * plop into a new object
494
+ * @returns an object containing those entries
495
+ */
496
+ const fromEntries = (entries) => {
497
+ const object = {};
498
+ for (const [key, value] of entries) object[key] = value;
499
+ return object;
500
+ };
501
+ /**
502
+ * Based on a given object, create a new object which has only the specified
503
+ * key-value pairs included in it.
504
+ *
505
+ * @param obj the object from which to take values
506
+ * @param keys a set of keys to take
507
+ * @returns an object mapping `key` to `obj[key]` if `obj[key]` is truthy for
508
+ * every `key` in `keys`
509
+ */
510
+ const pluck = (obj, keys) => {
511
+ return keys.reduce((final, key) => {
512
+ if (obj[key]) final[key] = obj[key];
513
+ return final;
514
+ }, {});
515
+ };
516
+ const isDefined = (v) => v !== null && v !== void 0;
517
+ const isBoolean = (v) => typeof v === "boolean";
518
+ const isFunction = (v) => typeof v === "function";
519
+ const isNumber = (v) => typeof v === "number";
520
+ const isObject = (val) => val != null && typeof val === "object" && Array.isArray(val) === false;
521
+ const isString = (v) => typeof v === "string";
522
+ const isIterable = (v) => isDefined(v) && isFunction(v[Symbol.iterator]);
523
+ //#endregion
524
+ export { VALID_CONFIG_OUTPUT_TARGETS as $, DIST_LAZY as A, HOST_FLAGS as B, CMP_FLAGS as C, COPY as D, COLLECTION_MANIFEST_FILE_NAME as E, DOCS_README as F, NODE_TYPES as G, LISTENER_FLAGS as H, DOCS_VSCODE as I, STANDALONE as J, SSR as K, EVENT_FLAGS as L, DOCS_CUSTOM as M, DOCS_CUSTOM_ELEMENTS_MANIFEST as N, CUSTOM as O, DOCS_JSON as P, TYPES as Q, GENERATED_DTS as R, ASSETS as S, COLLECTION_APP_DATA_FILE_NAME as T, LOADER_BUNDLE as U, HTML_NS as V, MEMBER_FLAGS as W, STYLE_EXT as X, STATS as Y, SVG_NS as Z, toCamelCase as _, isBoolean as a, unique as b, isFunction as c, isObject as d, WATCH_FLAGS as et, isString as f, sortBy as g, pluck as h, fromEntries as i, DOCS_AGENT_SKILL as j, DEFAULT_STYLE_MODE as k, isIterable as l, noop as m, escapeWithPattern as n, XLINK_NS as nt, isComplexType as o, mergeIntoWith as p, SSR_WASM as q, flatOne as r, isDef as s, dashToPascalCase as t, WWW as tt, isNumber as u, toDashCase as v, COLLECTION as w, queryNonceMetaTagContent as x, toTitleCase as y, GLOBAL_STYLE as z };