| Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/ |
| Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/Show-42d40f26.js |
import{T as O,r as U,h as P,f as S,o as c,a as e,c as u,t as n,e as r,k as Z,u as t,l as T,g as D,n as m}from"./app-43851608.js";import E from"./App-ad5f7ecb.js";import{_ as p}from"./FormInput-4a309017.js";import{_ as C}from"./FormSelect-2d73589a.js";import{_ as F}from"./FormToggleSwitch-1780efa4.js";import{t as _}from"./index-17cd980e.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"./use-text-value-242aa4d7.js";import"./ChevronUpDownIcon-8859f144.js";const z={class:"p-8 rounded-[5px] text-[#000] overflow-y-scroll"},J={class:"flex justify-between"},Y={key:0,class:"text-xl mb-1"},q={key:1,class:"text-xl mb-1"},A={class:"mb-6 flex items-center text-sm leading-6 text-gray-600"},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={key:0,class:"ml-1 mt-1"},I={key:1,class:"ml-1 mt-1"},K={class:"sm:flex border-b py-5"},L={class:"hidden sm:block sm:w-[40%] mb-1"},Q={class:"text-sm text-gray-500 tracking-[0px]"},R={class:"sm:w-[60%] sm:flex space-x-6"},W={class:"sm:w-[80%] grid gap-x-6 gap-y-4 sm:grid-cols-6"},X={class:"sm:flex border-b py-5"},ee={class:"hidden sm:block sm:w-[40%] mb-1"},se={class:"text-sm text-gray-500 tracking-[0px]"},te={class:"sm:w-[60%] sm:flex space-x-6"},ae={class:"sm:w-[80%] grid gap-x-6 gap-y-4 sm:grid-cols-6"},le={class:"sm:flex border-b py-5"},oe={class:"hidden sm:block w-[40%] mb-1"},ie={class:"text-sm text-gray-500 tracking-[0px]"},ne={class:"sm:w-[60%] sm:flex space-x-6"},re={class:"sm:w-[80%] grid gap-x-6 gap-y-4 sm:grid-cols-6"},me={class:"sm:flex py-5 border-b"},de={class:"hidden sm:block w-[40%] mb-1"},pe={class:"text-sm text-gray-500 tracking-[0px]"},ce={class:"sm:w-[60%]"},ue={class:"bg-orange-100 p-2 rounded-md shadow-sm sm:w-[80%] mb-4 flex items-center gap-x-1"},_e=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),ge={class:"text-sm leading-6"},he={class:"sm:w-[80%] grid gap-x-6 gap-y-4 sm:grid-cols-6"},ve={class:"py-5 sm:flex"},fe={class:"w-[40%]"},be={class:"text-sm text-gray-500 tracking-[0px]"},xe={class:"text-xs text-slate-700 flex items-center"},we={class:"sm:w-[20%]"},ye={class:"py-6"},Ve={type:"submit",class:"float-right flex items-center space-x-4 rounded-md bg-black px-3 py-2 text-sm text-white shadow-sm hover:bg-slate-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},Fe={__name:"Show",props:{title:String,plan:Object},setup(B){var g,h,v,f,b,x,w,y,V,$,k;const i=B,d=(a,l)=>{if(a){const o=JSON.parse(a);return(o==null?void 0:o[l])??null}else return null},s=O({name:(g=i.plan)==null?void 0:g.name,price:(h=i.plan)==null?void 0:h.price,period:(v=i.plan)==null?void 0:v.period,status:(f=i.plan)==null?void 0:f.status,campaign_limit:d((b=i.plan)==null?void 0:b.metadata,"campaign_limit")??"-1",message_limit:d((x=i.plan)==null?void 0:x.metadata,"message_limit")??"-1",contacts_limit:d((w=i.plan)==null?void 0:w.metadata,"contacts_limit")??"-1",canned_replies_limit:d((y=i.plan)==null?void 0:y.metadata,"canned_replies_limit")??"-1",team_limit:d((V=i.plan)==null?void 0:V.metadata,"team_limit")??"-1",receive_messages_after_expiration:d(($=i.plan)==null?void 0:$.metadata,"receive_messages_after_expiration")==1||d((k=i.plan)==null?void 0:k.metadata,"receive_messages_after_expiration")==null}),N=U([{value:"active",label:_("active")},{value:"inactive",label:_("inactive")}]),M=U([{value:"monthly",label:_("Monthly")},{value:"yearly",label:_("Yearly")}]),j=async()=>{const a=i.plan?window.location.pathname:"/admin/plans";s[i.plan?"put":"post"](a,{preserveScroll:!0})};return(a,l)=>(c(),P(E,null,{default:S(()=>[e("div",z,[e("div",J,[e("div",null,[i.plan===null?(c(),u("h1",Y,n(a.$t("Create plan")),1)):(c(),u("h1",q,n(a.$t("Update plan")),1)),e("p",A,[G,i.plan===null?(c(),u("span",H,n(a.$t("Create plan")),1)):(c(),u("span",I,n(a.$t("Update plan")),1))])]),e("div",null,[r(t(T),{href:"/admin/plans",class:"rounded-md bg-indigo-600 px-3 py-2 text-sm text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},{default:S(()=>[Z(n(a.$t("Back")),1)]),_:1})])]),e("form",{onSubmit:l[10]||(l[10]=D(o=>j(),["prevent"])),class:"bg-white border py-5 px-5 rounded-[0.5rem]"},[e("div",K,[e("div",L,[e("h1",Q,n(a.$t("Name")),1)]),e("div",R,[e("div",W,[r(p,{modelValue:t(s).name,"onUpdate:modelValue":l[0]||(l[0]=o=>t(s).name=o),name:a.$t("Name"),error:t(s).errors.name,type:"text",class:m("sm:col-span-6")},null,8,["modelValue","name","error"])])])]),e("div",X,[e("div",ee,[e("h1",se,n(a.$t("Status")),1)]),e("div",te,[e("div",ae,[r(C,{modelValue:t(s).status,"onUpdate:modelValue":l[1]||(l[1]=o=>t(s).status=o),options:N.value,error:t(s).errors.status,name:a.$t("Status"),class:m("sm:col-span-6"),placeholder:a.$t("Select status")},null,8,["modelValue","options","error","name","placeholder"])])])]),e("div",le,[e("div",oe,[e("h1",ie,n(a.$t("Pricing details")),1)]),e("div",ne,[e("div",re,[r(p,{modelValue:t(s).price,"onUpdate:modelValue":l[2]||(l[2]=o=>t(s).price=o),name:a.$t("Price"),error:t(s).errors.price,type:"number",class:m("sm:col-span-3")},null,8,["modelValue","name","error"]),r(C,{modelValue:t(s).period,"onUpdate:modelValue":l[3]||(l[3]=o=>t(s).period=o),options:M.value,error:t(s).errors.period,name:a.$t("Period"),class:m("sm:col-span-3"),placeholder:a.$t("Select period")},null,8,["modelValue","options","error","name","placeholder"])])])]),e("div",me,[e("div",de,[e("h1",pe,n(a.$t("Plan limit")),1)]),e("div",ce,[e("div",ue,[_e,e("p",ge,n(a.$t("For unlimited usage, set -1 as the value")),1)]),e("div",he,[r(p,{modelValue:t(s).campaign_limit,"onUpdate:modelValue":l[4]||(l[4]=o=>t(s).campaign_limit=o),name:a.$t("Campaign limit"),error:t(s).errors.campaign_limit,type:"number",class:m("sm:col-span-3")},null,8,["modelValue","name","error"]),r(p,{modelValue:t(s).message_limit,"onUpdate:modelValue":l[5]||(l[5]=o=>t(s).message_limit=o),name:a.$t("Message limit"),error:t(s).errors.message_limit,type:"number",class:m("sm:col-span-3")},null,8,["modelValue","name","error"]),r(p,{modelValue:t(s).contacts_limit,"onUpdate:modelValue":l[6]||(l[6]=o=>t(s).contacts_limit=o),name:a.$t("Contacts limit"),error:t(s).errors.contacts_limit,type:"number",class:m("sm:col-span-3")},null,8,["modelValue","name","error"]),r(p,{modelValue:t(s).canned_replies_limit,"onUpdate:modelValue":l[7]||(l[7]=o=>t(s).canned_replies_limit=o),name:a.$t("Canned replies limit"),error:t(s).errors.canned_replies_limit,type:"number",class:m("sm:col-span-3")},null,8,["modelValue","name","error"]),r(p,{modelValue:t(s).team_limit,"onUpdate:modelValue":l[8]||(l[8]=o=>t(s).team_limit=o),name:a.$t("User limit"),error:t(s).errors.team_limit,type:"number",class:m("sm:col-span-3")},null,8,["modelValue","name","error"])])])]),e("div",ve,[e("div",fe,[e("h1",be,n(a.$t("Enable message reception after plan expiration")),1),e("div",xe,[e("span",null,n(a.$t("Toggle this setting to allow or block inbound messages when a user's subscription plan has ended.")),1)])]),e("div",we,[r(F,{modelValue:t(s).receive_messages_after_expiration,"onUpdate:modelValue":l[9]||(l[9]=o=>t(s).receive_messages_after_expiration=o),class:"float-left"},null,8,["modelValue"])])]),e("div",ye,[e("button",Ve,n(a.$t("Save")),1)])],32)])]),_:1}))}};export{Fe as default};