@mapka/sprites-generate 0.4.1

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/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ Internet Systems Consortium license
2
+ ===================================
3
+
4
+ Copyright (c) 2016, Mapbox
5
+ Copyright (c) 2025, Mapka
6
+
7
+ Permission to use, copy, modify, and/or distribute this software for any purpose
8
+ with or without fee is hereby granted, provided that the above copyright notice
9
+ and this permission notice appear in all copies.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
13
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
15
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
17
+ THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # @mapka/sprites-generate
2
+
3
+ This is fork of [spritezero](https://github.com/mapbox/spritezero) library. This is JS based solution using [mapnik](https://github.com/mapnik/node-mapnik) library for image generation.
4
+
5
+ Alternatively you can use [spreet](https://github.com/flother/spreet) library which is written in Rust.
6
+
7
+ ## Usage
8
+
9
+ ```ts
10
+ import { readFileSync, writeFileSync } from 'node:fs';
11
+ import { generateLayout } from '@mapka/sprites-generate';
12
+
13
+ const layout = await generateLayout({
14
+ imgs: [
15
+ { svg: readFileSync('aerialway-24.svg'), id: 'aerialway-24' },
16
+ { svg: readFileSync('aerialway-24-copy.svg'), id: 'aerialway-24-copy' },
17
+ { svg: readFileSync('aerialway-24-alternate.svg'), id: 'aerialway-24-alternate' },
18
+ ],
19
+ pixelRatio: 2,
20
+ format: false,
21
+ });
22
+
23
+ const spriteImage = await generateImage(layout);
24
+ writeFileSync('sprite.png', spriteImage);
25
+ ```
@@ -0,0 +1 @@
1
+ {"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/typescript/lib/lib.es2024.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/typescript/lib/lib.esnext.float16.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/typescript/lib/lib.es2024.full.d.ts","../src/declarations.d.ts","../../shelf-pack/lib/index.d.ts","../src/metadata.js","../src/validate.ts","../src/types.ts","../src/generate.ts","../src/image.ts","../src/index.ts","../../../node_modules/@vitest/pretty-format/dist/index.d.ts","../../../node_modules/@vitest/utils/dist/types.d.ts","../../../node_modules/@vitest/utils/dist/helpers.d.ts","../../../node_modules/tinyrainbow/dist/index-8b61d5bc.d.ts","../../../node_modules/tinyrainbow/dist/node.d.ts","../../../node_modules/@vitest/utils/dist/index.d.ts","../../../node_modules/@vitest/runner/dist/tasks.d-CkscK4of.d.ts","../../../node_modules/@vitest/utils/dist/types.d-BCElaP-c.d.ts","../../../node_modules/@vitest/utils/dist/diff.d.ts","../../../node_modules/@vitest/runner/dist/types.d.ts","../../../node_modules/@vitest/utils/dist/error.d.ts","../../../node_modules/@vitest/runner/dist/index.d.ts","../../../node_modules/vitest/optional-types.d.ts","../../../node_modules/vitest/dist/chunks/environment.d.cL3nLXbE.d.ts","../../../node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/utility.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client-stats.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/h2c-client.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-call-history.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/undici-types/retry-handler.d.ts","../../../node_modules/undici-types/retry-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cache-interceptor.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/util.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/eventsource.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/sea.d.ts","../../../node_modules/@types/node/sqlite.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/vite/types/hmrPayload.d.ts","../../../node_modules/vite/dist/node/moduleRunnerTransport-BWUZBVLX.d.ts","../../../node_modules/vite/types/customEvent.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/rollup/dist/rollup.d.ts","../../../node_modules/rollup/dist/parseAst.d.ts","../../../node_modules/vite/types/hot.d.ts","../../../node_modules/vite/dist/node/module-runner.d.ts","../../../node_modules/esbuild/lib/main.d.ts","../../../node_modules/vite/types/internal/terserOptions.d.ts","../../../node_modules/source-map-js/source-map.d.ts","../../../node_modules/postcss/lib/previous-map.d.ts","../../../node_modules/postcss/lib/input.d.ts","../../../node_modules/postcss/lib/css-syntax-error.d.ts","../../../node_modules/postcss/lib/declaration.d.ts","../../../node_modules/postcss/lib/root.d.ts","../../../node_modules/postcss/lib/warning.d.ts","../../../node_modules/postcss/lib/lazy-result.d.ts","../../../node_modules/postcss/lib/no-work-result.d.ts","../../../node_modules/postcss/lib/processor.d.ts","../../../node_modules/postcss/lib/result.d.ts","../../../node_modules/postcss/lib/document.d.ts","../../../node_modules/postcss/lib/rule.d.ts","../../../node_modules/postcss/lib/node.d.ts","../../../node_modules/postcss/lib/comment.d.ts","../../../node_modules/postcss/lib/container.d.ts","../../../node_modules/postcss/lib/at-rule.d.ts","../../../node_modules/postcss/lib/list.d.ts","../../../node_modules/postcss/lib/postcss.d.ts","../../../node_modules/postcss/lib/postcss.d.mts","../../../node_modules/vite/types/internal/lightningcssOptions.d.ts","../../../node_modules/vite/types/internal/cssPreprocessorOptions.d.ts","../../../node_modules/vite/types/importGlob.d.ts","../../../node_modules/vite/types/metadata.d.ts","../../../node_modules/vite/dist/node/index.d.ts","../../../node_modules/@vitest/mocker/dist/registry.d-D765pazg.d.ts","../../../node_modules/@vitest/mocker/dist/types.d-D_aRZRdy.d.ts","../../../node_modules/@vitest/mocker/dist/index.d.ts","../../../node_modules/@vitest/utils/dist/source-map.d.ts","../../../node_modules/vite-node/dist/trace-mapping.d-DLVdEqOp.d.ts","../../../node_modules/vite-node/dist/index.d-DGmxD2U7.d.ts","../../../node_modules/vite-node/dist/index.d.ts","../../../node_modules/@vitest/snapshot/dist/environment.d-DHdQ1Csl.d.ts","../../../node_modules/@vitest/snapshot/dist/rawSnapshot.d-lFsMJFUd.d.ts","../../../node_modules/@vitest/snapshot/dist/index.d.ts","../../../node_modules/@vitest/snapshot/dist/environment.d.ts","../../../node_modules/vitest/dist/chunks/config.d.D2ROskhv.d.ts","../../../node_modules/vitest/dist/chunks/worker.d.1GmBbd7G.d.ts","../../../node_modules/@types/deep-eql/index.d.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/@vitest/runner/dist/utils.d.ts","../../../node_modules/tinybench/dist/index.d.ts","../../../node_modules/vitest/dist/chunks/benchmark.d.BwvBVTda.d.ts","../../../node_modules/vite-node/dist/client.d.ts","../../../node_modules/vitest/dist/chunks/coverage.d.S9RMNXIe.d.ts","../../../node_modules/@vitest/snapshot/dist/manager.d.ts","../../../node_modules/vitest/dist/chunks/reporters.d.BFLkQcL6.d.ts","../../../node_modules/vitest/dist/chunks/worker.d.CKwWzBSj.d.ts","../../../node_modules/@vitest/spy/dist/index.d.ts","../../../node_modules/@vitest/expect/dist/index.d.ts","../../../node_modules/vitest/dist/chunks/global.d.MAmajcmJ.d.ts","../../../node_modules/vitest/dist/chunks/vite.d.CMLlLIFP.d.ts","../../../node_modules/vitest/dist/chunks/mocker.d.BE_2ls6u.d.ts","../../../node_modules/vitest/dist/chunks/suite.d.FvehnV49.d.ts","../../../node_modules/expect-type/dist/utils.d.ts","../../../node_modules/expect-type/dist/overloads.d.ts","../../../node_modules/expect-type/dist/branding.d.ts","../../../node_modules/expect-type/dist/messages.d.ts","../../../node_modules/expect-type/dist/index.d.ts","../../../node_modules/vitest/dist/index.d.ts","../src/__bench__/generate.bench.ts","../src/__tests__/generate.test.ts","../src/__tests__/metadata.test.ts","../../../node_modules/@types/conventional-commits-parser/index.d.ts","../../../node_modules/minimatch/dist/commonjs/ast.d.ts","../../../node_modules/minimatch/dist/commonjs/escape.d.ts","../../../node_modules/minimatch/dist/commonjs/unescape.d.ts","../../../node_modules/minimatch/dist/commonjs/index.d.ts","../../../node_modules/@types/glob/index.d.ts","../../../node_modules/@types/mapbox__spritezero/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/parse-path/index.d.ts"],"fileIdsList":[[102,148,247],[102,148,180,198],[102,148],[102,148,160,161,198,276],[102,145,148],[102,147,148],[148],[102,148,153,183],[102,148,149,154,160,161,168,180,191],[102,148,149,150,160,168],[102,148,151,192],[102,148,152,153,161,169],[102,148,153,180,188],[102,148,154,156,160,168],[102,147,148,155],[102,148,156,157],[102,148,158,160],[102,147,148,160],[102,148,160,161,162,180,191],[102,148,160,161,162,175,180,183],[102,143,148],[102,143,148,156,160,163,168,180,191],[102,148,160,161,163,164,168,180,188,191],[102,148,163,165,180,188,191],[100,101,102,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197],[102,148,160,166],[102,148,167,191],[102,148,156,160,168,180],[102,148,169],[102,148,170],[102,147,148,171],[102,145,146,147,148,149,150,151,152,153,154,155,156,157,158,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197],[102,148,173],[102,148,174],[102,148,160,175,176],[102,148,175,177,192,194],[102,148,160,180,181,183],[102,148,182,183],[102,148,180,181],[102,148,183],[102,148,184],[102,145,148,180,185],[102,148,160,186,187],[102,148,186,187],[102,148,153,168,180,188],[102,148,189],[102,148,168,190],[102,148,163,174,191],[102,148,153,192],[102,148,180,193],[102,148,167,194],[102,148,195],[102,148,160,162,171,180,183,191,193,194,196],[102,148,180,197],[90,91,94,102,148,257],[102,148,234,235],[91,92,94,95,96,102,148],[91,102,148],[91,92,94,102,148],[91,92,102,148],[102,148,241],[86,102,148,241,242],[86,102,148,241],[86,93,102,148],[87,102,148],[86,87,88,90,102,148],[86,102,148],[102,148,263,264],[102,148,263,264,265,266],[102,148,263,265],[102,148,263],[102,148,276],[102,148,273,274,275],[102,148,224],[102,148,222,224],[102,148,213,221,222,223,225,227],[102,148,211],[102,148,214,219,224,227],[102,148,210,227],[102,148,214,215,218,219,220,227],[102,148,214,215,216,218,219,227],[102,148,211,212,213,214,215,219,220,221,223,224,225,227],[102,148,227],[102,148,209,211,212,213,214,215,216,218,219,220,221,222,223,224,225,226],[102,148,209,227],[102,148,214,216,217,219,220,227],[102,148,218,227],[102,148,219,220,224,227],[102,148,212,222],[102,148,203,232,233],[102,148,202,203],[89,102,148],[102,110,113,116,117,148,191],[102,113,148,180,191],[102,113,117,148,191],[102,148,180],[102,107,148],[102,111,148],[102,109,110,113,148,191],[102,148,168,188],[102,148,198],[102,107,148,198],[102,109,113,148,168,191],[102,104,105,106,108,112,148,160,180,191],[102,113,121,148],[102,105,111,148],[102,113,137,138,148],[102,105,108,113,148,183,191,198],[102,113,148],[102,109,113,148,191],[102,104,148],[102,107,108,109,111,112,113,114,115,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,138,139,140,141,142,148],[102,113,130,133,148,156],[102,113,121,122,123,148],[102,111,113,122,124,148],[102,112,148],[102,105,107,113,148],[102,113,117,122,124,148],[102,117,148],[102,111,113,116,148,191],[102,105,109,113,121,148],[102,113,130,148],[102,107,113,137,148,183,196,198],[102,148,238,239],[102,148,238],[102,148,160,161,163,164,165,168,180,188,191,197,198,199,200,201,203,204,206,207,208,228,229,230,231,232,233],[102,148,199,200,201,205],[102,148,199],[102,148,201],[102,148,203,233],[97,102,148,249,250,259],[86,94,97,102,148,243,244,259],[102,148,252],[98,102,148],[86,97,99,102,148,243,251,258,259],[102,148,236],[86,91,94,97,99,102,148,151,161,180,233,236,237,240,243,245,246,248,251,253,254,259,260],[97,102,148,249,250,251,259],[102,148,233,255,260],[97,99,102,148,240,243,245,259],[102,148,196,246],[86,91,94,97,98,99,102,148,151,161,180,196,233,236,237,240,243,244,245,246,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,267],[83,102,148,161,170,268],[78,83,84,102,148,161,170,268],[80,81,102,148,161,268],[78,79,80,81,82,102,148],[78,82,102,148],[80,81,83,84,102,148],[78,81,102,148]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2e80ee7a49e8ac312cc11b77f1475804bee36b3b2bc896bead8b6e1266befb43","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7a3c8b952931daebdfc7a2897c53c0a1c73624593fa070e46bd537e64dcd20a","affectsGlobalScope":true,"impliedFormat":1},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true,"impliedFormat":1},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"df83c2a6c73228b625b0beb6669c7ee2a09c914637e2d35170723ad49c0f5cd4","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"4245fee526a7d1754529d19227ecbf3be066ff79ebb6a380d78e41648f2f224d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3e9cef4eed59f8a2249ed834ba4aabe9d0d4e9037d4679487fa17dad99004a3","impliedFormat":1},{"version":"3330fcd38b000fba370830a89ae1f886ffbbec4cf8c071a412e5fc6b351d1e4a","affectsGlobalScope":true,"impliedFormat":99},{"version":"9404729fdcff80506c5de70ac1eb5ea4bdf6b9b46867481b419773246601d1bd","impliedFormat":99},{"version":"c9d062fa333b7c9f00715770875aa3ed25065fc9981bdbebbfda5e7856b747ea","signature":"3c269b3634f379ccd37ab38ab42af371f21c61528488880e8927af4a1fe50bc6","impliedFormat":99},{"version":"64e873108715482d9780e737b9ec97e59eec58decc28d08bf587195e33622a21","signature":"fbdec12a0fc7e1b069bbb2c3b8db3122e7d8f0ba61186fb128471ba5e51c2eed","impliedFormat":99},{"version":"3ae877e0777a93f72f2110a9abaf5f5a9b76a2bd99ca8cf518d3dd4dfe0392ac","signature":"4aa1d93c8e0e1fec8b607c0e4fde163f6bde7bfc4bed8ebe85ec53513493b838","impliedFormat":99},{"version":"8e161c661ccac0c3dea437074699a95c5bf19868095990ea02ba8d51782b62ef","signature":"cdab0e55c9f90197c2e4ecced85029fb9ada8f1dd6717886bce5e89b734671bb","impliedFormat":99},{"version":"56c3dbf2c712e63ab3c1b826cec8e2a629c7391d672a279f28fb98f8a7a140e9","signature":"d0901e15fce318ce743088e60f1f77bc56dc584908f074f6ea336b3b3a7611df","impliedFormat":99},{"version":"de26c3a63e3764e04db0d4a9ba9843b8f1f4fa4d353e790a415f79570d6471f3","signature":"1d9567061311fc17c1aed6554015768e267242e3596e4cf977096a67f4140df9","impliedFormat":99},{"version":"5c54a34e3d91727f7ae840bfe4d5d1c9a2f93c54cb7b6063d06ee4a6c3322656","impliedFormat":99},{"version":"db4da53b03596668cf6cc9484834e5de3833b9e7e64620cf08399fe069cd398d","impliedFormat":99},{"version":"ac7c28f153820c10850457994db1462d8c8e462f253b828ad942a979f726f2f9","impliedFormat":99},{"version":"f9b028d3c3891dd817e24d53102132b8f696269309605e6ed4f0db2c113bbd82","impliedFormat":99},{"version":"fb7c8d90e52e2884509166f96f3d591020c7b7977ab473b746954b0c8d100960","impliedFormat":99},{"version":"0bff51d6ed0c9093f6955b9d8258ce152ddb273359d50a897d8baabcb34de2c4","impliedFormat":99},{"version":"45cec9a1ba6549060552eead8959d47226048e0b71c7d0702ae58b7e16a28912","impliedFormat":99},{"version":"ef13c73d6157a32933c612d476c1524dd674cf5b9a88571d7d6a0d147544d529","impliedFormat":99},{"version":"13918e2b81c4288695f9b1f3dcc2468caf0f848d5c1f3dc00071c619d34ff63a","impliedFormat":99},{"version":"6907b09850f86610e7a528348c15484c1e1c09a18a9c1e98861399dfe4b18b46","impliedFormat":99},{"version":"12deea8eaa7a4fc1a2908e67da99831e5c5a6b46ad4f4f948fd4759314ea2b80","impliedFormat":99},{"version":"f0a8b376568a18f9a4976ecb0855187672b16b96c4df1c183a7e52dc1b5d98e8","impliedFormat":99},{"version":"8124828a11be7db984fcdab052fd4ff756b18edcfa8d71118b55388176210923","impliedFormat":99},{"version":"092944a8c05f9b96579161e88c6f211d5304a76bd2c47f8d4c30053269146bc8","impliedFormat":99},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0671b50bb99cc7ad46e9c68fa0e7f15ba4bc898b59c31a17ea4611fab5095da","affectsGlobalScope":true,"impliedFormat":1},{"version":"d802f0e6b5188646d307f070d83512e8eb94651858de8a82d1e47f60fb6da4e2","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"cdcf9ea426ad970f96ac930cd176d5c69c6c24eebd9fc580e1572d6c6a88f62c","impliedFormat":1},{"version":"23cd712e2ce083d68afe69224587438e5914b457b8acf87073c22494d706a3d0","impliedFormat":1},{"version":"487b694c3de27ddf4ad107d4007ad304d29effccf9800c8ae23c2093638d906a","impliedFormat":1},{"version":"e525f9e67f5ddba7b5548430211cae2479070b70ef1fd93550c96c10529457bd","impliedFormat":1},{"version":"ccf4552357ce3c159ef75f0f0114e80401702228f1898bdc9402214c9499e8c0","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"68834d631c8838c715f225509cfc3927913b9cc7a4870460b5b60c8dbdb99baf","impliedFormat":1},{"version":"4bc0794175abedf989547e628949888c1085b1efcd93fc482bccd77ee27f8b7c","impliedFormat":1},{"version":"3c8e93af4d6ce21eb4c8d005ad6dc02e7b5e6781f429d52a35290210f495a674","impliedFormat":1},{"version":"2c9875466123715464539bfd69bcaccb8ff6f3e217809428e0d7bd6323416d01","impliedFormat":1},{"version":"ea6bc8de8b59f90a7a3960005fd01988f98fd0784e14bc6922dde2e93305ec7d","impliedFormat":1},{"version":"36107995674b29284a115e21a0618c4c2751b32a8766dd4cb3ba740308b16d59","impliedFormat":1},{"version":"914a0ae30d96d71915fc519ccb4efbf2b62c0ddfb3a3fc6129151076bc01dc60","impliedFormat":1},{"version":"33e981bf6376e939f99bd7f89abec757c64897d33c005036b9a10d9587d80187","impliedFormat":1},{"version":"6c8e442ba33b07892169a14f7757321e49ab0f1032d676d321a1fdab8a67d40c","impliedFormat":1},{"version":"b41767d372275c154c7ea6c9d5449d9a741b8ce080f640155cc88ba1763e35b3","impliedFormat":1},{"version":"1cd673d367293fc5cb31cd7bf03d598eb368e4f31f39cf2b908abbaf120ab85a","impliedFormat":1},{"version":"af13e99445f37022c730bfcafcdc1761e9382ce1ea02afb678e3130b01ce5676","impliedFormat":1},{"version":"3825bf209f1662dfd039010a27747b73d0ef379f79970b1d05601ec8e8a4249f","impliedFormat":1},{"version":"0b6e25234b4eec6ed96ab138d96eb70b135690d7dd01f3dd8a8ab291c35a683a","impliedFormat":1},{"version":"9666f2f84b985b62400d2e5ab0adae9ff44de9b2a34803c2c5bd3c8325b17dc0","impliedFormat":1},{"version":"da52342062e70c77213e45107921100ba9f9b3a30dd019444cf349e5fb3470c4","impliedFormat":1},{"version":"e9ace91946385d29192766bf783b8460c7dbcbfc63284aa3c9cae6de5155c8bc","impliedFormat":1},{"version":"40b463c6766ca1b689bfcc46d26b5e295954f32ad43e37ee6953c0a677e4ae2b","impliedFormat":1},{"version":"249b9cab7f5d628b71308c7d9bb0a808b50b091e640ba3ed6e2d0516f4a8d91d","impliedFormat":1},{"version":"1e30c045732e7db8f7a82cf90b516ebe693d2f499ce2250a977ec0d12e44a529","impliedFormat":1},{"version":"84b736594d8760f43400202859cda55607663090a43445a078963031d47e25e7","impliedFormat":1},{"version":"499e5b055a5aba1e1998f7311a6c441a369831c70905cc565ceac93c28083d53","impliedFormat":1},{"version":"54c3e2371e3d016469ad959697fd257e5621e16296fa67082c2575d0bf8eced0","impliedFormat":1},{"version":"beb8233b2c220cfa0feea31fbe9218d89fa02faa81ef744be8dce5acb89bb1fd","impliedFormat":1},{"version":"78b29846349d4dfdd88bd6650cc5d2baaa67f2e89dc8a80c8e26ef7995386583","impliedFormat":1},{"version":"5d0375ca7310efb77e3ef18d068d53784faf62705e0ad04569597ae0e755c401","impliedFormat":1},{"version":"59af37caec41ecf7b2e76059c9672a49e682c1a2aa6f9d7dc78878f53aa284d6","impliedFormat":1},{"version":"addf417b9eb3f938fddf8d81e96393a165e4be0d4a8b6402292f9c634b1cb00d","impliedFormat":1},{"version":"e38d4fdf79e1eadd92ed7844c331dbaa40f29f21541cfee4e1acff4db09cda33","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"7c10a32ae6f3962672e6869ee2c794e8055d8225ef35c91c0228e354b4e5d2d3","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"99f569b42ea7e7c5fe404b2848c0893f3e1a56e0547c1cd0f74d5dbb9a9de27e","impliedFormat":1},{"version":"f4b4faedc57701ae727d78ba4a83e466a6e3bdcbe40efbf913b17e860642897c","affectsGlobalScope":true,"impliedFormat":1},{"version":"bbcfd9cd76d92c3ee70475270156755346c9086391e1b9cb643d072e0cf576b8","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"72c1f5e0a28e473026074817561d1bc9647909cf253c8d56c41d1df8d95b85f7","impliedFormat":1},{"version":"003ec918ec442c3a4db2c36dc0c9c766977ea1c8bcc1ca7c2085868727c3d3f6","affectsGlobalScope":true,"impliedFormat":1},{"version":"938f94db8400d0b479626b9006245a833d50ce8337f391085fad4af540279567","impliedFormat":1},{"version":"c4e8e8031808b158cfb5ac5c4b38d4a26659aec4b57b6a7e2ba0a141439c208c","impliedFormat":1},{"version":"2c91d8366ff2506296191c26fd97cc1990bab3ee22576275d28b654a21261a44","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"db39d9a16e4ddcd8a8f2b7b3292b362cc5392f92ad7ccd76f00bccf6838ac7de","affectsGlobalScope":true,"impliedFormat":1},{"version":"289e9894a4668c61b5ffed09e196c1f0c2f87ca81efcaebdf6357cfb198dac14","impliedFormat":1},{"version":"25a1105595236f09f5bce42398be9f9ededc8d538c258579ab662d509aa3b98e","impliedFormat":1},{"version":"5078cd62dbdf91ae8b1dc90b1384dec71a9c0932d62bdafb1a811d2a8e26bef2","impliedFormat":1},{"version":"a2e2bbde231b65c53c764c12313897ffdfb6c49183dd31823ee2405f2f7b5378","impliedFormat":1},{"version":"ad1cc0ed328f3f708771272021be61ab146b32ecf2b78f3224959ff1e2cd2a5c","impliedFormat":1},{"version":"71450bbc2d82821d24ca05699a533e72758964e9852062c53b30f31c36978ab8","affectsGlobalScope":true,"impliedFormat":1},{"version":"62f572306e0b173cc5dfc4c583471151f16ef3779cf27ab96922c92ec82a3bc8","affectsGlobalScope":true,"impliedFormat":1},{"version":"067bdd82d9768baddbdc8df51d85f7b96387c47176bf7f895d2e21e2b6b2f1f4","impliedFormat":1},{"version":"42d30e7d04915facc3ded22b4127c9f517973b4c2b1326e56c10ff70daf6800a","impliedFormat":1},{"version":"bd8b644c5861b94926687618ec2c9e60ad054d334d6b7eb4517f23f53cb11f91","impliedFormat":1},{"version":"bcbabfaca3f6b8a76cb2739e57710daf70ab5c9479ab70f5351c9b4932abf6bd","impliedFormat":1},{"version":"77fced47f495f4ff29bb49c52c605c5e73cd9b47d50080133783032769a9d8a6","impliedFormat":1},{"version":"55f370475031b3d36af8dd47fb3934dff02e0f1330d13f1977c9e676af5c2e70","impliedFormat":1},{"version":"c54f0b30a787b3df16280f4675bd3d9d17bf983ae3cd40087409476bc50b922d","affectsGlobalScope":true,"impliedFormat":1},{"version":"0f5cda0282e1d18198e2887387eb2f026372ebc4e11c4e4516fef8a19ee4d514","impliedFormat":1},{"version":"e99b0e71f07128fc32583e88ccd509a1aaa9524c290efb2f48c22f9bf8ba83b1","impliedFormat":1},{"version":"76957a6d92b94b9e2852cf527fea32ad2dc0ef50f67fe2b14bd027c9ceef2d86","impliedFormat":1},{"version":"5e9f8c1e042b0f598a9be018fc8c3cb670fe579e9f2e18e3388b63327544fe16","affectsGlobalScope":true,"impliedFormat":1},{"version":"a8a99a5e6ed33c4a951b67cc1fd5b64fd6ad719f5747845c165ca12f6c21ba16","affectsGlobalScope":true,"impliedFormat":1},{"version":"a58a15da4c5ba3df60c910a043281256fa52d36a0fcdef9b9100c646282e88dd","impliedFormat":1},{"version":"b36beffbf8acdc3ebc58c8bb4b75574b31a2169869c70fc03f82895b93950a12","impliedFormat":1},{"version":"de263f0089aefbfd73c89562fb7254a7468b1f33b61839aafc3f035d60766cb4","impliedFormat":1},{"version":"70b57b5529051497e9f6482b76d91c0dcbb103d9ead8a0549f5bab8f65e5d031","impliedFormat":1},{"version":"8c81fd4a110490c43d7c578e8c6f69b3af01717189196899a6a44f93daa57a3a","impliedFormat":1},{"version":"1013eb2e2547ad8c100aca52ef9df8c3f209edee32bb387121bb3227f7c00088","impliedFormat":1},{"version":"e07c573ac1971ea89e2c56ff5fd096f6f7bba2e6dbcd5681d39257c8d954d4a8","impliedFormat":1},{"version":"363eedb495912790e867da6ff96e81bf792c8cfe386321e8163b71823a35719a","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093","impliedFormat":1},{"version":"dba28a419aec76ed864ef43e5f577a5c99a010c32e5949fe4e17a4d57c58dd11","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea713aa14a670b1ea0fbaaca4fd204e645f71ca7653a834a8ec07ee889c45de6","impliedFormat":1},{"version":"1e080418e53f9b7a05db81ab517c4e1d71b7194ee26ddd54016bcef3ac474bd4","impliedFormat":1},{"version":"9705cd157ffbb91c5cab48bdd2de5a437a372e63f870f8a8472e72ff634d47c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"ae86f30d5d10e4f75ce8dcb6e1bd3a12ecec3d071a21e8f462c5c85c678efb41","impliedFormat":1},{"version":"982efeb2573605d4e6d5df4dc7e40846bda8b9e678e058fc99522ab6165c479e","impliedFormat":1},{"version":"e03460fe72b259f6d25ad029f085e4bedc3f90477da4401d8fbc1efa9793230e","impliedFormat":1},{"version":"4286a3a6619514fca656089aee160bb6f2e77f4dd53dc5a96b26a0b4fc778055","impliedFormat":1},{"version":"3b63610eaabadf26aadf51a563e4b2a8bf56eeaab1094f2a2b21509008eaef0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"2d5d50cd0667d9710d4d2f6e077cc4e0f9dc75e106cccaea59999b36873c5a0d","affectsGlobalScope":true,"impliedFormat":1},{"version":"784490137935e1e38c49b9289110e74a1622baf8a8907888dcbe9e476d7c5e44","impliedFormat":1},{"version":"42180b657831d1b8fead051698618b31da623fb71ff37f002cb9d932cfa775f1","impliedFormat":1},{"version":"4f98d6fb4fe7cbeaa04635c6eaa119d966285d4d39f0eb55b2654187b0b27446","impliedFormat":1},{"version":"f8529fe0645fd9af7441191a4961497cc7638f75a777a56248eac6a079bb275d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4445f6ce6289c5b2220398138da23752fd84152c5c95bb8b58dedefc1758c036","impliedFormat":1},{"version":"a51f786b9f3c297668f8f322a6c58f85d84948ef69ade32069d5d63ec917221c","impliedFormat":1},{"version":"a7ca8df4f2931bef2aa4118078584d84a0b16539598eaadf7dce9104dfaa381c","impliedFormat":1},{"version":"5c31dea483b64cbb341ea8a7073c457720d1574f87837e71cccb70ce91196211","impliedFormat":99},{"version":"11443a1dcfaaa404c68d53368b5b818712b95dd19f188cab1669c39bee8b84b3","impliedFormat":1},{"version":"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","impliedFormat":1},{"version":"ffb518fc55181aefd066c690dbc0f8fa6a1533c8ddac595469c8c5f7fda2d756","affectsGlobalScope":true,"impliedFormat":1},{"version":"a660aa95476042d3fdcc1343cf6bb8fdf24772d31712b1db321c5a4dcc325434","impliedFormat":1},{"version":"36977c14a7f7bfc8c0426ae4343875689949fb699f3f84ecbe5b300ebf9a2c55","impliedFormat":1},{"version":"217d7b67dacf8438f0be82b846f933981a1e6527e63c082c56adaf4782d62ab4","impliedFormat":99},{"version":"b8caba62c0d2ef625f31cbb4fde09d851251af2551086ccf068611b0a69efd81","affectsGlobalScope":true,"impliedFormat":1},{"version":"f582b0fcbf1eea9b318ab92fb89ea9ab2ebb84f9b60af89328a91155e1afce72","impliedFormat":1},{"version":"402e5c534fb2b85fa771170595db3ac0dd532112c8fa44fc23f233bc6967488b","impliedFormat":1},{"version":"8885cf05f3e2abf117590bbb951dcf6359e3e5ac462af1c901cfd24c6a6472e2","impliedFormat":1},{"version":"333caa2bfff7f06017f114de738050dd99a765c7eb16571c6d25a38c0d5365dc","impliedFormat":1},{"version":"e61df3640a38d535fd4bc9f4a53aef17c296b58dc4b6394fd576b808dd2fe5e6","impliedFormat":1},{"version":"459920181700cec8cbdf2a5faca127f3f17fd8dd9d9e577ed3f5f3af5d12a2e4","impliedFormat":1},{"version":"4719c209b9c00b579553859407a7e5dcfaa1c472994bd62aa5dd3cc0757eb077","impliedFormat":1},{"version":"7ec359bbc29b69d4063fe7dad0baaf35f1856f914db16b3f4f6e3e1bca4099fa","impliedFormat":1},{"version":"70790a7f0040993ca66ab8a07a059a0f8256e7bb57d968ae945f696cbff4ac7a","impliedFormat":1},{"version":"d1b9a81e99a0050ca7f2d98d7eedc6cda768f0eb9fa90b602e7107433e64c04c","impliedFormat":1},{"version":"a022503e75d6953d0e82c2c564508a5c7f8556fad5d7f971372d2d40479e4034","impliedFormat":1},{"version":"b215c4f0096f108020f666ffcc1f072c81e9f2f95464e894a5d5f34c5ea2a8b1","impliedFormat":1},{"version":"644491cde678bd462bb922c1d0cfab8f17d626b195ccb7f008612dc31f445d2d","impliedFormat":1},{"version":"dfe54dab1fa4961a6bcfba68c4ca955f8b5bbeb5f2ab3c915aa7adaa2eabc03a","impliedFormat":1},{"version":"1251d53755b03cde02466064260bb88fd83c30006a46395b7d9167340bc59b73","impliedFormat":1},{"version":"47865c5e695a382a916b1eedda1b6523145426e48a2eae4647e96b3b5e52024f","impliedFormat":1},{"version":"4cdf27e29feae6c7826cdd5c91751cc35559125e8304f9e7aed8faef97dcf572","impliedFormat":1},{"version":"331b8f71bfae1df25d564f5ea9ee65a0d847c4a94baa45925b6f38c55c7039bf","impliedFormat":1},{"version":"2a771d907aebf9391ac1f50e4ad37952943515eeea0dcc7e78aa08f508294668","impliedFormat":1},{"version":"0146fd6262c3fd3da51cb0254bb6b9a4e42931eb2f56329edd4c199cb9aaf804","impliedFormat":1},{"version":"183f480885db5caa5a8acb833c2be04f98056bdcc5fb29e969ff86e07efe57ab","impliedFormat":99},{"version":"4ec16d7a4e366c06a4573d299e15fe6207fc080f41beac5da06f4af33ea9761e","impliedFormat":1},{"version":"960bd764c62ac43edc24eaa2af958a4b4f1fa5d27df5237e176d0143b36a39c6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59f8dc89b9e724a6a667f52cdf4b90b6816ae6c9842ce176d38fcc973669009e","affectsGlobalScope":true,"impliedFormat":1},{"version":"e4af494f7a14b226bbe732e9c130d8811f8c7025911d7c58dd97121a85519715","impliedFormat":1},{"version":"a5d643092d2f16cb861872357b12ab844f33fc1181f7c5aed447b3424b4f5668","impliedFormat":99},{"version":"b34b5f6b506abb206b1ea73c6a332b9ee9c8c98be0f6d17cdbda9430ecc1efab","impliedFormat":99},{"version":"75d4c746c3d16af0df61e7b0afe9606475a23335d9f34fcc525d388c21e9058b","impliedFormat":99},{"version":"fa959bf357232201c32566f45d97e70538c75a093c940af594865d12f31d4912","impliedFormat":99},{"version":"d2c52abd76259fc39a30dfae70a2e5ce77fd23144457a7ff1b64b03de6e3aec7","impliedFormat":99},{"version":"e6233e1c976265e85aa8ad76c3881febe6264cb06ae3136f0257e1eab4a6cc5a","impliedFormat":99},{"version":"f73e2335e568014e279927321770da6fe26facd4ac96cdc22a56687f1ecbb58e","impliedFormat":99},{"version":"317878f156f976d487e21fd1d58ad0461ee0a09185d5b0a43eedf2a56eb7e4ea","impliedFormat":99},{"version":"324ac98294dab54fbd580c7d0e707d94506d7b2c3d5efe981a8495f02cf9ad96","impliedFormat":99},{"version":"9ec72eb493ff209b470467e24264116b6a8616484bca438091433a545dfba17e","impliedFormat":99},{"version":"d6ee22aba183d5fc0c7b8617f77ee82ecadc2c14359cc51271c135e23f6ed51f","impliedFormat":99},{"version":"49747416f08b3ba50500a215e7a55d75268b84e31e896a40313c8053e8dec908","impliedFormat":99},{"version":"81e634f1c5e1ca309e7e3dc69e2732eea932ef07b8b34517d452e5a3e9a36fa3","impliedFormat":99},{"version":"34f39f75f2b5aa9c84a9f8157abbf8322e6831430e402badeaf58dd284f9b9a6","impliedFormat":99},{"version":"427fe2004642504828c1476d0af4270e6ad4db6de78c0b5da3e4c5ca95052a99","impliedFormat":1},{"version":"c8905dbea83f3220676a669366cd8c1acef56af4d9d72a8b2241b1d044bb4302","affectsGlobalScope":true,"impliedFormat":99},{"version":"891694d3694abd66f0b8872997b85fd8e52bc51632ce0f8128c96962b443189f","impliedFormat":99},{"version":"69bf2422313487956e4dacf049f30cb91b34968912058d244cb19e4baa24da97","impliedFormat":99},{"version":"971a2c327ff166c770c5fb35699575ba2d13bba1f6d2757309c9be4b30036c8e","impliedFormat":99},{"version":"4f45e8effab83434a78d17123b01124259fbd1e335732135c213955d85222234","impliedFormat":99},{"version":"7bd51996fb7717941cbe094b05adc0d80b9503b350a77b789bbb0fc786f28053","impliedFormat":99},{"version":"b62006bbc815fe8190c7aee262aad6bff993e3f9ade70d7057dfceab6de79d2f","impliedFormat":99},{"version":"13497c0d73306e27f70634c424cd2f3b472187164f36140b504b3756b0ff476d","impliedFormat":99},{"version":"bf7a2d0f6d9e72d59044079d61000c38da50328ccdff28c47528a1a139c610ec","impliedFormat":99},{"version":"04471dc55f802c29791cc75edda8c4dd2a121f71c2401059da61eff83099e8ab","impliedFormat":99},{"version":"120a80aa556732f684db3ed61aeff1d6671e1655bd6cba0aa88b22b88ac9a6b1","affectsGlobalScope":true,"impliedFormat":99},{"version":"e58c0b5226aff07b63be6ac6e1bec9d55bc3d2bda3b11b9b68cccea8c24ae839","affectsGlobalScope":true,"impliedFormat":99},{"version":"a23a08b626aa4d4a1924957bd8c4d38a7ffc032e21407bbd2c97413e1d8c3dbd","impliedFormat":99},{"version":"5a88655bf852c8cc007d6bc874ab61d1d63fba97063020458177173c454e9b4a","impliedFormat":99},{"version":"7e4dfae2da12ec71ffd9f55f4641a6e05610ce0d6784838659490e259e4eb13c","impliedFormat":99},{"version":"c30a41267fc04c6518b17e55dcb2b810f267af4314b0b6d7df1c33a76ce1b330","impliedFormat":1},{"version":"72422d0bac4076912385d0c10911b82e4694fc106e2d70added091f88f0824ba","impliedFormat":1},{"version":"da251b82c25bee1d93f9fd80c5a61d945da4f708ca21285541d7aff83ecb8200","impliedFormat":1},{"version":"4c8ca51077f382498f47074cf304d654aba5d362416d4f809dfdd5d4f6b3aaca","impliedFormat":1},{"version":"c6bddf16578495abc8b5546850b047f30c4b5a2a2b7fecefc0e11a44a6e91399","impliedFormat":1},{"version":"13573a613314e40482386fe9c7934f9d86f3e06f19b840466c75391fb833b99b","impliedFormat":99},{"version":"8cb64a605171ec1732e93d80c82fd962b292762bfc270e9938f0a66d4522968a","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","impliedFormat":99},{"version":"40d9401ac3e7cdb7d0059ea7805395b5441aeaf710dd26cf908fd1e16c6d90e9","signature":"2c0e9ceb4678417707e7d9925125145bb64250fb0bb0bd037208864892b00ac0","impliedFormat":99},{"version":"a92bf3d7cdb3cee0c36a0f3406368f86aacb1d006cafdea5912c5995c38a8208","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","impliedFormat":99},{"version":"f96f3c445afc7d65d4790386e37c5b57f095f285cc89b8315b209fe0c81837c1","impliedFormat":1},{"version":"7212c2d58855b8df35275180e97903a4b6093d4fbaefea863d8d028da63938c6","impliedFormat":1},{"version":"de0199a112f75809a7f80ec071495159dcf3e434bc021347e0175627398264c3","impliedFormat":1},{"version":"1a2bed55cfa62b4649485df27c0e560b04d4da4911e3a9f0475468721495563f","impliedFormat":1},{"version":"854045924626ba585f454b53531c42aed4365f02301aa8eca596423f4675b71f","impliedFormat":1},{"version":"fd326577c62145816fe1acc306c734c2396487f76719d3785d4e825b34540b33","impliedFormat":1},{"version":"6942f031a55d96365479986d08bb04aff56b7e2adae1159cdb4012bef6ff6d8c","impliedFormat":1},{"version":"963d59066dd6742da1918a6213a209bcc205b8ee53b1876ee2b4e6d80f97c85e","impliedFormat":1},{"version":"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","impliedFormat":1},{"version":"e72bcd16c134dae5a840b1d5d0e8b87e1d07fbbff01d66e9a7b913da3cd39b8e","impliedFormat":1}],"root":[78,[80,85],[269,271]],"options":{"allowJs":true,"allowUnreachableCode":false,"alwaysStrict":true,"composite":true,"declaration":true,"declarationMap":true,"erasableSyntaxOnly":true,"esModuleInterop":true,"experimentalDecorators":true,"module":101,"newLine":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":false,"noUnusedParameters":true,"outDir":"./","preserveConstEnums":true,"removeComments":false,"rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":11,"tsBuildInfoFile":"./.buildInfo.json"},"referencedMap":[[248,1],[272,2],[247,3],[202,3],[277,4],[278,3],[279,3],[145,5],[146,5],[147,6],[102,7],[148,8],[149,9],[150,10],[100,3],[151,11],[152,12],[153,13],[154,14],[155,15],[156,16],[157,16],[159,3],[158,17],[160,18],[161,19],[162,20],[144,21],[101,3],[163,22],[164,23],[165,24],[198,25],[166,26],[167,27],[168,28],[169,29],[170,30],[171,31],[172,32],[173,33],[174,34],[175,35],[176,35],[177,36],[178,3],[179,3],[180,37],[182,38],[181,39],[183,40],[184,41],[185,42],[186,43],[187,44],[188,45],[189,46],[190,47],[191,48],[192,49],[193,50],[194,51],[195,52],[196,53],[197,54],[280,3],[281,3],[258,55],[236,56],[234,3],[235,3],[86,3],[97,57],[92,58],[95,59],[249,60],[241,3],[244,61],[243,62],[254,62],[242,63],[257,3],[94,64],[96,64],[88,65],[91,66],[237,65],[93,67],[87,3],[103,3],[207,3],[265,68],[267,69],[266,70],[264,71],[263,3],[273,72],[274,72],[276,73],[275,72],[225,74],[223,75],[224,76],[212,77],[213,75],[220,78],[211,79],[216,80],[226,3],[217,81],[222,82],[228,83],[227,84],[210,85],[218,86],[219,87],[214,88],[221,74],[215,89],[204,90],[203,91],[209,3],[250,3],[89,3],[90,92],[75,3],[76,3],[14,3],[12,3],[13,3],[18,3],[17,3],[2,3],[19,3],[20,3],[21,3],[22,3],[23,3],[24,3],[25,3],[26,3],[3,3],[27,3],[28,3],[4,3],[29,3],[33,3],[30,3],[31,3],[32,3],[34,3],[35,3],[36,3],[5,3],[37,3],[38,3],[39,3],[40,3],[6,3],[44,3],[41,3],[42,3],[43,3],[45,3],[7,3],[46,3],[51,3],[52,3],[47,3],[48,3],[49,3],[50,3],[8,3],[56,3],[53,3],[54,3],[55,3],[57,3],[9,3],[58,3],[59,3],[60,3],[62,3],[61,3],[63,3],[64,3],[10,3],[65,3],[66,3],[67,3],[11,3],[77,3],[68,3],[69,3],[70,3],[71,3],[72,3],[1,3],[73,3],[74,3],[16,3],[15,3],[121,93],[132,94],[119,95],[133,96],[142,97],[110,98],[111,99],[109,100],[141,101],[136,102],[140,103],[113,104],[129,105],[112,106],[139,107],[107,108],[108,102],[114,109],[115,3],[120,110],[118,109],[105,111],[143,112],[134,113],[124,114],[123,109],[125,115],[127,116],[122,117],[126,118],[137,101],[116,119],[117,120],[128,121],[106,96],[131,122],[130,109],[135,3],[104,3],[138,123],[252,124],[239,125],[240,124],[238,3],[233,126],[206,127],[200,128],[201,128],[199,3],[205,129],[231,3],[230,3],[229,3],[208,3],[232,130],[251,131],[245,132],[253,133],[99,134],[259,135],[261,136],[255,137],[262,138],[260,139],[246,140],[256,141],[268,142],[98,3],[79,3],[269,143],[270,144],[271,145],[78,3],[83,146],[84,147],[85,148],[80,3],[82,149],[81,3]],"latestChangedDtsFile":"./__tests__/metadata.test.d.ts","version":"5.9.2"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate.bench.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.bench.d.ts","sourceRoot":"","sources":["../../src/__bench__/generate.bench.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ import { globSync, readFileSync } from "node:fs";
2
+ import { basename, join, resolve } from "node:path";
3
+ import { bench } from "vitest";
4
+ import { generateLayout } from "../generate.js";
5
+ const fixtures = globSync(resolve(join(import.meta.dirname, "../__tests__/fixture/svg/*.svg"))).map((im) => ({
6
+ svg: readFileSync(im),
7
+ id: basename(im).replace(".svg", ""),
8
+ }));
9
+ function getFixtures() {
10
+ return fixtures.sort(() => Math.random() - 0.5);
11
+ }
12
+ bench("generateLayout bench (concurrency=1,x20)", async () => {
13
+ for (let i = 0; i < 20; i++) {
14
+ await generateLayout({ imgs: getFixtures(), pixelRatio: 1, format: false });
15
+ }
16
+ });
17
+ bench("generateLayout bench (concurrency=4,x20)", async () => {
18
+ for (let i = 0; i < 20; i += 4) {
19
+ await Promise.all([
20
+ generateLayout({ imgs: getFixtures(), pixelRatio: 1, format: false }),
21
+ generateLayout({ imgs: getFixtures(), pixelRatio: 1, format: false }),
22
+ generateLayout({ imgs: getFixtures(), pixelRatio: 1, format: false }),
23
+ generateLayout({ imgs: getFixtures(), pixelRatio: 1, format: false }),
24
+ ]);
25
+ }
26
+ });
27
+ //# sourceMappingURL=generate.bench.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.bench.js","sourceRoot":"","sources":["../../src/__bench__/generate.bench.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OA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AAM,EAAE,KAAK,EAAE,CAAC;YACrE,cAAc,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;YACrE,cAAc,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;SACtE,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,48 @@
1
+ import type { DataLayout, ImgLayout } from "./types.js";
2
+ export interface Img {
3
+ svg: Buffer;
4
+ id: string;
5
+ }
6
+ export interface GenerateLayoutOptions {
7
+ /**
8
+ * Overrides the max_size in mapnik
9
+ */
10
+ maxIconSize?: number;
11
+ /**
12
+ * If set, filters out icons that mapnik says are too big
13
+ */
14
+ removeOversizedIcons?: boolean;
15
+ /**
16
+ * If set, filters out icons that have no height or width attribute set
17
+ * @default true
18
+ */
19
+ removeSizeMissingIcons?: boolean;
20
+ /**
21
+ * If false, omits stretch and placeholder metadata (`content`, `stretchX`, `stretchY`, `placeholder`) in {@link DataLayout}
22
+ * @default true
23
+ */
24
+ extractMetadata?: boolean;
25
+ /**
26
+ * If true, generate {@link DataLayout} as first argument to callback and {@link ImgLayout} as the second argument; if false, generate only {@link ImgLayout} as the first argument to the callback function
27
+ */
28
+ format: boolean;
29
+ pixelRatio: number;
30
+ imgs: Img[];
31
+ }
32
+ export type LayoutResult<T extends GenerateLayoutOptions> = T["format"] extends true ? DataLayout : ImgLayout;
33
+ /**
34
+ * Pack a list of images with width and height into a sprite layout.
35
+ * options object with the following keys:
36
+ * Generated Layout Object with sprite contents
37
+ */
38
+ export declare function generateLayout<T extends GenerateLayoutOptions>(options: T): Promise<LayoutResult<T>>;
39
+ /**
40
+ * Same as generateLayout but can be used to dedupe identical SVGs
41
+ * and still preserve the reference.
42
+ *
43
+ * For example if `A.svg` and `B.svg` are identical, a single icon
44
+ * will be in the sprite image and both A and B will reference the same image
45
+ *
46
+ */
47
+ export declare function generateLayoutUnique<T extends GenerateLayoutOptions>(options: T): Promise<LayoutResult<T>>;
48
+ //# sourceMappingURL=generate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAgB,SAAS,EAAY,MAAM,YAAY,CAAC;AAiBhF,MAAM,WAAW,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC;CACb;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,qBAAqB,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,IAAI,GAChF,UAAU,GACV,SAAS,CAAC;AAmId;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,CAAC,SAAS,qBAAqB,EAClE,OAAO,EAAE,CAAC,GACT,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAoD1B;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CAAC,CAAC,SAAS,qBAAqB,EACxE,OAAO,EAAE,CAAC,GACT,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CA4E1B"}
@@ -0,0 +1,227 @@
1
+ import ShelfPack from "@mapka/shelf-pack";
2
+ import mapnik from "@mapnik/mapnik";
3
+ import { extractSvgMetadata } from "./metadata.js";
4
+ function heightAscThanNameComparator(a, b) {
5
+ return b.height - a.height || (a.id === b.id ? 0 : a.id < b.id ? -1 : 1);
6
+ }
7
+ function isNotNull(value) {
8
+ return value !== null;
9
+ }
10
+ const oversizedRe = /image created from svg must be \d+ pixels or fewer on each side/;
11
+ const emptyRe = /image created from svg must have a width and height greater (then|than) zero/;
12
+ /**
13
+ * Create an image from an svg data
14
+ */
15
+ function createImage(img, options) {
16
+ const { svg, id } = img;
17
+ const { pixelRatio, maxIconSize, removeOversizedIcons, removeSizeMissingIcons, extractMetadata, format } = options;
18
+ const svgImageOptions = {
19
+ scale: pixelRatio,
20
+ };
21
+ if (typeof maxIconSize === 'number') {
22
+ svgImageOptions.max_size = maxIconSize;
23
+ }
24
+ return new Promise((resolve, reject) => {
25
+ mapnik.Image.fromSVGBytes(svg, svgImageOptions, (err, image) => {
26
+ if (err) {
27
+ // Produce null result if image was too big and removeOversizedIcons is true
28
+ // Check for specific error message to avoid false positive
29
+ if (removeOversizedIcons && err.message.match(oversizedRe)) {
30
+ return resolve(null);
31
+ }
32
+ // Produce a null result if no width or height attributes and removeSizeMissingIcons is true
33
+ // The error message from mapnik has a typo "then"; account for potential future fix to "than".
34
+ if (removeSizeMissingIcons && err.message.match(emptyRe)) {
35
+ return resolve(null);
36
+ }
37
+ // Any other error is a real error
38
+ return reject(err);
39
+ }
40
+ const height = image.height();
41
+ const width = image.width();
42
+ if (!width || !height) {
43
+ return resolve(null);
44
+ }
45
+ // For the data layout JSON (when options.format is true), extract stretch and placeholder metadata if present
46
+ // In addition to mapka-stretch and mapka-text-placeholder, also check for mapbox-stretch and mapbox-text-placeholder
47
+ if (format && extractMetadata) {
48
+ if (svg.includes("mapbox-stretch") ||
49
+ svg.includes("mapbox-text-placeholder") ||
50
+ svg.includes("mapka-stretch") ||
51
+ svg.includes("mapka-text-placeholder")) {
52
+ extractSvgMetadata({ svg, pixelRatio }, (err, metadata) => {
53
+ if (err)
54
+ return reject(err);
55
+ return resolve({
56
+ svg,
57
+ id,
58
+ width,
59
+ height,
60
+ buffer: image,
61
+ ...metadata,
62
+ });
63
+ });
64
+ return;
65
+ }
66
+ }
67
+ return resolve({
68
+ svg,
69
+ id,
70
+ width,
71
+ height,
72
+ buffer: image,
73
+ });
74
+ });
75
+ });
76
+ }
77
+ async function createImages(options) {
78
+ const images = await Promise.all(options.imgs.map((img) => createImage(img, options)));
79
+ // Remove nulls because of removeSizeMissingIcons, removeOversizedIcons
80
+ const nonNullImages = images.filter(isNotNull);
81
+ // Sort images by height ascending and by id ascending
82
+ const sortedImages = nonNullImages.toSorted(heightAscThanNameComparator);
83
+ return sortedImages;
84
+ }
85
+ function normalizeOptions(options) {
86
+ const { extractMetadata = true, removeSizeMissingIcons = true, pixelRatio, imgs = [] } = options;
87
+ if (!Array.isArray(imgs)) {
88
+ throw new Error("imgs must be an array");
89
+ }
90
+ if (!Number.isInteger(pixelRatio)) {
91
+ throw new Error("pixelRatio must be a number");
92
+ }
93
+ return {
94
+ ...options,
95
+ pixelRatio,
96
+ extractMetadata,
97
+ removeSizeMissingIcons,
98
+ imgs,
99
+ };
100
+ }
101
+ /**
102
+ * Pack a list of images with width and height into a sprite layout.
103
+ * options object with the following keys:
104
+ * Generated Layout Object with sprite contents
105
+ */
106
+ export async function generateLayout(options) {
107
+ const normalizedOptions = normalizeOptions(options);
108
+ // Create images from all svg images using same options
109
+ const allImages = await createImages(normalizedOptions);
110
+ /**
111
+ * Create a ShelfPack instance with autoResize = true
112
+ * Pack all images into the sprite
113
+ * Packing will mutate the images in place and add `x` and `y` properties
114
+ */
115
+ const sprite = new ShelfPack(1, 1, { autoResize: true });
116
+ sprite.pack(allImages, {
117
+ inPlace: true
118
+ });
119
+ if (normalizedOptions.format === false) {
120
+ return {
121
+ width: sprite.w,
122
+ height: sprite.h,
123
+ items: allImages
124
+ };
125
+ }
126
+ if (normalizedOptions.format === true) {
127
+ const dataLayout = {};
128
+ allImages.forEach((item) => {
129
+ dataLayout[item.id] = {
130
+ width: item.width,
131
+ height: item.height,
132
+ x: item.x,
133
+ y: item.y,
134
+ pixelRatio: options.pixelRatio
135
+ };
136
+ if (item.placeholder) {
137
+ dataLayout[item.id].placeholder = item.placeholder;
138
+ }
139
+ if (item.content) {
140
+ dataLayout[item.id].content = item.content;
141
+ }
142
+ if (item.stretchX) {
143
+ dataLayout[item.id].stretchX = item.stretchX;
144
+ }
145
+ if (item.stretchY) {
146
+ dataLayout[item.id].stretchY = item.stretchY;
147
+ }
148
+ });
149
+ return dataLayout;
150
+ }
151
+ throw new Error("Invalid format");
152
+ }
153
+ /**
154
+ * Same as generateLayout but can be used to dedupe identical SVGs
155
+ * and still preserve the reference.
156
+ *
157
+ * For example if `A.svg` and `B.svg` are identical, a single icon
158
+ * will be in the sprite image and both A and B will reference the same image
159
+ *
160
+ */
161
+ export async function generateLayoutUnique(options) {
162
+ const normalizedOptions = normalizeOptions(options);
163
+ /* The svg signature of each item */
164
+ const svgPerItemId = {};
165
+ /* The items for each SVG signature */
166
+ const itemIdsPerSvg = {};
167
+ normalizedOptions.imgs.forEach((item) => {
168
+ var svg = item.svg.toString("base64");
169
+ svgPerItemId[item.id] = svg;
170
+ if (svg in itemIdsPerSvg) {
171
+ itemIdsPerSvg[svg].push(item.id);
172
+ }
173
+ else {
174
+ itemIdsPerSvg[svg] = [item.id];
175
+ }
176
+ });
177
+ /* Only keep 1 item per svg signature for packing */
178
+ normalizedOptions.imgs = normalizedOptions.imgs.filter((item) => {
179
+ var svg = svgPerItemId[item.id];
180
+ return item.id === itemIdsPerSvg[svg][0];
181
+ });
182
+ const allImages = await createImages(normalizedOptions);
183
+ /**
184
+ * Create a ShelfPack instance with autoResize = true
185
+ * Pack all images into the sprite
186
+ * Packing will mutate the images in place and add `x` and `y` properties
187
+ */
188
+ const sprite = new ShelfPack(1, 1, { autoResize: true });
189
+ sprite.pack(allImages, {
190
+ inPlace: true
191
+ });
192
+ if (normalizedOptions.format) {
193
+ const dataLayout = {};
194
+ allImages.forEach((item) => {
195
+ const svg = svgPerItemId[item.id];
196
+ const itemIdsToUpdate = itemIdsPerSvg[svg];
197
+ itemIdsToUpdate.forEach((itemIdToUpdate) => {
198
+ dataLayout[itemIdToUpdate] = {
199
+ width: item.width,
200
+ height: item.height,
201
+ x: item.x,
202
+ y: item.y,
203
+ pixelRatio: options.pixelRatio
204
+ };
205
+ if (item.placeholder) {
206
+ dataLayout[itemIdToUpdate].placeholder = item.placeholder;
207
+ }
208
+ if (item.content) {
209
+ dataLayout[itemIdToUpdate].content = item.content;
210
+ }
211
+ if (item.stretchX) {
212
+ dataLayout[itemIdToUpdate].stretchX = item.stretchX;
213
+ }
214
+ if (item.stretchY) {
215
+ dataLayout[itemIdToUpdate].stretchY = item.stretchY;
216
+ }
217
+ });
218
+ });
219
+ return dataLayout;
220
+ }
221
+ return {
222
+ width: sprite.w,
223
+ height: sprite.h,
224
+ items: allImages
225
+ };
226
+ }
227
+ //# sourceMappingURL=generate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.js","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAUnD,SAAS,2BAA2B,CAAC,CAAO,EAAE,CAAO;IACnD,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,SAAS,SAAS,CAAI,KAAe;IACnC,OAAO,KAAK,KAAK,IAAI,CAAA;AACvB,CAAC;AAyCD,MAAM,WAAW,GAAG,iEAAiE,CAAC;AACtF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,CAAC;YAE3C,eAAe,CAAC,OAAO,CAAC,CAAC,cAAc,EAAE,EAAE;gBACzC,UAAU,CAAC,cAAc,CAAC,GAAG;oBAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,CAAC,EAAE,IAAI,CAAC,CAAC;oBACT,CAAC,EAAE,IAAI,CAAC,CAAC;oBACT,UAAU,EAAE,OAAO,CAAC,UAAU;iBAC/B,CAAC;gBAEF,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;oBACrB,UAAU,CAAC,cAAc,CAAC,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;gBAC5D,CAAC;gBACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;oBACjB,UAAU,CAAC,cAAc,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;gBACpD,CAAC;gBACD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;oBAClB,UAAU,CAAC,cAAc,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;gBACtD,CAAC;gBACD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;oBAClB,UAAU,CAAC,cAAc,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;gBACtD,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,UAA6B,CAAC;IACvC,CAAC;IAED,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,CAAC;QACf,MAAM,EAAE,MAAM,CAAC,CAAC;QAChB,KAAK,EAAE,SAAuB;KACZ,CAAC;AACvB,CAAC"}
package/lib/image.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ import type { Buffer } from "node:buffer";
2
+ import type { ImgLayout } from "./types.js";
3
+ /**
4
+ * Generate a PNG image with positioned icons on a sprite.
5
+ */
6
+ export declare function generateImage(layout: ImgLayout): Promise<Buffer>;
7
+ interface OptimizationOptions {
8
+ quality?: number;
9
+ }
10
+ /**
11
+ * Generate a PNG image with positioned icons on a sprite.
12
+ *
13
+ */
14
+ export declare function generateOptimizedImage(layout: ImgLayout, { quality }: OptimizationOptions): Promise<Buffer>;
15
+ export {};
16
+ //# sourceMappingURL=image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI5C;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BhE;AAED,UAAU,mBAAmB;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,EAAC,OAAa,EAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiC/G"}
package/lib/image.js ADDED
@@ -0,0 +1,53 @@
1
+ import mapnik from "@mapnik/mapnik";
2
+ const emptyPNG = new mapnik.Image(1, 1).encodeSync("png");
3
+ /**
4
+ * Generate a PNG image with positioned icons on a sprite.
5
+ */
6
+ export function generateImage(layout) {
7
+ if (typeof layout !== "object") {
8
+ throw new Error("layout must be an object");
9
+ }
10
+ if (!layout.items.length)
11
+ return Promise.resolve(emptyPNG);
12
+ const { width, height, items, } = layout;
13
+ return new Promise((resolve, reject) => {
14
+ mapnik.blend(items, {
15
+ width,
16
+ height,
17
+ }, (err, image) => {
18
+ if (err)
19
+ return reject(err);
20
+ if (!image)
21
+ return reject();
22
+ resolve(image);
23
+ });
24
+ });
25
+ }
26
+ /**
27
+ * Generate a PNG image with positioned icons on a sprite.
28
+ *
29
+ */
30
+ export function generateOptimizedImage(layout, { quality = 128 }) {
31
+ if (typeof layout !== "object") {
32
+ throw new Error("layout must be an object");
33
+ }
34
+ if (!layout.items.length)
35
+ return Promise.resolve(emptyPNG);
36
+ const { width, height, items, } = layout;
37
+ return new Promise((resolve, reject) => {
38
+ mapnik.blend(items, {
39
+ format: "png",
40
+ mode: "hextree",
41
+ quality,
42
+ width,
43
+ height,
44
+ }, (err, image) => {
45
+ if (err)
46
+ return reject(err);
47
+ if (!image)
48
+ return reject();
49
+ resolve(image);
50
+ });
51
+ });
52
+ }
53
+ //# sourceMappingURL=image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.js","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAGpC,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAAiB;IAC7C,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM;QAAE,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE3D,MAAM,EACJ,KAAK,EACL,MAAM,EACN,KAAK,GACN,GAAG,MAAM,CAAC;IAEX,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC7C,MAAM,CAAC,KAAK,CACV,KAAK,EACL;YACE,KAAK;YACL,MAAM;SACP,EACD,CAAC,GAAkB,EAAE,KAAc,EAAE,EAAE;YACrC,IAAI,GAAG;gBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;YAC5B,IAAI,CAAC,KAAK;gBAAE,OAAO,MAAM,EAAE,CAAC;YAE5B,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAMD;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAiB,EAAE,EAAC,OAAO,GAAG,GAAG,EAAsB;IAC5F,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM;QAAE,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE3D,MAAM,EACJ,KAAK,EACL,MAAM,EACN,KAAK,GACN,GAAG,MAAM,CAAC;IAGT,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC/C,MAAM,CAAC,KAAK,CACV,KAAK,EACL;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,SAAS;YACf,OAAO;YACP,KAAK;YACL,MAAM;SACP,EACD,CAAC,GAAkB,EAAE,KAAc,EAAE,EAAE;YACrC,IAAI,GAAG;gBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;YAC5B,IAAI,CAAC,KAAK;gBAAE,OAAO,MAAM,EAAE,CAAC;YAE5B,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AAEL,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export { generateLayout, generateLayoutUnique } from './generate.js';
2
+ export { generateImage, generateOptimizedImage } from './image.js';
3
+ export { extractSvgMetadata } from './metadata.js';
4
+ export { validateMetadata } from './validate.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,oBAAoB,EAAC,MAAM,eAAe,CAAC;AACnE,OAAO,EAAC,aAAa,EAAE,sBAAsB,EAAC,MAAM,YAAY,CAAC;AAEjE,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC"}