PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
← All changes | assets/app.js +3 -3 trunk → 1.6.5 View file →
@@ -1,5 +1,5 @@
1 -var Nf=Object.defineProperty;var Kf=(e,t,a)=>t in e?Nf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var Pe=(e,t,a)=>Kf(e,typeof t!="symbol"?t+"":t,a);import{r as C,c as E,o as r,w as d,a as n,u as A,b as x,d as o,e as h,f as R,t as m,F as P,g as te,h as T,i as Ie,j as Bt,k as Jt,l as K,m as ga,n as de,p as oa,q as Ge,s as Dn,T as Xl,v as be,x as xe,y as oi,z as xa,A as bl,B as Il,C as yn,D as va,E as gl,G as ra,H as Gf,I as Wt,J as Hc,K as vs,L as Zs,M as cl,N as ii,O as zf,P as Nc,V as Kc,Q as Ds,R as jf,S as ri,U as Va,W as Tl,X as qf,Y as Yf,Z as Gc,_ as Wf,$ as Jf,a0 as Xf,a1 as td,a2 as Zf}from"./chunks/vue.esm-bundler.js?ver=1.6.6";import{u as sl,a as nl,o as zc,c as em,b as tm}from"./chunks/vue-router.js?ver=1.6.6";import{_ as Yt}from"./chunks/preload-helper.js?ver=1.6.6";import{t as u,a as sa,A as ze,_ as kl,p as Io}from"./chunks/Translator.js?ver=1.6.6";import{T as Vs,_ as Ts,a as ad,F as Qo,b as el,P as dn,B as fa,c as jc,m as qc,d as Yc,e as am}from"./chunks/Badge.js?ver=1.6.6";import{_ as Ct,P as ol}from"./chunks/Empty.js?ver=1.6.6";import{a as Hn,E as Fl,m as lm,b as Al,d as Wc,i as ll,c as sm,s as Jc,e as Do,f as ld,g as Xc,p as Od,r as Zc,w as nm,l as en,h as om,j as im,k as sd,n as Vo,t as rm,o as dm,q as um,u as cm,v as Am,x as pm,y as fm,z as mm}from"./chunks/index.js?ver=1.6.6";import{u as eA,_ as tA,a as nd,b as Ea,c as aA,d as lA,L as od,e as di,O as sA,f as ui,P as id,C as as}from"./chunks/OrderCustomerInformation.js?ver=1.6.6";import{_ as Ot,p as Vn}from"./chunks/UserCan.js?ver=1.6.6";import{C as ft,f as Zl,r as Ll}from"./chunks/CurrencyFormatter.js?ver=1.6.6";import{_ as Pa,a as rd,b as dd,c as hm,S as nA,d as oA,A as iA,e as rA}from"./chunks/Activity.js?ver=1.6.6";import{_ as Ba,C as Ve,a as ke,b as Se}from"./chunks/CardBody.js?ver=1.6.6";import{_ as Y}from"./chunks/DynamicIcon.js?ver=1.6.6";import{_ as nt}from"./chunks/_plugin-vue_export-helper.js?ver=1.6.6";import{c as _m,S as Vt,u as vm,h as ln,a as fr,g as dA,f as gm,b as Us,$ as ul,d as ym}from"./chunks/common.js?ver=1.6.6";import{I as at}from"./chunks/IconButton.js?ver=1.6.6";import{M as tl}from"./chunks/Model.js?ver=1.6.6";import{R as Ae}from"./chunks/Rest.js?ver=1.6.6";import{d as lt,g as bm}from"./chunks/dayjs.min.js?ver=1.6.6";import{n as q}from"./chunks/Notify.js?ver=1.6.6";import{_ as ya}from"./chunks/Animation.js?ver=1.6.6";import{_ as ls,T as Te,m as Oa,a as Gl,i as na,r as wm,L as mr,b as uA,d as cA,c as AA}from"./chunks/dateShortCuts.js?ver=1.6.6";import{S as Ua,_ as Ia,u as bs,a as Cm,b as km,c as Bm}from"./chunks/countries.js?ver=1.6.6";import{u as ws,L as pa,_ as ci}from"./chunks/NotFound.js?ver=1.6.6";import{c as Ql,a as wl,b as za,e as Tn,i as ud,U as cd,p as xm}from"./chunks/Utils.js?ver=1.6.6";import{A as gs}from"./chunks/Asset.js?ver=1.6.6";import{E as Sm}from"./chunks/index2.js?ver=1.6.6";import{S as da}from"./chunks/Str.js?ver=1.6.6";import{A as dt}from"./chunks/Arr.js?ver=1.6.6";import{C as ks,V as sn,_ as Aa,c as Mn,a as Bo,b as Fm,d as $m}from"./chunks/AttrGroups.js?ver=1.6.6";import{U as nn}from"./chunks/Url.js?ver=1.6.6";import{p as Em,E as Os,v as Um,i as Im}from"./chunks/DynamicTemplateParser.js?ver=1.6.6";import{u as Ai,t as pA}from"./chunks/timezone.js?ver=1.6.6";import{_ as un,P as fA}from"./chunks/ProductVariationSelector.js?ver=1.6.6";import{f as Kt,a as Qm,p as Dm,b as Vm,g as Tm,c as Mm,d as Lm}from"./chunks/productService.js?ver=1.6.6";import{B as To}from"./chunks/BundleProducts.js?ver=1.6.6";import{m as Pd,n as Rm,s as Om,a as Pm,i as Hd,r as Hm,b as Nm,g as Nd,c as Kd,d as Km,e as Gm,f as zm,h as jm,j as qm,k as Ym,l as Wm}from"./chunks/galleryTabs.js?ver=1.6.6";import{E as Gd}from"./chunks/index3.js?ver=1.6.6";import{T as zd}from"./chunks/TransitionAccordion.js?ver=1.6.6";import{_ as mA}from"./chunks/FileUploaderDialog.js?ver=1.6.6";import Jm from"./chunks/Screenshot.js?ver=1.6.6";import{u as Xm}from"./chunks/useElementPlusComponents.js?ver=1.6.6";import"./chunks/AddressComponent2.js?ver=1.6.6";import"./chunks/weekOfYear.js?ver=1.6.6";import"./chunks/index4.js?ver=1.6.6";class Zm extends Vs{getTabs(){return{}}getToggleableColumns(){return[{label:u("Lifetime Value (LTV)"),value:"ltv"},{label:u("Customer Since"),value:"customer_since"},{label:u("Last Purchase Date"),value:"last_purchase_date"}]}getSearchHint(){return u("Search by, #ID, First Name, Last Name and Email")}getFetchUrl(){return"customers"}parseResponse(t){return t.customers}getTableName(){return"customers"}}function hA(e){return Zm.init(e)}const eh={class:"table-cell"},th={class:"fct-product-info-card w-full"},ah={class:"fct-product-info-media"},lh={class:"fct-product-info-details grow-0 shrink-0 basis-[calc(100%-52px)]",style:{overflow:"hidden"}},sh={class:"fct-product-info-name flex flex-col items-start gap-3"},nh={class:"table-cell"},oh={class:"table-cell"},ih={class:"table-cell"},rh={class:"table-cell"},dh={class:"table-cell"},uh={__name:"CustomersLoader",props:{nextPageCount:{type:Number,default:0},customerTable:{type:Object,default:()=>({})}},setup(e){const t=e,a=Array.from({length:t.nextPageCount},(l,s)=>s+1);return(l,s)=>{const i=C("el-skeleton-item"),c=C("el-table-column"),p=C("el-table"),f=C("el-skeleton");return r(),E(f,{animated:""},{template:d(()=>[n(p,{data:A(a),class:"w-full compact-table responsive"},{default:d(()=>[n(c,{label:l.$t("Customer"),width:"340"},{default:d(()=>[o("div",eh,[o("div",th,[o("div",ah,[n(i,{variant:"image",class:"w-10 h-10.5 rounded-full flex-none"})]),o("div",lh,[o("div",sh,[n(i,{variant:"p",class:"max-w-[190px]"}),n(i,{variant:"p",class:"max-w-[100px]"})])])])])]),_:1},8,["label"]),n(c,{label:l.$t("Address"),width:"340"},{default:d(()=>[o("div",nh,[n(i,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"]),n(c,{label:l.$t("Purchases"),width:"102"},{default:d(()=>[o("div",oh,[n(i,{variant:"p",class:"w-3/5"})])]),_:1},8,["label"]),e.customerTable.isColumnVisible("ltv")?(r(),E(c,{key:0,label:l.$t("LTV"),width:"113"},{default:d(()=>[o("div",ih,[n(i,{variant:"p",class:"w-3/5"})])]),_:1},8,["label"])):x("",!0),e.customerTable.isColumnVisible("last_purchase_date")?(r(),E(c,{key:1,label:l.$t("Last Purchase Date"),width:"226"},{default:d(()=>[o("div",rh,[n(i,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"])):x("",!0),e.customerTable.isColumnVisible("customer_since")?(r(),E(c,{key:2,label:l.$t("Customer Since"),width:"170"},{default:d(()=>[o("div",dh,[n(i,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"])):x("",!0)]),_:1},8,["data"])]),_:1})}}},ch={key:0,class:"fct-customer-card"},Ah={class:"fct-customer-avatar"},ph=["src"],fh={class:"fct-customer-details"},mh={class:"fct-customer-name"},hh={class:"fct-customer-id"},_h={class:"fct-customer-email"},vh=["innerHTML"],gh={key:1},yh={__name:"CustomersTable",props:{table:{type:Object,required:!0}},emits:["selectionChange"],setup(e,{emit:t}){const a=t,l=s=>{a("selectionChange",s)};return(s,i)=>{const c=C("el-table-column"),p=C("el-table");return r(),E(p,{data:e.table.getTableData(),class:"w-full compact-table",onSelectionChange:l},{empty:d(()=>[n(Ct,{icon:"Empty/ListView","has-dark":!0,text:A(u)("No customer found!")},null,8,["text"])]),default:d(()=>[n(c,{type:"selection",width:"45"}),n(c,{label:A(u)("Customer"),width:"300"},{default:d(f=>{var _;return[n(Ba,{class:"hover:no-underline",to:{name:"view_customer",params:{customer_id:(_=f.row)==null?void 0:_.id}}},{default:d(()=>{var g,y,v,w,k;return[(g=f.row)!=null&&g.id?(r(),h("div",ch,[o("div",Ah,[o("span",null,[o("img",{src:(y=f.row)==null?void 0:y.photo,alt:"avatar"},null,8,ph)])]),o("div",fh,[o("div",mh,[R(m(((v=f.row)==null?void 0:v.full_name)||A(u)("No Name"))+" ",1),o("span",hh,"#"+m(A(sa)((w=f.row)==null?void 0:w.id)),1)]),o("div",_h,m((k=f.row)==null?void 0:k.email),1)])])):x("",!0)]}),_:2},1032,["to"])]}),_:1},8,["label"]),n(c,{label:A(u)("Address"),width:"300"},{default:d(f=>{var _;return[n(Ba,{class:"hover:no-underline",to:{name:"view_customer",params:{customer_id:(_=f.row)==null?void 0:_.id}}},{default:d(()=>[R(m(s.getOrderAddress(f.row)),1)]),_:2},1032,["to"])]}),_:1},8,["label"]),n(c,{label:A(u)("Purchases"),width:90},{default:d(f=>{var _;return[n(Ba,{class:"hover:no-underline",to:{name:"view_customer",params:{customer_id:(_=f.row)==null?void 0:_.id}}},{default:d(()=>[R(m(A(sa)(f.row.purchase_count)),1)]),_:2},1032,["to"])]}),_:1},8,["label"]),e.table.isColumnVisible("ltv")?(r(),E(c,{key:0,label:A(u)("LTV"),width:100},{default:d(f=>{var _;return[n(Ba,{class:"hover:no-underline",to:{name:"view_customer",params:{customer_id:(_=f.row)==null?void 0:_.id}}},{default:d(()=>[o("span",{innerHTML:A(ft).formatNumber(f.row.ltv,!0,!1)},null,8,vh)]),_:2},1032,["to"])]}),_:1},8,["label"])):x("",!0),e.table.isColumnVisible("last_purchase_date")?(r(),E(c,{key:1,label:A(u)("Last Purchase Date"),width:"200"},{default:d(f=>{var _;return[n(Ba,{class:"hover:no-underline",to:{name:"view_customer",params:{customer_id:(_=f.row)==null?void 0:_.id}}},{default:d(()=>[f.row.last_purchase_date?(r(),E(Pa,{key:0,"date-time":f.row.last_purchase_date},null,8,["date-time"])):(r(),h("span",gh,"---"))]),_:2},1032,["to"])]}),_:1},8,["label"])):x("",!0),e.table.isColumnVisible("customer_since")?(r(),E(c,{key:2,label:A(u)("Customer Since"),width:"150"},{default:d(f=>{var _;return[n(Ba,{class:"hover:no-underline",to:{name:"view_customer",params:{customer_id:(_=f.row)==null?void 0:_.id}}},{default:d(()=>[n(Pa,{"date-time":f.row.created_at},null,8,["date-time"])]),_:2},1032,["to"])]}),_:1},8,["label"])):x("",!0)]),_:1},8,["data"])}}},bh={class:"fct-customer-table-mobile-wrap"},wh=["onClick"],Ch={class:"fct-customer-table-mobile-header"},kh={key:0,class:"fct-customer-table-customer-col fct-customer-card"},Bh={class:"fct-customer-avatar"},xh=["src"],Sh={class:"fct-customer-details"},Fh={class:"fct-customer-name"},$h={class:"fct-customer-id"},Eh={class:"fct-customer-email"},Uh={class:"fct-customer-table-purchases-col"},Ih={class:"fct-customer-table-mobile-body"},Qh={class:"fct-customer-table-mobile-body-list"},Dh={key:0,class:"fct-customer-table-ltv-col"},Vh={class:"label"},Th=["innerHTML"],Mh={key:1,class:"fct-customer-table-last-purchase-date-col"},Lh={class:"label"},Rh={class:"value"},Oh={key:2,class:"fct-customer-table-customer-since-col"},Ph={class:"label"},Hh={class:"value"},Nh={class:"fct-customer-table-mobile-footer"},Kh={class:"fct-customer-table-address-col"},Gh={key:0,class:"py-6 text-center"},zh={__name:"CustomersTableMobile",props:{table:{type:Object,required:!0},emptyText:{type:String,default:u("No customers found.")}},setup(e){return(t,a)=>(r(),h("div",bh,[(r(!0),h(P,null,te(e.table.getTableData(),(l,s)=>(r(),h("div",{key:l.id,class:"fct-customer-table-mobile-row",onClick:i=>t.$router.push({name:"view_customer",params:{customer_id:l.id}})},[o("div",Ch,[l!=null&&l.id?(r(),h("div",kh,[o("div",Bh,[o("img",{src:l==null?void 0:l.photo,alt:"avatar"},null,8,xh)]),o("div",Sh,[o("div",Fh,[R(m((l==null?void 0:l.full_name)||A(u)("No Name"))+" ",1),o("span",$h,"#"+m(l==null?void 0:l.id),1)]),o("div",Eh,m(l==null?void 0:l.email),1)])])):x("",!0),o("div",Uh,m(l.purchase_count)+" "+m(l.purchase_count>1?A(u)("Purchases"):A(u)("Purchase")),1)]),o("div",Ih,[o("ul",Qh,[e.table.isColumnVisible("ltv")?(r(),h("li",Dh,[o("div",Vh,m(A(u)("LTV:")),1),o("div",{class:"value",innerHTML:A(ft).formatNumber(l.ltv,!0,!1)},null,8,Th)])):x("",!0),e.table.isColumnVisible("last_purchase_date")?(r(),h("li",Mh,[o("div",Lh,m(A(u)("Last Purchase Date:")),1),o("div",Rh,[n(Pa,{"date-time":l.last_purchase_date},null,8,["date-time"])])])):x("",!0),e.table.isColumnVisible("customer_since")?(r(),h("li",Oh,[o("div",Ph,m(A(u)("Customer Since:")),1),o("div",Hh,[n(Pa,{"date-time":l.created_at},null,8,["date-time"])])])):x("",!0)])]),o("div",Nh,[o("div",Kh,[n(Y,{name:"LocationPin"}),R(" "+m(t.getOrderAddress(l)),1)])])],8,wh))),128)),e.table.getTableData().length===0?(r(),h("div",Gh,[n(Ct,{icon:"Empty/Order","has-dark":"",text:e.emptyText},null,8,["text"])])):x("",!0)]))}},jh={},qh={class:"px-4 py-3"},Yh={class:"flex items-center justify-between mb-3"},Wh={class:"flex items-center justify-between mb-3"},Jh={class:"flex items-center justify-between mb-3"},Xh={class:"flex items-center justify-between mb-3"};function Zh(e,t){const a=C("el-skeleton-item"),l=C("el-skeleton");return r(),E(l,{animated:""},{template:d(()=>[o("div",qh,[o("div",Yh,[n(a,{varient:"p",class:"w-1/2"}),n(a,{varient:"p",class:"w-[100px]"})]),o("div",Wh,[n(a,{varient:"p",class:"w-[50px]"}),n(a,{varient:"p",class:"w-[80px]"})]),o("div",Jh,[n(a,{varient:"p",class:"w-[120px]"}),n(a,{varient:"p",class:"w-[100px]"})]),o("div",Xh,[n(a,{varient:"p",class:"w-[100px]"}),n(a,{varient:"p",class:"w-[100px]"})]),n(a,{varient:"p",class:"w-[230px]"})])]),_:1})}const e_=nt(jh,[["render",Zh]]),t_={class:"fct-all-customers-page fct-layout-width"},a_={class:"fct-all-customers-wrap"},l_={key:1},s_={__name:"AllCustomers",setup(e){const t=hA(),a=T({showModal:!1,action:"create",title:u("Create New Customer"),customer:{}}),l=T(!1),s=T(!1),i=T([]),c=(y=!0)=>{const v=t.buildQueryParams();return y||(delete v.active_view,delete v.filter_type,delete v.search,delete v.advanced_filters),v},p=eA({entity:"customers",buildParams:()=>c(),buildAllParams:()=>c(!1),filenamePrefix:"customers-export"}),f=({scope:y,columns:v,modules:w,format:k})=>{let b=[];y==="current_page"?b=t.getTableData().map(S=>S.id).filter(Boolean):y==="selected"&&(b=i.value.map(S=>S.id).filter(Boolean)),p.startExport({scope:y,ids:b,columns:v,modules:w,format:k})},_=y=>{i.value=y},g=()=>{l.value=window.innerWidth<768};return Ie(()=>{g(),window.addEventListener("resize",g)}),Bt(()=>{window.removeEventListener("resize",g)}),(y,v)=>{const w=C("el-icon"),k=C("el-button"),b=C("el-dropdown-item"),S=C("el-dropdown-menu"),$=C("el-dropdown");return r(),h("div",t_,[n(ol,{title:A(u)("Customers")},{action:d(()=>[n(Ot,{permission:"customers/export"},{default:d(()=>[n($,{trigger:"click","popper-class":"fct-dropdown",placement:"bottom-end"},{dropdown:d(()=>[n(S,null,{default:d(()=>[n(b,{onClick:v[0]||(v[0]=D=>s.value=!0)},{default:d(()=>[n(Y,{name:"Download"}),R(" "+m(A(u)("Export Customers")),1)]),_:1})]),_:1})]),default:d(()=>[n(k,null,{default:d(()=>[R(m(A(u)("More actions"))+" ",1),n(w,null,{default:d(()=>[n(A(Hn))]),_:1})]),_:1})]),_:1})]),_:1}),n(Ot,{permission:"customers/manage"},{default:d(()=>[n(k,{type:"primary",onClick:v[1]||(v[1]=D=>a.value.showModal=!0)},{default:d(()=>[R(m(A(u)("Add Customer")),1)]),_:1})]),_:1})]),_:1},8,["title"]),n(Ot,{permission:"customers/view"},{default:d(()=>[o("div",a_,[n(Ts,{table:A(t),"has-mobile-slot":!0},{mobile:d(()=>[A(t).isLoading()?(r(),E(e_,{key:0})):x("",!0),n(zh,{table:A(t)},null,8,["table"])]),default:d(()=>[A(t).isLoading()?(r(),E(uh,{key:0,customerTable:A(t),"next-page-count":A(t).nextPageCount},null,8,["customerTable","next-page-count"])):(r(),h("div",l_,[n(yh,{table:A(t),onSelectionChange:_},null,8,["table"])]))]),_:1},8,["table"])])]),_:1}),n(Ot,{permission:"customers/manage"},{default:d(()=>[n(nd,{"onUpdate:customerModal":v[2]||(v[2]=()=>{a.value.showModal=!1,a.value.customer={},A(t).fetch()}),customerModalInfos:a.value,customer_id:a.value.customer_id,customer:a.value.customer,onCloseModal:v[3]||(v[3]=D=>a.value.showModal=!1)},null,8,["customerModalInfos","customer_id","customer"])]),_:1}),n(tA,{modelValue:s.value,"onUpdate:modelValue":v[4]||(v[4]=D=>s.value=D),title:A(u)("Export Customers"),"selected-count":i.value.length,"current-page-count":A(t).getTableData().length,"total-count":A(t).data.paginate.total,"item-label-singular":A(u)("customer"),"item-label-plural":A(u)("customers"),"has-active-filter":!!A(t).isFiltering(),"export-state":A(p),onExport:f},null,8,["modelValue","title","selected-count","current-page-count","total-count","item-label-singular","item-label-plural","has-active-filter","export-state"])])}}};class n_ extends Vs{getTabs(){return{all:u("All"),completed:u("Completed"),processing:u("Processing"),"on-hold":u("On Hold"),paid:u("Paid"),subscription:u("Subscription"),renewal:u("Renewal"),refunded:u("Refunded"),partially_refunded:u("Partially Refunded"),upgraded_from:{title:u("Upgraded From"),description:u("Orders upgraded from another order")},upgraded_to:{title:u("Upgraded To"),description:u("Orders upgraded to another order")}}}getToggleableColumns(){return[{label:u("Customer"),value:"customer"},{label:u("Items"),value:"order_items"},{label:u("Order Status"),value:"status"},{label:u("Order Type"),value:"type"},{label:u("Actions"),value:"actions"}]}getSearchHint(){return u("Search by invoice no, customer name, or customer email.")}getFetchUrl(){return"orders"}parseResponse(t){return t.orders}getTableName(){return"order_table"}with(){return["admin_order_list"]}}function _A(e){return n_.init(e)}const o_={class:"fct-order-stats-card"},i_={class:"fct-order-stats-card-head"},r_={class:"fct-order-stats-card-head-content"},d_={class:"text"},u_={key:0,class:"value"},c_={class:"fct-order-stats-card-body"},A_={key:0,class:"change-wrap"},p_={key:0,class:"change-title"},f_={key:1,class:"change-title"},m_={key:1,class:"change-wrap"},h_={class:"change-title"},__={__name:"StatCard",props:{direction:String,stat:Object,statRanges:Object,currentRange:String|Number,statKey:String|Number,loading:Boolean},setup(e){const t=Jt().ctx,a=e,l=K(()=>{switch(a.statKey){case"total_orders":return"warning";case"paid_orders":return"blue";case"total_paid_order_items":return"danger";case"total_paid_amounts":return"secondary";default:return"info"}}),s=K(()=>c.value===0?"":c.value>0?"success":"danger"),i=f=>f.is_cents?t.formatNumber(f.current_count):sa(f.current_count),c=K(()=>{let f=_m(a.stat.current_count,a.stat.compare_count)??0;return f===""?0:f}),p=K(()=>a.statRanges[a.currentRange].label);return(f,_)=>{const g=C("el-skeleton"),y=C("el-skeleton-item");return r(),h("div",o_,[o("div",i_,[n(at,{size:"large",bg:l.value,soft:""},{default:d(()=>[ga(f.$slots,"icon")]),_:3},8,["bg"]),o("div",r_,[n(g,{loading:e.loading,animated:"",rows:0},null,8,["loading"]),o("span",d_,m(e.stat.title),1),e.loading?x("",!0):(r(),h("div",u_,m(i(e.stat)),1))])]),o("div",c_,[n(g,{loading:e.loading,animated:""},{template:d(()=>[n(y,{variant:"p",class:"w-1/2 h-4"})]),_:1},8,["loading"]),!e.loading&&e.currentRange!=="all_time"?(r(),h("div",A_,[o("span",{class:de("change "+s.value)},[c.value!==0?(r(),E(Y,{key:0,name:c.value>0?"CaretUp":"CaretDown"},null,8,["name"])):x("",!0),R(" "+m(c.value===0?f.$t("Same as previous"):Math.abs(c.value)+"%"),1)],2),c.value>0?(r(),h("span",p_,m(A(u)("More than %s",p.value==="Today"?f.$t("Yesterday"):f.$t(p.value))),1)):c.value<0?(r(),h("span",f_,m(A(u)("Less than %s",p.value==="Today"?f.$t("Yesterday"):f.$t(p.value))),1)):x("",!0)])):x("",!0),!e.loading&&e.currentRange==="all_time"?(r(),h("div",m_,[o("span",h_,m(f.$t("All Time")),1)])):x("",!0)])])}}},v_={name:"CardFooter"},g_={class:"fct-card-footer"};function y_(e,t,a,l,s,i){return r(),h("div",g_,[ga(e.$slots,"default")])}const Ad=nt(v_,[["render",y_]]);class vA{constructor(){Pe(this,"_attributes",{})}attribute(t,a){return this._attributes[t]=a,this}setAttribute(t){return this._attributes=typeof t=="object"?t:this._attributes,this}}class ms{static install(t,a,l={},s=!1){const i=new a(...Object.values(l));Object.keys(i).forEach(c=>{(s||!t.hasOwnProperty(c))&&(t[c]=i[c])}),Object.getOwnPropertyNames(a.prototype).forEach(c=>{c!=="constructor"&&typeof i[c]=="function"&&(s||typeof t[c]!="function")&&(t[c]=i[c].bind(t))})}}class b_ extends tl{constructor(){super(...arguments);Pe(this,"data",{salesGrowthChart:[],countryHeatMap:[],fluctuations:[],dashBoardStats:[],recentOrders:[],recentActivities:[],topSoldProducts:[],currencySign:ze.get("shop.currency_sign"),isBusy:{recentActivities:!1,fluctuations:!1,dashBoardStats:!1,recentOrders:!1,countryHeatMap:!1,salesGrowthChart:!0,topSoldProducts:!0}})}get controllerKey(){return"ReportingController"}beforeInit(){}makeRequest(a,l,s,i){this.data.isBusy[i]=!0,typeof l!="object"&&(l={});const c=Ae.get(`reports/${a}`,l);return this.resolvePromiseResponse(c,s,i),c}resolvePromiseResponse(a,l=null,s=null){a.then(i=>{s==null||l==null||(this.data[s]=i[l])}).catch(i=>{}).finally(()=>{this.data.isBusy[s]=!1})}getDashboardStats(a={}){return this.makeRequest("dashboard-stats",a,"dashBoardStats","dashBoardStats")}getSalesGrowthChart(a={}){return this.makeRequest("sales-growth-chart",a,"salesGrowthChart","salesGrowthChart")}getCountryHeatMap(a={}){return this.makeRequest("country-heat-map",a,"countryHeatMap","countryHeatMap")}getRecentOrders(a={}){return this.makeRequest("get-recent-orders",a,"recentOrders","recentOrders")}getRecentActivities(a={}){return this.makeRequest("get-recent-activities",a,"recentActivities","recentActivities")}getSummary(a={}){return this.makeRequest("get-dashboard-summary",a,"summaryData","summaryData")}getTopSoldProducts(a={}){return this.makeRequest("fetch-top-sold-products",a,"topSoldProducts","topSoldProducts")}}const rl=b_.init(),w_={},C_={class:"fct-order-stats-row"},k_={class:"p-4 bg-gray-25 rounded dark:bg-primary-500"},B_={class:"flex items-center gap-2 mb-3"},x_={class:"right flex flex-col flex-1 gap-2"};function S_(e,t){const a=C("el-skeleton-item"),l=C("el-skeleton");return r(),h("div",C_,[(r(),h(P,null,te(4,s=>n(l,{animated:"",key:s},{template:d(()=>[o("div",k_,[o("div",B_,[n(a,{variant:"p",class:"rounded w-10 h-10 block"}),o("div",x_,[n(a,{variant:"p",class:"rounded w-4/5 block"}),n(a,{variant:"p",class:"rounded w-1/2 block"})])]),o("div",null,[n(a,{variant:"p",class:"rounded w-2/3 block"})])])]),_:2},1024)),64))])}const F_=nt(w_,[["render",S_]]),$_={class:"fct-order-stats-wrap"},E_={class:"fct-order-stats-actions flex items-center gap-2.5"},U_={class:"fct-order-stats-body"},I_={key:1,class:"fct-order-stats-row"},Q_={class:"flex justify-end mt-2"},D_=Object.assign({name:"OrderStatBar"},{__name:"OrderStatBar",setup(e){const t=T(Vt.get("order_stat_collapse",!1)),a=T(""),l=Jt().ctx,s=T(!1),i=T(!0),c=T(!1),p=T("-7 days"),f=sl(),_=T({"-0 days":{label:u("Today"),desc:u("Compared to yesterday")},"-7 days":{label:u("Last 7 days"),desc:u("Compared to the previous 7 days")},"-30 days":{label:u("Last 30 days"),desc:u("Compared to the previous 30 days")},this_month:{label:u("This Month"),desc:u("Compared to the previous Month")},all_time:{label:u("All Time"),desc:u("See All time Sales Stat")}}),g=async v=>{if(p.value!==v)try{p.value=v,a.value="collapse",t.value===!0&&(t.value=!1,Vt.set("order_stat_collapse",t.value)),await Promise.all([l.Storage().set("order_quick_stat_bar_range",p.value),y()])}catch{}},y=()=>{c.value=!1,i.value=!0;const v={"-0 days":[lt().startOf("day").format("YYYY-MM-DD"),lt().endOf("day").format("YYYY-MM-DD")],"-7 days":[lt().subtract(7,"days").startOf("day").format("YYYY-MM-DD"),lt().endOf("day").format("YYYY-MM-DD")],"-30 days":[lt().subtract(30,"days").startOf("day").format("YYYY-MM-DD"),lt().endOf("day").format("YYYY-MM-DD")],this_month:[lt().startOf("month").format("YYYY-MM-DD"),lt().endOf("day").format("YYYY-MM-DD")],all_time:[null,null]},[w,k]=v[p.value]||[lt().startOf("month"),lt().endOf("day")],b={startDate:w,endDate:k,paymentStatus:"all"};rl.getDashboardStats({params:{...b}}).then(()=>{s.value=rl.data.dashBoardStats}).catch(S=>{}).finally(()=>{i.value=!1})};return Ie(()=>{p.value=Vt.get("order_quick_stat_bar_range","-0 days");let v=Vt.get("order_quick_stat_bar_collapse_item");a.value=v===null?"collapse":v,y()}),(v,w)=>{const k=C("el-button");return r(),h("div",$_,[n(Se,null,{default:d(()=>[n(Ve,{title:A(u)("Order Stats Overview"),border_bottom:""},{action:d(()=>[o("div",E_,[n(ad,{class:"hide-animation-on-mobile"},{default:d(()=>[(r(!0),h(P,null,te(_.value,(b,S)=>(r(),E(Qo,{title:`${A(u)("Order Stats Overview of")} ${b.label}`,tabindex:"0",key:S,onClick:$=>g(S),class:de(S===p.value?"active":"")},{default:d(()=>[R(m(b.label),1)]),_:2},1032,["title","onClick","class"]))),128))]),_:1})])]),_:1},8,["title"]),n(ke,null,{default:d(()=>[o("div",U_,[i.value?(r(),E(F_,{key:0})):(r(),h("div",I_,[(r(!0),h(P,null,te(s.value,(b,S)=>(r(),h("div",{key:S,class:"fct-order-stats-col cursor-pointer",onClick:w[0]||(w[0]=$=>A(f).push({name:"reports_orders"}))},[(r(),E(__,{key:S,stat:b,"current-range":p.value,"stat-ranges":_.value,loading:i.value,"stat-key":S},{icon:d(()=>[n(Y,{name:b.icon},null,8,["name"])]),_:2},1032,["stat","current-range","stat-ranges","loading","stat-key"]))]))),128))])),o("div",Q_,[n(k,{text:"",class:"underline-link-button",onClick:w[1]||(w[1]=b=>A(f).push({name:"reports_orders"}))},{default:d(()=>[R(m(A(u)("See Full Report")),1)]),_:1})])])]),_:1})]),_:1})])}}}),V_={class:"table-cell"},T_={class:"table-cell"},M_={class:"table-cell"},L_={class:"table-cell"},R_={class:"table-cell items-center gap-1"},O_={class:"table-cell"},P_={class:"table-cell"},H_={class:"table-cell"},N_={__name:"OrdersLoader",props:{nextPageCount:{type:Number,default:0},orderTable:{type:Object,default:()=>({})}},setup(e){const t=e,a=s=>t.orderTable.columns.includes(s),l=Array.from({length:t.nextPageCount},(s,i)=>i+1);return(s,i)=>{const c=C("el-table-column"),p=C("el-skeleton-item"),f=C("el-table"),_=C("el-skeleton");return r(),E(_,{animated:""},{template:d(()=>[n(f,{data:A(l),class:"w-full compact-table responsive"},{empty:d(()=>i[0]||(i[0]=[])),default:d(()=>[x("",!0),n(c,{label:s.$t("Date"),width:"140"},{default:d(()=>[o("div",V_,[n(p,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"]),a("customer")?(r(),E(c,{key:1,width:"130",label:s.$t("Customer")},{default:d(()=>[o("div",T_,[n(p,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"])):x("",!0),a("order_items")?(r(),E(c,{key:2,label:s.$t("Items"),width:"402"},{default:d(()=>[o("div",M_,[n(p,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"])):x("",!0),n(c,{width:"150",label:s.$t("Total")},{default:d(()=>[o("div",L_,[n(p,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"]),n(c,{width:"150",label:s.$t("Payment Status")},{default:d(()=>[o("div",R_,[n(p,{variant:"p",class:"w-4/5"}),n(p,{variant:"p",class:"w-3/5"})])]),_:1},8,["label"]),a("status")?(r(),E(c,{key:3,width:"120",label:s.$t("Status")},{default:d(()=>[o("div",O_,[n(p,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"])):x("",!0),a("type")?(r(),E(c,{key:4,width:"140",label:s.$t("Order Type")},{default:d(()=>[o("div",P_,[n(p,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"])):x("",!0),a("actions")?(r(),E(c,{key:5,width:"60",label:""},{default:d(()=>[o("div",H_,[n(p,{variant:"p",class:"w-3/5"})])]),_:1})):x("",!0)]),_:1},8,["data"])]),_:1})}}},K_={},G_={class:"px-4 py-3"},z_={class:"grid grid-cols-3 gap-5 mt-5"};function j_(e,t){const a=C("el-skeleton-item"),l=C("el-skeleton");return r(),E(l,{animated:""},{template:d(()=>[o("div",G_,[(r(),h(P,null,te(2,s=>o("div",{key:s,class:"flex items-center justify-between mb-3"},[n(a,{varient:"p",class:"w-1/2"}),n(a,{varient:"p",class:"w-[100px]"})])),64)),o("div",z_,[(r(),h(P,null,te(3,s=>o("div",{key:s},[n(a,{varient:"p",class:"w-1/2"}),n(a,{varient:"p",class:"w-[100px]"})])),64))])])]),_:1})}const q_=nt(K_,[["render",j_]]),Y_={class:"fct-all-orders-page fct-layout-width"},W_={class:"fct-delete-test-orders-content"},J_={if:"deleteTestOrdersProgressTitle",class:"fct-delete-test-orders-title"},X_={class:"fct-delete-test-orders-meta"},Z_={class:"fct-delete-test-orders-text"},ev={key:0,class:"fct-delete-test-orders-loading"},tv={class:"fct-test-orders-loading-content"},av={class:"fct-loading-bars"},lv=["id"],sv={class:"fct-delete-test-orders-percentage"},nv={class:"fct-delete-test-orders-stats"},ov={class:"fct-delete-test-orders-stat-row"},iv={class:"fct-delete-test-orders-stat-label"},rv={class:"fct-delete-test-orders-stat-value"},dv={class:"fct-delete-test-orders-stat-row"},uv={class:"fct-delete-test-orders-stat-label"},cv={class:"fct-delete-test-orders-stat-value is-success"},Av={class:"fct-delete-test-orders-stat-row"},pv={class:"fct-delete-test-orders-stat-label"},fv={class:"fct-delete-test-orders-stat-value is-danger"},mv={key:1,class:"fct-delete-test-orders-message"},hv={key:0,class:"dialog-footer"},_v={class:"fct-all-orders-wrap"},vv={__name:"AllOrders",setup(e){const t=_A({instance:Jt()}),a=T(!1),l=T(!1),s=T(!1),i=T(!1),c=T({total:0,processed:0,deleted:0,failed:0}),p=T(""),f=T(!1),_=T([]),g=(V=!0)=>{const I=t.buildQueryParams();return V||(delete I.active_view,delete I.filter_type,delete I.search,delete I.advanced_filters),I},y=eA({entity:"orders",buildParams:()=>g(),buildAllParams:()=>g(!1),filenamePrefix:"orders-export"}),v=({scope:V,columns:I,modules:M,format:O})=>{let L=[];V==="current_page"?L=t.getTableData().map(H=>H.id).filter(Boolean):V==="selected"&&(L=_.value.map(H=>H.id).filter(Boolean)),y.startExport({scope:V,ids:L,columns:I,modules:M,format:O})},w=V=>{_.value=V},k=K(()=>c.value.total?Math.min(100,Math.round(c.value.processed/c.value.total*100)):0),b=K(()=>{if(!c.value.total)return"";const V=Math.min(c.value.processed,c.value.total);return s.value?u("Deleting %1$s of %2$s Test Orders",V,c.value.total):u("Deleted %1$s of %2$s Test Orders",V,c.value.total)}),S=K(()=>c.value.total?s.value?u("Deleting... %1$s",`${k.value}%`):u("Completed"):""),$=()=>{l.value=window.innerWidth<768},D=()=>{c.value={total:0,processed:0,deleted:0,failed:0},p.value=""},F=V=>{V==="show_order_stats"&&(Vt.set("show_order_stats",!a.value),a.value=!a.value),V==="show_delete_bulk_action"&&t.showBulkDeleteAction(!0),V==="hide_delete_bulk_action"&&t.showBulkDeleteAction(!1),V==="delete_test_orders"&&B()},B=async()=>{var V,I;if(!s.value){try{await Fl.confirm(u("Are you sure you want to delete all test orders? This action cannot be undone."),u("Confirm Delete!"),{confirmButtonText:u("Delete"),cancelButtonText:u("Cancel"),cancelButtonClass:"el-button--small",confirmButtonClass:"el-button--small",type:"warning"})}catch{return}s.value=!0,i.value=!0,D();try{let M=0,O=0,L=0;for(;;){const j=await Ae.post("orders/do-bulk-action",{action:"delete_test_orders",last_order_id:M}),W=j||{};if(O=O||Number(W.total_count||0),L+=Number(W.batch_count||0),c.value={total:O,processed:L,deleted:c.value.deleted+Number(W.deleted_count||0),failed:c.value.failed+Number(W.failed_count||0)},p.value=W.has_more?u("Processed %1$s of %2$s test orders...",Math.min(L,O),O):(j==null?void 0:j.message)||"",!W.has_more)break;M=Number(W.last_attempted_order_id||0),await new Promise(G=>setTimeout(G,100))}if(!c.value.total){i.value=!1,q.info(u("No test orders found to delete"));return}const H=c.value.failed?u("Deleted %1$s test orders. %2$s test orders could not be deleted.",c.value.deleted,c.value.failed):u("Deleted %s test orders successfully",c.value.deleted);p.value=H,q.success(H),t.fetch()}catch(M){p.value=((V=M==null?void 0:M.data)==null?void 0:V.message)||u("Failed to delete test orders"),q.error(((I=M==null?void 0:M.data)==null?void 0:I.message)||u("Failed to delete test orders"))}finally{s.value=!1}}},U=()=>{i.value=!1},Q=()=>{const V=Vt.get("show_order_stats");V&&(a.value=V)};return Ie(()=>{Q(),$(),window.addEventListener("resize",$)}),Bt(()=>{window.removeEventListener("resize",$)}),(V,I)=>{const M=C("el-icon"),O=C("el-button"),L=C("el-dropdown-item"),H=C("el-dropdown-menu"),j=C("el-dropdown"),W=C("el-tag"),G=C("el-progress"),Z=C("el-dialog");return r(),h("div",Y_,[n(ol,{title:A(u)("Orders")},{action:d(()=>[n(Ot,{permission:["reports/view","orders/manage","orders/export","orders/delete"]},{default:d(()=>[n(j,{trigger:"click","popper-class":"fct-dropdown",onCommand:F,placement:"bottom-end"},{dropdown:d(()=>[n(H,null,{default:d(()=>[n(Ot,{permission:"reports/view"},{default:d(()=>[n(L,{command:"show_order_stats"},{default:d(()=>[a.value?(r(),h(P,{key:1},[n(Y,{name:"EyeOff"}),R(" "+m(A(u)("Hide Order Stats")),1)],64)):(r(),h(P,{key:0},[n(Y,{name:"Eye"}),R(" "+m(A(u)("Show Order Stats")),1)],64))]),_:1}),A(t).data.showDeleteBulkAction?x("",!0):(r(),E(L,{key:0,command:"show_delete_bulk_action"},{default:d(()=>[n(Y,{name:"Eye"}),R(" "+m(A(u)("Show Bulk Actions")),1)]),_:1})),A(t).data.showDeleteBulkAction?(r(),E(L,{key:1,command:"hide_delete_bulk_action"},{default:d(()=>[n(Y,{name:"EyeOff"}),R(" "+m(A(u)("Hide Bulk Actions")),1)]),_:1})):x("",!0)]),_:1}),n(Ot,{permission:"orders/delete"},{default:d(()=>[n(L,{command:"delete_test_orders",disabled:s.value,class:"item-destructive"},{default:d(()=>[n(Y,{name:"Delete"}),R(" "+m(s.value?A(u)("Deleting Test Orders..."):A(u)("Delete Test Orders")),1)]),_:1},8,["disabled"])]),_:1}),n(Ot,{permission:"orders/export"},{default:d(()=>[n(L,{onClick:I[0]||(I[0]=ne=>f.value=!0)},{default:d(()=>[n(Y,{name:"Download"}),R(" "+m(A(u)("Export Orders")),1)]),_:1})]),_:1})]),_:1})]),default:d(()=>[n(O,null,{default:d(()=>[R(m(A(u)("More actions"))+" ",1),n(M,null,{default:d(()=>[n(A(Hn))]),_:1})]),_:1})]),_:1})]),_:1}),n(Ot,{permission:"orders/create"},{default:d(()=>[n(O,{tag:"router-link",type:"primary",to:{name:"add_order"}},{default:d(()=>[R(m(A(u)("Create Order")),1)]),_:1})]),_:1})]),_:1},8,["title"]),n(Z,{modelValue:i.value,"onUpdate:modelValue":I[1]||(I[1]=ne=>i.value=ne),title:A(u)("Delete Test Orders"),"append-to-body":!0,"close-on-click-modal":!1,"show-close":!0,"close-on-press-escape":!0,onClose:U,class:"fct-delete-test-orders-modal"},{footer:d(()=>[s.value?x("",!0):(r(),h("div",hv,[n(O,{type:"primary",onClick:U},{default:d(()=>[R(m(A(u)("Done")),1)]),_:1})]))]),default:d(()=>[o("div",W_,[o("div",J_,m(b.value),1),o("div",X_,[o("div",Z_,m(s.value?A(u)("You can close this — deletion will continue in the background"):A(u)("Test order deletion completed.")),1),S.value?(r(),E(W,{key:0,type:"success",class:de(["fct-delete-test-orders-status",{"is-complete":!s.value}])},{default:d(()=>[R(m(S.value),1)]),_:1},8,["class"])):x("",!0)]),s.value?(r(),h("div",ev,[o("div",tv,[o("div",av,[(r(),h(P,null,te(8,ne=>o("div",{key:ne,class:"bar-block",id:`bar-block-${ne+1}`},null,8,lv)),64))]),R(" "+m(A(u)("Deleting...")),1)]),o("span",sv,m(k.value)+"% ",1)])):x("",!0),n(ya,{visible:s.value,fade:"",duration:300},{default:d(()=>[n(G,{percentage:k.value,"stroke-width":6,striped:"","striped-flow":"","show-text":!1,status:s.value?void 0:"success",class:"fct-delete-test-orders-progress"},null,8,["percentage","status"])]),_:1},8,["visible"]),o("div",nv,[o("div",ov,[I[3]||(I[3]=o("span",{class:"fct-delete-test-orders-stat-icon"},[o("svg",{width:"24",height:"24",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{opacity:"0.4",d:"M13.66 1.1333C13.3741 1.09487 13.0575 1.0716 12.7083 1.05762V1.66146V1.70461C12.7083 2.25782 12.7084 2.73471 12.6567 3.11653C12.6017 3.52616 12.4775 3.91865 12.1592 4.23714C11.8409 4.55563 11.4483 4.68009 11.0383 4.73518C10.6566 4.78653 10.18 4.78649 9.62663 4.78646H9.58329H8.74996H8.70662C8.15333 4.78649 7.67666 4.78653 7.29499 4.73518C6.88499 4.68009 6.49249 4.55563 6.17416 4.23714C5.85583 3.91865 5.73166 3.52616 5.67666 3.11653C5.62333 2.72482 5.625 2.23304 5.625 1.66146V1.05762C5.27583 1.0716 4.95917 1.09487 4.67333 1.1333C3.92333 1.23414 3.2925 1.45038 2.79083 1.95198C2.28917 2.45358 2.07249 3.08503 1.97166 3.83513C1.87499 4.55588 1.875 5.47186 1.875 6.60774V13.3818C1.875 14.5178 1.87499 15.4337 1.97166 16.1544C2.07249 16.9046 2.28917 17.536 2.79083 18.0376C3.2925 18.5392 3.92333 18.7554 4.67333 18.8563C5.39417 18.9532 6.31 18.9532 7.44667 18.9531H10.8866C11.0791 18.9532 11.2641 18.9519 11.4433 18.9515C11.2358 18.5378 11.0666 18.3449 10.9875 18.2671C10.18 18.0578 9.58329 17.3269 9.58329 16.4539C9.58329 15.4184 10.4225 14.5789 11.4583 14.5789C11.6941 14.5789 11.9733 14.6359 12.1158 14.6766C12.31 14.7322 12.52 14.8165 12.7383 14.9346C13.1533 14.298 13.6958 13.5629 14.3133 12.9367C14.8741 12.3678 15.5933 11.7846 16.4583 11.432V6.60774C16.4583 5.47186 16.4583 4.55588 16.3616 3.83513C16.2608 3.08503 16.0441 2.45358 15.5425 1.95198C15.0408 1.45038 14.41 1.23414 13.66 1.1333Z",fill:"#017EF3"}),o("path",{d:"M17.012 12.3361C17.4462 12.1825 17.922 12.4094 18.0753 12.8431C18.2295 13.2768 18.002 13.753 17.5687 13.9068C17.1453 14.0568 16.6945 14.3786 16.2395 14.8393C15.7912 15.2944 15.3778 15.845 15.022 16.3897C14.6687 16.9317 14.3828 17.4519 14.1853 17.8374C14.087 18.0296 13.9387 18.3456 13.8879 18.4534C13.7587 18.7501 13.4695 18.9462 13.1453 18.9548C12.822 18.9633 12.5228 18.7836 12.3778 18.4942C12.0112 17.7597 11.6821 17.4672 11.5154 17.3564C11.4421 17.3074 11.3937 17.2895 11.3762 17.284C10.9537 17.2435 10.6237 16.8878 10.6237 16.4548C10.6237 15.9945 10.997 15.6214 11.457 15.6214C11.5645 15.6214 11.7428 15.6547 11.8287 15.6792C12.002 15.7287 12.2112 15.8173 12.4403 15.9698C12.6295 16.0958 12.8245 16.2633 13.0228 16.48C13.1945 16.1726 13.3971 15.8302 13.6271 15.4782C14.0187 14.8772 14.5003 14.2296 15.0528 13.6691C15.6003 13.1143 16.2595 12.6028 17.012 12.3361ZM9.16532 11.8714C9.51032 11.8714 9.79032 12.1513 9.79032 12.4964C9.79032 12.8416 9.51032 13.1214 9.16532 13.1214H5.83203C5.48703 13.1214 5.20703 12.8416 5.20703 12.4964C5.20703 12.1513 5.48703 11.8714 5.83203 11.8714H9.16532ZM12.4987 8.53809C12.8437 8.53809 13.1237 8.81793 13.1237 9.16309C13.1237 9.50826 12.8437 9.78809 12.4987 9.78809H5.83203C5.48703 9.78809 5.20703 9.50826 5.20703 9.16309C5.20703 8.81793 5.48703 8.53809 5.83203 8.53809H12.4987ZM11.457 1.0389V1.66309C11.457 2.26994 11.4562 2.66228 11.417 2.95134C11.3803 3.22242 11.3212 3.3074 11.2737 3.35498C11.2262 3.40256 11.1412 3.46176 10.8704 3.49821C10.5812 3.53706 10.1887 3.53809 9.58199 3.53809H8.74866C8.14203 3.53809 7.74952 3.53706 7.46036 3.49821C7.18952 3.46176 7.10453 3.40256 7.05703 3.35498C7.00953 3.3074 6.95036 3.22242 6.9137 2.95134C6.87453 2.66228 6.8737 2.26994 6.8737 1.66309V1.0389C7.05786 1.03839 7.24786 1.03808 7.44536 1.03809H10.8853C11.0828 1.03808 11.2728 1.03839 11.457 1.0389Z",fill:"#017EF3"})])],-1)),o("span",iv,m(A(u)("Processed")),1),o("span",rv,m(c.value.processed)+" / "+m(c.value.total),1)]),o("div",dv,[I[4]||(I[4]=o("span",{class:"fct-delete-test-orders-stat-icon"},[o("svg",{width:"24",height:"24",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{opacity:"0.4",d:"M16.9433 13.0463C16.88 14.0913 16.8292 14.9197 16.725 15.5813C16.6183 16.2605 16.4475 16.8263 16.1067 17.3205C15.7942 17.773 15.3917 18.1547 14.9258 18.4413C14.4158 18.7555 13.8467 18.8922 13.1692 18.958H8.06417C7.38667 18.8922 6.81667 18.7547 6.30667 18.4405C5.84 18.153 5.4375 17.7705 5.125 17.3172C4.78417 16.8222 4.61417 16.2563 4.50833 15.5763C4.405 14.913 4.355 14.083 4.2925 13.0372L3.75 3.95801H17.5L16.9433 13.0463Z",fill:"#189877"}),o("path",{d:"M11.7488 1.06879C12.2196 1.11046 12.6621 1.25462 13.043 1.53796C13.3238 1.74712 13.5188 2.00379 13.6855 2.28212C13.8405 2.53962 13.9963 2.86046 14.173 3.22462L14.528 3.95879H18.1263C18.5863 3.95879 18.9596 4.33129 18.9596 4.79212C18.9596 5.25212 18.5863 5.62546 18.1263 5.62546H3.1263C2.6663 5.62546 2.29297 5.25212 2.29297 4.79212C2.29297 4.33129 2.6663 3.95879 3.1263 3.95879H6.8013L7.09797 3.30796C7.26964 2.93046 7.4213 2.59796 7.5738 2.33129C7.73797 2.04296 7.93214 1.77629 8.21714 1.55796C8.6013 1.26296 9.05297 1.11379 9.53464 1.06962C9.86213 1.03962 10.193 1.04046 10.5221 1.04129C10.5571 1.04129 10.5913 1.04212 10.6263 1.04212C10.6605 1.04212 10.6955 1.04212 10.7288 1.04212C11.1138 1.04212 11.4605 1.04296 11.7488 1.06879ZM8.63297 3.95879H12.6763C12.4871 3.56879 12.3663 3.32212 12.2571 3.13962C12.0963 2.87296 11.9046 2.75546 11.6005 2.72879C11.3846 2.70962 11.103 2.70879 10.6555 2.70879C10.1963 2.70879 9.90714 2.70962 9.68547 2.72962C9.3738 2.75796 9.17964 2.87962 9.0213 3.15712C8.91714 3.33879 8.80464 3.58212 8.63297 3.95879Z",fill:"#189877"})])],-1)),o("span",uv,m(A(u)("Deleted")),1),o("span",cv,m(c.value.deleted),1)]),o("div",Av,[I[5]||(I[5]=o("span",{class:"fct-delete-test-orders-stat-icon"},[o("svg",{width:"24",height:"24",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{opacity:"0.4",d:"M10.0013 1.04004C14.9488 1.04004 18.9596 5.05082 18.9596 9.99833C18.9596 14.9459 14.9488 18.9567 10.0013 18.9567C5.0538 18.9567 1.04297 14.9459 1.04297 9.99833C1.04297 9.54867 1.40778 9.18392 1.85677 9.18375C2.30677 9.18375 2.6722 9.54858 2.6722 9.99833C2.6722 14.0463 5.95297 17.3282 10.0013 17.3282C14.0496 17.3282 17.3304 14.0463 17.3304 9.99833C17.3304 5.95037 14.0496 2.66846 10.0013 2.66846C9.55138 2.66846 9.18764 2.30434 9.18747 1.85466C9.18747 1.40488 9.5513 1.04004 10.0013 1.04004ZM2.80566 4.66634C3.08066 4.35891 3.55043 4.30436 3.89209 4.55241C4.25514 4.81714 4.33519 5.32656 4.07031 5.69011L3.90674 5.92448C3.53507 6.47876 3.23784 7.08712 3.02784 7.73356C2.88857 8.16094 2.42904 8.39483 2.00163 8.25602C1.57424 8.11701 1.33924 7.65747 1.47835 7.22982C1.77169 6.32508 2.20608 5.48362 2.75358 4.73145L2.80566 4.66634ZM7.3125 1.45345C7.71574 1.36659 8.12817 1.59791 8.25814 1.9987C8.39722 2.42644 8.16233 2.88598 7.73486 3.02491L7.46061 3.12011C6.82564 3.35476 6.23137 3.67519 5.69222 4.06738L5.62224 4.11214C5.26557 4.32003 4.80286 4.22905 4.55453 3.88835C4.29044 3.52472 4.37034 3.01452 4.73356 2.74984L5.02084 2.55046C5.69734 2.09692 6.44048 1.7332 7.23194 1.47624L7.3125 1.45345Z",fill:"#F04438"}),o("path",{d:"M11.9754 6.85201C12.3029 6.58506 12.7854 6.6039 13.0904 6.90897C13.3954 7.21407 13.4145 7.69657 13.147 8.02388L13.0904 8.08736L11.1787 9.99808L13.0895 11.9089L13.147 11.9724C13.4137 12.2997 13.3945 12.7823 13.0895 13.0873C12.7845 13.3923 12.302 13.4113 11.9745 13.1442L11.9112 13.0873L10.0012 11.1765L8.09122 13.0873C7.76538 13.4127 7.23789 13.4127 6.91289 13.0873C6.58706 12.7619 6.58706 12.2344 6.91289 11.9089L8.82288 9.99808L6.91206 8.08736L6.85456 8.02388C6.58789 7.69657 6.60706 7.21407 6.91206 6.90897C7.21706 6.6039 7.69955 6.58506 8.02705 6.85201L8.09039 6.90897L10.0012 8.81975L11.912 6.90897L11.9754 6.85201Z",fill:"#F04438"})])],-1)),o("span",pv,m(A(u)("Failed")),1),o("span",fv,m(c.value.failed),1)])]),p.value&&!s.value?(r(),h("p",mv,m(p.value),1)):x("",!0)])]),_:1},8,["modelValue","title"]),n(Ot,{permission:"reports/view"},{default:d(()=>[a.value?(r(),E(D_,{key:0})):x("",!0)]),_:1}),n(Ot,{permission:"orders/view"},{default:d(()=>[o("div",_v,[n(Ts,{table:A(t),classicTabStyle:!0,hasMobileSlot:!0},{mobile:d(()=>[A(t).isLoading()?(r(),E(q_,{key:0})):x("",!0),A(t).isLoading()?x("",!0):(r(),E(dd,{key:1,table:A(t),orders:A(t).getTableData(),columns:A(t).data.columns,"empty-text":A(t).emptyMessage},null,8,["table","orders","columns","empty-text"]))]),default:d(()=>[A(t).isLoading()?(r(),E(N_,{key:0,orderTable:A(t),"next-page-count":A(t).nextPageCount},null,8,["orderTable","next-page-count"])):(r(),E(rd,{key:1,table:A(t),orders:A(t).getTableData(),columns:A(t).data.columns,"empty-text":A(t).emptyMessage,onSelectionChange:w},null,8,["table","orders","columns","empty-text"]))]),_:1},8,["table"])])]),_:1}),n(tA,{modelValue:f.value,"onUpdate:modelValue":I[2]||(I[2]=ne=>f.value=ne),title:A(u)("Export Orders"),"selected-count":_.value.length,"current-page-count":A(t).getTableData().length,"total-count":A(t).data.paginate.total,"item-label-singular":A(u)("order"),"item-label-plural":A(u)("orders"),"has-active-filter":!!A(t).isFiltering(),"export-state":A(y),onExport:v},null,8,["modelValue","title","selected-count","current-page-count","total-count","item-label-singular","item-label-plural","has-active-filter","export-state"])])}}},gv={class:"setting-wrap"},yv={class:"setting-wrap-inner"},bv={class:"setting-confirmation-content"},wv={class:"custom-wp-editor-wrapper"},Cv={class:"setting-save-action"},kv={__name:"InvoicePacking",setup(e){const t=T([]),a=T([]),l=T(!1),s=T(!1);ws().onSave(()=>{_()});const c=T([u("Invoice Template"),u("Packing Slip Template"),u("Delivery Slip Template"),u("Shipping Slip Template"),u("Dispatch Slip Template")]),p=()=>{l.value=!0,Ae.get("templates/print-templates").then(g=>{t.value=g.templates,l.value=!1}).catch(g=>{q.error(g)}).finally(()=>{l.value=!1})},f=()=>{l.value=!0,Ae.get("settings/confirmation/shortcode",{}).then(g=>{a.value=g.data}).catch(g=>{q.error(g)}).finally(()=>{l.value=!1})},_=()=>{s.value=!0,Ae.put("templates/print-templates",{templates:t.value}).then(g=>{q.success(g.message)}).catch(g=>{q.error(g)}).finally(()=>{s.value=!1})};return Ie(()=>{p(),f()}),(g,y)=>{const v=C("el-skeleton");return C("el-button"),r(),h("div",gv,[n(Ua,{heading:A(u)("Invoice & Packing"),"show-save-button":!1},null,8,["heading"]),o("div",yv,[n(Ia),n(el,{class:"mb-5",type:"information",content:A(u)("It will be available soon!")},null,8,["content"]),l.value?(r(!0),h(P,{key:0},te(c.value,(w,k)=>(r(),E(Se,{key:k},{default:d(()=>[n(Ve,{title:w,border_bottom:""},null,8,["title"]),n(ke,null,{default:d(()=>[n(v,{animated:"",rows:6})]),_:1})]),_:2},1024))),128)):x("",!0),!l.value&&t.value.length>0?(r(),h(P,{key:1},[(r(!0),h(P,null,te(t.value,(w,k)=>(r(),E(Se,{key:k},{default:d(()=>[n(Ve,{title:w.title+" (Under Development)",border_bottom:""},null,8,["title"]),n(ke,null,{default:d(()=>[o("div",bv,[o("div",wv,[n(ls,{"short-codes":a.value,modelValue:w.content,"onUpdate:modelValue":b=>w.content=b,onUpdate:b=>{w.content=b}},null,8,["short-codes","modelValue","onUpdate:modelValue","onUpdate"])])])]),_:2},1024)]),_:2},1024))),128)),o("div",Cv,[x("",!0)])],64)):x("",!0)])])}}},Bv={key:0,class:"bg-white p-10 rounded m-10 dark:bg-dark-600"},xv={__name:"PdfTemplateRoute",setup(e){const t=ze.get("app_config.isProActive");return(a,l)=>{const s=C("router-view");return A(t)?(r(),E(s,{key:1})):(r(),h("div",Bv,[n(dn,{placement:"feature_lock_pdf_templates",title:A(u)("PDF Templates"),text:A(u)("Customizable PDF receipts, invoices, and e-invoices with ZUGFeRD support.")},null,8,["title","text"])]))}}},Sv={class:"setting-wrap"},Fv={class:"setting-wrap-inner"},$v={class:"flex gap-5"},Ev={class:"flex flex-col items-center justify-center py-12 text-center"},Uv={class:"text-lg font-semibold mb-2 text-system-dark dark:text-gray-200"},Iv={class:"text-sm text-system-mid dark:text-gray-400 mb-6 max-w-md"},Qv={class:"fct-pdf-template-desc"},Dv={class:"fct-pdf-template-grid"},Vv={class:"fct-pdf-template-preview"},Tv={class:"fct-pdf-template-preview-placeholder"},Mv={class:"fct-pdf-placeholder-text"},Lv={class:"fct-pdf-template-overlay"},Rv={class:"fct-pdf-template-footer"},Ov={class:"fct-pdf-template-name-row"},Pv={class:"fct-pdf-template-title"},Hv={key:0,class:"fct-pdf-badge fct-pdf-badge--default"},Nv={__name:"PdfTemplateIndex",setup(e){const t=sl(),a=T(!0),l=T(!1),s=T({}),i=T(!1),c=T(""),p=T(!1),f=T(""),_=T(null),g=T(!1),y=T(!1),v=ze.get("app_config.isProActive"),w=()=>{a.value=!0,Ae.get("settings/pdf-templates/receipt").then(F=>{s.value=F.templates||{},l.value=F.has_fluent_pdf||!1,_.value=F.addon_info||null}).catch(F=>{var B;q.error(((B=F.data)==null?void 0:B.message)||u("Failed to load templates"))}).finally(()=>{a.value=!1})},k=()=>{if(_.value){if(!v&&_.value.repo_link){window.open(_.value.repo_link,"_blank","noopener,noreferrer");return}g.value=!0,Ae.post("settings/modules/plugin-addons/install",{plugin_slug:_.value.plugin_slug,source_type:_.value.source_type||"wordpress",source_link:_.value.source_link||"",asset_path:_.value.asset_path||""}).then(F=>{q.success(F.message||u("Plugin installed successfully")),setTimeout(()=>{window.location.reload()},500)}).catch(F=>{var B;q.error(((B=F.data)==null?void 0:B.message)||u("Failed to install plugin"))}).finally(()=>{g.value=!1})}},b=()=>{_.value&&(y.value=!0,Ae.post("settings/modules/plugin-addons/activate",{plugin_file:_.value.plugin_file}).then(F=>{q.success(F.message||u("Plugin activated successfully")),setTimeout(()=>{window.location.reload()},500)}).catch(F=>{var B;q.error(((B=F.data)==null?void 0:B.message)||u("Failed to activate plugin"))}).finally(()=>{y.value=!1}))},S=()=>{c.value="",i.value=!0},$=()=>{if(!c.value.trim()){q.error(u("Please enter a template name"));return}p.value=!0,Ae.post("settings/pdf-templates/create",{title:c.value.trim()}).then(F=>{i.value=!1,q.success(F.message||u("Template created")),F.slug?t.push({name:"edit-pdf-template",params:{template:F.slug}}):w()}).catch(F=>{var B;q.error(((B=F.data)==null?void 0:B.message)||u("Failed to create template"))}).finally(()=>{p.value=!1})},D=F=>{f.value=F,Ae.delete("settings/pdf-templates/delete/"+F).then(B=>{q.success(B.message||u("Template deleted")),w()}).catch(B=>{var U;q.error(((U=B.data)==null?void 0:U.message)||u("Failed to delete template"))}).finally(()=>{f.value=""})};return Ie(()=>{w()}),(F,B)=>{const U=C("el-button"),Q=C("el-skeleton-item"),V=C("el-skeleton"),I=C("el-popconfirm"),M=C("el-input"),O=C("el-form-item"),L=C("el-form"),H=C("el-dialog");return r(),h("div",Sv,[n(Ua,{heading:A(u)("PDF Templates"),"show-save-button":!1},oa({_:2},[l.value?{name:"action",fn:d(()=>[n(U,{type:"primary",size:"small",onClick:S},{default:d(()=>[R(m(A(u)("Add Template")),1)]),_:1})]),key:"0"}:void 0]),1032,["heading"]),o("div",Fv,[n(Ia),a.value?(r(),E(Se,{key:0},{default:d(()=>[n(ke,null,{default:d(()=>[n(V,{animated:""},{template:d(()=>[n(Q,{variant:"text",class:"w-[300px] mb-4"}),o("div",$v,[n(Q,{variant:"rect",style:{width:"220px",height:"280px","border-radius":"8px"}}),n(Q,{variant:"rect",style:{width:"220px",height:"280px","border-radius":"8px"}})])]),_:1})]),_:1})]),_:1})):x("",!0),!a.value&&!l.value&&_.value?(r(),E(Se,{key:1},{default:d(()=>[n(ke,null,{default:d(()=>[o("div",Ev,[B[3]||(B[3]=o("svg",{class:"mb-4",width:"48",height:"48",viewBox:"0 0 32 32",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[o("path",{d:"M8 2C6.9 2 6 2.9 6 4v24c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V10l-8-8H8z"}),o("path",{d:"M18 2v8h8"}),o("path",{d:"M12 18h8M12 22h6"})],-1)),o("h3",Uv,m(A(u)("Fluent PDF Required")),1),o("p",Iv,m(A(u)("To use PDF receipt templates, you need to install and activate the Fluent PDF plugin.")),1),_.value.is_installed?_.value.is_installed&&!_.value.is_active?(r(),E(U,{key:1,type:"success",loading:y.value,onClick:b},{default:d(()=>[R(m(A(u)("Activate Plugin")),1)]),_:1},8,["loading"])):x("",!0):(r(),E(U,{key:0,type:"primary",loading:g.value,onClick:k},{default:d(()=>[R(m(A(v)?A(u)("Install & Activate"):A(u)("Download")),1)]),_:1},8,["loading"]))])]),_:1})]),_:1})):x("",!0),!a.value&&l.value?(r(),E(Se,{key:2},{default:d(()=>[n(ke,null,{default:d(()=>[o("p",Qv,m(A(u)("Customize PDF templates for email attachments. Select which template to attach in each email notification's settings.")),1),o("div",Dv,[(r(!0),h(P,null,te(s.value,(j,W)=>(r(),h("div",{key:W,class:"fct-pdf-template-card"},[o("div",Vv,[o("div",Tv,[B[4]||(B[4]=o("svg",{width:"40",height:"40",viewBox:"0 0 32 32",fill:"none",stroke:"#525866","stroke-width":"1.2"},[o("path",{d:"M8 2C6.9 2 6 2.9 6 4v24c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V10l-8-8H8z"}),o("path",{d:"M18 2v8h8"}),o("path",{d:"M12 18h8M12 22h6"})],-1)),o("span",Mv,m(j.title||A(u)("Receipt Template")),1)]),o("div",Lv,[n(U,{type:"primary",size:"small",tag:"router-link",to:{name:"edit-pdf-template",params:{template:W}}},{default:d(()=>[R(m(A(u)("Edit Template")),1)]),_:2},1032,["to"])])]),o("div",Rv,[o("div",Ov,[o("span",Pv,m(j.title||W),1),j.is_default?(r(),h("span",Hv,m(A(u)("Built-in")),1)):x("",!0)]),j.is_default?x("",!0):(r(),E(I,{key:0,title:A(u)("Delete this template?"),"confirm-button-text":A(u)("Delete"),"cancel-button-text":A(u)("Cancel"),"confirm-button-type":"danger",onConfirm:G=>D(W)},{reference:d(()=>[n(U,{type:"danger",size:"small",text:"",loading:f.value===W,class:"fct-pdf-delete-btn"},{default:d(()=>B[5]||(B[5]=[o("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o("path",{d:"M3 6h18"}),o("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})],-1)])),_:2,__:[5]},1032,["loading"])]),_:2},1032,["title","confirm-button-text","cancel-button-text","onConfirm"]))])]))),128))])]),_:1})]),_:1})):x("",!0)]),n(H,{modelValue:i.value,"onUpdate:modelValue":B[2]||(B[2]=j=>i.value=j),title:A(u)("Add Custom Template"),width:"420px","close-on-click-modal":!1,"append-to-body":!0},{footer:d(()=>[n(U,{onClick:B[1]||(B[1]=j=>i.value=!1)},{default:d(()=>[R(m(A(u)("Cancel")),1)]),_:1}),n(U,{type:"primary",onClick:$,loading:p.value},{default:d(()=>[R(m(A(u)("Create")),1)]),_:1},8,["loading"])]),default:d(()=>[n(L,{onSubmit:Ge($,["prevent"]),"label-position":"top"},{default:d(()=>[n(O,{label:A(u)("Template Name")},{default:d(()=>[n(M,{modelValue:c.value,"onUpdate:modelValue":B[0]||(B[0]=j=>c.value=j),placeholder:A(u)("e.g. Custom Invoice"),autofocus:""},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1})]),_:1},8,["modelValue","title"])])}}},Kv={name:"EmailBodySkeleton",props:{showLoadingBadge:{type:Boolean,default:!1}}},Gv={class:"fct-email-body-skeleton"},zv={class:"fct-email-body-skeleton__page"},jv={key:0,class:"fct-ebs__badge"},qv={class:"fct-ebs__badge-text"};function Yv(e,t,a,l,s,i){return r(),h("div",Gv,[o("div",zv,[t[3]||(t[3]=Dn('<div class="fct-ebs__skel fct-ebs__header"></div><div style="height:8px;"></div><div class="fct-ebs__row"><div class="fct-ebs__skel" style="width:45%;height:12px;"></div><div style="flex:1;"></div><div class="fct-ebs__skel" style="width:30%;height:12px;"></div></div><div class="fct-ebs__divider"></div><div class="fct-ebs__grid"><div class="fct-ebs__skel"></div><div class="fct-ebs__skel"></div><div class="fct-ebs__skel"></div><div class="fct-ebs__skel"></div></div><div class="fct-ebs__row" style="margin-top:2px;"><div class="fct-ebs__skel" style="width:30%;height:12px;"></div><div class="fct-ebs__skel" style="width:20%;height:12px;"></div><div class="fct-ebs__skel" style="width:30%;height:12px;"></div><div class="fct-ebs__skel" style="width:20%;height:12px;"></div></div><div class="fct-ebs__divider"></div><div class="fct-ebs__row"><div class="fct-ebs__skel" style="flex:1;height:12px;"></div></div><div class="fct-ebs__row"><div class="fct-ebs__skel" style="width:45%;height:12px;"></div></div>',9)),a.showLoadingBadge?(r(),h("div",jv,[t[0]||(t[0]=o("span",{class:"fct-ebs__dot"},null,-1)),t[1]||(t[1]=o("span",{class:"fct-ebs__dot"},null,-1)),t[2]||(t[2]=o("span",{class:"fct-ebs__dot"},null,-1)),o("span",qv,m(e.$t("Loading block editor…")),1)])):x("",!0)])])}const hr=nt(Kv,[["render",Yv]]),Wv={name:"NewEditorFrame",components:{EmailBodySkeleton:hr},props:{editorPath:{type:String,default:"/editor"},modelValue:{type:String,default:""},editorParams:{type:Object,default:()=>({})},frameHeight:{type:String,default:"500px"},documentTitle:{type:String,default:""}},emits:["update:modelValue","titleUpdated","contentUpdated","editorFullscreenToggle","featuredMediaUpdated","previewRequest","autosaveState"],data(){return{editorData:{content:""},editorFrame:null,editorOrigin:null,dataSent:!1,isFailing:!1,iframeReady:!1,pendingDataSend:!1,sendRetries:0,editorReadyReceived:!1,editorContentReady:!1,isFullscreen:!1,_timers:[]}},computed:{editorFailed(){return!this.dataSent&&this.isFailing&&!this.editorReadyReceived}},mounted(){this._setTimeout(()=>{this.editorReadyReceived||(this.isFailing=!0)},3e4),this.editorData.content=this.modelValue,this.editorData.title=this.documentTitle,this.createEditorIframe(),window.addEventListener("message",this.handleEditorMessage)},beforeUnmount(){this._timers.forEach(e=>clearTimeout(e)),this._timers=[],window.removeEventListener("message",this.handleEditorMessage),this.isFullscreen&&this.toggleFullScreen(!1),this.editorFrame&&(this.editorFrame.onload=null,this.$refs.iframeContainer.removeChild(this.editorFrame),this.editorFrame=null)},methods:{_setTimeout(e,t){const a=setTimeout(e,t);return this._timers.push(a),a},createEditorIframe(){this.editorFrame=document.createElement("iframe");let e=this.appVars.fct_editor_frame;if(this.editorParams){const t=new URLSearchParams(this.editorParams);e+="&"+t.toString()}try{this.editorOrigin=new URL(e,window.location.origin).origin}catch{this.editorOrigin=window.location.origin}this.editorFrame.src=e,this.editorFrame.style.width="100%",this.editorFrame.style.height=this.frameHeight,this.editorFrame.onload=()=>{this.iframeReady=!0,this.pendingDataSend&&(this.pendingDataSend=!1,this._setTimeout(()=>{this.sendDataToEditor()},1e3)),this._setTimeout(()=>{!this.editorReadyReceived&&this.iframeReady&&this.sendDataToEditor()},1e4)},this.$refs.iframeContainer.appendChild(this.editorFrame)},sendDataToEditor(){if(!this.iframeReady||!this.editorFrame||!this.editorFrame.contentWindow){this.pendingDataSend=!0;return}try{const e=JSON.parse(JSON.stringify(this.editorData));this.editorFrame.contentWindow.postMessage({action:"UPDATE_EDITOR",data:e},this.editorOrigin),this.dataSent=!0,this.sendRetries=0,this._setTimeout(()=>{this.editorContentReady||(this.editorContentReady=!0)},5e3)}catch{this.sendRetries++,this.sendRetries<=3&&this._setTimeout(()=>{this.sendDataToEditor()},500)}},handleEditorMessage(e){if(e&&e.origin&&this.editorOrigin&&e.origin!==this.editorOrigin)return;const{action:t,content:a}=e.data;t==="EDITOR_UPDATED"?this.dataSent&&(this.editorContentReady||this._setTimeout(()=>{this.editorContentReady=!0},1500),this.editorData.content=a,this.$emit("update:modelValue",a),this.$emit("contentUpdated",a)):t==="TITLE_UPDATED"?(this.editorData.title=a,this.$emit("titleUpdated",a)):t==="FEATURED_MEDIA_UPDATED"?this.$emit("featuredMediaUpdated",a):t==="EDITOR_FULLSCREEN_TOGGLE"?this.toggleFullScreen(a):t==="EMAIL_PREVIEW_REQUEST"?this.$emit("previewRequest"):t==="AUTOSAVE_STATE"?this.$emit("autosaveState",a):t==="EDITOR_READY"&&(this.editorReadyReceived=!0,this.isFailing=!1,this.sendDataToEditor())},forceAutosave(){this.editorFrame&&this.editorFrame.contentWindow&&this.editorFrame.contentWindow.postMessage({action:"FORCE_SAVE"},this.editorOrigin)},toggleFullScreen(e){this.isFullscreen=e;const t=this.editorFrame;if(e){if(document.documentElement.classList.add("fct-editor-fullscreen"),document.body.style.overflow="hidden",t){t.classList.add("fct-fullscreen-iframe"),this._fullscreenAncestors=[];let a=t.parentElement;for(;a&&a!==document.documentElement;)a.classList.add("fct-fullscreen-ancestor"),this._fullscreenAncestors.push(a),a=a.parentElement}}else document.documentElement.classList.remove("fct-editor-fullscreen"),document.body.style.overflow="",t&&t.classList.remove("fct-fullscreen-iframe"),this._fullscreenAncestors&&(this._fullscreenAncestors.forEach(function(a){a.classList.remove("fct-fullscreen-ancestor")}),this._fullscreenAncestors=null);this.$emit("editorFullscreenToggle",e)}}},Jv={style:{width:"100%"}},Xv={key:0,style:{display:"flex","justify-content":"center","align-items":"center","column-gap":"10px"}},Zv={class:"editor-container",style:{position:"relative"}},eg={key:0,class:"fct-editor-skeleton"},tg={ref:"iframeContainer",class:"iframe-container"};function ag(e,t,a,l,s,i){const c=C("EmailBodySkeleton");return r(),h("div",Jv,[i.editorFailed?(r(),h("div",Xv,[o("p",null,m(e.$t("Problem with loading the editor. Please reload the page.")),1)])):x("",!0),o("div",Zv,[n(Xl,{name:"fct-skeleton-fade"},{default:d(()=>[s.editorContentReady?x("",!0):(r(),h("div",eg,[t[0]||(t[0]=o("div",{class:"fct-skel-menubar"},[o("div",{class:"fct-skel fct-skel-logo"}),o("div",{class:"fct-skel-slash"}),o("div",{class:"fct-skel fct-skel-name"}),o("div",{class:"fct-skel-spacer"}),o("div",{class:"fct-skel fct-skel-btn-wide"}),o("div",{class:"fct-skel-dot"}),o("div",{class:"fct-skel-dot"})],-1)),t[1]||(t[1]=o("div",{class:"fct-skel-toolbar"},[o("div",{class:"fct-skel fct-skel-tb-btn"}),o("div",{class:"fct-skel fct-skel-tb-btn"}),o("div",{class:"fct-skel fct-skel-tb-btn"}),o("div",{class:"fct-skel-sep"}),o("div",{class:"fct-skel fct-skel-tb-btn"}),o("div",{class:"fct-skel fct-skel-tb-btn"}),o("div",{class:"fct-skel-sep"}),o("div",{class:"fct-skel fct-skel-tb-wide"}),o("div",{class:"fct-skel fct-skel-tb-wide"}),o("div",{class:"fct-skel-sep"}),o("div",{class:"fct-skel fct-skel-tb-btn"})],-1)),n(c,{"show-loading-badge":!0})]))]),_:1}),o("div",tg,null,512)])])}const gA=nt(Wv,[["render",ag],["__scopeId","data-v-e5dae537"]]),lg={class:"setting-wrap fct-pdf-template-edit-wrapper"},sg={class:"capitalize"},ng={class:"setting-wrap-inner"},og={class:"bg-white rounded dark:bg-dark-700 p-6 mb-4"},ig={class:"setting-save-action"},rg={__name:"PdfTemplateEdit",props:{template:{type:String,required:!0}},setup(e){const t=e,a=sl(),l=T(!0),s=T(!1),i=T(!1),c=T(!1),p=T(null),f=T(null),_=T(""),g=B=>{const U=atob(B),Q=new Array(U.length);for(let V=0;V<U.length;V++)Q[V]=U.charCodeAt(V);return new Blob([new Uint8Array(Q)],{type:"application/pdf"})},y=async()=>{const B=await Ae.post("settings/pdf-templates/download",{template_id:t.template});if(!(B!=null&&B.pdf_base64))throw new Error(u("Failed to generate PDF"));return B},v=()=>{l.value=!0,Ae.get("settings/pdf-templates/receipt/"+t.template).then(B=>{var Q,V,I;p.value=B.template;const U=(I=(V=(Q=B.template)==null?void 0:Q.pdf_settings)==null?void 0:V[0])==null?void 0:I.pdf_structure;U&&(_.value=U.content||"")}).catch(B=>{var U;q.error(((U=B.data)==null?void 0:U.message)||u("Failed to load template"))}).finally(()=>{l.value=!1})},w=async({showSuccess:B=!0}={})=>{var Q,V,I,M;s.value=!0,f.value&&await f.value.forceAutosave();const U=((I=(V=(Q=p.value)==null?void 0:Q.pdf_settings)==null?void 0:V[0])==null?void 0:I.pdf_structure)||{};U.content=_.value;try{const O=await Ae.post("settings/pdf-templates/receipt/"+t.template,{pdf_structure:U});return B&&q.success(O.message||u("Template saved")),!0}catch(O){return q.error(((M=O.data)==null?void 0:M.message)||u("Failed to save template")),!1}finally{s.value=!1}},k=()=>{i.value=!0,y().then(B=>{const U=g(B.pdf_base64),Q=URL.createObjectURL(U),V=document.createElement("a");V.href=Q,V.download=B.filename||"receipt-test.pdf",document.body.appendChild(V),V.click(),document.body.removeChild(V),URL.revokeObjectURL(Q),q.success(u("PDF downloaded"))}).catch(B=>{var U;q.error(((U=B.data)==null?void 0:U.message)||B.message||u("Failed to generate PDF"))}).finally(()=>{i.value=!1})},b=async()=>{var B;c.value=!0;try{const U=await y(),Q=g(U.pdf_base64),V=URL.createObjectURL(Q),I=document.createElement("a");I.href=V,I.target="_blank",I.rel="noopener",document.body.appendChild(I),I.click(),document.body.removeChild(I),setTimeout(()=>{URL.revokeObjectURL(V)},1e4)}catch(U){q.error(((B=U.data)==null?void 0:B.message)||U.message||u("Failed to generate PDF"))}finally{c.value=!1}},S=async()=>{s.value||i.value||c.value||!await w({showSuccess:!1})||await b()},$=()=>p.value&&!p.value.is_default,D=()=>{Ae.delete("settings/pdf-templates/delete/"+t.template).then(B=>{q.success(B.message||u("Template deleted")),a.push({path:"/settings/pdf-template"})}).catch(B=>{var U;q.error(((U=B.data)==null?void 0:U.message)||u("Failed to delete template"))})},F=()=>{Ae.get("settings/pdf-templates/factory-default").then(B=>{var V,I,M;const U=(V=B.templates)==null?void 0:V[t.template];if(!U)return;const Q=((M=(I=U.pdf_settings)==null?void 0:I[0])==null?void 0:M.pdf_structure)||{};return Ae.post("settings/pdf-templates/receipt/"+t.template,{pdf_structure:Q}).then(()=>{q.success(u("Reverted to default template")),v()})}).catch(B=>{var U;q.error(((U=B.data)==null?void 0:U.message)||u("Failed to revert template"))})};return Ie(()=>{v()}),(B,U)=>{const Q=C("el-breadcrumb-item"),V=C("el-breadcrumb"),I=C("el-icon"),M=C("el-button"),O=C("el-dropdown-item"),L=C("el-dropdown-menu"),H=C("el-dropdown"),j=C("el-skeleton-item"),W=C("el-skeleton");return r(),h("div",lg,[n(Ua,{loading:s.value,"loading-text":A(u)("Saving"),"save-button-text":A(u)("Save Template"),onOnSave:w},{heading:d(()=>[n(V,{class:"mb-0","separator-icon":A(Al)},{default:d(()=>[n(Q,{to:{path:"/settings/pdf-template"}},{default:d(()=>[R(m(A(u)("PDF Templates")),1)]),_:1}),n(Q,null,{default:d(()=>{var G;return[o("span",sg,m(((G=p.value)==null?void 0:G.title)||A(u)("Edit Template")),1)]}),_:1})]),_:1},8,["separator-icon"])]),action:d(()=>[n(H,{trigger:"click",style:{"margin-left":"12px",display:"inline-flex","align-items":"center"},"popper-class":"fct-dropdown"},{dropdown:d(()=>[n(L,null,{default:d(()=>[n(O,{onClick:k,disabled:i.value},{default:d(()=>[R(m(i.value?A(u)("Downloading..."):A(u)("Test Download")),1)]),_:1},8,["disabled"]),n(O,{onClick:F},{default:d(()=>[R(m(A(u)("Revert to Default")),1)]),_:1}),$()?(r(),E(O,{key:0,divided:"",onClick:D,style:{color:"#F56C6C"}},{default:d(()=>[R(m(A(u)("Delete Template")),1)]),_:1})):x("",!0)]),_:1})]),default:d(()=>[n(M,{size:"small",text:"",style:{height:"auto",padding:"4px"}},{default:d(()=>[n(I,{style:{transform:"rotate(90deg)","font-size":"16px"}},{default:d(()=>[n(A(lm))]),_:1})]),_:1})]),_:1})]),_:1},8,["loading","loading-text","save-button-text"]),o("div",ng,[n(Ia),n(W,{loading:l.value,class:"bg-white rounded p-6 dark:bg-dark-700",animated:""},{template:d(()=>[n(j,{variant:"h3",class:"w-[200px] mb-5"}),n(j,{variant:"rect",style:{width:"100%",height:"500px"}})]),_:1},8,["loading"]),!l.value&&p.value?(r(),h(P,{key:0},[o("div",og,[n(gA,{ref_key:"editorFrameRef",ref:f,editorParams:{block_type:"pdf_template",campaign_title:p.value.title,bid:t.template},frameHeight:"calc(100vh - 200px)",documentTitle:p.value.title||A(u)("Receipt Template"),onPreviewRequest:S,modelValue:_.value,"onUpdate:modelValue":U[0]||(U[0]=G=>_.value=G)},null,8,["editorParams","documentTitle","modelValue"])]),o("div",ig,[n(M,{onClick:w,type:"primary",disabled:s.value,loading:s.value},{default:d(()=>[R(m(A(u)("Save Template")),1)]),_:1},8,["disabled","loading"]),n(M,{onClick:k,disabled:i.value,loading:i.value},{default:d(()=>[R(m(A(u)("Test Download")),1)]),_:1},8,["disabled","loading"])])],64)):x("",!0)])])}}},dg={class:"fluent-cart-admin-validation-error-wrapper `${fieldKey}`"},_l=Object.assign({name:"ValidationError"},{__name:"ValidationError",props:{validationErrors:Object,fieldKey:{type:String,default:""}},setup(e){return(t,a)=>(r(),h("div",dg,[(r(!0),h(P,null,te(e.validationErrors,(l,s)=>(r(),h("span",{class:"fluent-cart-admin-validation-error",key:l.toLowerCase().replace(/\s/g,"")},m(l),1))),128))]))}}),xo={__name:"Alert",props:{type:String,title:String,description:String,closable:Boolean,showIcon:Boolean},setup(e){return(t,a)=>{const l=C("el-alert");return r(),E(l,{title:e.title,type:e.type,description:e.description,"show-icon":e.showIcon,closable:e.closable,role:"alert"},{default:d(()=>[ga(t.$slots,"default")]),_:3},8,["title","type","description","show-icon","closable"])}}},ug={class:"setting-wrap"},cg={class:"setting-wrap-inner"},Ag={class:"grid gap-3 mb-6"},pg={class:"grid gap-3 mb-6"},fg={class:"grid gap-3 mb-6"},mg={class:"grid gap-3"},hg={key:0,class:"mb-4 p-4 rounded-lg border border-yellow-300 bg-yellow-50 text-yellow-800 text-sm"},_g=["href"],vg={class:"form-note"},gg={class:"form-note"},yg=["href"],bg={class:"mb-4"},wg={class:"mb-4"},Cg={class:"form-note"},kg={class:"form-note"},Bg={class:"form-note"},xg={class:"form-note"},Sg={class:"setting-save-action"},Fg={__name:"PdfTemplateSettings",setup(e){const t=T(!0),a=T(!1),l=T({}),s=T(!0),i=T(""),c=T({zugferd_enabled:"0",zugferd_profile:"en16931",seller_legal_registration_scheme:"",seller_contact_name:"",seller_contact_email:"",seller_contact_phone:"",seller_bank_iban:"",seller_bank_bic:"",seller_bank_account_name:"",seller_electronic_address:""}),p=[{label:"EN 16931 (ZUGFeRD)",value:"en16931"}],f=[{value:"",label:u("None")},{value:"0002",label:"0002 — SIRENE (France)"},{value:"0009",label:"0009 — SIRET (France)"},{value:"0021",label:"0021 — SWIFT"},{value:"0060",label:"0060 — DUNS"},{value:"0088",label:"0088 — EAN / GS1 GLN"},{value:"0096",label:"0096 — Danish P number"},{value:"0130",label:"0130 — EU Directorates"},{value:"0183",label:"0183 — Swiss UID"},{value:"0184",label:"0184 — Danish CVR"},{value:"0190",label:"0190 — Dutch OIN"},{value:"0191",label:"0191 — Dutch KvK"},{value:"0192",label:"0192 — Dutch Organisation ID"},{value:"0195",label:"0195 — Singapore UEN"},{value:"0196",label:"0196 — Icelandic kennitala"},{value:"0198",label:"0198 — Danish SE"},{value:"0199",label:"0199 — LEI"},{value:"0200",label:"0200 — Lithuanian legal entity"},{value:"0204",label:"0204 — German Leitweg-ID"},{value:"0208",label:"0208 — Belgian CBE / KBO"},{value:"0210",label:"0210 — Italian Codice Fiscale"},{value:"0211",label:"0211 — Italian Partita IVA"},{value:"0213",label:"0213 — Finnish OVT"}];ws().onSave(()=>{y()});const g=()=>{t.value=!0,Ae.get("settings/pdf-templates/seller-details").then(v=>{v.seller_details&&Object.keys(c.value).forEach(w=>{v.seller_details[w]!==void 0&&(c.value[w]=v.seller_details[w])}),s.value=v.store_country_set!==!1,i.value=v.store_settings_url||""}).catch(v=>{var w;q.error(((w=v.data)==null?void 0:w.message)||u("Failed to load settings"))}).finally(()=>{t.value=!1})},y=()=>{a.value=!0,l.value={},Ae.post("settings/pdf-templates/seller-details",c.value).then(v=>{q.success(v.message||u("Settings saved"))}).catch(v=>{var w,k;v.status_code===422&&((w=v.data)!=null&&w.data)&&(l.value=v.data.data),q.error(((k=v.data)==null?void 0:k.message)||u("Failed to save settings"))}).finally(()=>{a.value=!1})};return Ie(()=>{g()}),(v,w)=>{const k=C("el-skeleton-item"),b=C("el-skeleton"),S=C("el-switch"),$=C("el-option"),D=C("el-select"),F=C("el-form-item"),B=C("el-col"),U=C("el-row"),Q=C("el-input"),V=C("el-divider"),I=C("el-button");return r(),h("div",ug,[n(Ua,{heading:A(u)("E-Invoice Settings"),loading:a.value,onOnSave:y},null,8,["heading","loading"]),o("div",cg,[n(Ia),t.value?(r(),E(Se,{key:0},{default:d(()=>[n(ke,null,{default:d(()=>[n(b,{animated:""},{template:d(()=>[o("div",Ag,[n(k,{variant:"p",class:"w-[20%]"}),n(k,{variant:"p"})]),o("div",pg,[n(k,{variant:"p",class:"w-[20%]"}),n(k,{variant:"p"})]),o("div",fg,[n(k,{variant:"p",class:"w-[20%]"}),n(k,{variant:"p"})]),o("div",mg,[n(k,{variant:"p",class:"w-[20%]"}),n(k,{variant:"p"})])]),_:1})]),_:1})]),_:1})):x("",!0),t.value?x("",!0):(r(),h(P,{key:1},[c.value.zugferd_enabled==="1"&&!s.value?(r(),h("div",hg,[o("strong",null,m(A(u)("Store country is not configured.")),1),R(" "+m(A(u)("ZUGFeRD XML cannot be embedded in PDFs until your store country is set."))+" ",1),i.value?(r(),h("a",{key:0,href:i.value,class:"underline ml-1"},m(A(u)("Go to Store Settings")),9,_g)):x("",!0)])):x("",!0),n(Se,null,{default:d(()=>[n(Ve,{title:A(u)("E-Invoice Configuration"),text:A(u)("Configure ZUGFeRD / Factur-X e-invoice encoding and seller details for your PDFs."),border_bottom:""},{action:d(()=>[n(S,{modelValue:c.value.zugferd_enabled,"onUpdate:modelValue":w[0]||(w[0]=M=>c.value.zugferd_enabled=M),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1},8,["title","text"]),n(ke,null,{default:d(()=>[n(U,{gutter:15},{default:d(()=>[n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("ZUGFeRD Profile"),"label-position":"top"},{default:d(()=>[n(D,{modelValue:c.value.zugferd_profile,"onUpdate:modelValue":w[1]||(w[1]=M=>c.value.zugferd_profile=M)},{default:d(()=>[(r(),h(P,null,te(p,M=>n($,{key:M.value,label:M.label,value:M.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),o("div",vg,[o("p",null,m(A(u)("Select the e-invoice formatter used when generating the embedded XML.")),1)])]),_:1},8,["label"])]),_:1}),n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Legal Registration Scheme"),"label-position":"top"},{default:d(()=>[n(D,{modelValue:c.value.seller_legal_registration_scheme,"onUpdate:modelValue":w[2]||(w[2]=M=>c.value.seller_legal_registration_scheme=M),placeholder:A(u)("Select scheme"),clearable:"",filterable:""},{default:d(()=>[(r(),h(P,null,te(f,M=>n($,{key:M.value,label:M.label,value:M.value},null,8,["label","value"])),64))]),_:1},8,["modelValue","placeholder"]),o("div",gg,[o("p",null,m(A(u)("ISO 6523 ICD code for the legal registration identifier")),1)]),n(_l,{"validation-errors":l.value.seller_legal_registration_scheme||{},"field-key":"seller_legal_registration_scheme"},null,8,["validation-errors"])]),_:1},8,["label"])]),_:1})]),_:1}),n(xo,{type:"info",closable:!1,"show-icon":"",class:"mb-4"},{default:d(()=>[R(m(A(u)("Company Name, VAT ID, Tax ID, and Legal Registration ID are managed in"))+" ",1),i.value?(r(),h("a",{key:0,href:i.value,target:"_blank",class:""},m(A(u)("Store Settings → Business Details")),9,yg)):x("",!0)]),_:1}),o("h4",bg,m(A(u)("Seller Contact")),1),n(U,{gutter:15},{default:d(()=>[n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Contact Name"),"label-position":"top"},{default:d(()=>[n(Q,{modelValue:c.value.seller_contact_name,"onUpdate:modelValue":w[3]||(w[3]=M=>c.value.seller_contact_name=M)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Contact Email"),"label-position":"top"},{default:d(()=>[n(Q,{modelValue:c.value.seller_contact_email,"onUpdate:modelValue":w[4]||(w[4]=M=>c.value.seller_contact_email=M),type:"email"},null,8,["modelValue"]),n(_l,{"validation-errors":l.value.seller_contact_email||{},"field-key":"seller_contact_email"},null,8,["validation-errors"])]),_:1},8,["label"])]),_:1})]),_:1}),n(U,{gutter:15},{default:d(()=>[n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Contact Phone"),"label-position":"top"},{default:d(()=>[n(Q,{modelValue:c.value.seller_contact_phone,"onUpdate:modelValue":w[5]||(w[5]=M=>c.value.seller_contact_phone=M)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})]),_:1}),n(V),o("h4",wg,m(A(u)("Seller Bank Details")),1),n(U,{gutter:15},{default:d(()=>[n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Bank IBAN"),"label-position":"top"},{default:d(()=>[n(Q,{modelValue:c.value.seller_bank_iban,"onUpdate:modelValue":w[6]||(w[6]=M=>c.value.seller_bank_iban=M)},null,8,["modelValue"]),n(_l,{"validation-errors":l.value.seller_bank_iban||{},"field-key":"seller_bank_iban"},null,8,["validation-errors"]),o("div",Cg,[o("p",null,m(A(u)("International Bank Account Number")),1)])]),_:1},8,["label"])]),_:1}),n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Bank BIC"),"label-position":"top"},{default:d(()=>[n(Q,{modelValue:c.value.seller_bank_bic,"onUpdate:modelValue":w[7]||(w[7]=M=>c.value.seller_bank_bic=M)},null,8,["modelValue"]),o("div",kg,[o("p",null,m(A(u)("Bank Identifier Code (SWIFT)")),1)])]),_:1},8,["label"])]),_:1})]),_:1}),n(U,{gutter:15},{default:d(()=>[n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Bank Account Name"),"label-position":"top"},{default:d(()=>[n(Q,{modelValue:c.value.seller_bank_account_name,"onUpdate:modelValue":w[8]||(w[8]=M=>c.value.seller_bank_account_name=M)},null,8,["modelValue"]),o("div",Bg,[o("p",null,m(A(u)("Name of the bank account holder")),1)])]),_:1},8,["label"])]),_:1}),n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Electronic Address"),"label-position":"top"},{default:d(()=>[n(Q,{modelValue:c.value.seller_electronic_address,"onUpdate:modelValue":w[9]||(w[9]=M=>c.value.seller_electronic_address=M)},null,8,["modelValue"]),o("div",xg,[o("p",null,m(A(u)("Electronic address for receiving e-invoices (e.g. PEPPOL ID)")),1)])]),_:1},8,["label"])]),_:1})]),_:1})]),_:1})]),_:1}),o("div",Sg,[n(I,{type:"primary",onClick:w[10]||(w[10]=M=>y()),loading:a.value},{default:d(()=>[R(m(A(u)("Save Settings")),1)]),_:1},8,["loading"])])],64))])])}}},$g={name:"CustomersRoute"},Eg={class:"fca_customers_route"};function Ug(e,t,a,l,s,i){const c=C("router-view");return r(),h("div",Eg,[n(c)])}const Ig=nt($g,[["render",Ug]]);/*!
1 +var Nf=Object.defineProperty;var Kf=(e,t,a)=>t in e?Nf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var Pe=(e,t,a)=>Kf(e,typeof t!="symbol"?t+"":t,a);import{r as C,c as E,o as r,w as d,a as n,u as A,b as x,d as o,e as h,f as R,t as m,F as P,g as te,h as T,i as Ie,j as Bt,k as Jt,l as K,m as ga,n as de,p as oa,q as Ge,s as Dn,T as Xl,v as be,x as xe,y as oi,z as xa,A as bl,B as Il,C as yn,D as va,E as gl,G as ra,H as Gf,I as Wt,J as Hc,K as vs,L as Zs,M as cl,N as ii,O as zf,P as Nc,V as Kc,Q as Ds,R as jf,S as ri,U as Va,W as Tl,X as qf,Y as Yf,Z as Gc,_ as Wf,$ as Jf,a0 as Xf,a1 as td,a2 as Zf}from"./chunks/vue.esm-bundler.js?ver=1.6.5";import{u as sl,a as nl,o as zc,c as em,b as tm}from"./chunks/vue-router.js?ver=1.6.5";import{_ as Yt}from"./chunks/preload-helper.js?ver=1.6.5";import{t as u,a as sa,A as ze,_ as kl,p as Io}from"./chunks/Translator.js?ver=1.6.5";import{T as Vs,_ as Ts,a as ad,F as Qo,b as el,P as dn,B as fa,c as jc,m as qc,d as Yc,e as am}from"./chunks/Badge.js?ver=1.6.5";import{_ as Ct,P as ol}from"./chunks/Empty.js?ver=1.6.5";import{a as Hn,E as Fl,m as lm,b as Al,d as Wc,i as ll,c as sm,s as Jc,e as Do,f as ld,g as Xc,p as Od,r as Zc,w as nm,l as en,h as om,j as im,k as sd,n as Vo,t as rm,o as dm,q as um,u as cm,v as Am,x as pm,y as fm,z as mm}from"./chunks/index.js?ver=1.6.5";import{u as eA,_ as tA,a as nd,b as Ea,c as aA,d as lA,L as od,e as di,O as sA,f as ui,P as id,C as as}from"./chunks/OrderCustomerInformation.js?ver=1.6.5";import{_ as Ot,p as Vn}from"./chunks/UserCan.js?ver=1.6.5";import{C as ft,f as Zl,r as Ll}from"./chunks/CurrencyFormatter.js?ver=1.6.5";import{_ as Pa,a as rd,b as dd,c as hm,S as nA,d as oA,A as iA,e as rA}from"./chunks/Activity.js?ver=1.6.5";import{_ as Ba,C as Ve,a as ke,b as Se}from"./chunks/CardBody.js?ver=1.6.5";import{_ as Y}from"./chunks/DynamicIcon.js?ver=1.6.5";import{_ as nt}from"./chunks/_plugin-vue_export-helper.js?ver=1.6.5";import{c as _m,S as Vt,u as vm,h as ln,a as fr,g as dA,f as gm,b as Us,$ as ul,d as ym}from"./chunks/common.js?ver=1.6.5";import{I as at}from"./chunks/IconButton.js?ver=1.6.5";import{M as tl}from"./chunks/Model.js?ver=1.6.5";import{R as Ae}from"./chunks/Rest.js?ver=1.6.5";import{d as lt,g as bm}from"./chunks/dayjs.min.js?ver=1.6.5";import{n as q}from"./chunks/Notify.js?ver=1.6.5";import{_ as ya}from"./chunks/Animation.js?ver=1.6.5";import{_ as ls,T as Te,m as Oa,a as Gl,i as na,r as wm,L as mr,b as uA,d as cA,c as AA}from"./chunks/dateShortCuts.js?ver=1.6.5";import{S as Ua,_ as Ia,u as bs,a as Cm,b as km,c as Bm}from"./chunks/countries.js?ver=1.6.5";import{u as ws,L as pa,_ as ci}from"./chunks/NotFound.js?ver=1.6.5";import{c as Ql,a as wl,b as za,e as Tn,i as ud,U as cd,p as xm}from"./chunks/Utils.js?ver=1.6.5";import{A as gs}from"./chunks/Asset.js?ver=1.6.5";import{E as Sm}from"./chunks/index2.js?ver=1.6.5";import{S as da}from"./chunks/Str.js?ver=1.6.5";import{A as dt}from"./chunks/Arr.js?ver=1.6.5";import{C as ks,V as sn,_ as Aa,c as Mn,a as Bo,b as Fm,d as $m}from"./chunks/AttrGroups.js?ver=1.6.5";import{U as nn}from"./chunks/Url.js?ver=1.6.5";import{p as Em,E as Os,v as Um,i as Im}from"./chunks/DynamicTemplateParser.js?ver=1.6.5";import{u as Ai,t as pA}from"./chunks/timezone.js?ver=1.6.5";import{_ as un,P as fA}from"./chunks/ProductVariationSelector.js?ver=1.6.5";import{f as Kt,a as Qm,p as Dm,b as Vm,g as Tm,c as Mm,d as Lm}from"./chunks/productService.js?ver=1.6.5";import{B as To}from"./chunks/BundleProducts.js?ver=1.6.5";import{m as Pd,n as Rm,s as Om,a as Pm,i as Hd,r as Hm,b as Nm,g as Nd,c as Kd,d as Km,e as Gm,f as zm,h as jm,j as qm,k as Ym,l as Wm}from"./chunks/galleryTabs.js?ver=1.6.5";import{E as Gd}from"./chunks/index3.js?ver=1.6.5";import{T as zd}from"./chunks/TransitionAccordion.js?ver=1.6.5";import{_ as mA}from"./chunks/FileUploaderDialog.js?ver=1.6.5";import Jm from"./chunks/Screenshot.js?ver=1.6.5";import{u as Xm}from"./chunks/useElementPlusComponents.js?ver=1.6.5";import"./chunks/AddressComponent2.js?ver=1.6.5";import"./chunks/weekOfYear.js?ver=1.6.5";import"./chunks/index4.js?ver=1.6.5";class Zm extends Vs{getTabs(){return{}}getToggleableColumns(){return[{label:u("Lifetime Value (LTV)"),value:"ltv"},{label:u("Customer Since"),value:"customer_since"},{label:u("Last Purchase Date"),value:"last_purchase_date"}]}getSearchHint(){return u("Search by, #ID, First Name, Last Name and Email")}getFetchUrl(){return"customers"}parseResponse(t){return t.customers}getTableName(){return"customers"}}function hA(e){return Zm.init(e)}const eh={class:"table-cell"},th={class:"fct-product-info-card w-full"},ah={class:"fct-product-info-media"},lh={class:"fct-product-info-details grow-0 shrink-0 basis-[calc(100%-52px)]",style:{overflow:"hidden"}},sh={class:"fct-product-info-name flex flex-col items-start gap-3"},nh={class:"table-cell"},oh={class:"table-cell"},ih={class:"table-cell"},rh={class:"table-cell"},dh={class:"table-cell"},uh={__name:"CustomersLoader",props:{nextPageCount:{type:Number,default:0},customerTable:{type:Object,default:()=>({})}},setup(e){const t=e,a=Array.from({length:t.nextPageCount},(l,s)=>s+1);return(l,s)=>{const i=C("el-skeleton-item"),c=C("el-table-column"),p=C("el-table"),f=C("el-skeleton");return r(),E(f,{animated:""},{template:d(()=>[n(p,{data:A(a),class:"w-full compact-table responsive"},{default:d(()=>[n(c,{label:l.$t("Customer"),width:"340"},{default:d(()=>[o("div",eh,[o("div",th,[o("div",ah,[n(i,{variant:"image",class:"w-10 h-10.5 rounded-full flex-none"})]),o("div",lh,[o("div",sh,[n(i,{variant:"p",class:"max-w-[190px]"}),n(i,{variant:"p",class:"max-w-[100px]"})])])])])]),_:1},8,["label"]),n(c,{label:l.$t("Address"),width:"340"},{default:d(()=>[o("div",nh,[n(i,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"]),n(c,{label:l.$t("Purchases"),width:"102"},{default:d(()=>[o("div",oh,[n(i,{variant:"p",class:"w-3/5"})])]),_:1},8,["label"]),e.customerTable.isColumnVisible("ltv")?(r(),E(c,{key:0,label:l.$t("LTV"),width:"113"},{default:d(()=>[o("div",ih,[n(i,{variant:"p",class:"w-3/5"})])]),_:1},8,["label"])):x("",!0),e.customerTable.isColumnVisible("last_purchase_date")?(r(),E(c,{key:1,label:l.$t("Last Purchase Date"),width:"226"},{default:d(()=>[o("div",rh,[n(i,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"])):x("",!0),e.customerTable.isColumnVisible("customer_since")?(r(),E(c,{key:2,label:l.$t("Customer Since"),width:"170"},{default:d(()=>[o("div",dh,[n(i,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"])):x("",!0)]),_:1},8,["data"])]),_:1})}}},ch={key:0,class:"fct-customer-card"},Ah={class:"fct-customer-avatar"},ph=["src"],fh={class:"fct-customer-details"},mh={class:"fct-customer-name"},hh={class:"fct-customer-id"},_h={class:"fct-customer-email"},vh=["innerHTML"],gh={key:1},yh={__name:"CustomersTable",props:{table:{type:Object,required:!0}},emits:["selectionChange"],setup(e,{emit:t}){const a=t,l=s=>{a("selectionChange",s)};return(s,i)=>{const c=C("el-table-column"),p=C("el-table");return r(),E(p,{data:e.table.getTableData(),class:"w-full compact-table",onSelectionChange:l},{empty:d(()=>[n(Ct,{icon:"Empty/ListView","has-dark":!0,text:A(u)("No customer found!")},null,8,["text"])]),default:d(()=>[n(c,{type:"selection",width:"45"}),n(c,{label:A(u)("Customer"),width:"300"},{default:d(f=>{var _;return[n(Ba,{class:"hover:no-underline",to:{name:"view_customer",params:{customer_id:(_=f.row)==null?void 0:_.id}}},{default:d(()=>{var g,y,v,w,k;return[(g=f.row)!=null&&g.id?(r(),h("div",ch,[o("div",Ah,[o("span",null,[o("img",{src:(y=f.row)==null?void 0:y.photo,alt:"avatar"},null,8,ph)])]),o("div",fh,[o("div",mh,[R(m(((v=f.row)==null?void 0:v.full_name)||A(u)("No Name"))+" ",1),o("span",hh,"#"+m(A(sa)((w=f.row)==null?void 0:w.id)),1)]),o("div",_h,m((k=f.row)==null?void 0:k.email),1)])])):x("",!0)]}),_:2},1032,["to"])]}),_:1},8,["label"]),n(c,{label:A(u)("Address"),width:"300"},{default:d(f=>{var _;return[n(Ba,{class:"hover:no-underline",to:{name:"view_customer",params:{customer_id:(_=f.row)==null?void 0:_.id}}},{default:d(()=>[R(m(s.getOrderAddress(f.row)),1)]),_:2},1032,["to"])]}),_:1},8,["label"]),n(c,{label:A(u)("Purchases"),width:90},{default:d(f=>{var _;return[n(Ba,{class:"hover:no-underline",to:{name:"view_customer",params:{customer_id:(_=f.row)==null?void 0:_.id}}},{default:d(()=>[R(m(A(sa)(f.row.purchase_count)),1)]),_:2},1032,["to"])]}),_:1},8,["label"]),e.table.isColumnVisible("ltv")?(r(),E(c,{key:0,label:A(u)("LTV"),width:100},{default:d(f=>{var _;return[n(Ba,{class:"hover:no-underline",to:{name:"view_customer",params:{customer_id:(_=f.row)==null?void 0:_.id}}},{default:d(()=>[o("span",{innerHTML:A(ft).formatNumber(f.row.ltv,!0,!1)},null,8,vh)]),_:2},1032,["to"])]}),_:1},8,["label"])):x("",!0),e.table.isColumnVisible("last_purchase_date")?(r(),E(c,{key:1,label:A(u)("Last Purchase Date"),width:"200"},{default:d(f=>{var _;return[n(Ba,{class:"hover:no-underline",to:{name:"view_customer",params:{customer_id:(_=f.row)==null?void 0:_.id}}},{default:d(()=>[f.row.last_purchase_date?(r(),E(Pa,{key:0,"date-time":f.row.last_purchase_date},null,8,["date-time"])):(r(),h("span",gh,"---"))]),_:2},1032,["to"])]}),_:1},8,["label"])):x("",!0),e.table.isColumnVisible("customer_since")?(r(),E(c,{key:2,label:A(u)("Customer Since"),width:"150"},{default:d(f=>{var _;return[n(Ba,{class:"hover:no-underline",to:{name:"view_customer",params:{customer_id:(_=f.row)==null?void 0:_.id}}},{default:d(()=>[n(Pa,{"date-time":f.row.created_at},null,8,["date-time"])]),_:2},1032,["to"])]}),_:1},8,["label"])):x("",!0)]),_:1},8,["data"])}}},bh={class:"fct-customer-table-mobile-wrap"},wh=["onClick"],Ch={class:"fct-customer-table-mobile-header"},kh={key:0,class:"fct-customer-table-customer-col fct-customer-card"},Bh={class:"fct-customer-avatar"},xh=["src"],Sh={class:"fct-customer-details"},Fh={class:"fct-customer-name"},$h={class:"fct-customer-id"},Eh={class:"fct-customer-email"},Uh={class:"fct-customer-table-purchases-col"},Ih={class:"fct-customer-table-mobile-body"},Qh={class:"fct-customer-table-mobile-body-list"},Dh={key:0,class:"fct-customer-table-ltv-col"},Vh={class:"label"},Th=["innerHTML"],Mh={key:1,class:"fct-customer-table-last-purchase-date-col"},Lh={class:"label"},Rh={class:"value"},Oh={key:2,class:"fct-customer-table-customer-since-col"},Ph={class:"label"},Hh={class:"value"},Nh={class:"fct-customer-table-mobile-footer"},Kh={class:"fct-customer-table-address-col"},Gh={key:0,class:"py-6 text-center"},zh={__name:"CustomersTableMobile",props:{table:{type:Object,required:!0},emptyText:{type:String,default:u("No customers found.")}},setup(e){return(t,a)=>(r(),h("div",bh,[(r(!0),h(P,null,te(e.table.getTableData(),(l,s)=>(r(),h("div",{key:l.id,class:"fct-customer-table-mobile-row",onClick:i=>t.$router.push({name:"view_customer",params:{customer_id:l.id}})},[o("div",Ch,[l!=null&&l.id?(r(),h("div",kh,[o("div",Bh,[o("img",{src:l==null?void 0:l.photo,alt:"avatar"},null,8,xh)]),o("div",Sh,[o("div",Fh,[R(m((l==null?void 0:l.full_name)||A(u)("No Name"))+" ",1),o("span",$h,"#"+m(l==null?void 0:l.id),1)]),o("div",Eh,m(l==null?void 0:l.email),1)])])):x("",!0),o("div",Uh,m(l.purchase_count)+" "+m(l.purchase_count>1?A(u)("Purchases"):A(u)("Purchase")),1)]),o("div",Ih,[o("ul",Qh,[e.table.isColumnVisible("ltv")?(r(),h("li",Dh,[o("div",Vh,m(A(u)("LTV:")),1),o("div",{class:"value",innerHTML:A(ft).formatNumber(l.ltv,!0,!1)},null,8,Th)])):x("",!0),e.table.isColumnVisible("last_purchase_date")?(r(),h("li",Mh,[o("div",Lh,m(A(u)("Last Purchase Date:")),1),o("div",Rh,[n(Pa,{"date-time":l.last_purchase_date},null,8,["date-time"])])])):x("",!0),e.table.isColumnVisible("customer_since")?(r(),h("li",Oh,[o("div",Ph,m(A(u)("Customer Since:")),1),o("div",Hh,[n(Pa,{"date-time":l.created_at},null,8,["date-time"])])])):x("",!0)])]),o("div",Nh,[o("div",Kh,[n(Y,{name:"LocationPin"}),R(" "+m(t.getOrderAddress(l)),1)])])],8,wh))),128)),e.table.getTableData().length===0?(r(),h("div",Gh,[n(Ct,{icon:"Empty/Order","has-dark":"",text:e.emptyText},null,8,["text"])])):x("",!0)]))}},jh={},qh={class:"px-4 py-3"},Yh={class:"flex items-center justify-between mb-3"},Wh={class:"flex items-center justify-between mb-3"},Jh={class:"flex items-center justify-between mb-3"},Xh={class:"flex items-center justify-between mb-3"};function Zh(e,t){const a=C("el-skeleton-item"),l=C("el-skeleton");return r(),E(l,{animated:""},{template:d(()=>[o("div",qh,[o("div",Yh,[n(a,{varient:"p",class:"w-1/2"}),n(a,{varient:"p",class:"w-[100px]"})]),o("div",Wh,[n(a,{varient:"p",class:"w-[50px]"}),n(a,{varient:"p",class:"w-[80px]"})]),o("div",Jh,[n(a,{varient:"p",class:"w-[120px]"}),n(a,{varient:"p",class:"w-[100px]"})]),o("div",Xh,[n(a,{varient:"p",class:"w-[100px]"}),n(a,{varient:"p",class:"w-[100px]"})]),n(a,{varient:"p",class:"w-[230px]"})])]),_:1})}const e_=nt(jh,[["render",Zh]]),t_={class:"fct-all-customers-page fct-layout-width"},a_={class:"fct-all-customers-wrap"},l_={key:1},s_={__name:"AllCustomers",setup(e){const t=hA(),a=T({showModal:!1,action:"create",title:u("Create New Customer"),customer:{}}),l=T(!1),s=T(!1),i=T([]),c=(y=!0)=>{const v=t.buildQueryParams();return y||(delete v.active_view,delete v.filter_type,delete v.search,delete v.advanced_filters),v},p=eA({entity:"customers",buildParams:()=>c(),buildAllParams:()=>c(!1),filenamePrefix:"customers-export"}),f=({scope:y,columns:v,modules:w,format:k})=>{let b=[];y==="current_page"?b=t.getTableData().map(S=>S.id).filter(Boolean):y==="selected"&&(b=i.value.map(S=>S.id).filter(Boolean)),p.startExport({scope:y,ids:b,columns:v,modules:w,format:k})},_=y=>{i.value=y},g=()=>{l.value=window.innerWidth<768};return Ie(()=>{g(),window.addEventListener("resize",g)}),Bt(()=>{window.removeEventListener("resize",g)}),(y,v)=>{const w=C("el-icon"),k=C("el-button"),b=C("el-dropdown-item"),S=C("el-dropdown-menu"),$=C("el-dropdown");return r(),h("div",t_,[n(ol,{title:A(u)("Customers")},{action:d(()=>[n(Ot,{permission:"customers/export"},{default:d(()=>[n($,{trigger:"click","popper-class":"fct-dropdown",placement:"bottom-end"},{dropdown:d(()=>[n(S,null,{default:d(()=>[n(b,{onClick:v[0]||(v[0]=D=>s.value=!0)},{default:d(()=>[n(Y,{name:"Download"}),R(" "+m(A(u)("Export Customers")),1)]),_:1})]),_:1})]),default:d(()=>[n(k,null,{default:d(()=>[R(m(A(u)("More actions"))+" ",1),n(w,null,{default:d(()=>[n(A(Hn))]),_:1})]),_:1})]),_:1})]),_:1}),n(Ot,{permission:"customers/manage"},{default:d(()=>[n(k,{type:"primary",onClick:v[1]||(v[1]=D=>a.value.showModal=!0)},{default:d(()=>[R(m(A(u)("Add Customer")),1)]),_:1})]),_:1})]),_:1},8,["title"]),n(Ot,{permission:"customers/view"},{default:d(()=>[o("div",a_,[n(Ts,{table:A(t),"has-mobile-slot":!0},{mobile:d(()=>[A(t).isLoading()?(r(),E(e_,{key:0})):x("",!0),n(zh,{table:A(t)},null,8,["table"])]),default:d(()=>[A(t).isLoading()?(r(),E(uh,{key:0,customerTable:A(t),"next-page-count":A(t).nextPageCount},null,8,["customerTable","next-page-count"])):(r(),h("div",l_,[n(yh,{table:A(t),onSelectionChange:_},null,8,["table"])]))]),_:1},8,["table"])])]),_:1}),n(Ot,{permission:"customers/manage"},{default:d(()=>[n(nd,{"onUpdate:customerModal":v[2]||(v[2]=()=>{a.value.showModal=!1,a.value.customer={},A(t).fetch()}),customerModalInfos:a.value,customer_id:a.value.customer_id,customer:a.value.customer,onCloseModal:v[3]||(v[3]=D=>a.value.showModal=!1)},null,8,["customerModalInfos","customer_id","customer"])]),_:1}),n(tA,{modelValue:s.value,"onUpdate:modelValue":v[4]||(v[4]=D=>s.value=D),title:A(u)("Export Customers"),"selected-count":i.value.length,"current-page-count":A(t).getTableData().length,"total-count":A(t).data.paginate.total,"item-label-singular":A(u)("customer"),"item-label-plural":A(u)("customers"),"has-active-filter":!!A(t).isFiltering(),"export-state":A(p),onExport:f},null,8,["modelValue","title","selected-count","current-page-count","total-count","item-label-singular","item-label-plural","has-active-filter","export-state"])])}}};class n_ extends Vs{getTabs(){return{all:u("All"),completed:u("Completed"),processing:u("Processing"),"on-hold":u("On Hold"),paid:u("Paid"),subscription:u("Subscription"),renewal:u("Renewal"),refunded:u("Refunded"),partially_refunded:u("Partially Refunded"),upgraded_from:{title:u("Upgraded From"),description:u("Orders upgraded from another order")},upgraded_to:{title:u("Upgraded To"),description:u("Orders upgraded to another order")}}}getToggleableColumns(){return[{label:u("Customer"),value:"customer"},{label:u("Items"),value:"order_items"},{label:u("Order Status"),value:"status"},{label:u("Order Type"),value:"type"},{label:u("Actions"),value:"actions"}]}getSearchHint(){return u("Search by invoice no, customer name, or customer email.")}getFetchUrl(){return"orders"}parseResponse(t){return t.orders}getTableName(){return"order_table"}with(){return["admin_order_list"]}}function _A(e){return n_.init(e)}const o_={class:"fct-order-stats-card"},i_={class:"fct-order-stats-card-head"},r_={class:"fct-order-stats-card-head-content"},d_={class:"text"},u_={key:0,class:"value"},c_={class:"fct-order-stats-card-body"},A_={key:0,class:"change-wrap"},p_={key:0,class:"change-title"},f_={key:1,class:"change-title"},m_={key:1,class:"change-wrap"},h_={class:"change-title"},__={__name:"StatCard",props:{direction:String,stat:Object,statRanges:Object,currentRange:String|Number,statKey:String|Number,loading:Boolean},setup(e){const t=Jt().ctx,a=e,l=K(()=>{switch(a.statKey){case"total_orders":return"warning";case"paid_orders":return"blue";case"total_paid_order_items":return"danger";case"total_paid_amounts":return"secondary";default:return"info"}}),s=K(()=>c.value===0?"":c.value>0?"success":"danger"),i=f=>f.is_cents?t.formatNumber(f.current_count):sa(f.current_count),c=K(()=>{let f=_m(a.stat.current_count,a.stat.compare_count)??0;return f===""?0:f}),p=K(()=>a.statRanges[a.currentRange].label);return(f,_)=>{const g=C("el-skeleton"),y=C("el-skeleton-item");return r(),h("div",o_,[o("div",i_,[n(at,{size:"large",bg:l.value,soft:""},{default:d(()=>[ga(f.$slots,"icon")]),_:3},8,["bg"]),o("div",r_,[n(g,{loading:e.loading,animated:"",rows:0},null,8,["loading"]),o("span",d_,m(e.stat.title),1),e.loading?x("",!0):(r(),h("div",u_,m(i(e.stat)),1))])]),o("div",c_,[n(g,{loading:e.loading,animated:""},{template:d(()=>[n(y,{variant:"p",class:"w-1/2 h-4"})]),_:1},8,["loading"]),!e.loading&&e.currentRange!=="all_time"?(r(),h("div",A_,[o("span",{class:de("change "+s.value)},[c.value!==0?(r(),E(Y,{key:0,name:c.value>0?"CaretUp":"CaretDown"},null,8,["name"])):x("",!0),R(" "+m(c.value===0?f.$t("Same as previous"):Math.abs(c.value)+"%"),1)],2),c.value>0?(r(),h("span",p_,m(A(u)("More than %s",p.value==="Today"?f.$t("Yesterday"):f.$t(p.value))),1)):c.value<0?(r(),h("span",f_,m(A(u)("Less than %s",p.value==="Today"?f.$t("Yesterday"):f.$t(p.value))),1)):x("",!0)])):x("",!0),!e.loading&&e.currentRange==="all_time"?(r(),h("div",m_,[o("span",h_,m(f.$t("All Time")),1)])):x("",!0)])])}}},v_={name:"CardFooter"},g_={class:"fct-card-footer"};function y_(e,t,a,l,s,i){return r(),h("div",g_,[ga(e.$slots,"default")])}const Ad=nt(v_,[["render",y_]]);class vA{constructor(){Pe(this,"_attributes",{})}attribute(t,a){return this._attributes[t]=a,this}setAttribute(t){return this._attributes=typeof t=="object"?t:this._attributes,this}}class ms{static install(t,a,l={},s=!1){const i=new a(...Object.values(l));Object.keys(i).forEach(c=>{(s||!t.hasOwnProperty(c))&&(t[c]=i[c])}),Object.getOwnPropertyNames(a.prototype).forEach(c=>{c!=="constructor"&&typeof i[c]=="function"&&(s||typeof t[c]!="function")&&(t[c]=i[c].bind(t))})}}class b_ extends tl{constructor(){super(...arguments);Pe(this,"data",{salesGrowthChart:[],countryHeatMap:[],fluctuations:[],dashBoardStats:[],recentOrders:[],recentActivities:[],topSoldProducts:[],currencySign:ze.get("shop.currency_sign"),isBusy:{recentActivities:!1,fluctuations:!1,dashBoardStats:!1,recentOrders:!1,countryHeatMap:!1,salesGrowthChart:!0,topSoldProducts:!0}})}get controllerKey(){return"ReportingController"}beforeInit(){}makeRequest(a,l,s,i){this.data.isBusy[i]=!0,typeof l!="object"&&(l={});const c=Ae.get(`reports/${a}`,l);return this.resolvePromiseResponse(c,s,i),c}resolvePromiseResponse(a,l=null,s=null){a.then(i=>{s==null||l==null||(this.data[s]=i[l])}).catch(i=>{}).finally(()=>{this.data.isBusy[s]=!1})}getDashboardStats(a={}){return this.makeRequest("dashboard-stats",a,"dashBoardStats","dashBoardStats")}getSalesGrowthChart(a={}){return this.makeRequest("sales-growth-chart",a,"salesGrowthChart","salesGrowthChart")}getCountryHeatMap(a={}){return this.makeRequest("country-heat-map",a,"countryHeatMap","countryHeatMap")}getRecentOrders(a={}){return this.makeRequest("get-recent-orders",a,"recentOrders","recentOrders")}getRecentActivities(a={}){return this.makeRequest("get-recent-activities",a,"recentActivities","recentActivities")}getSummary(a={}){return this.makeRequest("get-dashboard-summary",a,"summaryData","summaryData")}getTopSoldProducts(a={}){return this.makeRequest("fetch-top-sold-products",a,"topSoldProducts","topSoldProducts")}}const rl=b_.init(),w_={},C_={class:"fct-order-stats-row"},k_={class:"p-4 bg-gray-25 rounded dark:bg-primary-500"},B_={class:"flex items-center gap-2 mb-3"},x_={class:"right flex flex-col flex-1 gap-2"};function S_(e,t){const a=C("el-skeleton-item"),l=C("el-skeleton");return r(),h("div",C_,[(r(),h(P,null,te(4,s=>n(l,{animated:"",key:s},{template:d(()=>[o("div",k_,[o("div",B_,[n(a,{variant:"p",class:"rounded w-10 h-10 block"}),o("div",x_,[n(a,{variant:"p",class:"rounded w-4/5 block"}),n(a,{variant:"p",class:"rounded w-1/2 block"})])]),o("div",null,[n(a,{variant:"p",class:"rounded w-2/3 block"})])])]),_:2},1024)),64))])}const F_=nt(w_,[["render",S_]]),$_={class:"fct-order-stats-wrap"},E_={class:"fct-order-stats-actions flex items-center gap-2.5"},U_={class:"fct-order-stats-body"},I_={key:1,class:"fct-order-stats-row"},Q_={class:"flex justify-end mt-2"},D_=Object.assign({name:"OrderStatBar"},{__name:"OrderStatBar",setup(e){const t=T(Vt.get("order_stat_collapse",!1)),a=T(""),l=Jt().ctx,s=T(!1),i=T(!0),c=T(!1),p=T("-7 days"),f=sl(),_=T({"-0 days":{label:u("Today"),desc:u("Compared to yesterday")},"-7 days":{label:u("Last 7 days"),desc:u("Compared to the previous 7 days")},"-30 days":{label:u("Last 30 days"),desc:u("Compared to the previous 30 days")},this_month:{label:u("This Month"),desc:u("Compared to the previous Month")},all_time:{label:u("All Time"),desc:u("See All time Sales Stat")}}),g=async v=>{if(p.value!==v)try{p.value=v,a.value="collapse",t.value===!0&&(t.value=!1,Vt.set("order_stat_collapse",t.value)),await Promise.all([l.Storage().set("order_quick_stat_bar_range",p.value),y()])}catch{}},y=()=>{c.value=!1,i.value=!0;const v={"-0 days":[lt().startOf("day").format("YYYY-MM-DD"),lt().endOf("day").format("YYYY-MM-DD")],"-7 days":[lt().subtract(7,"days").startOf("day").format("YYYY-MM-DD"),lt().endOf("day").format("YYYY-MM-DD")],"-30 days":[lt().subtract(30,"days").startOf("day").format("YYYY-MM-DD"),lt().endOf("day").format("YYYY-MM-DD")],this_month:[lt().startOf("month").format("YYYY-MM-DD"),lt().endOf("day").format("YYYY-MM-DD")],all_time:[null,null]},[w,k]=v[p.value]||[lt().startOf("month"),lt().endOf("day")],b={startDate:w,endDate:k,paymentStatus:"all"};rl.getDashboardStats({params:{...b}}).then(()=>{s.value=rl.data.dashBoardStats}).catch(S=>{}).finally(()=>{i.value=!1})};return Ie(()=>{p.value=Vt.get("order_quick_stat_bar_range","-0 days");let v=Vt.get("order_quick_stat_bar_collapse_item");a.value=v===null?"collapse":v,y()}),(v,w)=>{const k=C("el-button");return r(),h("div",$_,[n(Se,null,{default:d(()=>[n(Ve,{title:A(u)("Order Stats Overview"),border_bottom:""},{action:d(()=>[o("div",E_,[n(ad,{class:"hide-animation-on-mobile"},{default:d(()=>[(r(!0),h(P,null,te(_.value,(b,S)=>(r(),E(Qo,{title:`${A(u)("Order Stats Overview of")} ${b.label}`,tabindex:"0",key:S,onClick:$=>g(S),class:de(S===p.value?"active":"")},{default:d(()=>[R(m(b.label),1)]),_:2},1032,["title","onClick","class"]))),128))]),_:1})])]),_:1},8,["title"]),n(ke,null,{default:d(()=>[o("div",U_,[i.value?(r(),E(F_,{key:0})):(r(),h("div",I_,[(r(!0),h(P,null,te(s.value,(b,S)=>(r(),h("div",{key:S,class:"fct-order-stats-col cursor-pointer",onClick:w[0]||(w[0]=$=>A(f).push({name:"reports_orders"}))},[(r(),E(__,{key:S,stat:b,"current-range":p.value,"stat-ranges":_.value,loading:i.value,"stat-key":S},{icon:d(()=>[n(Y,{name:b.icon},null,8,["name"])]),_:2},1032,["stat","current-range","stat-ranges","loading","stat-key"]))]))),128))])),o("div",Q_,[n(k,{text:"",class:"underline-link-button",onClick:w[1]||(w[1]=b=>A(f).push({name:"reports_orders"}))},{default:d(()=>[R(m(A(u)("See Full Report")),1)]),_:1})])])]),_:1})]),_:1})])}}}),V_={class:"table-cell"},T_={class:"table-cell"},M_={class:"table-cell"},L_={class:"table-cell"},R_={class:"table-cell items-center gap-1"},O_={class:"table-cell"},P_={class:"table-cell"},H_={class:"table-cell"},N_={__name:"OrdersLoader",props:{nextPageCount:{type:Number,default:0},orderTable:{type:Object,default:()=>({})}},setup(e){const t=e,a=s=>t.orderTable.columns.includes(s),l=Array.from({length:t.nextPageCount},(s,i)=>i+1);return(s,i)=>{const c=C("el-table-column"),p=C("el-skeleton-item"),f=C("el-table"),_=C("el-skeleton");return r(),E(_,{animated:""},{template:d(()=>[n(f,{data:A(l),class:"w-full compact-table responsive"},{empty:d(()=>i[0]||(i[0]=[])),default:d(()=>[x("",!0),n(c,{label:s.$t("Date"),width:"140"},{default:d(()=>[o("div",V_,[n(p,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"]),a("customer")?(r(),E(c,{key:1,width:"130",label:s.$t("Customer")},{default:d(()=>[o("div",T_,[n(p,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"])):x("",!0),a("order_items")?(r(),E(c,{key:2,label:s.$t("Items"),width:"402"},{default:d(()=>[o("div",M_,[n(p,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"])):x("",!0),n(c,{width:"150",label:s.$t("Total")},{default:d(()=>[o("div",L_,[n(p,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"]),n(c,{width:"150",label:s.$t("Payment Status")},{default:d(()=>[o("div",R_,[n(p,{variant:"p",class:"w-4/5"}),n(p,{variant:"p",class:"w-3/5"})])]),_:1},8,["label"]),a("status")?(r(),E(c,{key:3,width:"120",label:s.$t("Status")},{default:d(()=>[o("div",O_,[n(p,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"])):x("",!0),a("type")?(r(),E(c,{key:4,width:"140",label:s.$t("Order Type")},{default:d(()=>[o("div",P_,[n(p,{variant:"p",class:"w-4/5"})])]),_:1},8,["label"])):x("",!0),a("actions")?(r(),E(c,{key:5,width:"60",label:""},{default:d(()=>[o("div",H_,[n(p,{variant:"p",class:"w-3/5"})])]),_:1})):x("",!0)]),_:1},8,["data"])]),_:1})}}},K_={},G_={class:"px-4 py-3"},z_={class:"grid grid-cols-3 gap-5 mt-5"};function j_(e,t){const a=C("el-skeleton-item"),l=C("el-skeleton");return r(),E(l,{animated:""},{template:d(()=>[o("div",G_,[(r(),h(P,null,te(2,s=>o("div",{key:s,class:"flex items-center justify-between mb-3"},[n(a,{varient:"p",class:"w-1/2"}),n(a,{varient:"p",class:"w-[100px]"})])),64)),o("div",z_,[(r(),h(P,null,te(3,s=>o("div",{key:s},[n(a,{varient:"p",class:"w-1/2"}),n(a,{varient:"p",class:"w-[100px]"})])),64))])])]),_:1})}const q_=nt(K_,[["render",j_]]),Y_={class:"fct-all-orders-page fct-layout-width"},W_={class:"fct-delete-test-orders-content"},J_={if:"deleteTestOrdersProgressTitle",class:"fct-delete-test-orders-title"},X_={class:"fct-delete-test-orders-meta"},Z_={class:"fct-delete-test-orders-text"},ev={key:0,class:"fct-delete-test-orders-loading"},tv={class:"fct-test-orders-loading-content"},av={class:"fct-loading-bars"},lv=["id"],sv={class:"fct-delete-test-orders-percentage"},nv={class:"fct-delete-test-orders-stats"},ov={class:"fct-delete-test-orders-stat-row"},iv={class:"fct-delete-test-orders-stat-label"},rv={class:"fct-delete-test-orders-stat-value"},dv={class:"fct-delete-test-orders-stat-row"},uv={class:"fct-delete-test-orders-stat-label"},cv={class:"fct-delete-test-orders-stat-value is-success"},Av={class:"fct-delete-test-orders-stat-row"},pv={class:"fct-delete-test-orders-stat-label"},fv={class:"fct-delete-test-orders-stat-value is-danger"},mv={key:1,class:"fct-delete-test-orders-message"},hv={key:0,class:"dialog-footer"},_v={class:"fct-all-orders-wrap"},vv={__name:"AllOrders",setup(e){const t=_A({instance:Jt()}),a=T(!1),l=T(!1),s=T(!1),i=T(!1),c=T({total:0,processed:0,deleted:0,failed:0}),p=T(""),f=T(!1),_=T([]),g=(V=!0)=>{const I=t.buildQueryParams();return V||(delete I.active_view,delete I.filter_type,delete I.search,delete I.advanced_filters),I},y=eA({entity:"orders",buildParams:()=>g(),buildAllParams:()=>g(!1),filenamePrefix:"orders-export"}),v=({scope:V,columns:I,modules:M,format:O})=>{let L=[];V==="current_page"?L=t.getTableData().map(H=>H.id).filter(Boolean):V==="selected"&&(L=_.value.map(H=>H.id).filter(Boolean)),y.startExport({scope:V,ids:L,columns:I,modules:M,format:O})},w=V=>{_.value=V},k=K(()=>c.value.total?Math.min(100,Math.round(c.value.processed/c.value.total*100)):0),b=K(()=>{if(!c.value.total)return"";const V=Math.min(c.value.processed,c.value.total);return s.value?u("Deleting %1$s of %2$s Test Orders",V,c.value.total):u("Deleted %1$s of %2$s Test Orders",V,c.value.total)}),S=K(()=>c.value.total?s.value?u("Deleting... %1$s",`${k.value}%`):u("Completed"):""),$=()=>{l.value=window.innerWidth<768},D=()=>{c.value={total:0,processed:0,deleted:0,failed:0},p.value=""},F=V=>{V==="show_order_stats"&&(Vt.set("show_order_stats",!a.value),a.value=!a.value),V==="show_delete_bulk_action"&&t.showBulkDeleteAction(!0),V==="hide_delete_bulk_action"&&t.showBulkDeleteAction(!1),V==="delete_test_orders"&&B()},B=async()=>{var V,I;if(!s.value){try{await Fl.confirm(u("Are you sure you want to delete all test orders? This action cannot be undone."),u("Confirm Delete!"),{confirmButtonText:u("Delete"),cancelButtonText:u("Cancel"),cancelButtonClass:"el-button--small",confirmButtonClass:"el-button--small",type:"warning"})}catch{return}s.value=!0,i.value=!0,D();try{let M=0,O=0,L=0;for(;;){const j=await Ae.post("orders/do-bulk-action",{action:"delete_test_orders",last_order_id:M}),W=j||{};if(O=O||Number(W.total_count||0),L+=Number(W.batch_count||0),c.value={total:O,processed:L,deleted:c.value.deleted+Number(W.deleted_count||0),failed:c.value.failed+Number(W.failed_count||0)},p.value=W.has_more?u("Processed %1$s of %2$s test orders...",Math.min(L,O),O):(j==null?void 0:j.message)||"",!W.has_more)break;M=Number(W.last_attempted_order_id||0),await new Promise(G=>setTimeout(G,100))}if(!c.value.total){i.value=!1,q.info(u("No test orders found to delete"));return}const H=c.value.failed?u("Deleted %1$s test orders. %2$s test orders could not be deleted.",c.value.deleted,c.value.failed):u("Deleted %s test orders successfully",c.value.deleted);p.value=H,q.success(H),t.fetch()}catch(M){p.value=((V=M==null?void 0:M.data)==null?void 0:V.message)||u("Failed to delete test orders"),q.error(((I=M==null?void 0:M.data)==null?void 0:I.message)||u("Failed to delete test orders"))}finally{s.value=!1}}},U=()=>{i.value=!1},Q=()=>{const V=Vt.get("show_order_stats");V&&(a.value=V)};return Ie(()=>{Q(),$(),window.addEventListener("resize",$)}),Bt(()=>{window.removeEventListener("resize",$)}),(V,I)=>{const M=C("el-icon"),O=C("el-button"),L=C("el-dropdown-item"),H=C("el-dropdown-menu"),j=C("el-dropdown"),W=C("el-tag"),G=C("el-progress"),Z=C("el-dialog");return r(),h("div",Y_,[n(ol,{title:A(u)("Orders")},{action:d(()=>[n(Ot,{permission:["reports/view","orders/manage","orders/export","orders/delete"]},{default:d(()=>[n(j,{trigger:"click","popper-class":"fct-dropdown",onCommand:F,placement:"bottom-end"},{dropdown:d(()=>[n(H,null,{default:d(()=>[n(Ot,{permission:"reports/view"},{default:d(()=>[n(L,{command:"show_order_stats"},{default:d(()=>[a.value?(r(),h(P,{key:1},[n(Y,{name:"EyeOff"}),R(" "+m(A(u)("Hide Order Stats")),1)],64)):(r(),h(P,{key:0},[n(Y,{name:"Eye"}),R(" "+m(A(u)("Show Order Stats")),1)],64))]),_:1}),A(t).data.showDeleteBulkAction?x("",!0):(r(),E(L,{key:0,command:"show_delete_bulk_action"},{default:d(()=>[n(Y,{name:"Eye"}),R(" "+m(A(u)("Show Bulk Actions")),1)]),_:1})),A(t).data.showDeleteBulkAction?(r(),E(L,{key:1,command:"hide_delete_bulk_action"},{default:d(()=>[n(Y,{name:"EyeOff"}),R(" "+m(A(u)("Hide Bulk Actions")),1)]),_:1})):x("",!0)]),_:1}),n(Ot,{permission:"orders/delete"},{default:d(()=>[n(L,{command:"delete_test_orders",disabled:s.value,class:"item-destructive"},{default:d(()=>[n(Y,{name:"Delete"}),R(" "+m(s.value?A(u)("Deleting Test Orders..."):A(u)("Delete Test Orders")),1)]),_:1},8,["disabled"])]),_:1}),n(Ot,{permission:"orders/export"},{default:d(()=>[n(L,{onClick:I[0]||(I[0]=ne=>f.value=!0)},{default:d(()=>[n(Y,{name:"Download"}),R(" "+m(A(u)("Export Orders")),1)]),_:1})]),_:1})]),_:1})]),default:d(()=>[n(O,null,{default:d(()=>[R(m(A(u)("More actions"))+" ",1),n(M,null,{default:d(()=>[n(A(Hn))]),_:1})]),_:1})]),_:1})]),_:1}),n(Ot,{permission:"orders/create"},{default:d(()=>[n(O,{tag:"router-link",type:"primary",to:{name:"add_order"}},{default:d(()=>[R(m(A(u)("Create Order")),1)]),_:1})]),_:1})]),_:1},8,["title"]),n(Z,{modelValue:i.value,"onUpdate:modelValue":I[1]||(I[1]=ne=>i.value=ne),title:A(u)("Delete Test Orders"),"append-to-body":!0,"close-on-click-modal":!1,"show-close":!0,"close-on-press-escape":!0,onClose:U,class:"fct-delete-test-orders-modal"},{footer:d(()=>[s.value?x("",!0):(r(),h("div",hv,[n(O,{type:"primary",onClick:U},{default:d(()=>[R(m(A(u)("Done")),1)]),_:1})]))]),default:d(()=>[o("div",W_,[o("div",J_,m(b.value),1),o("div",X_,[o("div",Z_,m(s.value?A(u)("You can close this — deletion will continue in the background"):A(u)("Test order deletion completed.")),1),S.value?(r(),E(W,{key:0,type:"success",class:de(["fct-delete-test-orders-status",{"is-complete":!s.value}])},{default:d(()=>[R(m(S.value),1)]),_:1},8,["class"])):x("",!0)]),s.value?(r(),h("div",ev,[o("div",tv,[o("div",av,[(r(),h(P,null,te(8,ne=>o("div",{key:ne,class:"bar-block",id:`bar-block-${ne+1}`},null,8,lv)),64))]),R(" "+m(A(u)("Deleting...")),1)]),o("span",sv,m(k.value)+"% ",1)])):x("",!0),n(ya,{visible:s.value,fade:"",duration:300},{default:d(()=>[n(G,{percentage:k.value,"stroke-width":6,striped:"","striped-flow":"","show-text":!1,status:s.value?void 0:"success",class:"fct-delete-test-orders-progress"},null,8,["percentage","status"])]),_:1},8,["visible"]),o("div",nv,[o("div",ov,[I[3]||(I[3]=o("span",{class:"fct-delete-test-orders-stat-icon"},[o("svg",{width:"24",height:"24",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{opacity:"0.4",d:"M13.66 1.1333C13.3741 1.09487 13.0575 1.0716 12.7083 1.05762V1.66146V1.70461C12.7083 2.25782 12.7084 2.73471 12.6567 3.11653C12.6017 3.52616 12.4775 3.91865 12.1592 4.23714C11.8409 4.55563 11.4483 4.68009 11.0383 4.73518C10.6566 4.78653 10.18 4.78649 9.62663 4.78646H9.58329H8.74996H8.70662C8.15333 4.78649 7.67666 4.78653 7.29499 4.73518C6.88499 4.68009 6.49249 4.55563 6.17416 4.23714C5.85583 3.91865 5.73166 3.52616 5.67666 3.11653C5.62333 2.72482 5.625 2.23304 5.625 1.66146V1.05762C5.27583 1.0716 4.95917 1.09487 4.67333 1.1333C3.92333 1.23414 3.2925 1.45038 2.79083 1.95198C2.28917 2.45358 2.07249 3.08503 1.97166 3.83513C1.87499 4.55588 1.875 5.47186 1.875 6.60774V13.3818C1.875 14.5178 1.87499 15.4337 1.97166 16.1544C2.07249 16.9046 2.28917 17.536 2.79083 18.0376C3.2925 18.5392 3.92333 18.7554 4.67333 18.8563C5.39417 18.9532 6.31 18.9532 7.44667 18.9531H10.8866C11.0791 18.9532 11.2641 18.9519 11.4433 18.9515C11.2358 18.5378 11.0666 18.3449 10.9875 18.2671C10.18 18.0578 9.58329 17.3269 9.58329 16.4539C9.58329 15.4184 10.4225 14.5789 11.4583 14.5789C11.6941 14.5789 11.9733 14.6359 12.1158 14.6766C12.31 14.7322 12.52 14.8165 12.7383 14.9346C13.1533 14.298 13.6958 13.5629 14.3133 12.9367C14.8741 12.3678 15.5933 11.7846 16.4583 11.432V6.60774C16.4583 5.47186 16.4583 4.55588 16.3616 3.83513C16.2608 3.08503 16.0441 2.45358 15.5425 1.95198C15.0408 1.45038 14.41 1.23414 13.66 1.1333Z",fill:"#017EF3"}),o("path",{d:"M17.012 12.3361C17.4462 12.1825 17.922 12.4094 18.0753 12.8431C18.2295 13.2768 18.002 13.753 17.5687 13.9068C17.1453 14.0568 16.6945 14.3786 16.2395 14.8393C15.7912 15.2944 15.3778 15.845 15.022 16.3897C14.6687 16.9317 14.3828 17.4519 14.1853 17.8374C14.087 18.0296 13.9387 18.3456 13.8879 18.4534C13.7587 18.7501 13.4695 18.9462 13.1453 18.9548C12.822 18.9633 12.5228 18.7836 12.3778 18.4942C12.0112 17.7597 11.6821 17.4672 11.5154 17.3564C11.4421 17.3074 11.3937 17.2895 11.3762 17.284C10.9537 17.2435 10.6237 16.8878 10.6237 16.4548C10.6237 15.9945 10.997 15.6214 11.457 15.6214C11.5645 15.6214 11.7428 15.6547 11.8287 15.6792C12.002 15.7287 12.2112 15.8173 12.4403 15.9698C12.6295 16.0958 12.8245 16.2633 13.0228 16.48C13.1945 16.1726 13.3971 15.8302 13.6271 15.4782C14.0187 14.8772 14.5003 14.2296 15.0528 13.6691C15.6003 13.1143 16.2595 12.6028 17.012 12.3361ZM9.16532 11.8714C9.51032 11.8714 9.79032 12.1513 9.79032 12.4964C9.79032 12.8416 9.51032 13.1214 9.16532 13.1214H5.83203C5.48703 13.1214 5.20703 12.8416 5.20703 12.4964C5.20703 12.1513 5.48703 11.8714 5.83203 11.8714H9.16532ZM12.4987 8.53809C12.8437 8.53809 13.1237 8.81793 13.1237 9.16309C13.1237 9.50826 12.8437 9.78809 12.4987 9.78809H5.83203C5.48703 9.78809 5.20703 9.50826 5.20703 9.16309C5.20703 8.81793 5.48703 8.53809 5.83203 8.53809H12.4987ZM11.457 1.0389V1.66309C11.457 2.26994 11.4562 2.66228 11.417 2.95134C11.3803 3.22242 11.3212 3.3074 11.2737 3.35498C11.2262 3.40256 11.1412 3.46176 10.8704 3.49821C10.5812 3.53706 10.1887 3.53809 9.58199 3.53809H8.74866C8.14203 3.53809 7.74952 3.53706 7.46036 3.49821C7.18952 3.46176 7.10453 3.40256 7.05703 3.35498C7.00953 3.3074 6.95036 3.22242 6.9137 2.95134C6.87453 2.66228 6.8737 2.26994 6.8737 1.66309V1.0389C7.05786 1.03839 7.24786 1.03808 7.44536 1.03809H10.8853C11.0828 1.03808 11.2728 1.03839 11.457 1.0389Z",fill:"#017EF3"})])],-1)),o("span",iv,m(A(u)("Processed")),1),o("span",rv,m(c.value.processed)+" / "+m(c.value.total),1)]),o("div",dv,[I[4]||(I[4]=o("span",{class:"fct-delete-test-orders-stat-icon"},[o("svg",{width:"24",height:"24",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{opacity:"0.4",d:"M16.9433 13.0463C16.88 14.0913 16.8292 14.9197 16.725 15.5813C16.6183 16.2605 16.4475 16.8263 16.1067 17.3205C15.7942 17.773 15.3917 18.1547 14.9258 18.4413C14.4158 18.7555 13.8467 18.8922 13.1692 18.958H8.06417C7.38667 18.8922 6.81667 18.7547 6.30667 18.4405C5.84 18.153 5.4375 17.7705 5.125 17.3172C4.78417 16.8222 4.61417 16.2563 4.50833 15.5763C4.405 14.913 4.355 14.083 4.2925 13.0372L3.75 3.95801H17.5L16.9433 13.0463Z",fill:"#189877"}),o("path",{d:"M11.7488 1.06879C12.2196 1.11046 12.6621 1.25462 13.043 1.53796C13.3238 1.74712 13.5188 2.00379 13.6855 2.28212C13.8405 2.53962 13.9963 2.86046 14.173 3.22462L14.528 3.95879H18.1263C18.5863 3.95879 18.9596 4.33129 18.9596 4.79212C18.9596 5.25212 18.5863 5.62546 18.1263 5.62546H3.1263C2.6663 5.62546 2.29297 5.25212 2.29297 4.79212C2.29297 4.33129 2.6663 3.95879 3.1263 3.95879H6.8013L7.09797 3.30796C7.26964 2.93046 7.4213 2.59796 7.5738 2.33129C7.73797 2.04296 7.93214 1.77629 8.21714 1.55796C8.6013 1.26296 9.05297 1.11379 9.53464 1.06962C9.86213 1.03962 10.193 1.04046 10.5221 1.04129C10.5571 1.04129 10.5913 1.04212 10.6263 1.04212C10.6605 1.04212 10.6955 1.04212 10.7288 1.04212C11.1138 1.04212 11.4605 1.04296 11.7488 1.06879ZM8.63297 3.95879H12.6763C12.4871 3.56879 12.3663 3.32212 12.2571 3.13962C12.0963 2.87296 11.9046 2.75546 11.6005 2.72879C11.3846 2.70962 11.103 2.70879 10.6555 2.70879C10.1963 2.70879 9.90714 2.70962 9.68547 2.72962C9.3738 2.75796 9.17964 2.87962 9.0213 3.15712C8.91714 3.33879 8.80464 3.58212 8.63297 3.95879Z",fill:"#189877"})])],-1)),o("span",uv,m(A(u)("Deleted")),1),o("span",cv,m(c.value.deleted),1)]),o("div",Av,[I[5]||(I[5]=o("span",{class:"fct-delete-test-orders-stat-icon"},[o("svg",{width:"24",height:"24",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{opacity:"0.4",d:"M10.0013 1.04004C14.9488 1.04004 18.9596 5.05082 18.9596 9.99833C18.9596 14.9459 14.9488 18.9567 10.0013 18.9567C5.0538 18.9567 1.04297 14.9459 1.04297 9.99833C1.04297 9.54867 1.40778 9.18392 1.85677 9.18375C2.30677 9.18375 2.6722 9.54858 2.6722 9.99833C2.6722 14.0463 5.95297 17.3282 10.0013 17.3282C14.0496 17.3282 17.3304 14.0463 17.3304 9.99833C17.3304 5.95037 14.0496 2.66846 10.0013 2.66846C9.55138 2.66846 9.18764 2.30434 9.18747 1.85466C9.18747 1.40488 9.5513 1.04004 10.0013 1.04004ZM2.80566 4.66634C3.08066 4.35891 3.55043 4.30436 3.89209 4.55241C4.25514 4.81714 4.33519 5.32656 4.07031 5.69011L3.90674 5.92448C3.53507 6.47876 3.23784 7.08712 3.02784 7.73356C2.88857 8.16094 2.42904 8.39483 2.00163 8.25602C1.57424 8.11701 1.33924 7.65747 1.47835 7.22982C1.77169 6.32508 2.20608 5.48362 2.75358 4.73145L2.80566 4.66634ZM7.3125 1.45345C7.71574 1.36659 8.12817 1.59791 8.25814 1.9987C8.39722 2.42644 8.16233 2.88598 7.73486 3.02491L7.46061 3.12011C6.82564 3.35476 6.23137 3.67519 5.69222 4.06738L5.62224 4.11214C5.26557 4.32003 4.80286 4.22905 4.55453 3.88835C4.29044 3.52472 4.37034 3.01452 4.73356 2.74984L5.02084 2.55046C5.69734 2.09692 6.44048 1.7332 7.23194 1.47624L7.3125 1.45345Z",fill:"#F04438"}),o("path",{d:"M11.9754 6.85201C12.3029 6.58506 12.7854 6.6039 13.0904 6.90897C13.3954 7.21407 13.4145 7.69657 13.147 8.02388L13.0904 8.08736L11.1787 9.99808L13.0895 11.9089L13.147 11.9724C13.4137 12.2997 13.3945 12.7823 13.0895 13.0873C12.7845 13.3923 12.302 13.4113 11.9745 13.1442L11.9112 13.0873L10.0012 11.1765L8.09122 13.0873C7.76538 13.4127 7.23789 13.4127 6.91289 13.0873C6.58706 12.7619 6.58706 12.2344 6.91289 11.9089L8.82288 9.99808L6.91206 8.08736L6.85456 8.02388C6.58789 7.69657 6.60706 7.21407 6.91206 6.90897C7.21706 6.6039 7.69955 6.58506 8.02705 6.85201L8.09039 6.90897L10.0012 8.81975L11.912 6.90897L11.9754 6.85201Z",fill:"#F04438"})])],-1)),o("span",pv,m(A(u)("Failed")),1),o("span",fv,m(c.value.failed),1)])]),p.value&&!s.value?(r(),h("p",mv,m(p.value),1)):x("",!0)])]),_:1},8,["modelValue","title"]),n(Ot,{permission:"reports/view"},{default:d(()=>[a.value?(r(),E(D_,{key:0})):x("",!0)]),_:1}),n(Ot,{permission:"orders/view"},{default:d(()=>[o("div",_v,[n(Ts,{table:A(t),classicTabStyle:!0,hasMobileSlot:!0},{mobile:d(()=>[A(t).isLoading()?(r(),E(q_,{key:0})):x("",!0),A(t).isLoading()?x("",!0):(r(),E(dd,{key:1,table:A(t),orders:A(t).getTableData(),columns:A(t).data.columns,"empty-text":A(t).emptyMessage},null,8,["table","orders","columns","empty-text"]))]),default:d(()=>[A(t).isLoading()?(r(),E(N_,{key:0,orderTable:A(t),"next-page-count":A(t).nextPageCount},null,8,["orderTable","next-page-count"])):(r(),E(rd,{key:1,table:A(t),orders:A(t).getTableData(),columns:A(t).data.columns,"empty-text":A(t).emptyMessage,onSelectionChange:w},null,8,["table","orders","columns","empty-text"]))]),_:1},8,["table"])])]),_:1}),n(tA,{modelValue:f.value,"onUpdate:modelValue":I[2]||(I[2]=ne=>f.value=ne),title:A(u)("Export Orders"),"selected-count":_.value.length,"current-page-count":A(t).getTableData().length,"total-count":A(t).data.paginate.total,"item-label-singular":A(u)("order"),"item-label-plural":A(u)("orders"),"has-active-filter":!!A(t).isFiltering(),"export-state":A(y),onExport:v},null,8,["modelValue","title","selected-count","current-page-count","total-count","item-label-singular","item-label-plural","has-active-filter","export-state"])])}}},gv={class:"setting-wrap"},yv={class:"setting-wrap-inner"},bv={class:"setting-confirmation-content"},wv={class:"custom-wp-editor-wrapper"},Cv={class:"setting-save-action"},kv={__name:"InvoicePacking",setup(e){const t=T([]),a=T([]),l=T(!1),s=T(!1);ws().onSave(()=>{_()});const c=T([u("Invoice Template"),u("Packing Slip Template"),u("Delivery Slip Template"),u("Shipping Slip Template"),u("Dispatch Slip Template")]),p=()=>{l.value=!0,Ae.get("templates/print-templates").then(g=>{t.value=g.templates,l.value=!1}).catch(g=>{q.error(g)}).finally(()=>{l.value=!1})},f=()=>{l.value=!0,Ae.get("settings/confirmation/shortcode",{}).then(g=>{a.value=g.data}).catch(g=>{q.error(g)}).finally(()=>{l.value=!1})},_=()=>{s.value=!0,Ae.put("templates/print-templates",{templates:t.value}).then(g=>{q.success(g.message)}).catch(g=>{q.error(g)}).finally(()=>{s.value=!1})};return Ie(()=>{p(),f()}),(g,y)=>{const v=C("el-skeleton");return C("el-button"),r(),h("div",gv,[n(Ua,{heading:A(u)("Invoice & Packing"),"show-save-button":!1},null,8,["heading"]),o("div",yv,[n(Ia),n(el,{class:"mb-5",type:"information",content:A(u)("It will be available soon!")},null,8,["content"]),l.value?(r(!0),h(P,{key:0},te(c.value,(w,k)=>(r(),E(Se,{key:k},{default:d(()=>[n(Ve,{title:w,border_bottom:""},null,8,["title"]),n(ke,null,{default:d(()=>[n(v,{animated:"",rows:6})]),_:1})]),_:2},1024))),128)):x("",!0),!l.value&&t.value.length>0?(r(),h(P,{key:1},[(r(!0),h(P,null,te(t.value,(w,k)=>(r(),E(Se,{key:k},{default:d(()=>[n(Ve,{title:w.title+" (Under Development)",border_bottom:""},null,8,["title"]),n(ke,null,{default:d(()=>[o("div",bv,[o("div",wv,[n(ls,{"short-codes":a.value,modelValue:w.content,"onUpdate:modelValue":b=>w.content=b,onUpdate:b=>{w.content=b}},null,8,["short-codes","modelValue","onUpdate:modelValue","onUpdate"])])])]),_:2},1024)]),_:2},1024))),128)),o("div",Cv,[x("",!0)])],64)):x("",!0)])])}}},Bv={key:0,class:"bg-white p-10 rounded m-10 dark:bg-dark-600"},xv={__name:"PdfTemplateRoute",setup(e){const t=ze.get("app_config.isProActive");return(a,l)=>{const s=C("router-view");return A(t)?(r(),E(s,{key:1})):(r(),h("div",Bv,[n(dn,{placement:"feature_lock_pdf_templates",title:A(u)("PDF Templates"),text:A(u)("Customizable PDF receipts, invoices, and e-invoices with ZUGFeRD support.")},null,8,["title","text"])]))}}},Sv={class:"setting-wrap"},Fv={class:"setting-wrap-inner"},$v={class:"flex gap-5"},Ev={class:"flex flex-col items-center justify-center py-12 text-center"},Uv={class:"text-lg font-semibold mb-2 text-system-dark dark:text-gray-200"},Iv={class:"text-sm text-system-mid dark:text-gray-400 mb-6 max-w-md"},Qv={class:"fct-pdf-template-desc"},Dv={class:"fct-pdf-template-grid"},Vv={class:"fct-pdf-template-preview"},Tv={class:"fct-pdf-template-preview-placeholder"},Mv={class:"fct-pdf-placeholder-text"},Lv={class:"fct-pdf-template-overlay"},Rv={class:"fct-pdf-template-footer"},Ov={class:"fct-pdf-template-name-row"},Pv={class:"fct-pdf-template-title"},Hv={key:0,class:"fct-pdf-badge fct-pdf-badge--default"},Nv={__name:"PdfTemplateIndex",setup(e){const t=sl(),a=T(!0),l=T(!1),s=T({}),i=T(!1),c=T(""),p=T(!1),f=T(""),_=T(null),g=T(!1),y=T(!1),v=ze.get("app_config.isProActive"),w=()=>{a.value=!0,Ae.get("settings/pdf-templates/receipt").then(F=>{s.value=F.templates||{},l.value=F.has_fluent_pdf||!1,_.value=F.addon_info||null}).catch(F=>{var B;q.error(((B=F.data)==null?void 0:B.message)||u("Failed to load templates"))}).finally(()=>{a.value=!1})},k=()=>{if(_.value){if(!v&&_.value.repo_link){window.open(_.value.repo_link,"_blank","noopener,noreferrer");return}g.value=!0,Ae.post("settings/modules/plugin-addons/install",{plugin_slug:_.value.plugin_slug,source_type:_.value.source_type||"wordpress",source_link:_.value.source_link||"",asset_path:_.value.asset_path||""}).then(F=>{q.success(F.message||u("Plugin installed successfully")),setTimeout(()=>{window.location.reload()},500)}).catch(F=>{var B;q.error(((B=F.data)==null?void 0:B.message)||u("Failed to install plugin"))}).finally(()=>{g.value=!1})}},b=()=>{_.value&&(y.value=!0,Ae.post("settings/modules/plugin-addons/activate",{plugin_file:_.value.plugin_file}).then(F=>{q.success(F.message||u("Plugin activated successfully")),setTimeout(()=>{window.location.reload()},500)}).catch(F=>{var B;q.error(((B=F.data)==null?void 0:B.message)||u("Failed to activate plugin"))}).finally(()=>{y.value=!1}))},S=()=>{c.value="",i.value=!0},$=()=>{if(!c.value.trim()){q.error(u("Please enter a template name"));return}p.value=!0,Ae.post("settings/pdf-templates/create",{title:c.value.trim()}).then(F=>{i.value=!1,q.success(F.message||u("Template created")),F.slug?t.push({name:"edit-pdf-template",params:{template:F.slug}}):w()}).catch(F=>{var B;q.error(((B=F.data)==null?void 0:B.message)||u("Failed to create template"))}).finally(()=>{p.value=!1})},D=F=>{f.value=F,Ae.delete("settings/pdf-templates/delete/"+F).then(B=>{q.success(B.message||u("Template deleted")),w()}).catch(B=>{var U;q.error(((U=B.data)==null?void 0:U.message)||u("Failed to delete template"))}).finally(()=>{f.value=""})};return Ie(()=>{w()}),(F,B)=>{const U=C("el-button"),Q=C("el-skeleton-item"),V=C("el-skeleton"),I=C("el-popconfirm"),M=C("el-input"),O=C("el-form-item"),L=C("el-form"),H=C("el-dialog");return r(),h("div",Sv,[n(Ua,{heading:A(u)("PDF Templates"),"show-save-button":!1},oa({_:2},[l.value?{name:"action",fn:d(()=>[n(U,{type:"primary",size:"small",onClick:S},{default:d(()=>[R(m(A(u)("Add Template")),1)]),_:1})]),key:"0"}:void 0]),1032,["heading"]),o("div",Fv,[n(Ia),a.value?(r(),E(Se,{key:0},{default:d(()=>[n(ke,null,{default:d(()=>[n(V,{animated:""},{template:d(()=>[n(Q,{variant:"text",class:"w-[300px] mb-4"}),o("div",$v,[n(Q,{variant:"rect",style:{width:"220px",height:"280px","border-radius":"8px"}}),n(Q,{variant:"rect",style:{width:"220px",height:"280px","border-radius":"8px"}})])]),_:1})]),_:1})]),_:1})):x("",!0),!a.value&&!l.value&&_.value?(r(),E(Se,{key:1},{default:d(()=>[n(ke,null,{default:d(()=>[o("div",Ev,[B[3]||(B[3]=o("svg",{class:"mb-4",width:"48",height:"48",viewBox:"0 0 32 32",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[o("path",{d:"M8 2C6.9 2 6 2.9 6 4v24c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V10l-8-8H8z"}),o("path",{d:"M18 2v8h8"}),o("path",{d:"M12 18h8M12 22h6"})],-1)),o("h3",Uv,m(A(u)("Fluent PDF Required")),1),o("p",Iv,m(A(u)("To use PDF receipt templates, you need to install and activate the Fluent PDF plugin.")),1),_.value.is_installed?_.value.is_installed&&!_.value.is_active?(r(),E(U,{key:1,type:"success",loading:y.value,onClick:b},{default:d(()=>[R(m(A(u)("Activate Plugin")),1)]),_:1},8,["loading"])):x("",!0):(r(),E(U,{key:0,type:"primary",loading:g.value,onClick:k},{default:d(()=>[R(m(A(v)?A(u)("Install & Activate"):A(u)("Download")),1)]),_:1},8,["loading"]))])]),_:1})]),_:1})):x("",!0),!a.value&&l.value?(r(),E(Se,{key:2},{default:d(()=>[n(ke,null,{default:d(()=>[o("p",Qv,m(A(u)("Customize PDF templates for email attachments. Select which template to attach in each email notification's settings.")),1),o("div",Dv,[(r(!0),h(P,null,te(s.value,(j,W)=>(r(),h("div",{key:W,class:"fct-pdf-template-card"},[o("div",Vv,[o("div",Tv,[B[4]||(B[4]=o("svg",{width:"40",height:"40",viewBox:"0 0 32 32",fill:"none",stroke:"#525866","stroke-width":"1.2"},[o("path",{d:"M8 2C6.9 2 6 2.9 6 4v24c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V10l-8-8H8z"}),o("path",{d:"M18 2v8h8"}),o("path",{d:"M12 18h8M12 22h6"})],-1)),o("span",Mv,m(j.title||A(u)("Receipt Template")),1)]),o("div",Lv,[n(U,{type:"primary",size:"small",tag:"router-link",to:{name:"edit-pdf-template",params:{template:W}}},{default:d(()=>[R(m(A(u)("Edit Template")),1)]),_:2},1032,["to"])])]),o("div",Rv,[o("div",Ov,[o("span",Pv,m(j.title||W),1),j.is_default?(r(),h("span",Hv,m(A(u)("Built-in")),1)):x("",!0)]),j.is_default?x("",!0):(r(),E(I,{key:0,title:A(u)("Delete this template?"),"confirm-button-text":A(u)("Delete"),"cancel-button-text":A(u)("Cancel"),"confirm-button-type":"danger",onConfirm:G=>D(W)},{reference:d(()=>[n(U,{type:"danger",size:"small",text:"",loading:f.value===W,class:"fct-pdf-delete-btn"},{default:d(()=>B[5]||(B[5]=[o("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o("path",{d:"M3 6h18"}),o("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})],-1)])),_:2,__:[5]},1032,["loading"])]),_:2},1032,["title","confirm-button-text","cancel-button-text","onConfirm"]))])]))),128))])]),_:1})]),_:1})):x("",!0)]),n(H,{modelValue:i.value,"onUpdate:modelValue":B[2]||(B[2]=j=>i.value=j),title:A(u)("Add Custom Template"),width:"420px","close-on-click-modal":!1,"append-to-body":!0},{footer:d(()=>[n(U,{onClick:B[1]||(B[1]=j=>i.value=!1)},{default:d(()=>[R(m(A(u)("Cancel")),1)]),_:1}),n(U,{type:"primary",onClick:$,loading:p.value},{default:d(()=>[R(m(A(u)("Create")),1)]),_:1},8,["loading"])]),default:d(()=>[n(L,{onSubmit:Ge($,["prevent"]),"label-position":"top"},{default:d(()=>[n(O,{label:A(u)("Template Name")},{default:d(()=>[n(M,{modelValue:c.value,"onUpdate:modelValue":B[0]||(B[0]=j=>c.value=j),placeholder:A(u)("e.g. Custom Invoice"),autofocus:""},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1})]),_:1},8,["modelValue","title"])])}}},Kv={name:"EmailBodySkeleton",props:{showLoadingBadge:{type:Boolean,default:!1}}},Gv={class:"fct-email-body-skeleton"},zv={class:"fct-email-body-skeleton__page"},jv={key:0,class:"fct-ebs__badge"},qv={class:"fct-ebs__badge-text"};function Yv(e,t,a,l,s,i){return r(),h("div",Gv,[o("div",zv,[t[3]||(t[3]=Dn('<div class="fct-ebs__skel fct-ebs__header"></div><div style="height:8px;"></div><div class="fct-ebs__row"><div class="fct-ebs__skel" style="width:45%;height:12px;"></div><div style="flex:1;"></div><div class="fct-ebs__skel" style="width:30%;height:12px;"></div></div><div class="fct-ebs__divider"></div><div class="fct-ebs__grid"><div class="fct-ebs__skel"></div><div class="fct-ebs__skel"></div><div class="fct-ebs__skel"></div><div class="fct-ebs__skel"></div></div><div class="fct-ebs__row" style="margin-top:2px;"><div class="fct-ebs__skel" style="width:30%;height:12px;"></div><div class="fct-ebs__skel" style="width:20%;height:12px;"></div><div class="fct-ebs__skel" style="width:30%;height:12px;"></div><div class="fct-ebs__skel" style="width:20%;height:12px;"></div></div><div class="fct-ebs__divider"></div><div class="fct-ebs__row"><div class="fct-ebs__skel" style="flex:1;height:12px;"></div></div><div class="fct-ebs__row"><div class="fct-ebs__skel" style="width:45%;height:12px;"></div></div>',9)),a.showLoadingBadge?(r(),h("div",jv,[t[0]||(t[0]=o("span",{class:"fct-ebs__dot"},null,-1)),t[1]||(t[1]=o("span",{class:"fct-ebs__dot"},null,-1)),t[2]||(t[2]=o("span",{class:"fct-ebs__dot"},null,-1)),o("span",qv,m(e.$t("Loading block editor…")),1)])):x("",!0)])])}const hr=nt(Kv,[["render",Yv]]),Wv={name:"NewEditorFrame",components:{EmailBodySkeleton:hr},props:{editorPath:{type:String,default:"/editor"},modelValue:{type:String,default:""},editorParams:{type:Object,default:()=>({})},frameHeight:{type:String,default:"500px"},documentTitle:{type:String,default:""}},emits:["update:modelValue","titleUpdated","contentUpdated","editorFullscreenToggle","featuredMediaUpdated","previewRequest","autosaveState"],data(){return{editorData:{content:""},editorFrame:null,editorOrigin:null,dataSent:!1,isFailing:!1,iframeReady:!1,pendingDataSend:!1,sendRetries:0,editorReadyReceived:!1,editorContentReady:!1,isFullscreen:!1,_timers:[]}},computed:{editorFailed(){return!this.dataSent&&this.isFailing&&!this.editorReadyReceived}},mounted(){this._setTimeout(()=>{this.editorReadyReceived||(this.isFailing=!0)},3e4),this.editorData.content=this.modelValue,this.editorData.title=this.documentTitle,this.createEditorIframe(),window.addEventListener("message",this.handleEditorMessage)},beforeUnmount(){this._timers.forEach(e=>clearTimeout(e)),this._timers=[],window.removeEventListener("message",this.handleEditorMessage),this.isFullscreen&&this.toggleFullScreen(!1),this.editorFrame&&(this.editorFrame.onload=null,this.$refs.iframeContainer.removeChild(this.editorFrame),this.editorFrame=null)},methods:{_setTimeout(e,t){const a=setTimeout(e,t);return this._timers.push(a),a},createEditorIframe(){this.editorFrame=document.createElement("iframe");let e=this.appVars.fct_editor_frame;if(this.editorParams){const t=new URLSearchParams(this.editorParams);e+="&"+t.toString()}try{this.editorOrigin=new URL(e,window.location.origin).origin}catch{this.editorOrigin=window.location.origin}this.editorFrame.src=e,this.editorFrame.style.width="100%",this.editorFrame.style.height=this.frameHeight,this.editorFrame.onload=()=>{this.iframeReady=!0,this.pendingDataSend&&(this.pendingDataSend=!1,this._setTimeout(()=>{this.sendDataToEditor()},1e3)),this._setTimeout(()=>{!this.editorReadyReceived&&this.iframeReady&&this.sendDataToEditor()},1e4)},this.$refs.iframeContainer.appendChild(this.editorFrame)},sendDataToEditor(){if(!this.iframeReady||!this.editorFrame||!this.editorFrame.contentWindow){this.pendingDataSend=!0;return}try{const e=JSON.parse(JSON.stringify(this.editorData));this.editorFrame.contentWindow.postMessage({action:"UPDATE_EDITOR",data:e},this.editorOrigin),this.dataSent=!0,this.sendRetries=0,this._setTimeout(()=>{this.editorContentReady||(this.editorContentReady=!0)},5e3)}catch{this.sendRetries++,this.sendRetries<=3&&this._setTimeout(()=>{this.sendDataToEditor()},500)}},handleEditorMessage(e){if(e&&e.origin&&this.editorOrigin&&e.origin!==this.editorOrigin)return;const{action:t,content:a}=e.data;t==="EDITOR_UPDATED"?this.dataSent&&(this.editorContentReady||this._setTimeout(()=>{this.editorContentReady=!0},1500),this.editorData.content=a,this.$emit("update:modelValue",a),this.$emit("contentUpdated",a)):t==="TITLE_UPDATED"?(this.editorData.title=a,this.$emit("titleUpdated",a)):t==="FEATURED_MEDIA_UPDATED"?this.$emit("featuredMediaUpdated",a):t==="EDITOR_FULLSCREEN_TOGGLE"?this.toggleFullScreen(a):t==="EMAIL_PREVIEW_REQUEST"?this.$emit("previewRequest"):t==="AUTOSAVE_STATE"?this.$emit("autosaveState",a):t==="EDITOR_READY"&&(this.editorReadyReceived=!0,this.isFailing=!1,this.sendDataToEditor())},forceAutosave(){this.editorFrame&&this.editorFrame.contentWindow&&this.editorFrame.contentWindow.postMessage({action:"FORCE_SAVE"},this.editorOrigin)},toggleFullScreen(e){this.isFullscreen=e;const t=this.editorFrame;if(e){if(document.documentElement.classList.add("fct-editor-fullscreen"),document.body.style.overflow="hidden",t){t.classList.add("fct-fullscreen-iframe"),this._fullscreenAncestors=[];let a=t.parentElement;for(;a&&a!==document.documentElement;)a.classList.add("fct-fullscreen-ancestor"),this._fullscreenAncestors.push(a),a=a.parentElement}}else document.documentElement.classList.remove("fct-editor-fullscreen"),document.body.style.overflow="",t&&t.classList.remove("fct-fullscreen-iframe"),this._fullscreenAncestors&&(this._fullscreenAncestors.forEach(function(a){a.classList.remove("fct-fullscreen-ancestor")}),this._fullscreenAncestors=null);this.$emit("editorFullscreenToggle",e)}}},Jv={style:{width:"100%"}},Xv={key:0,style:{display:"flex","justify-content":"center","align-items":"center","column-gap":"10px"}},Zv={class:"editor-container",style:{position:"relative"}},eg={key:0,class:"fct-editor-skeleton"},tg={ref:"iframeContainer",class:"iframe-container"};function ag(e,t,a,l,s,i){const c=C("EmailBodySkeleton");return r(),h("div",Jv,[i.editorFailed?(r(),h("div",Xv,[o("p",null,m(e.$t("Problem with loading the editor. Please reload the page.")),1)])):x("",!0),o("div",Zv,[n(Xl,{name:"fct-skeleton-fade"},{default:d(()=>[s.editorContentReady?x("",!0):(r(),h("div",eg,[t[0]||(t[0]=o("div",{class:"fct-skel-menubar"},[o("div",{class:"fct-skel fct-skel-logo"}),o("div",{class:"fct-skel-slash"}),o("div",{class:"fct-skel fct-skel-name"}),o("div",{class:"fct-skel-spacer"}),o("div",{class:"fct-skel fct-skel-btn-wide"}),o("div",{class:"fct-skel-dot"}),o("div",{class:"fct-skel-dot"})],-1)),t[1]||(t[1]=o("div",{class:"fct-skel-toolbar"},[o("div",{class:"fct-skel fct-skel-tb-btn"}),o("div",{class:"fct-skel fct-skel-tb-btn"}),o("div",{class:"fct-skel fct-skel-tb-btn"}),o("div",{class:"fct-skel-sep"}),o("div",{class:"fct-skel fct-skel-tb-btn"}),o("div",{class:"fct-skel fct-skel-tb-btn"}),o("div",{class:"fct-skel-sep"}),o("div",{class:"fct-skel fct-skel-tb-wide"}),o("div",{class:"fct-skel fct-skel-tb-wide"}),o("div",{class:"fct-skel-sep"}),o("div",{class:"fct-skel fct-skel-tb-btn"})],-1)),n(c,{"show-loading-badge":!0})]))]),_:1}),o("div",tg,null,512)])])}const gA=nt(Wv,[["render",ag],["__scopeId","data-v-e5dae537"]]),lg={class:"setting-wrap fct-pdf-template-edit-wrapper"},sg={class:"capitalize"},ng={class:"setting-wrap-inner"},og={class:"bg-white rounded dark:bg-dark-700 p-6 mb-4"},ig={class:"setting-save-action"},rg={__name:"PdfTemplateEdit",props:{template:{type:String,required:!0}},setup(e){const t=e,a=sl(),l=T(!0),s=T(!1),i=T(!1),c=T(!1),p=T(null),f=T(null),_=T(""),g=B=>{const U=atob(B),Q=new Array(U.length);for(let V=0;V<U.length;V++)Q[V]=U.charCodeAt(V);return new Blob([new Uint8Array(Q)],{type:"application/pdf"})},y=async()=>{const B=await Ae.post("settings/pdf-templates/download",{template_id:t.template});if(!(B!=null&&B.pdf_base64))throw new Error(u("Failed to generate PDF"));return B},v=()=>{l.value=!0,Ae.get("settings/pdf-templates/receipt/"+t.template).then(B=>{var Q,V,I;p.value=B.template;const U=(I=(V=(Q=B.template)==null?void 0:Q.pdf_settings)==null?void 0:V[0])==null?void 0:I.pdf_structure;U&&(_.value=U.content||"")}).catch(B=>{var U;q.error(((U=B.data)==null?void 0:U.message)||u("Failed to load template"))}).finally(()=>{l.value=!1})},w=async({showSuccess:B=!0}={})=>{var Q,V,I,M;s.value=!0,f.value&&await f.value.forceAutosave();const U=((I=(V=(Q=p.value)==null?void 0:Q.pdf_settings)==null?void 0:V[0])==null?void 0:I.pdf_structure)||{};U.content=_.value;try{const O=await Ae.post("settings/pdf-templates/receipt/"+t.template,{pdf_structure:U});return B&&q.success(O.message||u("Template saved")),!0}catch(O){return q.error(((M=O.data)==null?void 0:M.message)||u("Failed to save template")),!1}finally{s.value=!1}},k=()=>{i.value=!0,y().then(B=>{const U=g(B.pdf_base64),Q=URL.createObjectURL(U),V=document.createElement("a");V.href=Q,V.download=B.filename||"receipt-test.pdf",document.body.appendChild(V),V.click(),document.body.removeChild(V),URL.revokeObjectURL(Q),q.success(u("PDF downloaded"))}).catch(B=>{var U;q.error(((U=B.data)==null?void 0:U.message)||B.message||u("Failed to generate PDF"))}).finally(()=>{i.value=!1})},b=async()=>{var B;c.value=!0;try{const U=await y(),Q=g(U.pdf_base64),V=URL.createObjectURL(Q),I=document.createElement("a");I.href=V,I.target="_blank",I.rel="noopener",document.body.appendChild(I),I.click(),document.body.removeChild(I),setTimeout(()=>{URL.revokeObjectURL(V)},1e4)}catch(U){q.error(((B=U.data)==null?void 0:B.message)||U.message||u("Failed to generate PDF"))}finally{c.value=!1}},S=async()=>{s.value||i.value||c.value||!await w({showSuccess:!1})||await b()},$=()=>p.value&&!p.value.is_default,D=()=>{Ae.delete("settings/pdf-templates/delete/"+t.template).then(B=>{q.success(B.message||u("Template deleted")),a.push({path:"/settings/pdf-template"})}).catch(B=>{var U;q.error(((U=B.data)==null?void 0:U.message)||u("Failed to delete template"))})},F=()=>{Ae.get("settings/pdf-templates/factory-default").then(B=>{var V,I,M;const U=(V=B.templates)==null?void 0:V[t.template];if(!U)return;const Q=((M=(I=U.pdf_settings)==null?void 0:I[0])==null?void 0:M.pdf_structure)||{};return Ae.post("settings/pdf-templates/receipt/"+t.template,{pdf_structure:Q}).then(()=>{q.success(u("Reverted to default template")),v()})}).catch(B=>{var U;q.error(((U=B.data)==null?void 0:U.message)||u("Failed to revert template"))})};return Ie(()=>{v()}),(B,U)=>{const Q=C("el-breadcrumb-item"),V=C("el-breadcrumb"),I=C("el-icon"),M=C("el-button"),O=C("el-dropdown-item"),L=C("el-dropdown-menu"),H=C("el-dropdown"),j=C("el-skeleton-item"),W=C("el-skeleton");return r(),h("div",lg,[n(Ua,{loading:s.value,"loading-text":A(u)("Saving"),"save-button-text":A(u)("Save Template"),onOnSave:w},{heading:d(()=>[n(V,{class:"mb-0","separator-icon":A(Al)},{default:d(()=>[n(Q,{to:{path:"/settings/pdf-template"}},{default:d(()=>[R(m(A(u)("PDF Templates")),1)]),_:1}),n(Q,null,{default:d(()=>{var G;return[o("span",sg,m(((G=p.value)==null?void 0:G.title)||A(u)("Edit Template")),1)]}),_:1})]),_:1},8,["separator-icon"])]),action:d(()=>[n(H,{trigger:"click",style:{"margin-left":"12px",display:"inline-flex","align-items":"center"},"popper-class":"fct-dropdown"},{dropdown:d(()=>[n(L,null,{default:d(()=>[n(O,{onClick:k,disabled:i.value},{default:d(()=>[R(m(i.value?A(u)("Downloading..."):A(u)("Test Download")),1)]),_:1},8,["disabled"]),n(O,{onClick:F},{default:d(()=>[R(m(A(u)("Revert to Default")),1)]),_:1}),$()?(r(),E(O,{key:0,divided:"",onClick:D,style:{color:"#F56C6C"}},{default:d(()=>[R(m(A(u)("Delete Template")),1)]),_:1})):x("",!0)]),_:1})]),default:d(()=>[n(M,{size:"small",text:"",style:{height:"auto",padding:"4px"}},{default:d(()=>[n(I,{style:{transform:"rotate(90deg)","font-size":"16px"}},{default:d(()=>[n(A(lm))]),_:1})]),_:1})]),_:1})]),_:1},8,["loading","loading-text","save-button-text"]),o("div",ng,[n(Ia),n(W,{loading:l.value,class:"bg-white rounded p-6 dark:bg-dark-700",animated:""},{template:d(()=>[n(j,{variant:"h3",class:"w-[200px] mb-5"}),n(j,{variant:"rect",style:{width:"100%",height:"500px"}})]),_:1},8,["loading"]),!l.value&&p.value?(r(),h(P,{key:0},[o("div",og,[n(gA,{ref_key:"editorFrameRef",ref:f,editorParams:{block_type:"pdf_template",campaign_title:p.value.title,bid:t.template},frameHeight:"calc(100vh - 200px)",documentTitle:p.value.title||A(u)("Receipt Template"),onPreviewRequest:S,modelValue:_.value,"onUpdate:modelValue":U[0]||(U[0]=G=>_.value=G)},null,8,["editorParams","documentTitle","modelValue"])]),o("div",ig,[n(M,{onClick:w,type:"primary",disabled:s.value,loading:s.value},{default:d(()=>[R(m(A(u)("Save Template")),1)]),_:1},8,["disabled","loading"]),n(M,{onClick:k,disabled:i.value,loading:i.value},{default:d(()=>[R(m(A(u)("Test Download")),1)]),_:1},8,["disabled","loading"])])],64)):x("",!0)])])}}},dg={class:"fluent-cart-admin-validation-error-wrapper `${fieldKey}`"},_l=Object.assign({name:"ValidationError"},{__name:"ValidationError",props:{validationErrors:Object,fieldKey:{type:String,default:""}},setup(e){return(t,a)=>(r(),h("div",dg,[(r(!0),h(P,null,te(e.validationErrors,(l,s)=>(r(),h("span",{class:"fluent-cart-admin-validation-error",key:l.toLowerCase().replace(/\s/g,"")},m(l),1))),128))]))}}),xo={__name:"Alert",props:{type:String,title:String,description:String,closable:Boolean,showIcon:Boolean},setup(e){return(t,a)=>{const l=C("el-alert");return r(),E(l,{title:e.title,type:e.type,description:e.description,"show-icon":e.showIcon,closable:e.closable,role:"alert"},{default:d(()=>[ga(t.$slots,"default")]),_:3},8,["title","type","description","show-icon","closable"])}}},ug={class:"setting-wrap"},cg={class:"setting-wrap-inner"},Ag={class:"grid gap-3 mb-6"},pg={class:"grid gap-3 mb-6"},fg={class:"grid gap-3 mb-6"},mg={class:"grid gap-3"},hg={key:0,class:"mb-4 p-4 rounded-lg border border-yellow-300 bg-yellow-50 text-yellow-800 text-sm"},_g=["href"],vg={class:"form-note"},gg={class:"form-note"},yg=["href"],bg={class:"mb-4"},wg={class:"mb-4"},Cg={class:"form-note"},kg={class:"form-note"},Bg={class:"form-note"},xg={class:"form-note"},Sg={class:"setting-save-action"},Fg={__name:"PdfTemplateSettings",setup(e){const t=T(!0),a=T(!1),l=T({}),s=T(!0),i=T(""),c=T({zugferd_enabled:"0",zugferd_profile:"en16931",seller_legal_registration_scheme:"",seller_contact_name:"",seller_contact_email:"",seller_contact_phone:"",seller_bank_iban:"",seller_bank_bic:"",seller_bank_account_name:"",seller_electronic_address:""}),p=[{label:"EN 16931 (ZUGFeRD)",value:"en16931"}],f=[{value:"",label:u("None")},{value:"0002",label:"0002 — SIRENE (France)"},{value:"0009",label:"0009 — SIRET (France)"},{value:"0021",label:"0021 — SWIFT"},{value:"0060",label:"0060 — DUNS"},{value:"0088",label:"0088 — EAN / GS1 GLN"},{value:"0096",label:"0096 — Danish P number"},{value:"0130",label:"0130 — EU Directorates"},{value:"0183",label:"0183 — Swiss UID"},{value:"0184",label:"0184 — Danish CVR"},{value:"0190",label:"0190 — Dutch OIN"},{value:"0191",label:"0191 — Dutch KvK"},{value:"0192",label:"0192 — Dutch Organisation ID"},{value:"0195",label:"0195 — Singapore UEN"},{value:"0196",label:"0196 — Icelandic kennitala"},{value:"0198",label:"0198 — Danish SE"},{value:"0199",label:"0199 — LEI"},{value:"0200",label:"0200 — Lithuanian legal entity"},{value:"0204",label:"0204 — German Leitweg-ID"},{value:"0208",label:"0208 — Belgian CBE / KBO"},{value:"0210",label:"0210 — Italian Codice Fiscale"},{value:"0211",label:"0211 — Italian Partita IVA"},{value:"0213",label:"0213 — Finnish OVT"}];ws().onSave(()=>{y()});const g=()=>{t.value=!0,Ae.get("settings/pdf-templates/seller-details").then(v=>{v.seller_details&&Object.keys(c.value).forEach(w=>{v.seller_details[w]!==void 0&&(c.value[w]=v.seller_details[w])}),s.value=v.store_country_set!==!1,i.value=v.store_settings_url||""}).catch(v=>{var w;q.error(((w=v.data)==null?void 0:w.message)||u("Failed to load settings"))}).finally(()=>{t.value=!1})},y=()=>{a.value=!0,l.value={},Ae.post("settings/pdf-templates/seller-details",c.value).then(v=>{q.success(v.message||u("Settings saved"))}).catch(v=>{var w,k;v.status_code===422&&((w=v.data)!=null&&w.data)&&(l.value=v.data.data),q.error(((k=v.data)==null?void 0:k.message)||u("Failed to save settings"))}).finally(()=>{a.value=!1})};return Ie(()=>{g()}),(v,w)=>{const k=C("el-skeleton-item"),b=C("el-skeleton"),S=C("el-switch"),$=C("el-option"),D=C("el-select"),F=C("el-form-item"),B=C("el-col"),U=C("el-row"),Q=C("el-input"),V=C("el-divider"),I=C("el-button");return r(),h("div",ug,[n(Ua,{heading:A(u)("E-Invoice Settings"),loading:a.value,onOnSave:y},null,8,["heading","loading"]),o("div",cg,[n(Ia),t.value?(r(),E(Se,{key:0},{default:d(()=>[n(ke,null,{default:d(()=>[n(b,{animated:""},{template:d(()=>[o("div",Ag,[n(k,{variant:"p",class:"w-[20%]"}),n(k,{variant:"p"})]),o("div",pg,[n(k,{variant:"p",class:"w-[20%]"}),n(k,{variant:"p"})]),o("div",fg,[n(k,{variant:"p",class:"w-[20%]"}),n(k,{variant:"p"})]),o("div",mg,[n(k,{variant:"p",class:"w-[20%]"}),n(k,{variant:"p"})])]),_:1})]),_:1})]),_:1})):x("",!0),t.value?x("",!0):(r(),h(P,{key:1},[c.value.zugferd_enabled==="1"&&!s.value?(r(),h("div",hg,[o("strong",null,m(A(u)("Store country is not configured.")),1),R(" "+m(A(u)("ZUGFeRD XML cannot be embedded in PDFs until your store country is set."))+" ",1),i.value?(r(),h("a",{key:0,href:i.value,class:"underline ml-1"},m(A(u)("Go to Store Settings")),9,_g)):x("",!0)])):x("",!0),n(Se,null,{default:d(()=>[n(Ve,{title:A(u)("E-Invoice Configuration"),text:A(u)("Configure ZUGFeRD / Factur-X e-invoice encoding and seller details for your PDFs."),border_bottom:""},{action:d(()=>[n(S,{modelValue:c.value.zugferd_enabled,"onUpdate:modelValue":w[0]||(w[0]=M=>c.value.zugferd_enabled=M),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1},8,["title","text"]),n(ke,null,{default:d(()=>[n(U,{gutter:15},{default:d(()=>[n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("ZUGFeRD Profile"),"label-position":"top"},{default:d(()=>[n(D,{modelValue:c.value.zugferd_profile,"onUpdate:modelValue":w[1]||(w[1]=M=>c.value.zugferd_profile=M)},{default:d(()=>[(r(),h(P,null,te(p,M=>n($,{key:M.value,label:M.label,value:M.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),o("div",vg,[o("p",null,m(A(u)("Select the e-invoice formatter used when generating the embedded XML.")),1)])]),_:1},8,["label"])]),_:1}),n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Legal Registration Scheme"),"label-position":"top"},{default:d(()=>[n(D,{modelValue:c.value.seller_legal_registration_scheme,"onUpdate:modelValue":w[2]||(w[2]=M=>c.value.seller_legal_registration_scheme=M),placeholder:A(u)("Select scheme"),clearable:"",filterable:""},{default:d(()=>[(r(),h(P,null,te(f,M=>n($,{key:M.value,label:M.label,value:M.value},null,8,["label","value"])),64))]),_:1},8,["modelValue","placeholder"]),o("div",gg,[o("p",null,m(A(u)("ISO 6523 ICD code for the legal registration identifier")),1)]),n(_l,{"validation-errors":l.value.seller_legal_registration_scheme||{},"field-key":"seller_legal_registration_scheme"},null,8,["validation-errors"])]),_:1},8,["label"])]),_:1})]),_:1}),n(xo,{type:"info",closable:!1,"show-icon":"",class:"mb-4"},{default:d(()=>[R(m(A(u)("Company Name, VAT ID, Tax ID, and Legal Registration ID are managed in"))+" ",1),i.value?(r(),h("a",{key:0,href:i.value,target:"_blank",class:""},m(A(u)("Store Settings → Business Details")),9,yg)):x("",!0)]),_:1}),o("h4",bg,m(A(u)("Seller Contact")),1),n(U,{gutter:15},{default:d(()=>[n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Contact Name"),"label-position":"top"},{default:d(()=>[n(Q,{modelValue:c.value.seller_contact_name,"onUpdate:modelValue":w[3]||(w[3]=M=>c.value.seller_contact_name=M)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Contact Email"),"label-position":"top"},{default:d(()=>[n(Q,{modelValue:c.value.seller_contact_email,"onUpdate:modelValue":w[4]||(w[4]=M=>c.value.seller_contact_email=M),type:"email"},null,8,["modelValue"]),n(_l,{"validation-errors":l.value.seller_contact_email||{},"field-key":"seller_contact_email"},null,8,["validation-errors"])]),_:1},8,["label"])]),_:1})]),_:1}),n(U,{gutter:15},{default:d(()=>[n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Contact Phone"),"label-position":"top"},{default:d(()=>[n(Q,{modelValue:c.value.seller_contact_phone,"onUpdate:modelValue":w[5]||(w[5]=M=>c.value.seller_contact_phone=M)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})]),_:1}),n(V),o("h4",wg,m(A(u)("Seller Bank Details")),1),n(U,{gutter:15},{default:d(()=>[n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Bank IBAN"),"label-position":"top"},{default:d(()=>[n(Q,{modelValue:c.value.seller_bank_iban,"onUpdate:modelValue":w[6]||(w[6]=M=>c.value.seller_bank_iban=M)},null,8,["modelValue"]),n(_l,{"validation-errors":l.value.seller_bank_iban||{},"field-key":"seller_bank_iban"},null,8,["validation-errors"]),o("div",Cg,[o("p",null,m(A(u)("International Bank Account Number")),1)])]),_:1},8,["label"])]),_:1}),n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Bank BIC"),"label-position":"top"},{default:d(()=>[n(Q,{modelValue:c.value.seller_bank_bic,"onUpdate:modelValue":w[7]||(w[7]=M=>c.value.seller_bank_bic=M)},null,8,["modelValue"]),o("div",kg,[o("p",null,m(A(u)("Bank Identifier Code (SWIFT)")),1)])]),_:1},8,["label"])]),_:1})]),_:1}),n(U,{gutter:15},{default:d(()=>[n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Bank Account Name"),"label-position":"top"},{default:d(()=>[n(Q,{modelValue:c.value.seller_bank_account_name,"onUpdate:modelValue":w[8]||(w[8]=M=>c.value.seller_bank_account_name=M)},null,8,["modelValue"]),o("div",Bg,[o("p",null,m(A(u)("Name of the bank account holder")),1)])]),_:1},8,["label"])]),_:1}),n(B,{lg:12},{default:d(()=>[n(F,{label:A(u)("Electronic Address"),"label-position":"top"},{default:d(()=>[n(Q,{modelValue:c.value.seller_electronic_address,"onUpdate:modelValue":w[9]||(w[9]=M=>c.value.seller_electronic_address=M)},null,8,["modelValue"]),o("div",xg,[o("p",null,m(A(u)("Electronic address for receiving e-invoices (e.g. PEPPOL ID)")),1)])]),_:1},8,["label"])]),_:1})]),_:1})]),_:1})]),_:1}),o("div",Sg,[n(I,{type:"primary",onClick:w[10]||(w[10]=M=>y()),loading:a.value},{default:d(()=>[R(m(A(u)("Save Settings")),1)]),_:1},8,["loading"])])],64))])])}}},$g={name:"CustomersRoute"},Eg={class:"fca_customers_route"};function Ug(e,t,a,l,s,i){const c=C("router-view");return r(),h("div",Eg,[n(c)])}const Ig=nt($g,[["render",Ug]]);/*!
2 2 * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
3 3 * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
4 4 * Released under MIT License
5 5 *//*! *****************************************************************************
@@ -102,9 +102,9 @@
102 102 <span style="color: ${I};">${Q.seriesName}</span>
103 103 <span style="float: right; margin-left: 20px; color: ${I};">
104 104 ${V}
105 105 </span>
106 - </div>`}),U}},xAxis:{type:"category",data:v.value,axisLabel:{color:p.value?"#ffffff":"#696778",fontSize:12,interval:b.value.interval},axisLine:{lineStyle:{type:"dashed",color:p.value?"#253241":"#D6DAE1"}}},yAxis:[{name:kl("Revenue","Chart axis title"),type:"value",position:"left",axisLabel:{color:p.value?"#ffffff":"#696778",fontSize:12,formatter:B=>`${ft.scaledChart(B)}`},splitLine:{show:!0,lineStyle:{color:p.value?"#253241":"#D6DAE1",type:"dashed"}}},{name:kl("Orders","Chart axis title"),type:"value",position:"right",axisLabel:{color:p.value?"#ffffff":"#696778",fontSize:12},splitLine:{show:!1,lineStyle:{color:p.value?"#253241":"#D6DAE1",type:"dashed"}}}],series:y.value};w.setOption(F,{notMerge:!0,replaceMerge:["series"]})},$=(F,B,U,Q,V)=>({name:F,type:B,barMaxWidth:30,data:U,smooth:!1,color:Q,lineStyle:{width:3},areaStyle:{opacity:.3,color:Q},symbol:"circle",showSymbol:!0,symbolSize:8,itemStyle:{color:Q,borderRadius:[4,4,0,0]},yAxisIndex:V,emphasis:{scale:2,itemStyle:{color:ja(Q)},lineStyle:{color:Q},areaStyle:{opacity:.3,color:Q}},animation:!0,animationEasing:"cubicOut",animationDuration:800,animationDelay:0,barGap:"-100%",legendHoverLink:!1}),D=F=>{i.value!==F&&(i.value=F,ba.onChange("order","sales_growth_chart",F),S())};return be([()=>a.chartData,i],()=>{xe(S)},{deep:!0}),be(f,F=>{F||k()}),be(()=>a.loading,F=>{F||k()}),Bt(()=>{window.removeEventListener("onFluentCartThemeChange",S,!1),window.removeEventListener("fluentCartCurrencyChange",S,!1)}),Ie(()=>{window.addEventListener("onFluentCartThemeChange",S),window.addEventListener("fluentCartCurrencyChange",S),xe(k)}),(F,B)=>{const U=C("el-skeleton");return r(),h("div",iC,[n(Se,{id:"chartContainer",ref_key:"cardRef",ref:s},{default:d(()=>[n(Ve,{title:F.$t("Sales Growth"),border_bottom:""},oa({_:2},[!f.value&&!e.loading?{name:"action",fn:d(()=>[o("div",rC,[n(Gl,{activeType:i.value,types:{bar:"BarChart",line:"LineChart"},onChange:D},null,8,["activeType"]),n(Sa,{targetRef:l.value},null,8,["targetRef"])])]),key:"0"}:void 0]),1032,["title"]),n(ke,{class:"p-0"},{default:d(()=>[e.loading?(r(),E(U,{key:0,animated:"",rows:5,class:"p-4"})):(r(),h(P,{key:1},[f.value?(r(),E(Ct,{key:1,icon:"Empty/ListView","has-dark":!0,text:A(u)("Currently there is no data!"),class:"fct-report-empty-state"},null,8,["text"])):(r(),h("div",{key:0,class:"fct-chart-wrap fct-gross-sale-vs-net-revenue-chart",ref_key:"chartRef",ref:l},null,512))],64))]),_:1})]),_:1},512)])}}},uC={class:"fct-gross-sale-vs-net-revenue-wrap"},cC={class:"fct-btn-group sm"},AC={key:0,class:"fct-world-map-action-btns absolute top-5 right-5 flex flex-col gap-1 z-10"},pC={key:1,class:"fct-world-map-action-btns absolute top-[10px] right-[40px] flex flex-col gap-1 z-10"},ju=.5,Zi=6,vo=1.2,fC={__name:"HeatMap",props:{data:{type:Array,required:!0}},setup(e){const t=e,a=Te.colors,l=T(null),s=T(null),i=T(!1),c=T("world"),p=T(92),f=T(100);T(!1);let _=null,g=null,y=50;const v=T(1.2),w=T(),k=a.blue,b=K(()=>{const ue=f.value-p.value,ie=t.data?t.data.length:0;return ue<60||ie<15}),S=ue=>{ue=ue.replace(/^#/,"");const ie=parseInt(ue.substring(0,2),16),J=parseInt(ue.substring(2,4),16),N=parseInt(ue.substring(4,6),16);return[ie,J,N]},$=()=>Te.isDark()?a.gray[50]:a.gray[600],D=S(k[500]),F=async()=>{const ue=gs.getUrl("world.geo.json"),J=await(await fetch(ue)).json();wm("world",J)},B=ue=>{if(!ue||isNaN(ue))return`rgba(${D.join(",")}, 0)`;const ie=Math.log(ue+1)/Math.log(y+1);return`rgba(${D.join(",")}, ${ie})`},U=ue=>{c.value=ue,W(),_&&(_.clear(),_.setOption(H()),ue==="bar"&&Q()),g&&i.value&&(g.clear(),g.setOption(H()),ue==="bar"&&V())},Q=()=>{_&&(_.off("dataZoom"),_.on("dataZoom",function(ue){ue.batch&&ue.batch[0]?(p.value=ue.batch[0].start||0,f.value=ue.batch[0].end||100):(p.value=ue.start||0,f.value=ue.end||100),setTimeout(()=>{W()},100)}))},V=()=>{g&&(g.off("dataZoom"),g.on("dataZoom",function(ue){ue.batch&&ue.batch[0]?(p.value=ue.batch[0].start||0,f.value=ue.batch[0].end||100):(p.value=ue.start||0,f.value=ue.end||100),setTimeout(()=>{g&&g.setOption(H())},100)}))},I=K(()=>(t.data||[]).map(ue=>({...ue,value:ue.value||0,itemStyle:{color:B(ue.value||0)},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}))),M=()=>({backgroundColor:Te.isDark()?a.dark[700]:a.gray[25],tooltip:{trigger:"item",formatter:ue=>u("%1$s%2$s Orders: %3$s",ue.name,"<br>",ue.value||0),borderRadius:8,backgroundColor:Te.isDark()?"#38485a":"#ffffff",borderColor:Te.isDark()?"#4a5a6b":"#c0c4ca",borderWidth:1,textStyle:{color:Te.isDark()?"#ffffff":"#565865"}},visualMap:{min:0,max:y,left:i.value?"5%":"center",bottom:i.value?"center":"4%",text:[u("High"),u("Low")],orient:i.value?"vertical":"horizontal",calculable:!0,inRange:{color:[k[100],k[500]]},textStyle:{color:a.gray[800]}},series:[{name:"Orders",type:"map",map:"world",roam:w.value,zoom:v.value,label:{show:!1,emphasis:{show:!0,color:a.gray[1e3],fontWeight:"bold",textShadowColor:a.gray[50],textShadowBlur:3,textShadowOffsetX:0,textShadowOffsetY:0}},emphasis:{itemStyle:{areaColor:k[300],shadowBlur:10,shadowColor:a.gray[400]}},itemStyle:{borderColor:a.gray[200],borderWidth:.5},data:I.value}]}),O=K(()=>{const ue=t.data.length,ie=f.value-p.value,J=Math.ceil(ue*ie/100);let N=0;return J>100?N=9:J>50?N=4:J>30?N=2:J>20&&(N=1),N}),L=()=>{const ue=b.value;return{backgroundColor:Te.isDark()?a.dark[700]:a.gray[25],tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(ie){const J=ie[0];return`${J.name}<br/>${u("Orders")}: ${J.value||0}`},backgroundColor:Te.isDark()?"#38485a":"#ffffff",textStyle:{color:Te.isDark()?a.gray[25]:a.system.mid},borderColor:Te.isDark()?"#4a5a6b":"#c0c4ca",borderWidth:1},dataZoom:[{type:"inside",yAxisIndex:0,start:p.value,end:f.value},{type:"slider",yAxisIndex:0,start:p.value,end:f.value,width:25,top:10,right:10,textStyle:{color:$()},brushSelect:!1,showDetail:!1,disabled:!0}],grid:{left:ue?"10px":"0%",right:"15%",top:"10%",bottom:"15%",containLabel:!0},yAxis:{type:"category",axisTick:{show:ue},splitLine:{show:!1},axisLine:{show:ue,lineStyle:{color:$()}},axisLabel:{show:ue,interval:O.value,color:$(),fontSize:11},data:t.data.map(ie=>ie.name)},xAxis:{type:"value",axisLabel:{show:!0,color:$(),formatter:function(ie){return ie.toLocaleString()}},splitLine:{show:!0,lineStyle:{color:Te.isDark()?a.gray[600]:a.gray[200]}}},series:[{type:"bar",large:!0,itemStyle:{color:new mr(0,0,1,0,[{offset:0,color:k[400]},{offset:1,color:k[600]}]),borderRadius:[0,4,4,0]},emphasis:{itemStyle:{color:new mr(0,0,1,0,[{offset:0,color:k[500]},{offset:1,color:k[700]}])}},data:t.data.map(ie=>ie.value),label:{show:ue,formatter:"{c}",position:"right",color:$(),fontSize:10}}]}},H=()=>c.value==="bar"?L():M(),j=async()=>{await F(),l.value&&(_=na(l.value),_.setOption(H()),c.value==="bar"&&Q(),_.on("georoam",()=>{const ie=_.getOption().series[0].zoom;if(ie!==v.value)if(ie<vo||ie>Zi){const J=Math.max(vo,Math.min(Zi,ie));_.setOption({series:[{zoom:J}]},!1),v.value=J}else v.value=ie}))},W=()=>{t.data&&t.data.length>0?y=Math.max(...t.data.map(ue=>ue.value||0)):y=1,_&&_.setOption(H(),{notMerge:!0})},G=()=>{v.value=Math.min(v.value+ju,Zi),w.value=!0,_.setOption({series:[{zoom:v.value,roam:w.value}]})},Z=()=>{v.value=Math.max(v.value-ju,vo),w.value=!0,_.setOption({series:[{zoom:v.value,roam:w.value}]})},ne=()=>{c.value==="bar"?(p.value=92,f.value=100,_&&_.dispatchAction({type:"dataZoom",start:92,end:100})):(v.value=vo,w.value="move",_&&(_.clear(),_.setOption(H())))},ce=async()=>{i.value=!0,await xe(),g?g.clear():g=na(s.value),g.setOption(H()),c.value==="bar"&&V()},z=ue=>{$(),_&&_.setOption(H())};return Ie(()=>{window.addEventListener("onFluentCartThemeChange",z),w.value="move",xe(j)}),Bt(()=>{window.removeEventListener("onFluentCartThemeChange",z),_&&(_.dispose(),_=null),g&&(g.dispose(),g=null)}),be(()=>t.data,()=>W(),{deep:!0}),be(b,()=>{c.value==="bar"&&xe(()=>{W()})}),(ue,ie)=>(r(),h("div",uC,[n(Se,{id:"chartContainer",class:"mb-0"},{default:d(()=>[n(Ve,{title:ue.$t("Order Heat Map"),border_bottom:""},{action:d(()=>[o("div",cC,[n(Gl,{activeType:c.value,types:{world:"Globe",bar:"BarChart"},onChange:U},null,8,["activeType"]),n(Sa,{targetRef:l.value,size:"small"},null,8,["targetRef"])])]),_:1},8,["title"]),n(ke,{class:"p-0 pt-0 relative"},{default:d(()=>[c.value==="world"?(r(),h("div",AC,[n(at,{tag:"button",size:"small",onClick:G},{default:d(()=>[n(Y,{name:"Plus"})]),_:1}),n(at,{tag:"button",size:"small",onClick:Z},{default:d(()=>[n(Y,{name:"Minus"})]),_:1}),n(at,{tag:"button",size:"small",onClick:ne},{default:d(()=>[n(Y,{name:"Reload"})]),_:1}),n(at,{tag:"button",size:"small lg:hidden",onClick:ce},{default:d(()=>[n(Y,{name:"Eye"})]),_:1})])):x("",!0),c.value==="bar"?(r(),h("div",pC,[n(at,{tag:"button",size:"small",onClick:ne},{default:d(()=>[n(Y,{name:"Reload"})]),_:1})])):x("",!0),o("div",{class:"fct-chart-wrap rounded-[0px] bg-transparent",ref_key:"chartRef",ref:l},null,512)]),_:1})]),_:1}),n(A(Sm),{modelValue:i.value,"onUpdate:modelValue":ie[0]||(ie[0]=J=>i.value=J),title:ue.$t("Order Heat Map"),class:"country-heat-map-dialog"},{default:d(()=>[o("div",{class:"fct-chart-wrap",ref_key:"modalChartRef",ref:s},null,512)]),_:1},8,["modelValue","title"])]))}},mC=nt(fC,[["__scopeId","data-v-36a900c8"]]),hC={class:"fct-report-card"},_C={key:0,class:"fct-report-card-header"},vC={key:0,class:"flex items-center gap-2"},gC={class:"title"},yC={class:"actions"},bC={class:"fct-report-card-body flex h-full"},wC={class:"w-full"},Gn={__name:"ReportCard",props:{cardOptions:{type:Object,default:()=>({heading:"",linkButtonText:"",linkButtonUrl:"",headingIcon:{type:Boolean,default:!1}})}},setup(e){return(t,a)=>{const l=C("router-link");return r(),h("div",hC,[e.cardOptions.heading||e.cardOptions.linkButtonText?(r(),h("div",_C,[e.cardOptions.heading?(r(),h("div",vC,[e.cardOptions.headingIcon?(r(),E(at,{key:0,size:"x-small",bg:"danger",soft:""},{default:d(()=>[n(Y,{name:"FailedCircle"})]),_:1})):x("",!0),o("h4",gC,m(e.cardOptions.heading),1)])):x("",!0),o("div",yC,[e.cardOptions.linkButtonText?(r(),E(l,{key:0,to:`/${e.cardOptions.linkButtonUrl}`,class:"link"},{default:d(()=>[R(m(t.$t(e.cardOptions.linkButtonText)),1)]),_:1},8,["to"])):x("",!0),ga(t.$slots,"action")])])):x("",!0),o("div",bC,[o("div",wC,[ga(t.$slots,"default")])])])}}},CC={key:0,class:"fct-report-sold-product-list has-scroll"},kC={class:"list-left-content"},BC={class:"list-title"},xC={class:"list-title-inner"},SC={class:"list-id"},FC={class:"list-right-content"},$C=["innerHTML"],EC={class:"list-price"},UC={__name:"RecentOrders",setup(e){const t=rl.data;return(a,l)=>{const s=C("router-link");return r(),E(Gn,{class:"top-sold-products","card-options":{heading:A(u)("Recent Orders"),linkButtonText:A(u)("View All"),linkButtonUrl:"orders"}},{default:d(()=>{var i,c;return[((c=(i=A(t))==null?void 0:i.recentOrders)==null?void 0:c.length)>0?(r(),h("ul",CC,[(r(!0),h(P,null,te(A(t).recentOrders,p=>(r(),h("li",{key:p.id},[n(s,{class:"no-underline",to:{name:"view_order",params:{order_id:p.id}}},{default:d(()=>[o("div",kC,[o("div",BC,[o("div",xC,m(p.customer_name)+" #"+m(A(sa)(p.id)),1),o("div",SC,[n(Pa,{"date-time":p.created_at},null,8,["date-time"])])])]),o("div",FC,[o("div",{class:"list-value",innerHTML:A(ft).scaled(p.total_amount)},null,8,$C),o("div",EC,m(A(sa)(p.order_items_count))+" "+m(A(u)("Items")),1)])]),_:2},1032,["to"])]))),128))])):(r(),E(Ct,{key:1,icon:"Empty/ListView","has-dark":!0,text:A(u)("Currently there is no item!")},null,8,["text"]))]}),_:1},8,["card-options"])}}},IC={key:0},QC={key:1,class:"fc_dashboard_onboarding_wrap"},DC={class:"fc_dashboard_onboarding_title"},VC={class:"fc_dashboard_onboarding_lists"},TC=["href"],MC={class:"circle-shape"},LC={class:"fc_dashboard_onboarding_item__title"},RC={__name:"Onboarding",emits:["status"],setup(e,{emit:t}){const a=T(0),l=T(!1);Jt().ctx;const s=T([]),i=T(!0);T(localStorage.getItem("started_content_collapse")==="true"||!1),K(()=>{const _=Object.keys(s.value).length;return _?Math.round(a.value/_*100):0});const c=_=>_.hash_id?_.url+"#"+_.hash_id:_.url,p=oi("dashboardTogglePageNotification"),f=t;return Ie(async()=>{l.value=!0,Ae.get("dashboard").then(_=>{var y,v;s.value=_.data.steps,a.value=_.data.completed,i.value=Object.keys(s.value).length!==a.value,f("status",{completed:!i.value}),l.value=!1;let g=((y=s.value.page_setup)==null?void 0:y.completed)||!1;p&&p(!g,((v=s.value.page_setup)==null?void 0:v.url)||"")}).catch(_=>{l.value=!1})}),(_,g)=>{const y=C("el-skeleton"),v=C("Check"),w=C("el-icon");return i.value?(r(),h("div",IC,[l.value?(r(),E(y,{key:0,rows:3,animated:""})):(r(),h("div",QC,[o("h3",DC,m(_.$t("Getting Started")),1),o("div",VC,[(r(!0),h(P,null,te(s.value,(k,b)=>(r(),h("a",{key:b,href:c(k),class:de([k.completed===!0?"active":"","fc_dashboard_onboarding_item"])},[o("span",MC,[k.completed===!0?(r(),E(w,{key:0},{default:d(()=>[n(v)]),_:1})):x("",!0)]),o("div",LC,m(k.title),1)],10,TC))),128))])]))])):x("",!0)}}},OC={class:"fct-dashboard-recent-activities-wrap"},PC={class:"fct-dashboard-recent-activities__header"},HC={class:"fct-dashboard-recent-activities__header_title"},NC={class:"fct-dashboard-recent-activities__header_desc"},KC={key:0,class:"fct-dashboard-recent-activities__body"},GC={class:"content"},zC={class:"title"},jC=["onClick"],qC={class:"date"},YC=["innerHTML"],WC={class:"created_by"},JC={key:1,class:"fct-dashboard-recent-activities__empty"},XC={class:"fct-dashboard-recent-activities__empty_text"},ZC={__name:"RecentActivity",props:{activities:{type:Array,default:()=>[]},showManageActivity:{type:Boolean,default:!1}},emits:["reload"],setup(e,{emit:t}){const a=sl(),l=T([{label:kl("All","Activity filter button"),value:"all"},{label:kl("Today","Activity filter button"),value:"today"},{label:kl("Yesterday","Activity filter button"),value:"yesterday"},{label:kl("This Week","Activity filter button"),value:"this_week"}]),s=T("all"),i=()=>{switch(s.value){case"all":return kl("all","Activity filter, mid-sentence");case"today":return kl("today","Activity filter, mid-sentence");case"yesterday":return kl("yesterday","Activity filter, mid-sentence");case"this_week":return kl("this week","Activity filter, mid-sentence");default:return s.value}},c=()=>{i(),rl.getRecentActivities({groupKey:s.value})},p={Order:"orders/view",Payment:"orders/view",PayPal:"orders/view",Product:"products/view",Customer:"customers/view",Coupon:"coupons/view",Subscription:"subscriptions/view",Tax:"store/settings"},f={order:{name:"view_order",param:"order_id",permission:"orders/view"},payment:{name:"view_order",param:"order_id",permission:"orders/view"},product:{name:"view_product",param:"product_id",permission:"products/view"},customer:{name:"view_customer",param:"customer_id",permission:"customers/view"},coupon:{name:"view_coupon",param:"coupon_id",permission:"coupons/view"},subscription:{name:"view_subscription",param:"subscription_id",permission:"subscriptions/view"}},_=v=>{var b;let w=(b=v==null?void 0:v.module_name)==null?void 0:b.toLowerCase();const k=f[w];k&&v.module_id&&g(v)&&a.push({name:k.name,params:{[k.param]:v.module_id}})},g=v=>{if(!v.module_name)return!0;const w=dt.get(p,da.capitalize(v.module_name));return w?Vn.has(w):!1},y=K(()=>rl.data.recentActivities.filter(v=>g(v)));return Ie(()=>{c()}),(v,w)=>{const k=C("el-radio-button"),b=C("el-radio-group");return r(),h("div",OC,[o("div",PC,[o("h4",HC,m(A(u)("Recent Activities")),1),o("p",NC,[s.value==="all"?(r(),h(P,{key:0},[R(m(A(u)("%1$s new activities",A(sa)(y.value.length))),1)],64)):(r(),h(P,{key:1},[R(m(A(u)("%1$s new activities %2$s",A(sa)(y.value.length),i())),1)],64))]),n(b,{class:"fct-dashboard-recent-activities__header_filter",modelValue:s.value,"onUpdate:modelValue":w[0]||(w[0]=S=>s.value=S),onChange:c,size:"large"},{default:d(()=>[(r(!0),h(P,null,te(l.value,(S,$)=>(r(),E(k,{key:$,label:S.label,value:S.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),y.value.length?(r(),h("div",KC,[(r(!0),h(P,null,te(y.value,(S,$)=>{var D;return r(),h("div",{key:$,class:"fct-dashboard-recent-activities__item has-icon"},[w[1]||(w[1]=o("span",{class:"icon"},[o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{d:"M12.8499 9.92029L13.5711 10.3529C13.6156 10.3795 13.6524 10.4172 13.678 10.4623C13.7036 10.5075 13.717 10.5584 13.717 10.6103C13.717 10.6621 13.7036 10.7131 13.678 10.7582C13.6524 10.8033 13.6156 10.841 13.5711 10.8677L8.30911 14.0249C8.21579 14.081 8.10897 14.1106 8.00011 14.1106C7.89124 14.1106 7.78443 14.081 7.69111 14.0249L2.42911 10.8677C2.38462 10.841 2.34779 10.8033 2.32222 10.7582C2.29664 10.7131 2.2832 10.6621 2.2832 10.6103C2.2832 10.5584 2.29664 10.5075 2.32222 10.4623C2.34779 10.4172 2.38462 10.3795 2.42911 10.3529L3.15031 9.92029L8.00011 12.8303L12.8499 9.92029ZM12.8499 7.10029L13.5711 7.53289C13.6156 7.55952 13.6524 7.59723 13.678 7.64235C13.7036 7.68746 13.717 7.73843 13.717 7.79029C13.717 7.84214 13.7036 7.89311 13.678 7.93822C13.6524 7.98334 13.6156 8.02105 13.5711 8.04769L8.00011 11.3903L2.42911 8.04769C2.38462 8.02105 2.34779 7.98334 2.32222 7.93822C2.29664 7.89311 2.2832 7.84214 2.2832 7.79029C2.2832 7.73843 2.29664 7.68746 2.32222 7.64235C2.34779 7.59723 2.38462 7.55952 2.42911 7.53289L3.15031 7.10029L8.00011 10.0103L12.8499 7.10029ZM8.30851 1.58569L13.5711 4.74289C13.6156 4.76952 13.6524 4.80724 13.678 4.85235C13.7036 4.89746 13.717 4.94843 13.717 5.00029C13.717 5.05214 13.7036 5.10311 13.678 5.14822C13.6524 5.19334 13.6156 5.23105 13.5711 5.25769L8.00011 8.60029L2.42911 5.25769C2.38462 5.23105 2.34779 5.19334 2.32222 5.14822C2.29664 5.10311 2.2832 5.05214 2.2832 5.00029C2.2832 4.94843 2.29664 4.89746 2.32222 4.85235C2.34779 4.80724 2.38462 4.76952 2.42911 4.74289L7.69111 1.58569C7.78443 1.52962 7.89124 1.5 8.00011 1.5C8.10897 1.5 8.21579 1.52962 8.30911 1.58569H8.30851ZM8.00011 2.79949L4.33231 5.00029L8.00011 7.20109L11.6679 5.00029L8.00011 2.79949Z",fill:"#335CFF"})])],-1)),o("div",GC,[o("h3",zC,[f[(D=S.module_name)==null?void 0:D.toLowerCase()]?(r(),h("span",{key:0,onClick:F=>_(S),class:"cursor-pointer"},m(S.title||"--"),9,jC)):(r(),h(P,{key:1},[R(m(S.title||"--"),1)],64)),o("span",qC,[n(Pa,{"date-time":S.created_at},null,8,["date-time"])])]),o("p",{innerHTML:S.content,class:"description"},null,8,YC),o("span",WC,m(A(u)("By %s",S.created_by)),1)])])}),128))])):(r(),h("div",JC,[o("div",XC,m(A(u)("No activity found.")),1)]))])}}},e2="https://wordpress.org/support/plugin/fluent-cart/reviews/#new-post",Cp="fct_review_prompt_hidden",kp=()=>{try{return window.localStorage}catch{return null}},t2=(e=kp())=>{try{return!!e&&e.getItem(Cp)==="yes"}catch{return!1}},a2=(e=kp())=>{try{return e?(e.setItem(Cp,"yes"),!0):!1}catch{return!1}},l2=["aria-label"],s2={class:"fct-review-prompt__text"},qu="fct-review-prompt-title",n2={__name:"ReviewPrompt",setup(e){const t=T(t2()),a=()=>{t.value=!0,a2()};return(l,s)=>{const i=C("el-button");return t.value?x("",!0):(r(),h("div",{key:0,class:"fct-review-prompt",role:"region","aria-labelledby":qu},[o("button",{type:"button",class:"fct-review-prompt__close","aria-label":A(u)("Dismiss feedback request"),onClick:a},[n(Y,{name:"Cross"})],8,l2),o("h3",{id:qu,class:"fct-review-prompt__title"},m(A(u)("How's FluentCart working for you?")),1),o("p",s2,m(A(u)("A short review on WordPress.org helps other store owners decide, and tells us what to improve.")),1),n(i,{tag:"a",href:A(e2),target:"_blank",rel:"noopener noreferrer",onClick:a},{default:d(()=>[R(m(A(u)("Share your feedback"))+" ",1),n(Y,{name:"External",class:"ml-1.5 w-3.5 h-3.5"})]),_:1},8,["href"])]))}}},o2={class:"fc_dashboard_sidebar bg-white dark:bg-dark-700 p-5 rounded"},i2={__name:"SideBar",setup(e){const t=T(!1),a=l=>{t.value=!!l.completed};return(l,s)=>(r(),h("div",o2,[n(Ot,{permission:"is_super_admin"},{default:d(()=>[n(RC,{onStatus:a}),t.value?(r(),E(n2,{key:0})):x("",!0)]),_:1}),n(ZC,{onReload:s[0]||(s[0]=()=>{})})]))}},r2={class:"fct-product-create"},d2={class:"fct-product-step"},u2={class:"fct-product-item-selector"},c2=["onClick"],A2={class:"fct-product-item-selector-content"},p2={class:"fct-bundle-product-condition"},f2={class:"condition-text"},m2={class:"dialog-footer"},Ci={__name:"AddProductModal",props:{customModal:String},emits:["process_custom","update:createProductModal"],setup(e,{emit:t}){const a=e,l=t,s=sl(),i=ze.get("variation_types",{}),c=T({post_title:"",post_content:"",post_excerpt:"",post_date:new Date,post_status:"draft",detail:{fulfillment_type:"digital",variation_type:"simple",manage_stock:"0",manage_downloadable:"0",other_info:{use_pricing_table:"yes",group_pricing_by:"repeat_interval",active_editor:"wp-editor",sold_individually:"no"}}}),p=[{type:"physical",title:u("Physical Product"),icon:"Gift"},{type:"digital",title:u("Digital Product"),icon:"Code"}],f=T(!1),_=T(null),g=w=>{c.value.detail.fulfillment_type=w},y=()=>{f.value=!0,Ae.post("products",{...c.value}).then(w=>{if(q.success(w.message),a.customModal==="order_modal"){const k={id:w.data.product_variants.id,object_id:w.data.product_variants.post_id,variation_id:w.data.product_variants.id,item_name:w.data.product_variants.variation_title,item_price:w.data.product_variants.item_price,quantity:1,stock:100,object_type:w.data.product_details.fulfillment_type,item_total:w.data.product_variants.item_price,line_total:w.data.product_variants.item_price,tax_amount:0,discount_total:0};l("process_custom",k),l("update:createProductModal",!1)}else s.push({name:"product_edit",params:{product_id:w.data.ID}})}).catch(w=>{var k;w.status_code=="422"?q.validationErrors(w):q.error((k=w.data)==null?void 0:k.message)}).finally(()=>{f.value=!1})},v=w=>{w.stopPropagation(),w.preventDefault(),y()};return Ie(()=>{xe(()=>{setTimeout(()=>{var w;(w=_.value)==null||w.focus()},10)})}),(w,k)=>{const b=C("el-input"),S=C("el-form-item"),$=C("el-option"),D=C("el-select"),F=C("el-checkbox"),B=C("el-form"),U=C("el-button");return r(),h("div",r2,[o("div",d2,[n(B,{"label-position":"top",model:c.value,"require-asterisk-position":"right"},{default:d(()=>[n(S,{label:c.value.detail.other_info.is_bundle_product==="yes"?A(u)("Bundle Title"):A(u)("Product Title"),required:""},{default:d(()=>[n(b,{type:"text",modelValue:c.value.post_title,"onUpdate:modelValue":k[0]||(k[0]=Q=>c.value.post_title=Q),placeholder:c.value.detail.other_info.is_bundle_product==="yes"?A(u)("Bundle Title"):A(u)("Product Title"),minlength:"3",maxlength:"200","show-word-limit":"",autofocus:"",ref_key:"fcProductTitle",ref:_,onKeydown:xa(v,["enter"])},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),e.customModal!=="order_modal"?(r(),E(S,{key:0,label:A(u)("Variation Type")},{default:d(()=>[n(D,{modelValue:c.value.detail.variation_type,"onUpdate:modelValue":k[1]||(k[1]=Q=>c.value.detail.variation_type=Q),placeholder:A(u)("Select Variation Type"),class:"w-full"},{default:d(()=>[(r(!0),h(P,null,te(A(i),(Q,V)=>(r(),E($,{key:V,label:Q,value:V},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])):x("",!0),n(S,null,{default:d(()=>[o("ul",u2,[(r(),h(P,null,te(p,Q=>o("li",{key:Q.type,class:de({active:Q.type===c.value.detail.fulfillment_type}),onClick:V=>g(Q.type)},[o("div",A2,[n(Y,{name:Q.icon},null,8,["name"]),R(" "+m(Q.title),1)]),k[3]||(k[3]=o("div",{class:"fct-product-item-selector-dot-wrap"},[o("span",{class:"fct-product-item-selector-dot"})],-1))],10,c2)),64))])]),_:1}),n(S,null,{default:d(()=>[o("div",p2,[n(F,{modelValue:c.value.detail.other_info.is_bundle_product,"onUpdate:modelValue":k[2]||(k[2]=Q=>c.value.detail.other_info.is_bundle_product=Q),"true-value":"yes","false-value":"no"},{default:d(()=>[R(m(A(u)("Add as a Bundle")),1)]),_:1},8,["modelValue"]),o("span",f2,m(A(u)("Combine multiple items into one package")),1)])]),_:1})]),_:1},8,["model"])]),o("div",m2,[n(U,{disabled:!c.value.post_title||f.value,loading:f.value,onClick:y,type:"primary"},{default:d(()=>[R(m(f.value?A(u)("Creating"):A(u)("Add Product")),1)]),_:1},8,["disabled","loading"])])])}}};class yd{constructor(t=new Date){this.date=t}getHours(){return this.date.getHours()}static greeting(){const t=new yd().getHours();if(t>=5&&t<12)return u("Good morning");if(t>=12&&t<17)return u("Good afternoon");if(t>=17&&t<21)return u("Good evening");{const a=[u("Step into the moonlight!"),u("Evening vibes!"),u("The night's still young!")];return a[Math.floor(Math.random()*a.length)]}}}const h2={class:"fct-current-user-info-wrap"},_2={class:"fct-current-user-info-content"},v2={class:"image"},g2=["src","alt"],y2={class:"content"},b2={key:0,class:"fct-current-user-info-action"},w2={__name:"CurrentUserInfo",setup(e){const t=T(!1),a=T(ze.get("me")),l=()=>ze.get("shop.store_name"),s=ze.get("total_products_count");return(i,c)=>{const p=C("el-button"),f=C("el-dialog");return r(),h("div",h2,[o("div",_2,[o("div",v2,[o("img",{src:a.value.avatar,alt:a.value.full_name},null,8,g2)]),o("div",y2,[o("h4",null,m(A(yd).greeting())+" "+m(a.value.full_name)+" 👋🏻",1),o("p",null,m(A(u)("Welcome to %1$s",l())),1)])]),n(Ot,{permission:"products/create"},{default:d(()=>[A(s)==0?(r(),h("div",b2,[n(p,{onClick:c[0]||(c[0]=_=>t.value=!0),type:"primary"},{default:d(()=>[R(m(A(u)("Add Product")),1)]),_:1})])):x("",!0)]),_:1}),n(f,{"append-to-body":!0,modelValue:t.value,"onUpdate:modelValue":c[1]||(c[1]=_=>t.value=_),onClose:c[2]||(c[2]=_=>t.value=!1),title:A(u)("Add New Product")},{default:d(()=>[n(Ci)]),_:1},8,["modelValue","title"])])}}};class C2{constructor(){Pe(this,"operatorMap",{"!==":"matchNotEqual","!=":"matchNotEqual"});Pe(this,"defaultMatcherMethod",null)}getMatchingMethod(t){return t==="=="||t==="==="?"matchEqual":this.operatorMap.hasOwnProperty(t)?this.operatorMap[t]:this.defaultMatcherMethod}defaultMatcher(t,a,l){}matchEqual(t,a,l){return l==="==="?t===a:t==a}matchNotEqual(t,a,l){return l==="!=="?t!==a:t!=a}matchContains(t,a,l){return a instanceof String||Array.isArray(a)?a.includes(t):typeof a=="object"?a.hasOwnProperty(t):!1}matchIn(t,a,l){return this.matchContains(t,a,l)}matchNotIn(t,a,l){return!this.matchContains(t,a,l)}}class k2{constructor(){Pe(this,"modifierMap",{"+":"applyAddition","-":"applySubstruction"});Pe(this,"defaultModifierMethod",null)}getModificationMethod(t){return t==="=="||t==="==="?"matchEqual":this.modifierMap.hasOwnProperty(t)?this.modifierMap[t]:this.defaultModifierMethod}applyAddition(t,a,l,s,i){return t+a}}class B2{constructor(t,a){Pe(this,"value");Pe(this,"operator");this.value=t,this.operator=a}setOperator(t){return this.operator=t,this}setValue(t){return this.value=t,this}static make(t,a){return new this(t,a)}build(){return{operator:this.operator,value:this.value instanceof Or?this.value.setModifiers([]).build():this.value}}}class Or{constructor(t,a){Pe(this,"accessor");Pe(this,"modifiers");this.accessor=t,this.modifiers=[],this.setModifiers(a)}setAccessor(t){return this.accessor=t,this}addModifier(t){return this.modifiers.push(t),this}setModifiers(t){return this.modifiers=Array.isArray(t)?t:this.modifiers,this}static make(t,a){return new this(t,a)}build(){let t=[];return Array.isArray(this.modifiers)&&this.modifiers.length>0&&(t=this.modifiers.map(a=>a instanceof B2?a.build():a)),t.length>0?{accessor:this.accessor,modifiers:t}:{accessor:this.accessor}}}class Is{constructor(t,a,l,s,i){Pe(this,"conditionType");Pe(this,"conditions");Pe(this,"key");Pe(this,"operator");Pe(this,"value");this.key=t,this.value=a,this.operator=l,this.conditions=[],this.conditionType=this.buildConditionType(s),this.setConditions(i)}static make(t,a,l,s){return new this(t,a,l,s)}setConditionType(t){return this.conditionType=this.buildConditionType(t),this}buildConditionType(t){return t==="or"||t==="|"?"or":"and"}setOperator(t){return this.operator=t,this}setKey(t){return this.key=t,this}setValue(t){return this.value=t,this}addCondition(t){return this.conditions.push(t),this}setConditions(t){return this.conditions=Array.isArray(t)||t instanceof Is||typeof t=="function"?t:this.conditions,this}build(){if(Array.isArray(this.conditions)&&this.conditions.length>0){let l=[];return l=this.conditions.map(s=>s instanceof Is?s.build.bind(s)():s),{condition_type:this.conditionType,conditions:l}}const t=this.key instanceof Or?this.key.build():this.key,a=this.value instanceof Or?this.value.build():this.value;return{key:t,operator:this.operator,value:a}}}class x2{constructor(t,a){Pe(this,"data");Pe(this,"conditions");Pe(this,"stateKey");Pe(this,"matcher");Pe(this,"modifier");this.data=a,this.stateKey=t,this.matcher=new C2,this.modifier=new k2}match(t,a,l,s=!0){let i="",c=this.matcher.getMatchingMethod(a);return c!=null?i=c:i=da.camel("match"+a),i in this.matcher&&typeof this.matcher[i]=="function"?this.matcher[i](t,l,a,s):s}evaluate(t,a="and"){if(t instanceof Is){const s=t.build.bind(t)();s.hasOwnProperty("conditions")?(t=s.conditions,a=s.condition_type):t=[s]}a=a==="or"?"or":"and";let l=a==="and";if(typeof t=="function")return t(this.stateKey,this.data);if(!Array.isArray(t))return!0;for(let s of t){let i=null;if(Array.isArray(dt.get(s,"conditions")))i=this.evaluate(s.conditions,dt.get(s,"condition_type","and"));else{if(s.key===null||s.key===void 0){l=!0;continue}i=this.applyCondition(s)}l=a==="and"?l&&i:l||i}return l}applyCondition(t){let a="",l=null;typeof t.key=="object"?a=dt.resolvePath(this.stateKey,dt.get(t,"key.accessor")):a=dt.resolvePath(this.stateKey,t.key);let s=dt.get(this.data,a);if(typeof t.value=="object"){const i=dt.resolvePath(this.stateKey,dt.get(t,"value.accessor"));l=dt.get(this.data,i)}else l=t.value;return s=this.applyModification(s,t.key.modifiers,this.stateKey),l=this.applyModification(l,t.value.modifiers,this.stateKey),this.match(s,t.operator,l)}applyModification(t,a,l){return Array.isArray(a)&&a.forEach(s=>{let i=s.operator,c="",p=this.modifier.getModificationMethod(i);if(p!=null?c=p:c=da.camel("apply"+i),c in this.modifier&&typeof this.modifier[c]=="function"){let f=s.value;typeof f=="object"&&f!==null&&(f=dt.getByPath(this.data,l,dt.get(f,"accessor"))),t=this.modifier[c](t,f,i,l,this.data)}}),t}}class Bp{constructor(){Pe(this,"_conditionType","and");Pe(this,"_conditions",null)}conditionType(t){return this._conditionType=t,this}conditions(t){return this._conditions=Array.isArray(t)||t instanceof Is||typeof t=="function"?t:this._conditions,this}visibleIf(t){return this._conditions=t,this}buildConditions(t){return Array.isArray(t)&&t.length>0?t.map(a=>a instanceof Is?a.build.bind(a)():a):t}}class xp{constructor(){Pe(this,"_events",{})}event(t,a){return this._events[t]=a,this}}class jo{constructor(t=""){this._component="",this._affix=t}static component(t){const a=new jo;return a._component="Affix/"+t,a}static make(t=""){return new this(t)}build(){return this._component.length>0?{component:this._component}:this._affix}}class Pr{constructor(t,a="input"){if(typeof t!="string"||t.length<1)throw new Error("Key is Required");this._key=t,this._type=a,this._class="",this._id="",this._name="",this._label="",this._value="",this._placeholder="",this._min="",this._max="",this._prefix="",this._hasPrefix=!1,this._hasSuffix=!1,this._suffix="",ms.install(this,vA),ms.install(this,xp),ms.install(this,Bp),this._wrapperClass=""}static make(t,a="input"){return new this(t,a)}wrapperClass(t){return this._wrapperClass=t,this}type(t){return this._type=t,this}class(t){return this._class=t,this}id(t){return this._id=t,this}name(t){return this._name=t,this}label(t){return this._label=t,this}value(t){return this._value=t,this}placeholder(t){return this._placeholder=t,this}min(t){return this._min=t,this}max(t){return this._max=t,this}prefix(t){return this._hasPrefix=!0,this._prefix=t,this}suffix(t){this._hasSuffix=!0,this._suffix=t}onChange(t){return this._onChangeCallback=t,this}onKeyPress(t){return this._onKeyPressCallback=t,this}onKeyUp(t){return this._onKeyUpCallback=t,this}onKeyDown(t){return this._onKeyDownCallback=t,this}build(){return this._conditions,Array.isArray(this._conditions)&&this._conditions.length>0&&this._conditions.map(t=>t instanceof Is?t.build.bind(t)():t),this._attributes=typeof this._attributes=="object"?this._attributes:{},this._attributes.min=this._min,this._attributes.max=this._max,this._attributes.placeholder=this._placeholder,this._attributes.type=this._type,{key:this._key,type:this._type,class:this._class,id:this._id,name:this._name??u(da.headline(this._key)),label:this._label??u(da.headline(this._key)),value:this._value,condition_type:this._conditionType,conditions:this.buildConditions(this._conditions),hasSuffix:this._hasSuffix,hasPrefix:this._hasPrefix,suffix:this._suffix instanceof jo?this._suffix.build():this._suffix,prefix:this._prefix instanceof jo?this._prefix.build():this._prefix,min:this._min,max:this._max,placeholder:this._placeholder,attributes:this._attributes,events:this._events,wrapperClass:this._wrapperClass}}}class Hr{constructor(t){if(typeof t!="string"||t.length<1)throw new Error("Key is Required");this._type="section",this._key=t,this._schema=[],this._class="",this.disable_nesting=!0,ms.install(this,vA),ms.install(this,xp),ms.install(this,Bp)}static make(t){return new this(t)}enableNesting(){return this.disable_nesting=!1,this}disableNesting(){return this.disable_nesting=!0,this}class(t){return this._class=t,this}get type(){return this._type}set type(t){if(typeof t=="string")this._type=t;else throw new TypeError("Type must be a string.")}get schema(){return this._schema}setSchema(t){return this._schema=t,this}build(){const t=rn.build(this.schema);return{key:this._key,type:this._type,class:this._class,schema:t,disable_nesting:this.disable_nesting,condition_type:this._conditionType,conditions:this.buildConditions(this._conditions),attributes:this._attributes}}}class Yu{constructor(t,a){if(typeof t!="string"||t.length<1)throw new Error("Key is Required");ms.install(this,Pr,{key:t}),ms.install(this,Hr,{key:t}),this._component=a,this._key=t}static make(t,a=""){return new this(t,a)}component(t){return this._component=t,this}value(t){return this._value=t,this}build(){const t=rn.build(this.schema??{});return{type:this._type,class:this._class,id:this._id,name:this._name??u(da.headline(this._key)),label:this._label??u(da.headline(this._key)),value:this._value,condition_type:this._conditionType,conditions:this.buildConditions(this._conditions),hasSuffix:this._hasSuffix,hasPrefix:this._hasPrefix,suffix:this._suffix,prefix:this._prefix,placeholder:this._placeholder,attributes:this._attributes,onChange:this._onChangeCallback,onKeyUp:this._onKeyUpCallback,onKeyDown:this._onKeyDownCallback,type:this._type,class:this._class,schema:t,disable_nesting:this.disable_nesting,condition_type:this._conditionType,conditions:this.buildConditions(this._conditions),type:"custom",component:this._component,key:this._key}}}class rn{static build(t){return Array.isArray(t)?rn.buildFromArray(t):typeof t=="object"?rn.buildFromObject(t):t}static buildFromObject(t){let a={};return Object.keys(t).forEach((l,s)=>{const i=t[l];i instanceof Pr||i instanceof Hr||i instanceof Yu?a[l]=i.build.bind(i)():a[l]=t[l]}),a}static buildFromArray(t){let a={};return Array.isArray(t)&&t.forEach(l=>{if(l instanceof Pr||l instanceof Hr||l instanceof Yu){let s=l.build.bind(l)();a[s.key]=s}else a[l.key]=l}),a}}class S2 extends tl{constructor(){super(...arguments);Pe(this,"data",{schema:{},defaults:{},_originalDefaults:{},values:{},initialized:!1,hasChange:!1,validationErrors:{},onChangeCallback:[]});Pe(this,"nestedFormLayouts",["section","tab","tab-pane","grid"]);Pe(this,"ignorableFormLayouts",["grid"])}get hasChange(){return this.data.hasChange}setSchema(a){return this.data.schema=rn.build(a??{}),this.initForm(),this}setDefaults(a){return this.data.defaults=a||{},this.data._originalDefaults=JSON.parse(JSON.stringify(this.data.defaults)),this.initForm(),this}get schema(){return this.data.schema}get values(){return this.data.values}get isReady(){return this.data.initialized}initForm(){if(typeof this.data.schema!="object"||typeof this.data.defaults!="object")throw new Error("You need to set Schema and Defaults First");this.setValues(),this.data.initialized=!0}setValues(){this.data.values=this.ensureNestedDataProperties(this.data.schema,this.data.defaults)}getState(){return this.data.values}setValidationErrors(a){this.data.validationErrors=a||{}}hasValidationError(a){return(this.data.validationErrors??{}).hasOwnProperty(a)}getValidationError(a){return this.data.validationErrors[a]}ensureNestedDataProperties(a,l={}){return Object.keys(a).reduce((s,i)=>{const c=a[i];if(c.type==="html")return s;if(this.nestedFormLayouts.includes(c.type??""))if(c.disable_nesting===!0){const p=this.ensureNestedDataProperties(c.schema??{},l??{});s={...s,...p}}else s[i]=this.ensureNestedDataProperties(c.schema??{},l[i]??{});else s[i]=l[i]??c.value??"";return s},{})}isVisible(a,l){return a.hasOwnProperty("conditions")?new x2(l,this.values).evaluate(dt.get(a,"conditions"),dt.get(a,"condition_type","and")):!0}triggerChange(a){for(let l of this.data.onChangeCallback)l(a)}onDataChanged(a){this.data.onChangeCallback.push(a)}setValue(a,l){dt.set(this.data.values,a,l),this.data.hasChange=!0,this.triggerChange(this.data.values)}reset(a=!0){if(!this.data.schema||!this.data._originalDefaults)throw new Error("Form is not initialized");const l=a?this.data._originalDefaults:this.data.defaults;return this.data.values=this.ensureNestedDataProperties(this.data.schema,JSON.parse(JSON.stringify(l))),this.data.validationErrors={},this.data.hasChange=!1,this.data.initialized=!0,this}}function bd(){return S2.init()}const F2=["innerHTML"],Nr={__name:"FieldNote",props:{note:String},setup(e){return(t,a)=>(r(),h("div",{class:"form-note",innerHTML:e.note},null,8,F2))}},$2=Object.freeze(Object.defineProperty({__proto__:null,default:Nr},Symbol.toStringTag,{value:"Module"})),Wu=Object.assign({name:"ValidationError"},{__name:"ValidationErrorNew",props:{errorKey:String,form:{type:Object,required:!0}},setup(e){return(t,a)=>e.form.hasValidationError(e.errorKey)?(r(),h("div",{key:0,class:de(`fluent-cart-admin-validation-error-wrapper ${e.errorKey}`)},[(r(!0),h(P,null,te(e.form.getValidationError(e.errorKey),(l,s)=>(r(),h("span",{class:"fluent-cart-admin-validation-error",key:l.toLowerCase().replace(/\s/g,"")},m(l),1))),128))],2)):x("",!0)}}),Sp={__name:"Resolver",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},label:{type:String},attribute:{type:Object},callback:{type:Function}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue"),a=Object.assign({"./Affix/Test.vue":()=>Yt(()=>import("./chunks/Test.js?ver=1.6.6"),[],import.meta.url),"./Base/Inputs/Checkbox.vue":()=>Yt(()=>Promise.resolve().then(()=>H2),void 0,import.meta.url),"./Base/Inputs/ColorPicker.vue":()=>Yt(()=>Promise.resolve().then(()=>ak),void 0,import.meta.url),"./Base/Inputs/Date.vue":()=>Yt(()=>Promise.resolve().then(()=>lk),void 0,import.meta.url),"./Base/Inputs/FieldNote.vue":()=>Yt(()=>Promise.resolve().then(()=>$2),void 0,import.meta.url),"./Base/Inputs/Input.vue":()=>Yt(()=>Promise.resolve().then(()=>z2),void 0,import.meta.url),"./Base/Inputs/Media.vue":()=>Yt(()=>Promise.resolve().then(()=>Fk),void 0,import.meta.url),"./Base/Inputs/RadioGroup.vue":()=>Yt(()=>Promise.resolve().then(()=>K2),void 0,import.meta.url),"./Base/Inputs/RemoteSearchableSelect.vue":()=>Yt(()=>Promise.resolve().then(()=>ik),void 0,import.meta.url),"./Base/Inputs/Select.vue":()=>Yt(()=>Promise.resolve().then(()=>ok),void 0,import.meta.url),"./Base/Inputs/Switch.vue":()=>Yt(()=>Promise.resolve().then(()=>P2),void 0,import.meta.url),"./Base/Inputs/Time.vue":()=>Yt(()=>Promise.resolve().then(()=>sk),void 0,import.meta.url),"./Base/Layouts/FormGrid.vue":()=>Yt(()=>Promise.resolve().then(()=>U2),void 0,import.meta.url),"./Base/Layouts/FormSection.vue":()=>Yt(()=>Promise.resolve().then(()=>M2),void 0,import.meta.url),"./Base/Layouts/FormTab.vue":()=>Yt(()=>Promise.resolve().then(()=>L2),void 0,import.meta.url),"./Base/Layouts/FormTabPane.vue":()=>Yt(()=>Promise.resolve().then(()=>R2),void 0,import.meta.url),"./Coupon/BuyProducts.vue":()=>Yt(()=>import("./chunks/BuyProducts.js?ver=1.6.6"),[],import.meta.url),"./Coupon/Categories.vue":()=>Yt(()=>import("./chunks/Categories.js?ver=1.6.6"),[],import.meta.url),"./Coupon/Code.vue":()=>Yt(()=>import("./chunks/Code.js?ver=1.6.6"),[],import.meta.url),"./Coupon/GetProducts.vue":()=>Yt(()=>import("./chunks/GetProducts.js?ver=1.6.6"),[],import.meta.url),"./Coupon/IncludeExclude/Categories.vue":()=>Yt(()=>import("./chunks/Categories2.js?ver=1.6.6"),[],import.meta.url),"./Coupon/IncludeExclude/Product.vue":()=>Yt(()=>import("./chunks/Product.js?ver=1.6.6"),[],import.meta.url),"./Coupon/Products.vue":()=>Yt(()=>import("./chunks/Products.js?ver=1.6.6"),[],import.meta.url),"./McpSettings.vue":()=>Yt(()=>import("./chunks/McpSettings.js?ver=1.6.6"),[],import.meta.url),"./ModuleSettings.vue":()=>Yt(()=>import("./chunks/ModuleSettings.js?ver=1.6.6"),[],import.meta.url),"./PaymentView.vue":()=>Yt(()=>import("./chunks/PaymentView.js?ver=1.6.6"),[],import.meta.url),"./StoreSettings/AddressComponent.vue":()=>Yt(()=>import("./chunks/AddressComponent.js?ver=1.6.6"),[],import.meta.url),"./StoreSettings/AppearanceComponent.vue":()=>Yt(()=>import("./chunks/AppearanceComponent.js?ver=1.6.6"),[],import.meta.url),"./StoreSettings/AppearancePreview.vue":()=>Yt(()=>import("./chunks/AppearancePreview.js?ver=1.6.6"),[],import.meta.url),"./StoreSettings/CreatePageButton.vue":()=>Yt(()=>import("./chunks/CreatePageButton.js?ver=1.6.6"),[],import.meta.url),"./StoreSettings/PageSelector.vue":()=>Yt(()=>import("./chunks/PageSelector.js?ver=1.6.6"),[],import.meta.url),"./StoreSettings/SubscriptionModeManager.vue":()=>Yt(()=>import("./chunks/SubscriptionModeManager.js?ver=1.6.6"),[],import.meta.url),"./TurnstileSettings.vue":()=>Yt(()=>import("./chunks/TurnstileSettings.js?ver=1.6.6"),[],import.meta.url)}),l=yn(null);Ie(()=>{s(i.name)});const s=async c=>{const p=`./${c}.vue`;a[p]&&(l.value=(await a[p]()).default)},i=e;return(c,p)=>(r(),h(P,null,[(r(),E(gl(l.value),va({name:e.name,field:e.field,fieldKey:e.fieldKey,value:e.value,variant:e.variant,nesting:e.nesting,statePath:e.statePath,form:e.form,attribute:e.attribute,label:e.label,callback:e.callback},{modelValue:t.value,"onUpdate:modelValue":p[0]||(p[0]=f=>t.value=f)}),null,16,["modelValue"])),ga(c.$slots,"fieldNote"),ga(c.$slots,"validationError")],64))}},E2=["id"],wd={__name:"FormGrid",props:{field:{type:Object},fieldKey:{type:String},value:{type:Object},statePath:{type:String},form:{type:Object,required:!0}},setup(e){return(t,a)=>{var l,s,i,c,p,f,_,g,y,v;return r(),h("div",{class:"gap-2 grid grid-cols-dynamic sm:grid-cols-sm-dynamic md:grid-cols-md-dynamic lg:grid-cols-lg--dynamic",id:e.field.id||"",style:ra({"--grid-columns":((l=e.field.columns)==null?void 0:l.default)??2,"--sm-grid-columns":((s=e.field.columns)==null?void 0:s.sm)??((i=e.field.columns)==null?void 0:i.default)??2,"--md-grid-columns":((c=e.field.columns)==null?void 0:c.sm)??((p=e.field.columns)==null?void 0:p.md)??((f=e.field.columns)==null?void 0:f.default)??2,"--lg-grid-columns":((_=e.field.columns)==null?void 0:_.lg)??((g=e.field.columns)==null?void 0:g.md)??((y=e.field.columns)==null?void 0:y.sm)??((v=e.field.columns)==null?void 0:v.default)??2})},[n(xi,{form:e.form,schema:e.field.schema,value:e.value,statePath:e.statePath},null,8,["form","schema","value","statePath"])],12,E2)}}},U2=Object.freeze(Object.defineProperty({__proto__:null,default:wd},Symbol.toStringTag,{value:"Module"})),I2={key:0,class:"fct-content-card-header"},Q2={key:0,class:"title"},D2={key:1,class:"fct-content-card-action"},V2={__name:"ContentCard",props:["title","show_heading"],setup(e){return(t,a)=>(r(),h("div",{class:de({"fct-content-card":e.show_heading!==!1})},[e.show_heading!==!1?(r(),h("div",I2,[e.title||t.$slots.title?(r(),h("div",Q2,[ga(t.$slots,"title",{},()=>[R(m(e.title),1)])])):x("",!0),t.$slots.action?(r(),h("div",D2,[ga(t.$slots,"action")])):x("",!0)])):x("",!0),o("div",{class:de({"fct-content-card-body":e.show_heading!==!1})},[ga(t.$slots,"default")],2)],2))}},T2=["id"],Fp={__name:"FormSection",props:{field:{type:Object},fieldKey:{type:String},value:{type:Object},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0}},setup(e){return(t,a)=>(r(),h("div",{class:"form-section",id:e.field.id||""},[n(Se,null,{default:d(()=>[e.field.show_title!==!1?(r(),E(Ve,{key:0,title:e.field.title,border_bottom:""},null,8,["title"])):x("",!0),n(ke,null,{default:d(()=>[n(wd,{form:e.form,field:e.field,statePath:e.statePath,value:e.value},null,8,["form","field","statePath","value"])]),_:1})]),_:1})],8,T2))}},M2=Object.freeze(Object.defineProperty({__proto__:null,default:Fp},Symbol.toStringTag,{value:"Module"})),$p={__name:"FormTab",props:{field:{type:Object},value:{type:Object},statePath:{type:String},form:{type:Object,required:!0}},setup(e){const t=e,a=T(""),l=T([]),s=sl(),i=_=>{const g=_.props.name;c(g)},c=_=>{const g=new URL(window.location.href);g.hash=`#/settings/${_}`,window.history.replaceState(null,"",g.toString())},p=()=>{const g=window.location.hash.split("/").pop().split("#")[0];l.value=Object.keys(t.field.schema);const y=l.value.find(v=>v===g);y?a.value=y:a.value=t.field.default_tab};let f;return Ie(()=>{f=s.beforeEach((_,g,y)=>{y(),setTimeout(()=>{p()},200)}),p()}),Bt(()=>{f&&f()}),(_,g)=>{const y=C("el-tabs");return r(),E(y,{modelValue:a.value,"onUpdate:modelValue":g[0]||(g[0]=v=>a.value=v),class:de(["fct-tabs-button",{"hidden-switch":e.field.hide_tab_switch}]),onTabClick:i,type:"card"},{default:d(()=>[n(xi,{form:e.form,schema:e.field.schema,value:e.value,"state-path":e.statePath},null,8,["form","schema","value","state-path"])]),_:1},8,["modelValue","class"])}}},L2=Object.freeze(Object.defineProperty({__proto__:null,default:$p},Symbol.toStringTag,{value:"Module"})),Ep={__name:"FormTabPane",props:{fieldKey:{type:String},field:{type:Object},value:{type:Object},statePath:{type:String},form:{type:Object,required:!0}},setup(e){return(t,a)=>{const l=C("el-tab-pane");return r(),E(l,{label:e.field.title,name:e.fieldKey},{default:d(()=>[n(xi,{form:e.form,schema:e.field.schema,value:e.value,statePath:e.statePath},null,8,["form","schema","value","statePath"])]),_:1},8,["label","name"])}}},R2=Object.freeze(Object.defineProperty({__proto__:null,default:Ep},Symbol.toStringTag,{value:"Module"}));class Cd{}Pe(Cd,"attributesBuilders",async(t,a,l)=>{if(t.attributes||(t.attributes={}),t.class&&(t.attributes.class=t.class),t.placeholder&&(t.attributes.placeholder=t.placeholder),typeof a!="function")return t.attributes??{};let s={};typeof t.events!="object"&&(s={}),s.hasOwnProperty("onChange")&&typeof s.onChange=="function"?s.onChange=(...i)=>{l.data.hasChange=!0,s.onChange(i)}:s.onChange=()=>{l.data.hasChange=!0};for(let i in t.events)s[i]=(...c)=>{a(t.events[i],c)};for(let i in t.attributes??{}){let c=t.attributes[i];typeof c=="function"&&await a(c,{})}return{...t.attributes??{},...s}});const O2={__name:"LayoutRenderer",props:{form:{type:Object,required:!0},field:{type:Object,required:!0},value:{type:Object,required:!0},statePath:{type:String,required:!0},fieldKey:{type:String,required:!0},fullStatePath:{type:String,required:!0}},setup(e){const t=e;Jt().ctx;const a=(i,c)=>{if(typeof i=="function")return i({data:t.value,form:t.form,statePath:t.statePath,field:t.field,event:Array.isArray(c)&&c.length===1?c[0]:c})},l=T(!1),s=T({});return Ie(async()=>{s.value=await Cd.attributesBuilders(t.field,a,t.form),l.value=!0}),(i,c)=>(r(),h(P,null,[e.field.type==="grid"&&typeof e.field.schema<"u"?(r(),E(wd,va({key:0,class:e.field.wrapperClass,form:e.form,field:e.field,value:e.value,fieldKey:e.fieldKey,statePath:e.fullStatePath},s.value),null,16,["class","form","field","value","fieldKey","statePath"])):x("",!0),e.field.type==="tab"&&typeof e.field.schema<"u"?(r(),E($p,va({key:1,form:e.form,field:e.field,value:e.value,statePath:e.fullStatePath},s.value),null,16,["form","field","value","statePath"])):x("",!0),e.field.type==="tab-pane"&&typeof e.field.schema<"u"&&typeof e.field.title<"u"?(r(),E(Ep,va({key:2,form:e.form,field:e.field,value:e.value,fieldKey:e.fieldKey,statePath:e.fullStatePath},s.value),null,16,["form","field","value","fieldKey","statePath"])):x("",!0),e.field.type==="section"?(r(),E(Fp,va({key:3,class:e.field.wrapperClass,form:e.form,statePath:e.field.disable_nesting===!0?e.fullStatePath:e.fieldKey+".",field:e.field,"field-key":e.fieldKey,value:e.field.disable_nesting===!0?e.value:e.value[e.fieldKey],nesting:e.field.disable_nesting===!0},s.value),null,16,["class","form","statePath","field","field-key","value","nesting"])):x("",!0)],64))}},Up={__name:"Switch",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue");return(a,l)=>{const s=C("el-switch");return r(),E(s,va({modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=i=>t.value=i),disabled:e.field.disabled},e.attribute),null,16,["modelValue","disabled"])}}},P2=Object.freeze(Object.defineProperty({__proto__:null,default:Up},Symbol.toStringTag,{value:"Module"})),Ip={__name:"Checkbox",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue");return(a,l)=>{const s=C("el-checkbox");return r(),E(s,va({modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=i=>t.value=i)},e.attribute,{"true-value":"yes","false-value":"no",disabled:e.field.disabled}),{default:d(()=>[R(m(e.label),1)]),_:1},16,["modelValue","disabled"])}}},H2=Object.freeze(Object.defineProperty({__proto__:null,default:Ip},Symbol.toStringTag,{value:"Module"})),N2=["innerHTML"],Qp={__name:"RadioGroup",props:bl({field:{type:Object},statePath:{type:String},value:{required:!0},form:{type:Object},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue"),a=e,l=T([]),s=async(i="")=>{if(typeof a.field.options=="function")return l.value=await a.field.options({data:a.value,form:a.form,statePath:a.statePath,search:i});if(Array.isArray(a.field.options))return l.value=[...a.field.options]};return Ie(async()=>{await s()}),(i,c)=>{const p=C("el-radio"),f=C("el-radio-group");return r(),E(f,va({modelValue:t.value,"onUpdate:modelValue":c[0]||(c[0]=_=>t.value=_)},e.attribute,{class:"inline-flex items-center gap-4"}),{default:d(()=>[(r(!0),h(P,null,te(e.field.options,(_,g)=>(r(),h("div",{key:g,class:de(_.option_class)},[n(p,{value:_.value},{default:d(()=>[R(m(_.label),1)]),_:2},1032,["value"]),_.note?(r(),h("div",{key:0,innerHTML:_.note,class:"radio-option-note"},null,8,N2)):x("",!0)],2))),128))]),_:1},16,["modelValue"])}}},K2=Object.freeze(Object.defineProperty({__proto__:null,default:Qp},Symbol.toStringTag,{value:"Module"})),G2=["innerHTML"],Ws={__name:"Input",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Jt().ctx,a=Il(e,"modelValue"),l=e,s=T(),i=async()=>{typeof l.field.prefix=="function"?s.value=await l.callback(l.field.prefix):s.value=l.field.prefix};return Ie(()=>{i()}),Gf(()=>{i()}),K(()=>l.fieldKey==="amount"?l.form.data.values.type==="fixed"?ze.shop.get("currency_sign"):"%":t.appVars.shop.currency_sign),(c,p)=>{var _;const f=C("el-input");return r(),E(f,va({modelValue:a.value,"onUpdate:modelValue":p[0]||(p[0]=g=>a.value=g)},e.attribute,{disabled:e.field.disabled}),oa({_:2},[(_=e.field.prefix)!=null&&_.component?{name:"prefix",fn:d(()=>[n(Sp,{form:e.form,name:e.field.prefix.component,field:e.field,value:e.value},null,8,["form","name","field","value"])]),key:"0"}:e.field.prefix?{name:"prefix",fn:d(()=>[o("div",{innerHTML:s.value},null,8,G2)]),key:"1"}:void 0]),1040,["modelValue","disabled"])}}},z2=Object.freeze(Object.defineProperty({__proto__:null,default:Ws},Symbol.toStringTag,{value:"Module"})),j2={key:0,class:"fct-color-presets-section"},q2=["aria-label"],Y2=["aria-label","aria-pressed","tabindex","onClick","onKeydown"],W2={class:"fct-color-custom-row"},J2={class:"fct-term-color-picker-wrap fct-term-color-picker-wrap--lg"},X2={key:1,class:"fct-color-picker-box"},Z2={class:"fct-color-picker-trigger-wrap"},ek={class:"fct-color-picker-action-wrap"},tk=["disabled","placeholder","aria-label","onKeydown"],kd={__name:"ColorPicker",props:bl({field:{type:Object},statePath:{type:String},value:{default:null},form:{type:Object},callback:{type:Function},label:{type:String},attribute:{default:()=>({})},withPresets:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue"),a=()=>{t.value=""},l=T(t.value||""),s=v=>{let w=(v||"").trim();return w&&w[0]!=="#"&&(w="#"+w),/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(w)?w.toLowerCase():""};be(t,v=>{s(l.value)!==(v||"")&&(l.value=v||"")});const i=()=>{const v=s(l.value);v&&(t.value=v)},c=()=>{const v=s(l.value);v&&(t.value=v),l.value=v||t.value||""},p=v=>v?ks.findIndex(w=>w.toLowerCase()===v.toLowerCase()):-1,f=T(Math.max(0,p(t.value)));be(t,v=>{const w=p(v);w>=0&&(f.value=w)});const _=T([]),g=(v,w)=>{t.value=v,f.value=w},y=(v,w)=>{let k=w;if(v.key==="ArrowRight"||v.key==="ArrowDown")k=(w+1)%ks.length;else if(v.key==="ArrowLeft"||v.key==="ArrowUp")k=(w-1+ks.length)%ks.length;else if(v.key==="Home")k=0;else if(v.key==="End")k=ks.length-1;else return;v.preventDefault(),g(ks[k],k),xe(()=>{_.value[k]&&_.value[k].focus()})};return(v,w)=>{const k=C("el-color-picker"),b=C("el-input");return e.withPresets?(r(),h("div",j2,[o("div",{class:"fct-color-swatch-grid",role:"group","aria-label":A(u)("Color presets")},[(r(!0),h(P,null,te(A(ks),(S,$)=>(r(),h("button",{key:S,ref_for:!0,ref:D=>_.value[$]=D,type:"button",class:de(["fct-color-swatch",{"is-active":t.value&&t.value.toLowerCase()===S.toLowerCase()}]),style:ra({background:S,"--swatch-color":S}),"aria-label":A(u)("Select color %1$s",S),"aria-pressed":!!(t.value&&t.value.toLowerCase()===S.toLowerCase()),tabindex:$===f.value?0:-1,onClick:D=>g(S,$),onKeydown:D=>y(D,$)},null,46,Y2))),128))],8,q2),o("div",W2,[o("div",J2,[n(k,va({modelValue:t.value,"onUpdate:modelValue":w[0]||(w[0]=S=>t.value=S),"color-format":"hex"},e.attribute,{disabled:e.field&&e.field.disabled}),null,16,["modelValue","disabled"])]),n(b,{modelValue:t.value,"onUpdate:modelValue":w[1]||(w[1]=S=>t.value=S),placeholder:A(u)("#000000"),"aria-label":A(u)("Hex color code")},null,8,["modelValue","placeholder","aria-label"])])])):(r(),h("div",X2,[o("div",Z2,[n(k,va({modelValue:t.value,"onUpdate:modelValue":w[2]||(w[2]=S=>t.value=S)},e.attribute,{disabled:e.field&&e.field.disabled,"popper-class":"fct-color-picker-popover"}),null,16,["modelValue","disabled"]),t.value?x("",!0):(r(),E(Y,{key:0,name:"ColorPicker",class:"fct-color-picker-icon w-4 h-4"}))]),o("div",ek,[Wt(o("input",{"onUpdate:modelValue":w[3]||(w[3]=S=>l.value=S),type:"text",class:"fct-color-picker-hex-input",maxlength:"7",spellcheck:"false",disabled:e.field&&e.field.disabled,placeholder:A(u)("Add..."),"aria-label":A(u)("Hex color code"),onInput:i,onBlur:c,onKeydown:xa(Ge(c,["prevent"]),["enter"])},null,40,tk),[[Hc,l.value]]),t.value?(r(),E(Y,{key:0,name:"Cross",class:"fct-color-picker-action w-5 h-5",onClick:a})):x("",!0)])]))}}},ak=Object.freeze(Object.defineProperty({__proto__:null,default:kd},Symbol.toStringTag,{value:"Module"})),Dp={__name:"Date",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue");return(a,l)=>{const s=C("el-date-picker");return r(),E(s,va({modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=i=>t.value=i)},e.attribute,{disabled:e.field.disabled}),null,16,["modelValue","disabled"])}}},lk=Object.freeze(Object.defineProperty({__proto__:null,default:Dp},Symbol.toStringTag,{value:"Module"})),Vp={__name:"Time",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue");return(a,l)=>{const s=C("el-time-select");return r(),E(s,va({modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=i=>t.value=i)},e.attribute,{disabled:e.field.disabled}),null,16,["modelValue","disabled"])}}},sk=Object.freeze(Object.defineProperty({__proto__:null,default:Vp},Symbol.toStringTag,{value:"Module"})),nk={key:0},Tp={__name:"Select",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue"),a=e,l=T([]),s=T(!1),i=async(p="")=>{s.value=!0,typeof a.field.options=="function"&&(l.value=await a.field.options({data:a.value,form:a.form,statePath:a.statePath,search:p})),Array.isArray(a.field.options)&&(l.value=[...a.field.options]),s.value=!1};Ie(async()=>{await i()});const c=p=>typeof p.disabled=="function"?a.callback(p.disabled,{}):p.disabled;return(p,f)=>{const _=C("el-option"),g=C("el-select");return r(),E(g,va({modelValue:t.value,"onUpdate:modelValue":f[0]||(f[0]=y=>t.value=y)},e.attribute,{"remote-method":i,loading:s.value,filterable:e.field.filterable===!0,clearable:e.field.clearable===!0,disabled:e.field.disabled}),{default:d(()=>[(r(!0),h(P,null,te(l.value,(y,v)=>(r(),E(_,{key:v,value:y.value,label:y.label,disabled:c(y)},{default:d(()=>[y.slot?(r(),h("span",nk,m(y.slot),1)):x("",!0)]),_:2},1032,["value","label","disabled"]))),128))]),_:1},16,["modelValue","loading","filterable","clearable","disabled"])}}},ok=Object.freeze(Object.defineProperty({__proto__:null,default:Tp},Symbol.toStringTag,{value:"Module"})),Mp={__name:"RemoteSearchableSelect",props:bl({field:{type:Object},key:{type:String}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue"),a=e,l=T(!1),s=T(a.field.options||[]),i=c=>{if(a.field.search_only_on_type===!0){if(c.query.length===0)return}else if(c.query.length<1&&s.value.length>0)return;l.value=!0,Ae.get("forms/search_options",{search_by:c.query,search_for:c.key}).then(p=>{s.value=p.options,l.value=!1})};return(c,p)=>{const f=C("el-option"),_=C("el-select");return r(),E(_,{modelValue:t.value,"onUpdate:modelValue":p[0]||(p[0]=g=>t.value=g),filterable:"",remote:"",placeholder:e.field.placeholder??A(u)("Please enter a keyword"),"remote-method":g=>{i({query:g,key:e.field.remote_key})},loading:l.value,multiple:e.field.multiple},{default:d(()=>[(r(!0),h(P,null,te(s.value,g=>(r(),E(f,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","remote-method","loading","multiple"])}}},ik=Object.freeze(Object.defineProperty({__proto__:null,default:Mp},Symbol.toStringTag,{value:"Module"}));function An(e,t){t===void 0&&(t={});var a=t.insertAt;if(e&&typeof document<"u"){var l=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",a==="top"&&l.firstChild?l.insertBefore(s,l.firstChild):l.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}An(".vel-fade-enter-active,.vel-fade-leave-active{-webkit-transition:all .3s ease;transition:all .3s ease}.vel-fade-enter-from,.vel-fade-leave-to{opacity:0}.vel-img-swiper{display:block;position:relative}.vel-modal{background:rgba(0,0,0,.5);bottom:0;left:0;margin:0;position:fixed;right:0;top:0;z-index:9998}.vel-img-wrapper{left:50%;margin:0;position:absolute;top:50%;-webkit-transform:translate(-50% -50%);transform:translate(-50% -50%);-webkit-transition:.3s linear;transition:.3s linear;will-change:transform opacity}.vel-img,.vel-img-wrapper{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vel-img{background-color:rgba(0,0,0,.7);-webkit-box-shadow:0 5px 20px 2px rgba(0,0,0,.7);box-shadow:0 5px 20px 2px rgba(0,0,0,.7);display:block;max-height:80vh;max-width:80vw;position:relative;-webkit-transition:-webkit-transform .3s ease-in-out;transition:-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out;transition:transform .3s ease-in-out,-webkit-transform .3s ease-in-out}@media (max-width:750px){.vel-img{max-height:95vh;max-width:85vw}}.vel-btns-wrapper{position:static}.vel-btns-wrapper .btn__close,.vel-btns-wrapper .btn__next,.vel-btns-wrapper .btn__prev{-webkit-tap-highlight-color:transparent;color:#fff;cursor:pointer;font-size:32px;opacity:.6;outline:none;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:.15s linear;transition:.15s linear;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vel-btns-wrapper .btn__close:hover,.vel-btns-wrapper .btn__next:hover,.vel-btns-wrapper .btn__prev:hover{opacity:1}.vel-btns-wrapper .btn__close.disable,.vel-btns-wrapper .btn__close.disable:hover,.vel-btns-wrapper .btn__next.disable,.vel-btns-wrapper .btn__next.disable:hover,.vel-btns-wrapper .btn__prev.disable,.vel-btns-wrapper .btn__prev.disable:hover{cursor:default;opacity:.2}.vel-btns-wrapper .btn__next{right:12px}.vel-btns-wrapper .btn__prev{left:12px}.vel-btns-wrapper .btn__close{right:10px;top:24px}@media (max-width:750px){.vel-btns-wrapper .btn__next,.vel-btns-wrapper .btn__prev{font-size:20px}.vel-btns-wrapper .btn__close{font-size:24px}.vel-btns-wrapper .btn__next{right:4px}.vel-btns-wrapper .btn__prev{left:4px}}.vel-modal.is-rtl .vel-btns-wrapper .btn__next{left:12px;right:auto}.vel-modal.is-rtl .vel-btns-wrapper .btn__prev{left:auto;right:12px}@media (max-width:750px){.vel-modal.is-rtl .vel-btns-wrapper .btn__next{left:4px;right:auto}.vel-modal.is-rtl .vel-btns-wrapper .btn__prev{left:auto;right:4px}}.vel-modal.is-rtl .vel-img-title{direction:rtl}");An('.vel-loading{left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.vel-loading .ring{display:inline-block;height:64px;width:64px}.vel-loading .ring:after{-webkit-animation:ring 1.2s linear infinite;animation:ring 1.2s linear infinite;border-color:hsla(0,0%,100%,.7) transparent;border-radius:50%;border-style:solid;border-width:5px;content:" ";display:block;height:46px;margin:1px;width:46px}@-webkit-keyframes ring{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes ring{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}');An(".vel-on-error{left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.vel-on-error .icon{color:#aaa;font-size:80px}");An(".vel-img-title{bottom:60px;color:#ccc;cursor:default;font-size:12px;left:50%;line-height:1;max-width:80%;opacity:.8;overflow:hidden;position:absolute;text-align:center;text-overflow:ellipsis;-webkit-transform:translate(-50%);transform:translate(-50%);-webkit-transition:opacity .15s;transition:opacity .15s;white-space:nowrap}.vel-img-title:hover{opacity:1}");An(".vel-icon{fill:currentColor;height:1em;overflow:hidden;vertical-align:-.15em;width:1em}");An(".vel-toolbar{border-radius:4px;bottom:8px;display:-webkit-box;display:-ms-flexbox;display:flex;left:50%;opacity:.9;overflow:hidden;padding:0;position:absolute;-webkit-transform:translate(-50%);transform:translate(-50%)}.vel-toolbar,.vel-toolbar .toolbar-btn{background-color:#2d2d2d;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vel-toolbar .toolbar-btn{-ms-flex-negative:0;-webkit-tap-highlight-color:transparent;color:#fff;cursor:pointer;flex-shrink:0;font-size:20px;outline:none;padding:6px 10px}.vel-toolbar .toolbar-btn:active,.vel-toolbar .toolbar-btn:hover{background-color:#3d3d3d}");const xl="vel",Ml=vs({name:"SvgIcon",props:{type:{type:String,default:""}},setup:e=>()=>n("svg",{class:`${xl}-icon icon`,"aria-hidden":"true"},[n("use",{"xlink:href":`#icon-${e.type}`},null)])}),ki=typeof window<"u",Js=()=>{};let Lp=!1;if(ki)try{const e={};Object.defineProperty(e,"passive",{get(){Lp=!0}}),window.addEventListener("test-passive",Js,e)}catch{}const Ju=function(e,t,a){let l=arguments.length>3&&arguments[3]!==void 0&&arguments[3];ki&&e.addEventListener(t,a,!!Lp&&{capture:!1,passive:l})},Xu=(e,t,a)=>{ki&&e.removeEventListener(t,a)},rk=e=>{e.preventDefault()},dk=Object.prototype.toString,Bd=e=>t=>dk.call(t).slice(8,-1)===e,uk=e=>!!e&&Bd("Object")(e),Zu=e=>!!e&&Bd("String")(e);function ck(e){return e!=null}const Ak=vs({name:"Toolbar",props:{zoomIn:{type:Function,default:Js},zoomOut:{type:Function,default:Js},rotateLeft:{type:Function,default:Js},rotateRight:{type:Function,default:Js},resize:{type:Function,default:Js},rotateDisabled:{type:Boolean,default:!1},zoomDisabled:{type:Boolean,default:!1}},setup:e=>()=>n("div",{class:`${xl}-toolbar`},[!e.zoomDisabled&&n(P,null,[n("div",{role:"button","aria-label":"zoom in button",class:"toolbar-btn toolbar-btn__zoomin",onClick:e.zoomIn},[n(Ml,{type:"zoomin"},null)]),n("div",{role:"button","aria-label":"zoom out button",class:"toolbar-btn toolbar-btn__zoomout",onClick:e.zoomOut},[n(Ml,{type:"zoomout"},null)])]),n("div",{role:"button","aria-label":"resize image button",class:"toolbar-btn toolbar-btn__resize",onClick:e.resize},[n(Ml,{type:"resize"},null)]),!e.rotateDisabled&&n(P,null,[n("div",{role:"button","aria-label":"image rotate left button",class:"toolbar-btn toolbar-btn__rotate",onClick:e.rotateLeft},[n(Ml,{type:"rotate-left"},null)]),n("div",{role:"button","aria-label":"image rotate right button",class:"toolbar-btn toolbar-btn__rotate",onClick:e.rotateRight},[n(Ml,{type:"rotate-right"},null)])])])}),pk=()=>n("div",{class:`${xl}-loading`},[n("div",{class:"ring"},null)]),fk=()=>n("div",{class:`${xl}-on-error`},[n("div",{class:"ring"},null),n(Ml,{type:"img-broken"},null)]),mk=(e,t)=>{let{slots:a}=t;return n("div",{class:`${xl}-img-title`},[a.default?a.default():""])},hk=vs({name:"DefaultIcons",setup:()=>()=>n("svg",{"aria-hidden":!0,style:"position: absolute; width: 0; height: 0; overflow: hidden; visibility: hidden;"},[n("symbol",{id:"icon-rotate-right",viewBox:"0 0 1024 1024"},[n("path",{d:"M275.199914 450.496179v20.031994c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399a120.255962 120.255962 0 0 1-72.991978-24.895992c-21.503993-15.839995-35.359989-38.751988-41.567987-68.735979h60.831981c9.247997 23.007993 27.167992 34.495989 53.759983 34.49599 37.535988-0.384 56.863982-21.407993 57.983982-63.071981v-38.751988c-28.095991 8.863997-54.303983 13.119996-78.623975 12.735996a91.263971 91.263971 0 0 1-68.447979-27.711991c-18.847994-18.303994-28.095991-47.231985-27.711991-86.847973z m62.55998 24.863992c7.103998 24.799992 25.215992 37.343988 54.271983 37.663989 27.103992-0.288 44.703986-11.327996 52.831984-33.11999 3.135999-8.383997 2.655999-29.599991-1.28-38.559988-8.607997-19.615994-25.791992-29.695991-51.551984-30.20799-28.383991 0.576-46.303986 12.639996-53.759983 36.159988a58.719982 58.719982 0 0 0-0.512 28.063991z m390.335878 115.711964v-116.895963c-1.12-41.311987-20.447994-62.335981-57.983981-63.07198-37.727988 0.768-56.959982 21.791993-57.695982 63.07198v116.895963c0.768 41.663987 19.999994 62.68798 57.695982 63.071981 37.535988-0.384 56.863982-21.407993 57.983981-63.071981z m-174.815945 3.391999v-123.935961c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399-31.10399-0.384-57.887982-10.751997-80.319975-31.10399-23.935993-20.543994-36.127989-49.791984-36.479989-87.679973z m282.559912-479.07185A509.887841 509.887841 0 0 0 511.99984 0.00032C229.215928 0.00032 0 229.216248 0 512.00016s229.215928 511.99984 511.99984 511.99984 511.99984-229.215928 511.99984-511.99984c0-3.743999-0.032-7.455998-0.128-11.167997-1.631999-11.295996-8.159997-27.103992-31.87199-27.103991-27.487991 0-31.67999 21.247993-32.03199 32.06399l0.032 4.127999a30.62399 30.62399 0 0 0 0.16 2.079999H959.9997c0 247.423923-200.575937 447.99986-447.99986 447.99986S63.99998 759.424083 63.99998 512.00016 264.575917 64.0003 511.99984 64.0003a446.079861 446.079861 0 0 1 277.439913 96.22397l-94.91197 91.679971c-25.439992 24.607992-17.439995 44.991986 17.887994 45.599986l188.031942 3.295999a64.31998 64.31998 0 0 0 65.055979-62.84798l3.295999-188.127942C969.407697 15.040315 949.311703 5.792318 923.871711 30.368311l-87.999972 85.023973z",fill:""},null)]),n("symbol",{id:"icon-rotate-left",viewBox:"0 0 1024 1024"},[n("path",{d:"M275.199914 450.496179v20.031994c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399a120.255962 120.255962 0 0 1-72.991978-24.895992c-21.503993-15.839995-35.359989-38.751988-41.567987-68.735979h60.831981c9.247997 23.007993 27.167992 34.495989 53.759983 34.49599 37.535988-0.384 56.863982-21.407993 57.983982-63.071981v-38.751988c-28.095991 8.863997-54.303983 13.119996-78.623975 12.735996a91.263971 91.263971 0 0 1-68.447979-27.711991c-18.847994-18.303994-28.095991-47.231985-27.711991-86.847973z m62.55998 24.863992c7.103998 24.799992 25.215992 37.343988 54.271983 37.663989 27.103992-0.288 44.703986-11.327996 52.831984-33.11999 3.135999-8.383997 2.655999-29.599991-1.28-38.559988-8.607997-19.615994-25.791992-29.695991-51.551984-30.20799-28.383991 0.576-46.303986 12.639996-53.759983 36.159988a58.719982 58.719982 0 0 0-0.512 28.063991z m390.335878 115.711964v-116.895963c-1.12-41.311987-20.447994-62.335981-57.983981-63.07198-37.727988 0.768-56.959982 21.791993-57.695982 63.07198v116.895963c0.768 41.663987 19.999994 62.68798 57.695982 63.071981 37.535988-0.384 56.863982-21.407993 57.983981-63.071981z m-174.815945 3.391999v-123.935961c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399-31.10399-0.384-57.887982-10.751997-80.319975-31.10399-23.935993-20.543994-36.127989-49.791984-36.479989-87.679973zM188.159941 115.392284A509.887841 509.887841 0 0 1 511.99984 0.00032c282.783912 0 511.99984 229.215928 511.99984 511.99984s-229.215928 511.99984-511.99984 511.99984S0 794.784072 0 512.00016c0-3.743999 0.032-7.455998 0.128-11.167997 1.631999-11.295996 8.159997-27.103992 31.87199-27.103991 27.487991 0 31.67999 21.247993 32.03199 32.06399L63.99998 509.920161a30.62399 30.62399 0 0 1-0.16 2.079999H63.99998c0 247.423923 200.575937 447.99986 447.99986 447.99986s447.99986-200.575937 447.99986-447.99986S759.423763 64.0003 511.99984 64.0003a446.079861 446.079861 0 0 0-277.439913 96.22397l94.91197 91.679971c25.439992 24.607992 17.439995 44.991986-17.887994 45.599986L123.551961 300.800226a64.31998 64.31998 0 0 1-65.055979-62.84798l-3.295999-188.127942C54.591983 15.040315 74.687977 5.792318 100.127969 30.368311l87.999972 85.023973z",fill:""},null)]),n("symbol",{id:"icon-resize",viewBox:"0 0 1024 1024"},[n("path",{d:"M456.036919 791.8108 270.553461 791.8108 460.818829 601.572038l-39.593763-39.567157L231.314785 751.915162l0.873903-183.953615c0-15.465227-12.515035-27.981285-27.981285-27.981285s-27.981285 12.515035-27.981285 27.981285l0 251.829516c0 8.3072 3.415796 14.975063 8.826016 19.564591 5.082762 5.192256 12.132318 8.416693 19.947308 8.416693l251.036453 0c15.46625 0 27.981285-12.514012 27.981285-27.981285C484.018204 804.325835 471.504192 791.8108 456.036919 791.8108zM838.945819 184.644347c-5.082762-5.191232-12.132318-8.416693-19.947308-8.416693L567.961034 176.227654c-15.46625 0-27.981285 12.515035-27.981285 27.981285 0 15.46625 12.514012 27.981285 27.981285 27.981285l185.483458 0L563.206754 422.427962l39.567157 39.567157 189.910281-189.910281-0.873903 183.953615c0 15.46625 12.514012 27.981285 27.981285 27.981285s27.981285-12.514012 27.981285-27.981285L847.772858 204.208938C847.771835 195.902762 844.356039 189.234899 838.945819 184.644347zM847.771835 64.303538 176.227142 64.303538c-61.809741 0-111.924115 50.115398-111.924115 111.924115l0 671.544693c0 61.809741 50.114374 111.924115 111.924115 111.924115l671.544693 0c61.809741 0 111.924115-50.114374 111.924115-111.924115l0-671.544693C959.69595 114.418936 909.581576 64.303538 847.771835 64.303538zM903.733381 847.772346c0 30.878265-25.056676 55.962569-55.962569 55.962569L176.227142 903.734916c-30.90487 0-55.962569-25.084305-55.962569-55.962569l0-671.544693c0-30.9325 25.056676-55.962569 55.962569-55.962569l671.544693 0c30.90487 0 55.962569 25.03007 55.962569 55.962569L903.734404 847.772346z"},null)]),n("symbol",{id:"icon-img-broken",viewBox:"0 0 1024 1024"},[n("path",{d:"M810.666667 128H213.333333c-46.933333 0-85.333333 38.4-85.333333 85.333333v597.333334c0 46.933333 38.4 85.333333 85.333333 85.333333h597.333334c46.933333 0 85.333333-38.4 85.333333-85.333333V213.333333c0-46.933333-38.4-85.333333-85.333333-85.333333z m0 682.666667H213.333333v-195.413334l42.24 42.24 170.666667-170.666666 170.666667 170.666666 170.666666-170.24L810.666667 530.346667V810.666667z m0-401.493334l-43.093334-43.093333-170.666666 171.093333-170.666667-170.666666-170.666667 170.666666-42.24-42.666666V213.333333h597.333334v195.84z"},null)]),n("symbol",{id:"icon-prev",viewBox:"0 0 1024 1024"},[n("path",{d:"M784.652701 955.6957 346.601985 517.644983c-2.822492-2.822492-2.822492-7.902977 0-11.289967l439.179713-439.179713c6.77398-6.77398 10.725469-16.370452 10.725469-25.966924L796.507166 36.692393c0-20.32194-16.370452-36.692393-36.692393-36.692393l-4.515987 0c-9.596472 0-19.192944 3.951488-25.966924 10.725469L250.072767 489.420066c-12.418964 12.418964-12.418964 32.740904 0 45.159868l477.565601 477.565601c7.338479 7.338479 17.499449 11.854465 28.224917 11.854465l0 0c22.015436 0 40.079383-18.063947 40.079383-40.079383l0 0C796.507166 973.759647 791.99118 963.598677 784.652701 955.6957z"},null)]),n("symbol",{id:"icon-next",viewBox:"0 0 1024 1024"},[n("path",{d:"M246.121279 955.6957l438.050717-438.050717c2.822492-2.822492 2.822492-7.902977 0-11.289967L244.992282 67.175303c-6.77398-6.77398-10.725469-16.370452-10.725469-25.966924L234.266814 36.692393C234.266814 16.370452 250.637266 0 270.959206 0l4.515987 0c9.596472 0 19.192944 3.951488 25.966924 10.725469l478.694598 478.694598c12.418964 12.418964 12.418964 32.740904 0 45.159868l-477.565601 477.565601c-7.338479 7.338479-17.499449 11.854465-28.224917 11.854465l0 0c-22.015436 0-40.079383-18.063947-40.079383-40.079383l0 0C234.266814 973.759647 238.7828 963.598677 246.121279 955.6957z"},null)]),n("symbol",{id:"icon-zoomin",viewBox:"0 0 1024 1024"},[n("path",{d:"M725.504 652.864c46.4-61.44 71.744-136.448 71.744-218.752C797.248 230.464 632.768 64 430.656 64S64 230.464 64 434.112C64 639.36 228.48 805.76 430.656 805.76c86.656 0 164.48-30.144 227.52-81.088L889.984 960 960 891.264l-234.496-238.4z m-294.848 67.456c-155.776 0-282.624-128.896-282.624-286.208s126.848-286.208 282.624-286.208 282.624 128.896 282.624 286.208-126.912 286.208-282.624 286.208z"},null),n("path",{d:"M235.712 369.92h390.72v127.104H235.712z"},null),n("path",{d:"M367.488 238.144h127.104v390.72H367.488z"},null)]),n("symbol",{id:"icon-close",viewBox:"0 0 1024 1024"},[n("path",{d:"M570.24 512l259.2 259.2-58.88 58.24L512 570.24l-261.12 261.12-58.24-58.24L453.76 512 194.56 252.8l58.24-58.24L512 453.76l261.12-261.12 58.24 58.24z"},null)]),n("symbol",{id:"icon-zoomout",viewBox:"0 0 1024 1024"},[n("path",{d:"M725.504 652.864c46.4-61.44 71.744-136.448 71.744-218.752C797.248 230.464 632.768 64 430.656 64S64 230.464 64 434.112C64 639.36 228.48 805.76 430.656 805.76c86.656 0 164.48-30.144 227.52-81.088L889.984 960 960 891.264l-234.496-238.4z m-294.848 67.456c-155.776 0-282.624-128.896-282.624-286.208s126.848-286.208 282.624-286.208 282.624 128.896 282.624 286.208-126.912 286.208-282.624 286.208z"},null),n("path",{d:"M235.712 369.92h390.72v127.104H235.712z"},null)])])}),Qn=ki?window:global;let ec=Date.now();function _k(e){const t=Date.now(),a=Math.max(0,16-(t-ec)),l=setTimeout(e,a);return ec=t+a,l}function er(e){return(Qn.requestAnimationFrame||_k).call(Qn,e)}function tc(e){(Qn.cancelAnimationFrame||Qn.clearTimeout).call(Qn,e)}function ac(e,t){const a=e.clientX-t.clientX,l=e.clientY-t.clientY;return Math.sqrt(a*a+l*l)}function tr(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!zf(e)}var ar=vs({name:"VueEasyLightbox",props:{imgs:{type:[Array,String],default:()=>""},visible:{type:Boolean,default:!1},index:{type:Number,default:0},scrollDisabled:{type:Boolean,default:!0},escDisabled:{type:Boolean,default:!1},moveDisabled:{type:Boolean,default:!1},titleDisabled:{type:Boolean,default:!1},maskClosable:{type:Boolean,default:!0},teleport:{type:[String,Object],default:null},swipeTolerance:{type:Number,default:50},loop:{type:Boolean,default:!1},rtl:{type:Boolean,default:!1},zoomScale:{type:Number,default:.12},maxZoom:{type:Number,default:3},minZoom:{type:Number,default:.1},rotateDisabled:{type:Boolean,default:!1},zoomDisabled:{type:Boolean,default:!1},pinchDisabled:{type:Boolean,default:!1},dblclickDisabled:{type:Boolean,default:!1}},emits:{hide:()=>!0,"on-error":e=>!0,"on-prev":(e,t)=>!0,"on-next":(e,t)=>!0,"on-prev-click":(e,t)=>!0,"on-next-click":(e,t)=>!0,"on-index-change":(e,t)=>!0,"on-rotate":e=>!0},setup(e,t){let{emit:a,slots:l}=t;const{imgRef:s,imgState:i,setImgSize:c}=(()=>{const Be=T(),$e=Zs({width:0,height:0,maxScale:1});return{imgRef:Be,imgState:$e,setImgSize:()=>{if(Be.value){const{width:He,height:Re,naturalWidth:yt}=Be.value;$e.maxScale=yt/He,$e.width=He,$e.height=Re}}}})(),p=T(e.index),f=T(""),_=Zs({scale:1,lastScale:1,rotateDeg:0,top:0,left:0,initX:0,initY:0,lastX:0,lastY:0,touches:[]}),g=Zs({loadError:!1,loading:!1,dragging:!1,gesturing:!1,wheeling:!1}),y=K(()=>{return Be=e.imgs,Bd("Array")(Be)?e.imgs.map($e=>typeof $e=="string"?{src:$e}:function(He){return uk(He)&&Zu(He.src)}($e)?$e:void 0).filter(ck):Zu(e.imgs)?[{src:e.imgs}]:[];var Be}),v=K(()=>y.value[p.value]),w=K(()=>{var Be;return(Be=y.value[p.value])==null?void 0:Be.src}),k=K(()=>{var Be;return(Be=y.value[p.value])==null?void 0:Be.title}),b=K(()=>{var Be;return(Be=y.value[p.value])==null?void 0:Be.alt}),S=K(()=>({cursor:g.loadError?"default":e.moveDisabled?g.dragging?"grabbing":"grab":"move",top:`calc(50% + ${_.top}px)`,left:`calc(50% + ${_.left}px)`,transition:g.dragging||g.gesturing?"none":"",transform:`translate(-50%, -50%) scale(${_.scale}) rotate(${_.rotateDeg}deg)`})),$=()=>{a("hide")},D=()=>{_.scale=1,_.lastScale=1,_.rotateDeg=0,_.top=0,_.left=0,g.loadError=!1,g.dragging=!1,g.loading=!0},F=(Be,$e)=>{const He=p.value;D(),p.value=Be,y.value[p.value]===y.value[Be]&&xe(()=>{g.loading=!1}),e.visible&&He!==Be&&($e&&$e(He,Be),a("on-index-change",He,Be))},B=()=>{const Be=p.value,$e=e.loop?(Be+1)%y.value.length:Be+1;!e.loop&&$e>y.value.length-1||F($e,(He,Re)=>{a("on-next",He,Re),a("on-next-click",He,Re)})},U=()=>{const Be=p.value;let $e=Be-1;if(Be===0){if(!e.loop)return;$e=y.value.length-1}F($e,(He,Re)=>{a("on-prev",He,Re),a("on-prev-click",He,Re)})},Q=Be=>{Math.abs(1-Be)<.05?Be=1:Math.abs(i.maxScale-Be)<.05&&(Be=i.maxScale),_.lastScale=_.scale,_.scale=Be},V=()=>{const Be=_.scale+e.zoomScale;Be<i.maxScale*e.maxZoom&&Q(Be)},I=()=>{const Be=_.scale-e.zoomScale;Be>e.minZoom&&Q(Be)},M=()=>{const Be=_.rotateDeg%360;a("on-rotate",Math.abs(Be<0?Be+360:Be))},O=()=>{_.rotateDeg-=90,M()},L=()=>{_.rotateDeg+=90,M()},H=()=>{_.scale=1,_.top=0,_.left=0},j=function(){let Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return!e.moveDisabled&&Be===0},{onMouseDown:W,onMouseMove:G,onMouseUp:Z}=((Be,$e,He)=>{let Re,yt=!1;return{onMouseDown:gt=>{Be.initX=Be.lastX=gt.clientX,Be.initY=Be.lastY=gt.clientY,$e.dragging=!0,yt=!1,gt.stopPropagation()},onMouseUp:gt=>{He(gt.button)&&tc(Re),$e.dragging=!1,yt=!1},onMouseMove:gt=>{if($e.dragging)if(He(gt.button)){if(yt)return;yt=!0,Re=er(()=>{const{top:Rt,left:Tt,lastY:Dt,lastX:_t}=Be;Be.top=Rt-Dt+gt.clientY,Be.left=Tt-_t+gt.clientX,Be.lastX=gt.clientX,Be.lastY=gt.clientY,yt=!1})}else Be.lastX=gt.clientX,Be.lastY=gt.clientY;gt.stopPropagation()}}})(_,g,j),{onTouchStart:ne,onTouchMove:ce,onTouchEnd:z}=((Be,$e,He,Re,yt)=>{let gt,Rt=!1;return{onTouchStart:Tt=>{const{touches:Dt}=Tt;Dt.length>1&&yt()?(He.gesturing=!0,$e.touches=Dt):($e.initX=$e.lastX=Dt[0].clientX,$e.initY=$e.lastY=Dt[0].clientY,He.dragging=!0),Tt.stopPropagation()},onTouchMove:Tt=>{if(Rt)return;const{touches:Dt}=Tt,{lastX:_t,lastY:Gt,left:bt,top:St,scale:Pt}=$e;if(!He.gesturing&&He.dragging){if(!Dt[0])return;const{clientX:Ht,clientY:Qt}=Dt[0];Re()?gt=er(()=>{$e.lastX=Ht,$e.lastY=Qt,$e.top=St-Gt+Qt,$e.left=bt-_t+Ht,Rt=!1}):($e.lastX=Ht,$e.lastY=Qt)}else He.gesturing&&$e.touches.length>1&&Dt.length>1&&yt()&&(gt=er(()=>{const Ht=(ac($e.touches[0],$e.touches[1])-ac(Dt[0],Dt[1]))/Be.width;$e.touches=Dt;const Qt=Pt-1.3*Ht;Qt>.5&&Qt<1.5*Be.maxScale&&($e.scale=Qt),Rt=!1}))},onTouchEnd:()=>{tc(gt),He.dragging=!1,He.gesturing=!1,Rt=!1}}})(i,_,g,j,()=>!e.pinchDisabled),ue=()=>{e.dblclickDisabled||(_.scale!==i.maxScale?(_.lastScale=_.scale,_.scale=i.maxScale):_.scale=_.lastScale)},ie=Be=>{g.loadError||g.gesturing||g.loading||g.dragging||g.wheeling||!e.scrollDisabled||e.zoomDisabled||(g.wheeling=!0,setTimeout(()=>{g.wheeling=!1},80),Be.deltaY<0?V():I())},J=Be=>{const $e=Be;e.visible&&(!e.escDisabled&&$e.key==="Escape"&&e.visible&&$(),$e.key==="ArrowLeft"&&(e.rtl?B():U()),$e.key==="ArrowRight"&&(e.rtl?U():B()))},N=()=>{e.maskClosable&&$()},ae=()=>{c()},oe=()=>{g.loading=!1},fe=Be=>{g.loading=!1,g.loadError=!0,a("on-error",Be)},re=()=>{e.visible&&c()};be(()=>e.index,Be=>{Be<0||Be>=y.value.length||F(Be)}),be(()=>g.dragging,(Be,$e)=>{const He=!Be&&$e;if(!j()&&He){const Re=_.lastX-_.initX,yt=_.lastY-_.initY,gt=e.swipeTolerance;Math.abs(Re)>Math.abs(yt)&&(Re<-1*gt?B():Re>gt&&U())}}),be(()=>e.visible,Be=>{if(Be){D();const $e=y.value.length;if($e===0)return p.value=0,g.loading=!1,void xe(()=>g.loadError=!0);p.value=e.index>=$e?$e-1:e.index<0?0:e.index,e.scrollDisabled&&Ee()}else e.scrollDisabled&&ye()});const Ee=()=>{document&&(f.value=document.body.style.overflowY,document.body.style.overflowY="hidden")},ye=()=>{document&&(document.body.style.overflowY=f.value)};Ie(()=>{Ju(document,"keydown",J),Ju(window,"resize",re)}),cl(()=>{Xu(document,"keydown",J),Xu(window,"resize",re),e.scrollDisabled&&ye()});const Ce=()=>g.loading?l.loading?l.loading({key:"loading"}):n(pk,{key:"img-loading"},null):g.loadError?l.onerror?l.onerror({key:"onerror"}):n(fk,{key:"img-on-error"},null):n("div",{class:`${xl}-img-wrapper`,style:S.value,key:"img-wrapper"},[n("img",{alt:b.value,ref:s,draggable:"false",class:`${xl}-img`,src:w.value,onMousedown:W,onMouseup:Z,onMousemove:G,onTouchstart:ne,onTouchmove:ce,onTouchend:z,onLoad:ae,onDblclick:ue,onDragstart:Be=>{Be.preventDefault()}},null)]),ve=()=>{if(l["prev-btn"])return l["prev-btn"]({prev:U});if(y.value.length<=1)return;const Be=!e.loop&&p.value<=0;return n("div",{role:"button","aria-label":"previous image button",class:"btn__prev "+(Be?"disable":""),onClick:U},[e.rtl?n(Ml,{type:"next"},null):n(Ml,{type:"prev"},null)])},Ue=()=>{if(l["next-btn"])return l["next-btn"]({next:B});if(y.value.length<=1)return;const Be=!e.loop&&p.value>=y.value.length-1;return n("div",{role:"button","aria-label":"next image button",class:"btn__next "+(Be?"disable":""),onClick:B},[e.rtl?n(Ml,{type:"prev"},null):n(Ml,{type:"next"},null)])},Ke=()=>{if(!(e.titleDisabled||g.loading||g.loadError))return l.title?l.title({currentImg:v.value}):k.value?n(mk,null,{default:()=>[k.value]}):void 0},We=()=>{let Be;if(e.visible)return n("div",{onTouchmove:rk,class:[`${xl}-modal`,e.rtl?"is-rtl":""],onClick:Ge(N,["self"]),onWheel:ie},[n(hk,null,null),n(Xl,{name:`${xl}-fade`,mode:"out-in"},tr(Be=Ce())?Be:{default:()=>[Be]}),n("img",{style:"display:none;",src:w.value,onError:fe,onLoad:oe},null),n("div",{class:`${xl}-btns-wrapper`},[ve(),Ue(),Ke(),l["close-btn"]?l["close-btn"]({close:$}):n("div",{role:"button","aria-label":"close image preview button",class:"btn__close",onClick:$},[n(Ml,{type:"close"},null)]),l.toolbar?l.toolbar({toolbarMethods:{zoomIn:V,zoomOut:I,rotate:O,rotateLeft:O,rotateRight:L,resize:H},zoomIn:V,zoomOut:I,rotate:O,rotateLeft:O,rotateRight:L,resize:H}):n(Ak,{zoomIn:V,zoomOut:I,resize:H,rotateLeft:O,rotateRight:L,rotateDisabled:e.rotateDisabled,zoomDisabled:e.zoomDisabled},null)])])};return()=>{let Be;if(e.teleport){let $e;return n(ii,{to:e.teleport},{default:()=>[n(Xl,{name:`${xl}-fade`},tr($e=We())?$e:{default:()=>[$e]})]})}return n(Xl,{name:`${xl}-fade`},tr(Be=We())?Be:{default:()=>[Be]})}}});const vk=Object.assign(ar,{install:e=>{e.component(ar.name,ar)}}),gk={name:"Attachments",components:{MediaButton:uA,VueEasyLightbox:vk,IconButton:at,Delete:Wc},props:{multiple:Boolean,attachments:{type:[Array,Object],default:()=>[]},empty_text:String,isSingle:Boolean,title:String,type:String,icon:String,showList:{type:Boolean,default:!0},showDeleteButton:{type:Boolean,default:!0},previewImage:{type:Boolean,default:!0},mediaInputSize:{type:String},mediaInputBg:{type:String}},emits:["removeImage","mediaUploaded"],data(){return{visible:!1,imageIndex:0,lightboxData:[],images:T([])}},computed:{showMediaButtonAsIcon:function(){return!this.multiple&&this.attachments.length===1}},watch:{attachments:{handler:function(e,t){return this.lightboxData=[],Array.isArray(e)&&e.length>0&&e.map((a,l)=>{this.lightboxData.push(a.url)}),e},deep:!0}},mounted:function(){Array.isArray(this.attachments)&&this.attachments.length>0&&this.attachments.forEach(e=>{this.lightboxData.push(e.url),this.images.push({id:e.id,url:e.url,title:e.title})})},methods:{translate:u,removeImageEvent(e){this.$emit("removeImage",e)},onMediaSelected(e){this.images=e.map(t=>({id:t.id,title:t.title,url:t.url})),this.$emit("mediaUploaded",this.images)}}},yk={class:"fct-attachments-wrap",style:{position:"relative"}},bk={class:"fct-attachment-img-wrap"},wk=["src","alt","onClick"],Ck={class:"fct-attachments-button"};function kk(e,t,a,l,s,i){const c=C("VueEasyLightbox"),p=C("MediaButton"),f=C("IconButton"),_=C("Delete");return r(),h(P,null,[n(c,{visible:s.visible,imgs:s.lightboxData,index:s.imageIndex,onHide:t[0]||(t[0]=()=>{s.visible=!1})},null,8,["visible","imgs","index"]),o("div",yk,[a.attachments?(r(),h("ul",{key:0,class:de(`fct-attachments-list ${a.multiple?"is-multiple":"fct-single-attachment"} ${a.attachments.length>0?"is-single":""}`)},[a.showList===!0?(r(!0),h(P,{key:0},te(a.attachments,(g,y)=>(r(),h("li",{key:y,class:de([[a.mediaInputSize,a.mediaInputBg],"fct-attachment-item"])},[o("div",bk,[a.previewImage?(r(),h("img",{key:0,src:g.url,alt:g.title,onClick:()=>{s.imageIndex=y,s.visible=!0}},null,8,wk)):x("",!0),i.showMediaButtonAsIcon&&!a.multiple?(r(),E(f,{key:1,size:"x-small"},{default:d(()=>[n(p,{"icon-mode":!0,attachments:a.attachments,title:a.multiple?"":a.title,onOnMediaSelected:i.onMediaSelected,multiple:a.multiple,icon:a.icon},null,8,["attachments","title","onOnMediaSelected","multiple","icon"])]),_:1})):x("",!0)]),o("div",Ck,[a.showDeleteButton?(r(),E(f,{key:0,tag:"button",bg:"danger",outline:"",size:"x-small",onClick:Ge(v=>i.removeImageEvent(y),["prevent"]),title:i.translate("Delete media")},{default:d(()=>[a.multiple?(r(),E(_,{key:0})):(r(),h(P,{key:1},[R(m(i.translate("Remove")),1)],64))]),_:2},1032,["onClick","title"])):x("",!0),i.showMediaButtonAsIcon&&a.multiple?(r(),E(f,{key:1,size:"x-small"},{default:d(()=>[n(p,{"icon-mode":!0,attachments:a.attachments,title:a.multiple?"":a.title,onOnMediaSelected:i.onMediaSelected,multiple:a.multiple,icon:a.icon},null,8,["attachments","title","onOnMediaSelected","multiple","icon"])]),_:1})):x("",!0)])],2))),128)):x("",!0),i.showMediaButtonAsIcon?x("",!0):(r(),h("li",{key:1,class:de([a.mediaInputSize,a.mediaInputBg])},[n(p,{"icon-mode":!1,attachments:a.attachments,title:a.multiple?"":a.title,onOnMediaSelected:i.onMediaSelected,multiple:a.multiple,icon:a.icon},null,8,["attachments","title","onOnMediaSelected","multiple","icon"])],2))],2)):x("",!0),ga(e.$slots,"default")])],64)}const Rp=nt(gk,[["render",kk]]),Bk={key:0},xk={key:0,class:"setting-label"},Bi={__name:"MediaInput",props:{modelValue:{default:""},showSupported:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},icon:{type:String},title:{type:String},mediaInputSize:{type:String},mediaInputBg:{type:String},field:{type:Object}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,l=t,s=T();let i=T([]);const c=()=>{a.multiple?s.value=[]:s.value="",i.value=[],l("update:modelValue",s.value)},p=_=>{if(_.length)if(a.multiple){s.value=[],i.value=[];for(const g of _)s.value.push(g),i.value.push(g)}else s.value=_,i.value=_;l("update:modelValue",s.value)};be(()=>a.modelValue,_=>{Array.isArray(_)&&_.length>0?s.value=_:_&&typeof _=="string"&&_!==""?s.value=[_]:_&&typeof _=="object"?s.value=[_]:s.value=[],f()});const f=()=>{i.value=[],Object.values(s.value).forEach((_,g)=>{_!==void 0&&_!==""&&i.value.push(_)})};return Ie(()=>{Array.isArray(a.modelValue)&&a.modelValue.length>0?s.value=a.modelValue:a.modelValue&&typeof a.modelValue=="string"&&a.modelValue!==""?s.value=[a.modelValue]:a.modelValue&&typeof a.modelValue=="object"?s.value=[a.modelValue]:s.value=[],f()}),(_,g)=>(r(),h(P,null,[n(Rp,{attachments:A(i),onMediaUploaded:p,onRemoveImage:c,icon:e.icon,title:e.title,mediaInputSize:e.mediaInputSize,mediaInputBg:e.mediaInputBg},null,8,["attachments","icon","title","mediaInputSize","mediaInputBg"]),e.showSupported?(r(),h("div",Bk,[e.field&&e.field.label?(r(),h("label",xk,m(e.field.label),1)):x("",!0),o("span",null,m(A(u)("%1$s Recommended width: %2$s pixels minimum.","HEIC, WEBP, SVG, PNG, or JPG.","512")),1)])):x("",!0)],64))}},Sk={class:"setting-media-wrap"},Op={__name:"Media",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue");return(a,l)=>(r(),h("div",Sk,[n(Bi,va({modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=s=>t.value=s),field:e.field,icon:"Upload"},e.attribute),null,16,["modelValue","field"])]))}},Fk=Object.freeze(Object.defineProperty({__proto__:null,default:Op},Symbol.toStringTag,{value:"Module"})),$k={__name:"InputRenderer",props:{form:{type:Object,required:!0},field:{type:Object,required:!0},value:{type:Object,required:!0},statePath:{type:String,required:!0},fieldKey:{type:String,required:!0},fullStatePath:{type:String,required:!0}},setup(e){const t=e;T(!1),Jt().ctx;const a=_=>typeof _.label=="function"?_.label(t.value,t.statePath,t.form):_.label,l=(_,g)=>{if(typeof _=="function")return _({data:t.value,form:t.form,statePath:t.statePath,field:t.field,event:Array.isArray(g)&&g.length===1?g[0]:g})},s=T(!1);let i={};Ie(async()=>{i=await Cd.attributesBuilders(t.field,l,t.form),s.value=!0});const c={switch:Up,checkbox:Ip,radio:Qp,input:Ws,text:Ws,email:Ws,number:Ws,textarea:Ws,color:kd,date:Dp,time:Vp,select:Tp,media:Op,remote_select:Mp},p=K(()=>c[t.field.type]||null),f=K(()=>({modelValue:t.value[t.fieldKey],form:t.form,statePath:t.statePath,field:t.field,fieldKey:t.fieldKey,value:t.value[t.fieldKey],nesting:!1,label:a(t.field),attribute:i,callback:l}));return(_,g)=>e.field.type==="wp-editor"?(r(),E(ls,{key:0,shortCodes:e.field.shortcodes.data,modelValue:t.value[t.fieldKey],onUpdate:g[0]||(g[0]=y=>{t.value[t.fieldKey]=y})},null,8,["shortCodes","modelValue"])):p.value&&s.value?(r(),E(gl(p.value),va({key:1,onChange:g[1]||(g[1]=y=>{e.form.triggerChange(y)}),onInput:g[2]||(g[2]=y=>{e.form.triggerChange(e.value[e.fieldKey])}),modelValue:e.value[e.fieldKey],"onUpdate:modelValue":g[3]||(g[3]=y=>e.value[e.fieldKey]=y)},f.value),null,16,["modelValue"])):x("",!0)}},Ek=["innerHTML"],Uk={key:0},Ik={key:0},xi={__name:"FormRenderer",props:{form:{type:Object,required:!0},schema:{type:Object},value:{type:Object},statePath:{type:String}},setup(e){const t=e,a=t.statePath??"",l=["grid","section","tab","tab-pane"];T(!1),Jt().ctx;const s=(c,p)=>{if(typeof c.label=="function"){let f=i(c)?a:p+".",_=i(c)?t.value:t.value[p];return c.label(_,f,t.form)}return c.label},i=c=>c.disable_nesting!==!1;return(c,p)=>(r(!0),h(P,null,te(e.schema,(f,_)=>(r(),h(P,{key:_},[e.form.isVisible(f,e.statePath+_)?(r(),h(P,{key:0},[f.type==="html"?(r(),h("div",{key:0,class:de(`setting-html-wrapper ${f.wrapperClass??""}`),innerHTML:f.value},null,10,Ek)):(r(),h(P,{key:1},[f.component?(r(),h("div",{key:0,class:de(f.wrapperClass??"")},[f.component&&f.label?(r(),E(pa,{key:0,title:s(f,_),content:f.tooltip,class:"setting-label",placement:f.tooltip_placement},{default:d(()=>[f.labelOptional?(r(),h("span",Uk,"("+m(f.labelOptional)+")",1)):x("",!0)]),_:2},1032,["title","content","placement"])):x("",!0),n(Sp,{modelValue:e.value[_],"onUpdate:modelValue":g=>e.value[_]=g,name:f.component,form:e.form,statePath:i(f)?A(a):_+".",field:f,"field-key":_,value:i(f)?e.value:e.value[_],nesting:i(f)},{fieldNote:d(()=>[f.note&&f.hide_note!==!0?(r(),E(Nr,{key:0,note:f.note},null,8,["note"])):x("",!0)]),validationError:d(()=>[n(Wu,{form:e.form,"error-key":A(a)+_},null,8,["form","error-key"])]),_:2},1032,["modelValue","onUpdate:modelValue","name","form","statePath","field","field-key","value","nesting"])],2)):x("",!0),l.includes(f.type)?(r(),E(O2,{key:1,form:e.form,field:f,value:e.value,"full-state-path":A(a),statePath:i(f)?A(a):_+".","field-key":_},null,8,["form","field","value","full-state-path","statePath","field-key"])):x("",!0),typeof f.type<"u"&&!l.includes(f.type)&&!["custom","component","html","hidden"].includes(f.type)?(r(),h("div",{key:2,class:de(`setting-fields-inner ${f.wrapperClass??""}`)},[f.type!=="checkbox"&&!f.component&&f.label!==!1?(r(),E(pa,{key:0,class:"setting-label",title:s(f,_),content:f.tooltip,placement:f.tooltip_placement},{default:d(()=>[f.labelOptional?(r(),h("span",Ik,"("+m(f.labelOptional)+")",1)):x("",!0)]),_:2},1032,["title","content","placement"])):x("",!0),n($k,{form:e.form,field:f,value:e.value,"full-state-path":A(a),"state-path":e.statePath,"field-key":_},null,8,["form","field","value","full-state-path","state-path","field-key"]),f.note&&!f.component?(r(),E(Nr,{key:1,note:f.note},null,8,["note"])):x("",!0),f.component?x("",!0):(r(),E(Wu,{key:2,form:e.form,"error-key":A(a)+_},null,8,["form","error-key"]))],2)):x("",!0)],64))],64)):x("",!0)],64))),128))}},Qk={key:0,class:"vue-form-wrap"},Dk={key:0,class:"form-section-save-action"},Vk={key:0,class:"cmd block leading-none"},Si={__name:"VueForm",props:{form:{type:Object,required:!0},schema:{type:Object},value:{type:Object},showSubmitButton:{type:Boolean,default:!1},submitButtonText:{type:String,default:"Save"},loading:{type:Boolean,default:!1}},emits:["onSubmit","onChange","onSubmitButtonClick"],setup(e,{expose:t,emit:a}){const l=nl(),s=e,i=a;be(()=>s.form.isReady,()=>{xe(()=>nn.scrollToHashSection(l.hash))},{once:!0}),Ie(()=>{xe(()=>{c.registerCopyAction(),s.form.isReady&&nn.scrollToHashSection(l.hash)})}),T({});const c=Jt().ctx,p=()=>{i("onSubmitButtonClick")};return t({getState:()=>s.form.values}),(_,g)=>{const y=C("el-button");return e.form.isReady?(r(),h("div",Qk,[n(xi,{form:e.form,ref:"formRenderer",schema:e.form.schema,value:e.form.values},null,8,["form","schema","value"]),e.showSubmitButton?(r(),h("div",Dk,[n(y,{onClick:p,type:"primary",loading:e.loading},{default:d(()=>[e.loading?x("",!0):(r(),h("span",Vk,"⌘s")),R(" "+m(e.submitButtonText),1)]),_:1},8,["loading"])])):x("",!0)])):x("",!0)}}},Tk={key:0},Pp={__name:"DynamicFormLoader",props:["schema","values","submit_button_text","form_name","widget"],emits:["change"],setup(e,{expose:t,emit:a}){let l=bd();const s=a,i=e,c=()=>{const g=i.form_name,y={};return y[g]={...l.values},y},p=()=>{l.reset()},f=()=>{var g;return((g=i.widget)==null?void 0:g.reset_on_save)==!0},_=oi("triggerChange");return Ie(()=>{l.setSchema(i.schema).setDefaults(i.values).initForm(),l.onDataChanged(g=>{_==null||_(),s("change")})}),t({getState:c,resetForm:p,resetOnSave:f}),(g,y)=>A(l).isReady?(r(),h("div",Tk,[n(Si,{showSubmitButton:!1,submitButtonText:e.submit_button_text,form:A(l),onOnSubmitButtonClick:y[0]||(y[0]=()=>{A(l).values}),onOnChange:y[1]||(y[1]=v=>{}),"validation-errors":{}},null,8,["submitButtonText","form"])])):x("",!0)}},Mk={__name:"EChart",props:{option:{type:Object,required:!0},height:{type:String,default:"400px"},width:{type:String,default:"100%"}},setup(e){const t=e,a=T(null);let l=null;const s=()=>{a.value&&(l=na(a.value),l.setOption(t.option))};be(()=>t.option,f=>{l&&f&&l.setOption(f,!0)},{deep:!0});const i=(f,_)=>{if(f==null||f==="")return _;const g=Number(f);return isNaN(g)?f:`${g}px`},c=K(()=>i(t.height,"400px")),p=K(()=>i(t.width,"100%"));return Ie(()=>{s(),window.addEventListener("resize",()=>l==null?void 0:l.resize())}),cl(()=>{window.removeEventListener("resize",()=>l==null?void 0:l.resize()),l==null||l.dispose()}),(f,_)=>(r(),h("div",{ref_key:"chartRef",ref:a,style:ra({width:p.value,height:c.value})},null,4))}},Lk={class:"fct-step-indicator"},Rk={class:"indicator-title"},Ok={class:"indicator-steps"},Pk={class:"indicator-progress"},Hk={class:"indicator-steps-bar"},Nk=["onClick"],Kk={__name:"StepIndicator",props:{steps:{type:Array,required:!0},currentStep:{type:Number,default:1}},emits:["step-click"],setup(e,{emit:t}){const a=t;return(l,s)=>(r(),h("div",Lk,[o("div",Rk,m(e.steps[e.currentStep-1].label),1),o("div",Ok,[o("div",Pk,m(e.currentStep)+"/"+m(e.steps.length)+" "+m(l.$t("Completed")),1),o("div",Hk,[(r(!0),h(P,null,te(e.steps,(i,c)=>(r(),h("div",{key:c,class:"indicator-step",onClick:p=>a("step-click",c+1)},[o("div",{class:de(["indicator-step-bar",c<e.currentStep?"is-completed":""])},null,2)],8,Nk))),128))])])]))}},Gk=["type","disabled","aria-disabled"],zk={key:0,class:"fct-btn-spinner"},jk="6px",qk={__name:"LoadingButton",props:{loading:Boolean,disabled:Boolean,type:{type:String,default:""},size:{type:String,default:""},plain:Boolean,nativeType:{type:String,default:"button"},duration:{type:Number,default:300}},emits:["click"],setup(e,{emit:t}){const a=e,l=t,s=K(()=>a.disabled||a.loading),i=()=>`width ${a.duration}ms ease, opacity ${a.duration}ms ease, margin-right ${a.duration}ms ease`,c=y=>{y.style.width="0",y.style.opacity="0",y.style.overflow="hidden",y.style.marginRight="6px"},p=(y,v)=>{const w=y.scrollWidth+"px";y.style.transition=i(),requestAnimationFrame(()=>{y.style.width=w,y.style.opacity="1",y.style.marginRight=""}),setTimeout(()=>v(),a.duration)},f=y=>{y.style.width="auto",y.style.overflow="",y.style.marginRight=""},_=y=>{y.style.width=y.scrollWidth+"px",y.style.opacity="1",y.style.overflow="hidden",y.style.marginRight=jk},g=(y,v)=>{y.offsetHeight,y.style.transition=i(),y.style.width="0",y.style.opacity="0",y.style.marginRight="0";const w=k=>{k.propertyName==="width"&&(y.removeEventListener("transitionend",w),v())};y.addEventListener("transitionend",w)};return(y,v)=>(r(),h("button",{type:e.nativeType,class:de(["el-button",e.type&&`el-button--${e.type}`,e.size&&`el-button--${e.size}`,{"is-plain":e.plain,"is-loading":e.loading,"is-disabled":s.value}]),disabled:s.value,"aria-disabled":s.value,onClick:v[0]||(v[0]=w=>l("click",w))},[n(Xl,{onBeforeEnter:c,onEnter:p,onAfterEnter:f,onBeforeLeave:_,onLeave:g},{default:d(()=>[e.loading?(r(),h("span",zk,v[1]||(v[1]=[o("i",{class:"el-icon is-loading"},[o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})])],-1)]))):x("",!0)]),_:1}),o("span",null,[ga(y.$slots,"default",{},void 0,!0)])],10,Gk))}},Yk=nt(qk,[["__scopeId","data-v-fa8794a2"]]),Hp={__name:"VueTemplateLoader",props:{widget:{type:Object,required:!0},data:{required:!1}},setup(e){var c,p;const t=Nc(Kc),a=Object.freeze({get:(...f)=>Ae.get(...f),post:(...f)=>Ae.post(...f),put:(...f)=>Ae.put(...f),delete:(...f)=>Ae.delete(...f),patch:(...f)=>Ae.patch(...f),upload:(...f)=>Ae.upload(...f),getNonce:()=>Ae.getNonce()}),l=Object.freeze({success:(...f)=>q.success(...f),error:(...f)=>q.error(...f),info:(...f)=>q.info(...f),validationErrors:(...f)=>q.validationErrors(...f)}),s={Vue:t,Rest:a,Notify:l,translate:u,Animation:ya,StepIndicator:Kk,LoadingButton:Yk,ElMessage:(c=window==null?void 0:window.ELEMENT)==null?void 0:c.ElMessage,ElMessageBox:(p=window==null?void 0:window.ELEMENT)==null?void 0:p.ElMessageBox},i=f=>typeof f=="string"?Em(f,s).component:vs(f);return(f,_)=>(r(),E(gl(i(e.widget.component)),va({ref:"componentRefs",data:e.data},{...e.widget}),null,16,["data"]))}},Wk=["innerHTML"],pn={__name:"DynamicTemplates",props:{widgetsQuery:{type:Object,default:{},required:!1},filter:{type:String,default:"",required:!1},data:{required:!1}},emits:["change"],setup(e,{expose:t,emit:a}){Jt().ctx;const l=a,s=e,i=T([]),c=Nc(Kc),p={},f=D=>{window.fluent_cart_admin.app={vue:c,components:D,xhr:Ae,notify:q},window.fluent_cart_admin.hooks.applyFilters(s.filter+"_components",[],c,D).forEach(({name:B,component:U})=>{p[B]=vs(U)})};Ds(()=>{let F=Jt().appContext.components;f(F);let B=window.fluent_cart_admin.hooks.applyFilters(s.filter,[],c,F);Array.isArray(B)&&(i.value=i.value.concat(B));const U={filter:s.filter,data:s.widgetsQuery};Ae.get("widgets",U).then(Q=>{Array.isArray(Q.widgets)&&(i.value=i.value.concat(Q.widgets))}),s.widgetsQuery});const _=D=>vs(D),g=D=>p[D]||null,y=T([]),v=async(D,F)=>{const B=y.value.map(U=>typeof U[D]=="function"?U[D](F):Promise.resolve());return await Promise.all(B),!0};t({beforeUpdatingData:async D=>await v("beforeUpdatingData",D),afterUpdatingData:async D=>await v("afterUpdatingData",D),getFormStates:()=>{let D=[];if(Array.isArray($.value))for(let F of $.value)D={...D,...F.getState()};return D},resetForms:()=>{if(Array.isArray($.value))for(let D of $.value)D.resetOnSave()&&D.resetForm()}});const $=T();return(D,F)=>(r(!0),h(P,null,te(i.value,B=>(r(),h(P,null,[B.type!=="vue-component"&&B.type!=="vue-template"||B.use_card==!0?(r(),E(Se,{key:0},{default:d(()=>[n(Ve,{title:B.title,subtitle:B.subtitle,border_bottom:""},null,8,["title","subtitle"]),n(ke,null,{default:d(()=>[B.type==="html"?(r(),h("div",{key:0,innerHTML:B.content},null,8,Wk)):B.type==="chart"?(r(),E(Mk,{key:1,option:B.data,height:`${B.height||400}`,width:`${B.width||"100%"}`},null,8,["option","height","width"])):B.type==="form"?(r(),E(Pp,{key:2,schema:B.schema,values:B.values,submit_button_text:B.submit_button_text,form_name:B.form_name,ref_for:!0,ref_key:"formRefs",ref:$,widget:B,onChange:F[0]||(F[0]=()=>l("change"))},null,8,["schema","values","submit_button_text","form_name","widget"])):typeof B.component=="object"?(r(),E(gl(_(B.component)),va({key:3,ref_for:!0,ref_key:"componentRefs",ref:y},{ref_for:!0},{...B,data:e.data}),null,16)):g(B.component)?(r(),E(gl(g(B.component)),va({key:4,ref_for:!0,ref_key:"componentRefs",ref:y},{ref_for:!0},{...B,data:e.data}),null,16)):(r(),h(P,{key:5},[R(m(B.content),1)],64))]),_:2},1024)]),_:2},1024)):B.type==="vue-component"?(r(),h(P,{key:1},[typeof B.component=="object"?(r(),E(gl(_(B.component)),va({key:0,ref_for:!0,ref_key:"componentRefs",ref:y},{ref_for:!0},{...B,data:e.data}),null,16)):g(B.component)?(r(),E(gl(g(B.component)),va({key:1,ref_for:!0,ref_key:"componentRefs",ref:y},{ref_for:!0},{...B,data:e.data}),null,16)):x("",!0)],64)):B.type==="vue-template"?(r(),E(Hp,{key:2,widget:B,data:e.data},null,8,["widget","data"])):x("",!0)],64))),256))}},ua=e=>e!=null&&!isNaN(Number(e))?new Intl.NumberFormat(void 0,{maximumFractionDigits:2}).format(Number(e)):e,Jk={class:"fct-dashboard-stat-widgets"},Xk={class:"right w-full"},Zk=["href"],eB={class:"fct-dashboard-stat-widget__icon"},tB={class:"fct-dashboard-stat-widget__content"},aB={class:"fct-dashboard-stat-widget__title"},lB={class:"fct-dashboard-stat-widget__value inner-value"},sB=["innerHTML"],nB={key:1,class:"fct-dashboard-stat-widget__inner"},oB={class:"fct-dashboard-stat-widget__content"},iB={class:"fct-dashboard-stat-widget__title"},rB=["href"],dB={key:1},uB={class:"fct-dashboard-stat-widget__value"},cB={__name:"StatsWidget",setup(e){const t=T(!0),a=T([]),l=()=>{t.value=!0,Ae.get("dashboard/stats").then(s=>{a.value=s.stats}).catch(s=>{q.error(s)}).finally(()=>{t.value=!1})};return Ie(()=>{l()}),(s,i)=>{const c=C("el-skeleton-item"),p=C("el-skeleton");return r(),h("div",Jk,[t.value?(r(),h(P,{key:0},te(4,f=>n(p,{key:f,animated:"",class:"bg-white dark:bg-dark-700 flex flex-col items-start py-5 px-4.5 rounded-[12px] gap-3"},{template:d(()=>[n(c,{variant:"circle",class:"w-10 h-10 flex-none"}),o("div",Xk,[n(c,{variant:"p",class:"w-full"}),n(c,{variant:"p",class:"w-10"})])]),_:2},1024)),64)):(r(),h(P,{key:1},[(r(!0),h(P,null,te(a.value,(f,_)=>(r(),h("div",{key:_,class:"fct-dashboard-stat-widget"},[f.url?(r(),h("a",{key:0,href:f.url,class:"fct-dashboard-stat-widget__inner no-underline"},[o("div",eB,[n(Y,{class:"w-5",name:f.icon},null,8,["name"])]),o("div",tB,[o("h3",aB,[o("span",null,m(f.title),1)]),o("span",lB,[f.has_currency?(r(),h("span",{key:0,innerHTML:A(ft).scaled(f.current_count)},null,8,sB)):(r(),h(P,{key:1},[R(m(A(sa)(A(ua)(f.current_count))||0),1)],64))])])],8,Zk)):(r(),h("div",nB,[i[0]||(i[0]=Dn('<div class="fct-dashboard-stat-widget__icon"><svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.20248 2.62165L5.7818 3.27834C3.59393 4.28965 2.5 4.7953 2.5 5.62533C2.5 6.45535 3.59393 6.961 5.7818 7.97231L7.20249 8.629C8.57936 9.26544 9.26781 9.58366 10 9.58366C10.7322 9.58366 11.4206 9.26544 12.7975 8.629L14.2182 7.97231C16.4061 6.961 17.5 6.45535 17.5 5.62533C17.5 4.7953 16.4061 4.28965 14.2182 3.27834L12.7975 2.62165C11.4206 1.98521 10.7322 1.66699 10 1.66699C9.26781 1.66699 8.57937 1.98521 7.20248 2.62165Z" stroke="#122368" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17.3233 9.24805C17.4411 9.41368 17.5 9.5863 17.5 9.77614C17.5 10.5944 16.4061 11.0928 14.2182 12.0897L12.7975 12.7371C11.4206 13.3644 10.7322 13.6781 10 13.6781C9.26781 13.6781 8.57936 13.3644 7.20249 12.7371L5.7818 12.0897C3.59394 11.0928 2.5 10.5944 2.5 9.77614C2.5 9.5863 2.55889 9.41368 2.67667 9.24805" stroke="#122368" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M16.9806 13.5557C17.3269 13.8315 17.5 14.1064 17.5 14.4319C17.5 15.2501 16.4061 15.7486 14.2182 16.7455L12.7975 17.3928C11.4206 18.0202 10.7322 18.3339 10 18.3339C9.26781 18.3339 8.57936 18.0202 7.20249 17.3928L5.7818 16.7455C3.59394 15.7486 2.5 15.2501 2.5 14.4319C2.5 14.1064 2.67315 13.8315 3.01945 13.5557" stroke="#122368" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg></div>',1)),o("div",oB,[o("h3",iB,[f.url?(r(),h("a",{key:0,class:"link",href:f.url},m(f.title),9,rB)):(r(),h("span",dB,m(f.title),1))]),o("span",uB,m(f.current_count),1)])]))]))),128)),n(pn,{data:{stats:a.value},filter:"dashboard_stats_widget"},null,8,["data"])],64))])}}},lc=200,AB=800,pB=.1,fB=.3,sc=.5,mB=.5,hB=12,_B=800,vB=1600,gB=150,yB=3500,bB=["#FFC700","#FF0000","#2E3191","#41BBC7"];var xd={props:{particleCount:{type:Number,default:gB},particleSize:{type:Number,default:hB},duration:{type:Number,default:yB},colors:{type:Array,default:bB},force:{type:Number,default:mB},stageHeight:{type:Number,default:_B},stageWidth:{type:Number,default:vB},shouldDestroyAfterDone:{type:Boolean,default:!0}},setup(e){const t=T(!0),a=(F,B)=>{D(F,{degree:B})},l=K(()=>i(e.particleCount,e.colors));jf(()=>{e.particleCount>300&&console.log("[VUE-CONFETTI-EXPLOSION] That's a lot of confetti, you sure about that? A lesser number like 200 will still give off the party vibes while still not bricking the device 😉")});const s=K(()=>$(e.particleCount,e.duration,e.colors,e.particleSize,e.force,e.stageHeight,e.stageWidth));Ie(async()=>{await c(e.duration),e.shouldDestroyAfterDone&&(t.value=!1)});const i=(F,B)=>{const U=360/F;return Array.from({length:F},(Q,V)=>({color:B[V%B.length],degree:V*U}))},c=F=>new Promise(B=>setTimeout(B,F));function p(F){let B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return Math.round((F+Number.EPSILON)*10**B)/10**B}function f(F,B){if(F===B)return!0;if(F==null||B==null||F.length!==B.length)return!1;for(let U=0;U<F.length;U++)if(F[U]!==B[U])return!1;return!0}const _=(F,B,U,Q,V)=>(F-B)*(V-Q)/(U-B)+Q,g=(F,B)=>{const U=F+B;return U>360?U-360:U},y=()=>Math.random()>.5,v=[0,0,1],w=[[1,1,0],[1,0,1],[0,1,1],[1,0,0],[0,1,0],v],k=F=>!f(w[F],v)&&y(),b=F=>typeof F>"u",S=F=>{console.error(F)};function $(F,B,U,Q,V,I,M){const O=Number.isSafeInteger;return!b(F)&&O(F)&&F<0?(S("particleCount must be a positive integer"),!1):!b(B)&&O(B)&&B<0?(S("duration must be a positive integer"),!1):!b(U)&&!Array.isArray(U)?(S("colors must be an array of strings"),!1):!b(Q)&&O(Q)&&Q<0?(S("particleSize must be a positive integer"),!1):!b(V)&&O(V)&&(V<0||V>1)?(S("force must be a positive integer and should be within 0 and 1"),!1):!b(I)&&typeof I=="number"&&O(I)&&I<0?(S("floorHeight must be a positive integer"),!1):!b(M)&&typeof M=="number"&&O(M)&&M<0?(S("floorWidth must be a positive integer"),!1):!0}function D(F,B){let{degree:U}=B;const Q=_(Math.abs(g(U,90)-180),0,180,-e.stageWidth/2,e.stageWidth/2),V=Math.random()*(AB-lc)+lc,I=Math.round(Math.random()*(w.length-1)),M=e.duration-Math.round(Math.random()*1e3),O=Math.random()<pB,L=k(I),H=O?p(Math.random()*fB,2):0,j=H*-1,W=H,G=p(Math.abs(_(Math.abs(g(U,90)-180),0,180,-1,1)),4),Z=p(Math.random()*sc,4),ne=p(Math.random()*e.force*(y()?1:-1),4),ce=sc,z=p(Math.max(_(Math.abs(U-180),0,180,e.force,-e.force),0),4),ue=(ie,J)=>F==null?void 0:F.style.setProperty(ie,J+"");ue("--x-landing-point",`${Q}px`),ue("--duration-chaos",`${M}ms`),ue("--x1",`${H}`),ue("--x2",`${j}`),ue("--x3",`${W}`),ue("--x4",`${G}`),ue("--y1",`${Z}`),ue("--y2",`${ne}`),ue("--y3",`${ce}`),ue("--y4",`${z}`),ue("--width",`${L?e.particleSize:Math.round(Math.random()*4)+e.particleSize/2}px`),ue("--height",(L?e.particleSize:Math.round(Math.random()*2)+e.particleSize)+"px"),ue("--rotation",`${w[I].join()}`),ue("--rotation-duration",`${V}ms`),ue("--border-radius",`${L?"50%":"0"}`)}return{isVisible:t,isValid:s,stageHeight:e.stageHeight,particles:l,setItemRef:a}}};function wB(e,t,a,l,s,i){return l.isVisible&&l.isValid?(r(),h("div",{key:0,class:"confetti-container",style:ra(`--floor-height: ${l.stageHeight}px;`)},[(r(!0),h(P,null,te(l.particles,c=>{let{color:p,degree:f}=c;return r(),h("div",{key:f,class:"particle",ref:_=>l.setItemRef(_,f)},[o("div",{style:ra(`--bgcolor: ${p};`)},null,4)],512)}),128))],4)):x("",!0)}function CB(e,t){t===void 0&&(t={});var a=t.insertAt;if(!(typeof document>"u")){var l=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",a==="top"&&l.firstChild?l.insertBefore(s,l.firstChild):l.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}var kB=`
106 + </div>`}),U}},xAxis:{type:"category",data:v.value,axisLabel:{color:p.value?"#ffffff":"#696778",fontSize:12,interval:b.value.interval},axisLine:{lineStyle:{type:"dashed",color:p.value?"#253241":"#D6DAE1"}}},yAxis:[{name:kl("Revenue","Chart axis title"),type:"value",position:"left",axisLabel:{color:p.value?"#ffffff":"#696778",fontSize:12,formatter:B=>`${ft.scaledChart(B)}`},splitLine:{show:!0,lineStyle:{color:p.value?"#253241":"#D6DAE1",type:"dashed"}}},{name:kl("Orders","Chart axis title"),type:"value",position:"right",axisLabel:{color:p.value?"#ffffff":"#696778",fontSize:12},splitLine:{show:!1,lineStyle:{color:p.value?"#253241":"#D6DAE1",type:"dashed"}}}],series:y.value};w.setOption(F,{notMerge:!0,replaceMerge:["series"]})},$=(F,B,U,Q,V)=>({name:F,type:B,barMaxWidth:30,data:U,smooth:!1,color:Q,lineStyle:{width:3},areaStyle:{opacity:.3,color:Q},symbol:"circle",showSymbol:!0,symbolSize:8,itemStyle:{color:Q,borderRadius:[4,4,0,0]},yAxisIndex:V,emphasis:{scale:2,itemStyle:{color:ja(Q)},lineStyle:{color:Q},areaStyle:{opacity:.3,color:Q}},animation:!0,animationEasing:"cubicOut",animationDuration:800,animationDelay:0,barGap:"-100%",legendHoverLink:!1}),D=F=>{i.value!==F&&(i.value=F,ba.onChange("order","sales_growth_chart",F),S())};return be([()=>a.chartData,i],()=>{xe(S)},{deep:!0}),be(f,F=>{F||k()}),be(()=>a.loading,F=>{F||k()}),Bt(()=>{window.removeEventListener("onFluentCartThemeChange",S,!1),window.removeEventListener("fluentCartCurrencyChange",S,!1)}),Ie(()=>{window.addEventListener("onFluentCartThemeChange",S),window.addEventListener("fluentCartCurrencyChange",S),xe(k)}),(F,B)=>{const U=C("el-skeleton");return r(),h("div",iC,[n(Se,{id:"chartContainer",ref_key:"cardRef",ref:s},{default:d(()=>[n(Ve,{title:F.$t("Sales Growth"),border_bottom:""},oa({_:2},[!f.value&&!e.loading?{name:"action",fn:d(()=>[o("div",rC,[n(Gl,{activeType:i.value,types:{bar:"BarChart",line:"LineChart"},onChange:D},null,8,["activeType"]),n(Sa,{targetRef:l.value},null,8,["targetRef"])])]),key:"0"}:void 0]),1032,["title"]),n(ke,{class:"p-0"},{default:d(()=>[e.loading?(r(),E(U,{key:0,animated:"",rows:5,class:"p-4"})):(r(),h(P,{key:1},[f.value?(r(),E(Ct,{key:1,icon:"Empty/ListView","has-dark":!0,text:A(u)("Currently there is no data!"),class:"fct-report-empty-state"},null,8,["text"])):(r(),h("div",{key:0,class:"fct-chart-wrap fct-gross-sale-vs-net-revenue-chart",ref_key:"chartRef",ref:l},null,512))],64))]),_:1})]),_:1},512)])}}},uC={class:"fct-gross-sale-vs-net-revenue-wrap"},cC={class:"fct-btn-group sm"},AC={key:0,class:"fct-world-map-action-btns absolute top-5 right-5 flex flex-col gap-1 z-10"},pC={key:1,class:"fct-world-map-action-btns absolute top-[10px] right-[40px] flex flex-col gap-1 z-10"},ju=.5,Zi=6,vo=1.2,fC={__name:"HeatMap",props:{data:{type:Array,required:!0}},setup(e){const t=e,a=Te.colors,l=T(null),s=T(null),i=T(!1),c=T("world"),p=T(92),f=T(100);T(!1);let _=null,g=null,y=50;const v=T(1.2),w=T(),k=a.blue,b=K(()=>{const ue=f.value-p.value,ie=t.data?t.data.length:0;return ue<60||ie<15}),S=ue=>{ue=ue.replace(/^#/,"");const ie=parseInt(ue.substring(0,2),16),J=parseInt(ue.substring(2,4),16),N=parseInt(ue.substring(4,6),16);return[ie,J,N]},$=()=>Te.isDark()?a.gray[50]:a.gray[600],D=S(k[500]),F=async()=>{const ue=gs.getUrl("world.geo.json"),J=await(await fetch(ue)).json();wm("world",J)},B=ue=>{if(!ue||isNaN(ue))return`rgba(${D.join(",")}, 0)`;const ie=Math.log(ue+1)/Math.log(y+1);return`rgba(${D.join(",")}, ${ie})`},U=ue=>{c.value=ue,W(),_&&(_.clear(),_.setOption(H()),ue==="bar"&&Q()),g&&i.value&&(g.clear(),g.setOption(H()),ue==="bar"&&V())},Q=()=>{_&&(_.off("dataZoom"),_.on("dataZoom",function(ue){ue.batch&&ue.batch[0]?(p.value=ue.batch[0].start||0,f.value=ue.batch[0].end||100):(p.value=ue.start||0,f.value=ue.end||100),setTimeout(()=>{W()},100)}))},V=()=>{g&&(g.off("dataZoom"),g.on("dataZoom",function(ue){ue.batch&&ue.batch[0]?(p.value=ue.batch[0].start||0,f.value=ue.batch[0].end||100):(p.value=ue.start||0,f.value=ue.end||100),setTimeout(()=>{g&&g.setOption(H())},100)}))},I=K(()=>(t.data||[]).map(ue=>({...ue,value:ue.value||0,itemStyle:{color:B(ue.value||0)},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}))),M=()=>({backgroundColor:Te.isDark()?a.dark[700]:a.gray[25],tooltip:{trigger:"item",formatter:ue=>u("%1$s%2$s Orders: %3$s",ue.name,"<br>",ue.value||0),borderRadius:8,backgroundColor:Te.isDark()?"#38485a":"#ffffff",borderColor:Te.isDark()?"#4a5a6b":"#c0c4ca",borderWidth:1,textStyle:{color:Te.isDark()?"#ffffff":"#565865"}},visualMap:{min:0,max:y,left:i.value?"5%":"center",bottom:i.value?"center":"4%",text:[u("High"),u("Low")],orient:i.value?"vertical":"horizontal",calculable:!0,inRange:{color:[k[100],k[500]]},textStyle:{color:a.gray[800]}},series:[{name:"Orders",type:"map",map:"world",roam:w.value,zoom:v.value,label:{show:!1,emphasis:{show:!0,color:a.gray[1e3],fontWeight:"bold",textShadowColor:a.gray[50],textShadowBlur:3,textShadowOffsetX:0,textShadowOffsetY:0}},emphasis:{itemStyle:{areaColor:k[300],shadowBlur:10,shadowColor:a.gray[400]}},itemStyle:{borderColor:a.gray[200],borderWidth:.5},data:I.value}]}),O=K(()=>{const ue=t.data.length,ie=f.value-p.value,J=Math.ceil(ue*ie/100);let N=0;return J>100?N=9:J>50?N=4:J>30?N=2:J>20&&(N=1),N}),L=()=>{const ue=b.value;return{backgroundColor:Te.isDark()?a.dark[700]:a.gray[25],tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(ie){const J=ie[0];return`${J.name}<br/>${u("Orders")}: ${J.value||0}`},backgroundColor:Te.isDark()?"#38485a":"#ffffff",textStyle:{color:Te.isDark()?a.gray[25]:a.system.mid},borderColor:Te.isDark()?"#4a5a6b":"#c0c4ca",borderWidth:1},dataZoom:[{type:"inside",yAxisIndex:0,start:p.value,end:f.value},{type:"slider",yAxisIndex:0,start:p.value,end:f.value,width:25,top:10,right:10,textStyle:{color:$()},brushSelect:!1,showDetail:!1,disabled:!0}],grid:{left:ue?"10px":"0%",right:"15%",top:"10%",bottom:"15%",containLabel:!0},yAxis:{type:"category",axisTick:{show:ue},splitLine:{show:!1},axisLine:{show:ue,lineStyle:{color:$()}},axisLabel:{show:ue,interval:O.value,color:$(),fontSize:11},data:t.data.map(ie=>ie.name)},xAxis:{type:"value",axisLabel:{show:!0,color:$(),formatter:function(ie){return ie.toLocaleString()}},splitLine:{show:!0,lineStyle:{color:Te.isDark()?a.gray[600]:a.gray[200]}}},series:[{type:"bar",large:!0,itemStyle:{color:new mr(0,0,1,0,[{offset:0,color:k[400]},{offset:1,color:k[600]}]),borderRadius:[0,4,4,0]},emphasis:{itemStyle:{color:new mr(0,0,1,0,[{offset:0,color:k[500]},{offset:1,color:k[700]}])}},data:t.data.map(ie=>ie.value),label:{show:ue,formatter:"{c}",position:"right",color:$(),fontSize:10}}]}},H=()=>c.value==="bar"?L():M(),j=async()=>{await F(),l.value&&(_=na(l.value),_.setOption(H()),c.value==="bar"&&Q(),_.on("georoam",()=>{const ie=_.getOption().series[0].zoom;if(ie!==v.value)if(ie<vo||ie>Zi){const J=Math.max(vo,Math.min(Zi,ie));_.setOption({series:[{zoom:J}]},!1),v.value=J}else v.value=ie}))},W=()=>{t.data&&t.data.length>0?y=Math.max(...t.data.map(ue=>ue.value||0)):y=1,_&&_.setOption(H(),{notMerge:!0})},G=()=>{v.value=Math.min(v.value+ju,Zi),w.value=!0,_.setOption({series:[{zoom:v.value,roam:w.value}]})},Z=()=>{v.value=Math.max(v.value-ju,vo),w.value=!0,_.setOption({series:[{zoom:v.value,roam:w.value}]})},ne=()=>{c.value==="bar"?(p.value=92,f.value=100,_&&_.dispatchAction({type:"dataZoom",start:92,end:100})):(v.value=vo,w.value="move",_&&(_.clear(),_.setOption(H())))},ce=async()=>{i.value=!0,await xe(),g?g.clear():g=na(s.value),g.setOption(H()),c.value==="bar"&&V()},z=ue=>{$(),_&&_.setOption(H())};return Ie(()=>{window.addEventListener("onFluentCartThemeChange",z),w.value="move",xe(j)}),Bt(()=>{window.removeEventListener("onFluentCartThemeChange",z),_&&(_.dispose(),_=null),g&&(g.dispose(),g=null)}),be(()=>t.data,()=>W(),{deep:!0}),be(b,()=>{c.value==="bar"&&xe(()=>{W()})}),(ue,ie)=>(r(),h("div",uC,[n(Se,{id:"chartContainer",class:"mb-0"},{default:d(()=>[n(Ve,{title:ue.$t("Order Heat Map"),border_bottom:""},{action:d(()=>[o("div",cC,[n(Gl,{activeType:c.value,types:{world:"Globe",bar:"BarChart"},onChange:U},null,8,["activeType"]),n(Sa,{targetRef:l.value,size:"small"},null,8,["targetRef"])])]),_:1},8,["title"]),n(ke,{class:"p-0 pt-0 relative"},{default:d(()=>[c.value==="world"?(r(),h("div",AC,[n(at,{tag:"button",size:"small",onClick:G},{default:d(()=>[n(Y,{name:"Plus"})]),_:1}),n(at,{tag:"button",size:"small",onClick:Z},{default:d(()=>[n(Y,{name:"Minus"})]),_:1}),n(at,{tag:"button",size:"small",onClick:ne},{default:d(()=>[n(Y,{name:"Reload"})]),_:1}),n(at,{tag:"button",size:"small lg:hidden",onClick:ce},{default:d(()=>[n(Y,{name:"Eye"})]),_:1})])):x("",!0),c.value==="bar"?(r(),h("div",pC,[n(at,{tag:"button",size:"small",onClick:ne},{default:d(()=>[n(Y,{name:"Reload"})]),_:1})])):x("",!0),o("div",{class:"fct-chart-wrap rounded-[0px] bg-transparent",ref_key:"chartRef",ref:l},null,512)]),_:1})]),_:1}),n(A(Sm),{modelValue:i.value,"onUpdate:modelValue":ie[0]||(ie[0]=J=>i.value=J),title:ue.$t("Order Heat Map"),class:"country-heat-map-dialog"},{default:d(()=>[o("div",{class:"fct-chart-wrap",ref_key:"modalChartRef",ref:s},null,512)]),_:1},8,["modelValue","title"])]))}},mC=nt(fC,[["__scopeId","data-v-36a900c8"]]),hC={class:"fct-report-card"},_C={key:0,class:"fct-report-card-header"},vC={key:0,class:"flex items-center gap-2"},gC={class:"title"},yC={class:"actions"},bC={class:"fct-report-card-body flex h-full"},wC={class:"w-full"},Gn={__name:"ReportCard",props:{cardOptions:{type:Object,default:()=>({heading:"",linkButtonText:"",linkButtonUrl:"",headingIcon:{type:Boolean,default:!1}})}},setup(e){return(t,a)=>{const l=C("router-link");return r(),h("div",hC,[e.cardOptions.heading||e.cardOptions.linkButtonText?(r(),h("div",_C,[e.cardOptions.heading?(r(),h("div",vC,[e.cardOptions.headingIcon?(r(),E(at,{key:0,size:"x-small",bg:"danger",soft:""},{default:d(()=>[n(Y,{name:"FailedCircle"})]),_:1})):x("",!0),o("h4",gC,m(e.cardOptions.heading),1)])):x("",!0),o("div",yC,[e.cardOptions.linkButtonText?(r(),E(l,{key:0,to:`/${e.cardOptions.linkButtonUrl}`,class:"link"},{default:d(()=>[R(m(t.$t(e.cardOptions.linkButtonText)),1)]),_:1},8,["to"])):x("",!0),ga(t.$slots,"action")])])):x("",!0),o("div",bC,[o("div",wC,[ga(t.$slots,"default")])])])}}},CC={key:0,class:"fct-report-sold-product-list has-scroll"},kC={class:"list-left-content"},BC={class:"list-title"},xC={class:"list-title-inner"},SC={class:"list-id"},FC={class:"list-right-content"},$C=["innerHTML"],EC={class:"list-price"},UC={__name:"RecentOrders",setup(e){const t=rl.data;return(a,l)=>{const s=C("router-link");return r(),E(Gn,{class:"top-sold-products","card-options":{heading:A(u)("Recent Orders"),linkButtonText:A(u)("View All"),linkButtonUrl:"orders"}},{default:d(()=>{var i,c;return[((c=(i=A(t))==null?void 0:i.recentOrders)==null?void 0:c.length)>0?(r(),h("ul",CC,[(r(!0),h(P,null,te(A(t).recentOrders,p=>(r(),h("li",{key:p.id},[n(s,{class:"no-underline",to:{name:"view_order",params:{order_id:p.id}}},{default:d(()=>[o("div",kC,[o("div",BC,[o("div",xC,m(p.customer_name)+" #"+m(A(sa)(p.id)),1),o("div",SC,[n(Pa,{"date-time":p.created_at},null,8,["date-time"])])])]),o("div",FC,[o("div",{class:"list-value",innerHTML:A(ft).scaled(p.total_amount)},null,8,$C),o("div",EC,m(A(sa)(p.order_items_count))+" "+m(A(u)("Items")),1)])]),_:2},1032,["to"])]))),128))])):(r(),E(Ct,{key:1,icon:"Empty/ListView","has-dark":!0,text:A(u)("Currently there is no item!")},null,8,["text"]))]}),_:1},8,["card-options"])}}},IC={key:0},QC={key:1,class:"fc_dashboard_onboarding_wrap"},DC={class:"fc_dashboard_onboarding_title"},VC={class:"fc_dashboard_onboarding_lists"},TC=["href"],MC={class:"circle-shape"},LC={class:"fc_dashboard_onboarding_item__title"},RC={__name:"Onboarding",emits:["status"],setup(e,{emit:t}){const a=T(0),l=T(!1);Jt().ctx;const s=T([]),i=T(!0);T(localStorage.getItem("started_content_collapse")==="true"||!1),K(()=>{const _=Object.keys(s.value).length;return _?Math.round(a.value/_*100):0});const c=_=>_.hash_id?_.url+"#"+_.hash_id:_.url,p=oi("dashboardTogglePageNotification"),f=t;return Ie(async()=>{l.value=!0,Ae.get("dashboard").then(_=>{var y,v;s.value=_.data.steps,a.value=_.data.completed,i.value=Object.keys(s.value).length!==a.value,f("status",{completed:!i.value}),l.value=!1;let g=((y=s.value.page_setup)==null?void 0:y.completed)||!1;p&&p(!g,((v=s.value.page_setup)==null?void 0:v.url)||"")}).catch(_=>{l.value=!1})}),(_,g)=>{const y=C("el-skeleton"),v=C("Check"),w=C("el-icon");return i.value?(r(),h("div",IC,[l.value?(r(),E(y,{key:0,rows:3,animated:""})):(r(),h("div",QC,[o("h3",DC,m(_.$t("Getting Started")),1),o("div",VC,[(r(!0),h(P,null,te(s.value,(k,b)=>(r(),h("a",{key:b,href:c(k),class:de([k.completed===!0?"active":"","fc_dashboard_onboarding_item"])},[o("span",MC,[k.completed===!0?(r(),E(w,{key:0},{default:d(()=>[n(v)]),_:1})):x("",!0)]),o("div",LC,m(k.title),1)],10,TC))),128))])]))])):x("",!0)}}},OC={class:"fct-dashboard-recent-activities-wrap"},PC={class:"fct-dashboard-recent-activities__header"},HC={class:"fct-dashboard-recent-activities__header_title"},NC={class:"fct-dashboard-recent-activities__header_desc"},KC={key:0,class:"fct-dashboard-recent-activities__body"},GC={class:"content"},zC={class:"title"},jC=["onClick"],qC={class:"date"},YC=["innerHTML"],WC={class:"created_by"},JC={key:1,class:"fct-dashboard-recent-activities__empty"},XC={class:"fct-dashboard-recent-activities__empty_text"},ZC={__name:"RecentActivity",props:{activities:{type:Array,default:()=>[]},showManageActivity:{type:Boolean,default:!1}},emits:["reload"],setup(e,{emit:t}){const a=sl(),l=T([{label:kl("All","Activity filter button"),value:"all"},{label:kl("Today","Activity filter button"),value:"today"},{label:kl("Yesterday","Activity filter button"),value:"yesterday"},{label:kl("This Week","Activity filter button"),value:"this_week"}]),s=T("all"),i=()=>{switch(s.value){case"all":return kl("all","Activity filter, mid-sentence");case"today":return kl("today","Activity filter, mid-sentence");case"yesterday":return kl("yesterday","Activity filter, mid-sentence");case"this_week":return kl("this week","Activity filter, mid-sentence");default:return s.value}},c=()=>{i(),rl.getRecentActivities({groupKey:s.value})},p={Order:"orders/view",Payment:"orders/view",PayPal:"orders/view",Product:"products/view",Customer:"customers/view",Coupon:"coupons/view",Subscription:"subscriptions/view",Tax:"store/settings"},f={order:{name:"view_order",param:"order_id",permission:"orders/view"},payment:{name:"view_order",param:"order_id",permission:"orders/view"},product:{name:"view_product",param:"product_id",permission:"products/view"},customer:{name:"view_customer",param:"customer_id",permission:"customers/view"},coupon:{name:"view_coupon",param:"coupon_id",permission:"coupons/view"},subscription:{name:"view_subscription",param:"subscription_id",permission:"subscriptions/view"}},_=v=>{var b;let w=(b=v==null?void 0:v.module_name)==null?void 0:b.toLowerCase();const k=f[w];k&&v.module_id&&g(v)&&a.push({name:k.name,params:{[k.param]:v.module_id}})},g=v=>{if(!v.module_name)return!0;const w=dt.get(p,da.capitalize(v.module_name));return w?Vn.has(w):!1},y=K(()=>rl.data.recentActivities.filter(v=>g(v)));return Ie(()=>{c()}),(v,w)=>{const k=C("el-radio-button"),b=C("el-radio-group");return r(),h("div",OC,[o("div",PC,[o("h4",HC,m(A(u)("Recent Activities")),1),o("p",NC,[s.value==="all"?(r(),h(P,{key:0},[R(m(A(u)("%1$s new activities",A(sa)(y.value.length))),1)],64)):(r(),h(P,{key:1},[R(m(A(u)("%1$s new activities %2$s",A(sa)(y.value.length),i())),1)],64))]),n(b,{class:"fct-dashboard-recent-activities__header_filter",modelValue:s.value,"onUpdate:modelValue":w[0]||(w[0]=S=>s.value=S),onChange:c,size:"large"},{default:d(()=>[(r(!0),h(P,null,te(l.value,(S,$)=>(r(),E(k,{key:$,label:S.label,value:S.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),y.value.length?(r(),h("div",KC,[(r(!0),h(P,null,te(y.value,(S,$)=>{var D;return r(),h("div",{key:$,class:"fct-dashboard-recent-activities__item has-icon"},[w[1]||(w[1]=o("span",{class:"icon"},[o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{d:"M12.8499 9.92029L13.5711 10.3529C13.6156 10.3795 13.6524 10.4172 13.678 10.4623C13.7036 10.5075 13.717 10.5584 13.717 10.6103C13.717 10.6621 13.7036 10.7131 13.678 10.7582C13.6524 10.8033 13.6156 10.841 13.5711 10.8677L8.30911 14.0249C8.21579 14.081 8.10897 14.1106 8.00011 14.1106C7.89124 14.1106 7.78443 14.081 7.69111 14.0249L2.42911 10.8677C2.38462 10.841 2.34779 10.8033 2.32222 10.7582C2.29664 10.7131 2.2832 10.6621 2.2832 10.6103C2.2832 10.5584 2.29664 10.5075 2.32222 10.4623C2.34779 10.4172 2.38462 10.3795 2.42911 10.3529L3.15031 9.92029L8.00011 12.8303L12.8499 9.92029ZM12.8499 7.10029L13.5711 7.53289C13.6156 7.55952 13.6524 7.59723 13.678 7.64235C13.7036 7.68746 13.717 7.73843 13.717 7.79029C13.717 7.84214 13.7036 7.89311 13.678 7.93822C13.6524 7.98334 13.6156 8.02105 13.5711 8.04769L8.00011 11.3903L2.42911 8.04769C2.38462 8.02105 2.34779 7.98334 2.32222 7.93822C2.29664 7.89311 2.2832 7.84214 2.2832 7.79029C2.2832 7.73843 2.29664 7.68746 2.32222 7.64235C2.34779 7.59723 2.38462 7.55952 2.42911 7.53289L3.15031 7.10029L8.00011 10.0103L12.8499 7.10029ZM8.30851 1.58569L13.5711 4.74289C13.6156 4.76952 13.6524 4.80724 13.678 4.85235C13.7036 4.89746 13.717 4.94843 13.717 5.00029C13.717 5.05214 13.7036 5.10311 13.678 5.14822C13.6524 5.19334 13.6156 5.23105 13.5711 5.25769L8.00011 8.60029L2.42911 5.25769C2.38462 5.23105 2.34779 5.19334 2.32222 5.14822C2.29664 5.10311 2.2832 5.05214 2.2832 5.00029C2.2832 4.94843 2.29664 4.89746 2.32222 4.85235C2.34779 4.80724 2.38462 4.76952 2.42911 4.74289L7.69111 1.58569C7.78443 1.52962 7.89124 1.5 8.00011 1.5C8.10897 1.5 8.21579 1.52962 8.30911 1.58569H8.30851ZM8.00011 2.79949L4.33231 5.00029L8.00011 7.20109L11.6679 5.00029L8.00011 2.79949Z",fill:"#335CFF"})])],-1)),o("div",GC,[o("h3",zC,[f[(D=S.module_name)==null?void 0:D.toLowerCase()]?(r(),h("span",{key:0,onClick:F=>_(S),class:"cursor-pointer"},m(S.title||"--"),9,jC)):(r(),h(P,{key:1},[R(m(S.title||"--"),1)],64)),o("span",qC,[n(Pa,{"date-time":S.created_at},null,8,["date-time"])])]),o("p",{innerHTML:S.content,class:"description"},null,8,YC),o("span",WC,m(A(u)("By %s",S.created_by)),1)])])}),128))])):(r(),h("div",JC,[o("div",XC,m(A(u)("No activity found.")),1)]))])}}},e2="https://wordpress.org/support/plugin/fluent-cart/reviews/#new-post",Cp="fct_review_prompt_hidden",kp=()=>{try{return window.localStorage}catch{return null}},t2=(e=kp())=>{try{return!!e&&e.getItem(Cp)==="yes"}catch{return!1}},a2=(e=kp())=>{try{return e?(e.setItem(Cp,"yes"),!0):!1}catch{return!1}},l2=["aria-label"],s2={class:"fct-review-prompt__text"},qu="fct-review-prompt-title",n2={__name:"ReviewPrompt",setup(e){const t=T(t2()),a=()=>{t.value=!0,a2()};return(l,s)=>{const i=C("el-button");return t.value?x("",!0):(r(),h("div",{key:0,class:"fct-review-prompt",role:"region","aria-labelledby":qu},[o("button",{type:"button",class:"fct-review-prompt__close","aria-label":A(u)("Dismiss feedback request"),onClick:a},[n(Y,{name:"Cross"})],8,l2),o("h3",{id:qu,class:"fct-review-prompt__title"},m(A(u)("How's FluentCart working for you?")),1),o("p",s2,m(A(u)("A short review on WordPress.org helps other store owners decide, and tells us what to improve.")),1),n(i,{tag:"a",href:A(e2),target:"_blank",rel:"noopener noreferrer",onClick:a},{default:d(()=>[R(m(A(u)("Share your feedback"))+" ",1),n(Y,{name:"External",class:"ml-1.5 w-3.5 h-3.5"})]),_:1},8,["href"])]))}}},o2={class:"fc_dashboard_sidebar bg-white dark:bg-dark-700 p-5 rounded"},i2={__name:"SideBar",setup(e){const t=T(!1),a=l=>{t.value=!!l.completed};return(l,s)=>(r(),h("div",o2,[n(Ot,{permission:"is_super_admin"},{default:d(()=>[n(RC,{onStatus:a}),t.value?(r(),E(n2,{key:0})):x("",!0)]),_:1}),n(ZC,{onReload:s[0]||(s[0]=()=>{})})]))}},r2={class:"fct-product-create"},d2={class:"fct-product-step"},u2={class:"fct-product-item-selector"},c2=["onClick"],A2={class:"fct-product-item-selector-content"},p2={class:"fct-bundle-product-condition"},f2={class:"condition-text"},m2={class:"dialog-footer"},Ci={__name:"AddProductModal",props:{customModal:String},emits:["process_custom","update:createProductModal"],setup(e,{emit:t}){const a=e,l=t,s=sl(),i=ze.get("variation_types",{}),c=T({post_title:"",post_content:"",post_excerpt:"",post_date:new Date,post_status:"draft",detail:{fulfillment_type:"digital",variation_type:"simple",manage_stock:"0",manage_downloadable:"0",other_info:{use_pricing_table:"yes",group_pricing_by:"repeat_interval",active_editor:"wp-editor",sold_individually:"no"}}}),p=[{type:"physical",title:u("Physical Product"),icon:"Gift"},{type:"digital",title:u("Digital Product"),icon:"Code"}],f=T(!1),_=T(null),g=w=>{c.value.detail.fulfillment_type=w},y=()=>{f.value=!0,Ae.post("products",{...c.value}).then(w=>{if(q.success(w.message),a.customModal==="order_modal"){const k={id:w.data.product_variants.id,object_id:w.data.product_variants.post_id,variation_id:w.data.product_variants.id,item_name:w.data.product_variants.variation_title,item_price:w.data.product_variants.item_price,quantity:1,stock:100,object_type:w.data.product_details.fulfillment_type,item_total:w.data.product_variants.item_price,line_total:w.data.product_variants.item_price,tax_amount:0,discount_total:0};l("process_custom",k),l("update:createProductModal",!1)}else s.push({name:"product_edit",params:{product_id:w.data.ID}})}).catch(w=>{var k;w.status_code=="422"?q.validationErrors(w):q.error((k=w.data)==null?void 0:k.message)}).finally(()=>{f.value=!1})},v=w=>{w.stopPropagation(),w.preventDefault(),y()};return Ie(()=>{xe(()=>{setTimeout(()=>{var w;(w=_.value)==null||w.focus()},10)})}),(w,k)=>{const b=C("el-input"),S=C("el-form-item"),$=C("el-option"),D=C("el-select"),F=C("el-checkbox"),B=C("el-form"),U=C("el-button");return r(),h("div",r2,[o("div",d2,[n(B,{"label-position":"top",model:c.value,"require-asterisk-position":"right"},{default:d(()=>[n(S,{label:c.value.detail.other_info.is_bundle_product==="yes"?A(u)("Bundle Title"):A(u)("Product Title"),required:""},{default:d(()=>[n(b,{type:"text",modelValue:c.value.post_title,"onUpdate:modelValue":k[0]||(k[0]=Q=>c.value.post_title=Q),placeholder:c.value.detail.other_info.is_bundle_product==="yes"?A(u)("Bundle Title"):A(u)("Product Title"),minlength:"3",maxlength:"200","show-word-limit":"",autofocus:"",ref_key:"fcProductTitle",ref:_,onKeydown:xa(v,["enter"])},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),e.customModal!=="order_modal"?(r(),E(S,{key:0,label:A(u)("Variation Type")},{default:d(()=>[n(D,{modelValue:c.value.detail.variation_type,"onUpdate:modelValue":k[1]||(k[1]=Q=>c.value.detail.variation_type=Q),placeholder:A(u)("Select Variation Type"),class:"w-full"},{default:d(()=>[(r(!0),h(P,null,te(A(i),(Q,V)=>(r(),E($,{key:V,label:Q,value:V},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])):x("",!0),n(S,null,{default:d(()=>[o("ul",u2,[(r(),h(P,null,te(p,Q=>o("li",{key:Q.type,class:de({active:Q.type===c.value.detail.fulfillment_type}),onClick:V=>g(Q.type)},[o("div",A2,[n(Y,{name:Q.icon},null,8,["name"]),R(" "+m(Q.title),1)]),k[3]||(k[3]=o("div",{class:"fct-product-item-selector-dot-wrap"},[o("span",{class:"fct-product-item-selector-dot"})],-1))],10,c2)),64))])]),_:1}),n(S,null,{default:d(()=>[o("div",p2,[n(F,{modelValue:c.value.detail.other_info.is_bundle_product,"onUpdate:modelValue":k[2]||(k[2]=Q=>c.value.detail.other_info.is_bundle_product=Q),"true-value":"yes","false-value":"no"},{default:d(()=>[R(m(A(u)("Add as a Bundle")),1)]),_:1},8,["modelValue"]),o("span",f2,m(A(u)("Combine multiple items into one package")),1)])]),_:1})]),_:1},8,["model"])]),o("div",m2,[n(U,{disabled:!c.value.post_title||f.value,loading:f.value,onClick:y,type:"primary"},{default:d(()=>[R(m(f.value?A(u)("Creating"):A(u)("Add Product")),1)]),_:1},8,["disabled","loading"])])])}}};class yd{constructor(t=new Date){this.date=t}getHours(){return this.date.getHours()}static greeting(){const t=new yd().getHours();if(t>=5&&t<12)return u("Good morning");if(t>=12&&t<17)return u("Good afternoon");if(t>=17&&t<21)return u("Good evening");{const a=[u("Step into the moonlight!"),u("Evening vibes!"),u("The night's still young!")];return a[Math.floor(Math.random()*a.length)]}}}const h2={class:"fct-current-user-info-wrap"},_2={class:"fct-current-user-info-content"},v2={class:"image"},g2=["src","alt"],y2={class:"content"},b2={key:0,class:"fct-current-user-info-action"},w2={__name:"CurrentUserInfo",setup(e){const t=T(!1),a=T(ze.get("me")),l=()=>ze.get("shop.store_name"),s=ze.get("total_products_count");return(i,c)=>{const p=C("el-button"),f=C("el-dialog");return r(),h("div",h2,[o("div",_2,[o("div",v2,[o("img",{src:a.value.avatar,alt:a.value.full_name},null,8,g2)]),o("div",y2,[o("h4",null,m(A(yd).greeting())+" "+m(a.value.full_name)+" 👋🏻",1),o("p",null,m(A(u)("Welcome to %1$s",l())),1)])]),n(Ot,{permission:"products/create"},{default:d(()=>[A(s)==0?(r(),h("div",b2,[n(p,{onClick:c[0]||(c[0]=_=>t.value=!0),type:"primary"},{default:d(()=>[R(m(A(u)("Add Product")),1)]),_:1})])):x("",!0)]),_:1}),n(f,{"append-to-body":!0,modelValue:t.value,"onUpdate:modelValue":c[1]||(c[1]=_=>t.value=_),onClose:c[2]||(c[2]=_=>t.value=!1),title:A(u)("Add New Product")},{default:d(()=>[n(Ci)]),_:1},8,["modelValue","title"])])}}};class C2{constructor(){Pe(this,"operatorMap",{"!==":"matchNotEqual","!=":"matchNotEqual"});Pe(this,"defaultMatcherMethod",null)}getMatchingMethod(t){return t==="=="||t==="==="?"matchEqual":this.operatorMap.hasOwnProperty(t)?this.operatorMap[t]:this.defaultMatcherMethod}defaultMatcher(t,a,l){}matchEqual(t,a,l){return l==="==="?t===a:t==a}matchNotEqual(t,a,l){return l==="!=="?t!==a:t!=a}matchContains(t,a,l){return a instanceof String||Array.isArray(a)?a.includes(t):typeof a=="object"?a.hasOwnProperty(t):!1}matchIn(t,a,l){return this.matchContains(t,a,l)}matchNotIn(t,a,l){return!this.matchContains(t,a,l)}}class k2{constructor(){Pe(this,"modifierMap",{"+":"applyAddition","-":"applySubstruction"});Pe(this,"defaultModifierMethod",null)}getModificationMethod(t){return t==="=="||t==="==="?"matchEqual":this.modifierMap.hasOwnProperty(t)?this.modifierMap[t]:this.defaultModifierMethod}applyAddition(t,a,l,s,i){return t+a}}class B2{constructor(t,a){Pe(this,"value");Pe(this,"operator");this.value=t,this.operator=a}setOperator(t){return this.operator=t,this}setValue(t){return this.value=t,this}static make(t,a){return new this(t,a)}build(){return{operator:this.operator,value:this.value instanceof Or?this.value.setModifiers([]).build():this.value}}}class Or{constructor(t,a){Pe(this,"accessor");Pe(this,"modifiers");this.accessor=t,this.modifiers=[],this.setModifiers(a)}setAccessor(t){return this.accessor=t,this}addModifier(t){return this.modifiers.push(t),this}setModifiers(t){return this.modifiers=Array.isArray(t)?t:this.modifiers,this}static make(t,a){return new this(t,a)}build(){let t=[];return Array.isArray(this.modifiers)&&this.modifiers.length>0&&(t=this.modifiers.map(a=>a instanceof B2?a.build():a)),t.length>0?{accessor:this.accessor,modifiers:t}:{accessor:this.accessor}}}class Is{constructor(t,a,l,s,i){Pe(this,"conditionType");Pe(this,"conditions");Pe(this,"key");Pe(this,"operator");Pe(this,"value");this.key=t,this.value=a,this.operator=l,this.conditions=[],this.conditionType=this.buildConditionType(s),this.setConditions(i)}static make(t,a,l,s){return new this(t,a,l,s)}setConditionType(t){return this.conditionType=this.buildConditionType(t),this}buildConditionType(t){return t==="or"||t==="|"?"or":"and"}setOperator(t){return this.operator=t,this}setKey(t){return this.key=t,this}setValue(t){return this.value=t,this}addCondition(t){return this.conditions.push(t),this}setConditions(t){return this.conditions=Array.isArray(t)||t instanceof Is||typeof t=="function"?t:this.conditions,this}build(){if(Array.isArray(this.conditions)&&this.conditions.length>0){let l=[];return l=this.conditions.map(s=>s instanceof Is?s.build.bind(s)():s),{condition_type:this.conditionType,conditions:l}}const t=this.key instanceof Or?this.key.build():this.key,a=this.value instanceof Or?this.value.build():this.value;return{key:t,operator:this.operator,value:a}}}class x2{constructor(t,a){Pe(this,"data");Pe(this,"conditions");Pe(this,"stateKey");Pe(this,"matcher");Pe(this,"modifier");this.data=a,this.stateKey=t,this.matcher=new C2,this.modifier=new k2}match(t,a,l,s=!0){let i="",c=this.matcher.getMatchingMethod(a);return c!=null?i=c:i=da.camel("match"+a),i in this.matcher&&typeof this.matcher[i]=="function"?this.matcher[i](t,l,a,s):s}evaluate(t,a="and"){if(t instanceof Is){const s=t.build.bind(t)();s.hasOwnProperty("conditions")?(t=s.conditions,a=s.condition_type):t=[s]}a=a==="or"?"or":"and";let l=a==="and";if(typeof t=="function")return t(this.stateKey,this.data);if(!Array.isArray(t))return!0;for(let s of t){let i=null;if(Array.isArray(dt.get(s,"conditions")))i=this.evaluate(s.conditions,dt.get(s,"condition_type","and"));else{if(s.key===null||s.key===void 0){l=!0;continue}i=this.applyCondition(s)}l=a==="and"?l&&i:l||i}return l}applyCondition(t){let a="",l=null;typeof t.key=="object"?a=dt.resolvePath(this.stateKey,dt.get(t,"key.accessor")):a=dt.resolvePath(this.stateKey,t.key);let s=dt.get(this.data,a);if(typeof t.value=="object"){const i=dt.resolvePath(this.stateKey,dt.get(t,"value.accessor"));l=dt.get(this.data,i)}else l=t.value;return s=this.applyModification(s,t.key.modifiers,this.stateKey),l=this.applyModification(l,t.value.modifiers,this.stateKey),this.match(s,t.operator,l)}applyModification(t,a,l){return Array.isArray(a)&&a.forEach(s=>{let i=s.operator,c="",p=this.modifier.getModificationMethod(i);if(p!=null?c=p:c=da.camel("apply"+i),c in this.modifier&&typeof this.modifier[c]=="function"){let f=s.value;typeof f=="object"&&f!==null&&(f=dt.getByPath(this.data,l,dt.get(f,"accessor"))),t=this.modifier[c](t,f,i,l,this.data)}}),t}}class Bp{constructor(){Pe(this,"_conditionType","and");Pe(this,"_conditions",null)}conditionType(t){return this._conditionType=t,this}conditions(t){return this._conditions=Array.isArray(t)||t instanceof Is||typeof t=="function"?t:this._conditions,this}visibleIf(t){return this._conditions=t,this}buildConditions(t){return Array.isArray(t)&&t.length>0?t.map(a=>a instanceof Is?a.build.bind(a)():a):t}}class xp{constructor(){Pe(this,"_events",{})}event(t,a){return this._events[t]=a,this}}class jo{constructor(t=""){this._component="",this._affix=t}static component(t){const a=new jo;return a._component="Affix/"+t,a}static make(t=""){return new this(t)}build(){return this._component.length>0?{component:this._component}:this._affix}}class Pr{constructor(t,a="input"){if(typeof t!="string"||t.length<1)throw new Error("Key is Required");this._key=t,this._type=a,this._class="",this._id="",this._name="",this._label="",this._value="",this._placeholder="",this._min="",this._max="",this._prefix="",this._hasPrefix=!1,this._hasSuffix=!1,this._suffix="",ms.install(this,vA),ms.install(this,xp),ms.install(this,Bp),this._wrapperClass=""}static make(t,a="input"){return new this(t,a)}wrapperClass(t){return this._wrapperClass=t,this}type(t){return this._type=t,this}class(t){return this._class=t,this}id(t){return this._id=t,this}name(t){return this._name=t,this}label(t){return this._label=t,this}value(t){return this._value=t,this}placeholder(t){return this._placeholder=t,this}min(t){return this._min=t,this}max(t){return this._max=t,this}prefix(t){return this._hasPrefix=!0,this._prefix=t,this}suffix(t){this._hasSuffix=!0,this._suffix=t}onChange(t){return this._onChangeCallback=t,this}onKeyPress(t){return this._onKeyPressCallback=t,this}onKeyUp(t){return this._onKeyUpCallback=t,this}onKeyDown(t){return this._onKeyDownCallback=t,this}build(){return this._conditions,Array.isArray(this._conditions)&&this._conditions.length>0&&this._conditions.map(t=>t instanceof Is?t.build.bind(t)():t),this._attributes=typeof this._attributes=="object"?this._attributes:{},this._attributes.min=this._min,this._attributes.max=this._max,this._attributes.placeholder=this._placeholder,this._attributes.type=this._type,{key:this._key,type:this._type,class:this._class,id:this._id,name:this._name??u(da.headline(this._key)),label:this._label??u(da.headline(this._key)),value:this._value,condition_type:this._conditionType,conditions:this.buildConditions(this._conditions),hasSuffix:this._hasSuffix,hasPrefix:this._hasPrefix,suffix:this._suffix instanceof jo?this._suffix.build():this._suffix,prefix:this._prefix instanceof jo?this._prefix.build():this._prefix,min:this._min,max:this._max,placeholder:this._placeholder,attributes:this._attributes,events:this._events,wrapperClass:this._wrapperClass}}}class Hr{constructor(t){if(typeof t!="string"||t.length<1)throw new Error("Key is Required");this._type="section",this._key=t,this._schema=[],this._class="",this.disable_nesting=!0,ms.install(this,vA),ms.install(this,xp),ms.install(this,Bp)}static make(t){return new this(t)}enableNesting(){return this.disable_nesting=!1,this}disableNesting(){return this.disable_nesting=!0,this}class(t){return this._class=t,this}get type(){return this._type}set type(t){if(typeof t=="string")this._type=t;else throw new TypeError("Type must be a string.")}get schema(){return this._schema}setSchema(t){return this._schema=t,this}build(){const t=rn.build(this.schema);return{key:this._key,type:this._type,class:this._class,schema:t,disable_nesting:this.disable_nesting,condition_type:this._conditionType,conditions:this.buildConditions(this._conditions),attributes:this._attributes}}}class Yu{constructor(t,a){if(typeof t!="string"||t.length<1)throw new Error("Key is Required");ms.install(this,Pr,{key:t}),ms.install(this,Hr,{key:t}),this._component=a,this._key=t}static make(t,a=""){return new this(t,a)}component(t){return this._component=t,this}value(t){return this._value=t,this}build(){const t=rn.build(this.schema??{});return{type:this._type,class:this._class,id:this._id,name:this._name??u(da.headline(this._key)),label:this._label??u(da.headline(this._key)),value:this._value,condition_type:this._conditionType,conditions:this.buildConditions(this._conditions),hasSuffix:this._hasSuffix,hasPrefix:this._hasPrefix,suffix:this._suffix,prefix:this._prefix,placeholder:this._placeholder,attributes:this._attributes,onChange:this._onChangeCallback,onKeyUp:this._onKeyUpCallback,onKeyDown:this._onKeyDownCallback,type:this._type,class:this._class,schema:t,disable_nesting:this.disable_nesting,condition_type:this._conditionType,conditions:this.buildConditions(this._conditions),type:"custom",component:this._component,key:this._key}}}class rn{static build(t){return Array.isArray(t)?rn.buildFromArray(t):typeof t=="object"?rn.buildFromObject(t):t}static buildFromObject(t){let a={};return Object.keys(t).forEach((l,s)=>{const i=t[l];i instanceof Pr||i instanceof Hr||i instanceof Yu?a[l]=i.build.bind(i)():a[l]=t[l]}),a}static buildFromArray(t){let a={};return Array.isArray(t)&&t.forEach(l=>{if(l instanceof Pr||l instanceof Hr||l instanceof Yu){let s=l.build.bind(l)();a[s.key]=s}else a[l.key]=l}),a}}class S2 extends tl{constructor(){super(...arguments);Pe(this,"data",{schema:{},defaults:{},_originalDefaults:{},values:{},initialized:!1,hasChange:!1,validationErrors:{},onChangeCallback:[]});Pe(this,"nestedFormLayouts",["section","tab","tab-pane","grid"]);Pe(this,"ignorableFormLayouts",["grid"])}get hasChange(){return this.data.hasChange}setSchema(a){return this.data.schema=rn.build(a??{}),this.initForm(),this}setDefaults(a){return this.data.defaults=a||{},this.data._originalDefaults=JSON.parse(JSON.stringify(this.data.defaults)),this.initForm(),this}get schema(){return this.data.schema}get values(){return this.data.values}get isReady(){return this.data.initialized}initForm(){if(typeof this.data.schema!="object"||typeof this.data.defaults!="object")throw new Error("You need to set Schema and Defaults First");this.setValues(),this.data.initialized=!0}setValues(){this.data.values=this.ensureNestedDataProperties(this.data.schema,this.data.defaults)}getState(){return this.data.values}setValidationErrors(a){this.data.validationErrors=a||{}}hasValidationError(a){return(this.data.validationErrors??{}).hasOwnProperty(a)}getValidationError(a){return this.data.validationErrors[a]}ensureNestedDataProperties(a,l={}){return Object.keys(a).reduce((s,i)=>{const c=a[i];if(c.type==="html")return s;if(this.nestedFormLayouts.includes(c.type??""))if(c.disable_nesting===!0){const p=this.ensureNestedDataProperties(c.schema??{},l??{});s={...s,...p}}else s[i]=this.ensureNestedDataProperties(c.schema??{},l[i]??{});else s[i]=l[i]??c.value??"";return s},{})}isVisible(a,l){return a.hasOwnProperty("conditions")?new x2(l,this.values).evaluate(dt.get(a,"conditions"),dt.get(a,"condition_type","and")):!0}triggerChange(a){for(let l of this.data.onChangeCallback)l(a)}onDataChanged(a){this.data.onChangeCallback.push(a)}setValue(a,l){dt.set(this.data.values,a,l),this.data.hasChange=!0,this.triggerChange(this.data.values)}reset(a=!0){if(!this.data.schema||!this.data._originalDefaults)throw new Error("Form is not initialized");const l=a?this.data._originalDefaults:this.data.defaults;return this.data.values=this.ensureNestedDataProperties(this.data.schema,JSON.parse(JSON.stringify(l))),this.data.validationErrors={},this.data.hasChange=!1,this.data.initialized=!0,this}}function bd(){return S2.init()}const F2=["innerHTML"],Nr={__name:"FieldNote",props:{note:String},setup(e){return(t,a)=>(r(),h("div",{class:"form-note",innerHTML:e.note},null,8,F2))}},$2=Object.freeze(Object.defineProperty({__proto__:null,default:Nr},Symbol.toStringTag,{value:"Module"})),Wu=Object.assign({name:"ValidationError"},{__name:"ValidationErrorNew",props:{errorKey:String,form:{type:Object,required:!0}},setup(e){return(t,a)=>e.form.hasValidationError(e.errorKey)?(r(),h("div",{key:0,class:de(`fluent-cart-admin-validation-error-wrapper ${e.errorKey}`)},[(r(!0),h(P,null,te(e.form.getValidationError(e.errorKey),(l,s)=>(r(),h("span",{class:"fluent-cart-admin-validation-error",key:l.toLowerCase().replace(/\s/g,"")},m(l),1))),128))],2)):x("",!0)}}),Sp={__name:"Resolver",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},label:{type:String},attribute:{type:Object},callback:{type:Function}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue"),a=Object.assign({"./Affix/Test.vue":()=>Yt(()=>import("./chunks/Test.js?ver=1.6.5"),[],import.meta.url),"./Base/Inputs/Checkbox.vue":()=>Yt(()=>Promise.resolve().then(()=>H2),void 0,import.meta.url),"./Base/Inputs/ColorPicker.vue":()=>Yt(()=>Promise.resolve().then(()=>ak),void 0,import.meta.url),"./Base/Inputs/Date.vue":()=>Yt(()=>Promise.resolve().then(()=>lk),void 0,import.meta.url),"./Base/Inputs/FieldNote.vue":()=>Yt(()=>Promise.resolve().then(()=>$2),void 0,import.meta.url),"./Base/Inputs/Input.vue":()=>Yt(()=>Promise.resolve().then(()=>z2),void 0,import.meta.url),"./Base/Inputs/Media.vue":()=>Yt(()=>Promise.resolve().then(()=>Fk),void 0,import.meta.url),"./Base/Inputs/RadioGroup.vue":()=>Yt(()=>Promise.resolve().then(()=>K2),void 0,import.meta.url),"./Base/Inputs/RemoteSearchableSelect.vue":()=>Yt(()=>Promise.resolve().then(()=>ik),void 0,import.meta.url),"./Base/Inputs/Select.vue":()=>Yt(()=>Promise.resolve().then(()=>ok),void 0,import.meta.url),"./Base/Inputs/Switch.vue":()=>Yt(()=>Promise.resolve().then(()=>P2),void 0,import.meta.url),"./Base/Inputs/Time.vue":()=>Yt(()=>Promise.resolve().then(()=>sk),void 0,import.meta.url),"./Base/Layouts/FormGrid.vue":()=>Yt(()=>Promise.resolve().then(()=>U2),void 0,import.meta.url),"./Base/Layouts/FormSection.vue":()=>Yt(()=>Promise.resolve().then(()=>M2),void 0,import.meta.url),"./Base/Layouts/FormTab.vue":()=>Yt(()=>Promise.resolve().then(()=>L2),void 0,import.meta.url),"./Base/Layouts/FormTabPane.vue":()=>Yt(()=>Promise.resolve().then(()=>R2),void 0,import.meta.url),"./Coupon/BuyProducts.vue":()=>Yt(()=>import("./chunks/BuyProducts.js?ver=1.6.5"),[],import.meta.url),"./Coupon/Categories.vue":()=>Yt(()=>import("./chunks/Categories.js?ver=1.6.5"),[],import.meta.url),"./Coupon/Code.vue":()=>Yt(()=>import("./chunks/Code.js?ver=1.6.5"),[],import.meta.url),"./Coupon/GetProducts.vue":()=>Yt(()=>import("./chunks/GetProducts.js?ver=1.6.5"),[],import.meta.url),"./Coupon/IncludeExclude/Categories.vue":()=>Yt(()=>import("./chunks/Categories2.js?ver=1.6.5"),[],import.meta.url),"./Coupon/IncludeExclude/Product.vue":()=>Yt(()=>import("./chunks/Product.js?ver=1.6.5"),[],import.meta.url),"./Coupon/Products.vue":()=>Yt(()=>import("./chunks/Products.js?ver=1.6.5"),[],import.meta.url),"./McpSettings.vue":()=>Yt(()=>import("./chunks/McpSettings.js?ver=1.6.5"),[],import.meta.url),"./ModuleSettings.vue":()=>Yt(()=>import("./chunks/ModuleSettings.js?ver=1.6.5"),[],import.meta.url),"./PaymentView.vue":()=>Yt(()=>import("./chunks/PaymentView.js?ver=1.6.5"),[],import.meta.url),"./StoreSettings/AddressComponent.vue":()=>Yt(()=>import("./chunks/AddressComponent.js?ver=1.6.5"),[],import.meta.url),"./StoreSettings/AppearanceComponent.vue":()=>Yt(()=>import("./chunks/AppearanceComponent.js?ver=1.6.5"),[],import.meta.url),"./StoreSettings/AppearancePreview.vue":()=>Yt(()=>import("./chunks/AppearancePreview.js?ver=1.6.5"),[],import.meta.url),"./StoreSettings/CreatePageButton.vue":()=>Yt(()=>import("./chunks/CreatePageButton.js?ver=1.6.5"),[],import.meta.url),"./StoreSettings/PageSelector.vue":()=>Yt(()=>import("./chunks/PageSelector.js?ver=1.6.5"),[],import.meta.url),"./StoreSettings/SubscriptionModeManager.vue":()=>Yt(()=>import("./chunks/SubscriptionModeManager.js?ver=1.6.5"),[],import.meta.url),"./TurnstileSettings.vue":()=>Yt(()=>import("./chunks/TurnstileSettings.js?ver=1.6.5"),[],import.meta.url)}),l=yn(null);Ie(()=>{s(i.name)});const s=async c=>{const p=`./${c}.vue`;a[p]&&(l.value=(await a[p]()).default)},i=e;return(c,p)=>(r(),h(P,null,[(r(),E(gl(l.value),va({name:e.name,field:e.field,fieldKey:e.fieldKey,value:e.value,variant:e.variant,nesting:e.nesting,statePath:e.statePath,form:e.form,attribute:e.attribute,label:e.label,callback:e.callback},{modelValue:t.value,"onUpdate:modelValue":p[0]||(p[0]=f=>t.value=f)}),null,16,["modelValue"])),ga(c.$slots,"fieldNote"),ga(c.$slots,"validationError")],64))}},E2=["id"],wd={__name:"FormGrid",props:{field:{type:Object},fieldKey:{type:String},value:{type:Object},statePath:{type:String},form:{type:Object,required:!0}},setup(e){return(t,a)=>{var l,s,i,c,p,f,_,g,y,v;return r(),h("div",{class:"gap-2 grid grid-cols-dynamic sm:grid-cols-sm-dynamic md:grid-cols-md-dynamic lg:grid-cols-lg--dynamic",id:e.field.id||"",style:ra({"--grid-columns":((l=e.field.columns)==null?void 0:l.default)??2,"--sm-grid-columns":((s=e.field.columns)==null?void 0:s.sm)??((i=e.field.columns)==null?void 0:i.default)??2,"--md-grid-columns":((c=e.field.columns)==null?void 0:c.sm)??((p=e.field.columns)==null?void 0:p.md)??((f=e.field.columns)==null?void 0:f.default)??2,"--lg-grid-columns":((_=e.field.columns)==null?void 0:_.lg)??((g=e.field.columns)==null?void 0:g.md)??((y=e.field.columns)==null?void 0:y.sm)??((v=e.field.columns)==null?void 0:v.default)??2})},[n(xi,{form:e.form,schema:e.field.schema,value:e.value,statePath:e.statePath},null,8,["form","schema","value","statePath"])],12,E2)}}},U2=Object.freeze(Object.defineProperty({__proto__:null,default:wd},Symbol.toStringTag,{value:"Module"})),I2={key:0,class:"fct-content-card-header"},Q2={key:0,class:"title"},D2={key:1,class:"fct-content-card-action"},V2={__name:"ContentCard",props:["title","show_heading"],setup(e){return(t,a)=>(r(),h("div",{class:de({"fct-content-card":e.show_heading!==!1})},[e.show_heading!==!1?(r(),h("div",I2,[e.title||t.$slots.title?(r(),h("div",Q2,[ga(t.$slots,"title",{},()=>[R(m(e.title),1)])])):x("",!0),t.$slots.action?(r(),h("div",D2,[ga(t.$slots,"action")])):x("",!0)])):x("",!0),o("div",{class:de({"fct-content-card-body":e.show_heading!==!1})},[ga(t.$slots,"default")],2)],2))}},T2=["id"],Fp={__name:"FormSection",props:{field:{type:Object},fieldKey:{type:String},value:{type:Object},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0}},setup(e){return(t,a)=>(r(),h("div",{class:"form-section",id:e.field.id||""},[n(Se,null,{default:d(()=>[e.field.show_title!==!1?(r(),E(Ve,{key:0,title:e.field.title,border_bottom:""},null,8,["title"])):x("",!0),n(ke,null,{default:d(()=>[n(wd,{form:e.form,field:e.field,statePath:e.statePath,value:e.value},null,8,["form","field","statePath","value"])]),_:1})]),_:1})],8,T2))}},M2=Object.freeze(Object.defineProperty({__proto__:null,default:Fp},Symbol.toStringTag,{value:"Module"})),$p={__name:"FormTab",props:{field:{type:Object},value:{type:Object},statePath:{type:String},form:{type:Object,required:!0}},setup(e){const t=e,a=T(""),l=T([]),s=sl(),i=_=>{const g=_.props.name;c(g)},c=_=>{const g=new URL(window.location.href);g.hash=`#/settings/${_}`,window.history.replaceState(null,"",g.toString())},p=()=>{const g=window.location.hash.split("/").pop().split("#")[0];l.value=Object.keys(t.field.schema);const y=l.value.find(v=>v===g);y?a.value=y:a.value=t.field.default_tab};let f;return Ie(()=>{f=s.beforeEach((_,g,y)=>{y(),setTimeout(()=>{p()},200)}),p()}),Bt(()=>{f&&f()}),(_,g)=>{const y=C("el-tabs");return r(),E(y,{modelValue:a.value,"onUpdate:modelValue":g[0]||(g[0]=v=>a.value=v),class:de(["fct-tabs-button",{"hidden-switch":e.field.hide_tab_switch}]),onTabClick:i,type:"card"},{default:d(()=>[n(xi,{form:e.form,schema:e.field.schema,value:e.value,"state-path":e.statePath},null,8,["form","schema","value","state-path"])]),_:1},8,["modelValue","class"])}}},L2=Object.freeze(Object.defineProperty({__proto__:null,default:$p},Symbol.toStringTag,{value:"Module"})),Ep={__name:"FormTabPane",props:{fieldKey:{type:String},field:{type:Object},value:{type:Object},statePath:{type:String},form:{type:Object,required:!0}},setup(e){return(t,a)=>{const l=C("el-tab-pane");return r(),E(l,{label:e.field.title,name:e.fieldKey},{default:d(()=>[n(xi,{form:e.form,schema:e.field.schema,value:e.value,statePath:e.statePath},null,8,["form","schema","value","statePath"])]),_:1},8,["label","name"])}}},R2=Object.freeze(Object.defineProperty({__proto__:null,default:Ep},Symbol.toStringTag,{value:"Module"}));class Cd{}Pe(Cd,"attributesBuilders",async(t,a,l)=>{if(t.attributes||(t.attributes={}),t.class&&(t.attributes.class=t.class),t.placeholder&&(t.attributes.placeholder=t.placeholder),typeof a!="function")return t.attributes??{};let s={};typeof t.events!="object"&&(s={}),s.hasOwnProperty("onChange")&&typeof s.onChange=="function"?s.onChange=(...i)=>{l.data.hasChange=!0,s.onChange(i)}:s.onChange=()=>{l.data.hasChange=!0};for(let i in t.events)s[i]=(...c)=>{a(t.events[i],c)};for(let i in t.attributes??{}){let c=t.attributes[i];typeof c=="function"&&await a(c,{})}return{...t.attributes??{},...s}});const O2={__name:"LayoutRenderer",props:{form:{type:Object,required:!0},field:{type:Object,required:!0},value:{type:Object,required:!0},statePath:{type:String,required:!0},fieldKey:{type:String,required:!0},fullStatePath:{type:String,required:!0}},setup(e){const t=e;Jt().ctx;const a=(i,c)=>{if(typeof i=="function")return i({data:t.value,form:t.form,statePath:t.statePath,field:t.field,event:Array.isArray(c)&&c.length===1?c[0]:c})},l=T(!1),s=T({});return Ie(async()=>{s.value=await Cd.attributesBuilders(t.field,a,t.form),l.value=!0}),(i,c)=>(r(),h(P,null,[e.field.type==="grid"&&typeof e.field.schema<"u"?(r(),E(wd,va({key:0,class:e.field.wrapperClass,form:e.form,field:e.field,value:e.value,fieldKey:e.fieldKey,statePath:e.fullStatePath},s.value),null,16,["class","form","field","value","fieldKey","statePath"])):x("",!0),e.field.type==="tab"&&typeof e.field.schema<"u"?(r(),E($p,va({key:1,form:e.form,field:e.field,value:e.value,statePath:e.fullStatePath},s.value),null,16,["form","field","value","statePath"])):x("",!0),e.field.type==="tab-pane"&&typeof e.field.schema<"u"&&typeof e.field.title<"u"?(r(),E(Ep,va({key:2,form:e.form,field:e.field,value:e.value,fieldKey:e.fieldKey,statePath:e.fullStatePath},s.value),null,16,["form","field","value","fieldKey","statePath"])):x("",!0),e.field.type==="section"?(r(),E(Fp,va({key:3,class:e.field.wrapperClass,form:e.form,statePath:e.field.disable_nesting===!0?e.fullStatePath:e.fieldKey+".",field:e.field,"field-key":e.fieldKey,value:e.field.disable_nesting===!0?e.value:e.value[e.fieldKey],nesting:e.field.disable_nesting===!0},s.value),null,16,["class","form","statePath","field","field-key","value","nesting"])):x("",!0)],64))}},Up={__name:"Switch",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue");return(a,l)=>{const s=C("el-switch");return r(),E(s,va({modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=i=>t.value=i),disabled:e.field.disabled},e.attribute),null,16,["modelValue","disabled"])}}},P2=Object.freeze(Object.defineProperty({__proto__:null,default:Up},Symbol.toStringTag,{value:"Module"})),Ip={__name:"Checkbox",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue");return(a,l)=>{const s=C("el-checkbox");return r(),E(s,va({modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=i=>t.value=i)},e.attribute,{"true-value":"yes","false-value":"no",disabled:e.field.disabled}),{default:d(()=>[R(m(e.label),1)]),_:1},16,["modelValue","disabled"])}}},H2=Object.freeze(Object.defineProperty({__proto__:null,default:Ip},Symbol.toStringTag,{value:"Module"})),N2=["innerHTML"],Qp={__name:"RadioGroup",props:bl({field:{type:Object},statePath:{type:String},value:{required:!0},form:{type:Object},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue"),a=e,l=T([]),s=async(i="")=>{if(typeof a.field.options=="function")return l.value=await a.field.options({data:a.value,form:a.form,statePath:a.statePath,search:i});if(Array.isArray(a.field.options))return l.value=[...a.field.options]};return Ie(async()=>{await s()}),(i,c)=>{const p=C("el-radio"),f=C("el-radio-group");return r(),E(f,va({modelValue:t.value,"onUpdate:modelValue":c[0]||(c[0]=_=>t.value=_)},e.attribute,{class:"inline-flex items-center gap-4"}),{default:d(()=>[(r(!0),h(P,null,te(e.field.options,(_,g)=>(r(),h("div",{key:g,class:de(_.option_class)},[n(p,{value:_.value},{default:d(()=>[R(m(_.label),1)]),_:2},1032,["value"]),_.note?(r(),h("div",{key:0,innerHTML:_.note,class:"radio-option-note"},null,8,N2)):x("",!0)],2))),128))]),_:1},16,["modelValue"])}}},K2=Object.freeze(Object.defineProperty({__proto__:null,default:Qp},Symbol.toStringTag,{value:"Module"})),G2=["innerHTML"],Ws={__name:"Input",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Jt().ctx,a=Il(e,"modelValue"),l=e,s=T(),i=async()=>{typeof l.field.prefix=="function"?s.value=await l.callback(l.field.prefix):s.value=l.field.prefix};return Ie(()=>{i()}),Gf(()=>{i()}),K(()=>l.fieldKey==="amount"?l.form.data.values.type==="fixed"?ze.shop.get("currency_sign"):"%":t.appVars.shop.currency_sign),(c,p)=>{var _;const f=C("el-input");return r(),E(f,va({modelValue:a.value,"onUpdate:modelValue":p[0]||(p[0]=g=>a.value=g)},e.attribute,{disabled:e.field.disabled}),oa({_:2},[(_=e.field.prefix)!=null&&_.component?{name:"prefix",fn:d(()=>[n(Sp,{form:e.form,name:e.field.prefix.component,field:e.field,value:e.value},null,8,["form","name","field","value"])]),key:"0"}:e.field.prefix?{name:"prefix",fn:d(()=>[o("div",{innerHTML:s.value},null,8,G2)]),key:"1"}:void 0]),1040,["modelValue","disabled"])}}},z2=Object.freeze(Object.defineProperty({__proto__:null,default:Ws},Symbol.toStringTag,{value:"Module"})),j2={key:0,class:"fct-color-presets-section"},q2=["aria-label"],Y2=["aria-label","aria-pressed","tabindex","onClick","onKeydown"],W2={class:"fct-color-custom-row"},J2={class:"fct-term-color-picker-wrap fct-term-color-picker-wrap--lg"},X2={key:1,class:"fct-color-picker-box"},Z2={class:"fct-color-picker-trigger-wrap"},ek={class:"fct-color-picker-action-wrap"},tk=["disabled","placeholder","aria-label","onKeydown"],kd={__name:"ColorPicker",props:bl({field:{type:Object},statePath:{type:String},value:{default:null},form:{type:Object},callback:{type:Function},label:{type:String},attribute:{default:()=>({})},withPresets:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue"),a=()=>{t.value=""},l=T(t.value||""),s=v=>{let w=(v||"").trim();return w&&w[0]!=="#"&&(w="#"+w),/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(w)?w.toLowerCase():""};be(t,v=>{s(l.value)!==(v||"")&&(l.value=v||"")});const i=()=>{const v=s(l.value);v&&(t.value=v)},c=()=>{const v=s(l.value);v&&(t.value=v),l.value=v||t.value||""},p=v=>v?ks.findIndex(w=>w.toLowerCase()===v.toLowerCase()):-1,f=T(Math.max(0,p(t.value)));be(t,v=>{const w=p(v);w>=0&&(f.value=w)});const _=T([]),g=(v,w)=>{t.value=v,f.value=w},y=(v,w)=>{let k=w;if(v.key==="ArrowRight"||v.key==="ArrowDown")k=(w+1)%ks.length;else if(v.key==="ArrowLeft"||v.key==="ArrowUp")k=(w-1+ks.length)%ks.length;else if(v.key==="Home")k=0;else if(v.key==="End")k=ks.length-1;else return;v.preventDefault(),g(ks[k],k),xe(()=>{_.value[k]&&_.value[k].focus()})};return(v,w)=>{const k=C("el-color-picker"),b=C("el-input");return e.withPresets?(r(),h("div",j2,[o("div",{class:"fct-color-swatch-grid",role:"group","aria-label":A(u)("Color presets")},[(r(!0),h(P,null,te(A(ks),(S,$)=>(r(),h("button",{key:S,ref_for:!0,ref:D=>_.value[$]=D,type:"button",class:de(["fct-color-swatch",{"is-active":t.value&&t.value.toLowerCase()===S.toLowerCase()}]),style:ra({background:S,"--swatch-color":S}),"aria-label":A(u)("Select color %1$s",S),"aria-pressed":!!(t.value&&t.value.toLowerCase()===S.toLowerCase()),tabindex:$===f.value?0:-1,onClick:D=>g(S,$),onKeydown:D=>y(D,$)},null,46,Y2))),128))],8,q2),o("div",W2,[o("div",J2,[n(k,va({modelValue:t.value,"onUpdate:modelValue":w[0]||(w[0]=S=>t.value=S),"color-format":"hex"},e.attribute,{disabled:e.field&&e.field.disabled}),null,16,["modelValue","disabled"])]),n(b,{modelValue:t.value,"onUpdate:modelValue":w[1]||(w[1]=S=>t.value=S),placeholder:A(u)("#000000"),"aria-label":A(u)("Hex color code")},null,8,["modelValue","placeholder","aria-label"])])])):(r(),h("div",X2,[o("div",Z2,[n(k,va({modelValue:t.value,"onUpdate:modelValue":w[2]||(w[2]=S=>t.value=S)},e.attribute,{disabled:e.field&&e.field.disabled,"popper-class":"fct-color-picker-popover"}),null,16,["modelValue","disabled"]),t.value?x("",!0):(r(),E(Y,{key:0,name:"ColorPicker",class:"fct-color-picker-icon w-4 h-4"}))]),o("div",ek,[Wt(o("input",{"onUpdate:modelValue":w[3]||(w[3]=S=>l.value=S),type:"text",class:"fct-color-picker-hex-input",maxlength:"7",spellcheck:"false",disabled:e.field&&e.field.disabled,placeholder:A(u)("Add..."),"aria-label":A(u)("Hex color code"),onInput:i,onBlur:c,onKeydown:xa(Ge(c,["prevent"]),["enter"])},null,40,tk),[[Hc,l.value]]),t.value?(r(),E(Y,{key:0,name:"Cross",class:"fct-color-picker-action w-5 h-5",onClick:a})):x("",!0)])]))}}},ak=Object.freeze(Object.defineProperty({__proto__:null,default:kd},Symbol.toStringTag,{value:"Module"})),Dp={__name:"Date",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue");return(a,l)=>{const s=C("el-date-picker");return r(),E(s,va({modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=i=>t.value=i)},e.attribute,{disabled:e.field.disabled}),null,16,["modelValue","disabled"])}}},lk=Object.freeze(Object.defineProperty({__proto__:null,default:Dp},Symbol.toStringTag,{value:"Module"})),Vp={__name:"Time",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue");return(a,l)=>{const s=C("el-time-select");return r(),E(s,va({modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=i=>t.value=i)},e.attribute,{disabled:e.field.disabled}),null,16,["modelValue","disabled"])}}},sk=Object.freeze(Object.defineProperty({__proto__:null,default:Vp},Symbol.toStringTag,{value:"Module"})),nk={key:0},Tp={__name:"Select",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue"),a=e,l=T([]),s=T(!1),i=async(p="")=>{s.value=!0,typeof a.field.options=="function"&&(l.value=await a.field.options({data:a.value,form:a.form,statePath:a.statePath,search:p})),Array.isArray(a.field.options)&&(l.value=[...a.field.options]),s.value=!1};Ie(async()=>{await i()});const c=p=>typeof p.disabled=="function"?a.callback(p.disabled,{}):p.disabled;return(p,f)=>{const _=C("el-option"),g=C("el-select");return r(),E(g,va({modelValue:t.value,"onUpdate:modelValue":f[0]||(f[0]=y=>t.value=y)},e.attribute,{"remote-method":i,loading:s.value,filterable:e.field.filterable===!0,clearable:e.field.clearable===!0,disabled:e.field.disabled}),{default:d(()=>[(r(!0),h(P,null,te(l.value,(y,v)=>(r(),E(_,{key:v,value:y.value,label:y.label,disabled:c(y)},{default:d(()=>[y.slot?(r(),h("span",nk,m(y.slot),1)):x("",!0)]),_:2},1032,["value","label","disabled"]))),128))]),_:1},16,["modelValue","loading","filterable","clearable","disabled"])}}},ok=Object.freeze(Object.defineProperty({__proto__:null,default:Tp},Symbol.toStringTag,{value:"Module"})),Mp={__name:"RemoteSearchableSelect",props:bl({field:{type:Object},key:{type:String}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue"),a=e,l=T(!1),s=T(a.field.options||[]),i=c=>{if(a.field.search_only_on_type===!0){if(c.query.length===0)return}else if(c.query.length<1&&s.value.length>0)return;l.value=!0,Ae.get("forms/search_options",{search_by:c.query,search_for:c.key}).then(p=>{s.value=p.options,l.value=!1})};return(c,p)=>{const f=C("el-option"),_=C("el-select");return r(),E(_,{modelValue:t.value,"onUpdate:modelValue":p[0]||(p[0]=g=>t.value=g),filterable:"",remote:"",placeholder:e.field.placeholder??A(u)("Please enter a keyword"),"remote-method":g=>{i({query:g,key:e.field.remote_key})},loading:l.value,multiple:e.field.multiple},{default:d(()=>[(r(!0),h(P,null,te(s.value,g=>(r(),E(f,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","remote-method","loading","multiple"])}}},ik=Object.freeze(Object.defineProperty({__proto__:null,default:Mp},Symbol.toStringTag,{value:"Module"}));function An(e,t){t===void 0&&(t={});var a=t.insertAt;if(e&&typeof document<"u"){var l=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",a==="top"&&l.firstChild?l.insertBefore(s,l.firstChild):l.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}An(".vel-fade-enter-active,.vel-fade-leave-active{-webkit-transition:all .3s ease;transition:all .3s ease}.vel-fade-enter-from,.vel-fade-leave-to{opacity:0}.vel-img-swiper{display:block;position:relative}.vel-modal{background:rgba(0,0,0,.5);bottom:0;left:0;margin:0;position:fixed;right:0;top:0;z-index:9998}.vel-img-wrapper{left:50%;margin:0;position:absolute;top:50%;-webkit-transform:translate(-50% -50%);transform:translate(-50% -50%);-webkit-transition:.3s linear;transition:.3s linear;will-change:transform opacity}.vel-img,.vel-img-wrapper{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vel-img{background-color:rgba(0,0,0,.7);-webkit-box-shadow:0 5px 20px 2px rgba(0,0,0,.7);box-shadow:0 5px 20px 2px rgba(0,0,0,.7);display:block;max-height:80vh;max-width:80vw;position:relative;-webkit-transition:-webkit-transform .3s ease-in-out;transition:-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out;transition:transform .3s ease-in-out,-webkit-transform .3s ease-in-out}@media (max-width:750px){.vel-img{max-height:95vh;max-width:85vw}}.vel-btns-wrapper{position:static}.vel-btns-wrapper .btn__close,.vel-btns-wrapper .btn__next,.vel-btns-wrapper .btn__prev{-webkit-tap-highlight-color:transparent;color:#fff;cursor:pointer;font-size:32px;opacity:.6;outline:none;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:.15s linear;transition:.15s linear;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vel-btns-wrapper .btn__close:hover,.vel-btns-wrapper .btn__next:hover,.vel-btns-wrapper .btn__prev:hover{opacity:1}.vel-btns-wrapper .btn__close.disable,.vel-btns-wrapper .btn__close.disable:hover,.vel-btns-wrapper .btn__next.disable,.vel-btns-wrapper .btn__next.disable:hover,.vel-btns-wrapper .btn__prev.disable,.vel-btns-wrapper .btn__prev.disable:hover{cursor:default;opacity:.2}.vel-btns-wrapper .btn__next{right:12px}.vel-btns-wrapper .btn__prev{left:12px}.vel-btns-wrapper .btn__close{right:10px;top:24px}@media (max-width:750px){.vel-btns-wrapper .btn__next,.vel-btns-wrapper .btn__prev{font-size:20px}.vel-btns-wrapper .btn__close{font-size:24px}.vel-btns-wrapper .btn__next{right:4px}.vel-btns-wrapper .btn__prev{left:4px}}.vel-modal.is-rtl .vel-btns-wrapper .btn__next{left:12px;right:auto}.vel-modal.is-rtl .vel-btns-wrapper .btn__prev{left:auto;right:12px}@media (max-width:750px){.vel-modal.is-rtl .vel-btns-wrapper .btn__next{left:4px;right:auto}.vel-modal.is-rtl .vel-btns-wrapper .btn__prev{left:auto;right:4px}}.vel-modal.is-rtl .vel-img-title{direction:rtl}");An('.vel-loading{left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.vel-loading .ring{display:inline-block;height:64px;width:64px}.vel-loading .ring:after{-webkit-animation:ring 1.2s linear infinite;animation:ring 1.2s linear infinite;border-color:hsla(0,0%,100%,.7) transparent;border-radius:50%;border-style:solid;border-width:5px;content:" ";display:block;height:46px;margin:1px;width:46px}@-webkit-keyframes ring{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes ring{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}');An(".vel-on-error{left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.vel-on-error .icon{color:#aaa;font-size:80px}");An(".vel-img-title{bottom:60px;color:#ccc;cursor:default;font-size:12px;left:50%;line-height:1;max-width:80%;opacity:.8;overflow:hidden;position:absolute;text-align:center;text-overflow:ellipsis;-webkit-transform:translate(-50%);transform:translate(-50%);-webkit-transition:opacity .15s;transition:opacity .15s;white-space:nowrap}.vel-img-title:hover{opacity:1}");An(".vel-icon{fill:currentColor;height:1em;overflow:hidden;vertical-align:-.15em;width:1em}");An(".vel-toolbar{border-radius:4px;bottom:8px;display:-webkit-box;display:-ms-flexbox;display:flex;left:50%;opacity:.9;overflow:hidden;padding:0;position:absolute;-webkit-transform:translate(-50%);transform:translate(-50%)}.vel-toolbar,.vel-toolbar .toolbar-btn{background-color:#2d2d2d;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vel-toolbar .toolbar-btn{-ms-flex-negative:0;-webkit-tap-highlight-color:transparent;color:#fff;cursor:pointer;flex-shrink:0;font-size:20px;outline:none;padding:6px 10px}.vel-toolbar .toolbar-btn:active,.vel-toolbar .toolbar-btn:hover{background-color:#3d3d3d}");const xl="vel",Ml=vs({name:"SvgIcon",props:{type:{type:String,default:""}},setup:e=>()=>n("svg",{class:`${xl}-icon icon`,"aria-hidden":"true"},[n("use",{"xlink:href":`#icon-${e.type}`},null)])}),ki=typeof window<"u",Js=()=>{};let Lp=!1;if(ki)try{const e={};Object.defineProperty(e,"passive",{get(){Lp=!0}}),window.addEventListener("test-passive",Js,e)}catch{}const Ju=function(e,t,a){let l=arguments.length>3&&arguments[3]!==void 0&&arguments[3];ki&&e.addEventListener(t,a,!!Lp&&{capture:!1,passive:l})},Xu=(e,t,a)=>{ki&&e.removeEventListener(t,a)},rk=e=>{e.preventDefault()},dk=Object.prototype.toString,Bd=e=>t=>dk.call(t).slice(8,-1)===e,uk=e=>!!e&&Bd("Object")(e),Zu=e=>!!e&&Bd("String")(e);function ck(e){return e!=null}const Ak=vs({name:"Toolbar",props:{zoomIn:{type:Function,default:Js},zoomOut:{type:Function,default:Js},rotateLeft:{type:Function,default:Js},rotateRight:{type:Function,default:Js},resize:{type:Function,default:Js},rotateDisabled:{type:Boolean,default:!1},zoomDisabled:{type:Boolean,default:!1}},setup:e=>()=>n("div",{class:`${xl}-toolbar`},[!e.zoomDisabled&&n(P,null,[n("div",{role:"button","aria-label":"zoom in button",class:"toolbar-btn toolbar-btn__zoomin",onClick:e.zoomIn},[n(Ml,{type:"zoomin"},null)]),n("div",{role:"button","aria-label":"zoom out button",class:"toolbar-btn toolbar-btn__zoomout",onClick:e.zoomOut},[n(Ml,{type:"zoomout"},null)])]),n("div",{role:"button","aria-label":"resize image button",class:"toolbar-btn toolbar-btn__resize",onClick:e.resize},[n(Ml,{type:"resize"},null)]),!e.rotateDisabled&&n(P,null,[n("div",{role:"button","aria-label":"image rotate left button",class:"toolbar-btn toolbar-btn__rotate",onClick:e.rotateLeft},[n(Ml,{type:"rotate-left"},null)]),n("div",{role:"button","aria-label":"image rotate right button",class:"toolbar-btn toolbar-btn__rotate",onClick:e.rotateRight},[n(Ml,{type:"rotate-right"},null)])])])}),pk=()=>n("div",{class:`${xl}-loading`},[n("div",{class:"ring"},null)]),fk=()=>n("div",{class:`${xl}-on-error`},[n("div",{class:"ring"},null),n(Ml,{type:"img-broken"},null)]),mk=(e,t)=>{let{slots:a}=t;return n("div",{class:`${xl}-img-title`},[a.default?a.default():""])},hk=vs({name:"DefaultIcons",setup:()=>()=>n("svg",{"aria-hidden":!0,style:"position: absolute; width: 0; height: 0; overflow: hidden; visibility: hidden;"},[n("symbol",{id:"icon-rotate-right",viewBox:"0 0 1024 1024"},[n("path",{d:"M275.199914 450.496179v20.031994c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399a120.255962 120.255962 0 0 1-72.991978-24.895992c-21.503993-15.839995-35.359989-38.751988-41.567987-68.735979h60.831981c9.247997 23.007993 27.167992 34.495989 53.759983 34.49599 37.535988-0.384 56.863982-21.407993 57.983982-63.071981v-38.751988c-28.095991 8.863997-54.303983 13.119996-78.623975 12.735996a91.263971 91.263971 0 0 1-68.447979-27.711991c-18.847994-18.303994-28.095991-47.231985-27.711991-86.847973z m62.55998 24.863992c7.103998 24.799992 25.215992 37.343988 54.271983 37.663989 27.103992-0.288 44.703986-11.327996 52.831984-33.11999 3.135999-8.383997 2.655999-29.599991-1.28-38.559988-8.607997-19.615994-25.791992-29.695991-51.551984-30.20799-28.383991 0.576-46.303986 12.639996-53.759983 36.159988a58.719982 58.719982 0 0 0-0.512 28.063991z m390.335878 115.711964v-116.895963c-1.12-41.311987-20.447994-62.335981-57.983981-63.07198-37.727988 0.768-56.959982 21.791993-57.695982 63.07198v116.895963c0.768 41.663987 19.999994 62.68798 57.695982 63.071981 37.535988-0.384 56.863982-21.407993 57.983981-63.071981z m-174.815945 3.391999v-123.935961c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399-31.10399-0.384-57.887982-10.751997-80.319975-31.10399-23.935993-20.543994-36.127989-49.791984-36.479989-87.679973z m282.559912-479.07185A509.887841 509.887841 0 0 0 511.99984 0.00032C229.215928 0.00032 0 229.216248 0 512.00016s229.215928 511.99984 511.99984 511.99984 511.99984-229.215928 511.99984-511.99984c0-3.743999-0.032-7.455998-0.128-11.167997-1.631999-11.295996-8.159997-27.103992-31.87199-27.103991-27.487991 0-31.67999 21.247993-32.03199 32.06399l0.032 4.127999a30.62399 30.62399 0 0 0 0.16 2.079999H959.9997c0 247.423923-200.575937 447.99986-447.99986 447.99986S63.99998 759.424083 63.99998 512.00016 264.575917 64.0003 511.99984 64.0003a446.079861 446.079861 0 0 1 277.439913 96.22397l-94.91197 91.679971c-25.439992 24.607992-17.439995 44.991986 17.887994 45.599986l188.031942 3.295999a64.31998 64.31998 0 0 0 65.055979-62.84798l3.295999-188.127942C969.407697 15.040315 949.311703 5.792318 923.871711 30.368311l-87.999972 85.023973z",fill:""},null)]),n("symbol",{id:"icon-rotate-left",viewBox:"0 0 1024 1024"},[n("path",{d:"M275.199914 450.496179v20.031994c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399a120.255962 120.255962 0 0 1-72.991978-24.895992c-21.503993-15.839995-35.359989-38.751988-41.567987-68.735979h60.831981c9.247997 23.007993 27.167992 34.495989 53.759983 34.49599 37.535988-0.384 56.863982-21.407993 57.983982-63.071981v-38.751988c-28.095991 8.863997-54.303983 13.119996-78.623975 12.735996a91.263971 91.263971 0 0 1-68.447979-27.711991c-18.847994-18.303994-28.095991-47.231985-27.711991-86.847973z m62.55998 24.863992c7.103998 24.799992 25.215992 37.343988 54.271983 37.663989 27.103992-0.288 44.703986-11.327996 52.831984-33.11999 3.135999-8.383997 2.655999-29.599991-1.28-38.559988-8.607997-19.615994-25.791992-29.695991-51.551984-30.20799-28.383991 0.576-46.303986 12.639996-53.759983 36.159988a58.719982 58.719982 0 0 0-0.512 28.063991z m390.335878 115.711964v-116.895963c-1.12-41.311987-20.447994-62.335981-57.983981-63.07198-37.727988 0.768-56.959982 21.791993-57.695982 63.07198v116.895963c0.768 41.663987 19.999994 62.68798 57.695982 63.071981 37.535988-0.384 56.863982-21.407993 57.983981-63.071981z m-174.815945 3.391999v-123.935961c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399-31.10399-0.384-57.887982-10.751997-80.319975-31.10399-23.935993-20.543994-36.127989-49.791984-36.479989-87.679973zM188.159941 115.392284A509.887841 509.887841 0 0 1 511.99984 0.00032c282.783912 0 511.99984 229.215928 511.99984 511.99984s-229.215928 511.99984-511.99984 511.99984S0 794.784072 0 512.00016c0-3.743999 0.032-7.455998 0.128-11.167997 1.631999-11.295996 8.159997-27.103992 31.87199-27.103991 27.487991 0 31.67999 21.247993 32.03199 32.06399L63.99998 509.920161a30.62399 30.62399 0 0 1-0.16 2.079999H63.99998c0 247.423923 200.575937 447.99986 447.99986 447.99986s447.99986-200.575937 447.99986-447.99986S759.423763 64.0003 511.99984 64.0003a446.079861 446.079861 0 0 0-277.439913 96.22397l94.91197 91.679971c25.439992 24.607992 17.439995 44.991986-17.887994 45.599986L123.551961 300.800226a64.31998 64.31998 0 0 1-65.055979-62.84798l-3.295999-188.127942C54.591983 15.040315 74.687977 5.792318 100.127969 30.368311l87.999972 85.023973z",fill:""},null)]),n("symbol",{id:"icon-resize",viewBox:"0 0 1024 1024"},[n("path",{d:"M456.036919 791.8108 270.553461 791.8108 460.818829 601.572038l-39.593763-39.567157L231.314785 751.915162l0.873903-183.953615c0-15.465227-12.515035-27.981285-27.981285-27.981285s-27.981285 12.515035-27.981285 27.981285l0 251.829516c0 8.3072 3.415796 14.975063 8.826016 19.564591 5.082762 5.192256 12.132318 8.416693 19.947308 8.416693l251.036453 0c15.46625 0 27.981285-12.514012 27.981285-27.981285C484.018204 804.325835 471.504192 791.8108 456.036919 791.8108zM838.945819 184.644347c-5.082762-5.191232-12.132318-8.416693-19.947308-8.416693L567.961034 176.227654c-15.46625 0-27.981285 12.515035-27.981285 27.981285 0 15.46625 12.514012 27.981285 27.981285 27.981285l185.483458 0L563.206754 422.427962l39.567157 39.567157 189.910281-189.910281-0.873903 183.953615c0 15.46625 12.514012 27.981285 27.981285 27.981285s27.981285-12.514012 27.981285-27.981285L847.772858 204.208938C847.771835 195.902762 844.356039 189.234899 838.945819 184.644347zM847.771835 64.303538 176.227142 64.303538c-61.809741 0-111.924115 50.115398-111.924115 111.924115l0 671.544693c0 61.809741 50.114374 111.924115 111.924115 111.924115l671.544693 0c61.809741 0 111.924115-50.114374 111.924115-111.924115l0-671.544693C959.69595 114.418936 909.581576 64.303538 847.771835 64.303538zM903.733381 847.772346c0 30.878265-25.056676 55.962569-55.962569 55.962569L176.227142 903.734916c-30.90487 0-55.962569-25.084305-55.962569-55.962569l0-671.544693c0-30.9325 25.056676-55.962569 55.962569-55.962569l671.544693 0c30.90487 0 55.962569 25.03007 55.962569 55.962569L903.734404 847.772346z"},null)]),n("symbol",{id:"icon-img-broken",viewBox:"0 0 1024 1024"},[n("path",{d:"M810.666667 128H213.333333c-46.933333 0-85.333333 38.4-85.333333 85.333333v597.333334c0 46.933333 38.4 85.333333 85.333333 85.333333h597.333334c46.933333 0 85.333333-38.4 85.333333-85.333333V213.333333c0-46.933333-38.4-85.333333-85.333333-85.333333z m0 682.666667H213.333333v-195.413334l42.24 42.24 170.666667-170.666666 170.666667 170.666666 170.666666-170.24L810.666667 530.346667V810.666667z m0-401.493334l-43.093334-43.093333-170.666666 171.093333-170.666667-170.666666-170.666667 170.666666-42.24-42.666666V213.333333h597.333334v195.84z"},null)]),n("symbol",{id:"icon-prev",viewBox:"0 0 1024 1024"},[n("path",{d:"M784.652701 955.6957 346.601985 517.644983c-2.822492-2.822492-2.822492-7.902977 0-11.289967l439.179713-439.179713c6.77398-6.77398 10.725469-16.370452 10.725469-25.966924L796.507166 36.692393c0-20.32194-16.370452-36.692393-36.692393-36.692393l-4.515987 0c-9.596472 0-19.192944 3.951488-25.966924 10.725469L250.072767 489.420066c-12.418964 12.418964-12.418964 32.740904 0 45.159868l477.565601 477.565601c7.338479 7.338479 17.499449 11.854465 28.224917 11.854465l0 0c22.015436 0 40.079383-18.063947 40.079383-40.079383l0 0C796.507166 973.759647 791.99118 963.598677 784.652701 955.6957z"},null)]),n("symbol",{id:"icon-next",viewBox:"0 0 1024 1024"},[n("path",{d:"M246.121279 955.6957l438.050717-438.050717c2.822492-2.822492 2.822492-7.902977 0-11.289967L244.992282 67.175303c-6.77398-6.77398-10.725469-16.370452-10.725469-25.966924L234.266814 36.692393C234.266814 16.370452 250.637266 0 270.959206 0l4.515987 0c9.596472 0 19.192944 3.951488 25.966924 10.725469l478.694598 478.694598c12.418964 12.418964 12.418964 32.740904 0 45.159868l-477.565601 477.565601c-7.338479 7.338479-17.499449 11.854465-28.224917 11.854465l0 0c-22.015436 0-40.079383-18.063947-40.079383-40.079383l0 0C234.266814 973.759647 238.7828 963.598677 246.121279 955.6957z"},null)]),n("symbol",{id:"icon-zoomin",viewBox:"0 0 1024 1024"},[n("path",{d:"M725.504 652.864c46.4-61.44 71.744-136.448 71.744-218.752C797.248 230.464 632.768 64 430.656 64S64 230.464 64 434.112C64 639.36 228.48 805.76 430.656 805.76c86.656 0 164.48-30.144 227.52-81.088L889.984 960 960 891.264l-234.496-238.4z m-294.848 67.456c-155.776 0-282.624-128.896-282.624-286.208s126.848-286.208 282.624-286.208 282.624 128.896 282.624 286.208-126.912 286.208-282.624 286.208z"},null),n("path",{d:"M235.712 369.92h390.72v127.104H235.712z"},null),n("path",{d:"M367.488 238.144h127.104v390.72H367.488z"},null)]),n("symbol",{id:"icon-close",viewBox:"0 0 1024 1024"},[n("path",{d:"M570.24 512l259.2 259.2-58.88 58.24L512 570.24l-261.12 261.12-58.24-58.24L453.76 512 194.56 252.8l58.24-58.24L512 453.76l261.12-261.12 58.24 58.24z"},null)]),n("symbol",{id:"icon-zoomout",viewBox:"0 0 1024 1024"},[n("path",{d:"M725.504 652.864c46.4-61.44 71.744-136.448 71.744-218.752C797.248 230.464 632.768 64 430.656 64S64 230.464 64 434.112C64 639.36 228.48 805.76 430.656 805.76c86.656 0 164.48-30.144 227.52-81.088L889.984 960 960 891.264l-234.496-238.4z m-294.848 67.456c-155.776 0-282.624-128.896-282.624-286.208s126.848-286.208 282.624-286.208 282.624 128.896 282.624 286.208-126.912 286.208-282.624 286.208z"},null),n("path",{d:"M235.712 369.92h390.72v127.104H235.712z"},null)])])}),Qn=ki?window:global;let ec=Date.now();function _k(e){const t=Date.now(),a=Math.max(0,16-(t-ec)),l=setTimeout(e,a);return ec=t+a,l}function er(e){return(Qn.requestAnimationFrame||_k).call(Qn,e)}function tc(e){(Qn.cancelAnimationFrame||Qn.clearTimeout).call(Qn,e)}function ac(e,t){const a=e.clientX-t.clientX,l=e.clientY-t.clientY;return Math.sqrt(a*a+l*l)}function tr(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!zf(e)}var ar=vs({name:"VueEasyLightbox",props:{imgs:{type:[Array,String],default:()=>""},visible:{type:Boolean,default:!1},index:{type:Number,default:0},scrollDisabled:{type:Boolean,default:!0},escDisabled:{type:Boolean,default:!1},moveDisabled:{type:Boolean,default:!1},titleDisabled:{type:Boolean,default:!1},maskClosable:{type:Boolean,default:!0},teleport:{type:[String,Object],default:null},swipeTolerance:{type:Number,default:50},loop:{type:Boolean,default:!1},rtl:{type:Boolean,default:!1},zoomScale:{type:Number,default:.12},maxZoom:{type:Number,default:3},minZoom:{type:Number,default:.1},rotateDisabled:{type:Boolean,default:!1},zoomDisabled:{type:Boolean,default:!1},pinchDisabled:{type:Boolean,default:!1},dblclickDisabled:{type:Boolean,default:!1}},emits:{hide:()=>!0,"on-error":e=>!0,"on-prev":(e,t)=>!0,"on-next":(e,t)=>!0,"on-prev-click":(e,t)=>!0,"on-next-click":(e,t)=>!0,"on-index-change":(e,t)=>!0,"on-rotate":e=>!0},setup(e,t){let{emit:a,slots:l}=t;const{imgRef:s,imgState:i,setImgSize:c}=(()=>{const Be=T(),$e=Zs({width:0,height:0,maxScale:1});return{imgRef:Be,imgState:$e,setImgSize:()=>{if(Be.value){const{width:He,height:Re,naturalWidth:yt}=Be.value;$e.maxScale=yt/He,$e.width=He,$e.height=Re}}}})(),p=T(e.index),f=T(""),_=Zs({scale:1,lastScale:1,rotateDeg:0,top:0,left:0,initX:0,initY:0,lastX:0,lastY:0,touches:[]}),g=Zs({loadError:!1,loading:!1,dragging:!1,gesturing:!1,wheeling:!1}),y=K(()=>{return Be=e.imgs,Bd("Array")(Be)?e.imgs.map($e=>typeof $e=="string"?{src:$e}:function(He){return uk(He)&&Zu(He.src)}($e)?$e:void 0).filter(ck):Zu(e.imgs)?[{src:e.imgs}]:[];var Be}),v=K(()=>y.value[p.value]),w=K(()=>{var Be;return(Be=y.value[p.value])==null?void 0:Be.src}),k=K(()=>{var Be;return(Be=y.value[p.value])==null?void 0:Be.title}),b=K(()=>{var Be;return(Be=y.value[p.value])==null?void 0:Be.alt}),S=K(()=>({cursor:g.loadError?"default":e.moveDisabled?g.dragging?"grabbing":"grab":"move",top:`calc(50% + ${_.top}px)`,left:`calc(50% + ${_.left}px)`,transition:g.dragging||g.gesturing?"none":"",transform:`translate(-50%, -50%) scale(${_.scale}) rotate(${_.rotateDeg}deg)`})),$=()=>{a("hide")},D=()=>{_.scale=1,_.lastScale=1,_.rotateDeg=0,_.top=0,_.left=0,g.loadError=!1,g.dragging=!1,g.loading=!0},F=(Be,$e)=>{const He=p.value;D(),p.value=Be,y.value[p.value]===y.value[Be]&&xe(()=>{g.loading=!1}),e.visible&&He!==Be&&($e&&$e(He,Be),a("on-index-change",He,Be))},B=()=>{const Be=p.value,$e=e.loop?(Be+1)%y.value.length:Be+1;!e.loop&&$e>y.value.length-1||F($e,(He,Re)=>{a("on-next",He,Re),a("on-next-click",He,Re)})},U=()=>{const Be=p.value;let $e=Be-1;if(Be===0){if(!e.loop)return;$e=y.value.length-1}F($e,(He,Re)=>{a("on-prev",He,Re),a("on-prev-click",He,Re)})},Q=Be=>{Math.abs(1-Be)<.05?Be=1:Math.abs(i.maxScale-Be)<.05&&(Be=i.maxScale),_.lastScale=_.scale,_.scale=Be},V=()=>{const Be=_.scale+e.zoomScale;Be<i.maxScale*e.maxZoom&&Q(Be)},I=()=>{const Be=_.scale-e.zoomScale;Be>e.minZoom&&Q(Be)},M=()=>{const Be=_.rotateDeg%360;a("on-rotate",Math.abs(Be<0?Be+360:Be))},O=()=>{_.rotateDeg-=90,M()},L=()=>{_.rotateDeg+=90,M()},H=()=>{_.scale=1,_.top=0,_.left=0},j=function(){let Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return!e.moveDisabled&&Be===0},{onMouseDown:W,onMouseMove:G,onMouseUp:Z}=((Be,$e,He)=>{let Re,yt=!1;return{onMouseDown:gt=>{Be.initX=Be.lastX=gt.clientX,Be.initY=Be.lastY=gt.clientY,$e.dragging=!0,yt=!1,gt.stopPropagation()},onMouseUp:gt=>{He(gt.button)&&tc(Re),$e.dragging=!1,yt=!1},onMouseMove:gt=>{if($e.dragging)if(He(gt.button)){if(yt)return;yt=!0,Re=er(()=>{const{top:Rt,left:Tt,lastY:Dt,lastX:_t}=Be;Be.top=Rt-Dt+gt.clientY,Be.left=Tt-_t+gt.clientX,Be.lastX=gt.clientX,Be.lastY=gt.clientY,yt=!1})}else Be.lastX=gt.clientX,Be.lastY=gt.clientY;gt.stopPropagation()}}})(_,g,j),{onTouchStart:ne,onTouchMove:ce,onTouchEnd:z}=((Be,$e,He,Re,yt)=>{let gt,Rt=!1;return{onTouchStart:Tt=>{const{touches:Dt}=Tt;Dt.length>1&&yt()?(He.gesturing=!0,$e.touches=Dt):($e.initX=$e.lastX=Dt[0].clientX,$e.initY=$e.lastY=Dt[0].clientY,He.dragging=!0),Tt.stopPropagation()},onTouchMove:Tt=>{if(Rt)return;const{touches:Dt}=Tt,{lastX:_t,lastY:Gt,left:bt,top:St,scale:Pt}=$e;if(!He.gesturing&&He.dragging){if(!Dt[0])return;const{clientX:Ht,clientY:Qt}=Dt[0];Re()?gt=er(()=>{$e.lastX=Ht,$e.lastY=Qt,$e.top=St-Gt+Qt,$e.left=bt-_t+Ht,Rt=!1}):($e.lastX=Ht,$e.lastY=Qt)}else He.gesturing&&$e.touches.length>1&&Dt.length>1&&yt()&&(gt=er(()=>{const Ht=(ac($e.touches[0],$e.touches[1])-ac(Dt[0],Dt[1]))/Be.width;$e.touches=Dt;const Qt=Pt-1.3*Ht;Qt>.5&&Qt<1.5*Be.maxScale&&($e.scale=Qt),Rt=!1}))},onTouchEnd:()=>{tc(gt),He.dragging=!1,He.gesturing=!1,Rt=!1}}})(i,_,g,j,()=>!e.pinchDisabled),ue=()=>{e.dblclickDisabled||(_.scale!==i.maxScale?(_.lastScale=_.scale,_.scale=i.maxScale):_.scale=_.lastScale)},ie=Be=>{g.loadError||g.gesturing||g.loading||g.dragging||g.wheeling||!e.scrollDisabled||e.zoomDisabled||(g.wheeling=!0,setTimeout(()=>{g.wheeling=!1},80),Be.deltaY<0?V():I())},J=Be=>{const $e=Be;e.visible&&(!e.escDisabled&&$e.key==="Escape"&&e.visible&&$(),$e.key==="ArrowLeft"&&(e.rtl?B():U()),$e.key==="ArrowRight"&&(e.rtl?U():B()))},N=()=>{e.maskClosable&&$()},ae=()=>{c()},oe=()=>{g.loading=!1},fe=Be=>{g.loading=!1,g.loadError=!0,a("on-error",Be)},re=()=>{e.visible&&c()};be(()=>e.index,Be=>{Be<0||Be>=y.value.length||F(Be)}),be(()=>g.dragging,(Be,$e)=>{const He=!Be&&$e;if(!j()&&He){const Re=_.lastX-_.initX,yt=_.lastY-_.initY,gt=e.swipeTolerance;Math.abs(Re)>Math.abs(yt)&&(Re<-1*gt?B():Re>gt&&U())}}),be(()=>e.visible,Be=>{if(Be){D();const $e=y.value.length;if($e===0)return p.value=0,g.loading=!1,void xe(()=>g.loadError=!0);p.value=e.index>=$e?$e-1:e.index<0?0:e.index,e.scrollDisabled&&Ee()}else e.scrollDisabled&&ye()});const Ee=()=>{document&&(f.value=document.body.style.overflowY,document.body.style.overflowY="hidden")},ye=()=>{document&&(document.body.style.overflowY=f.value)};Ie(()=>{Ju(document,"keydown",J),Ju(window,"resize",re)}),cl(()=>{Xu(document,"keydown",J),Xu(window,"resize",re),e.scrollDisabled&&ye()});const Ce=()=>g.loading?l.loading?l.loading({key:"loading"}):n(pk,{key:"img-loading"},null):g.loadError?l.onerror?l.onerror({key:"onerror"}):n(fk,{key:"img-on-error"},null):n("div",{class:`${xl}-img-wrapper`,style:S.value,key:"img-wrapper"},[n("img",{alt:b.value,ref:s,draggable:"false",class:`${xl}-img`,src:w.value,onMousedown:W,onMouseup:Z,onMousemove:G,onTouchstart:ne,onTouchmove:ce,onTouchend:z,onLoad:ae,onDblclick:ue,onDragstart:Be=>{Be.preventDefault()}},null)]),ve=()=>{if(l["prev-btn"])return l["prev-btn"]({prev:U});if(y.value.length<=1)return;const Be=!e.loop&&p.value<=0;return n("div",{role:"button","aria-label":"previous image button",class:"btn__prev "+(Be?"disable":""),onClick:U},[e.rtl?n(Ml,{type:"next"},null):n(Ml,{type:"prev"},null)])},Ue=()=>{if(l["next-btn"])return l["next-btn"]({next:B});if(y.value.length<=1)return;const Be=!e.loop&&p.value>=y.value.length-1;return n("div",{role:"button","aria-label":"next image button",class:"btn__next "+(Be?"disable":""),onClick:B},[e.rtl?n(Ml,{type:"prev"},null):n(Ml,{type:"next"},null)])},Ke=()=>{if(!(e.titleDisabled||g.loading||g.loadError))return l.title?l.title({currentImg:v.value}):k.value?n(mk,null,{default:()=>[k.value]}):void 0},We=()=>{let Be;if(e.visible)return n("div",{onTouchmove:rk,class:[`${xl}-modal`,e.rtl?"is-rtl":""],onClick:Ge(N,["self"]),onWheel:ie},[n(hk,null,null),n(Xl,{name:`${xl}-fade`,mode:"out-in"},tr(Be=Ce())?Be:{default:()=>[Be]}),n("img",{style:"display:none;",src:w.value,onError:fe,onLoad:oe},null),n("div",{class:`${xl}-btns-wrapper`},[ve(),Ue(),Ke(),l["close-btn"]?l["close-btn"]({close:$}):n("div",{role:"button","aria-label":"close image preview button",class:"btn__close",onClick:$},[n(Ml,{type:"close"},null)]),l.toolbar?l.toolbar({toolbarMethods:{zoomIn:V,zoomOut:I,rotate:O,rotateLeft:O,rotateRight:L,resize:H},zoomIn:V,zoomOut:I,rotate:O,rotateLeft:O,rotateRight:L,resize:H}):n(Ak,{zoomIn:V,zoomOut:I,resize:H,rotateLeft:O,rotateRight:L,rotateDisabled:e.rotateDisabled,zoomDisabled:e.zoomDisabled},null)])])};return()=>{let Be;if(e.teleport){let $e;return n(ii,{to:e.teleport},{default:()=>[n(Xl,{name:`${xl}-fade`},tr($e=We())?$e:{default:()=>[$e]})]})}return n(Xl,{name:`${xl}-fade`},tr(Be=We())?Be:{default:()=>[Be]})}}});const vk=Object.assign(ar,{install:e=>{e.component(ar.name,ar)}}),gk={name:"Attachments",components:{MediaButton:uA,VueEasyLightbox:vk,IconButton:at,Delete:Wc},props:{multiple:Boolean,attachments:{type:[Array,Object],default:()=>[]},empty_text:String,isSingle:Boolean,title:String,type:String,icon:String,showList:{type:Boolean,default:!0},showDeleteButton:{type:Boolean,default:!0},previewImage:{type:Boolean,default:!0},mediaInputSize:{type:String},mediaInputBg:{type:String}},emits:["removeImage","mediaUploaded"],data(){return{visible:!1,imageIndex:0,lightboxData:[],images:T([])}},computed:{showMediaButtonAsIcon:function(){return!this.multiple&&this.attachments.length===1}},watch:{attachments:{handler:function(e,t){return this.lightboxData=[],Array.isArray(e)&&e.length>0&&e.map((a,l)=>{this.lightboxData.push(a.url)}),e},deep:!0}},mounted:function(){Array.isArray(this.attachments)&&this.attachments.length>0&&this.attachments.forEach(e=>{this.lightboxData.push(e.url),this.images.push({id:e.id,url:e.url,title:e.title})})},methods:{translate:u,removeImageEvent(e){this.$emit("removeImage",e)},onMediaSelected(e){this.images=e.map(t=>({id:t.id,title:t.title,url:t.url})),this.$emit("mediaUploaded",this.images)}}},yk={class:"fct-attachments-wrap",style:{position:"relative"}},bk={class:"fct-attachment-img-wrap"},wk=["src","alt","onClick"],Ck={class:"fct-attachments-button"};function kk(e,t,a,l,s,i){const c=C("VueEasyLightbox"),p=C("MediaButton"),f=C("IconButton"),_=C("Delete");return r(),h(P,null,[n(c,{visible:s.visible,imgs:s.lightboxData,index:s.imageIndex,onHide:t[0]||(t[0]=()=>{s.visible=!1})},null,8,["visible","imgs","index"]),o("div",yk,[a.attachments?(r(),h("ul",{key:0,class:de(`fct-attachments-list ${a.multiple?"is-multiple":"fct-single-attachment"} ${a.attachments.length>0?"is-single":""}`)},[a.showList===!0?(r(!0),h(P,{key:0},te(a.attachments,(g,y)=>(r(),h("li",{key:y,class:de([[a.mediaInputSize,a.mediaInputBg],"fct-attachment-item"])},[o("div",bk,[a.previewImage?(r(),h("img",{key:0,src:g.url,alt:g.title,onClick:()=>{s.imageIndex=y,s.visible=!0}},null,8,wk)):x("",!0),i.showMediaButtonAsIcon&&!a.multiple?(r(),E(f,{key:1,size:"x-small"},{default:d(()=>[n(p,{"icon-mode":!0,attachments:a.attachments,title:a.multiple?"":a.title,onOnMediaSelected:i.onMediaSelected,multiple:a.multiple,icon:a.icon},null,8,["attachments","title","onOnMediaSelected","multiple","icon"])]),_:1})):x("",!0)]),o("div",Ck,[a.showDeleteButton?(r(),E(f,{key:0,tag:"button",bg:"danger",outline:"",size:"x-small",onClick:Ge(v=>i.removeImageEvent(y),["prevent"]),title:i.translate("Delete media")},{default:d(()=>[a.multiple?(r(),E(_,{key:0})):(r(),h(P,{key:1},[R(m(i.translate("Remove")),1)],64))]),_:2},1032,["onClick","title"])):x("",!0),i.showMediaButtonAsIcon&&a.multiple?(r(),E(f,{key:1,size:"x-small"},{default:d(()=>[n(p,{"icon-mode":!0,attachments:a.attachments,title:a.multiple?"":a.title,onOnMediaSelected:i.onMediaSelected,multiple:a.multiple,icon:a.icon},null,8,["attachments","title","onOnMediaSelected","multiple","icon"])]),_:1})):x("",!0)])],2))),128)):x("",!0),i.showMediaButtonAsIcon?x("",!0):(r(),h("li",{key:1,class:de([a.mediaInputSize,a.mediaInputBg])},[n(p,{"icon-mode":!1,attachments:a.attachments,title:a.multiple?"":a.title,onOnMediaSelected:i.onMediaSelected,multiple:a.multiple,icon:a.icon},null,8,["attachments","title","onOnMediaSelected","multiple","icon"])],2))],2)):x("",!0),ga(e.$slots,"default")])],64)}const Rp=nt(gk,[["render",kk]]),Bk={key:0},xk={key:0,class:"setting-label"},Bi={__name:"MediaInput",props:{modelValue:{default:""},showSupported:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},icon:{type:String},title:{type:String},mediaInputSize:{type:String},mediaInputBg:{type:String},field:{type:Object}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,l=t,s=T();let i=T([]);const c=()=>{a.multiple?s.value=[]:s.value="",i.value=[],l("update:modelValue",s.value)},p=_=>{if(_.length)if(a.multiple){s.value=[],i.value=[];for(const g of _)s.value.push(g),i.value.push(g)}else s.value=_,i.value=_;l("update:modelValue",s.value)};be(()=>a.modelValue,_=>{Array.isArray(_)&&_.length>0?s.value=_:_&&typeof _=="string"&&_!==""?s.value=[_]:_&&typeof _=="object"?s.value=[_]:s.value=[],f()});const f=()=>{i.value=[],Object.values(s.value).forEach((_,g)=>{_!==void 0&&_!==""&&i.value.push(_)})};return Ie(()=>{Array.isArray(a.modelValue)&&a.modelValue.length>0?s.value=a.modelValue:a.modelValue&&typeof a.modelValue=="string"&&a.modelValue!==""?s.value=[a.modelValue]:a.modelValue&&typeof a.modelValue=="object"?s.value=[a.modelValue]:s.value=[],f()}),(_,g)=>(r(),h(P,null,[n(Rp,{attachments:A(i),onMediaUploaded:p,onRemoveImage:c,icon:e.icon,title:e.title,mediaInputSize:e.mediaInputSize,mediaInputBg:e.mediaInputBg},null,8,["attachments","icon","title","mediaInputSize","mediaInputBg"]),e.showSupported?(r(),h("div",Bk,[e.field&&e.field.label?(r(),h("label",xk,m(e.field.label),1)):x("",!0),o("span",null,m(A(u)("%1$s Recommended width: %2$s pixels minimum.","HEIC, WEBP, SVG, PNG, or JPG.","512")),1)])):x("",!0)],64))}},Sk={class:"setting-media-wrap"},Op={__name:"Media",props:bl({name:{type:String,required:!0},field:{type:Object},fieldKey:{type:String},value:{required:!0},variant:{type:String},nesting:{type:Boolean,default:!1},statePath:{type:String},form:{type:Object,required:!0},callback:{type:Function,required:!0},label:{type:String},attribute:{required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Il(e,"modelValue");return(a,l)=>(r(),h("div",Sk,[n(Bi,va({modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=s=>t.value=s),field:e.field,icon:"Upload"},e.attribute),null,16,["modelValue","field"])]))}},Fk=Object.freeze(Object.defineProperty({__proto__:null,default:Op},Symbol.toStringTag,{value:"Module"})),$k={__name:"InputRenderer",props:{form:{type:Object,required:!0},field:{type:Object,required:!0},value:{type:Object,required:!0},statePath:{type:String,required:!0},fieldKey:{type:String,required:!0},fullStatePath:{type:String,required:!0}},setup(e){const t=e;T(!1),Jt().ctx;const a=_=>typeof _.label=="function"?_.label(t.value,t.statePath,t.form):_.label,l=(_,g)=>{if(typeof _=="function")return _({data:t.value,form:t.form,statePath:t.statePath,field:t.field,event:Array.isArray(g)&&g.length===1?g[0]:g})},s=T(!1);let i={};Ie(async()=>{i=await Cd.attributesBuilders(t.field,l,t.form),s.value=!0});const c={switch:Up,checkbox:Ip,radio:Qp,input:Ws,text:Ws,email:Ws,number:Ws,textarea:Ws,color:kd,date:Dp,time:Vp,select:Tp,media:Op,remote_select:Mp},p=K(()=>c[t.field.type]||null),f=K(()=>({modelValue:t.value[t.fieldKey],form:t.form,statePath:t.statePath,field:t.field,fieldKey:t.fieldKey,value:t.value[t.fieldKey],nesting:!1,label:a(t.field),attribute:i,callback:l}));return(_,g)=>e.field.type==="wp-editor"?(r(),E(ls,{key:0,shortCodes:e.field.shortcodes.data,modelValue:t.value[t.fieldKey],onUpdate:g[0]||(g[0]=y=>{t.value[t.fieldKey]=y})},null,8,["shortCodes","modelValue"])):p.value&&s.value?(r(),E(gl(p.value),va({key:1,onChange:g[1]||(g[1]=y=>{e.form.triggerChange(y)}),onInput:g[2]||(g[2]=y=>{e.form.triggerChange(e.value[e.fieldKey])}),modelValue:e.value[e.fieldKey],"onUpdate:modelValue":g[3]||(g[3]=y=>e.value[e.fieldKey]=y)},f.value),null,16,["modelValue"])):x("",!0)}},Ek=["innerHTML"],Uk={key:0},Ik={key:0},xi={__name:"FormRenderer",props:{form:{type:Object,required:!0},schema:{type:Object},value:{type:Object},statePath:{type:String}},setup(e){const t=e,a=t.statePath??"",l=["grid","section","tab","tab-pane"];T(!1),Jt().ctx;const s=(c,p)=>{if(typeof c.label=="function"){let f=i(c)?a:p+".",_=i(c)?t.value:t.value[p];return c.label(_,f,t.form)}return c.label},i=c=>c.disable_nesting!==!1;return(c,p)=>(r(!0),h(P,null,te(e.schema,(f,_)=>(r(),h(P,{key:_},[e.form.isVisible(f,e.statePath+_)?(r(),h(P,{key:0},[f.type==="html"?(r(),h("div",{key:0,class:de(`setting-html-wrapper ${f.wrapperClass??""}`),innerHTML:f.value},null,10,Ek)):(r(),h(P,{key:1},[f.component?(r(),h("div",{key:0,class:de(f.wrapperClass??"")},[f.component&&f.label?(r(),E(pa,{key:0,title:s(f,_),content:f.tooltip,class:"setting-label",placement:f.tooltip_placement},{default:d(()=>[f.labelOptional?(r(),h("span",Uk,"("+m(f.labelOptional)+")",1)):x("",!0)]),_:2},1032,["title","content","placement"])):x("",!0),n(Sp,{modelValue:e.value[_],"onUpdate:modelValue":g=>e.value[_]=g,name:f.component,form:e.form,statePath:i(f)?A(a):_+".",field:f,"field-key":_,value:i(f)?e.value:e.value[_],nesting:i(f)},{fieldNote:d(()=>[f.note&&f.hide_note!==!0?(r(),E(Nr,{key:0,note:f.note},null,8,["note"])):x("",!0)]),validationError:d(()=>[n(Wu,{form:e.form,"error-key":A(a)+_},null,8,["form","error-key"])]),_:2},1032,["modelValue","onUpdate:modelValue","name","form","statePath","field","field-key","value","nesting"])],2)):x("",!0),l.includes(f.type)?(r(),E(O2,{key:1,form:e.form,field:f,value:e.value,"full-state-path":A(a),statePath:i(f)?A(a):_+".","field-key":_},null,8,["form","field","value","full-state-path","statePath","field-key"])):x("",!0),typeof f.type<"u"&&!l.includes(f.type)&&!["custom","component","html","hidden"].includes(f.type)?(r(),h("div",{key:2,class:de(`setting-fields-inner ${f.wrapperClass??""}`)},[f.type!=="checkbox"&&!f.component&&f.label!==!1?(r(),E(pa,{key:0,class:"setting-label",title:s(f,_),content:f.tooltip,placement:f.tooltip_placement},{default:d(()=>[f.labelOptional?(r(),h("span",Ik,"("+m(f.labelOptional)+")",1)):x("",!0)]),_:2},1032,["title","content","placement"])):x("",!0),n($k,{form:e.form,field:f,value:e.value,"full-state-path":A(a),"state-path":e.statePath,"field-key":_},null,8,["form","field","value","full-state-path","state-path","field-key"]),f.note&&!f.component?(r(),E(Nr,{key:1,note:f.note},null,8,["note"])):x("",!0),f.component?x("",!0):(r(),E(Wu,{key:2,form:e.form,"error-key":A(a)+_},null,8,["form","error-key"]))],2)):x("",!0)],64))],64)):x("",!0)],64))),128))}},Qk={key:0,class:"vue-form-wrap"},Dk={key:0,class:"form-section-save-action"},Vk={key:0,class:"cmd block leading-none"},Si={__name:"VueForm",props:{form:{type:Object,required:!0},schema:{type:Object},value:{type:Object},showSubmitButton:{type:Boolean,default:!1},submitButtonText:{type:String,default:"Save"},loading:{type:Boolean,default:!1}},emits:["onSubmit","onChange","onSubmitButtonClick"],setup(e,{expose:t,emit:a}){const l=nl(),s=e,i=a;be(()=>s.form.isReady,()=>{xe(()=>nn.scrollToHashSection(l.hash))},{once:!0}),Ie(()=>{xe(()=>{c.registerCopyAction(),s.form.isReady&&nn.scrollToHashSection(l.hash)})}),T({});const c=Jt().ctx,p=()=>{i("onSubmitButtonClick")};return t({getState:()=>s.form.values}),(_,g)=>{const y=C("el-button");return e.form.isReady?(r(),h("div",Qk,[n(xi,{form:e.form,ref:"formRenderer",schema:e.form.schema,value:e.form.values},null,8,["form","schema","value"]),e.showSubmitButton?(r(),h("div",Dk,[n(y,{onClick:p,type:"primary",loading:e.loading},{default:d(()=>[e.loading?x("",!0):(r(),h("span",Vk,"⌘s")),R(" "+m(e.submitButtonText),1)]),_:1},8,["loading"])])):x("",!0)])):x("",!0)}}},Tk={key:0},Pp={__name:"DynamicFormLoader",props:["schema","values","submit_button_text","form_name","widget"],emits:["change"],setup(e,{expose:t,emit:a}){let l=bd();const s=a,i=e,c=()=>{const g=i.form_name,y={};return y[g]={...l.values},y},p=()=>{l.reset()},f=()=>{var g;return((g=i.widget)==null?void 0:g.reset_on_save)==!0},_=oi("triggerChange");return Ie(()=>{l.setSchema(i.schema).setDefaults(i.values).initForm(),l.onDataChanged(g=>{_==null||_(),s("change")})}),t({getState:c,resetForm:p,resetOnSave:f}),(g,y)=>A(l).isReady?(r(),h("div",Tk,[n(Si,{showSubmitButton:!1,submitButtonText:e.submit_button_text,form:A(l),onOnSubmitButtonClick:y[0]||(y[0]=()=>{A(l).values}),onOnChange:y[1]||(y[1]=v=>{}),"validation-errors":{}},null,8,["submitButtonText","form"])])):x("",!0)}},Mk={__name:"EChart",props:{option:{type:Object,required:!0},height:{type:String,default:"400px"},width:{type:String,default:"100%"}},setup(e){const t=e,a=T(null);let l=null;const s=()=>{a.value&&(l=na(a.value),l.setOption(t.option))};be(()=>t.option,f=>{l&&f&&l.setOption(f,!0)},{deep:!0});const i=(f,_)=>{if(f==null||f==="")return _;const g=Number(f);return isNaN(g)?f:`${g}px`},c=K(()=>i(t.height,"400px")),p=K(()=>i(t.width,"100%"));return Ie(()=>{s(),window.addEventListener("resize",()=>l==null?void 0:l.resize())}),cl(()=>{window.removeEventListener("resize",()=>l==null?void 0:l.resize()),l==null||l.dispose()}),(f,_)=>(r(),h("div",{ref_key:"chartRef",ref:a,style:ra({width:p.value,height:c.value})},null,4))}},Lk={class:"fct-step-indicator"},Rk={class:"indicator-title"},Ok={class:"indicator-steps"},Pk={class:"indicator-progress"},Hk={class:"indicator-steps-bar"},Nk=["onClick"],Kk={__name:"StepIndicator",props:{steps:{type:Array,required:!0},currentStep:{type:Number,default:1}},emits:["step-click"],setup(e,{emit:t}){const a=t;return(l,s)=>(r(),h("div",Lk,[o("div",Rk,m(e.steps[e.currentStep-1].label),1),o("div",Ok,[o("div",Pk,m(e.currentStep)+"/"+m(e.steps.length)+" "+m(l.$t("Completed")),1),o("div",Hk,[(r(!0),h(P,null,te(e.steps,(i,c)=>(r(),h("div",{key:c,class:"indicator-step",onClick:p=>a("step-click",c+1)},[o("div",{class:de(["indicator-step-bar",c<e.currentStep?"is-completed":""])},null,2)],8,Nk))),128))])])]))}},Gk=["type","disabled","aria-disabled"],zk={key:0,class:"fct-btn-spinner"},jk="6px",qk={__name:"LoadingButton",props:{loading:Boolean,disabled:Boolean,type:{type:String,default:""},size:{type:String,default:""},plain:Boolean,nativeType:{type:String,default:"button"},duration:{type:Number,default:300}},emits:["click"],setup(e,{emit:t}){const a=e,l=t,s=K(()=>a.disabled||a.loading),i=()=>`width ${a.duration}ms ease, opacity ${a.duration}ms ease, margin-right ${a.duration}ms ease`,c=y=>{y.style.width="0",y.style.opacity="0",y.style.overflow="hidden",y.style.marginRight="6px"},p=(y,v)=>{const w=y.scrollWidth+"px";y.style.transition=i(),requestAnimationFrame(()=>{y.style.width=w,y.style.opacity="1",y.style.marginRight=""}),setTimeout(()=>v(),a.duration)},f=y=>{y.style.width="auto",y.style.overflow="",y.style.marginRight=""},_=y=>{y.style.width=y.scrollWidth+"px",y.style.opacity="1",y.style.overflow="hidden",y.style.marginRight=jk},g=(y,v)=>{y.offsetHeight,y.style.transition=i(),y.style.width="0",y.style.opacity="0",y.style.marginRight="0";const w=k=>{k.propertyName==="width"&&(y.removeEventListener("transitionend",w),v())};y.addEventListener("transitionend",w)};return(y,v)=>(r(),h("button",{type:e.nativeType,class:de(["el-button",e.type&&`el-button--${e.type}`,e.size&&`el-button--${e.size}`,{"is-plain":e.plain,"is-loading":e.loading,"is-disabled":s.value}]),disabled:s.value,"aria-disabled":s.value,onClick:v[0]||(v[0]=w=>l("click",w))},[n(Xl,{onBeforeEnter:c,onEnter:p,onAfterEnter:f,onBeforeLeave:_,onLeave:g},{default:d(()=>[e.loading?(r(),h("span",zk,v[1]||(v[1]=[o("i",{class:"el-icon is-loading"},[o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})])],-1)]))):x("",!0)]),_:1}),o("span",null,[ga(y.$slots,"default",{},void 0,!0)])],10,Gk))}},Yk=nt(qk,[["__scopeId","data-v-fa8794a2"]]),Hp={__name:"VueTemplateLoader",props:{widget:{type:Object,required:!0},data:{required:!1}},setup(e){var c,p;const t=Nc(Kc),a=Object.freeze({get:(...f)=>Ae.get(...f),post:(...f)=>Ae.post(...f),put:(...f)=>Ae.put(...f),delete:(...f)=>Ae.delete(...f),patch:(...f)=>Ae.patch(...f),upload:(...f)=>Ae.upload(...f),getNonce:()=>Ae.getNonce()}),l=Object.freeze({success:(...f)=>q.success(...f),error:(...f)=>q.error(...f),info:(...f)=>q.info(...f),validationErrors:(...f)=>q.validationErrors(...f)}),s={Vue:t,Rest:a,Notify:l,translate:u,Animation:ya,StepIndicator:Kk,LoadingButton:Yk,ElMessage:(c=window==null?void 0:window.ELEMENT)==null?void 0:c.ElMessage,ElMessageBox:(p=window==null?void 0:window.ELEMENT)==null?void 0:p.ElMessageBox},i=f=>typeof f=="string"?Em(f,s).component:vs(f);return(f,_)=>(r(),E(gl(i(e.widget.component)),va({ref:"componentRefs",data:e.data},{...e.widget}),null,16,["data"]))}},Wk=["innerHTML"],pn={__name:"DynamicTemplates",props:{widgetsQuery:{type:Object,default:{},required:!1},filter:{type:String,default:"",required:!1},data:{required:!1}},emits:["change"],setup(e,{expose:t,emit:a}){Jt().ctx;const l=a,s=e,i=T([]),c=Nc(Kc),p={},f=D=>{window.fluent_cart_admin.app={vue:c,components:D,xhr:Ae,notify:q},window.fluent_cart_admin.hooks.applyFilters(s.filter+"_components",[],c,D).forEach(({name:B,component:U})=>{p[B]=vs(U)})};Ds(()=>{let F=Jt().appContext.components;f(F);let B=window.fluent_cart_admin.hooks.applyFilters(s.filter,[],c,F);Array.isArray(B)&&(i.value=i.value.concat(B));const U={filter:s.filter,data:s.widgetsQuery};Ae.get("widgets",U).then(Q=>{Array.isArray(Q.widgets)&&(i.value=i.value.concat(Q.widgets))}),s.widgetsQuery});const _=D=>vs(D),g=D=>p[D]||null,y=T([]),v=async(D,F)=>{const B=y.value.map(U=>typeof U[D]=="function"?U[D](F):Promise.resolve());return await Promise.all(B),!0};t({beforeUpdatingData:async D=>await v("beforeUpdatingData",D),afterUpdatingData:async D=>await v("afterUpdatingData",D),getFormStates:()=>{let D=[];if(Array.isArray($.value))for(let F of $.value)D={...D,...F.getState()};return D},resetForms:()=>{if(Array.isArray($.value))for(let D of $.value)D.resetOnSave()&&D.resetForm()}});const $=T();return(D,F)=>(r(!0),h(P,null,te(i.value,B=>(r(),h(P,null,[B.type!=="vue-component"&&B.type!=="vue-template"||B.use_card==!0?(r(),E(Se,{key:0},{default:d(()=>[n(Ve,{title:B.title,subtitle:B.subtitle,border_bottom:""},null,8,["title","subtitle"]),n(ke,null,{default:d(()=>[B.type==="html"?(r(),h("div",{key:0,innerHTML:B.content},null,8,Wk)):B.type==="chart"?(r(),E(Mk,{key:1,option:B.data,height:`${B.height||400}`,width:`${B.width||"100%"}`},null,8,["option","height","width"])):B.type==="form"?(r(),E(Pp,{key:2,schema:B.schema,values:B.values,submit_button_text:B.submit_button_text,form_name:B.form_name,ref_for:!0,ref_key:"formRefs",ref:$,widget:B,onChange:F[0]||(F[0]=()=>l("change"))},null,8,["schema","values","submit_button_text","form_name","widget"])):typeof B.component=="object"?(r(),E(gl(_(B.component)),va({key:3,ref_for:!0,ref_key:"componentRefs",ref:y},{ref_for:!0},{...B,data:e.data}),null,16)):g(B.component)?(r(),E(gl(g(B.component)),va({key:4,ref_for:!0,ref_key:"componentRefs",ref:y},{ref_for:!0},{...B,data:e.data}),null,16)):(r(),h(P,{key:5},[R(m(B.content),1)],64))]),_:2},1024)]),_:2},1024)):B.type==="vue-component"?(r(),h(P,{key:1},[typeof B.component=="object"?(r(),E(gl(_(B.component)),va({key:0,ref_for:!0,ref_key:"componentRefs",ref:y},{ref_for:!0},{...B,data:e.data}),null,16)):g(B.component)?(r(),E(gl(g(B.component)),va({key:1,ref_for:!0,ref_key:"componentRefs",ref:y},{ref_for:!0},{...B,data:e.data}),null,16)):x("",!0)],64)):B.type==="vue-template"?(r(),E(Hp,{key:2,widget:B,data:e.data},null,8,["widget","data"])):x("",!0)],64))),256))}},ua=e=>e!=null&&!isNaN(Number(e))?new Intl.NumberFormat(void 0,{maximumFractionDigits:2}).format(Number(e)):e,Jk={class:"fct-dashboard-stat-widgets"},Xk={class:"right w-full"},Zk=["href"],eB={class:"fct-dashboard-stat-widget__icon"},tB={class:"fct-dashboard-stat-widget__content"},aB={class:"fct-dashboard-stat-widget__title"},lB={class:"fct-dashboard-stat-widget__value inner-value"},sB=["innerHTML"],nB={key:1,class:"fct-dashboard-stat-widget__inner"},oB={class:"fct-dashboard-stat-widget__content"},iB={class:"fct-dashboard-stat-widget__title"},rB=["href"],dB={key:1},uB={class:"fct-dashboard-stat-widget__value"},cB={__name:"StatsWidget",setup(e){const t=T(!0),a=T([]),l=()=>{t.value=!0,Ae.get("dashboard/stats").then(s=>{a.value=s.stats}).catch(s=>{q.error(s)}).finally(()=>{t.value=!1})};return Ie(()=>{l()}),(s,i)=>{const c=C("el-skeleton-item"),p=C("el-skeleton");return r(),h("div",Jk,[t.value?(r(),h(P,{key:0},te(4,f=>n(p,{key:f,animated:"",class:"bg-white dark:bg-dark-700 flex flex-col items-start py-5 px-4.5 rounded-[12px] gap-3"},{template:d(()=>[n(c,{variant:"circle",class:"w-10 h-10 flex-none"}),o("div",Xk,[n(c,{variant:"p",class:"w-full"}),n(c,{variant:"p",class:"w-10"})])]),_:2},1024)),64)):(r(),h(P,{key:1},[(r(!0),h(P,null,te(a.value,(f,_)=>(r(),h("div",{key:_,class:"fct-dashboard-stat-widget"},[f.url?(r(),h("a",{key:0,href:f.url,class:"fct-dashboard-stat-widget__inner no-underline"},[o("div",eB,[n(Y,{class:"w-5",name:f.icon},null,8,["name"])]),o("div",tB,[o("h3",aB,[o("span",null,m(f.title),1)]),o("span",lB,[f.has_currency?(r(),h("span",{key:0,innerHTML:A(ft).scaled(f.current_count)},null,8,sB)):(r(),h(P,{key:1},[R(m(A(sa)(A(ua)(f.current_count))||0),1)],64))])])],8,Zk)):(r(),h("div",nB,[i[0]||(i[0]=Dn('<div class="fct-dashboard-stat-widget__icon"><svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.20248 2.62165L5.7818 3.27834C3.59393 4.28965 2.5 4.7953 2.5 5.62533C2.5 6.45535 3.59393 6.961 5.7818 7.97231L7.20249 8.629C8.57936 9.26544 9.26781 9.58366 10 9.58366C10.7322 9.58366 11.4206 9.26544 12.7975 8.629L14.2182 7.97231C16.4061 6.961 17.5 6.45535 17.5 5.62533C17.5 4.7953 16.4061 4.28965 14.2182 3.27834L12.7975 2.62165C11.4206 1.98521 10.7322 1.66699 10 1.66699C9.26781 1.66699 8.57937 1.98521 7.20248 2.62165Z" stroke="#122368" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17.3233 9.24805C17.4411 9.41368 17.5 9.5863 17.5 9.77614C17.5 10.5944 16.4061 11.0928 14.2182 12.0897L12.7975 12.7371C11.4206 13.3644 10.7322 13.6781 10 13.6781C9.26781 13.6781 8.57936 13.3644 7.20249 12.7371L5.7818 12.0897C3.59394 11.0928 2.5 10.5944 2.5 9.77614C2.5 9.5863 2.55889 9.41368 2.67667 9.24805" stroke="#122368" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M16.9806 13.5557C17.3269 13.8315 17.5 14.1064 17.5 14.4319C17.5 15.2501 16.4061 15.7486 14.2182 16.7455L12.7975 17.3928C11.4206 18.0202 10.7322 18.3339 10 18.3339C9.26781 18.3339 8.57936 18.0202 7.20249 17.3928L5.7818 16.7455C3.59394 15.7486 2.5 15.2501 2.5 14.4319C2.5 14.1064 2.67315 13.8315 3.01945 13.5557" stroke="#122368" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg></div>',1)),o("div",oB,[o("h3",iB,[f.url?(r(),h("a",{key:0,class:"link",href:f.url},m(f.title),9,rB)):(r(),h("span",dB,m(f.title),1))]),o("span",uB,m(f.current_count),1)])]))]))),128)),n(pn,{data:{stats:a.value},filter:"dashboard_stats_widget"},null,8,["data"])],64))])}}},lc=200,AB=800,pB=.1,fB=.3,sc=.5,mB=.5,hB=12,_B=800,vB=1600,gB=150,yB=3500,bB=["#FFC700","#FF0000","#2E3191","#41BBC7"];var xd={props:{particleCount:{type:Number,default:gB},particleSize:{type:Number,default:hB},duration:{type:Number,default:yB},colors:{type:Array,default:bB},force:{type:Number,default:mB},stageHeight:{type:Number,default:_B},stageWidth:{type:Number,default:vB},shouldDestroyAfterDone:{type:Boolean,default:!0}},setup(e){const t=T(!0),a=(F,B)=>{D(F,{degree:B})},l=K(()=>i(e.particleCount,e.colors));jf(()=>{e.particleCount>300&&console.log("[VUE-CONFETTI-EXPLOSION] That's a lot of confetti, you sure about that? A lesser number like 200 will still give off the party vibes while still not bricking the device 😉")});const s=K(()=>$(e.particleCount,e.duration,e.colors,e.particleSize,e.force,e.stageHeight,e.stageWidth));Ie(async()=>{await c(e.duration),e.shouldDestroyAfterDone&&(t.value=!1)});const i=(F,B)=>{const U=360/F;return Array.from({length:F},(Q,V)=>({color:B[V%B.length],degree:V*U}))},c=F=>new Promise(B=>setTimeout(B,F));function p(F){let B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return Math.round((F+Number.EPSILON)*10**B)/10**B}function f(F,B){if(F===B)return!0;if(F==null||B==null||F.length!==B.length)return!1;for(let U=0;U<F.length;U++)if(F[U]!==B[U])return!1;return!0}const _=(F,B,U,Q,V)=>(F-B)*(V-Q)/(U-B)+Q,g=(F,B)=>{const U=F+B;return U>360?U-360:U},y=()=>Math.random()>.5,v=[0,0,1],w=[[1,1,0],[1,0,1],[0,1,1],[1,0,0],[0,1,0],v],k=F=>!f(w[F],v)&&y(),b=F=>typeof F>"u",S=F=>{console.error(F)};function $(F,B,U,Q,V,I,M){const O=Number.isSafeInteger;return!b(F)&&O(F)&&F<0?(S("particleCount must be a positive integer"),!1):!b(B)&&O(B)&&B<0?(S("duration must be a positive integer"),!1):!b(U)&&!Array.isArray(U)?(S("colors must be an array of strings"),!1):!b(Q)&&O(Q)&&Q<0?(S("particleSize must be a positive integer"),!1):!b(V)&&O(V)&&(V<0||V>1)?(S("force must be a positive integer and should be within 0 and 1"),!1):!b(I)&&typeof I=="number"&&O(I)&&I<0?(S("floorHeight must be a positive integer"),!1):!b(M)&&typeof M=="number"&&O(M)&&M<0?(S("floorWidth must be a positive integer"),!1):!0}function D(F,B){let{degree:U}=B;const Q=_(Math.abs(g(U,90)-180),0,180,-e.stageWidth/2,e.stageWidth/2),V=Math.random()*(AB-lc)+lc,I=Math.round(Math.random()*(w.length-1)),M=e.duration-Math.round(Math.random()*1e3),O=Math.random()<pB,L=k(I),H=O?p(Math.random()*fB,2):0,j=H*-1,W=H,G=p(Math.abs(_(Math.abs(g(U,90)-180),0,180,-1,1)),4),Z=p(Math.random()*sc,4),ne=p(Math.random()*e.force*(y()?1:-1),4),ce=sc,z=p(Math.max(_(Math.abs(U-180),0,180,e.force,-e.force),0),4),ue=(ie,J)=>F==null?void 0:F.style.setProperty(ie,J+"");ue("--x-landing-point",`${Q}px`),ue("--duration-chaos",`${M}ms`),ue("--x1",`${H}`),ue("--x2",`${j}`),ue("--x3",`${W}`),ue("--x4",`${G}`),ue("--y1",`${Z}`),ue("--y2",`${ne}`),ue("--y3",`${ce}`),ue("--y4",`${z}`),ue("--width",`${L?e.particleSize:Math.round(Math.random()*4)+e.particleSize/2}px`),ue("--height",(L?e.particleSize:Math.round(Math.random()*2)+e.particleSize)+"px"),ue("--rotation",`${w[I].join()}`),ue("--rotation-duration",`${V}ms`),ue("--border-radius",`${L?"50%":"0"}`)}return{isVisible:t,isValid:s,stageHeight:e.stageHeight,particles:l,setItemRef:a}}};function wB(e,t,a,l,s,i){return l.isVisible&&l.isValid?(r(),h("div",{key:0,class:"confetti-container",style:ra(`--floor-height: ${l.stageHeight}px;`)},[(r(!0),h(P,null,te(l.particles,c=>{let{color:p,degree:f}=c;return r(),h("div",{key:f,class:"particle",ref:_=>l.setItemRef(_,f)},[o("div",{style:ra(`--bgcolor: ${p};`)},null,4)],512)}),128))],4)):x("",!0)}function CB(e,t){t===void 0&&(t={});var a=t.insertAt;if(!(typeof document>"u")){var l=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",a==="top"&&l.firstChild?l.insertBefore(s,l.firstChild):l.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}var kB=`
107 107 @keyframes y-axis-4ff796ae {
108 108 to {
109 109 transform: translate3d(0, var(--floor-height), 0);
110 110 }
@@ -296,5 +296,5 @@
296 296 `&&(O=`
297 297 `);var z=0,ue=!1;this.parse=function(ie,J,N){if(typeof ie!="string")throw new Error("Input must be a string");var ae=ie.length,oe=M.length,fe=O.length,re=L.length,Ee=V(H),ye=[],Ce=[],ve=[],Ue=z=0;if(!ie)return _t();if(W||W!==!1&&ie.indexOf(ne)===-1){for(var Ke=ie.split(O),We=0;We<Ke.length;We++){if(ve=Ke[We],z+=ve.length,We!==Ke.length-1)z+=O.length;else if(N)return _t();if(!L||ve.substring(0,re)!==L){if(Ee){if(ye=[],gt(ve.split(M)),Gt(),ue)return _t()}else gt(ve.split(M));if(j&&j<=We)return ye=ye.slice(0,j),_t(!0)}}return _t()}for(var Be=ie.indexOf(M,z),$e=ie.indexOf(O,z),He=new RegExp(S(ce)+S(ne),"g"),Re=ie.indexOf(ne,z);;)if(ie[z]===ne)for(Re=z,z++;;){if((Re=ie.indexOf(ne,Re+1))===-1)return N||Ce.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ye.length,index:z}),Tt();if(Re===ae-1)return Tt(ie.substring(z,Re).replace(He,ne));if(ne===ce&&ie[Re+1]===ce)Re++;else if(ne===ce||Re===0||ie[Re-1]!==ce){Be!==-1&&Be<Re+1&&(Be=ie.indexOf(M,Re+1));var yt=Rt(($e=$e!==-1&&$e<Re+1?ie.indexOf(O,Re+1):$e)===-1?Be:Math.min(Be,$e));if(ie.substr(Re+1+yt,oe)===M){ve.push(ie.substring(z,Re).replace(He,ne)),ie[z=Re+1+yt+oe]!==ne&&(Re=ie.indexOf(ne,z)),Be=ie.indexOf(M,z),$e=ie.indexOf(O,z);break}if(yt=Rt($e),ie.substring(Re+1+yt,Re+1+yt+fe)===O){if(ve.push(ie.substring(z,Re).replace(He,ne)),Dt(Re+1+yt+fe),Be=ie.indexOf(M,z),Re=ie.indexOf(ne,z),Ee&&(Gt(),ue))return _t();if(j&&ye.length>=j)return _t(!0);break}Ce.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ye.length,index:z}),Re++}}else if(L&&ve.length===0&&ie.substring(z,z+re)===L){if($e===-1)return _t();z=$e+fe,$e=ie.indexOf(O,z),Be=ie.indexOf(M,z)}else if(Be!==-1&&(Be<$e||$e===-1))ve.push(ie.substring(z,Be)),z=Be+oe,Be=ie.indexOf(M,z);else{if($e===-1)break;if(ve.push(ie.substring(z,$e)),Dt($e+fe),Ee&&(Gt(),ue))return _t();if(j&&ye.length>=j)return _t(!0)}return Tt();function gt(bt){ye.push(bt),Ue=z}function Rt(bt){var St=0;return St=bt!==-1&&(bt=ie.substring(Re+1,bt))&&bt.trim()===""?bt.length:St}function Tt(bt){return N||(bt===void 0&&(bt=ie.substring(z)),ve.push(bt),z=ae,gt(ve),Ee&&Gt()),_t()}function Dt(bt){z=bt,gt(ve),ve=[],$e=ie.indexOf(O,z)}function _t(bt){if(I.header&&!J&&ye.length&&!Z){var St=ye[0],Pt=Object.create(null),Ht=new Set(St);let Qt=!1;for(let ht=0;ht<St.length;ht++){let qt=St[ht];if(Pt[qt=V(I.transformHeader)?I.transformHeader(qt,ht):qt]){let ge,Fe=Pt[qt];for(;ge=qt+"_"+Fe,Fe++,Ht.has(ge););Ht.add(ge),St[ht]=ge,Pt[qt]++,Qt=!0,(G=G===null?{}:G)[ge]=qt}else Pt[qt]=1,St[ht]=qt;Ht.add(qt)}Qt&&console.warn("Duplicate headers found and renamed."),Z=!0}return{data:ye,errors:Ce,meta:{delimiter:M,linebreak:O,aborted:ue,truncated:!!bt,cursor:Ue+(J||0),renamedHeaders:G}}}function Gt(){H(_t()),ye=[],Ce=[]}},this.abort=function(){ue=!0},this.getCharIndex=function(){return z}}function D(I){var M=I.data,O=p[M.workerId],L=!1;if(M.error)O.userError(M.error,M.file);else if(M.results&&M.results.data){var H={abort:function(){L=!0,F(M.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:B,resume:B};if(V(O.userStep)){for(var j=0;j<M.results.data.length&&(O.userStep({data:M.results.data[j],errors:M.results.errors,meta:M.results.meta},H),!L);j++);delete M.results}else V(O.userChunk)&&(O.userChunk(M.results,H,M.file),delete M.results)}M.finished&&!L&&F(M.workerId,M.results)}function F(I,M){var O=p[I];V(O.userComplete)&&O.userComplete(M),O.terminate(),delete p[I]}function B(){throw new Error("Not implemented.")}function U(I){if(typeof I!="object"||I===null)return I;var M,O=Array.isArray(I)?[]:{};for(M in I)O[M]=U(I[M]);return O}function Q(I,M){return function(){I.apply(M,arguments)}}function V(I){return typeof I=="function"}return _.parse=function(I,M){var O=(M=M||{}).dynamicTyping||!1;if(V(O)&&(M.dynamicTypingFunction=O,O={}),M.dynamicTyping=O,M.transform=!!V(M.transform)&&M.transform,!M.worker||!_.WORKERS_SUPPORTED)return O=null,_.NODE_STREAM_INPUT,typeof I=="string"?(I=(L=>L.charCodeAt(0)!==65279?L:L.slice(1))(I),O=new(M.download?y:w)(M)):I.readable===!0&&V(I.read)&&V(I.on)?O=new k(M):(l.File&&I instanceof File||I instanceof Object)&&(O=new v(M)),O.stream(I);(O=(()=>{var L;return!!_.WORKERS_SUPPORTED&&(L=(()=>{var H=l.URL||l.webkitURL||null,j=a.toString();return _.BLOB_URL||(_.BLOB_URL=H.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",j,")();"],{type:"text/javascript"})))})(),(L=new l.Worker(L)).onmessage=D,L.id=f++,p[L.id]=L)})()).userStep=M.step,O.userChunk=M.chunk,O.userComplete=M.complete,O.userError=M.error,M.step=V(M.step),M.chunk=V(M.chunk),M.complete=V(M.complete),M.error=V(M.error),delete M.worker,O.postMessage({input:I,config:M,workerId:O.id})},_.unparse=function(I,M){var O=!1,L=!0,H=",",j=`\r
298 298 `,W='"',G=W+W,Z=!1,ne=null,ce=!1,z=((()=>{if(typeof M=="object"){if(typeof M.delimiter!="string"||_.BAD_DELIMITERS.filter(function(J){return M.delimiter.indexOf(J)!==-1}).length||(H=M.delimiter),typeof M.quotes!="boolean"&&typeof M.quotes!="function"&&!Array.isArray(M.quotes)||(O=M.quotes),typeof M.skipEmptyLines!="boolean"&&typeof M.skipEmptyLines!="string"||(Z=M.skipEmptyLines),typeof M.newline=="string"&&(j=M.newline),typeof M.quoteChar=="string"&&(W=M.quoteChar),typeof M.header=="boolean"&&(L=M.header),Array.isArray(M.columns)){if(M.columns.length===0)throw new Error("Option columns is empty");ne=M.columns}M.escapeChar!==void 0&&(G=M.escapeChar+W),M.escapeFormulae instanceof RegExp?ce=M.escapeFormulae:typeof M.escapeFormulae=="boolean"&&M.escapeFormulae&&(ce=/^[=+\-@\t\r].*$/)}})(),new RegExp(S(W),"g"));if(typeof I=="string"&&(I=JSON.parse(I)),Array.isArray(I)){if(!I.length||Array.isArray(I[0]))return ue(null,I,Z);if(typeof I[0]=="object")return ue(ne||Object.keys(I[0]),I,Z)}else if(typeof I=="object")return typeof I.data=="string"&&(I.data=JSON.parse(I.data)),Array.isArray(I.data)&&(I.fields||(I.fields=I.meta&&I.meta.fields||ne),I.fields||(I.fields=Array.isArray(I.data[0])?I.fields:typeof I.data[0]=="object"?Object.keys(I.data[0]):[]),Array.isArray(I.data[0])||typeof I.data[0]=="object"||(I.data=[I.data])),ue(I.fields||[],I.data||[],Z);throw new Error("Unable to serialize unrecognized input");function ue(J,N,ae){var oe="",fe=(typeof J=="string"&&(J=JSON.parse(J)),typeof N=="string"&&(N=JSON.parse(N)),Array.isArray(J)&&0<J.length),re=!Array.isArray(N[0]);if(fe&&L){for(var Ee=0;Ee<J.length;Ee++)0<Ee&&(oe+=H),oe+=ie(J[Ee],Ee);0<N.length&&(oe+=j)}for(var ye=0;ye<N.length;ye++){var Ce=(fe?J:N[ye]).length,ve=!1,Ue=fe?Object.keys(N[ye]).length===0:N[ye].length===0;if(ae&&!fe&&(ve=ae==="greedy"?N[ye].join("").trim()==="":N[ye].length===1&&N[ye][0].length===0),ae==="greedy"&&fe){for(var Ke=[],We=0;We<Ce;We++){var Be=re?J[We]:We;Ke.push(N[ye][Be])}ve=Ke.join("").trim()===""}if(!ve){for(var $e=0;$e<Ce;$e++){0<$e&&!Ue&&(oe+=H);var He=fe&&re?J[$e]:$e;oe+=ie(N[ye][He],$e)}ye<N.length-1&&(!ae||0<Ce&&!Ue)&&(oe+=j)}}return oe}function ie(J,N){var ae,oe;return J==null?"":J.constructor===Date?JSON.stringify(J).slice(1,25):(oe=!1,ce&&typeof J=="string"&&ce.test(J)&&(J="'"+J,oe=!0),ae=J.toString().replace(z,G),(oe=oe||O===!0||typeof O=="function"&&O(J,N)||Array.isArray(O)&&O[N]||((fe,re)=>{for(var Ee=0;Ee<re.length;Ee++)if(-1<fe.indexOf(re[Ee]))return!0;return!1})(ae,_.BAD_DELIMITERS)||-1<ae.indexOf(H)||ae.charAt(0)===" "||ae.charAt(ae.length-1)===" ")?W+ae+W:ae)}},_.RECORD_SEP="",_.UNIT_SEP="",_.BYTE_ORDER_MARK="\uFEFF",_.BAD_DELIMITERS=["\r",`
299 299 `,'"',_.BYTE_ORDER_MARK],_.WORKERS_SUPPORTED=!i&&!!l.Worker,_.NODE_STREAM_INPUT=1,_.LocalChunkSize=10485760,_.RemoteChunkSize=5242880,_.DefaultDelimiter=",",_.Parser=$,_.ParserHandle=b,_.NetworkStreamer=y,_.FileStreamer=v,_.StringStreamer=w,_.ReadableStreamStreamer=k,l.jQuery&&((s=l.jQuery).fn.parse=function(I){var M=I.config||{},O=[];return this.each(function(j){if(!(s(this).prop("tagName").toUpperCase()==="INPUT"&&s(this).attr("type").toLowerCase()==="file"&&l.FileReader)||!this.files||this.files.length===0)return!0;for(var W=0;W<this.files.length;W++)O.push({file:this.files[W],inputElem:this,instanceConfig:s.extend({},M)})}),L(),this;function L(){if(O.length===0)V(I.complete)&&I.complete();else{var j,W,G,Z,ne=O[0];if(V(I.before)){var ce=I.before(ne.file,ne.inputElem);if(typeof ce=="object"){if(ce.action==="abort")return j="AbortError",W=ne.file,G=ne.inputElem,Z=ce.reason,void(V(I.error)&&I.error({name:j},W,G,Z));if(ce.action==="skip")return void H();typeof ce.config=="object"&&(ne.instanceConfig=s.extend(ne.instanceConfig,ce.config))}else if(ce==="skip")return void H()}var z=ne.instanceConfig.complete;ne.instanceConfig.complete=function(ue){V(z)&&z(ue,ne.file,ne.inputElem),H()},_.parse(ne.file,ne.instanceConfig)}}function H(){O.splice(0,1),L()}}),c&&(l.onmessage=function(I){I=I.data,_.WORKER_ID===void 0&&I&&(_.WORKER_ID=I.workerId),typeof I.input=="string"?l.postMessage({workerId:_.WORKER_ID,results:_.parse(I.input,I.config),finished:!0}):(l.File&&I.input instanceof File||I.input instanceof Object)&&(I=_.parse(I.input,I.config))&&l.postMessage({workerId:_.WORKER_ID,results:I,finished:!0})}),(y.prototype=Object.create(g.prototype)).constructor=y,(v.prototype=Object.create(g.prototype)).constructor=v,(w.prototype=Object.create(w.prototype)).constructor=w,(k.prototype=Object.create(g.prototype)).constructor=k,_})}(Uo)),Uo.exports}var fge=pge();const Ec=bm(fge),mge={class:"el-upload__text"},hge={class:"fct-import-map-table-wrap"},_ge={class:"fct-import-map-heading"},vge={class:"fct-import-map-table"},gge={width:"50%"},yge={class:"dialog-footer"},bge={__name:"Importer",emits:["onDataPopulated"],setup(e,{emit:t}){const a=Jt().ctx,l=T(!1),s=T(),i=T(),c=T([]),p=T([]),f=T({}),_=T({}),g=T(!1),y=["attribute","attributes","attribute's","variation","variations","variation's"];let v=0;const w=T(!1),k=sf(ze.get("shop.decimal_separator","")),b=G=>zL(G,k.thousand),S=G=>{G&&Ec.parse(G,{header:!0,complete:function(Z){p.value=Z.data,c.value=Z.meta.fields,g.value=c.value.includes("Type")&&c.value.includes("Parent"),D(),g.value&&U(),w.value=!0}})},$=()=>{_.value={},c.value=[],p.value=[],w.value=!1,g.value=!1},D=()=>{const G=[],Z=[];let ne=0;c.value.forEach(ce=>{let z=null,ue=null;const ie=ce.toString();for(const[J,N]of y.entries())if(ie.toLocaleLowerCase().startsWith(N)){const ae=ce.toString().match(/ \d+ /g);if(Array.isArray(ae)&&ae.length===1){let oe=ae[0];ne=oe>ne?oe:ne,z=ce.toString().replace(ae[0]," %d "),ue=ce.toString().replace(ae[0]," ");break}}z!=null?G.includes(z)||(G.push(z),Z.push({title:ue,value:z})):Z.push({title:ce,value:ce})}),_.value=Z,v=ne},F=()=>window.fluentCartRestVars.rest.url+"/files/upload",B={post_id:["ID"],post_title:["Name"],post_name:["SKU"],post_content:["description","Description"],post_excerpt:["Short description","Short Description"],post_status:["Published"],comment_status:["Allow customer reviews?"],item_price:["Regular price","Meta: _subscription_price"],compare_price:["Sale price"],images:["Images"],categories:["Categories"],sku:["SKU"],payment_type:["Payment Type"],repeat_interval:["Subscription Interval","Meta: _subscription_period"],trial_days:["Trial Days","Meta: _subscription_trial_length"],installment:["Installment"],installment_count:["Installment Count"],manage_setup_fee:["Setup Fee"],signup_fee_name:["Setup Fee Name"],signup_fee:["Setup Fee Amount","Meta: _subscription_sign_up_fee"]},U=()=>{for(const[G,Z]of Object.entries(B))if(f.value[G]){for(const ne of Z)if(c.value.includes(ne)){f.value[G].value=ne;break}}},Q=G=>G?{day:"daily",week:"weekly",month:"monthly",year:"yearly"}[G.trim().toLowerCase()]||G:"",V=G=>{if(!G)return"";const Z=G.split(",").map(ne=>ne.trim().toLowerCase());return Z.includes("variation")?"variation":Z.includes("variable")?"variable":Z.includes("subscription")?"subscription":Z.includes("simple")?"simple":Z[0]||""},I=(G=!0)=>{const Z=[],ne={},ce=f.value,z={description:"",payment_type:"onetime",times:"",repeat_interval:"",trial_days:"",billing_summary:"",manage_setup_fee:"no",signup_fee_name:"",signup_fee:"",setup_fee_per_item:"no"},ue=J=>{const N=[];for(let ae=1;ae<=10;ae++){const oe=`Attribute ${ae} name`,fe=`Attribute ${ae} value(s)`;J[oe]&&J[fe]&&N.push(J[fe])}return N.join(" - ")},ie=J=>J==="1"||J===1?"published":J==="0"||J===0?"draft":J||"published";p.value.forEach(J=>{var Ce,ve,Ue,Ke,We,Be,$e,He,Re,yt,gt,Rt,Tt,Dt,_t,Gt,bt,St,Pt,Ht;const N=V(J.Type);if(N!=="simple"&&N!=="variable"&&N!=="subscription")return;const ae={};ae._cid=ml(),ae.post_title=J[(Ce=ce.post_title)==null?void 0:Ce.value]||"",ae.post_name=J[(ve=ce.post_name)==null?void 0:ve.value]||ae.post_title,ae.ID=J[(Ue=ce.post_id)==null?void 0:Ue.value]||"",ae.post_content=J[(Ke=ce.post_content)==null?void 0:Ke.value]||"",ae.post_excerpt=J[(We=ce.post_excerpt)==null?void 0:We.value]||"",ae.post_status=ie(J[(Be=ce.post_status)==null?void 0:Be.value]);const oe={variation_type:N==="variable"?"simple_variations":"simple",manage_stock:"0",fulfillment_type:"physical"},fe=J[($e=ce.images)==null?void 0:$e.value]||"",re=[];fe&&fe.split(",").map(Qt=>Qt.trim()).filter(Boolean).forEach(Qt=>{const ht=Qt.split("/").pop().split("?")[0]||"image";re.push({id:0,url:Qt,title:ht})}),ae.detail=oe,ae.gallery=re,ae.variants=[];const Ee=J[(He=ce.categories)==null?void 0:He.value]||"";if(Ee?ae.categories=Ee.split(",").map(Qt=>Qt.trim()).filter(Boolean):ae.categories=[],N==="simple"||N==="subscription"){const Qt=b(J[(Re=ce.item_price)==null?void 0:Re.value]||""),ht=b(J[(yt=ce.compare_price)==null?void 0:yt.value]||""),qt=J[(gt=ce.sku)==null?void 0:gt.value]||"",ge=N==="subscription"?"subscription":J[(Rt=ce.payment_type)==null?void 0:Rt.value]||"onetime",Fe=Q(J[(Tt=ce.repeat_interval)==null?void 0:Tt.value]||""),ot=J[(Dt=ce.trial_days)==null?void 0:Dt.value]||"",wt=J[(_t=ce.installment)==null?void 0:_t.value]||"",kt=J[(Gt=ce.installment_count)==null?void 0:Gt.value]||"",Xt=J[(bt=ce.manage_setup_fee)==null?void 0:bt.value]||"",vt=J[(St=ce.signup_fee_name)==null?void 0:St.value]||"",ea=b(J[(Pt=ce.signup_fee)==null?void 0:Pt.value]||"");(Qt||ae.post_title)&&ae.variants.push({_cid:ml(),variation_title:ae.post_title,sku:qt,item_price:Qt,compare_price:ht,other_info:{...z,payment_type:ge,repeat_interval:Fe,trial_days:ot,installment:wt==="yes"?"yes":"no",times:kt,manage_setup_fee:Xt==="yes"?"yes":"no",signup_fee_name:vt,signup_fee:ea},media:[]})}const ye=J[(Ht=ce.sku)==null?void 0:Ht.value]||"";N==="variable"&&ye&&(ne[ye]=ae),Z.push(ae)}),p.value.forEach(J=>{var yt,gt,Rt,Tt,Dt,_t,Gt,bt,St,Pt,Ht,Qt;if(V(J.Type)!=="variation")return;const N=J.Parent;if(!N||!ne[N])return;const ae=ue(J),oe=b(J[(yt=ce.item_price)==null?void 0:yt.value]||""),fe=b(J[(gt=ce.compare_price)==null?void 0:gt.value]||""),re=J[(Rt=ce.images)==null?void 0:Rt.value]||"",Ee=[];re&&re.split(",").map(ht=>ht.trim()).filter(Boolean).forEach(ht=>{const qt=ht.split("/").pop().split("?")[0]||"image";Ee.push({id:0,url:ht,title:qt})});const ye=J[(Tt=ce.sku)==null?void 0:Tt.value]||"",Ce=J[(Dt=ce.payment_type)==null?void 0:Dt.value]||"onetime",ve=Q(J[(_t=ce.repeat_interval)==null?void 0:_t.value]||""),Ue=J[(Gt=ce.trial_days)==null?void 0:Gt.value]||"",Ke=J[(bt=ce.installment)==null?void 0:bt.value]||"",We=J[(St=ce.installment_count)==null?void 0:St.value]||"",Be=J[(Pt=ce.manage_setup_fee)==null?void 0:Pt.value]||"",$e=J[(Ht=ce.signup_fee_name)==null?void 0:Ht.value]||"",He=b(J[(Qt=ce.signup_fee)==null?void 0:Qt.value]||""),Re={_cid:ml(),variation_title:ae||J.Name||"",sku:ye,item_price:oe,compare_price:fe,other_info:{...z,payment_type:Ce,repeat_interval:ve,trial_days:Ue,installment:Ke==="yes"?"yes":"no",times:We,manage_setup_fee:Be==="yes"?"yes":"no",signup_fee_name:$e,signup_fee:He},media:Ee};ne[N].variants.push(Re)}),W("onDataPopulated",{products:Z,concat:G})},M=(G=!0)=>{if(g.value)return I(G);const Z=[];p.value.forEach(ne=>{var We,Be,$e,He,Re,yt,gt,Rt,Tt,Dt,_t,Gt;const ce={};ce._cid=ml();const z=f.value;ce.post_title=ne[z.post_title.value]??"",ce.post_name=ne[z.post_name.value]??ce.post_title,ce.ID=ne[z.post_id.value]??"",ce.post_content=ne[z.post_content.value]??"",ce.post_excerpt=ne[z.post_excerpt.value]??"",ce.post_status=ne[(We=z.post_status)==null?void 0:We.value]||"published",ce.comment_status="close";const ue=ne[(Be=z.images)==null?void 0:Be.value]||"",ie=[];ue&&ue.split(",").map(bt=>bt.trim()).filter(Boolean).forEach(bt=>{const St=bt.split("/").pop().split("?")[0]||"image";ie.push({id:0,url:bt,title:St})});const J=ne[($e=z.categories)==null?void 0:$e.value]||"";J?ce.categories=J.split(",").map(bt=>bt.trim()).filter(Boolean):ce.categories=[];const N=ne[(He=z.sku)==null?void 0:He.value]||"",ae=ne[(Re=z.payment_type)==null?void 0:Re.value]||"onetime",oe=ne[(yt=z.repeat_interval)==null?void 0:yt.value]||"",fe=ne[(gt=z.trial_days)==null?void 0:gt.value]||"",re=ne[(Rt=z.installment)==null?void 0:Rt.value]||"",Ee=ne[(Tt=z.installment_count)==null?void 0:Tt.value]||"",ye=ne[(Dt=z.manage_setup_fee)==null?void 0:Dt.value]||"",Ce=ne[(_t=z.signup_fee_name)==null?void 0:_t.value]||"",ve=b(ne[(Gt=z.signup_fee)==null?void 0:Gt.value]||""),Ue={variation_type:"simple",manage_stock:"0",fulfillment_type:"physical"},Ke={description:"",payment_type:ae,times:Ee,repeat_interval:oe,trial_days:fe,billing_summary:"",manage_setup_fee:ye==="yes"?"yes":"no",signup_fee_name:Ce,signup_fee:ve,setup_fee_per_item:"no",installment:re==="yes"?"yes":"no"};ce.gallery=ie,ce.variants=[];for(let bt=1;bt<=v;bt++){const St={};["variation_title","item_price","compare_price"].forEach(Pt=>{var Qt;const Ht=((Qt=z[Pt])==null?void 0:Qt.value)??"";if(Ht.length>0){const ht=Ht.replace("%d",bt.toString()),qt=ne[ht];St[Pt]=Pt==="variation_title"?qt:b(qt)}}),H(St)&&(St._cid=ml(),St.sku=N,St.other_info={...Ke},St.media=[],ce.variants.push(St))}ce.variants.length>0?(Ue.variation_type="simple_variations",ce.detail=Ue,Z.push(ce)):H(ce)&&(ce.variants.push({_cid:ml(),variation_title:"",sku:N,item_price:0,compare_price:0,other_info:{...Ke},media:[]}),ce.detail=Ue,Z.push(ce))}),W("onDataPopulated",{products:Z,concat:G})},O=()=>{l.value=!1,s.value=[],i.value=null,$()},L=(G=!0)=>{M(G),O()},H=G=>{let Z=!1;for(const[ne,ce]of Object.entries(G))if(typeof ce!==null&&typeof ce<"u"&&(Array.isArray(ce)&&ce.length>0||ce.toString().length>0)){Z=!0;break}return Z};Ie(()=>{f.value={post_id:{title:a.$t("Post ID"),value:""},post_title:{title:a.$t("Post Title"),value:""},post_name:{title:a.$t("Post Name"),value:""},post_content:{title:a.$t("Post Content"),value:""},post_excerpt:{title:a.$t("Post Excerpt"),value:""},post_status:{title:a.$t("Post Status"),value:""},post_date:{title:a.$t("Post Date"),value:""},comment_status:{title:a.$t("Comment Status"),value:""},images:{title:a.$t("Images"),value:""},variation_title:{title:a.$t("Variation Title"),value:""},item_price:{title:a.$t("Variation Price"),value:""},compare_price:{title:a.$t("Variation Compare Price"),value:""},sku:{title:a.$t("SKU"),value:""},categories:{title:a.$t("Categories"),value:""},payment_type:{title:a.$t("Payment Type"),value:""},repeat_interval:{title:a.$t("Subscription Interval"),value:""},trial_days:{title:a.$t("Trial Days"),value:""},installment:{title:a.$t("Installment"),value:""},installment_count:{title:a.$t("Installment Count"),value:""},manage_setup_fee:{title:a.$t("Setup Fee"),value:""},signup_fee_name:{title:a.$t("Setup Fee Name"),value:""},signup_fee:{title:a.$t("Setup Fee Amount"),value:""}}});const j=()=>{const G=[{ID:"",Type:"simple",SKU:"BASIC-TEE-001",Name:"Classic Cotton T-Shirt",Published:1,"Short description":"Comfortable everyday cotton tee",description:"Made from 100% organic cotton. Pre-shrunk and machine washable.",Categories:"Clothing, Clothing > T-Shirts",Images:"https://example.com/images/tee-front.jpg, https://example.com/images/tee-back.jpg",Parent:"","Regular price":"29.99","Sale price":"24.99","Attribute 1 name":"","Attribute 1 value(s)":"","Payment Type":"onetime","Subscription Interval":"","Trial Days":"",Installment:"","Installment Count":"","Setup Fee":"","Setup Fee Name":"","Setup Fee Amount":""},{ID:"",Type:"simple",SKU:"STARTER-PLAN",Name:"Starter Membership Plan",Published:1,"Short description":"Monthly access to premium content",description:"Get access to all premium tutorials and resources. Cancel anytime.",Categories:"Memberships",Images:"",Parent:"","Regular price":"9.99","Sale price":"","Attribute 1 name":"","Attribute 1 value(s)":"","Payment Type":"subscription","Subscription Interval":"monthly","Trial Days":"14",Installment:"","Installment Count":"","Setup Fee":"yes","Setup Fee Name":"Activation Fee","Setup Fee Amount":"4.99"},{ID:"",Type:"simple",SKU:"PRO-YEARLY",Name:"Pro Annual Plan",Published:1,"Short description":"12-month installment plan",description:"Pay in 12 monthly installments for annual access to all pro features.",Categories:"Memberships",Images:"",Parent:"","Regular price":"19.99","Sale price":"","Attribute 1 name":"","Attribute 1 value(s)":"","Payment Type":"subscription","Subscription Interval":"monthly","Trial Days":"",Installment:"yes","Installment Count":"12","Setup Fee":"","Setup Fee Name":"","Setup Fee Amount":""},{ID:"",Type:"variable",SKU:"HOODIE-PREMIUM",Name:"Premium Zip Hoodie",Published:1,"Short description":"Heavyweight zip-up hoodie",description:"Premium quality hoodie with YKK zipper. Available in multiple colors.",Categories:"Clothing, Clothing > Hoodies",Images:"https://example.com/images/hoodie-main.jpg, https://example.com/images/hoodie-side.jpg, https://example.com/images/hoodie-detail.jpg",Parent:"","Regular price":"","Sale price":"","Attribute 1 name":"","Attribute 1 value(s)":"","Payment Type":"","Subscription Interval":"","Trial Days":"",Installment:"","Installment Count":"","Setup Fee":"","Setup Fee Name":"","Setup Fee Amount":""},{ID:"",Type:"variation",SKU:"HOODIE-BLK",Name:"",Published:1,"Short description":"",description:"",Categories:"",Images:"https://example.com/images/hoodie-black.jpg",Parent:"HOODIE-PREMIUM","Regular price":"59.99","Sale price":"","Attribute 1 name":"Color","Attribute 1 value(s)":"Black","Payment Type":"","Subscription Interval":"","Trial Days":"",Installment:"","Installment Count":"","Setup Fee":"","Setup Fee Name":"","Setup Fee Amount":""},{ID:"",Type:"variation",SKU:"HOODIE-WHT",Name:"",Published:1,"Short description":"",description:"",Categories:"",Images:"",Parent:"HOODIE-PREMIUM","Regular price":"59.99","Sale price":"","Attribute 1 name":"Color","Attribute 1 value(s)":"White","Payment Type":"","Subscription Interval":"","Trial Days":"",Installment:"","Installment Count":"","Setup Fee":"","Setup Fee Name":"","Setup Fee Amount":""},{ID:"",Type:"variation",SKU:"HOODIE-BLU-LE",Name:"",Published:1,"Short description":"",description:"",Categories:"",Images:"",Parent:"HOODIE-PREMIUM","Regular price":"69.99","Sale price":"64.99","Attribute 1 name":"Color","Attribute 1 value(s)":"Blue","Payment Type":"","Subscription Interval":"","Trial Days":"",Installment:"","Installment Count":"","Setup Fee":"","Setup Fee Name":"","Setup Fee Amount":""}],Z=Ec.unparse(G),ne=new Blob([Z],{type:"text/csv;charset=utf-8;"}),ce=URL.createObjectURL(ne),z=document.createElement("a");z.href=ce,z.download="fluent-cart-sample-import.csv",document.body.appendChild(z),z.click(),document.body.removeChild(z),URL.revokeObjectURL(ce)},W=t;return(G,Z)=>{const ne=C("el-button"),ce=C("el-upload"),z=C("el-option"),ue=C("el-select"),ie=C("el-dialog");return r(),h(P,null,[n(ne,{onClick:Z[0]||(Z[0]=J=>l.value=!0)},{default:d(()=>[R(m(G.$t("Import")),1)]),_:1}),n(ie,{modelValue:l.value,"onUpdate:modelValue":Z[4]||(Z[4]=J=>l.value=J),"append-to-body":!0,title:G.$t("Import Products"),class:"fct-bulk-import-dialog"},{default:d(()=>[w.value?x("",!0):(r(),E(ce,{key:0,class:"fct-file-uploader",ref:"uploaderRef","file-list":s.value,"onUpdate:fileList":Z[1]||(Z[1]=J=>s.value=J),drag:"",action:F(),"on-progress":()=>{},"on-success":()=>{},"on-error":()=>{},"auto-upload":!1,"on-change":J=>{$(),i.value=J,S(J==null?void 0:J.raw)},multiple:!1,limit:1,"show-file-list":!0},{default:d(()=>[n(at,{circle:"",bg:"primary",soft:""},{default:d(()=>[n(Y,{name:"Upload"})]),_:1}),o("div",mge,[R(m(G.$t("Drag & Drop or"))+" ",1),o("em",null,m(G.$t("Browse/Upload")),1),R(" "+m(G.$t("Files"))+" ",1),o("span",null,m(A(u)("Any Format upto %s",A(Vt).serverMaxUploadSize())),1)])]),_:1},8,["file-list","action","on-change"])),w.value?x("",!0):(r(),E(ne,{key:1,onClick:j,link:""},{default:d(()=>[n(Y,{name:"Download"}),R(" "+m(G.$t("Download a Sample CSV File")),1)]),_:1})),w.value?(r(),h(P,{key:2},[o("div",hge,[o("h4",_ge,m(G.$t("Map Columns")),1),o("table",vge,[o("thead",null,[o("tr",null,[o("th",null,m(G.$t("Products Fields")),1),o("th",null,m(G.$t("CSV Headers")),1)])]),o("tbody",null,[(r(!0),h(P,null,te(f.value,(J,N)=>(r(),h("tr",null,[o("td",null,m(J.title),1),o("td",gge,[n(ue,{modelValue:J.value,"onUpdate:modelValue":ae=>J.value=ae,filterable:"",clearable:""},{default:d(()=>[(r(!0),h(P,null,te(_.value,ae=>(r(),E(z,{key:ae.value,label:ae.title,value:ae.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])])]))),256))])])]),o("div",yge,[n(ne,{onClick:Z[2]||(Z[2]=J=>L())},{default:d(()=>[R(m(G.$t("Add Products")),1)]),_:1}),n(ne,{onClick:Z[3]||(Z[3]=J=>L(!1))},{default:d(()=>[R(m(G.$t("Clear and Add Products")),1)]),_:1})])],64)):x("",!0)]),_:1},8,["modelValue","title"])],64)}}};class wge extends Dd{beforeInit(){this.data.products=[],this.data.saving=!1,this.data.saveProgress={total:0,completed:0,errors:[],createdIds:[]},this.data.savingIds=new Set,this.data.savedIds=new Set,this.data.productErrors=new Map,this.data.categoryOptions=[],this.data.dummies.product={ID:"",post_title:"",post_name:"",post_content:"",post_excerpt:"",post_status:"published",post_date:new Date,comment_status:"close",categories:[],variants:!1}}populateDummyProduct(){const t={...this.data.dummies.product};t._cid=ml(),t.detail={...this.data.dummies.productDetail},t.gallery=[],t.downloadable_files={...this.data.dummies.downloadableFile},t.variants=[this.getDummyVariation(t)],this.data.products.push(t)}clearProducts(){this.data.products=[]}isSaving(t){return this.data.savingIds.has(t)}isSaved(t){return this.data.savedIds.has(t)}isRowDisabled(t){return this.isSaving(t)||this.isSaved(t)}hasError(t){return this.data.productErrors.has(t)}getError(t){const a=this.data.productErrors.get(t);return a?a.fields&&Object.keys(a.fields).length?Object.values(a.fields).join("; "):a.message||"":""}hasProductLevelError(t){const a=this.data.productErrors.get(t);return a?!a.fields||!Object.keys(a.fields).length?!!a.message:Object.keys(a.fields).some(l=>!l.startsWith("variants.")):!1}getProductLevelError(t){const a=this.data.productErrors.get(t);return a?!a.fields||!Object.keys(a.fields).length?a.message||"":Object.entries(a.fields).filter(([s])=>!s.startsWith("variants.")).map(([,s])=>s).join("; ")||"":""}hasVariantError(t,a){const l=this.data.productErrors.get(t);if(!(l!=null&&l.fields))return!1;const s=`variants.${a}.`;return Object.keys(l.fields).some(i=>i.startsWith(s))}getVariantError(t,a){const l=this.data.productErrors.get(t);if(!(l!=null&&l.fields))return"";const s=`variants.${a}.`;return Object.entries(l.fields).filter(([c])=>c.startsWith(s)).map(([,c])=>c).join("; ")}hasFieldError(t,a){var s;const l=this.data.productErrors.get(t);return!!((s=l==null?void 0:l.fields)!=null&&s[a])}hasVariantFieldError(t,a,l){return this.hasFieldError(t,`variants.${a}.${l}`)}chunkArray(t,a){const l=[];for(let s=0;s<t.length;s+=a)l.push(t.slice(s,s+a));return l}async saveProducts(){var s,i;const t=this.data.products,a=t.filter(c=>!this.data.savedIds.has(c._cid));if(a.length===0){q.error(u("No products to save."));return}const l=this.chunkArray(a,10);this.data.saving=!0,this.data.productErrors=new Map,this.data.saveProgress={total:l.length,completed:0,errors:[],createdIds:[]};try{for(const f of l){const _=f.map(g=>g._cid);for(const g of _)this.data.savingIds.add(g);this.data.savingIds=new Set(this.data.savingIds);try{const g=await Ae.post("products/bulk-insert",{products:f});if(g.created&&g.created.length){this.data.saveProgress.createdIds.push(...g.created);for(const y of g.created){this.data.savedIds.add(y._cid);const v=t.find(w=>w._cid===y._cid);v&&(v.ID=y.id,v.view_url=y.view_url||"")}this.data.savedIds=new Set(this.data.savedIds)}if(g.errors&&g.errors.length){this.data.saveProgress.errors.push(...g.errors);for(const y of g.errors)y._cid&&this.data.productErrors.set(y._cid,{message:y.message,fields:y.fields||{}});this.data.productErrors=new Map(this.data.productErrors)}}catch(g){const y=(s=g==null?void 0:g.data)==null?void 0:s.errors;if(Array.isArray(y)&&y.length){this.data.saveProgress.errors.push(...y);for(const v of y)v._cid&&this.data.productErrors.set(v._cid,{message:v.message,fields:v.fields||{}})}else{const v=((i=g==null?void 0:g.data)==null?void 0:i.message)||"A chunk failed to save";this.data.saveProgress.errors.push({message:v});for(const w of _)this.data.productErrors.set(w,{message:v,fields:{}})}this.data.productErrors=new Map(this.data.productErrors)}for(const g of _)this.data.savingIds.delete(g);this.data.savingIds=new Set(this.data.savingIds),this.data.saveProgress.completed++}const{createdIds:c,errors:p}=this.data.saveProgress;p.length===0?q.success(`${c.length} product(s) created successfully`):c.length>0?q.info(`${c.length} product(s) created, ${p.length} error(s)`):q.error(u("All products failed to save"))}finally{this.data.saving=!1}}async removeProduct(t){var l;if(t.ID&&this.data.savedIds.has(t._cid)){try{await Ae.delete(`products/${t.ID}`)}catch(s){const i=((l=s==null?void 0:s.data)==null?void 0:l.message)||"Failed to delete product from server";q.error(i);return}this.data.savedIds.delete(t._cid),this.data.savedIds=new Set(this.data.savedIds)}const a=this.data.products.indexOf(t);a!==-1&&this.data.products.splice(a,1)}removeVariant(t,a){const l=t.variants.indexOf(a);l!==-1&&t.variants.splice(l,1)}duplicateProduct(t){const a=JSON.parse(JSON.stringify(t));a._cid=ml(),a.post_title=a.post_title?a.post_title+" (Copy)":"",a.variants&&Array.isArray(a.variants)&&a.variants.forEach(s=>{s.sku="",s._cid=ml()});const l=this.data.products.indexOf(t);this.data.products.splice(l+1,0,a)}duplicateProductWithVariants(t,a){const l=JSON.parse(JSON.stringify(t));if(l._cid=ml(),l.post_title=l.post_title?l.post_title+" (Copy)":"",l.variants&&Array.isArray(l.variants)){const i=new Set(a);l.variants=l.variants.filter((c,p)=>i.has(p)),l.variants.forEach(c=>{c.sku="",c._cid=ml()})}const s=this.data.products.indexOf(t);this.data.products.splice(s+1,0,l)}duplicateVariant(t,a){const l=JSON.parse(JSON.stringify(a));l._cid=ml(),l.variation_title=l.variation_title?l.variation_title+" (Copy)":"",l.sku="";const s=t.variants.indexOf(a);t.variants.splice(s+1,0,l)}resetPaymentTypeDefaults(t){t.other_info.payment_type==="onetime"&&(t.other_info.installment="no",t.other_info.times="",t.other_info.manage_setup_fee="no",t.other_info.signup_fee="",t.other_info.signup_fee_name="")}resetState(){this.data.products.splice(0),this.data.savedIds=new Set,this.data.savingIds=new Set,this.data.productErrors=new Map}getColumnWidthStorageKey(){return"bulk_insert_column_widths"}getColumnStorageKey(){return"bulk_insert_columns"}getToggleableColumns(){return[{label:"SKU",value:"sku"},{label:"Media",value:"media"},{label:"Categories",value:"categories"},{label:"Description",value:"description"},{label:"Short Description",value:"short_description"},{label:"Status",value:"status"},{label:"Product Type",value:"product_type"},{label:"Pricing Type",value:"pricing_type"},{label:"Payment Type",value:"payment_type"},{label:"Interval",value:"interval"},{label:"Trial Days",value:"trial_days"},{label:"Best Price",value:"best_price"},{label:"Compare-at Price",value:"compare_price"},{label:"Track Quantity",value:"track_quantity"},{label:"Stock",value:"stock"}]}flattenCategoryTree(t,a=""){var s;const l=[];for(const i of t){const c=a?`${a} > ${i.label}`:i.label;l.push({label:c,value:c}),(s=i.children)!=null&&s.length&&l.push(...this.flattenCategoryTree(i.children,c))}return l}async fetchCategories(){try{const a=(await Ae.get("products/fetch-term")).taxonomies||{},l=Object.values(a).find(s=>s.name==="product-categories");l!=null&&l.terms&&(this.data.categoryOptions=this.flattenCategoryTree(l.terms))}catch{}}}const Ft=wge.init(),Cge={class:"max-w-full overflow-x-scroll"},kge={class:"relative"},Bge={key:0,class:"bulk-checkbox-cell"},xge=["onMousedown","onTouchstart"],Bf={__name:"ResizeableColumns",props:{columns:{type:Array,required:!0},stickyLast:{type:Boolean,default:!1}},emits:["scroll","resize-end"],setup(e,{emit:t}){const a=t,l=Xf(),s=td("table"),i=T(null);let c=null;Ie(()=>{xe(()=>{const g=s.value.querySelectorAll("th"),y=l["header-first"]?1:0;Array.from(g).forEach((v,w)=>{const k=w-y;k<0||k>=p.columns.length||(p.columns[k].width=v.offsetWidth,p.columns[k].minWidth||(p.columns[k].minWidth=v.offsetWidth))}),c=new ResizeObserver(()=>{s.value.style.setProperty("--resizer-height",s.value.offsetHeight+"px");const v=s.value.querySelector("th");v&&s.value.style.setProperty("--header-height",v.offsetHeight+"px")}),c.observe(s.value)})}),cl(()=>{c&&c.disconnect()});const p=e,f=K(()=>{const g=l["header-first"]?40:0;return p.columns.reduce((y,v)=>y+v.width,0)+g}),_=(g,y)=>{g.preventDefault();const v=g.clientX,w=p.columns[y].width,k=p.columns[y].minWidth||50;i.value=y;const b=$=>{const D=w+($.clientX-v);D>=k&&(p.columns[y].width=D)},S=()=>{i.value=null,document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",S),a("resize-end")};document.addEventListener("mousemove",b),document.addEventListener("mouseup",S)};return(g,y)=>(r(),h("div",Cge,[o("div",{class:de(["resizable-table",{"is-resizing":i.value!==null}]),onScroll:y[0]||(y[0]=v=>a("scroll",v))},[o("div",kge,[o("table",{id:"tb",ref_key:"table",ref:s,style:ra({tableLayout:"fixed",width:f.value+"px"})},[o("thead",null,[o("tr",null,[g.$slots["header-first"]?(r(),h("th",Bge,[ga(g.$slots,"header-first")])):x("",!0),(r(!0),h(P,null,te(e.columns,(v,w)=>(r(),h("th",{class:de({"sticky-col":w===0,"sticky-col sticky-col-right":w===e.columns.length-1&&e.stickyLast}),style:ra({width:v.width+"px",zIndex:w===0||w===e.columns.length-1&&e.stickyLast?70:e.columns.length-w+50,left:w===0&&g.$slots["header-first"]?"40px":w===0?"0px":void 0}),key:v.key||w},[w===e.columns.length-1?ga(g.$slots,"header-last",{key:0},()=>[R(m(v.title),1)]):(r(),h(P,{key:1},[R(m(v.title),1)],64)),w<e.columns.length-1?(r(),h("span",{key:2,class:de(["resizer",{"is-active":i.value===w}]),onMousedown:k=>_(k,w),onTouchstart:k=>_(k,w)},null,42,xge)):x("",!0)],6))),128))])]),o("tbody",null,[ga(g.$slots,"default")])],4)])],34)]))}},Sge={class:"bulk-setup-fee-badge"},Fge={key:1,class:"text-gray-300 text-sm flex justify-center"},Xo={__name:"BulkPriceInput",props:{variant:{type:Object,default:null},disabled:{type:Boolean,default:!1},hasError:{type:Boolean,default:!1}},emits:["change"],setup(e,{emit:t}){const a=t;return(l,s)=>{var c;const i=C("el-tooltip");return e.variant?(r(),E(Za,{key:0,size:"small","error-class":e.hasError?"is-error":"","model-value":e.variant.item_price,placeholder:l.$t("Price"),disabled:e.disabled,"onUpdate:modelValue":s[0]||(s[0]=p=>{e.variant.item_price=p,a("change")})},oa({_:2},[((c=e.variant.other_info)==null?void 0:c.manage_setup_fee)==="yes"&&e.variant.other_info.signup_fee?{name:"suffix",fn:d(()=>[n(i,{content:(e.variant.other_info.signup_fee_name||l.$t("Setup fee"))+": "+A(Kt)(e.variant.other_info.signup_fee,!0),placement:"top","popper-class":"fct-tooltip"},{default:d(()=>[o("span",Sge,"+ "+m(l.$t("fee")),1)]),_:1},8,["content"])]),key:"0"}:void 0]),1032,["error-class","model-value","placeholder","disabled"])):(r(),h("span",Fge,"—"))}}},$ge=["disabled"],Ege={key:0,class:"fct-bulk-sub-count"},Uge={class:"fct-bulk-sub-popover-body"},Ige={class:"fct-bulk-sub-popover-title"},Qge={class:"fct-bulk-sub-section"},Dge={class:"fct-bulk-sub-row"},Vge={class:"fct-bulk-sub-row"},Tge={class:"fct-bulk-sub-label"},Mge={class:"fct-bulk-sub-row"},Lge={class:"fct-bulk-sub-label"},Rge=["innerHTML"],Oge={class:"fct-bulk-sub-section"},Pge={class:"fct-bulk-sub-row"},Hge={class:"fct-bulk-sub-row"},Nge={class:"fct-bulk-sub-label"},Kge={class:"fct-bulk-sub-row"},Gge={class:"fct-bulk-sub-label"},zge={class:"fct-bulk-sub-footer"},dr=2,jge={__name:"BulkSubscriptionPopover",props:{variant:{type:Object,required:!0},disabled:{type:Boolean,default:!1}},emits:["changed"],setup(e,{emit:t}){const a=e,l=t,s=Jt().ctx,i=ze.get(),c=ze.get("app_config.isProActive"),p=T(!1);K(()=>{var F;return((F=i==null?void 0:i.shop)==null?void 0:F.currency_sign)||"$"});const f=K(()=>{var F;return((F=a.variant)==null?void 0:F.other_info)||{}}),_=K(()=>f.value.payment_type==="subscription"),g=K(()=>f.value.installment==="yes"),y=K(()=>Number(f.value.times)||1),v=K(()=>{var B;const F=Number((B=a.variant)==null?void 0:B.item_price)||0;return g.value?F*y.value:F}),w=K(()=>{const F=[];if(g.value&&F.push(s.$t("Installment")+": "+y.value+"x"),f.value.manage_setup_fee==="yes"){const B=f.value.signup_fee_name||s.$t("Setup fee"),U=f.value.signup_fee||0;F.push(s.$t("Setup fee")+": "+B+" ("+Kt(U,!0)+")")}return F.length>0?F.join(`
300 -`):s.$t("Subscription settings")}),k=F=>{F==="no"?a.variant.other_info.times="":b(),l("changed")},b=()=>{const F=Number(a.variant.other_info.times);(!Number.isFinite(F)||F<dr)&&(a.variant.other_info.times=dr)},S=F=>{F==="no"&&(a.variant.other_info.signup_fee=""),l("changed")},$=()=>{l("changed")},D=()=>{p.value=!1};return(F,B)=>{const U=C("el-checkbox"),Q=C("el-tooltip"),V=C("el-input"),I=C("el-switch"),M=C("el-button"),O=C("el-popover");return r(),E(Q,{content:w.value,placement:"top",disabled:!_.value||p.value,"popper-class":"fct-tooltip","show-after":400},{default:d(()=>[n(O,{visible:p.value,"onUpdate:visible":B[6]||(B[6]=L=>p.value=L),placement:"bottom",width:320,trigger:"click",disabled:e.disabled||!_.value,"popper-class":"bulk-sub-popover"},{reference:d(()=>[o("button",{class:de(["fc-bulk-sub-icon-btn",{"is-active":_.value,"is-configured":_.value&&(g.value||f.value.manage_setup_fee==="yes")}]),disabled:e.disabled||!_.value,onClick:B[0]||(B[0]=Ge(()=>{},["prevent"]))},[B[7]||(B[7]=o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16"},[o("path",{d:"M6 4H21C21.5523 4 22 4.44772 22 5V12H20V6H6V9L1 5.5L6 2V4ZM18 20H3C2.44772 20 2 19.5523 2 19V12H4V18H18V15L23 18.5L18 22V20Z"})],-1)),g.value?(r(),h("span",Ege,m(y.value),1)):x("",!0)],10,$ge)]),default:d(()=>[o("div",Uge,[o("h4",Ige,m(F.$t("Subscription Settings")),1),o("div",Qge,[o("div",Dge,[n(U,{"true-value":"yes","false-value":"no",label:F.$t("Enable installment payment"),modelValue:e.variant.other_info.installment,"onUpdate:modelValue":B[1]||(B[1]=L=>e.variant.other_info.installment=L),disabled:!A(c)||e.disabled,onChange:k},null,8,["label","modelValue","disabled"]),A(c)?x("",!0):(r(),E(Q,{key:0,"popper-class":"fct-tooltip"},{content:d(()=>[R(m(F.$t("This feature is available in pro version only.")),1)]),default:d(()=>[n(Y,{name:"Crown",class:"fct-pro-icon"})]),_:1}))]),f.value.installment==="yes"?(r(),h(P,{key:0},[o("div",Vge,[o("label",Tge,m(F.$t("Installment Count")),1),n(V,{type:"number",min:dr,size:"small",modelValue:e.variant.other_info.times,"onUpdate:modelValue":B[2]||(B[2]=L=>e.variant.other_info.times=L),modelModifiers:{number:!0},placeholder:F.$t("Count"),style:{width:"100px"},onInput:$,onChange:b},null,8,["modelValue","placeholder"])]),o("div",Mge,[o("span",Lge,m(F.$t("Total Price")),1),o("span",{class:"fct-bulk-sub-value",innerHTML:A(Kt)(v.value,!0)},null,8,Rge)])],64)):x("",!0)]),o("div",Oge,[o("div",Pge,[n(I,{"active-text":F.$t("Setup fee"),modelValue:e.variant.other_info.manage_setup_fee,"onUpdate:modelValue":B[3]||(B[3]=L=>e.variant.other_info.manage_setup_fee=L),"active-value":"yes","inactive-value":"no",disabled:!A(c)||e.disabled,size:"small",onChange:S},null,8,["active-text","modelValue","disabled"]),A(c)?x("",!0):(r(),E(Q,{key:0,"popper-class":"fct-tooltip"},{content:d(()=>[R(m(F.$t("This feature is available in pro version only.")),1)]),default:d(()=>[n(Y,{name:"Crown",class:"fct-pro-icon"})]),_:1}))]),f.value.manage_setup_fee==="yes"?(r(),h(P,{key:0},[o("div",Hge,[o("label",Nge,m(F.$t("Label")),1),n(V,{size:"small",modelValue:e.variant.other_info.signup_fee_name,"onUpdate:modelValue":B[4]||(B[4]=L=>e.variant.other_info.signup_fee_name=L),placeholder:F.$t("e.g. Initial Setup"),onInput:$},null,8,["modelValue","placeholder"])]),o("div",Kge,[o("label",Gge,m(F.$t("Amount")),1),n(Za,{size:"small","model-value":e.variant.other_info.signup_fee,placeholder:F.$t("Amount"),"onUpdate:modelValue":B[5]||(B[5]=L=>{e.variant.other_info.signup_fee=L,$()})},null,8,["model-value","placeholder"])])],64)):x("",!0)]),o("div",zge,[n(M,{size:"small",type:"primary",onClick:D},{default:d(()=>[R(m(F.$t("Done")),1)]),_:1})])])]),_:1},8,["visible","disabled"])]),_:1},8,["content","disabled"])}}},qge={key:0,class:"flex items-center"},Yge={key:1,class:"text-gray-300 text-sm flex justify-center"},Zo={__name:"BulkPaymentTypeCell",props:{variant:{type:Object,default:null},disabled:{type:Boolean,default:!1},hasError:{type:Boolean,default:!1}},emits:["change","payment-type-change"],setup(e,{emit:t}){const a=e,l=t,s=()=>{var i;return(i=a.variant)==null?void 0:i.other_info};return(i,c)=>{const p=C("el-option"),f=C("el-select");return e.variant&&s()?(r(),h("div",qge,[n(f,{modelValue:e.variant.other_info.payment_type,"onUpdate:modelValue":c[0]||(c[0]=_=>e.variant.other_info.payment_type=_),size:"small",class:de({"is-field-error":e.hasError}),disabled:e.disabled,onChange:c[1]||(c[1]=_=>l("payment-type-change",e.variant))},{default:d(()=>[n(p,{label:i.$t("One Time"),value:"onetime"},null,8,["label"]),n(p,{label:i.$t("Subscription"),value:"subscription"},null,8,["label"])]),_:1},8,["modelValue","class","disabled"]),n(jge,{variant:e.variant,disabled:e.disabled,onChanged:c[2]||(c[2]=_=>l("change"))},null,8,["variant","disabled"])])):(r(),h("span",Yge,"—"))}}},Wge={key:1,class:"text-gray-300 text-sm flex justify-center"},ei={__name:"BulkIntervalSelect",props:{variant:{type:Object,default:null},disabled:{type:Boolean,default:!1},hasError:{type:Boolean,default:!1}},emits:["change"],setup(e,{emit:t}){const a=e,l=t,s=()=>{var i,c;return((c=(i=a.variant)==null?void 0:i.other_info)==null?void 0:c.payment_type)==="subscription"};return(i,c)=>{const p=C("el-option"),f=C("el-select");return e.variant&&s()?(r(),E(f,{key:0,modelValue:e.variant.other_info.repeat_interval,"onUpdate:modelValue":c[0]||(c[0]=_=>e.variant.other_info.repeat_interval=_),size:"small",class:de({"is-field-error":e.hasError}),disabled:e.disabled,onChange:c[1]||(c[1]=_=>l("change"))},{default:d(()=>[n(p,{label:i.$t("Yearly"),value:"yearly"},null,8,["label"]),n(p,{label:i.$t("Half Yearly"),value:"half_yearly"},null,8,["label"]),n(p,{label:i.$t("Quarterly"),value:"quarterly"},null,8,["label"]),n(p,{label:i.$t("Monthly"),value:"monthly"},null,8,["label"]),n(p,{label:i.$t("Weekly"),value:"weekly"},null,8,["label"]),n(p,{label:i.$t("Daily"),value:"daily"},null,8,["label"])]),_:1},8,["modelValue","class","disabled"])):(r(),h("span",Wge,"—"))}}},Jge={key:1,class:"text-gray-300 text-sm flex justify-center"},ti={__name:"BulkTrialDaysInput",props:{variant:{type:Object,default:null},disabled:{type:Boolean,default:!1},hasError:{type:Boolean,default:!1}},emits:["change"],setup(e,{emit:t}){const a=e,l=t,s=()=>{var i,c;return((c=(i=a.variant)==null?void 0:i.other_info)==null?void 0:c.payment_type)==="subscription"};return(i,c)=>{const p=C("el-input");return e.variant&&s()?(r(),E(p,{key:0,class:de(["fct-bulk-input",{"is-error":e.hasError}]),modelValue:e.variant.other_info.trial_days,"onUpdate:modelValue":c[0]||(c[0]=f=>e.variant.other_info.trial_days=f),placeholder:"0",disabled:e.disabled,onChange:c[1]||(c[1]=f=>l("change")),size:"small"},null,8,["class","modelValue","disabled"])):(r(),h("span",Jge,"—"))}}},Xge={key:1,class:"text-gray-300 text-sm flex justify-center"},ai={__name:"BulkComparePriceInput",props:{variant:{type:Object,default:null},disabled:{type:Boolean,default:!1},hasError:{type:Boolean,default:!1}},emits:["change"],setup(e,{emit:t}){const a=t;return(l,s)=>e.variant?(r(),E(Za,{key:0,size:"small","error-class":e.hasError?"is-error":"","model-value":e.variant.compare_price,placeholder:l.$t("Compare price"),disabled:e.disabled,"onUpdate:modelValue":s[0]||(s[0]=i=>{e.variant.compare_price=i,a("change")})},null,8,["error-class","model-value","placeholder","disabled"])):(r(),h("span",Xge,"—"))}},xf={__name:"BulkCategorySelect",props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const a=t,l=s=>{a("update:modelValue",s),a("change",s)};return(s,i)=>{const c=C("el-option"),p=C("el-select");return r(),E(p,{"model-value":e.modelValue,multiple:"",filterable:"","allow-create":"","default-first-option":"","collapse-tags":"","collapse-tags-tooltip":!1,"max-collapse-tags":1,size:"small",placeholder:s.$t("Select or type..."),disabled:e.disabled,"onUpdate:modelValue":l},{default:d(()=>[(r(!0),h(P,null,te(e.options,f=>(r(),E(c,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","disabled"])}}},Zge=["textContent"],eye={key:1,class:"fct-bulk-editor-placeholder"},li={__name:"BulkEditorCell",props:{value:{type:String,default:""},placeholder:{type:String,default:""}},emits:["click"],setup(e){return(t,a)=>(r(),h("div",{class:"fct-bulk-editor",onClick:a[0]||(a[0]=l=>t.$emit("click"))},[e.value?(r(),h("span",{key:0,class:"bulk-editor-preview",textContent:m(e.value)},null,8,Zge)):(r(),h("span",eye,m(e.placeholder),1))]))}};function Sf(){const e=T(new Set),t=T(null),a=T(!1),l=(y,v,w)=>{if(v.shiftKey&&t.value!==null){const b=w.indexOf(t.value),S=w.indexOf(y);if(b!==-1&&S!==-1){const $=Math.min(b,S),D=Math.max(b,S),F=new Set(e.value);for(let B=$;B<=D;B++)F.add(w[B]);e.value=F}}else{const b=new Set(e.value);b.has(y)?b.delete(y):b.add(y),e.value=b,t.value=y}},s=y=>{e.value.size===y.length&&y.length>0?e.value=new Set:e.value=new Set(y)},i=y=>{e.value=new Set(y)},c=()=>{e.value=new Set,t.value=null,a.value=!1},p=()=>{a.value?a.value=!1:e.value.size>=2&&(a.value=!0)};be(e,y=>{a.value&&y.size<2&&(a.value=!1)});const f=y=>e.value.has(y),_=K(()=>e.value.size);return{selectedKeys:e,lastClickedKey:t,isLinkMode:a,handleRowClick:l,toggleSelectAll:s,selectAll:i,deselectAll:c,toggleLinkMode:p,isSelected:f,selectedCount:_,pruneStaleKeys:y=>{const v=new Set(y);let w=!1;const k=new Set;for(const b of e.value)v.has(b)?k.add(b):w=!0;w&&(e.value=k),t.value&&!v.has(t.value)&&(t.value=null)}}}const tye={mounted(e,t){e.indeterminate=!!t.value},updated(e,t){e.indeterminate=!!t.value}},Ff={title:{product:{get:e=>e.post_title,set:(e,t)=>e.post_title=t},variant:{get:e=>e.variation_title,set:(e,t)=>e.variation_title=t}},sku:{product:{get:e=>{var t,a;return(a=(t=e.variants)==null?void 0:t[0])==null?void 0:a.sku},set:(e,t)=>{var a;(a=e.variants)!=null&&a[0]&&(e.variants[0].sku=t)}},variant:{get:e=>e.sku,set:(e,t)=>e.sku=t}},status:{product:{get:e=>e.post_status,set:(e,t)=>e.post_status=t}},description:{product:{get:e=>e.post_content,set:(e,t)=>e.post_content=t}},short_desc:{product:{get:e=>e.post_excerpt,set:(e,t)=>e.post_excerpt=t}},product_type:{product:{get:e=>{var t;return(t=e.detail)==null?void 0:t.fulfillment_type},set:(e,t)=>{e.detail&&(e.detail.fulfillment_type=t)}}},pricing_type:{product:{get:e=>{var t;return(t=e.detail)==null?void 0:t.variation_type},set:(e,t)=>{e.detail&&(e.detail.variation_type=t)}}},payment_type:{product:{get:e=>{var t,a,l;return(l=(a=(t=e.variants)==null?void 0:t[0])==null?void 0:a.other_info)==null?void 0:l.payment_type},set:(e,t)=>{var a,l;(l=(a=e.variants)==null?void 0:a[0])!=null&&l.other_info&&(e.variants[0].other_info.payment_type=t)}},variant:{get:e=>{var t;return(t=e.other_info)==null?void 0:t.payment_type},set:(e,t)=>{e.other_info&&(e.other_info.payment_type=t)}}},interval:{product:{get:e=>{var t,a,l;return(l=(a=(t=e.variants)==null?void 0:t[0])==null?void 0:a.other_info)==null?void 0:l.repeat_interval},set:(e,t)=>{var a,l;(l=(a=e.variants)==null?void 0:a[0])!=null&&l.other_info&&(e.variants[0].other_info.repeat_interval=t)}},variant:{get:e=>{var t;return(t=e.other_info)==null?void 0:t.repeat_interval},set:(e,t)=>{e.other_info&&(e.other_info.repeat_interval=t)}}},trial_days:{product:{get:e=>{var t,a,l;return(l=(a=(t=e.variants)==null?void 0:t[0])==null?void 0:a.other_info)==null?void 0:l.trial_days},set:(e,t)=>{var a,l;(l=(a=e.variants)==null?void 0:a[0])!=null&&l.other_info&&(e.variants[0].other_info.trial_days=t)}},variant:{get:e=>{var t;return(t=e.other_info)==null?void 0:t.trial_days},set:(e,t)=>{e.other_info&&(e.other_info.trial_days=t)}}},price:{product:{get:e=>{var t,a;return(a=(t=e.variants)==null?void 0:t[0])==null?void 0:a.item_price},set:(e,t)=>{var a;(a=e.variants)!=null&&a[0]&&(e.variants[0].item_price=t)}},variant:{get:e=>e.item_price,set:(e,t)=>e.item_price=t}},compare_price:{product:{get:e=>{var t,a;return(a=(t=e.variants)==null?void 0:t[0])==null?void 0:a.compare_price},set:(e,t)=>{var a;(a=e.variants)!=null&&a[0]&&(e.variants[0].compare_price=t)}},variant:{get:e=>e.compare_price,set:(e,t)=>e.compare_price=t}},manage_stock:{product:{get:e=>{var t;return(t=e.detail)==null?void 0:t.manage_stock},set:(e,t)=>{e.detail&&(e.detail.manage_stock=t)}}},categories:{product:{get:e=>e.categories,set:(e,t)=>e.categories=[...t]}}},aye={...Ff,stock:{product:{get:e=>{var t;return(t=e.detail)==null?void 0:t.total_stock},set:(e,t)=>{e.detail&&(e.detail.total_stock=t)}},variant:{get:e=>e.total_stock,set:(e,t)=>e.total_stock=t}}},lye={...Ff,stock:{product:{get:e=>{var t,a;return(a=(t=e.variants)==null?void 0:t[0])==null?void 0:a.available},set:(e,t)=>{var a;(a=e.variants)!=null&&a[0]&&(e.variants[0].available=t)}},variant:{get:e=>e.available,set:(e,t)=>e.available=t}}};function $f(e,t,a,l,s,i,c){const p=c[e];if(p)for(const f of l){if(f===a)continue;const _=s(f);if(!_)continue;const g=p[_.type];g&&(g.set(_.data,t),i&&i(_.product))}}const sye={class:"fct-bulk-insert-page fct-layout-width"},nye={class:"fct-btn-group sm justify-end"},oye={class:"filter-popover-item"},iye={class:"filter-popover-title"},rye={key:0,"aria-hidden":"true"},dye=["colspan"],uye=["onClick"],cye=["onClick"],Aye={class:"fct-bulk-product-title-cell sticky-col",style:{left:"40px"}},pye={class:"flex items-center"},fye=["onClick","title"],mye={key:0,class:"bulk-collapse-count"},hye=["title"],_ye=["title"],vye={class:"bulk-status-icon is-error"},gye={key:0,class:"fct-bulk-sku-cell"},yye={key:1,class:"text-gray-300 text-sm flex justify-center"},bye={key:1,class:"fct-bulk-media-cell"},wye={key:2,class:"fct-bulk-categories-cell"},Cye={key:3,class:"fct-bulk-desc-cell"},kye={key:4,class:"fct-bulk-short-desc-cell"},Bye={key:5,class:"fct-bulk-status-cell"},xye={key:6,class:"fct-bulk-product-type-cell"},Sye={key:7,class:"fct-bulk-product-type-cell"},Fye={key:8,class:"fct-bulk-pricing-type-cell"},$ye={key:9,class:"fct-bulk-pricing-type-cell"},Eye={key:10,class:"fct-bulk-payment-type-cell"},Uye={key:11,class:"fct-bulk-interval-cell"},Iye={key:12,class:"fct-bulk-trial-days-cell"},Qye={key:13,class:"fct-bulk-best-price-cell"},Dye={key:14,class:"fct-bulk-compare-price-cell"},Vye={key:15,class:"fct-bulk-qty-cell !pl-5"},Tye={key:16,class:"fct-bulk-stock-cell"},Mye={key:1,class:"text-gray-300 text-sm pl-5"},Lye={class:"fct-btn-group xs justify-end"},Rye=["href","title"],Oye={key:0,class:"bulk-variants-block-row"},Pye=["colspan"],Hye={class:"bulk-inner-table",style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},Nye=["onClick"],Kye={class:"bulk-checkbox-cell"},Gye={class:"fct-bulk-product-title-cell sticky-col",style:{left:"40px"}},zye={class:"flex items-center gap-1 pl-4"},jye={class:"bulk-status-icon is-error"},qye={key:0,class:"fct-bulk-sku-cell"},Yye={key:1,class:"fct-bulk-media-cell"},Wye={key:2},Jye={key:3},Xye={key:4},Zye={key:5},e1e={key:6},t1e={key:7},a1e={key:8},l1e={key:9},s1e={key:10},n1e={key:11},o1e={key:12},i1e={key:13,class:"text-center"},r1e={key:14},d1e={key:1,class:"text-gray-300 text-sm flex justify-center"},u1e={class:"fct-btn-group sm justify-end"},c1e={class:"bulk-add-variant-row"},A1e=["colspan"],p1e={class:"sticky left-0 inline-block pl-6"},f1e={key:1,"aria-hidden":"true"},m1e=["colspan"],ur=43,h1e=10,_1e=800,Uc=100,v1e={__name:"BulkInsert",setup(e){const{options:t,products:a}=Ft.data,l=ge=>{var Fe;return((Fe=ge==null?void 0:ge.detail)==null?void 0:Fe.variation_type)==="simple"},s=K(()=>Ft.data.saving),i=K(()=>Ft.data.saveProgress),c=K(()=>{const ge=Ft.data.saveProgress;return ge.total?Math.round(ge.completed/ge.total*100):0}),p=()=>{Ft.saveProducts()},f=ge=>Ft.isSaving(ge._cid),_=ge=>Ft.isSaved(ge._cid),g=ge=>Ft.isRowDisabled(ge._cid),y=ge=>Ft.hasError(ge._cid),v=ge=>Ft.getError(ge._cid),w=ge=>Ft.hasProductLevelError(ge._cid),k=(ge,Fe)=>Ft.hasVariantError(ge._cid,Fe),b=(ge,Fe)=>Ft.getVariantError(ge._cid,Fe),S=(ge,Fe)=>Ft.hasFieldError(ge._cid,Fe),$=(ge,Fe,ot)=>Ft.hasVariantFieldError(ge._cid,Fe,ot),D=async ge=>{const Fe=ge.post_title||H.$t("Untitled product"),ot=Array.isArray(ge.variants)?ge.variants.length:0,wt=Ft.isSaved(ge._cid);let kt=ot>0?H.$t('This will remove "%1$s" and its %2$s variant(s).',Fe,ot):H.$t('This will remove "%1$s".',Fe);wt&&(kt+=" "+H.$t("This product was already saved and will be permanently deleted."));try{await Fl.confirm(kt,H.$t("Remove Product"),{confirmButtonText:H.$t("Remove"),cancelButtonText:H.$t("Cancel"),type:"warning"})}catch{return}await Ft.removeProduct(ge)},F=(ge,Fe)=>{const ot=Fe.variation_title||H.$t("Untitled variant");Fl.confirm(H.$t('This will remove the variant "%1$s".',ot),H.$t("Remove Variant"),{confirmButtonText:H.$t("Remove"),cancelButtonText:H.$t("Cancel"),confirmButtonClass:"el-button--small",cancelButtonClass:"el-button--small",type:"warning"}).then(()=>{Ft.removeVariant(ge,Fe)}).catch(()=>{})},B=ge=>Ft.duplicateProduct(ge),U=(ge,Fe)=>Ft.duplicateVariant(ge,Fe),Q=()=>{const ge=[];for(const Fe of a){const ot=`p:${Fe._cid}`,wt=ue.value.has(ot),kt=[];Fe.variants&&Fe.variants.forEach((Xt,vt)=>{ue.value.has(`v:${Fe._cid}:${vt}`)&&kt.push(vt)}),!(!wt&&kt.length===0)&&(wt&&kt.length===0?ge.push({product:Fe,type:"full"}):!wt&&kt.length>0?ge.push({product:Fe,type:"variants-only",variantIndexes:kt}):ge.push({product:Fe,type:"partial",variantIndexes:kt}))}return ge},V=()=>{const ge=Q();if(!ge.length)return;const Fe=ge.filter(vt=>vt.type==="full").length,ot=ge.filter(vt=>vt.type==="partial").length,kt=ge.filter(vt=>vt.type==="variants-only").reduce((vt,ea)=>vt+ea.variantIndexes.length,0),Xt=[];Fe>0&&Xt.push(`${Fe} product(s) with all variants`),ot>0&&Xt.push(`${ot} product(s) with selected variants`),kt>0&&Xt.push(`${kt} variant(s)`),Fl.confirm(H.$t("Duplicate %s?").replace("%s",Xt.join(", ")),H.$t("Bulk Duplicate"),{confirmButtonText:H.$t("Duplicate"),cancelButtonText:H.$t("Cancel"),type:"info"}).then(()=>{for(const vt of ge)if(vt.type==="full")Ft.duplicateProduct(vt.product);else if(vt.type==="variants-only")for(const ea of vt.variantIndexes){const ta=vt.product.variants[ea];ta&&Ft.duplicateVariant(vt.product,ta)}else vt.type==="partial"&&Ft.duplicateProductWithVariants(vt.product,vt.variantIndexes);ae()}).catch(()=>{})},I=async()=>{const ge=[],Fe=[];for(const vt of a){const ea=`p:${vt._cid}`;if(ue.value.has(ea)){ge.push(vt);continue}const zt=[];vt.variants&&vt.variants.forEach((wa,qa)=>{ue.value.has(`v:${vt._cid}:${qa}`)&&zt.push(wa)}),zt.length>0&&Fe.push({product:vt,variants:zt})}if(!ge.length&&!Fe.length)return;const ot=ge.filter(vt=>Ft.isSaved(vt._cid)).length,wt=Fe.reduce((vt,ea)=>vt+ea.variants.length,0),kt=[];ge.length>0&&kt.push(`${ge.length} product(s)`),wt>0&&kt.push(`${wt} variant(s)`);let Xt=H.$t("Remove %s?").replace("%s",kt.join(" and "));ot>0&&(Xt+=" "+H.$t("%s already saved will be permanently deleted.").replace("%s",`${ot}`));try{await Fl.confirm(Xt,H.$t("Bulk Remove"),{confirmButtonText:H.$t("Remove"),cancelButtonText:H.$t("Cancel"),type:"warning"})}catch{return}for(const vt of ge)await Ft.removeProduct(vt);for(const{product:vt,variants:ea}of Fe)for(const ta of ea)Ft.removeVariant(vt,ta);ae()},M=ge=>{Ft.resetPaymentTypeDefaults(ge)},O=(ge,Fe)=>{const ot=Ft.data.categoryOptions;for(const wt of Fe)ot.find(kt=>kt.value===wt)||ot.push({label:wt,value:wt})},L=()=>{Ft.populateDummyProduct()},H=Jt().ctx,j=ge=>{const Fe=Ft.data.products;ge.concat||(Fe.splice(0,Fe.length),Ft.data.savedIds=new Set,Ft.data.savingIds=new Set,Ft.data.productErrors=new Map),Fe.push(...ge.products)},W=T({visible:!1,field:"",product:null,value:""}),G=(ge,Fe)=>{W.value={visible:!0,field:Fe,product:ge,value:ge[Fe]||""}},Z=ge=>{W.value.value=ge},ne=()=>{const{product:ge,field:Fe,value:ot}=W.value;ge&&(ge[Fe]=ot),W.value.visible=!1},ce=K(()=>W.value.field==="post_content"?H.$t("Edit Description"):H.$t("Edit Short Description")),z=T(!0),{selectedKeys:ue,handleRowClick:ie,toggleSelectAll:J,selectAll:N,deselectAll:ae,isSelected:oe,selectedCount:fe,isLinkMode:re,toggleLinkMode:Ee}=Sf(),ye=K(()=>{const ge=[];for(const Fe of _t.value)if(ge.push(`p:${Fe.productId}`),Fe.hasVariants&&!Fe.collapsed)for(let ot=0;ot<Fe.product.variants.length;ot++)ge.push(`v:${Fe.productId}:${ot}`);return ge}),Ce=ge=>{var Fe;if(ge.startsWith("p:")){const ot=ge.slice(2),wt=a.find(kt=>kt._cid===ot);return wt?{type:"product",data:wt,product:wt}:null}else if(ge.startsWith("v:")){const ot=ge.split(":"),wt=ot[1],kt=parseInt(ot[2]),Xt=a.find(vt=>vt._cid===wt);if(Xt&&((Fe=Xt.variants)!=null&&Fe[kt]))return{type:"variant",data:Xt.variants[kt],product:Xt}}return null},ve=(ge,Fe,ot)=>{!re.value||!oe(ot)||$f(ge,Fe,ot,ue.value,Ce,null,aye)},Ue=T(!1),Ke=ge=>{ge.key==="Shift"&&(Ue.value=!0)},We=ge=>{ge.key==="Shift"&&(Ue.value=!1)},Be=(ge,Fe)=>{if(!Fe.shiftKey||Fe.target.closest(".bulk-checkbox-cell"))return;Fe.preventDefault();const ot=new Set(ue.value);ot.has(ge)?ot.delete(ge):ot.add(ge),ue.value=ot},$e=T([]),He=K(()=>$e.value.filter(ge=>ge.key==="title"||ge.key==="actions"?!0:Ft.isColumnVisible(ge.key))),Re=ge=>Ft.isColumnVisible(ge),yt=()=>{Ft.saveColumnWidths($e.value)},gt=T(new Set),Rt=ge=>{const Fe=ge._cid;gt.value.has(Fe)?gt.value.delete(Fe):gt.value.add(Fe),gt.value=new Set(gt.value)},Tt=ge=>gt.value.has(ge._cid),Dt=T(0),_t=K(()=>{let ge=0;return a.map(Fe=>{var zt;const ot=Fe._cid,wt=((zt=Fe.detail)==null?void 0:zt.variation_type)!=="simple"&&Array.isArray(Fe.variants),kt=wt?Fe.variants.length:0,Xt=gt.value.has(ot),vt=wt&&!Xt?(kt+1)*ur:0,ea=ur+vt,ta={product:Fe,productId:ot,hasVariants:wt,variantCount:kt,collapsed:Xt,groupHeight:ea,offset:ge};return ge+=ea,ta})}),Gt=K(()=>{const ge=_t.value;if(ge.length===0)return 0;const Fe=ge[ge.length-1];return Fe.offset+Fe.groupHeight}),bt=K(()=>{const ge=_t.value,Fe=Dt.value,ot=Fe+_1e,wt=h1e*ur;return ge.filter(kt=>kt.offset+kt.groupHeight>=Fe-wt&&kt.offset<=ot+wt)}),St=K(()=>bt.value.length===0?0:bt.value[0].offset),Pt=K(()=>{if(bt.value.length===0)return 0;const ge=bt.value[bt.value.length-1];return Gt.value-ge.offset-ge.groupHeight});let Ht=null,Qt=0;const ht=ge=>{const Fe=ge.target,ot=Date.now();Ht&&clearTimeout(Ht),ot-Qt>=Uc?(Dt.value=Fe.scrollTop,Qt=ot):Ht=setTimeout(()=>{Dt.value=Fe.scrollTop,Qt=Date.now(),Ht=null},Uc)};let qt=null;return Ie(async()=>{qt=bs(),qt.bind("mod+a",ge=>{var ot,wt;const Fe=(ot=document.activeElement)==null?void 0:ot.tagName;Fe==="INPUT"||Fe==="TEXTAREA"||(wt=document.activeElement)!=null&&wt.isContentEditable||(ge.preventDefault(),N(ye.value))}),qt.bind("escape",()=>{var Fe,ot;const ge=(Fe=document.activeElement)==null?void 0:Fe.tagName;ge==="INPUT"||ge==="TEXTAREA"||(ot=document.activeElement)!=null&&ot.isContentEditable||(re.value?Ee():ae())}),$e.value=[{key:"title",title:H.$t("Title"),width:150,minWidth:100},{key:"sku",title:H.$t("SKU"),width:120,minWidth:80},{key:"media",title:H.$t("Media"),width:100,minWidth:50},{key:"categories",title:H.$t("Categories"),width:200,minWidth:150},{key:"description",title:H.$t("Description"),width:200,minWidth:150},{key:"short_description",title:H.$t("Short Description"),width:150,minWidth:100},{key:"status",title:H.$t("Status"),width:100,minWidth:50},{key:"product_type",title:H.$t("Product Type"),width:200,minWidth:150},{key:"pricing_type",title:H.$t("Pricing Type"),width:200,minWidth:150},{key:"payment_type",title:H.$t("Payment Type"),width:120,minWidth:100},{key:"interval",title:H.$t("Interval"),width:120,minWidth:80},{key:"trial_days",title:H.$t("Trial Days"),width:100,minWidth:70},{key:"best_price",title:H.$t("Best Price"),width:100,minWidth:100},{key:"compare_price",title:H.$t("Compare-at Price"),width:200,minWidth:150},{key:"track_quantity",title:H.$t("Track Quantity"),width:100,minWidth:100},{key:"stock",title:H.$t("Stock"),width:150,minWidth:150},{key:"actions",title:"",width:110,minWidth:110}],Ft.restoreColumnWidths($e.value),Ft.setupColumnVisibility(),Ft.fetchCategories(),document.body.classList.add("fct-bulk-page"),window.addEventListener("keydown",Ke),window.addEventListener("keyup",We)}),cl(()=>{document.body.classList.remove("fct-bulk-page"),window.removeEventListener("keydown",Ke),window.removeEventListener("keyup",We),qt&&qt.reset()}),(ge,Fe)=>{const ot=C("el-button"),wt=C("el-progress"),kt=C("el-checkbox"),Xt=C("el-checkbox-group"),vt=C("el-tooltip"),ea=C("el-popover"),ta=C("el-input"),zt=C("el-icon"),wa=C("el-option"),qa=C("el-select"),il=C("el-switch"),Ya=C("el-dialog");return r(),h("div",sye,[n(ol,{title:ge.$t("Bulk Insert")},{action:d(()=>[n(bge,{onOnDataPopulated:j}),n(ot,{onClick:L},{default:d(()=>[R(m(ge.$t("Add Product")),1)]),_:1}),n(ot,{type:"primary",onClick:p,loading:s.value,disabled:s.value||A(a).length===0},{default:d(()=>[R(m(s.value?ge.$t("Saving %s/%s...").replace("%s",i.value.completed).replace("%s",i.value.total):ge.$t("Save All Products")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["title"]),s.value?(r(),E(wt,{key:0,percentage:c.value,"stroke-width":6,class:"mb-4"},null,8,["percentage"])):x("",!0),n(Se,null,{default:d(()=>{var ma;return[A(a).length>0?(r(),E(Ve,{key:0,title:((ma=A(a))==null?void 0:ma.length)===1?ge.$t("Product"):ge.$t("Products"),border_bottom:""},{action:d(()=>[o("div",nye,[n(ot,{disabled:A(fe)===0,onClick:I,size:"small",type:"danger",soft:""},{default:d(()=>[Fe[8]||(Fe[8]=o("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o("polyline",{points:"3 6 5 6 21 6"}),o("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)),R(" "+m(ge.$t("Delete")),1)]),_:1,__:[8]},8,["disabled"]),n(ot,{disabled:A(fe)===0,onClick:V,size:"small",type:"info",soft:""},{default:d(()=>[Fe[9]||(Fe[9]=o("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),o("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})],-1)),R(" "+m(ge.$t("Duplicate")),1)]),_:1,__:[9]},8,["disabled"]),n(ot,{class:de({"is-active":A(re)}),disabled:A(fe)<2&&!A(re),onClick:A(Ee),size:"small",type:"info",soft:""},{default:d(()=>[Fe[10]||(Fe[10]=o("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),o("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})],-1)),R(" "+m(A(re)?ge.$t("Unlink"):ge.$t("Link")),1)]),_:1,__:[10]},8,["class","disabled","onClick"]),n(kt,{modelValue:z.value,"onUpdate:modelValue":Fe[0]||(Fe[0]=X=>z.value=X),label:ge.$t("Pin Actions")},null,8,["modelValue","label"]),n(ea,{trigger:"click",placement:"bottom-end",width:"240","popper-class":"filter-popover"},{reference:d(()=>[o("span",null,[n(vt,{effect:"light",content:ge.$t("Toggle columns"),placement:"top","popper-class":"fct-tooltip"},{default:d(()=>[n(at,{tag:"button",size:"small"},{default:d(()=>[n(Y,{name:"ColumnIcon"})]),_:1})]),_:1},8,["content"])])]),default:d(()=>[o("div",oye,[o("h3",iye,m(ge.$t("Columns")),1),n(Xt,{modelValue:A(Ft).data.visibleColumns,"onUpdate:modelValue":Fe[1]||(Fe[1]=X=>A(Ft).data.visibleColumns=X),class:"fct-checkbox-blocks",onChange:Fe[2]||(Fe[2]=X=>A(Ft).handleColumnVisibilityChange())},{default:d(()=>[(r(!0),h(P,null,te(A(Ft).getToggleableColumns(),X=>(r(),E(kt,{key:X.value,value:X.value,label:ge.$t(X.label)},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])])]),_:1})])]),_:1},8,["title"])):x("",!0),n(ke,{class:"p-0"},{default:d(()=>[A(a).length>0?(r(),h("div",{key:0,class:de(["relative",{"is-link-mode":A(re),"is-shift-held":Ue.value}])},[n(Bf,{columns:He.value,"sticky-last":z.value,onScroll:ht,onResizeEnd:yt},{"header-first":d(()=>[n(kt,{"model-value":A(fe)>0&&A(fe)===ye.value.length,indeterminate:A(fe)>0&&A(fe)<ye.value.length,onChange:Fe[3]||(Fe[3]=X=>A(J)(ye.value))},null,8,["model-value","indeterminate"])]),"header-last":d(()=>[R(m(ge.$t("Actions")),1)]),default:d(()=>[St.value>0?(r(),h("tr",rye,[o("td",{colspan:He.value.length+1,style:ra({height:St.value+"px",padding:0,border:"none"})},null,12,dye)])):x("",!0),(r(!0),h(P,null,te(bt.value,X=>{var we,le,he,Ye,st,je,Xe,mt,et,It,pe,_e,Oe,Me,ct;return r(),h(P,{key:X.productId},[o("tr",{class:de(["bulk-product-row",{"is-saving":f(X.product),"is-saved":_(X.product),"has-product-error":y(X.product),"is-selected":A(oe)(`p:${X.productId}`)}]),onClick:ee=>Be(`p:${X.productId}`,ee)},[o("td",{class:"bulk-checkbox-cell",onClick:ee=>A(ie)(`p:${X.productId}`,ee,ye.value)},[n(kt,{"model-value":A(oe)(`p:${X.productId}`),tabindex:"-1"},null,8,["model-value"])],8,cye),o("td",Aye,[o("div",pye,[X.hasVariants?(r(),h("button",{key:0,class:"bulk-collapse-btn",onClick:Ge(ee=>Rt(X.product),["prevent"]),title:Tt(X.product)?ge.$t("Expand variants"):ge.$t("Collapse variants")},[(r(),h("svg",{class:de(["bulk-collapse-icon",{"is-collapsed":Tt(X.product)}]),width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},Fe[11]||(Fe[11]=[o("path",{d:"M6 4L10 8L6 12",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2)),Tt(X.product)?(r(),h("span",mye,m(X.variantCount),1)):x("",!0)],8,fye)):x("",!0),n(ta,{class:de(["fct-bulk-input",{"is-error":S(X.product,"post_title")}]),modelValue:X.product.post_title,"onUpdate:modelValue":ee=>X.product.post_title=ee,placeholder:ge.$t("Product title"),size:"small",disabled:g(X.product),onInput:ee=>ve("title",ee,`p:${X.productId}`)},null,8,["class","modelValue","onUpdate:modelValue","placeholder","disabled","onInput"]),f(X.product)?(r(),h("span",{key:1,class:"bulk-status-icon is-syncing",title:ge.$t("Saving...")},[n(zt,{class:"is-loading",size:14},{default:d(()=>[n(A(en))]),_:1})],8,hye)):_(X.product)?(r(),h("span",{key:2,class:"bulk-status-icon is-saved",title:ge.$t("Saved")},Fe[12]||(Fe[12]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16"},[o("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-.997-6l7.07-7.071-1.414-1.414-5.656 5.657-2.829-2.829-1.414 1.414L11.003 16z"})],-1)]),8,_ye)):w(X.product)||l(X.product)&&y(X.product)?(r(),E(vt,{key:3,content:v(X.product),placement:"top"},{default:d(()=>[o("span",vye,[n(zt,{size:16},{default:d(()=>[n(A(Vo))]),_:1})])]),_:2},1032,["content"])):x("",!0)])]),Re("sku")?(r(),h("td",gye,[((le=(we=X.product)==null?void 0:we.detail)==null?void 0:le.variation_type)==="simple"&&((he=X.product.variants)!=null&&he[0])?(r(),E(ta,{key:0,class:de(["fct-bulk-input",{"is-error":S(X.product,"variants.0.sku")}]),modelValue:X.product.variants[0].sku,"onUpdate:modelValue":[ee=>X.product.variants[0].sku=ee,ee=>ve("sku",ee,`p:${X.productId}`)],placeholder:"SKU",size:"small",disabled:g(X.product)},null,8,["class","modelValue","onUpdate:modelValue","disabled"])):(r(),h("span",yye,"—"))])):x("",!0),Re("media")?(r(),h("td",bye,[n(yl,{modelValue:X.product.gallery,"onUpdate:modelValue":ee=>X.product.gallery=ee,"show-url-tab":"",disabled:g(X.product)},null,8,["modelValue","onUpdate:modelValue","disabled"])])):x("",!0),Re("categories")?(r(),h("td",wye,[n(xf,{modelValue:X.product.categories,"onUpdate:modelValue":ee=>X.product.categories=ee,options:A(Ft).data.categoryOptions,disabled:g(X.product),onChange:ee=>{O(X.product,ee),ve("categories",X.product.categories,`p:${X.productId}`)}},null,8,["modelValue","onUpdate:modelValue","options","disabled","onChange"])])):x("",!0),Re("description")?(r(),h("td",Cye,[n(li,{value:X.product.post_content,placeholder:ge.$t("Description"),onClick:ee=>G(X.product,"post_content")},null,8,["value","placeholder","onClick"])])):x("",!0),Re("short_description")?(r(),h("td",kye,[n(li,{value:X.product.post_excerpt,placeholder:ge.$t("Short description"),onClick:ee=>G(X.product,"post_excerpt")},null,8,["value","placeholder","onClick"])])):x("",!0),Re("status")?(r(),h("td",Bye,[n(qa,{modelValue:X.product.post_status,"onUpdate:modelValue":ee=>X.product.post_status=ee,size:"small",class:de({"is-field-error":S(X.product,"post_status")}),disabled:g(X.product),onChange:ee=>ve("status",X.product.post_status,`p:${X.productId}`)},{default:d(()=>[(r(!0),h(P,null,te(A(t).status,ee=>(r(),E(wa,{key:ee.value,label:ge.$t(ee.title),value:ee.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled","onChange"])])):x("",!0),Re("product_type")&&((Ye=X.product)!=null&&Ye.detail)?(r(),h("td",xye,[n(qa,{modelValue:X.product.detail.fulfillment_type,"onUpdate:modelValue":ee=>X.product.detail.fulfillment_type=ee,size:"small",class:de({"is-field-error":S(X.product,"detail.fulfillment_type")}),disabled:g(X.product),onChange:ee=>ve("product_type",X.product.detail.fulfillment_type,`p:${X.productId}`)},{default:d(()=>[(r(!0),h(P,null,te(A(t).fulfilment,ee=>(r(),E(wa,{key:ee.value,label:ge.$t(ee.title),value:ee.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled","onChange"])])):Re("product_type")?(r(),h("td",Sye)):x("",!0),Re("pricing_type")&&((st=X.product)!=null&&st.detail)?(r(),h("td",Fye,[n(qa,{modelValue:X.product.detail.variation_type,"onUpdate:modelValue":ee=>X.product.detail.variation_type=ee,size:"small",class:de({"is-field-error":S(X.product,"detail.variation_type")}),disabled:g(X.product),onChange:ee=>{A(Ft).handleVariationChanged(X.product,ee),ve("pricing_type",ee,`p:${X.productId}`)}},{default:d(()=>[(r(!0),h(P,null,te(A(t).variation,ee=>(r(),E(wa,{key:ee.value,label:ge.$t(ee.title),value:ee.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled","onChange"])])):Re("pricing_type")?(r(),h("td",$ye)):x("",!0),Re("payment_type")?(r(),h("td",Eye,[n(Zo,{variant:l(X.product)?(je=X.product.variants)==null?void 0:je[0]:null,disabled:g(X.product),"has-error":S(X.product,"variants.0.other_info.payment_type"),onPaymentTypeChange:ee=>{var Ne;M(ee),ve("payment_type",(Ne=ee.other_info)==null?void 0:Ne.payment_type,`p:${X.productId}`)}},null,8,["variant","disabled","has-error","onPaymentTypeChange"])])):x("",!0),Re("interval")?(r(),h("td",Uye,[n(ei,{variant:l(X.product)?(Xe=X.product.variants)==null?void 0:Xe[0]:null,disabled:g(X.product),"has-error":S(X.product,"variants.0.other_info.repeat_interval"),onChange:ee=>{var Ne,pt,De;return ve("interval",(De=(pt=(Ne=X.product.variants)==null?void 0:Ne[0])==null?void 0:pt.other_info)==null?void 0:De.repeat_interval,`p:${X.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("trial_days")?(r(),h("td",Iye,[n(ti,{variant:l(X.product)?(mt=X.product.variants)==null?void 0:mt[0]:null,disabled:g(X.product),"has-error":S(X.product,"variants.0.other_info.trial_days"),onChange:ee=>{var Ne,pt,De;return ve("trial_days",(De=(pt=(Ne=X.product.variants)==null?void 0:Ne[0])==null?void 0:pt.other_info)==null?void 0:De.trial_days,`p:${X.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("best_price")?(r(),h("td",Qye,[n(Xo,{variant:l(X.product)?(et=X.product.variants)==null?void 0:et[0]:null,disabled:g(X.product),"has-error":S(X.product,"variants.0.item_price"),onChange:ee=>{var Ne,pt;return ve("price",(pt=(Ne=X.product.variants)==null?void 0:Ne[0])==null?void 0:pt.item_price,`p:${X.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("compare_price")?(r(),h("td",Dye,[n(ai,{variant:l(X.product)?(It=X.product.variants)==null?void 0:It[0]:null,disabled:g(X.product),"has-error":S(X.product,"variants.0.compare_price"),onChange:ee=>{var Ne,pt;return ve("compare_price",(pt=(Ne=X.product.variants)==null?void 0:Ne[0])==null?void 0:pt.compare_price,`p:${X.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("track_quantity")?(r(),h("td",Vye,[(pe=X.product)!=null&&pe.detail?(r(),E(il,{key:0,modelValue:X.product.detail.manage_stock,"onUpdate:modelValue":ee=>X.product.detail.manage_stock=ee,"active-value":"1","inactive-value":"0",disabled:g(X.product),onChange:ee=>{A(Ft).syncStockStatus(X.product),ve("manage_stock",X.product.detail.manage_stock,`p:${X.productId}`)}},null,8,["modelValue","onUpdate:modelValue","disabled","onChange"])):x("",!0)])):x("",!0),Re("stock")?(r(),h("td",Tye,[((Oe=(_e=X.product)==null?void 0:_e.detail)==null?void 0:Oe.manage_stock)==="1"&&((ct=(Me=X.product)==null?void 0:Me.detail)==null?void 0:ct.variation_type)==="simple"?(r(),E(ta,{key:0,modelValue:X.product.detail.total_stock,"onUpdate:modelValue":[ee=>X.product.detail.total_stock=ee,ee=>{var Ne;(Ne=X.product.variants)!=null&&Ne[0]&&(X.product.variants[0].total_stock=ee,X.product.variants[0].available=ee),A(Ft).syncStockStatus(X.product),ve("stock",ee,`p:${X.productId}`)}],disabled:g(X.product),size:"small",placeholder:ge.$t("e.g 10")},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):(r(),h("span",Mye,"—"))])):x("",!0),o("td",{class:de(["fct-bulk-actions-cell",{"sticky-col sticky-col-right":z.value}])},[o("div",Lye,[_(X.product)&&X.product.view_url?(r(),h("a",{key:0,href:X.product.view_url,target:"_blank",class:"bulk-action-btn bulk-view-link",title:ge.$t("View Product")},[n(Y,{name:"External"})],8,Rye)):x("",!0),n(at,{tag:"button",size:"x-small",onClick:Ge(ee=>B(X.product),["prevent"]),disabled:s.value||g(X.product),title:ge.$t("Duplicate")},{default:d(()=>[n(Y,{name:"Copy"})]),_:2},1032,["onClick","disabled","title"]),n(at,{tag:"button",size:"x-small",hover:"danger",onClick:Ge(ee=>D(X.product),["prevent"]),disabled:s.value||g(X.product),title:ge.$t("Delete")},{default:d(()=>[n(Y,{name:"Delete"})]),_:2},1032,["onClick","disabled","title"])])],2)],10,uye),X.hasVariants?(r(),h("tr",Oye,[o("td",{colspan:He.value.length+1,class:"!p-0 !border-b-0"},[n(ya,{accordion:"",visible:!X.collapsed,duration:200},{default:d(()=>[o("table",Hye,[o("colgroup",null,[Fe[13]||(Fe[13]=o("col",{style:{width:"40px"}},null,-1)),(r(!0),h(P,null,te(He.value,(ee,Ne)=>(r(),h("col",{key:Ne,style:ra({width:ee.width+"px"})},null,4))),128))]),o("tbody",null,[(r(!0),h(P,null,te(X.product.variants,(ee,Ne)=>{var pt,De;return r(),h("tr",{key:Ne,class:de(["bulk-variation-row",{"is-selected":A(oe)(`v:${X.productId}:${Ne}`)}]),onClick:xt=>Be(`v:${X.productId}:${Ne}`,xt)},[o("td",Kye,[n(kt,{"model-value":A(oe)(`v:${X.productId}:${Ne}`),tabindex:"-1",onChange:xt=>A(ie)(`v:${X.productId}:${Ne}`,xt,ye.value)},null,8,["model-value","onChange"])]),o("td",Gye,[o("div",zye,[Fe[14]||(Fe[14]=o("span",{class:"text-gray-300 text-xs"},"└",-1)),n(ta,{size:"small",modelValue:ee.variation_title,"onUpdate:modelValue":[xt=>ee.variation_title=xt,xt=>ve("title",xt,`v:${X.productId}:${Ne}`)],placeholder:ge.$t("Variation title"),disabled:g(X.product),class:de({"is-error":$(X.product,Ne,"variation_title")})},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","class"]),k(X.product,Ne)?(r(),E(vt,{key:0,content:b(X.product,Ne),placement:"top"},{default:d(()=>[o("span",jye,[n(zt,{size:14},{default:d(()=>[n(A(Vo))]),_:1})])]),_:2},1032,["content"])):x("",!0)])]),Re("sku")?(r(),h("td",qye,[n(ta,{size:"small",modelValue:ee.sku,"onUpdate:modelValue":[xt=>ee.sku=xt,xt=>ve("sku",xt,`v:${X.productId}:${Ne}`)],placeholder:"SKU",disabled:g(X.product),class:de({"is-error":$(X.product,Ne,"sku")})},null,8,["modelValue","onUpdate:modelValue","disabled","class"])])):x("",!0),Re("media")?(r(),h("td",Yye,[n(yl,{modelValue:ee.media,"onUpdate:modelValue":xt=>ee.media=xt,"show-url-tab":"",disabled:g(X.product)},null,8,["modelValue","onUpdate:modelValue","disabled"])])):x("",!0),Re("categories")?(r(),h("td",Wye,Fe[15]||(Fe[15]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),Re("description")?(r(),h("td",Jye,Fe[16]||(Fe[16]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),Re("short_description")?(r(),h("td",Xye,Fe[17]||(Fe[17]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),Re("status")?(r(),h("td",Zye,Fe[18]||(Fe[18]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),Re("product_type")?(r(),h("td",e1e,Fe[19]||(Fe[19]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),Re("pricing_type")?(r(),h("td",t1e,Fe[20]||(Fe[20]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),Re("payment_type")?(r(),h("td",a1e,[n(Zo,{variant:ee,disabled:g(X.product),"has-error":$(X.product,Ne,"other_info.payment_type"),onPaymentTypeChange:xt=>{var Wa;M(xt),ve("payment_type",(Wa=xt.other_info)==null?void 0:Wa.payment_type,`v:${X.productId}:${Ne}`)}},null,8,["variant","disabled","has-error","onPaymentTypeChange"])])):x("",!0),Re("interval")?(r(),h("td",l1e,[n(ei,{variant:ee,disabled:g(X.product),"has-error":$(X.product,Ne,"other_info.repeat_interval"),onChange:xt=>{var Wa;return ve("interval",(Wa=ee.other_info)==null?void 0:Wa.repeat_interval,`v:${X.productId}:${Ne}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("trial_days")?(r(),h("td",s1e,[n(ti,{variant:ee,disabled:g(X.product),"has-error":$(X.product,Ne,"other_info.trial_days"),onChange:xt=>{var Wa;return ve("trial_days",(Wa=ee.other_info)==null?void 0:Wa.trial_days,`v:${X.productId}:${Ne}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("best_price")?(r(),h("td",n1e,[n(Xo,{variant:ee,disabled:g(X.product),"has-error":$(X.product,Ne,"item_price"),onChange:xt=>ve("price",ee.item_price,`v:${X.productId}:${Ne}`)},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("compare_price")?(r(),h("td",o1e,[n(ai,{variant:ee,disabled:g(X.product),"has-error":$(X.product,Ne,"compare_price"),onChange:xt=>ve("compare_price",ee.compare_price,`v:${X.productId}:${Ne}`)},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("track_quantity")?(r(),h("td",i1e,Fe[21]||(Fe[21]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),Re("stock")?(r(),h("td",r1e,[((De=(pt=X.product)==null?void 0:pt.detail)==null?void 0:De.manage_stock)==="1"?(r(),E(ta,{key:0,class:"fc-bulk-input",size:"small",modelValue:ee.total_stock,"onUpdate:modelValue":[xt=>ee.total_stock=xt,xt=>{ee.available=xt,A(Ft).syncStockStatus(X.product),ve("stock",xt,`v:${X.productId}:${Ne}`)}],disabled:g(X.product),placeholder:ge.$t("e.g 10")},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):(r(),h("span",d1e,"—"))])):x("",!0),o("td",{class:de(["fct-bulk-actions-cell",{"sticky-col sticky-col-right":z.value}])},[o("div",u1e,[n(at,{tag:"button",size:"x-small",onClick:Ge(xt=>U(X.product,ee),["prevent"]),disabled:s.value||g(X.product),title:ge.$t("Duplicate")},{default:d(()=>[n(Y,{name:"Copy"})]),_:2},1032,["onClick","disabled","title"]),n(at,{tag:"button",size:"x-small",hover:"danger",onClick:Ge(xt=>F(X.product,ee),["prevent"]),disabled:s.value||g(X.product),title:ge.$t("Delete")},{default:d(()=>[n(Y,{name:"Delete"})]),_:2},1032,["onClick","disabled","title"])])],2)],10,Nye)}),128)),o("tr",c1e,[o("td",{colspan:He.value.length+1},[o("div",p1e,[n(ot,{size:"small",text:"",type:"primary",onClick:Ge(ee=>A(Ft).addVariationToProduct(X.product),["prevent"])},{default:d(()=>[R(" + "+m(ge.$t("Add Variant")),1)]),_:2},1032,["onClick"])])],8,A1e)])])])]),_:2},1032,["visible"])],8,Pye)])):x("",!0)],64)}),128)),Pt.value>0?(r(),h("tr",f1e,[o("td",{colspan:He.value.length+1,style:ra({height:Pt.value+"px",padding:0,border:"none"})},null,12,m1e)])):x("",!0)]),_:1},8,["columns","sticky-last"])],2)):(r(),E(Ct,{key:1,icon:"Empty/ListView","has-dark":!0,text:A(u)("No products yet. Import a CSV or add products manually.")},null,8,["text"]))]),_:1})]}),_:1}),n(Ya,{modelValue:W.value.visible,"onUpdate:modelValue":Fe[6]||(Fe[6]=ma=>W.value.visible=ma),title:ce.value,width:"700px","close-on-click-modal":!1,onClosed:Fe[7]||(Fe[7]=ma=>W.value.product=null)},{footer:d(()=>[n(ot,{onClick:Fe[5]||(Fe[5]=ma=>W.value.visible=!1)},{default:d(()=>[R(m(ge.$t("Cancel")),1)]),_:1}),n(ot,{type:"primary",onClick:ne},{default:d(()=>[R(m(ge.$t("Save")),1)]),_:1})]),default:d(()=>[W.value.visible&&W.value.field==="post_content"?(r(),E(ls,{key:0,"model-value":W.value.value,height:300,onUpdate:Z},null,8,["model-value"])):x("",!0),W.value.visible&&W.value.field==="post_excerpt"?(r(),E(ta,{key:1,modelValue:W.value.value,"onUpdate:modelValue":Fe[4]||(Fe[4]=ma=>W.value.value=ma),type:"textarea",rows:6,placeholder:ge.$t("Short description")},null,8,["modelValue","placeholder"])):x("",!0)]),_:1},8,["modelValue","title"])])}}};class g1e extends Dd{beforeInit(){this.data.products=[],this.data.dirty=new Set,this.data.loading=!1,this.data.saving=!1,this.data.pagination={page:1,per_page:5,total:0,hasMore:!1},this.data.saveProgress={total:0,completed:0,errors:[],updatedIds:[]},this.data.savingIds=new Set,this.data.savedIds=new Set,this.data.productErrors=new Map,this.data.advanceFilters=[[]],this.data.filterType="simple",this.data.selectedView="all",this.data.searching=!1,this.data.search="",this.data.duplicatingIds=new Set,this.data.deletingIds=new Set,this.data.categoryOptions=[],this.data.constrainedProductIds="",this.data.constrainedVariantIds="",this.data.savedViews=[],this.data.activeSavedViewId=null,this.data.savedViewQueryParams=null}getTabs(){return{all:u("All"),publish:u("Published"),draft:u("Draft"),physical:u("Physical"),digital:u("Digital")}}getTabsCount(){return Object.values(this.getTabs()).length}getSelectedTab(){return this.data.selectedView}handleTabChanged(t){t!==this.data.selectedView&&(this.data.selectedView=t,this.fetchProducts({},!1))}isSearching(){return this.data.searching!==!1}openSearch(){this.data.searching=!0}closeSearch(){this.data.searching=!1,this.data.search="",this.fetchProducts({},!1)}search(){this.fetchProducts({},!1)}useFullWidthSearch(){return!1}getSearchHint(){return u("Search by Id, product title or variation title")}getSearchGuideOptions(){return null}isUsingAdvanceFilter(){return this.data.filterType==="advanced"}isUsingSimpleFilter(){return this.data.filterType==="simple"}isAdvanceFilterEnabled(){return this.getAdvanceFilterOptions()!==null}getAdvanceFilterOptions(){var t,a,l;return((l=(a=(t=window.fluentCartAdminApp)==null?void 0:t.filter_options)==null?void 0:a.product_filter_options)==null?void 0:l.advance)||null}onFilterTypeChanged(t){t==="advanced"?(this.data.searching=!1,this.data.search=""):this.data.advanceFilters=[[]],this.fetchProducts({},!1)}applyAdvancedFilter(t=!1){this.fetchProducts({},!1)}addAdvanceFilterGroup(){this.data.advanceFilters.push([])}removeAdvanceFilterGroup(t){this.data.advanceFilters.length>1&&this.data.advanceFilters.splice(t,1)}clearAdvanceFilter(){this.data.advanceFilters=[[]],this.fetchProducts({},!1)}getColumnWidthStorageKey(){return"bulk_edit_column_widths"}getColumnStorageKey(){return"bulk_edit_columns"}getToggleableColumns(){return[{label:"Image",value:"image"},{label:"SKU",value:"sku"},{label:"Categories",value:"categories"},{label:"Description",value:"description"},{label:"Short Description",value:"short_description"},{label:"Status",value:"status"},{label:"Product Type",value:"product_type"},{label:"Pricing Type",value:"pricing_type"},{label:"Payment Type",value:"payment_type"},{label:"Interval",value:"interval"},{label:"Trial Days",value:"trial_days"},{label:"Best Price",value:"best_price"},{label:"Compare-at Price",value:"compare_price"},{label:"Track Quantity",value:"track_quantity"},{label:"Stock",value:"stock"}]}getSortableColumns(){return[]}markDirty(t){this._suppressDirty||(this.data.dirty.add(t),this.data.dirty=new Set(this.data.dirty),this.data.savedIds.has(t)&&(this.data.savedIds.delete(t),this.data.savedIds=new Set(this.data.savedIds)),this.data.productErrors.has(t)&&(this.data.productErrors.delete(t),this.data.productErrors=new Map(this.data.productErrors)))}get dirtyCount(){return this.data.dirty.size}getDirtyProducts(){return this.data.products.filter(t=>this.data.dirty.has(t.ID))}chunkArray(t,a){const l=[];for(let s=0;s<t.length;s+=a)l.push(t.slice(s,s+a));return l}async fetchProducts(t={},a=!1,l="",s=""){var i;this.data.loading=!0;try{l&&(this.data.constrainedProductIds=l,this.data.constrainedVariantIds=s);const c=l||this.data.constrainedProductIds,p=s||this.data.constrainedVariantIds,f={per_page:this.data.pagination.per_page,page:a?this.data.pagination.page+1:1};c&&(f.product_ids=c,f.variant_ids=p),this.data.filterType==="advanced"?(f.advanced_filters=JSON.stringify(this.data.advanceFilters),f.filter_type="advanced"):(this.data.search&&(f.search=this.data.search),this.data.selectedView&&this.data.selectedView!=="all"&&(f.active_view=this.data.selectedView)),Object.assign(f,t);const _=await Ae.get("products/bulk-edit-data",f),g=_.products||[];this._suppressDirty=!0,a?this.data.products.push(...g):(this.data.products=g,this.data.dirty=new Set,this.data.savedIds=new Set,this.data.productErrors=new Map),xe(()=>{this._suppressDirty=!1}),this.data.pagination={page:_.page||f.page,per_page:_.per_page||f.per_page,total:_.total||0,hasMore:_.page*_.per_page<_.total}}catch(c){const p=((i=c==null?void 0:c.data)==null?void 0:i.message)||"Failed to fetch products";q.error(p)}finally{this.data.loading=!1}}isSavingProduct(t){return this.data.savingIds.has(t)}isDirty(t){return this.data.dirty.has(t)}isSaved(t){return this.data.savedIds.has(t)}isRowDisabled(t){return this.isSavingProduct(t)}isDuplicating(t){return this.data.duplicatingIds.has(t)}isDeleting(t){return this.data.deletingIds.has(t)}hasError(t){return this.data.productErrors.has(t)}getError(t){const a=this.data.productErrors.get(t);return a?a.fields&&Object.keys(a.fields).length?Object.values(a.fields).join("; "):a.message||"":""}hasProductLevelError(t){const a=this.data.productErrors.get(t);return a?!a.fields||!Object.keys(a.fields).length?!!a.message:Object.keys(a.fields).some(l=>!l.startsWith("variants.")):!1}getProductLevelError(t){const a=this.data.productErrors.get(t);return a?!a.fields||!Object.keys(a.fields).length?a.message||"":Object.entries(a.fields).filter(([s])=>!s.startsWith("variants.")).map(([,s])=>s).join("; ")||"":""}hasVariantError(t,a){const l=this.data.productErrors.get(t);if(!(l!=null&&l.fields))return!1;const s=`variants.${a}.`;return Object.keys(l.fields).some(i=>i.startsWith(s))}getVariantError(t,a){const l=this.data.productErrors.get(t);if(!(l!=null&&l.fields))return"";const s=`variants.${a}.`;return Object.entries(l.fields).filter(([c])=>c.startsWith(s)).map(([,c])=>c).join("; ")}hasFieldError(t,a){var s;const l=this.data.productErrors.get(t);return!!((s=l==null?void 0:l.fields)!=null&&s[a])}hasVariantFieldError(t,a,l){return this.hasFieldError(t,`variants.${a}.${l}`)}async saveProduct(t){var l,s,i,c;const a=t.ID;if(!this.data.savingIds.has(a)){this.data.savingIds.add(a),this.data.savingIds=new Set(this.data.savingIds);try{const p=await Ae.post("products/bulk-update",{products:[t]});if((l=p.updated)!=null&&l.length)this.data.dirty.delete(a),this.data.dirty=new Set(this.data.dirty),this.data.savedIds.add(a),this.data.savedIds=new Set(this.data.savedIds),this.data.productErrors.delete(a),this.data.productErrors=new Map(this.data.productErrors),q.success(u("Product updated successfully"));else if((s=p.errors)!=null&&s.length){const f=p.errors[0];f!=null&&f.fields&&(this.data.productErrors.set(a,f),this.data.productErrors=new Map(this.data.productErrors)),q.error((f==null?void 0:f.message)||"Failed to save product")}}catch(p){const f=((i=p==null?void 0:p.data)==null?void 0:i.message)||"Failed to save product",_=(c=p==null?void 0:p.data)==null?void 0:c.errors;if(_!=null&&_.length){const g=_[0];g!=null&&g.fields&&(this.data.productErrors.set(a,g),this.data.productErrors=new Map(this.data.productErrors))}q.error(f)}finally{this.data.savingIds.delete(a),this.data.savingIds=new Set(this.data.savingIds)}}}async saveProducts(){var l,s;const t=this.getDirtyProducts().filter(i=>!this.data.savedIds.has(i.ID));if(t.length===0){q.info(u("No changes to save"));return}const a=this.chunkArray(t,10);this.data.saving=!0,this.data.saveProgress={total:a.length,completed:0,errors:[],updatedIds:[]};try{for(const p of a){const f=p.map(_=>_.ID);for(const _ of f)this.data.savingIds.add(_);this.data.savingIds=new Set(this.data.savingIds);try{const _=await Ae.post("products/bulk-update",{products:p});if(_.updated){this.data.saveProgress.updatedIds.push(..._.updated);for(const g of _.updated)this.data.savedIds.add(g),this.data.dirty.delete(g),this.data.productErrors.delete(g);this.data.savedIds=new Set(this.data.savedIds),this.data.dirty=new Set(this.data.dirty),this.data.productErrors=new Map(this.data.productErrors)}if(_.errors&&_.errors.length){this.data.saveProgress.errors.push(..._.errors);for(const g of _.errors)g.post_id&&g.fields&&this.data.productErrors.set(g.post_id,g);this.data.productErrors=new Map(this.data.productErrors)}}catch(_){const g=((l=_==null?void 0:_.data)==null?void 0:l.message)||"A chunk failed to save";this.data.saveProgress.errors.push({message:g});const y=(s=_==null?void 0:_.data)==null?void 0:s.errors;if(y!=null&&y.length){for(const v of y)v.post_id&&v.fields&&this.data.productErrors.set(v.post_id,v);this.data.productErrors=new Map(this.data.productErrors)}}for(const _ of f)this.data.savingIds.delete(_);this.data.savingIds=new Set(this.data.savingIds),this.data.saveProgress.completed++}const{updatedIds:i,errors:c}=this.data.saveProgress;c.length===0?q.success(`${i.length} product(s) updated successfully`):i.length>0?q.info(`${i.length} product(s) updated, ${c.length} error(s)`):q.error(u("All products failed to save"))}finally{this.data.saving=!1}}async duplicateProduct(t){var l;const a=t.ID;if(!(!a||this.data.duplicatingIds.has(a))){this.data.duplicatingIds.add(a),this.data.duplicatingIds=new Set(this.data.duplicatingIds);try{const i=(await Ae.post(`products/${a}/duplicate`,{})).product_id;if(i){const p=(await Ae.get("products/bulk-edit-data",{search:i,per_page:1})).products||[];if(p.length>0){const f=this.data.products.indexOf(t);this.data.products.splice(f+1,0,p[0])}}}catch(s){const i=((l=s==null?void 0:s.data)==null?void 0:l.message)||"Failed to duplicate product";q.error(i)}finally{this.data.duplicatingIds.delete(a),this.data.duplicatingIds=new Set(this.data.duplicatingIds)}}}async duplicateProductWithVariants(t,a){var s;const l=t.ID;if(!(!l||this.data.duplicatingIds.has(l))){this.data.duplicatingIds.add(l),this.data.duplicatingIds=new Set(this.data.duplicatingIds);try{const c=(await Ae.post(`products/${l}/duplicate`,{})).product_id;if(!c)return;const f=(await Ae.get("products/bulk-edit-data",{search:c,per_page:1})).products||[];if(!f.length)return;const _=f[0],g=t.variants||[],y=new Set;for(const w of g)a.includes(w.id)&&w.serial_index!=null&&y.add(w.serial_index);_.variants&&y.size>0&&(_.variants=_.variants.filter(w=>y.has(w.serial_index)));const v=this.data.products.indexOf(t);this.data.products.splice(v+1,0,_),this.markDirty(_.ID)}catch(i){const c=((s=i==null?void 0:i.data)==null?void 0:s.message)||"Failed to duplicate product";q.error(c)}finally{this.data.duplicatingIds.delete(l),this.data.duplicatingIds=new Set(this.data.duplicatingIds)}}}duplicateVariant(t,a){const l=JSON.parse(JSON.stringify(a));l.variation_title=l.variation_title?l.variation_title+" (Copy)":"",l.sku="",delete l.id,delete l.post_id;const s=t.variants.indexOf(a);t.variants.splice(s+1,0,l),this.markDirty(t.ID)}async deleteProduct(t){var l;const a=t.ID;if(!(!a||this.data.deletingIds.has(a))){this.data.deletingIds.add(a),this.data.deletingIds=new Set(this.data.deletingIds);try{await Ae.delete(`products/${a}`);const s=this.data.products.indexOf(t);s!==-1&&this.data.products.splice(s,1),this.data.dirty.delete(a),this.data.savedIds.delete(a)}catch(s){const i=((l=s==null?void 0:s.data)==null?void 0:l.message)||"Failed to delete product";q.error(i)}finally{this.data.deletingIds.delete(a),this.data.deletingIds=new Set(this.data.deletingIds)}}}removeVariant(t,a){if(t.variants.length<=1)return q.error(u("A product must have at least one variant.")),!1;const l=t.variants.indexOf(a);return l!==-1&&t.variants.splice(l,1),this.markDirty(t.ID),!0}resetPaymentTypeDefaults(t){t.other_info.payment_type==="onetime"&&(t.other_info.installment="no",t.other_info.times="",t.other_info.manage_setup_fee="no",t.other_info.signup_fee="",t.other_info.signup_fee_name="")}flattenCategoryTree(t,a=""){var s;const l=[];for(const i of t){const c=a?`${a} > ${i.label}`:i.label;l.push({label:c,value:c}),(s=i.children)!=null&&s.length&&l.push(...this.flattenCategoryTree(i.children,c))}return l}async fetchCategories(){try{const a=(await Ae.get("products/fetch-term")).taxonomies||{},l=Object.values(a).find(s=>s.name==="product-categories");l!=null&&l.terms&&(this.data.categoryOptions=this.flattenCategoryTree(l.terms))}catch{}}setupSavedViews(){var a,l;const t=(a=window.fluentCartAdminApp)==null?void 0:a.table_config;this.data.savedViews=((l=t==null?void 0:t.products)==null?void 0:l.saved_views)||[]}getSavedViews(){return this.data.savedViews}getActiveSavedViewId(){return this.data.activeSavedViewId}applySavedView(t){const a=this.data.savedViews.find(l=>l.slug===t);a&&(this.data.activeSavedViewId=t,this.data.savedViewQueryParams=a.query_params)}isViewOwner(t){var a,l;return!t||!t.owner_id?!1:t.owner_id===((l=(a=window.fluentCartAdminApp)==null?void 0:a.me)==null?void 0:l.id)}renameSavedView(t,a){}updateSavedView(t){}deleteSavedView(t){}}const it=g1e.init(),y1e={class:"fct-bulk-edit-page fct-layout-width"},b1e={class:"fct-table-wrapper"},w1e={class:"fct-card-header-top"},C1e={class:"fct-card-header-left flex-1"},k1e={class:"fct-card-header-actions"},B1e={key:0,class:"fct-advanced-filter-toggle-wrapper"},x1e={key:1,class:"fct-btn-group sm hidden md:flex"},S1e={key:0,class:"filter-search-wrap"},F1e={class:"search-bar"},$1e={class:"text-xs text-system-light pt-2 dark:text-gray-300"},E1e={class:"fct-bulk-edit-table-wrap"},U1e={key:0,class:"px-5 py-3 flex items-center justify-between border border-solid border-x-0 border-gray-divider border-t-0 dark:border-dark-400"},I1e={class:"m-0 text-base"},Q1e={key:0,class:"text-system-mid text-sm font-normal dark:text-gray-300"},D1e={class:"fct-btn-group sm justify-end"},V1e={class:"filter-popover-item"},T1e={class:"filter-popover-title"},M1e={class:"fct-bulk-edit-table"},L1e={key:0,"aria-hidden":"true"},R1e=["colspan"],O1e=["onClick"],P1e=["onClick"],H1e={class:"fct-bulk-product-title-cell sticky-col",style:{left:"40px"}},N1e={class:"flex items-center"},K1e=["onClick","title"],G1e={key:0,class:"bulk-collapse-count"},z1e=["title"],j1e={class:"bulk-status-icon is-error"},q1e=["disabled","onClick","title"],Y1e={key:0,class:"fct-bulk-media-cell"},W1e={key:1,class:"fct-bulk-sku-cell"},J1e={key:1,class:"text-gray-300 text-sm flex justify-center"},X1e={key:2,class:"fct-bulk-categories-cell"},Z1e={key:3,class:"fct-bulk-desc-cell"},ebe={key:4,class:"fct-bulk-short-desc-cell"},tbe={key:5,class:"fct-bulk-status-cell"},abe={key:6,class:"fct-bulk-product-type-cell"},lbe={class:"bulk-readonly-label"},sbe={key:7,class:"fct-bulk-pricing-type-cell"},nbe={class:"bulk-readonly-label"},obe={key:8,class:"fct-bulk-payment-type-cell"},ibe={key:9,class:"fct-bulk-interval-cell"},rbe={key:10,class:"fct-bulk-trial-days-cell"},dbe={key:11,class:"fct-bulk-best-price-cell"},ube={key:12,class:"fct-bulk-compare-price-cell"},cbe={key:13,class:"fct-bulk-qty-cell !pl-5"},Abe={key:14,class:"fct-bulk-stock-cell"},pbe={key:1,class:"text-gray-300 text-sm flex justify-center"},fbe={class:"fct-btn-group sm justify-end"},mbe={key:0,class:"bulk-variants-block-row"},hbe=["colspan"],_be={class:"bulk-inner-table",style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},vbe=["onClick"],gbe={class:"bulk-checkbox-cell"},ybe={class:"fct-bulk-product-title-cell sticky-col",style:{left:"40px"}},bbe={class:"flex items-center gap-1 pl-4"},wbe={class:"bulk-status-icon is-error"},Cbe={key:0},kbe={key:1},Bbe={key:2},xbe={key:3},Sbe={key:4},Fbe={key:5},$be={key:6},Ebe={key:7},Ube={key:8},Ibe={key:9},Qbe={key:10},Dbe={key:11},Vbe={key:12},Tbe={key:13,class:"text-center"},Mbe={key:14},Lbe={key:1,class:"text-gray-300 text-sm flex justify-center"},Rbe={class:"fct-btn-group sm justify-end"},Obe={key:1,"aria-hidden":"true"},Pbe=["colspan"],Hbe={key:1,class:"flex flex-col items-center justify-center py-16 text-center"},Nbe={class:"text-system-mid text-sm"},Kbe={key:2,class:"flex items-center justify-center py-8"},Gbe={class:"text-system-mid text-sm"},zbe={key:1,class:"flex items-center justify-center py-3 border-top"},jbe={class:"text-system-mid text-sm"},cr=43,qbe=10,Ic=800,Qc=100,Ybe=200,Wbe={__name:"BulkEdit",setup(e){const t=Jt().ctx,a=nl(),{options:l}=it.data,s=le=>{var he;return((he=le==null?void 0:le.detail)==null?void 0:he.variation_type)==="simple"},i=K(()=>it.data.products),c=K(()=>it.data.loading),p=K(()=>it.data.saving),f=K(()=>it.data.saveProgress),_=K(()=>it.data.pagination),g=K(()=>it.data.dirty),y=K(()=>g.value.size),v=K(()=>Math.max(0,_.value.total-i.value.length)),w=K(()=>Math.min(_.value.per_page,v.value)),k=K(()=>{const le=it.data.saveProgress;return le.total?Math.round(le.completed/le.total*100):0}),b=td("search-input"),S=()=>{it.openSearch(),xe(()=>{var le;(le=b.value)==null||le.focus()})},$=(le=!1)=>{it.fetchProducts({},le)},D=()=>{it.saveProducts()},F=le=>{it.markDirty(le.ID)},B=(le,he)=>{it.resetPaymentTypeDefaults(he),F(le)},U=(le,he)=>{const Ye=it.data.categoryOptions;for(const st of he)Ye.find(je=>je.value===st)||Ye.push({label:st,value:st});F(le)},Q=le=>it.isDirty(le.ID),V=le=>it.isSavingProduct(le.ID),I=le=>it.isSaved(le.ID),M=le=>it.isRowDisabled(le.ID),O=le=>it.isDuplicating(le.ID),L=le=>it.isDeleting(le.ID),H=le=>it.hasError(le.ID),j=le=>it.getError(le.ID),W=le=>it.hasProductLevelError(le.ID),G=(le,he)=>it.hasVariantError(le.ID,he),Z=(le,he)=>it.getVariantError(le.ID,he),ne=(le,he)=>it.hasFieldError(le.ID,he),ce=(le,he,Ye)=>it.hasVariantFieldError(le.ID,he,Ye),z=le=>it.saveProduct(le),ue=le=>it.duplicateProduct(le),ie=(le,he)=>it.duplicateVariant(le,he),J=T(!0),{selectedKeys:N,handleRowClick:ae,toggleSelectAll:oe,selectAll:fe,deselectAll:re,isSelected:Ee,selectedCount:ye,isLinkMode:Ce,toggleLinkMode:ve}=Sf(),Ue=K(()=>{const le=[];for(const he of kt.value)if(le.push(`p:${he.productId}`),he.hasVariants&&!he.collapsed)for(const Ye of he.product.variants)le.push(`v:${Ye.id}`);return le}),Ke=le=>{var he;if(le.startsWith("p:")){const Ye=parseInt(le.slice(2)),st=kt.value.find(je=>je.productId===Ye);return st?{type:"product",data:st.product,product:st.product}:null}else if(le.startsWith("v:")){const Ye=parseInt(le.slice(2));for(const st of kt.value){const je=(he=st.product.variants)==null?void 0:he.find(Xe=>Xe.id===Ye);if(je)return{type:"variant",data:je,product:st.product}}}return null},We=(le,he,Ye)=>{!Ce.value||!Ee(Ye)||$f(le,he,Ye,N.value,Ke,F,lye)},Be=T(!1),$e=le=>{le.key==="Shift"&&(Be.value=!0)},He=le=>{le.key==="Shift"&&(Be.value=!1)},Re=(le,he)=>{if(!he.shiftKey||he.target.closest(".bulk-checkbox-cell"))return;he.preventDefault();const Ye=new Set(N.value);Ye.has(le)?Ye.delete(le):Ye.add(le),N.value=Ye},yt=()=>{const le=[];for(const he of kt.value){const Ye=`p:${he.productId}`,st=N.value.has(Ye),je=[];if(he.product.variants)for(const Xe of he.product.variants)N.value.has(`v:${Xe.id}`)&&je.push(Xe.id);!st&&je.length===0||(st&&je.length===0?le.push({product:he.product,type:"full"}):!st&&je.length>0?le.push({product:he.product,type:"variants-only",variantIds:je}):le.push({product:he.product,type:"partial",variantIds:je}))}return le},gt=async()=>{const le=yt();if(!le.length)return;const he=le.filter(mt=>mt.type==="full").length,Ye=le.filter(mt=>mt.type==="partial").length,je=le.filter(mt=>mt.type==="variants-only").reduce((mt,et)=>mt+et.variantIds.length,0),Xe=[];he>0&&Xe.push(`${he} product(s) with all variants`),Ye>0&&Xe.push(`${Ye} product(s) with selected variants`),je>0&&Xe.push(`${je} variant(s)`);try{await Fl.confirm(t.$t("Duplicate %s?").replace("%s",Xe.join(", ")),t.$t("Bulk Duplicate"),{confirmButtonText:t.$t("Duplicate"),cancelButtonText:t.$t("Cancel"),type:"info"})}catch{return}for(const mt of le)if(mt.type==="full")await it.duplicateProduct(mt.product);else if(mt.type==="variants-only")for(const et of mt.variantIds){const It=mt.product.variants.find(pe=>pe.id===et);It&&it.duplicateVariant(mt.product,It)}else mt.type==="partial"&&await it.duplicateProductWithVariants(mt.product,mt.variantIds);re()},Rt=async()=>{const le=[],he=[];for(const je of kt.value){const Xe=`p:${je.productId}`;if(N.value.has(Xe)){le.push(je.product);continue}const et=[];if(je.product.variants)for(const It of je.product.variants)N.value.has(`v:${It.id}`)&&et.push(It);et.length>0&&he.push({product:je.product,variants:et})}if(!le.length&&!he.length)return;const Ye=he.reduce((je,Xe)=>je+Xe.variants.length,0),st=[];le.length>0&&st.push(`${le.length} product(s)`),Ye>0&&st.push(`${Ye} variant(s)`);try{await Fl.confirm(t.$t("Permanently delete %s? This cannot be undone.").replace("%s",st.join(" and ")),t.$t("Bulk Delete"),{confirmButtonText:t.$t("Delete"),cancelButtonText:t.$t("Cancel"),type:"warning"})}catch{return}for(const je of le)await it.deleteProduct(je);for(const{product:je,variants:Xe}of he)for(const mt of Xe)it.removeVariant(je,mt);re()},Tt=async le=>{const he=le.ID;if(!he||it.isDeleting(he))return;const Ye=le.post_title||t.$t("Untitled product"),st=Array.isArray(le.variants)?le.variants.length:0,je=st>0?t.$t('This will permanently delete "%1$s" and its %2$s variant(s).',Ye,st):t.$t('This will permanently delete "%1$s".',Ye);try{await Fl.confirm(je,t.$t("Delete Product"),{confirmButtonText:t.$t("Delete"),cancelButtonText:t.$t("Cancel"),type:"warning"})}catch{return}it.deleteProduct(le)},Dt=(le,he)=>{if(le.variants.length<=1){it.removeVariant(le,he);return}const Ye=he.variation_title||t.$t("Untitled variant");Fl.confirm(t.$t('This will remove the variant "%1$s".',Ye),t.$t("Remove Variant"),{confirmButtonText:t.$t("Remove"),cancelButtonText:t.$t("Cancel"),type:"warning"}).then(()=>{it.removeVariant(le,he)}).catch(()=>{})},_t=T({visible:!1,field:"",product:null,value:""}),Gt=(le,he)=>{_t.value={visible:!0,field:he,product:le,value:le[he]||""}},bt=le=>{_t.value.value=le},St=()=>{const{product:le,field:he,value:Ye}=_t.value;le&&(le[he]=Ye,F(le)),_t.value.visible=!1},Pt=K(()=>_t.value.field==="post_content"?t.$t("Edit Description"):t.$t("Edit Short Description")),Ht=T([]),Qt=K(()=>Ht.value.filter(le=>le.key==="title"||le.key==="actions"?!0:it.isColumnVisible(le.key))),ht=le=>it.isColumnVisible(le),qt=()=>{it.saveColumnWidths(Ht.value)},ge=T(new Set),Fe=le=>{const he=le.ID;ge.value.has(he)?ge.value.delete(he):ge.value.add(he),ge.value=new Set(ge.value)},ot=le=>ge.value.has(le.ID),wt=T(0),kt=K(()=>{let le=0;return i.value.map(he=>{var pe;const Ye=he.ID,st=((pe=he.detail)==null?void 0:pe.variation_type)!=="simple"&&Array.isArray(he.variants)&&he.variants.length>0,je=st?he.variants.length:0,Xe=ge.value.has(Ye),mt=st&&!Xe?je*cr:0,et=cr+mt,It={product:he,productId:Ye,hasVariants:st,variantCount:je,collapsed:Xe,groupHeight:et,offset:le};return le+=et,It})}),Xt=K(()=>{const le=kt.value;if(le.length===0)return 0;const he=le[le.length-1];return he.offset+he.groupHeight}),vt=K(()=>{const le=kt.value,he=wt.value,Ye=he+Ic,st=qbe*cr;return le.filter(je=>je.offset+je.groupHeight>=he-st&&je.offset<=Ye+st)}),ea=K(()=>vt.value.length===0?0:vt.value[0].offset),ta=K(()=>{if(vt.value.length===0)return 0;const le=vt.value[vt.value.length-1];return Xt.value-le.offset-le.groupHeight});let zt=null,wa=0;const qa=()=>{if(c.value||!_.value.hasMore||i.value.length===0)return;Xt.value-(wt.value+Ic)<Ybe&&$(!0)},il=le=>{const he=le.target,Ye=Date.now();zt&&clearTimeout(zt),Ye-wa>=Qc?(wt.value=he.scrollTop,wa=Ye,qa()):zt=setTimeout(()=>{wt.value=he.scrollTop,wa=Date.now(),zt=null,qa()},Qc)},Ya=le=>({physical:"Physical",digital:"Digital"})[le]||le||"—",ma=le=>({simple:"Simple",simple_variations:"Variable"})[le]||le||"—";let X=null;const we=()=>{const le=a.query.product_ids,he=a.query.variant_ids;le&&he?it.fetchProducts({},!1,le,he):$(!1)};return Ie(async()=>{X=bs(),X.bind("mod+a",le=>{var Ye,st;const he=(Ye=document.activeElement)==null?void 0:Ye.tagName;he==="INPUT"||he==="TEXTAREA"||(st=document.activeElement)!=null&&st.isContentEditable||(le.preventDefault(),fe(Ue.value))}),X.bind("escape",()=>{var he,Ye;const le=(he=document.activeElement)==null?void 0:he.tagName;le==="INPUT"||le==="TEXTAREA"||(Ye=document.activeElement)!=null&&Ye.isContentEditable||(Ce.value?ve():re())}),Ht.value=[{key:"title",title:t.$t("Title"),width:150,minWidth:100},{key:"image",title:t.$t("Image"),width:60,minWidth:50},{key:"sku",title:t.$t("SKU"),width:120,minWidth:80},{key:"categories",title:t.$t("Categories"),width:200,minWidth:150},{key:"description",title:t.$t("Description"),width:200,minWidth:150},{key:"short_description",title:t.$t("Short Description"),width:150,minWidth:100},{key:"status",title:t.$t("Status"),width:100,minWidth:50},{key:"product_type",title:t.$t("Product Type"),width:120,minWidth:80},{key:"pricing_type",title:t.$t("Pricing Type"),width:120,minWidth:80},{key:"payment_type",title:t.$t("Payment Type"),width:120,minWidth:100},{key:"interval",title:t.$t("Interval"),width:120,minWidth:80},{key:"trial_days",title:t.$t("Trial Days"),width:100,minWidth:70},{key:"best_price",title:t.$t("Best Price"),width:100,minWidth:100},{key:"compare_price",title:t.$t("Compare-at Price"),width:150,minWidth:100},{key:"track_quantity",title:t.$t("Track Quantity"),width:100,minWidth:100},{key:"stock",title:t.$t("Stock"),width:120,minWidth:80},{key:"actions",title:"",width:110,minWidth:110}],it.restoreColumnWidths(Ht.value),it.setupColumnVisibility(),it.setupSavedViews(),it.fetchCategories(),we(),document.body.classList.add("fct-bulk-page"),window.addEventListener("keydown",$e),window.addEventListener("keyup",He)}),cl(()=>{document.body.classList.remove("fct-bulk-page"),window.removeEventListener("keydown",$e),window.removeEventListener("keyup",He),X&&X.reset()}),(le,he)=>{const Ye=C("el-button"),st=C("el-progress"),je=C("el-switch"),Xe=C("el-tooltip"),mt=C("el-input"),et=C("el-checkbox"),It=C("el-checkbox-group"),pe=C("el-popover"),_e=C("el-icon"),Oe=C("el-option"),Me=C("el-select"),ct=C("el-dialog");return r(),h("div",y1e,[n(ol,{title:le.$t("Bulk Edit")},{action:d(()=>[n(Ye,{type:"primary",onClick:D,loading:p.value,disabled:p.value||y.value===0},{default:d(()=>[R(m(p.value?le.$t("Saving %s/%s...").replace("%s",f.value.completed).replace("%s",f.value.total):y.value>0?le.$t("Save Changes")+` (${y.value})`:le.$t("Save Changes")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["title"]),p.value?(r(),E(st,{key:0,percentage:k.value,"stroke-width":6,class:"mb-4"},null,8,["percentage"])):x("",!0),o("div",b1e,[n(Se,null,{default:d(()=>[n(Ve,{border_bottom:""},{default:d(()=>[o("div",w1e,[o("div",C1e,[A(it).getTabsCount()&&!A(it).isUsingAdvanceFilter()?(r(),E(am,{key:0,class:de("hide-animation-on-mobile hidden md:inline-flex classic-tab-style"),table:A(it)},null,8,["table"])):x("",!0)]),o("div",k1e,[A(it).isAdvanceFilterEnabled()?(r(),h("div",B1e,[n(je,{class:"fct-advanced-filter-toggle",onChange:he[0]||(he[0]=ee=>{A(it).onFilterTypeChanged(ee)}),"active-value":"advanced","inactive-value":"simple",modelValue:A(it).data.filterType,"onUpdate:modelValue":he[1]||(he[1]=ee=>A(it).data.filterType=ee),"active-text":le.$t("Advanced Filter"),size:"small"},null,8,["modelValue","active-text"])])):x("",!0),A(it).isUsingAdvanceFilter()?x("",!0):(r(),h("div",x1e,[A(it).isSearching()?x("",!0):(r(),E(Xe,{key:0,effect:"light",content:le.$t("Search"),placement:"top","popper-class":"fct-tooltip"},{default:d(()=>[n(at,{tag:"button",onClick:Ge(S,["prevent"])},{default:d(()=>[n(Y,{name:"Search"})]),_:1})]),_:1},8,["content"]))]))])]),n(Yc,{table:A(it)},null,8,["table"]),A(it).isSearching()&&!A(it).isUsingAdvanceFilter()?(r(),h("div",S1e,[o("div",F1e,[n(mt,{ref:"search-input",onClear:he[2]||(he[2]=()=>{A(it).search()}),onKeyup:he[3]||(he[3]=xa(()=>{A(it).search()},["enter"])),modelValue:A(it).data.search,"onUpdate:modelValue":he[4]||(he[4]=ee=>A(it).data.search=ee),type:"text",placeholder:le.$t("Search"),clearable:""},{prefix:d(()=>[n(Y,{name:"Search"})]),_:1},8,["modelValue","placeholder"]),o("div",$1e,m(A(it).getSearchHint()),1)]),n(Ye,{text:"",onClick:he[5]||(he[5]=()=>{A(it).closeSearch()})},{default:d(()=>[R(m(le.$t("Cancel")),1)]),_:1})])):x("",!0)]),_:1}),n(ke,{class:"p-0"},{default:d(()=>[o("div",E1e,[i.value.length>0?(r(),h("div",U1e,[o("h5",I1e,[R(m(i.value.length)+" "+m(i.value.length===1?le.$t("Product"):le.$t("Products"))+" ",1),_.value.total>i.value.length?(r(),h("span",Q1e,m(le.$t("of"))+" "+m(_.value.total)+" "+m(le.$t("total"))+" · "+m(w.value)+" "+m(le.$t("next")),1)):x("",!0)]),o("div",D1e,[n(Ye,{disabled:A(ye)===0,onClick:gt,size:"small"},{default:d(()=>[he[14]||(he[14]=o("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),o("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})],-1)),R(" "+m(le.$t("Duplicate")),1)]),_:1,__:[14]},8,["disabled"]),n(Ye,{disabled:A(ye)===0,onClick:Rt,size:"small",type:"danger",plain:""},{default:d(()=>[he[15]||(he[15]=o("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o("polyline",{points:"3 6 5 6 21 6"}),o("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)),R(" "+m(le.$t("Delete")),1)]),_:1,__:[15]},8,["disabled"]),n(Ye,{class:de({"is-active":A(Ce)}),disabled:A(ye)<2&&!A(Ce),onClick:A(ve),size:"small"},{default:d(()=>[he[16]||(he[16]=o("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),o("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})],-1)),R(" "+m(A(Ce)?le.$t("Unlink"):le.$t("Link")),1)]),_:1,__:[16]},8,["class","disabled","onClick"]),n(et,{modelValue:J.value,"onUpdate:modelValue":he[6]||(he[6]=ee=>J.value=ee),label:le.$t("Pin Actions")},null,8,["modelValue","label"]),n(pe,{trigger:"click",placement:"bottom-end",width:"240","popper-class":"filter-popover"},{reference:d(()=>[o("span",null,[n(Xe,{effect:"light",content:le.$t("Toggle columns"),placement:"top","popper-class":"fct-tooltip"},{default:d(()=>[n(at,{tag:"button",size:"small"},{default:d(()=>[n(Y,{name:"ColumnIcon"})]),_:1})]),_:1},8,["content"])])]),default:d(()=>[o("div",V1e,[o("h3",T1e,m(le.$t("Columns")),1),n(It,{modelValue:A(it).data.visibleColumns,"onUpdate:modelValue":he[7]||(he[7]=ee=>A(it).data.visibleColumns=ee),class:"fct-checkbox-blocks",onChange:he[8]||(he[8]=ee=>A(it).handleColumnVisibilityChange())},{default:d(()=>[(r(!0),h(P,null,te(A(it).getToggleableColumns(),ee=>(r(),E(et,{key:ee.value,value:ee.value,label:le.$t(ee.label)},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])])]),_:1})])])):x("",!0),o("div",M1e,[i.value.length>0?(r(),h("div",{key:0,class:de(["relative",{"is-link-mode":A(Ce),"is-shift-held":Be.value}])},[n(Bf,{columns:Qt.value,"sticky-last":J.value,onScroll:il,onResizeEnd:qt},{"header-first":d(()=>[Wt(n(et,{checked:A(ye)>0&&A(ye)===Ue.value.length,onChange:he[9]||(he[9]=ee=>A(oe)(Ue.value))},null,8,["checked"]),[[A(tye),A(ye)>0&&A(ye)<Ue.value.length]])]),"header-last":d(()=>[R(m(le.$t("Actions")),1)]),default:d(()=>[ea.value>0?(r(),h("tr",L1e,[o("td",{colspan:Qt.value.length+1,style:ra({height:ea.value+"px",padding:0,border:"none"})},null,12,R1e)])):x("",!0),(r(!0),h(P,null,te(vt.value,ee=>{var Ne,pt,De,xt,Wa,se,me,Qe,Le,qe,At,tt,Ut,jt,Ta,$t,Zt,ha;return r(),h(P,{key:ee.productId},[o("tr",{class:de(["bulk-product-row",{"is-dirty":Q(ee.product),"is-saving":V(ee.product),"is-saved":I(ee.product),"has-product-error":H(ee.product),"is-selected":A(Ee)(`p:${ee.productId}`)}]),onClick:Ze=>Re(`p:${ee.productId}`,Ze)},[o("td",{class:"bulk-checkbox-cell",onClick:Ze=>A(ae)(`p:${ee.productId}`,Ze,Ue.value)},[n(et,{"model-value":A(Ee)(`p:${ee.productId}`),tabindex:"-1"},null,8,["model-value"])],8,P1e),o("td",H1e,[o("div",N1e,[ee.hasVariants?(r(),h("button",{key:0,class:"bulk-collapse-btn",onClick:Ge(Ze=>Fe(ee.product),["prevent"]),title:ot(ee.product)?le.$t("Expand variants"):le.$t("Collapse variants")},[(r(),h("svg",{class:de(["bulk-collapse-icon",{"is-collapsed":ot(ee.product)}]),width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},he[17]||(he[17]=[o("path",{d:"M6 4L10 8L6 12",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2)),ot(ee.product)?(r(),h("span",G1e,m(ee.variantCount),1)):x("",!0)],8,K1e)):x("",!0),n(mt,{class:de(["fct-bulk-input",{"is-error":ne(ee.product,"post_title")}]),modelValue:ee.product.post_title,"onUpdate:modelValue":[Ze=>ee.product.post_title=Ze,Ze=>{F(ee.product),We("title",Ze,`p:${ee.productId}`)}],placeholder:le.$t("Product title"),disabled:M(ee.product),size:"small"},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","class"]),V(ee.product)?(r(),h("span",{key:1,class:"bulk-status-icon is-syncing",title:le.$t("Saving...")},[n(_e,{class:"is-loading",size:14},{default:d(()=>[n(A(en))]),_:1})],8,z1e)):W(ee.product)||s(ee.product)&&H(ee.product)?(r(),E(Xe,{key:2,content:j(ee.product),placement:"top"},{default:d(()=>[o("span",j1e,[n(_e,{size:16},{default:d(()=>[n(A(Vo))]),_:1})])]),_:2},1032,["content"])):Q(ee.product)?(r(),h("button",{key:3,class:"bulk-inline-save",disabled:M(ee.product),onClick:Ge(Ze=>z(ee.product),["prevent"]),title:le.$t("Save")},he[18]||(he[18]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",width:"16",height:"16"},[o("path",{d:"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z",fill:"currentColor"})],-1)]),8,q1e)):x("",!0)])]),ht("image")?(r(),h("td",Y1e,[n(yl,{modelValue:ee.product.gallery,"onUpdate:modelValue":Ze=>ee.product.gallery=Ze,onChange:Ze=>F(ee.product)},null,8,["modelValue","onUpdate:modelValue","onChange"])])):x("",!0),ht("sku")?(r(),h("td",W1e,[((pt=(Ne=ee.product)==null?void 0:Ne.detail)==null?void 0:pt.variation_type)==="simple"&&((De=ee.product.variants)!=null&&De[0])?(r(),E(mt,{key:0,class:de(["fct-bulk-input",{"is-error":ne(ee.product,"variants.0.sku")}]),modelValue:ee.product.variants[0].sku,"onUpdate:modelValue":[Ze=>ee.product.variants[0].sku=Ze,Ze=>{F(ee.product),We("sku",Ze,`p:${ee.productId}`)}],placeholder:"SKU",size:"small",disabled:M(ee.product)},null,8,["modelValue","onUpdate:modelValue","disabled","class"])):(r(),h("span",J1e,"—"))])):x("",!0),ht("categories")?(r(),h("td",X1e,[n(xf,{modelValue:ee.product.categories,"onUpdate:modelValue":Ze=>ee.product.categories=Ze,options:A(it).data.categoryOptions,disabled:M(ee.product),onChange:Ze=>{U(ee.product,Ze),We("categories",ee.product.categories,`p:${ee.productId}`)}},null,8,["modelValue","onUpdate:modelValue","options","disabled","onChange"])])):x("",!0),ht("description")?(r(),h("td",Z1e,[n(li,{value:ee.product.post_content,placeholder:le.$t("Description"),onClick:Ze=>Gt(ee.product,"post_content")},null,8,["value","placeholder","onClick"])])):x("",!0),ht("short_description")?(r(),h("td",ebe,[n(li,{value:ee.product.post_excerpt,placeholder:le.$t("Short description"),onClick:Ze=>Gt(ee.product,"post_excerpt")},null,8,["value","placeholder","onClick"])])):x("",!0),ht("status")?(r(),h("td",tbe,[n(Me,{modelValue:ee.product.post_status,"onUpdate:modelValue":Ze=>ee.product.post_status=Ze,size:"small",class:de({"is-field-error":ne(ee.product,"post_status")}),disabled:M(ee.product),onChange:Ze=>{F(ee.product),We("status",ee.product.post_status,`p:${ee.productId}`)}},{default:d(()=>[n(Oe,{label:le.$t("Published"),value:"publish"},null,8,["label"]),n(Oe,{label:le.$t("Draft"),value:"draft"},null,8,["label"])]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled","onChange"])])):x("",!0),ht("product_type")?(r(),h("td",abe,[o("span",lbe,m(Ya((Wa=(xt=ee.product)==null?void 0:xt.detail)==null?void 0:Wa.fulfillment_type)),1)])):x("",!0),ht("pricing_type")?(r(),h("td",sbe,[o("span",nbe,m(ma((me=(se=ee.product)==null?void 0:se.detail)==null?void 0:me.variation_type)),1)])):x("",!0),ht("payment_type")?(r(),h("td",obe,[n(Zo,{variant:s(ee.product)?(Qe=ee.product.variants)==null?void 0:Qe[0]:null,disabled:M(ee.product),"has-error":ne(ee.product,"variants.0.other_info.payment_type"),onPaymentTypeChange:Ze=>{var aa;B(ee.product,Ze),We("payment_type",(aa=Ze.other_info)==null?void 0:aa.payment_type,`p:${ee.productId}`)},onChange:Ze=>F(ee.product)},null,8,["variant","disabled","has-error","onPaymentTypeChange","onChange"])])):x("",!0),ht("interval")?(r(),h("td",ibe,[n(ei,{variant:s(ee.product)?(Le=ee.product.variants)==null?void 0:Le[0]:null,disabled:M(ee.product),"has-error":ne(ee.product,"variants.0.other_info.repeat_interval"),onChange:Ze=>{var aa,Ha,Je;F(ee.product),We("interval",(Je=(Ha=(aa=ee.product.variants)==null?void 0:aa[0])==null?void 0:Ha.other_info)==null?void 0:Je.repeat_interval,`p:${ee.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("trial_days")?(r(),h("td",rbe,[n(ti,{variant:s(ee.product)?(qe=ee.product.variants)==null?void 0:qe[0]:null,disabled:M(ee.product),"has-error":ne(ee.product,"variants.0.other_info.trial_days"),onChange:Ze=>{var aa,Ha,Je;F(ee.product),We("trial_days",(Je=(Ha=(aa=ee.product.variants)==null?void 0:aa[0])==null?void 0:Ha.other_info)==null?void 0:Je.trial_days,`p:${ee.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("best_price")?(r(),h("td",dbe,[n(Xo,{variant:s(ee.product)?(At=ee.product.variants)==null?void 0:At[0]:null,disabled:M(ee.product),"has-error":ne(ee.product,"variants.0.item_price"),onChange:Ze=>{var aa,Ha;F(ee.product),We("price",(Ha=(aa=ee.product.variants)==null?void 0:aa[0])==null?void 0:Ha.item_price,`p:${ee.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("compare_price")?(r(),h("td",ube,[n(ai,{variant:s(ee.product)?(tt=ee.product.variants)==null?void 0:tt[0]:null,disabled:M(ee.product),"has-error":ne(ee.product,"variants.0.compare_price"),onChange:Ze=>{var aa,Ha;F(ee.product),We("compare_price",(Ha=(aa=ee.product.variants)==null?void 0:aa[0])==null?void 0:Ha.compare_price,`p:${ee.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("track_quantity")?(r(),h("td",cbe,[(Ut=ee.product)!=null&&Ut.detail?(r(),E(je,{key:0,modelValue:ee.product.detail.manage_stock,"onUpdate:modelValue":Ze=>ee.product.detail.manage_stock=Ze,"active-value":1,"inactive-value":0,disabled:M(ee.product),onChange:Ze=>{F(ee.product),A(it).syncStockStatus(ee.product),We("manage_stock",ee.product.detail.manage_stock,`p:${ee.productId}`)}},null,8,["modelValue","onUpdate:modelValue","disabled","onChange"])):x("",!0)])):x("",!0),ht("stock")?(r(),h("td",Abe,[(Ta=(jt=ee.product)==null?void 0:jt.detail)!=null&&Ta.manage_stock&&((Zt=($t=ee.product)==null?void 0:$t.detail)==null?void 0:Zt.variation_type)==="simple"&&((ha=ee.product.variants)!=null&&ha[0])?(r(),E(mt,{key:0,class:"fct-bulk-input",placeholder:le.$t("e.g 10"),size:"small",modelValue:ee.product.variants[0].available,"onUpdate:modelValue":[Ze=>ee.product.variants[0].available=Ze,Ze=>{ee.product.variants[0].total_stock=Ze,F(ee.product),A(it).syncStockStatus(ee.product),We("stock",Ze,`p:${ee.productId}`)}],disabled:M(ee.product)},null,8,["placeholder","modelValue","onUpdate:modelValue","disabled"])):(r(),h("span",pbe,"—"))])):x("",!0),o("td",{class:de(["fct-bulk-actions-cell",{"sticky-col sticky-col-right":J.value}])},[o("div",fbe,[ee.product.view_url?(r(),E(at,{key:0,tag:"a",size:"x-small",href:ee.product.view_url,target:"_blank",title:le.$t("View Product")},{default:d(()=>[n(Y,{name:"External"})]),_:2},1032,["href","title"])):x("",!0),n(at,{tag:"button",size:"x-small",onClick:Ge(Ze=>ue(ee.product),["prevent"]),disabled:p.value||M(ee.product)||O(ee.product),title:le.$t("Duplicate")},{default:d(()=>[O(ee.product)?(r(),E(_e,{key:0,class:"is-loading",size:14},{default:d(()=>[n(A(en))]),_:1})):(r(),E(Y,{key:1,name:"Copy"}))]),_:2},1032,["onClick","disabled","title"]),n(at,{tag:"button",size:"x-small",hover:"danger",onClick:Ge(Ze=>Tt(ee.product),["prevent"]),disabled:p.value||M(ee.product)||L(ee.product),title:le.$t("Delete")},{default:d(()=>[L(ee.product)?(r(),E(_e,{key:0,class:"is-loading",size:14},{default:d(()=>[n(A(en))]),_:1})):(r(),E(Y,{key:1,name:"Delete"}))]),_:2},1032,["onClick","disabled","title"])])],2)],10,O1e),ee.hasVariants?(r(),h("tr",mbe,[o("td",{colspan:Qt.value.length+1,class:"!p-0 !border-b-0"},[n(ya,{accordion:"",visible:!ee.collapsed,duration:200},{default:d(()=>[o("table",_be,[o("colgroup",null,[he[19]||(he[19]=o("col",{style:{width:"40px"}},null,-1)),(r(!0),h(P,null,te(Qt.value,(Ze,aa)=>(r(),h("col",{key:aa,style:ra({width:Ze.width+"px"})},null,4))),128))]),o("tbody",null,[(r(!0),h(P,null,te(ee.product.variants,(Ze,aa)=>{var Ha,Je;return r(),h("tr",{key:Ze.id||aa,class:de(["bulk-variation-row",{"is-selected":A(Ee)(`v:${Ze.id}`)}]),onClick:Lt=>Re(`v:${Ze.id}`,Lt)},[o("td",gbe,[n(et,{"model-value":A(Ee)(`v:${Ze.id}`),tabindex:"-1",onChange:Lt=>A(ae)(`v:${Ze.id}`,Lt,Ue.value)},null,8,["model-value","onChange"])]),o("td",ybe,[o("div",bbe,[he[20]||(he[20]=o("span",{class:"text-gray-300 text-xs"},"└",-1)),n(mt,{size:"small",modelValue:Ze.variation_title,"onUpdate:modelValue":[Lt=>Ze.variation_title=Lt,Lt=>{F(ee.product),We("title",Lt,`v:${Ze.id}`)}],placeholder:le.$t("Variation title"),disabled:M(ee.product),class:de({"is-error":ce(ee.product,aa,"variation_title")})},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","class"]),G(ee.product,aa)?(r(),E(Xe,{key:0,content:Z(ee.product,aa),placement:"top"},{default:d(()=>[o("span",wbe,[n(_e,{size:14},{default:d(()=>[n(A(Vo))]),_:1})])]),_:2},1032,["content"])):x("",!0)])]),ht("image")?(r(),h("td",Cbe,[n(yl,{modelValue:Ze.media,"onUpdate:modelValue":Lt=>Ze.media=Lt,onChange:Lt=>F(ee.product)},null,8,["modelValue","onUpdate:modelValue","onChange"])])):x("",!0),ht("sku")?(r(),h("td",kbe,[n(mt,{class:de(["fct-bulk-input",{"is-error":ce(ee.product,aa,"sku")}]),size:"small",modelValue:Ze.sku,"onUpdate:modelValue":[Lt=>Ze.sku=Lt,Lt=>{F(ee.product),We("sku",Lt,`v:${Ze.id}`)}],placeholder:le.$t("SKU"),disabled:M(ee.product)},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","class"])])):x("",!0),ht("categories")?(r(),h("td",Bbe,he[21]||(he[21]=[o("span",{class:"text-gray-300 text-sm flex justify-center"},"—",-1)]))):x("",!0),ht("description")?(r(),h("td",xbe,he[22]||(he[22]=[o("span",{class:"text-gray-300 text-sm flex justify-center"},"—",-1)]))):x("",!0),ht("short_description")?(r(),h("td",Sbe,he[23]||(he[23]=[o("span",{class:"text-gray-300 text-sm flex justify-center"},"—",-1)]))):x("",!0),ht("status")?(r(),h("td",Fbe,he[24]||(he[24]=[o("span",{class:"text-gray-300 text-sm flex justify-center"},"—",-1)]))):x("",!0),ht("product_type")?(r(),h("td",$be,he[25]||(he[25]=[o("span",{class:"text-gray-300 text-sm flex justify-center"},"—",-1)]))):x("",!0),ht("pricing_type")?(r(),h("td",Ebe,he[26]||(he[26]=[o("span",{class:"text-gray-300 text-sm flex justify-center"},"—",-1)]))):x("",!0),ht("payment_type")?(r(),h("td",Ube,[n(Zo,{variant:Ze,disabled:M(ee.product),"has-error":ce(ee.product,aa,"other_info.payment_type"),onPaymentTypeChange:Lt=>{var os;B(ee.product,Lt),We("payment_type",(os=Lt.other_info)==null?void 0:os.payment_type,`v:${Ze.id}`)},onChange:Lt=>F(ee.product)},null,8,["variant","disabled","has-error","onPaymentTypeChange","onChange"])])):x("",!0),ht("interval")?(r(),h("td",Ibe,[n(ei,{variant:Ze,disabled:M(ee.product),"has-error":ce(ee.product,aa,"other_info.repeat_interval"),onChange:Lt=>{var os;F(ee.product),We("interval",(os=Ze.other_info)==null?void 0:os.repeat_interval,`v:${Ze.id}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("trial_days")?(r(),h("td",Qbe,[n(ti,{variant:Ze,disabled:M(ee.product),"has-error":ce(ee.product,aa,"other_info.trial_days"),onChange:Lt=>{var os;F(ee.product),We("trial_days",(os=Ze.other_info)==null?void 0:os.trial_days,`v:${Ze.id}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("best_price")?(r(),h("td",Dbe,[n(Xo,{variant:Ze,disabled:M(ee.product),"has-error":ce(ee.product,aa,"item_price"),onChange:Lt=>{F(ee.product),We("price",Ze.item_price,`v:${Ze.id}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("compare_price")?(r(),h("td",Vbe,[n(ai,{variant:Ze,disabled:M(ee.product),"has-error":ce(ee.product,aa,"compare_price"),onChange:Lt=>{F(ee.product),We("compare_price",Ze.compare_price,`v:${Ze.id}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("track_quantity")?(r(),h("td",Tbe,he[27]||(he[27]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),ht("stock")?(r(),h("td",Mbe,[(Je=(Ha=ee.product)==null?void 0:Ha.detail)!=null&&Je.manage_stock?(r(),E(mt,{key:0,class:"fct-bulk-input",placeholder:le.$t("e.g 10"),size:"small",modelValue:Ze.available,"onUpdate:modelValue":[Lt=>Ze.available=Lt,Lt=>{Ze.total_stock=Lt,F(ee.product),A(it).syncStockStatus(ee.product),We("stock",Lt,`v:${Ze.id}`)}],disabled:M(ee.product)},null,8,["placeholder","modelValue","onUpdate:modelValue","disabled"])):(r(),h("span",Lbe,"—"))])):x("",!0),o("td",{class:de(["text-center",{"sticky-col sticky-col-right":J.value}])},[o("div",Rbe,[n(at,{tag:"button",size:"x-small",onClick:Ge(Lt=>ie(ee.product,Ze),["prevent"]),disabled:p.value||M(ee.product),title:le.$t("Duplicate")},{default:d(()=>[n(Y,{name:"Copy"})]),_:2},1032,["onClick","disabled","title"]),n(at,{tag:"button",size:"x-small",hover:"danger",onClick:Ge(Lt=>Dt(ee.product,Ze),["prevent"]),disabled:p.value||M(ee.product),title:le.$t("Delete")},{default:d(()=>[n(Y,{name:"Delete"})]),_:2},1032,["onClick","disabled","title"])])],2)],10,vbe)}),128))])])]),_:2},1032,["visible"])],8,hbe)])):x("",!0)],64)}),128)),ta.value>0?(r(),h("tr",Obe,[o("td",{colspan:Qt.value.length+1,style:ra({height:ta.value+"px",padding:0,border:"none"})},null,12,Pbe)])):x("",!0)]),_:1},8,["columns","sticky-last"])],2)):c.value?c.value?(r(),h("div",Kbe,[n(_e,{class:"is-loading mr-2"},{default:d(()=>he[28]||(he[28]=[o("i",{class:"el-icon-loading"},null,-1)])),_:1,__:[28]}),o("span",Gbe,m(le.$t("Loading products...")),1)])):x("",!0):(r(),h("div",Hbe,[o("p",Nbe,m(le.$t("No products found.")),1)]))]),_.value.hasMore&&i.value.length>0&&c.value?(r(),h("div",zbe,[n(_e,{class:"is-loading mr-2"},{default:d(()=>he[29]||(he[29]=[o("i",{class:"el-icon-loading"},null,-1)])),_:1,__:[29]}),o("span",jbe,m(le.$t("Loading"))+" "+m(w.value)+" "+m(le.$t("more...")),1)])):x("",!0)])]),_:1})]),_:1})]),n(ct,{modelValue:_t.value.visible,"onUpdate:modelValue":he[12]||(he[12]=ee=>_t.value.visible=ee),title:Pt.value,width:"700px","close-on-click-modal":!1,onClosed:he[13]||(he[13]=ee=>_t.value.product=null)},{footer:d(()=>[n(Ye,{onClick:he[11]||(he[11]=ee=>_t.value.visible=!1)},{default:d(()=>[R(m(le.$t("Cancel")),1)]),_:1}),n(Ye,{type:"primary",onClick:St},{default:d(()=>[R(m(le.$t("Save")),1)]),_:1})]),default:d(()=>[_t.value.visible&&_t.value.field==="post_content"?(r(),E(ls,{key:0,"model-value":_t.value.value,height:300,onUpdate:bt},null,8,["model-value"])):x("",!0),_t.value.visible&&_t.value.field==="post_excerpt"?(r(),E(mt,{key:1,modelValue:_t.value.value,"onUpdate:modelValue":he[10]||(he[10]=ee=>_t.value.value=ee),type:"textarea",rows:6,placeholder:le.$t("Short description")},null,8,["modelValue","placeholder"])):x("",!0)]),_:1},8,["modelValue","title"])])}}},Ef=ze.get("payment_routes");for(const e of Ef)e.props=!0;const Jbe=ze.get("storage_driver_routes"),Uf=(Jbe||[]).filter(e=>e.name!=="s3");for(const e of Uf)e.props=!0;var Xbe={dashboard:{name:"dashboard",path:"/",component:YB,meta:{active_menu:"dashboard",title:u("Dashboard")}},orders:{path:"/orders",component:F$,meta:{active_menu:"orders",title:u("Orders")},children:[{name:"orders",path:"",component:vv,meta:{active_menu:"orders",title:u("Orders"),permission:"orders/view"}},{name:"view_order",path:":order_id(\\d+)/view",component:ND,props:!0,meta:{active_menu:"orders",title:u("View Order"),permission:["orders/view","orders/manage"]}},{name:"add_order",path:"add",component:bV,props:!0,meta:{active_menu:"orders",title:u("Create Order"),permission:"orders/create"}}]},products:{name:"products",path:"/products",component:h7,meta:{active_menu:"products",title:u("Products"),permission:"products/view"}},product_route:{path:"/products/:product_id(\\d+)",component:cT,name:"product_route",meta:{active_menu:"products",title:u("Products"),permission:["products/view","products/edit","integrations/manage"]},props:!0,children:[{name:"product_edit",path:"",props:!0,component:lq,meta:{active_menu:"products",title:u("Product Edit"),permission:"products/edit"}},{name:"product_integrations",path:"integrations",props:!0,component:gc,meta:{active_menu:"products",title:u("Integrations"),permission:"integrations/manage"}},{name:"product_integration_feed_editor",path:"integrations/:integration_id/:integration_name",component:nc,meta:{active_menu:"products",title:u("Edit Integration"),permission:"integrations/manage"}},{name:"SingleIntegration",path:"integrations/:integration_id",props:!0,component:AY,meta:{active_menu:"products",title:u("Integrations"),permission:"integrations/manage"}},{name:"product_upgrade_paths",path:"upgrade-paths",props:!0,component:Gq,meta:{active_menu:"products",title:u("Upgrade Paths"),permission:"integrations/manage"}},{name:"Integrations",path:"integrations",props:!0,component:gc,meta:{active_menu:"integrations",title:u("Product Integrations"),permission:"integrations/manage"}}]},product_bulk_insert:{name:"product_bulk_insert",path:"/products/bulk-insert",component:v1e,meta:{active_menu:"products",title:u("Product Bulk Insert"),permission:"products/create"}},product_bulk_edit:{name:"product_bulk_edit",path:"/products/bulk-edit",component:Wbe,meta:{active_menu:"products",title:u("Product Bulk Edit"),permission:"products/edit"}},product_attributes:{name:"product_attributes",path:"/products/attributes",component:$m,meta:{active_menu:"products",title:u("Attributes"),permission:"products/view"}},product_inventory:{name:"product_inventory",path:"/products/inventory",component:jJ,meta:{active_menu:"products",title:u("Inventory"),permission:"products/view"}},customers:{path:"/customers",component:Ig,meta:{active_menu:"customers",permission:["customers/view","customers/manage"]},children:[{name:"customers",path:"/customers",component:s_,meta:{active_menu:"customers",title:u("Customers"),permission:"customers/view"}},{name:"view_customer",path:":customer_id(\\d+)/view",component:xU,props:!0,meta:{active_menu:"customers",title:u("View Customer"),permission:"customers/view"}}]},reports:{name:"reports",path:"/reports",component:dte,meta:{active_menu:"reports",permission:"reports/view"},children:[{name:"reports_overview",path:"overview",component:mce,meta:{title:u("Overview"),permission:"reports/view"}},{name:"reports_sales",path:"sales",component:Rte,meta:{title:u("Sales"),permission:"reports/view"}},{name:"reports_orders",path:"orders",component:tne,meta:{title:u("Orders"),permission:"reports/view"}},{name:"reports_revenue",path:"revenue",component:Vae,meta:{title:u("Revenue"),permission:"reports/view"}},{name:"reports_refunds",path:"refunds",component:Lne,meta:{title:u("Refunds"),permission:"reports/view"}},{name:"reports_subscriptions",path:"subscriptions",component:Eoe,meta:{title:u("Subscriptions"),permission:"reports/view"}},{name:"subscriptions-retention",path:"subscriptions/subscriptions-retention",component:Kie,meta:{title:u("Retention"),permission:"reports/view"}},{name:"subscriptions-cohorts",path:"subscriptions/subscriptions-cohorts",component:()=>Yt(()=>import("./chunks/Cohort.js?ver=1.6.6"),[],import.meta.url),meta:{title:u("Cohorts"),permission:"reports/view"}},{name:"future_renewals",path:"subscriptions/future-renewals",component:Yoe,meta:{title:u("Future Renewals"),permission:"reports/view"}},{name:"reports_products",path:"products",component:bue,meta:{title:u("Product"),permission:"reports/view"}},{name:"reports_customer",path:"customer",component:mre,meta:{title:u("Customer"),permission:"reports/view"}},{name:"reports_sources",path:"sources",component:Xre,meta:{title:u("Sources"),permission:"reports/view"}}]},settings:{path:"/settings",component:vE,meta:{active_menu:"settings",title:u("Settings"),permission:["store/settings","store/sensitive"]},children:[{name:"store_settings",path:"store-settings",component:IV,meta:{active_menu:"settings",title:u("Settings"),permission:"store/settings"},children:[{name:"store_setup",path:"",component:Jl,meta:{title:u("Store Setup")}},{name:"pages_setup",path:"pages_setup",component:Jl,meta:{title:u("Pages Setup")}},{name:"single_product_setup",path:"single_product_setup",component:Jl,meta:{title:u("Product Page")}},{name:"cart_and_checkout",path:"cart_and_checkout",component:Jl,meta:{title:u("Cart & Checkout")}},{name:"subscriptions_setup",path:"subscriptions_setup",component:Jl,meta:{title:u("Subscriptions")}},{name:"checkout_fields",path:"checkout_fields",component:cge,meta:{}},{name:"appearance",path:"appearance",component:Jl,meta:{title:u("Appearance")}}]},{name:"compliance",path:"compliance",component:Jl,meta:{active_menu:"settings",title:u("Compliance"),permission:"store/settings"}},...ze.get("addon_settings_routes",[]).map(e=>({component:Jl,...e})),{name:"email_notifications",path:"email_notifications",component:vX,meta:{active_menu:"settings",title:u("Notifications"),permission:"store/sensitive"}},{name:"email_mailing_settings",path:"email_mailing_settings",component:cAe,meta:{active_menu:"settings",title:u("Mailing Settings"),permission:"store/sensitive"}},{name:"reminders",path:"email_mailing_settings/reminders",component:Jl,meta:{active_menu:"settings",title:u("Reminders"),permission:"store/sensitive"}},{name:"email_digest_settings",path:"email_digest_settings",component:gAe,meta:{active_menu:"settings",title:u("Store Digest"),permission:"store/sensitive"}},{path:"email_notifications/:name/",name:"email_notifications/edit",component:jX,meta:{active_menu:"settings",title:u("Edit Notification"),permission:"store/sensitive"},props:!0},{path:"email_notifications/add",name:"email_notifications/add",component:mZ,meta:{active_menu:"settings",title:u("Add Notification"),permission:"store/sensitive"}},{name:"licensing",path:"licensing",component:tT,meta:{active_menu:"settings",title:u("Licensing"),permission:"store/sensitive"}},{name:"payments",path:"payments",component:H$,meta:{active_menu:"settings",title:u("Payment Settings"),permission:"is_super_admin"}},{name:"gateway",component:hS,path:"payments",children:Ef,props:!0,meta:{active_menu:"settings",title:u("Payment Settings"),permission:"is_super_admin"}},{name:"invoice-packing",path:"invoice-packing",component:kv,meta:{active_menu:"settings",title:u("Invoice & Packing"),permission:"is_super_admin"}},{name:"pdf-template",path:"pdf-template",component:xv,meta:{active_menu:"settings",title:u("PDF Templates"),permission:"is_super_admin"},children:[{name:"pdf-template-list",path:"",component:Nv,meta:{active_menu:"settings",title:u("PDF Templates"),permission:"is_super_admin"}},{name:"pdf-template-settings",path:"settings",component:Fg,meta:{active_menu:"settings",title:u("PDF Template Settings"),permission:"is_super_admin"}},{name:"edit-pdf-template",path:":template/edit",component:rg,props:!0,meta:{active_menu:"settings",title:u("Edit PDF Template"),permission:"is_super_admin"}}]},{name:"roles",path:"roles",component:rE,meta:{active_menu:"settings",title:u("Role Settings"),permission:"is_super_admin"}},{name:"addons",path:"addons",component:Vce,meta:{active_menu:"settings",title:u("Features & addon"),permission:"is_super_admin"}},{name:"coupons",path:"coupons",component:Fc,meta:{active_menu:"coupons",title:u("Coupons Settings"),permission:"is_super_admin"}},{name:"storage",path:"storage",component:iZ,meta:{active_menu:"settings",title:u("Storage Providers"),permission:"is_super_admin"}},{name:"s3",path:"storage/s3",component:wc,props:!0,meta:{active_menu:"settings",title:u("S3"),permission:"is_super_admin"}},{name:"payment-design",path:"payments/:method/design",component:bS,meta:{active_menu:"settings",title:u("Gateway"),permission:"is_super_admin"},props:!0},{name:"drivers",component:wc,path:"storage",children:Uf,props:!0,meta:{active_menu:"settings",title:u("Storage Settings"),permission:"is_super_admin"}},{name:"tax_settings",path:"tax_settings",component:wAe,meta:{active_menu:"settings",title:u("Tax Settings"),permission:"store/settings"},children:[{name:"tax_configurations",path:"",component:Qpe,meta:{}},{name:"tax_rates",path:"tax_rates",component:Ype,meta:{}},{name:"eu",path:"eu",component:C_e,meta:{}},{name:"eu_country_tax_rates",path:"eu/:country/:group",component:Sc,props:!0,meta:{}},{name:"tax-rates-country-single",path:"tax_rates_country_single/:country/:group",component:Sc,props:!0,meta:{}}]}]},integrations:{name:"integrations",path:"/integrations",component:dx,meta:{active_menu:"integrations",title:u("Integrations"),permission:"integrations/view"}},global_feed_editor:{name:"feed_editor",path:"/global_integrations/:integration_id/:integration_name",component:nc,meta:{active_menu:"integrations",title:u("Global Integrations"),permission:"integrations/view"}},integration_editor:{name:"integration_editor",path:"/integrations/:integration_name",component:GS,meta:{active_menu:"integrations",title:u("Integrations"),permission:"integrations/manage"}},coupons:{name:"coupons",path:"/coupons",component:Fc,meta:{active_menu:"coupons",title:u("Coupons"),permission:"coupons/view"}},logs:{name:"logs",path:"/logs",component:aee,meta:{active_menu:"logs",title:u("Logs"),permission:"is_super_admin"}},taxes:{name:"taxes",path:"/taxes",component:wme,meta:{active_menu:"taxes",title:u("Taxes"),permission:"is_super_admin"}},add_or_edit_coupon_route:{name:"add_or_edit_coupon",path:"/coupons/add_or_edit_coupon/:coupon_id?",component:Kve,props:!0,meta:{active_menu:"coupons",title:u("Coupons"),permission:"coupons/manage"}},onboarding:{path:"/onboarding",component:x$,name:"onboarding",meta:{active_menu:"dashboard",title:u("Onboarding"),permission:"is_super_admin"}}};const Zbe={class:"fct-theme-button-container"},e0e={class:"theme-selected-button"},t0e={__name:"ThemeToggle",setup(e){const t=T(Te.MODE_LIGHT),a=c=>{t.value!==c&&(t.value=c,Te.apply(c))},l=[{value:"light",label:u("Light"),icon:"Sun"},{value:"dark",label:u("Dark"),icon:"Moon"},{value:"system",label:u("System"),icon:"Tools"}];Ds(()=>{const c=document.getElementById("theme-button-container");if(c){const p=c.querySelector(".fct-theme-button-container");p&&p.remove()}t.value=Te.getCurrentTheme(),t.value.toString().startsWith(Te.MODE_SYSTEM)&&(t.value=Te.MODE_SYSTEM)});const s=c=>{xe(()=>{t.value=Te.getCurrentTheme()})},i=c=>{a(c)};return Ie(()=>{window.addEventListener(Te.THEME_CHANGE_EVENT,s,!1)}),cl(()=>{window.removeEventListener(Te.THEME_CHANGE_EVENT,s,!1)}),(c,p)=>{const f=C("el-dropdown-item"),_=C("el-dropdown-menu"),g=C("el-dropdown");return r(),h("div",Zbe,[n(g,{placement:"bottom-end",trigger:"click","popper-class":"fct-dropdown",onCommand:i},{dropdown:d(()=>[n(_,null,{default:d(()=>[(r(),h(P,null,te(l,y=>n(f,{key:y.value,command:y.value,class:de({active:t.value===y.value})},{default:d(()=>[n(Y,{name:y.icon},null,8,["name"]),R(" "+m(y.label),1)]),_:2},1032,["command","class"])),64))]),_:1})]),default:d(()=>[o("div",e0e,[t.value==="light"?(r(),E(Y,{key:0,name:"Sun"})):t.value==="dark"?(r(),E(Y,{key:1,name:"Moon"})):t.value==="system"?(r(),E(Y,{key:2,name:"Tools"})):x("",!0)])]),_:1})])}}};function ns(e){return Array.isArray?Array.isArray(e):Df(e)==="[object Array]"}function a0e(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function l0e(e){return e==null?"":a0e(e)}function Hl(e){return typeof e=="string"}function If(e){return typeof e=="number"}function s0e(e){return e===!0||e===!1||n0e(e)&&Df(e)=="[object Boolean]"}function Qf(e){return typeof e=="object"}function n0e(e){return Qf(e)&&e!==null}function hl(e){return e!=null}function Ar(e){return!e.trim().length}function Df(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const o0e="Incorrect 'index' type",i0e=e=>`Invalid value for key ${e}`,r0e=e=>`Pattern length exceeds max of ${e}.`,d0e=e=>`Missing ${e} property in key`,u0e=e=>`Property 'weight' in key '${e}' must be a positive integer`,Dc=Object.prototype.hasOwnProperty;class c0e{constructor(t){this._keys=[],this._keyMap={};let a=0;t.forEach(l=>{let s=Vf(l);this._keys.push(s),this._keyMap[s.id]=s,a+=s.weight}),this._keys.forEach(l=>{l.weight/=a})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Vf(e){let t=null,a=null,l=null,s=1,i=null;if(Hl(e)||ns(e))l=e,t=Vc(e),a=jr(e);else{if(!Dc.call(e,"name"))throw new Error(d0e("name"));const c=e.name;if(l=c,Dc.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(u0e(c));t=Vc(c),a=jr(c),i=e.getFn}return{path:t,id:a,weight:s,src:l,getFn:i}}function Vc(e){return ns(e)?e:e.split(".")}function jr(e){return ns(e)?e.join("."):e}function A0e(e,t){let a=[],l=!1;const s=(i,c,p)=>{if(hl(i))if(!c[p])a.push(i);else{let f=c[p];const _=i[f];if(!hl(_))return;if(p===c.length-1&&(Hl(_)||If(_)||s0e(_)))a.push(l0e(_));else if(ns(_)){l=!0;for(let g=0,y=_.length;g<y;g+=1)s(_[g],c,p+1)}else c.length&&s(_,c,p+1)}};return s(e,Hl(t)?t.split("."):t,0),l?a:a[0]}const p0e={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},f0e={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},m0e={location:0,threshold:.6,distance:100},h0e={useExtendedSearch:!1,getFn:A0e,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var Et={...f0e,...p0e,...m0e,...h0e};const _0e=/[^ ]+/g;function v0e(e=1,t=3){const a=new Map,l=Math.pow(10,t);return{get(s){const i=s.match(_0e).length;if(a.has(i))return a.get(i);const c=1/Math.pow(i,.5*e),p=parseFloat(Math.round(c*l)/l);return a.set(i,p),p},clear(){a.clear()}}}class Md{constructor({getFn:t=Et.getFn,fieldNormWeight:a=Et.fieldNormWeight}={}){this.norm=v0e(a,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((a,l)=>{this._keysMap[a.id]=l})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Hl(this.docs[0])?this.docs.forEach((t,a)=>{this._addString(t,a)}):this.docs.forEach((t,a)=>{this._addObject(t,a)}),this.norm.clear())}add(t){const a=this.size();Hl(t)?this._addString(t,a):this._addObject(t,a)}removeAt(t){this.records.splice(t,1);for(let a=t,l=this.size();a<l;a+=1)this.records[a].i-=1}getValueForItemAtKeyId(t,a){return t[this._keysMap[a]]}size(){return this.records.length}_addString(t,a){if(!hl(t)||Ar(t))return;let l={v:t,i:a,n:this.norm.get(t)};this.records.push(l)}_addObject(t,a){let l={i:a,$:{}};this.keys.forEach((s,i)=>{let c=s.getFn?s.getFn(t):this.getFn(t,s.path);if(hl(c)){if(ns(c)){let p=[];const f=[{nestedArrIndex:-1,value:c}];for(;f.length;){const{nestedArrIndex:_,value:g}=f.pop();if(hl(g))if(Hl(g)&&!Ar(g)){let y={v:g,i:_,n:this.norm.get(g)};p.push(y)}else ns(g)&&g.forEach((y,v)=>{f.push({nestedArrIndex:v,value:y})})}l.$[i]=p}else if(Hl(c)&&!Ar(c)){let p={v:c,n:this.norm.get(c)};l.$[i]=p}}}),this.records.push(l)}toJSON(){return{keys:this.keys,records:this.records}}}function Tf(e,t,{getFn:a=Et.getFn,fieldNormWeight:l=Et.fieldNormWeight}={}){const s=new Md({getFn:a,fieldNormWeight:l});return s.setKeys(e.map(Vf)),s.setSources(t),s.create(),s}function g0e(e,{getFn:t=Et.getFn,fieldNormWeight:a=Et.fieldNormWeight}={}){const{keys:l,records:s}=e,i=new Md({getFn:t,fieldNormWeight:a});return i.setKeys(l),i.setIndexRecords(s),i}function ko(e,{errors:t=0,currentLocation:a=0,expectedLocation:l=0,distance:s=Et.distance,ignoreLocation:i=Et.ignoreLocation}={}){const c=t/e.length;if(i)return c;const p=Math.abs(l-a);return s?c+p/s:p?1:c}function y0e(e=[],t=Et.minMatchCharLength){let a=[],l=-1,s=-1,i=0;for(let c=e.length;i<c;i+=1){let p=e[i];p&&l===-1?l=i:!p&&l!==-1&&(s=i-1,s-l+1>=t&&a.push([l,s]),l=-1)}return e[i-1]&&i-l>=t&&a.push([l,i-1]),a}const Ss=32;function b0e(e,t,a,{location:l=Et.location,distance:s=Et.distance,threshold:i=Et.threshold,findAllMatches:c=Et.findAllMatches,minMatchCharLength:p=Et.minMatchCharLength,includeMatches:f=Et.includeMatches,ignoreLocation:_=Et.ignoreLocation}={}){if(t.length>Ss)throw new Error(r0e(Ss));const g=t.length,y=e.length,v=Math.max(0,Math.min(l,y));let w=i,k=v;const b=p>1||f,S=b?Array(y):[];let $;for(;($=e.indexOf(t,k))>-1;){let V=ko(t,{currentLocation:$,expectedLocation:v,distance:s,ignoreLocation:_});if(w=Math.min(V,w),k=$+g,b){let I=0;for(;I<g;)S[$+I]=1,I+=1}}k=-1;let D=[],F=1,B=g+y;const U=1<<g-1;for(let V=0;V<g;V+=1){let I=0,M=B;for(;I<M;)ko(t,{errors:V,currentLocation:v+M,expectedLocation:v,distance:s,ignoreLocation:_})<=w?I=M:B=M,M=Math.floor((B-I)/2+I);B=M;let O=Math.max(1,v-M+1),L=c?y:Math.min(v+M,y)+g,H=Array(L+2);H[L+1]=(1<<V)-1;for(let W=L;W>=O;W-=1){let G=W-1,Z=a[e.charAt(G)];if(b&&(S[G]=+!!Z),H[W]=(H[W+1]<<1|1)&Z,V&&(H[W]|=(D[W+1]|D[W])<<1|1|D[W+1]),H[W]&U&&(F=ko(t,{errors:V,currentLocation:G,expectedLocation:v,distance:s,ignoreLocation:_}),F<=w)){if(w=F,k=G,k<=v)break;O=Math.max(1,2*v-k)}}if(ko(t,{errors:V+1,currentLocation:v,expectedLocation:v,distance:s,ignoreLocation:_})>w)break;D=H}const Q={isMatch:k>=0,score:Math.max(.001,F)};if(b){const V=y0e(S,p);V.length?f&&(Q.indices=V):Q.isMatch=!1}return Q}function w0e(e){let t={};for(let a=0,l=e.length;a<l;a+=1){const s=e.charAt(a);t[s]=(t[s]||0)|1<<l-a-1}return t}const si=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class Mf{constructor(t,{location:a=Et.location,threshold:l=Et.threshold,distance:s=Et.distance,includeMatches:i=Et.includeMatches,findAllMatches:c=Et.findAllMatches,minMatchCharLength:p=Et.minMatchCharLength,isCaseSensitive:f=Et.isCaseSensitive,ignoreDiacritics:_=Et.ignoreDiacritics,ignoreLocation:g=Et.ignoreLocation}={}){if(this.options={location:a,threshold:l,distance:s,includeMatches:i,findAllMatches:c,minMatchCharLength:p,isCaseSensitive:f,ignoreDiacritics:_,ignoreLocation:g},t=f?t:t.toLowerCase(),t=_?si(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const y=(w,k)=>{this.chunks.push({pattern:w,alphabet:w0e(w),startIndex:k})},v=this.pattern.length;if(v>Ss){let w=0;const k=v%Ss,b=v-k;for(;w<b;)y(this.pattern.substr(w,Ss),w),w+=Ss;if(k){const S=v-Ss;y(this.pattern.substr(S),S)}}else y(this.pattern,0)}searchIn(t){const{isCaseSensitive:a,ignoreDiacritics:l,includeMatches:s}=this.options;if(t=a?t:t.toLowerCase(),t=l?si(t):t,this.pattern===t){let b={isMatch:!0,score:0};return s&&(b.indices=[[0,t.length-1]]),b}const{location:i,distance:c,threshold:p,findAllMatches:f,minMatchCharLength:_,ignoreLocation:g}=this.options;let y=[],v=0,w=!1;this.chunks.forEach(({pattern:b,alphabet:S,startIndex:$})=>{const{isMatch:D,score:F,indices:B}=b0e(t,b,S,{location:i+$,distance:c,threshold:p,findAllMatches:f,minMatchCharLength:_,includeMatches:s,ignoreLocation:g});D&&(w=!0),v+=F,D&&B&&(y=[...y,...B])});let k={isMatch:w,score:w?v/this.chunks.length:1};return w&&s&&(k.indices=y),k}}class Cs{constructor(t){this.pattern=t}static isMultiMatch(t){return Tc(t,this.multiRegex)}static isSingleMatch(t){return Tc(t,this.singleRegex)}search(){}}function Tc(e,t){const a=e.match(t);return a?a[1]:null}class C0e extends Cs{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const a=t===this.pattern;return{isMatch:a,score:a?0:1,indices:[0,this.pattern.length-1]}}}class k0e extends Cs{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const l=t.indexOf(this.pattern)===-1;return{isMatch:l,score:l?0:1,indices:[0,t.length-1]}}}class B0e extends Cs{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const a=t.startsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[0,this.pattern.length-1]}}}class x0e extends Cs{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const a=!t.startsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[0,t.length-1]}}}class S0e extends Cs{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const a=t.endsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class F0e extends Cs{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const a=!t.endsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[0,t.length-1]}}}class Lf extends Cs{constructor(t,{location:a=Et.location,threshold:l=Et.threshold,distance:s=Et.distance,includeMatches:i=Et.includeMatches,findAllMatches:c=Et.findAllMatches,minMatchCharLength:p=Et.minMatchCharLength,isCaseSensitive:f=Et.isCaseSensitive,ignoreDiacritics:_=Et.ignoreDiacritics,ignoreLocation:g=Et.ignoreLocation}={}){super(t),this._bitapSearch=new Mf(t,{location:a,threshold:l,distance:s,includeMatches:i,findAllMatches:c,minMatchCharLength:p,isCaseSensitive:f,ignoreDiacritics:_,ignoreLocation:g})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Rf extends Cs{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let a=0,l;const s=[],i=this.pattern.length;for(;(l=t.indexOf(this.pattern,a))>-1;)a=l+i,s.push([l,a-1]);const c=!!s.length;return{isMatch:c,score:c?0:1,indices:s}}}const qr=[C0e,Rf,B0e,x0e,F0e,S0e,k0e,Lf],Mc=qr.length,$0e=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,E0e="|";function U0e(e,t={}){return e.split(E0e).map(a=>{let l=a.trim().split($0e).filter(i=>i&&!!i.trim()),s=[];for(let i=0,c=l.length;i<c;i+=1){const p=l[i];let f=!1,_=-1;for(;!f&&++_<Mc;){const g=qr[_];let y=g.isMultiMatch(p);y&&(s.push(new g(y,t)),f=!0)}if(!f)for(_=-1;++_<Mc;){const g=qr[_];let y=g.isSingleMatch(p);if(y){s.push(new g(y,t));break}}}return s})}const I0e=new Set([Lf.type,Rf.type]);class Q0e{constructor(t,{isCaseSensitive:a=Et.isCaseSensitive,ignoreDiacritics:l=Et.ignoreDiacritics,includeMatches:s=Et.includeMatches,minMatchCharLength:i=Et.minMatchCharLength,ignoreLocation:c=Et.ignoreLocation,findAllMatches:p=Et.findAllMatches,location:f=Et.location,threshold:_=Et.threshold,distance:g=Et.distance}={}){this.query=null,this.options={isCaseSensitive:a,ignoreDiacritics:l,includeMatches:s,minMatchCharLength:i,findAllMatches:p,ignoreLocation:c,location:f,threshold:_,distance:g},t=a?t:t.toLowerCase(),t=l?si(t):t,this.pattern=t,this.query=U0e(this.pattern,this.options)}static condition(t,a){return a.useExtendedSearch}searchIn(t){const a=this.query;if(!a)return{isMatch:!1,score:1};const{includeMatches:l,isCaseSensitive:s,ignoreDiacritics:i}=this.options;t=s?t:t.toLowerCase(),t=i?si(t):t;let c=0,p=[],f=0;for(let _=0,g=a.length;_<g;_+=1){const y=a[_];p.length=0,c=0;for(let v=0,w=y.length;v<w;v+=1){const k=y[v],{isMatch:b,indices:S,score:$}=k.search(t);if(b){if(c+=1,f+=$,l){const D=k.constructor.type;I0e.has(D)?p=[...p,...S]:p.push(S)}}else{f=0,c=0,p.length=0;break}}if(c){let v={isMatch:!0,score:f/c};return l&&(v.indices=p),v}}return{isMatch:!1,score:1}}}const Yr=[];function D0e(...e){Yr.push(...e)}function Wr(e,t){for(let a=0,l=Yr.length;a<l;a+=1){let s=Yr[a];if(s.condition(e,t))return new s(e,t)}return new Mf(e,t)}const ni={AND:"$and",OR:"$or"},Jr={PATH:"$path",PATTERN:"$val"},Xr=e=>!!(e[ni.AND]||e[ni.OR]),V0e=e=>!!e[Jr.PATH],T0e=e=>!ns(e)&&Qf(e)&&!Xr(e),Lc=e=>({[ni.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Of(e,t,{auto:a=!0}={}){const l=s=>{let i=Object.keys(s);const c=V0e(s);if(!c&&i.length>1&&!Xr(s))return l(Lc(s));if(T0e(s)){const f=c?s[Jr.PATH]:i[0],_=c?s[Jr.PATTERN]:s[f];if(!Hl(_))throw new Error(i0e(f));const g={keyId:jr(f),pattern:_};return a&&(g.searcher=Wr(_,t)),g}let p={children:[],operator:i[0]};return i.forEach(f=>{const _=s[f];ns(_)&&_.forEach(g=>{p.children.push(l(g))})}),p};return Xr(e)||(e=Lc(e)),l(e)}function M0e(e,{ignoreFieldNorm:t=Et.ignoreFieldNorm}){e.forEach(a=>{let l=1;a.matches.forEach(({key:s,norm:i,score:c})=>{const p=s?s.weight:null;l*=Math.pow(c===0&&p?Number.EPSILON:c,(p||1)*(t?1:i))}),a.score=l})}function L0e(e,t){const a=e.matches;t.matches=[],hl(a)&&a.forEach(l=>{if(!hl(l.indices)||!l.indices.length)return;const{indices:s,value:i}=l;let c={indices:s,value:i};l.key&&(c.key=l.key.src),l.idx>-1&&(c.refIndex=l.idx),t.matches.push(c)})}function R0e(e,t){t.score=e.score}function O0e(e,t,{includeMatches:a=Et.includeMatches,includeScore:l=Et.includeScore}={}){const s=[];return a&&s.push(L0e),l&&s.push(R0e),e.map(i=>{const{idx:c}=i,p={item:t[c],refIndex:c};return s.length&&s.forEach(f=>{f(i,p)}),p})}class mn{constructor(t,a={},l){this.options={...Et,...a},this.options.useExtendedSearch,this._keyStore=new c0e(this.options.keys),this.setCollection(t,l)}setCollection(t,a){if(this._docs=t,a&&!(a instanceof Md))throw new Error(o0e);this._myIndex=a||Tf(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){hl(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const a=[];for(let l=0,s=this._docs.length;l<s;l+=1){const i=this._docs[l];t(i,l)&&(this.removeAt(l),l-=1,s-=1,a.push(i))}return a}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:a=-1}={}){const{includeMatches:l,includeScore:s,shouldSort:i,sortFn:c,ignoreFieldNorm:p}=this.options;let f=Hl(t)?Hl(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return M0e(f,{ignoreFieldNorm:p}),i&&f.sort(c),If(a)&&a>-1&&(f=f.slice(0,a)),O0e(f,this._docs,{includeMatches:l,includeScore:s})}_searchStringList(t){const a=Wr(t,this.options),{records:l}=this._myIndex,s=[];return l.forEach(({v:i,i:c,n:p})=>{if(!hl(i))return;const{isMatch:f,score:_,indices:g}=a.searchIn(i);f&&s.push({item:i,idx:c,matches:[{score:_,value:i,norm:p,indices:g}]})}),s}_searchLogical(t){const a=Of(t,this.options),l=(p,f,_)=>{if(!p.children){const{keyId:y,searcher:v}=p,w=this._findMatches({key:this._keyStore.get(y),value:this._myIndex.getValueForItemAtKeyId(f,y),searcher:v});return w&&w.length?[{idx:_,item:f,matches:w}]:[]}const g=[];for(let y=0,v=p.children.length;y<v;y+=1){const w=p.children[y],k=l(w,f,_);if(k.length)g.push(...k);else if(p.operator===ni.AND)return[]}return g},s=this._myIndex.records,i={},c=[];return s.forEach(({$:p,i:f})=>{if(hl(p)){let _=l(a,p,f);_.length&&(i[f]||(i[f]={idx:f,item:p,matches:[]},c.push(i[f])),_.forEach(({matches:g})=>{i[f].matches.push(...g)}))}}),c}_searchObjectList(t){const a=Wr(t,this.options),{keys:l,records:s}=this._myIndex,i=[];return s.forEach(({$:c,i:p})=>{if(!hl(c))return;let f=[];l.forEach((_,g)=>{f.push(...this._findMatches({key:_,value:c[g],searcher:a}))}),f.length&&i.push({idx:p,item:c,matches:f})}),i}_findMatches({key:t,value:a,searcher:l}){if(!hl(a))return[];let s=[];if(ns(a))a.forEach(({v:i,i:c,n:p})=>{if(!hl(i))return;const{isMatch:f,score:_,indices:g}=l.searchIn(i);f&&s.push({score:_,key:t,value:i,idx:c,norm:p,indices:g})});else{const{v:i,n:c}=a,{isMatch:p,score:f,indices:_}=l.searchIn(i);p&&s.push({score:f,key:t,value:i,norm:c,indices:_})}return s}}mn.version="7.1.0";mn.createIndex=Tf;mn.parseIndex=g0e;mn.config=Et;mn.parseQuery=Of;D0e(Q0e);const P0e=(ze.get("payment_routes")||[]).filter(e=>!e.upcoming).map(e=>{const t=e.meta.admin_title||e.meta.title||e.meta.label||e.name;return{title:t,subtitle:u("Manage %1$s",t),path:"/settings/payments/"+e.path}}),H0e=[{title:u("Dashboard"),path:"/"},{title:u("Orders"),path:"/orders"},{title:u("Create Order"),path:"/orders/add"},{title:u("Customers"),path:"/customers"},{title:u("Products"),path:"/products"},{title:u("Product Inventory"),path:"/products/inventory"},{title:u("Bulk Import Products"),path:"/products/bulk-insert"},{title:u("Integrations"),path:"/integrations"},{title:u("Coupons"),path:"/coupons"},{title:u("Logs"),path:"/logs"},{title:u("Taxes"),path:"/taxes"},{title:u("Reports"),path:"/reports/overview"},{title:u("Sales Report"),path:"/reports/sales"},{title:u("Orders Report"),path:"/reports/orders"},{title:u("Revenue Report"),path:"/reports/revenue"},{title:u("Refunds Report"),path:"/reports/refunds"},{title:u("Subscriptions Report"),path:"/reports/subscriptions"},{title:u("Future Renewals Report"),path:"/reports/subscriptions/future-renewals"},{title:u("Product Report"),path:"/reports/products"},{title:u("Customer Report"),path:"/reports/customer"},{title:u("Traffic Sources Report"),path:"/reports/sources"},...P0e],N0e=H0e.map(({title:e,subtitle:t,path:a})=>({title:e,...t?{subtitle:t}:{},data:{type:"action",action:({router:l})=>{l.push({path:a})},show_description:!1}})),K0e=[{title:"Theme",title_resolver:()=>{let t=(Te.isDark()?"dark":"light")==="light"?u("Dark"):u("Light");return u("Change theme to %1$s",t)},data:{type:"action",action:()=>{let t=(Te.isDark()?"dark":"light")==="light"?"dark":"light";Te.apply(t,{fromShortcut:!0})}}}],Rc={"/settings/store-settings":u("Store Setup"),"/settings/store-settings/pages_setup":u("Pages Setup"),"/settings/store-settings/single_product_setup":u("Single Product & Order Setup"),"/settings/store-settings/cart_and_checkout":u("Cart and Checkout"),"/settings/compliance":u("Compliance"),"/settings/store-settings/subscriptions_setup":u("Subscriptions Setup"),"/settings/store-settings/checkout_fields":u("Checkout Fields"),"/settings/store-settings/appearance":u("Appearance"),"/settings/email_notifications":u("Email Notifications"),"/settings/email_mailing_settings":u("Mailing Settings"),"/settings/email_mailing_settings/reminders":u("Reminders"),"/settings/licensing":u("Licensing"),"/settings/payments":u("Payment Settings"),"/settings/invoice-packing":u("Invoice & Packing Slips"),"/settings/pdf-template":u("PDF Templates"),"/settings/roles":u("Role Settings"),"/settings/addons":u("Features & Addons"),"/settings/tax_settings":u("Tax Settings"),"/settings/tax_settings/tax_rates":u("Tax Rates"),"/settings/tax_settings/eu":u("EU VAT Settings"),"/settings/storage":u("Storage Providers"),"/settings/coupons":u("Coupon Settings")};let Pf=[];Object.keys(Rc).forEach(e=>{const t=Rc[e];Pf.push({title:t,data:{type:"action",action:({router:a})=>{a.push({path:e})},description:u("Go to %1$s",t),show_description:!1}})});const G0e=[],z0e={Menu:N0e,Actions:K0e,Settings:Pf,Shortcuts:G0e},Zr=[];Object.entries(z0e).forEach(([e,t])=>{t.forEach((a,l)=>{Zr.push({...a,id:`${e.toString().toLowerCase()}-${l}`,group:[e]})})});const j0e=()=>({shouldSort:!0,threshold:.6,keys:[{name:"title",getFn:e=>e.title},{name:"data.description",getFn:e=>e.data.description},{name:"group",weight:2,getFn:e=>e.group}]}),q0e={class:"navigable-list-container fct-global-search-result-container"},Y0e={key:0,class:"no-results fct-global-search-result-not-found"},W0e={key:1},J0e=["tabindex","onClick","onKeydown"],X0e={__name:"NavigableList",props:{items:{type:Array,required:!0,default:()=>[]},noResultsText:{type:String,default:u("No results found")},onAction:{type:Function,required:!0}},setup(e,{expose:t}){const a=e,l=T(-1),s=td("listContainer"),i=T({}),c=(k,b)=>{b&&(i.value[k]=b)},p=k=>{const b=a.items.length;if(b===0)return;const S=b-1;k==="up"?l.value=l.value<=0?S:l.value-1:k==="down"&&(l.value=l.value>=S?0:l.value+1),f()},f=()=>{const k=s.value,b=i.value[l.value];b&&k&&(b.scrollIntoView({behavior:"smooth",block:"nearest"}),xe(()=>{b.focus()}))},_=k=>{l.value=k,g(k)},g=k=>{k>=0&&k<a.items.length&&a.onAction(a.items[k],k)},y=()=>{l.value=-1};return t({focusList:k=>{k=k??a.items.length-1,k>=0&&(l.value=k,xe(()=>{i.value[k]&&i.value[k].focus()}))},resetSelection:y,performFirstAction:()=>{a.items.length>0?(l.value=0,setTimeout(()=>{g(0)},200)):l.value=-1}}),be(()=>a.items,k=>{y(),k.length>0&&xe(()=>{})},{immediate:!0}),be(l,()=>{}),(k,b)=>(r(),h("div",q0e,[e.items.length===0?(r(),h("div",Y0e,[n(Y,{name:"Empty/GlobalSearch"}),R(" "+m(e.noResultsText),1)])):(r(),h("div",W0e,[o("ul",{ref_key:"listContainer",ref:s,class:"navigable-list fct-global-search-result-list"},[(r(!0),h(P,null,te(e.items,(S,$)=>(r(),h("li",{key:$,ref_for:!0,ref:D=>c($,D),class:de({selected:$===l.value}),tabindex:$,onClick:D=>_($),onKeydown:[b[0]||(b[0]=xa(Ge(D=>p("up"),["prevent"]),["arrow-up"])),b[1]||(b[1]=xa(Ge(D=>p("down"),["prevent"]),["arrow-down"])),xa(D=>g($),["enter"])]},[ga(k.$slots,"default",{item:S,index:$,isSelected:$===l.value},void 0,!0)],42,J0e))),128))],512)]))]))}},ed=nt(X0e,[["__scopeId","data-v-2379fe26"]]),Z0e={class:"fct-search-result-label"},ewe={class:"fct-search-result-title"},twe={key:0,class:"fct-search-result-subtitle"},awe={key:1,class:"fct-search-result-subtitle"},lwe={class:"action-icon"},swe={class:"recent-search-title"},nwe={class:"fct-search-result-label"},owe={class:"fct-search-result-title"},iwe={key:0,class:"fct-search-result-subtitle"},rwe={key:1,class:"fct-search-result-subtitle"},dwe={class:"action-icon"},pr="recent_actions",uwe={__name:"ResultList",props:{query:{type:String,required:!0},searchResults:{type:Array,required:!0,default:()=>[]},onActionPerformed:{type:Function,required:!0},focusInput:{type:Function,required:!0},searchData:{type:Array,required:!0,default:()=>[]}},setup(e,{expose:t}){const a=sl();Jt().ctx;const l=e,s=T(0),i=T({}),c=T(),p=(S,$)=>{const F=S.item.data,B=_(F.type);if(B==="link"){let U=_(F.url);_(F.new_tab)?window.open(U,"_blank"):window.location.href=U}else B==="action"&&_(F.action);f(S),l.onActionPerformed()},f=S=>{const $=S.item.id;let D=Vt.get(pr)||[];D=D.filter(F=>F!==$),D.unshift($),D=D.slice(0,5),Vt.set(pr,D)},_=S=>typeof S=="function"?g(S):S,g=async S=>await S({query:l.query,router:a}),y=()=>{var S;(S=c.value)==null||S.resetSelection()},v=()=>{var S;(S=c.value)==null||S.focusList(0)},w=()=>{var S;(S=c.value)==null||S.performFirstAction()};be(()=>l.searchResults,async()=>{i.value={},i.value=l.searchResults??{},s.value=Object.keys(i.value).length-1;let S=i.value;for(const $ of Object.keys(S)){const D=S[$];D.item.title_resolver&&(S[$].item.title=await _(D.item.title_resolver))}i.value={...S}});const k=T([]),b=async()=>{const S=Vt.get(pr)||[];let $=dt.whereIn(l.searchData,"id",S),D=[];for(const F of $)typeof F.title_resolver=="function"&&(F.title=await _(F.title_resolver)),D.push({item:F});k.value=D};return Ie(()=>{b()}),t({focusList:v,resetSelection:y,performFirstAction:w,fetchRecentActions:b}),(S,$)=>(r(),h(P,null,[e.query||k.value.length<1?(r(),E(ed,{key:0,items:e.searchResults,"on-action":p,"no-results-text":A(u)("No matches found"),ref_key:"navigableList",ref:c},{default:d(({item:D,index:F,isSelected:B})=>{var U,Q,V;return[o("span",Z0e,[o("span",ewe,m(D.item.title),1),(U=D.item)!=null&&U.subtitle?(r(),h("span",twe,m(D.item.subtitle),1)):((V=(Q=D.item)==null?void 0:Q.data)==null?void 0:V.show_description)===!0?(r(),h("span",awe,m(D.item.data.description),1)):x("",!0)]),o("div",lwe,[n(Y,{name:"Enter"})])]}),_:1},8,["items","no-results-text"])):x("",!0),!e.query&&k.value.length>0?(r(),h(P,{key:1},[o("span",swe,m(A(u)("Recent Actions")),1),n(ed,{items:k.value,"on-action":p,"no-results-text":A(u)("No matches found"),ref_key:"navigableList",ref:c},{default:d(({item:D,index:F,isSelected:B})=>{var U,Q,V;return[o("span",nwe,[o("span",owe,m(D.item.title),1),(U=D.item)!=null&&U.subtitle?(r(),h("span",iwe,m(D.item.subtitle),1)):((V=(Q=D.item)==null?void 0:Q.data)==null?void 0:V.show_description)===!0?(r(),h("span",rwe,m(D.item.data.description),1)):x("",!0)]),o("div",dwe,[n(Y,{name:"Enter"})])]}),_:1},8,["items","no-results-text"])],64)):x("",!0)],64))}},cwe=nt(uwe,[["__scopeId","data-v-ccb0ebef"]]),Awe={class:"fct-global-search-product-wrap"},pwe={class:"fct-global-search-product-left-info"},fwe={key:0,class:"type"},mwe={key:0,class:"price-and-status"},hwe={__name:"Product",props:{product:{type:Object,required:!0}},setup(e){const t=l=>l.min_price===l.max_price?Kt(l.min_price,!0):`${Kt(l.min_price,!0)} - ${Kt(l.max_price,!0)}`,a=l=>l==="publish"?u("published"):l==="future"?u("scheduled"):l;return(l,s)=>(r(),h("div",Awe,[o("div",pwe,[n(id,{product:e.product},null,8,["product"]),e.product.detail?(r(),h("span",fwe,[R(m(A(da).headline(e.product.detail.variation_type))+" ",1),s[0]||(s[0]=o("br",null,null,-1)),R(" "+m(A(da).headline(e.product.detail.fulfillment_type)),1)])):x("",!0)]),e.product.detail?(r(),h("span",mwe,[R(m(t(e.product.detail))+" ",1),(r(),E(fa,{key:e.product.ID,status:e.product.post_status},{default:d(()=>[R(m(a(e.product.post_status)),1)]),_:1},8,["status"]))])):x("",!0)]))}},_we={class:"fct-global-search-order-wrap"},vwe={class:"fct-global-search-order-header"},gwe={class:"fct-global-search-order-id"},ywe={class:"items"},bwe={class:"fct-global-search-order-header-meta"},wwe={class:"date"},Cwe=["innerHTML"],kwe={class:"customer-name"},Bwe={class:"fct-global-search-order-status-wrapper"},xwe=["src","alt"],Swe={__name:"Order",props:{order:{type:Object,required:!0}},setup(e){const t=a=>dt.get(window,"fluentCartAdminApp.payment_logos."+a);return(a,l)=>{var i;const s=C("el-tag");return r(),h("div",_we,[o("div",vwe,[o("div",gwe,[R(" #"+m(e.order.id)+" ",1),o("span",ywe,m(A(u)("%s Items",e.order.order_items.length)),1)]),o("div",bwe,[o("span",wwe,[n(Pa,{"date-time":e.order.created_at},null,8,["date-time"])]),l[0]||(l[0]=o("span",{class:"circle"},null,-1)),o("span",{class:"total-price",innerHTML:A(Kt)(e.order.total_amount,!0,!1,e.order.currency)},null,8,Cwe),l[1]||(l[1]=o("span",{class:"circle"},null,-1)),o("span",kwe,m(((i=e.order.customer)==null?void 0:i.full_name)||A(u)("No Name")),1)])]),o("div",Bwe,[n(fa,{status:e.order.payment_status,"hide-icon":!0},null,8,["status"]),t(e.order.payment_method)?(r(),h("img",{key:0,src:t(e.order.payment_method),alt:A(da).headline(e.order.payment_method)},null,8,xwe)):(r(),E(s,{key:1,type:"info",round:"",size:"small",class:"capitalize"},{default:d(()=>[R(m(A(da).headline(e.order.payment_method)),1)]),_:1}))])])}}},Fwe={class:"fct-global-search-customer-wrap"},$we={class:"fct-customer-card"},Ewe={class:"fct-customer-avatar"},Uwe=["src"],Iwe={class:"fct-customer-details"},Qwe={class:"fct-customer-name"},Dwe={class:"fct-customer-id"},Vwe={class:"fct-customer-email"},Twe={class:"purchase-count"},Mwe={class:"date"},Lwe={__name:"Customer",props:{customer:{type:Object,required:!0}},setup(e){return(t,a)=>(r(),h("div",Fwe,[o("div",$we,[o("div",Ewe,[o("img",{src:e.customer.photo,alt:"avatar"},null,8,Uwe)]),o("div",Iwe,[o("div",Qwe,[R(m(e.customer.full_name||t.$t("No Name"))+" ",1),o("span",Dwe,"#"+m(e.customer.id),1)]),o("div",Vwe,[R(m(e.customer.email)+" ",1),a[0]||(a[0]=o("span",{class:"circle"},null,-1)),a[1]||(a[1]=R()),o("span",Twe,"Purchase: "+m(e.customer.purchase_count),1)])])]),o("span",Mwe,[n(Pa,{"date-time":e.customer.last_purchase_date},null,8,["date-time"])])]))}},Rwe={class:"fct-global-search-coupon-wrap"},Owe={class:"amount"},Pwe={__name:"Coupon",props:{coupon:{type:Object,required:!0}},setup(e){return(t,a)=>(r(),h("div",Rwe,[o("span",null,m(e.coupon.title),1),o("span",null,m(e.coupon.code),1),o("span",Owe,m(A(Kt)(e.coupon.amount,!0)),1)]))}},Hwe={class:"fct-global-remote-result-container"},Nwe={class:"fct-global-remote-result-label"},Kwe={class:"text"},Gwe={class:"navigable-content"},zwe={class:"action-icon"},jwe={__name:"RemoteResult",emits:["close-modal","onRemoteSearchStateChange"],setup(e,{expose:t,emit:a}){const l=a,s=sl(),i=T({}),c=T(""),p=T(),f=T({}),_=T([]),g=V=>{y.value=!1,_.value=S.data.tableData,l("onRemoteSearchStateChange",!1)},y=T(!1),v={orders:_A({fetch:!1}),products:tf({fetch:!1}),customers:hA({fetch:!1}),coupons:kf({fetch:!1})},w=()=>{},k=()=>{var V;(V=p.value)==null||V.focusList(0)},b=()=>{var V;(V=p.value)==null||V.performFirstAction()};Ds(()=>{for(const V of Object.keys(v))v[V].onDataLoaded(g)});let S=null;const $=()=>{S=v[i.value.key],S.data.search=c.value,y.value=!0,S.fetch(),l("onRemoteSearchStateChange",!0)},D=cd.debounce($,800),F=(V,I)=>{if(_.value=[],S&&(S.data.search=""),i.value=I,f.value={title:I.title,key:I.key},!V){c.value="";return}c.value=V,D()},B=()=>{s.push({name:f.value.key,query:{search:c.value}}),l("close-modal")},U={orders:{name:"view_order",key:"order_id"},products:{name:"product_edit",key:"product_id"},customers:{name:"view_customer",key:"customer_id"},coupons:{name:"edit_coupon",key:"coupon_id"}},Q=V=>{i.value.key in U&&(s.push({name:U[i.value.key].name,params:{[U[i.value.key].key]:V.id||V.ID,action:"edit"}}),l("close-modal"))};return t({fetchData:F,focusList:k,resetSelection:w,performFirstAction:b}),(V,I)=>(r(),h("div",Hwe,[o("div",Nwe,[o("span",Kwe,m(i.value.title),1),f.value.key?(r(),h("span",{key:0,class:"view-all",onClick:B},m(c.value?A(u)('Search "%1$s" in %2$s',c.value,f.value.title):A(u)("See All %s",f.value.title)),1)):x("",!0)]),n(ed,{items:_.value,"on-action":M=>{Q(M)},"no-results-text":c.value?A(u)("No matches found for %s",i.value.title):A(u)("Type something to find %s",i.value.title),ref_key:"navigableList",ref:p},{default:d(({item:M,index:O,isSelected:L})=>[o("div",Gwe,[i.value.key==="products"?(r(),E(hwe,{key:0,product:M},null,8,["product"])):x("",!0),i.value.key==="orders"?(r(),E(Swe,{key:1,order:M},null,8,["order"])):x("",!0),i.value.key==="customers"?(r(),E(Lwe,{key:2,customer:M},null,8,["customer"])):x("",!0),i.value.key==="coupons"?(r(),E(Pwe,{key:3,coupon:M},null,8,["coupon"])):x("",!0)]),o("div",zwe,[n(Y,{name:"Enter"})])]),_:1},8,["items","on-action","no-results-text"])]))}},qwe={class:"fct-global-search-input-wrap"},Ywe=["aria-label"],Wwe={class:"fct-setting-search-icon"},Jwe={class:"fct-global-search-input-container"},Xwe={key:0,class:"searched-item"},Zwe={class:"fct-global-searching-for"},eCe={class:"fct-global-searching-for-label"},tCe={class:"fct-global-searching-suggestion-list"},aCe=["onClick"],lCe={class:"dialog-footer is-border"},sCe={class:"fct-search-commands"},nCe={class:"command-key"},oCe={class:"command-key"},iCe={class:"label"},rCe={class:"command-key"},dCe={class:"label"},uCe={class:"label"},cCe={__name:"GlobalSearch",setup(e){Jt().ctx,sl();const t=T(!1),a=T(""),l=T({}),s=T(),i=T(""),c=T([u("orders"),u("products"),u("customers"),u("coupons"),u("settings"),u("menus"),u("shortcuts...")]),p=T(0),f=T(!0),_=T(0),g=T(null),y=T(null),v=T(70),w=T(40),k=T(1700),b=()=>{xe(()=>{$()})},S=()=>{var ie,J;Q.value?(ie=W.value)==null||ie.resetSelection():(J=F.value)==null||J.resetSelection(),Q.value=!1,H.value=!1,D()},$=()=>{var ie;(ie=s.value)==null||ie.focus()},D=()=>{Q.value=!1,l.value=[],t.value=!1,a.value="",V.value=null},F=T(),B=ie=>{let J=ie.includes(","),N={},ae=[];(J?ie.split(","):[ie]).forEach(re=>{re.includes(":")?U(re,N,ae):ae.push(re)});let fe=[];return Object.keys(N).forEach(re=>{const Ee=N[re];Ee.length>0?Ee.forEach(ye=>{ye.length>0?fe.push({group:"'"+re,title:ye}):fe.push({group:"'"+re})}):fe.push({group:"'"+re})}),ae.forEach(re=>{re.length>0&&fe.push({title:re})}),fe},U=(ie,J,N)=>{if(ie.length===1)return;let ae=ie.split(":"),oe=ae[0],fe=ae[1];oe.length>0?(J.hasOwnProperty(oe)||(J[oe]=[]),fe.length>0&&J[oe].push(fe)):N.push(fe)},Q=T(!1),V=T(null),I=T({o:{key:"orders",title:u("Orders")},p:{key:"products",title:u("Products")},c:{key:"customers",title:u("Customers")},d:{key:"coupons",title:u("Coupons")}}),M=ie=>{V.value=ie,Q.value=!0,l.value={},xe(()=>{var J,N;(J=W.value)==null||J.fetchData(a.value,ie),(N=s.value)==null||N.focus()})},O=()=>{var ie;l.value=[],V.value=null,a.value="",Q.value=!1,(ie=s.value)==null||ie.focus(),H.value=!1},L=()=>{var ie;(ie=W.value)==null||ie.fetchData(a.value,V.value)},H=T(!1),j=ie=>{H.value=ie,xe(()=>{var J;(J=s.value)==null||J.focus()})},W=T(),G=bs(),Z=()=>{if(t.value){$();return}const ie=["o","p","c","d"];G.bind(ie,J=>{J.preventDefault();const N=I.value[J.key];N&&M(N)}),t.value=!0,xe(()=>{var J;(J=F.value)==null||J.fetchRecentActions()}),setTimeout(()=>{G.unbind(ie)},800)};G.bind(["/"],ie=>{!t.value&&ne()||(ie.preventDefault(),Z())});const ne=()=>{const ie=document.activeElement;if(!ie)return!1;const J=ie.tagName;return J==="INPUT"||J==="TEXTAREA"||J==="SELECT"||ie.isContentEditable},ce=()=>{if(g.value)return;const ie=()=>{if(s.value&&s.value.length>0)return;const N=c.value[p.value];if(f.value)_.value<N.length?(i.value=N.slice(0,_.value+1),_.value++):(f.value=!1,clearTimeout(y.value),y.value=setTimeout(()=>{y.value=null},k.value));else{if(y.value)return;_.value>0?(_.value--,i.value=N.slice(0,_.value)):(f.value=!0,p.value=(p.value+1)%c.value.length)}},J=()=>{ie();const N=f.value?v.value:y.value?120:w.value;g.value=setTimeout(J,N)};J()},z=T(!1);let ue;return Ie(()=>{ce(),ue=new mn(Zr,j0e());const ie=document.getElementById("fct_admin_menu_search");if(ie){const J=ie.querySelector(".fct-global-search-input-wrap");J&&J.remove()}z.value=!!ie,window.fluentCart=window.fluentCart||{},window.fluentCart.openSearch=Z}),Bt(()=>{window.fluentCart&&delete window.fluentCart.openSearch}),(ie,J)=>{const N=C("el-input"),ae=C("el-dialog");return r(),h(P,null,[z.value?(r(),E(ii,{key:0,to:"#fct_admin_menu_search"},[o("div",qwe,[o("button",{onClick:Z,type:"button",class:"fct-setting-search-button","aria-label":A(u)("Search")},[o("span",Wwe,[n(Y,{name:"Search"})]),J[6]||(J[6]=o("span",{class:"fct-global-search-button-keys"},[o("kbd",{class:"fct-global-search-button-key"},"/")],-1))],8,Ywe)])])):x("",!0),n(ae,{modelValue:t.value,"onUpdate:modelValue":J[5]||(J[5]=oe=>t.value=oe),onOpened:b,onClosed:S,class:"fct-global-search-container","append-to-body":!0},{header:d(()=>[o("div",Jwe,[n(Y,{name:"Search",class:"search-icon"}),V.value!=null?(r(),h("div",Xwe,[R(m(V.value.title)+" ",1),n(Y,{name:"Cross",class:"searched-item-remove",onClick:O})])):x("",!0),n(N,{class:"mousetrap",placeholder:A(u)("Search for %1$s",i.value),autofocus:"",ref_key:"searchRef",ref:s,id:"fct-global-search-input",disabled:H.value,onKeydown:[J[0]||(J[0]=xa(Ge(()=>{var oe,fe;if(Q.value){(oe=W.value)==null||oe.focusList();return}(fe=F.value)==null||fe.focusList()},["prevent"]),["arrow-down"])),J[1]||(J[1]=xa(Ge(()=>{var oe,fe;if(Q.value){(oe=W.value)==null||oe.performFirstAction();return}(fe=F.value)==null||fe.performFirstAction()},["prevent"]),["enter"])),J[2]||(J[2]=xa(()=>{a.value.length===0&&(V.value=null,Q.value=!1)},["backspace"]))],onInput:J[3]||(J[3]=()=>{if(Q.value){L();return}let oe=a.value.includes(","),fe=a.value.includes(":");if(!oe&&!fe)l.value.value=A(ue).search(a.value);else{const re=B(a.value);l.value.value=A(ue).search({$or:re})}}),modelValue:a.value,"onUpdate:modelValue":J[4]||(J[4]=oe=>a.value=oe),clearable:""},null,8,["placeholder","disabled","modelValue"])])]),default:d(()=>[n(ya,{visible:!V.value&&a.value.length===0,accordion:""},{default:d(()=>[o("div",Zwe,[o("div",eCe,m(A(u)("Searching for")),1),o("div",tCe,[(r(!0),h(P,null,te(I.value,oe=>{var fe;return r(),h("div",{key:oe.key,onClick:re=>M(oe),class:de(["fct-global-searching-suggestion",((fe=V.value)==null?void 0:fe.key)===oe.key?"active":""])},m(oe.title),11,aCe)}),128))])])]),_:1},8,["visible"]),Q.value?(r(),E(jwe,{key:0,ref_key:"remoteResultRef",ref:W,query:a.value,tag:V.value,onCloseModal:D,onOnRemoteSearchStateChange:j},null,8,["query","tag"])):(r(),E(cwe,{key:1,ref_key:"resultListRef",ref:F,query:a.value,"search-results":l.value.value,onActionPerformed:D,focusInput:$,searchData:A(Zr)},null,8,["query","search-results","searchData"])),o("div",lCe,[o("ul",sCe,[o("li",null,[o("span",nCe,[n(Y,{name:"ArrowUp"})]),o("span",oCe,[n(Y,{name:"ArrowDown"})]),o("span",iCe,m(A(u)("To navigate")),1)]),o("li",null,[o("span",rCe,[n(Y,{name:"Enter"})]),o("span",dCe,m(A(u)("To select")),1)]),o("li",null,[J[7]||(J[7]=o("kbd",{class:"command-key"},"esc",-1)),o("span",uCe,m(A(u)("To close")),1)])])])]),_:1},8,["modelValue"])],64)}}},ACe={class:"fl_app fluent-cart-admin-pages"},pCe=Object.assign({name:"DashboardApplication"},{__name:"Application",setup(e){const t=T("");Ie(()=>{jQuery(".notice:not(.fluent-cart), .error:not(.fluent-cart), #ehp-admin-cb").remove(),t.value=a(),l.value=!!document.getElementById("theme-button-container");const c=document.querySelector(".fct_admin_menu_wrap"),p=()=>{window.scrollY>10?c==null||c.classList.add("scroll-header"):c==null||c.classList.remove("scroll-header")};window.addEventListener("scroll",p)});const a=()=>window.location.href,l=T(!1),s=nl();be(()=>s.fullPath,()=>{t.value=a()});const i=K(()=>!(s.fullPath.includes("reports")||s.fullPath.includes("settings")));return(c,p)=>{const f=C("router-view");return r(),h("div",null,[n(cCe),i.value?(r(),E(Ia,{key:0})):x("",!0),o("div",ACe,[n(f)]),l.value?(r(),E(ii,{key:1,to:"#theme-button-container"},[n(t0e)])):x("",!0)])}}});let Oc=!1;function fCe(e){return{data:function(){return{appVars:window.fluentCartAdminApp}},methods:{$get:Ae.get,$post:Ae.post,$put:Ae.put,$del:Ae.delete,$t:u,$n:Io,formatMoney(t,a,l=!1){return!t&&l?"":(t||(t="0.00"),ze.get("shop.currency_sign")+" "+t)},formatCents(t,a,l=!1){return!t&&l?"":(t?t=(t*100).toFixed(2):t="0.00",a?(t=new Intl.NumberFormat("en-US").format(t),ze.get("shop.currency_sign")+" "+t):t)},formatNumber(t,a=!0,l=!1,s){return ft.formatNumber(t,a,l,s)},formatNumberForOrder(t,a,l=!0,s=!1){return ft.formatForOrder(t,a,l,s)},getAddress(t,a="billing"){let l=[t[a+"_address_1"],t[a+"_address_2"],t[a+"_city"],t[a+"_city"],t[a+"_state"],t[a+"_zip"],t[a+"_country"]];return l=l.filter(s=>!!s).join(", "),l||"no "+a+" address"},getOrderAddress(t,a="billing",l=!1){return xm(t,a,l)},changeTitle(t){jQuery("head title").text(t+" - FluentCart")},handleError(t){if(!t)return;let a="";typeof t=="string"?a=t:t&&t.message?a=t.message:a=t,typeof t=="object"&&(a=this.convertToText(t)),a||(a="Something is wrong!"),this.$notify({type:"error",title:"Error",message:a,dangerouslyUseHTMLString:!0})},convertToText(t){const a=[];if(typeof t=="object"&&t.join===void 0)for(const l in t)a.push(this.convertToText(t[l]));else if(typeof t=="object"&&t.join!==void 0)for(const l in t)a.push(this.convertToText(t[l]));else typeof t=="function"||typeof t=="string"&&a.push(t);return a.join("<br />")},handleSuccess:t=>{q.success(t)},handleMessage:(t,a="info",l=40,s=1e3)=>{qc.show(t,a,l,s)},Storage:()=>Vt,buildFormRendererValue(t,a){let l={};return Object.keys(t).forEach(s=>{let i=t[s];["grid"].includes(i.type??"")?l[s]=this.buildFormRendererValue(i.schema??{},a[s]??{}):l[s]=a[s]??""}),l},registerCopyAction(){Oc||(Oc=!0,document.addEventListener("click",t=>{t.target.matches(".copyable-content")&&as.copy(t.target.textContent)}))},currencySign(){return ze.get("shop.currency_sign")},getPlaceholderImage(){return gs.getUrl("images/placeholder.svg")},saveLocal(t,a){Vt.set(t,a)},getLocal(t){return Vt.get(t)},hasPermission(t){return Vn.hasPermission(t)}}}}function mCe(e){e.beforeEach((t,a,l)=>{const s=dt.get(t,"meta.permission");return s?Vn.resolve({permission:s,permissionType:dt.get(t,"meta.permissionType")})?l():l({name:"unauthorized"}):(ze.get("app_config.env"),l())})}function hCe(e){const t={fluent_cart_products:["fluent_cart_inventory","fluent_cart_attributes"]},a=l=>{if(!l)return;const s="fluent_cart_"+l;Object.entries(t).forEach(([i,c])=>{const p=s===i;c.forEach(f=>{const _=jQuery(".toplevel_page_fluent-cart li."+f);p?_.show():_.hide()})})};e.afterEach((l,s)=>{const i=l.meta.active_menu;jQuery(".fct_menu li").removeClass("active_admin_menu"),jQuery(".fct_menu li.fct_menu_item_"+i).addClass("active_admin_menu"),jQuery(".toplevel_page_fluent-cart li").removeClass("current"),jQuery(".toplevel_page_fluent-cart li.fluent_cart_"+i).addClass("current"),a(i),l.meta.title&&jQuery("head title").text(l.meta.title+" - FluentCart")})}const _Ce={mounted(e,t){const a=t.value,l=1e3,s=0,i=performance.now(),c=()=>{const p=performance.now()-i,f=Math.min(p/l,1),_=(s+f*(a-s)).toFixed(2);e.textContent=_,f<1&&requestAnimationFrame(c)};c()},updated(e,t){const a=t.value,l=2e3,s=0,i=performance.now(),c=()=>{const p=performance.now()-i,f=Math.min(p/l,1),_=(s+f*(a-s)).toFixed(2);e.textContent=_,f<1&&requestAnimationFrame(c)};c()}},vCe={__name:"Unauthorized",setup(e){return(t,a)=>(r(),h("span",null,m(A(u)("You are not allowed")),1))}},gCe=window.fluent_cart_admin.hooks.applyFilters("fluent_cart_routes",Xbe);let Pc=!1;document.addEventListener("fcart_renew_rest_nonce",function(e){Pc||Fl.alert(u("Your session has expired due to inactivity. Please refresh the page to continue."),u("Session Expired"),{confirmButtonText:u("Reload"),callback:t=>{Pc=!1,window.location.reload()}})});const yCe=[rm,dm,um,Wc,cm,ld,Am,pm,sd,fm,mm,Xc],ql=Zf(pCe);ql.config.globalProperties.appVars=ze.get();ql.provide("appVars",ze.get());ql.mixin(fCe());ql.directive("loading",Um);ql.directive("animate",_Ce);Xm(ql);const Ld=em({routes:[...Object.values(gCe),{path:"/unauthorized",name:"unauthorized",component:vCe,props:!0},{path:"/:path(.*)*",name:"NotFound",component:ci,props:!0}],history:tm(),scrollBehavior(e,t,a){return a||{top:0,behavior:"smooth"}}});ql.use(Ld);mCe(Ld);hCe(Ld);yCe.forEach(e=>{ql.component(e.name,e)});const Rd=ze.get("el_strings"),Hf=ze.get("datei18");Rd.el.datepicker.weeks=Hf.weekdaysShort;Rd.el.datepicker.months=Hf.monthsShort;ql.use(Im,{locale:Rd});ql.mount("#fluent_cart_plugin_app");if(ze.get("has_data_migrations")){let e=0;const t=()=>{Ae.post("data-backfills/run").then(a=>{a&&a.status==="running"&&++e<100&&t()}).catch(()=>{})};t()}export{jn as E,kd as _};
300 +`):s.$t("Subscription settings")}),k=F=>{F==="no"?a.variant.other_info.times="":b(),l("changed")},b=()=>{const F=Number(a.variant.other_info.times);(!Number.isFinite(F)||F<dr)&&(a.variant.other_info.times=dr)},S=F=>{F==="no"&&(a.variant.other_info.signup_fee=""),l("changed")},$=()=>{l("changed")},D=()=>{p.value=!1};return(F,B)=>{const U=C("el-checkbox"),Q=C("el-tooltip"),V=C("el-input"),I=C("el-switch"),M=C("el-button"),O=C("el-popover");return r(),E(Q,{content:w.value,placement:"top",disabled:!_.value||p.value,"popper-class":"fct-tooltip","show-after":400},{default:d(()=>[n(O,{visible:p.value,"onUpdate:visible":B[6]||(B[6]=L=>p.value=L),placement:"bottom",width:320,trigger:"click",disabled:e.disabled||!_.value,"popper-class":"bulk-sub-popover"},{reference:d(()=>[o("button",{class:de(["fc-bulk-sub-icon-btn",{"is-active":_.value,"is-configured":_.value&&(g.value||f.value.manage_setup_fee==="yes")}]),disabled:e.disabled||!_.value,onClick:B[0]||(B[0]=Ge(()=>{},["prevent"]))},[B[7]||(B[7]=o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16"},[o("path",{d:"M6 4H21C21.5523 4 22 4.44772 22 5V12H20V6H6V9L1 5.5L6 2V4ZM18 20H3C2.44772 20 2 19.5523 2 19V12H4V18H18V15L23 18.5L18 22V20Z"})],-1)),g.value?(r(),h("span",Ege,m(y.value),1)):x("",!0)],10,$ge)]),default:d(()=>[o("div",Uge,[o("h4",Ige,m(F.$t("Subscription Settings")),1),o("div",Qge,[o("div",Dge,[n(U,{"true-value":"yes","false-value":"no",label:F.$t("Enable installment payment"),modelValue:e.variant.other_info.installment,"onUpdate:modelValue":B[1]||(B[1]=L=>e.variant.other_info.installment=L),disabled:!A(c)||e.disabled,onChange:k},null,8,["label","modelValue","disabled"]),A(c)?x("",!0):(r(),E(Q,{key:0,"popper-class":"fct-tooltip"},{content:d(()=>[R(m(F.$t("This feature is available in pro version only.")),1)]),default:d(()=>[n(Y,{name:"Crown",class:"fct-pro-icon"})]),_:1}))]),f.value.installment==="yes"?(r(),h(P,{key:0},[o("div",Vge,[o("label",Tge,m(F.$t("Installment Count")),1),n(V,{type:"number",min:dr,size:"small",modelValue:e.variant.other_info.times,"onUpdate:modelValue":B[2]||(B[2]=L=>e.variant.other_info.times=L),modelModifiers:{number:!0},placeholder:F.$t("Count"),style:{width:"100px"},onInput:$,onChange:b},null,8,["modelValue","placeholder"])]),o("div",Mge,[o("span",Lge,m(F.$t("Total Price")),1),o("span",{class:"fct-bulk-sub-value",innerHTML:A(Kt)(v.value,!0)},null,8,Rge)])],64)):x("",!0)]),o("div",Oge,[o("div",Pge,[n(I,{"active-text":F.$t("Setup fee"),modelValue:e.variant.other_info.manage_setup_fee,"onUpdate:modelValue":B[3]||(B[3]=L=>e.variant.other_info.manage_setup_fee=L),"active-value":"yes","inactive-value":"no",disabled:!A(c)||e.disabled,size:"small",onChange:S},null,8,["active-text","modelValue","disabled"]),A(c)?x("",!0):(r(),E(Q,{key:0,"popper-class":"fct-tooltip"},{content:d(()=>[R(m(F.$t("This feature is available in pro version only.")),1)]),default:d(()=>[n(Y,{name:"Crown",class:"fct-pro-icon"})]),_:1}))]),f.value.manage_setup_fee==="yes"?(r(),h(P,{key:0},[o("div",Hge,[o("label",Nge,m(F.$t("Label")),1),n(V,{size:"small",modelValue:e.variant.other_info.signup_fee_name,"onUpdate:modelValue":B[4]||(B[4]=L=>e.variant.other_info.signup_fee_name=L),placeholder:F.$t("e.g. Initial Setup"),onInput:$},null,8,["modelValue","placeholder"])]),o("div",Kge,[o("label",Gge,m(F.$t("Amount")),1),n(Za,{size:"small","model-value":e.variant.other_info.signup_fee,placeholder:F.$t("Amount"),"onUpdate:modelValue":B[5]||(B[5]=L=>{e.variant.other_info.signup_fee=L,$()})},null,8,["model-value","placeholder"])])],64)):x("",!0)]),o("div",zge,[n(M,{size:"small",type:"primary",onClick:D},{default:d(()=>[R(m(F.$t("Done")),1)]),_:1})])])]),_:1},8,["visible","disabled"])]),_:1},8,["content","disabled"])}}},qge={key:0,class:"flex items-center"},Yge={key:1,class:"text-gray-300 text-sm flex justify-center"},Zo={__name:"BulkPaymentTypeCell",props:{variant:{type:Object,default:null},disabled:{type:Boolean,default:!1},hasError:{type:Boolean,default:!1}},emits:["change","payment-type-change"],setup(e,{emit:t}){const a=e,l=t,s=()=>{var i;return(i=a.variant)==null?void 0:i.other_info};return(i,c)=>{const p=C("el-option"),f=C("el-select");return e.variant&&s()?(r(),h("div",qge,[n(f,{modelValue:e.variant.other_info.payment_type,"onUpdate:modelValue":c[0]||(c[0]=_=>e.variant.other_info.payment_type=_),size:"small",class:de({"is-field-error":e.hasError}),disabled:e.disabled,onChange:c[1]||(c[1]=_=>l("payment-type-change",e.variant))},{default:d(()=>[n(p,{label:i.$t("One Time"),value:"onetime"},null,8,["label"]),n(p,{label:i.$t("Subscription"),value:"subscription"},null,8,["label"])]),_:1},8,["modelValue","class","disabled"]),n(jge,{variant:e.variant,disabled:e.disabled,onChanged:c[2]||(c[2]=_=>l("change"))},null,8,["variant","disabled"])])):(r(),h("span",Yge,"—"))}}},Wge={key:1,class:"text-gray-300 text-sm flex justify-center"},ei={__name:"BulkIntervalSelect",props:{variant:{type:Object,default:null},disabled:{type:Boolean,default:!1},hasError:{type:Boolean,default:!1}},emits:["change"],setup(e,{emit:t}){const a=e,l=t,s=()=>{var i,c;return((c=(i=a.variant)==null?void 0:i.other_info)==null?void 0:c.payment_type)==="subscription"};return(i,c)=>{const p=C("el-option"),f=C("el-select");return e.variant&&s()?(r(),E(f,{key:0,modelValue:e.variant.other_info.repeat_interval,"onUpdate:modelValue":c[0]||(c[0]=_=>e.variant.other_info.repeat_interval=_),size:"small",class:de({"is-field-error":e.hasError}),disabled:e.disabled,onChange:c[1]||(c[1]=_=>l("change"))},{default:d(()=>[n(p,{label:i.$t("Yearly"),value:"yearly"},null,8,["label"]),n(p,{label:i.$t("Half Yearly"),value:"half_yearly"},null,8,["label"]),n(p,{label:i.$t("Quarterly"),value:"quarterly"},null,8,["label"]),n(p,{label:i.$t("Monthly"),value:"monthly"},null,8,["label"]),n(p,{label:i.$t("Weekly"),value:"weekly"},null,8,["label"]),n(p,{label:i.$t("Daily"),value:"daily"},null,8,["label"])]),_:1},8,["modelValue","class","disabled"])):(r(),h("span",Wge,"—"))}}},Jge={key:1,class:"text-gray-300 text-sm flex justify-center"},ti={__name:"BulkTrialDaysInput",props:{variant:{type:Object,default:null},disabled:{type:Boolean,default:!1},hasError:{type:Boolean,default:!1}},emits:["change"],setup(e,{emit:t}){const a=e,l=t,s=()=>{var i,c;return((c=(i=a.variant)==null?void 0:i.other_info)==null?void 0:c.payment_type)==="subscription"};return(i,c)=>{const p=C("el-input");return e.variant&&s()?(r(),E(p,{key:0,class:de(["fct-bulk-input",{"is-error":e.hasError}]),modelValue:e.variant.other_info.trial_days,"onUpdate:modelValue":c[0]||(c[0]=f=>e.variant.other_info.trial_days=f),placeholder:"0",disabled:e.disabled,onChange:c[1]||(c[1]=f=>l("change")),size:"small"},null,8,["class","modelValue","disabled"])):(r(),h("span",Jge,"—"))}}},Xge={key:1,class:"text-gray-300 text-sm flex justify-center"},ai={__name:"BulkComparePriceInput",props:{variant:{type:Object,default:null},disabled:{type:Boolean,default:!1},hasError:{type:Boolean,default:!1}},emits:["change"],setup(e,{emit:t}){const a=t;return(l,s)=>e.variant?(r(),E(Za,{key:0,size:"small","error-class":e.hasError?"is-error":"","model-value":e.variant.compare_price,placeholder:l.$t("Compare price"),disabled:e.disabled,"onUpdate:modelValue":s[0]||(s[0]=i=>{e.variant.compare_price=i,a("change")})},null,8,["error-class","model-value","placeholder","disabled"])):(r(),h("span",Xge,"—"))}},xf={__name:"BulkCategorySelect",props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const a=t,l=s=>{a("update:modelValue",s),a("change",s)};return(s,i)=>{const c=C("el-option"),p=C("el-select");return r(),E(p,{"model-value":e.modelValue,multiple:"",filterable:"","allow-create":"","default-first-option":"","collapse-tags":"","collapse-tags-tooltip":!1,"max-collapse-tags":1,size:"small",placeholder:s.$t("Select or type..."),disabled:e.disabled,"onUpdate:modelValue":l},{default:d(()=>[(r(!0),h(P,null,te(e.options,f=>(r(),E(c,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","disabled"])}}},Zge=["textContent"],eye={key:1,class:"fct-bulk-editor-placeholder"},li={__name:"BulkEditorCell",props:{value:{type:String,default:""},placeholder:{type:String,default:""}},emits:["click"],setup(e){return(t,a)=>(r(),h("div",{class:"fct-bulk-editor",onClick:a[0]||(a[0]=l=>t.$emit("click"))},[e.value?(r(),h("span",{key:0,class:"bulk-editor-preview",textContent:m(e.value)},null,8,Zge)):(r(),h("span",eye,m(e.placeholder),1))]))}};function Sf(){const e=T(new Set),t=T(null),a=T(!1),l=(y,v,w)=>{if(v.shiftKey&&t.value!==null){const b=w.indexOf(t.value),S=w.indexOf(y);if(b!==-1&&S!==-1){const $=Math.min(b,S),D=Math.max(b,S),F=new Set(e.value);for(let B=$;B<=D;B++)F.add(w[B]);e.value=F}}else{const b=new Set(e.value);b.has(y)?b.delete(y):b.add(y),e.value=b,t.value=y}},s=y=>{e.value.size===y.length&&y.length>0?e.value=new Set:e.value=new Set(y)},i=y=>{e.value=new Set(y)},c=()=>{e.value=new Set,t.value=null,a.value=!1},p=()=>{a.value?a.value=!1:e.value.size>=2&&(a.value=!0)};be(e,y=>{a.value&&y.size<2&&(a.value=!1)});const f=y=>e.value.has(y),_=K(()=>e.value.size);return{selectedKeys:e,lastClickedKey:t,isLinkMode:a,handleRowClick:l,toggleSelectAll:s,selectAll:i,deselectAll:c,toggleLinkMode:p,isSelected:f,selectedCount:_,pruneStaleKeys:y=>{const v=new Set(y);let w=!1;const k=new Set;for(const b of e.value)v.has(b)?k.add(b):w=!0;w&&(e.value=k),t.value&&!v.has(t.value)&&(t.value=null)}}}const tye={mounted(e,t){e.indeterminate=!!t.value},updated(e,t){e.indeterminate=!!t.value}},Ff={title:{product:{get:e=>e.post_title,set:(e,t)=>e.post_title=t},variant:{get:e=>e.variation_title,set:(e,t)=>e.variation_title=t}},sku:{product:{get:e=>{var t,a;return(a=(t=e.variants)==null?void 0:t[0])==null?void 0:a.sku},set:(e,t)=>{var a;(a=e.variants)!=null&&a[0]&&(e.variants[0].sku=t)}},variant:{get:e=>e.sku,set:(e,t)=>e.sku=t}},status:{product:{get:e=>e.post_status,set:(e,t)=>e.post_status=t}},description:{product:{get:e=>e.post_content,set:(e,t)=>e.post_content=t}},short_desc:{product:{get:e=>e.post_excerpt,set:(e,t)=>e.post_excerpt=t}},product_type:{product:{get:e=>{var t;return(t=e.detail)==null?void 0:t.fulfillment_type},set:(e,t)=>{e.detail&&(e.detail.fulfillment_type=t)}}},pricing_type:{product:{get:e=>{var t;return(t=e.detail)==null?void 0:t.variation_type},set:(e,t)=>{e.detail&&(e.detail.variation_type=t)}}},payment_type:{product:{get:e=>{var t,a,l;return(l=(a=(t=e.variants)==null?void 0:t[0])==null?void 0:a.other_info)==null?void 0:l.payment_type},set:(e,t)=>{var a,l;(l=(a=e.variants)==null?void 0:a[0])!=null&&l.other_info&&(e.variants[0].other_info.payment_type=t)}},variant:{get:e=>{var t;return(t=e.other_info)==null?void 0:t.payment_type},set:(e,t)=>{e.other_info&&(e.other_info.payment_type=t)}}},interval:{product:{get:e=>{var t,a,l;return(l=(a=(t=e.variants)==null?void 0:t[0])==null?void 0:a.other_info)==null?void 0:l.repeat_interval},set:(e,t)=>{var a,l;(l=(a=e.variants)==null?void 0:a[0])!=null&&l.other_info&&(e.variants[0].other_info.repeat_interval=t)}},variant:{get:e=>{var t;return(t=e.other_info)==null?void 0:t.repeat_interval},set:(e,t)=>{e.other_info&&(e.other_info.repeat_interval=t)}}},trial_days:{product:{get:e=>{var t,a,l;return(l=(a=(t=e.variants)==null?void 0:t[0])==null?void 0:a.other_info)==null?void 0:l.trial_days},set:(e,t)=>{var a,l;(l=(a=e.variants)==null?void 0:a[0])!=null&&l.other_info&&(e.variants[0].other_info.trial_days=t)}},variant:{get:e=>{var t;return(t=e.other_info)==null?void 0:t.trial_days},set:(e,t)=>{e.other_info&&(e.other_info.trial_days=t)}}},price:{product:{get:e=>{var t,a;return(a=(t=e.variants)==null?void 0:t[0])==null?void 0:a.item_price},set:(e,t)=>{var a;(a=e.variants)!=null&&a[0]&&(e.variants[0].item_price=t)}},variant:{get:e=>e.item_price,set:(e,t)=>e.item_price=t}},compare_price:{product:{get:e=>{var t,a;return(a=(t=e.variants)==null?void 0:t[0])==null?void 0:a.compare_price},set:(e,t)=>{var a;(a=e.variants)!=null&&a[0]&&(e.variants[0].compare_price=t)}},variant:{get:e=>e.compare_price,set:(e,t)=>e.compare_price=t}},manage_stock:{product:{get:e=>{var t;return(t=e.detail)==null?void 0:t.manage_stock},set:(e,t)=>{e.detail&&(e.detail.manage_stock=t)}}},categories:{product:{get:e=>e.categories,set:(e,t)=>e.categories=[...t]}}},aye={...Ff,stock:{product:{get:e=>{var t;return(t=e.detail)==null?void 0:t.total_stock},set:(e,t)=>{e.detail&&(e.detail.total_stock=t)}},variant:{get:e=>e.total_stock,set:(e,t)=>e.total_stock=t}}},lye={...Ff,stock:{product:{get:e=>{var t,a;return(a=(t=e.variants)==null?void 0:t[0])==null?void 0:a.available},set:(e,t)=>{var a;(a=e.variants)!=null&&a[0]&&(e.variants[0].available=t)}},variant:{get:e=>e.available,set:(e,t)=>e.available=t}}};function $f(e,t,a,l,s,i,c){const p=c[e];if(p)for(const f of l){if(f===a)continue;const _=s(f);if(!_)continue;const g=p[_.type];g&&(g.set(_.data,t),i&&i(_.product))}}const sye={class:"fct-bulk-insert-page fct-layout-width"},nye={class:"fct-btn-group sm justify-end"},oye={class:"filter-popover-item"},iye={class:"filter-popover-title"},rye={key:0,"aria-hidden":"true"},dye=["colspan"],uye=["onClick"],cye=["onClick"],Aye={class:"fct-bulk-product-title-cell sticky-col",style:{left:"40px"}},pye={class:"flex items-center"},fye=["onClick","title"],mye={key:0,class:"bulk-collapse-count"},hye=["title"],_ye=["title"],vye={class:"bulk-status-icon is-error"},gye={key:0,class:"fct-bulk-sku-cell"},yye={key:1,class:"text-gray-300 text-sm flex justify-center"},bye={key:1,class:"fct-bulk-media-cell"},wye={key:2,class:"fct-bulk-categories-cell"},Cye={key:3,class:"fct-bulk-desc-cell"},kye={key:4,class:"fct-bulk-short-desc-cell"},Bye={key:5,class:"fct-bulk-status-cell"},xye={key:6,class:"fct-bulk-product-type-cell"},Sye={key:7,class:"fct-bulk-product-type-cell"},Fye={key:8,class:"fct-bulk-pricing-type-cell"},$ye={key:9,class:"fct-bulk-pricing-type-cell"},Eye={key:10,class:"fct-bulk-payment-type-cell"},Uye={key:11,class:"fct-bulk-interval-cell"},Iye={key:12,class:"fct-bulk-trial-days-cell"},Qye={key:13,class:"fct-bulk-best-price-cell"},Dye={key:14,class:"fct-bulk-compare-price-cell"},Vye={key:15,class:"fct-bulk-qty-cell !pl-5"},Tye={key:16,class:"fct-bulk-stock-cell"},Mye={key:1,class:"text-gray-300 text-sm pl-5"},Lye={class:"fct-btn-group xs justify-end"},Rye=["href","title"],Oye={key:0,class:"bulk-variants-block-row"},Pye=["colspan"],Hye={class:"bulk-inner-table",style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},Nye=["onClick"],Kye={class:"bulk-checkbox-cell"},Gye={class:"fct-bulk-product-title-cell sticky-col",style:{left:"40px"}},zye={class:"flex items-center gap-1 pl-4"},jye={class:"bulk-status-icon is-error"},qye={key:0,class:"fct-bulk-sku-cell"},Yye={key:1,class:"fct-bulk-media-cell"},Wye={key:2},Jye={key:3},Xye={key:4},Zye={key:5},e1e={key:6},t1e={key:7},a1e={key:8},l1e={key:9},s1e={key:10},n1e={key:11},o1e={key:12},i1e={key:13,class:"text-center"},r1e={key:14},d1e={key:1,class:"text-gray-300 text-sm flex justify-center"},u1e={class:"fct-btn-group sm justify-end"},c1e={class:"bulk-add-variant-row"},A1e=["colspan"],p1e={class:"sticky left-0 inline-block pl-6"},f1e={key:1,"aria-hidden":"true"},m1e=["colspan"],ur=43,h1e=10,_1e=800,Uc=100,v1e={__name:"BulkInsert",setup(e){const{options:t,products:a}=Ft.data,l=ge=>{var Fe;return((Fe=ge==null?void 0:ge.detail)==null?void 0:Fe.variation_type)==="simple"},s=K(()=>Ft.data.saving),i=K(()=>Ft.data.saveProgress),c=K(()=>{const ge=Ft.data.saveProgress;return ge.total?Math.round(ge.completed/ge.total*100):0}),p=()=>{Ft.saveProducts()},f=ge=>Ft.isSaving(ge._cid),_=ge=>Ft.isSaved(ge._cid),g=ge=>Ft.isRowDisabled(ge._cid),y=ge=>Ft.hasError(ge._cid),v=ge=>Ft.getError(ge._cid),w=ge=>Ft.hasProductLevelError(ge._cid),k=(ge,Fe)=>Ft.hasVariantError(ge._cid,Fe),b=(ge,Fe)=>Ft.getVariantError(ge._cid,Fe),S=(ge,Fe)=>Ft.hasFieldError(ge._cid,Fe),$=(ge,Fe,ot)=>Ft.hasVariantFieldError(ge._cid,Fe,ot),D=async ge=>{const Fe=ge.post_title||H.$t("Untitled product"),ot=Array.isArray(ge.variants)?ge.variants.length:0,wt=Ft.isSaved(ge._cid);let kt=ot>0?H.$t('This will remove "%1$s" and its %2$s variant(s).',Fe,ot):H.$t('This will remove "%1$s".',Fe);wt&&(kt+=" "+H.$t("This product was already saved and will be permanently deleted."));try{await Fl.confirm(kt,H.$t("Remove Product"),{confirmButtonText:H.$t("Remove"),cancelButtonText:H.$t("Cancel"),type:"warning"})}catch{return}await Ft.removeProduct(ge)},F=(ge,Fe)=>{const ot=Fe.variation_title||H.$t("Untitled variant");Fl.confirm(H.$t('This will remove the variant "%1$s".',ot),H.$t("Remove Variant"),{confirmButtonText:H.$t("Remove"),cancelButtonText:H.$t("Cancel"),confirmButtonClass:"el-button--small",cancelButtonClass:"el-button--small",type:"warning"}).then(()=>{Ft.removeVariant(ge,Fe)}).catch(()=>{})},B=ge=>Ft.duplicateProduct(ge),U=(ge,Fe)=>Ft.duplicateVariant(ge,Fe),Q=()=>{const ge=[];for(const Fe of a){const ot=`p:${Fe._cid}`,wt=ue.value.has(ot),kt=[];Fe.variants&&Fe.variants.forEach((Xt,vt)=>{ue.value.has(`v:${Fe._cid}:${vt}`)&&kt.push(vt)}),!(!wt&&kt.length===0)&&(wt&&kt.length===0?ge.push({product:Fe,type:"full"}):!wt&&kt.length>0?ge.push({product:Fe,type:"variants-only",variantIndexes:kt}):ge.push({product:Fe,type:"partial",variantIndexes:kt}))}return ge},V=()=>{const ge=Q();if(!ge.length)return;const Fe=ge.filter(vt=>vt.type==="full").length,ot=ge.filter(vt=>vt.type==="partial").length,kt=ge.filter(vt=>vt.type==="variants-only").reduce((vt,ea)=>vt+ea.variantIndexes.length,0),Xt=[];Fe>0&&Xt.push(`${Fe} product(s) with all variants`),ot>0&&Xt.push(`${ot} product(s) with selected variants`),kt>0&&Xt.push(`${kt} variant(s)`),Fl.confirm(H.$t("Duplicate %s?").replace("%s",Xt.join(", ")),H.$t("Bulk Duplicate"),{confirmButtonText:H.$t("Duplicate"),cancelButtonText:H.$t("Cancel"),type:"info"}).then(()=>{for(const vt of ge)if(vt.type==="full")Ft.duplicateProduct(vt.product);else if(vt.type==="variants-only")for(const ea of vt.variantIndexes){const ta=vt.product.variants[ea];ta&&Ft.duplicateVariant(vt.product,ta)}else vt.type==="partial"&&Ft.duplicateProductWithVariants(vt.product,vt.variantIndexes);ae()}).catch(()=>{})},I=async()=>{const ge=[],Fe=[];for(const vt of a){const ea=`p:${vt._cid}`;if(ue.value.has(ea)){ge.push(vt);continue}const zt=[];vt.variants&&vt.variants.forEach((wa,qa)=>{ue.value.has(`v:${vt._cid}:${qa}`)&&zt.push(wa)}),zt.length>0&&Fe.push({product:vt,variants:zt})}if(!ge.length&&!Fe.length)return;const ot=ge.filter(vt=>Ft.isSaved(vt._cid)).length,wt=Fe.reduce((vt,ea)=>vt+ea.variants.length,0),kt=[];ge.length>0&&kt.push(`${ge.length} product(s)`),wt>0&&kt.push(`${wt} variant(s)`);let Xt=H.$t("Remove %s?").replace("%s",kt.join(" and "));ot>0&&(Xt+=" "+H.$t("%s already saved will be permanently deleted.").replace("%s",`${ot}`));try{await Fl.confirm(Xt,H.$t("Bulk Remove"),{confirmButtonText:H.$t("Remove"),cancelButtonText:H.$t("Cancel"),type:"warning"})}catch{return}for(const vt of ge)await Ft.removeProduct(vt);for(const{product:vt,variants:ea}of Fe)for(const ta of ea)Ft.removeVariant(vt,ta);ae()},M=ge=>{Ft.resetPaymentTypeDefaults(ge)},O=(ge,Fe)=>{const ot=Ft.data.categoryOptions;for(const wt of Fe)ot.find(kt=>kt.value===wt)||ot.push({label:wt,value:wt})},L=()=>{Ft.populateDummyProduct()},H=Jt().ctx,j=ge=>{const Fe=Ft.data.products;ge.concat||(Fe.splice(0,Fe.length),Ft.data.savedIds=new Set,Ft.data.savingIds=new Set,Ft.data.productErrors=new Map),Fe.push(...ge.products)},W=T({visible:!1,field:"",product:null,value:""}),G=(ge,Fe)=>{W.value={visible:!0,field:Fe,product:ge,value:ge[Fe]||""}},Z=ge=>{W.value.value=ge},ne=()=>{const{product:ge,field:Fe,value:ot}=W.value;ge&&(ge[Fe]=ot),W.value.visible=!1},ce=K(()=>W.value.field==="post_content"?H.$t("Edit Description"):H.$t("Edit Short Description")),z=T(!0),{selectedKeys:ue,handleRowClick:ie,toggleSelectAll:J,selectAll:N,deselectAll:ae,isSelected:oe,selectedCount:fe,isLinkMode:re,toggleLinkMode:Ee}=Sf(),ye=K(()=>{const ge=[];for(const Fe of _t.value)if(ge.push(`p:${Fe.productId}`),Fe.hasVariants&&!Fe.collapsed)for(let ot=0;ot<Fe.product.variants.length;ot++)ge.push(`v:${Fe.productId}:${ot}`);return ge}),Ce=ge=>{var Fe;if(ge.startsWith("p:")){const ot=ge.slice(2),wt=a.find(kt=>kt._cid===ot);return wt?{type:"product",data:wt,product:wt}:null}else if(ge.startsWith("v:")){const ot=ge.split(":"),wt=ot[1],kt=parseInt(ot[2]),Xt=a.find(vt=>vt._cid===wt);if(Xt&&((Fe=Xt.variants)!=null&&Fe[kt]))return{type:"variant",data:Xt.variants[kt],product:Xt}}return null},ve=(ge,Fe,ot)=>{!re.value||!oe(ot)||$f(ge,Fe,ot,ue.value,Ce,null,aye)},Ue=T(!1),Ke=ge=>{ge.key==="Shift"&&(Ue.value=!0)},We=ge=>{ge.key==="Shift"&&(Ue.value=!1)},Be=(ge,Fe)=>{if(!Fe.shiftKey||Fe.target.closest(".bulk-checkbox-cell"))return;Fe.preventDefault();const ot=new Set(ue.value);ot.has(ge)?ot.delete(ge):ot.add(ge),ue.value=ot},$e=T([]),He=K(()=>$e.value.filter(ge=>ge.key==="title"||ge.key==="actions"?!0:Ft.isColumnVisible(ge.key))),Re=ge=>Ft.isColumnVisible(ge),yt=()=>{Ft.saveColumnWidths($e.value)},gt=T(new Set),Rt=ge=>{const Fe=ge._cid;gt.value.has(Fe)?gt.value.delete(Fe):gt.value.add(Fe),gt.value=new Set(gt.value)},Tt=ge=>gt.value.has(ge._cid),Dt=T(0),_t=K(()=>{let ge=0;return a.map(Fe=>{var zt;const ot=Fe._cid,wt=((zt=Fe.detail)==null?void 0:zt.variation_type)!=="simple"&&Array.isArray(Fe.variants),kt=wt?Fe.variants.length:0,Xt=gt.value.has(ot),vt=wt&&!Xt?(kt+1)*ur:0,ea=ur+vt,ta={product:Fe,productId:ot,hasVariants:wt,variantCount:kt,collapsed:Xt,groupHeight:ea,offset:ge};return ge+=ea,ta})}),Gt=K(()=>{const ge=_t.value;if(ge.length===0)return 0;const Fe=ge[ge.length-1];return Fe.offset+Fe.groupHeight}),bt=K(()=>{const ge=_t.value,Fe=Dt.value,ot=Fe+_1e,wt=h1e*ur;return ge.filter(kt=>kt.offset+kt.groupHeight>=Fe-wt&&kt.offset<=ot+wt)}),St=K(()=>bt.value.length===0?0:bt.value[0].offset),Pt=K(()=>{if(bt.value.length===0)return 0;const ge=bt.value[bt.value.length-1];return Gt.value-ge.offset-ge.groupHeight});let Ht=null,Qt=0;const ht=ge=>{const Fe=ge.target,ot=Date.now();Ht&&clearTimeout(Ht),ot-Qt>=Uc?(Dt.value=Fe.scrollTop,Qt=ot):Ht=setTimeout(()=>{Dt.value=Fe.scrollTop,Qt=Date.now(),Ht=null},Uc)};let qt=null;return Ie(async()=>{qt=bs(),qt.bind("mod+a",ge=>{var ot,wt;const Fe=(ot=document.activeElement)==null?void 0:ot.tagName;Fe==="INPUT"||Fe==="TEXTAREA"||(wt=document.activeElement)!=null&&wt.isContentEditable||(ge.preventDefault(),N(ye.value))}),qt.bind("escape",()=>{var Fe,ot;const ge=(Fe=document.activeElement)==null?void 0:Fe.tagName;ge==="INPUT"||ge==="TEXTAREA"||(ot=document.activeElement)!=null&&ot.isContentEditable||(re.value?Ee():ae())}),$e.value=[{key:"title",title:H.$t("Title"),width:150,minWidth:100},{key:"sku",title:H.$t("SKU"),width:120,minWidth:80},{key:"media",title:H.$t("Media"),width:100,minWidth:50},{key:"categories",title:H.$t("Categories"),width:200,minWidth:150},{key:"description",title:H.$t("Description"),width:200,minWidth:150},{key:"short_description",title:H.$t("Short Description"),width:150,minWidth:100},{key:"status",title:H.$t("Status"),width:100,minWidth:50},{key:"product_type",title:H.$t("Product Type"),width:200,minWidth:150},{key:"pricing_type",title:H.$t("Pricing Type"),width:200,minWidth:150},{key:"payment_type",title:H.$t("Payment Type"),width:120,minWidth:100},{key:"interval",title:H.$t("Interval"),width:120,minWidth:80},{key:"trial_days",title:H.$t("Trial Days"),width:100,minWidth:70},{key:"best_price",title:H.$t("Best Price"),width:100,minWidth:100},{key:"compare_price",title:H.$t("Compare-at Price"),width:200,minWidth:150},{key:"track_quantity",title:H.$t("Track Quantity"),width:100,minWidth:100},{key:"stock",title:H.$t("Stock"),width:150,minWidth:150},{key:"actions",title:"",width:110,minWidth:110}],Ft.restoreColumnWidths($e.value),Ft.setupColumnVisibility(),Ft.fetchCategories(),document.body.classList.add("fct-bulk-page"),window.addEventListener("keydown",Ke),window.addEventListener("keyup",We)}),cl(()=>{document.body.classList.remove("fct-bulk-page"),window.removeEventListener("keydown",Ke),window.removeEventListener("keyup",We),qt&&qt.reset()}),(ge,Fe)=>{const ot=C("el-button"),wt=C("el-progress"),kt=C("el-checkbox"),Xt=C("el-checkbox-group"),vt=C("el-tooltip"),ea=C("el-popover"),ta=C("el-input"),zt=C("el-icon"),wa=C("el-option"),qa=C("el-select"),il=C("el-switch"),Ya=C("el-dialog");return r(),h("div",sye,[n(ol,{title:ge.$t("Bulk Insert")},{action:d(()=>[n(bge,{onOnDataPopulated:j}),n(ot,{onClick:L},{default:d(()=>[R(m(ge.$t("Add Product")),1)]),_:1}),n(ot,{type:"primary",onClick:p,loading:s.value,disabled:s.value||A(a).length===0},{default:d(()=>[R(m(s.value?ge.$t("Saving %s/%s...").replace("%s",i.value.completed).replace("%s",i.value.total):ge.$t("Save All Products")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["title"]),s.value?(r(),E(wt,{key:0,percentage:c.value,"stroke-width":6,class:"mb-4"},null,8,["percentage"])):x("",!0),n(Se,null,{default:d(()=>{var ma;return[A(a).length>0?(r(),E(Ve,{key:0,title:((ma=A(a))==null?void 0:ma.length)===1?ge.$t("Product"):ge.$t("Products"),border_bottom:""},{action:d(()=>[o("div",nye,[n(ot,{disabled:A(fe)===0,onClick:I,size:"small",type:"danger",soft:""},{default:d(()=>[Fe[8]||(Fe[8]=o("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o("polyline",{points:"3 6 5 6 21 6"}),o("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)),R(" "+m(ge.$t("Delete")),1)]),_:1,__:[8]},8,["disabled"]),n(ot,{disabled:A(fe)===0,onClick:V,size:"small",type:"info",soft:""},{default:d(()=>[Fe[9]||(Fe[9]=o("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),o("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})],-1)),R(" "+m(ge.$t("Duplicate")),1)]),_:1,__:[9]},8,["disabled"]),n(ot,{class:de({"is-active":A(re)}),disabled:A(fe)<2&&!A(re),onClick:A(Ee),size:"small",type:"info",soft:""},{default:d(()=>[Fe[10]||(Fe[10]=o("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),o("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})],-1)),R(" "+m(A(re)?ge.$t("Unlink"):ge.$t("Link")),1)]),_:1,__:[10]},8,["class","disabled","onClick"]),n(kt,{modelValue:z.value,"onUpdate:modelValue":Fe[0]||(Fe[0]=X=>z.value=X),label:ge.$t("Pin Actions")},null,8,["modelValue","label"]),n(ea,{trigger:"click",placement:"bottom-end",width:"240","popper-class":"filter-popover"},{reference:d(()=>[o("span",null,[n(vt,{effect:"light",content:ge.$t("Toggle columns"),placement:"top","popper-class":"fct-tooltip"},{default:d(()=>[n(at,{tag:"button",size:"small"},{default:d(()=>[n(Y,{name:"ColumnIcon"})]),_:1})]),_:1},8,["content"])])]),default:d(()=>[o("div",oye,[o("h3",iye,m(ge.$t("Columns")),1),n(Xt,{modelValue:A(Ft).data.visibleColumns,"onUpdate:modelValue":Fe[1]||(Fe[1]=X=>A(Ft).data.visibleColumns=X),class:"fct-checkbox-blocks",onChange:Fe[2]||(Fe[2]=X=>A(Ft).handleColumnVisibilityChange())},{default:d(()=>[(r(!0),h(P,null,te(A(Ft).getToggleableColumns(),X=>(r(),E(kt,{key:X.value,value:X.value,label:ge.$t(X.label)},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])])]),_:1})])]),_:1},8,["title"])):x("",!0),n(ke,{class:"p-0"},{default:d(()=>[A(a).length>0?(r(),h("div",{key:0,class:de(["relative",{"is-link-mode":A(re),"is-shift-held":Ue.value}])},[n(Bf,{columns:He.value,"sticky-last":z.value,onScroll:ht,onResizeEnd:yt},{"header-first":d(()=>[n(kt,{"model-value":A(fe)>0&&A(fe)===ye.value.length,indeterminate:A(fe)>0&&A(fe)<ye.value.length,onChange:Fe[3]||(Fe[3]=X=>A(J)(ye.value))},null,8,["model-value","indeterminate"])]),"header-last":d(()=>[R(m(ge.$t("Actions")),1)]),default:d(()=>[St.value>0?(r(),h("tr",rye,[o("td",{colspan:He.value.length+1,style:ra({height:St.value+"px",padding:0,border:"none"})},null,12,dye)])):x("",!0),(r(!0),h(P,null,te(bt.value,X=>{var we,le,he,Ye,st,je,Xe,mt,et,It,pe,_e,Oe,Me,ct;return r(),h(P,{key:X.productId},[o("tr",{class:de(["bulk-product-row",{"is-saving":f(X.product),"is-saved":_(X.product),"has-product-error":y(X.product),"is-selected":A(oe)(`p:${X.productId}`)}]),onClick:ee=>Be(`p:${X.productId}`,ee)},[o("td",{class:"bulk-checkbox-cell",onClick:ee=>A(ie)(`p:${X.productId}`,ee,ye.value)},[n(kt,{"model-value":A(oe)(`p:${X.productId}`),tabindex:"-1"},null,8,["model-value"])],8,cye),o("td",Aye,[o("div",pye,[X.hasVariants?(r(),h("button",{key:0,class:"bulk-collapse-btn",onClick:Ge(ee=>Rt(X.product),["prevent"]),title:Tt(X.product)?ge.$t("Expand variants"):ge.$t("Collapse variants")},[(r(),h("svg",{class:de(["bulk-collapse-icon",{"is-collapsed":Tt(X.product)}]),width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},Fe[11]||(Fe[11]=[o("path",{d:"M6 4L10 8L6 12",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2)),Tt(X.product)?(r(),h("span",mye,m(X.variantCount),1)):x("",!0)],8,fye)):x("",!0),n(ta,{class:de(["fct-bulk-input",{"is-error":S(X.product,"post_title")}]),modelValue:X.product.post_title,"onUpdate:modelValue":ee=>X.product.post_title=ee,placeholder:ge.$t("Product title"),size:"small",disabled:g(X.product),onInput:ee=>ve("title",ee,`p:${X.productId}`)},null,8,["class","modelValue","onUpdate:modelValue","placeholder","disabled","onInput"]),f(X.product)?(r(),h("span",{key:1,class:"bulk-status-icon is-syncing",title:ge.$t("Saving...")},[n(zt,{class:"is-loading",size:14},{default:d(()=>[n(A(en))]),_:1})],8,hye)):_(X.product)?(r(),h("span",{key:2,class:"bulk-status-icon is-saved",title:ge.$t("Saved")},Fe[12]||(Fe[12]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16"},[o("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-.997-6l7.07-7.071-1.414-1.414-5.656 5.657-2.829-2.829-1.414 1.414L11.003 16z"})],-1)]),8,_ye)):w(X.product)||l(X.product)&&y(X.product)?(r(),E(vt,{key:3,content:v(X.product),placement:"top"},{default:d(()=>[o("span",vye,[n(zt,{size:16},{default:d(()=>[n(A(Vo))]),_:1})])]),_:2},1032,["content"])):x("",!0)])]),Re("sku")?(r(),h("td",gye,[((le=(we=X.product)==null?void 0:we.detail)==null?void 0:le.variation_type)==="simple"&&((he=X.product.variants)!=null&&he[0])?(r(),E(ta,{key:0,class:de(["fct-bulk-input",{"is-error":S(X.product,"variants.0.sku")}]),modelValue:X.product.variants[0].sku,"onUpdate:modelValue":[ee=>X.product.variants[0].sku=ee,ee=>ve("sku",ee,`p:${X.productId}`)],placeholder:"SKU",size:"small",disabled:g(X.product)},null,8,["class","modelValue","onUpdate:modelValue","disabled"])):(r(),h("span",yye,"—"))])):x("",!0),Re("media")?(r(),h("td",bye,[n(yl,{modelValue:X.product.gallery,"onUpdate:modelValue":ee=>X.product.gallery=ee,"show-url-tab":"",disabled:g(X.product)},null,8,["modelValue","onUpdate:modelValue","disabled"])])):x("",!0),Re("categories")?(r(),h("td",wye,[n(xf,{modelValue:X.product.categories,"onUpdate:modelValue":ee=>X.product.categories=ee,options:A(Ft).data.categoryOptions,disabled:g(X.product),onChange:ee=>{O(X.product,ee),ve("categories",X.product.categories,`p:${X.productId}`)}},null,8,["modelValue","onUpdate:modelValue","options","disabled","onChange"])])):x("",!0),Re("description")?(r(),h("td",Cye,[n(li,{value:X.product.post_content,placeholder:ge.$t("Description"),onClick:ee=>G(X.product,"post_content")},null,8,["value","placeholder","onClick"])])):x("",!0),Re("short_description")?(r(),h("td",kye,[n(li,{value:X.product.post_excerpt,placeholder:ge.$t("Short description"),onClick:ee=>G(X.product,"post_excerpt")},null,8,["value","placeholder","onClick"])])):x("",!0),Re("status")?(r(),h("td",Bye,[n(qa,{modelValue:X.product.post_status,"onUpdate:modelValue":ee=>X.product.post_status=ee,size:"small",class:de({"is-field-error":S(X.product,"post_status")}),disabled:g(X.product),onChange:ee=>ve("status",X.product.post_status,`p:${X.productId}`)},{default:d(()=>[(r(!0),h(P,null,te(A(t).status,ee=>(r(),E(wa,{key:ee.value,label:ge.$t(ee.title),value:ee.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled","onChange"])])):x("",!0),Re("product_type")&&((Ye=X.product)!=null&&Ye.detail)?(r(),h("td",xye,[n(qa,{modelValue:X.product.detail.fulfillment_type,"onUpdate:modelValue":ee=>X.product.detail.fulfillment_type=ee,size:"small",class:de({"is-field-error":S(X.product,"detail.fulfillment_type")}),disabled:g(X.product),onChange:ee=>ve("product_type",X.product.detail.fulfillment_type,`p:${X.productId}`)},{default:d(()=>[(r(!0),h(P,null,te(A(t).fulfilment,ee=>(r(),E(wa,{key:ee.value,label:ge.$t(ee.title),value:ee.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled","onChange"])])):Re("product_type")?(r(),h("td",Sye)):x("",!0),Re("pricing_type")&&((st=X.product)!=null&&st.detail)?(r(),h("td",Fye,[n(qa,{modelValue:X.product.detail.variation_type,"onUpdate:modelValue":ee=>X.product.detail.variation_type=ee,size:"small",class:de({"is-field-error":S(X.product,"detail.variation_type")}),disabled:g(X.product),onChange:ee=>{A(Ft).handleVariationChanged(X.product,ee),ve("pricing_type",ee,`p:${X.productId}`)}},{default:d(()=>[(r(!0),h(P,null,te(A(t).variation,ee=>(r(),E(wa,{key:ee.value,label:ge.$t(ee.title),value:ee.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled","onChange"])])):Re("pricing_type")?(r(),h("td",$ye)):x("",!0),Re("payment_type")?(r(),h("td",Eye,[n(Zo,{variant:l(X.product)?(je=X.product.variants)==null?void 0:je[0]:null,disabled:g(X.product),"has-error":S(X.product,"variants.0.other_info.payment_type"),onPaymentTypeChange:ee=>{var Ne;M(ee),ve("payment_type",(Ne=ee.other_info)==null?void 0:Ne.payment_type,`p:${X.productId}`)}},null,8,["variant","disabled","has-error","onPaymentTypeChange"])])):x("",!0),Re("interval")?(r(),h("td",Uye,[n(ei,{variant:l(X.product)?(Xe=X.product.variants)==null?void 0:Xe[0]:null,disabled:g(X.product),"has-error":S(X.product,"variants.0.other_info.repeat_interval"),onChange:ee=>{var Ne,pt,De;return ve("interval",(De=(pt=(Ne=X.product.variants)==null?void 0:Ne[0])==null?void 0:pt.other_info)==null?void 0:De.repeat_interval,`p:${X.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("trial_days")?(r(),h("td",Iye,[n(ti,{variant:l(X.product)?(mt=X.product.variants)==null?void 0:mt[0]:null,disabled:g(X.product),"has-error":S(X.product,"variants.0.other_info.trial_days"),onChange:ee=>{var Ne,pt,De;return ve("trial_days",(De=(pt=(Ne=X.product.variants)==null?void 0:Ne[0])==null?void 0:pt.other_info)==null?void 0:De.trial_days,`p:${X.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("best_price")?(r(),h("td",Qye,[n(Xo,{variant:l(X.product)?(et=X.product.variants)==null?void 0:et[0]:null,disabled:g(X.product),"has-error":S(X.product,"variants.0.item_price"),onChange:ee=>{var Ne,pt;return ve("price",(pt=(Ne=X.product.variants)==null?void 0:Ne[0])==null?void 0:pt.item_price,`p:${X.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("compare_price")?(r(),h("td",Dye,[n(ai,{variant:l(X.product)?(It=X.product.variants)==null?void 0:It[0]:null,disabled:g(X.product),"has-error":S(X.product,"variants.0.compare_price"),onChange:ee=>{var Ne,pt;return ve("compare_price",(pt=(Ne=X.product.variants)==null?void 0:Ne[0])==null?void 0:pt.compare_price,`p:${X.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("track_quantity")?(r(),h("td",Vye,[(pe=X.product)!=null&&pe.detail?(r(),E(il,{key:0,modelValue:X.product.detail.manage_stock,"onUpdate:modelValue":ee=>X.product.detail.manage_stock=ee,"active-value":"1","inactive-value":"0",disabled:g(X.product),onChange:ee=>{A(Ft).syncStockStatus(X.product),ve("manage_stock",X.product.detail.manage_stock,`p:${X.productId}`)}},null,8,["modelValue","onUpdate:modelValue","disabled","onChange"])):x("",!0)])):x("",!0),Re("stock")?(r(),h("td",Tye,[((Oe=(_e=X.product)==null?void 0:_e.detail)==null?void 0:Oe.manage_stock)==="1"&&((ct=(Me=X.product)==null?void 0:Me.detail)==null?void 0:ct.variation_type)==="simple"?(r(),E(ta,{key:0,modelValue:X.product.detail.total_stock,"onUpdate:modelValue":[ee=>X.product.detail.total_stock=ee,ee=>{var Ne;(Ne=X.product.variants)!=null&&Ne[0]&&(X.product.variants[0].total_stock=ee,X.product.variants[0].available=ee),A(Ft).syncStockStatus(X.product),ve("stock",ee,`p:${X.productId}`)}],disabled:g(X.product),size:"small",placeholder:ge.$t("e.g 10")},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):(r(),h("span",Mye,"—"))])):x("",!0),o("td",{class:de(["fct-bulk-actions-cell",{"sticky-col sticky-col-right":z.value}])},[o("div",Lye,[_(X.product)&&X.product.view_url?(r(),h("a",{key:0,href:X.product.view_url,target:"_blank",class:"bulk-action-btn bulk-view-link",title:ge.$t("View Product")},[n(Y,{name:"External"})],8,Rye)):x("",!0),n(at,{tag:"button",size:"x-small",onClick:Ge(ee=>B(X.product),["prevent"]),disabled:s.value||g(X.product),title:ge.$t("Duplicate")},{default:d(()=>[n(Y,{name:"Copy"})]),_:2},1032,["onClick","disabled","title"]),n(at,{tag:"button",size:"x-small",hover:"danger",onClick:Ge(ee=>D(X.product),["prevent"]),disabled:s.value||g(X.product),title:ge.$t("Delete")},{default:d(()=>[n(Y,{name:"Delete"})]),_:2},1032,["onClick","disabled","title"])])],2)],10,uye),X.hasVariants?(r(),h("tr",Oye,[o("td",{colspan:He.value.length+1,class:"!p-0 !border-b-0"},[n(ya,{accordion:"",visible:!X.collapsed,duration:200},{default:d(()=>[o("table",Hye,[o("colgroup",null,[Fe[13]||(Fe[13]=o("col",{style:{width:"40px"}},null,-1)),(r(!0),h(P,null,te(He.value,(ee,Ne)=>(r(),h("col",{key:Ne,style:ra({width:ee.width+"px"})},null,4))),128))]),o("tbody",null,[(r(!0),h(P,null,te(X.product.variants,(ee,Ne)=>{var pt,De;return r(),h("tr",{key:Ne,class:de(["bulk-variation-row",{"is-selected":A(oe)(`v:${X.productId}:${Ne}`)}]),onClick:xt=>Be(`v:${X.productId}:${Ne}`,xt)},[o("td",Kye,[n(kt,{"model-value":A(oe)(`v:${X.productId}:${Ne}`),tabindex:"-1",onChange:xt=>A(ie)(`v:${X.productId}:${Ne}`,xt,ye.value)},null,8,["model-value","onChange"])]),o("td",Gye,[o("div",zye,[Fe[14]||(Fe[14]=o("span",{class:"text-gray-300 text-xs"},"└",-1)),n(ta,{size:"small",modelValue:ee.variation_title,"onUpdate:modelValue":[xt=>ee.variation_title=xt,xt=>ve("title",xt,`v:${X.productId}:${Ne}`)],placeholder:ge.$t("Variation title"),disabled:g(X.product),class:de({"is-error":$(X.product,Ne,"variation_title")})},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","class"]),k(X.product,Ne)?(r(),E(vt,{key:0,content:b(X.product,Ne),placement:"top"},{default:d(()=>[o("span",jye,[n(zt,{size:14},{default:d(()=>[n(A(Vo))]),_:1})])]),_:2},1032,["content"])):x("",!0)])]),Re("sku")?(r(),h("td",qye,[n(ta,{size:"small",modelValue:ee.sku,"onUpdate:modelValue":[xt=>ee.sku=xt,xt=>ve("sku",xt,`v:${X.productId}:${Ne}`)],placeholder:"SKU",disabled:g(X.product),class:de({"is-error":$(X.product,Ne,"sku")})},null,8,["modelValue","onUpdate:modelValue","disabled","class"])])):x("",!0),Re("media")?(r(),h("td",Yye,[n(yl,{modelValue:ee.media,"onUpdate:modelValue":xt=>ee.media=xt,"show-url-tab":"",disabled:g(X.product)},null,8,["modelValue","onUpdate:modelValue","disabled"])])):x("",!0),Re("categories")?(r(),h("td",Wye,Fe[15]||(Fe[15]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),Re("description")?(r(),h("td",Jye,Fe[16]||(Fe[16]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),Re("short_description")?(r(),h("td",Xye,Fe[17]||(Fe[17]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),Re("status")?(r(),h("td",Zye,Fe[18]||(Fe[18]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),Re("product_type")?(r(),h("td",e1e,Fe[19]||(Fe[19]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),Re("pricing_type")?(r(),h("td",t1e,Fe[20]||(Fe[20]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),Re("payment_type")?(r(),h("td",a1e,[n(Zo,{variant:ee,disabled:g(X.product),"has-error":$(X.product,Ne,"other_info.payment_type"),onPaymentTypeChange:xt=>{var Wa;M(xt),ve("payment_type",(Wa=xt.other_info)==null?void 0:Wa.payment_type,`v:${X.productId}:${Ne}`)}},null,8,["variant","disabled","has-error","onPaymentTypeChange"])])):x("",!0),Re("interval")?(r(),h("td",l1e,[n(ei,{variant:ee,disabled:g(X.product),"has-error":$(X.product,Ne,"other_info.repeat_interval"),onChange:xt=>{var Wa;return ve("interval",(Wa=ee.other_info)==null?void 0:Wa.repeat_interval,`v:${X.productId}:${Ne}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("trial_days")?(r(),h("td",s1e,[n(ti,{variant:ee,disabled:g(X.product),"has-error":$(X.product,Ne,"other_info.trial_days"),onChange:xt=>{var Wa;return ve("trial_days",(Wa=ee.other_info)==null?void 0:Wa.trial_days,`v:${X.productId}:${Ne}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("best_price")?(r(),h("td",n1e,[n(Xo,{variant:ee,disabled:g(X.product),"has-error":$(X.product,Ne,"item_price"),onChange:xt=>ve("price",ee.item_price,`v:${X.productId}:${Ne}`)},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("compare_price")?(r(),h("td",o1e,[n(ai,{variant:ee,disabled:g(X.product),"has-error":$(X.product,Ne,"compare_price"),onChange:xt=>ve("compare_price",ee.compare_price,`v:${X.productId}:${Ne}`)},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),Re("track_quantity")?(r(),h("td",i1e,Fe[21]||(Fe[21]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),Re("stock")?(r(),h("td",r1e,[((De=(pt=X.product)==null?void 0:pt.detail)==null?void 0:De.manage_stock)==="1"?(r(),E(ta,{key:0,class:"fc-bulk-input",size:"small",modelValue:ee.total_stock,"onUpdate:modelValue":[xt=>ee.total_stock=xt,xt=>{ee.available=xt,A(Ft).syncStockStatus(X.product),ve("stock",xt,`v:${X.productId}:${Ne}`)}],disabled:g(X.product),placeholder:ge.$t("e.g 10")},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):(r(),h("span",d1e,"—"))])):x("",!0),o("td",{class:de(["fct-bulk-actions-cell",{"sticky-col sticky-col-right":z.value}])},[o("div",u1e,[n(at,{tag:"button",size:"x-small",onClick:Ge(xt=>U(X.product,ee),["prevent"]),disabled:s.value||g(X.product),title:ge.$t("Duplicate")},{default:d(()=>[n(Y,{name:"Copy"})]),_:2},1032,["onClick","disabled","title"]),n(at,{tag:"button",size:"x-small",hover:"danger",onClick:Ge(xt=>F(X.product,ee),["prevent"]),disabled:s.value||g(X.product),title:ge.$t("Delete")},{default:d(()=>[n(Y,{name:"Delete"})]),_:2},1032,["onClick","disabled","title"])])],2)],10,Nye)}),128)),o("tr",c1e,[o("td",{colspan:He.value.length+1},[o("div",p1e,[n(ot,{size:"small",text:"",type:"primary",onClick:Ge(ee=>A(Ft).addVariationToProduct(X.product),["prevent"])},{default:d(()=>[R(" + "+m(ge.$t("Add Variant")),1)]),_:2},1032,["onClick"])])],8,A1e)])])])]),_:2},1032,["visible"])],8,Pye)])):x("",!0)],64)}),128)),Pt.value>0?(r(),h("tr",f1e,[o("td",{colspan:He.value.length+1,style:ra({height:Pt.value+"px",padding:0,border:"none"})},null,12,m1e)])):x("",!0)]),_:1},8,["columns","sticky-last"])],2)):(r(),E(Ct,{key:1,icon:"Empty/ListView","has-dark":!0,text:A(u)("No products yet. Import a CSV or add products manually.")},null,8,["text"]))]),_:1})]}),_:1}),n(Ya,{modelValue:W.value.visible,"onUpdate:modelValue":Fe[6]||(Fe[6]=ma=>W.value.visible=ma),title:ce.value,width:"700px","close-on-click-modal":!1,onClosed:Fe[7]||(Fe[7]=ma=>W.value.product=null)},{footer:d(()=>[n(ot,{onClick:Fe[5]||(Fe[5]=ma=>W.value.visible=!1)},{default:d(()=>[R(m(ge.$t("Cancel")),1)]),_:1}),n(ot,{type:"primary",onClick:ne},{default:d(()=>[R(m(ge.$t("Save")),1)]),_:1})]),default:d(()=>[W.value.visible&&W.value.field==="post_content"?(r(),E(ls,{key:0,"model-value":W.value.value,height:300,onUpdate:Z},null,8,["model-value"])):x("",!0),W.value.visible&&W.value.field==="post_excerpt"?(r(),E(ta,{key:1,modelValue:W.value.value,"onUpdate:modelValue":Fe[4]||(Fe[4]=ma=>W.value.value=ma),type:"textarea",rows:6,placeholder:ge.$t("Short description")},null,8,["modelValue","placeholder"])):x("",!0)]),_:1},8,["modelValue","title"])])}}};class g1e extends Dd{beforeInit(){this.data.products=[],this.data.dirty=new Set,this.data.loading=!1,this.data.saving=!1,this.data.pagination={page:1,per_page:5,total:0,hasMore:!1},this.data.saveProgress={total:0,completed:0,errors:[],updatedIds:[]},this.data.savingIds=new Set,this.data.savedIds=new Set,this.data.productErrors=new Map,this.data.advanceFilters=[[]],this.data.filterType="simple",this.data.selectedView="all",this.data.searching=!1,this.data.search="",this.data.duplicatingIds=new Set,this.data.deletingIds=new Set,this.data.categoryOptions=[],this.data.constrainedProductIds="",this.data.constrainedVariantIds="",this.data.savedViews=[],this.data.activeSavedViewId=null,this.data.savedViewQueryParams=null}getTabs(){return{all:u("All"),publish:u("Published"),draft:u("Draft"),physical:u("Physical"),digital:u("Digital")}}getTabsCount(){return Object.values(this.getTabs()).length}getSelectedTab(){return this.data.selectedView}handleTabChanged(t){t!==this.data.selectedView&&(this.data.selectedView=t,this.fetchProducts({},!1))}isSearching(){return this.data.searching!==!1}openSearch(){this.data.searching=!0}closeSearch(){this.data.searching=!1,this.data.search="",this.fetchProducts({},!1)}search(){this.fetchProducts({},!1)}useFullWidthSearch(){return!1}getSearchHint(){return u("Search by Id, product title or variation title")}getSearchGuideOptions(){return null}isUsingAdvanceFilter(){return this.data.filterType==="advanced"}isUsingSimpleFilter(){return this.data.filterType==="simple"}isAdvanceFilterEnabled(){return this.getAdvanceFilterOptions()!==null}getAdvanceFilterOptions(){var t,a,l;return((l=(a=(t=window.fluentCartAdminApp)==null?void 0:t.filter_options)==null?void 0:a.product_filter_options)==null?void 0:l.advance)||null}onFilterTypeChanged(t){t==="advanced"?(this.data.searching=!1,this.data.search=""):this.data.advanceFilters=[[]],this.fetchProducts({},!1)}applyAdvancedFilter(t=!1){this.fetchProducts({},!1)}addAdvanceFilterGroup(){this.data.advanceFilters.push([])}removeAdvanceFilterGroup(t){this.data.advanceFilters.length>1&&this.data.advanceFilters.splice(t,1)}clearAdvanceFilter(){this.data.advanceFilters=[[]],this.fetchProducts({},!1)}getColumnWidthStorageKey(){return"bulk_edit_column_widths"}getColumnStorageKey(){return"bulk_edit_columns"}getToggleableColumns(){return[{label:"Image",value:"image"},{label:"SKU",value:"sku"},{label:"Categories",value:"categories"},{label:"Description",value:"description"},{label:"Short Description",value:"short_description"},{label:"Status",value:"status"},{label:"Product Type",value:"product_type"},{label:"Pricing Type",value:"pricing_type"},{label:"Payment Type",value:"payment_type"},{label:"Interval",value:"interval"},{label:"Trial Days",value:"trial_days"},{label:"Best Price",value:"best_price"},{label:"Compare-at Price",value:"compare_price"},{label:"Track Quantity",value:"track_quantity"},{label:"Stock",value:"stock"}]}getSortableColumns(){return[]}markDirty(t){this._suppressDirty||(this.data.dirty.add(t),this.data.dirty=new Set(this.data.dirty),this.data.savedIds.has(t)&&(this.data.savedIds.delete(t),this.data.savedIds=new Set(this.data.savedIds)),this.data.productErrors.has(t)&&(this.data.productErrors.delete(t),this.data.productErrors=new Map(this.data.productErrors)))}get dirtyCount(){return this.data.dirty.size}getDirtyProducts(){return this.data.products.filter(t=>this.data.dirty.has(t.ID))}chunkArray(t,a){const l=[];for(let s=0;s<t.length;s+=a)l.push(t.slice(s,s+a));return l}async fetchProducts(t={},a=!1,l="",s=""){var i;this.data.loading=!0;try{l&&(this.data.constrainedProductIds=l,this.data.constrainedVariantIds=s);const c=l||this.data.constrainedProductIds,p=s||this.data.constrainedVariantIds,f={per_page:this.data.pagination.per_page,page:a?this.data.pagination.page+1:1};c&&(f.product_ids=c,f.variant_ids=p),this.data.filterType==="advanced"?(f.advanced_filters=JSON.stringify(this.data.advanceFilters),f.filter_type="advanced"):(this.data.search&&(f.search=this.data.search),this.data.selectedView&&this.data.selectedView!=="all"&&(f.active_view=this.data.selectedView)),Object.assign(f,t);const _=await Ae.get("products/bulk-edit-data",f),g=_.products||[];this._suppressDirty=!0,a?this.data.products.push(...g):(this.data.products=g,this.data.dirty=new Set,this.data.savedIds=new Set,this.data.productErrors=new Map),xe(()=>{this._suppressDirty=!1}),this.data.pagination={page:_.page||f.page,per_page:_.per_page||f.per_page,total:_.total||0,hasMore:_.page*_.per_page<_.total}}catch(c){const p=((i=c==null?void 0:c.data)==null?void 0:i.message)||"Failed to fetch products";q.error(p)}finally{this.data.loading=!1}}isSavingProduct(t){return this.data.savingIds.has(t)}isDirty(t){return this.data.dirty.has(t)}isSaved(t){return this.data.savedIds.has(t)}isRowDisabled(t){return this.isSavingProduct(t)}isDuplicating(t){return this.data.duplicatingIds.has(t)}isDeleting(t){return this.data.deletingIds.has(t)}hasError(t){return this.data.productErrors.has(t)}getError(t){const a=this.data.productErrors.get(t);return a?a.fields&&Object.keys(a.fields).length?Object.values(a.fields).join("; "):a.message||"":""}hasProductLevelError(t){const a=this.data.productErrors.get(t);return a?!a.fields||!Object.keys(a.fields).length?!!a.message:Object.keys(a.fields).some(l=>!l.startsWith("variants.")):!1}getProductLevelError(t){const a=this.data.productErrors.get(t);return a?!a.fields||!Object.keys(a.fields).length?a.message||"":Object.entries(a.fields).filter(([s])=>!s.startsWith("variants.")).map(([,s])=>s).join("; ")||"":""}hasVariantError(t,a){const l=this.data.productErrors.get(t);if(!(l!=null&&l.fields))return!1;const s=`variants.${a}.`;return Object.keys(l.fields).some(i=>i.startsWith(s))}getVariantError(t,a){const l=this.data.productErrors.get(t);if(!(l!=null&&l.fields))return"";const s=`variants.${a}.`;return Object.entries(l.fields).filter(([c])=>c.startsWith(s)).map(([,c])=>c).join("; ")}hasFieldError(t,a){var s;const l=this.data.productErrors.get(t);return!!((s=l==null?void 0:l.fields)!=null&&s[a])}hasVariantFieldError(t,a,l){return this.hasFieldError(t,`variants.${a}.${l}`)}async saveProduct(t){var l,s,i,c;const a=t.ID;if(!this.data.savingIds.has(a)){this.data.savingIds.add(a),this.data.savingIds=new Set(this.data.savingIds);try{const p=await Ae.post("products/bulk-update",{products:[t]});if((l=p.updated)!=null&&l.length)this.data.dirty.delete(a),this.data.dirty=new Set(this.data.dirty),this.data.savedIds.add(a),this.data.savedIds=new Set(this.data.savedIds),this.data.productErrors.delete(a),this.data.productErrors=new Map(this.data.productErrors),q.success(u("Product updated successfully"));else if((s=p.errors)!=null&&s.length){const f=p.errors[0];f!=null&&f.fields&&(this.data.productErrors.set(a,f),this.data.productErrors=new Map(this.data.productErrors)),q.error((f==null?void 0:f.message)||"Failed to save product")}}catch(p){const f=((i=p==null?void 0:p.data)==null?void 0:i.message)||"Failed to save product",_=(c=p==null?void 0:p.data)==null?void 0:c.errors;if(_!=null&&_.length){const g=_[0];g!=null&&g.fields&&(this.data.productErrors.set(a,g),this.data.productErrors=new Map(this.data.productErrors))}q.error(f)}finally{this.data.savingIds.delete(a),this.data.savingIds=new Set(this.data.savingIds)}}}async saveProducts(){var l,s;const t=this.getDirtyProducts().filter(i=>!this.data.savedIds.has(i.ID));if(t.length===0){q.info(u("No changes to save"));return}const a=this.chunkArray(t,10);this.data.saving=!0,this.data.saveProgress={total:a.length,completed:0,errors:[],updatedIds:[]};try{for(const p of a){const f=p.map(_=>_.ID);for(const _ of f)this.data.savingIds.add(_);this.data.savingIds=new Set(this.data.savingIds);try{const _=await Ae.post("products/bulk-update",{products:p});if(_.updated){this.data.saveProgress.updatedIds.push(..._.updated);for(const g of _.updated)this.data.savedIds.add(g),this.data.dirty.delete(g),this.data.productErrors.delete(g);this.data.savedIds=new Set(this.data.savedIds),this.data.dirty=new Set(this.data.dirty),this.data.productErrors=new Map(this.data.productErrors)}if(_.errors&&_.errors.length){this.data.saveProgress.errors.push(..._.errors);for(const g of _.errors)g.post_id&&g.fields&&this.data.productErrors.set(g.post_id,g);this.data.productErrors=new Map(this.data.productErrors)}}catch(_){const g=((l=_==null?void 0:_.data)==null?void 0:l.message)||"A chunk failed to save";this.data.saveProgress.errors.push({message:g});const y=(s=_==null?void 0:_.data)==null?void 0:s.errors;if(y!=null&&y.length){for(const v of y)v.post_id&&v.fields&&this.data.productErrors.set(v.post_id,v);this.data.productErrors=new Map(this.data.productErrors)}}for(const _ of f)this.data.savingIds.delete(_);this.data.savingIds=new Set(this.data.savingIds),this.data.saveProgress.completed++}const{updatedIds:i,errors:c}=this.data.saveProgress;c.length===0?q.success(`${i.length} product(s) updated successfully`):i.length>0?q.info(`${i.length} product(s) updated, ${c.length} error(s)`):q.error(u("All products failed to save"))}finally{this.data.saving=!1}}async duplicateProduct(t){var l;const a=t.ID;if(!(!a||this.data.duplicatingIds.has(a))){this.data.duplicatingIds.add(a),this.data.duplicatingIds=new Set(this.data.duplicatingIds);try{const i=(await Ae.post(`products/${a}/duplicate`,{})).product_id;if(i){const p=(await Ae.get("products/bulk-edit-data",{search:i,per_page:1})).products||[];if(p.length>0){const f=this.data.products.indexOf(t);this.data.products.splice(f+1,0,p[0])}}}catch(s){const i=((l=s==null?void 0:s.data)==null?void 0:l.message)||"Failed to duplicate product";q.error(i)}finally{this.data.duplicatingIds.delete(a),this.data.duplicatingIds=new Set(this.data.duplicatingIds)}}}async duplicateProductWithVariants(t,a){var s;const l=t.ID;if(!(!l||this.data.duplicatingIds.has(l))){this.data.duplicatingIds.add(l),this.data.duplicatingIds=new Set(this.data.duplicatingIds);try{const c=(await Ae.post(`products/${l}/duplicate`,{})).product_id;if(!c)return;const f=(await Ae.get("products/bulk-edit-data",{search:c,per_page:1})).products||[];if(!f.length)return;const _=f[0],g=t.variants||[],y=new Set;for(const w of g)a.includes(w.id)&&w.serial_index!=null&&y.add(w.serial_index);_.variants&&y.size>0&&(_.variants=_.variants.filter(w=>y.has(w.serial_index)));const v=this.data.products.indexOf(t);this.data.products.splice(v+1,0,_),this.markDirty(_.ID)}catch(i){const c=((s=i==null?void 0:i.data)==null?void 0:s.message)||"Failed to duplicate product";q.error(c)}finally{this.data.duplicatingIds.delete(l),this.data.duplicatingIds=new Set(this.data.duplicatingIds)}}}duplicateVariant(t,a){const l=JSON.parse(JSON.stringify(a));l.variation_title=l.variation_title?l.variation_title+" (Copy)":"",l.sku="",delete l.id,delete l.post_id;const s=t.variants.indexOf(a);t.variants.splice(s+1,0,l),this.markDirty(t.ID)}async deleteProduct(t){var l;const a=t.ID;if(!(!a||this.data.deletingIds.has(a))){this.data.deletingIds.add(a),this.data.deletingIds=new Set(this.data.deletingIds);try{await Ae.delete(`products/${a}`);const s=this.data.products.indexOf(t);s!==-1&&this.data.products.splice(s,1),this.data.dirty.delete(a),this.data.savedIds.delete(a)}catch(s){const i=((l=s==null?void 0:s.data)==null?void 0:l.message)||"Failed to delete product";q.error(i)}finally{this.data.deletingIds.delete(a),this.data.deletingIds=new Set(this.data.deletingIds)}}}removeVariant(t,a){if(t.variants.length<=1)return q.error(u("A product must have at least one variant.")),!1;const l=t.variants.indexOf(a);return l!==-1&&t.variants.splice(l,1),this.markDirty(t.ID),!0}resetPaymentTypeDefaults(t){t.other_info.payment_type==="onetime"&&(t.other_info.installment="no",t.other_info.times="",t.other_info.manage_setup_fee="no",t.other_info.signup_fee="",t.other_info.signup_fee_name="")}flattenCategoryTree(t,a=""){var s;const l=[];for(const i of t){const c=a?`${a} > ${i.label}`:i.label;l.push({label:c,value:c}),(s=i.children)!=null&&s.length&&l.push(...this.flattenCategoryTree(i.children,c))}return l}async fetchCategories(){try{const a=(await Ae.get("products/fetch-term")).taxonomies||{},l=Object.values(a).find(s=>s.name==="product-categories");l!=null&&l.terms&&(this.data.categoryOptions=this.flattenCategoryTree(l.terms))}catch{}}setupSavedViews(){var a,l;const t=(a=window.fluentCartAdminApp)==null?void 0:a.table_config;this.data.savedViews=((l=t==null?void 0:t.products)==null?void 0:l.saved_views)||[]}getSavedViews(){return this.data.savedViews}getActiveSavedViewId(){return this.data.activeSavedViewId}applySavedView(t){const a=this.data.savedViews.find(l=>l.slug===t);a&&(this.data.activeSavedViewId=t,this.data.savedViewQueryParams=a.query_params)}isViewOwner(t){var a,l;return!t||!t.owner_id?!1:t.owner_id===((l=(a=window.fluentCartAdminApp)==null?void 0:a.me)==null?void 0:l.id)}renameSavedView(t,a){}updateSavedView(t){}deleteSavedView(t){}}const it=g1e.init(),y1e={class:"fct-bulk-edit-page fct-layout-width"},b1e={class:"fct-table-wrapper"},w1e={class:"fct-card-header-top"},C1e={class:"fct-card-header-left flex-1"},k1e={class:"fct-card-header-actions"},B1e={key:0,class:"fct-advanced-filter-toggle-wrapper"},x1e={key:1,class:"fct-btn-group sm hidden md:flex"},S1e={key:0,class:"filter-search-wrap"},F1e={class:"search-bar"},$1e={class:"text-xs text-system-light pt-2 dark:text-gray-300"},E1e={class:"fct-bulk-edit-table-wrap"},U1e={key:0,class:"px-5 py-3 flex items-center justify-between border border-solid border-x-0 border-gray-divider border-t-0 dark:border-dark-400"},I1e={class:"m-0 text-base"},Q1e={key:0,class:"text-system-mid text-sm font-normal dark:text-gray-300"},D1e={class:"fct-btn-group sm justify-end"},V1e={class:"filter-popover-item"},T1e={class:"filter-popover-title"},M1e={class:"fct-bulk-edit-table"},L1e={key:0,"aria-hidden":"true"},R1e=["colspan"],O1e=["onClick"],P1e=["onClick"],H1e={class:"fct-bulk-product-title-cell sticky-col",style:{left:"40px"}},N1e={class:"flex items-center"},K1e=["onClick","title"],G1e={key:0,class:"bulk-collapse-count"},z1e=["title"],j1e={class:"bulk-status-icon is-error"},q1e=["disabled","onClick","title"],Y1e={key:0,class:"fct-bulk-media-cell"},W1e={key:1,class:"fct-bulk-sku-cell"},J1e={key:1,class:"text-gray-300 text-sm flex justify-center"},X1e={key:2,class:"fct-bulk-categories-cell"},Z1e={key:3,class:"fct-bulk-desc-cell"},ebe={key:4,class:"fct-bulk-short-desc-cell"},tbe={key:5,class:"fct-bulk-status-cell"},abe={key:6,class:"fct-bulk-product-type-cell"},lbe={class:"bulk-readonly-label"},sbe={key:7,class:"fct-bulk-pricing-type-cell"},nbe={class:"bulk-readonly-label"},obe={key:8,class:"fct-bulk-payment-type-cell"},ibe={key:9,class:"fct-bulk-interval-cell"},rbe={key:10,class:"fct-bulk-trial-days-cell"},dbe={key:11,class:"fct-bulk-best-price-cell"},ube={key:12,class:"fct-bulk-compare-price-cell"},cbe={key:13,class:"fct-bulk-qty-cell !pl-5"},Abe={key:14,class:"fct-bulk-stock-cell"},pbe={key:1,class:"text-gray-300 text-sm flex justify-center"},fbe={class:"fct-btn-group sm justify-end"},mbe={key:0,class:"bulk-variants-block-row"},hbe=["colspan"],_be={class:"bulk-inner-table",style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},vbe=["onClick"],gbe={class:"bulk-checkbox-cell"},ybe={class:"fct-bulk-product-title-cell sticky-col",style:{left:"40px"}},bbe={class:"flex items-center gap-1 pl-4"},wbe={class:"bulk-status-icon is-error"},Cbe={key:0},kbe={key:1},Bbe={key:2},xbe={key:3},Sbe={key:4},Fbe={key:5},$be={key:6},Ebe={key:7},Ube={key:8},Ibe={key:9},Qbe={key:10},Dbe={key:11},Vbe={key:12},Tbe={key:13,class:"text-center"},Mbe={key:14},Lbe={key:1,class:"text-gray-300 text-sm flex justify-center"},Rbe={class:"fct-btn-group sm justify-end"},Obe={key:1,"aria-hidden":"true"},Pbe=["colspan"],Hbe={key:1,class:"flex flex-col items-center justify-center py-16 text-center"},Nbe={class:"text-system-mid text-sm"},Kbe={key:2,class:"flex items-center justify-center py-8"},Gbe={class:"text-system-mid text-sm"},zbe={key:1,class:"flex items-center justify-center py-3 border-top"},jbe={class:"text-system-mid text-sm"},cr=43,qbe=10,Ic=800,Qc=100,Ybe=200,Wbe={__name:"BulkEdit",setup(e){const t=Jt().ctx,a=nl(),{options:l}=it.data,s=le=>{var he;return((he=le==null?void 0:le.detail)==null?void 0:he.variation_type)==="simple"},i=K(()=>it.data.products),c=K(()=>it.data.loading),p=K(()=>it.data.saving),f=K(()=>it.data.saveProgress),_=K(()=>it.data.pagination),g=K(()=>it.data.dirty),y=K(()=>g.value.size),v=K(()=>Math.max(0,_.value.total-i.value.length)),w=K(()=>Math.min(_.value.per_page,v.value)),k=K(()=>{const le=it.data.saveProgress;return le.total?Math.round(le.completed/le.total*100):0}),b=td("search-input"),S=()=>{it.openSearch(),xe(()=>{var le;(le=b.value)==null||le.focus()})},$=(le=!1)=>{it.fetchProducts({},le)},D=()=>{it.saveProducts()},F=le=>{it.markDirty(le.ID)},B=(le,he)=>{it.resetPaymentTypeDefaults(he),F(le)},U=(le,he)=>{const Ye=it.data.categoryOptions;for(const st of he)Ye.find(je=>je.value===st)||Ye.push({label:st,value:st});F(le)},Q=le=>it.isDirty(le.ID),V=le=>it.isSavingProduct(le.ID),I=le=>it.isSaved(le.ID),M=le=>it.isRowDisabled(le.ID),O=le=>it.isDuplicating(le.ID),L=le=>it.isDeleting(le.ID),H=le=>it.hasError(le.ID),j=le=>it.getError(le.ID),W=le=>it.hasProductLevelError(le.ID),G=(le,he)=>it.hasVariantError(le.ID,he),Z=(le,he)=>it.getVariantError(le.ID,he),ne=(le,he)=>it.hasFieldError(le.ID,he),ce=(le,he,Ye)=>it.hasVariantFieldError(le.ID,he,Ye),z=le=>it.saveProduct(le),ue=le=>it.duplicateProduct(le),ie=(le,he)=>it.duplicateVariant(le,he),J=T(!0),{selectedKeys:N,handleRowClick:ae,toggleSelectAll:oe,selectAll:fe,deselectAll:re,isSelected:Ee,selectedCount:ye,isLinkMode:Ce,toggleLinkMode:ve}=Sf(),Ue=K(()=>{const le=[];for(const he of kt.value)if(le.push(`p:${he.productId}`),he.hasVariants&&!he.collapsed)for(const Ye of he.product.variants)le.push(`v:${Ye.id}`);return le}),Ke=le=>{var he;if(le.startsWith("p:")){const Ye=parseInt(le.slice(2)),st=kt.value.find(je=>je.productId===Ye);return st?{type:"product",data:st.product,product:st.product}:null}else if(le.startsWith("v:")){const Ye=parseInt(le.slice(2));for(const st of kt.value){const je=(he=st.product.variants)==null?void 0:he.find(Xe=>Xe.id===Ye);if(je)return{type:"variant",data:je,product:st.product}}}return null},We=(le,he,Ye)=>{!Ce.value||!Ee(Ye)||$f(le,he,Ye,N.value,Ke,F,lye)},Be=T(!1),$e=le=>{le.key==="Shift"&&(Be.value=!0)},He=le=>{le.key==="Shift"&&(Be.value=!1)},Re=(le,he)=>{if(!he.shiftKey||he.target.closest(".bulk-checkbox-cell"))return;he.preventDefault();const Ye=new Set(N.value);Ye.has(le)?Ye.delete(le):Ye.add(le),N.value=Ye},yt=()=>{const le=[];for(const he of kt.value){const Ye=`p:${he.productId}`,st=N.value.has(Ye),je=[];if(he.product.variants)for(const Xe of he.product.variants)N.value.has(`v:${Xe.id}`)&&je.push(Xe.id);!st&&je.length===0||(st&&je.length===0?le.push({product:he.product,type:"full"}):!st&&je.length>0?le.push({product:he.product,type:"variants-only",variantIds:je}):le.push({product:he.product,type:"partial",variantIds:je}))}return le},gt=async()=>{const le=yt();if(!le.length)return;const he=le.filter(mt=>mt.type==="full").length,Ye=le.filter(mt=>mt.type==="partial").length,je=le.filter(mt=>mt.type==="variants-only").reduce((mt,et)=>mt+et.variantIds.length,0),Xe=[];he>0&&Xe.push(`${he} product(s) with all variants`),Ye>0&&Xe.push(`${Ye} product(s) with selected variants`),je>0&&Xe.push(`${je} variant(s)`);try{await Fl.confirm(t.$t("Duplicate %s?").replace("%s",Xe.join(", ")),t.$t("Bulk Duplicate"),{confirmButtonText:t.$t("Duplicate"),cancelButtonText:t.$t("Cancel"),type:"info"})}catch{return}for(const mt of le)if(mt.type==="full")await it.duplicateProduct(mt.product);else if(mt.type==="variants-only")for(const et of mt.variantIds){const It=mt.product.variants.find(pe=>pe.id===et);It&&it.duplicateVariant(mt.product,It)}else mt.type==="partial"&&await it.duplicateProductWithVariants(mt.product,mt.variantIds);re()},Rt=async()=>{const le=[],he=[];for(const je of kt.value){const Xe=`p:${je.productId}`;if(N.value.has(Xe)){le.push(je.product);continue}const et=[];if(je.product.variants)for(const It of je.product.variants)N.value.has(`v:${It.id}`)&&et.push(It);et.length>0&&he.push({product:je.product,variants:et})}if(!le.length&&!he.length)return;const Ye=he.reduce((je,Xe)=>je+Xe.variants.length,0),st=[];le.length>0&&st.push(`${le.length} product(s)`),Ye>0&&st.push(`${Ye} variant(s)`);try{await Fl.confirm(t.$t("Permanently delete %s? This cannot be undone.").replace("%s",st.join(" and ")),t.$t("Bulk Delete"),{confirmButtonText:t.$t("Delete"),cancelButtonText:t.$t("Cancel"),type:"warning"})}catch{return}for(const je of le)await it.deleteProduct(je);for(const{product:je,variants:Xe}of he)for(const mt of Xe)it.removeVariant(je,mt);re()},Tt=async le=>{const he=le.ID;if(!he||it.isDeleting(he))return;const Ye=le.post_title||t.$t("Untitled product"),st=Array.isArray(le.variants)?le.variants.length:0,je=st>0?t.$t('This will permanently delete "%1$s" and its %2$s variant(s).',Ye,st):t.$t('This will permanently delete "%1$s".',Ye);try{await Fl.confirm(je,t.$t("Delete Product"),{confirmButtonText:t.$t("Delete"),cancelButtonText:t.$t("Cancel"),type:"warning"})}catch{return}it.deleteProduct(le)},Dt=(le,he)=>{if(le.variants.length<=1){it.removeVariant(le,he);return}const Ye=he.variation_title||t.$t("Untitled variant");Fl.confirm(t.$t('This will remove the variant "%1$s".',Ye),t.$t("Remove Variant"),{confirmButtonText:t.$t("Remove"),cancelButtonText:t.$t("Cancel"),type:"warning"}).then(()=>{it.removeVariant(le,he)}).catch(()=>{})},_t=T({visible:!1,field:"",product:null,value:""}),Gt=(le,he)=>{_t.value={visible:!0,field:he,product:le,value:le[he]||""}},bt=le=>{_t.value.value=le},St=()=>{const{product:le,field:he,value:Ye}=_t.value;le&&(le[he]=Ye,F(le)),_t.value.visible=!1},Pt=K(()=>_t.value.field==="post_content"?t.$t("Edit Description"):t.$t("Edit Short Description")),Ht=T([]),Qt=K(()=>Ht.value.filter(le=>le.key==="title"||le.key==="actions"?!0:it.isColumnVisible(le.key))),ht=le=>it.isColumnVisible(le),qt=()=>{it.saveColumnWidths(Ht.value)},ge=T(new Set),Fe=le=>{const he=le.ID;ge.value.has(he)?ge.value.delete(he):ge.value.add(he),ge.value=new Set(ge.value)},ot=le=>ge.value.has(le.ID),wt=T(0),kt=K(()=>{let le=0;return i.value.map(he=>{var pe;const Ye=he.ID,st=((pe=he.detail)==null?void 0:pe.variation_type)!=="simple"&&Array.isArray(he.variants)&&he.variants.length>0,je=st?he.variants.length:0,Xe=ge.value.has(Ye),mt=st&&!Xe?je*cr:0,et=cr+mt,It={product:he,productId:Ye,hasVariants:st,variantCount:je,collapsed:Xe,groupHeight:et,offset:le};return le+=et,It})}),Xt=K(()=>{const le=kt.value;if(le.length===0)return 0;const he=le[le.length-1];return he.offset+he.groupHeight}),vt=K(()=>{const le=kt.value,he=wt.value,Ye=he+Ic,st=qbe*cr;return le.filter(je=>je.offset+je.groupHeight>=he-st&&je.offset<=Ye+st)}),ea=K(()=>vt.value.length===0?0:vt.value[0].offset),ta=K(()=>{if(vt.value.length===0)return 0;const le=vt.value[vt.value.length-1];return Xt.value-le.offset-le.groupHeight});let zt=null,wa=0;const qa=()=>{if(c.value||!_.value.hasMore||i.value.length===0)return;Xt.value-(wt.value+Ic)<Ybe&&$(!0)},il=le=>{const he=le.target,Ye=Date.now();zt&&clearTimeout(zt),Ye-wa>=Qc?(wt.value=he.scrollTop,wa=Ye,qa()):zt=setTimeout(()=>{wt.value=he.scrollTop,wa=Date.now(),zt=null,qa()},Qc)},Ya=le=>({physical:"Physical",digital:"Digital"})[le]||le||"—",ma=le=>({simple:"Simple",simple_variations:"Variable"})[le]||le||"—";let X=null;const we=()=>{const le=a.query.product_ids,he=a.query.variant_ids;le&&he?it.fetchProducts({},!1,le,he):$(!1)};return Ie(async()=>{X=bs(),X.bind("mod+a",le=>{var Ye,st;const he=(Ye=document.activeElement)==null?void 0:Ye.tagName;he==="INPUT"||he==="TEXTAREA"||(st=document.activeElement)!=null&&st.isContentEditable||(le.preventDefault(),fe(Ue.value))}),X.bind("escape",()=>{var he,Ye;const le=(he=document.activeElement)==null?void 0:he.tagName;le==="INPUT"||le==="TEXTAREA"||(Ye=document.activeElement)!=null&&Ye.isContentEditable||(Ce.value?ve():re())}),Ht.value=[{key:"title",title:t.$t("Title"),width:150,minWidth:100},{key:"image",title:t.$t("Image"),width:60,minWidth:50},{key:"sku",title:t.$t("SKU"),width:120,minWidth:80},{key:"categories",title:t.$t("Categories"),width:200,minWidth:150},{key:"description",title:t.$t("Description"),width:200,minWidth:150},{key:"short_description",title:t.$t("Short Description"),width:150,minWidth:100},{key:"status",title:t.$t("Status"),width:100,minWidth:50},{key:"product_type",title:t.$t("Product Type"),width:120,minWidth:80},{key:"pricing_type",title:t.$t("Pricing Type"),width:120,minWidth:80},{key:"payment_type",title:t.$t("Payment Type"),width:120,minWidth:100},{key:"interval",title:t.$t("Interval"),width:120,minWidth:80},{key:"trial_days",title:t.$t("Trial Days"),width:100,minWidth:70},{key:"best_price",title:t.$t("Best Price"),width:100,minWidth:100},{key:"compare_price",title:t.$t("Compare-at Price"),width:150,minWidth:100},{key:"track_quantity",title:t.$t("Track Quantity"),width:100,minWidth:100},{key:"stock",title:t.$t("Stock"),width:120,minWidth:80},{key:"actions",title:"",width:110,minWidth:110}],it.restoreColumnWidths(Ht.value),it.setupColumnVisibility(),it.setupSavedViews(),it.fetchCategories(),we(),document.body.classList.add("fct-bulk-page"),window.addEventListener("keydown",$e),window.addEventListener("keyup",He)}),cl(()=>{document.body.classList.remove("fct-bulk-page"),window.removeEventListener("keydown",$e),window.removeEventListener("keyup",He),X&&X.reset()}),(le,he)=>{const Ye=C("el-button"),st=C("el-progress"),je=C("el-switch"),Xe=C("el-tooltip"),mt=C("el-input"),et=C("el-checkbox"),It=C("el-checkbox-group"),pe=C("el-popover"),_e=C("el-icon"),Oe=C("el-option"),Me=C("el-select"),ct=C("el-dialog");return r(),h("div",y1e,[n(ol,{title:le.$t("Bulk Edit")},{action:d(()=>[n(Ye,{type:"primary",onClick:D,loading:p.value,disabled:p.value||y.value===0},{default:d(()=>[R(m(p.value?le.$t("Saving %s/%s...").replace("%s",f.value.completed).replace("%s",f.value.total):y.value>0?le.$t("Save Changes")+` (${y.value})`:le.$t("Save Changes")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["title"]),p.value?(r(),E(st,{key:0,percentage:k.value,"stroke-width":6,class:"mb-4"},null,8,["percentage"])):x("",!0),o("div",b1e,[n(Se,null,{default:d(()=>[n(Ve,{border_bottom:""},{default:d(()=>[o("div",w1e,[o("div",C1e,[A(it).getTabsCount()&&!A(it).isUsingAdvanceFilter()?(r(),E(am,{key:0,class:de("hide-animation-on-mobile hidden md:inline-flex classic-tab-style"),table:A(it)},null,8,["table"])):x("",!0)]),o("div",k1e,[A(it).isAdvanceFilterEnabled()?(r(),h("div",B1e,[n(je,{class:"fct-advanced-filter-toggle",onChange:he[0]||(he[0]=ee=>{A(it).onFilterTypeChanged(ee)}),"active-value":"advanced","inactive-value":"simple",modelValue:A(it).data.filterType,"onUpdate:modelValue":he[1]||(he[1]=ee=>A(it).data.filterType=ee),"active-text":le.$t("Advanced Filter"),size:"small"},null,8,["modelValue","active-text"])])):x("",!0),A(it).isUsingAdvanceFilter()?x("",!0):(r(),h("div",x1e,[A(it).isSearching()?x("",!0):(r(),E(Xe,{key:0,effect:"light",content:le.$t("Search"),placement:"top","popper-class":"fct-tooltip"},{default:d(()=>[n(at,{tag:"button",onClick:Ge(S,["prevent"])},{default:d(()=>[n(Y,{name:"Search"})]),_:1})]),_:1},8,["content"]))]))])]),n(Yc,{table:A(it)},null,8,["table"]),A(it).isSearching()&&!A(it).isUsingAdvanceFilter()?(r(),h("div",S1e,[o("div",F1e,[n(mt,{ref:"search-input",onClear:he[2]||(he[2]=()=>{A(it).search()}),onKeyup:he[3]||(he[3]=xa(()=>{A(it).search()},["enter"])),modelValue:A(it).data.search,"onUpdate:modelValue":he[4]||(he[4]=ee=>A(it).data.search=ee),type:"text",placeholder:le.$t("Search"),clearable:""},{prefix:d(()=>[n(Y,{name:"Search"})]),_:1},8,["modelValue","placeholder"]),o("div",$1e,m(A(it).getSearchHint()),1)]),n(Ye,{text:"",onClick:he[5]||(he[5]=()=>{A(it).closeSearch()})},{default:d(()=>[R(m(le.$t("Cancel")),1)]),_:1})])):x("",!0)]),_:1}),n(ke,{class:"p-0"},{default:d(()=>[o("div",E1e,[i.value.length>0?(r(),h("div",U1e,[o("h5",I1e,[R(m(i.value.length)+" "+m(i.value.length===1?le.$t("Product"):le.$t("Products"))+" ",1),_.value.total>i.value.length?(r(),h("span",Q1e,m(le.$t("of"))+" "+m(_.value.total)+" "+m(le.$t("total"))+" · "+m(w.value)+" "+m(le.$t("next")),1)):x("",!0)]),o("div",D1e,[n(Ye,{disabled:A(ye)===0,onClick:gt,size:"small"},{default:d(()=>[he[14]||(he[14]=o("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),o("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})],-1)),R(" "+m(le.$t("Duplicate")),1)]),_:1,__:[14]},8,["disabled"]),n(Ye,{disabled:A(ye)===0,onClick:Rt,size:"small",type:"danger",plain:""},{default:d(()=>[he[15]||(he[15]=o("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o("polyline",{points:"3 6 5 6 21 6"}),o("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)),R(" "+m(le.$t("Delete")),1)]),_:1,__:[15]},8,["disabled"]),n(Ye,{class:de({"is-active":A(Ce)}),disabled:A(ye)<2&&!A(Ce),onClick:A(ve),size:"small"},{default:d(()=>[he[16]||(he[16]=o("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),o("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})],-1)),R(" "+m(A(Ce)?le.$t("Unlink"):le.$t("Link")),1)]),_:1,__:[16]},8,["class","disabled","onClick"]),n(et,{modelValue:J.value,"onUpdate:modelValue":he[6]||(he[6]=ee=>J.value=ee),label:le.$t("Pin Actions")},null,8,["modelValue","label"]),n(pe,{trigger:"click",placement:"bottom-end",width:"240","popper-class":"filter-popover"},{reference:d(()=>[o("span",null,[n(Xe,{effect:"light",content:le.$t("Toggle columns"),placement:"top","popper-class":"fct-tooltip"},{default:d(()=>[n(at,{tag:"button",size:"small"},{default:d(()=>[n(Y,{name:"ColumnIcon"})]),_:1})]),_:1},8,["content"])])]),default:d(()=>[o("div",V1e,[o("h3",T1e,m(le.$t("Columns")),1),n(It,{modelValue:A(it).data.visibleColumns,"onUpdate:modelValue":he[7]||(he[7]=ee=>A(it).data.visibleColumns=ee),class:"fct-checkbox-blocks",onChange:he[8]||(he[8]=ee=>A(it).handleColumnVisibilityChange())},{default:d(()=>[(r(!0),h(P,null,te(A(it).getToggleableColumns(),ee=>(r(),E(et,{key:ee.value,value:ee.value,label:le.$t(ee.label)},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])])]),_:1})])])):x("",!0),o("div",M1e,[i.value.length>0?(r(),h("div",{key:0,class:de(["relative",{"is-link-mode":A(Ce),"is-shift-held":Be.value}])},[n(Bf,{columns:Qt.value,"sticky-last":J.value,onScroll:il,onResizeEnd:qt},{"header-first":d(()=>[Wt(n(et,{checked:A(ye)>0&&A(ye)===Ue.value.length,onChange:he[9]||(he[9]=ee=>A(oe)(Ue.value))},null,8,["checked"]),[[A(tye),A(ye)>0&&A(ye)<Ue.value.length]])]),"header-last":d(()=>[R(m(le.$t("Actions")),1)]),default:d(()=>[ea.value>0?(r(),h("tr",L1e,[o("td",{colspan:Qt.value.length+1,style:ra({height:ea.value+"px",padding:0,border:"none"})},null,12,R1e)])):x("",!0),(r(!0),h(P,null,te(vt.value,ee=>{var Ne,pt,De,xt,Wa,se,me,Qe,Le,qe,At,tt,Ut,jt,Ta,$t,Zt,ha;return r(),h(P,{key:ee.productId},[o("tr",{class:de(["bulk-product-row",{"is-dirty":Q(ee.product),"is-saving":V(ee.product),"is-saved":I(ee.product),"has-product-error":H(ee.product),"is-selected":A(Ee)(`p:${ee.productId}`)}]),onClick:Ze=>Re(`p:${ee.productId}`,Ze)},[o("td",{class:"bulk-checkbox-cell",onClick:Ze=>A(ae)(`p:${ee.productId}`,Ze,Ue.value)},[n(et,{"model-value":A(Ee)(`p:${ee.productId}`),tabindex:"-1"},null,8,["model-value"])],8,P1e),o("td",H1e,[o("div",N1e,[ee.hasVariants?(r(),h("button",{key:0,class:"bulk-collapse-btn",onClick:Ge(Ze=>Fe(ee.product),["prevent"]),title:ot(ee.product)?le.$t("Expand variants"):le.$t("Collapse variants")},[(r(),h("svg",{class:de(["bulk-collapse-icon",{"is-collapsed":ot(ee.product)}]),width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},he[17]||(he[17]=[o("path",{d:"M6 4L10 8L6 12",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2)),ot(ee.product)?(r(),h("span",G1e,m(ee.variantCount),1)):x("",!0)],8,K1e)):x("",!0),n(mt,{class:de(["fct-bulk-input",{"is-error":ne(ee.product,"post_title")}]),modelValue:ee.product.post_title,"onUpdate:modelValue":[Ze=>ee.product.post_title=Ze,Ze=>{F(ee.product),We("title",Ze,`p:${ee.productId}`)}],placeholder:le.$t("Product title"),disabled:M(ee.product),size:"small"},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","class"]),V(ee.product)?(r(),h("span",{key:1,class:"bulk-status-icon is-syncing",title:le.$t("Saving...")},[n(_e,{class:"is-loading",size:14},{default:d(()=>[n(A(en))]),_:1})],8,z1e)):W(ee.product)||s(ee.product)&&H(ee.product)?(r(),E(Xe,{key:2,content:j(ee.product),placement:"top"},{default:d(()=>[o("span",j1e,[n(_e,{size:16},{default:d(()=>[n(A(Vo))]),_:1})])]),_:2},1032,["content"])):Q(ee.product)?(r(),h("button",{key:3,class:"bulk-inline-save",disabled:M(ee.product),onClick:Ge(Ze=>z(ee.product),["prevent"]),title:le.$t("Save")},he[18]||(he[18]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",width:"16",height:"16"},[o("path",{d:"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z",fill:"currentColor"})],-1)]),8,q1e)):x("",!0)])]),ht("image")?(r(),h("td",Y1e,[n(yl,{modelValue:ee.product.gallery,"onUpdate:modelValue":Ze=>ee.product.gallery=Ze,onChange:Ze=>F(ee.product)},null,8,["modelValue","onUpdate:modelValue","onChange"])])):x("",!0),ht("sku")?(r(),h("td",W1e,[((pt=(Ne=ee.product)==null?void 0:Ne.detail)==null?void 0:pt.variation_type)==="simple"&&((De=ee.product.variants)!=null&&De[0])?(r(),E(mt,{key:0,class:de(["fct-bulk-input",{"is-error":ne(ee.product,"variants.0.sku")}]),modelValue:ee.product.variants[0].sku,"onUpdate:modelValue":[Ze=>ee.product.variants[0].sku=Ze,Ze=>{F(ee.product),We("sku",Ze,`p:${ee.productId}`)}],placeholder:"SKU",size:"small",disabled:M(ee.product)},null,8,["modelValue","onUpdate:modelValue","disabled","class"])):(r(),h("span",J1e,"—"))])):x("",!0),ht("categories")?(r(),h("td",X1e,[n(xf,{modelValue:ee.product.categories,"onUpdate:modelValue":Ze=>ee.product.categories=Ze,options:A(it).data.categoryOptions,disabled:M(ee.product),onChange:Ze=>{U(ee.product,Ze),We("categories",ee.product.categories,`p:${ee.productId}`)}},null,8,["modelValue","onUpdate:modelValue","options","disabled","onChange"])])):x("",!0),ht("description")?(r(),h("td",Z1e,[n(li,{value:ee.product.post_content,placeholder:le.$t("Description"),onClick:Ze=>Gt(ee.product,"post_content")},null,8,["value","placeholder","onClick"])])):x("",!0),ht("short_description")?(r(),h("td",ebe,[n(li,{value:ee.product.post_excerpt,placeholder:le.$t("Short description"),onClick:Ze=>Gt(ee.product,"post_excerpt")},null,8,["value","placeholder","onClick"])])):x("",!0),ht("status")?(r(),h("td",tbe,[n(Me,{modelValue:ee.product.post_status,"onUpdate:modelValue":Ze=>ee.product.post_status=Ze,size:"small",class:de({"is-field-error":ne(ee.product,"post_status")}),disabled:M(ee.product),onChange:Ze=>{F(ee.product),We("status",ee.product.post_status,`p:${ee.productId}`)}},{default:d(()=>[n(Oe,{label:le.$t("Published"),value:"publish"},null,8,["label"]),n(Oe,{label:le.$t("Draft"),value:"draft"},null,8,["label"])]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled","onChange"])])):x("",!0),ht("product_type")?(r(),h("td",abe,[o("span",lbe,m(Ya((Wa=(xt=ee.product)==null?void 0:xt.detail)==null?void 0:Wa.fulfillment_type)),1)])):x("",!0),ht("pricing_type")?(r(),h("td",sbe,[o("span",nbe,m(ma((me=(se=ee.product)==null?void 0:se.detail)==null?void 0:me.variation_type)),1)])):x("",!0),ht("payment_type")?(r(),h("td",obe,[n(Zo,{variant:s(ee.product)?(Qe=ee.product.variants)==null?void 0:Qe[0]:null,disabled:M(ee.product),"has-error":ne(ee.product,"variants.0.other_info.payment_type"),onPaymentTypeChange:Ze=>{var aa;B(ee.product,Ze),We("payment_type",(aa=Ze.other_info)==null?void 0:aa.payment_type,`p:${ee.productId}`)},onChange:Ze=>F(ee.product)},null,8,["variant","disabled","has-error","onPaymentTypeChange","onChange"])])):x("",!0),ht("interval")?(r(),h("td",ibe,[n(ei,{variant:s(ee.product)?(Le=ee.product.variants)==null?void 0:Le[0]:null,disabled:M(ee.product),"has-error":ne(ee.product,"variants.0.other_info.repeat_interval"),onChange:Ze=>{var aa,Ha,Je;F(ee.product),We("interval",(Je=(Ha=(aa=ee.product.variants)==null?void 0:aa[0])==null?void 0:Ha.other_info)==null?void 0:Je.repeat_interval,`p:${ee.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("trial_days")?(r(),h("td",rbe,[n(ti,{variant:s(ee.product)?(qe=ee.product.variants)==null?void 0:qe[0]:null,disabled:M(ee.product),"has-error":ne(ee.product,"variants.0.other_info.trial_days"),onChange:Ze=>{var aa,Ha,Je;F(ee.product),We("trial_days",(Je=(Ha=(aa=ee.product.variants)==null?void 0:aa[0])==null?void 0:Ha.other_info)==null?void 0:Je.trial_days,`p:${ee.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("best_price")?(r(),h("td",dbe,[n(Xo,{variant:s(ee.product)?(At=ee.product.variants)==null?void 0:At[0]:null,disabled:M(ee.product),"has-error":ne(ee.product,"variants.0.item_price"),onChange:Ze=>{var aa,Ha;F(ee.product),We("price",(Ha=(aa=ee.product.variants)==null?void 0:aa[0])==null?void 0:Ha.item_price,`p:${ee.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("compare_price")?(r(),h("td",ube,[n(ai,{variant:s(ee.product)?(tt=ee.product.variants)==null?void 0:tt[0]:null,disabled:M(ee.product),"has-error":ne(ee.product,"variants.0.compare_price"),onChange:Ze=>{var aa,Ha;F(ee.product),We("compare_price",(Ha=(aa=ee.product.variants)==null?void 0:aa[0])==null?void 0:Ha.compare_price,`p:${ee.productId}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("track_quantity")?(r(),h("td",cbe,[(Ut=ee.product)!=null&&Ut.detail?(r(),E(je,{key:0,modelValue:ee.product.detail.manage_stock,"onUpdate:modelValue":Ze=>ee.product.detail.manage_stock=Ze,"active-value":1,"inactive-value":0,disabled:M(ee.product),onChange:Ze=>{F(ee.product),A(it).syncStockStatus(ee.product),We("manage_stock",ee.product.detail.manage_stock,`p:${ee.productId}`)}},null,8,["modelValue","onUpdate:modelValue","disabled","onChange"])):x("",!0)])):x("",!0),ht("stock")?(r(),h("td",Abe,[(Ta=(jt=ee.product)==null?void 0:jt.detail)!=null&&Ta.manage_stock&&((Zt=($t=ee.product)==null?void 0:$t.detail)==null?void 0:Zt.variation_type)==="simple"&&((ha=ee.product.variants)!=null&&ha[0])?(r(),E(mt,{key:0,class:"fct-bulk-input",placeholder:le.$t("e.g 10"),size:"small",modelValue:ee.product.variants[0].available,"onUpdate:modelValue":[Ze=>ee.product.variants[0].available=Ze,Ze=>{ee.product.variants[0].total_stock=Ze,F(ee.product),A(it).syncStockStatus(ee.product),We("stock",Ze,`p:${ee.productId}`)}],disabled:M(ee.product)},null,8,["placeholder","modelValue","onUpdate:modelValue","disabled"])):(r(),h("span",pbe,"—"))])):x("",!0),o("td",{class:de(["fct-bulk-actions-cell",{"sticky-col sticky-col-right":J.value}])},[o("div",fbe,[ee.product.view_url?(r(),E(at,{key:0,tag:"a",size:"x-small",href:ee.product.view_url,target:"_blank",title:le.$t("View Product")},{default:d(()=>[n(Y,{name:"External"})]),_:2},1032,["href","title"])):x("",!0),n(at,{tag:"button",size:"x-small",onClick:Ge(Ze=>ue(ee.product),["prevent"]),disabled:p.value||M(ee.product)||O(ee.product),title:le.$t("Duplicate")},{default:d(()=>[O(ee.product)?(r(),E(_e,{key:0,class:"is-loading",size:14},{default:d(()=>[n(A(en))]),_:1})):(r(),E(Y,{key:1,name:"Copy"}))]),_:2},1032,["onClick","disabled","title"]),n(at,{tag:"button",size:"x-small",hover:"danger",onClick:Ge(Ze=>Tt(ee.product),["prevent"]),disabled:p.value||M(ee.product)||L(ee.product),title:le.$t("Delete")},{default:d(()=>[L(ee.product)?(r(),E(_e,{key:0,class:"is-loading",size:14},{default:d(()=>[n(A(en))]),_:1})):(r(),E(Y,{key:1,name:"Delete"}))]),_:2},1032,["onClick","disabled","title"])])],2)],10,O1e),ee.hasVariants?(r(),h("tr",mbe,[o("td",{colspan:Qt.value.length+1,class:"!p-0 !border-b-0"},[n(ya,{accordion:"",visible:!ee.collapsed,duration:200},{default:d(()=>[o("table",_be,[o("colgroup",null,[he[19]||(he[19]=o("col",{style:{width:"40px"}},null,-1)),(r(!0),h(P,null,te(Qt.value,(Ze,aa)=>(r(),h("col",{key:aa,style:ra({width:Ze.width+"px"})},null,4))),128))]),o("tbody",null,[(r(!0),h(P,null,te(ee.product.variants,(Ze,aa)=>{var Ha,Je;return r(),h("tr",{key:Ze.id||aa,class:de(["bulk-variation-row",{"is-selected":A(Ee)(`v:${Ze.id}`)}]),onClick:Lt=>Re(`v:${Ze.id}`,Lt)},[o("td",gbe,[n(et,{"model-value":A(Ee)(`v:${Ze.id}`),tabindex:"-1",onChange:Lt=>A(ae)(`v:${Ze.id}`,Lt,Ue.value)},null,8,["model-value","onChange"])]),o("td",ybe,[o("div",bbe,[he[20]||(he[20]=o("span",{class:"text-gray-300 text-xs"},"└",-1)),n(mt,{size:"small",modelValue:Ze.variation_title,"onUpdate:modelValue":[Lt=>Ze.variation_title=Lt,Lt=>{F(ee.product),We("title",Lt,`v:${Ze.id}`)}],placeholder:le.$t("Variation title"),disabled:M(ee.product),class:de({"is-error":ce(ee.product,aa,"variation_title")})},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","class"]),G(ee.product,aa)?(r(),E(Xe,{key:0,content:Z(ee.product,aa),placement:"top"},{default:d(()=>[o("span",wbe,[n(_e,{size:14},{default:d(()=>[n(A(Vo))]),_:1})])]),_:2},1032,["content"])):x("",!0)])]),ht("image")?(r(),h("td",Cbe,[n(yl,{modelValue:Ze.media,"onUpdate:modelValue":Lt=>Ze.media=Lt,onChange:Lt=>F(ee.product)},null,8,["modelValue","onUpdate:modelValue","onChange"])])):x("",!0),ht("sku")?(r(),h("td",kbe,[n(mt,{class:de(["fct-bulk-input",{"is-error":ce(ee.product,aa,"sku")}]),size:"small",modelValue:Ze.sku,"onUpdate:modelValue":[Lt=>Ze.sku=Lt,Lt=>{F(ee.product),We("sku",Lt,`v:${Ze.id}`)}],placeholder:le.$t("SKU"),disabled:M(ee.product)},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","class"])])):x("",!0),ht("categories")?(r(),h("td",Bbe,he[21]||(he[21]=[o("span",{class:"text-gray-300 text-sm flex justify-center"},"—",-1)]))):x("",!0),ht("description")?(r(),h("td",xbe,he[22]||(he[22]=[o("span",{class:"text-gray-300 text-sm flex justify-center"},"—",-1)]))):x("",!0),ht("short_description")?(r(),h("td",Sbe,he[23]||(he[23]=[o("span",{class:"text-gray-300 text-sm flex justify-center"},"—",-1)]))):x("",!0),ht("status")?(r(),h("td",Fbe,he[24]||(he[24]=[o("span",{class:"text-gray-300 text-sm flex justify-center"},"—",-1)]))):x("",!0),ht("product_type")?(r(),h("td",$be,he[25]||(he[25]=[o("span",{class:"text-gray-300 text-sm flex justify-center"},"—",-1)]))):x("",!0),ht("pricing_type")?(r(),h("td",Ebe,he[26]||(he[26]=[o("span",{class:"text-gray-300 text-sm flex justify-center"},"—",-1)]))):x("",!0),ht("payment_type")?(r(),h("td",Ube,[n(Zo,{variant:Ze,disabled:M(ee.product),"has-error":ce(ee.product,aa,"other_info.payment_type"),onPaymentTypeChange:Lt=>{var os;B(ee.product,Lt),We("payment_type",(os=Lt.other_info)==null?void 0:os.payment_type,`v:${Ze.id}`)},onChange:Lt=>F(ee.product)},null,8,["variant","disabled","has-error","onPaymentTypeChange","onChange"])])):x("",!0),ht("interval")?(r(),h("td",Ibe,[n(ei,{variant:Ze,disabled:M(ee.product),"has-error":ce(ee.product,aa,"other_info.repeat_interval"),onChange:Lt=>{var os;F(ee.product),We("interval",(os=Ze.other_info)==null?void 0:os.repeat_interval,`v:${Ze.id}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("trial_days")?(r(),h("td",Qbe,[n(ti,{variant:Ze,disabled:M(ee.product),"has-error":ce(ee.product,aa,"other_info.trial_days"),onChange:Lt=>{var os;F(ee.product),We("trial_days",(os=Ze.other_info)==null?void 0:os.trial_days,`v:${Ze.id}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("best_price")?(r(),h("td",Dbe,[n(Xo,{variant:Ze,disabled:M(ee.product),"has-error":ce(ee.product,aa,"item_price"),onChange:Lt=>{F(ee.product),We("price",Ze.item_price,`v:${Ze.id}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("compare_price")?(r(),h("td",Vbe,[n(ai,{variant:Ze,disabled:M(ee.product),"has-error":ce(ee.product,aa,"compare_price"),onChange:Lt=>{F(ee.product),We("compare_price",Ze.compare_price,`v:${Ze.id}`)}},null,8,["variant","disabled","has-error","onChange"])])):x("",!0),ht("track_quantity")?(r(),h("td",Tbe,he[27]||(he[27]=[o("span",{class:"text-gray-300 text-sm"},"—",-1)]))):x("",!0),ht("stock")?(r(),h("td",Mbe,[(Je=(Ha=ee.product)==null?void 0:Ha.detail)!=null&&Je.manage_stock?(r(),E(mt,{key:0,class:"fct-bulk-input",placeholder:le.$t("e.g 10"),size:"small",modelValue:Ze.available,"onUpdate:modelValue":[Lt=>Ze.available=Lt,Lt=>{Ze.total_stock=Lt,F(ee.product),A(it).syncStockStatus(ee.product),We("stock",Lt,`v:${Ze.id}`)}],disabled:M(ee.product)},null,8,["placeholder","modelValue","onUpdate:modelValue","disabled"])):(r(),h("span",Lbe,"—"))])):x("",!0),o("td",{class:de(["text-center",{"sticky-col sticky-col-right":J.value}])},[o("div",Rbe,[n(at,{tag:"button",size:"x-small",onClick:Ge(Lt=>ie(ee.product,Ze),["prevent"]),disabled:p.value||M(ee.product),title:le.$t("Duplicate")},{default:d(()=>[n(Y,{name:"Copy"})]),_:2},1032,["onClick","disabled","title"]),n(at,{tag:"button",size:"x-small",hover:"danger",onClick:Ge(Lt=>Dt(ee.product,Ze),["prevent"]),disabled:p.value||M(ee.product),title:le.$t("Delete")},{default:d(()=>[n(Y,{name:"Delete"})]),_:2},1032,["onClick","disabled","title"])])],2)],10,vbe)}),128))])])]),_:2},1032,["visible"])],8,hbe)])):x("",!0)],64)}),128)),ta.value>0?(r(),h("tr",Obe,[o("td",{colspan:Qt.value.length+1,style:ra({height:ta.value+"px",padding:0,border:"none"})},null,12,Pbe)])):x("",!0)]),_:1},8,["columns","sticky-last"])],2)):c.value?c.value?(r(),h("div",Kbe,[n(_e,{class:"is-loading mr-2"},{default:d(()=>he[28]||(he[28]=[o("i",{class:"el-icon-loading"},null,-1)])),_:1,__:[28]}),o("span",Gbe,m(le.$t("Loading products...")),1)])):x("",!0):(r(),h("div",Hbe,[o("p",Nbe,m(le.$t("No products found.")),1)]))]),_.value.hasMore&&i.value.length>0&&c.value?(r(),h("div",zbe,[n(_e,{class:"is-loading mr-2"},{default:d(()=>he[29]||(he[29]=[o("i",{class:"el-icon-loading"},null,-1)])),_:1,__:[29]}),o("span",jbe,m(le.$t("Loading"))+" "+m(w.value)+" "+m(le.$t("more...")),1)])):x("",!0)])]),_:1})]),_:1})]),n(ct,{modelValue:_t.value.visible,"onUpdate:modelValue":he[12]||(he[12]=ee=>_t.value.visible=ee),title:Pt.value,width:"700px","close-on-click-modal":!1,onClosed:he[13]||(he[13]=ee=>_t.value.product=null)},{footer:d(()=>[n(Ye,{onClick:he[11]||(he[11]=ee=>_t.value.visible=!1)},{default:d(()=>[R(m(le.$t("Cancel")),1)]),_:1}),n(Ye,{type:"primary",onClick:St},{default:d(()=>[R(m(le.$t("Save")),1)]),_:1})]),default:d(()=>[_t.value.visible&&_t.value.field==="post_content"?(r(),E(ls,{key:0,"model-value":_t.value.value,height:300,onUpdate:bt},null,8,["model-value"])):x("",!0),_t.value.visible&&_t.value.field==="post_excerpt"?(r(),E(mt,{key:1,modelValue:_t.value.value,"onUpdate:modelValue":he[10]||(he[10]=ee=>_t.value.value=ee),type:"textarea",rows:6,placeholder:le.$t("Short description")},null,8,["modelValue","placeholder"])):x("",!0)]),_:1},8,["modelValue","title"])])}}},Ef=ze.get("payment_routes");for(const e of Ef)e.props=!0;const Jbe=ze.get("storage_driver_routes"),Uf=(Jbe||[]).filter(e=>e.name!=="s3");for(const e of Uf)e.props=!0;var Xbe={dashboard:{name:"dashboard",path:"/",component:YB,meta:{active_menu:"dashboard",title:u("Dashboard")}},orders:{path:"/orders",component:F$,meta:{active_menu:"orders",title:u("Orders")},children:[{name:"orders",path:"",component:vv,meta:{active_menu:"orders",title:u("Orders"),permission:"orders/view"}},{name:"view_order",path:":order_id(\\d+)/view",component:ND,props:!0,meta:{active_menu:"orders",title:u("View Order"),permission:["orders/view","orders/manage"]}},{name:"add_order",path:"add",component:bV,props:!0,meta:{active_menu:"orders",title:u("Create Order"),permission:"orders/create"}}]},products:{name:"products",path:"/products",component:h7,meta:{active_menu:"products",title:u("Products"),permission:"products/view"}},product_route:{path:"/products/:product_id(\\d+)",component:cT,name:"product_route",meta:{active_menu:"products",title:u("Products"),permission:["products/view","products/edit","integrations/manage"]},props:!0,children:[{name:"product_edit",path:"",props:!0,component:lq,meta:{active_menu:"products",title:u("Product Edit"),permission:"products/edit"}},{name:"product_integrations",path:"integrations",props:!0,component:gc,meta:{active_menu:"products",title:u("Integrations"),permission:"integrations/manage"}},{name:"product_integration_feed_editor",path:"integrations/:integration_id/:integration_name",component:nc,meta:{active_menu:"products",title:u("Edit Integration"),permission:"integrations/manage"}},{name:"SingleIntegration",path:"integrations/:integration_id",props:!0,component:AY,meta:{active_menu:"products",title:u("Integrations"),permission:"integrations/manage"}},{name:"product_upgrade_paths",path:"upgrade-paths",props:!0,component:Gq,meta:{active_menu:"products",title:u("Upgrade Paths"),permission:"integrations/manage"}},{name:"Integrations",path:"integrations",props:!0,component:gc,meta:{active_menu:"integrations",title:u("Product Integrations"),permission:"integrations/manage"}}]},product_bulk_insert:{name:"product_bulk_insert",path:"/products/bulk-insert",component:v1e,meta:{active_menu:"products",title:u("Product Bulk Insert"),permission:"products/create"}},product_bulk_edit:{name:"product_bulk_edit",path:"/products/bulk-edit",component:Wbe,meta:{active_menu:"products",title:u("Product Bulk Edit"),permission:"products/edit"}},product_attributes:{name:"product_attributes",path:"/products/attributes",component:$m,meta:{active_menu:"products",title:u("Attributes"),permission:"products/view"}},product_inventory:{name:"product_inventory",path:"/products/inventory",component:jJ,meta:{active_menu:"products",title:u("Inventory"),permission:"products/view"}},customers:{path:"/customers",component:Ig,meta:{active_menu:"customers",permission:["customers/view","customers/manage"]},children:[{name:"customers",path:"/customers",component:s_,meta:{active_menu:"customers",title:u("Customers"),permission:"customers/view"}},{name:"view_customer",path:":customer_id(\\d+)/view",component:xU,props:!0,meta:{active_menu:"customers",title:u("View Customer"),permission:"customers/view"}}]},reports:{name:"reports",path:"/reports",component:dte,meta:{active_menu:"reports",permission:"reports/view"},children:[{name:"reports_overview",path:"overview",component:mce,meta:{title:u("Overview"),permission:"reports/view"}},{name:"reports_sales",path:"sales",component:Rte,meta:{title:u("Sales"),permission:"reports/view"}},{name:"reports_orders",path:"orders",component:tne,meta:{title:u("Orders"),permission:"reports/view"}},{name:"reports_revenue",path:"revenue",component:Vae,meta:{title:u("Revenue"),permission:"reports/view"}},{name:"reports_refunds",path:"refunds",component:Lne,meta:{title:u("Refunds"),permission:"reports/view"}},{name:"reports_subscriptions",path:"subscriptions",component:Eoe,meta:{title:u("Subscriptions"),permission:"reports/view"}},{name:"subscriptions-retention",path:"subscriptions/subscriptions-retention",component:Kie,meta:{title:u("Retention"),permission:"reports/view"}},{name:"subscriptions-cohorts",path:"subscriptions/subscriptions-cohorts",component:()=>Yt(()=>import("./chunks/Cohort.js?ver=1.6.5"),[],import.meta.url),meta:{title:u("Cohorts"),permission:"reports/view"}},{name:"future_renewals",path:"subscriptions/future-renewals",component:Yoe,meta:{title:u("Future Renewals"),permission:"reports/view"}},{name:"reports_products",path:"products",component:bue,meta:{title:u("Product"),permission:"reports/view"}},{name:"reports_customer",path:"customer",component:mre,meta:{title:u("Customer"),permission:"reports/view"}},{name:"reports_sources",path:"sources",component:Xre,meta:{title:u("Sources"),permission:"reports/view"}}]},settings:{path:"/settings",component:vE,meta:{active_menu:"settings",title:u("Settings"),permission:["store/settings","store/sensitive"]},children:[{name:"store_settings",path:"store-settings",component:IV,meta:{active_menu:"settings",title:u("Settings"),permission:"store/settings"},children:[{name:"store_setup",path:"",component:Jl,meta:{title:u("Store Setup")}},{name:"pages_setup",path:"pages_setup",component:Jl,meta:{title:u("Pages Setup")}},{name:"single_product_setup",path:"single_product_setup",component:Jl,meta:{title:u("Product Page")}},{name:"cart_and_checkout",path:"cart_and_checkout",component:Jl,meta:{title:u("Cart & Checkout")}},{name:"subscriptions_setup",path:"subscriptions_setup",component:Jl,meta:{title:u("Subscriptions")}},{name:"checkout_fields",path:"checkout_fields",component:cge,meta:{}},{name:"appearance",path:"appearance",component:Jl,meta:{title:u("Appearance")}}]},{name:"compliance",path:"compliance",component:Jl,meta:{active_menu:"settings",title:u("Compliance"),permission:"store/settings"}},...ze.get("addon_settings_routes",[]).map(e=>({component:Jl,...e})),{name:"email_notifications",path:"email_notifications",component:vX,meta:{active_menu:"settings",title:u("Notifications"),permission:"store/sensitive"}},{name:"email_mailing_settings",path:"email_mailing_settings",component:cAe,meta:{active_menu:"settings",title:u("Mailing Settings"),permission:"store/sensitive"}},{name:"reminders",path:"email_mailing_settings/reminders",component:Jl,meta:{active_menu:"settings",title:u("Reminders"),permission:"store/sensitive"}},{name:"email_digest_settings",path:"email_digest_settings",component:gAe,meta:{active_menu:"settings",title:u("Store Digest"),permission:"store/sensitive"}},{path:"email_notifications/:name/",name:"email_notifications/edit",component:jX,meta:{active_menu:"settings",title:u("Edit Notification"),permission:"store/sensitive"},props:!0},{path:"email_notifications/add",name:"email_notifications/add",component:mZ,meta:{active_menu:"settings",title:u("Add Notification"),permission:"store/sensitive"}},{name:"licensing",path:"licensing",component:tT,meta:{active_menu:"settings",title:u("Licensing"),permission:"store/sensitive"}},{name:"payments",path:"payments",component:H$,meta:{active_menu:"settings",title:u("Payment Settings"),permission:"is_super_admin"}},{name:"gateway",component:hS,path:"payments",children:Ef,props:!0,meta:{active_menu:"settings",title:u("Payment Settings"),permission:"is_super_admin"}},{name:"invoice-packing",path:"invoice-packing",component:kv,meta:{active_menu:"settings",title:u("Invoice & Packing"),permission:"is_super_admin"}},{name:"pdf-template",path:"pdf-template",component:xv,meta:{active_menu:"settings",title:u("PDF Templates"),permission:"is_super_admin"},children:[{name:"pdf-template-list",path:"",component:Nv,meta:{active_menu:"settings",title:u("PDF Templates"),permission:"is_super_admin"}},{name:"pdf-template-settings",path:"settings",component:Fg,meta:{active_menu:"settings",title:u("PDF Template Settings"),permission:"is_super_admin"}},{name:"edit-pdf-template",path:":template/edit",component:rg,props:!0,meta:{active_menu:"settings",title:u("Edit PDF Template"),permission:"is_super_admin"}}]},{name:"roles",path:"roles",component:rE,meta:{active_menu:"settings",title:u("Role Settings"),permission:"is_super_admin"}},{name:"addons",path:"addons",component:Vce,meta:{active_menu:"settings",title:u("Features & addon"),permission:"is_super_admin"}},{name:"coupons",path:"coupons",component:Fc,meta:{active_menu:"coupons",title:u("Coupons Settings"),permission:"is_super_admin"}},{name:"storage",path:"storage",component:iZ,meta:{active_menu:"settings",title:u("Storage Providers"),permission:"is_super_admin"}},{name:"s3",path:"storage/s3",component:wc,props:!0,meta:{active_menu:"settings",title:u("S3"),permission:"is_super_admin"}},{name:"payment-design",path:"payments/:method/design",component:bS,meta:{active_menu:"settings",title:u("Gateway"),permission:"is_super_admin"},props:!0},{name:"drivers",component:wc,path:"storage",children:Uf,props:!0,meta:{active_menu:"settings",title:u("Storage Settings"),permission:"is_super_admin"}},{name:"tax_settings",path:"tax_settings",component:wAe,meta:{active_menu:"settings",title:u("Tax Settings"),permission:"store/settings"},children:[{name:"tax_configurations",path:"",component:Qpe,meta:{}},{name:"tax_rates",path:"tax_rates",component:Ype,meta:{}},{name:"eu",path:"eu",component:C_e,meta:{}},{name:"eu_country_tax_rates",path:"eu/:country/:group",component:Sc,props:!0,meta:{}},{name:"tax-rates-country-single",path:"tax_rates_country_single/:country/:group",component:Sc,props:!0,meta:{}}]}]},integrations:{name:"integrations",path:"/integrations",component:dx,meta:{active_menu:"integrations",title:u("Integrations"),permission:"integrations/view"}},global_feed_editor:{name:"feed_editor",path:"/global_integrations/:integration_id/:integration_name",component:nc,meta:{active_menu:"integrations",title:u("Global Integrations"),permission:"integrations/view"}},integration_editor:{name:"integration_editor",path:"/integrations/:integration_name",component:GS,meta:{active_menu:"integrations",title:u("Integrations"),permission:"integrations/manage"}},coupons:{name:"coupons",path:"/coupons",component:Fc,meta:{active_menu:"coupons",title:u("Coupons"),permission:"coupons/view"}},logs:{name:"logs",path:"/logs",component:aee,meta:{active_menu:"logs",title:u("Logs"),permission:"is_super_admin"}},taxes:{name:"taxes",path:"/taxes",component:wme,meta:{active_menu:"taxes",title:u("Taxes"),permission:"is_super_admin"}},add_or_edit_coupon_route:{name:"add_or_edit_coupon",path:"/coupons/add_or_edit_coupon/:coupon_id?",component:Kve,props:!0,meta:{active_menu:"coupons",title:u("Coupons"),permission:"coupons/manage"}},onboarding:{path:"/onboarding",component:x$,name:"onboarding",meta:{active_menu:"dashboard",title:u("Onboarding"),permission:"is_super_admin"}}};const Zbe={class:"fct-theme-button-container"},e0e={class:"theme-selected-button"},t0e={__name:"ThemeToggle",setup(e){const t=T(Te.MODE_LIGHT),a=c=>{t.value!==c&&(t.value=c,Te.apply(c))},l=[{value:"light",label:u("Light"),icon:"Sun"},{value:"dark",label:u("Dark"),icon:"Moon"},{value:"system",label:u("System"),icon:"Tools"}];Ds(()=>{const c=document.getElementById("theme-button-container");if(c){const p=c.querySelector(".fct-theme-button-container");p&&p.remove()}t.value=Te.getCurrentTheme(),t.value.toString().startsWith(Te.MODE_SYSTEM)&&(t.value=Te.MODE_SYSTEM)});const s=c=>{xe(()=>{t.value=Te.getCurrentTheme()})},i=c=>{a(c)};return Ie(()=>{window.addEventListener(Te.THEME_CHANGE_EVENT,s,!1)}),cl(()=>{window.removeEventListener(Te.THEME_CHANGE_EVENT,s,!1)}),(c,p)=>{const f=C("el-dropdown-item"),_=C("el-dropdown-menu"),g=C("el-dropdown");return r(),h("div",Zbe,[n(g,{placement:"bottom-end",trigger:"click","popper-class":"fct-dropdown",onCommand:i},{dropdown:d(()=>[n(_,null,{default:d(()=>[(r(),h(P,null,te(l,y=>n(f,{key:y.value,command:y.value,class:de({active:t.value===y.value})},{default:d(()=>[n(Y,{name:y.icon},null,8,["name"]),R(" "+m(y.label),1)]),_:2},1032,["command","class"])),64))]),_:1})]),default:d(()=>[o("div",e0e,[t.value==="light"?(r(),E(Y,{key:0,name:"Sun"})):t.value==="dark"?(r(),E(Y,{key:1,name:"Moon"})):t.value==="system"?(r(),E(Y,{key:2,name:"Tools"})):x("",!0)])]),_:1})])}}};function ns(e){return Array.isArray?Array.isArray(e):Df(e)==="[object Array]"}function a0e(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function l0e(e){return e==null?"":a0e(e)}function Hl(e){return typeof e=="string"}function If(e){return typeof e=="number"}function s0e(e){return e===!0||e===!1||n0e(e)&&Df(e)=="[object Boolean]"}function Qf(e){return typeof e=="object"}function n0e(e){return Qf(e)&&e!==null}function hl(e){return e!=null}function Ar(e){return!e.trim().length}function Df(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const o0e="Incorrect 'index' type",i0e=e=>`Invalid value for key ${e}`,r0e=e=>`Pattern length exceeds max of ${e}.`,d0e=e=>`Missing ${e} property in key`,u0e=e=>`Property 'weight' in key '${e}' must be a positive integer`,Dc=Object.prototype.hasOwnProperty;class c0e{constructor(t){this._keys=[],this._keyMap={};let a=0;t.forEach(l=>{let s=Vf(l);this._keys.push(s),this._keyMap[s.id]=s,a+=s.weight}),this._keys.forEach(l=>{l.weight/=a})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Vf(e){let t=null,a=null,l=null,s=1,i=null;if(Hl(e)||ns(e))l=e,t=Vc(e),a=jr(e);else{if(!Dc.call(e,"name"))throw new Error(d0e("name"));const c=e.name;if(l=c,Dc.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(u0e(c));t=Vc(c),a=jr(c),i=e.getFn}return{path:t,id:a,weight:s,src:l,getFn:i}}function Vc(e){return ns(e)?e:e.split(".")}function jr(e){return ns(e)?e.join("."):e}function A0e(e,t){let a=[],l=!1;const s=(i,c,p)=>{if(hl(i))if(!c[p])a.push(i);else{let f=c[p];const _=i[f];if(!hl(_))return;if(p===c.length-1&&(Hl(_)||If(_)||s0e(_)))a.push(l0e(_));else if(ns(_)){l=!0;for(let g=0,y=_.length;g<y;g+=1)s(_[g],c,p+1)}else c.length&&s(_,c,p+1)}};return s(e,Hl(t)?t.split("."):t,0),l?a:a[0]}const p0e={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},f0e={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},m0e={location:0,threshold:.6,distance:100},h0e={useExtendedSearch:!1,getFn:A0e,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var Et={...f0e,...p0e,...m0e,...h0e};const _0e=/[^ ]+/g;function v0e(e=1,t=3){const a=new Map,l=Math.pow(10,t);return{get(s){const i=s.match(_0e).length;if(a.has(i))return a.get(i);const c=1/Math.pow(i,.5*e),p=parseFloat(Math.round(c*l)/l);return a.set(i,p),p},clear(){a.clear()}}}class Md{constructor({getFn:t=Et.getFn,fieldNormWeight:a=Et.fieldNormWeight}={}){this.norm=v0e(a,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((a,l)=>{this._keysMap[a.id]=l})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Hl(this.docs[0])?this.docs.forEach((t,a)=>{this._addString(t,a)}):this.docs.forEach((t,a)=>{this._addObject(t,a)}),this.norm.clear())}add(t){const a=this.size();Hl(t)?this._addString(t,a):this._addObject(t,a)}removeAt(t){this.records.splice(t,1);for(let a=t,l=this.size();a<l;a+=1)this.records[a].i-=1}getValueForItemAtKeyId(t,a){return t[this._keysMap[a]]}size(){return this.records.length}_addString(t,a){if(!hl(t)||Ar(t))return;let l={v:t,i:a,n:this.norm.get(t)};this.records.push(l)}_addObject(t,a){let l={i:a,$:{}};this.keys.forEach((s,i)=>{let c=s.getFn?s.getFn(t):this.getFn(t,s.path);if(hl(c)){if(ns(c)){let p=[];const f=[{nestedArrIndex:-1,value:c}];for(;f.length;){const{nestedArrIndex:_,value:g}=f.pop();if(hl(g))if(Hl(g)&&!Ar(g)){let y={v:g,i:_,n:this.norm.get(g)};p.push(y)}else ns(g)&&g.forEach((y,v)=>{f.push({nestedArrIndex:v,value:y})})}l.$[i]=p}else if(Hl(c)&&!Ar(c)){let p={v:c,n:this.norm.get(c)};l.$[i]=p}}}),this.records.push(l)}toJSON(){return{keys:this.keys,records:this.records}}}function Tf(e,t,{getFn:a=Et.getFn,fieldNormWeight:l=Et.fieldNormWeight}={}){const s=new Md({getFn:a,fieldNormWeight:l});return s.setKeys(e.map(Vf)),s.setSources(t),s.create(),s}function g0e(e,{getFn:t=Et.getFn,fieldNormWeight:a=Et.fieldNormWeight}={}){const{keys:l,records:s}=e,i=new Md({getFn:t,fieldNormWeight:a});return i.setKeys(l),i.setIndexRecords(s),i}function ko(e,{errors:t=0,currentLocation:a=0,expectedLocation:l=0,distance:s=Et.distance,ignoreLocation:i=Et.ignoreLocation}={}){const c=t/e.length;if(i)return c;const p=Math.abs(l-a);return s?c+p/s:p?1:c}function y0e(e=[],t=Et.minMatchCharLength){let a=[],l=-1,s=-1,i=0;for(let c=e.length;i<c;i+=1){let p=e[i];p&&l===-1?l=i:!p&&l!==-1&&(s=i-1,s-l+1>=t&&a.push([l,s]),l=-1)}return e[i-1]&&i-l>=t&&a.push([l,i-1]),a}const Ss=32;function b0e(e,t,a,{location:l=Et.location,distance:s=Et.distance,threshold:i=Et.threshold,findAllMatches:c=Et.findAllMatches,minMatchCharLength:p=Et.minMatchCharLength,includeMatches:f=Et.includeMatches,ignoreLocation:_=Et.ignoreLocation}={}){if(t.length>Ss)throw new Error(r0e(Ss));const g=t.length,y=e.length,v=Math.max(0,Math.min(l,y));let w=i,k=v;const b=p>1||f,S=b?Array(y):[];let $;for(;($=e.indexOf(t,k))>-1;){let V=ko(t,{currentLocation:$,expectedLocation:v,distance:s,ignoreLocation:_});if(w=Math.min(V,w),k=$+g,b){let I=0;for(;I<g;)S[$+I]=1,I+=1}}k=-1;let D=[],F=1,B=g+y;const U=1<<g-1;for(let V=0;V<g;V+=1){let I=0,M=B;for(;I<M;)ko(t,{errors:V,currentLocation:v+M,expectedLocation:v,distance:s,ignoreLocation:_})<=w?I=M:B=M,M=Math.floor((B-I)/2+I);B=M;let O=Math.max(1,v-M+1),L=c?y:Math.min(v+M,y)+g,H=Array(L+2);H[L+1]=(1<<V)-1;for(let W=L;W>=O;W-=1){let G=W-1,Z=a[e.charAt(G)];if(b&&(S[G]=+!!Z),H[W]=(H[W+1]<<1|1)&Z,V&&(H[W]|=(D[W+1]|D[W])<<1|1|D[W+1]),H[W]&U&&(F=ko(t,{errors:V,currentLocation:G,expectedLocation:v,distance:s,ignoreLocation:_}),F<=w)){if(w=F,k=G,k<=v)break;O=Math.max(1,2*v-k)}}if(ko(t,{errors:V+1,currentLocation:v,expectedLocation:v,distance:s,ignoreLocation:_})>w)break;D=H}const Q={isMatch:k>=0,score:Math.max(.001,F)};if(b){const V=y0e(S,p);V.length?f&&(Q.indices=V):Q.isMatch=!1}return Q}function w0e(e){let t={};for(let a=0,l=e.length;a<l;a+=1){const s=e.charAt(a);t[s]=(t[s]||0)|1<<l-a-1}return t}const si=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class Mf{constructor(t,{location:a=Et.location,threshold:l=Et.threshold,distance:s=Et.distance,includeMatches:i=Et.includeMatches,findAllMatches:c=Et.findAllMatches,minMatchCharLength:p=Et.minMatchCharLength,isCaseSensitive:f=Et.isCaseSensitive,ignoreDiacritics:_=Et.ignoreDiacritics,ignoreLocation:g=Et.ignoreLocation}={}){if(this.options={location:a,threshold:l,distance:s,includeMatches:i,findAllMatches:c,minMatchCharLength:p,isCaseSensitive:f,ignoreDiacritics:_,ignoreLocation:g},t=f?t:t.toLowerCase(),t=_?si(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const y=(w,k)=>{this.chunks.push({pattern:w,alphabet:w0e(w),startIndex:k})},v=this.pattern.length;if(v>Ss){let w=0;const k=v%Ss,b=v-k;for(;w<b;)y(this.pattern.substr(w,Ss),w),w+=Ss;if(k){const S=v-Ss;y(this.pattern.substr(S),S)}}else y(this.pattern,0)}searchIn(t){const{isCaseSensitive:a,ignoreDiacritics:l,includeMatches:s}=this.options;if(t=a?t:t.toLowerCase(),t=l?si(t):t,this.pattern===t){let b={isMatch:!0,score:0};return s&&(b.indices=[[0,t.length-1]]),b}const{location:i,distance:c,threshold:p,findAllMatches:f,minMatchCharLength:_,ignoreLocation:g}=this.options;let y=[],v=0,w=!1;this.chunks.forEach(({pattern:b,alphabet:S,startIndex:$})=>{const{isMatch:D,score:F,indices:B}=b0e(t,b,S,{location:i+$,distance:c,threshold:p,findAllMatches:f,minMatchCharLength:_,includeMatches:s,ignoreLocation:g});D&&(w=!0),v+=F,D&&B&&(y=[...y,...B])});let k={isMatch:w,score:w?v/this.chunks.length:1};return w&&s&&(k.indices=y),k}}class Cs{constructor(t){this.pattern=t}static isMultiMatch(t){return Tc(t,this.multiRegex)}static isSingleMatch(t){return Tc(t,this.singleRegex)}search(){}}function Tc(e,t){const a=e.match(t);return a?a[1]:null}class C0e extends Cs{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const a=t===this.pattern;return{isMatch:a,score:a?0:1,indices:[0,this.pattern.length-1]}}}class k0e extends Cs{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const l=t.indexOf(this.pattern)===-1;return{isMatch:l,score:l?0:1,indices:[0,t.length-1]}}}class B0e extends Cs{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const a=t.startsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[0,this.pattern.length-1]}}}class x0e extends Cs{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const a=!t.startsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[0,t.length-1]}}}class S0e extends Cs{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const a=t.endsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class F0e extends Cs{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const a=!t.endsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[0,t.length-1]}}}class Lf extends Cs{constructor(t,{location:a=Et.location,threshold:l=Et.threshold,distance:s=Et.distance,includeMatches:i=Et.includeMatches,findAllMatches:c=Et.findAllMatches,minMatchCharLength:p=Et.minMatchCharLength,isCaseSensitive:f=Et.isCaseSensitive,ignoreDiacritics:_=Et.ignoreDiacritics,ignoreLocation:g=Et.ignoreLocation}={}){super(t),this._bitapSearch=new Mf(t,{location:a,threshold:l,distance:s,includeMatches:i,findAllMatches:c,minMatchCharLength:p,isCaseSensitive:f,ignoreDiacritics:_,ignoreLocation:g})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Rf extends Cs{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let a=0,l;const s=[],i=this.pattern.length;for(;(l=t.indexOf(this.pattern,a))>-1;)a=l+i,s.push([l,a-1]);const c=!!s.length;return{isMatch:c,score:c?0:1,indices:s}}}const qr=[C0e,Rf,B0e,x0e,F0e,S0e,k0e,Lf],Mc=qr.length,$0e=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,E0e="|";function U0e(e,t={}){return e.split(E0e).map(a=>{let l=a.trim().split($0e).filter(i=>i&&!!i.trim()),s=[];for(let i=0,c=l.length;i<c;i+=1){const p=l[i];let f=!1,_=-1;for(;!f&&++_<Mc;){const g=qr[_];let y=g.isMultiMatch(p);y&&(s.push(new g(y,t)),f=!0)}if(!f)for(_=-1;++_<Mc;){const g=qr[_];let y=g.isSingleMatch(p);if(y){s.push(new g(y,t));break}}}return s})}const I0e=new Set([Lf.type,Rf.type]);class Q0e{constructor(t,{isCaseSensitive:a=Et.isCaseSensitive,ignoreDiacritics:l=Et.ignoreDiacritics,includeMatches:s=Et.includeMatches,minMatchCharLength:i=Et.minMatchCharLength,ignoreLocation:c=Et.ignoreLocation,findAllMatches:p=Et.findAllMatches,location:f=Et.location,threshold:_=Et.threshold,distance:g=Et.distance}={}){this.query=null,this.options={isCaseSensitive:a,ignoreDiacritics:l,includeMatches:s,minMatchCharLength:i,findAllMatches:p,ignoreLocation:c,location:f,threshold:_,distance:g},t=a?t:t.toLowerCase(),t=l?si(t):t,this.pattern=t,this.query=U0e(this.pattern,this.options)}static condition(t,a){return a.useExtendedSearch}searchIn(t){const a=this.query;if(!a)return{isMatch:!1,score:1};const{includeMatches:l,isCaseSensitive:s,ignoreDiacritics:i}=this.options;t=s?t:t.toLowerCase(),t=i?si(t):t;let c=0,p=[],f=0;for(let _=0,g=a.length;_<g;_+=1){const y=a[_];p.length=0,c=0;for(let v=0,w=y.length;v<w;v+=1){const k=y[v],{isMatch:b,indices:S,score:$}=k.search(t);if(b){if(c+=1,f+=$,l){const D=k.constructor.type;I0e.has(D)?p=[...p,...S]:p.push(S)}}else{f=0,c=0,p.length=0;break}}if(c){let v={isMatch:!0,score:f/c};return l&&(v.indices=p),v}}return{isMatch:!1,score:1}}}const Yr=[];function D0e(...e){Yr.push(...e)}function Wr(e,t){for(let a=0,l=Yr.length;a<l;a+=1){let s=Yr[a];if(s.condition(e,t))return new s(e,t)}return new Mf(e,t)}const ni={AND:"$and",OR:"$or"},Jr={PATH:"$path",PATTERN:"$val"},Xr=e=>!!(e[ni.AND]||e[ni.OR]),V0e=e=>!!e[Jr.PATH],T0e=e=>!ns(e)&&Qf(e)&&!Xr(e),Lc=e=>({[ni.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Of(e,t,{auto:a=!0}={}){const l=s=>{let i=Object.keys(s);const c=V0e(s);if(!c&&i.length>1&&!Xr(s))return l(Lc(s));if(T0e(s)){const f=c?s[Jr.PATH]:i[0],_=c?s[Jr.PATTERN]:s[f];if(!Hl(_))throw new Error(i0e(f));const g={keyId:jr(f),pattern:_};return a&&(g.searcher=Wr(_,t)),g}let p={children:[],operator:i[0]};return i.forEach(f=>{const _=s[f];ns(_)&&_.forEach(g=>{p.children.push(l(g))})}),p};return Xr(e)||(e=Lc(e)),l(e)}function M0e(e,{ignoreFieldNorm:t=Et.ignoreFieldNorm}){e.forEach(a=>{let l=1;a.matches.forEach(({key:s,norm:i,score:c})=>{const p=s?s.weight:null;l*=Math.pow(c===0&&p?Number.EPSILON:c,(p||1)*(t?1:i))}),a.score=l})}function L0e(e,t){const a=e.matches;t.matches=[],hl(a)&&a.forEach(l=>{if(!hl(l.indices)||!l.indices.length)return;const{indices:s,value:i}=l;let c={indices:s,value:i};l.key&&(c.key=l.key.src),l.idx>-1&&(c.refIndex=l.idx),t.matches.push(c)})}function R0e(e,t){t.score=e.score}function O0e(e,t,{includeMatches:a=Et.includeMatches,includeScore:l=Et.includeScore}={}){const s=[];return a&&s.push(L0e),l&&s.push(R0e),e.map(i=>{const{idx:c}=i,p={item:t[c],refIndex:c};return s.length&&s.forEach(f=>{f(i,p)}),p})}class mn{constructor(t,a={},l){this.options={...Et,...a},this.options.useExtendedSearch,this._keyStore=new c0e(this.options.keys),this.setCollection(t,l)}setCollection(t,a){if(this._docs=t,a&&!(a instanceof Md))throw new Error(o0e);this._myIndex=a||Tf(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){hl(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const a=[];for(let l=0,s=this._docs.length;l<s;l+=1){const i=this._docs[l];t(i,l)&&(this.removeAt(l),l-=1,s-=1,a.push(i))}return a}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:a=-1}={}){const{includeMatches:l,includeScore:s,shouldSort:i,sortFn:c,ignoreFieldNorm:p}=this.options;let f=Hl(t)?Hl(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return M0e(f,{ignoreFieldNorm:p}),i&&f.sort(c),If(a)&&a>-1&&(f=f.slice(0,a)),O0e(f,this._docs,{includeMatches:l,includeScore:s})}_searchStringList(t){const a=Wr(t,this.options),{records:l}=this._myIndex,s=[];return l.forEach(({v:i,i:c,n:p})=>{if(!hl(i))return;const{isMatch:f,score:_,indices:g}=a.searchIn(i);f&&s.push({item:i,idx:c,matches:[{score:_,value:i,norm:p,indices:g}]})}),s}_searchLogical(t){const a=Of(t,this.options),l=(p,f,_)=>{if(!p.children){const{keyId:y,searcher:v}=p,w=this._findMatches({key:this._keyStore.get(y),value:this._myIndex.getValueForItemAtKeyId(f,y),searcher:v});return w&&w.length?[{idx:_,item:f,matches:w}]:[]}const g=[];for(let y=0,v=p.children.length;y<v;y+=1){const w=p.children[y],k=l(w,f,_);if(k.length)g.push(...k);else if(p.operator===ni.AND)return[]}return g},s=this._myIndex.records,i={},c=[];return s.forEach(({$:p,i:f})=>{if(hl(p)){let _=l(a,p,f);_.length&&(i[f]||(i[f]={idx:f,item:p,matches:[]},c.push(i[f])),_.forEach(({matches:g})=>{i[f].matches.push(...g)}))}}),c}_searchObjectList(t){const a=Wr(t,this.options),{keys:l,records:s}=this._myIndex,i=[];return s.forEach(({$:c,i:p})=>{if(!hl(c))return;let f=[];l.forEach((_,g)=>{f.push(...this._findMatches({key:_,value:c[g],searcher:a}))}),f.length&&i.push({idx:p,item:c,matches:f})}),i}_findMatches({key:t,value:a,searcher:l}){if(!hl(a))return[];let s=[];if(ns(a))a.forEach(({v:i,i:c,n:p})=>{if(!hl(i))return;const{isMatch:f,score:_,indices:g}=l.searchIn(i);f&&s.push({score:_,key:t,value:i,idx:c,norm:p,indices:g})});else{const{v:i,n:c}=a,{isMatch:p,score:f,indices:_}=l.searchIn(i);p&&s.push({score:f,key:t,value:i,norm:c,indices:_})}return s}}mn.version="7.1.0";mn.createIndex=Tf;mn.parseIndex=g0e;mn.config=Et;mn.parseQuery=Of;D0e(Q0e);const P0e=(ze.get("payment_routes")||[]).filter(e=>!e.upcoming).map(e=>{const t=e.meta.admin_title||e.meta.title||e.meta.label||e.name;return{title:t,subtitle:u("Manage %1$s",t),path:"/settings/payments/"+e.path}}),H0e=[{title:u("Dashboard"),path:"/"},{title:u("Orders"),path:"/orders"},{title:u("Create Order"),path:"/orders/add"},{title:u("Customers"),path:"/customers"},{title:u("Products"),path:"/products"},{title:u("Product Inventory"),path:"/products/inventory"},{title:u("Bulk Import Products"),path:"/products/bulk-insert"},{title:u("Integrations"),path:"/integrations"},{title:u("Coupons"),path:"/coupons"},{title:u("Logs"),path:"/logs"},{title:u("Taxes"),path:"/taxes"},{title:u("Reports"),path:"/reports/overview"},{title:u("Sales Report"),path:"/reports/sales"},{title:u("Orders Report"),path:"/reports/orders"},{title:u("Revenue Report"),path:"/reports/revenue"},{title:u("Refunds Report"),path:"/reports/refunds"},{title:u("Subscriptions Report"),path:"/reports/subscriptions"},{title:u("Future Renewals Report"),path:"/reports/subscriptions/future-renewals"},{title:u("Product Report"),path:"/reports/products"},{title:u("Customer Report"),path:"/reports/customer"},{title:u("Traffic Sources Report"),path:"/reports/sources"},...P0e],N0e=H0e.map(({title:e,subtitle:t,path:a})=>({title:e,...t?{subtitle:t}:{},data:{type:"action",action:({router:l})=>{l.push({path:a})},show_description:!1}})),K0e=[{title:"Theme",title_resolver:()=>{let t=(Te.isDark()?"dark":"light")==="light"?u("Dark"):u("Light");return u("Change theme to %1$s",t)},data:{type:"action",action:()=>{let t=(Te.isDark()?"dark":"light")==="light"?"dark":"light";Te.apply(t,{fromShortcut:!0})}}}],Rc={"/settings/store-settings":u("Store Setup"),"/settings/store-settings/pages_setup":u("Pages Setup"),"/settings/store-settings/single_product_setup":u("Single Product & Order Setup"),"/settings/store-settings/cart_and_checkout":u("Cart and Checkout"),"/settings/compliance":u("Compliance"),"/settings/store-settings/subscriptions_setup":u("Subscriptions Setup"),"/settings/store-settings/checkout_fields":u("Checkout Fields"),"/settings/store-settings/appearance":u("Appearance"),"/settings/email_notifications":u("Email Notifications"),"/settings/email_mailing_settings":u("Mailing Settings"),"/settings/email_mailing_settings/reminders":u("Reminders"),"/settings/licensing":u("Licensing"),"/settings/payments":u("Payment Settings"),"/settings/invoice-packing":u("Invoice & Packing Slips"),"/settings/pdf-template":u("PDF Templates"),"/settings/roles":u("Role Settings"),"/settings/addons":u("Features & Addons"),"/settings/tax_settings":u("Tax Settings"),"/settings/tax_settings/tax_rates":u("Tax Rates"),"/settings/tax_settings/eu":u("EU VAT Settings"),"/settings/storage":u("Storage Providers"),"/settings/coupons":u("Coupon Settings")};let Pf=[];Object.keys(Rc).forEach(e=>{const t=Rc[e];Pf.push({title:t,data:{type:"action",action:({router:a})=>{a.push({path:e})},description:u("Go to %1$s",t),show_description:!1}})});const G0e=[],z0e={Menu:N0e,Actions:K0e,Settings:Pf,Shortcuts:G0e},Zr=[];Object.entries(z0e).forEach(([e,t])=>{t.forEach((a,l)=>{Zr.push({...a,id:`${e.toString().toLowerCase()}-${l}`,group:[e]})})});const j0e=()=>({shouldSort:!0,threshold:.6,keys:[{name:"title",getFn:e=>e.title},{name:"data.description",getFn:e=>e.data.description},{name:"group",weight:2,getFn:e=>e.group}]}),q0e={class:"navigable-list-container fct-global-search-result-container"},Y0e={key:0,class:"no-results fct-global-search-result-not-found"},W0e={key:1},J0e=["tabindex","onClick","onKeydown"],X0e={__name:"NavigableList",props:{items:{type:Array,required:!0,default:()=>[]},noResultsText:{type:String,default:u("No results found")},onAction:{type:Function,required:!0}},setup(e,{expose:t}){const a=e,l=T(-1),s=td("listContainer"),i=T({}),c=(k,b)=>{b&&(i.value[k]=b)},p=k=>{const b=a.items.length;if(b===0)return;const S=b-1;k==="up"?l.value=l.value<=0?S:l.value-1:k==="down"&&(l.value=l.value>=S?0:l.value+1),f()},f=()=>{const k=s.value,b=i.value[l.value];b&&k&&(b.scrollIntoView({behavior:"smooth",block:"nearest"}),xe(()=>{b.focus()}))},_=k=>{l.value=k,g(k)},g=k=>{k>=0&&k<a.items.length&&a.onAction(a.items[k],k)},y=()=>{l.value=-1};return t({focusList:k=>{k=k??a.items.length-1,k>=0&&(l.value=k,xe(()=>{i.value[k]&&i.value[k].focus()}))},resetSelection:y,performFirstAction:()=>{a.items.length>0?(l.value=0,setTimeout(()=>{g(0)},200)):l.value=-1}}),be(()=>a.items,k=>{y(),k.length>0&&xe(()=>{})},{immediate:!0}),be(l,()=>{}),(k,b)=>(r(),h("div",q0e,[e.items.length===0?(r(),h("div",Y0e,[n(Y,{name:"Empty/GlobalSearch"}),R(" "+m(e.noResultsText),1)])):(r(),h("div",W0e,[o("ul",{ref_key:"listContainer",ref:s,class:"navigable-list fct-global-search-result-list"},[(r(!0),h(P,null,te(e.items,(S,$)=>(r(),h("li",{key:$,ref_for:!0,ref:D=>c($,D),class:de({selected:$===l.value}),tabindex:$,onClick:D=>_($),onKeydown:[b[0]||(b[0]=xa(Ge(D=>p("up"),["prevent"]),["arrow-up"])),b[1]||(b[1]=xa(Ge(D=>p("down"),["prevent"]),["arrow-down"])),xa(D=>g($),["enter"])]},[ga(k.$slots,"default",{item:S,index:$,isSelected:$===l.value},void 0,!0)],42,J0e))),128))],512)]))]))}},ed=nt(X0e,[["__scopeId","data-v-2379fe26"]]),Z0e={class:"fct-search-result-label"},ewe={class:"fct-search-result-title"},twe={key:0,class:"fct-search-result-subtitle"},awe={key:1,class:"fct-search-result-subtitle"},lwe={class:"action-icon"},swe={class:"recent-search-title"},nwe={class:"fct-search-result-label"},owe={class:"fct-search-result-title"},iwe={key:0,class:"fct-search-result-subtitle"},rwe={key:1,class:"fct-search-result-subtitle"},dwe={class:"action-icon"},pr="recent_actions",uwe={__name:"ResultList",props:{query:{type:String,required:!0},searchResults:{type:Array,required:!0,default:()=>[]},onActionPerformed:{type:Function,required:!0},focusInput:{type:Function,required:!0},searchData:{type:Array,required:!0,default:()=>[]}},setup(e,{expose:t}){const a=sl();Jt().ctx;const l=e,s=T(0),i=T({}),c=T(),p=(S,$)=>{const F=S.item.data,B=_(F.type);if(B==="link"){let U=_(F.url);_(F.new_tab)?window.open(U,"_blank"):window.location.href=U}else B==="action"&&_(F.action);f(S),l.onActionPerformed()},f=S=>{const $=S.item.id;let D=Vt.get(pr)||[];D=D.filter(F=>F!==$),D.unshift($),D=D.slice(0,5),Vt.set(pr,D)},_=S=>typeof S=="function"?g(S):S,g=async S=>await S({query:l.query,router:a}),y=()=>{var S;(S=c.value)==null||S.resetSelection()},v=()=>{var S;(S=c.value)==null||S.focusList(0)},w=()=>{var S;(S=c.value)==null||S.performFirstAction()};be(()=>l.searchResults,async()=>{i.value={},i.value=l.searchResults??{},s.value=Object.keys(i.value).length-1;let S=i.value;for(const $ of Object.keys(S)){const D=S[$];D.item.title_resolver&&(S[$].item.title=await _(D.item.title_resolver))}i.value={...S}});const k=T([]),b=async()=>{const S=Vt.get(pr)||[];let $=dt.whereIn(l.searchData,"id",S),D=[];for(const F of $)typeof F.title_resolver=="function"&&(F.title=await _(F.title_resolver)),D.push({item:F});k.value=D};return Ie(()=>{b()}),t({focusList:v,resetSelection:y,performFirstAction:w,fetchRecentActions:b}),(S,$)=>(r(),h(P,null,[e.query||k.value.length<1?(r(),E(ed,{key:0,items:e.searchResults,"on-action":p,"no-results-text":A(u)("No matches found"),ref_key:"navigableList",ref:c},{default:d(({item:D,index:F,isSelected:B})=>{var U,Q,V;return[o("span",Z0e,[o("span",ewe,m(D.item.title),1),(U=D.item)!=null&&U.subtitle?(r(),h("span",twe,m(D.item.subtitle),1)):((V=(Q=D.item)==null?void 0:Q.data)==null?void 0:V.show_description)===!0?(r(),h("span",awe,m(D.item.data.description),1)):x("",!0)]),o("div",lwe,[n(Y,{name:"Enter"})])]}),_:1},8,["items","no-results-text"])):x("",!0),!e.query&&k.value.length>0?(r(),h(P,{key:1},[o("span",swe,m(A(u)("Recent Actions")),1),n(ed,{items:k.value,"on-action":p,"no-results-text":A(u)("No matches found"),ref_key:"navigableList",ref:c},{default:d(({item:D,index:F,isSelected:B})=>{var U,Q,V;return[o("span",nwe,[o("span",owe,m(D.item.title),1),(U=D.item)!=null&&U.subtitle?(r(),h("span",iwe,m(D.item.subtitle),1)):((V=(Q=D.item)==null?void 0:Q.data)==null?void 0:V.show_description)===!0?(r(),h("span",rwe,m(D.item.data.description),1)):x("",!0)]),o("div",dwe,[n(Y,{name:"Enter"})])]}),_:1},8,["items","no-results-text"])],64)):x("",!0)],64))}},cwe=nt(uwe,[["__scopeId","data-v-ccb0ebef"]]),Awe={class:"fct-global-search-product-wrap"},pwe={class:"fct-global-search-product-left-info"},fwe={key:0,class:"type"},mwe={key:0,class:"price-and-status"},hwe={__name:"Product",props:{product:{type:Object,required:!0}},setup(e){const t=l=>l.min_price===l.max_price?Kt(l.min_price,!0):`${Kt(l.min_price,!0)} - ${Kt(l.max_price,!0)}`,a=l=>l==="publish"?u("published"):l==="future"?u("scheduled"):l;return(l,s)=>(r(),h("div",Awe,[o("div",pwe,[n(id,{product:e.product},null,8,["product"]),e.product.detail?(r(),h("span",fwe,[R(m(A(da).headline(e.product.detail.variation_type))+" ",1),s[0]||(s[0]=o("br",null,null,-1)),R(" "+m(A(da).headline(e.product.detail.fulfillment_type)),1)])):x("",!0)]),e.product.detail?(r(),h("span",mwe,[R(m(t(e.product.detail))+" ",1),(r(),E(fa,{key:e.product.ID,status:e.product.post_status},{default:d(()=>[R(m(a(e.product.post_status)),1)]),_:1},8,["status"]))])):x("",!0)]))}},_we={class:"fct-global-search-order-wrap"},vwe={class:"fct-global-search-order-header"},gwe={class:"fct-global-search-order-id"},ywe={class:"items"},bwe={class:"fct-global-search-order-header-meta"},wwe={class:"date"},Cwe=["innerHTML"],kwe={class:"customer-name"},Bwe={class:"fct-global-search-order-status-wrapper"},xwe=["src","alt"],Swe={__name:"Order",props:{order:{type:Object,required:!0}},setup(e){const t=a=>dt.get(window,"fluentCartAdminApp.payment_logos."+a);return(a,l)=>{var i;const s=C("el-tag");return r(),h("div",_we,[o("div",vwe,[o("div",gwe,[R(" #"+m(e.order.id)+" ",1),o("span",ywe,m(A(u)("%s Items",e.order.order_items.length)),1)]),o("div",bwe,[o("span",wwe,[n(Pa,{"date-time":e.order.created_at},null,8,["date-time"])]),l[0]||(l[0]=o("span",{class:"circle"},null,-1)),o("span",{class:"total-price",innerHTML:A(Kt)(e.order.total_amount,!0,!1,e.order.currency)},null,8,Cwe),l[1]||(l[1]=o("span",{class:"circle"},null,-1)),o("span",kwe,m(((i=e.order.customer)==null?void 0:i.full_name)||A(u)("No Name")),1)])]),o("div",Bwe,[n(fa,{status:e.order.payment_status,"hide-icon":!0},null,8,["status"]),t(e.order.payment_method)?(r(),h("img",{key:0,src:t(e.order.payment_method),alt:A(da).headline(e.order.payment_method)},null,8,xwe)):(r(),E(s,{key:1,type:"info",round:"",size:"small",class:"capitalize"},{default:d(()=>[R(m(A(da).headline(e.order.payment_method)),1)]),_:1}))])])}}},Fwe={class:"fct-global-search-customer-wrap"},$we={class:"fct-customer-card"},Ewe={class:"fct-customer-avatar"},Uwe=["src"],Iwe={class:"fct-customer-details"},Qwe={class:"fct-customer-name"},Dwe={class:"fct-customer-id"},Vwe={class:"fct-customer-email"},Twe={class:"purchase-count"},Mwe={class:"date"},Lwe={__name:"Customer",props:{customer:{type:Object,required:!0}},setup(e){return(t,a)=>(r(),h("div",Fwe,[o("div",$we,[o("div",Ewe,[o("img",{src:e.customer.photo,alt:"avatar"},null,8,Uwe)]),o("div",Iwe,[o("div",Qwe,[R(m(e.customer.full_name||t.$t("No Name"))+" ",1),o("span",Dwe,"#"+m(e.customer.id),1)]),o("div",Vwe,[R(m(e.customer.email)+" ",1),a[0]||(a[0]=o("span",{class:"circle"},null,-1)),a[1]||(a[1]=R()),o("span",Twe,"Purchase: "+m(e.customer.purchase_count),1)])])]),o("span",Mwe,[n(Pa,{"date-time":e.customer.last_purchase_date},null,8,["date-time"])])]))}},Rwe={class:"fct-global-search-coupon-wrap"},Owe={class:"amount"},Pwe={__name:"Coupon",props:{coupon:{type:Object,required:!0}},setup(e){return(t,a)=>(r(),h("div",Rwe,[o("span",null,m(e.coupon.title),1),o("span",null,m(e.coupon.code),1),o("span",Owe,m(A(Kt)(e.coupon.amount,!0)),1)]))}},Hwe={class:"fct-global-remote-result-container"},Nwe={class:"fct-global-remote-result-label"},Kwe={class:"text"},Gwe={class:"navigable-content"},zwe={class:"action-icon"},jwe={__name:"RemoteResult",emits:["close-modal","onRemoteSearchStateChange"],setup(e,{expose:t,emit:a}){const l=a,s=sl(),i=T({}),c=T(""),p=T(),f=T({}),_=T([]),g=V=>{y.value=!1,_.value=S.data.tableData,l("onRemoteSearchStateChange",!1)},y=T(!1),v={orders:_A({fetch:!1}),products:tf({fetch:!1}),customers:hA({fetch:!1}),coupons:kf({fetch:!1})},w=()=>{},k=()=>{var V;(V=p.value)==null||V.focusList(0)},b=()=>{var V;(V=p.value)==null||V.performFirstAction()};Ds(()=>{for(const V of Object.keys(v))v[V].onDataLoaded(g)});let S=null;const $=()=>{S=v[i.value.key],S.data.search=c.value,y.value=!0,S.fetch(),l("onRemoteSearchStateChange",!0)},D=cd.debounce($,800),F=(V,I)=>{if(_.value=[],S&&(S.data.search=""),i.value=I,f.value={title:I.title,key:I.key},!V){c.value="";return}c.value=V,D()},B=()=>{s.push({name:f.value.key,query:{search:c.value}}),l("close-modal")},U={orders:{name:"view_order",key:"order_id"},products:{name:"product_edit",key:"product_id"},customers:{name:"view_customer",key:"customer_id"},coupons:{name:"edit_coupon",key:"coupon_id"}},Q=V=>{i.value.key in U&&(s.push({name:U[i.value.key].name,params:{[U[i.value.key].key]:V.id||V.ID,action:"edit"}}),l("close-modal"))};return t({fetchData:F,focusList:k,resetSelection:w,performFirstAction:b}),(V,I)=>(r(),h("div",Hwe,[o("div",Nwe,[o("span",Kwe,m(i.value.title),1),f.value.key?(r(),h("span",{key:0,class:"view-all",onClick:B},m(c.value?A(u)('Search "%1$s" in %2$s',c.value,f.value.title):A(u)("See All %s",f.value.title)),1)):x("",!0)]),n(ed,{items:_.value,"on-action":M=>{Q(M)},"no-results-text":c.value?A(u)("No matches found for %s",i.value.title):A(u)("Type something to find %s",i.value.title),ref_key:"navigableList",ref:p},{default:d(({item:M,index:O,isSelected:L})=>[o("div",Gwe,[i.value.key==="products"?(r(),E(hwe,{key:0,product:M},null,8,["product"])):x("",!0),i.value.key==="orders"?(r(),E(Swe,{key:1,order:M},null,8,["order"])):x("",!0),i.value.key==="customers"?(r(),E(Lwe,{key:2,customer:M},null,8,["customer"])):x("",!0),i.value.key==="coupons"?(r(),E(Pwe,{key:3,coupon:M},null,8,["coupon"])):x("",!0)]),o("div",zwe,[n(Y,{name:"Enter"})])]),_:1},8,["items","on-action","no-results-text"])]))}},qwe={class:"fct-global-search-input-wrap"},Ywe=["aria-label"],Wwe={class:"fct-setting-search-icon"},Jwe={class:"fct-global-search-input-container"},Xwe={key:0,class:"searched-item"},Zwe={class:"fct-global-searching-for"},eCe={class:"fct-global-searching-for-label"},tCe={class:"fct-global-searching-suggestion-list"},aCe=["onClick"],lCe={class:"dialog-footer is-border"},sCe={class:"fct-search-commands"},nCe={class:"command-key"},oCe={class:"command-key"},iCe={class:"label"},rCe={class:"command-key"},dCe={class:"label"},uCe={class:"label"},cCe={__name:"GlobalSearch",setup(e){Jt().ctx,sl();const t=T(!1),a=T(""),l=T({}),s=T(),i=T(""),c=T([u("orders"),u("products"),u("customers"),u("coupons"),u("settings"),u("menus"),u("shortcuts...")]),p=T(0),f=T(!0),_=T(0),g=T(null),y=T(null),v=T(70),w=T(40),k=T(1700),b=()=>{xe(()=>{$()})},S=()=>{var ie,J;Q.value?(ie=W.value)==null||ie.resetSelection():(J=F.value)==null||J.resetSelection(),Q.value=!1,H.value=!1,D()},$=()=>{var ie;(ie=s.value)==null||ie.focus()},D=()=>{Q.value=!1,l.value=[],t.value=!1,a.value="",V.value=null},F=T(),B=ie=>{let J=ie.includes(","),N={},ae=[];(J?ie.split(","):[ie]).forEach(re=>{re.includes(":")?U(re,N,ae):ae.push(re)});let fe=[];return Object.keys(N).forEach(re=>{const Ee=N[re];Ee.length>0?Ee.forEach(ye=>{ye.length>0?fe.push({group:"'"+re,title:ye}):fe.push({group:"'"+re})}):fe.push({group:"'"+re})}),ae.forEach(re=>{re.length>0&&fe.push({title:re})}),fe},U=(ie,J,N)=>{if(ie.length===1)return;let ae=ie.split(":"),oe=ae[0],fe=ae[1];oe.length>0?(J.hasOwnProperty(oe)||(J[oe]=[]),fe.length>0&&J[oe].push(fe)):N.push(fe)},Q=T(!1),V=T(null),I=T({o:{key:"orders",title:u("Orders")},p:{key:"products",title:u("Products")},c:{key:"customers",title:u("Customers")},d:{key:"coupons",title:u("Coupons")}}),M=ie=>{V.value=ie,Q.value=!0,l.value={},xe(()=>{var J,N;(J=W.value)==null||J.fetchData(a.value,ie),(N=s.value)==null||N.focus()})},O=()=>{var ie;l.value=[],V.value=null,a.value="",Q.value=!1,(ie=s.value)==null||ie.focus(),H.value=!1},L=()=>{var ie;(ie=W.value)==null||ie.fetchData(a.value,V.value)},H=T(!1),j=ie=>{H.value=ie,xe(()=>{var J;(J=s.value)==null||J.focus()})},W=T(),G=bs(),Z=()=>{if(t.value){$();return}const ie=["o","p","c","d"];G.bind(ie,J=>{J.preventDefault();const N=I.value[J.key];N&&M(N)}),t.value=!0,xe(()=>{var J;(J=F.value)==null||J.fetchRecentActions()}),setTimeout(()=>{G.unbind(ie)},800)};G.bind(["/"],ie=>{!t.value&&ne()||(ie.preventDefault(),Z())});const ne=()=>{const ie=document.activeElement;if(!ie)return!1;const J=ie.tagName;return J==="INPUT"||J==="TEXTAREA"||J==="SELECT"||ie.isContentEditable},ce=()=>{if(g.value)return;const ie=()=>{if(s.value&&s.value.length>0)return;const N=c.value[p.value];if(f.value)_.value<N.length?(i.value=N.slice(0,_.value+1),_.value++):(f.value=!1,clearTimeout(y.value),y.value=setTimeout(()=>{y.value=null},k.value));else{if(y.value)return;_.value>0?(_.value--,i.value=N.slice(0,_.value)):(f.value=!0,p.value=(p.value+1)%c.value.length)}},J=()=>{ie();const N=f.value?v.value:y.value?120:w.value;g.value=setTimeout(J,N)};J()},z=T(!1);let ue;return Ie(()=>{ce(),ue=new mn(Zr,j0e());const ie=document.getElementById("fct_admin_menu_search");if(ie){const J=ie.querySelector(".fct-global-search-input-wrap");J&&J.remove()}z.value=!!ie,window.fluentCart=window.fluentCart||{},window.fluentCart.openSearch=Z}),Bt(()=>{window.fluentCart&&delete window.fluentCart.openSearch}),(ie,J)=>{const N=C("el-input"),ae=C("el-dialog");return r(),h(P,null,[z.value?(r(),E(ii,{key:0,to:"#fct_admin_menu_search"},[o("div",qwe,[o("button",{onClick:Z,type:"button",class:"fct-setting-search-button","aria-label":A(u)("Search")},[o("span",Wwe,[n(Y,{name:"Search"})]),J[6]||(J[6]=o("span",{class:"fct-global-search-button-keys"},[o("kbd",{class:"fct-global-search-button-key"},"/")],-1))],8,Ywe)])])):x("",!0),n(ae,{modelValue:t.value,"onUpdate:modelValue":J[5]||(J[5]=oe=>t.value=oe),onOpened:b,onClosed:S,class:"fct-global-search-container","append-to-body":!0},{header:d(()=>[o("div",Jwe,[n(Y,{name:"Search",class:"search-icon"}),V.value!=null?(r(),h("div",Xwe,[R(m(V.value.title)+" ",1),n(Y,{name:"Cross",class:"searched-item-remove",onClick:O})])):x("",!0),n(N,{class:"mousetrap",placeholder:A(u)("Search for %1$s",i.value),autofocus:"",ref_key:"searchRef",ref:s,id:"fct-global-search-input",disabled:H.value,onKeydown:[J[0]||(J[0]=xa(Ge(()=>{var oe,fe;if(Q.value){(oe=W.value)==null||oe.focusList();return}(fe=F.value)==null||fe.focusList()},["prevent"]),["arrow-down"])),J[1]||(J[1]=xa(Ge(()=>{var oe,fe;if(Q.value){(oe=W.value)==null||oe.performFirstAction();return}(fe=F.value)==null||fe.performFirstAction()},["prevent"]),["enter"])),J[2]||(J[2]=xa(()=>{a.value.length===0&&(V.value=null,Q.value=!1)},["backspace"]))],onInput:J[3]||(J[3]=()=>{if(Q.value){L();return}let oe=a.value.includes(","),fe=a.value.includes(":");if(!oe&&!fe)l.value.value=A(ue).search(a.value);else{const re=B(a.value);l.value.value=A(ue).search({$or:re})}}),modelValue:a.value,"onUpdate:modelValue":J[4]||(J[4]=oe=>a.value=oe),clearable:""},null,8,["placeholder","disabled","modelValue"])])]),default:d(()=>[n(ya,{visible:!V.value&&a.value.length===0,accordion:""},{default:d(()=>[o("div",Zwe,[o("div",eCe,m(A(u)("Searching for")),1),o("div",tCe,[(r(!0),h(P,null,te(I.value,oe=>{var fe;return r(),h("div",{key:oe.key,onClick:re=>M(oe),class:de(["fct-global-searching-suggestion",((fe=V.value)==null?void 0:fe.key)===oe.key?"active":""])},m(oe.title),11,aCe)}),128))])])]),_:1},8,["visible"]),Q.value?(r(),E(jwe,{key:0,ref_key:"remoteResultRef",ref:W,query:a.value,tag:V.value,onCloseModal:D,onOnRemoteSearchStateChange:j},null,8,["query","tag"])):(r(),E(cwe,{key:1,ref_key:"resultListRef",ref:F,query:a.value,"search-results":l.value.value,onActionPerformed:D,focusInput:$,searchData:A(Zr)},null,8,["query","search-results","searchData"])),o("div",lCe,[o("ul",sCe,[o("li",null,[o("span",nCe,[n(Y,{name:"ArrowUp"})]),o("span",oCe,[n(Y,{name:"ArrowDown"})]),o("span",iCe,m(A(u)("To navigate")),1)]),o("li",null,[o("span",rCe,[n(Y,{name:"Enter"})]),o("span",dCe,m(A(u)("To select")),1)]),o("li",null,[J[7]||(J[7]=o("kbd",{class:"command-key"},"esc",-1)),o("span",uCe,m(A(u)("To close")),1)])])])]),_:1},8,["modelValue"])],64)}}},ACe={class:"fl_app fluent-cart-admin-pages"},pCe=Object.assign({name:"DashboardApplication"},{__name:"Application",setup(e){const t=T("");Ie(()=>{jQuery(".notice:not(.fluent-cart), .error:not(.fluent-cart), #ehp-admin-cb").remove(),t.value=a(),l.value=!!document.getElementById("theme-button-container");const c=document.querySelector(".fct_admin_menu_wrap"),p=()=>{window.scrollY>10?c==null||c.classList.add("scroll-header"):c==null||c.classList.remove("scroll-header")};window.addEventListener("scroll",p)});const a=()=>window.location.href,l=T(!1),s=nl();be(()=>s.fullPath,()=>{t.value=a()});const i=K(()=>!(s.fullPath.includes("reports")||s.fullPath.includes("settings")));return(c,p)=>{const f=C("router-view");return r(),h("div",null,[n(cCe),i.value?(r(),E(Ia,{key:0})):x("",!0),o("div",ACe,[n(f)]),l.value?(r(),E(ii,{key:1,to:"#theme-button-container"},[n(t0e)])):x("",!0)])}}});let Oc=!1;function fCe(e){return{data:function(){return{appVars:window.fluentCartAdminApp}},methods:{$get:Ae.get,$post:Ae.post,$put:Ae.put,$del:Ae.delete,$t:u,$n:Io,formatMoney(t,a,l=!1){return!t&&l?"":(t||(t="0.00"),ze.get("shop.currency_sign")+" "+t)},formatCents(t,a,l=!1){return!t&&l?"":(t?t=(t*100).toFixed(2):t="0.00",a?(t=new Intl.NumberFormat("en-US").format(t),ze.get("shop.currency_sign")+" "+t):t)},formatNumber(t,a=!0,l=!1,s){return ft.formatNumber(t,a,l,s)},formatNumberForOrder(t,a,l=!0,s=!1){return ft.formatForOrder(t,a,l,s)},getAddress(t,a="billing"){let l=[t[a+"_address_1"],t[a+"_address_2"],t[a+"_city"],t[a+"_city"],t[a+"_state"],t[a+"_zip"],t[a+"_country"]];return l=l.filter(s=>!!s).join(", "),l||"no "+a+" address"},getOrderAddress(t,a="billing",l=!1){return xm(t,a,l)},changeTitle(t){jQuery("head title").text(t+" - FluentCart")},handleError(t){if(!t)return;let a="";typeof t=="string"?a=t:t&&t.message?a=t.message:a=t,typeof t=="object"&&(a=this.convertToText(t)),a||(a="Something is wrong!"),this.$notify({type:"error",title:"Error",message:a,dangerouslyUseHTMLString:!0})},convertToText(t){const a=[];if(typeof t=="object"&&t.join===void 0)for(const l in t)a.push(this.convertToText(t[l]));else if(typeof t=="object"&&t.join!==void 0)for(const l in t)a.push(this.convertToText(t[l]));else typeof t=="function"||typeof t=="string"&&a.push(t);return a.join("<br />")},handleSuccess:t=>{q.success(t)},handleMessage:(t,a="info",l=40,s=1e3)=>{qc.show(t,a,l,s)},Storage:()=>Vt,buildFormRendererValue(t,a){let l={};return Object.keys(t).forEach(s=>{let i=t[s];["grid"].includes(i.type??"")?l[s]=this.buildFormRendererValue(i.schema??{},a[s]??{}):l[s]=a[s]??""}),l},registerCopyAction(){Oc||(Oc=!0,document.addEventListener("click",t=>{t.target.matches(".copyable-content")&&as.copy(t.target.textContent)}))},currencySign(){return ze.get("shop.currency_sign")},getPlaceholderImage(){return gs.getUrl("images/placeholder.svg")},saveLocal(t,a){Vt.set(t,a)},getLocal(t){return Vt.get(t)},hasPermission(t){return Vn.hasPermission(t)}}}}function mCe(e){e.beforeEach((t,a,l)=>{const s=dt.get(t,"meta.permission");return s?Vn.resolve({permission:s,permissionType:dt.get(t,"meta.permissionType")})?l():l({name:"unauthorized"}):(ze.get("app_config.env"),l())})}function hCe(e){const t={fluent_cart_products:["fluent_cart_inventory","fluent_cart_attributes"]},a=l=>{if(!l)return;const s="fluent_cart_"+l;Object.entries(t).forEach(([i,c])=>{const p=s===i;c.forEach(f=>{const _=jQuery(".toplevel_page_fluent-cart li."+f);p?_.show():_.hide()})})};e.afterEach((l,s)=>{const i=l.meta.active_menu;jQuery(".fct_menu li").removeClass("active_admin_menu"),jQuery(".fct_menu li.fct_menu_item_"+i).addClass("active_admin_menu"),jQuery(".toplevel_page_fluent-cart li").removeClass("current"),jQuery(".toplevel_page_fluent-cart li.fluent_cart_"+i).addClass("current"),a(i),l.meta.title&&jQuery("head title").text(l.meta.title+" - FluentCart")})}const _Ce={mounted(e,t){const a=t.value,l=1e3,s=0,i=performance.now(),c=()=>{const p=performance.now()-i,f=Math.min(p/l,1),_=(s+f*(a-s)).toFixed(2);e.textContent=_,f<1&&requestAnimationFrame(c)};c()},updated(e,t){const a=t.value,l=2e3,s=0,i=performance.now(),c=()=>{const p=performance.now()-i,f=Math.min(p/l,1),_=(s+f*(a-s)).toFixed(2);e.textContent=_,f<1&&requestAnimationFrame(c)};c()}},vCe={__name:"Unauthorized",setup(e){return(t,a)=>(r(),h("span",null,m(A(u)("You are not allowed")),1))}},gCe=window.fluent_cart_admin.hooks.applyFilters("fluent_cart_routes",Xbe);let Pc=!1;document.addEventListener("fcart_renew_rest_nonce",function(e){Pc||Fl.alert(u("Your session has expired due to inactivity. Please refresh the page to continue."),u("Session Expired"),{confirmButtonText:u("Reload"),callback:t=>{Pc=!1,window.location.reload()}})});const yCe=[rm,dm,um,Wc,cm,ld,Am,pm,sd,fm,mm,Xc],ql=Zf(pCe);ql.config.globalProperties.appVars=ze.get();ql.provide("appVars",ze.get());ql.mixin(fCe());ql.directive("loading",Um);ql.directive("animate",_Ce);Xm(ql);const Ld=em({routes:[...Object.values(gCe),{path:"/unauthorized",name:"unauthorized",component:vCe,props:!0},{path:"/:path(.*)*",name:"NotFound",component:ci,props:!0}],history:tm(),scrollBehavior(e,t,a){return a||{top:0,behavior:"smooth"}}});ql.use(Ld);mCe(Ld);hCe(Ld);yCe.forEach(e=>{ql.component(e.name,e)});const Rd=ze.get("el_strings"),Hf=ze.get("datei18");Rd.el.datepicker.weeks=Hf.weekdaysShort;Rd.el.datepicker.months=Hf.monthsShort;ql.use(Im,{locale:Rd});ql.mount("#fluent_cart_plugin_app");if(ze.get("has_data_migrations")){let e=0;const t=()=>{Ae.post("data-backfills/run").then(a=>{a&&a.status==="running"&&++e<100&&t()}).catch(()=>{})};t()}export{jn as E,kd as _};