"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[12],{9:(r,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_PREORDER_DAYS=void 0,e.hasValidPreOrderVariant=function(r){return!!(null==r?void 0:r.preorderVariant)&&(!r.availableForSale||parseFloat(r.preorderVariant.price)parseFloat(r.preorderVariant.price)?t:void 0,addToCartProperties:r.preorderVariant.addToCartProperties})},e.formatPreorderBundleDate=a,e.getFallbackDateString=function(r=75){const e=new Date;return e.setDate(e.getDate()+r),e.toISOString().substring(0,10)},e.formatPreorderDate=o,e.getPreorderAssignment=function(r,e){if(!e.every((r=>null==r?void 0:r.variants.some((r=>r.preorderVariant)))))return{showPreorderButtons:!1,preorderTreatment:"default"};const t=e.length>1&&"enabled"===r.getAssignment("showBundlePreorderButtons")||"enabled"===r.getAssignment("showPreorderButtons"),n=r.getAssignment("preorderTreatment");return{showPreorderButtons:t,preorderTreatment:"shipDateOnAddToCart"===n?n:"default"}},e.isPreOrderVariant=i,e.getPreOrderMessage=function(...r){const e=r.filter(i);if(0!==e.length)return`Pre-order: ${a(e)}`};const n=t(5);function a(r){const t=r.map((r=>r.preorderVariant)).filter(n.isDefined).map((r=>{var t;return null!==(t=r.days)&&void 0!==t?t:e.DEFAULT_PREORDER_DAYS})).sort(((r,e)=>r-e));return 0===t.length?"":o(t.pop())}function o(r){null!=r||(r=e.DEFAULT_PREORDER_DAYS);const t=new Date;return t.setDate(t.getDate()+r),`Estimated to Ship ${t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}`}function i(r){var e;return Boolean(r&&r.preorderVariant&&(null===(e=r.preorderVariant)||void 0===e?void 0:e.id)===r.variantId)}e.DEFAULT_PREORDER_DAYS=75}}]);