@likec4/language-server 1.48.0 → 1.49.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 (78) hide show
  1. package/browser/package.json +2 -2
  2. package/browser-worker/package.json +2 -2
  3. package/dist/THIRD-PARTY-LICENSES.md +178 -0
  4. package/dist/_chunks/ConfigurableLayouter.mjs +1 -1956
  5. package/dist/_chunks/LikeC4FileSystem.mjs +3 -0
  6. package/dist/_chunks/LikeC4Views.mjs +34 -0
  7. package/dist/_chunks/ProjectsManager.mjs +1 -0
  8. package/dist/_chunks/WithMCPServer.mjs +481 -0
  9. package/dist/_chunks/icons.mjs +2 -5211
  10. package/dist/_chunks/{LikeC4LanguageServices.d.mts → index.d.mts} +1836 -707
  11. package/dist/_chunks/libs/@msgpack/msgpack.mjs +1 -805
  12. package/dist/_chunks/libs/eventemitter3.mjs +1 -243
  13. package/dist/_chunks/libs/fast-equals.mjs +1 -446
  14. package/dist/_chunks/libs/p-queue.mjs +1 -449
  15. package/dist/_chunks/libs/parse-ms.mjs +1 -36
  16. package/dist/_chunks/libs/picomatch.mjs +1 -1673
  17. package/dist/_chunks/libs/pretty-ms.mjs +1 -80
  18. package/dist/_chunks/libs/remeda.mjs +1 -482
  19. package/dist/_chunks/libs/strip-indent.mjs +1 -15
  20. package/dist/_chunks/libs/ufo.mjs +1 -166
  21. package/dist/_chunks/logger.mjs +1 -0
  22. package/dist/_chunks/rolldown-runtime.mjs +1 -42
  23. package/dist/_chunks/utils.mjs +1 -0
  24. package/dist/browser/index.d.mts +10 -0
  25. package/dist/browser/index.mjs +1 -0
  26. package/dist/browser/worker.mjs +1 -0
  27. package/dist/bundled.d.mts +2 -3
  28. package/dist/bundled.mjs +1 -51
  29. package/dist/filesystem/index.d.mts +2 -4
  30. package/dist/filesystem/index.mjs +1 -3
  31. package/dist/index.d.mts +38 -3
  32. package/dist/index.mjs +1 -48
  33. package/dist/likec4lib.d.mts +10 -3
  34. package/dist/likec4lib.mjs +1 -4
  35. package/dist/mcp/index.d.mts +2 -4
  36. package/dist/mcp/index.mjs +1 -3
  37. package/dist/module.d.mts +126 -4
  38. package/dist/module.mjs +1 -3
  39. package/dist/protocol.d.mts +314 -1
  40. package/dist/protocol.mjs +1 -3
  41. package/filesystem/package.json +4 -0
  42. package/mcp/package.json +4 -0
  43. package/module/package.json +4 -0
  44. package/package.json +79 -56
  45. package/LICENSE +0 -21
  46. package/dist/LikeC4LanguageServices.d.mts +0 -4
  47. package/dist/LikeC4LanguageServices.mjs +0 -3
  48. package/dist/_chunks/LikeC4LanguageServices.mjs +0 -725
  49. package/dist/_chunks/ast.d.mts +0 -1444
  50. package/dist/_chunks/ast.mjs +0 -2375
  51. package/dist/_chunks/ast2.mjs +0 -176
  52. package/dist/_chunks/common-exports.mjs +0 -0
  53. package/dist/_chunks/filesystem.mjs +0 -58
  54. package/dist/_chunks/grammar.mjs +0 -8
  55. package/dist/_chunks/libs/@hono/node-server.mjs +0 -436
  56. package/dist/_chunks/libs/hono.mjs +0 -1829
  57. package/dist/_chunks/likec4lib.mjs +0 -9
  58. package/dist/_chunks/mcp.mjs +0 -33
  59. package/dist/_chunks/module.mjs +0 -28
  60. package/dist/_chunks/module2.mjs +0 -6576
  61. package/dist/_chunks/protocol.d.mts +0 -311
  62. package/dist/_chunks/protocol.mjs +0 -78
  63. package/dist/ast.d.mts +0 -4
  64. package/dist/ast.mjs +0 -4
  65. package/dist/browser-worker.mjs +0 -6
  66. package/dist/browser.d.mts +0 -11
  67. package/dist/browser.mjs +0 -27
  68. package/dist/common-exports.d.mts +0 -4
  69. package/dist/common-exports.mjs +0 -5
  70. package/dist/generated/ast.d.mts +0 -2
  71. package/dist/generated/ast.mjs +0 -3
  72. package/dist/generated/grammar.d.mts +0 -6
  73. package/dist/generated/grammar.mjs +0 -3
  74. package/dist/generated/module.d.mts +0 -14
  75. package/dist/generated/module.mjs +0 -3
  76. package/dist/generated-lib/icons.d.mts +0 -4
  77. package/dist/generated-lib/icons.mjs +0 -3
  78. /package/dist/{browser-worker.d.mts → browser/worker.d.mts} +0 -0
@@ -1,446 +1 @@
1
- //#region ../../node_modules/.pnpm/fast-equals@6.0.0/node_modules/fast-equals/dist/es/index.mjs
2
- const { getOwnPropertyNames, getOwnPropertySymbols } = Object;
3
- const { hasOwnProperty } = Object.prototype;
4
- /**
5
- * Combine two comparators into a single comparators.
6
- */
7
- function combineComparators(comparatorA, comparatorB) {
8
- return function isEqual(a, b, state) {
9
- return comparatorA(a, b, state) && comparatorB(a, b, state);
10
- };
11
- }
12
- /**
13
- * Wrap the provided `areItemsEqual` method to manage the circular state, allowing
14
- * for circular references to be safely included in the comparison without creating
15
- * stack overflows.
16
- */
17
- function createIsCircular(areItemsEqual) {
18
- return function isCircular(a, b, state) {
19
- if (!a || !b || typeof a !== "object" || typeof b !== "object") return areItemsEqual(a, b, state);
20
- const { cache } = state;
21
- const cachedA = cache.get(a);
22
- const cachedB = cache.get(b);
23
- if (cachedA && cachedB) return cachedA === b && cachedB === a;
24
- cache.set(a, b);
25
- cache.set(b, a);
26
- const result = areItemsEqual(a, b, state);
27
- cache.delete(a);
28
- cache.delete(b);
29
- return result;
30
- };
31
- }
32
- /**
33
- * Get the properties to strictly examine, which include both own properties that are
34
- * not enumerable and symbol properties.
35
- */
36
- function getStrictProperties(object) {
37
- return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
38
- }
39
- /**
40
- * Whether the object contains the property passed as an own property.
41
- */
42
- const hasOwn = Object.hasOwn || ((object, property) => hasOwnProperty.call(object, property));
43
- const PREACT_VNODE = "__v";
44
- const PREACT_OWNER = "__o";
45
- const REACT_OWNER = "_owner";
46
- const { getOwnPropertyDescriptor, keys } = Object;
47
- /**
48
- * Whether the values passed are equal based on a [SameValue](https://262.ecma-international.org/7.0/#sec-samevalue) basis.
49
- * Simplified, this maps to if the two values are referentially equal to one another (`a === b`) or both are `NaN`.
50
- *
51
- * @note
52
- * When available in the environment, this is just a re-export of the global
53
- * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) method.
54
- */
55
- const sameValueEqual = Object.is || function sameValueEqual(a, b) {
56
- return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;
57
- };
58
- /**
59
- * Whether the values passed are equal based on a
60
- * [Strict Equality Comparison](https://262.ecma-international.org/7.0/#sec-strict-equality-comparison) basis.
61
- * Simplified, this maps to if the two values are referentially equal to one another (`a === b`).
62
- *
63
- * @note
64
- * This is mainly available as a convenience function, such as being a default when a function to determine equality between
65
- * two objects is used.
66
- */
67
- function strictEqual(a, b) {
68
- return a === b;
69
- }
70
- /**
71
- * Whether the array buffers are equal in value.
72
- */
73
- function areArrayBuffersEqual(a, b) {
74
- return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));
75
- }
76
- /**
77
- * Whether the arrays are equal in value.
78
- */
79
- function areArraysEqual(a, b, state) {
80
- let index = a.length;
81
- if (b.length !== index) return false;
82
- while (index-- > 0) if (!state.equals(a[index], b[index], index, index, a, b, state)) return false;
83
- return true;
84
- }
85
- /**
86
- * Whether the dataviews are equal in value.
87
- */
88
- function areDataViewsEqual(a, b) {
89
- return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength));
90
- }
91
- /**
92
- * Whether the dates passed are equal in value.
93
- */
94
- function areDatesEqual(a, b) {
95
- return sameValueEqual(a.getTime(), b.getTime());
96
- }
97
- /**
98
- * Whether the errors passed are equal in value.
99
- */
100
- function areErrorsEqual(a, b) {
101
- return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
102
- }
103
- /**
104
- * Whether the `Map`s are equal in value.
105
- */
106
- function areMapsEqual(a, b, state) {
107
- const size = a.size;
108
- if (size !== b.size) return false;
109
- if (!size) return true;
110
- const matchedIndices = new Array(size);
111
- const aIterable = a.entries();
112
- let aResult;
113
- let bResult;
114
- let index = 0;
115
- while (aResult = aIterable.next()) {
116
- if (aResult.done) break;
117
- const bIterable = b.entries();
118
- let hasMatch = false;
119
- let matchIndex = 0;
120
- while (bResult = bIterable.next()) {
121
- if (bResult.done) break;
122
- if (matchedIndices[matchIndex]) {
123
- matchIndex++;
124
- continue;
125
- }
126
- const aEntry = aResult.value;
127
- const bEntry = bResult.value;
128
- if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state) && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
129
- hasMatch = matchedIndices[matchIndex] = true;
130
- break;
131
- }
132
- matchIndex++;
133
- }
134
- if (!hasMatch) return false;
135
- index++;
136
- }
137
- return true;
138
- }
139
- /**
140
- * Whether the objects are equal in value.
141
- */
142
- function areObjectsEqual(a, b, state) {
143
- const properties = keys(a);
144
- let index = properties.length;
145
- if (keys(b).length !== index) return false;
146
- while (index-- > 0) if (!isPropertyEqual(a, b, state, properties[index])) return false;
147
- return true;
148
- }
149
- /**
150
- * Whether the objects are equal in value with strict property checking.
151
- */
152
- function areObjectsEqualStrict(a, b, state) {
153
- const properties = getStrictProperties(a);
154
- let index = properties.length;
155
- if (getStrictProperties(b).length !== index) return false;
156
- let property;
157
- let descriptorA;
158
- let descriptorB;
159
- while (index-- > 0) {
160
- property = properties[index];
161
- if (!isPropertyEqual(a, b, state, property)) return false;
162
- descriptorA = getOwnPropertyDescriptor(a, property);
163
- descriptorB = getOwnPropertyDescriptor(b, property);
164
- if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) return false;
165
- }
166
- return true;
167
- }
168
- /**
169
- * Whether the primitive wrappers passed are equal in value.
170
- */
171
- function arePrimitiveWrappersEqual(a, b) {
172
- return sameValueEqual(a.valueOf(), b.valueOf());
173
- }
174
- /**
175
- * Whether the regexps passed are equal in value.
176
- */
177
- function areRegExpsEqual(a, b) {
178
- return a.source === b.source && a.flags === b.flags;
179
- }
180
- /**
181
- * Whether the `Set`s are equal in value.
182
- */
183
- function areSetsEqual(a, b, state) {
184
- const size = a.size;
185
- if (size !== b.size) return false;
186
- if (!size) return true;
187
- const matchedIndices = new Array(size);
188
- const aIterable = a.values();
189
- let aResult;
190
- let bResult;
191
- while (aResult = aIterable.next()) {
192
- if (aResult.done) break;
193
- const bIterable = b.values();
194
- let hasMatch = false;
195
- let matchIndex = 0;
196
- while (bResult = bIterable.next()) {
197
- if (bResult.done) break;
198
- if (!matchedIndices[matchIndex] && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
199
- hasMatch = matchedIndices[matchIndex] = true;
200
- break;
201
- }
202
- matchIndex++;
203
- }
204
- if (!hasMatch) return false;
205
- }
206
- return true;
207
- }
208
- /**
209
- * Whether the TypedArray instances are equal in value.
210
- */
211
- function areTypedArraysEqual(a, b) {
212
- let index = a.byteLength;
213
- if (b.byteLength !== index || a.byteOffset !== b.byteOffset) return false;
214
- while (index-- > 0) if (a[index] !== b[index]) return false;
215
- return true;
216
- }
217
- /**
218
- * Whether the URL instances are equal in value.
219
- */
220
- function areUrlsEqual(a, b) {
221
- return a.hostname === b.hostname && a.pathname === b.pathname && a.protocol === b.protocol && a.port === b.port && a.hash === b.hash && a.username === b.username && a.password === b.password;
222
- }
223
- function isPropertyEqual(a, b, state, property) {
224
- if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE) && (a.$$typeof || b.$$typeof)) return true;
225
- return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
226
- }
227
- const toString = Object.prototype.toString;
228
- /**
229
- * Create a comparator method based on the type-specific equality comparators passed.
230
- */
231
- function createEqualityComparator(config) {
232
- const supportedComparatorMap = createSupportedComparatorMap(config);
233
- const { areArraysEqual, areDatesEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, areRegExpsEqual, areSetsEqual, getUnsupportedCustomComparator } = config;
234
- /**
235
- * compare the value of the two objects and return true if they are equivalent in values
236
- */
237
- return function comparator(a, b, state) {
238
- if (a === b) return true;
239
- if (a == null || b == null) return false;
240
- const type = typeof a;
241
- if (type !== typeof b) return false;
242
- if (type !== "object") {
243
- if (type === "number" || type === "bigint") return areNumbersEqual(a, b, state);
244
- if (type === "function") return areFunctionsEqual(a, b, state);
245
- return false;
246
- }
247
- const constructor = a.constructor;
248
- if (constructor !== b.constructor) return false;
249
- if (constructor === Object) return areObjectsEqual(a, b, state);
250
- if (constructor === Array) return areArraysEqual(a, b, state);
251
- if (constructor === Date) return areDatesEqual(a, b, state);
252
- if (constructor === RegExp) return areRegExpsEqual(a, b, state);
253
- if (constructor === Map) return areMapsEqual(a, b, state);
254
- if (constructor === Set) return areSetsEqual(a, b, state);
255
- if (constructor === Promise) return false;
256
- if (Array.isArray(a)) return areArraysEqual(a, b, state);
257
- const tag = toString.call(a);
258
- const supportedComparator = supportedComparatorMap[tag];
259
- if (supportedComparator) return supportedComparator(a, b, state);
260
- const unsupportedCustomComparator = getUnsupportedCustomComparator && getUnsupportedCustomComparator(a, b, state, tag);
261
- if (unsupportedCustomComparator) return unsupportedCustomComparator(a, b, state);
262
- return false;
263
- };
264
- }
265
- /**
266
- * Create the configuration object used for building comparators.
267
- */
268
- function createEqualityComparatorConfig({ circular, createCustomConfig, strict }) {
269
- let config = {
270
- areArrayBuffersEqual,
271
- areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
272
- areDataViewsEqual,
273
- areDatesEqual,
274
- areErrorsEqual,
275
- areFunctionsEqual: strictEqual,
276
- areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
277
- areNumbersEqual: sameValueEqual,
278
- areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
279
- arePrimitiveWrappersEqual,
280
- areRegExpsEqual,
281
- areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
282
- areTypedArraysEqual: strict ? combineComparators(areTypedArraysEqual, areObjectsEqualStrict) : areTypedArraysEqual,
283
- areUrlsEqual,
284
- getUnsupportedCustomComparator: void 0
285
- };
286
- if (createCustomConfig) config = Object.assign({}, config, createCustomConfig(config));
287
- if (circular) {
288
- const areArraysEqual = createIsCircular(config.areArraysEqual);
289
- const areMapsEqual = createIsCircular(config.areMapsEqual);
290
- const areObjectsEqual = createIsCircular(config.areObjectsEqual);
291
- const areSetsEqual = createIsCircular(config.areSetsEqual);
292
- config = Object.assign({}, config, {
293
- areArraysEqual,
294
- areMapsEqual,
295
- areObjectsEqual,
296
- areSetsEqual
297
- });
298
- }
299
- return config;
300
- }
301
- /**
302
- * Default equality comparator pass-through, used as the standard `isEqual` creator for
303
- * use inside the built comparator.
304
- */
305
- function createInternalEqualityComparator(compare) {
306
- return function(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
307
- return compare(a, b, state);
308
- };
309
- }
310
- /**
311
- * Create the `isEqual` function used by the consuming application.
312
- */
313
- function createIsEqual({ circular, comparator, createState, equals, strict }) {
314
- if (createState) return function isEqual(a, b) {
315
- const { cache = circular ? /* @__PURE__ */ new WeakMap() : void 0, meta } = createState();
316
- return comparator(a, b, {
317
- cache,
318
- equals,
319
- meta,
320
- strict
321
- });
322
- };
323
- if (circular) return function isEqual(a, b) {
324
- return comparator(a, b, {
325
- cache: /* @__PURE__ */ new WeakMap(),
326
- equals,
327
- meta: void 0,
328
- strict
329
- });
330
- };
331
- const state = {
332
- cache: void 0,
333
- equals,
334
- meta: void 0,
335
- strict
336
- };
337
- return function isEqual(a, b) {
338
- return comparator(a, b, state);
339
- };
340
- }
341
- /**
342
- * Create a map of `toString()` values to their respective handlers for `tag`-based lookups.
343
- */
344
- function createSupportedComparatorMap({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual }) {
345
- return {
346
- "[object Arguments]": areObjectsEqual,
347
- "[object Array]": areArraysEqual,
348
- "[object ArrayBuffer]": areArrayBuffersEqual,
349
- "[object AsyncGeneratorFunction]": areFunctionsEqual,
350
- "[object BigInt]": areNumbersEqual,
351
- "[object BigInt64Array]": areTypedArraysEqual,
352
- "[object BigUint64Array]": areTypedArraysEqual,
353
- "[object Boolean]": arePrimitiveWrappersEqual,
354
- "[object DataView]": areDataViewsEqual,
355
- "[object Date]": areDatesEqual,
356
- "[object Error]": areErrorsEqual,
357
- "[object Float16Array]": areTypedArraysEqual,
358
- "[object Float32Array]": areTypedArraysEqual,
359
- "[object Float64Array]": areTypedArraysEqual,
360
- "[object Function]": areFunctionsEqual,
361
- "[object GeneratorFunction]": areFunctionsEqual,
362
- "[object Int8Array]": areTypedArraysEqual,
363
- "[object Int16Array]": areTypedArraysEqual,
364
- "[object Int32Array]": areTypedArraysEqual,
365
- "[object Map]": areMapsEqual,
366
- "[object Number]": arePrimitiveWrappersEqual,
367
- "[object Object]": (a, b, state) => typeof a.then !== "function" && typeof b.then !== "function" && areObjectsEqual(a, b, state),
368
- "[object RegExp]": areRegExpsEqual,
369
- "[object Set]": areSetsEqual,
370
- "[object String]": arePrimitiveWrappersEqual,
371
- "[object URL]": areUrlsEqual,
372
- "[object Uint8Array]": areTypedArraysEqual,
373
- "[object Uint8ClampedArray]": areTypedArraysEqual,
374
- "[object Uint16Array]": areTypedArraysEqual,
375
- "[object Uint32Array]": areTypedArraysEqual
376
- };
377
- }
378
- /**
379
- * Whether the items passed are deeply-equal in value.
380
- */
381
- const deepEqual = createCustomEqual();
382
- /**
383
- * Whether the items passed are deeply-equal in value based on strict comparison.
384
- */
385
- const strictDeepEqual = createCustomEqual({ strict: true });
386
- /**
387
- * Whether the items passed are deeply-equal in value, including circular references.
388
- */
389
- const circularDeepEqual = createCustomEqual({ circular: true });
390
- /**
391
- * Whether the items passed are deeply-equal in value, including circular references,
392
- * based on strict comparison.
393
- */
394
- const strictCircularDeepEqual = createCustomEqual({
395
- circular: true,
396
- strict: true
397
- });
398
- /**
399
- * Whether the items passed are shallowly-equal in value.
400
- */
401
- const shallowEqual = createCustomEqual({ createInternalComparator: () => sameValueEqual });
402
- /**
403
- * Whether the items passed are shallowly-equal in value based on strict comparison
404
- */
405
- const strictShallowEqual = createCustomEqual({
406
- strict: true,
407
- createInternalComparator: () => sameValueEqual
408
- });
409
- /**
410
- * Whether the items passed are shallowly-equal in value, including circular references.
411
- */
412
- const circularShallowEqual = createCustomEqual({
413
- circular: true,
414
- createInternalComparator: () => sameValueEqual
415
- });
416
- /**
417
- * Whether the items passed are shallowly-equal in value, including circular references,
418
- * based on strict comparison.
419
- */
420
- const strictCircularShallowEqual = createCustomEqual({
421
- circular: true,
422
- createInternalComparator: () => sameValueEqual,
423
- strict: true
424
- });
425
- /**
426
- * Create a custom equality comparison method.
427
- *
428
- * This can be done to create very targeted comparisons in extreme hot-path scenarios
429
- * where the standard methods are not performant enough, but can also be used to provide
430
- * support for legacy environments that do not support expected features like
431
- * `RegExp.prototype.flags` out of the box.
432
- */
433
- function createCustomEqual(options = {}) {
434
- const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false } = options;
435
- const comparator = createEqualityComparator(createEqualityComparatorConfig(options));
436
- return createIsEqual({
437
- circular,
438
- comparator,
439
- createState,
440
- equals: createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator),
441
- strict
442
- });
443
- }
444
-
445
- //#endregion
446
- export { deepEqual as t };
1
+ const{getOwnPropertyNames,getOwnPropertySymbols}=Object,{hasOwnProperty}=Object.prototype;function combineComparators(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function createIsCircular(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function getStrictProperties(n){return getOwnPropertyNames(n).concat(getOwnPropertySymbols(n))}const hasOwn=Object.hasOwn||((e,t)=>hasOwnProperty.call(e,t)),{getOwnPropertyDescriptor,keys}=Object,sameValueEqual=Object.is||function(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t};function strictEqual(e,t){return e===t}function areArrayBuffersEqual(e,t){return e.byteLength===t.byteLength&&areTypedArraysEqual(new Uint8Array(e),new Uint8Array(t))}function areArraysEqual(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function areDataViewsEqual(e,t){return e.byteLength===t.byteLength&&areTypedArraysEqual(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function areDatesEqual(e,t){return sameValueEqual(e.getTime(),t.getTime())}function areErrorsEqual(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function areMapsEqual(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}function areObjectsEqual(e,t,n){let r=keys(e),i=r.length;if(keys(t).length!==i)return!1;for(;i-- >0;)if(!isPropertyEqual(e,t,n,r[i]))return!1;return!0}function areObjectsEqualStrict(e,t,n){let r=getStrictProperties(e),a=r.length;if(getStrictProperties(t).length!==a)return!1;let o,s,c;for(;a-- >0;)if(o=r[a],!isPropertyEqual(e,t,n,o)||(s=getOwnPropertyDescriptor(e,o),c=getOwnPropertyDescriptor(t,o),(s||c)&&(!s||!c||s.configurable!==c.configurable||s.enumerable!==c.enumerable||s.writable!==c.writable)))return!1;return!0}function arePrimitiveWrappersEqual(e,t){return sameValueEqual(e.valueOf(),t.valueOf())}function areRegExpsEqual(e,t){return e.source===t.source&&e.flags===t.flags}function areSetsEqual(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function areTypedArraysEqual(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function areUrlsEqual(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function isPropertyEqual(e,t,n,i){return(i===`_owner`||i===`__o`||i===`__v`)&&(e.$$typeof||t.$$typeof)?!0:hasOwn(t,i)&&n.equals(e[i],t[i],i,i,e,t,n)}const toString=Object.prototype.toString;function createEqualityComparator(e){let t=createSupportedComparatorMap(e),{areArraysEqual:n,areDatesEqual:r,areFunctionsEqual:i,areMapsEqual:a,areNumbersEqual:o,areObjectsEqual:c,areRegExpsEqual:l,areSetsEqual:u,getUnsupportedCustomComparator:d}=e;return function(e,f,p){if(e===f)return!0;if(e==null||f==null)return!1;let m=typeof e;if(m!==typeof f)return!1;if(m!==`object`)return m===`number`||m===`bigint`?o(e,f,p):m===`function`?i(e,f,p):!1;let h=e.constructor;if(h!==f.constructor)return!1;if(h===Object)return c(e,f,p);if(h===Array)return n(e,f,p);if(h===Date)return r(e,f,p);if(h===RegExp)return l(e,f,p);if(h===Map)return a(e,f,p);if(h===Set)return u(e,f,p);if(h===Promise)return!1;if(Array.isArray(e))return n(e,f,p);let g=toString.call(e),_=t[g];if(_)return _(e,f,p);let v=d&&d(e,f,p,g);return v?v(e,f,p):!1}}function createEqualityComparatorConfig({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual,areArraysEqual:n?areObjectsEqualStrict:areArraysEqual,areDataViewsEqual,areDatesEqual,areErrorsEqual,areFunctionsEqual:strictEqual,areMapsEqual:n?combineComparators(areMapsEqual,areObjectsEqualStrict):areMapsEqual,areNumbersEqual:sameValueEqual,areObjectsEqual:n?areObjectsEqualStrict:areObjectsEqual,arePrimitiveWrappersEqual,areRegExpsEqual,areSetsEqual:n?combineComparators(areSetsEqual,areObjectsEqualStrict):areSetsEqual,areTypedArraysEqual:n?combineComparators(areTypedArraysEqual,areObjectsEqualStrict):areTypedArraysEqual,areUrlsEqual,getUnsupportedCustomComparator:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=createIsCircular(r.areArraysEqual),t=createIsCircular(r.areMapsEqual),n=createIsCircular(r.areObjectsEqual),i=createIsCircular(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function createInternalEqualityComparator(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function createIsEqual({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}function createSupportedComparatorMap({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p}){return{"[object Arguments]":c,"[object Array]":t,"[object ArrayBuffer]":e,"[object AsyncGeneratorFunction]":a,"[object BigInt]":s,"[object BigInt64Array]":f,"[object BigUint64Array]":f,"[object Boolean]":l,"[object DataView]":n,"[object Date]":r,"[object Error]":i,"[object Float16Array]":f,"[object Float32Array]":f,"[object Float64Array]":f,"[object Function]":a,"[object GeneratorFunction]":a,"[object Int8Array]":f,"[object Int16Array]":f,"[object Int32Array]":f,"[object Map]":o,"[object Number]":l,"[object Object]":(e,t,n)=>typeof e.then!=`function`&&typeof t.then!=`function`&&c(e,t,n),"[object RegExp]":u,"[object Set]":d,"[object String]":l,"[object URL]":p,"[object Uint8Array]":f,"[object Uint8ClampedArray]":f,"[object Uint16Array]":f,"[object Uint32Array]":f}}const deepEqual=createCustomEqual();createCustomEqual({strict:!0}),createCustomEqual({circular:!0}),createCustomEqual({circular:!0,strict:!0}),createCustomEqual({createInternalComparator:()=>sameValueEqual}),createCustomEqual({strict:!0,createInternalComparator:()=>sameValueEqual}),createCustomEqual({circular:!0,createInternalComparator:()=>sameValueEqual}),createCustomEqual({circular:!0,createInternalComparator:()=>sameValueEqual,strict:!0});function createCustomEqual(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=createEqualityComparator(createEqualityComparatorConfig(e));return createIsEqual({circular:t,comparator:a,createState:r,equals:n?n(a):createInternalEqualityComparator(a),strict:i})}export{deepEqual as t};