@valbuild/core 0.12.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 (100) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/README.md +537 -0
  3. package/dist/createClass-012eebbf.esm.js +109 -0
  4. package/dist/createClass-a436dbfe.cjs.dev.js +116 -0
  5. package/dist/createClass-de7426aa.cjs.prod.js +116 -0
  6. package/dist/declarations/src/Json.d.ts +6 -0
  7. package/dist/declarations/src/expr/eval.d.ts +19 -0
  8. package/dist/declarations/src/expr/expr.d.ts +32 -0
  9. package/dist/declarations/src/expr/index.d.ts +3 -0
  10. package/dist/declarations/src/expr/parser.d.ts +8 -0
  11. package/dist/declarations/src/expr/tokenizer.d.ts +7 -0
  12. package/dist/declarations/src/fetchVal.d.ts +5 -0
  13. package/dist/declarations/src/fp/array.d.ts +8 -0
  14. package/dist/declarations/src/fp/index.d.ts +3 -0
  15. package/dist/declarations/src/fp/result.d.ts +67 -0
  16. package/dist/declarations/src/fp/util.d.ts +12 -0
  17. package/dist/declarations/src/index.d.ts +32 -0
  18. package/dist/declarations/src/initSchema.d.ts +57 -0
  19. package/dist/declarations/src/initVal.d.ts +39 -0
  20. package/dist/declarations/src/module.d.ts +38 -0
  21. package/dist/declarations/src/patch/deref.d.ts +13 -0
  22. package/dist/declarations/src/patch/index.d.ts +6 -0
  23. package/dist/declarations/src/patch/json.d.ts +11 -0
  24. package/dist/declarations/src/patch/operation.d.ts +59 -0
  25. package/dist/declarations/src/patch/ops.d.ts +40 -0
  26. package/dist/declarations/src/patch/parse.d.ts +19 -0
  27. package/dist/declarations/src/patch/patch.d.ts +6 -0
  28. package/dist/declarations/src/patch/util.d.ts +6 -0
  29. package/dist/declarations/src/schema/array.d.ts +18 -0
  30. package/dist/declarations/src/schema/boolean.d.ts +15 -0
  31. package/dist/declarations/src/schema/i18n.d.ts +21 -0
  32. package/dist/declarations/src/schema/image.d.ts +32 -0
  33. package/dist/declarations/src/schema/index.d.ts +23 -0
  34. package/dist/declarations/src/schema/literal.d.ts +17 -0
  35. package/dist/declarations/src/schema/number.d.ts +22 -0
  36. package/dist/declarations/src/schema/object.d.ts +25 -0
  37. package/dist/declarations/src/schema/oneOf.d.ts +22 -0
  38. package/dist/declarations/src/schema/richtext.d.ts +76 -0
  39. package/dist/declarations/src/schema/string.d.ts +22 -0
  40. package/dist/declarations/src/schema/union.d.ts +36 -0
  41. package/dist/declarations/src/selector/SelectorProxy.d.ts +7 -0
  42. package/dist/declarations/src/selector/array.d.ts +17 -0
  43. package/dist/declarations/src/selector/boolean.d.ts +2 -0
  44. package/dist/declarations/src/selector/file.d.ts +9 -0
  45. package/dist/declarations/src/selector/i18n.d.ts +11 -0
  46. package/dist/declarations/src/selector/index.d.ts +81 -0
  47. package/dist/declarations/src/selector/number.d.ts +2 -0
  48. package/dist/declarations/src/selector/object.d.ts +10 -0
  49. package/dist/declarations/src/selector/primitive.d.ts +9 -0
  50. package/dist/declarations/src/selector/remote.d.ts +7 -0
  51. package/dist/declarations/src/selector/string.d.ts +2 -0
  52. package/dist/declarations/src/source/file.d.ts +23 -0
  53. package/dist/declarations/src/source/i18n.d.ts +29 -0
  54. package/dist/declarations/src/source/index.d.ts +33 -0
  55. package/dist/declarations/src/source/remote.d.ts +29 -0
  56. package/dist/declarations/src/val/array.d.ts +9 -0
  57. package/dist/declarations/src/val/index.d.ts +53 -0
  58. package/dist/declarations/src/val/object.d.ts +9 -0
  59. package/dist/declarations/src/val/primitive.d.ts +7 -0
  60. package/dist/index-2f1631cf.cjs.prod.js +1031 -0
  61. package/dist/index-55916dcd.esm.js +1000 -0
  62. package/dist/index-b49a2c60.cjs.dev.js +1031 -0
  63. package/dist/ops-6fae92a1.esm.js +12 -0
  64. package/dist/ops-87cdbafc.cjs.dev.js +14 -0
  65. package/dist/ops-ae4d1bc2.cjs.prod.js +14 -0
  66. package/dist/result-26f67b40.cjs.prod.js +299 -0
  67. package/dist/result-48320acd.cjs.dev.js +299 -0
  68. package/dist/result-b96df128.esm.js +279 -0
  69. package/dist/util-030d8a1f.cjs.prod.js +29 -0
  70. package/dist/util-18613e99.esm.js +26 -0
  71. package/dist/util-b213092b.cjs.dev.js +29 -0
  72. package/dist/valbuild-core.cjs.d.ts +2 -0
  73. package/dist/valbuild-core.cjs.d.ts.map +1 -0
  74. package/dist/valbuild-core.cjs.dev.js +1276 -0
  75. package/dist/valbuild-core.cjs.js +7 -0
  76. package/dist/valbuild-core.cjs.prod.js +1276 -0
  77. package/dist/valbuild-core.esm.js +1265 -0
  78. package/expr/dist/valbuild-core-expr.cjs.d.ts +2 -0
  79. package/expr/dist/valbuild-core-expr.cjs.d.ts.map +1 -0
  80. package/expr/dist/valbuild-core-expr.cjs.dev.js +18 -0
  81. package/expr/dist/valbuild-core-expr.cjs.js +7 -0
  82. package/expr/dist/valbuild-core-expr.cjs.prod.js +18 -0
  83. package/expr/dist/valbuild-core-expr.esm.js +3 -0
  84. package/expr/package.json +4 -0
  85. package/fp/dist/valbuild-core-fp.cjs.d.ts +2 -0
  86. package/fp/dist/valbuild-core-fp.cjs.d.ts.map +1 -0
  87. package/fp/dist/valbuild-core-fp.cjs.dev.js +13 -0
  88. package/fp/dist/valbuild-core-fp.cjs.js +7 -0
  89. package/fp/dist/valbuild-core-fp.cjs.prod.js +13 -0
  90. package/fp/dist/valbuild-core-fp.esm.js +2 -0
  91. package/fp/package.json +4 -0
  92. package/package.json +43 -0
  93. package/patch/dist/valbuild-core-patch.cjs.d.ts +2 -0
  94. package/patch/dist/valbuild-core-patch.cjs.d.ts.map +1 -0
  95. package/patch/dist/valbuild-core-patch.cjs.dev.js +443 -0
  96. package/patch/dist/valbuild-core-patch.cjs.js +7 -0
  97. package/patch/dist/valbuild-core-patch.cjs.prod.js +443 -0
  98. package/patch/dist/valbuild-core-patch.esm.js +431 -0
  99. package/patch/package.json +4 -0
  100. package/tsconfig.json +7 -0
package/CHANGELOG.md ADDED
File without changes
package/README.md ADDED
@@ -0,0 +1,537 @@
1
+ <p align="center">
2
+ <h1 align="center">Val</h1>
3
+ <p align="center">
4
+ ✨ <a href="https://app.val.build">https://app.val.build</a> ✨
5
+ <br/>
6
+ content - super-charged - hard-coded
7
+ </p>
8
+ </p>
9
+
10
+ # 🐉 HERE BE DRAGONS 🐉
11
+
12
+ Val is PRE-ALPHA - MOST features are broken and in state of flux.
13
+
14
+ This is released only for **INTERNAL** **TESTING** PURPOSES.
15
+
16
+ ## Table of contents
17
+
18
+ - [Table of contents](#table-of-contents)
19
+ - [Introduction](#introduction)
20
+ - [Installation](#installation)
21
+ - [Getting started](#getting-started)
22
+ - [Concepts](#concepts)
23
+ - [String](#string)
24
+ - [Number](#number)
25
+ - [Boolean](#boolean)
26
+ - [Optional](#optional)
27
+ - [Array](#array)
28
+ - [Object](#object)
29
+ - [Rich text](#richtext)
30
+ - [Image](#image)
31
+ - [Internalization](#internalization)
32
+ - [Union](#union)
33
+ - [One-of references](#one-of-references)
34
+ - [Remote](#remote)
35
+ - [Selector](#selector)
36
+
37
+ ## Introduction
38
+
39
+ Val treats your content as code, but it remains fully editable.
40
+
41
+ Val is built on top of TypeScript and Git, letting you use types, branches, version control (even rollbacks!) seamlessly.
42
+
43
+ - Val is **TypeSafe**: being TypeScript-first means you see errors as you type. In addition you can **refactor**, find references and auto-complete content - just as if it was hard-coded. Safety means no more "add-only" content models, where your content model continues to expand because you hesitate to remove anything.
44
+
45
+ - Version **control**: content is tied to commits, which means you can use branches and reverts just as you would normally do.
46
+
47
+ - Val is **isomorphic**: if your content scales beyond your code base, Val lets you easily make it remote. Just add `.remote()` to your schema and Val will host your content - your components stays the same. Remote content are handled using immutable references, so remote content are tied to Git commits - rollbacks, branches works as before.
48
+
49
+ - Contextual editing: Val is built from the ground up to support contextual editing. Editors can see Val content in the context of the app, and make edits directly there.
50
+
51
+ - Full CMS: even hard-coded content has its drawbacks: i18n, images, rich text - Val supports all of these.
52
+
53
+ - No signup required: **your** content is yours. Local development requires no sign ups and is free. When you are ready and editors needs access, you can sign up and without any changes to your code base. Head over to [https://app.val.build](https://app.val.build) to get started 🚀.
54
+
55
+ ## Installation
56
+
57
+ - Make sure you have TypeScript 4.9+, Next 13+ (other meta frameworks will come), React 18+ (other frontend frameworks will come)
58
+ - Install the packages:
59
+
60
+ ```sh
61
+ npm install @valbuild/core @valbuild/react @valbuild/server
62
+ ```
63
+
64
+ - Create your val.config.ts file:
65
+
66
+ ```ts
67
+ // ./val.config.ts
68
+
69
+ import { initVal } from "@valbuild/core";
70
+
71
+ const { s, val } = initVal();
72
+
73
+ export { s, val };
74
+ ```
75
+
76
+ - Update tsconfig.json: enable strict mode and include the Val JSX transformer :
77
+
78
+ ```jsonc
79
+ // ./tsconfig.json
80
+
81
+ {
82
+ "compilerOptions": {
83
+ ///...
84
+ "strict": true,
85
+ ///...
86
+ "jsx": "react-jsx",
87
+ "jsxImportSource": "@valbuild/react"
88
+ //...
89
+ }
90
+ ///...
91
+ }
92
+ ```
93
+
94
+ - Enable contextual editing: setup Val endpoints
95
+
96
+ ```ts
97
+ // ./pages/api/val/[...val].ts
98
+
99
+ import { createRequestListener } from "@valbuild/server";
100
+ import { NextApiHandler } from "next";
101
+
102
+ const handler: NextApiHandler = createRequestListener("/api/val", {
103
+ valConfigPath: "./val.config",
104
+ });
105
+
106
+ export default handler;
107
+
108
+ export const config = {
109
+ api: {
110
+ bodyParser: false,
111
+ externalResolver: true,
112
+ },
113
+ };
114
+ ```
115
+
116
+ - Enable contextual editing: Use the Val provider in a top-level layout file:
117
+
118
+ ```tsx
119
+ // ./app/layout.tsx
120
+
121
+ import { ValProvider } from "@valbuild/react";
122
+ import "./globals.css";
123
+
124
+ export default function RootLayout({
125
+ children,
126
+ }: {
127
+ children: React.ReactNode;
128
+ }) {
129
+ return (
130
+ <html lang="en">
131
+ {/*
132
+ <head /> will contain the components returned by the nearest parent
133
+ head.tsx. Find out more at https://beta.nextjs.org/docs/api-reference/file-conventions/head
134
+ */}
135
+ <head />
136
+ <body>
137
+ <ValProvider host="/api/val">{children}</ValProvider>
138
+ </body>
139
+ </html>
140
+ );
141
+ }
142
+ ```
143
+
144
+ ## Getting started
145
+
146
+ ### Create your first Val content file
147
+
148
+ Content defined in Val is always defined `.val.{ts|js}` files.
149
+
150
+ They must export a default `val.content` where the first argument equals the path of the file relative to the `val.config.{js|ts}` file.
151
+
152
+ ```ts
153
+ // ./app/example/blogs.val.ts
154
+
155
+ import { s, val } from "src/val.config";
156
+
157
+ export default val.content(
158
+ "/app/example/blogs", // <- NOTE: this must be the same path as the file
159
+ s.array(s.object({ title: s.string(), text: s.string() })),
160
+ [
161
+ {
162
+ title: "Title 1",
163
+ text: "Text 1",
164
+ },
165
+ {
166
+ title: "Title 2",
167
+ text: "Text 2",
168
+ },
169
+ ]
170
+ );
171
+ ```
172
+
173
+ ### Use your content
174
+
175
+ ```tsx
176
+ // /app/example/page.tsx
177
+
178
+ import { NextPage } from "next";
179
+ import { useVal } from "@valbuild/react";
180
+ import blogsVal from "./blogs.val";
181
+ import { val } from "val.config";
182
+
183
+ const Home: NextPage = () => {
184
+ const blogs = useVal(blogsVal);
185
+ return (
186
+ <main>
187
+ <article>
188
+ {blogs.map((blog) => (
189
+ <section key={val.key(blog)}>
190
+ <h1>{blog.title}</h1>
191
+ <p>{blog.text}</p>
192
+ </section>
193
+ ))}
194
+ </article>
195
+ </main>
196
+ );
197
+ };
198
+
199
+ export default Home;
200
+ ```
201
+
202
+ ## Concepts
203
+
204
+ `.val.{ts|js}` files **MUST** have a default export which is a ValModule. A ValModule is a special type of [Selector](#selectors). Selectors makes it possible to select a subset of content from a ValModule or a another Selector.
205
+
206
+ Selectors can be turned to Val types using `useVal` or `fetchVal`.
207
+
208
+ Val types is what you use in your components. It is a wrapper around underlying type that adds an id, which is used to automatically tag content in the DOM. You can always extract the underlying value from a Val using the `.val` property.
209
+
210
+ ### .val files
211
+
212
+ `.val.{ts|js}` files are the files in which you store your content.
213
+
214
+ They are evaluated when the content is run, therefore they have a specific set of requirements. They must have a default export that is `val.content`, they must have a `export const schema` with the Schema and they CANNOT import anything other than `val.config` and `@valbuild/core`.
215
+
216
+ Example:
217
+
218
+ ```ts
219
+ import { s, val } from "../val.config";
220
+
221
+ export const schema = t.string();
222
+
223
+ export default val.content(
224
+ "/file/path/relative/to/val/config",
225
+ schema,
226
+ "My string content"
227
+ );
228
+ ```
229
+
230
+ NOTE: IN THE FUTURE, they will be validated by the eslint-plugin.
231
+
232
+ ## String
233
+
234
+ ```ts
235
+ import { s } from "./val.config";
236
+
237
+ s.string(); // <- Schema<string>
238
+ ```
239
+
240
+ ### String selectors
241
+
242
+ See [Selectors](#selector) for more info.
243
+
244
+ ### String `.eq`
245
+
246
+ ```ts
247
+ useVal(stringVal.eq("")); // <- Val<boolean>
248
+ ```
249
+
250
+ ## Number
251
+
252
+ ```ts
253
+ import { s } from "./val.config";
254
+
255
+ s.number(); // <- Schema<number>
256
+ ```
257
+
258
+ ### Number selectors
259
+
260
+ See [Selectors](#selector) for more info.
261
+
262
+ ### Number `.eq`
263
+
264
+ ```ts
265
+ useVal(numberVal.eq(2)); // <- Val<boolean>
266
+ ```
267
+
268
+ ## Boolean
269
+
270
+ ```ts
271
+ import { s } from "./val.config";
272
+
273
+ s.boolean(); // <- Schema<boolean>
274
+ ```
275
+
276
+ ### Boolean selectors
277
+
278
+ See [Selectors](#selector) for more info.
279
+
280
+ ### Boolean `.eq`
281
+
282
+ ```ts
283
+ useVal(booleanVal.eq(true)); // <- Val<boolean>
284
+ ```
285
+
286
+ ## Optional
287
+
288
+ All schema types can be optional. An optional schema creates a union of the type and `null`.
289
+
290
+ ```ts
291
+ import { s } from "./val.config";
292
+
293
+ s.string().optional(); // <- Schema<string | null>
294
+ ```
295
+
296
+ ### Selectors
297
+
298
+ ### Accessing the underlying type: `.andThen`
299
+
300
+ To use and optional val, you can use the [.andThen](#andthen) selector.
301
+
302
+ ## Array
303
+
304
+ ```ts
305
+ s.array(t.string());
306
+ ```
307
+
308
+ ### Selecting arrays
309
+
310
+ ### `.filter`
311
+
312
+ TODO: text
313
+
314
+ ```ts
315
+ useVal(myArray.filter((item) => item.title.eq("Title 1")));
316
+ ```
317
+
318
+ ### `.map`
319
+
320
+ TODO:
321
+
322
+ ```ts
323
+ useVal(myArray.map((item) => ({ test: item.title })));
324
+ ```
325
+
326
+ ## Object
327
+
328
+ ```ts
329
+ s.object({
330
+ myProperty: s.string(),
331
+ });
332
+ ```
333
+
334
+ ### Selecting objects
335
+
336
+ You can select Selector objects almost as if they were normal objects. The exception is that you cannot use the spread (`...`) operator.
337
+
338
+ Example:
339
+
340
+ ```ts
341
+ useVal({ foo: myObjectVal.hello });
342
+ ```
343
+
344
+ ## RichText
345
+
346
+ ### RichText Schema
347
+
348
+ ```ts
349
+ import { s } from "./val.config";
350
+
351
+ s.richtext();
352
+ ```
353
+
354
+ ### Initializing RichText content
355
+
356
+ To initialize some text content using a RichText schema, you can use follow the example below:
357
+
358
+ ```ts
359
+ import { s, val } from "./val.config";
360
+
361
+ // TODO: need some other way of doing this:
362
+ export default val.content("/example/richtext.ts", s.richtext(), {
363
+ children: [
364
+ {
365
+ type: "paragraph",
366
+ version: 1,
367
+ indent: 0,
368
+ direction: "ltr",
369
+ format: "",
370
+ children: [
371
+ {
372
+ type: "text",
373
+ version: 1,
374
+ mode: "normal",
375
+ format: 0,
376
+ detail: 0,
377
+ style: "",
378
+ text: "TODO: update me",
379
+ },
380
+ ],
381
+ },
382
+ ],
383
+ direction: "ltr",
384
+ format: "",
385
+ indent: 0,
386
+ type: "root",
387
+ version: 1,
388
+ });
389
+ ```
390
+
391
+ ### Render RichText
392
+
393
+ You can use the `ValRichText` component to render content.
394
+
395
+ ```tsx
396
+ "use client";
397
+ import { useVal, ValRichText } from "@valbuild/react";
398
+ import richtextVal from "./richtext";
399
+
400
+ export default function Page() {
401
+ const richtext = useVal(richtextVal);
402
+ return <ValRichText>{richtext}</ValRichText>;
403
+ }
404
+ ```
405
+
406
+ ## Image
407
+
408
+ ### Schema
409
+
410
+ ```ts
411
+ s.image();
412
+ ```
413
+
414
+ ### Initializing image content
415
+
416
+ Local images must be stored under the `.public` folder.
417
+
418
+ ```ts
419
+ import { s, val } from "../val.config";
420
+
421
+ export const schema = s.image();
422
+
423
+ export default val.content("/image", schema, val.file("/public/myfile.jpg"));
424
+ ```
425
+
426
+ NOTE: This will not validate, since images requires `width`, `height` and a `sha256` checksum. You can fix this validation in the UI by opening the image and clicking the Fix button.
427
+
428
+ ### Using images in components
429
+
430
+ Images are transformed to object that have a `url` property which can be used to render them.
431
+
432
+ Example:
433
+
434
+ ```tsx
435
+ // in a Functional Component
436
+ const image = useVal(imageVal);
437
+
438
+ return <img src={image.url} />;
439
+ ```
440
+
441
+ ## Internalization
442
+
443
+ **NOTE**: WORKS ONLY ON THE TYPE LEVEL
444
+
445
+ To enable i18n, you must update your Val with the locales you want to enforce.
446
+
447
+ Example:
448
+
449
+ ```ts
450
+ // ./val.config.ts
451
+
452
+ import { initVal } from "@valbuild/core";
453
+
454
+ const { s, val } = initVal({
455
+ locales: {
456
+ required: ["en_US", "fr_FR"],
457
+ fallback: "en_US",
458
+ },
459
+ });
460
+
461
+ export { s, val };
462
+ ```
463
+
464
+ ## Union
465
+
466
+ **NOTE**: WORKS ONLY ON THE TYPE LEVEL
467
+
468
+ TODO: fill in.
469
+
470
+ ```ts
471
+ s.union(
472
+ "type",
473
+ s.object({ type: s.literal("type1"), bar: s.string() }),
474
+ s.object({ type: s.literal("type2"), foo: s.number() })
475
+ );
476
+ ```
477
+
478
+ ### Selecting unions
479
+
480
+ ### `.fold`
481
+
482
+ TODO: description
483
+
484
+ ```ts
485
+ useVal(myUnionVal.fold("type")({
486
+
487
+ })
488
+ ```
489
+
490
+ ## One of references
491
+
492
+ **NOTE**: Currently not possible to change from UI
493
+
494
+ ```ts
495
+
496
+ ```
497
+
498
+ # Remote
499
+
500
+ **NOTE**: WORKS ONLY ON THE TYPE LEVEL
501
+
502
+ All schemas can be converted into `.remote`.
503
+
504
+ TODO: add description.
505
+
506
+ Example:
507
+
508
+ ```ts
509
+ export const schema = s.object({ stuff: s.string() });
510
+
511
+ export default val.content("/remote/example", schema, val.remote("REFERENCE"));
512
+ ```
513
+
514
+ ## Selector
515
+
516
+ To select parts of a your content you should use Selectors.
517
+ If you make the content `.remote`
518
+
519
+ ### `.andThen`
520
+
521
+ All selectors can use `andThen` method which is similar to the `&&` operator. You can use this to only do operations on optionals that are defined. NOTE: only TRUTHY arguments are passed in to `andThen` (i.e. the empty string, `''` is NOT truthy).
522
+
523
+ Given the example schema:
524
+
525
+ ```ts
526
+ // ./maybeArray.val.ts
527
+ //...
528
+
529
+ export const schema = t.array(t.string()).optional();
530
+
531
+ //...
532
+ ```
533
+
534
+ ```ts
535
+ import maybeArrayVal from "./maybeArray.val";
536
+ useVal(maybeArrayVal.andThen((array) => array.filter((v) => v.eq("foo"))));
537
+ ```
@@ -0,0 +1,109 @@
1
+ import { b as _arrayLikeToArray, c as _unsupportedIterableToArray } from './result-b96df128.esm.js';
2
+
3
+ function _toPrimitive(input, hint) {
4
+ if (typeof input !== "object" || input === null) return input;
5
+ var prim = input[Symbol.toPrimitive];
6
+ if (prim !== undefined) {
7
+ var res = prim.call(input, hint || "default");
8
+ if (typeof res !== "object") return res;
9
+ throw new TypeError("@@toPrimitive must return a primitive value.");
10
+ }
11
+ return (hint === "string" ? String : Number)(input);
12
+ }
13
+
14
+ function _toPropertyKey(arg) {
15
+ var key = _toPrimitive(arg, "string");
16
+ return typeof key === "symbol" ? key : String(key);
17
+ }
18
+
19
+ function _arrayWithoutHoles(arr) {
20
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
21
+ }
22
+
23
+ function _iterableToArray(iter) {
24
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
25
+ }
26
+
27
+ function _nonIterableSpread() {
28
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
29
+ }
30
+
31
+ function _toConsumableArray(arr) {
32
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
33
+ }
34
+
35
+ function _typeof(obj) {
36
+ "@babel/helpers - typeof";
37
+
38
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
39
+ return typeof obj;
40
+ } : function (obj) {
41
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
42
+ }, _typeof(obj);
43
+ }
44
+
45
+ function _arrayWithHoles(arr) {
46
+ if (Array.isArray(arr)) return arr;
47
+ }
48
+
49
+ function _iterableToArrayLimit(arr, i) {
50
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
51
+ if (null != _i) {
52
+ var _s,
53
+ _e,
54
+ _x,
55
+ _r,
56
+ _arr = [],
57
+ _n = !0,
58
+ _d = !1;
59
+ try {
60
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
61
+ if (Object(_i) !== _i) return;
62
+ _n = !1;
63
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
64
+ } catch (err) {
65
+ _d = !0, _e = err;
66
+ } finally {
67
+ try {
68
+ if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
69
+ } finally {
70
+ if (_d) throw _e;
71
+ }
72
+ }
73
+ return _arr;
74
+ }
75
+ }
76
+
77
+ function _nonIterableRest() {
78
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
79
+ }
80
+
81
+ function _slicedToArray(arr, i) {
82
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
83
+ }
84
+
85
+ function _classCallCheck(instance, Constructor) {
86
+ if (!(instance instanceof Constructor)) {
87
+ throw new TypeError("Cannot call a class as a function");
88
+ }
89
+ }
90
+
91
+ function _defineProperties(target, props) {
92
+ for (var i = 0; i < props.length; i++) {
93
+ var descriptor = props[i];
94
+ descriptor.enumerable = descriptor.enumerable || false;
95
+ descriptor.configurable = true;
96
+ if ("value" in descriptor) descriptor.writable = true;
97
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
98
+ }
99
+ }
100
+ function _createClass(Constructor, protoProps, staticProps) {
101
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
102
+ if (staticProps) _defineProperties(Constructor, staticProps);
103
+ Object.defineProperty(Constructor, "prototype", {
104
+ writable: false
105
+ });
106
+ return Constructor;
107
+ }
108
+
109
+ export { _classCallCheck as _, _createClass as a, _typeof as b, _slicedToArray as c, _toConsumableArray as d, _toPropertyKey as e };