vue-wiguet-chatweb 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,4 +13,4 @@
13
13
  c1.338-1.547,1.676-3.722,0.872-5.602l-15.046-35.201C187.187,154.774,185.392,153.518,183.359,153.407z`})])],-1)];function Du(t,e){return u.openBlock(),u.createElementBlock("svg",Au,Mu)}const Ru=X(xu,[["render",Du]]),Iu={},Lu={version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"-10 -10 78 78","xml:space":"preserve"},Vu=[u.createElementVNode("g",null,[u.createElementVNode("path",{style:{fill:"orange"},d:`M29,1.5c-16.016,0-29,11.641-29,26c0,5.292,1.768,10.211,4.796,14.318
14
14
  C4.398,46.563,3.254,53.246,0,56.5c0,0,9.943-1.395,16.677-5.462c0.007,0.003,0.015,0.006,0.022,0.009
15
15
  c2.764-1.801,5.532-3.656,6.105-4.126c0.3-0.421,0.879-0.548,1.33-0.277c0.296,0.178,0.483,0.503,0.489,0.848
16
- c0.01,0.622-0.005,0.784-5.585,4.421C22.146,52.933,25.498,53.5,29,53.5c16.016,0,29-11.641,29-26S45.016,1.5,29,1.5z`}),u.createElementVNode("circle",{style:{fill:"#ffffff"},cx:"15",cy:"27.5",r:"3"}),u.createElementVNode("circle",{style:{fill:"#ffffff"},cx:"29",cy:"27.5",r:"3"}),u.createElementVNode("circle",{style:{fill:"#ffffff"},cx:"43",cy:"27.5",r:"3"})],-1)];function Fu(t,e){return u.openBlock(),u.createElementBlock("svg",Lu,Vu)}const Bu=X(Iu,[["render",Fu]]),$u={id:"chat-circle",class:"widget-container"},Uu={key:0,class:"new-message-badge"},Pu={class:"chat-box"},Wu=X(u.defineComponent({__name:"Widget",props:{tokenAuth:{type:String,required:!0},titlePrincipal:{type:String},user:{type:Object,required:!0},isDarkMode:{type:Boolean,default:!1}},emits:["show-toast","show-confirm"],setup(t,{emit:e}){const n=t;function s(l){var d;const c=((d=window.VITE_CELLPHONE_NUMBERS)==null?void 0:d.split(","))??[];if(c.length===0){console.warn("not found cellphone numbers");return}o.value=!1;const f=Math.floor(Math.random()*c.length);if(l===0){window.open("https://wa.me/"+c[f],"WhatsApp","noopener");return}window.open("https://t.me/+"+c[f],"Telegram","noopener")}const r=u.ref(!1),i=u.ref(0),o=u.ref(!1),a=()=>{r.value=!r.value};return(l,c)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass(["widget-css-reset widget-container",t.isDarkMode?"chat-dark-mode":""])},[u.withDirectives(u.createElementVNode("div",$u,[u.createElementVNode("div",{class:u.normalizeClass(["container-buttons-chat",{active:o.value}])},[u.createElementVNode("a",{href:"javascript:;",class:"button whatsapp",onClick:c[0]||(c[0]=f=>s(0))},[u.createVNode(Ru)]),u.createElementVNode("a",{href:"javascript:;",class:"button telegram",onClick:c[1]||(c[1]=f=>s(1))},[u.createVNode(_u)]),u.createElementVNode("a",{href:"javascript:;",class:u.normalizeClass(["button webchat",{disabled:n.tokenAuth.length<10}]),title:"Debe estar autenticado",onClick:c[2]||(c[2]=f=>o.value&&n.tokenAuth.length>10&&a())},[u.createVNode(Bu)],2)],2),i.value?(u.openBlock(),u.createElementBlock("div",Uu,u.toDisplayString(i.value>9?"9+":i.value),1)):u.createCommentVNode("",!0),u.createElementVNode("a",{href:"javascript:;",onClick:c[3]||(c[3]=f=>n.tokenAuth.length>10&&a())},[u.createVNode(Tu)])],512),[[u.vShow,!r.value]]),u.withDirectives(u.createElementVNode("div",Pu,[t.tokenAuth?(u.openBlock(),u.createBlock(wu,{key:0,visible:r.value,titlePrincipal:t.titlePrincipal,toggleChat:a,tokenAuth:t.tokenAuth,user:t.user,onShowToast:c[4]||(c[4]=f=>e("show-toast",f)),onShowConfirm:c[5]||(c[5]=f=>e("show-confirm",f)),onClearNewMessages:c[6]||(c[6]=f=>i.value=0),onNewMessage:c[7]||(c[7]=()=>i.value++),onNotViewedTotal:c[8]||(c[8]=f=>i.value=f)},null,8,["visible","titlePrincipal","tokenAuth","user"])):u.createCommentVNode("",!0)],512),[[u.vShow,r.value]])],2))}}),[["__scopeId","data-v-ca19c81b"]]),qu={install(t,e){window.VITE_BACKEND_URL=e.VITE_BACKEND_URL,window.VITE_SOCKET_URI=e.VITE_SOCKET_URI,window.VITE_CELLPHONE_NUMBERS=e.VITE_CELLPHONE_NUMBERS}};ue.Widget=Wu,ue.default=qu,Object.defineProperties(ue,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
16
+ c0.01,0.622-0.005,0.784-5.585,4.421C22.146,52.933,25.498,53.5,29,53.5c16.016,0,29-11.641,29-26S45.016,1.5,29,1.5z`}),u.createElementVNode("circle",{style:{fill:"#ffffff"},cx:"15",cy:"27.5",r:"3"}),u.createElementVNode("circle",{style:{fill:"#ffffff"},cx:"29",cy:"27.5",r:"3"}),u.createElementVNode("circle",{style:{fill:"#ffffff"},cx:"43",cy:"27.5",r:"3"})],-1)];function Fu(t,e){return u.openBlock(),u.createElementBlock("svg",Lu,Vu)}const Bu=X(Iu,[["render",Fu]]),$u={id:"chat-circle",class:"widget-container"},Uu={key:0,class:"new-message-badge"},Pu={class:"chat-box"},Wu=X(u.defineComponent({__name:"Widget",props:{tokenAuth:{type:String,required:!0},titlePrincipal:{type:String},user:{type:Object,required:!0},isDarkMode:{type:Boolean,default:!1}},emits:["show-toast","show-confirm"],setup(t,{emit:e}){const n=t;function s(l){var d;const c=((d=window.VITE_CELLPHONE_NUMBERS)==null?void 0:d.split(","))??[];if(c.length===0){console.warn("not found cellphone numbers");return}o.value=!1;const f=Math.floor(Math.random()*c.length);if(l===0){window.open("https://wa.me/"+c[f],"WhatsApp","noopener");return}window.open("https://t.me/+"+c[f],"Telegram","noopener")}const r=u.ref(!1),i=u.ref(0),o=u.ref(!1),a=()=>{r.value=!r.value};return(l,c)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass(["widget-css-reset widget-container",t.isDarkMode?"chat-dark-mode":""])},[u.withDirectives(u.createElementVNode("div",$u,[u.createElementVNode("div",{class:u.normalizeClass(["container-buttons-chat",{active:o.value}])},[u.createElementVNode("a",{href:"javascript:;",class:"button whatsapp",onClick:c[0]||(c[0]=f=>s(0))},[u.createVNode(Ru)]),u.createElementVNode("a",{href:"javascript:;",class:"button telegram",onClick:c[1]||(c[1]=f=>s(1))},[u.createVNode(_u)]),u.createElementVNode("a",{href:"javascript:;",class:u.normalizeClass(["button webchat",{disabled:n.tokenAuth.length<10}]),title:"Debe estar autenticado",onClick:c[2]||(c[2]=f=>o.value&&n.tokenAuth.length>10&&a())},[u.createVNode(Bu)],2)],2),i.value?(u.openBlock(),u.createElementBlock("div",Uu,u.toDisplayString(i.value>9?"9+":i.value),1)):u.createCommentVNode("",!0),u.withDirectives(u.createElementVNode("a",{href:"javascript:;",onClick:c[3]||(c[3]=f=>n.tokenAuth.length>10&&a())},[u.createVNode(Tu)],512),[[u.vShow,!r.value]])],512),[[u.vShow,!r.value]]),u.withDirectives(u.createElementVNode("div",Pu,[t.tokenAuth?(u.openBlock(),u.createBlock(wu,{key:0,visible:r.value,titlePrincipal:t.titlePrincipal,toggleChat:a,tokenAuth:t.tokenAuth,user:t.user,onShowToast:c[4]||(c[4]=f=>e("show-toast",f)),onShowConfirm:c[5]||(c[5]=f=>e("show-confirm",f)),onClearNewMessages:c[6]||(c[6]=f=>i.value=0),onNewMessage:c[7]||(c[7]=()=>i.value++),onNotViewedTotal:c[8]||(c[8]=f=>i.value=f)},null,8,["visible","titlePrincipal","tokenAuth","user"])):u.createCommentVNode("",!0)],512),[[u.vShow,r.value]])],2))}}),[["__scopeId","data-v-8cf654bc"]]),qu={install(t,e){window.VITE_BACKEND_URL=e.VITE_BACKEND_URL,window.VITE_SOCKET_URI=e.VITE_SOCKET_URI,window.VITE_CELLPHONE_NUMBERS=e.VITE_CELLPHONE_NUMBERS}};ue.Widget=Wu,ue.default=qu,Object.defineProperties(ue,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-wiguet-chatweb",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -31,7 +31,7 @@
31
31
  <div class="new-message-badge" v-if="newMessages" >
32
32
  {{ newMessages > 9 ? "9+" : newMessages }}
33
33
  </div>
34
- <a href="javascript:;" @click="props.tokenAuth.length > 10 && toggleChat()">
34
+ <a href="javascript:;" v-show="!isChatBoxVisible" @click="props.tokenAuth.length > 10 && toggleChat()">
35
35
  <IconWidget />
36
36
  </a>
37
37
  </div>