{"version":3,"file":"vendor-D7JBmMuS.js","sources":["../../node_modules/esm-env/dev-fallback.js","../../node_modules/svelte/src/internal/shared/utils.js","../../node_modules/svelte/src/internal/client/constants.js","../../node_modules/svelte/src/internal/client/reactivity/equality.js","../../node_modules/svelte/src/internal/client/errors.js","../../node_modules/svelte/src/internal/flags/index.js","../../node_modules/svelte/src/constants.js","../../node_modules/svelte/src/internal/shared/warnings.js","../../node_modules/svelte/src/internal/shared/clone.js","../../node_modules/svelte/src/internal/client/warnings.js","../../node_modules/svelte/src/internal/client/dev/ownership.js","../../node_modules/svelte/src/internal/shared/errors.js","../../node_modules/svelte/src/internal/client/context.js","../../node_modules/svelte/src/internal/client/reactivity/sources.js","../../node_modules/svelte/src/internal/client/runtime.js","../../node_modules/svelte/src/internal/client/dom/hydration.js","../../node_modules/svelte/src/internal/client/proxy.js","../../node_modules/svelte/src/internal/client/dom/operations.js","../../node_modules/svelte/src/internal/client/dev/equality.js","../../node_modules/svelte/src/internal/client/reactivity/deriveds.js","../../node_modules/svelte/src/internal/client/reactivity/effects.js","../../node_modules/svelte/src/internal/client/dom/task.js","../../node_modules/svelte/src/utils.js","../../node_modules/svelte/src/internal/client/dom/elements/misc.js","../../node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js","../../node_modules/svelte/src/internal/client/dom/elements/events.js","../../node_modules/svelte/src/internal/client/dom/blocks/svelte-head.js","../../node_modules/svelte/src/internal/client/dom/reconciler.js","../../node_modules/svelte/src/internal/client/dom/template.js","../../node_modules/svelte/src/internal/client/render.js","../../node_modules/svelte/src/internal/client/dom/blocks/await.js","../../node_modules/svelte/src/internal/client/dom/blocks/if.js","../../node_modules/svelte/src/internal/client/dom/blocks/key.js","../../node_modules/svelte/src/internal/client/dom/blocks/each.js","../../node_modules/svelte/src/internal/client/dom/blocks/html.js","../../node_modules/svelte/src/internal/client/dom/blocks/slot.js","../../node_modules/svelte/src/internal/client/dom/blocks/snippet.js","../../node_modules/svelte/src/internal/client/dom/blocks/svelte-component.js","../../node_modules/svelte/src/internal/client/dom/elements/actions.js","../../node_modules/svelte/node_modules/clsx/dist/clsx.mjs","../../node_modules/svelte/src/internal/shared/attributes.js","../../node_modules/svelte/src/internal/client/dom/elements/class.js","../../node_modules/svelte/src/internal/client/dom/elements/attributes.js","../../node_modules/svelte/src/internal/client/timing.js","../../node_modules/svelte/src/internal/client/loop.js","../../node_modules/svelte/src/internal/client/dom/elements/transitions.js","../../node_modules/svelte/src/internal/client/dom/elements/bindings/input.js","../../node_modules/svelte/src/internal/client/dom/elements/bindings/props.js","../../node_modules/svelte/src/internal/client/dom/elements/bindings/select.js","../../node_modules/svelte/src/internal/client/dom/elements/bindings/size.js","../../node_modules/svelte/src/internal/client/dom/elements/bindings/this.js","../../node_modules/svelte/src/internal/client/dom/elements/bindings/window.js","../../node_modules/svelte/src/internal/client/dom/legacy/event-modifiers.js","../../node_modules/svelte/src/internal/client/dom/legacy/lifecycle.js","../../node_modules/svelte/src/internal/client/dom/legacy/misc.js","../../node_modules/svelte/src/store/utils.js","../../node_modules/svelte/src/store/shared/index.js","../../node_modules/svelte/src/internal/client/reactivity/store.js","../../node_modules/svelte/src/internal/client/reactivity/props.js","../../node_modules/svelte/src/index-client.js","../../node_modules/svelte/src/internal/disclose-version.js","../../node_modules/svelte/src/version.js","../../node_modules/rollup-styles/dist/runtime/inject-css.js","../../node_modules/deepmerge/dist/cjs.js","../../node_modules/tslib/tslib.es6.js","../../node_modules/@formatjs/fast-memoize/lib/index.js","../../node_modules/@formatjs/icu-messageformat-parser/lib/error.js","../../node_modules/@formatjs/icu-messageformat-parser/lib/types.js","../../node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js","../../node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js","../../node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js","../../node_modules/@formatjs/icu-skeleton-parser/lib/number.js","../../node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js","../../node_modules/@formatjs/icu-messageformat-parser/lib/parser.js","../../node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js","../../node_modules/intl-messageformat/lib/src/error.js","../../node_modules/@formatjs/icu-messageformat-parser/lib/index.js","../../node_modules/intl-messageformat/lib/src/formatters.js","../../node_modules/intl-messageformat/lib/src/core.js","../../node_modules/svelte-i18n/dist/runtime.js","../../node_modules/base64-js/index.js","../../openchat-shared/node_modules/@dfinity/agent/lib/esm/agent/api.js","../../node_modules/ieee754/index.js","../../node_modules/buffer/index.js","../../openchat-shared/node_modules/@dfinity/principal/lib/esm/utils/base32.js","../../openchat-shared/node_modules/@dfinity/principal/lib/esm/utils/getCrc.js","../../node_modules/@noble/hashes/esm/_assert.js","../../node_modules/@noble/hashes/esm/crypto.js","../../node_modules/@noble/hashes/esm/utils.js","../../node_modules/@noble/hashes/esm/_md.js","../../node_modules/@noble/hashes/esm/sha256.js","../../openchat-shared/node_modules/@dfinity/principal/lib/esm/index.js","../../openchat-shared/node_modules/@dfinity/principal/lib/esm/utils/sha224.js","../../openchat-shared/node_modules/@dfinity/agent/lib/esm/utils/buffer.js","../../openchat-shared/node_modules/@dfinity/candid/lib/esm/utils/buffer.js","../../openchat-shared/node_modules/@dfinity/candid/lib/esm/utils/leb128.js","../../openchat-shared/node_modules/@dfinity/candid/lib/esm/utils/bigint-math.js","../../openchat-shared/node_modules/@dfinity/candid/lib/esm/idl.js","../../node_modules/borc/node_modules/buffer/index.js","../../node_modules/bignumber.js/bignumber.js","../../node_modules/borc/src/constants.js","../../node_modules/borc/src/utils.js","../../node_modules/borc/src/simple.js","../../node_modules/borc/src/tagged.js","../../node_modules/iso-url/src/url-browser.js","../../node_modules/iso-url/src/relative.js","../../node_modules/iso-url/index.js","../../node_modules/borc/src/decoder.js","../../node_modules/borc/src/decoder.asm.js","../../node_modules/borc/src/diagnose.js","../../node_modules/borc/src/encoder.js","../../node_modules/borc/src/index.js","../../openchat-shared/node_modules/@dfinity/agent/lib/esm/request_id.js","../../openchat-shared/node_modules/@dfinity/agent/lib/esm/auth.js","../../node_modules/simple-cbor/src/value.js","../../node_modules/simple-cbor/src/serializer.js","../../node_modules/simple-cbor/src/index.js","../../openchat-shared/node_modules/@dfinity/agent/lib/esm/cbor.js","../../openchat-shared/node_modules/@dfinity/agent/lib/esm/agent/http/types.js","../../openchat-shared/node_modules/@dfinity/agent/lib/esm/agent/http/transforms.js","../../node_modules/@noble/curves/esm/abstract/utils.js","../../node_modules/@noble/curves/esm/abstract/modular.js","../../node_modules/@noble/curves/esm/abstract/hash-to-curve.js","../../node_modules/@noble/curves/esm/abstract/curve.js","../../node_modules/@noble/curves/esm/abstract/weierstrass.js","../../node_modules/@noble/curves/esm/abstract/bls.js","../../node_modules/@noble/curves/esm/bls12-381.js","../../openchat-shared/node_modules/@dfinity/agent/lib/esm/certificate.js","../../node_modules/@noble/hashes/esm/_u64.js","../../node_modules/@noble/hashes/esm/sha512.js","../../node_modules/@noble/curves/esm/abstract/edwards.js","../../node_modules/@noble/curves/esm/ed25519.js","../../openchat-shared/node_modules/@dfinity/agent/lib/esm/agent/http/index.js","../../openchat-shared/node_modules/@dfinity/agent/lib/esm/agent/proxy.js","../../openchat-shared/node_modules/@dfinity/agent/lib/esm/der.js","../../openchat-shared/node_modules/@dfinity/identity/lib/esm/identity/ecdsa.js","../../openchat-shared/node_modules/@dfinity/identity/lib/esm/identity/delegation.js","../../openchat-shared/node_modules/@dfinity/identity/lib/esm/identity/webauthn.js","../../node_modules/idb/build/wrap-idb-value.js","../../node_modules/idb/build/index.js","../../openchat-shared/node_modules/@dfinity/auth-client/lib/esm/db.js","../../openchat-shared/node_modules/@dfinity/auth-client/lib/esm/storage.js","../../node_modules/rollbar/dist/rollbar.umd.min.js","../../node_modules/dayjs/plugin/quarterOfYear.js","../../node_modules/dayjs/dayjs.min.js","../../node_modules/chrono-node/dist/esm/types.js","../../node_modules/chrono-node/dist/esm/utils/dayjs.js","../../node_modules/chrono-node/dist/esm/timezone.js","../../node_modules/chrono-node/dist/esm/results.js","../../node_modules/chrono-node/dist/esm/utils/pattern.js","../../node_modules/chrono-node/dist/esm/calculation/years.js","../../node_modules/chrono-node/dist/esm/locales/en/constants.js","../../node_modules/chrono-node/dist/esm/common/parsers/AbstractParserWithWordBoundary.js","../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENTimeUnitWithinFormatParser.js","../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENMonthNameLittleEndianParser.js","../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENMonthNameMiddleEndianParser.js","../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENMonthNameParser.js","../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENYearMonthDayParser.js","../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENSlashMonthFormatParser.js","../../node_modules/chrono-node/dist/esm/common/parsers/AbstractTimeExpressionParser.js","../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENTimeExpressionParser.js","../../node_modules/chrono-node/dist/esm/utils/timeunits.js","../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENTimeUnitAgoFormatParser.js","../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENTimeUnitLaterFormatParser.js","../../node_modules/chrono-node/dist/esm/common/abstractRefiners.js","../../node_modules/chrono-node/dist/esm/common/refiners/AbstractMergeDateRangeRefiner.js","../../node_modules/chrono-node/dist/esm/locales/en/refiners/ENMergeDateRangeRefiner.js","../../node_modules/chrono-node/dist/esm/calculation/mergingCalculation.js","../../node_modules/chrono-node/dist/esm/common/refiners/AbstractMergeDateTimeRefiner.js","../../node_modules/chrono-node/dist/esm/locales/en/refiners/ENMergeDateTimeRefiner.js","../../node_modules/chrono-node/dist/esm/common/refiners/ExtractTimezoneAbbrRefiner.js","../../node_modules/chrono-node/dist/esm/common/refiners/ExtractTimezoneOffsetRefiner.js","../../node_modules/chrono-node/dist/esm/common/refiners/OverlapRemovalRefiner.js","../../node_modules/chrono-node/dist/esm/common/refiners/ForwardDateRefiner.js","../../node_modules/chrono-node/dist/esm/common/refiners/UnlikelyFormatFilter.js","../../node_modules/chrono-node/dist/esm/common/parsers/ISOFormatParser.js","../../node_modules/chrono-node/dist/esm/common/refiners/MergeWeekdayComponentRefiner.js","../../node_modules/chrono-node/dist/esm/common/casualReferences.js","../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENCasualDateParser.js","../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENCasualTimeParser.js","../../node_modules/chrono-node/dist/esm/common/calculation/weekdays.js","../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENWeekdayParser.js","../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENRelativeDateFormatParser.js","../../node_modules/chrono-node/dist/esm/common/parsers/SlashDateFormatParser.js","../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENTimeUnitCasualRelativeFormatParser.js","../../node_modules/chrono-node/dist/esm/locales/en/refiners/ENMergeRelativeAfterDateRefiner.js","../../node_modules/chrono-node/dist/esm/locales/en/refiners/ENMergeRelativeFollowByDateRefiner.js","../../node_modules/chrono-node/dist/esm/locales/en/refiners/ENExtractYearSuffixRefiner.js","../../node_modules/chrono-node/dist/esm/locales/en/refiners/ENUnlikelyFormatFilter.js","../../node_modules/chrono-node/dist/esm/locales/en/configuration.js","../../node_modules/chrono-node/dist/esm/configurations.js","../../node_modules/chrono-node/dist/esm/chrono.js","../../node_modules/chrono-node/dist/esm/locales/en/index.js","../../node_modules/chrono-node/dist/esm/index.js","../../node_modules/drange/lib/index.js","../../node_modules/identicon.js/pnglib.js","../../node_modules/identicon.js/identicon.js","../../node_modules/crypt/crypt.js","../../node_modules/charenc/charenc.js","../../node_modules/is-buffer/index.js","../../node_modules/md5/md5.js","../../node_modules/peerjs-js-binarypack/dist/binarypack.mjs","../../node_modules/webrtc-adapter/src/js/utils.js","../../node_modules/webrtc-adapter/src/js/chrome/getusermedia.js","../../node_modules/webrtc-adapter/src/js/chrome/chrome_shim.js","../../node_modules/webrtc-adapter/src/js/chrome/getdisplaymedia.js","../../node_modules/webrtc-adapter/src/js/firefox/getusermedia.js","../../node_modules/webrtc-adapter/src/js/firefox/firefox_shim.js","../../node_modules/webrtc-adapter/src/js/firefox/getdisplaymedia.js","../../node_modules/webrtc-adapter/src/js/safari/safari_shim.js","../../node_modules/sdp/sdp.js","../../node_modules/webrtc-adapter/src/js/common_shim.js","../../node_modules/webrtc-adapter/src/js/adapter_core.js","../../node_modules/webrtc-adapter/src/js/adapter_factory.js","../../node_modules/cbor-x/decode.js","../../node_modules/cbor-x/encode.js","../../node_modules/process/browser.js","../../node_modules/peerjs/dist/bundler.mjs","../../openchat-client/node_modules/@dfinity/agent/lib/esm/agent/api.js","../../openchat-client/node_modules/@dfinity/principal/lib/esm/utils/base32.js","../../openchat-client/node_modules/@dfinity/principal/lib/esm/utils/getCrc.js","../../openchat-client/node_modules/@dfinity/principal/lib/esm/index.js","../../openchat-client/node_modules/@dfinity/principal/lib/esm/utils/sha224.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/utils/buffer.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/errors.js","../../openchat-client/node_modules/@dfinity/candid/lib/esm/utils/buffer.js","../../openchat-client/node_modules/@dfinity/candid/lib/esm/utils/hash.js","../../openchat-client/node_modules/@dfinity/candid/lib/esm/utils/leb128.js","../../openchat-client/node_modules/@dfinity/candid/lib/esm/utils/bigint-math.js","../../openchat-client/node_modules/@dfinity/candid/lib/esm/idl.js","../../openchat-client/node_modules/@dfinity/agent/node_modules/borc/node_modules/buffer/index.js","../../openchat-client/node_modules/@dfinity/agent/node_modules/borc/src/constants.js","../../openchat-client/node_modules/@dfinity/agent/node_modules/borc/src/utils.js","../../openchat-client/node_modules/@dfinity/agent/node_modules/borc/src/simple.js","../../openchat-client/node_modules/@dfinity/agent/node_modules/borc/src/tagged.js","../../openchat-client/node_modules/@dfinity/agent/node_modules/borc/src/decoder.js","../../openchat-client/node_modules/@dfinity/agent/node_modules/borc/src/decoder.asm.js","../../openchat-client/node_modules/@dfinity/agent/node_modules/borc/src/diagnose.js","../../openchat-client/node_modules/@dfinity/agent/node_modules/borc/src/encoder.js","../../openchat-client/node_modules/@dfinity/agent/node_modules/borc/src/index.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/request_id.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/auth.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/cbor.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/utils/random.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/agent/http/types.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/agent/http/transforms.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/agent/http/errors.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/utils/bls.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/utils/leb.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/certificate.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/canisterStatus/index.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/utils/expirableMap.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/der.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/public_key.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/observable.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/polling/backoff.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/constants.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/agent/http/index.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/agent/proxy.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/agent/index.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/polling/strategy.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/polling/index.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/canisters/management_idl.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/actor.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/canisters/asset_idl.js","../../openchat-client/node_modules/@dfinity/identity/lib/esm/identity/ed25519.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/canisters/asset.js","../../openchat-client/node_modules/@dfinity/agent/lib/esm/fetch_candid.js","../../openchat-client/node_modules/@dfinity/identity/lib/esm/identity/ecdsa.js","../../openchat-client/node_modules/@dfinity/identity/lib/esm/identity/partial.js","../../openchat-client/node_modules/@dfinity/identity/lib/esm/identity/delegation.js","../../openchat-client/node_modules/@dfinity/identity/node_modules/buffer/index.js","../../openchat-client/node_modules/@dfinity/identity/node_modules/borc/src/constants.js","../../openchat-client/node_modules/@dfinity/identity/node_modules/borc/src/utils.js","../../openchat-client/node_modules/@dfinity/identity/node_modules/borc/src/simple.js","../../openchat-client/node_modules/@dfinity/identity/node_modules/borc/src/tagged.js","../../openchat-client/node_modules/@dfinity/identity/node_modules/borc/src/decoder.js","../../openchat-client/node_modules/@dfinity/identity/node_modules/borc/src/decoder.asm.js","../../openchat-client/node_modules/@dfinity/identity/node_modules/borc/src/diagnose.js","../../openchat-client/node_modules/@dfinity/identity/node_modules/borc/src/encoder.js","../../openchat-client/node_modules/@dfinity/identity/node_modules/borc/src/index.js","../../openchat-client/node_modules/@dfinity/identity/lib/esm/identity/webauthn.js","../../openchat-client/node_modules/@dfinity/auth-client/lib/esm/idleManager.js","../../openchat-client/node_modules/@dfinity/auth-client/lib/esm/db.js","../../openchat-client/node_modules/@dfinity/auth-client/lib/esm/storage.js","../../openchat-client/node_modules/@dfinity/auth-client/lib/esm/index.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/pageVisibility/PageVisibilityApi.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/utils.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/pageVisibility/PageVisibilityTracker.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/canisters/coordinator.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/store/KeyValueStore.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/store/InMemoryKeyValueStore.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/store/KeyValueStoreFacade.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/store/LocalStorageKeyValueStore.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/APIStorage.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/canisters/clientRegistry.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/ClientRegistryApi.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/CoordinatorAPI.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/canisters/constants.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/canisters/analyticsStore.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/AnalyticsStoreApi.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/APIService.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/tracker/Report.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/tracker/ReportsStorage.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/tracker/Configuration.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/tracker/Uploader.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/tracker/Tracker.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/UsergeekClient.js","../../openchat-client/node_modules/usergeek-ic-js/lib/es5/index.js","../../openchat-client/node_modules/borc/src/constants.js","../../openchat-client/node_modules/borc/src/utils.js","../../openchat-client/node_modules/borc/src/simple.js","../../openchat-client/node_modules/borc/src/tagged.js","../../openchat-client/node_modules/borc/node_modules/iso-url/src/url-browser.js","../../openchat-client/node_modules/borc/node_modules/iso-url/src/relative.js","../../openchat-client/node_modules/borc/node_modules/iso-url/index.js","../../openchat-client/node_modules/borc/src/decoder.js","../../openchat-client/node_modules/borc/src/decoder.asm.js","../../openchat-client/node_modules/borc/src/diagnose.js","../../openchat-client/node_modules/borc/src/encoder.js","../../openchat-client/node_modules/borc/src/index.js","../../node_modules/marked/lib/marked.esm.js","../../node_modules/page/page.js","../../node_modules/svelte-material-icons/Close.svelte","../../node_modules/svelte-material-icons/CompassOutline.svelte","../../node_modules/svelte-material-icons/Robot.svelte","../../node_modules/svelte/src/transition/index.js","../../node_modules/svelte-material-icons/Cancel.svelte","../node_modules/@dfinity/agent/lib/esm/agent/api.js","../../node_modules/svelte-material-icons/Check.svelte","../node_modules/@dfinity/principal/lib/esm/utils/base32.js","../node_modules/@dfinity/principal/lib/esm/utils/getCrc.js","../node_modules/@dfinity/principal/lib/esm/index.js","../node_modules/@dfinity/principal/lib/esm/utils/sha224.js","../node_modules/@dfinity/agent/lib/esm/utils/buffer.js","../node_modules/@dfinity/candid/lib/esm/utils/buffer.js","../node_modules/@dfinity/candid/lib/esm/utils/hash.js","../node_modules/@dfinity/candid/lib/esm/utils/leb128.js","../node_modules/@dfinity/candid/lib/esm/utils/bigint-math.js","../node_modules/@dfinity/candid/lib/esm/idl.js","../node_modules/@dfinity/agent/lib/esm/request_id.js","../node_modules/@dfinity/agent/lib/esm/auth.js","../node_modules/@dfinity/agent/lib/esm/cbor.js","../node_modules/@dfinity/agent/lib/esm/agent/http/types.js","../node_modules/@dfinity/agent/lib/esm/certificate.js","../node_modules/@dfinity/agent/lib/esm/agent/http/transforms.js","../node_modules/@dfinity/agent/lib/esm/der.js","../node_modules/@dfinity/agent/lib/esm/agent/http/index.js","../node_modules/@dfinity/agent/lib/esm/agent/proxy.js","../node_modules/@dfinity/identity/lib/esm/identity/ed25519.js","../node_modules/@dfinity/identity/lib/esm/identity/ecdsa.js","../node_modules/@dfinity/identity/lib/esm/identity/partial.js","../node_modules/@dfinity/identity/lib/esm/identity/delegation.js","../node_modules/@dfinity/identity/lib/esm/identity/webauthn.js","../node_modules/@dfinity/auth-client/lib/esm/idleManager.js","../node_modules/@dfinity/auth-client/lib/esm/db.js","../node_modules/@dfinity/auth-client/lib/esm/storage.js","../node_modules/@dfinity/auth-client/lib/esm/index.js","../../node_modules/svelte-material-icons/BellOff.svelte","../../node_modules/svelte-material-icons/CheckboxMultipleMarked.svelte","../../node_modules/svelte-material-icons/Contain.svelte","../../node_modules/svelte-material-icons/AccountMultiple.svelte","../../node_modules/svelte-material-icons/AccountMultiplePlus.svelte","../../node_modules/svelte-material-icons/PencilOutline.svelte","../../node_modules/svelte-material-icons/LocationExit.svelte","../../node_modules/svelte-material-icons/FileDocument.svelte","../../node_modules/svelte-material-icons/PlaylistPlus.svelte","../../node_modules/svelte-material-icons/DeleteOutline.svelte","../../node_modules/svelte-material-icons/DotsVertical.svelte","../../node_modules/svelte-material-icons/Magnify.svelte","../../node_modules/svelte-material-icons/CameraTimer.svelte","../../node_modules/svelte-material-icons/Delete.svelte","../../node_modules/svelte-material-icons/Heart.svelte","../../node_modules/svelte-material-icons/Pin.svelte","../../node_modules/svelte-material-icons/PinOff.svelte","../../node_modules/svelte-material-icons/Bell.svelte","../../node_modules/svelte-material-icons/Archive.svelte","../../node_modules/dompurify/dist/purify.es.mjs","../../node_modules/emoji-picker-element/database.js","../../node_modules/emoji-picker-element/picker.js","../../node_modules/svelte/src/easing/index.js","../../node_modules/@daily-co/daily-js/dist/daily-esm.js","../../node_modules/svelte-material-icons/ArrowExpand.svelte","../../node_modules/svelte-material-icons/ArrowCollapse.svelte","../../node_modules/svelte-material-icons/MusicNote.svelte","../../node_modules/svelte-material-icons/Pause.svelte","../../node_modules/svelte-material-icons/Poll.svelte","../../node_modules/svelte-material-icons/CheckCircleOutline.svelte","../../node_modules/svelte-material-icons/FileDownload.svelte","../../node_modules/svelte-material-icons/Clock.svelte","../../node_modules/svelte-confetti/dist/Confetti.svelte","../../node_modules/@fingerprintjs/botd/dist/botd.esm.js","../../node_modules/svelte-material-icons/ContentCopy.svelte","../../node_modules/qrcode/lib/core/utils.js","../../node_modules/qrcode/lib/core/bit-buffer.js","../../node_modules/qrcode/lib/core/error-correction-level.js","../../node_modules/qrcode/lib/core/bit-matrix.js","../../node_modules/qrcode/lib/core/alignment-pattern.js","../../node_modules/qrcode/lib/core/finder-pattern.js","../../node_modules/qrcode/lib/core/mask-pattern.js","../../node_modules/qrcode/lib/core/error-correction-code.js","../../node_modules/qrcode/lib/core/galois-field.js","../../node_modules/qrcode/lib/core/polynomial.js","../../node_modules/qrcode/lib/core/reed-solomon-encoder.js","../../node_modules/qrcode/lib/core/version-check.js","../../node_modules/qrcode/lib/core/regex.js","../../node_modules/qrcode/lib/core/mode.js","../../node_modules/qrcode/lib/core/version.js","../../node_modules/qrcode/lib/core/format-info.js","../../node_modules/qrcode/lib/core/numeric-data.js","../../node_modules/qrcode/lib/core/alphanumeric-data.js","../../node_modules/qrcode/lib/core/byte-data.js","../../node_modules/encode-utf8/index.js","../../node_modules/qrcode/lib/core/kanji-data.js","../../node_modules/dijkstrajs/dijkstra.js","../../node_modules/qrcode/lib/core/segments.js","../../node_modules/qrcode/lib/core/qrcode.js","../../node_modules/qrcode/lib/renderer/utils.js","../../node_modules/qrcode/lib/renderer/canvas.js","../../node_modules/qrcode/lib/renderer/svg-tag.js","../../node_modules/qrcode/lib/browser.js","../../node_modules/qrcode/lib/can-promise.js","../../node_modules/svelte-qrcode-image/QRCodeImage.svelte","../../node_modules/svelte-material-icons/ArrowExpandDown.svelte","../../node_modules/svelte-material-icons/Launch.svelte","../../node_modules/svelte-material-icons/OpenInNew.svelte","../../node_modules/svelte-material-icons/ThumbUp.svelte","../../node_modules/svelte-material-icons/ThumbDown.svelte","../../node_modules/svelte-material-icons/ChevronDown.svelte","../../node_modules/svelte/src/reactivity/date.js","../../node_modules/svelte/src/motion/utils.js","../../node_modules/svelte/src/motion/spring.js","../../node_modules/svelte/src/motion/tweened.js","../../node_modules/svelte-material-icons/SwapHorizontal.svelte","../../node_modules/svelte-material-icons/Refresh.svelte","../../node_modules/svelte-material-icons/Plus.svelte","../../node_modules/svelte/src/animate/index.js","../../node_modules/svelte-material-icons/CheckCircle.svelte","../../node_modules/svelte-material-icons/CloseCircle.svelte","../../node_modules/svelte-material-icons/EmoticonOutline.svelte","../../node_modules/svelte-material-icons/Share.svelte","../../node_modules/svelte-material-icons/AlertCircleOutline.svelte","../../node_modules/svelte-material-icons/Reply.svelte","../../node_modules/svelte-material-icons/ReplyOutline.svelte","../../node_modules/svelte-material-icons/Flag.svelte","../../node_modules/svelte-material-icons/DeleteOffOutline.svelte","../../node_modules/svelte-material-icons/Translate.svelte","../../node_modules/svelte-material-icons/Eye.svelte","../../node_modules/svelte-material-icons/TranslateOff.svelte","../../node_modules/svelte-material-icons/ShareVariant.svelte","../../node_modules/svelte-material-icons/ArrowCollapseUp.svelte","../../node_modules/svelte-material-icons/EyeArrowRight.svelte","../../node_modules/svelte-material-icons/EyeOff.svelte","../../node_modules/svelte-material-icons/ChatPlusOutline.svelte","../../node_modules/svelte-material-icons/ClockPlusOutline.svelte","../../node_modules/svelte-material-icons/ClockRemoveOutline.svelte","../../node_modules/svelte-material-icons/MenuDown.svelte","../../node_modules/svelte-material-icons/Alert.svelte","../../node_modules/svelte-material-icons/CogOutline.svelte","../../node_modules/svelte-material-icons/Send.svelte","../../node_modules/svelte-material-icons/ShieldAccount.svelte","../../node_modules/svelte-material-icons/HelpCircleOutline.svelte","../../node_modules/svelte-material-icons/ForumOutline.svelte","../../node_modules/svelte-material-icons/MessageOutline.svelte","../../node_modules/svelte-material-icons/HeartOutline.svelte","../../node_modules/svelte-material-icons/Alarm.svelte","../../node_modules/svelte-material-icons/AccountCheck.svelte","../../node_modules/svelte-material-icons/AccountPlusOutline.svelte","../../node_modules/svelte-material-icons/VectorCombine.svelte","../../node_modules/svelte-material-icons/ShieldLockOpenOutline.svelte","../../node_modules/svelte-material-icons/InformationOutline.svelte","../../node_modules/svelte-material-icons/LinkVariantPlus.svelte","../../node_modules/svelte-material-icons/ArrowRightBoldOutline.svelte","../../node_modules/svelte-material-icons/EmailOutline.svelte","../../node_modules/svelte-material-icons/Microphone.svelte","../../node_modules/svelte-material-icons/HandFrontLeft.svelte","../../node_modules/svelte-material-icons/MicrophoneOff.svelte","../../node_modules/svelte-material-icons/Video.svelte","../../node_modules/svelte-material-icons/VideoOff.svelte","../../node_modules/svelte-material-icons/MonitorShare.svelte","../../node_modules/svelte-material-icons/MonitorOff.svelte","../../node_modules/svelte-material-icons/PhoneHangup.svelte","../../node_modules/svelte-material-icons/BellRingOutline.svelte","../../node_modules/svelte-material-icons/EmoticonLolOutline.svelte","../../node_modules/svelte-material-icons/At.svelte","../../node_modules/svelte-material-icons/Bug.svelte","../../node_modules/svelte-material-icons/Pound.svelte","../../node_modules/svelte-material-icons/ArrowLeft.svelte","../../node_modules/svelte-material-icons/ArrowRight.svelte","../../node_modules/svelte-material-icons/ArrowUp.svelte","../../node_modules/svelte-material-icons/CloudOffOutline.svelte","../../node_modules/svelte-material-icons/Tune.svelte","../../node_modules/svelte-material-icons/Headphones.svelte","../../node_modules/svelte-material-icons/Import.svelte","../../node_modules/svelte-material-icons/ChatQuestion.svelte","../../node_modules/svelte-material-icons/ArrowDown.svelte","../../node_modules/svelte-material-icons/LockOutline.svelte","../../node_modules/svelte-material-icons/ContentSaveMoveOutline.svelte","../../node_modules/svelte-material-icons/RadioboxMarked.svelte","../../node_modules/svelte-material-icons/GiftOutline.svelte","../../node_modules/svelte-material-icons/StickerEmoji.svelte","../../node_modules/svelte-material-icons/LanguageMarkdownOutline.svelte","../../node_modules/svelte-material-icons/LanguageMarkdown.svelte","../../node_modules/svelty-picker/dist/settings.js","../../node_modules/svelty-picker/dist/i18n/index.js","../../node_modules/svelty-picker/dist/utils/constants.js","../../node_modules/svelty-picker/dist/utils/dateUtils.js","../../node_modules/svelty-picker/dist/utils/transitions.js","../../node_modules/svelty-picker/dist/components/Calendar.svelte","../../node_modules/svelty-picker/dist/utils/grid.js","../../node_modules/svelty-picker/dist/components/Time.svelte","../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../node_modules/svelty-picker/dist/utils/actions.js","../../node_modules/svelty-picker/dist/components/SveltyPicker.svelte","../../node_modules/svelty-picker/dist/utils/state.js","../../node_modules/svelte-material-icons/Information.svelte","../../node_modules/svelte-material-icons/PlusCircleOutline.svelte","../../node_modules/zod/lib/index.mjs","../../node_modules/svelte-material-icons/ChevronUp.svelte","../../node_modules/@memefighter/maker-core/dist/handlers.js","../../node_modules/@memefighter/maker-core/dist/client.js","../../node_modules/@memefighter/maker-core/dist/index.js","../../node_modules/svelte-material-icons/TextBoxOutline.svelte","../../node_modules/svelte-material-icons/KeyPlus.svelte","../../node_modules/svelte-material-icons/KeyRemove.svelte","../../node_modules/svelte-material-icons/HeartPlus.svelte","../../node_modules/svelte-material-icons/HeartMinus.svelte","../../node_modules/svelte-material-icons/ClockOutline.svelte","../../node_modules/svelte-easy-crop/dist/helpers.js","../../node_modules/svelte-easy-crop/dist/Cropper.svelte","../../node_modules/svelte-material-icons/Minus.svelte","../../node_modules/svelte-material-icons/Menu.svelte","../../node_modules/svelte-material-icons/TuneVertical.svelte","../../node_modules/svelte-material-icons/ShieldPlus.svelte","../../node_modules/svelte-material-icons/ShieldRemove.svelte","../../node_modules/svelte-material-icons/ShieldRefresh.svelte","../../node_modules/svelte-material-icons/WalletOutline.svelte","../../node_modules/svelte-material-icons/HeartRemoveOutline.svelte","../../node_modules/svelte-material-icons/ArrowRightBoldCircle.svelte","../../node_modules/svelte-material-icons/ArrowLeftBoldCircle.svelte","../../node_modules/svelte-material-icons/ViewList.svelte","../node_modules/@dfinity/candid/lib/cjs/utils/buffer.js","../node_modules/@dfinity/candid/lib/cjs/utils/hash.js","../node_modules/@dfinity/candid/lib/cjs/utils/leb128.js","../node_modules/@dfinity/candid/lib/cjs/utils/bigint-math.js","../node_modules/@dfinity/candid/lib/cjs/idl.js","../../node_modules/svelte-material-icons/QrcodeScan.svelte","../../node_modules/jsqr-es6/dist/jsQR.js","../../node_modules/svelte-material-icons/EyeOutline.svelte","../../node_modules/svelte-material-icons/EyeOffOutline.svelte","../../node_modules/svelte-material-icons/ArrowExpandRight.svelte","../../node_modules/svelte-material-icons/AccountSettingsOutline.svelte","../../node_modules/svelte-material-icons/Home.svelte","../../node_modules/svelte-material-icons/ChartLine.svelte","../../node_modules/svelte-material-icons/RoadVariant.svelte","../../node_modules/svelte-material-icons/NoteTextOutline.svelte","../../node_modules/svelte-material-icons/GraphOutline.svelte","../../node_modules/svelte-material-icons/PostOutline.svelte","../../node_modules/svelte-material-icons/Security.svelte","../../node_modules/svelte-material-icons/Logout.svelte","../../node_modules/svelte-material-icons/Login.svelte","../../node_modules/svelte-dnd-action/src/helpers/dispatcher.js","../../node_modules/svelte-dnd-action/src/constants.js","../../node_modules/svelte-dnd-action/src/helpers/intersection.js","../../node_modules/svelte-dnd-action/src/helpers/listUtil.js","../../node_modules/svelte-dnd-action/src/helpers/util.js","../../node_modules/svelte-dnd-action/src/helpers/observer.js","../../node_modules/svelte-dnd-action/src/helpers/scroller.js","../../node_modules/svelte-dnd-action/src/helpers/multiScroller.js","../../node_modules/svelte-dnd-action/src/featureFlags.js","../../node_modules/svelte-dnd-action/src/helpers/styler.js","../../node_modules/svelte-dnd-action/src/pointerAction.js","../../node_modules/svelte-dnd-action/src/helpers/svelteNodeClone.js","../../node_modules/svelte-dnd-action/src/helpers/aria.js","../../node_modules/svelte-dnd-action/src/keyboardAction.js","../../node_modules/svelte-dnd-action/src/action.js","../../node_modules/svelte-material-icons/PlayCircleOutline.svelte","../../node_modules/svelte-material-icons/PauseCircleOutline.svelte","../../node_modules/wavesurfer.js/dist/wavesurfer.esm.js","../../node_modules/svelte-material-icons/ChevronRight.svelte","../../node_modules/svelte-material-icons/ChevronLeft.svelte","../../node_modules/svelte-material-icons/Account.svelte","../../node_modules/svelte-material-icons/LinkOff.svelte","../../node_modules/svelte-material-icons/LinkVariantOff.svelte","../../node_modules/svelte-material-icons/AccountRemoveOutline.svelte","../../node_modules/svelte-material-icons/MinusCircleOutline.svelte","../../node_modules/svelte-material-icons/AccountCancel.svelte","../../node_modules/svelte-material-icons/TrophyOutline.svelte","../../node_modules/svelte-material-icons/Reload.svelte","../../node_modules/svelte-material-icons/ShoppingOutline.svelte","../../node_modules/svelte-material-icons/Monitor.svelte","../../node_modules/svelte-material-icons/Cellphone.svelte","../../node_modules/svelte-material-icons/WindowMaximize.svelte","../../node_modules/svelte-material-icons/WindowMinimize.svelte","../../node_modules/svelte-material-icons/Phone.svelte","../../node_modules/viem/_esm/errors/base.js","../../node_modules/viem/_esm/errors/utils.js","../../node_modules/viem/_esm/errors/encoding.js","../../node_modules/viem/_esm/errors/data.js","../../node_modules/viem/_esm/utils/data/pad.js","../../node_modules/viem/_esm/utils/data/isHex.js","../../node_modules/viem/_esm/utils/data/size.js","../../node_modules/viem/_esm/utils/encoding/toBytes.js","../../node_modules/viem/_esm/utils/encoding/fromHex.js","../../node_modules/viem/_esm/utils/encoding/toHex.js","../../node_modules/viem/_esm/errors/address.js","../../node_modules/viem/_esm/utils/lru.js","../../node_modules/viem/node_modules/@noble/hashes/esm/_assert.js","../../node_modules/viem/node_modules/@noble/hashes/esm/_u64.js","../../node_modules/viem/node_modules/@noble/hashes/esm/utils.js","../../node_modules/viem/node_modules/@noble/hashes/esm/sha3.js","../../node_modules/viem/_esm/utils/hash/keccak256.js","../../node_modules/viem/_esm/utils/address/getAddress.js","../../node_modules/viem/_esm/utils/address/isAddress.js","../../node_modules/viem/_esm/accounts/utils/parseAccount.js","../../node_modules/viem/_esm/errors/account.js","../../node_modules/viem/_esm/utils/stringify.js","../../node_modules/viem/_esm/errors/request.js","../../node_modules/viem/_esm/errors/rpc.js","../../node_modules/viem/_esm/utils/promise/createBatchScheduler.js","../../node_modules/viem/_esm/utils/promise/withDedupe.js","../../node_modules/viem/_esm/utils/promise/withRetry.js","../../node_modules/viem/_esm/utils/wait.js","../../node_modules/viem/_esm/utils/buildRequest.js","../../node_modules/viem/_esm/utils/promise/withTimeout.js","../../node_modules/viem/_esm/utils/rpc/id.js","../../node_modules/viem/_esm/actions/wallet/signMessage.js","../node_modules/@wagmi/core/dist/esm/version.js","../node_modules/@wagmi/core/dist/esm/errors/base.js","../node_modules/@wagmi/core/dist/esm/utils/getVersion.js","../node_modules/@wagmi/core/dist/esm/errors/config.js","../../node_modules/viem/_esm/utils/uid.js","../../node_modules/viem/_esm/clients/createClient.js","../../node_modules/viem/_esm/clients/transports/createTransport.js","../../node_modules/viem/_esm/errors/transport.js","../../node_modules/viem/_esm/clients/transports/http.js","../../node_modules/viem/_esm/utils/rpc/http.js","../node_modules/@wagmi/core/dist/esm/actions/getConnectorClient.js","../../node_modules/viem/_esm/clients/transports/custom.js","../node_modules/@wagmi/core/dist/esm/actions/signMessage.js","../node_modules/@wagmi/core/dist/esm/utils/getAction.js","../node_modules/@wagmi/core/dist/esm/errors/connector.js","../node_modules/@wagmi/core/dist/esm/connectors/injected.js","../node_modules/@wagmi/core/node_modules/mipd/dist/esm/store.js","../node_modules/@wagmi/core/node_modules/mipd/dist/esm/utils.js","../../node_modules/zustand/esm/middleware.mjs","../../node_modules/zustand/esm/vanilla.mjs","../node_modules/eventemitter3/index.js","../node_modules/@wagmi/core/dist/esm/createEmitter.js","../node_modules/@wagmi/core/dist/esm/utils/deserialize.js","../node_modules/@wagmi/core/dist/esm/utils/serialize.js","../node_modules/@wagmi/core/dist/esm/createStorage.js","../node_modules/@wagmi/core/dist/esm/utils/uid.js","../node_modules/@wagmi/core/dist/esm/createConfig.js","../node_modules/@wagmi/core/dist/esm/utils/extractRpcUrls.js","../node_modules/@wagmi/connectors/dist/esm/coinbaseWallet.js","../node_modules/@wagmi/connectors/dist/esm/metaMask.js","../node_modules/@wagmi/connectors/dist/esm/walletConnect.js","../../node_modules/@wagmi/chains/dist/index.mjs","../../node_modules/eventemitter3/index.js","../../node_modules/@solana/wallet-adapter-base/lib/esm/adapter.js","../../node_modules/@solana/wallet-adapter-base/lib/esm/types.js","../../node_modules/@solana/wallet-adapter-base/lib/esm/errors.js","../../node_modules/@solana/wallet-adapter-base/lib/esm/transaction.js","../../node_modules/@solana/wallet-adapter-base/lib/esm/signer.js","../../node_modules/bn.js/lib/bn.js","../../node_modules/safe-buffer/index.js","../../node_modules/base-x/src/index.js","../../node_modules/@solana/web3.js/node_modules/bs58/index.js","../../node_modules/borsh/node_modules/bs58/index.js","../../node_modules/text-encoding-utf-8/lib/encoding.lib.mjs","../../node_modules/borsh/lib/index.js","../../node_modules/@solana/buffer-layout/lib/Layout.js","../../node_modules/bigint-buffer/dist/browser.js","../../node_modules/@solana/web3.js/node_modules/superstruct/lib/index.es.js","../../node_modules/jayson/node_modules/uuid/dist/esm-browser/rng.js","../../node_modules/jayson/node_modules/uuid/dist/esm-browser/regex.js","../../node_modules/jayson/node_modules/uuid/dist/esm-browser/validate.js","../../node_modules/jayson/node_modules/uuid/dist/esm-browser/stringify.js","../../node_modules/jayson/node_modules/uuid/dist/esm-browser/v1.js","../../node_modules/jayson/node_modules/uuid/dist/esm-browser/parse.js","../../node_modules/jayson/node_modules/uuid/dist/esm-browser/v35.js","../../node_modules/jayson/node_modules/uuid/dist/esm-browser/md5.js","../../node_modules/jayson/node_modules/uuid/dist/esm-browser/v3.js","../../node_modules/jayson/node_modules/uuid/dist/esm-browser/sha1.js","../../node_modules/jayson/node_modules/uuid/dist/esm-browser/v5.js","../../node_modules/jayson/node_modules/uuid/dist/esm-browser/nil.js","../../node_modules/jayson/node_modules/uuid/dist/esm-browser/v4.js","../../node_modules/jayson/node_modules/uuid/dist/esm-browser/version.js","../../node_modules/jayson/lib/generateRequest.js","../../node_modules/jayson/lib/client/browser/index.js","../../node_modules/rpc-websockets/dist/lib/utils.js","../../node_modules/rpc-websockets/dist/lib/client.js","../../node_modules/rpc-websockets/dist/lib/client/websocket.browser.js","../../node_modules/@noble/hashes/esm/hmac.js","../../node_modules/@noble/curves/esm/_shortw_utils.js","../../node_modules/@noble/curves/esm/secp256k1.js","../../node_modules/@solana/web3.js/lib/index.browser.esm.js","../../node_modules/@solana/wallet-adapter-coinbase/lib/esm/adapter.js","../../node_modules/@solana/wallet-adapter-phantom/lib/esm/adapter.js","../../node_modules/@solana/wallet-adapter-walletconnect/lib/esm/adapter.js","../../node_modules/bs58/node_modules/base-x/src/index.js","../../node_modules/bs58/index.js","../node_modules/@coinbase/wallet-sdk/dist/assets/wallet-logo.js","../node_modules/@coinbase/wallet-sdk/dist/core/error/constants.js","../node_modules/@coinbase/wallet-sdk/dist/core/error/utils.js","../node_modules/@coinbase/wallet-sdk/dist/core/error/errors.js","../node_modules/@coinbase/wallet-sdk/dist/core/error/index.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/type/Web3Response.js","../node_modules/@coinbase/wallet-sdk/dist/version.js","../node_modules/@coinbase/wallet-sdk/dist/core/error/serialize.js","../node_modules/@coinbase/wallet-sdk/dist/core/type/index.js","../node_modules/@coinbase/wallet-sdk/dist/core/type/util.js","../node_modules/@coinbase/wallet-sdk/dist/util/cipher.js","../node_modules/@coinbase/wallet-sdk/dist/util/ScopedLocalStorage.js","../node_modules/@coinbase/wallet-sdk/dist/sign/scw/SCWKeyManager.js","../node_modules/@coinbase/wallet-sdk/dist/sign/scw/SCWStateManager.js","../node_modules/@coinbase/wallet-sdk/dist/sign/scw/SCWSigner.js","../../node_modules/events/events.js","../../node_modules/readable-stream/lib/internal/streams/stream-browser.js","../../node_modules/readable-stream/lib/internal/streams/buffer_list.js","../../node_modules/readable-stream/lib/internal/streams/destroy.js","../../node_modules/readable-stream/errors-browser.js","../../node_modules/readable-stream/lib/internal/streams/state.js","../../node_modules/inherits/inherits_browser.js","../../node_modules/util-deprecate/browser.js","../../node_modules/readable-stream/lib/_stream_writable.js","../../node_modules/readable-stream/lib/_stream_duplex.js","../../node_modules/string_decoder/lib/string_decoder.js","../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js","../../node_modules/readable-stream/lib/internal/streams/async_iterator.js","../../node_modules/readable-stream/lib/_stream_readable.js","../../node_modules/readable-stream/lib/internal/streams/from-browser.js","../../node_modules/readable-stream/lib/_stream_transform.js","../../node_modules/readable-stream/lib/_stream_passthrough.js","../../node_modules/readable-stream/lib/internal/streams/pipeline.js","../../node_modules/readable-stream/readable-browser.js","../../node_modules/keccak/lib/api/keccak.js","../../node_modules/keccak/lib/api/shake.js","../../node_modules/keccak/lib/api/index.js","../../node_modules/keccak/lib/keccak-state-unroll.js","../../node_modules/keccak/lib/keccak.js","../../node_modules/keccak/js.js","../node_modules/@coinbase/wallet-sdk/dist/vendor-js/eth-eip712-util/util.js","../node_modules/@coinbase/wallet-sdk/dist/vendor-js/eth-eip712-util/abi.js","../node_modules/@coinbase/wallet-sdk/dist/vendor-js/eth-eip712-util/index.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/constants.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/RelayEventManager.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/connection/WalletLinkCipher.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/connection/WalletLinkHTTP.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/connection/WalletLinkWebSocket.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/connection/WalletLinkConnection.js","../../node_modules/sha.js/hash.js","../../node_modules/sha.js/sha.js","../../node_modules/sha.js/sha1.js","../../node_modules/sha.js/sha256.js","../../node_modules/sha.js/sha224.js","../../node_modules/sha.js/sha512.js","../../node_modules/sha.js/sha384.js","../../node_modules/sha.js/index.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/type/WalletLinkSession.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/ui/components/util.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/ui/components/cssReset/cssReset-css.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/ui/components/cssReset/cssReset.js","../../node_modules/clsx/dist/clsx.m.js","../../node_modules/preact/dist/preact.module.js","../../node_modules/preact/hooks/dist/hooks.module.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/ui/components/Snackbar/Snackbar-css.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/ui/components/Snackbar/Snackbar.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/ui/WalletLinkRelayUI.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/ui/components/RedirectDialog/RedirectDialog-css.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/ui/components/RedirectDialog/RedirectDialog.js","../node_modules/@coinbase/wallet-sdk/dist/core/constants.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/ui/WLMobileRelayUI.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/relay/WalletLinkRelay.js","../node_modules/@coinbase/wallet-sdk/dist/sign/walletlink/WalletLinkSigner.js","../node_modules/@coinbase/wallet-sdk/dist/util/provider.js","../node_modules/@coinbase/wallet-sdk/dist/sign/util.js","../node_modules/@coinbase/wallet-sdk/dist/core/communicator/util.js","../node_modules/@coinbase/wallet-sdk/dist/core/communicator/Communicator.js","../node_modules/@coinbase/wallet-sdk/dist/core/provider/method.js","../node_modules/@coinbase/wallet-sdk/dist/CoinbaseWalletProvider.js","../node_modules/@coinbase/wallet-sdk/dist/CoinbaseWalletSDK.js","../node_modules/@coinbase/wallet-sdk/dist/index.js","../../node_modules/cbw-sdk/dist/assets/wallet-logo.js","../../node_modules/cbw-sdk/dist/core/constants.js","../../node_modules/cbw-sdk/dist/core/error/constants.js","../../node_modules/cbw-sdk/dist/core/error/utils.js","../../node_modules/cbw-sdk/dist/core/error/errors.js","../../node_modules/cbw-sdk/dist/relay/walletlink/type/Web3Response.js","../../node_modules/cbw-sdk/dist/version.js","../../node_modules/cbw-sdk/dist/core/error/serialize.js","../../node_modules/cbw-sdk/dist/core/error/index.js","../../node_modules/cbw-sdk/dist/core/type.js","../../node_modules/cbw-sdk/dist/core/util.js","../../node_modules/cbw-sdk/dist/lib/ScopedLocalStorage.js","../../node_modules/cbw-sdk/node_modules/eventemitter3/index.js","../../node_modules/cbw-sdk/dist/provider/DiagnosticLogger.js","../../node_modules/cbw-sdk/dist/relay/RelayAbstract.js","../../node_modules/cbw-sdk/dist/relay/Session.js","../../node_modules/cbw-sdk/dist/lib/Cipher.js","../../node_modules/cbw-sdk/dist/relay/walletlink/connection/WalletLinkHTTP.js","../../node_modules/cbw-sdk/dist/relay/walletlink/connection/WalletLinkWebSocket.js","../../node_modules/cbw-sdk/dist/relay/walletlink/connection/WalletLinkConnection.js","../../node_modules/cbw-sdk/dist/lib/cssReset-css.js","../../node_modules/cbw-sdk/dist/lib/cssReset.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/icons/CloseIcon.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/icons/CoinbaseWalletRound.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/icons/QRCodeIcon.js","../../node_modules/cbw-sdk/dist/vendor-js/qrcode-svg/index.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/QRCode.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/Spinner/Spinner-css.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/Spinner/Spinner.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/ConnectContent/ConnectContent-css.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/ConnectContent/ConnectContent.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/icons/ArrowLeftIcon.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/icons/LaptopIcon.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/icons/SafeIcon.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/TryExtensionContent/TryExtensionContent-css.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/TryExtensionContent/TryExtensionContent.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/ConnectDialog/ConnectDialog-css.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/ConnectDialog/ConnectDialog.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/LinkFlow/LinkFlow.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/Snackbar/Snackbar-css.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/Snackbar/Snackbar.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/WalletLinkRelayUI.js","../../node_modules/cbw-sdk/dist/relay/walletlink/WalletLinkRelay.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/Snackbar/index.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/RedirectDialog/RedirectDialog-css.js","../../node_modules/cbw-sdk/dist/relay/walletlink/ui/components/RedirectDialog/RedirectDialog.js","../../node_modules/cbw-sdk/dist/relay/mobile/MobileRelayUI.js","../../node_modules/cbw-sdk/dist/relay/mobile/MobileRelay.js","../../node_modules/cbw-sdk/dist/vendor-js/eth-eip712-util/util.js","../../node_modules/cbw-sdk/dist/vendor-js/eth-eip712-util/abi.js","../../node_modules/cbw-sdk/dist/vendor-js/eth-eip712-util/index.js","../../node_modules/cbw-sdk/dist/provider/FilterPolyfill.js","../../node_modules/json-rpc-random-id/index.js","../../node_modules/pify/index.js","../../node_modules/@metamask/safe-event-emitter/dist/cjs/index.js","../../node_modules/eth-block-tracker/dist/BaseBlockTracker.js","../../node_modules/superstruct/dist/index.mjs","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/assert.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/base64.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/hex.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/bytes.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/checksum.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/coercers.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/collections.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/encryption-types.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/json.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/keyring.js","../../node_modules/ms/index.js","../../node_modules/debug/src/common.js","../../node_modules/debug/src/browser.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/logging.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/misc.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/number.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/opaque.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/time.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/transaction-types.js","../../node_modules/eth-block-tracker/node_modules/semver/internal/constants.js","../../node_modules/eth-block-tracker/node_modules/semver/internal/debug.js","../../node_modules/eth-block-tracker/node_modules/semver/internal/re.js","../../node_modules/eth-block-tracker/node_modules/semver/internal/parse-options.js","../../node_modules/eth-block-tracker/node_modules/semver/internal/identifiers.js","../../node_modules/eth-block-tracker/node_modules/semver/classes/semver.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/parse.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/valid.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/clean.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/inc.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/diff.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/major.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/minor.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/patch.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/prerelease.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/compare.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/rcompare.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/compare-loose.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/compare-build.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/sort.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/rsort.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/gt.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/lt.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/eq.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/neq.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/gte.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/lte.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/cmp.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/coerce.js","../../node_modules/eth-block-tracker/node_modules/semver/classes/range.js","../../node_modules/eth-block-tracker/node_modules/semver/internal/lrucache.js","../../node_modules/eth-block-tracker/node_modules/semver/classes/comparator.js","../../node_modules/eth-block-tracker/node_modules/semver/functions/satisfies.js","../../node_modules/eth-block-tracker/node_modules/semver/ranges/to-comparators.js","../../node_modules/eth-block-tracker/node_modules/semver/ranges/max-satisfying.js","../../node_modules/eth-block-tracker/node_modules/semver/ranges/min-satisfying.js","../../node_modules/eth-block-tracker/node_modules/semver/ranges/min-version.js","../../node_modules/eth-block-tracker/node_modules/semver/ranges/valid.js","../../node_modules/eth-block-tracker/node_modules/semver/ranges/outside.js","../../node_modules/eth-block-tracker/node_modules/semver/ranges/gtr.js","../../node_modules/eth-block-tracker/node_modules/semver/ranges/ltr.js","../../node_modules/eth-block-tracker/node_modules/semver/ranges/intersects.js","../../node_modules/eth-block-tracker/node_modules/semver/ranges/simplify.js","../../node_modules/eth-block-tracker/node_modules/semver/ranges/subset.js","../../node_modules/eth-block-tracker/node_modules/semver/index.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/versions.js","../../node_modules/eth-block-tracker/node_modules/@metamask/utils/dist/index.js","../../node_modules/eth-block-tracker/dist/logging-utils.js","../../node_modules/eth-block-tracker/dist/PollingBlockTracker.js","../../node_modules/eth-block-tracker/dist/SubscribeBlockTracker.js","../../node_modules/eth-block-tracker/dist/index.js","../../node_modules/json-rpc-engine/dist/getUniqueId.js","../../node_modules/json-rpc-engine/dist/idRemapMiddleware.js","../../node_modules/json-rpc-engine/dist/createAsyncMiddleware.js","../../node_modules/json-rpc-engine/dist/createScaffoldMiddleware.js","../../node_modules/json-rpc-engine/node_modules/@metamask/safe-event-emitter/index.js","../../node_modules/fast-safe-stringify/index.js","../../node_modules/eth-rpc-errors/dist/classes.js","../../node_modules/eth-rpc-errors/dist/error-constants.js","../../node_modules/eth-rpc-errors/dist/utils.js","../../node_modules/eth-rpc-errors/dist/errors.js","../../node_modules/eth-rpc-errors/dist/index.js","../../node_modules/json-rpc-engine/dist/JsonRpcEngine.js","../../node_modules/json-rpc-engine/dist/mergeMiddleware.js","../../node_modules/json-rpc-engine/dist/index.js","../../node_modules/async-mutex/lib/Semaphore.js","../../node_modules/async-mutex/lib/Mutex.js","../../node_modules/async-mutex/lib/withTimeout.js","../../node_modules/async-mutex/lib/index.js","../../node_modules/xtend/immutable.js","../../node_modules/eth-query/index.js","../../node_modules/eth-json-rpc-filters/node_modules/pify/index.js","../../node_modules/eth-json-rpc-filters/base-filter.js","../../node_modules/eth-json-rpc-filters/base-filter-history.js","../../node_modules/eth-json-rpc-filters/hexUtils.js","../../node_modules/eth-json-rpc-filters/log-filter.js","../../node_modules/eth-json-rpc-filters/getBlocksForRange.js","../../node_modules/eth-json-rpc-filters/block-filter.js","../../node_modules/eth-json-rpc-filters/tx-filter.js","../../node_modules/eth-json-rpc-filters/index.js","../../node_modules/eth-json-rpc-filters/subscriptionManager.js","../../node_modules/cbw-sdk/dist/provider/SubscriptionManager.js","../../node_modules/cbw-sdk/dist/provider/CoinbaseWalletProvider.js","../../node_modules/cbw-sdk/dist/relay/RelayEventManager.js","../../node_modules/cbw-sdk/dist/CoinbaseWalletSDK.js","../../node_modules/cbw-sdk/dist/index.js","../node_modules/@wagmi/connectors/node_modules/@metamask/sdk/dist/browser/umd/metamask-sdk.js","../../node_modules/detect-browser/es/index.js","../../node_modules/@walletconnect/time/dist/cjs/constants/index.js","../../node_modules/@walletconnect/time/dist/cjs/constants/misc.js","../../node_modules/@walletconnect/time/dist/cjs/constants/time.js","../../node_modules/@walletconnect/time/dist/cjs/utils/index.js","../../node_modules/@walletconnect/time/dist/cjs/utils/delay.js","../../node_modules/@walletconnect/time/dist/cjs/utils/convert.js","../../node_modules/@walletconnect/time/dist/cjs/types/index.js","../../node_modules/@walletconnect/time/dist/cjs/types/watch.js","../../node_modules/@walletconnect/time/dist/cjs/index.js","../../node_modules/@walletconnect/time/dist/cjs/watch.js","../../node_modules/@walletconnect/window-getters/dist/cjs/index.js","../../node_modules/@walletconnect/window-metadata/dist/cjs/index.js","../../node_modules/strict-uri-encode/index.js","../node_modules/decode-uri-component/index.js","../node_modules/split-on-first/index.js","../node_modules/filter-obj/index.js","../node_modules/query-string/index.js","../../node_modules/@stablelib/int/lib/int.js","../../node_modules/@stablelib/binary/lib/binary.js","../../node_modules/@stablelib/wipe/lib/wipe.js","../../node_modules/@stablelib/chacha/lib/chacha.js","../../node_modules/@stablelib/constant-time/lib/constant-time.js","../../node_modules/@stablelib/poly1305/lib/poly1305.js","../../node_modules/@stablelib/chacha20poly1305/lib/chacha20poly1305.js","../../node_modules/@stablelib/hash/lib/hash.js","../../node_modules/@stablelib/hmac/lib/hmac.js","../../node_modules/@stablelib/hkdf/lib/hkdf.js","../../node_modules/@stablelib/random/lib/source/browser.js","../../node_modules/@stablelib/random/lib/source/node.js","../../node_modules/@stablelib/random/lib/source/system.js","../../node_modules/@stablelib/random/lib/random.js","../../node_modules/@stablelib/sha256/lib/sha256.js","../../node_modules/uint8arrays/esm/src/alloc.js","../../node_modules/uint8arrays/esm/src/concat.js","../../node_modules/@stablelib/x25519/lib/x25519.js","../../node_modules/multiformats/esm/vendor/base-x.js","../../node_modules/multiformats/esm/src/bases/base.js","../../node_modules/multiformats/esm/src/bytes.js","../../node_modules/multiformats/esm/src/bases/identity.js","../../node_modules/multiformats/esm/src/bases/base2.js","../../node_modules/multiformats/esm/src/bases/base8.js","../../node_modules/multiformats/esm/src/bases/base10.js","../../node_modules/multiformats/esm/src/bases/base16.js","../../node_modules/multiformats/esm/src/bases/base32.js","../../node_modules/multiformats/esm/src/bases/base36.js","../../node_modules/multiformats/esm/src/bases/base58.js","../../node_modules/multiformats/esm/src/bases/base64.js","../../node_modules/multiformats/esm/src/bases/base256emoji.js","../../node_modules/multiformats/esm/src/codecs/json.js","../../node_modules/multiformats/esm/src/basics.js","../../node_modules/uint8arrays/esm/src/util/bases.js","../../node_modules/uint8arrays/esm/src/from-string.js","../../node_modules/uint8arrays/esm/src/to-string.js","../../node_modules/elliptic/node_modules/bn.js/lib/bn.js","../../node_modules/minimalistic-assert/index.js","../../node_modules/minimalistic-crypto-utils/lib/utils.js","../../node_modules/elliptic/lib/elliptic/utils.js","../../node_modules/brorand/index.js","../../node_modules/elliptic/lib/elliptic/curve/base.js","../../node_modules/elliptic/lib/elliptic/curve/short.js","../../node_modules/elliptic/lib/elliptic/curve/mont.js","../../node_modules/elliptic/lib/elliptic/curve/edwards.js","../../node_modules/elliptic/lib/elliptic/curve/index.js","../../node_modules/hash.js/lib/hash/utils.js","../../node_modules/hash.js/lib/hash/common.js","../../node_modules/hash.js/lib/hash/sha/common.js","../../node_modules/hash.js/lib/hash/sha/1.js","../../node_modules/hash.js/lib/hash/sha/256.js","../../node_modules/hash.js/lib/hash/sha/224.js","../../node_modules/hash.js/lib/hash/sha/512.js","../../node_modules/hash.js/lib/hash/sha/384.js","../../node_modules/hash.js/lib/hash/sha.js","../../node_modules/hash.js/lib/hash/ripemd.js","../../node_modules/hash.js/lib/hash/hmac.js","../../node_modules/hash.js/lib/hash.js","../../node_modules/elliptic/lib/elliptic/curves.js","../../node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js","../../node_modules/hmac-drbg/lib/hmac-drbg.js","../../node_modules/elliptic/lib/elliptic/ec/key.js","../../node_modules/elliptic/lib/elliptic/ec/signature.js","../../node_modules/elliptic/lib/elliptic/ec/index.js","../../node_modules/elliptic/lib/elliptic/eddsa/key.js","../../node_modules/elliptic/lib/elliptic/eddsa/signature.js","../../node_modules/elliptic/lib/elliptic/eddsa/index.js","../../node_modules/elliptic/lib/elliptic.js","../../node_modules/@stablelib/sha512/lib/sha512.js","../../node_modules/@stablelib/ed25519/lib/ed25519.js","../../node_modules/@walletconnect/relay-auth/dist/esm/constants.js","../../node_modules/@walletconnect/safe-json/dist/esm/index.js","../../node_modules/@walletconnect/relay-auth/dist/esm/utils.js","../../node_modules/@walletconnect/relay-auth/dist/esm/api.js","../node_modules/@walletconnect/relay-api/dist/index.es.js","../node_modules/@walletconnect/utils/dist/index.es.js","../../node_modules/destr/dist/index.mjs","../../node_modules/unstorage/dist/shared/unstorage.8581f561.mjs","../../node_modules/unstorage/dist/index.mjs","../../node_modules/idb-keyval/dist/index.js","../../node_modules/@walletconnect/keyvaluestorage/dist/index.es.js","../../node_modules/@walletconnect/events/dist/esm/events.js","../../node_modules/@walletconnect/heartbeat/dist/index.es.js","../../node_modules/quick-format-unescaped/index.js","../../node_modules/@walletconnect/logger/node_modules/pino/browser.js","../../node_modules/@walletconnect/logger/dist/index.es.js","../node_modules/@walletconnect/types/dist/index.es.js","../../node_modules/@walletconnect/jsonrpc-utils/dist/esm/constants.js","../../node_modules/@walletconnect/jsonrpc-utils/dist/esm/error.js","../../node_modules/@walletconnect/jsonrpc-utils/dist/esm/format.js","../../node_modules/@walletconnect/environment/dist/cjs/index.js","../../node_modules/@walletconnect/environment/dist/cjs/crypto.js","../../node_modules/@walletconnect/environment/dist/cjs/env.js","../../node_modules/@walletconnect/jsonrpc-types/dist/index.es.js","../../node_modules/@walletconnect/jsonrpc-utils/dist/esm/url.js","../../node_modules/@walletconnect/jsonrpc-utils/dist/esm/validators.js","../../node_modules/@walletconnect/jsonrpc-provider/dist/index.es.js","../../node_modules/@walletconnect/jsonrpc-ws-connection/dist/index.es.js","../../node_modules/lodash.isequal/index.js","../node_modules/@walletconnect/core/dist/index.es.js","../node_modules/@walletconnect/sign-client/dist/index.es.js","../../node_modules/cross-fetch/dist/browser-ponyfill.js","../../node_modules/@walletconnect/jsonrpc-http-connection/dist/index.es.js","../node_modules/@walletconnect/universal-provider/dist/index.es.js","../node_modules/@walletconnect/ethereum-provider/dist/index.es.js","../../node_modules/@walletconnect/browser-utils/node_modules/@walletconnect/window-getters/dist/cjs/index.js","../../node_modules/@walletconnect/browser-utils/node_modules/@walletconnect/window-metadata/dist/cjs/index.js","../../node_modules/@walletconnect/browser-utils/node_modules/detect-browser/es/index.js","../../node_modules/@walletconnect/browser-utils/dist/esm/browser.js","../../node_modules/@walletconnect/browser-utils/dist/esm/json.js","../../node_modules/@walletconnect/browser-utils/node_modules/@walletconnect/safe-json/dist/esm/index.js","../../node_modules/@walletconnect/browser-utils/dist/esm/local.js","../../node_modules/@walletconnect/browser-utils/dist/esm/mobile.js","../../node_modules/@walletconnect/browser-utils/dist/esm/registry.js","../../node_modules/isarray/index.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/utils/typedarray-buffer.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/utils.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/bit-buffer.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/error-correction-level.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/bit-matrix.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/alignment-pattern.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/finder-pattern.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/mask-pattern.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/error-correction-code.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/galois-field.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/polynomial.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/buffer/index.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/reed-solomon-encoder.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/version-check.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/regex.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/mode.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/version.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/format-info.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/numeric-data.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/alphanumeric-data.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/byte-data.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/kanji-data.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/segments.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/core/qrcode.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/renderer/utils.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/renderer/canvas.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/renderer/svg-tag.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/browser.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/qrcode/lib/can-promise.js","../../node_modules/toggle-selection/index.js","../../node_modules/copy-to-clipboard/index.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/preact/dist/preact.module.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/preact/hooks/dist/hooks.module.js","../../node_modules/@walletconnect/qrcode-modal/node_modules/preact/compat/dist/compat.module.js","../../node_modules/@walletconnect/qrcode-modal/dist/cjs/index.js","../../node_modules/@walletconnect/types/dist/index.es.js","../../node_modules/@walletconnect/utils/node_modules/decode-uri-component/index.js","../../node_modules/@walletconnect/utils/node_modules/split-on-first/index.js","../../node_modules/@walletconnect/utils/node_modules/filter-obj/index.js","../../node_modules/@walletconnect/utils/node_modules/query-string/index.js","../../node_modules/@walletconnect/relay-api/dist/index.es.js","../../node_modules/@walletconnect/utils/dist/index.es.js","../../node_modules/unfetch/dist/unfetch.module.js","../../node_modules/isomorphic-unfetch/browser.js","../../node_modules/@walletconnect/core/dist/index.es.js","../../node_modules/@walletconnect/sign-client/dist/index.es.js","../../node_modules/@jnwng/walletconnect-solana/lib/esm/errors.js","../../node_modules/@jnwng/walletconnect-solana/lib/esm/adapter.js","../../node_modules/proxy-compare/dist/index.modern.js","../../node_modules/valtio/esm/vanilla.mjs","../../node_modules/@walletconnect/modal-core/dist/index.js","../../node_modules/@walletconnect/modal/dist/index.js","../../node_modules/@lit/reactive-element/css-tag.js","../../node_modules/@lit/reactive-element/reactive-element.js","../../node_modules/lit-html/lit-html.js","../../node_modules/lit-element/lit-element.js","../../node_modules/@lit/reactive-element/decorators/custom-element.js","../../node_modules/@lit/reactive-element/decorators/property.js","../../node_modules/@lit/reactive-element/decorators/state.js","../../node_modules/@lit/reactive-element/decorators/query-assigned-elements.js","../../node_modules/lit-html/directive.js","../../node_modules/lit-html/directives/class-map.js","../../node_modules/@motionone/utils/dist/clamp.es.js","../../node_modules/@motionone/utils/dist/defaults.es.js","../../node_modules/@motionone/utils/dist/is-number.es.js","../../node_modules/@motionone/utils/dist/is-easing-list.es.js","../../node_modules/@motionone/utils/dist/wrap.es.js","../../node_modules/@motionone/utils/dist/mix.es.js","../../node_modules/@motionone/utils/dist/noop.es.js","../../node_modules/@motionone/utils/dist/progress.es.js","../../node_modules/@motionone/utils/dist/offset.es.js","../../node_modules/@motionone/utils/dist/interpolate.es.js","../../node_modules/@motionone/utils/dist/easing.es.js","../../node_modules/@motionone/utils/dist/is-cubic-bezier.es.js","../../node_modules/@motionone/utils/dist/is-easing-generator.es.js","../../node_modules/@motionone/utils/dist/is-function.es.js","../../node_modules/@motionone/utils/dist/is-string.es.js","../../node_modules/@motionone/utils/dist/time.es.js","../../node_modules/@motionone/easing/dist/cubic-bezier.es.js","../../node_modules/@motionone/easing/dist/steps.es.js","../../node_modules/@motionone/animation/dist/utils/easing.es.js","../../node_modules/@motionone/animation/dist/Animation.es.js","../../node_modules/hey-listen/dist/hey-listen.es.js","../../node_modules/@motionone/types/dist/MotionValue.es.js","../../node_modules/@motionone/dom/dist/animate/data.es.js","../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js","../../node_modules/@motionone/utils/dist/array.es.js","../../node_modules/@motionone/dom/dist/animate/utils/css-var.es.js","../../node_modules/@motionone/dom/dist/animate/utils/feature-detection.es.js","../../node_modules/@motionone/dom/dist/animate/utils/easing.es.js","../../node_modules/@motionone/dom/dist/animate/utils/keyframes.es.js","../../node_modules/@motionone/dom/dist/animate/utils/get-style-name.es.js","../../node_modules/@motionone/dom/dist/animate/style.es.js","../../node_modules/@motionone/dom/dist/animate/utils/stop-animation.es.js","../../node_modules/@motionone/dom/dist/animate/animate-style.es.js","../../node_modules/@motionone/dom/dist/animate/utils/get-unit.es.js","../../node_modules/@motionone/dom/dist/animate/utils/options.es.js","../../node_modules/@motionone/dom/dist/animate/utils/controls.es.js","../../node_modules/@motionone/dom/dist/utils/stagger.es.js","../../node_modules/@motionone/dom/dist/animate/index.es.js","../../node_modules/@motionone/dom/dist/animate/create-animate.es.js","../../node_modules/@motionone/dom/dist/utils/resolve-elements.es.js","../../node_modules/motion/dist/animate.es.js","../../node_modules/lit-html/directives/if-defined.js","../../node_modules/@walletconnect/modal-ui/dist/index.js"],"sourcesContent":["const node_env = globalThis.process?.env?.NODE_ENV;\nexport default node_env && !node_env.toLowerCase().startsWith('prod');\n","// Store the references to globals in case someone tries to monkey patch these, causing the below\n// to de-opt (this occurs often when using popular extensions).\nexport var is_array = Array.isArray;\nexport var index_of = Array.prototype.indexOf;\nexport var array_from = Array.from;\nexport var object_keys = Object.keys;\nexport var define_property = Object.defineProperty;\nexport var get_descriptor = Object.getOwnPropertyDescriptor;\nexport var get_descriptors = Object.getOwnPropertyDescriptors;\nexport var object_prototype = Object.prototype;\nexport var array_prototype = Array.prototype;\nexport var get_prototype_of = Object.getPrototypeOf;\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\nexport const noop = () => {};\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n\n/**\n * @template [T=any]\n * @param {any} value\n * @returns {value is PromiseLike}\n */\nexport function is_promise(value) {\n\treturn typeof value?.then === 'function';\n}\n\n/** @param {Function} fn */\nexport function run(fn) {\n\treturn fn();\n}\n\n/** @param {Array<() => void>} arr */\nexport function run_all(arr) {\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tarr[i]();\n\t}\n}\n\n/**\n * TODO replace with Promise.withResolvers once supported widely enough\n * @template T\n */\nexport function deferred() {\n\t/** @type {(value: T) => void} */\n\tvar resolve;\n\n\t/** @type {(reason: any) => void} */\n\tvar reject;\n\n\t/** @type {Promise} */\n\tvar promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\n\t// @ts-expect-error\n\treturn { promise, resolve, reject };\n}\n\n/**\n * @template V\n * @param {V} value\n * @param {V | (() => V)} fallback\n * @param {boolean} [lazy]\n * @returns {V}\n */\nexport function fallback(value, fallback, lazy = false) {\n\treturn value === undefined\n\t\t? lazy\n\t\t\t? /** @type {() => V} */ (fallback)()\n\t\t\t: /** @type {V} */ (fallback)\n\t\t: value;\n}\n","export const DERIVED = 1 << 1;\nexport const EFFECT = 1 << 2;\nexport const RENDER_EFFECT = 1 << 3;\nexport const BLOCK_EFFECT = 1 << 4;\nexport const BRANCH_EFFECT = 1 << 5;\nexport const ROOT_EFFECT = 1 << 6;\nexport const BOUNDARY_EFFECT = 1 << 7;\nexport const UNOWNED = 1 << 8;\nexport const DISCONNECTED = 1 << 9;\nexport const CLEAN = 1 << 10;\nexport const DIRTY = 1 << 11;\nexport const MAYBE_DIRTY = 1 << 12;\nexport const INERT = 1 << 13;\nexport const DESTROYED = 1 << 14;\nexport const EFFECT_RAN = 1 << 15;\n/** 'Transparent' effects do not create a transition boundary */\nexport const EFFECT_TRANSPARENT = 1 << 16;\n/** Svelte 4 legacy mode props need to be handled with deriveds and be recognized elsewhere, hence the dedicated flag */\nexport const LEGACY_DERIVED_PROP = 1 << 17;\nexport const INSPECT_EFFECT = 1 << 18;\nexport const HEAD_EFFECT = 1 << 19;\nexport const EFFECT_HAS_DERIVED = 1 << 20;\n\nexport const STATE_SYMBOL = Symbol('$state');\nexport const STATE_SYMBOL_METADATA = Symbol('$state metadata');\nexport const LEGACY_PROPS = Symbol('legacy props');\nexport const LOADING_ATTR_SYMBOL = Symbol('');\n","/** @import { Equals } from '#client' */\n/** @type {Equals} */\nexport function equals(value) {\n\treturn value === this.v;\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function safe_not_equal(a, b) {\n\treturn a != a\n\t\t? b == b\n\t\t: a !== b || (a !== null && typeof a === 'object') || typeof a === 'function';\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function not_equal(a, b) {\n\treturn a !== b;\n}\n\n/** @type {Equals} */\nexport function safe_equals(value) {\n\treturn !safe_not_equal(value, this.v);\n}\n","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\n/**\n * Using `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\n * @returns {never}\n */\nexport function bind_invalid_checkbox_value() {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_checkbox_value\\nUsing \\`bind:value\\` together with a checkbox input is not allowed. Use \\`bind:checked\\` instead\\nhttps://svelte.dev/e/bind_invalid_checkbox_value`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_checkbox_value`);\n\t}\n}\n\n/**\n * Component %component% has an export named `%key%` that a consumer component is trying to access using `bind:%key%`, which is disallowed. Instead, use `bind:this` (e.g. `<%name% bind:this={component} />`) and then access the property on the bound component instance (e.g. `component.%key%`)\n * @param {string} component\n * @param {string} key\n * @param {string} name\n * @returns {never}\n */\nexport function bind_invalid_export(component, key, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_export\\nComponent ${component} has an export named \\`${key}\\` that a consumer component is trying to access using \\`bind:${key}\\`, which is disallowed. Instead, use \\`bind:this\\` (e.g. \\`<${name} bind:this={component} />\\`) and then access the property on the bound component instance (e.g. \\`component.${key}\\`)\\nhttps://svelte.dev/e/bind_invalid_export`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_export`);\n\t}\n}\n\n/**\n * A component is attempting to bind to a non-bindable property `%key%` belonging to %component% (i.e. `<%name% bind:%key%={...}>`). To mark a property as bindable: `let { %key% = $bindable() } = $props()`\n * @param {string} key\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function bind_not_bindable(key, component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_not_bindable\\nA component is attempting to bind to a non-bindable property \\`${key}\\` belonging to ${component} (i.e. \\`<${name} bind:${key}={...}>\\`). To mark a property as bindable: \\`let { ${key} = $bindable() } = $props()\\`\\nhttps://svelte.dev/e/bind_not_bindable`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_not_bindable`);\n\t}\n}\n\n/**\n * %parent% called `%method%` on an instance of %component%, which is no longer valid in Svelte 5\n * @param {string} parent\n * @param {string} method\n * @param {string} component\n * @returns {never}\n */\nexport function component_api_changed(parent, method, component) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_changed\\n${parent} called \\`${method}\\` on an instance of ${component}, which is no longer valid in Svelte 5\\nhttps://svelte.dev/e/component_api_changed`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_changed`);\n\t}\n}\n\n/**\n * Attempted to instantiate %component% with `new %name%`, which is no longer valid in Svelte 5. If this component is not under your control, set the `compatibility.componentApi` compiler option to `4` to keep it working.\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function component_api_invalid_new(component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_invalid_new\\nAttempted to instantiate ${component} with \\`new ${name}\\`, which is no longer valid in Svelte 5. If this component is not under your control, set the \\`compatibility.componentApi\\` compiler option to \\`4\\` to keep it working.\\nhttps://svelte.dev/e/component_api_invalid_new`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_invalid_new`);\n\t}\n}\n\n/**\n * A derived value cannot reference itself recursively\n * @returns {never}\n */\nexport function derived_references_self() {\n\tif (DEV) {\n\t\tconst error = new Error(`derived_references_self\\nA derived value cannot reference itself recursively\\nhttps://svelte.dev/e/derived_references_self`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/derived_references_self`);\n\t}\n}\n\n/**\n * Keyed each block has duplicate key `%value%` at indexes %a% and %b%\n * @param {string} a\n * @param {string} b\n * @param {string | undefined | null} [value]\n * @returns {never}\n */\nexport function each_key_duplicate(a, b, value) {\n\tif (DEV) {\n\t\tconst error = new Error(`each_key_duplicate\\n${value ? `Keyed each block has duplicate key \\`${value}\\` at indexes ${a} and ${b}` : `Keyed each block has duplicate key at indexes ${a} and ${b}`}\\nhttps://svelte.dev/e/each_key_duplicate`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/each_key_duplicate`);\n\t}\n}\n\n/**\n * `%rune%` cannot be used inside an effect cleanup function\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_in_teardown(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_teardown\\n\\`${rune}\\` cannot be used inside an effect cleanup function\\nhttps://svelte.dev/e/effect_in_teardown`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_teardown`);\n\t}\n}\n\n/**\n * Effect cannot be created inside a `$derived` value that was not itself created inside an effect\n * @returns {never}\n */\nexport function effect_in_unowned_derived() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_unowned_derived\\nEffect cannot be created inside a \\`$derived\\` value that was not itself created inside an effect\\nhttps://svelte.dev/e/effect_in_unowned_derived`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_unowned_derived`);\n\t}\n}\n\n/**\n * `%rune%` can only be used inside an effect (e.g. during component initialisation)\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_orphan(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_orphan\\n\\`${rune}\\` can only be used inside an effect (e.g. during component initialisation)\\nhttps://svelte.dev/e/effect_orphan`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_orphan`);\n\t}\n}\n\n/**\n * Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops\n * @returns {never}\n */\nexport function effect_update_depth_exceeded() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_update_depth_exceeded\\nMaximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops\\nhttps://svelte.dev/e/effect_update_depth_exceeded`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);\n\t}\n}\n\n/**\n * Failed to hydrate the application\n * @returns {never}\n */\nexport function hydration_failed() {\n\tif (DEV) {\n\t\tconst error = new Error(`hydration_failed\\nFailed to hydrate the application\\nhttps://svelte.dev/e/hydration_failed`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/hydration_failed`);\n\t}\n}\n\n/**\n * Could not `{@render}` snippet due to the expression being `null` or `undefined`. Consider using optional chaining `{@render snippet?.()}`\n * @returns {never}\n */\nexport function invalid_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_snippet\\nCould not \\`{@render}\\` snippet due to the expression being \\`null\\` or \\`undefined\\`. Consider using optional chaining \\`{@render snippet?.()}\\`\\nhttps://svelte.dev/e/invalid_snippet`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_snippet`);\n\t}\n}\n\n/**\n * `%name%(...)` cannot be used in runes mode\n * @param {string} name\n * @returns {never}\n */\nexport function lifecycle_legacy_only(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`lifecycle_legacy_only\\n\\`${name}(...)\\` cannot be used in runes mode\\nhttps://svelte.dev/e/lifecycle_legacy_only`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/lifecycle_legacy_only`);\n\t}\n}\n\n/**\n * Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value\n * @param {string} key\n * @returns {never}\n */\nexport function props_invalid_value(key) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_invalid_value\\nCannot do \\`bind:${key}={undefined}\\` when \\`${key}\\` has a fallback value\\nhttps://svelte.dev/e/props_invalid_value`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_invalid_value`);\n\t}\n}\n\n/**\n * Rest element properties of `$props()` such as `%property%` are readonly\n * @param {string} property\n * @returns {never}\n */\nexport function props_rest_readonly(property) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_rest_readonly\\nRest element properties of \\`$props()\\` such as \\`${property}\\` are readonly\\nhttps://svelte.dev/e/props_rest_readonly`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_rest_readonly`);\n\t}\n}\n\n/**\n * The `%rune%` rune is only available inside `.svelte` and `.svelte.js/ts` files\n * @param {string} rune\n * @returns {never}\n */\nexport function rune_outside_svelte(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`rune_outside_svelte\\nThe \\`${rune}\\` rune is only available inside \\`.svelte\\` and \\`.svelte.js/ts\\` files\\nhttps://svelte.dev/e/rune_outside_svelte`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/rune_outside_svelte`);\n\t}\n}\n\n/**\n * Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\n * @returns {never}\n */\nexport function state_descriptors_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_descriptors_fixed\\nProperty descriptors defined on \\`$state\\` objects must contain \\`value\\` and always be \\`enumerable\\`, \\`configurable\\` and \\`writable\\`.\\nhttps://svelte.dev/e/state_descriptors_fixed`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_descriptors_fixed`);\n\t}\n}\n\n/**\n * Cannot set prototype of `$state` object\n * @returns {never}\n */\nexport function state_prototype_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_prototype_fixed\\nCannot set prototype of \\`$state\\` object\\nhttps://svelte.dev/e/state_prototype_fixed`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_prototype_fixed`);\n\t}\n}\n\n/**\n * Reading state that was created inside the same derived is forbidden. Consider using `untrack` to read locally created state\n * @returns {never}\n */\nexport function state_unsafe_local_read() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_unsafe_local_read\\nReading state that was created inside the same derived is forbidden. Consider using \\`untrack\\` to read locally created state\\nhttps://svelte.dev/e/state_unsafe_local_read`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_unsafe_local_read`);\n\t}\n}\n\n/**\n * Updating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\n * @returns {never}\n */\nexport function state_unsafe_mutation() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_unsafe_mutation\\nUpdating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without \\`$state\\`\\nhttps://svelte.dev/e/state_unsafe_mutation`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_unsafe_mutation`);\n\t}\n}","export let legacy_mode_flag = false;\nexport let tracing_mode_flag = false;\n\nexport function enable_legacy_mode_flag() {\n\tlegacy_mode_flag = true;\n}\n\nexport function enable_tracing_mode_flag() {\n\ttracing_mode_flag = true;\n}\n","export const EACH_ITEM_REACTIVE = 1;\nexport const EACH_INDEX_REACTIVE = 1 << 1;\n/** See EachBlock interface metadata.is_controlled for an explanation what this is */\nexport const EACH_IS_CONTROLLED = 1 << 2;\nexport const EACH_IS_ANIMATED = 1 << 3;\nexport const EACH_ITEM_IMMUTABLE = 1 << 4;\n\nexport const PROPS_IS_IMMUTABLE = 1;\nexport const PROPS_IS_RUNES = 1 << 1;\nexport const PROPS_IS_UPDATED = 1 << 2;\nexport const PROPS_IS_BINDABLE = 1 << 3;\nexport const PROPS_IS_LAZY_INITIAL = 1 << 4;\n\nexport const TRANSITION_IN = 1;\nexport const TRANSITION_OUT = 1 << 1;\nexport const TRANSITION_GLOBAL = 1 << 2;\n\nexport const TEMPLATE_FRAGMENT = 1;\nexport const TEMPLATE_USE_IMPORT_NODE = 1 << 1;\n\nexport const HYDRATION_START = '[';\n/** used to indicate that an `{:else}...` block was rendered */\nexport const HYDRATION_START_ELSE = '[!';\nexport const HYDRATION_END = ']';\nexport const HYDRATION_ERROR = {};\n\nexport const ELEMENT_IS_NAMESPACED = 1;\nexport const ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;\n\nexport const UNINITIALIZED = Symbol();\n\n// Dev-time component properties\nexport const FILENAME = Symbol('filename');\nexport const HMR = Symbol('hmr');\n\nexport const NAMESPACE_SVG = 'http://www.w3.org/2000/svg';\nexport const NAMESPACE_MATHML = 'http://www.w3.org/1998/Math/MathML';\n\n// we use a list of ignorable runtime warnings because not every runtime warning\n// can be ignored and we want to keep the validation for svelte-ignore in place\nexport const IGNORABLE_RUNTIME_WARNINGS = /** @type {const} */ ([\n\t'state_snapshot_uncloneable',\n\t'binding_property_non_reactive',\n\t'hydration_attribute_changed',\n\t'hydration_html_changed',\n\t'ownership_invalid_binding',\n\t'ownership_invalid_mutation'\n]);\n\n/**\n * Whitespace inside one of these elements will not result in\n * a whitespace node being created in any circumstances. (This\n * list is almost certainly very incomplete)\n * TODO this is currently unused\n */\nexport const ELEMENTS_WITHOUT_TEXT = ['audio', 'datalist', 'dl', 'optgroup', 'select', 'video'];\n","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\nvar bold = 'font-weight: bold';\nvar normal = 'font-weight: normal';\n\n/**\n * `` is a void element — it cannot have content\n * @param {string} tag\n */\nexport function dynamic_void_element_content(tag) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] dynamic_void_element_content\\n%c\\`\\` is a void element — it cannot have content\\nhttps://svelte.dev/e/dynamic_void_element_content`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/dynamic_void_element_content`);\n\t}\n}\n\n/**\n * The following properties cannot be cloned with `$state.snapshot` — the return value contains the originals:\n * \n * %properties%\n * @param {string | undefined | null} [properties]\n */\nexport function state_snapshot_uncloneable(properties) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] state_snapshot_uncloneable\\n%c${properties\n\t\t\t? `The following properties cannot be cloned with \\`$state.snapshot\\` — the return value contains the originals:\n\n${properties}`\n\t\t\t: 'Value cannot be cloned with `$state.snapshot` — the original value was returned'}\\nhttps://svelte.dev/e/state_snapshot_uncloneable`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/state_snapshot_uncloneable`);\n\t}\n}","/** @import { Snapshot } from './types' */\nimport { DEV } from 'esm-env';\nimport * as w from './warnings.js';\nimport { get_prototype_of, is_array, object_prototype } from './utils.js';\n\n/**\n * In dev, we keep track of which properties could not be cloned. In prod\n * we don't bother, but we keep a dummy array around so that the\n * signature stays the same\n * @type {string[]}\n */\nconst empty = [];\n\n/**\n * @template T\n * @param {T} value\n * @param {boolean} [skip_warning]\n * @returns {Snapshot}\n */\nexport function snapshot(value, skip_warning = false) {\n\tif (DEV && !skip_warning) {\n\t\t/** @type {string[]} */\n\t\tconst paths = [];\n\n\t\tconst copy = clone(value, new Map(), '', paths);\n\t\tif (paths.length === 1 && paths[0] === '') {\n\t\t\t// value could not be cloned\n\t\t\tw.state_snapshot_uncloneable();\n\t\t} else if (paths.length > 0) {\n\t\t\t// some properties could not be cloned\n\t\t\tconst slice = paths.length > 10 ? paths.slice(0, 7) : paths.slice(0, 10);\n\t\t\tconst excess = paths.length - slice.length;\n\n\t\t\tlet uncloned = slice.map((path) => `- ${path}`).join('\\n');\n\t\t\tif (excess > 0) uncloned += `\\n- ...and ${excess} more`;\n\n\t\t\tw.state_snapshot_uncloneable(uncloned);\n\t\t}\n\n\t\treturn copy;\n\t}\n\n\treturn clone(value, new Map(), '', empty);\n}\n\n/**\n * @template T\n * @param {T} value\n * @param {Map>} cloned\n * @param {string} path\n * @param {string[]} paths\n * @param {null | T} original The original value, if `value` was produced from a `toJSON` call\n * @returns {Snapshot}\n */\nfunction clone(value, cloned, path, paths, original = null) {\n\tif (typeof value === 'object' && value !== null) {\n\t\tvar unwrapped = cloned.get(value);\n\t\tif (unwrapped !== undefined) return unwrapped;\n\n\t\tif (value instanceof Map) return /** @type {Snapshot} */ (new Map(value));\n\t\tif (value instanceof Set) return /** @type {Snapshot} */ (new Set(value));\n\n\t\tif (is_array(value)) {\n\t\t\tvar copy = /** @type {Snapshot} */ (Array(value.length));\n\t\t\tcloned.set(value, copy);\n\n\t\t\tif (original !== null) {\n\t\t\t\tcloned.set(original, copy);\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < value.length; i += 1) {\n\t\t\t\tvar element = value[i];\n\t\t\t\tif (i in value) {\n\t\t\t\t\tcopy[i] = clone(element, cloned, DEV ? `${path}[${i}]` : path, paths);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn copy;\n\t\t}\n\n\t\tif (get_prototype_of(value) === object_prototype) {\n\t\t\t/** @type {Snapshot} */\n\t\t\tcopy = {};\n\t\t\tcloned.set(value, copy);\n\n\t\t\tif (original !== null) {\n\t\t\t\tcloned.set(original, copy);\n\t\t\t}\n\n\t\t\tfor (var key in value) {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tcopy[key] = clone(value[key], cloned, DEV ? `${path}.${key}` : path, paths);\n\t\t\t}\n\n\t\t\treturn copy;\n\t\t}\n\n\t\tif (value instanceof Date) {\n\t\t\treturn /** @type {Snapshot} */ (structuredClone(value));\n\t\t}\n\n\t\tif (typeof (/** @type {T & { toJSON?: any } } */ (value).toJSON) === 'function') {\n\t\t\treturn clone(\n\t\t\t\t/** @type {T & { toJSON(): any } } */ (value).toJSON(),\n\t\t\t\tcloned,\n\t\t\t\tDEV ? `${path}.toJSON()` : path,\n\t\t\t\tpaths,\n\t\t\t\t// Associate the instance with the toJSON clone\n\t\t\t\tvalue\n\t\t\t);\n\t\t}\n\t}\n\n\tif (value instanceof EventTarget) {\n\t\t// can't be cloned\n\t\treturn /** @type {Snapshot} */ (value);\n\t}\n\n\ttry {\n\t\treturn /** @type {Snapshot} */ (structuredClone(value));\n\t} catch (e) {\n\t\tif (DEV) {\n\t\t\tpaths.push(path);\n\t\t}\n\n\t\treturn /** @type {Snapshot} */ (value);\n\t}\n}\n","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\nvar bold = 'font-weight: bold';\nvar normal = 'font-weight: normal';\n\n/**\n * Assignment to `%property%` property (%location%) will evaluate to the right-hand side, not the value of `%property%` following the assignment. This may result in unexpected behaviour.\n * @param {string} property\n * @param {string} location\n */\nexport function assignment_value_stale(property, location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] assignment_value_stale\\n%cAssignment to \\`${property}\\` property (${location}) will evaluate to the right-hand side, not the value of \\`${property}\\` following the assignment. This may result in unexpected behaviour.\\nhttps://svelte.dev/e/assignment_value_stale`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/assignment_value_stale`);\n\t}\n}\n\n/**\n * `%binding%` (%location%) is binding to a non-reactive property\n * @param {string} binding\n * @param {string | undefined | null} [location]\n */\nexport function binding_property_non_reactive(binding, location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] binding_property_non_reactive\\n%c${location ? `\\`${binding}\\` (${location}) is binding to a non-reactive property` : `\\`${binding}\\` is binding to a non-reactive property`}\\nhttps://svelte.dev/e/binding_property_non_reactive`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/binding_property_non_reactive`);\n\t}\n}\n\n/**\n * Your `console.%method%` contained `$state` proxies. Consider using `$inspect(...)` or `$state.snapshot(...)` instead\n * @param {string} method\n */\nexport function console_log_state(method) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] console_log_state\\n%cYour \\`console.${method}\\` contained \\`$state\\` proxies. Consider using \\`$inspect(...)\\` or \\`$state.snapshot(...)\\` instead\\nhttps://svelte.dev/e/console_log_state`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/console_log_state`);\n\t}\n}\n\n/**\n * %handler% should be a function. Did you mean to %suggestion%?\n * @param {string} handler\n * @param {string} suggestion\n */\nexport function event_handler_invalid(handler, suggestion) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] event_handler_invalid\\n%c${handler} should be a function. Did you mean to ${suggestion}?\\nhttps://svelte.dev/e/event_handler_invalid`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/event_handler_invalid`);\n\t}\n}\n\n/**\n * The `%attribute%` attribute on `%html%` changed its value between server and client renders. The client value, `%value%`, will be ignored in favour of the server value\n * @param {string} attribute\n * @param {string} html\n * @param {string} value\n */\nexport function hydration_attribute_changed(attribute, html, value) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] hydration_attribute_changed\\n%cThe \\`${attribute}\\` attribute on \\`${html}\\` changed its value between server and client renders. The client value, \\`${value}\\`, will be ignored in favour of the server value\\nhttps://svelte.dev/e/hydration_attribute_changed`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_attribute_changed`);\n\t}\n}\n\n/**\n * The value of an `{@html ...}` block %location% changed between server and client renders. The client value will be ignored in favour of the server value\n * @param {string | undefined | null} [location]\n */\nexport function hydration_html_changed(location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] hydration_html_changed\\n%c${location ? `The value of an \\`{@html ...}\\` block ${location} changed between server and client renders. The client value will be ignored in favour of the server value` : 'The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value'}\\nhttps://svelte.dev/e/hydration_html_changed`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_html_changed`);\n\t}\n}\n\n/**\n * Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near %location%\n * @param {string | undefined | null} [location]\n */\nexport function hydration_mismatch(location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] hydration_mismatch\\n%c${location ? `Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${location}` : 'Hydration failed because the initial UI does not match what was rendered on the server'}\\nhttps://svelte.dev/e/hydration_mismatch`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_mismatch`);\n\t}\n}\n\n/**\n * The `render` function passed to `createRawSnippet` should return HTML for a single element\n */\nexport function invalid_raw_snippet_render() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] invalid_raw_snippet_render\\n%cThe \\`render\\` function passed to \\`createRawSnippet\\` should return HTML for a single element\\nhttps://svelte.dev/e/invalid_raw_snippet_render`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/invalid_raw_snippet_render`);\n\t}\n}\n\n/**\n * Detected a migrated `$:` reactive block in `%filename%` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`.\n * @param {string} filename\n */\nexport function legacy_recursive_reactive_block(filename) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] legacy_recursive_reactive_block\\n%cDetected a migrated \\`$:\\` reactive block in \\`${filename}\\` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an \\`$effect\\`.\\nhttps://svelte.dev/e/legacy_recursive_reactive_block`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/legacy_recursive_reactive_block`);\n\t}\n}\n\n/**\n * Tried to unmount a component that was not mounted\n */\nexport function lifecycle_double_unmount() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] lifecycle_double_unmount\\n%cTried to unmount a component that was not mounted\\nhttps://svelte.dev/e/lifecycle_double_unmount`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/lifecycle_double_unmount`);\n\t}\n}\n\n/**\n * %parent% passed a value to %child% with `bind:`, but the value is owned by %owner%. Consider creating a binding between %owner% and %parent%\n * @param {string} parent\n * @param {string} child\n * @param {string} owner\n */\nexport function ownership_invalid_binding(parent, child, owner) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] ownership_invalid_binding\\n%c${parent} passed a value to ${child} with \\`bind:\\`, but the value is owned by ${owner}. Consider creating a binding between ${owner} and ${parent}\\nhttps://svelte.dev/e/ownership_invalid_binding`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/ownership_invalid_binding`);\n\t}\n}\n\n/**\n * %component% mutated a value owned by %owner%. This is strongly discouraged. Consider passing values to child components with `bind:`, or use a callback instead\n * @param {string | undefined | null} [component]\n * @param {string | undefined | null} [owner]\n */\nexport function ownership_invalid_mutation(component, owner) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] ownership_invalid_mutation\\n%c${component ? `${component} mutated a value owned by ${owner}. This is strongly discouraged. Consider passing values to child components with \\`bind:\\`, or use a callback instead` : 'Mutating a value outside the component that created it is strongly discouraged. Consider passing values to child components with `bind:`, or use a callback instead'}\\nhttps://svelte.dev/e/ownership_invalid_mutation`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/ownership_invalid_mutation`);\n\t}\n}\n\n/**\n * Reactive `$state(...)` proxies and the values they proxy have different identities. Because of this, comparisons with `%operator%` will produce unexpected results\n * @param {string} operator\n */\nexport function state_proxy_equality_mismatch(operator) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] state_proxy_equality_mismatch\\n%cReactive \\`$state(...)\\` proxies and the values they proxy have different identities. Because of this, comparisons with \\`${operator}\\` will produce unexpected results\\nhttps://svelte.dev/e/state_proxy_equality_mismatch`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/state_proxy_equality_mismatch`);\n\t}\n}\n\n/**\n * The `slide` transition does not work correctly for elements with `display: %value%`\n * @param {string} value\n */\nexport function transition_slide_display(value) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] transition_slide_display\\n%cThe \\`slide\\` transition does not work correctly for elements with \\`display: ${value}\\`\\nhttps://svelte.dev/e/transition_slide_display`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/transition_slide_display`);\n\t}\n}","/** @import { ProxyMetadata } from '#client' */\n/** @typedef {{ file: string, line: number, column: number }} Location */\n\nimport { STATE_SYMBOL_METADATA } from '../constants.js';\nimport { render_effect, user_pre_effect } from '../reactivity/effects.js';\nimport { dev_current_component_function } from '../context.js';\nimport { get_prototype_of } from '../../shared/utils.js';\nimport * as w from '../warnings.js';\nimport { FILENAME, UNINITIALIZED } from '../../../constants.js';\n\n/** @type {Record>} */\nconst boundaries = {};\n\nconst chrome_pattern = /at (?:.+ \\()?(.+):(\\d+):(\\d+)\\)?$/;\nconst firefox_pattern = /@(.+):(\\d+):(\\d+)$/;\n\nfunction get_stack() {\n\tconst stack = new Error().stack;\n\tif (!stack) return null;\n\n\tconst entries = [];\n\n\tfor (const line of stack.split('\\n')) {\n\t\tlet match = chrome_pattern.exec(line) ?? firefox_pattern.exec(line);\n\n\t\tif (match) {\n\t\t\tentries.push({\n\t\t\t\tfile: match[1],\n\t\t\t\tline: +match[2],\n\t\t\t\tcolumn: +match[3]\n\t\t\t});\n\t\t}\n\t}\n\n\treturn entries;\n}\n\n/**\n * Determines which `.svelte` component is responsible for a given state change\n * @returns {Function | null}\n */\nexport function get_component() {\n\t// first 4 lines are svelte internals; adjust this number if we change the internal call stack\n\tconst stack = get_stack()?.slice(4);\n\tif (!stack) return null;\n\n\tfor (let i = 0; i < stack.length; i++) {\n\t\tconst entry = stack[i];\n\t\tconst modules = boundaries[entry.file];\n\t\tif (!modules) {\n\t\t\t// If the first entry is not a component, that means the modification very likely happened\n\t\t\t// within a .svelte.js file, possibly triggered by a component. Since these files are not part\n\t\t\t// of the bondaries/component context heuristic, we need to bail in this case, else we would\n\t\t\t// have false positives when the .svelte.ts file provides a state creator function, encapsulating\n\t\t\t// the state and its mutations, and is being called from a component other than the one who\n\t\t\t// called the state creator function.\n\t\t\tif (i === 0) return null;\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (const module of modules) {\n\t\t\tif (module.end == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (module.start.line < entry.line && module.end.line > entry.line) {\n\t\t\t\treturn module.component;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport const ADD_OWNER = Symbol('ADD_OWNER');\n\n/**\n * Together with `mark_module_end`, this function establishes the boundaries of a `.svelte` file,\n * such that subsequent calls to `get_component` can tell us which component is responsible\n * for a given state change\n */\nexport function mark_module_start() {\n\tconst start = get_stack()?.[2];\n\n\tif (start) {\n\t\t(boundaries[start.file] ??= []).push({\n\t\t\tstart,\n\t\t\t// @ts-expect-error\n\t\t\tend: null,\n\t\t\t// @ts-expect-error we add the component at the end, since HMR will overwrite the function\n\t\t\tcomponent: null\n\t\t});\n\t}\n}\n\n/**\n * @param {Function} component\n */\nexport function mark_module_end(component) {\n\tconst end = get_stack()?.[2];\n\n\tif (end) {\n\t\tconst boundaries_file = boundaries[end.file];\n\t\tconst boundary = boundaries_file[boundaries_file.length - 1];\n\n\t\tboundary.end = end;\n\t\tboundary.component = component;\n\t}\n}\n\n/**\n * @param {any} object\n * @param {any | null} owner\n * @param {boolean} [global]\n * @param {boolean} [skip_warning]\n */\nexport function add_owner(object, owner, global = false, skip_warning = false) {\n\tif (object && !global) {\n\t\tconst component = dev_current_component_function;\n\t\tconst metadata = object[STATE_SYMBOL_METADATA];\n\t\tif (metadata && !has_owner(metadata, component)) {\n\t\t\tlet original = get_owner(metadata);\n\n\t\t\tif (owner && owner[FILENAME] !== component[FILENAME] && !skip_warning) {\n\t\t\t\tw.ownership_invalid_binding(component[FILENAME], owner[FILENAME], original[FILENAME]);\n\t\t\t}\n\t\t}\n\t}\n\n\tadd_owner_to_object(object, owner, new Set());\n}\n\n/**\n * @param {() => unknown} get_object\n * @param {any} Component\n * @param {boolean} [skip_warning]\n */\nexport function add_owner_effect(get_object, Component, skip_warning = false) {\n\tuser_pre_effect(() => {\n\t\tadd_owner(get_object(), Component, false, skip_warning);\n\t});\n}\n\n/**\n * @param {any} _this\n * @param {Function} owner\n * @param {Array<() => any>} getters\n * @param {boolean} skip_warning\n */\nexport function add_owner_to_class(_this, owner, getters, skip_warning) {\n\t_this[ADD_OWNER].current ||= getters.map(() => UNINITIALIZED);\n\n\tfor (let i = 0; i < getters.length; i += 1) {\n\t\tconst current = getters[i]();\n\t\t// For performance reasons we only re-add the owner if the state has changed\n\t\tif (current !== _this[ADD_OWNER][i]) {\n\t\t\t_this[ADD_OWNER].current[i] = current;\n\t\t\tadd_owner(current, owner, false, skip_warning);\n\t\t}\n\t}\n}\n\n/**\n * @param {ProxyMetadata | null} from\n * @param {ProxyMetadata} to\n */\nexport function widen_ownership(from, to) {\n\tif (to.owners === null) {\n\t\treturn;\n\t}\n\n\twhile (from) {\n\t\tif (from.owners === null) {\n\t\t\tto.owners = null;\n\t\t\tbreak;\n\t\t}\n\n\t\tfor (const owner of from.owners) {\n\t\t\tto.owners.add(owner);\n\t\t}\n\n\t\tfrom = from.parent;\n\t}\n}\n\n/**\n * @param {any} object\n * @param {Function | null} owner If `null`, then the object is globally owned and will not be checked\n * @param {Set} seen\n */\nfunction add_owner_to_object(object, owner, seen) {\n\tconst metadata = /** @type {ProxyMetadata} */ (object?.[STATE_SYMBOL_METADATA]);\n\n\tif (metadata) {\n\t\t// this is a state proxy, add owner directly, if not globally shared\n\t\tif ('owners' in metadata && metadata.owners != null) {\n\t\t\tif (owner) {\n\t\t\t\tmetadata.owners.add(owner);\n\t\t\t} else {\n\t\t\t\tmetadata.owners = null;\n\t\t\t}\n\t\t}\n\t} else if (object && typeof object === 'object') {\n\t\tif (seen.has(object)) return;\n\t\tseen.add(object);\n\t\tif (ADD_OWNER in object && object[ADD_OWNER]) {\n\t\t\t// this is a class with state fields. we put this in a render effect\n\t\t\t// so that if state is replaced (e.g. `instance.name = { first, last }`)\n\t\t\t// the new state is also co-owned by the caller of `getContext`\n\t\t\trender_effect(() => {\n\t\t\t\tobject[ADD_OWNER](owner);\n\t\t\t});\n\t\t} else {\n\t\t\tvar proto = get_prototype_of(object);\n\n\t\t\tif (proto === Object.prototype) {\n\t\t\t\t// recurse until we find a state proxy\n\t\t\t\tfor (const key in object) {\n\t\t\t\t\tif (Object.getOwnPropertyDescriptor(object, key)?.get) {\n\t\t\t\t\t\t// Similar to the class case; the getter could update with a new state\n\t\t\t\t\t\tlet current = UNINITIALIZED;\n\t\t\t\t\t\trender_effect(() => {\n\t\t\t\t\t\t\tconst next = object[key];\n\t\t\t\t\t\t\tif (current !== next) {\n\t\t\t\t\t\t\t\tcurrent = next;\n\t\t\t\t\t\t\t\tadd_owner_to_object(next, owner, seen);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tadd_owner_to_object(object[key], owner, seen);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (proto === Array.prototype) {\n\t\t\t\t// recurse until we find a state proxy\n\t\t\t\tfor (let i = 0; i < object.length; i += 1) {\n\t\t\t\t\tadd_owner_to_object(object[i], owner, seen);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {ProxyMetadata} metadata\n * @param {Function} component\n * @returns {boolean}\n */\nfunction has_owner(metadata, component) {\n\tif (metadata.owners === null) {\n\t\treturn true;\n\t}\n\n\treturn (\n\t\tmetadata.owners.has(component) ||\n\t\t// This helps avoid false positives when using HMR, where the component function is replaced\n\t\t(FILENAME in component &&\n\t\t\t[...metadata.owners].some(\n\t\t\t\t(owner) => /** @type {any} */ (owner)[FILENAME] === component[FILENAME]\n\t\t\t)) ||\n\t\t(metadata.parent !== null && has_owner(metadata.parent, component))\n\t);\n}\n\n/**\n * @param {ProxyMetadata} metadata\n * @returns {any}\n */\nfunction get_owner(metadata) {\n\treturn (\n\t\tmetadata?.owners?.values().next().value ??\n\t\tget_owner(/** @type {ProxyMetadata} */ (metadata.parent))\n\t);\n}\n\nlet skip = false;\n\n/**\n * @param {() => any} fn\n */\nexport function skip_ownership_validation(fn) {\n\tskip = true;\n\tfn();\n\tskip = false;\n}\n\n/**\n * @param {ProxyMetadata} metadata\n */\nexport function check_ownership(metadata) {\n\tif (skip) return;\n\n\tconst component = get_component();\n\n\tif (component && !has_owner(metadata, component)) {\n\t\tlet original = get_owner(metadata);\n\n\t\t// @ts-expect-error\n\t\tif (original[FILENAME] !== component[FILENAME]) {\n\t\t\t// @ts-expect-error\n\t\t\tw.ownership_invalid_mutation(component[FILENAME], original[FILENAME]);\n\t\t} else {\n\t\t\tw.ownership_invalid_mutation();\n\t\t}\n\t}\n}\n","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\n/**\n * Cannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead\n * @returns {never}\n */\nexport function invalid_default_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_default_snippet\\nCannot use \\`{@render children(...)}\\` if the parent component uses \\`let:\\` directives. Consider using a named snippet instead\\nhttps://svelte.dev/e/invalid_default_snippet`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_default_snippet`);\n\t}\n}\n\n/**\n * `%name%(...)` can only be used during component initialisation\n * @param {string} name\n * @returns {never}\n */\nexport function lifecycle_outside_component(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`lifecycle_outside_component\\n\\`${name}(...)\\` can only be used during component initialisation\\nhttps://svelte.dev/e/lifecycle_outside_component`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/lifecycle_outside_component`);\n\t}\n}\n\n/**\n * `%name%` is not a store with a `subscribe` method\n * @param {string} name\n * @returns {never}\n */\nexport function store_invalid_shape(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`store_invalid_shape\\n\\`${name}\\` is not a store with a \\`subscribe\\` method\\nhttps://svelte.dev/e/store_invalid_shape`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/store_invalid_shape`);\n\t}\n}\n\n/**\n * The `this` prop on `` must be a string, if defined\n * @returns {never}\n */\nexport function svelte_element_invalid_this_value() {\n\tif (DEV) {\n\t\tconst error = new Error(`svelte_element_invalid_this_value\\nThe \\`this\\` prop on \\`\\` must be a string, if defined\\nhttps://svelte.dev/e/svelte_element_invalid_this_value`);\n\n\t\terror.name = 'Svelte error';\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/svelte_element_invalid_this_value`);\n\t}\n}","/** @import { ComponentContext } from '#client' */\n\nimport { DEV } from 'esm-env';\nimport { add_owner } from './dev/ownership.js';\nimport { lifecycle_outside_component } from '../shared/errors.js';\nimport { source } from './reactivity/sources.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction,\n\tuntrack\n} from './runtime.js';\nimport { effect } from './reactivity/effects.js';\nimport { legacy_mode_flag } from '../flags/index.js';\n\n/** @type {ComponentContext | null} */\nexport let component_context = null;\n\n/** @param {ComponentContext | null} context */\nexport function set_component_context(context) {\n\tcomponent_context = context;\n}\n\n/**\n * The current component function. Different from current component context:\n * ```html\n * \n * \n * \n * \n * ```\n * @type {ComponentContext['function']}\n */\nexport let dev_current_component_function = null;\n\n/** @param {ComponentContext['function']} fn */\nexport function set_dev_current_component_function(fn) {\n\tdev_current_component_function = fn;\n}\n\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * @template T\n * @param {any} key\n * @returns {T}\n */\nexport function getContext(key) {\n\tconst context_map = get_or_init_context_map('getContext');\n\tconst result = /** @type {T} */ (context_map.get(key));\n\treturn result;\n}\n\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * @template T\n * @param {any} key\n * @param {T} context\n * @returns {T}\n */\nexport function setContext(key, context) {\n\tconst context_map = get_or_init_context_map('setContext');\n\n\tif (DEV) {\n\t\t// When state is put into context, we treat as if it's global from now on.\n\t\t// We do for performance reasons (it's for example very expensive to call\n\t\t// getContext on a big object many times when part of a list component)\n\t\t// and danger of false positives.\n\t\tuntrack(() => add_owner(context, null, true));\n\t}\n\n\tcontext_map.set(key, context);\n\treturn context;\n}\n\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * @param {any} key\n * @returns {boolean}\n */\nexport function hasContext(key) {\n\tconst context_map = get_or_init_context_map('hasContext');\n\treturn context_map.has(key);\n}\n\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * @template {Map} [T=Map]\n * @returns {T}\n */\nexport function getAllContexts() {\n\tconst context_map = get_or_init_context_map('getAllContexts');\n\treturn /** @type {T} */ (context_map);\n}\n\n/**\n * @param {Record} props\n * @param {any} runes\n * @param {Function} [fn]\n * @returns {void}\n */\nexport function push(props, runes = false, fn) {\n\tcomponent_context = {\n\t\tp: component_context,\n\t\tc: null,\n\t\te: null,\n\t\tm: false,\n\t\ts: props,\n\t\tx: null,\n\t\tl: null\n\t};\n\n\tif (legacy_mode_flag && !runes) {\n\t\tcomponent_context.l = {\n\t\t\ts: null,\n\t\t\tu: null,\n\t\t\tr1: [],\n\t\t\tr2: source(false)\n\t\t};\n\t}\n\n\tif (DEV) {\n\t\t// component function\n\t\tcomponent_context.function = fn;\n\t\tdev_current_component_function = fn;\n\t}\n}\n\n/**\n * @template {Record} T\n * @param {T} [component]\n * @returns {T}\n */\nexport function pop(component) {\n\tconst context_stack_item = component_context;\n\tif (context_stack_item !== null) {\n\t\tif (component !== undefined) {\n\t\t\tcontext_stack_item.x = component;\n\t\t}\n\t\tconst component_effects = context_stack_item.e;\n\t\tif (component_effects !== null) {\n\t\t\tvar previous_effect = active_effect;\n\t\t\tvar previous_reaction = active_reaction;\n\t\t\tcontext_stack_item.e = null;\n\t\t\ttry {\n\t\t\t\tfor (var i = 0; i < component_effects.length; i++) {\n\t\t\t\t\tvar component_effect = component_effects[i];\n\t\t\t\t\tset_active_effect(component_effect.effect);\n\t\t\t\t\tset_active_reaction(component_effect.reaction);\n\t\t\t\t\teffect(component_effect.fn);\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tset_active_effect(previous_effect);\n\t\t\t\tset_active_reaction(previous_reaction);\n\t\t\t}\n\t\t}\n\t\tcomponent_context = context_stack_item.p;\n\t\tif (DEV) {\n\t\t\tdev_current_component_function = context_stack_item.p?.function ?? null;\n\t\t}\n\t\tcontext_stack_item.m = true;\n\t}\n\t// Micro-optimization: Don't set .a above to the empty object\n\t// so it can be garbage-collected when the return here is unused\n\treturn component || /** @type {T} */ ({});\n}\n\n/** @returns {boolean} */\nexport function is_runes() {\n\treturn !legacy_mode_flag || (component_context !== null && component_context.l === null);\n}\n\n/**\n * @param {string} name\n * @returns {Map}\n */\nfunction get_or_init_context_map(name) {\n\tif (component_context === null) {\n\t\tlifecycle_outside_component(name);\n\t}\n\n\treturn (component_context.c ??= new Map(get_parent_context(component_context) || undefined));\n}\n\n/**\n * @param {ComponentContext} component_context\n * @returns {Map | null}\n */\nfunction get_parent_context(component_context) {\n\tlet parent = component_context.p;\n\twhile (parent !== null) {\n\t\tconst context_map = parent.c;\n\t\tif (context_map !== null) {\n\t\t\treturn context_map;\n\t\t}\n\t\tparent = parent.p;\n\t}\n\treturn null;\n}\n","/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tuntracked_writes,\n\tget,\n\tschedule_effect,\n\tset_untracked_writes,\n\tset_signal_status,\n\tuntrack,\n\tincrement_write_version,\n\tupdate_effect,\n\tderived_sources,\n\tset_derived_sources,\n\tcheck_dirtiness,\n\tuntracking\n} from '../runtime.js';\nimport { equals, safe_equals } from './equality.js';\nimport {\n\tCLEAN,\n\tDERIVED,\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tINSPECT_EFFECT,\n\tUNOWNED,\n\tMAYBE_DIRTY,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT\n} from '../constants.js';\nimport * as e from '../errors.js';\nimport { legacy_mode_flag, tracing_mode_flag } from '../../flags/index.js';\nimport { get_stack } from '../dev/tracing.js';\nimport { component_context, is_runes } from '../context.js';\n\nexport let inspect_effects = new Set();\n\n/**\n * @param {Set} v\n */\nexport function set_inspect_effects(v) {\n\tinspect_effects = v;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {Error | null} [stack]\n * @returns {Source}\n */\nexport function source(v, stack) {\n\t/** @type {Value} */\n\tvar signal = {\n\t\tf: 0, // TODO ideally we could skip this altogether, but it causes type errors\n\t\tv,\n\t\treactions: null,\n\t\tequals,\n\t\trv: 0,\n\t\twv: 0\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = stack ?? get_stack('CreatedAt');\n\t\tsignal.debug = null;\n\t}\n\n\treturn signal;\n}\n\n/**\n * @template V\n * @param {V} v\n */\nexport function state(v) {\n\treturn push_derived_source(source(v));\n}\n\n/**\n * @template V\n * @param {V} initial_value\n * @param {boolean} [immutable]\n * @returns {Source}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function mutable_source(initial_value, immutable = false) {\n\tconst s = source(initial_value);\n\tif (!immutable) {\n\t\ts.equals = safe_equals;\n\t}\n\n\t// bind the signal to the component context, in case we need to\n\t// track updates to trigger beforeUpdate/afterUpdate callbacks\n\tif (legacy_mode_flag && component_context !== null && component_context.l !== null) {\n\t\t(component_context.l.s ??= []).push(s);\n\t}\n\n\treturn s;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {boolean} [immutable]\n * @returns {Source}\n */\nexport function mutable_state(v, immutable = false) {\n\treturn push_derived_source(mutable_source(v, immutable));\n}\n\n/**\n * @template V\n * @param {Source} source\n */\n/*#__NO_SIDE_EFFECTS__*/\nfunction push_derived_source(source) {\n\tif (active_reaction !== null && !untracking && (active_reaction.f & DERIVED) !== 0) {\n\t\tif (derived_sources === null) {\n\t\t\tset_derived_sources([source]);\n\t\t} else {\n\t\t\tderived_sources.push(source);\n\t\t}\n\t}\n\n\treturn source;\n}\n\n/**\n * @template V\n * @param {Value} source\n * @param {V} value\n */\nexport function mutate(source, value) {\n\tset(\n\t\tsource,\n\t\tuntrack(() => get(source))\n\t);\n\treturn value;\n}\n\n/**\n * @template V\n * @param {Source} source\n * @param {V} value\n * @returns {V}\n */\nexport function set(source, value) {\n\tif (\n\t\tactive_reaction !== null &&\n\t\t!untracking &&\n\t\tis_runes() &&\n\t\t(active_reaction.f & (DERIVED | BLOCK_EFFECT)) !== 0 &&\n\t\t// If the source was created locally within the current derived, then\n\t\t// we allow the mutation.\n\t\t(derived_sources === null || !derived_sources.includes(source))\n\t) {\n\t\te.state_unsafe_mutation();\n\t}\n\n\treturn internal_set(source, value);\n}\n\n/**\n * @template V\n * @param {Source} source\n * @param {V} value\n * @returns {V}\n */\nexport function internal_set(source, value) {\n\tif (!source.equals(value)) {\n\t\tvar old_value = source.v;\n\t\tsource.v = value;\n\t\tsource.wv = increment_write_version();\n\n\t\tif (DEV && tracing_mode_flag) {\n\t\t\tsource.updated = get_stack('UpdatedAt');\n\t\t\tif (active_effect != null) {\n\t\t\t\tsource.trace_need_increase = true;\n\t\t\t\tsource.trace_v ??= old_value;\n\t\t\t}\n\t\t}\n\n\t\tmark_reactions(source, DIRTY);\n\n\t\t// It's possible that the current reaction might not have up-to-date dependencies\n\t\t// whilst it's actively running. So in the case of ensuring it registers the reaction\n\t\t// properly for itself, we need to ensure the current effect actually gets\n\t\t// scheduled. i.e: `$effect(() => x++)`\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tactive_effect !== null &&\n\t\t\t(active_effect.f & CLEAN) !== 0 &&\n\t\t\t(active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0\n\t\t) {\n\t\t\tif (untracked_writes === null) {\n\t\t\t\tset_untracked_writes([source]);\n\t\t\t} else {\n\t\t\t\tuntracked_writes.push(source);\n\t\t\t}\n\t\t}\n\n\t\tif (DEV && inspect_effects.size > 0) {\n\t\t\tconst inspects = Array.from(inspect_effects);\n\n\t\t\tfor (const effect of inspects) {\n\t\t\t\t// Mark clean inspect-effects as maybe dirty and then check their dirtiness\n\t\t\t\t// instead of just updating the effects - this way we avoid overfiring.\n\t\t\t\tif ((effect.f & CLEAN) !== 0) {\n\t\t\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t\t\t}\n\t\t\t\tif (check_dirtiness(effect)) {\n\t\t\t\t\tupdate_effect(effect);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tinspect_effects.clear();\n\t\t}\n\t}\n\n\treturn value;\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update(source, d = 1) {\n\tvar value = get(source);\n\tvar result = d === 1 ? value++ : value--;\n\n\tset(source, value);\n\n\t// @ts-expect-error\n\treturn result;\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update_pre(source, d = 1) {\n\tvar value = get(source);\n\n\t// @ts-expect-error\n\treturn set(source, d === 1 ? ++value : --value);\n}\n\n/**\n * @param {Value} signal\n * @param {number} status should be DIRTY or MAYBE_DIRTY\n * @returns {void}\n */\nfunction mark_reactions(signal, status) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tvar runes = is_runes();\n\tvar length = reactions.length;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tvar reaction = reactions[i];\n\t\tvar flags = reaction.f;\n\n\t\t// Skip any effects that are already dirty\n\t\tif ((flags & DIRTY) !== 0) continue;\n\n\t\t// In legacy mode, skip the current effect to prevent infinite loops\n\t\tif (!runes && reaction === active_effect) continue;\n\n\t\t// Inspect effects need to run immediately, so that the stack trace makes sense\n\t\tif (DEV && (flags & INSPECT_EFFECT) !== 0) {\n\t\t\tinspect_effects.add(reaction);\n\t\t\tcontinue;\n\t\t}\n\n\t\tset_signal_status(reaction, status);\n\n\t\t// If the signal a) was previously clean or b) is an unowned derived, then mark it\n\t\tif ((flags & (CLEAN | UNOWNED)) !== 0) {\n\t\t\tif ((flags & DERIVED) !== 0) {\n\t\t\t\tmark_reactions(/** @type {Derived} */ (reaction), MAYBE_DIRTY);\n\t\t\t} else {\n\t\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t\t}\n\t\t}\n\t}\n}\n","/** @import { ComponentContext, Derived, Effect, Reaction, Signal, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport { define_property, get_descriptors, get_prototype_of, index_of } from '../shared/utils.js';\nimport {\n\tdestroy_block_effect_children,\n\tdestroy_effect_children,\n\texecute_effect_teardown,\n\tunlink_effect\n} from './reactivity/effects.js';\nimport {\n\tEFFECT,\n\tDIRTY,\n\tMAYBE_DIRTY,\n\tCLEAN,\n\tDERIVED,\n\tUNOWNED,\n\tDESTROYED,\n\tINERT,\n\tBRANCH_EFFECT,\n\tSTATE_SYMBOL,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tLEGACY_DERIVED_PROP,\n\tDISCONNECTED,\n\tBOUNDARY_EFFECT\n} from './constants.js';\nimport { flush_tasks } from './dom/task.js';\nimport { internal_set } from './reactivity/sources.js';\nimport { destroy_derived_effects, update_derived } from './reactivity/deriveds.js';\nimport * as e from './errors.js';\nimport { FILENAME } from '../../constants.js';\nimport { tracing_mode_flag } from '../flags/index.js';\nimport { tracing_expressions, get_stack } from './dev/tracing.js';\nimport {\n\tcomponent_context,\n\tdev_current_component_function,\n\tis_runes,\n\tset_component_context,\n\tset_dev_current_component_function\n} from './context.js';\nimport { is_firefox } from './dom/operations.js';\n\n// Used for DEV time error handling\n/** @param {WeakSet} value */\nconst handled_errors = new WeakSet();\nlet is_throwing_error = false;\n\nlet is_flushing = false;\n\n/** @type {Effect | null} */\nlet last_scheduled_effect = null;\n\nlet is_updating_effect = false;\n\nexport let is_destroying_effect = false;\n\n/** @param {boolean} value */\nexport function set_is_destroying_effect(value) {\n\tis_destroying_effect = value;\n}\n\n// Handle effect queues\n\n/** @type {Effect[]} */\nlet queued_root_effects = [];\n\n/** @type {Effect[]} Stack of effects, dev only */\nlet dev_effect_stack = [];\n// Handle signal reactivity tree dependencies and reactions\n\n/** @type {null | Reaction} */\nexport let active_reaction = null;\n\nexport let untracking = false;\n\n/** @param {null | Reaction} reaction */\nexport function set_active_reaction(reaction) {\n\tactive_reaction = reaction;\n}\n\n/** @type {null | Effect} */\nexport let active_effect = null;\n\n/** @param {null | Effect} effect */\nexport function set_active_effect(effect) {\n\tactive_effect = effect;\n}\n\n/**\n * When sources are created within a derived, we record them so that we can safely allow\n * local mutations to these sources without the side-effect error being invoked unnecessarily.\n * @type {null | Source[]}\n */\nexport let derived_sources = null;\n\n/**\n * @param {Source[] | null} sources\n */\nexport function set_derived_sources(sources) {\n\tderived_sources = sources;\n}\n\n/**\n * The dependencies of the reaction that is currently being executed. In many cases,\n * the dependencies are unchanged between runs, and so this will be `null` unless\n * and until a new dependency is accessed — we track this via `skipped_deps`\n * @type {null | Value[]}\n */\nlet new_deps = null;\n\nlet skipped_deps = 0;\n\n/**\n * Tracks writes that the effect it's executed in doesn't listen to yet,\n * so that the dependency can be added to the effect later on if it then reads it\n * @type {null | Source[]}\n */\nexport let untracked_writes = null;\n\n/** @param {null | Source[]} value */\nexport function set_untracked_writes(value) {\n\tuntracked_writes = value;\n}\n\n/**\n * @type {number} Used by sources and deriveds for handling updates.\n * Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing\n **/\nlet write_version = 1;\n\n/** @type {number} Used to version each read of a source of derived to avoid duplicating depedencies inside a reaction */\nlet read_version = 0;\n\n// If we are working with a get() chain that has no active container,\n// to prevent memory leaks, we skip adding the reaction.\nexport let skip_reaction = false;\n// Handle collecting all signals which are read during a specific time frame\n/** @type {Set | null} */\nexport let captured_signals = null;\n\n/** @param {Set | null} value */\nexport function set_captured_signals(value) {\n\tcaptured_signals = value;\n}\n\nexport function increment_write_version() {\n\treturn ++write_version;\n}\n\n/**\n * Determines whether a derived or effect is dirty.\n * If it is MAYBE_DIRTY, will set the status to CLEAN\n * @param {Reaction} reaction\n * @returns {boolean}\n */\nexport function check_dirtiness(reaction) {\n\tvar flags = reaction.f;\n\n\tif ((flags & DIRTY) !== 0) {\n\t\treturn true;\n\t}\n\n\tif ((flags & MAYBE_DIRTY) !== 0) {\n\t\tvar dependencies = reaction.deps;\n\t\tvar is_unowned = (flags & UNOWNED) !== 0;\n\n\t\tif (dependencies !== null) {\n\t\t\tvar i;\n\t\t\tvar dependency;\n\t\t\tvar is_disconnected = (flags & DISCONNECTED) !== 0;\n\t\t\tvar is_unowned_connected = is_unowned && active_effect !== null && !skip_reaction;\n\t\t\tvar length = dependencies.length;\n\n\t\t\t// If we are working with a disconnected or an unowned signal that is now connected (due to an active effect)\n\t\t\t// then we need to re-connect the reaction to the dependency\n\t\t\tif (is_disconnected || is_unowned_connected) {\n\t\t\t\tvar derived = /** @type {Derived} */ (reaction);\n\t\t\t\tvar parent = derived.parent;\n\n\t\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\t\tdependency = dependencies[i];\n\n\t\t\t\t\t// We always re-add all reactions (even duplicates) if the derived was\n\t\t\t\t\t// previously disconnected, however we don't if it was unowned as we\n\t\t\t\t\t// de-duplicate dependencies in that case\n\t\t\t\t\tif (is_disconnected || !dependency?.reactions?.includes(derived)) {\n\t\t\t\t\t\t(dependency.reactions ??= []).push(derived);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (is_disconnected) {\n\t\t\t\t\tderived.f ^= DISCONNECTED;\n\t\t\t\t}\n\t\t\t\t// If the unowned derived is now fully connected to the graph again (it's unowned and reconnected, has a parent\n\t\t\t\t// and the parent is not unowned), then we can mark it as connected again, removing the need for the unowned\n\t\t\t\t// flag\n\t\t\t\tif (is_unowned_connected && parent !== null && (parent.f & UNOWNED) === 0) {\n\t\t\t\t\tderived.f ^= UNOWNED;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\tdependency = dependencies[i];\n\n\t\t\t\tif (check_dirtiness(/** @type {Derived} */ (dependency))) {\n\t\t\t\t\tupdate_derived(/** @type {Derived} */ (dependency));\n\t\t\t\t}\n\n\t\t\t\tif (dependency.wv > reaction.wv) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Unowned signals should never be marked as clean unless they\n\t\t// are used within an active_effect without skip_reaction\n\t\tif (!is_unowned || (active_effect !== null && !skip_reaction)) {\n\t\t\tset_signal_status(reaction, CLEAN);\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * @param {unknown} error\n * @param {Effect} effect\n */\nfunction propagate_error(error, effect) {\n\t/** @type {Effect | null} */\n\tvar current = effect;\n\n\twhile (current !== null) {\n\t\tif ((current.f & BOUNDARY_EFFECT) !== 0) {\n\t\t\ttry {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tcurrent.fn(error);\n\t\t\t\treturn;\n\t\t\t} catch {\n\t\t\t\t// Remove boundary flag from effect\n\t\t\t\tcurrent.f ^= BOUNDARY_EFFECT;\n\t\t\t}\n\t\t}\n\n\t\tcurrent = current.parent;\n\t}\n\n\tis_throwing_error = false;\n\tthrow error;\n}\n\n/**\n * @param {Effect} effect\n */\nfunction should_rethrow_error(effect) {\n\treturn (\n\t\t(effect.f & DESTROYED) === 0 &&\n\t\t(effect.parent === null || (effect.parent.f & BOUNDARY_EFFECT) === 0)\n\t);\n}\n\nexport function reset_is_throwing_error() {\n\tis_throwing_error = false;\n}\n\n/**\n * @param {unknown} error\n * @param {Effect} effect\n * @param {Effect | null} previous_effect\n * @param {ComponentContext | null} component_context\n */\nexport function handle_error(error, effect, previous_effect, component_context) {\n\tif (is_throwing_error) {\n\t\tif (previous_effect === null) {\n\t\t\tis_throwing_error = false;\n\t\t}\n\n\t\tif (should_rethrow_error(effect)) {\n\t\t\tthrow error;\n\t\t}\n\n\t\treturn;\n\t}\n\n\tif (previous_effect !== null) {\n\t\tis_throwing_error = true;\n\t}\n\n\tif (\n\t\t!DEV ||\n\t\tcomponent_context === null ||\n\t\t!(error instanceof Error) ||\n\t\thandled_errors.has(error)\n\t) {\n\t\tpropagate_error(error, effect);\n\t\treturn;\n\t}\n\n\thandled_errors.add(error);\n\n\tconst component_stack = [];\n\n\tconst effect_name = effect.fn?.name;\n\n\tif (effect_name) {\n\t\tcomponent_stack.push(effect_name);\n\t}\n\n\t/** @type {ComponentContext | null} */\n\tlet current_context = component_context;\n\n\twhile (current_context !== null) {\n\t\tif (DEV) {\n\t\t\t/** @type {string} */\n\t\t\tvar filename = current_context.function?.[FILENAME];\n\n\t\t\tif (filename) {\n\t\t\t\tconst file = filename.split('/').pop();\n\t\t\t\tcomponent_stack.push(file);\n\t\t\t}\n\t\t}\n\n\t\tcurrent_context = current_context.p;\n\t}\n\n\tconst indent = is_firefox ? ' ' : '\\t';\n\tdefine_property(error, 'message', {\n\t\tvalue: error.message + `\\n${component_stack.map((name) => `\\n${indent}in ${name}`).join('')}\\n`\n\t});\n\tdefine_property(error, 'component_stack', {\n\t\tvalue: component_stack\n\t});\n\n\tconst stack = error.stack;\n\n\t// Filter out internal files from callstack\n\tif (stack) {\n\t\tconst lines = stack.split('\\n');\n\t\tconst new_lines = [];\n\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\tconst line = lines[i];\n\t\t\tif (line.includes('svelte/src/internal')) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tnew_lines.push(line);\n\t\t}\n\t\tdefine_property(error, 'stack', {\n\t\t\tvalue: new_lines.join('\\n')\n\t\t});\n\t}\n\n\tpropagate_error(error, effect);\n\n\tif (should_rethrow_error(effect)) {\n\t\tthrow error;\n\t}\n}\n\n/**\n * @param {Value} signal\n * @param {Effect} effect\n * @param {boolean} [root]\n */\nfunction schedule_possible_effect_self_invalidation(signal, effect, root = true) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tfor (var i = 0; i < reactions.length; i++) {\n\t\tvar reaction = reactions[i];\n\t\tif ((reaction.f & DERIVED) !== 0) {\n\t\t\tschedule_possible_effect_self_invalidation(/** @type {Derived} */ (reaction), effect, false);\n\t\t} else if (effect === reaction) {\n\t\t\tif (root) {\n\t\t\t\tset_signal_status(reaction, DIRTY);\n\t\t\t} else if ((reaction.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(reaction, MAYBE_DIRTY);\n\t\t\t}\n\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n\n/**\n * @template V\n * @param {Reaction} reaction\n * @returns {V}\n */\nexport function update_reaction(reaction) {\n\tvar previous_deps = new_deps;\n\tvar previous_skipped_deps = skipped_deps;\n\tvar previous_untracked_writes = untracked_writes;\n\tvar previous_reaction = active_reaction;\n\tvar previous_skip_reaction = skip_reaction;\n\tvar prev_derived_sources = derived_sources;\n\tvar previous_component_context = component_context;\n\tvar previous_untracking = untracking;\n\tvar flags = reaction.f;\n\n\tnew_deps = /** @type {null | Value[]} */ (null);\n\tskipped_deps = 0;\n\tuntracked_writes = null;\n\tskip_reaction =\n\t\t(flags & UNOWNED) !== 0 && (untracking || !is_updating_effect || active_reaction === null);\n\tactive_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;\n\n\tderived_sources = null;\n\tset_component_context(reaction.ctx);\n\tuntracking = false;\n\tread_version++;\n\n\ttry {\n\t\tvar result = /** @type {Function} */ (0, reaction.fn)();\n\t\tvar deps = reaction.deps;\n\n\t\tif (new_deps !== null) {\n\t\t\tvar i;\n\n\t\t\tremove_reactions(reaction, skipped_deps);\n\n\t\t\tif (deps !== null && skipped_deps > 0) {\n\t\t\t\tdeps.length = skipped_deps + new_deps.length;\n\t\t\t\tfor (i = 0; i < new_deps.length; i++) {\n\t\t\t\t\tdeps[skipped_deps + i] = new_deps[i];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treaction.deps = deps = new_deps;\n\t\t\t}\n\n\t\t\tif (!skip_reaction) {\n\t\t\t\tfor (i = skipped_deps; i < deps.length; i++) {\n\t\t\t\t\t(deps[i].reactions ??= []).push(reaction);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (deps !== null && skipped_deps < deps.length) {\n\t\t\tremove_reactions(reaction, skipped_deps);\n\t\t\tdeps.length = skipped_deps;\n\t\t}\n\n\t\t// If we're inside an effect and we have untracked writes, then we need to\n\t\t// ensure that if any of those untracked writes result in re-invalidation\n\t\t// of the current effect, then that happens accordingly\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tuntracked_writes !== null &&\n\t\t\t!untracking &&\n\t\t\tdeps !== null &&\n\t\t\t(reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0\n\t\t) {\n\t\t\tfor (i = 0; i < /** @type {Source[]} */ (untracked_writes).length; i++) {\n\t\t\t\tschedule_possible_effect_self_invalidation(\n\t\t\t\t\tuntracked_writes[i],\n\t\t\t\t\t/** @type {Effect} */ (reaction)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// If we are returning to an previous reaction then\n\t\t// we need to increment the read version to ensure that\n\t\t// any dependencies in this reaction aren't marked with\n\t\t// the same version\n\t\tif (previous_reaction !== null) {\n\t\t\tread_version++;\n\t\t}\n\n\t\treturn result;\n\t} finally {\n\t\tnew_deps = previous_deps;\n\t\tskipped_deps = previous_skipped_deps;\n\t\tuntracked_writes = previous_untracked_writes;\n\t\tactive_reaction = previous_reaction;\n\t\tskip_reaction = previous_skip_reaction;\n\t\tderived_sources = prev_derived_sources;\n\t\tset_component_context(previous_component_context);\n\t\tuntracking = previous_untracking;\n\t}\n}\n\n/**\n * @template V\n * @param {Reaction} signal\n * @param {Value} dependency\n * @returns {void}\n */\nfunction remove_reaction(signal, dependency) {\n\tlet reactions = dependency.reactions;\n\tif (reactions !== null) {\n\t\tvar index = index_of.call(reactions, signal);\n\t\tif (index !== -1) {\n\t\t\tvar new_length = reactions.length - 1;\n\t\t\tif (new_length === 0) {\n\t\t\t\treactions = dependency.reactions = null;\n\t\t\t} else {\n\t\t\t\t// Swap with last element and then remove.\n\t\t\t\treactions[index] = reactions[new_length];\n\t\t\t\treactions.pop();\n\t\t\t}\n\t\t}\n\t}\n\t// If the derived has no reactions, then we can disconnect it from the graph,\n\t// allowing it to either reconnect in the future, or be GC'd by the VM.\n\tif (\n\t\treactions === null &&\n\t\t(dependency.f & DERIVED) !== 0 &&\n\t\t// Destroying a child effect while updating a parent effect can cause a dependency to appear\n\t\t// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`\n\t\t// allows us to skip the expensive work of disconnecting and immediately reconnecting it\n\t\t(new_deps === null || !new_deps.includes(dependency))\n\t) {\n\t\tset_signal_status(dependency, MAYBE_DIRTY);\n\t\t// If we are working with a derived that is owned by an effect, then mark it as being\n\t\t// disconnected.\n\t\tif ((dependency.f & (UNOWNED | DISCONNECTED)) === 0) {\n\t\t\tdependency.f ^= DISCONNECTED;\n\t\t}\n\t\t// Disconnect any reactions owned by this reaction\n\t\tdestroy_derived_effects(/** @type {Derived} **/ (dependency));\n\t\tremove_reactions(/** @type {Derived} **/ (dependency), 0);\n\t}\n}\n\n/**\n * @param {Reaction} signal\n * @param {number} start_index\n * @returns {void}\n */\nexport function remove_reactions(signal, start_index) {\n\tvar dependencies = signal.deps;\n\tif (dependencies === null) return;\n\n\tfor (var i = start_index; i < dependencies.length; i++) {\n\t\tremove_reaction(signal, dependencies[i]);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @returns {void}\n */\nexport function update_effect(effect) {\n\tvar flags = effect.f;\n\n\tif ((flags & DESTROYED) !== 0) {\n\t\treturn;\n\t}\n\n\tset_signal_status(effect, CLEAN);\n\n\tvar previous_effect = active_effect;\n\tvar previous_component_context = component_context;\n\tvar was_updating_effect = is_updating_effect;\n\n\tactive_effect = effect;\n\tis_updating_effect = true;\n\n\tif (DEV) {\n\t\tvar previous_component_fn = dev_current_component_function;\n\t\tset_dev_current_component_function(effect.component_function);\n\t}\n\n\ttry {\n\t\tif ((flags & BLOCK_EFFECT) !== 0) {\n\t\t\tdestroy_block_effect_children(effect);\n\t\t} else {\n\t\t\tdestroy_effect_children(effect);\n\t\t}\n\n\t\texecute_effect_teardown(effect);\n\t\tvar teardown = update_reaction(effect);\n\t\teffect.teardown = typeof teardown === 'function' ? teardown : null;\n\t\teffect.wv = write_version;\n\n\t\tvar deps = effect.deps;\n\n\t\t// In DEV, we need to handle a case where $inspect.trace() might\n\t\t// incorrectly state a source dependency has not changed when it has.\n\t\t// That's beacuse that source was changed by the same effect, causing\n\t\t// the versions to match. We can avoid this by incrementing the version\n\t\tif (DEV && tracing_mode_flag && (effect.f & DIRTY) !== 0 && deps !== null) {\n\t\t\tfor (let i = 0; i < deps.length; i++) {\n\t\t\t\tvar dep = deps[i];\n\t\t\t\tif (dep.trace_need_increase) {\n\t\t\t\t\tdep.wv = increment_write_version();\n\t\t\t\t\tdep.trace_need_increase = undefined;\n\t\t\t\t\tdep.trace_v = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (DEV) {\n\t\t\tdev_effect_stack.push(effect);\n\t\t}\n\t} catch (error) {\n\t\thandle_error(error, effect, previous_effect, previous_component_context || effect.ctx);\n\t} finally {\n\t\tis_updating_effect = was_updating_effect;\n\t\tactive_effect = previous_effect;\n\n\t\tif (DEV) {\n\t\t\tset_dev_current_component_function(previous_component_fn);\n\t\t}\n\t}\n}\n\nfunction log_effect_stack() {\n\t// eslint-disable-next-line no-console\n\tconsole.error(\n\t\t'Last ten effects were: ',\n\t\tdev_effect_stack.slice(-10).map((d) => d.fn)\n\t);\n\tdev_effect_stack = [];\n}\n\nfunction infinite_loop_guard() {\n\ttry {\n\t\te.effect_update_depth_exceeded();\n\t} catch (error) {\n\t\tif (DEV) {\n\t\t\t// stack is garbage, ignore. Instead add a console.error message.\n\t\t\tdefine_property(error, 'stack', {\n\t\t\t\tvalue: ''\n\t\t\t});\n\t\t}\n\t\t// Try and handle the error so it can be caught at a boundary, that's\n\t\t// if there's an effect available from when it was last scheduled\n\t\tif (last_scheduled_effect !== null) {\n\t\t\tif (DEV) {\n\t\t\t\ttry {\n\t\t\t\t\thandle_error(error, last_scheduled_effect, null, null);\n\t\t\t\t} catch (e) {\n\t\t\t\t\t// Only log the effect stack if the error is re-thrown\n\t\t\t\t\tlog_effect_stack();\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandle_error(error, last_scheduled_effect, null, null);\n\t\t\t}\n\t\t} else {\n\t\t\tif (DEV) {\n\t\t\t\tlog_effect_stack();\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n\nfunction flush_queued_root_effects() {\n\ttry {\n\t\tvar flush_count = 0;\n\n\t\twhile (queued_root_effects.length > 0) {\n\t\t\tif (flush_count++ > 1000) {\n\t\t\t\tinfinite_loop_guard();\n\t\t\t}\n\n\t\t\tvar root_effects = queued_root_effects;\n\t\t\tvar length = root_effects.length;\n\n\t\t\tqueued_root_effects = [];\n\n\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\tvar root = root_effects[i];\n\n\t\t\t\tif ((root.f & CLEAN) === 0) {\n\t\t\t\t\troot.f ^= CLEAN;\n\t\t\t\t}\n\n\t\t\t\tvar collected_effects = process_effects(root);\n\t\t\t\tflush_queued_effects(collected_effects);\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tis_flushing = false;\n\n\t\tlast_scheduled_effect = null;\n\t\tif (DEV) {\n\t\t\tdev_effect_stack = [];\n\t\t}\n\t}\n}\n\n/**\n * @param {Array} effects\n * @returns {void}\n */\nfunction flush_queued_effects(effects) {\n\tvar length = effects.length;\n\tif (length === 0) return;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tvar effect = effects[i];\n\n\t\tif ((effect.f & (DESTROYED | INERT)) === 0) {\n\t\t\ttry {\n\t\t\t\tif (check_dirtiness(effect)) {\n\t\t\t\t\tupdate_effect(effect);\n\n\t\t\t\t\t// Effects with no dependencies or teardown do not get added to the effect tree.\n\t\t\t\t\t// Deferred effects (e.g. `$effect(...)`) _are_ added to the tree because we\n\t\t\t\t\t// don't know if we need to keep them until they are executed. Doing the check\n\t\t\t\t\t// here (rather than in `update_effect`) allows us to skip the work for\n\t\t\t\t\t// immediate effects.\n\t\t\t\t\tif (effect.deps === null && effect.first === null && effect.nodes_start === null) {\n\t\t\t\t\t\tif (effect.teardown === null) {\n\t\t\t\t\t\t\t// remove this effect from the graph\n\t\t\t\t\t\t\tunlink_effect(effect);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// keep the effect in the graph, but free up some memory\n\t\t\t\t\t\t\teffect.fn = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\thandle_error(error, effect, null, effect.ctx);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @returns {void}\n */\nexport function schedule_effect(signal) {\n\tif (!is_flushing) {\n\t\tis_flushing = true;\n\t\tqueueMicrotask(flush_queued_root_effects);\n\t}\n\n\tvar effect = (last_scheduled_effect = signal);\n\n\twhile (effect.parent !== null) {\n\t\teffect = effect.parent;\n\t\tvar flags = effect.f;\n\n\t\tif ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {\n\t\t\tif ((flags & CLEAN) === 0) return;\n\t\t\teffect.f ^= CLEAN;\n\t\t}\n\t}\n\n\tqueued_root_effects.push(effect);\n}\n\n/**\n *\n * This function both runs render effects and collects user effects in topological order\n * from the starting effect passed in. Effects will be collected when they match the filtered\n * bitwise flag passed in only. The collected effects array will be populated with all the user\n * effects to be flushed.\n *\n * @param {Effect} effect\n * @returns {Effect[]}\n */\nfunction process_effects(effect) {\n\t/** @type {Effect[]} */\n\tvar effects = [];\n\n\tvar current_effect = effect.first;\n\n\tmain_loop: while (current_effect !== null) {\n\t\tvar flags = current_effect.f;\n\t\tvar is_branch = (flags & BRANCH_EFFECT) !== 0;\n\t\tvar is_skippable_branch = is_branch && (flags & CLEAN) !== 0;\n\t\tvar sibling = current_effect.next;\n\n\t\tif (!is_skippable_branch && (flags & INERT) === 0) {\n\t\t\tif ((flags & EFFECT) !== 0) {\n\t\t\t\teffects.push(current_effect);\n\t\t\t} else if (is_branch) {\n\t\t\t\tcurrent_effect.f ^= CLEAN;\n\t\t\t} else {\n\t\t\t\t// Ensure we set the effect to be the active reaction\n\t\t\t\t// to ensure that unowned deriveds are correctly tracked\n\t\t\t\t// because we're flushing the current effect\n\t\t\t\tvar previous_active_reaction = active_reaction;\n\t\t\t\ttry {\n\t\t\t\t\tactive_reaction = current_effect;\n\t\t\t\t\tif (check_dirtiness(current_effect)) {\n\t\t\t\t\t\tupdate_effect(current_effect);\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\thandle_error(error, current_effect, null, current_effect.ctx);\n\t\t\t\t} finally {\n\t\t\t\t\tactive_reaction = previous_active_reaction;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar child = current_effect.first;\n\n\t\t\tif (child !== null) {\n\t\t\t\tcurrent_effect = child;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (sibling === null) {\n\t\t\tlet parent = current_effect.parent;\n\n\t\t\twhile (parent !== null) {\n\t\t\t\tif (effect === parent) {\n\t\t\t\t\tbreak main_loop;\n\t\t\t\t}\n\t\t\t\tvar parent_sibling = parent.next;\n\t\t\t\tif (parent_sibling !== null) {\n\t\t\t\t\tcurrent_effect = parent_sibling;\n\t\t\t\t\tcontinue main_loop;\n\t\t\t\t}\n\t\t\t\tparent = parent.parent;\n\t\t\t}\n\t\t}\n\n\t\tcurrent_effect = sibling;\n\t}\n\n\treturn effects;\n}\n\n/**\n * Synchronously flush any pending updates.\n * Returns void if no callback is provided, otherwise returns the result of calling the callback.\n * @template [T=void]\n * @param {(() => T) | undefined} [fn]\n * @returns {T}\n */\nexport function flushSync(fn) {\n\tvar result;\n\n\tif (fn) {\n\t\tis_flushing = true;\n\t\tflush_queued_root_effects();\n\t\tresult = fn();\n\t}\n\n\tflush_tasks();\n\n\twhile (queued_root_effects.length > 0) {\n\t\tis_flushing = true;\n\t\tflush_queued_root_effects();\n\t\tflush_tasks();\n\t}\n\n\treturn /** @type {T} */ (result);\n}\n\n/**\n * Returns a promise that resolves once any pending state changes have been applied.\n * @returns {Promise}\n */\nexport async function tick() {\n\tawait Promise.resolve();\n\t// By calling flushSync we guarantee that any pending state changes are applied after one tick.\n\t// TODO look into whether we can make flushing subsequent updates synchronously in the future.\n\tflushSync();\n}\n\n/**\n * @template V\n * @param {Value} signal\n * @returns {V}\n */\nexport function get(signal) {\n\tvar flags = signal.f;\n\tvar is_derived = (flags & DERIVED) !== 0;\n\n\tif (captured_signals !== null) {\n\t\tcaptured_signals.add(signal);\n\t}\n\n\t// Register the dependency on the current reaction signal.\n\tif (active_reaction !== null && !untracking) {\n\t\tif (derived_sources !== null && derived_sources.includes(signal)) {\n\t\t\te.state_unsafe_local_read();\n\t\t}\n\t\tvar deps = active_reaction.deps;\n\t\tif (signal.rv < read_version) {\n\t\t\tsignal.rv = read_version;\n\t\t\t// If the signal is accessing the same dependencies in the same\n\t\t\t// order as it did last time, increment `skipped_deps`\n\t\t\t// rather than updating `new_deps`, which creates GC cost\n\t\t\tif (new_deps === null && deps !== null && deps[skipped_deps] === signal) {\n\t\t\t\tskipped_deps++;\n\t\t\t} else if (new_deps === null) {\n\t\t\t\tnew_deps = [signal];\n\t\t\t} else if (!skip_reaction || !new_deps.includes(signal)) {\n\t\t\t\t// Normally we can push duplicated dependencies to `new_deps`, but if we're inside\n\t\t\t\t// an unowned derived because skip_reaction is true, then we need to ensure that\n\t\t\t\t// we don't have duplicates\n\t\t\t\tnew_deps.push(signal);\n\t\t\t}\n\t\t}\n\t} else if (\n\t\tis_derived &&\n\t\t/** @type {Derived} */ (signal).deps === null &&\n\t\t/** @type {Derived} */ (signal).effects === null\n\t) {\n\t\tvar derived = /** @type {Derived} */ (signal);\n\t\tvar parent = derived.parent;\n\n\t\tif (parent !== null && (parent.f & UNOWNED) === 0) {\n\t\t\t// If the derived is owned by another derived then mark it as unowned\n\t\t\t// as the derived value might have been referenced in a different context\n\t\t\t// since and thus its parent might not be its true owner anymore\n\t\t\tderived.f ^= UNOWNED;\n\t\t}\n\t}\n\n\tif (is_derived) {\n\t\tderived = /** @type {Derived} */ (signal);\n\n\t\tif (check_dirtiness(derived)) {\n\t\t\tupdate_derived(derived);\n\t\t}\n\t}\n\n\tif (\n\t\tDEV &&\n\t\ttracing_mode_flag &&\n\t\ttracing_expressions !== null &&\n\t\tactive_reaction !== null &&\n\t\ttracing_expressions.reaction === active_reaction\n\t) {\n\t\t// Used when mapping state between special blocks like `each`\n\t\tif (signal.debug) {\n\t\t\tsignal.debug();\n\t\t} else if (signal.created) {\n\t\t\tvar entry = tracing_expressions.entries.get(signal);\n\n\t\t\tif (entry === undefined) {\n\t\t\t\tentry = { read: [] };\n\t\t\t\ttracing_expressions.entries.set(signal, entry);\n\t\t\t}\n\n\t\t\tentry.read.push(get_stack('TracedAt'));\n\t\t}\n\t}\n\n\treturn signal.v;\n}\n\n/**\n * Like `get`, but checks for `undefined`. Used for `var` declarations because they can be accessed before being declared\n * @template V\n * @param {Value | undefined} signal\n * @returns {V | undefined}\n */\nexport function safe_get(signal) {\n\treturn signal && get(signal);\n}\n\n/**\n * Capture an array of all the signals that are read when `fn` is called\n * @template T\n * @param {() => T} fn\n */\nfunction capture_signals(fn) {\n\tvar previous_captured_signals = captured_signals;\n\tcaptured_signals = new Set();\n\n\tvar captured = captured_signals;\n\tvar signal;\n\n\ttry {\n\t\tuntrack(fn);\n\t\tif (previous_captured_signals !== null) {\n\t\t\tfor (signal of captured_signals) {\n\t\t\t\tprevious_captured_signals.add(signal);\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tcaptured_signals = previous_captured_signals;\n\t}\n\n\treturn captured;\n}\n\n/**\n * Invokes a function and captures all signals that are read during the invocation,\n * then invalidates them.\n * @param {() => any} fn\n */\nexport function invalidate_inner_signals(fn) {\n\tvar captured = capture_signals(() => untrack(fn));\n\n\tfor (var signal of captured) {\n\t\t// Go one level up because derived signals created as part of props in legacy mode\n\t\tif ((signal.f & LEGACY_DERIVED_PROP) !== 0) {\n\t\t\tfor (const dep of /** @type {Derived} */ (signal).deps || []) {\n\t\t\t\tif ((dep.f & DERIVED) === 0) {\n\t\t\t\t\t// Use internal_set instead of set here and below to avoid mutation validation\n\t\t\t\t\tinternal_set(dep, dep.v);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tinternal_set(signal, signal.v);\n\t\t}\n\t}\n}\n\n/**\n * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),\n * any state read inside `fn` will not be treated as a dependency.\n *\n * ```ts\n * $effect(() => {\n * // this will run when `data` changes, but not when `time` changes\n * save(data, {\n * timestamp: untrack(() => time)\n * });\n * });\n * ```\n * @template T\n * @param {() => T} fn\n * @returns {T}\n */\nexport function untrack(fn) {\n\tvar previous_untracking = untracking;\n\ttry {\n\t\tuntracking = true;\n\t\treturn fn();\n\t} finally {\n\t\tuntracking = previous_untracking;\n\t}\n}\n\nconst STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);\n\n/**\n * @param {Signal} signal\n * @param {number} status\n * @returns {void}\n */\nexport function set_signal_status(signal, status) {\n\tsignal.f = (signal.f & STATUS_MASK) | status;\n}\n\n/**\n * @param {Record} obj\n * @param {string[]} keys\n * @returns {Record}\n */\nexport function exclude_from_object(obj, keys) {\n\t/** @type {Record} */\n\tvar result = {};\n\n\tfor (var key in obj) {\n\t\tif (!keys.includes(key)) {\n\t\t\tresult[key] = obj[key];\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Possibly traverse an object and read all its properties so that they're all reactive in case this is `$state`.\n * Does only check first level of an object for performance reasons (heuristic should be good for 99% of all cases).\n * @param {any} value\n * @returns {void}\n */\nexport function deep_read_state(value) {\n\tif (typeof value !== 'object' || !value || value instanceof EventTarget) {\n\t\treturn;\n\t}\n\n\tif (STATE_SYMBOL in value) {\n\t\tdeep_read(value);\n\t} else if (!Array.isArray(value)) {\n\t\tfor (let key in value) {\n\t\t\tconst prop = value[key];\n\t\t\tif (typeof prop === 'object' && prop && STATE_SYMBOL in prop) {\n\t\t\t\tdeep_read(prop);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Deeply traverse an object and read all its properties\n * so that they're all reactive in case this is `$state`\n * @param {any} value\n * @param {Set} visited\n * @returns {void}\n */\nexport function deep_read(value, visited = new Set()) {\n\tif (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t// We don't want to traverse DOM elements\n\t\t!(value instanceof EventTarget) &&\n\t\t!visited.has(value)\n\t) {\n\t\tvisited.add(value);\n\t\t// When working with a possible SvelteDate, this\n\t\t// will ensure we capture changes to it.\n\t\tif (value instanceof Date) {\n\t\t\tvalue.getTime();\n\t\t}\n\t\tfor (let key in value) {\n\t\t\ttry {\n\t\t\t\tdeep_read(value[key], visited);\n\t\t\t} catch (e) {\n\t\t\t\t// continue\n\t\t\t}\n\t\t}\n\t\tconst proto = get_prototype_of(value);\n\t\tif (\n\t\t\tproto !== Object.prototype &&\n\t\t\tproto !== Array.prototype &&\n\t\t\tproto !== Map.prototype &&\n\t\t\tproto !== Set.prototype &&\n\t\t\tproto !== Date.prototype\n\t\t) {\n\t\t\tconst descriptors = get_descriptors(proto);\n\t\t\tfor (let key in descriptors) {\n\t\t\t\tconst get = descriptors[key].get;\n\t\t\t\tif (get) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tget.call(value);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t// continue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","/** @import { TemplateNode } from '#client' */\n\nimport {\n\tHYDRATION_END,\n\tHYDRATION_ERROR,\n\tHYDRATION_START,\n\tHYDRATION_START_ELSE\n} from '../../../constants.js';\nimport * as w from '../warnings.js';\nimport { get_next_sibling } from './operations.js';\n\n/**\n * Use this variable to guard everything related to hydration code so it can be treeshaken out\n * if the user doesn't use the `hydrate` method and these code paths are therefore not needed.\n */\nexport let hydrating = false;\n\n/** @param {boolean} value */\nexport function set_hydrating(value) {\n\thydrating = value;\n}\n\n/**\n * The node that is currently being hydrated. This starts out as the first node inside the opening\n * comment, and updates each time a component calls `$.child(...)` or `$.sibling(...)`.\n * When entering a block (e.g. `{#if ...}`), `hydrate_node` is the block opening comment; by the\n * time we leave the block it is the closing comment, which serves as the block's anchor.\n * @type {TemplateNode}\n */\nexport let hydrate_node;\n\n/** @param {TemplateNode} node */\nexport function set_hydrate_node(node) {\n\tif (node === null) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\treturn (hydrate_node = node);\n}\n\nexport function hydrate_next() {\n\treturn set_hydrate_node(/** @type {TemplateNode} */ (get_next_sibling(hydrate_node)));\n}\n\n/** @param {TemplateNode} node */\nexport function reset(node) {\n\tif (!hydrating) return;\n\n\t// If the node has remaining siblings, something has gone wrong\n\tif (get_next_sibling(hydrate_node) !== null) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\thydrate_node = node;\n}\n\n/**\n * @param {HTMLTemplateElement} template\n */\nexport function hydrate_template(template) {\n\tif (hydrating) {\n\t\t// @ts-expect-error TemplateNode doesn't include DocumentFragment, but it's actually fine\n\t\thydrate_node = template.content;\n\t}\n}\n\nexport function next(count = 1) {\n\tif (hydrating) {\n\t\tvar i = count;\n\t\tvar node = hydrate_node;\n\n\t\twhile (i--) {\n\t\t\tnode = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\t}\n\n\t\thydrate_node = node;\n\t}\n}\n\n/**\n * Removes all nodes starting at `hydrate_node` up until the next hydration end comment\n */\nexport function remove_nodes() {\n\tvar depth = 0;\n\tvar node = hydrate_node;\n\n\twhile (true) {\n\t\tif (node.nodeType === 8) {\n\t\t\tvar data = /** @type {Comment} */ (node).data;\n\n\t\t\tif (data === HYDRATION_END) {\n\t\t\t\tif (depth === 0) return node;\n\t\t\t\tdepth -= 1;\n\t\t\t} else if (data === HYDRATION_START || data === HYDRATION_START_ELSE) {\n\t\t\t\tdepth += 1;\n\t\t\t}\n\t\t}\n\n\t\tvar next = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\tnode.remove();\n\t\tnode = next;\n\t}\n}\n","/** @import { ProxyMetadata, Source } from '#client' */\nimport { DEV } from 'esm-env';\nimport { get, active_effect } from './runtime.js';\nimport { component_context } from './context.js';\nimport {\n\tarray_prototype,\n\tget_descriptor,\n\tget_prototype_of,\n\tis_array,\n\tobject_prototype\n} from '../shared/utils.js';\nimport { check_ownership, widen_ownership } from './dev/ownership.js';\nimport { source, set } from './reactivity/sources.js';\nimport { STATE_SYMBOL, STATE_SYMBOL_METADATA } from './constants.js';\nimport { UNINITIALIZED } from '../../constants.js';\nimport * as e from './errors.js';\nimport { get_stack } from './dev/tracing.js';\nimport { tracing_mode_flag } from '../flags/index.js';\n\n/**\n * @template T\n * @param {T} value\n * @param {ProxyMetadata | null} [parent]\n * @param {Source} [prev] dev mode only\n * @returns {T}\n */\nexport function proxy(value, parent = null, prev) {\n\t/** @type {Error | null} */\n\tvar stack = null;\n\tif (DEV && tracing_mode_flag) {\n\t\tstack = get_stack('CreatedAt');\n\t}\n\t// if non-proxyable, or is already a proxy, return `value`\n\tif (typeof value !== 'object' || value === null || STATE_SYMBOL in value) {\n\t\treturn value;\n\t}\n\n\tconst prototype = get_prototype_of(value);\n\n\tif (prototype !== object_prototype && prototype !== array_prototype) {\n\t\treturn value;\n\t}\n\n\t/** @type {Map>} */\n\tvar sources = new Map();\n\tvar is_proxied_array = is_array(value);\n\tvar version = source(0);\n\n\tif (is_proxied_array) {\n\t\t// We need to create the length source eagerly to ensure that\n\t\t// mutations to the array are properly synced with our proxy\n\t\tsources.set('length', source(/** @type {any[]} */ (value).length, stack));\n\t}\n\n\t/** @type {ProxyMetadata} */\n\tvar metadata;\n\n\tif (DEV) {\n\t\tmetadata = {\n\t\t\tparent,\n\t\t\towners: null\n\t\t};\n\n\t\tif (prev) {\n\t\t\t// Reuse owners from previous state; necessary because reassignment is not guaranteed to have correct component context.\n\t\t\t// If no previous proxy exists we play it safe and assume ownerless state\n\t\t\t// @ts-expect-error\n\t\t\tconst prev_owners = prev.v?.[STATE_SYMBOL_METADATA]?.owners;\n\t\t\tmetadata.owners = prev_owners ? new Set(prev_owners) : null;\n\t\t} else {\n\t\t\tmetadata.owners =\n\t\t\t\tparent === null\n\t\t\t\t\t? component_context !== null\n\t\t\t\t\t\t? new Set([component_context.function])\n\t\t\t\t\t\t: null\n\t\t\t\t\t: new Set();\n\t\t}\n\t}\n\n\treturn new Proxy(/** @type {any} */ (value), {\n\t\tdefineProperty(_, prop, descriptor) {\n\t\t\tif (\n\t\t\t\t!('value' in descriptor) ||\n\t\t\t\tdescriptor.configurable === false ||\n\t\t\t\tdescriptor.enumerable === false ||\n\t\t\t\tdescriptor.writable === false\n\t\t\t) {\n\t\t\t\t// we disallow non-basic descriptors, because unless they are applied to the\n\t\t\t\t// target object — which we avoid, so that state can be forked — we will run\n\t\t\t\t// afoul of the various invariants\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/getOwnPropertyDescriptor#invariants\n\t\t\t\te.state_descriptors_fixed();\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\n\t\t\tif (s === undefined) {\n\t\t\t\ts = source(descriptor.value, stack);\n\t\t\t\tsources.set(prop, s);\n\t\t\t} else {\n\t\t\t\tset(s, proxy(descriptor.value, metadata));\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tdeleteProperty(target, prop) {\n\t\t\tvar s = sources.get(prop);\n\n\t\t\tif (s === undefined) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tsources.set(prop, source(UNINITIALIZED, stack));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// When working with arrays, we need to also ensure we update the length when removing\n\t\t\t\t// an indexed property\n\t\t\t\tif (is_proxied_array && typeof prop === 'string') {\n\t\t\t\t\tvar ls = /** @type {Source} */ (sources.get('length'));\n\t\t\t\t\tvar n = Number(prop);\n\n\t\t\t\t\tif (Number.isInteger(n) && n < ls.v) {\n\t\t\t\t\t\tset(ls, n);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tset(s, UNINITIALIZED);\n\t\t\t\tupdate_version(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tget(target, prop, receiver) {\n\t\t\tif (DEV && prop === STATE_SYMBOL_METADATA) {\n\t\t\t\treturn metadata;\n\t\t\t}\n\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar exists = prop in target;\n\n\t\t\t// create a source, but only if it's an own property and not a prototype property\n\t\t\tif (s === undefined && (!exists || get_descriptor(target, prop)?.writable)) {\n\t\t\t\ts = source(proxy(exists ? target[prop] : UNINITIALIZED, metadata), stack);\n\t\t\t\tsources.set(prop, s);\n\t\t\t}\n\n\t\t\tif (s !== undefined) {\n\t\t\t\tvar v = get(s);\n\n\t\t\t\t// In case of something like `foo = bar.map(...)`, foo would have ownership\n\t\t\t\t// of the array itself, while the individual items would have ownership\n\t\t\t\t// of the component that created bar. That means if we later do `foo[0].baz = 42`,\n\t\t\t\t// we could get a false-positive ownership violation, since the two proxies\n\t\t\t\t// are not connected to each other via the parent metadata relationship.\n\t\t\t\t// For this reason, we need to widen the ownership of the children\n\t\t\t\t// upon access when we detect they are not connected.\n\t\t\t\tif (DEV) {\n\t\t\t\t\t/** @type {ProxyMetadata | undefined} */\n\t\t\t\t\tvar prop_metadata = v?.[STATE_SYMBOL_METADATA];\n\t\t\t\t\tif (prop_metadata && prop_metadata?.parent !== metadata) {\n\t\t\t\t\t\twiden_ownership(metadata, prop_metadata);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn v === UNINITIALIZED ? undefined : v;\n\t\t\t}\n\n\t\t\treturn Reflect.get(target, prop, receiver);\n\t\t},\n\n\t\tgetOwnPropertyDescriptor(target, prop) {\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\t\t\tif (descriptor && 'value' in descriptor) {\n\t\t\t\tvar s = sources.get(prop);\n\t\t\t\tif (s) descriptor.value = get(s);\n\t\t\t} else if (descriptor === undefined) {\n\t\t\t\tvar source = sources.get(prop);\n\t\t\t\tvar value = source?.v;\n\n\t\t\t\tif (source !== undefined && value !== UNINITIALIZED) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\twritable: true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn descriptor;\n\t\t},\n\n\t\thas(target, prop) {\n\t\t\tif (DEV && prop === STATE_SYMBOL_METADATA) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = (s !== undefined && s.v !== UNINITIALIZED) || Reflect.has(target, prop);\n\n\t\t\tif (\n\t\t\t\ts !== undefined ||\n\t\t\t\t(active_effect !== null && (!has || get_descriptor(target, prop)?.writable))\n\t\t\t) {\n\t\t\t\tif (s === undefined) {\n\t\t\t\t\ts = source(has ? proxy(target[prop], metadata) : UNINITIALIZED, stack);\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t}\n\n\t\t\t\tvar value = get(s);\n\t\t\t\tif (value === UNINITIALIZED) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn has;\n\t\t},\n\n\t\tset(target, prop, value, receiver) {\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = prop in target;\n\n\t\t\t// variable.length = value -> clear all signals with index >= value\n\t\t\tif (is_proxied_array && prop === 'length') {\n\t\t\t\tfor (var i = value; i < /** @type {Source} */ (s).v; i += 1) {\n\t\t\t\t\tvar other_s = sources.get(i + '');\n\t\t\t\t\tif (other_s !== undefined) {\n\t\t\t\t\t\tset(other_s, UNINITIALIZED);\n\t\t\t\t\t} else if (i in target) {\n\t\t\t\t\t\t// If the item exists in the original, we need to create a uninitialized source,\n\t\t\t\t\t\t// else a later read of the property would result in a source being created with\n\t\t\t\t\t\t// the value of the original item at that index.\n\t\t\t\t\t\tother_s = source(UNINITIALIZED, stack);\n\t\t\t\t\t\tsources.set(i + '', other_s);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we haven't yet created a source for this property, we need to ensure\n\t\t\t// we do so otherwise if we read it later, then the write won't be tracked and\n\t\t\t// the heuristics of effects will be different vs if we had read the proxied\n\t\t\t// object property before writing to that property.\n\t\t\tif (s === undefined) {\n\t\t\t\tif (!has || get_descriptor(target, prop)?.writable) {\n\t\t\t\t\ts = source(undefined, stack);\n\t\t\t\t\tset(s, proxy(value, metadata));\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thas = s.v !== UNINITIALIZED;\n\t\t\t\tset(s, proxy(value, metadata));\n\t\t\t}\n\n\t\t\tif (DEV) {\n\t\t\t\t/** @type {ProxyMetadata | undefined} */\n\t\t\t\tvar prop_metadata = value?.[STATE_SYMBOL_METADATA];\n\t\t\t\tif (prop_metadata && prop_metadata?.parent !== metadata) {\n\t\t\t\t\twiden_ownership(metadata, prop_metadata);\n\t\t\t\t}\n\t\t\t\tcheck_ownership(metadata);\n\t\t\t}\n\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\t\t\t// Set the new value before updating any signals so that any listeners get the new value\n\t\t\tif (descriptor?.set) {\n\t\t\t\tdescriptor.set.call(receiver, value);\n\t\t\t}\n\n\t\t\tif (!has) {\n\t\t\t\t// If we have mutated an array directly, we might need to\n\t\t\t\t// signal that length has also changed. Do it before updating metadata\n\t\t\t\t// to ensure that iterating over the array as a result of a metadata update\n\t\t\t\t// will not cause the length to be out of sync.\n\t\t\t\tif (is_proxied_array && typeof prop === 'string') {\n\t\t\t\t\tvar ls = /** @type {Source} */ (sources.get('length'));\n\t\t\t\t\tvar n = Number(prop);\n\n\t\t\t\t\tif (Number.isInteger(n) && n >= ls.v) {\n\t\t\t\t\t\tset(ls, n + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tupdate_version(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\townKeys(target) {\n\t\t\tget(version);\n\n\t\t\tvar own_keys = Reflect.ownKeys(target).filter((key) => {\n\t\t\t\tvar source = sources.get(key);\n\t\t\t\treturn source === undefined || source.v !== UNINITIALIZED;\n\t\t\t});\n\n\t\t\tfor (var [key, source] of sources) {\n\t\t\t\tif (source.v !== UNINITIALIZED && !(key in target)) {\n\t\t\t\t\town_keys.push(key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn own_keys;\n\t\t},\n\n\t\tsetPrototypeOf() {\n\t\t\te.state_prototype_fixed();\n\t\t}\n\t});\n}\n\n/**\n * @param {Source} signal\n * @param {1 | -1} [d]\n */\nfunction update_version(signal, d = 1) {\n\tset(signal, signal.v + d);\n}\n\n/**\n * @param {any} value\n */\nexport function get_proxied_value(value) {\n\tif (value !== null && typeof value === 'object' && STATE_SYMBOL in value) {\n\t\treturn value[STATE_SYMBOL];\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {any} a\n * @param {any} b\n */\nexport function is(a, b) {\n\treturn Object.is(get_proxied_value(a), get_proxied_value(b));\n}\n","/** @import { TemplateNode } from '#client' */\nimport { hydrate_node, hydrating, set_hydrate_node } from './hydration.js';\nimport { DEV } from 'esm-env';\nimport { init_array_prototype_warnings } from '../dev/equality.js';\nimport { get_descriptor } from '../../shared/utils.js';\n\n// export these for reference in the compiled code, making global name deduplication unnecessary\n/** @type {Window} */\nexport var $window;\n\n/** @type {Document} */\nexport var $document;\n\n/** @type {boolean} */\nexport var is_firefox;\n\n/** @type {() => Node | null} */\nvar first_child_getter;\n/** @type {() => Node | null} */\nvar next_sibling_getter;\n\n/**\n * Initialize these lazily to avoid issues when using the runtime in a server context\n * where these globals are not available while avoiding a separate server entry point\n */\nexport function init_operations() {\n\tif ($window !== undefined) {\n\t\treturn;\n\t}\n\n\t$window = window;\n\t$document = document;\n\tis_firefox = /Firefox/.test(navigator.userAgent);\n\n\tvar element_prototype = Element.prototype;\n\tvar node_prototype = Node.prototype;\n\n\t// @ts-ignore\n\tfirst_child_getter = get_descriptor(node_prototype, 'firstChild').get;\n\t// @ts-ignore\n\tnext_sibling_getter = get_descriptor(node_prototype, 'nextSibling').get;\n\n\t// the following assignments improve perf of lookups on DOM nodes\n\t// @ts-expect-error\n\telement_prototype.__click = undefined;\n\t// @ts-expect-error\n\telement_prototype.__className = undefined;\n\t// @ts-expect-error\n\telement_prototype.__attributes = null;\n\t// @ts-expect-error\n\telement_prototype.__styles = null;\n\t// @ts-expect-error\n\telement_prototype.__e = undefined;\n\n\t// @ts-expect-error\n\tText.prototype.__t = undefined;\n\n\tif (DEV) {\n\t\t// @ts-expect-error\n\t\telement_prototype.__svelte_meta = null;\n\n\t\tinit_array_prototype_warnings();\n\t}\n}\n\n/**\n * @param {string} value\n * @returns {Text}\n */\nexport function create_text(value = '') {\n\treturn document.createTextNode(value);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {Node | null}\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_first_child(node) {\n\treturn first_child_getter.call(node);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {Node | null}\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_next_sibling(node) {\n\treturn next_sibling_getter.call(node);\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @template {Node} N\n * @param {N} node\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function child(node, is_text) {\n\tif (!hydrating) {\n\t\treturn get_first_child(node);\n\t}\n\n\tvar child = /** @type {TemplateNode} */ (get_first_child(hydrate_node));\n\n\t// Child can be null if we have an element with a single child, like `

{text}

`, where `text` is empty\n\tif (child === null) {\n\t\tchild = hydrate_node.appendChild(create_text());\n\t} else if (is_text && child.nodeType !== 3) {\n\t\tvar text = create_text();\n\t\tchild?.before(text);\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\tset_hydrate_node(child);\n\treturn child;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {DocumentFragment | TemplateNode[]} fragment\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function first_child(fragment, is_text) {\n\tif (!hydrating) {\n\t\t// when not hydrating, `fragment` is a `DocumentFragment` (the result of calling `open_frag`)\n\t\tvar first = /** @type {DocumentFragment} */ (get_first_child(/** @type {Node} */ (fragment)));\n\n\t\t// TODO prevent user comments with the empty string when preserveComments is true\n\t\tif (first instanceof Comment && first.data === '') return get_next_sibling(first);\n\n\t\treturn first;\n\t}\n\n\t// if an {expression} is empty during SSR, there might be no\n\t// text node to hydrate — we must therefore create one\n\tif (is_text && hydrate_node?.nodeType !== 3) {\n\t\tvar text = create_text();\n\n\t\thydrate_node?.before(text);\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\treturn hydrate_node;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {TemplateNode} node\n * @param {number} count\n * @param {boolean} is_text\n * @returns {Node | null}\n */\nexport function sibling(node, count = 1, is_text = false) {\n\tlet next_sibling = hydrating ? hydrate_node : node;\n\tvar last_sibling;\n\n\twhile (count--) {\n\t\tlast_sibling = next_sibling;\n\t\tnext_sibling = /** @type {TemplateNode} */ (get_next_sibling(next_sibling));\n\t}\n\n\tif (!hydrating) {\n\t\treturn next_sibling;\n\t}\n\n\tvar type = next_sibling?.nodeType;\n\n\t// if a sibling {expression} is empty during SSR, there might be no\n\t// text node to hydrate — we must therefore create one\n\tif (is_text && type !== 3) {\n\t\tvar text = create_text();\n\t\t// If the next sibling is `null` and we're handling text then it's because\n\t\t// the SSR content was empty for the text, so we need to generate a new text\n\t\t// node and insert it after the last sibling\n\t\tif (next_sibling === null) {\n\t\t\tlast_sibling?.after(text);\n\t\t} else {\n\t\t\tnext_sibling.before(text);\n\t\t}\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\tset_hydrate_node(next_sibling);\n\treturn /** @type {TemplateNode} */ (next_sibling);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {void}\n */\nexport function clear_text_content(node) {\n\tnode.textContent = '';\n}\n","import * as w from '../warnings.js';\nimport { get_proxied_value } from '../proxy.js';\n\nexport function init_array_prototype_warnings() {\n\tconst array_prototype = Array.prototype;\n\t// The REPL ends up here over and over, and this prevents it from adding more and more patches\n\t// of the same kind to the prototype, which would slow down everything over time.\n\t// @ts-expect-error\n\tconst cleanup = Array.__svelte_cleanup;\n\tif (cleanup) {\n\t\tcleanup();\n\t}\n\n\tconst { indexOf, lastIndexOf, includes } = array_prototype;\n\n\tarray_prototype.indexOf = function (item, from_index) {\n\t\tconst index = indexOf.call(this, item, from_index);\n\n\t\tif (index === -1) {\n\t\t\tfor (let i = from_index ?? 0; i < this.length; i += 1) {\n\t\t\t\tif (get_proxied_value(this[i]) === item) {\n\t\t\t\t\tw.state_proxy_equality_mismatch('array.indexOf(...)');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn index;\n\t};\n\n\tarray_prototype.lastIndexOf = function (item, from_index) {\n\t\t// we need to specify this.length - 1 because it's probably using something like\n\t\t// `arguments` inside so passing undefined is different from not passing anything\n\t\tconst index = lastIndexOf.call(this, item, from_index ?? this.length - 1);\n\n\t\tif (index === -1) {\n\t\t\tfor (let i = 0; i <= (from_index ?? this.length - 1); i += 1) {\n\t\t\t\tif (get_proxied_value(this[i]) === item) {\n\t\t\t\t\tw.state_proxy_equality_mismatch('array.lastIndexOf(...)');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn index;\n\t};\n\n\tarray_prototype.includes = function (item, from_index) {\n\t\tconst has = includes.call(this, item, from_index);\n\n\t\tif (!has) {\n\t\t\tfor (let i = 0; i < this.length; i += 1) {\n\t\t\t\tif (get_proxied_value(this[i]) === item) {\n\t\t\t\t\tw.state_proxy_equality_mismatch('array.includes(...)');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn has;\n\t};\n\n\t// @ts-expect-error\n\tArray.__svelte_cleanup = () => {\n\t\tarray_prototype.indexOf = indexOf;\n\t\tarray_prototype.lastIndexOf = lastIndexOf;\n\t\tarray_prototype.includes = includes;\n\t};\n}\n\n/**\n * @param {any} a\n * @param {any} b\n * @param {boolean} equal\n * @returns {boolean}\n */\nexport function strict_equals(a, b, equal = true) {\n\t// try-catch needed because this tries to read properties of `a` and `b`,\n\t// which could be disallowed for example in a secure context\n\ttry {\n\t\tif ((a === b) !== (get_proxied_value(a) === get_proxied_value(b))) {\n\t\t\tw.state_proxy_equality_mismatch(equal ? '===' : '!==');\n\t\t}\n\t} catch {}\n\n\treturn (a === b) === equal;\n}\n\n/**\n * @param {any} a\n * @param {any} b\n * @param {boolean} equal\n * @returns {boolean}\n */\nexport function equals(a, b, equal = true) {\n\tif ((a == b) !== (get_proxied_value(a) == get_proxied_value(b))) {\n\t\tw.state_proxy_equality_mismatch(equal ? '==' : '!=');\n\t}\n\n\treturn (a == b) === equal;\n}\n","/** @import { Derived, Effect } from '#client' */\nimport { DEV } from 'esm-env';\nimport { CLEAN, DERIVED, DIRTY, EFFECT_HAS_DERIVED, MAYBE_DIRTY, UNOWNED } from '../constants.js';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tset_signal_status,\n\tskip_reaction,\n\tupdate_reaction,\n\tincrement_write_version,\n\tset_active_effect\n} from '../runtime.js';\nimport { equals, safe_equals } from './equality.js';\nimport * as e from '../errors.js';\nimport { destroy_effect } from './effects.js';\nimport { inspect_effects, set_inspect_effects } from './sources.js';\nimport { get_stack } from '../dev/tracing.js';\nimport { tracing_mode_flag } from '../../flags/index.js';\nimport { component_context } from '../context.js';\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived(fn) {\n\tvar flags = DERIVED | DIRTY;\n\tvar parent_derived =\n\t\tactive_reaction !== null && (active_reaction.f & DERIVED) !== 0\n\t\t\t? /** @type {Derived} */ (active_reaction)\n\t\t\t: null;\n\n\tif (active_effect === null || (parent_derived !== null && (parent_derived.f & UNOWNED) !== 0)) {\n\t\tflags |= UNOWNED;\n\t} else {\n\t\t// Since deriveds are evaluated lazily, any effects created inside them are\n\t\t// created too late to ensure that the parent effect is added to the tree\n\t\tactive_effect.f |= EFFECT_HAS_DERIVED;\n\t}\n\n\t/** @type {Derived} */\n\tconst signal = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\teffects: null,\n\t\tequals,\n\t\tf: flags,\n\t\tfn,\n\t\treactions: null,\n\t\trv: 0,\n\t\tv: /** @type {V} */ (null),\n\t\twv: 0,\n\t\tparent: parent_derived ?? active_effect\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = get_stack('CreatedAt');\n\t}\n\n\treturn signal;\n}\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived_safe_equal(fn) {\n\tconst signal = derived(fn);\n\tsignal.equals = safe_equals;\n\treturn signal;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function destroy_derived_effects(derived) {\n\tvar effects = derived.effects;\n\n\tif (effects !== null) {\n\t\tderived.effects = null;\n\n\t\tfor (var i = 0; i < effects.length; i += 1) {\n\t\t\tdestroy_effect(/** @type {Effect} */ (effects[i]));\n\t\t}\n\t}\n}\n\n/**\n * The currently updating deriveds, used to detect infinite recursion\n * in dev mode and provide a nicer error than 'too much recursion'\n * @type {Derived[]}\n */\nlet stack = [];\n\n/**\n * @param {Derived} derived\n * @returns {Effect | null}\n */\nfunction get_derived_parent_effect(derived) {\n\tvar parent = derived.parent;\n\twhile (parent !== null) {\n\t\tif ((parent.f & DERIVED) === 0) {\n\t\t\treturn /** @type {Effect} */ (parent);\n\t\t}\n\t\tparent = parent.parent;\n\t}\n\treturn null;\n}\n\n/**\n * @template T\n * @param {Derived} derived\n * @returns {T}\n */\nfunction execute_derived(derived) {\n\tvar value;\n\tvar prev_active_effect = active_effect;\n\n\tset_active_effect(get_derived_parent_effect(derived));\n\n\tif (DEV) {\n\t\tlet prev_inspect_effects = inspect_effects;\n\t\tset_inspect_effects(new Set());\n\t\ttry {\n\t\t\tif (stack.includes(derived)) {\n\t\t\t\te.derived_references_self();\n\t\t\t}\n\n\t\t\tstack.push(derived);\n\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t\tset_inspect_effects(prev_inspect_effects);\n\t\t\tstack.pop();\n\t\t}\n\t} else {\n\t\ttry {\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t}\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function update_derived(derived) {\n\tvar value = execute_derived(derived);\n\tvar status =\n\t\t(skip_reaction || (derived.f & UNOWNED) !== 0) && derived.deps !== null ? MAYBE_DIRTY : CLEAN;\n\n\tset_signal_status(derived, status);\n\n\tif (!derived.equals(value)) {\n\t\tderived.v = value;\n\t\tderived.wv = increment_write_version();\n\t}\n}\n","/** @import { ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */\nimport {\n\tcheck_dirtiness,\n\tactive_effect,\n\tactive_reaction,\n\tupdate_effect,\n\tget,\n\tis_destroying_effect,\n\tremove_reactions,\n\tschedule_effect,\n\tset_active_reaction,\n\tset_is_destroying_effect,\n\tset_signal_status,\n\tuntrack,\n\tuntracking\n} from '../runtime.js';\nimport {\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tRENDER_EFFECT,\n\tEFFECT,\n\tDESTROYED,\n\tINERT,\n\tEFFECT_RAN,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tEFFECT_TRANSPARENT,\n\tDERIVED,\n\tUNOWNED,\n\tCLEAN,\n\tINSPECT_EFFECT,\n\tHEAD_EFFECT,\n\tMAYBE_DIRTY,\n\tEFFECT_HAS_DERIVED,\n\tBOUNDARY_EFFECT\n} from '../constants.js';\nimport { set } from './sources.js';\nimport * as e from '../errors.js';\nimport { DEV } from 'esm-env';\nimport { define_property } from '../../shared/utils.js';\nimport { get_next_sibling } from '../dom/operations.js';\nimport { derived } from './deriveds.js';\nimport { component_context, dev_current_component_function } from '../context.js';\n\n/**\n * @param {'$effect' | '$effect.pre' | '$inspect'} rune\n */\nexport function validate_effect(rune) {\n\tif (active_effect === null && active_reaction === null) {\n\t\te.effect_orphan(rune);\n\t}\n\n\tif (active_reaction !== null && (active_reaction.f & UNOWNED) !== 0 && active_effect === null) {\n\t\te.effect_in_unowned_derived();\n\t}\n\n\tif (is_destroying_effect) {\n\t\te.effect_in_teardown(rune);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {Effect} parent_effect\n */\nfunction push_effect(effect, parent_effect) {\n\tvar parent_last = parent_effect.last;\n\tif (parent_last === null) {\n\t\tparent_effect.last = parent_effect.first = effect;\n\t} else {\n\t\tparent_last.next = effect;\n\t\teffect.prev = parent_last;\n\t\tparent_effect.last = effect;\n\t}\n}\n\n/**\n * @param {number} type\n * @param {null | (() => void | (() => void))} fn\n * @param {boolean} sync\n * @param {boolean} push\n * @returns {Effect}\n */\nfunction create_effect(type, fn, sync, push = true) {\n\tvar is_root = (type & ROOT_EFFECT) !== 0;\n\tvar parent_effect = active_effect;\n\n\tif (DEV) {\n\t\t// Ensure the parent is never an inspect effect\n\t\twhile (parent_effect !== null && (parent_effect.f & INSPECT_EFFECT) !== 0) {\n\t\t\tparent_effect = parent_effect.parent;\n\t\t}\n\t}\n\n\t/** @type {Effect} */\n\tvar effect = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\tnodes_start: null,\n\t\tnodes_end: null,\n\t\tf: type | DIRTY,\n\t\tfirst: null,\n\t\tfn,\n\t\tlast: null,\n\t\tnext: null,\n\t\tparent: is_root ? null : parent_effect,\n\t\tprev: null,\n\t\tteardown: null,\n\t\ttransitions: null,\n\t\twv: 0\n\t};\n\n\tif (DEV) {\n\t\teffect.component_function = dev_current_component_function;\n\t}\n\n\tif (sync) {\n\t\ttry {\n\t\t\tupdate_effect(effect);\n\t\t\teffect.f |= EFFECT_RAN;\n\t\t} catch (e) {\n\t\t\tdestroy_effect(effect);\n\t\t\tthrow e;\n\t\t}\n\t} else if (fn !== null) {\n\t\tschedule_effect(effect);\n\t}\n\n\t// if an effect has no dependencies, no DOM and no teardown function,\n\t// don't bother adding it to the effect tree\n\tvar inert =\n\t\tsync &&\n\t\teffect.deps === null &&\n\t\teffect.first === null &&\n\t\teffect.nodes_start === null &&\n\t\teffect.teardown === null &&\n\t\t(effect.f & (EFFECT_HAS_DERIVED | BOUNDARY_EFFECT)) === 0;\n\n\tif (!inert && !is_root && push) {\n\t\tif (parent_effect !== null) {\n\t\t\tpush_effect(effect, parent_effect);\n\t\t}\n\n\t\t// if we're in a derived, add the effect there too\n\t\tif (active_reaction !== null && (active_reaction.f & DERIVED) !== 0) {\n\t\t\tvar derived = /** @type {Derived} */ (active_reaction);\n\t\t\t(derived.effects ??= []).push(effect);\n\t\t}\n\t}\n\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect.tracking()`\n * @returns {boolean}\n */\nexport function effect_tracking() {\n\treturn active_reaction !== null && !untracking;\n}\n\n/**\n * @param {() => void} fn\n */\nexport function teardown(fn) {\n\tconst effect = create_effect(RENDER_EFFECT, null, false);\n\tset_signal_status(effect, CLEAN);\n\teffect.teardown = fn;\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect(...)`\n * @param {() => void | (() => void)} fn\n */\nexport function user_effect(fn) {\n\tvalidate_effect('$effect');\n\n\t// Non-nested `$effect(...)` in a component should be deferred\n\t// until the component is mounted\n\tvar defer =\n\t\tactive_effect !== null &&\n\t\t(active_effect.f & BRANCH_EFFECT) !== 0 &&\n\t\tcomponent_context !== null &&\n\t\t!component_context.m;\n\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect'\n\t\t});\n\t}\n\n\tif (defer) {\n\t\tvar context = /** @type {ComponentContext} */ (component_context);\n\t\t(context.e ??= []).push({\n\t\t\tfn,\n\t\t\teffect: active_effect,\n\t\t\treaction: active_reaction\n\t\t});\n\t} else {\n\t\tvar signal = effect(fn);\n\t\treturn signal;\n\t}\n}\n\n/**\n * Internal representation of `$effect.pre(...)`\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function user_pre_effect(fn) {\n\tvalidate_effect('$effect.pre');\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect.pre'\n\t\t});\n\t}\n\treturn render_effect(fn);\n}\n\n/** @param {() => void | (() => void)} fn */\nexport function inspect_effect(fn) {\n\treturn create_effect(INSPECT_EFFECT, fn, true);\n}\n\n/**\n * Internal representation of `$effect.root(...)`\n * @param {() => void | (() => void)} fn\n * @returns {() => void}\n */\nexport function effect_root(fn) {\n\tconst effect = create_effect(ROOT_EFFECT, fn, true);\n\n\treturn () => {\n\t\tdestroy_effect(effect);\n\t};\n}\n\n/**\n * An effect root whose children can transition out\n * @param {() => void} fn\n * @returns {(options?: { outro?: boolean }) => Promise}\n */\nexport function component_root(fn) {\n\tconst effect = create_effect(ROOT_EFFECT, fn, true);\n\n\treturn (options = {}) => {\n\t\treturn new Promise((fulfil) => {\n\t\t\tif (options.outro) {\n\t\t\t\tpause_effect(effect, () => {\n\t\t\t\t\tdestroy_effect(effect);\n\t\t\t\t\tfulfil(undefined);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tdestroy_effect(effect);\n\t\t\t\tfulfil(undefined);\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function effect(fn) {\n\treturn create_effect(EFFECT, fn, false);\n}\n\n/**\n * Internal representation of `$: ..`\n * @param {() => any} deps\n * @param {() => void | (() => void)} fn\n */\nexport function legacy_pre_effect(deps, fn) {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\t/** @type {{ effect: null | Effect, ran: boolean }} */\n\tvar token = { effect: null, ran: false };\n\tcontext.l.r1.push(token);\n\n\ttoken.effect = render_effect(() => {\n\t\tdeps();\n\n\t\t// If this legacy pre effect has already run before the end of the reset, then\n\t\t// bail out to emulate the same behavior.\n\t\tif (token.ran) return;\n\n\t\ttoken.ran = true;\n\t\tset(context.l.r2, true);\n\t\tuntrack(fn);\n\t});\n}\n\nexport function legacy_pre_effect_reset() {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\trender_effect(() => {\n\t\tif (!get(context.l.r2)) return;\n\n\t\t// Run dirty `$:` statements\n\t\tfor (var token of context.l.r1) {\n\t\t\tvar effect = token.effect;\n\n\t\t\t// If the effect is CLEAN, then make it MAYBE_DIRTY. This ensures we traverse through\n\t\t\t// the effects dependencies and correctly ensure each dependency is up-to-date.\n\t\t\tif ((effect.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t\t}\n\n\t\t\tif (check_dirtiness(effect)) {\n\t\t\t\tupdate_effect(effect);\n\t\t\t}\n\n\t\t\ttoken.ran = false;\n\t\t}\n\n\t\tcontext.l.r2.v = false; // set directly to avoid rerunning this effect\n\t});\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function render_effect(fn) {\n\treturn create_effect(RENDER_EFFECT, fn, true);\n}\n\n/**\n * @param {(...expressions: any) => void | (() => void)} fn\n * @param {Array<() => any>} thunks\n * @returns {Effect}\n */\nexport function template_effect(fn, thunks = [], d = derived) {\n\tconst deriveds = thunks.map(d);\n\tconst effect = () => fn(...deriveds.map(get));\n\n\tif (DEV) {\n\t\tdefine_property(effect, 'name', {\n\t\t\tvalue: '{expression}'\n\t\t});\n\t}\n\n\treturn block(effect);\n}\n\n/**\n * @param {(() => void)} fn\n * @param {number} flags\n */\nexport function block(fn, flags = 0) {\n\treturn create_effect(RENDER_EFFECT | BLOCK_EFFECT | flags, fn, true);\n}\n\n/**\n * @param {(() => void)} fn\n * @param {boolean} [push]\n */\nexport function branch(fn, push = true) {\n\treturn create_effect(RENDER_EFFECT | BRANCH_EFFECT, fn, true, push);\n}\n\n/**\n * @param {Effect} effect\n */\nexport function execute_effect_teardown(effect) {\n\tvar teardown = effect.teardown;\n\tif (teardown !== null) {\n\t\tconst previously_destroying_effect = is_destroying_effect;\n\t\tconst previous_reaction = active_reaction;\n\t\tset_is_destroying_effect(true);\n\t\tset_active_reaction(null);\n\t\ttry {\n\t\t\tteardown.call(null);\n\t\t} finally {\n\t\t\tset_is_destroying_effect(previously_destroying_effect);\n\t\t\tset_active_reaction(previous_reaction);\n\t\t}\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @param {boolean} remove_dom\n * @returns {void}\n */\nexport function destroy_effect_children(signal, remove_dom = false) {\n\tvar effect = signal.first;\n\tsignal.first = signal.last = null;\n\n\twhile (effect !== null) {\n\t\tvar next = effect.next;\n\t\tdestroy_effect(effect, remove_dom);\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @returns {void}\n */\nexport function destroy_block_effect_children(signal) {\n\tvar effect = signal.first;\n\n\twhile (effect !== null) {\n\t\tvar next = effect.next;\n\t\tif ((effect.f & BRANCH_EFFECT) === 0) {\n\t\t\tdestroy_effect(effect);\n\t\t}\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} [remove_dom]\n * @returns {void}\n */\nexport function destroy_effect(effect, remove_dom = true) {\n\tvar removed = false;\n\n\tif ((remove_dom || (effect.f & HEAD_EFFECT) !== 0) && effect.nodes_start !== null) {\n\t\t/** @type {TemplateNode | null} */\n\t\tvar node = effect.nodes_start;\n\t\tvar end = effect.nodes_end;\n\n\t\twhile (node !== null) {\n\t\t\t/** @type {TemplateNode | null} */\n\t\t\tvar next = node === end ? null : /** @type {TemplateNode} */ (get_next_sibling(node));\n\n\t\t\tnode.remove();\n\t\t\tnode = next;\n\t\t}\n\n\t\tremoved = true;\n\t}\n\n\tdestroy_effect_children(effect, remove_dom && !removed);\n\tremove_reactions(effect, 0);\n\tset_signal_status(effect, DESTROYED);\n\n\tvar transitions = effect.transitions;\n\n\tif (transitions !== null) {\n\t\tfor (const transition of transitions) {\n\t\t\ttransition.stop();\n\t\t}\n\t}\n\n\texecute_effect_teardown(effect);\n\n\tvar parent = effect.parent;\n\n\t// If the parent doesn't have any children, then skip this work altogether\n\tif (parent !== null && parent.first !== null) {\n\t\tunlink_effect(effect);\n\t}\n\n\tif (DEV) {\n\t\teffect.component_function = null;\n\t}\n\n\t// `first` and `child` are nulled out in destroy_effect_children\n\t// we don't null out `parent` so that error propagation can work correctly\n\teffect.next =\n\t\teffect.prev =\n\t\teffect.teardown =\n\t\teffect.ctx =\n\t\teffect.deps =\n\t\teffect.fn =\n\t\teffect.nodes_start =\n\t\teffect.nodes_end =\n\t\t\tnull;\n}\n\n/**\n * Detach an effect from the effect tree, freeing up memory and\n * reducing the amount of work that happens on subsequent traversals\n * @param {Effect} effect\n */\nexport function unlink_effect(effect) {\n\tvar parent = effect.parent;\n\tvar prev = effect.prev;\n\tvar next = effect.next;\n\n\tif (prev !== null) prev.next = next;\n\tif (next !== null) next.prev = prev;\n\n\tif (parent !== null) {\n\t\tif (parent.first === effect) parent.first = next;\n\t\tif (parent.last === effect) parent.last = prev;\n\t}\n}\n\n/**\n * When a block effect is removed, we don't immediately destroy it or yank it\n * out of the DOM, because it might have transitions. Instead, we 'pause' it.\n * It stays around (in memory, and in the DOM) until outro transitions have\n * completed, and if the state change is reversed then we _resume_ it.\n * A paused effect does not update, and the DOM subtree becomes inert.\n * @param {Effect} effect\n * @param {() => void} [callback]\n */\nexport function pause_effect(effect, callback) {\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\n\tpause_children(effect, transitions, true);\n\n\trun_out_transitions(transitions, () => {\n\t\tdestroy_effect(effect);\n\t\tif (callback) callback();\n\t});\n}\n\n/**\n * @param {TransitionManager[]} transitions\n * @param {() => void} fn\n */\nexport function run_out_transitions(transitions, fn) {\n\tvar remaining = transitions.length;\n\tif (remaining > 0) {\n\t\tvar check = () => --remaining || fn();\n\t\tfor (var transition of transitions) {\n\t\t\ttransition.out(check);\n\t\t}\n\t} else {\n\t\tfn();\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {TransitionManager[]} transitions\n * @param {boolean} local\n */\nexport function pause_children(effect, transitions, local) {\n\tif ((effect.f & INERT) !== 0) return;\n\teffect.f ^= INERT;\n\n\tif (effect.transitions !== null) {\n\t\tfor (const transition of effect.transitions) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransitions.push(transition);\n\t\t\t}\n\t\t}\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\t\tvar transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0;\n\t\t// TODO we don't need to call pause_children recursively with a linked list in place\n\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t// through the tree.\n\t\tpause_children(child, transitions, transparent ? local : false);\n\t\tchild = sibling;\n\t}\n}\n\n/**\n * The opposite of `pause_effect`. We call this if (for example)\n * `x` becomes falsy then truthy: `{#if x}...{/if}`\n * @param {Effect} effect\n */\nexport function resume_effect(effect) {\n\tresume_children(effect, true);\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} local\n */\nfunction resume_children(effect, local) {\n\tif ((effect.f & INERT) === 0) return;\n\teffect.f ^= INERT;\n\n\t// Ensure the effect is marked as clean again so that any dirty child\n\t// effects can schedule themselves for execution\n\tif ((effect.f & CLEAN) === 0) {\n\t\teffect.f ^= CLEAN;\n\t}\n\n\t// If a dependency of this effect changed while it was paused,\n\t// schedule the effect to update\n\tif (check_dirtiness(effect)) {\n\t\tset_signal_status(effect, DIRTY);\n\t\tschedule_effect(effect);\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\t\tvar transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0;\n\t\t// TODO we don't need to call resume_children recursively with a linked list in place\n\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t// through the tree.\n\t\tresume_children(child, transparent ? local : false);\n\t\tchild = sibling;\n\t}\n\n\tif (effect.transitions !== null) {\n\t\tfor (const transition of effect.transitions) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransition.in();\n\t\t\t}\n\t\t}\n\t}\n}\n","import { run_all } from '../../shared/utils.js';\n\n// Fallback for when requestIdleCallback is not available\nconst request_idle_callback =\n\ttypeof requestIdleCallback === 'undefined'\n\t\t? (/** @type {() => void} */ cb) => setTimeout(cb, 1)\n\t\t: requestIdleCallback;\n\n/** @type {Array<() => void>} */\nlet micro_tasks = [];\n\n/** @type {Array<() => void>} */\nlet idle_tasks = [];\n\nfunction run_micro_tasks() {\n\tvar tasks = micro_tasks;\n\tmicro_tasks = [];\n\trun_all(tasks);\n}\n\nfunction run_idle_tasks() {\n\tvar tasks = idle_tasks;\n\tidle_tasks = [];\n\trun_all(tasks);\n}\n\n/**\n * @param {() => void} fn\n */\nexport function queue_micro_task(fn) {\n\tif (micro_tasks.length === 0) {\n\t\tqueueMicrotask(run_micro_tasks);\n\t}\n\n\tmicro_tasks.push(fn);\n}\n\n/**\n * @param {() => void} fn\n */\nexport function queue_idle_task(fn) {\n\tif (idle_tasks.length === 0) {\n\t\trequest_idle_callback(run_idle_tasks);\n\t}\n\n\tidle_tasks.push(fn);\n}\n\n/**\n * Synchronously run any queued tasks.\n */\nexport function flush_tasks() {\n\tif (micro_tasks.length > 0) {\n\t\trun_micro_tasks();\n\t}\n\n\tif (idle_tasks.length > 0) {\n\t\trun_idle_tasks();\n\t}\n}\n","const regex_return_characters = /\\r/g;\n\n/**\n * @param {string} str\n * @returns {string}\n */\nexport function hash(str) {\n\tstr = str.replace(regex_return_characters, '');\n\tlet hash = 5381;\n\tlet i = str.length;\n\n\twhile (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n\treturn (hash >>> 0).toString(36);\n}\n\nconst VOID_ELEMENT_NAMES = [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr'\n];\n\n/**\n * Returns `true` if `name` is of a void element\n * @param {string} name\n */\nexport function is_void(name) {\n\treturn VOID_ELEMENT_NAMES.includes(name) || name.toLowerCase() === '!doctype';\n}\n\nconst RESERVED_WORDS = [\n\t'arguments',\n\t'await',\n\t'break',\n\t'case',\n\t'catch',\n\t'class',\n\t'const',\n\t'continue',\n\t'debugger',\n\t'default',\n\t'delete',\n\t'do',\n\t'else',\n\t'enum',\n\t'eval',\n\t'export',\n\t'extends',\n\t'false',\n\t'finally',\n\t'for',\n\t'function',\n\t'if',\n\t'implements',\n\t'import',\n\t'in',\n\t'instanceof',\n\t'interface',\n\t'let',\n\t'new',\n\t'null',\n\t'package',\n\t'private',\n\t'protected',\n\t'public',\n\t'return',\n\t'static',\n\t'super',\n\t'switch',\n\t'this',\n\t'throw',\n\t'true',\n\t'try',\n\t'typeof',\n\t'var',\n\t'void',\n\t'while',\n\t'with',\n\t'yield'\n];\n\n/**\n * Returns `true` if `word` is a reserved JavaScript keyword\n * @param {string} word\n */\nexport function is_reserved(word) {\n\treturn RESERVED_WORDS.includes(word);\n}\n\n/**\n * @param {string} name\n */\nexport function is_capture_event(name) {\n\treturn name.endsWith('capture') && name !== 'gotpointercapture' && name !== 'lostpointercapture';\n}\n\n/** List of Element events that will be delegated */\nconst DELEGATED_EVENTS = [\n\t'beforeinput',\n\t'click',\n\t'change',\n\t'dblclick',\n\t'contextmenu',\n\t'focusin',\n\t'focusout',\n\t'input',\n\t'keydown',\n\t'keyup',\n\t'mousedown',\n\t'mousemove',\n\t'mouseout',\n\t'mouseover',\n\t'mouseup',\n\t'pointerdown',\n\t'pointermove',\n\t'pointerout',\n\t'pointerover',\n\t'pointerup',\n\t'touchend',\n\t'touchmove',\n\t'touchstart'\n];\n\n/**\n * Returns `true` if `event_name` is a delegated event\n * @param {string} event_name\n */\nexport function is_delegated(event_name) {\n\treturn DELEGATED_EVENTS.includes(event_name);\n}\n\n/**\n * Attributes that are boolean, i.e. they are present or not present.\n */\nconst DOM_BOOLEAN_ATTRIBUTES = [\n\t'allowfullscreen',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'disabled',\n\t'formnovalidate',\n\t'hidden',\n\t'indeterminate',\n\t'inert',\n\t'ismap',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'seamless',\n\t'selected',\n\t'webkitdirectory',\n\t'defer',\n\t'disablepictureinpicture',\n\t'disableremoteplayback'\n];\n\n/**\n * Returns `true` if `name` is a boolean attribute\n * @param {string} name\n */\nexport function is_boolean_attribute(name) {\n\treturn DOM_BOOLEAN_ATTRIBUTES.includes(name);\n}\n\n/**\n * @type {Record}\n * List of attribute names that should be aliased to their property names\n * because they behave differently between setting them as an attribute and\n * setting them as a property.\n */\nconst ATTRIBUTE_ALIASES = {\n\t// no `class: 'className'` because we handle that separately\n\tformnovalidate: 'formNoValidate',\n\tismap: 'isMap',\n\tnomodule: 'noModule',\n\tplaysinline: 'playsInline',\n\treadonly: 'readOnly',\n\tdefaultvalue: 'defaultValue',\n\tdefaultchecked: 'defaultChecked',\n\tsrcobject: 'srcObject',\n\tnovalidate: 'noValidate',\n\tallowfullscreen: 'allowFullscreen',\n\tdisablepictureinpicture: 'disablePictureInPicture',\n\tdisableremoteplayback: 'disableRemotePlayback'\n};\n\n/**\n * @param {string} name\n */\nexport function normalize_attribute(name) {\n\tname = name.toLowerCase();\n\treturn ATTRIBUTE_ALIASES[name] ?? name;\n}\n\nconst DOM_PROPERTIES = [\n\t...DOM_BOOLEAN_ATTRIBUTES,\n\t'formNoValidate',\n\t'isMap',\n\t'noModule',\n\t'playsInline',\n\t'readOnly',\n\t'value',\n\t'volume',\n\t'defaultValue',\n\t'defaultChecked',\n\t'srcObject',\n\t'noValidate',\n\t'allowFullscreen',\n\t'disablePictureInPicture',\n\t'disableRemotePlayback'\n];\n\n/**\n * @param {string} name\n */\nexport function is_dom_property(name) {\n\treturn DOM_PROPERTIES.includes(name);\n}\n\nconst NON_STATIC_PROPERTIES = ['autofocus', 'muted', 'defaultValue', 'defaultChecked'];\n\n/**\n * Returns `true` if the given attribute cannot be set through the template\n * string, i.e. needs some kind of JavaScript handling to work.\n * @param {string} name\n */\nexport function cannot_be_set_statically(name) {\n\treturn NON_STATIC_PROPERTIES.includes(name);\n}\n\n/**\n * Subset of delegated events which should be passive by default.\n * These two are already passive via browser defaults on window, document and body.\n * But since\n * - we're delegating them\n * - they happen often\n * - they apply to mobile which is generally less performant\n * we're marking them as passive by default for other elements, too.\n */\nconst PASSIVE_EVENTS = ['touchstart', 'touchmove'];\n\n/**\n * Returns `true` if `name` is a passive event\n * @param {string} name\n */\nexport function is_passive_event(name) {\n\treturn PASSIVE_EVENTS.includes(name);\n}\n\nconst CONTENT_EDITABLE_BINDINGS = ['textContent', 'innerHTML', 'innerText'];\n\n/** @param {string} name */\nexport function is_content_editable_binding(name) {\n\treturn CONTENT_EDITABLE_BINDINGS.includes(name);\n}\n\nconst LOAD_ERROR_ELEMENTS = [\n\t'body',\n\t'embed',\n\t'iframe',\n\t'img',\n\t'link',\n\t'object',\n\t'script',\n\t'style',\n\t'track'\n];\n\n/**\n * Returns `true` if the element emits `load` and `error` events\n * @param {string} name\n */\nexport function is_load_error_element(name) {\n\treturn LOAD_ERROR_ELEMENTS.includes(name);\n}\n\nconst SVG_ELEMENTS = [\n\t'altGlyph',\n\t'altGlyphDef',\n\t'altGlyphItem',\n\t'animate',\n\t'animateColor',\n\t'animateMotion',\n\t'animateTransform',\n\t'circle',\n\t'clipPath',\n\t'color-profile',\n\t'cursor',\n\t'defs',\n\t'desc',\n\t'discard',\n\t'ellipse',\n\t'feBlend',\n\t'feColorMatrix',\n\t'feComponentTransfer',\n\t'feComposite',\n\t'feConvolveMatrix',\n\t'feDiffuseLighting',\n\t'feDisplacementMap',\n\t'feDistantLight',\n\t'feDropShadow',\n\t'feFlood',\n\t'feFuncA',\n\t'feFuncB',\n\t'feFuncG',\n\t'feFuncR',\n\t'feGaussianBlur',\n\t'feImage',\n\t'feMerge',\n\t'feMergeNode',\n\t'feMorphology',\n\t'feOffset',\n\t'fePointLight',\n\t'feSpecularLighting',\n\t'feSpotLight',\n\t'feTile',\n\t'feTurbulence',\n\t'filter',\n\t'font',\n\t'font-face',\n\t'font-face-format',\n\t'font-face-name',\n\t'font-face-src',\n\t'font-face-uri',\n\t'foreignObject',\n\t'g',\n\t'glyph',\n\t'glyphRef',\n\t'hatch',\n\t'hatchpath',\n\t'hkern',\n\t'image',\n\t'line',\n\t'linearGradient',\n\t'marker',\n\t'mask',\n\t'mesh',\n\t'meshgradient',\n\t'meshpatch',\n\t'meshrow',\n\t'metadata',\n\t'missing-glyph',\n\t'mpath',\n\t'path',\n\t'pattern',\n\t'polygon',\n\t'polyline',\n\t'radialGradient',\n\t'rect',\n\t'set',\n\t'solidcolor',\n\t'stop',\n\t'svg',\n\t'switch',\n\t'symbol',\n\t'text',\n\t'textPath',\n\t'tref',\n\t'tspan',\n\t'unknown',\n\t'use',\n\t'view',\n\t'vkern'\n];\n\n/** @param {string} name */\nexport function is_svg(name) {\n\treturn SVG_ELEMENTS.includes(name);\n}\n\nconst MATHML_ELEMENTS = [\n\t'annotation',\n\t'annotation-xml',\n\t'maction',\n\t'math',\n\t'merror',\n\t'mfrac',\n\t'mi',\n\t'mmultiscripts',\n\t'mn',\n\t'mo',\n\t'mover',\n\t'mpadded',\n\t'mphantom',\n\t'mprescripts',\n\t'mroot',\n\t'mrow',\n\t'ms',\n\t'mspace',\n\t'msqrt',\n\t'mstyle',\n\t'msub',\n\t'msubsup',\n\t'msup',\n\t'mtable',\n\t'mtd',\n\t'mtext',\n\t'mtr',\n\t'munder',\n\t'munderover',\n\t'semantics'\n];\n\n/** @param {string} name */\nexport function is_mathml(name) {\n\treturn MATHML_ELEMENTS.includes(name);\n}\n\nconst RUNES = /** @type {const} */ ([\n\t'$state',\n\t'$state.raw',\n\t'$state.snapshot',\n\t'$props',\n\t'$props.id',\n\t'$bindable',\n\t'$derived',\n\t'$derived.by',\n\t'$effect',\n\t'$effect.pre',\n\t'$effect.tracking',\n\t'$effect.root',\n\t'$inspect',\n\t'$inspect().with',\n\t'$inspect.trace',\n\t'$host'\n]);\n\n/**\n * @param {string} name\n * @returns {name is RUNES[number]}\n */\nexport function is_rune(name) {\n\treturn RUNES.includes(/** @type {RUNES[number]} */ (name));\n}\n\n/** List of elements that require raw contents and should not have SSR comments put in them */\nconst RAW_TEXT_ELEMENTS = /** @type {const} */ (['textarea', 'script', 'style', 'title']);\n\n/** @param {string} name */\nexport function is_raw_text_element(name) {\n\treturn RAW_TEXT_ELEMENTS.includes(/** @type {RAW_TEXT_ELEMENTS[number]} */ (name));\n}\n\n/**\n * Prevent devtools trying to make `location` a clickable link by inserting a zero-width space\n * @param {string | undefined} location\n */\nexport function sanitize_location(location) {\n\treturn location?.replace(/\\//g, '/\\u200b');\n}\n","import { hydrating } from '../hydration.js';\nimport { clear_text_content, get_first_child } from '../operations.js';\nimport { queue_micro_task } from '../task.js';\n\n/**\n * @param {HTMLElement} dom\n * @param {boolean} value\n * @returns {void}\n */\nexport function autofocus(dom, value) {\n\tif (value) {\n\t\tconst body = document.body;\n\t\tdom.autofocus = true;\n\n\t\tqueue_micro_task(() => {\n\t\t\tif (document.activeElement === body) {\n\t\t\t\tdom.focus();\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * The child of a textarea actually corresponds to the defaultValue property, so we need\n * to remove it upon hydration to avoid a bug when someone resets the form value.\n * @param {HTMLTextAreaElement} dom\n * @returns {void}\n */\nexport function remove_textarea_child(dom) {\n\tif (hydrating && get_first_child(dom) !== null) {\n\t\tclear_text_content(dom);\n\t}\n}\n\nlet listening_to_form_reset = false;\n\nexport function add_form_reset_listener() {\n\tif (!listening_to_form_reset) {\n\t\tlistening_to_form_reset = true;\n\t\tdocument.addEventListener(\n\t\t\t'reset',\n\t\t\t(evt) => {\n\t\t\t\t// Needs to happen one tick later or else the dom properties of the form\n\t\t\t\t// elements have not updated to their reset values yet\n\t\t\t\tPromise.resolve().then(() => {\n\t\t\t\t\tif (!evt.defaultPrevented) {\n\t\t\t\t\t\tfor (const e of /**@type {HTMLFormElement} */ (evt.target).elements) {\n\t\t\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\t\t\te.__on_r?.();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\t// In the capture phase to guarantee we get noticed of it (no possiblity of stopPropagation)\n\t\t\t{ capture: true }\n\t\t);\n\t}\n}\n","import { teardown } from '../../../reactivity/effects.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../../runtime.js';\nimport { add_form_reset_listener } from '../misc.js';\n\n/**\n * Fires the handler once immediately (unless corresponding arg is set to `false`),\n * then listens to the given events until the render effect context is destroyed\n * @param {EventTarget} target\n * @param {Array} events\n * @param {(event?: Event) => void} handler\n * @param {any} call_handler_immediately\n */\nexport function listen(target, events, handler, call_handler_immediately = true) {\n\tif (call_handler_immediately) {\n\t\thandler();\n\t}\n\n\tfor (var name of events) {\n\t\ttarget.addEventListener(name, handler);\n\t}\n\n\tteardown(() => {\n\t\tfor (var name of events) {\n\t\t\ttarget.removeEventListener(name, handler);\n\t\t}\n\t});\n}\n\n/**\n * @template T\n * @param {() => T} fn\n */\nexport function without_reactive_context(fn) {\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\ttry {\n\t\treturn fn();\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * Listen to the given event, and then instantiate a global form reset listener if not already done,\n * to notify all bindings when the form is reset\n * @param {HTMLElement} element\n * @param {string} event\n * @param {(is_reset?: true) => void} handler\n * @param {(is_reset?: true) => void} [on_reset]\n */\nexport function listen_to_event_and_reset_event(element, event, handler, on_reset = handler) {\n\telement.addEventListener(event, () => without_reactive_context(handler));\n\t// @ts-expect-error\n\tconst prev = element.__on_r;\n\tif (prev) {\n\t\t// special case for checkbox that can have multiple binds (group & checked)\n\t\t// @ts-expect-error\n\t\telement.__on_r = () => {\n\t\t\tprev();\n\t\t\ton_reset(true);\n\t\t};\n\t} else {\n\t\t// @ts-expect-error\n\t\telement.__on_r = () => on_reset(true);\n\t}\n\n\tadd_form_reset_listener();\n}\n","/** @import { Location } from 'locate-character' */\nimport { teardown } from '../../reactivity/effects.js';\nimport { define_property, is_array } from '../../../shared/utils.js';\nimport { hydrating } from '../hydration.js';\nimport { queue_micro_task } from '../task.js';\nimport { FILENAME } from '../../../../constants.js';\nimport * as w from '../../warnings.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { without_reactive_context } from './bindings/shared.js';\n\n/** @type {Set} */\nexport const all_registered_events = new Set();\n\n/** @type {Set<(events: Array) => void>} */\nexport const root_event_handles = new Set();\n\n/**\n * SSR adds onload and onerror attributes to catch those events before the hydration.\n * This function detects those cases, removes the attributes and replays the events.\n * @param {HTMLElement} dom\n */\nexport function replay_events(dom) {\n\tif (!hydrating) return;\n\n\tif (dom.onload) {\n\t\tdom.removeAttribute('onload');\n\t}\n\tif (dom.onerror) {\n\t\tdom.removeAttribute('onerror');\n\t}\n\t// @ts-expect-error\n\tconst event = dom.__e;\n\tif (event !== undefined) {\n\t\t// @ts-expect-error\n\t\tdom.__e = undefined;\n\t\tqueueMicrotask(() => {\n\t\t\tif (dom.isConnected) {\n\t\t\t\tdom.dispatchEvent(event);\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * @param {string} event_name\n * @param {EventTarget} dom\n * @param {EventListener} [handler]\n * @param {AddEventListenerOptions} [options]\n */\nexport function create_event(event_name, dom, handler, options = {}) {\n\t/**\n\t * @this {EventTarget}\n\t */\n\tfunction target_handler(/** @type {Event} */ event) {\n\t\tif (!options.capture) {\n\t\t\t// Only call in the bubble phase, else delegated events would be called before the capturing events\n\t\t\thandle_event_propagation.call(dom, event);\n\t\t}\n\t\tif (!event.cancelBubble) {\n\t\t\treturn without_reactive_context(() => {\n\t\t\t\treturn handler?.call(this, event);\n\t\t\t});\n\t\t}\n\t}\n\n\t// Chrome has a bug where pointer events don't work when attached to a DOM element that has been cloned\n\t// with cloneNode() and the DOM element is disconnected from the document. To ensure the event works, we\n\t// defer the attachment till after it's been appended to the document. TODO: remove this once Chrome fixes\n\t// this bug. The same applies to wheel events and touch events.\n\tif (\n\t\tevent_name.startsWith('pointer') ||\n\t\tevent_name.startsWith('touch') ||\n\t\tevent_name === 'wheel'\n\t) {\n\t\tqueue_micro_task(() => {\n\t\t\tdom.addEventListener(event_name, target_handler, options);\n\t\t});\n\t} else {\n\t\tdom.addEventListener(event_name, target_handler, options);\n\t}\n\n\treturn target_handler;\n}\n\n/**\n * Attaches an event handler to an element and returns a function that removes the handler. Using this\n * rather than `addEventListener` will preserve the correct order relative to handlers added declaratively\n * (with attributes like `onclick`), which use event delegation for performance reasons\n *\n * @param {EventTarget} element\n * @param {string} type\n * @param {EventListener} handler\n * @param {AddEventListenerOptions} [options]\n */\nexport function on(element, type, handler, options = {}) {\n\tvar target_handler = create_event(type, element, handler, options);\n\n\treturn () => {\n\t\telement.removeEventListener(type, target_handler, options);\n\t};\n}\n\n/**\n * @param {string} event_name\n * @param {Element} dom\n * @param {EventListener} [handler]\n * @param {boolean} [capture]\n * @param {boolean} [passive]\n * @returns {void}\n */\nexport function event(event_name, dom, handler, capture, passive) {\n\tvar options = { capture, passive };\n\tvar target_handler = create_event(event_name, dom, handler, options);\n\n\t// @ts-ignore\n\tif (dom === document.body || dom === window || dom === document) {\n\t\tteardown(() => {\n\t\t\tdom.removeEventListener(event_name, target_handler, options);\n\t\t});\n\t}\n}\n\n/**\n * @param {Array} events\n * @returns {void}\n */\nexport function delegate(events) {\n\tfor (var i = 0; i < events.length; i++) {\n\t\tall_registered_events.add(events[i]);\n\t}\n\n\tfor (var fn of root_event_handles) {\n\t\tfn(events);\n\t}\n}\n\n/**\n * @this {EventTarget}\n * @param {Event} event\n * @returns {void}\n */\nexport function handle_event_propagation(event) {\n\tvar handler_element = this;\n\tvar owner_document = /** @type {Node} */ (handler_element).ownerDocument;\n\tvar event_name = event.type;\n\tvar path = event.composedPath?.() || [];\n\tvar current_target = /** @type {null | Element} */ (path[0] || event.target);\n\n\t// composedPath contains list of nodes the event has propagated through.\n\t// We check __root to skip all nodes below it in case this is a\n\t// parent of the __root node, which indicates that there's nested\n\t// mounted apps. In this case we don't want to trigger events multiple times.\n\tvar path_idx = 0;\n\n\t// @ts-expect-error is added below\n\tvar handled_at = event.__root;\n\n\tif (handled_at) {\n\t\tvar at_idx = path.indexOf(handled_at);\n\t\tif (\n\t\t\tat_idx !== -1 &&\n\t\t\t(handler_element === document || handler_element === /** @type {any} */ (window))\n\t\t) {\n\t\t\t// This is the fallback document listener or a window listener, but the event was already handled\n\t\t\t// -> ignore, but set handle_at to document/window so that we're resetting the event\n\t\t\t// chain in case someone manually dispatches the same event object again.\n\t\t\t// @ts-expect-error\n\t\t\tevent.__root = handler_element;\n\t\t\treturn;\n\t\t}\n\n\t\t// We're deliberately not skipping if the index is higher, because\n\t\t// someone could create an event programmatically and emit it multiple times,\n\t\t// in which case we want to handle the whole propagation chain properly each time.\n\t\t// (this will only be a false negative if the event is dispatched multiple times and\n\t\t// the fallback document listener isn't reached in between, but that's super rare)\n\t\tvar handler_idx = path.indexOf(handler_element);\n\t\tif (handler_idx === -1) {\n\t\t\t// handle_idx can theoretically be -1 (happened in some JSDOM testing scenarios with an event listener on the window object)\n\t\t\t// so guard against that, too, and assume that everything was handled at this point.\n\t\t\treturn;\n\t\t}\n\n\t\tif (at_idx <= handler_idx) {\n\t\t\tpath_idx = at_idx;\n\t\t}\n\t}\n\n\tcurrent_target = /** @type {Element} */ (path[path_idx] || event.target);\n\t// there can only be one delegated event per element, and we either already handled the current target,\n\t// or this is the very first target in the chain which has a non-delegated listener, in which case it's safe\n\t// to handle a possible delegated event on it later (through the root delegation listener for example).\n\tif (current_target === handler_element) return;\n\n\t// Proxy currentTarget to correct target\n\tdefine_property(event, 'currentTarget', {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn current_target || owner_document;\n\t\t}\n\t});\n\n\t// This started because of Chromium issue https://chromestatus.com/feature/5128696823545856,\n\t// where removal or moving of of the DOM can cause sync `blur` events to fire, which can cause logic\n\t// to run inside the current `active_reaction`, which isn't what we want at all. However, on reflection,\n\t// it's probably best that all event handled by Svelte have this behaviour, as we don't really want\n\t// an event handler to run in the context of another reaction or effect.\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\n\ttry {\n\t\t/**\n\t\t * @type {unknown}\n\t\t */\n\t\tvar throw_error;\n\t\t/**\n\t\t * @type {unknown[]}\n\t\t */\n\t\tvar other_errors = [];\n\n\t\twhile (current_target !== null) {\n\t\t\t/** @type {null | Element} */\n\t\t\tvar parent_element =\n\t\t\t\tcurrent_target.assignedSlot ||\n\t\t\t\tcurrent_target.parentNode ||\n\t\t\t\t/** @type {any} */ (current_target).host ||\n\t\t\t\tnull;\n\n\t\t\ttry {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tvar delegated = current_target['__' + event_name];\n\n\t\t\t\tif (\n\t\t\t\t\tdelegated !== undefined &&\n\t\t\t\t\t(!(/** @type {any} */ (current_target).disabled) ||\n\t\t\t\t\t\t// DOM could've been updated already by the time this is reached, so we check this as well\n\t\t\t\t\t\t// -> the target could not have been disabled because it emits the event in the first place\n\t\t\t\t\t\tevent.target === current_target)\n\t\t\t\t) {\n\t\t\t\t\tif (is_array(delegated)) {\n\t\t\t\t\t\tvar [fn, ...data] = delegated;\n\t\t\t\t\t\tfn.apply(current_target, [event, ...data]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdelegated.call(current_target, event);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (throw_error) {\n\t\t\t\t\tother_errors.push(error);\n\t\t\t\t} else {\n\t\t\t\t\tthrow_error = error;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (event.cancelBubble || parent_element === handler_element || parent_element === null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcurrent_target = parent_element;\n\t\t}\n\n\t\tif (throw_error) {\n\t\t\tfor (let error of other_errors) {\n\t\t\t\t// Throw the rest of the errors, one-by-one on a microtask\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow throw_error;\n\t\t}\n\t} finally {\n\t\t// @ts-expect-error is used above\n\t\tevent.__root = handler_element;\n\t\t// @ts-ignore remove proxy on currentTarget\n\t\tdelete event.currentTarget;\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * In dev, warn if an event handler is not a function, as it means the\n * user probably called the handler or forgot to add a `() =>`\n * @param {() => (event: Event, ...args: any) => void} thunk\n * @param {EventTarget} element\n * @param {[Event, ...any]} args\n * @param {any} component\n * @param {[number, number]} [loc]\n * @param {boolean} [remove_parens]\n */\nexport function apply(\n\tthunk,\n\telement,\n\targs,\n\tcomponent,\n\tloc,\n\thas_side_effects = false,\n\tremove_parens = false\n) {\n\tlet handler;\n\tlet error;\n\n\ttry {\n\t\thandler = thunk();\n\t} catch (e) {\n\t\terror = e;\n\t}\n\n\tif (typeof handler === 'function') {\n\t\thandler.apply(element, args);\n\t} else if (has_side_effects || handler != null || error) {\n\t\tconst filename = component?.[FILENAME];\n\t\tconst location = loc ? ` at ${filename}:${loc[0]}:${loc[1]}` : ` in ${filename}`;\n\n\t\tconst event_name = args[0].type;\n\t\tconst description = `\\`${event_name}\\` handler${location}`;\n\t\tconst suggestion = remove_parens ? 'remove the trailing `()`' : 'add a leading `() =>`';\n\n\t\tw.event_handler_invalid(description, suggestion);\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n","/** @import { TemplateNode } from '#client' */\nimport { hydrate_node, hydrating, set_hydrate_node, set_hydrating } from '../hydration.js';\nimport { create_text, get_first_child, get_next_sibling } from '../operations.js';\nimport { block } from '../../reactivity/effects.js';\nimport { HEAD_EFFECT } from '../../constants.js';\nimport { HYDRATION_START } from '../../../../constants.js';\n\n/**\n * @type {Node | undefined}\n */\nlet head_anchor;\n\nexport function reset_head_anchor() {\n\thead_anchor = undefined;\n}\n\n/**\n * @param {(anchor: Node) => void} render_fn\n * @returns {void}\n */\nexport function head(render_fn) {\n\t// The head function may be called after the first hydration pass and ssr comment nodes may still be present,\n\t// therefore we need to skip that when we detect that we're not in hydration mode.\n\tlet previous_hydrate_node = null;\n\tlet was_hydrating = hydrating;\n\n\t/** @type {Comment | Text} */\n\tvar anchor;\n\n\tif (hydrating) {\n\t\tprevious_hydrate_node = hydrate_node;\n\n\t\t// There might be multiple head blocks in our app, so we need to account for each one needing independent hydration.\n\t\tif (head_anchor === undefined) {\n\t\t\thead_anchor = /** @type {TemplateNode} */ (get_first_child(document.head));\n\t\t}\n\n\t\twhile (\n\t\t\thead_anchor !== null &&\n\t\t\t(head_anchor.nodeType !== 8 || /** @type {Comment} */ (head_anchor).data !== HYDRATION_START)\n\t\t) {\n\t\t\thead_anchor = /** @type {TemplateNode} */ (get_next_sibling(head_anchor));\n\t\t}\n\n\t\t// If we can't find an opening hydration marker, skip hydration (this can happen\n\t\t// if a framework rendered body but not head content)\n\t\tif (head_anchor === null) {\n\t\t\tset_hydrating(false);\n\t\t} else {\n\t\t\thead_anchor = set_hydrate_node(/** @type {TemplateNode} */ (get_next_sibling(head_anchor)));\n\t\t}\n\t}\n\n\tif (!hydrating) {\n\t\tanchor = document.head.appendChild(create_text());\n\t}\n\n\ttry {\n\t\tblock(() => render_fn(anchor), HEAD_EFFECT);\n\t} finally {\n\t\tif (was_hydrating) {\n\t\t\tset_hydrating(true);\n\t\t\thead_anchor = hydrate_node; // so that next head block starts from the correct node\n\t\t\tset_hydrate_node(/** @type {TemplateNode} */ (previous_hydrate_node));\n\t\t}\n\t}\n}\n","/** @param {string} html */\nexport function create_fragment_from_html(html) {\n\tvar elem = document.createElement('template');\n\telem.innerHTML = html;\n\treturn elem.content;\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from './hydration.js';\nimport { create_text, get_first_child, is_firefox } from './operations.js';\nimport { create_fragment_from_html } from './reconciler.js';\nimport { active_effect } from '../runtime.js';\nimport { TEMPLATE_FRAGMENT, TEMPLATE_USE_IMPORT_NODE } from '../../../constants.js';\n\n/**\n * @param {TemplateNode} start\n * @param {TemplateNode | null} end\n */\nexport function assign_nodes(start, end) {\n\tvar effect = /** @type {Effect} */ (active_effect);\n\tif (effect.nodes_start === null) {\n\t\teffect.nodes_start = start;\n\t\teffect.nodes_end = end;\n\t}\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function template(content, flags) {\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;\n\n\t/** @type {Node} */\n\tvar node;\n\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('');\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (node === undefined) {\n\t\t\tnode = create_fragment_from_html(has_start ? content : '' + content);\n\t\t\tif (!is_fragment) node = /** @type {Node} */ (get_first_child(node));\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (\n\t\t\tuse_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)\n\t\t);\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function template_with_script(content, flags) {\n\tvar fn = template(content, flags);\n\treturn () => run_scripts(/** @type {Element | DocumentFragment} */ (fn()));\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @param {'svg' | 'math'} ns\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function ns_template(content, flags, ns = 'svg') {\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('');\n\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar wrapped = `<${ns}>${has_start ? content : '' + content}`;\n\n\t/** @type {Element | DocumentFragment} */\n\tvar node;\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (!node) {\n\t\t\tvar fragment = /** @type {DocumentFragment} */ (create_fragment_from_html(wrapped));\n\t\t\tvar root = /** @type {Element} */ (get_first_child(fragment));\n\n\t\t\tif (is_fragment) {\n\t\t\t\tnode = document.createDocumentFragment();\n\t\t\t\twhile (get_first_child(root)) {\n\t\t\t\t\tnode.appendChild(/** @type {Node} */ (get_first_child(root)));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode = /** @type {Element} */ (get_first_child(root));\n\t\t\t}\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (node.cloneNode(true));\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function svg_template_with_script(content, flags) {\n\tvar fn = ns_template(content, flags);\n\treturn () => run_scripts(/** @type {Element | DocumentFragment} */ (fn()));\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function mathml_template(content, flags) {\n\treturn ns_template(content, flags, 'math');\n}\n\n/**\n * Creating a document fragment from HTML that contains script tags will not execute\n * the scripts. We need to replace the script tags with new ones so that they are executed.\n * @param {Element | DocumentFragment} node\n * @returns {Node | Node[]}\n */\nfunction run_scripts(node) {\n\t// scripts were SSR'd, in which case they will run\n\tif (hydrating) return node;\n\n\tconst is_fragment = node.nodeType === 11;\n\tconst scripts =\n\t\t/** @type {HTMLElement} */ (node).tagName === 'SCRIPT'\n\t\t\t? [/** @type {HTMLScriptElement} */ (node)]\n\t\t\t: node.querySelectorAll('script');\n\tconst effect = /** @type {Effect} */ (active_effect);\n\n\tfor (const script of scripts) {\n\t\tconst clone = document.createElement('script');\n\t\tfor (var attribute of script.attributes) {\n\t\t\tclone.setAttribute(attribute.name, attribute.value);\n\t\t}\n\n\t\tclone.textContent = script.textContent;\n\n\t\t// The script has changed - if it's at the edges, the effect now points at dead nodes\n\t\tif (is_fragment ? node.firstChild === script : node === script) {\n\t\t\teffect.nodes_start = clone;\n\t\t}\n\t\tif (is_fragment ? node.lastChild === script : node === script) {\n\t\t\teffect.nodes_end = clone;\n\t\t}\n\n\t\tscript.replaceWith(clone);\n\t}\n\treturn node;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {any} value\n */\nexport function text(value = '') {\n\tif (!hydrating) {\n\t\tvar t = create_text(value + '');\n\t\tassign_nodes(t, t);\n\t\treturn t;\n\t}\n\n\tvar node = hydrate_node;\n\n\tif (node.nodeType !== 3) {\n\t\t// if an {expression} is empty during SSR, we need to insert an empty text node\n\t\tnode.before((node = create_text()));\n\t\tset_hydrate_node(node);\n\t}\n\n\tassign_nodes(node, node);\n\treturn node;\n}\n\nexport function comment() {\n\t// we're not delegating to `template` here for performance reasons\n\tif (hydrating) {\n\t\tassign_nodes(hydrate_node, null);\n\t\treturn hydrate_node;\n\t}\n\n\tvar frag = document.createDocumentFragment();\n\tvar start = document.createComment('');\n\tvar anchor = create_text();\n\tfrag.append(start, anchor);\n\n\tassign_nodes(start, anchor);\n\n\treturn frag;\n}\n\n/**\n * Assign the created (or in hydration mode, traversed) dom elements to the current block\n * and insert the elements into the dom (in client mode).\n * @param {Text | Comment | Element} anchor\n * @param {DocumentFragment | Element} dom\n */\nexport function append(anchor, dom) {\n\tif (hydrating) {\n\t\t/** @type {Effect} */ (active_effect).nodes_end = hydrate_node;\n\t\thydrate_next();\n\t\treturn;\n\t}\n\n\tif (anchor === null) {\n\t\t// edge case — void `` with content\n\t\treturn;\n\t}\n\n\tanchor.before(/** @type {Node} */ (dom));\n}\n\nlet uid = 1;\n\nexport function reset_props_id() {\n\tuid = 1;\n}\n\n/**\n * Create (or hydrate) an unique UID for the component instance.\n */\nexport function props_id() {\n\tif (\n\t\thydrating &&\n\t\thydrate_node &&\n\t\thydrate_node.nodeType === 8 &&\n\t\thydrate_node.textContent?.startsWith('#s')\n\t) {\n\t\tconst id = hydrate_node.textContent.substring(1);\n\t\thydrate_next();\n\t\treturn id;\n\t}\n\n\treturn 'c' + uid++;\n}\n","/** @import { ComponentContext, Effect, TemplateNode } from '#client' */\n/** @import { Component, ComponentType, SvelteComponent, MountOptions } from '../../index.js' */\nimport { DEV } from 'esm-env';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling,\n\tinit_operations\n} from './dom/operations.js';\nimport { HYDRATION_END, HYDRATION_ERROR, HYDRATION_START } from '../../constants.js';\nimport { active_effect } from './runtime.js';\nimport { push, pop, component_context } from './context.js';\nimport { component_root, branch } from './reactivity/effects.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tset_hydrate_node,\n\tset_hydrating\n} from './dom/hydration.js';\nimport { array_from } from '../shared/utils.js';\nimport {\n\tall_registered_events,\n\thandle_event_propagation,\n\troot_event_handles\n} from './dom/elements/events.js';\nimport { reset_head_anchor } from './dom/blocks/svelte-head.js';\nimport * as w from './warnings.js';\nimport * as e from './errors.js';\nimport { assign_nodes } from './dom/template.js';\nimport { is_passive_event } from '../../utils.js';\n\n/**\n * This is normally true — block effects should run their intro transitions —\n * but is false during hydration (unless `options.intro` is `true`) and\n * when creating the children of a `` that just changed tag\n */\nexport let should_intro = true;\n\n/** @param {boolean} value */\nexport function set_should_intro(value) {\n\tshould_intro = value;\n}\n\n/**\n * @param {Element} text\n * @param {string} value\n * @returns {void}\n */\nexport function set_text(text, value) {\n\t// For objects, we apply string coercion (which might make things like $state array references in the template reactive) before diffing\n\tvar str = value == null ? '' : typeof value === 'object' ? value + '' : value;\n\t// @ts-expect-error\n\tif (str !== (text.__t ??= text.nodeValue)) {\n\t\t// @ts-expect-error\n\t\ttext.__t = str;\n\t\ttext.nodeValue = str + '';\n\t}\n}\n\n/**\n * Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component.\n * Transitions will play during the initial render unless the `intro` option is set to `false`.\n *\n * @template {Record} Props\n * @template {Record} Exports\n * @param {ComponentType> | Component} component\n * @param {MountOptions} options\n * @returns {Exports}\n */\nexport function mount(component, options) {\n\treturn _mount(component, options);\n}\n\n/**\n * Hydrates a component on the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component\n *\n * @template {Record} Props\n * @template {Record} Exports\n * @param {ComponentType> | Component} component\n * @param {{} extends Props ? {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops?: Props;\n * \t\tevents?: Record any>;\n * \tcontext?: Map;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n * \t} : {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops: Props;\n * \t\tevents?: Record any>;\n * \tcontext?: Map;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n * \t}} options\n * @returns {Exports}\n */\nexport function hydrate(component, options) {\n\tinit_operations();\n\toptions.intro = options.intro ?? false;\n\tconst target = options.target;\n\tconst was_hydrating = hydrating;\n\tconst previous_hydrate_node = hydrate_node;\n\n\ttry {\n\t\tvar anchor = /** @type {TemplateNode} */ (get_first_child(target));\n\t\twhile (\n\t\t\tanchor &&\n\t\t\t(anchor.nodeType !== 8 || /** @type {Comment} */ (anchor).data !== HYDRATION_START)\n\t\t) {\n\t\t\tanchor = /** @type {TemplateNode} */ (get_next_sibling(anchor));\n\t\t}\n\n\t\tif (!anchor) {\n\t\t\tthrow HYDRATION_ERROR;\n\t\t}\n\n\t\tset_hydrating(true);\n\t\tset_hydrate_node(/** @type {Comment} */ (anchor));\n\t\thydrate_next();\n\n\t\tconst instance = _mount(component, { ...options, anchor });\n\n\t\tif (\n\t\t\thydrate_node === null ||\n\t\t\thydrate_node.nodeType !== 8 ||\n\t\t\t/** @type {Comment} */ (hydrate_node).data !== HYDRATION_END\n\t\t) {\n\t\t\tw.hydration_mismatch();\n\t\t\tthrow HYDRATION_ERROR;\n\t\t}\n\n\t\tset_hydrating(false);\n\n\t\treturn /** @type {Exports} */ (instance);\n\t} catch (error) {\n\t\tif (error === HYDRATION_ERROR) {\n\t\t\tif (options.recover === false) {\n\t\t\t\te.hydration_failed();\n\t\t\t}\n\n\t\t\t// If an error occured above, the operations might not yet have been initialised.\n\t\t\tinit_operations();\n\t\t\tclear_text_content(target);\n\n\t\t\tset_hydrating(false);\n\t\t\treturn mount(component, options);\n\t\t}\n\n\t\tthrow error;\n\t} finally {\n\t\tset_hydrating(was_hydrating);\n\t\tset_hydrate_node(previous_hydrate_node);\n\t\treset_head_anchor();\n\t}\n}\n\n/** @type {Map} */\nconst document_listeners = new Map();\n\n/**\n * @template {Record} Exports\n * @param {ComponentType> | Component} Component\n * @param {MountOptions} options\n * @returns {Exports}\n */\nfunction _mount(Component, { target, anchor, props = {}, events, context, intro = true }) {\n\tinit_operations();\n\n\tvar registered_events = new Set();\n\n\t/** @param {Array} events */\n\tvar event_handle = (events) => {\n\t\tfor (var i = 0; i < events.length; i++) {\n\t\t\tvar event_name = events[i];\n\n\t\t\tif (registered_events.has(event_name)) continue;\n\t\t\tregistered_events.add(event_name);\n\n\t\t\tvar passive = is_passive_event(event_name);\n\n\t\t\t// Add the event listener to both the container and the document.\n\t\t\t// The container listener ensures we catch events from within in case\n\t\t\t// the outer content stops propagation of the event.\n\t\t\ttarget.addEventListener(event_name, handle_event_propagation, { passive });\n\n\t\t\tvar n = document_listeners.get(event_name);\n\n\t\t\tif (n === undefined) {\n\t\t\t\t// The document listener ensures we catch events that originate from elements that were\n\t\t\t\t// manually moved outside of the container (e.g. via manual portals).\n\t\t\t\tdocument.addEventListener(event_name, handle_event_propagation, { passive });\n\t\t\t\tdocument_listeners.set(event_name, 1);\n\t\t\t} else {\n\t\t\t\tdocument_listeners.set(event_name, n + 1);\n\t\t\t}\n\t\t}\n\t};\n\n\tevent_handle(array_from(all_registered_events));\n\troot_event_handles.add(event_handle);\n\n\t/** @type {Exports} */\n\t// @ts-expect-error will be defined because the render effect runs synchronously\n\tvar component = undefined;\n\n\tvar unmount = component_root(() => {\n\t\tvar anchor_node = anchor ?? target.appendChild(create_text());\n\n\t\tbranch(() => {\n\t\t\tif (context) {\n\t\t\t\tpush({});\n\t\t\t\tvar ctx = /** @type {ComponentContext} */ (component_context);\n\t\t\t\tctx.c = context;\n\t\t\t}\n\n\t\t\tif (events) {\n\t\t\t\t// We can't spread the object or else we'd lose the state proxy stuff, if it is one\n\t\t\t\t/** @type {any} */ (props).$$events = events;\n\t\t\t}\n\n\t\t\tif (hydrating) {\n\t\t\t\tassign_nodes(/** @type {TemplateNode} */ (anchor_node), null);\n\t\t\t}\n\n\t\t\tshould_intro = intro;\n\t\t\t// @ts-expect-error the public typings are not what the actual function looks like\n\t\t\tcomponent = Component(anchor_node, props) || {};\n\t\t\tshould_intro = true;\n\n\t\t\tif (hydrating) {\n\t\t\t\t/** @type {Effect} */ (active_effect).nodes_end = hydrate_node;\n\t\t\t}\n\n\t\t\tif (context) {\n\t\t\t\tpop();\n\t\t\t}\n\t\t});\n\n\t\treturn () => {\n\t\t\tfor (var event_name of registered_events) {\n\t\t\t\ttarget.removeEventListener(event_name, handle_event_propagation);\n\n\t\t\t\tvar n = /** @type {number} */ (document_listeners.get(event_name));\n\n\t\t\t\tif (--n === 0) {\n\t\t\t\t\tdocument.removeEventListener(event_name, handle_event_propagation);\n\t\t\t\t\tdocument_listeners.delete(event_name);\n\t\t\t\t} else {\n\t\t\t\t\tdocument_listeners.set(event_name, n);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\troot_event_handles.delete(event_handle);\n\n\t\t\tif (anchor_node !== anchor) {\n\t\t\t\tanchor_node.parentNode?.removeChild(anchor_node);\n\t\t\t}\n\t\t};\n\t});\n\n\tmounted_components.set(component, unmount);\n\treturn component;\n}\n\n/**\n * References of the components that were mounted or hydrated.\n * Uses a `WeakMap` to avoid memory leaks.\n */\nlet mounted_components = new WeakMap();\n\n/**\n * Unmounts a component that was previously mounted using `mount` or `hydrate`.\n *\n * Since 5.13.0, if `options.outro` is `true`, [transitions](https://svelte.dev/docs/svelte/transition) will play before the component is removed from the DOM.\n *\n * Returns a `Promise` that resolves after transitions have completed if `options.outro` is true, or immediately otherwise (prior to 5.13.0, returns `void`).\n *\n * ```js\n * import { mount, unmount } from 'svelte';\n * import App from './App.svelte';\n *\n * const app = mount(App, { target: document.body });\n *\n * // later...\n * unmount(app, { outro: true });\n * ```\n * @param {Record} component\n * @param {{ outro?: boolean }} [options]\n * @returns {Promise}\n */\nexport function unmount(component, options) {\n\tconst fn = mounted_components.get(component);\n\n\tif (fn) {\n\t\tmounted_components.delete(component);\n\t\treturn fn(options);\n\t}\n\n\tif (DEV) {\n\t\tw.lifecycle_double_unmount();\n\t}\n\n\treturn Promise.resolve();\n}\n","/** @import { Effect, Source, TemplateNode } from '#client' */\nimport { DEV } from 'esm-env';\nimport { is_promise } from '../../../shared/utils.js';\nimport { block, branch, pause_effect, resume_effect } from '../../reactivity/effects.js';\nimport { internal_set, mutable_source, source } from '../../reactivity/sources.js';\nimport { flushSync, set_active_effect, set_active_reaction } from '../../runtime.js';\nimport { hydrate_next, hydrate_node, hydrating } from '../hydration.js';\nimport { queue_micro_task } from '../task.js';\nimport { UNINITIALIZED } from '../../../../constants.js';\nimport {\n\tcomponent_context,\n\tis_runes,\n\tset_component_context,\n\tset_dev_current_component_function\n} from '../../context.js';\n\nconst PENDING = 0;\nconst THEN = 1;\nconst CATCH = 2;\n\n/**\n * @template V\n * @param {TemplateNode} node\n * @param {(() => Promise)} get_input\n * @param {null | ((anchor: Node) => void)} pending_fn\n * @param {null | ((anchor: Node, value: Source) => void)} then_fn\n * @param {null | ((anchor: Node, error: unknown) => void)} catch_fn\n * @returns {void}\n */\nexport function await_block(node, get_input, pending_fn, then_fn, catch_fn) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar anchor = node;\n\tvar runes = is_runes();\n\tvar active_component_context = component_context;\n\n\t/** @type {any} */\n\tvar component_function = DEV ? component_context?.function : null;\n\n\t/** @type {V | Promise | typeof UNINITIALIZED} */\n\tvar input = UNINITIALIZED;\n\n\t/** @type {Effect | null} */\n\tvar pending_effect;\n\n\t/** @type {Effect | null} */\n\tvar then_effect;\n\n\t/** @type {Effect | null} */\n\tvar catch_effect;\n\n\tvar input_source = (runes ? source : mutable_source)(/** @type {V} */ (undefined));\n\tvar error_source = (runes ? source : mutable_source)(undefined);\n\tvar resolved = false;\n\n\t/**\n\t * @param {PENDING | THEN | CATCH} state\n\t * @param {boolean} restore\n\t */\n\tfunction update(state, restore) {\n\t\tresolved = true;\n\n\t\tif (restore) {\n\t\t\tset_active_effect(effect);\n\t\t\tset_active_reaction(effect); // TODO do we need both?\n\t\t\tset_component_context(active_component_context);\n\t\t\tif (DEV) set_dev_current_component_function(component_function);\n\t\t}\n\n\t\ttry {\n\t\t\tif (state === PENDING && pending_fn) {\n\t\t\t\tif (pending_effect) resume_effect(pending_effect);\n\t\t\t\telse pending_effect = branch(() => pending_fn(anchor));\n\t\t\t}\n\n\t\t\tif (state === THEN && then_fn) {\n\t\t\t\tif (then_effect) resume_effect(then_effect);\n\t\t\t\telse then_effect = branch(() => then_fn(anchor, input_source));\n\t\t\t}\n\n\t\t\tif (state === CATCH && catch_fn) {\n\t\t\t\tif (catch_effect) resume_effect(catch_effect);\n\t\t\t\telse catch_effect = branch(() => catch_fn(anchor, error_source));\n\t\t\t}\n\n\t\t\tif (state !== PENDING && pending_effect) {\n\t\t\t\tpause_effect(pending_effect, () => (pending_effect = null));\n\t\t\t}\n\n\t\t\tif (state !== THEN && then_effect) {\n\t\t\t\tpause_effect(then_effect, () => (then_effect = null));\n\t\t\t}\n\n\t\t\tif (state !== CATCH && catch_effect) {\n\t\t\t\tpause_effect(catch_effect, () => (catch_effect = null));\n\t\t\t}\n\t\t} finally {\n\t\t\tif (restore) {\n\t\t\t\tif (DEV) set_dev_current_component_function(null);\n\t\t\t\tset_component_context(null);\n\t\t\t\tset_active_reaction(null);\n\t\t\t\tset_active_effect(null);\n\n\t\t\t\t// without this, the DOM does not update until two ticks after the promise\n\t\t\t\t// resolves, which is unexpected behaviour (and somewhat irksome to test)\n\t\t\t\tflushSync();\n\t\t\t}\n\t\t}\n\t}\n\n\tvar effect = block(() => {\n\t\tif (input === (input = get_input())) return;\n\n\t\tif (is_promise(input)) {\n\t\t\tvar promise = input;\n\n\t\t\tresolved = false;\n\n\t\t\tpromise.then(\n\t\t\t\t(value) => {\n\t\t\t\t\tif (promise !== input) return;\n\t\t\t\t\t// we technically could use `set` here since it's on the next microtick\n\t\t\t\t\t// but let's use internal_set for consistency and just to be safe\n\t\t\t\t\tinternal_set(input_source, value);\n\t\t\t\t\tupdate(THEN, true);\n\t\t\t\t},\n\t\t\t\t(error) => {\n\t\t\t\t\tif (promise !== input) return;\n\t\t\t\t\t// we technically could use `set` here since it's on the next microtick\n\t\t\t\t\t// but let's use internal_set for consistency and just to be safe\n\t\t\t\t\tinternal_set(error_source, error);\n\t\t\t\t\tupdate(CATCH, true);\n\t\t\t\t\tif (!catch_fn) {\n\t\t\t\t\t\t// Rethrow the error if no catch block exists\n\t\t\t\t\t\tthrow error_source.v;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif (hydrating) {\n\t\t\t\tif (pending_fn) {\n\t\t\t\t\tpending_effect = branch(() => pending_fn(anchor));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Wait a microtask before checking if we should show the pending state as\n\t\t\t\t// the promise might have resolved by the next microtask.\n\t\t\t\tqueue_micro_task(() => {\n\t\t\t\t\tif (!resolved) update(PENDING, true);\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tinternal_set(input_source, input);\n\t\t\tupdate(THEN, false);\n\t\t}\n\n\t\t// Set the input to something else, in order to disable the promise callbacks\n\t\treturn () => (input = UNINITIALIZED);\n\t});\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { EFFECT_TRANSPARENT } from '../../constants.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tremove_nodes,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport { block, branch, pause_effect, resume_effect } from '../../reactivity/effects.js';\nimport { HYDRATION_START_ELSE, UNINITIALIZED } from '../../../../constants.js';\n\n/**\n * @param {TemplateNode} node\n * @param {(branch: (fn: (anchor: Node) => void, flag?: boolean) => void) => void} fn\n * @param {boolean} [elseif] True if this is an `{:else if ...}` block rather than an `{#if ...}`, as that affects which transitions are considered 'local'\n * @returns {void}\n */\nexport function if_block(node, fn, elseif = false) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar anchor = node;\n\n\t/** @type {Effect | null} */\n\tvar consequent_effect = null;\n\n\t/** @type {Effect | null} */\n\tvar alternate_effect = null;\n\n\t/** @type {UNINITIALIZED | boolean | null} */\n\tvar condition = UNINITIALIZED;\n\n\tvar flags = elseif ? EFFECT_TRANSPARENT : 0;\n\n\tvar has_branch = false;\n\n\tconst set_branch = (/** @type {(anchor: Node) => void} */ fn, flag = true) => {\n\t\thas_branch = true;\n\t\tupdate_branch(flag, fn);\n\t};\n\n\tconst update_branch = (\n\t\t/** @type {boolean | null} */ new_condition,\n\t\t/** @type {null | ((anchor: Node) => void)} */ fn\n\t) => {\n\t\tif (condition === (condition = new_condition)) return;\n\n\t\t/** Whether or not there was a hydration mismatch. Needs to be a `let` or else it isn't treeshaken out */\n\t\tlet mismatch = false;\n\n\t\tif (hydrating) {\n\t\t\tconst is_else = /** @type {Comment} */ (anchor).data === HYDRATION_START_ELSE;\n\n\t\t\tif (!!condition === is_else) {\n\t\t\t\t// Hydration mismatch: remove everything inside the anchor and start fresh.\n\t\t\t\t// This could happen with `{#if browser}...{/if}`, for example\n\t\t\t\tanchor = remove_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tset_hydrating(false);\n\t\t\t\tmismatch = true;\n\t\t\t}\n\t\t}\n\n\t\tif (condition) {\n\t\t\tif (consequent_effect) {\n\t\t\t\tresume_effect(consequent_effect);\n\t\t\t} else if (fn) {\n\t\t\t\tconsequent_effect = branch(() => fn(anchor));\n\t\t\t}\n\n\t\t\tif (alternate_effect) {\n\t\t\t\tpause_effect(alternate_effect, () => {\n\t\t\t\t\talternate_effect = null;\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tif (alternate_effect) {\n\t\t\t\tresume_effect(alternate_effect);\n\t\t\t} else if (fn) {\n\t\t\t\talternate_effect = branch(() => fn(anchor));\n\t\t\t}\n\n\t\t\tif (consequent_effect) {\n\t\t\t\tpause_effect(consequent_effect, () => {\n\t\t\t\t\tconsequent_effect = null;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (mismatch) {\n\t\t\t// continue in hydration mode\n\t\t\tset_hydrating(true);\n\t\t}\n\t};\n\n\tblock(() => {\n\t\thas_branch = false;\n\t\tfn(set_branch);\n\t\tif (!has_branch) {\n\t\t\tupdate_branch(null, null);\n\t\t}\n\t}, flags);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { UNINITIALIZED } from '../../../../constants.js';\nimport { block, branch, pause_effect } from '../../reactivity/effects.js';\nimport { not_equal, safe_not_equal } from '../../reactivity/equality.js';\nimport { is_runes } from '../../context.js';\nimport { hydrate_next, hydrate_node, hydrating } from '../hydration.js';\n\n/**\n * @template V\n * @param {TemplateNode} node\n * @param {() => V} get_key\n * @param {(anchor: Node) => TemplateNode | void} render_fn\n * @returns {void}\n */\nexport function key_block(node, get_key, render_fn) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar anchor = node;\n\n\t/** @type {V | typeof UNINITIALIZED} */\n\tvar key = UNINITIALIZED;\n\n\t/** @type {Effect} */\n\tvar effect;\n\n\tvar changed = is_runes() ? not_equal : safe_not_equal;\n\n\tblock(() => {\n\t\tif (changed(key, (key = get_key()))) {\n\t\t\tif (effect) {\n\t\t\t\tpause_effect(effect);\n\t\t\t}\n\n\t\t\teffect = branch(() => render_fn(anchor));\n\t\t}\n\t});\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n","/** @import { EachItem, EachState, Effect, MaybeSource, Source, TemplateNode, TransitionManager, Value } from '#client' */\nimport {\n\tEACH_INDEX_REACTIVE,\n\tEACH_IS_ANIMATED,\n\tEACH_IS_CONTROLLED,\n\tEACH_ITEM_IMMUTABLE,\n\tEACH_ITEM_REACTIVE,\n\tHYDRATION_END,\n\tHYDRATION_START_ELSE\n} from '../../../../constants.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tremove_nodes,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling\n} from '../operations.js';\nimport {\n\tblock,\n\tbranch,\n\tdestroy_effect,\n\trun_out_transitions,\n\tpause_children,\n\tpause_effect,\n\tresume_effect\n} from '../../reactivity/effects.js';\nimport { source, mutable_source, internal_set } from '../../reactivity/sources.js';\nimport { array_from, is_array } from '../../../shared/utils.js';\nimport { INERT } from '../../constants.js';\nimport { queue_micro_task } from '../task.js';\nimport { active_effect, active_reaction, get } from '../../runtime.js';\nimport { DEV } from 'esm-env';\nimport { derived_safe_equal } from '../../reactivity/deriveds.js';\n\n/**\n * The row of a keyed each block that is currently updating. We track this\n * so that `animate:` directives have something to attach themselves to\n * @type {EachItem | null}\n */\nexport let current_each_item = null;\n\n/** @param {EachItem | null} item */\nexport function set_current_each_item(item) {\n\tcurrent_each_item = item;\n}\n\n/**\n * @param {any} _\n * @param {number} i\n */\nexport function index(_, i) {\n\treturn i;\n}\n\n/**\n * Pause multiple effects simultaneously, and coordinate their\n * subsequent destruction. Used in each blocks\n * @param {EachState} state\n * @param {EachItem[]} items\n * @param {null | Node} controlled_anchor\n * @param {Map} items_map\n */\nfunction pause_effects(state, items, controlled_anchor, items_map) {\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\tvar length = items.length;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tpause_children(items[i].e, transitions, true);\n\t}\n\n\tvar is_controlled = length > 0 && transitions.length === 0 && controlled_anchor !== null;\n\t// If we have a controlled anchor, it means that the each block is inside a single\n\t// DOM element, so we can apply a fast-path for clearing the contents of the element.\n\tif (is_controlled) {\n\t\tvar parent_node = /** @type {Element} */ (\n\t\t\t/** @type {Element} */ (controlled_anchor).parentNode\n\t\t);\n\t\tclear_text_content(parent_node);\n\t\tparent_node.append(/** @type {Element} */ (controlled_anchor));\n\t\titems_map.clear();\n\t\tlink(state, items[0].prev, items[length - 1].next);\n\t}\n\n\trun_out_transitions(transitions, () => {\n\t\tfor (var i = 0; i < length; i++) {\n\t\t\tvar item = items[i];\n\t\t\tif (!is_controlled) {\n\t\t\t\titems_map.delete(item.k);\n\t\t\t\tlink(state, item.prev, item.next);\n\t\t\t}\n\t\t\tdestroy_effect(item.e, !is_controlled);\n\t\t}\n\t});\n}\n\n/**\n * @template V\n * @param {Element | Comment} node The next sibling node, or the parent node if this is a 'controlled' block\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @param {(value: V, index: number) => any} get_key\n * @param {(anchor: Node, item: MaybeSource, index: MaybeSource) => void} render_fn\n * @param {null | ((anchor: Node) => void)} fallback_fn\n * @returns {void}\n */\nexport function each(node, flags, get_collection, get_key, render_fn, fallback_fn = null) {\n\tvar anchor = node;\n\n\t/** @type {EachState} */\n\tvar state = { flags, items: new Map(), first: null };\n\n\tvar is_controlled = (flags & EACH_IS_CONTROLLED) !== 0;\n\n\tif (is_controlled) {\n\t\tvar parent_node = /** @type {Element} */ (node);\n\n\t\tanchor = hydrating\n\t\t\t? set_hydrate_node(/** @type {Comment | Text} */ (get_first_child(parent_node)))\n\t\t\t: parent_node.appendChild(create_text());\n\t}\n\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\t/** @type {Effect | null} */\n\tvar fallback = null;\n\n\tvar was_empty = false;\n\n\t// TODO: ideally we could use derived for runes mode but because of the ability\n\t// to use a store which can be mutated, we can't do that here as mutating a store\n\t// will still result in the collection array being the same from the store\n\tvar each_array = derived_safe_equal(() => {\n\t\tvar collection = get_collection();\n\n\t\treturn is_array(collection) ? collection : collection == null ? [] : array_from(collection);\n\t});\n\n\tblock(() => {\n\t\tvar array = get(each_array);\n\t\tvar length = array.length;\n\n\t\tif (was_empty && length === 0) {\n\t\t\t// ignore updates if the array is empty,\n\t\t\t// and it already was empty on previous run\n\t\t\treturn;\n\t\t}\n\t\twas_empty = length === 0;\n\n\t\t/** `true` if there was a hydration mismatch. Needs to be a `let` or else it isn't treeshaken out */\n\t\tlet mismatch = false;\n\n\t\tif (hydrating) {\n\t\t\tvar is_else = /** @type {Comment} */ (anchor).data === HYDRATION_START_ELSE;\n\n\t\t\tif (is_else !== (length === 0)) {\n\t\t\t\t// hydration mismatch — remove the server-rendered DOM and start over\n\t\t\t\tanchor = remove_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tset_hydrating(false);\n\t\t\t\tmismatch = true;\n\t\t\t}\n\t\t}\n\n\t\t// this is separate to the previous block because `hydrating` might change\n\t\tif (hydrating) {\n\t\t\t/** @type {EachItem | null} */\n\t\t\tvar prev = null;\n\n\t\t\t/** @type {EachItem} */\n\t\t\tvar item;\n\n\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\tif (\n\t\t\t\t\thydrate_node.nodeType === 8 &&\n\t\t\t\t\t/** @type {Comment} */ (hydrate_node).data === HYDRATION_END\n\t\t\t\t) {\n\t\t\t\t\t// The server rendered fewer items than expected,\n\t\t\t\t\t// so break out and continue appending non-hydrated items\n\t\t\t\t\tanchor = /** @type {Comment} */ (hydrate_node);\n\t\t\t\t\tmismatch = true;\n\t\t\t\t\tset_hydrating(false);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tvar value = array[i];\n\t\t\t\tvar key = get_key(value, i);\n\t\t\t\titem = create_item(\n\t\t\t\t\thydrate_node,\n\t\t\t\t\tstate,\n\t\t\t\t\tprev,\n\t\t\t\t\tnull,\n\t\t\t\t\tvalue,\n\t\t\t\t\tkey,\n\t\t\t\t\ti,\n\t\t\t\t\trender_fn,\n\t\t\t\t\tflags,\n\t\t\t\t\tget_collection\n\t\t\t\t);\n\t\t\t\tstate.items.set(key, item);\n\n\t\t\t\tprev = item;\n\t\t\t}\n\n\t\t\t// remove excess nodes\n\t\t\tif (length > 0) {\n\t\t\t\tset_hydrate_node(remove_nodes());\n\t\t\t}\n\t\t}\n\n\t\tif (!hydrating) {\n\t\t\treconcile(array, state, anchor, render_fn, flags, get_key, get_collection);\n\t\t}\n\n\t\tif (fallback_fn !== null) {\n\t\t\tif (length === 0) {\n\t\t\t\tif (fallback) {\n\t\t\t\t\tresume_effect(fallback);\n\t\t\t\t} else {\n\t\t\t\t\tfallback = branch(() => fallback_fn(anchor));\n\t\t\t\t}\n\t\t\t} else if (fallback !== null) {\n\t\t\t\tpause_effect(fallback, () => {\n\t\t\t\t\tfallback = null;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (mismatch) {\n\t\t\t// continue in hydration mode\n\t\t\tset_hydrating(true);\n\t\t}\n\n\t\t// When we mount the each block for the first time, the collection won't be\n\t\t// connected to this effect as the effect hasn't finished running yet and its deps\n\t\t// won't be assigned. However, it's possible that when reconciling the each block\n\t\t// that a mutation occurred and it's made the collection MAYBE_DIRTY, so reading the\n\t\t// collection again can provide consistency to the reactive graph again as the deriveds\n\t\t// will now be `CLEAN`.\n\t\tget(each_array);\n\t});\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n\n/**\n * Add, remove, or reorder items output by an each block as its input changes\n * @template V\n * @param {Array} array\n * @param {EachState} state\n * @param {Element | Comment | Text} anchor\n * @param {(anchor: Node, item: MaybeSource, index: number | Source, collection: () => V[]) => void} render_fn\n * @param {number} flags\n * @param {(value: V, index: number) => any} get_key\n * @param {() => V[]} get_collection\n * @returns {void}\n */\nfunction reconcile(array, state, anchor, render_fn, flags, get_key, get_collection) {\n\tvar is_animated = (flags & EACH_IS_ANIMATED) !== 0;\n\tvar should_update = (flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0;\n\n\tvar length = array.length;\n\tvar items = state.items;\n\tvar first = state.first;\n\tvar current = first;\n\n\t/** @type {undefined | Set} */\n\tvar seen;\n\n\t/** @type {EachItem | null} */\n\tvar prev = null;\n\n\t/** @type {undefined | Set} */\n\tvar to_animate;\n\n\t/** @type {EachItem[]} */\n\tvar matched = [];\n\n\t/** @type {EachItem[]} */\n\tvar stashed = [];\n\n\t/** @type {V} */\n\tvar value;\n\n\t/** @type {any} */\n\tvar key;\n\n\t/** @type {EachItem | undefined} */\n\tvar item;\n\n\t/** @type {number} */\n\tvar i;\n\n\tif (is_animated) {\n\t\tfor (i = 0; i < length; i += 1) {\n\t\t\tvalue = array[i];\n\t\t\tkey = get_key(value, i);\n\t\t\titem = items.get(key);\n\n\t\t\tif (item !== undefined) {\n\t\t\t\titem.a?.measure();\n\t\t\t\t(to_animate ??= new Set()).add(item);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (i = 0; i < length; i += 1) {\n\t\tvalue = array[i];\n\t\tkey = get_key(value, i);\n\t\titem = items.get(key);\n\n\t\tif (item === undefined) {\n\t\t\tvar child_anchor = current ? /** @type {TemplateNode} */ (current.e.nodes_start) : anchor;\n\n\t\t\tprev = create_item(\n\t\t\t\tchild_anchor,\n\t\t\t\tstate,\n\t\t\t\tprev,\n\t\t\t\tprev === null ? state.first : prev.next,\n\t\t\t\tvalue,\n\t\t\t\tkey,\n\t\t\t\ti,\n\t\t\t\trender_fn,\n\t\t\t\tflags,\n\t\t\t\tget_collection\n\t\t\t);\n\n\t\t\titems.set(key, prev);\n\n\t\t\tmatched = [];\n\t\t\tstashed = [];\n\n\t\t\tcurrent = prev.next;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (should_update) {\n\t\t\tupdate_item(item, value, i, flags);\n\t\t}\n\n\t\tif ((item.e.f & INERT) !== 0) {\n\t\t\tresume_effect(item.e);\n\t\t\tif (is_animated) {\n\t\t\t\titem.a?.unfix();\n\t\t\t\t(to_animate ??= new Set()).delete(item);\n\t\t\t}\n\t\t}\n\n\t\tif (item !== current) {\n\t\t\tif (seen !== undefined && seen.has(item)) {\n\t\t\t\tif (matched.length < stashed.length) {\n\t\t\t\t\t// more efficient to move later items to the front\n\t\t\t\t\tvar start = stashed[0];\n\t\t\t\t\tvar j;\n\n\t\t\t\t\tprev = start.prev;\n\n\t\t\t\t\tvar a = matched[0];\n\t\t\t\t\tvar b = matched[matched.length - 1];\n\n\t\t\t\t\tfor (j = 0; j < matched.length; j += 1) {\n\t\t\t\t\t\tmove(matched[j], start, anchor);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (j = 0; j < stashed.length; j += 1) {\n\t\t\t\t\t\tseen.delete(stashed[j]);\n\t\t\t\t\t}\n\n\t\t\t\t\tlink(state, a.prev, b.next);\n\t\t\t\t\tlink(state, prev, a);\n\t\t\t\t\tlink(state, b, start);\n\n\t\t\t\t\tcurrent = start;\n\t\t\t\t\tprev = b;\n\t\t\t\t\ti -= 1;\n\n\t\t\t\t\tmatched = [];\n\t\t\t\t\tstashed = [];\n\t\t\t\t} else {\n\t\t\t\t\t// more efficient to move earlier items to the back\n\t\t\t\t\tseen.delete(item);\n\t\t\t\t\tmove(item, current, anchor);\n\n\t\t\t\t\tlink(state, item.prev, item.next);\n\t\t\t\t\tlink(state, item, prev === null ? state.first : prev.next);\n\t\t\t\t\tlink(state, prev, item);\n\n\t\t\t\t\tprev = item;\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tmatched = [];\n\t\t\tstashed = [];\n\n\t\t\twhile (current !== null && current.k !== key) {\n\t\t\t\t// If the each block isn't inert and an item has an effect that is already inert,\n\t\t\t\t// skip over adding it to our seen Set as the item is already being handled\n\t\t\t\tif ((current.e.f & INERT) === 0) {\n\t\t\t\t\t(seen ??= new Set()).add(current);\n\t\t\t\t}\n\t\t\t\tstashed.push(current);\n\t\t\t\tcurrent = current.next;\n\t\t\t}\n\n\t\t\tif (current === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\titem = current;\n\t\t}\n\n\t\tmatched.push(item);\n\t\tprev = item;\n\t\tcurrent = item.next;\n\t}\n\n\tif (current !== null || seen !== undefined) {\n\t\tvar to_destroy = seen === undefined ? [] : array_from(seen);\n\n\t\twhile (current !== null) {\n\t\t\t// If the each block isn't inert, then inert effects are currently outroing and will be removed once the transition is finished\n\t\t\tif ((current.e.f & INERT) === 0) {\n\t\t\t\tto_destroy.push(current);\n\t\t\t}\n\t\t\tcurrent = current.next;\n\t\t}\n\n\t\tvar destroy_length = to_destroy.length;\n\n\t\tif (destroy_length > 0) {\n\t\t\tvar controlled_anchor = (flags & EACH_IS_CONTROLLED) !== 0 && length === 0 ? anchor : null;\n\n\t\t\tif (is_animated) {\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].a?.measure();\n\t\t\t\t}\n\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].a?.fix();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpause_effects(state, to_destroy, controlled_anchor, items);\n\t\t}\n\t}\n\n\tif (is_animated) {\n\t\tqueue_micro_task(() => {\n\t\t\tif (to_animate === undefined) return;\n\t\t\tfor (item of to_animate) {\n\t\t\t\titem.a?.apply();\n\t\t\t}\n\t\t});\n\t}\n\n\t/** @type {Effect} */ (active_effect).first = state.first && state.first.e;\n\t/** @type {Effect} */ (active_effect).last = prev && prev.e;\n}\n\n/**\n * @param {EachItem} item\n * @param {any} value\n * @param {number} index\n * @param {number} type\n * @returns {void}\n */\nfunction update_item(item, value, index, type) {\n\tif ((type & EACH_ITEM_REACTIVE) !== 0) {\n\t\tinternal_set(item.v, value);\n\t}\n\n\tif ((type & EACH_INDEX_REACTIVE) !== 0) {\n\t\tinternal_set(/** @type {Value} */ (item.i), index);\n\t} else {\n\t\titem.i = index;\n\t}\n}\n\n/**\n * @template V\n * @param {Node} anchor\n * @param {EachState} state\n * @param {EachItem | null} prev\n * @param {EachItem | null} next\n * @param {V} value\n * @param {unknown} key\n * @param {number} index\n * @param {(anchor: Node, item: V | Source, index: number | Value, collection: () => V[]) => void} render_fn\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @returns {EachItem}\n */\nfunction create_item(\n\tanchor,\n\tstate,\n\tprev,\n\tnext,\n\tvalue,\n\tkey,\n\tindex,\n\trender_fn,\n\tflags,\n\tget_collection\n) {\n\tvar previous_each_item = current_each_item;\n\tvar reactive = (flags & EACH_ITEM_REACTIVE) !== 0;\n\tvar mutable = (flags & EACH_ITEM_IMMUTABLE) === 0;\n\n\tvar v = reactive ? (mutable ? mutable_source(value) : source(value)) : value;\n\tvar i = (flags & EACH_INDEX_REACTIVE) === 0 ? index : source(index);\n\n\tif (DEV && reactive) {\n\t\t// For tracing purposes, we need to link the source signal we create with the\n\t\t// collection + index so that tracing works as intended\n\t\t/** @type {Value} */ (v).debug = () => {\n\t\t\tvar collection_index = typeof i === 'number' ? index : i.v;\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-expressions\n\t\t\tget_collection()[collection_index];\n\t\t};\n\t}\n\n\t/** @type {EachItem} */\n\tvar item = {\n\t\ti,\n\t\tv,\n\t\tk: key,\n\t\ta: null,\n\t\t// @ts-expect-error\n\t\te: null,\n\t\tprev,\n\t\tnext\n\t};\n\n\tcurrent_each_item = item;\n\n\ttry {\n\t\titem.e = branch(() => render_fn(anchor, v, i, get_collection), hydrating);\n\n\t\titem.e.prev = prev && prev.e;\n\t\titem.e.next = next && next.e;\n\n\t\tif (prev === null) {\n\t\t\tstate.first = item;\n\t\t} else {\n\t\t\tprev.next = item;\n\t\t\tprev.e.next = item.e;\n\t\t}\n\n\t\tif (next !== null) {\n\t\t\tnext.prev = item;\n\t\t\tnext.e.prev = item.e;\n\t\t}\n\n\t\treturn item;\n\t} finally {\n\t\tcurrent_each_item = previous_each_item;\n\t}\n}\n\n/**\n * @param {EachItem} item\n * @param {EachItem | null} next\n * @param {Text | Element | Comment} anchor\n */\nfunction move(item, next, anchor) {\n\tvar end = item.next ? /** @type {TemplateNode} */ (item.next.e.nodes_start) : anchor;\n\n\tvar dest = next ? /** @type {TemplateNode} */ (next.e.nodes_start) : anchor;\n\tvar node = /** @type {TemplateNode} */ (item.e.nodes_start);\n\n\twhile (node !== end) {\n\t\tvar next_node = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\tdest.before(node);\n\t\tnode = next_node;\n\t}\n}\n\n/**\n * @param {EachState} state\n * @param {EachItem | null} prev\n * @param {EachItem | null} next\n */\nfunction link(state, prev, next) {\n\tif (prev === null) {\n\t\tstate.first = next;\n\t} else {\n\t\tprev.next = next;\n\t\tprev.e.next = next && next.e;\n\t}\n\n\tif (next !== null) {\n\t\tnext.prev = prev;\n\t\tnext.e.prev = prev && prev.e;\n\t}\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { FILENAME, HYDRATION_ERROR } from '../../../../constants.js';\nimport { block, branch, destroy_effect } from '../../reactivity/effects.js';\nimport { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from '../hydration.js';\nimport { create_fragment_from_html } from '../reconciler.js';\nimport { assign_nodes } from '../template.js';\nimport * as w from '../../warnings.js';\nimport { hash, sanitize_location } from '../../../../utils.js';\nimport { DEV } from 'esm-env';\nimport { dev_current_component_function } from '../../context.js';\nimport { get_first_child, get_next_sibling } from '../operations.js';\n\n/**\n * @param {Element} element\n * @param {string | null} server_hash\n * @param {string} value\n */\nfunction check_hash(element, server_hash, value) {\n\tif (!server_hash || server_hash === hash(String(value ?? ''))) return;\n\n\tlet location;\n\n\t// @ts-expect-error\n\tconst loc = element.__svelte_meta?.loc;\n\tif (loc) {\n\t\tlocation = `near ${loc.file}:${loc.line}:${loc.column}`;\n\t} else if (dev_current_component_function?.[FILENAME]) {\n\t\tlocation = `in ${dev_current_component_function[FILENAME]}`;\n\t}\n\n\tw.hydration_html_changed(sanitize_location(location));\n}\n\n/**\n * @param {Element | Text | Comment} node\n * @param {() => string} get_value\n * @param {boolean} svg\n * @param {boolean} mathml\n * @param {boolean} [skip_warning]\n * @returns {void}\n */\nexport function html(node, get_value, svg, mathml, skip_warning) {\n\tvar anchor = node;\n\n\tvar value = '';\n\n\t/** @type {Effect | undefined} */\n\tvar effect;\n\n\tblock(() => {\n\t\tif (value === (value = get_value() ?? '')) {\n\t\t\tif (hydrating) {\n\t\t\t\thydrate_next();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (effect !== undefined) {\n\t\t\tdestroy_effect(effect);\n\t\t\teffect = undefined;\n\t\t}\n\n\t\tif (value === '') return;\n\n\t\teffect = branch(() => {\n\t\t\tif (hydrating) {\n\t\t\t\t// We're deliberately not trying to repair mismatches between server and client,\n\t\t\t\t// as it's costly and error-prone (and it's an edge case to have a mismatch anyway)\n\t\t\t\tvar hash = /** @type {Comment} */ (hydrate_node).data;\n\t\t\t\tvar next = hydrate_next();\n\t\t\t\tvar last = next;\n\n\t\t\t\twhile (\n\t\t\t\t\tnext !== null &&\n\t\t\t\t\t(next.nodeType !== 8 || /** @type {Comment} */ (next).data !== '')\n\t\t\t\t) {\n\t\t\t\t\tlast = next;\n\t\t\t\t\tnext = /** @type {TemplateNode} */ (get_next_sibling(next));\n\t\t\t\t}\n\n\t\t\t\tif (next === null) {\n\t\t\t\t\tw.hydration_mismatch();\n\t\t\t\t\tthrow HYDRATION_ERROR;\n\t\t\t\t}\n\n\t\t\t\tif (DEV && !skip_warning) {\n\t\t\t\t\tcheck_hash(/** @type {Element} */ (next.parentNode), hash, value);\n\t\t\t\t}\n\n\t\t\t\tassign_nodes(hydrate_node, last);\n\t\t\t\tanchor = set_hydrate_node(next);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar html = value + '';\n\t\t\tif (svg) html = `${html}`;\n\t\t\telse if (mathml) html = `${html}`;\n\n\t\t\t// Don't use create_fragment_with_script_from_html here because that would mean script tags are executed.\n\t\t\t// @html is basically `.innerHTML = ...` and that doesn't execute scripts either due to security reasons.\n\t\t\t/** @type {DocumentFragment | Element} */\n\t\t\tvar node = create_fragment_from_html(html);\n\n\t\t\tif (svg || mathml) {\n\t\t\t\tnode = /** @type {Element} */ (get_first_child(node));\n\t\t\t}\n\n\t\t\tassign_nodes(\n\t\t\t\t/** @type {TemplateNode} */ (get_first_child(node)),\n\t\t\t\t/** @type {TemplateNode} */ (node.lastChild)\n\t\t\t);\n\n\t\t\tif (svg || mathml) {\n\t\t\t\twhile (get_first_child(node)) {\n\t\t\t\t\tanchor.before(/** @type {Node} */ (get_first_child(node)));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tanchor.before(node);\n\t\t\t}\n\t\t});\n\t});\n}\n","import { hydrate_next, hydrating } from '../hydration.js';\n\n/**\n * @param {Comment} anchor\n * @param {Record} $$props\n * @param {string} name\n * @param {Record} slot_props\n * @param {null | ((anchor: Comment) => void)} fallback_fn\n */\nexport function slot(anchor, $$props, name, slot_props, fallback_fn) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar slot_fn = $$props.$$slots?.[name];\n\t// Interop: Can use snippets to fill slots\n\tvar is_interop = false;\n\tif (slot_fn === true) {\n\t\tslot_fn = $$props[name === 'default' ? 'children' : name];\n\t\tis_interop = true;\n\t}\n\n\tif (slot_fn === undefined) {\n\t\tif (fallback_fn !== null) {\n\t\t\tfallback_fn(anchor);\n\t\t}\n\t} else {\n\t\tslot_fn(anchor, is_interop ? () => slot_props : slot_props);\n\t}\n}\n\n/**\n * @param {Record} props\n * @returns {Record}\n */\nexport function sanitize_slots(props) {\n\t/** @type {Record} */\n\tconst sanitized = {};\n\tif (props.children) sanitized.default = true;\n\tfor (const key in props.$$slots) {\n\t\tsanitized[key] = true;\n\t}\n\treturn sanitized;\n}\n","/** @import { Snippet } from 'svelte' */\n/** @import { Effect, TemplateNode } from '#client' */\n/** @import { Getters } from '#shared' */\nimport { EFFECT_TRANSPARENT } from '../../constants.js';\nimport { branch, block, destroy_effect, teardown } from '../../reactivity/effects.js';\nimport {\n\tdev_current_component_function,\n\tset_dev_current_component_function\n} from '../../context.js';\nimport { hydrate_next, hydrate_node, hydrating } from '../hydration.js';\nimport { create_fragment_from_html } from '../reconciler.js';\nimport { assign_nodes } from '../template.js';\nimport * as w from '../../warnings.js';\nimport * as e from '../../errors.js';\nimport { DEV } from 'esm-env';\nimport { get_first_child, get_next_sibling } from '../operations.js';\nimport { noop } from '../../../shared/utils.js';\n\n/**\n * @template {(node: TemplateNode, ...args: any[]) => void} SnippetFn\n * @param {TemplateNode} node\n * @param {() => SnippetFn | null | undefined} get_snippet\n * @param {(() => any)[]} args\n * @returns {void}\n */\nexport function snippet(node, get_snippet, ...args) {\n\tvar anchor = node;\n\n\t/** @type {SnippetFn | null | undefined} */\n\t// @ts-ignore\n\tvar snippet = noop;\n\n\t/** @type {Effect | null} */\n\tvar snippet_effect;\n\n\tblock(() => {\n\t\tif (snippet === (snippet = get_snippet())) return;\n\n\t\tif (snippet_effect) {\n\t\t\tdestroy_effect(snippet_effect);\n\t\t\tsnippet_effect = null;\n\t\t}\n\n\t\tif (DEV && snippet == null) {\n\t\t\te.invalid_snippet();\n\t\t}\n\n\t\tsnippet_effect = branch(() => /** @type {SnippetFn} */ (snippet)(anchor, ...args));\n\t}, EFFECT_TRANSPARENT);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n\n/**\n * In development, wrap the snippet function so that it passes validation, and so that the\n * correct component context is set for ownership checks\n * @param {any} component\n * @param {(node: TemplateNode, ...args: any[]) => void} fn\n */\nexport function wrap_snippet(component, fn) {\n\treturn (/** @type {TemplateNode} */ node, /** @type {any[]} */ ...args) => {\n\t\tvar previous_component_function = dev_current_component_function;\n\t\tset_dev_current_component_function(component);\n\n\t\ttry {\n\t\t\treturn fn(node, ...args);\n\t\t} finally {\n\t\t\tset_dev_current_component_function(previous_component_function);\n\t\t}\n\t};\n}\n\n/**\n * Create a snippet programmatically\n * @template {unknown[]} Params\n * @param {(...params: Getters) => {\n * render: () => string\n * setup?: (element: Element) => void | (() => void)\n * }} fn\n * @returns {Snippet}\n */\nexport function createRawSnippet(fn) {\n\t// @ts-expect-error the types are a lie\n\treturn (/** @type {TemplateNode} */ anchor, /** @type {Getters} */ ...params) => {\n\t\tvar snippet = fn(...params);\n\n\t\t/** @type {Element} */\n\t\tvar element;\n\n\t\tif (hydrating) {\n\t\t\telement = /** @type {Element} */ (hydrate_node);\n\t\t\thydrate_next();\n\t\t} else {\n\t\t\tvar html = snippet.render().trim();\n\t\t\tvar fragment = create_fragment_from_html(html);\n\t\t\telement = /** @type {Element} */ (get_first_child(fragment));\n\n\t\t\tif (DEV && (get_next_sibling(element) !== null || element.nodeType !== 1)) {\n\t\t\t\tw.invalid_raw_snippet_render();\n\t\t\t}\n\n\t\t\tanchor.before(element);\n\t\t}\n\n\t\tconst result = snippet.setup?.(element);\n\t\tassign_nodes(element, element);\n\n\t\tif (typeof result === 'function') {\n\t\t\tteardown(result);\n\t\t}\n\t};\n}\n","/** @import { TemplateNode, Dom, Effect } from '#client' */\nimport { EFFECT_TRANSPARENT } from '../../constants.js';\nimport { block, branch, pause_effect } from '../../reactivity/effects.js';\nimport { hydrate_next, hydrate_node, hydrating } from '../hydration.js';\n\n/**\n * @template P\n * @template {(props: P) => void} C\n * @param {TemplateNode} node\n * @param {() => C} get_component\n * @param {(anchor: TemplateNode, component: C) => Dom | void} render_fn\n * @returns {void}\n */\nexport function component(node, get_component, render_fn) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar anchor = node;\n\n\t/** @type {C} */\n\tvar component;\n\n\t/** @type {Effect | null} */\n\tvar effect;\n\n\tblock(() => {\n\t\tif (component === (component = get_component())) return;\n\n\t\tif (effect) {\n\t\t\tpause_effect(effect);\n\t\t\teffect = null;\n\t\t}\n\n\t\tif (component) {\n\t\t\teffect = branch(() => render_fn(anchor, component));\n\t\t}\n\t}, EFFECT_TRANSPARENT);\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n","/** @import { ActionPayload } from '#client' */\nimport { effect, render_effect } from '../../reactivity/effects.js';\nimport { safe_not_equal } from '../../reactivity/equality.js';\nimport { deep_read_state, untrack } from '../../runtime.js';\n\n/**\n * @template P\n * @param {Element} dom\n * @param {(dom: Element, value?: P) => ActionPayload

} action\n * @param {() => P} [get_value]\n * @returns {void}\n */\nexport function action(dom, action, get_value) {\n\teffect(() => {\n\t\tvar payload = untrack(() => action(dom, get_value?.()) || {});\n\n\t\tif (get_value && payload?.update) {\n\t\t\tvar inited = false;\n\t\t\t/** @type {P} */\n\t\t\tvar prev = /** @type {any} */ ({}); // initialize with something so it's never equal on first run\n\n\t\t\trender_effect(() => {\n\t\t\t\tvar value = get_value();\n\n\t\t\t\t// Action's update method is coarse-grained, i.e. when anything in the passed value changes, update.\n\t\t\t\t// This works in legacy mode because of mutable_source being updated as a whole, but when using $state\n\t\t\t\t// together with actions and mutation, it wouldn't notice the change without a deep read.\n\t\t\t\tdeep_read_state(value);\n\n\t\t\t\tif (inited && safe_not_equal(prev, value)) {\n\t\t\t\t\tprev = value;\n\t\t\t\t\t/** @type {Function} */ (payload.update)(value);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tinited = true;\n\t\t}\n\n\t\tif (payload?.destroy) {\n\t\t\treturn () => /** @type {Function} */ (payload.destroy)();\n\t\t}\n\t});\n}\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t` should be rendered as `

` and _not_\n * `
`, which is equivalent to `
`. There\n * may be other odd cases that need to be added to this list in future\n * @type {Record>}\n */\nconst replacements = {\n\ttranslate: new Map([\n\t\t[true, 'yes'],\n\t\t[false, 'no']\n\t])\n};\n\n/**\n * @template V\n * @param {string} name\n * @param {V} value\n * @param {boolean} [is_boolean]\n * @returns {string}\n */\nexport function attr(name, value, is_boolean = false) {\n\tif (value == null || (!value && is_boolean) || (value === '' && name === 'class')) return '';\n\tconst normalized = (name in replacements && replacements[name].get(value)) || value;\n\tconst assignment = is_boolean ? '' : `=\"${escape_html(normalized, true)}\"`;\n\treturn ` ${name}${assignment}`;\n}\n\n/**\n * Small wrapper around clsx to preserve Svelte's (weird) handling of falsy values.\n * TODO Svelte 6 revisit this, and likely turn all falsy values into the empty string (what clsx also does)\n * @param {any} value\n */\nexport function clsx(value) {\n\tif (typeof value === 'object') {\n\t\treturn _clsx(value);\n\t} else {\n\t\treturn value ?? '';\n\t}\n}\n\nconst whitespace = [...' \\t\\n\\r\\f\\u00a0\\u000b\\ufeff'];\n\n/**\n * @param {any} value\n * @param {string | null} [hash]\n * @param {Record} [directives]\n * @returns {string | null}\n */\nexport function to_class(value, hash, directives) {\n\tvar classname = value == null ? '' : '' + value;\n\n\tif (hash) {\n\t\tclassname = classname ? classname + ' ' + hash : hash;\n\t}\n\n\tif (directives) {\n\t\tfor (var key in directives) {\n\t\t\tif (directives[key]) {\n\t\t\t\tclassname = classname ? classname + ' ' + key : key;\n\t\t\t} else if (classname.length) {\n\t\t\t\tvar len = key.length;\n\t\t\t\tvar a = 0;\n\n\t\t\t\twhile ((a = classname.indexOf(key, a)) >= 0) {\n\t\t\t\t\tvar b = a + len;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(a === 0 || whitespace.includes(classname[a - 1])) &&\n\t\t\t\t\t\t(b === classname.length || whitespace.includes(classname[b]))\n\t\t\t\t\t) {\n\t\t\t\t\t\tclassname = (a === 0 ? '' : classname.substring(0, a)) + classname.substring(b + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ta = b;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn classname === '' ? null : classname;\n}\n","import { to_class } from '../../../shared/attributes.js';\nimport { hydrating } from '../hydration.js';\n\n/**\n * @param {Element} dom\n * @param {boolean | number} is_html\n * @param {string | null} value\n * @param {string} [hash]\n * @param {Record} [prev_classes]\n * @param {Record} [next_classes]\n * @returns {Record | undefined}\n */\nexport function set_class(dom, is_html, value, hash, prev_classes, next_classes) {\n\t// @ts-expect-error need to add __className to patched prototype\n\tvar prev = dom.__className;\n\n\tif (hydrating || prev !== value) {\n\t\tvar next_class_name = to_class(value, hash, next_classes);\n\n\t\tif (!hydrating || next_class_name !== dom.getAttribute('class')) {\n\t\t\t// Removing the attribute when the value is only an empty string causes\n\t\t\t// performance issues vs simply making the className an empty string. So\n\t\t\t// we should only remove the class if the the value is nullish\n\t\t\t// and there no hash/directives :\n\t\t\tif (next_class_name == null) {\n\t\t\t\tdom.removeAttribute('class');\n\t\t\t} else if (is_html) {\n\t\t\t\tdom.className = next_class_name;\n\t\t\t} else {\n\t\t\t\tdom.setAttribute('class', next_class_name);\n\t\t\t}\n\t\t}\n\n\t\t// @ts-expect-error need to add __className to patched prototype\n\t\tdom.__className = value;\n\t} else if (next_classes) {\n\t\tprev_classes ??= {};\n\n\t\tfor (var key in next_classes) {\n\t\t\tvar is_present = !!next_classes[key];\n\n\t\t\tif (is_present !== !!prev_classes[key]) {\n\t\t\t\tdom.classList.toggle(key, is_present);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn next_classes;\n}\n","import { DEV } from 'esm-env';\nimport { hydrating, set_hydrating } from '../hydration.js';\nimport { get_descriptors, get_prototype_of } from '../../../shared/utils.js';\nimport { create_event, delegate } from './events.js';\nimport { add_form_reset_listener, autofocus } from './misc.js';\nimport * as w from '../../warnings.js';\nimport { LOADING_ATTR_SYMBOL } from '../../constants.js';\nimport { queue_idle_task } from '../task.js';\nimport { is_capture_event, is_delegated, normalize_attribute } from '../../../../utils.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { clsx } from '../../../shared/attributes.js';\nimport { set_class } from './class.js';\n\nexport const CLASS = Symbol('class');\nexport const STYLE = Symbol('style');\n\n/**\n * The value/checked attribute in the template actually corresponds to the defaultValue property, so we need\n * to remove it upon hydration to avoid a bug when someone resets the form value.\n * @param {HTMLInputElement} input\n * @returns {void}\n */\nexport function remove_input_defaults(input) {\n\tif (!hydrating) return;\n\n\tvar already_removed = false;\n\n\t// We try and remove the default attributes later, rather than sync during hydration.\n\t// Doing it sync during hydration has a negative impact on performance, but deferring the\n\t// work in an idle task alleviates this greatly. If a form reset event comes in before\n\t// the idle callback, then we ensure the input defaults are cleared just before.\n\tvar remove_defaults = () => {\n\t\tif (already_removed) return;\n\t\talready_removed = true;\n\n\t\t// Remove the attributes but preserve the values\n\t\tif (input.hasAttribute('value')) {\n\t\t\tvar value = input.value;\n\t\t\tset_attribute(input, 'value', null);\n\t\t\tinput.value = value;\n\t\t}\n\n\t\tif (input.hasAttribute('checked')) {\n\t\t\tvar checked = input.checked;\n\t\t\tset_attribute(input, 'checked', null);\n\t\t\tinput.checked = checked;\n\t\t}\n\t};\n\n\t// @ts-expect-error\n\tinput.__on_r = remove_defaults;\n\tqueue_idle_task(remove_defaults);\n\tadd_form_reset_listener();\n}\n\n/**\n * @param {Element} element\n * @param {any} value\n */\nexport function set_value(element, value) {\n\t// @ts-expect-error\n\tvar attributes = (element.__attributes ??= {});\n\n\tif (\n\t\tattributes.value ===\n\t\t\t(attributes.value =\n\t\t\t\t// treat null and undefined the same for the initial value\n\t\t\t\tvalue ?? undefined) ||\n\t\t// @ts-expect-error\n\t\t// `progress` elements always need their value set when it's `0`\n\t\t(element.value === value && (value !== 0 || element.nodeName !== 'PROGRESS'))\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.value = value ?? '';\n}\n\n/**\n * @param {Element} element\n * @param {boolean} checked\n */\nexport function set_checked(element, checked) {\n\t// @ts-expect-error\n\tvar attributes = (element.__attributes ??= {});\n\n\tif (\n\t\tattributes.checked ===\n\t\t(attributes.checked =\n\t\t\t// treat null and undefined the same for the initial value\n\t\t\tchecked ?? undefined)\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.checked = checked;\n}\n\n/**\n * Sets the `selected` attribute on an `option` element.\n * Not set through the property because that doesn't reflect to the DOM,\n * which means it wouldn't be taken into account when a form is reset.\n * @param {HTMLOptionElement} element\n * @param {boolean} selected\n */\nexport function set_selected(element, selected) {\n\tif (selected) {\n\t\t// The selected option could've changed via user selection, and\n\t\t// setting the value without this check would set it back.\n\t\tif (!element.hasAttribute('selected')) {\n\t\t\telement.setAttribute('selected', '');\n\t\t}\n\t} else {\n\t\telement.removeAttribute('selected');\n\t}\n}\n\n/**\n * Applies the default checked property without influencing the current checked property.\n * @param {HTMLInputElement} element\n * @param {boolean} checked\n */\nexport function set_default_checked(element, checked) {\n\tconst existing_value = element.checked;\n\telement.defaultChecked = checked;\n\telement.checked = existing_value;\n}\n\n/**\n * Applies the default value property without influencing the current value property.\n * @param {HTMLInputElement | HTMLTextAreaElement} element\n * @param {string} value\n */\nexport function set_default_value(element, value) {\n\tconst existing_value = element.value;\n\telement.defaultValue = value;\n\telement.value = existing_value;\n}\n\n/**\n * @param {Element} element\n * @param {string} attribute\n * @param {string | null} value\n * @param {boolean} [skip_warning]\n */\nexport function set_attribute(element, attribute, value, skip_warning) {\n\t// @ts-expect-error\n\tvar attributes = (element.__attributes ??= {});\n\n\tif (hydrating) {\n\t\tattributes[attribute] = element.getAttribute(attribute);\n\n\t\tif (\n\t\t\tattribute === 'src' ||\n\t\t\tattribute === 'srcset' ||\n\t\t\t(attribute === 'href' && element.nodeName === 'LINK')\n\t\t) {\n\t\t\tif (!skip_warning) {\n\t\t\t\tcheck_src_in_dev_hydration(element, attribute, value ?? '');\n\t\t\t}\n\n\t\t\t// If we reset these attributes, they would result in another network request, which we want to avoid.\n\t\t\t// We assume they are the same between client and server as checking if they are equal is expensive\n\t\t\t// (we can't just compare the strings as they can be different between client and server but result in the\n\t\t\t// same url, so we would need to create hidden anchor elements to compare them)\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (attributes[attribute] === (attributes[attribute] = value)) return;\n\n\tif (attribute === 'style' && '__styles' in element) {\n\t\t// reset styles to force style: directive to update\n\t\telement.__styles = {};\n\t}\n\n\tif (attribute === 'loading') {\n\t\t// @ts-expect-error\n\t\telement[LOADING_ATTR_SYMBOL] = value;\n\t}\n\n\tif (value == null) {\n\t\telement.removeAttribute(attribute);\n\t} else if (typeof value !== 'string' && get_setters(element).includes(attribute)) {\n\t\t// @ts-ignore\n\t\telement[attribute] = value;\n\t} else {\n\t\telement.setAttribute(attribute, value);\n\t}\n}\n\n/**\n * @param {Element} dom\n * @param {string} attribute\n * @param {string} value\n */\nexport function set_xlink_attribute(dom, attribute, value) {\n\tdom.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\n/**\n * @param {HTMLElement} node\n * @param {string} prop\n * @param {any} value\n */\nexport function set_custom_element_data(node, prop, value) {\n\t// We need to ensure that setting custom element props, which can\n\t// invoke lifecycle methods on other custom elements, does not also\n\t// associate those lifecycle methods with the current active reaction\n\t// or effect\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet was_hydrating = hydrating;\n\tif (hydrating) {\n\t\tset_hydrating(false);\n\t}\n\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\ttry {\n\t\tif (\n\t\t\t// Don't compute setters for custom elements while they aren't registered yet,\n\t\t\t// because during their upgrade/instantiation they might add more setters.\n\t\t\t// Instead, fall back to a simple \"an object, then set as property\" heuristic.\n\t\t\tsetters_cache.has(node.nodeName) ||\n\t\t\t// customElements may not be available in browser extension contexts\n\t\t\t!customElements ||\n\t\t\tcustomElements.get(node.tagName.toLowerCase())\n\t\t\t\t? get_setters(node).includes(prop)\n\t\t\t\t: value && typeof value === 'object'\n\t\t) {\n\t\t\t// @ts-expect-error\n\t\t\tnode[prop] = value;\n\t\t} else {\n\t\t\t// We did getters etc checks already, stringify before passing to set_attribute\n\t\t\t// to ensure it doesn't invoke the same logic again, and potentially populating\n\t\t\t// the setters cache too early.\n\t\t\tset_attribute(node, prop, value == null ? value : String(value));\n\t\t}\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t\tif (was_hydrating) {\n\t\t\tset_hydrating(true);\n\t\t}\n\t}\n}\n\n/**\n * Spreads attributes onto a DOM element, taking into account the currently set attributes\n * @param {Element & ElementCSSInlineStyle} element\n * @param {Record | undefined} prev\n * @param {Record} next New attributes - this function mutates this object\n * @param {string} [css_hash]\n * @param {boolean} [preserve_attribute_case]\n * @param {boolean} [is_custom_element]\n * @param {boolean} [skip_warning]\n * @returns {Record}\n */\nexport function set_attributes(\n\telement,\n\tprev,\n\tnext,\n\tcss_hash,\n\tpreserve_attribute_case = false,\n\tis_custom_element = false,\n\tskip_warning = false\n) {\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet is_hydrating_custom_element = hydrating && is_custom_element;\n\tif (is_hydrating_custom_element) {\n\t\tset_hydrating(false);\n\t}\n\n\tvar current = prev || {};\n\tvar is_option_element = element.tagName === 'OPTION';\n\n\tfor (var key in prev) {\n\t\tif (!(key in next)) {\n\t\t\tnext[key] = null;\n\t\t}\n\t}\n\n\tif (next.class) {\n\t\tnext.class = clsx(next.class);\n\t} else if (css_hash || next[CLASS]) {\n\t\tnext.class = null; /* force call to set_class() */\n\t}\n\n\tvar setters = get_setters(element);\n\n\t// @ts-expect-error\n\tvar attributes = /** @type {Record} **/ (element.__attributes ??= {});\n\n\t// since key is captured we use const\n\tfor (const key in next) {\n\t\t// let instead of var because referenced in a closure\n\t\tlet value = next[key];\n\n\t\t// Up here because we want to do this for the initial value, too, even if it's undefined,\n\t\t// and this wouldn't be reached in case of undefined because of the equality check below\n\t\tif (is_option_element && key === 'value' && value == null) {\n\t\t\t// The
\r\n{/if}\r\n\r\n\r\n","/**\n * Fingerprint BotD v1.9.1 - Copyright (c) FingerprintJS, Inc, 2024 (https://fingerprint.com)\n * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.\n */\n\nimport { __extends, __awaiter, __generator, __spreadArray } from 'tslib';\n\nvar version = \"1.9.1\";\n\n/**\n * Enum for types of bots.\n * Specific types of bots come first, followed by automation technologies.\n *\n * @readonly\n * @enum {string}\n */\nvar BotKind = {\n // Object is used instead of Typescript enum to avoid emitting IIFE which might be affected by further tree-shaking.\n // See example of compiled enums https://stackoverflow.com/q/47363996)\n Awesomium: 'awesomium',\n Cef: 'cef',\n CefSharp: 'cefsharp',\n CoachJS: 'coachjs',\n Electron: 'electron',\n FMiner: 'fminer',\n Geb: 'geb',\n NightmareJS: 'nightmarejs',\n Phantomas: 'phantomas',\n PhantomJS: 'phantomjs',\n Rhino: 'rhino',\n Selenium: 'selenium',\n Sequentum: 'sequentum',\n SlimerJS: 'slimerjs',\n WebDriverIO: 'webdriverio',\n WebDriver: 'webdriver',\n HeadlessChrome: 'headless_chrome',\n Unknown: 'unknown',\n};\n/**\n * Bot detection error.\n */\nvar BotdError = /** @class */ (function (_super) {\n __extends(BotdError, _super);\n /**\n * Creates a new BotdError.\n *\n * @class\n */\n function BotdError(state, message) {\n var _this = _super.call(this, message) || this;\n _this.state = state;\n _this.name = 'BotdError';\n Object.setPrototypeOf(_this, BotdError.prototype);\n return _this;\n }\n return BotdError;\n}(Error));\n\nfunction detect(components, detectors) {\n var detections = {};\n var finalDetection = {\n bot: false,\n };\n for (var detectorName in detectors) {\n var detector = detectors[detectorName];\n var detectorRes = detector(components);\n var detection = { bot: false };\n if (typeof detectorRes === 'string') {\n detection = { bot: true, botKind: detectorRes };\n }\n else if (detectorRes) {\n detection = { bot: true, botKind: BotKind.Unknown };\n }\n detections[detectorName] = detection;\n if (detection.bot) {\n finalDetection = detection;\n }\n }\n return [detections, finalDetection];\n}\nfunction collect(sources) {\n return __awaiter(this, void 0, void 0, function () {\n var components, sourcesKeys;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n components = {};\n sourcesKeys = Object.keys(sources);\n return [4 /*yield*/, Promise.all(sourcesKeys.map(function (sourceKey) { return __awaiter(_this, void 0, void 0, function () {\n var res, _a, _b, error_1;\n var _c;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n res = sources[sourceKey];\n _d.label = 1;\n case 1:\n _d.trys.push([1, 3, , 4]);\n _a = components;\n _b = sourceKey;\n _c = {};\n return [4 /*yield*/, res()];\n case 2:\n _a[_b] = (_c.value = _d.sent(),\n _c.state = 0 /* State.Success */,\n _c);\n return [3 /*break*/, 4];\n case 3:\n error_1 = _d.sent();\n if (error_1 instanceof BotdError) {\n components[sourceKey] = {\n state: error_1.state,\n error: \"\".concat(error_1.name, \": \").concat(error_1.message),\n };\n }\n else {\n components[sourceKey] = {\n state: -3 /* State.UnexpectedBehaviour */,\n error: error_1 instanceof Error ? \"\".concat(error_1.name, \": \").concat(error_1.message) : String(error_1),\n };\n }\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n }); }))];\n case 1:\n _a.sent();\n return [2 /*return*/, components];\n }\n });\n });\n}\n\nfunction detectAppVersion(_a) {\n var appVersion = _a.appVersion;\n if (appVersion.state !== 0 /* State.Success */)\n return false;\n if (/headless/i.test(appVersion.value))\n return BotKind.HeadlessChrome;\n if (/electron/i.test(appVersion.value))\n return BotKind.Electron;\n if (/slimerjs/i.test(appVersion.value))\n return BotKind.SlimerJS;\n}\n\nfunction arrayIncludes(arr, value) {\n return arr.indexOf(value) !== -1;\n}\nfunction strIncludes(str, value) {\n return str.indexOf(value) !== -1;\n}\nfunction arrayFind(array, callback) {\n if ('find' in array)\n return array.find(callback);\n for (var i = 0; i < array.length; i++) {\n if (callback(array[i], i, array))\n return array[i];\n }\n return undefined;\n}\n\nfunction getObjectProps(obj) {\n return Object.getOwnPropertyNames(obj);\n}\nfunction includes(arr) {\n var keys = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n keys[_i - 1] = arguments[_i];\n }\n var _loop_1 = function (key) {\n if (typeof key === 'string') {\n if (arrayIncludes(arr, key))\n return { value: true };\n }\n else {\n var match = arrayFind(arr, function (value) { return key.test(value); });\n if (match != null)\n return { value: true };\n }\n };\n for (var _a = 0, keys_1 = keys; _a < keys_1.length; _a++) {\n var key = keys_1[_a];\n var state_1 = _loop_1(key);\n if (typeof state_1 === \"object\")\n return state_1.value;\n }\n return false;\n}\nfunction countTruthy(values) {\n return values.reduce(function (sum, value) { return sum + (value ? 1 : 0); }, 0);\n}\n\nfunction detectDocumentAttributes(_a) {\n var documentElementKeys = _a.documentElementKeys;\n if (documentElementKeys.state !== 0 /* State.Success */)\n return false;\n if (includes(documentElementKeys.value, 'selenium', 'webdriver', 'driver')) {\n return BotKind.Selenium;\n }\n}\n\nfunction detectErrorTrace(_a) {\n var errorTrace = _a.errorTrace;\n if (errorTrace.state !== 0 /* State.Success */)\n return false;\n if (/PhantomJS/i.test(errorTrace.value))\n return BotKind.PhantomJS;\n}\n\nfunction detectEvalLengthInconsistency(_a) {\n var evalLength = _a.evalLength, browserKind = _a.browserKind, browserEngineKind = _a.browserEngineKind;\n if (evalLength.state !== 0 /* State.Success */ ||\n browserKind.state !== 0 /* State.Success */ ||\n browserEngineKind.state !== 0 /* State.Success */)\n return;\n var length = evalLength.value;\n if (browserEngineKind.value === \"unknown\" /* BrowserEngineKind.Unknown */)\n return false;\n return ((length === 37 && !arrayIncludes([\"webkit\" /* BrowserEngineKind.Webkit */, \"gecko\" /* BrowserEngineKind.Gecko */], browserEngineKind.value)) ||\n (length === 39 && !arrayIncludes([\"internet_explorer\" /* BrowserKind.IE */], browserKind.value)) ||\n (length === 33 && !arrayIncludes([\"chromium\" /* BrowserEngineKind.Chromium */], browserEngineKind.value)));\n}\n\nfunction detectFunctionBind(_a) {\n var functionBind = _a.functionBind;\n if (functionBind.state === -2 /* State.NotFunction */)\n return BotKind.PhantomJS;\n}\n\nfunction detectLanguagesLengthInconsistency(_a) {\n var languages = _a.languages;\n if (languages.state === 0 /* State.Success */ && languages.value.length === 0) {\n return BotKind.HeadlessChrome;\n }\n}\n\nfunction detectMimeTypesConsistent(_a) {\n var mimeTypesConsistent = _a.mimeTypesConsistent;\n if (mimeTypesConsistent.state === 0 /* State.Success */ && !mimeTypesConsistent.value) {\n return BotKind.Unknown;\n }\n}\n\nfunction detectNotificationPermissions(_a) {\n var notificationPermissions = _a.notificationPermissions, browserKind = _a.browserKind;\n if (browserKind.state !== 0 /* State.Success */ || browserKind.value !== \"chrome\" /* BrowserKind.Chrome */)\n return false;\n if (notificationPermissions.state === 0 /* State.Success */ && notificationPermissions.value) {\n return BotKind.HeadlessChrome;\n }\n}\n\nfunction detectPluginsArray(_a) {\n var pluginsArray = _a.pluginsArray;\n if (pluginsArray.state === 0 /* State.Success */ && !pluginsArray.value)\n return BotKind.HeadlessChrome;\n}\n\nfunction detectPluginsLengthInconsistency(_a) {\n var pluginsLength = _a.pluginsLength, android = _a.android, browserKind = _a.browserKind, browserEngineKind = _a.browserEngineKind;\n if (pluginsLength.state !== 0 /* State.Success */ ||\n android.state !== 0 /* State.Success */ ||\n browserKind.state !== 0 /* State.Success */ ||\n browserEngineKind.state !== 0 /* State.Success */)\n return;\n if (browserKind.value !== \"chrome\" /* BrowserKind.Chrome */ ||\n android.value ||\n browserEngineKind.value !== \"chromium\" /* BrowserEngineKind.Chromium */)\n return;\n if (pluginsLength.value === 0)\n return BotKind.HeadlessChrome;\n}\n\nfunction detectProcess(_a) {\n var _b;\n var process = _a.process;\n if (process.state !== 0 /* State.Success */)\n return false;\n if (process.value.type === 'renderer' || ((_b = process.value.versions) === null || _b === void 0 ? void 0 : _b.electron) != null)\n return BotKind.Electron;\n}\n\nfunction detectProductSub(_a) {\n var productSub = _a.productSub, browserKind = _a.browserKind;\n if (productSub.state !== 0 /* State.Success */ || browserKind.state !== 0 /* State.Success */)\n return false;\n if ((browserKind.value === \"chrome\" /* BrowserKind.Chrome */ ||\n browserKind.value === \"safari\" /* BrowserKind.Safari */ ||\n browserKind.value === \"opera\" /* BrowserKind.Opera */ ||\n browserKind.value === \"wechat\" /* BrowserKind.WeChat */) &&\n productSub.value !== '20030107')\n return BotKind.Unknown;\n}\n\nfunction detectUserAgent(_a) {\n var userAgent = _a.userAgent;\n if (userAgent.state !== 0 /* State.Success */)\n return false;\n if (/PhantomJS/i.test(userAgent.value))\n return BotKind.PhantomJS;\n if (/Headless/i.test(userAgent.value))\n return BotKind.HeadlessChrome;\n if (/Electron/i.test(userAgent.value))\n return BotKind.Electron;\n if (/slimerjs/i.test(userAgent.value))\n return BotKind.SlimerJS;\n}\n\nfunction detectWebDriver(_a) {\n var webDriver = _a.webDriver;\n if (webDriver.state === 0 /* State.Success */ && webDriver.value)\n return BotKind.HeadlessChrome;\n}\n\nfunction detectWebGL(_a) {\n var webGL = _a.webGL;\n if (webGL.state === 0 /* State.Success */) {\n var _b = webGL.value, vendor = _b.vendor, renderer = _b.renderer;\n if (vendor == 'Brian Paul' && renderer == 'Mesa OffScreen') {\n return BotKind.HeadlessChrome;\n }\n }\n}\n\nfunction detectWindowExternal(_a) {\n var windowExternal = _a.windowExternal;\n if (windowExternal.state !== 0 /* State.Success */)\n return false;\n if (/Sequentum/i.test(windowExternal.value))\n return BotKind.Sequentum;\n}\n\nfunction detectWindowSize(_a) {\n var windowSize = _a.windowSize, documentFocus = _a.documentFocus;\n if (windowSize.state !== 0 /* State.Success */ || documentFocus.state !== 0 /* State.Success */)\n return false;\n var _b = windowSize.value, outerWidth = _b.outerWidth, outerHeight = _b.outerHeight;\n // When a page is opened in a new tab without focusing it right away, the window outer size is 0x0\n if (!documentFocus.value)\n return;\n if (outerWidth === 0 && outerHeight === 0)\n return BotKind.HeadlessChrome;\n}\n\nfunction detectDistinctiveProperties(_a) {\n var distinctiveProps = _a.distinctiveProps;\n if (distinctiveProps.state !== 0 /* State.Success */)\n return false;\n var value = distinctiveProps.value;\n var bot;\n for (bot in value)\n if (value[bot])\n return bot;\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nvar detectors = {\n detectAppVersion: detectAppVersion,\n detectDocumentAttributes: detectDocumentAttributes,\n detectErrorTrace: detectErrorTrace,\n detectEvalLengthInconsistency: detectEvalLengthInconsistency,\n detectFunctionBind: detectFunctionBind,\n detectLanguagesLengthInconsistency: detectLanguagesLengthInconsistency,\n detectNotificationPermissions: detectNotificationPermissions,\n detectPluginsArray: detectPluginsArray,\n detectPluginsLengthInconsistency: detectPluginsLengthInconsistency,\n detectProcess: detectProcess,\n detectUserAgent: detectUserAgent,\n detectWebDriver: detectWebDriver,\n detectWebGL: detectWebGL,\n detectWindowExternal: detectWindowExternal,\n detectWindowSize: detectWindowSize,\n detectMimeTypesConsistent: detectMimeTypesConsistent,\n detectProductSub: detectProductSub,\n detectDistinctiveProperties: detectDistinctiveProperties,\n};\n\nfunction getAppVersion() {\n var appVersion = navigator.appVersion;\n if (appVersion == undefined) {\n throw new BotdError(-1 /* State.Undefined */, 'navigator.appVersion is undefined');\n }\n return appVersion;\n}\n\nfunction getDocumentElementKeys() {\n if (document.documentElement === undefined) {\n throw new BotdError(-1 /* State.Undefined */, 'document.documentElement is undefined');\n }\n var documentElement = document.documentElement;\n if (typeof documentElement.getAttributeNames !== 'function') {\n throw new BotdError(-2 /* State.NotFunction */, 'document.documentElement.getAttributeNames is not a function');\n }\n return documentElement.getAttributeNames();\n}\n\nfunction getErrorTrace() {\n try {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n null[0]();\n }\n catch (error) {\n if (error instanceof Error && error['stack'] != null) {\n return error.stack.toString();\n }\n }\n throw new BotdError(-3 /* State.UnexpectedBehaviour */, 'errorTrace signal unexpected behaviour');\n}\n\nfunction getEvalLength() {\n return eval.toString().length;\n}\n\nfunction getFunctionBind() {\n if (Function.prototype.bind === undefined) {\n throw new BotdError(-2 /* State.NotFunction */, 'Function.prototype.bind is undefined');\n }\n return Function.prototype.bind.toString();\n}\n\nfunction getBrowserEngineKind() {\n var _a, _b;\n // Based on research in October 2020. Tested to detect Chromium 42-86.\n var w = window;\n var n = navigator;\n if (countTruthy([\n 'webkitPersistentStorage' in n,\n 'webkitTemporaryStorage' in n,\n n.vendor.indexOf('Google') === 0,\n 'webkitResolveLocalFileSystemURL' in w,\n 'BatteryManager' in w,\n 'webkitMediaStream' in w,\n 'webkitSpeechGrammar' in w,\n ]) >= 5) {\n return \"chromium\" /* BrowserEngineKind.Chromium */;\n }\n if (countTruthy([\n 'ApplePayError' in w,\n 'CSSPrimitiveValue' in w,\n 'Counter' in w,\n n.vendor.indexOf('Apple') === 0,\n 'getStorageUpdates' in n,\n 'WebKitMediaKeys' in w,\n ]) >= 4) {\n return \"webkit\" /* BrowserEngineKind.Webkit */;\n }\n if (countTruthy([\n 'buildID' in navigator,\n 'MozAppearance' in ((_b = (_a = document.documentElement) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {}),\n 'onmozfullscreenchange' in w,\n 'mozInnerScreenX' in w,\n 'CSSMozDocumentRule' in w,\n 'CanvasCaptureMediaStream' in w,\n ]) >= 4) {\n return \"gecko\" /* BrowserEngineKind.Gecko */;\n }\n return \"unknown\" /* BrowserEngineKind.Unknown */;\n}\nfunction getBrowserKind() {\n var _a;\n var userAgent = (_a = navigator.userAgent) === null || _a === void 0 ? void 0 : _a.toLowerCase();\n if (strIncludes(userAgent, 'edg/')) {\n return \"edge\" /* BrowserKind.Edge */;\n }\n else if (strIncludes(userAgent, 'trident') || strIncludes(userAgent, 'msie')) {\n return \"internet_explorer\" /* BrowserKind.IE */;\n }\n else if (strIncludes(userAgent, 'wechat')) {\n return \"wechat\" /* BrowserKind.WeChat */;\n }\n else if (strIncludes(userAgent, 'firefox')) {\n return \"firefox\" /* BrowserKind.Firefox */;\n }\n else if (strIncludes(userAgent, 'opera') || strIncludes(userAgent, 'opr')) {\n return \"opera\" /* BrowserKind.Opera */;\n }\n else if (strIncludes(userAgent, 'chrome')) {\n return \"chrome\" /* BrowserKind.Chrome */;\n }\n else if (strIncludes(userAgent, 'safari')) {\n return \"safari\" /* BrowserKind.Safari */;\n }\n else {\n return \"unknown\" /* BrowserKind.Unknown */;\n }\n}\n// Source: https://github.com/fingerprintjs/fingerprintjs/blob/master/src/utils/browser.ts#L223\nfunction isAndroid() {\n var browserEngineKind = getBrowserEngineKind();\n var isItChromium = browserEngineKind === \"chromium\" /* BrowserEngineKind.Chromium */;\n var isItGecko = browserEngineKind === \"gecko\" /* BrowserEngineKind.Gecko */;\n // Only 2 browser engines are presented on Android.\n // Actually, there is also Android 4.1 browser, but it's not worth detecting it at the moment.\n if (!isItChromium && !isItGecko)\n return false;\n var w = window;\n // Chrome removes all words \"Android\" from `navigator` when desktop version is requested\n // Firefox keeps \"Android\" in `navigator.appVersion` when desktop version is requested\n return (countTruthy([\n 'onorientationchange' in w,\n 'orientation' in w,\n isItChromium && !('SharedWorker' in w),\n isItGecko && /android/i.test(navigator.appVersion),\n ]) >= 2);\n}\nfunction getDocumentFocus() {\n if (document.hasFocus === undefined) {\n return false;\n }\n return document.hasFocus();\n}\nfunction isChromium86OrNewer() {\n // Checked in Chrome 85 vs Chrome 86 both on desktop and Android\n var w = window;\n return (countTruthy([\n !('MediaSettingsRange' in w),\n 'RTCEncodedAudioFrame' in w,\n '' + w.Intl === '[object Intl]',\n '' + w.Reflect === '[object Reflect]',\n ]) >= 3);\n}\n\nfunction getLanguages() {\n var n = navigator;\n var result = [];\n var language = n.language || n.userLanguage || n.browserLanguage || n.systemLanguage;\n if (language !== undefined) {\n result.push([language]);\n }\n if (Array.isArray(n.languages)) {\n var browserEngine = getBrowserEngineKind();\n // Starting from Chromium 86, there is only a single value in `navigator.language` in Incognito mode:\n // the value of `navigator.language`. Therefore, the value is ignored in this browser.\n if (!(browserEngine === \"chromium\" /* BrowserEngineKind.Chromium */ && isChromium86OrNewer())) {\n result.push(n.languages);\n }\n }\n else if (typeof n.languages === 'string') {\n var languages = n.languages;\n if (languages) {\n result.push(languages.split(','));\n }\n }\n return result;\n}\n\nfunction areMimeTypesConsistent() {\n if (navigator.mimeTypes === undefined) {\n throw new BotdError(-1 /* State.Undefined */, 'navigator.mimeTypes is undefined');\n }\n var mimeTypes = navigator.mimeTypes;\n var isConsistent = Object.getPrototypeOf(mimeTypes) === MimeTypeArray.prototype;\n for (var i = 0; i < mimeTypes.length; i++) {\n isConsistent && (isConsistent = Object.getPrototypeOf(mimeTypes[i]) === MimeType.prototype);\n }\n return isConsistent;\n}\n\nfunction getNotificationPermissions() {\n return __awaiter(this, void 0, void 0, function () {\n var permissions, permissionStatus;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (window.Notification === undefined) {\n throw new BotdError(-1 /* State.Undefined */, 'window.Notification is undefined');\n }\n if (navigator.permissions === undefined) {\n throw new BotdError(-1 /* State.Undefined */, 'navigator.permissions is undefined');\n }\n permissions = navigator.permissions;\n if (typeof permissions.query !== 'function') {\n throw new BotdError(-2 /* State.NotFunction */, 'navigator.permissions.query is not a function');\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, permissions.query({ name: 'notifications' })];\n case 2:\n permissionStatus = _a.sent();\n return [2 /*return*/, window.Notification.permission === 'denied' && permissionStatus.state === 'prompt'];\n case 3:\n _a.sent();\n throw new BotdError(-3 /* State.UnexpectedBehaviour */, 'notificationPermissions signal unexpected behaviour');\n case 4: return [2 /*return*/];\n }\n });\n });\n}\n\nfunction getPluginsArray() {\n if (navigator.plugins === undefined) {\n throw new BotdError(-1 /* State.Undefined */, 'navigator.plugins is undefined');\n }\n if (window.PluginArray === undefined) {\n throw new BotdError(-1 /* State.Undefined */, 'window.PluginArray is undefined');\n }\n return navigator.plugins instanceof PluginArray;\n}\n\nfunction getPluginsLength() {\n if (navigator.plugins === undefined) {\n throw new BotdError(-1 /* State.Undefined */, 'navigator.plugins is undefined');\n }\n if (navigator.plugins.length === undefined) {\n throw new BotdError(-3 /* State.UnexpectedBehaviour */, 'navigator.plugins.length is undefined');\n }\n return navigator.plugins.length;\n}\n\nfunction getProcess() {\n var process = window.process;\n var errorPrefix = 'window.process is';\n if (process === undefined) {\n throw new BotdError(-1 /* State.Undefined */, \"\".concat(errorPrefix, \" undefined\"));\n }\n if (process && typeof process !== 'object') {\n throw new BotdError(-3 /* State.UnexpectedBehaviour */, \"\".concat(errorPrefix, \" not an object\"));\n }\n return process;\n}\n\nfunction getProductSub() {\n var productSub = navigator.productSub;\n if (productSub === undefined) {\n throw new BotdError(-1 /* State.Undefined */, 'navigator.productSub is undefined');\n }\n return productSub;\n}\n\nfunction getRTT() {\n if (navigator.connection === undefined) {\n throw new BotdError(-1 /* State.Undefined */, 'navigator.connection is undefined');\n }\n if (navigator.connection.rtt === undefined) {\n throw new BotdError(-1 /* State.Undefined */, 'navigator.connection.rtt is undefined');\n }\n return navigator.connection.rtt;\n}\n\nfunction getUserAgent() {\n return navigator.userAgent;\n}\n\nfunction getWebDriver() {\n if (navigator.webdriver == undefined) {\n throw new BotdError(-1 /* State.Undefined */, 'navigator.webdriver is undefined');\n }\n return navigator.webdriver;\n}\n\nfunction getWebGL() {\n var canvasElement = document.createElement('canvas');\n if (typeof canvasElement.getContext !== 'function') {\n throw new BotdError(-2 /* State.NotFunction */, 'HTMLCanvasElement.getContext is not a function');\n }\n var webGLContext = canvasElement.getContext('webgl');\n if (webGLContext === null) {\n throw new BotdError(-4 /* State.Null */, 'WebGLRenderingContext is null');\n }\n if (typeof webGLContext.getParameter !== 'function') {\n throw new BotdError(-2 /* State.NotFunction */, 'WebGLRenderingContext.getParameter is not a function');\n }\n var vendor = webGLContext.getParameter(webGLContext.VENDOR);\n var renderer = webGLContext.getParameter(webGLContext.RENDERER);\n return { vendor: vendor, renderer: renderer };\n}\n\nfunction getWindowExternal() {\n if (window.external === undefined) {\n throw new BotdError(-1 /* State.Undefined */, 'window.external is undefined');\n }\n var external = window.external;\n if (typeof external.toString !== 'function') {\n throw new BotdError(-2 /* State.NotFunction */, 'window.external.toString is not a function');\n }\n return external.toString();\n}\n\nfunction getWindowSize() {\n return {\n outerWidth: window.outerWidth,\n outerHeight: window.outerHeight,\n innerWidth: window.innerWidth,\n innerHeight: window.innerHeight,\n };\n}\n\nfunction checkDistinctiveProperties() {\n var _a;\n // The order in the following list matters, because specific types of bots come first, followed by automation technologies.\n var distinctivePropsList = (_a = {},\n _a[BotKind.Awesomium] = {\n window: ['awesomium'],\n },\n _a[BotKind.Cef] = {\n window: ['RunPerfTest'],\n },\n _a[BotKind.CefSharp] = {\n window: ['CefSharp'],\n },\n _a[BotKind.CoachJS] = {\n window: ['emit'],\n },\n _a[BotKind.FMiner] = {\n window: ['fmget_targets'],\n },\n _a[BotKind.Geb] = {\n window: ['geb'],\n },\n _a[BotKind.NightmareJS] = {\n window: ['__nightmare', 'nightmare'],\n },\n _a[BotKind.Phantomas] = {\n window: ['__phantomas'],\n },\n _a[BotKind.PhantomJS] = {\n window: ['callPhantom', '_phantom'],\n },\n _a[BotKind.Rhino] = {\n window: ['spawn'],\n },\n _a[BotKind.Selenium] = {\n window: ['_Selenium_IDE_Recorder', '_selenium', 'calledSelenium', /^([a-z]){3}_.*_(Array|Promise|Symbol)$/],\n document: ['__selenium_evaluate', 'selenium-evaluate', '__selenium_unwrapped'],\n },\n _a[BotKind.WebDriverIO] = {\n window: ['wdioElectron'],\n },\n _a[BotKind.WebDriver] = {\n window: [\n 'webdriver',\n '__webdriverFunc',\n '__lastWatirAlert',\n '__lastWatirConfirm',\n '__lastWatirPrompt',\n '_WEBDRIVER_ELEM_CACHE',\n 'ChromeDriverw',\n ],\n document: [\n '__webdriver_script_fn',\n '__driver_evaluate',\n '__webdriver_evaluate',\n '__fxdriver_evaluate',\n '__driver_unwrapped',\n '__webdriver_unwrapped',\n '__fxdriver_unwrapped',\n '__webdriver_script_fn',\n '__webdriver_script_func',\n '__webdriver_script_function',\n '$cdc_asdjflasutopfhvcZLmcf',\n '$cdc_asdjflasutopfhvcZLmcfl_',\n '$chrome_asyncScriptInfo',\n '__$webdriverAsyncExecutor',\n ],\n },\n _a[BotKind.HeadlessChrome] = {\n window: ['domAutomation', 'domAutomationController'],\n },\n _a);\n var botName;\n var result = {};\n var windowProps = getObjectProps(window);\n var documentProps = [];\n if (window.document !== undefined)\n documentProps = getObjectProps(window.document);\n for (botName in distinctivePropsList) {\n var props = distinctivePropsList[botName];\n if (props !== undefined) {\n var windowContains = props.window === undefined ? false : includes.apply(void 0, __spreadArray([windowProps], props.window, false));\n var documentContains = props.document === undefined || !documentProps.length ? false : includes.apply(void 0, __spreadArray([documentProps], props.document, false));\n result[botName] = windowContains || documentContains;\n }\n }\n return result;\n}\n\nvar sources = {\n android: isAndroid,\n browserKind: getBrowserKind,\n browserEngineKind: getBrowserEngineKind,\n documentFocus: getDocumentFocus,\n userAgent: getUserAgent,\n appVersion: getAppVersion,\n rtt: getRTT,\n windowSize: getWindowSize,\n pluginsLength: getPluginsLength,\n pluginsArray: getPluginsArray,\n errorTrace: getErrorTrace,\n productSub: getProductSub,\n windowExternal: getWindowExternal,\n mimeTypesConsistent: areMimeTypesConsistent,\n evalLength: getEvalLength,\n webGL: getWebGL,\n webDriver: getWebDriver,\n languages: getLanguages,\n notificationPermissions: getNotificationPermissions,\n documentElementKeys: getDocumentElementKeys,\n functionBind: getFunctionBind,\n process: getProcess,\n distinctiveProps: checkDistinctiveProperties,\n};\n\n/**\n * Class representing a bot detector.\n *\n * @class\n * @implements {BotDetectorInterface}\n */\nvar BotDetector = /** @class */ (function () {\n function BotDetector() {\n this.components = undefined;\n this.detections = undefined;\n }\n BotDetector.prototype.getComponents = function () {\n return this.components;\n };\n BotDetector.prototype.getDetections = function () {\n return this.detections;\n };\n /**\n * @inheritdoc\n */\n BotDetector.prototype.detect = function () {\n if (this.components === undefined) {\n throw new Error(\"BotDetector.detect can't be called before BotDetector.collect\");\n }\n var _a = detect(this.components, detectors), detections = _a[0], finalDetection = _a[1];\n this.detections = detections;\n return finalDetection;\n };\n /**\n * @inheritdoc\n */\n BotDetector.prototype.collect = function () {\n return __awaiter(this, void 0, void 0, function () {\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this;\n return [4 /*yield*/, collect(sources)];\n case 1:\n _a.components = _b.sent();\n return [2 /*return*/, this.components];\n }\n });\n });\n };\n return BotDetector;\n}());\n\n/**\n * Sends an unpersonalized AJAX request to collect installation statistics\n */\nfunction monitor() {\n // The FingerprintJS CDN (https://github.com/fingerprintjs/cdn) replaces `window.__fpjs_d_m` with `true`\n if (window.__fpjs_d_m || Math.random() >= 0.001) {\n return;\n }\n try {\n var request = new XMLHttpRequest();\n request.open('get', \"https://m1.openfpcdn.io/botd/v\".concat(version, \"/npm-monitoring\"), true);\n request.send();\n }\n catch (error) {\n // console.error is ok here because it's an unexpected error handler\n // eslint-disable-next-line no-console\n console.error(error);\n }\n}\nfunction load(_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.monitoring, monitoring = _c === void 0 ? true : _c;\n return __awaiter(this, void 0, void 0, function () {\n var detector;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n if (monitoring) {\n monitor();\n }\n detector = new BotDetector();\n return [4 /*yield*/, detector.collect()];\n case 1:\n _d.sent();\n return [2 /*return*/, detector];\n }\n });\n });\n}\nvar index = { load: load };\n\nexport { BotKind, BotdError, collect, index as default, detect, detectors, load, sources };\n","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","let toSJISFunction\nconst CODEWORDS_COUNT = [\n 0, // Not used\n 26, 44, 70, 100, 134, 172, 196, 242, 292, 346,\n 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085,\n 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185,\n 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706\n]\n\n/**\n * Returns the QR Code size for the specified version\n *\n * @param {Number} version QR Code version\n * @return {Number} size of QR code\n */\nexports.getSymbolSize = function getSymbolSize (version) {\n if (!version) throw new Error('\"version\" cannot be null or undefined')\n if (version < 1 || version > 40) throw new Error('\"version\" should be in range from 1 to 40')\n return version * 4 + 17\n}\n\n/**\n * Returns the total number of codewords used to store data and EC information.\n *\n * @param {Number} version QR Code version\n * @return {Number} Data length in bits\n */\nexports.getSymbolTotalCodewords = function getSymbolTotalCodewords (version) {\n return CODEWORDS_COUNT[version]\n}\n\n/**\n * Encode data with Bose-Chaudhuri-Hocquenghem\n *\n * @param {Number} data Value to encode\n * @return {Number} Encoded value\n */\nexports.getBCHDigit = function (data) {\n let digit = 0\n\n while (data !== 0) {\n digit++\n data >>>= 1\n }\n\n return digit\n}\n\nexports.setToSJISFunction = function setToSJISFunction (f) {\n if (typeof f !== 'function') {\n throw new Error('\"toSJISFunc\" is not a valid function.')\n }\n\n toSJISFunction = f\n}\n\nexports.isKanjiModeEnabled = function () {\n return typeof toSJISFunction !== 'undefined'\n}\n\nexports.toSJIS = function toSJIS (kanji) {\n return toSJISFunction(kanji)\n}\n","function BitBuffer () {\n this.buffer = []\n this.length = 0\n}\n\nBitBuffer.prototype = {\n\n get: function (index) {\n const bufIndex = Math.floor(index / 8)\n return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) === 1\n },\n\n put: function (num, length) {\n for (let i = 0; i < length; i++) {\n this.putBit(((num >>> (length - i - 1)) & 1) === 1)\n }\n },\n\n getLengthInBits: function () {\n return this.length\n },\n\n putBit: function (bit) {\n const bufIndex = Math.floor(this.length / 8)\n if (this.buffer.length <= bufIndex) {\n this.buffer.push(0)\n }\n\n if (bit) {\n this.buffer[bufIndex] |= (0x80 >>> (this.length % 8))\n }\n\n this.length++\n }\n}\n\nmodule.exports = BitBuffer\n","exports.L = { bit: 1 }\nexports.M = { bit: 0 }\nexports.Q = { bit: 3 }\nexports.H = { bit: 2 }\n\nfunction fromString (string) {\n if (typeof string !== 'string') {\n throw new Error('Param is not a string')\n }\n\n const lcStr = string.toLowerCase()\n\n switch (lcStr) {\n case 'l':\n case 'low':\n return exports.L\n\n case 'm':\n case 'medium':\n return exports.M\n\n case 'q':\n case 'quartile':\n return exports.Q\n\n case 'h':\n case 'high':\n return exports.H\n\n default:\n throw new Error('Unknown EC Level: ' + string)\n }\n}\n\nexports.isValid = function isValid (level) {\n return level && typeof level.bit !== 'undefined' &&\n level.bit >= 0 && level.bit < 4\n}\n\nexports.from = function from (value, defaultValue) {\n if (exports.isValid(value)) {\n return value\n }\n\n try {\n return fromString(value)\n } catch (e) {\n return defaultValue\n }\n}\n","/**\n * Helper class to handle QR Code symbol modules\n *\n * @param {Number} size Symbol size\n */\nfunction BitMatrix (size) {\n if (!size || size < 1) {\n throw new Error('BitMatrix size must be defined and greater than 0')\n }\n\n this.size = size\n this.data = new Uint8Array(size * size)\n this.reservedBit = new Uint8Array(size * size)\n}\n\n/**\n * Set bit value at specified location\n * If reserved flag is set, this bit will be ignored during masking process\n *\n * @param {Number} row\n * @param {Number} col\n * @param {Boolean} value\n * @param {Boolean} reserved\n */\nBitMatrix.prototype.set = function (row, col, value, reserved) {\n const index = row * this.size + col\n this.data[index] = value\n if (reserved) this.reservedBit[index] = true\n}\n\n/**\n * Returns bit value at specified location\n *\n * @param {Number} row\n * @param {Number} col\n * @return {Boolean}\n */\nBitMatrix.prototype.get = function (row, col) {\n return this.data[row * this.size + col]\n}\n\n/**\n * Applies xor operator at specified location\n * (used during masking process)\n *\n * @param {Number} row\n * @param {Number} col\n * @param {Boolean} value\n */\nBitMatrix.prototype.xor = function (row, col, value) {\n this.data[row * this.size + col] ^= value\n}\n\n/**\n * Check if bit at specified location is reserved\n *\n * @param {Number} row\n * @param {Number} col\n * @return {Boolean}\n */\nBitMatrix.prototype.isReserved = function (row, col) {\n return this.reservedBit[row * this.size + col]\n}\n\nmodule.exports = BitMatrix\n","/**\n * Alignment pattern are fixed reference pattern in defined positions\n * in a matrix symbology, which enables the decode software to re-synchronise\n * the coordinate mapping of the image modules in the event of moderate amounts\n * of distortion of the image.\n *\n * Alignment patterns are present only in QR Code symbols of version 2 or larger\n * and their number depends on the symbol version.\n */\n\nconst getSymbolSize = require('./utils').getSymbolSize\n\n/**\n * Calculate the row/column coordinates of the center module of each alignment pattern\n * for the specified QR Code version.\n *\n * The alignment patterns are positioned symmetrically on either side of the diagonal\n * running from the top left corner of the symbol to the bottom right corner.\n *\n * Since positions are simmetrical only half of the coordinates are returned.\n * Each item of the array will represent in turn the x and y coordinate.\n * @see {@link getPositions}\n *\n * @param {Number} version QR Code version\n * @return {Array} Array of coordinate\n */\nexports.getRowColCoords = function getRowColCoords (version) {\n if (version === 1) return []\n\n const posCount = Math.floor(version / 7) + 2\n const size = getSymbolSize(version)\n const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2\n const positions = [size - 7] // Last coord is always (size - 7)\n\n for (let i = 1; i < posCount - 1; i++) {\n positions[i] = positions[i - 1] - intervals\n }\n\n positions.push(6) // First coord is always 6\n\n return positions.reverse()\n}\n\n/**\n * Returns an array containing the positions of each alignment pattern.\n * Each array's element represent the center point of the pattern as (x, y) coordinates\n *\n * Coordinates are calculated expanding the row/column coordinates returned by {@link getRowColCoords}\n * and filtering out the items that overlaps with finder pattern\n *\n * @example\n * For a Version 7 symbol {@link getRowColCoords} returns values 6, 22 and 38.\n * The alignment patterns, therefore, are to be centered on (row, column)\n * positions (6,22), (22,6), (22,22), (22,38), (38,22), (38,38).\n * Note that the coordinates (6,6), (6,38), (38,6) are occupied by finder patterns\n * and are not therefore used for alignment patterns.\n *\n * let pos = getPositions(7)\n * // [[6,22], [22,6], [22,22], [22,38], [38,22], [38,38]]\n *\n * @param {Number} version QR Code version\n * @return {Array} Array of coordinates\n */\nexports.getPositions = function getPositions (version) {\n const coords = []\n const pos = exports.getRowColCoords(version)\n const posLength = pos.length\n\n for (let i = 0; i < posLength; i++) {\n for (let j = 0; j < posLength; j++) {\n // Skip if position is occupied by finder patterns\n if ((i === 0 && j === 0) || // top-left\n (i === 0 && j === posLength - 1) || // bottom-left\n (i === posLength - 1 && j === 0)) { // top-right\n continue\n }\n\n coords.push([pos[i], pos[j]])\n }\n }\n\n return coords\n}\n","const getSymbolSize = require('./utils').getSymbolSize\nconst FINDER_PATTERN_SIZE = 7\n\n/**\n * Returns an array containing the positions of each finder pattern.\n * Each array's element represent the top-left point of the pattern as (x, y) coordinates\n *\n * @param {Number} version QR Code version\n * @return {Array} Array of coordinates\n */\nexports.getPositions = function getPositions (version) {\n const size = getSymbolSize(version)\n\n return [\n // top-left\n [0, 0],\n // top-right\n [size - FINDER_PATTERN_SIZE, 0],\n // bottom-left\n [0, size - FINDER_PATTERN_SIZE]\n ]\n}\n","/**\n * Data mask pattern reference\n * @type {Object}\n */\nexports.Patterns = {\n PATTERN000: 0,\n PATTERN001: 1,\n PATTERN010: 2,\n PATTERN011: 3,\n PATTERN100: 4,\n PATTERN101: 5,\n PATTERN110: 6,\n PATTERN111: 7\n}\n\n/**\n * Weighted penalty scores for the undesirable features\n * @type {Object}\n */\nconst PenaltyScores = {\n N1: 3,\n N2: 3,\n N3: 40,\n N4: 10\n}\n\n/**\n * Check if mask pattern value is valid\n *\n * @param {Number} mask Mask pattern\n * @return {Boolean} true if valid, false otherwise\n */\nexports.isValid = function isValid (mask) {\n return mask != null && mask !== '' && !isNaN(mask) && mask >= 0 && mask <= 7\n}\n\n/**\n * Returns mask pattern from a value.\n * If value is not valid, returns undefined\n *\n * @param {Number|String} value Mask pattern value\n * @return {Number} Valid mask pattern or undefined\n */\nexports.from = function from (value) {\n return exports.isValid(value) ? parseInt(value, 10) : undefined\n}\n\n/**\n* Find adjacent modules in row/column with the same color\n* and assign a penalty value.\n*\n* Points: N1 + i\n* i is the amount by which the number of adjacent modules of the same color exceeds 5\n*/\nexports.getPenaltyN1 = function getPenaltyN1 (data) {\n const size = data.size\n let points = 0\n let sameCountCol = 0\n let sameCountRow = 0\n let lastCol = null\n let lastRow = null\n\n for (let row = 0; row < size; row++) {\n sameCountCol = sameCountRow = 0\n lastCol = lastRow = null\n\n for (let col = 0; col < size; col++) {\n let module = data.get(row, col)\n if (module === lastCol) {\n sameCountCol++\n } else {\n if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)\n lastCol = module\n sameCountCol = 1\n }\n\n module = data.get(col, row)\n if (module === lastRow) {\n sameCountRow++\n } else {\n if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)\n lastRow = module\n sameCountRow = 1\n }\n }\n\n if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)\n if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)\n }\n\n return points\n}\n\n/**\n * Find 2x2 blocks with the same color and assign a penalty value\n *\n * Points: N2 * (m - 1) * (n - 1)\n */\nexports.getPenaltyN2 = function getPenaltyN2 (data) {\n const size = data.size\n let points = 0\n\n for (let row = 0; row < size - 1; row++) {\n for (let col = 0; col < size - 1; col++) {\n const last = data.get(row, col) +\n data.get(row, col + 1) +\n data.get(row + 1, col) +\n data.get(row + 1, col + 1)\n\n if (last === 4 || last === 0) points++\n }\n }\n\n return points * PenaltyScores.N2\n}\n\n/**\n * Find 1:1:3:1:1 ratio (dark:light:dark:light:dark) pattern in row/column,\n * preceded or followed by light area 4 modules wide\n *\n * Points: N3 * number of pattern found\n */\nexports.getPenaltyN3 = function getPenaltyN3 (data) {\n const size = data.size\n let points = 0\n let bitsCol = 0\n let bitsRow = 0\n\n for (let row = 0; row < size; row++) {\n bitsCol = bitsRow = 0\n for (let col = 0; col < size; col++) {\n bitsCol = ((bitsCol << 1) & 0x7FF) | data.get(row, col)\n if (col >= 10 && (bitsCol === 0x5D0 || bitsCol === 0x05D)) points++\n\n bitsRow = ((bitsRow << 1) & 0x7FF) | data.get(col, row)\n if (col >= 10 && (bitsRow === 0x5D0 || bitsRow === 0x05D)) points++\n }\n }\n\n return points * PenaltyScores.N3\n}\n\n/**\n * Calculate proportion of dark modules in entire symbol\n *\n * Points: N4 * k\n *\n * k is the rating of the deviation of the proportion of dark modules\n * in the symbol from 50% in steps of 5%\n */\nexports.getPenaltyN4 = function getPenaltyN4 (data) {\n let darkCount = 0\n const modulesCount = data.data.length\n\n for (let i = 0; i < modulesCount; i++) darkCount += data.data[i]\n\n const k = Math.abs(Math.ceil((darkCount * 100 / modulesCount) / 5) - 10)\n\n return k * PenaltyScores.N4\n}\n\n/**\n * Return mask value at given position\n *\n * @param {Number} maskPattern Pattern reference value\n * @param {Number} i Row\n * @param {Number} j Column\n * @return {Boolean} Mask value\n */\nfunction getMaskAt (maskPattern, i, j) {\n switch (maskPattern) {\n case exports.Patterns.PATTERN000: return (i + j) % 2 === 0\n case exports.Patterns.PATTERN001: return i % 2 === 0\n case exports.Patterns.PATTERN010: return j % 3 === 0\n case exports.Patterns.PATTERN011: return (i + j) % 3 === 0\n case exports.Patterns.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0\n case exports.Patterns.PATTERN101: return (i * j) % 2 + (i * j) % 3 === 0\n case exports.Patterns.PATTERN110: return ((i * j) % 2 + (i * j) % 3) % 2 === 0\n case exports.Patterns.PATTERN111: return ((i * j) % 3 + (i + j) % 2) % 2 === 0\n\n default: throw new Error('bad maskPattern:' + maskPattern)\n }\n}\n\n/**\n * Apply a mask pattern to a BitMatrix\n *\n * @param {Number} pattern Pattern reference number\n * @param {BitMatrix} data BitMatrix data\n */\nexports.applyMask = function applyMask (pattern, data) {\n const size = data.size\n\n for (let col = 0; col < size; col++) {\n for (let row = 0; row < size; row++) {\n if (data.isReserved(row, col)) continue\n data.xor(row, col, getMaskAt(pattern, row, col))\n }\n }\n}\n\n/**\n * Returns the best mask pattern for data\n *\n * @param {BitMatrix} data\n * @return {Number} Mask pattern reference number\n */\nexports.getBestMask = function getBestMask (data, setupFormatFunc) {\n const numPatterns = Object.keys(exports.Patterns).length\n let bestPattern = 0\n let lowerPenalty = Infinity\n\n for (let p = 0; p < numPatterns; p++) {\n setupFormatFunc(p)\n exports.applyMask(p, data)\n\n // Calculate penalty\n const penalty =\n exports.getPenaltyN1(data) +\n exports.getPenaltyN2(data) +\n exports.getPenaltyN3(data) +\n exports.getPenaltyN4(data)\n\n // Undo previously applied mask\n exports.applyMask(p, data)\n\n if (penalty < lowerPenalty) {\n lowerPenalty = penalty\n bestPattern = p\n }\n }\n\n return bestPattern\n}\n","const ECLevel = require('./error-correction-level')\r\n\r\nconst EC_BLOCKS_TABLE = [\r\n// L M Q H\r\n 1, 1, 1, 1,\r\n 1, 1, 1, 1,\r\n 1, 1, 2, 2,\r\n 1, 2, 2, 4,\r\n 1, 2, 4, 4,\r\n 2, 4, 4, 4,\r\n 2, 4, 6, 5,\r\n 2, 4, 6, 6,\r\n 2, 5, 8, 8,\r\n 4, 5, 8, 8,\r\n 4, 5, 8, 11,\r\n 4, 8, 10, 11,\r\n 4, 9, 12, 16,\r\n 4, 9, 16, 16,\r\n 6, 10, 12, 18,\r\n 6, 10, 17, 16,\r\n 6, 11, 16, 19,\r\n 6, 13, 18, 21,\r\n 7, 14, 21, 25,\r\n 8, 16, 20, 25,\r\n 8, 17, 23, 25,\r\n 9, 17, 23, 34,\r\n 9, 18, 25, 30,\r\n 10, 20, 27, 32,\r\n 12, 21, 29, 35,\r\n 12, 23, 34, 37,\r\n 12, 25, 34, 40,\r\n 13, 26, 35, 42,\r\n 14, 28, 38, 45,\r\n 15, 29, 40, 48,\r\n 16, 31, 43, 51,\r\n 17, 33, 45, 54,\r\n 18, 35, 48, 57,\r\n 19, 37, 51, 60,\r\n 19, 38, 53, 63,\r\n 20, 40, 56, 66,\r\n 21, 43, 59, 70,\r\n 22, 45, 62, 74,\r\n 24, 47, 65, 77,\r\n 25, 49, 68, 81\r\n]\r\n\r\nconst EC_CODEWORDS_TABLE = [\r\n// L M Q H\r\n 7, 10, 13, 17,\r\n 10, 16, 22, 28,\r\n 15, 26, 36, 44,\r\n 20, 36, 52, 64,\r\n 26, 48, 72, 88,\r\n 36, 64, 96, 112,\r\n 40, 72, 108, 130,\r\n 48, 88, 132, 156,\r\n 60, 110, 160, 192,\r\n 72, 130, 192, 224,\r\n 80, 150, 224, 264,\r\n 96, 176, 260, 308,\r\n 104, 198, 288, 352,\r\n 120, 216, 320, 384,\r\n 132, 240, 360, 432,\r\n 144, 280, 408, 480,\r\n 168, 308, 448, 532,\r\n 180, 338, 504, 588,\r\n 196, 364, 546, 650,\r\n 224, 416, 600, 700,\r\n 224, 442, 644, 750,\r\n 252, 476, 690, 816,\r\n 270, 504, 750, 900,\r\n 300, 560, 810, 960,\r\n 312, 588, 870, 1050,\r\n 336, 644, 952, 1110,\r\n 360, 700, 1020, 1200,\r\n 390, 728, 1050, 1260,\r\n 420, 784, 1140, 1350,\r\n 450, 812, 1200, 1440,\r\n 480, 868, 1290, 1530,\r\n 510, 924, 1350, 1620,\r\n 540, 980, 1440, 1710,\r\n 570, 1036, 1530, 1800,\r\n 570, 1064, 1590, 1890,\r\n 600, 1120, 1680, 1980,\r\n 630, 1204, 1770, 2100,\r\n 660, 1260, 1860, 2220,\r\n 720, 1316, 1950, 2310,\r\n 750, 1372, 2040, 2430\r\n]\r\n\r\n/**\r\n * Returns the number of error correction block that the QR Code should contain\r\n * for the specified version and error correction level.\r\n *\r\n * @param {Number} version QR Code version\r\n * @param {Number} errorCorrectionLevel Error correction level\r\n * @return {Number} Number of error correction blocks\r\n */\r\nexports.getBlocksCount = function getBlocksCount (version, errorCorrectionLevel) {\r\n switch (errorCorrectionLevel) {\r\n case ECLevel.L:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 0]\r\n case ECLevel.M:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 1]\r\n case ECLevel.Q:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 2]\r\n case ECLevel.H:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 3]\r\n default:\r\n return undefined\r\n }\r\n}\r\n\r\n/**\r\n * Returns the number of error correction codewords to use for the specified\r\n * version and error correction level.\r\n *\r\n * @param {Number} version QR Code version\r\n * @param {Number} errorCorrectionLevel Error correction level\r\n * @return {Number} Number of error correction codewords\r\n */\r\nexports.getTotalCodewordsCount = function getTotalCodewordsCount (version, errorCorrectionLevel) {\r\n switch (errorCorrectionLevel) {\r\n case ECLevel.L:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 0]\r\n case ECLevel.M:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 1]\r\n case ECLevel.Q:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 2]\r\n case ECLevel.H:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 3]\r\n default:\r\n return undefined\r\n }\r\n}\r\n","const EXP_TABLE = new Uint8Array(512)\nconst LOG_TABLE = new Uint8Array(256)\n/**\n * Precompute the log and anti-log tables for faster computation later\n *\n * For each possible value in the galois field 2^8, we will pre-compute\n * the logarithm and anti-logarithm (exponential) of this value\n *\n * ref {@link https://en.wikiversity.org/wiki/Reed%E2%80%93Solomon_codes_for_coders#Introduction_to_mathematical_fields}\n */\n;(function initTables () {\n let x = 1\n for (let i = 0; i < 255; i++) {\n EXP_TABLE[i] = x\n LOG_TABLE[x] = i\n\n x <<= 1 // multiply by 2\n\n // The QR code specification says to use byte-wise modulo 100011101 arithmetic.\n // This means that when a number is 256 or larger, it should be XORed with 0x11D.\n if (x & 0x100) { // similar to x >= 256, but a lot faster (because 0x100 == 256)\n x ^= 0x11D\n }\n }\n\n // Optimization: double the size of the anti-log table so that we don't need to mod 255 to\n // stay inside the bounds (because we will mainly use this table for the multiplication of\n // two GF numbers, no more).\n // @see {@link mul}\n for (let i = 255; i < 512; i++) {\n EXP_TABLE[i] = EXP_TABLE[i - 255]\n }\n}())\n\n/**\n * Returns log value of n inside Galois Field\n *\n * @param {Number} n\n * @return {Number}\n */\nexports.log = function log (n) {\n if (n < 1) throw new Error('log(' + n + ')')\n return LOG_TABLE[n]\n}\n\n/**\n * Returns anti-log value of n inside Galois Field\n *\n * @param {Number} n\n * @return {Number}\n */\nexports.exp = function exp (n) {\n return EXP_TABLE[n]\n}\n\n/**\n * Multiplies two number inside Galois Field\n *\n * @param {Number} x\n * @param {Number} y\n * @return {Number}\n */\nexports.mul = function mul (x, y) {\n if (x === 0 || y === 0) return 0\n\n // should be EXP_TABLE[(LOG_TABLE[x] + LOG_TABLE[y]) % 255] if EXP_TABLE wasn't oversized\n // @see {@link initTables}\n return EXP_TABLE[LOG_TABLE[x] + LOG_TABLE[y]]\n}\n","const GF = require('./galois-field')\n\n/**\n * Multiplies two polynomials inside Galois Field\n *\n * @param {Uint8Array} p1 Polynomial\n * @param {Uint8Array} p2 Polynomial\n * @return {Uint8Array} Product of p1 and p2\n */\nexports.mul = function mul (p1, p2) {\n const coeff = new Uint8Array(p1.length + p2.length - 1)\n\n for (let i = 0; i < p1.length; i++) {\n for (let j = 0; j < p2.length; j++) {\n coeff[i + j] ^= GF.mul(p1[i], p2[j])\n }\n }\n\n return coeff\n}\n\n/**\n * Calculate the remainder of polynomials division\n *\n * @param {Uint8Array} divident Polynomial\n * @param {Uint8Array} divisor Polynomial\n * @return {Uint8Array} Remainder\n */\nexports.mod = function mod (divident, divisor) {\n let result = new Uint8Array(divident)\n\n while ((result.length - divisor.length) >= 0) {\n const coeff = result[0]\n\n for (let i = 0; i < divisor.length; i++) {\n result[i] ^= GF.mul(divisor[i], coeff)\n }\n\n // remove all zeros from buffer head\n let offset = 0\n while (offset < result.length && result[offset] === 0) offset++\n result = result.slice(offset)\n }\n\n return result\n}\n\n/**\n * Generate an irreducible generator polynomial of specified degree\n * (used by Reed-Solomon encoder)\n *\n * @param {Number} degree Degree of the generator polynomial\n * @return {Uint8Array} Buffer containing polynomial coefficients\n */\nexports.generateECPolynomial = function generateECPolynomial (degree) {\n let poly = new Uint8Array([1])\n for (let i = 0; i < degree; i++) {\n poly = exports.mul(poly, new Uint8Array([1, GF.exp(i)]))\n }\n\n return poly\n}\n","const Polynomial = require('./polynomial')\n\nfunction ReedSolomonEncoder (degree) {\n this.genPoly = undefined\n this.degree = degree\n\n if (this.degree) this.initialize(this.degree)\n}\n\n/**\n * Initialize the encoder.\n * The input param should correspond to the number of error correction codewords.\n *\n * @param {Number} degree\n */\nReedSolomonEncoder.prototype.initialize = function initialize (degree) {\n // create an irreducible generator polynomial\n this.degree = degree\n this.genPoly = Polynomial.generateECPolynomial(this.degree)\n}\n\n/**\n * Encodes a chunk of data\n *\n * @param {Uint8Array} data Buffer containing input data\n * @return {Uint8Array} Buffer containing encoded data\n */\nReedSolomonEncoder.prototype.encode = function encode (data) {\n if (!this.genPoly) {\n throw new Error('Encoder not initialized')\n }\n\n // Calculate EC for this data block\n // extends data size to data+genPoly size\n const paddedData = new Uint8Array(data.length + this.degree)\n paddedData.set(data)\n\n // The error correction codewords are the remainder after dividing the data codewords\n // by a generator polynomial\n const remainder = Polynomial.mod(paddedData, this.genPoly)\n\n // return EC data blocks (last n byte, where n is the degree of genPoly)\n // If coefficients number in remainder are less than genPoly degree,\n // pad with 0s to the left to reach the needed number of coefficients\n const start = this.degree - remainder.length\n if (start > 0) {\n const buff = new Uint8Array(this.degree)\n buff.set(remainder, start)\n\n return buff\n }\n\n return remainder\n}\n\nmodule.exports = ReedSolomonEncoder\n","/**\n * Check if QR Code version is valid\n *\n * @param {Number} version QR Code version\n * @return {Boolean} true if valid version, false otherwise\n */\nexports.isValid = function isValid (version) {\n return !isNaN(version) && version >= 1 && version <= 40\n}\n","const numeric = '[0-9]+'\nconst alphanumeric = '[A-Z $%*+\\\\-./:]+'\nlet kanji = '(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|' +\n '[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|' +\n '[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|' +\n '[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+'\nkanji = kanji.replace(/u/g, '\\\\u')\n\nconst byte = '(?:(?![A-Z0-9 $%*+\\\\-./:]|' + kanji + ')(?:.|[\\r\\n]))+'\n\nexports.KANJI = new RegExp(kanji, 'g')\nexports.BYTE_KANJI = new RegExp('[^A-Z0-9 $%*+\\\\-./:]+', 'g')\nexports.BYTE = new RegExp(byte, 'g')\nexports.NUMERIC = new RegExp(numeric, 'g')\nexports.ALPHANUMERIC = new RegExp(alphanumeric, 'g')\n\nconst TEST_KANJI = new RegExp('^' + kanji + '$')\nconst TEST_NUMERIC = new RegExp('^' + numeric + '$')\nconst TEST_ALPHANUMERIC = new RegExp('^[A-Z0-9 $%*+\\\\-./:]+$')\n\nexports.testKanji = function testKanji (str) {\n return TEST_KANJI.test(str)\n}\n\nexports.testNumeric = function testNumeric (str) {\n return TEST_NUMERIC.test(str)\n}\n\nexports.testAlphanumeric = function testAlphanumeric (str) {\n return TEST_ALPHANUMERIC.test(str)\n}\n","const VersionCheck = require('./version-check')\nconst Regex = require('./regex')\n\n/**\n * Numeric mode encodes data from the decimal digit set (0 - 9)\n * (byte values 30HEX to 39HEX).\n * Normally, 3 data characters are represented by 10 bits.\n *\n * @type {Object}\n */\nexports.NUMERIC = {\n id: 'Numeric',\n bit: 1 << 0,\n ccBits: [10, 12, 14]\n}\n\n/**\n * Alphanumeric mode encodes data from a set of 45 characters,\n * i.e. 10 numeric digits (0 - 9),\n * 26 alphabetic characters (A - Z),\n * and 9 symbols (SP, $, %, *, +, -, ., /, :).\n * Normally, two input characters are represented by 11 bits.\n *\n * @type {Object}\n */\nexports.ALPHANUMERIC = {\n id: 'Alphanumeric',\n bit: 1 << 1,\n ccBits: [9, 11, 13]\n}\n\n/**\n * In byte mode, data is encoded at 8 bits per character.\n *\n * @type {Object}\n */\nexports.BYTE = {\n id: 'Byte',\n bit: 1 << 2,\n ccBits: [8, 16, 16]\n}\n\n/**\n * The Kanji mode efficiently encodes Kanji characters in accordance with\n * the Shift JIS system based on JIS X 0208.\n * The Shift JIS values are shifted from the JIS X 0208 values.\n * JIS X 0208 gives details of the shift coded representation.\n * Each two-byte character value is compacted to a 13-bit binary codeword.\n *\n * @type {Object}\n */\nexports.KANJI = {\n id: 'Kanji',\n bit: 1 << 3,\n ccBits: [8, 10, 12]\n}\n\n/**\n * Mixed mode will contain a sequences of data in a combination of any of\n * the modes described above\n *\n * @type {Object}\n */\nexports.MIXED = {\n bit: -1\n}\n\n/**\n * Returns the number of bits needed to store the data length\n * according to QR Code specifications.\n *\n * @param {Mode} mode Data mode\n * @param {Number} version QR Code version\n * @return {Number} Number of bits\n */\nexports.getCharCountIndicator = function getCharCountIndicator (mode, version) {\n if (!mode.ccBits) throw new Error('Invalid mode: ' + mode)\n\n if (!VersionCheck.isValid(version)) {\n throw new Error('Invalid version: ' + version)\n }\n\n if (version >= 1 && version < 10) return mode.ccBits[0]\n else if (version < 27) return mode.ccBits[1]\n return mode.ccBits[2]\n}\n\n/**\n * Returns the most efficient mode to store the specified data\n *\n * @param {String} dataStr Input data string\n * @return {Mode} Best mode\n */\nexports.getBestModeForData = function getBestModeForData (dataStr) {\n if (Regex.testNumeric(dataStr)) return exports.NUMERIC\n else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC\n else if (Regex.testKanji(dataStr)) return exports.KANJI\n else return exports.BYTE\n}\n\n/**\n * Return mode name as string\n *\n * @param {Mode} mode Mode object\n * @returns {String} Mode name\n */\nexports.toString = function toString (mode) {\n if (mode && mode.id) return mode.id\n throw new Error('Invalid mode')\n}\n\n/**\n * Check if input param is a valid mode object\n *\n * @param {Mode} mode Mode object\n * @returns {Boolean} True if valid mode, false otherwise\n */\nexports.isValid = function isValid (mode) {\n return mode && mode.bit && mode.ccBits\n}\n\n/**\n * Get mode object from its name\n *\n * @param {String} string Mode name\n * @returns {Mode} Mode object\n */\nfunction fromString (string) {\n if (typeof string !== 'string') {\n throw new Error('Param is not a string')\n }\n\n const lcStr = string.toLowerCase()\n\n switch (lcStr) {\n case 'numeric':\n return exports.NUMERIC\n case 'alphanumeric':\n return exports.ALPHANUMERIC\n case 'kanji':\n return exports.KANJI\n case 'byte':\n return exports.BYTE\n default:\n throw new Error('Unknown mode: ' + string)\n }\n}\n\n/**\n * Returns mode from a value.\n * If value is not a valid mode, returns defaultValue\n *\n * @param {Mode|String} value Encoding mode\n * @param {Mode} defaultValue Fallback value\n * @return {Mode} Encoding mode\n */\nexports.from = function from (value, defaultValue) {\n if (exports.isValid(value)) {\n return value\n }\n\n try {\n return fromString(value)\n } catch (e) {\n return defaultValue\n }\n}\n","const Utils = require('./utils')\nconst ECCode = require('./error-correction-code')\nconst ECLevel = require('./error-correction-level')\nconst Mode = require('./mode')\nconst VersionCheck = require('./version-check')\n\n// Generator polynomial used to encode version information\nconst G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)\nconst G18_BCH = Utils.getBCHDigit(G18)\n\nfunction getBestVersionForDataLength (mode, length, errorCorrectionLevel) {\n for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) {\n return currentVersion\n }\n }\n\n return undefined\n}\n\nfunction getReservedBitsCount (mode, version) {\n // Character count indicator + mode indicator bits\n return Mode.getCharCountIndicator(mode, version) + 4\n}\n\nfunction getTotalBitsFromDataArray (segments, version) {\n let totalBits = 0\n\n segments.forEach(function (data) {\n const reservedBits = getReservedBitsCount(data.mode, version)\n totalBits += reservedBits + data.getBitsLength()\n })\n\n return totalBits\n}\n\nfunction getBestVersionForMixedData (segments, errorCorrectionLevel) {\n for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n const length = getTotalBitsFromDataArray(segments, currentVersion)\n if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {\n return currentVersion\n }\n }\n\n return undefined\n}\n\n/**\n * Returns version number from a value.\n * If value is not a valid version, returns defaultValue\n *\n * @param {Number|String} value QR Code version\n * @param {Number} defaultValue Fallback value\n * @return {Number} QR Code version number\n */\nexports.from = function from (value, defaultValue) {\n if (VersionCheck.isValid(value)) {\n return parseInt(value, 10)\n }\n\n return defaultValue\n}\n\n/**\n * Returns how much data can be stored with the specified QR code version\n * and error correction level\n *\n * @param {Number} version QR Code version (1-40)\n * @param {Number} errorCorrectionLevel Error correction level\n * @param {Mode} mode Data mode\n * @return {Number} Quantity of storable data\n */\nexports.getCapacity = function getCapacity (version, errorCorrectionLevel, mode) {\n if (!VersionCheck.isValid(version)) {\n throw new Error('Invalid QR Code version')\n }\n\n // Use Byte mode as default\n if (typeof mode === 'undefined') mode = Mode.BYTE\n\n // Total codewords for this QR code version (Data + Error correction)\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n // Total number of error correction codewords\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n // Total number of data codewords\n const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n if (mode === Mode.MIXED) return dataTotalCodewordsBits\n\n const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version)\n\n // Return max number of storable codewords\n switch (mode) {\n case Mode.NUMERIC:\n return Math.floor((usableBits / 10) * 3)\n\n case Mode.ALPHANUMERIC:\n return Math.floor((usableBits / 11) * 2)\n\n case Mode.KANJI:\n return Math.floor(usableBits / 13)\n\n case Mode.BYTE:\n default:\n return Math.floor(usableBits / 8)\n }\n}\n\n/**\n * Returns the minimum version needed to contain the amount of data\n *\n * @param {Segment} data Segment of data\n * @param {Number} [errorCorrectionLevel=H] Error correction level\n * @param {Mode} mode Data mode\n * @return {Number} QR Code version\n */\nexports.getBestVersionForData = function getBestVersionForData (data, errorCorrectionLevel) {\n let seg\n\n const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M)\n\n if (Array.isArray(data)) {\n if (data.length > 1) {\n return getBestVersionForMixedData(data, ecl)\n }\n\n if (data.length === 0) {\n return 1\n }\n\n seg = data[0]\n } else {\n seg = data\n }\n\n return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl)\n}\n\n/**\n * Returns version information with relative error correction bits\n *\n * The version information is included in QR Code symbols of version 7 or larger.\n * It consists of an 18-bit sequence containing 6 data bits,\n * with 12 error correction bits calculated using the (18, 6) Golay code.\n *\n * @param {Number} version QR Code version\n * @return {Number} Encoded version info bits\n */\nexports.getEncodedBits = function getEncodedBits (version) {\n if (!VersionCheck.isValid(version) || version < 7) {\n throw new Error('Invalid QR Code version')\n }\n\n let d = version << 12\n\n while (Utils.getBCHDigit(d) - G18_BCH >= 0) {\n d ^= (G18 << (Utils.getBCHDigit(d) - G18_BCH))\n }\n\n return (version << 12) | d\n}\n","const Utils = require('./utils')\n\nconst G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0)\nconst G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1)\nconst G15_BCH = Utils.getBCHDigit(G15)\n\n/**\n * Returns format information with relative error correction bits\n *\n * The format information is a 15-bit sequence containing 5 data bits,\n * with 10 error correction bits calculated using the (15, 5) BCH code.\n *\n * @param {Number} errorCorrectionLevel Error correction level\n * @param {Number} mask Mask pattern\n * @return {Number} Encoded format information bits\n */\nexports.getEncodedBits = function getEncodedBits (errorCorrectionLevel, mask) {\n const data = ((errorCorrectionLevel.bit << 3) | mask)\n let d = data << 10\n\n while (Utils.getBCHDigit(d) - G15_BCH >= 0) {\n d ^= (G15 << (Utils.getBCHDigit(d) - G15_BCH))\n }\n\n // xor final data with mask pattern in order to ensure that\n // no combination of Error Correction Level and data mask pattern\n // will result in an all-zero data string\n return ((data << 10) | d) ^ G15_MASK\n}\n","const Mode = require('./mode')\n\nfunction NumericData (data) {\n this.mode = Mode.NUMERIC\n this.data = data.toString()\n}\n\nNumericData.getBitsLength = function getBitsLength (length) {\n return 10 * Math.floor(length / 3) + ((length % 3) ? ((length % 3) * 3 + 1) : 0)\n}\n\nNumericData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nNumericData.prototype.getBitsLength = function getBitsLength () {\n return NumericData.getBitsLength(this.data.length)\n}\n\nNumericData.prototype.write = function write (bitBuffer) {\n let i, group, value\n\n // The input data string is divided into groups of three digits,\n // and each group is converted to its 10-bit binary equivalent.\n for (i = 0; i + 3 <= this.data.length; i += 3) {\n group = this.data.substr(i, 3)\n value = parseInt(group, 10)\n\n bitBuffer.put(value, 10)\n }\n\n // If the number of input digits is not an exact multiple of three,\n // the final one or two digits are converted to 4 or 7 bits respectively.\n const remainingNum = this.data.length - i\n if (remainingNum > 0) {\n group = this.data.substr(i)\n value = parseInt(group, 10)\n\n bitBuffer.put(value, remainingNum * 3 + 1)\n }\n}\n\nmodule.exports = NumericData\n","const Mode = require('./mode')\n\n/**\n * Array of characters available in alphanumeric mode\n *\n * As per QR Code specification, to each character\n * is assigned a value from 0 to 44 which in this case coincides\n * with the array index\n *\n * @type {Array}\n */\nconst ALPHA_NUM_CHARS = [\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',\n ' ', '$', '%', '*', '+', '-', '.', '/', ':'\n]\n\nfunction AlphanumericData (data) {\n this.mode = Mode.ALPHANUMERIC\n this.data = data\n}\n\nAlphanumericData.getBitsLength = function getBitsLength (length) {\n return 11 * Math.floor(length / 2) + 6 * (length % 2)\n}\n\nAlphanumericData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nAlphanumericData.prototype.getBitsLength = function getBitsLength () {\n return AlphanumericData.getBitsLength(this.data.length)\n}\n\nAlphanumericData.prototype.write = function write (bitBuffer) {\n let i\n\n // Input data characters are divided into groups of two characters\n // and encoded as 11-bit binary codes.\n for (i = 0; i + 2 <= this.data.length; i += 2) {\n // The character value of the first character is multiplied by 45\n let value = ALPHA_NUM_CHARS.indexOf(this.data[i]) * 45\n\n // The character value of the second digit is added to the product\n value += ALPHA_NUM_CHARS.indexOf(this.data[i + 1])\n\n // The sum is then stored as 11-bit binary number\n bitBuffer.put(value, 11)\n }\n\n // If the number of input data characters is not a multiple of two,\n // the character value of the final character is encoded as a 6-bit binary number.\n if (this.data.length % 2) {\n bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i]), 6)\n }\n}\n\nmodule.exports = AlphanumericData\n","const encodeUtf8 = require('encode-utf8')\nconst Mode = require('./mode')\n\nfunction ByteData (data) {\n this.mode = Mode.BYTE\n if (typeof (data) === 'string') {\n data = encodeUtf8(data)\n }\n this.data = new Uint8Array(data)\n}\n\nByteData.getBitsLength = function getBitsLength (length) {\n return length * 8\n}\n\nByteData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nByteData.prototype.getBitsLength = function getBitsLength () {\n return ByteData.getBitsLength(this.data.length)\n}\n\nByteData.prototype.write = function (bitBuffer) {\n for (let i = 0, l = this.data.length; i < l; i++) {\n bitBuffer.put(this.data[i], 8)\n }\n}\n\nmodule.exports = ByteData\n","'use strict'\n\nmodule.exports = function encodeUtf8 (input) {\n var result = []\n var size = input.length\n\n for (var index = 0; index < size; index++) {\n var point = input.charCodeAt(index)\n\n if (point >= 0xD800 && point <= 0xDBFF && size > index + 1) {\n var second = input.charCodeAt(index + 1)\n\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n point = (point - 0xD800) * 0x400 + second - 0xDC00 + 0x10000\n index += 1\n }\n }\n\n // US-ASCII\n if (point < 0x80) {\n result.push(point)\n continue\n }\n\n // 2-byte UTF-8\n if (point < 0x800) {\n result.push((point >> 6) | 192)\n result.push((point & 63) | 128)\n continue\n }\n\n // 3-byte UTF-8\n if (point < 0xD800 || (point >= 0xE000 && point < 0x10000)) {\n result.push((point >> 12) | 224)\n result.push(((point >> 6) & 63) | 128)\n result.push((point & 63) | 128)\n continue\n }\n\n // 4-byte UTF-8\n if (point >= 0x10000 && point <= 0x10FFFF) {\n result.push((point >> 18) | 240)\n result.push(((point >> 12) & 63) | 128)\n result.push(((point >> 6) & 63) | 128)\n result.push((point & 63) | 128)\n continue\n }\n\n // Invalid character\n result.push(0xEF, 0xBF, 0xBD)\n }\n\n return new Uint8Array(result).buffer\n}\n","const Mode = require('./mode')\nconst Utils = require('./utils')\n\nfunction KanjiData (data) {\n this.mode = Mode.KANJI\n this.data = data\n}\n\nKanjiData.getBitsLength = function getBitsLength (length) {\n return length * 13\n}\n\nKanjiData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nKanjiData.prototype.getBitsLength = function getBitsLength () {\n return KanjiData.getBitsLength(this.data.length)\n}\n\nKanjiData.prototype.write = function (bitBuffer) {\n let i\n\n // In the Shift JIS system, Kanji characters are represented by a two byte combination.\n // These byte values are shifted from the JIS X 0208 values.\n // JIS X 0208 gives details of the shift coded representation.\n for (i = 0; i < this.data.length; i++) {\n let value = Utils.toSJIS(this.data[i])\n\n // For characters with Shift JIS values from 0x8140 to 0x9FFC:\n if (value >= 0x8140 && value <= 0x9FFC) {\n // Subtract 0x8140 from Shift JIS value\n value -= 0x8140\n\n // For characters with Shift JIS values from 0xE040 to 0xEBBF\n } else if (value >= 0xE040 && value <= 0xEBBF) {\n // Subtract 0xC140 from Shift JIS value\n value -= 0xC140\n } else {\n throw new Error(\n 'Invalid SJIS character: ' + this.data[i] + '\\n' +\n 'Make sure your charset is UTF-8')\n }\n\n // Multiply most significant byte of result by 0xC0\n // and add least significant byte to product\n value = (((value >>> 8) & 0xff) * 0xC0) + (value & 0xff)\n\n // Convert result to a 13-bit binary string\n bitBuffer.put(value, 13)\n }\n}\n\nmodule.exports = KanjiData\n","'use strict';\n\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n * Wyatt Baldwin \n * All rights reserved\n *\n * Licensed under the MIT license.\n *\n * http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\nvar dijkstra = {\n single_source_shortest_paths: function(graph, s, d) {\n // Predecessor map for each node that has been encountered.\n // node ID => predecessor node ID\n var predecessors = {};\n\n // Costs of shortest paths from s to all nodes encountered.\n // node ID => cost\n var costs = {};\n costs[s] = 0;\n\n // Costs of shortest paths from s to all nodes encountered; differs from\n // `costs` in that it provides easy access to the node that currently has\n // the known shortest path from s.\n // XXX: Do we actually need both `costs` and `open`?\n var open = dijkstra.PriorityQueue.make();\n open.push(s, 0);\n\n var closest,\n u, v,\n cost_of_s_to_u,\n adjacent_nodes,\n cost_of_e,\n cost_of_s_to_u_plus_cost_of_e,\n cost_of_s_to_v,\n first_visit;\n while (!open.empty()) {\n // In the nodes remaining in graph that have a known cost from s,\n // find the node, u, that currently has the shortest path from s.\n closest = open.pop();\n u = closest.value;\n cost_of_s_to_u = closest.cost;\n\n // Get nodes adjacent to u...\n adjacent_nodes = graph[u] || {};\n\n // ...and explore the edges that connect u to those nodes, updating\n // the cost of the shortest paths to any or all of those nodes as\n // necessary. v is the node across the current edge from u.\n for (v in adjacent_nodes) {\n if (adjacent_nodes.hasOwnProperty(v)) {\n // Get the cost of the edge running from u to v.\n cost_of_e = adjacent_nodes[v];\n\n // Cost of s to u plus the cost of u to v across e--this is *a*\n // cost from s to v that may or may not be less than the current\n // known cost to v.\n cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n // If we haven't visited v yet OR if the current known cost from s to\n // v is greater than the new cost we just found (cost of s to u plus\n // cost of u to v across e), update v's cost in the cost list and\n // update v's predecessor in the predecessor list (it's now u).\n cost_of_s_to_v = costs[v];\n first_visit = (typeof costs[v] === 'undefined');\n if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n costs[v] = cost_of_s_to_u_plus_cost_of_e;\n open.push(v, cost_of_s_to_u_plus_cost_of_e);\n predecessors[v] = u;\n }\n }\n }\n }\n\n if (typeof d !== 'undefined' && typeof costs[d] === 'undefined') {\n var msg = ['Could not find a path from ', s, ' to ', d, '.'].join('');\n throw new Error(msg);\n }\n\n return predecessors;\n },\n\n extract_shortest_path_from_predecessor_list: function(predecessors, d) {\n var nodes = [];\n var u = d;\n var predecessor;\n while (u) {\n nodes.push(u);\n predecessor = predecessors[u];\n u = predecessors[u];\n }\n nodes.reverse();\n return nodes;\n },\n\n find_path: function(graph, s, d) {\n var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);\n return dijkstra.extract_shortest_path_from_predecessor_list(\n predecessors, d);\n },\n\n /**\n * A very naive priority queue implementation.\n */\n PriorityQueue: {\n make: function (opts) {\n var T = dijkstra.PriorityQueue,\n t = {},\n key;\n opts = opts || {};\n for (key in T) {\n if (T.hasOwnProperty(key)) {\n t[key] = T[key];\n }\n }\n t.queue = [];\n t.sorter = opts.sorter || T.default_sorter;\n return t;\n },\n\n default_sorter: function (a, b) {\n return a.cost - b.cost;\n },\n\n /**\n * Add a new item to the queue and ensure the highest priority element\n * is at the front of the queue.\n */\n push: function (value, cost) {\n var item = {value: value, cost: cost};\n this.queue.push(item);\n this.queue.sort(this.sorter);\n },\n\n /**\n * Return the highest priority element in the queue.\n */\n pop: function () {\n return this.queue.shift();\n },\n\n empty: function () {\n return this.queue.length === 0;\n }\n }\n};\n\n\n// node.js module exports\nif (typeof module !== 'undefined') {\n module.exports = dijkstra;\n}\n","const Mode = require('./mode')\nconst NumericData = require('./numeric-data')\nconst AlphanumericData = require('./alphanumeric-data')\nconst ByteData = require('./byte-data')\nconst KanjiData = require('./kanji-data')\nconst Regex = require('./regex')\nconst Utils = require('./utils')\nconst dijkstra = require('dijkstrajs')\n\n/**\n * Returns UTF8 byte length\n *\n * @param {String} str Input string\n * @return {Number} Number of byte\n */\nfunction getStringByteLength (str) {\n return unescape(encodeURIComponent(str)).length\n}\n\n/**\n * Get a list of segments of the specified mode\n * from a string\n *\n * @param {Mode} mode Segment mode\n * @param {String} str String to process\n * @return {Array} Array of object with segments data\n */\nfunction getSegments (regex, mode, str) {\n const segments = []\n let result\n\n while ((result = regex.exec(str)) !== null) {\n segments.push({\n data: result[0],\n index: result.index,\n mode: mode,\n length: result[0].length\n })\n }\n\n return segments\n}\n\n/**\n * Extracts a series of segments with the appropriate\n * modes from a string\n *\n * @param {String} dataStr Input string\n * @return {Array} Array of object with segments data\n */\nfunction getSegmentsFromString (dataStr) {\n const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr)\n const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr)\n let byteSegs\n let kanjiSegs\n\n if (Utils.isKanjiModeEnabled()) {\n byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr)\n kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr)\n } else {\n byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr)\n kanjiSegs = []\n }\n\n const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs)\n\n return segs\n .sort(function (s1, s2) {\n return s1.index - s2.index\n })\n .map(function (obj) {\n return {\n data: obj.data,\n mode: obj.mode,\n length: obj.length\n }\n })\n}\n\n/**\n * Returns how many bits are needed to encode a string of\n * specified length with the specified mode\n *\n * @param {Number} length String length\n * @param {Mode} mode Segment mode\n * @return {Number} Bit length\n */\nfunction getSegmentBitsLength (length, mode) {\n switch (mode) {\n case Mode.NUMERIC:\n return NumericData.getBitsLength(length)\n case Mode.ALPHANUMERIC:\n return AlphanumericData.getBitsLength(length)\n case Mode.KANJI:\n return KanjiData.getBitsLength(length)\n case Mode.BYTE:\n return ByteData.getBitsLength(length)\n }\n}\n\n/**\n * Merges adjacent segments which have the same mode\n *\n * @param {Array} segs Array of object with segments data\n * @return {Array} Array of object with segments data\n */\nfunction mergeSegments (segs) {\n return segs.reduce(function (acc, curr) {\n const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null\n if (prevSeg && prevSeg.mode === curr.mode) {\n acc[acc.length - 1].data += curr.data\n return acc\n }\n\n acc.push(curr)\n return acc\n }, [])\n}\n\n/**\n * Generates a list of all possible nodes combination which\n * will be used to build a segments graph.\n *\n * Nodes are divided by groups. Each group will contain a list of all the modes\n * in which is possible to encode the given text.\n *\n * For example the text '12345' can be encoded as Numeric, Alphanumeric or Byte.\n * The group for '12345' will contain then 3 objects, one for each\n * possible encoding mode.\n *\n * Each node represents a possible segment.\n *\n * @param {Array} segs Array of object with segments data\n * @return {Array} Array of object with segments data\n */\nfunction buildNodes (segs) {\n const nodes = []\n for (let i = 0; i < segs.length; i++) {\n const seg = segs[i]\n\n switch (seg.mode) {\n case Mode.NUMERIC:\n nodes.push([seg,\n { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length },\n { data: seg.data, mode: Mode.BYTE, length: seg.length }\n ])\n break\n case Mode.ALPHANUMERIC:\n nodes.push([seg,\n { data: seg.data, mode: Mode.BYTE, length: seg.length }\n ])\n break\n case Mode.KANJI:\n nodes.push([seg,\n { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n ])\n break\n case Mode.BYTE:\n nodes.push([\n { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n ])\n }\n }\n\n return nodes\n}\n\n/**\n * Builds a graph from a list of nodes.\n * All segments in each node group will be connected with all the segments of\n * the next group and so on.\n *\n * At each connection will be assigned a weight depending on the\n * segment's byte length.\n *\n * @param {Array} nodes Array of object with segments data\n * @param {Number} version QR Code version\n * @return {Object} Graph of all possible segments\n */\nfunction buildGraph (nodes, version) {\n const table = {}\n const graph = { start: {} }\n let prevNodeIds = ['start']\n\n for (let i = 0; i < nodes.length; i++) {\n const nodeGroup = nodes[i]\n const currentNodeIds = []\n\n for (let j = 0; j < nodeGroup.length; j++) {\n const node = nodeGroup[j]\n const key = '' + i + j\n\n currentNodeIds.push(key)\n table[key] = { node: node, lastCount: 0 }\n graph[key] = {}\n\n for (let n = 0; n < prevNodeIds.length; n++) {\n const prevNodeId = prevNodeIds[n]\n\n if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {\n graph[prevNodeId][key] =\n getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) -\n getSegmentBitsLength(table[prevNodeId].lastCount, node.mode)\n\n table[prevNodeId].lastCount += node.length\n } else {\n if (table[prevNodeId]) table[prevNodeId].lastCount = node.length\n\n graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) +\n 4 + Mode.getCharCountIndicator(node.mode, version) // switch cost\n }\n }\n }\n\n prevNodeIds = currentNodeIds\n }\n\n for (let n = 0; n < prevNodeIds.length; n++) {\n graph[prevNodeIds[n]].end = 0\n }\n\n return { map: graph, table: table }\n}\n\n/**\n * Builds a segment from a specified data and mode.\n * If a mode is not specified, the more suitable will be used.\n *\n * @param {String} data Input data\n * @param {Mode | String} modesHint Data mode\n * @return {Segment} Segment\n */\nfunction buildSingleSegment (data, modesHint) {\n let mode\n const bestMode = Mode.getBestModeForData(data)\n\n mode = Mode.from(modesHint, bestMode)\n\n // Make sure data can be encoded\n if (mode !== Mode.BYTE && mode.bit < bestMode.bit) {\n throw new Error('\"' + data + '\"' +\n ' cannot be encoded with mode ' + Mode.toString(mode) +\n '.\\n Suggested mode is: ' + Mode.toString(bestMode))\n }\n\n // Use Mode.BYTE if Kanji support is disabled\n if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) {\n mode = Mode.BYTE\n }\n\n switch (mode) {\n case Mode.NUMERIC:\n return new NumericData(data)\n\n case Mode.ALPHANUMERIC:\n return new AlphanumericData(data)\n\n case Mode.KANJI:\n return new KanjiData(data)\n\n case Mode.BYTE:\n return new ByteData(data)\n }\n}\n\n/**\n * Builds a list of segments from an array.\n * Array can contain Strings or Objects with segment's info.\n *\n * For each item which is a string, will be generated a segment with the given\n * string and the more appropriate encoding mode.\n *\n * For each item which is an object, will be generated a segment with the given\n * data and mode.\n * Objects must contain at least the property \"data\".\n * If property \"mode\" is not present, the more suitable mode will be used.\n *\n * @param {Array} array Array of objects with segments data\n * @return {Array} Array of Segments\n */\nexports.fromArray = function fromArray (array) {\n return array.reduce(function (acc, seg) {\n if (typeof seg === 'string') {\n acc.push(buildSingleSegment(seg, null))\n } else if (seg.data) {\n acc.push(buildSingleSegment(seg.data, seg.mode))\n }\n\n return acc\n }, [])\n}\n\n/**\n * Builds an optimized sequence of segments from a string,\n * which will produce the shortest possible bitstream.\n *\n * @param {String} data Input string\n * @param {Number} version QR Code version\n * @return {Array} Array of segments\n */\nexports.fromString = function fromString (data, version) {\n const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n\n const nodes = buildNodes(segs)\n const graph = buildGraph(nodes, version)\n const path = dijkstra.find_path(graph.map, 'start', 'end')\n\n const optimizedSegs = []\n for (let i = 1; i < path.length - 1; i++) {\n optimizedSegs.push(graph.table[path[i]].node)\n }\n\n return exports.fromArray(mergeSegments(optimizedSegs))\n}\n\n/**\n * Splits a string in various segments with the modes which\n * best represent their content.\n * The produced segments are far from being optimized.\n * The output of this function is only used to estimate a QR Code version\n * which may contain the data.\n *\n * @param {string} data Input string\n * @return {Array} Array of segments\n */\nexports.rawSplit = function rawSplit (data) {\n return exports.fromArray(\n getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n )\n}\n","const Utils = require('./utils')\nconst ECLevel = require('./error-correction-level')\nconst BitBuffer = require('./bit-buffer')\nconst BitMatrix = require('./bit-matrix')\nconst AlignmentPattern = require('./alignment-pattern')\nconst FinderPattern = require('./finder-pattern')\nconst MaskPattern = require('./mask-pattern')\nconst ECCode = require('./error-correction-code')\nconst ReedSolomonEncoder = require('./reed-solomon-encoder')\nconst Version = require('./version')\nconst FormatInfo = require('./format-info')\nconst Mode = require('./mode')\nconst Segments = require('./segments')\n\n/**\n * QRCode for JavaScript\n *\n * modified by Ryan Day for nodejs support\n * Copyright (c) 2011 Ryan Day\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/mit-license.php\n *\n//---------------------------------------------------------------------\n// QRCode for JavaScript\n//\n// Copyright (c) 2009 Kazuhiko Arase\n//\n// URL: http://www.d-project.com/\n//\n// Licensed under the MIT license:\n// http://www.opensource.org/licenses/mit-license.php\n//\n// The word \"QR Code\" is registered trademark of\n// DENSO WAVE INCORPORATED\n// http://www.denso-wave.com/qrcode/faqpatent-e.html\n//\n//---------------------------------------------------------------------\n*/\n\n/**\n * Add finder patterns bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupFinderPattern (matrix, version) {\n const size = matrix.size\n const pos = FinderPattern.getPositions(version)\n\n for (let i = 0; i < pos.length; i++) {\n const row = pos[i][0]\n const col = pos[i][1]\n\n for (let r = -1; r <= 7; r++) {\n if (row + r <= -1 || size <= row + r) continue\n\n for (let c = -1; c <= 7; c++) {\n if (col + c <= -1 || size <= col + c) continue\n\n if ((r >= 0 && r <= 6 && (c === 0 || c === 6)) ||\n (c >= 0 && c <= 6 && (r === 0 || r === 6)) ||\n (r >= 2 && r <= 4 && c >= 2 && c <= 4)) {\n matrix.set(row + r, col + c, true, true)\n } else {\n matrix.set(row + r, col + c, false, true)\n }\n }\n }\n }\n}\n\n/**\n * Add timing pattern bits to matrix\n *\n * Note: this function must be called before {@link setupAlignmentPattern}\n *\n * @param {BitMatrix} matrix Modules matrix\n */\nfunction setupTimingPattern (matrix) {\n const size = matrix.size\n\n for (let r = 8; r < size - 8; r++) {\n const value = r % 2 === 0\n matrix.set(r, 6, value, true)\n matrix.set(6, r, value, true)\n }\n}\n\n/**\n * Add alignment patterns bits to matrix\n *\n * Note: this function must be called after {@link setupTimingPattern}\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupAlignmentPattern (matrix, version) {\n const pos = AlignmentPattern.getPositions(version)\n\n for (let i = 0; i < pos.length; i++) {\n const row = pos[i][0]\n const col = pos[i][1]\n\n for (let r = -2; r <= 2; r++) {\n for (let c = -2; c <= 2; c++) {\n if (r === -2 || r === 2 || c === -2 || c === 2 ||\n (r === 0 && c === 0)) {\n matrix.set(row + r, col + c, true, true)\n } else {\n matrix.set(row + r, col + c, false, true)\n }\n }\n }\n }\n}\n\n/**\n * Add version info bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupVersionInfo (matrix, version) {\n const size = matrix.size\n const bits = Version.getEncodedBits(version)\n let row, col, mod\n\n for (let i = 0; i < 18; i++) {\n row = Math.floor(i / 3)\n col = i % 3 + size - 8 - 3\n mod = ((bits >> i) & 1) === 1\n\n matrix.set(row, col, mod, true)\n matrix.set(col, row, mod, true)\n }\n}\n\n/**\n * Add format info bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @param {Number} maskPattern Mask pattern reference value\n */\nfunction setupFormatInfo (matrix, errorCorrectionLevel, maskPattern) {\n const size = matrix.size\n const bits = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern)\n let i, mod\n\n for (i = 0; i < 15; i++) {\n mod = ((bits >> i) & 1) === 1\n\n // vertical\n if (i < 6) {\n matrix.set(i, 8, mod, true)\n } else if (i < 8) {\n matrix.set(i + 1, 8, mod, true)\n } else {\n matrix.set(size - 15 + i, 8, mod, true)\n }\n\n // horizontal\n if (i < 8) {\n matrix.set(8, size - i - 1, mod, true)\n } else if (i < 9) {\n matrix.set(8, 15 - i - 1 + 1, mod, true)\n } else {\n matrix.set(8, 15 - i - 1, mod, true)\n }\n }\n\n // fixed module\n matrix.set(size - 8, 8, 1, true)\n}\n\n/**\n * Add encoded data bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Uint8Array} data Data codewords\n */\nfunction setupData (matrix, data) {\n const size = matrix.size\n let inc = -1\n let row = size - 1\n let bitIndex = 7\n let byteIndex = 0\n\n for (let col = size - 1; col > 0; col -= 2) {\n if (col === 6) col--\n\n while (true) {\n for (let c = 0; c < 2; c++) {\n if (!matrix.isReserved(row, col - c)) {\n let dark = false\n\n if (byteIndex < data.length) {\n dark = (((data[byteIndex] >>> bitIndex) & 1) === 1)\n }\n\n matrix.set(row, col - c, dark)\n bitIndex--\n\n if (bitIndex === -1) {\n byteIndex++\n bitIndex = 7\n }\n }\n }\n\n row += inc\n\n if (row < 0 || size <= row) {\n row -= inc\n inc = -inc\n break\n }\n }\n }\n}\n\n/**\n * Create encoded codewords from data input\n *\n * @param {Number} version QR Code version\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @param {ByteData} data Data input\n * @return {Uint8Array} Buffer containing encoded codewords\n */\nfunction createData (version, errorCorrectionLevel, segments) {\n // Prepare data buffer\n const buffer = new BitBuffer()\n\n segments.forEach(function (data) {\n // prefix data with mode indicator (4 bits)\n buffer.put(data.mode.bit, 4)\n\n // Prefix data with character count indicator.\n // The character count indicator is a string of bits that represents the\n // number of characters that are being encoded.\n // The character count indicator must be placed after the mode indicator\n // and must be a certain number of bits long, depending on the QR version\n // and data mode\n // @see {@link Mode.getCharCountIndicator}.\n buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version))\n\n // add binary data sequence to buffer\n data.write(buffer)\n })\n\n // Calculate required number of bits\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n // Add a terminator.\n // If the bit string is shorter than the total number of required bits,\n // a terminator of up to four 0s must be added to the right side of the string.\n // If the bit string is more than four bits shorter than the required number of bits,\n // add four 0s to the end.\n if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) {\n buffer.put(0, 4)\n }\n\n // If the bit string is fewer than four bits shorter, add only the number of 0s that\n // are needed to reach the required number of bits.\n\n // After adding the terminator, if the number of bits in the string is not a multiple of 8,\n // pad the string on the right with 0s to make the string's length a multiple of 8.\n while (buffer.getLengthInBits() % 8 !== 0) {\n buffer.putBit(0)\n }\n\n // Add pad bytes if the string is still shorter than the total number of required bits.\n // Extend the buffer to fill the data capacity of the symbol corresponding to\n // the Version and Error Correction Level by adding the Pad Codewords 11101100 (0xEC)\n // and 00010001 (0x11) alternately.\n const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8\n for (let i = 0; i < remainingByte; i++) {\n buffer.put(i % 2 ? 0x11 : 0xEC, 8)\n }\n\n return createCodewords(buffer, version, errorCorrectionLevel)\n}\n\n/**\n * Encode input data with Reed-Solomon and return codewords with\n * relative error correction bits\n *\n * @param {BitBuffer} bitBuffer Data to encode\n * @param {Number} version QR Code version\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @return {Uint8Array} Buffer containing encoded codewords\n */\nfunction createCodewords (bitBuffer, version, errorCorrectionLevel) {\n // Total codewords for this QR code version (Data + Error correction)\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n // Total number of error correction codewords\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n // Total number of data codewords\n const dataTotalCodewords = totalCodewords - ecTotalCodewords\n\n // Total number of blocks\n const ecTotalBlocks = ECCode.getBlocksCount(version, errorCorrectionLevel)\n\n // Calculate how many blocks each group should contain\n const blocksInGroup2 = totalCodewords % ecTotalBlocks\n const blocksInGroup1 = ecTotalBlocks - blocksInGroup2\n\n const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks)\n\n const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks)\n const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1\n\n // Number of EC codewords is the same for both groups\n const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1\n\n // Initialize a Reed-Solomon encoder with a generator polynomial of degree ecCount\n const rs = new ReedSolomonEncoder(ecCount)\n\n let offset = 0\n const dcData = new Array(ecTotalBlocks)\n const ecData = new Array(ecTotalBlocks)\n let maxDataSize = 0\n const buffer = new Uint8Array(bitBuffer.buffer)\n\n // Divide the buffer into the required number of blocks\n for (let b = 0; b < ecTotalBlocks; b++) {\n const dataSize = b < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2\n\n // extract a block of data from buffer\n dcData[b] = buffer.slice(offset, offset + dataSize)\n\n // Calculate EC codewords for this data block\n ecData[b] = rs.encode(dcData[b])\n\n offset += dataSize\n maxDataSize = Math.max(maxDataSize, dataSize)\n }\n\n // Create final data\n // Interleave the data and error correction codewords from each block\n const data = new Uint8Array(totalCodewords)\n let index = 0\n let i, r\n\n // Add data codewords\n for (i = 0; i < maxDataSize; i++) {\n for (r = 0; r < ecTotalBlocks; r++) {\n if (i < dcData[r].length) {\n data[index++] = dcData[r][i]\n }\n }\n }\n\n // Apped EC codewords\n for (i = 0; i < ecCount; i++) {\n for (r = 0; r < ecTotalBlocks; r++) {\n data[index++] = ecData[r][i]\n }\n }\n\n return data\n}\n\n/**\n * Build QR Code symbol\n *\n * @param {String} data Input string\n * @param {Number} version QR Code version\n * @param {ErrorCorretionLevel} errorCorrectionLevel Error level\n * @param {MaskPattern} maskPattern Mask pattern\n * @return {Object} Object containing symbol data\n */\nfunction createSymbol (data, version, errorCorrectionLevel, maskPattern) {\n let segments\n\n if (Array.isArray(data)) {\n segments = Segments.fromArray(data)\n } else if (typeof data === 'string') {\n let estimatedVersion = version\n\n if (!estimatedVersion) {\n const rawSegments = Segments.rawSplit(data)\n\n // Estimate best version that can contain raw splitted segments\n estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel)\n }\n\n // Build optimized segments\n // If estimated version is undefined, try with the highest version\n segments = Segments.fromString(data, estimatedVersion || 40)\n } else {\n throw new Error('Invalid data')\n }\n\n // Get the min version that can contain data\n const bestVersion = Version.getBestVersionForData(segments, errorCorrectionLevel)\n\n // If no version is found, data cannot be stored\n if (!bestVersion) {\n throw new Error('The amount of data is too big to be stored in a QR Code')\n }\n\n // If not specified, use min version as default\n if (!version) {\n version = bestVersion\n\n // Check if the specified version can contain the data\n } else if (version < bestVersion) {\n throw new Error('\\n' +\n 'The chosen QR Code version cannot contain this amount of data.\\n' +\n 'Minimum version required to store current data is: ' + bestVersion + '.\\n'\n )\n }\n\n const dataBits = createData(version, errorCorrectionLevel, segments)\n\n // Allocate matrix buffer\n const moduleCount = Utils.getSymbolSize(version)\n const modules = new BitMatrix(moduleCount)\n\n // Add function modules\n setupFinderPattern(modules, version)\n setupTimingPattern(modules)\n setupAlignmentPattern(modules, version)\n\n // Add temporary dummy bits for format info just to set them as reserved.\n // This is needed to prevent these bits from being masked by {@link MaskPattern.applyMask}\n // since the masking operation must be performed only on the encoding region.\n // These blocks will be replaced with correct values later in code.\n setupFormatInfo(modules, errorCorrectionLevel, 0)\n\n if (version >= 7) {\n setupVersionInfo(modules, version)\n }\n\n // Add data codewords\n setupData(modules, dataBits)\n\n if (isNaN(maskPattern)) {\n // Find best mask pattern\n maskPattern = MaskPattern.getBestMask(modules,\n setupFormatInfo.bind(null, modules, errorCorrectionLevel))\n }\n\n // Apply mask pattern\n MaskPattern.applyMask(maskPattern, modules)\n\n // Replace format info bits with correct values\n setupFormatInfo(modules, errorCorrectionLevel, maskPattern)\n\n return {\n modules: modules,\n version: version,\n errorCorrectionLevel: errorCorrectionLevel,\n maskPattern: maskPattern,\n segments: segments\n }\n}\n\n/**\n * QR Code\n *\n * @param {String | Array} data Input data\n * @param {Object} options Optional configurations\n * @param {Number} options.version QR Code version\n * @param {String} options.errorCorrectionLevel Error correction level\n * @param {Function} options.toSJISFunc Helper func to convert utf8 to sjis\n */\nexports.create = function create (data, options) {\n if (typeof data === 'undefined' || data === '') {\n throw new Error('No input text')\n }\n\n let errorCorrectionLevel = ECLevel.M\n let version\n let mask\n\n if (typeof options !== 'undefined') {\n // Use higher error correction level as default\n errorCorrectionLevel = ECLevel.from(options.errorCorrectionLevel, ECLevel.M)\n version = Version.from(options.version)\n mask = MaskPattern.from(options.maskPattern)\n\n if (options.toSJISFunc) {\n Utils.setToSJISFunction(options.toSJISFunc)\n }\n }\n\n return createSymbol(data, version, errorCorrectionLevel, mask)\n}\n","function hex2rgba (hex) {\n if (typeof hex === 'number') {\n hex = hex.toString()\n }\n\n if (typeof hex !== 'string') {\n throw new Error('Color should be defined as hex string')\n }\n\n let hexCode = hex.slice().replace('#', '').split('')\n if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) {\n throw new Error('Invalid hex color: ' + hex)\n }\n\n // Convert from short to long form (fff -> ffffff)\n if (hexCode.length === 3 || hexCode.length === 4) {\n hexCode = Array.prototype.concat.apply([], hexCode.map(function (c) {\n return [c, c]\n }))\n }\n\n // Add default alpha value\n if (hexCode.length === 6) hexCode.push('F', 'F')\n\n const hexValue = parseInt(hexCode.join(''), 16)\n\n return {\n r: (hexValue >> 24) & 255,\n g: (hexValue >> 16) & 255,\n b: (hexValue >> 8) & 255,\n a: hexValue & 255,\n hex: '#' + hexCode.slice(0, 6).join('')\n }\n}\n\nexports.getOptions = function getOptions (options) {\n if (!options) options = {}\n if (!options.color) options.color = {}\n\n const margin = typeof options.margin === 'undefined' ||\n options.margin === null ||\n options.margin < 0\n ? 4\n : options.margin\n\n const width = options.width && options.width >= 21 ? options.width : undefined\n const scale = options.scale || 4\n\n return {\n width: width,\n scale: width ? 4 : scale,\n margin: margin,\n color: {\n dark: hex2rgba(options.color.dark || '#000000ff'),\n light: hex2rgba(options.color.light || '#ffffffff')\n },\n type: options.type,\n rendererOpts: options.rendererOpts || {}\n }\n}\n\nexports.getScale = function getScale (qrSize, opts) {\n return opts.width && opts.width >= qrSize + opts.margin * 2\n ? opts.width / (qrSize + opts.margin * 2)\n : opts.scale\n}\n\nexports.getImageWidth = function getImageWidth (qrSize, opts) {\n const scale = exports.getScale(qrSize, opts)\n return Math.floor((qrSize + opts.margin * 2) * scale)\n}\n\nexports.qrToImageData = function qrToImageData (imgData, qr, opts) {\n const size = qr.modules.size\n const data = qr.modules.data\n const scale = exports.getScale(size, opts)\n const symbolSize = Math.floor((size + opts.margin * 2) * scale)\n const scaledMargin = opts.margin * scale\n const palette = [opts.color.light, opts.color.dark]\n\n for (let i = 0; i < symbolSize; i++) {\n for (let j = 0; j < symbolSize; j++) {\n let posDst = (i * symbolSize + j) * 4\n let pxColor = opts.color.light\n\n if (i >= scaledMargin && j >= scaledMargin &&\n i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {\n const iSrc = Math.floor((i - scaledMargin) / scale)\n const jSrc = Math.floor((j - scaledMargin) / scale)\n pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0]\n }\n\n imgData[posDst++] = pxColor.r\n imgData[posDst++] = pxColor.g\n imgData[posDst++] = pxColor.b\n imgData[posDst] = pxColor.a\n }\n }\n}\n","const Utils = require('./utils')\n\nfunction clearCanvas (ctx, canvas, size) {\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n if (!canvas.style) canvas.style = {}\n canvas.height = size\n canvas.width = size\n canvas.style.height = size + 'px'\n canvas.style.width = size + 'px'\n}\n\nfunction getCanvasElement () {\n try {\n return document.createElement('canvas')\n } catch (e) {\n throw new Error('You need to specify a canvas element')\n }\n}\n\nexports.render = function render (qrData, canvas, options) {\n let opts = options\n let canvasEl = canvas\n\n if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n opts = canvas\n canvas = undefined\n }\n\n if (!canvas) {\n canvasEl = getCanvasElement()\n }\n\n opts = Utils.getOptions(opts)\n const size = Utils.getImageWidth(qrData.modules.size, opts)\n\n const ctx = canvasEl.getContext('2d')\n const image = ctx.createImageData(size, size)\n Utils.qrToImageData(image.data, qrData, opts)\n\n clearCanvas(ctx, canvasEl, size)\n ctx.putImageData(image, 0, 0)\n\n return canvasEl\n}\n\nexports.renderToDataURL = function renderToDataURL (qrData, canvas, options) {\n let opts = options\n\n if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n opts = canvas\n canvas = undefined\n }\n\n if (!opts) opts = {}\n\n const canvasEl = exports.render(qrData, canvas, opts)\n\n const type = opts.type || 'image/png'\n const rendererOpts = opts.rendererOpts || {}\n\n return canvasEl.toDataURL(type, rendererOpts.quality)\n}\n","const Utils = require('./utils')\n\nfunction getColorAttrib (color, attrib) {\n const alpha = color.a / 255\n const str = attrib + '=\"' + color.hex + '\"'\n\n return alpha < 1\n ? str + ' ' + attrib + '-opacity=\"' + alpha.toFixed(2).slice(1) + '\"'\n : str\n}\n\nfunction svgCmd (cmd, x, y) {\n let str = cmd + x\n if (typeof y !== 'undefined') str += ' ' + y\n\n return str\n}\n\nfunction qrToPath (data, size, margin) {\n let path = ''\n let moveBy = 0\n let newRow = false\n let lineLength = 0\n\n for (let i = 0; i < data.length; i++) {\n const col = Math.floor(i % size)\n const row = Math.floor(i / size)\n\n if (!col && !newRow) newRow = true\n\n if (data[i]) {\n lineLength++\n\n if (!(i > 0 && col > 0 && data[i - 1])) {\n path += newRow\n ? svgCmd('M', col + margin, 0.5 + row + margin)\n : svgCmd('m', moveBy, 0)\n\n moveBy = 0\n newRow = false\n }\n\n if (!(col + 1 < size && data[i + 1])) {\n path += svgCmd('h', lineLength)\n lineLength = 0\n }\n } else {\n moveBy++\n }\n }\n\n return path\n}\n\nexports.render = function render (qrData, options, cb) {\n const opts = Utils.getOptions(options)\n const size = qrData.modules.size\n const data = qrData.modules.data\n const qrcodesize = size + opts.margin * 2\n\n const bg = !opts.color.light.a\n ? ''\n : ''\n\n const path =\n ''\n\n const viewBox = 'viewBox=\"' + '0 0 ' + qrcodesize + ' ' + qrcodesize + '\"'\n\n const width = !opts.width ? '' : 'width=\"' + opts.width + '\" height=\"' + opts.width + '\" '\n\n const svgTag = '' + bg + path + '\\n'\n\n if (typeof cb === 'function') {\n cb(null, svgTag)\n }\n\n return svgTag\n}\n","\nconst canPromise = require('./can-promise')\n\nconst QRCode = require('./core/qrcode')\nconst CanvasRenderer = require('./renderer/canvas')\nconst SvgRenderer = require('./renderer/svg-tag.js')\n\nfunction renderCanvas (renderFunc, canvas, text, opts, cb) {\n const args = [].slice.call(arguments, 1)\n const argsNum = args.length\n const isLastArgCb = typeof args[argsNum - 1] === 'function'\n\n if (!isLastArgCb && !canPromise()) {\n throw new Error('Callback required as last argument')\n }\n\n if (isLastArgCb) {\n if (argsNum < 2) {\n throw new Error('Too few arguments provided')\n }\n\n if (argsNum === 2) {\n cb = text\n text = canvas\n canvas = opts = undefined\n } else if (argsNum === 3) {\n if (canvas.getContext && typeof cb === 'undefined') {\n cb = opts\n opts = undefined\n } else {\n cb = opts\n opts = text\n text = canvas\n canvas = undefined\n }\n }\n } else {\n if (argsNum < 1) {\n throw new Error('Too few arguments provided')\n }\n\n if (argsNum === 1) {\n text = canvas\n canvas = opts = undefined\n } else if (argsNum === 2 && !canvas.getContext) {\n opts = text\n text = canvas\n canvas = undefined\n }\n\n return new Promise(function (resolve, reject) {\n try {\n const data = QRCode.create(text, opts)\n resolve(renderFunc(data, canvas, opts))\n } catch (e) {\n reject(e)\n }\n })\n }\n\n try {\n const data = QRCode.create(text, opts)\n cb(null, renderFunc(data, canvas, opts))\n } catch (e) {\n cb(e)\n }\n}\n\nexports.create = QRCode.create\nexports.toCanvas = renderCanvas.bind(null, CanvasRenderer.render)\nexports.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL)\n\n// only svg for now.\nexports.toString = renderCanvas.bind(null, function (data, _, opts) {\n return SvgRenderer.render(data, opts)\n})\n","// can-promise has a crash in some versions of react native that dont have\n// standard global objects\n// https://github.com/soldair/node-qrcode/issues/157\n\nmodule.exports = function () {\n return typeof Promise === 'function' && Promise.prototype && Promise.prototype.then\n}\n","\r\n\r\n{#if displayType === \"img\"}\r\n \r\n{:else if displayType === \"canvas\"}\r\n
\r\n \r\n \r\n {altText}\r\n
\r\n{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","/** @import { Source } from '#client' */\nimport { derived } from '../internal/client/index.js';\nimport { source, set } from '../internal/client/reactivity/sources.js';\nimport { active_reaction, get, set_active_reaction } from '../internal/client/runtime.js';\n\nvar inited = false;\n\nexport class SvelteDate extends Date {\n\t#time = source(super.getTime());\n\n\t/** @type {Map>} */\n\t#deriveds = new Map();\n\n\t#reaction = active_reaction;\n\n\t/** @param {any[]} params */\n\tconstructor(...params) {\n\t\t// @ts-ignore\n\t\tsuper(...params);\n\t\tif (!inited) this.#init();\n\t}\n\n\t#init() {\n\t\tinited = true;\n\n\t\tvar proto = SvelteDate.prototype;\n\t\tvar date_proto = Date.prototype;\n\n\t\tvar methods = /** @type {Array} */ (\n\t\t\tObject.getOwnPropertyNames(date_proto)\n\t\t);\n\n\t\tfor (const method of methods) {\n\t\t\tif (method.startsWith('get') || method.startsWith('to') || method === 'valueOf') {\n\t\t\t\t// @ts-ignore\n\t\t\t\tproto[method] = function (...args) {\n\t\t\t\t\t// don't memoize if there are arguments\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tif (args.length > 0) {\n\t\t\t\t\t\tget(this.#time);\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\treturn date_proto[method].apply(this, args);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar d = this.#deriveds.get(method);\n\n\t\t\t\t\tif (d === undefined) {\n\t\t\t\t\t\t// lazily create the derived, but as though it were being\n\t\t\t\t\t\t// created at the same time as the class instance\n\t\t\t\t\t\tconst reaction = active_reaction;\n\t\t\t\t\t\tset_active_reaction(this.#reaction);\n\n\t\t\t\t\t\td = derived(() => {\n\t\t\t\t\t\t\tget(this.#time);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\treturn date_proto[method].apply(this, args);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tthis.#deriveds.set(method, d);\n\n\t\t\t\t\t\tset_active_reaction(reaction);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn get(d);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (method.startsWith('set')) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tproto[method] = function (...args) {\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tvar result = date_proto[method].apply(this, args);\n\t\t\t\t\tset(this.#time, date_proto.getTime.call(this));\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n}\n","/**\n * @param {any} obj\n * @returns {obj is Date}\n */\nexport function is_date(obj) {\n\treturn Object.prototype.toString.call(obj) === '[object Date]';\n}\n","/** @import { Task } from '#client' */\n/** @import { SpringOpts, SpringUpdateOpts, TickContext } from './private.js' */\n/** @import { Spring as SpringStore } from './public.js' */\nimport { writable } from '../store/shared/index.js';\nimport { loop } from '../internal/client/loop.js';\nimport { raf } from '../internal/client/timing.js';\nimport { is_date } from './utils.js';\nimport { set, source } from '../internal/client/reactivity/sources.js';\nimport { render_effect } from '../internal/client/reactivity/effects.js';\nimport { get } from '../internal/client/runtime.js';\nimport { deferred, noop } from '../internal/shared/utils.js';\n\n/**\n * @template T\n * @param {TickContext} ctx\n * @param {T} last_value\n * @param {T} current_value\n * @param {T} target_value\n * @returns {T}\n */\nfunction tick_spring(ctx, last_value, current_value, target_value) {\n\tif (typeof current_value === 'number' || is_date(current_value)) {\n\t\t// @ts-ignore\n\t\tconst delta = target_value - current_value;\n\t\t// @ts-ignore\n\t\tconst velocity = (current_value - last_value) / (ctx.dt || 1 / 60); // guard div by 0\n\t\tconst spring = ctx.opts.stiffness * delta;\n\t\tconst damper = ctx.opts.damping * velocity;\n\t\tconst acceleration = (spring - damper) * ctx.inv_mass;\n\t\tconst d = (velocity + acceleration) * ctx.dt;\n\t\tif (Math.abs(d) < ctx.opts.precision && Math.abs(delta) < ctx.opts.precision) {\n\t\t\treturn target_value; // settled\n\t\t} else {\n\t\t\tctx.settled = false; // signal loop to keep ticking\n\t\t\t// @ts-ignore\n\t\t\treturn is_date(current_value) ? new Date(current_value.getTime() + d) : current_value + d;\n\t\t}\n\t} else if (Array.isArray(current_value)) {\n\t\t// @ts-ignore\n\t\treturn current_value.map((_, i) =>\n\t\t\t// @ts-ignore\n\t\t\ttick_spring(ctx, last_value[i], current_value[i], target_value[i])\n\t\t);\n\t} else if (typeof current_value === 'object') {\n\t\tconst next_value = {};\n\t\tfor (const k in current_value) {\n\t\t\t// @ts-ignore\n\t\t\tnext_value[k] = tick_spring(ctx, last_value[k], current_value[k], target_value[k]);\n\t\t}\n\t\t// @ts-ignore\n\t\treturn next_value;\n\t} else {\n\t\tthrow new Error(`Cannot spring ${typeof current_value} values`);\n\t}\n}\n\n/**\n * The spring function in Svelte creates a store whose value is animated, with a motion that simulates the behavior of a spring. This means when the value changes, instead of transitioning at a steady rate, it \"bounces\" like a spring would, depending on the physics parameters provided. This adds a level of realism to the transitions and can enhance the user experience.\n *\n * @deprecated Use [`Spring`](https://svelte.dev/docs/svelte/svelte-motion#Spring) instead\n * @template [T=any]\n * @param {T} [value]\n * @param {SpringOpts} [opts]\n * @returns {SpringStore}\n */\nexport function spring(value, opts = {}) {\n\tconst store = writable(value);\n\tconst { stiffness = 0.15, damping = 0.8, precision = 0.01 } = opts;\n\t/** @type {number} */\n\tlet last_time;\n\t/** @type {Task | null} */\n\tlet task;\n\t/** @type {object} */\n\tlet current_token;\n\n\tlet last_value = /** @type {T} */ (value);\n\tlet target_value = /** @type {T | undefined} */ (value);\n\n\tlet inv_mass = 1;\n\tlet inv_mass_recovery_rate = 0;\n\tlet cancel_task = false;\n\t/**\n\t * @param {T} new_value\n\t * @param {SpringUpdateOpts} opts\n\t * @returns {Promise}\n\t */\n\tfunction set(new_value, opts = {}) {\n\t\ttarget_value = new_value;\n\t\tconst token = (current_token = {});\n\t\tif (value == null || opts.hard || (spring.stiffness >= 1 && spring.damping >= 1)) {\n\t\t\tcancel_task = true; // cancel any running animation\n\t\t\tlast_time = raf.now();\n\t\t\tlast_value = new_value;\n\t\t\tstore.set((value = target_value));\n\t\t\treturn Promise.resolve();\n\t\t} else if (opts.soft) {\n\t\t\tconst rate = opts.soft === true ? 0.5 : +opts.soft;\n\t\t\tinv_mass_recovery_rate = 1 / (rate * 60);\n\t\t\tinv_mass = 0; // infinite mass, unaffected by spring forces\n\t\t}\n\t\tif (!task) {\n\t\t\tlast_time = raf.now();\n\t\t\tcancel_task = false;\n\t\t\ttask = loop((now) => {\n\t\t\t\tif (cancel_task) {\n\t\t\t\t\tcancel_task = false;\n\t\t\t\t\ttask = null;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tinv_mass = Math.min(inv_mass + inv_mass_recovery_rate, 1);\n\n\t\t\t\t// clamp elapsed time to 1/30th of a second, so that longer pauses\n\t\t\t\t// (blocked thread or inactive tab) don't cause the spring to go haywire\n\t\t\t\tconst elapsed = Math.min(now - last_time, 1000 / 30);\n\n\t\t\t\t/** @type {TickContext} */\n\t\t\t\tconst ctx = {\n\t\t\t\t\tinv_mass,\n\t\t\t\t\topts: spring,\n\t\t\t\t\tsettled: true,\n\t\t\t\t\tdt: (elapsed * 60) / 1000\n\t\t\t\t};\n\t\t\t\t// @ts-ignore\n\t\t\t\tconst next_value = tick_spring(ctx, last_value, value, target_value);\n\t\t\t\tlast_time = now;\n\t\t\t\tlast_value = /** @type {T} */ (value);\n\t\t\t\tstore.set((value = /** @type {T} */ (next_value)));\n\t\t\t\tif (ctx.settled) {\n\t\t\t\t\ttask = null;\n\t\t\t\t}\n\t\t\t\treturn !ctx.settled;\n\t\t\t});\n\t\t}\n\t\treturn new Promise((fulfil) => {\n\t\t\t/** @type {Task} */ (task).promise.then(() => {\n\t\t\t\tif (token === current_token) fulfil();\n\t\t\t});\n\t\t});\n\t}\n\t/** @type {SpringStore} */\n\t// @ts-expect-error - class-only properties are missing\n\tconst spring = {\n\t\tset,\n\t\tupdate: (fn, opts) => set(fn(/** @type {T} */ (target_value), /** @type {T} */ (value)), opts),\n\t\tsubscribe: store.subscribe,\n\t\tstiffness,\n\t\tdamping,\n\t\tprecision\n\t};\n\treturn spring;\n}\n\n/**\n * A wrapper for a value that behaves in a spring-like fashion. Changes to `spring.target` will cause `spring.current` to\n * move towards it over time, taking account of the `spring.stiffness` and `spring.damping` parameters.\n *\n * ```svelte\n * \n *\n * \n * \n * ```\n * @template T\n * @since 5.8.0\n */\nexport class Spring {\n\t#stiffness = source(0.15);\n\t#damping = source(0.8);\n\t#precision = source(0.01);\n\n\t#current = source(/** @type {T} */ (undefined));\n\t#target = source(/** @type {T} */ (undefined));\n\n\t#last_value = /** @type {T} */ (undefined);\n\t#last_time = 0;\n\n\t#inverse_mass = 1;\n\t#momentum = 0;\n\n\t/** @type {import('../internal/client/types').Task | null} */\n\t#task = null;\n\n\t/** @type {ReturnType | null} */\n\t#deferred = null;\n\n\t/**\n\t * @param {T} value\n\t * @param {SpringOpts} [options]\n\t */\n\tconstructor(value, options = {}) {\n\t\tthis.#current.v = this.#target.v = value;\n\n\t\tif (typeof options.stiffness === 'number') this.#stiffness.v = clamp(options.stiffness, 0, 1);\n\t\tif (typeof options.damping === 'number') this.#damping.v = clamp(options.damping, 0, 1);\n\t\tif (typeof options.precision === 'number') this.#precision.v = options.precision;\n\t}\n\n\t/**\n\t * Create a spring whose value is bound to the return value of `fn`. This must be called\n\t * inside an effect root (for example, during component initialisation).\n\t *\n\t * ```svelte\n\t * \n\t * ```\n\t * @template U\n\t * @param {() => U} fn\n\t * @param {SpringOpts} [options]\n\t */\n\tstatic of(fn, options) {\n\t\tconst spring = new Spring(fn(), options);\n\n\t\trender_effect(() => {\n\t\t\tspring.set(fn());\n\t\t});\n\n\t\treturn spring;\n\t}\n\n\t/** @param {T} value */\n\t#update(value) {\n\t\tset(this.#target, value);\n\n\t\tthis.#current.v ??= value;\n\t\tthis.#last_value ??= this.#current.v;\n\n\t\tif (!this.#task) {\n\t\t\tthis.#last_time = raf.now();\n\n\t\t\tvar inv_mass_recovery_rate = 1000 / (this.#momentum * 60);\n\n\t\t\tthis.#task ??= loop((now) => {\n\t\t\t\tthis.#inverse_mass = Math.min(this.#inverse_mass + inv_mass_recovery_rate, 1);\n\n\t\t\t\t// clamp elapsed time to 1/30th of a second, so that longer pauses\n\t\t\t\t// (blocked thread or inactive tab) don't cause the spring to go haywire\n\t\t\t\tconst elapsed = Math.min(now - this.#last_time, 1000 / 30);\n\n\t\t\t\t/** @type {import('./private').TickContext} */\n\t\t\t\tconst ctx = {\n\t\t\t\t\tinv_mass: this.#inverse_mass,\n\t\t\t\t\topts: {\n\t\t\t\t\t\tstiffness: this.#stiffness.v,\n\t\t\t\t\t\tdamping: this.#damping.v,\n\t\t\t\t\t\tprecision: this.#precision.v\n\t\t\t\t\t},\n\t\t\t\t\tsettled: true,\n\t\t\t\t\tdt: (elapsed * 60) / 1000\n\t\t\t\t};\n\n\t\t\t\tvar next = tick_spring(ctx, this.#last_value, this.#current.v, this.#target.v);\n\t\t\t\tthis.#last_value = this.#current.v;\n\t\t\t\tthis.#last_time = now;\n\t\t\t\tset(this.#current, next);\n\n\t\t\t\tif (ctx.settled) {\n\t\t\t\t\tthis.#task = null;\n\t\t\t\t}\n\n\t\t\t\treturn !ctx.settled;\n\t\t\t});\n\t\t}\n\n\t\treturn this.#task.promise;\n\t}\n\n\t/**\n\t * Sets `spring.target` to `value` and returns a `Promise` that resolves if and when `spring.current` catches up to it.\n\t *\n\t * If `options.instant` is `true`, `spring.current` immediately matches `spring.target`.\n\t *\n\t * If `options.preserveMomentum` is provided, the spring will continue on its current trajectory for\n\t * the specified number of milliseconds. This is useful for things like 'fling' gestures.\n\t *\n\t * @param {T} value\n\t * @param {SpringUpdateOpts} [options]\n\t */\n\tset(value, options) {\n\t\tthis.#deferred?.reject(new Error('Aborted'));\n\n\t\tif (options?.instant || this.#current.v === undefined) {\n\t\t\tthis.#task?.abort();\n\t\t\tthis.#task = null;\n\t\t\tset(this.#current, set(this.#target, value));\n\t\t\tthis.#last_value = value;\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tif (options?.preserveMomentum) {\n\t\t\tthis.#inverse_mass = 0;\n\t\t\tthis.#momentum = options.preserveMomentum;\n\t\t}\n\n\t\tvar d = (this.#deferred = deferred());\n\t\td.promise.catch(noop);\n\n\t\tthis.#update(value).then(() => {\n\t\t\tif (d !== this.#deferred) return;\n\t\t\td.resolve(undefined);\n\t\t});\n\n\t\treturn d.promise;\n\t}\n\n\tget current() {\n\t\treturn get(this.#current);\n\t}\n\n\tget damping() {\n\t\treturn get(this.#damping);\n\t}\n\n\tset damping(v) {\n\t\tset(this.#damping, clamp(v, 0, 1));\n\t}\n\n\tget precision() {\n\t\treturn get(this.#precision);\n\t}\n\n\tset precision(v) {\n\t\tset(this.#precision, v);\n\t}\n\n\tget stiffness() {\n\t\treturn get(this.#stiffness);\n\t}\n\n\tset stiffness(v) {\n\t\tset(this.#stiffness, clamp(v, 0, 1));\n\t}\n\n\tget target() {\n\t\treturn get(this.#target);\n\t}\n\n\tset target(v) {\n\t\tthis.set(v);\n\t}\n}\n\n/**\n * @param {number} n\n * @param {number} min\n * @param {number} max\n */\nfunction clamp(n, min, max) {\n\treturn Math.max(min, Math.min(max, n));\n}\n","/** @import { Task } from '../internal/client/types' */\n/** @import { Tweened } from './public' */\n/** @import { TweenedOptions } from './private' */\nimport { writable } from '../store/shared/index.js';\nimport { raf } from '../internal/client/timing.js';\nimport { loop } from '../internal/client/loop.js';\nimport { linear } from '../easing/index.js';\nimport { is_date } from './utils.js';\nimport { set, source } from '../internal/client/reactivity/sources.js';\nimport { get, render_effect } from 'svelte/internal/client';\n\n/**\n * @template T\n * @param {T} a\n * @param {T} b\n * @returns {(t: number) => T}\n */\nfunction get_interpolator(a, b) {\n\tif (a === b || a !== a) return () => a;\n\n\tconst type = typeof a;\n\tif (type !== typeof b || Array.isArray(a) !== Array.isArray(b)) {\n\t\tthrow new Error('Cannot interpolate values of different type');\n\t}\n\n\tif (Array.isArray(a)) {\n\t\tconst arr = /** @type {Array} */ (b).map((bi, i) => {\n\t\t\treturn get_interpolator(/** @type {Array} */ (a)[i], bi);\n\t\t});\n\n\t\t// @ts-ignore\n\t\treturn (t) => arr.map((fn) => fn(t));\n\t}\n\n\tif (type === 'object') {\n\t\tif (!a || !b) {\n\t\t\tthrow new Error('Object cannot be null');\n\t\t}\n\n\t\tif (is_date(a) && is_date(b)) {\n\t\t\tconst an = a.getTime();\n\t\t\tconst bn = b.getTime();\n\t\t\tconst delta = bn - an;\n\n\t\t\t// @ts-ignore\n\t\t\treturn (t) => new Date(an + t * delta);\n\t\t}\n\n\t\tconst keys = Object.keys(b);\n\n\t\t/** @type {Record T>} */\n\t\tconst interpolators = {};\n\t\tkeys.forEach((key) => {\n\t\t\t// @ts-ignore\n\t\t\tinterpolators[key] = get_interpolator(a[key], b[key]);\n\t\t});\n\n\t\t// @ts-ignore\n\t\treturn (t) => {\n\t\t\t/** @type {Record} */\n\t\t\tconst result = {};\n\t\t\tkeys.forEach((key) => {\n\t\t\t\tresult[key] = interpolators[key](t);\n\t\t\t});\n\t\t\treturn result;\n\t\t};\n\t}\n\n\tif (type === 'number') {\n\t\tconst delta = /** @type {number} */ (b) - /** @type {number} */ (a);\n\t\t// @ts-ignore\n\t\treturn (t) => a + t * delta;\n\t}\n\n\t// for non-numeric values, snap to the final value immediately\n\treturn () => b;\n}\n\n/**\n * A tweened store in Svelte is a special type of store that provides smooth transitions between state values over time.\n *\n * @deprecated Use [`Tween`](https://svelte.dev/docs/svelte/svelte-motion#Tween) instead\n * @template T\n * @param {T} [value]\n * @param {TweenedOptions} [defaults]\n * @returns {Tweened}\n */\nexport function tweened(value, defaults = {}) {\n\tconst store = writable(value);\n\t/** @type {Task} */\n\tlet task;\n\tlet target_value = value;\n\t/**\n\t * @param {T} new_value\n\t * @param {TweenedOptions} [opts]\n\t */\n\tfunction set(new_value, opts) {\n\t\ttarget_value = new_value;\n\n\t\tif (value == null) {\n\t\t\tstore.set((value = new_value));\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\t/** @type {Task | null} */\n\t\tlet previous_task = task;\n\n\t\tlet started = false;\n\t\tlet {\n\t\t\tdelay = 0,\n\t\t\tduration = 400,\n\t\t\teasing = linear,\n\t\t\tinterpolate = get_interpolator\n\t\t} = { ...defaults, ...opts };\n\n\t\tif (duration === 0) {\n\t\t\tif (previous_task) {\n\t\t\t\tprevious_task.abort();\n\t\t\t\tprevious_task = null;\n\t\t\t}\n\t\t\tstore.set((value = target_value));\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tconst start = raf.now() + delay;\n\n\t\t/** @type {(t: number) => T} */\n\t\tlet fn;\n\t\ttask = loop((now) => {\n\t\t\tif (now < start) return true;\n\t\t\tif (!started) {\n\t\t\t\tfn = interpolate(/** @type {any} */ (value), new_value);\n\t\t\t\tif (typeof duration === 'function')\n\t\t\t\t\tduration = duration(/** @type {any} */ (value), new_value);\n\t\t\t\tstarted = true;\n\t\t\t}\n\t\t\tif (previous_task) {\n\t\t\t\tprevious_task.abort();\n\t\t\t\tprevious_task = null;\n\t\t\t}\n\t\t\tconst elapsed = now - start;\n\t\t\tif (elapsed > /** @type {number} */ (duration)) {\n\t\t\t\tstore.set((value = new_value));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// @ts-ignore\n\t\t\tstore.set((value = fn(easing(elapsed / duration))));\n\t\t\treturn true;\n\t\t});\n\t\treturn task.promise;\n\t}\n\treturn {\n\t\tset,\n\t\tupdate: (fn, opts) =>\n\t\t\tset(fn(/** @type {any} */ (target_value), /** @type {any} */ (value)), opts),\n\t\tsubscribe: store.subscribe\n\t};\n}\n\n/**\n * A wrapper for a value that tweens smoothly to its target value. Changes to `tween.target` will cause `tween.current` to\n * move towards it over time, taking account of the `delay`, `duration` and `easing` options.\n *\n * ```svelte\n * \n *\n * \n * \n * ```\n * @template T\n * @since 5.8.0\n */\nexport class Tween {\n\t#current = source(/** @type {T} */ (undefined));\n\t#target = source(/** @type {T} */ (undefined));\n\n\t/** @type {TweenedOptions} */\n\t#defaults;\n\n\t/** @type {import('../internal/client/types').Task | null} */\n\t#task = null;\n\n\t/**\n\t * @param {T} value\n\t * @param {TweenedOptions} options\n\t */\n\tconstructor(value, options = {}) {\n\t\tthis.#current.v = this.#target.v = value;\n\t\tthis.#defaults = options;\n\t}\n\n\t/**\n\t * Create a tween whose value is bound to the return value of `fn`. This must be called\n\t * inside an effect root (for example, during component initialisation).\n\t *\n\t * ```svelte\n\t * \n\t * ```\n\t * @template U\n\t * @param {() => U} fn\n\t * @param {TweenedOptions} [options]\n\t */\n\tstatic of(fn, options) {\n\t\tconst tween = new Tween(fn(), options);\n\n\t\trender_effect(() => {\n\t\t\ttween.set(fn());\n\t\t});\n\n\t\treturn tween;\n\t}\n\n\t/**\n\t * Sets `tween.target` to `value` and returns a `Promise` that resolves if and when `tween.current` catches up to it.\n\t *\n\t * If `options` are provided, they will override the tween's defaults.\n\t * @param {T} value\n\t * @param {TweenedOptions} [options]\n\t * @returns\n\t */\n\tset(value, options) {\n\t\tset(this.#target, value);\n\n\t\tlet {\n\t\t\tdelay = 0,\n\t\t\tduration = 400,\n\t\t\teasing = linear,\n\t\t\tinterpolate = get_interpolator\n\t\t} = { ...this.#defaults, ...options };\n\n\t\tif (duration === 0) {\n\t\t\tthis.#task?.abort();\n\t\t\tset(this.#current, value);\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tconst start = raf.now() + delay;\n\n\t\t/** @type {(t: number) => T} */\n\t\tlet fn;\n\t\tlet started = false;\n\t\tlet previous_task = this.#task;\n\n\t\tthis.#task = loop((now) => {\n\t\t\tif (now < start) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (!started) {\n\t\t\t\tstarted = true;\n\n\t\t\t\tconst prev = this.#current.v;\n\n\t\t\t\tfn = interpolate(prev, value);\n\n\t\t\t\tif (typeof duration === 'function') {\n\t\t\t\t\tduration = duration(prev, value);\n\t\t\t\t}\n\n\t\t\t\tprevious_task?.abort();\n\t\t\t}\n\n\t\t\tconst elapsed = now - start;\n\n\t\t\tif (elapsed > /** @type {number} */ (duration)) {\n\t\t\t\tset(this.#current, value);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tset(this.#current, fn(easing(elapsed / /** @type {number} */ (duration))));\n\t\t\treturn true;\n\t\t});\n\n\t\treturn this.#task.promise;\n\t}\n\n\tget current() {\n\t\treturn get(this.#current);\n\t}\n\n\tget target() {\n\t\treturn get(this.#target);\n\t}\n\n\tset target(v) {\n\t\tthis.set(v);\n\t}\n}\n","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","/** @import { FlipParams, AnimationConfig } from './public.js' */\nimport { cubicOut } from '../easing/index.js';\n\n/**\n * The flip function calculates the start and end position of an element and animates between them, translating the x and y values.\n * `flip` stands for [First, Last, Invert, Play](https://aerotwist.com/blog/flip-your-animations/).\n *\n * @param {Element} node\n * @param {{ from: DOMRect; to: DOMRect }} fromTo\n * @param {FlipParams} params\n * @returns {AnimationConfig}\n */\nexport function flip(node, { from, to }, params = {}) {\n\tvar { delay = 0, duration = (d) => Math.sqrt(d) * 120, easing = cubicOut } = params;\n\n\tvar style = getComputedStyle(node);\n\n\t// find the transform origin, expressed as a pair of values between 0 and 1\n\tvar transform = style.transform === 'none' ? '' : style.transform;\n\tvar [ox, oy] = style.transformOrigin.split(' ').map(parseFloat);\n\tox /= node.clientWidth;\n\toy /= node.clientHeight;\n\n\t// calculate effect of parent transforms and zoom\n\tvar zoom = get_zoom(node); // https://drafts.csswg.org/css-viewport/#effective-zoom\n\tvar sx = node.clientWidth / to.width / zoom;\n\tvar sy = node.clientHeight / to.height / zoom;\n\n\t// find the starting position of the transform origin\n\tvar fx = from.left + from.width * ox;\n\tvar fy = from.top + from.height * oy;\n\n\t// find the ending position of the transform origin\n\tvar tx = to.left + to.width * ox;\n\tvar ty = to.top + to.height * oy;\n\n\t// find the translation at the start of the transform\n\tvar dx = (fx - tx) * sx;\n\tvar dy = (fy - ty) * sy;\n\n\t// find the relative scale at the start of the transform\n\tvar dsx = from.width / to.width;\n\tvar dsy = from.height / to.height;\n\n\treturn {\n\t\tdelay,\n\t\tduration: typeof duration === 'function' ? duration(Math.sqrt(dx * dx + dy * dy)) : duration,\n\t\teasing,\n\t\tcss: (t, u) => {\n\t\t\tvar x = u * dx;\n\t\t\tvar y = u * dy;\n\t\t\tvar sx = t + u * dsx;\n\t\t\tvar sy = t + u * dsy;\n\n\t\t\treturn `transform: ${transform} translate(${x}px, ${y}px) scale(${sx}, ${sy});`;\n\t\t}\n\t};\n}\n\n/**\n * @param {Element} element\n */\nfunction get_zoom(element) {\n\tif ('currentCSSZoom' in element) {\n\t\treturn /** @type {number} */ (element.currentCSSZoom);\n\t}\n\n\t/** @type {Element | null} */\n\tvar current = element;\n\tvar zoom = 1;\n\n\twhile (current !== null) {\n\t\tzoom *= +getComputedStyle(current).zoom;\n\t\tcurrent = /** @type {Element | null} */ (current.parentElement);\n\t}\n\n\treturn zoom;\n}\n","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","\n\n{#if desc}{desc}{/if}{#if title}{title}{/if}","import { en } from './i18n/index.js';\n\nexport default {\n theme: 'sdt-calendar-colors',\n format: 'yyyy-mm-dd',\n formatType: 'standard',\n displayFormat: null,\n displayFormatType: null,\n minuteIncrement: 1,\n weekStart: 1,\n inputClasses: '',\n todayBtnClasses: 'sdt-action-btn sdt-today-btn',\n clearBtnClasses: 'sdt-action-btn sdt-clear-btn',\n hourOnly: false,\n todayBtn: true,\n clearBtn: true,\n clearToggle: true,\n autocommit: true,\n i18n: en\n}\n","//==============================================================\n/* *\n * always keep sorted alphabetically, when adding new locale *\n * */\n//==============================================================\n\n/**\n * @typedef {object} i18nType\n * @property {string[]} days\n * @property {string[]} daysShort\n * @property {string[]} daysMin\n * @property {string[]} months\n * @property {string[]} monthsShort\n * @property {string[]} meridiem\n * @property {string[]} suffix\n * @property {string} todayBtn\n * @property {string} clearBtn\n * @property {string} okBtn\n * @property {string} cancelBtn\n * @property {string} timeView\n * @property {string} backToDate\n*/\n\n/**\n * @type {i18nType} Arabic translation by Amine Laaraf\n */\nexport const ar_DZ = {\n days: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت', 'الأحد'],\n daysShort: ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت', 'أحد'],\n daysMin: ['أح', 'اث', 'ثل', 'أر', 'خم', 'جم', 'سب', 'أح'],\n months: ['جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان', 'جويلية', 'أوت', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'],\n monthsShort: ['جان', 'فيف', 'مار', 'أفر', 'ماي', 'جوا', 'جوي', 'أوت', 'سبت', 'أكت', 'نوف', 'ديس'],\n meridiem: ['صباح', 'مساء'],\n suffix: ['', '', '', ''],\n todayBtn: 'اليوم',\n clearBtn: 'مسح',\n okBtn: 'تأكيد',\n cancelBtn: 'إلغاء',\n timeView: 'عرض الوقت',\n backToDate: 'العودة إلى عرض التقويم'\n};\n\n/**\n * @type {i18nType} Arabic translation by Amine Laaraf\n */\nexport const ar_MR = {\n days: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت', 'الأحد'],\n daysShort: ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت', 'أحد'],\n daysMin: ['أح', 'اث', 'ثل', 'أر', 'خم', 'جم', 'سب', 'أح'],\n months: ['يناير', 'فبراير', 'مارس', 'أبريل', 'ماي', 'يونيو', 'يوليوز', 'غشت', 'شتنبر', 'أكتوبر', 'نونبر', 'دجنبر'],\n monthsShort: ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'غش', 'شت', 'أكت', 'نون', 'دج'],\n meridiem: ['صباح', 'مساء'],\n suffix: ['', '', '', ''],\n todayBtn: 'اليوم',\n clearBtn: 'مسح',\n okBtn: 'تأكيد',\n cancelBtn: 'إلغاء',\n timeView: 'عرض الوقت',\n backToDate: 'العودة إلى عرض التقويم'\n};\n\n/**\n * @type {i18nType} Arabic translation by Amine Laaraf\n */\nexport const ar_YE = {\n days: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت', 'الأحد'],\n daysShort: ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت', 'أحد'],\n daysMin: ['أح', 'اث', 'ثل', 'أر', 'خم', 'جم', 'سب', 'أح'],\n months: ['يناير', 'فبراير', 'مارس', 'إبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'],\n monthsShort: ['ينا', 'فبر', 'مار', 'إبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'],\n meridiem: ['صباح', 'مساء'],\n suffix: ['', '', '', ''],\n todayBtn: 'اليوم',\n clearBtn: 'مسح',\n okBtn: 'تأكيد',\n cancelBtn: 'إلغاء',\n timeView: 'عرض الوقت',\n backToDate: 'العودة إلى عرض التقويم'\n}\n\n/**\n * @type {i18nType} Czech translation\n */\nexport const cz = {\n days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],\n daysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],\n daysMin: ['Ne', 'Po', 'Út', 'St', 'Čt', 'Pá', 'So', 'Ne'],\n months: ['Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen', 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec'],\n monthsShort: ['Led', 'Úno', 'Bře', 'Dub', 'Kvě', 'Čer', 'Čer', 'Srp', 'Zář', 'Říj', 'List', 'Pro'],\n meridiem: ['am', 'pm'],\n suffix: ['st', 'nd', 'rd', 'th'],\n todayBtn: 'Dnes',\n clearBtn: 'Smazat',\n okBtn: 'Ok',\n cancelBtn: 'Zrušit',\n timeView: 'Zobrazit hodiny',\n backToDate: 'Zpátky na kalendář'\n}\n\n/**\n * @type {i18nType} German translation by emroc GmbH\n */\nexport const de = {\n days: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag'],\n daysShort: ['Son', 'Mon', 'Die', 'Mie', 'Don', 'Fre', 'Sam', 'Son'],\n daysMin: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'],\n months: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],\n monthsShort: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],\n meridiem: ['am', 'pm'],\n suffix: ['', '', '', ''],\n todayBtn: 'Heute',\n clearBtn: 'Zurücksetzen',\n okBtn: 'Ok',\n cancelBtn: 'Abbrechen',\n timeView: 'Zeitansicht anzeigen',\n backToDate: 'Zurück zur Kalenderansicht'\n}\n\n/**\n * @type {i18nType} English translation\n */\nexport const en = {\n days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],\n daysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],\n daysMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'],\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n meridiem: ['am', 'pm'],\n suffix: ['st', 'nd', 'rd', 'th'],\n todayBtn: 'Today',\n clearBtn: 'Clear',\n okBtn: 'Ok',\n cancelBtn: 'Cancel',\n timeView: 'Show time view',\n backToDate: 'Back to calendar view'\n}\n\n\n/**\n * @type {i18nType} Spanish translation by markoan\n */\n\nexport const es = {\n days: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado', 'Domingo'],\n daysShort: ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb', 'Dom'],\n daysMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa', 'Do'],\n months: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],\n monthsShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],\n meridiem: ['am', 'pm'],\n suffix: ['o', '', '', ''],\n todayBtn: 'Hoy',\n clearBtn: 'Borrar',\n okBtn: 'Aceptar',\n cancelBtn: 'Cancelar',\n timeView: 'Mostrar hora',\n backToDate: 'Regresar al calendario'\n}\n\n/**\n * @type {i18nType} Persian (Farsi) translation by sadegh19b\n */\nexport const fa = {\n days: ['یکشنبه', 'دوشنبه', 'سه‌شنبه‌', 'چهارشنبه', 'پنج‌شنبه', 'جمعه', 'شنبه', 'یکشنبه'],\n daysShort: ['یکش', 'دوش', 'سه‌ش', 'چهار', 'پنج', 'جمع', 'شنب', 'یکش'],\n daysMin: ['یک', 'دو', 'سه', 'چا', 'پن', 'جم', 'شن', 'یک'],\n months: ['ژانویه', 'فوریه', 'مارس', 'آپریل', 'می', 'ژوئن', 'جولای', 'آگوست', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'],\n monthsShort: ['ژان', 'فور', 'مار', 'آپر', 'می', 'ژو', 'جول', 'آگو', 'سپت', 'اکت', 'نوا', 'دسا'],\n meridiem: ['ق.ض', 'ب.ض'],\n suffix: ['st', 'nd', 'rd', 'th'],\n todayBtn: 'امروز',\n clearBtn: 'پاک‌کردن',\n okBtn: 'تایید',\n cancelBtn: 'لغو',\n timeView: 'نمایش بخش زمان',\n backToDate: 'بازگشت به بخش تقویم'\n}\n\n/**\n * @type {i18nType} French translation by Tuditi\n */\nexport const fr = {\n days: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche'],\n daysShort: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam', 'Dim'],\n daysMin: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa', 'Di'],\n months: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],\n monthsShort: ['Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Aoû', 'Sep', 'Oct', 'Nov', 'Déc'],\n meridiem: ['AM', 'PM'],\n suffix: ['er', 'ème', 'ème', 'ème'],\n todayBtn: 'Aujourd\\'hui',\n clearBtn: 'Effacer',\n okBtn: 'OK',\n cancelBtn: 'Annuler',\n timeView: 'Afficher l\\'heure',\n backToDate: 'Retour au calendrier'\n}\n\n/**\n * @type {i18nType} Croatian translation by AntonioStipic\n */\nexport const hr = {\n days: ['Nedjelja', 'Ponedjeljak', 'Utorak', 'Srijeda', 'Četvrtak', 'Petak', 'Subota', 'Nedjelja'],\n daysShort: ['Ned', 'Pon', 'Uto', 'Sri', 'Čet', 'Pet', 'Sub', 'Ned'],\n daysMin: ['Ne', 'Po', 'Ut', 'Sr', 'Čt', 'Pt', 'Su', 'Ne'],\n months: ['Siječanj', 'Veljača', 'Ožujak', 'Travanj', 'Svibanj', 'Lipanj', 'Srpanj', 'Kolovoz', 'Rujan', 'Listopad', 'Studeni', 'Prosinac'],\n monthsShort: ['Sij', 'Vel', 'Ožu', 'Tra', 'Svi', 'Lip', 'Srp', 'Kol', 'Ruj', 'Lis', 'Stu', 'Pro'],\n meridiem: ['am', 'pm'],\n suffix: ['', '', '', ''],\n todayBtn: 'Danas',\n clearBtn: 'Očisti',\n okBtn: 'OK',\n cancelBtn: 'Prekid',\n timeView: 'Prikaži vrijeme',\n backToDate: 'Nazad na kalendar'\n}\n\n/**\n * @type {i18nType} Hungarian translation by Tuditi\n */\nexport const hu = {\n days: ['Vasárnap', 'Hétfő', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat', 'Vasárnap'],\n daysShort: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo', 'V'],\n daysMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo', 'V'],\n months: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június', 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'],\n monthsShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún', 'Júl', 'Aug', 'Szept', 'Okt', 'Nov', 'Dec'],\n meridiem: ['de', 'du'],\n suffix: ['.', '.', '.', '.'],\n todayBtn: 'Ma',\n clearBtn: 'Törlés',\n okBtn: 'OK',\n cancelBtn: 'Áthúz',\n timeView: 'Óra nézet',\n backToDate: 'Vissza a naptárhoz'\n};\n\n/**\n * @type {i18nType} Indonesian translation\n */\nexport const id = {\n days: ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu', 'Minggu'],\n daysShort: ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab', 'Min'],\n daysMin: ['Mn', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sb', 'Mn'],\n months: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'],\n monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agu', 'Sep', 'Okt', 'Nov', 'Des'],\n meridiem: ['am', 'pm'],\n suffix: ['st', 'nd', 'rd', 'th'],\n todayBtn: 'Hari Ini',\n clearBtn: 'Hapus',\n okBtn: 'Mengkonfirmasi',\n cancelBtn: 'Batal',\n timeView: 'Tampilkan tampilan waktu',\n backToDate: 'Kembali ke tampilan kalender'\n}\n\n/**\n * @type {i18nType} Japanese translation by aska\n */\nexport const jp = {\n days: ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日', '日曜日'],\n daysShort: ['日曜', '月曜', '火曜', '水曜', '木曜', '金曜', '土曜', '日曜'],\n daysMin: ['日', '月', '火', '水', '木', '金', '土', '日'],\n months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],\n monthsShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],\n meridiem: ['am', 'pm'],\n suffix: ['', '', '', ''],\n todayBtn: '今日',\n clearBtn: 'クリア',\n okBtn: '確認する',\n cancelBtn: 'キャンセル',\n timeView: 'タイムを表示',\n backToDate: 'カレンダーに戻る'\n}\n\n/**\n * @type {i18nType} Dutch Translation by Tuditi\n */\nexport const nl = {\n days: ['Zondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrijdag', 'Zaterdag', 'Zondag'],\n daysShort: ['Zon', 'Maa', 'Din', 'Woe', 'Don', 'Vri', 'Zat', 'Zon'],\n daysMin: ['Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za', 'Zo'],\n months: ['Januari', 'Februari', 'Maart', 'April', 'Mei', 'Juni', 'Juli', 'Augustus', 'September', 'Oktober', 'November', 'December'],\n monthsShort: ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'],\n meridiem: ['AM', 'PM'],\n suffix: ['e', 'e', 'e', 'e'],\n todayBtn: 'Vandaag',\n clearBtn: 'Wissen',\n okBtn: 'OK',\n cancelBtn: 'Annuleren',\n timeView: 'Uurweergave',\n backToDate: 'Terug naar de kalender'\n};\n\n/**\n * @type {i18nType} Slovak Translation\n */\nexport const sk = {\n days: ['Nedeľa', 'Pondelok', 'Utorok', 'Streda', 'Štvrtok', 'Piatok', 'Sobota', 'Nedeľa'],\n daysShort: ['Ned', 'Pon', 'Uto', 'Str', 'Štv', 'Pia', 'Sob', 'Ned'],\n daysMin: ['Ne', 'Po', 'Ut', 'St', 'Št', 'Pi', 'So', 'Ne'],\n months: ['Január', 'Február', 'Marec', 'Apríl', 'Máj', 'Jún', 'Júl', 'August', 'September', 'Október', 'November', 'December'],\n monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Máj', 'Jún', 'Júl', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'],\n meridiem: ['am', 'pm'],\n suffix: ['st', 'nd', 'rd', 'th'],\n todayBtn: 'Dnes',\n clearBtn: 'Zmazať',\n okBtn: 'Ok',\n cancelBtn: 'Zrušiť',\n timeView: 'Zobraziť hodiny',\n backToDate: 'Späť na kalendár'\n}\n\n/**\n * @type {i18nType} Korean translation\n */\nexport const ko = {\n days: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일', '일요일'],\n daysShort: ['일', '월', '화', '수', '목', '금', '토', '일'],\n daysMin: ['일', '월', '화', '수', '목', '금', '토', '일'],\n months: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],\n monthsShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],\n meridiem: ['오전', '오후'],\n suffix: ['', '', '', ''],\n todayBtn: '오늘',\n clearBtn: '지우기',\n okBtn: '확인하다',\n cancelBtn: '취소',\n timeView: '시계보기',\n backToDate: '달력보기'\n}\n\n/**\n * @type {i18nType} Latin translation by PSYCHONOISE \n */\nexport const la = {\n days: ['Solis', 'Lunae', 'Martis', 'Mercuri', 'Jovis', 'Veneris', 'Saturni', 'Solis'],\n daysShort: ['Sol', 'Lun', 'Mar', 'Mer', 'Jov', 'Ven', 'Sat', 'Sol'],\n daysMin: ['So', 'Lu', 'Ma', 'Me', 'Jo', 'Ve', 'Sa', 'So'],\n months: ['Januarius', 'Februarius', 'Martius', 'Aprilis', 'Maius', 'Iunius', 'Iulius', 'Augustus', 'September', 'October', 'November', 'December'],\n monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Iun', 'Qui', 'Sex', 'Sep', 'Oct', 'Nov', 'Dec'],\n meridiem: ['am', 'pm'],\n suffix: ['us', 'us', 'us', 'us'],\n todayBtn: 'Hodie',\n clearBtn: 'Patet',\n okBtn: 'ОК',\n cancelBtn: 'Cancel',\n timeView: 'Ostende tempus visum',\n backToDate: 'Ad visum calendarium'\n}\n\n/**\n * @type {i18nType} Brazilian portuguese translation by IgorDalepiane\n */\nexport const pt_BR = {\n days: ['Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sábado', 'Domingo'],\n daysShort: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb', 'Dom'],\n daysMin: ['Do', 'Se', 'Te', 'Qu', 'Qu', 'Se', 'Sá', 'Do'],\n months: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],\n monthsShort: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],\n meridiem: ['am', 'pm'],\n suffix: ['º', 'º', 'º', 'º'],\n todayBtn: 'Hoje',\n clearBtn: 'Limpar',\n okBtn: 'OK',\n cancelBtn: 'Cancelar',\n timeView: 'Mostrar hora',\n backToDate: 'Voltar para o calendário'\n}\n\n/**\n * @type {i18nType} Russian translation by PSYCHONOISE \n */\nexport const ru = {\n days: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота', 'Воскресенье'],\n daysShort: ['Вск', 'Пнд', 'Втр', 'Срд', 'Чтв', 'Птн', 'Сбт', 'Вск'],\n daysMin: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'],\n months: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],\n monthsShort: ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'],\n meridiem: ['AM', 'PM'],\n suffix: ['.', '.', '.', '.'],\n todayBtn: 'Сегодня',\n clearBtn: 'Очистить',\n okBtn: 'ОК',\n cancelBtn: 'Отмена',\n timeView: 'Показать вид времени',\n backToDate: 'Вернуться к виду календаря'\n}\n\n/**\n * @type {i18nType} Italian translation by MarkNerdi\n */\nexport const it = {\n days: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato', 'Domenica'],\n daysShort: ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab', 'Dom'],\n daysMin: ['Do', 'Lu', 'Ma', 'Me', 'Gi', 'Ve', 'Sa', 'Do'],\n months: ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'],\n monthsShort: ['Gen', 'Feb', 'Mar', 'Apr', 'Mag', 'Giu', 'Lug', 'Ago', 'Set', 'Ott', 'Nov', 'Dic'],\n meridiem: ['am', 'pm'],\n suffix: ['º', 'º', 'º', 'º'],\n todayBtn: 'Oggi',\n clearBtn: 'Cancella',\n okBtn: 'Ok',\n cancelBtn: 'Annulla',\n timeView: 'Mostra orario',\n backToDate: 'Torna alla vista calendario'\n}\n\n/**\n * @type {i18nType} Turkish translation by semih-ky\n */\nexport const tr = {\n days: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi', 'Pazar'],\n daysShort: ['Paz', 'Pzt', 'Sal', 'Çar', 'Per', 'Cum', 'Cmt', 'Paz'],\n daysMin: ['Pa', 'Pz', 'Sa', 'Ça', 'Pe', 'Cu', 'Cm', 'Pa'],\n months: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'],\n monthsShort: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'],\n meridiem: ['öö', 'ös'],\n suffix: ['.', '.', '.', '.'],\n todayBtn: 'Bugün',\n clearBtn: 'Temizle',\n okBtn: 'Ok',\n cancelBtn: 'İptal',\n timeView: 'Zaman görünümünü göster',\n backToDate: 'Takvim görünümüne geri dön'\n}\n\n/**\n * @type {i18nType} Swedish translation by brantsrasmus\n */\nexport const sv = {\n days: ['Söndag', 'Måndag', 'Tisdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lördag', 'Söndag'],\n daysShort: ['Sön', 'Mån', 'Tis', 'Ons', 'Tor', 'Fre', 'Lör', 'Sön'],\n daysMin: ['Sö', 'Må', 'Ti', 'On', 'To', 'Fr', 'Lö', 'Sö'],\n months: ['Januari', 'Februari', 'Mars', 'April', 'Maj', 'Juni', 'Juli', 'Augusti', 'September', 'Oktober', 'November', 'December'],\n monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'],\n meridiem: ['am', 'pm'],\n suffix: ['.', '.', '.', '.'],\n todayBtn: 'Idag',\n clearBtn: 'Rensa',\n okBtn: 'Ok',\n cancelBtn: 'Avbryt',\n timeView: 'Visa tid',\n backToDate: 'Tillbaka till kalender'\n}\n\n/**\n * @type {i18nType} Danish translation by brantsrasmus\n */\nexport const da = {\n days: ['Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag', 'Søndag'],\n daysShort: ['Søn', 'Man', 'Tir', 'Ons', 'Tor', 'Fre', 'Lør', 'Søn'],\n daysMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø', 'Sø'],\n months: ['Januar', 'Februar', 'Marts', 'April', 'Maj', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'December'],\n monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'],\n meridiem: ['am', 'pm'],\n suffix: ['.', '.', '.', '.'],\n todayBtn: 'I dag',\n clearBtn: 'Slet',\n okBtn: 'Ok',\n cancelBtn: 'Annuller',\n timeView: 'Vis tid',\n backToDate: 'Tilbage til kalenderen'\n}\n\n/**\n * @type {i18nType} Thai translation by kodaicoder\n */\nexport const th = {\n days: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์', 'อาทิตย์'],\n daysShort: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.', 'อา.'],\n daysMin: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.', 'อา.'],\n months: ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'],\n monthsShort: ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'],\n meridiem: ['am', 'pm'],\n suffix: ['', '', '', ''],\n todayBtn: 'วันนี้',\n clearBtn: 'ล้างข้อมูล',\n okBtn: 'ยืนยัน',\n cancelBtn: 'ปิด',\n timeView: 'แสดงหน้าเลือกเวลา',\n backToDate: 'กลับไปหน้าปฏิทิน'\n}\n\n/**\n * @type {i18nType} Chinese Simplified translation by shiroko \n */\nexport const zh_CN = {\n days: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'],\n daysShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六', '周日'],\n daysMin: ['日', '一', '二', '三', '四', '五', '六', '日'],\n months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],\n monthsShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],\n meridiem: ['上午', '下午'],\n suffix: ['', '', '', ''],\n todayBtn: '今天',\n clearBtn: '清空',\n okBtn: '好的',\n cancelBtn: '取消',\n timeView: '显示时间选择',\n backToDate: '回退到日历选项卡'\n}\n\n/**\n * IMPORTANT: always keep it sorted alphabetically\n *\n * @type {Record}\n */\nexport default {\n ar_DZ, ar_MR, ar_YE, cz, da, de, en, es, fr, hr, hu, id, it, jp, ko, la, nl, pt_BR, ru, sk, sv, th, tr, zh_CN\n}","export const MODE_DECADE = 0;\nexport const MODE_YEAR = 1;\nexport const MODE_MONTH = 2;\n\nexport const STARTVIEW_TIME = 3;\n","/** @typedef {import(\"../i18n\").i18nType} i18nType */\n\n/**\n *\n * @param {Date|string} date\n * @param {string} format\n * @param {i18nType} i18n\n * @param {string} type\n * @returns {Date}\n */\nexport function parseDate(date, format, i18n, type) {\n if (date instanceof Date) {\n return date;\n // const dateUTC = new Date(date.valueOf() + date.getTimezoneOffset() * 60000);\n // dateUTC.setMilliseconds(0);\n // return dateUTC;\n }\n const commonFormats = type === 'php'\n ? { date: 'Y-m-d', datetime: 'Y-m-d H:i', datetime_s: 'Y-m-d H:i:s' }\n : { date: 'yyyy-mm-dd', datetime: 'yyyy-mm-dd hh:ii', datetime_s: 'yyyy-mm-dd hh:ii:ss' };\n /** @var {{ separators: string[], parts: string[]}} */\n let parsedFormat;\n let useParsedTime;\n if (/^\\d{4}\\-\\d{1,2}\\-\\d{1,2}$/.test(date)) {\n parsedFormat = formatHelper.parseFormat(commonFormats.date, type);\n } else\n if (/^\\d{4}\\-\\d{1,2}\\-\\d{1,2}[T ]\\d{1,2}\\:\\d{1,2}$/.test(date)) {\n parsedFormat = formatHelper.parseFormat(commonFormats.datetime, type);\n } else\n if (/^\\d{4}\\-\\d{1,2}\\-\\d{1,2}[T ]\\d{1,2}\\:\\d{1,2}\\:\\d{1,2}[Z]{0,1}$/.test(date)) {\n parsedFormat = formatHelper.parseFormat(commonFormats.datetime_s, type);\n } else\n // specific case when parsing time without 'nonPunctuation' ref #102\n if (/^([01]*\\d|2[0-3])([0-5]\\d)(?:[ ]([ap][m]|[AP][M]))?$/.test(date)) {\n useParsedTime = date.match(/^([01]*\\d|2[0-3])([0-5]\\d)(?:[ ]([ap][m]|[AP][M]))?$/)?.slice(1).filter(e => e);\n parsedFormat = formatHelper.parseFormat(format, type);\n\n } else {\n parsedFormat = formatHelper.parseFormat(format, type);\n }\n const parts = useParsedTime\n ? useParsedTime\n : (date && date.toString().match(formatHelper.nonpunctuation) || []);\n date = new Date(); // reset date\n date.setHours(0,0,0,0);\n /** @type {Record} */\n const parsed = {};\n const { setters_order, setters_map } = formatHelper.setters(type);\n let val, part;\n if (parts.length !== parsedFormat.parts.length && parsedFormat.parts.includes('S')) { // specific suffix parsing from string like '14th'\n const splitSuffix = parts[parsedFormat.parts.indexOf('S') - 1].match(/(\\d+)([a-zA-Z]+)/)?.slice(1,3);\n // @ts-ignore\n parts.splice(parsedFormat.parts.indexOf('S') - 1, 1, ...splitSuffix);\n }\n if (parts.length === parsedFormat.parts.length) {\n for (var i = 0, cnt = parsedFormat.parts.length; i < cnt; i++) {\n val = parseInt(parts[i], 10);\n part = parsedFormat.parts[i];\n if (isNaN(val)) {\n if (type === 'standard') {\n switch (part) {\n case 'MM':\n val = i18n.months.indexOf(parts[i]) + 1;\n break;\n case 'M':\n val= i18n.monthsShort.indexOf(parts[i]) + 1;\n break;\n case 'p':\n case 'P':\n val = i18n.meridiem.indexOf(parts[i].toLowerCase());\n break;\n }\n } else {\n // php\n switch (part) {\n case 'D':\n val = i18n.daysShort.indexOf(parts[i]) + 1;\n break;\n case 'l':\n val = i18n.days.indexOf(parts[i]) + 1;\n break;\n case 'F':\n val = i18n.months.indexOf(parts[i]) + 1;\n break;\n case 'M':\n val= i18n.monthsShort.indexOf(parts[i]) + 1;\n break;\n case 'a':\n case 'A':\n val = i18n.meridiem.indexOf(parts[i].toLowerCase());\n break;\n }\n }\n }\n parsed[part] = val;\n }\n for (var i = 0, s; i < setters_order.length; i++) {\n s = setters_order[i];\n if (s in parsed && !isNaN(parsed[s]))\n setters_map[`${s}`] && setters_map[`${s}`](date, parsed[s])\n }\n }\n return date;\n}\n\n/**\n * @param {Date} date\n * @param {string} format\n * @param {i18nType} i18n\n * @param {string} type\n * @returns {string} date' string representation\n */\nexport function formatDate(date, format, i18n, type) {\n if (date === null) {\n return '';\n }\n const dateVal = date.getDate();\n /** @type {Record} */\n let val;\n if (type === 'standard') {\n val = {\n t: date.getTime(),\n // year\n yy: date.getFullYear().toString().substring(2),\n yyyy: date.getFullYear(),\n // month\n m: date.getMonth() + 1,\n M: i18n.monthsShort[date.getMonth()],\n MM: i18n.months[date.getMonth()],\n // day\n d: dateVal,\n D: i18n.daysShort[date.getDay()],\n DD: i18n.days[date.getDay()],\n S: (dateVal % 10 && dateVal % 10 < 4 && (dateVal < 10 || dateVal > 14) ? i18n.suffix[dateVal % 10 - 1] : i18n.suffix[i18n.suffix.length -1 ]),\n p: (i18n.meridiem.length === 2 ? i18n.meridiem[date.getHours() < 12 ? 0 : 1] : ''),\n // hour\n h: date.getHours(),\n // minute\n ii: (date.getMinutes() < 10 ? '0' : '') + date.getMinutes(),\n // second\n ss: (date.getUTCSeconds() < 10 ? '0' : '') + date.getUTCSeconds()\n };\n\n if (i18n.meridiem.length === 2) {\n val.H = (val.h % 12 === 0 ? 12 : val.h % 12);\n }\n else {\n val.H = val.h;\n }\n val.HH = (val.H < 10 ? '0' : '') + val.H;\n val.P = val.p.toUpperCase();\n val.hh = (val.h < 10 ? '0' : '') + val.h;\n val.i = val.ii;\n val.s = val.ss;\n val.dd = (val.d < 10 ? '0' : '') + val.d;\n val.mm = (val.m < 10 ? '0' : '') + val.m;\n } else if (type === 'php') {\n // php format\n val = {\n // year\n y: date.getFullYear().toString().substring(2),\n Y: date.getFullYear(),\n // month\n F: i18n.months[date.getMonth()],\n M: i18n.monthsShort[date.getMonth()],\n n: date.getMonth() + 1,\n t: getDaysInMonth(date.getFullYear(), date.getMonth()),\n // day\n j: date.getDate(),\n l: i18n.days[date.getDay()],\n D: i18n.daysShort[date.getDay()],\n w: date.getDay(), // 0 -> 6\n N: (date.getDay() === 0 ? 7 : date.getDay()), // 1 -> 7\n S: (dateVal % 10 && dateVal % 10 < 4 && (dateVal < 10 || dateVal > 14) ? i18n.suffix[dateVal % 10 - 1] : i18n.suffix[i18n.suffix.length -1 ]),\n // hour\n a: (i18n.meridiem.length === 2 ? i18n.meridiem[date.getHours() < 12 ? 0 : 1] : ''),\n g: (date.getHours() % 12 === 0 ? 12 : date.getHours() % 12),\n G: date.getHours(),\n // minute\n i: date.getMinutes(),\n // second\n s: date.getSeconds(),\n U: Math.floor(date.getTime() / 1000)\n };\n val.m = (val.n < 10 ? '0' : '') + val.n;\n val.d = (val.j < 10 ? '0' : '') + val.j;\n val.A = val.a.toString().toUpperCase();\n val.h = (val.g < 10 ? '0' : '') + val.g;\n val.H = (val.G < 10 ? '0' : '') + val.G;\n val.i = (val.i < 10 ? '0' : '') + val.i;\n val.s = (val.s < 10 ? '0' : '') + val.s;\n } else {\n throw new Error('Invalid format type.');\n }\n let dateArr = [];\n const pFormat = formatHelper.parseFormat(format, type);\n for (var i = 0, cnt = pFormat.parts?.length || 0; i < cnt; i++) {\n if (pFormat.separators.length) {\n dateArr.push(pFormat.separators.shift());\n }\n dateArr.push(val[pFormat.parts[i]]);\n }\n if (pFormat.separators.length) {\n dateArr.push(pFormat.separators.shift());\n }\n return dateArr.join('');\n}\n\n\n/**\n * @param {number} year\n * @param {number} month\n * @returns {number}\n */\nexport function getDaysInMonth(year, month) {\n const isLeapYear = (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0));\n return [31, (isLeapYear ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]\n}\n\n/**\n * Date comparison a < b\n *\n * @param {Date|string} a\n * @param {Date} b\n * @returns\n */\nexport function isLower(a, b) {\n if (!(a instanceof Date)) return false;\n return a.getFullYear() < b.getFullYear()\n || (a.getMonth() < b.getMonth() || a.getDate() < b.getDate());\n}\n\n/**\n * Date comparison a > b\n *\n * @param {Date|string} a\n * @param {Date} b\n * @returns\n */\nexport function isGreater(a, b) {\n if (!(a instanceof Date)) return false;\n return a.getFullYear() > b.getFullYear()\n || (a.getMonth() > b.getMonth() || a.getDate() > b.getDate());\n}\n\n/**\n * @callback MapperFunction\n * @param {Date} d date\n * @param {number} v value to be set according to format\n * @returns void\n *\n * @typedef {Record} SetterMap\n */\n\nconst formatHelper = {\n validParts: function(/** @type {string} */ type) {\n if (type === 'standard') {\n return /t|hh?|HH?|p|P|z|ii?|ss?|dd?|DD?|S|mm?|MM?|yy(?:yy)?/g;\n } else if (type === 'php') {\n return /[dDjlNwzFmMnStyYaABgGhHisU]/g;\n } else {\n throw new Error('Invalid format type.');\n }\n },\n nonpunctuation: /[^ -\\/:-@\\[-`{-~\\t\\n\\rTZ]+/g,\n /**\n *\n * @param {string} format\n * @param {string} type\n * @returns {{ separators: string[], parts: string[]} }\n */\n parseFormat: function (/** @type {string} */ format, /** @type {string} */ type) {\n // IE treats \\0 as a string end in inputs (truncating the value),\n // so it's a bad format delimiter, anyway\n var separators = format.replace(this.validParts(type), '\\0').split('\\0'),\n parts = format.match(this.validParts(type)) || [];\n if (!separators || !separators.length || !parts || parts.length === 0) {\n // throw new Error('Invalid date format.');\n console.warn('invalid date format', separators, parts);\n }\n return {separators: separators, parts: parts};\n },\n /**\n * @param {string} type\n * @returns {{setters_map: SetterMap, setters_order: string[]}}\n */\n setters: function(type) {\n /** @type {string[]} */\n let setters_order\n /** @type {SetterMap} */\n let setters_map = {};\n if (type === 'standard') {\n setters_order = ['yyyy', 'yy', 'm', 'mm', 'M', 'MM','d', 'dd', 'D','DD', 'hh', 'h', 'HH', 'H', 'ii', 'i', 'ss', 's', 'S', 'p', 'P', 't'];\n setters_map = {\n hh: (d, v) => d.setHours(v),\n h: (d, v) => d.setHours(v),\n HH: (d, v) => d.setHours(v === 12 ? 0 : v),\n H: (d, v) => d.setHours(v === 12 ? 0 : v),\n i: (d, v) => d.setMinutes(v),\n s: (d, v) => d.setSeconds(v),\n yyyy: (d, v) => d.setFullYear(v),\n yy: (d, v) => d.setFullYear((v < 50 ? 2000 : 1900) + v),\n m: (d, v) => {\n v -= 1;\n while (v < 0) v += 12;\n v %= 12;\n d.setMonth(v);\n while (d.getMonth() !== v)\n if (isNaN(d.getMonth()))\n return d;\n else\n d.setDate(d.getDate() - 1);\n return d;\n },\n d: (d, v) => d.setDate(v),\n p: (d, v) => d.setHours(v === 1 && d.getHours() < 12 ? d.getHours() + 12 : d.getHours()),\n t: (d, v) => d.setTime(v),\n mm: ()=>{},\n M: ()=>{},\n MM: ()=>{},\n ii: ()=>{},\n ss: ()=>{},\n dd: ()=>{},\n D: ()=>{},\n DD: ()=>{},\n P: ()=>{}\n };\n setters_map.mm = setters_map.M = setters_map.MM = setters_map.m;\n setters_map.ii = setters_map.i;\n setters_map.ss = setters_map.s;\n setters_map.dd = setters_map.D = setters_map.DD = setters_map.d;\n setters_map.P = setters_map.p;\n } else {\n // php\n setters_order = ['Y','yy','m','M','F','n','d','D','j','l','N','S','H','G','h','g','i','s','p','P','U'];\n setters_map = {\n H: (d, v) => d.setHours(v),\n G: (d, v) => d.setHours(v),\n h: (d, v) => d.setHours(v === 12 ? 0 : v),\n g: (d, v) => d.setHours(v === 12 ? 0 : v),\n i: (d, v) => d.setMinutes(v),\n s: (d, v) => d.setSeconds(v),\n Y: (d, v) => d.setFullYear(v),\n yy: (d, v) => d.setFullYear((v < 50 ? 2000 : 1900) + v),\n m: (d, v) => {\n v -= 1;\n while (v < 0) v += 12;\n v %= 12;\n d.setMonth(v);\n while (d.getMonth() !== v)\n if (isNaN(d.getMonth()))\n return d;\n else\n d.setDate(d.getDate() - 1);\n return d;\n },\n n: (d, v) => d.setMonth(v - 1),\n d: (d, v) => d.setDate(v),\n a: (d, v) => d.setHours(v === 1 ? d.getHours() + 12 : d.getHours()),\n U: (d, v) => d.setTime(v * 1000)\n };\n setters_map.F = setters_map.M = setters_map.m;\n setters_map.D = setters_map.j = setters_map.l = setters_map.N = setters_map.d;\n setters_map.A = setters_map.a;\n }\n return { setters_order, setters_map };\n }\n}\n","import { cubicOut } from 'svelte/easing';\n\n\n/**\n *\n * @typedef {object} ScaleParams\n * @property {number} duration\n * @property {number} start\n * @property {number} opacity\n * @property {number|undefined} end\n *\n * @param {HTMLElement} node\n * @param {ScaleParams | import('svelte/transition').FadeParams} params\n * @returns {import('svelte/transition').TransitionConfig}\n */\n// @ts-ignore\nexport function scale(node, { duration = 400, start = 0, end = 1, opacity = 0 }) {\n const style = getComputedStyle(node);\n const target_opacity = +style.opacity;\n const transform = style.transform === 'none' ? '' : style.transform;\n const sd = 1 - start;\n const od = target_opacity * (1 - opacity);\n end = end || 1;\n return {\n delay: 0,\n duration,\n easing: cubicOut,\n css: (/** @type number */ _t, /** @type number */ u) => `\n transform: ${transform} scale(${end !== 1 ? start + end * u : 1 - (sd * u)});\n opacity: ${target_opacity - (od * u)};\n `\n };\n}\n","\n\n
\n \n {#if enableTimeToggle && dates.length}\n \n \n \n {/if}\n onTransformChangeMonth(-1)}\n disabled={disableButtonNav(activeDate, -1, currentView)}\n >\n \n \n onTransformChangeMonth(1)}\n disabled={disableButtonNav(activeDate, 1, currentView)}\n >\n \n \n
\n
\n
\n
\n {#if currentView === MODE_DECADE}\n \n onMonthTransitionTrigger && onMonthTransitionTrigger()}\n >\n {#each dataset.years as row, i}\n \n {#each row as year, j(j)}\n {@const idx = i*4+j}\n \n {/each}\n \n {/each}\n \n
\n \n
\n {/if}\n {#if currentView === MODE_YEAR}\n \n onMonthTransitionTrigger && onMonthTransitionTrigger()}\n >\n {#each dataset.months as row, i}\n \n {#each row as month, j(j)}\n {@const idx = i*4+j}\n \n {/each}\n \n {/each}\n \n
\n \n
\n {/if}\n {#if currentView === MODE_MONTH}\n \n \n \n {#each dayLabels as header}\n \n {/each}\n \n {#each dataset.days as row, i }\n \n {#each row as currDate, j(j)}\n {@const idx = i*7+j}\n {@const dateTime = currDate.getTime()}\n \n \n {/each}\n \n {/each}\n \n
{header}
\n \n
\n {/if}\n
\n\n\n","\nimport { MODE_YEAR, MODE_DECADE } from \"./constants.js\";\nimport { getDaysInMonth } from \"./dateUtils.js\";\n\n/**\n * @typedef {object} Dataset\n * @property {any[][]} grid\n * @property {Date[][]} days\n * @property {string[][]} months\n * @property {number[][]} years\n * @property {number[]} selectionMark\n * @property {number} todayMark\n * @property {number} prevTo\n * @property {number} nextFrom\n *\n * @typedef {import(\"../i18n\").i18nType} i18nType\n */\n\n/**\n * Compute view grid content based on given 'currentView' property\n *\n * @param {Date} currentDate\n * @param {Date[]} selectedDates\n * @param {number} view\n * @param {i18nType} locale\n * @param {number} weekStart\n * @returns {Dataset}\n */\nexport function compute(currentDate, selectedDates, view, locale, weekStart) {\n\n /** ************************************ MODE_DECADE: */\n /** ************************************ years 4 x 3 */\n if (view === MODE_DECADE) {\n let prevTo = 10; // base is year 2000\n let nextFrom = 20;\n const todayMark = -1;\n const grid = [];\n let yearRow = [];\n let currYear = currentDate.getFullYear() - (currentDate.getFullYear() % 10);\n currYear -= (currYear % 20 ? 12 : 10);\n if (currYear % 10) { // if start is 10\n prevTo = 12;\n nextFrom = 22;\n }\n for (let i = 0; i < 32; i++) {\n yearRow.push(currYear + i);\n if (yearRow.length === 4) {\n grid.push(yearRow);\n yearRow = [];\n }\n }\n /** @var number[] */\n let selectionMark = [];\n if (!selectedDates[0]) {\n selectedDates[0] = new Date();\n }\n if (selectedDates[0].getFullYear() >= currYear) {\n selectionMark.push(selectedDates[0].getFullYear() % currYear);\n }\n\n // @ts-ignore\n return {\n years: grid, todayMark, nextFrom, prevTo, selectionMark\n }\n }\n\n /** ************************************ MODE_YEAR: */\n /** ************************************ months 4 x 3 */\n if (view === MODE_YEAR) {\n let grid = [];\n let monthRow = [];\n let prevTo = 12;\n let nextFrom = 24;\n const ISO = currentDate.toISOString().split('T')[0].substring(0, 8);\n const dateNormalized = new Date(ISO + '01 00:00:00');\n const initYear = dateNormalized.getFullYear() - 1;\n dateNormalized.setFullYear(initYear);\n let todayMark = 0;\n for (let y = 0; y < 3; y++) {\n for (let i = 0; i < 12; i++) {\n dateNormalized.setMonth(i);\n monthRow.push(locale.monthsShort[i % 12]);\n if (monthRow.length === 4) {\n grid.push(monthRow);\n monthRow = [];\n }\n }\n dateNormalized.setFullYear(dateNormalized.getFullYear() + 1);\n }\n /** @type {number[]} */\n let selectionMark = [];\n if (!selectedDates[0]) {\n selectedDates[0] = new Date();\n }\n if (selectedDates[0].getFullYear() - initYear >= 0 && selectedDates[0].getFullYear() - initYear <= 2) {\n selectionMark.push(selectedDates[0].getMonth() + ((selectedDates[0].getFullYear() - initYear || 0) * 12));\n }\n // @ts-ignore\n return {\n months: grid, todayMark, nextFrom, prevTo, selectionMark\n }\n }\n\n /** ************************************ MONTH */\n /** ************************************ days 7x6 */\n let d = currentDate || new Date(), // or currently selected date\n y = d.getFullYear(),\n m = d.getMonth(),\n dM = d.getDate(),\n h = d.getHours(),\n today = new Date();\n let prevMonth = new Date(y, m-1, 28, 0, 0, 0, 0),\n day = getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth());\n prevMonth.setDate(day);\n prevMonth.setDate(day - (prevMonth.getDay() - weekStart + 7) % 7);\n\n let nextMonth = new Date(prevMonth);\n nextMonth.setDate(nextMonth.getDate() + 42);\n let nextMonthValue = nextMonth.valueOf();\n\n let grid = [];\n let dayRow = [];\n let todayMark = -1;\n /** @type {number[]} */\n let selectionMark = [];\n let prevTo = 0;\n let nextFrom = 42;\n let inc = 0;\n while(prevMonth.valueOf() < nextMonthValue) {\n inc++;\n dayRow.push(new Date(prevMonth));\n if (prevMonth.getFullYear() < y || (prevMonth.getFullYear() === y && prevMonth.getMonth() < m)) {\n prevTo = inc;\n } else if (nextFrom === 42 && (prevMonth.getFullYear() > y || (prevMonth.getFullYear() === y && prevMonth.getMonth() > m))) {\n nextFrom = inc - 1;\n }\n\n prevMonth.setDate(prevMonth.getDate() + 1);\n\n\n if (prevMonth.getFullYear() === today.getFullYear() &&\n prevMonth.getMonth() === today.getMonth() &&\n prevMonth.getDate() === today.getDate()\n ) {\n todayMark = inc;\n }\n if (selectionMark.length !== selectedDates.length) {\n selectedDates.map(s => {\n if (prevMonth.getFullYear() === s.getFullYear()\n && prevMonth.getMonth() === s.getMonth()\n && prevMonth.getDate() === s.getDate()\n )\n selectionMark.push(inc);\n })\n }\n\n if (dayRow.length === 7) {\n grid.push(dayRow);\n dayRow = [];\n }\n }\n // @ts-ignore\n return {\n grid, days: grid, todayMark, prevTo, nextFrom, selectionMark,\n };\n}\n","\n\n
\n
\n {#if hasDateComponent}\n \n \n \n {/if}\n {#if !hourOnly}\n isMinuteView = false}\n >\n {view(selectedHour, showMeridian)}\n \n :\n isMinuteView = true}\n >\n {view(selectedMinutes, false)}\n \n {:else}\n {view(selectedHour, showMeridian)}\n {#if showMeridian}\n {(isPM ? i18n.meridiem[1] : i18n.meridiem[0]).toUpperCase()}\n {:else}\n :\n 00\n {/if}\n {/if}\n {#if showMeridian}\n
\n \n {isPM ? i18n.meridiem[1] : i18n.meridiem[0]}\n \n
\n {/if}\n
\n\n \n \n { e.preventDefault(); onClick(e) } }\n onmousedown={onToggleMove}\n onmousemove={e => { handleMoveMove && onClick(e) }}\n onmouseup={onToggleMove}\n >\n
\n
\n
\n
\n {#each pos as p, i(p.val)}\n \n {/each}\n {#each innerHours as p, i}\n \n {/each}\n
\n
\n\n\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nfunction getSideList(side, isStart, rtl) {\n const lr = ['left', 'right'];\n const rl = ['right', 'left'];\n const tb = ['top', 'bottom'];\n const bt = ['bottom', 'top'];\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rl : lr;\n return isStart ? lr : rl;\n case 'left':\n case 'right':\n return isStart ? tb : bt;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = ['top', 'left'].includes(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isTopLayer(element) {\n return [':popover-open', ':modal'].some(selector => {\n try {\n return element.matches(selector);\n } catch (e) {\n return false;\n }\n });\n}\nfunction isContainingBlock(elementOrCss) {\n const webkit = isWebKit();\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nfunction isLastTraversableNode(node) {\n return ['html', 'body', '#document'].includes(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, detectOverflow as detectOverflow$1, offset as offset$1, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {\n if (ignoreScrollbarX === void 0) {\n ignoreScrollbarX = false;\n }\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :\n // RTL scrollbar.\n getWindowScrollBarX(documentElement, htmlRect));\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n // If the scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the element as the offsetParent if it's non-static,\n // while Chrome and Safari return the element. The element must\n // be used to perform the correct calculations even if the element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n // It's possible that even though the ratio is reported as 1, the\n // element is not actually fully within the IntersectionObserver's root\n // area anymore. This can happen under performance constraints. This may\n // be a bug in the browser's IntersectionObserver implementation. To\n // work around this, we compare the element's bounding rect now with\n // what it was at the time we created the IntersectionObserver. If they\n // are not equal then the element moved, so we refresh.\n refresh();\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle