import{i as r,j as S,a as w,c as _,o as p,e as A,f as i,b as C,t as c,u as v,d as P,g as h,w as b,F as x,a2 as B}from"./vue.esm-bundler-DZdE0M9V.js";import{u as I}from"./useElementPlusComponents-B_fOPHjO.js";import{_ as j}from"./AddProductItemModal-BW_L_XlB.js";import{t as d}from"./Translator-Bios5QX5.js";import{u as E}from"./useElementor-CLTCC9L5.js";/* empty css                                                                          */import{_ as N}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./index-D0R5Hqh1.js";import"./index-I6zcAgit.js";import"./index-Db9JpFxU.js";import"./dayjs.min-2rai63wT.js";import"./DynamicIcon-D-LZibaK.js";import"./CaretRight-2tV7VHCK.js";import"./Str-Ckn63bs5.js";import"./productService-BVWCmR6j.js";import"./Arr-MwYQQ3qa.js";import"./Model-B7FTF6mI.js";import"./Rest-DEQMhckH.js";import"./Asset-DDfERlE5.js";import"./Url-D4lOoZOf.js";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=E()}),(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(j,{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=N($,[["__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)})});
