@multiplatform.one/node-graph 9.0.10 → 9.1.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 (124) hide show
  1. package/dist/cjs/graphLayout/GraphDots.cjs +60 -0
  2. package/dist/cjs/graphLayout/GraphDots.native.js +66 -0
  3. package/dist/cjs/graphLayout/GraphDots.native.js.map +1 -0
  4. package/dist/cjs/graphLayout/GraphLayout.cjs +153 -0
  5. package/dist/cjs/graphLayout/GraphLayout.native.js +163 -0
  6. package/dist/cjs/graphLayout/GraphLayout.native.js.map +1 -0
  7. package/dist/cjs/graphLayout/GraphSvg.cjs +68 -0
  8. package/dist/cjs/graphLayout/GraphSvg.native.js +73 -0
  9. package/dist/cjs/graphLayout/GraphSvg.native.js.map +1 -0
  10. package/dist/cjs/graphLayout/GraphViewport.cjs +263 -0
  11. package/dist/cjs/graphLayout/GraphViewport.native.js +279 -0
  12. package/dist/cjs/graphLayout/GraphViewport.native.js.map +1 -0
  13. package/dist/cjs/graphLayout/index.cjs +51 -0
  14. package/dist/cjs/graphLayout/index.native.js +54 -0
  15. package/dist/cjs/graphLayout/index.native.js.map +1 -0
  16. package/dist/cjs/graphLayout/ogden.fixture.cjs +30 -0
  17. package/dist/cjs/graphLayout/ogden.fixture.native.js +33 -0
  18. package/dist/cjs/graphLayout/ogden.fixture.native.js.map +1 -0
  19. package/dist/cjs/graphLayout/plan.cjs +263 -0
  20. package/dist/cjs/graphLayout/plan.native.js +372 -0
  21. package/dist/cjs/graphLayout/plan.native.js.map +1 -0
  22. package/dist/cjs/graphLayout/viewMath.cjs +142 -0
  23. package/dist/cjs/graphLayout/viewMath.native.js +147 -0
  24. package/dist/cjs/graphLayout/viewMath.native.js.map +1 -0
  25. package/dist/esm/graphLayout/GraphDots.mjs +35 -0
  26. package/dist/esm/graphLayout/GraphDots.mjs.map +1 -0
  27. package/dist/esm/graphLayout/GraphDots.native.js +38 -0
  28. package/dist/esm/graphLayout/GraphDots.native.js.map +1 -0
  29. package/dist/esm/graphLayout/GraphLayout.mjs +127 -0
  30. package/dist/esm/graphLayout/GraphLayout.mjs.map +1 -0
  31. package/dist/esm/graphLayout/GraphLayout.native.js +134 -0
  32. package/dist/esm/graphLayout/GraphLayout.native.js.map +1 -0
  33. package/dist/esm/graphLayout/GraphSvg.mjs +42 -0
  34. package/dist/esm/graphLayout/GraphSvg.mjs.map +1 -0
  35. package/dist/esm/graphLayout/GraphSvg.native.js +44 -0
  36. package/dist/esm/graphLayout/GraphSvg.native.js.map +1 -0
  37. package/dist/esm/graphLayout/GraphViewport.mjs +238 -0
  38. package/dist/esm/graphLayout/GraphViewport.mjs.map +1 -0
  39. package/dist/esm/graphLayout/GraphViewport.native.js +251 -0
  40. package/dist/esm/graphLayout/GraphViewport.native.js.map +1 -0
  41. package/dist/esm/graphLayout/index.mjs +7 -0
  42. package/dist/esm/graphLayout/index.mjs.map +1 -0
  43. package/dist/esm/graphLayout/index.native.js +7 -0
  44. package/dist/esm/graphLayout/index.native.js.map +1 -0
  45. package/dist/esm/graphLayout/ogden.fixture.mjs +4 -0
  46. package/dist/esm/graphLayout/ogden.fixture.mjs.map +1 -0
  47. package/dist/esm/graphLayout/ogden.fixture.native.js +4 -0
  48. package/dist/esm/graphLayout/ogden.fixture.native.js.map +1 -0
  49. package/dist/esm/graphLayout/plan.mjs +235 -0
  50. package/dist/esm/graphLayout/plan.mjs.map +1 -0
  51. package/dist/esm/graphLayout/plan.native.js +341 -0
  52. package/dist/esm/graphLayout/plan.native.js.map +1 -0
  53. package/dist/esm/graphLayout/viewMath.mjs +105 -0
  54. package/dist/esm/graphLayout/viewMath.mjs.map +1 -0
  55. package/dist/esm/graphLayout/viewMath.native.js +107 -0
  56. package/dist/esm/graphLayout/viewMath.native.js.map +1 -0
  57. package/dist/jsx/graphLayout/GraphDots.mjs +35 -0
  58. package/dist/jsx/graphLayout/GraphDots.mjs.map +1 -0
  59. package/dist/jsx/graphLayout/GraphDots.native.js +66 -0
  60. package/dist/jsx/graphLayout/GraphDots.native.js.map +1 -0
  61. package/dist/jsx/graphLayout/GraphLayout.mjs +127 -0
  62. package/dist/jsx/graphLayout/GraphLayout.mjs.map +1 -0
  63. package/dist/jsx/graphLayout/GraphLayout.native.js +163 -0
  64. package/dist/jsx/graphLayout/GraphLayout.native.js.map +1 -0
  65. package/dist/jsx/graphLayout/GraphSvg.mjs +42 -0
  66. package/dist/jsx/graphLayout/GraphSvg.mjs.map +1 -0
  67. package/dist/jsx/graphLayout/GraphSvg.native.js +73 -0
  68. package/dist/jsx/graphLayout/GraphSvg.native.js.map +1 -0
  69. package/dist/jsx/graphLayout/GraphViewport.mjs +238 -0
  70. package/dist/jsx/graphLayout/GraphViewport.mjs.map +1 -0
  71. package/dist/jsx/graphLayout/GraphViewport.native.js +279 -0
  72. package/dist/jsx/graphLayout/GraphViewport.native.js.map +1 -0
  73. package/dist/jsx/graphLayout/index.mjs +7 -0
  74. package/dist/jsx/graphLayout/index.mjs.map +1 -0
  75. package/dist/jsx/graphLayout/index.native.js +54 -0
  76. package/dist/jsx/graphLayout/index.native.js.map +1 -0
  77. package/dist/jsx/graphLayout/ogden.fixture.mjs +4 -0
  78. package/dist/jsx/graphLayout/ogden.fixture.mjs.map +1 -0
  79. package/dist/jsx/graphLayout/ogden.fixture.native.js +33 -0
  80. package/dist/jsx/graphLayout/ogden.fixture.native.js.map +1 -0
  81. package/dist/jsx/graphLayout/plan.mjs +235 -0
  82. package/dist/jsx/graphLayout/plan.mjs.map +1 -0
  83. package/dist/jsx/graphLayout/plan.native.js +372 -0
  84. package/dist/jsx/graphLayout/plan.native.js.map +1 -0
  85. package/dist/jsx/graphLayout/viewMath.mjs +105 -0
  86. package/dist/jsx/graphLayout/viewMath.mjs.map +1 -0
  87. package/dist/jsx/graphLayout/viewMath.native.js +147 -0
  88. package/dist/jsx/graphLayout/viewMath.native.js.map +1 -0
  89. package/graph-layout.ts +1 -0
  90. package/package.json +21 -6
  91. package/src/graphLayout/GraphDots.tsx +32 -0
  92. package/src/graphLayout/GraphLayout.stories.tsx +86 -0
  93. package/src/graphLayout/GraphLayout.tsx +152 -0
  94. package/src/graphLayout/GraphSvg.native.tsx +31 -0
  95. package/src/graphLayout/GraphSvg.tsx +45 -0
  96. package/src/graphLayout/GraphViewport.native.tsx +231 -0
  97. package/src/graphLayout/GraphViewport.tsx +246 -0
  98. package/src/graphLayout/index.ts +31 -0
  99. package/src/graphLayout/ogden.fixture.ts +120 -0
  100. package/src/graphLayout/plan.spec.ts +202 -0
  101. package/src/graphLayout/plan.ts +223 -0
  102. package/src/graphLayout/purity.spec.ts +67 -0
  103. package/src/graphLayout/viewMath.spec.ts +185 -0
  104. package/src/graphLayout/viewMath.ts +151 -0
  105. package/types/graphLayout/GraphDots.d.ts +9 -0
  106. package/types/graphLayout/GraphDots.d.ts.map +1 -0
  107. package/types/graphLayout/GraphLayout.d.ts +22 -0
  108. package/types/graphLayout/GraphLayout.d.ts.map +1 -0
  109. package/types/graphLayout/GraphSvg.d.ts +17 -0
  110. package/types/graphLayout/GraphSvg.d.ts.map +1 -0
  111. package/types/graphLayout/GraphSvg.native.d.ts +5 -0
  112. package/types/graphLayout/GraphSvg.native.d.ts.map +1 -0
  113. package/types/graphLayout/GraphViewport.d.ts +11 -0
  114. package/types/graphLayout/GraphViewport.d.ts.map +1 -0
  115. package/types/graphLayout/GraphViewport.native.d.ts +4 -0
  116. package/types/graphLayout/GraphViewport.native.d.ts.map +1 -0
  117. package/types/graphLayout/index.d.ts +11 -0
  118. package/types/graphLayout/index.d.ts.map +1 -0
  119. package/types/graphLayout/ogden.fixture.d.ts +3 -0
  120. package/types/graphLayout/ogden.fixture.d.ts.map +1 -0
  121. package/types/graphLayout/plan.d.ts +52 -0
  122. package/types/graphLayout/plan.d.ts.map +1 -0
  123. package/types/graphLayout/viewMath.d.ts +47 -0
  124. package/types/graphLayout/viewMath.d.ts.map +1 -0
@@ -0,0 +1,5 @@
1
+ import type { GraphPathProps, GraphSvgProps } from "./GraphSvg";
2
+ export type { GraphPathProps, GraphSvgProps } from "./GraphSvg";
3
+ export declare function GraphSvg({ width, height, children }: GraphSvgProps): import("react/jsx-runtime").JSX.Element;
4
+ export declare function GraphPath({ d, stroke, strokeWidth, dash, fill, round }: GraphPathProps): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=GraphSvg.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphSvg.native.d.ts","sourceRoot":"","sources":["../../src/graphLayout/GraphSvg.native.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhE,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,aAAa,2CAWlE;AAED,wBAAgB,SAAS,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,cAAc,2CAYtF"}
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from "react";
2
+ import type { Extent, GraphDots as GraphDotsSpec } from "./viewMath";
3
+ export interface GraphViewportProps {
4
+ readonly content: Extent;
5
+ readonly viewport: Extent;
6
+ readonly dots?: GraphDotsSpec;
7
+ readonly frozen?: boolean;
8
+ readonly children: ReactNode;
9
+ }
10
+ export declare function GraphViewport({ content, viewport, dots, frozen, children }: GraphViewportProps): import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=GraphViewport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphViewport.d.ts","sourceRoot":"","sources":["../../src/graphLayout/GraphViewport.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAavC,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,IAAI,aAAa,EAAa,MAAM,YAAY,CAAC;AAEhF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAqBD,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,kBAAkB,2CA0M9F"}
@@ -0,0 +1,4 @@
1
+ import type { GraphViewportProps } from "./GraphViewport";
2
+ export type { GraphViewportProps } from "./GraphViewport";
3
+ export declare function GraphViewport({ content, viewport, dots, frozen, children }: GraphViewportProps): import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=GraphViewport.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphViewport.native.d.ts","sourceRoot":"","sources":["../../src/graphLayout/GraphViewport.native.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAY1D,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,kBAAkB,2CAmI9F"}
@@ -0,0 +1,11 @@
1
+ export { GraphLayout, resolveGraphDirection } from "./GraphLayout";
2
+ export type { GraphLayoutProps, GraphSpaceToken } from "./GraphLayout";
3
+ export { GraphViewport } from "./GraphViewport";
4
+ export type { GraphViewportProps } from "./GraphViewport";
5
+ export { GraphDots } from "./GraphDots";
6
+ export type { GraphDotsProps } from "./GraphDots";
7
+ export { arrowHead, graphEdgeId, planGraphLayout, usableEdges } from "./plan";
8
+ export type { GraphDirection, GraphLayoutEdge, GraphLayoutNode, GraphPlan, GraphPlanInput, PlannedEdge, PlannedNode, } from "./plan";
9
+ export { clampOffset, clampView, dotArea, dotPath, dotPhase, dotPitch, fittedView, graphZoom, keyedView, leastScale, toggledView, zoomAt, } from "./viewMath";
10
+ export type { DotArea, Extent, GraphDots as GraphDotsSpec, GraphView } from "./viewMath";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/graphLayout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACnE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC9E,YAAY,EACV,cAAc,EACd,eAAe,EACf,eAAe,EACf,SAAS,EACT,cAAc,EACd,WAAW,EACX,WAAW,GACZ,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,WAAW,EACX,MAAM,GACP,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,IAAI,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const ogdenApps: readonly string[];
2
+ export declare const ogdenLinks: readonly (readonly [string, string])[];
3
+ //# sourceMappingURL=ogden.fixture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ogden.fixture.d.ts","sourceRoot":"","sources":["../../src/graphLayout/ogden.fixture.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,EAAE,SAAS,MAAM,EA0DtC,CAAC;AACF,eAAO,MAAM,UAAU,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EA4D5D,CAAC"}
@@ -0,0 +1,52 @@
1
+ import type { XY } from "../model/document";
2
+ import { Position } from "../react-flow/xyPaths";
3
+ export type GraphDirection = "LR" | "TB";
4
+ export interface GraphLayoutNode {
5
+ readonly id: string;
6
+ readonly width: number;
7
+ readonly height: number;
8
+ }
9
+ export interface GraphLayoutEdge {
10
+ readonly id?: string;
11
+ readonly source: string;
12
+ readonly target: string;
13
+ readonly kind?: string;
14
+ readonly emphasis?: boolean;
15
+ }
16
+ export interface GraphPlanInput {
17
+ readonly nodes: readonly GraphLayoutNode[];
18
+ readonly edges: readonly GraphLayoutEdge[];
19
+ readonly direction: GraphDirection;
20
+ readonly nodeSpacing: number;
21
+ readonly rankSpacing: number;
22
+ readonly margin: number;
23
+ readonly strokeWidth: number;
24
+ readonly wrapWidth?: number;
25
+ readonly positions?: Readonly<Record<string, XY>>;
26
+ }
27
+ export interface PlannedNode extends GraphLayoutNode {
28
+ readonly x: number;
29
+ readonly y: number;
30
+ }
31
+ export interface PlannedEdge {
32
+ readonly id: string;
33
+ readonly source: string;
34
+ readonly target: string;
35
+ readonly d: string;
36
+ readonly head: string;
37
+ readonly tip: XY;
38
+ readonly stroke: string;
39
+ readonly dash?: string;
40
+ readonly emphasis: boolean;
41
+ }
42
+ export interface GraphPlan {
43
+ readonly width: number;
44
+ readonly height: number;
45
+ readonly nodes: readonly PlannedNode[];
46
+ readonly edges: readonly PlannedEdge[];
47
+ }
48
+ export declare function graphEdgeId(edge: GraphLayoutEdge): string;
49
+ export declare function usableEdges(nodes: readonly GraphLayoutNode[], edges: readonly GraphLayoutEdge[]): GraphLayoutEdge[];
50
+ export declare function arrowHead(tip: XY, side: Position, strokeWidth: number): string;
51
+ export declare function planGraphLayout(input: GraphPlanInput): GraphPlan;
52
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/graphLayout/plan.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;AAEzC,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAC3C,QAAQ,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAA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C,KAAK,EAAE,cAAc,GAAG,SAAS,CAmDhE"}
@@ -0,0 +1,47 @@
1
+ export interface Extent {
2
+ readonly width: number;
3
+ readonly height: number;
4
+ }
5
+ export interface GraphView {
6
+ readonly scale: number;
7
+ readonly x: number;
8
+ readonly y: number;
9
+ }
10
+ export interface DotArea {
11
+ readonly x: number;
12
+ readonly y: number;
13
+ readonly width: number;
14
+ readonly height: number;
15
+ }
16
+ export interface GraphDots {
17
+ readonly pitch: number;
18
+ readonly dot: number;
19
+ readonly color: string;
20
+ }
21
+ export declare const graphZoom: {
22
+ readonly floor: 0.1;
23
+ readonly step: 1.25;
24
+ readonly settleMs: 220;
25
+ };
26
+ export declare function leastScale(content: Extent, viewport: Extent): number;
27
+ export declare function clampOffset(offset: number, content: number, viewport: number): number;
28
+ export declare function clampView(view: GraphView, content: Extent, viewport: Extent): GraphView;
29
+ export declare function zoomAt(view: GraphView, scale: number, focal: {
30
+ readonly x: number;
31
+ readonly y: number;
32
+ }, content: Extent, viewport: Extent): GraphView;
33
+ export declare function fittedView(content: Extent, viewport: Extent): GraphView;
34
+ export declare function toggledView(view: GraphView, at: {
35
+ readonly x: number;
36
+ readonly y: number;
37
+ }, content: Extent, viewport: Extent): GraphView;
38
+ export declare function keyedView(key: string, view: GraphView, content: Extent, viewport: Extent): GraphView | undefined;
39
+ export declare function dotPitch(pitch: number, scale: number): number;
40
+ export declare function dotPhase(offset: number, scale: number, pitch: number, spaced: number): number;
41
+ export declare function dotArea(offset: {
42
+ readonly x: number;
43
+ readonly y: number;
44
+ }, viewport: Extent, canvas: Extent, chunk: number): DotArea;
45
+ export declare function dotPath(area: DotArea, pitch: number): string;
46
+ export declare function sameArea(a: DotArea, b: DotArea): boolean;
47
+ //# sourceMappingURL=viewMath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewMath.d.ts","sourceRoot":"","sources":["../../src/graphLayout/viewMath.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,QAAQ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