import{h as r,i as S,r as w,e as _,o as p,b as A,d as i,c as C,t as c,u as v,a as P,f as h,w as b,F as x,a2 as B}from"./chunks/vue.esm-bundler.js?ver=1.3.21";import{u as I}from"./chunks/useElementPlusComponents.js?ver=1.3.21";import{_ as E}from"./chunks/AddProductItemModal.js?ver=1.3.21";import{t as d}from"./chunks/Translator.js?ver=1.3.21";import{u as N}from"./chunks/useElementor.js?ver=1.3.21";import"./chunks/ServerSidePreview.vue_vue_type_style_index_0_scoped_e73ce754_lang.js?ver=1.3.21";import{_ as j}from"./chunks/_plugin-vue_export-helper.js?ver=1.3.21";import"./chunks/index.js?ver=1.3.21";import"./chunks/index2.js?ver=1.3.21";import"./chunks/index4.js?ver=1.3.21";import"./chunks/dayjs.min.js?ver=1.3.21";import"./chunks/index3.js?ver=1.3.21";import"./chunks/DynamicIcon.js?ver=1.3.21";import"./chunks/CaretRight.js?ver=1.3.21";import"./chunks/Str.js?ver=1.3.21";import"./chunks/productService.js?ver=1.3.21";import"./chunks/Arr.js?ver=1.3.21";import"./chunks/Model.js?ver=1.3.21";import"./chunks/Rest.js?ver=1.3.21";import"./chunks/Asset.js?ver=1.3.21";import"./chunks/Url.js?ver=1.3.21";import"./chunks/vue-router.js?ver=1.3.21";const D={class:"fluent-cart-direct-checkout-app"},F={class:"fluent-cart-direct-checkout-app-title"},M={key:0,class:"fluent-cart-direct-checkout-app-content"},Q=["title"],H={class:"fluent-cart-direct-checkout-app-product-id"},L=["innerHTML"],$={__name:"App",props:{variantId:{type:String,default:""},variantTitle:{type:String,default:""},variantPrice:{type:String,default:""}},setup(t){let e=null;const o=t;r(0);const n=r(o.variantId),a=r(o.variantTitle),s=r(o.variantPrice);r(null);const k=()=>{n.value="",a.value="",s.value="",setTimeout(()=>{e.setSettings("variant_id","")},100)},y=l=>{n.value=l,setTimeout(()=>{e.setSettings("variant_id",l.toString())},100)};return S(()=>{e=N()}),(l,m)=>{const g=w("el-button");return p(),_(x,null,[A("",!0),i("div",D,[i("h3",F,c(v(d)("Direct Checkout Button")),1),n.value?(p(),_("div",M,[i("div",{class:"fluent-cart-direct-checkout-app-product-title",title:a.value},[i("span",H,"#"+c(n.value),1),h(c(a.value),1)],8,Q),i("div",{class:"fluent-cart-direct-checkout-app-product-price",innerHTML:s.value},null,8,L),P(g,{class:"fluent-cart-direct-checkout-app-reset-button",type:"primary",onClick:k},{default:b(()=>[h(c(v(d)("Reset")),1)]),_:1})])):(p(),C(E,{key:1,onOnVariationSelectionUpdated:m[0]||(m[0]=(f,T)=>{y(f[0]),T.forEach(V=>{for(const u of V.variants)if(u.id===f[0])return a.value=u.variation_title,s.value=u.formatted_total,!1})})}))])],64)}}},O=j($,[["__scopeId","data-v-1d9b4c2d"]]),R=t=>{const e=t.dataset.variantId,o=t.dataset.variantTitle,n=t.dataset.variantPrice,a=B(O,{variantId:e,variantTitle:o,variantPrice:n});I(a),a.mixin({methods:{$t:d}}).mount(t)};jQuery(document).ready(function(){elementor.hooks.addAction("panel/open_editor/widget/fluent_cart_direct_checkout",function(t,e,o){e.get("settings")})});jQuery(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/fluent_cart_direct_checkout.default",function(t){const e=jQuery(t[0]).find("[data-fluent-cart-direct-checkout-app]")[0];R(e)})});
