/**handles:mdp-mates,mdp-speaker,mdp-speaker-player-wavesurfer**/ (()=>{“use strict”;function e(e){const{avatar:t}=window.mdpMates;if(e){if(“none”===t.user.type)return;const e=document.createElement(“div”);return e.classList.add(“mdp-mates-visitor-avatar”,”mdp-mates-avatar”),e.innerHTML=””!==t.user.content?t.user.content:t.user.url?``:””,e}{if(“none”===t.bot.type)return;const e=document.createElement(“div”);return e.classList.add(“mdp-mates-bot-avatar”,”mdp-mates-avatar”),e.innerHTML=””!==t.bot.content?t.bot.content:t.bot.url?``:””,e}}function t(e,t=””){const a=document.createElement(“button”);return a.classList.add(“mdp-bot-menu-button”),a.setAttribute(“data-button-type”,e),a.title=t,a.innerHTML=t,a}function a(e){const{botRespondDelay:t,botTypingAnimation:a,botTypingAnimationDelay:n,randomizeBotRespondDelay:s}=window.mdpMates,o=parseFloat(t),i=”on”===a?+n:0;if(s){return Math.floor(Math.random()*o)+i*e}return o+i*e}function n(e){if(void 0===e)return;const t=document.querySelector(“.mdp-mates-chatbot-footer-form”);t&&(e?t.classList.remove(“mdp-mates-form-disabled”):t.classList.add(“mdp-mates-form-disabled”))}function s(){const{stt:e}=window.mdpMates;if(!e)return;if(!e.enabled)return;const t=document.querySelector(“.mdp-mates-bot-button-recognize”);if(!t)return;const a=function(){let e=null;if(“SpeechRecognition”in window)e=new SpeechRecognition;else{if(!(“webkitSpeechRecognition”in window)){const{translations:t}=window.mdpMates;console.warn(t.recognitionNotSupported);return document.querySelector(“.mdp-mates-form-with-recognize”).classList.remove(“mdp-mates-form-with-recognize”),e}e=new webkitSpeechRecognition}return e.lang=document.documentElement.lang,e.continuous=!1,e.interimResults=!1,e.maxAlternatives=1,e}();a&&(t.addEventListener(“click”,(()=>{t.disabled?a.stop():(t.disabled=!0,”true”===t.getAttribute(“data-in-progress”)?a.stop():a.start())})),function(e,t){e.addEventListener(“start”,(()=>{const e=new CustomEvent(“mates-recognition-start”);window.dispatchEvent(e),t.setAttribute(“data-in-progress”,”true”)})),e.addEventListener(“end”,(()=>{const e=new CustomEvent(“mates-recognition-end”);window.dispatchEvent(e),t.setAttribute(“data-in-progress”,”false”),t.disabled=!1})),e.addEventListener(“result”,(e=>{const{resultIndex:t}=e,{transcript:a}=e.results[t][0];document.querySelector(“#mdp-mates-input-messages-field”).value=a.charAt(0).toUpperCase()+a.slice(1);const n=new CustomEvent(“mates-recognition”,{detail:{message:a}});window.dispatchEvent(n)})),e.addEventListener(“error”,(e=>{const{translations:a}=window.mdpMates;console.warn(`${a.recognitionError}: ${e.error}`);const n=new CustomEvent(“mates-recognition-error”,{detail:{message:e.error}});window.dispatchEvent(n),t.setAttribute(“data-in-progress”,”false”),t.disabled=!1}))}(a,t))}function o(e){if(void 0===e.detail.message||””===e.detail.message)return;const t=document.querySelector(“.mdp-mates-mute-button”);if(t&&”true”===t.getAttribute(“data-mute”))return;const a=window.speechSynthesis;if(!a)return;const{tts:n}=window.mdpMates,s=document.documentElement.lang;let o=new SpeechSynthesisUtterance;if(n.multilingual||””===n.voice){const e=a.getVoices().find((e=>e.lang===s));e?(o.voice=e,o.lang=document.documentElement.lang):(o.voice=a.getVoices().find((e=>e.lang.startsWith(s))),o.lang=o.voice.lang),o.voice||(“”===n.voice?(o.voice=a.getVoices().find((e=>e.lang.startsWith(“en-GB”))),o.lang=o.voice.lang):n.voice.split(“,”).forEach((e=>{null===o.voice&&(o.voice=a.getVoices().find((t=>t.name===e.trim())),o.lang=o.voice.lang)})))}else n.voice.split(“,”).forEach((e=>{if(e=e.split(“;”)[0],null===o.voice){const t=a.getVoices().find((t=>t.name===e.trim()));t&&(o.voice=t,o.lang=o.voice.lang)}}));o.text=e.detail.message.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,””),a.speak(o)}function i(){const e=window.speechSynthesis;e&&e.speaking&&e.cancel()}function d(){const e=document.querySelector(“#mdp-mates-input-messages-field”),t=document.querySelector(“.mdp-mates-send-message-button”);e&&t&&(r(t,!e.value.length>0),e.addEventListener(“input”,(()=>{r(t,!e.value.length>0)})),window.addEventListener(“mates-recognition-end”,(()=>{r(t,!e.value.length>0)})))}function r(e,t){e&&(t?e.setAttribute(“disabled”,”disabled”):e.removeAttribute(“disabled”))}function c(e,t){const a=(new Date).getTime();localStorage.setItem(“mdpMatesSetupQuestionTime”,a+””),sessionStorage.setItem(“mdpMatesUserQuestion”,e),localStorage.setItem(“mdpMatesUserQuestion”,e),sessionStorage.setItem(“mdpMatesBotAnswer”,t),localStorage.setItem(“mdpMatesBotAnswer”,t)}function m(e){return/\S+@\S+\.\S+/.test(e)}const p=”on”===mdpMates.botLogs;let […]
source https://cartercapner.com.au/?post_type=wphb_minify_group&p=89707
Subscribe to:
Post Comments (Atom)
a625be33577d58c8d6e8c4fdde43323f-scripts
/**handles:mdp-mates,mdp-speaker,mdp-speaker-player-wavesurfer**/ (()=>{“use strict”;function e(e){const{avatar:t}=window.mdpMates;if(e){...
-
/**handles:wpforms-mailcheck,wpforms-punycode,wpforms-generic-utils,wpforms-flatpickr,wpforms-jquery-timepicker,wpforms-address-field**/ /*!...
-
/**handles:googlesitekit-events-provider-optin-monster,googlesitekit-events-provider-wpforms,smush-lazy-load,mailcheck-js,autocomplete-email...
-
/**handles:pcp-bxslider,pcp-popup,pcp_fonttello_icon,pcp_social_icons_style,pcp-style,passster-public,mdp-speaker,mdp-speaker-player-mediael...
No comments:
Post a Comment