@plasmicpkgs/commerce-swell 0.0.155 → 0.0.157
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cart/use-update-item.d.ts +2 -2
- package/dist/commerce-swell.cjs.development.js +17 -18
- package/dist/commerce-swell.cjs.development.js.map +1 -1
- package/dist/commerce-swell.cjs.production.min.js +1 -1
- package/dist/commerce-swell.cjs.production.min.js.map +1 -1
- package/dist/commerce-swell.esm.js +18 -19
- package/dist/commerce-swell.esm.js.map +1 -1
- package/dist/provider.d.ts +2 -2
- package/package.json +4 -4
|
@@ -4,9 +4,9 @@ import { UpdateItemHook } from "../types/cart";
|
|
|
4
4
|
declare const _default: <T extends CartType.LineItem | undefined = undefined>(ctx?: {
|
|
5
5
|
item?: T | undefined;
|
|
6
6
|
wait?: number | undefined;
|
|
7
|
-
}) => ((input: (CartType.CartItemBody & {
|
|
7
|
+
}) => ((input: (Partial<CartType.CartItemBody> & {
|
|
8
8
|
id: string;
|
|
9
|
-
}) | Partial<CartType.CartItemBody & {
|
|
9
|
+
}) | Partial<Partial<CartType.CartItemBody> & {
|
|
10
10
|
id: string;
|
|
11
11
|
}>) => Promise<CartType.Cart | null | undefined>) & {
|
|
12
12
|
clear(): void;
|
|
@@ -1349,45 +1349,40 @@ var handler$3 = {
|
|
|
1349
1349
|
var _ctx = ctx,
|
|
1350
1350
|
item = _ctx.item;
|
|
1351
1351
|
var _useCart = commerce.useCart(),
|
|
1352
|
-
mutate = _useCart.mutate
|
|
1353
|
-
cartData = _useCart.data;
|
|
1352
|
+
mutate = _useCart.mutate;
|
|
1354
1353
|
return React.useCallback(debounce( /*#__PURE__*/function () {
|
|
1355
1354
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(input) {
|
|
1356
|
-
var
|
|
1355
|
+
var _input$id;
|
|
1356
|
+
var itemId, data;
|
|
1357
1357
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
1358
1358
|
while (1) {
|
|
1359
1359
|
switch (_context2.prev = _context2.next) {
|
|
1360
1360
|
case 0:
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
variantId = (item == null ? void 0 : item.variant.id) || firstLineItem.variant.id;
|
|
1365
|
-
if (!(!itemId || !productId)) {
|
|
1366
|
-
_context2.next = 6;
|
|
1361
|
+
itemId = (_input$id = input.id) != null ? _input$id : item == null ? void 0 : item.id;
|
|
1362
|
+
if (itemId) {
|
|
1363
|
+
_context2.next = 3;
|
|
1367
1364
|
break;
|
|
1368
1365
|
}
|
|
1369
1366
|
throw new commerce.ValidationError({
|
|
1370
1367
|
message: "Invalid input used for this operation"
|
|
1371
1368
|
});
|
|
1372
|
-
case
|
|
1373
|
-
_context2.next =
|
|
1369
|
+
case 3:
|
|
1370
|
+
_context2.next = 5;
|
|
1374
1371
|
return fetch({
|
|
1375
1372
|
input: {
|
|
1376
1373
|
item: {
|
|
1377
|
-
productId: productId,
|
|
1378
|
-
variantId: variantId,
|
|
1379
1374
|
quantity: input.quantity
|
|
1380
1375
|
},
|
|
1381
1376
|
itemId: itemId
|
|
1382
1377
|
}
|
|
1383
1378
|
});
|
|
1384
|
-
case
|
|
1379
|
+
case 5:
|
|
1385
1380
|
data = _context2.sent;
|
|
1386
|
-
_context2.next =
|
|
1381
|
+
_context2.next = 8;
|
|
1387
1382
|
return mutate(data, false);
|
|
1388
|
-
case
|
|
1383
|
+
case 8:
|
|
1389
1384
|
return _context2.abrupt("return", data);
|
|
1390
|
-
case
|
|
1385
|
+
case 9:
|
|
1391
1386
|
case "end":
|
|
1392
1387
|
return _context2.stop();
|
|
1393
1388
|
}
|
|
@@ -1875,6 +1870,7 @@ var useCommerce = function useCommerce() {
|
|
|
1875
1870
|
return commerce.useCommerce();
|
|
1876
1871
|
};
|
|
1877
1872
|
|
|
1873
|
+
var globalContextName = "plasmic-commerce-swell-provider";
|
|
1878
1874
|
var commerceProviderMeta = {
|
|
1879
1875
|
name: "plasmic-commerce-swell-provider",
|
|
1880
1876
|
displayName: "Swell Provider",
|
|
@@ -1888,6 +1884,7 @@ var commerceProviderMeta = {
|
|
|
1888
1884
|
defaultValue: "pk_QaZeGhtpQaVbNQnWJdRlE1abE6Ezf9U9"
|
|
1889
1885
|
}
|
|
1890
1886
|
},
|
|
1887
|
+
unstable__globalActions: commerce.globalActionsRegistrations,
|
|
1891
1888
|
description: "Get your store ID and public storefront API key from the Swell admin UI under Developer > API Keys.\n\n[Watch how to use this integration](https://www.youtube.com/watch?v=b2mgOTbP2_8).",
|
|
1892
1889
|
importPath: "@plasmicpkgs/commerce-swell",
|
|
1893
1890
|
importName: "CommerceProviderComponent"
|
|
@@ -1899,7 +1896,9 @@ function CommerceProviderComponent(props) {
|
|
|
1899
1896
|
var CommerceProvider = React__default.useMemo(function () {
|
|
1900
1897
|
return getCommerceProvider(storeId, publicKey);
|
|
1901
1898
|
}, [storeId, publicKey]);
|
|
1902
|
-
return React__default.createElement(CommerceProvider, null,
|
|
1899
|
+
return React__default.createElement(CommerceProvider, null, React__default.createElement(commerce.CartActionsProvider, {
|
|
1900
|
+
globalContextName: globalContextName
|
|
1901
|
+
}, children));
|
|
1903
1902
|
}
|
|
1904
1903
|
function registerCommerceProvider(loader, customCommerceProviderMeta) {
|
|
1905
1904
|
var doRegisterComponent = function doRegisterComponent() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commerce-swell.cjs.development.js","sources":["../src/const.ts","../../../../node_modules/regenerator-runtime/runtime.js","../src/utils/normalize.ts","../src/utils/handle-fetch-response.ts","../src/utils/get-checkout-id.ts","../src/cart/utils/checkout-to-cart.ts","../src/cart/utils/checkout-create.ts","../src/cart/use-cart.tsx","../src/cart/use-add-item.tsx","../src/cart/use-remove-item.tsx","../src/cart/use-update-item.tsx","../src/utils/common.ts","../src/utils/category-tree.ts","../src/product/use-search.tsx","../src/product/use-product.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/fetcher.ts","../src/provider.ts","../src/swell.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: Removed store id and public key\n*/\nexport const SWELL_CHECKOUT_ID_COOKIE = 'SWELL_checkoutId'\n\nexport const SWELL_CHECKOUT_URL_COOKIE = 'swell_checkoutUrl'\n\nexport const SWELL_CUSTOMER_TOKEN_COOKIE = 'swell_customerToken'\n\nexport const SWELL_COOKIE_EXPIRE = 30\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: Added \"Default Variant\" to default title when there's no product variant\n*/\nimport { MoneyV2 } from \"../schema\";\nimport type {\n Cart,\n CartLineItem,\n LineItem,\n ProductOptionValue,\n SwellCart,\n SwellImage,\n SwellProduct,\n SwellProductOptionValue,\n SwellVariant,\n} from \"../types\";\nimport { Product, ProductOption } from \"../types/product\";\nimport { Category, SwellCategoryChildren } from \"../types/site\";\n\nconst money = ({ amount, currencyCode }: MoneyV2) => {\n return {\n value: +amount,\n currencyCode,\n };\n};\n\ntype swellProductOption = {\n id: string;\n name: string;\n values: any[];\n};\n\ntype normalizedProductOption = {\n id: string;\n displayName: string;\n values: ProductOptionValue[];\n};\n\nconst normalizeProductOption = ({\n id,\n name: displayName = \"\",\n values = [],\n}: swellProductOption): ProductOption => {\n let returnValues = values.map((value) => {\n let output: any = {\n label: value.name,\n // id: value?.id || id,\n };\n if (displayName.match(/colou?r/gi)) {\n output = {\n ...output,\n hexColors: [value.name],\n };\n }\n return output;\n });\n return {\n __typename: \"MultipleChoiceOption\",\n id,\n displayName,\n values: returnValues,\n };\n};\n\nconst normalizeProductImages = (images: SwellImage[]) => {\n if (!images || images.length < 1) {\n return [{ url: \"/\" }];\n }\n return images?.map(({ file, ...rest }: SwellImage) => ({\n url: file?.url + \"\",\n height: Number(file?.height),\n width: Number(file?.width),\n ...rest,\n }));\n};\n\nconst normalizeProductVariants = (\n variants: SwellVariant[],\n productOptions: swellProductOption[]\n) => {\n return variants?.map(\n ({ id, name, price, option_value_ids: optionValueIds = [] }) => {\n const values = name\n .split(\",\")\n .map((i) => ({ name: i.trim(), label: i.trim() }));\n\n const options = optionValueIds.map((id) => {\n const matchingOption = productOptions.find((option) => {\n return option.values.find(\n (value: SwellProductOptionValue) => value.id == id\n );\n });\n return normalizeProductOption({\n id,\n name: matchingOption?.name ?? \"\",\n values,\n });\n });\n\n return {\n id,\n name,\n // sku: sku ?? id,\n price: price ?? undefined,\n // listPrice: price ?? null,\n // requiresShipping: true,\n options,\n };\n }\n );\n};\n\nexport function normalizeProduct(swellProduct: SwellProduct): Product {\n const {\n id,\n name,\n description,\n images,\n options,\n slug,\n variants,\n price: value,\n currency: currencyCode,\n } = swellProduct;\n // ProductView accesses variants for each product\n const emptyVariants = [{ options: [], id, name: \"Default variant\" }];\n\n const productOptions = options\n ? options.map((o) => normalizeProductOption(o))\n : [];\n const productVariants = variants\n ? normalizeProductVariants(variants.results, options)\n : [];\n\n const productImages = normalizeProductImages(images);\n const product = {\n ...swellProduct,\n description,\n id,\n vendor: \"\",\n path: `/${slug}`,\n images: productImages,\n variants:\n productVariants && productVariants.length\n ? productVariants\n : emptyVariants,\n options: productOptions,\n price: {\n value,\n currencyCode,\n },\n };\n return product;\n}\n\nexport function normalizeCart({\n id,\n account_id,\n date_created,\n currency,\n tax_included_total,\n items,\n sub_total,\n grand_total,\n discounts,\n}: SwellCart) {\n const cart: Cart = {\n id: id,\n customerId: account_id + \"\",\n email: \"\",\n createdAt: date_created,\n currency: { code: currency },\n taxesIncluded: tax_included_total > 0,\n lineItems: items?.map(normalizeLineItem) ?? [],\n lineItemsSubtotalPrice: +sub_total,\n subtotalPrice: +sub_total,\n totalPrice: grand_total,\n discounts: discounts?.map((discount) => ({ value: discount.amount })),\n };\n return cart;\n}\n/*\nexport function normalizeCustomer(customer: SwellCustomer): Customer {\n const { first_name: firstName, last_name: lastName } = customer\n return {\n ...customer,\n firstName,\n lastName,\n }\n}\n*/\nfunction normalizeLineItem({\n id,\n product,\n price,\n variant,\n quantity,\n}: CartLineItem): LineItem {\n const item = {\n id,\n variantId: variant?.id,\n productId: product.id ?? \"\",\n name: product?.name ?? \"\",\n quantity,\n variant: {\n id: variant?.id ?? \"\",\n sku: variant?.sku ?? \"\",\n name: variant?.name!,\n image: {\n url:\n product?.images && product.images.length > 0\n ? product?.images[0].file.url\n : \"/\",\n },\n requiresShipping: false,\n price: price,\n listPrice: price,\n },\n path: \"\",\n discounts: [],\n options: [\n {\n value: variant?.name,\n },\n ],\n };\n return item;\n}\n\nexport function normalizeChildren(children: SwellCategoryChildren) {\n return children?.results.map((ch) => ch.id);\n}\n\nexport function normalizeCategory({\n id,\n name,\n slug,\n products,\n images,\n depth,\n children,\n parent_id,\n}: any): Category {\n return {\n id,\n name,\n slug,\n path: `/${slug}`,\n isEmpty: products?.length === 0,\n images: images?.map((image: any) => ({\n url: image.file.url,\n })),\n depth,\n children: normalizeChildren(children),\n parentId: parent_id,\n };\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport { CommerceError } from '@plasmicpkgs/commerce'\n\ntype SwellFetchResponse = {\n error: {\n message: string\n code?: string\n }\n}\n\nconst handleFetchResponse = async (res: SwellFetchResponse) => {\n if (res) {\n if (res.error) {\n throw new CommerceError(res.error)\n }\n return res\n }\n return null;\n}\n\nexport default handleFetchResponse\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport Cookies from 'js-cookie'\nimport { SWELL_CHECKOUT_ID_COOKIE } from '../const'\n\nconst getCheckoutId = (id?: string) => {\n return id ?? Cookies.get(SWELL_CHECKOUT_ID_COOKIE)\n}\n\nexport default getCheckoutId\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport { CommerceError } from '@plasmicpkgs/commerce'\nimport { CartType } from '@plasmicpkgs/commerce'\n\nimport {\n CheckoutLineItemsAddPayload,\n CheckoutLineItemsRemovePayload,\n CheckoutLineItemsUpdatePayload,\n Maybe,\n} from '../../schema'\nimport { normalizeCart } from '../../utils'\nexport type CheckoutPayload =\n | CheckoutLineItemsAddPayload\n | CheckoutLineItemsUpdatePayload\n | CheckoutLineItemsRemovePayload\n\nconst checkoutToCart = (checkoutPayload?: Maybe<CheckoutPayload>): CartType.Cart => {\n if (!checkoutPayload) {\n throw new CommerceError({\n message: 'Invalid response from Swell',\n })\n }\n return normalizeCart(checkoutPayload as any)\n}\n\nexport default checkoutToCart\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes:\n - Added sameSite and secure to the cookie options to allow third-party cookies.\n\t We need this to make work on the studio\n*/\nimport { SWELL_CHECKOUT_URL_COOKIE, SWELL_COOKIE_EXPIRE } from '../../const'\n\nimport Cookies from 'js-cookie'\n\nexport const checkoutCreate = async (fetch: any) => {\n const cart = await fetch({\n query: 'cart',\n method: 'get',\n })\n\n if (!cart) {\n await fetch({\n query: 'cart',\n method: 'setItems',\n variables: [[]],\n })\n }\n\n const checkoutUrl = cart?.checkout_url\n const options: Cookies.CookieAttributes = {\n expires: SWELL_COOKIE_EXPIRE,\n sameSite: \"none\",\n secure: true\n }\n if (checkoutUrl) {\n Cookies.set(SWELL_CHECKOUT_URL_COOKIE, checkoutUrl, options)\n }\n\n return cart\n}\n\nexport default checkoutCreate\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport { useCart, UseCart } from '@plasmicpkgs/commerce'\nimport { SWRHook } from '@plasmicpkgs/commerce'\nimport { useMemo } from 'react'\nimport { normalizeCart } from '../utils/normalize'\nimport { checkoutCreate, checkoutToCart } from './utils'\nimport type { CartType } from '@plasmicpkgs/commerce'\n\nexport default useCart as UseCart<typeof handler>\n\ntype GetCartHook = CartType.GetCartHook;\n\nexport const handler: SWRHook<GetCartHook> = {\n fetchOptions: {\n query: 'cart',\n method: 'get',\n },\n async fetcher({ fetch }) {\n const cart = await checkoutCreate(fetch)\n\n return cart ? normalizeCart(cart) : null\n },\n useHook:\n ({ useData }) =>\n (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n })\n return useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.lineItems.length ?? 0) <= 0\n },\n enumerable: true,\n },\n }),\n [response]\n )\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport type { MutationHook } from '@plasmicpkgs/commerce'\nimport { CommerceError } from '@plasmicpkgs/commerce'\nimport { useAddItem, UseAddItem } from '@plasmicpkgs/commerce'\nimport useCart from './use-cart'\nimport { checkoutToCart } from './utils'\nimport { getCheckoutId } from '../utils'\nimport { useCallback } from 'react'\nimport { AddItemHook } from '../types/cart'\n\nexport default useAddItem as UseAddItem<typeof handler>\n\nexport const handler: MutationHook<AddItemHook> = {\n fetchOptions: {\n query: 'cart',\n method: 'addItem',\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: 'The item quantity has to be a valid integer greater than 0',\n })\n }\n const variables: {\n product_id: string | undefined\n variant_id?: string\n checkoutId?: string\n quantity?: number\n } = {\n checkoutId: getCheckoutId(),\n product_id: item.productId,\n quantity: item.quantity,\n }\n if (item.productId !== item.variantId) {\n variables.variant_id = item.variantId\n }\n\n const response = await fetch({\n ...options,\n variables,\n })\n\n return checkoutToCart(response) as any\n },\n useHook:\n ({ fetch }) =>\n () => {\n const { mutate } = useCart()\n\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input })\n await mutate(data, false)\n return data\n },\n [fetch, mutate]\n )\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport type {\n HookFetcherContext,\n MutationHookContext,\n} from \"@plasmicpkgs/commerce\";\nimport { useCallback } from \"react\";\n\nimport { CartType, useRemoveItem, UseRemoveItem } from \"@plasmicpkgs/commerce\";\nimport useCart from \"./use-cart\";\nimport { checkoutToCart } from \"./utils\";\n\ntype Cart = CartType.Cart;\ntype LineItem = CartType.LineItem;\ntype RemoveItemHook = CartType.RemoveItemHook;\n\nexport type RemoveItemFn<T = any> = T extends LineItem\n ? (input?: RemoveItemActionInput<T>) => Promise<Cart | null | undefined>\n : (input: RemoveItemActionInput<T>) => Promise<Cart | null>;\n\nexport type RemoveItemActionInput<T = any> = T extends LineItem\n ? Partial<RemoveItemHook[\"actionInput\"]>\n : RemoveItemHook[\"actionInput\"];\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>;\n\nexport const handler = {\n fetchOptions: {\n query: \"cart\",\n method: \"removeItem\",\n },\n async fetcher({\n input: { itemId },\n options,\n fetch,\n }: HookFetcherContext<RemoveItemHook>) {\n const response = await fetch({ ...options, variables: [itemId] });\n\n return checkoutToCart(response);\n },\n useHook: ({ fetch }: MutationHookContext<RemoveItemHook>) => () => {\n const { mutate } = useCart();\n\n return useCallback(\n async function removeItem(input: { id: string }) {\n const data = await fetch({ input: { itemId: input.id } });\n await mutate(data, false);\n\n return data;\n },\n [fetch, mutate]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport type {\n HookFetcherContext,\n MutationHookContext,\n} from \"@plasmicpkgs/commerce\";\nimport { ValidationError } from \"@plasmicpkgs/commerce\";\nimport debounce from \"debounce\";\nimport { useCallback } from \"react\";\n// import useUpdateItem, {\n// UpdateItemInput as UpdateItemInputBase,\n// UseUpdateItem,\n// } from '@vercel/commerce/cart/use-update-item'\nimport { CartType, useUpdateItem, UseUpdateItem } from \"@plasmicpkgs/commerce\";\nimport { UpdateItemHook } from \"../types/cart\";\nimport useCart from \"./use-cart\";\nimport { handler as removeItemHandler } from \"./use-remove-item\";\nimport { checkoutToCart } from \"./utils\";\n// export type UpdateItemInput<T = any> = T extends LineItem\n// ? Partial<UpdateItemInputBase<LineItem>>\n// : UpdateItemInputBase<LineItem>\n\nexport default useUpdateItem as UseUpdateItem<typeof handler>;\n\ntype CartItemBody = CartType.CartItemBody;\ntype LineItem = CartType.LineItem;\n\nexport type UpdateItemActionInput<T = any> = T extends LineItem\n ? Partial<UpdateItemHook[\"actionInput\"]>\n : UpdateItemHook[\"actionInput\"];\n\nexport const handler = {\n fetchOptions: {\n query: \"cart\",\n method: \"updateItem\",\n },\n async fetcher({\n input: { itemId, item },\n options,\n fetch,\n }: HookFetcherContext<UpdateItemHook>) {\n if (Number.isInteger(item.quantity)) {\n // Also allow the update hook to remove an item if the quantity is lower than 1\n if (item.quantity! < 1) {\n return removeItemHandler.fetcher({\n options: removeItemHandler.fetchOptions,\n input: { itemId },\n fetch,\n });\n }\n } else if (item.quantity) {\n throw new ValidationError({\n message: \"The item quantity has to be a valid integer\",\n });\n }\n const response = await fetch({\n ...options,\n variables: [itemId, { quantity: item.quantity }],\n });\n\n return checkoutToCart(response);\n },\n useHook: ({ fetch }: MutationHookContext<UpdateItemHook>) => <\n T extends LineItem | undefined = undefined\n >(\n ctx: {\n item?: T;\n wait?: number;\n } = {}\n ) => {\n const { item } = ctx;\n const { mutate, data: cartData } = useCart() as any;\n\n return useCallback(\n debounce(async (input: UpdateItemActionInput) => {\n const firstLineItem = cartData.lineItems[0];\n const itemId = item?.id || firstLineItem.id;\n const productId = item?.productId || firstLineItem.productId;\n const variantId = item?.variant.id || firstLineItem.variant.id;\n if (!itemId || !productId) {\n throw new ValidationError({\n message: \"Invalid input used for this operation\",\n });\n }\n\n const data = await fetch({\n input: {\n item: {\n productId,\n variantId,\n quantity: input.quantity,\n },\n itemId,\n },\n });\n await mutate(data, false);\n return data;\n }, ctx.wait ?? 500),\n [fetch, mutate]\n );\n },\n};\n","export function ensure<T>(x: T | null | undefined, msg = \"\"): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(\n `Value must not be undefined or null${msg ? `- ${msg}` : \"\"}`\n );\n } else {\n return x;\n }\n}\n\nexport const ensureNoNilFields = (\n o: Record<string, any>\n): Record<string, any> =>\n Object.fromEntries(Object.entries(o).filter(([k, v]) => v != null));\n","import { Category } from \"../types/site\";\nimport { ensure } from \"./common\";\n\nexport const walkCategoryTree = (\n category?: Category,\n categories?: Category[]\n) => {\n if (!category || !categories) {\n return [];\n }\n\n const queue: Category[] = [category];\n const result: Category[] = [];\n while (queue.length > 0) {\n const curr = ensure(queue.shift());\n result.push(curr);\n queue.push(\n ...(curr.children?.map((child) =>\n ensure(\n categories.find((category) => category.id === child),\n \"The child category must always exist in the categories list\"\n )\n ) ?? [])\n );\n }\n return result;\n};\n\nexport const topologicalSortForCategoryTree = (categories: Category[]) => {\n return categories\n .filter((category) => !category.parentId)\n .flatMap((category) => walkCategoryTree(category, categories));\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: Added count as a parameter to input\n*/\nimport type { SearchProductsHook } from \"@plasmicpkgs/commerce\";\nimport {\n HookSWRInput,\n SWRHook,\n useSearch,\n UseSearch,\n} from \"@plasmicpkgs/commerce\";\nimport { SwellProduct } from \"../types\";\nimport { Category } from \"../types/site\";\nimport { normalizeProduct } from \"../utils\";\nimport { walkCategoryTree } from \"../utils/category-tree\";\nimport { ensureNoNilFields } from \"../utils/common\";\n\nexport type SearchProductsInput = {\n search?: string;\n categoryId?: string;\n brandId?: string;\n sort?: string;\n count?: number;\n includeSubCategories?: boolean;\n categories?: Category[];\n};\n\nconst useSearchTyped: UseSearch<typeof handler> = useSearch;\nexport default useSearchTyped;\n\nexport const handler: SWRHook<SearchProductsHook> = {\n fetchOptions: {\n query: \"products\",\n method: \"list\",\n },\n async fetcher({ input, options, fetch }) {\n const sortMap = new Map([\n [\"latest-desc\", \"\"],\n [\"price-asc\", \"price asc\"],\n [\"price-desc\", \"price desc\"],\n [\"trending-desc\", \"popularity\"],\n ]);\n const {\n categoryId,\n includeSubCategories,\n categories,\n brandId,\n search,\n sort = \"latest-desc\",\n count,\n } = input;\n const mappedSort = sortMap.get(sort);\n\n const includedCategories = includeSubCategories\n ? walkCategoryTree(\n categories?.find((category) => category.id === categoryId),\n categories\n )\n : undefined;\n\n const { results: products } = await fetch({\n query: options.query,\n method: options.method,\n variables: ensureNoNilFields({\n category: !includeSubCategories ? categoryId : undefined,\n brand: brandId,\n search,\n sort: mappedSort,\n expand: [\"variants\"],\n limit: count,\n $filters: {\n ...(includeSubCategories\n ? { category: includedCategories?.map((c) => c.id) }\n : {}),\n },\n }),\n });\n\n return {\n products: products.map((product: SwellProduct) =>\n normalizeProduct(product)\n ),\n found: products.length > 0,\n };\n },\n useHook:\n ({ useData }) =>\n (input = {}) => {\n return useData({\n input: [\n [\"search\", input.search],\n [\"categoryId\", input.categoryId],\n [\"includeSubCategories\", input.includeSubCategories],\n [\"categories\", input.categories],\n [\"brandId\", input.brandId],\n [\"sort\", input.sort],\n [\"count\", input.count],\n ] as HookSWRInput,\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { GetProductHook, SWRHook, UseProduct, useProduct } from '@plasmicpkgs/commerce'\nimport { normalizeProduct } from '../utils'\nimport { SwellProduct } from '../types'\n\nexport type GetProductInput = {\n id?: string;\n}\n\nexport default useProduct as UseProduct<typeof handler>\n\nexport const handler: SWRHook<GetProductHook> = {\n fetchOptions: {\n query: 'products',\n method: 'get',\n },\n async fetcher({ input, options, fetch }) {\n const { id } = input;\n const product = await fetch({\n query: options.query,\n method: options.method,\n variables: [id],\n });\n if (!product) {\n return null;\n }\n return normalizeProduct(product);\n },\n useHook:\n ({ useData }) =>\n (input = {}) => {\n return useData({\n input: [\n ['id', input.id],\n ],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n })\n },\n}\n","import {\n SiteTypes,\n SWRHook,\n useCategories,\n UseCategories,\n} from \"@plasmicpkgs/commerce\";\nimport { useMemo } from \"react\";\nimport { Category } from \"../types/site\";\nimport { normalizeCategory } from \"../utils\";\nimport { topologicalSortForCategoryTree } from \"../utils/category-tree\";\nimport { ensureNoNilFields } from \"../utils/common\";\n\nexport default useCategories as UseCategories<typeof handler>;\n\ntype GetCategoriesHook = SiteTypes.GetCategoriesHook;\n\nexport const handler: SWRHook<GetCategoriesHook> = {\n fetchOptions: {\n query: \"categories\",\n method: \"get\",\n },\n async fetcher({ input, options, fetch }) {\n const { addIsEmptyField, categoryId } = input;\n\n const data = await fetch({\n query: options.query,\n method: options.method,\n variables: ensureNoNilFields({\n expand: [\"children\", \"parent_id\"],\n id: categoryId,\n }),\n });\n\n let categories = data?.results ?? [];\n if (addIsEmptyField) {\n categories = await Promise.all(\n categories.map(async (category: any) => ({\n ...category,\n products: (\n await fetch({\n query: \"products\",\n method: \"list\",\n variables: ensureNoNilFields({\n limit: 1,\n category: category.id,\n }),\n })\n ).results,\n }))\n );\n }\n\n const normalizedCategories: Category[] = !categoryId\n ? topologicalSortForCategoryTree(categories.map(normalizeCategory))\n : categories.map(normalizeCategory);\n\n for (const category of normalizedCategories) {\n category.depth =\n (normalizedCategories.find((c) => c.id === category.parentId)?.depth ??\n -1) + 1;\n }\n return normalizedCategories;\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n input: [\n [\"addIsEmptyField\", input?.addIsEmptyField],\n [\"categoryId\", input?.categoryId],\n ],\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","import {\n SiteTypes,\n SWRHook,\n useBrands,\n UseBrands,\n} from \"@plasmicpkgs/commerce\";\nimport { useMemo } from \"react\";\n\nexport default useBrands as UseBrands<typeof handler>;\n\ntype GetBrandsHook = SiteTypes.GetBrandsHook;\n\nexport const handler: SWRHook<GetBrandsHook> = {\n fetchOptions: {\n query: \"attributes\",\n method: \"get\",\n },\n async fetcher({ fetch }) {\n const vendors: [string] =\n (\n await fetch({\n query: \"attributes\",\n method: \"get\",\n variables: \"brand\",\n })\n )?.values ?? [];\n return Array.from(new Set(vendors).values()).map((v) => ({\n entityId: v,\n name: v,\n path: `brands/${v}`,\n }));\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport { Fetcher } from '@plasmicpkgs/commerce'\nimport { CommerceError } from '@plasmicpkgs/commerce'\nimport { handleFetchResponse } from './utils'\nimport swell from './provider'\n\nconst fetcher: Fetcher = async ({ method = 'get', variables, query }) => {\n async function callSwell() {\n if (Array.isArray(variables)) {\n const arg1 = variables[0]\n const arg2 = variables[1]\n const response = await swell[query!][method](arg1, arg2)\n return handleFetchResponse(response)\n } else {\n const response = await swell[query!][method](variables)\n return handleFetchResponse(response)\n }\n }\n\n if (query && query in swell) {\n return await callSwell()\n } else {\n throw new CommerceError({ message: 'Invalid query argument!' })\n }\n}\n\nexport default fetcher\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: Added storeId and publicKey parameters\n*/\n// @ts-ignore\nimport swell from 'swell-js'\n\nimport { CommerceExtraFeatures, Provider } from '@plasmicpkgs/commerce'\nimport { SWELL_CHECKOUT_ID_COOKIE } from './const'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useProduct } from './product/use-product'\nimport { handler as useCategories } from \"./site/use-categories\"\nimport { handler as useBrands } from \"./site/use-brands\"\nimport fetcher from './fetcher'\nimport { Fetcher } from '@plasmicpkgs/commerce'\n\nexport const getSwellProvider = (storeId: string, publicKey: string) => {\n swell.init(storeId, publicKey);\n\n return {\n locale: 'en-us',\n cartCookie: SWELL_CHECKOUT_ID_COOKIE,\n swell,\n fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch, useProduct },\n site: { useCategories, useBrands },\n extraFeatures: { \n includeSubCategories: true\n }\n }\n}\n\nexport type SwellProvider = {\n locale: string;\n cartCookie: string;\n fetcher: Fetcher;\n cart: {\n useCart: typeof useCart;\n useAddItem: typeof useAddItem;\n useUpdateItem: typeof useUpdateItem;\n useRemoveItem: typeof useRemoveItem\n };\n products: {\n useSearch: typeof useSearch\n };\n site: {\n useCategories: typeof useCategories\n useBrands: typeof useBrands\n };\n extraFeatures: CommerceExtraFeatures\n swell: any\n}\n\nexport default swell;","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport {\n CommerceAPIConfig,\n getCommerceProvider as getCoreCommerceProvider,\n useCommerce as useCoreCommerce,\n} from '@plasmicpkgs/commerce'\nimport { SWELL_CHECKOUT_ID_COOKIE, SWELL_COOKIE_EXPIRE, SWELL_CUSTOMER_TOKEN_COOKIE } from './const'\nimport { getSwellProvider, SwellProvider } from './provider'\nimport fetchApi from './utils/fetch-swell-api'\n\nexport type { SwellProvider }\n\nexport const getCommerceProvider = (storeId: string, publicKey: string) => \n getCoreCommerceProvider(getSwellProvider(storeId, publicKey))\n\nexport const useCommerce = () => useCoreCommerce<SwellProvider>()\n\n\nexport interface SwellConfig extends CommerceAPIConfig {\n fetch: any\n}\n\nconst config: SwellConfig = {\n locale: 'en-US',\n commerceUrl: '',\n apiToken: ''!,\n cartCookie: SWELL_CHECKOUT_ID_COOKIE,\n cartCookieMaxAge: SWELL_COOKIE_EXPIRE,\n fetch: fetchApi,\n customerCookie: SWELL_CUSTOMER_TOKEN_COOKIE,\n}\n","import { GlobalContextMeta } from \"@plasmicapp/host\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport React from \"react\";\nimport { Registerable } from \"./registerable\";\nimport { getCommerceProvider } from \"./swell\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n storeId: string;\n publicKey: string;\n}\nexport const commerceProviderMeta: GlobalContextMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-swell-provider\",\n displayName: \"Swell Provider\",\n props: {\n storeId: {\n type: \"string\",\n defaultValue: \"plasmic-sandbox\",\n },\n publicKey: {\n type: \"string\",\n defaultValue: \"pk_QaZeGhtpQaVbNQnWJdRlE1abE6Ezf9U9\",\n },\n },\n description: `Get your store ID and public storefront API key from the Swell admin UI under Developer > API Keys.\n\n[Watch how to use this integration](https://www.youtube.com/watch?v=b2mgOTbP2_8).`,\n importPath: \"@plasmicpkgs/commerce-swell\",\n importName: \"CommerceProviderComponent\",\n};\n\nexport function CommerceProviderComponent(props: CommerceProviderProps) {\n const { storeId, publicKey, children } = props;\n\n const CommerceProvider = React.useMemo(\n () => getCommerceProvider(storeId, publicKey),\n [storeId, publicKey]\n );\n\n return <CommerceProvider>{children}</CommerceProvider>;\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: GlobalContextMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerGlobalContext = (...args) =>\n loader\n ? loader.registerGlobalContext(...args)\n : registerGlobalContext(...args);\n doRegisterComponent(\n CommerceProviderComponent,\n customCommerceProviderMeta ?? commerceProviderMeta\n );\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\nexport * from \"./registerCommerceProvider\";\nexport * from \"./swell\";\nexport { registerCommerceProvider };\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n"],"names":["SWELL_CHECKOUT_ID_COOKIE","SWELL_CHECKOUT_URL_COOKIE","SWELL_COOKIE_EXPIRE","runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","undefined","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","makeInvokeMethod","tryCatch","fn","arg","type","call","GenStateSuspendedStart","GenStateSuspendedYield","GenStateExecuting","GenStateCompleted","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","displayName","defineIteratorMethods","forEach","method","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","__await","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","then","unwrapped","error","previousPromise","enqueue","callInvokeWithMethodAndArg","async","Promise","iter","next","done","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","info","resultName","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","keys","object","reverse","length","pop","iterable","iteratorMethod","isNaN","i","skipTempReset","prev","charAt","slice","stop","rootEntry","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","normalizeProductOption","id","returnValues","map","output","label","match","hexColors","__typename","normalizeProductImages","images","url","file","rest","height","Number","width","normalizeProductVariants","variants","productOptions","price","option_value_ids","optionValueIds","split","trim","options","matchingOption","find","option","normalizeProduct","swellProduct","description","slug","currencyCode","currency","emptyVariants","o","productVariants","results","productImages","product","vendor","path","normalizeCart","account_id","date_created","tax_included_total","items","sub_total","grand_total","discounts","cart","customerId","email","createdAt","code","taxesIncluded","lineItems","normalizeLineItem","lineItemsSubtotalPrice","subtotalPrice","totalPrice","discount","amount","variant","quantity","item","variantId","productId","sku","image","requiresShipping","listPrice","normalizeChildren","children","ch","normalizeCategory","products","depth","parent_id","isEmpty","parentId","handleFetchResponse","res","CommerceError","getCheckoutId","Cookies","get","checkoutToCart","checkoutPayload","message","checkoutCreate","fetch","query","variables","checkoutUrl","checkout_url","expires","sameSite","secure","set","handler","fetchOptions","fetcher","useHook","useData","input","response","swrOptions","revalidateOnFocus","useMemo","data","isInteger","checkoutId","product_id","variant_id","useCart","mutate","useCallback","addItem","itemId","removeItem","removeItemHandler","ValidationError","ctx","cartData","debounce","firstLineItem","wait","ensure","x","msg","ensureNoNilFields","fromEntries","entries","filter","v","walkCategoryTree","category","categories","queue","curr","shift","child","topologicalSortForCategoryTree","flatMap","sortMap","Map","categoryId","includeSubCategories","brandId","search","sort","count","mappedSort","includedCategories","brand","expand","limit","$filters","c","found","addIsEmptyField","all","normalizedCategories","vendors","Array","from","Set","entityId","callSwell","isArray","arg1","arg2","swell","getSwellProvider","storeId","publicKey","init","locale","cartCookie","useAddItem","useUpdateItem","useRemoveItem","useSearch","useProduct","site","useCategories","useBrands","extraFeatures","getCommerceProvider","getCoreCommerceProvider","useCommerce","useCoreCommerce","commerceProviderMeta","props","defaultValue","importPath","importName","CommerceProviderComponent","CommerceProvider","React","registerCommerceProvider","loader","customCommerceProviderMeta","doRegisterComponent","registerGlobalContext","registerAll"],"mappings":";;;;;;;;;;;;;;AAAA;;;;AAIO,IAAMA,wBAAwB,GAAG,kBAAkB;AAEnD,IAAMC,yBAAyB,GAAG,mBAAmB;AAIrD,IAAMC,mBAAmB,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACTrC;AACA;AACA;AACA;AACA;;EAEA,IAAIC,OAAO,GAAI,UAAUC,OAAO,EAAE;;IAGhC,IAAIC,EAAE,GAAGC,MAAM,CAACC,SAAS;IACzB,IAAIC,MAAM,GAAGH,EAAE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AAK,CAAtCnB,OAAO;IAAEC,SAAS,GAAekB,KAAK,CAA7BlB,SAAS;IAAEvG,QAAQ,GAAKyH,KAAK,CAAlBzH,QAAQ;EAEpC,IAAM8H,gBAAgB,GAAGC,cAAK,CAAC3F,OAAO,CACpC;IAAA,OAAMgF,mBAAmB,CAACd,OAAO,EAAEC,SAAS,CAAC;KAC7C,CAACD,OAAO,EAAEC,SAAS,CAAC,CACrB;EAED,OAAOwB,6BAACD,gBAAgB,QAAE9H,QAAQ,CAAoB;AACxD;AAEA,SAAgBgI,wBAAwB,CACtCC,MAAqB,EACrBC,0BAAqE;EAErE,IAAMC,mBAAmB,GAAiC,SAApDA,mBAAmB;IAAA,OACvBF,MAAM,GACFA,MAAM,CAACG,qBAAqB,OAA5BH,MAAM,YAA+B,GACrCG,qBAAqB,yBAAS;;EACpCD,mBAAmB,CACjBN,yBAAyB,EACzBK,0BAA0B,WAA1BA,0BAA0B,GAAIV,oBAAoB,CACnD;AACH;;SC/CgBa,WAAW,CAACJ,MAAqB;EAC/CD,wBAAwB,CAACC,MAAM,CAAC;AAClC;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"commerce-swell.cjs.development.js","sources":["../src/const.ts","../../../../node_modules/regenerator-runtime/runtime.js","../src/utils/normalize.ts","../src/utils/handle-fetch-response.ts","../src/utils/get-checkout-id.ts","../src/cart/utils/checkout-to-cart.ts","../src/cart/utils/checkout-create.ts","../src/cart/use-cart.tsx","../src/cart/use-add-item.tsx","../src/cart/use-remove-item.tsx","../src/cart/use-update-item.tsx","../src/utils/common.ts","../src/utils/category-tree.ts","../src/product/use-search.tsx","../src/product/use-product.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/fetcher.ts","../src/provider.ts","../src/swell.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: Removed store id and public key\n*/\nexport const SWELL_CHECKOUT_ID_COOKIE = 'SWELL_checkoutId'\n\nexport const SWELL_CHECKOUT_URL_COOKIE = 'swell_checkoutUrl'\n\nexport const SWELL_CUSTOMER_TOKEN_COOKIE = 'swell_customerToken'\n\nexport const SWELL_COOKIE_EXPIRE = 30\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: Added \"Default Variant\" to default title when there's no product variant\n*/\nimport { MoneyV2 } from \"../schema\";\nimport type {\n Cart,\n CartLineItem,\n LineItem,\n ProductOptionValue,\n SwellCart,\n SwellImage,\n SwellProduct,\n SwellProductOptionValue,\n SwellVariant,\n} from \"../types\";\nimport { Product, ProductOption } from \"../types/product\";\nimport { Category, SwellCategoryChildren } from \"../types/site\";\n\nconst money = ({ amount, currencyCode }: MoneyV2) => {\n return {\n value: +amount,\n currencyCode,\n };\n};\n\ntype swellProductOption = {\n id: string;\n name: string;\n values: any[];\n};\n\ntype normalizedProductOption = {\n id: string;\n displayName: string;\n values: ProductOptionValue[];\n};\n\nconst normalizeProductOption = ({\n id,\n name: displayName = \"\",\n values = [],\n}: swellProductOption): ProductOption => {\n let returnValues = values.map((value) => {\n let output: any = {\n label: value.name,\n // id: value?.id || id,\n };\n if (displayName.match(/colou?r/gi)) {\n output = {\n ...output,\n hexColors: [value.name],\n };\n }\n return output;\n });\n return {\n __typename: \"MultipleChoiceOption\",\n id,\n displayName,\n values: returnValues,\n };\n};\n\nconst normalizeProductImages = (images: SwellImage[]) => {\n if (!images || images.length < 1) {\n return [{ url: \"/\" }];\n }\n return images?.map(({ file, ...rest }: SwellImage) => ({\n url: file?.url + \"\",\n height: Number(file?.height),\n width: Number(file?.width),\n ...rest,\n }));\n};\n\nconst normalizeProductVariants = (\n variants: SwellVariant[],\n productOptions: swellProductOption[]\n) => {\n return variants?.map(\n ({ id, name, price, option_value_ids: optionValueIds = [] }) => {\n const values = name\n .split(\",\")\n .map((i) => ({ name: i.trim(), label: i.trim() }));\n\n const options = optionValueIds.map((id) => {\n const matchingOption = productOptions.find((option) => {\n return option.values.find(\n (value: SwellProductOptionValue) => value.id == id\n );\n });\n return normalizeProductOption({\n id,\n name: matchingOption?.name ?? \"\",\n values,\n });\n });\n\n return {\n id,\n name,\n // sku: sku ?? id,\n price: price ?? undefined,\n // listPrice: price ?? null,\n // requiresShipping: true,\n options,\n };\n }\n );\n};\n\nexport function normalizeProduct(swellProduct: SwellProduct): Product {\n const {\n id,\n name,\n description,\n images,\n options,\n slug,\n variants,\n price: value,\n currency: currencyCode,\n } = swellProduct;\n // ProductView accesses variants for each product\n const emptyVariants = [{ options: [], id, name: \"Default variant\" }];\n\n const productOptions = options\n ? options.map((o) => normalizeProductOption(o))\n : [];\n const productVariants = variants\n ? normalizeProductVariants(variants.results, options)\n : [];\n\n const productImages = normalizeProductImages(images);\n const product = {\n ...swellProduct,\n description,\n id,\n vendor: \"\",\n path: `/${slug}`,\n images: productImages,\n variants:\n productVariants && productVariants.length\n ? productVariants\n : emptyVariants,\n options: productOptions,\n price: {\n value,\n currencyCode,\n },\n };\n return product;\n}\n\nexport function normalizeCart({\n id,\n account_id,\n date_created,\n currency,\n tax_included_total,\n items,\n sub_total,\n grand_total,\n discounts,\n}: SwellCart) {\n const cart: Cart = {\n id: id,\n customerId: account_id + \"\",\n email: \"\",\n createdAt: date_created,\n currency: { code: currency },\n taxesIncluded: tax_included_total > 0,\n lineItems: items?.map(normalizeLineItem) ?? [],\n lineItemsSubtotalPrice: +sub_total,\n subtotalPrice: +sub_total,\n totalPrice: grand_total,\n discounts: discounts?.map((discount) => ({ value: discount.amount })),\n };\n return cart;\n}\n/*\nexport function normalizeCustomer(customer: SwellCustomer): Customer {\n const { first_name: firstName, last_name: lastName } = customer\n return {\n ...customer,\n firstName,\n lastName,\n }\n}\n*/\nfunction normalizeLineItem({\n id,\n product,\n price,\n variant,\n quantity,\n}: CartLineItem): LineItem {\n const item = {\n id,\n variantId: variant?.id,\n productId: product.id ?? \"\",\n name: product?.name ?? \"\",\n quantity,\n variant: {\n id: variant?.id ?? \"\",\n sku: variant?.sku ?? \"\",\n name: variant?.name!,\n image: {\n url:\n product?.images && product.images.length > 0\n ? product?.images[0].file.url\n : \"/\",\n },\n requiresShipping: false,\n price: price,\n listPrice: price,\n },\n path: \"\",\n discounts: [],\n options: [\n {\n value: variant?.name,\n },\n ],\n };\n return item;\n}\n\nexport function normalizeChildren(children: SwellCategoryChildren) {\n return children?.results.map((ch) => ch.id);\n}\n\nexport function normalizeCategory({\n id,\n name,\n slug,\n products,\n images,\n depth,\n children,\n parent_id,\n}: any): Category {\n return {\n id,\n name,\n slug,\n path: `/${slug}`,\n isEmpty: products?.length === 0,\n images: images?.map((image: any) => ({\n url: image.file.url,\n })),\n depth,\n children: normalizeChildren(children),\n parentId: parent_id,\n };\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport { CommerceError } from '@plasmicpkgs/commerce'\n\ntype SwellFetchResponse = {\n error: {\n message: string\n code?: string\n }\n}\n\nconst handleFetchResponse = async (res: SwellFetchResponse) => {\n if (res) {\n if (res.error) {\n throw new CommerceError(res.error)\n }\n return res\n }\n return null;\n}\n\nexport default handleFetchResponse\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport Cookies from 'js-cookie'\nimport { SWELL_CHECKOUT_ID_COOKIE } from '../const'\n\nconst getCheckoutId = (id?: string) => {\n return id ?? Cookies.get(SWELL_CHECKOUT_ID_COOKIE)\n}\n\nexport default getCheckoutId\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport { CommerceError } from '@plasmicpkgs/commerce'\nimport { CartType } from '@plasmicpkgs/commerce'\n\nimport {\n CheckoutLineItemsAddPayload,\n CheckoutLineItemsRemovePayload,\n CheckoutLineItemsUpdatePayload,\n Maybe,\n} from '../../schema'\nimport { normalizeCart } from '../../utils'\nexport type CheckoutPayload =\n | CheckoutLineItemsAddPayload\n | CheckoutLineItemsUpdatePayload\n | CheckoutLineItemsRemovePayload\n\nconst checkoutToCart = (checkoutPayload?: Maybe<CheckoutPayload>): CartType.Cart => {\n if (!checkoutPayload) {\n throw new CommerceError({\n message: 'Invalid response from Swell',\n })\n }\n return normalizeCart(checkoutPayload as any)\n}\n\nexport default checkoutToCart\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes:\n - Added sameSite and secure to the cookie options to allow third-party cookies.\n\t We need this to make work on the studio\n*/\nimport { SWELL_CHECKOUT_URL_COOKIE, SWELL_COOKIE_EXPIRE } from '../../const'\n\nimport Cookies from 'js-cookie'\n\nexport const checkoutCreate = async (fetch: any) => {\n const cart = await fetch({\n query: 'cart',\n method: 'get',\n })\n\n if (!cart) {\n await fetch({\n query: 'cart',\n method: 'setItems',\n variables: [[]],\n })\n }\n\n const checkoutUrl = cart?.checkout_url\n const options: Cookies.CookieAttributes = {\n expires: SWELL_COOKIE_EXPIRE,\n sameSite: \"none\",\n secure: true\n }\n if (checkoutUrl) {\n Cookies.set(SWELL_CHECKOUT_URL_COOKIE, checkoutUrl, options)\n }\n\n return cart\n}\n\nexport default checkoutCreate\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport { useCart, UseCart } from '@plasmicpkgs/commerce'\nimport { SWRHook } from '@plasmicpkgs/commerce'\nimport { useMemo } from 'react'\nimport { normalizeCart } from '../utils/normalize'\nimport { checkoutCreate, checkoutToCart } from './utils'\nimport type { CartType } from '@plasmicpkgs/commerce'\n\nexport default useCart as UseCart<typeof handler>\n\ntype GetCartHook = CartType.GetCartHook;\n\nexport const handler: SWRHook<GetCartHook> = {\n fetchOptions: {\n query: 'cart',\n method: 'get',\n },\n async fetcher({ fetch }) {\n const cart = await checkoutCreate(fetch)\n\n return cart ? normalizeCart(cart) : null\n },\n useHook:\n ({ useData }) =>\n (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n })\n return useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.lineItems.length ?? 0) <= 0\n },\n enumerable: true,\n },\n }),\n [response]\n )\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport type { MutationHook } from '@plasmicpkgs/commerce'\nimport { CommerceError } from '@plasmicpkgs/commerce'\nimport { useAddItem, UseAddItem } from '@plasmicpkgs/commerce'\nimport useCart from './use-cart'\nimport { checkoutToCart } from './utils'\nimport { getCheckoutId } from '../utils'\nimport { useCallback } from 'react'\nimport { AddItemHook } from '../types/cart'\n\nexport default useAddItem as UseAddItem<typeof handler>\n\nexport const handler: MutationHook<AddItemHook> = {\n fetchOptions: {\n query: 'cart',\n method: 'addItem',\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: 'The item quantity has to be a valid integer greater than 0',\n })\n }\n const variables: {\n product_id: string | undefined\n variant_id?: string\n checkoutId?: string\n quantity?: number\n } = {\n checkoutId: getCheckoutId(),\n product_id: item.productId,\n quantity: item.quantity,\n }\n if (item.productId !== item.variantId) {\n variables.variant_id = item.variantId\n }\n\n const response = await fetch({\n ...options,\n variables,\n })\n\n return checkoutToCart(response) as any\n },\n useHook:\n ({ fetch }) =>\n () => {\n const { mutate } = useCart()\n\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input })\n await mutate(data, false)\n return data\n },\n [fetch, mutate]\n )\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport type {\n HookFetcherContext,\n MutationHookContext,\n} from \"@plasmicpkgs/commerce\";\nimport { useCallback } from \"react\";\n\nimport { CartType, useRemoveItem, UseRemoveItem } from \"@plasmicpkgs/commerce\";\nimport useCart from \"./use-cart\";\nimport { checkoutToCart } from \"./utils\";\n\ntype Cart = CartType.Cart;\ntype LineItem = CartType.LineItem;\ntype RemoveItemHook = CartType.RemoveItemHook;\n\nexport type RemoveItemFn<T = any> = T extends LineItem\n ? (input?: RemoveItemActionInput<T>) => Promise<Cart | null | undefined>\n : (input: RemoveItemActionInput<T>) => Promise<Cart | null>;\n\nexport type RemoveItemActionInput<T = any> = T extends LineItem\n ? Partial<RemoveItemHook[\"actionInput\"]>\n : RemoveItemHook[\"actionInput\"];\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>;\n\nexport const handler = {\n fetchOptions: {\n query: \"cart\",\n method: \"removeItem\",\n },\n async fetcher({\n input: { itemId },\n options,\n fetch,\n }: HookFetcherContext<RemoveItemHook>) {\n const response = await fetch({ ...options, variables: [itemId] });\n\n return checkoutToCart(response);\n },\n useHook: ({ fetch }: MutationHookContext<RemoveItemHook>) => () => {\n const { mutate } = useCart();\n\n return useCallback(\n async function removeItem(input: { id: string }) {\n const data = await fetch({ input: { itemId: input.id } });\n await mutate(data, false);\n\n return data;\n },\n [fetch, mutate]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport type {\n HookFetcherContext,\n MutationHookContext,\n} from \"@plasmicpkgs/commerce\";\nimport { ValidationError } from \"@plasmicpkgs/commerce\";\nimport debounce from \"debounce\";\nimport { useCallback } from \"react\";\n// import useUpdateItem, {\n// UpdateItemInput as UpdateItemInputBase,\n// UseUpdateItem,\n// } from '@vercel/commerce/cart/use-update-item'\nimport { CartType, useUpdateItem, UseUpdateItem } from \"@plasmicpkgs/commerce\";\nimport { UpdateItemHook } from \"../types/cart\";\nimport useCart from \"./use-cart\";\nimport { handler as removeItemHandler } from \"./use-remove-item\";\nimport { checkoutToCart } from \"./utils\";\n// export type UpdateItemInput<T = any> = T extends LineItem\n// ? Partial<UpdateItemInputBase<LineItem>>\n// : UpdateItemInputBase<LineItem>\n\nexport default useUpdateItem as UseUpdateItem<typeof handler>;\n\ntype CartItemBody = CartType.CartItemBody;\ntype LineItem = CartType.LineItem;\n\nexport type UpdateItemActionInput<T = any> = T extends LineItem\n ? Partial<UpdateItemHook[\"actionInput\"]>\n : UpdateItemHook[\"actionInput\"];\n\nexport const handler = {\n fetchOptions: {\n query: \"cart\",\n method: \"updateItem\",\n },\n async fetcher({\n input: { itemId, item },\n options,\n fetch,\n }: HookFetcherContext<UpdateItemHook>) {\n if (Number.isInteger(item.quantity)) {\n // Also allow the update hook to remove an item if the quantity is lower than 1\n if (item.quantity! < 1) {\n return removeItemHandler.fetcher({\n options: removeItemHandler.fetchOptions,\n input: { itemId },\n fetch,\n });\n }\n } else if (item.quantity) {\n throw new ValidationError({\n message: \"The item quantity has to be a valid integer\",\n });\n }\n const response = await fetch({\n ...options,\n variables: [itemId, { quantity: item.quantity }],\n });\n\n return checkoutToCart(response);\n },\n useHook:\n ({ fetch }: MutationHookContext<UpdateItemHook>) =>\n <T extends LineItem | undefined = undefined>(\n ctx: {\n item?: T;\n wait?: number;\n } = {}\n ) => {\n const { item } = ctx;\n const { mutate, data: cartData } = useCart() as any;\n\n return useCallback(\n debounce(async (input: UpdateItemActionInput) => {\n const itemId = input.id ?? item?.id;\n if (!itemId) {\n throw new ValidationError({\n message: \"Invalid input used for this operation\",\n });\n }\n\n const data = await fetch({\n input: {\n item: {\n quantity: input.quantity,\n },\n itemId,\n },\n });\n await mutate(data, false);\n return data;\n }, ctx.wait ?? 500),\n [fetch, mutate]\n );\n },\n};\n","export function ensure<T>(x: T | null | undefined, msg = \"\"): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(\n `Value must not be undefined or null${msg ? `- ${msg}` : \"\"}`\n );\n } else {\n return x;\n }\n}\n\nexport const ensureNoNilFields = (\n o: Record<string, any>\n): Record<string, any> =>\n Object.fromEntries(Object.entries(o).filter(([k, v]) => v != null));\n","import { Category } from \"../types/site\";\nimport { ensure } from \"./common\";\n\nexport const walkCategoryTree = (\n category?: Category,\n categories?: Category[]\n) => {\n if (!category || !categories) {\n return [];\n }\n\n const queue: Category[] = [category];\n const result: Category[] = [];\n while (queue.length > 0) {\n const curr = ensure(queue.shift());\n result.push(curr);\n queue.push(\n ...(curr.children?.map((child) =>\n ensure(\n categories.find((category) => category.id === child),\n \"The child category must always exist in the categories list\"\n )\n ) ?? [])\n );\n }\n return result;\n};\n\nexport const topologicalSortForCategoryTree = (categories: Category[]) => {\n return categories\n .filter((category) => !category.parentId)\n .flatMap((category) => walkCategoryTree(category, categories));\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: Added count as a parameter to input\n*/\nimport type { SearchProductsHook } from \"@plasmicpkgs/commerce\";\nimport {\n HookSWRInput,\n SWRHook,\n useSearch,\n UseSearch,\n} from \"@plasmicpkgs/commerce\";\nimport { SwellProduct } from \"../types\";\nimport { Category } from \"../types/site\";\nimport { normalizeProduct } from \"../utils\";\nimport { walkCategoryTree } from \"../utils/category-tree\";\nimport { ensureNoNilFields } from \"../utils/common\";\n\nexport type SearchProductsInput = {\n search?: string;\n categoryId?: string;\n brandId?: string;\n sort?: string;\n count?: number;\n includeSubCategories?: boolean;\n categories?: Category[];\n};\n\nconst useSearchTyped: UseSearch<typeof handler> = useSearch;\nexport default useSearchTyped;\n\nexport const handler: SWRHook<SearchProductsHook> = {\n fetchOptions: {\n query: \"products\",\n method: \"list\",\n },\n async fetcher({ input, options, fetch }) {\n const sortMap = new Map([\n [\"latest-desc\", \"\"],\n [\"price-asc\", \"price asc\"],\n [\"price-desc\", \"price desc\"],\n [\"trending-desc\", \"popularity\"],\n ]);\n const {\n categoryId,\n includeSubCategories,\n categories,\n brandId,\n search,\n sort = \"latest-desc\",\n count,\n } = input;\n const mappedSort = sortMap.get(sort);\n\n const includedCategories = includeSubCategories\n ? walkCategoryTree(\n categories?.find((category) => category.id === categoryId),\n categories\n )\n : undefined;\n\n const { results: products } = await fetch({\n query: options.query,\n method: options.method,\n variables: ensureNoNilFields({\n category: !includeSubCategories ? categoryId : undefined,\n brand: brandId,\n search,\n sort: mappedSort,\n expand: [\"variants\"],\n limit: count,\n $filters: {\n ...(includeSubCategories\n ? { category: includedCategories?.map((c) => c.id) }\n : {}),\n },\n }),\n });\n\n return {\n products: products.map((product: SwellProduct) =>\n normalizeProduct(product)\n ),\n found: products.length > 0,\n };\n },\n useHook:\n ({ useData }) =>\n (input = {}) => {\n return useData({\n input: [\n [\"search\", input.search],\n [\"categoryId\", input.categoryId],\n [\"includeSubCategories\", input.includeSubCategories],\n [\"categories\", input.categories],\n [\"brandId\", input.brandId],\n [\"sort\", input.sort],\n [\"count\", input.count],\n ] as HookSWRInput,\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { GetProductHook, SWRHook, UseProduct, useProduct } from '@plasmicpkgs/commerce'\nimport { normalizeProduct } from '../utils'\nimport { SwellProduct } from '../types'\n\nexport type GetProductInput = {\n id?: string;\n}\n\nexport default useProduct as UseProduct<typeof handler>\n\nexport const handler: SWRHook<GetProductHook> = {\n fetchOptions: {\n query: 'products',\n method: 'get',\n },\n async fetcher({ input, options, fetch }) {\n const { id } = input;\n const product = await fetch({\n query: options.query,\n method: options.method,\n variables: [id],\n });\n if (!product) {\n return null;\n }\n return normalizeProduct(product);\n },\n useHook:\n ({ useData }) =>\n (input = {}) => {\n return useData({\n input: [\n ['id', input.id],\n ],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n })\n },\n}\n","import {\n SiteTypes,\n SWRHook,\n useCategories,\n UseCategories,\n} from \"@plasmicpkgs/commerce\";\nimport { useMemo } from \"react\";\nimport { Category } from \"../types/site\";\nimport { normalizeCategory } from \"../utils\";\nimport { topologicalSortForCategoryTree } from \"../utils/category-tree\";\nimport { ensureNoNilFields } from \"../utils/common\";\n\nexport default useCategories as UseCategories<typeof handler>;\n\ntype GetCategoriesHook = SiteTypes.GetCategoriesHook;\n\nexport const handler: SWRHook<GetCategoriesHook> = {\n fetchOptions: {\n query: \"categories\",\n method: \"get\",\n },\n async fetcher({ input, options, fetch }) {\n const { addIsEmptyField, categoryId } = input;\n\n const data = await fetch({\n query: options.query,\n method: options.method,\n variables: ensureNoNilFields({\n expand: [\"children\", \"parent_id\"],\n id: categoryId,\n }),\n });\n\n let categories = data?.results ?? [];\n if (addIsEmptyField) {\n categories = await Promise.all(\n categories.map(async (category: any) => ({\n ...category,\n products: (\n await fetch({\n query: \"products\",\n method: \"list\",\n variables: ensureNoNilFields({\n limit: 1,\n category: category.id,\n }),\n })\n ).results,\n }))\n );\n }\n\n const normalizedCategories: Category[] = !categoryId\n ? topologicalSortForCategoryTree(categories.map(normalizeCategory))\n : categories.map(normalizeCategory);\n\n for (const category of normalizedCategories) {\n category.depth =\n (normalizedCategories.find((c) => c.id === category.parentId)?.depth ??\n -1) + 1;\n }\n return normalizedCategories;\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n input: [\n [\"addIsEmptyField\", input?.addIsEmptyField],\n [\"categoryId\", input?.categoryId],\n ],\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","import {\n SiteTypes,\n SWRHook,\n useBrands,\n UseBrands,\n} from \"@plasmicpkgs/commerce\";\nimport { useMemo } from \"react\";\n\nexport default useBrands as UseBrands<typeof handler>;\n\ntype GetBrandsHook = SiteTypes.GetBrandsHook;\n\nexport const handler: SWRHook<GetBrandsHook> = {\n fetchOptions: {\n query: \"attributes\",\n method: \"get\",\n },\n async fetcher({ fetch }) {\n const vendors: [string] =\n (\n await fetch({\n query: \"attributes\",\n method: \"get\",\n variables: \"brand\",\n })\n )?.values ?? [];\n return Array.from(new Set(vendors).values()).map((v) => ({\n entityId: v,\n name: v,\n path: `brands/${v}`,\n }));\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport { Fetcher } from '@plasmicpkgs/commerce'\nimport { CommerceError } from '@plasmicpkgs/commerce'\nimport { handleFetchResponse } from './utils'\nimport swell from './provider'\n\nconst fetcher: Fetcher = async ({ method = 'get', variables, query }) => {\n async function callSwell() {\n if (Array.isArray(variables)) {\n const arg1 = variables[0]\n const arg2 = variables[1]\n const response = await swell[query!][method](arg1, arg2)\n return handleFetchResponse(response)\n } else {\n const response = await swell[query!][method](variables)\n return handleFetchResponse(response)\n }\n }\n\n if (query && query in swell) {\n return await callSwell()\n } else {\n throw new CommerceError({ message: 'Invalid query argument!' })\n }\n}\n\nexport default fetcher\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: Added storeId and publicKey parameters\n*/\n// @ts-ignore\nimport swell from 'swell-js'\n\nimport { CommerceExtraFeatures, Provider } from '@plasmicpkgs/commerce'\nimport { SWELL_CHECKOUT_ID_COOKIE } from './const'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useProduct } from './product/use-product'\nimport { handler as useCategories } from \"./site/use-categories\"\nimport { handler as useBrands } from \"./site/use-brands\"\nimport fetcher from './fetcher'\nimport { Fetcher } from '@plasmicpkgs/commerce'\n\nexport const getSwellProvider = (storeId: string, publicKey: string) => {\n swell.init(storeId, publicKey);\n\n return {\n locale: 'en-us',\n cartCookie: SWELL_CHECKOUT_ID_COOKIE,\n swell,\n fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch, useProduct },\n site: { useCategories, useBrands },\n extraFeatures: { \n includeSubCategories: true\n }\n }\n}\n\nexport type SwellProvider = {\n locale: string;\n cartCookie: string;\n fetcher: Fetcher;\n cart: {\n useCart: typeof useCart;\n useAddItem: typeof useAddItem;\n useUpdateItem: typeof useUpdateItem;\n useRemoveItem: typeof useRemoveItem\n };\n products: {\n useSearch: typeof useSearch\n };\n site: {\n useCategories: typeof useCategories\n useBrands: typeof useBrands\n };\n extraFeatures: CommerceExtraFeatures\n swell: any\n}\n\nexport default swell;","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/swell/src\n Changes: None\n*/\nimport {\n CommerceAPIConfig,\n getCommerceProvider as getCoreCommerceProvider,\n useCommerce as useCoreCommerce,\n} from '@plasmicpkgs/commerce'\nimport { SWELL_CHECKOUT_ID_COOKIE, SWELL_COOKIE_EXPIRE, SWELL_CUSTOMER_TOKEN_COOKIE } from './const'\nimport { getSwellProvider, SwellProvider } from './provider'\nimport fetchApi from './utils/fetch-swell-api'\n\nexport type { SwellProvider }\n\nexport const getCommerceProvider = (storeId: string, publicKey: string) => \n getCoreCommerceProvider(getSwellProvider(storeId, publicKey))\n\nexport const useCommerce = () => useCoreCommerce<SwellProvider>()\n\n\nexport interface SwellConfig extends CommerceAPIConfig {\n fetch: any\n}\n\nconst config: SwellConfig = {\n locale: 'en-US',\n commerceUrl: '',\n apiToken: ''!,\n cartCookie: SWELL_CHECKOUT_ID_COOKIE,\n cartCookieMaxAge: SWELL_COOKIE_EXPIRE,\n fetch: fetchApi,\n customerCookie: SWELL_CUSTOMER_TOKEN_COOKIE,\n}\n","import { GlobalActionsProvider, GlobalContextMeta } from \"@plasmicapp/host\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport React from \"react\";\nimport { Registerable } from \"./registerable\";\nimport { getCommerceProvider } from \"./swell\";\nimport {\n CartActionsProvider,\n globalActionsRegistrations,\n} from \"@plasmicpkgs/commerce\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n storeId: string;\n publicKey: string;\n}\n\nconst globalContextName = \"plasmic-commerce-swell-provider\";\n\nexport const commerceProviderMeta: GlobalContextMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-swell-provider\",\n displayName: \"Swell Provider\",\n props: {\n storeId: {\n type: \"string\",\n defaultValue: \"plasmic-sandbox\",\n },\n publicKey: {\n type: \"string\",\n defaultValue: \"pk_QaZeGhtpQaVbNQnWJdRlE1abE6Ezf9U9\",\n },\n },\n unstable__globalActions: globalActionsRegistrations as any,\n description: `Get your store ID and public storefront API key from the Swell admin UI under Developer > API Keys.\n\n[Watch how to use this integration](https://www.youtube.com/watch?v=b2mgOTbP2_8).`,\n importPath: \"@plasmicpkgs/commerce-swell\",\n importName: \"CommerceProviderComponent\",\n};\n\nexport function CommerceProviderComponent(props: CommerceProviderProps) {\n const { storeId, publicKey, children } = props;\n\n const CommerceProvider = React.useMemo(\n () => getCommerceProvider(storeId, publicKey),\n [storeId, publicKey]\n );\n\n return (\n <CommerceProvider>\n <CartActionsProvider globalContextName={globalContextName}>\n {children}\n </CartActionsProvider>\n </CommerceProvider>\n );\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: GlobalContextMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerGlobalContext = (...args) =>\n loader\n ? loader.registerGlobalContext(...args)\n : registerGlobalContext(...args);\n doRegisterComponent(\n CommerceProviderComponent,\n customCommerceProviderMeta ?? commerceProviderMeta\n );\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\nexport * from \"./registerCommerceProvider\";\nexport * from \"./swell\";\nexport { registerCommerceProvider };\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n"],"names":["SWELL_CHECKOUT_ID_COOKIE","SWELL_CHECKOUT_URL_COOKIE","SWELL_COOKIE_EXPIRE","runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","undefined","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","makeInvokeMethod","tryCatch","fn","arg","type","call","GenStateSuspendedStart","GenStateSuspendedYield","GenStateExecuting","GenStateCompleted","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","displayName","defineIteratorMethods","forEach","method","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","__await","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","then","unwrapped","error","previousPromise","enqueue","callInvokeWithMethodAndArg","async","Promise","iter","next","done","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","info","resultName","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","keys","object","reverse","length","pop","iterable","iteratorMethod","isNaN","i","skipTempReset","prev","charAt","slice","stop","rootEntry","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","normalizeProductOption","id","returnValues","map","output","label","match","hexColors","__typename","normalizeProductImages","images","url","file","rest","height","Number","width","normalizeProductVariants","variants","productOptions","price","option_value_ids","optionValueIds","split","trim","options","matchingOption","find","option","normalizeProduct","swellProduct","description","slug","currencyCode","currency","emptyVariants","o","productVariants","results","productImages","product","vendor","path","normalizeCart","account_id","date_created","tax_included_total","items","sub_total","grand_total","discounts","cart","customerId","email","createdAt","code","taxesIncluded","lineItems","normalizeLineItem","lineItemsSubtotalPrice","subtotalPrice","totalPrice","discount","amount","variant","quantity","item","variantId","productId","sku","image","requiresShipping","listPrice","normalizeChildren","children","ch","normalizeCategory","products","depth","parent_id","isEmpty","parentId","handleFetchResponse","res","CommerceError","getCheckoutId","Cookies","get","checkoutToCart","checkoutPayload","message","checkoutCreate","fetch","query","variables","checkoutUrl","checkout_url","expires","sameSite","secure","set","handler","fetchOptions","fetcher","useHook","useData","input","response","swrOptions","revalidateOnFocus","useMemo","data","isInteger","checkoutId","product_id","variant_id","useCart","mutate","useCallback","addItem","itemId","removeItem","removeItemHandler","ValidationError","ctx","debounce","wait","ensure","x","msg","ensureNoNilFields","fromEntries","entries","filter","v","walkCategoryTree","category","categories","queue","curr","shift","child","topologicalSortForCategoryTree","flatMap","sortMap","Map","categoryId","includeSubCategories","brandId","search","sort","count","mappedSort","includedCategories","brand","expand","limit","$filters","c","found","addIsEmptyField","all","normalizedCategories","vendors","Array","from","Set","entityId","callSwell","isArray","arg1","arg2","swell","getSwellProvider","storeId","publicKey","init","locale","cartCookie","useAddItem","useUpdateItem","useRemoveItem","useSearch","useProduct","site","useCategories","useBrands","extraFeatures","getCommerceProvider","getCoreCommerceProvider","useCommerce","useCoreCommerce","globalContextName","commerceProviderMeta","props","defaultValue","unstable__globalActions","globalActionsRegistrations","importPath","importName","CommerceProviderComponent","CommerceProvider","React","CartActionsProvider","registerCommerceProvider","loader","customCommerceProviderMeta","doRegisterComponent","registerGlobalContext","registerAll"],"mappings":";;;;;;;;;;;;;;AAAA;;;;AAIO,IAAMA,wBAAwB,GAAG,kBAAkB;AAEnD,IAAMC,yBAAyB,GAAG,mBAAmB;AAIrD,IAAMC,mBAAmB,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACTrC;AACA;AACA;AACA;AACA;;EAEA,IAAIC,OAAO,GAAI,UAAUC,OAAO,EAAE;;IAGhC,IAAIC,EAAE,GAAGC,MAAM,CAACC,SAAS;IACzB,IAAIC,MAAM,GAAGH,EAAE,CAACI,cAAc;IAC9B,IAAIC,WAAS,CAAC;IACd,IAAIC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