| Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/ |
| Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/Subscription-9fcc5746.js |
import{r as x,T as $,h as k,f as C,o as _,a as e,t as l,e as n,u as s,n as m,c as v,g as B}from"./app-43851608.js";import U from"./App-2fea9171.js";import{_ as d}from"./FormInput-4a309017.js";import{_ as A}from"./FormToggleSwitch-1780efa4.js";import"./App-ad5f7ecb.js";import"./Sidebar-7bb6d772.js";import"./Menu-4221d61f.js";import"./ProfileModal-628e5b7c.js";import"./LangToggle-8d05b0dc.js";import"./MobileSidebar-b73cd192.js";import"./index-99011d5f.js";/* empty css */import"./Sidebar-7b5bc85b.js";const S={class:"text-xl mb-1"},Z={class:"mb-6 flex items-center text-sm leading-6 text-gray-600"},M=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},[e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 11v5m0 5a9 9 0 1 1 0-18a9 9 0 0 1 0 18Zm.05-13v.1h-.1V8h.1Z"})],-1),j={class:"ml-1 mt-1"},N={class:"space-y-12"},T={class:"pb-12"},z={class:"pt-5"},D={class:"flex gap-x-10 md:w-2/3 pb-6 border-b mb-4"},E={class:"w-[80%]"},F={class:"text-xs text-slate-700 flex items-center"},O={class:"w-[20%]"},q={class:"grid gap-3 grid-cols-2 pb-6 md:w-2/3 border-b mb-4"},J={class:"col-span-2 text-xs"},K={class:"mb-4"},L={class:"text-base text-gray-900"},P={class:"text-sm leading-6 mb-5"},R={class:"bg-orange-100 p-2 rounded-md shadow-sm md:w-2/3 mb-4 flex items-center gap-x-1"},G=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},[e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 11v5m0 5a9 9 0 1 1 0-18a9 9 0 0 1 0 18Zm.05-13v.1h-.1V8h.1Z"})],-1),H={class:"text-sm leading-6"},I={class:"grid gap-3 grid-cols-2 pb-6 border-b md:w-2/3"},Q={class:"mt-6 flex items-center justify-end gap-x-6 md:w-2/3"},W={type:"button",class:"text-sm leading-6 text-gray-900"},X=["disabled"],Y={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},ee=e("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:".5"},null,-1),te=e("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"},[e("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})],-1),se=[ee,te],oe={key:1},he={__name:"Subscription",props:{config:{type:Object,required:!0}},setup(y){const w=y,p=a=>{const o=w.config.find(u=>u.key===a);return o?o.value:""},r=p("trial_limits")?JSON.parse(p("trial_limits")):{},c=x(!1),t=$({enable_custom_payment:p("enable_custom_payment")==1||p("enable_custom_payment")=="",trial_period:p("trial_period"),trial_limits:{users:(r==null?void 0:r.users)??"-1",messages:(r==null?void 0:r.messages)??"-1",contacts:(r==null?void 0:r.contacts)??"-1",campaigns:(r==null?void 0:r.campaigns)??"-1",automated_replies:(r==null?void 0:r.automated_replies)??"-1"}}),V=async()=>{t.put("/admin/settings?type=subscription",{preserveScroll:!0})};return(a,o)=>(_(),k(U,null,{default:C(()=>{var u,g,b,h,f;return[e("div",null,[e("h2",S,l(a.$t("Subscription settings")),1),e("p",Z,[M,e("span",j,l(a.$t("Configure how your subscriptions are set")),1)])]),e("form",{onSubmit:o[7]||(o[7]=B(i=>V(),["prevent"]))},[e("div",N,[e("div",T,[e("div",z,[e("div",D,[e("div",E,[e("span",null,l(a.$t("Enable custom payment amounts")),1),e("div",F,[e("span",null,l(a.$t("Allow users to make custom payments that can be applied to their subscription fees automatically.")),1)])]),e("div",O,[n(A,{modelValue:s(t).enable_custom_payment,"onUpdate:modelValue":o[0]||(o[0]=i=>s(t).enable_custom_payment=i),class:"float-right"},null,8,["modelValue"])])])]),e("div",q,[n(d,{modelValue:s(t).trial_period,"onUpdate:modelValue":o[1]||(o[1]=i=>s(t).trial_period=i),name:a.$t("Trial period (in days)"),error:s(t).errors.trial_period,type:"number",class:m("col-span-2")},null,8,["modelValue","name","error"]),e("span",J,l(a.$t("Please note that if you put zero then the user will be prompted to first subscribe before using the app")),1)]),e("div",K,[e("h2",L,l(a.$t("Trial period limits")),1),e("p",P,l(a.$t("Define the usage limits during the trial period")),1)]),e("div",R,[G,e("p",H,l(a.$t("For unlimited usage, set -1 as the value")),1)]),e("div",I,[n(d,{modelValue:s(t).trial_limits.messages,"onUpdate:modelValue":o[2]||(o[2]=i=>s(t).trial_limits.messages=i),name:a.$t("Message limit"),error:(u=s(t).errors)==null?void 0:u["trial_limits.messages"],type:"number",class:m("col-span-1")},null,8,["modelValue","name","error"]),n(d,{modelValue:s(t).trial_limits.campaigns,"onUpdate:modelValue":o[3]||(o[3]=i=>s(t).trial_limits.campaigns=i),name:a.$t("Campaign limit"),error:(g=s(t).errors)==null?void 0:g["trial_limits.campaigns"],type:"number",class:m("col-span-1")},null,8,["modelValue","name","error"]),n(d,{modelValue:s(t).trial_limits.contacts,"onUpdate:modelValue":o[4]||(o[4]=i=>s(t).trial_limits.contacts=i),name:a.$t("Contacts limit"),error:(b=s(t).errors)==null?void 0:b["trial_limits.contacts"],type:"number",class:m("col-span-1")},null,8,["modelValue","name","error"]),n(d,{modelValue:s(t).trial_limits.automated_replies,"onUpdate:modelValue":o[5]||(o[5]=i=>s(t).trial_limits.automated_replies=i),name:a.$t("Automated Replies limit"),error:(h=s(t).errors)==null?void 0:h["trial_limits.automated_replies"],type:"number",class:m("col-span-1")},null,8,["modelValue","name","error"]),n(d,{modelValue:s(t).trial_limits.users,"onUpdate:modelValue":o[6]||(o[6]=i=>s(t).trial_limits.users=i),name:a.$t("User limit"),error:(f=s(t).errors)==null?void 0:f["trial_limits.users"],type:"number",class:m("col-span-1")},null,8,["modelValue","name","error"])]),e("div",Q,[e("button",W,l(a.$t("Cancel")),1),e("button",{class:m(["inline-flex justify-center rounded-md border border-transparent bg-primary px-4 py-2 text-sm text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",{"opacity-50":c.value}]),disabled:c.value},[c.value?(_(),v("svg",Y,se)):(_(),v("span",oe,l(a.$t("Save")),1))],10,X)])])])],32)]}),_:1}))}};export{he as default};