1"use strict";(self.webpackChunktwilio_com_frontend=self.webpackChunktwilio_com_frontend||[]).push([[403],{1403:function(t,e,n){function r(){const t=document.querySelector(".voice-api"),e=t?.querySelector('input[type="text"]'),n=t?.querySelector("[data-cmp-hook-voiceapi]");t&&n&&e&&(n.addEventListener("click",()=>o(t,e)),e.addEventListener("keypress",n=>function(t,e,n){"Enter"!==t.key?/^\d$/.test(t.key)||t.preventDefault():o(e,n)}(n,t,e)),e.addEventListener("input",t=>function(t,e,n){n.disabled=!i(e.value)}(0,e,n)),e.addEventListener("paste",a))}function o(t,e){if(!i(e.value))throw new Error("Unable to find required elements or not valid phone");const n=t.getAttribute("data-component")?.replace("/content/twilio-com/global",""),r=t.getAttribute("data-cmp-is"),o=t.querySelector('[role="phoneNumber"]'),a=t.querySelector('[role="visitorSid"]'),c=e?.value,u=a?.value,s=o?.value,d=t.getAttribute("data-type");if(!(c&&u&&s&&d))throw new Error("Required fields missing when submitting voice API!");const l=`${n}.${r}.json?${new URLSearchParams({From:s,To:c,VisitorSid:u,Type:d}).toString()}`,p=document.createElement("div");p.classList.add("mask"),p.textContent=t.getAttribute("data-mask-text")??"",t.append(p),fetch(l,{method:"POST"}).then(t=>{if(!t.ok)return t.text().then(e=>{throw new Error(`Error: ${t.status} ${t.statusText} - ${e}`)})}).then(()=>{const e=document.createElement("div");e.textContent=t.getAttribute("data-success")??"",p.textContent="Success!",p.append(e)}).catch(()=>{p.textContent=t.getAttribute("data-error")??""})}function i(t){return t.length>=10}function a(t){const e=t.clipboardData?.getData("text/plain")??"";/^\d+$/.test(e)||t.preventDefault()}n.d(e,{registerVoiceApi:function(){return r}})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.