"use strict";var e=require("./constants.js");const t=/^\s*\{\{[\s\S]*\}\}\s*$/,r=e=>e.replace(/\s*\}\}\s*$/,"| escape | replace: '&quot;', '\"' }}"),s=e=>{if(null==e)return e;let s=e.toString();return t.test(s)?r(s):s.replaceAll("'","&#39;").replaceAll("’","&#39;")},a=e=>(e?.attrs&&e?.attrs.color&&delete e.attrs.color,e);exports.checkIconVisibility=e=>e?.enableIcon===!0,exports.getGPProductButtonState=({styles:e,setting:t,successMessage:r,errorMessage:a,variantSelectionRequiredMessage:o})=>({styles:{errorTypo:e?.errorTypo,successTypo:e?.successTypo},setting:{errorType:t?.errorType,actionEffect:t?.actionEffect,enableMessage:t?.enableMessage,label:s(t?.label),errorMessage:s(a??t?.errorMessage),successMessage:s(r??t?.successMessage),outOfStockLabel:s(t?.outOfStockLabel),customURL:{link:s(t?.customURL?.link),target:t?.customURL?.target},variantSelectionRequiredMessage:s(o??t?.variantSelectionRequiredMessage)},variantID:"{{variant.id}}",disabled:"{{variant.available}}",totalVariant:"{{total_combinations}}"}),exports.getRenderComparePriceSettings=e=>({lineThrough:!0,typo:a(e?.compareAtPriceTypo),opacityPrice:e?.opacityPrice}),exports.getRenderRegularPriceSettings=e=>({lineThrough:!1,typo:a(e?.priceTypo)}),exports.renderSeparator=t=>({dot:e.SEPARATOR.DOT,"vertical-line":e.SEPARATOR.VERTICAL_LINE,"horizontal-line":e.SEPARATOR.HORIZONTAL_LINE})[t??"horizontal-line"]??e.SEPARATOR.HORIZONTAL_LINE;
