@mark1russell7/packing 0.2.0 → 0.2.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.
package/build/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { DEFAULT_TOLERANCE, Direction, Direction as Direction$1, EPS, Item, Item as Item$1, LayoutContainer, LayoutContainer as LayoutContainer$1, LayoutEdge, LayoutEdge as LayoutEdge$1, LayoutGenerator, LayoutInput, LayoutInput as LayoutInput$1, Margin, MeasureSpec as MeasureSpec$1, Obstacle, PackHard, PackHard as PackHard$1, PackInput, PackOutput, Placement, Port, RECORD_EPS, Region, Side, Sides, Sides as Sides$1, StageTrace, Tolerance, checkInput, turnPoint, turnPort, turnRegion } from "@mark1russell7/layout-contract";
1
+ import { ContainerTest, ContainerTest as ContainerTest$1, DEFAULT_TOLERANCE, Direction, Direction as Direction$1, EPS, Item, Item as Item$1, LayoutContainer, LayoutContainer as LayoutContainer$1, LayoutEdge, LayoutEdge as LayoutEdge$1, LayoutGenerator, LayoutInput, LayoutInput as LayoutInput$1, Margin, MeasureSpec as MeasureSpec$1, Obstacle, PackHard, PackHard as PackHard$1, PackInput, PackOutput, Placement, Port, RECORD_EPS, Region, Side, Sides, Sides as Sides$1, StageTrace, Tolerance, checkInput, turnPoint, turnPort, turnRegion } from "@mark1russell7/layout-contract";
2
2
  /** A mutable two-dimensional vector. */
3
3
  export declare class Vector {
4
4
  #private;
@@ -80,10 +80,77 @@ type SortOrder = "height-desc" | "height-asc" | "width-desc" | "area-desc" | "in
80
80
  export declare const SORT_ORDERS: readonly SortOrder[];
81
81
  /** This function gives the comparator of a sort order. The sort is stable, so `input` keeps the order. */
82
82
  export declare function compareRects(order: SortOrder): <T>(a: Rect<T>, b: Rect<T>) => number;
83
+ /** This function gives the margin of an item on each side. A number is the same margin on each side. */
84
+ export declare function marginOf(item: Pick<Item$1, "margin">): Sides$1;
85
+ /**
86
+ * This function gives an item after a turn of 90 degrees clockwise, with the y axis down (decision 1 of
87
+ * `docs/PACKER.md`). The width and the height change places. The top-left corner, the id and the other fields stay.
88
+ * The ports, the shape and the margin turn with the item. The function does not change its argument.
89
+ * It is `turnBox` of the contract.
90
+ */
91
+ export declare function turnItem(item: Item$1): Item$1;
92
+ /** A free interval on one axis, from `start` to `end`. A box fits when it starts at `start` or later and ends at `end` or earlier. */
93
+ interface FreeSpan {
94
+ readonly start: number;
95
+ readonly end: number;
96
+ }
97
+ /** A rectangle of the frame: its top-left corner and its size. */
98
+ interface SpaceRect {
99
+ readonly x: number;
100
+ readonly y: number;
101
+ readonly w: number;
102
+ readonly h: number;
103
+ }
104
+ /**
105
+ * The free space of one input, in the coordinates of the frame of the adapters. A rectangle of the frame is an item with its
106
+ * margin, grown by half the gap on each side. Each method takes such a rectangle.
107
+ *
108
+ * - The outline of a container with a fixed size is exact. A free side uses the bounding box of the shape, and the holes stay.
109
+ * - The inset of the container counts as in `checkHard`: the item with its margin, grown by the inset, stays in the outline.
110
+ * - A rectangle obstacle and a locked item are holes with the exact rectangles of the frame.
111
+ * - Another obstacle blocks its range over the query, grown by half the gap on each axis.
112
+ */
113
+ interface FreeSpace {
114
+ /** The width of the area of the frame. A free side has the width `Infinity`. */
115
+ readonly w: number;
116
+ /** The height of the area of the frame. A free side has the height `Infinity`. */
117
+ readonly h: number;
118
+ /**
119
+ * The value `true` tells that the container is a plain rectangle and that each obstacle is a rectangle. Then `band` does
120
+ * not test y, and `column` does not test x, because each strategy tests the fixed side itself. This is the fast path.
121
+ */
122
+ readonly plain: boolean;
123
+ /** This method gives the free x-spans, from left to right, for a rectangle from `y0` to `y1`. */
124
+ band(y0: number, y1: number): FreeSpan[];
125
+ /**
126
+ * This method gives the first free y-span for a rectangle from `x0` to `x1` that ends after `from`. The span starts
127
+ * at `from` or later. The method gives `undefined` when no such span is free.
128
+ */
129
+ column(x0: number, x1: number, from?: number): FreeSpan | undefined;
130
+ /** This method tells if a rectangle is in the free space. */
131
+ fits(rect: SpaceRect): boolean;
132
+ /** This method gives the first x from `x` where a rectangle of width `w` fits from `y0` to `y1`, or `Infinity`. */
133
+ fitX(x: number, w: number, y0: number, y1: number): number;
134
+ /**
135
+ * This method gives the next top edge after `y0` where the free spans of a rectangle of the height `y1 - y0` change, or
136
+ * `Infinity`. A row that has no place for a rectangle of width `w` steps down to this edge.
137
+ */
138
+ nextY(y0: number, y1: number, w: number): number;
139
+ }
140
+ /**
141
+ * This function gives the free space of an input, in the coordinates of the frame of the adapters. The origin of the
142
+ * frame is the corner of the container, moved in by the inset and out by half the gap. `FreeSpace` tells the methods.
143
+ */
144
+ export declare function freeSpace(input: PackInput): FreeSpace;
83
145
  /** The options of `pack` and `packRows` */
84
146
  interface PackOptions {
85
147
  /** The order of the rectangles before the packing. The default is `height-desc`. */
86
148
  sortOrder?: SortOrder;
149
+ /**
150
+ * The free space of the container: `freeSpace` of the input. With a space that is not plain, each strategy packs into
151
+ * the outline of the container and around its holes. The rows of `packRows` also go around the locked rectangles.
152
+ */
153
+ space?: FreeSpace;
87
154
  }
88
155
  /** The options of `pack` */
89
156
  interface PackLayoutOptions extends PackOptions {
@@ -97,6 +164,9 @@ interface PackLayoutOptions extends PackOptions {
97
164
  * This function packs rectangles into an outer rectangle of a given width with a guillotine row packing. It does
98
165
  * not change the width. Without `fixedSize`, the height grows until all rectangles fit. A `locked` rectangle keeps
99
166
  * its position, but the rows do not go around it. `pack` sets the width first and then uses this function.
167
+ *
168
+ * With `options.space`, the rows go around the locked rectangles and the holes of the space, inside its outline. A space
169
+ * that is plain, with no locked rectangle, gives the rows of 0.1.
100
170
  */
101
171
  export declare function packRows<T>(rects: Rect<T>[], outer: Rect<T>, options?: PackOptions): Rect<T>;
102
172
  /**
@@ -114,11 +184,24 @@ export declare function pack<T>(rects: Rect<T>[], outer?: Rect<T>, options?: Pac
114
184
  * This function finds the lowest window of width `rw` on a skyline. For each `x` in `[0, width - rw]`, the height
115
185
  * of the window is the largest value of `skyline[x, x + rw)`. The first `x` with the smallest height wins. A
116
186
  * monotonic deque makes the search O(width) for one rectangle.
187
+ *
188
+ * With `limit`, a window is valid only when its height plus `rh` is not more than the smallest value of
189
+ * `limit[x, x + rw)`. A second deque keeps that smallest value. No valid window gives the height `Infinity`.
117
190
  */
118
- export declare function lowestWindow(skyline: ArrayLike<number>, width: number, rw: number): {
191
+ export declare function lowestWindow(skyline: ArrayLike<number>, width: number, rw: number, limit?: ArrayLike<number>, rh?: number): {
119
192
  x: number;
120
193
  y: number;
121
194
  };
195
+ /** The options of `packSkyline` */
196
+ interface SkylineOptions {
197
+ /** The order of the rectangles before the packing. The default is `height-desc`. */
198
+ sortOrder?: SortOrder;
199
+ /**
200
+ * The free space of the container: `freeSpace` of the input. Without it, or when it is plain, the skyline uses only the
201
+ * outer rectangle and the locked rectangles.
202
+ */
203
+ space?: FreeSpace;
204
+ }
122
205
  /**
123
206
  * This function packs rectangles into an outer rectangle with a skyline. It puts each rectangle in the lowest place
124
207
  * where it fits, and it does not change the width of the outer rectangle.
@@ -130,14 +213,19 @@ export declare function lowestWindow(skyline: ArrayLike<number>, width: number,
130
213
  * - Without `fixedSize`, the height of the outer rectangle grows to the content. With `fixedSize`, a rectangle that
131
214
  * does not fit is not packed: its `wasPacked` stays `false`.
132
215
  * - The default sort order is `height-desc`. The order of the array of the caller stays.
216
+ * - With a space that is not plain, each cell gets its start and its limit from `column` of the space. The space holds
217
+ * the obstacles and the locked items, thus the locked rectangles only keep their positions.
133
218
  */
134
- export declare function packSkyline<T>(rects: Rect<T>[], outer: Rect<T>, options?: {
135
- sortOrder?: SortOrder;
136
- }): Rect<T>;
219
+ export declare function packSkyline<T>(rects: Rect<T>[], outer: Rect<T>, options?: SkylineOptions): Rect<T>;
137
220
  /** The options of `packShelf` */
138
221
  interface ShelfOptions {
139
222
  /** The order of the rectangles before the packing. The default is `height-desc`. */
140
223
  sortOrder?: SortOrder;
224
+ /**
225
+ * The free space of the container: `freeSpace` of the input. Without it, or when it is plain, the packer uses only the
226
+ * outer rectangle and the locked rectangles.
227
+ */
228
+ space?: FreeSpace;
141
229
  }
142
230
  /**
143
231
  * This function packs rectangles into shelves: rows that it fills left to right in the sort order, and does not fill
@@ -150,6 +238,7 @@ interface ShelfOptions {
150
238
  * - A rectangle wider than the outer rectangle goes on its own row, at the left edge, and overflows.
151
239
  * - It does not change the width. Without `fixedSize`, the height grows to the content. With `fixedSize`, a
152
240
  * rectangle that does not fit is not packed: its `wasPacked` stays `false`.
241
+ * - With a space that is not plain, `packRowsInSpace` packs the rows into the outline of the space and around its holes.
153
242
  */
154
243
  export declare function packShelf<T>(rects: Rect<T>[], outer: Rect<T>, options?: ShelfOptions): Rect<T>;
155
244
  /** The options of `packFree` */
@@ -259,19 +348,10 @@ interface MetricsOptions {
259
348
  * ```
260
349
  */
261
350
  export declare function packingMetrics(rects: readonly Rect[], options?: MetricsOptions): PackingMetrics;
262
- /** This function gives the margin of an item on each side. A number is the same margin on each side. */
263
- export declare function marginOf(item: Pick<Item$1, "margin">): Sides$1;
264
- /**
265
- * This function gives an item after a turn of 90 degrees clockwise, with the y axis down (decision 1 of
266
- * `docs/PACKER.md`). The width and the height change places. The top-left corner, the id and the other fields stay.
267
- * The ports, the shape and the margin turn with the item. The function does not change its argument.
268
- * It is `turnBox` of the contract.
269
- */
270
- export declare function turnItem(item: Item$1): Item$1;
271
351
  /** The family of a measure. Each family has a section in `docs/MEASURES.md`. */
272
352
  type MeasureFamily = "density" | "aspect" | "order" | "raggedness" | "overflow" | "stability" | "determinism" | "speed";
273
353
  /** The id of a measure of the packer. The ids are those of `docs/FORMAT.md`, and `highways` uses the same ids. */
274
- type MeasureId = "pack.area" | "pack.fill" | "pack.whitespace" | "pack.aspect" | "pack.aspectError" | "pack.order.inversions" | "pack.order.breaks" | "pack.raggedness" | "pack.overflow" | "pack.stability.moved" | "pack.stability.mean" | "pack.stability.q95" | "pack.deterministic" | "pack.search.widths" | "pack.search.ms";
354
+ type MeasureId = "pack.area" | "pack.fill" | "pack.whitespace" | "pack.aspect" | "pack.aspectError" | "pack.order.inversions" | "pack.order.breaks" | "pack.raggedness" | "pack.overflow" | "pack.overflow.rate" | "pack.overflow.area" | "pack.overflow.forced" | "pack.overflow.forcedArea" | "pack.overflow.excess" | "pack.stability.moved" | "pack.stability.mean" | "pack.stability.q95" | "pack.deterministic" | "pack.search.widths" | "pack.search.ms";
275
355
  /**
276
356
  * The facts of one measure: its family, its unit, its direction and its range.
277
357
  * It is `MeasureSpec` of the contract for a packer measure id, with a family.
@@ -304,6 +384,11 @@ interface LayoutMeasures {
304
384
  "pack.order.breaks": number;
305
385
  "pack.raggedness": number;
306
386
  "pack.overflow": number;
387
+ "pack.overflow.rate": number;
388
+ "pack.overflow.area": number;
389
+ "pack.overflow.forced": number;
390
+ "pack.overflow.forcedArea": number;
391
+ "pack.overflow.excess": number;
307
392
  "pack.search.widths": number;
308
393
  "pack.search.ms": number;
309
394
  }
@@ -323,7 +408,12 @@ interface MeasureOptions {
323
408
  }
324
409
  /**
325
410
  * The facts of each measure, by id. `docs/MEASURES.md` gives the full definitions. This record is the source of the floor
326
- * and the tolerance of each guard of the packer.
411
+ * and the tolerance of each guard of the packer, and of the minimum effect of each measure.
412
+ *
413
+ * - A count and a share of counts have the minimum effect 0. Thus each change of a count is an effect.
414
+ * - A share of an area from 0 to 1 has 0.005. A guard has its tolerance.
415
+ * - An area and a ratio of lengths have `{ rel: 0.01 }`: 1% of the larger value.
416
+ * - The time has no minimum effect, because the times of CI change each time.
327
417
  */
328
418
  export declare const MEASURE_SPECS: Readonly<Record<MeasureId, MeasureSpec>>;
329
419
  /**
@@ -333,6 +423,8 @@ export declare const MEASURE_SPECS: Readonly<Record<MeasureId, MeasureSpec>>;
333
423
  * - The boxes are the placed items with a width and a height above 0. The hull is the smallest rectangle around them.
334
424
  * - An empty layout gives the area 0, the aspect 1 and the aspect error 0. Its fill is 0 and its whitespace is 1.
335
425
  * - The time `pack.search.ms` comes from the trace. It is not part of the determinism rule.
426
+ * - The overflow measures count each id once. `pack.overflow.forced` is the lower bound of `overflowBound`.
427
+ * - `pack.overflow.excess` is the overflow less the forced overflow. A container with no fixed side gives 0 for both.
336
428
  *
337
429
  * @example
338
430
  * ```ts
@@ -501,18 +593,19 @@ interface PushStrategyOptions {
501
593
  maxShovesPerItem: number;
502
594
  }
503
595
  /**
504
- * The strategy `rows` uses `packRows`: a guillotine row packing with a recursive gap fill. It supports no obstacle and
505
- * no locked item, because `packRows` does not go around them. Turnable items, groups and shapes throw `UnsupportedCell`.
596
+ * The strategy `rows` uses `packRows`: a guillotine row packing with a recursive gap fill. With obstacles, locked items or a
597
+ * container shape, the rows go around the holes of the free space and lose the gap fill. Turnable items, groups and item
598
+ * shapes throw `UnsupportedCell`.
506
599
  */
507
600
  export declare const rows: Strategy<LayoutStrategyOptions>;
508
601
  /**
509
602
  * The strategy `skyline` uses `packSkyline`: each item goes to the lowest place where it fits. It packs around the
510
- * locked items and the fixed obstacles. Turnable items, groups and shapes throw `UnsupportedCell`.
603
+ * locked items and the fixed obstacles, in each container shape. Turnable items, groups and item shapes throw `UnsupportedCell`.
511
604
  */
512
605
  export declare const skyline: Strategy<LayoutStrategyOptions>;
513
606
  /**
514
607
  * The strategy `shelf` uses `packShelf`: rows filled left to right, around the locked items and the fixed obstacles.
515
- * With the sort order `input`, the rows keep the rank order. Turnable items, groups and shapes throw `UnsupportedCell`.
608
+ * With the sort order `input`, the rows keep the rank order. Turnable items, groups and item shapes throw `UnsupportedCell`.
516
609
  */
517
610
  export declare const shelf: Strategy<LayoutStrategyOptions>;
518
611
  /**
@@ -563,8 +656,12 @@ export declare function packWith(id: string, input: PackInput, options?: unknown
563
656
  * The test of an obstacle is exact: a circle, an ellipse and a polygon with holes count only their insides, as in `packHard`.
564
657
  * The rules read a shape of the container or of an item as its bounding box (decision 5). The bounding box of an item
565
658
  * shape is relative to the position of the item. The result has no tolerance in it.
659
+ *
660
+ * With `options.exactContainer`, a shaped container with the size `fixed` also uses its true outline for `in-container`.
661
+ * A box then counts when `rectInRegion` of the contract tells that it is not in the shape, as in `packHard`.
662
+ * For that test, the box grows by the inset and becomes smaller by `tolerance.overlap` on each side. The default is `false`.
566
663
  */
567
- export declare function checkHard(input: PackInput, output: PackOutput, tolerance?: Pick<Tolerance, "overlap">): PackHard$1;
664
+ export declare function checkHard(input: PackInput, output: PackOutput, tolerance?: Pick<Tolerance, "overlap">, options?: ContainerTest$1): PackHard$1;
568
665
  /** The parameters of a generator: a name and a string or a number for each parameter. */
569
666
  type GeneratorParams = Record<string, string | number>;
570
667
  /**
@@ -737,5 +834,5 @@ interface Corpus {
737
834
  * `RangeError` for an unknown generator, a different version or 2 inputs with the same id.
738
835
  */
739
836
  export declare function corpus(name: string, specs: readonly CorpusSpec[]): Corpus;
740
- export { type Cell, type ChangeMeasures, type Corpus, type CorpusCell, type CorpusEntry, type CorpusGenerator, type CorpusManifest, type CorpusSpec, type CountScale, DEFAULT_TOLERANCE, type Dimension, type DimensionValue, type Direction, EPS, type EdgeCase, type EdgeCaseParams, type FreeWidthOptions, type FreeWidthResult, type FreeWidthTry, type GeneratedInput, type GeneratorParams, type GeneratorStamp, type Item, type LayoutContainer, type LayoutEdge, type LayoutInput, type LayoutMeasures, type LayoutStrategyOptions, type Margin, type MeasureFamily, type MeasureId, type MeasureOptions, type MeasureSpec, type MetricsOptions, type Obstacle, type ObstacleLayout, type PackContext, type PackHard, type PackInput, type PackLayoutOptions, type PackOptions, type PackOutput, type PackingMetrics, type Placement, type Port, type PushOptions, type PushStrategyOptions, RECORD_EPS, type RectGridParams, type RectScatteredParams, type Region, type ShelfOptions, type Side, type Sides, type SizeDistribution, type SizeSearch, type SortOrder, type StageTrace, type Strategy, type Supports, type Tolerance, type UiParams, checkInput, turnPoint, turnPort, turnRegion };
837
+ export { type Cell, type ChangeMeasures, type ContainerTest, type Corpus, type CorpusCell, type CorpusEntry, type CorpusGenerator, type CorpusManifest, type CorpusSpec, type CountScale, DEFAULT_TOLERANCE, type Dimension, type DimensionValue, type Direction, EPS, type EdgeCase, type EdgeCaseParams, type FreeSpace, type FreeSpan, type FreeWidthOptions, type FreeWidthResult, type FreeWidthTry, type GeneratedInput, type GeneratorParams, type GeneratorStamp, type Item, type LayoutContainer, type LayoutEdge, type LayoutInput, type LayoutMeasures, type LayoutStrategyOptions, type Margin, type MeasureFamily, type MeasureId, type MeasureOptions, type MeasureSpec, type MetricsOptions, type Obstacle, type ObstacleLayout, type PackContext, type PackHard, type PackInput, type PackLayoutOptions, type PackOptions, type PackOutput, type PackingMetrics, type Placement, type Port, type PushOptions, type PushStrategyOptions, RECORD_EPS, type RectGridParams, type RectScatteredParams, type Region, type ShelfOptions, type Side, type Sides, type SizeDistribution, type SizeSearch, type SkylineOptions, type SortOrder, type SpaceRect, type StageTrace, type Strategy, type Supports, type Tolerance, type UiParams, checkInput, turnPoint, turnPort, turnRegion };
741
838
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["Item","Sides","ContractMeasureSpec","Direction","PackHard","LayoutContainer","LayoutEdge","LayoutInput"],"sources":["../src/vector.ts","../src/rect.ts","../src/order.ts","../src/pack.ts","../src/skyline.ts","../src/shelf.ts","../src/free.ts","../src/push.ts","../src/metrics.ts","../src/contract.ts","../src/measures.ts","../src/strategy.ts","../src/adapters.ts","../src/convert.ts","../src/registry.ts","../src/check.ts","../src/layout-input.ts","../src/generators.ts","../src/corpus.ts"],"mappings":";;qBACa;;EAIX,YAAY,YAAO;;MAMf;MACA,EAAE;;MAEF;MACA,EAAE;;EAGN,IAAI,WAAW;;EAMf,MAAM,GAAG;;EAMT,IAAI,OAAO,SAAS;;EAKpB;;EAKA,SAAS;;EAKT,MAAM,KAAK,QAAQ,KAAK,SAAS;;SAQ1B,GAAG,iBAAiB;;SAKpB,IAAI,SAAS,WAAW;;SASxB,IAAI,SAAS,WAAW;;aASpB,YAAY;;;qBCxEZ,KAAK;;;EAKhB,KAAK;;EAEL;;EAEA;;EAEA;;;;;EAKA;;MAGI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CnFlF,gBAAgB,UAAU,kBAAkB;;WAElD;;WAEA;;WAEA;;WAEA,UAAU,SAAS;;WAEnB,oBAAoB,WAAW,cAAc,EAAE;;EAExD,aAAa,SAAS,QAAQ,KAAK;;EAEnC,KAAK,SAAS,QAAQ,KAAK;;EAE3B,SAAS,cAAc,SAAS,QAAQ,IAAI,eAAe;;;KAgJjD;EAAwB;;;qBAGvB,eAAe,gBAAgB;;KA8QhC;EACV,eAAe;EACf,gBAAgB;EAChB,WAAW;EACX,OAAO;EACP;;;;;;qBAOW,UAAU,gBAAgB;;KA2B3B;EACV,eAAe;EACf;;;qBA0BW,SAAS,gBAAgB;;qBAWzB,WAAW,gBAAgB;;qBAS3B,OAAO,gBAAgB;;qBAUvB,WAAW,gBAAgB;;KAY5B;;KAGA;EAAmB,MAAM;EAAU;;;;;;;;;;;qBAoBlC,WAAW,gBAAgB;;qBAwF3B,qBAAqB;;wBAGlB,UAAU,eAAe;;UChqBxB;;EAEf;;EAEA;;EAEA,SAAS;EACT;;;UAIe;EACf;EACA;EACA,MAAM;;;UAIS;EACf;;EAEA;;EAEA;IAAS;IAAmB;IAAiB,QAAQ;IAAiB;;EACtE,QAAQ;;;UAIO;EACf,UAAU;EACV,QAAQ;;;;;;wBAOM,OAAO,cAAc,gBAAgB,eAAe"}
1
+ {"version":3,"file":"index.d.ts","names":["Item","Sides","ContractMeasureSpec","Direction","ContainerTest","PackHard","LayoutContainer","LayoutEdge","LayoutInput"],"sources":["../src/vector.ts","../src/rect.ts","../src/order.ts","../src/contract.ts","../src/space.ts","../src/pack.ts","../src/skyline.ts","../src/shelf.ts","../src/free.ts","../src/push.ts","../src/metrics.ts","../src/measures.ts","../src/strategy.ts","../src/adapters.ts","../src/convert.ts","../src/registry.ts","../src/check.ts","../src/layout-input.ts","../src/generators.ts","../src/corpus.ts"],"mappings":";;qBACa;;EAIX,YAAY,YAAO;;MAMf;MACA,EAAE;;MAEF;MACA,EAAE;;EAGN,IAAI,WAAW;;EAMf,MAA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