@imgly/plugin-qr-code-web 1.68.0-rc.1 → 1.69.0-nightly.20260130
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/dist/.tsbuildinfo +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fileNames":["../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/@cesdk+engine@1.66.1_react@18.3.1/node_modules/@cesdk/engine/index.d.ts","../../../node_modules/.pnpm/@types+react@18.3.27/node_modules/@types/react/global.d.ts","../../../node_modules/.pnpm/csstype@3.2.3/node_modules/csstype/index.d.ts","../../../node_modules/.pnpm/@types+prop-types@15.7.15/node_modules/@types/prop-types/index.d.ts","../../../node_modules/.pnpm/@types+react@18.3.27/node_modules/@types/react/index.d.ts","../../../node_modules/.pnpm/@types+react-dom@18.3.7_@types+react@18.3.27/node_modules/@types/react-dom/client.d.ts","../../../node_modules/.pnpm/@cesdk+cesdk-js@1.66.1_react@18.3.1/node_modules/@cesdk/cesdk-js/index.d.ts","../../../internal/plugin-utils/dist/assetSources/CustomAssetSource.d.ts","../../../internal/plugin-utils/dist/assetSources/IndexedDBAssetSource.d.ts","../../../internal/plugin-utils/dist/assetSources/AggregatedAssetSource.d.ts","../../../internal/plugin-utils/dist/metadata/Metadata.d.ts","../../../internal/plugin-utils/dist/metadata/types.d.ts","../../../internal/plugin-utils/dist/metadata/FillProcessingMetadata.d.ts","../../../internal/plugin-utils/dist/processing/fillProcessing.d.ts","../../../internal/plugin-utils/dist/processing/initializeFillProcessing.d.ts","../../../internal/plugin-utils/dist/processing/registerFillProcessingComponents.d.ts","../../../internal/plugin-utils/dist/types/Optional.d.ts","../../../internal/plugin-utils/dist/types/UserInterfaceConfiguration.d.ts","../../../internal/plugin-utils/dist/utils/colors.d.ts","../../../internal/plugin-utils/dist/utils/upload.d.ts","../../../internal/plugin-utils/dist/utils/uuid.d.ts","../../../internal/plugin-utils/dist/utils/images.d.ts","../../../internal/plugin-utils/dist/utils/isDefined.d.ts","../../../internal/plugin-utils/dist/utils/toArray.d.ts","../../../internal/plugin-utils/dist/translationHelpers.d.ts","../../../internal/plugin-utils/dist/index.d.ts","../src/lib/qrcodegen.ts","../src/qr.ts","../src/plugin.ts","../src/index.ts","../src/types.ts","../esbuild/global.d.ts","../../../node_modules/.pnpm/@types+ndarray@1.0.14/node_modules/@types/ndarray/index.d.ts"],"fileIdsList":[[38],[32],[39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56],[42,43],[38,43,57],[38,57],[32,36,37],[36],[33,34,35],[60],[32,38,57,59],[58]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","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":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"88c934b67e3a7e427a36dd910ff8647b44af173b722889e5d26edc6c913b3fcd","impliedFormat":99},{"version":"eb5b19b86227ace1d29ea4cf81387279d04bb34051e944bc53df69f58914b788","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"87d9d29dbc745f182683f63187bf3d53fd8673e5fca38ad5eaab69798ed29fbc","impliedFormat":1},{"version":"7a3aa194cfd5919c4da251ef04ea051077e22702638d4edcb9579e9101653519","affectsGlobalScope":true,"impliedFormat":1},{"version":"05321b823dd3781d0b6aac8700bfdc0c9181d56479fe52ba6a40c9196fd661a8","impliedFormat":1},{"version":"6ae5ab1a9052d341e333c6e1d51da38e7973bd8ed1ffd2111e333c7189e26045","impliedFormat":99},"395930038878d2820bae19148bfbbfea0dc4d6a5f0937081d1f818aa1a5344c8","bb310394bed87e0518177d56d03ed9302644d7c6131f0065610c89159d785a53","48d1d8068fdbf3a80f65bfddc6833009bb73522a85ac66ba01cbe88431869a7b","9792a6ceb95a9b12a06bf77dafa60773111aebd3676e74d9f015a01b2ce9ad4e","3b66b77dc1c65e79292b24ca485ab9f224c57d59c9b1483dd4142040aaf3ab10","cb022fa0053b67ba57a4e61d2f655757b35fbaaf6bbab1f8e7d8e71c595e77ce","3c364501427d75086144822fdff35f9d12fc46d30a15589d4bf1ec58604e5d81","a711cc0a1b5635ad802047cc72ce5bbfedb3ee4166e1c58f6b67eae79d41b690","9925441ad64712f91750f97a35026857ef85bcbb673ce5232f814eee749a4932","67110113d27335e8fb7a32087a5cce2316627867b67b2df252d9cfbc3826ab34","0a8f2dbe1118ebc2070fec7bb921bb86cc48fa6e62a172a300e525e291e64488","8a501b3e5592be6d51ef04c1dbdf625c5c8d242612c8365b43ba2b6ea0a8dc18","8c0e8ac147427276b9977392caa11e35402b6a29460cf1bfa486e7fd8ab55850","da2cff8595faeb98d2246fbe5c2a96efdc04525b7868e258ad06a24b298ba648","2e6a7c89b4fb214da5440bf4fe04dfea899a6e9052f0c8493f8fb08c74e94a55","2eda1174ba5d7df48620e859dc6dd04e0abae33ae1b1bca7571ba3b33874ace0","1708d1f9960568c3d158a5d70d7837520a0a09bc1a9462e65468910397afba44","3ee86f1c530b1603f3dd9b377a778a44bbe1ecb0539cf7793d3967afd47c8f9b","a4927ed9cbea5c7fedcae6344c70b88d9026525545a6d48748071233b929ae33",{"version":"a34e609b123e592c453d82d23a97bc1a1773162919e8a5ebe61c0e2b5f332370","signature":"e3eed1477a2d2424e54602d871e92b9991f36c50479493ac9e28c41b6a311237"},{"version":"c3f7cf44598eec9c593a1aa386773f2da5bbc86007bd88b6896a18727c8b8f09","signature":"295575918649b896e61d1e278cd4a8f0c51f04157949490478be9edd392a088d"},{"version":"965d8f31afa6c8f6c0a16bf4787846fbadd67f4218cc095e54d389bdd3751e4e","signature":"f890f80c67a430560b1025ff5252963db52e35767e88d4345e9a162f4603dc3d"},{"version":"88d0533b03e062d398a7a12483f059b55aa62dec1a1d01910669cef95bd52f2d","signature":"c5f44b10ddc44d6aed9bfe8917e0519e7f008a9207ebdd95a38cb1f436a3eee2"},{"version":"64c10a4e32bc17cd9a26a683b7b3fcfe6722740a33a2cda157539917a9e164a8","signature":"6ba3cf0ee1e6e2f182413dc0e232e2138ce75747227f53f95db614dc774c9dee"},{"version":"9180dee655300a81a1ba84d945901d773f54b6e535a5730c56722c052ddddc33","affectsGlobalScope":true},{"version":"08c5f8a855984aaf4b7df847c53ac7e87c32350d4ab151370f262a822fa96d8d","impliedFormat":1}],"root":[[58,63]],"options":{"declaration":true,"declarationDir":"./","emitDeclarationOnly":true,"esModuleInterop":true,"module":6,"skipLibCheck":true,"strict":true,"target":4,"tsBuildInfoFile":"./.tsbuildinfo"},"referencedMap":[[41,1],[39,2],[40,1],[57,3],[44,4],[42,1],[43,1],[45,5],[46,6],[47,1],[50,1],[53,1],[51,1],[38,7],[37,8],[36,9],[61,10],[60,11],[59,12]],"version":"5.9.3"}
|
|
1
|
+
{"fileNames":["../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/@cesdk+engine@1.69.0-nightly.20260130_react@18.3.1/node_modules/@cesdk/engine/index.d.ts","../../../node_modules/.pnpm/@types+react@18.3.27/node_modules/@types/react/global.d.ts","../../../node_modules/.pnpm/csstype@3.2.3/node_modules/csstype/index.d.ts","../../../node_modules/.pnpm/@types+prop-types@15.7.15/node_modules/@types/prop-types/index.d.ts","../../../node_modules/.pnpm/@types+react@18.3.27/node_modules/@types/react/index.d.ts","../../../node_modules/.pnpm/@types+react-dom@18.3.7_@types+react@18.3.27/node_modules/@types/react-dom/client.d.ts","../../../node_modules/.pnpm/@cesdk+cesdk-js@1.69.0-nightly.20260130_react@18.3.1/node_modules/@cesdk/cesdk-js/index.d.ts","../../../internal/plugin-utils/dist/assetSources/CustomAssetSource.d.ts","../../../internal/plugin-utils/dist/assetSources/IndexedDBAssetSource.d.ts","../../../internal/plugin-utils/dist/assetSources/AggregatedAssetSource.d.ts","../../../internal/plugin-utils/dist/metadata/Metadata.d.ts","../../../internal/plugin-utils/dist/metadata/types.d.ts","../../../internal/plugin-utils/dist/metadata/FillProcessingMetadata.d.ts","../../../internal/plugin-utils/dist/processing/fillProcessing.d.ts","../../../internal/plugin-utils/dist/processing/initializeFillProcessing.d.ts","../../../internal/plugin-utils/dist/processing/registerFillProcessingComponents.d.ts","../../../internal/plugin-utils/dist/types/Optional.d.ts","../../../internal/plugin-utils/dist/types/UserInterfaceConfiguration.d.ts","../../../internal/plugin-utils/dist/utils/colors.d.ts","../../../internal/plugin-utils/dist/utils/upload.d.ts","../../../internal/plugin-utils/dist/utils/uuid.d.ts","../../../internal/plugin-utils/dist/utils/images.d.ts","../../../internal/plugin-utils/dist/utils/isDefined.d.ts","../../../internal/plugin-utils/dist/utils/toArray.d.ts","../../../internal/plugin-utils/dist/translationHelpers.d.ts","../../../internal/plugin-utils/dist/index.d.ts","../src/lib/qrcodegen.ts","../src/qr.ts","../src/plugin.ts","../src/index.ts","../src/types.ts","../esbuild/global.d.ts","../../../node_modules/.pnpm/@types+ndarray@1.0.14/node_modules/@types/ndarray/index.d.ts"],"fileIdsList":[[38],[32],[39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56],[42,43],[38,43,57],[38,57],[32,36,37],[36],[33,34,35],[60],[32,38,57,59],[58]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","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":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"402036bd3e6a3484eabb7896fbc1474d6e50ea1d71b6fc9d5644869e9e8913b7","impliedFormat":99},{"version":"eb5b19b86227ace1d29ea4cf81387279d04bb34051e944bc53df69f58914b788","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"87d9d29dbc745f182683f63187bf3d53fd8673e5fca38ad5eaab69798ed29fbc","impliedFormat":1},{"version":"7a3aa194cfd5919c4da251ef04ea051077e22702638d4edcb9579e9101653519","affectsGlobalScope":true,"impliedFormat":1},{"version":"05321b823dd3781d0b6aac8700bfdc0c9181d56479fe52ba6a40c9196fd661a8","impliedFormat":1},{"version":"d8fdfe8bd0fd0d4c985d6beaa02a36918de12059c3401a164a928d77da5b384d","impliedFormat":99},"395930038878d2820bae19148bfbbfea0dc4d6a5f0937081d1f818aa1a5344c8","bb310394bed87e0518177d56d03ed9302644d7c6131f0065610c89159d785a53","48d1d8068fdbf3a80f65bfddc6833009bb73522a85ac66ba01cbe88431869a7b","9792a6ceb95a9b12a06bf77dafa60773111aebd3676e74d9f015a01b2ce9ad4e","3b66b77dc1c65e79292b24ca485ab9f224c57d59c9b1483dd4142040aaf3ab10","cb022fa0053b67ba57a4e61d2f655757b35fbaaf6bbab1f8e7d8e71c595e77ce","3c364501427d75086144822fdff35f9d12fc46d30a15589d4bf1ec58604e5d81","a711cc0a1b5635ad802047cc72ce5bbfedb3ee4166e1c58f6b67eae79d41b690","9925441ad64712f91750f97a35026857ef85bcbb673ce5232f814eee749a4932","67110113d27335e8fb7a32087a5cce2316627867b67b2df252d9cfbc3826ab34","0a8f2dbe1118ebc2070fec7bb921bb86cc48fa6e62a172a300e525e291e64488","8a501b3e5592be6d51ef04c1dbdf625c5c8d242612c8365b43ba2b6ea0a8dc18","8c0e8ac147427276b9977392caa11e35402b6a29460cf1bfa486e7fd8ab55850","da2cff8595faeb98d2246fbe5c2a96efdc04525b7868e258ad06a24b298ba648","2e6a7c89b4fb214da5440bf4fe04dfea899a6e9052f0c8493f8fb08c74e94a55","2eda1174ba5d7df48620e859dc6dd04e0abae33ae1b1bca7571ba3b33874ace0","1708d1f9960568c3d158a5d70d7837520a0a09bc1a9462e65468910397afba44","3ee86f1c530b1603f3dd9b377a778a44bbe1ecb0539cf7793d3967afd47c8f9b","a4927ed9cbea5c7fedcae6344c70b88d9026525545a6d48748071233b929ae33",{"version":"a34e609b123e592c453d82d23a97bc1a1773162919e8a5ebe61c0e2b5f332370","signature":"e3eed1477a2d2424e54602d871e92b9991f36c50479493ac9e28c41b6a311237"},{"version":"c3f7cf44598eec9c593a1aa386773f2da5bbc86007bd88b6896a18727c8b8f09","signature":"295575918649b896e61d1e278cd4a8f0c51f04157949490478be9edd392a088d"},{"version":"965d8f31afa6c8f6c0a16bf4787846fbadd67f4218cc095e54d389bdd3751e4e","signature":"f890f80c67a430560b1025ff5252963db52e35767e88d4345e9a162f4603dc3d"},{"version":"88d0533b03e062d398a7a12483f059b55aa62dec1a1d01910669cef95bd52f2d","signature":"c5f44b10ddc44d6aed9bfe8917e0519e7f008a9207ebdd95a38cb1f436a3eee2"},{"version":"64c10a4e32bc17cd9a26a683b7b3fcfe6722740a33a2cda157539917a9e164a8","signature":"6ba3cf0ee1e6e2f182413dc0e232e2138ce75747227f53f95db614dc774c9dee"},{"version":"9180dee655300a81a1ba84d945901d773f54b6e535a5730c56722c052ddddc33","affectsGlobalScope":true},{"version":"08c5f8a855984aaf4b7df847c53ac7e87c32350d4ab151370f262a822fa96d8d","impliedFormat":1}],"root":[[58,63]],"options":{"declaration":true,"declarationDir":"./","emitDeclarationOnly":true,"esModuleInterop":true,"module":6,"skipLibCheck":true,"strict":true,"target":4,"tsBuildInfoFile":"./.tsbuildinfo"},"referencedMap":[[41,1],[39,2],[40,1],[57,3],[44,4],[42,1],[43,1],[45,5],[46,6],[47,1],[50,1],[53,1],[51,1],[38,7],[37,8],[36,9],[61,10],[60,11],[59,12]],"version":"5.9.3"}
|
package/dist/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ var Rt=class{constructor(t,n){this.engine=t,this.key=n}hasData(t){return this.en
|
|
|
17
17
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 13H13V15H15V17H13V21H17V19H19V21H21V19H19V17H21V13H17V15H15V13ZM17 17H15V19H17V17ZM17 17V15H19V17H17Z" fill="currentColor"/>
|
|
18
18
|
</symbol>
|
|
19
19
|
</svg>
|
|
20
|
-
`),l.setTranslations({en:{"ly.img.generate-qr.dock.label":"QR Code",[`panel.${m}`]:"Generate QR Code",[`panel.${m}.description`]:"Enter a URL to automatically generate a QR code for you to embed it in your design.",[`panel.${m}.submit`]:"Generate QR Code",[`panel.${m}.url`]:"URL",[`panel.${m}.foregroundColor`]:"Foreground Color",[`panel.${m}.error`]:"Failed to create QR code block.",[`panel.${v}`]:"Update QR Code",[`panel.${v}.description`]:"Update the URL to automatically refresh the QR code within your design.",[`panel.${v}.asShape`]:"As Shape?",[`panel.${v}.onlyOneBlock`]:"Please select only one block to update the QR code.",[`panel.${v}.noMetadata`]:"Invalid QR code block selected. Missing metadata.",[`panel.${v}.invalidStateShape`]:"Invalid state with no shape found.",[`panel.${v}.invalidStateFill`]:"Invalid state with no fill found.",[`panel.${v}.url`]:"URL",[`panel.${v}.foregroundColor`]:"Foreground Color","ly.img.generate-qr.canvasMenu.edit":"Edit"}}),["ly.img.replace","ly.img.crop","ly.img.fill","ly.img.adjustment","ly.img.shape.options"].forEach(d=>{l.feature.enable(d,({isPreviousEnable:f,engine:e})=>e.block.findAllSelected().every(r=>c.hasData(r)?c.get(r)?.type==="fill":!1)?!1:f())}),l.ui.registerComponent("ly.img.generate-qr.dock",({builder:d})=>{let f=l.ui.isPanelOpen(m);d.Button("ly.img.generate-qr.dock",{label:"ly.img.generate-qr.dock.label",icon:"@imgly/plugin/qr",isSelected:f,onClick:()=>{f?l.ui.closePanel(m):l.ui.openPanel(m)}})}),l.ui.registerComponent("ly.img.update-qr.canvasMenu",({builder:d,engine:f})=>{let e=f.block.findAllSelected();if(e.length!==1)return;let i=e[0];f.block.isAllowedByScope(i,"fill/change")&&c.hasData(i)&&d.Button("ly.img.update-qr.dock",{label:"ly.img.generate-qr.canvasMenu.edit",icon:"@imgly/plugin/qr",onClick:()=>{l.ui.openPanel(v)}})}),l.ui.setCanvasMenuOrder(["ly.img.update-qr.canvasMenu",...l.ui.getCanvasMenuOrder()]),l.ui.registerPanel(m,({builder:d,engine:f,state:e})=>{let i=e("url",""),r=e("color",{r:0,g:0,b:0,a:1}),a=e("asShape",n==="shape");d.Section("ly.img.generate-qr.text.section",{children:()=>{d.Text("ly.img.generate-qr.text",{content:`panel.${m}.description`})}}),d.Section("ly.img.generate-qr.inputs.section",{children:()=>{d.TextInput("ly.img.generate-qr.url",{inputLabel:`panel.${m}.url`,...i}),d.ColorInput("ly.img.generate-qr.foregroundColor",{label:`panel.${m}.foregroundColor`,inputLabel:`panel.${m}.foregroundColor`,...r})}}),d.Section("ly.img.generate-qr.button.section",{children:()=>{d.Button("ly.img.generate-qr.generate",{label:`panel.${m}.submit`,isDisabled:i.value==="",color:"accent",onClick:async()=>{await ki(l,f,i.value,r.value,c,a.value)!=null&&l.ui.closePanel(m)}}),o&&d.Checkbox("ly.img.generate-qr.asShape",{inputLabel:`panel.${v}.asShape`,...a})}})}),l.engine.block.onSelectionChanged(()=>{let d=l.engine.block.findAllSelected();if(d.length!==1){l.ui.isPanelOpen(v)&&l.ui.closePanel(v);return}let f=d[0];c.hasData(f)||l.ui.isPanelOpen(v)&&l.ui.closePanel(v)}),l.ui.registerPanel(v,({builder:d,engine:f})=>{let e=f.block.findAllSelected();if(e.length!==1){d.Section("ly.img.update-qr.only-one-block.section",{children:()=>{d.Text("ly.img.update-qr.only-one-block",{content:`panel.${v}.onlyOneBlock`})}});return}let i=e[0];if(!c.hasData(i)){d.Section("ly.img.update-qr.no-metadata.section",{children:()=>{d.Text("ly.img.update-qr.no-metadata",{content:`panel.${v}.noMetadata`})}});return}let{url:r,color:a,type:s}=c.get(i);d.Section("ly.img.update-qr.section",{children:()=>{d.Text("ly.img.update-qr.text",{content:`panel.${v}.description`}),d.TextInput("ly.img.update-qr.url",{inputLabel:`panel.${v}.url`,value:r,setValue:h=>{c.set(i,{url:h,color:a,type:s}),St(l,f,i,h,a,s)}}),s==="fill"&&d.ColorInput("ly.img.update-qr.foregroundColor",{inputLabel:`panel.${v}.foregroundColor`,inputLabelPosition:"top",value:Ct(a),setValue:h=>{let u=Mi(f,h);c.set(i,{url:r,color:u,type:s}),St(l,f,i,r,u,s)}})}})})}}};function Mi(t,n){let o=typeof n=="string",l;if(o)l=n;else{let c=t.editor.convertColorToColorSpace(n,"sRGB");l=K(c)}return l}async function ki(t,n,o,l,c,d){let f=n.editor.convertColorToColorSpace(l,"sRGB"),e=K(f),{path:i,svg:r,size:a}=J(o,e),s;if(d){if(s=await n.asset.defaultApplyAsset({id:"qr-code",meta:{kind:"shape",vectorPath:i,height:a,width:a,shapeType:"//ly.img.ubq/shape/vector_path"},payload:{}}),s!=null){if(n.block.supportsFill(s)){let h=n.block.getFill(s);n.block.getType(h)==="//ly.img.ubq/fill/color"&&n.block.setColor(h,"fill/color/value",f)}It(n,s)}}else{let h=`data:text/plain;base64,${btoa(r)}`;s=await n.asset.defaultApplyAsset({id:"qr-code",meta:{fillType:"//ly.img.ubq/fill/image",width:a,height:a},payload:{sourceSet:[{uri:h,width:a,height:a}]}})}return s==null?t.ui.showNotification({type:"error",message:`panel.${m}.error`}):c.set(s,{url:o,color:e,type:d?"shape":"fill"}),s}function St(t,n,o,l,c,d){let{path:f,svg:e,size:i}=J(l,c);if(d==="shape"){if(!n.block.supportsShape(o)){t.ui.showNotification({type:"error",message:`panel.${v}.invalidStateShape`});return}let r=n.block.getShape(o);n.block.setString(r,"shape/vector_path/path",f),n.block.setFloat(r,"shape/vector_path/height",i),n.block.setFloat(r,"shape/vector_path/width",i),It(n,o)}else if(d==="fill"){if(!n.block.supportsFill(o)){t.ui.showNotification({type:"error",message:`panel.${v}.invalidStateFill`});return}let r=n.block.getFill(o),a=`data:text/plain;base64,${btoa(e)}`;n.block.setSourceSet(r,"fill/image/sourceSet",[{uri:a,width:i,height:i}])}}function It(t,n){let o=t.block.duplicate(n),l=t.block.getParent(n);if(l!=null){let c=t.block.create("graphic");t.block.setShape(c,t.block.createShape("//ly.img.ubq/shape/rect")),t.block.appendChild(l,c),t.block.setPositionX(c,t.block.getPositionX(n)),t.block.setPositionY(c,t.block.getPositionY(n)),t.block.setWidth(c,t.block.getWidth(n)),t.block.setHeight(c,t.block.getHeight(n));let d=t.block.combine([o,c],"Intersection");t.block.setShape(n,t.block.getShape(d)),t.block.destroy(d)}return n}var Ni=t=>({name:Q,version:"1.
|
|
20
|
+
`),l.setTranslations({en:{"ly.img.generate-qr.dock.label":"QR Code",[`panel.${m}`]:"Generate QR Code",[`panel.${m}.description`]:"Enter a URL to automatically generate a QR code for you to embed it in your design.",[`panel.${m}.submit`]:"Generate QR Code",[`panel.${m}.url`]:"URL",[`panel.${m}.foregroundColor`]:"Foreground Color",[`panel.${m}.error`]:"Failed to create QR code block.",[`panel.${v}`]:"Update QR Code",[`panel.${v}.description`]:"Update the URL to automatically refresh the QR code within your design.",[`panel.${v}.asShape`]:"As Shape?",[`panel.${v}.onlyOneBlock`]:"Please select only one block to update the QR code.",[`panel.${v}.noMetadata`]:"Invalid QR code block selected. Missing metadata.",[`panel.${v}.invalidStateShape`]:"Invalid state with no shape found.",[`panel.${v}.invalidStateFill`]:"Invalid state with no fill found.",[`panel.${v}.url`]:"URL",[`panel.${v}.foregroundColor`]:"Foreground Color","ly.img.generate-qr.canvasMenu.edit":"Edit"}}),["ly.img.replace","ly.img.crop","ly.img.fill","ly.img.adjustment","ly.img.shape.options"].forEach(d=>{l.feature.enable(d,({isPreviousEnable:f,engine:e})=>e.block.findAllSelected().every(r=>c.hasData(r)?c.get(r)?.type==="fill":!1)?!1:f())}),l.ui.registerComponent("ly.img.generate-qr.dock",({builder:d})=>{let f=l.ui.isPanelOpen(m);d.Button("ly.img.generate-qr.dock",{label:"ly.img.generate-qr.dock.label",icon:"@imgly/plugin/qr",isSelected:f,onClick:()=>{f?l.ui.closePanel(m):l.ui.openPanel(m)}})}),l.ui.registerComponent("ly.img.update-qr.canvasMenu",({builder:d,engine:f})=>{let e=f.block.findAllSelected();if(e.length!==1)return;let i=e[0];f.block.isAllowedByScope(i,"fill/change")&&c.hasData(i)&&d.Button("ly.img.update-qr.dock",{label:"ly.img.generate-qr.canvasMenu.edit",icon:"@imgly/plugin/qr",onClick:()=>{l.ui.openPanel(v)}})}),l.ui.setCanvasMenuOrder(["ly.img.update-qr.canvasMenu",...l.ui.getCanvasMenuOrder()]),l.ui.registerPanel(m,({builder:d,engine:f,state:e})=>{let i=e("url",""),r=e("color",{r:0,g:0,b:0,a:1}),a=e("asShape",n==="shape");d.Section("ly.img.generate-qr.text.section",{children:()=>{d.Text("ly.img.generate-qr.text",{content:`panel.${m}.description`})}}),d.Section("ly.img.generate-qr.inputs.section",{children:()=>{d.TextInput("ly.img.generate-qr.url",{inputLabel:`panel.${m}.url`,...i}),d.ColorInput("ly.img.generate-qr.foregroundColor",{label:`panel.${m}.foregroundColor`,inputLabel:`panel.${m}.foregroundColor`,...r})}}),d.Section("ly.img.generate-qr.button.section",{children:()=>{d.Button("ly.img.generate-qr.generate",{label:`panel.${m}.submit`,isDisabled:i.value==="",color:"accent",onClick:async()=>{await ki(l,f,i.value,r.value,c,a.value)!=null&&l.ui.closePanel(m)}}),o&&d.Checkbox("ly.img.generate-qr.asShape",{inputLabel:`panel.${v}.asShape`,...a})}})}),l.engine.block.onSelectionChanged(()=>{let d=l.engine.block.findAllSelected();if(d.length!==1){l.ui.isPanelOpen(v)&&l.ui.closePanel(v);return}let f=d[0];c.hasData(f)||l.ui.isPanelOpen(v)&&l.ui.closePanel(v)}),l.ui.registerPanel(v,({builder:d,engine:f})=>{let e=f.block.findAllSelected();if(e.length!==1){d.Section("ly.img.update-qr.only-one-block.section",{children:()=>{d.Text("ly.img.update-qr.only-one-block",{content:`panel.${v}.onlyOneBlock`})}});return}let i=e[0];if(!c.hasData(i)){d.Section("ly.img.update-qr.no-metadata.section",{children:()=>{d.Text("ly.img.update-qr.no-metadata",{content:`panel.${v}.noMetadata`})}});return}let{url:r,color:a,type:s}=c.get(i);d.Section("ly.img.update-qr.section",{children:()=>{d.Text("ly.img.update-qr.text",{content:`panel.${v}.description`}),d.TextInput("ly.img.update-qr.url",{inputLabel:`panel.${v}.url`,value:r,setValue:h=>{c.set(i,{url:h,color:a,type:s}),St(l,f,i,h,a,s)}}),s==="fill"&&d.ColorInput("ly.img.update-qr.foregroundColor",{inputLabel:`panel.${v}.foregroundColor`,inputLabelPosition:"top",value:Ct(a),setValue:h=>{let u=Mi(f,h);c.set(i,{url:r,color:u,type:s}),St(l,f,i,r,u,s)}})}})})}}};function Mi(t,n){let o=typeof n=="string",l;if(o)l=n;else{let c=t.editor.convertColorToColorSpace(n,"sRGB");l=K(c)}return l}async function ki(t,n,o,l,c,d){let f=n.editor.convertColorToColorSpace(l,"sRGB"),e=K(f),{path:i,svg:r,size:a}=J(o,e),s;if(d){if(s=await n.asset.defaultApplyAsset({id:"qr-code",meta:{kind:"shape",vectorPath:i,height:a,width:a,shapeType:"//ly.img.ubq/shape/vector_path"},payload:{}}),s!=null){if(n.block.supportsFill(s)){let h=n.block.getFill(s);n.block.getType(h)==="//ly.img.ubq/fill/color"&&n.block.setColor(h,"fill/color/value",f)}It(n,s)}}else{let h=`data:text/plain;base64,${btoa(r)}`;s=await n.asset.defaultApplyAsset({id:"qr-code",meta:{fillType:"//ly.img.ubq/fill/image",width:a,height:a},payload:{sourceSet:[{uri:h,width:a,height:a}]}})}return s==null?t.ui.showNotification({type:"error",message:`panel.${m}.error`}):c.set(s,{url:o,color:e,type:d?"shape":"fill"}),s}function St(t,n,o,l,c,d){let{path:f,svg:e,size:i}=J(l,c);if(d==="shape"){if(!n.block.supportsShape(o)){t.ui.showNotification({type:"error",message:`panel.${v}.invalidStateShape`});return}let r=n.block.getShape(o);n.block.setString(r,"shape/vector_path/path",f),n.block.setFloat(r,"shape/vector_path/height",i),n.block.setFloat(r,"shape/vector_path/width",i),It(n,o)}else if(d==="fill"){if(!n.block.supportsFill(o)){t.ui.showNotification({type:"error",message:`panel.${v}.invalidStateFill`});return}let r=n.block.getFill(o),a=`data:text/plain;base64,${btoa(e)}`;n.block.setSourceSet(r,"fill/image/sourceSet",[{uri:a,width:i,height:i}])}}function It(t,n){let o=t.block.duplicate(n),l=t.block.getParent(n);if(l!=null){let c=t.block.create("graphic");t.block.setShape(c,t.block.createShape("//ly.img.ubq/shape/rect")),t.block.appendChild(l,c),t.block.setPositionX(c,t.block.getPositionX(n)),t.block.setPositionY(c,t.block.getPositionY(n)),t.block.setWidth(c,t.block.getWidth(n)),t.block.setHeight(c,t.block.getHeight(n));let d=t.block.combine([o,c],"Intersection");t.block.setShape(n,t.block.getShape(d)),t.block.destroy(d)}return n}var Ni=t=>({name:Q,version:"1.69.0-nightly.20260130",...Et(t)}),tn=Ni;export{tn as default};
|
|
21
21
|
/*! Bundled license information:
|
|
22
22
|
|
|
23
23
|
lodash-es/lodash.js:
|
package/dist/index.mjs.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../internal/plugin-utils/src/icons/formats.ts", "../../../internal/plugin-utils/src/assetSources/CustomAssetSource.ts", "../../../internal/plugin-utils/src/assetSources/IndexedDBAssetSource.ts", "../../../internal/plugin-utils/src/assetSources/AggregatedAssetSource.ts", "../../../internal/plugin-utils/src/metadata/Metadata.ts", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_root.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isArray.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isObject.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/eq.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isLength.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/keys.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Map.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Set.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_SetCache.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arraySome.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_cacheHas.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_equalArrays.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapToArray.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_equalByTag.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_equalObjects.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqualDeep.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqual.js", "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isEqual.js", "../../../internal/plugin-utils/src/metadata/FillProcessingMetadata.ts", "../../../internal/plugin-utils/src/processing/fillProcessing.ts", "../../../internal/plugin-utils/src/processing/constants.ts", "../../../internal/plugin-utils/src/processing/initializeFillProcessing.ts", "../../../internal/plugin-utils/src/processing/registerFillProcessingComponents.ts", "../../../internal/plugin-utils/src/utils/colors.ts", "../../../internal/plugin-utils/src/utils/upload.ts", "../../../internal/plugin-utils/src/utils/uuid.ts", "../../../internal/plugin-utils/src/utils/images.ts", "../../../internal/plugin-utils/src/utils/isDefined.ts", "../../../internal/plugin-utils/src/utils/toArray.ts", "../../../internal/plugin-utils/src/translationHelpers.ts", "../../../internal/plugin-utils/src/index.ts", "../src/lib/qrcodegen.ts", "../src/qr.ts", "../src/plugin.ts", "../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["export default `\n<svg>\n <symbol\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n id=\"@imgly/plugin/formats/ratioFree\"\n >\n <path d=\"M7 6C6.44772 6 6 6.44772 6 7V9.22222H4V7C4 5.34315 5.34315 4 7 4H9.22222V6H7Z\" fill=\"currentColor\"/>\n <path d=\"M17 6H14.7778V4H17C18.6569 4 20 5.34315 20 7V9.22222H18V7C18 6.44772 17.5523 6 17 6Z\" fill=\"currentColor\"/>\n <path d=\"M6 14.7778V17C6 17.5523 6.44772 18 7 18H9.22222V20H7C5.34315 20 4 18.6569 4 17V14.7778H6Z\" fill=\"currentColor\"/>\n <path d=\"M18 17V14.7778H20V17C20 18.6569 18.6569 20 17 20H14.7778V18H17C17.5523 18 18 17.5523 18 17Z\" fill=\"currentColor\"/>\n </symbol>\n <symbol\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n id=\"@imgly/plugin/formats/ratio4by3\"\n >\n <path d=\"M6.5 13H8V15H10V16.5H6.5V13Z\" fill=\"currentColor\"/>\n <path d=\"M14 9V7.5H17.5V11H16V9H14Z\" fill=\"currentColor\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M6 4C4.34315 4 3 5.34315 3 7V17C3 18.6569 4.34315 20 6 20H18C19.6569 20 21 18.6569 21 17V7C21 5.34315 19.6569 4 18 4H6ZM5 7C5 6.44772 5.44772 6 6 6H18C18.5523 6 19 6.44772 19 7V17C19 17.5523 18.5523 18 18 18H6C5.44772 18 5 17.5523 5 17V7Z\" fill=\"currentColor\"/>\n </symbol>\n <symbol\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n id=\"@imgly/plugin/formats/ratio16by9\"\n >\n <path d=\"M4.5 13H6V15H8V16.5H4.5V13Z\" fill=\"currentColor\"/>\n <path d=\"M16 9V7.5H19.5V11H18V9H16Z\" fill=\"currentColor\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M4 4C2.34315 4 1 5.34315 1 7V17C1 18.6569 2.34315 20 4 20H20C21.6569 20 23 18.6569 23 17V7C23 5.34315 21.6569 4 20 4H4ZM3 7C3 6.44772 3.44772 6 4 6H20C20.5523 6 21 6.44772 21 7V17C21 17.5523 20.5523 18 20 18H4C3.44772 18 3 17.5523 3 17V7Z\" fill=\"currentColor\"/>\n </symbol>\n <symbol\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n id=\"@imgly/plugin/formats/ratio9by16\"\n >\n <path d=\"M7.5 16H9V18H11V19.5H7.5V16Z\" fill=\"currentColor\"/>\n <path d=\"M13 6V4.5H16.5V8H15V6H13Z\" fill=\"currentColor\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M4 20C4 21.6569 5.34315 23 7 23H17C18.6569 23 20 21.6569 20 20V4C20 2.34315 18.6569 1 17 1H7C5.34315 1 4 2.34315 4 4V20ZM7 21C6.44772 21 6 20.5523 6 20V4C6 3.44772 6.44772 3 7 3H17C17.5523 3 18 3.44772 18 4V20C18 20.5523 17.5523 21 17 21H7Z\" fill=\"currentColor\"/>\n </symbol>\n <symbol\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n id=\"@imgly/plugin/formats/ratio3by4\"\n >\n <path d=\"M11 17.5V16H9V14H7.5V17.5H11Z\" fill=\"currentColor\"/>\n <path d=\"M15 10H16.5V6.5H13V8H15V10Z\" fill=\"currentColor\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M20 18C20 19.6569 18.6569 21 17 21H7C5.34315 21 4 19.6569 4 18V6C4 4.34315 5.34315 3 7 3H17C18.6569 3 20 4.34315 20 6V18ZM17 19C17.5523 19 18 18.5523 18 18V6C18 5.44772 17.5523 5 17 5H7C6.44771 5 6 5.44771 6 6V18C6 18.5523 6.44772 19 7 19H17Z\" fill=\"currentColor\"/>\n </symbol>\n <symbol\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n id=\"@imgly/plugin/formats/ratio1by1\"\n >\n <path d=\"M17.4142 8.00009L16 6.58587L14.2929 8.29298L15.7071 9.70719L17.4142 8.00009Z\" fill=\"currentColor\"/>\n <path d=\"M13.0404 12.3739L15.0404 10.3739L13.6262 8.95965L11.6262 10.9596L13.0404 12.3739Z\" fill=\"currentColor\"/>\n <path d=\"M10.3737 15.0405L12.3737 13.0405L10.9595 11.6263L8.95953 13.6263L10.3737 15.0405Z\" fill=\"currentColor\"/>\n <path d=\"M9.70708 15.7072L8.29286 14.293L6.58576 16.0001L7.99997 17.4143L9.70708 15.7072Z\" fill=\"currentColor\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7 4C5.34315 4 4 5.34315 4 7V17C4 18.6569 5.34315 20 7 20H17C18.6569 20 20 18.6569 20 17V7C20 5.34315 18.6569 4 17 4H7ZM6 7C6 6.44772 6.44772 6 7 6H17C17.5523 6 18 6.44772 18 7V17C18 17.5523 17.5523 18 17 18H7C6.44772 18 6 17.5523 6 17V7Z\" fill=\"currentColor\"/>\n </symbol>\n</svg>\n`;\n", "import type {\n AssetDefinition,\n AssetQueryData,\n AssetResult,\n AssetSource,\n AssetsQueryResult\n} from '@cesdk/engine';\n\n/**\n * Simplified value type for select inputs that can be converted to asset definitions\n */\nexport type SelectValue = {\n id: string;\n label: string;\n thumbUri?: string;\n meta?: { [key: string]: any };\n};\n\n/**\n * Options for CustomAssetSource constructor\n */\nexport interface CustomAssetSourceOptions {\n /**\n * Optional callback function to translate asset labels\n * @param assetId - The ID of the asset to translate\n * @param fallbackLabel - The fallback label to use if translation is not available\n * @param locale - The current locale\n * @returns The translated label or fallback\n */\n translateLabel?: (\n assetId: string,\n fallbackLabel: string,\n locale: string\n ) => string;\n}\n\n/**\n * A custom AssetSource implementation that manages assets from an array\n * and provides additional functionality like to mark assets as active or changing\n * labels.\n */\nexport class CustomAssetSource implements AssetSource {\n /** The unique id of the asset source */\n id: string;\n\n /** Array of assets to be served by this source */\n private assets: AssetDefinition[];\n\n /** Set of IDs for active assets */\n private activeAssetIds: Set<string>;\n\n /** Optional translation callback function */\n private translateLabel?: (\n assetId: string,\n fallbackLabel: string,\n locale: string\n ) => string;\n\n /**\n * Creates a new instance of CustomAssetSource\n *\n * @param id - The unique identifier for this asset source\n * @param assets - Array of asset definitions or SelectValue objects to include in this source\n * @param options - Optional configuration for the asset source\n */\n constructor(\n id: string,\n assets: (AssetDefinition | SelectValue)[] = [],\n options?: CustomAssetSourceOptions\n ) {\n this.id = id;\n this.translateLabel = options?.translateLabel;\n this.assets = assets.map((asset) => {\n // Check if the asset is a SelectValue by looking for the label property as a string\n if (\n typeof (asset as SelectValue).label === 'string' &&\n !(\n (asset as AssetDefinition).label &&\n typeof (asset as AssetDefinition).label === 'object'\n )\n ) {\n const selectValue = asset as SelectValue;\n // Convert SelectValue to AssetDefinition\n return {\n id: selectValue.id,\n label: { en: selectValue.label },\n meta: selectValue.thumbUri\n ? { ...(selectValue.meta ?? {}), thumbUri: selectValue.thumbUri }\n : selectValue.meta\n } as AssetDefinition;\n }\n return asset as AssetDefinition;\n });\n this.activeAssetIds = new Set<string>();\n\n // Automatically set first asset as active if available\n if (this.assets.length > 0) {\n this.activeAssetIds.add(this.assets[0].id);\n }\n }\n\n /**\n * Find assets based on the provided query data\n * Supports pagination, searching, filtering, and active-first sorting\n *\n * @param queryData - Query parameters to filter and sort assets\n * @returns Promise with the query results\n */\n async findAssets(\n queryData: AssetQueryData\n ): Promise<AssetsQueryResult | undefined> {\n const {\n page,\n perPage,\n locale = 'en',\n sortActiveFirst,\n query,\n tags,\n groups,\n excludeGroups,\n sortingOrder,\n sortKey\n } = queryData;\n\n // Start with all assets\n let filteredAssets = [...this.assets];\n\n // Filter by groups if provided\n if (groups && groups.length > 0) {\n filteredAssets = filteredAssets.filter(\n (asset) =>\n asset.groups && groups.some((group) => asset.groups?.includes(group))\n );\n }\n\n // Filter out excluded groups if provided\n if (excludeGroups && excludeGroups.length > 0) {\n filteredAssets = filteredAssets.filter(\n (asset) =>\n !asset.groups ||\n !excludeGroups.some((group) => asset.groups?.includes(group))\n );\n }\n\n // Filter by query (search in label and tags)\n if (query) {\n const lowerQuery = query.toLowerCase();\n filteredAssets = filteredAssets.filter((asset) => {\n const label = asset.label?.[locale]?.toLowerCase();\n const assetTags = asset.tags?.[locale] || [];\n\n return (\n (label && label.includes(lowerQuery)) ||\n assetTags.some((tag) => tag.toLowerCase().includes(lowerQuery))\n );\n });\n }\n\n // Filter by exact tags if provided\n if (tags && tags.length > 0) {\n const tagArray = Array.isArray(tags) ? tags : [tags];\n filteredAssets = filteredAssets.filter((asset) => {\n const assetTags = asset.tags?.[locale] || [];\n return tagArray.some((tag) => assetTags.includes(tag));\n });\n }\n\n // Sort by active first if requested\n if (sortActiveFirst) {\n filteredAssets.sort((a, b) => {\n const aActive = this.activeAssetIds.has(a.id);\n const bActive = this.activeAssetIds.has(b.id);\n\n if (aActive && !bActive) return -1;\n if (!aActive && bActive) return 1;\n return 0;\n });\n }\n\n // Sort by sortKey if provided\n if (sortKey && sortKey !== 'id') {\n filteredAssets.sort((a, b) => {\n // Sort by metadata field\n const aValue = a.meta?.[sortKey];\n const bValue = b.meta?.[sortKey];\n\n if (aValue === undefined) return 1;\n if (bValue === undefined) return -1;\n\n if (typeof aValue === 'string' && typeof bValue === 'string') {\n return sortingOrder === 'Descending'\n ? bValue.localeCompare(aValue)\n : aValue.localeCompare(bValue);\n }\n\n if (typeof aValue === 'number' && typeof bValue === 'number') {\n return sortingOrder === 'Descending'\n ? bValue - aValue\n : aValue - bValue;\n }\n\n return 0;\n });\n } else if (sortKey === 'id') {\n // Sort by id\n filteredAssets.sort((a, b) => {\n return sortingOrder === 'Descending'\n ? b.id.localeCompare(a.id)\n : a.id.localeCompare(b.id);\n });\n }\n\n // Calculate pagination\n const total = filteredAssets.length;\n const startIndex = page * perPage;\n const endIndex = startIndex + perPage;\n const paginatedAssets = filteredAssets.slice(startIndex, endIndex);\n\n // Transform AssetDefinition objects to AssetResult objects\n const resultAssets: AssetResult[] = paginatedAssets.map((asset) => {\n // Use translation callback if provided, otherwise use default label\n const fallbackLabel = asset.label?.[locale] || '';\n const label = this.translateLabel\n ? this.translateLabel(asset.id, fallbackLabel, locale)\n : fallbackLabel;\n\n return {\n id: asset.id,\n groups: asset.groups,\n meta: asset.meta,\n payload: asset.payload,\n locale,\n label,\n tags: asset.tags?.[locale],\n active: this.activeAssetIds.has(asset.id)\n };\n });\n\n // Calculate next page if there are more assets\n const nextPage = endIndex < total ? page + 1 : undefined;\n\n return {\n assets: resultAssets,\n currentPage: page,\n nextPage,\n total\n };\n }\n\n updateLabel(assetId: string, label: string, locale: string): void {\n this.assets.forEach((asset) => {\n if (asset.id === assetId) {\n asset.label = asset.label || {};\n asset.label[locale] = label;\n }\n });\n }\n\n /**\n * Get the asset select value by its ID\n *\n * @param assetId - The ID of the asset to retrieve\n * @returns The SelectValue object for the asset or undefined if not found\n */\n getAssetSelectValue(assetId: string): SelectValue | undefined {\n const asset = this.assets.find(({ id }) => id === assetId);\n if (asset) {\n // Get translated label if translation callback is available\n const label = this.translateLabel\n ? this.translateLabel(asset.id, asset.label?.en || '', '')\n : asset.label?.en || '';\n\n return {\n id: asset.id,\n label,\n thumbUri: asset.meta?.thumbUri\n };\n }\n return undefined;\n }\n\n /**\n * Get the currently active asset as a SelectValue\n *\n * @returns The SelectValue object for the active asset or undefined if no asset is active\n */\n getActiveSelectValue(): SelectValue | undefined {\n const activeIds = this.getActiveAssetIds();\n if (activeIds.length > 0) {\n const asset = this.assets.find(({ id }) => id === activeIds[0]);\n if (asset) {\n // Get translated label if translation callback is available\n const label = this.translateLabel\n ? this.translateLabel(asset.id, asset.label?.en || '', '')\n : asset.label?.en || '';\n\n return {\n id: asset.id,\n label,\n thumbUri: asset.meta?.thumbUri\n };\n }\n }\n return undefined;\n }\n\n /**\n * Get the translated label for an asset by its ID\n *\n * @param assetId - The ID of the asset\n * @returns The translated label or undefined if asset not found\n */\n getTranslatedLabel(assetId: string): string | undefined {\n const asset = this.assets.find(({ id }) => id === assetId);\n if (asset) {\n return this.translateLabel\n ? this.translateLabel(asset.id, asset.label?.en || '', '')\n : asset.label?.en || '';\n }\n return undefined;\n }\n\n /**\n * Get an asset by its ID\n */\n getAsset(id: string): AssetDefinition | undefined {\n return this.assets.find((asset) => asset.id === id);\n }\n\n /**\n * Set an asset as active by its ID\n *\n * @param assetId - The ID of the asset to mark as active\n */\n setAssetActive(assetId: string): void {\n this.activeAssetIds.add(assetId);\n }\n\n /**\n * Get all active asset IDs\n *\n * @returns Array of active asset IDs\n */\n getActiveAssetIds(): string[] {\n return Array.from(this.activeAssetIds);\n }\n\n /**\n * Set multiple assets as active by their IDs\n *\n * @param assetIds - Array of asset IDs to mark as active\n */\n setAssetsActive(assetIds: string[]): void {\n assetIds.forEach((id) => this.activeAssetIds.add(id));\n }\n\n /**\n * Set an asset as inactive by its ID\n *\n * @param assetId - The ID of the asset to mark as inactive\n */\n setAssetInactive(assetId: string): void {\n this.activeAssetIds.delete(assetId);\n }\n\n /**\n * Clear all active assets\n */\n clearActiveAssets(): void {\n this.activeAssetIds.clear();\n }\n\n /**\n * Check if an asset is marked as active\n *\n * @param assetId - The ID of the asset to check\n * @returns True if the asset is active, false otherwise\n */\n isAssetActive(assetId: string): boolean {\n return this.activeAssetIds.has(assetId);\n }\n\n /**\n * Add an asset to this source\n *\n * @param asset - The asset definition to add\n */\n addAsset(asset: AssetDefinition): void {\n // Check if asset with this ID already exists\n const existingIndex = this.assets.findIndex((a) => a.id === asset.id);\n if (existingIndex >= 0) {\n // Replace existing asset\n this.assets[existingIndex] = asset;\n } else {\n // Add new asset\n this.assets.push(asset);\n }\n }\n\n /**\n * Remove an asset from this source\n *\n * @param assetId - The ID of the asset to remove\n */\n removeAsset(assetId: string): void {\n const index = this.assets.findIndex((asset) => asset.id === assetId);\n if (index !== -1) {\n this.assets.splice(index, 1);\n this.activeAssetIds.delete(assetId);\n }\n }\n\n /**\n * Get all available groups from the assets\n *\n * @returns Array of unique group names\n */\n async getGroups(): Promise<string[]> {\n const groups = new Set<string>();\n this.assets.forEach((asset) => {\n if (asset.groups) {\n asset.groups.forEach((group) => groups.add(group));\n }\n });\n return Array.from(groups);\n }\n\n /**\n * Returns the supported MIME types for this asset source\n *\n * @returns Array of supported MIME types\n */\n getSupportedMimeTypes(): string[] {\n return [\n 'image/jpeg',\n 'image/png',\n 'image/svg+xml',\n 'image/webp',\n 'video/mp4',\n 'audio/mpeg'\n ];\n }\n}\n\n/**\n * Helper function to create a CustomAssetSource instance\n *\n * @param id - The unique identifier for this asset source\n * @param assets - Array of asset definitions or SelectValue objects to include in this source\n * @param options - Optional configuration for the asset source\n * @returns A new CustomAssetSource instance\n */\nexport function createCustomAssetSource(\n id: string,\n assets: (AssetDefinition | SelectValue)[] = [],\n options?: CustomAssetSourceOptions\n): CustomAssetSource {\n return new CustomAssetSource(id, assets, options);\n}\n\nexport default CustomAssetSource;\n", "/* eslint-disable no-console */\nimport {\n CreativeEngine,\n type AssetDefinition,\n type AssetQueryData,\n type AssetResult,\n type AssetSource,\n type AssetsQueryResult\n} from '@cesdk/cesdk-js';\n\ntype BlobEntry = {\n id: string;\n blob: Blob;\n};\n\n// Asset definition with meta containing insertedAt timestamp\ntype AssetEntryWithMeta = AssetDefinition;\n\n/**\n * IndexedDBAssetSource implements the AssetSource interface using IndexedDB as the storage backend.\n */\nexport class IndexedDBAssetSource implements AssetSource {\n /** The unique id of the API */\n public readonly id: string;\n\n public readonly engine: CreativeEngine;\n\n private readonly dbName: string;\n\n private readonly dbVersion: number;\n\n private readonly assetStoreName: string = 'assets';\n\n private readonly blobStoreName: string = 'blobs';\n\n private db: IDBDatabase | null = null;\n\n /**\n * Creates a new IndexedDBAssetSource\n *\n * @param id - The unique identifier for this asset source\n * @param {Object} [options] - Optional configuration options.\n * @param {string} [options.dbName] - The name of the database.\n * @param {number} [options.dbVersion] - The version number of the database.\n */\n constructor(\n id: string,\n engine: CreativeEngine,\n options?: {\n dbName?: string;\n dbVersion?: number;\n }\n ) {\n this.id = id;\n this.engine = engine;\n this.dbName = options?.dbName ?? `ly.img.assetSource/${id}`;\n this.dbVersion = options?.dbVersion ?? 1;\n }\n\n /**\n * Initialize the database connection and create object stores if needed\n */\n public async initialize(): Promise<void> {\n if (this.db) {\n return;\n }\n\n return new Promise((resolve, reject) => {\n const request = indexedDB.open(this.dbName, this.dbVersion);\n\n request.onerror = (event) => {\n reject(\n new Error(\n `Failed to open IndexedDB: ${(event.target as IDBRequest).error}`\n )\n );\n };\n\n request.onupgradeneeded = (event) => {\n const db = (event.target as IDBOpenDBRequest).result;\n\n // Create asset store if it doesn't exist\n if (!db.objectStoreNames.contains(this.assetStoreName)) {\n db.createObjectStore(this.assetStoreName, {\n keyPath: 'id'\n });\n }\n // Create blob store if it doesn't exist\n if (!db.objectStoreNames.contains(this.blobStoreName)) {\n db.createObjectStore(this.blobStoreName, {\n keyPath: 'id'\n });\n }\n };\n\n request.onsuccess = (event) => {\n this.db = (event.target as IDBOpenDBRequest).result;\n resolve();\n };\n });\n }\n\n /**\n * Close the database connection\n */\n public close(): void {\n if (this.db) {\n this.db.close();\n this.db = null;\n }\n }\n\n /**\n * Find all assets for the given type and the provided query data.\n *\n * @param queryData - The query parameters for filtering assets\n * @param insertionSortOrder - Optional parameter to sort by insertion time: 'asc' for oldest first, 'desc' for newest first (default)\n * @returns A promise that resolves to the query results or undefined if there was an error\n */\n public async findAssets(\n queryData: AssetQueryData\n ): Promise<AssetsQueryResult | undefined> {\n await this.initialize();\n\n if (!this.db) {\n throw new Error('Database not initialized');\n }\n\n try {\n // Get all assets from the store with specified insertion order\n const assetDefinitions = await this.getAllAssets('asc');\n\n let assetResults = assetDefinitions.reduce((acc, assetDefinition) => {\n const locale = queryData.locale ?? 'en';\n let label = '';\n let tags: string[] = [];\n\n // Handle localized label if available\n if (\n assetDefinition.label != null &&\n typeof assetDefinition.label === 'object' &&\n assetDefinition.label[locale]\n ) {\n label = assetDefinition.label[locale];\n }\n\n // Handle localized tags if available\n if (\n assetDefinition.tags != null &&\n typeof assetDefinition.tags === 'object' &&\n assetDefinition.tags[locale]\n ) {\n tags = assetDefinition.tags[locale];\n }\n\n const result: AssetResult = {\n ...assetDefinition,\n label,\n tags\n };\n\n if (this.filterAsset(result, queryData)) {\n acc.push(result);\n }\n\n return acc;\n }, [] as AssetResult[]);\n\n assetResults = await this.restoreBlobUrls(assetResults);\n\n // Apply sorting\n assetResults = this.sortAssets(assetResults, queryData);\n\n // Apply pagination\n const { page, perPage } = queryData;\n const startIndex = page * perPage;\n const endIndex = startIndex + perPage;\n const paginatedAssets = assetResults.slice(startIndex, endIndex);\n\n // Determine if there's a next page\n const nextPage = endIndex < assetResults.length ? page + 1 : undefined;\n\n const result = {\n assets: paginatedAssets,\n currentPage: page,\n nextPage,\n total: assetResults.length\n };\n\n return result;\n } catch (error) {\n console.error('Error finding assets:', error);\n return undefined;\n }\n }\n\n public async getGroups(): Promise<string[]> {\n await this.initialize();\n\n if (!this.db) {\n throw new Error('Database not initialized');\n }\n\n return new Promise((resolve, reject) => {\n const transaction = this.db!.transaction(this.assetStoreName, 'readonly');\n const store = transaction.objectStore(this.assetStoreName);\n const request = store.getAll();\n\n request.onsuccess = () => {\n const allGroups = new Set<string>();\n\n // Extract all groups from all assets\n (request.result as AssetResult[]).forEach((asset) => {\n if (asset.groups && Array.isArray(asset.groups)) {\n asset.groups.forEach((group) => allGroups.add(group));\n }\n });\n\n const uniqueGroups = [...allGroups];\n resolve(uniqueGroups);\n };\n\n request.onerror = () => {\n reject(new Error(`Failed to get groups: ${request.error}`));\n };\n });\n }\n\n /**\n * Adds the given asset to this source. Part of the AssetSource interface.\n *\n * @param asset - The asset definition to add\n */\n public addAsset(asset: AssetDefinition): void {\n this.initialize()\n .then(async () => {\n if (!this.db) {\n throw new Error('Database not initialized');\n }\n\n const transaction = this.db.transaction(\n this.assetStoreName,\n 'readwrite'\n );\n const assetStore = transaction.objectStore(this.assetStoreName);\n\n const blobsToStore = new Set<string>();\n processBlobUrls(asset, (value) => {\n blobsToStore.add(value);\n });\n\n setTimeout(() => {\n this.storeBlobUrls([...blobsToStore]);\n });\n\n // Ensure asset has meta object with insertedAt timestamp\n const assetWithMeta: AssetEntryWithMeta = {\n ...asset,\n meta: {\n ...asset.meta,\n insertedAt: asset.meta?.insertedAt || Date.now()\n }\n };\n\n // Store the asset in the database\n assetStore.put(assetWithMeta);\n\n transaction.onerror = () => {\n console.error(`Failed to add asset: ${transaction.error}`);\n };\n })\n .catch((error) => {\n console.error('Error initializing database:', error);\n });\n }\n\n /**\n * Removes the given asset from this source. Part of the AssetSource interface.\n *\n * @param assetId - The ID of the asset to remove\n */\n public async removeAsset(assetId: string): Promise<void> {\n const asset = await this.getAsset(assetId);\n\n return this.initialize()\n .then(() => {\n if (!this.db) {\n throw new Error('Database not initialized');\n }\n\n const transaction = this.db.transaction(\n this.assetStoreName,\n 'readwrite'\n );\n const store = transaction.objectStore(this.assetStoreName);\n store.delete(assetId);\n\n transaction.oncomplete = () => {\n processBlobUrls(asset, (value) => {\n this.removeBlob(value);\n });\n this.engine.asset.assetSourceContentsChanged(this.id);\n };\n\n transaction.onerror = () => {\n console.error(`Failed to remove asset: ${transaction.error}`);\n };\n })\n .catch((error) => {\n console.error('Error initializing database:', error);\n });\n }\n\n /**\n * Removes the given asset from this source. Part of the AssetSource interface.\n *\n * @param assetId - The ID of the asset to remove\n */\n public async removeBlob(blobId: string): Promise<void> {\n return this.initialize()\n .then(() => {\n if (!this.db) {\n throw new Error('Database not initialized');\n }\n\n const transaction = this.db.transaction(\n this.blobStoreName,\n 'readwrite'\n );\n const store = transaction.objectStore(this.blobStoreName);\n store.delete(blobId);\n\n transaction.onerror = () => {\n console.error(`Failed to remove blob: ${transaction.error}`);\n };\n })\n .catch((error) => {\n console.error('Error initializing database:', error);\n });\n }\n\n /**\n * Get all assets from the database sorted by insertion order (newest to oldest)\n *\n * @param sortOrder - Optional parameter to specify sort order: 'asc' for oldest first, 'desc' for newest first (default)\n * @returns A promise that resolves to an array of all assets\n */\n private async getAllAssets(\n sortOrder: 'asc' | 'desc' = 'desc'\n ): Promise<AssetDefinition[]> {\n return new Promise((resolve, reject) => {\n const transaction = this.db!.transaction(this.assetStoreName, 'readonly');\n const store = transaction.objectStore(this.assetStoreName);\n const request = store.getAll();\n\n request.onsuccess = () => {\n const assets = request.result as AssetEntryWithMeta[];\n\n // Sort by insertion timestamp\n assets.sort((a, b) => {\n // Default to current time if insertedAt is missing (for backward compatibility)\n // First check in meta.insertedAt, then fallback to legacy _insertedAt for backward compatibility\n const timeA =\n a.meta?.insertedAt || (a as any)._insertedAt || Date.now();\n const timeB =\n b.meta?.insertedAt || (b as any)._insertedAt || Date.now();\n\n // Sort based on requested order\n return sortOrder === 'asc'\n ? timeA - timeB // oldest first\n : timeB - timeA; // newest first (default)\n });\n\n resolve(assets);\n };\n\n request.onerror = () => {\n reject(new Error(`Failed to get assets: ${request.error}`));\n };\n });\n }\n\n // Retrieve a blob by ID\n async getAsset(id: string): Promise<AssetResult | undefined> {\n return new Promise((resolve, reject) => {\n const transaction = this.db!.transaction(this.assetStoreName, 'readonly');\n const store = transaction.objectStore(this.assetStoreName);\n const request = store.get(id);\n\n request.onsuccess = () => {\n resolve(request.result as AssetResult);\n };\n\n request.onerror = () => {\n reject(new Error(`Failed to get blob: ${request.error}`));\n };\n });\n }\n\n // Retrieve a blob by ID\n async getBlob(id: string): Promise<BlobEntry | undefined> {\n return new Promise((resolve, reject) => {\n const transaction = this.db!.transaction(this.blobStoreName, 'readonly');\n const store = transaction.objectStore(this.blobStoreName);\n const request = store.get(id);\n\n request.onsuccess = () => {\n resolve(request.result as BlobEntry);\n };\n\n request.onerror = () => {\n reject(new Error(`Failed to get blob: ${request.error}`));\n };\n });\n }\n\n async createBlobUrlFromStore(blobUrl: string): Promise<string> {\n const blobEntry = await this.getBlob(blobUrl);\n if (blobEntry != null) {\n return URL.createObjectURL(blobEntry.blob);\n }\n return blobUrl;\n }\n\n async storeBlobUrls(urls: string[]): Promise<void> {\n const blobsToStore: { [key: string]: Blob } = {};\n await Promise.all(\n urls.map(async (blobUrl) => {\n const blobResponse = await fetch(blobUrl);\n const blob = await blobResponse.blob();\n blobsToStore[blobUrl] = blob;\n })\n );\n\n return this.initialize()\n .then(async () => {\n if (!this.db) {\n throw new Error('Database not initialized');\n }\n\n const transaction = this.db.transaction(\n this.blobStoreName,\n 'readwrite'\n );\n const blobStore = transaction.objectStore(this.blobStoreName);\n\n // Store the asset in the database\n Object.entries(blobsToStore).forEach(([key, blob]) => {\n const asset: BlobEntry = { id: key, blob };\n blobStore.put(asset);\n });\n\n transaction.onerror = () => {\n console.error(`Failed to add blobs: ${transaction.error}`);\n };\n })\n .catch((error) => {\n console.error('Error initializing database:', error);\n });\n }\n\n async restoreBlobUrls(assets: AssetResult[]): Promise<AssetResult[]> {\n const blobReplaced: { [key: string]: string } = {};\n const blobUrls: Set<string> = new Set();\n processBlobUrls(assets, (value) => {\n blobUrls.add(value);\n });\n\n await Promise.all(\n [...blobUrls].map(async (value) => {\n const newUrl = await this.createBlobUrlFromStore(value);\n blobReplaced[value] = newUrl;\n })\n );\n\n return processBlobUrls(assets, (value) => {\n return blobReplaced[value] ?? value;\n });\n }\n\n /**\n * Returns if the given asset should be filtered based on query data\n *\n * @param asset - The asset to filter\n * @param queryData - The query parameters to filter by\n * @returns true if the asset should be included, false otherwise\n */\n private filterAsset(asset: AssetResult, queryData: AssetQueryData): boolean {\n const { query, tags, groups, excludeGroups } = queryData;\n\n // Filter by query string (search on label and tags)\n if (query && query.trim() !== '') {\n const lowerQuery = query.trim().toLowerCase().split(' ');\n\n const lowerLabel = asset.label?.toLowerCase() ?? '';\n const lowerTags = asset.tags?.map((tag) => tag.toLowerCase()) ?? [];\n\n const matchLabelOrTag = lowerQuery.every((word) => {\n return (\n lowerLabel.includes(word) ||\n lowerTags.some((tag) => tag.includes(word))\n );\n });\n\n if (!matchLabelOrTag) {\n return false;\n }\n }\n\n // Filter by exact tags if provided by the query\n if (tags) {\n const tagList = Array.isArray(tags) ? tags : [tags];\n if (\n tagList.length > 0 &&\n (!asset.tags || !tagList.every((tag) => asset.tags?.includes(tag)))\n ) {\n return false;\n }\n }\n\n // Filter by groups\n if (groups && groups.length > 0) {\n if (\n !asset.groups ||\n !groups.some((group) => asset.groups?.includes(group))\n ) {\n return false;\n }\n }\n\n // Filter by excluded groups\n if (excludeGroups && excludeGroups.length > 0) {\n if (\n asset.groups &&\n asset.groups.some((group) => excludeGroups.includes(group))\n ) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Sort assets based on query data\n *\n * @param assets - The assets to sort\n * @param queryData - The query parameters with sorting information\n * @returns The sorted assets\n */\n private sortAssets(\n assets: AssetResult[],\n queryData: AssetQueryData\n ): AssetResult[] {\n const { sortingOrder, sortKey, sortActiveFirst } = queryData;\n\n // Clone the array to avoid modifying the original\n const sortedAssets = [...assets];\n\n // If no sorting order specified or set to 'None', return the current order\n if (!sortingOrder || sortingOrder === 'None') {\n return sortedAssets;\n }\n\n // Sort by the specified key\n if (sortKey) {\n sortedAssets.sort((a, b) => {\n let valueA;\n let valueB;\n\n if (sortKey === 'id') {\n valueA = a.id;\n valueB = b.id;\n } else {\n // Handle metadata sorting (assuming metadata is stored in a 'metadata' field)\n valueA = a.meta?.[sortKey] ?? null;\n valueB = b.meta?.[sortKey] ?? null;\n }\n\n // Handle null/undefined values\n if (valueA === null || valueA === undefined)\n return sortingOrder === 'Ascending' ? -1 : 1;\n if (valueB === null || valueB === undefined)\n return sortingOrder === 'Ascending' ? 1 : -1;\n\n // Compare values based on sorting order\n if (typeof valueA === 'string' && typeof valueB === 'string') {\n return sortingOrder === 'Ascending'\n ? valueA.localeCompare(valueB)\n : valueB.localeCompare(valueA);\n } else {\n return sortingOrder === 'Ascending'\n ? valueA < valueB\n ? -1\n : valueA > valueB\n ? 1\n : 0\n : valueA > valueB\n ? -1\n : valueA < valueB\n ? 1\n : 0;\n }\n });\n } else if (sortingOrder === 'Descending') {\n // If no sort key is specified, and sorting order set\n // to Descending, just reverse original order\n sortedAssets.reverse();\n }\n\n // Sort by active first if requested\n if (sortActiveFirst) {\n sortedAssets.sort((a, b) => {\n if (a.active && !b.active) return -1;\n if (!a.active && b.active) return 1;\n return 0;\n });\n }\n\n return sortedAssets;\n }\n}\n\n/**\n * Goes through an object and calls a callback for every string value that starts with 'blob:'\n * The callback can return a string to replace the original value\n * @param obj The object to traverse\n * @param callback Function to call when a blob URL is found, can return a replacement value\n * @param path Current path in the object (used for recursion)\n * @returns The modified object (or the original if no replacements were made)\n */\nfunction processBlobUrls<T>(\n obj: T,\n callback: (value: string, path: string) => string | void,\n path: string = ''\n): T {\n // Return the object as is if it's null or not an object\n if (obj === null || typeof obj !== 'object') {\n return obj;\n }\n\n // Handle arrays\n if (Array.isArray(obj)) {\n for (let index = 0; index < obj.length; index++) {\n const currentPath = path ? `${path}[${index}]` : `[${index}]`;\n\n if (typeof obj[index] === 'string' && obj[index].startsWith('blob:')) {\n const replacement = callback(obj[index], currentPath);\n if (typeof replacement === 'string') {\n obj[index] = replacement;\n }\n } else {\n obj[index] = processBlobUrls(obj[index], callback, currentPath);\n }\n }\n return obj;\n }\n\n // Handle regular objects\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n const value = obj[key];\n const currentPath = path ? `${path}.${key}` : key;\n\n if (typeof value === 'string' && value.startsWith('blob:')) {\n const replacement = callback(value, currentPath);\n if (typeof replacement === 'string') {\n // @ts-ignore\n obj[key] = replacement;\n }\n } else {\n obj[key] = processBlobUrls(value, callback, currentPath);\n }\n }\n }\n\n return obj;\n}\n\nexport default IndexedDBAssetSource;\n", "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type {\n AssetDefinition,\n AssetQueryData,\n AssetResult,\n AssetSource,\n AssetsQueryResult\n} from '@cesdk/cesdk-js';\nimport CreativeEditorSDK from '@cesdk/cesdk-js';\n\n/**\n * AggregatedAssetSource implements the AssetSource interface by aggregating\n * multiple asset sources via the cesdk API and combining their results.\n *\n * This asset source is read-only - it does not support adding or removing assets.\n */\nexport class AggregatedAssetSource implements AssetSource {\n /** The unique id of the asset source */\n public readonly id: string;\n\n /** The Creative Editor SDK instance */\n private cesdk: CreativeEditorSDK;\n\n /** The IDs of asset sources to aggregate */\n private assetSourceIds: string[];\n\n /**\n * Creates a new AggregatedAssetSource\n *\n * @param id - The unique identifier for this asset source\n * @param cesdk - The Creative Editor SDK instance\n * @param assetSourceIds - The IDs of asset sources to aggregate\n */\n constructor(id: string, cesdk: CreativeEditorSDK, assetSourceIds: string[]) {\n this.id = id;\n this.cesdk = cesdk;\n this.assetSourceIds = assetSourceIds;\n }\n\n /**\n * Find assets across all aggregated sources based on the provided query data\n * Results are sorted by the insertedAt timestamp in meta field\n *\n * @param queryData - Query parameters to filter and sort assets\n * @returns Promise with the query results\n */\n async findAssets(\n queryData: AssetQueryData\n ): Promise<AssetsQueryResult | undefined> {\n try {\n // Query all asset sources via cesdk\n const queryPromises = this.assetSourceIds.map((sourceId) =>\n this.cesdk.engine.asset.findAssets(sourceId, {\n ...queryData,\n // Increase page size to get all assets from each source\n // We'll handle pagination after merging\n perPage: 9999,\n page: 0\n })\n );\n\n // Wait for all queries to complete\n const results = await Promise.all(queryPromises);\n\n // Combine all assets from all sources\n let allAssets: AssetResult[] = [];\n results.forEach((result) => {\n if (result?.assets) {\n allAssets = allAssets.concat(result.assets);\n }\n });\n\n // Sort by insertedAt timestamp\n allAssets.sort((a, b) => {\n const timeA = (a.meta?.insertedAt as number) || 0;\n const timeB = (b.meta?.insertedAt as number) || 0;\n\n // Sort newest first (descending)\n return timeB - timeA;\n });\n\n // Apply pagination after merging\n const { page, perPage } = queryData;\n const startIndex = page * perPage;\n const endIndex = startIndex + perPage;\n const paginatedAssets = allAssets.slice(startIndex, endIndex);\n\n // Calculate if there is a next page\n const nextPage = endIndex < allAssets.length ? page + 1 : undefined;\n\n return {\n assets: paginatedAssets,\n currentPage: page,\n nextPage,\n total: allAssets.length\n };\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error finding assets:', error);\n return undefined;\n }\n }\n\n /**\n * Retrieves all groups from all aggregated asset sources using cesdk\n * @returns Promise with an array of unique group names\n */\n async getGroups(): Promise<string[]> {\n const groupPromises = this.assetSourceIds.map((sourceId) =>\n this.cesdk.engine.asset.getGroups(sourceId)\n );\n\n const groupArrays = await Promise.all(groupPromises);\n\n // Combine and deduplicate groups\n const uniqueGroups = new Set<string>();\n groupArrays.forEach((groups) => {\n groups.forEach((group) => uniqueGroups.add(group));\n });\n\n return Array.from(uniqueGroups);\n }\n\n /**\n * This operation is not supported in AggregatedAssetSource\n * @throws Error - This method is not supported\n */\n addAsset(_asset: AssetDefinition): void {\n throw new Error('AggregatedAssetSource does not support adding assets');\n }\n\n /**\n * This operation is not supported in AggregatedAssetSource\n * @throws Error - This method is not supported\n */\n removeAsset(_assetId: string): void {\n throw new Error('AggregatedAssetSource does not support removing assets');\n }\n}\n\n/**\n * Helper function to create an AggregatedAssetSource instance\n *\n * @param id - The unique identifier for this asset source\n * @param cesdk - The Creative Editor SDK instance\n * @param assetSourceIds - The IDs of asset sources to aggregate\n * @returns A new AggregatedAssetSource instance\n */\nexport function createAggregatedAssetSource(\n id: string,\n cesdk: CreativeEditorSDK,\n assetSourceIds: string[]\n): AggregatedAssetSource {\n return new AggregatedAssetSource(id, cesdk, assetSourceIds);\n}\n\nexport default AggregatedAssetSource;\n", "import { type CreativeEngine } from '@cesdk/cesdk-js';\n\nclass Metadata<V> {\n engine: CreativeEngine;\n\n key: string;\n\n constructor(engine: CreativeEngine, key: string) {\n this.engine = engine;\n this.key = key;\n }\n\n hasData(blockId: number): boolean {\n return (\n this.engine.block.isValid(blockId) &&\n this.engine.block.hasMetadata(blockId, this.key)\n );\n }\n\n get(blockId: number): V | undefined {\n if (this.hasData(blockId)) {\n return JSON.parse(this.engine.block.getMetadata(blockId, this.key));\n }\n return undefined;\n }\n\n set(blockId: number, value: V) {\n this.engine.block.setMetadata(blockId, this.key, JSON.stringify(value));\n }\n\n clear(blockId: number) {\n if (this.engine.block.hasMetadata(blockId, this.key)) {\n this.engine.block.removeMetadata(blockId, this.key);\n }\n }\n}\n\nexport default Metadata;\n", "/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n", "import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n", "import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n", "import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n", "import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n", "/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n", "/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n", "/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n", "import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n", "import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n", "import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n", "/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n", "import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n", "/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n", "import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n", "/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n", "import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n", "/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n", "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n", "import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n", "/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n", "import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n", "import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n", "/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n", "import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n", "import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n", "import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n", "/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n", "import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n", "import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n", "import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n", "import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n", "import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n", "/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n", "import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n", "/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n", "import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n", "import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n", "import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n", "/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n", "import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n", "import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n", "/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n", "import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n", "/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n", "/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n", "/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n", "import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n", "import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n", "/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n", "/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n", "import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n", "import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n", "import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n", "import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n", "import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n", "/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n", "/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n", "import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n", "/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n", "/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n", "import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n", "/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n", "/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n", "import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n", "import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n", "import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n", "import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n", "import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n", "import { isEqual } from 'lodash-es';\n\nimport Metadata from './Metadata';\nimport {\n PluginStatusError,\n PluginStatusMetadata,\n PluginStatusProcessed,\n PluginStatusProcessing\n} from './types';\n\nclass ImageProcessingMetadata extends Metadata<PluginStatusMetadata> {\n get(blockId: number): PluginStatusMetadata {\n return super.get(blockId) ?? { status: 'IDLE' };\n }\n\n /**\n * Detect if the block has been duplicated with processed or processing\n * fill processing. In that case the processing state is still\n * valid, but blockId and fillId have changed.\n */\n isDuplicate(blockId: number): boolean {\n if (!this.engine.block.isValid(blockId)) return false;\n\n const metadata = this.get(blockId);\n\n if (\n metadata.status === 'IDLE' ||\n metadata.status === 'PENDING' ||\n metadata.status === 'ERROR'\n )\n return false;\n\n if (!this.engine.block.hasFill(blockId)) return false;\n const fillId = this.engine.block.getFill(blockId);\n\n // It cannot be a duplicate if the blockId or fillId are the same\n if (metadata.blockId === blockId || metadata.fillId === fillId)\n return false;\n\n return true;\n }\n\n /**\n * Fixes the metadata if the block has been duplicated, i.e. the blockId and\n * fillId will be updated to the current block/fill.\n *\n * Please note: Call this method only on duplicates (see isDuplicate).\n */\n fixDuplicate(blockId: number) {\n const fillId = this.engine.block.getFill(blockId);\n const metadata = this.get(blockId);\n if (\n metadata.status === 'IDLE' ||\n metadata.status === 'PENDING' ||\n metadata.status === 'ERROR'\n )\n return;\n this.set(blockId, {\n ...metadata,\n blockId,\n fillId\n });\n\n // If it is currently processing the best we can do is to just recover\n // the initial image data, since no processing will update this block and\n // it will be stuck in the processing state.\n if (metadata.status === 'PROCESSING') {\n this.recoverInitialImageData(blockId);\n this.clear(blockId);\n }\n }\n\n /**\n * Check if the image has a consisten metadata state. A inconsistent state is\n * caused by outside changes of the fill data.\n *\n * @returns true if the metadata is consistent, false otherwise\n */\n isConsistent(blockId: number): boolean {\n // In case the block was removed, we just abort and mark it\n // as reset by returning true\n if (!this.engine.block.isValid(blockId)) return false;\n const metadata = this.get(blockId);\n if (metadata.status === 'IDLE' || metadata.status === 'PENDING')\n return true;\n\n if (!this.engine.block.hasFill(blockId)) return false;\n const fillId = this.engine.block.getFill(blockId);\n if (fillId == null) return false;\n\n if (blockId !== metadata.blockId || fillId !== metadata.fillId)\n return false;\n\n const sourceSet = this.engine.block.getSourceSet(\n fillId,\n 'fill/image/sourceSet'\n );\n const imageFileURI = this.engine.block.getString(\n fillId,\n 'fill/image/imageFileURI'\n );\n\n if (\n sourceSet.length === 0 &&\n !imageFileURI &&\n metadata.status === 'PROCESSING'\n ) {\n // While we process it is OK to have no image file URI and no source set\n // (which we cleared to show the spinning loader)\n return true;\n }\n\n // Source sets have precedence over imageFileURI so if we have a source set,\n // we only need to check if it has changed to something else.\n if (sourceSet?.length > 0) {\n const initialSourceSet = metadata.initialSourceSet;\n // If we have already processed the image, we need to check if the source set\n // we need to check against both source sets, the removed and the initial\n if (metadata.status !== 'PROCESSED') {\n if (!isEqual(sourceSet, initialSourceSet)) {\n return false;\n }\n }\n } else {\n if (metadata.status !== 'PROCESSED') {\n if (imageFileURI !== metadata.initialImageFileURI) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * Recover the initial values to avoid the loading spinner and have the same\n * state as before the fill processing was started.\n */\n recoverInitialImageData(blockId: number) {\n const blockApi = this.engine.block;\n if (!blockApi.hasFill(blockId)) return; // Nothing to recover (no fill anymore)\n\n const metadata = this.get(blockId);\n\n if (metadata.status === 'PENDING' || metadata.status === 'IDLE') {\n return;\n }\n\n const initialSourceSet = metadata.initialSourceSet;\n const initialImageFileURI = metadata.initialImageFileURI;\n const initialPreviewFileURI = metadata.initialPreviewFileURI;\n\n const fillId = this.getValidFill(blockId, metadata);\n if (fillId == null) return;\n\n if (initialImageFileURI) {\n this.engine.block.setString(\n fillId,\n 'fill/image/imageFileURI',\n initialImageFileURI\n );\n }\n if (initialPreviewFileURI) {\n this.engine.block.setString(\n fillId,\n 'fill/image/previewFileURI',\n initialPreviewFileURI\n );\n }\n if (initialSourceSet.length > 0) {\n this.engine.block.setSourceSet(\n fillId,\n 'fill/image/sourceSet',\n initialSourceSet\n );\n }\n }\n\n /**\n * Returns the fill id of the block if it has a valid fill that was used for\n * fill processing. Returns undefined otherwise.\n */\n private getValidFill(\n blockId: number,\n metadata: PluginStatusProcessing | PluginStatusError | PluginStatusProcessed\n ): number | undefined {\n if (\n !this.engine.block.isValid(blockId) ||\n !this.engine.block.hasFill(blockId) ||\n blockId !== metadata.blockId\n ) {\n return undefined;\n }\n const fillId = this.engine.block.getFill(blockId);\n if (fillId !== metadata.fillId) {\n return undefined;\n }\n\n return fillId;\n }\n}\n\nexport default ImageProcessingMetadata;\n", "import CreativeEditorSDK from '@cesdk/cesdk-js';\nimport { FillProcessingMetadata } from '..';\nimport {\n PluginStatusProcessed,\n PluginStatusProcessing\n} from '../metadata/types';\n\ninterface FillProcessor<T> {\n processFill(metadataState: PluginStatusProcessing): Promise<T>;\n\n commitProcessing(\n data: T,\n metadataState: PluginStatusProcessed\n ): number | void;\n}\n\nasync function fillProcessing<T>(\n blockId: number,\n cesdk: CreativeEditorSDK,\n metadata: FillProcessingMetadata,\n processor: FillProcessor<T>\n) {\n const blockApi = cesdk.engine.block;\n if (!blockApi.hasFill(blockId))\n throw new Error('Block does not support fill');\n\n const fillId = blockApi.getFill(blockId);\n\n // Get the current image URI and source set as initial values.\n const initialSourceSet = blockApi.getSourceSet(\n fillId,\n 'fill/image/sourceSet'\n );\n const initialImageFileURI = blockApi.getString(\n fillId,\n 'fill/image/imageFileURI'\n );\n const initialPreviewFileURI = blockApi.getString(\n fillId,\n 'fill/image/previewFileURI'\n );\n try {\n cesdk.engine.block.setState(fillId, {\n type: 'Pending',\n progress: 0\n });\n\n const status: PluginStatusProcessing = {\n ...metadata.get(blockId),\n version: PLUGIN_VERSION,\n initialSourceSet,\n initialImageFileURI,\n initialPreviewFileURI,\n blockId,\n fillId,\n status: 'PROCESSING'\n };\n\n metadata.set(blockId, status);\n\n const processedData = await processor.processFill(status);\n // Check for externally changed state while we were applying the mask and\n // do not proceed if the state was reset.\n if (\n metadata.get(blockId).status !== 'PROCESSING' ||\n !metadata.isConsistent(blockId)\n )\n return;\n\n // Check for externally changed state while we were uploading and\n // do not proceed if the state was reset.\n if (\n metadata.get(blockId).status !== 'PROCESSING' ||\n !metadata.isConsistent(blockId)\n )\n return;\n\n if (processedData == null) return;\n\n const metadataStateProcessed: PluginStatusProcessed = {\n version: PLUGIN_VERSION,\n initialSourceSet,\n initialImageFileURI,\n initialPreviewFileURI,\n blockId,\n fillId,\n status: 'PROCESSED'\n };\n\n const blockIdOrVoid = processor.commitProcessing(\n processedData,\n metadataStateProcessed\n );\n\n // If a new block was created, we do not update the metadata.\n if (blockIdOrVoid == null || blockIdOrVoid === blockId) {\n metadata.set(blockId, metadataStateProcessed);\n }\n\n // Finally, create an undo step\n cesdk.engine.editor.addUndoStep();\n } catch (error) {\n if (cesdk.engine.block.isValid(blockId)) {\n metadata.set(blockId, {\n version: PLUGIN_VERSION,\n initialSourceSet,\n initialImageFileURI,\n initialPreviewFileURI,\n blockId,\n fillId,\n status: 'ERROR'\n });\n\n metadata.recoverInitialImageData(blockId);\n }\n\n if (\n error != null &&\n typeof error === 'object' &&\n 'message' in error &&\n typeof error.message === 'string'\n ) {\n const message =\n error.message === 'signal timed out'\n ? 'Processing canceled due to timeout'\n : error.message;\n cesdk.ui.showNotification({\n type: 'error',\n message\n });\n }\n\n // eslint-disable-next-line no-console\n console.log(error);\n } finally {\n if (cesdk.engine.block.isValid(fillId)) {\n cesdk.engine.block.setState(fillId, { type: 'Ready' });\n }\n }\n}\n\nexport default fillProcessing;\n", "export function getFeatureId(pluginId: string): string {\n return `${pluginId}.fillProcessing.feature`;\n}\n\nexport function getCanvasMenuComponentIds(pluginId: string): string[] {\n return [`${pluginId}.canvasMenu`, `${pluginId}.fillProcessing.canvasMenu`];\n}\n\nexport function getDockComponentIds(pluginId: string): string[] {\n return [`${pluginId}.dock`, `${pluginId}.fillProcessing.dock`];\n}\n\nexport function getInspectorBarComponentIds(pluginId: string): string[] {\n return [\n `${pluginId}.inspectorBar`,\n `${pluginId}.fillProcessing.inspectorBar`\n ];\n}\n\nexport function getNavigationBarComponentIds(pluginId: string): string[] {\n return [\n `${pluginId}.navigationBar`,\n `${pluginId}.fillProcessing.navigationBar`\n ];\n}\n\nexport function getCanvasBarComponentIds(pluginId: string): string[] {\n return [`${pluginId}.canvasBar`, `${pluginId}.fillProcessing.canvasBar`];\n}\n\nexport function getI18nCanvasMenuLabel(pluginId: string): string {\n return `plugin.${pluginId}.fillProcessing.canvasMenu.button.label`;\n}\n\nexport function getI18nDockLabel(pluginId: string): string {\n return `plugin.${pluginId}.fillProcessing.dock.button.label`;\n}\n\nexport function getI18nInspectorBarLabel(pluginId: string): string {\n return `plugin.${pluginId}.fillProcessing.inspectorBar.button.label`;\n}\n\nexport function getI18nNavigationBarLabel(pluginId: string): string {\n return `plugin.${pluginId}.fillProcessing.navigationBar.button.label`;\n}\n\nexport function getI18nCanvasBarLabel(pluginId: string): string {\n return `plugin.${pluginId}.fillProcessing.canvasBar.button.label`;\n}\n", "import type CreativeEditorSDK from '@cesdk/cesdk-js';\n\nimport { FillProcessingMetadata } from '..';\nimport { getFeatureId } from './constants';\n\nexport default function handleFillProcessing(\n cesdk: CreativeEditorSDK,\n {\n pluginId,\n process\n }: {\n pluginId: string;\n icon?: string;\n process: (blockId: number, metadata: FillProcessingMetadata) => void;\n }\n): {\n featureId: string;\n} {\n const featureId = getFeatureId(pluginId);\n\n const metadata = new FillProcessingMetadata(cesdk.engine, pluginId);\n\n enableFeatures(cesdk, metadata, featureId);\n\n cesdk.engine.event.subscribe([], async (events) => {\n events.forEach((e) => {\n const id = e.block;\n if (!cesdk.engine.block.isValid(id) || !metadata.hasData(id)) {\n return;\n }\n\n if (e.type === 'Created') {\n if (metadata.isDuplicate(id)) {\n metadata.fixDuplicate(id);\n }\n } else if (e.type === 'Updated') {\n switch (metadata.get(id).status) {\n case 'PENDING': {\n if (\n cesdk.feature.isEnabled(featureId, {\n engine: cesdk.engine\n }) &&\n cesdk.engine.block.isAllowedByScope(id, 'fill/change') &&\n cesdk.engine.block.getState(id).type !== 'Pending'\n ) {\n process(id, metadata);\n }\n break;\n }\n\n case 'PROCESSING':\n case 'PROCESSED': {\n if (!metadata.isConsistent(id)) {\n metadata.clear(id);\n }\n break;\n }\n\n default: {\n // We do not care about other states\n }\n }\n }\n });\n });\n\n return { featureId };\n}\n\n/**\n * Defines the feature that determines in which context (on which block)\n * fill processing is allowed/enabled.\n */\nfunction enableFeatures(\n cesdk: CreativeEditorSDK,\n metadata: FillProcessingMetadata,\n featureId: string\n) {\n cesdk.feature.enable(featureId, ({ engine }) => {\n const selectedIds = engine.block.findAllSelected();\n if (selectedIds.length !== 1) {\n return false;\n }\n const [selectedId] = selectedIds;\n\n if (!cesdk.engine.block.isVisible(selectedId)) return false;\n\n if (cesdk.engine.block.hasFill(selectedId)) {\n const kind = cesdk.engine.block.getKind(selectedId);\n if (kind === 'sticker') return false;\n\n const fillId = cesdk.engine.block.getFill(selectedId);\n const fillType = cesdk.engine.block.getType(fillId);\n\n if (fillType !== '//ly.img.ubq/fill/image') {\n return false;\n }\n\n const fileUri = engine.block.getString(fillId, 'fill/image/imageFileURI');\n const sourceSet = engine.block.getSourceSet(\n fillId,\n 'fill/image/sourceSet'\n );\n\n if (sourceSet.length > 0 || fileUri !== '') return true;\n\n // If we are in a processing state we do not have a imageFileURI or\n // source set set (to show the loading spinner), but the feature is still\n // enabled.\n return metadata.get(selectedId).status === 'PROCESSING';\n }\n\n return false;\n });\n}\n", "import CreativeEditorSDK from '@cesdk/cesdk-js';\nimport { FillProcessingMetadata } from '..';\nimport {\n getCanvasBarComponentIds,\n getCanvasMenuComponentIds,\n getDockComponentIds,\n getFeatureId,\n getI18nCanvasBarLabel,\n getI18nCanvasMenuLabel,\n getI18nDockLabel,\n getI18nInspectorBarLabel,\n getI18nNavigationBarLabel,\n getInspectorBarComponentIds,\n getNavigationBarComponentIds\n} from './constants';\n\nexport type Location =\n | 'inspectorBar'\n | 'navigationBar'\n | 'canvasBarTop'\n | 'canvasBarBottom'\n | 'canvasMenu'\n | 'dock';\n\n/**\n * Registers the components that can be used to process the fill of\n * a block.\n */\nexport default function registerFillProcessingComponents(\n cesdk: CreativeEditorSDK,\n options: {\n pluginId: string;\n icon?: string;\n locations?: Location | Location[];\n }\n): {\n canvasMenuComponentId: string;\n dockComponentId: string;\n\n translationsKeys: {\n inspectorBarLabel: string;\n navigationBarLabel: string;\n canvasBarLabel: string;\n canvasMenuLabel: string;\n dockLabel: string;\n };\n} {\n const { pluginId, locations } = options;\n const metadata = new FillProcessingMetadata(cesdk.engine, pluginId);\n\n const canvasMenuLabel = getI18nCanvasMenuLabel(pluginId);\n const canvasMenuComponentIds = getCanvasMenuComponentIds(pluginId);\n const canvasMenuComponentId = canvasMenuComponentIds[0];\n\n const dockLabel = getI18nDockLabel(pluginId);\n const dockComponentIds = getDockComponentIds(pluginId);\n const dockComponentId = dockComponentIds[0];\n\n const inspectorBarLabel = getI18nInspectorBarLabel(pluginId);\n const inspectorBarComponentIds = getInspectorBarComponentIds(pluginId);\n const inspectorBarComponentId = inspectorBarComponentIds[0];\n\n const navigationBarLabel = getI18nNavigationBarLabel(pluginId);\n const navigationBarComponentIds = getNavigationBarComponentIds(pluginId);\n const navigationBarComponentId = navigationBarComponentIds[0];\n\n const canvasBarLabel = getI18nCanvasBarLabel(pluginId);\n const canvasBarComponentIds = getCanvasBarComponentIds(pluginId);\n const canvasBarComponentId = canvasBarComponentIds[0];\n\n const featureId = getFeatureId(pluginId);\n\n if (locations?.includes('inspectorBar')) {\n cesdk.ui.setInspectorBarOrder([\n inspectorBarComponentId,\n ...cesdk.ui.getInspectorBarOrder()\n ]);\n }\n\n if (locations?.includes('navigationBar')) {\n cesdk.ui.setNavigationBarOrder([\n navigationBarComponentId,\n ...cesdk.ui.getNavigationBarOrder()\n ]);\n }\n\n if (locations?.includes('canvasBarTop')) {\n cesdk.ui.setCanvasBarOrder(\n [canvasBarComponentId, ...cesdk.ui.getCanvasBarOrder('top')],\n 'top'\n );\n }\n\n if (locations?.includes('canvasBarBottom')) {\n cesdk.ui.setCanvasBarOrder(\n [canvasBarComponentId, ...cesdk.ui.getCanvasBarOrder('bottom')],\n 'bottom'\n );\n }\n\n if (locations?.includes('canvasMenu')) {\n cesdk.ui.setCanvasMenuOrder([\n canvasMenuComponentId,\n ...cesdk.ui.getCanvasMenuOrder()\n ]);\n }\n\n if (locations?.includes('dock')) {\n cesdk.ui.setDockOrder([...cesdk.ui.getDockOrder(), dockComponentId]);\n }\n\n cesdk.ui.registerComponent(\n dockComponentIds,\n ({ builder: { Button }, engine }) => {\n const [id] = engine.block.findAllSelected();\n\n let isDisabled = false;\n let isLoading = false;\n let loadingProgress: number | undefined;\n\n if (id == null) {\n isDisabled = true;\n }\n\n if (\n !isDisabled &&\n !cesdk.feature.isEnabled(featureId, {\n engine\n })\n ) {\n isDisabled = true;\n }\n\n if (\n !isDisabled &&\n !cesdk.engine.block.isAllowedByScope(id, 'fill/change')\n ) {\n isDisabled = true;\n }\n\n if (!isDisabled && engine.block.getState(id)?.type === 'Pending') {\n isDisabled = true;\n }\n\n if (!isDisabled) {\n const currentMetadata = metadata.get(id);\n\n isLoading = currentMetadata.status === 'PROCESSING';\n isDisabled =\n currentMetadata.status === 'PENDING' ||\n currentMetadata.status === 'PROCESSING';\n\n if (\n currentMetadata.status === 'PROCESSING' &&\n currentMetadata.progress\n ) {\n const { current, total } = currentMetadata.progress;\n loadingProgress = (current / total) * 100;\n }\n }\n\n const buttonId = `${dockComponentId}.button`;\n Button(buttonId, {\n label: dockLabel,\n icon: options.icon,\n isLoading,\n isDisabled,\n loadingProgress,\n onClick: () => {\n const currentMetadata = metadata.get(id);\n\n if (\n currentMetadata.status === 'IDLE' ||\n currentMetadata.status === 'ERROR' ||\n currentMetadata.status === 'PROCESSED'\n ) {\n metadata.set(id, {\n status: 'PENDING'\n });\n }\n }\n });\n }\n );\n\n const buttonComponents: {\n componentIds: string[];\n label: string;\n variant: 'plain' | 'regular';\n }[] = [\n {\n componentIds: inspectorBarComponentIds,\n variant: 'plain',\n label: inspectorBarLabel\n },\n {\n componentIds: navigationBarComponentIds,\n variant: 'regular',\n label: navigationBarLabel\n },\n {\n componentIds: canvasBarComponentIds,\n variant: 'regular',\n label: canvasBarLabel\n },\n {\n componentIds: canvasMenuComponentIds,\n variant: 'plain',\n label: canvasMenuLabel\n }\n ];\n\n buttonComponents.forEach(({ componentIds, label, variant }) => {\n const componentId = componentIds[0];\n cesdk.ui.registerComponent(\n componentIds,\n ({ builder: { Button }, engine }) => {\n if (\n !cesdk.feature.isEnabled(featureId, {\n engine\n })\n ) {\n return;\n }\n\n const [id] = engine.block.findAllSelected();\n\n if (!cesdk.engine.block.isAllowedByScope(id, 'fill/change')) return;\n\n const currentMetadata = metadata.get(id);\n\n const isLoading = currentMetadata.status === 'PROCESSING';\n const isDisabled =\n currentMetadata.status === 'PENDING' ||\n currentMetadata.status === 'PROCESSING' ||\n engine.block.getState(id)?.type === 'Pending';\n\n let loadingProgress: number | undefined;\n if (isLoading && currentMetadata.progress) {\n const { current, total } = currentMetadata.progress;\n loadingProgress = (current / total) * 100;\n }\n\n const buttonId = `${componentId}.button`;\n Button(buttonId, {\n icon: options.icon,\n label,\n variant,\n isLoading,\n isDisabled,\n loadingProgress,\n onClick: () => {\n if (\n currentMetadata.status === 'IDLE' ||\n currentMetadata.status === 'ERROR' ||\n currentMetadata.status === 'PROCESSED'\n ) {\n metadata.set(id, {\n status: 'PENDING'\n });\n }\n }\n });\n }\n );\n });\n\n return {\n canvasMenuComponentId,\n dockComponentId,\n translationsKeys: {\n inspectorBarLabel,\n navigationBarLabel,\n canvasBarLabel,\n canvasMenuLabel,\n dockLabel\n }\n };\n}\n", "import { type RGBAColor } from '@cesdk/cesdk-js';\n\nconst HEX_COLOR_PATTERN = new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/, 'i');\nconst HEX_SINGLE_CHAR_COMPONENTS_PATTERN = new RegExp(/[A-Fa-f0-9]{1}/, 'g');\nconst HEX_DOUBLE_CHAR_COMPONENTS_PATTERN = new RegExp(/[A-Fa-f0-9]{2}/, 'g');\n\n/** @public */\nexport const rgbaToHex = (rgba: RGBAColor, includeAlpha = false): string => {\n const { r, g, b, a } = rgba;\n const rByte = Math.round(255 * r);\n const gByte = Math.round(255 * g);\n const bByte = Math.round(255 * b);\n const aByte = Math.round(255 * a);\n const byteToHex = (byte: number) => {\n return byte.toString(16).padStart(2, '0');\n };\n return `#${byteToHex(rByte)}${byteToHex(gByte)}${byteToHex(bByte)}${\n includeAlpha ? byteToHex(aByte) : ''\n }`;\n};\n\n/** @public */\nexport const hexToRgba = (hexString: string): RGBAColor => {\n const rgbaHexToColor = (\n r: string,\n g: string,\n b: string,\n a: string | undefined,\n max: number\n ) => {\n return {\n r: parseInt(r, 16) / max,\n g: parseInt(g, 16) / max,\n b: parseInt(b, 16) / max,\n a: a === undefined ? 1 : parseInt(a, 16) / max\n };\n };\n\n if (hexString.startsWith('#')) {\n if (hexString.length === 4 || hexString.length === 5) {\n const hexMatch = hexString.match(HEX_SINGLE_CHAR_COMPONENTS_PATTERN);\n if (hexMatch) {\n const [r, g, b, a] = hexMatch;\n return rgbaHexToColor(r, g, b, a, 15);\n }\n }\n if (hexString.length === 7 || hexString.length === 8) {\n const hexMatch = hexString.match(HEX_DOUBLE_CHAR_COMPONENTS_PATTERN);\n if (hexMatch) {\n const [r, g, b, a] = hexMatch;\n return rgbaHexToColor(r, g, b, a, 255);\n }\n }\n }\n\n throw new Error(\n 'Invalid hex string! Allowed RGB formats are \"#FFF\" and \"#FFFFFF\". Allowed RGBA formats are \"#FFFF\" and \"#FFFFFFFF'\n );\n};\n\n/** @public */\nexport const isValidHexColor = (hexString: string): boolean => {\n return HEX_COLOR_PATTERN.test(hexString);\n};\n", "import type CreativeEditorSDK from '@cesdk/cesdk-js';\nimport { CreativeEngine } from '@cesdk/cesdk-js';\n\n/**\n * Uploads a blob with the help of CE.SDK\n */\nexport async function uploadBlob(\n blob: Blob,\n initialUri: string,\n cesdk: CreativeEditorSDK\n) {\n const pathname = new URL(initialUri).pathname;\n const parts = pathname.split('/');\n const extension = mimeTypeToExtension(blob.type);\n const filename = parts[parts.length - 1]?.split('.')?.[0] ?? 'asset';\n const filenameWithExtension = `${filename}.${extension}`;\n\n const uploadedAssets = await cesdk.unstable_upload(\n new File([blob], filenameWithExtension, { type: blob.type }),\n () => {\n // TODO Delegate process to UI component\n }\n );\n\n const url = uploadedAssets.meta?.uri;\n if (url == null) {\n throw new Error('Could not upload processed fill');\n }\n return url;\n}\n\n/**\n * Returns the file extension for a given mime type.\n */\nexport function mimeTypeToExtension(mimeType: string): string {\n const extensions: Record<string, string> = {\n 'image/png': 'png',\n 'image/jpeg': 'jpg',\n 'image/webp': 'webp',\n 'image/gif': 'gif',\n 'image/svg+xml': 'svg'\n };\n return extensions[mimeType] ?? 'png';\n}\n\nexport async function fetchImageBlob(uri: string): Promise<Blob> {\n return fetch(uri).then((response) => response.blob());\n}\n\n/**\n * Converts a buffer URI to a object url.\n */\nexport async function bufferURIToObjectURL(\n uri: string,\n engine: CreativeEngine\n): Promise<string> {\n if (uri.startsWith('buffer:')) {\n const mimeType = await engine.editor.getMimeType(uri);\n const length = engine.editor.getBufferLength(uri);\n const data = engine.editor.getBufferData(uri, 0, length);\n const buffer = new Uint8Array(data);\n const blob = new Blob([buffer], { type: mimeType });\n return URL.createObjectURL(blob);\n } else {\n return uri;\n }\n}\n", "function uuid4() {\n /* eslint-disable no-bitwise */\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n /* eslint-enable no-bitwise */\n });\n}\n\nexport default uuid4;\n", "import { bufferURIToObjectURL } from './upload';\nimport { type CreativeEngine } from '@cesdk/cesdk-js';\n\n/**\n * Get the dimensions of an image from its URL\n *\n * @param url - The URL of the image\n * @returns A promise that resolves to an object containing the width and height of the image\n */\nexport async function getImageDimensionsFromURL(\n url: string,\n engine: CreativeEngine\n): Promise<{ width: number; height: number }> {\n const resolvedUrl = await bufferURIToObjectURL(url, engine);\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => {\n resolve({ width: img.width, height: img.height });\n };\n img.onerror = reject;\n img.src = resolvedUrl;\n });\n}\n\n/**\n * Get the URI of an image from a block ID, either the first source of a source set or\n * the image file URI. Will handle buffer URIs and convert them to object URLs.\n */\nexport async function getImageUri(\n blockId: number,\n engine: CreativeEngine,\n options?: { throwErrorIfSvg?: boolean }\n): Promise<string> {\n let uri;\n const fillBlock = engine.block.getFill(blockId);\n const sourceSet = engine.block.getSourceSet(\n fillBlock,\n 'fill/image/sourceSet'\n );\n const [source] = sourceSet;\n if (source == null) {\n uri = engine.block.getString(fillBlock, 'fill/image/imageFileURI');\n if (uri == null) throw new Error('No image source/uri found');\n } else {\n uri = source.uri;\n }\n\n // Check if the image is SVG (not supported)\n if (options?.throwErrorIfSvg) {\n const mimeType = await engine.editor.getMimeType(uri);\n if (mimeType === 'image/svg+xml') {\n throw new Error('SVG images are not supported');\n }\n }\n\n return bufferURIToObjectURL(uri, engine);\n}\n\n/**\n * Returns if the given fill block is an SVG image fill.\n */\nexport async function isSvgFill(\n fillBlock: number,\n engine: CreativeEngine\n): Promise<boolean> {\n if (engine.block.getType(fillBlock) !== '//ly.img.ubq/fill/image') {\n return false;\n }\n\n let uri;\n const sourceSet = engine.block.getSourceSet(\n fillBlock,\n 'fill/image/sourceSet'\n );\n const [source] = sourceSet;\n if (source == null) {\n uri = engine.block.getString(fillBlock, 'fill/image/imageFileURI');\n if (uri == null) return false;\n } else {\n uri = source.uri;\n }\n\n const mimeType = await engine.editor.getMimeType(uri);\n return mimeType === 'image/svg+xml';\n}\n", "/**\n * Checks if a value is defined (not undefined).\n *\n * Helpful to filter out undefined values from an array or collection\n * while keeping the type information intact.\n *\n * ```\n * array.filter(isDefined)\n * ```\n */\nfunction isDefined<T>(value: T | undefined): value is T {\n return value !== undefined;\n}\n\nexport default isDefined;\n", "/**\n * Converts a value to an array format.\n *\n * @template T The type of the array elements\n * @param value - The value to convert. Can be a single item, an array, null, or undefined\n * @returns An array containing the value(s). Returns empty array if value is null/undefined,\n * the original array if value is already an array, or a single-element array if value is a single item\n *\n * @example\n * ```typescript\n * toArray('hello') // ['hello']\n * toArray(['a', 'b']) // ['a', 'b']\n * toArray(null) // []\n * toArray(undefined) // []\n * toArray(42) // [42]\n * ```\n */\nfunction toArray<T>(value?: T | T[]): T[] {\n if (value == null) return [];\n return Array.isArray(value) ? value : [value];\n}\n\nexport default toArray;\n", "/**\n * Interface for objects that have translation capabilities\n */\ninterface TranslationAPI {\n translate(key: string | string[]): string;\n}\n\n/**\n * Check if CE.SDK supports the translate API (version 1.59.0 or higher)\n * @param cesdk - The CE.SDK instance to check\n * @returns True if the translate API is supported\n */\nexport function supportsTranslateAPI(cesdk: any): boolean {\n if (!cesdk?.version) return false;\n\n // Use localeCompare for semantic version comparison\n // Returns >= 0 when cesdk.version is 1.59.0 or higher\n const comparison = cesdk.version.localeCompare('1.59.0', undefined, {\n numeric: true,\n sensitivity: 'base'\n });\n\n return comparison >= 0 && typeof cesdk.i18n?.translate === 'function';\n}\n\n/**\n * Type guard to check if an object has the translate API\n * @param i18n - The object to check\n * @returns True if the object has a translate function\n */\nexport function hasTranslateAPI(i18n: any): i18n is TranslationAPI {\n return typeof i18n?.translate === 'function';\n}\n\n/**\n * Safely translate a key with CE.SDK version compatibility check.\n * Returns the translation if supported (CE.SDK >= 1.59.0), otherwise returns the fallback.\n *\n * @param cesdk - The CE.SDK instance\n * @param translationKey - The translation key to translate\n * @param fallback - The fallback value to use if translation is not supported or key is not found\n * @returns The translated string or fallback\n */\nexport function translateWithFallback(\n cesdk: any,\n translationKey: string | string[],\n fallback: string\n): string {\n if (!cesdk) {\n return fallback;\n }\n\n // Check if CE.SDK supports translation API (version 1.59.0+)\n if (supportsTranslateAPI(cesdk) && hasTranslateAPI(cesdk.i18n)) {\n return cesdk.i18n.translate(translationKey);\n }\n\n return fallback;\n}\n", "import formatsIconSprite from './icons/formats';\n\nconst Icons = {\n Formats: formatsIconSprite\n};\n\nexport { Icons };\n\nexport {\n CustomAssetSource,\n type CustomAssetSourceOptions,\n type SelectValue\n} from './assetSources/CustomAssetSource';\n\nexport { IndexedDBAssetSource } from './assetSources/IndexedDBAssetSource';\n\nexport { AggregatedAssetSource } from './assetSources/AggregatedAssetSource';\n\nexport { default as Metadata } from './metadata/Metadata';\n\nexport { default as FillProcessingMetadata } from './metadata/FillProcessingMetadata';\n\nexport { default as fillProcessing } from './processing/fillProcessing';\n\nexport { default as initializeFillProcessing } from './processing/initializeFillProcessing';\n\nexport { default as registerFillProcessingComponents } from './processing/registerFillProcessingComponents';\n\nexport { type Optional } from './types/Optional';\n\nexport {\n type Location,\n type UserInterfaceConfiguration\n} from './types/UserInterfaceConfiguration';\n\nexport { hexToRgba, isValidHexColor, rgbaToHex } from './utils/colors';\n\nexport {\n uploadBlob,\n fetchImageBlob,\n bufferURIToObjectURL,\n mimeTypeToExtension\n} from './utils/upload';\n\nexport { default as uuid } from './utils/uuid';\n\nexport {\n getImageDimensionsFromURL,\n getImageUri,\n isSvgFill\n} from './utils/images';\n\nexport { default as isDefined } from './utils/isDefined';\n\nexport { default as toArray } from './utils/toArray';\n\nexport {\n supportsTranslateAPI,\n hasTranslateAPI,\n translateWithFallback\n} from './translationHelpers';\n", "/**\n * @license QR Code generator library (TypeScript)\n * Copyright (c) Project Nayuki.\n * SPDX-License-Identifier: MIT\n */\n\n\"use strict\";\n\n\nnamespace qrcodegen {\n\n\ttype bit = number;\n\ttype byte = number;\n\ttype int = number;\n\n\n\t/*---- QR Code symbol class ----*/\n\n\t/*\n\t * A QR Code symbol, which is a type of two-dimension barcode.\n\t * Invented by Denso Wave and described in the ISO/IEC 18004 standard.\n\t * Instances of this class represent an immutable square grid of dark and light cells.\n\t * The class provides static factory functions to create a QR Code from text or binary data.\n\t * The class covers the QR Code Model 2 specification, supporting all versions (sizes)\n\t * from 1 to 40, all 4 error correction levels, and 4 character encoding modes.\n\t *\n\t * Ways to create a QR Code object:\n\t * - High level: Take the payload data and call QrCode.encodeText() or QrCode.encodeBinary().\n\t * - Mid level: Custom-make the list of segments and call QrCode.encodeSegments().\n\t * - Low level: Custom-make the array of data codeword bytes (including\n\t * segment headers and final padding, excluding error correction codewords),\n\t * supply the appropriate version number, and call the QrCode() constructor.\n\t * (Note that all ways require supplying the desired error correction level.)\n\t */\n\texport class QrCode {\n\n\t\t/*-- Static factory functions (high level) --*/\n\n\t\t// Returns a QR Code representing the given Unicode text string at the given error correction level.\n\t\t// As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer\n\t\t// Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible\n\t\t// QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the\n\t\t// ecl argument if it can be done without increasing the version.\n\t\tpublic static encodeText(text: string, ecl: QrCode.Ecc): QrCode {\n\t\t\tconst segs: Array<QrSegment> = qrcodegen.QrSegment.makeSegments(text);\n\t\t\treturn QrCode.encodeSegments(segs, ecl);\n\t\t}\n\n\n\t\t// Returns a QR Code representing the given binary data at the given error correction level.\n\t\t// This function always encodes using the binary segment mode, not any text mode. The maximum number of\n\t\t// bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.\n\t\t// The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.\n\t\tpublic static encodeBinary(data: Readonly<Array<byte>>, ecl: QrCode.Ecc): QrCode {\n\t\t\tconst seg: QrSegment = qrcodegen.QrSegment.makeBytes(data);\n\t\t\treturn QrCode.encodeSegments([seg], ecl);\n\t\t}\n\n\n\t\t/*-- Static factory functions (mid level) --*/\n\n\t\t// Returns a QR Code representing the given segments with the given encoding parameters.\n\t\t// The smallest possible QR Code version within the given range is automatically\n\t\t// chosen for the output. Iff boostEcl is true, then the ECC level of the result\n\t\t// may be higher than the ecl argument if it can be done without increasing the\n\t\t// version. The mask number is either between 0 to 7 (inclusive) to force that\n\t\t// mask, or -1 to automatically choose an appropriate mask (which may be slow).\n\t\t// This function allows the user to create a custom sequence of segments that switches\n\t\t// between modes (such as alphanumeric and byte) to encode text in less space.\n\t\t// This is a mid-level API; the high-level API is encodeText() and encodeBinary().\n\t\tpublic static encodeSegments(segs: Readonly<Array<QrSegment>>, ecl: QrCode.Ecc,\n\t\t\t\tminVersion: int = 1, maxVersion: int = 40,\n\t\t\t\tmask: int = -1, boostEcl: boolean = true): QrCode {\n\n\t\t\tif (!(QrCode.MIN_VERSION <= minVersion && minVersion <= maxVersion && maxVersion <= QrCode.MAX_VERSION)\n\t\t\t\t\t|| mask < -1 || mask > 7)\n\t\t\t\tthrow new RangeError(\"Invalid value\");\n\n\t\t\t// Find the minimal version number to use\n\t\t\tlet version: int;\n\t\t\tlet dataUsedBits: int;\n\t\t\tfor (version = minVersion; ; version++) {\n\t\t\t\tconst dataCapacityBits: int = QrCode.getNumDataCodewords(version, ecl) * 8; // Number of data bits available\n\t\t\t\tconst usedBits: number = QrSegment.getTotalBits(segs, version);\n\t\t\t\tif (usedBits <= dataCapacityBits) {\n\t\t\t\t\tdataUsedBits = usedBits;\n\t\t\t\t\tbreak; // This version number is found to be suitable\n\t\t\t\t}\n\t\t\t\tif (version >= maxVersion) // All versions in the range could not fit the given data\n\t\t\t\t\tthrow new RangeError(\"Data too long\");\n\t\t\t}\n\n\t\t\t// Increase the error correction level while the data still fits in the current version number\n\t\t\tfor (const newEcl of [QrCode.Ecc.MEDIUM, QrCode.Ecc.QUARTILE, QrCode.Ecc.HIGH]) { // From low to high\n\t\t\t\tif (boostEcl && dataUsedBits <= QrCode.getNumDataCodewords(version, newEcl) * 8)\n\t\t\t\t\tecl = newEcl;\n\t\t\t}\n\n\t\t\t// Concatenate all segments to create the data bit string\n\t\t\tlet bb: Array<bit> = []\n\t\t\tfor (const seg of segs) {\n\t\t\t\tappendBits(seg.mode.modeBits, 4, bb);\n\t\t\t\tappendBits(seg.numChars, seg.mode.numCharCountBits(version), bb);\n\t\t\t\tfor (const b of seg.getData())\n\t\t\t\t\tbb.push(b);\n\t\t\t}\n\t\t\tassert(bb.length == dataUsedBits);\n\n\t\t\t// Add terminator and pad up to a byte if applicable\n\t\t\tconst dataCapacityBits: int = QrCode.getNumDataCodewords(version, ecl) * 8;\n\t\t\tassert(bb.length <= dataCapacityBits);\n\t\t\tappendBits(0, Math.min(4, dataCapacityBits - bb.length), bb);\n\t\t\tappendBits(0, (8 - bb.length % 8) % 8, bb);\n\t\t\tassert(bb.length % 8 == 0);\n\n\t\t\t// Pad with alternating bytes until data capacity is reached\n\t\t\tfor (let padByte = 0xEC; bb.length < dataCapacityBits; padByte ^= 0xEC ^ 0x11)\n\t\t\t\tappendBits(padByte, 8, bb);\n\n\t\t\t// Pack bits into bytes in big endian\n\t\t\tlet dataCodewords: Array<byte> = [];\n\t\t\twhile (dataCodewords.length * 8 < bb.length)\n\t\t\t\tdataCodewords.push(0);\n\t\t\tbb.forEach((b: bit, i: int) =>\n\t\t\t\tdataCodewords[i >>> 3] |= b << (7 - (i & 7)));\n\n\t\t\t// Create the QR Code object\n\t\t\treturn new QrCode(version, ecl, dataCodewords, mask);\n\t\t}\n\n\n\t\t/*-- Fields --*/\n\n\t\t// The width and height of this QR Code, measured in modules, between\n\t\t// 21 and 177 (inclusive). This is equal to version * 4 + 17.\n\t\tpublic readonly size: int;\n\n\t\t// The index of the mask pattern used in this QR Code, which is between 0 and 7 (inclusive).\n\t\t// Even if a QR Code is created with automatic masking requested (mask = -1),\n\t\t// the resulting object still has a mask value between 0 and 7.\n\t\tpublic readonly mask: int;\n\n\t\t// The modules of this QR Code (false = light, true = dark).\n\t\t// Immutable after constructor finishes. Accessed through getModule().\n\t\tprivate readonly modules : Array<Array<boolean>> = [];\n\n\t\t// Indicates function modules that are not subjected to masking. Discarded when constructor finishes.\n\t\tprivate readonly isFunction: Array<Array<boolean>> = [];\n\n\n\t\t/*-- Constructor (low level) and fields --*/\n\n\t\t// Creates a new QR Code with the given version number,\n\t\t// error correction level, data codeword bytes, and mask number.\n\t\t// This is a low-level API that most users should not use directly.\n\t\t// A mid-level API is the encodeSegments() function.\n\t\tpublic constructor(\n\t\t\t\t// The version number of this QR Code, which is between 1 and 40 (inclusive).\n\t\t\t\t// This determines the size of this barcode.\n\t\t\t\tpublic readonly version: int,\n\n\t\t\t\t// The error correction level used in this QR Code.\n\t\t\t\tpublic readonly errorCorrectionLevel: QrCode.Ecc,\n\n\t\t\t\tdataCodewords: Readonly<Array<byte>>,\n\n\t\t\t\tmsk: int) {\n\n\t\t\t// Check scalar arguments\n\t\t\tif (version < QrCode.MIN_VERSION || version > QrCode.MAX_VERSION)\n\t\t\t\tthrow new RangeError(\"Version value out of range\");\n\t\t\tif (msk < -1 || msk > 7)\n\t\t\t\tthrow new RangeError(\"Mask value out of range\");\n\t\t\tthis.size = version * 4 + 17;\n\n\t\t\t// Initialize both grids to be size*size arrays of Boolean false\n\t\t\tlet row: Array<boolean> = [];\n\t\t\tfor (let i = 0; i < this.size; i++)\n\t\t\t\trow.push(false);\n\t\t\tfor (let i = 0; i < this.size; i++) {\n\t\t\t\tthis.modules .push(row.slice()); // Initially all light\n\t\t\t\tthis.isFunction.push(row.slice());\n\t\t\t}\n\n\t\t\t// Compute ECC, draw modules\n\t\t\tthis.drawFunctionPatterns();\n\t\t\tconst allCodewords: Array<byte> = this.addEccAndInterleave(dataCodewords);\n\t\t\tthis.drawCodewords(allCodewords);\n\n\t\t\t// Do masking\n\t\t\tif (msk == -1) { // Automatically choose best mask\n\t\t\t\tlet minPenalty: int = 1000000000;\n\t\t\t\tfor (let i = 0; i < 8; i++) {\n\t\t\t\t\tthis.applyMask(i);\n\t\t\t\t\tthis.drawFormatBits(i);\n\t\t\t\t\tconst penalty: int = this.getPenaltyScore();\n\t\t\t\t\tif (penalty < minPenalty) {\n\t\t\t\t\t\tmsk = i;\n\t\t\t\t\t\tminPenalty = penalty;\n\t\t\t\t\t}\n\t\t\t\t\tthis.applyMask(i); // Undoes the mask due to XOR\n\t\t\t\t}\n\t\t\t}\n\t\t\tassert(0 <= msk && msk <= 7);\n\t\t\tthis.mask = msk;\n\t\t\tthis.applyMask(msk); // Apply the final choice of mask\n\t\t\tthis.drawFormatBits(msk); // Overwrite old format bits\n\n\t\t\tthis.isFunction = [];\n\t\t}\n\n\n\t\t/*-- Accessor methods --*/\n\n\t\t// Returns the color of the module (pixel) at the given coordinates, which is false\n\t\t// for light or true for dark. The top left corner has the coordinates (x=0, y=0).\n\t\t// If the given coordinates are out of bounds, then false (light) is returned.\n\t\tpublic getModule(x: int, y: int): boolean {\n\t\t\treturn 0 <= x && x < this.size && 0 <= y && y < this.size && this.modules[y][x];\n\t\t}\n\n // Modified to expose modules for easy access\n public getModules() {\n return this.modules;\n }\n\n\n\t\t/*-- Private helper methods for constructor: Drawing function modules --*/\n\n\t\t// Reads this object's version field, and draws and marks all function modules.\n\t\tprivate drawFunctionPatterns(): void {\n\t\t\t// Draw horizontal and vertical timing patterns\n\t\t\tfor (let i = 0; i < this.size; i++) {\n\t\t\t\tthis.setFunctionModule(6, i, i % 2 == 0);\n\t\t\t\tthis.setFunctionModule(i, 6, i % 2 == 0);\n\t\t\t}\n\n\t\t\t// Draw 3 finder patterns (all corners except bottom right; overwrites some timing modules)\n\t\t\tthis.drawFinderPattern(3, 3);\n\t\t\tthis.drawFinderPattern(this.size - 4, 3);\n\t\t\tthis.drawFinderPattern(3, this.size - 4);\n\n\t\t\t// Draw numerous alignment patterns\n\t\t\tconst alignPatPos: Array<int> = this.getAlignmentPatternPositions();\n\t\t\tconst numAlign: int = alignPatPos.length;\n\t\t\tfor (let i = 0; i < numAlign; i++) {\n\t\t\t\tfor (let j = 0; j < numAlign; j++) {\n\t\t\t\t\t// Don't draw on the three finder corners\n\t\t\t\t\tif (!(i == 0 && j == 0 || i == 0 && j == numAlign - 1 || i == numAlign - 1 && j == 0))\n\t\t\t\t\t\tthis.drawAlignmentPattern(alignPatPos[i], alignPatPos[j]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Draw configuration data\n\t\t\tthis.drawFormatBits(0); // Dummy mask value; overwritten later in the constructor\n\t\t\tthis.drawVersion();\n\t\t}\n\n\n\t\t// Draws two copies of the format bits (with its own error correction code)\n\t\t// based on the given mask and this object's error correction level field.\n\t\tprivate drawFormatBits(mask: int): void {\n\t\t\t// Calculate error correction code and pack bits\n\t\t\tconst data: int = this.errorCorrectionLevel.formatBits << 3 | mask; // errCorrLvl is uint2, mask is uint3\n\t\t\tlet rem: int = data;\n\t\t\tfor (let i = 0; i < 10; i++)\n\t\t\t\trem = (rem << 1) ^ ((rem >>> 9) * 0x537);\n\t\t\tconst bits = (data << 10 | rem) ^ 0x5412; // uint15\n\t\t\tassert(bits >>> 15 == 0);\n\n\t\t\t// Draw first copy\n\t\t\tfor (let i = 0; i <= 5; i++)\n\t\t\t\tthis.setFunctionModule(8, i, getBit(bits, i));\n\t\t\tthis.setFunctionModule(8, 7, getBit(bits, 6));\n\t\t\tthis.setFunctionModule(8, 8, getBit(bits, 7));\n\t\t\tthis.setFunctionModule(7, 8, getBit(bits, 8));\n\t\t\tfor (let i = 9; i < 15; i++)\n\t\t\t\tthis.setFunctionModule(14 - i, 8, getBit(bits, i));\n\n\t\t\t// Draw second copy\n\t\t\tfor (let i = 0; i < 8; i++)\n\t\t\t\tthis.setFunctionModule(this.size - 1 - i, 8, getBit(bits, i));\n\t\t\tfor (let i = 8; i < 15; i++)\n\t\t\t\tthis.setFunctionModule(8, this.size - 15 + i, getBit(bits, i));\n\t\t\tthis.setFunctionModule(8, this.size - 8, true); // Always dark\n\t\t}\n\n\n\t\t// Draws two copies of the version bits (with its own error correction code),\n\t\t// based on this object's version field, iff 7 <= version <= 40.\n\t\tprivate drawVersion(): void {\n\t\t\tif (this.version < 7)\n\t\t\t\treturn;\n\n\t\t\t// Calculate error correction code and pack bits\n\t\t\tlet rem: int = this.version; // version is uint6, in the range [7, 40]\n\t\t\tfor (let i = 0; i < 12; i++)\n\t\t\t\trem = (rem << 1) ^ ((rem >>> 11) * 0x1F25);\n\t\t\tconst bits: int = this.version << 12 | rem; // uint18\n\t\t\tassert(bits >>> 18 == 0);\n\n\t\t\t// Draw two copies\n\t\t\tfor (let i = 0; i < 18; i++) {\n\t\t\t\tconst color: boolean = getBit(bits, i);\n\t\t\t\tconst a: int = this.size - 11 + i % 3;\n\t\t\t\tconst b: int = Math.floor(i / 3);\n\t\t\t\tthis.setFunctionModule(a, b, color);\n\t\t\t\tthis.setFunctionModule(b, a, color);\n\t\t\t}\n\t\t}\n\n\n\t\t// Draws a 9*9 finder pattern including the border separator,\n\t\t// with the center module at (x, y). Modules can be out of bounds.\n\t\tprivate drawFinderPattern(x: int, y: int): void {\n\t\t\tfor (let dy = -4; dy <= 4; dy++) {\n\t\t\t\tfor (let dx = -4; dx <= 4; dx++) {\n\t\t\t\t\tconst dist: int = Math.max(Math.abs(dx), Math.abs(dy)); // Chebyshev/infinity norm\n\t\t\t\t\tconst xx: int = x + dx;\n\t\t\t\t\tconst yy: int = y + dy;\n\t\t\t\t\tif (0 <= xx && xx < this.size && 0 <= yy && yy < this.size)\n\t\t\t\t\t\tthis.setFunctionModule(xx, yy, dist != 2 && dist != 4);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// Draws a 5*5 alignment pattern, with the center module\n\t\t// at (x, y). All modules must be in bounds.\n\t\tprivate drawAlignmentPattern(x: int, y: int): void {\n\t\t\tfor (let dy = -2; dy <= 2; dy++) {\n\t\t\t\tfor (let dx = -2; dx <= 2; dx++)\n\t\t\t\t\tthis.setFunctionModule(x + dx, y + dy, Math.max(Math.abs(dx), Math.abs(dy)) != 1);\n\t\t\t}\n\t\t}\n\n\n\t\t// Sets the color of a module and marks it as a function module.\n\t\t// Only used by the constructor. Coordinates must be in bounds.\n\t\tprivate setFunctionModule(x: int, y: int, isDark: boolean): void {\n\t\t\tthis.modules[y][x] = isDark;\n\t\t\tthis.isFunction[y][x] = true;\n\t\t}\n\n\n\t\t/*-- Private helper methods for constructor: Codewords and masking --*/\n\n\t\t// Returns a new byte string representing the given data with the appropriate error correction\n\t\t// codewords appended to it, based on this object's version and error correction level.\n\t\tprivate addEccAndInterleave(data: Readonly<Array<byte>>): Array<byte> {\n\t\t\tconst ver: int = this.version;\n\t\t\tconst ecl: QrCode.Ecc = this.errorCorrectionLevel;\n\t\t\tif (data.length != QrCode.getNumDataCodewords(ver, ecl))\n\t\t\t\tthrow new RangeError(\"Invalid argument\");\n\n\t\t\t// Calculate parameter numbers\n\t\t\tconst numBlocks: int = QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];\n\t\t\tconst blockEccLen: int = QrCode.ECC_CODEWORDS_PER_BLOCK [ecl.ordinal][ver];\n\t\t\tconst rawCodewords: int = Math.floor(QrCode.getNumRawDataModules(ver) / 8);\n\t\t\tconst numShortBlocks: int = numBlocks - rawCodewords % numBlocks;\n\t\t\tconst shortBlockLen: int = Math.floor(rawCodewords / numBlocks);\n\n\t\t\t// Split data into blocks and append ECC to each block\n\t\t\tlet blocks: Array<Array<byte>> = [];\n\t\t\tconst rsDiv: Array<byte> = QrCode.reedSolomonComputeDivisor(blockEccLen);\n\t\t\tfor (let i = 0, k = 0; i < numBlocks; i++) {\n\t\t\t\tlet dat: Array<byte> = data.slice(k, k + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1));\n\t\t\t\tk += dat.length;\n\t\t\t\tconst ecc: Array<byte> = QrCode.reedSolomonComputeRemainder(dat, rsDiv);\n\t\t\t\tif (i < numShortBlocks)\n\t\t\t\t\tdat.push(0);\n\t\t\t\tblocks.push(dat.concat(ecc));\n\t\t\t}\n\n\t\t\t// Interleave (not concatenate) the bytes from every block into a single sequence\n\t\t\tlet result: Array<byte> = [];\n\t\t\tfor (let i = 0; i < blocks[0].length; i++) {\n\t\t\t\tblocks.forEach((block, j) => {\n\t\t\t\t\t// Skip the padding byte in short blocks\n\t\t\t\t\tif (i != shortBlockLen - blockEccLen || j >= numShortBlocks)\n\t\t\t\t\t\tresult.push(block[i]);\n\t\t\t\t});\n\t\t\t}\n\t\t\tassert(result.length == rawCodewords);\n\t\t\treturn result;\n\t\t}\n\n\n\t\t// Draws the given sequence of 8-bit codewords (data and error correction) onto the entire\n\t\t// data area of this QR Code. Function modules need to be marked off before this is called.\n\t\tprivate drawCodewords(data: Readonly<Array<byte>>): void {\n\t\t\tif (data.length != Math.floor(QrCode.getNumRawDataModules(this.version) / 8))\n\t\t\t\tthrow new RangeError(\"Invalid argument\");\n\t\t\tlet i: int = 0; // Bit index into the data\n\t\t\t// Do the funny zigzag scan\n\t\t\tfor (let right = this.size - 1; right >= 1; right -= 2) { // Index of right column in each column pair\n\t\t\t\tif (right == 6)\n\t\t\t\t\tright = 5;\n\t\t\t\tfor (let vert = 0; vert < this.size; vert++) { // Vertical counter\n\t\t\t\t\tfor (let j = 0; j < 2; j++) {\n\t\t\t\t\t\tconst x: int = right - j; // Actual x coordinate\n\t\t\t\t\t\tconst upward: boolean = ((right + 1) & 2) == 0;\n\t\t\t\t\t\tconst y: int = upward ? this.size - 1 - vert : vert; // Actual y coordinate\n\t\t\t\t\t\tif (!this.isFunction[y][x] && i < data.length * 8) {\n\t\t\t\t\t\t\tthis.modules[y][x] = getBit(data[i >>> 3], 7 - (i & 7));\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If this QR Code has any remainder bits (0 to 7), they were assigned as\n\t\t\t\t\t\t// 0/false/light by the constructor and are left unchanged by this method\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tassert(i == data.length * 8);\n\t\t}\n\n\n\t\t// XORs the codeword modules in this QR Code with the given mask pattern.\n\t\t// The function modules must be marked and the codeword bits must be drawn\n\t\t// before masking. Due to the arithmetic of XOR, calling applyMask() with\n\t\t// the same mask value a second time will undo the mask. A final well-formed\n\t\t// QR Code needs exactly one (not zero, two, etc.) mask applied.\n\t\tprivate applyMask(mask: int): void {\n\t\t\tif (mask < 0 || mask > 7)\n\t\t\t\tthrow new RangeError(\"Mask value out of range\");\n\t\t\tfor (let y = 0; y < this.size; y++) {\n\t\t\t\tfor (let x = 0; x < this.size; x++) {\n\t\t\t\t\tlet invert: boolean;\n\t\t\t\t\tswitch (mask) {\n\t\t\t\t\t\tcase 0: invert = (x + y) % 2 == 0; break;\n\t\t\t\t\t\tcase 1: invert = y % 2 == 0; break;\n\t\t\t\t\t\tcase 2: invert = x % 3 == 0; break;\n\t\t\t\t\t\tcase 3: invert = (x + y) % 3 == 0; break;\n\t\t\t\t\t\tcase 4: invert = (Math.floor(x / 3) + Math.floor(y / 2)) % 2 == 0; break;\n\t\t\t\t\t\tcase 5: invert = x * y % 2 + x * y % 3 == 0; break;\n\t\t\t\t\t\tcase 6: invert = (x * y % 2 + x * y % 3) % 2 == 0; break;\n\t\t\t\t\t\tcase 7: invert = ((x + y) % 2 + x * y % 3) % 2 == 0; break;\n\t\t\t\t\t\tdefault: throw new Error(\"Unreachable\");\n\t\t\t\t\t}\n\t\t\t\t\tif (!this.isFunction[y][x] && invert)\n\t\t\t\t\t\tthis.modules[y][x] = !this.modules[y][x];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// Calculates and returns the penalty score based on state of this QR Code's current modules.\n\t\t// This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.\n\t\tprivate getPenaltyScore(): int {\n\t\t\tlet result: int = 0;\n\n\t\t\t// Adjacent modules in row having same color, and finder-like patterns\n\t\t\tfor (let y = 0; y < this.size; y++) {\n\t\t\t\tlet runColor = false;\n\t\t\t\tlet runX = 0;\n\t\t\t\tlet runHistory = [0,0,0,0,0,0,0];\n\t\t\t\tfor (let x = 0; x < this.size; x++) {\n\t\t\t\t\tif (this.modules[y][x] == runColor) {\n\t\t\t\t\t\trunX++;\n\t\t\t\t\t\tif (runX == 5)\n\t\t\t\t\t\t\tresult += QrCode.PENALTY_N1;\n\t\t\t\t\t\telse if (runX > 5)\n\t\t\t\t\t\t\tresult++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.finderPenaltyAddHistory(runX, runHistory);\n\t\t\t\t\t\tif (!runColor)\n\t\t\t\t\t\t\tresult += this.finderPenaltyCountPatterns(runHistory) * QrCode.PENALTY_N3;\n\t\t\t\t\t\trunColor = this.modules[y][x];\n\t\t\t\t\t\trunX = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresult += this.finderPenaltyTerminateAndCount(runColor, runX, runHistory) * QrCode.PENALTY_N3;\n\t\t\t}\n\t\t\t// Adjacent modules in column having same color, and finder-like patterns\n\t\t\tfor (let x = 0; x < this.size; x++) {\n\t\t\t\tlet runColor = false;\n\t\t\t\tlet runY = 0;\n\t\t\t\tlet runHistory = [0,0,0,0,0,0,0];\n\t\t\t\tfor (let y = 0; y < this.size; y++) {\n\t\t\t\t\tif (this.modules[y][x] == runColor) {\n\t\t\t\t\t\trunY++;\n\t\t\t\t\t\tif (runY == 5)\n\t\t\t\t\t\t\tresult += QrCode.PENALTY_N1;\n\t\t\t\t\t\telse if (runY > 5)\n\t\t\t\t\t\t\tresult++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.finderPenaltyAddHistory(runY, runHistory);\n\t\t\t\t\t\tif (!runColor)\n\t\t\t\t\t\t\tresult += this.finderPenaltyCountPatterns(runHistory) * QrCode.PENALTY_N3;\n\t\t\t\t\t\trunColor = this.modules[y][x];\n\t\t\t\t\t\trunY = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresult += this.finderPenaltyTerminateAndCount(runColor, runY, runHistory) * QrCode.PENALTY_N3;\n\t\t\t}\n\n\t\t\t// 2*2 blocks of modules having same color\n\t\t\tfor (let y = 0; y < this.size - 1; y++) {\n\t\t\t\tfor (let x = 0; x < this.size - 1; x++) {\n\t\t\t\t\tconst color: boolean = this.modules[y][x];\n\t\t\t\t\tif ( color == this.modules[y][x + 1] &&\n\t\t\t\t\t color == this.modules[y + 1][x] &&\n\t\t\t\t\t color == this.modules[y + 1][x + 1])\n\t\t\t\t\t\tresult += QrCode.PENALTY_N2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Balance of dark and light modules\n\t\t\tlet dark: int = 0;\n\t\t\tfor (const row of this.modules)\n\t\t\t\tdark = row.reduce((sum, color) => sum + (color ? 1 : 0), dark);\n\t\t\tconst total: int = this.size * this.size; // Note that size is odd, so dark/total != 1/2\n\t\t\t// Compute the smallest integer k >= 0 such that (45-5k)% <= dark/total <= (55+5k)%\n\t\t\tconst k: int = Math.ceil(Math.abs(dark * 20 - total * 10) / total) - 1;\n\t\t\tassert(0 <= k && k <= 9);\n\t\t\tresult += k * QrCode.PENALTY_N4;\n\t\t\tassert(0 <= result && result <= 2568888); // Non-tight upper bound based on default values of PENALTY_N1, ..., N4\n\t\t\treturn result;\n\t\t}\n\n\n\t\t/*-- Private helper functions --*/\n\n\t\t// Returns an ascending list of positions of alignment patterns for this version number.\n\t\t// Each position is in the range [0,177), and are used on both the x and y axes.\n\t\t// This could be implemented as lookup table of 40 variable-length lists of integers.\n\t\tprivate getAlignmentPatternPositions(): Array<int> {\n\t\t\tif (this.version == 1)\n\t\t\t\treturn [];\n\t\t\telse {\n\t\t\t\tconst numAlign: int = Math.floor(this.version / 7) + 2;\n\t\t\t\tconst step: int = (this.version == 32) ? 26 :\n\t\t\t\t\tMath.ceil((this.version * 4 + 4) / (numAlign * 2 - 2)) * 2;\n\t\t\t\tlet result: Array<int> = [6];\n\t\t\t\tfor (let pos = this.size - 7; result.length < numAlign; pos -= step)\n\t\t\t\t\tresult.splice(1, 0, pos);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\n\t\t// Returns the number of data bits that can be stored in a QR Code of the given version number, after\n\t\t// all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8.\n\t\t// The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.\n\t\tprivate static getNumRawDataModules(ver: int): int {\n\t\t\tif (ver < QrCode.MIN_VERSION || ver > QrCode.MAX_VERSION)\n\t\t\t\tthrow new RangeError(\"Version number out of range\");\n\t\t\tlet result: int = (16 * ver + 128) * ver + 64;\n\t\t\tif (ver >= 2) {\n\t\t\t\tconst numAlign: int = Math.floor(ver / 7) + 2;\n\t\t\t\tresult -= (25 * numAlign - 10) * numAlign - 55;\n\t\t\t\tif (ver >= 7)\n\t\t\t\t\tresult -= 36;\n\t\t\t}\n\t\t\tassert(208 <= result && result <= 29648);\n\t\t\treturn result;\n\t\t}\n\n\n\t\t// Returns the number of 8-bit data (i.e. not error correction) codewords contained in any\n\t\t// QR Code of the given version number and error correction level, with remainder bits discarded.\n\t\t// This stateless pure function could be implemented as a (40*4)-cell lookup table.\n\t\tprivate static getNumDataCodewords(ver: int, ecl: QrCode.Ecc): int {\n\t\t\treturn Math.floor(QrCode.getNumRawDataModules(ver) / 8) -\n\t\t\t\tQrCode.ECC_CODEWORDS_PER_BLOCK [ecl.ordinal][ver] *\n\t\t\t\tQrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];\n\t\t}\n\n\n\t\t// Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be\n\t\t// implemented as a lookup table over all possible parameter values, instead of as an algorithm.\n\t\tprivate static reedSolomonComputeDivisor(degree: int): Array<byte> {\n\t\t\tif (degree < 1 || degree > 255)\n\t\t\t\tthrow new RangeError(\"Degree out of range\");\n\t\t\t// Polynomial coefficients are stored from highest to lowest power, excluding the leading term which is always 1.\n\t\t\t// For example the polynomial x^3 + 255x^2 + 8x + 93 is stored as the uint8 array [255, 8, 93].\n\t\t\tlet result: Array<byte> = [];\n\t\t\tfor (let i = 0; i < degree - 1; i++)\n\t\t\t\tresult.push(0);\n\t\t\tresult.push(1); // Start off with the monomial x^0\n\n\t\t\t// Compute the product polynomial (x - r^0) * (x - r^1) * (x - r^2) * ... * (x - r^{degree-1}),\n\t\t\t// and drop the highest monomial term which is always 1x^degree.\n\t\t\t// Note that r = 0x02, which is a generator element of this field GF(2^8/0x11D).\n\t\t\tlet root = 1;\n\t\t\tfor (let i = 0; i < degree; i++) {\n\t\t\t\t// Multiply the current product by (x - r^i)\n\t\t\t\tfor (let j = 0; j < result.length; j++) {\n\t\t\t\t\tresult[j] = QrCode.reedSolomonMultiply(result[j], root);\n\t\t\t\t\tif (j + 1 < result.length)\n\t\t\t\t\t\tresult[j] ^= result[j + 1];\n\t\t\t\t}\n\t\t\t\troot = QrCode.reedSolomonMultiply(root, 0x02);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\n\t\t// Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.\n\t\tprivate static reedSolomonComputeRemainder(data: Readonly<Array<byte>>, divisor: Readonly<Array<byte>>): Array<byte> {\n\t\t\tlet result: Array<byte> = divisor.map(_ => 0);\n\t\t\tfor (const b of data) { // Polynomial division\n\t\t\t\tconst factor: byte = b ^ (result.shift() as byte);\n\t\t\t\tresult.push(0);\n\t\t\t\tdivisor.forEach((coef, i) =>\n\t\t\t\t\tresult[i] ^= QrCode.reedSolomonMultiply(coef, factor));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\n\t\t// Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result\n\t\t// are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.\n\t\tprivate static reedSolomonMultiply(x: byte, y: byte): byte {\n\t\t\tif (x >>> 8 != 0 || y >>> 8 != 0)\n\t\t\t\tthrow new RangeError(\"Byte out of range\");\n\t\t\t// Russian peasant multiplication\n\t\t\tlet z: int = 0;\n\t\t\tfor (let i = 7; i >= 0; i--) {\n\t\t\t\tz = (z << 1) ^ ((z >>> 7) * 0x11D);\n\t\t\t\tz ^= ((y >>> i) & 1) * x;\n\t\t\t}\n\t\t\tassert(z >>> 8 == 0);\n\t\t\treturn z as byte;\n\t\t}\n\n\n\t\t// Can only be called immediately after a light run is added, and\n\t\t// returns either 0, 1, or 2. A helper function for getPenaltyScore().\n\t\tprivate finderPenaltyCountPatterns(runHistory: Readonly<Array<int>>): int {\n\t\t\tconst n: int = runHistory[1];\n\t\t\tassert(n <= this.size * 3);\n\t\t\tconst core: boolean = n > 0 && runHistory[2] == n && runHistory[3] == n * 3 && runHistory[4] == n && runHistory[5] == n;\n\t\t\treturn (core && runHistory[0] >= n * 4 && runHistory[6] >= n ? 1 : 0)\n\t\t\t + (core && runHistory[6] >= n * 4 && runHistory[0] >= n ? 1 : 0);\n\t\t}\n\n\n\t\t// Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().\n\t\tprivate finderPenaltyTerminateAndCount(currentRunColor: boolean, currentRunLength: int, runHistory: Array<int>): int {\n\t\t\tif (currentRunColor) { // Terminate dark run\n\t\t\t\tthis.finderPenaltyAddHistory(currentRunLength, runHistory);\n\t\t\t\tcurrentRunLength = 0;\n\t\t\t}\n\t\t\tcurrentRunLength += this.size; // Add light border to final run\n\t\t\tthis.finderPenaltyAddHistory(currentRunLength, runHistory);\n\t\t\treturn this.finderPenaltyCountPatterns(runHistory);\n\t\t}\n\n\n\t\t// Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().\n\t\tprivate finderPenaltyAddHistory(currentRunLength: int, runHistory: Array<int>): void {\n\t\t\tif (runHistory[0] == 0)\n\t\t\t\tcurrentRunLength += this.size; // Add light border to initial run\n\t\t\trunHistory.pop();\n\t\t\trunHistory.unshift(currentRunLength);\n\t\t}\n\n\n\t\t/*-- Constants and tables --*/\n\n\t\t// The minimum version number supported in the QR Code Model 2 standard.\n\t\tpublic static readonly MIN_VERSION: int = 1;\n\t\t// The maximum version number supported in the QR Code Model 2 standard.\n\t\tpublic static readonly MAX_VERSION: int = 40;\n\n\t\t// For use in getPenaltyScore(), when evaluating which mask is best.\n\t\tprivate static readonly PENALTY_N1: int = 3;\n\t\tprivate static readonly PENALTY_N2: int = 3;\n\t\tprivate static readonly PENALTY_N3: int = 40;\n\t\tprivate static readonly PENALTY_N4: int = 10;\n\n\t\tprivate static readonly ECC_CODEWORDS_PER_BLOCK: Array<Array<int>> = [\n\t\t\t// Version: (note that index 0 is for padding, and is set to an illegal value)\n\t\t\t//0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level\n\t\t\t[-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], // Low\n\t\t\t[-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28], // Medium\n\t\t\t[-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], // Quartile\n\t\t\t[-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], // High\n\t\t];\n\n\t\tprivate static readonly NUM_ERROR_CORRECTION_BLOCKS: Array<Array<int>> = [\n\t\t\t// Version: (note that index 0 is for padding, and is set to an illegal value)\n\t\t\t//0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level\n\t\t\t[-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25], // Low\n\t\t\t[-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49], // Medium\n\t\t\t[-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68], // Quartile\n\t\t\t[-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81], // High\n\t\t];\n\n\t}\n\n\n\t// Appends the given number of low-order bits of the given value\n\t// to the given buffer. Requires 0 <= len <= 31 and 0 <= val < 2^len.\n\tfunction appendBits(val: int, len: int, bb: Array<bit>): void {\n\t\tif (len < 0 || len > 31 || val >>> len != 0)\n\t\t\tthrow new RangeError(\"Value out of range\");\n\t\tfor (let i = len - 1; i >= 0; i--) // Append bit by bit\n\t\t\tbb.push((val >>> i) & 1);\n\t}\n\n\n\t// Returns true iff the i'th bit of x is set to 1.\n\tfunction getBit(x: int, i: int): boolean {\n\t\treturn ((x >>> i) & 1) != 0;\n\t}\n\n\n\t// Throws an exception if the given condition is false.\n\tfunction assert(cond: boolean): void {\n\t\tif (!cond)\n\t\t\tthrow new Error(\"Assertion error\");\n\t}\n\n\n\n\t/*---- Data segment class ----*/\n\n\t/*\n\t * A segment of character/binary/control data in a QR Code symbol.\n\t * Instances of this class are immutable.\n\t * The mid-level way to create a segment is to take the payload data\n\t * and call a static factory function such as QrSegment.makeNumeric().\n\t * The low-level way to create a segment is to custom-make the bit buffer\n\t * and call the QrSegment() constructor with appropriate values.\n\t * This segment class imposes no length restrictions, but QR Codes have restrictions.\n\t * Even in the most favorable conditions, a QR Code can only hold 7089 characters of data.\n\t * Any segment longer than this is meaningless for the purpose of generating QR Codes.\n\t */\n\texport class QrSegment {\n\n\t\t/*-- Static factory functions (mid level) --*/\n\n\t\t// Returns a segment representing the given binary data encoded in\n\t\t// byte mode. All input byte arrays are acceptable. Any text string\n\t\t// can be converted to UTF-8 bytes and encoded as a byte mode segment.\n\t\tpublic static makeBytes(data: Readonly<Array<byte>>): QrSegment {\n\t\t\tlet bb: Array<bit> = []\n\t\t\tfor (const b of data)\n\t\t\t\tappendBits(b, 8, bb);\n\t\t\treturn new QrSegment(QrSegment.Mode.BYTE, data.length, bb);\n\t\t}\n\n\n\t\t// Returns a segment representing the given string of decimal digits encoded in numeric mode.\n\t\tpublic static makeNumeric(digits: string): QrSegment {\n\t\t\tif (!QrSegment.isNumeric(digits))\n\t\t\t\tthrow new RangeError(\"String contains non-numeric characters\");\n\t\t\tlet bb: Array<bit> = []\n\t\t\tfor (let i = 0; i < digits.length; ) { // Consume up to 3 digits per iteration\n\t\t\t\tconst n: int = Math.min(digits.length - i, 3);\n\t\t\t\tappendBits(parseInt(digits.substring(i, i + n), 10), n * 3 + 1, bb);\n\t\t\t\ti += n;\n\t\t\t}\n\t\t\treturn new QrSegment(QrSegment.Mode.NUMERIC, digits.length, bb);\n\t\t}\n\n\n\t\t// Returns a segment representing the given text string encoded in alphanumeric mode.\n\t\t// The characters allowed are: 0 to 9, A to Z (uppercase only), space,\n\t\t// dollar, percent, asterisk, plus, hyphen, period, slash, colon.\n\t\tpublic static makeAlphanumeric(text: string): QrSegment {\n\t\t\tif (!QrSegment.isAlphanumeric(text))\n\t\t\t\tthrow new RangeError(\"String contains unencodable characters in alphanumeric mode\");\n\t\t\tlet bb: Array<bit> = []\n\t\t\tlet i: int;\n\t\t\tfor (i = 0; i + 2 <= text.length; i += 2) { // Process groups of 2\n\t\t\t\tlet temp: int = QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)) * 45;\n\t\t\t\ttemp += QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i + 1));\n\t\t\t\tappendBits(temp, 11, bb);\n\t\t\t}\n\t\t\tif (i < text.length) // 1 character remaining\n\t\t\t\tappendBits(QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)), 6, bb);\n\t\t\treturn new QrSegment(QrSegment.Mode.ALPHANUMERIC, text.length, bb);\n\t\t}\n\n\n\t\t// Returns a new mutable list of zero or more segments to represent the given Unicode text string.\n\t\t// The result may use various segment modes and switch modes to optimize the length of the bit stream.\n\t\tpublic static makeSegments(text: string): Array<QrSegment> {\n\t\t\t// Select the most efficient segment encoding automatically\n\t\t\tif (text == \"\")\n\t\t\t\treturn [];\n\t\t\telse if (QrSegment.isNumeric(text))\n\t\t\t\treturn [QrSegment.makeNumeric(text)];\n\t\t\telse if (QrSegment.isAlphanumeric(text))\n\t\t\t\treturn [QrSegment.makeAlphanumeric(text)];\n\t\t\telse\n\t\t\t\treturn [QrSegment.makeBytes(QrSegment.toUtf8ByteArray(text))];\n\t\t}\n\n\n\t\t// Returns a segment representing an Extended Channel Interpretation\n\t\t// (ECI) designator with the given assignment value.\n\t\tpublic static makeEci(assignVal: int): QrSegment {\n\t\t\tlet bb: Array<bit> = []\n\t\t\tif (assignVal < 0)\n\t\t\t\tthrow new RangeError(\"ECI assignment value out of range\");\n\t\t\telse if (assignVal < (1 << 7))\n\t\t\t\tappendBits(assignVal, 8, bb);\n\t\t\telse if (assignVal < (1 << 14)) {\n\t\t\t\tappendBits(0b10, 2, bb);\n\t\t\t\tappendBits(assignVal, 14, bb);\n\t\t\t} else if (assignVal < 1000000) {\n\t\t\t\tappendBits(0b110, 3, bb);\n\t\t\t\tappendBits(assignVal, 21, bb);\n\t\t\t} else\n\t\t\t\tthrow new RangeError(\"ECI assignment value out of range\");\n\t\t\treturn new QrSegment(QrSegment.Mode.ECI, 0, bb);\n\t\t}\n\n\n\t\t// Tests whether the given string can be encoded as a segment in numeric mode.\n\t\t// A string is encodable iff each character is in the range 0 to 9.\n\t\tpublic static isNumeric(text: string): boolean {\n\t\t\treturn QrSegment.NUMERIC_REGEX.test(text);\n\t\t}\n\n\n\t\t// Tests whether the given string can be encoded as a segment in alphanumeric mode.\n\t\t// A string is encodable iff each character is in the following set: 0 to 9, A to Z\n\t\t// (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.\n\t\tpublic static isAlphanumeric(text: string): boolean {\n\t\t\treturn QrSegment.ALPHANUMERIC_REGEX.test(text);\n\t\t}\n\n\n\t\t/*-- Constructor (low level) and fields --*/\n\n\t\t// Creates a new QR Code segment with the given attributes and data.\n\t\t// The character count (numChars) must agree with the mode and the bit buffer length,\n\t\t// but the constraint isn't checked. The given bit buffer is cloned and stored.\n\t\tpublic constructor(\n\t\t\t\t// The mode indicator of this segment.\n\t\t\t\tpublic readonly mode: QrSegment.Mode,\n\n\t\t\t\t// The length of this segment's unencoded data. Measured in characters for\n\t\t\t\t// numeric/alphanumeric/kanji mode, bytes for byte mode, and 0 for ECI mode.\n\t\t\t\t// Always zero or positive. Not the same as the data's bit length.\n\t\t\t\tpublic readonly numChars: int,\n\n\t\t\t\t// The data bits of this segment. Accessed through getData().\n\t\t\t\tprivate readonly bitData: Array<bit>) {\n\n\t\t\tif (numChars < 0)\n\t\t\t\tthrow new RangeError(\"Invalid argument\");\n\t\t\tthis.bitData = bitData.slice(); // Make defensive copy\n\t\t}\n\n\n\t\t/*-- Methods --*/\n\n\t\t// Returns a new copy of the data bits of this segment.\n\t\tpublic getData(): Array<bit> {\n\t\t\treturn this.bitData.slice(); // Make defensive copy\n\t\t}\n\n\n\t\t// (Package-private) Calculates and returns the number of bits needed to encode the given segments at\n\t\t// the given version. The result is infinity if a segment has too many characters to fit its length field.\n\t\tpublic static getTotalBits(segs: Readonly<Array<QrSegment>>, version: int): number {\n\t\t\tlet result: number = 0;\n\t\t\tfor (const seg of segs) {\n\t\t\t\tconst ccbits: int = seg.mode.numCharCountBits(version);\n\t\t\t\tif (seg.numChars >= (1 << ccbits))\n\t\t\t\t\treturn Infinity; // The segment's length doesn't fit the field's bit width\n\t\t\t\tresult += 4 + ccbits + seg.bitData.length;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\n\t\t// Returns a new array of bytes representing the given string encoded in UTF-8.\n\t\tprivate static toUtf8ByteArray(str: string): Array<byte> {\n\t\t\tstr = encodeURI(str);\n\t\t\tlet result: Array<byte> = [];\n\t\t\tfor (let i = 0; i < str.length; i++) {\n\t\t\t\tif (str.charAt(i) != \"%\")\n\t\t\t\t\tresult.push(str.charCodeAt(i));\n\t\t\t\telse {\n\t\t\t\t\tresult.push(parseInt(str.substring(i + 1, i + 3), 16));\n\t\t\t\t\ti += 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\n\t\t/*-- Constants --*/\n\n\t\t// Describes precisely all strings that are encodable in numeric mode.\n\t\tprivate static readonly NUMERIC_REGEX: RegExp = /^[0-9]*$/;\n\n\t\t// Describes precisely all strings that are encodable in alphanumeric mode.\n\t\tprivate static readonly ALPHANUMERIC_REGEX: RegExp = /^[A-Z0-9 $%*+.\\/:-]*$/;\n\n\t\t// The set of all legal characters in alphanumeric mode,\n\t\t// where each character value maps to the index in the string.\n\t\tprivate static readonly ALPHANUMERIC_CHARSET: string = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:\";\n\n\t}\n\n}\n\n\n\n/*---- Public helper enumeration ----*/\n\nnamespace qrcodegen.QrCode {\n\n\ttype int = number;\n\n\n\t/*\n\t * The error correction level in a QR Code symbol. Immutable.\n\t */\n\texport class Ecc {\n\n\t\t/*-- Constants --*/\n\n\t\tpublic static readonly LOW = new Ecc(0, 1); // The QR Code can tolerate about 7% erroneous codewords\n\t\tpublic static readonly MEDIUM = new Ecc(1, 0); // The QR Code can tolerate about 15% erroneous codewords\n\t\tpublic static readonly QUARTILE = new Ecc(2, 3); // The QR Code can tolerate about 25% erroneous codewords\n\t\tpublic static readonly HIGH = new Ecc(3, 2); // The QR Code can tolerate about 30% erroneous codewords\n\n\n\t\t/*-- Constructor and fields --*/\n\n\t\tprivate constructor(\n\t\t\t// In the range 0 to 3 (unsigned 2-bit integer).\n\t\t\tpublic readonly ordinal: int,\n\t\t\t// (Package-private) In the range 0 to 3 (unsigned 2-bit integer).\n\t\t\tpublic readonly formatBits: int) {}\n\n\t}\n}\n\n\n\n/*---- Public helper enumeration ----*/\n\nnamespace qrcodegen.QrSegment {\n\n\ttype int = number;\n\n\n\t/*\n\t * Describes how a segment's data bits are interpreted. Immutable.\n\t */\n\texport class Mode {\n\n\t\t/*-- Constants --*/\n\n\t\tpublic static readonly NUMERIC = new Mode(0x1, [10, 12, 14]);\n\t\tpublic static readonly ALPHANUMERIC = new Mode(0x2, [ 9, 11, 13]);\n\t\tpublic static readonly BYTE = new Mode(0x4, [ 8, 16, 16]);\n\t\tpublic static readonly KANJI = new Mode(0x8, [ 8, 10, 12]);\n\t\tpublic static readonly ECI = new Mode(0x7, [ 0, 0, 0]);\n\n\n\t\t/*-- Constructor and fields --*/\n\n\t\tprivate constructor(\n\t\t\t// The mode indicator bits, which is a uint4 value (range 0 to 15).\n\t\t\tpublic readonly modeBits: int,\n\t\t\t// Number of character count bits for three different version ranges.\n\t\t\tprivate readonly numBitsCharCount: [int,int,int]) {}\n\n\n\t\t/*-- Method --*/\n\n\t\t// (Package-private) Returns the bit width of the character count field for a segment in\n\t\t// this mode in a QR Code at the given version number. The result is in the range [0, 16].\n\t\tpublic numCharCountBits(ver: int): int {\n\t\t\treturn this.numBitsCharCount[Math.floor((ver + 7) / 17)];\n\t\t}\n\n\t}\n}\n\n// Modification to export for actual use\nexport default qrcodegen\n", "import qrcodegen from './lib/qrcodegen';\n\ninterface QrCode {\n svg: string;\n path: string;\n size: number;\n}\n\nexport function generateQr(content: string, color: string): QrCode {\n const code = qrcodegen.QrCode.encodeText(content, qrcodegen.QrCode.Ecc.HIGH);\n\n const path = toPath(code);\n const svg = toSvg(path, color, code.size);\n\n return {\n svg,\n path,\n size: code.size\n };\n}\n\n/**\n * Create an SVG path from a QR code.\n */\nfunction toPath(qr: qrcodegen.QrCode) {\n const parts: Array<string> = [];\n for (let y = 0; y < qr.size; y++) {\n for (let x = 0; x < qr.size; x++) {\n if (qr.getModule(x, y)) parts.push(`M${x},${y}h1v1h-1z`);\n }\n }\n\n return parts.join(' ');\n}\n\n/**\n * Create a complete SVG string from a QR code.\n */\nfunction toSvg(path: string, color: string, size: number): string {\n return `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 ${size} ${size}\" stroke=\"none\">\n\t<path d=\"${path}\" fill=\"${color}\"/>\n</svg>\n`;\n}\n", "import type CreativeEngine from '@cesdk/engine';\nimport { type Color } from '@cesdk/engine';\n\nimport CreativeEditorSDK, { EditorPlugin } from '@cesdk/cesdk-js';\n\nimport { Metadata, hexToRgba, rgbaToHex } from '@imgly/plugin-utils';\n\nimport { generateQr } from './qr';\n\nexport const PLUGIN_ID = '@imgly/plugin-qr-code-web';\n\nconst GENERATE_QR_PANEL_ID = '//ly.img.panel/generate-qr';\nconst UPDATE_QR_PANEL_ID = '//ly.img.panel/update-qr';\n\ninterface QrMetadata {\n url: string;\n color: string;\n type: 'fill' | 'shape';\n}\n\nexport interface PluginConfiguration {\n createdBlockType?: 'fill' | 'shape';\n addCheckboxForCreatedBlockType?: boolean;\n}\n\nexport default (\n configuration: PluginConfiguration = {}\n): Omit<EditorPlugin, 'name' | 'version'> => {\n const { createdBlockType = 'shape', addCheckboxForCreatedBlockType = false } =\n configuration || {};\n\n return {\n initialize({ cesdk }) {\n if (cesdk == null) return;\n\n const metadata = new Metadata<QrMetadata>(cesdk.engine, PLUGIN_ID);\n\n cesdk.ui.addIconSet(\n '@imgly/plugin/qr',\n `\n <svg>\n <symbol\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n id=\"@imgly/plugin/qr\"\n >\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M3 3H11V11H3V3ZM5 5H9V9H5V5Z\" fill=\"currentColor\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M3 13H11V21H3V13ZM5 15H9V19H5V15Z\" fill=\"currentColor\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13 3V11H21V3H13ZM19 5H15V9H19V5Z\" fill=\"currentColor\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M15 13H13V15H15V17H13V21H17V19H19V21H21V19H19V17H21V13H17V15H15V13ZM17 17H15V19H17V17ZM17 17V15H19V17H17Z\" fill=\"currentColor\"/>\n </symbol>\n </svg>\n `\n );\n\n cesdk.setTranslations({\n en: {\n [`ly.img.generate-qr.dock.label`]: 'QR Code',\n [`panel.${GENERATE_QR_PANEL_ID}`]: 'Generate QR Code',\n [`panel.${GENERATE_QR_PANEL_ID}.description`]:\n 'Enter a URL to automatically generate a QR code for you to embed it in your design.',\n [`panel.${GENERATE_QR_PANEL_ID}.submit`]: 'Generate QR Code',\n [`panel.${GENERATE_QR_PANEL_ID}.url`]: 'URL',\n [`panel.${GENERATE_QR_PANEL_ID}.foregroundColor`]: 'Foreground Color',\n [`panel.${GENERATE_QR_PANEL_ID}.error`]:\n 'Failed to create QR code block.',\n\n [`panel.${UPDATE_QR_PANEL_ID}`]: 'Update QR Code',\n [`panel.${UPDATE_QR_PANEL_ID}.description`]:\n 'Update the URL to automatically refresh the QR code within your design.',\n [`panel.${UPDATE_QR_PANEL_ID}.asShape`]: 'As Shape?',\n [`panel.${UPDATE_QR_PANEL_ID}.onlyOneBlock`]:\n 'Please select only one block to update the QR code.',\n [`panel.${UPDATE_QR_PANEL_ID}.noMetadata`]:\n 'Invalid QR code block selected. Missing metadata.',\n [`panel.${UPDATE_QR_PANEL_ID}.invalidStateShape`]:\n 'Invalid state with no shape found.',\n [`panel.${UPDATE_QR_PANEL_ID}.invalidStateFill`]:\n 'Invalid state with no fill found.',\n [`panel.${UPDATE_QR_PANEL_ID}.url`]: 'URL',\n [`panel.${UPDATE_QR_PANEL_ID}.foregroundColor`]: 'Foreground Color',\n [`ly.img.generate-qr.canvasMenu.edit`]: 'Edit'\n }\n });\n\n [\n 'ly.img.replace',\n 'ly.img.crop',\n 'ly.img.fill',\n 'ly.img.adjustment',\n 'ly.img.shape.options'\n ].forEach((key) => {\n cesdk.feature.enable(key, ({ isPreviousEnable, engine }) => {\n const hasQRFill = engine.block.findAllSelected().every((block) => {\n if (!metadata.hasData(block)) return false;\n return metadata.get(block)?.type === 'fill';\n });\n if (hasQRFill) return false;\n return isPreviousEnable();\n });\n });\n\n cesdk.ui.registerComponent('ly.img.generate-qr.dock', ({ builder }) => {\n const isOpen = cesdk.ui.isPanelOpen(GENERATE_QR_PANEL_ID);\n builder.Button('ly.img.generate-qr.dock', {\n label: 'ly.img.generate-qr.dock.label',\n icon: '@imgly/plugin/qr',\n isSelected: isOpen,\n onClick: () => {\n if (isOpen) {\n cesdk.ui.closePanel(GENERATE_QR_PANEL_ID);\n } else {\n cesdk.ui.openPanel(GENERATE_QR_PANEL_ID);\n }\n }\n });\n });\n\n cesdk.ui.registerComponent(\n 'ly.img.update-qr.canvasMenu',\n ({ builder, engine }) => {\n const selectedBlocks = engine.block.findAllSelected();\n if (selectedBlocks.length !== 1) return;\n const selectedBlock = selectedBlocks[0];\n\n const canEdit = engine.block.isAllowedByScope(\n selectedBlock,\n 'fill/change'\n );\n\n if (!canEdit) return;\n\n if (!metadata.hasData(selectedBlock)) return;\n\n builder.Button('ly.img.update-qr.dock', {\n label: 'ly.img.generate-qr.canvasMenu.edit',\n icon: '@imgly/plugin/qr',\n onClick: () => {\n cesdk.ui.openPanel(UPDATE_QR_PANEL_ID);\n }\n });\n }\n );\n\n cesdk.ui.setCanvasMenuOrder([\n 'ly.img.update-qr.canvasMenu',\n ...cesdk.ui.getCanvasMenuOrder()\n ]);\n\n cesdk.ui.registerPanel(\n GENERATE_QR_PANEL_ID,\n ({ builder, engine, state }) => {\n const url = state<string>('url', '');\n const color = state<Color>('color', { r: 0, g: 0, b: 0, a: 1 });\n const asShape = state<boolean>(\n 'asShape',\n createdBlockType === 'shape'\n );\n\n builder.Section('ly.img.generate-qr.text.section', {\n children: () => {\n builder.Text('ly.img.generate-qr.text', {\n content: `panel.${GENERATE_QR_PANEL_ID}.description`\n });\n }\n });\n\n builder.Section('ly.img.generate-qr.inputs.section', {\n children: () => {\n builder.TextInput('ly.img.generate-qr.url', {\n inputLabel: `panel.${GENERATE_QR_PANEL_ID}.url`,\n ...url\n });\n builder.ColorInput('ly.img.generate-qr.foregroundColor', {\n label: `panel.${GENERATE_QR_PANEL_ID}.foregroundColor`,\n inputLabel: `panel.${GENERATE_QR_PANEL_ID}.foregroundColor`,\n ...color\n });\n }\n });\n\n builder.Section('ly.img.generate-qr.button.section', {\n children: () => {\n builder.Button('ly.img.generate-qr.generate', {\n label: `panel.${GENERATE_QR_PANEL_ID}.submit`,\n isDisabled: url.value === '',\n color: 'accent',\n onClick: async () => {\n const block = await createQRBlock(\n cesdk,\n engine,\n url.value,\n color.value,\n metadata,\n asShape.value\n );\n if (block != null) {\n cesdk.ui.closePanel(GENERATE_QR_PANEL_ID);\n }\n }\n });\n\n if (addCheckboxForCreatedBlockType) {\n builder.Checkbox('ly.img.generate-qr.asShape', {\n inputLabel: `panel.${UPDATE_QR_PANEL_ID}.asShape`,\n ...asShape\n });\n }\n }\n });\n }\n );\n\n cesdk.engine.block.onSelectionChanged(() => {\n const selectedBlocks = cesdk.engine.block.findAllSelected();\n if (selectedBlocks.length !== 1) {\n if (cesdk.ui.isPanelOpen(UPDATE_QR_PANEL_ID))\n cesdk.ui.closePanel(UPDATE_QR_PANEL_ID);\n return;\n }\n const selectedBlock = selectedBlocks[0];\n if (!metadata.hasData(selectedBlock)) {\n if (cesdk.ui.isPanelOpen(UPDATE_QR_PANEL_ID))\n cesdk.ui.closePanel(UPDATE_QR_PANEL_ID);\n }\n });\n\n cesdk.ui.registerPanel(UPDATE_QR_PANEL_ID, ({ builder, engine }) => {\n const selectedBlocks = engine.block.findAllSelected();\n if (selectedBlocks.length !== 1) {\n builder.Section('ly.img.update-qr.only-one-block.section', {\n children: () => {\n builder.Text('ly.img.update-qr.only-one-block', {\n content: `panel.${UPDATE_QR_PANEL_ID}.onlyOneBlock`\n });\n }\n });\n return;\n }\n\n const selectedBlock = selectedBlocks[0];\n if (!metadata.hasData(selectedBlock)) {\n builder.Section('ly.img.update-qr.no-metadata.section', {\n children: () => {\n builder.Text('ly.img.update-qr.no-metadata', {\n content: `panel.${UPDATE_QR_PANEL_ID}.noMetadata`\n });\n }\n });\n return;\n }\n\n const { url, color, type } = metadata.get(selectedBlock) as QrMetadata;\n\n builder.Section('ly.img.update-qr.section', {\n children: () => {\n builder.Text('ly.img.update-qr.text', {\n content: `panel.${UPDATE_QR_PANEL_ID}.description`\n });\n\n builder.TextInput('ly.img.update-qr.url', {\n inputLabel: `panel.${UPDATE_QR_PANEL_ID}.url`,\n value: url,\n setValue: (value) => {\n metadata.set(selectedBlock, {\n url: value,\n color,\n type\n });\n\n updateQR(cesdk, engine, selectedBlock, value, color, type);\n }\n });\n\n if (type === 'fill') {\n builder.ColorInput('ly.img.update-qr.foregroundColor', {\n inputLabel: `panel.${UPDATE_QR_PANEL_ID}.foregroundColor`,\n inputLabelPosition: 'top',\n value: hexToRgba(color),\n setValue: (value) => {\n const colorAsHex = hexify(engine, value);\n metadata.set(selectedBlock, {\n url,\n color: colorAsHex,\n type\n });\n\n updateQR(cesdk, engine, selectedBlock, url, colorAsHex, type);\n }\n });\n }\n }\n });\n });\n }\n };\n};\n\nfunction hexify(engine: CreativeEngine, color: Color | string) {\n const isColorString = typeof color === 'string';\n\n let colorAsHex;\n if (isColorString) {\n colorAsHex = color;\n } else {\n const colorAsRgba = engine.editor.convertColorToColorSpace(color, 'sRGB');\n colorAsHex = rgbaToHex(colorAsRgba);\n }\n\n return colorAsHex;\n}\n\nasync function createQRBlock(\n cesdk: CreativeEditorSDK,\n engine: CreativeEngine,\n url: string,\n color: Color,\n metadata: Metadata<QrMetadata>,\n asShape: boolean\n): Promise<number | undefined> {\n const colorAsRgba = engine.editor.convertColorToColorSpace(color, 'sRGB');\n const colorAsHex = rgbaToHex(colorAsRgba);\n const { path, svg, size } = generateQr(url, colorAsHex);\n\n let block: number | undefined;\n if (asShape) {\n block = await engine.asset.defaultApplyAsset({\n id: 'qr-code',\n meta: {\n kind: 'shape',\n vectorPath: path,\n height: size,\n width: size,\n shapeType: '//ly.img.ubq/shape/vector_path'\n },\n payload: {}\n });\n\n if (block != null) {\n // Set the fill color\n if (engine.block.supportsFill(block)) {\n const fill = engine.block.getFill(block);\n const fillType = engine.block.getType(fill);\n if (fillType === '//ly.img.ubq/fill/color') {\n engine.block.setColor(fill, 'fill/color/value', colorAsRgba);\n }\n }\n\n simplifyShape(engine, block);\n }\n } else {\n const svgDataURI = `data:text/plain;base64,${btoa(svg)}`;\n\n block = await engine.asset.defaultApplyAsset({\n id: 'qr-code',\n meta: {\n fillType: '//ly.img.ubq/fill/image',\n width: size,\n height: size\n },\n payload: {\n sourceSet: [\n {\n uri: svgDataURI,\n width: size,\n height: size\n }\n ]\n }\n });\n }\n\n if (block == null) {\n cesdk.ui.showNotification({\n type: 'error',\n message: `panel.${GENERATE_QR_PANEL_ID}.error`\n });\n } else {\n metadata.set(block, {\n url,\n color: colorAsHex,\n type: asShape ? 'shape' : 'fill'\n });\n }\n return block;\n}\n\nfunction updateQR(\n cesdk: CreativeEditorSDK,\n engine: CreativeEngine,\n block: number,\n url: string,\n color: string,\n type: 'fill' | 'shape'\n) {\n const { path, svg, size } = generateQr(url, color);\n\n if (type === 'shape') {\n if (!engine.block.supportsShape(block)) {\n cesdk.ui.showNotification({\n type: 'error',\n message: `panel.${UPDATE_QR_PANEL_ID}.invalidStateShape`\n });\n return;\n }\n\n const shape = engine.block.getShape(block);\n engine.block.setString(shape, 'shape/vector_path/path', path);\n engine.block.setFloat(shape, 'shape/vector_path/height', size);\n engine.block.setFloat(shape, 'shape/vector_path/width', size);\n simplifyShape(engine, block);\n } else if (type === 'fill') {\n if (!engine.block.supportsFill(block)) {\n cesdk.ui.showNotification({\n type: 'error',\n message: `panel.${UPDATE_QR_PANEL_ID}.invalidStateFill`\n });\n return;\n }\n const fill = engine.block.getFill(block);\n\n const svgDataURI = `data:text/plain;base64,${btoa(svg)}`;\n\n engine.block.setSourceSet(fill, 'fill/image/sourceSet', [\n {\n uri: svgDataURI,\n width: size,\n height: size\n }\n ]);\n }\n}\n\nfunction simplifyShape(engine: CreativeEngine, block: number): number {\n // Simplify the shape by intersecting with a rect shape\n const duplicate = engine.block.duplicate(block);\n const parent = engine.block.getParent(block);\n if (parent != null) {\n const rect = engine.block.create('graphic');\n engine.block.setShape(\n rect,\n engine.block.createShape('//ly.img.ubq/shape/rect')\n );\n engine.block.appendChild(parent, rect);\n engine.block.setPositionX(rect, engine.block.getPositionX(block));\n engine.block.setPositionY(rect, engine.block.getPositionY(block));\n engine.block.setWidth(rect, engine.block.getWidth(block));\n engine.block.setHeight(rect, engine.block.getHeight(block));\n\n const newBlock = engine.block.combine([duplicate, rect], 'Intersection');\n engine.block.setShape(block, engine.block.getShape(newBlock));\n engine.block.destroy(newBlock);\n }\n\n return block;\n}\n", "import plugin, { PLUGIN_ID, type PluginConfiguration } from './plugin';\n\nconst Plugin = (pluginConfiguration?: PluginConfiguration) => ({\n name: PLUGIN_ID,\n version: PLUGIN_VERSION,\n ...plugin(pluginConfiguration)\n});\n\nexport default Plugin;\n"],
|
|
5
|
-
"mappings": "AIEA,IAAMA,GAAN,KAAkB,CAKhB,YAAYC,EAAwBC,EAAa,CAC/C,KAAK,OAASD,EACd,KAAK,IAAMC,CACb,CAEA,QAAQC,EAA0B,CAChC,OACE,KAAK,OAAO,MAAM,QAAQA,CAAO,GACjC,KAAK,OAAO,MAAM,YAAYA,EAAS,KAAK,GAAG,CAEnD,CAEA,IAAIA,EAAgC,CAClC,GAAI,KAAK,QAAQA,CAAO,EACtB,OAAO,KAAK,MAAM,KAAK,OAAO,MAAM,YAAYA,EAAS,KAAK,GAAG,CAAC,CAGtE,CAEA,IAAIA,EAAiBC,EAAU,CAC7B,KAAK,OAAO,MAAM,YAAYD,EAAS,KAAK,IAAK,KAAK,UAAUC,CAAK,CAAC,CACxE,CAEA,MAAMD,EAAiB,CACjB,KAAK,OAAO,MAAM,YAAYA,EAAS,KAAK,GAAG,GACjD,KAAK,OAAO,MAAM,eAAeA,EAAS,KAAK,GAAG,CAEtD,CACF,EAEOE,GAAQL,GCpCXM,GAAa,OAAO,QAAU,UAAY,QAAU,OAAO,SAAW,QAAU,OAE7EC,GAAQD,GCAXE,GAAW,OAAO,MAAQ,UAAY,MAAQ,KAAK,SAAW,QAAU,KAGxEC,GAAOF,IAAcC,IAAY,SAAS,aAAa,EAAE,EAEtDE,EAAQD,GCLXE,GAASD,EAAK,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C,CAAC,EACD,MACF,CACA,IAAMkC,EAAOxB,EAAO,MAAM,QAAQC,CAAK,EAEjCyB,EAAa,0BAA0B,KAAKL,CAAG,CAAC,GAEtDrB,EAAO,MAAM,aAAawB,EAAM,uBAAwB,CACtD,CACE,IAAKE,EACL,MAAOJ,EACP,OAAQA,CACV,CACF,CAAC,CACH,CACF,CAEA,SAASG,GAAczB,EAAwBC,EAAuB,CAEpE,IAAM2B,EAAY5B,EAAO,MAAM,UAAUC,CAAK,EACxC4B,EAAS7B,EAAO,MAAM,UAAUC,CAAK,EAC3C,GAAI4B,GAAU,KAAM,CAClB,IAAMC,EAAO9B,EAAO,MAAM,OAAO,SAAS,EAC1CA,EAAO,MAAM,SACX8B,EACA9B,EAAO,MAAM,YAAY,yBAAyB,CACpD,EACAA,EAAO,MAAM,YAAY6B,EAAQC,CAAI,EACrC9B,EAAO,MAAM,aAAa8B,EAAM9B,EAAO,MAAM,aAAaC,CAAK,CAAC,EAChED,EAAO,MAAM,aAAa8B,EAAM9B,EAAO,MAAM,aAAaC,CAAK,CAAC,EAChED,EAAO,MAAM,SAAS8B,EAAM9B,EAAO,MAAM,SAASC,CAAK,CAAC,EACxDD,EAAO,MAAM,UAAU8B,EAAM9B,EAAO,MAAM,UAAUC,CAAK,CAAC,EAE1D,IAAM8B,EAAW/B,EAAO,MAAM,QAAQ,CAAC4B,EAAWE,CAAI,EAAG,cAAc,EACvE9B,EAAO,MAAM,SAASC,EAAOD,EAAO,MAAM,SAAS+B,CAAQ,CAAC,EAC5D/B,EAAO,MAAM,QAAQ+B,CAAQ,CAC/B,CAEA,OAAO9B,CACT,CCtcA,IAAM+B,GAAUC,IAA+C,CAC7D,KAAMC,EACN,QAAS,0BACT,GAAGC,GAAOF,CAAmB,CAC/B,GAEOG,GAAQJ",
|
|
6
6
|
"names": ["Metadata", "engine", "key", "blockId", "value", "Metadata_default", "freeGlobal", "freeGlobal_default", "freeSelf", "root", "root_default", "Symbol", "Symbol_default", "objectProto", "hasOwnProperty", "nativeObjectToString", "symToStringTag", "getRawTag", "isOwn", "tag", "unmasked", "result", "getRawTag_default", "objectToString", "objectToString_default", "nullTag", "undefinedTag", "baseGetTag", "baseGetTag_default", "isObjectLike", "isObjectLike_default", "isArray", "isObject", "value", "type", "isObject_default", "asyncTag", "funcTag", "genTag", "proxyTag", "isFunction", "tag", "baseGetTag_default", "isFunction_default", "coreJsData", "root_default", "coreJsData_default", "maskSrcKey", "uid", "isMasked", "func", "isMasked_default", "funcProto", "funcToString", "toSource", "toSource_default", "reRegExpChar", "reIsHostCtor", "objectProto", "hasOwnProperty", "reIsNative", "baseIsNative", "pattern", "baseIsNative_default", "getValue", "object", "key", "getValue_default", "getNative", "getNative_default", "WeakMap", "WeakMap_default", "eq", "value", "other", "eq_default", "MAX_SAFE_INTEGER", "isLength", "isLength_default", "objectProto", "argsTag", "baseIsArguments", "value", "isObjectLike_default", "baseGetTag_default", "baseIsArguments_default", "objectProto", "hasOwnProperty", "propertyIsEnumerable", "isArguments", "freeExports", "freeModule", "moduleExports", "Buffer", "root_default", "nativeIsBuffer", "argsTag", "arrayTag", "boolTag", "dateTag", "errorTag", "funcTag", "mapTag", "numberTag", "objectTag", "regexpTag", "setTag", "stringTag", "weakMapTag", "arrayBufferTag", "dataViewTag", "float32Tag", "float64Tag", "int8Tag", "int16Tag", "int32Tag", "uint8Tag", "uint8ClampedTag", "uint16Tag", "uint32Tag", "typedArrayTags", "baseIsTypedArray", "value", "isObjectLike_default", "isLength_default", "baseGetTag_default", "baseIsTypedArray_default", "baseUnary", "func", "baseUnary_default", "freeExports", "freeModule", "moduleExports", "freeProcess", "freeGlobal_default", "nodeUtil", "types", "nodeUtil_default", "nodeIsTypedArray", "isTypedArray", "objectProto", "hasOwnProperty", "overArg", "func", "transform", "arg", "overArg_default", "nativeKeys", "objectProto", "hasOwnProperty", "nativeCreate", "getNative_default", "nativeCreate_default", "hashClear", "hashClear_default", "hashDelete", "key", "result", "hashDelete_default", "HASH_UNDEFINED", "objectProto", "hasOwnProperty", "hashGet", "data", "hashGet_default", "hashHas", "hashHas_default", "hashSet", "value", "hashSet_default", "Hash", "entries", "index", "length", "entry", "Hash_default", "listCacheClear", "listCacheClear_default", "assocIndexOf", "array", "eq_default", "assocIndexOf_default", "arrayProto", "splice", "listCacheDelete", "lastIndex", "listCacheDelete_default", "listCacheGet", "listCacheGet_default", "listCacheHas", "listCacheHas_default", "listCacheSet", "listCacheSet_default", "ListCache", "ListCache_default", "Map", "root_default", "Map_default", "mapCacheClear", "mapCacheClear_default", "isKeyable", "type", "isKeyable_default", "getMapData", "map", "getMapData_default", "mapCacheDelete", "mapCacheDelete_default", "mapCacheGet", "mapCacheGet_default", "mapCacheHas", "mapCacheHas_default", "mapCacheSet", "size", "mapCacheSet_default", "MapCache", "MapCache_default", "stackClear", "ListCache_default", "stackClear_default", "stackDelete", "key", "data", "result", "stackDelete_default", "stackGet", "stackGet_default", "stackHas", "stackHas_default", "LARGE_ARRAY_SIZE", "stackSet", "value", "pairs", "Map_default", "MapCache_default", "stackSet_default", "Stack", "entries", "objectProto", "propertyIsEnumerable", "DataView", "getNative_default", "root_default", "DataView_default", "Promise", "Promise_default", "Set", "Set_default", "mapTag", "objectTag", "promiseTag", "setTag", "weakMapTag", "dataViewTag", "dataViewCtorString", "toSource_default", "mapCtorString", "Map_default", "promiseCtorString", "setCtorString", "weakMapCtorString", "WeakMap_default", "getTag", "baseGetTag_default", "value", "result", "Ctor", "ctorString", "Uint8Array", "root_default", "HASH_UNDEFINED", "setCacheAdd", "value", "setCacheAdd_default", "setCacheHas", "setCacheHas_default", "SetCache", "values", "index", "length", "MapCache_default", "symbolProto", "Symbol_default", "symbolValueOf", "objectProto", "hasOwnProperty", "objectProto", "hasOwnProperty", "HEX_COLOR_PATTERN", "HEX_SINGLE_CHAR_COMPONENTS_PATTERN", "HEX_DOUBLE_CHAR_COMPONENTS_PATTERN", "rgbaToHex", "rgba", "includeAlpha", "r", "g", "b", "a", "rByte", "gByte", "bByte", "aByte", "byteToHex", "byte", "hexToRgba", "hexString", "rgbaHexToColor", "max", "hexMatch", "qrcodegen", "QrCode", "version", "errorCorrectionLevel", "dataCodewords", "msk", "row", "i", "allCodewords", "minPenalty", "penalty", "assert", "text", "ecl", "segs", "data", "seg", "minVersion", "maxVersion", "mask", "boostEcl", "dataUsedBits", "dataCapacityBits", "usedBits", "QrSegment", "newEcl", "bb", "appendBits", "b", "padByte", "x", "y", "alignPatPos", "numAlign", "j", "rem", "bits", "getBit", "color", "a", "dy", "dx", "dist", "xx", "yy", "isDark", "ver", "numBlocks", "blockEccLen", "rawCodewords", "numShortBlocks", "shortBlockLen", "blocks", "rsDiv", "k", "dat", "ecc", "result", "block", "right", "vert", "invert", "runColor", "runX", "runHistory", "runY", "dark", "sum", "total", "step", "pos", "degree", "root", "divisor", "_", "factor", "coef", "z", "n", "core", "currentRunColor", "currentRunLength", "val", "len", "cond", "mode", "numChars", "bitData", "digits", "temp", "assignVal", "ccbits", "str", "Ecc", "ordinal", "formatBits", "Mode", "modeBits", "numBitsCharCount", "qrcodegen_default", "generateQr", "content", "color", "code", "qrcodegen_default", "path", "toPath", "toSvg", "qr", "parts", "y", "x", "size", "PLUGIN_ID", "GENERATE_QR_PANEL_ID", "UPDATE_QR_PANEL_ID", "plugin_default", "configuration", "createdBlockType", "addCheckboxForCreatedBlockType", "cesdk", "metadata", "Ce", "key", "isPreviousEnable", "engine", "block", "builder", "isOpen", "selectedBlocks", "selectedBlock", "state", "url", "color", "asShape", "createQRBlock", "type", "value", "updateQR", "Ws", "colorAsHex", "hexify", "isColorString", "colorAsRgba", "zs", "path", "svg", "size", "generateQr", "fill", "simplifyShape", "svgDataURI", "shape", "duplicate", "parent", "rect", "newBlock", "Plugin", "pluginConfiguration", "PLUGIN_ID", "plugin_default", "src_default"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imgly/plugin-qr-code-web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.69.0-nightly.20260130",
|
|
4
4
|
"description": "QR code generation plugin for the CE.SDK editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CE.SDK",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@imgly/plugin-utils": "0.0.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@cesdk/cesdk-js": "1.
|
|
47
|
+
"@cesdk/cesdk-js": "1.69.0-nightly.20260130"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"start": "pnpm dev",
|