2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
var w=(D,M,p)=>new Promise((u,v)=>{var c=r=>{try{_(p.next(r))}catch(i){v(i)}},C=r=>{try{_(p.throw(r))}catch(i){v(i)}},_=r=>r.done?u(r.value):Promise.resolve(r.value).then(c,C);_((p=p.apply(D,M)).next())});import{s as te,r as o,p as ae,w as F,b as I,q as se,v as S,x as ne,f as x,g as P,i as a,t as j,k as d,l as V,A as O,F as le,m as oe,J as $,X as ie,j as re,T as ce,y as ue,n as E,h as f}from"./vendor-vue.CmaRnji1.js";import{_ as me,u as de,dt as pe,a as he,ds as fe,i as K,f as ve}from"./index.CjrDwa0W.js";import{_ as Ce}from"./AiakosEmojiPicker.D8pZj3nB.js";const ge={key:0,class:"absolute w-[99%] h-[510em] bottom-0 rounded-[20em] bg-white dark:bg-[#1e1e1e] z-[50] shadow-[0px_-16px_32.400001525878906px_0px_rgba(0,0,0,0.29)] overflow-hidden"},we={class:"w-full h-[48em] flex items-center justify-center border-b-[1em] border-black/10 dark:border-white/10"},xe={class:"w-full h-[30%] pr-[12em] pl-[15em] flex justify-between items-center"},_e={class:"text-[13em] font-['SFPRO'] text-black dark:text-white font-[400] leading-[100%] text-center"},be={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",class:"injected-svg h-[60%]","data-src":"https://cdn.hugeicons.com/icons/cancel-01-solid-standard.svg?v=3.0","xmlns:xlink":"http://www.w3.org/1999/xlink",role:"img"},ke=["fill"],ye={class:"w-full flex absolute top-[48em] items-start justify-center border-b-[1px] border-black/10 dark:border-white/10 transition-all duration-300 ease-out"},Fe={class:"w-[90%] flex py-[12em] items-start justify-start h-full"},De={class:"text-[13em] font-['SFPRO'] text-black dark:text-white font-[500] leading-[100%] mr-[1em] flex-shrink-0 mt-[.4em]"},Me=["onClick"],Le={class:"text-[11em] font-['SFPRO'] text-[#0088FE] font-[500] leading-[100%] whitespace-nowrap"},Se=["placeholder"],je={class:"w-[20em] min-h-[32em] max-h-[32em] mt-[-5em] flex items-center justify-center"},Ee=["src"],Te=["placeholder"],Re=["fill"],He=["src"],Ae={key:0,class:"w-full h-[250em] absolute bottom-0"},Be={__name:"NewMessage",props:{modelValue:Boolean,show:{type:Boolean,default:!1},recipientData:{type:[String,Object],default:null}},emits:["update:modelValue","cancel"],setup(D,{emit:M}){const p=de();pe();const{t:u}=he(),{DarkMode:v}=te(p),c=o(""),C=o(null),_=o(null),r=o(40),i=o(!1),Z=o(null),l=o(""),T=o(!1),L=o(null),g=o(48),m=D;ae(()=>{v.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")});const z=()=>w(this,null,function*(){if(yield E(),C.value){C.value.style.height="40%";const e=74,s=100,t=C.value.scrollHeight,h=Math.min(Math.max(t,e),s);C.value.style.height=`${h}%`,r.value=h-34}});F(c,()=>{z()});const R=M,H=()=>{c.value="",l.value="",i.value=!1,n.value=[],g.value=48,setTimeout(()=>{R("update:modelValue",!1),R("cancel")},300)},U=e=>{c.value+=e},A=()=>{i.value=!i.value};o(!1);const b=o(!1),q=()=>{b.value=!1},n=o([]),G=e=>{n.value.some(t=>t.target_phone===e.target_phone)?(b.value=!1,l.value=""):(n.value.push(e),b.value=!1,l.value="")},B=()=>w(this,null,function*(){if(yield E(),L.value){const t=L.value.scrollHeight+5;t>140?g.value=140:g.value=Math.max(t,5)}}),J=I(()=>g.value>=140);I(()=>g.value),F(n,()=>w(this,null,function*(){n.value.length===0?g.value=8:yield B()}),{deep:!0}),F(l,()=>w(this,null,function*(){n.value.length>0&&(yield B())}));const W=e=>{const s=e.target.value.replace(/[^0-9]/g,"");l.value=s,E(()=>{e.target.value!==s&&(e.target.value=s)})},X=e=>{if(e.key==="Enter"&&l.value.trim()&&/^\d+$/.test(l.value.trim())){const k=l.value.trim();if(!n.value.some(y=>y.target_phone===k||y.phone===k)){const y={id:Date.now(),name:k,phone:k};n.value.push(y)}l.value="";return}const s=["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","Tab","Enter","Escape"],t=/^[0-9]$/.test(e.key),h=s.includes(e.key);!t&&!h&&e.preventDefault()},Q=e=>{n.value.splice(e,1)},Y=()=>{T.value=!0},ee=()=>{if(T.value=!1,l.value.trim()&&/^\d+$/.test(l.value.trim())){const e=l.value.trim();if(!n.value.some(t=>t.target_phone===e||t.phone===e)){const t={id:Date.now(),name:e,target_phone:e};n.value.push(t)}l.value=""}},N=()=>w(this,null,function*(){if(n.value.length===0||c.value.trim()==="")return;let e=yield ve("SEND_MESSAGE",{recipients:n.value,message:{type:"text",content:c.value.trim()}});e&&e.success?H():p.TriggerNotification({appname:"message",header:u("message.title"),message:u(e.message)})});return F(()=>m.show,e=>{if(e){if(m.recipientData)if(n.value=[],typeof m.recipientData=="string"){const s={id:Date.now(),name:m.recipientData.name,target_phone:m.recipientData.target_phone};n.value.push(s)}else typeof m.recipientData=="object"&&n.value.push(m.recipientData)}else n.value=[]}),(e,s)=>(f(),se(ue,{to:"#phone-screen"},[S(ce,{name:"slide-up"},{default:ne(()=>[m.show?(f(),x("div",ge,[S(fe,{onCancel:q,show:b.value,onSelectcontact:G},null,8,["show"]),a("div",we,[a("div",xe,[a("span",_e,j(d(u)("newMessage.title")),1),a("div",{onClick:H,class:"flex bg-white dark:bg-black/40 items-center justify-center w-[25em] h-[25em] cursor-pointer anim-hover-1 rounded-full shadow-[0_0_10.9px_0_rgba(0,0,0,0.15)]"},[(f(),x("svg",be,[a("path",{fill:d(v)?"#FFFFFFCC":"#000000CC",d:"M17.293 5.29295C17.6835 4.90243 18.3165 4.90243 18.707 5.29295C19.0975 5.68348 19.0975 6.31649 18.707 6.70702L13.4131 12L18.706 17.293L18.7754 17.3691C19.0954 17.7619 19.072 18.341 18.706 18.707C18.3399 19.0731 17.7609 19.0958 17.3681 18.7754L17.292 18.707L11.999 13.414L6.70799 18.706C6.31747 19.0966 5.68446 19.0965 5.29393 18.706C4.90341 18.3155 4.90341 17.6825 5.29393 17.292L10.5849 12L5.29295 6.70799L5.22459 6.63182C4.9042 6.23907 4.92688 5.66007 5.29295 5.29393C5.65894 4.92794 6.23808 4.9046 6.63084 5.22459L6.70702 5.29393L11.999 10.5859L17.293 5.29295Z"},null,8,ke)]))])])]),a("div",ye,[a("div",Fe,[a("span",De,j(d(u)("newMessage.to")),1),a("div",{class:V(["w-[210em] min-h-[32em] mr-[8em] pr-[2em] mt-[-5em] custom-scrollbar",J.value?"overflow-y-scroll max-h-[104em]":"overflow-y-visible"])},[a("div",{ref_key:"contactsContainerRef",ref:L,class:"flex flex-wrap items-center gap-[6em]"},[(f(!0),x(le,null,oe(n.value,(t,h)=>(f(),x("div",{key:t.id||h,class:"group h-[20em] rounded-full bg-[#0088FE33] dark:bg-white/5 flex items-center justify-center px-[10em] cursor-pointer transition-all duration-300 hover:bg-[#FCB4B4] dark:hover:bg-white/10",onClick:k=>Q(h)},[a("span",Le,j(t.name),1)],8,Me))),128)),O(a("input",{ref_key:"toInputRef",ref:Z,"onUpdate:modelValue":s[0]||(s[0]=t=>l.value=t),onInput:W,onKeydown:X,onFocus:Y,onBlur:ee,placeholder:d(u)("newMessage.phoneNumberPlaceholder"),inputmode:"numeric",pattern:"[0-9]*",class:"h-[1em] min-w-[17em] mt-[1em] max-w-[17em] flex-shrink-0 bg-transparent text-[11em] font-['SFPRO'] text-black dark:text-white font-[400] outline-none placeholder:text-black/50 dark:placeholder:text-white/50"},null,40,Se),[[$,l.value]])],512)],2),a("div",je,[a("img",{src:d(K)["message/+.svg"],onClick:s[1]||(s[1]=t=>b.value=!0),class:"h-[90%] cursor-pointer anim-hover-1",alt:""},null,8,Ee)])])]),a("div",{class:"w-full h-[20em] absolute flex justify-between items-end px-[15em]",style:re({height:`${r.value}em`,bottom:i.value?"260em":"15em"})},[a("div",{ref_key:"inputContainerRef",ref:_,class:"w-[82%] h-full flex items-center bg-black/5 dark:bg-white/5 rounded-[20em] shadow-[0px_0px_32.400001525878906px_0px_rgba(0,0,0,0.29)] transition-all duration-200 px-[10em] py-[10em]"},[O(a("input",{placeholder:d(u)("inMessage.typeAMessage"),type:"text",maxlength:800,"onUpdate:modelValue":s[2]||(s[2]=t=>c.value=t),onKeyup:ie(N,["enter"]),class:"w-[85%] font-['SFPRO'] placeholder:font-['SFPRO'] h-full flex items-center border-none bg-transparent outline-none text-[11em] pb-[.2em]"},null,40,Te),[[$,c.value]]),(f(),x("svg",{onClick:A,xmlns:"http://www.w3.org/2000/svg",class:V(["h-[20em] ml-[10em] cursor-pointer anim-hover-1 transition-transform duration-200",{"rotate-180":i.value}]),viewBox:"0 0 20 20",fill:"none"},[a("path",{d:"M9.99999 20C11.366 20 12.652 19.7385 13.8578 19.2156C15.0637 18.6928 16.1274 17.9706 17.049 17.049C17.9706 16.1274 18.6928 15.0637 19.2156 13.8578C19.7385 12.652 20 11.366 20 9.99999C20 8.63398 19.7385 7.34803 19.2156 6.14214C18.6928 4.93627 17.9706 3.87255 17.049 2.95097C16.1274 2.02941 15.0621 1.30719 13.8529 0.784313C12.6438 0.261438 11.3562 0 9.99018 0C8.62417 0 7.33823 0.261438 6.13235 0.784313C4.92646 1.30719 3.86437 2.02941 2.94607 2.95097C2.02778 3.87255 1.30719 4.93627 0.784313 6.14214C0.261438 7.34803 0 8.63398 0 9.99999C0 11.366 0.261438 12.652 0.784313 13.8578C1.30719 15.0637 2.02941 16.1274 2.95097 17.049C3.87255 17.9706 4.93627 18.6928 6.14214 19.2156C7.34803 19.7385 8.63398 20 9.99999 20ZM9.99999 18.3333C8.84313 18.3333 7.76143 18.1176 6.7549 17.6863C5.74836 17.2549 4.86437 16.6585 4.10293 15.8971C3.3415 15.1356 2.74673 14.2517 2.31862 13.2451C1.89052 12.2386 1.67647 11.1569 1.67647 9.99999C1.67647 8.84313 1.89052 7.76143 2.31862 6.7549C2.74673 5.74836 3.33987 4.86274 4.09803 4.09803C4.8562 3.33333 5.73855 2.73692 6.74509 2.30882C7.75163 1.88072 8.83332 1.66667 9.99018 1.66667C11.1471 1.66667 12.2288 1.88072 13.2353 2.30882C14.2418 2.73692 15.1274 3.33333 15.8922 4.09803C16.6569 4.86274 17.2549 5.74836 17.6863 6.7549C18.1176 7.76143 18.3333 8.84313 18.3333 9.99999C18.3333 11.1569 18.1193 12.2386 17.6912 13.2451C17.263 14.2517 16.6683 15.1356 15.9068 15.8971C15.1454 16.6585 14.2598 17.2549 13.2499 17.6863C12.2402 18.1176 11.1569 18.3333 9.99999 18.3333ZM9.99018 14.9117C10.6699 14.9117 11.268 14.7892 11.7843 14.5441C12.3007 14.299 12.701 14.018 12.9853 13.701C13.2696 13.384 13.4118 13.1176 13.4118 12.902C13.4118 12.7843 13.3644 12.7026 13.2696 12.6568C13.1748 12.6111 13.0752 12.6111 12.9705 12.6568C12.6176 12.8529 12.2108 13.0408 11.75 13.2205C11.2892 13.4003 10.7026 13.4902 9.99018 13.4902C9.27777 13.4902 8.69117 13.4003 8.23038 13.2205C7.7696 13.0408 7.35947 12.8529 7 12.6568C6.89542 12.6111 6.79738 12.6111 6.70588 12.6568C6.61437 12.7026 6.56862 12.7843 6.56862 12.902C6.56862 13.1176 6.71078 13.384 6.99509 13.701C7.2794 14.018 7.67973 14.299 8.19606 14.5441C8.71241 14.7892 9.31045 14.9117 9.99018 14.9117ZM7.07842 9.12744C7.39215 9.12744 7.66666 9.00163 7.90195 8.74999C8.13725 8.49835 8.2549 8.17646 8.2549 7.78431C8.2549 7.39215 8.13725 7.06862 7.90195 6.81372C7.66666 6.55882 7.39215 6.43136 7.07842 6.43136C6.77123 6.43136 6.50326 6.55882 6.2745 6.81372C6.04574 7.06862 5.93136 7.39215 5.93136 7.78431C5.93136 8.17646 6.04574 8.49835 6.2745 8.74999C6.50326 9.00163 6.77123 9.12744 7.07842 9.12744ZM12.8921 9.12744C13.2058 9.12744 13.4803 9.00163 13.7157 8.74999C13.951 8.49835 14.0686 8.17646 14.0686 7.78431C14.0686 7.39215 13.951 7.06862 13.7157 6.81372C13.4803 6.55882 13.2058 6.43136 12.8921 6.43136C12.5849 6.43136 12.317 6.55882 12.0882 6.81372C11.8594 7.06862 11.7451 7.39215 11.7451 7.78431C11.7451 8.17646 11.8594 8.49835 12.0882 8.74999C12.317 9.00163 12.5849 9.12744 12.8921 9.12744Z",fill:d(v)?"#FFFFFFCC":"#000000CC"},null,8,Re)],2))],512),a("div",{onClick:N,class:"aspect-square h-[40em] rounded-full bg-black/5 dark:bg-white/5 shadow-[0px_0px_32.400001525878906px_0px_rgba(0,0,0,0.29)] flex items-center justify-center flex-shrink-0"},[a("img",{src:d(K)["message/send1.svg"],class:"h-[80%] cursor-pointer",alt:""},null,8,He)])],4),i.value?(f(),x("div",Ae,[S(Ce,{show:i.value,onSelectEmoji:U,onClose:A},null,8,["show"])])):P("",!0)])):P("",!0)]),_:1})]))}},$e=me(Be,[["__scopeId","data-v-3eb83411"]]);export{$e as N};
|