{
  "version": 3,
  "sources": ["/cdn/shop/t/5/assets/order-quantity-limits.js?enable_js_minification=1"],
  "sourcesContent": ["/**\n * Per-order quantity limits driven by a product tag matching\n * \"order-limit-{N}lb\" (e.g. \"order-limit-2000lb\" caps every variant on that\n * product at the unit-equivalent of N lbs, computed from each variant's own\n * weight so one tag covers every size without listing sizes individually).\n * N lbs is a shared budget across every variant of the product already in\n * the cart.\n *\n * Ported from the Hydrogen storefront's app/lib/orderQuantityLimits.ts and\n * app/lib/priceWeightConversion.ts. Liquid has no regex, so all weight/tag\n * parsing lives here instead of in the theme's Liquid snippets; the\n * snippets (order-limit-map, variant-inventory-map) only emit raw data\n * (tag-derived limit, raw variant size strings, per-variant inventory).\n */\n(function (window, $) {\n\t'use strict';\n\n\tvar SUPPORTED_AMOUNT_UNITS = ['tray', 'trays', 'seeds', 'seed', 'pack'];\n\tvar UNSUPPORTED_UNITS = ['pkg', 'package', 'packet'];\n\tvar WEIGHT_UNITS = ['oz', 'lb', 'g', 'mg'];\n\t// Spelled-out and plural weight units, mapped to the unit weightToOz\n\t// converts. Without them \"50 Grams\" or \"25 Lbs Bag\" matched no unit and fell\n\t// through to the \"amount with no unit\" fallback of amount x 5 lb \u2014 250 lb\n\t// per 50 g unit \u2014 which slashed the allowed quantity. A trailing period\n\t// (\"2 lbs.\") already matches, since the unit is followed by a word boundary.\n\t// Deliberate deviation from Hydrogen's priceWeightConversion.ts.\n\tvar WEIGHT_UNIT_ALIASES = {\n\t\tlbs: 'lb',\n\t\tozs: 'oz',\n\t\tpound: 'lb',\n\t\tpounds: 'lb',\n\t\tounce: 'oz',\n\t\tounces: 'oz',\n\t\tgram: 'g',\n\t\tgrams: 'g',\n\t};\n\tvar ALL_UNITS = WEIGHT_UNITS.concat(Object.keys(WEIGHT_UNIT_ALIASES), SUPPORTED_AMOUNT_UNITS)\n\t\t.slice()\n\t\t.sort(function (a, b) {\n\t\t\treturn b.length - a.length;\n\t\t});\n\tvar UNIT_PATTERN = ALL_UNITS.map(function (u) {\n\t\treturn u.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\t}).join('|');\n\tvar SPLIT_VALUE_RE = new RegExp('^\\\\s*([\\\\d./]+)\\\\s*(' + UNIT_PATTERN + ')\\\\b', 'i');\n\tvar AMOUNT_ONLY_RE = /^([\\d./]+)/;\n\n\tvar FALLBACK_UNIT_WEIGHT_LBS = 5;\n\tvar NO_ORDER_LIMIT_HANDLES = ['gift-card'];\n\n\t/**\n\t * Ported from Hydrogen's getLimitMessage (app/lib/quantityLimitHandlers.ts,\n\t * SD-2682): two messages sharing one vocabulary. 'allowed' names a rule\n\t * (the order-limit tag), 'available' names real scarcity. What splits the\n\t * two messages is whether anything is still addable:\n\t *\n\t *   Max <allowed|available> quantity that can be added: N\n\t *   Max <allowed|available> quantity already <selected|in the cart>\n\t *\n\t * The phrasing this replaced announced \"You are at the Order Limit\" on a\n\t * product page that could still add a unit, beside a working Add to Cart.\n\t * A cart line says \"selected\" because it already shows its own quantity;\n\t * a \"how many to add\" field names the cart, which is offscreen there and\n\t * is what is actually limiting it. (Hydrogen's third reason,\n\t * 'lineItemLimit', is Shopify's add-to-cart cap, which this store has off.)\n\t */\n\tfunction getLimitMessage(limitReason, limitAmount, isCartLine) {\n\t\tif (limitReason === null || limitAmount === null) return '';\n\n\t\tvar limitType = limitReason === 'stockLimit' ? 'available' : 'allowed';\n\t\tvar locationPhrase = isCartLine ? 'selected' : 'in the cart';\n\t\tvar cartHasMax = isCartLine || limitAmount === 0;\n\n\t\tif (cartHasMax) {\n\t\t\treturn 'Max ' + limitType + ' quantity already ' + locationPhrase;\n\t\t}\n\t\treturn 'Max ' + limitType + ' quantity that can be added: ' + limitAmount;\n\t}\n\n\tfunction isUnsupported(value) {\n\t\tvar lower = value.toLowerCase();\n\t\treturn UNSUPPORTED_UNITS.some(function (u) {\n\t\t\treturn lower.indexOf(u) !== -1;\n\t\t});\n\t}\n\n\tfunction checkAmount(value) {\n\t\tif (value.indexOf('/') !== -1) {\n\t\t\tvar parts = value.split('/');\n\t\t\tvar numerator = Number(parts[0]);\n\t\t\tvar denominator = Number(parts[1]);\n\t\t\tif (denominator === 0) return NaN;\n\t\t\treturn numerator / denominator;\n\t\t}\n\t\treturn parseFloat(value);\n\t}\n\n\tfunction splitValue(value, amountOnlyAllowed) {\n\t\tvar match = value.toLowerCase().match(SPLIT_VALUE_RE);\n\t\tif (match) {\n\t\t\treturn { amount: match[1], unit: match[2] };\n\t\t}\n\t\tif (amountOnlyAllowed) {\n\t\t\tvar amountOnlyMatch = value.trim().match(AMOUNT_ONLY_RE);\n\t\t\tif (amountOnlyMatch) {\n\t\t\t\treturn { amount: amountOnlyMatch[1], unit: '' };\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tfunction isCountBasedSize(value) {\n\t\tif (isUnsupported(value)) return true;\n\t\tvar parsed = splitValue(value);\n\t\tif (!parsed) return false;\n\t\treturn SUPPORTED_AMOUNT_UNITS.indexOf(parsed.unit.toLowerCase()) !== -1;\n\t}\n\n\tfunction canonicalUnit(unit) {\n\t\tvar lower = unit.toLowerCase();\n\t\treturn WEIGHT_UNIT_ALIASES[lower] || lower;\n\t}\n\n\tfunction weightToOz(value) {\n\t\tvar initialSplit = splitValue(value);\n\t\tif (!initialSplit) return 0;\n\t\tvar amount = checkAmount(initialSplit.amount);\n\t\tswitch (canonicalUnit(initialSplit.unit)) {\n\t\t\tcase 'oz':\n\t\t\t\treturn amount;\n\t\t\tcase 'lb':\n\t\t\t\treturn amount * 16;\n\t\t\tcase 'g':\n\t\t\t\treturn amount / 28.3495;\n\t\t\tcase 'mg':\n\t\t\t\treturn amount / 28349.5;\n\t\t\tdefault:\n\t\t\t\treturn 0;\n\t\t}\n\t}\n\n\t/**\n\t * Resolves one unit's weight in lbs from its raw size string.\n\t */\n\tfunction getUnitWeightLbs(size) {\n\t\tvar variantOz = weightToOz(size);\n\t\tif (isFinite(variantOz) && variantOz > 0) {\n\t\t\treturn variantOz / 16;\n\t\t}\n\n\t\tif (isCountBasedSize(size)) {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (splitValue(size)) {\n\t\t\t// A unit was recognized but produced an unusable weight\n\t\t\t// (e.g. \"0 lb\", \"1/0 oz\") \u2014 don't trust it, fall back flat.\n\t\t\treturn FALLBACK_UNIT_WEIGHT_LBS;\n\t\t}\n\n\t\tvar amountWithNoUnits = splitValue(size, true);\n\t\tif (amountWithNoUnits) {\n\t\t\tvar amount = checkAmount(amountWithNoUnits.amount);\n\t\t\tif (isFinite(amount) && amount > 0) {\n\t\t\t\t// e.g. size = \"10 Pre-Measured Bags\" -> 10 * 5 = 50 lb/unit\n\t\t\t\treturn amount * FALLBACK_UNIT_WEIGHT_LBS;\n\t\t\t}\n\t\t}\n\n\t\treturn FALLBACK_UNIT_WEIGHT_LBS;\n\t}\n\n\tfunction getVariantQuantityInCart(cartItems, variantId, excludeLineKey) {\n\t\tvar total = 0;\n\t\tfor (var i = 0; i < cartItems.length; i++) {\n\t\t\tvar item = cartItems[i];\n\t\t\tif (excludeLineKey && item.key === excludeLineKey) continue;\n\t\t\tif (String(item.variant_id) === String(variantId)) {\n\t\t\t\ttotal += item.quantity || 0;\n\t\t\t}\n\t\t}\n\t\treturn total;\n\t}\n\n\t/**\n\t * Total weight (lbs) already in the cart across every variant of a\n\t * product, optionally excluding one line. `variantSizes` maps variant\n\t * id -> raw size string for every variant of this product (from\n\t * order-limit-map.liquid).\n\t */\n\tfunction getProductWeightInCart(cartItems, productId, variantSizes, excludeLineKey) {\n\t\tvar total = 0;\n\t\tfor (var i = 0; i < cartItems.length; i++) {\n\t\t\tvar item = cartItems[i];\n\t\t\tif (excludeLineKey && item.key === excludeLineKey) continue;\n\t\t\tif (String(item.product_id) !== String(productId)) continue;\n\n\t\t\tvar size = variantSizes[String(item.variant_id)];\n\t\t\tif (!size) continue;\n\n\t\t\tvar unitLbs = getUnitWeightLbs(size);\n\t\t\ttotal += (item.quantity || 0) * unitLbs;\n\t\t}\n\t\treturn total;\n\t}\n\n\t/**\n\t * How many more units of this variant can still be added/set without\n\t * exceeding the product's order-limit tag, accounting for what's\n\t * already in the cart.\n\t *\n\t * @param {Array} cartItems - /cart.js items array\n\t * @param {{limitLbs:(number|null), productId:string, variantId:string,\n\t *   size:string, variantSizes:Object}} limitData\n\t * @param {{excludeLineKey?:string}} [options]\n\t * @returns {number|null} null means unlimited\n\t */\n\tfunction getRemainingOrderQuantity(cartItems, limitData, options) {\n\t\toptions = options || {};\n\t\tvar limitLbs = limitData.limitLbs;\n\t\tif (limitLbs === null || typeof limitLbs === 'undefined') return null;\n\n\t\t// order-limit-0lb: hard block, returned before the over-limit\n\t\t// allowance below. At 0 lb every variant is \"heavier than the limit\",\n\t\t// so that allowance would otherwise let 1 unit of each through.\n\t\tif (limitLbs === 0) return 0;\n\n\t\tvar size = limitData.size;\n\t\tif (!size) return null;\n\n\t\tvar unitLbs = getUnitWeightLbs(size);\n\n\t\tvar alreadyInCartLbs = getProductWeightInCart(\n\t\t\tcartItems,\n\t\t\tlimitData.productId,\n\t\t\tlimitData.variantSizes || {},\n\t\t\toptions.excludeLineKey\n\t\t);\n\n\t\tvar remainingLbs = Math.max(0, limitLbs - alreadyInCartLbs);\n\t\tvar remainingQty = Math.floor(remainingLbs / unitLbs);\n\t\tif (remainingQty > 0) return remainingQty;\n\n\t\tvar heavierThanLimit = unitLbs > limitLbs;\n\t\tif (!heavierThanLimit) return 0;\n\n\t\t// A unit heavier than the whole limit may still be bought once, but only\n\t\t// against an untouched budget. Hydrogen checks just this variant's own\n\t\t// quantity, which let one 25 lb unit through on a 5 lb tag already spent\n\t\t// on 1 lb units \u2014 a deliberate deviation.\n\t\treturn alreadyInCartLbs > 0 ? 0 : 1;\n\t}\n\n\t// ---- DOM wiring -----------------------------------------------------\n\n\tvar cartPromise = null;\n\tfunction fetchCart() {\n\t\tif (!cartPromise) {\n\t\t\tcartPromise = $.getJSON('/cart.js').always(function () {\n\t\t\t\tcartPromise = null;\n\t\t\t});\n\t\t}\n\t\treturn cartPromise;\n\t}\n\n\tfunction readLimitDataFromMap(mapJson, variantId) {\n\t\tvar map;\n\t\ttry {\n\t\t\tmap = JSON.parse(mapJson);\n\t\t} catch (err) {\n\t\t\treturn null;\n\t\t}\n\t\tvar size = map.variants ? map.variants[variantId] : undefined;\n\t\tif (typeof size === 'undefined') return null;\n\t\treturn {\n\t\t\tlimitLbs: map.limitLbs,\n\t\t\tsize: size,\n\t\t\tvariantSizes: map.variants || {},\n\t\t};\n\t}\n\n\t/**\n\t * Reads order-limit data off a quantity input. Every surface renders\n\t * data-order-limit-map (the whole product's variant->size table), since\n\t * the shared budget needs every variant's weight, not just the one this\n\t * input currently represents.\n\t */\n\tfunction readLimitData($input, variantId) {\n\t\tvar mapJson = $input.attr('data-order-limit-map');\n\t\tif (!mapJson) return null;\n\n\t\tvar resolvedVariantId = variantId || $input.attr('data-order-limit-variant-id');\n\t\tif (!resolvedVariantId) return null;\n\n\t\tvar limitData = readLimitDataFromMap(mapJson, resolvedVariantId);\n\t\tif (!limitData) return null;\n\n\t\tlimitData.productId = $input.attr('data-order-limit-product-id');\n\t\tlimitData.variantId = resolvedVariantId;\n\t\treturn limitData;\n\t}\n\n\t/**\n\t * Resolves which variant a quantity input currently represents.\n\t *\n\t * On the PDP both the main buy box and the sticky bar are their own\n\t * product group (.pg), each with its own form and hidden select.variant-id\n\t * (the sticky bar's is `sc__form` in product-template.liquid);\n\t * bt-product-global.js sets both selects on a variant change. So the\n\t * input's own form is the first scope, then its product group, then its\n\t * section, then the page's single picker, so every placement resolves to\n\t * the select that actually tracks it.\n\t */\n\tfunction findVariantSelect($input) {\n\t\tvar scopes = [\n\t\t\t$input.closest('form'),\n\t\t\t$input.closest('.pg'),\n\t\t\t$input.closest('[data-section-id], [data-section-type]'),\n\t\t];\n\t\tfor (var i = 0; i < scopes.length; i++) {\n\t\t\tif (!scopes[i] || !scopes[i].length) continue;\n\t\t\tvar $found = scopes[i].find('select[name=\"id\"], .variant-id').first();\n\t\t\tif ($found.length) return $found;\n\t\t}\n\t\t// Last resort: a PDP renders exactly one variant picker, so if there\n\t\t// is only one on the page it is unambiguously the right one.\n\t\tvar $all = $('select[name=\"id\"], .variant-id');\n\t\treturn $all.length === 1 ? $all.first() : $();\n\t}\n\n\tfunction currentFormVariantId($input) {\n\t\tvar $select = findVariantSelect($input);\n\t\tif ($select.length) return $select.val();\n\t\tvar $productIdInput = $input.closest('form').find('input[name=\"id\"]').first();\n\t\tif ($productIdInput.length) return $productIdInput.val();\n\t\treturn null;\n\t}\n\n\t// A quantity input is \"managed\" if it either carries an order-limit map\n\t// (the product is order-limited) or is explicitly marked\n\t// data-order-limit-managed (PDP inputs always carry this, even for\n\t// ordinary products, so this module can also own the plain stock-limit\n\t// message there \u2014 see applyRemaining's stock-message branch below).\n\t// Cart lines and wholesale rows are NOT marked this way, so an ordinary\n\t// (non-order-limited) product on those surfaces is left to their\n\t// existing, separate inventory messaging untouched.\n\tfunction findOrderLimitInputs() {\n\t\treturn $('input[data-order-limit-map], input[data-order-limit-managed]');\n\t}\n\n\tvar messageIdCounter = 0;\n\n\t// Walks up from the input, checking each ancestor level for a descendant\n\t// message div, rather than jQuery's .closest('a, b, c') \u2014 which stops at\n\t// the FIRST matching ancestor in DOM order, not the one that actually\n\t// contains the message. On the PDP the input's immediate wrapper is\n\t// .qty-box, which sits INSIDE .product-form__item (where the message\n\t// div actually lives, as a sibling of .qty-box, not a descendant of\n\t// it) \u2014 .closest('.product-form__item, .qty-box') matches .qty-box\n\t// first and never reaches the ancestor that actually contains the\n\t// message, so .find() inside it (and the .siblings() fallback, since\n\t// the message isn't a sibling of the INPUT either) both silently find\n\t// nothing. Different surfaces nest their message div at different\n\t// depths (cart lines: 4 levels up, inside a shared <td>; wholesale\n\t// rows: 3 levels up), so walking a bounded number of ancestors instead\n\t// of guessing a fixed class name works everywhere without needing to\n\t// special-case each surface's markup.\n\t// The walk also must not escape the surface the input belongs to: a cart\n\t// line in the drawer would otherwise climb out and claim the PDP's message\n\t// slot, writing that line's state into the product form's live region.\n\tfunction findMessageEl($input) {\n\t\tvar $scope = $input.parent();\n\t\tfor (var i = 0; i < 8 && $scope.length; i++) {\n\t\t\tvar $found = $scope.find('[data-order-limit-message]').first();\n\t\t\tif ($found.length) return $found;\n\t\t\tif ($scope.is('form, .header__cart, .cart-page__content, [data-section-id]')) {\n\t\t\t\treturn $();\n\t\t\t}\n\t\t\t$scope = $scope.parent();\n\t\t}\n\t\treturn $input.siblings('[data-order-limit-message]');\n\t}\n\n\t// Per element: $submitBtn can hold more than one button (the sticky bar's\n\t// desktop and mobile ones), and .attr() alone reads only the first.\n\tfunction addDescribedBy($el, id) {\n\t\tif (!$el) return;\n\t\t$el.each(function () {\n\t\t\tvar existing = this.getAttribute('aria-describedby');\n\t\t\tif (!existing) {\n\t\t\t\tthis.setAttribute('aria-describedby', id);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ((' ' + existing + ' ').indexOf(' ' + id + ' ') === -1) {\n\t\t\t\tthis.setAttribute('aria-describedby', existing + ' ' + id);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Points the quantity input, its -/+ stepper buttons and the add-to-cart\n\t * button at the limit message. aria-disabled is used instead of the\n\t * disabled attribute precisely so those controls keep focus \u2014 but that only\n\t * helps if focusing one says why it is unavailable, which requires this\n\t * association. Hydrogen's QuantitySelector describes all three stepper parts\n\t * for the same reason (SC 4.1.2): a greyed-out + that said nothing when\n\t * focused was the gap here.\n\t */\n\tfunction linkMessage($input, $message, $submitBtn) {\n\t\tif (!$message.length) return;\n\t\tvar id = $message.attr('id');\n\t\tif (!id) {\n\t\t\tmessageIdCounter += 1;\n\t\t\tid = 'order-limit-message-' + messageIdCounter;\n\t\t\t$message.attr('id', id);\n\t\t}\n\t\taddDescribedBy($input, id);\n\t\t$input.closest('.qty-box, .order-form-qty-box').find('.qty-box__ctrl').each(function () {\n\t\t\taddDescribedBy($(this), id);\n\t\t});\n\t\taddDescribedBy($submitBtn, id);\n\t}\n\n\tfunction setMessage($message, text) {\n\t\tif (!$message.length) return;\n\t\t// Only touch the DOM on an actual change, so a cart-wide recompute\n\t\t// doesn't rewrite every line's message.\n\t\tif ($message.text() !== text) {\n\t\t\t$message.text(text);\n\t\t}\n\t}\n\n\tfunction isExemptHandle($input) {\n\t\tvar handle = $input.attr('data-order-limit-exempt-handle');\n\t\tif (!handle) return false;\n\t\treturn NO_ORDER_LIMIT_HANDLES.indexOf(handle) !== -1;\n\t}\n\n\t// Tells any other client-side engine reading data-stock-limit (bt-libs.js's\n\t// stepper bounds, and form-item-actions.js's clampLineData \u2014 the\n\t// wholesale order form's own price/is_maxed recompute, which reads the\n\t// exact same attribute independently) that the ceiling just changed, so\n\t// they refresh in the same tick instead of waiting for the next\n\t// unrelated click/input the customer happens to trigger.\n\t//\n\t// clampLineData is deliberately skipped for cart lines: its\n\t// enforceStockLimit() will force-overwrite el.value down to the new\n\t// ceiling, which is exactly the value-mutation applyRemaining above\n\t// already refuses to do for a cart line whose quantity the customer\n\t// didn't just edit (see its own comment) \u2014 silently rewriting a sibling\n\t// line's displayed quantity would desync it from the real cart total\n\t// until the next submit, and a decrement click right after would then\n\t// compute its \"-1\" from that wrong, never-submitted number.\n\tfunction notifyCeilingChanged($input, isCartLine) {\n\t\t$input.trigger('qtybox:sync');\n\t\tif (!isCartLine && typeof window.clampLineData === 'function') {\n\t\t\twindow.clampLineData($input.get(0));\n\t\t}\n\t}\n\n\t/**\n\t * Applies the combined order-limit + stock-limit ceiling to one input.\n\t *\n\t * @param {jQuery} $input\n\t * @param {number|null} orderLimitRemaining - this product's own\n\t *   order-limit remaining-units figure (null = no order-limit tag, or\n\t *   this variant is missing from the map, i.e. \"unlimited by\n\t *   order-limit\").\n\t * @param {number} variantQtyInCart - how many of THIS exact variant are\n\t *   already in the cart. data-stock-limit holds the variant's total\n\t *   sellable inventory, not \"how many more can be added\" \u2014 for a \"how\n\t *   many to add\" field (PDP, wholesale row) those are only the same\n\t *   number when the cart is empty. Skipping this subtraction was a real\n\t *   bug: with 31 in stock and 31 already in the cart, the PDP still\n\t *   offered a fresh \"1\" as addable with everything enabled, because the\n\t *   raw 31 was used as the ceiling instead of 31 - 31 = 0.\n\t */\n\t/**\n\t * This variant's own sellable inventory, or null for \"no inventory\n\t * ceiling\" (untracked, or oversell-allowed).\n\t *\n\t * data-stock-limit alone can't answer this: the PDP renders it once, from\n\t * whichever variant happened to be selected at render time, and Shopify\n\t * doesn't re-render the section when the customer picks a different one.\n\t * data-order-limit-inventory-map (variant-inventory-map.liquid) carries\n\t * every variant's number so the ceiling can follow the selection. Falls\n\t * back to the originally-rendered attribute when no map is present, which\n\t * is correct for the surfaces that render one input per variant (cart\n\t * lines, wholesale rows) and can therefore never switch variants.\n\t */\n\tfunction inventoryLimitFor($input, variantId) {\n\t\tvar mapJson = $input.attr('data-order-limit-inventory-map');\n\t\tif (mapJson && variantId) {\n\t\t\tvar map;\n\t\t\ttry {\n\t\t\t\tmap = JSON.parse(mapJson);\n\t\t\t} catch (err) {\n\t\t\t\tmap = null;\n\t\t\t}\n\t\t\tif (map && Object.prototype.hasOwnProperty.call(map, String(variantId))) {\n\t\t\t\tvar value = map[String(variantId)];\n\t\t\t\t// null is a deliberate \"unlimited\" from the snippet, not a\n\t\t\t\t// missing entry \u2014 don't coerce it to 0.\n\t\t\t\treturn value === null ? null : parseInt(value, 10);\n\t\t\t}\n\t\t}\n\n\t\tif ($input.attr('data-ol-orig-stock-limit') === undefined) {\n\t\t\t$input.attr('data-ol-orig-stock-limit', $input.attr('data-stock-limit') || '');\n\t\t}\n\t\tvar rendered = parseInt($input.attr('data-ol-orig-stock-limit'), 10);\n\t\treturn isNaN(rendered) ? null : rendered;\n\t}\n\n\t// Every add-to-cart button of the form $btn sits in. The sticky bar's form\n\t// holds two: the desktop one beside its stepper and the collapsed mobile\n\t// bar's. Taking only the first left the mobile one enabled and silent at\n\t// the limit.\n\tfunction withFormSiblings($btn) {\n\t\tvar $form = $btn.closest('form');\n\t\treturn $form.length ? $form.find('.js-order-limit-submit') : $btn;\n\t}\n\n\t/**\n\t * Finds the add-to-cart buttons that belong to this quantity input,\n\t * walking up from the input and taking the first ancestor that contains\n\t * one, then widening to every such button in that form.\n\t */\n\tfunction findSubmitBtn($input) {\n\t\t// A cart line (drawer or cart page) has no add-to-cart button of its\n\t\t// own. Letting the walk continue past its container made a drawer line\n\t\t// climb all the way out to the PDP's main add-to-cart button and claim\n\t\t// it \u2014 then write its own, much larger ceiling onto it, re-enabling a\n\t\t// button the product's real limit had just correctly disabled. Stop\n\t\t// before leaving any cart-line context.\n\t\tif (typeof $input.attr('data-order-limit-line-key') !== 'undefined') return $();\n\n\t\tvar $scope = $input.parent();\n\t\tfor (var i = 0; i < 8 && $scope.length; i++) {\n\t\t\t// Never escape the surface this input belongs to.\n\t\t\tif ($scope.is('form, .header__cart, .cart-page__content, [data-section-id]')) {\n\t\t\t\tvar $inBoundary = $scope.find('.js-order-limit-submit').first();\n\t\t\t\treturn $inBoundary.length ? withFormSiblings($inBoundary) : $();\n\t\t\t}\n\t\t\tvar $found = $scope.find('.js-order-limit-submit').first();\n\t\t\tif ($found.length) return withFormSiblings($found);\n\t\t\t$scope = $scope.parent();\n\t\t}\n\t\treturn $();\n\t}\n\n\t/**\n\t * The combined order-limit + stock ceiling for one input, and which of the\n\t * two is binding. Pure: reads the input's attributes, writes nothing.\n\t */\n\tfunction computeCeiling($input, orderLimitRemaining, variantQtyInCart, variantId) {\n\t\tvar orderLimitApplies = orderLimitRemaining !== null && !isExemptHandle($input);\n\t\tvar isCartLine = typeof $input.attr('data-order-limit-line-key') !== 'undefined';\n\n\t\tvar inventoryLimit = inventoryLimitFor($input, variantId);\n\t\tvar hasInventoryLimit = inventoryLimit !== null && !isNaN(inventoryLimit);\n\n\t\t// A cart line's quantity field already IS the total for that variant,\n\t\t// so its own stock ceiling stays the raw inventory number. A \"how many\n\t\t// to add\" field needs the room actually left after what's already in\n\t\t// the cart \u2014 unless its rendered stock figure already had the cart\n\t\t// taken off: a wholesale row renders `in_stock` (inventory minus the\n\t\t// cart quantity), and subtracting the cart again capped a row with 60\n\t\t// addable at 20, or at 0 once half the stock sat in the cart.\n\t\tvar stockAlreadyNetOfCart = $input.attr('data-order-limit-stock-net-of-cart') === 'true';\n\t\tvar stockRemaining = null;\n\t\tif (hasInventoryLimit && isCartLine) {\n\t\t\tstockRemaining = inventoryLimit;\n\t\t} else if (hasInventoryLimit && stockAlreadyNetOfCart) {\n\t\t\tstockRemaining = Math.max(0, inventoryLimit);\n\t\t} else if (hasInventoryLimit) {\n\t\t\tstockRemaining = Math.max(0, inventoryLimit - (variantQtyInCart || 0));\n\t\t}\n\n\t\tvar effectiveLimit = null;\n\t\tif (orderLimitApplies && stockRemaining !== null) {\n\t\t\teffectiveLimit = Math.min(stockRemaining, orderLimitRemaining);\n\t\t} else if (orderLimitApplies) {\n\t\t\teffectiveLimit = orderLimitRemaining;\n\t\t} else if (stockRemaining !== null) {\n\t\t\teffectiveLimit = stockRemaining;\n\t\t}\n\n\t\t// Which constraint is actually binding decides the wording \u2014 one shared\n\t\t// slot, mutually exclusive, and the order limit wins a tie since it's\n\t\t// the more specific, more actionable explanation.\n\t\tvar orderLimitIsBinding = orderLimitApplies && (stockRemaining === null || orderLimitRemaining <= stockRemaining);\n\t\tvar stockIsBinding = stockRemaining !== null && (!orderLimitApplies || stockRemaining <= orderLimitRemaining);\n\t\tvar limitReason = null;\n\t\tif (orderLimitIsBinding) {\n\t\t\tlimitReason = 'orderLimit';\n\t\t} else if (stockIsBinding) {\n\t\t\tlimitReason = 'stockLimit';\n\t\t}\n\n\t\treturn {\n\t\t\teffectiveLimit: effectiveLimit,\n\t\t\tlimitReason: limitReason,\n\t\t\torderLimitApplies: orderLimitApplies,\n\t\t\tisCartLine: isCartLine,\n\t\t\t// A tracked variant with nothing in stock at all. The theme's own\n\t\t\t// \"Sold out\" button already says so, so no limit message is shown\n\t\t\t// beside it (see applyRemaining).\n\t\t\t// A wholesale row's figure is net of the cart, so 0 there means \"the\n\t\t\t// rest is already in your cart\", not sold out.\n\t\t\tisSoldOut: !isCartLine && !stockAlreadyNetOfCart && hasInventoryLimit && inventoryLimit <= 0,\n\t\t};\n\t}\n\n\tfunction applyRemaining($input, orderLimitRemaining, variantQtyInCart, variantId) {\n\t\tvar $submitBtn = findSubmitBtn($input);\n\t\tvar $message = findMessageEl($input);\n\t\tlinkMessage($input, $message, $submitBtn);\n\n\t\tvar ceiling = computeCeiling($input, orderLimitRemaining, variantQtyInCart, variantId);\n\t\tvar effectiveLimit = ceiling.effectiveLimit;\n\t\tvar orderLimitApplies = ceiling.orderLimitApplies;\n\t\tvar isCartLine = ceiling.isCartLine;\n\n\t\tif (orderLimitApplies) {\n\t\t\t$input.attr('data-order-limit-active', 'true');\n\t\t} else {\n\t\t\t$input.removeAttr('data-order-limit-active');\n\t\t}\n\n\t\tif (effectiveLimit === null) {\n\t\t\t// Genuinely no ceiling from either constraint for this variant.\n\t\t\t$input.removeAttr('data-stock-limit');\n\t\t\t$input.removeAttr('max');\n\t\t\t$input.removeAttr('data-order-limit-announcement');\n\t\t\tsetMessage($message, '');\n\t\t\tif ($submitBtn.length) {\n\t\t\t\t$submitBtn.attr('aria-disabled', 'false').removeClass('is-order-limit-disabled');\n\t\t\t}\n\t\t\tnotifyCeilingChanged($input, isCartLine);\n\t\t\treturn;\n\t\t}\n\n\t\t$input.attr('data-stock-limit', effectiveLimit);\n\n\t\tvar minValue = parseInt($input.attr('min'), 10);\n\t\tif (isNaN(minValue)) minValue = 1;\n\n\t\t// Keep the native max in step with the computed ceiling. Leaving the\n\t\t// render-time max behind would let the browser accept a typed value\n\t\t// this module then silently rewrites, and \u2014 worse \u2014 a max BELOW min\n\t\t// (effectiveLimit 0 against min 1) makes the field permanently\n\t\t// :invalid, which is what surfaces the browser's own \"Please enter a\n\t\t// value greater than or equal to 1\" bubble beside the field. At a\n\t\t// zero ceiling there is no valid amount to add, so the field is held\n\t\t// at min and the disabled add-to-cart button does the blocking.\n\t\t$input.attr('max', Math.max(effectiveLimit, minValue));\n\n\t\t// A cart line's input reflects quantity already in the cart, so\n\t\t// rewriting it here would show a number that disagrees with the real\n\t\t// cart until the customer happens to submit. Only \"how many to add\"\n\t\t// fields (PDP, wholesale rows) get clamped; cart lines are held to the\n\t\t// cap by the stepper ceiling below instead.\n\t\t//\n\t\t// Both bounds are enforced, not just the ceiling. Clamping only\n\t\t// downward was a real bug: a \"how many to add\" field is meaningless at\n\t\t// 0 (and the browser's own min= validation then pops \"Please enter a\n\t\t// value greater than or equal to 1\" right next to the field), yet a\n\t\t// typed 0 \u2014 or a 0 arrived at any other way \u2014 was left sitting there\n\t\t// untouched because it is not ABOVE the ceiling. The floor also has to\n\t\t// win when effectiveLimit is 0: at that point there is no valid\n\t\t// \"amount to add\" at all, so the field holds at its min and the\n\t\t// disabled add-to-cart button is what actually blocks the purchase.\n\t\tvar currentValue = parseInt($input.val(), 10);\n\t\tif (!isCartLine) {\n\t\t\tif (isNaN(currentValue) || currentValue < minValue) {\n\t\t\t\t$input.val(minValue);\n\t\t\t} else if (currentValue > effectiveLimit) {\n\t\t\t\t// Never clamp down to 0 \u2014 that leaves the customer staring at a\n\t\t\t\t// dead \"0\" with no way back up; hold at the input's own min.\n\t\t\t\t$input.val(Math.max(effectiveLimit, minValue));\n\t\t\t}\n\t\t}\n\n\t\tvar ownsStockMessage = $input.attr('data-order-limit-owns-stock-message') === 'true';\n\t\tvar limitReason = ceiling.limitReason;\n\t\tvar limitMessage = getLimitMessage(limitReason, effectiveLimit, isCartLine);\n\n\t\t// What to say if the customer's own entry gets cut back to this\n\t\t// ceiling (see announceIfCutBack). Stock counts on cart lines too,\n\t\t// where the visible stock note is the theme's server-rendered one.\n\t\t$input.attr('data-order-limit-announcement', limitMessage);\n\n\t\tvar valueNow = parseInt($input.val(), 10);\n\t\tvar atCap = !isNaN(valueNow) && valueNow >= effectiveLimit;\n\t\tvar ownsVisibleStockMessage = limitReason === 'stockLimit' && ownsStockMessage;\n\t\tvar ownsVisibleMessage = limitReason === 'orderLimit' || ownsVisibleStockMessage;\n\t\t// A sold-out size says nothing here, whichever limit binds: the theme's\n\t\t// \"Sold out\" state is the explanation, and once the order budget is spent\n\t\t// the order limit wins the tie and read \"Max allowed quantity already in\n\t\t// the cart\" under every sold-out size too.\n\t\tvar showsMessage = atCap && ownsVisibleMessage && !ceiling.isSoldOut;\n\t\tsetMessage($message, showsMessage ? limitMessage : '');\n\n\t\t// Disable for EITHER constraint reaching zero, not just the order\n\t\t// limit. Only checking orderLimitRemaining here was a real bug: with\n\t\t// stock already fully claimed by this customer's own cart, the\n\t\t// button stayed fully enabled and a click silently added nothing \u2014\n\t\t// Shopify's own /cart/add.js still enforces the true ceiling\n\t\t// server-side, but the customer sees no explanation at all for why\n\t\t// their click appeared to do nothing.\n\t\tvar atZero = effectiveLimit === 0;\n\t\tif ($submitBtn.length) {\n\t\t\t$submitBtn.attr('aria-disabled', atZero ? 'true' : 'false');\n\t\t\t$submitBtn.toggleClass('is-order-limit-disabled', atZero);\n\t\t}\n\n\t\tnotifyCeilingChanged($input, isCartLine);\n\t}\n\n\t/**\n\t * Wholesale order form: every row is its own \"how many to add\" field and\n\t * one submit adds them all, so what is typed into this product's OTHER rows\n\t * spends the same budget as what is already in the cart. Counting the cart\n\t * alone let 50 x 1 lb and 2 x 25 lb each pass a 50 lb limit, and one\n\t * submit add 100 lb. Other rows join as cart-shaped items so the limit\n\t * math is unchanged.\n\t */\n\tfunction withOtherOrderFormRows($input, cartItems) {\n\t\tvar $form = $input.closest('#order-form');\n\t\tif (!$form.length) return cartItems;\n\n\t\tvar productId = $input.attr('data-order-limit-product-id');\n\t\tvar typedRows = [];\n\t\t$form.find('input[data-order-limit-map]').each(function () {\n\t\t\tif (this === $input.get(0)) return;\n\t\t\tif (this.getAttribute('data-order-limit-product-id') !== productId) return;\n\t\t\tvar typedQty = parseInt(this.value, 10);\n\t\t\tif (isNaN(typedQty) || typedQty <= 0) return;\n\t\t\ttypedRows.push({\n\t\t\t\tproduct_id: productId,\n\t\t\t\tvariant_id: this.getAttribute('data-order-limit-variant-id'),\n\t\t\t\tquantity: typedQty,\n\t\t\t});\n\t\t});\n\t\treturn cartItems.concat(typedRows);\n\t}\n\n\t/**\n\t * The order-limit room left for one input, and how much of its variant the\n\t * cart already holds. orderLimitRemaining is null when no order limit\n\t * applies (no tag, or a variant missing from the map); the stock layer in\n\t * computeCeiling still applies either way.\n\t */\n\tfunction limitsFor($input, cartItems) {\n\t\tvar excludeLineKey = $input.attr('data-order-limit-line-key') || null;\n\t\tvar variantId = $input.attr('data-order-limit-variant-id') || currentFormVariantId($input);\n\t\tvar variantQtyInCart = getVariantQuantityInCart(cartItems, variantId, excludeLineKey);\n\n\t\tvar limitData = readLimitData($input, variantId);\n\t\tif (!limitData) {\n\t\t\treturn { orderLimitRemaining: null, variantQtyInCart: variantQtyInCart, variantId: variantId };\n\t\t}\n\n\t\tvar orderLimitRemaining = getRemainingOrderQuantity(withOtherOrderFormRows($input, cartItems), limitData, {\n\t\t\texcludeLineKey: excludeLineKey,\n\t\t});\n\t\treturn { orderLimitRemaining: orderLimitRemaining, variantQtyInCart: variantQtyInCart, variantId: variantId };\n\t}\n\n\t// The quantity field the customer touched last (typed into, or stepped).\n\tvar lastEditedInput = null;\n\n\tfunction recomputeAll() {\n\t\tif (!findOrderLimitInputs().length) return;\n\n\t\tfetchCart().done(function (cart) {\n\t\t\tvar cartItems = cart.items || [];\n\t\t\t// Looked up now, not before the request: a cart refresh can replace\n\t\t\t// these nodes while it is in flight.\n\t\t\tvar inputs = findOrderLimitInputs().get();\n\t\t\t// The field just edited is settled first. When it overspends a budget\n\t\t\t// it shares with other order-form rows, it is the one cut back, and\n\t\t\t// the rows after it see its settled value and keep their own.\n\t\t\tvar editedIndex = inputs.indexOf(lastEditedInput);\n\t\t\tif (editedIndex > 0) {\n\t\t\t\tinputs.unshift(inputs.splice(editedIndex, 1)[0]);\n\t\t\t}\n\t\t\t$.each(inputs, function () {\n\t\t\t\tvar $input = $(this);\n\t\t\t\tvar limits = limitsFor($input, cartItems);\n\t\t\t\tapplyRemaining($input, limits.orderLimitRemaining, limits.variantQtyInCart, limits.variantId);\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Re-checks a product form's quantity against the live cart right before\n\t * an add, and cuts it back to what is left. Called from bt-libs.js's\n\t * submitCartForm with the cart it has just fetched. The button's\n\t * aria-disabled state is only as fresh as the last recompute: a popup\n\t * rendered after page load, a cart filled in another tab, or a second click\n\t * landing before the post-add recompute all saw a stale ceiling and added\n\t * past the limit. This restores the click-time check the old purchase-limit\n\t * code made.\n\t *\n\t * @returns {number|null} how many may be added (null = no ceiling)\n\t */\n\tfunction enforceBeforeAdd($input, cartItems) {\n\t\tif (!$input.length || !$input.is('input[data-order-limit-map], input[data-order-limit-managed]')) return null;\n\n\t\tvar limits = limitsFor($input, cartItems);\n\t\tvar ceiling = computeCeiling($input, limits.orderLimitRemaining, limits.variantQtyInCart, limits.variantId);\n\t\tif (ceiling.effectiveLimit === null) return null;\n\n\t\tvar requestedQty = parseInt($input.val(), 10);\n\t\tvar isCutBack = !isNaN(requestedQty) && requestedQty > ceiling.effectiveLimit;\n\t\tif (isCutBack) {\n\t\t\t// Sold out says nothing about a limit (see applyRemaining).\n\t\t\tif (!ceiling.isSoldOut) {\n\t\t\t\tannounce(getLimitMessage(ceiling.limitReason, ceiling.effectiveLimit, false));\n\t\t\t}\n\t\t\tif (ceiling.effectiveLimit > 0) {\n\t\t\t\t$input.val(ceiling.effectiveLimit).trigger('change');\n\t\t\t}\n\t\t}\n\t\t// Bring the button, message and stepper up to date with this cart.\n\t\trecomputeAll();\n\t\treturn ceiling.effectiveLimit;\n\t}\n\n\tfunction guardSubmit($form) {\n\t\tvar $submitBtn = $form.find('.js-order-limit-submit').first();\n\t\tif (!$submitBtn.length) return;\n\t\tif ($submitBtn.attr('aria-disabled') === 'true') {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t// ---- Announcements (Hydrogen's R6) -------------------------------------\n\t//\n\t// The visible limit message is a standing fact, so it is not a live\n\t// region: every recompute (page load, a variant switch, an edit to a\n\t// DIFFERENT cart line) rewrites it, and as a live region each rewrite was\n\t// read aloud. What does get spoken is the one event a customer needs to\n\t// hear: their own entry being cut back to a limit. One polite region\n\t// serves the whole page, appended to <body> so it sits outside every\n\t// container the cart refreshes replace \u2014 the announcement survives the\n\t// re-render that follows the write. It is created up front because a\n\t// live region added at the same moment as its text is often not read.\n\tvar $announcer = null;\n\n\tfunction ensureAnnouncer() {\n\t\tif ($announcer) return $announcer;\n\t\t$announcer = $('<div id=\"order-limit-announcer\" class=\"sr-only\" role=\"status\" aria-live=\"polite\"></div>');\n\t\t$('body').append($announcer);\n\t\treturn $announcer;\n\t}\n\n\tfunction announce(text) {\n\t\tvar $region = ensureAnnouncer();\n\t\tif ($region.text() !== text) $region.text(text);\n\t}\n\n\t// A cart line this module doesn't manage (no order-limit tag) still has a\n\t// stock ceiling in data-stock-limit, so its cut-backs are stock ones.\n\tfunction announcementFor(el) {\n\t\tvar stored = el.getAttribute('data-order-limit-announcement');\n\t\tif (stored) return stored;\n\t\tvar ceiling = parseInt(el.getAttribute('data-stock-limit'), 10);\n\t\tif (isNaN(ceiling)) return '';\n\t\tvar isCartLine = el.getAttribute('name') === 'updates[]';\n\t\treturn getLimitMessage('stockLimit', ceiling, isCartLine);\n\t}\n\n\tvar TYPED_ATTR = 'data-order-limit-typed';\n\n\tfunction isQuantityInput(el) {\n\t\treturn !!(el && el.classList && el.classList.contains('qty-box__input'));\n\t}\n\n\t// Bound on window in the CAPTURE phase so it sees the raw keystroke value\n\t// before form-item-actions.js's document-level capture listener clamps it.\n\tfunction recordTypedQuantity(event) {\n\t\tvar el = event.target;\n\t\tif (!isQuantityInput(el)) return;\n\t\t// Editing again means the last announcement no longer describes what\n\t\t// is in the field (Hydrogen clears isLimited at the same point).\n\t\tannounce('');\n\t\tel.setAttribute(TYPED_ATTR, el.value);\n\t}\n\n\t// Stepper presses never reach here with a typed value: a + that would\n\t// exceed the limit is aria-disabled and inert, so there is no cut-back to\n\t// report \u2014 matching Hydrogen, where only a typed entry is ever spoken.\n\tfunction announceIfCutBack(event) {\n\t\tvar el = event.target;\n\t\tif (!isQuantityInput(el)) return;\n\t\tvar typedQty = parseInt(el.getAttribute(TYPED_ATTR), 10);\n\t\tel.removeAttribute(TYPED_ATTR);\n\t\tif (isNaN(typedQty)) return;\n\t\t// Read once every change handler has run, bt-libs' cart clamp included.\n\t\tsetTimeout(function () {\n\t\t\tvar committedQty = parseInt(el.value, 10);\n\t\t\tvar wasCutBack = !isNaN(committedQty) && committedQty < typedQty;\n\t\t\tif (wasCutBack) announce(announcementFor(el));\n\t\t}, 0);\n\t}\n\n\t// ---- Variant switch ----------------------------------------------------\n\t//\n\t// Hydrogen resets the quantity to 1 whenever the selected variant changes\n\t// (ProductForm.tsx): a count picked for one size isn't a meaningful count\n\t// of another \u2014 50 meant as 50 x 1 lb is a very different order at 25 lb.\n\t// Only product-page \"how many to add\" fields (data-order-limit-managed)\n\t// are reset, and only on an actual switch, not a re-selection of the\n\t// variant already chosen.\n\tvar LAST_VARIANT_KEY = 'orderLimitVariantId';\n\n\tfunction rememberSelectedVariants() {\n\t\t$('select[name=\"id\"], .variant-id').each(function () {\n\t\t\t$(this).data(LAST_VARIANT_KEY, String($(this).val()));\n\t\t});\n\t}\n\n\tfunction resetQuantityOnVariantSwitch($select) {\n\t\tvar variantId = String($select.val());\n\t\tvar previousVariantId = $select.data(LAST_VARIANT_KEY);\n\t\t$select.data(LAST_VARIANT_KEY, variantId);\n\n\t\tvar isSwitch = typeof previousVariantId !== 'undefined' && previousVariantId !== variantId;\n\t\tif (!isSwitch) return;\n\n\t\t$('input[data-order-limit-managed]').each(function () {\n\t\t\tvar $input = $(this);\n\t\t\tif (findVariantSelect($input).get(0) !== $select.get(0)) return;\n\t\t\tvar minValue = parseInt($input.attr('min'), 10);\n\t\t\t$input.val(isNaN(minValue) ? 1 : minValue).trigger('change');\n\t\t});\n\t}\n\n\tfunction init() {\n\t\tensureAnnouncer();\n\t\trememberSelectedVariants();\n\t\twindow.addEventListener('input', recordTypedQuantity, true);\n\t\tdocument.addEventListener('change', announceIfCutBack, true);\n\n\t\trecomputeAll();\n\n\t\t// A browser back/forward navigation can restore this page from the\n\t\t// back-forward cache instead of reloading it \u2014 the DOM (including\n\t\t// every data-stock-limit/aria-disabled/message this module already\n\t\t// wrote) comes back frozen exactly as it was, and none of this\n\t\t// file's own setup re-runs. If the cart changed on an intervening\n\t\t// page and the customer hits Back, that frozen state can disagree\n\t\t// with the real cart until something notices. Re-running the full\n\t\t// recompute is exactly the same fix cart mutations already get.\n\t\t$(window).on('pageshow', function (event) {\n\t\t\tif (event.originalEvent && event.originalEvent.persisted) {\n\t\t\t\trecomputeAll();\n\t\t\t}\n\t\t});\n\n\t\t$(document).on('change', 'select[name=\"id\"], .variant-id', function () {\n\t\t\tresetQuantityOnVariantSwitch($(this));\n\t\t\trecomputeAll();\n\t\t});\n\n\t\t$(document).on(\n\t\t\t'click',\n\t\t\t'.qty-box__ctrl',\n\t\t\tfunction () {\n\t\t\t\tvar steppedInput = $(this).siblings('input').get(0);\n\t\t\t\tif (steppedInput) lastEditedInput = steppedInput;\n\t\t\t\tsetTimeout(recomputeAll, 0);\n\t\t\t}\n\t\t);\n\n\t\t$(document).on('input change', 'input[data-order-limit-map], input[data-order-limit-managed]', function () {\n\t\t\tlastEditedInput = this;\n\t\t\tsetTimeout(recomputeAll, 0);\n\t\t});\n\n\t\t// The order form's Reset puts every row back without firing input or\n\t\t// change, so rows still held down by the values just cleared kept their\n\t\t// lowered ceiling, and the keystroke clamp cut the next entry to it.\n\t\t$(document).on('reset', '#order-form', function () {\n\t\t\tsetTimeout(recomputeAll, 0);\n\t\t});\n\n\t\t// Quick view and the collection \"Select option\" popup render a product\n\t\t// form into the page after load, so nothing had computed its ceiling \u2014\n\t\t// its add button sat enabled at the limit. bt-libs.js dispatches these\n\t\t// once the popup's HTML is in the DOM. The popup's variant select is new\n\t\t// too, so remember its starting variant for the reset-on-switch rule.\n\t\t['quick-view', 'select-option'].forEach(function (eventName) {\n\t\t\tdocument.addEventListener(eventName, function () {\n\t\t\t\trememberSelectedVariants();\n\t\t\t\trecomputeAll();\n\t\t\t});\n\t\t});\n\n\t\t// Recompute after every cart mutation so cross-variant/cross-line\n\t\t// aggregation and PDP-vs-cart-drawer state stay in sync without a\n\t\t// full page reload. This deliberately does NOT hook the raw\n\t\t// /cart/add.js or /cart/change.js XHR success: bt-libs.js's\n\t\t// updateHeaderCartHtml() re-fetches a fresh server-rendered copy of\n\t\t// the cart drawer (?view=header_cart) and *replaces* that HTML\n\t\t// afterwards, and bt-cart-page.js does the same for the cart page's\n\t\t// own content \u2014 recomputing on raw XHR success ran against\n\t\t// about-to-be-discarded DOM nodes, so every clamp/message/aria state\n\t\t// this module had just applied was silently wiped out the instant\n\t\t// that replacement landed a moment later. These two events are\n\t\t// exactly the themes's own \"the fresh HTML is now in the DOM\"\n\t\t// signals, fired once each render has actually happened:\n\t\t//   - ajaxCart.afterUpdateHeaderCartHtml: cart drawer HTML replaced.\n\t\t//     Fires after every add-to-cart (PDP, quick-view) and every\n\t\t//     drawer/cart-page quantity or remove action, since\n\t\t//     updateHeaderCartHtml() sits behind all of them.\n\t\t//   - orderLimits:cartPageUpdated: cart PAGE's own content replaced\n\t\t//     (fired from bt-cart-page.js once its own, separate\n\t\t//     ?view=ajax refresh \u2014 chained off ajaxCart.afterCartLoad \u2014\n\t\t//     finishes swapping in fresh HTML).\n\t\t$(document).on('ajaxCart.afterUpdateHeaderCartHtml orderLimits:cartPageUpdated', function () {\n\t\t\trecomputeAll();\n\t\t});\n\n\t\t// Bound natively in the CAPTURE phase rather than as a jQuery\n\t\t// delegated handler. bt-libs.js registers its own\n\t\t// $(document).on('click', '.add-cart-btn', ...) \u2014 the handler that\n\t\t// actually performs the add \u2014 and is loaded BEFORE this file, so a\n\t\t// delegated (bubble-phase) guard here can never\n\t\t// stopImmediatePropagation its way in front of it: jQuery runs\n\t\t// same-element handlers in registration order, and bt-libs' is first.\n\t\t// Capture runs on the way DOWN, so this fires before any bubble-phase\n\t\t// handler on any element, whatever the load order.\n\t\t//\n\t\t// submitCartForm() also checks aria-disabled before submitting, and\n\t\t// that check is what blocks the add today. This is deliberately a\n\t\t// second, independent gate: it stops the click before bt-libs starts\n\t\t// its loading spinner and \"working\" class, so a blocked click reads as\n\t\t// nothing-happened rather than as a request that spun and silently\n\t\t// failed.\n\t\tdocument.addEventListener(\n\t\t\t'click',\n\t\t\tfunction (e) {\n\t\t\t\tvar target = e.target;\n\t\t\t\tvar btn = target && target.closest ? target.closest('.js-order-limit-submit') : null;\n\t\t\t\tif (btn && btn.getAttribute('aria-disabled') === 'true') {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t}\n\t\t\t},\n\t\t\ttrue\n\t\t);\n\n\t\t$(document).on('submit', 'form', function (e) {\n\t\t\tvar $form = $(this);\n\t\t\tif (!$form.find('.js-order-limit-submit').length) return;\n\t\t\tif (!guardSubmit($form)) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t});\n\t}\n\n\t$(function () {\n\t\tinit();\n\t});\n\n\t// Exposed for hand verification against orderQuantityLimits.test.ts\n\t// (see the plan's verification section) and for other modules that may\n\t// need to recompute after their own cart mutations.\n\twindow.OrderQuantityLimits = {\n\t\tsplitValue: splitValue,\n\t\tcheckAmount: checkAmount,\n\t\tweightToOz: weightToOz,\n\t\tisCountBasedSize: isCountBasedSize,\n\t\tgetUnitWeightLbs: getUnitWeightLbs,\n\t\tgetRemainingOrderQuantity: getRemainingOrderQuantity,\n\t\tgetLimitMessage: getLimitMessage,\n\t\trecomputeAll: recomputeAll,\n\t\tenforceBeforeAdd: enforceBeforeAdd,\n\t};\n})(window, jQuery);\n"],
  "mappings": "CAcC,SAAU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