@lmvz-ds/components 0.12.3-alpha.4 → 0.12.3
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.
- package/dist/cjs/{Effect-BIlTHtLK.js → Effect-CNhHt4Xb.js} +615 -885
- package/dist/cjs/MutableQueue-Bk9tBfaK.js +462 -0
- package/dist/cjs/{aria-validation-controller-B7unOPxT.js → aria-validation-controller-B3hMkau3.js} +157 -156
- package/dist/cjs/assets-iuJtMMdw.js +60 -0
- package/dist/cjs/{icons-BFM1yQ_r.js → icons-CAiJpiUC.js} +22 -74
- package/dist/cjs/index.cjs.js +4 -2
- package/dist/cjs/lmvz-button.cjs.entry.js +3 -2
- package/dist/cjs/lmvz-card.cjs.entry.js +7 -2
- package/dist/cjs/lmvz-header.cjs.entry.js +3 -2
- package/dist/cjs/lmvz-icon.cjs.entry.js +5 -3
- package/dist/cjs/lmvz-input.cjs.entry.js +3 -2
- package/dist/cjs/lmvz-menuitem.cjs.entry.js +3 -2
- package/dist/collection/components/lmvz-card/lmvz-card.js +8 -3
- package/dist/collection/components/lmvz-icon/icons.js +3 -3
- package/dist/collection/utils/{url.js → assets.js} +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/lmvz-button.js +1 -1
- package/dist/components/lmvz-card.js +1 -1
- package/dist/components/lmvz-header.js +1 -1
- package/dist/components/lmvz-icon.js +1 -1
- package/dist/components/lmvz-input.js +1 -1
- package/dist/components/lmvz-menuitem.js +1 -1
- package/dist/components/p-3I3wZmp8.js +1 -0
- package/dist/components/p-BQTNPxka.js +1 -0
- package/dist/components/p-CdofjRtQ.js +1 -0
- package/dist/components/p-xpxyPpHZ.js +1 -0
- package/dist/esm/{Effect-D9S7OTyY.js → Effect-BhQLGXPs.js} +568 -829
- package/dist/esm/MutableQueue-CNlEFklh.js +431 -0
- package/dist/esm/{aria-validation-controller-C7nQzCCq.js → aria-validation-controller-iA4YWFG-.js} +2 -1
- package/dist/esm/assets-BymuU366.js +57 -0
- package/dist/esm/{icons-BFqdzPxR.js → icons-D7UubWaN.js} +5 -57
- package/dist/esm/index.js +4 -2
- package/dist/esm/lmvz-button.entry.js +3 -2
- package/dist/esm/lmvz-card.entry.js +8 -3
- package/dist/esm/lmvz-header.entry.js +3 -2
- package/dist/esm/lmvz-icon.entry.js +5 -3
- package/dist/esm/lmvz-input.entry.js +3 -2
- package/dist/esm/lmvz-menuitem.entry.js +3 -2
- package/dist/lmvz-components/index.esm.js +1 -1
- package/dist/lmvz-components/lmvz-components.esm.js +1 -1
- package/dist/lmvz-components/p-1d916449.entry.js +1 -0
- package/dist/lmvz-components/p-274c36df.entry.js +1 -0
- package/dist/lmvz-components/p-4b70fe08.entry.js +1 -0
- package/dist/lmvz-components/p-68001ab7.entry.js +1 -0
- package/dist/lmvz-components/p-77e26e71.entry.js +1 -0
- package/dist/lmvz-components/p-BhQLGXPs.js +1 -0
- package/dist/lmvz-components/p-CXWyvf0D.js +1 -0
- package/dist/lmvz-components/p-Ce_AL9kY.js +1 -0
- package/dist/lmvz-components/p-D7I-Bc5i.js +1 -0
- package/dist/lmvz-components/p-DohldYb4.js +1 -0
- package/dist/lmvz-components/p-de18e27e.entry.js +1 -0
- package/dist/manifest.json +1 -1
- package/dist/types/components/lmvz-card/lmvz-card.d.ts +1 -0
- package/dist/types/utils/{url.d.ts → assets.d.ts} +1 -1
- package/hydrate/index.js +487 -7
- package/hydrate/index.mjs +487 -7
- package/package.json +4 -4
- package/dist/components/p-BFwzIh71.js +0 -1
- package/dist/components/p-CfWkZ_yJ.js +0 -1
- package/dist/lmvz-components/assets/LMVZ_logo_175.svg +0 -1
- package/dist/lmvz-components/assets/card-placeholder.svg +0 -4
- package/dist/lmvz-components/assets/fonts/Router-Bold.woff +0 -0
- package/dist/lmvz-components/assets/fonts/Router-Book.woff +0 -0
- package/dist/lmvz-components/assets/fonts/Router-Medium.woff +0 -0
- package/dist/lmvz-components/assets/icons/Logo.svg +0 -10
- package/dist/lmvz-components/assets/icons/actions.svg +0 -5
- package/dist/lmvz-components/assets/icons/adduser.svg +0 -3
- package/dist/lmvz-components/assets/icons/alert.svg +0 -3
- package/dist/lmvz-components/assets/icons/apple.svg +0 -3
- package/dist/lmvz-components/assets/icons/arrow-down.svg +0 -3
- package/dist/lmvz-components/assets/icons/arrow-left.svg +0 -3
- package/dist/lmvz-components/assets/icons/arrow-right.svg +0 -3
- package/dist/lmvz-components/assets/icons/arrow-up.svg +0 -3
- package/dist/lmvz-components/assets/icons/book.svg +0 -3
- package/dist/lmvz-components/assets/icons/bookmark.svg +0 -3
- package/dist/lmvz-components/assets/icons/checkmark.svg +0 -3
- package/dist/lmvz-components/assets/icons/chevron-down.svg +0 -3
- package/dist/lmvz-components/assets/icons/chevron-left.svg +0 -3
- package/dist/lmvz-components/assets/icons/chevron-right.svg +0 -3
- package/dist/lmvz-components/assets/icons/chevron-up.svg +0 -3
- package/dist/lmvz-components/assets/icons/close-l.svg +0 -3
- package/dist/lmvz-components/assets/icons/close-sm.svg +0 -3
- package/dist/lmvz-components/assets/icons/cog.svg +0 -4
- package/dist/lmvz-components/assets/icons/computer.svg +0 -3
- package/dist/lmvz-components/assets/icons/dashboard.svg +0 -6
- package/dist/lmvz-components/assets/icons/delete.svg +0 -3
- package/dist/lmvz-components/assets/icons/download.svg +0 -3
- package/dist/lmvz-components/assets/icons/edit.svg +0 -3
- package/dist/lmvz-components/assets/icons/external.svg +0 -3
- package/dist/lmvz-components/assets/icons/facebook.svg +0 -3
- package/dist/lmvz-components/assets/icons/favorite.svg +0 -3
- package/dist/lmvz-components/assets/icons/filter.svg +0 -3
- package/dist/lmvz-components/assets/icons/group.svg +0 -3
- package/dist/lmvz-components/assets/icons/hide.svg +0 -3
- package/dist/lmvz-components/assets/icons/home.svg +0 -3
- package/dist/lmvz-components/assets/icons/info.svg +0 -3
- package/dist/lmvz-components/assets/icons/instagram.svg +0 -3
- package/dist/lmvz-components/assets/icons/letter.svg +0 -3
- package/dist/lmvz-components/assets/icons/linkedin.svg +0 -5
- package/dist/lmvz-components/assets/icons/logout.svg +0 -3
- package/dist/lmvz-components/assets/icons/map.svg +0 -3
- package/dist/lmvz-components/assets/icons/minus.svg +0 -3
- package/dist/lmvz-components/assets/icons/navigation.svg +0 -3
- package/dist/lmvz-components/assets/icons/plus.svg +0 -3
- package/dist/lmvz-components/assets/icons/qr-scan.svg +0 -3
- package/dist/lmvz-components/assets/icons/question.svg +0 -10
- package/dist/lmvz-components/assets/icons/reader.svg +0 -3
- package/dist/lmvz-components/assets/icons/reset.svg +0 -3
- package/dist/lmvz-components/assets/icons/school.svg +0 -3
- package/dist/lmvz-components/assets/icons/search.svg +0 -3
- package/dist/lmvz-components/assets/icons/send.svg +0 -3
- package/dist/lmvz-components/assets/icons/settings.svg +0 -3
- package/dist/lmvz-components/assets/icons/share.svg +0 -10
- package/dist/lmvz-components/assets/icons/shopping-cart.svg +0 -3
- package/dist/lmvz-components/assets/icons/show.svg +0 -3
- package/dist/lmvz-components/assets/icons/snapchat.svg +0 -3
- package/dist/lmvz-components/assets/icons/sort.svg +0 -3
- package/dist/lmvz-components/assets/icons/speech-bubble.svg +0 -3
- package/dist/lmvz-components/assets/icons/star.svg +0 -3
- package/dist/lmvz-components/assets/icons/student.svg +0 -3
- package/dist/lmvz-components/assets/icons/upload.svg +0 -3
- package/dist/lmvz-components/assets/icons/user.svg +0 -3
- package/dist/lmvz-components/assets/icons/warn-circle.svg +0 -3
- package/dist/lmvz-components/assets/icons/warn-triangle.svg +0 -3
- package/dist/lmvz-components/assets/icons/whatsapp.svg +0 -4
- package/dist/lmvz-components/assets/icons/world.svg +0 -10
- package/dist/lmvz-components/assets/icons/x.svg +0 -3
- package/dist/lmvz-components/assets/icons/youtube.svg +0 -3
- package/dist/lmvz-components/assets/zukunftslinie.svg +0 -3
- package/dist/lmvz-components/p-6d71c048.entry.js +0 -1
- package/dist/lmvz-components/p-CDfcYSci.js +0 -1
- package/dist/lmvz-components/p-D9S7OTyY.js +0 -1
- package/dist/lmvz-components/p-DlrjrWsu.js +0 -1
- package/dist/lmvz-components/p-a4615e4b.entry.js +0 -1
- package/dist/lmvz-components/p-a8c88454.entry.js +0 -1
- package/dist/lmvz-components/p-e63e239a.entry.js +0 -1
- package/dist/lmvz-components/p-f956a5e7.entry.js +0 -1
- package/dist/lmvz-components/p-fefd2fe4.entry.js +0 -1
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Effect = require('./Effect-CNhHt4Xb.js');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new `Deferred`.
|
|
7
|
+
*
|
|
8
|
+
* @since 2.0.0
|
|
9
|
+
* @category constructors
|
|
10
|
+
*/
|
|
11
|
+
const make$1 = Effect.deferredMake;
|
|
12
|
+
const _await = Effect.deferredAwait;
|
|
13
|
+
/**
|
|
14
|
+
* Exits the `Deferred` with the specified `Exit` value, which will be
|
|
15
|
+
* propagated to all fibers waiting on the value of the `Deferred`.
|
|
16
|
+
*
|
|
17
|
+
* @since 2.0.0
|
|
18
|
+
* @category utils
|
|
19
|
+
*/
|
|
20
|
+
const done = Effect.deferredDone;
|
|
21
|
+
/**
|
|
22
|
+
* Fails the `Deferred` with the specified `Cause`, which will be propagated to
|
|
23
|
+
* all fibers waiting on the value of the `Deferred`.
|
|
24
|
+
*
|
|
25
|
+
* @since 2.0.0
|
|
26
|
+
* @category utils
|
|
27
|
+
*/
|
|
28
|
+
const failCause$1 = Effect.deferredFailCause;
|
|
29
|
+
/**
|
|
30
|
+
* Completes the `Deferred` with interruption. This will interrupt all fibers
|
|
31
|
+
* waiting on the value of the `Deferred` with the `FiberId` of the fiber
|
|
32
|
+
* calling this method.
|
|
33
|
+
*
|
|
34
|
+
* @since 2.0.0
|
|
35
|
+
* @category utils
|
|
36
|
+
*/
|
|
37
|
+
const interrupt = Effect.deferredInterrupt;
|
|
38
|
+
/**
|
|
39
|
+
* Returns `true` if this `Deferred` has already been completed with a value or
|
|
40
|
+
* an error, `false` otherwise.
|
|
41
|
+
*
|
|
42
|
+
* @since 2.0.0
|
|
43
|
+
* @category getters
|
|
44
|
+
*/
|
|
45
|
+
const isDone = Effect.deferredIsDone;
|
|
46
|
+
/**
|
|
47
|
+
* Completes the `Deferred` with the specified value.
|
|
48
|
+
*
|
|
49
|
+
* @since 2.0.0
|
|
50
|
+
* @category utils
|
|
51
|
+
*/
|
|
52
|
+
const succeed$1 = Effect.deferredSucceed;
|
|
53
|
+
/**
|
|
54
|
+
* Unsafely creates a new `Deferred` from the specified `FiberId`.
|
|
55
|
+
*
|
|
56
|
+
* @since 2.0.0
|
|
57
|
+
* @category unsafe
|
|
58
|
+
*/
|
|
59
|
+
const unsafeMake = Effect.deferredUnsafeMake;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Returns `true` if the specified `Exit` is a `Failure`, `false` otherwise.
|
|
63
|
+
*
|
|
64
|
+
* @since 2.0.0
|
|
65
|
+
* @category refinements
|
|
66
|
+
*/
|
|
67
|
+
const isFailure = Effect.exitIsFailure;
|
|
68
|
+
/**
|
|
69
|
+
* Returns `true` if the specified `Exit` is a `Success`, `false` otherwise.
|
|
70
|
+
*
|
|
71
|
+
* @since 2.0.0
|
|
72
|
+
* @category refinements
|
|
73
|
+
*/
|
|
74
|
+
const isSuccess = Effect.exitIsSuccess;
|
|
75
|
+
/**
|
|
76
|
+
* Collects all of the specified exit values into a `Some<Exit<List<A>, E>>`. If
|
|
77
|
+
* the provided iterable contains no elements, `None` will be returned.
|
|
78
|
+
*
|
|
79
|
+
* @since 2.0.0
|
|
80
|
+
* @category constructors
|
|
81
|
+
*/
|
|
82
|
+
const all = Effect.exitCollectAll;
|
|
83
|
+
/**
|
|
84
|
+
* Constructs a new `Exit.Failure` from the specified unrecoverable defect.
|
|
85
|
+
*
|
|
86
|
+
* @since 2.0.0
|
|
87
|
+
* @category constructors
|
|
88
|
+
*/
|
|
89
|
+
const die = Effect.exitDie;
|
|
90
|
+
/**
|
|
91
|
+
* Constructs a new `Exit.Failure` from the specified recoverable error of type
|
|
92
|
+
* `E`.
|
|
93
|
+
*
|
|
94
|
+
* @since 2.0.0
|
|
95
|
+
* @category constructors
|
|
96
|
+
*/
|
|
97
|
+
const fail = Effect.exitFail;
|
|
98
|
+
/**
|
|
99
|
+
* Constructs a new `Exit.Failure` from the specified `Cause` of type `E`.
|
|
100
|
+
*
|
|
101
|
+
* @since 2.0.0
|
|
102
|
+
* @category constructors
|
|
103
|
+
*/
|
|
104
|
+
const failCause = Effect.exitFailCause;
|
|
105
|
+
/**
|
|
106
|
+
* Maps over the `Success` value of the specified exit using the provided
|
|
107
|
+
* function.
|
|
108
|
+
*
|
|
109
|
+
* @since 2.0.0
|
|
110
|
+
* @category mapping
|
|
111
|
+
*/
|
|
112
|
+
const map = Effect.exitMap;
|
|
113
|
+
/**
|
|
114
|
+
* @since 2.0.0
|
|
115
|
+
* @category folding
|
|
116
|
+
*/
|
|
117
|
+
const match = Effect.exitMatch;
|
|
118
|
+
/**
|
|
119
|
+
* Constructs a new `Exit.Success` containing the specified value of type `A`.
|
|
120
|
+
*
|
|
121
|
+
* @since 2.0.0
|
|
122
|
+
* @category constructors
|
|
123
|
+
*/
|
|
124
|
+
const succeed = Effect.exitSucceed;
|
|
125
|
+
const void_ = Effect.exitVoid;
|
|
126
|
+
/**
|
|
127
|
+
* Sequentially zips the this result with the specified result or else returns
|
|
128
|
+
* the failed `Cause<E | E2>`.
|
|
129
|
+
*
|
|
130
|
+
* @since 2.0.0
|
|
131
|
+
* @category zipping
|
|
132
|
+
*/
|
|
133
|
+
const zip = Effect.exitZip;
|
|
134
|
+
/**
|
|
135
|
+
* Sequentially zips the this result with the specified result discarding the
|
|
136
|
+
* first element of the tuple or else returns the failed `Cause<E | E2>`.
|
|
137
|
+
*
|
|
138
|
+
* @since 2.0.0
|
|
139
|
+
* @category zipping
|
|
140
|
+
*/
|
|
141
|
+
const zipRight = Effect.exitZipRight;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @since 2.0.0
|
|
145
|
+
*/
|
|
146
|
+
const TypeId$1 = /*#__PURE__*/Symbol.for("effect/MutableList");
|
|
147
|
+
const MutableListProto = {
|
|
148
|
+
[TypeId$1]: TypeId$1,
|
|
149
|
+
[Symbol.iterator]() {
|
|
150
|
+
let done = false;
|
|
151
|
+
let head = this.head;
|
|
152
|
+
return {
|
|
153
|
+
next() {
|
|
154
|
+
if (done) {
|
|
155
|
+
return this.return();
|
|
156
|
+
}
|
|
157
|
+
if (head == null) {
|
|
158
|
+
done = true;
|
|
159
|
+
return this.return();
|
|
160
|
+
}
|
|
161
|
+
const value = head.value;
|
|
162
|
+
head = head.next;
|
|
163
|
+
return {
|
|
164
|
+
done,
|
|
165
|
+
value
|
|
166
|
+
};
|
|
167
|
+
},
|
|
168
|
+
return(value) {
|
|
169
|
+
if (!done) {
|
|
170
|
+
done = true;
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
done: true,
|
|
174
|
+
value
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
},
|
|
179
|
+
toString() {
|
|
180
|
+
return Effect.format(this.toJSON());
|
|
181
|
+
},
|
|
182
|
+
toJSON() {
|
|
183
|
+
return {
|
|
184
|
+
_id: "MutableList",
|
|
185
|
+
values: Array.from(this).map(Effect.toJSON)
|
|
186
|
+
};
|
|
187
|
+
},
|
|
188
|
+
[Effect.NodeInspectSymbol]() {
|
|
189
|
+
return this.toJSON();
|
|
190
|
+
},
|
|
191
|
+
pipe() {
|
|
192
|
+
return Effect.pipeArguments(this, arguments);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
/** @internal */
|
|
196
|
+
const makeNode = value => ({
|
|
197
|
+
value,
|
|
198
|
+
removed: false,
|
|
199
|
+
prev: undefined,
|
|
200
|
+
next: undefined
|
|
201
|
+
});
|
|
202
|
+
/**
|
|
203
|
+
* Creates an empty `MutableList`.
|
|
204
|
+
*
|
|
205
|
+
* @since 2.0.0
|
|
206
|
+
* @category constructors
|
|
207
|
+
*/
|
|
208
|
+
const empty = () => {
|
|
209
|
+
const list = Object.create(MutableListProto);
|
|
210
|
+
list.head = undefined;
|
|
211
|
+
list.tail = undefined;
|
|
212
|
+
list._length = 0;
|
|
213
|
+
return list;
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* Returns `true` if the list contains zero elements, `false`, otherwise.
|
|
217
|
+
*
|
|
218
|
+
* @since 2.0.0
|
|
219
|
+
* @category getters
|
|
220
|
+
*/
|
|
221
|
+
const isEmpty$1 = self => length$1(self) === 0;
|
|
222
|
+
/**
|
|
223
|
+
* Returns the length of the list.
|
|
224
|
+
*
|
|
225
|
+
* @since 2.0.0
|
|
226
|
+
* @category getters
|
|
227
|
+
*/
|
|
228
|
+
const length$1 = self => self._length;
|
|
229
|
+
/**
|
|
230
|
+
* Appends the specified element to the end of the `MutableList`.
|
|
231
|
+
*
|
|
232
|
+
* @category concatenating
|
|
233
|
+
* @since 2.0.0
|
|
234
|
+
*/
|
|
235
|
+
const append = /*#__PURE__*/Effect.dual(2, (self, value) => {
|
|
236
|
+
const node = makeNode(value);
|
|
237
|
+
if (self.head === undefined) {
|
|
238
|
+
self.head = node;
|
|
239
|
+
}
|
|
240
|
+
if (self.tail === undefined) {
|
|
241
|
+
self.tail = node;
|
|
242
|
+
} else {
|
|
243
|
+
self.tail.next = node;
|
|
244
|
+
node.prev = self.tail;
|
|
245
|
+
self.tail = node;
|
|
246
|
+
}
|
|
247
|
+
self._length += 1;
|
|
248
|
+
return self;
|
|
249
|
+
});
|
|
250
|
+
/**
|
|
251
|
+
* Removes the first value from the list and returns it, if it exists.
|
|
252
|
+
*
|
|
253
|
+
* @since 0.0.1
|
|
254
|
+
*/
|
|
255
|
+
const shift = self => {
|
|
256
|
+
const head = self.head;
|
|
257
|
+
if (head !== undefined) {
|
|
258
|
+
remove(self, head);
|
|
259
|
+
return head.value;
|
|
260
|
+
}
|
|
261
|
+
return undefined;
|
|
262
|
+
};
|
|
263
|
+
const remove = (self, node) => {
|
|
264
|
+
if (node.removed) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
node.removed = true;
|
|
268
|
+
if (node.prev !== undefined && node.next !== undefined) {
|
|
269
|
+
node.prev.next = node.next;
|
|
270
|
+
node.next.prev = node.prev;
|
|
271
|
+
} else if (node.prev !== undefined) {
|
|
272
|
+
self.tail = node.prev;
|
|
273
|
+
node.prev.next = undefined;
|
|
274
|
+
} else if (node.next !== undefined) {
|
|
275
|
+
self.head = node.next;
|
|
276
|
+
node.next.prev = undefined;
|
|
277
|
+
} else {
|
|
278
|
+
self.tail = undefined;
|
|
279
|
+
self.head = undefined;
|
|
280
|
+
}
|
|
281
|
+
if (self._length > 0) {
|
|
282
|
+
self._length -= 1;
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* @since 2.0.0
|
|
288
|
+
*/
|
|
289
|
+
const TypeId = /*#__PURE__*/Symbol.for("effect/MutableQueue");
|
|
290
|
+
/**
|
|
291
|
+
* @since 2.0.0
|
|
292
|
+
* @category symbol
|
|
293
|
+
*/
|
|
294
|
+
const EmptyMutableQueue = /*#__PURE__*/Symbol.for("effect/mutable/MutableQueue/Empty");
|
|
295
|
+
const MutableQueueProto = {
|
|
296
|
+
[TypeId]: TypeId,
|
|
297
|
+
[Symbol.iterator]() {
|
|
298
|
+
return Array.from(this.queue)[Symbol.iterator]();
|
|
299
|
+
},
|
|
300
|
+
toString() {
|
|
301
|
+
return Effect.format(this.toJSON());
|
|
302
|
+
},
|
|
303
|
+
toJSON() {
|
|
304
|
+
return {
|
|
305
|
+
_id: "MutableQueue",
|
|
306
|
+
values: Array.from(this).map(Effect.toJSON)
|
|
307
|
+
};
|
|
308
|
+
},
|
|
309
|
+
[Effect.NodeInspectSymbol]() {
|
|
310
|
+
return this.toJSON();
|
|
311
|
+
},
|
|
312
|
+
pipe() {
|
|
313
|
+
return Effect.pipeArguments(this, arguments);
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
const make = capacity => {
|
|
317
|
+
const queue = Object.create(MutableQueueProto);
|
|
318
|
+
queue.queue = empty();
|
|
319
|
+
queue.capacity = capacity;
|
|
320
|
+
return queue;
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* Creates a new bounded `MutableQueue`.
|
|
324
|
+
*
|
|
325
|
+
* @since 2.0.0
|
|
326
|
+
* @category constructors
|
|
327
|
+
*/
|
|
328
|
+
const bounded = capacity => make(capacity);
|
|
329
|
+
/**
|
|
330
|
+
* Creates a new unbounded `MutableQueue`.
|
|
331
|
+
*
|
|
332
|
+
* @since 2.0.0
|
|
333
|
+
* @category constructors
|
|
334
|
+
*/
|
|
335
|
+
const unbounded = () => make(undefined);
|
|
336
|
+
/**
|
|
337
|
+
* Returns the current number of elements in the queue.
|
|
338
|
+
*
|
|
339
|
+
* @since 2.0.0
|
|
340
|
+
* @category getters
|
|
341
|
+
*/
|
|
342
|
+
const length = self => length$1(self.queue);
|
|
343
|
+
/**
|
|
344
|
+
* Returns `true` if the queue is empty, `false` otherwise.
|
|
345
|
+
*
|
|
346
|
+
* @since 2.0.0
|
|
347
|
+
* @category getters
|
|
348
|
+
*/
|
|
349
|
+
const isEmpty = self => isEmpty$1(self.queue);
|
|
350
|
+
/**
|
|
351
|
+
* The **maximum** number of elements that a queue can hold.
|
|
352
|
+
*
|
|
353
|
+
* **Note**: unbounded queues can still implement this interface with
|
|
354
|
+
* `capacity = Infinity`.
|
|
355
|
+
*
|
|
356
|
+
* @since 2.0.0
|
|
357
|
+
* @category getters
|
|
358
|
+
*/
|
|
359
|
+
const capacity = self => self.capacity === undefined ? Infinity : self.capacity;
|
|
360
|
+
/**
|
|
361
|
+
* Offers an element to the queue.
|
|
362
|
+
*
|
|
363
|
+
* Returns whether the enqueue was successful or not.
|
|
364
|
+
*
|
|
365
|
+
* @since 2.0.0
|
|
366
|
+
*/
|
|
367
|
+
const offer = /*#__PURE__*/Effect.dual(2, (self, value) => {
|
|
368
|
+
const queueLength = length$1(self.queue);
|
|
369
|
+
if (self.capacity !== undefined && queueLength === self.capacity) {
|
|
370
|
+
return false;
|
|
371
|
+
}
|
|
372
|
+
append(value)(self.queue);
|
|
373
|
+
return true;
|
|
374
|
+
});
|
|
375
|
+
/**
|
|
376
|
+
* Enqueues a collection of values into the queue.
|
|
377
|
+
*
|
|
378
|
+
* Returns a `Chunk` of the values that were **not** able to be enqueued.
|
|
379
|
+
*
|
|
380
|
+
* @since 2.0.0
|
|
381
|
+
*/
|
|
382
|
+
const offerAll = /*#__PURE__*/Effect.dual(2, (self, values) => {
|
|
383
|
+
const iterator = values[Symbol.iterator]();
|
|
384
|
+
let next;
|
|
385
|
+
let remainder = Effect.empty$2();
|
|
386
|
+
let offering = true;
|
|
387
|
+
while (offering && (next = iterator.next()) && !next.done) {
|
|
388
|
+
offering = offer(next.value)(self);
|
|
389
|
+
}
|
|
390
|
+
while (next != null && !next.done) {
|
|
391
|
+
remainder = Effect.prepend(next.value)(remainder);
|
|
392
|
+
next = iterator.next();
|
|
393
|
+
}
|
|
394
|
+
return Effect.reverse(remainder);
|
|
395
|
+
});
|
|
396
|
+
/**
|
|
397
|
+
* Dequeues an element from the queue.
|
|
398
|
+
*
|
|
399
|
+
* Returns either an element from the queue, or the `def` param.
|
|
400
|
+
*
|
|
401
|
+
* **Note**: if there is no meaningful default for your type, you can always
|
|
402
|
+
* use `poll(MutableQueue.EmptyMutableQueue)`.
|
|
403
|
+
*
|
|
404
|
+
* @since 2.0.0
|
|
405
|
+
*/
|
|
406
|
+
const poll = /*#__PURE__*/Effect.dual(2, (self, def) => {
|
|
407
|
+
if (isEmpty$1(self.queue)) {
|
|
408
|
+
return def;
|
|
409
|
+
}
|
|
410
|
+
return shift(self.queue);
|
|
411
|
+
});
|
|
412
|
+
/**
|
|
413
|
+
* Dequeues up to `n` elements from the queue.
|
|
414
|
+
*
|
|
415
|
+
* Returns a `List` of up to `n` elements.
|
|
416
|
+
*
|
|
417
|
+
* @since 2.0.0
|
|
418
|
+
*/
|
|
419
|
+
const pollUpTo = /*#__PURE__*/Effect.dual(2, (self, n) => {
|
|
420
|
+
let result = Effect.empty$2();
|
|
421
|
+
let count = 0;
|
|
422
|
+
while (count < n) {
|
|
423
|
+
const element = poll(EmptyMutableQueue)(self);
|
|
424
|
+
if (element === EmptyMutableQueue) {
|
|
425
|
+
break;
|
|
426
|
+
}
|
|
427
|
+
result = Effect.prepend(element)(result);
|
|
428
|
+
count += 1;
|
|
429
|
+
}
|
|
430
|
+
return Effect.reverse(result);
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
exports.EmptyMutableQueue = EmptyMutableQueue;
|
|
434
|
+
exports._await = _await;
|
|
435
|
+
exports.all = all;
|
|
436
|
+
exports.bounded = bounded;
|
|
437
|
+
exports.capacity = capacity;
|
|
438
|
+
exports.die = die;
|
|
439
|
+
exports.done = done;
|
|
440
|
+
exports.fail = fail;
|
|
441
|
+
exports.failCause = failCause;
|
|
442
|
+
exports.failCause$1 = failCause$1;
|
|
443
|
+
exports.interrupt = interrupt;
|
|
444
|
+
exports.isDone = isDone;
|
|
445
|
+
exports.isEmpty = isEmpty;
|
|
446
|
+
exports.isFailure = isFailure;
|
|
447
|
+
exports.isSuccess = isSuccess;
|
|
448
|
+
exports.length = length;
|
|
449
|
+
exports.make = make$1;
|
|
450
|
+
exports.map = map;
|
|
451
|
+
exports.match = match;
|
|
452
|
+
exports.offer = offer;
|
|
453
|
+
exports.offerAll = offerAll;
|
|
454
|
+
exports.poll = poll;
|
|
455
|
+
exports.pollUpTo = pollUpTo;
|
|
456
|
+
exports.succeed = succeed;
|
|
457
|
+
exports.succeed$1 = succeed$1;
|
|
458
|
+
exports.unbounded = unbounded;
|
|
459
|
+
exports.unsafeMake = unsafeMake;
|
|
460
|
+
exports.void_ = void_;
|
|
461
|
+
exports.zip = zip;
|
|
462
|
+
exports.zipRight = zipRight;
|