import{template as s,isLocalEnv as o,baseAssetURL as t}from"@gem-sdk/core";import{createStyle as e,createClass as r,createAttr as i,createStateOrContext as p,If as c}from"@gem-sdk/system";import{getSettingPreloadData as m}from"../../../helpers.js";import{getButtonClasses as l,getButtonWrapperClasses as u}from"./common/classes.js";import{getSPButton as a}from"./common/helpers.js";import{getButtonWrapperStyles as h}from"./common/styles.js";import n from"./icons/DynamicCheckoutBlack.liquid.js";import k from"./icons/DynamicCheckoutPurple.liquid.js";import y from"./icons/DynamicCheckoutWhite.liquid.js";import d from"./icons/ExpressCheckoutBlack.liquid.js";import f from"./icons/ExpressCheckoutPurple.liquid.js";import j from"./icons/ExpressCheckoutWhite.liquid.js";let ShopPayButton=({style:C,styles:g,setting:$,className:E,builderAttrs:b})=>{let S=a({styles:g,buttons:{DynamicCheckoutBlack:n({}),DynamicCheckoutPurple:k({}),DynamicCheckoutWhite:y({}),ExpressCheckoutBlack:d({}),ExpressCheckoutPurple:f({}),ExpressCheckoutWhite:j({})}}),P=e({...h(C,g)}),x=r({...l()}),B=r({...u(E)}),q=i({disabled:!1,"aria-label":"Buy with Shop Pay"}),D=p({setting:JSON.stringify($),shop_url:"{{shop.url}}"});return s`
    <gp-shop-pay-button
      ${{...b}}
      style="${P}"
      class="${B}"
      gp-data='${D}'
    >
      <button
        ${{...q}}
        class="${x}"
      >
        ${S}
      </button>
    </gp-shop-pay-button>
    ${c(o,`<script ${m('class="gps-link" delay',"src")}="{{ 'gp-shop-pay-button-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${m('class="gps-link" delay',"src")}="${t}/assets-v2/gp-shop-pay-button-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
  `};export{ShopPayButton as default};
