Loading...
}\n * {JSON.stringify(accumulatedData, undefined, 2)}\n * >\n * );\n * }\n * ```\n *\n * Instead of using `useEffect` here, we can re-write this component to use the `onData` callback function accepted in `useSubscription`'s `options` object:\n *\n * ```jsx\n * export function Subscriptions() {\n * const [accumulatedData, setAccumulatedData] = useState([]);\n * const { data, error, loading } = useSubscription(\n * query,\n * {\n * onData({ data }) {\n * setAccumulatedData((prev) => [...prev, data])\n * }\n * }\n * );\n *\n * return (\n * <>\n * {loading &&Loading...
}\n * {JSON.stringify(accumulatedData, undefined, 2)}\n * >\n * );\n * }\n * ```\n *\n * > ⚠️ **Note:** The `useSubscription` option `onData` is available in Apollo Client >= 3.7. In previous versions, the equivalent option is named `onSubscriptionData`.\n *\n * Now, the first message will be added to the `accumulatedData` array since `onData` is called _before_ the component re-renders. React 18 automatic batching is still in effect and results in a single re-render, but with `onData` we can guarantee each message received after the component mounts is added to `accumulatedData`.\n *\n * @since 3.0.0\n * @param subscription - A GraphQL subscription document parsed into an AST by `gql`.\n * @param options - Options to control how the subscription is executed.\n * @returns Query result object\n */\nexport function useSubscription(subscription, options) {\n if (options === void 0) { options = Object.create(null); }\n var hasIssuedDeprecationWarningRef = React.useRef(false);\n var client = useApolloClient(options.client);\n verifyDocumentType(subscription, DocumentType.Subscription);\n if (!hasIssuedDeprecationWarningRef.current) {\n // eslint-disable-next-line react-compiler/react-compiler\n hasIssuedDeprecationWarningRef.current = true;\n if (options.onSubscriptionData) {\n globalThis.__DEV__ !== false && invariant.warn(options.onData ? 61 : 62);\n }\n if (options.onSubscriptionComplete) {\n globalThis.__DEV__ !== false && invariant.warn(options.onComplete ? 63 : 64);\n }\n }\n var skip = options.skip, fetchPolicy = options.fetchPolicy, errorPolicy = options.errorPolicy, shouldResubscribe = options.shouldResubscribe, context = options.context, extensions = options.extensions, ignoreResults = options.ignoreResults;\n var variables = useDeepMemo(function () { return options.variables; }, [options.variables]);\n var recreate = function () {\n return createSubscription(client, subscription, variables, fetchPolicy, errorPolicy, context, extensions);\n };\n var _a = React.useState(options.skip ? null : recreate), observable = _a[0], setObservable = _a[1];\n var recreateRef = React.useRef(recreate);\n useIsomorphicLayoutEffect(function () {\n recreateRef.current = recreate;\n });\n if (skip) {\n if (observable) {\n setObservable((observable = null));\n }\n }\n else if (!observable ||\n ((client !== observable.__.client ||\n subscription !== observable.__.query ||\n fetchPolicy !== observable.__.fetchPolicy ||\n errorPolicy !== observable.__.errorPolicy ||\n !equal(variables, observable.__.variables)) &&\n (typeof shouldResubscribe === \"function\" ?\n !!shouldResubscribe(options)\n : shouldResubscribe) !== false)) {\n setObservable((observable = recreate()));\n }\n var optionsRef = React.useRef(options);\n React.useEffect(function () {\n optionsRef.current = options;\n });\n var fallbackLoading = !skip && !ignoreResults;\n var fallbackResult = React.useMemo(function () { return ({\n loading: fallbackLoading,\n error: void 0,\n data: void 0,\n variables: variables,\n }); }, [fallbackLoading, variables]);\n var ignoreResultsRef = React.useRef(ignoreResults);\n useIsomorphicLayoutEffect(function () {\n // We cannot reference `ignoreResults` directly in the effect below\n // it would add a dependency to the `useEffect` deps array, which means the\n // subscription would be recreated if `ignoreResults` changes\n // As a result, on resubscription, the last result would be re-delivered,\n // rendering the component one additional time, and re-triggering `onData`.\n // The same applies to `fetchPolicy`, which results in a new `observable`\n // being created. We cannot really avoid it in that case, but we can at least\n // avoid it for `ignoreResults`.\n ignoreResultsRef.current = ignoreResults;\n });\n var ret = useSyncExternalStore(React.useCallback(function (update) {\n if (!observable) {\n return function () { };\n }\n var subscriptionStopped = false;\n var variables = observable.__.variables;\n var client = observable.__.client;\n var subscription = observable.subscribe({\n next: function (fetchResult) {\n var _a, _b;\n if (subscriptionStopped) {\n return;\n }\n var result = {\n loading: false,\n // TODO: fetchResult.data can be null but SubscriptionResult.data\n // expects TData | undefined only\n data: fetchResult.data,\n error: toApolloError(fetchResult),\n variables: variables,\n };\n observable.__.setResult(result);\n if (!ignoreResultsRef.current)\n update();\n if (result.error) {\n (_b = (_a = optionsRef.current).onError) === null || _b === void 0 ? void 0 : _b.call(_a, result.error);\n }\n else if (optionsRef.current.onData) {\n optionsRef.current.onData({\n client: client,\n data: result,\n });\n }\n else if (optionsRef.current.onSubscriptionData) {\n optionsRef.current.onSubscriptionData({\n client: client,\n subscriptionData: result,\n });\n }\n },\n error: function (error) {\n var _a, _b;\n error =\n error instanceof ApolloError ? error : (new ApolloError({ protocolErrors: [error] }));\n if (!subscriptionStopped) {\n observable.__.setResult({\n loading: false,\n data: void 0,\n error: error,\n variables: variables,\n });\n if (!ignoreResultsRef.current)\n update();\n (_b = (_a = optionsRef.current).onError) === null || _b === void 0 ? void 0 : _b.call(_a, error);\n }\n },\n complete: function () {\n if (!subscriptionStopped) {\n if (optionsRef.current.onComplete) {\n optionsRef.current.onComplete();\n }\n else if (optionsRef.current.onSubscriptionComplete) {\n optionsRef.current.onSubscriptionComplete();\n }\n }\n },\n });\n return function () {\n // immediately stop receiving subscription values, but do not unsubscribe\n // until after a short delay in case another useSubscription hook is\n // reusing the same underlying observable and is about to subscribe\n subscriptionStopped = true;\n setTimeout(function () {\n subscription.unsubscribe();\n });\n };\n }, [observable]), function () {\n return observable && !skip && !ignoreResults ?\n observable.__.result\n : fallbackResult;\n }, function () { return fallbackResult; });\n var restart = React.useCallback(function () {\n invariant(!optionsRef.current.skip, 65);\n setObservable(recreateRef.current());\n }, [optionsRef, recreateRef]);\n return React.useMemo(function () { return (__assign(__assign({}, ret), { restart: restart })); }, [ret, restart]);\n}\nfunction createSubscription(client, query, variables, fetchPolicy, errorPolicy, context, extensions) {\n var options = {\n query: query,\n variables: variables,\n fetchPolicy: fetchPolicy,\n errorPolicy: errorPolicy,\n context: context,\n extensions: extensions,\n };\n var __ = __assign(__assign({}, options), { client: client, result: {\n loading: true,\n data: void 0,\n error: void 0,\n variables: variables,\n }, setResult: function (result) {\n __.result = result;\n } });\n var observable = null;\n return Object.assign(new Observable(function (observer) {\n // lazily start the subscription when the first observer subscribes\n // to get around strict mode\n if (!observable) {\n observable = client.subscribe(options);\n }\n var sub = observable.subscribe(observer);\n return function () { return sub.unsubscribe(); };\n }), {\n /**\n * A tracking object to store details about the observable and the latest result of the subscription.\n */\n __: __,\n });\n}\n//# sourceMappingURL=useSubscription.js.map","import * as React from \"rehackt\";\nimport { useSyncExternalStore } from \"./useSyncExternalStore.js\";\n/**\n * Reads the value of a [reactive variable](https://www.apollographql.com/docs/react/local-state/reactive-variables/) and re-renders the containing component whenever that variable's value changes. This enables a reactive variable to trigger changes _without_ relying on the `useQuery` hook.\n *\n * @example\n * ```jsx\n * import { makeVar, useReactiveVar } from \"@apollo/client\";\n * export const cartItemsVar = makeVar([]);\n *\n * export function Cart() {\n * const cartItems = useReactiveVar(cartItemsVar);\n * // ...\n * }\n * ```\n * @since 3.2.0\n * @param rv - A reactive variable.\n * @returns The current value of the reactive variable.\n */\nexport function useReactiveVar(rv) {\n return useSyncExternalStore(React.useCallback(function (update) {\n // By reusing the same onNext function in the nested call to\n // rv.onNextChange(onNext), we can keep using the initial clean-up function\n // returned by rv.onNextChange(function onNext(v){...}), without having to\n // register the new clean-up function (returned by the nested\n // rv.onNextChange(onNext)) with yet another callback.\n return rv.onNextChange(function onNext() {\n update();\n rv.onNextChange(onNext);\n });\n }, [rv]), rv, rv);\n}\n//# sourceMappingURL=useReactiveVar.js.map","import { __assign, __rest } from \"tslib\";\nimport * as React from \"rehackt\";\nimport { mergeDeepArray } from \"../../utilities/index.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\nimport { useSyncExternalStore } from \"./useSyncExternalStore.js\";\nimport { useDeepMemo, wrapHook } from \"./internal/index.js\";\nimport equal from \"@wry/equality\";\nexport function useFragment(options) {\n return wrapHook(\"useFragment\", \n // eslint-disable-next-line react-compiler/react-compiler\n useFragment_, useApolloClient(options.client))(options);\n}\nfunction useFragment_(options) {\n var client = useApolloClient(options.client);\n var cache = client.cache;\n var from = options.from, rest = __rest(options, [\"from\"]);\n // We calculate the cache id seperately from `stableOptions` because we don't\n // want changes to non key fields in the `from` property to affect\n // `stableOptions` and retrigger our subscription. If the cache identifier\n // stays the same between renders, we want to reuse the existing subscription.\n var id = React.useMemo(function () {\n return typeof from === \"string\" ? from\n : from === null ? null\n : cache.identify(from);\n }, [cache, from]);\n var stableOptions = useDeepMemo(function () { return (__assign(__assign({}, rest), { from: id })); }, [rest, id]);\n // Since .next is async, we need to make sure that we\n // get the correct diff on the next render given new diffOptions\n var diff = React.useMemo(function () {\n var fragment = stableOptions.fragment, fragmentName = stableOptions.fragmentName, from = stableOptions.from, _a = stableOptions.optimistic, optimistic = _a === void 0 ? true : _a;\n if (from === null) {\n return {\n result: diffToResult({\n result: {},\n complete: false,\n }),\n };\n }\n var cache = client.cache;\n var diff = cache.diff(__assign(__assign({}, stableOptions), { returnPartialData: true, id: from, query: cache[\"getFragmentDoc\"](fragment, fragmentName), optimistic: optimistic }));\n return {\n result: diffToResult(__assign(__assign({}, diff), { result: client[\"queryManager\"].maskFragment({\n fragment: fragment,\n fragmentName: fragmentName,\n data: diff.result,\n }) })),\n };\n }, [client, stableOptions]);\n // Used for both getSnapshot and getServerSnapshot\n var getSnapshot = React.useCallback(function () { return diff.result; }, [diff]);\n return useSyncExternalStore(React.useCallback(function (forceUpdate) {\n var lastTimeout = 0;\n var subscription = stableOptions.from === null ?\n null\n : client.watchFragment(stableOptions).subscribe({\n next: function (result) {\n // Since `next` is called async by zen-observable, we want to avoid\n // unnecessarily rerendering this hook for the initial result\n // emitted from watchFragment which should be equal to\n // `diff.result`.\n if (equal(result, diff.result))\n return;\n diff.result = result;\n // If we get another update before we've re-rendered, bail out of\n // the update and try again. This ensures that the relative timing\n // between useQuery and useFragment stays roughly the same as\n // fixed in https://github.com/apollographql/apollo-client/pull/11083\n clearTimeout(lastTimeout);\n lastTimeout = setTimeout(forceUpdate);\n },\n });\n return function () {\n subscription === null || subscription === void 0 ? void 0 : subscription.unsubscribe();\n clearTimeout(lastTimeout);\n };\n }, [client, stableOptions, diff]), getSnapshot, getSnapshot);\n}\nfunction diffToResult(diff) {\n var result = {\n data: diff.result,\n complete: !!diff.complete,\n };\n if (diff.missing) {\n result.missing = mergeDeepArray(diff.missing.map(function (error) { return error.missing; }));\n }\n return result;\n}\n//# sourceMappingURL=useFragment.js.map","export function createFulfilledPromise(value) {\n var promise = Promise.resolve(value);\n promise.status = \"fulfilled\";\n promise.value = value;\n return promise;\n}\nexport function createRejectedPromise(reason) {\n var promise = Promise.reject(reason);\n // prevent potential edge cases leaking unhandled error rejections\n promise.catch(function () { });\n promise.status = \"rejected\";\n promise.reason = reason;\n return promise;\n}\nexport function isStatefulPromise(promise) {\n return \"status\" in promise;\n}\nexport function wrapPromiseWithState(promise) {\n if (isStatefulPromise(promise)) {\n return promise;\n }\n var pendingPromise = promise;\n pendingPromise.status = \"pending\";\n pendingPromise.then(function (value) {\n if (pendingPromise.status === \"pending\") {\n var fulfilledPromise = pendingPromise;\n fulfilledPromise.status = \"fulfilled\";\n fulfilledPromise.value = value;\n }\n }, function (reason) {\n if (pendingPromise.status === \"pending\") {\n var rejectedPromise = pendingPromise;\n rejectedPromise.status = \"rejected\";\n rejectedPromise.reason = reason;\n }\n });\n return promise;\n}\n//# sourceMappingURL=decoration.js.map","import { wrapPromiseWithState } from \"../../../utilities/index.js\";\nimport * as React from \"rehackt\";\n// Prevent webpack from complaining about our feature detection of the\n// use property of the React namespace, which is expected not\n// to exist when using current stable versions, and that's fine.\nvar useKey = \"use\";\nvar realHook = React[useKey];\n// This is named with two underscores to allow this hook to evade typical rules of\n// hooks (i.e. it can be used conditionally)\nexport var __use = realHook ||\n function __use(promise) {\n var statefulPromise = wrapPromiseWithState(promise);\n switch (statefulPromise.status) {\n case \"pending\":\n throw statefulPromise;\n case \"rejected\":\n throw statefulPromise.reason;\n case \"fulfilled\":\n return statefulPromise.value;\n }\n };\n//# sourceMappingURL=__use.js.map","import { __assign } from \"tslib\";\nimport { equal } from \"@wry/equality\";\nimport { createFulfilledPromise, createRejectedPromise, } from \"../../../utilities/index.js\";\nimport { wrapPromiseWithState } from \"../../../utilities/index.js\";\nimport { invariant } from \"../../../utilities/globals/invariantWrappers.js\";\nvar QUERY_REFERENCE_SYMBOL = Symbol.for(\"apollo.internal.queryRef\");\nvar PROMISE_SYMBOL = Symbol.for(\"apollo.internal.refPromise\");\nexport function wrapQueryRef(internalQueryRef) {\n var _a;\n var ref = (_a = {\n toPromise: function () {\n // We avoid resolving this promise with the query data because we want to\n // discourage using the server data directly from the queryRef. Instead,\n // the data should be accessed through `useReadQuery`. When the server\n // data is needed, its better to use `client.query()` directly.\n //\n // Here we resolve with the ref itself to make using this in React Router\n // or TanStack Router `loader` functions a bit more ergonomic e.g.\n //\n // function loader() {\n // return { queryRef: await preloadQuery(query).toPromise() }\n // }\n return getWrappedPromise(ref).then(function () { return ref; });\n }\n },\n _a[QUERY_REFERENCE_SYMBOL] = internalQueryRef,\n _a[PROMISE_SYMBOL] = internalQueryRef.promise,\n _a);\n return ref;\n}\nexport function assertWrappedQueryRef(queryRef) {\n invariant(!queryRef || QUERY_REFERENCE_SYMBOL in queryRef, 69);\n}\nexport function getWrappedPromise(queryRef) {\n var internalQueryRef = unwrapQueryRef(queryRef);\n return internalQueryRef.promise.status === \"fulfilled\" ?\n internalQueryRef.promise\n : queryRef[PROMISE_SYMBOL];\n}\nexport function unwrapQueryRef(queryRef) {\n return queryRef[QUERY_REFERENCE_SYMBOL];\n}\nexport function updateWrappedQueryRef(queryRef, promise) {\n queryRef[PROMISE_SYMBOL] = promise;\n}\nvar OBSERVED_CHANGED_OPTIONS = [\n \"canonizeResults\",\n \"context\",\n \"errorPolicy\",\n \"fetchPolicy\",\n \"refetchWritePolicy\",\n \"returnPartialData\",\n];\nvar InternalQueryReference = /** @class */ (function () {\n function InternalQueryReference(observable, options) {\n var _this = this;\n this.key = {};\n this.listeners = new Set();\n this.references = 0;\n this.softReferences = 0;\n this.handleNext = this.handleNext.bind(this);\n this.handleError = this.handleError.bind(this);\n this.dispose = this.dispose.bind(this);\n this.observable = observable;\n if (options.onDispose) {\n this.onDispose = options.onDispose;\n }\n this.setResult();\n this.subscribeToQuery();\n // Start a timer that will automatically dispose of the query if the\n // suspended resource does not use this queryRef in the given time. This\n // helps prevent memory leaks when a component has unmounted before the\n // query has finished loading.\n var startDisposeTimer = function () {\n var _a;\n if (!_this.references) {\n _this.autoDisposeTimeoutId = setTimeout(_this.dispose, (_a = options.autoDisposeTimeoutMs) !== null && _a !== void 0 ? _a : 30000);\n }\n };\n // We wait until the request has settled to ensure we don't dispose of the\n // query ref before the request finishes, otherwise we would leave the\n // promise in a pending state rendering the suspense boundary indefinitely.\n this.promise.then(startDisposeTimer, startDisposeTimer);\n }\n Object.defineProperty(InternalQueryReference.prototype, \"disposed\", {\n get: function () {\n return this.subscription.closed;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InternalQueryReference.prototype, \"watchQueryOptions\", {\n get: function () {\n return this.observable.options;\n },\n enumerable: false,\n configurable: true\n });\n InternalQueryReference.prototype.reinitialize = function () {\n var observable = this.observable;\n var originalFetchPolicy = this.watchQueryOptions.fetchPolicy;\n var avoidNetworkRequests = originalFetchPolicy === \"no-cache\" || originalFetchPolicy === \"standby\";\n try {\n if (avoidNetworkRequests) {\n observable.silentSetOptions({ fetchPolicy: \"standby\" });\n }\n else {\n observable.resetLastResults();\n observable.silentSetOptions({ fetchPolicy: \"cache-first\" });\n }\n this.subscribeToQuery();\n if (avoidNetworkRequests) {\n return;\n }\n observable.resetDiff();\n this.setResult();\n }\n finally {\n observable.silentSetOptions({ fetchPolicy: originalFetchPolicy });\n }\n };\n InternalQueryReference.prototype.retain = function () {\n var _this = this;\n this.references++;\n clearTimeout(this.autoDisposeTimeoutId);\n var disposed = false;\n return function () {\n if (disposed) {\n return;\n }\n disposed = true;\n _this.references--;\n setTimeout(function () {\n if (!_this.references) {\n _this.dispose();\n }\n });\n };\n };\n InternalQueryReference.prototype.softRetain = function () {\n var _this = this;\n this.softReferences++;\n var disposed = false;\n return function () {\n // Tracking if this has already been called helps ensure that\n // multiple calls to this function won't decrement the reference\n // counter more than it should. Subsequent calls just result in a noop.\n if (disposed) {\n return;\n }\n disposed = true;\n _this.softReferences--;\n setTimeout(function () {\n if (!_this.softReferences && !_this.references) {\n _this.dispose();\n }\n });\n };\n };\n InternalQueryReference.prototype.didChangeOptions = function (watchQueryOptions) {\n var _this = this;\n return OBSERVED_CHANGED_OPTIONS.some(function (option) {\n return option in watchQueryOptions &&\n !equal(_this.watchQueryOptions[option], watchQueryOptions[option]);\n });\n };\n InternalQueryReference.prototype.applyOptions = function (watchQueryOptions) {\n var _a = this.watchQueryOptions, currentFetchPolicy = _a.fetchPolicy, currentCanonizeResults = _a.canonizeResults;\n // \"standby\" is used when `skip` is set to `true`. Detect when we've\n // enabled the query (i.e. `skip` is `false`) to execute a network request.\n if (currentFetchPolicy === \"standby\" &&\n currentFetchPolicy !== watchQueryOptions.fetchPolicy) {\n this.initiateFetch(this.observable.reobserve(watchQueryOptions));\n }\n else {\n this.observable.silentSetOptions(watchQueryOptions);\n if (currentCanonizeResults !== watchQueryOptions.canonizeResults) {\n this.result = __assign(__assign({}, this.result), this.observable.getCurrentResult());\n this.promise = createFulfilledPromise(this.result);\n }\n }\n return this.promise;\n };\n InternalQueryReference.prototype.listen = function (listener) {\n var _this = this;\n this.listeners.add(listener);\n return function () {\n _this.listeners.delete(listener);\n };\n };\n InternalQueryReference.prototype.refetch = function (variables) {\n return this.initiateFetch(this.observable.refetch(variables));\n };\n InternalQueryReference.prototype.fetchMore = function (options) {\n return this.initiateFetch(this.observable.fetchMore(options));\n };\n InternalQueryReference.prototype.dispose = function () {\n this.subscription.unsubscribe();\n this.onDispose();\n };\n InternalQueryReference.prototype.onDispose = function () {\n // noop. overridable by options\n };\n InternalQueryReference.prototype.handleNext = function (result) {\n var _a;\n switch (this.promise.status) {\n case \"pending\": {\n // Maintain the last successful `data` value if the next result does not\n // have one.\n if (result.data === void 0) {\n result.data = this.result.data;\n }\n this.result = result;\n (_a = this.resolve) === null || _a === void 0 ? void 0 : _a.call(this, result);\n break;\n }\n default: {\n // This occurs when switching to a result that is fully cached when this\n // class is instantiated. ObservableQuery will run reobserve when\n // subscribing, which delivers a result from the cache.\n if (result.data === this.result.data &&\n result.networkStatus === this.result.networkStatus) {\n return;\n }\n // Maintain the last successful `data` value if the next result does not\n // have one.\n if (result.data === void 0) {\n result.data = this.result.data;\n }\n this.result = result;\n this.promise = createFulfilledPromise(result);\n this.deliver(this.promise);\n break;\n }\n }\n };\n InternalQueryReference.prototype.handleError = function (error) {\n var _a;\n this.subscription.unsubscribe();\n this.subscription = this.observable.resubscribeAfterError(this.handleNext, this.handleError);\n switch (this.promise.status) {\n case \"pending\": {\n (_a = this.reject) === null || _a === void 0 ? void 0 : _a.call(this, error);\n break;\n }\n default: {\n this.promise = createRejectedPromise(error);\n this.deliver(this.promise);\n }\n }\n };\n InternalQueryReference.prototype.deliver = function (promise) {\n this.listeners.forEach(function (listener) { return listener(promise); });\n };\n InternalQueryReference.prototype.initiateFetch = function (returnedPromise) {\n var _this = this;\n this.promise = this.createPendingPromise();\n this.promise.catch(function () { });\n // If the data returned from the fetch is deeply equal to the data already\n // in the cache, `handleNext` will not be triggered leaving the promise we\n // created in a pending state forever. To avoid this situtation, we attempt\n // to resolve the promise if `handleNext` hasn't been run to ensure the\n // promise is resolved correctly.\n returnedPromise\n .then(function () {\n // In the case of `fetchMore`, this promise is resolved before a cache\n // result is emitted due to the fact that `fetchMore` sets a `no-cache`\n // fetch policy and runs `cache.batch` in its `.then` handler. Because\n // the timing is different, we accidentally run this update twice\n // causing an additional re-render with the `fetchMore` result by\n // itself. By wrapping in `setTimeout`, this should provide a short\n // delay to allow the `QueryInfo.notify` handler to run before this\n // promise is checked.\n // See https://github.com/apollographql/apollo-client/issues/11315 for\n // more information\n setTimeout(function () {\n var _a;\n if (_this.promise.status === \"pending\") {\n // Use the current result from the observable instead of the value\n // resolved from the promise. This avoids issues in some cases where\n // the raw resolved value should not be the emitted value, such as\n // when a `fetchMore` call returns an empty array after it has\n // reached the end of the list.\n //\n // See the following for more information:\n // https://github.com/apollographql/apollo-client/issues/11642\n _this.result = _this.observable.getCurrentResult();\n (_a = _this.resolve) === null || _a === void 0 ? void 0 : _a.call(_this, _this.result);\n }\n });\n })\n .catch(function (error) { var _a; return (_a = _this.reject) === null || _a === void 0 ? void 0 : _a.call(_this, error); });\n return returnedPromise;\n };\n InternalQueryReference.prototype.subscribeToQuery = function () {\n var _this = this;\n this.subscription = this.observable\n .filter(function (result) { return !equal(result.data, {}) && !equal(result, _this.result); })\n .subscribe(this.handleNext, this.handleError);\n };\n InternalQueryReference.prototype.setResult = function () {\n // Don't save this result as last result to prevent delivery of last result\n // when first subscribing\n var result = this.observable.getCurrentResult(false);\n if (equal(result, this.result)) {\n return;\n }\n this.result = result;\n this.promise =\n (result.data &&\n (!result.partial || this.watchQueryOptions.returnPartialData)) ?\n createFulfilledPromise(result)\n : this.createPendingPromise();\n };\n InternalQueryReference.prototype.createPendingPromise = function () {\n var _this = this;\n return wrapPromiseWithState(new Promise(function (resolve, reject) {\n _this.resolve = resolve;\n _this.reject = reject;\n }));\n };\n return InternalQueryReference;\n}());\nexport { InternalQueryReference };\n//# sourceMappingURL=QueryReference.js.map","import { __assign } from \"tslib\";\nimport { equal } from \"@wry/equality\";\nimport { createFulfilledPromise, wrapPromiseWithState, } from \"../../../utilities/index.js\";\nvar FragmentReference = /** @class */ (function () {\n function FragmentReference(client, watchFragmentOptions, options) {\n var _this = this;\n this.key = {};\n this.listeners = new Set();\n this.references = 0;\n this.dispose = this.dispose.bind(this);\n this.handleNext = this.handleNext.bind(this);\n this.handleError = this.handleError.bind(this);\n this.observable = client.watchFragment(watchFragmentOptions);\n if (options.onDispose) {\n this.onDispose = options.onDispose;\n }\n var diff = this.getDiff(client, watchFragmentOptions);\n // Start a timer that will automatically dispose of the query if the\n // suspended resource does not use this fragmentRef in the given time. This\n // helps prevent memory leaks when a component has unmounted before the\n // query has finished loading.\n var startDisposeTimer = function () {\n var _a;\n if (!_this.references) {\n _this.autoDisposeTimeoutId = setTimeout(_this.dispose, (_a = options.autoDisposeTimeoutMs) !== null && _a !== void 0 ? _a : 30000);\n }\n };\n this.promise =\n diff.complete ?\n createFulfilledPromise(diff.result)\n : this.createPendingPromise();\n this.subscribeToFragment();\n this.promise.then(startDisposeTimer, startDisposeTimer);\n }\n FragmentReference.prototype.listen = function (listener) {\n var _this = this;\n this.listeners.add(listener);\n return function () {\n _this.listeners.delete(listener);\n };\n };\n FragmentReference.prototype.retain = function () {\n var _this = this;\n this.references++;\n clearTimeout(this.autoDisposeTimeoutId);\n var disposed = false;\n return function () {\n if (disposed) {\n return;\n }\n disposed = true;\n _this.references--;\n setTimeout(function () {\n if (!_this.references) {\n _this.dispose();\n }\n });\n };\n };\n FragmentReference.prototype.dispose = function () {\n this.subscription.unsubscribe();\n this.onDispose();\n };\n FragmentReference.prototype.onDispose = function () {\n // noop. overridable by options\n };\n FragmentReference.prototype.subscribeToFragment = function () {\n this.subscription = this.observable.subscribe(this.handleNext.bind(this), this.handleError.bind(this));\n };\n FragmentReference.prototype.handleNext = function (result) {\n var _a;\n switch (this.promise.status) {\n case \"pending\": {\n if (result.complete) {\n return (_a = this.resolve) === null || _a === void 0 ? void 0 : _a.call(this, result.data);\n }\n this.deliver(this.promise);\n break;\n }\n case \"fulfilled\": {\n // This can occur when we already have a result written to the cache and\n // we subscribe for the first time. We create a fulfilled promise in the\n // constructor with a value that is the same as the first emitted value\n // so we want to skip delivering it.\n if (equal(this.promise.value, result.data)) {\n return;\n }\n this.promise =\n result.complete ?\n createFulfilledPromise(result.data)\n : this.createPendingPromise();\n this.deliver(this.promise);\n }\n }\n };\n FragmentReference.prototype.handleError = function (error) {\n var _a;\n (_a = this.reject) === null || _a === void 0 ? void 0 : _a.call(this, error);\n };\n FragmentReference.prototype.deliver = function (promise) {\n this.listeners.forEach(function (listener) { return listener(promise); });\n };\n FragmentReference.prototype.createPendingPromise = function () {\n var _this = this;\n return wrapPromiseWithState(new Promise(function (resolve, reject) {\n _this.resolve = resolve;\n _this.reject = reject;\n }));\n };\n FragmentReference.prototype.getDiff = function (client, options) {\n var cache = client.cache;\n var from = options.from, fragment = options.fragment, fragmentName = options.fragmentName;\n var diff = cache.diff(__assign(__assign({}, options), { query: cache[\"getFragmentDoc\"](fragment, fragmentName), returnPartialData: true, id: from, optimistic: true }));\n return __assign(__assign({}, diff), { result: client[\"queryManager\"].maskFragment({\n fragment: fragment,\n fragmentName: fragmentName,\n data: diff.result,\n }) });\n };\n return FragmentReference;\n}());\nexport { FragmentReference };\n//# sourceMappingURL=FragmentReference.js.map","import { Trie } from \"@wry/trie\";\nimport { canUseWeakMap } from \"../../../utilities/index.js\";\nimport { InternalQueryReference } from \"./QueryReference.js\";\nimport { FragmentReference } from \"./FragmentReference.js\";\nvar SuspenseCache = /** @class */ (function () {\n function SuspenseCache(options) {\n if (options === void 0) { options = Object.create(null); }\n this.queryRefs = new Trie(canUseWeakMap);\n this.fragmentRefs = new Trie(canUseWeakMap);\n this.options = options;\n }\n SuspenseCache.prototype.getQueryRef = function (cacheKey, createObservable) {\n var ref = this.queryRefs.lookupArray(cacheKey);\n if (!ref.current) {\n ref.current = new InternalQueryReference(createObservable(), {\n autoDisposeTimeoutMs: this.options.autoDisposeTimeoutMs,\n onDispose: function () {\n delete ref.current;\n },\n });\n }\n return ref.current;\n };\n SuspenseCache.prototype.getFragmentRef = function (cacheKey, client, options) {\n var ref = this.fragmentRefs.lookupArray(cacheKey);\n if (!ref.current) {\n ref.current = new FragmentReference(client, options, {\n autoDisposeTimeoutMs: this.options.autoDisposeTimeoutMs,\n onDispose: function () {\n delete ref.current;\n },\n });\n }\n return ref.current;\n };\n SuspenseCache.prototype.add = function (cacheKey, queryRef) {\n var ref = this.queryRefs.lookupArray(cacheKey);\n ref.current = queryRef;\n };\n return SuspenseCache;\n}());\nexport { SuspenseCache };\n//# sourceMappingURL=SuspenseCache.js.map","import { SuspenseCache } from \"./SuspenseCache.js\";\nvar suspenseCacheSymbol = Symbol.for(\"apollo.suspenseCache\");\nexport function getSuspenseCache(client) {\n var _a;\n if (!client[suspenseCacheSymbol]) {\n client[suspenseCacheSymbol] = new SuspenseCache((_a = client.defaultOptions.react) === null || _a === void 0 ? void 0 : _a.suspense);\n }\n return client[suspenseCacheSymbol];\n}\n//# sourceMappingURL=getSuspenseCache.js.map","export var skipToken = Symbol.for(\"apollo.skipToken\");\n//# sourceMappingURL=constants.js.map","import { __assign, __spreadArray } from \"tslib\";\nimport * as React from \"rehackt\";\nimport { invariant } from \"../../utilities/globals/index.js\";\nimport { ApolloError, NetworkStatus } from \"../../core/index.js\";\nimport { isNonEmptyArray } from \"../../utilities/index.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\nimport { DocumentType, verifyDocumentType } from \"../parser/index.js\";\nimport { __use, useDeepMemo, wrapHook } from \"./internal/index.js\";\nimport { getSuspenseCache } from \"../internal/index.js\";\nimport { canonicalStringify } from \"../../cache/index.js\";\nimport { skipToken } from \"./constants.js\";\nexport function useSuspenseQuery(query, options) {\n if (options === void 0) { options = Object.create(null); }\n return wrapHook(\"useSuspenseQuery\", \n // eslint-disable-next-line react-compiler/react-compiler\n useSuspenseQuery_, useApolloClient(typeof options === \"object\" ? options.client : undefined))(query, options);\n}\nfunction useSuspenseQuery_(query, options) {\n var client = useApolloClient(options.client);\n var suspenseCache = getSuspenseCache(client);\n var watchQueryOptions = useWatchQueryOptions({\n client: client,\n query: query,\n options: options,\n });\n var fetchPolicy = watchQueryOptions.fetchPolicy, variables = watchQueryOptions.variables;\n var _a = options.queryKey, queryKey = _a === void 0 ? [] : _a;\n var cacheKey = __spreadArray([\n query,\n canonicalStringify(variables)\n ], [].concat(queryKey), true);\n var queryRef = suspenseCache.getQueryRef(cacheKey, function () {\n return client.watchQuery(watchQueryOptions);\n });\n var _b = React.useState([queryRef.key, queryRef.promise]), current = _b[0], setPromise = _b[1];\n // This saves us a re-execution of the render function when a variable changed.\n if (current[0] !== queryRef.key) {\n // eslint-disable-next-line react-compiler/react-compiler\n current[0] = queryRef.key;\n current[1] = queryRef.promise;\n }\n var promise = current[1];\n if (queryRef.didChangeOptions(watchQueryOptions)) {\n current[1] = promise = queryRef.applyOptions(watchQueryOptions);\n }\n React.useEffect(function () {\n var dispose = queryRef.retain();\n var removeListener = queryRef.listen(function (promise) {\n setPromise([queryRef.key, promise]);\n });\n return function () {\n removeListener();\n dispose();\n };\n }, [queryRef]);\n var skipResult = React.useMemo(function () {\n var error = toApolloError(queryRef.result);\n return {\n loading: false,\n data: queryRef.result.data,\n networkStatus: error ? NetworkStatus.error : NetworkStatus.ready,\n error: error,\n };\n }, [queryRef.result]);\n var result = fetchPolicy === \"standby\" ? skipResult : __use(promise);\n var fetchMore = React.useCallback(function (options) {\n var promise = queryRef.fetchMore(options);\n setPromise([queryRef.key, queryRef.promise]);\n return promise;\n }, [queryRef]);\n var refetch = React.useCallback(function (variables) {\n var promise = queryRef.refetch(variables);\n setPromise([queryRef.key, queryRef.promise]);\n return promise;\n }, [queryRef]);\n // TODO: The internalQueryRef doesn't have TVariables' type information so we have to cast it here\n var subscribeToMore = queryRef.observable\n .subscribeToMore;\n return React.useMemo(function () {\n return {\n client: client,\n data: result.data,\n error: toApolloError(result),\n networkStatus: result.networkStatus,\n fetchMore: fetchMore,\n refetch: refetch,\n subscribeToMore: subscribeToMore,\n };\n }, [client, fetchMore, refetch, result, subscribeToMore]);\n}\nfunction validateOptions(options) {\n var query = options.query, fetchPolicy = options.fetchPolicy, returnPartialData = options.returnPartialData;\n verifyDocumentType(query, DocumentType.Query);\n validateFetchPolicy(fetchPolicy);\n validatePartialDataReturn(fetchPolicy, returnPartialData);\n}\nfunction validateFetchPolicy(fetchPolicy) {\n if (fetchPolicy === void 0) { fetchPolicy = \"cache-first\"; }\n var supportedFetchPolicies = [\n \"cache-first\",\n \"network-only\",\n \"no-cache\",\n \"cache-and-network\",\n ];\n invariant(supportedFetchPolicies.includes(fetchPolicy), 66, fetchPolicy);\n}\nfunction validatePartialDataReturn(fetchPolicy, returnPartialData) {\n if (fetchPolicy === \"no-cache\" && returnPartialData) {\n globalThis.__DEV__ !== false && invariant.warn(67);\n }\n}\nexport function toApolloError(result) {\n return isNonEmptyArray(result.errors) ?\n new ApolloError({ graphQLErrors: result.errors })\n : result.error;\n}\nexport function useWatchQueryOptions(_a) {\n var client = _a.client, query = _a.query, options = _a.options;\n return useDeepMemo(function () {\n var _a;\n if (options === skipToken) {\n return { query: query, fetchPolicy: \"standby\" };\n }\n var fetchPolicy = options.fetchPolicy ||\n ((_a = client.defaultOptions.watchQuery) === null || _a === void 0 ? void 0 : _a.fetchPolicy) ||\n \"cache-first\";\n var watchQueryOptions = __assign(__assign({}, options), { fetchPolicy: fetchPolicy, query: query, notifyOnNetworkStatusChange: false, nextFetchPolicy: void 0 });\n if (globalThis.__DEV__ !== false) {\n validateOptions(watchQueryOptions);\n }\n // Assign the updated fetch policy after our validation since `standby` is\n // not a supported fetch policy on its own without the use of `skip`.\n if (options.skip) {\n watchQueryOptions.fetchPolicy = \"standby\";\n }\n return watchQueryOptions;\n }, [client, options, query]);\n}\n//# sourceMappingURL=useSuspenseQuery.js.map","import { __spreadArray } from \"tslib\";\nimport * as React from \"rehackt\";\nimport { useApolloClient } from \"./useApolloClient.js\";\nimport { getSuspenseCache, unwrapQueryRef, updateWrappedQueryRef, wrapQueryRef, } from \"../internal/index.js\";\nimport { wrapHook } from \"./internal/index.js\";\nimport { useWatchQueryOptions } from \"./useSuspenseQuery.js\";\nimport { canonicalStringify } from \"../../cache/index.js\";\nexport function useBackgroundQuery(query, options) {\n if (options === void 0) { options = Object.create(null); }\n return wrapHook(\"useBackgroundQuery\", \n // eslint-disable-next-line react-compiler/react-compiler\n useBackgroundQuery_, useApolloClient(typeof options === \"object\" ? options.client : undefined))(query, options);\n}\nfunction useBackgroundQuery_(query, options) {\n var client = useApolloClient(options.client);\n var suspenseCache = getSuspenseCache(client);\n var watchQueryOptions = useWatchQueryOptions({ client: client, query: query, options: options });\n var fetchPolicy = watchQueryOptions.fetchPolicy, variables = watchQueryOptions.variables;\n var _a = options.queryKey, queryKey = _a === void 0 ? [] : _a;\n // This ref tracks the first time query execution is enabled to determine\n // whether to return a query ref or `undefined`. When initialized\n // in a skipped state (either via `skip: true` or `skipToken`) we return\n // `undefined` for the `queryRef` until the query has been enabled. Once\n // enabled, a query ref is always returned regardless of whether the query is\n // skipped again later.\n var didFetchResult = React.useRef(fetchPolicy !== \"standby\");\n didFetchResult.current || (didFetchResult.current = fetchPolicy !== \"standby\");\n var cacheKey = __spreadArray([\n query,\n canonicalStringify(variables)\n ], [].concat(queryKey), true);\n var queryRef = suspenseCache.getQueryRef(cacheKey, function () {\n return client.watchQuery(watchQueryOptions);\n });\n var _b = React.useState(wrapQueryRef(queryRef)), wrappedQueryRef = _b[0], setWrappedQueryRef = _b[1];\n if (unwrapQueryRef(wrappedQueryRef) !== queryRef) {\n setWrappedQueryRef(wrapQueryRef(queryRef));\n }\n if (queryRef.didChangeOptions(watchQueryOptions)) {\n var promise = queryRef.applyOptions(watchQueryOptions);\n updateWrappedQueryRef(wrappedQueryRef, promise);\n }\n // This prevents issues where rerendering useBackgroundQuery after the\n // queryRef has been disposed would cause the hook to return a new queryRef\n // instance since disposal also removes it from the suspense cache. We add\n // the queryRef back in the suspense cache so that the next render will reuse\n // this queryRef rather than initializing a new instance.\n React.useEffect(function () {\n // Since the queryRef is disposed async via `setTimeout`, we have to wait a\n // tick before checking it and adding back to the suspense cache.\n var id = setTimeout(function () {\n if (queryRef.disposed) {\n suspenseCache.add(cacheKey, queryRef);\n }\n });\n return function () { return clearTimeout(id); };\n // Omitting the deps is intentional. This avoids stale closures and the\n // conditional ensures we aren't running the logic on each render.\n });\n var fetchMore = React.useCallback(function (options) {\n var promise = queryRef.fetchMore(options);\n setWrappedQueryRef(wrapQueryRef(queryRef));\n return promise;\n }, [queryRef]);\n var refetch = React.useCallback(function (variables) {\n var promise = queryRef.refetch(variables);\n setWrappedQueryRef(wrapQueryRef(queryRef));\n return promise;\n }, [queryRef]);\n React.useEffect(function () { return queryRef.softRetain(); }, [queryRef]);\n return [\n didFetchResult.current ? wrappedQueryRef : void 0,\n {\n fetchMore: fetchMore,\n refetch: refetch,\n // TODO: The internalQueryRef doesn't have TVariables' type information so we have to cast it here\n subscribeToMore: queryRef.observable\n .subscribeToMore,\n },\n ];\n}\n//# sourceMappingURL=useBackgroundQuery.js.map","import { __assign } from \"tslib\";\nimport { canonicalStringify } from \"../../cache/index.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\nimport { getSuspenseCache } from \"../internal/index.js\";\nimport * as React from \"rehackt\";\nimport { __use } from \"./internal/__use.js\";\nimport { wrapHook } from \"./internal/index.js\";\nvar NULL_PLACEHOLDER = [];\nexport function useSuspenseFragment(options) {\n return wrapHook(\"useSuspenseFragment\", \n // eslint-disable-next-line react-compiler/react-compiler\n useSuspenseFragment_, useApolloClient(typeof options === \"object\" ? options.client : undefined))(options);\n}\nfunction useSuspenseFragment_(options) {\n var client = useApolloClient(options.client);\n var from = options.from, variables = options.variables;\n var cache = client.cache;\n var id = React.useMemo(function () {\n return typeof from === \"string\" ? from\n : from === null ? null\n : cache.identify(from);\n }, [cache, from]);\n var fragmentRef = id === null ? null : (getSuspenseCache(client).getFragmentRef([id, options.fragment, canonicalStringify(variables)], client, __assign(__assign({}, options), { variables: variables, from: id })));\n var _a = React.useState(fragmentRef === null ? NULL_PLACEHOLDER : ([fragmentRef.key, fragmentRef.promise])), current = _a[0], setPromise = _a[1];\n React.useEffect(function () {\n if (fragmentRef === null) {\n return;\n }\n var dispose = fragmentRef.retain();\n var removeListener = fragmentRef.listen(function (promise) {\n setPromise([fragmentRef.key, promise]);\n });\n return function () {\n dispose();\n removeListener();\n };\n }, [fragmentRef]);\n if (fragmentRef === null) {\n return { data: null };\n }\n if (current[0] !== fragmentRef.key) {\n // eslint-disable-next-line react-compiler/react-compiler\n current[0] = fragmentRef.key;\n current[1] = fragmentRef.promise;\n }\n var data = __use(current[1]);\n return { data: data };\n}\n//# sourceMappingURL=useSuspenseFragment.js.map","import * as React from \"rehackt\";\nvar Ctx;\nfunction noop() { }\nexport function useRenderGuard() {\n if (!Ctx) {\n // we want the intialization to be lazy because `createContext` would error on import in a RSC\n Ctx = React.createContext(null);\n }\n return React.useCallback(\n /**\n * @returns true if the hook was called during render\n */ function () {\n var orig = console.error;\n try {\n console.error = noop;\n /**\n * `useContext` can be called conditionally during render, so this is safe.\n * (Also, during render we would want to throw as a reaction to this anyways, so it\n * wouldn't even matter if we got the order of hooks mixed up...)\n *\n * They cannot however be called outside of Render, and that's what we're testing here.\n *\n * Different versions of React have different behaviour on an invalid hook call:\n *\n * React 16.8 - 17: throws an error\n * https://github.com/facebook/react/blob/2b93d686e359c7afa299e2ec5cf63160a32a1155/packages/react/src/ReactHooks.js#L18-L26\n *\n * React 18 & 19: `console.error` in development, then `resolveDispatcher` returns `null` and a member access on `null` throws.\n * https://github.com/facebook/react/blob/58e8304483ebfadd02a295339b5e9a989ac98c6e/packages/react/src/ReactHooks.js#L28-L35\n */\n React[\"useContext\" /* hide this from the linter */](Ctx);\n return true;\n }\n catch (e) {\n return false;\n }\n finally {\n console.error = orig;\n }\n }, []);\n}\n//# sourceMappingURL=useRenderGuard.js.map","import { __assign, __spreadArray } from \"tslib\";\nimport * as React from \"rehackt\";\nimport { useApolloClient } from \"./useApolloClient.js\";\nimport { assertWrappedQueryRef, getSuspenseCache, unwrapQueryRef, updateWrappedQueryRef, wrapQueryRef, } from \"../internal/index.js\";\nimport { useRenderGuard } from \"./internal/index.js\";\nimport { useWatchQueryOptions } from \"./useSuspenseQuery.js\";\nimport { canonicalStringify } from \"../../cache/index.js\";\nimport { invariant } from \"../../utilities/globals/index.js\";\nexport function useLoadableQuery(query, options) {\n if (options === void 0) { options = Object.create(null); }\n var client = useApolloClient(options.client);\n var suspenseCache = getSuspenseCache(client);\n var watchQueryOptions = useWatchQueryOptions({ client: client, query: query, options: options });\n var _a = options.queryKey, queryKey = _a === void 0 ? [] : _a;\n var _b = React.useState(null), queryRef = _b[0], setQueryRef = _b[1];\n assertWrappedQueryRef(queryRef);\n var internalQueryRef = queryRef && unwrapQueryRef(queryRef);\n if (queryRef && (internalQueryRef === null || internalQueryRef === void 0 ? void 0 : internalQueryRef.didChangeOptions(watchQueryOptions))) {\n var promise = internalQueryRef.applyOptions(watchQueryOptions);\n updateWrappedQueryRef(queryRef, promise);\n }\n var calledDuringRender = useRenderGuard();\n var fetchMore = React.useCallback(function (options) {\n if (!internalQueryRef) {\n throw new Error(\"The query has not been loaded. Please load the query.\");\n }\n var promise = internalQueryRef.fetchMore(options);\n setQueryRef(wrapQueryRef(internalQueryRef));\n return promise;\n }, [internalQueryRef]);\n var refetch = React.useCallback(function (options) {\n if (!internalQueryRef) {\n throw new Error(\"The query has not been loaded. Please load the query.\");\n }\n var promise = internalQueryRef.refetch(options);\n setQueryRef(wrapQueryRef(internalQueryRef));\n return promise;\n }, [internalQueryRef]);\n var loadQuery = React.useCallback(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n invariant(!calledDuringRender(), 59);\n var variables = args[0];\n var cacheKey = __spreadArray([\n query,\n canonicalStringify(variables)\n ], [].concat(queryKey), true);\n var queryRef = suspenseCache.getQueryRef(cacheKey, function () {\n return client.watchQuery(__assign(__assign({}, watchQueryOptions), { variables: variables }));\n });\n setQueryRef(wrapQueryRef(queryRef));\n }, [\n query,\n queryKey,\n suspenseCache,\n watchQueryOptions,\n calledDuringRender,\n client,\n ]);\n var subscribeToMore = React.useCallback(function (options) {\n invariant(internalQueryRef, 60);\n return internalQueryRef.observable.subscribeToMore(\n // TODO: The internalQueryRef doesn't have TVariables' type information so we have to cast it here\n options);\n }, [internalQueryRef]);\n var reset = React.useCallback(function () {\n setQueryRef(null);\n }, []);\n return [loadQuery, queryRef, { fetchMore: fetchMore, refetch: refetch, reset: reset, subscribeToMore: subscribeToMore }];\n}\n//# sourceMappingURL=useLoadableQuery.js.map","import * as React from \"rehackt\";\nimport { assertWrappedQueryRef, getWrappedPromise, unwrapQueryRef, updateWrappedQueryRef, wrapQueryRef, } from \"../internal/index.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\nimport { wrapHook } from \"./internal/index.js\";\n/**\n * A React hook that returns a `refetch` and `fetchMore` function for a given\n * `queryRef`.\n *\n * This is useful to get access to handlers for a `queryRef` that was created by\n * `createQueryPreloader` or when the handlers for a `queryRef` produced in\n * a different component are inaccessible.\n *\n * @example\n * ```tsx\n * const MyComponent({ queryRef }) {\n * const { refetch, fetchMore } = useQueryRefHandlers(queryRef);\n *\n * // ...\n * }\n * ```\n * @since 3.9.0\n * @param queryRef - A `QueryRef` returned from `useBackgroundQuery`, `useLoadableQuery`, or `createQueryPreloader`.\n */\nexport function useQueryRefHandlers(queryRef) {\n var unwrapped = unwrapQueryRef(queryRef);\n var clientOrObsQuery = useApolloClient(unwrapped ?\n // passing an `ObservableQuery` is not supported by the types, but it will\n // return any truthy value that is passed in as an override so we cast the result\n unwrapped[\"observable\"]\n : undefined);\n return wrapHook(\"useQueryRefHandlers\", \n // eslint-disable-next-line react-compiler/react-compiler\n useQueryRefHandlers_, clientOrObsQuery)(queryRef);\n}\nfunction useQueryRefHandlers_(queryRef) {\n assertWrappedQueryRef(queryRef);\n var _a = React.useState(queryRef), previousQueryRef = _a[0], setPreviousQueryRef = _a[1];\n var _b = React.useState(queryRef), wrappedQueryRef = _b[0], setWrappedQueryRef = _b[1];\n var internalQueryRef = unwrapQueryRef(queryRef);\n // To ensure we can support React transitions, this hook needs to manage the\n // queryRef state and apply React's state value immediately to the existing\n // queryRef since this hook doesn't return the queryRef directly\n if (previousQueryRef !== queryRef) {\n setPreviousQueryRef(queryRef);\n setWrappedQueryRef(queryRef);\n }\n else {\n updateWrappedQueryRef(queryRef, getWrappedPromise(wrappedQueryRef));\n }\n var refetch = React.useCallback(function (variables) {\n var promise = internalQueryRef.refetch(variables);\n setWrappedQueryRef(wrapQueryRef(internalQueryRef));\n return promise;\n }, [internalQueryRef]);\n var fetchMore = React.useCallback(function (options) {\n var promise = internalQueryRef.fetchMore(options);\n setWrappedQueryRef(wrapQueryRef(internalQueryRef));\n return promise;\n }, [internalQueryRef]);\n return {\n refetch: refetch,\n fetchMore: fetchMore,\n // TODO: The internalQueryRef doesn't have TVariables' type information so we have to cast it here\n subscribeToMore: internalQueryRef.observable\n .subscribeToMore,\n };\n}\n//# sourceMappingURL=useQueryRefHandlers.js.map","import * as React from \"rehackt\";\nimport { assertWrappedQueryRef, getWrappedPromise, unwrapQueryRef, updateWrappedQueryRef, } from \"../internal/index.js\";\nimport { __use, wrapHook } from \"./internal/index.js\";\nimport { toApolloError } from \"./useSuspenseQuery.js\";\nimport { useSyncExternalStore } from \"./useSyncExternalStore.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\nexport function useReadQuery(queryRef) {\n var unwrapped = unwrapQueryRef(queryRef);\n var clientOrObsQuery = useApolloClient(unwrapped ?\n // passing an `ObservableQuery` is not supported by the types, but it will\n // return any truthy value that is passed in as an override so we cast the result\n unwrapped[\"observable\"]\n : undefined);\n return wrapHook(\"useReadQuery\", \n // eslint-disable-next-line react-compiler/react-compiler\n useReadQuery_, clientOrObsQuery)(queryRef);\n}\nfunction useReadQuery_(queryRef) {\n assertWrappedQueryRef(queryRef);\n var internalQueryRef = React.useMemo(function () { return unwrapQueryRef(queryRef); }, [queryRef]);\n var getPromise = React.useCallback(function () { return getWrappedPromise(queryRef); }, [queryRef]);\n if (internalQueryRef.disposed) {\n internalQueryRef.reinitialize();\n updateWrappedQueryRef(queryRef, internalQueryRef.promise);\n }\n React.useEffect(function () { return internalQueryRef.retain(); }, [internalQueryRef]);\n var promise = useSyncExternalStore(React.useCallback(function (forceUpdate) {\n return internalQueryRef.listen(function (promise) {\n updateWrappedQueryRef(queryRef, promise);\n forceUpdate();\n });\n }, [internalQueryRef, queryRef]), getPromise, getPromise);\n var result = __use(promise);\n return React.useMemo(function () {\n return {\n data: result.data,\n networkStatus: result.networkStatus,\n error: toApolloError(result),\n };\n }, [result]);\n}\n//# sourceMappingURL=useReadQuery.js.map","import { __assign } from \"tslib\";\nimport { InternalQueryReference, wrapQueryRef } from \"../internal/index.js\";\nimport { wrapHook } from \"../hooks/internal/index.js\";\n/**\n * A higher order function that returns a `preloadQuery` function which\n * can be used to begin loading a query with the given `client`. This is useful\n * when you want to start loading a query as early as possible outside of a\n * React component.\n *\n * > Refer to the [Suspense - Initiating queries outside React](https://www.apollographql.com/docs/react/data/suspense#initiating-queries-outside-react) section for a more in-depth overview.\n *\n * @param client - The `ApolloClient` instance that will be used to load queries\n * from the returned `preloadQuery` function.\n * @returns The `preloadQuery` function.\n *\n * @example\n * ```js\n * const preloadQuery = createQueryPreloader(client);\n * ```\n * @since 3.9.0\n */\nexport function createQueryPreloader(client) {\n return wrapHook(\"createQueryPreloader\", _createQueryPreloader, client)(client);\n}\nvar _createQueryPreloader = function (client) {\n return function preloadQuery(query, options) {\n var _a, _b;\n if (options === void 0) { options = Object.create(null); }\n var queryRef = new InternalQueryReference(client.watchQuery(__assign(__assign({}, options), { query: query })), {\n autoDisposeTimeoutMs: (_b = (_a = client.defaultOptions.react) === null || _a === void 0 ? void 0 : _a.suspense) === null || _b === void 0 ? void 0 : _b.autoDisposeTimeoutMs,\n });\n return wrapQueryRef(queryRef);\n };\n};\n//# sourceMappingURL=createQueryPreloader.js.map","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar _extends = require('@babel/runtime/helpers/extends');\nvar React = require('react');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n }\n n[\"default\"] = e;\n return Object.freeze(n);\n}\n\nvar _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);\nvar React__namespace = /*#__PURE__*/_interopNamespace(React);\n\nconst ArrowRight = props => /*#__PURE__*/React__namespace.createElement(\"svg\", _extends__default[\"default\"]({\n width: \"16\",\n height: \"16\",\n fill: \"#000\",\n viewBox: \"0 0 16 16\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, props), /*#__PURE__*/React__namespace.createElement(\"path\", {\n d: \"M12.354 8.354a.5.5 0 0 0 0-.708L9.172 4.464a.5.5 0 1 0-.708.708L11.293 8l-2.829 2.828a.5.5 0 1 0 .708.708l3.182-3.182ZM4 8.5h8v-1H4v1Z\",\n fill: \"inherit\"\n}));\n\nexports[\"default\"] = ArrowRight;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction styleInject(css, id) {\n let {\n insertAt\n } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (!css) return;\n if (typeof document === 'undefined') {\n globalThis.ssrCss = globalThis.ssrCss || [];\n globalThis.ssrCss.push({\n css,\n id\n });\n return;\n }\n if (document.getElementById(id)) return;\n const head = document.head || document.getElementsByTagName('head')[0];\n const style = document.createElement('style');\n style.id = id;\n if (insertAt === 'top' && head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n style.appendChild(document.createTextNode(css));\n}\n\nexports[\"default\"] = styleInject;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar styleInject = require('../../styleInject.js');\n\nvar css_248z = \".ReturnsLayout-module_pageWrapper__ia1yN{overflow-x:hidden}.ReturnsLayout-module_stepWrapper__8DIwQ{box-sizing:border-box;margin:0 auto;max-width:952px;min-height:calc(100vh - 250px);padding:0 .25rem}@media screen and (min-width:768px){.ReturnsLayout-module_desktopHeightWrapper__5rL4B{min-height:calc(100vh - 250px)}}\";\nvar styles = {\"pageWrapper\":\"ReturnsLayout-module_pageWrapper__ia1yN\",\"stepWrapper\":\"ReturnsLayout-module_stepWrapper__8DIwQ\",\"desktopHeightWrapper\":\"ReturnsLayout-module_desktopHeightWrapper__5rL4B\"};\nstyleInject[\"default\"](css_248z, '1b5da720-dc15-44da-be95-1fe766e976e7');\n\nexports[\"default\"] = styles;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar styleInject = require('../../../styleInject.js');\n\nvar css_248z = \".ReshopOptIn-module_wrapper__QTuZM{align-items:center;align-self:stretch;background-color:#f7f7f7;border:1px solid #ccc;display:flex;flex-direction:column;gap:1rem;justify-content:center;margin-top:2rem;padding:1.5rem;text-align:center}.ReshopOptIn-module_formField__4lVV7{max-width:312px;text-align:left;width:100%}.ReshopOptIn-module_disclaimer__P28Yw{color:#999;font-style:italic}.ReshopOptIn-module_errorMessage__N2Vdn{padding-top:.5rem}\";\nvar styles = {\"wrapper\":\"ReshopOptIn-module_wrapper__QTuZM\",\"formField\":\"ReshopOptIn-module_formField__4lVV7\",\"disclaimer\":\"ReshopOptIn-module_disclaimer__P28Yw\",\"errorMessage\":\"ReshopOptIn-module_errorMessage__N2Vdn\"};\nstyleInject[\"default\"](css_248z, 'a717ab7e-eade-438b-971b-e33e639cb113');\n\nexports[\"default\"] = styles;\n","var assignInWith = require('./assignInWith'),\n attempt = require('./attempt'),\n baseValues = require('./_baseValues'),\n customDefaultsAssignIn = require('./_customDefaultsAssignIn'),\n escapeStringChar = require('./_escapeStringChar'),\n isError = require('./isError'),\n isIterateeCall = require('./_isIterateeCall'),\n keys = require('./keys'),\n reInterpolate = require('./_reInterpolate'),\n templateSettings = require('./templateSettings'),\n toString = require('./toString');\n\n/** Error message constants. */\nvar INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n/** Used to match empty string literals in compiled template source. */\nvar reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n/**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\nvar reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n/**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\nvar reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n/** Used to ensure capturing order of template delimiters. */\nvar reNoMatch = /($^)/;\n\n/** Used to match unescaped characters in compiled string literals. */\nvar reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '`.\n this.sequenceIndex = Number(c === CharCodes.Lt);\n }\n };\n Tokenizer.prototype.stateCDATASequence = function (c) {\n if (c === Sequences.Cdata[this.sequenceIndex]) {\n if (++this.sequenceIndex === Sequences.Cdata.length) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CdataEnd;\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n }\n }\n else {\n this.sequenceIndex = 0;\n this.state = State.InDeclaration;\n this.stateInDeclaration(c); // Reconsume the character\n }\n };\n /**\n * When we wait for one specific character, we can speed things up\n * by skipping through the buffer until we find it.\n *\n * @returns Whether the character was found.\n */\n Tokenizer.prototype.fastForwardTo = function (c) {\n while (++this.index < this.buffer.length + this.offset) {\n if (this.buffer.charCodeAt(this.index - this.offset) === c) {\n return true;\n }\n }\n /*\n * We increment the index at the end of the `parse` loop,\n * so set it to `buffer.length - 1` here.\n *\n * TODO: Refactor `parse` to increment index before calling states.\n */\n this.index = this.buffer.length + this.offset - 1;\n return false;\n };\n /**\n * Comments and CDATA end with `-->` and `]]>`.\n *\n * Their common qualities are:\n * - Their end sequences have a distinct character they start with.\n * - That character is then repeated, so we have to check multiple repeats.\n * - All characters but the start character of the sequence can be skipped.\n */\n Tokenizer.prototype.stateInCommentLike = function (c) {\n if (c === this.currentSequence[this.sequenceIndex]) {\n if (++this.sequenceIndex === this.currentSequence.length) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, this.index, 2);\n }\n else {\n this.cbs.oncomment(this.sectionStart, this.index, 2);\n }\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n this.state = State.Text;\n }\n }\n else if (this.sequenceIndex === 0) {\n // Fast-forward to the first character of the sequence\n if (this.fastForwardTo(this.currentSequence[0])) {\n this.sequenceIndex = 1;\n }\n }\n else if (c !== this.currentSequence[this.sequenceIndex - 1]) {\n // Allow long sequences, eg. --->, ]]]>\n this.sequenceIndex = 0;\n }\n };\n /**\n * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.\n *\n * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).\n * We allow anything that wouldn't end the tag.\n */\n Tokenizer.prototype.isTagStartChar = function (c) {\n return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);\n };\n Tokenizer.prototype.startSpecial = function (sequence, offset) {\n this.isSpecial = true;\n this.currentSequence = sequence;\n this.sequenceIndex = offset;\n this.state = State.SpecialStartSequence;\n };\n Tokenizer.prototype.stateBeforeTagName = function (c) {\n if (c === CharCodes.ExclamationMark) {\n this.state = State.BeforeDeclaration;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Questionmark) {\n this.state = State.InProcessingInstruction;\n this.sectionStart = this.index + 1;\n }\n else if (this.isTagStartChar(c)) {\n var lower = c | 0x20;\n this.sectionStart = this.index;\n if (!this.xmlMode && lower === Sequences.TitleEnd[2]) {\n this.startSpecial(Sequences.TitleEnd, 3);\n }\n else {\n this.state =\n !this.xmlMode && lower === Sequences.ScriptEnd[2]\n ? State.BeforeSpecialS\n : State.InTagName;\n }\n }\n else if (c === CharCodes.Slash) {\n this.state = State.BeforeClosingTagName;\n }\n else {\n this.state = State.Text;\n this.stateText(c);\n }\n };\n Tokenizer.prototype.stateInTagName = function (c) {\n if (isEndOfTagSection(c)) {\n this.cbs.onopentagname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n };\n Tokenizer.prototype.stateBeforeClosingTagName = function (c) {\n if (isWhitespace(c)) {\n // Ignore\n }\n else if (c === CharCodes.Gt) {\n this.state = State.Text;\n }\n else {\n this.state = this.isTagStartChar(c)\n ? State.InClosingTagName\n : State.InSpecialComment;\n this.sectionStart = this.index;\n }\n };\n Tokenizer.prototype.stateInClosingTagName = function (c) {\n if (c === CharCodes.Gt || isWhitespace(c)) {\n this.cbs.onclosetag(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterClosingTagName;\n this.stateAfterClosingTagName(c);\n }\n };\n Tokenizer.prototype.stateAfterClosingTagName = function (c) {\n // Skip everything until \">\"\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.state = State.Text;\n this.baseState = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateBeforeAttributeName = function (c) {\n if (c === CharCodes.Gt) {\n this.cbs.onopentagend(this.index);\n if (this.isSpecial) {\n this.state = State.InSpecialTag;\n this.sequenceIndex = 0;\n }\n else {\n this.state = State.Text;\n }\n this.baseState = this.state;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Slash) {\n this.state = State.InSelfClosingTag;\n }\n else if (!isWhitespace(c)) {\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n };\n Tokenizer.prototype.stateInSelfClosingTag = function (c) {\n if (c === CharCodes.Gt) {\n this.cbs.onselfclosingtag(this.index);\n this.state = State.Text;\n this.baseState = State.Text;\n this.sectionStart = this.index + 1;\n this.isSpecial = false; // Reset special state, in case of self-closing special tags\n }\n else if (!isWhitespace(c)) {\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n };\n Tokenizer.prototype.stateInAttributeName = function (c) {\n if (c === CharCodes.Eq || isEndOfTagSection(c)) {\n this.cbs.onattribname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterAttributeName;\n this.stateAfterAttributeName(c);\n }\n };\n Tokenizer.prototype.stateAfterAttributeName = function (c) {\n if (c === CharCodes.Eq) {\n this.state = State.BeforeAttributeValue;\n }\n else if (c === CharCodes.Slash || c === CharCodes.Gt) {\n this.cbs.onattribend(QuoteType.NoValue, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (!isWhitespace(c)) {\n this.cbs.onattribend(QuoteType.NoValue, this.index);\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n };\n Tokenizer.prototype.stateBeforeAttributeValue = function (c) {\n if (c === CharCodes.DoubleQuote) {\n this.state = State.InAttributeValueDq;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.SingleQuote) {\n this.state = State.InAttributeValueSq;\n this.sectionStart = this.index + 1;\n }\n else if (!isWhitespace(c)) {\n this.sectionStart = this.index;\n this.state = State.InAttributeValueNq;\n this.stateInAttributeValueNoQuotes(c); // Reconsume token\n }\n };\n Tokenizer.prototype.handleInAttributeValue = function (c, quote) {\n if (c === quote ||\n (!this.decodeEntities && this.fastForwardTo(quote))) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(quote === CharCodes.DoubleQuote\n ? QuoteType.Double\n : QuoteType.Single, this.index);\n this.state = State.BeforeAttributeName;\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.baseState = this.state;\n this.state = State.BeforeEntity;\n }\n };\n Tokenizer.prototype.stateInAttributeValueDoubleQuotes = function (c) {\n this.handleInAttributeValue(c, CharCodes.DoubleQuote);\n };\n Tokenizer.prototype.stateInAttributeValueSingleQuotes = function (c) {\n this.handleInAttributeValue(c, CharCodes.SingleQuote);\n };\n Tokenizer.prototype.stateInAttributeValueNoQuotes = function (c) {\n if (isWhitespace(c) || c === CharCodes.Gt) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(QuoteType.Unquoted, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.baseState = this.state;\n this.state = State.BeforeEntity;\n }\n };\n Tokenizer.prototype.stateBeforeDeclaration = function (c) {\n if (c === CharCodes.OpeningSquareBracket) {\n this.state = State.CDATASequence;\n this.sequenceIndex = 0;\n }\n else {\n this.state =\n c === CharCodes.Dash\n ? State.BeforeComment\n : State.InDeclaration;\n }\n };\n Tokenizer.prototype.stateInDeclaration = function (c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.ondeclaration(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateInProcessingInstruction = function (c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.onprocessinginstruction(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateBeforeComment = function (c) {\n if (c === CharCodes.Dash) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CommentEnd;\n // Allow short comments (eg. )\n this.sequenceIndex = 2;\n this.sectionStart = this.index + 1;\n }\n else {\n this.state = State.InDeclaration;\n }\n };\n Tokenizer.prototype.stateInSpecialComment = function (c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.oncomment(this.sectionStart, this.index, 0);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateBeforeSpecialS = function (c) {\n var lower = c | 0x20;\n if (lower === Sequences.ScriptEnd[3]) {\n this.startSpecial(Sequences.ScriptEnd, 4);\n }\n else if (lower === Sequences.StyleEnd[3]) {\n this.startSpecial(Sequences.StyleEnd, 4);\n }\n else {\n this.state = State.InTagName;\n this.stateInTagName(c); // Consume the token again\n }\n };\n Tokenizer.prototype.stateBeforeEntity = function (c) {\n // Start excess with 1 to include the '&'\n this.entityExcess = 1;\n this.entityResult = 0;\n if (c === CharCodes.Number) {\n this.state = State.BeforeNumericEntity;\n }\n else if (c === CharCodes.Amp) {\n // We have two `&` characters in a row. Stay in the current state.\n }\n else {\n this.trieIndex = 0;\n this.trieCurrent = this.entityTrie[0];\n this.state = State.InNamedEntity;\n this.stateInNamedEntity(c);\n }\n };\n Tokenizer.prototype.stateInNamedEntity = function (c) {\n this.entityExcess += 1;\n this.trieIndex = (0, decode_js_1.determineBranch)(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c);\n if (this.trieIndex < 0) {\n this.emitNamedEntity();\n this.index--;\n return;\n }\n this.trieCurrent = this.entityTrie[this.trieIndex];\n var masked = this.trieCurrent & decode_js_1.BinTrieFlags.VALUE_LENGTH;\n // If the branch is a value, store it and continue\n if (masked) {\n // The mask is the number of bytes of the value, including the current byte.\n var valueLength = (masked >> 14) - 1;\n // If we have a legacy entity while parsing strictly, just skip the number of bytes\n if (!this.allowLegacyEntity() && c !== CharCodes.Semi) {\n this.trieIndex += valueLength;\n }\n else {\n // Add 1 as we have already incremented the excess\n var entityStart = this.index - this.entityExcess + 1;\n if (entityStart > this.sectionStart) {\n this.emitPartial(this.sectionStart, entityStart);\n }\n // If this is a surrogate pair, consume the next two bytes\n this.entityResult = this.trieIndex;\n this.trieIndex += valueLength;\n this.entityExcess = 0;\n this.sectionStart = this.index + 1;\n if (valueLength === 0) {\n this.emitNamedEntity();\n }\n }\n }\n };\n Tokenizer.prototype.emitNamedEntity = function () {\n this.state = this.baseState;\n if (this.entityResult === 0) {\n return;\n }\n var valueLength = (this.entityTrie[this.entityResult] & decode_js_1.BinTrieFlags.VALUE_LENGTH) >>\n 14;\n switch (valueLength) {\n case 1: {\n this.emitCodePoint(this.entityTrie[this.entityResult] &\n ~decode_js_1.BinTrieFlags.VALUE_LENGTH);\n break;\n }\n case 2: {\n this.emitCodePoint(this.entityTrie[this.entityResult + 1]);\n break;\n }\n case 3: {\n this.emitCodePoint(this.entityTrie[this.entityResult + 1]);\n this.emitCodePoint(this.entityTrie[this.entityResult + 2]);\n }\n }\n };\n Tokenizer.prototype.stateBeforeNumericEntity = function (c) {\n if ((c | 0x20) === CharCodes.LowerX) {\n this.entityExcess++;\n this.state = State.InHexEntity;\n }\n else {\n this.state = State.InNumericEntity;\n this.stateInNumericEntity(c);\n }\n };\n Tokenizer.prototype.emitNumericEntity = function (strict) {\n var entityStart = this.index - this.entityExcess - 1;\n var numberStart = entityStart + 2 + Number(this.state === State.InHexEntity);\n if (numberStart !== this.index) {\n // Emit leading data if any\n if (entityStart > this.sectionStart) {\n this.emitPartial(this.sectionStart, entityStart);\n }\n this.sectionStart = this.index + Number(strict);\n this.emitCodePoint((0, decode_js_1.replaceCodePoint)(this.entityResult));\n }\n this.state = this.baseState;\n };\n Tokenizer.prototype.stateInNumericEntity = function (c) {\n if (c === CharCodes.Semi) {\n this.emitNumericEntity(true);\n }\n else if (isNumber(c)) {\n this.entityResult = this.entityResult * 10 + (c - CharCodes.Zero);\n this.entityExcess++;\n }\n else {\n if (this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n }\n else {\n this.state = this.baseState;\n }\n this.index--;\n }\n };\n Tokenizer.prototype.stateInHexEntity = function (c) {\n if (c === CharCodes.Semi) {\n this.emitNumericEntity(true);\n }\n else if (isNumber(c)) {\n this.entityResult = this.entityResult * 16 + (c - CharCodes.Zero);\n this.entityExcess++;\n }\n else if (isHexDigit(c)) {\n this.entityResult =\n this.entityResult * 16 + ((c | 0x20) - CharCodes.LowerA + 10);\n this.entityExcess++;\n }\n else {\n if (this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n }\n else {\n this.state = this.baseState;\n }\n this.index--;\n }\n };\n Tokenizer.prototype.allowLegacyEntity = function () {\n return (!this.xmlMode &&\n (this.baseState === State.Text ||\n this.baseState === State.InSpecialTag));\n };\n /**\n * Remove data that has already been consumed from the buffer.\n */\n Tokenizer.prototype.cleanup = function () {\n // If we are inside of text or attributes, emit what we already have.\n if (this.running && this.sectionStart !== this.index) {\n if (this.state === State.Text ||\n (this.state === State.InSpecialTag && this.sequenceIndex === 0)) {\n this.cbs.ontext(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n else if (this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueNq) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n }\n };\n Tokenizer.prototype.shouldContinue = function () {\n return this.index < this.buffer.length + this.offset && this.running;\n };\n /**\n * Iterates through the buffer, calling the function corresponding to the current state.\n *\n * States that are more likely to be hit are higher up, as a performance improvement.\n */\n Tokenizer.prototype.parse = function () {\n while (this.shouldContinue()) {\n var c = this.buffer.charCodeAt(this.index - this.offset);\n switch (this.state) {\n case State.Text: {\n this.stateText(c);\n break;\n }\n case State.SpecialStartSequence: {\n this.stateSpecialStartSequence(c);\n break;\n }\n case State.InSpecialTag: {\n this.stateInSpecialTag(c);\n break;\n }\n case State.CDATASequence: {\n this.stateCDATASequence(c);\n break;\n }\n case State.InAttributeValueDq: {\n this.stateInAttributeValueDoubleQuotes(c);\n break;\n }\n case State.InAttributeName: {\n this.stateInAttributeName(c);\n break;\n }\n case State.InCommentLike: {\n this.stateInCommentLike(c);\n break;\n }\n case State.InSpecialComment: {\n this.stateInSpecialComment(c);\n break;\n }\n case State.BeforeAttributeName: {\n this.stateBeforeAttributeName(c);\n break;\n }\n case State.InTagName: {\n this.stateInTagName(c);\n break;\n }\n case State.InClosingTagName: {\n this.stateInClosingTagName(c);\n break;\n }\n case State.BeforeTagName: {\n this.stateBeforeTagName(c);\n break;\n }\n case State.AfterAttributeName: {\n this.stateAfterAttributeName(c);\n break;\n }\n case State.InAttributeValueSq: {\n this.stateInAttributeValueSingleQuotes(c);\n break;\n }\n case State.BeforeAttributeValue: {\n this.stateBeforeAttributeValue(c);\n break;\n }\n case State.BeforeClosingTagName: {\n this.stateBeforeClosingTagName(c);\n break;\n }\n case State.AfterClosingTagName: {\n this.stateAfterClosingTagName(c);\n break;\n }\n case State.BeforeSpecialS: {\n this.stateBeforeSpecialS(c);\n break;\n }\n case State.InAttributeValueNq: {\n this.stateInAttributeValueNoQuotes(c);\n break;\n }\n case State.InSelfClosingTag: {\n this.stateInSelfClosingTag(c);\n break;\n }\n case State.InDeclaration: {\n this.stateInDeclaration(c);\n break;\n }\n case State.BeforeDeclaration: {\n this.stateBeforeDeclaration(c);\n break;\n }\n case State.BeforeComment: {\n this.stateBeforeComment(c);\n break;\n }\n case State.InProcessingInstruction: {\n this.stateInProcessingInstruction(c);\n break;\n }\n case State.InNamedEntity: {\n this.stateInNamedEntity(c);\n break;\n }\n case State.BeforeEntity: {\n this.stateBeforeEntity(c);\n break;\n }\n case State.InHexEntity: {\n this.stateInHexEntity(c);\n break;\n }\n case State.InNumericEntity: {\n this.stateInNumericEntity(c);\n break;\n }\n default: {\n // `this._state === State.BeforeNumericEntity`\n this.stateBeforeNumericEntity(c);\n }\n }\n this.index++;\n }\n this.cleanup();\n };\n Tokenizer.prototype.finish = function () {\n if (this.state === State.InNamedEntity) {\n this.emitNamedEntity();\n }\n // If there is remaining data, emit it in a reasonable way\n if (this.sectionStart < this.index) {\n this.handleTrailingData();\n }\n this.cbs.onend();\n };\n /** Handle any trailing data. */\n Tokenizer.prototype.handleTrailingData = function () {\n var endIndex = this.buffer.length + this.offset;\n if (this.state === State.InCommentLike) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, endIndex, 0);\n }\n else {\n this.cbs.oncomment(this.sectionStart, endIndex, 0);\n }\n }\n else if (this.state === State.InNumericEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InHexEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InTagName ||\n this.state === State.BeforeAttributeName ||\n this.state === State.BeforeAttributeValue ||\n this.state === State.AfterAttributeName ||\n this.state === State.InAttributeName ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueNq ||\n this.state === State.InClosingTagName) {\n /*\n * If we are currently in an opening or closing tag, us not calling the\n * respective callback signals that the tag should be ignored.\n */\n }\n else {\n this.cbs.ontext(this.sectionStart, endIndex);\n }\n };\n Tokenizer.prototype.emitPartial = function (start, endIndex) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n this.cbs.onattribdata(start, endIndex);\n }\n else {\n this.cbs.ontext(start, endIndex);\n }\n };\n Tokenizer.prototype.emitCodePoint = function (cp) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n this.cbs.onattribentity(cp);\n }\n else {\n this.cbs.ontextentity(cp);\n }\n };\n return Tokenizer;\n}());\nexports.default = Tokenizer;\n//# sourceMappingURL=Tokenizer.js.map","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.Mustache = factory());\n}(this, (function () { 'use strict';\n\n /*!\n * mustache.js - Logic-less {{mustache}} templates with JavaScript\n * http://github.com/janl/mustache.js\n */\n\n var objectToString = Object.prototype.toString;\n var isArray = Array.isArray || function isArrayPolyfill (object) {\n return objectToString.call(object) === '[object Array]';\n };\n\n function isFunction (object) {\n return typeof object === 'function';\n }\n\n /**\n * More correct typeof string handling array\n * which normally returns typeof 'object'\n */\n function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }\n\n function escapeRegExp (string) {\n return string.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, '\\\\$&');\n }\n\n /**\n * Null safe way of checking whether or not an object,\n * including its prototype, has a given property\n */\n function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }\n\n /**\n * Safe way of detecting whether or not the given thing is a primitive and\n * whether it has the given property\n */\n function primitiveHasOwnProperty (primitive, propName) {\n return (\n primitive != null\n && typeof primitive !== 'object'\n && primitive.hasOwnProperty\n && primitive.hasOwnProperty(propName)\n );\n }\n\n // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577\n // See https://github.com/janl/mustache.js/issues/189\n var regExpTest = RegExp.prototype.test;\n function testRegExp (re, string) {\n return regExpTest.call(re, string);\n }\n\n var nonSpaceRe = /\\S/;\n function isWhitespace (string) {\n return !testRegExp(nonSpaceRe, string);\n }\n\n var entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/',\n '`': '`',\n '=': '='\n };\n\n function escapeHtml (string) {\n return String(string).replace(/[&<>\"'`=\\/]/g, function fromEntityMap (s) {\n return entityMap[s];\n });\n }\n\n var whiteRe = /\\s*/;\n var spaceRe = /\\s+/;\n var equalsRe = /\\s*=/;\n var curlyRe = /\\s*\\}/;\n var tagRe = /#|\\^|\\/|>|\\{|&|=|!/;\n\n /**\n * Breaks up the given `template` string into a tree of tokens. If the `tags`\n * argument is given here it must be an array with two string values: the\n * opening and closing tags used in the template (e.g. [ \"<%\", \"%>\" ]). Of\n * course, the default is to use mustaches (i.e. mustache.tags).\n *\n * A token is an array with at least 4 elements. The first element is the\n * mustache symbol that was used inside the tag, e.g. \"#\" or \"&\". If the tag\n * did not contain a symbol (i.e. {{myValue}}) this element is \"name\". For\n * all text that appears outside a symbol this element is \"text\".\n *\n * The second element of a token is its \"value\". For mustache tags this is\n * whatever else was inside the tag besides the opening symbol. For text tokens\n * this is the text itself.\n *\n * The third and fourth elements of the token are the start and end indices,\n * respectively, of the token in the original template.\n *\n * Tokens that are the root node of a subtree contain two more elements: 1) an\n * array of tokens in the subtree and 2) the index in the original template at\n * which the closing tag for that section begins.\n *\n * Tokens for partials also contain two more elements: 1) a string value of\n * indendation prior to that tag and 2) the index of that tag on that line -\n * eg a value of 2 indicates the partial is the third tag on this line.\n */\n function parseTemplate (template, tags) {\n if (!template)\n return [];\n var lineHasNonSpace = false;\n var sections = []; // Stack to hold section tokens\n var tokens = []; // Buffer to hold the tokens\n var spaces = []; // Indices of whitespace tokens on the current line\n var hasTag = false; // Is there a {{tag}} on the current line?\n var nonSpace = false; // Is there a non-space char on the current line?\n var indentation = ''; // Tracks indentation for tags that use it\n var tagIndex = 0; // Stores a count of number of tags encountered on a line\n\n // Strips all whitespace tokens array for the current line\n // if there was a {{#tag}} on it and otherwise only space.\n function stripSpace () {\n if (hasTag && !nonSpace) {\n while (spaces.length)\n delete tokens[spaces.pop()];\n } else {\n spaces = [];\n }\n\n hasTag = false;\n nonSpace = false;\n }\n\n var openingTagRe, closingTagRe, closingCurlyRe;\n function compileTags (tagsToCompile) {\n if (typeof tagsToCompile === 'string')\n tagsToCompile = tagsToCompile.split(spaceRe, 2);\n\n if (!isArray(tagsToCompile) || tagsToCompile.length !== 2)\n throw new Error('Invalid tags: ' + tagsToCompile);\n\n openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + '\\\\s*');\n closingTagRe = new RegExp('\\\\s*' + escapeRegExp(tagsToCompile[1]));\n closingCurlyRe = new RegExp('\\\\s*' + escapeRegExp('}' + tagsToCompile[1]));\n }\n\n compileTags(tags || mustache.tags);\n\n var scanner = new Scanner(template);\n\n var start, type, value, chr, token, openSection;\n while (!scanner.eos()) {\n start = scanner.pos;\n\n // Match any text between tags.\n value = scanner.scanUntil(openingTagRe);\n\n if (value) {\n for (var i = 0, valueLength = value.length; i < valueLength; ++i) {\n chr = value.charAt(i);\n\n if (isWhitespace(chr)) {\n spaces.push(tokens.length);\n indentation += chr;\n } else {\n nonSpace = true;\n lineHasNonSpace = true;\n indentation += ' ';\n }\n\n tokens.push([ 'text', chr, start, start + 1 ]);\n start += 1;\n\n // Check for whitespace on the current line.\n if (chr === '\\n') {\n stripSpace();\n indentation = '';\n tagIndex = 0;\n lineHasNonSpace = false;\n }\n }\n }\n\n // Match the opening tag.\n if (!scanner.scan(openingTagRe))\n break;\n\n hasTag = true;\n\n // Get the tag type.\n type = scanner.scan(tagRe) || 'name';\n scanner.scan(whiteRe);\n\n // Get the tag value.\n if (type === '=') {\n value = scanner.scanUntil(equalsRe);\n scanner.scan(equalsRe);\n scanner.scanUntil(closingTagRe);\n } else if (type === '{') {\n value = scanner.scanUntil(closingCurlyRe);\n scanner.scan(curlyRe);\n scanner.scanUntil(closingTagRe);\n type = '&';\n } else {\n value = scanner.scanUntil(closingTagRe);\n }\n\n // Match the closing tag.\n if (!scanner.scan(closingTagRe))\n throw new Error('Unclosed tag at ' + scanner.pos);\n\n if (type == '>') {\n token = [ type, value, start, scanner.pos, indentation, tagIndex, lineHasNonSpace ];\n } else {\n token = [ type, value, start, scanner.pos ];\n }\n tagIndex++;\n tokens.push(token);\n\n if (type === '#' || type === '^') {\n sections.push(token);\n } else if (type === '/') {\n // Check section nesting.\n openSection = sections.pop();\n\n if (!openSection)\n throw new Error('Unopened section \"' + value + '\" at ' + start);\n\n if (openSection[1] !== value)\n throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + start);\n } else if (type === 'name' || type === '{' || type === '&') {\n nonSpace = true;\n } else if (type === '=') {\n // Set the tags for the next time around.\n compileTags(value);\n }\n }\n\n stripSpace();\n\n // Make sure there are no open sections when we're done.\n openSection = sections.pop();\n\n if (openSection)\n throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + scanner.pos);\n\n return nestTokens(squashTokens(tokens));\n }\n\n /**\n * Combines the values of consecutive text tokens in the given `tokens` array\n * to a single token.\n */\n function squashTokens (tokens) {\n var squashedTokens = [];\n\n var token, lastToken;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n\n if (token) {\n if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {\n lastToken[1] += token[1];\n lastToken[3] = token[3];\n } else {\n squashedTokens.push(token);\n lastToken = token;\n }\n }\n }\n\n return squashedTokens;\n }\n\n /**\n * Forms the given array of `tokens` into a nested tree structure where\n * tokens that represent a section have two additional items: 1) an array of\n * all tokens that appear in that section and 2) the index in the original\n * template that represents the end of that section.\n */\n function nestTokens (tokens) {\n var nestedTokens = [];\n var collector = nestedTokens;\n var sections = [];\n\n var token, section;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n\n switch (token[0]) {\n case '#':\n case '^':\n collector.push(token);\n sections.push(token);\n collector = token[4] = [];\n break;\n case '/':\n section = sections.pop();\n section[5] = token[2];\n collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;\n break;\n default:\n collector.push(token);\n }\n }\n\n return nestedTokens;\n }\n\n /**\n * A simple string scanner that is used by the template parser to find\n * tokens in template strings.\n */\n function Scanner (string) {\n this.string = string;\n this.tail = string;\n this.pos = 0;\n }\n\n /**\n * Returns `true` if the tail is empty (end of string).\n */\n Scanner.prototype.eos = function eos () {\n return this.tail === '';\n };\n\n /**\n * Tries to match the given regular expression at the current position.\n * Returns the matched text if it can match, the empty string otherwise.\n */\n Scanner.prototype.scan = function scan (re) {\n var match = this.tail.match(re);\n\n if (!match || match.index !== 0)\n return '';\n\n var string = match[0];\n\n this.tail = this.tail.substring(string.length);\n this.pos += string.length;\n\n return string;\n };\n\n /**\n * Skips all text until the given regular expression can be matched. Returns\n * the skipped string, which is the entire tail if no match can be made.\n */\n Scanner.prototype.scanUntil = function scanUntil (re) {\n var index = this.tail.search(re), match;\n\n switch (index) {\n case -1:\n match = this.tail;\n this.tail = '';\n break;\n case 0:\n match = '';\n break;\n default:\n match = this.tail.substring(0, index);\n this.tail = this.tail.substring(index);\n }\n\n this.pos += match.length;\n\n return match;\n };\n\n /**\n * Represents a rendering context by wrapping a view object and\n * maintaining a reference to the parent context.\n */\n function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }\n\n /**\n * Creates a new context using the given view with this context\n * as the parent.\n */\n Context.prototype.push = function push (view) {\n return new Context(view, this);\n };\n\n /**\n * Returns the value of the given name in this context, traversing\n * up the context hierarchy if the value is absent in this context's view.\n */\n Context.prototype.lookup = function lookup (name) {\n var cache = this.cache;\n\n var value;\n if (cache.hasOwnProperty(name)) {\n value = cache[name];\n } else {\n var context = this, intermediateValue, names, index, lookupHit = false;\n\n while (context) {\n if (name.indexOf('.') > 0) {\n intermediateValue = context.view;\n names = name.split('.');\n index = 0;\n\n /**\n * Using the dot notion path in `name`, we descend through the\n * nested objects.\n *\n * To be certain that the lookup has been successful, we have to\n * check if the last object in the path actually has the property\n * we are looking for. We store the result in `lookupHit`.\n *\n * This is specially necessary for when the value has been set to\n * `undefined` and we want to avoid looking up parent contexts.\n *\n * In the case where dot notation is used, we consider the lookup\n * to be successful even if the last \"object\" in the path is\n * not actually an object but a primitive (e.g., a string, or an\n * integer), because it is sometimes useful to access a property\n * of an autoboxed primitive, such as the length of a string.\n **/\n while (intermediateValue != null && index < names.length) {\n if (index === names.length - 1)\n lookupHit = (\n hasProperty(intermediateValue, names[index])\n || primitiveHasOwnProperty(intermediateValue, names[index])\n );\n\n intermediateValue = intermediateValue[names[index++]];\n }\n } else {\n intermediateValue = context.view[name];\n\n /**\n * Only checking against `hasProperty`, which always returns `false` if\n * `context.view` is not an object. Deliberately omitting the check\n * against `primitiveHasOwnProperty` if dot notation is not used.\n *\n * Consider this example:\n * ```\n * Mustache.render(\"The length of a football field is {{#length}}{{length}}{{/length}}.\", {length: \"100 yards\"})\n * ```\n *\n * If we were to check also against `primitiveHasOwnProperty`, as we do\n * in the dot notation case, then render call would return:\n *\n * \"The length of a football field is 9.\"\n *\n * rather than the expected:\n *\n * \"The length of a football field is 100 yards.\"\n **/\n lookupHit = hasProperty(context.view, name);\n }\n\n if (lookupHit) {\n value = intermediateValue;\n break;\n }\n\n context = context.parent;\n }\n\n cache[name] = value;\n }\n\n if (isFunction(value))\n value = value.call(this.view);\n\n return value;\n };\n\n /**\n * A Writer knows how to take a stream of tokens and render them to a\n * string, given a context. It also maintains a cache of templates to\n * avoid the need to parse the same template twice.\n */\n function Writer () {\n this.templateCache = {\n _cache: {},\n set: function set (key, value) {\n this._cache[key] = value;\n },\n get: function get (key) {\n return this._cache[key];\n },\n clear: function clear () {\n this._cache = {};\n }\n };\n }\n\n /**\n * Clears all cached templates in this writer.\n */\n Writer.prototype.clearCache = function clearCache () {\n if (typeof this.templateCache !== 'undefined') {\n this.templateCache.clear();\n }\n };\n\n /**\n * Parses and caches the given `template` according to the given `tags` or\n * `mustache.tags` if `tags` is omitted, and returns the array of tokens\n * that is generated from the parse.\n */\n Writer.prototype.parse = function parse (template, tags) {\n var cache = this.templateCache;\n var cacheKey = template + ':' + (tags || mustache.tags).join(':');\n var isCacheEnabled = typeof cache !== 'undefined';\n var tokens = isCacheEnabled ? cache.get(cacheKey) : undefined;\n\n if (tokens == undefined) {\n tokens = parseTemplate(template, tags);\n isCacheEnabled && cache.set(cacheKey, tokens);\n }\n return tokens;\n };\n\n /**\n * High-level method that is used to render the given `template` with\n * the given `view`.\n *\n * The optional `partials` argument may be an object that contains the\n * names and templates of partials that are used in the template. It may\n * also be a function that is used to load partial templates on the fly\n * that takes a single argument: the name of the partial.\n *\n * If the optional `config` argument is given here, then it should be an\n * object with a `tags` attribute or an `escape` attribute or both.\n * If an array is passed, then it will be interpreted the same way as\n * a `tags` attribute on a `config` object.\n *\n * The `tags` attribute of a `config` object must be an array with two\n * string values: the opening and closing tags used in the template (e.g.\n * [ \"<%\", \"%>\" ]). The default is to mustache.tags.\n *\n * The `escape` attribute of a `config` object must be a function which\n * accepts a string as input and outputs a safely escaped string.\n * If an `escape` function is not provided, then an HTML-safe string\n * escaping function is used as the default.\n */\n Writer.prototype.render = function render (template, view, partials, config) {\n var tags = this.getConfigTags(config);\n var tokens = this.parse(template, tags);\n var context = (view instanceof Context) ? view : new Context(view, undefined);\n return this.renderTokens(tokens, context, partials, template, config);\n };\n\n /**\n * Low-level method that renders the given array of `tokens` using\n * the given `context` and `partials`.\n *\n * Note: The `originalTemplate` is only ever used to extract the portion\n * of the original template that was contained in a higher-order section.\n * If the template doesn't use higher-order sections, this argument may\n * be omitted.\n */\n Writer.prototype.renderTokens = function renderTokens (tokens, context, partials, originalTemplate, config) {\n var buffer = '';\n\n var token, symbol, value;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n value = undefined;\n token = tokens[i];\n symbol = token[0];\n\n if (symbol === '#') value = this.renderSection(token, context, partials, originalTemplate, config);\n else if (symbol === '^') value = this.renderInverted(token, context, partials, originalTemplate, config);\n else if (symbol === '>') value = this.renderPartial(token, context, partials, config);\n else if (symbol === '&') value = this.unescapedValue(token, context);\n else if (symbol === 'name') value = this.escapedValue(token, context, config);\n else if (symbol === 'text') value = this.rawValue(token);\n\n if (value !== undefined)\n buffer += value;\n }\n\n return buffer;\n };\n\n Writer.prototype.renderSection = function renderSection (token, context, partials, originalTemplate, config) {\n var self = this;\n var buffer = '';\n var value = context.lookup(token[1]);\n\n // This function is used to render an arbitrary template\n // in the current context by higher-order sections.\n function subRender (template) {\n return self.render(template, context, partials, config);\n }\n\n if (!value) return;\n\n if (isArray(value)) {\n for (var j = 0, valueLength = value.length; j < valueLength; ++j) {\n buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate, config);\n }\n } else if (typeof value === 'object' || typeof value === 'string' || typeof value === 'number') {\n buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate, config);\n } else if (isFunction(value)) {\n if (typeof originalTemplate !== 'string')\n throw new Error('Cannot use higher-order sections without the original template');\n\n // Extract the portion of the original template that the section contains.\n value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);\n\n if (value != null)\n buffer += value;\n } else {\n buffer += this.renderTokens(token[4], context, partials, originalTemplate, config);\n }\n return buffer;\n };\n\n Writer.prototype.renderInverted = function renderInverted (token, context, partials, originalTemplate, config) {\n var value = context.lookup(token[1]);\n\n // Use JavaScript's definition of falsy. Include empty arrays.\n // See https://github.com/janl/mustache.js/issues/186\n if (!value || (isArray(value) && value.length === 0))\n return this.renderTokens(token[4], context, partials, originalTemplate, config);\n };\n\n Writer.prototype.indentPartial = function indentPartial (partial, indentation, lineHasNonSpace) {\n var filteredIndentation = indentation.replace(/[^ \\t]/g, '');\n var partialByNl = partial.split('\\n');\n for (var i = 0; i < partialByNl.length; i++) {\n if (partialByNl[i].length && (i > 0 || !lineHasNonSpace)) {\n partialByNl[i] = filteredIndentation + partialByNl[i];\n }\n }\n return partialByNl.join('\\n');\n };\n\n Writer.prototype.renderPartial = function renderPartial (token, context, partials, config) {\n if (!partials) return;\n var tags = this.getConfigTags(config);\n\n var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];\n if (value != null) {\n var lineHasNonSpace = token[6];\n var tagIndex = token[5];\n var indentation = token[4];\n var indentedValue = value;\n if (tagIndex == 0 && indentation) {\n indentedValue = this.indentPartial(value, indentation, lineHasNonSpace);\n }\n var tokens = this.parse(indentedValue, tags);\n return this.renderTokens(tokens, context, partials, indentedValue, config);\n }\n };\n\n Writer.prototype.unescapedValue = function unescapedValue (token, context) {\n var value = context.lookup(token[1]);\n if (value != null)\n return value;\n };\n\n Writer.prototype.escapedValue = function escapedValue (token, context, config) {\n var escape = this.getConfigEscape(config) || mustache.escape;\n var value = context.lookup(token[1]);\n if (value != null)\n return (typeof value === 'number' && escape === mustache.escape) ? String(value) : escape(value);\n };\n\n Writer.prototype.rawValue = function rawValue (token) {\n return token[1];\n };\n\n Writer.prototype.getConfigTags = function getConfigTags (config) {\n if (isArray(config)) {\n return config;\n }\n else if (config && typeof config === 'object') {\n return config.tags;\n }\n else {\n return undefined;\n }\n };\n\n Writer.prototype.getConfigEscape = function getConfigEscape (config) {\n if (config && typeof config === 'object' && !isArray(config)) {\n return config.escape;\n }\n else {\n return undefined;\n }\n };\n\n var mustache = {\n name: 'mustache.js',\n version: '4.2.0',\n tags: [ '{{', '}}' ],\n clearCache: undefined,\n escape: undefined,\n parse: undefined,\n render: undefined,\n Scanner: undefined,\n Context: undefined,\n Writer: undefined,\n /**\n * Allows a user to override the default caching strategy, by providing an\n * object with set, get and clear methods. This can also be used to disable\n * the cache by setting it to the literal `undefined`.\n */\n set templateCache (cache) {\n defaultWriter.templateCache = cache;\n },\n /**\n * Gets the default or overridden caching object from the default writer.\n */\n get templateCache () {\n return defaultWriter.templateCache;\n }\n };\n\n // All high-level mustache.* functions use this writer.\n var defaultWriter = new Writer();\n\n /**\n * Clears all cached templates in the default writer.\n */\n mustache.clearCache = function clearCache () {\n return defaultWriter.clearCache();\n };\n\n /**\n * Parses and caches the given template in the default writer and returns the\n * array of tokens it contains. Doing this ahead of time avoids the need to\n * parse templates on the fly as they are rendered.\n */\n mustache.parse = function parse (template, tags) {\n return defaultWriter.parse(template, tags);\n };\n\n /**\n * Renders the `template` with the given `view`, `partials`, and `config`\n * using the default writer.\n */\n mustache.render = function render (template, view, partials, config) {\n if (typeof template !== 'string') {\n throw new TypeError('Invalid template! Template should be a \"string\" ' +\n 'but \"' + typeStr(template) + '\" was given as the first ' +\n 'argument for mustache#render(template, view, partials)');\n }\n\n return defaultWriter.render(template, view, partials, config);\n };\n\n // Export the escaping function so that the user may override it.\n // See https://github.com/janl/mustache.js/issues/244\n mustache.escape = escapeHtml;\n\n // Export these mainly for testing, but also for advanced usage.\n mustache.Scanner = Scanner;\n mustache.Context = Context;\n mustache.Writer = Writer;\n\n return mustache;\n\n})));\n","var apply = require('./_apply'),\n baseRest = require('./_baseRest'),\n isError = require('./isError');\n\n/**\n * Attempts to invoke `func`, returning either the result or the caught error\n * object. Any additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Function} func The function to attempt.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {*} Returns the `func` result or error object.\n * @example\n *\n * // Avoid throwing errors for invalid selectors.\n * var elements = _.attempt(function(selector) {\n * return document.querySelectorAll(selector);\n * }, '>_>');\n *\n * if (_.isError(elements)) {\n * elements = [];\n * }\n */\nvar attempt = baseRest(function(func, args) {\n try {\n return apply(func, undefined, args);\n } catch (e) {\n return isError(e) ? e : new Error(e);\n }\n});\n\nmodule.exports = attempt;\n","var convert = require('./convert'),\n func = convert('unescape', require('../unescape'), require('./_falseOptions'));\n\nfunc.placeholder = require('./placeholder');\nmodule.exports = func;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction styleInject(css, id) {\n let {\n insertAt\n } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (!css) return;\n if (typeof document === 'undefined') {\n globalThis.ssrCss = globalThis.ssrCss || [];\n globalThis.ssrCss.push({\n css,\n id\n });\n return;\n }\n if (document.getElementById(id)) return;\n const head = document.head || document.getElementsByTagName('head')[0];\n const style = document.createElement('style');\n style.id = id;\n if (insertAt === 'top' && head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n style.appendChild(document.createTextNode(css));\n}\n\nexports[\"default\"] = styleInject;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar styleInject = require('../../../styleInject.js');\n\nvar css_248z = \".PudoRaw-module_wrapper__IFUiM{display:flex;flex-direction:column;justify-content:center;padding:1.5rem}.PudoRaw-module_pudoElmWrap__u9Cud{align-items:center;display:flex;flex-direction:column;justify-content:center;width:100%}.PudoRaw-module_pudoGroup__vaFe8{display:flex;flex-direction:column;gap:8px;justify-content:stretch;justify-self:center;max-width:520px;width:100%}\";\nvar styles = {\"wrapper\":\"PudoRaw-module_wrapper__IFUiM\",\"pudoElmWrap\":\"PudoRaw-module_pudoElmWrap__u9Cud\",\"pudoGroup\":\"PudoRaw-module_pudoGroup__vaFe8\"};\nstyleInject[\"default\"](css_248z, 'c8450d66-e5fa-4bce-9fc4-918dad1fcffe');\n\nexports[\"default\"] = styles;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar React = require('react');\nvar mustache = require('mustache');\nvar nthHookTheme = require('@narvar/nth-hook-theme');\nvar nthHookContextAnalytics = require('@narvar/nth-hook-context-analytics');\nvar Panel = require('@narvar/nth-block-panel');\nvar Asset_module = require('./Asset.module.css.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar React__default = /*#__PURE__*/_interopDefaultLegacy(React);\nvar mustache__default = /*#__PURE__*/_interopDefaultLegacy(mustache);\nvar Panel__default = /*#__PURE__*/_interopDefaultLegacy(Panel);\n\nconst Asset = _ref => {\n let {\n featureName,\n assetId,\n asset,\n fixedPanelHeight,\n templateRenderingContext\n } = _ref;\n const {\n imgPrimaryNone: imgStyle,\n assetpanelcontainerNoneNone: containerStyle,\n panelcontainerNoneNone: {\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomLeftRadius,\n borderBottomRightRadius\n } = {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0\n }\n } = nthHookTheme.useTheme();\n const logEvent = nthHookContextAnalytics.useAnalyticsPost();\n const baseLogInfo = {\n feature: featureName,\n pageComponent: nthHookContextAnalytics.NarvarEventComponents.NTH_BLOCK_ASSET,\n eventComponent: nthHookContextAnalytics.NarvarEventComponents.NTH_BLOCK_ASSET,\n eventFeature: nthHookContextAnalytics.NarvarEventComponents.NTH_BLOCK_ASSET\n };\n React.useEffect(() => {\n if (!assetId || !asset) return;\n const {\n category,\n altText,\n cdnUrl,\n name\n } = asset;\n logEvent({\n ...baseLogInfo,\n clickAssetId: assetId,\n clickAssetType: category,\n clickAssetUrl: cdnUrl || '',\n clickLinkLabel: name || altText,\n eventType: nthHookContextAnalytics.NarvarEventTypes.COMPONENT_RENDER\n });\n },\n // TODO: Make this dependency array exhaustive\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [assetId]);\n if (!asset) return null;\n const {\n category,\n destinationUrl,\n altText,\n cdnUrl\n } = asset;\n if (!cdnUrl) return null;\n const renderedDestinationUrl = mustache__default[\"default\"].render(destinationUrl || '', templateRenderingContext);\n const img = fixedPanelHeight ? /*#__PURE__*/React__default[\"default\"].createElement(\"div\", {\n role: \"img\",\n \"aria-label\": altText || '',\n className: Asset_module[\"default\"].container,\n style: {\n backgroundImage: `url(${cdnUrl})`,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomLeftRadius,\n borderBottomRightRadius,\n ...imgStyle\n }\n }) : /*#__PURE__*/React__default[\"default\"].createElement(\"img\", {\n src: cdnUrl,\n alt: altText || '',\n className: Asset_module[\"default\"].image,\n style: {\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomLeftRadius,\n borderBottomRightRadius,\n ...imgStyle\n }\n });\n return /*#__PURE__*/React__default[\"default\"].createElement(Panel__default[\"default\"], {\n sOuter: {\n ...containerStyle,\n overflowY: 'visible',\n boxSizing: 'border-box',\n height: fixedPanelHeight || containerStyle && containerStyle.height || '100%'\n },\n sInner: {\n overflowY: 'visible',\n padding: 0\n },\n header: true\n }, destinationUrl ? /*#__PURE__*/React__default[\"default\"].createElement(\"a\", {\n className: Asset_module[\"default\"].link,\n href: renderedDestinationUrl,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n style: {\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomLeftRadius,\n borderBottomRightRadius\n },\n onClick: () => logEvent({\n ...baseLogInfo,\n clickAssetId: assetId,\n clickAssetType: category,\n clickAssetUrl: cdnUrl,\n clickCategory: nthHookContextAnalytics.NarvarClickSubTypes.MARKETING_ASSET,\n clickLinkDestinationUrl: renderedDestinationUrl,\n clickLinkLabel: altText,\n clickSubType: nthHookContextAnalytics.NarvarClickSubTypes.MARKETING_ASSET,\n clickType: nthHookContextAnalytics.NarvarClickTypes.OUTGOING,\n eventType: nthHookContextAnalytics.NarvarEventTypes.CLICK\n })\n }, img) : img);\n};\nvar Asset$1 = nthHookTheme.withThemeProvider(Asset, {\n themeTokens: ['imgPrimaryNone', 'assetpanelcontainerNoneNone', 'panelcontainerNoneNone']\n});\n\nexports[\"default\"] = Asset$1;\n","'use strict'\n\nclass Warning {\n constructor(text, opts = {}) {\n this.type = 'warning'\n this.text = text\n\n if (opts.node && opts.node.source) {\n let range = opts.node.rangeBy(opts)\n this.line = range.start.line\n this.column = range.start.column\n this.endLine = range.end.line\n this.endColumn = range.end.column\n }\n\n for (let opt in opts) this[opt] = opts[opt]\n }\n\n toString() {\n if (this.node) {\n return this.node.error(this.text, {\n index: this.index,\n plugin: this.plugin,\n word: this.word\n }).message\n }\n\n if (this.plugin) {\n return this.plugin + ': ' + this.text\n }\n\n return this.text\n }\n}\n\nmodule.exports = Warning\nWarning.default = Warning\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport { isFragment } from 'react-is';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport capitalize from '../utils/capitalize';\nimport { alpha } from '../styles/colorManipulator';\nimport withStyles from '../styles/withStyles';\nimport Button from '../Button'; // Force a side effect so we don't have any override priority issue.\n// eslint-disable-next-line no-unused-expressions\n\nButton.styles;\nexport var styles = function styles(theme) {\n return {\n /* Styles applied to the root element. */\n root: {\n display: 'inline-flex',\n borderRadius: theme.shape.borderRadius\n },\n\n /* Styles applied to the root element if `variant=\"contained\"`. */\n contained: {\n boxShadow: theme.shadows[2]\n },\n\n /* Styles applied to the root element if `disableElevation={true}`. */\n disableElevation: {\n boxShadow: 'none'\n },\n\n /* Pseudo-class applied to child elements if `disabled={true}`. */\n disabled: {},\n\n /* Styles applied to the root element if `fullWidth={true}`. */\n fullWidth: {\n width: '100%'\n },\n\n /* Styles applied to the root element if `orientation=\"vertical\"`. */\n vertical: {\n flexDirection: 'column'\n },\n\n /* Styles applied to the children. */\n grouped: {\n minWidth: 40\n },\n\n /* Styles applied to the children if `orientation=\"horizontal\"`. */\n groupedHorizontal: {\n '&:not(:first-child)': {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0\n },\n '&:not(:last-child)': {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0\n }\n },\n\n /* Styles applied to the children if `orientation=\"vertical\"`. */\n groupedVertical: {\n '&:not(:first-child)': {\n borderTopRightRadius: 0,\n borderTopLeftRadius: 0\n },\n '&:not(:last-child)': {\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0\n }\n },\n\n /* Styles applied to the children if `variant=\"text\"`. */\n groupedText: {},\n\n /* Styles applied to the children if `variant=\"text\"` and `orientation=\"horizontal\"`. */\n groupedTextHorizontal: {\n '&:not(:last-child)': {\n borderRight: \"1px solid \".concat(theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)')\n }\n },\n\n /* Styles applied to the children if `variant=\"text\"` and `orientation=\"vertical\"`. */\n groupedTextVertical: {\n '&:not(:last-child)': {\n borderBottom: \"1px solid \".concat(theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)')\n }\n },\n\n /* Styles applied to the children if `variant=\"text\"` and `color=\"primary\"`. */\n groupedTextPrimary: {\n '&:not(:last-child)': {\n borderColor: alpha(theme.palette.primary.main, 0.5)\n }\n },\n\n /* Styles applied to the children if `variant=\"text\"` and `color=\"secondary\"`. */\n groupedTextSecondary: {\n '&:not(:last-child)': {\n borderColor: alpha(theme.palette.secondary.main, 0.5)\n }\n },\n\n /* Styles applied to the children if `variant=\"outlined\"`. */\n groupedOutlined: {},\n\n /* Styles applied to the children if `variant=\"outlined\"` and `orientation=\"horizontal\"`. */\n groupedOutlinedHorizontal: {\n '&:not(:first-child)': {\n marginLeft: -1\n },\n '&:not(:last-child)': {\n borderRightColor: 'transparent'\n }\n },\n\n /* Styles applied to the children if `variant=\"outlined\"` and `orientation=\"vertical\"`. */\n groupedOutlinedVertical: {\n '&:not(:first-child)': {\n marginTop: -1\n },\n '&:not(:last-child)': {\n borderBottomColor: 'transparent'\n }\n },\n\n /* Styles applied to the children if `variant=\"outlined\"` and `color=\"primary\"`. */\n groupedOutlinedPrimary: {\n '&:hover': {\n borderColor: theme.palette.primary.main\n }\n },\n\n /* Styles applied to the children if `variant=\"outlined\"` and `color=\"secondary\"`. */\n groupedOutlinedSecondary: {\n '&:hover': {\n borderColor: theme.palette.secondary.main\n }\n },\n\n /* Styles applied to the children if `variant=\"contained\"`. */\n groupedContained: {\n boxShadow: 'none'\n },\n\n /* Styles applied to the children if `variant=\"contained\"` and `orientation=\"horizontal\"`. */\n groupedContainedHorizontal: {\n '&:not(:last-child)': {\n borderRight: \"1px solid \".concat(theme.palette.grey[400]),\n '&$disabled': {\n borderRight: \"1px solid \".concat(theme.palette.action.disabled)\n }\n }\n },\n\n /* Styles applied to the children if `variant=\"contained\"` and `orientation=\"vertical\"`. */\n groupedContainedVertical: {\n '&:not(:last-child)': {\n borderBottom: \"1px solid \".concat(theme.palette.grey[400]),\n '&$disabled': {\n borderBottom: \"1px solid \".concat(theme.palette.action.disabled)\n }\n }\n },\n\n /* Styles applied to the children if `variant=\"contained\"` and `color=\"primary\"`. */\n groupedContainedPrimary: {\n '&:not(:last-child)': {\n borderColor: theme.palette.primary.dark\n }\n },\n\n /* Styles applied to the children if `variant=\"contained\"` and `color=\"secondary\"`. */\n groupedContainedSecondary: {\n '&:not(:last-child)': {\n borderColor: theme.palette.secondary.dark\n }\n }\n };\n};\nvar ButtonGroup = /*#__PURE__*/React.forwardRef(function ButtonGroup(props, ref) {\n var children = props.children,\n classes = props.classes,\n className = props.className,\n _props$color = props.color,\n color = _props$color === void 0 ? 'default' : _props$color,\n _props$component = props.component,\n Component = _props$component === void 0 ? 'div' : _props$component,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n _props$disableElevati = props.disableElevation,\n disableElevation = _props$disableElevati === void 0 ? false : _props$disableElevati,\n _props$disableFocusRi = props.disableFocusRipple,\n disableFocusRipple = _props$disableFocusRi === void 0 ? false : _props$disableFocusRi,\n _props$disableRipple = props.disableRipple,\n disableRipple = _props$disableRipple === void 0 ? false : _props$disableRipple,\n _props$fullWidth = props.fullWidth,\n fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth,\n _props$orientation = props.orientation,\n orientation = _props$orientation === void 0 ? 'horizontal' : _props$orientation,\n _props$size = props.size,\n size = _props$size === void 0 ? 'medium' : _props$size,\n _props$variant = props.variant,\n variant = _props$variant === void 0 ? 'outlined' : _props$variant,\n other = _objectWithoutProperties(props, [\"children\", \"classes\", \"className\", \"color\", \"component\", \"disabled\", \"disableElevation\", \"disableFocusRipple\", \"disableRipple\", \"fullWidth\", \"orientation\", \"size\", \"variant\"]);\n\n var buttonClassName = clsx(classes.grouped, classes[\"grouped\".concat(capitalize(orientation))], classes[\"grouped\".concat(capitalize(variant))], classes[\"grouped\".concat(capitalize(variant)).concat(capitalize(orientation))], classes[\"grouped\".concat(capitalize(variant)).concat(color !== 'default' ? capitalize(color) : '')], disabled && classes.disabled);\n return /*#__PURE__*/React.createElement(Component, _extends({\n role: \"group\",\n className: clsx(classes.root, className, fullWidth && classes.fullWidth, disableElevation && classes.disableElevation, variant === 'contained' && classes.contained, orientation === 'vertical' && classes.vertical),\n ref: ref\n }, other), React.Children.map(children, function (child) {\n if (! /*#__PURE__*/React.isValidElement(child)) {\n return null;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (isFragment(child)) {\n console.error([\"Material-UI: The ButtonGroup component doesn't accept a Fragment as a child.\", 'Consider providing an array instead.'].join('\\n'));\n }\n }\n\n return /*#__PURE__*/React.cloneElement(child, {\n className: clsx(buttonClassName, child.props.className),\n color: child.props.color || color,\n disabled: child.props.disabled || disabled,\n disableElevation: child.props.disableElevation || disableElevation,\n disableFocusRipple: disableFocusRipple,\n disableRipple: disableRipple,\n fullWidth: fullWidth,\n size: child.props.size || size,\n variant: child.props.variant || variant\n });\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? ButtonGroup.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The content of the button group.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n */\n color: PropTypes.oneOf(['default', 'inherit', 'primary', 'secondary']),\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes\n /* @typescript-to-proptypes-ignore */\n .elementType,\n\n /**\n * If `true`, the buttons will be disabled.\n */\n disabled: PropTypes.bool,\n\n /**\n * If `true`, no elevation is used.\n */\n disableElevation: PropTypes.bool,\n\n /**\n * If `true`, the button keyboard focus ripple will be disabled.\n */\n disableFocusRipple: PropTypes.bool,\n\n /**\n * If `true`, the button ripple effect will be disabled.\n */\n disableRipple: PropTypes.bool,\n\n /**\n * If `true`, the buttons will take up the full width of its container.\n */\n fullWidth: PropTypes.bool,\n\n /**\n * The group orientation (layout flow direction).\n */\n orientation: PropTypes.oneOf(['horizontal', 'vertical']),\n\n /**\n * The size of the button.\n * `small` is equivalent to the dense button styling.\n */\n size: PropTypes.oneOf(['large', 'medium', 'small']),\n\n /**\n * The variant to use.\n */\n variant: PropTypes.oneOf(['contained', 'outlined', 'text'])\n} : void 0;\nexport default withStyles(styles, {\n name: 'MuiButtonGroup'\n})(ButtonGroup);","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction styleInject(css, id) {\n let {\n insertAt\n } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (!css) return;\n if (typeof document === 'undefined') {\n globalThis.ssrCss = globalThis.ssrCss || [];\n globalThis.ssrCss.push({\n css,\n id\n });\n return;\n }\n if (document.getElementById(id)) return;\n const head = document.head || document.getElementsByTagName('head')[0];\n const style = document.createElement('style');\n style.id = id;\n if (insertAt === 'top' && head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n style.appendChild(document.createTextNode(css));\n}\n\nexports[\"default\"] = styleInject;\n","/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\nmodule.exports = asciiToArray;\n","'use strict'\n\nlet { nanoid } = require('nanoid/non-secure')\nlet { isAbsolute, resolve } = require('path')\nlet { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')\nlet { fileURLToPath, pathToFileURL } = require('url')\n\nlet CssSyntaxError = require('./css-syntax-error')\nlet PreviousMap = require('./previous-map')\nlet terminalHighlight = require('./terminal-highlight')\n\nlet fromOffsetCache = Symbol('fromOffsetCache')\n\nlet sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator)\nlet pathAvailable = Boolean(resolve && isAbsolute)\n\nclass Input {\n get from() {\n return this.file || this.id\n }\n\n constructor(css, opts = {}) {\n if (\n css === null ||\n typeof css === 'undefined' ||\n (typeof css === 'object' && !css.toString)\n ) {\n throw new Error(`PostCSS received ${css} instead of CSS string`)\n }\n\n this.css = css.toString()\n\n if (this.css[0] === '\\uFEFF' || this.css[0] === '\\uFFFE') {\n this.hasBOM = true\n this.css = this.css.slice(1)\n } else {\n this.hasBOM = false\n }\n\n this.document = this.css\n if (opts.document) this.document = opts.document.toString()\n\n if (opts.from) {\n if (\n !pathAvailable ||\n /^\\w+:\\/\\//.test(opts.from) ||\n isAbsolute(opts.from)\n ) {\n this.file = opts.from\n } else {\n this.file = resolve(opts.from)\n }\n }\n\n if (pathAvailable && sourceMapAvailable) {\n let map = new PreviousMap(this.css, opts)\n if (map.text) {\n this.map = map\n let file = map.consumer().file\n if (!this.file && file) this.file = this.mapResolve(file)\n }\n }\n\n if (!this.file) {\n this.id = ''\n }\n if (this.map) this.map.file = this.from\n }\n\n error(message, line, column, opts = {}) {\n let endColumn, endLine, result\n\n if (line && typeof line === 'object') {\n let start = line\n let end = column\n if (typeof start.offset === 'number') {\n let pos = this.fromOffset(start.offset)\n line = pos.line\n column = pos.col\n } else {\n line = start.line\n column = start.column\n }\n if (typeof end.offset === 'number') {\n let pos = this.fromOffset(end.offset)\n endLine = pos.line\n endColumn = pos.col\n } else {\n endLine = end.line\n endColumn = end.column\n }\n } else if (!column) {\n let pos = this.fromOffset(line)\n line = pos.line\n column = pos.col\n }\n\n let origin = this.origin(line, column, endLine, endColumn)\n if (origin) {\n result = new CssSyntaxError(\n message,\n origin.endLine === undefined\n ? origin.line\n : { column: origin.column, line: origin.line },\n origin.endLine === undefined\n ? origin.column\n : { column: origin.endColumn, line: origin.endLine },\n origin.source,\n origin.file,\n opts.plugin\n )\n } else {\n result = new CssSyntaxError(\n message,\n endLine === undefined ? line : { column, line },\n endLine === undefined ? column : { column: endColumn, line: endLine },\n this.css,\n this.file,\n opts.plugin\n )\n }\n\n result.input = { column, endColumn, endLine, line, source: this.css }\n if (this.file) {\n if (pathToFileURL) {\n result.input.url = pathToFileURL(this.file).toString()\n }\n result.input.file = this.file\n }\n\n return result\n }\n\n fromOffset(offset) {\n let lastLine, lineToIndex\n if (!this[fromOffsetCache]) {\n let lines = this.css.split('\\n')\n lineToIndex = new Array(lines.length)\n let prevIndex = 0\n\n for (let i = 0, l = lines.length; i < l; i++) {\n lineToIndex[i] = prevIndex\n prevIndex += lines[i].length + 1\n }\n\n this[fromOffsetCache] = lineToIndex\n } else {\n lineToIndex = this[fromOffsetCache]\n }\n lastLine = lineToIndex[lineToIndex.length - 1]\n\n let min = 0\n if (offset >= lastLine) {\n min = lineToIndex.length - 1\n } else {\n let max = lineToIndex.length - 2\n let mid\n while (min < max) {\n mid = min + ((max - min) >> 1)\n if (offset < lineToIndex[mid]) {\n max = mid - 1\n } else if (offset >= lineToIndex[mid + 1]) {\n min = mid + 1\n } else {\n min = mid\n break\n }\n }\n }\n return {\n col: offset - lineToIndex[min] + 1,\n line: min + 1\n }\n }\n\n mapResolve(file) {\n if (/^\\w+:\\/\\//.test(file)) {\n return file\n }\n return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file)\n }\n\n origin(line, column, endLine, endColumn) {\n if (!this.map) return false\n let consumer = this.map.consumer()\n\n let from = consumer.originalPositionFor({ column, line })\n if (!from.source) return false\n\n let to\n if (typeof endLine === 'number') {\n to = consumer.originalPositionFor({ column: endColumn, line: endLine })\n }\n\n let fromUrl\n\n if (isAbsolute(from.source)) {\n fromUrl = pathToFileURL(from.source)\n } else {\n fromUrl = new URL(\n from.source,\n this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile)\n )\n }\n\n let result = {\n column: from.column,\n endColumn: to && to.column,\n endLine: to && to.line,\n line: from.line,\n url: fromUrl.toString()\n }\n\n if (fromUrl.protocol === 'file:') {\n if (fileURLToPath) {\n result.file = fileURLToPath(fromUrl)\n } else {\n /* c8 ignore next 2 */\n throw new Error(`file: protocol is not available in this PostCSS build`)\n }\n }\n\n let source = consumer.sourceContentFor(from.source)\n if (source) result.source = source\n\n return result\n }\n\n toJSON() {\n let json = {}\n for (let name of ['hasBOM', 'css', 'file', 'id']) {\n if (this[name] != null) {\n json[name] = this[name]\n }\n }\n if (this.map) {\n json.map = { ...this.map }\n if (json.map.consumerCache) {\n json.map.consumerCache = undefined\n }\n }\n return json\n }\n}\n\nmodule.exports = Input\nInput.default = Input\n\nif (terminalHighlight && terminalHighlight.registerInput) {\n terminalHighlight.registerInput(Input)\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar _extends = require('@babel/runtime/helpers/extends');\nvar React = require('react');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);\nvar React__default = /*#__PURE__*/_interopDefaultLegacy(React);\n\nconst A11yDiv = _ref => {\n let {\n style = {},\n onClick,\n ...attrs\n } = _ref;\n if (!onClick) return /*#__PURE__*/React__default[\"default\"].createElement(\"div\", _extends__default[\"default\"]({\n style: style\n }, attrs));\n const handleKeyDown = event => {\n const keyCode = event.nativeEvent.code;\n if (keyCode === 'Enter' || keyCode === 'Space') {\n onClick(event);\n }\n };\n return /*#__PURE__*/React__default[\"default\"].createElement(\"div\", _extends__default[\"default\"]({\n role: \"button\",\n onClick: onClick,\n onKeyDown: handleKeyDown,\n tabIndex: 0\n }, attrs, {\n style: {\n cursor: 'pointer',\n ...style\n }\n }));\n};\n\nexports[\"default\"] = A11yDiv;\n","//.CommonJS\nvar CSSOM = {};\n///CommonJS\n\n\n/**\n * @constructor\n * @see http://dev.w3.org/csswg/cssom/#the-stylesheet-interface\n */\nCSSOM.StyleSheet = function StyleSheet() {\n\tthis.parentStyleSheet = null;\n};\n\n\n//.CommonJS\nexports.StyleSheet = CSSOM.StyleSheet;\n///CommonJS\n","'use strict'\n\nlet Container = require('./container')\nlet list = require('./list')\n\nclass Rule extends Container {\n get selectors() {\n return list.comma(this.selector)\n }\n\n set selectors(values) {\n let match = this.selector ? this.selector.match(/,\\s*/) : null\n let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen')\n this.selector = values.join(sep)\n }\n\n constructor(defaults) {\n super(defaults)\n this.type = 'rule'\n if (!this.nodes) this.nodes = []\n }\n}\n\nmodule.exports = Rule\nRule.default = Rule\n\nContainer.registerRule(Rule)\n","import { __awaiter, __extends, __generator } from \"tslib\";\nimport { ApolloLink } from \"../core/index.js\";\nimport { Observable } from \"../../utilities/index.js\";\nimport { buildDelayFunction } from \"./delayFunction.js\";\nimport { buildRetryFunction } from \"./retryFunction.js\";\nimport { ApolloError, graphQLResultHasProtocolErrors, PROTOCOL_ERRORS_SYMBOL, } from \"../../errors/index.js\";\n/**\n * Tracking and management of operations that may be (or currently are) retried.\n */\nvar RetryableOperation = /** @class */ (function () {\n function RetryableOperation(observer, operation, forward, delayFor, retryIf) {\n var _this = this;\n this.observer = observer;\n this.operation = operation;\n this.forward = forward;\n this.delayFor = delayFor;\n this.retryIf = retryIf;\n this.retryCount = 0;\n this.currentSubscription = null;\n this.onError = function (error) { return __awaiter(_this, void 0, void 0, function () {\n var shouldRetry;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n this.retryCount += 1;\n return [4 /*yield*/, this.retryIf(this.retryCount, this.operation, error)];\n case 1:\n shouldRetry = _a.sent();\n if (shouldRetry) {\n this.scheduleRetry(this.delayFor(this.retryCount, this.operation, error));\n return [2 /*return*/];\n }\n this.observer.error(error);\n return [2 /*return*/];\n }\n });\n }); };\n this.try();\n }\n /**\n * Stop retrying for the operation, and cancel any in-progress requests.\n */\n RetryableOperation.prototype.cancel = function () {\n if (this.currentSubscription) {\n this.currentSubscription.unsubscribe();\n }\n clearTimeout(this.timerId);\n this.timerId = undefined;\n this.currentSubscription = null;\n };\n RetryableOperation.prototype.try = function () {\n var _this = this;\n this.currentSubscription = this.forward(this.operation).subscribe({\n next: function (result) {\n var _a;\n if (graphQLResultHasProtocolErrors(result)) {\n _this.onError(new ApolloError({\n protocolErrors: result.extensions[PROTOCOL_ERRORS_SYMBOL],\n }));\n // Unsubscribe from the current subscription to prevent the `complete`\n // handler to be called as a result of the stream closing.\n (_a = _this.currentSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n return;\n }\n _this.observer.next(result);\n },\n error: this.onError,\n complete: this.observer.complete.bind(this.observer),\n });\n };\n RetryableOperation.prototype.scheduleRetry = function (delay) {\n var _this = this;\n if (this.timerId) {\n throw new Error(\"RetryLink BUG! Encountered overlapping retries\");\n }\n this.timerId = setTimeout(function () {\n _this.timerId = undefined;\n _this.try();\n }, delay);\n };\n return RetryableOperation;\n}());\nvar RetryLink = /** @class */ (function (_super) {\n __extends(RetryLink, _super);\n function RetryLink(options) {\n var _this = _super.call(this) || this;\n var _a = options || {}, attempts = _a.attempts, delay = _a.delay;\n _this.delayFor =\n typeof delay === \"function\" ? delay : buildDelayFunction(delay);\n _this.retryIf =\n typeof attempts === \"function\" ? attempts : buildRetryFunction(attempts);\n return _this;\n }\n RetryLink.prototype.request = function (operation, nextLink) {\n var _this = this;\n return new Observable(function (observer) {\n var retryable = new RetryableOperation(observer, operation, nextLink, _this.delayFor, _this.retryIf);\n return function () {\n retryable.cancel();\n };\n });\n };\n return RetryLink;\n}(ApolloLink));\nexport { RetryLink };\n//# sourceMappingURL=retryLink.js.map","export function buildDelayFunction(delayOptions) {\n var _a = delayOptions || {}, _b = _a.initial, initial = _b === void 0 ? 300 : _b, _c = _a.jitter, jitter = _c === void 0 ? true : _c, _d = _a.max, max = _d === void 0 ? Infinity : _d;\n // If we're jittering, baseDelay is half of the maximum delay for that\n // attempt (and is, on average, the delay we will encounter).\n // If we're not jittering, adjust baseDelay so that the first attempt\n // lines up with initialDelay, for everyone's sanity.\n var baseDelay = jitter ? initial : initial / 2;\n return function delayFunction(count) {\n var delay = Math.min(max, baseDelay * Math.pow(2, count));\n if (jitter) {\n // We opt for a full jitter approach for a mostly uniform distribution,\n // but bound it within initialDelay and delay for everyone's sanity.\n delay = Math.random() * delay;\n }\n return delay;\n };\n}\n//# sourceMappingURL=delayFunction.js.map","export function buildRetryFunction(retryOptions) {\n var _a = retryOptions || {}, retryIf = _a.retryIf, _b = _a.max, max = _b === void 0 ? 5 : _b;\n return function retryFunction(count, operation, error) {\n if (count >= max)\n return false;\n return retryIf ? retryIf(error, operation) : !!error;\n };\n}\n//# sourceMappingURL=retryFunction.js.map","'use strict';\n\n// Store setTimeout reference so promise-polyfill will be unaffected by\n// other code modifying setTimeout (like sinon.useFakeTimers())\nvar setTimeoutFunc = setTimeout;\n\nfunction noop() {}\n\n// Polyfill for Function.prototype.bind\nfunction bind(fn, thisArg) {\n return function() {\n fn.apply(thisArg, arguments);\n };\n}\n\nfunction Promise(fn) {\n if (!(this instanceof Promise))\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n this._state = 0;\n this._handled = false;\n this._value = undefined;\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = function(callback) {\n var constructor = this.constructor;\n return this.then(\n function(value) {\n return constructor.resolve(callback()).then(function() {\n return value;\n });\n },\n function(reason) {\n return constructor.resolve(callback()).then(function() {\n return constructor.reject(reason);\n });\n }\n );\n};\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!arr || typeof arr.length === 'undefined')\n throw new TypeError('Promise.all accepts an array');\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(values) {\n return new Promise(function(resolve, reject) {\n for (var i = 0, len = values.length; i < len; i++) {\n values[i].then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n (typeof setImmediate === 'function' &&\n function(fn) {\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nmodule.exports = Promise;\n","var baseKeys = require('./_baseKeys'),\n getTag = require('./_getTag'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLike = require('./isArrayLike'),\n isBuffer = require('./isBuffer'),\n isPrototype = require('./_isPrototype'),\n isTypedArray = require('./isTypedArray');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = isEmpty;\n","var convert = require('./convert'),\n func = convert('head', require('../head'), require('./_falseOptions'));\n\nfunc.placeholder = require('./placeholder');\nmodule.exports = func;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar React = require('react');\nvar Skeleton_module = require('./Skeleton.module.css.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar React__default = /*#__PURE__*/_interopDefaultLegacy(React);\n\nconst PudoCardSkeleton = () => /*#__PURE__*/React__default[\"default\"].createElement(\"div\", {\n className: Skeleton_module[\"default\"].cardContainerPudo\n}, /*#__PURE__*/React__default[\"default\"].createElement(\"div\", {\n className: Skeleton_module[\"default\"].cardPhoto\n}), /*#__PURE__*/React__default[\"default\"].createElement(\"div\", {\n className: Skeleton_module[\"default\"].cardTitle\n}), /*#__PURE__*/React__default[\"default\"].createElement(\"div\", {\n className: Skeleton_module[\"default\"].cardDescription\n}), /*#__PURE__*/React__default[\"default\"].createElement(\"div\", {\n className: Skeleton_module[\"default\"].cardFee\n}));\n\nexports.PudoCardSkeleton = PudoCardSkeleton;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar CSSOM = require('cssom');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar CSSOM__default = /*#__PURE__*/_interopDefaultLegacy(CSSOM);\n\nconst allowedCSSSelectors = ['.narvar', '#narvar'];\nconst filterCSSStyleRule = cssText => {\n const {\n selectorText = '',\n style\n } = CSSOM__default[\"default\"].CSSStyleRule.parse(cssText);\n const allowed = allowedCSSSelectors.some(allowedCSSSelector => selectorText.indexOf(allowedCSSSelector) === 0);\n return allowed ? `${selectorText} { ${style.cssText} } ` : '';\n};\n\n// Only keep CSS classes that start with one of the allowed css selectors\n// to prevent global selectors from being passed\nvar filterCSSStyles = (style => {\n const {\n cssRules\n } = CSSOM__default[\"default\"].parse(style);\n return cssRules.map(cssRule => {\n if (cssRule.type === CSSOM__default[\"default\"].CSSRule.MEDIA_RULE) {\n const {\n cssRules: cssMediaRules = [],\n media\n } = cssRule;\n const filteredMediaStyle = cssMediaRules.map(cssMediaQueryRule => filterCSSStyleRule(cssMediaQueryRule.cssText)).join(' ');\n return filteredMediaStyle ? `@media ${media.mediaText} { ${filteredMediaStyle} } ` : '';\n }\n return filterCSSStyleRule(cssRule.cssText);\n }).join(' ');\n});\n\nexports[\"default\"] = filterCSSStyles;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.StickyBucketService = exports.RedisStickyBucketService = exports.LocalStorageStickyBucketService = exports.ExpressCookieStickyBucketService = exports.BrowserCookieStickyBucketService = void 0;\n/**\n * Responsible for reading and writing documents which describe sticky bucket assignments.\n */\nclass StickyBucketService {\n /**\n * The SDK calls getAllAssignments to populate sticky buckets. This in turn will\n * typically loop through individual getAssignments calls. However, some StickyBucketService\n * instances (i.e. Redis) will instead perform a multi-query inside getAllAssignments instead.\n */\n async getAllAssignments(attributes) {\n const docs = {};\n (await Promise.all(Object.entries(attributes).map(_ref => {\n let [attributeName, attributeValue] = _ref;\n return this.getAssignments(attributeName, attributeValue);\n }))).forEach(doc => {\n if (doc) {\n const key = \"\".concat(doc.attributeName, \"||\").concat(doc.attributeValue);\n docs[key] = doc;\n }\n });\n return docs;\n }\n}\nexports.StickyBucketService = StickyBucketService;\nclass LocalStorageStickyBucketService extends StickyBucketService {\n constructor(opts) {\n opts = opts || {};\n super();\n this.prefix = opts.prefix || \"gbStickyBuckets__\";\n try {\n this.localStorage = opts.localStorage || globalThis.localStorage;\n } catch (e) {\n // Ignore localStorage errors\n }\n }\n async getAssignments(attributeName, attributeValue) {\n const key = \"\".concat(attributeName, \"||\").concat(attributeValue);\n let doc = null;\n if (!this.localStorage) return doc;\n try {\n const raw = (await this.localStorage.getItem(this.prefix + key)) || \"{}\";\n const data = JSON.parse(raw);\n if (data.attributeName && data.attributeValue && data.assignments) {\n doc = data;\n }\n } catch (e) {\n // Ignore localStorage errors\n }\n return doc;\n }\n async saveAssignments(doc) {\n const key = \"\".concat(doc.attributeName, \"||\").concat(doc.attributeValue);\n if (!this.localStorage) return;\n try {\n await this.localStorage.setItem(this.prefix + key, JSON.stringify(doc));\n } catch (e) {\n // Ignore localStorage errors\n }\n }\n}\nexports.LocalStorageStickyBucketService = LocalStorageStickyBucketService;\nclass ExpressCookieStickyBucketService extends StickyBucketService {\n /**\n * Intended to be used with cookieParser() middleware from npm: 'cookie-parser'.\n * Assumes:\n * - reading a cookie is automatically decoded via decodeURIComponent() or similar\n * - writing a cookie name & value must be manually encoded via encodeURIComponent() or similar\n * - all cookie bodies are JSON encoded strings and are manually encoded/decoded\n */\n\n constructor(_ref2) {\n let {\n prefix = \"gbStickyBuckets__\",\n req,\n res,\n cookieAttributes = {}\n } = _ref2;\n super();\n this.prefix = prefix;\n this.req = req;\n this.res = res;\n this.cookieAttributes = cookieAttributes;\n }\n async getAssignments(attributeName, attributeValue) {\n const key = \"\".concat(attributeName, \"||\").concat(attributeValue);\n let doc = null;\n if (!this.req) return doc;\n try {\n const raw = this.req.cookies[this.prefix + key] || \"{}\";\n const data = JSON.parse(raw);\n if (data.attributeName && data.attributeValue && data.assignments) {\n doc = data;\n }\n } catch (e) {\n // Ignore cookie errors\n }\n return doc;\n }\n async saveAssignments(doc) {\n const key = \"\".concat(doc.attributeName, \"||\").concat(doc.attributeValue);\n if (!this.res) return;\n const str = JSON.stringify(doc);\n this.res.cookie(encodeURIComponent(this.prefix + key), encodeURIComponent(str), this.cookieAttributes);\n }\n}\nexports.ExpressCookieStickyBucketService = ExpressCookieStickyBucketService;\nclass BrowserCookieStickyBucketService extends StickyBucketService {\n /**\n * Intended to be used with npm: 'js-cookie'.\n * Assumes:\n * - reading a cookie is automatically decoded via decodeURIComponent() or similar\n * - writing a cookie name & value is automatically encoded via encodeURIComponent() or similar\n * - all cookie bodies are JSON encoded strings and are manually encoded/decoded\n */\n\n constructor(_ref3) {\n let {\n prefix = \"gbStickyBuckets__\",\n jsCookie,\n cookieAttributes = {}\n } = _ref3;\n super();\n this.prefix = prefix;\n this.jsCookie = jsCookie;\n this.cookieAttributes = cookieAttributes;\n }\n async getAssignments(attributeName, attributeValue) {\n const key = \"\".concat(attributeName, \"||\").concat(attributeValue);\n let doc = null;\n if (!this.jsCookie) return doc;\n try {\n const raw = this.jsCookie.get(this.prefix + key);\n const data = JSON.parse(raw || \"{}\");\n if (data.attributeName && data.attributeValue && data.assignments) {\n doc = data;\n }\n } catch (e) {\n // Ignore cookie errors\n }\n return doc;\n }\n async saveAssignments(doc) {\n const key = \"\".concat(doc.attributeName, \"||\").concat(doc.attributeValue);\n if (!this.jsCookie) return;\n const str = JSON.stringify(doc);\n this.jsCookie.set(this.prefix + key, str, this.cookieAttributes);\n }\n}\nexports.BrowserCookieStickyBucketService = BrowserCookieStickyBucketService;\nclass RedisStickyBucketService extends StickyBucketService {\n /** Intended to be used with npm: 'ioredis'. **/\n\n constructor(_ref4) {\n let {\n redis\n } = _ref4;\n super();\n this.redis = redis;\n }\n async getAllAssignments(attributes) {\n const docs = {};\n const keys = Object.entries(attributes).map(_ref5 => {\n let [attributeName, attributeValue] = _ref5;\n return \"\".concat(attributeName, \"||\").concat(attributeValue);\n });\n if (!this.redis) return docs;\n this.redis.mget(...keys).then(values => {\n values.forEach(raw => {\n try {\n const data = JSON.parse(raw || \"{}\");\n if (data.attributeName && data.attributeValue && data.assignments) {\n const key = \"\".concat(data.attributeName, \"||\").concat(data.attributeValue);\n docs[key] = data;\n }\n } catch (e) {\n // ignore redis doc parse errors\n }\n });\n });\n return docs;\n }\n async getAssignments(_attributeName, _attributeValue) {\n // not implemented\n return null;\n }\n async saveAssignments(doc) {\n const key = \"\".concat(doc.attributeName, \"||\").concat(doc.attributeValue);\n if (!this.redis) return;\n await this.redis.set(key, JSON.stringify(doc));\n }\n}\nexports.RedisStickyBucketService = RedisStickyBucketService;\n//# sourceMappingURL=sticky-bucket-service.js.map","'use strict'\n\nlet Container = require('./container')\n\nlet LazyResult, Processor\n\nclass Document extends Container {\n constructor(defaults) {\n // type needs to be passed to super, otherwise child roots won't be normalized correctly\n super({ type: 'document', ...defaults })\n\n if (!this.nodes) {\n this.nodes = []\n }\n }\n\n toResult(opts = {}) {\n let lazy = new LazyResult(new Processor(), this, opts)\n\n return lazy.stringify()\n }\n}\n\nDocument.registerLazyResult = dependant => {\n LazyResult = dependant\n}\n\nDocument.registerProcessor = dependant => {\n Processor = dependant\n}\n\nmodule.exports = Document\nDocument.default = Document\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nlet Devices = /*#__PURE__*/function (Devices) {\n Devices[\"MOBILE\"] = \"Mobile\";\n Devices[\"DESKTOP\"] = \"Desktop\";\n return Devices;\n}({});\nlet TreeNodeTypes = /*#__PURE__*/function (TreeNodeTypes) {\n TreeNodeTypes[\"VIEW\"] = \"View\";\n TreeNodeTypes[\"ROW\"] = \"Row\";\n TreeNodeTypes[\"COL\"] = \"Col\";\n TreeNodeTypes[\"FEATURE\"] = \"Feature\";\n return TreeNodeTypes;\n}({});\nlet FeatureLayout = /*#__PURE__*/function (FeatureLayout) {\n FeatureLayout[\"PORTRAIT\"] = \"PORTRAIT\";\n FeatureLayout[\"LANDSCAPE\"] = \"LANDSCAPE\";\n return FeatureLayout;\n}({});\nlet ConditionType = /*#__PURE__*/function (ConditionType) {\n ConditionType[\"SHIPMENT_STATUS\"] = \"SHIPMENT_STATUS\";\n ConditionType[\"SUB_STATUS\"] = \"SUB_STATUS\";\n ConditionType[\"CARRIER_MONIKER\"] = \"CARRIER_MONIKER\";\n ConditionType[\"CATEGORY\"] = \"CATEGORY\";\n return ConditionType;\n}({});\nlet ConditionOperator = /*#__PURE__*/function (ConditionOperator) {\n ConditionOperator[\"EQ\"] = \"EQ\";\n ConditionOperator[\"NEQ\"] = \"NEQ\";\n ConditionOperator[\"IN\"] = \"IN\";\n return ConditionOperator;\n}({});\nlet ShipmentStatusConditionStatus = /*#__PURE__*/function (ShipmentStatusConditionStatus) {\n ShipmentStatusConditionStatus[\"JUSTSHIPPED\"] = \"JUSTSHIPPED\";\n ShipmentStatusConditionStatus[\"INTRANSIT\"] = \"INTRANSIT\";\n ShipmentStatusConditionStatus[\"DELIVERED\"] = \"DELIVERED\";\n ShipmentStatusConditionStatus[\"EXCEPTION\"] = \"EXCEPTION\";\n ShipmentStatusConditionStatus[\"PROCESSING\"] = \"PROCESSING\";\n ShipmentStatusConditionStatus[\"PRESHIPMENT0\"] = \"PRESHIPMENT0\";\n ShipmentStatusConditionStatus[\"PRESHIPMENT1\"] = \"PRESHIPMENT1\";\n ShipmentStatusConditionStatus[\"PRESHIPMENT2\"] = \"PRESHIPMENT2\";\n ShipmentStatusConditionStatus[\"PRESHIPMENT3\"] = \"PRESHIPMENT3\";\n ShipmentStatusConditionStatus[\"PRESHIPMENT4\"] = \"PRESHIPMENT4\";\n ShipmentStatusConditionStatus[\"PRESHIPMENT5\"] = \"PRESHIPMENT5\";\n ShipmentStatusConditionStatus[\"PRESHIPMENT6\"] = \"PRESHIPMENT6\";\n ShipmentStatusConditionStatus[\"PRESHIPMENT7\"] = \"PRESHIPMENT7\";\n ShipmentStatusConditionStatus[\"PRESHIPMENT8\"] = \"PRESHIPMENT8\";\n ShipmentStatusConditionStatus[\"PRESHIPMENT9\"] = \"PRESHIPMENT9\";\n ShipmentStatusConditionStatus[\"BOPISPROCESSING\"] = \"BOPISPROCESSING\";\n ShipmentStatusConditionStatus[\"BOPISDELAYED\"] = \"BOPISDELAYED\";\n ShipmentStatusConditionStatus[\"BOPISREADYFORPICKUP\"] = \"BOPISREADYFORPICKUP\";\n ShipmentStatusConditionStatus[\"BOPISPICKEDUP\"] = \"BOPISPICKEDUP\";\n ShipmentStatusConditionStatus[\"BOPISCANCELLED\"] = \"BOPISCANCELED\";\n ShipmentStatusConditionStatus[\"LDORDERPLACED\"] = \"LDORDERPLACED\";\n ShipmentStatusConditionStatus[\"LDPICKUPINPROGRESS\"] = \"LDPICKUPINPROGRESS\";\n ShipmentStatusConditionStatus[\"LDONITSWAY\"] = \"LDONITSWAY\";\n ShipmentStatusConditionStatus[\"LDDELIVERED\"] = \"LDDELIVERED\";\n ShipmentStatusConditionStatus[\"LDEXCEPTION\"] = \"LDEXCEPTION\";\n ShipmentStatusConditionStatus[\"HPUSCHEDULED\"] = \"HPUSCHEDULED\";\n ShipmentStatusConditionStatus[\"HPUPICKUPINPROGRESS\"] = \"HPUPICKUPINPROGRESS\";\n ShipmentStatusConditionStatus[\"HPUPICKEDUP\"] = \"HPUPICKEDUP\";\n ShipmentStatusConditionStatus[\"HPUEXCEPTION\"] = \"HPUEXCEPTION\";\n return ShipmentStatusConditionStatus;\n}({});\nlet ShipmentSubStatusConditionStatus = /*#__PURE__*/function (ShipmentSubStatusConditionStatus) {\n ShipmentSubStatusConditionStatus[\"SHPD\"] = \"SHPD\";\n ShipmentSubStatusConditionStatus[\"INTR\"] = \"INTR\";\n ShipmentSubStatusConditionStatus[\"OFDL\"] = \"OFDL\";\n ShipmentSubStatusConditionStatus[\"DLVD\"] = \"DLVD\";\n ShipmentSubStatusConditionStatus[\"DLPP\"] = \"DLPP\";\n ShipmentSubStatusConditionStatus[\"PUBC\"] = \"PUBC\";\n ShipmentSubStatusConditionStatus[\"ITTS\"] = \"ITTS\";\n ShipmentSubStatusConditionStatus[\"ITPP\"] = \"ITPP\";\n ShipmentSubStatusConditionStatus[\"DLTS\"] = \"DLTS\";\n ShipmentSubStatusConditionStatus[\"EXCP\"] = \"EXCP\";\n ShipmentSubStatusConditionStatus[\"UNDL\"] = \"UNDL\";\n ShipmentSubStatusConditionStatus[\"BOSS\"] = \"BOSS\";\n ShipmentSubStatusConditionStatus[\"BOPIS\"] = \"BOPIS\";\n ShipmentSubStatusConditionStatus[\"UNKN\"] = \"UNKN\";\n ShipmentSubStatusConditionStatus[\"SHPD_SDD_101\"] = \"SHPD_SDD_101\";\n ShipmentSubStatusConditionStatus[\"SHPD_SDD_201\"] = \"SHPD_SDD_201\";\n ShipmentSubStatusConditionStatus[\"SHPD_SDD_280\"] = \"SHPD_SDD_280\";\n ShipmentSubStatusConditionStatus[\"SHPD_SDD_281\"] = \"SHPD_SDD_281\";\n ShipmentSubStatusConditionStatus[\"INTR_SDD_311\"] = \"INTR_SDD_311\";\n ShipmentSubStatusConditionStatus[\"OFDL_SDD_400\"] = \"OFDL_SDD_400\";\n ShipmentSubStatusConditionStatus[\"OFDL_SDD_403\"] = \"OFDL_SDD_403\";\n ShipmentSubStatusConditionStatus[\"DLVD_SDD_500\"] = \"DLVD_SDD_500\";\n ShipmentSubStatusConditionStatus[\"UNDL_SDD_700\"] = \"UNDL_SDD_700\";\n ShipmentSubStatusConditionStatus[\"EXCP_SDD_800\"] = \"EXCP_SDD_800\";\n return ShipmentSubStatusConditionStatus;\n}({});\n\n// Default status for a track page. This is just a fail safe. Actual\n// setting of a \"default tracking status\" is done further upstream\nconst DEFAULT_NARVAR_STATUS = ShipmentStatusConditionStatus.JUSTSHIPPED;\nlet CarrierConditionMoniker = /*#__PURE__*/function (CarrierConditionMoniker) {\n CarrierConditionMoniker[\"UPS\"] = \"ups\";\n CarrierConditionMoniker[\"FEDEX\"] = \"fedex\";\n CarrierConditionMoniker[\"METRO\"] = \"metro\";\n CarrierConditionMoniker[\"PILOT\"] = \"pilot\";\n return CarrierConditionMoniker;\n}({});\nlet CategoryConditionCategory = /*#__PURE__*/function (CategoryConditionCategory) {\n CategoryConditionCategory[\"SHARING\"] = \"sharing\";\n return CategoryConditionCategory;\n}({});\n\nexports.CarrierConditionMoniker = CarrierConditionMoniker;\nexports.CategoryConditionCategory = CategoryConditionCategory;\nexports.ConditionOperator = ConditionOperator;\nexports.ConditionType = ConditionType;\nexports.DEFAULT_NARVAR_STATUS = DEFAULT_NARVAR_STATUS;\nexports.Devices = Devices;\nexports.FeatureLayout = FeatureLayout;\nexports.ShipmentStatusConditionStatus = ShipmentStatusConditionStatus;\nexports.ShipmentSubStatusConditionStatus = ShipmentSubStatusConditionStatus;\nexports.TreeNodeTypes = TreeNodeTypes;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar React = require('react');\nvar Skeleton_module = require('./Skeleton.module.css.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar React__default = /*#__PURE__*/_interopDefaultLegacy(React);\n\nconst ItemCardSkeleton = () => /*#__PURE__*/React__default[\"default\"].createElement(\"div\", {\n className: Skeleton_module[\"default\"].cardContainer\n}, /*#__PURE__*/React__default[\"default\"].createElement(\"div\", {\n className: Skeleton_module[\"default\"].photo\n}), /*#__PURE__*/React__default[\"default\"].createElement(\"div\", {\n className: Skeleton_module[\"default\"].textContainer\n}, /*#__PURE__*/React__default[\"default\"].createElement(\"div\", {\n className: Skeleton_module[\"default\"].title\n}), /*#__PURE__*/React__default[\"default\"].createElement(\"div\", {\n className: Skeleton_module[\"default\"].description\n}), /*#__PURE__*/React__default[\"default\"].createElement(\"div\", {\n className: Skeleton_module[\"default\"].description\n})));\n\nexports.ItemCardSkeleton = ItemCardSkeleton;\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\n\n/* eslint-disable no-constant-condition */\nimport * as React from 'react';\nimport { setRef, useEventCallback, useControlled, unstable_useId as useId } from '@material-ui/core/utils'; // https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript\n// Give up on IE 11 support for this feature\n\nfunction stripDiacritics(string) {\n return typeof string.normalize !== 'undefined' ? string.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '') : string;\n}\n\nexport function createFilterOptions() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _config$ignoreAccents = config.ignoreAccents,\n ignoreAccents = _config$ignoreAccents === void 0 ? true : _config$ignoreAccents,\n _config$ignoreCase = config.ignoreCase,\n ignoreCase = _config$ignoreCase === void 0 ? true : _config$ignoreCase,\n limit = config.limit,\n _config$matchFrom = config.matchFrom,\n matchFrom = _config$matchFrom === void 0 ? 'any' : _config$matchFrom,\n stringify = config.stringify,\n _config$trim = config.trim,\n trim = _config$trim === void 0 ? false : _config$trim;\n return function (options, _ref) {\n var inputValue = _ref.inputValue,\n getOptionLabel = _ref.getOptionLabel;\n var input = trim ? inputValue.trim() : inputValue;\n\n if (ignoreCase) {\n input = input.toLowerCase();\n }\n\n if (ignoreAccents) {\n input = stripDiacritics(input);\n }\n\n var filteredOptions = options.filter(function (option) {\n var candidate = (stringify || getOptionLabel)(option);\n\n if (ignoreCase) {\n candidate = candidate.toLowerCase();\n }\n\n if (ignoreAccents) {\n candidate = stripDiacritics(candidate);\n }\n\n return matchFrom === 'start' ? candidate.indexOf(input) === 0 : candidate.indexOf(input) > -1;\n });\n return typeof limit === 'number' ? filteredOptions.slice(0, limit) : filteredOptions;\n };\n} // To replace with .findIndex() once we stop IE 11 support.\n\nfunction findIndex(array, comp) {\n for (var i = 0; i < array.length; i += 1) {\n if (comp(array[i])) {\n return i;\n }\n }\n\n return -1;\n}\n\nvar defaultFilterOptions = createFilterOptions(); // Number of options to jump in list box when pageup and pagedown keys are used.\n\nvar pageSize = 5;\nexport default function useAutocomplete(props) {\n var _props$autoComplete = props.autoComplete,\n autoComplete = _props$autoComplete === void 0 ? false : _props$autoComplete,\n _props$autoHighlight = props.autoHighlight,\n autoHighlight = _props$autoHighlight === void 0 ? false : _props$autoHighlight,\n _props$autoSelect = props.autoSelect,\n autoSelect = _props$autoSelect === void 0 ? false : _props$autoSelect,\n _props$blurOnSelect = props.blurOnSelect,\n blurOnSelect = _props$blurOnSelect === void 0 ? false : _props$blurOnSelect,\n _props$clearOnBlur = props.clearOnBlur,\n clearOnBlur = _props$clearOnBlur === void 0 ? !props.freeSolo : _props$clearOnBlur,\n _props$clearOnEscape = props.clearOnEscape,\n clearOnEscape = _props$clearOnEscape === void 0 ? false : _props$clearOnEscape,\n _props$componentName = props.componentName,\n componentName = _props$componentName === void 0 ? 'useAutocomplete' : _props$componentName,\n _props$debug = props.debug,\n debug = _props$debug === void 0 ? false : _props$debug,\n _props$defaultValue = props.defaultValue,\n defaultValue = _props$defaultValue === void 0 ? props.multiple ? [] : null : _props$defaultValue,\n _props$disableClearab = props.disableClearable,\n disableClearable = _props$disableClearab === void 0 ? false : _props$disableClearab,\n _props$disableCloseOn = props.disableCloseOnSelect,\n disableCloseOnSelect = _props$disableCloseOn === void 0 ? false : _props$disableCloseOn,\n _props$disabledItemsF = props.disabledItemsFocusable,\n disabledItemsFocusable = _props$disabledItemsF === void 0 ? false : _props$disabledItemsF,\n _props$disableListWra = props.disableListWrap,\n disableListWrap = _props$disableListWra === void 0 ? false : _props$disableListWra,\n _props$filterOptions = props.filterOptions,\n filterOptions = _props$filterOptions === void 0 ? defaultFilterOptions : _props$filterOptions,\n _props$filterSelected = props.filterSelectedOptions,\n filterSelectedOptions = _props$filterSelected === void 0 ? false : _props$filterSelected,\n _props$freeSolo = props.freeSolo,\n freeSolo = _props$freeSolo === void 0 ? false : _props$freeSolo,\n getOptionDisabled = props.getOptionDisabled,\n _props$getOptionLabel = props.getOptionLabel,\n getOptionLabelProp = _props$getOptionLabel === void 0 ? function (option) {\n return option;\n } : _props$getOptionLabel,\n _props$getOptionSelec = props.getOptionSelected,\n getOptionSelected = _props$getOptionSelec === void 0 ? function (option, value) {\n return option === value;\n } : _props$getOptionSelec,\n groupBy = props.groupBy,\n _props$handleHomeEndK = props.handleHomeEndKeys,\n handleHomeEndKeys = _props$handleHomeEndK === void 0 ? !props.freeSolo : _props$handleHomeEndK,\n idProp = props.id,\n _props$includeInputIn = props.includeInputInList,\n includeInputInList = _props$includeInputIn === void 0 ? false : _props$includeInputIn,\n inputValueProp = props.inputValue,\n _props$multiple = props.multiple,\n multiple = _props$multiple === void 0 ? false : _props$multiple,\n onChange = props.onChange,\n onClose = props.onClose,\n onHighlightChange = props.onHighlightChange,\n onInputChange = props.onInputChange,\n onOpen = props.onOpen,\n openProp = props.open,\n _props$openOnFocus = props.openOnFocus,\n openOnFocus = _props$openOnFocus === void 0 ? false : _props$openOnFocus,\n options = props.options,\n _props$selectOnFocus = props.selectOnFocus,\n selectOnFocus = _props$selectOnFocus === void 0 ? !props.freeSolo : _props$selectOnFocus,\n valueProp = props.value;\n var id = useId(idProp);\n var getOptionLabel = getOptionLabelProp;\n\n if (process.env.NODE_ENV !== 'production') {\n getOptionLabel = function getOptionLabel(option) {\n var optionLabel = getOptionLabelProp(option);\n\n if (typeof optionLabel !== 'string') {\n var erroneousReturn = optionLabel === undefined ? 'undefined' : \"\".concat(_typeof(optionLabel), \" (\").concat(optionLabel, \")\");\n console.error(\"Material-UI: The `getOptionLabel` method of \".concat(componentName, \" returned \").concat(erroneousReturn, \" instead of a string for \").concat(JSON.stringify(option), \".\"));\n }\n\n return optionLabel;\n };\n }\n\n var ignoreFocus = React.useRef(false);\n var firstFocus = React.useRef(true);\n var inputRef = React.useRef(null);\n var listboxRef = React.useRef(null);\n\n var _React$useState = React.useState(null),\n anchorEl = _React$useState[0],\n setAnchorEl = _React$useState[1];\n\n var _React$useState2 = React.useState(-1),\n focusedTag = _React$useState2[0],\n setFocusedTag = _React$useState2[1];\n\n var defaultHighlighted = autoHighlight ? 0 : -1;\n var highlightedIndexRef = React.useRef(defaultHighlighted);\n\n var _useControlled = useControlled({\n controlled: valueProp,\n default: defaultValue,\n name: componentName\n }),\n _useControlled2 = _slicedToArray(_useControlled, 2),\n value = _useControlled2[0],\n setValue = _useControlled2[1];\n\n var _useControlled3 = useControlled({\n controlled: inputValueProp,\n default: '',\n name: componentName,\n state: 'inputValue'\n }),\n _useControlled4 = _slicedToArray(_useControlled3, 2),\n inputValue = _useControlled4[0],\n setInputValue = _useControlled4[1];\n\n var _React$useState3 = React.useState(false),\n focused = _React$useState3[0],\n setFocused = _React$useState3[1];\n\n var resetInputValue = useEventCallback(function (event, newValue) {\n var newInputValue;\n\n if (multiple) {\n newInputValue = '';\n } else if (newValue == null) {\n newInputValue = '';\n } else {\n var optionLabel = getOptionLabel(newValue);\n newInputValue = typeof optionLabel === 'string' ? optionLabel : '';\n }\n\n if (inputValue === newInputValue) {\n return;\n }\n\n setInputValue(newInputValue);\n\n if (onInputChange) {\n onInputChange(event, newInputValue, 'reset');\n }\n });\n React.useEffect(function () {\n resetInputValue(null, value);\n }, [value, resetInputValue]);\n\n var _useControlled5 = useControlled({\n controlled: openProp,\n default: false,\n name: componentName,\n state: 'open'\n }),\n _useControlled6 = _slicedToArray(_useControlled5, 2),\n open = _useControlled6[0],\n setOpenState = _useControlled6[1];\n\n var inputValueIsSelectedValue = !multiple && value != null && inputValue === getOptionLabel(value);\n var popupOpen = open;\n var filteredOptions = popupOpen ? filterOptions(options.filter(function (option) {\n if (filterSelectedOptions && (multiple ? value : [value]).some(function (value2) {\n return value2 !== null && getOptionSelected(option, value2);\n })) {\n return false;\n }\n\n return true;\n }), // we use the empty string to manipulate `filterOptions` to not filter any options\n // i.e. the filter predicate always returns true\n {\n inputValue: inputValueIsSelectedValue ? '' : inputValue,\n getOptionLabel: getOptionLabel\n }) : [];\n\n if (process.env.NODE_ENV !== 'production') {\n if (value !== null && !freeSolo && options.length > 0) {\n var missingValue = (multiple ? value : [value]).filter(function (value2) {\n return !options.some(function (option) {\n return getOptionSelected(option, value2);\n });\n });\n\n if (missingValue.length > 0) {\n console.warn([\"Material-UI: The value provided to \".concat(componentName, \" is invalid.\"), \"None of the options match with `\".concat(missingValue.length > 1 ? JSON.stringify(missingValue) : JSON.stringify(missingValue[0]), \"`.\"), 'You can use the `getOptionSelected` prop to customize the equality test.'].join('\\n'));\n }\n }\n }\n\n var focusTag = useEventCallback(function (tagToFocus) {\n if (tagToFocus === -1) {\n inputRef.current.focus();\n } else {\n anchorEl.querySelector(\"[data-tag-index=\\\"\".concat(tagToFocus, \"\\\"]\")).focus();\n }\n }); // Ensure the focusedTag is never inconsistent\n\n React.useEffect(function () {\n if (multiple && focusedTag > value.length - 1) {\n setFocusedTag(-1);\n focusTag(-1);\n }\n }, [value, multiple, focusedTag, focusTag]);\n\n function validOptionIndex(index, direction) {\n if (!listboxRef.current || index === -1) {\n return -1;\n }\n\n var nextFocus = index;\n\n while (true) {\n // Out of range\n if (direction === 'next' && nextFocus === filteredOptions.length || direction === 'previous' && nextFocus === -1) {\n return -1;\n }\n\n var option = listboxRef.current.querySelector(\"[data-option-index=\\\"\".concat(nextFocus, \"\\\"]\")); // Same logic as MenuList.js\n\n var nextFocusDisabled = disabledItemsFocusable ? false : option && (option.disabled || option.getAttribute('aria-disabled') === 'true');\n\n if (option && !option.hasAttribute('tabindex') || nextFocusDisabled) {\n // Move to the next element.\n nextFocus += direction === 'next' ? 1 : -1;\n } else {\n return nextFocus;\n }\n }\n }\n\n var setHighlightedIndex = useEventCallback(function (_ref2) {\n var event = _ref2.event,\n index = _ref2.index,\n _ref2$reason = _ref2.reason,\n reason = _ref2$reason === void 0 ? 'auto' : _ref2$reason;\n highlightedIndexRef.current = index; // does the index exist?\n\n if (index === -1) {\n inputRef.current.removeAttribute('aria-activedescendant');\n } else {\n inputRef.current.setAttribute('aria-activedescendant', \"\".concat(id, \"-option-\").concat(index));\n }\n\n if (onHighlightChange) {\n onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);\n }\n\n if (!listboxRef.current) {\n return;\n }\n\n var prev = listboxRef.current.querySelector('[data-focus]');\n\n if (prev) {\n prev.removeAttribute('data-focus');\n }\n\n var listboxNode = listboxRef.current.parentElement.querySelector('[role=\"listbox\"]'); // \"No results\"\n\n if (!listboxNode) {\n return;\n }\n\n if (index === -1) {\n listboxNode.scrollTop = 0;\n return;\n }\n\n var option = listboxRef.current.querySelector(\"[data-option-index=\\\"\".concat(index, \"\\\"]\"));\n\n if (!option) {\n return;\n }\n\n option.setAttribute('data-focus', 'true'); // Scroll active descendant into view.\n // Logic copied from https://www.w3.org/TR/wai-aria-practices/examples/listbox/js/listbox.js\n //\n // Consider this API instead once it has a better browser support:\n // .scrollIntoView({ scrollMode: 'if-needed', block: 'nearest' });\n\n if (listboxNode.scrollHeight > listboxNode.clientHeight && reason !== 'mouse') {\n var element = option;\n var scrollBottom = listboxNode.clientHeight + listboxNode.scrollTop;\n var elementBottom = element.offsetTop + element.offsetHeight;\n\n if (elementBottom > scrollBottom) {\n listboxNode.scrollTop = elementBottom - listboxNode.clientHeight;\n } else if (element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0) < listboxNode.scrollTop) {\n listboxNode.scrollTop = element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0);\n }\n }\n });\n var changeHighlightedIndex = useEventCallback(function (_ref3) {\n var event = _ref3.event,\n diff = _ref3.diff,\n _ref3$direction = _ref3.direction,\n direction = _ref3$direction === void 0 ? 'next' : _ref3$direction,\n _ref3$reason = _ref3.reason,\n reason = _ref3$reason === void 0 ? 'auto' : _ref3$reason;\n\n if (!popupOpen) {\n return;\n }\n\n var getNextIndex = function getNextIndex() {\n var maxIndex = filteredOptions.length - 1;\n\n if (diff === 'reset') {\n return defaultHighlighted;\n }\n\n if (diff === 'start') {\n return 0;\n }\n\n if (diff === 'end') {\n return maxIndex;\n }\n\n var newIndex = highlightedIndexRef.current + diff;\n\n if (newIndex < 0) {\n if (newIndex === -1 && includeInputInList) {\n return -1;\n }\n\n if (disableListWrap && highlightedIndexRef.current !== -1 || Math.abs(diff) > 1) {\n return 0;\n }\n\n return maxIndex;\n }\n\n if (newIndex > maxIndex) {\n if (newIndex === maxIndex + 1 && includeInputInList) {\n return -1;\n }\n\n if (disableListWrap || Math.abs(diff) > 1) {\n return maxIndex;\n }\n\n return 0;\n }\n\n return newIndex;\n };\n\n var nextIndex = validOptionIndex(getNextIndex(), direction);\n setHighlightedIndex({\n index: nextIndex,\n reason: reason,\n event: event\n }); // Sync the content of the input with the highlighted option.\n\n if (autoComplete && diff !== 'reset') {\n if (nextIndex === -1) {\n inputRef.current.value = inputValue;\n } else {\n var option = getOptionLabel(filteredOptions[nextIndex]);\n inputRef.current.value = option; // The portion of the selected suggestion that has not been typed by the user,\n // a completion string, appears inline after the input cursor in the textbox.\n\n var index = option.toLowerCase().indexOf(inputValue.toLowerCase());\n\n if (index === 0 && inputValue.length > 0) {\n inputRef.current.setSelectionRange(inputValue.length, option.length);\n }\n }\n }\n });\n var syncHighlightedIndex = React.useCallback(function () {\n if (!popupOpen) {\n return;\n }\n\n var valueItem = multiple ? value[0] : value; // The popup is empty, reset\n\n if (filteredOptions.length === 0 || valueItem == null) {\n changeHighlightedIndex({\n diff: 'reset'\n });\n return;\n }\n\n if (!listboxRef.current) {\n return;\n } // Synchronize the value with the highlighted index\n\n\n if (!filterSelectedOptions && valueItem != null) {\n var currentOption = filteredOptions[highlightedIndexRef.current]; // Keep the current highlighted index if possible\n\n if (multiple && currentOption && findIndex(value, function (val) {\n return getOptionSelected(currentOption, val);\n }) !== -1) {\n return;\n }\n\n var itemIndex = findIndex(filteredOptions, function (optionItem) {\n return getOptionSelected(optionItem, valueItem);\n });\n\n if (itemIndex === -1) {\n changeHighlightedIndex({\n diff: 'reset'\n });\n } else {\n setHighlightedIndex({\n index: itemIndex\n });\n }\n\n return;\n } // Prevent the highlighted index to leak outside the boundaries.\n\n\n if (highlightedIndexRef.current >= filteredOptions.length - 1) {\n setHighlightedIndex({\n index: filteredOptions.length - 1\n });\n return;\n } // Restore the focus to the previous index.\n\n\n setHighlightedIndex({\n index: highlightedIndexRef.current\n }); // Ignore filteredOptions (and options, getOptionSelected, getOptionLabel) not to break the scroll position\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [// Only sync the highlighted index when the option switch between empty and not\n // eslint-disable-next-line react-hooks/exhaustive-deps\n filteredOptions.length === 0, // Don't sync the highlighted index with the value when multiple\n // eslint-disable-next-line react-hooks/exhaustive-deps\n multiple ? false : value, filterSelectedOptions, changeHighlightedIndex, setHighlightedIndex, popupOpen, inputValue, multiple]);\n var handleListboxRef = useEventCallback(function (node) {\n setRef(listboxRef, node);\n\n if (!node) {\n return;\n }\n\n syncHighlightedIndex();\n });\n React.useEffect(function () {\n syncHighlightedIndex();\n }, [syncHighlightedIndex]);\n\n var handleOpen = function handleOpen(event) {\n if (open) {\n return;\n }\n\n setOpenState(true);\n\n if (onOpen) {\n onOpen(event);\n }\n };\n\n var handleClose = function handleClose(event, reason) {\n if (!open) {\n return;\n }\n\n setOpenState(false);\n\n if (onClose) {\n onClose(event, reason);\n }\n };\n\n var handleValue = function handleValue(event, newValue, reason, details) {\n if (value === newValue) {\n return;\n }\n\n if (onChange) {\n onChange(event, newValue, reason, details);\n }\n\n setValue(newValue);\n };\n\n var isTouch = React.useRef(false);\n\n var selectNewValue = function selectNewValue(event, option) {\n var reasonProp = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'select-option';\n var origin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'options';\n var reason = reasonProp;\n var newValue = option;\n\n if (multiple) {\n newValue = Array.isArray(value) ? value.slice() : [];\n\n if (process.env.NODE_ENV !== 'production') {\n var matches = newValue.filter(function (val) {\n return getOptionSelected(option, val);\n });\n\n if (matches.length > 1) {\n console.error([\"Material-UI: The `getOptionSelected` method of \".concat(componentName, \" do not handle the arguments correctly.\"), \"The component expects a single value to match a given option but found \".concat(matches.length, \" matches.\")].join('\\n'));\n }\n }\n\n var itemIndex = findIndex(newValue, function (valueItem) {\n return getOptionSelected(option, valueItem);\n });\n\n if (itemIndex === -1) {\n newValue.push(option);\n } else if (origin !== 'freeSolo') {\n newValue.splice(itemIndex, 1);\n reason = 'remove-option';\n }\n }\n\n resetInputValue(event, newValue);\n handleValue(event, newValue, reason, {\n option: option\n });\n\n if (!disableCloseOnSelect) {\n handleClose(event, reason);\n }\n\n if (blurOnSelect === true || blurOnSelect === 'touch' && isTouch.current || blurOnSelect === 'mouse' && !isTouch.current) {\n inputRef.current.blur();\n }\n };\n\n function validTagIndex(index, direction) {\n if (index === -1) {\n return -1;\n }\n\n var nextFocus = index;\n\n while (true) {\n // Out of range\n if (direction === 'next' && nextFocus === value.length || direction === 'previous' && nextFocus === -1) {\n return -1;\n }\n\n var option = anchorEl.querySelector(\"[data-tag-index=\\\"\".concat(nextFocus, \"\\\"]\")); // Same logic as MenuList.js\n\n if (option && (!option.hasAttribute('tabindex') || option.disabled || option.getAttribute('aria-disabled') === 'true')) {\n nextFocus += direction === 'next' ? 1 : -1;\n } else {\n return nextFocus;\n }\n }\n }\n\n var handleFocusTag = function handleFocusTag(event, direction) {\n if (!multiple) {\n return;\n }\n\n handleClose(event, 'toggleInput');\n var nextTag = focusedTag;\n\n if (focusedTag === -1) {\n if (inputValue === '' && direction === 'previous') {\n nextTag = value.length - 1;\n }\n } else {\n nextTag += direction === 'next' ? 1 : -1;\n\n if (nextTag < 0) {\n nextTag = 0;\n }\n\n if (nextTag === value.length) {\n nextTag = -1;\n }\n }\n\n nextTag = validTagIndex(nextTag, direction);\n setFocusedTag(nextTag);\n focusTag(nextTag);\n };\n\n var handleClear = function handleClear(event) {\n ignoreFocus.current = true;\n setInputValue('');\n\n if (onInputChange) {\n onInputChange(event, '', 'clear');\n }\n\n handleValue(event, multiple ? [] : null, 'clear');\n };\n\n var handleKeyDown = function handleKeyDown(other) {\n return function (event) {\n if (focusedTag !== -1 && ['ArrowLeft', 'ArrowRight'].indexOf(event.key) === -1) {\n setFocusedTag(-1);\n focusTag(-1);\n }\n\n switch (event.key) {\n case 'Home':\n if (popupOpen && handleHomeEndKeys) {\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: 'start',\n direction: 'next',\n reason: 'keyboard',\n event: event\n });\n }\n\n break;\n\n case 'End':\n if (popupOpen && handleHomeEndKeys) {\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: 'end',\n direction: 'previous',\n reason: 'keyboard',\n event: event\n });\n }\n\n break;\n\n case 'PageUp':\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: -pageSize,\n direction: 'previous',\n reason: 'keyboard',\n event: event\n });\n handleOpen(event);\n break;\n\n case 'PageDown':\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: pageSize,\n direction: 'next',\n reason: 'keyboard',\n event: event\n });\n handleOpen(event);\n break;\n\n case 'ArrowDown':\n // Prevent cursor move\n event.preventDefault();\n changeHighlightedIndex({\n diff: 1,\n direction: 'next',\n reason: 'keyboard',\n event: event\n });\n handleOpen(event);\n break;\n\n case 'ArrowUp':\n // Prevent cursor move\n event.preventDefault();\n changeHighlightedIndex({\n diff: -1,\n direction: 'previous',\n reason: 'keyboard',\n event: event\n });\n handleOpen(event);\n break;\n\n case 'ArrowLeft':\n handleFocusTag(event, 'previous');\n break;\n\n case 'ArrowRight':\n handleFocusTag(event, 'next');\n break;\n\n case 'Enter':\n // Wait until IME is settled.\n if (event.which === 229) {\n break;\n }\n\n if (highlightedIndexRef.current !== -1 && popupOpen) {\n var option = filteredOptions[highlightedIndexRef.current];\n var disabled = getOptionDisabled ? getOptionDisabled(option) : false; // We don't want to validate the form.\n\n event.preventDefault();\n\n if (disabled) {\n return;\n }\n\n selectNewValue(event, option, 'select-option'); // Move the selection to the end.\n\n if (autoComplete) {\n inputRef.current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length);\n }\n } else if (freeSolo && inputValue !== '' && inputValueIsSelectedValue === false) {\n if (multiple) {\n // Allow people to add new values before they submit the form.\n event.preventDefault();\n }\n\n selectNewValue(event, inputValue, 'create-option', 'freeSolo');\n }\n\n break;\n\n case 'Escape':\n if (popupOpen) {\n // Avoid Opera to exit fullscreen mode.\n event.preventDefault(); // Avoid the Modal to handle the event.\n\n event.stopPropagation();\n handleClose(event, 'escape');\n } else if (clearOnEscape && (inputValue !== '' || multiple && value.length > 0)) {\n // Avoid Opera to exit fullscreen mode.\n event.preventDefault(); // Avoid the Modal to handle the event.\n\n event.stopPropagation();\n handleClear(event);\n }\n\n break;\n\n case 'Backspace':\n if (multiple && inputValue === '' && value.length > 0) {\n var index = focusedTag === -1 ? value.length - 1 : focusedTag;\n var newValue = value.slice();\n newValue.splice(index, 1);\n handleValue(event, newValue, 'remove-option', {\n option: value[index]\n });\n }\n\n break;\n\n default:\n }\n\n if (other.onKeyDown) {\n other.onKeyDown(event);\n }\n };\n };\n\n var handleFocus = function handleFocus(event) {\n setFocused(true);\n\n if (openOnFocus && !ignoreFocus.current) {\n handleOpen(event);\n }\n };\n\n var handleBlur = function handleBlur(event) {\n // Ignore the event when using the scrollbar with IE 11\n if (listboxRef.current !== null && document.activeElement === listboxRef.current.parentElement) {\n inputRef.current.focus();\n return;\n }\n\n setFocused(false);\n firstFocus.current = true;\n ignoreFocus.current = false;\n\n if (debug && inputValue !== '') {\n return;\n }\n\n if (autoSelect && highlightedIndexRef.current !== -1 && popupOpen) {\n selectNewValue(event, filteredOptions[highlightedIndexRef.current], 'blur');\n } else if (autoSelect && freeSolo && inputValue !== '') {\n selectNewValue(event, inputValue, 'blur', 'freeSolo');\n } else if (clearOnBlur) {\n resetInputValue(event, value);\n }\n\n handleClose(event, 'blur');\n };\n\n var handleInputChange = function handleInputChange(event) {\n var newValue = event.target.value;\n\n if (inputValue !== newValue) {\n setInputValue(newValue);\n\n if (onInputChange) {\n onInputChange(event, newValue, 'input');\n }\n }\n\n if (newValue === '') {\n if (!disableClearable && !multiple) {\n handleValue(event, null, 'clear');\n }\n } else {\n handleOpen(event);\n }\n };\n\n var handleOptionMouseOver = function handleOptionMouseOver(event) {\n setHighlightedIndex({\n event: event,\n index: Number(event.currentTarget.getAttribute('data-option-index')),\n reason: 'mouse'\n });\n };\n\n var handleOptionTouchStart = function handleOptionTouchStart() {\n isTouch.current = true;\n };\n\n var handleOptionClick = function handleOptionClick(event) {\n var index = Number(event.currentTarget.getAttribute('data-option-index'));\n selectNewValue(event, filteredOptions[index], 'select-option');\n isTouch.current = false;\n };\n\n var handleTagDelete = function handleTagDelete(index) {\n return function (event) {\n var newValue = value.slice();\n newValue.splice(index, 1);\n handleValue(event, newValue, 'remove-option', {\n option: value[index]\n });\n };\n };\n\n var handlePopupIndicator = function handlePopupIndicator(event) {\n if (open) {\n handleClose(event, 'toggleInput');\n } else {\n handleOpen(event);\n }\n }; // Prevent input blur when interacting with the combobox\n\n\n var handleMouseDown = function handleMouseDown(event) {\n if (event.target.getAttribute('id') !== id) {\n event.preventDefault();\n }\n }; // Focus the input when interacting with the combobox\n\n\n var handleClick = function handleClick() {\n inputRef.current.focus();\n\n if (selectOnFocus && firstFocus.current && inputRef.current.selectionEnd - inputRef.current.selectionStart === 0) {\n inputRef.current.select();\n }\n\n firstFocus.current = false;\n };\n\n var handleInputMouseDown = function handleInputMouseDown(event) {\n if (inputValue === '' || !open) {\n handlePopupIndicator(event);\n }\n };\n\n var dirty = freeSolo && inputValue.length > 0;\n dirty = dirty || (multiple ? value.length > 0 : value !== null);\n var groupedOptions = filteredOptions;\n\n if (groupBy) {\n // used to keep track of key and indexes in the result array\n var indexBy = new Map();\n var warn = false;\n groupedOptions = filteredOptions.reduce(function (acc, option, index) {\n var group = groupBy(option);\n\n if (acc.length > 0 && acc[acc.length - 1].group === group) {\n acc[acc.length - 1].options.push(option);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n if (indexBy.get(group) && !warn) {\n console.warn(\"Material-UI: The options provided combined with the `groupBy` method of \".concat(componentName, \" returns duplicated headers.\"), 'You can solve the issue by sorting the options with the output of `groupBy`.');\n warn = true;\n }\n\n indexBy.set(group, true);\n }\n\n acc.push({\n key: index,\n index: index,\n group: group,\n options: [option]\n });\n }\n\n return acc;\n }, []);\n }\n\n return {\n getRootProps: function getRootProps() {\n var other = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _extends({\n 'aria-owns': popupOpen ? \"\".concat(id, \"-popup\") : null,\n role: 'combobox',\n 'aria-expanded': popupOpen\n }, other, {\n onKeyDown: handleKeyDown(other),\n onMouseDown: handleMouseDown,\n onClick: handleClick\n });\n },\n getInputLabelProps: function getInputLabelProps() {\n return {\n id: \"\".concat(id, \"-label\"),\n htmlFor: id\n };\n },\n getInputProps: function getInputProps() {\n return {\n id: id,\n value: inputValue,\n onBlur: handleBlur,\n onFocus: handleFocus,\n onChange: handleInputChange,\n onMouseDown: handleInputMouseDown,\n // if open then this is handled imperativeley so don't let react override\n // only have an opinion about this when closed\n 'aria-activedescendant': popupOpen ? '' : null,\n 'aria-autocomplete': autoComplete ? 'both' : 'list',\n 'aria-controls': popupOpen ? \"\".concat(id, \"-popup\") : null,\n // Disable browser's suggestion that might overlap with the popup.\n // Handle autocomplete but not autofill.\n autoComplete: 'off',\n ref: inputRef,\n autoCapitalize: 'none',\n spellCheck: 'false'\n };\n },\n getClearProps: function getClearProps() {\n return {\n tabIndex: -1,\n onClick: handleClear\n };\n },\n getPopupIndicatorProps: function getPopupIndicatorProps() {\n return {\n tabIndex: -1,\n onClick: handlePopupIndicator\n };\n },\n getTagProps: function getTagProps(_ref4) {\n var index = _ref4.index;\n return {\n key: index,\n 'data-tag-index': index,\n tabIndex: -1,\n onDelete: handleTagDelete(index)\n };\n },\n getListboxProps: function getListboxProps() {\n return {\n role: 'listbox',\n id: \"\".concat(id, \"-popup\"),\n 'aria-labelledby': \"\".concat(id, \"-label\"),\n ref: handleListboxRef,\n onMouseDown: function onMouseDown(event) {\n // Prevent blur\n event.preventDefault();\n }\n };\n },\n getOptionProps: function getOptionProps(_ref5) {\n var index = _ref5.index,\n option = _ref5.option;\n var selected = (multiple ? value : [value]).some(function (value2) {\n return value2 != null && getOptionSelected(option, value2);\n });\n var disabled = getOptionDisabled ? getOptionDisabled(option) : false;\n return {\n key: index,\n tabIndex: -1,\n role: 'option',\n id: \"\".concat(id, \"-option-\").concat(index),\n onMouseOver: handleOptionMouseOver,\n onClick: handleOptionClick,\n onTouchStart: handleOptionTouchStart,\n 'data-option-index': index,\n 'aria-disabled': disabled,\n 'aria-selected': selected\n };\n },\n id: id,\n inputValue: inputValue,\n value: value,\n dirty: dirty,\n popupOpen: popupOpen,\n focused: focused || focusedTag !== -1,\n anchorEl: anchorEl,\n setAnchorEl: setAnchorEl,\n focusedTag: focusedTag,\n groupedOptions: groupedOptions\n };\n}","'use strict'\n\nlet CssSyntaxError = require('./css-syntax-error')\nlet Stringifier = require('./stringifier')\nlet stringify = require('./stringify')\nlet { isClean, my } = require('./symbols')\n\nfunction cloneNode(obj, parent) {\n let cloned = new obj.constructor()\n\n for (let i in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, i)) {\n /* c8 ignore next 2 */\n continue\n }\n if (i === 'proxyCache') continue\n let value = obj[i]\n let type = typeof value\n\n if (i === 'parent' && type === 'object') {\n if (parent) cloned[i] = parent\n } else if (i === 'source') {\n cloned[i] = value\n } else if (Array.isArray(value)) {\n cloned[i] = value.map(j => cloneNode(j, cloned))\n } else {\n if (type === 'object' && value !== null) value = cloneNode(value)\n cloned[i] = value\n }\n }\n\n return cloned\n}\n\nfunction sourceOffset(inputCSS, position) {\n // Not all custom syntaxes support `offset` in `source.start` and `source.end`\n if (\n position &&\n typeof position.offset !== 'undefined'\n ) {\n return position.offset;\n }\n\n let column = 1\n let line = 1\n let offset = 0\n\n for (let i = 0; i < inputCSS.length; i++) {\n if (line === position.line && column === position.column) {\n offset = i\n break\n }\n\n if (inputCSS[i] === '\\n') {\n column = 1\n line += 1\n } else {\n column += 1\n }\n }\n\n return offset\n}\n\nclass Node {\n get proxyOf() {\n return this\n }\n\n constructor(defaults = {}) {\n this.raws = {}\n this[isClean] = false\n this[my] = true\n\n for (let name in defaults) {\n if (name === 'nodes') {\n this.nodes = []\n for (let node of defaults[name]) {\n if (typeof node.clone === 'function') {\n this.append(node.clone())\n } else {\n this.append(node)\n }\n }\n } else {\n this[name] = defaults[name]\n }\n }\n }\n\n addToError(error) {\n error.postcssNode = this\n if (error.stack && this.source && /\\n\\s{4}at /.test(error.stack)) {\n let s = this.source\n error.stack = error.stack.replace(\n /\\n\\s{4}at /,\n `$&${s.input.from}:${s.start.line}:${s.start.column}$&`\n )\n }\n return error\n }\n\n after(add) {\n this.parent.insertAfter(this, add)\n return this\n }\n\n assign(overrides = {}) {\n for (let name in overrides) {\n this[name] = overrides[name]\n }\n return this\n }\n\n before(add) {\n this.parent.insertBefore(this, add)\n return this\n }\n\n cleanRaws(keepBetween) {\n delete this.raws.before\n delete this.raws.after\n if (!keepBetween) delete this.raws.between\n }\n\n clone(overrides = {}) {\n let cloned = cloneNode(this)\n for (let name in overrides) {\n cloned[name] = overrides[name]\n }\n return cloned\n }\n\n cloneAfter(overrides = {}) {\n let cloned = this.clone(overrides)\n this.parent.insertAfter(this, cloned)\n return cloned\n }\n\n cloneBefore(overrides = {}) {\n let cloned = this.clone(overrides)\n this.parent.insertBefore(this, cloned)\n return cloned\n }\n\n error(message, opts = {}) {\n if (this.source) {\n let { end, start } = this.rangeBy(opts)\n return this.source.input.error(\n message,\n { column: start.column, line: start.line },\n { column: end.column, line: end.line },\n opts\n )\n }\n return new CssSyntaxError(message)\n }\n\n getProxyProcessor() {\n return {\n get(node, prop) {\n if (prop === 'proxyOf') {\n return node\n } else if (prop === 'root') {\n return () => node.root().toProxy()\n } else {\n return node[prop]\n }\n },\n\n set(node, prop, value) {\n if (node[prop] === value) return true\n node[prop] = value\n if (\n prop === 'prop' ||\n prop === 'value' ||\n prop === 'name' ||\n prop === 'params' ||\n prop === 'important' ||\n /* c8 ignore next */\n prop === 'text'\n ) {\n node.markDirty()\n }\n return true\n }\n }\n }\n\n /* c8 ignore next 3 */\n markClean() {\n this[isClean] = true\n }\n\n markDirty() {\n if (this[isClean]) {\n this[isClean] = false\n let next = this\n while ((next = next.parent)) {\n next[isClean] = false\n }\n }\n }\n\n next() {\n if (!this.parent) return undefined\n let index = this.parent.index(this)\n return this.parent.nodes[index + 1]\n }\n\n positionBy(opts) {\n let pos = this.source.start\n if (opts.index) {\n pos = this.positionInside(opts.index)\n } else if (opts.word) {\n let inputString = ('document' in this.source.input)\n ? this.source.input.document\n : this.source.input.css\n let stringRepresentation = inputString.slice(\n sourceOffset(inputString, this.source.start),\n sourceOffset(inputString, this.source.end)\n )\n let index = stringRepresentation.indexOf(opts.word)\n if (index !== -1) pos = this.positionInside(index)\n }\n return pos\n }\n\n positionInside(index) {\n let column = this.source.start.column\n let line = this.source.start.line\n let inputString = ('document' in this.source.input)\n ? this.source.input.document\n : this.source.input.css\n let offset = sourceOffset(inputString, this.source.start)\n let end = offset + index\n\n for (let i = offset; i < end; i++) {\n if (inputString[i] === '\\n') {\n column = 1\n line += 1\n } else {\n column += 1\n }\n }\n\n return { column, line }\n }\n\n prev() {\n if (!this.parent) return undefined\n let index = this.parent.index(this)\n return this.parent.nodes[index - 1]\n }\n\n rangeBy(opts) {\n let start = {\n column: this.source.start.column,\n line: this.source.start.line\n }\n let end = this.source.end\n ? {\n column: this.source.end.column + 1,\n line: this.source.end.line\n }\n : {\n column: start.column + 1,\n line: start.line\n }\n\n if (opts.word) {\n let inputString = ('document' in this.source.input)\n ? this.source.input.document\n : this.source.input.css\n let stringRepresentation = inputString.slice(\n sourceOffset(inputString, this.source.start),\n sourceOffset(inputString, this.source.end)\n )\n let index = stringRepresentation.indexOf(opts.word)\n if (index !== -1) {\n start = this.positionInside(index)\n end = this.positionInside(\n index + opts.word.length,\n )\n }\n } else {\n if (opts.start) {\n start = {\n column: opts.start.column,\n line: opts.start.line\n }\n } else if (opts.index) {\n start = this.positionInside(opts.index)\n }\n\n if (opts.end) {\n end = {\n column: opts.end.column,\n line: opts.end.line\n }\n } else if (typeof opts.endIndex === 'number') {\n end = this.positionInside(opts.endIndex)\n } else if (opts.index) {\n end = this.positionInside(opts.index + 1)\n }\n }\n\n if (\n end.line < start.line ||\n (end.line === start.line && end.column <= start.column)\n ) {\n end = { column: start.column + 1, line: start.line }\n }\n\n return { end, start }\n }\n\n raw(prop, defaultType) {\n let str = new Stringifier()\n return str.raw(this, prop, defaultType)\n }\n\n remove() {\n if (this.parent) {\n this.parent.removeChild(this)\n }\n this.parent = undefined\n return this\n }\n\n replaceWith(...nodes) {\n if (this.parent) {\n let bookmark = this\n let foundSelf = false\n for (let node of nodes) {\n if (node === this) {\n foundSelf = true\n } else if (foundSelf) {\n this.parent.insertAfter(bookmark, node)\n bookmark = node\n } else {\n this.parent.insertBefore(bookmark, node)\n }\n }\n\n if (!foundSelf) {\n this.remove()\n }\n }\n\n return this\n }\n\n root() {\n let result = this\n while (result.parent && result.parent.type !== 'document') {\n result = result.parent\n }\n return result\n }\n\n toJSON(_, inputs) {\n let fixed = {}\n let emitInputs = inputs == null\n inputs = inputs || new Map()\n let inputsNextIndex = 0\n\n for (let name in this) {\n if (!Object.prototype.hasOwnProperty.call(this, name)) {\n /* c8 ignore next 2 */\n continue\n }\n if (name === 'parent' || name === 'proxyCache') continue\n let value = this[name]\n\n if (Array.isArray(value)) {\n fixed[name] = value.map(i => {\n if (typeof i === 'object' && i.toJSON) {\n return i.toJSON(null, inputs)\n } else {\n return i\n }\n })\n } else if (typeof value === 'object' && value.toJSON) {\n fixed[name] = value.toJSON(null, inputs)\n } else if (name === 'source') {\n let inputId = inputs.get(value.input)\n if (inputId == null) {\n inputId = inputsNextIndex\n inputs.set(value.input, inputsNextIndex)\n inputsNextIndex++\n }\n fixed[name] = {\n end: value.end,\n inputId,\n start: value.start\n }\n } else {\n fixed[name] = value\n }\n }\n\n if (emitInputs) {\n fixed.inputs = [...inputs.keys()].map(input => input.toJSON())\n }\n\n return fixed\n }\n\n toProxy() {\n if (!this.proxyCache) {\n this.proxyCache = new Proxy(this, this.getProxyProcessor())\n }\n return this.proxyCache\n }\n\n toString(stringifier = stringify) {\n if (stringifier.stringify) stringifier = stringifier.stringify\n let result = ''\n stringifier(this, i => {\n result += i\n })\n return result\n }\n\n warn(result, text, opts) {\n let data = { node: this }\n for (let i in opts) data[i] = opts[i]\n return result.warn(text, data)\n }\n}\n\nmodule.exports = Node\nNode.default = Node\n","var baseUniq = require('./_baseUniq');\n\n/**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\nfunction uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n}\n\nmodule.exports = uniq;\n","var baseSet = require('./_baseSet');\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nmodule.exports = set;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar styleInject = require('../styleInject.js');\n\nvar css_248z = \".Column-module_column__ihEsE{display:grid;grid-template-columns:repeat(12,[col-start] 1fr);grid-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;grid-auto-rows:min-content}\";\nvar styles = {\"column\":\"Column-module_column__ihEsE\"};\nstyleInject[\"default\"](css_248z, 'e777f35d-1c18-44d1-8391-89bfadb7ef5d');\n\nexports[\"default\"] = styles;\n","var asciiToArray = require('./_asciiToArray'),\n hasUnicode = require('./_hasUnicode'),\n unicodeToArray = require('./_unicodeToArray');\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\nmodule.exports = stringToArray;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar _extends = require('@babel/runtime/helpers/extends');\nvar React = require('react');\nvar nthHookTheme = require('@narvar/nth-hook-theme');\nvar index$1 = require('../../../components/Language/index.js');\nrequire('../../../components/Spinner/Spinner.module.css.js');\nrequire('../../../components/LocationCard/LocationCard.js');\nvar PudoCard = require('../../../components/PudoCard/PudoCard.js');\nrequire('../../../components/ItemCard/ItemCard.js');\nrequire('../../../components/SelectItem/SelectItem.js');\nrequire('../../../components/SelectList/SelectList.js');\nrequire('../../../components/ErrorBanner/ErrorBanner.js');\nrequire('../../../components/Footer/Footer.js');\nrequire('../../../components/StickyFooter/StickyFooter.js');\nrequire('../../../components/SwatchesList/SwatchesList.js');\nvar index = require('../../../components/TextLink/index.js');\nrequire('../../../components/Backdrop/Backdrop.module.css.js');\nrequire('../../../components/LineItemsGroup/index.js');\nrequire('../../../components/Skeleton/Skeleton.module.css.js');\nvar title = require('../RootElm/title.js');\nvar pudoMethod = require('../../../transformers/pudoMethod.js');\nvar PreferencesStatus = require('../../../components/Preferences/PreferencesStatus.js');\nvar PudoCardList_module = require('./PudoCardList.module.css.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);\nvar React__default = /*#__PURE__*/_interopDefaultLegacy(React);\n\nconst PudoCards = _ref => {\n let {\n pudoOptions,\n onValueChange,\n defaultValue,\n headerTitle,\n preferencesStatus,\n showSwitchCategory,\n locale,\n includeCurrency\n } = _ref;\n const {\n linksNoneDefault,\n linksNoneHover\n } = nthHookTheme.useTheme();\n return /*#__PURE__*/React__default[\"default\"].createElement(\"div\", {\n className: PudoCardList_module[\"default\"].pudoElmWrap\n }, /*#__PURE__*/React__default[\"default\"].createElement(title[\"default\"], {\n headerTitle: headerTitle\n }), preferencesStatus && pudoOptions.some(opt => opt.preferred) && /*#__PURE__*/React__default[\"default\"].createElement(PreferencesStatus[\"default\"], preferencesStatus), /*#__PURE__*/React__default[\"default\"].createElement(\"div\", {\n className: PudoCardList_module[\"default\"].pudoGroup\n }, defaultValue ? pudoOptions.filter(item => pudoMethod.generatePudoId(item) === pudoMethod.generatePudoId(defaultValue)).map(option => /*#__PURE__*/React__default[\"default\"].createElement(PudoCard[\"default\"], _extends__default[\"default\"]({}, option, {\n defaultValue,\n locale,\n includeCurrency,\n key: pudoMethod.generatePudoId(option)\n }))) : pudoOptions.map(option => /*#__PURE__*/React__default[\"default\"].createElement(PudoCard[\"default\"], _extends__default[\"default\"]({}, option, {\n defaultValue,\n locale,\n includeCurrency,\n key: pudoMethod.generatePudoId(option),\n onClick: () => onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(pudoMethod.generatePudoId(option))\n })))), defaultValue && showSwitchCategory && /*#__PURE__*/React__default[\"default\"].createElement(\"div\", {\n className: PudoCardList_module[\"default\"].pudoExtraActions\n }, /*#__PURE__*/React__default[\"default\"].createElement(index[\"default\"], {\n onClick: () => onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(''),\n linkStyle: {\n sDefault: linksNoneDefault,\n sHover: linksNoneHover\n }\n }, /*#__PURE__*/React__default[\"default\"].createElement(index$1[\"default\"], {\n langKey: \"returnsPudoListSwitchCategory\"\n }))));\n};\nvar PudoCards$1 = nthHookTheme.withThemeProvider(PudoCards, {\n themeTokens: ['linksNoneDefault', 'linksNoneHover']\n});\n\nexports[\"default\"] = PudoCards$1;\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport Typography from '../Typography';\nimport withStyles from '../styles/withStyles';\nimport FormControlContext, { useFormControl } from '../FormControl/FormControlContext';\nexport var styles = {\n /* Styles applied to the root element. */\n root: {\n display: 'flex',\n height: '0.01em',\n // Fix IE 11 flexbox alignment. To remove at some point.\n maxHeight: '2em',\n alignItems: 'center',\n whiteSpace: 'nowrap'\n },\n\n /* Styles applied to the root element if `variant=\"filled\"`. */\n filled: {\n '&$positionStart:not($hiddenLabel)': {\n marginTop: 16\n }\n },\n\n /* Styles applied to the root element if `position=\"start\"`. */\n positionStart: {\n marginRight: 8\n },\n\n /* Styles applied to the root element if `position=\"end\"`. */\n positionEnd: {\n marginLeft: 8\n },\n\n /* Styles applied to the root element if `disablePointerEvents=true`. */\n disablePointerEvents: {\n pointerEvents: 'none'\n },\n\n /* Styles applied if the adornment is used inside