@code3d/core 0.0.1-alpha.0 → 0.0.1-alpha.2

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 (128) hide show
  1. package/README.md +223 -786
  2. package/THIRD_PARTY.md +40 -0
  3. package/bld/THIRD_PARTY_NOTICES.txt +182 -0
  4. package/bld/chunks/chunk-5E6VXJU2.js +30 -0
  5. package/bld/chunks/chunk-5E6VXJU2.js.map +7 -0
  6. package/bld/chunks/chunk-63ZUQWQ2.js +19 -0
  7. package/bld/chunks/chunk-63ZUQWQ2.js.map +7 -0
  8. package/bld/chunks/chunk-AWYI64EE.js +31 -0
  9. package/bld/chunks/chunk-AWYI64EE.js.map +7 -0
  10. package/bld/chunks/chunk-F53RTQPT.js +24787 -0
  11. package/bld/chunks/chunk-F53RTQPT.js.map +7 -0
  12. package/bld/chunks/chunk-TJIN6S4R.js +1 -0
  13. package/bld/chunks/chunk-TJIN6S4R.js.map +7 -0
  14. package/bld/library/cached.d.ts +33 -0
  15. package/bld/library/cached.d.ts.map +1 -0
  16. package/bld/library/font.d.ts +39 -0
  17. package/bld/library/font.d.ts.map +1 -0
  18. package/bld/library/google-font.d.ts +14 -0
  19. package/bld/library/google-font.d.ts.map +1 -0
  20. package/bld/library/index.d.ts +8 -2
  21. package/bld/library/index.d.ts.map +1 -1
  22. package/bld/library/index.js +60 -3
  23. package/bld/library/index.js.map +7 -1
  24. package/bld/library/kernel-artifact-codec.d.ts.map +1 -1
  25. package/bld/library/kernel-cache.d.ts +17 -6
  26. package/bld/library/kernel-cache.d.ts.map +1 -1
  27. package/bld/library/material.d.ts +1 -1
  28. package/bld/library/material.d.ts.map +1 -1
  29. package/bld/library/open-cascade.d.ts +4 -0
  30. package/bld/library/open-cascade.d.ts.map +1 -0
  31. package/bld/library/replicad.d.ts +3 -2
  32. package/bld/library/replicad.d.ts.map +1 -1
  33. package/bld/library/replicad.js +10 -24
  34. package/bld/library/replicad.js.map +7 -1
  35. package/bld/library/retained-memory.d.ts.map +1 -1
  36. package/bld/library/runtime.d.ts +144 -80
  37. package/bld/library/runtime.d.ts.map +1 -1
  38. package/bld/library/sketch-solver.d.ts +1 -1
  39. package/bld/library/sketch-solver.d.ts.map +1 -1
  40. package/bld/library/sketch.d.ts +9 -1
  41. package/bld/library/sketch.d.ts.map +1 -1
  42. package/bld/library/text.d.ts +53 -0
  43. package/bld/library/text.d.ts.map +1 -0
  44. package/bld/library/three.js +3 -3
  45. package/bld/library/three.js.map +7 -1
  46. package/bld/node/index.d.ts.map +1 -1
  47. package/bld/node/index.js +62 -14
  48. package/bld/node/index.js.map +7 -1
  49. package/bld/node/replicad.js +13 -3
  50. package/bld/node/replicad.js.map +7 -1
  51. package/bld/tooling/index.d.ts +17 -15
  52. package/bld/tooling/index.d.ts.map +1 -1
  53. package/bld/tooling/index.js +147 -19
  54. package/bld/tooling/index.js.map +7 -1
  55. package/package.json +18 -6
  56. package/src/library/cached.ts +132 -0
  57. package/src/library/font.ts +186 -0
  58. package/src/library/google-font.ts +97 -0
  59. package/src/library/index.ts +8 -3
  60. package/src/library/kernel-artifact-codec.ts +129 -20
  61. package/src/library/kernel-cache.ts +111 -33
  62. package/src/library/material.ts +3 -4
  63. package/src/library/open-cascade.ts +13 -0
  64. package/src/library/replicad.ts +5 -5
  65. package/src/library/retained-memory.ts +6 -1
  66. package/src/library/runtime.ts +2049 -1728
  67. package/src/library/sketch-solver.ts +3 -1
  68. package/src/library/sketch.ts +81 -13
  69. package/src/library/text.ts +477 -0
  70. package/src/library/tsconfig.json +2 -1
  71. package/src/node/index.ts +14 -3
  72. package/src/node/tsconfig.json +2 -1
  73. package/src/tooling/index.ts +48 -46
  74. package/src/tooling/tsconfig.json +2 -1
  75. package/bld/library/alignment-geometry.js +0 -322
  76. package/bld/library/alignment-geometry.js.map +0 -1
  77. package/bld/library/bound-solver.js +0 -252
  78. package/bld/library/bound-solver.js.map +0 -1
  79. package/bld/library/extrude.js +0 -28
  80. package/bld/library/extrude.js.map +0 -1
  81. package/bld/library/kernel-artifact-codec.js +0 -148
  82. package/bld/library/kernel-artifact-codec.js.map +0 -1
  83. package/bld/library/kernel-cache.js +0 -245
  84. package/bld/library/kernel-cache.js.map +0 -1
  85. package/bld/library/kernel-shapes.js +0 -108
  86. package/bld/library/kernel-shapes.js.map +0 -1
  87. package/bld/library/loft.js +0 -161
  88. package/bld/library/loft.js.map +0 -1
  89. package/bld/library/material.js +0 -176
  90. package/bld/library/material.js.map +0 -1
  91. package/bld/library/model-color.js +0 -36
  92. package/bld/library/model-color.js.map +0 -1
  93. package/bld/library/open-cascade-error.js +0 -22
  94. package/bld/library/open-cascade-error.js.map +0 -1
  95. package/bld/library/relation-solver.js +0 -258
  96. package/bld/library/relation-solver.js.map +0 -1
  97. package/bld/library/retained-memory.js +0 -27
  98. package/bld/library/retained-memory.js.map +0 -1
  99. package/bld/library/runtime.js +0 -2954
  100. package/bld/library/runtime.js.map +0 -1
  101. package/bld/library/shell.js +0 -221
  102. package/bld/library/shell.js.map +0 -1
  103. package/bld/library/sketch-curve-intersections.js +0 -117
  104. package/bld/library/sketch-curve-intersections.js.map +0 -1
  105. package/bld/library/sketch-curves.js +0 -89
  106. package/bld/library/sketch-curves.js.map +0 -1
  107. package/bld/library/sketch-drag-rules.js +0 -522
  108. package/bld/library/sketch-drag-rules.js.map +0 -1
  109. package/bld/library/sketch-face.js +0 -72
  110. package/bld/library/sketch-face.js.map +0 -1
  111. package/bld/library/sketch-incidence.js +0 -114
  112. package/bld/library/sketch-incidence.js.map +0 -1
  113. package/bld/library/sketch-precision.js +0 -55
  114. package/bld/library/sketch-precision.js.map +0 -1
  115. package/bld/library/sketch-regions.js +0 -193
  116. package/bld/library/sketch-regions.js.map +0 -1
  117. package/bld/library/sketch-solver.js +0 -578
  118. package/bld/library/sketch-solver.js.map +0 -1
  119. package/bld/library/sketch.js +0 -650
  120. package/bld/library/sketch.js.map +0 -1
  121. package/bld/library/spatial.js +0 -195
  122. package/bld/library/spatial.js.map +0 -1
  123. package/bld/library/topology-id.js +0 -67
  124. package/bld/library/topology-id.js.map +0 -1
  125. package/bld/library/topology-inspection.js +0 -267
  126. package/bld/library/topology-inspection.js.map +0 -1
  127. package/bld/library/topology.js +0 -455
  128. package/bld/library/topology.js.map +0 -1
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-TJIN6S4R.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,33 @@
1
+ import { type CacheCodec, type KernelArtifact, type KernelOperationKey, type KernelValueLifecycle } from './kernel-cache.js';
2
+ export type CachedOptions<Value> = CacheCodec<Value>;
3
+ /** The compiler supplies the definition and its static dependency fingerprint. */
4
+ export declare function identifyCachedFunction<Fn extends Function>(fn: Fn, identity: string): Fn;
5
+ /**
6
+ * Memoizes a synchronous, deterministic computation in the shared cache.
7
+ * Pass changing captured state as arguments and treat returned data as immutable.
8
+ * The engine fingerprints definitions and dependencies for persistent reuse.
9
+ * Outside the engine, function identity provides process-local memory reuse.
10
+ * Custom encoder/decoder pairs run only when writing/restoring persistent data;
11
+ * memory hits return the retained value without decoding or copying it.
12
+ */
13
+ export declare function cached<Args extends unknown[], Value>(compute: (...args: Args) => Value & (Value extends PromiseLike<unknown> ? never : unknown), options?: CachedOptions<NoInfer<Value>>): (...args: Args) => Value;
14
+ /** Internal artifact form also supports native ownership and remote admission. */
15
+ export declare function cachedArtifact<Args extends unknown[], Value>(compute: (...args: Args) => Value, { key, lifecycle, codec, identity, namespace, }?: {
16
+ key?: (...args: Args) => KernelOperationKey;
17
+ lifecycle?: KernelValueLifecycle<Value>;
18
+ codec?: CacheCodec<Value> | false;
19
+ identity?: Function;
20
+ namespace?: string;
21
+ }): ((...args: Args) => KernelArtifact<Value>) & {
22
+ key: (...args: Args) => KernelOperationKey;
23
+ find: (key: KernelOperationKey) => Readonly<{
24
+ id: string;
25
+ value: Value;
26
+ }> | undefined;
27
+ findMany: (keys: readonly KernelOperationKey[]) => readonly (Readonly<{
28
+ id: string;
29
+ value: Value;
30
+ }> | undefined)[];
31
+ accept: (key: KernelOperationKey, value: Value) => void;
32
+ };
33
+ //# sourceMappingURL=cached.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cached.d.ts","sourceRoot":"","sources":["../../src/library/cached.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,mBAAmB,CAAC;AAG3B,MAAM,MAAM,aAAa,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;AAOrD,kFAAkF;AAClF,wBAAgB,sBAAsB,CAAC,EAAE,SAAS,QAAQ,EACxD,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,MAAM,GACf,EAAE,CAQJ;AAsBD;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,KAAK,EAClD,OAAO,EAAE,CACP,GAAG,IAAI,EAAE,IAAI,KACV,KAAK,GAAG,CAAC,KAAK,SAAS,WAAW,CAAC,OAAO,CAAC,GAAG,KAAK,GAAG,OAAO,CAAC,EACnE,OAAO,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GACtC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,KAAK,CAgB1B;AAED,kFAAkF;AAClF,wBAAgB,cAAc,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,KAAK,EAC1D,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,KAAK,EACjC,EACE,GAAG,EACH,SAAwD,EACxD,KAAK,EACL,QAAkB,EAClB,SAAoB,GACrB,GAAE;IACD,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,kBAAkB,CAAC;IAC5C,SAAS,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;IAClC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,cAmBM,IAAI,KAAG,cAAc,CAAC,KAAK,CAAC;mBAxBtB,IAAI,KAAK,kBAAkB;gBAiB1B,kBAAkB;;;;qBAEb,SAAS,kBAAkB,EAAE;;;;kBAEhC,kBAAkB,SAAS,KAAK;EAatD"}
@@ -0,0 +1,39 @@
1
+ /// <reference types="emscripten" preserve="true" />
2
+ import type * as HarfBuzz from 'harfbuzzjs';
3
+ import { type GoogleFontOptions } from './google-font.js';
4
+ import { type KernelArtifact } from './kernel-cache.js';
5
+ declare const fontBrand: unique symbol;
6
+ /** An immutable, content-addressed font resource. Size is supplied to text(). */
7
+ export type Font = Readonly<{
8
+ family: string;
9
+ style: string;
10
+ [fontBrand]: true;
11
+ }>;
12
+ export type ParsedFont = Readonly<{
13
+ face: HarfBuzz.Face;
14
+ font: HarfBuzz.Font;
15
+ numGlyphs: number;
16
+ sourceBytes: number;
17
+ }>;
18
+ export declare function installFontEngine(engine: typeof HarfBuzz): void;
19
+ export declare function shapeFontText(font: HarfBuzz.Font, content: string, kerning: boolean): {
20
+ infos: HarfBuzz.GlyphInfo[];
21
+ positions: HarfBuzz.GlyphPosition[];
22
+ };
23
+ export type FontPart = Readonly<{
24
+ artifact: KernelArtifact<ParsedFont>;
25
+ ranges: readonly (readonly [number, number])[];
26
+ }>;
27
+ declare let readResource: ((url: URL) => Uint8Array | undefined) | undefined;
28
+ /** The model engine prepares resources before synchronous author code runs. */
29
+ export declare function installModelResourceReader(reader: typeof readResource): void;
30
+ /** Reads font bytes or a prepared project/HTTP(S) URL; Node also reads file URLs. */
31
+ export declare function font(source: URL | ArrayBuffer | Uint8Array): Font;
32
+ /**
33
+ * A Google Fonts family/style prepared by the model engine before execution.
34
+ * @modelResource google-font
35
+ */
36
+ export declare function googleFont(family: string, options?: GoogleFontOptions): Font;
37
+ export declare function fontParts(value: Font): readonly FontPart[];
38
+ export {};
39
+ //# sourceMappingURL=font.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../../src/library/font.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,KAAK,QAAQ,MAAM,YAAY,CAAC;AAC5C,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAE3B,QAAA,MAAM,SAAS,EAAE,OAAO,MAAuB,CAAC;AAChD,iFAAiF;AACjF,MAAM,MAAM,IAAI,GAAG,QAAQ,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC;CACnB,CAAC,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC,CAAC;AAGH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,QAAQ,GAAG,IAAI,CAG/D;AACD,wBAAgB,aAAa,CAC3B,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO;IASd,KAAK;IACL,SAAS;EAEZ;AACD,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAC9B,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACrC,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;CAChD,CAAC,CAAC;AAEH,QAAA,IAAI,YAAY,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK,UAAU,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;AAErE,+EAA+E;AAC/E,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,OAAO,YAAY,GAAG,IAAI,CAE5E;AAED,qFAAqF;AACrF,wBAAgB,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,WAAW,GAAG,UAAU,GAAG,IAAI,CAEjE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,iBAAsB,GAC9B,IAAI,CAaN;AA4FD,wBAAgB,SAAS,CAAC,KAAK,EAAE,IAAI,GAAG,SAAS,QAAQ,EAAE,CAO1D"}
@@ -0,0 +1,14 @@
1
+ export type GoogleFontOptions = Readonly<{
2
+ /** Omit to use Google Fonts' default weight. */
3
+ weight?: number;
4
+ /** Omit to use Google Fonts' default style. */
5
+ italic?: boolean;
6
+ }>;
7
+ export type GoogleFontSource = Readonly<{
8
+ url: string;
9
+ ranges: readonly (readonly [number, number])[];
10
+ }>;
11
+ /** Canonical request shared by synchronous Core and asynchronous preparation. */
12
+ export declare function googleFontUrl(family: string, options?: GoogleFontOptions): URL;
13
+ export declare function googleFontSources(bytes: Uint8Array): readonly GoogleFontSource[];
14
+ //# sourceMappingURL=google-font.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-font.d.ts","sourceRoot":"","sources":["../../src/library/google-font.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;CAChD,CAAC,CAAC;AAEH,iFAAiF;AACjF,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,iBAAsB,GAC9B,GAAG,CA2BL;AA8CD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,UAAU,GAChB,SAAS,gBAAgB,EAAE,CAE7B"}
@@ -1,7 +1,13 @@
1
+ export { cached } from './cached.js';
2
+ export type { CachedOptions } from './cached.js';
3
+ export { font, googleFont } from './font.js';
4
+ export type { Font } from './font.js';
5
+ export type { GoogleFontOptions } from './google-font.js';
6
+ export type { TextOptions } from './text.js';
1
7
  export { sketch } from './sketch.js';
2
8
  export type { Sketch, SketchEntry, SketchConstraint, SketchOptions, SketchPoint, SketchPosition, SketchArcDirection, } from './sketch.js';
3
- export { arc, bezier, box, circle, coil, cut, cylinder, ellipse, extrude, frustum, group, intersect, line, loft, point, rectangle, regularPolygon, regularPrism, spline, sphere, tube, union, } from './runtime.js';
4
- export type { Anchor, Bound, DirectionalBounds, ConstraintPivotChain, ConstraintAroundChain, CanonicalElements, Constraint, CurveElements, Edge, EdgeModel, EdgeTopologyCapabilities, ElementKind, ElementSources, ExposedElements, ExposedValue, FaceAnchor, FaceModel, GeometryCapabilities, GeometryQueryCapabilities, GroupModel, LineAnchor, LoftOptions, MergedElements, Model, ModelCapabilities, ModelElementKind, ModelFamily, ModelFamilyElementKind, ModelForFamily, ModelGeometryKind, ModelKind, NamedElements, PlanarElements, PointAnchor, Solid, SolidModel, SolidModificationCapabilities, Surface, SurfaceTopologyCapabilities, Vertex, VertexModel, VertexTopologyCapabilities, } from './runtime.js';
9
+ export { arc, bezier, box, circle, coil, cut, cylinder, ellipse, extrude, text, frustum, group, intersect, line, loft, point, rectangle, regularPolygon, regularPrism, spline, sphere, tube, union, } from './runtime.js';
10
+ export type { Anchor, Bound, DirectionalBounds, ConstraintPivotChain, ConstraintAroundChain, CanonicalElements, Constraint, CurveElements, Edge, EdgeModel, EdgeTopologyCapabilities, ElementKind, ElementSources, ExposedElements, ExposedValue, FaceAnchor, FaceModel, GeometryCapabilities, GeometryQueryCapabilities, GroupModel, LineAnchor, LoftOptions, MergedElements, Model, ModelCapabilities, ModelElementKind, ModelForKind, ModelGeometryKind, ModelKind, NamedElements, PlanarElements, PointAnchor, Solid, SolidModel, SolidModificationCapabilities, Surface, SurfaceTopologyCapabilities, Vertex, VertexModel, VertexTopologyCapabilities, } from './runtime.js';
5
11
  export type { Vec3 } from './spatial.js';
6
12
  export type { EdgeId, SurfaceId, TopologyId, TopologyKind, VertexId, } from './topology.js';
7
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,YAAY,EACV,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,cAAc,EACd,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,GAAG,EACH,MAAM,EACN,GAAG,EACH,MAAM,EACN,IAAI,EACJ,GAAG,EACH,QAAQ,EACR,OAAO,EACP,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,SAAS,EACT,cAAc,EACd,YAAY,EACZ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,GACN,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,MAAM,EACN,KAAK,EACL,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,IAAI,EACJ,SAAS,EACT,wBAAwB,EACxB,WAAW,EACX,cAAc,EACd,eAAe,EACf,YAAY,EACZ,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,yBAAyB,EACzB,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,sBAAsB,EACtB,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,cAAc,EACd,WAAW,EACX,KAAK,EACL,UAAU,EACV,6BAA6B,EAC7B,OAAO,EACP,2BAA2B,EAC3B,MAAM,EACN,WAAW,EACX,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AACtB,YAAY,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AACvC,YAAY,EACV,MAAM,EACN,SAAS,EACT,UAAU,EACV,YAAY,EACZ,QAAQ,GACT,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,YAAY,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,MAAM,WAAW,CAAC;AAC3C,YAAY,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AACpC,YAAY,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACxD,YAAY,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,YAAY,EACV,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,cAAc,EACd,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,GAAG,EACH,MAAM,EACN,GAAG,EACH,MAAM,EACN,IAAI,EACJ,GAAG,EACH,QAAQ,EACR,OAAO,EACP,OAAO,EACP,IAAI,EACJ,OAAO,EACP,KAAK,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,SAAS,EACT,cAAc,EACd,YAAY,EACZ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,GACN,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,MAAM,EACN,KAAK,EACL,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,IAAI,EACJ,SAAS,EACT,wBAAwB,EACxB,WAAW,EACX,cAAc,EACd,eAAe,EACf,YAAY,EACZ,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,yBAAyB,EACzB,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,cAAc,EACd,WAAW,EACX,KAAK,EACL,UAAU,EACV,6BAA6B,EAC7B,OAAO,EACP,2BAA2B,EAC3B,MAAM,EACN,WAAW,EACX,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AACtB,YAAY,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AACvC,YAAY,EACV,MAAM,EACN,SAAS,EACT,UAAU,EACV,YAAY,EACZ,QAAQ,GACT,MAAM,eAAe,CAAC"}
@@ -1,3 +1,60 @@
1
- export { sketch } from './sketch.js';
2
- export { arc, bezier, box, circle, coil, cut, cylinder, ellipse, extrude, frustum, group, intersect, line, loft, point, rectangle, regularPolygon, regularPrism, spline, sphere, tube, union, } from './runtime.js';
3
- //# sourceMappingURL=index.js.map
1
+ import "../chunks/chunk-TJIN6S4R.js";
2
+ import {
3
+ arc,
4
+ bezier,
5
+ box,
6
+ cached,
7
+ circle,
8
+ coil,
9
+ cut,
10
+ cylinder,
11
+ ellipse,
12
+ extrude,
13
+ font,
14
+ frustum,
15
+ googleFont,
16
+ group,
17
+ intersect,
18
+ line,
19
+ loft,
20
+ point,
21
+ rectangle,
22
+ regularPolygon,
23
+ regularPrism,
24
+ sketch,
25
+ sphere,
26
+ spline,
27
+ text,
28
+ tube,
29
+ union
30
+ } from "../chunks/chunk-F53RTQPT.js";
31
+ export {
32
+ arc,
33
+ bezier,
34
+ box,
35
+ cached,
36
+ circle,
37
+ coil,
38
+ cut,
39
+ cylinder,
40
+ ellipse,
41
+ extrude,
42
+ font,
43
+ frustum,
44
+ googleFont,
45
+ group,
46
+ intersect,
47
+ line,
48
+ loft,
49
+ point,
50
+ rectangle,
51
+ regularPolygon,
52
+ regularPrism,
53
+ sketch,
54
+ sphere,
55
+ spline,
56
+ text,
57
+ tube,
58
+ union
59
+ };
60
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAWnC,OAAO,EACL,GAAG,EACH,MAAM,EACN,GAAG,EACH,MAAM,EACN,IAAI,EACJ,GAAG,EACH,QAAQ,EACR,OAAO,EACP,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,SAAS,EACT,cAAc,EACd,YAAY,EACZ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,GACN,MAAM,cAAc,CAAC"}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"kernel-artifact-codec.d.ts","sourceRoot":"","sources":["../../src/library/kernel-artifact-codec.ts"],"names":[],"mappings":"AAUA,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,OAAO,GACb,UAAU,CAmDZ;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EACxC,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,MAAM,GAChB,KAAK,CA2DP"}
1
+ {"version":3,"file":"kernel-artifact-codec.d.ts","sourceRoot":"","sources":["../../src/library/kernel-artifact-codec.ts"],"names":[],"mappings":"AA4BA,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,OAAO,GACb,UAAU,CAuFZ;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EACxC,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,MAAM,GAChB,KAAK,CAkHP"}
@@ -1,8 +1,11 @@
1
1
  /** The host opens storage before synchronous evaluation and owns its lifetime. */
2
2
  export interface KernelArtifactStore {
3
3
  get(id: string): Uint8Array | undefined;
4
+ getMany(ids: readonly string[]): readonly (Uint8Array | undefined)[];
4
5
  set(id: string, bytes: Uint8Array): void;
5
6
  touch(id: string): boolean;
7
+ /** Update access order together, returning existence in the same order. */
8
+ touchMany(ids: readonly string[]): readonly boolean[];
6
9
  delete(id: string): void;
7
10
  flush(): void;
8
11
  }
@@ -11,18 +14,22 @@ export type KernelArtifact<Value> = Readonly<{
11
14
  id: string;
12
15
  value: Value;
13
16
  }>;
17
+ export type CacheCodec<Value> = Readonly<{
18
+ encoder(value: Value): Uint8Array;
19
+ decoder(bytes: Uint8Array): Value;
20
+ }>;
14
21
  export type KernelValueLifecycle<Value> = Readonly<{
15
22
  estimateBytes(value: Value): number;
16
23
  retain(value: Value): Value;
17
24
  instantiate(retained: Value): Value;
18
25
  release(value: Value): void;
19
26
  }>;
20
- export declare function createKernelOperationCache({ maximumBytes, nativeAllocatedBytes, }: {
27
+ export declare function createComputationCache({ maximumBytes, nativeAllocatedBytes, }: {
21
28
  maximumBytes?: number;
22
29
  nativeAllocatedBytes: () => number;
23
30
  }): {
31
+ evaluateCachedArtifact: <Value>(key: KernelOperationKey, lifecycle: KernelValueLifecycle<Value>, compute: () => Value, codec?: CacheCodec<Value> | false) => KernelArtifact<Value>;
24
32
  beginKernelOperationEvaluation: (checkCancelled?: () => void) => () => void;
25
- evaluateKernelOperation: <Value>(operation: string, arguments_: readonly KernelKeyPart[], inputs: readonly KernelArtifact<unknown>[], lifecycle: KernelValueLifecycle<Value>, compute: () => Value) => KernelArtifact<Value>;
26
33
  clearKernelOperationCache: () => void;
27
34
  kernelOperationCacheStats: () => {
28
35
  entries: number;
@@ -38,11 +45,14 @@ export declare function createKernelOperationCache({ maximumBytes, nativeAllocat
38
45
  persistenceErrors: number;
39
46
  };
40
47
  setKernelArtifactStore: (next: KernelArtifactStore | undefined) => void;
41
- findKernelOperation: <Value>(key: KernelOperationKey, lifecycle: KernelValueLifecycle<Value>) => KernelArtifact<Value> | undefined;
42
- acceptKernelOperation: <Value>(key: KernelOperationKey, lifecycle: KernelValueLifecycle<Value>, value: Value) => void;
48
+ findKernelOperation: <Value>(key: KernelOperationKey, lifecycle: KernelValueLifecycle<Value>, codec?: CacheCodec<Value> | false) => KernelArtifact<Value> | undefined;
49
+ findKernelOperations: <Value>(keys: readonly KernelOperationKey[], lifecycle: KernelValueLifecycle<Value>, codec?: CacheCodec<Value> | false) => readonly (KernelArtifact<Value> | undefined)[];
50
+ acceptKernelOperation: <Value>(key: KernelOperationKey, lifecycle: KernelValueLifecycle<Value>, value: Value, codec?: CacheCodec<Value> | false) => void;
43
51
  setKernelExternalBytes: (bytes: number) => void;
44
52
  };
45
- export declare const beginKernelOperationEvaluation: (checkCancelled?: () => void) => () => void, evaluateKernelOperation: <Value>(operation: string, arguments_: readonly KernelKeyPart[], inputs: readonly KernelArtifact<unknown>[], lifecycle: KernelValueLifecycle<Value>, compute: () => Value) => KernelArtifact<Value>, clearKernelOperationCache: () => void, kernelOperationCacheStats: () => {
53
+ /** The installed backend supplies native accounting; pure caches need no kernel. */
54
+ export declare function setKernelNativeMemoryCounter(read: () => number): void;
55
+ export declare const evaluateCachedArtifact: <Value>(key: KernelOperationKey, lifecycle: KernelValueLifecycle<Value>, compute: () => Value, codec?: CacheCodec<Value> | false) => KernelArtifact<Value>, beginKernelOperationEvaluation: (checkCancelled?: () => void) => () => void, clearKernelOperationCache: () => void, kernelOperationCacheStats: () => {
46
56
  entries: number;
47
57
  hits: number;
48
58
  misses: number;
@@ -54,10 +64,11 @@ export declare const beginKernelOperationEvaluation: (checkCancelled?: () => voi
54
64
  persistentHits: number;
55
65
  persistentWrites: number;
56
66
  persistenceErrors: number;
57
- }, setKernelArtifactStore: (next: KernelArtifactStore | undefined) => void, findKernelOperation: <Value>(key: KernelOperationKey, lifecycle: KernelValueLifecycle<Value>) => KernelArtifact<Value> | undefined, acceptKernelOperation: <Value>(key: KernelOperationKey, lifecycle: KernelValueLifecycle<Value>, value: Value) => void, setKernelExternalBytes: (bytes: number) => void;
67
+ }, setKernelArtifactStore: (next: KernelArtifactStore | undefined) => void, findKernelOperation: <Value>(key: KernelOperationKey, lifecycle: KernelValueLifecycle<Value>, codec?: CacheCodec<Value> | false) => KernelArtifact<Value> | undefined, findKernelOperations: <Value>(keys: readonly KernelOperationKey[], lifecycle: KernelValueLifecycle<Value>, codec?: CacheCodec<Value> | false) => readonly (KernelArtifact<Value> | undefined)[], acceptKernelOperation: <Value>(key: KernelOperationKey, lifecycle: KernelValueLifecycle<Value>, value: Value, codec?: CacheCodec<Value> | false) => void, setKernelExternalBytes: (bytes: number) => void;
58
68
  export type KernelOperationKey = Readonly<{
59
69
  id: string;
60
70
  signature: string;
61
71
  }>;
62
72
  export declare function kernelOperationKey(operation: string, arguments_: readonly KernelKeyPart[], inputs: readonly Pick<KernelArtifact<unknown>, 'id'>[]): KernelOperationKey;
73
+ export declare function kernelContentId(value: string | Uint8Array): string;
63
74
  //# sourceMappingURL=kernel-cache.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kernel-cache.d.ts","sourceRoot":"","sources":["../../src/library/kernel-cache.ts"],"names":[],"mappings":"AAQA,kFAAkF;AAClF,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IACxC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzC,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB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AC9B,UAAU,CAAC,KAAK,CAAC,GAAG,KAAK,KAChC,cAAc,CAAC,KAAK,CAAC,GAAG,SAAS,EAiPpC,oBAAoB,GA3OU,KAAK,QAC3B,SAAS,kBAAkB,EAAE,aACxB,oBAAoB,CAAC,KAAK,CAAC,UAC9B,UAAU,CAAC,KAAK,CAAC,GAAG,KAAK,KAChC,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,EAAE,EAwOjD,qBAAqB,GA/KU,KAAK,OAC7B,kBAAkB,aACZ,oBAAoB,CAAC,KAAK,CAAC,SAC/B,KAAK,UACJ,UAAU,CAAC,KAAK,CAAC,GAAG,KAAK,KAChC,IAAI,EA2KP,sBAAsB,UApTiB,MAAM,KAAG,IAuThD,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC;AAE3E,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,SAAS,aAAa,EAAE,EACpC,MAAM,EAAE,SAAS,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,GACrD,kBAAkB,CAOpB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAgBlE"}
@@ -1,4 +1,4 @@
1
- import { Material, type MaterialJSON } from './three.js';
1
+ import { Material, type MaterialJSON } from 'three';
2
2
  /** A color selects the default material for each geometry kind. */
3
3
  export type ModelMaterialSnapshot = string | Readonly<MaterialJSON>;
4
4
  /** Capture the authored value before mutable Three.js instances can change. */
@@ -1 +1 @@
1
- {"version":3,"file":"material.d.ts","sourceRoot":"","sources":["../../src/library/material.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,KAAK,YAAY,EAIlB,MAAM,YAAY,CAAC;AAGpB,mEAAmE;AACnE,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;AAEpE,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,QAAQ,GAAG,MAAM,GACvB,qBAAqB,CA8HvB;AAsED,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,qBAAqB;;;;eAajE"}
1
+ {"version":3,"file":"material.d.ts","sourceRoot":"","sources":["../../src/library/material.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,KAAK,YAAY,EAIlB,MAAM,OAAO,CAAC;AAGf,mEAAmE;AACnE,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;AAEpE,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,QAAQ,GAAG,MAAM,GACvB,qBAAqB,CA6HvB;AAsED,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,qBAAqB;;;;eAajE"}
@@ -0,0 +1,4 @@
1
+ import type { OpenCascadeInstance } from '@code3d/opencascade';
2
+ /** Install the backend and its memory accounting for Node and hosted runtimes. */
3
+ export declare function installOpenCascade(openCascade: OpenCascadeInstance): void;
4
+ //# sourceMappingURL=open-cascade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-cascade.d.ts","sourceRoot":"","sources":["../../src/library/open-cascade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AAO7D,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,mBAAmB,GAAG,IAAI,CAIzE"}
@@ -10,8 +10,9 @@ export type Replicad = Omit<typeof replicadModule, 'getOC' | 'setOC'>;
10
10
  export declare const replicad: Replicad;
11
11
  /**
12
12
  * Defines a synchronous model constructor with the builder's parameters.
13
- * The builder runs on every call and transfers ownership of its returned solid
14
- * to code3d. Intermediate shapes remain the builder's responsibility.
13
+ * Reuses deterministic geometry by arguments; pass changing captured state as
14
+ * explicit parameters. Each invocation creates a fresh model. The builder
15
+ * transfers its returned solid to code3d and owns its intermediate shapes.
15
16
  */
16
17
  export declare function definePrimitive<Builder extends (...arguments_: never[]) => Shape3D>(build: Builder): (...arguments_: Parameters<Builder>) => SolidModel;
17
18
  //# sourceMappingURL=replicad.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"replicad.d.ts","sourceRoot":"","sources":["../../src/library/replicad.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,UAAU,CAAC;AAG3C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAEtC,mBAAmB,UAAU,CAAC;AAE9B,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,cAAc,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC;AAStE;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,QAMrB,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,OAAO,SAAS,CAAC,GAAG,UAAU,EAAE,KAAK,EAAE,KAAK,OAAO,EACnD,KAAK,EAAE,OAAO,GAAG,CAAC,GAAG,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,KAAK,UAAU,CAGpE"}
1
+ {"version":3,"file":"replicad.d.ts","sourceRoot":"","sources":["../../src/library/replicad.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,UAAU,CAAC;AAG3C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAEtC,mBAAmB,UAAU,CAAC;AAE9B,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,cAAc,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC;AAStE;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,QAMrB,CAAC;AAEH;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,OAAO,SAAS,CAAC,GAAG,UAAU,EAAE,KAAK,EAAE,KAAK,OAAO,EACnD,KAAK,EAAE,OAAO,GAAG,CAAC,GAAG,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,KAAK,UAAU,CAEpE"}
@@ -1,24 +1,10 @@
1
- import * as replicadModule from 'replicad';
2
- import { modelFromReplicadSolid } from './runtime.js';
3
- import { castOwnedShape } from './kernel-shapes.js';
4
- const { getOC: _getOC, setOC: _setOC, deserializeShape: _deserializeShape, ...authorReplicad } = replicadModule;
5
- /**
6
- * The Replicad API bound to the OpenCascade runtime owned by code3d. Kernel
7
- * installation remains a tooling responsibility and is intentionally omitted.
8
- */
9
- export const replicad = Object.freeze({
10
- ...authorReplicad,
11
- deserializeShape(data) {
12
- // The native reader owns a raw shape; casting acquires another handle.
13
- return castOwnedShape(replicadModule.getOC().BRepToolsWrapper.Read(data));
14
- },
15
- });
16
- /**
17
- * Defines a synchronous model constructor with the builder's parameters.
18
- * The builder runs on every call and transfers ownership of its returned solid
19
- * to code3d. Intermediate shapes remain the builder's responsibility.
20
- */
21
- export function definePrimitive(build) {
22
- return (...arguments_) => modelFromReplicadSolid(build(...arguments_));
23
- }
24
- //# sourceMappingURL=replicad.js.map
1
+ import {
2
+ definePrimitive,
3
+ replicad
4
+ } from "../chunks/chunk-5E6VXJU2.js";
5
+ import "../chunks/chunk-F53RTQPT.js";
6
+ export {
7
+ definePrimitive,
8
+ replicad
9
+ };
10
+ //# sourceMappingURL=replicad.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"replicad.js","sourceRoot":"","sources":["../../src/library/replicad.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAC,sBAAsB,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAQlD,MAAM,EACJ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,iBAAiB,EACnC,GAAG,cAAc,EAClB,GAAG,cAAc,CAAC;AAEnB;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAa,MAAM,CAAC,MAAM,CAAC;IAC9C,GAAG,cAAc;IACjB,gBAAgB,CAAC,IAAY;QAC3B,uEAAuE;QACvE,OAAO,cAAc,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5E,CAAC;CACF,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAE7B,KAAc;IACd,OAAO,CAAC,GAAG,UAA+B,EAAE,EAAE,CAC5C,sBAAsB,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;AACjD,CAAC"}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"retained-memory.d.ts","sourceRoot":"","sources":["../../src/library/retained-memory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAiB5D"}
1
+ {"version":3,"file":"retained-memory.d.ts","sourceRoot":"","sources":["../../src/library/retained-memory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAsB5D"}