callix-dialer-widget 2.8.2 → 2.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,5 +22,5 @@
22
22
  * Callix Client SDK React
23
23
  * @version 1.1.0
24
24
  * @license Proprietary
25
- */var ku=function(){if(Tu)return Nu;Tu=1;var e,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(a,{CallOperatorStartupError:()=>s.CallOperatorStartupError,CallixClientParams:()=>s.CallixClientParams,CallixClientProvider:()=>g,CallixClientSdk:()=>s.CallixClientSdk,useCallOperator:()=>_,useCallOperatorAudioInputMuted:()=>M,useCallOperatorAudioOutputControls:()=>P,useCallOperatorAudioOutputMuted:()=>L,useCallOperatorAudioOutputVolume:()=>D,useCallOperatorBreaks:()=>U,useCallOperatorControls:()=>E,useCallOperatorCurrentBreak:()=>k,useCallOperatorCurrentCall:()=>N,useCallOperatorCurrentCallControls:()=>I,useCallOperatorCurrentCallInfo:()=>T,useCallOperatorDiscardQualifications:()=>O,useCallOperatorEventListener:()=>R,useCallOperatorStartupError:()=>j,useCallOperatorState:()=>C,useCallOperatorSuccessQualifications:()=>A,useCallixClient:()=>p}),e=a,Nu=((e,t,a,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let d of i(t))!o.call(e,d)&&d!==a&&n(e,d,{get:()=>t[d],enumerable:!(s=r(t,d))||s.enumerable});return e})(n({},"__esModule",{value:!0}),e);var s=vu(),d=vu(),l=Cu(),u=Iu(),c=m(),f=(0,l.createScope)(null),h=(0,l.molecule)((e,t)=>{let n=t(f);if(!n)throw new Error("Missing CallixClient parameters. You must wrap your component tree with CallixClientProvider.");return new d.CallixClientSdk(n)});function p(){return(0,u.useMolecule)(h)}function g({children:e,...t}){return(0,c.jsx)(u.ScopeProvider,{scope:f,value:t,children:e})}var $=Cu(),v=Iu(),y=t,b=t;function x(e){return(0,b.useSyncExternalStore)(e.subscribe.bind(e),e.get.bind(e),e.get.bind(e))}var w=(0,$.molecule)(e=>{let t=e(h).createCallOperator();return(0,$.onMount)(()=>{t.start();let e=()=>{t.stop()};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}}),(0,$.onUnmount)(()=>{t.stop()}),t});function _(){return(0,v.useMolecule)(w)}function C(){let e=_(),t=x(e.currentStateKeys);for(let n of t){if("startup.error"===n)return{state:"startupError",error:e.startupError.get()};if("startup"===n)return{state:"starting"};if("offline"===n||"available.networkDown"===n||"onBreak.networkDown"===n)return{state:"offline"};if("onBreak"===n)return{state:"onBreak",break:e.currentBreak.get()};if("available.callRinging"===n)return{state:"callRinging",call:e.currentCall.get()};if("manualCall.callSetup"===n)return{state:"manualCallSetup",call:e.currentCall.get()};if("manualCall.callRinging"===n)return{state:"manualCallRinging",call:e.currentCall.get()};if("manualCall.callFailed"===n)return{state:"manualCallFailed",call:e.currentCall.get()};if("available"===n||"manualCall.idle"===n)return{state:"idle"};if("inCall"===n)return{state:"callInProgress",call:e.currentCall.get()};if("afterCall"===n)return{state:"afterCall"}}}function S(e,t,n){return Object.fromEntries(n.map(n=>[n,(0,y.useCallback)((...r)=>{if(t){if("function"==typeof t[n])return t[n].apply(t,r);console.warn(`Method ${String(n)} is not a function on obj ${e}.`)}else console.warn(`Obj ${e} is null or undefined, cannot call method ${String(n)}.`)},[t])]))}function E(){return S("callOperator",_(),["becomeAvailable","goOffline","enterOnBreak","makeManualCall","finishAfterCall"])}function N(){return x(_().currentCall)}function T(){return x(_().currentCallInfo)}function A(){return x(_().successQualifications)}function O(){return x(_().discardQualifications)}function I(){return S("currentCall",N(),["answer","reject","hangup","isOnHold","hold","unhold","isMuted","mute","unmute"])}function k(){return x(_().currentBreak)}function j(){let e=C();if("startupError"===(null==e?void 0:e.state))return e.error}function R(e,t){let n=_(),r=(0,y.useRef)(t);r.current=t,(0,y.useEffect)(()=>{if(n)return n.on(e,(...e)=>{r.current.apply(null,e)})},[e,n])}function P(){return S("audioOutput",_().audioOutput,["setVolume","setMute"])}function D(){let e=_(),{setVolume:t}=P();return[x(e.audioOutput.volume),t]}function L(){let e=_(),{setMute:t}=P();return[x(e.audioOutput.isMuted),t]}function M(){let e=N(),[t,n]=(0,y.useState)((null==e?void 0:e.isMuted())??!1);return[t,(0,y.useCallback)(t=>{e&&(t?e.mute():e.unmute(),n(t))},[e])]}function U(){return x(_().breaks)}return Nu}();class ju extends Error{constructor(e,t){super(t),this.code=e,this.name="EngineAccessError"}}class Ru{constructor(e){this.value=e,this.listeners=new Set}get(){return this.value}set(e){if(JSON.stringify(e)!==JSON.stringify(this.value)){this.value=e;for(const t of this.listeners)t(e)}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}}const Pu={segments:[],status:null,insight:null,interims:0};class Du{constructor(e){this.options=e,this.userSignal=new Ru(void 0),this.listeners=new Set,this.sessionLostListeners=new Set,this.viewWaiters=[],this.ws=null,this.reconnectDelay=500,this.pendingCommands=[],this.reconnectTimer=null,this.closed=!1,this.iceServers=[{urls:"stun:stun.l.google.com:19302"}],this.pc=null,this.connectionId=null,this.remoteSet=!1,this.pendingCandidates=[],this.micStream=null,this.audioSeq=0,this.unlockListener=null,this.agentId=e.agentId,this.session=e.session??null,this.log=e.log??(()=>{}),this.audio=void 0!==e.audioElement?e.audioElement:function(){if("undefined"==typeof document)return null;const e=document.createElement("audio");return e.autoplay=!0,e.setAttribute("playsinline","true"),e.style.display="none",e.dataset.callixEngineAudio="true",document.body.appendChild(e),e}(),this.state={wsState:"idle",tabId:null,view:null,engaged:!1,pcState:"idle",needsUnlock:!1,micError:null,lastError:null,inputMuted:!1,outputMuted:!1,outputVolume:100,transcript:Pu,sessionLost:null,rejected:null}}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setState(e){this.state={...this.state,...e};for(const t of this.listeners)t()}get currentCall(){var e,t;return(null==(t=null==(e=this.state.view)?void 0:e.snapshot)?void 0:t.leg.call)??null}connect(){if(this.closed&&(this.closed=!1),this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING))return;const e=this.options.WebSocketImpl??WebSocket;this.setState({wsState:"connecting"});const t=new e(function(e){const t=new URL(e,"undefined"!=typeof window?window.location.href:"http://localhost");return t.protocol="https:"===t.protocol?"wss:":"ws:",t.pathname=`${t.pathname.replace(/\/+$/,"")}/ws`,t.search="",t.hash="",t.toString()}(this.options.url));this.ws=t,t.onopen=()=>{if(this.ws!==t)return;this.reconnectDelay=500,this.setState({wsState:"open"});const e=!this.session&&this.options.sessionToken?this.options.sessionToken():null,n={type:"hello",role:"tab",agentId:this.agentId,...this.options.token?{token:this.options.token}:{},...this.options.version?{version:this.options.version}:{},...e?{sessionToken:e}:{},label:this.options.label??"Discador",...this.session?{session:this.session}:{}};this.send(n),this.log("conectado ao host do motor")},t.onmessage=e=>{if(this.ws!==t)return;let n;try{n=JSON.parse(String(e.data))}catch{return}this.handle(n)},t.onclose=()=>{if(this.ws!==t)return;this.ws=null;const e=this.state.engaged;this.setState({wsState:"closed",tabId:null,engaged:!1}),e&&this.stopAudio(),this.closed||(this.log(`conexão com o motor caiu; nova tentativa em ${this.reconnectDelay} ms`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},this.reconnectDelay),this.reconnectDelay=Math.min(2*this.reconnectDelay,5e3))},t.onerror=()=>{}}close(){this.closed=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopAudio();const e=this.ws;this.ws=null,e&&(e.onclose=null,e.close());for(const t of this.viewWaiters.splice(0))clearTimeout(t.timer);this.setState({wsState:"closed",tabId:null,engaged:!1})}waitForView(e=15e3,t,n){const r=this.state.rejected;return r?Promise.reject(new ju(r.code,r.message)):(null==n?void 0:n.fresh)||!this.state.view||!this.state.tabId||t&&!t(this.state.view)?new Promise((n,r)=>{const i=setTimeout(()=>{const e=this.viewWaiters.findIndex(e=>e.timer===i);e>=0&&this.viewWaiters.splice(e,1),r(new Error("o motor não respondeu"))},e);this.viewWaiters.push({resolve:n,reject:r,accept:t,timer:i})}):Promise.resolve(this.state.view)}rejectWaiters(e){for(const t of this.viewWaiters.splice(0))clearTimeout(t.timer),t.reject(e)}send(e){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}handle(e){switch(e.type){case"welcome":Array.isArray(e.iceServers)&&e.iceServers.length>0&&(this.iceServers=e.iceServers),this.setState({tabId:e.tabId,rejected:null}),this.flushPendingCommands(),this.applyView(e.view),this.log(`sou a aba ${e.tabId}`),!1!==this.options.autoEngage&&e.view.engagedTabId!==e.tabId&&this.engage();break;case"view":this.applyView(e.view);break;case"engage":this.setState({engaged:e.engaged}),e.engaged?this.startAudio():this.stopAudio();break;case"signal":this.onSignal(e.payload);break;case"error":if("unauthorized"===e.code){this.setState({lastError:e.message,rejected:{code:e.code,message:e.message}}),this.session=null,this.reconnectDelay=5e3,this.log(`acesso recusado pelo host: ${e.message}`),this.rejectWaiters(new ju(e.code,e.message));break}if("session-changed"===e.code){this.session=null,this.log("a sessão deste agente foi trocada por um login novo; reconectando com a credencial atual");break}this.setState({lastError:e.message}),this.log(`erro do host: ${e.message}`);break;case"transcript":this.pushSegment(e.segment);break;case"transcript-sync":this.setState({transcript:{segments:e.segments??[],status:e.status??null,insight:e.insight??null,interims:0}});break;case"insight":{const t=this.state.transcript.insight;(!t||e.insight.revision>=t.revision||e.insight.callId!==t.callId)&&this.setState({transcript:{...this.state.transcript,insight:e.insight}});break}case"transcript-status":this.onTranscriptStatus(e.status)}}applyView(e){var t,n;const r=this.state.view,i=e.sessionLost??null,o=Boolean(i)&&!(null==r?void 0:r.sessionLost);o&&(this.session=null,this.log(`o Callix derrubou a sessão: ${(null==i?void 0:i.message)??""}`));const a=null==(t=e.snapshot)?void 0:t.leg.user;this.userSignal.set(a?{...a,sessionId:0}:void 0);const s=null==(n=e.snapshot)?void 0:n.leg.call,d={view:e,sessionLost:i?{originator:i.originator,message:i.message}:null};s&&"boolean"==typeof s.muted&&s.muted!==this.state.inputMuted&&"ended"!==s.state&&(d.inputMuted=s.muted),this.setState(d);for(const l of this.viewWaiters.splice(0))!l.accept||l.accept(e)?(clearTimeout(l.timer),l.resolve(e)):this.viewWaiters.push(l);if(o&&i)for(const l of this.sessionLostListeners)l(i)}onSessionLost(e){return this.sessionLostListeners.add(e),()=>{this.sessionLostListeners.delete(e)}}setSession(e){if(this.session=e,this.setState({rejected:null,sessionLost:null}),this.ws&&this.ws.readyState===WebSocket.OPEN){if(this.state.tabId)return void this.send({type:"session",session:e});const t=this.ws;this.ws=null,t.onopen=null,t.onmessage=null,t.onclose=null,t.close(),this.setState({wsState:"closed"})}this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.reconnectDelay=500,this.connect()}engage(){this.send({type:"engage"})}release(){this.send({type:"release"})}command(e){if(this.ws&&this.ws.readyState===WebSocket.OPEN&&this.state.tabId)return this.send({type:"command",command:e}),void this.log(`comando: ${e.name}${e.phone?` ${e.phone}`:""}`);this.pendingCommands.push({command:e,at:Date.now()}),this.pendingCommands.length>10&&this.pendingCommands.shift(),this.log(`comando: ${e.name} guardado até a conexão com o motor voltar`),this.setState({lastError:"Sem conexão com o motor neste momento; o comando será enviado assim que ela voltar."}),this.connect()}flushPendingCommands(){const e=Date.now(),t=this.pendingCommands.splice(0);for(const n of t)e-n.at>15e3?this.log(`comando ${n.command.name} descartado: a conexão demorou demais para voltar`):(this.send({type:"command",command:n.command}),this.log(`comando: ${n.command.name} (enviado depois da reconexão)`))}setInputMuted(e){if(this.micStream)for(const t of this.micStream.getAudioTracks())t.enabled=!e;this.setState({inputMuted:e}),this.currentCall&&this.command({name:e?"mute":"unmute"})}setOutputMuted(e){this.audio&&(this.audio.muted=e),this.setState({outputMuted:e})}setOutputVolume(e){const t=Math.max(0,Math.min(100,Math.round(e)));this.audio&&(this.audio.volume=t/100),this.setState({outputVolume:t})}async setOutputDevice(e){const t=this.audio;if(!(null==t?void 0:t.setSinkId))throw new Error("este navegador não permite escolher a saída de som");await t.setSinkId(e)}async unlockAudio(){if(this.audio&&this.audio.srcObject)try{await this.audio.play(),this.setState({needsUnlock:!1})}catch{this.setState({needsUnlock:!0})}}async startAudio(){const e=++this.audioSeq;this.stopAudio();const t=void 0===this.options.mediaDevices?"undefined"!=typeof navigator?navigator.mediaDevices:null:this.options.mediaDevices;if(!(null==t?void 0:t.getUserMedia))return void this.setState({micError:"Este navegador não permite usar o microfone pela página."});let n;try{n=await t.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})}catch(a){const e=`Microfone indisponível: ${a.message}`;return this.setState({micError:e}),void this.log(e)}if(e!==this.audioSeq||!this.state.engaged){for(const e of n.getTracks())e.stop();return}this.micStream=n;for(const s of n.getAudioTracks())s.enabled=!this.state.inputMuted;this.setState({micError:null});const r=new(this.options.PeerConnectionImpl??RTCPeerConnection)({iceServers:this.iceServers});this.pc=r;const i=Math.random().toString(36).slice(2,10);this.connectionId=i,this.remoteSet=!1,this.pendingCandidates=[];for(const s of n.getAudioTracks())r.addTrack(s,n);r.onicecandidate=e=>{this.send({type:"signal",payload:{connectionId:i,candidate:e.candidate?e.candidate.toJSON():null}})},r.ontrack=e=>{const t=e.streams[0]??new MediaStream([e.track]);this.audio&&(this.audio.srcObject=t,this.audio.muted=this.state.outputMuted,this.audio.volume=this.state.outputVolume/100,this.audio.play().then(()=>this.setState({needsUnlock:!1})).catch(()=>{this.setState({needsUnlock:!0}),this.armUnlock()})),this.log("áudio do motor chegou")},r.onconnectionstatechange=()=>{this.pc===r&&(this.setState({pcState:r.connectionState}),this.log(`WebRTC: ${r.connectionState}`),"failed"===r.connectionState&&this.state.engaged&&(this.log("conexão de áudio com o motor falhou; renegociando"),this.startAudio()))};const o=await r.createOffer();this.pc===r&&(await r.setLocalDescription(o),this.send({type:"signal",payload:{connectionId:i,description:{type:o.type,sdp:o.sdp}}}),this.setState({pcState:r.connectionState}))}stopAudio(){if(this.pc&&(this.pc.onconnectionstatechange=null,this.pc.onicecandidate=null,this.pc.ontrack=null,this.pc.close(),this.pc=null),this.connectionId=null,this.micStream){for(const e of this.micStream.getTracks())e.stop();this.micStream=null}this.audio&&(this.audio.srcObject=null),"idle"!==this.state.pcState&&this.setState({pcState:"idle"})}async onSignal(e){const t=this.pc;if(t&&(!e.connectionId||e.connectionId===this.connectionId))try{if(e.description){await t.setRemoteDescription(e.description),this.remoteSet=!0;for(const e of this.pendingCandidates.splice(0))await t.addIceCandidate(e).catch(()=>{})}if(void 0!==e.candidate){const n=e.candidate??void 0;!this.remoteSet&&n?this.pendingCandidates.push(n):await t.addIceCandidate(n).catch(()=>{})}}catch(n){this.log(`sinalização: ${n.message}`)}}armUnlock(){if(this.unlockListener||"undefined"==typeof document)return;const e=()=>{document.removeEventListener("pointerdown",e,!0),document.removeEventListener("keydown",e,!0),this.unlockListener=null,this.unlockAudio()};this.unlockListener=e,document.addEventListener("pointerdown",e,!0),document.addEventListener("keydown",e,!0)}pushSegment(e){const t=this.state.transcript;let n=t.segments,r=t.insight,i=t.interims;n.length&&n[0].callId!==e.callId&&(n=[],r=null,i=0);const o=n.findIndex(t=>t.id===e.id),a=o>=0?n.map((t,n)=>n===o?e:t):[...n,e];a.length>300&&a.shift(),e.interim&&(i+=1),this.setState({transcript:{...t,segments:a,insight:r,interims:i}})}onTranscriptStatus(e){const t=this.state.transcript;if(!t.status||t.status.recordingId===e.recordingId||"running"===e.live){const n=t.status&&t.status.recordingId!==e.recordingId;this.setState({transcript:{...t,status:e,...n?{segments:[],insight:null,interims:0}:{}}})}}}const Lu=t.createContext(null);function Mu({client:e,children:t}){return $.jsx(Lu.Provider,{value:e,children:t})}function Uu(e){return t.useSyncExternalStore(e.subscribe.bind(e),e.getState.bind(e),e.getState.bind(e))}const Fu=[{id:0,name:"Pausa"}];function Bu(e){var t;const n=null==(t=null==e?void 0:e.snapshot)?void 0:t.leg.breaks;return n&&n.length>0?n.map(e=>({id:e.id,name:e.name})):Fu}function qu(e){var t;return(null==(t=e.snapshot)?void 0:t.leg.break)??Bu(e)[0]}function zu(e){return"number"==typeof e?{name:"pause",breakId:e}:{name:"pause"}}function Hu(e){return{id:e.id,name:e.name,isSystemQualification:!1,systemQualificationType:0}}function Wu(e,t){var n;return((null==(n=null==e?void 0:e.snapshot)?void 0:n.leg.qualifications)??[]).filter(e=>e.kind===t).map(Hu)}class Gu{constructor(e,t){this.client=e,this.listeners=new Map,this.snapshot=t}get id(){return this.snapshot.id}get direction(){return this.snapshot.direction}get data(){var e;return{destinationNumber:null==(e=this.snapshot.contact)?void 0:e.phone,campaignContactPhoneId:this.snapshot.campaignContactPhoneId,answeredAt:this.snapshot.answeredAt?new Date(this.snapshot.answeredAt):void 0}}get callerNumber(){var e;return null==(e=this.snapshot.contact)?void 0:e.phone}get peerDisplayName(){var e;return null==(e=this.snapshot.contact)?void 0:e.name}get isEstablished(){return"active"===this.snapshot.state}get isEnded(){return"ended"===this.snapshot.state}get currentDurationSeconds(){const e=this.snapshot.answeredAt??this.snapshot.startedAt;return Math.max(0,Math.floor((Date.now()-e)/1e3))}answer(){this.client.command({name:"answer"})}reject(){this.client.command({name:"reject"})}hangup(){this.client.command({name:"hangup"})}isOnHold(){return{local:!1,remote:!1}}async hold(){}async unhold(){}isMuted(){return this.client.getState().inputMuted}mute(){this.client.setInputMuted(!0)}unmute(){this.client.setInputMuted(!1)}sendDtmf(e){this.client.command({name:"dtmf",tones:e})}on(e,t){let n=this.listeners.get(e);return n||(n=new Set,this.listeners.set(e,n)),n.add(t),this}once(e,t){const n=(...r)=>{this.off(e,n),t(...r)};return this.on(e,n)}off(e,t){var n;return null==(n=this.listeners.get(e))||n.delete(t),this}toCallData(){var e;return{id:this.snapshot.id,direction:this.snapshot.direction,destinationNumber:(null==(e=this.snapshot.contact)?void 0:e.phone)??"",answeredAt:this.snapshot.answeredAt?new Date(this.snapshot.answeredAt).toISOString():void 0,campaignContactPhoneId:this.snapshot.campaignContactPhoneId,isMuted:this.snapshot.muted}}}function Vu(e){var n,r;const i=(null==(r=null==(n=Uu(e).view)?void 0:n.snapshot)?void 0:r.leg.call)??null,o=t.useRef(null);return i&&"ended"!==i.state?o.current&&o.current.id===i.id?o.current.snapshot=i:o.current=new Gu(e,i):o.current=null,o.current}function Ku(e){const n=Uu(e),r=Vu(e);return t.useMemo(()=>function(e,t){var n,r,i;if(!e)return;if("anotherDevice"===(null==(n=e.sessionLost)?void 0:n.originator))return{state:"startupError",error:"userIsAlreadyConnectedOnAnotherDevice"};const o=null==(r=e.snapshot)?void 0:r.leg;if(!o)return"starting"===e.engine||"running"===e.engine?{state:"starting"}:{state:"offline"};const a=t??void 0;switch(o.status){case"starting":return{state:"starting"};case"available":return{state:"idle"};case"ringing":return{state:"callRinging",call:a};case"dialing":return"ringing"===(null==(i=o.call)?void 0:i.state)?{state:"manualCallRinging",call:a}:{state:"manualCallSetup",call:a};case"inCall":return{state:"callInProgress",call:a};case"afterCall":return{state:"afterCall"};case"onBreak":return{state:"onBreak",break:qu(e)};case"offline":return{state:"offline"};case"error":return{state:"startupError",error:"unknownError"}}}(n.view,r),[n.view,r])}function Yu(e){var n,r,i,o,a;const s=Uu(e).view,d=JSON.stringify([null==(r=null==(n=null==s?void 0:s.snapshot)?void 0:n.leg.call)?void 0:r.id,null==(o=null==(i=null==s?void 0:s.snapshot)?void 0:i.leg.call)?void 0:o.contact,null==(a=null==s?void 0:s.snapshot)?void 0:a.leg.qualifications]);return t.useMemo(()=>function(e){var t;const n=null==(t=null==e?void 0:e.snapshot)?void 0:t.leg,r=null==n?void 0:n.call;if(!n||!r)return;const i=Wu(e,"success"),o=Wu(e,"discard"),a=r.contact;if(null==a?void 0:a.campaign)return{type:"campaign",info:{campaign:{id:0,name:a.campaign,type:0,requireCallComments:!1,enableTransfer:!1,enableScheduledCall:!1,successQualifications:i,discardQualifications:o,previewDuration:"",showCampaignModelOnService:!1,skipCallQualification:!1},campaignList:{id:0,name:""},campaignContact:{id:r.campaignContactPhoneId??0,label:a.name,phoneNumber:a.phone}}};return{type:"manual",info:{successQualifications:i,discardQualifications:o}}}(s),[d])}function Xu(e,n){var r,i;const o=Uu(e),a=(null==(i=null==(r=o.view)?void 0:r.snapshot)?void 0:i.leg.qualifications)??[],s=JSON.stringify(a);return t.useMemo(()=>Wu(o.view,n),[s,n])}const Ju=new WeakMap;function Zu(e){return t.useMemo(()=>function(e){let t=Ju.get(e);if(!t){const n=new Ru(Bu(e.getState().view));e.subscribe(()=>n.set(Bu(e.getState().view))),t={breaks:n,user:e.userSignal,audioOutput:{setAudioOutputDevice:t=>{e.setOutputDevice(t).catch(()=>{})},setVolume:t=>e.setOutputVolume(t),setMute:t=>e.setOutputMuted(t)},stop:()=>{},goOffline:()=>{},becomeAvailable:()=>{var t,n;"onBreak"===(null==(n=null==(t=e.getState().view)?void 0:t.snapshot)?void 0:n.leg.status)&&e.command({name:"resume"})},enterOnBreak:t=>e.command(zu(t)),makeManualCall:t=>e.command({name:"dial",phone:t}),finishAfterCall:t=>{"number"==typeof t.qualificationId?e.command({name:"qualify",qualificationId:t.qualificationId,result:"failure"===t.result?"discard":"success"}):e.command({name:"finish"})}},Ju.set(e,t)}return t}(e),[e])}function Qu(){const e=t.useContext(Lu);return e?Zu(e):ku.useCallOperator()}function ec(){const e=t.useContext(Lu);return e?Ku(e):ku.useCallOperatorState()}function tc(){const e=t.useContext(Lu);return e?(n=e,t.useMemo(()=>({becomeAvailable:()=>{var e,t;"onBreak"===(null==(t=null==(e=n.getState().view)?void 0:e.snapshot)?void 0:t.leg.status)&&n.command({name:"resume"})},goOffline:()=>{},enterOnBreak:e=>n.command(zu(e)),makeManualCall:e=>n.command({name:"dial",phone:e}),finishAfterCall:e=>{"number"==typeof e.qualificationId?n.command({name:"qualify",qualificationId:e.qualificationId,result:"failure"===e.result?"discard":"success"}):n.command({name:"finish"})}}),[n])):ku.useCallOperatorControls();var n}function nc(){const e=t.useContext(Lu);return e?Vu(e)??void 0:ku.useCallOperatorCurrentCall()}function rc(){const e=t.useContext(Lu);return e?Yu(e):ku.useCallOperatorCurrentCallInfo()}function ic(){const e=t.useContext(Lu);return e?Xu(e,"success"):ku.useCallOperatorSuccessQualifications()}function oc(){const e=t.useContext(Lu);return e?Xu(e,"discard"):ku.useCallOperatorDiscardQualifications()}function ac(){const e=t.useContext(Lu);return e?(n=e,t.useMemo(()=>({answer:()=>n.command({name:"answer"}),reject:()=>n.command({name:"reject"}),hangup:()=>n.command({name:"hangup"}),isOnHold:()=>({local:!1,remote:!1}),hold:async()=>{},unhold:async()=>{},isMuted:()=>n.getState().inputMuted,mute:()=>n.setInputMuted(!0),unmute:()=>n.setInputMuted(!1)}),[n])):ku.useCallOperatorCurrentCallControls();var n}function sc(){const e=t.useContext(Lu);return e?function(e){const n=Uu(e),r=t.useCallback(t=>e.setInputMuted(t),[e]);return[n.inputMuted,r]}(e):ku.useCallOperatorAudioInputMuted()}function dc(){const e=t.useContext(Lu);return e?function(e){const n=Uu(e),r=t.useCallback(t=>e.setOutputMuted(t),[e]);return[n.outputMuted,r]}(e):ku.useCallOperatorAudioOutputMuted()}function lc(){const e=t.useContext(Lu);return e?function(e){const n=Uu(e),r=t.useCallback(t=>e.setOutputVolume(t),[e]);return[n.outputVolume,r]}(e):ku.useCallOperatorAudioOutputVolume()}function uc(e,n){const r=t.useContext(Lu);r?function(e,n,r){const i=t.useRef(r);i.current=r,t.useEffect(()=>e.onSessionLost(e=>{i.current({originator:e.originator})}),[e,n])}(r,e,n):ku.useCallOperatorEventListener(e,n)}var cc={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},fc=t.createContext&&t.createContext(cc),hc=["attr","size","title"];function pc(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mc(){return mc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mc.apply(this,arguments)}function gc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gc(Object(n),!0).forEach(function(t){vc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vc(e,t,n){var r;return(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?r:r+"")in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yc(e){return e&&e.map((e,n)=>t.createElement(e.tag,$c({key:n},e.attr),yc(e.child)))}function bc(e){return n=>t.createElement(xc,mc({attr:$c({},e.attr)},n),yc(e.child))}function xc(e){var n=n=>{var r,{attr:i,size:o,title:a}=e,s=pc(e,hc),d=o||n.size||"1em";return n.className&&(r=n.className),e.className&&(r=(r?r+" ":"")+e.className),t.createElement("svg",mc({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,i,s,{className:r,style:$c($c({color:e.color||n.color},n.style),e.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),a&&t.createElement("title",null,a),e.children)};return void 0!==fc?t.createElement(fc.Consumer,null,e=>n(e)):n(cc)}function wc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"22 12 18 12 15 21 9 3 6 12 2 12"},child:[]}]})(e)}function _c(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"16",x2:"12.01",y2:"16"},child:[]}]})(e)}function Cc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"},child:[]},{tag:"line",attr:{x1:"12",y1:"9",x2:"12",y2:"13"},child:[]},{tag:"line",attr:{x1:"12",y1:"17",x2:"12.01",y2:"17"},child:[]}]})(e)}function Sc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"19",y1:"12",x2:"5",y2:"12"},child:[]},{tag:"polyline",attr:{points:"12 19 5 12 12 5"},child:[]}]})(e)}function Ec(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"2",y:"7",width:"20",height:"14",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"},child:[]}]})(e)}function Nc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"},child:[]},{tag:"polyline",attr:{points:"22 4 12 14.01 9 11.01"},child:[]}]})(e)}function Tc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"polyline",attr:{points:"12 6 12 12 16 14"},child:[]}]})(e)}function Ac(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"},child:[]},{tag:"line",attr:{x1:"18",y1:"9",x2:"12",y2:"15"},child:[]},{tag:"line",attr:{x1:"12",y1:"9",x2:"18",y2:"15"},child:[]}]})(e)}function Oc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"4",y1:"9",x2:"20",y2:"9"},child:[]},{tag:"line",attr:{x1:"4",y1:"15",x2:"20",y2:"15"},child:[]},{tag:"line",attr:{x1:"10",y1:"3",x2:"8",y2:"21"},child:[]},{tag:"line",attr:{x1:"16",y1:"3",x2:"14",y2:"21"},child:[]}]})(e)}function Ic(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 18v-6a9 9 0 0 1 18 0v6"},child:[]},{tag:"path",attr:{d:"M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"},child:[]}]})(e)}function kc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"},child:[]},{tag:"polyline",attr:{points:"16 17 21 12 16 7"},child:[]},{tag:"line",attr:{x1:"21",y1:"12",x2:"9",y2:"12"},child:[]}]})(e)}function jc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"1",y1:"1",x2:"23",y2:"23"},child:[]},{tag:"path",attr:{d:"M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6"},child:[]},{tag:"path",attr:{d:"M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23"},child:[]},{tag:"line",attr:{x1:"12",y1:"19",x2:"12",y2:"23"},child:[]},{tag:"line",attr:{x1:"8",y1:"23",x2:"16",y2:"23"},child:[]}]})(e)}function Rc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"},child:[]},{tag:"path",attr:{d:"M19 10v2a7 7 0 0 1-14 0v-2"},child:[]},{tag:"line",attr:{x1:"12",y1:"19",x2:"12",y2:"23"},child:[]},{tag:"line",attr:{x1:"8",y1:"23",x2:"16",y2:"23"},child:[]}]})(e)}function Pc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]}]})(e)}function Dc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"10",y1:"15",x2:"10",y2:"9"},child:[]},{tag:"line",attr:{x1:"14",y1:"15",x2:"14",y2:"9"},child:[]}]})(e)}function Lc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.05 5A5 5 0 0 1 19 8.95M15.05 1A9 9 0 0 1 23 8.94m-1 7.98v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"},child:[]}]})(e)}function Mc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"16 2 16 8 22 8"},child:[]},{tag:"line",attr:{x1:"23",y1:"1",x2:"16",y2:"8"},child:[]},{tag:"path",attr:{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"},child:[]}]})(e)}function Uc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"},child:[]},{tag:"line",attr:{x1:"23",y1:"1",x2:"1",y2:"23"},child:[]}]})(e)}function Fc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"},child:[]}]})(e)}function Bc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"5",x2:"12",y2:"19"},child:[]},{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]}]})(e)}function qc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(e)}function zc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"},child:[]},{tag:"line",attr:{x1:"12",y1:"18",x2:"12.01",y2:"18"},child:[]}]})(e)}function Hc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"},child:[]},{tag:"circle",attr:{cx:"12",cy:"7",r:"4"},child:[]}]})(e)}function Wc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"},child:[]},{tag:"path",attr:{d:"M15.54 8.46a5 5 0 0 1 0 7.07"},child:[]}]})(e)}function Gc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"},child:[]},{tag:"path",attr:{d:"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"},child:[]}]})(e)}function Vc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"},child:[]},{tag:"line",attr:{x1:"23",y1:"9",x2:"17",y2:"15"},child:[]},{tag:"line",attr:{x1:"17",y1:"9",x2:"23",y2:"15"},child:[]}]})(e)}function Kc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"15",y1:"9",x2:"9",y2:"15"},child:[]},{tag:"line",attr:{x1:"9",y1:"9",x2:"15",y2:"15"},child:[]}]})(e)}function Yc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}var Xc=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);var Jc,Zc,Qc,ef,tf,nf,rf,of,af=(e,t)=>!!~e.indexOf(t),sf=(e,t="-")=>e.join(t),df=(e,t)=>sf(e.filter(Boolean),t),lf=(e,t=1)=>e.slice(t),uf=e=>e,cf=()=>{},ff=e=>e[0].toUpperCase()+lf(e),hf=e=>e.replace(/[A-Z]/g,"-$&").toLowerCase(),pf=(e,t)=>{for(;"function"==typeof e;)e=e(t);return e},mf=(e,t)=>{e.size>t&&e.delete(e.keys().next().value)},gf=(e,t)=>!af("@:&",e[0])&&(af("rg",(typeof t)[5])||Array.isArray(t)),$f=(e,t,n)=>t?Object.keys(t).reduce((e,r)=>{const i=pf(t[r],n);return gf(r,i)?e[hf(r)]=i:e[r]="@"==r[0]&&af("figa",r[1])?(e[r]||[]).concat(i):$f(e[r]||{},i,n),e},e):e,vf="undefined"!=typeof CSS&&CSS.escape||(e=>e.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& ")),yf=e=>(Array.isArray(e)||(e=[e]),"@media "+sf(e.map(e=>("string"==typeof e&&(e={min:e}),e.raw||sf(Object.keys(e).map(t=>`(${t}-width:${e[t]})`)," and "))),",")),bf=e=>{for(var t=9,n=e.length;n--;)t=Math.imul(t^e.charCodeAt(n),1597334677);return"tw-"+((t^t>>>9)>>>0).toString(36)},xf=(e="")=>(Jc.push(e),""),wf=e=>{Jc.length=Math.max(Jc.lastIndexOf("")+~~e,0)},_f=e=>e&&!af("!:",e[0]),Cf=e=>":"==e[0],Sf=(e,t)=>{Zc.push({v:Jc.filter(Cf),d:e,n:t,i:af(Jc,"!"),$:""})},Ef=e=>{const t="-"==e[0];t&&(e=lf(e));const n=sf(Jc.filter(_f));return Sf("&"==e?n:(n&&n+"-")+e,t),""},Nf=(e,t)=>{let n="";for(let r,i=!1,o=0;r=e[o++];)if(i||"["==r)n+=r,i="]"!=r;else switch(r){case":":n=n&&xf(":"+(e[o]==r?e[o++]:"")+n);break;case"(":n=n&&xf(n),xf();break;case"!":xf(r);break;case")":case" ":case"\t":case"\n":case"\r":n=n&&Ef(n),wf(")"!==r);break;default:n+=r}n&&(t?xf(":"+n):"-"==n.slice(-1)?xf(n.slice(0,-1)):Ef(n))},Tf=e=>{xf(),Af(e),wf()},Af=e=>{switch(typeof e){case"string":Nf(e);break;case"function":Sf(e);break;case"object":Array.isArray(e)?e.forEach(Tf):e&&Object.keys(e).forEach(t=>{((e,t)=>{if(t){xf();const n=af("tbu",(typeof t)[1]);Nf(e,n),n&&Tf(t),wf()}})(t,e[t])})}},Of=new WeakMap,If=e=>(Jc=[],Zc=[],Array.isArray(e[0])&&Array.isArray(e[0].raw)?(e=>{let t=Of.get(e);if(!t){let n=NaN,r="";t=e.map((t,i)=>{if(n==n||"["!=t.slice(-1)&&!af(":-(",(e[i+1]||"")[0])||(n=i),i>=n)return o=>{i==n&&(r=""),r+=t,af("rg",(typeof o)[5])?r+=o:o&&(Nf(r),r="",Af(o)),i==e.length-1&&Nf(r)};const o=Zc=[];Nf(t);const a=[...Jc];return Zc=[],e=>{Zc.push(...o),Jc=[...a],e&&Af(e)}}),Of.set(e,t)}return t})(e[0]).forEach((t,n)=>t(e[n+1])):Af(e),Zc),kf=(e,t)=>("function"==typeof t&&(Qc=!1),t),jf=new WeakMap,Rf=(e,t)=>{const n=(e=>{Qc=!0;const t=JSON.stringify(e,kf);return Qc&&t})(t);let r;if(n){var i=jf.get(e);i||jf.set(e,i=new Map),r=i.get(n)}return r||(r=Object.defineProperty((n,r)=>(r=Array.isArray(n)?r:n,pf(e(t,r),r)),"toJSON",{value:()=>n||t}),i&&(i.set(n,r),mf(i,1e4))),r},Pf=(e,{css:t})=>t(If(e)),Df=e=>(t,n,r,i)=>{if(t){const o=n&&e(n);if(o&&o.length>0)return o.reduce((e,n)=>(e[df([r,n,i])]=t,e),{})}},Lf=Df(e=>({t:["top-left","top-right"],r:["top-right","bottom-right"],b:["bottom-left","bottom-right"],l:["bottom-left","top-left"],tl:["top-left"],tr:["top-right"],bl:["bottom-left"],br:["bottom-right"]}[e])),Mf=e=>{const t=({x:"lr",y:"tb"}[e]||e||"").split("").sort();for(let n=t.length;n--;)if(!(t[n]={t:"top",r:"right",b:"bottom",l:"left"}[t[n]]))return;if(t.length)return t},Uf=Df(Mf),Ff=(e,t)=>e+(":"==t[1]?lf(t,2)+":":lf(t))+":",Bf=(e,t=e.d)=>"function"==typeof t?"":e.v.reduce(Ff,"")+(e.i?"!":"")+(e.n?"-":"")+t,qf=e=>"cols"==e?"columns":"rows",zf=e=>(t,n,r)=>({[e]:r+((ef=sf(t))&&"-"+ef)}),Hf=(e,t)=>(n,r,i)=>(ef=sf(n,t))&&{[e||i]:ef},Wf=e=>(t,{theme:n},r)=>(ef=n(e||r,t))&&{[e||r]:ef},Gf=(e,t)=>(n,{theme:r},i)=>(ef=r(e||i,n,sf(n,t)))&&{[e||i]:ef},Vf=(e,t)=>(n,r)=>e(n,r,t),Kf=zf("display"),Yf=zf("position"),Xf=zf("textTransform"),Jf=zf("textDecoration"),Zf=zf("fontStyle"),Qf=e=>(t,n,r)=>({["--tw-"+e]:r,fontVariantNumeric:"var(--tw-ordinal,/*!*/ /*!*/) var(--tw-slashed-zero,/*!*/ /*!*/) var(--tw-numeric-figure,/*!*/ /*!*/) var(--tw-numeric-spacing,/*!*/ /*!*/) var(--tw-numeric-fraction,/*!*/ /*!*/)"}),eh=(e,{theme:t},n)=>(ef=t("inset",e))&&{[n]:ef},th=(e,t,n,r=n)=>(ef=t(r+"Opacity",lf(e)))&&{[`--tw-${n}-opacity`]:ef},nh=(e,t)=>Math.round(parseInt(e,16)*t),rh=(e,t,n)=>e&&"#"==e[0]&&(ef=(e.length-1)/3)&&(nf=[17,1,.062272][ef-1])?`rgba(${nh(e.substr(1,ef),nf)},${nh(e.substr(1+ef,ef),nf)},${nh(e.substr(1+2*ef,ef),nf)},${t?`var(--tw-${t}${n?","+n:""})`:n||1})`:e,ih=(e,t,n)=>n&&"string"==typeof n?(ef=rh(n,t+"-opacity"))&&ef!==n?{[`--tw-${t}-opacity`]:"1",[e]:[n,ef]}:{[e]:n}:void 0,oh=e=>(nf=rh(e,"","0"))==ef?"transparent":nf,ah=(e,{theme:t},n,r,i,o)=>(ef={x:["right","left"],y:["bottom","top"]}[e[0]])&&(nf=`--tw-${n}-${e[0]}-reverse`)?"reverse"==e[1]?{[nf]:"1"}:{[nf]:"0",[df([i,ef[0],o])]:(tf=t(r,lf(e)))&&`calc(${tf} * var(${nf}))`,[df([i,ef[1],o])]:tf&&[tf,`calc(${tf} * calc(1 - var(${nf})))`]}:void 0,sh=(e,t)=>t[0]&&{[e]:(af("wun",(t[0]||"")[3])?"space-":"")+t[0]},dh=e=>t=>af(["start","end"],t[0])?{[e]:"flex-"+t[0]}:sh(e,t),lh=e=>(t,{theme:n})=>{if(ef=n("grid"+ff(e),t,""))return{["grid-"+e]:ef};switch(t[0]){case"span":return t[1]&&{["grid-"+e]:`span ${t[1]} / span ${t[1]}`};case"start":case"end":return(ef=n("grid"+ff(e)+ff(t[0]),lf(t),sf(lf(t))))&&{[`grid-${e}-${t[0]}`]:ef}}},uh=(e,{theme:t},n)=>{switch(e[0]){case"solid":case"dashed":case"dotted":case"double":case"none":return Hf("borderStyle")(e);case"collapse":case"separate":return Hf("borderCollapse")(e);case"opacity":return th(e,t,n)}return(ef=t(n+"Width",e,""))?{borderWidth:ef}:ih("borderColor",n,t(n+"Color",e))},ch=e=>(e?"translate3d(var(--tw-translate-x,0),var(--tw-translate-y,0),0)":"translateX(var(--tw-translate-x,0)) translateY(var(--tw-translate-y,0))")+" rotate(var(--tw-rotate,0)) skewX(var(--tw-skew-x,0)) skewY(var(--tw-skew-y,0)) scaleX(var(--tw-scale-x,1)) scaleY(var(--tw-scale-y,1))",fh=(e,t,n)=>e[0]&&(ef=t.theme(n,e[1]||e[0]))&&{[`--tw-${n}-x`]:"y"!==e[0]&&ef,[`--tw-${n}-y`]:"x"!==e[0]&&ef,transform:[`${n}${e[1]?e[0].toUpperCase():""}(${ef})`,ch()]},hh=e=>(t,n,r)=>r[1]?Uf(n.theme(e,t),r[1],e):Wf(e)(t,n,r),ph=hh("padding"),mh=hh("margin"),gh=(e,{theme:t},n)=>(ef={w:"width",h:"height"}[e[0]])&&{[ef=`${n}${ff(ef)}`]:t(ef,lf(e))},$h=(e,{theme:t},n)=>{const r=n.split("-"),i="backdrop"==r[0]?r[0]+"-":"";if(i||e.unshift(...r),"filter"==e[0]){const t=["blur","brightness","contrast","grayscale","hue-rotate","invert",i&&"opacity","saturate","sepia",!i&&"drop-shadow"].filter(Boolean);return"none"==e[1]?{[i+"filter"]:"none"}:t.reduce((e,t)=>(e["--tw-"+i+t]="var(--tw-empty,/*!*/ /*!*/)",e),{[i+"filter"]:t.map(e=>`var(--tw-${i}${e})`).join(" ")})}return nf=e.shift(),af(["hue","drop"],nf)&&(nf+=ff(e.shift())),(ef=t(i?"backdrop"+ff(nf):nf,e))&&{["--tw-"+i+nf]:(Array.isArray(ef)?ef:[ef]).map(e=>`${hf(nf)}(${e})`).join(" ")}},vh={group:(e,{tag:t},n)=>t(sf([n,...e])),hidden:Vf(Kf,"none"),inline:Kf,block:Kf,contents:Kf,flow:Kf,table:(e,t,n)=>af(["auto","fixed"],e[0])?{tableLayout:e[0]}:Kf(e,t,n),flex(e,t,n){switch(e[0]){case"row":case"col":return{flexDirection:sf("col"==e[0]?["column",...lf(e)]:e)};case"nowrap":case"wrap":return{flexWrap:sf(e)};case"grow":case"shrink":return null!=(ef=t.theme("flex"+ff(e[0]),lf(e),e[1]||1))&&{["flex-"+e[0]]:""+ef}}return(ef=t.theme("flex",e,""))?{flex:ef}:Kf(e,t,n)},grid(e,t,n){switch(e[0]){case"cols":case"rows":return(ef=t.theme("gridTemplate"+ff(qf(e[0])),lf(e),2==e.length&&Number(e[1])?`repeat(${e[1]},minmax(0,1fr))`:sf(lf(e))))&&{["gridTemplate-"+qf(e[0])]:ef};case"flow":return e.length>1&&{gridAutoFlow:sf("col"==e[1]?["column",...lf(e,2)]:lf(e)," ")}}return Kf(e,t,n)},auto:(e,{theme:t})=>af(["cols","rows"],e[0])&&(ef=t("gridAuto"+ff(qf(e[0])),lf(e),sf(lf(e))))&&{["gridAuto-"+qf(e[0])]:ef},static:Yf,fixed:Yf,absolute:Yf,relative:Yf,sticky:Yf,visible:{visibility:"visible"},invisible:{visibility:"hidden"},antialiased:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},"subpixel-antialiased":{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"},truncate:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},"sr-only":{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"},"not-sr-only":{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"},resize:e=>({resize:{x:"horizontal",y:"vertical"}[e[0]]||e[0]||"both"}),box:e=>e[0]&&{boxSizing:e[0]+"-box"},appearance:Hf(),cursor:Gf(),float:Hf(),clear:Hf(),decoration:Hf("boxDecorationBreak"),isolate:{isolation:"isolate"},isolation:Hf(),"mix-blend":Hf("mixBlendMode"),top:eh,right:eh,bottom:eh,left:eh,inset:(e,{theme:t})=>(ef=Mf(e[0]))?Uf(t("inset",lf(e)),e[0]):(ef=t("inset",e))&&{top:ef,right:ef,bottom:ef,left:ef},underline:Jf,"line-through":Jf,"no-underline":Vf(Jf,"none"),"text-underline":Vf(Jf,"underline"),"text-no-underline":Vf(Jf,"none"),"text-line-through":Vf(Jf,"line-through"),uppercase:Xf,lowercase:Xf,capitalize:Xf,"normal-case":Vf(Xf,"none"),"text-normal-case":Vf(Xf,"none"),italic:Zf,"not-italic":Vf(Zf,"normal"),"font-italic":Vf(Zf,"italic"),"font-not-italic":Vf(Zf,"normal"),font:(e,t,n)=>(ef=t.theme("fontFamily",e,""))?{fontFamily:ef}:Wf("fontWeight")(e,t,n),items:e=>e[0]&&{alignItems:af(["start","end"],e[0])?"flex-"+e[0]:sf(e)},"justify-self":Hf(),"justify-items":Hf(),justify:dh("justifyContent"),content:dh("alignContent"),self:dh("alignSelf"),place:e=>e[0]&&sh("place-"+e[0],lf(e)),overscroll:e=>e[0]&&{["overscrollBehavior"+(e[1]?"-"+e[0]:"")]:e[1]||e[0]},col:lh("column"),row:lh("row"),duration:Wf("transitionDuration"),delay:Wf("transitionDelay"),tracking:Wf("letterSpacing"),leading:Wf("lineHeight"),z:Wf("zIndex"),opacity:Wf(),ease:Wf("transitionTimingFunction"),p:ph,py:ph,px:ph,pt:ph,pr:ph,pb:ph,pl:ph,m:mh,my:mh,mx:mh,mt:mh,mr:mh,mb:mh,ml:mh,w:Wf("width"),h:Wf("height"),min:gh,max:gh,fill:Wf(),order:Wf(),origin:Gf("transformOrigin"," "),select:Hf("userSelect"),"pointer-events":Hf(),align:Hf("verticalAlign"),whitespace:Hf("whiteSpace"),"normal-nums":{fontVariantNumeric:"normal"},ordinal:Qf("ordinal"),"slashed-zero":Qf("slashed-zero"),"lining-nums":Qf("numeric-figure"),"oldstyle-nums":Qf("numeric-figure"),"proportional-nums":Qf("numeric-spacing"),"tabular-nums":Qf("numeric-spacing"),"diagonal-fractions":Qf("numeric-fraction"),"stacked-fractions":Qf("numeric-fraction"),overflow:(e,t,n)=>af(["ellipsis","clip"],e[0])?Hf("textOverflow")(e):e[1]?{["overflow-"+e[0]]:e[1]}:Hf()(e,t,n),transform:e=>"none"==e[0]?{transform:"none"}:{"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1",transform:ch("gpu"==e[0])},rotate:(e,{theme:t})=>(ef=t("rotate",e))&&{"--tw-rotate":ef,transform:[`rotate(${ef})`,ch()]},scale:fh,translate:fh,skew:fh,gap:(e,t,n)=>(ef={x:"column",y:"row"}[e[0]])?{[ef+"Gap"]:t.theme("gap",lf(e))}:Wf("gap")(e,t,n),stroke:(e,t,n)=>(ef=t.theme("stroke",e,""))?{stroke:ef}:Wf("strokeWidth")(e,t,n),outline:(e,{theme:t})=>(ef=t("outline",e))&&{outline:ef[0],outlineOffset:ef[1]},"break-normal":{wordBreak:"normal",overflowWrap:"normal"},"break-words":{overflowWrap:"break-word"},"break-all":{wordBreak:"break-all"},text(e,{theme:t},n){switch(e[0]){case"left":case"center":case"right":case"justify":return{textAlign:e[0]};case"uppercase":case"lowercase":case"capitalize":return Xf([],ef,e[0]);case"opacity":return th(e,t,n)}const r=t("fontSize",e,"");return r?"string"==typeof r?{fontSize:r}:{fontSize:r[0],..."string"==typeof r[1]?{lineHeight:r[1]}:r[1]}:ih("color","text",t("textColor",e))},bg(e,{theme:t},n){switch(e[0]){case"fixed":case"local":case"scroll":return Hf("backgroundAttachment",",")(e);case"bottom":case"center":case"left":case"right":case"top":return Hf("backgroundPosition"," ")(e);case"no":return"repeat"==e[1]&&Hf("backgroundRepeat")(e);case"repeat":return af("xy",e[1])?Hf("backgroundRepeat")(e):{backgroundRepeat:e[1]||e[0]};case"opacity":return th(e,t,n,"background");case"clip":case"origin":return e[1]&&{["background-"+e[0]]:e[1]+("text"==e[1]?"":"-box")};case"blend":return Hf("background-blend-mode")(lf(e));case"gradient":if("to"==e[1]&&(ef=Mf(e[2])))return{backgroundImage:`linear-gradient(to ${sf(ef," ")},var(--tw-gradient-stops))`}}return(ef=t("backgroundPosition",e,""))?{backgroundPosition:ef}:(ef=t("backgroundSize",e,""))?{backgroundSize:ef}:(ef=t("backgroundImage",e,""))?{backgroundImage:ef}:ih("backgroundColor","bg",t("backgroundColor",e))},from:(e,{theme:t})=>(ef=t("gradientColorStops",e))&&{"--tw-gradient-from":ef,"--tw-gradient-stops":`var(--tw-gradient-from),var(--tw-gradient-to,${oh(ef)})`},via:(e,{theme:t})=>(ef=t("gradientColorStops",e))&&{"--tw-gradient-stops":`var(--tw-gradient-from),${ef},var(--tw-gradient-to,${oh(ef)})`},to:(e,{theme:t})=>(ef=t("gradientColorStops",e))&&{"--tw-gradient-to":ef},border:(e,t,n)=>{var r;const i=null==(r=Mf(e[0]))?void 0:r.map(ff);i&&(e=lf(e));let o=uh(e,t,n);return i&&o&&"object"==typeof o&&(o=Object.entries(o).reduce((e,[t,n])=>{if(t.startsWith("border"))for(const r of i)e[t.slice(0,6)+r+t.slice(6)]=n;else e[t]=n;return e},{})),o},divide:(e,t,n)=>(ef=ah(e,t,n,"divideWidth","border","width")||uh(e,t,n))&&{"&>:not([hidden])~:not([hidden])":ef},space:(e,t,n)=>(ef=ah(e,t,n,"space","margin"))&&{"&>:not([hidden])~:not([hidden])":ef},placeholder:(e,{theme:t},n)=>(ef="opacity"==e[0]?th(e,t,n):ih("color","placeholder",t("placeholderColor",e)))&&{"&::placeholder":ef},shadow:(e,{theme:t})=>(ef=t("boxShadow",e))&&{":global":{"*":{"--tw-shadow":"0 0 transparent"}},"--tw-shadow":"none"==ef?"0 0 transparent":ef,boxShadow:[ef,"var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)"]},animate:(e,{theme:t,tag:n})=>{if(nf=t("animation",e)){const e=nf.split(" ");return(ef=t("keyframes",e[0],tf={}))!==tf?(nf=n(e[0]))&&{animation:nf+" "+sf(lf(e)," "),["@keyframes "+nf]:ef}:{animation:nf}}},ring(e,{theme:t},n){switch(e[0]){case"inset":return{"--tw-ring-inset":"inset"};case"opacity":return th(e,t,n);case"offset":return(ef=t("ringOffsetWidth",lf(e),""))?{"--tw-ring-offset-width":ef}:{"--tw-ring-offset-color":t("ringOffsetColor",lf(e))}}return(ef=t("ringWidth",e,""))?{"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${ef} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)",":global":{"*":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":t("ringOffsetWidth","","0px"),"--tw-ring-offset-color":t("ringOffsetColor","","#fff"),"--tw-ring-color":rh(t("ringColor","","#93c5fd"),"ring-opacity",t("ringOpacity","","0.5")),"--tw-ring-offset-shadow":"0 0 transparent","--tw-ring-shadow":"0 0 transparent"}}}:{"--tw-ring-opacity":"1","--tw-ring-color":rh(t("ringColor",e),"ring-opacity")}},object:(e,t,n)=>af(["contain","cover","fill","none","scale-down"],sf(e))?{objectFit:sf(e)}:Gf("objectPosition"," ")(e,t,n),list:(e,t,n)=>"item"==sf(e)?Kf(e,t,n):af(["inside","outside"],sf(e))?{listStylePosition:e[0]}:Gf("listStyleType")(e,t,n),rounded:(e,t,n)=>Lf(t.theme("borderRadius",lf(e),""),e[0],"border","radius")||Wf("borderRadius")(e,t,n),"transition-none":{transitionProperty:"none"},transition:(e,{theme:t})=>({transitionProperty:t("transitionProperty",e),transitionTimingFunction:t("transitionTimingFunction",""),transitionDuration:t("transitionDuration","")}),container:(e,{theme:t})=>{const{screens:n=t("screens"),center:r,padding:i}=t("container"),o=e=>(ef=i&&("string"==typeof i?i:i[e]||i.DEFAULT))?{paddingRight:ef,paddingLeft:ef}:{};return Object.keys(n).reduce((e,t)=>((nf=n[t])&&"string"==typeof nf&&(e[yf(nf)]={"&":{"max-width":nf,...o(t)}}),e),{width:"100%",...r?{marginRight:"auto",marginLeft:"auto"}:{},...o("xs")})},filter:$h,blur:$h,brightness:$h,contrast:$h,grayscale:$h,"hue-rotate":$h,invert:$h,saturate:$h,sepia:$h,"drop-shadow":$h,backdrop:$h},yh={dark:"@media (prefers-color-scheme:dark)",sticky:"@supports ((position: -webkit-sticky) or (position:sticky))","motion-reduce":"@media (prefers-reduced-motion:reduce)","motion-safe":"@media (prefers-reduced-motion:no-preference)",first:"&:first-child",last:"&:last-child",even:"&:nth-child(2n)",odd:"&:nth-child(odd)",children:"&>*",siblings:"&~*",sibling:"&+*",override:"&&"},bh="__twind",xh=e=>{let t=self[bh];return t||(t=document.head.appendChild(document.createElement("style")),t.id=bh,e&&(t.nonce=e),t.appendChild(document.createTextNode(""))),t},wh=e=>({unknown(e,t=[],n,r){n||this.report({id:"UNKNOWN_THEME_VALUE",key:e+"."+sf(t)},r)},report:({id:t,...n})=>e(`[${t}] ${JSON.stringify(n)}`)}),_h=wh(e=>console.warn(e)),Ch=wh(e=>{throw new Error(e)}),Sh=wh(cf),Eh=(e,t,n)=>`${e}:${t}${n?" !important":""}`,Nh=(e,t,n)=>{let r="";const i=(o=e,Xc.get(o));var o;i&&(r+=`${Eh(i,t,n)};`);let a=function(e){var t=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(e);return t?t[1]?1:t[2]?2:t[3]?3:5:0}(e);return 1&a&&(r+=`-webkit-${Eh(e,t,n)};`),2&a&&(r+=`-moz-${Eh(e,t,n)};`),4&a&&(r+=`-ms-${Eh(e,t,n)};`),a=function(e,t){var n=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(e);return n?n[1]?/^sti/i.test(t)?1:0:n[2]?/^pat/i.test(t)?1:0:n[3]?/^image-/i.test(t)?1:0:n[4]?"-"===t[3]?2:0:/^(?:inline-)?grid$/i.test(t)?4:0:0}(e,t),1&a&&(r+=`${Eh(e,`-webkit-${t}`,n)};`),2&a&&(r+=`${Eh(e,`-moz-${t}`,n)};`),4&a&&(r+=`${Eh(e,`-ms-${t}`,n)};`),r+=Eh(e,t,n),r},Th=(e,t)=>{const n={};do{for(let t=1;t<e;t++)n[`${t}/${e}`]=Number((t/e*100).toFixed(6))+"%"}while(++e<=t);return n},Ah=(e,t,n=0)=>{const r={};for(;n<=e;n=2*n||1)r[n]=n+t;return r},Oh=(e,t="",n=1,r=0,i=1,o={})=>{for(;r<=e;r+=i)o[r]=r/n+t;return o},Ih=e=>t=>t(e),kh={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},colors:{transparent:"transparent",current:"currentColor",black:"#000",white:"#fff",gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},yellow:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},green:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},purple:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"}},spacing:{px:"1px",0:"0px",...Oh(4,"rem",4,.5,.5),...Oh(12,"rem",4,5),14:"3.5rem",...Oh(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},backdropBlur:Ih("blur"),backdropBrightness:Ih("brightness"),backdropContrast:Ih("contrast"),backdropGrayscale:Ih("grayscale"),backdropHueRotate:Ih("hueRotate"),backdropInvert:Ih("invert"),backdropOpacity:Ih("opacity"),backdropSaturate:Ih("saturate"),backdropSepia:Ih("sepia"),backgroundColor:Ih("colors"),backgroundImage:{none:"none"},backgroundOpacity:Ih("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...Oh(200,"",100,0,50),...Oh(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:e=>({...e("colors"),DEFAULT:e("colors.gray.200","currentColor")}),borderOpacity:Ih("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderWidth:{DEFAULT:"1px",...Ah(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none"},contrast:{...Oh(200,"",100,0,50),75:"0.75",125:"1.25"},divideColor:Ih("borderColor"),divideOpacity:Ih("borderOpacity"),divideWidth:Ih("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:{current:"currentColor"},grayscale:{0:"0",DEFAULT:"100%"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{0:"0",DEFAULT:"100%"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gridTemplateColumns:{},gridTemplateRows:{},gridAutoColumns:{min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gap:Ih("spacing"),gradientColorStops:Ih("colors"),height:e=>({auto:"auto",...e("spacing"),...Th(2,6),full:"100%",screen:"100vh"}),inset:e=>({auto:"auto",...e("spacing"),...Th(2,4),full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",...Oh(10,"rem",4,3)},margin:e=>({auto:"auto",...e("spacing")}),maxHeight:e=>({...e("spacing"),full:"100%",screen:"100vh"}),maxWidth:(e,{breakpoints:t})=>({none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",prose:"65ch",...t(e("screens"))}),minHeight:{0:"0px",full:"100%",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content"},opacity:{...Oh(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0",...Oh(12,"",1,1)},outline:{none:["2px solid transparent","2px"],white:["2px dotted white","2px"],black:["2px dotted black","2px"]},padding:Ih("spacing"),placeholderColor:Ih("colors"),placeholderOpacity:Ih("opacity"),ringColor:e=>({DEFAULT:e("colors.blue.500","#3b82f6"),...e("colors")}),ringOffsetColor:Ih("colors"),ringOffsetWidth:Ah(8,"px"),ringOpacity:e=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",...Ah(8,"px")},rotate:{...Ah(2,"deg"),...Ah(12,"deg",3),...Ah(180,"deg",45)},saturate:Oh(200,"",100,0,50),scale:{...Oh(150,"",100,0,50),...Oh(110,"",100,90,5),75:"0.75",125:"1.25"},sepia:{0:"0",DEFAULT:"100%"},skew:{...Ah(2,"deg"),...Ah(12,"deg",3)},space:Ih("spacing"),stroke:{current:"currentColor"},strokeWidth:Oh(2),textColor:Ih("colors"),textOpacity:Ih("opacity"),transitionDuration:e=>({DEFAULT:"150ms",...e("durations")}),transitionDelay:Ih("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"background-color,border-color,color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:e=>({...e("spacing"),...Th(2,4),full:"100%"}),width:e=>({auto:"auto",...e("spacing"),...Th(2,6),...Th(12,12),screen:"100vw",full:"100%",min:"min-content",max:"max-content"}),zIndex:{auto:"auto",...Oh(50,"",1,0,10)}},jh=(e,t={},n=[])=>(Object.keys(e).forEach(r=>{const i=e[r];"DEFAULT"==r&&(t[sf(n)]=i,t[sf(n,".")]=i);const o=[...n,r];t[sf(o)]=i,t[sf(o,".")]=i,i&&"object"==typeof i&&jh(i,t,o)},t),t),Rh={negative:()=>({}),breakpoints:e=>Object.keys(e).filter(t=>"string"==typeof e[t]).reduce((t,n)=>(t["screen-"+n]=e[n],t),{})},Ph=e=>{const t=new Map,n={...kh,...e},r=(e,t)=>{const n=e&&e[t],r="function"==typeof n?n(i,Rh):n;return r&&"colors"==t?jh(r):r},i=(e,i,o)=>{const a=e.split(".");e=a[0],a.length>1&&(o=i,i=sf(lf(a),"."));let s=t.get(e);if(s||(t.set(e,s={...r(n,e)}),Object.assign(s,r(n.extend,e))),null!=i){const t=((e,t)=>(t="["==t[0]&&"]"==t.slice(-1)&&t.slice(1,-1))&&af(e,"olor")==/^(#|(hsl|rgb)a?\(|[a-z]+$)/.test(t)&&(af(t,"calc(")?t.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "):t))(e,i=(Array.isArray(i)?sf(i):i)||"DEFAULT")||s[i];return null==t?o:Array.isArray(t)&&!af(["fontSize","outline","dropShadow"],e)?sf(t,","):t}return s};return i},Dh=/^:(group(?:(?!-focus).+?)*)-(.+)$/,Lh=/^(:not)-(.+)/,Mh=e=>"["==e[1]?lf(e):e,Uh=e=>(31&((of=/(?:^|min-width: *)(\d+(?:.\d+)?)(p)?/.exec(e))?+of[1]/(of[2]?15:1)/10:0))<<22,Fh=e=>{of=0;for(let t=e.length;t--;)of+=af("-:,",e[t]);return of},Bh=e=>(15&Fh(e))<<18,qh=["rst","st","en","d","nk","sited","pty","ecked","cus-w","ver","cus","cus-v","tive","sable","ad-on","tiona","quire"],zh=(e,t)=>(n,r)=>{return n|((of=e("screens",lf(r),""))?1<<27|Uh(yf(of)):":dark"==r?1<<30:"@"==(of=t[r]||r.replace(Lh,":$2"))[0]?Bh(of):(i=r,1<<(~(of=qh.indexOf(i.replace(Dh,":$2").slice(3,8)))?of:17)));var i},Hh=(e,t)=>t+"{"+e+"}",Wh=(e,t,n)=>{const{theme:r,tag:i}=n,o=(e,t)=>"--"+i(t),a=e=>`${e}`.replace(/--(tw-[\w-]+)\b/g,o);let s;const d=(t,r,i,o,l)=>{if(Array.isArray(o))return void o.forEach(e=>e&&d(t,r,i,e,l));let u="",c=0,f=0;o["@apply"]&&(o=$f(pf(((...e)=>Rf(Pf,e))(o["@apply"]),n),{...o,"@apply":void 0},n)),Object.keys(o).forEach(h=>{const p=pf(o[h],n);if(gf(h,p)){if(""!==p&&h.length>1){const t=hf(h);f+=1,c=Math.max(c,(e=>"-"==e[0]?0:Fh(e)+((of=/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7}$)|([fl].{5}l|g.{8}$|pl))/.exec(e))?+!!of[1]||-!!of[2]:0)+1)(t)),u=(u&&u+";")+((t,n,r)=>(t=a(t),Array.isArray(n)?sf(n.filter(Boolean).map(n=>e(t,a(n),r)),";"):e(t,a(n),r)))(t,p,l)}}else if(p)if(":global"==h&&(h="@global"),"@"==h[0])if("g"==h[1])d([],"",0,p,l);else if("f"==h[1])d([],h,0,p,l);else if("k"==h[1]){const e=s.length;d([],"",0,p,l);const t=s.splice(e,s.length-e);s.push({r:Hh(sf(t.map(e=>e.r),""),h),p:t.reduce((e,t)=>e+t.p,0)})}else"i"==h[1]?(Array.isArray(p)?p:[p]).forEach(e=>e&&s.push({p:0,r:`${h} ${e};`})):("c"==h[2]&&(h=yf(n.theme("screens",lf(h,8).trim()))),d([...t,h],r,i|Uh(h)|Bh(h),p,l));else d(t,r?r.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(e,t,n)=>h.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(e,n,r)=>(af(n,"&")?n.replace(/&/g,t):(t&&t+" ")+n)+r)+n):h,i,p,l)}),f&&s.push({r:t.reduceRight(Hh,Hh(u,r)),p:256*i+((15&Math.max(0,15-f))<<4|15&(c||15))})},l=zh(r,t);return(e,t,n,r=0)=>(r<<=28,s=[],d([],t?"."+vf(t):"",n?n.v.reduceRight(l,r):r,e,n&&n.i),s)},Gh=(e,t,n,r=t)=>!1===e?n:!0===e?r:e||t,Vh={_:{value:"",writable:!0}},Kh=(e={})=>{const t=Ph(e.theme),n=(e=>("string"==typeof e?{t:Ch,a:_h,i:Sh}[e[1]]:e)||_h)(e.mode),r=Gh(e.hash,!1,!1,bf),i=e.important;let o={v:[]},a=0;const s=[],d={tw:(...e)=>b(e),theme:(e,r,i)=>{var a;const s=null!=(a=t(e,r,i))?a:n.unknown(e,null==r||Array.isArray(r)?r:r.split("."),null!=i,d);return o.n&&s&&af("rg",(typeof s)[5])?`calc(${s} * -1)`:s},tag:e=>r?r(e):e,css:e=>{a++;const t=s.length;try{("string"==typeof e?If([e]):e).forEach(y);const n=Object.create(null,Vh);for(let e=t;e<s.length;e++){const t=s[e];if(t)switch(typeof t){case"object":$f(n,t,d);break;case"string":n._+=(n._&&" ")+t}}return n}finally{s.length=t,a--}}},l=((e,t)=>(n,r)=>{if("function"==typeof n.d)return n.d(t);const i=n.d.split(/-(?![^[]*])/g);if(!r&&"tw"==i[0]&&n.$==n.d)return n.$;for(let o=i.length;o;o--){const n=sf(i.slice(0,o));if(Object.prototype.hasOwnProperty.call(e,n)){const a=e[n];return"function"==typeof a?a(lf(i,o),t,n):"string"==typeof a?t[r?"css":"tw"](a):a}}})({...vh,...e.plugins},d),u={...yh,...e.variants},c=((e,t,{theme:n,tag:r})=>{const i=(i,o)=>(rf=n("screens",lf(o),""))?{[yf(rf)]:i}:":dark"==o&&"class"==e?{".dark &":i}:(rf=Dh.exec(o))?{[`.${vf(r(rf[1]))}:${rf[2]} &`]:i}:{[t[lf(o)]||"&"+o.replace(Lh,(e,t,n)=>t+"("+Mh(":"+n)+")")]:i};return(e,t)=>t.v.reduceRight(i,e)})(e.darkMode||"media",u,d),f=Wh(Gh(e.prefix,Nh,Eh),u,d),h=e.sheet||("undefined"==typeof window?{target:null,insert:cf}:(({nonce:e,target:t=xh(e).sheet}={})=>{const n=t.cssRules.length;return{target:t,insert:(e,r)=>t.insertRule(e,n+r)}})(e)),{init:p=e=>e()}=h,m=((e,t,n,r)=>{let i,o;return n((e=[])=>i=e),n((e=new Set)=>o=e),({r:n,p:a})=>{if(!o.has(n)){o.add(n);const d=((e,t)=>{for(var n=0,r=e.length;n<r;){const i=r+n>>1;e[i]<=t?n=i+1:r=i}return r})(i,a);try{e.insert(n,d),i.splice(d,0,a)}catch(s){/:-[mwo]/.test(n)||t.report({id:"INJECT_CSS_ERROR",css:n,error:s},r)}}}})(h,n,p,d);let g;p((e=new Map)=>g=e);const $=new WeakMap,v=(e,t)=>"_"==e?void 0:"function"==typeof t?JSON.stringify(pf(t,d),v):t,y=e=>{!a&&o.v.length&&(e={...e,v:[...o.v,...e.v],$:""}),e.$||(e.$=Bf(e,$.get(e.d)));let t=a?null:g.get(e.$);if(null==t){let u=(e=>{const t=o;o=e;try{return pf(l(e),d)}finally{o=t}})(e);if(e.$||(e.$=bf(JSON.stringify(u,v)),$.set(e.d,e.$),e.$=Bf(e,e.$)),u&&"object"==typeof u)if(e.v=e.v.map(Mh),i&&(e.i=i),u=c(u,e),a)s.push(u);else{const n="function"==typeof e.d?"string"==typeof u._?1:3:2;t=r||"function"==typeof e.d?(r||bf)(n+e.$):e.$,f(u,t,e,n).forEach(m),u._&&(t+=" "+u._)}else"string"==typeof u?t=u:(t=e.$,n.report({id:"UNKNOWN_DIRECTIVE",rule:t},d)),a&&"function"!=typeof e.d&&s.push(t);a||(g.set(e.$,t),mf(g,3e4))}return t},b=e=>sf(If(e).map(y).filter(Boolean)," "),x=Gh(e.preflight,uf,!1);if(x){const e=(e=>({":root":{tabSize:4},"body,blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre,fieldset,ol,ul":{margin:"0"},button:{backgroundColor:"transparent",backgroundImage:"none"},'button,[type="button"],[type="reset"],[type="submit"]':{WebkitAppearance:"button"},"button:focus":{outline:["1px dotted","5px auto -webkit-focus-ring-color"]},"fieldset,ol,ul,legend":{padding:"0"},"ol,ul":{listStyle:"none"},html:{lineHeight:"1.5",WebkitTextSizeAdjust:"100%",fontFamily:e("fontFamily.sans","ui-sans-serif,system-ui,sans-serif")},body:{fontFamily:"inherit",lineHeight:"inherit"},"*,::before,::after":{boxSizing:"border-box",border:`0 solid ${e("borderColor.DEFAULT","currentColor")}`},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},img:{borderStyle:"solid"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:"1",color:e("placeholderColor.DEFAULT",e("colors.gray.400","#a1a1aa"))},'button,[role="button"]':{cursor:"pointer"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",margin:"0",padding:"0",lineHeight:"inherit",color:"inherit"},"button,select":{textTransform:"none"},"::-moz-focus-inner":{borderStyle:"none",padding:"0"},":-moz-focusring":{outline:"1px dotted ButtonText"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},'[type="search"]':{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"abbr[title]":{textDecoration:"underline dotted"},"b,strong":{fontWeight:"bolder"},"pre,code,kbd,samp":{fontFamily:e("fontFamily","mono","ui-monospace,monospace"),fontSize:"1em"},"sub,sup":{fontSize:"75%",lineHeight:"0",position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"}}))(t),n=f("function"==typeof x?pf(x(e,d),d)||e:{...e,...x});p((e=(n.forEach(m),!0))=>e)}return{init:()=>n.report({id:"LATE_SETUP_CALL"},d),process:b}},Yh=e=>{let t,n=e=>(r(),n(e)),r=e=>{({process:n,init:r}=Kh(e))};return{tw:Object.defineProperties((...e)=>n(e),{theme:{get:(i="theme",()=>(t||n([e=>(t=e,"")]),t[i]))}}),setup:e=>r(e)};var i},{tw:Xh,setup:Jh}=Yh();let Zh={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...tp(4,"rem",4,.5,.5),...tp(12,"rem",4,5),14:"3.5rem",...tp(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:np("blur"),backdropBrightness:np("brightness"),backdropContrast:np("contrast"),backdropGrayscale:np("grayscale"),backdropHueRotate:np("hueRotate"),backdropInvert:np("invert"),backdropOpacity:np("opacity"),backdropSaturate:np("saturate"),backdropSepia:np("sepia"),backgroundColor:np("colors"),backgroundImage:{none:"none"},backgroundOpacity:np("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...tp(200,"",100,0,50),...tp(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:e})=>({DEFAULT:e("colors.gray.200","currentColor"),...e("colors")}),borderOpacity:np("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:np("spacing"),borderWidth:{DEFAULT:"1px",...ep(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:np("colors"),caretColor:np("colors"),accentColor:({theme:e})=>({auto:"auto",...e("colors")}),contrast:{...tp(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:np("borderColor"),divideOpacity:np("borderOpacity"),divideWidth:np("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:e})=>({...e("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({...e("spacing"),...Qh(2,6),...Qh(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:np("spacing"),gradientColorStops:np("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:e})=>({...e("spacing"),...Qh(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:e})=>({...e("spacing"),...Qh(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...tp(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),maxHeight:({theme:e})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...e("spacing")}),maxWidth:({theme:e,breakpoints:t})=>({...t(e("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...tp(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:np("spacing"),placeholderColor:np("colors"),placeholderOpacity:np("opacity"),outlineColor:np("colors"),outlineOffset:ep(8,"px"),outlineWidth:ep(8,"px"),ringColor:({theme:e})=>({...e("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:np("colors"),ringOffsetWidth:ep(8,"px"),ringOpacity:({theme:e})=>({...e("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...ep(8,"px")},rotate:{...ep(2,"deg"),...ep(12,"deg",3),...ep(180,"deg",45)},saturate:tp(200,"",100,0,50),scale:{...tp(150,"",100,0,50),...tp(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:np("spacing"),scrollPadding:np("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...ep(2,"deg"),...ep(12,"deg",3)},space:np("spacing"),stroke:({theme:e})=>({...e("colors"),none:"none"}),strokeWidth:tp(2),textColor:np("colors"),textDecorationColor:np("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...ep(8,"px")},textUnderlineOffset:{auto:"auto",...ep(8,"px")},textIndent:np("spacing"),textOpacity:np("opacity"),transitionDuration:({theme:e})=>({...e("durations"),DEFAULT:"150ms"}),transitionDelay:np("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:e})=>({...e("spacing"),...Qh(2,4),full:"100%"}),width:({theme:e})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...e("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...tp(50,"",1,0,10),auto:"auto"}};function Qh(e,t){let n={};do{for(var r=1;r<e;r++)n[`${r}/${e}`]=Number((r/e*100).toFixed(6))+"%"}while(++e<=t);return n}function ep(e,t,n=0){let r={};for(;n<=e;n=2*n||1)r[n]=n+t;return r}function tp(e,t="",n=1,r=0,i=1,o={}){for(;r<=e;r+=i)o[r]=r/n+t;return o}function np(e){return({theme:t})=>t(e)}let rp={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${Zh.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${Zh.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};function ip(e,t="@media "){return t+op(e).map(e=>("string"==typeof e&&(e={min:e}),e.raw||Object.keys(e).map(t=>`(${t}-width:${e[t]})`).join(" and "))).join(",")}function op(e=[]){return Array.isArray(e)?e:null==e?[]:[e]}function ap(e,t){return Math.round(parseInt(e,16)*t)}function sp(e,t={}){if("function"==typeof e)return e(t);let{opacityValue:n="1",opacityVariable:r}=t,i=r?`var(${r})`:n;if(e.includes("<alpha-value>"))return e.replace("<alpha-value>",i);if("#"==e[0]&&(4==e.length||7==e.length)){let t=(e.length-1)/3,n=[17,1,.062272][t-1];return`rgba(${[ap(e.substr(1,t),n),ap(e.substr(1+t,t),n),ap(e.substr(1+2*t,t),n),i]})`}return"1"==i?e:"0"==i?"#0000":e.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${i})`)}function dp(e,t,n){return[e,lp(t,n)]}function lp(e,t){return"function"==typeof e?e:"string"==typeof e&&/^[\w-]+$/.test(e)?(n,r)=>({[e]:t?t(n,r):up(n,1)}):t=>e||{[t[1]]:up(t,2)}}function up(e,t,n=e.slice(t).find(Boolean)||e.$$||e.input){return"-"==e.input[0]?`calc(${n} * -1)`:n}function cp(e,t,n,r){return[e,fp(t,n,r)]}function fp(e,t,n){let r="string"==typeof t?(e,r)=>({[t]:n?n(e,r):e._}):t||(({1:e,_:t},n,r)=>({[e||r]:t}));return(t,n)=>{let i=$p(e||t[1]),o=n.theme(i,t.$$)??gp(t.$$,i,n);if(null!=o)return t._=up(t,0,o),r(t,n,i)}}function hp(e,t={},n){return[e,pp(t,n)]}function pp(e={},t){return(n,r)=>{let{section:i=$p(n[0]).replace("-","")+"Color"}=e,[o,a]=(n.$$.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1);if(!o)return;let s=r.theme(i,o)||gp(o,i,r);if(!s||"object"==typeof s)return;let{opacityVariable:d=`--tw-${n[0].replace(/-$/,"")}-opacity`,opacitySection:l=i.replace("Color","Opacity"),property:u=i,selector:c}=e,f=r.theme(l,a||"DEFAULT")||a&&gp(a,l,r),h=t||(({_:e})=>{let t=mp(u,e);return c?{[c]:t}:t});n._={value:sp(s,{opacityVariable:d||void 0,opacityValue:f||void 0}),color:e=>sp(s,e),opacityVariable:d||void 0,opacityValue:f||void 0};let p=h(n,r);if(!n.dark){let e=r.d(i,o,s);e&&e!==s&&(n._={value:sp(e,{opacityVariable:d||void 0,opacityValue:f||"1"}),color:t=>sp(e,t),opacityVariable:d||void 0,opacityValue:f||void 0},p={"&":p,[r.v("dark")]:h(n,r)})}return p}}function mp(e,t){let n={};return"string"==typeof t?n[e]=t:(t.opacityVariable&&t.value.includes(t.opacityVariable)&&(n[t.opacityVariable]=t.opacityValue||"1"),n[e]=t.value),n}function gp(e,t,n){if("["==e[0]&&"]"==e.slice(-1)){if(e=vp(function(e,t){return e.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(e,n,r,i,o="")=>{let a=t(r,o);return"function"==typeof a&&/color|fill|stroke/i.test(r)?sp(a):""+op(a).filter(e=>Object(e)!==e)})}(e.slice(1,-1),n.theme)),!t)return e;if(!(/color|fill|stroke/i.test(t)&&!/^color:/.test(e)&&!/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(e)||/image/i.test(t)&&!/^image:/.test(e)&&!/^[a-z-]+\(/.test(e)||/weight/i.test(t)&&!/^(number|any):/.test(e)&&!/^\d+$/.test(e)||/position/i.test(t)&&/^(length|size):/.test(e)))return e.replace(/^[a-z-]+:/,"")}}function $p(e){return e.replace(/-./g,e=>e[1].toUpperCase())}function vp(e){return e.includes("url(")?e.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",n,r="")=>vp(t)+n+vp(r)):e.replace(/(^|[^\\])_+/g,(e,t)=>t+" ".repeat(e.length-t.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}let yp=[dp("\\[([-\\w]+):(.+)]",({1:e,2:t},n)=>({"@layer overrides":{"&":{[e]:gp(`[${t}]`,"",n)}}})),dp("(group|peer)([~/][^-[]+)?",({input:e},{h:t})=>[{c:t(e)}]),cp("aspect-","aspectRatio"),dp("container",(e,{theme:t})=>{let{screens:n=t("screens"),center:r,padding:i}=t("container"),o={width:"100%",marginRight:r&&"auto",marginLeft:r&&"auto",...a("xs")};for(let s in n){let e=n[s];"string"==typeof e&&(o[ip(e)]={"&":{maxWidth:e,...a(s)}})}return o;function a(e){let t=i&&("string"==typeof i?i:i[e]||i.DEFAULT);if(t)return{paddingRight:t,paddingLeft:t}}}),cp("content-","content",({_:e})=>({"--tw-content":e,content:"var(--tw-content)"})),dp("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),dp("box-(border|content)","boxSizing",({1:e})=>e+"-box"),dp("hidden",{display:"none"}),dp("table-(auto|fixed)","tableLayout"),dp(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",dp("isolate","isolation"),dp("object-(contain|cover|fill|none|scale-down)","objectFit"),cp("object-","objectPosition"),dp("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",bp),dp("overscroll(-[xy])?-(auto|contain|none)",({1:e="",2:t})=>({["overscroll-behavior"+e]:t})),dp("(static|fixed|absolute|relative|sticky)","position"),cp("-?inset(-[xy])?(?:$|-)","inset",({1:e,_:t})=>({top:"-x"!=e&&t,right:"-y"!=e&&t,bottom:"-x"!=e&&t,left:"-y"!=e&&t})),cp("-?(top|bottom|left|right)(?:$|-)","inset"),dp("(visible|collapse)","visibility"),dp("invisible",{visibility:"hidden"}),cp("-?z-","zIndex"),dp("flex-((row|col)(-reverse)?)","flexDirection",xp),dp("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),cp("(flex-(?:grow|shrink))(?:$|-)"),cp("(flex)-"),cp("grow(?:$|-)","flexGrow"),cp("shrink(?:$|-)","flexShrink"),cp("basis-","flexBasis"),cp("-?(order)-"),"-?(order)-(\\d+)",cp("grid-cols-","gridTemplateColumns"),dp("grid-cols-(\\d+)","gridTemplateColumns",Ip),cp("col-","gridColumn"),dp("col-(span)-(\\d+)","gridColumn",Op),cp("col-start-","gridColumnStart"),dp("col-start-(auto|\\d+)","gridColumnStart"),cp("col-end-","gridColumnEnd"),dp("col-end-(auto|\\d+)","gridColumnEnd"),cp("grid-rows-","gridTemplateRows"),dp("grid-rows-(\\d+)","gridTemplateRows",Ip),cp("row-","gridRow"),dp("row-(span)-(\\d+)","gridRow",Op),cp("row-start-","gridRowStart"),dp("row-start-(auto|\\d+)","gridRowStart"),cp("row-end-","gridRowEnd"),dp("row-end-(auto|\\d+)","gridRowEnd"),dp("grid-flow-((row|col)(-dense)?)","gridAutoFlow",e=>bp(xp(e))),dp("grid-flow-(dense)","gridAutoFlow"),cp("auto-cols-","gridAutoColumns"),cp("auto-rows-","gridAutoRows"),cp("gap-x(?:$|-)","gap","columnGap"),cp("gap-y(?:$|-)","gap","rowGap"),cp("gap(?:$|-)","gap"),"(justify-(?:items|self))-",dp("justify-","justifyContent",Cp),dp("(content|items|self)-",e=>({["align-"+e[1]]:Cp(e)})),dp("(place-(content|items|self))-",({1:e,$$:t})=>({[e]:("wun".includes(t[3])?"space-":"")+t})),cp("p([xytrbl])?(?:$|-)","padding",Sp("padding")),cp("-?m([xytrbl])?(?:$|-)","margin",Sp("margin")),cp("-?space-(x|y)(?:$|-)","space",({1:e,_:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${e}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[e]]:`calc(${t} * calc(1 - var(--tw-space-${e}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[e]]:`calc(${t} * var(--tw-space-${e}-reverse))`}})),dp("space-(x|y)-reverse",({1:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${e}-reverse`]:"1"}})),cp("w-","width"),cp("min-w-","minWidth"),cp("max-w-","maxWidth"),cp("h-","height"),cp("min-h-","minHeight"),cp("max-h-","maxHeight"),cp("font-","fontWeight"),cp("font-","fontFamily",({_:e})=>"string"==typeof(e=op(e))[1]?{fontFamily:_p(e)}:{fontFamily:_p(e[0]),...e[1]}),dp("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),dp("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),dp("italic","fontStyle"),dp("not-italic",{fontStyle:"normal"}),dp("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:e,2:t="",3:n})=>"normal"==t?{fontVariantNumeric:"normal"}:{["--tw-"+(n?"numeric-fraction":"pt".includes(t[0])?"numeric-spacing":t?"numeric-figure":e)]:e,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...kp({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),cp("tracking-","letterSpacing"),cp("leading-","lineHeight"),dp("list-(inside|outside)","listStylePosition"),cp("list-","listStyleType"),dp("list-","listStyleType"),cp("placeholder-opacity-","placeholderOpacity",({_:e})=>({"&::placeholder":{"--tw-placeholder-opacity":e}})),hp("placeholder-",{property:"color",selector:"&::placeholder"}),dp("text-(left|center|right|justify|start|end)","textAlign"),dp("text-(ellipsis|clip)","textOverflow"),cp("text-opacity-","textOpacity","--tw-text-opacity"),hp("text-",{property:"color"}),cp("text-","fontSize",({_:e})=>"string"==typeof e?{fontSize:e}:{fontSize:e[0],..."string"==typeof e[1]?{lineHeight:e[1]}:e[1]}),cp("indent-","textIndent"),dp("(overline|underline|line-through)","textDecorationLine"),dp("no-underline",{textDecorationLine:"none"}),cp("underline-offset-","textUnderlineOffset"),hp("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),cp("decoration-","textDecorationThickness"),dp("decoration-","textDecorationStyle"),dp("(uppercase|lowercase|capitalize)","textTransform"),dp("normal-case",{textTransform:"none"}),dp("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),dp("align-","verticalAlign"),dp("whitespace-","whiteSpace"),dp("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),dp("break-words",{overflowWrap:"break-word"}),dp("break-all",{wordBreak:"break-all"}),dp("break-keep",{wordBreak:"keep-all"}),hp("caret-",{opacityVariable:!1,opacitySection:"opacity"}),hp("accent-",{opacityVariable:!1,opacitySection:"opacity"}),dp("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:e})=>`linear-gradient(to ${wp(e," ")},var(--tw-gradient-stops))`),hp("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:e})=>({"--tw-gradient-from":e.value,"--tw-gradient-to":e.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),hp("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:e})=>({"--tw-gradient-to":e.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${e.value},var(--tw-gradient-to)`})),hp("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),dp("bg-(fixed|local|scroll)","backgroundAttachment"),dp("bg-origin-(border|padding|content)","backgroundOrigin",({1:e})=>e+"-box"),dp(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),dp("bg-blend-","backgroundBlendMode"),dp("bg-clip-(border|padding|content|text)","backgroundClip",({1:e})=>e+("text"==e?"":"-box")),cp("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),hp("bg-",{section:"backgroundColor"}),cp("bg-","backgroundImage"),cp("bg-","backgroundPosition"),dp("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",bp),cp("bg-","backgroundSize"),cp("rounded(?:$|-)","borderRadius"),cp("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:e,_:t})=>{let n={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[e]||[e,e];return{[`border-${wp(n[0])}-radius`]:t,[`border-${wp(n[1])}-radius`]:t}}),dp("border-(collapse|separate)","borderCollapse"),cp("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),dp("border-(solid|dashed|dotted|double|none)","borderStyle"),cp("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:e,_:t})=>({...kp({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(e||"-x")]:t,["--tw-border-spacing"+(e||"-y")]:t,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),hp("border-([xytrbl])-",{section:"borderColor"},Sp("border","Color")),hp("border-"),cp("border-([xytrbl])(?:$|-)","borderWidth",Sp("border","Width")),cp("border(?:$|-)","borderWidth"),cp("divide-opacity(?:$|-)","divideOpacity",({_:e})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":e}})),dp("divide-(solid|dashed|dotted|double|none)",({1:e})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:e}})),dp("divide-([xy]-reverse)",({1:e})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+e]:"1"}})),cp("divide-([xy])(?:$|-)","divideWidth",({1:e,_:t})=>{let n={x:"lr",y:"tb"}[e];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${e}-reverse`]:"0",[`border-${wp(n[0])}Width`]:`calc(${t} * calc(1 - var(--tw-divide-${e}-reverse)))`,[`border-${wp(n[1])}Width`]:`calc(${t} * var(--tw-divide-${e}-reverse))`}}}),hp("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),cp("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),hp("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),cp("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),dp("ring-inset",{"--tw-ring-inset":"inset"}),hp("ring-",{property:"--tw-ring-color"}),cp("ring(?:$|-)","ringWidth",({_:e},{theme:t})=>({...kp({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":t("ringOffsetWidth","","0px"),"--tw-ring-offset-color":sp(t("ringOffsetColor","","#fff")),"--tw-ring-color":sp(t("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":t("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${e} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),hp("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:e})=>({"--tw-shadow-color":e.value,"--tw-shadow":"var(--tw-shadow-colored)"})),cp("shadow(?:$|-)","boxShadow",({_:e})=>({...kp({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":_p(e),"--tw-shadow-colored":_p(e).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),cp("(opacity)-"),dp("mix-blend-","mixBlendMode"),...Ep(),...Ep("backdrop-"),cp("transition(?:$|-)","transitionProperty",(e,{theme:t})=>({transitionProperty:_p(e),transitionTimingFunction:"none"==e._?void 0:_p(t("transitionTimingFunction","")),transitionDuration:"none"==e._?void 0:_p(t("transitionDuration",""))})),cp("duration(?:$|-)","transitionDuration","transitionDuration",_p),cp("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",_p),cp("delay(?:$|-)","transitionDelay","transitionDelay",_p),cp("animate(?:$|-)","animation",(e,{theme:t,h:n,e:r})=>{let i=_p(e),o=i.split(" "),a=t("keyframes",o[0]);return a?{["@keyframes "+(o[0]=r(n(o[0])))]:a,animation:o.join(" ")}:{animation:i}}),"(transform)-(none)",dp("transform",Tp),dp("transform-(cpu|gpu)",({1:e})=>({"--tw-transform":Ap("gpu"==e)})),cp("scale(-[xy])?-","scale",({1:e,_:t})=>({["--tw-scale"+(e||"-x")]:t,["--tw-scale"+(e||"-y")]:t,...Tp()})),cp("-?(rotate)-","rotate",Np),cp("-?(translate-[xy])-","translate",Np),cp("-?(skew-[xy])-","skew",Np),dp("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",bp),"(appearance)-",cp("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",cp("(cursor)-"),"(cursor)-",dp("snap-(none)","scroll-snap-type"),dp("snap-(x|y|both)",({1:e})=>({...kp({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":e+" var(--tw-scroll-snap-strictness)"})),dp("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),dp("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),dp("snap-(normal|always)","scroll-snap-stop"),dp("scroll-(auto|smooth)","scroll-behavior"),cp("scroll-p([xytrbl])?(?:$|-)","padding",Sp("scroll-padding")),cp("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",Sp("scroll-margin")),dp("touch-(auto|none|manipulation)","touch-action"),dp("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:e,2:t,3:n})=>({...kp({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${t?"pan-x":n?"pan-y":e}`]:e,"touch-action":"var(--tw-touch-action)"})),dp("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),dp("outline",{outlineStyle:"solid"}),dp("outline-(dashed|dotted|double)","outlineStyle"),cp("-?(outline-offset)-"),hp("outline-",{opacityVariable:!1,opacitySection:"opacity"}),cp("outline-","outlineWidth"),"(pointer-events)-",cp("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:e})=>({x:"horizontal",y:"vertical"}[e]||e||"both")],dp("select-(none|text|all|auto)","userSelect"),hp("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),hp("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),cp("stroke-","strokeWidth"),dp("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),dp("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function bp(e){return("string"==typeof e?e:e[1]).replace(/-/g," ").trim()}function xp(e){return("string"==typeof e?e:e[1]).replace("col","column")}function wp(e,t="-"){let n=[];for(let r of e)n.push({t:"top",r:"right",b:"bottom",l:"left"}[r]);return n.join(t)}function _p(e){return e&&""+(e._||e)}function Cp({$$:e}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[e[3]||""]||"")+e}function Sp(e,t=""){return({1:n,_:r})=>{let i={x:"lr",y:"tb"}[n]||n+n;return i?{...mp(e+"-"+wp(i[0])+t,r),...mp(e+"-"+wp(i[1])+t,r)}:mp(e+t,r)}}function Ep(e=""){let t=["blur","brightness","contrast","grayscale","hue-rotate","invert",e&&"opacity","saturate","sepia",!e&&"drop-shadow"].filter(Boolean),n={};for(let r of t)n[`--tw-${e}${r}`]="var(--tw-empty,/*!*/ /*!*/)";return n={...kp(n),[`${e}filter`]:t.map(t=>`var(--tw-${e}${t})`).join(" ")},[`(${e}filter)-(none)`,dp(`${e}filter`,n),...t.map(t=>cp(`${"h"==t[0]?"-?":""}(${e}${t})(?:$|-)`,t,({1:e,_:r})=>({[`--tw-${e}`]:op(r).map(e=>`${t}(${e})`).join(" "),...n})))]}function Np({1:e,_:t}){return{["--tw-"+e]:t,...Tp()}}function Tp(){return{...kp({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":Ap()}),transform:"var(--tw-transform)"}}function Ap(e){return[e?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function Op({1:e,2:t}){return`${e} ${t} / ${e} ${t}`}function Ip({1:e}){return`repeat(${e},minmax(0,1fr))`}function kp(e){return{"@layer defaults":{"*,::before,::after":e,"::backdrop":e}}}let jp=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:e})=>`@media (orientation:${e})`],["contrast-(more|less)",({1:e})=>`@media (prefers-contrast:${e})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:e})=>`&::${e}`],["(marker|selection)",({1:e})=>`& *::${e},&::${e}`],["file","&::file-selector-button"],["(first|last|only)",({1:e})=>`&:${e}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:e,$$:t},n)=>t&&`&[${e}-${n.theme(e,t)||gp(t,"",n)||`${t}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:e,3:t="",4:n,5:r="",6:i=t},{e:o,h:a,v:s})=>{let d=vp(r)||("["==n[0]?n:s(n.slice(1)));return`${(d.includes("&")?d:"&"+d).replace(/&/g,`:merge(.${o(a(e+i))})`)}${"p"==e[0]?"~":" "}&`}],["(ltr|rtl)",({1:e})=>`[dir="${e}"] &`],["supports-",({$$:e},t)=>{if(e&&(e=t.theme("supports",e)||gp(e,"",t)),e)return e.includes(":")||(e+=":var(--tw)"),/^\w*\s*\(/.test(e)||(e=`(${e})`),`@supports ${e.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:e},t)=>{if(e&&(e=t.theme("screens",e)||gp(e,"",t)),"string"==typeof e)return`@media not all and (min-width:${e})`}],["min-",({$$:e},t)=>(e&&(e=gp(e,"",t)),e&&`@media (min-width:${e})`)],[/^\[(.+)]$/,({1:e})=>/[&@]/.test(e)&&vp(e).replace(/[}]+$/,"").split("{")]];let Rp={__proto__:null,slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"}};const Pp=globalThis;if(!Pp.__twindInitialized){Jh({presets:[function({disablePreflight:e}={}){return function({colors:e,disablePreflight:t}={}){return{preflight:t?void 0:rp,theme:{...Zh,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...e}},variants:jp,rules:yp,finalize:e=>e.n&&e.d&&e.r.some(e=>/^&::(before|after)$/.test(e))&&!/(^|;)content:/.test(e.d)?{...e,d:"content:var(--tw-content);"+e.d}:e}}({colors:Rp,disablePreflight:e})}({disablePreflight:!0})],theme:{extend:{colors:{primary:"#1f7aed",primaryDark:"#1557a5",accent:"#1dd1a1"}}}}),Pp.__twindInitialized=!0}const Dp={unsupported:{level:"error",title:"Navegador sem acesso ao microfone",detail:"Este navegador não permite usar o microfone pela página.",action:"Use Chrome, Edge ou Firefox atualizados."},"insecure-context":{level:"error",title:"Página sem HTTPS",detail:"O navegador só libera o microfone em páginas HTTPS (ou localhost).",action:"Abra o discador pelo endereço com https://."},"no-microphone":{level:"error",title:"Sem microfone",detail:"Nenhum microfone foi encontrado neste computador, por isso o discador não consegue conectar nem ligar.",action:"Conecte um fone ou headset e confira se o microfone está habilitado nas configurações de som do Windows; o discador reconhece sozinho quando aparecer."},"mic-permission-denied":{level:"error",title:"Microfone bloqueado pelo navegador",detail:"O navegador não permitiu que o discador use o microfone.",action:"Clique no cadeado ao lado do endereço, permita o microfone e recarregue a página."},"mic-unavailable":{level:"error",title:"Microfone em uso ou com falha",detail:"Outro programa pode estar usando o microfone, ou o dispositivo falhou ao iniciar.",action:"Feche outros aplicativos de áudio (Teams, Meet, gravadores) e tente de novo."},"no-speaker":{level:"warning",title:"Sem saída de som",detail:"Nenhum alto-falante ou fone foi encontrado: você não vai ouvir o cliente.",action:"Conecte um fone e confira o dispositivo de saída nas configurações de som."},"enumerate-failed":{level:"warning",title:"Não foi possível verificar os dispositivos de áudio",detail:"O navegador não listou os dispositivos de áudio.",action:"Confira as permissões da página e recarregue."}};function Lp(e,t){const n=Dp[e];return{...n,detail:t?`${n.detail} (${t})`:n.detail,kind:e,source:"device",code:`device:${e}`}}const Mp=new Set(["NotFoundError","DevicesNotFoundError","OverconstrainedError"]),Up=new Set(["NotAllowedError","PermissionDeniedError","PermissionDismissedError","SecurityError"]),Fp=new Set(["NotReadableError","TrackStartError","AbortError","SourceUnavailableError"]);async function Bp(e={}){const t=void 0===e.mediaDevices?"undefined"!=typeof navigator?navigator.mediaDevices:null:e.mediaDevices,n=e.isSecureContext??("undefined"==typeof window||!1!==window.isSecureContext);if(!t||"function"!=typeof t.getUserMedia)return Lp(n?"unsupported":"insecure-context");try{const e=await t.getUserMedia({audio:!0});for(const t of e.getTracks())t.stop()}catch(i){const e=function(e){const t=(null==e?void 0:e.name)??"";return Mp.has(t)?"no-microphone":Up.has(t)?"mic-permission-denied":(Fp.has(t),"mic-unavailable")}(i),t=null==i?void 0:i.name;return Lp(e,"mic-unavailable"===e&&t?t:void 0)}if("function"!=typeof t.enumerateDevices)return null;let r;try{r=await t.enumerateDevices()}catch{return Lp("enumerate-failed")}if(!r.some(e=>"audioinput"===e.kind))return Lp("no-microphone");return(e.canListOutputs??("undefined"!=typeof HTMLMediaElement&&"setSinkId"in HTMLMediaElement.prototype))&&!r.some(e=>"audiooutput"===e.kind)?Lp("no-speaker"):null}const qp={missingAudioPermissions:{level:"error",title:"Discador sem acesso ao microfone",detail:"O Callix não conseguiu usar o microfone para iniciar o atendimento.",action:"Conecte ou habilite um microfone, permita o uso no navegador e recarregue a página."},maxUsersReached:{level:"error",title:"Limite de usuários do Callix atingido",detail:"O serviço já está com o número máximo de agentes conectados.",action:"Aguarde um colega sair ou fale com o supervisor."},userIsAlreadyConnectedOnAnotherDevice:{level:"error",title:"Usuário já conectado em outro lugar",detail:"Este login está ativo em outro computador, aba ou no Callix web.",action:"Saia de lá (ou feche a outra aba) e entre de novo aqui."},unknownError:{level:"error",title:"O discador não conseguiu iniciar",detail:"O Callix não respondeu como esperado ao iniciar o atendimento.",action:"Recarregue a página; se continuar, confira a internet e avise o suporte."}};function zp(e){const t=e&&e in qp?e:"unknownError";return{...qp[t],source:"startup",code:`startup:${t}`}}const Hp={exclusiveLogin:{level:"error",title:"Você entrou em outro lugar",detail:"Este login foi aberto em outro computador, aba ou no Callix web, e a sessão daqui foi encerrada.",action:"Feche o outro acesso e entre de novo aqui."},supervisor:{level:"error",title:"Sessão encerrada pelo supervisor",detail:"Um supervisor desconectou você do atendimento.",action:"Fale com o supervisor antes de entrar de novo."},userBlocked:{level:"error",title:"Usuário bloqueado",detail:"Seu usuário foi bloqueado no Callix.",action:"Fale com o supervisor ou o administrador."},breakTimeLimit:{level:"warning",title:"Tempo de pausa excedido",detail:"A pausa passou do limite e o Callix encerrou a sessão.",action:"Entre de novo para voltar ao atendimento."},manualCallTimeLimit:{level:"warning",title:"Tempo de chamada manual excedido",detail:"A chamada manual passou do limite configurado e a sessão foi encerrada.",action:"Entre de novo para continuar."},idle:{level:"warning",title:"Sessão encerrada por inatividade",detail:"Ficou muito tempo sem atividade e o Callix desconectou.",action:"Entre de novo para continuar."},user:{level:"warning",title:"Você saiu do atendimento",detail:"A sessão foi encerrada a seu pedido.",action:"Entre de novo quando quiser voltar."}};function Wp(e){const t=e&&e in Hp?e:null;return t?{...Hp[t],source:"session",code:`session:${t}`}:{level:"error",source:"session",code:"session:unknown",title:"Sessão encerrada",detail:`A sessão no Callix foi encerrada${e?` (${e})`:""}.`,action:"Entre de novo para continuar."}}const Gp={1:{title:"Número inválido",detail:"O Callix recusou o número discado.",action:"Confira o DDD e o número."},2:{title:"Usuário não encontrado",detail:"O Callix não reconheceu o usuário para esta chamada.",action:"Saia e entre de novo no discador."},3:{title:"Equipe bloqueada para ligar",detail:"Sua equipe está sem permissão de chamada manual neste momento.",action:"Fale com o supervisor."},4:{title:"Número na black list",detail:"Este número está na lista de bloqueio e não pode ser discado."},5:{title:"Sem rota para este número",detail:"A telefonia não tem rota de saída para este destino.",action:"Confira o número ou fale com o suporte."},6:{title:"Chamada recusada pelo Callix",detail:"O Callix não autorizou esta chamada."},7:{title:"Erro interno do Callix",detail:"O Callix falhou ao iniciar a chamada.",action:"Tente de novo em instantes."},8:{title:"Ligação internacional não autorizada",detail:"Chamadas internacionais estão desligadas para o seu usuário.",action:"Fale com o supervisor."},9:{title:"Saldo de telefonia insuficiente",detail:"A conta de telefonia do Callix está sem saldo.",action:"Avise o administrador."},10:{title:"Caixa postal ou silêncio",detail:"A chamada caiu em caixa postal ou ninguém falou do outro lado."}},Vp={Busy:{title:"Número ocupado",detail:"O destino está em outra ligação.",action:"Tente de novo em alguns minutos."},Unavailable:{title:"Número indisponível",detail:"O destino não atendeu ou está fora de área."},"Not Found":{title:"Número não existe",detail:"A operadora respondeu que este número não existe.",action:"Confira o DDD e o número."},"Address Incomplete":{title:"Número incompleto",detail:"Faltam dígitos no número discado.",action:"Confira o DDD e o número."},"Blocked By Carrier":{title:"Bloqueado pela operadora",detail:"A operadora bloqueou a chamada para este destino."},Rejected:{title:"Chamada recusada",detail:"O destino ou a operadora recusou a chamada."},"SIP Failure Code":{title:"Falha na telefonia",detail:"A operadora devolveu um erro ao completar a chamada.",action:"Tente de novo; se repetir, avise o suporte."},"Bad Media Description":{title:"Falha de áudio na chamada",detail:"A negociação de áudio com a operadora falhou.",action:"Recarregue a página e tente de novo."},"Silence or Machine Detected":{title:"Caixa postal ou silêncio",detail:"A chamada caiu em caixa postal ou ninguém falou do outro lado."}};function Kp(e){const t=null!=(null==e?void 0:e.rejectReason)?Gp[e.rejectReason]:void 0,n=(null==e?void 0:e.cause)?Vp[e.cause]:void 0,r=t??n;if(r)return{level:"warning",source:"call",code:`call:${null!=(null==e?void 0:e.rejectReason)?`reject-${e.rejectReason}`:null==e?void 0:e.cause}`,...r};const i=(null==e?void 0:e.message)||(null==e?void 0:e.cause);return{level:"warning",source:"call",code:"call:unknown",title:"Chamada não concluída",detail:i?`O Callix informou: ${i}.`:"O Callix não informou o motivo.",action:"Tente de novo; se repetir, avise o suporte."}}const Yp="https://callix-zeta.vercel.app";const Xp=function(){if("undefined"==typeof window)return Yp;const e=window.__CALLIX_API_BASE_URL__;return"string"==typeof e&&e.trim()?e.trim().replace(/\/+$/,""):Yp}();function Jp(){const e={"Content-Type":"application/json"},t=function(){if("undefined"==typeof window)return null;try{const e=localStorage.getItem("callix_dialer_last_username");if(e){const t=localStorage.getItem(`callix_dialer_${e}_session_token`);if(t)return t}for(let t=0;t<localStorage.length;t++){const e=localStorage.key(t);if(e&&/^callix_dialer_.*_session_token$/.test(e)){const t=localStorage.getItem(e);if(t)return t}}}catch{}return null}();return t&&(e["x-session-token"]=t,e.Authorization=`Bearer ${t}`),e}const Zp=new Map;function Qp(e){return`${e.source}:${e.id}`}function em(e,t){var n,r;const i=null==e?void 0:e.campaignContact;if(!(null==i?void 0:i.id))return null;const o=i.customer;return(null==o?void 0:o.id)&&(null==o?void 0:o.formId)?{source:"customer",id:o.id,formId:o.formId,campaignId:(null==(n=null==e?void 0:e.campaign)?void 0:n.id)??null,phoneId:t??null}:{source:"campaign",id:i.id,campaignId:(null==(r=null==e?void 0:e.campaign)?void 0:r.id)??null,phoneId:t??null}}async function tm(e,t){const n=new AbortController,r=setTimeout(()=>n.abort(),15e3);try{const r=await fetch(e,{method:"GET",headers:t,credentials:"omit",signal:n.signal});if(!r.ok){const e=await r.json().catch(()=>({})),t=new Error(function(e,t){if(401===e)return"Sessão expirada. Entre novamente no discador.";const n=t.message||t.error;return n||(404===e?"Rota do formulário não encontrada no servidor do discador. Atualize o back-end (deploy) para esta versão do widget.":`Erro ${e}`)}(r.status,e));throw t.status=r.status,t}const i=await r.json();if(!function(e){if(!e||"object"!=typeof e)return!1;const t=e;return"number"==typeof t.id&&!!t.values&&"object"==typeof t.values&&Array.isArray(t.fields)}(i))throw new Error("Resposta inesperada do servidor");return i}catch(i){if(i instanceof Error&&"AbortError"===i.name)throw new Error("Tempo esgotado ao buscar o formulário");if(i instanceof TypeError){const e=new Error("Não foi possível conectar ao servidor do discador. Verifique a conexão ou se o back-end está atualizado.");throw e.cause=i,e}throw i}finally{clearTimeout(r)}}function nm(e){const t=null==e?void 0:e.status;return void 0===t||(t>=500||408===t||429===t)}function rm(e,t={}){const n=Qp(e),r=Date.now(),i=Zp.get(n);if(i&&i.until>r&&!t.force)return i.promise;const o=function(e,t){const n=new URLSearchParams;"customer"===t.source&&n.set("source","customer"),t.campaignId&&n.set("campaignId",String(t.campaignId)),t.formId&&n.set("formId",String(t.formId)),t.phoneId&&n.set("phoneId",String(t.phoneId)),t.signature&&t.expiresAt&&(n.set("sig",t.signature),n.set("exp",String(t.expiresAt)));const r=n.toString();return`${e}/api/campaign-form/${encodeURIComponent(String(t.id))}${r?`?${r}`:""}`}(t.apiBaseUrl??Xp,e),a=t.headers??Jp(),s=Math.max(0,t.retries??2),d=(async()=>{let e;for(let n=0;n<=s;n++)try{return await tm(o,a)}catch(t){if(e=t,n===s||!nm(t))break;await new Promise(e=>setTimeout(e,800*2**n))}throw e instanceof Error?e:new Error("Erro ao buscar o formulário")})();return Zp.set(n,{promise:d,until:r+3e5}),d.then(e=>{var t;e.partial&&(null==(t=Zp.get(n))?void 0:t.promise)===d&&Zp.delete(n)}).catch(()=>{var e;(null==(e=Zp.get(n))?void 0:e.promise)===d&&Zp.delete(n)}),d}function im(e){return String(e??"").normalize("NFC").trim().toLowerCase().replace(/\s+/g," ")}function om(e,t){if(!(null==e?void 0:e.values))return;const n=new Map;for(const[r,i]of Object.entries(e.values)){const e=am(im(r));n.has(e)||null==i||""===String(i).trim()||n.set(e,String(i))}for(const r of t){const e=n.get(am(im(r)));if(void 0!==e)return e}}function am(e){return e.normalize("NFD").replace(/[̀-ͯ]/g,"")}function sm(){var e;const t=rc(),n=nc(),r=(null==(e=null==n?void 0:n.data)?void 0:e.campaignContactPhoneId)??null;return"campaign"===(null==t?void 0:t.type)?$.jsx(dm,{campaignCallInfo:t.info,campaignContactPhoneId:r}):t?$.jsx("div",{className:"mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2",children:$.jsx("p",{className:"text-xs font-semibold text-amber-700",children:"Chamada manual (sem informações de campanha)"})}):null}function dm(e){const{campaign:n,campaignContact:r}=e.campaignCallInfo,[i,o]=t.useState({form:null,isLoading:!1,error:null}),[a,s]=t.useState({key:null,n:0}),d=t.useMemo(()=>em(e.campaignCallInfo,e.campaignContactPhoneId),[e.campaignCallInfo,e.campaignContactPhoneId]),l=d?Qp(d):null,u=t.useRef(d);u.current=d;const c=t.useRef(null);t.useEffect(()=>{const e=u.current;if(!e||!l)return void o({form:null,isLoading:!1,error:null});let t=!1,n=null;return o({form:null,isLoading:!0,error:null}),rm(e,{force:a.key===l&&a.n>0}).then(e=>{t||(o({form:e,isLoading:!1,error:null}),e.partial&&c.current!==l&&(c.current=l,n=setTimeout(()=>s(e=>({key:l,n:e.n+1})),3e3)))}).catch(e=>{t||(console.error("[CampaignCallInfoDisplay] Erro ao buscar dados:",e),o({form:null,isLoading:!1,error:e instanceof Error?e.message:"Erro ao buscar dados do contato"}))}),()=>{t=!0,n&&clearTimeout(n)}},[l,a]);const f=t.useMemo(()=>[{label:"Decisor",keys:["DECISOR","CONTATO","NOME"],icon:$.jsx(Hc,{className:"text-sm"})},{label:"Empresa",keys:["EMPRESA","RAZAO SOCIAL","RAZÃO SOCIAL","CLIENTE"],icon:$.jsx(Ec,{className:"text-sm"})},{label:"Dívida ativa",keys:["DIVIDA ATIVA","DÍVIDA ATIVA","VALOR TOTAL DEVIDO"],icon:$.jsx(Oc,{className:"text-sm"})},{label:"Telefone",keys:["TELEFONE","CELULAR","WHATSAPP"],icon:$.jsx(zc,{className:"text-sm"})}],[]),h=t.useMemo(()=>f.map(e=>{const t=("Telefone"===e.label?om(i.form,e.keys)??(null==r?void 0:r.phoneNumber):om(i.form,e.keys))||"",n="Telefone"===e.label?function(e){if(!e)return"-";const t=e.replace(/\D/g,"");if(t.length>=10){const e=t.slice(0,2),n=t.slice(2,t.length-4),r=t.slice(-4);return`(${e}) ${n.length>5?`${n.slice(0,n.length-4)} ${n.slice(n.length-4)}`:n}-${r}`.replace(/\s+/g," ").trim()}return e.trim()}(t):(t||"-").toString().trim()||"-";return{...e,value:n,isEmpty:!t}}),[null==r?void 0:r.phoneNumber,i.form,f]),p=h.some(e=>!e.isEmpty);return $.jsxs("div",{className:"mb-4 rounded-2xl border border-slate-200 bg-white/90 p-3 shadow-sm",children:[$.jsxs("div",{className:"mb-3 flex items-center justify-between gap-2",children:[$.jsxs("div",{className:"flex items-center gap-3",children:[$.jsx("span",{className:"inline-flex h-9 w-9 items-center justify-center rounded-2xl bg-emerald-500 text-white shadow-inner",children:$.jsx(Lc,{className:"text-base"})}),$.jsxs("div",{className:"min-w-0",children:[$.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.15em] text-slate-500",children:"Campanha"}),$.jsx("p",{className:"truncate text-sm font-bold text-slate-900",children:(null==n?void 0:n.name)||"Chamada de campanha"})]})]}),$.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-1 text-[10px] font-bold uppercase text-emerald-700",children:[$.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500"}),"Em chamada"]})]}),i.isLoading&&$.jsxs("div",{className:"rounded-xl border border-slate-200 bg-slate-50 p-4 text-center",role:"status",children:[$.jsx("div",{className:"mx-auto mb-2 inline-block h-7 w-7 animate-spin rounded-full border-2 border-emerald-500 border-t-transparent"}),$.jsx("p",{className:"text-xs font-medium text-slate-600",children:"Carregando dados do contato..."})]}),i.error&&$.jsxs("div",{className:"rounded-xl border border-rose-200 bg-rose-50 p-3",children:[$.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[$.jsx(Cc,{className:"text-sm text-rose-600"}),$.jsx("p",{className:"text-xs font-semibold text-rose-700",children:"Erro ao carregar dados"})]}),$.jsx("p",{className:"ml-6 text-[11px] text-rose-600",children:i.error}),$.jsx("button",{type:"button",onClick:()=>s(e=>({key:l,n:e.n+1})),className:"mt-2 ml-6 text-[11px] font-semibold text-rose-700 underline hover:text-rose-800",children:"Tentar novamente"})]}),!i.isLoading&&!i.error&&$.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:h.map(e=>$.jsxs("div",{className:"flex flex-col gap-1 rounded-xl border border-slate-200 bg-slate-50 p-2.5 shadow-[inset_0_1px_0_rgba(255,255,255,0.6)]",children:[$.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-slate-500",children:[e.icon,$.jsx("span",{className:"truncate",children:e.label})]}),$.jsx("p",{className:"break-words text-sm font-bold leading-tight text-slate-900",children:e.value||"-"})]},e.label))}),!i.isLoading&&!i.error&&!p&&$.jsx("div",{className:"rounded-xl border border-slate-200 bg-slate-50 p-3 text-xs font-medium text-slate-600",children:"Nenhuma informação de campanha disponível para este contato."})]})}function lm(e){const[n,r]=t.useState(null==e?void 0:e.get());return t.useEffect(()=>{if(!e)return void r(void 0);r(e.get());return e.subscribe(e=>{r(e)})},[e]),n}function um(){const{enterOnBreak:e,becomeAvailable:t}=tc();return{goOnBreak:e,goOffBreak:t}}const cm={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6],0,0,0,0,0,0,0,[["6[2-467]\\d{3}",[5]],["4\\d{4}",[5]],0,0,0,0,["(?:0[1-9]|[1589]\\d)\\d{4}",[6]]]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[["[78]\\d{5}",[6]],["690\\d{6}|[356]\\d{5}",[6,9]],["180[02]\\d{4}",[8]],["[19]\\d{5}",[6]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0",0,0,0,0,0,[["[2-4679][2-8]\\d{6}",[8]],["5[024-68]\\d{7}",[9]],["400\\d{6}|800\\d{2,9}"],["900[02]\\d{5}",[9]],0,0,["600[25]\\d{5}",[9]],0,0,["700[05]\\d{5}",[9]]]],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0",0,0,0,0,0,[["(?:[25][0-8]|[34][0-4]|6[0-5])[2-9]\\d{6}"],["7\\d{8}"]]],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268",[["268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}"],["268(?:464|7(?:1[3-9]|[28]\\d|3[0246]|64|7[0-689]))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,["26840[69]\\d{4}"],["26848[01]\\d{4}"]]],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264",[["264(?:292|4(?:6[12]|9[78]))\\d{4}"],["264(?:235|4(?:69|76)|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,["264724\\d{4}"]]],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0",0,0,0,0,0,[["4505[0-2]\\d{3}|(?:[2358][16-9]\\d[2-9]|4410)\\d{4}|(?:[2358][2-5][2-9]|4(?:[2-57-9][2-9]|6\\d))\\d{5}",[8]],["6(?:[78][2-9]|9\\d)\\d{6}",[9]],["800\\d{4}",[7]],["900[1-9]\\d\\d",[6]],["700[2-9]\\d{4}",[8]],0,0,0,0,["808[1-9]\\d\\d",[6]]]],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:1[0-25]|47)\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2)\\d{5}"],["(?:33|4[1349]|55|77|88|9[13-9])\\d{6}"],["800\\d{5}"],["90[016]\\d{5}"],0,0,0,0,["60(?:2[78]|3[5-9]|4[02-9]|5[0-46-9]|[6-8]\\d|9[0-2])\\d{4}"],["80[1-4]\\d{5}"]]],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]],0,0,0,0,0,0,[["2\\d(?:[0134][25-9]|[25-9]\\d)\\d{5}"],["9[1-79]\\d{7}"]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1",0,0,[["3(?:7(?:1[15]|81)|8(?:21|4[16]|69|9[12]))[46]\\d{5}|(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|47[35]|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|(?:2(?:657|9(?:54|66))|3(?:48[27]|7(?:55|77)|8(?:65|78)))[2-8]\\d{5}|(?:2(?:284|3(?:02|23)|477|622|920)|3(?:4(?:46|89|92)|541))[2-7]\\d{5}|(?:(?:11[1-8]|670)\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[25][4-6]|3[3-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|1[2-7]|3[4-6]|5[3-6]|7[2-6]|8[3-68])))\\d{6}|(?:2(?:2(?:62|81)|320|9(?:42|83))|3(?:329|4(?:62|7[16])|5(?:43|64)|7(?:18|5[17])))[2-6]\\d{5}|2(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|(?:2(?:257|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|64)|5(?:25|37|4[47]|71)|7(?:35|72)|825))[3-6]\\d{5}|(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[035-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[14]|4[13]|5[468]|7[3-5]|8[26])|8(?:2[67]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}",[10]],["93(?:7(?:1[15]|81)|8(?:21|4[16]|69|9[12]))[46]\\d{5}|9(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|47[35]|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|9(?:2(?:657|9(?:54|66))|3(?:48[27]|7(?:55|77)|8(?:65|78)))[2-8]\\d{5}|9(?:2(?:284|3(?:02|23)|477|622|920)|3(?:4(?:46|89|92)|541))[2-7]\\d{5}|(?:675\\d|9(?:11[1-8]\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[25][4-6]|3[3-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|1[2-7]|3[4-6]|5[3-6]|7[2-6]|8[3-68]))))\\d{6}|9(?:2(?:2(?:62|81)|320|9(?:42|83))|3(?:329|4(?:62|7[16])|5(?:43|64)|7(?:18|5[17])))[2-6]\\d{5}|92(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|9(?:2(?:257|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|64)|5(?:25|37|4[47]|71)|7(?:35|72)|825))[3-6]\\d{5}|9(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[035-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[14]|4[13]|5[468]|7[3-5]|8[26])|8(?:2[67]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}"],["800\\d{7,8}"],["60[04579]\\d{7}",[10]],0,0,["810\\d{7}",[10]]]],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684",[["6846(?:22|33|44|55|77|88|9[19])\\d{4}"],["684(?:2(?:48|5[2468]|7[26])|7(?:3[13]|70|82))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0",0,0,0,0,0,[["1(?:11\\d|[2-9]\\d{3,11})|(?:316|463)\\d{3,10}|648[34]\\d{3,9}|(?:51|66|73)2\\d{3,10}|(?:2(?:1[467]|2[13-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|9[1458])|3(?:1[1-578]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|7[1368]|8[2457])|5(?:2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[135-7]|5[468])|7(?:2[1-8]|35|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{4,10}"],["6(?:485|(?:5[0-3579]|6[013-9]|[7-9]\\d)\\d)\\d{3,9}",[7,8,9,10,11,12,13]],["800\\d{6,10}",[9,10,11,12,13]],["(?:8[69][2-68]|9(?:0[01]|3[019]))\\d{6,10}",[9,10,11,12,13]],0,0,0,0,["5(?:0[1-9]|17|[79]\\d)\\d{2,10}|7[28]0\\d{6,10}",[5,6,7,8,9,10,11,12,13]],["8(?:10|2[018])\\d{6,10}|828\\d{5}",[8,9,10,11,12,13]]]],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:2(?:(?:[0-26-9]\\d|3[0-8]|5[0135-9])\\d|4(?:[02-9]\\d|10))|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90))|7(?:[013-57-9]\\d|2[0-8])\\d)\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-478])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]],0,0,0,0,0,0,[["5(?:2\\d|8[1-9])\\d{4}"],["(?:290|5[69]\\d|6(?:[03]0|22|4[0-2]|[69]\\d)|7(?:[34]\\d|7[07])|9(?:6[45]|9[4-8]))\\d{4}"],["800\\d{4}"],["900\\d{4}"],0,0,0,0,["(?:28\\d|501)\\d{4}"]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",[["18[1-8]\\d{3,6}",[6,7,8,9]],["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}",[6,7,8,9,10]],["800\\d{4,6}",[7,8,9]],["[67]00\\d{5,6}",[8,9]],0,0,["20\\d{4,8}|60[12]\\d{5,6}|7(?:099\\d{4,5}|5[03-9]\\d{3,7})|20[2-59]\\d\\d|(?:606|7(?:0[78]|1|3\\d))\\d{7}|(?:10|29|3[09]|70[1-5]\\d)\\d{4,8}"]],"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:2[12]428|3655[02])\\d{4}|(?:2(?:22[0-79]|63[0-28])|3654)\\d{5}|(?:(?:1[28]|46)\\d|2(?:[014-6]2|[23]3))\\d{6}"],["36554\\d{4}|(?:[16]0|4[04]|5[015]|7[07]|99)\\d{7}"],["88\\d{7}"],["900200\\d{3}"]]],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0",0,0,0,0,0,[["(?:3(?:[05-79][2-9]|1[4579]|[23][24-9]|4[2-4689]|8[2457-9])|49[2-579]|5(?:0[2-49]|[13][2-9]|[268][2-4679]|4[4689]|5[2-79]|7[2-69]|9[2-4689]))\\d{5}",[8]],["6040\\d{5}|6(?:03|[1-356]|44|7\\d)\\d{6}"],["8[08]\\d{6}",[8]],["9[0246]\\d{6}",[8]],0,0,["703[235]0\\d{3}|70(?:2[0-5]|3[0146]|[56]0)\\d{4}",[8]],0,0,["8[12]\\d{6}",[8]]]],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246",[["246521[0369]\\d{3}|246(?:2(?:2[78]|7[0-4])|4(?:1[024-6]|2\\d|3[2-9])|5(?:20|[34]\\d|54|7[1-3])|6(?:2\\d|38)|7[35]7|9(?:1[89]|63))\\d{4}"],["246(?:(?:2(?:[3568]\\d|4[0-57-9])|3(?:5[2-9]|6[0-6])|4(?:46|5\\d)|69[5-7]|8(?:[2-5]\\d|83))\\d|52(?:1[147]|20))\\d{3}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["(?:246976|900[2-9]\\d\\d)\\d{4}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,["246(?:292|367|4(?:1[7-9]|3[01]|4[47-9]|67)|7(?:1[2-9]|2\\d|3[016]|53))\\d{4}"],0,["24631\\d{5}"]]],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0",0,0,0,0,0,[["(?:4(?:31\\d\\d|423)|5222)\\d{3}(?:\\d{2})?|8332[6-9]\\d\\d|(?:3(?:03[56]|224)|4(?:22[25]|653))\\d{3,4}|(?:3(?:42[47]|529|823)|4(?:027|525|65(?:28|8))|562|6257|7(?:1(?:5[3-5]|6[12]|7[156]|89)|22[589]56|32|42675|52(?:[25689](?:56|8)|[347]8)|71(?:6[1267]|75|89)|92374)|82(?:2[59]|32)56|9(?:03[23]56|23(?:256|373)|31|5(?:1|2[4589]56)))\\d{3}|(?:3(?:02[348]|22[35]|324|422)|4(?:22[67]|32[236-9]|6(?:2[46]|5[57])|953)|5526|6(?:024|6655)|81)\\d{4,5}|(?:2(?:7(?:1[0-267]|2[0-289]|3[0-29]|4[01]|5[1-3]|6[013]|7[0178]|91)|8(?:0[125]|1[1-6]|2[0157-9]|3[1-69]|41|6[1-35]|7[1-5]|8[1-8]|9[0-6])|9(?:0[0-2]|1[0-4]|2[568]|3[3-6]|5[5-7]|6[0136-9]|7[0-7]|8[014-9]))|3(?:0(?:2[025-79]|3[2-4])|181|22[12]|32[2356]|824)|4(?:02[09]|22[348]|32[045]|523|6(?:27|54))|666(?:22|53)|7(?:22[57-9]|42[56]|82[35])8|8(?:0[124-9]|2(?:181|2[02-4679]8)|4[12]|[5-7]2)|9(?:[04]2|2(?:2|328)|81))\\d{4}|(?:2(?:[23]\\d|[45])\\d\\d|3(?:1(?:2[5-7]|[5-7])|425|822)|4(?:033|1\\d|[257]1|332|4(?:2[246]|5[25])|6(?:2[35]|56|62)|8(?:23|54)|92[2-5])|5(?:02[03489]|22[457]|32[35-79]|42[46]|6(?:[18]|53)|724|826)|6(?:023|2(?:2[2-5]|5[3-5]|8)|32[3478]|42[34]|52[47]|6(?:[18]|6(?:2[34]|5[24]))|[78]2[2-5]|92[2-6])|7(?:02|21\\d|[3-589]1|6[12]|72[24])|8(?:217|3[12]|[5-7]1)|9[24]1)\\d{5}|(?:(?:3[2-8]|5[2-57-9]|6[03-589])1|4[4689][18])\\d{5}|[59]1\\d{5}"],["(?:1[13-9]\\d|644)\\d{7}|(?:3[78]|44|66)[02-9]\\d{7}",[10]],["80[03]\\d{7}",[10]],0,0,0,0,0,["96(?:0[469]|1[0-47]|3[389]|43|6[69]|7[78])\\d{6}",[10]]]],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0",0,0,0,0,0,[["80[2-8]\\d{5}|(?:1[0-69]|[23][2-8]|4[23]|5\\d|6[013-57-9]|71|8[1-79]|9[2-4])\\d{6}",[8]],["4[5-9]\\d{7}",[9]],["800[1-9]\\d{4}",[8]],["(?:70(?:2[0-57]|3[04-7]|44|6[04-69]|7[0579])|90\\d\\d)\\d{4}",[8]],0,0,["78(?:0[578]|1[014-8]|2[25]|3[15-8]|48|5[05]|60|7[06-8]|9\\d)\\d{4}",[8]],0,0,["7879\\d{4}",[8]]]],BF:["226","00","(?:[025-7]\\d|44)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]],0,0,0,0,0,0,[["2(?:0(?:49|5[23]|6[5-7]|9[016-9])|4(?:4[569]|5[4-6]|6[5-7]|7[0179])|5(?:[34]\\d|50|6[5-7]))\\d{4}"],["(?:0[1-7]|44|5[0-8]|[67]\\d)\\d{6}"]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[["2\\d{5,7}|(?:43[1-6]|70[1-9])\\d{4,5}|(?:[36]\\d|4[124-7]|[57][1-9]|8[1-6]|9[1-7])\\d{5,6}",[6,7,8]],["(?:43[07-9]|99[69]\\d)\\d{5}|(?:8[7-9]|98)\\d{7}",[8,9]],["(?:00800\\d\\d|800)\\d{5}",[8,12]],["90\\d{6}",[8]],0,0,0,0,0,["700\\d{5}",[8]]]],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]],0,0,0,0,0,0,[["(?:1(?:3[1356]|6[0156]|7\\d)\\d|6(?:1[16]\\d|500|6(?:0\\d|3[12]|44|55|7[7-9]|88)|9[69][69])|7(?:[07]\\d\\d|1(?:11|78)))\\d{4}"],["(?:3(?:[0-79]\\d|8[0-57-9])\\d|6(?:3(?:00|33|6[16])|441|6(?:3[03-9]|[69]\\d|7[0-689])))\\d{4}"],["8[02369]\\d{6}"],["(?:87|9[0-8])\\d{6}"],0,0,0,0,0,["84\\d{6}"]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]],0,0,0,0,0,0,[["(?:22|31)\\d{6}"],["(?:29|6[124-9]|7[125-9])\\d{6}"]]],BJ:["229","00","(?:01\\d|[24-689])\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]],0,0,0,0,0,0,[["2090\\d{4}|(?:012\\d\\d|2(?:02|1[037]|2[45]|3[68]|4\\d))\\d{5}"],["(?:01(?:2[5-9]|[4-69]\\d)|4[0-8]|[56]\\d|9[013-9])\\d{6}"],0,0,0,0,["81\\d{6}",[8]],0,["857[58]\\d{4}",[8]]]],BL:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441",[["441(?:[46]\\d\\d|5(?:4\\d|60|89))\\d{4}"],["441(?:[2378]\\d|5[0-39]|9[02])\\d{5}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]],0,0,0,0,0,0,[["22[0-7]\\d{4}|(?:2[013-9]|[34]\\d|5[0-25-9])\\d{5}"],["(?:22[89]|[78]\\d\\d)\\d{4}"],0,0,0,0,0,0,["5[34]\\d{5}"]]],BO:["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?",0,0,0,[["(?:2(?:2\\d\\d|5(?:11|[258]\\d|9[67])|6(?:12|2\\d|9[34])|8(?:2[34]|39|62))|3(?:3\\d\\d|4(?:6\\d|8[24])|8(?:25|42|5[257]|86|9[25])|9(?:[27]\\d|3[2-4]|4[248]|5[24]|6[2-6]))|4(?:4\\d\\d|6(?:11|[24689]\\d|72)))\\d{4}",[8]],["[67]\\d{7}",[8]],["8001[07]\\d{4}",[9]],0,0,0,0,0,["50\\d{6}",[8]]]],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]",[["(?:318[023]|41(?:6[023]|70)|7(?:1[578]|2[05]|50)\\d)\\d{3}"],["(?:31(?:8[14-8]|9[14578])|416[14-9]|7(?:0[01]|7[07]|8\\d|9[056])\\d)\\d{3}"]]],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2",0,0,[["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\\d{7}",[10]],["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])(?:7|9\\d)\\d{7}",[10,11]],["800\\d{6,7}",[9,10]],["[59]00\\d{6,7}",[9,10]],0,0,0,0,0,["(?:30[03]\\d{3}|4(?:0(?:0\\d|20)|370|864))\\d{4}|300\\d{5}",[8,10]]]],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242",[["242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[347]|8[0-4]|9[2-467])|461|502|6(?:0[1-5]|12|2[013]|[45]0|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}"],["242(?:3(?:5[79]|7[56]|95)|4(?:[23][1-9]|4[1-35-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-46-9]|65|77)|6[34]6|7(?:27|38)|8(?:0[1-9]|1[02-9]|2\\d|3[0-4]|[89]9))\\d{4}"],["242300\\d{4}|8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,["242225\\d{4}"]]],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]],0,0,0,0,0,0,[["(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\d{5}",[7]],["(?:1[67]|[78]7)\\d{6}",[8]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0-35-9]|55|[69]\\d|7[013]|81)|4(?:6[03]|7[1267]|9[0-5])|5(?:3[03489]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[013467]))\\d{4}",[7]],["(?:321|7[1-8]\\d)\\d{5}",[8]],["(?:0800|800\\d)\\d{6}",[10]],["90\\d{5}",[7]],0,0,0,0,["79(?:1(?:[0-2]\\d|3[0-8])|2[0-7]\\d)\\d{3}",[8]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,[["(?:1(?:5(?:1[1-5]|[24]\\d|6[2-4]|9[1-7])|6(?:[235]\\d|4[1-7])|7\\d\\d)|2(?:1(?:[246]\\d|3[0-35-9]|5[1-9])|2(?:[235]\\d|4[0-8])|3(?:[26]\\d|3[02-79]|4[024-7]|5[03-7])))\\d{5}",[9]],["(?:2(?:5[5-79]|9[1-9])|(?:33|44)\\d)\\d{6}",[9]],["800\\d{3,7}|8(?:0[13]|20\\d)\\d{7}"],["(?:810|902)\\d{7}",[10]],0,0,0,0,["249\\d{6}",[9]]],"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]],0,0,0,0,0,0,[["(?:2(?:[02]\\d|36|[68]0)|[3-58](?:[02]\\d|[68]0)|7(?:[02]\\d|32|[68]0))\\d{4}",[7]],["6[0-35-7]\\d{5}",[7]],["0800\\d{7}",[11]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|33|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-478])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:12|573)\\d\\d|276)\\d{5}|[1-6]\\d{6}"],["88\\d{5}|(?:8[0-69]|9[017-9])\\d{7}",[7,9]]]],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]],0,0,0,0,0,0,[["2[12]\\d{6}"],["7[024-7]\\d{6}"],0,["8776\\d{4}"]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]],0,0,0,0,0,0,[["222[1-589]\\d{5}"],["026(?:1[0-5]|6[6-9])\\d{4}|0(?:[14-6]\\d\\d|2(?:40|5[5-8]|6[07-9]))\\d{5}"],0,["80[0-2]\\d{6}"]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:2[12467]|3[1-4]|4[134]|5[256]|6[12]|[7-9]1)\\d{7}",[9]],["(?:6[89]|7[235-9])\\d{7}",[9]],["800\\d{6}",[9]],["90[016]\\d{6}",[9]],["878\\d{6}",[9]],["860\\d{9}",[12]],["5[18]\\d{7}",[9]],["74[0248]\\d{6}",[9]],0,["84[0248]\\d{6}",[9]]]],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]],0,0,0,0,0,0,[["2(?:[15]\\d{3}|7(?:2(?:0[23]|1[2357]|2[245]|3[45]|4[3-5])|3(?:06|1[69]|[2-6]7)))\\d{5}"],["0[157]\\d{8}"]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]],0,0,0,0,0,0,[["(?:2\\d|3[13-7]|4[1-5])\\d{3}"],["[578]\\d{4}"]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]],0,0,0,0,0,0,[["2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|2\\d{3}|3(?:(?:2\\d|50)\\d|3(?:[03467]\\d|1[0-35-9]|2[1-9]|5[0-24-9]|8[0-389]|9[0-8])|600)|646[59])|(?:(?:3[2-5]|[47][1-35]|5[1-3578])\\d|6(?:00|[13-57]\\d)|8(?:0[1-9]|[1-9]\\d))\\d\\d|9(?:(?:10[01]|(?:[2458]\\d|7[1-9])\\d)\\d|3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}",[9]],["2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|2\\d{3}|3(?:(?:2\\d|50)\\d|3(?:[03467]\\d|1[0-35-9]|2[1-9]|5[0-24-9]|8[0-389]|9[0-8])|600)|646[59])|(?:(?:3[2-5]|[47][1-35]|5[1-3578]|6[13-57])\\d|8(?:0[1-8]|[1-9]\\d))\\d\\d|9(?:(?:10[01]|(?:[2458]\\d|7[1-9])\\d)\\d|3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}",[9]],["(?:123|8)00\\d{6}",[9,11]],0,0,0,0,0,["44\\d{7}",[9]],["600\\d{7,8}",[10,11]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]],0,0,0,0,0,0,[["2(?:22|33)\\d{6}",[9]],["(?:24[23]|6(?:[25-9]\\d|40))\\d{6}",[9]],["88\\d{6,7}"]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,[["(?:10(?:[02-79]\\d\\d|[18](?:0[1-9]|[1-9]\\d))|2(?:[02-57-9]\\d{3}|1(?:[18](?:0[1-9]|[1-9]\\d)|[2-79]\\d\\d))|(?:41[03]|8078|9(?:78|94))\\d\\d)\\d{5}|(?:10|2[0-57-9])(?:1(?:00|23)\\d\\d|95\\d{3,4})|(?:41[03]|9(?:78|94))(?:100\\d\\d|95\\d{3,4})|8078123|(?:43[35]|754|851)\\d{7,8}|(?:43[35]|754|851)(?:1(?:00\\d|23)\\d|95\\d{3,4})|(?:3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1\\d|2[37]|3[12]|51|7[13-79]|9[15])|7(?:[39]1|5[57]|6[09])|8(?:71|98))(?:[02-8]\\d{7}|1(?:0(?:0\\d\\d(?:\\d{3})?|[1-9]\\d{5})|[13-9]\\d{6}|2(?:[0-24-9]\\d{5}|3\\d(?:\\d{4})?))|9(?:[0-46-9]\\d{6}|5\\d{3}(?:\\d(?:\\d{2})?)?))|(?:3(?:1[02-9]|35|49|5\\d|7[02-68]|9[1-68])|4(?:1[24-9]|2[179]|3[46-9]|5[2-9]|6[47-9]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[17]\\d|2[248]|3[04-9]|4[3-6]|5[0-3689]|6[2368]|9[02-9])|8(?:1[236-8]|2[5-7]|3\\d|5[2-9]|7[02-9]|8[36-8]|9[1-7])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))(?:[02-8]\\d{6}|1(?:0(?:0\\d\\d(?:\\d{2})?|[1-9]\\d{4})|[13-9]\\d{5}|2(?:[0-24-9]\\d{4}|3\\d(?:\\d{3})?))|9(?:[0-46-9]\\d{5}|5\\d{3,5}))",[7,8,9,10,11]],["1740[0-5]\\d{6}|1(?:[38]\\d|4[57]|[59][0-35-9]|6[25-7]|7[0-35-8])\\d{8}",[11]],["(?:(?:10|21)8|8)00\\d{7}",[10,12]],["16[08]\\d{5}",[8]],0,0,0,0,0,["10(?:10\\d{4}|96\\d{3,4})|400\\d{7}|950\\d{7,8}|(?:2[0-57-9]|3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))96\\d{3,4}",[7,8,9,10,11]]],"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?",0,0,0,[["601055(?:[0-4]\\d|50)\\d\\d|6010(?:[0-4]\\d|5[0-4])\\d{4}|(?:46|60(?:[18][1-9]|[24-7][2-9]))\\d{6}",[8,10]],["333301[0-5]\\d{3}|3333(?:00|2[5-9]|[3-9]\\d)\\d{4}|(?:3(?:(?:0[0-5]|1\\d|5[01]|70)\\d|2(?:[0-3]\\d|4[1-9])|3(?:00|3[0-24-9]))|9(?:101|408))\\d{6}",[10]],["1800\\d{7}",[11]],["(?:19(?:0[01]|4[78])|901)\\d{7}",[10,11]]]],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))",0,0,0,[["210[7-9]\\d{4}|2(?:[024-7]\\d|1[1-9])\\d{5}",[8]],["(?:3005\\d|6500[01])\\d{3}|(?:5[07]|6[0-4]|7[0-3]|8[3-9])\\d{6}",[8]],["800\\d{7}",[10]],["90[059]\\d{7}",[10]],0,0,0,0,["(?:210[0-6]|4\\d{3}|5100)\\d{4}",[8]]]],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:3[23]|4[89])\\d{4,6}|(?:31|4[36]|8(?:0[25]|78)\\d)\\d{6}|(?:2[1-4]|4[1257]|7\\d)\\d{5,6}"],["(?:5\\d|6[2-4])\\d{6}",[8]],["800\\d{7}",[10]],0,0,0,0,0,0,["807\\d{7}",[10]]]],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]],0,0,0,0,0,0,[["2(?:2[1-7]|3[0-8]|4[12]|5[1256]|6\\d|7[1-3]|8[1-5])\\d{4}"],["(?:36|5[1-389]|9\\d)\\d{5}"],["800\\d{4}"],0,0,0,0,0,["(?:3[3-5]|4[356])\\d{5}"]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]",[["9(?:4(?:3[0-5]|4[14]|6\\d)|50\\d|7(?:2[014]|3[02-9]|4[4-9]|6[357]|77|8[7-9])|8(?:3[39]|[46]\\d|7[01]|8[57-9]))\\d{4}"],["953[01]\\d{4}|9(?:5[12467]|6[5-9])\\d{5}"],0,0,0,0,0,["955\\d{5}",[8]],0,["60[0-2]\\d{4}",[7]]]],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-478])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]],0,0,0,0,0,0,[["2[2-6]\\d{6}"],["9(?:10|[4-79]\\d)\\d{5}"],["800\\d{5}"],["90[09]\\d{5}"],["700\\d{5}"],0,["(?:50|77)\\d{6}"],0,0,["80[1-9]\\d{5}"]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,[["(?:2\\d|3[1257-9]|4[16-9]|5[13-9])\\d{7}",[9]],["7(?:060\\d|19(?:[0-4]\\d|50))\\d{4}|(?:60[1-8]|7(?:0[2-5]|[2379]\\d))\\d{6}",[9]],["800\\d{6}",[9]],["9(?:0[05689]|76)\\d{6}",[9]],["70[01]\\d{6}",[9]],["9(?:3\\d{9}|6\\d{7,10})"],["9(?:5\\d|7[2-4])\\d{6}",[9]],0,["9[17]0\\d{6}",[9]],["8[134]\\d{7}",[9]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0",0,0,0,0,0,[["32\\d{9,11}|49[1-6]\\d{10}|322\\d{6}|49[0-7]\\d{3,9}|(?:[34]0|[68]9)\\d{3,13}|(?:2(?:0[1-689]|[1-3569]\\d|4[0-8]|7[1-7]|8[0-7])|3(?:[3569]\\d|4[0-79]|7[1-7]|8[1-8])|4(?:1[02-9]|[2-48]\\d|5[0-6]|6[0-8]|7[0-79])|5(?:0[2-8]|[124-6]\\d|[38][0-8]|[79][0-7])|6(?:0[02-9]|[1-358]\\d|[47][0-8]|6[1-9])|7(?:0[2-8]|1[1-9]|[27][0-7]|3\\d|[4-6][0-8]|8[0-5]|9[013-7])|8(?:0[2-9]|1[0-79]|2\\d|3[0-46-9]|4[0-6]|5[013-9]|6[1-8]|7[0-8]|8[0-24-6])|9(?:0[6-9]|[1-4]\\d|[589][0-7]|6[0-8]|7[0-467]))\\d{3,12}",[5,6,7,8,9,10,11,12,13,14,15]],["1(?:(?:5(?:[0-25-9]\\d\\d|3(?:10|33))|7[26-9]\\d\\d)\\d{6}|6[023]\\d{7,8})|17\\d{8}",[10,11]],["800\\d{7,12}",[10,11,12,13,14,15]],["(?:137[7-9]|900(?:[135]|9\\d))\\d{6}",[10,11]],["700\\d{8}",[11]],["1(?:6(?:013|255|399)|7(?:(?:[015]1|[69]3)3|[2-4]55|[78]99))\\d{7,8}|15(?:(?:[03-68]00|113)\\d|2\\d55|7\\d99|9\\d33)\\d{7}",[12,13]],["18(?:1\\d{5,11}|[2-9]\\d{8})",[8,9,10,11,12,13,14]],["16(?:4\\d{1,10}|[89]\\d{1,11})",[4,5,6,7,8,9,10,11,12,13,14]],0,["180\\d{5,11}|13(?:7[1-6]\\d\\d|8)\\d{4}",[7,8,9,10,11,12,13,14]]]],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]],0,0,0,0,0,0,[["2(?:1[2-5]|7[45])\\d{5}"],["77\\d{6}"]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:[0-59][1-9]|[6-8]\\d)|3(?:[0-3][1-9]|4[13]|5[1-58]|6[1347-9]|7\\d|8[1-8]|9[1-79])|4(?:[0-25][1-9]|[34][2-9]|6[13-579]|7[13579]|8[1-47]|9[127])|5(?:[0-36][1-9]|4[146-9]|5[3-57-9]|7[568]|8[1-358]|9[1-69])|6(?:[0135][1-9]|2[1-68]|4[2-8]|6[1689]|[78]\\d|9[15689])|7(?:[0-69][1-9]|7[3-9]|8[147])|8(?:[16-9][1-9]|2[1-58])|9(?:[1-47-9][1-9]|6\\d))\\d{5}"],["(?:2[6-8]|37|6[78]|96)\\d{6}|(?:2[0-59]|3[0-689]|[457]\\d|6[0-69]|8[126-9]|9[1-47-9])[1-9]\\d{5}"],["80\\d{6}"],["90\\d{6}"]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767",[["767(?:2(?:55|66)|4(?:2[01]|4[0-25-9])|50[0-4])\\d{4}"],["767(?:2(?:[2-4689]5|7[5-7])|31[5-7]|61[1-8]|70[1-6])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9",[["8(?:[04]9[2-9]\\d\\d|29(?:2(?:[0-59]\\d|6[04-9]|7[0-27]|8[0237-9])|3(?:[0-35-9]\\d|4[7-9])|[45]\\d\\d|6(?:[0-27-9]\\d|[3-5][1-9]|6[0135-8])|7(?:0[013-9]|[1-37]\\d|4[1-35689]|5[1-4689]|6[1-57-9]|8[1-79]|9[1-8])|8(?:0[146-9]|1[0-48]|[248]\\d|3[1-79]|5[01589]|6[013-68]|7[124-8]|9[0-8])|9(?:[0-24]\\d|3[02-46-9]|5[0-79]|60|7[0169]|8[57-9]|9[02-9])))\\d{4}"],["8[024]9[2-9]\\d{6}"],["800(?:14|[2-9]\\d)\\d{5}|8[024]9[01]\\d{6}|8(?:33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0",0,0,0,0,0,[["9619\\d{5}|(?:1\\d|2[013-79]|3[0-8]|4[013-689])\\d{6}"],["(?:5(?:4[0-29]|5\\d|6[0-3])|6(?:[569]\\d|7[0-6])|7[7-9]\\d)\\d{6}",[9]],["800\\d{6}",[9]],["80[3-689]1\\d{5}",[9]],0,0,0,0,["98[23]\\d{6}",[9]],["80[12]1\\d{5}",[9]]]],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["[2-7][2-7]\\d{6}",[8]],["964[0-2]\\d{5}|9(?:39|[57][89]|6[0-36-9]|[89]\\d)\\d{6}",[9]],["1800\\d{7}|1[78]00\\d{6}",[10,11]],0,0,0,0,0,["[2-7]890\\d{4}",[8]]]],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:3[23589]|4[3-8]|6\\d|7[1-9]|88)\\d{5}",[7]],["(?:5\\d{5}|8(?:1(?:0(?:0(?:00|[178]\\d)|[3-9]\\d\\d)|(?:1(?:0[2-6]|1\\d)|(?:2[0-59]|[3-79]\\d)\\d)\\d)|2(?:0(?:0(?:00|4\\d)|(?:19|[2-7]\\d)\\d)|(?:(?:[124-69]\\d|3[5-9])\\d|7(?:[0-79]\\d|8[13-9])|8(?:[2-6]\\d|7[01]))\\d)|[349]\\d{4}))\\d\\d|5(?:(?:[02]\\d|5[0-478])\\d|1(?:[0-8]\\d|95)|6(?:4[0-4]|5[1-589]))\\d{3}",[7,8]],["800(?:(?:0\\d\\d|1)\\d|[2-9])\\d{3}"],["(?:40\\d\\d|900)\\d{4}",[7,8]],["70[0-2]\\d{5}",[8]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0",0,0,0,0,0,[["13[23]\\d{6}|(?:15|57)\\d{6,7}|(?:2\\d|3|4[05-8]|5[05]|6[24-689]|8[2468]|9[235-7])\\d{7}",[8,9]],["1[0-25]\\d{8}",[10]],["800\\d{7}",[10]],["900\\d{7}",[10]]]],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]",[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-8]|5[0-5]|8[0-7]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1[12568]|[24]0|55|6[146])|8\\d\\d)\\d{4}"],["(?:17[1-3]|7\\d\\d)\\d{4}"]]],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]],0,0,0,0,0,0,[["96906(?:0[0-8]|1[1-9]|[2-9]\\d)\\d\\d|9(?:69(?:0[0-57-9]|[1-9]\\d)|73(?:[0-8]\\d|9[1-9]))\\d{4}|(?:8(?:[1356]\\d|[28][0-8]|[47][1-9])|9(?:[135]\\d|[268][0-8]|4[1-9]|7[124-9]))\\d{6}"],["(?:590[16]00\\d|9(?:6906(?:09|10)|7390\\d\\d))\\d\\d|(?:6\\d|7[1-48])\\d{7}"],["[89]00\\d{6}"],["80[367]\\d{6}"],["70\\d{7}"],0,["51\\d{7}"],0,0,["90[12]\\d{6}"]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0",0,0,0,0,0,[["11667[01]\\d{3}|(?:11(?:1(?:1[1-468]|2[2-7]|3[1-5]|5[5-8]|8[6-8])|2(?:13|3[6-8]|5[89]|7[05-9]|8[2-6])|3(?:2[01]|3[0-289]|4[1289]|7[1-4]|87)|4(?:1[69]|3[2-49]|4[0-3]|6[5-8]|7\\d)|5(?:1[578]|44|5[0-4])|6(?:1[578]|2[69]|39|4[5-7]|5[0-5]|6[0-59]|8[015-8]))|2(?:2(?:11[1-9]|22[0-7]|33\\d|44[1467]|66[1-68])|5(?:11[124-6]|33[2-8]|44[1467]|55[14]|66[1-3679]|77[124-79]|880))|3(?:3(?:11[0-46-8]|(?:22|55)[0-6]|33[0134689]|44[04]|66[01467])|4(?:44[0-8]|55[0-69]|66[0-3]|77[1-5]))|4(?:6(?:119|22[0-24-7]|33[1-5]|44[13-69]|55[14-689]|660|88[1-4])|7(?:(?:11|22)[1-9]|33[13-7]|44[13-6]|55[1-689]))|5(?:7(?:227|55[05]|(?:66|77)[14-8])|8(?:11[149]|22[013-79]|33[0-68]|44[013-8]|550|66[1-5]|77\\d)))\\d{4}"],["700[1-9]\\d{5}|(?:7(?:0[1-9]|1[0-8]|22|77|86|99)|9\\d\\d)\\d{6}"]]],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",[["1[3-7][1-8]\\d{3,6}|(?:19[1-8]|[23568][1-8]\\d|9(?:00|[1-8]\\d))\\d{2,6}",[5,6,7,8,9]],["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}",[6,7,8,9,10]],["800\\d{4,6}",[7,8,9]],["[67]00\\d{5,6}",[8,9]],0,0,["20\\d{4,8}|60[12]\\d{5,6}|7(?:099\\d{4,5}|5[03-9]\\d{3,7})|20[2-59]\\d\\d|(?:606|7(?:0[78]|1|3\\d))\\d{7}|(?:10|29|3[09]|70[1-5]\\d)\\d{4,8}"]],"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,[["603\\d{4}|(?:3[0-5]|6[25-7]|8[58])\\d{5}",[7]],["(?:[279]\\d|45|5[01568]|8[034679])\\d{5}",[7]],["0800\\d{7}",[11]]],"00"],FK:["500","00","[2-7]\\d{4}",[5],0,0,0,0,0,0,0,[["[2-47]\\d{4}"],["[56]\\d{4}"]]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]],0,0,0,0,0,0,[["31(?:00[67]|208|309)\\d\\d|(?:3(?:[2357]0[1-9]|602|804|905)|(?:820|9[2-6]\\d)\\d)\\d{3}"],["31(?:00[67]|208|309)\\d\\d|(?:3(?:[2357]0[1-9]|602|804|905)|(?:820|9[2-7]\\d)\\d)\\d{3}"]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))",0,0,0,[["(?:20|[34]\\d|8[19])\\d{4}"],["(?:[27][1-9]|5\\d|9[16])\\d{4}"],["80[257-9]\\d{3}"],["90(?:[13-5][15-7]|2[125-7]|9\\d)\\d\\d"],0,0,0,0,["(?:6[0-36]|88)\\d{4}"]]],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0",0,0,0,0,0,[["(?:26[013-9]|59[1-35-9])\\d{6}|(?:[13]\\d|2[0-57-9]|4[1-9]|5[0-8])\\d{7}"],["(?:6(?:[0-24-8]\\d|3[0-8]|9[589])|7[3-9]\\d)\\d{6}"],["80[0-5]\\d{6}"],["836(?:0[0-36-9]|[1-9]\\d)\\d{4}|8(?:1[2-9]|2[2-47-9]|3[0-57-9]|[569]\\d|8[0-35-9])\\d{6}"],0,0,["80[6-9]\\d{6}"],0,["9\\d{8}"],["8(?:1[01]|2[0156]|4[024]|84)\\d{6}"]]],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1",0,0,[["[01]1\\d{6}",[8]],["(?:(?:0[2-7]|7[467])\\d|6(?:0[0-4]|10|[256]\\d))\\d{5}|[2-7]\\d{6}"]]],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-35])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473",[["473(?:2(?:3[0-2]|69)|3(?:2[89]|86)|4(?:[06]8|3[5-9]|4[0-4]|5[59]|73|90)|63[68]|7(?:58|84)|800|938)\\d{4}"],["473(?:4(?:0[2-79]|1[04-9]|2[0-5]|49|5[6-8])|5(?:2[01]|3[3-8])|901)\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0",0,0,0,0,0,[["(?:3(?:[256]\\d|4[124-9]|7[0-4])|4(?:1\\d|2[2-7]|3[1-79]|4[2-8]|7[239]|9[1-7]))\\d{6}"],["5(?:(?:(?:0555|1(?:[17]77|555))[5-9]|757(?:7[7-9]|8[01]))\\d|22252[0-4])\\d\\d|5(?:0(?:0[17]0|505)|1(?:0[01]0|1(?:07|33|51))|2(?:0[02]0|2[25]2)|3(?:0[03]0|3[35]3)|(?:40[04]|900)0|5222)[0-4]\\d{3}|(?:5(?:0(?:0(?:0\\d|11|22|3[0-6]|44|5[05]|77|88|9[09])|(?:[14]\\d|77)\\d|22[02])|1(?:1(?:[03][01]|[124]\\d|5[2-6]|7[0-4])|4\\d\\d)|[23]555|4(?:4\\d\\d|555)|5(?:[0157-9]\\d\\d|200|333|444)|6[89]\\d\\d|7(?:[0147-9]\\d\\d|5(?:00|[57]5))|8(?:0(?:[018]\\d|2[0-4])|5(?:55|8[89])|8(?:55|88))|9(?:090|[1-35-9]\\d\\d))|790\\d\\d)\\d{4}"],["800\\d{6}"],0,0,0,0,0,["70[67]\\d{6}"]]],GF:["594","00","(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0",0,0,0,0,0,[["594(?:[02-49]\\d|1[0-5]|5[6-9]|6[0-3]|80)\\d{4}"],["(?:694(?:[0-249]\\d|3[0-8])|7093[0-3])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:396|76\\d)\\d|476[0-6])\\d{4}"]]],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0",0,0,0,0,0,[["3082[0-5]\\d{4}|3(?:0(?:[237]\\d|8[01])|[167](?:2[0-6]|7\\d|80)|2(?:2[0-5]|7\\d|80)|3(?:2[0-3]|7\\d|80)|4(?:2[013-9]|3[01]|7\\d|80)|5(?:2[0-7]|7\\d|80)|8(?:2[0-2]|7\\d|80)|9(?:[28]0|7\\d))\\d{5}",[9]],["(?:2(?:[0346-9]\\d|5[67])|5(?:[03-7]\\d|9[1-9]))\\d{6}",[9]],["800\\d{5}",[8]]]],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]],0,0,0,0,0,0,[["2190[0-2]\\d{3}|2(?:0(?:[02]\\d|3[01])|16[24-9]|2[2-5]\\d)\\d{4}"],["5251[0-4]\\d{3}|(?:5(?:[146-8]\\d\\d|250)|60(?:1[01]|6\\d))\\d{4}"]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]],0,0,0,0,0,0,[["(?:19|3[1-7]|[68][1-9]|70|9\\d)\\d{4}"],["[245]\\d{5}"],["80\\d{4}"],0,0,0,0,0,["3[89]\\d{4}"]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[["(?:4(?:[23]\\d\\d|4(?:1[024679]|[6-9]\\d))|5(?:5(?:3\\d|4[0-7])|6[67]\\d|7(?:1[04]|2[035]|3[58]|48))|8[0-589]\\d\\d)\\d{3}"],["556\\d{4}|(?:[23679]\\d|4[015]|5[0-489]|8[67])\\d{5}"]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]],0,0,0,0,0,0,[["3(?:0(?:24|3[12]|4[1-35-7]|5[13]|6[189]|[78]1|9[1478])|1\\d\\d)\\d{4}",[8]],["6[0-356]\\d{7}",[9]],0,0,0,0,0,0,["722\\d{6}",[9]]]],GP:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]],0,0,0,0,0,0,[["33[0-24-9]\\d[46]\\d{4}|3(?:33|5\\d)\\d[7-9]\\d{4}"],["(?:222|55\\d)\\d{6}"],["80\\d[1-9]\\d{5}"],["90\\d[1-9]\\d{5}"]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["2(?:1\\d\\d|2(?:2[1-46-9]|[36][1-8]|4[1-7]|5[1-4]|7[1-5]|[89][1-9])|3(?:1\\d|2[1-57]|[35][1-3]|4[13]|7[1-7]|8[124-6]|9[1-79])|4(?:1\\d|2[1-8]|3[1-4]|4[13-5]|6[1-578]|9[1-5])|5(?:1\\d|[29][1-4]|3[1-5]|4[124]|5[1-6])|6(?:1\\d|[269][1-6]|3[1245]|4[1-7]|5[13-9]|7[14]|8[1-5])|7(?:1\\d|2[1-5]|3[1-6]|4[1-7]|5[1-57]|6[135]|9[125-7])|8(?:1\\d|2[1-5]|[34][1-4]|9[1-57]))\\d{6}",[10]],["68[57-9]\\d{7}|(?:69|94)\\d{8}",[10]],["800\\d{7,9}"],["90[19]\\d{7}",[10]],["70\\d{8}",[10]],0,["5005000\\d{3}",[10]],0,0,["8(?:0[16]|12|[27]5|50)\\d{7}",[10]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[["[267][2-9]\\d{6}",[8]],["(?:[3-5]\\d\\d|80[0-4])\\d{5}",[8]],["18[01]\\d{8}",[11]],["19\\d{9}",[11]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671",[["671(?:2\\d\\d|3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[02-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[478])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]],0,0,0,0,0,0,[["443\\d{6}",[9]],["9(?:5\\d|6[569]|77)\\d{6}",[9]],0,0,0,0,0,0,["40\\d{5}",[7]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:1[6-9]|2[0-35-9]|3[1-4]|5[3-9]|6\\d|7[0-79])|3(?:2[25-9]|3\\d)|4(?:4[0-24]|5[56])|50[0-6]|77[1-57])\\d{4}"],["(?:51[01]|6\\d\\d|7(?:[0-5]\\d|6[0-39]|70))\\d{4}"],["(?:289|8(?:00|6[28]|88|99))\\d{4}"],["9008\\d{3}"],0,0,0,0,["515\\d{4}"]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,[["(?:2(?:[13-9]\\d|2[013-9])\\d|3(?:(?:[1569][0-24-9]|4[0-246-9]|7[0-24-69])\\d|8(?:4[0-8]|[579]\\d|6[0-5]))|58(?:0[1-9]|1[2-9]))\\d{4}",[8]],["(?:4(?:44[0-35-9]|6(?:4[0-57-9]|6[0-4])|7(?:3[0-4]|4[0-48]|6[0-5]))|5(?:35[4-8]|73[0-6]|95[0-8])|6(?:26[013-8]|(?:66|78)[0-5])|70(?:7[1-8]|8[0-8])|84(?:4[0-2]|8[0-35-9])|9(?:29[013-9]|39[014-9]|59[0-4]|899))\\d{4}|(?:4(?:4[0-35-9]|6[0-357-9]|7[0-25])|5(?:[1-59][0-46-9]|6[0-4689]|7[0-246-9])|6(?:0[1-9]|[13-59]\\d|[268][0-57-9]|7[0-79])|70[1-59]|84[0-39]|9(?:0[1-9]|1[02-9]|[2358][0-8]|[467]\\d))\\d{5}",[8]],["800\\d{6}",[9]],["900(?:[0-24-9]\\d{7}|3\\d{1,4})",[5,6,7,8,11]],["8(?:1[0-4679]\\d|2(?:[0-36]\\d|7[0-4])|3(?:[034]\\d|2[09]|70))\\d{4}",[8]],0,["30(?:0[1-9]|[15-7]\\d|2[047]|89)\\d{4}",[8]],["7(?:1(?:0[0-38]|1[0-3679]|3[013]|69|9[0136])|2(?:[02389]\\d|1[18]|7[27-9])|3(?:[0-38]\\d|7[0-369]|9[2357-9])|47\\d|5(?:[178]\\d|5[0-5])|6(?:0[0-7]|2[236-9]|[35]\\d)|7(?:[27]\\d|8[7-9])|8(?:[23689]\\d|7[1-9])|9(?:[025]\\d|6[0-246-8]|7[0-36-9]|8[238]))\\d{4}",[8]]],"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]],0,0,0,0,0,0,[["2(?:2(?:0[0-59]|1[1-9]|[23]\\d|4[02-7]|5[57]|6[245]|7[0135689]|8[01346-9]|9[0-2])|4(?:0[578]|2[3-59]|3[13-9]|4[0-68]|5[1-3589])|5(?:0[2357-9]|1[1-356]|4[03-5]|5\\d|6[014-69]|7[04]|80)|6(?:[056]\\d|17|2[067]|3[047]|4[0-378]|[78][0-8]|9[01])|7(?:0[5-79]|6[46-9]|7[02-9]|8[034]|91)|8(?:79|8[0-357-9]|9[1-57-9]))\\d{4}",[8]],["[37-9]\\d{7}",[8]],["8002\\d{7}",[11]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[["1\\d{7}|(?:2[0-3]|3[1-5]|4[02-47-9]|5[1-3])\\d{6,7}",[8,9]],["9(?:(?:0[1-9]|[12589]\\d)\\d\\d|7(?:[0679]\\d\\d|5(?:[01]\\d|44|55|77|9[5-79])))\\d{4}|98\\d{6}",[8,9]],["80\\d{5,7}"],["6[01459]\\d{6}|6[01]\\d{5}",[7,8]],["7[45]\\d{6}",[8]],0,["62\\d{6,7}|72\\d{6}",[8,9]]]],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]],0,0,0,0,0,0,[["2(?:2\\d|5[1-5]|81|9[149])\\d{5}"],["(?:[34]\\d|5[56])\\d{6}"],["8\\d{7}"],0,0,0,0,0,["9(?:[67][0-4]|8[0-3589]|9\\d)\\d{5}"]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06",0,0,0,0,0,[["(?:1\\d|[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6[23689]|8[2-57-9]|9[2-69])\\d{6}",[8]],["(?:[257]0|3[01])\\d{7}",[9]],["(?:[48]0\\d|680[29])\\d{5}"],["9[01]\\d{6}",[8]],0,0,["38\\d{7}",[9]],0,["21\\d{7}",[9]]]],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0",0,0,0,0,0,[["2[124]\\d{7,8}|619\\d{8}|2(?:1(?:14|500)|2\\d{3})\\d{3}|61\\d{5,8}|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\d|9[1-8])|3(?:1|[25][1-8]|3[1-68]|4[1-3]|6[1-3568]|7[0-469]|8\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|43|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[124-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:[25]\\d|3[1-69]|4[1-6])|7(?:02|[125][1-9]|[36]\\d|4[1-8]|7[0-36-9])|9(?:0[12]|1[013-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\d{5,8}",[7,8,9,10,11]],["8[1-35-9]\\d{7,10}",[9,10,11,12]],["00(?:1803\\d{5,11}|7803\\d{7})|(?:177\\d|800)\\d{5,7}",[8,9,10,11,12,13,14,15,16,17]],["809\\d{7}",[10]],0,0,["(?:1500|8071\\d{3})\\d{3}",[7,10]],0,0,["804\\d{7}",[10]]]],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:1\\d|21)\\d{6,7}|(?:2[24-9]|4(?:0[24]|5\\d|7)|5(?:0[45]|1\\d|8)|6(?:1\\d|[237-9])|9(?:1\\d|[35-9]))\\d{5}|(?:23|4(?:[1-469]|8\\d)|5[23679]|6[4-6]|7[14]|9[04])\\d{7}"],["8(?:22|[35-9]\\d)\\d{6}",[9]],["1800\\d{6}",[10]],["15(?:1[2-8]|[2-8]0|9[089])\\d{6}",[10]],["700\\d{6}",[9]],["88210[1-9]\\d{4}|8(?:[35-79]5\\d\\d|8(?:[013-9]\\d\\d|2(?:[01][1-9]|[2-9]\\d)))\\d{5}",[10]],["818\\d{6}",[9]],0,["76\\d{7}",[9]],["18[59]0\\d{6}",[10]]]],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0",0,0,0,0,0,[["153\\d{8,9}|29[1-9]\\d{5}|(?:2[0-8]|[3489]\\d)\\d{6}",[8,11,12]],["55(?:4(?:0[01]|10|5[0-7])|57[0-289])\\d{4}|5(?:(?:[0-2][02-9]|[36]\\d|[49][2-9]|8[3-7])\\d|5(?:01|2\\d|3[0-3]|4[34]|5[0-25689]|6[6-8]|7[0-267]|8[7-9]|9[1-9]))\\d{5}",[9]],["1(?:255|80[019]\\d{3})\\d{3}",[7,10]],["1212\\d{4}|1(?:200|9(?:0[0-2]|19))\\d{6}",[8,10]],0,["151\\d{8,9}",[11,12]],["1599\\d{6}",[10]],0,["7(?:38(?:[05]\\d|8[018])|8(?:33|55|77|81)\\d)\\d{4}|7(?:18|2[23]|3[237]|47|6[258]|7\\d|82|9[2-9])\\d{6}",[9]],["1700\\d{6}",[10]]]],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24",[["1624(?:230|[5-8]\\d\\d)\\d{3}"],["76245[06]\\d{4}|7(?:4576|[59]24\\d|624[0-4689])\\d{5}"],["808162\\d{4}"],["8(?:440[49]06|72299\\d)\\d{3}|(?:8(?:45|70)|90[0167])624\\d{4}"],["70\\d{8}"],0,["3440[49]06\\d{3}|(?:3(?:08162|3\\d{4}|45624|7(?:0624|2299))|55\\d{4})\\d{4}"],0,["56\\d{8}"]]],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0",0,0,0,0,0,[["2717(?:[2-7]\\d|95)\\d{4}|(?:271[0-689]|782[0-6])[2-7]\\d{5}|(?:170[24]|2(?:(?:[02][2-79]|90)\\d|80[13468])|(?:3(?:23|80)|683|79[1-7])\\d|4(?:20[24]|72[2-8])|552[1-7])\\d{6}|(?:11|33|4[04]|80)[2-7]\\d{7}|(?:342|674|788)(?:[0189][2-7]|[2-7]\\d)\\d{5}|(?:1(?:2[0-249]|3[0-25]|4[145]|[59][14]|6[014]|7[1257]|8[01346])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568]|9[14])|3(?:26|4[13]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[014-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91))[2-7]\\d{6}|(?:1(?:2[35-8]|3[346-9]|4[236-9]|[59][0235-9]|6[235-9]|7[34689]|8[257-9])|2(?:1[134689]|3[24-8]|4[2-8]|5[25689]|6[2-4679]|7[3-79]|8[2-479]|9[235-9])|3(?:01|1[79]|2[1245]|4[5-8]|5[125689]|6[235-7]|7[157-9]|8[2-46-8])|4(?:1[14578]|2[5689]|3[2-467]|5[4-7]|6[35]|73|8[2689]|9[2389])|5(?:[16][146-9]|2[14-8]|3[1346]|4[14-69]|5[46]|7[2-4]|8[2-8]|9[246])|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])|7(?:1[013-9]|2[0235-9]|3[2679]|4[1-35689]|5[2-46-9]|[67][02-9]|8[013-7]|9[089])|8(?:1[1357-9]|2[235-8]|3[03-57-9]|4[0-24-9]|5\\d|6[2457-9]|7[1-6]|8[1256]|9[2-4]))\\d[2-7]\\d{5}",[10]],["(?:61279|7(?:887[02-9]|9(?:313|79[07-9]))|8(?:079[04-9]|(?:84|91)7[02-8]))\\d{5}|(?:6(?:12|[2-47]1|5[17]|6[13]|80)[0189]|7(?:1(?:2[0189]|9[0-5])|2(?:[14][017-9]|8[0-59])|3(?:2[5-8]|[34][017-9]|9[016-9])|4(?:1[015-9]|[29][89]|39|8[389])|5(?:[15][017-9]|2[04-9]|9[7-9])|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589])|70[0289]|88[089]|97[02-8])|8(?:0(?:6[67]|7[02-8])|70[017-9]|84[01489]|91[0-289]))\\d{6}|(?:7(?:31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[0189]\\d|7[02-8])\\d{5}|(?:6(?:[09]\\d|1[04679]|2[03689]|3[05-9]|4[0489]|50|6[069]|7[07]|8[7-9])|7(?:0\\d|2[0235-79]|3[05-8]|40|5[0346-8]|6[6-9]|7[1-9]|8[0-79]|9[089])|8(?:0[01589]|1[0-57-9]|2[235-9]|3[03-57-9]|[45]\\d|6[02457-9]|7[1-69]|8[0-25-9]|9[02-9])|9\\d\\d)\\d{7}|(?:6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|8[124-6])\\d|7(?:[235689]\\d|4[0189]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-5])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]|881))[0189]\\d{5}",[10]],["000800\\d{7}|1(?:600\\d{6}|80(?:0\\d{4,9}|3\\d{9}))"],["186[12]\\d{9}",[13]],0,0,["140\\d{7}",[10]],0,0,["1860\\d{7}",[11]]]],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]],0,0,0,0,0,0,[["37\\d{5}"],["38\\d{5}"]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["1\\d{7}|(?:2[13-5]|3[02367]|4[023]|5[03]|6[026])\\d{6,7}",[8,9]],["7[3-9]\\d{8}",[10]]]],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0",0,0,0,0,0,[["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])(?:[03-57]\\d{7}|[16]\\d{3}(?:\\d{4})?|[289]\\d{3}(?:\\d(?:\\d{3})?)?)|94(?:000[09]|(?:12\\d|30[0-2])\\d|2(?:121|[2689]0\\d)|4(?:111|40\\d))\\d{4}",[6,7,10]],["9(?:(?:0[0-5]|[13]\\d|2[0-3])\\d\\d|9(?:[0-46]\\d\\d|5(?:10|5\\d)|8(?:[12]\\d|88)|9(?:0[0-3]|[19]\\d|21|69|77|8[7-9])))\\d{5}",[10]],0,0,0,0,["96(?:0[12]|2[16-8]|3(?:08|[14]5|[23]|66)|4(?:0|80)|5[01]|6[89]|86|9[19])",[4,5]]]],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["(?:4(?:1[0-24-69]|2[0-7]|[37][0-8]|4[0-24589]|5[0-68]|6\\d|8[0-36-8])|5(?:05|[156]\\d|2[02578]|3[0-579]|4[03-7]|7[0-2578]|8[0-35-9]|9[013-689])|872)\\d{4}",[7]],["(?:38[589]\\d\\d|6(?:1[1-8]|2[0-6]|3[026-9]|4[014679]|5[0159]|6[0-69]|70|8[06-8]|9\\d)|7(?:5[057]|[6-9]\\d)|8(?:2[0-59]|[3-69]\\d|8[238]))\\d{4}"],["80[0-8]\\d{4}",[7]],["90(?:0\\d|1[5-79]|2[015-79]|3[135-79]|4[125-7]|5[25-79]|7[1-37]|8[0-35-7])\\d{3}",[7]],0,["(?:689|8(?:7[18]|80)|95[48])\\d{4}",[7]],["809\\d{4}",[7]],0,["49[0-24-79]\\d{4}",[7]]],"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876",[["8766060\\d{3}|(?:658(?:2(?:[0-8]\\d|9[0-46-9])|[3-9]\\d\\d)|876(?:52[35]|6(?:0[1-3579]|1[0235-9]|[23]\\d|40|5[06]|6[2-589]|7[0-25-9]|8[04]|9[4-9])|7(?:0[2-689]|[1-6]\\d|8[056]|9[45])|9(?:0[1-8]|1[02378]|[2-8]\\d|9[2-468])))\\d{4}"],["(?:658295|876(?:2(?:0[1-9]|[13-9]\\d|2[013-9])|[348]\\d\\d|5(?:0[1-9]|[1-9]\\d)|6(?:4[89]|6[67])|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579])))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["87(?:000|90[01])\\d{3}|(?:2(?:6(?:2[0-35-9]|3[0-578]|4[24-7]|5[0-24-8]|[6-8][023]|9[0-3])|7(?:0[1-79]|10|2[014-7]|3[0-689]|4[019]|5[0-3578]))|32(?:0[1-69]|1[1-35-7]|2[024-7]|3\\d|4[0-3]|[5-7][023])|53(?:0[0-3]|[13][023]|2[0-59]|49|5[0-35-9]|6[15]|7[45]|8[1-6]|9[0-36-9])|6(?:2(?:[05]0|22)|3(?:00|33)|4(?:0[0-25]|1[2-7]|2[0569]|[38][07-9]|4[025689]|6[0-589]|7\\d|9[0-2])|5(?:[01][056]|2[034]|3[0-57-9]|4[178]|5[0-69]|6[0-35-9]|7[1-379]|8[0-68]|9[0239]))|87(?:20|7[078]|99))\\d{4}",[8]],["7(?:[78][0-25-9]|9\\d)\\d{6}",[9]],["80\\d{6}",[8]],["9\\d{7}",[8]],["70\\d{7}",[9]],0,["8(?:10|8\\d)\\d{5}",[8]],["74(?:66|77)\\d{5}",[9]],0,["85\\d{6}",[8]]]],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1",0,0,[["(?:1(?:1[235-8]|2[3-6]|3[3-9]|4[2-6]|[58][2-8]|6[2-7]|7[2-9]|9[1-9])|(?:2[2-9]|[36][1-9])\\d|4(?:[2-578]\\d|6[02-8]|9[2-59])|5(?:[2-589]\\d|6[1-9]|7[2-8])|7(?:[25-9]\\d|3[4-9]|4[02-9])|8(?:[2679]\\d|3[2-9]|4[5-9]|5[1-9]|8[03-9])|9(?:[2-58]\\d|[679][1-9]))\\d{6}",[9]],["(?:601[0-4]0|[7-9]0[1-9]\\d\\d)\\d{5}",[10]],["00777(?:[01]|5\\d)\\d\\d|(?:00(?:7778|882[1245])|(?:120|800\\d)\\d\\d)\\d{4}|00(?:37|66|78)\\d{6,13}"],["990\\d{6}",[9]],["60\\d{7}",[9]],0,["570\\d{6}",[9]],["20\\d{8}",[10]],["50[1-9]\\d{7}",[10]]]],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,[["(?:4[245]|5[1-79]|6[01457-9])\\d{5,7}|(?:4[136]|5[08]|62)\\d{7}|(?:[24]0|66)\\d{6,7}",[7,8,9]],["(?:1(?:0[0-8]|1\\d|2[014]|[34]0)|7\\d\\d)\\d{6}",[9]],["800[02-8]\\d{5,6}",[9,10]],["900[02-9]\\d{5}",[9]]]],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["312(?:5[0-79]\\d|9(?:[0-689]\\d|7[0-24-9]))\\d{3}|(?:3(?:1(?:2[0-46-8]|3[1-9]|47|[56]\\d)|2(?:22|3[0-479]|6[0-7])|4(?:22|5[6-9]|6\\d)|5(?:22|3[4-7]|59|6\\d)|6(?:22|5[35-7]|6\\d)|7(?:22|3[468]|4[1-9]|59|[67]\\d)|9(?:22|4[1-8]|6\\d))|6(?:09|12|2[2-4])\\d)\\d{5}",[9]],["312(?:58\\d|973)\\d{3}|(?:2(?:0[0-35]|2\\d)|5[0-24-7]\\d|600|7(?:[07]\\d|55)|88[08]|9(?:12|9[05-9]))\\d{6}",[9]],["800\\d{6,7}"]]],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["23(?:4(?:[2-4]|[56]\\d)|[568]\\d\\d)\\d{4}|23[236-9]\\d{5}|(?:2[4-6]|3[2-6]|4[2-4]|[5-7][2-5])(?:(?:[237-9]|4[56]|5\\d)\\d{5}|6\\d{5,6})",[8,9]],["(?:(?:1[28]|3[18]|9[67])\\d|6[016-9]|7(?:[07-9]|[16]\\d)|8(?:[013-79]|8\\d))\\d{6}|(?:1\\d|9[0-57-9])\\d{6}|(?:2[3-6]|3[2-6]|4[2-4]|[5-7][2-5])48\\d{5}",[8,9]],["1800(?:1\\d|2[019])\\d{4}",[10]],["1900(?:1\\d|2[09])\\d{4}",[10]]]],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0",0,0,0,0,0,[["(?:[24]\\d|3[1-9]|50|65(?:02[12]|12[56]|22[89]|[3-5]00)|7(?:27\\d\\d|3100|5(?:02[12]|12[56]|22[89]|[34](?:00|81)|500))|8[0-5])\\d{3}"],["(?:6200[01]|7(?:310[1-9]|5(?:02[03-9]|12[0-47-9]|22[0-7]|[34](?:0[1-9]|8[02-9])|50[1-9])))\\d{3}|(?:63\\d\\d|7(?:(?:[0146-9]\\d|2[0-689])\\d|3(?:[02-9]\\d|1[1-9])|5(?:[0-2][013-9]|[34][1-79]|5[1-9]|[6-9]\\d)))\\d{4}",[8]],0,0,0,0,0,0,["30(?:0[01]\\d\\d|12(?:11|20))\\d\\d",[8]]]],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]],0,0,0,0,0,0,[["7[4-7]\\d{5}"],["[34]\\d{6}"],0,["8\\d{6}"]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869",[["869(?:2(?:29|36)|302|4(?:6[015-9]|70)|56[5-7])\\d{4}"],["869(?:48[89]|55[6-8]|66\\d|76[02-7])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:195|2)\\d|3[19]|4[159]|5[37]|6[17]|7[39]|85)\\d{6}"],["19[1-3]\\d{7}",[10]]]],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?",0,0,0,[["(?:2|3[1-3]|[46][1-4]|5[1-5])[1-9]\\d{6,7}|(?:3[1-3]|[46][1-4]|5[1-5])1\\d{2,3}",[5,6,8,9,10]],["1(?:05(?:[0-8]\\d|9[0-6])|22[13]\\d)\\d{4,5}|1(?:0[0-46-9]|[16-9]\\d|2[013-9])\\d{6,7}",[9,10]],["00(?:308\\d{6,7}|798\\d{7,9})|(?:00368|[38]0)\\d{7}",[9,11,12,13,14]],["60[2-9]\\d{6}",[9]],["50\\d{8,9}",[10,11]],0,["1(?:5(?:22|33|44|66|77|88|99)|6(?:[07]0|44|6[0168]|88)|8(?:00|33|55|77|99))\\d{4}",[8]],["15\\d{7,8}",[9,10]],["70\\d{8}",[10]]]],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]],0,0,0,0,0,0,[["2(?:[23]\\d\\d|4(?:[1-35-9]\\d|44)|5(?:0[034]|[2-46]\\d|5[1-3]|7[1-7]))\\d{4}",[8]],["(?:41\\d\\d|5(?:(?:[05]\\d|1[0-7]|6[56])\\d|2(?:22|5[25])|7(?:55|77)|88[58])|6(?:(?:0[034679]|5[015-9]|6\\d)\\d|1(?:00|11|6[16])|2[26]2|3[36]3|4[46]4|7(?:0[013-9]|[67]\\d)|8[68]8|9(?:[069]\\d|3[039]))|9(?:(?:[04679]\\d|8[057-9])\\d|1(?:00|1[01]|99)|2(?:00|2\\d)|3(?:00|3[03])|5(?:00|5\\d)))\\d{4}",[8]],["18\\d{5}",[7]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345",[["345(?:2(?:22|3[23]|44|66)|333|444|6(?:23|38|40)|7(?:30|4[35-79]|6[6-9]|77)|8(?:00|1[45]|4[89]|88)|9(?:14|4[035-9]))\\d{4}"],["345(?:32[1-9]|42[0-4]|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|82[56]|9(?:1[679]|2[2-9]|3[06-9]|90))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["(?:345976|900[2-9]\\d\\d)\\d{4}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33622|7",[["(?:33622|7(?:1(?:0(?:[23]\\d|4[0-3]|59|63)|1(?:[23]\\d|4[0-79]|59)|2(?:[23]\\d|59)|3(?:2\\d|3[0-79]|4[0-35-9]|59)|4(?:[24]\\d|3[013-9]|5[1-9]|97)|5(?:2\\d|3[1-9]|4[0-7]|59)|6(?:[2-4]\\d|5[19]|61)|72\\d|8(?:[27]\\d|3[1-46-9]|4[0-5]|59))|2(?:1(?:[23]\\d|4[46-9]|5[3469])|2(?:2\\d|3[0679]|46|5[12679])|3(?:[2-4]\\d|5[139])|4(?:2\\d|3[1-35-9]|59)|5(?:[23]\\d|4[0-8]|59|61)|6(?:2\\d|3[1-9]|4[0-4]|59)|7(?:[2379]\\d|40|5[279])|8(?:[23]\\d|4[0-3]|59)|9(?:2\\d|3[124578]|59))))\\d{5}",[10]],["7(?:0[0-25-8]|47|6[0-4]|7[15-8]|85)\\d{7}",[10]],["8(?:00|108\\d{3})\\d{7}"],["809\\d{7}",[10]],["808\\d{7}",[10]],0,0,0,["751\\d{7}",[10]]],"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,0,0,0,0,[["(?:2[13]|[35-7][14]|41|8[1468])\\d{6}",[8]],["(?:20(?:[23579]\\d|8[78])|30[24]\\d)\\d{6}|30\\d{7}",[9,10]]]],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0",0,0,0,0,0,[["7(?:62|8[0-6]|9[04-9])\\d{4}|(?:[14-69]\\d|2(?:[14-69]\\d|[78][1-9])|7[2-57]|8[02-9])\\d{5}"],["(?:(?:3|81)\\d|7(?:[01]\\d|6[013-9]|8[7-9]|9[1-3]))\\d{5}"],0,["9[01]\\d{6}",[8]],0,0,0,0,0,["80\\d{6}",[8]]]],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758",[["758(?:234|4(?:30|5\\d|6[2-9]|8[0-2])|57[0-2]|(?:63|75)8)\\d{4}"],["758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2\\d|3[0-3])|812)\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0",0,0,0,[["(?:2(?:01|1[27]|2[024]|3\\d|6[02-578]|96)|3(?:[24]0|33|7[0135-7]|8[048]|9[0269]))\\d{4}",[7]],["(?:6(?:(?:4[5-9]|5\\d)\\d|6(?:[024-6]\\d|[17]0|3[7-9]))\\d|7(?:[37-9]\\d|42|56))\\d{4}"],["8002[28]\\d\\d|80(?:05\\d|9)\\d{4}"],["90(?:02[258]|1(?:23|3[14])|66[136])\\d\\d",[7]],0,["697(?:42|56|[78]\\d)\\d{4}",[9]],["870(?:28|87)\\d\\d",[7]]]],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0",0,0,0,0,0,[["(?:12[2-9]|602|8[12]\\d|9(?:1\\d|22|9[245]))\\d{6}|(?:11|2[13-7]|3[1-8]|4[157]|5[12457]|6[35-7])[2-57]\\d{6}"],["7(?:[0-25-8]\\d|4[0-4])\\d{6}"],0,0,0,0,["1973\\d{5}"]]],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0",0,0,0,0,0,[["2\\d{7}",[8]],["(?:(?:(?:22|33)0|555|7(?:6[01]|7\\d)|88\\d)\\d|4(?:240|[67]))\\d{5}|[56]\\d{6}",[7,9]],0,["332(?:02|[34]\\d)\\d{4}",[9]]]],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]],0,0,0,0,0,0,[["2\\d{7}"],["[56]\\d{7}"],["800[1256]\\d{4}"]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]",0,0,0,[["(?:3[1478]|4[124-6]|52)\\d{6}"],["6\\d{7}"],["80[02]\\d{5}"],["9(?:0[0239]|10)\\d{5}"],["70[05]\\d{5}"],0,["70[67]\\d{5}"],0,["[89]01\\d{5}"],["808\\d{5}"]]],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)",0,0,0,[["(?:35[013-9]|80[2-9]|90[89])\\d{1,8}|(?:2[2-9]|3[0-46-9]|[457]\\d|8[13-9]|9[2-579])\\d{2,9}"],["6(?:[269][18]|5[1568]|7[189]|81)\\d{6}",[9]],["800\\d{5}",[8]],["90[015]\\d{5}",[8]],0,0,0,0,["20(?:1\\d{5}|[2-689]\\d{1,7})",[4,5,6,7,8,9,10]],["801\\d{5}",[8]]]],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]],0,0,0,0,0,0,[["6\\d{7}"],["2333[0-8]\\d{3}|2(?:[0-24-9]\\d\\d|3(?:0[07]|[14-9]\\d|2[02-9]|3[0-24-9]))\\d{4}"],["80\\d{6}"],["90\\d{6}"],0,0,0,0,0,["81\\d{6}"]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:0[56]|[1-6]\\d|7[124579]|8[124])|3(?:1\\d|2[2356])|4(?:[17]\\d|2[1-357]|5[2-4]|8[124])|5(?:[1347]\\d|2[1-469]|5[13-5]|8[1-4])|6(?:[1-479]\\d|5[2-57]|8[1-5])|7(?:[13]\\d|2[13-79])|8(?:[124]\\d|5[124]|84))\\d{6}"],["9[1-6]\\d{7}"]]],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-8]|5[0-5]|8[0-7]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0",0,0,0,0,0,[["(?:870|9[2-47-9]\\d)\\d{5}",[8]],["4(?:[469]\\d|5[1-9])\\d{5}|(?:3|6\\d)\\d{7}"],["(?:800|90\\d)\\d{5}",[8]]]],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:2[1-9]|3[1-79])\\d|5(?:33|5[257]))\\d{5}"],["562\\d{5}|(?:6\\d|7[16-9])\\d{6}"],["800\\d{5}"],["90[056]\\d{5}"],0,0,["803\\d{5}"],0,["3[08]\\d{6}"],["808\\d{5}"]]],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:20[2-8]|3(?:[0-2][2-7]|3[24-7])|4(?:0[2-467]|1[2467])|5(?:0[2467]|1[24-7]|2[2-467]))\\d{5}",[8]],["6(?:[07-9]\\d|3[024]|6[0-25])\\d{5}",[8]],["80(?:[0-2578]|9\\d)\\d{5}"],["9(?:4[1568]|5[178])\\d{5}",[8]],0,0,["77[1-9]\\d{5}",[8]],0,["78[1-49]\\d{5}",[8]]]],MF:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1",0,0,[["2072[29]\\d{4}|20(?:2\\d|4[47]|5[3467]|6[279]|7[356]|8[268]|9[2457])\\d{5}"],["3[2-47-9]\\d{7}"],0,0,0,0,0,0,["22\\d{7}"]]],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1",0,0,0,0,0,[["(?:247|528|625)\\d{4}"],["(?:(?:23|54)5|329|45[35-8])\\d{4}"],0,0,0,0,0,0,["635\\d{4}"]]],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:2(?:62|77)0|3444)\\d|4[56]440)\\d{3}|(?:34|4[357])700\\d{3}|(?:2(?:[0-3]\\d|5[0-578]|6[01]|82)|3(?:1[3-68]|[23][2-68]|4[23568])|4(?:[23][2-68]|4[3-68]|5[2568]|6[25-8]|7[24-68]|8[4-68]))\\d{5}"],["7(?:3555|(?:474|9[019]7)7)\\d{3}|7(?:[0-25-8]\\d\\d|3(?:[1-478]\\d|6[01])|4(?:2\\d|60|7[01578])|9(?:[2-4]\\d|5[01]|7[015]))\\d{4}"],["800\\d{5}"],["5\\d{7}"],0,0,0,0,0,["8(?:0[1-9]|[1-9]\\d)\\d{5}"]]],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]],0,0,0,0,0,0,[["2(?:07[0-8]|12[67])\\d{4}|(?:2(?:02|1[4-689])|4(?:0[0-4]|4[1-59]))\\d{5}"],["2(?:0(?:01|79)|17\\d)\\d{4}|(?:5[0-3]|[679]\\d|8[2-59])\\d{6}"],["80\\d{6}"]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:(?:12|[28]\\d|3[56]|7[3-6]|9[0-6])\\d|4(?:2[29]|7[0-2]|83)|6)|2(?:2(?:00|8[34])|4(?:0\\d|22|7[0-2]|83)|51\\d\\d)|4(?:2(?:2\\d\\d|48[013])|3(?:20\\d|4(?:70|83)|56)|420\\d|5(?:2\\d|470))|6(?:0(?:[23]|88\\d)|(?:124|[56]2\\d)\\d|2472|3(?:20\\d|470)|4(?:2[04]\\d|472)|7(?:3\\d\\d|4[67]0|8(?:[01459]\\d|8))))\\d{4}|5(?:2(?:2\\d{5,6}|47[02]\\d{4})|(?:3472|4(?:2(?:1|86)|470)|522\\d|6(?:20\\d|483)|7(?:20\\d|48[01])|8(?:20\\d|47[02])|9(?:20\\d|470))\\d{4})|7(?:(?:0470|4(?:25\\d|470)|5(?:202|470|96\\d))\\d{4}|1(?:20\\d{4,5}|4(?:70|83)\\d{4}))|8(?:1(?:2\\d{5,6}|4(?:10|7[01]\\d)\\d{3})|2(?:2\\d{5,6}|(?:320|490\\d)\\d{3})|(?:3(?:2\\d\\d|470)|4[24-7]|5(?:(?:2\\d|51)\\d|4(?:[1-35-9]\\d|4[0-57-9]))|6[23])\\d{4})|(?:1[2-6]\\d|4(?:2[24-8]|3[2-7]|[46][2-6]|5[3-5])|5(?:[27][2-8]|3[2-68]|4[24-8]|5[23]|6[2-4]|8[24-7]|9[2-7])|6(?:[19]20|42[03-6]|(?:52|7[45])\\d)|7(?:[04][24-8]|[15][2-7]|22|3[2-4])|8(?:1[2-689]|2[2-8]|(?:[35]2|64)\\d))\\d{4}|25\\d{5,6}|(?:2[2-9]|6(?:1[2356]|[24][2-6]|3[24-6]|5[2-4]|6[2-8]|7[235-7]|8[245]|9[24])|8(?:3[24]|5[245]))\\d{4}",[6,7,8,9]],["(?:17[01]|9(?:2(?:[0-4]|[56]\\d\\d)|(?:3(?:[0-36]|4\\d)|(?:6\\d|8[89]|9[4-8])\\d|7(?:3|40|[5-9]\\d))\\d|4(?:(?:[0245]\\d|[1379])\\d|88)|5[0-6])\\d)\\d{4}|9[69]1\\d{6}|9(?:[68]\\d|9[089])\\d{5}",[7,8,9,10]],["80080(?:0[1-9]|2\\d)\\d{3}",[10]],0,0,0,0,0,["1333\\d{4}",[8]]]],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0",0,0,0,0,0,[["[12]2[1-3]\\d{5,6}|(?:(?:[12](?:1|27)|5[368])\\d\\d|7(?:0(?:[0-5]\\d|7[078]|80)|128))\\d{4}|[12](?:3[2-8]|4[2-68]|5[1-4689])\\d{6,7}"],["92[0139]\\d{5}|(?:5[05]|6[069]|7[28]|8[0135689]|9[013-9])\\d{6}",[8]],0,0,0,0,0,0,["712[0-79]\\d{4}|7(?:1[013-9]|[5-79]\\d)\\d{5}",[8]]]],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]],0,0,0,0,0,0,[["(?:28[2-9]|8(?:11|[2-57-9]\\d))\\d{5}",[8]],["6800[0-79]\\d{3}|6(?:[235]\\d\\d|6(?:0[0-5]|[1-9]\\d)|8(?:0[1-9]|[14-8]\\d|2[5-9]|[39][0-4]))\\d{4}",[8]],["0800\\d{3}",[7]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670",[["670(?:2(?:3[3-7]|56|8[4-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],MQ:["596","00","(?:596\\d|7091)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:596(?:[03-7]\\d|1[05]|2[7-9]|8[0-39]|9[04-9])|80[6-9]\\d\\d|9(?:477[6-9]|767[4589]))\\d{4}"],["(?:69[67]\\d\\d|7091[0-3])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:397[0-3]|477[0-5]|76(?:6\\d|7[0-367]))\\d{4}"]]],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]],0,0,0,0,0,0,[["(?:25[08]|35\\d|45[1-7])\\d{5}"],["[2-4][0-46-9]\\d{6}"],["800\\d{5}"]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664",[["6644(?:1[0-3]|91)\\d{4}"],["664(?:3(?:49|9[1-6])|49[2-6])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]],0,0,0,0,0,0,[["20(?:3[1-4]|6[059])\\d{4}|2(?:0[19]|[1-357]\\d|60)\\d{5}"],["(?:7(?:210|[79]\\d\\d)|9(?:[29]\\d\\d|69[67]|8(?:1[1-3]|89|97)))\\d{4}"],["800(?:02|[3467]\\d)\\d{3}"],["5(?:0(?:0(?:37|43)|(?:6\\d|70|9[0168])\\d)|[12]\\d0[1-5])\\d{3}"],0,0,["501\\d{5}"],["7117\\d{4}"],["3550\\d{4}"]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,[["(?:2(?:[0346-8]\\d|1[0-8])|4(?:[013568]\\d|2[4-8]|71|90)|54(?:[3-5]\\d|71)|6\\d\\d|8(?:14|3[129]))\\d{4}",[7,8]],["5(?:4(?:2[1-389]|7[1-9])|87[15-8])\\d{4}|(?:5(?:2[5-9]|4[3-689]|[57]\\d|8[0-689]|9[0-8])|7(?:0[0-6]|3[013]))\\d{5}",[8]],["802\\d{7}|80[0-2]\\d{4}",[7,10]],["30\\d{5}",[7]],0,0,0,["219\\d{4}",[7]],["3(?:20|9\\d)\\d{4}",[7]]],"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,[["(?:3(?:0[0-4]|3[0-59])|6(?:[58][024689]|6[024-68]|7[02468]))\\d{4}",[7]],["(?:46[46]|[79]\\d\\d)\\d{4}",[7]],["800\\d{7}",[10]],["900\\d{7}",[10]],0,0,["4(?:0[01]|50)\\d{4}",[7]]],"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:1[2-9]|2[12]\\d\\d)\\d{5}"],["111\\d{6}|(?:31|77|[89][89])\\d{7}",[9]]]],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:0[01]|2\\d|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[267][1-9]|3[1-8]|[45]\\d|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-36-9]|6[0-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1346][1-9]|[27]\\d|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[0-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69]\\d|7[12]|8[1-8]))\\d{7}"],["(?:2(?:2\\d|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[267][1-9]|3[1-8]|[45]\\d|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-36-9]|6[0-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1346][1-9]|[27]\\d|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[0-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69]\\d|7[12]|8[1-8]))\\d{7}"],["8(?:00|88)\\d{7}"],["900\\d{7}"],["500\\d{7}"],0,0,0,0,["300\\d{7}"]],"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0",0,0,0,0,0,[["427[01]\\d{4}|(?:3(?:2[0-36-9]|3[0-368]|4[0-278]|5[0-24-8]|6[0-467]|7[1246-9]|8\\d|9[0-57])\\d|4(?:2[0-689]|[3-79]\\d|8[1-35689])|5(?:2[0-589]|[3468]\\d|5[0-489]|7[1-9]|9[23])|6(?:2[2-9]|3[1357-9]|[46]\\d|5[0-6]|7[0-35-9]|85|9[015-8])|7(?:[2579]\\d|3[03-68]|4[0-8]|6[5-9]|8[0-35-9])|8(?:[24][2-8]|3[2-5]|5[2-7]|6[2-589]|7[2-578]|[89][2-9])|9(?:0[57]|13|[25-7]\\d|[3489][0-8]))\\d{5}",[8,9]],["1(?:1888[689]|4400|8(?:47|8[27])[0-4])\\d{4}|1(?:0(?:[23568]\\d|4[0-6]|7[016-9]|9[0-8])|1(?:[1-5]\\d\\d|6(?:0[5-9]|[1-9]\\d)|7(?:[0-4]\\d|5[0-7]))|(?:[269]\\d|[37][1-9]|4[235-9])\\d|5(?:31|9\\d\\d)|8(?:1[23]|[236]\\d|4[06]|5(?:46|[7-9])|7[016-9]|8[01]|9[0-8]))\\d{5}",[9,10]],["1[378]00\\d{6}",[10]],["1600\\d{6}",[10]],0,0,0,0,["15(?:4(?:6[0-4]\\d|8(?:0[125]|[17]\\d|21|3[01]|4[01589]|5[014]|6[02]))|6(?:32[0-6]|78\\d))\\d{4}",[10]]]],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["2(?:[1346]\\d|5[0-2]|[78][12]|93)\\d{5}",[8]],["8[2-79]\\d{7}",[9]],["800\\d{6}",[9]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[["64426\\d{3}|6(?:1(?:2[2-7]|3[01378]|4[0-4])|254|32[0237]|4(?:27|41|5[25])|52[236-8]|626|7(?:2[2-4]|30))\\d{4,5}|6(?:1(?:(?:0\\d|2[0189]|3[24-69]|4[5-9])\\d|17|69|7[014])|2(?:17|5[0-36-8]|69|70)|3(?:17|2[14-689]|34|6[289]|7[01]|81)|4(?:17|2[0-2]|4[06]|5[0137]|69|7[01])|5(?:17|2[0459]|69|7[01])|6(?:17|25|38|42|69|7[01])|7(?:17|2[569]|3[13]|6[89]|7[01]))\\d{4}"],["(?:60|8[1245])\\d{7}",[9]],["80\\d{7}",[9]],["8701\\d{5}",[9]],0,0,0,0,["8(?:3\\d\\d|86)\\d{5}"]]],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]],0,0,0,0,0,0,[["(?:2[03-9]|3[0-5]|4[1-7]|88)\\d{4}"],["(?:[579]\\d|8[0-79])\\d{4}"],["050\\d{3}"],["36\\d{4}"]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]],0,0,0,0,0,0,[["2(?:0(?:20|3[1-8]|4[13-5]|5[14]|6[14578]|7[1-578])|1(?:4[145]|5[14]|6[14-68]|7[169]|88))\\d{4}"],["(?:23|7[0467]|[89]\\d)\\d{6}"],["08\\d{6}"],["09\\d{6}"]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1",0,0,[["(?:1(?:06|17|28|39)|3[0-2]\\d)\\d{3}"],["(?:14|3[58])\\d{4}"]]],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0",0,0,0,0,0,[["20(?:[1259]\\d|3[013-9]|4[1-8]|6[024-689]|7[1-79]|8[2-9])\\d{6}",[10]],["(?:702[0-24-9]|819[01])\\d{6}|(?:7(?:0[13-9]|[12]\\d)|8(?:0[1-9]|1[0-8])|9(?:0[1-9]|1[1-6]))\\d{7}",[10]],["800\\d{7,11}"],0,0,0,["700\\d{7,11}"]]],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]],0,0,0,0,0,0,[["2\\d{7}"],["(?:5(?:5[0-7]|[78]\\d)|6(?:20|3[035]|4[045]|5[05]|77|8[1-9]|9[059])|(?:7[5-8]|8\\d)\\d)\\d{5}"],["1800\\d{4}"]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:[035]\\d|1[13-578]|6[124-8]|7[24]|8[0-467])|2(?:[0346]\\d|2[2-46-9]|5[125]|9[479])|3(?:[03568]\\d|1[3-8]|2[01]|4[1-8])|4(?:[0356]\\d|1[1-368]|7[58]|8[15-8]|9[23579])|5(?:[0358]\\d|[19][1-9]|2[1-57-9]|4[13-8]|6[126]|7[0-3578])|7\\d\\d)\\d{6}",[9]],["(?:6[1-58]|970\\d)\\d{7}",[9,11]],["800\\d{4,7}",[7,8,9,10]],["90[069]\\d{4,7}",[7,8,9,10]],0,0,["140(?:1[035]|2[0346]|3[03568]|4[0356]|5[0358]|8[458])|(?:140(?:1[16-8]|2[259]|3[124]|4[17-9]|5[124679]|7)|8[478]\\d{6})\\d",[5,6,9]],["66\\d{7}",[9]],["(?:85|91)\\d{7}",[9]]]],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]",[["(?:2[1-4]|3[1-3578]|5[1-35-7]|6[1-4679]|7[0-8])\\d{6}",[8]],["(?:4[015-8]|9\\d)\\d{6}",[8]],["80[01]\\d{5}",[8]],["82[09]\\d{5}",[8]],["880\\d{5}",[8]],["81[23]\\d{5}",[8]],["(?:0[235-9]|81(?:0(?:0[7-9]|1\\d)|5\\d\\d))\\d{3}"],0,["85[0-5]\\d{5}",[8]],["810(?:0[0-6]|[2-8]\\d)\\d{3}",[8]]]],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0",0,0,0,0,0,[["(?:1[0-6]\\d|99[02-6])\\d{5}|(?:2[13-79]|3[135-8]|4[146-9]|5[135-7]|6[13-9]|7[15-9]|8[1-46-9]|9[1-7])[2-6]\\d{5}",[8]],["9(?:00|6[0-3]|7[0-24-6]|8[0-24-68])\\d{7}",[10]],["1(?:66001|800\\d\\d)\\d{5}",[11]]]],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]],0,0,0,0,0,0,[["444\\d{4}"],["(?:222|55[3-9]|666|777|8\\d\\d|999)\\d{4}"]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]],0,0,0,0,0,0,[["[47]\\d{3}",[4]],["(?:[56]|888[1-9])\\d{3}"]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,[["240\\d{5}|(?:3[2-79]|[49][2-9]|6[235-9]|7[2-57-9])\\d{6}",[8]],["2(?:[0-27-9]\\d|6)\\d{6,7}|2(?:1\\d|75)\\d{5}",[8,9,10]],["508\\d{6,7}|80\\d{6,8}",[8,9,10]],["(?:1[13-57-9]\\d{5}|50(?:0[08]|30|66|77|88))\\d{3}|90\\d{6,8}",[7,8,9,10]],["70\\d{7}",[9]],0,["8(?:1[16-9]|22|3\\d|4[045]|5[459]|6[235-9]|7[0-3579]|90)\\d{2,7}"]],"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]],0,0,0,0,0,0,[["2[1-6]\\d{6}",[8]],["1505\\d{4}|(?:7(?:[125-9]\\d|41)|9(?:0[1-9]|[1-9]\\d))\\d{5}",[8]],["8007\\d{4,5}|(?:500|800[05])\\d{4}"],["900\\d{5}",[8]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:1(?:0\\d|1[0479]|2[37]|3[0137]|4[17]|5[05]|6[058]|7[0167]|8[2358]|9[1389])|2(?:[0235-79]\\d|1[0-7]|4[013-9]|8[02-9])|3(?:[047-9]\\d|1[0-8]|2[0-5]|33|5[0-35]|6[068])|4(?:00|3[0-579]|4\\d|7[0-57-9])|5(?:[01]\\d|2[0-7]|[56]0|79)|7(?:0[09]|2[0-26-8]|3[03]|4[04]|5[05-9]|6[0156]|7[0-24-9]|8[4-9]|90)|8(?:09|2[89]|3\\d|4[0-24-689]|5[014]|8[02])|9(?:0[5-9]|1[0135-8]|2[036-9]|3[35-79]|40|5[0457-9]|6[05-9]|7[04-9]|8[35-8]|9\\d))\\d{4}",[7]],["(?:1[16]1|21[89]|6\\d{3}|8(?:1[01]|7[23]))\\d{4}",[7,8]],["800\\d{4,5}|(?:00800|800\\d)\\d{6}"],["(?:8(?:22|55|60|7[78]|86)|9(?:00|81))\\d{4}",[7]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,[["(?:(?:(?:4[34]|5[14])[0-8]|687)\\d|7(?:173|(?:3[0-8]|55)\\d)|8(?:10[05689]|6(?:0[06-9]|1[6-9]|29)|7(?:0[0569]|[56]0)))\\d{4}|(?:1[0-8]|4[12]|5[236]|6[1-7]|7[246]|8[2-4])\\d{6}",[8]],["9\\d{8}",[9]],["800\\d{5}",[8]],["805\\d{5}",[8]],["80[24]\\d{5}",[8]],0,0,0,0,["801\\d{5}",[8]]],"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]],0,0,0,0,0,0,[["4(?:0[4-689]|9[4-68])\\d{5}",[8]],["8[7-9]\\d{6}",[8]],["80[0-5]\\d{6}",[9]],0,0,0,["44\\d{4}",[6]],0,["499\\d{5}",[8]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,[["(?:(?:3[0-2]|4[257]|5[34]|9[78])\\d|64[1-9]|85[02-46-9])\\d{4}",[7]],["(?:7\\d|8[1-48])\\d{6}",[8]],["180\\d{4}",[7]],0,0,0,0,["27[01]\\d{4}",[7]],["2(?:0[0-57]|7[568])\\d{4}",[7]]],"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0",0,0,0,0,0,[["(?:(?:2[3-8]|3[2-68]|4[2-9]|5[2-6]|6[2-58]|7[24578])\\d{3}|88(?:22\\d\\d|42))\\d{4}|(?:2|8[2-8]\\d\\d)\\d{5}",[6,8,9,10]],["(?:8(?:1[37]|9[5-8])|9(?:0[5-9]|1[0-24-9]|[235-7]\\d|4[2-9]|8[135-9]|9[1-9]))\\d{7}",[10]],["1800\\d{7,9}",[11,12,13]]]],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0",0,0,0,0,0,[["(?:(?:21|42)[2-9]|58[126])\\d{7}|(?:2[25]|4[0146-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]\\d{6,7}|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8]))[2-9]\\d{5,6}",[9,10]],["3(?:[0-247]\\d|3[0-79]|55|64)\\d{7}",[10]],["800\\d{5}(?:\\d{3})?",[8,11]],["900\\d{5}",[8]],["122\\d{6}",[9]],0,["(?:2(?:[125]|3[2358]|4[2-4]|9[2-8])|4(?:[0-246-9]|5[3479])|5(?:[1-35-7]|4[2-467])|6(?:0[468]|[1-8])|7(?:[14]|2[236])|8(?:[16]|2[2-689]|3[23578]|4[3478]|5[2356])|9(?:1|22|3[27-9]|4[2-6]|6[3569]|9[2-7]))111\\d{6}",[11,12]]]],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["47\\d{7}|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])(?:[02-9]\\d{6}|1(?:[0-8]\\d{5}|9\\d{3}(?:\\d{2})?))",[7,9]],["2131[89]\\d{4}|21(?:1[013-5]|2\\d|3[2-9])\\d{5}|(?:45|5[0137]|6[069]|7[2389]|88)\\d{7}",[9]],["800\\d{6,7}",[9,10]],["70[01346-8]\\d{6}",[9]],0,0,["804\\d{6}",[9]],["64\\d{4,7}",[6,7,8,9]],["39\\d{7}",[9]],["801\\d{6}",[9]]]],PM:["508","00","[45]\\d{5}|(?:708|8\\d\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:4[1-35-9]|5[0-47-9]|80[6-9]\\d\\d)\\d{4}"],["(?:4[02-489]|5[02-9]|708(?:4[0-5]|5[0-6]))\\d{4}"],["80[0-5]\\d{6}",[9]],["8[129]\\d{7}",[9]]]],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939",[["(?:787|939)[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["(?:22[2-47-9]|42[45]|82[014-68]|92[3569])\\d{5}",[8]],["5[69]\\d{7}",[9]],["1800\\d{6}",[10]],0,0,0,0,0,0,["1700\\d{6}",[10]]]],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]],0,0,0,0,0,0,[["2(?:[12]\\d|3[1-689]|4[1-59]|[57][1-9]|6[1-35689]|8[1-69]|9[1256])\\d{6}"],["6(?:[06]92(?:30|9\\d)|[35]92(?:[049]\\d|3[034]))\\d{3}|(?:(?:16|6[0356])93|9(?:[1-36]\\d\\d|480))\\d{5}"],["80[02]\\d{6}"],["(?:6(?:0[178]|4[68])\\d|76(?:0[1-57]|1[2-47]|2[237]))\\d{5}"],["884[0-4689]\\d{5}"],["600\\d{6}|6[06]92(?:0\\d|3[349]|49)\\d{3}"],["70(?:38[01]|596|(?:7\\d|8[17])\\d)\\d{4}"],["6(?:222\\d|89(?:00|88|99))\\d{4}"],["30\\d{7}"],["80(?:8\\d|9[1579])\\d{5}"]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:55|77)|345|488|5(?:35|44|87)|6(?:22|54|79)|7(?:33|47)|8(?:24|55|76)|900)\\d{4}"],["(?:(?:46|83)[0-5]|(?:6[2-4689]|78)0)\\d{4}|(?:45|77|88)\\d{5}"]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,[["(?:[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36])\\d{5,7}|(?:2(?:2[4-68]|[4-68]\\d|7[15]|9[1-5])|3(?:18|3[167]|4[2357]|51|[67]\\d)|4(?:3[12]|5[13]|9[1-47])|5(?:[1-4]\\d|5[02-4])|6(?:3[1-3]|44|7[1-8])|7(?:4[0-4]|5\\d|6[1-578]|75|8[0-8])|858)\\d{5,6}",[7,8,9]],["9(?:51|6[129]|7[1-6]|8[1-7]|9[1-5])\\d{6}",[9]],["9800\\d{5,7}",[9,10,11]],0,0,0,["[2-9]0\\d{4,7}",[6,7,8,9]],0,["8700[0-4]\\d{4}",[9]]]],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]],0,0,0,0,0,0,[["4(?:1111|2022)\\d{3}|4(?:[04]\\d\\d|14[0-6]|999)\\d{4}",[8]],["[35-7]\\d{7}",[8]],["800\\d{4}|(?:0080[01]|800)\\d{6}",[7,9,11]],0,0,0,0,["2[136]\\d{5}",[7]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,[["[23][13-6]\\d{7}|(?:2(?:19\\d|[3-6]\\d9)|31\\d\\d)\\d\\d"],["(?:630|702)0\\d{5}|(?:6(?:00|2\\d)|7(?:0[013-9]|1[0-3]|[2-7]\\d|8[03-8]|9[0-39]))\\d{6}",[9]],["800\\d{6}",[9]],["90[0136]\\d{6}",[9]],0,0,["(?:37\\d|80[578])\\d{6}",[9]],0,0,["801\\d{6}",[9]]],0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0",0,0,0,0,0,[["(?:11[1-9]\\d|(?:2[389]|39)(?:0[2-9]|[2-9]\\d))\\d{3,8}|(?:1[02-9]|2[0-24-7]|3[0-8])[2-9]\\d{4,9}",[7,8,9,10,11,12]],["6(?:[0-689]|7\\d)\\d{6,7}",[8,9,10]],["800\\d{3,9}"],["(?:78\\d|90[0169])\\d{3,7}",[6,7,8,9,10]],0,0,["7[06]\\d{4,10}"]]],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,0,[["336(?:[013-9]\\d|2[013-9])\\d{5}|(?:3(?:0[12]|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15-7]|6[0-35-79]|7[1-37-9]))\\d{7}",[10]],["9\\d{9}",[10]],["8(?:0[04]|108\\d{3})\\d{7}"],["80[39]\\d{7}",[10]],["808\\d{7}",[10]]],"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:06|2[23568]\\d)\\d{6}"],["7[237-9]\\d{7}",[9]],["800\\d{6}",[9]],["900\\d{6}",[9]]]],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0",0,0,0,0,0,[["1(?:1\\d|2[24-8]|3[35-8]|4[3-68]|6[2-5]|7[235-7])\\d{6}",[9]],["579[01]\\d{5}|5(?:[013-689]\\d|7[0-8])\\d{6}",[9]],["800\\d{7}",[10]],["925\\d{6}",[9]],0,0,0,0,0,["920\\d{6}",[9]]]],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]],0,0,0,0,0,0,[["(?:1[4-79]|[23]\\d|4[0-2]|5[03]|6[0-37])\\d{3}",[5]],["48\\d{3}|(?:(?:6[89]|7[1-9]|8[4-9])\\d|9(?:1[2-9]|2[013-9]|3[0-2]|[46]\\d|5[0-46-9]|7[0-689]|8[0-79]|9[0-8]))\\d{4}"],["1[38]\\d{3}",[5]],0,0,0,0,0,["5[12]\\d{3}",[5]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,[["4[2-46]\\d{5}"],["2[125-8]\\d{5}"],["800[08]\\d{3}"],["85\\d{5}"],0,0,0,0,["971\\d{4}|(?:64|95)\\d{5}"]],"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0",0,0,0,0,0,[["1(?:5\\d|8[35-7])\\d{6}"],["(?:1[0-2]|9[0-3569])\\d{7}"]]],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0",0,0,0,0,0,[["(?:(?:[12][136]|3[356]|4[0246]|6[03]|8\\d)\\d|90[1-9])\\d{4,6}|(?:1(?:2[0-35]|4[0-4]|5[0-25-9]|7[13-6]|[89]\\d)|2(?:2[0-7]|4[0136-8]|5[0138]|7[018]|8[01]|9[0-57])|3(?:0[0-4]|1\\d|2[0-25]|4[056]|7[0-2]|8[0-3]|9[023])|4(?:1[013-8]|3[0135]|5[14-79]|7[0-246-9]|8[0156]|9[0-689])|5(?:0[0-6]|[15][0-5]|2[0-68]|3[0-4]|4\\d|6[03-5]|7[013]|8[0-79]|9[01])|6(?:1[1-3]|2[0-4]|4[02-57]|5[0-37]|6[0-3]|7[0-2]|8[0247]|9[0-356])|9(?:1[0-68]|2\\d|3[02-5]|4[0-3]|5[0-4]|[68][01]|7[0135-8]))\\d{5,6}",[7,8,9]],["7[02369]\\d{7}",[9]],["20\\d{4,7}",[6,7,8,9]],["649\\d{6}|99[1-59]\\d{4}(?:\\d{3})?|9(?:00|39|44)[1-8]\\d{3,6}",[7,8,9,10]],["75[1-8]\\d{6}",[9]],["(?:25[245]|67[3-68])\\d{9}",[12]],["10[1-8]\\d{6}",[9]],["74[02-9]\\d{6}",[9]],0,["77[0-7]\\d{6}",[9]]]],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[["662[0-24-9]\\d{4}|6(?:[0-578]\\d|6[013-57-9]|9[0-35-9])\\d{5}",[8]],["898[02-8]\\d{4}|(?:8(?:0[1-9]|[1-8]\\d|9[0-7])|9[0-8]\\d)\\d{5}",[8]],["(?:18|8)00\\d{7}",[10,11]],["1900\\d{7}",[11]],0,0,["7000\\d{7}",[11]],0,["(?:3[12]\\d|666)\\d{5}",[8]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]",[["2(?:[0-57-9]\\d|6[4-9])\\d\\d"],["[56]\\d{4}",[5]],0,0,0,0,0,0,["262\\d\\d",[5]]]],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,[["(?:[1-357][2-8]|4[24-8])\\d{6}",[8]],["65(?:[178]\\d|5[56]|6[01])\\d{4}|(?:[37][01]|4[0139]|51|6[489])\\d{6}",[8]],["80\\d{4,6}",[6,7,8]],["89[1-3]\\d{2,5}|90\\d{4,6}"],0,0,0,0,["(?:59\\d\\d|8(?:1(?:[67]\\d|8[0-589])|2(?:0\\d|2[0-37-9]|8[0-2489])|3[389]\\d))\\d{4}",[8]]],"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79",[["79\\d{6}",[8]],["(?:4[015-8]|9\\d)\\d{6}",[8]],["80[01]\\d{5}",[8]],["82[09]\\d{5}",[8]],["880\\d{5}",[8]],["81[23]\\d{5}",[8]],["(?:0[235-9]|81(?:0(?:0[7-9]|1\\d)|5\\d\\d))\\d{3}"],0,["85[0-5]\\d{5}",[8]],["810(?:0[0-6]|[2-8]\\d)\\d{3}",[8]]]],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:16|[2-9]\\d{3})|(?:(?:[3-5][1-8]\\d|819)\\d|601[1-5])\\d)\\d{4}|(?:2|[3-5][1-8])1[67]\\d{3}|[3-5][1-8]16\\d\\d"],["909[1-9]\\d{5}|9(?:0[1-8]|1[0-24-9]|4[03-57-9]|5\\d)\\d{6}",[9]],["800\\d{6}",[9]],["9(?:00|[78]\\d)\\d{6}",[9]],0,0,["96\\d{7}",[9]],["9090\\d{3}",[7]],["6(?:02|5[0-4]|9[0-6])\\d{6}",[9]],["8[5-9]\\d{7}",[9]]]],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0",0,0,0,0,0,[["22[2-4][2-9]\\d{4}"],["(?:25|3[0-5]|66|7[1-9]|8[08]|9[09])\\d{6}"]]],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1",0,0,[["0549(?:8[0157-9]|9\\d)\\d{4}",[10]],["6[16]\\d{6}",[8]],0,["7[178]\\d{6}",[8]],0,0,0,0,["5[158]\\d{6}",[8]]]],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]],0,0,0,0,0,0,[["3(?:0(?:1[0-2]|80)|282|3(?:8[1-9]|9[3-9])|611)\\d{5}"],["7(?:(?:[06-8]\\d|[19]0|21)\\d|5(?:0[01]|[19]0|2[25]|3[356]|[4-7]\\d|8[35]))\\d{5}"],["800\\d{6}"],["88[4689]\\d{6}"],0,0,0,0,["(?:3(?:392|9[01]\\d)\\d|93(?:3[13]0|929))\\d{4}"],["81[02468]\\d{6}"]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0",0,0,0,0,0,[["(?:1\\d|2[0-79]|3[0-46-8]|4[0-7]|5[57-9])\\d{5}|(?:[134]\\d|8[125])\\d{4}",[6,7]],["(?:(?:15|(?:3[59]|4[89]|6\\d|7[679]|8[08])\\d|9(?:0\\d|[2-9]))\\d|2(?:4\\d|8))\\d{5}|(?:[67]\\d\\d|904)\\d{5}",[7,8,9]]]],SR:["597","00","(?:[2-5]|[6-8]\\d|90)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]],0,0,0,0,0,0,[["(?:2[1-3]|3[0-7]|4\\d|5[2-58])\\d{4}",[6]],["(?:6[08]|7[124-7]|8[1-9])\\d{5}",[7]],["80\\d{5}",[7]],["90\\d{5}",[7]],0,0,0,0,["56\\d{4}",[6]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0",0,0,0,0,0,[["1[89]\\d{7}"],["(?:12|9[1257-9])\\d{7}"]]],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]],0,0,0,0,0,0,[["22\\d{5}"],["900[5-9]\\d{3}|9(?:0[1-9]|[89]\\d)\\d{4}"]]],SV:["503","00","[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,[["2(?:79(?:0[0347-9]|[1-9]\\d)|89(?:0[024589]|[1-9]\\d))\\d{3}|2(?:[1-69]\\d|[78][0-8])\\d{5}",[8]],["[67]\\d{7}",[8]],["800\\d{8}|80[01]\\d{4}",[7,11]],["900\\d{4}(?:\\d{4})?",[7,11]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721",[["7215(?:4[2-8]|8[239]|9[056])\\d{4}"],["7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0",0,0,0,0,0,[["21\\d{6,7}|(?:1(?:[14]\\d|[2356])|2[235]|3(?:[13]\\d|4)|4[134]|5[1-3])\\d{6}"],["(?:50|9[1-9])\\d{7}",[9]]]],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]],0,0,0,0,0,0,[["[23][2-5]\\d{6}",[8]],["7[5-9]\\d{6}",[8]],["0800\\d{4}",[8]],["900\\d{6}",[9]],0,0,0,0,["70\\d{6}",[8]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8",[["8\\d{3}"]]],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649",[["649(?:266|712|9(?:4\\d|50))\\d{4}"],["649(?:2(?:3[129]|4[1-79])|3\\d\\d|4[34][1-3])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["649(?:71[01]|966)\\d{4}"]]],TD:["235","00|16","(?:22|30|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,[["22(?:[37-9]0|5[0-5]|6[89])\\d{4}"],["(?:30|[69]\\d|77|8[56])\\d{6}"]],"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]],0,0,0,0,0,0,[["2(?:2[2-7]|3[23]|4[45]|55|6[67]|77)\\d{5}"],["(?:7[0-29]|9[0-36-9])\\d{6}"]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["(?:1[0689]|2\\d|3[2-9]|4[2-5]|5[2-6]|7[3-7])\\d{6}",[8]],["67(?:1[0-8]|2[4-7])\\d{5}|(?:14|6[1-6]|[89]\\d)\\d{7}",[9]],["(?:001800\\d|1800)\\d{6}",[10,13]],["1900\\d{6}",[10]],0,0,0,0,["6[08]\\d{7}",[9]]]],TJ:["992","810","[0-57-9]\\d{8}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,[["(?:3(?:1[3-5]|2[245]|3[12]|4[24-7]|5[25]|72)|4(?:46|74|87))\\d{6}"],["(?:33[03-9]|4(?:1[18]|4[02-479])|81[1-9])\\d{6}|(?:[09]\\d|1[0-27-9]|2[0-27]|[34]0|5[05]|7[01578]|8[078])\\d{7}"]],"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7],0,0,0,0,0,0,0,[["(?:2[2-4]|[34]\\d)\\d{2,5}"],["7[2-4]\\d{2,5}"]]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]],0,0,0,0,0,0,[["(?:2[1-5]|3[1-9]|4[1-4])\\d{5}",[7]],["7[2-8]\\d{6}",[8]],["80\\d{5}",[7]],["90\\d{5}",[7]],["70\\d{5}",[7]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,[["(?:1(?:2\\d|3[1-9])|2(?:22|4[0-35-8])|3(?:22|4[03-9])|4(?:22|3[128]|4\\d|6[15])|5(?:22|5[7-9]|6[014-689]))\\d{5}"],["(?:6\\d|71)\\d{6}"]],"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]],0,0,0,0,0,0,[["81200\\d{3}|(?:3[0-2]|7\\d)\\d{6}"],["3(?:001|[12]40)\\d{4}|(?:(?:[259]\\d|4[0-8])\\d|3(?:1[1-35]|6[0-4]|91))\\d{5}"],["8010\\d{4}"],["88\\d{6}"],0,0,0,0,0,["8[12]10\\d{4}"]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]],0,0,0,0,0,0,[["(?:2\\d|3[0-8]|4[0-4]|50|6[09]|7[0-24-69]|8[05])\\d{3}",[5]],["(?:5(?:4[0-5]|5[4-6])|6(?:[09]\\d|3[02]|8[15-9])|(?:7\\d|8[46-9])\\d|999)\\d{4}",[7]],["0800\\d{3}",[7]],0,0,0,0,0,["55[0-37-9]\\d{4}",[7]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0",0,0,0,0,0,[["(?:2(?:[13][26]|[28][2468]|[45][268]|[67][246])|3(?:[13][28]|[24-6][2468]|[78][02468]|92)|4(?:[16][246]|[23578][2468]|4[26]))\\d{7}",[10]],["561(?:011|61\\d)\\d{4}|5(?:0[15-7]|1[06]|24|[34]\\d|5[1-59]|9[46])\\d{7}",[10]],["8(?:00\\d{7}(?:\\d{2,3})?|11\\d{7})",[10,12,13]],["(?:8[89]8|900)\\d{7}",[10]],["592(?:21[12]|461)\\d{4}",[10]],0,["444\\d{4}",[7]],["512\\d{7}",[10]],["850\\d{7}",[10]]]],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868",[["868(?:2(?:01|1[5-9]|[23]\\d|4[0-2])|6(?:0[7-9]|1[02-8]|2[1-9]|[3-69]\\d|7[0-79])|82[124])\\d{4}"],["868(?:(?:2[5-9]|3\\d)\\d|4(?:3[0-6]|[6-9]\\d)|6(?:20|78|8\\d)|7(?:0[1-9]|1[02-9]|[2-9]\\d))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],["868619\\d{4}"]]],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]],0,0,0,0,0,0,[["2[02-9]\\d{3}",[5]],["(?:7[01]\\d|90)\\d{4}",[6,7]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["(?:2[2-8]\\d|370|55[01]|7[1-9])\\d{6}|4(?:(?:0(?:0[1-9]|[2-48]\\d)|1[023]\\d)\\d{4,5}|(?:[239]\\d\\d|4(?:0[56]|12|49))\\d{5})|6(?:[01]\\d{7}|4(?:0[56]|12|24|4[09])\\d{4,5})|8(?:(?:2(?:3\\d|4[0-269]|[578]0|66)|36[24-9]|90\\d\\d)\\d{4}|4(?:0[56]|12|24|4[09])\\d{4,5})|(?:2(?:2(?:0\\d\\d|4(?:0[68]|[249]0|3[0-467]|5[0-25-9]|6[0235689]))|(?:3(?:[09]\\d|1[0-4])|(?:4\\d|5[0-49]|6[0-29]|7[0-5])\\d)\\d)|(?:(?:3[2-9]|5[2-8]|6[0-35-79]|8[7-9])\\d\\d|4(?:2(?:[089]\\d|7[1-9])|(?:3[0-4]|[78]\\d|9[01])\\d))\\d)\\d{3}",[8,9]],["(?:40001[0-2]|9[0-8]\\d{4})\\d{3}",[9]],["80[0-79]\\d{6}|800\\d{5}",[8,9]],["20(?:[013-9]\\d\\d|2)\\d{4}",[7,9]],["99\\d{7}",[9]],0,["50[0-46-9]\\d{6}",[9]],0,["7010(?:[0-2679]\\d|3[0-7]|8[0-5])\\d{5}|70\\d{8}",[10,11]]],0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0",0,0,0,0,0,[["2[2-8]\\d{7}"],["(?:6[125-9]|7[13-9])\\d{7}"],["80[08]\\d{6}"],["90\\d{7}"],0,0,0,0,["41\\d{7}"],["8(?:40|6[01])\\d{6}"]]],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,[["(?:3[1-8]|4[13-8]|5[1-7]|6[12459])\\d{7}",[9]],["790\\d{6}|(?:39|50|6[36-8]|7[1-357]|9[1-9])\\d{7}",[9]],["800[1-8]\\d{5,6}"],["900[239]\\d{5,6}"],0,0,0,0,["89[1-579]\\d{6}",[9]]],"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0",0,0,0,0,0,[["20(?:(?:240|30[67])\\d|6(?:00[0-2]|30[0-4]))\\d{3}|(?:20(?:[017]\\d|2[5-9]|3[1-4]|5[0-4]|6[15-9])|[34]\\d{3})\\d{5}"],["72[48]0\\d{5}|7(?:[014-8]\\d|2[067]|36|9[0-289])\\d{6}"],["800[1-3]\\d{5}"],["90[1-3]\\d{6}"]]],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["3052(?:0[0-8]|[1-9]\\d)\\d{4}|(?:2742|305[3-9])\\d{6}|(?:472|983)[2-47-9]\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[0135-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["305209\\d{4}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,[["(?:1(?:770|9(?:20|[89]7))|(?:2\\d|4[2-7])\\d\\d)\\d{4}",[8]],["9[1-9]\\d{6}",[8]],["0004\\d{2,9}|(?:405|80[05])\\d{4}",[6,7,8,9,10,11,12,13]],["90[0-8]\\d{4}",[7]],0,0,["21\\d{2,3}",[4,5]]],"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]],0,0,0,0,0,0,[["(?:55\\d\\d|6(?:1(?:22|3[124]|4[1-4]|5[1-3578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|[69]\\d\\d|7(?:[23]\\d|7[69]))|7(?:0(?:5[4-9]|6[0146]|7[124-6]|9[135-8])|[168]\\d\\d|2(?:22|3[13-57-9]|4[1-3579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|9(?:22|5[1-9])))\\d{5}"],["(?:(?:[25]0|33|8[78]|9[0-57-9])\\d{3}|6(?:1(?:2(?:2[01]|98)|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:(?:11|7\\d)\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4]))|5(?:19[01]|2(?:27|9[26])|(?:30|59|7\\d)\\d)|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|(?:3[79]|9[0-3])\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79]))|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079])))|7(?:[07]\\d{3}|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|(?:33|9[4-6])\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078]))|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0-27]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[02569]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07]))))\\d{4}"]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698",[["06698\\d{1,6}",[6,7,8,9,10,11]],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784",[["784(?:266|3(?:6[6-9]|7\\d|8[0-6])|4(?:38|5[0-36-8]|8[0-8])|5(?:55|7[0-2]|93)|638|784)\\d{4}"],["784(?:4(?:3[0-5]|5[45]|89|9[0-8])|5(?:2[6-9]|3[0-4])|720)\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["78451[0-2]\\d{4}"]]],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:12|3[457-9]|[467]\\d|[58][1-9]|9[1-6])|[4-6]00)\\d{7}"],["4(?:1[24-8]|2[246])\\d{7}"],["800\\d{7}"],["90[01]\\d{7}"],0,0,["501\\d{7}"]]],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284",[["284(?:229|4(?:22|9[45])|774|8(?:52|6[459]))\\d{4}"],["284(?:245|3(?:0[0-3]|4[0-7]|68|9[34])|4(?:4[0-6]|68|9[69])|5(?:4[0-7]|68|9[69]))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340",[["340(?:2(?:0\\d|10|2[06-8]|4[49]|77)|3(?:32|44)|4(?:2[23]|44|7[34]|89)|5(?:1[34]|55)|6(?:2[56]|4[23]|77|9[023])|7(?:1[2-57-9]|2[57]|7\\d)|884|998)\\d{4}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0",0,0,0,0,0,[["2(?:0[3-9]|1[0-689]|2[0-25-9]|[38][2-9]|4[2-8]|5[124-9]|6[0-39]|7[0-7]|9[0-4679])\\d{7}",[10]],["(?:5(?:2[238]|59)|89[6-9]|99[013-9])\\d{6}|(?:3\\d|5[1689]|7[06-9]|8[1-8]|9[0-8])\\d{7}",[9]],["1800\\d{4,6}|12(?:0[13]|28)\\d{4}",[8,9,10]],["1900\\d{4,6}",[8,9,10]],0,0,["(?:[17]99|80\\d)\\d{4}|69\\d{5,6}",[7,8]],0,["672\\d{6}",[9]]]],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]],0,0,0,0,0,0,[["(?:38[0-8]|48[4-9])\\d\\d|(?:2[02-9]|3[4-7]|88)\\d{3}",[5]],["(?:[58]\\d|7[013-7])\\d{5}",[7]],["81[18]\\d\\d",[5]],0,0,0,["(?:3[03]|900\\d)\\d{3}"],0,["9(?:0[1-9]|1[01])\\d{4}",[7]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]],0,0,0,0,0,0,[["72\\d{4}",[6]],["(?:72|8[23])\\d{4}",[6]],["80[0-5]\\d{6}",[9]],0,0,["[48]0\\d{4}",[6]],0,0,["9[23]\\d{4}",[6]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]],0,0,0,0,0,0,[["6[1-9]\\d{3}|(?:[2-5]|60)\\d{4}",[5,6]],["(?:7[1-35-8]|8(?:[3-7]|9\\d{3}))\\d{5}",[7,10]],["800\\d{3}",[6]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0",0,0,0,0,0,[["38\\d{6,10}|(?:2[89]|39)(?:0\\d{5,6}|[1-9]\\d{5})"],["4[3-9]\\d{6}",[8]],["800\\d{5}",[8]],["900\\d{5}",[8]]]],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["78[0-7]\\d{4}|17\\d{6}|(?:[12][2-68]|3[2358]|4[2-58]|5[2-6]|6[3-58]|7[24-6])\\d{5}",[7,8]],["7[01378]\\d{7}",[9]]]],YT:["262","00","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:0330|4302)|52087)0\\d{3}|(?:1[0-8]|2[1-378]|3[1-69]|4\\d|5[1346-8])\\d{7}",[9]],["(?:1(?:3492[0-25]|4495[0235]|549(?:20|5[01]))|4[34]492[01])\\d{3}|8[1-4]\\d{3,7}|(?:2[27]|47|54)4950\\d{3}|(?:1(?:049[2-4]|9[12]\\d\\d)|(?:50[0-2]|6\\d\\d|7(?:[0-46-9]\\d|5[0-4]))\\d\\d|8(?:5\\d{3}|7(?:08[67]|158|28[5-9]|310)))\\d{4}|(?:1[6-8]|28|3[2-69]|4[025689]|5[36-8])4920\\d{3}|(?:12|[2-5]1)492\\d{4}",[5,6,7,8,9]],["80\\d{7}",[9]],["(?:86[2-9]|9[0-2]\\d)\\d{6}",[9]],0,0,["861\\d{6,7}",[9,10]],0,["87(?:08[0-589]|15[0-79]|28[0-4]|31[1-9])\\d{4}|87(?:[02][0-79]|1[0-46-9]|3[02-9]|[4-9]\\d)\\d{5}",[9]],["860\\d{6}",[9]]]],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0",0,0,0,0,0,[["21[1-8]\\d{6}"],["(?:[59][5-8]|7[5-9])\\d{7}"],["800\\d{6}"],0,0,0,0,0,["63\\d{7}"]]],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:(?:3\\d|9)\\d|[4-8])|2(?:(?:(?:0(?:2[014]|5)|(?:2[0157]|31|84|9)\\d\\d|[56](?:[14]\\d\\d|20)|7(?:[089]|2[03]|[35]\\d\\d))\\d|4(?:2\\d\\d|8))\\d|1(?:2|[39]\\d{4}))|3(?:(?:123|(?:29\\d|92)\\d)\\d\\d|7(?:[19]|[56]\\d))|5(?:0|1[2-478]|26|[37]2|4(?:2\\d{3}|83)|5(?:25\\d\\d|[78])|[689]\\d)|6(?:(?:[16-8]21|28|52[013])\\d\\d|[39])|8(?:[1349]28|523)\\d\\d)\\d{3}|(?:4\\d\\d|9[2-9])\\d{4,5}|(?:(?:2(?:(?:(?:0|8[146])\\d|7[1-7])\\d|2(?:[278]\\d|92)|58(?:2\\d|3))|3(?:[26]|9\\d{3})|5(?:4\\d|5)\\d\\d)\\d|6(?:(?:(?:[0-246]|[78]\\d)\\d|37)\\d|5[2-8]))\\d\\d|(?:2(?:[569]\\d|8[2-57-9])|3(?:[013-59]\\d|8[37])|6[89]8)\\d{3}"],["7(?:[1278]\\d|3[1-9])\\d{6}",[9]],["80(?:[01]\\d|20|8[0-8])\\d{3}",[7]],0,0,0,0,0,["86(?:1[12]|22|30|44|55|77|8[368])\\d{6}",[10]]]]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function fm(e,t){e=e.split("-"),t=t.split("-");for(var n=e[0].split("."),r=t[0].split("."),i=0;i<3;i++){var o=Number(n[i]),a=Number(r[i]);if(o>a)return 1;if(a>o)return-1;if(!isNaN(o)&&isNaN(a))return 1;if(isNaN(o)&&!isNaN(a))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}var hm={}.constructor;function pm(e){return null!=e&&e.constructor===hm}function mm(e){return(mm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $m(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,vm(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vm(e){var t=function(e,t){if("object"!=mm(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=mm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==mm(t)?t:t+""}var ym=" ext. ",bm=/^\d+$/,xm=function(){return $m(function e(t){gm(this,e),Nm(t),this.metadata=t,Om.call(this,t)},[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(e){return"001"!==e})}},{key:"getCountryMetadata",value:function(e){return this.metadata.countries[e]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(e){return void 0!==this.getCountryMetadata(e)}},{key:"hasCallingCode",value:function(e){if(this.getCountryCodesForCallingCode(e))return!0;if(this.nonGeographic()){if(this.nonGeographic()[e])return!0}else{var t=this.countryCallingCodes()[e];if(t&&1===t.length&&"001"===t[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(e){return this.nonGeographic()?!!this.nonGeographic()[e]:!this.getCountryCodesForCallingCode(e)}},{key:"country",value:function(e){return this.selectNumberingPlan(e)}},{key:"selectNumberingPlan",value:function(e,t){if(e&&bm.test(e)&&(t=e,e=null),e&&"001"!==e){if(!this.hasCountry(e))throw new Error("Unknown country: ".concat(e));this.numberingPlan=new wm(this.getCountryMetadata(e),this)}else if(t){if(!this.hasCallingCode(t))throw new Error("Unknown calling code: ".concat(t));this.numberingPlan=new wm(this.getNumberingPlanMetadata(t),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(e){var t=this.countryCallingCodes()[e];if(t){if(1===t.length&&3===t[0].length)return;return t}}},{key:"getCountryCodeForCallingCode",value:function(e){var t=this.getCountryCodesForCallingCode(e);if(t)return t[0]}},{key:"getNumberingPlanMetadata",value:function(e){var t=this.getCountryCodeForCallingCode(e);if(t)return this.getCountryMetadata(t);if(this.nonGeographic()){var n=this.nonGeographic()[e];if(n)return n}else{var r=this.countryCallingCodes()[e];if(r&&1===r.length&&"001"===r[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(e){return this.numberingPlan.type(e)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(e){return this.selectNumberingPlan(e)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}])}(),wm=function(){return $m(function e(t,n){gm(this,e),this.globalMetadataObject=n,this.metadata=t,Om.call(this,n.metadata)},[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(e){return e[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var e=this;return(this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[]).map(function(t){return new _m(t,e)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(e){return e[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return(!this.types()||0!==this.types().length)&&!!this.types()}},{key:"type",value:function(e){if(this.hasTypes()&&Em(this.types(),e))return new Sm(Em(this.types(),e),this)}},{key:"ext",value:function(){return this.v1||this.v2?ym:this.metadata[13]||ym}}])}(),_m=function(){return $m(function e(t,n){gm(this,e),this._format=t,this.metadata=n},[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||Cm.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])}(),Cm=/^\(?\$1\)?$/,Sm=function(){return $m(function e(t,n){gm(this,e),this.type=t,this.metadata=n},[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])}();function Em(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}function Nm(e){if(!e)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!pm(e)||!pm(e.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(pm(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+Tm(e)+": "+e,"."))}var Tm=function(e){return mm(e)};function Am(e,t){if((t=new xm(t)).hasCountry(e))return t.selectNumberingPlan(e).countryCallingCode();throw new Error("Unknown country: ".concat(e))}function Om(e){var t=e.version;"number"==typeof t?(this.v1=1===t,this.v2=2===t,this.v3=3===t,this.v4=4===t):t?-1===fm(t,"1.2.0")?this.v2=!0:-1===fm(t,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}function Im(e,t,n){return function(e,t,n,r){t&&(r=new xm(r.metadata)).selectNumberingPlan(t);var i=r.type(n),o=i&&i.possibleLengths()||r.possibleLengths();if(!o)return"IS_POSSIBLE";var a=e.length,s=o[0];if(s===a)return"IS_POSSIBLE";if(s>a)return"TOO_SHORT";if(o[o.length-1]<a)return"TOO_LONG";return o.indexOf(a,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}(e,t,void 0,n)}function km(e,t,n){return"IS_POSSIBLE"===Im(e,t,n)}function jm(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}function Rm(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Pm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pm(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Pm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Dm=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function Lm(e,t,n){if(t=t||{},e.country||e.countryCallingCode){(n=new xm(n)).selectNumberingPlan(e.country,e.countryCallingCode);var r=t.v2?e.nationalNumber:e.phone;if(jm(r,n.nationalNumberPattern())){if(Mm(r,"FIXED_LINE",n))return n.type("MOBILE")&&""===n.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":n.type("MOBILE")?Mm(r,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var i,o=Rm(Dm);!(i=o()).done;){var a=i.value;if(Mm(r,a,n))return a}}}}function Mm(e,t,n){return!(!(t=n.type(t))||!t.pattern())&&(!(t.possibleLengths()&&t.possibleLengths().indexOf(e.length)<0)&&jm(e,t.pattern()))}function Um(e,t,n){var r=new xm(n).getCountryCodesForCallingCode(e);return r?r.filter(function(e){return function(e,t,n){var r=new xm(n);if(r.selectNumberingPlan(t),r.numberingPlan.possibleLengths().indexOf(e.length)>=0)return!0;return!1}(t,e,n)}):[]}var Fm="0-90-9٠-٩۰-۹",Bm="".concat("-‐-―−ー-").concat("//").concat("..").concat("  ­​⁠ ").concat("()()[]\\[\\]").concat("~⁓∼~"),qm=new RegExp("(["+Fm+"])");function zm(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Hm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hm(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Hm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Wm(e,t){var n=t.nationalNumber,r=t.metadata,i=r.getCountryCodesForCallingCode(e);if(i)return 1===i.length?i[0]:function(e,t){var n=t.countries,r=t.metadata;r=new xm(r);for(var i,o=zm(n);!(i=o()).done;){var a=i.value;if(r.selectNumberingPlan(a),r.leadingDigits()){if(e&&0===e.search(r.leadingDigits()))return a}else if(Lm({phone:e,country:a},void 0,r.metadata))return a}}(n,{countries:i,metadata:r.metadata})}function Gm(e,t,n){var r=function(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(e);if(r){var i,o,a,s=r.length-1,d=s>0&&r[s];if(t.nationalPrefixTransformRule()&&d)i=e.replace(n,t.nationalPrefixTransformRule()),s>1&&(o=r[1]);else{var l=r[0];i=e.slice(l.length),d&&(o=r[1])}if(d){var u=e.indexOf(r[1]);e.slice(0,u)===t.numberingPlan.nationalPrefix()&&(a=t.numberingPlan.nationalPrefix())}else a=r[0];return{nationalNumber:i,nationalPrefix:a,carrierCode:o}}}return{nationalNumber:e}}(e,n),i=r.carrierCode,o=r.nationalNumber;if(o!==e){if(!function(e,t,n){if(jm(e,n.nationalNumberPattern())&&!jm(t,n.nationalNumberPattern()))return!1;return!0}(e,o,n))return{nationalNumber:e};if(n.numberingPlan.possibleLengths()&&(t||(t=Wm(n.numberingPlan.callingCode(),{nationalNumber:o,metadata:n})),!function(e,t,n){switch(Im(e,t,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(o,t,n)))return{nationalNumber:e}}return{nationalNumber:o,carrierCode:i}}function Vm(e,t,n,r,i){if(!e)return{};var o;if("+"!==e[0]){var a=function(e,t,n,r){if(t){var i=new xm(r);i.selectNumberingPlan(t,n);var o=new RegExp(i.IDDPrefix());if(0===e.search(o)){var a=(e=e.slice(e.match(o)[0].length)).match(qm);if(!(a&&null!=a[1]&&a[1].length>0&&"0"===a[1]))return e}}}(e,n,r,i);if(!a||a===e){if(n||r){var s=function(e,t,n,r,i){var o=n?Am(n,i):r;if(0===e.indexOf(o)){(i=new xm(i)).selectNumberingPlan(n,o);var a=e.slice(o.length),s=Gm(a,t,i).nationalNumber,d=Gm(e,t,i).nationalNumber;if(!jm(d,i.nationalNumberPattern())&&jm(s,i.nationalNumberPattern())||"TOO_LONG"===Im(d,t,i))return{countryCallingCode:o,number:a}}return{number:e}}(e,t,n,r,i),d=s.countryCallingCode,l=s.number;if(d)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:d,number:l}}return{number:e}}o=!0,e="+"+a}if("0"===e[1])return{};i=new xm(i);for(var u=2;u-1<=3&&u<=e.length;){var c=e.slice(1,u);if(i.hasCallingCode(c))return i.selectNumberingPlan(c),{countryCallingCodeSource:o?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:c,number:e.slice(u)};u++}return{}}var Km=/(\$\d)/;function Ym(e,t,n){var r=n.useInternationalFormat,i=n.withNationalPrefix,o=e.replace(new RegExp(t.pattern()),r?t.internationalFormat():i&&t.nationalPrefixFormattingRule()?t.format().replace(Km,t.nationalPrefixFormattingRule()):t.format());return r?function(e){return e.replace(new RegExp("[".concat(Bm,"]+"),"g")," ").trim()}(o):o}var Xm=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;var Jm=function(e){return"([".concat(Fm,"]{1,").concat(e,"})")};function Zm(e){var t="[  \\t,]*",n="[:\\..]?[  \\t,-]*",r="#?",i="[  \\t]*";return";ext="+Jm("20")+"|"+(t+"(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)"+n+Jm("20")+r)+"|"+(t+"(?:[xx##~~]|int|int)"+n+Jm("9")+r)+"|"+("[- ]+"+Jm("6")+"#")+"|"+(i+"(?:,{2}|;)"+n+Jm("15")+r)+"|"+(i+"(?:,)+"+n+Jm("9")+r)}var Qm="["+Fm+"]{2}",eg="[++]{0,1}(?:["+Bm+"]*["+Fm+"]){3,}["+Bm+Fm+"]*",tg=new RegExp("^[++]{0,1}(?:["+Bm+"]*["+Fm+"]){1,2}$","i"),ng=eg+"(?:"+Zm()+")?",rg=new RegExp("^"+Qm+"$|^"+ng+"$","i");var ig={formatExtension:function(e,t,n){return"".concat(e).concat(n.ext()).concat(t)}};function og(e,t,n,r){if(n=n?function(){for(var e=1,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(;e<n.length;){if(n[e])for(var i in n[e])n[0][i]=n[e][i];e++}return n[0]}({},ig,n):ig,r=new xm(r),e.country&&"001"!==e.country){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)return e.phone||"";r.selectNumberingPlan(e.countryCallingCode)}var i,o=r.countryCallingCode(),a=n.v2?e.nationalNumber:e.phone;switch(t){case"NATIONAL":return a?sg(i=ag(a,e.carrierCode,"NATIONAL",r,n),e.ext,r,n.formatExtension):"";case"INTERNATIONAL":return a?(i=ag(a,null,"INTERNATIONAL",r,n),sg(i="+".concat(o," ").concat(i),e.ext,r,n.formatExtension)):"+".concat(o);case"E.164":return"+".concat(o).concat(a);case"RFC3966":return function(e){var t=e.number,n=e.ext;if(!t)return"";if("+"!==t[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(n?";ext="+n:"")}({number:"+".concat(o).concat(a),ext:e.ext});case"IDD":if(!n.fromCountry)return;var s=function(e,t,n,r,i){var o=Am(r,i.metadata);if(o===n){var a=ag(e,t,"NATIONAL",i);return"1"===n?n+" "+a:a}var s=function(e,t,n){var r=new xm(n);return r.selectNumberingPlan(e,t),r.defaultIDDPrefix()?r.defaultIDDPrefix():Xm.test(r.IDDPrefix())?r.IDDPrefix():void 0}(r,void 0,i.metadata);if(s)return"".concat(s," ").concat(n," ").concat(ag(e,null,"INTERNATIONAL",i))}(a,e.carrierCode,o,n.fromCountry,r);return sg(s,e.ext,r,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function ag(e,t,n,r,i){var o,a,s=(o=r.formats(),a=e,function(e,t){for(var n=0;n<e.length;){if(t(e[n]))return e[n];n++}}(o,function(e){if(e.leadingDigitsPatterns().length>0){var t=e.leadingDigitsPatterns()[e.leadingDigitsPatterns().length-1];if(0!==a.search(t))return!1}return jm(a,e.pattern())}));return s?Ym(e,s,{useInternationalFormat:"INTERNATIONAL"===n,withNationalPrefix:!s.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!i||!1!==i.nationalPrefix}):e}function sg(e,t,n,r){return t?r(e,t,n):e}function dg(e){return(dg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ug(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lg(Object(n),!0).forEach(function(t){cg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cg(e,t,n){return(t=hg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fg(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hg(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function hg(e){var t=function(e,t){if("object"!=dg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=dg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==dg(t)?t:t+""}var pg=function(){return fg(function e(t,n,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new TypeError("First argument is required");if("string"!=typeof t)throw new TypeError("First argument must be a string");if("+"===t[0]&&!n)throw new TypeError("`metadata` argument not passed");if(pm(n)&&pm(n.countries)){r=n;var i=t;if(!gg.test(i))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var o=Vm(i,void 0,void 0,void 0,r);if(t=o.countryCallingCode,!(n=o.number))throw new Error("Invalid `number` argument passed: too short")}if(!n)throw new TypeError("`nationalNumber` argument is required");if("string"!=typeof n)throw new TypeError("`nationalNumber` argument must be a string");Nm(r);var a=function(e,t){var n,r,i=new xm(t);mg(e)?(n=e,i.selectNumberingPlan(n),r=i.countryCallingCode()):r=e;return{country:n,countryCallingCode:r}}(t,r),s=a.country,d=a.countryCallingCode;this.country=s,this.countryCallingCode=d,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}},[{key:"setExt",value:function(e){this.ext=e}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Um(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return function(e,t,n){if(void 0===t&&(t={}),n=new xm(n),t.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!n.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));n.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(e.countryCallingCode)}}if(n.possibleLengths())return km(e.phone||e.nationalNumber,e.country,n);if(e.countryCallingCode&&n.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return e=this,t={v2:!0},n=this.getMetadata(),t=t||{},(n=new xm(n)).selectNumberingPlan(e.country,e.countryCallingCode),n.hasTypes()?void 0!==Lm(e,t,n.metadata):jm(t.v2?e.nationalNumber:e.phone,n.nationalNumberPattern());var e,t,n}},{key:"isNonGeographic",value:function(){return new xm(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:"getType",value:function(){return Lm(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(e,t){return og(this,e,t?ug(ug({},t),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(e){return this.format("NATIONAL",e)}},{key:"formatInternational",value:function(e){return this.format("INTERNATIONAL",e)}},{key:"getURI",value:function(e){return this.format("RFC3966",e)}}])}(),mg=function(e){return/^[A-Z]{2}$/.test(e)};var gg=/^\+\d+$/;function $g(e){return($g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vg(e,t,n){return t=wg(t),function(e,t){if(t&&("object"==$g(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,bg()?Reflect.construct(t,n||[],wg(e).constructor):t.apply(e,n))}function yg(e){var t="function"==typeof Map?new Map:void 0;return yg=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(bg())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&xg(i,n.prototype),i}(e,arguments,wg(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),xg(n,e)},yg(e)}function bg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(bg=function(){return!!e})()}function xg(e,t){return(xg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function wg(e){return(wg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _g=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=vg(this,t,[e]),Object.setPrototypeOf(n,t.prototype),n.name=n.constructor.name,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xg(e,t)}(t,e),n=t,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(yg(Error)),Cg=new RegExp("(?:"+Zm()+")$","i");var Sg={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function Eg(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ng(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ng(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ng(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Tg(e){for(var t,n="",r=Eg(e.split(""));!(t=r()).done;){n+=Ag(t.value,n)||""}return n}function Ag(e,t,n){if("+"===e){if(t)return;return"+"}return function(e){return Sg[e]}(e)}var Og="(["+Fm+"]|[\\-\\.\\(\\)]?)",Ig=new RegExp("^\\+"+Og+"*["+Fm+"]"+Og+"*$","g"),kg=new RegExp("^("+("["+Fm+"]+((\\-)*["+Fm+"])*")+"\\.)*"+("[a-zA-Z]+((\\-)*["+Fm+"])*")+"\\.?$","g"),jg="tel:",Rg=";phone-context=";function Pg(e,t){var n,r=t.extractFormattedPhoneNumber,i=function(e){var t=e.indexOf(Rg);if(t<0)return null;var n=t+15;if(n>=e.length)return"";var r=e.indexOf(";",n);return r>=0?e.substring(n,r):e.substring(n)}(e);if(!function(e){return null===e||0!==e.length&&(Ig.test(e)||kg.test(e))}(i))throw new _g("NOT_A_NUMBER");if(null===i)n=r(e)||"";else{n="","+"===i.charAt(0)&&(n+=i);var o,a=e.indexOf(jg);o=a>=0?a+4:0;var s=e.indexOf(Rg);n+=e.substring(o,s)}var d=n.indexOf(";isub=");if(d>0&&(n=n.substring(0,d)),""!==n)return n}var Dg=new RegExp("[++"+Fm+"]"),Lg=new RegExp("[^"+Fm+"#]+$");function Mg(e,t,n){if(t=t||{},n=new xm(n),t.defaultCountry&&!n.hasCountry(t.defaultCountry)){if(t.v2)throw new _g("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(t.defaultCountry))}var r=function(e,t,n){var r=Pg(e,{extractFormattedPhoneNumber:function(e){return function(e,t,n){if(!e)return;if(e.length>250){if(n)throw new _g("TOO_LONG");return}if(!1===t)return e;var r=e.search(Dg);if(r<0)return;return e.slice(r).replace(Lg,"")}(e,n,t)}});if(!r)return{};if(!function(e){return e.length>=2&&rg.test(e)}(r))return function(e){return tg.test(e)}(r)?{error:"TOO_SHORT"}:{};var i=function(e){var t=e.search(Cg);if(t<0)return{};for(var n=e.slice(0,t),r=e.match(Cg),i=1;i<r.length;){if(r[i])return{number:n,ext:r[i]};i++}}(r);if(i.ext)return i;return{number:r}}(e,t.v2,t.extract),i=r.number,o=r.ext,a=r.error;if(!i){if(t.v2){if("TOO_SHORT"===a)throw new _g("TOO_SHORT");throw new _g("NOT_A_NUMBER")}return{}}var s=function(e,t,n,r){var i,o=Vm(Tg(e),void 0,t,n,r.metadata),a=o.countryCallingCodeSource,s=o.countryCallingCode,d=o.number;if(s)r.selectNumberingPlan(s);else{if(!d||!t&&!n)return{};r.selectNumberingPlan(t,n),t&&(i=t),s=n||Am(t,r.metadata)}if(!d)return{countryCallingCodeSource:a,countryCallingCode:s};var l=Gm(Tg(d),i,r),u=l.nationalNumber,c=l.carrierCode,f=Wm(s,{nationalNumber:u,metadata:r});f&&(i=f,"001"===f||r.selectNumberingPlan(i));return{country:i,countryCallingCode:s,countryCallingCodeSource:a,nationalNumber:u,carrierCode:c}}(i,t.defaultCountry,t.defaultCallingCode,n),d=s.country,l=s.nationalNumber,u=s.countryCallingCode,c=s.countryCallingCodeSource,f=s.carrierCode;if(!n.hasSelectedNumberingPlan()){if(t.v2)throw new _g("INVALID_COUNTRY");return{}}if(!l||l.length<2){if(t.v2)throw new _g("TOO_SHORT");return{}}if(l.length>17){if(t.v2)throw new _g("TOO_LONG");return{}}if(t.v2){var h=new pg(u,l,n.metadata);return d&&(h.country=d),f&&(h.carrierCode=f),o&&(h.ext=o),h.__countryCallingCodeSource=c,h}var p=!!(t.extended?n.hasSelectedNumberingPlan():d)&&jm(l,n.nationalNumberPattern());return t.extended?{country:d,countryCallingCode:u,carrierCode:f,valid:p,possible:!!p||!(!0!==t.extended||!n.possibleLengths()||!km(l,d,n)),phone:l,ext:o}:p?function(e,t,n){var r={country:e,phone:t};n&&(r.ext=n);return r}(d,l,o):{}}function Ug(e){return(Ug="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Bg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fg(Object(n),!0).forEach(function(t){qg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qg(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Ug(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Ug(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ug(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zg(e){return(zg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wg(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=zg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=zg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==zg(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],d=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(d=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);d=!0);}catch(u){l=!0,i=u}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Vg(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Kg(e){var t,n,r,i=Gg(Array.prototype.slice.call(e),4),o=i[0],a=i[1],s=i[2],d=i[3];if("string"!=typeof o)throw new TypeError("A text for parsing must be a string.");if(t=o,a&&"string"!=typeof a){if(!pm(a))throw new Error("Invalid second argument: ".concat(a));s?(n=a,r=s):r=a}else d?(n=s,r=d):(n=void 0,r=s),a&&(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hg(Object(n),!0).forEach(function(t){Wg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({defaultCountry:a},n));return{text:t,options:n,metadata:r}}function Yg(e){return(Yg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Jg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xg(Object(n),!0).forEach(function(t){Zg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Zg(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Yg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Yg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Yg(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qg(e,t,n){t&&t.defaultCountry&&!function(e,t){return t.countries.hasOwnProperty(e)}(t.defaultCountry,n)&&(t=Jg(Jg({},t),{},{defaultCountry:void 0}));try{return function(e,t,n){return Mg(e,Bg(Bg({},t),{},{v2:!0}),n)}(e,t,n)}catch(r){if(!(r instanceof _g))throw r}}function e$(e){return(e$="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function t$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function n$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?t$(Object(n),!0).forEach(function(t){r$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function r$(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=e$(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=e$(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==e$(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i$(){var e=Kg(arguments),t=e.text,n=e.options,r=e.metadata,i=Qg(t,n=n$(n$({},n),{},{extract:!1}),r);return i&&i.isValid()||!1}function o$(){return function(e,t){var n=Array.prototype.slice.call(t);return n.push(cm),e.apply(this,n)}(i$,arguments)}const a$="55";function s$(e){return null==e?"":String(e).replace(/\D/g,"")}const d$=/^0?((?:800|300|500|900)\d{6,7})$/;function l$(e){const t=s$(e).match(d$);return t?t[1]:null}function u$(e){const t=s$(e);return 8===t.length?/^[2-5]/.test(t)?"landline":/^[6-9]/.test(t)?"mobile":"unknown":9===t.length&&t.startsWith("9")?"mobile":"unknown"}function c$(e){let t=s$(e);for(;t.startsWith("0")&&t.length>10;)t=t.slice(1);return!t.startsWith(a$)||12!==t.length&&13!==t.length||(t=t.slice(2)),t}const f$=["12","14","15","17","21","23","25","31","41","43"];function h$(e,t={}){const n=void 0===t.defaultDDD?"48":t.defaultDDD,r=t.legacyMobile??"all",i=s$(e),o=i.startsWith("0"),a=l$(i);if(a)return a;let s=c$(i);if(!s)return"";const d=l$(s);if(d)return d;if(s.length>13)return s;if(12===s.length||13===s.length){const e=s.slice(0,2);if(!o||!f$.includes(e))return s;s=s.slice(2)}const l=e=>"mobile"===u$(e)&&("all"===r||!e.startsWith("9"));if(11===s.length)return s;if(10===s.length){const e=s.slice(0,2),t=s.slice(2);return l(t)?`${e}9${t}`:s}if(9===s.length)return s.startsWith("9")&&n?`${n}${s}`:s;if(8===s.length){const e=u$(s);return n&&"unknown"!==e?l(s)?`${n}9${s}`:`${n}${s}`:s}return s}function p$(e){return h$(e)}function m$(e){if(!e)return"";const t=String(e);if(/[*#]/.test(t))return t;let n=s$(t);if(!n)return t;let r="";const i=t.trim().startsWith("+");if(n.startsWith(a$)&&(i||n.length>=12)&&n.length<=13&&(r="+55 ",n=n.slice(2)),n.length<=2)return`${r}${n}`;const o=n.match(/^(0?)((?:800|300|500|900))(\d{0,7})$/);if(o){const e=o[3],t=e.length<=3?e:`${e.slice(0,3)} ${e.slice(3)}`;return`${r}${o[1]}${o[2]}${t?` ${t}`:""}`}const a=n.slice(0,2),s=n.slice(2);return s.length<=4?`${r}(${a}) ${s}`:s.length<=8?`${r}(${a}) ${s.slice(0,4)}-${s.slice(4)}`:9===s.length?`${r}(${a}) ${s.slice(0,5)}-${s.slice(5)}`:`${r}${n}`}function g$(e){const t=(e??"").trim();if(t.startsWith("+")){const e=s$(t);return e?`+${e}`:null}const n=c$(t),r=l$(n);return r?`+${a$}${r}`:10!==n.length&&11!==n.length?null:`+${a$}${n}`}function $$(e){if(!e)return!1;try{return o$(e)}catch{return!1}}function v$(e){const t=g$(e);return!!t&&(t.startsWith(`+${a$}`)&&$$(t))}const y$="+55";function b$(e){if(!e)return"";const t=e.normalize("NFKC");let n="";for(const r of t)(/^[0-9*#]$/.test(r)||"+"===r&&0===n.length)&&(n+=r);return n}function x$(e,t=y$){const n=b$(e);if(!n)return"";const r=n.startsWith("+"),i=n.replace(/[^0-9]/g,""),o=t.replace(/[^0-9]/g,""),a=o.length||2,s=r?i.slice(0,Math.min(a,i.length)):o||i.slice(0,a);let d=r?i.slice(s.length):i;const l=r?`+${s}`:t,u="55"===s?d.match(/^(0?)((?:800|300|500|900))(\d{0,7})$/):null;if(u){const e=u[3],t=e.length<=3?e:`${e.slice(0,3)} ${e.slice(3)}`;return`${l} ${u[1]}${u[2]}${t?` ${t}`:""}`}if("55"===s&&d.length>=8){return`${l} (${d.slice(0,2)}) ${d.slice(2,Math.max(d.length-4,2))}-${d.slice(-4)}`.replace(/\s+/g," ").trim()}if(!d)return l.trim();const c=[];for(;d.length>4;)c.push(d.slice(0,3)),d=d.slice(3);d&&c.push(d);return`${l} ${c.join(" ")}`.replace(/\s+/g," ").trim()}function w$(e,t=y$){const n=b$(e).slice(0,32),r=x$(n,t),i=function(e,t=y$){const n=b$(e);if(!n)return null;if(n.startsWith("+")){const e=n.replace(/[^0-9]/g,"");return e?`+${e}`:null}const r=s$(n);if(!r)return null;const i=t.replace(/[^0-9]/g,"");if("55"!==i)return i?`+${i}${r}`:`+${r}`;const o=h$(r,{defaultDDD:null,legacyMobile:"unambiguous"});return o.length<10&&!l$(o)?null:`+55${o}`}(n,t),o=$$(i),a=i?x$(i,t):null,s=n.startsWith("+")?s$(n):`${t.replace(/[^0-9]/g,"")}${s$(n)}`;return{raw:n,display:r,e164:i,dialDisplay:a,isValid:o,differs:Boolean(i)&&s$(i??"")!==s}}const _$={fine:"(pointer: fine)",coarse:"(pointer: coarse)",hover:"(hover: hover)"};function C$(e){if("undefined"==typeof window||"function"!=typeof window.matchMedia)return null;try{return window.matchMedia(e).matches}catch{return null}}function S$(){const e=C$(_$.fine),t=C$(_$.coarse),n=C$(_$.hover),r=t?"coarse":e?"fine":"unknown";return{pointer:r,hover:!0===n,touchLike:"coarse"===r||"fine"!==r&&!1===n}}function E$(){const[e,n]=t.useState(()=>S$());return t.useEffect(()=>{if("undefined"==typeof window||"function"!=typeof window.matchMedia)return;const e=()=>n(S$()),t=[];for(const n of Object.values(_$))try{const r=window.matchMedia(n);"function"==typeof r.addEventListener?r.addEventListener("change",e):"function"==typeof r.addListener&&r.addListener(e),t.push(r)}catch{}return e(),()=>{for(const n of t)"function"==typeof n.removeEventListener?n.removeEventListener("change",e):"function"==typeof n.removeListener&&n.removeListener(e)}},[]),e}const N$="callix:click-to-call";function T$(e){if(!e)return"unknown";switch(e){case"idle":return"available";case"onBreak":return"on_break";case"afterCall":case"manualCallFailed":return"after_call";case"offline":case"stopped":case"startupError":case"startup.error":case"networkDown":return"offline";case"starting":return"unknown";case"callRinging":case"manualCallSetup":case"manualCallRinging":case"callInProgress":return"in_call";default:return/call|ringing|dial/i.test(e)?"in_call":"unknown"}}function A$(e){return"available"===e||"on_break"===e}function O$(e){const t=new AbortController,n=setTimeout(()=>t.abort(),1e4);return e&&(e.aborted?t.abort():e.addEventListener("abort",()=>t.abort(),{once:!0})),{signal:t.signal,clear:()=>clearTimeout(n)}}async function I$(e){const{signal:t,clear:n}=O$();try{const n=await fetch(`${e.apiBaseUrl}/api/click-to-call/${encodeURIComponent(e.taskId)}`,{method:"PATCH",headers:e.headers,body:JSON.stringify({status:e.status,error:e.error,retry:!0===e.retry}),credentials:"omit",keepalive:!0,signal:t});if(!n.ok){let e=null;try{const t=await n.json();e="string"==typeof(null==t?void 0:t.error)?t.error:null}catch{}return{ok:!1,status:n.status,code:e}}return{ok:!0,task:(await n.json()).task??null}}finally{n()}}function k$(e){const t=(e??"").replace(/\D/g,"");return!t.startsWith("55")||12!==t.length&&13!==t.length?e.startsWith("+")?`+${t}`:t:t.slice(2)}const j$={width:448,height:640},R$=280,P$=420,D$=1024,L$=[{value:"1",detail:""},{value:"2",detail:"ABC"},{value:"3",detail:"DEF"},{value:"4",detail:"GHI"},{value:"5",detail:"JKL"},{value:"6",detail:"MNO"},{value:"7",detail:"PQRS"},{value:"8",detail:"TUV"},{value:"9",detail:"WXYZ"},{value:"*",detail:""},{value:"0",detail:"+"},{value:"#",detail:""}],M$={rttMs:null,bitrateKbps:null,packetLossRatio:null},U$={jitterMs:null,packetLossRatio:null,audioLevel:null},F$="candidate-pair",B$="inbound-rtp";function q$({isAuthenticated:e,username:n,onLogin:r,onLogout:i,isLoadingSession:o,sessionError:a,sessionStatus:s=null,loginConfirmation:d=null,onCancelLoginConfirmation:l,onTakeOverSession:u,onLogoutAllTabs:c,variant:f="default",portalTarget:h=null}){const p=t.useRef(null),m=t.useRef(null),g=t.useRef({pointerId:null,offsetX:0,offsetY:0}),v=t.useRef({pointerId:null,originX:0,originY:0,startWidth:j$.width,startHeight:j$.height,edge:"corner"}),y=t.useRef(!1),[b,x]=t.useState({x:24,y:24}),[w,_]=t.useState(!1),[C,S]=t.useState(!1),[E,N]=t.useState(!1),[T,A]=t.useState(""),[O,I]=t.useState(null),[k,j]=t.useState({width:j$.width,height:j$.height}),R=t.useRef(e),P=t.useMemo(()=>b$(T),[T]),D="min"===f,L=t.useMemo(()=>{const e=k.width/j$.width,t=k.height/j$.height;return X$(Math.min(e,t),.55,2.5)},[k]),M=t.useCallback(e=>{if("undefined"==typeof window)return{width:X$(e.width,R$,D$),height:X$(e.height,P$,960)};const t=window.innerWidth,n=window.innerHeight,r=t<640?12:16,i=Math.min(D$,t-2*r),o=Math.min(960,n-2*r);return{width:X$(e.width,R$,Math.max(R$,i)),height:X$(e.height,P$,Math.max(P$,o))}},[]),U=t.useCallback(e=>{if("undefined"==typeof window)return e;const t=window.innerWidth,n=window.innerHeight,r=p.current,i=(null==r?void 0:r.offsetWidth)??0,o=(null==r?void 0:r.offsetHeight)??0,a=O??k??j$,s=E?a.width:80,d=E?a.height:80,l=i>0?i:s,u=o>0?o:d,c=t<640?12:16,f=c,h=c,m=Math.max(f,t-l-c),g=Math.max(h,n-u-c);let $=e.x,v=e.y;return t<640&&E&&($=Math.round((t-l)/2),v=c),n<u+2*c&&(v=c),{x:X$($,f,m),y:X$(v,h,g)}},[E,O,k]),F=t.useCallback(e=>{A(t=>b$("function"==typeof e?e(t):e))},[]);t.useEffect(()=>{var e,t;if("undefined"==typeof window)return;const n=(null==(e=p.current)?void 0:e.offsetWidth)??96,r=(null==(t=p.current)?void 0:t.offsetHeight)??96,i=window.innerWidth-n-24,o=window.innerHeight-r-24;x(U({x:i,y:o}))},[U]),t.useEffect(()=>{x(e=>U(e))},[E,U]),t.useEffect(()=>{if("undefined"==typeof window)return;const e=()=>{x(e=>U(e)),I(e=>e?M(e):e)};return window.addEventListener("resize",e),window.addEventListener("orientationchange",e),()=>{window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}},[U,M]),t.useEffect(()=>{if(!E)return;const e=m.current;if(!e)return;const t=(e,t)=>{j({width:e,height:t})};if("undefined"!=typeof ResizeObserver){const n=new ResizeObserver(e=>{const n=e[0];if(n){const{width:e,height:r}=n.contentRect;t(e,r)}});return n.observe(e),()=>n.disconnect()}const n=e.getBoundingClientRect();t(n.width,n.height)},[E,O]),t.useEffect(()=>{e&&!R.current&&N(!0),R.current=e},[e]),t.useEffect(()=>{const e=e=>{const t=e.detail;N(!0),(null==t?void 0:t.phone)&&F(k$(t.phone).slice(0,32))};return window.addEventListener(N$,e),()=>window.removeEventListener(N$,e)},[F]);const B=t.useRef(!1);t.useEffect(()=>{const t=!e&&Boolean(d||a);t&&!B.current&&N(!0),B.current=t},[e,d,a]),t.useEffect(()=>{if(!w)return;const e=e=>{var t,n;if(g.current.pointerId!==e.pointerId)return;y.current=!0;const r=(null==(t=p.current)?void 0:t.offsetWidth)??0,i=(null==(n=p.current)?void 0:n.offsetHeight)??0,o=e.clientX-g.current.offsetX,a=e.clientY-g.current.offsetY,s="undefined"!=typeof window?window.innerWidth:0,d=s<640?12:16,l=s-r-d,u=("undefined"!=typeof window?window.innerHeight:0)-i-d,c=Math.max(d,l),f=Math.max(d,u);x({x:X$(o,d,c),y:X$(a,d,f)})},t=e=>{g.current.pointerId===e.pointerId&&(_(!1),g.current={pointerId:null,offsetX:0,offsetY:0})};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t)}},[w]),t.useEffect(()=>{if(!C)return;const e=e=>{if(v.current.pointerId!==e.pointerId)return;e.preventDefault();const{edge:t,startWidth:n,startHeight:r,originX:i,originY:o}=v.current;let a=n,s=r;"right"!==t&&"corner"!==t||(a=n+(e.clientX-i)),"bottom"!==t&&"corner"!==t||(s=r+(e.clientY-o));const d=M({width:a,height:s});I(e=>e&&e.width===d.width&&e.height===d.height?e:d)},t=e=>{var t,n;if(v.current.pointerId===e.pointerId){try{null==(n=null==(t=e.target)?void 0:t.releasePointerCapture)||n.call(t,e.pointerId)}catch{}S(!1),v.current={...v.current,pointerId:null}}};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[C,M]),t.useEffect(()=>{E||(y.current=!1)},[E]),t.useEffect(()=>{x(e=>U(e))},[O,k,U]);const q=t.useCallback(e=>t=>{var n,r;if(0!==t.button&&"touch"!==t.pointerType)return;t.preventDefault(),t.stopPropagation();const i=m.current,o=null==i?void 0:i.getBoundingClientRect(),a=(null==o?void 0:o.width)??(null==O?void 0:O.width)??j$.width,s=(null==o?void 0:o.height)??(null==O?void 0:O.height)??j$.height;v.current={pointerId:t.pointerId,originX:t.clientX,originY:t.clientY,startWidth:a,startHeight:s,edge:e};try{null==(r=(n=t.currentTarget).setPointerCapture)||r.call(n,t.pointerId)}catch{}S(!0)},[O]),z=t.useCallback(e=>{var t;if(0!==e.button)return;const n=null==(t=p.current)?void 0:t.getBoundingClientRect();g.current={pointerId:e.pointerId,offsetX:e.clientX-((null==n?void 0:n.left)??0),offsetY:e.clientY-((null==n?void 0:n.top)??0)},y.current=!1,_(!0)},[]),H=t.useCallback(()=>{y.current?y.current=!1:N(e=>!e)},[]),W=t.useCallback(async e=>{const t=e.trim();t&&await r(t)},[r]),G=e?$.jsx(H$,{username:n??"",dialValue:P,setDialValue:F,onLogout:i,variant:f,onRequestClose:()=>N(!1),portalTarget:h}):$.jsx(z$,{defaultValue:n??"",onSubmit:W,isLoading:o,error:a,statusMessage:s,confirmation:d,onCancelConfirmation:l,onTakeOver:u,onLogoutAll:c});if(D)return G;const V=Number.isFinite(L)&&L>0?L:1,K=j$.width/V,Y=j$.height/V,X={width:O?`${O.width}px`:void 0,height:O?`${O.height}px`:void 0,minWidth:"280px",minHeight:"420px",maxWidth:"min(1024px, calc(100vw - 1.5rem))",maxHeight:"calc(100vh - 3rem)"},J={flex:1,display:"flex",flexDirection:"column",transform:`scale(${V})`,transformOrigin:"top left",width:`${K}px`,minHeight:`${Y}px`},Z={flex:1,display:"flex",flexDirection:"column",width:`${j$.width}px`,minHeight:`${j$.height}px`};return $.jsx("div",{ref:p,className:["callix","mode","full",Xh`fixed z-50 select-none`].join(" "),"data-callix-variant":"default",style:{transform:`translate3d(${b.x}px, ${b.y}px, 0)`,top:0,left:0},children:E?$.jsxs("div",{ref:m,"data-floating-dialer-card":"true",className:Xh`relative flex flex-col items-start overflow-hidden rounded-3xl border border-slate-200/60 bg-gradient-to-br from-white/95 via-slate-50/95 to-white/90 shadow-2xl backdrop-blur-lg transition-all duration-300 w-[min(32rem,calc(100vw-1.5rem))] max-w-[calc(100vw-1.5rem)] sm:w-[28rem] md:w-[30rem] max-h-[calc(100vh-3rem)] sm:max-h-none`,style:X,children:[$.jsx("div",{className:Xh`flex flex-1 flex-col overflow-hidden`,style:J,children:$.jsxs("div",{"data-floating-dialer-content":!0,className:Xh`flex flex-1 flex-col rounded-3xl overflow-hidden`,style:Z,children:[$.jsxs("div",{className:Xh`cursor-grab touch-none active:cursor-grabbing flex items-center justify-between bg-gradient-to-r from-primary to-primaryDark px-4 py-3 text-white shadow-sm`,onPointerDown:z,children:[$.jsxs("div",{className:Xh`flex items-center gap-3`,children:[$.jsx("span",{className:Xh`inline-flex h-10 w-10 items-center justify-center rounded-2xl bg-white/15 shadow-inner`,children:$.jsx(Lc,{className:Xh`text-xl`})}),$.jsxs("div",{className:Xh`space-y-0.5`,children:[$.jsx("p",{className:Xh`text-[11px] uppercase tracking-[0.2em] text-white/70`,children:"Discadora"}),$.jsx("p",{className:Xh`text-base font-semibold`,children:n??"Visitante"})]})]}),$.jsx("button",{type:"button",className:Xh`rounded-full p-2 text-white/80 transition hover:bg-white/15 hover:text-white`,onClick:()=>N(!1),"aria-label":"Fechar discadora",children:$.jsx(Yc,{className:Xh`text-lg`})})]}),$.jsx("div",{className:Xh`flex-1 overflow-y-auto p-3`,children:G})]})}),$.jsx("div",{role:"presentation","data-floating-dialer-resize":"right","aria-hidden":"true",className:Xh`absolute right-0 top-16 bottom-12 w-3 cursor-ew-resize touch-none rounded-md border border-transparent transition-colors duration-150 hover:border-primary/30 hover:bg-primary/10`,onPointerDown:q("right")}),$.jsx("div",{role:"presentation","data-floating-dialer-resize":"bottom","aria-hidden":"true",className:Xh`absolute left-16 right-12 bottom-0 h-3 cursor-ns-resize touch-none rounded-md border border-transparent transition-colors duration-150 hover:border-primary/30 hover:bg-primary/10`,onPointerDown:q("bottom")}),$.jsx("div",{role:"presentation","data-floating-dialer-resize":"corner",className:Xh`absolute bottom-1 right-1 flex h-6 w-6 items-center justify-center cursor-nwse-resize touch-none`,onPointerDown:q("corner"),"aria-label":"Redimensionar discadora",children:$.jsx("span",{className:Xh`h-3 w-3 rotate-45 rounded-sm border border-slate-300 bg-white/80 shadow`})})]}):$.jsx("button",{type:"button",onPointerDown:z,onClick:H,className:Xh`flex h-16 w-16 items-center justify-center rounded-full bg-primary text-white shadow-xl transition-transform hover:scale-105 hover:bg-primaryDark focus:outline-none focus:ring-4 focus:ring-primary/30`,"aria-label":"Abrir discadora",children:$.jsx(Fc,{className:Xh`text-2xl`})})})}function z$({defaultValue:e,onSubmit:n,isLoading:r,error:i,statusMessage:o,confirmation:a,onCancelConfirmation:s,onTakeOver:d,onLogoutAll:l}){const[u,c]=t.useState(e),[f,h]=t.useState(!1);t.useEffect(()=>{c(e)},[e]);const p=f&&!u.trim();if(r){const e=((null==a?void 0:a.username)||u||"").trim();return $.jsxs("div",{className:Xh`flex flex-col items-center justify-center gap-3 rounded-2xl border border-slate-200 bg-white px-4 py-8 text-center`,role:"status","aria-live":"polite",children:[$.jsx("span",{className:Xh`inline-flex h-10 w-10 animate-spin rounded-full border-4 border-primary/20 border-t-primary`}),e&&$.jsx("p",{className:Xh`text-sm font-semibold text-slate-800`,children:e}),$.jsx("p",{className:Xh`text-xs text-slate-500`,children:o||"Conectando..."})]})}return(null==a?void 0:a.elsewhere)?$.jsxs("div",{className:Xh`space-y-4`,"data-login-state":"elsewhere",children:[$.jsxs("div",{className:Xh`space-y-2 text-center`,children:[$.jsx("p",{className:Xh`text-[11px] font-semibold uppercase tracking-wide text-slate-500`,children:"Discador ativo em outra aba"}),$.jsxs("p",{className:Xh`inline-flex items-center gap-2 rounded-full border border-slate-200 bg-slate-50 px-3 py-1 text-sm font-semibold text-slate-800`,children:[$.jsx(Hc,{className:Xh`text-primary`}),a.username]})]}),i&&$.jsx("p",{className:Xh`text-center text-xs text-red-500`,children:i}),$.jsx("button",{type:"button",id:"takeOverBtn",onClick:()=>null==d?void 0:d(),className:Xh`flex w-full items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2 text-white shadow-lg transition hover:bg-primaryDark`,children:"Usar o discador nesta aba"}),$.jsx("button",{type:"button",id:"logoutAllBtn",onClick:()=>null==l?void 0:l(),className:Xh`w-full text-center text-xs font-semibold text-red-500 transition hover:text-red-600`,children:"Sair em todas as abas"}),$.jsx("p",{className:Xh`text-center text-[11px] text-slate-400`,children:"O Callix aceita uma conexão por usuário: você já está conectado em outra aba deste navegador e pode continuar por lá."})]}):a?$.jsxs("div",{className:Xh`space-y-4`,"data-login-state":"choose",children:[$.jsxs("div",{className:Xh`space-y-2 text-center`,children:[$.jsx("p",{className:Xh`text-[11px] font-semibold uppercase tracking-wide text-slate-500`,children:"Entrar como"}),$.jsxs("p",{className:Xh`inline-flex items-center gap-2 rounded-full border border-slate-200 bg-slate-50 px-3 py-1 text-sm font-semibold text-slate-800`,children:[$.jsx(Hc,{className:Xh`text-primary`}),a.username]})]}),i&&$.jsx("p",{className:Xh`text-center text-xs text-red-500`,children:i}),!i&&a.note&&$.jsx("p",{className:Xh`text-center text-xs text-slate-500`,children:a.note}),$.jsx("button",{type:"button",id:"loginConfirmBtn",onClick:()=>{n(a.username)},className:Xh`flex w-full items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2 text-white shadow-lg transition hover:bg-primaryDark`,children:"Entrar"}),!a.locked&&s&&$.jsx("button",{type:"button",onClick:s,className:Xh`w-full text-center text-xs font-semibold text-slate-500 transition hover:text-primary`,children:"Usar outro usuário"}),$.jsx("p",{className:Xh`text-center text-[11px] text-slate-400`,children:"Ao entrar, todas as abas abertas passam a usar o discador. Vai usar o Callix web? Então não entre aqui: nada é conectado sem a sua confirmação."})]}):$.jsxs("form",{className:Xh`space-y-4`,onSubmit:async e=>{e.preventDefault(),h(!0),u.trim()&&await n(u)},children:[$.jsxs("div",{className:Xh`space-y-2`,children:[$.jsxs("label",{className:Xh`flex items-center gap-2 text-sm font-medium text-slate-700`,htmlFor:"dialer-username",children:[$.jsx(Hc,{className:Xh`text-base text-primary`}),"Usuario"]}),$.jsx("input",{id:"dialer-username",type:"text",placeholder:"Digite seu usuario Callix",className:Xh`w-full rounded-xl border border-slate-200 bg-white px-3 py-2 text-base shadow-inner focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/40`,value:u,onChange:e=>c(e.target.value),onBlur:()=>h(!0),autoCapitalize:"none",autoCorrect:"off",spellCheck:!1}),p&&$.jsx("p",{className:Xh`text-xs text-red-500`,children:"Informe um usuario para continuar."}),i&&$.jsx("p",{className:Xh`text-xs text-red-500`,children:i})]}),$.jsx("button",{type:"submit",className:Xh`flex w-full items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2 text-white shadow-lg transition hover:bg-primaryDark`,children:"Entrar"})]})}function H$({username:e,dialValue:r,setDialValue:i,onLogout:o,variant:a,onRequestClose:s,portalTarget:d=null}){var l,u;const c="min"===a,{skipManualQualification:f}=Yy();console.log("[FloatingDialer/AuthenticatedDialer] 🔧 skipManualQualification:",f);const h=Qu(),p=ec(),m=nc(),g=rc(),v=ic(),y=oc(),b=t.useMemo(()=>v??[],[v]),x=t.useMemo(()=>y??[],[y]),{makeManualCall:w,becomeAvailable:_,finishAfterCall:C}=tc(),{hangup:S,answer:E,reject:N}=ac(),[T,A]=sc(),[O,I]=dc(),[k,j]=lc();t.useEffect(()=>{console.log("[FloatingDialer] Estado do operador mudou:",{state:null==p?void 0:p.state,operatorState:p,hasCall:!!m,currentCall:m})},[p,m]),t.useEffect(()=>{console.log("[FloatingDialer] Qualificações:",{success:b,discard:x,callState:null==p?void 0:p.state})},[b,x,null==p?void 0:p.state]),t.useEffect(()=>{"incoming"===(null==m?void 0:m.direction)&&console.log("[FloatingDialer] 📞 CHAMADA RECEBIDA:",{call:m,direction:m.direction,state:null==p?void 0:p.state,counterpart:V$(m)})},[m,null==p?void 0:p.state]);const[R,P]=t.useState(!1),D=t.useRef(null),L=t.useRef(null),M=t.useRef(null),U=t.useRef(null),[F,B]=t.useState(null),[q,z]=t.useState(null);uc("userSessionDropped",e=>{const t=Wp(null==e?void 0:e.originator);z(`${t.title}: ${t.detail}${t.action?` ${t.action}`:""}`)});const[H,W]=t.useState(null),[G,V]=t.useState(!1),[K,Y]=t.useState("success"),[X,J]=t.useState(null),[Z,Q]=t.useState(0),[ee,te]=t.useState(0),[ne,re]=t.useState(M$),[ie,oe]=t.useState(U$),ae=t.useRef(null),se=t.useRef(!1),[de,le]=t.useState({inputs:[],outputs:[]}),[ue,ce]=t.useState(null),[fe,he]=t.useState(null),[pe,me]=t.useState(null),[ge,$e]=t.useState(!1),ve=t.useRef(null),[ye,be]=t.useState(null),[xe,we]=t.useState(!1),[_e,Ce]=t.useState(null),[Se,Ee]=t.useState("undefined"!=typeof window&&window.innerWidth<=640),Ne="mobile"===a,Te=E$(),Ae=Ne||Se&&Te.touchLike,Oe=lm(null==h?void 0:h.breaks)||[],{goOnBreak:Ie,goOffBreak:ke}=um(),je=t.useMemo(()=>r.slice(0,32),[r]),Re=t.useMemo(()=>w$(je,y$),[je]),Pe=Re.e164,De=Re.display,Le=Re.differs?Re.dialDisplay:null,Me=null==p?void 0:p.state,Ue="idle"===Me,Fe="onBreak"===Me,Be="incoming"===(null==m?void 0:m.direction),qe="callInProgress"===Me,ze="manualCallRinging"===Me||"callRinging"===Me,He="manualCallSetup"===Me||ze,We=!Me||"starting"===Me||"idle"===Me||"manualCallSetup"===Me||"onBreak"===Me,Ge=We||qe||ze,Ve=Re.isValid,Ke=t.useCallback(async e=>{if("function"==typeof _)try{await Promise.resolve(_())}catch(t){console.error(e,t),z(e)}else z(e)},[_]);t.useEffect(()=>{if(se.current)return;se.current=!0;Me&&["onBreak","manualCallSetup","manualCallRinging","manualCallFailed","callRinging","callInProgress","afterCall"].includes(Me)||Ke("Nao foi possivel ficar disponivel automaticamente.")},[Ke,Me]),t.useEffect(()=>{"idle"===Me&&(z(null),B(null))},[Me]),t.useEffect(()=>{if("undefined"==typeof window)return;const e=()=>Ee(window.innerWidth<=640);return e(),window.addEventListener("resize",e),window.addEventListener("orientationchange",e),()=>{window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}},[]),t.useEffect(()=>{"offline"===Me&&(z("Conexao perdida. Tentando reconectar..."),Ke("Conexao perdida. Tentando reconectar..."))},[Me,Ke]),t.useEffect(()=>{if("afterCall"===Me){if("campaign"===(null==g?void 0:g.type)&&!0===g.info.campaign.skipCallQualification)return console.log("[FloatingDialer] 🚀 skipCallQualification ativado - finalizando automaticamente"),void("function"==typeof C&&Promise.resolve(C({result:"success",qualificationId:void 0})));if("manual"===(null==g?void 0:g.type))return console.log("[FloatingDialer] 🚀 Chamada MANUAL detectada - finalizando automaticamente (chamadas manuais NUNCA exibem qualificação)"),void("function"==typeof C&&Promise.resolve(C({result:"success",qualificationId:void 0})));if(0===b.length&&0===x.length)return console.log("[FloatingDialer] 🚀 Sem qualificações configuradas - finalizando automaticamente"),void("function"==typeof C&&Promise.resolve(C({result:"success",qualificationId:void 0})));const e=b.length>0;Y(e?"success":"failure"),J(null),W(null)}},[Me,b.length,x.length,g,C,f]),t.useEffect(()=>{if("undefined"==typeof window)return;if("starting"!==Me)return;const e=window.setTimeout(()=>{z(e=>e??"Conexao demorando mais que o esperado. Verifique rede ou credenciais.")},8e3);return()=>window.clearTimeout(e)},[Me]);const Ye=t.useRef(Pe);Ye.current=Pe,t.useEffect(()=>{if("manualCallRinging"===Me||"callInProgress"===Me){const e=Ye.current;e&&be(t=>t??e),i("")}"idle"===Me&&be(null)},[Me,i]),t.useEffect(()=>{var e;if("undefined"==typeof navigator||!(null==(e=navigator.mediaDevices)?void 0:e.enumerateDevices))return;let t=!1;const n=async()=>{try{navigator.mediaDevices.getUserMedia&&await navigator.mediaDevices.getUserMedia({audio:!0})}catch(e){console.warn("Permissao de microfone nao concedida ainda",e)}try{const e=await navigator.mediaDevices.enumerateDevices();if(t)return;const n=e.filter(e=>"audioinput"===e.kind),r=e.filter(e=>"audiooutput"===e.kind);le({inputs:n,outputs:r});const i=await Bp();if(t)return;me(i?`${i.title}: ${i.detail}${i.action?` ${i.action}`:""}`:null),ce(e=>{var t;return e??(null==(t=n[0])?void 0:t.deviceId)??null}),he(e=>{var t;return e??(null==(t=r[0])?void 0:t.deviceId)??null})}catch(e){t||(console.error("Listagem de dispositivos falhou",e),me("Nao foi possivel listar dispositivos de audio. Verifique as permissoes."))}};n();const r=()=>{n()},i=navigator.mediaDevices;return"addEventListener"in i?i.addEventListener("devicechange",r):"ondevicechange"in i&&(i.ondevicechange=r),()=>{t=!0,"removeEventListener"in i?i.removeEventListener("devicechange",r):"ondevicechange"in i&&(i.ondevicechange=null)}},[]),t.useEffect(()=>{if(!m||"callInProgress"!==Me)return Q(0),re(M$),void oe(U$);const e=Math.floor(m.currentDurationSeconds??0);Q(e),console.log("[FloatingDialer] ?? Timer iniciado:",{initialDuration:e,currentDurationSeconds:m.currentDurationSeconds,callState:Me});const t=window.setInterval(()=>{const e=Math.floor(m.currentDurationSeconds??0);Q(e),e%5==0&&e>0&&console.log("[FloatingDialer] ?? Timer atualizado:",e,"segundos")},1e3);return()=>{console.log("[FloatingDialer] ?? Timer parado"),window.clearInterval(t)}},[m,Me]),t.useEffect(()=>{if(!m||"callInProgress"!==Me)return;const e=e=>{const t=W$(e,"stat")??{},n="string"==typeof t.type?t.type:void 0;if(n===F$){const e=K$(t,"currentRoundTripTime"),n=K$(t,"availableOutgoingBitrate");re(t=>({rttMs:null!=e?1e3*e:t.rttMs,bitrateKbps:null!=n?n/1e3:t.bitrateKbps,packetLossRatio:t.packetLossRatio}))}if(n===B$){const e=K$(t,"packetsReceived")??0,n=K$(t,"packetsLost")??0,r=e+n,i=r>0?n/r:null,o=K$(t,"jitter"),a=K$(t,"audioLevel");oe(e=>({jitterMs:null!=o?1e3*o:e.jitterMs,packetLossRatio:i??e.packetLossRatio,audioLevel:a??e.audioLevel})),re(e=>({rttMs:e.rttMs,bitrateKbps:e.bitrateKbps,packetLossRatio:i??e.packetLossRatio}))}};return m.on("webRTCStat",e),()=>{m.off("webRTCStat",e)}},[m,Me]),t.useEffect(()=>{var e;if(!ue)return;if("undefined"==typeof navigator||!(null==(e=navigator.mediaDevices)?void 0:e.getUserMedia))return;let t=!1;return(async()=>{var e,n,r,i;const o=null==(n=null==(e=ve.current)?void 0:e.getAudioTracks)?void 0:n.call(e)[0],a=null==(r=null==o?void 0:o.getSettings)?void 0:r.call(o).deviceId;let s=ve.current;if(!s||a!==ue)try{const e=await navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:ue}}});if(t)return void e.getTracks().forEach(e=>e.stop());ve.current&&ve.current!==e&&ve.current.getTracks().forEach(e=>e.stop()),ve.current=e,s=e}catch(l){return void(t||(console.error("Falha ao acessar microfone selecionado",l),me("Nao foi possivel acessar o microfone selecionado.")))}if(!s)return;const d=s.getAudioTracks()[0];if(d)try{const e=G$(h,"setAudioInputDevice");if(e)return await Promise.resolve(e(ue)),void me(null);const t=function(e){const t=W$(e,"rtcSession")??W$(e,"_session")??W$(e,"session"),n=W$(t,"_connection")??W$(t,"connection");if(n)return n;return W$(e,"pc")??void 0}(m),n=null==(i=null==t?void 0:t.getSenders)?void 0:i.call(t).find(e=>{var t;return"audio"===(null==(t=e.track)?void 0:t.kind)});if(null==n?void 0:n.replaceTrack)return await n.replaceTrack(d),void me(null);const r=G$(m,"setInputTrack");if(r)return await Promise.resolve(r(d)),void me(null);const o=G$(m,"replaceTrack");if(o)return await Promise.resolve(o(d)),void me(null);console.warn("Nao foi possivel aplicar o microfone via API conhecida"),me(null)}catch(l){t||(console.error("Erro ao aplicar microfone",l),me("Nao foi possivel aplicar o microfone selecionado."))}})(),()=>{t=!0}},[ue,h,m]),t.useEffect(()=>{if(!fe||!h)return;(async()=>{try{const e=G$(W$(h,"audioOutput"),"setAudioOutputDevice");if(!e)return void console.warn("Nao foi possivel localizar API para alterar dispositivo de saida.");await Promise.resolve(e(fe)),me(null)}catch(e){console.error("Erro ao aplicar dispositivo de saida",e),me("Nao foi possivel aplicar a saida de audio selecionada.")}})()},[fe,h]),t.useEffect(()=>{if(!m)return;const e=e=>{const t=Kp(null==e?void 0:e.failure);B(`${t.title}: ${t.detail}${t.action?` ${t.action}`:""}`)};return m.on("failed",e),()=>{m.off("failed",e)}},[m]),t.useEffect(()=>()=>{const e=ae.current;e&&e.close().catch(()=>{})},[]),t.useEffect(()=>()=>{var e;null==(e=ve.current)||e.getTracks().forEach(e=>e.stop()),ve.current=null},[]);const Xe=t.useCallback(async()=>{if("undefined"==typeof window)return null;const e=window.AudioContext||window.webkitAudioContext;if(!e)return null;if(ae.current||(ae.current=new e),"suspended"===ae.current.state)try{await ae.current.resume()}catch(t){console.error("Falha ao retomar audio",t)}return ae.current},[]),Je=t.useCallback(async e=>{const t=Y$[e];if(!t)return;const n=await Xe();if(!n)return;const r=n.createGain(),[i,o]=t,a=n.createOscillator(),s=n.createOscillator();a.type="sine",s.type="sine",a.frequency.setValueAtTime(i,n.currentTime),s.frequency.setValueAtTime(o,n.currentTime),r.gain.setValueAtTime(0,n.currentTime),r.gain.linearRampToValueAtTime(.22,n.currentTime+.01),r.gain.linearRampToValueAtTime(0,n.currentTime+.18),a.connect(r),s.connect(r),r.connect(n.destination);const d=n.currentTime,l=d+.2;a.start(d),s.start(d),a.stop(l),s.stop(l);const u=()=>{try{a.disconnect(),s.disconnect(),r.disconnect()}catch(e){console.error("Erro ao limpar tons DTMF",e)}};a.onended=u,s.onended=u},[Xe]),Ze=t.useCallback(e=>{if(Je(e),m&&(qe||ze)){try{m.sendDtmf(e)}catch(n){console.error("Falha ao enviar DTMF",n),B("Nao foi possivel enviar o tom DTMF.")}return}if(!We)return;if(B(null),!/^[0-9*#]$/.test(e))return void console.warn("[handleDial] Dígito inválido ignorado:",e);const t=ee;i(n=>{const r=n,i=(r.slice(0,t)+e+r.slice(t)).slice(0,32),o=Math.min(t+1,i.length);return te(o),setTimeout(()=>{U.current&&(U.current.focus(),U.current.setSelectionRange(o,o))},0),i})},[Je,m,qe,ze,We,ee,i]),Qe=t.useCallback(()=>{B(null),i(""),te(0),setTimeout(()=>{U.current&&U.current.focus()},0)},[i]),et=t.useCallback(()=>{B(null);const e=ee;0!==e&&i(t=>{const n=t.slice(0,e-1)+t.slice(e),r=e-1;return te(r),setTimeout(()=>{U.current&&(U.current.focus(),U.current.setSelectionRange(r,r))},0),n})},[i,ee]);t.useEffect(()=>{const e=e=>{const t=e.detail;(null==t?void 0:t.phone)&&(B(null),be(t.phone))};return window.addEventListener(N$,e),()=>window.removeEventListener(N$,e)},[]);const tt=t.useCallback(async()=>{if(!Ue&&!Fe)return;if(!je)return void B("Informe um numero para ligar.");const e=Pe;if(console.log("[handleCall] sanitizedDialValue:",je,"-> E.164:",e),e)if($$(e)){console.log("[handleCall] 🚀 Ligando para:",e);try{B(null),be(e),w&&w(e)}catch(t){console.error("Erro ao iniciar chamada",t),B("Nao foi possivel iniciar a ligacao.")}}else B("Numero invalido. Informe o DDD e o numero (fixo com 8 ou celular com 9 digitos).");else B("Informe um numero para ligar.")},[Ue,Fe,je,Pe,w]),nt=t.useCallback(async e=>{if(Ie)try{Ce(null),await Ie(e),we(!1),console.log("[FloatingDialer] Entrou em pausa com sucesso:",e)}catch(t){console.error("[FloatingDialer] Erro ao entrar em pausa:",t),Ce(t instanceof Error?t.message:"N�o foi poss�vel entrar em pausa.")}},[Ie]),rt=t.useCallback(async()=>{if(ke)try{await ke(),console.log("[FloatingDialer] Saiu da pausa com sucesso")}catch(e){console.error("[FloatingDialer] Erro ao sair da pausa:",e),z("N�o foi poss�vel sair da pausa.")}},[ke]);t.useEffect(()=>{if(U.current&&je.length<ee){const e=je.length;te(e),U.current.setSelectionRange(e,e)}},[je,ee]),t.useEffect(()=>{if(c)return;if(!R)return;const e=e=>{if(e.metaKey||e.ctrlKey||e.altKey)return;const t=e.key;if("Backspace"===t)return e.preventDefault(),void et();if("Delete"===t)return e.preventDefault(),void Qe();if("Enter"===t)return void(Ue&&(e.preventDefault(),tt()));const n="NumpadEnter"===t?null:t;if(n&&["0","1","2","3","4","5","6","7","8","9","#","*","+"].includes(n))return e.preventDefault(),void Ze(n);if(t.startsWith("Numpad")){const n=t.replace("Numpad","");if("Add"===n)return e.preventDefault(),void Ze("+");if("Multiply"===n)return e.preventDefault(),void Ze("*");/^[0-9]$/.test(n)&&(e.preventDefault(),Ze(n))}};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[c,R,et,Qe,Ze,tt,Ue]);const it=t.useCallback(async()=>{if(S)try{await S()}catch(e){console.error("Erro ao encerrar chamada",e),B("Falha ao encerrar chamada.")}},[S]),ot=t.useCallback(async()=>{if(E)try{await E()}catch(e){console.error("Erro ao atender chamada",e),B("Nao foi possivel atender.")}},[E]),at=t.useCallback(async()=>{if(N)try{await N()}catch(e){console.error("Erro ao rejeitar chamada",e),B("Nao foi possivel rejeitar.")}},[N]),st=t.useCallback(async()=>{if(("success"===K?b:x).length)if(X)if("function"==typeof C)try{V(!0),W(null),await Promise.resolve(C({result:K,qualificationId:X}))}catch(e){console.error("Erro ao finalizar pos-chamada",e),W("Falha ao finalizar atendimento. Tente novamente.")}finally{V(!1)}else W("Nao foi possivel enviar a qualificacao.");else W("Selecione uma qualificacao para finalizar.");else W("Nenhuma qualificacao configurada para este resultado.")},[K,x,C,X,b]),dt=t.useCallback(()=>{P(!0)},[]),lt=t.useCallback(e=>{const t=e.relatedTarget;D.current&&t&&D.current.contains(t)||P(!1)},[]),ut=t.useCallback(e=>{e.preventDefault();const t=e.clipboardData.getData("text");if(!t)return;const n=p$(t);i(n),te(n.length),setTimeout(()=>{U.current&&(U.current.focus(),U.current.setSelectionRange(n.length,n.length))},0)},[i]),ct=t.useCallback(e=>{const t=e.target,n=b$(t.value).slice(0,32);B(null),i(n),te(Math.min(t.selectionStart??n.length,n.length))},[i]),ft=t.useCallback((e,t)=>{if(!t)return void e.preventDefault();const n=e.key;return"Enter"===n?(e.preventDefault(),void tt()):/^[0-9*#]$/.test(n)&&m&&(qe||ze)?(e.preventDefault(),void Ze(n)):void(/^[0-9*#+]$/.test(n)?Je(n):1!==n.length||e.ctrlKey||e.metaKey||e.altKey||e.preventDefault())},[tt,Ze,m,qe,ze,Je]),ht=t.useCallback(e=>{const t=e.target.value;ce(t||null)},[]),pt=t.useCallback(e=>{const t=e.target.value;he(t||null)},[]),mt=t.useCallback(e=>{const t=Number.isFinite(e)?e:0,n=Math.min(Math.max(t,0),1);j(Number((n*(("number"==typeof k?k:0)>1?100:1)).toFixed(2)))},[k,j]),gt=p&&"call"in p?p.call:void 0,$t=V$(m)??V$(gt),vt=Pe||ye,yt=(null==$t?void 0:$t.displayName)??(null==$t?void 0:$t.phoneNumber)??("campaign"===(null==g?void 0:g.type)?g.info.campaignContact.phoneNumber:void 0)??((qe||He)&&vt?vt:void 0),bt=function(e){switch(e){case"starting":return"Conectando";case"idle":return"Disponivel";case"manualCallSetup":return"Preparando";case"manualCallRinging":return"Chamando";case"callRinging":return"Recebida";case"callInProgress":return"Em chamada";case"afterCall":return"Finalizando";case"onBreak":return"Em pausa";case"offline":return"Offline";case"error":return"Erro";default:return"Aguardando"}}(Me),xt=De||je,wt=(null==(l=de.inputs.find(e=>e.deviceId===ue))?void 0:l.label)||"Microfone padrao",_t=(null==(u=de.outputs.find(e=>e.deviceId===fe))?void 0:u.label)||"Saida padrao",Ct="number"==typeof k?k:0,St=Ct>1?100:1,Et=Math.min(Math.max(Ct/St,0),1),Nt=Math.round(100*Et),Tt=O?Vc:Et>.65?Gc:Wc,At=T?jc:Rc,Ot=function(e){switch(e){case"idle":return{Icon:Nc,badgeClass:Xh`border-green-200 bg-green-50 text-green-700`,dotClass:Xh`bg-green-500`};case"callInProgress":case"manualCallSetup":case"manualCallRinging":case"callRinging":return{Icon:wc,badgeClass:Xh`border-primary/30 bg-primary/10 text-primary`,dotClass:Xh`bg-primary`};case"onBreak":return{Icon:Dc,badgeClass:Xh`border-amber-200 bg-amber-50 text-amber-700`,dotClass:Xh`bg-amber-500`};case"offline":case"error":return{Icon:Cc,badgeClass:Xh`border-rose-200 bg-rose-50 text-rose-700`,dotClass:Xh`bg-rose-500`};default:return{Icon:Lc,badgeClass:Xh`border-slate-200 bg-slate-50 text-slate-600`,dotClass:Xh`bg-slate-500`}}}(Me);if("afterCall"===Me&&!c)return $.jsx(Z$,{username:e,result:K,onChangeResult:Y,successQualifications:b,discardQualifications:x,selectedQualificationId:X,onSelectQualification:J,onSubmit:st,isSubmitting:G,errorMessage:H,onLogout:o,isMobile:Ae,onClose:s});const It=d?Xh`absolute inset-0 z-50 flex items-center justify-center bg-black/50 p-4`:Xh`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4`,kt=$.jsx("div",{className:It,children:$.jsxs("div",{className:Xh`bg-white rounded-2xl shadow-2xl max-w-md w-full p-6 space-y-4`,children:[$.jsxs("div",{className:Xh`flex items-center justify-between`,children:[$.jsx("h3",{className:Xh`text-lg font-bold text-slate-800`,children:"Selecione uma Pausa"}),$.jsx("button",{type:"button",onClick:()=>{we(!1),Ce(null)},className:Xh`text-slate-400 hover:text-slate-600 transition`,children:$.jsx(Yc,{className:Xh`text-xl`})})]}),_e&&$.jsxs("div",{className:Xh`rounded-lg bg-red-50 border border-red-200 px-3 py-2 flex items-start gap-2`,children:[$.jsx(Cc,{className:Xh`text-red-500 shrink-0 mt-0.5`}),$.jsx("p",{className:Xh`text-sm text-red-700`,children:_e})]}),Oe&&0!==Oe.length?$.jsx("div",{className:Xh`space-y-2 max-h-96 overflow-y-auto`,children:Oe.map(e=>$.jsxs("button",{type:"button",onClick:()=>nt(e.id),className:Xh`w-full flex items-center gap-3 rounded-lg border border-slate-200 bg-white px-4 py-3 text-left transition-all hover:border-amber-300 hover:bg-amber-50 hover:shadow-md`,children:[$.jsx(Dc,{className:Xh`text-xl text-amber-600 shrink-0`}),$.jsxs("div",{className:Xh`flex-1 min-w-0`,children:[$.jsx("p",{className:Xh`font-semibold text-slate-800 truncate`,children:e.name}),$.jsxs("p",{className:Xh`text-xs text-slate-500`,children:["ID: ",e.id]})]})]},e.id))}):$.jsx("div",{className:Xh`text-center py-8`,children:$.jsx("p",{className:Xh`text-slate-500`,children:"Nenhuma pausa disponivel"})}),$.jsx("button",{type:"button",onClick:()=>{we(!1),Ce(null)},className:Xh`w-full rounded-lg border border-slate-200 bg-slate-50 px-4 py-2 text-sm font-semibold text-slate-600 transition hover:bg-slate-100`,children:"Cancelar"})]})}),jt=xe?d?n.createPortal(kt,d):kt:null,Rt=qe||He;if(Ae&&!c){const e=!q&&(Ge||Ue||Fe),t=xt||je||"Digite ou cole um numero";return $.jsxs("div",{ref:D,tabIndex:0,role:"application","aria-label":"Discador mobile",onFocusCapture:dt,onBlurCapture:lt,className:Xh`callix mobile flex min-h-[calc(100vh-3rem)] w-full max-w-full flex-col gap-4 rounded-3xl border border-slate-200 bg-gradient-to-b from-white via-slate-50 to-white p-4 shadow-xl outline-none`,children:[$.jsxs("div",{className:Xh`flex items-center justify-between gap-2`,children:[$.jsxs("button",{type:"button",onClick:()=>{s?s():Qe()},className:Xh`inline-flex items-center gap-2 rounded-full border border-slate-200 bg-white px-3 py-2 text-sm font-semibold text-slate-700 shadow-sm transition hover:border-slate-300 hover:shadow-md`,children:[$.jsx(Sc,{className:Xh`text-base`}),"Voltar"]}),$.jsxs("div",{className:Xh`${Ot.badgeClass} inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-[11px] font-bold`,children:[$.jsx(Ot.Icon,{className:Xh`text-xs`}),$.jsx("span",{children:bt})]}),$.jsxs("button",{type:"button",onClick:Fe?rt:()=>we(!0),className:Xh`inline-flex items-center gap-1.5 rounded-full border ${Fe?"border-green-200 bg-green-50 text-green-700":"border-amber-200 bg-amber-50 text-amber-700"} px-3 py-2 text-sm font-semibold transition hover:shadow-md`,children:[Fe?$.jsx(Nc,{className:Xh`text-sm`}):$.jsx(Dc,{className:Xh`text-sm`}),Fe?"Voltar":"Pausa"]})]}),Rt?$.jsxs("div",{className:Xh`space-y-3`,children:[$.jsx(Q$,{statusLabel:bt,callTarget:yt,durationSeconds:Z}),$.jsx(sm,{})]}):$.jsxs("div",{className:Xh`space-y-2 rounded-2xl border border-slate-200 bg-white px-3 py-3 shadow-inner`,children:[$.jsxs("div",{className:Xh`flex items-center justify-between`,children:[$.jsx("span",{className:Xh`text-[11px] font-semibold uppercase tracking-wide text-slate-500`,children:"Número"}),De&&$.jsx("span",{className:Xh`text-[11px] font-semibold text-primary`,children:De})]}),$.jsxs("div",{className:Xh`flex items-center gap-3`,children:[$.jsx("input",{ref:U,type:"text",inputMode:"tel",value:je,onChange:ct,onClick:e=>te(e.target.selectionStart||0),onKeyUp:e=>te(e.target.selectionStart||0),onSelect:e=>te(e.target.selectionStart||0),onKeyDown:t=>ft(t,e),onPaste:ut,disabled:!e,placeholder:"Digite ou cole um numero",className:Xh`flex-1 bg-transparent text-3xl font-bold text-slate-900 outline-none placeholder:text-slate-300 disabled:opacity-60`}),$.jsxs("div",{className:Xh`flex items-center gap-2`,children:[$.jsx("button",{type:"button",onClick:et,disabled:!e,className:Xh`inline-flex h-10 w-10 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-700 shadow-sm transition hover:border-slate-300 hover:shadow-md disabled:opacity-40`,"aria-label":"Apagar último digito",children:$.jsx(Ac,{className:Xh`text-lg`})}),$.jsx("button",{type:"button",onClick:Qe,disabled:!e,className:Xh`inline-flex h-10 w-10 items-center justify-center rounded-full border border-rose-300 bg-rose-50 text-rose-600 shadow-sm transition hover:border-rose-400 hover:bg-rose-100 hover:shadow-md disabled:opacity-40`,"aria-label":"Limpar número",children:$.jsx(Yc,{className:Xh`text-lg`})})]})]}),$.jsx("p",{className:Xh`text-[11px] font-medium ${Le?"text-primary":"text-slate-500"}`,children:Le?`Será discado: ${Le}`:`Formatação automática: ${t}`})]}),$.jsx("div",{className:Xh`grid grid-cols-3 gap-2`,children:L$.map(t=>$.jsxs("button",{type:"button",onClick:()=>Ze(t.value),disabled:!e,className:Xh`flex h-14 flex-col items-center justify-center rounded-xl border border-slate-200 bg-white text-xl font-bold text-slate-900 shadow-sm transition active:scale-95 hover:border-slate-300 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-40`,children:[$.jsx("span",{children:t.value}),t.detail&&$.jsx("span",{className:Xh`text-[9px] font-semibold uppercase tracking-widest text-slate-400`,children:t.detail})]},t.value))}),$.jsxs("div",{className:Xh`grid grid-cols-3 gap-2`,children:[$.jsxs("button",{type:"button",onClick:()=>A(!T),className:Xh`${T?"border-rose-300 bg-rose-50 text-rose-700":"border-slate-200 bg-white text-slate-700"} flex items-center justify-center gap-2 rounded-xl border px-3 py-2 text-sm font-semibold shadow-sm transition hover:border-slate-300 hover:shadow-md`,children:[$.jsx(At,{className:Xh`text-base`}),T?"Mudo":"Áudio"]}),$.jsxs("button",{type:"button",onClick:()=>I(!O),className:Xh`${O?"border-amber-300 bg-amber-50 text-amber-700":"border-slate-200 bg-white text-slate-700"} flex items-center justify-center gap-2 rounded-xl border px-3 py-2 text-sm font-semibold shadow-sm transition hover:border-slate-300 hover:shadow-md`,children:[$.jsx(Tt,{className:Xh`text-base`}),O?"Saída off":`${Nt}%`]}),$.jsxs("button",{type:"button",onClick:Fe?rt:()=>we(!0),className:Xh`${Fe?"border-green-300 bg-green-50 text-green-700":"border-amber-300 bg-amber-50 text-amber-700"} flex items-center justify-center gap-2 rounded-xl border px-3 py-2 text-sm font-semibold shadow-sm transition hover:shadow-md`,children:[Fe?$.jsx(Nc,{className:Xh`text-base`}):$.jsx(Dc,{className:Xh`text-base`}),Fe?"Voltar":"Pausa"]})]}),$.jsxs("div",{className:Xh`flex flex-wrap items-center gap-2`,children:[Ue||Fe?$.jsxs("button",{type:"button",onClick:tt,disabled:!Ve,className:Xh`flex flex-1 min-w-[8rem] items-center justify-center gap-2 rounded-xl bg-green-500 px-4 py-3 text-base font-bold text-white shadow-lg transition hover:bg-green-600 hover:shadow-xl disabled:cursor-not-allowed disabled:opacity-60`,children:[$.jsx(Fc,{className:Xh`text-lg`}),"Ligar"]}):Be?$.jsxs($.Fragment,{children:[$.jsxs("button",{type:"button",onClick:at,className:Xh`flex flex-1 min-w-[7rem] items-center justify-center gap-2 rounded-xl bg-rose-500 px-4 py-3 text-sm font-bold text-white shadow-lg transition hover:bg-rose-600`,children:[$.jsx(Uc,{className:Xh`text-base`}),"Recusar"]}),$.jsxs("button",{type:"button",onClick:ot,className:Xh`flex flex-1 min-w-[7rem] items-center justify-center gap-2 rounded-xl bg-green-500 px-4 py-3 text-sm font-bold text-white shadow-lg transition hover:bg-green-600`,children:[$.jsx(Mc,{className:Xh`text-base`}),"Atender"]})]}):$.jsxs("button",{type:"button",onClick:it,className:Xh`flex flex-1 min-w-[8rem] items-center justify-center gap-2 rounded-xl bg-rose-500 px-4 py-3 text-base font-bold text-white shadow-lg transition hover:bg-rose-600 hover:shadow-xl`,children:[$.jsx(Uc,{className:Xh`text-lg`}),"Encerrar"]}),$.jsxs("button",{type:"button",onClick:o,className:Xh`inline-flex items-center justify-center gap-2 rounded-xl border border-slate-200 bg-white px-4 py-3 text-sm font-semibold text-slate-700 shadow-sm transition hover:border-red-400 hover:text-red-500`,children:[$.jsx(kc,{className:Xh`text-base`}),"Sair"]})]}),(F||q||pe)&&$.jsxs("div",{className:Xh`space-y-1.5`,children:[F&&$.jsxs("div",{className:Xh`flex items-start gap-2 rounded-xl border border-rose-200 bg-rose-50 px-2.5 py-2 text-[11px] text-rose-700`,children:[$.jsx(Cc,{className:Xh`mt-0.5 text-xs`}),$.jsx("span",{children:F})]}),q&&$.jsxs("div",{className:Xh`flex items-start gap-2 rounded-xl border border-amber-200 bg-amber-50 px-2.5 py-2 text-[11px] text-amber-700`,children:[$.jsx(Cc,{className:Xh`mt-0.5 text-xs`}),$.jsx("span",{children:q})]}),pe&&$.jsxs("div",{className:Xh`flex items-start gap-2 rounded-xl border border-sky-200 bg-sky-50 px-2.5 py-2 text-[11px] text-sky-700`,children:[$.jsx(Cc,{className:Xh`mt-0.5 text-xs`}),$.jsx("span",{children:pe})]})]}),jt]})}if(c){const e=qe||He,t=je.length>0,n=!e&&!t,r=!q&&(Ge||Ue||Fe);if(console.log("[FloatingDialer Mini] Estado:",{miniCanUseKeypad:r,callButtonDisabled:n,hasNumber:t,dialValue:je,isNumberValid:Ve,availabilityError:q,callState:Me,operatorState:null==p?void 0:p.state}),"afterCall"===Me){const e="success"===K?b:x,t=e.length>0;return console.log("[FloatingDialer Mini] ?? TELA DE QUALIFICA��O:",{callState:Me,afterCallResult:K,successQualifications:b.length,discardQualifications:x.length,hasOptions:t,selectedQualificationId:X}),$.jsx("div",{className:["callix","mode","min",Xh`flex w-full max-w-full flex-col gap-1 rounded-xl border border-slate-200 bg-white/95 p-1.5 shadow-sm text-slate-800 overflow-hidden`].join(" "),"data-callix-variant":"min",children:$.jsxs("div",{className:Xh`space-y-1 rounded-lg border border-slate-200 bg-slate-50 px-1.5 py-1 overflow-hidden`,children:[$.jsx("div",{className:Xh`text-center`,children:$.jsx("p",{className:Xh`text-[9px] font-semibold text-slate-700`,children:"Qualifique a chamada"})}),$.jsxs("div",{className:Xh`grid grid-cols-2 gap-0.5`,children:[$.jsx("button",{type:"button",onClick:()=>Y("success"),className:Xh`${"success"===K?"bg-green-500 text-white":"bg-white text-slate-600"} rounded border border-slate-200 px-1 py-0.5 text-[7px] font-semibold transition`,children:"✓ Concluído"}),$.jsx("button",{type:"button",onClick:()=>Y("failure"),className:Xh`${"failure"===K?"bg-rose-500 text-white":"bg-white text-slate-600"} rounded border border-slate-200 px-1 py-0.5 text-[7px] font-semibold transition`,children:"✗ Descartado"})]}),$.jsxs("div",{className:Xh`space-y-0.5`,children:[$.jsx("p",{className:Xh`text-[7px] font-medium text-slate-700 text-center`,children:"Selecione qualificação"}),t?$.jsx("div",{className:Xh`max-h-16 space-y-0.5 overflow-y-auto`,children:e.map(e=>{const t=X===e.id;return $.jsx("button",{type:"button",onClick:()=>J(e.id),className:Xh`${t?"bg-blue-100 border-blue-300 text-blue-800":"border-slate-200 bg-white text-slate-700"} w-full rounded border px-1 py-0.5 text-left transition`,children:$.jsx("p",{className:Xh`text-[7px] font-medium leading-tight truncate`,children:e.name})},e.id)})}):$.jsx("div",{className:Xh`rounded border border-amber-200 bg-amber-50 px-1 py-0.5 text-[7px] text-amber-700 text-center`,children:"Nenhuma qualificação"})]}),H&&$.jsx("p",{className:Xh`text-[7px] text-red-500 text-center`,children:H}),$.jsxs("button",{type:"button",onClick:st,disabled:!t||!X||G,className:Xh`flex w-full items-center justify-center gap-1 rounded bg-blue-500 px-1.5 py-1 text-[7px] font-bold text-white transition hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-60`,children:[G&&$.jsx("span",{className:Xh`inline-flex h-2 w-2 animate-spin rounded-full border border-white/50 border-t-white`}),"Finalizar"]})]})})}return console.log("[FloatingDialer Mini] ?? Estado da Chamada:",{isCallActive:e,callState:Me,statusLabel:bt,isInCall:qe,isConnecting:He,isRinging:ze,callDurationSeconds:Z,callTarget:yt,statusVisualUsed:e?"GREEN (green)":"statusVisual",timerVisible:e&&Z>0}),$.jsxs("div",{className:["callix","mode","min",Xh`flex w-full max-w-full flex-col gap-3 rounded-2xl border border-slate-200 bg-white/95 p-3 shadow-sm text-slate-800`].join(" "),"data-callix-variant":"min",children:[$.jsx("input",{ref:M,type:"tel",inputMode:"tel",value:je,onChange:e=>i(e.target.value),onPaste:ut,className:Xh`sr-only`,tabIndex:-1,"aria-hidden":"true"}),$.jsxs("div",{className:Xh`flex items-center justify-between gap-2`,children:[$.jsxs("div",{className:Xh`${e?"border-green-200 bg-green-50 text-green-700":Ot.badgeClass} flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-semibold uppercase leading-tight`,children:[$.jsx(Ot.Icon,{className:Xh`text-xs`}),$.jsx("span",{children:bt})]}),Fe?$.jsxs("button",{type:"button",onClick:()=>rt(),className:Xh`inline-flex items-center gap-1 rounded-full border border-green-400 bg-green-50 px-2.5 py-1 text-[10px] font-semibold text-green-700 transition hover:bg-green-100`,children:[$.jsx(Nc,{className:Xh`text-xs`}),"Voltar"]}):$.jsxs("button",{type:"button",onClick:()=>we(!0),className:Xh`inline-flex items-center gap-1 rounded-full border border-amber-300 bg-amber-50 px-2.5 py-1 text-[10px] font-semibold text-amber-700 transition hover:bg-amber-100`,children:[$.jsx(Dc,{className:Xh`text-xs`}),"Pausa"]})]}),e?$.jsx("div",{className:Xh`rounded-xl border border-green-200 bg-gradient-to-br from-green-50 to-white px-3 py-2`,children:$.jsxs("div",{className:Xh`flex items-center gap-2`,children:[$.jsx("div",{className:Xh`flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-green-500 ${Z>0?"animate-pulse":""}`,children:$.jsx(Lc,{className:Xh`text-xs text-white`})}),$.jsxs("div",{className:Xh`flex min-w-0 flex-1 flex-col gap-0.5`,children:[$.jsx("span",{className:Xh`truncate font-mono text-sm font-bold text-slate-800`,children:(null==yt?void 0:yt.replace(/^\+55/,""))||"Conectando..."}),$.jsx("span",{className:Xh`text-[9px] font-medium uppercase tracking-wider text-green-600`,children:bt})]}),Z>0&&$.jsxs("div",{className:Xh`flex shrink-0 items-center gap-1 rounded-lg bg-green-500 px-2 py-1`,children:[$.jsx(Tc,{className:Xh`text-[10px] text-white`}),$.jsx("span",{className:Xh`tabular-nums text-xs font-bold text-white`,children:J$(Z)})]})]})}):$.jsxs("div",{className:Xh`space-y-1 rounded-xl border border-slate-200 bg-slate-50 px-3 py-2`,children:[$.jsx("span",{className:Xh`text-[10px] font-semibold uppercase tracking-wide text-slate-500`,children:"Numero"}),$.jsxs("div",{className:Xh`flex items-center gap-2`,children:[$.jsx("input",{ref:U,type:"text",inputMode:"tel",value:je,onChange:ct,onClick:e=>{te(e.target.selectionStart||0)},onKeyUp:e=>{te(e.target.selectionStart||0)},onSelect:e=>{te(e.target.selectionStart||0)},onKeyDown:e=>ft(e,r),onPaste:ut,disabled:!r,placeholder:"Digite ou cole um numero",className:Xh`flex-1 bg-transparent text-sm font-semibold text-slate-800 outline-none placeholder:text-slate-400 placeholder:text-xs placeholder:font-normal disabled:opacity-60 disabled:cursor-not-allowed`}),$.jsx("button",{type:"button",onClick:et,disabled:!r,className:Xh`inline-flex h-8 w-8 items-center justify-center rounded-lg border border-slate-300 bg-white text-slate-600 transition hover:border-slate-400 hover:text-slate-800 disabled:opacity-40 disabled:cursor-not-allowed`,"aria-label":"Apagar ultimo digito",children:$.jsx(Ac,{className:Xh`text-base`})}),$.jsx("button",{type:"button",onClick:Qe,disabled:!r,className:Xh`inline-flex h-8 w-8 items-center justify-center rounded-lg border border-rose-300 bg-rose-50 text-rose-600 transition hover:border-rose-400 hover:bg-rose-100 disabled:opacity-40 disabled:cursor-not-allowed`,"aria-label":"Limpar numero",children:$.jsx(Yc,{className:Xh`text-sm`})})]}),Le&&$.jsxs("p",{className:Xh`text-[10px] font-medium text-primary`,children:["Será discado: ",Le]})]}),$.jsx("div",{className:Xh`grid grid-cols-3 gap-2`,children:L$.map(e=>$.jsxs("button",{type:"button",onClick:()=>Ze(e.value),disabled:!r,className:Xh`flex h-12 flex-col items-center justify-center rounded-lg border border-slate-200 bg-white text-base font-semibold text-slate-800 shadow-sm transition active:scale-95 hover:border-slate-300 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-40`,children:[$.jsx("span",{children:e.value}),e.detail&&$.jsx("span",{className:Xh`text-[8px] font-semibold uppercase tracking-widest text-slate-400`,children:e.detail})]},e.value))}),$.jsxs("button",{type:"button",onClick:()=>{e?it():tt()},disabled:n,className:Xh`${e?"bg-rose-500 hover:bg-rose-600":"bg-green-500 hover:bg-green-600"} flex h-11 w-full items-center justify-center gap-2 rounded-xl text-sm font-bold text-white shadow-md transition disabled:cursor-not-allowed disabled:opacity-60`,children:[$.jsx(Fc,{className:Xh`text-base`}),e?"Encerrar":"Ligar"]}),(F||q||pe)&&$.jsxs("div",{className:Xh`rounded-lg border border-rose-200 bg-rose-50 px-2.5 py-2 text-[11px] text-rose-700`,children:[$.jsx(Cc,{className:Xh`mr-1 inline text-xs`}),F||q||pe]}),jt]})}return $.jsxs("div",{ref:D,tabIndex:0,role:"application","aria-label":"Discador manual",onFocusCapture:dt,onBlurCapture:lt,className:Xh`space-y-3 rounded-2xl outline-none`,children:[$.jsxs("div",{className:Xh`flex items-center justify-between gap-2`,children:[$.jsxs("div",{className:Xh`flex items-center gap-2 min-w-0 flex-1`,children:[$.jsx("span",{className:Xh`inline-flex h-8 w-8 items-center justify-center rounded-lg bg-primary/10 text-primary shrink-0`,children:$.jsx(Hc,{className:Xh`text-sm`})}),$.jsxs("div",{className:Xh`min-w-0 flex-1`,children:[$.jsx("p",{className:Xh`text-sm font-bold text-slate-800 truncate`,children:e}),$.jsx("p",{className:Xh`text-[9px] uppercase tracking-wide text-slate-500 font-medium`,children:"Operador"})]})]}),$.jsxs("div",{className:Xh`flex items-center gap-2 shrink-0`,children:[Ue&&$.jsxs("button",{type:"button",onClick:()=>we(!0),className:Xh`inline-flex items-center gap-1 rounded-lg border border-amber-300 bg-amber-50 px-2 py-1 text-[10px] font-bold text-amber-700 transition-all hover:bg-amber-100 hover:shadow-sm`,"aria-label":"Entrar em pausa",children:[$.jsx(Dc,{className:Xh`text-xs`}),$.jsx("span",{children:"Pausa"})]}),Fe&&$.jsxs("button",{type:"button",onClick:rt,className:Xh`inline-flex items-center gap-1 rounded-lg border border-green-300 bg-green-50 px-2 py-1 text-[10px] font-bold text-green-700 transition-all hover:bg-green-100 hover:shadow-sm`,"aria-label":"Sair da pausa",children:[$.jsx(Nc,{className:Xh`text-xs`}),$.jsx("span",{children:"Voltar"})]}),$.jsxs("div",{className:Xh`${Ot.badgeClass} inline-flex items-center gap-1.5 rounded-lg border px-2 py-1 text-[10px] font-bold ${qe?"animate-pulse":""}`,children:[$.jsx(Ot.Icon,{className:Xh`text-xs`}),$.jsx("span",{children:bt}),$.jsx("span",{className:Xh`${Ot.dotClass} inline-flex h-1.5 w-1.5 rounded-full`,"aria-hidden":!0})]})]})]}),Rt&&$.jsxs($.Fragment,{children:[$.jsx(Q$,{statusLabel:bt,callTarget:yt,durationSeconds:Z}),$.jsx(sm,{})]}),!Rt&&$.jsxs("div",{ref:L,className:Xh`${R?"ring-2 ring-primary/50 shadow-lg":"shadow-sm"} relative overflow-hidden rounded-xl border border-slate-200 bg-gradient-to-br from-white to-slate-50 px-4 py-3 transition-all hover:shadow-md`,onClick:()=>{var e;return null==(e=D.current)?void 0:e.focus()},children:[$.jsx("input",{ref:M,id:"dialer-number",type:"tel",inputMode:"tel",value:je,onChange:e=>i(e.target.value),onPaste:ut,className:Xh`sr-only`,tabIndex:-1,"aria-hidden":"true"}),$.jsxs("div",{className:Xh`flex items-center justify-between mb-2`,children:[$.jsxs("div",{className:Xh`flex items-center gap-1.5`,children:[$.jsx(Fc,{className:Xh`text-sm text-primary`}),$.jsx("span",{className:Xh`text-[10px] uppercase tracking-wider text-slate-500 font-semibold`,children:"N�mero"})]}),R&&$.jsxs("span",{className:Xh`inline-flex items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-[9px] font-semibold text-primary`,children:[$.jsx("span",{className:Xh`inline-block h-1.5 w-1.5 rounded-full bg-primary animate-pulse`}),"Ativo"]})]}),$.jsx("div",{className:Xh`min-h-[2.5rem] flex items-center`,children:$.jsx("p",{className:Xh`text-2xl font-semibold tabular-nums tracking-tight text-slate-800 flex-1 truncate`,children:xt||$.jsx("span",{className:Xh`text-slate-400 text-lg font-normal`,children:"Digite um n�mero"})})}),Le&&$.jsxs("p",{className:Xh`mt-1 text-[11px] font-medium text-primary`,children:["Será discado: ",Le]})]}),$.jsx("div",{className:Xh`grid grid-cols-3 gap-2`,children:L$.map(e=>$.jsxs("button",{type:"button",onClick:()=>Ze(e.value),disabled:!Ge,className:Xh`relative flex h-14 flex-col items-center justify-center rounded-lg border border-slate-200 bg-gradient-to-b from-white to-slate-50 text-lg font-bold text-slate-800 shadow-sm transition-all active:scale-95 hover:border-slate-300 hover:shadow-md outline-none disabled:cursor-not-allowed disabled:opacity-40`,children:[$.jsx("span",{children:e.value}),e.detail&&$.jsx("span",{className:Xh`text-[8px] font-semibold tracking-widest text-slate-400 uppercase`,children:e.detail})]},e.value))}),$.jsxs("div",{className:Xh`space-y-2`,children:[$.jsxs("div",{className:Xh`flex flex-wrap items-center gap-2`,children:[Ue||Fe?$.jsxs("button",{type:"button",onClick:tt,disabled:!Ve,className:Xh`flex flex-1 min-w-[7rem] items-center justify-center gap-2 rounded-lg bg-green-500 px-4 py-2.5 text-sm font-bold text-white shadow-lg transition-all hover:bg-green-600 hover:shadow-xl disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:shadow-lg`,children:[$.jsx(Fc,{className:Xh`text-base`}),"Ligar"]}):Be?$.jsxs($.Fragment,{children:[$.jsxs("button",{type:"button",onClick:at,className:Xh`flex flex-1 min-w-[6rem] items-center justify-center gap-1.5 rounded-lg bg-rose-500 px-3 py-2 text-xs font-bold text-white shadow-md transition-all hover:bg-rose-600 hover:shadow-lg`,children:[$.jsx(Uc,{className:Xh`text-sm`}),"Recusar"]}),$.jsxs("button",{type:"button",onClick:ot,className:Xh`flex flex-1 min-w-[6rem] items-center justify-center gap-1.5 rounded-lg bg-green-500 px-3 py-2 text-xs font-bold text-white shadow-md transition-all hover:bg-green-600 hover:shadow-lg`,children:[$.jsx(Mc,{className:Xh`text-sm`}),"Atender"]})]}):$.jsxs("button",{type:"button",onClick:it,className:Xh`flex flex-1 min-w-[7rem] items-center justify-center gap-2 rounded-lg bg-rose-500 px-4 py-2.5 text-sm font-bold text-white shadow-lg transition-all hover:bg-rose-600 hover:shadow-xl`,children:[$.jsx(Uc,{className:Xh`text-base`}),"Encerrar"]}),$.jsxs("button",{type:"button",onClick:()=>A(!T),className:Xh`${T?"border-rose-300 bg-rose-50 text-rose-600":"border-slate-300 bg-white text-slate-700"} flex h-9 min-w-[4.5rem] flex-1 items-center justify-center gap-1 rounded-lg border px-2 py-1.5 text-[10px] font-bold transition-all hover:border-slate-400 hover:shadow-md disabled:cursor-not-allowed`,children:[$.jsx(At,{className:Xh`text-xs`}),T?"Mudo":"Mic"]}),$.jsxs("button",{type:"button",onClick:()=>I(!O),className:Xh`${O?"border-amber-300 bg-amber-50 text-amber-700":"border-slate-300 bg-white text-slate-700"} flex h-9 min-w-[4.5rem] flex-1 items-center justify-center gap-1 rounded-lg border px-2 py-1.5 text-[10px] font-bold transition-all hover:border-slate-400 hover:shadow-md`,children:[$.jsx(Tt,{className:Xh`text-xs`}),O?"Mudo":`${Nt}%`]}),$.jsx("button",{type:"button",onClick:et,className:Xh`flex h-9 w-9 items-center justify-center rounded-lg border border-slate-300 bg-white text-slate-700 transition-all hover:border-slate-400 hover:shadow-md`,"aria-label":"Apagar ultimo digito",children:$.jsx(Ac,{className:Xh`text-base`})}),$.jsx("button",{type:"button",onClick:Qe,className:Xh`flex h-9 w-9 items-center justify-center rounded-lg border border-rose-300 bg-rose-50 text-rose-700 font-bold text-xs transition-all hover:border-rose-400 hover:bg-rose-100 hover:shadow-md active:bg-rose-200`,"aria-label":"Limpar numero",children:"C"})]}),$.jsxs("div",{className:Xh`rounded-xl border border-slate-200 bg-white/80 p-3 shadow-sm`,children:[$.jsxs("div",{className:Xh`flex flex-wrap items-center justify-between gap-2`,children:[$.jsxs("div",{children:[$.jsx("p",{className:Xh`text-[10px] uppercase tracking-wide text-slate-500`,children:"Volume"}),$.jsxs("p",{className:Xh`text-sm font-semibold text-slate-800`,children:["Sa�da ",Nt,"%"]})]}),$.jsxs("div",{className:Xh`flex items-center gap-2`,children:[$.jsx("button",{type:"button",onClick:()=>mt((k??0)-.05),className:Xh`inline-flex h-8 w-8 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-600 transition hover:border-primary/60 hover:text-primary`,"aria-label":"Diminuir volume",children:$.jsx(Pc,{className:Xh`text-sm`})}),$.jsx("input",{type:"range",min:0,max:1,step:.01,value:Number.isFinite(k)?k:0,onChange:e=>mt(parseFloat(e.target.value)),className:Xh`h-1 w-full max-w-full cursor-pointer appearance-none rounded-full bg-slate-200 accent-primary`,"aria-label":"Volume de saida"}),$.jsx("button",{type:"button",onClick:()=>mt((k??0)+.05),className:Xh`inline-flex h-8 w-8 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-600 transition hover:border-primary/60 hover:text-primary`,"aria-label":"Aumentar volume",children:$.jsx(Bc,{className:Xh`text-sm`})})]})]}),$.jsxs("div",{className:Xh`mt-2 flex flex-wrap items-center gap-2 text-xs text-slate-600`,children:[$.jsxs("div",{className:Xh`flex items-center gap-1.5`,children:[$.jsx(Rc,{className:Xh`text-sm text-primary`}),$.jsx("span",{className:Xh`truncate max-w-full`,children:wt})]}),$.jsxs("div",{className:Xh`flex items-center gap-1.5`,children:[$.jsx(Ic,{className:Xh`text-sm text-primary`}),$.jsx("span",{className:Xh`truncate max-w-full`,children:_t})]}),(de.inputs.length>0||de.outputs.length>0)&&$.jsxs("button",{type:"button",onClick:()=>$e(e=>!e),className:Xh`inline-flex items-center gap-1 rounded-md border border-slate-300 bg-white px-2 py-0.5 text-[9px] font-bold text-slate-700 transition-all hover:border-slate-400 hover:shadow-sm`,children:[$.jsx(qc,{className:Xh`text-[10px]`}),ge?"Ocultar":"Config"]})]}),ge&&$.jsxs("div",{className:Xh`mt-3 grid gap-2`,children:[$.jsxs("label",{className:Xh`space-y-1 text-xs text-slate-700`,children:[$.jsxs("span",{className:Xh`flex items-center gap-1.5 font-semibold`,children:[$.jsx(Rc,{className:Xh`text-sm text-primary`}),"Entrada"]}),$.jsxs("select",{className:Xh`w-full rounded-lg border border-slate-200 bg-white px-2.5 py-1.5 text-xs shadow-inner focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/40`,value:ue??"",onChange:ht,children:[0===de.inputs.length&&$.jsx("option",{value:"",children:"Padr�o"}),de.inputs.map(e=>$.jsx("option",{value:e.deviceId,children:e.label||"Padr�o"},e.deviceId||e.label))]})]}),$.jsxs("label",{className:Xh`space-y-1 text-xs text-slate-700`,children:[$.jsxs("span",{className:Xh`flex items-center gap-1.5 font-semibold`,children:[$.jsx(Ic,{className:Xh`text-sm text-primary`}),"Sa�da"]}),$.jsxs("select",{className:Xh`w-full rounded-lg border border-slate-200 bg-white px-2.5 py-1.5 text-xs shadow-inner focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/40`,value:fe??"",onChange:pt,children:[0===de.outputs.length&&$.jsx("option",{value:"",children:"Padr�o"}),de.outputs.map(e=>$.jsx("option",{value:e.deviceId,children:e.label||"Padr�o"},e.deviceId||e.label))]})]})]})]})]}),(F||q||pe)&&$.jsxs("div",{className:Xh`space-y-1.5`,children:[F&&$.jsxs("div",{className:Xh`flex items-start gap-2 rounded-xl border border-rose-200 bg-rose-50 px-2.5 py-2 text-[11px] text-rose-700`,children:[$.jsx(Cc,{className:Xh`mt-0.5 text-xs`}),$.jsx("span",{children:F})]}),q&&$.jsxs("div",{className:Xh`flex items-start gap-2 rounded-xl border border-amber-200 bg-amber-50 px-2.5 py-2 text-[11px] text-amber-700`,children:[$.jsx(Cc,{className:Xh`mt-0.5 text-xs`}),$.jsx("span",{children:q})]}),pe&&$.jsxs("div",{className:Xh`flex items-start gap-2 rounded-xl border border-sky-200 bg-sky-50 px-2.5 py-2 text-[11px] text-sky-700`,children:[$.jsx(Cc,{className:Xh`mt-0.5 text-xs`}),$.jsx("span",{children:pe})]})]}),jt,$.jsxs("button",{type:"button",onClick:o,className:Xh`flex w-full items-center justify-center gap-2 rounded-2xl border border-slate-200 bg-white px-4 py-3 text-sm font-semibold text-slate-600 transition hover:border-red-400 hover:text-red-500`,children:[$.jsx(kc,{className:Xh`text-base`}),"Sair"]})]})}function W$(e,t){const n=function(e){return e&&"object"==typeof e?e:null}(e);if(n&&t in n)return n[t]}function G$(e,t){const n=W$(e,t);return"function"==typeof n?n:void 0}function V$(e){const t=W$(e,"counterpart");return function(e){if(!e||"object"!=typeof e)return!1;const t=e,n=t.displayName,r=t.phoneNumber;return!(null!=n&&"string"!=typeof n||null!=r&&"string"!=typeof r)}(t)?t:null}function K$(e,t){const n=e[t];if("number"==typeof n&&Number.isFinite(n))return n;if("string"==typeof n){const e=Number(n);if(Number.isFinite(e))return e}return null}const Y$={1:[1209,697],2:[1336,697],3:[1477,697],4:[1209,770],5:[1336,770],6:[1477,770],7:[1209,852],8:[1336,852],9:[1477,852],"*":[1209,941],0:[1336,941],"#":[1477,941]};function X$(e,t,n){return Number.isFinite(e)?n<t?t:Math.min(Math.max(e,t),n):t}function J$(e){const t=Math.max(0,Math.floor(e));return`${Math.floor(t/60).toString().padStart(2,"0")}:${(t%60).toString().padStart(2,"0")}`}function Z$({username:e,result:t,onChangeResult:n,successQualifications:r,discardQualifications:i,selectedQualificationId:o,onSelectQualification:a,onSubmit:s,isSubmitting:d,errorMessage:l,onLogout:u,isMobile:c=!1,onClose:f}){const h="success"===t?r:i,p=h.length>0;return $.jsxs("div",{className:Xh`${c?"min-h-[70vh] rounded-3xl border border-slate-200 bg-white p-4 shadow-xl":"space-y-5"}`,children:[$.jsxs("div",{className:Xh`mb-3 flex items-center justify-between`,children:[$.jsx("p",{className:Xh`text-xs uppercase tracking-wide text-slate-500`,children:"Logado como"}),f&&$.jsxs("button",{type:"button",onClick:f,className:Xh`inline-flex items-center gap-1 rounded-full border border-slate-200 bg-slate-50 px-3 py-1 text-xs font-semibold text-slate-600 transition hover:border-slate-300`,children:[$.jsx(Sc,{className:Xh`text-xs`}),"Voltar"]})]}),$.jsx("div",{className:Xh`${c?"space-y-3":"space-y-1"}`,children:$.jsx("p",{className:Xh`text-sm font-semibold text-slate-800`,children:e})}),$.jsxs("div",{className:Xh`space-y-4 rounded-2xl border border-slate-200 bg-slate-50 px-4 py-5 ${c?"shadow-inner":""}`,children:[$.jsxs("div",{children:[$.jsx("p",{className:Xh`text-sm font-semibold text-slate-700`,children:"Qualifique a chamada"}),$.jsx("p",{className:Xh`text-xs text-slate-500`,children:"Esta etapa e obrigatoria para registrar o desfecho do atendimento."})]}),$.jsxs("div",{className:Xh`${c?"grid grid-cols-1 gap-2":"grid grid-cols-2 gap-2"}`,children:[$.jsx("button",{type:"button",onClick:()=>n("success"),className:Xh`${"success"===t?"bg-green-500 text-white shadow-lg":"bg-white text-slate-600"} rounded-xl border border-slate-200 px-3 py-3 text-sm font-semibold transition hover:border-green-400`,children:"Atendimento concluido"}),$.jsx("button",{type:"button",onClick:()=>n("failure"),className:Xh`${"failure"===t?"bg-rose-500 text-white shadow-lg":"bg-white text-slate-600"} rounded-xl border border-slate-200 px-3 py-3 text-sm font-semibold transition hover:border-rose-400`,children:"Atendimento descartado"})]}),$.jsxs("div",{className:Xh`space-y-2`,children:[$.jsx("p",{className:Xh`text-sm font-medium text-slate-700`,children:"Selecione uma qualificacao"}),p?$.jsx("div",{className:Xh`${c?"max-h-64":"max-h-52"} space-y-2 overflow-y-auto pr-1`,children:h.map(e=>{const t=o===e.id;return $.jsx("button",{type:"button",onClick:()=>a(e.id),className:Xh`${t?"ring-2 ring-primary bg-primary/5 border-primary":"border-slate-200 bg-white"} w-full rounded-xl border px-3 py-3 text-left text-sm font-semibold transition hover:border-primary`,children:$.jsx("p",{className:Xh`text-sm font-semibold text-slate-800`,children:e.name})},e.id)})}):$.jsx("div",{className:Xh`rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-700`,children:"Nenhuma qualificacao disponivel para este tipo de resultado."})]}),l&&$.jsx("p",{className:Xh`text-xs text-red-500`,children:l}),$.jsxs("button",{type:"button",onClick:s,disabled:!p||!o||d,className:Xh`flex w-full items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2 text-sm font-semibold text-white shadow-lg transition hover:bg-primaryDark disabled:cursor-not-allowed disabled:opacity-60`,children:[d&&$.jsx("span",{className:Xh`inline-flex h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white`}),"Finalizar atendimento"]})]}),$.jsxs("button",{type:"button",onClick:u,className:Xh`flex w-full items-center justify-center gap-2 rounded-xl border border-slate-200 bg-white px-4 py-2 text-sm font-semibold text-slate-600 transition hover:border-red-400 hover:text-red-500`,children:[$.jsx(kc,{className:Xh`text-base`}),"Sair"]})]})}function Q$({statusLabel:e,callTarget:t,durationSeconds:n}){const r=n>0?J$(n):"00:00",i=(null==t?void 0:t.replace(/^\+55/,""))||"Conectando...";return $.jsx("div",{className:Xh`rounded-lg border border-green-200 bg-gradient-to-br from-green-50 to-white px-3 py-2`,children:$.jsxs("div",{className:Xh`flex items-center justify-between gap-3`,children:[$.jsxs("div",{className:Xh`flex items-center gap-2.5 min-w-0 flex-1`,children:[$.jsx("div",{className:Xh`flex items-center justify-center w-8 h-8 rounded-full bg-green-500 shrink-0 ${n>0?"animate-pulse":""}`,children:$.jsx(Lc,{className:Xh`text-sm text-white`})}),$.jsxs("div",{className:Xh`flex flex-col gap-0.5 min-w-0 flex-1`,children:[$.jsx("span",{className:Xh`text-base font-bold text-slate-800 truncate font-mono`,children:i}),$.jsx("span",{className:Xh`text-[9px] font-medium text-green-600 uppercase tracking-wider`,children:e})]})]}),n>0&&$.jsxs("div",{className:Xh`flex items-center gap-1.5 bg-green-500 rounded-lg px-2.5 py-1.5 shrink-0`,children:[$.jsx(Tc,{className:Xh`text-xs text-white`}),$.jsx("span",{className:Xh`text-sm font-bold tabular-nums text-white`,children:r})]})]})})}const ev=/[0-9*#]/;function tv(e){return(e??"").replace(/[^0-9*#]/g,"")}function nv(e,t){if(t<=0){const t=e.search(ev);return t<0?e.length:t}let n=0;for(let r=0;r<e.length;r++)if(ev.test(e[r])&&(n++,n===t))return r+1;return e.length}const rv=t.forwardRef(function({value:e,onChange:n,onSubmit:r,onKeyDown:i,inputMode:o="tel",autoComplete:a="off",...s},d){const l=t.useRef(null),u=t.useRef(null),c=m$(e),f=t.useRef(c),h=t.useCallback(e=>{l.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]);t.useLayoutEffect(()=>{f.current=c;const e=l.current,t=u.current;if(!e||null===t)return;if(u.current=null,"undefined"!=typeof document&&document.activeElement!==e)return;const n=nv(c,t);try{e.setSelectionRange(n,n)}catch{}},[c]);const p=t.useCallback(e=>{var t;const r=e.target,i=r.value,o=r.selectionStart??i.length,a=f.current,s=tv(a),d=(null==(t=e.nativeEvent)?void 0:t.inputType)??"";let l=function(e){let t=0;for(const n of e)ev.test(n)&&t++;return t}(i.slice(0,o)),c=tv(i);if(c===s&&i.length<a.length&&("deleteContentForward"===d?l<c.length&&(c=c.slice(0,l)+c.slice(l+1)):l>0&&(c=c.slice(0,l-1)+c.slice(l),l-=1)),c===s){r.value=a;const e=nv(a,l);try{r.setSelectionRange(e,e)}catch{}return}u.current=l,n(c)},[n]),m=t.useCallback(e=>{var t;const r=(null==(t=e.clipboardData)?void 0:t.getData("text"))??"";if(!r)return;e.preventDefault();const i=p$(r);i&&(u.current=i.length,n(i))},[n]),g=t.useCallback(e=>{null==i||i(e),e.defaultPrevented||"Enter"===e.key&&r&&(e.preventDefault(),r())},[i,r]);return $.jsx("input",{ref:h,type:"tel",inputMode:o,autoComplete:a,value:c,onChange:p,onPaste:m,onKeyDown:g,...s})});function iv(e,t="America/Sao_Paulo"){const n=function(e,t){const n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}),r={};for(const o of n.formatToParts(e))"literal"!==o.type&&(r[o.type]=o.value);const i="24"===r.hour?"00":r.hour;return{year:r.year,month:r.month,day:r.day,hour:i,minute:r.minute,second:r.second}}(e,t);return`${n.year}-${n.month}-${n.day}`}function ov(e,t,n=new Date){if(e===iv(n))return"Hoje";return e===iv(new Date(n.getTime()-864e5))?"Ontem":t}function av(e){const t=s$(e.phoneNumber);return!t.startsWith("55")||12!==t.length&&13!==t.length?t:t.slice(2)}function sv(e){return(e??"").toString().normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/\s+/g," ").trim()}function dv(e){const t=(e??"").trim();if(!t)return{kind:"empty",digits:"",text:""};const n=s$(t),r=t.replace(/[\d\s()+\-.]/g,"");return n.length>=3&&0===r.length?{kind:"phone",digits:n,text:sv(t)}:{kind:"text",digits:n,text:sv(t)}}function lv(e,t){if("empty"===t.kind)return!0;if("phone"===t.kind)return av(e).includes(t.digits)||s$(e.phoneNumber).includes(t.digits)||void 0!==e.protocol&&String(e.protocol).includes(t.digits);const n=function(e){const t=[e.formattedPhone,av(e),e.callTypeLabel,e.campaignName,e.contactLabel,e.qualificationName,e.failureCauseLabel,e.hangupCauseLabel,e.formattedDate,e.note,void 0!==e.protocol?String(e.protocol):void 0];if(e.fields)for(const n of Object.values(e.fields))null!=n&&t.push(String(n));return sv(t.filter(Boolean).join(" | "))}(e);return t.text.split(" ").filter(Boolean).every(e=>n.includes(e))}const uv=1,cv=2,fv=3,hv={manual:"Chamadas manuais",campaign:"Chamadas de campanha"},pv={audio:"Áudios (zip)",data:"Dados (planilha)"},mv=e=>new Intl.DateTimeFormat("en-CA",{timeZone:"America/Sao_Paulo",year:"numeric",month:"2-digit",day:"2-digit"}).format(e);function gv(e){const t=`${e.kind?hv[e.kind]:"Exportação"} · ${e.content?pv[e.content].toLowerCase():""}`.replace(/ · $/,"");return e.status===fv?`${t}: pronta${e.fileSize?` (${n=e.fileSize,!n||n<=0?"":n<1048576?`${Math.max(1,Math.round(n/1024))} KB`:`${(n/1024/1024).toFixed(1)} MB`})`:""}`:e.status===cv?`${t}: processando${e.progress?` ${e.progress}%`:""}`:e.status===uv?`${t}: na fila do Callix`:`${t}: ${e.statusLabel}`;var n}async function $v(e,t){const n=await e.json().catch(()=>null);return"string"==typeof(null==n?void 0:n.error)&&n.error?n.error:t}async function vv(e,t,n){const r=await fetch(`${e}/api/call-exports/${encodeURIComponent(n)}/download`,{method:"GET",headers:t,credentials:"omit"}),i=await r.json().catch(()=>null);return r.ok&&(null==i?void 0:i.url)&&i.export?{state:"ready",url:i.url,filename:i.filename??null,fileSize:i.fileSize??null,export:i.export}:409===r.status&&(null==i?void 0:i.export)?i.export.status<=fv?{state:"pending",export:i.export}:{state:"failed",message:i.error??`Exportação ${i.export.statusLabel}`,export:i.export}:{state:"failed",message:(null==i?void 0:i.error)??`Não foi possível consultar a exportação (${r.status})`,export:null==i?void 0:i.export}}function yv({apiBaseUrl:e,getAuthHeaders:n,onClose:r,pollIntervalMs:i=5e3}){const[o]=t.useState(()=>function(e=new Date){return{from:mv(new Date(e.getTime()-2592e6)),to:mv(e)}}()),[a,s]=t.useState("manual"),[d,l]=t.useState("audio"),[u,c]=t.useState(o.from),[f,h]=t.useState(o.to),[p,m]=t.useState(!1),[g,v]=t.useState(null),[y,b]=t.useState(null),[x,w]=t.useState(null),[_,C]=t.useState([]),[S,E]=t.useState(null),N=t.useRef(!0);t.useEffect(()=>(N.current=!0,()=>{N.current=!1}),[]),t.useEffect(()=>{let t=!0;return async function(e,t){const n=await fetch(`${e}/api/call-exports`,{method:"GET",headers:t,credentials:"omit"});if(!n.ok)throw new Error(await $v(n,`Não foi possível listar as exportações (${n.status})`));return(await n.json()).items??[]}(e,n()).then(e=>{t&&C(e.slice(0,3))}).catch(()=>{}),()=>{t=!1}},[e,n]),t.useEffect(()=>{if(!y||"ready"===(null==x?void 0:x.state)||"failed"===(null==x?void 0:x.state))return;let t=null,r=!0;const o=async()=>{const a=await vv(e,n(),y.id);r&&(w(a),"pending"===a.state?(b(a.export),t=setTimeout(o,i)):"ready"===a.state&&(b(a.export),C(e=>[a.export,...e.filter(e=>e.id!==a.export.id)].slice(0,3))))};return o(),()=>{r=!1,t&&clearTimeout(t)}},[null==y?void 0:y.id,e,n,i]);const T=t.useCallback(async()=>{if(v(null),u&&f)if(f<u)v("O fim do período vem antes do início.");else{m(!0),w(null);try{const t=await async function(e,t,n){const r=await fetch(`${e}/api/call-exports`,{method:"POST",headers:{"Content-Type":"application/json",...t},credentials:"omit",body:JSON.stringify(n)});if(!r.ok)throw new Error(await $v(r,`Não foi possível pedir a exportação (${r.status})`));return(await r.json()).export}(e,n(),{kind:a,content:d,from:u,to:f});if(!N.current)return;b(t),C(e=>[t,...e.filter(e=>e.id!==t.id)].slice(0,3))}catch(t){N.current&&v(t instanceof Error?t.message:"Não foi possível pedir a exportação.")}finally{N.current&&m(!1)}}else v("Informe o período.")},[e,n,a,d,u,f]),A=t.useCallback(async t=>{E(t.id),v(null);try{const r=await vv(e,n(),t.id);if(!N.current)return;"ready"===r.state?window.open(r.url,"_blank","noopener,noreferrer"):v("pending"===r.state?gv(r.export):r.message)}finally{N.current&&E(null)}},[e,n]);return $.jsxs("div",{className:"export-panel",role:"region","aria-label":"Exportar histórico",children:[$.jsxs("div",{className:"export-panel-header",children:[$.jsx("span",{className:"export-panel-title",children:"Exportar histórico"}),$.jsx("button",{type:"button",className:"export-panel-close",onClick:r,"aria-label":"Fechar exportação",children:$.jsx("i",{className:"fas fa-xmark","aria-hidden":"true"})})]}),$.jsxs("div",{className:"export-panel-form",children:[$.jsxs("label",{className:"export-panel-field",children:[$.jsx("span",{children:"Tipo"}),$.jsx("select",{value:a,onChange:e=>s(e.target.value),"aria-label":"Tipo de chamada",children:Object.keys(hv).map(e=>$.jsx("option",{value:e,children:hv[e]},e))})]}),$.jsxs("label",{className:"export-panel-field",children:[$.jsx("span",{children:"Conteúdo"}),$.jsx("select",{value:d,onChange:e=>l(e.target.value),"aria-label":"Conteúdo",children:Object.keys(pv).map(e=>$.jsx("option",{value:e,children:pv[e]},e))})]}),$.jsxs("label",{className:"export-panel-field",children:[$.jsx("span",{children:"De"}),$.jsx("input",{type:"date",value:u,max:f,onChange:e=>c(e.target.value),"aria-label":"Início do período"})]}),$.jsxs("label",{className:"export-panel-field",children:[$.jsx("span",{children:"Até"}),$.jsx("input",{type:"date",value:f,min:u,onChange:e=>h(e.target.value),"aria-label":"Fim do período"})]}),$.jsx("button",{type:"button",className:"retry-btn export-panel-submit",onClick:()=>{T()},disabled:p,children:p?"Pedindo...":"Exportar"})]}),g&&$.jsx("div",{className:"export-panel-error",role:"alert",children:g}),y&&$.jsxs("div",{className:"export-panel-job",role:"status",children:[$.jsx("span",{children:"failed"===(null==x?void 0:x.state)?x.message:gv(y)}),"ready"===(null==x?void 0:x.state)&&$.jsxs("a",{className:"export-panel-link",href:x.url,target:"_blank",rel:"noopener noreferrer",children:[$.jsx("i",{className:"fas fa-download","aria-hidden":"true"})," Baixar ",x.filename??"arquivo"]})]}),_.length>0&&$.jsx("ul",{className:"export-panel-recent","aria-label":"Exportações recentes",children:_.map(e=>$.jsxs("li",{children:[$.jsx("span",{children:gv(e)}),e.status===fv&&$.jsx("button",{type:"button",className:"export-panel-recent-btn",onClick:()=>{A(e)},disabled:S===e.id,children:S===e.id?"...":"Baixar"})]},e.id))}),$.jsx("p",{className:"export-panel-hint",children:"O Callix prepara o arquivo em alguns minutos; o link de download vale por cerca de uma hora."})]})}function bv(){return $.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[$.jsx("line",{x1:"7",y1:"17",x2:"17",y2:"7"}),$.jsx("polyline",{points:"7 7 17 7 17 17"})]})}function xv(){return $.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[$.jsx("line",{x1:"17",y1:"7",x2:"7",y2:"17"}),$.jsx("polyline",{points:"17 17 7 17 7 7"})]})}function wv({state:e,onRetry:n,autoPlay:r}){const i=t.useRef(null),o="ready"===(null==e?void 0:e.status)?e.url:void 0;return t.useEffect(()=>{const e=i.current;if(r&&o&&e&&"function"==typeof e.play)try{const t=e.play();t&&"function"==typeof t.catch&&t.catch(()=>{})}catch{}},[r,o]),e&&"loading"!==e.status?"error"===e.status?$.jsxs("div",{className:"history-player error",role:"alert",children:[$.jsx("i",{className:"fas fa-circle-exclamation","aria-hidden":"true"}),$.jsx("span",{children:e.error||"Erro ao carregar gravação"}),$.jsx("button",{type:"button",className:"retry-link",onClick:n,children:"Tentar novamente"})]}):$.jsx("div",{className:"history-player",children:$.jsx("audio",{ref:i,controls:!0,preload:"metadata",src:e.url,"aria-label":"Gravação da chamada"})}):$.jsxs("div",{className:"history-player loading",role:"status",children:[$.jsx("i",{className:"fas fa-spinner fa-spin","aria-hidden":"true"}),$.jsx("span",{children:"Carregando gravação..."})]})}function _v({item:e,dayLabel:t,isPlayerOpen:n,recording:r,onTogglePlayer:i,onRetryRecording:o,onOpenDetails:a,onCall:s,onWhatsApp:d}){const l=e.wasAnswered?"":"missed",u=e=>e.stopPropagation(),c=!(!(f=e.qualificationName)||"chamada sem qualificação"===f.trim().toLowerCase());var f;let h=null;return e.wasAnswered?"campaign"===e.callType?h=$.jsxs("span",{className:"history-item-sub campaign "+(c?"with-qualification":""),children:[$.jsx("span",{className:"history-campaign-name",title:e.campaignName,children:e.campaignName||"Campanha"}),c&&$.jsxs($.Fragment,{children:[$.jsx("span",{className:"history-meta-dot",children:"•"}),$.jsx("span",{className:"history-qualification",title:e.qualificationName,children:e.qualificationName})]})]}):c&&(h=$.jsx("span",{className:"history-item-sub",children:$.jsx("span",{className:"history-qualification",title:e.qualificationName,children:e.qualificationName})})):h=$.jsxs("span",{className:"history-item-sub failure",children:[$.jsx("i",{className:"fas fa-circle-exclamation","aria-hidden":"true"}),$.jsx("span",{children:e.failureCauseLabel||"Não completada"})]}),$.jsxs("div",{className:`history-item ${l} ${n?"expanded":""}`,"data-call-id":e.id,children:[$.jsxs("div",{className:"history-item-row",children:[$.jsx("div",{className:"history-arrow "+(e.wasAnswered?"answered":"missed"),children:"incoming"===e.callDirection?$.jsx(xv,{}):$.jsx(bv,{})}),$.jsxs("button",{type:"button",className:"history-item-info",onClick:()=>a(e),title:"Ver detalhes da chamada",children:[$.jsx("span",{className:`history-item-number ${l} ${"campaign"===e.callType?"linked":""}`,children:e.formattedPhone}),$.jsxs("span",{className:"history-item-meta",children:[$.jsx("span",{className:`history-type-badge ${e.callType}`,children:e.callTypeLabel}),$.jsxs("span",{className:"history-item-datetime",children:[t," ",e.formattedTime]}),e.wasAnswered&&void 0!==e.duration&&$.jsx("span",{className:"history-item-duration",children:e.formattedDuration})]}),h]}),$.jsxs("div",{className:"history-actions",children:[e.hasAudio&&$.jsx("button",{type:"button",className:"history-action-btn play-btn "+(n?"active":""),onClick:t=>{u(t),i(e)},title:n?"Fechar gravação":"Ouvir gravação","aria-label":n?"Fechar gravação":"Ouvir gravação",children:$.jsx("i",{className:"fas "+(n?"fa-xmark":"fa-play"),"aria-hidden":"true"})}),$.jsx("button",{type:"button",className:"history-action-btn call-btn",onClick:t=>{u(t),s(e)},title:"Ligar","aria-label":"Ligar",children:$.jsx("i",{className:"fas fa-phone","aria-hidden":"true"})}),$.jsx("button",{type:"button",className:"history-action-btn whatsapp-btn",onClick:t=>{u(t),d(e)},title:"WhatsApp","aria-label":"WhatsApp",children:$.jsx("i",{className:"fab fa-whatsapp","aria-hidden":"true"})})]})]}),n&&e.hasAudio&&$.jsx(wv,{state:r,onRetry:()=>o(e),autoPlay:!0})]})}function Cv({label:e,value:t,tone:n,wide:r}){return t?$.jsxs("div",{className:"details-row "+(r?"wide":""),children:[$.jsx("div",{className:"details-label",children:e}),$.jsx("div",{className:`details-value ${n??""}`,children:t})]}):null}function Sv({item:e,dayLabel:n,apiBaseUrl:r,getAuthHeaders:i,recording:o,onLoadRecording:a,onClose:s,onCall:d,onWhatsApp:l}){const[u,c]=t.useState({status:"idle",form:null}),f=t.useRef(null),h="campaign"===e.callType;t.useEffect(()=>{var e;if("undefined"==typeof document)return;const t=document.activeElement;null==(e=f.current)||e.focus();const n=e=>{"Escape"===e.key&&(e.stopPropagation(),s())};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n),t&&"function"==typeof t.focus&&document.contains(t)&&t.focus()}},[s]),t.useEffect(()=>{if(!h||!e.campaignContactId)return void c({status:"idle",form:null});let t=!1;return c({status:"loading",form:null}),rm({source:"campaign",id:e.campaignContactId,campaignId:e.campaignId??null,signature:e.formSignature??null,expiresAt:e.formExpiresAt??null},{apiBaseUrl:r,headers:i(),retries:0}).then(e=>{t||c({status:"ready",form:e})}).catch(e=>{t||(console.warn("[CallHistoryList] Formulário da campanha indisponível, usando campos do histórico:",e),c({status:"error",form:null,error:e instanceof Error?e.message:"Erro ao carregar formulário"}))}),()=>{t=!0}},[r,i,h,e.campaignContactId,e.campaignId,e.id]);const p=t.useMemo(()=>Object.entries(e.fields??{}).filter(([e,t])=>null!=t&&""!==String(t).trim()&&!function(e){const t=e.trim().toLowerCase();return/(^|[\s_-])id$/.test(t)}(e)),[e.fields]),m=t.useMemo(()=>{const t=new Map;for(const[n,r]of Object.entries(e.fields??{}))null!=r&&""!==String(r).trim()&&t.set(am(im(n)),String(r));return t},[e.fields]),g=e=>{if(e.value&&""!==e.value.trim())return e.value;return m.get(am(im(e.label)))??m.get(am(im(e.key)))??"-"},v="ready"===u.status&&u.form?u.form.rows&&u.form.rows.length>0?u.form.rows:u.form.fields.length>0?[u.form.fields]:[]:[],y=v.length>0;let b;b="loading"===u.status&&0===p.length?$.jsxs("div",{className:"details-loading",role:"status",children:[$.jsx("i",{className:"fas fa-spinner fa-spin","aria-hidden":"true"}),$.jsx("span",{children:"Carregando formulário..."})]}):y?v.map((e,t)=>$.jsx("div",{className:"details-form-row",children:e.map((e,n)=>$.jsxs("div",{className:"details-field",children:[$.jsx("div",{className:"details-field-label",title:e.label,children:e.label}),$.jsx("div",{className:"details-field-value",children:g(e)})]},`${t}-${n}-${e.key}`))},t)):p.length>0?$.jsxs($.Fragment,{children:["loading"===u.status&&$.jsxs("div",{className:"details-loading details-loading-inline",role:"status",children:[$.jsx("i",{className:"fas fa-spinner fa-spin","aria-hidden":"true"}),$.jsx("span",{children:"Atualizando formulário..."})]}),$.jsx("div",{className:"details-form-row",children:p.map(([e,t])=>$.jsxs("div",{className:"details-field",children:[$.jsx("div",{className:"details-field-label",title:e,children:e}),$.jsx("div",{className:"details-field-value",children:t})]},e))})]}):$.jsxs("div",{className:"details-empty",children:[$.jsx("i",{className:"fas fa-user","aria-hidden":"true"}),$.jsx("span",{children:"error"===u.status?u.error||"Formulário indisponível":"Nenhum dado do cliente disponível"})]});let x=null;return e.hasAudio&&(x="ready"===(null==o?void 0:o.status)?$.jsx("audio",{controls:!0,preload:"metadata",src:o.url,"aria-label":"Gravação da chamada"}):"loading"===(null==o?void 0:o.status)?$.jsxs("div",{className:"details-loading",role:"status",children:[$.jsx("i",{className:"fas fa-spinner fa-spin","aria-hidden":"true"}),$.jsx("span",{children:"Carregando gravação..."})]}):"error"===(null==o?void 0:o.status)?$.jsxs("div",{className:"details-error",role:"alert",children:[$.jsx("i",{className:"fas fa-circle-exclamation","aria-hidden":"true"}),$.jsx("span",{children:o.error}),$.jsx("button",{type:"button",className:"retry-link",onClick:()=>a(e,!0),children:"Tentar novamente"})]}):$.jsxs("button",{type:"button",className:"details-play-btn",onClick:()=>a(e),children:[$.jsx("i",{className:"fas fa-play","aria-hidden":"true"}),$.jsx("span",{children:"Ouvir gravação"})]})),$.jsx("div",{className:"modal-overlay history-details-overlay active",onClick:s,role:"presentation",children:$.jsxs("div",{className:"modal-content history-details-sheet",onClick:e=>e.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":`Detalhes da chamada para ${e.formattedPhone}`,children:[$.jsxs("div",{className:"modal-header",children:[$.jsxs("div",{className:"history-details-heading",children:[$.jsx("h2",{className:"modal-title",children:e.formattedPhone}),$.jsxs("div",{className:"history-details-subtitle",children:[$.jsx("span",{className:`history-type-badge ${e.callType}`,children:e.callTypeLabel}),$.jsxs("span",{children:[n," ",e.formattedTimeWithSeconds]})]})]}),$.jsx("button",{ref:f,type:"button",className:"modal-close",onClick:s,"aria-label":"Fechar",children:$.jsx("i",{className:"fas fa-xmark","aria-hidden":"true"})})]}),$.jsxs("div",{className:"history-details-body",children:[h&&$.jsxs("section",{className:"details-section",children:[$.jsx("div",{className:"details-section-title",children:"Campanha"}),$.jsx("div",{className:"details-campaign-name",children:e.campaignName||"-"}),e.contactLabel&&$.jsxs("div",{className:"details-contact-label",children:["Cliente: ",e.contactLabel]})]}),$.jsxs("section",{className:"details-section details-grid",children:[$.jsx(Cv,{label:"Status",value:e.wasAnswered?"Completada":"Não completada",tone:e.wasAnswered?"success":"failure"}),$.jsx(Cv,{label:"Duração",value:e.formattedDuration}),!e.wasAnswered&&$.jsx(Cv,{label:"Motivo",value:e.failureCauseLabel||"Não informado",tone:"failure"}),e.wasAnswered&&$.jsx(Cv,{label:"Quem desligou",value:e.hangupCauseLabel}),$.jsx(Cv,{label:"Qualificação",value:e.qualificationName,wide:!0}),$.jsx(Cv,{label:"Protocolo",value:e.protocol?String(e.protocol):void 0}),$.jsx(Cv,{label:"Data",value:e.formattedDate}),$.jsx(Cv,{label:"Observação",value:e.note,wide:!0})]}),e.hasAudio&&$.jsxs("section",{className:"details-section",children:[$.jsx("div",{className:"details-section-title",children:"Gravação"}),x]}),h&&$.jsxs("section",{className:"details-section",children:[$.jsx("div",{className:"details-section-title",children:"Formulário da campanha"}),b]})]}),$.jsxs("div",{className:"history-details-actions",children:[$.jsxs("button",{type:"button",className:"details-action-btn call",onClick:()=>d(e),children:[$.jsx("i",{className:"fas fa-phone","aria-hidden":"true"}),$.jsx("span",{children:"Ligar"})]}),$.jsxs("button",{type:"button",className:"details-action-btn whatsapp",onClick:()=>l(e),children:[$.jsx("i",{className:"fab fa-whatsapp","aria-hidden":"true"}),$.jsx("span",{children:"WhatsApp"})]})]})]})})}function Ev({items:e,isLoading:n,error:r,onRefresh:i,onCall:o,onWhatsApp:a,apiBaseUrl:s,getAuthHeaders:d,query:l,onQueryChange:u,isSearching:c=!1,searchHint:f=null}){const[h,p]=t.useState(null),[m,g]=t.useState(null),[v,y]=t.useState(!1),b=function(e,n){const[i,o]=t.useState({}),a=t.useRef(i),s=t.useRef(new Map),d=t.useRef(new Set);t.useEffect(()=>{a.current=i},[i]);const l=t.useCallback(e=>{const t=s.current.get(e);t&&(URL.revokeObjectURL(t),s.current.delete(e))},[]);t.useEffect(()=>{const e=s.current;return()=>{e.forEach(e=>URL.revokeObjectURL(e)),e.clear()}},[]);const u=t.useCallback(e=>{d.current=e;const t=Object.keys(a.current).filter(t=>!e.has(t));0!==t.length&&(t.forEach(l),o(e=>{const n={...e};return t.forEach(e=>{delete n[e]}),n}))},[l]),c=t.useCallback(async(t,i=!1)=>{if(!t.audioPath)return;const u=a.current[t.id];if(i||!u||"loading"!==u.status&&"ready"!==u.status){d.current=new Set([...d.current,t.id]),l(t.id),o(e=>({...e,[t.id]:{status:"loading"}}));try{if(!t.audioSignature||!t.audioExpiresAt)throw new Error("Gravação indisponível. Atualize o histórico.");const r=new URLSearchParams({path:t.audioPath,exp:String(t.audioExpiresAt),sig:t.audioSignature}),i=`${e}/api/call-audio?${r.toString()}`,a=await fetch(i,{method:"GET",headers:n(),credentials:"omit"});if(!a.ok){const e=await a.json().catch(()=>({}));throw new Error(e.error||`Erro ${a.status}`)}const u=await a.blob();if(!d.current.has(t.id))return void o(e=>{const n={...e};return delete n[t.id],n});l(t.id);const c=URL.createObjectURL(u);s.current.set(t.id,c),o(e=>({...e,[t.id]:{status:"ready",url:c}}))}catch(r){const n=r instanceof Error?r.message:"Erro ao carregar gravação";console.error("[CallHistoryList] Erro ao carregar gravação:",r),o(e=>({...e,[t.id]:{status:"error",error:n}}))}}},[e,n,l]);return t.useMemo(()=>({states:i,load:c,retain:u}),[i,c,u])}(s,d),{retain:x}=b,[w,_]=t.useState(l??""),C=t.useRef(l??""),S=t.useRef(null);t.useEffect(()=>{const e=l??"";e!==C.current&&(C.current=e,_(e))},[l]),t.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]);const E=t.useCallback(e=>{_(e),u&&(S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{C.current=e,u(e)},350))},[u]),N=t.useCallback(()=>{_(""),S.current&&clearTimeout(S.current),C.current="",null==u||u("")},[u]),T=t.useMemo(()=>dv(w),[w]),A=t.useMemo(()=>function(e,t){const n="string"==typeof t?dv(t):t;return"empty"===n.kind?e:e.filter(e=>lv(e,n))}(e,T),[e,T]),O="empty"!==T.kind,I=t.useMemo(()=>{const t=new Date,n={};for(const r of e)n[r.id]=ov(r.dateKey,r.formattedDate,t);return n},[e]),k=t.useMemo(()=>e.find(e=>e.id===m)??null,[e,m]);t.useEffect(()=>{const t=new Set(e.map(e=>e.id)),n=new Set;h&&t.has(h)&&n.add(h),m&&t.has(m)&&n.add(m),x(n)},[h,m,e,x]);const j=t.useCallback(e=>{h!==e.id?(p(e.id),b.load(e)):p(null)},[h,b]),R=t.useCallback(e=>{b.load(e,!0)},[b]),P=t.useCallback((e,t=!1)=>{b.load(e,t)},[b]),D=t.useCallback(e=>{p(null),g(e.id)},[]),L=t.useCallback(()=>g(null),[]);return $.jsxs($.Fragment,{children:[$.jsxs("div",{className:"history-header",children:[$.jsx("h1",{className:"header-title",children:"Recentes"}),$.jsxs("div",{className:"history-header-actions",children:[$.jsx("button",{type:"button",className:"history-refresh-btn history-export-btn "+(v?"active":""),onClick:()=>y(e=>!e),"aria-label":"Exportar histórico","aria-pressed":v,title:"Exportar áudios ou dados do período",children:$.jsx("i",{className:"fas fa-file-export","aria-hidden":"true"})}),$.jsx("button",{type:"button",className:"history-refresh-btn",onClick:i,disabled:n,"aria-label":"Atualizar histórico",children:$.jsx("i",{className:"fas fa-arrows-rotate "+(n?"fa-spin":""),"aria-hidden":"true"})})]})]}),v&&$.jsx(yv,{apiBaseUrl:s,getAuthHeaders:d,onClose:()=>y(!1)}),$.jsxs("div",{className:"history-search-bar",children:[$.jsxs("label",{className:"history-search",children:[$.jsx("i",{className:"fas fa-magnifying-glass history-search-icon","aria-hidden":"true"}),$.jsx("input",{type:"search",className:"history-search-input",placeholder:"Buscar número, campanha, cliente...","aria-label":"Buscar no histórico",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,value:w,onChange:e=>E(e.target.value)}),c?$.jsx("i",{className:"fas fa-spinner fa-spin history-search-spinner","aria-hidden":"true",title:"Buscando..."}):w?$.jsx("button",{type:"button",className:"history-search-clear",onClick:N,"aria-label":"Limpar busca",children:$.jsx("i",{className:"fas fa-xmark","aria-hidden":"true"})}):null]}),O&&f&&$.jsx("div",{className:"history-search-hint",children:f})]}),$.jsx("div",{className:"call-history-list",id:"callHistoryList",children:n&&0===e.length?$.jsxs("div",{className:"history-loading",role:"status",children:[$.jsx("i",{className:"fas fa-spinner fa-spin","aria-hidden":"true"}),$.jsx("span",{children:"Carregando..."})]}):r?$.jsxs("div",{className:"history-error",role:"alert",children:[$.jsx("i",{className:"fas fa-exclamation-circle","aria-hidden":"true"}),$.jsx("span",{children:r}),$.jsx("button",{type:"button",className:"retry-btn",onClick:i,children:"Tentar novamente"})]}):0===e.length?$.jsxs("div",{className:"history-empty",children:[$.jsx("i",{className:"fas fa-phone-slash","aria-hidden":"true"}),$.jsx("span",{children:"Nenhuma ligação recente"})]}):0===A.length?$.jsxs("div",{className:"history-empty history-empty-search",children:[$.jsx("i",{className:"fas fa-magnifying-glass","aria-hidden":"true"}),$.jsxs("span",{children:["Nenhuma chamada encontrada para ",$.jsxs("strong",{children:["“",w.trim(),"”"]})]}),c&&$.jsx("span",{className:"history-search-status",children:"Buscando no servidor..."})]}):A.map(e=>$.jsx(_v,{item:e,dayLabel:I[e.id]??e.formattedDate,isPlayerOpen:h===e.id,recording:b.states[e.id],onTogglePlayer:j,onRetryRecording:R,onOpenDetails:D,onCall:o,onWhatsApp:a},e.id))}),k&&$.jsx(Sv,{item:k,dayLabel:I[k.id]??k.formattedDate,apiBaseUrl:s,getAuthHeaders:d,recording:b.states[k.id],onLoadRecording:P,onClose:L,onCall:e=>{g(null),o(e)},onWhatsApp:a})]})}const Nv={light:10,medium:20,heavy:30,selection:10,success:[10,30,10],warning:[20,30,20],error:[30,50,30,50,30]};const Tv={1:[697,1209],2:[697,1336],3:[697,1477],4:[770,1209],5:[770,1336],6:[770,1477],7:[852,1209],8:[852,1336],9:[852,1477],"*":[941,1209],0:[941,1336],"#":[941,1477]},Av=120,Ov=.08,Iv=.01;let kv=0,jv=0;const Rv=[],Pv=[],Dv=new Set,Lv={log:console.log.bind(console),info:console.info.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),debug:console.debug.bind(console)};let Mv=!1;function Uv(e,t,n,r,i){const o={id:++kv,timestamp:new Date,level:e,category:t,message:n,data:r,stack:i};for(Rv.push(o);Rv.length>1e3;)Rv.shift();return Dv.forEach(e=>e()),o}function Fv(e){const t={id:++jv,timestamp:new Date,...e};for(Pv.push(t);Pv.length>200;)Pv.shift();return Dv.forEach(e=>e()),t}function Bv(){if(Mv)return;Mv=!0;const e=(e,t)=>(...n)=>{var r;t(...n);const{category:i,isSIP:o}=function(e){const t=e[0];if("string"==typeof t){if(t.includes("[Callix Dialer]"))return{category:"Callix",isSIP:!1};if(t.includes("[MobileDialer]"))return{category:"MobileDialer",isSIP:!1};if(t.includes("[FloatingDialer]"))return{category:"FloatingDialer",isSIP:!1};if(t.includes("[InlineDialer]"))return{category:"InlineDialer",isSIP:!1};if(t.includes("[DraggableClientInfoModal]"))return{category:"ClientInfo",isSIP:!1};if(t.includes("[WhatsApp"))return{category:"WhatsApp",isSIP:!1};if(t.includes("[API"))return{category:"API",isSIP:!1};if(t.includes("SIP")||t.includes("sip:"))return{category:"SIP",isSIP:!0};if(t.includes("WebSocket"))return{category:"WebSocket",isSIP:!0};if(t.includes("WebRTC")||t.includes("RTC"))return{category:"WebRTC",isSIP:!0};if(t.includes("ICE"))return{category:"ICE",isSIP:!0};if(t.includes("SRTP")||t.includes("DTLS"))return{category:"Media",isSIP:!0};if(t.includes("SDK")||t.includes("sdk"))return{category:"SDK",isSIP:!1};if(t.includes("CallOperator"))return{category:"CallOperator",isSIP:!1};if(t.includes("useEffect")||t.includes("useState"))return{category:"React",isSIP:!1};if(t.includes("render")||t.includes("Render"))return{category:"React",isSIP:!1}}return{category:"General",isSIP:!1}}(n),{message:a,data:s}=function(e){if(0===e.length)return{message:""};const t=[];let n;for(let r=0;r<e.length;r++){const i=e[r];"string"==typeof i?t.push(i):"number"==typeof i||"boolean"==typeof i?t.push(String(i)):i instanceof Error?(t.push(`${i.name}: ${i.message}`),n={errorStack:i.stack}):void 0!==i&&(void 0===n?n=i:Array.isArray(n)?n.push(i):n=[n,i],t.push("object"==typeof i?"[Object]":String(i)))}return{message:t.join(" "),data:n}}(n);let d;"error"===e&&(d=null==(r=(new Error).stack)?void 0:r.split("\n").slice(2).join("\n")),Uv(o?"sip":e,i,a,s,d)};console.log=e("log",Lv.log),console.info=e("info",Lv.info),console.warn=e("warn",Lv.warn),console.error=e("error",Lv.error),console.debug=e("debug",Lv.debug)}async function qv(){const e={userAgent:navigator.userAgent,platform:navigator.platform,language:navigator.language,cookieEnabled:navigator.cookieEnabled,onLine:navigator.onLine,screenWidth:screen.width,screenHeight:screen.height,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,devicePixelRatio:window.devicePixelRatio,touchSupport:"ontouchstart"in window||navigator.maxTouchPoints>0,mediaDevices:{audioInputs:0,audioOutputs:0,videoInputs:0},permissions:{}};try{const t=await navigator.mediaDevices.enumerateDevices();e.mediaDevices={audioInputs:t.filter(e=>"audioinput"===e.kind).length,audioOutputs:t.filter(e=>"audiooutput"===e.kind).length,videoInputs:t.filter(e=>"videoinput"===e.kind).length}}catch(r){Uv("warn","DeviceInfo","Failed to enumerate media devices",r)}try{if("permissions"in navigator){const t=await navigator.permissions.query({name:"microphone"});e.permissions.microphone=t.state;const n=await navigator.permissions.query({name:"notifications"});e.permissions.notifications=n.state}}catch(r){}const t=navigator.connection;t&&(e.connection={type:t.type,effectiveType:t.effectiveType,downlink:t.downlink,rtt:t.rtt});const n=performance;return n.memory&&(e.memory={jsHeapSizeLimit:n.memory.jsHeapSizeLimit,totalJSHeapSize:n.memory.totalJSHeapSize,usedJSHeapSize:n.memory.usedJSHeapSize}),e}async function zv(){const e=await qv(),t=[];if(t.push("═══════════════════════════════════════════════════════════════"),t.push(" CALLIX DIALER DEBUG LOG "),t.push("═══════════════════════════════════════════════════════════════"),t.push(`Exported: ${(new Date).toISOString()}`),t.push(""),t.push("┌─────────────────────────────────────────────────────────────┐"),t.push("│ DEVICE INFO │"),t.push("├─────────────────────────────────────────────────────────────┤"),t.push(`│ User Agent: ${e.userAgent.substring(0,50)}...`),t.push(`│ Platform: ${e.platform}`),t.push(`│ Language: ${e.language}`),t.push(`│ Online: ${e.onLine}`),t.push(`│ Screen: ${e.screenWidth}x${e.screenHeight}`),t.push(`│ Viewport: ${e.viewportWidth}x${e.viewportHeight}`),t.push(`│ Pixel Ratio: ${e.devicePixelRatio}`),t.push(`│ Touch Support: ${e.touchSupport}`),t.push(`│ Audio Inputs: ${e.mediaDevices.audioInputs}`),t.push(`│ Audio Outputs: ${e.mediaDevices.audioOutputs}`),t.push(`│ Microphone Permission: ${e.permissions.microphone||"unknown"}`),e.connection&&(t.push(`│ Connection Type: ${e.connection.effectiveType||e.connection.type||"unknown"}`),t.push(`│ RTT: ${e.connection.rtt??"unknown"}ms`)),e.memory){const n=Math.round((e.memory.usedJSHeapSize||0)/1024/1024),r=Math.round((e.memory.totalJSHeapSize||0)/1024/1024);t.push(`│ Memory: ${n}MB / ${r}MB`)}if(t.push("└─────────────────────────────────────────────────────────────┘"),t.push(""),t.push("┌─────────────────────────────────────────────────────────────┐"),t.push("│ NETWORK REQUESTS │"),t.push("├─────────────────────────────────────────────────────────────┤"),0===Pv.length)t.push("│ No network requests logged");else for(const r of Pv){const e=r.timestamp.toISOString().split("T")[1].split(".")[0],n=r.status?`${r.status}`:"FAIL",i=r.duration?`${r.duration}ms`:"-";t.push(`│ [${e}] ${r.method} ${n} (${i})`),t.push(`│ URL: ${r.url.substring(0,60)}${r.url.length>60?"...":""}`),r.error&&t.push(`│ ERROR: ${r.error}`)}t.push("└─────────────────────────────────────────────────────────────┘"),t.push(""),t.push("┌─────────────────────────────────────────────────────────────┐"),t.push("│ APPLICATION LOGS │"),t.push("├─────────────────────────────────────────────────────────────┤");const n={log:"📝",info:"ℹ️",warn:"⚠️",error:"❌",debug:"🔍",network:"🌐",event:"⚡",state:"📊",sip:"📞"};for(const r of Rv){const e=r.timestamp.toISOString().split("T")[1].split(".")[0],i=n[r.level]||"•",o=r.level.toUpperCase().padEnd(7),a=`[${r.category}]`.padEnd(20);if(t.push(`│ ${e} ${i} ${o} ${a}`),t.push(`│ ${r.message.substring(0,70)}${r.message.length>70?"...":""}`),r.data)try{const e=JSON.stringify(r.data,null,2).split("\n");for(const n of e.slice(0,10))t.push(`│ ${n}`);e.length>10&&t.push(`│ ... (${e.length-10} more lines)`)}catch{t.push("│ [Data could not be serialized]")}if(r.stack){const e=r.stack.split("\n").slice(0,5);for(const n of e)t.push(`│ ${n.trim()}`)}t.push("│")}return t.push("└─────────────────────────────────────────────────────────────┘"),t.push(""),t.push(`Total Logs: ${Rv.length}`),t.push(`Total Network Requests: ${Pv.length}`),t.push("═══════════════════════════════════════════════════════════════"),t.join("\n")}function Hv(){const[e,n]=t.useState([]),[r,i]=t.useState([]),[o,a]=t.useState(0),s=t.useRef(!1);t.useEffect(()=>{if(s.current)return;s.current=!0,Bv(),function(){if("undefined"==typeof window)return;const e=window.fetch;window.fetch=async(t,n)=>{const r=Date.now(),i="string"==typeof t?t:t instanceof URL?t.toString():t.url,o=(null==n?void 0:n.method)||"GET",a={};let s;(null==n?void 0:n.headers)&&new Headers(n.headers).forEach((e,t)=>{t.toLowerCase().includes("auth")||t.toLowerCase().includes("token")?a[t]=e.substring(0,20)+"...":a[t]=e}),(null==n?void 0:n.body)&&(s="string"==typeof n.body?n.body.substring(0,500):n.body instanceof FormData?"[FormData]":"[Binary/Stream]");try{const d=await e(t,n),l=Date.now()-r,u=d.clone();let c;try{const e=d.headers.get("content-type")||"";if(e.includes("application/json")){const e=await u.json();c=JSON.stringify(e).substring(0,1e3)}else c=e.includes("text")?(await u.text()).substring(0,500):`[${e||"unknown content-type"}]`}catch{c="[Could not read response body]"}const f={};return d.headers.forEach((e,t)=>{f[t]=e}),Fv({method:o,url:i,status:d.status,duration:l,requestHeaders:a,responseHeaders:f,requestBody:s,responseBody:c}),Uv("network","Network",`${d.ok?"✅":"❌"} ${o} ${i} - ${d.status} (${l}ms)`,{status:d.status,duration:l}),d}catch(d){const e=Date.now()-r,t=d instanceof Error?d.message:String(d);throw Fv({method:o,url:i,duration:e,requestHeaders:a,requestBody:s,error:t}),Uv("network","Network",`❌ ${o} ${i} - FAILED: ${t}`,{error:t,duration:e}),d}}}();const e=function(){if("undefined"==typeof window)return()=>{};const e=e=>{var t;Uv("error","GlobalError",`Uncaught: ${e.message}`,{filename:e.filename,lineno:e.lineno,colno:e.colno},null==(t=e.error)?void 0:t.stack)},t=e=>{const t=e.reason;Uv("error","UnhandledRejection",`Unhandled Promise Rejection: ${t instanceof Error?t.message:String(t)}`,{reason:t instanceof Error?{name:t.name,message:t.message}:t},t instanceof Error?t.stack:void 0)};return window.addEventListener("error",e),window.addEventListener("unhandledrejection",t),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",t)}}();return Uv("info","DebugLogger","🚀 Debug Logger initialized",{timestamp:(new Date).toISOString(),version:"1.0.0"}),()=>{e()}},[]),t.useEffect(()=>{const e=()=>{a(e=>e+1)};return Dv.add(e),()=>{Dv.delete(e)}},[]),t.useEffect(()=>{n([...Rv]),i([...Pv])},[o]);return{logs:e,networkLogs:r,clear:t.useCallback(()=>{Rv.length=0,Pv.length=0,Dv.forEach(e=>e())},[]),exportText:t.useCallback(async()=>zv(),[]),copyToClipboard:t.useCallback(async()=>{const e=await zv();try{return await navigator.clipboard.writeText(e),Uv("info","DebugLogger","📋 Logs copied to clipboard"),!0}catch(t){return Uv("error","DebugLogger","Failed to copy logs to clipboard",t),!1}},[]),addLog:t.useCallback((e,t,n,r)=>{Uv(e,t,n,r)},[]),collectDeviceInfo:qv}}const Wv={container:{position:"fixed",inset:0,zIndex:99999,display:"flex",flexDirection:"column",backgroundColor:"#0f172a",color:"#e2e8f0",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',fontSize:"12px",overflow:"hidden"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",backgroundColor:"#1e293b",borderBottom:"1px solid #334155",flexShrink:0},headerTitle:{display:"flex",alignItems:"center",gap:"8px",fontSize:"14px",fontWeight:700},headerActions:{display:"flex",alignItems:"center",gap:"8px"},button:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",padding:"8px 12px",borderRadius:"6px",border:"none",fontSize:"11px",fontWeight:600,cursor:"pointer",transition:"all 0.2s"},primaryButton:{backgroundColor:"#3b82f6",color:"#fff"},dangerButton:{backgroundColor:"#dc2626",color:"#fff"},successButton:{backgroundColor:"#16a34a",color:"#fff"},tabs:{display:"flex",backgroundColor:"#1e293b",borderBottom:"1px solid #334155",padding:"0 16px",flexShrink:0,overflowX:"auto"},tab:{padding:"10px 16px",fontSize:"11px",fontWeight:600,cursor:"pointer",borderBottom:"2px solid transparent",color:"#94a3b8",whiteSpace:"nowrap",transition:"all 0.2s"},tabActive:{color:"#3b82f6",borderBottomColor:"#3b82f6"},filters:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",backgroundColor:"#1e293b",borderBottom:"1px solid #334155",flexWrap:"wrap",flexShrink:0},filterChip:{padding:"4px 10px",borderRadius:"12px",fontSize:"10px",fontWeight:600,cursor:"pointer",transition:"all 0.2s"},content:{flex:1,overflow:"auto",padding:"8px"},logEntry:{display:"flex",alignItems:"flex-start",padding:"6px 8px",borderRadius:"4px",marginBottom:"2px",fontSize:"11px",lineHeight:1.4},logTime:{flexShrink:0,width:"75px",color:"#64748b",fontSize:"10px"},logLevel:{flexShrink:0,width:"55px",fontWeight:700,fontSize:"9px",textTransform:"uppercase"},logCategory:{flexShrink:0,width:"100px",color:"#8b5cf6",fontSize:"10px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},logMessage:{flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap"},logData:{marginTop:"4px",padding:"6px",backgroundColor:"#0f172a",borderRadius:"4px",fontSize:"10px",whiteSpace:"pre-wrap",overflow:"auto",maxHeight:"200px"},deviceInfoGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"12px",padding:"16px"},deviceInfoCard:{backgroundColor:"#1e293b",borderRadius:"8px",padding:"12px",border:"1px solid #334155"},deviceInfoTitle:{fontSize:"11px",fontWeight:700,color:"#3b82f6",marginBottom:"8px",textTransform:"uppercase",letterSpacing:"0.05em"},deviceInfoRow:{display:"flex",justifyContent:"space-between",padding:"4px 0",borderBottom:"1px solid #334155",fontSize:"11px"},deviceInfoLabel:{color:"#94a3b8"},deviceInfoValue:{color:"#e2e8f0",fontWeight:600},networkEntry:{backgroundColor:"#1e293b",borderRadius:"6px",marginBottom:"8px",overflow:"hidden"},networkHeader:{display:"flex",alignItems:"center",gap:"12px",padding:"10px 12px",cursor:"pointer",transition:"background-color 0.2s"},networkMethod:{padding:"2px 8px",borderRadius:"4px",fontSize:"10px",fontWeight:700},networkUrl:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"11px"},networkStatus:{fontWeight:700,fontSize:"11px"},networkDetails:{padding:"12px",backgroundColor:"#0f172a",borderTop:"1px solid #334155",fontSize:"10px"},stats:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:"12px",padding:"16px"},statCard:{backgroundColor:"#1e293b",borderRadius:"8px",padding:"16px",textAlign:"center"},statValue:{fontSize:"28px",fontWeight:700,color:"#3b82f6"},statLabel:{fontSize:"10px",color:"#94a3b8",marginTop:"4px",textTransform:"uppercase"},emptyState:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"48px",color:"#64748b"},copySuccess:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",backgroundColor:"#16a34a",color:"#fff",padding:"16px 32px",borderRadius:"12px",fontSize:"16px",fontWeight:700,zIndex:1e5,animation:"fadeInOut 2s ease-in-out"}},Gv={log:{bg:"#374151",text:"#9ca3af"},info:{bg:"#1e3a5f",text:"#60a5fa"},warn:{bg:"#713f12",text:"#fbbf24"},error:{bg:"#7f1d1d",text:"#f87171"},debug:{bg:"#3f3f46",text:"#a1a1aa"},network:{bg:"#164e63",text:"#22d3ee"},event:{bg:"#4c1d95",text:"#a78bfa"},state:{bg:"#14532d",text:"#4ade80"},sip:{bg:"#581c87",text:"#c084fc"}},Vv={log:"📝",info:"ℹ️",warn:"⚠️",error:"❌",debug:"🔍",network:"🌐",event:"⚡",state:"📊",sip:"📞"};function Kv({onClose:e}){const{logs:n,networkLogs:r,clear:i,copyToClipboard:o}=Hv(),[a,s]=t.useState("logs"),[d,l]=t.useState(new Set),[u,c]=t.useState(""),[f,h]=t.useState(""),[p,m]=t.useState(new Set),[g,v]=t.useState(null),[y,b]=t.useState(!1),[x,w]=t.useState(new Set);t.useEffect(()=>{qv().then(v)},[]);const _=t.useMemo(()=>n.filter(e=>{if(d.size>0&&!d.has(e.level))return!1;if(u&&!e.category.toLowerCase().includes(u.toLowerCase()))return!1;if(f){const t=f.toLowerCase();return e.message.toLowerCase().includes(t)||e.category.toLowerCase().includes(t)||e.data&&JSON.stringify(e.data).toLowerCase().includes(t)}return!0}),[n,d,u,f]),C=t.useMemo(()=>{const e=new Set(n.map(e=>e.category));return Array.from(e).sort()},[n]),S=t.useMemo(()=>{const e={},t={};for(const r of n)e[r.level]=(e[r.level]||0)+1,t[r.category]=(t[r.category]||0)+1;return{byLevel:e,byCategory:t,networkSuccess:r.filter(e=>e.status&&e.status>=200&&e.status<400).length,networkError:r.filter(e=>!e.status||e.status>=400).length,avgDuration:r.length>0?Math.round(r.reduce((e,t)=>e+(t.duration||0),0)/r.length):0}},[n,r]),E=t.useCallback(e=>{l(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),N=t.useCallback(e=>{m(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),T=t.useCallback(e=>{w(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),A=t.useCallback(async()=>{await o()&&(b(!0),setTimeout(()=>b(!1),2e3))},[o]),O=e=>e.toTimeString().split(" ")[0]+"."+e.getMilliseconds().toString().padStart(3,"0");return $.jsxs("div",{style:Wv.container,children:[$.jsxs("div",{style:Wv.header,children:[$.jsxs("div",{style:Wv.headerTitle,children:[$.jsx("span",{children:"🔧"}),$.jsx("span",{children:"Debug Console"}),$.jsxs("span",{style:{fontSize:"10px",backgroundColor:"#374151",padding:"2px 8px",borderRadius:"10px"},children:[n.length," logs"]})]}),$.jsxs("div",{style:Wv.headerActions,children:[$.jsx("button",{style:{...Wv.button,...Wv.successButton},onClick:A,children:"📋 Copiar Todos"}),$.jsx("button",{style:{...Wv.button,...Wv.dangerButton},onClick:i,children:"🗑️ Limpar"}),$.jsx("button",{style:{...Wv.button,...Wv.primaryButton},onClick:e,children:"← Voltar"})]})]}),$.jsxs("div",{style:Wv.tabs,children:[$.jsxs("div",{style:{...Wv.tab,..."logs"===a?Wv.tabActive:{}},onClick:()=>s("logs"),children:["📝 Logs (",n.length,")"]}),$.jsxs("div",{style:{...Wv.tab,..."network"===a?Wv.tabActive:{}},onClick:()=>s("network"),children:["🌐 Network (",r.length,")"]}),$.jsx("div",{style:{...Wv.tab,..."device"===a?Wv.tabActive:{}},onClick:()=>s("device"),children:"📱 Device"}),$.jsx("div",{style:{...Wv.tab,..."stats"===a?Wv.tabActive:{}},onClick:()=>s("stats"),children:"📊 Stats"})]}),"logs"===a&&$.jsxs("div",{style:Wv.filters,children:[$.jsx("input",{type:"text",placeholder:"🔍 Buscar...",value:f,onChange:e=>h(e.target.value),style:{padding:"6px 12px",borderRadius:"6px",border:"1px solid #374151",backgroundColor:"#0f172a",color:"#e2e8f0",fontSize:"11px",width:"150px"}}),$.jsxs("select",{value:u,onChange:e=>c(e.target.value),style:{padding:"6px 12px",borderRadius:"6px",border:"1px solid #374151",backgroundColor:"#0f172a",color:"#e2e8f0",fontSize:"11px"},children:[$.jsx("option",{value:"",children:"Todas categorias"}),C.map(e=>$.jsx("option",{value:e,children:e},e))]}),$.jsx("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap"},children:Object.keys(Gv).map(e=>{const t=d.has(e),n=Gv[e];return $.jsxs("span",{style:{...Wv.filterChip,backgroundColor:t?n.text:"#374151",color:t?"#000":"#94a3b8"},onClick:()=>E(e),children:[Vv[e]," ",e]},e)})})]}),$.jsxs("div",{style:Wv.content,children:["logs"===a&&$.jsx($.Fragment,{children:0===_.length?$.jsxs("div",{style:Wv.emptyState,children:[$.jsx("span",{style:{fontSize:"48px",marginBottom:"16px"},children:"📭"}),$.jsx("span",{children:"Nenhum log encontrado"})]}):_.slice(-200).reverse().map(e=>{const t=Gv[e.level],n=x.has(e.id),r=void 0!==e.data||e.stack;return $.jsxs("div",{style:{...Wv.logEntry,backgroundColor:t.bg+"40",cursor:r?"pointer":"default"},onClick:()=>r&&T(e.id),children:[$.jsx("span",{style:Wv.logTime,children:O(e.timestamp)}),$.jsxs("span",{style:{...Wv.logLevel,color:t.text},children:[Vv[e.level]," ",e.level]}),$.jsxs("span",{style:Wv.logCategory,children:["[",e.category,"]"]}),$.jsxs("div",{style:{flex:1},children:[$.jsx("span",{style:Wv.logMessage,children:e.message}),r&&$.jsxs("span",{style:{color:"#64748b",fontSize:"10px",marginLeft:"8px"},children:[n?"▼":"▶"," ",r?"data":""]}),n&&$.jsxs("div",{style:Wv.logData,children:[void 0!==e.data&&$.jsx("pre",{children:(()=>{try{return JSON.stringify(e.data,null,2)}catch{return"[Não serializável]"}})()}),e.stack&&$.jsx("pre",{style:{color:"#f87171",marginTop:e.data?"8px":0},children:e.stack})]})]})]},e.id)})}),"network"===a&&$.jsx($.Fragment,{children:0===r.length?$.jsxs("div",{style:Wv.emptyState,children:[$.jsx("span",{style:{fontSize:"48px",marginBottom:"16px"},children:"🌐"}),$.jsx("span",{children:"Nenhuma requisição registrada"})]}):[...r].reverse().map(e=>{const t=e.status&&e.status>=200&&e.status<400,n=p.has(e.id),r={GET:"#22c55e",POST:"#3b82f6",PUT:"#f59e0b",DELETE:"#ef4444",PATCH:"#8b5cf6"};return $.jsxs("div",{style:Wv.networkEntry,children:[$.jsxs("div",{style:{...Wv.networkHeader,backgroundColor:n?"#334155":"transparent"},onClick:()=>N(e.id),children:[$.jsx("span",{style:{color:"#64748b",fontSize:"10px"},children:O(e.timestamp)}),$.jsx("span",{style:{...Wv.networkMethod,backgroundColor:(r[e.method]||"#6b7280")+"30",color:r[e.method]||"#6b7280"},children:e.method}),$.jsx("span",{style:Wv.networkUrl,title:e.url,children:e.url}),$.jsx("span",{style:{...Wv.networkStatus,color:t?"#22c55e":"#ef4444"},children:e.status||"FAILED"}),$.jsx("span",{style:{color:"#64748b",fontSize:"10px"},children:e.duration?`${e.duration}ms`:"-"}),$.jsx("span",{style:{color:"#64748b"},children:n?"▼":"▶"})]}),n&&$.jsxs("div",{style:Wv.networkDetails,children:[e.error&&$.jsxs("div",{style:{color:"#f87171",marginBottom:"8px"},children:[$.jsx("strong",{children:"Error:"})," ",e.error]}),e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&$.jsxs("div",{style:{marginBottom:"8px"},children:[$.jsx("strong",{style:{color:"#94a3b8"},children:"Request Headers:"}),$.jsx("pre",{style:{marginTop:"4px"},children:JSON.stringify(e.requestHeaders,null,2)})]}),e.requestBody&&$.jsxs("div",{style:{marginBottom:"8px"},children:[$.jsx("strong",{style:{color:"#94a3b8"},children:"Request Body:"}),$.jsx("pre",{style:{marginTop:"4px"},children:e.requestBody})]}),e.responseHeaders&&Object.keys(e.responseHeaders).length>0&&$.jsxs("div",{style:{marginBottom:"8px"},children:[$.jsx("strong",{style:{color:"#94a3b8"},children:"Response Headers:"}),$.jsx("pre",{style:{marginTop:"4px"},children:JSON.stringify(e.responseHeaders,null,2)})]}),e.responseBody&&$.jsxs("div",{children:[$.jsx("strong",{style:{color:"#94a3b8"},children:"Response Body:"}),$.jsx("pre",{style:{marginTop:"4px"},children:e.responseBody})]})]})]},e.id)})}),"device"===a&&g&&$.jsxs("div",{style:Wv.deviceInfoGrid,children:[$.jsxs("div",{style:Wv.deviceInfoCard,children:[$.jsx("div",{style:Wv.deviceInfoTitle,children:"📱 Sistema"}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"User Agent"}),$.jsxs("span",{style:{...Wv.deviceInfoValue,fontSize:"9px",maxWidth:"150px",overflow:"hidden",textOverflow:"ellipsis"},children:[g.userAgent.substring(0,50),"..."]})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Platform"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.platform})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Language"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.language})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Online"}),$.jsx("span",{style:{...Wv.deviceInfoValue,color:g.onLine?"#22c55e":"#ef4444"},children:g.onLine?"✅ Sim":"❌ Não"})]})]}),$.jsxs("div",{style:Wv.deviceInfoCard,children:[$.jsx("div",{style:Wv.deviceInfoTitle,children:"📐 Tela"}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Screen"}),$.jsxs("span",{style:Wv.deviceInfoValue,children:[g.screenWidth,"x",g.screenHeight]})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Viewport"}),$.jsxs("span",{style:Wv.deviceInfoValue,children:[g.viewportWidth,"x",g.viewportHeight]})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Pixel Ratio"}),$.jsxs("span",{style:Wv.deviceInfoValue,children:[g.devicePixelRatio,"x"]})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Touch"}),$.jsx("span",{style:{...Wv.deviceInfoValue,color:g.touchSupport?"#22c55e":"#94a3b8"},children:g.touchSupport?"✅ Suportado":"❌ Não"})]})]}),$.jsxs("div",{style:Wv.deviceInfoCard,children:[$.jsx("div",{style:Wv.deviceInfoTitle,children:"🎤 Mídia"}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Audio Inputs"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.mediaDevices.audioInputs})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Audio Outputs"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.mediaDevices.audioOutputs})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Video Inputs"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.mediaDevices.videoInputs})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Mic Permission"}),$.jsx("span",{style:{...Wv.deviceInfoValue,color:"granted"===g.permissions.microphone?"#22c55e":"#f59e0b"},children:g.permissions.microphone||"unknown"})]})]}),g.connection&&$.jsxs("div",{style:Wv.deviceInfoCard,children:[$.jsx("div",{style:Wv.deviceInfoTitle,children:"📶 Conexão"}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Type"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.connection.type||"-"})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Effective"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.connection.effectiveType||"-"})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Downlink"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.connection.downlink?`${g.connection.downlink} Mbps`:"-"})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"RTT"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.connection.rtt?`${g.connection.rtt}ms`:"-"})]})]}),g.memory&&$.jsxs("div",{style:Wv.deviceInfoCard,children:[$.jsx("div",{style:Wv.deviceInfoTitle,children:"💾 Memória"}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Heap Used"}),$.jsxs("span",{style:Wv.deviceInfoValue,children:[Math.round((g.memory.usedJSHeapSize||0)/1024/1024)," MB"]})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Heap Total"}),$.jsxs("span",{style:Wv.deviceInfoValue,children:[Math.round((g.memory.totalJSHeapSize||0)/1024/1024)," MB"]})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Heap Limit"}),$.jsxs("span",{style:Wv.deviceInfoValue,children:[Math.round((g.memory.jsHeapSizeLimit||0)/1024/1024)," MB"]})]})]})]}),"stats"===a&&$.jsxs($.Fragment,{children:[$.jsxs("div",{style:Wv.stats,children:[$.jsxs("div",{style:Wv.statCard,children:[$.jsx("div",{style:Wv.statValue,children:n.length}),$.jsx("div",{style:Wv.statLabel,children:"Total Logs"})]}),$.jsxs("div",{style:Wv.statCard,children:[$.jsx("div",{style:{...Wv.statValue,color:"#ef4444"},children:S.byLevel.error||0}),$.jsx("div",{style:Wv.statLabel,children:"Erros"})]}),$.jsxs("div",{style:Wv.statCard,children:[$.jsx("div",{style:{...Wv.statValue,color:"#f59e0b"},children:S.byLevel.warn||0}),$.jsx("div",{style:Wv.statLabel,children:"Warnings"})]}),$.jsxs("div",{style:Wv.statCard,children:[$.jsx("div",{style:{...Wv.statValue,color:"#22c55e"},children:S.networkSuccess}),$.jsx("div",{style:Wv.statLabel,children:"Requests OK"})]}),$.jsxs("div",{style:Wv.statCard,children:[$.jsx("div",{style:{...Wv.statValue,color:"#ef4444"},children:S.networkError}),$.jsx("div",{style:Wv.statLabel,children:"Requests Failed"})]}),$.jsxs("div",{style:Wv.statCard,children:[$.jsxs("div",{style:Wv.statValue,children:[S.avgDuration,"ms"]}),$.jsx("div",{style:Wv.statLabel,children:"Avg Response Time"})]})]}),$.jsxs("div",{style:{padding:"16px"},children:[$.jsx("h3",{style:{color:"#94a3b8",marginBottom:"12px"},children:"Logs por Categoria"}),$.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:Object.entries(S.byCategory).sort((e,t)=>t[1]-e[1]).map(([e,t])=>$.jsxs("span",{style:{padding:"6px 12px",backgroundColor:"#1e293b",borderRadius:"6px",fontSize:"11px"},children:[e,": ",$.jsx("strong",{children:t})]},e))})]})]})]}),y&&$.jsx("div",{style:Wv.copySuccess,children:"✅ Logs copiados para a área de transferência!"})]})}function Yv({notice:e,onDismiss:n,onRecheck:r,onHeightChange:i}){const o=t.useRef(null),a=null!==e;if(t.useLayoutEffect(()=>{const e=o.current;if(!i)return;if(!e)return void i(0);const t=()=>i(e.offsetHeight);if(t(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect(),i(0)}},[a,i]),!e)return null;const s="call"===e.source||"session"===e.source;return $.jsxs("div",{ref:o,className:`dialer-notice ${e.level}`,role:"error"===e.level?"alert":"status","data-code":e.code,children:[$.jsx("i",{className:`fas ${"error"===e.level?"fa-circle-exclamation":"fa-triangle-exclamation"} dialer-notice-icon`,"aria-hidden":"true"}),$.jsxs("div",{className:"dialer-notice-body",children:[$.jsx("strong",{className:"dialer-notice-title",children:e.title}),$.jsx("span",{className:"dialer-notice-detail",children:e.detail}),e.action&&$.jsx("span",{className:"dialer-notice-action",children:e.action}),"device"===e.source&&r&&$.jsx("button",{type:"button",className:"dialer-notice-btn",onClick:r,children:"Verificar de novo"})]}),s&&n&&$.jsx("button",{type:"button",className:"dialer-notice-close",onClick:n,"aria-label":"Fechar aviso",children:$.jsx("i",{className:"fas fa-xmark","aria-hidden":"true"})})]})}const Xv={raiva:"raiva",irritacao:"irritação",frustracao:"frustração",desconfianca:"desconfiança",impaciencia:"impaciência",confusao:"confusão",nervosismo:"nervosismo",surpresa:"surpresa",desanimo:"desânimo",cansaco:"cansaço",interesse:"interesse",entusiasmo:"entusiasmo",satisfacao:"satisfação",alivio:"alívio",neutro:"neutro"},Jv={aberto:"cliente aberto",neutro:"cliente neutro",resistente:"cliente resistente",hostil:"cliente hostil",indefinido:"lendo a conversa"},Zv={agent:"Você",customer:"Cliente",mixed:""};function Qv(e,t=2){return(e.emotions??[]).filter(e=>"neutro"!==e.label&&e.intensity>=.3).slice(0,t)}function ey({maxLines:e=4}){const n=t.useContext(Lu);return n?$.jsx(ty,{client:n,maxLines:e}):null}function ty({client:e,maxLines:t}){const{segments:n,insight:r,status:i}=function(e){return Uu(e).transcript}(e),o="running"===(null==i?void 0:i.live);if(0===n.length&&!r&&!o)return null;const a=n.slice(-t);return $.jsxs("div",{className:"live-captions",id:"liveCaptions","aria-live":"polite",children:[r&&$.jsxs("div",{className:`live-insight stance-${r.customer.stance}`,id:"liveInsight",title:r.summary,children:[$.jsx("span",{className:"live-insight-stance",children:Jv[r.customer.stance]??r.customer.stance}),$.jsxs("span",{className:"live-insight-interest",children:["interesse ",Math.round(r.customer.interest),"%"]}),r.nextMove&&$.jsx("span",{className:"live-insight-next",children:r.nextMove})]}),a.length>0?$.jsx("ul",{className:"live-caption-list",children:a.map(e=>$.jsxs("li",{className:`live-caption ${e.speaker}${e.interim?" interim":""}${e.refined?" refined":""}`,children:[$.jsx("span",{className:"live-caption-speaker",children:Zv[e.speaker]}),$.jsx("span",{className:"live-caption-text",children:e.text}),Qv(e).map(e=>$.jsxs("span",{className:"live-caption-emotion"+("context"===e.source?" ctx":""),title:e.evidence??"",children:[Xv[e.label]??e.label," ",Math.round(100*e.intensity),"%"]},e.label))]},e.id))}):$.jsx("div",{className:"live-caption-waiting",children:"Ouvindo a conversa…"})]})}function ny(e={}){const n=ec(),r=nc(),[i,o]=t.useState(null),[a,s]=t.useState(null),[d,l]=t.useState(null),[u,c]=t.useState(null),f=t.useRef(null),h=e.callFailureTtlMs??2e4,p=t.useCallback(async()=>{if(!1===e.checkDevices)return;const t=await Bp();o(t)},[e.checkDevices]);t.useEffect(()=>{var t;if(!1===e.checkDevices)return;let n=!1;const r=async()=>{const e=await Bp();n||o(e)};r();const i="undefined"!=typeof navigator?navigator.mediaDevices:void 0,a=()=>{r()};return null==(t=null==i?void 0:i.addEventListener)||t.call(i,"devicechange",a),()=>{var e;n=!0,null==(e=null==i?void 0:i.removeEventListener)||e.call(i,"devicechange",a)}},[e.checkDevices]),uc("userSessionDropped",e=>{s((null==e?void 0:e.originator)??"unknown")}),t.useEffect(()=>{if(!(null==r?void 0:r.on))return;const e=e=>{var t;const n=(null==e?void 0:e.failure)??(null==(t=r.toCallData)?void 0:t.call(r).failure)??null;l(n??{cause:null}),c(null),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>l(null),h)};return r.on("failed",e),()=>{var t;null==(t=r.off)||t.call(r,"failed",e)}},[r,h]),t.useEffect(()=>{var e,t;if("manualCallFailed"!==(null==n?void 0:n.state))return;const r=(null==(t=null==(e=n.call)?void 0:e.toCallData)?void 0:t.call(e).failure)??null;l(e=>e??r??{cause:null}),c(null)},[n]),t.useEffect(()=>{"callInProgress"!==(null==n?void 0:n.state)&&"manualCallRinging"!==(null==n?void 0:n.state)&&"callRinging"!==(null==n?void 0:n.state)||l(null),"idle"!==(null==n?void 0:n.state)&&"onBreak"!==(null==n?void 0:n.state)||s(null)},[null==n?void 0:n.state]),t.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const m=function(e){if(e.sessionDrop)return Wp(e.sessionDrop);if("startupError"===e.operatorState){if("missingAudioPermissions"===e.startupError&&e.deviceIssue){const t=e.deviceIssue.action??"";return{...e.deviceIssue,action:/recarregue a página/i.test(t)?t:`${t} Depois, recarregue a página para o discador iniciar.`.trim()}}return zp(e.startupError)}return e.deviceIssue?e.deviceIssue:"manualCallFailed"===e.operatorState||e.callFailure?Kp(e.callFailure):"offline"===e.operatorState?{level:"error",source:"offline",code:"offline",title:"Discador desconectado do Callix",detail:"O atendimento está offline: sem internet, sem microfone ou o Callix derrubou a conexão.",action:"Confira a internet e o microfone; o discador tenta reconectar sozinho. Se não voltar, recarregue a página."}:null}({deviceIssue:i,operatorState:(null==n?void 0:n.state)??null,startupError:"startupError"===(null==n?void 0:n.state)?n.error??null:null,sessionDrop:a,callFailure:d});return{notice:m&&m.code!==u?m:null,deviceIssue:i,dismiss:t.useCallback(()=>{m&&("call"===m.source?l(null):"session"===m.source?s(null):c(m.code))},[m]),recheckDevices:p}}const ry=16,iy="callix_dialer_form_scale",oy=100,ay="flex flex-shrink-0 items-center justify-center rounded-md transition hover:bg-black hover:bg-opacity-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white",sy="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;function dy(e,t,n){return Math.min(Math.max(e,t),n)}function ly(e){if(!Number.isFinite(e))return oy;return dy(10*Math.round(e/10),70,180)}function uy(){if("undefined"==typeof window)return oy;try{const e=window.localStorage.getItem(iy);return null===e||""===e.trim()?oy:ly(Number(e))}catch{return oy}}function cy(){if("undefined"==typeof CSS||"function"!=typeof CSS.supports)return!0;try{if(!CSS.supports("zoom","1.5"))return!1}catch{return!0}const e="undefined"!=typeof navigator?/\bFirefox\/(\d+)/.exec(navigator.userAgent):null;return!(e&&Number(e[1])<131)}function fy(){return"undefined"==typeof window?{width:1024,height:768}:{width:window.innerWidth,height:window.innerHeight}}function hy(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return t>0?`${t}:${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${n}:${r.toString().padStart(2,"0")}`}function py({isOpen:e,campaignCallInfo:r,campaignContactPhoneId:i,callDuration:o,isCallActive:a,onClose:s,portalTarget:d}){const l=t.useRef(null),u=t.useRef({pointerId:null,offsetX:0,offsetY:0}),c=t.useRef(!1),f=t.useRef(!1),h=t.useRef(null),p=t.useId(),[m,g]=t.useState({x:100,y:100}),[v,y]=t.useState(!1),[b,x]=t.useState(fy),w=t.useMemo(cy,[]),[_,C]=t.useState(uy),[S,E]=t.useState(""),N=w?_/100:1,T=t.useRef(N);T.current=N;const[A,O]=t.useState(null),[I,k]=t.useState(!1),[j,R]=t.useState(null),[P,D]=t.useState({key:null,n:0}),L=null==r?void 0:r.campaignContact,M=t.useMemo(()=>em(r,i),[r,i]),U=M?Qp(M):null,F=t.useRef(M);F.current=M;const B=t.useRef(null),q=t.useCallback(()=>{var e;const t=null==(e=l.current)?void 0:e.getBoundingClientRect(),n=T.current;return{width:t&&t.width>0?t.width:520*n,height:t&&t.height>0?t.height:600*n}},[]),z=t.useCallback(e=>{if("undefined"==typeof window)return e;const{width:t,height:n}=q(),r=Math.max(16,window.innerWidth-t-ry),i=Math.max(16,window.innerHeight-n-ry);return{x:dy(e.x,16,r),y:dy(e.y,16,i)}},[q]);sy(()=>{if(e&&"undefined"!=typeof window){x(fy());const{width:e,height:t}=q(),n=(window.innerWidth-e)/2,r=(window.innerHeight-t)/2;g(z({x:n,y:r}))}},[e,q,z]),t.useEffect(()=>{if(!e||"undefined"==typeof window)return;const t=()=>{x(fy()),g(e=>z(e))};return window.addEventListener("resize",t),window.addEventListener("orientationchange",t),()=>{window.removeEventListener("resize",t),window.removeEventListener("orientationchange",t)}},[e,z]);const H=t.useCallback(()=>{g(e=>{const t=z(e);return t.x===e.x&&t.y===e.y?e:t})},[z]);t.useEffect(()=>{e&&H()},[e,_,H]),t.useEffect(()=>{const t=l.current;if(!e||!t||"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(()=>H());return n.observe(t),()=>n.disconnect()},[e,H]),t.useEffect(()=>{const e=F.current;if(!e||!U)return O(null),R(null),void k(!1);let t=!1,n=null;return k(!0),R(null),rm(e,{force:P.key===U&&P.n>0}).then(e=>{t||(console.log("[DraggableClientInfoModal] ✅ Formulário carregado:",e.valuesSource,e.layoutSource,e.fields.length,"campos",e.partial?"(parcial)":""),O(e),k(!1),e.partial&&B.current!==U&&(B.current=U,n=setTimeout(()=>D(e=>({key:U,n:e.n+1})),3e3)))}).catch(e=>{t||(console.error("[DraggableClientInfoModal] ❌ Erro ao buscar o formulário:",e),O(null),R(e instanceof Error?e.message:"Erro ao buscar dados do contato"),k(!1))}),()=>{t=!0,n&&clearTimeout(n)}},[U,P]),t.useEffect(()=>{if(!v)return;const e=e=>{if(u.current.pointerId!==e.pointerId)return;c.current=!0;const{width:t,height:n}=q(),r=e.clientX-u.current.offsetX,i=e.clientY-u.current.offsetY,o="undefined"!=typeof window?window.innerWidth:0,a="undefined"!=typeof window?window.innerHeight:0,s=o-t-ry,d=a-n-ry,l=Math.max(ry,s),f=Math.max(ry,d);g({x:dy(r,ry,l),y:dy(i,ry,f)})},t=e=>{u.current.pointerId===e.pointerId&&(y(!1),u.current={pointerId:null,offsetX:0,offsetY:0})};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[v,q]);const W=t.useCallback(e=>{if(0!==e.button&&"touch"!==e.pointerType)return;if(e.target instanceof Element&&e.target.closest("button"))return;const t=l.current;if(!t)return;e.preventDefault();const n=e.currentTarget;if("function"==typeof n.setPointerCapture)try{n.setPointerCapture(e.pointerId)}catch{}const r=t.getBoundingClientRect();u.current={pointerId:e.pointerId,offsetX:e.clientX-r.left,offsetY:e.clientY-r.top},c.current=!1,y(!0)},[]),G=t.useCallback(()=>{!a&&s&&s()},[a,s]),V=t.useCallback(()=>{D(e=>({key:U,n:e.n+1}))},[U]),K=t.useCallback(e=>{const t=ly(e);return C(t),function(e){try{window.localStorage.setItem(iy,String(e))}catch{}}(t),t},[]),Y=_>70,X=_<180,J=t.useCallback(()=>{Y&&E(`Tamanho do formulário: ${K(_-10)}%`)},[K,Y,_]),Z=t.useCallback(()=>{X&&E(`Tamanho do formulário: ${K(_+10)}%`)},[K,X,_]),Q=t.useCallback(()=>{K(oy),E("")},[K]);t.useEffect(()=>{if(!e||"undefined"==typeof document)return;const t=l.current,n=document.activeElement;return h.current=n&&n!==document.body?n:null,!t||n&&n!==document.body||t.focus({preventScroll:!0}),()=>{const e=h.current;f.current&&e&&e.isConnected&&e.focus({preventScroll:!0}),f.current=!1}},[e]);const ee=t.useCallback(()=>{f.current=!0},[]),te=t.useCallback(e=>{e.currentTarget.contains(e.relatedTarget)||(f.current=!1)},[]),ne=t.useCallback(e=>{"Escape"!==e.key||a||(e.stopPropagation(),G())},[G,a]);if(!e)return null;const re=(null==A?void 0:A.rows)&&A.rows.length>0?A.rows:[],ie=re.length>0,oe=Boolean(A&&A.fields.length>0),ae=ie||oe,se={zoom:N,width:"520px",maxWidth:`${Math.max(160,Math.floor((b.width-32)/N))}px`,maxHeight:`${Math.max(120,Math.floor((b.height-32)/N))}px`},de=N<1?Math.ceil(28/N):28,le={width:`${de}px`,height:`${de}px`},ue={height:`${de}px`,minWidth:`${Math.ceil(48/Math.min(N,1))}px`},ce=$.jsx("div",{ref:l,role:"dialog","aria-labelledby":p,tabIndex:-1,onKeyDown:ne,onFocus:ee,onBlur:te,className:Xh`fixed z-[9999] overflow-hidden rounded-xl border border-gray-300 bg-white text-gray-900 shadow-2xl focus:outline-none`,style:{left:`${m.x}px`,top:`${m.y}px`,maxWidth:"calc(100vw - 32px)",maxHeight:"calc(100vh - 32px)"},children:$.jsxs("div",{"data-testid":"campaign-form-scaled","data-scale":w?_:oy,className:Xh`flex flex-col`,style:se,children:[$.jsxs("div",{onPointerDown:W,className:Xh`flex flex-wrap cursor-move select-none items-center gap-2 border-b border-gray-200 bg-gradient-to-r from-blue-600 to-blue-700 px-3 py-2.5 text-white`,style:{touchAction:"none"},children:[$.jsxs("div",{className:Xh`flex min-w-[7rem] flex-1 items-center gap-2`,children:[$.jsx(Hc,{"aria-hidden":!0,className:Xh`h-5 w-5 flex-shrink-0`}),$.jsx("h3",{id:p,className:Xh`truncate text-sm font-bold`,children:"Informações da Campanha"})]}),w&&$.jsxs("div",{role:"group","aria-label":"Tamanho do formulário",className:Xh`ml-auto flex flex-shrink-0 items-center gap-0.5`,children:[$.jsx("button",{type:"button",onClick:J,"aria-disabled":!Y,"aria-label":"Diminuir o tamanho do formulário",title:"Diminuir o formulário e o texto",className:Xh`${ay} ${Y?"":"cursor-not-allowed"}`,style:le,children:$.jsx(Pc,{"aria-hidden":!0,className:Xh`h-4 w-4 ${Y?"":"opacity-40"}`})}),$.jsxs("button",{type:"button",onClick:Q,"aria-label":`Tamanho atual ${_}%. Restaurar o tamanho padrão`,title:"Restaurar o tamanho padrão (100%)",className:Xh`flex-shrink-0 rounded-md px-1 text-center text-xs font-semibold tabular-nums transition hover:bg-black hover:bg-opacity-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white`,style:ue,children:[_,"%"]}),$.jsx("button",{type:"button",onClick:Z,"aria-disabled":!X,"aria-label":"Aumentar o tamanho do formulário",title:"Aumentar o formulário e o texto",className:Xh`${ay} ${X?"":"cursor-not-allowed"}`,style:le,children:$.jsx(Bc,{"aria-hidden":!0,className:Xh`h-4 w-4 ${X?"":"opacity-40"}`})}),$.jsx("span",{role:"status",className:Xh`sr-only`,children:S})]}),$.jsx("button",{type:"button",onClick:G,disabled:a,"aria-label":a?"Aguarde o fim da chamada para fechar":"Fechar",className:Xh`${ay} rounded-full disabled:cursor-not-allowed disabled:opacity-40`,style:le,title:a?"Aguarde o fim da chamada para fechar":"Fechar",children:$.jsx(Yc,{"aria-hidden":!0,className:Xh`h-5 w-5`})})]}),$.jsxs("div",{tabIndex:0,role:"region","aria-label":"Dados do contato",className:Xh`min-h-0 flex-1 space-y-3 overflow-y-auto p-4 focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500`,children:[$.jsxs("div",{className:Xh`grid grid-cols-2 gap-3`,children:[$.jsxs("div",{className:Xh`flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2`,children:[$.jsx(Tc,{"aria-hidden":!0,className:Xh`h-4 w-4 text-gray-500`}),$.jsxs("div",{children:[$.jsx("p",{className:Xh`text-[10px] text-gray-500 uppercase tracking-wide font-medium`,children:"Duração"}),$.jsx("p",{className:Xh`text-sm font-bold text-gray-800`,children:hy(o)})]})]}),$.jsxs("div",{className:Xh`flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2`,children:[$.jsx(Hc,{"aria-hidden":!0,className:Xh`h-4 w-4 text-gray-500`}),$.jsxs("div",{className:Xh`min-w-0 flex-1`,children:[$.jsx("p",{className:Xh`text-[10px] text-gray-500 uppercase tracking-wide font-medium`,children:"Cliente"}),$.jsx("p",{className:Xh`truncate text-sm font-bold text-gray-800`,children:(null==L?void 0:L.label)||"N/A"})]})]})]}),I&&$.jsxs("div",{className:Xh`rounded-lg border border-blue-200 bg-blue-50 p-6 text-center`,role:"status",children:[$.jsx("div",{className:Xh`mx-auto mb-2 inline-block h-6 w-6 animate-spin rounded-full border-2 border-blue-500 border-t-transparent`}),$.jsx("p",{className:Xh`text-xs font-medium text-blue-700`,children:"Carregando dados do contato..."})]}),j&&!I&&$.jsx("div",{className:Xh`rounded-lg border border-red-200 bg-red-50 p-3`,children:$.jsxs("div",{className:Xh`flex items-center gap-2`,children:[$.jsx(_c,{"aria-hidden":!0,className:Xh`h-4 w-4 flex-shrink-0 text-red-600`}),$.jsxs("div",{className:Xh`min-w-0 flex-1`,children:[$.jsx("p",{className:Xh`text-xs font-semibold text-red-700`,children:"Erro ao carregar dados"}),$.jsx("p",{className:Xh`text-[10px] text-red-600`,children:j})]}),$.jsx("button",{type:"button",onClick:V,className:Xh`rounded-md border border-red-300 bg-white px-2 py-1 text-[11px] font-semibold text-red-700 transition hover:bg-red-100`,children:"Tentar novamente"})]})}),!I&&!j&&ie&&$.jsx("div",{className:Xh`space-y-2`,children:re.map((e,t)=>{return $.jsx("div",{className:Xh`grid gap-2 ${n=e.length,2===n?"grid-cols-2":3===n?"grid-cols-3":4===n?"grid-cols-4":n>=5?"grid-cols-5":"grid-cols-1"}`,children:e.map((e,n)=>$.jsx(my,{label:e.label,value:e.value||"-",fullWidth:"100%"===e.width},`${t}-${n}-${e.key}`))},t);var n})}),!I&&!j&&!ie&&oe&&A&&$.jsx("div",{className:Xh`grid grid-cols-2 gap-2`,children:A.fields.map(e=>$.jsx(my,{label:e.label,value:e.value||"-"},e.key))}),!I&&!j&&!ae&&$.jsxs("div",{className:Xh`flex flex-col items-center justify-center rounded-lg border border-gray-200 bg-gray-50 px-4 py-8 text-center`,children:[$.jsx(Hc,{"aria-hidden":!0,className:Xh`mb-2 h-8 w-8 text-gray-400`}),$.jsx("p",{className:Xh`text-sm text-gray-500`,children:"Nenhum dado disponível"})]})]}),a&&$.jsx("div",{className:Xh`border-t border-gray-200 bg-gray-50 px-4 py-2`,children:$.jsx("p",{className:Xh`text-center text-xs text-gray-500`,children:"Aguarde o fim da chamada para fechar"})})]})});return"undefined"!=typeof document?n.createPortal(ce,d??document.body):null}function my({label:e,value:t,fullWidth:n}){const r=n?"col-span-full":"";return $.jsxs("div",{className:Xh`rounded-lg border border-gray-200 bg-white p-2 ${r}`,children:[$.jsx("p",{className:Xh`mb-0.5 truncate text-[9px] font-semibold uppercase tracking-wide text-gray-500`,children:e}),$.jsx("p",{className:Xh`overflow-hidden break-words text-xs font-semibold text-gray-800`,style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:t})]})}if("undefined"!=typeof window&&!window.__fetchIntercepted__){window.__fetchIntercepted__=!0;const e=window.fetch.bind(window);window.fetch=async function(t,n){const r=`req_${Date.now()}_${Math.random().toString(36).substring(2,8)}`,i="string"==typeof t?t:t instanceof URL?t.href:t.url,o=(null==n?void 0:n.method)||(t instanceof Request?t.method:"GET"),a={};(null==n?void 0:n.headers)&&(n.headers instanceof Headers?n.headers.forEach((e,t)=>{a[t]=t.toLowerCase().includes("token")||t.toLowerCase().includes("auth")?`${e.substring(0,30)}...(${e.length} chars)`:e}):Array.isArray(n.headers)?n.headers.forEach(([e,t])=>{a[e]=e.toLowerCase().includes("token")||e.toLowerCase().includes("auth")?`${t.substring(0,30)}...(${t.length} chars)`:t}):Object.entries(n.headers).forEach(([e,t])=>{a[e]=e.toLowerCase().includes("token")||e.toLowerCase().includes("auth")?`${String(t).substring(0,30)}...(${String(t).length} chars)`:String(t)}));const s=performance.now();if(console.log(`%c[FETCH ${r}] ➡️ ${o} ${i}`,"color: #4CAF50; font-weight: bold"),console.log(`[FETCH ${r}] Headers:`,JSON.stringify(a,null,2)),null==n?void 0:n.body)try{const e="string"==typeof n.body?n.body:JSON.stringify(n.body);console.log(`[FETCH ${r}] Body:`,e.substring(0,500))}catch{console.log(`[FETCH ${r}] Body: [não serializável]`)}console.log(`[FETCH ${r}] credentials: ${(null==n?void 0:n.credentials)||"default"}, mode: ${(null==n?void 0:n.mode)||"default"}`),Uv("network","Request",`➡️ ${o} ${i.substring(0,60)}...`,{requestId:r,method:o,url:i,headers:a,credentials:null==n?void 0:n.credentials});try{const o=await e(t,n),l=performance.now(),u=Math.round(l-s),c={};o.headers.forEach((e,t)=>{c[t]=e});const f=o.ok?"#4CAF50":"#F44336";if(console.log(`%c[FETCH ${r}] ⬅️ ${o.status} ${o.statusText} (${u}ms)`,`color: ${f}; font-weight: bold`),console.log(`[FETCH ${r}] Response Headers:`,JSON.stringify(c,null,2)),Uv(o.ok?"network":"error","Response",`⬅️ ${o.status} ${i.substring(0,40)}... (${u}ms)`,{requestId:r,status:o.status,statusText:o.statusText,duration:u,headers:c}),401===o.status||403===o.status){console.error(`%c[FETCH ${r}] ❌ AUTH ERROR ${o.status}`,"color: #F44336; font-weight: bold; font-size: 14px"),console.error(`[FETCH ${r}] URL completa:`,i),console.error(`[FETCH ${r}] Todos os headers enviados:`,a);try{const e=o.clone(),t=await e.text();console.error(`[FETCH ${r}] Response Body:`,t),Uv("error","AuthError",`❌ ${o.status} - ${t.substring(0,200)}`,{requestId:r,url:i,headers:a,responseBody:t})}catch(d){console.error(`[FETCH ${r}] Não foi possível ler body do erro:`,d)}}return o}catch(l){const e=performance.now(),t=Math.round(e-s);throw console.error(`%c[FETCH ${r}] ❌ NETWORK ERROR (${t}ms)`,"color: #F44336; font-weight: bold"),console.error(`[FETCH ${r}] Error:`,l),Uv("error","NetworkError",`❌ ${i.substring(0,40)}... - ${String(l)}`,{requestId:r,url:i,error:String(l),duration:t}),l}},console.log("%c[FETCH INTERCEPTOR] ✅ Ativo - todas as requisições serão logadas","color: #2196F3; font-weight: bold; font-size: 12px")}function gy(e,t){return om({values:e},t)}function $y(e){t.useEffect(()=>{if(!document.querySelector('link[data-mobile-dialer-fa="true"]')){const e=document.createElement("link");e.rel="stylesheet",e.href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css",e.dataset.mobileDialerFa="true",document.head.appendChild(e)}},[]);const n=E$(),r=function(e,t){return"compact"===e||"comfortable"===e?e:t.touchLike?"comfortable":"compact"}(e.density,n);return e.isAuthenticated?$.jsx(xy,{...e,density:r}):$.jsx(vy,{...e,density:r})}function vy({username:e,onLogin:n,isLoadingSession:r,sessionError:i,sessionStatus:o,loginConfirmation:a,onCancelLoginConfirmation:s,onTakeOverSession:d,onLogoutAllTabs:l,density:u}){const[c,f]=t.useState(e??""),[h,p]=t.useState(null);t.useEffect(()=>{f(e??"")},[e]);const m=t.useCallback(async e=>{const t=e.trim();if(t){p(null);try{await Promise.resolve(n(t))}catch(r){p("Falha ao autenticar."),console.error("Erro login",r)}}else p("Informe o usuário Callix.")},[n]),g=t.useCallback(()=>m(c),[m,c]),v=Boolean(a)&&!r,y=((null==a?void 0:a.username)||c||e||"").trim();return $.jsx("div",{className:"phone-container","data-density":"compact"===u?"compact":"comfortable",children:$.jsxs("div",{className:"screen dialer-screen login-screen active",id:"dialerScreen",children:[$.jsx("div",{className:"dialer-header",children:$.jsx("div",{className:"status-container",children:$.jsxs("button",{type:"button",className:"status-badge "+(r?"connecting":"available"),children:[$.jsx("span",{className:"status-dot"}),$.jsx("span",{className:"status-text",children:r?"Conectando":"Login"})]})})}),r?$.jsxs("div",{className:"login-loading",role:"status","aria-live":"polite",children:[$.jsx("div",{className:"login-spinner","aria-hidden":"true"}),y&&$.jsx("div",{className:"login-loading-user",children:y}),$.jsx("div",{className:"login-status",children:o||"Conectando..."})]}):v&&a?a.elsewhere?$.jsxs("div",{className:"login-confirm","data-login-state":"elsewhere",children:[$.jsx("div",{className:"login-confirm-label",children:"Discador ativo em outra aba"}),$.jsxs("div",{className:"login-user-chip",children:[$.jsx("i",{className:"fas fa-user-check","aria-hidden":"true"}),$.jsx("span",{children:a.username})]}),i&&$.jsx("div",{className:"input-error",children:i}),$.jsxs("button",{type:"button",className:"login-confirm-btn login-confirm-btn-blue",id:"takeOverBtn",onClick:()=>null==d?void 0:d(),children:[$.jsx("i",{className:"fas fa-arrow-down","aria-hidden":"true"}),$.jsx("span",{children:"Usar o discador nesta aba"})]}),$.jsx("button",{type:"button",className:"login-secondary-btn login-secondary-danger",id:"logoutAllBtn",onClick:()=>null==l?void 0:l(),children:"Sair em todas as abas"}),$.jsx("p",{className:"login-hint",children:"O Callix aceita uma conexão por usuário: você já está conectado em outra aba deste navegador e pode continuar por lá."})]}):$.jsxs("div",{className:"login-confirm","data-login-state":"choose",children:[$.jsx("div",{className:"login-confirm-label",children:"Entrar como"}),$.jsxs("div",{className:"login-user-chip",children:[$.jsx("i",{className:"fas fa-user","aria-hidden":"true"}),$.jsx("span",{children:a.username})]}),i&&$.jsx("div",{className:"input-error",children:i}),!i&&a.note&&$.jsx("div",{className:"login-note",children:a.note}),$.jsxs("button",{type:"button",className:"login-confirm-btn",id:"loginConfirmBtn",onClick:()=>{m(a.username)},children:[$.jsx("i",{className:"fas fa-sign-in-alt","aria-hidden":"true"}),$.jsx("span",{children:"Entrar"})]}),!a.locked&&s&&$.jsx("button",{type:"button",className:"login-secondary-btn",onClick:s,children:"Usar outro usuário"}),$.jsx("p",{className:"login-hint",children:"Ao entrar, todas as abas abertas passam a usar o discador. Vai usar o Callix web? Então não entre aqui: nada é conectado sem a sua confirmação."})]}):$.jsxs($.Fragment,{children:[$.jsx("div",{className:"phone-number-display",children:$.jsx("input",{type:"text",className:"phone-input",placeholder:"Digite seu usuário Callix",value:c,onChange:e=>f(e.target.value),onKeyDown:e=>"Enter"===e.key&&g(),autoCapitalize:"none",autoCorrect:"off",spellCheck:!1})}),h&&$.jsx("div",{className:"input-error",children:h}),i&&$.jsx("div",{className:"input-error",children:i}),$.jsxs("div",{className:"call-actions",children:[$.jsx("div",{className:"empty-space"}),$.jsx("button",{type:"button",className:"call-button",onClick:g,"aria-label":"Entrar",children:$.jsx("i",{className:"fas fa-sign-in-alt"})}),$.jsx("div",{className:"empty-space"})]})]})]})})}function yy(e,t){if(!e)return;const n=Object.entries(e),r=t.map(e=>e.toLowerCase());for(const[i,o]of n)if(r.includes(i.toLowerCase()))return o}function by(e,t){const n=function(e){if(!e)return"";const t=e.trim().split(/\s+/)[0]||"";return t?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():""}(e);if(!t||"object"!=typeof t||0===Object.keys(t).length)return console.log("[WhatsApp Template] Sem dados de contato, usando mensagem genérica"),`Olá! Aqui é *${n}*, do Grupo Villela. Estou entrando em contato para dar continuidade ao nosso atendimento. Posso ajudar?`;console.log("[WhatsApp Template] Operador:",e,"-> Primeiro nome:",n),console.log("[WhatsApp Template] Campos recebidos:",t),console.log("[WhatsApp Template] Chaves disponíveis:",Object.keys(t));const r=yy(t,["DECISOR","SOCIO","NOME","PROSPECT","CLIENTE","CONTATO"]);console.log("[WhatsApp Template] Prospect encontrado:",r);const i=yy(t,["EMPRESA","RAZAO SOCIAL","RAZÃO SOCIAL","RAZAO_SOCIAL","COMPANY","NOME_EMPRESA"]);console.log("[WhatsApp Template] Empresa encontrada:",i);const o=yy(t,["BENEFICIO","BENEFÍCIO","CAPITAL_RECUPERAR","CAPITAL A RECUPERAR","POTENCIAL","VALOR_RECUPERAR","VALOR RECUPERADO"]);if(console.log("[WhatsApp Template] Potencial encontrado:",o),!r&&!i&&!o)return console.log("[WhatsApp Template] Nenhum campo útil encontrado, usando mensagem genérica"),`Olá! Aqui é *${n}*, do Grupo Villela. Estou entrando em contato para dar continuidade ao nosso atendimento. Posso ajudar?`;let a=`Oi, *${r||"tudo bem"}*. Aqui é *${n}*, do Grupo Villela. Empresa líder no mercado de redução de dívidas e recuperação de capital, com mais de 20 anos de experiência.`;return i&&(a+=`\n\nVimos que a *${i}* tem um débito federal que contém cobranças indevidas.`),o?a+=`\n\nEm uma análise preliminar, verificamos que é possível recuperar para sua empresa um valor aproximado de *${o}*.`:i&&(a+="\n\nEm uma análise preliminar, verificamos que é possível recuperar valores significativos para sua empresa."),a+="\n\nGostaríamos de fazer um *diagnóstico gratuito* para te apresentar os valores reais que a empresa pode economizar. Posso te encaminhar o link para autorização?",a}function xy({username:e,onLogout:n,showClientInfoModal:r=!1,density:i}){var o,a,s,d,l;const{skipManualQualification:u}=Yy(),[c,f]=t.useState(""),[h,p]=t.useState("dialer"),[m,g]=t.useState(!1),[v,y]=t.useState(!1),[b,x]=t.useState("success"),[w,_]=t.useState(null),[C,S]=t.useState(null),[E,N]=t.useState(0),[T,A]=t.useState(null),[O,I]=t.useState(!1),[k,j]=t.useState(!1);Hv();const[R,P]=t.useState(null),[D,L]=t.useState(null),[M,U]=t.useState(0),[F,B]=t.useState({finalData:{},isLoading:!1,error:null}),[q,z]=t.useState([]),[H,W]=t.useState(!1),[G,V]=t.useState(null),[K,Y]=t.useState(""),[X,J]=t.useState(null),[Z,Q]=t.useState(!1),ee=t.useRef(null),te=t.useRef(0),[ne,re]=t.useState(!1),[ie,oe]=t.useState([]),[ae,se]=t.useState(null),[de,le]=t.useState("default"),[ue,ce]=t.useState(null),fe=Qu(),he=ec(),pe=nc(),{hangup:me,answer:ge,reject:$e}=ac(),ve=rc(),ye=ic(),be=oc(),xe=t.useMemo(()=>ye??[],[ye]),we=t.useMemo(()=>be??[],[be]),{makeManualCall:_e,finishAfterCall:Ce}=tc(),{goOnBreak:Se,goOffBreak:Ee}=um(),Ne=lm(null==fe?void 0:fe.breaks)||[],Te=lm(null==fe?void 0:fe.user),Ae="onBreak"===(null==he?void 0:he.state),[Oe,Ie]=sc(),ke=function(){const e=t.useCallback((e="light")=>{if("undefined"==typeof navigator||!("vibrate"in navigator))return;const t=Nv[e];try{navigator.vibrate(t)}catch{}},[]),n=t.useCallback(()=>e("light"),[e]),r=t.useCallback(()=>e("medium"),[e]),i=t.useCallback(()=>e("heavy"),[e]),o=t.useCallback(()=>e("selection"),[e]),a=t.useCallback(()=>e("success"),[e]),s=t.useCallback(()=>e("warning"),[e]),d=t.useCallback(()=>e("error"),[e]);return{trigger:e,impactLight:n,impactMedium:r,impactHeavy:i,selectionChanged:o,notificationSuccess:a,notificationWarning:s,notificationError:d}}(),je=function(e={}){const{enabled:n=!0,volume:r=Ov,duration:i=Av}=e,o=t.useRef(null),a=t.useRef([]),s=t.useCallback(()=>{var e;if(!n)return null;if(!o.current)try{const e=window.AudioContext||window.webkitAudioContext;e&&(o.current=new e)}catch{return console.warn("[useDTMF] Web Audio API não suportada"),null}return"suspended"===(null==(e=o.current)?void 0:e.state)&&o.current.resume().catch(()=>{}),o.current},[n]),d=t.useCallback(e=>{const t=s();if(!t)return;const n=Tv[e];if(!n)return;const[o,d]=n,l=t.currentTime,u=l+i/1e3;try{const e=t.createOscillator(),n=t.createOscillator(),s=t.createGain(),c=t.createGain();e.type="sine",n.type="sine",e.frequency.setValueAtTime(o,l),n.frequency.setValueAtTime(d,l),s.gain.setValueAtTime(0,l),s.gain.linearRampToValueAtTime(r,l+Iv),s.gain.setValueAtTime(r,u-Iv),s.gain.linearRampToValueAtTime(0,u),c.gain.setValueAtTime(0,l),c.gain.linearRampToValueAtTime(r,l+Iv),c.gain.setValueAtTime(r,u-Iv),c.gain.linearRampToValueAtTime(0,u),e.connect(s),s.connect(t.destination),n.connect(c),c.connect(t.destination),e.start(l),n.start(l),e.stop(u+.01),n.stop(u+.01),a.current.push(e,n),setTimeout(()=>{a.current=a.current.filter(t=>t!==e&&t!==n)},i+50)}catch(c){console.warn("[useDTMF] Erro ao tocar tom:",c)}},[s,i,r]),l=t.useCallback(()=>{a.current.forEach(e=>{try{e.stop()}catch{}}),a.current=[]},[]);return t.useEffect(()=>()=>{l(),o.current&&(o.current.close().catch(()=>{}),o.current=null)},[l]),{play:d,stopAll:l,isSupported:"undefined"!=typeof window&&!(!window.AudioContext&&!window.webkitAudioContext)}}({enabled:!0}),Re=t.useRef(""),Pe=t.useRef(null),De=t.useCallback(e=>!!["*#0000#","*#3284#"].includes(e)&&(Uv("info","Debug","🔓 Código secreto detectado - abrindo painel de debug"),j(!0),f(""),Re.current="",!0),[]);t.useEffect(()=>{var e,t;const n=async()=>{try{const t=document.createElement("audio");if(!("setSinkId"in t))return console.log("[MobileDialer] setSinkId não suportado neste navegador"),void ce(!1);let n=!1,r=await navigator.mediaDevices.enumerateDevices(),i=r.filter(e=>"audiooutput"===e.kind);if(!i.some(e=>e.label&&e.label.length>0)&&i.length>0){console.log("[MobileDialer] Labels vazios, solicitando permissão de áudio...");try{const e=await navigator.mediaDevices.getUserMedia({audio:!0});n=!0,e.getTracks().forEach(e=>e.stop()),r=await navigator.mediaDevices.enumerateDevices(),i=r.filter(e=>"audiooutput"===e.kind),console.log("[MobileDialer] Permissão concedida. Dispositivos:",i.length,i)}catch(e){console.log("[MobileDialer] Usuário negou permissão de áudio:",e)}}else n=!0;if(console.log("[MobileDialer] Dispositivos de saída encontrados:",i.length,i),i.length<=1)return console.log("[MobileDialer] Apenas um dispositivo de saída - viva-voz não disponível"),void ce(!1);oe(i);const o=i.find(e=>e.label.toLowerCase().includes("speaker")||e.label.toLowerCase().includes("alto-falante")||e.label.toLowerCase().includes("viva-voz")),a=i.find(e=>"default"===e.deviceId||e.label.toLowerCase().includes("default")||e.label.toLowerCase().includes("earpiece")||e.label.toLowerCase().includes("fone"))||i[0];if(o&&o.deviceId!==(null==a?void 0:a.deviceId))se(o.deviceId),le((null==a?void 0:a.deviceId)||"default"),ce(!0),console.log("[MobileDialer] Viva-voz disponível:",o.label);else if(i.length>1){const e=i.find(e=>e.deviceId!==(null==a?void 0:a.deviceId));e?(se(e.deviceId),le((null==a?void 0:a.deviceId)||"default"),ce(!0),console.log("[MobileDialer] Usando dispositivo alternativo para viva-voz:",e.label)):ce(!1)}else ce(!1)}catch(t){console.error("[MobileDialer] Erro ao detectar dispositivos de áudio:",t),ce(!1)}};n();const r=()=>{console.log("[MobileDialer] Mudança de dispositivos detectada"),n()};return null==(t=null==(e=navigator.mediaDevices)?void 0:e.addEventListener)||t.call(e,"devicechange",r),()=>{var e,t;null==(t=null==(e=navigator.mediaDevices)?void 0:e.removeEventListener)||t.call(e,"devicechange",r)}},[]);const Le=null==he?void 0:he.state,Me=t.useRef(!1);t.useEffect(()=>{if(0===Ne.length||"idle"!==Le||Me.current||Ae)return;if(!Se)return;Me.current=!0;const e=Ne.find(e=>5===e.id||e.name.toLowerCase()==="Reunião".toLowerCase());if(e)console.log("[MobileDialer] Operador conectado (idle), entrando em pausa inicial:",e.name),Promise.resolve(Se(e.id)).then(()=>{console.log("[MobileDialer] Pausa inicial aplicada com sucesso:",e.name),P(e.name),L(Date.now())}).catch(e=>{console.error("[MobileDialer] Falha ao entrar em pausa:",e),Me.current=!1});else{const e=Ne[0];console.log('[MobileDialer] Pausa "Reunião" não encontrada, usando:',e.name),Promise.resolve(Se(e.id)).then(()=>{console.log("[MobileDialer] Pausa inicial aplicada com sucesso:",e.name),P(e.name),L(Date.now())}).catch(e=>{console.error("[MobileDialer] Falha ao entrar em pausa:",e),Me.current=!1})}},[Ne,Le,Ae,Se]),t.useEffect(()=>{console.log("[MobileDialer] Breaks loaded:",Ne),Uv("state","Breaks",`Pausas carregadas: ${Ne.length}`,Ne)},[Ne]),t.useEffect(()=>{console.log("[MobileDialer] Call state changed:",Le),Uv("state","CallState",`Estado da chamada: ${Le}`,{callState:Le,isOnBreak:Ae}),"offline"===Le&&(console.warn("[MobileDialer] Estado OFFLINE detectado - verifique a conexão"),Uv("warn","Connection","⚠️ Estado OFFLINE detectado"))},[Le,Ae]),t.useEffect(()=>{ve&&console.log("[MobileDialer] Call info atualizado:",{type:null==ve?void 0:ve.type,info:"campaign"===(null==ve?void 0:ve.type)?{campaign:ve.info.campaign,campaignContact:ve.info.campaignContact}:ve})},[ve]);const Ue=t.useMemo(()=>{var e;return"campaign"===(null==ve?void 0:ve.type)?em(ve.info,(null==(e=null==pe?void 0:pe.data)?void 0:e.campaignContactPhoneId)??null):null},[ve,pe]),Fe=Ue?Qp(Ue):null,Be=t.useRef(Ue);Be.current=Ue,t.useEffect(()=>{const e=Be.current;if(!e||!Fe)return void B({finalData:{},isLoading:!1,error:null});let t=!1,n=null;B({finalData:{},isLoading:!0,error:null}),Uv("debug","FetchContact","Buscando formulário do contato",{contactId:e.id,source:e.source});const r=t=>{B({finalData:t.values,isLoading:!1,error:null}),Uv("info","FetchContact",`✅ Formulário: ${t.fields.length} campos (${t.valuesSource}, layout ${t.layoutSource})`,{contactId:e.id,partial:!0===t.partial})};return rm(e).then(i=>{t||(r(i),i.partial&&(n=setTimeout(()=>{t||rm(e,{force:!0}).then(e=>{t||r(e)}).catch(()=>{})},3e3)))}).catch(e=>{t||(console.error("[MobileDialer] Erro ao buscar o formulário:",e),B({finalData:{},isLoading:!1,error:e instanceof Error?e.message:"Erro ao buscar dados"}))}),()=>{t=!0,n&&clearTimeout(n)}},[Fe]);const qe=Le,{notice:ze,dismiss:He,recheckDevices:We}=ny(),[Ge,Ve]=t.useState(0),Ke="startupError"===qe||"offline"===qe||"device"===(null==ze?void 0:ze.source)||"session"===(null==ze?void 0:ze.source),Ye=!qe||"starting"===qe||"idle"===qe||"manualCallSetup"===qe||"onBreak"===qe,Xe="manualCallSetup"===Le||"manualCallRinging"===Le||"callRinging"===Le,Je="callInProgress"===Le,Ze="afterCall"===Le,Qe=t.useMemo(()=>ve&&"campaign"===ve.type?ve.info:null,[ve]);t.useEffect(()=>{r&&(Je||Xe)&&"campaign"===(null==ve?void 0:ve.type)&&I(!0)},[r,Je,Xe,ve]),t.useEffect(()=>{r&&(Je||Xe||Ze||I(!1))},[r,Je,Xe,Ze]),t.useEffect(()=>{if(!Je)return void N(0);const e=setInterval(()=>{N(e=>e+1)},1e3);return()=>clearInterval(e)},[Je]),t.useEffect(()=>{if(!Ae||!D)return;const e=setInterval(()=>{const e=Math.floor((Date.now()-D)/1e3);U(e)},1e3);return()=>clearInterval(e)},[Ae,D]),t.useEffect(()=>{!Ae&&R&&(P(null),L(null),U(0))},[Ae,R]),t.useEffect(()=>{const e=e=>{const t=e.detail;(null==t?void 0:t.phone)&&(A(null),f(k$(t.phone).slice(0,32)),p("dialer"),Uv("event","Call",`🖱️ Click-to-call recebido: ${t.phoneDisplay}`,{taskId:t.id,source:t.source}))};return window.addEventListener(N$,e),()=>window.removeEventListener(N$,e)},[]),t.useEffect(()=>{console.log("[MobileDialer] Screen control effect - callState:",Le,"isInCall:",Je,"isConnecting:",Xe,"isAfterCall:",Ze),Je||Xe?p("call"):(Ze||Ye||Ae)&&p("dialer")},[Je,Xe,Ze,Ye,Ae,Le]),t.useEffect(()=>{if(Ze){console.log("[MobileDialer] 📋 afterCall triggered - callInfo:",JSON.stringify(ve,null,2)),console.log("[MobileDialer] 📋 afterCall - callInfo?.type:",null==ve?void 0:ve.type),console.log("[MobileDialer] 📋 afterCall - skipManualQualification:",u),console.log("[MobileDialer] 📋 afterCall - successQualifications:",xe.length),console.log("[MobileDialer] 📋 afterCall - discardQualifications:",we.length);if("campaign"===(null==ve?void 0:ve.type)&&!0===ve.info.campaign.skipCallQualification&&Ce)return console.log("[MobileDialer] 🚀 Campanha com skipCallQualification - finalizando automaticamente"),void Promise.resolve(Ce({result:"success",qualificationId:void 0}));if("manual"===(null==ve?void 0:ve.type)&&Ce)return console.log("[MobileDialer] 🚀 Chamada MANUAL detectada - finalizando automaticamente (chamadas manuais NUNCA exibem qualificação)"),void Promise.resolve(Ce({result:"success",qualificationId:void 0}));if(0===xe.length&&0===we.length&&Ce)return console.log("[MobileDialer] 🚀 Sem qualificações configuradas - finalizando automaticamente"),void Promise.resolve(Ce({result:"success",qualificationId:void 0}));console.log("[MobileDialer] ⚠️ Abrindo modal de qualificação - tipo:",null==ve?void 0:ve.type);const e=xe.length>0;x(e?"success":"failure"),_(null),S(null),y(!0)}else y(!1)},[Ze,ve,Ce,xe,we,u]);const et=t.useMemo(()=>m$(c),[c]),tt=t.useMemo(()=>{if(/[*#]/.test(c))return null;const e=c.replace(/\D/g,"");if(!e)return null;const t=p$(e);return t&&t!==e&&v$(t)?m$(t):null},[c]),nt=t.useCallback(e=>p$(e),[]),rt=t.useCallback(e=>{if(ke.impactLight(),je.play(e),Pe.current&&clearTimeout(Pe.current),Re.current+=e,console.log("[MobileDialer] Sequência atual:",Re.current),De(Re.current))return console.log("[MobileDialer] 🔓 Código secreto detectado!"),void f("");if(Re.current.length>20&&(Re.current=Re.current.slice(-10)),Pe.current=setTimeout(()=>{Re.current=""},3e3),Je||Xe){if(pe&&"function"==typeof pe.sendDtmf)try{pe.sendDtmf(e)}catch(t){console.error("Falha ao enviar DTMF",t)}}else f(t=>(t+e).slice(0,32))},[pe,Je,Xe,ke,je,De]),it=t.useCallback(()=>{ke.impactLight(),f(e=>e.slice(0,-1))},[ke]),ot=t.useCallback(async()=>{console.log("[MobileDialer] handleCall triggered, dialValue:",c),Uv("event","Call","📞 Iniciando chamada manual",{dialValue:c});const e=nt(c);if(console.log("[MobileDialer] Sanitized number:",e),!e||!v$(e))return console.log("[MobileDialer] Invalid phone format"),Uv("warn","Call","⚠️ Número inválido",{sanitized:e,isValid:!1}),A("Número inválido. Informe o DDD e o número (fixo com 8 ou celular com 9 dígitos)."),void ke.notificationError();if(A(null),!_e)return console.error("[MobileDialer] makeManualCall is not available"),Uv("error","Call","❌ makeManualCall não disponível"),void A("Função de chamada não disponível.");const t=g$(e)??`+55${e}`;console.log("[MobileDialer] Calling makeManualCall with E.164:",t),Uv("info","Call",`📞 Ligando para ${t}`,{e164Number:t}),ke.impactMedium();try{_e(t),console.log("[MobileDialer] makeManualCall called successfully"),Uv("info","Call","✅ makeManualCall executado com sucesso")}catch(n){console.error("[MobileDialer] Erro ao iniciar chamada manual:",n),Uv("error","Call","❌ Erro ao iniciar chamada",n),A("Erro ao iniciar chamada."),ke.notificationError()}},[c,_e,nt,ke]),at=t.useCallback(async()=>{if(me){Uv("event","Call","📴 Encerrando chamada"),ke.impactHeavy();try{await me(),Uv("info","Call","✅ Chamada encerrada")}catch(e){console.error("[MobileDialer] Erro ao desligar",e)}}},[me,ke]),st=t.useCallback(()=>{ke.impactLight(),Ie(!Oe)},[Oe,Ie,ke]),dt=t.useCallback(()=>{if(ke.impactLight(),!1===ue)return console.warn("[MobileDialer] Viva-voz não suportado neste navegador/dispositivo"),void ke.notificationWarning();if(!ae||null===ue)return console.warn("[MobileDialer] Dispositivos de saída não detectados ainda"),void ke.notificationWarning();const e=!ne,t=e?ae:de;console.log("[MobileDialer] Alternando viva-voz:",e?"LIGADO":"DESLIGADO","Device:",t);try{(null==fe?void 0:fe.audioOutput)?(fe.audioOutput.setAudioOutputDevice(t),re(e),ke.notificationSuccess(),console.log("[MobileDialer] Dispositivo de saída alterado com sucesso")):(console.warn("[MobileDialer] audioOutput não disponível no operator"),ke.notificationError())}catch(n){console.error("[MobileDialer] Erro ao alternar viva-voz:",n),ke.notificationError()}},[ke,ue,ae,de,ne,fe]),lt=t.useCallback(async({phone:e,limit:t})=>{const n=null==Te?void 0:Te.id;if(!n)throw new Error("Aguardando ID do usuário");const r=new URLSearchParams({agent_id:String(n),limit:String(t)});e&&r.set("phone",e);const i=await fetch(`${Xp}/api/call-history?${r.toString()}`,{method:"GET",headers:Jp(),credentials:"omit"});if(!i.ok)throw new Error(401===i.status||403===i.status?"Sessão expirada. Entre novamente para ver o histórico.":`Erro ${i.status}`);return(await i.json()).items||[]},[null==Te?void 0:Te.id]),ut=t.useCallback(async()=>{if(null==Te?void 0:Te.id){W(!0),V(null),ee.current=null;try{const e=await lt({limit:50});console.log("[MobileDialer] Histórico recebido:",e.length,"registros"),z(e)}catch(e){console.error("[MobileDialer] Erro ao buscar histórico:",e),V(e instanceof Error&&e.message.startsWith("Sessão")?e.message:"Erro ao carregar histórico"),z([])}finally{W(!1)}}else console.log("[MobileDialer] Aguardando ID do usuário para buscar histórico")},[lt,null==Te?void 0:Te.id]),ct=t.useCallback(async e=>{Y(e);const t=dv(e),n=++te.current;if("empty"===t.kind)return J(null),void Q(!1);Q(!0);try{let e;"phone"===t.kind?e=await lt({phone:t.digits,limit:100}):(ee.current||(ee.current=await lt({limit:200})),e=ee.current),n===te.current&&J(e)}catch(r){console.error("[MobileDialer] Erro na busca do histórico:",r),n===te.current&&J(null)}finally{n===te.current&&Q(!1)}},[lt]),ft=t.useMemo(()=>{const e=dv(K);return"phone"===e.kind?"Busca por número em todo o histórico":"text"===e.kind?X?"Busca por texto nas últimas 200 chamadas":"Busca por texto nas chamadas carregadas":null},[K,X]);t.useEffect(()=>{"history"===h&&ut()},[h,ut]);const ht=t.useCallback(()=>{var t;let n="";"campaign"===(null==ve?void 0:ve.type)&&(null==(t=ve.info.campaignContact)?void 0:t.phoneNumber)?n=ve.info.campaignContact.phoneNumber:c&&(n=c);let r=n.replace(/[^\d+]/g,"");r.startsWith("+")||(r.startsWith("55")||(r="55"+r),r="+"+r);const i=by((null==Te?void 0:Te.name)||e||"",F.finalData),o=encodeURIComponent(i),a=`https://wa.me/${r.replace("+","")}?text=${o}`;console.log("[MobileDialer] Abrindo WhatsApp com template:",a),window.open(a,"_blank")},[ve,c,Te,e,F.finalData]),pt=t.useCallback(async e=>{if(Se)try{const t=Ne.find(t=>t.id===e);await Se(e),ke.notificationSuccess(),P((null==t?void 0:t.name)??"Em pausa"),L(Date.now()),U(0),g(!1)}catch(t){console.error("Erro ao entrar em pausa",t),ke.notificationError()}},[Se,Ne,ke]),mt=t.useCallback(async()=>{if(Ee)try{await Ee(),ke.notificationSuccess(),P(null),L(null),U(0),g(!1)}catch(e){console.error("Erro ao sair de pausa",e),ke.notificationError()}},[Ee,ke]),gt=t.useCallback(async()=>{if(!Ce)return;if(!("success"===b?xe:we).length)return S("Nenhuma qualificação disponível."),void ke.notificationWarning();if(!w)return S("Selecione uma qualificação."),void ke.notificationWarning();S(null),ke.impactMedium();try{await Promise.resolve(Ce({result:b,qualificationId:w})),ke.notificationSuccess(),y(!1)}catch(e){S("Erro ao enviar qualificação."),ke.notificationError(),console.error("Erro finishAfterCall",e)}},[we,Ce,b,w,xe,ke]),$t=t.useMemo(()=>{var e;return"campaign"===(null==ve?void 0:ve.type)&&(null==(e=ve.info.campaignContact)?void 0:e.phoneNumber)?m$(ve.info.campaignContact.phoneNumber):et||"(--) ----- ----"},[ve,et]),vt=t.useMemo(()=>Xe?"Ligando...":Je?"Em chamada":Ze?"Encerrando...":"manualCallFailed"===qe?"Chamada não concluída":Ke?(null==ze?void 0:ze.title)??"Erro de conexão":Ae?"Em pausa":"Disponível",[qe,ze,Ze,Xe,Ke,Je,Ae]),yt=t.useMemo(()=>Ke?"error":Ae?"paused":"available",[Ke,Ae]),bt="onBreak"===(null==he?void 0:he.state)?null==(o=he.break)?void 0:o.name:void 0,xt=t.useMemo(()=>Ke?"device"===(null==ze?void 0:ze.source)?ze.title:"Erro":Ae?R||bt||"Em pausa":"Disponível",[ze,Ke,Ae,R,bt]),wt=t.useMemo(()=>{const e=Math.floor(M/3600),t=Math.floor(M%3600/60).toString().padStart(2,"0"),n=(M%60).toString().padStart(2,"0");return e>0?`${e}:${t}:${n}`:`${t}:${n}`},[M]),_t=t.useMemo(()=>`${Math.floor(E/60).toString().padStart(2,"0")}:${(E%60).toString().padStart(2,"0")}`,[E]),Ct=(e,t)=>$.jsxs("div",{className:"key","data-value":e,onClick:()=>rt(e),role:"button","aria-label":`Tecla ${e}`,children:[$.jsx("span",{className:"number","aria-hidden":"true",children:e}),$.jsx("span",{className:"letters","aria-hidden":"true",children:t||" "})]},e);return k?$.jsx(Kv,{onClose:()=>{j(!1),Uv("info","Debug","🔒 Painel de debug fechado")}}):$.jsxs("div",{className:"phone-container","data-density":"compact"===i?"compact":"comfortable",style:{"--notice-h":`${Ge}px`},children:[$.jsxs("div",{className:"screen dialer-screen "+("dialer"===h?"active":""),id:"dialerScreen",children:[$.jsxs("div",{className:"dialer-header",children:[$.jsx("div",{className:"status-container",children:$.jsxs("button",{className:`status-badge ${yt}`,id:"statusBadge",children:[$.jsx("span",{className:"status-dot"}),Ae?$.jsxs("div",{className:"status-info",children:[$.jsx("span",{className:"status-text",children:xt}),$.jsx("span",{className:"pause-timer",children:wt})]}):$.jsx("span",{className:"status-text",children:xt})]})}),$.jsxs("div",{className:"status-actions",children:[Ae?$.jsxs("button",{className:"resume-btn",id:"resumeBtn",onClick:mt,children:[$.jsx("i",{className:"fas fa-play"}),$.jsx("span",{children:"Voltar"})]}):$.jsxs("button",{className:"pause-btn",id:"pauseBtn",onClick:()=>g(!0),children:[$.jsx("i",{className:"fas fa-pause"}),$.jsx("span",{children:"Pausa"})]}),$.jsx("button",{type:"button",className:"logout-btn",id:"logoutBtn",title:"Sair do discador (todas as abas)","aria-label":"Sair do discador",onClick:()=>{("undefined"==typeof window||window.confirm("Sair do discador em todas as abas?"))&&n()},children:$.jsx("i",{className:"fas fa-right-from-bracket"})})]})]}),$.jsx(Yv,{notice:ze,onDismiss:He,onRecheck:()=>{We()},onHeightChange:Ve}),$.jsx("div",{className:"phone-number-display",children:$.jsx(rv,{id:"phoneNumber",className:"phone-input",placeholder:"","aria-label":"Número de telefone",value:c,onChange:e=>f(e.slice(0,32)),onSubmit:()=>{ot()}})}),tt&&$.jsxs("div",{className:"dial-preview",children:["Será discado: ",tt]}),$.jsxs("div",{className:"keypad",children:[Ct("1",""),Ct("2","ABC"),Ct("3","DEF"),Ct("4","GHI"),Ct("5","JKL"),Ct("6","MNO"),Ct("7","PQRS"),Ct("8","TUV"),Ct("9","WXYZ"),Ct("*",""),Ct("0","+"),Ct("#","")]}),T&&$.jsx("div",{className:"input-error",children:T}),$.jsxs("div",{className:"call-actions",children:[$.jsx("div",{className:"empty-space"}),$.jsx("button",{className:"call-button",id:"callButton",onClick:ot,disabled:!et||!Ye,children:$.jsx("i",{className:"fas fa-phone"})}),$.jsx("button",{className:"delete-button",id:"deleteButton",style:{visibility:c?"visible":"hidden"},onClick:it,children:$.jsx("i",{className:"fas fa-delete-left"})})]})]}),$.jsxs("div",{className:"screen call-screen "+("call"===h?"active":""),id:"callScreen",children:[$.jsxs("div",{className:"call-info",children:[$.jsxs("div",{className:"call-status",children:[$.jsx("span",{className:"operator-badge-small",children:(null==e?void 0:e.slice(0,2).toUpperCase())||"OP"}),Je?$.jsx("span",{id:"callTimer",children:_t}):$.jsx("span",{id:"callStatus",children:vt})]}),$.jsx("div",{className:"call-number",id:"callNumber",children:$t}),$.jsx("div",{className:"call-location",children:"Brasil"}),"campaign"===(null==ve?void 0:ve.type)&&$.jsx("div",{className:"client-card",id:"clientCard",children:F.isLoading?$.jsxs("div",{className:"client-card-loading",children:[$.jsx("i",{className:"fas fa-spinner fa-spin"}),$.jsx("span",{children:"Carregando dados..."})]}):F.error?$.jsxs("div",{className:"client-card-error",children:[$.jsx("i",{className:"fas fa-exclamation-circle"}),$.jsx("span",{children:F.error})]}):$.jsxs($.Fragment,{children:[$.jsxs("div",{className:"client-card-header",children:[$.jsx("i",{className:"fas fa-user-circle client-avatar"}),$.jsxs("div",{className:"client-main-info",children:[$.jsx("span",{className:"client-name",id:"clientName",children:gy(F.finalData,["DECISOR","NOME","CLIENTE","PROSPECT"])??(null==(a=ve.info.campaignContact)?void 0:a.label)??"--"}),$.jsx("span",{className:"client-company",id:"clientCompany",children:gy(F.finalData,["EMPRESA","RAZAO SOCIAL","RAZÃO SOCIAL","RAZAO_SOCIAL"])??(null==(s=ve.info.campaign)?void 0:s.name)??"--"})]})]}),$.jsx("div",{className:"client-card-divider"}),$.jsxs("div",{className:"client-info-list",children:[$.jsxs("div",{className:"client-info-row",children:[$.jsx("span",{className:"client-info-label",children:"Socio"}),$.jsx("span",{className:"client-info-value",children:gy(F.finalData,["SOCIO","PROSPECT","DECISOR","NOME","CLIENTE"])??(null==(d=ve.info.campaignContact)?void 0:d.label)??"--"})]}),$.jsxs("div",{className:"client-info-row",children:[$.jsx("span",{className:"client-info-label",children:"Empresa"}),$.jsx("span",{className:"client-info-value",children:gy(F.finalData,["EMPRESA","RAZAO SOCIAL","RAZÃO SOCIAL","RAZAO_SOCIAL","COMPANY"])??"--"})]}),$.jsxs("div",{className:"client-info-row",children:[$.jsx("span",{className:"client-info-label",children:"CNPJ"}),$.jsx("span",{className:"client-info-value",children:gy(F.finalData,["CNPJ","CPF_CNPJ","CPF/CNPJ","DOCUMENTO"])??"--"})]}),$.jsxs("div",{className:"client-info-row",children:[$.jsx("span",{className:"client-info-label",children:"Dívida federal ativa"}),$.jsx("span",{className:"client-info-value debt",children:gy(F.finalData,["DIVIDA_ATIVA","DIVIDA ATIVA","DÍVIDA ATIVA","DIVIDA FEDERAL","DÍVIDA FEDERAL ATIVA","VALOR DIVIDA"])??"R$ 0,00"})]})]}),$.jsx("div",{className:"client-card-divider"}),$.jsxs("div",{className:"client-capital-section",children:[$.jsx("span",{className:"client-capital-label",children:"Capital a recuperar"}),$.jsx("span",{className:"client-capital-value",children:gy(F.finalData,["CAPITAL_RECUPERAR","CAPITAL A RECUPERAR","BENEFICIO","BENEFÍCIO","VALOR_TOTAL","VALOR RECUPERADO"])??"R$ 0,00"})]})]})})]}),$.jsx(ey,{}),$.jsxs("div",{className:"call-controls",children:[$.jsxs("div",{className:"control-row",children:[$.jsxs("button",{className:`control-button ${ne?"active":""} ${!1===ue?"disabled":""}`,id:"speakerBtn",onClick:dt,disabled:!1===ue,title:!1===ue?"Viva-voz não suportado neste dispositivo":"",children:[$.jsx("div",{className:"control-icon",children:$.jsx("i",{className:"fas "+(ne?"fa-volume-high":"fa-volume-low")})}),$.jsx("span",{children:ne?"Viva-voz":"Alto-falante"})]}),$.jsxs("button",{className:"control-button "+(Oe?"active":""),id:"muteBtn",onClick:st,children:[$.jsx("div",{className:"control-icon",children:$.jsx("i",{className:"fas "+(Oe?"fa-microphone-slash":"fa-microphone")})}),$.jsx("span",{children:"Mudo"})]}),$.jsxs("button",{className:"control-button",id:"keypadBtn",onClick:()=>p("incallKeypad"),children:[$.jsx("div",{className:"control-icon",children:$.jsx("i",{className:"fas fa-th"})}),$.jsx("span",{children:"Teclado"})]})]}),$.jsxs("div",{className:"control-row control-row-center",children:[$.jsxs("button",{className:"control-button whatsapp-btn",id:"whatsappBtn",onClick:ht,children:[$.jsx("div",{className:"control-icon whatsapp-icon",children:$.jsx("i",{className:"fab fa-whatsapp"})}),$.jsx("span",{children:"WhatsApp"})]}),$.jsxs("div",{className:"end-call-wrapper",children:[$.jsx("button",{className:"end-call-button",id:"endCallButton",onClick:at,children:$.jsx("i",{className:"fas fa-phone-slash"})}),$.jsx("span",{className:"end-call-label",children:"Desligar"})]})]})]})]}),$.jsxs("div",{className:"screen incall-keypad-screen "+("incallKeypad"===h?"active":""),id:"incallKeypadScreen",children:[$.jsx("div",{className:"incall-header",children:$.jsx("button",{className:"hide-keypad-btn",id:"hideKeypadBtn",onClick:()=>p("call"),children:$.jsx("span",{children:"Ocultar"})})}),$.jsx("div",{className:"incall-number-display",children:$.jsx("span",{id:"incallPhoneNumber",children:$t})}),$.jsx("div",{className:"keypad incall-keypad",children:["1","2","3","4","5","6","7","8","9","*","0","#"].map(e=>$.jsxs("div",{className:"key incall-key","data-value":e,onClick:()=>rt(e),children:[$.jsx("span",{className:"number",children:e}),$.jsx("span",{className:"letters",children:" "})]},e))}),$.jsx("div",{className:"incall-actions",children:$.jsx("button",{className:"end-call-button",id:"endCallButton2",onClick:at,children:$.jsx("i",{className:"fas fa-phone-slash"})})})]}),$.jsx("div",{className:"screen call-history-screen "+("history"===h?"active":""),id:"callHistoryScreen",children:$.jsx(Ev,{items:X??q,isLoading:H,error:G,onRefresh:ut,query:K,onQueryChange:ct,isSearching:Z,searchHint:ft,onCall:e=>{ke.impactLight(),f(av(e)),p("dialer")},onWhatsApp:t=>{ke.impactLight();const n=`55${av(t)}`,r=by((null==Te?void 0:Te.name)||e||"",t.fields);window.open(`https://wa.me/${n}?text=${encodeURIComponent(r)}`,"_blank")},apiBaseUrl:Xp,getAuthHeaders:Jp})}),$.jsxs("nav",{className:"bottom-nav "+("call"===h||"incallKeypad"===h?"hidden":""),id:"bottomNav",children:[$.jsxs("div",{className:"nav-item "+("history"===h?"active":""),id:"navCalls",onClick:()=>p("history"),children:[$.jsx("div",{className:"nav-icon",children:$.jsx("i",{className:"fas fa-clock-rotate-left"})}),$.jsx("span",{children:"Recentes"})]}),$.jsxs("div",{className:"nav-item "+("dialer"===h||"call"===h||"incallKeypad"===h?"active":""),id:"navKeypad",onClick:()=>p("dialer"),children:[$.jsx("div",{className:"nav-icon",children:$.jsx("i",{className:"fas fa-th"})}),$.jsx("span",{children:"Teclado"})]})]}),$.jsx("div",{className:"modal-overlay "+(m?"active":""),id:"pauseModal",children:$.jsxs("div",{className:"modal-content",children:[$.jsxs("div",{className:"modal-header",children:[$.jsx("h2",{className:"modal-title",children:"Selecionar Pausa"}),$.jsx("button",{className:"modal-close",id:"closePauseModal",onClick:()=>g(!1),children:$.jsx("i",{className:"fas fa-xmark"})})]}),$.jsxs("div",{className:"pause-options",id:"pauseOptions",children:[Ne.map(e=>$.jsxs("div",{className:"pause-option",onClick:()=>pt(e.id),children:[$.jsx("div",{className:"pause-option-icon",children:$.jsx("i",{className:`fas ${e.icon||"fa-circle-pause"}`})}),$.jsxs("div",{className:"pause-option-info",children:[$.jsx("div",{className:"pause-option-name",children:e.name}),$.jsxs("div",{className:"pause-option-id",children:["ID: ",e.id]})]})]},e.id)),!Ne.length&&$.jsx("div",{className:"history-empty",children:"Nenhuma pausa configurada."})]}),$.jsx("button",{className:"modal-cancel-btn",id:"cancelPauseBtn",onClick:()=>g(!1),children:"Cancelar"})]})}),$.jsx("div",{className:"modal-overlay qualification-modal "+(v?"active":""),id:"qualificationModal",children:$.jsxs("div",{className:"qualification-sheet",children:[$.jsx("div",{className:"sheet-handle"}),$.jsxs("div",{className:"sheet-header",children:[$.jsx("span",{className:"sheet-title",children:"Qualificar Chamada"}),$.jsx("span",{className:"sheet-subtitle",children:"Registre o resultado do atendimento"})]}),$.jsxs("div",{className:"result-segmented",children:[$.jsx("button",{className:"segment "+("success"===b?"active":""),id:"resultSuccess","data-type":"success",onClick:()=>{x("success"),_(null)},children:"Sucesso"}),$.jsx("button",{className:"segment "+("failure"===b?"active":""),id:"resultFailure","data-type":"failure",onClick:()=>{x("failure"),_(null)},children:"Falha"}),$.jsx("div",{className:"segment-indicator"})]}),$.jsx("div",{className:"qualifications-container",children:$.jsxs("div",{className:"qualification-list",id:"qualificationList",children:[("success"===b?xe:we).map(e=>$.jsx("button",{className:"qualification-item "+(w===e.id?"selected":""),onClick:()=>_(e.id),children:$.jsx("span",{children:e.name})},e.id)),!("success"===b?xe:we).length&&$.jsx("div",{className:"history-empty",children:"Nenhuma qualificação configurada."})]})}),C&&$.jsx("div",{className:"input-error",children:C}),$.jsx("div",{className:"sheet-footer",children:$.jsx("button",{className:"confirm-btn",id:"confirmQualificationBtn",onClick:gt,disabled:!w,children:"Confirmar"})})]})}),r&&$.jsx(py,{isOpen:O,campaignCallInfo:Qe,campaignContactPhoneId:(null==(l=null==pe?void 0:pe.data)?void 0:l.campaignContactPhoneId)??null,callDuration:E,isCallActive:Je||Xe,onClose:()=>I(!1)})]})}const wy=16;function _y(e,t,n){return Math.min(Math.max(e,t),n)}function Cy({isOpen:e,result:r,onChangeResult:i,successQualifications:o,discardQualifications:a,selectedQualificationId:s,onSelectQualification:d,onSubmit:l,isSubmitting:u,errorMessage:c,portalTarget:f=null}){const h=t.useRef(null),p=t.useRef({pointerId:null,offsetX:0,offsetY:0}),m=t.useRef(!1),[g,v]=t.useState({x:100,y:100}),[y,b]=t.useState(!1),x="success"===r?o:a,w=x.length>0,_=t.useCallback(e=>{if("undefined"==typeof window)return e;const t=window.innerWidth,n=window.innerHeight,r=h.current,i=(null==r?void 0:r.offsetWidth)??400,o=(null==r?void 0:r.offsetHeight)??500,a=Math.max(16,t-i-wy),s=Math.max(16,n-o-wy);return{x:_y(e.x,16,a),y:_y(e.y,16,s)}},[]);t.useEffect(()=>{if(e&&"undefined"!=typeof window){const e=h.current,t=(null==e?void 0:e.offsetWidth)??400,n=(null==e?void 0:e.offsetHeight)??500,r=(window.innerWidth-t)/2,i=(window.innerHeight-n)/2;v(_({x:r,y:i}))}},[e,_]),t.useEffect(()=>{if(!e||"undefined"==typeof window)return;const t=()=>{v(e=>_(e))};return window.addEventListener("resize",t),window.addEventListener("orientationchange",t),()=>{window.removeEventListener("resize",t),window.removeEventListener("orientationchange",t)}},[e,_]),t.useEffect(()=>{if(!y)return;const e=e=>{var t,n;if(p.current.pointerId!==e.pointerId)return;m.current=!0;const r=(null==(t=h.current)?void 0:t.offsetWidth)??0,i=(null==(n=h.current)?void 0:n.offsetHeight)??0,o=e.clientX-p.current.offsetX,a=e.clientY-p.current.offsetY,s="undefined"!=typeof window?window.innerWidth:0,d="undefined"!=typeof window?window.innerHeight:0,l=s-r-wy,u=d-i-wy,c=Math.max(wy,l),f=Math.max(wy,u);v({x:_y(o,wy,c),y:_y(a,wy,f)})},t=e=>{p.current.pointerId===e.pointerId&&(b(!1),p.current={pointerId:null,offsetX:0,offsetY:0})};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t)}},[y]);const C=t.useCallback(e=>{if(0!==e.button&&"touch"!==e.pointerType)return;const t=h.current;if(!t)return;const n=t.getBoundingClientRect();p.current={pointerId:e.pointerId,offsetX:e.clientX-n.left,offsetY:e.clientY-n.top},m.current=!1,b(!0)},[]);if(!e)return null;const S=$.jsxs("div",{ref:h,className:Xh`fixed z-[9999] flex flex-col overflow-hidden rounded-xl border border-slate-300 bg-white shadow-2xl`,style:{left:`${g.x}px`,top:`${g.y}px`,width:"420px",maxWidth:"calc(100vw - 32px)",maxHeight:"calc(100vh - 32px)"},children:[$.jsx("div",{onPointerDown:C,className:Xh`flex cursor-move items-center justify-center border-b border-slate-200 bg-gradient-to-r from-indigo-500 to-indigo-600 px-4 py-3 text-white`,children:$.jsx("h3",{className:Xh`text-sm font-bold`,children:"Qualificar Chamada"})}),$.jsxs("div",{className:Xh`flex-1 space-y-4 overflow-y-auto p-5`,children:[$.jsx("div",{className:Xh`text-center`,children:$.jsx("p",{className:Xh`text-sm text-slate-600`,children:"Esta etapa é obrigatória para registrar o desfecho do atendimento."})}),$.jsxs("div",{className:Xh`space-y-2`,children:[$.jsx("p",{className:Xh`text-sm font-semibold text-slate-700`,children:"Resultado da chamada"}),$.jsxs("div",{className:Xh`grid grid-cols-2 gap-3`,children:[$.jsxs("button",{type:"button",onClick:()=>i("success"),className:Xh`${"success"===r?"border-emerald-500 bg-emerald-50 ring-2 ring-emerald-500":"border-slate-200 bg-white hover:border-emerald-300"} flex flex-col items-center justify-center gap-2 rounded-lg border px-4 py-3 transition`,children:[$.jsx(Nc,{className:Xh`h-6 w-6 ${"success"===r?"text-emerald-600":"text-slate-400"}`}),$.jsx("span",{className:Xh`text-sm font-semibold ${"success"===r?"text-emerald-700":"text-slate-600"}`,children:"Sucesso"})]}),$.jsxs("button",{type:"button",onClick:()=>i("failure"),className:Xh`${"failure"===r?"border-rose-500 bg-rose-50 ring-2 ring-rose-500":"border-slate-200 bg-white hover:border-rose-300"} flex flex-col items-center justify-center gap-2 rounded-lg border px-4 py-3 transition`,children:[$.jsx(Kc,{className:Xh`h-6 w-6 ${"failure"===r?"text-rose-600":"text-slate-400"}`}),$.jsx("span",{className:Xh`text-sm font-semibold ${"failure"===r?"text-rose-700":"text-slate-600"}`,children:"Falha"})]})]})]}),$.jsxs("div",{className:Xh`space-y-2`,children:[$.jsx("p",{className:Xh`text-sm font-semibold text-slate-700`,children:"Selecione uma qualificação"}),w?$.jsx("div",{className:Xh`max-h-64 space-y-2 overflow-y-auto rounded-lg border border-slate-200 bg-slate-50 p-2`,children:x.map(e=>{const t=s===e.id;return $.jsx("button",{type:"button",onClick:()=>d(e.id),className:Xh`${t?"border-blue-400 bg-blue-100 ring-2 ring-blue-400":"border-slate-200 bg-white hover:border-blue-300"} w-full rounded-lg border px-4 py-3 text-left transition`,children:$.jsx("p",{className:Xh`text-sm font-semibold ${t?"text-blue-800":"text-slate-800"}`,children:e.name})},e.id)})}):$.jsxs("div",{className:Xh`flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700`,children:[$.jsx(_c,{className:Xh`h-5 w-5 flex-shrink-0`}),$.jsx("span",{children:"Nenhuma qualificação disponível para este tipo de resultado."})]})]}),c&&$.jsxs("div",{className:Xh`flex items-center gap-2 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700`,children:[$.jsx(_c,{className:Xh`h-5 w-5 flex-shrink-0`}),$.jsx("span",{children:c})]})]}),$.jsx("div",{className:Xh`border-t border-slate-200 bg-slate-50 px-5 py-4`,children:$.jsxs("button",{type:"button",onClick:l,disabled:!w||!s||u,className:Xh`flex w-full items-center justify-center gap-2 rounded-lg bg-indigo-600 px-4 py-3 text-sm font-bold text-white shadow-md transition hover:bg-indigo-700 disabled:cursor-not-allowed disabled:opacity-50`,children:[u&&$.jsxs("svg",{className:Xh`h-4 w-4 animate-spin text-white`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[$.jsx("circle",{className:Xh`opacity-25`,cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),$.jsx("path",{className:Xh`opacity-75`,fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),u?"Enviando...":"Confirmar Qualificação"]})})]});return"undefined"!=typeof document?n.createPortal(S,f??document.body):null}function Sy({variant:e="default",portalTarget:t,isAuthenticated:n,mode:r,...i}){const o="min"===e;return"mobile"===e?$.jsx($y,{isAuthenticated:n,showClientInfoModal:"inline"===r,...i}):n&&o?$.jsx(Ey,{portalTarget:t,...i}):$.jsx(q$,{variant:e,portalTarget:t,isAuthenticated:n,...i})}function Ey({username:e,onLogin:n,onLogout:r,isLoadingSession:i,sessionError:o,portalTarget:a}){var s;const{skipManualQualification:d}=Yy(),l=ec(),u=rc(),c=nc(),f=ic(),h=oc(),p=t.useMemo(()=>f??[],[f]),m=t.useMemo(()=>h??[],[h]),{finishAfterCall:g}=tc(),[v,y]=t.useState(!1),[b,x]=t.useState(!1),[w,_]=t.useState(0),[C,S]=t.useState("success"),[E,N]=t.useState(null),[T,A]=t.useState(!1),[O,I]=t.useState(null),k=null==l?void 0:l.state,j="callInProgress"===k,R="manualCallSetup"===k||("manualCallRinging"===k||"callRinging"===k),P="afterCall"===k;t.useEffect(()=>{if(!j)return void _(0);const e=setInterval(()=>{_(e=>e+1)},1e3);return()=>clearInterval(e)},[j]),t.useEffect(()=>{(j||R)&&"campaign"===(null==u?void 0:u.type)&&y(!0)},[j,R,u]),t.useEffect(()=>{if(P){if("campaign"===(null==u?void 0:u.type)&&!0===u.info.campaign.skipCallQualification&&g)return void Promise.resolve(g({result:"success",qualificationId:void 0}));if("manual"===(null==u?void 0:u.type)&&g)return console.log("[InlineDialer] 🚀 Chamada MANUAL detectada - finalizando automaticamente (chamadas manuais NUNCA exibem qualificação)"),void Promise.resolve(g({result:"success",qualificationId:void 0}));if(0===p.length&&0===m.length&&g)return console.log("[InlineDialer] 🚀 Sem qualificações configuradas - finalizando automaticamente"),void Promise.resolve(g({result:"success",qualificationId:void 0}));const e=p.length>0;S(e?"success":"failure"),N(null),I(null),x(!0)}else x(!1)},[P,u,g,p,m,d]),t.useEffect(()=>{j||R||P||y(!1)},[j,R,P]);const D=t.useMemo(()=>u&&"campaign"===u.type?u.info:null,[u]);return $.jsxs($.Fragment,{children:[$.jsx("style",{dangerouslySetInnerHTML:{__html:'\n /* Container externo do HTML - SEM padding/border para não vazar */\n #dialer-inline.callix.mode.min {\n display: block !important;\n width: 100% !important;\n max-width: 100% !important;\n padding: 0 !important;\n border: none !important;\n background: transparent !important;\n box-shadow: none !important;\n }\n\n /* Estilos para modo mini quando Tailwind CDN não processa classes */\n .callix.mode.min {\n display: flex !important;\n flex-direction: column !important;\n gap: 0.75rem !important;\n border-radius: 1rem !important;\n border: 1px solid #e2e8f0 !important;\n background: rgba(255, 255, 255, 0.95) !important;\n padding: 0.75rem !important;\n box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;\n color: #1e293b !important;\n width: 100% !important;\n max-width: 100% !important;\n box-sizing: border-box !important;\n }\n\n /* Visor de número - fonte menor para caber todos os dígitos */\n .callix.mode.min [class*="truncate"] {\n font-size: 0.875rem !important; /* text-sm */\n line-height: 1.25rem !important;\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n }\n\n /* Botões do modo mini */\n .callix.mode.min button {\n cursor: pointer !important;\n transition: all 0.2s ease !important;\n }\n \n .callix.mode.min button:disabled {\n cursor: not-allowed !important;\n opacity: 0.6 !important;\n }\n\n /* Grid do teclado numérico */\n .callix.mode.min [class*="grid-cols-3"] {\n display: grid !important;\n grid-template-columns: repeat(3, minmax(0, 1fr)) !important;\n gap: 0.5rem !important;\n }\n\n /* Botões do teclado */\n .callix.mode.min [class*="grid-cols-3"] button {\n display: flex !important;\n height: 3rem !important;\n flex-direction: column !important;\n align-items: center !important;\n justify-content: center !important;\n border-radius: 0.5rem !important;\n border: 1px solid #e2e8f0 !important;\n background: white !important;\n font-size: 1rem !important;\n font-weight: 600 !important;\n color: #1e293b !important;\n box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;\n }\n\n .callix.mode.min [class*="grid-cols-3"] button:hover:not(:disabled) {\n border-color: #cbd5e1 !important;\n box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1) !important;\n }\n\n .callix.mode.min [class*="grid-cols-3"] button:active:not(:disabled) {\n transform: scale(0.95) !important;\n }\n\n /* Botão principal de Ligar/Encerrar */\n .callix.mode.min > button[class*="bg-emerald"],\n .callix.mode.min > button[class*="bg-rose"] {\n display: flex !important;\n height: 2.75rem !important;\n width: 100% !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 0.5rem !important;\n border-radius: 0.75rem !important;\n font-size: 0.875rem !important;\n font-weight: 700 !important;\n color: white !important;\n box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1) !important;\n border: none !important;\n }\n\n .callix.mode.min > button[class*="bg-emerald"] {\n background: #10b981 !important;\n }\n\n .callix.mode.min > button[class*="bg-emerald"]:hover:not(:disabled) {\n background: #059669 !important;\n }\n\n .callix.mode.min > button[class*="bg-rose"] {\n background: #f43f5e !important;\n }\n\n .callix.mode.min > button[class*="bg-rose"]:hover:not(:disabled) {\n background: #e11d48 !important;\n }\n '}}),$.jsx(q$,{isAuthenticated:!0,username:e,onLogin:n,onLogout:r,isLoadingSession:i,sessionError:o,variant:"min"}),$.jsx(py,{isOpen:v,campaignCallInfo:D,campaignContactPhoneId:(null==(s=null==c?void 0:c.data)?void 0:s.campaignContactPhoneId)??null,callDuration:w,isCallActive:j||R,onClose:()=>y(!1),portalTarget:a}),$.jsx(Cy,{isOpen:b,result:C,onChangeResult:S,successQualifications:p,discardQualifications:m,selectedQualificationId:E,onSelectQualification:N,onSubmit:async()=>{if(("success"===C?p:m).length)if(E)if("function"==typeof g){A(!0),I(null);try{await Promise.resolve(g({result:C,qualificationId:E})),x(!1)}catch(e){I("Erro ao enviar qualificacao."),console.error("Erro ao finalizar afterCall:",e)}finally{A(!1)}}else I("Não foi possível enviar a qualificação.");else I("Selecione uma qualificação para finalizar.");else I("Nenhuma qualificação configurada para este resultado.")},isSubmitting:T,errorMessage:O})]})}function Ny(e){return`callix_dialer_${e}_leader`}const Ty="callix_dialer_tab_role";function Ay(){const e=void 0!==globalThis.crypto?globalThis.crypto:void 0;return e&&"randomUUID"in e?e.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10)}function Oy(e){if("undefined"==typeof BroadcastChannel)return null;try{return new BroadcastChannel(e)}catch{return null}}function Iy(){try{return"undefined"!=typeof localStorage?localStorage:null}catch{return null}}class ky{constructor(e){this.listeners=new Set,this.storageListener=null,this.closed=!1,this.username=e.username,this.tabId=e.tabId??Ay(),this.status=e.status,this.storage=void 0===e.storage?Iy():e.storage;const t=e.channelFactory??Oy;if(this.channel=t(`callix-dialer:${this.username.trim().toLowerCase()}`),this.channel)this.channel.onmessage=e=>this.receive(e.data);else if("undefined"!=typeof window&&this.storage){const e=this.fallbackKey();this.storageListener=t=>{if(t.key===e&&t.newValue)try{const e=JSON.parse(t.newValue);this.receive(e.message)}catch{}},window.addEventListener("storage",this.storageListener)}}fallbackKey(){return`callix_dialer_${this.username}_bus`}on(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(this.closed)return;const t={...e,from:this.tabId};if(this.channel)try{this.channel.postMessage(t)}catch{}else if(this.storage)try{this.storage.setItem(this.fallbackKey(),JSON.stringify({nonce:Math.random(),at:Date.now(),message:t}))}catch{}}receive(e){if(this.closed||!e||"object"!=typeof e)return;const t=e;if("string"==typeof t.type&&"string"==typeof t.from&&t.from!==this.tabId){if("ping"===t.type){const e=this.status();this.post({type:"pong",role:e.role,authenticated:e.authenticated})}for(const e of this.listeners)e(t)}}probe(e=600){return new Promise(t=>{const n=new Map,r=this.on(e=>{"pong"===e.type&&n.set(e.from,{tabId:e.from,role:e.role,authenticated:e.authenticated})});this.post({type:"ping"}),setTimeout(()=>{r(),t([...n.values()])},e)})}close(){if(this.closed=!0,this.listeners.clear(),this.channel){this.channel.onmessage=null;try{this.channel.close()}catch{}}this.storageListener&&"undefined"!=typeof window&&(window.removeEventListener("storage",this.storageListener),this.storageListener=null)}}function jy(e){return e.find(e=>"leader"===e.role&&e.authenticated)??null}function Ry(e,t=Iy(),n=Date.now()){if(!t)return null;try{const r=t.getItem(Ny(e));if(!r)return null;const i=JSON.parse(r);return"string"!=typeof i.tabId||"number"!=typeof i.at||n-i.at>9e3?null:{tabId:i.tabId,at:i.at}}catch{return null}}function Py(e,t,n=Iy(),r=Date.now()){if(!n)return!0;const i=Ry(e,n,r);if(i&&i.tabId!==t)return!1;try{n.setItem(Ny(e),JSON.stringify({tabId:t,at:r}))}catch{}return!0}function Dy(e,t,n=Iy()){if(n)try{const r=n.getItem(Ny(e));if(!r)return;JSON.parse(r).tabId===t&&n.removeItem(Ny(e))}catch{}}function Ly(){try{return"undefined"!=typeof sessionStorage?sessionStorage:null}catch{return null}}function My(e,t,n=Ly()){if(n)try{n.setItem(Ty,JSON.stringify({username:e,role:t,at:Date.now()}))}catch{}}function Uy(e=Ly()){if(e)try{e.removeItem(Ty)}catch{}}const Fy=new Set(["STORE_NOT_CONFIGURED","SERVER_NOT_CONFIGURED"]),By=new Set(["manualCallSetup","manualCallRinging","callInProgress","afterCall"]);function qy(e){return e?{"Content-Type":"application/json","x-session-token":e,Authorization:`Bearer ${e}`}:Jp()}const zy=e=>new Promise(t=>setTimeout(t,e));function Hy({enabled:e=!0,pollIntervalMs:n,sessionToken:r,onTask:i}){const o=ec(),{makeManualCall:a}=tc(),s=t.useRef(null==o?void 0:o.state);s.current=null==o?void 0:o.state;const d=t.useRef(a);d.current=a;const l=t.useRef(i);l.current=i;const u=t.useRef(null),c=t.useRef(null);return t.useEffect(()=>{var e;null==(e=c.current)||e.call(c)},[null==o?void 0:o.state]),t.useEffect(()=>{if(!e)return;let t=!1,i=!1,o=0,a=0,f="normal",h=!1,p=45e3,m=Math.max(1e3,n??4e3);const g={apiBaseUrl:Xp,headers:qy(r)},$=()=>{if("notConfigured"===f)return 3e5;const e=Math.max(1e3,Math.floor(p/2)),t=Math.min(m,e);if("backoff"===f)return Math.min(t*2**a,6e4);const n=Math.min(3*t,e);return A$(T$(s.current))?t:n},v=()=>{var e;return null==(e=u.current)?void 0:e.setInterval($())};c.current=v;const y=async e=>{for(let r=0;r<3;r++){try{const t=await I$({...g,...e});if(t.ok)return!0;if(!(t.status>=500||408===t.status||429===t.status))return console.warn("[ClickToCall] confirmação recusada pelo servidor:",t.status,t.code??"","(tarefa",e.taskId,")"),!1}catch(n){console.warn("[ClickToCall] confirmação falhou (tentativa",r+1,"):",n instanceof Error?n.message:n)}if(t||2===r)break;await zy(1500*(r+1))}return console.error("[ClickToCall] não foi possível confirmar a tarefa",e.taskId,"; o servidor a marcará como não confirmada"),!1},b=async e=>{var n;const r=s.current;if(o=Date.now()+6e3,!A$(T$(r)))return console.warn("[ClickToCall] tarefa",e.id,"recebida com operador ocupado (",r,"): devolvendo à fila"),void(await y({taskId:e.id,status:"failed",error:`Operador indisponível (${r??"desconhecido"})`,retry:!0}));console.log("[ClickToCall] 🖱️ ligação pedida pela API:",e.phoneDisplay,"(tarefa",e.id,")");try{window.dispatchEvent(new CustomEvent(N$,{detail:e}))}catch(a){console.warn("[ClickToCall] falha ao notificar o discador:",a)}try{null==(n=l.current)||n.call(l,e)}catch(a){console.warn("[ClickToCall] onTask lançou erro:",a)}try{d.current(e.phone)}catch(a){const t=a instanceof Error?a.message:String(a);return console.error("[ClickToCall] makeManualCall falhou:",t),void(await y({taskId:e.id,status:"failed",error:t,retry:!1}))}const i=await new Promise(e=>{const n=Date.now()+4e3,r=()=>{if(t)return e("disposed");const i=s.current;return i&&By.has(i)?e("started"):"manualCallFailed"===i?e("manual_failed"):"callRinging"===i||"offline"===T$(i)?e("interrupted"):Date.now()>=n?e("not_started"):void setTimeout(r,100)};r()});switch(i){case"started":return void(await y({taskId:e.id,status:"calling"}));case"manual_failed":return console.error("[ClickToCall] o SDK não conseguiu completar a chamada manual"),void(await y({taskId:e.id,status:"failed",error:"Chamada manual falhou no SDK",retry:!1}));case"interrupted":return console.warn("[ClickToCall] chamada manual não aconteceu (estado",s.current,"): devolvendo à fila"),void(await y({taskId:e.id,status:"failed",error:`Discador interrompido (${s.current??"desconhecido"})`,retry:!0}));case"disposed":return void(await y({taskId:e.id,status:"failed",error:"Discador encerrado durante a discagem",retry:!0}));default:{const t=`SDK não iniciou a chamada (estado continua ${s.current??"desconhecido"})`;console.error("[ClickToCall]",t),await y({taskId:e.id,status:"failed",error:t,retry:!1})}}},x=async()=>{if(!t&&!i){i=!0;try{const r=s.current,i=A$(T$(r))&&Date.now()>=o;let d;try{d=await async function(e){const{signal:t,clear:n}=O$(e.signal);try{const n=await fetch(`${e.apiBaseUrl}/api/click-to-call/poll`,{method:"POST",headers:e.headers,body:JSON.stringify({state:e.state??null,claim:e.claim}),credentials:"omit",signal:t});if(!n.ok){let e=null;try{const t=await n.json();e="string"==typeof(null==t?void 0:t.error)?t.error:null}catch{}return{ok:!1,status:n.status,code:e}}const r=await n.json();return{ok:!0,presence:r.presence??"unknown",task:r.task&&"object"==typeof r.task&&"string"==typeof r.task.phone?r.task:null,pollIntervalMs:"number"==typeof r.pollIntervalMs?r.pollIntervalMs:0,presenceTtlSeconds:"number"==typeof r.presenceTtlSeconds&&r.presenceTtlSeconds>0?r.presenceTtlSeconds:45}}finally{n()}}({...g,state:r,claim:i})}catch(e){d={ok:!1,status:0,code:e instanceof Error&&"AbortError"===e.name?"TIMEOUT":"NETWORK"}}if(t)return void(d.ok&&d.task&&await y({taskId:d.task.id,status:"failed",error:"Discador encerrado antes de discar",retry:!0}));if(!d.ok){a+=1;const e=null!==d.code&&Fy.has(d.code);return f=e?"notConfigured":"backoff",e?h||(h=!0,console.warn("[ClickToCall] backend sem click-to-call configurado (",d.code,"); nova tentativa em 5 min")):1===a&&console.warn("[ClickToCall] polling falhou (HTTP",d.status,d.code??"","); aplicando backoff"),void v()}if("normal"!==f&&(f="normal",a=0),p=1e3*d.presenceTtlSeconds,void 0===n&&d.pollIntervalMs>0&&(m=Math.max(1e3,d.pollIntervalMs)),v(),d.task)try{await b(d.task)}catch(e){console.error("[ClickToCall] erro ao tratar a tarefa",d.task.id,":",e instanceof Error?e.message:e)}}finally{i=!1}}},w=function(e,t){let n=Math.max(250,Math.round(t)),r=null,i=null,o=null,a=!1;const s=()=>{a||(r&&clearInterval(r),r=setInterval(e,n))};try{"undefined"!=typeof Worker&&"undefined"!=typeof Blob&&"undefined"!=typeof URL&&URL.createObjectURL?(o=URL.createObjectURL(new Blob(["\nlet timer = null;\nself.onmessage = (event) => {\n const interval = Number(event && event.data && event.data.interval) || 0;\n if (timer) { clearInterval(timer); timer = null; }\n if (interval > 0) { timer = setInterval(() => self.postMessage('tick'), interval); }\n};\n"],{type:"application/javascript"})),i=new Worker(o),i.onmessage=()=>{a||e()},i.onerror=()=>{null==i||i.terminate(),i=null,s()},i.postMessage({interval:n})):s()}catch{i=null,s()}return{setInterval(e){if(a)return;const t=Math.max(250,Math.round(e));t!==n&&(n=t,i?i.postMessage({interval:n}):s())},stop(){a=!0,i&&(i.terminate(),i=null),o&&(URL.revokeObjectURL(o),o=null),r&&(clearInterval(r),r=null)}}}(()=>{x()},$());return u.current=w,x(),()=>{t=!0,w.stop(),u.current===w&&(u.current=null),c.current===v&&(c.current=null),function(e){try{fetch(`${e.apiBaseUrl}/api/click-to-call/poll`,{method:"POST",headers:e.headers,body:JSON.stringify({state:"offline",claim:!1}),credentials:"omit",keepalive:!0}).catch(()=>{})}catch{}}(g)}},[e,n,r]),null}const Wy="2.8.2";let Gy=null;function Vy(){return new Promise(e=>{if(!Gy)return console.log("[Callix Dialer] 📭 Nenhum WebSocket SIP ativo para fechar"),void e();if(Gy.readyState===WebSocket.CLOSED||Gy.readyState===WebSocket.CLOSING)return console.log("[Callix Dialer] 📭 WebSocket SIP já está fechando/fechado"),Gy=null,void e();console.log("[Callix Dialer] 🔌 Fechando WebSocket SIP existente...");const t=Gy;!function(e){if(e.readyState===WebSocket.OPEN)try{console.log("[Callix Dialer] 📤 Tentando enviar sinalização de fechamento...");const t=e;t._ua&&"function"==typeof t._ua.stop?(console.log("[Callix Dialer] 🔌 Encontrado UA, chamando stop()..."),t._ua.stop()):t._connection&&"function"==typeof t._connection.close&&(console.log("[Callix Dialer] 🔌 Fechando conexão interna..."),t._connection.close())}catch(t){console.warn("[Callix Dialer] ⚠️ Não foi possível enviar UNREGISTER:",t)}}(t);const n=setTimeout(()=>{console.log("[Callix Dialer] ⏱️ Timeout ao fechar WebSocket, continuando...");try{t.close(1e3,"Force close after timeout")}catch{}e()},3e3);t.addEventListener("close",()=>{clearTimeout(n),console.log("[Callix Dialer] ✅ WebSocket SIP fechado com sucesso"),e()},{once:!0}),setTimeout(()=>{t.close(1e3,"Page reload - cleaning up SIP connection")},500)})}!function(){if("undefined"==typeof window)return;if(window.__callixWsInterceptorSetup)return;window.__callixWsInterceptorSetup=!0;const e=window.WebSocket;window.WebSocket=function(t,n){const r=new e(t,n);return"string"==typeof t&&t.includes("callix")&&t.includes("/ws")&&(console.log("[Callix Dialer] 🔌 WebSocket SIP detectado:",t),Gy=r,r.addEventListener("message",e=>{if("string"==typeof e.data&&e.data.includes("Call-ID:")){const t=e.data.match(/Call-ID:\s*([^\r\n]+)/i);t&&t[1].trim()}}),r.addEventListener("close",()=>{console.log("[Callix Dialer] 🔌 WebSocket SIP fechado"),Gy===r&&(Gy=null)})),r},Object.assign(window.WebSocket,{CONNECTING:e.CONNECTING,OPEN:e.OPEN,CLOSING:e.CLOSING,CLOSED:e.CLOSED}),console.log("[Callix Dialer] ✅ WebSocket interceptor configurado")}(),"undefined"!=typeof window&&(window.__callixUnloadSetup||(window.__callixUnloadSetup=!0,window.addEventListener("beforeunload",()=>{console.log("[Callix Dialer] 🚪 Página fechando, limpando WebSocket SIP..."),Gy&&Gy.readyState===WebSocket.OPEN&&Gy.close(1e3,"Page unload")}),window.addEventListener("pagehide",()=>{Gy&&Gy.readyState===WebSocket.OPEN&&Gy.close(1e3,"Page hide")}),console.log("[Callix Dialer] ✅ Page unload cleanup configurado"))),function(){if("undefined"==typeof document)return;if(document.querySelector('meta[name="format-detection"]'))return;const e=document.createElement("meta");e.name="format-detection",e.content="telephone=no, date=no, email=no, address=no",document.head.appendChild(e),console.log("[Callix Dialer] ✅ iOS format-detection meta tag adicionada")}();const Ky=t.createContext(null);function Yy(){const e=t.useContext(Ky);return e||{skipManualQualification:!1}}const Xy=t.forwardRef(function({children:e,onSessionDropped:n},r){const i=Qu(),o=tc(),a=ec(),s=t.useRef(n);s.current=n,uc("userSessionDropped",e=>{var t;const n=(null==e?void 0:e.originator)??null;null==(t=s.current)||t.call(s,n,Wp(n))});const d="startupError"===(null==a?void 0:a.state)?a.error??null:null;t.useEffect(()=>{var e;"userIsAlreadyConnectedOnAnotherDevice"===d&&(null==(e=s.current)||e.call(s,"anotherDevice",zp(d)))},[d]),t.useImperativeHandle(r,()=>({goOffline:()=>{console.log("[Callix Dialer] 📴 Chamando goOffline() para enviar SIP UNREGISTER...");try{o.goOffline(),console.log("[Callix Dialer] ✅ goOffline() chamado com sucesso")}catch(e){console.error("[Callix Dialer] ❌ Erro ao chamar goOffline():",e)}},stop:()=>{console.log("[Callix Dialer] 🛑 Chamando stop() no CallOperator...");try{i.stop(),console.log("[Callix Dialer] ✅ stop() chamado com sucesso")}catch(e){console.error("[Callix Dialer] ❌ Erro ao chamar stop():",e)}}}),[i,o]);const l=t.useRef(o);return l.current=o,t.useEffect(()=>()=>{console.log("[Callix Dialer] 🔌 SdkCleanupManager desmontando, chamando goOffline()...");try{l.current.goOffline()}catch(e){console.warn("[Callix Dialer] ⚠️ Erro no cleanup automático:",e)}},[]),$.jsx($.Fragment,{children:e})});class Jy{constructor(e){this.root=null,this.container=null,this.options=e}init(){try{if("string"==typeof this.options.container?this.container=document.querySelector(this.options.container):this.container=this.options.container,!this.container)throw new Error(`Container não encontrado: ${this.options.container}`);const e=function(e){const t={},n=e.getAttribute("data-callix-engine-url")??e.dataset.callixEngineUrl;n&&n.trim()&&(t.engineUrl=n.trim());const r=e.getAttribute("data-callix-engine-token")??e.dataset.callixEngineToken;r&&r.trim()&&(t.engineToken=r.trim());const i=e.getAttribute("data-callix-mode")||e.dataset.callixMode||e.dataset.mode,o=e.getAttribute("data-callix-username")||e.dataset.callixUsername||e.dataset.username,a=Array.from(e.classList),s=a.map(e=>e.toLowerCase()),d=s.includes("callix"),l=i?i.toLowerCase():void 0;if("min"===l||"mini"===l?t.uiVariant="min":"mobile"===l?t.uiVariant="mobile":"default"===l||"floating"===l||"full"===l||"inline"===l?t.uiVariant="default":d&&(s.includes("mode-min")||s.includes("mode-mini")||s.includes("mode")&&s.includes("min"))&&(t.uiVariant="min"),!t.presetUsername&&o&&(t.presetUsername=o.trim()),!t.presetUsername)for(const h of a){const e=h.match(/(?:user|username|callix-user)[-_:]([A-Za-z0-9.@_-]+)/i);if(e){t.presetUsername=e[1];break}}t.presetUsername&&(t.presetUsername=t.presetUsername.trim());const u=e.getAttribute("data-callix-auto-login")??e.dataset.callixAutoLogin??e.dataset.autoLogin;null!=u&&(t.autoLogin=["true","1","yes",""].includes(u.trim().toLowerCase()));const c=function(e){const t=(e??"").trim().toLowerCase();return"compact"===t||"compacta"===t||"compacto"===t?"compact":"comfortable"===t||"confortavel"===t||"confortável"===t||"touch"===t?"comfortable":"auto"===t?"auto":void 0}(e.getAttribute("data-callix-density")??e.dataset.callixDensity);c&&(t.density=c);const f=e.getAttribute("data-callix-click-to-call")??e.dataset.callixClickToCall;return null!=f&&(t.clickToCall=!["false","0","no","off"].includes(f.trim().toLowerCase())),t}(this.container);!this.options.uiVariant&&e.uiVariant&&(this.options.uiVariant=e.uiVariant),!this.options.presetUsername&&e.presetUsername&&(this.options.presetUsername=e.presetUsername),void 0===this.options.autoLogin&&void 0!==e.autoLogin&&(this.options.autoLogin=e.autoLogin),void 0===this.options.density&&void 0!==e.density&&(this.options.density=e.density),void 0===this.options.clickToCall&&void 0!==e.clickToCall&&(this.options.clickToCall=e.clickToCall),!this.options.engineUrl&&e.engineUrl&&(this.options.engineUrl=e.engineUrl),!this.options.engineToken&&e.engineToken&&(this.options.engineToken=e.engineToken),this.root=x.createRoot(this.container),this.root.render($.jsx(t.StrictMode,{children:$.jsx(tb,{options:this.options,containerEl:this.container})})),this.options.onReady&&this.options.onReady()}catch(e){this.options.onError?this.options.onError(e):console.error("[Callix Dialer] Erro ao inicializar:",e)}}destroy(){this.root&&(this.root.unmount(),this.root=null)}}const Zy=e=>({SESSION_TOKEN:`callix_dialer_${e}_session_token`,DOMAIN:`callix_dialer_${e}_domain`,TIMESTAMP:`callix_dialer_${e}_timestamp`,SKIP_MANUAL_QUALIFICATION:`callix_dialer_${e}_skip_manual_qualification`}),Qy="callix_dialer_last_username";function eb(e){try{return localStorage.getItem(Zy(e).SESSION_TOKEN)}catch{return null}}function tb({options:e,containerEl:n}){const[r,i]=t.useState(null),[o,a]=t.useState(!1),[s,d]=t.useState(!1),[l,u]=t.useState(null),[c,f]=t.useState(null),[h,p]=t.useState(null),[m,g]=t.useState(!0),[v,y]=t.useState(!1),[b,x]=t.useState(null),w=t.useRef(null),[_,C]=t.useState(()=>Date.now()),[S,E]=t.useState(!1),N=e.presetUsername?e.presetUsername.trim():null,T=e.uiVariant??"default",A=t.useMemo(()=>e.portalTarget??n??null,[e.portalTarget,n]),O=t.useRef("");O.current||(O.current=Ay());const[I,k]=t.useState(null),j=t.useRef(null);j.current=I;const[R,P]=t.useState(!1),[D,L]=t.useState(null),[M,U]=t.useState(!1),F=t.useRef(null),B=t.useRef(null),q=t.useRef(!1);q.current=o;const z=t.useRef(!1);z.current=s;const H=t.useRef(!1),W=t.useRef(async()=>{}),G=t.useRef(async()=>{}),V=t.useCallback(()=>{B.current&&(clearTimeout(B.current),B.current=null)},[]);t.useEffect(()=>{e.autoLogin&&console.info("[Callix Dialer] autoLogin: desde a 2.7.0 o widget não cria sessão sem confirmação; ele entra sozinho só quando já existe uma conexão ativa deste usuário (outra aba ou o motor).")},[e.autoLogin]);const K=t.useRef({apiUrl:e.apiUrl||"/api/user-sdk-session",token:null});t.useEffect(()=>{K.current.token=c},[c]);const Y=Boolean(e.engineUrl),X=t.useRef(Y);X.current=Y;const J=t.useRef(null),Z=t.useCallback(t=>{const n=J.current;if(n&&n.agentId===t)return n.connect(),n;null==n||n.close();const r=new Du({url:e.engineUrl??"",token:e.engineToken||void 0,version:Wy,sessionToken:()=>eb(t),agentId:t,label:"Discador",log:e=>console.log("[Callix Dialer/motor]",e)});return r.onSessionLost(e=>{const t=Wp(e.originator);u(`${t.title}: ${t.detail}${t.action?` ${t.action}`:""}`),a(!1),f(null),L(null)}),r.connect(),J.current=r,r},[e.engineUrl,e.engineToken]);t.useEffect(()=>()=>{var e;null==(e=J.current)||e.close(),J.current=null},[]),t.useEffect(()=>{let e=!1;const t=()=>{var t;if(X.current||e)return;e=!0,setTimeout(()=>{e=!1},2e3);const{apiUrl:n,token:r}=K.current;if("leader"===j.current&&(null==(t=F.current)||t.post({type:"leaving"}),F.current&&Dy(F.current.username,O.current)),r){const e=JSON.stringify({logout:!0}),t=`${n}?logout=true`;if(navigator.sendBeacon){const n=new Blob([e],{type:"application/json"});navigator.sendBeacon(t,n),console.log("[Callix Dialer] Logout enviado via sendBeacon")}else fetch(n,{method:"DELETE",headers:{Authorization:`Bearer ${r}`},keepalive:!0}).catch(()=>{})}};return window.addEventListener("beforeunload",t),window.addEventListener("pagehide",t),()=>{window.removeEventListener("beforeunload",t),window.removeEventListener("pagehide",t)}},[]),t.useEffect(()=>{if("undefined"!=typeof window)try{const e=localStorage.getItem(Qy);if(!e)return console.log("[Callix Dialer] Nenhum username salvo, aguardando login manual"),void g(!1);if(N&&e!==N)return console.log("[Callix Dialer] Ignorando sessao salva por mismatch com preset:",e,"!=",N),void g(!1);console.log("[Callix Dialer] Username encontrado, irá fazer novo login:",e),i(e);const t=Zy(e),n=localStorage.getItem(t.SKIP_MANUAL_QUALIFICATION);n&&y("true"===n)}catch(e){console.error("[Callix Dialer] Erro ao verificar sessão:",e)}finally{g(!1)}else g(!1)},[N]),t.useEffect(()=>{N&&r!==N&&i(N)},[N,r]);const Q=t.useCallback(()=>e.domain||new URL(e.apiUrl||"/api/user-sdk-session",window.location.href).host,[e.domain,e.apiUrl]),ee=t.useCallback(async(e,t,n)=>{if(n){const r=await async function(e,t){var n,r;try{const i=await fetch(`https://${e}/sdk/v1/client/user-service/config`,{headers:{Authorization:`Bearer ${t}`},credentials:"omit"});if(!i.ok)return null;const o=await i.json();return!0===(null==(r=null==(n=null==o?void 0:o.service)?void 0:n.outboundOptions)?void 0:r.skipQualification)}catch{return null}}(t,n);if(null!==r){y(r);try{localStorage.setItem(Zy(e).SKIP_MANUAL_QUALIFICATION,String(r))}catch{}}}try{if(localStorage.setItem(Qy,e),n){const r=Zy(e);localStorage.setItem(r.SESSION_TOKEN,n),localStorage.setItem(r.DOMAIN,t),localStorage.setItem(r.TIMESTAMP,Date.now().toString())}}catch{}f(n),p(t),i(e),a(!0),u(null),L(null),C(Date.now())},[]),te=t.useCallback(async e=>{d(!0),u(null),x("Entrando na sessão do motor...");try{await ee(e,Q(),eb(e)),console.log("[Callix Dialer] Conectado ao motor como",e)}catch(t){console.error("[Callix Dialer] Erro ao entrar na sessão do motor:",t),u(t instanceof Error?t.message:"Erro ao conectar ao motor")}finally{d(!1),x(null)}},[ee,Q]);t.useEffect(()=>{if(!Y||!r||m)return;const e=r,t=Z(e);U(!t.getState().view);const n=setTimeout(()=>U(!1),15e3);let i=!1,o=!1;const s=()=>{const{view:n,sessionLost:r,rejected:s}=t.getState();if(!s&&o&&(o=!1,L(null)),s){if(o=!0,U(!1),z.current)return;return q.current&&(console.log("[Callix Dialer] o motor recusou esta aba: a sessão do agente foi trocada por um login em outro lugar"),a(!1),f(null),p(null)),void L(s.message)}if(!n)return;U(!1),"stopped"!==n.engine&&"crashed"!==n.engine||(H.current=!1);!(("running"===n.engine||"starting"===n.engine)&&!r)||H.current||q.current||z.current||i?"stopped"===n.engine&&q.current&&!z.current&&(console.log("[Callix Dialer] o motor desligou (Sair em outra aba ou servidor reiniciado); voltando à tela de login"),a(!1),f(null),p(null),L("O discador foi encerrado em outra aba ou o motor foi reiniciado.")):(i=!0,console.log("[Callix Dialer] o motor já segura a sessão deste agente; entrando por aqui também"),te(e).finally(()=>{i=!1}))};s();const d=t.subscribe(s);return()=>{d(),clearTimeout(n)}},[Y,r,m,Z,te]);const ne=t.useRef(null);t.useEffect(()=>{if(Y||!r)return void P(!0);P(!1);const e=r,t=new ky({username:e,tabId:O.current,status:()=>({role:j.current,authenticated:q.current})});F.current=t;const n=()=>{V(),B.current=setTimeout(()=>{if(B.current=null,"member"!==j.current||q.current||z.current)return;const n=Ry(e);n&&n.tabId!==O.current||Py(e,O.current)&&(t.post({type:"claim"}),console.log("[Callix Dialer] a aba com o discador fechou; esta aba assume a conexão"),W.current(e))},function(e=Math.random()){return 3e3+Math.floor(600*e)}())};ne.current=n;const i=t.on(t=>{switch(t.type){case"login":case"claim":V(),q.current||"leader"===j.current||(k("member"),My(e,"member"),L(null),u(null),P(!0));break;case"leaving":"member"!==j.current||q.current||n();break;case"takeover":"leader"===j.current&&(console.log("[Callix Dialer] outra aba pediu o discador; soltando a conexão"),G.current({broadcast:!1,keepDecision:!0}));break;case"logout":V(),G.current({broadcast:!1}),L("Você saiu do discador em outra aba.");break;case"dropped":{V(),Dy(e,O.current),k(null),Uy();const n=Wp(t.originator);u(`${n.title}: ${n.detail}${n.action?` ${n.action}`:""}`);break}}});return()=>{i(),t.close(),V(),ne.current=null,F.current===t&&(F.current=null),P(!1)}},[Y,r,V]),t.useEffect(()=>{if(Y||!r||o||R||m||s)return;const e=F.current;if(!e)return;const t=r,n=function(e,t=Ly()){if(!t)return null;try{const n=t.getItem(Ty);if(!n)return null;const r=JSON.parse(n);return r.username!==e?null:"leader"===r.role||"member"===r.role?r.role:null}catch{return null}}(t);if("leader"===n)return V(),P(!0),void(Py(t,O.current)?(e.post({type:"claim"}),console.log("[Callix Dialer] esta aba segurava o discador antes de recarregar; reconectando"),W.current(t)):(k("member"),My(t,"member")));let i=!1;return e.probe().then(e=>{var r;if(i)return;P(!0);const o=Ry(t);jy(e)||o&&o.tabId!==O.current||"member"===n&&function(e){return e.some(e=>null!==e.role)}(e)?(k("member"),My(t,"member")):"member"===n?(k("member"),null==(r=ne.current)||r.call(ne)):(k(null),Uy())}),()=>{i=!0}},[Y,r,o,R,m,s,V]),t.useEffect(()=>{if(Y||"leader"!==I||!r)return;const e=r;Py(e,O.current);const t=setInterval(()=>Py(e,O.current),3e3);return()=>clearInterval(t)},[Y,I,r]),t.useEffect(()=>{if(Y||"member"!==I||!r)return;const e=r,t=()=>{if("visible"!==document.visibilityState||B.current)return;const t=F.current;t&&t.probe().then(t=>{var n;"member"!==j.current||q.current||B.current||jy(t)||Ry(e)||(console.log("[Callix Dialer] a aba com o discador não responde; esta aba vai assumir"),null==(n=ne.current)||n.call(ne))})};return document.addEventListener("visibilitychange",t),window.addEventListener("focus",t),()=>{document.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t)}},[Y,I,r]);const re=t.useCallback(async t=>{var n,r,s,l;if(d(!0),u(null),x("Preparando login..."),console.log("[Callix Dialer] 🚀 handleLogin iniciado para usuário:",t),e.engineUrl){const n=e.apiUrl||"/api/user-sdk-session";try{x("Conectando ao motor..."),H.current=!1;const e=Z(t);let r=null;try{r=await e.waitForView(15e3)}catch(g){if(!(g instanceof ju))throw g;console.log("[Callix Dialer] o motor recusou a credencial desta aba; fazendo login novo que substitui a sessão de lá")}const i=Q(),o=null!==r&&("running"===r.engine||"starting"===r.engine)&&!r.sessionLost;let a=null;if(o)a=eb(t),console.log("[Callix Dialer] motor já tem a sessão do agente; entrando sem novo login");else{x("Autenticando no Callix...");const r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t}),credentials:"same-origin"});if(!r.ok){const e=await r.json().catch(()=>({error:"Erro desconhecido"}));throw new Error(e.error||`Falha na autenticação: ${r.status}`)}a=(await r.json()).userSessionToken;try{const e=Zy(t);localStorage.setItem(Qy,t),localStorage.setItem(e.SESSION_TOKEN,a),localStorage.setItem(e.DOMAIN,i),localStorage.setItem(e.TIMESTAMP,Date.now().toString())}catch{}e.setSession({domain:i,userSessionToken:a}),x("Subindo o motor...");const o=await e.waitForView(2e4,e=>"running"===e.engine||"starting"===e.engine||Boolean(e.sessionLost),{fresh:!0});if(o.sessionLost)throw new Error(o.sessionLost.message)}await ee(t,i,a),console.log("[Callix Dialer] Conectado ao motor como",t)}catch(g){console.error("[Callix Dialer] Erro ao entrar pelo motor:",g),u(g instanceof Error?g.message:"Erro ao conectar ao motor"),a(!1),f(null)}finally{d(!1),x(null)}return}if(!Py(t,O.current))return console.log("[Callix Dialer] outra aba já segura a conexão deste usuário; esta aba vira membro"),k("member"),My(t,"member"),P(!0),i(t),d(!1),void x(null);null==(n=F.current)||n.post({type:"claim"}),V(),k("leader"),My(t,"leader");const h=e.apiUrl||"/api/user-sdk-session";let m;if("undefined"!=typeof window)try{const e=Zy(t);m=localStorage.getItem(e.SESSION_TOKEN)||void 0,console.log("[Callix Dialer] 🔍 Token anterior no localStorage:",m?"ENCONTRADO":"NÃO ENCONTRADO")}catch(g){console.warn("[Callix Dialer] Erro ao buscar token anterior:",g)}if(m){x("Encerrando sessão anterior..."),console.log("[Callix Dialer] 🔌 Token anterior encontrado, fazendo logout no servidor...");try{const e=await fetch(h,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${m}`,"x-session-token":m},credentials:"same-origin"});console.log("[Callix Dialer] 📡 Resposta do logout:",e.status),e.ok?console.log("[Callix Dialer] ✅ Logout no servidor concluído"):console.log("[Callix Dialer] ⚠️ Logout retornou status:",e.status)}catch($){console.warn("[Callix Dialer] ⚠️ Erro no logout (pode ser sessão expirada):",$)}x("Aguardando liberação da sessão anterior..."),console.log("[Callix Dialer] ⏳ Aguardando Kamailio processar unregister (5 segundos)..."),await new Promise(e=>setTimeout(e,5e3)),console.log("[Callix Dialer] ✅ Período de espera concluído")}if("undefined"!=typeof window)try{const e=Zy(t);localStorage.removeItem(e.SESSION_TOKEN),localStorage.removeItem(e.TIMESTAMP),console.log("[Callix Dialer] 🗑️ Token antigo removido do localStorage")}catch(g){console.warn("[Callix Dialer] Erro ao limpar localStorage:",g)}x("Fechando conexão anterior..."),console.log("[Callix Dialer] 🔌 Verificando WebSocket SIP local..."),await Vy(),(o||c)&&(console.log("[Callix Dialer] 🔌 Preparando para fechar conexão SIP local..."),w.current&&(console.log("[Callix Dialer] 📴 Chamando goOffline() via cleanupRef..."),w.current.goOffline(),await new Promise(e=>setTimeout(e,500)),console.log("[Callix Dialer] 🛑 Chamando stop() via cleanupRef..."),w.current.stop(),await new Promise(e=>setTimeout(e,500))),console.log("[Callix Dialer] ⏳ Desmontando CallixClientProvider..."),a(!1),f(null),E(!0),await new Promise(e=>setTimeout(e,1e3)),E(!1),console.log("[Callix Dialer] ✅ SDK desmontado"));try{x("Autenticando no Callix..."),console.log("[Callix Dialer] 🔐 Criando nova sessão no servidor...");const n=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t,previousToken:m}),credentials:"same-origin"});if(!n.ok){const e=await n.json().catch(()=>({error:"Erro desconhecido"}));throw new Error(e.error||`Falha na autenticação: ${n.status}`)}const o=await n.json(),d=e.domain||o.domain||"villelabrasil.callix.com.br";f(o.userSessionToken),p(d),i(t),a(!0),u(null),C(Date.now()),console.log("[Callix Dialer] Nova providerKey gerada para forçar recriação do SDK"),L(null),P(!0),null==(r=F.current)||r.post({type:"login"});try{const e=`https://${d}/sdk/v1/client/user-service/config`;x("Carregando configurações..."),console.log("[Callix Dialer] 🔍 Buscando configuração do serviço:",e);const n=await fetch(e,{headers:{Authorization:`Bearer ${o.userSessionToken}`},credentials:"omit"});if(console.log("[Callix Dialer] 📡 Resposta da config:",n.status),n.ok){const e=await n.json();console.log("[Callix Dialer] 📦 Dados da config recebidos:",JSON.stringify(e,null,2));const r=!0===(null==(l=null==(s=null==e?void 0:e.service)?void 0:s.outboundOptions)?void 0:l.skipQualification);if(console.log("[Callix Dialer] ✅ skipQualification configurado:",r),y(r),"undefined"!=typeof window){const e=Zy(t);localStorage.setItem(e.SKIP_MANUAL_QUALIFICATION,r.toString()),console.log("[Callix Dialer] 💾 skipQualification salvo no localStorage")}}else{const e=await n.text();console.warn("[Callix Dialer] ⚠️ Erro ao buscar config do serviço:",n.status,e)}}catch(v){console.error("[Callix Dialer] ❌ Erro ao buscar config do serviço:",v)}if("undefined"!=typeof window)try{const e=Zy(t);localStorage.setItem(Qy,t),localStorage.setItem(e.SESSION_TOKEN,o.userSessionToken),localStorage.setItem(e.DOMAIN,d),localStorage.setItem(e.TIMESTAMP,Date.now().toString()),console.log("[Callix Dialer] Sessão salva no localStorage")}catch(g){console.warn("[Callix Dialer] Não foi possível salvar sessão:",g)}x("Conectando ao discador..."),console.log("[Callix Dialer] Autenticado com sucesso:",t)}catch(g){console.error("[Callix Dialer] Erro ao autenticar:",g),u(g instanceof Error?g.message:"Erro ao autenticar"),a(!1),f(null),Dy(t,O.current),k(null),Uy()}finally{d(!1),x(null)}},[e.apiUrl,e.domain,e.engineUrl,o,c,Z,ee,Q,V]);t.useEffect(()=>{W.current=re},[re]);const ie=t.useCallback(async t=>{var n,o;const s=!1!==(null==t?void 0:t.broadcast),d=!0===(null==t?void 0:t.keepDecision),l=r;if(V(),e.engineUrl?q.current&&(H.current=!0,null==(n=J.current)||n.command({name:"logoff"})):(s&&(null==(o=F.current)||o.post({type:"logout"})),w.current&&(console.log("[Callix Dialer] 📴 Logout: Chamando goOffline()..."),w.current.goOffline(),await new Promise(e=>setTimeout(e,500)),console.log("[Callix Dialer] 🛑 Logout: Chamando stop()..."),w.current.stop(),await new Promise(e=>setTimeout(e,500))),l&&Dy(l,O.current)),a(!1),f(null),p(null),u(null),d)return k("member"),void(l&&My(l,"member"));if(k(null),Uy(),i(N??null),"undefined"!=typeof window&&l)try{const e=Zy(l);localStorage.removeItem(Qy),localStorage.removeItem(e.SESSION_TOKEN),localStorage.removeItem(e.DOMAIN),localStorage.removeItem(e.TIMESTAMP),console.log("[Callix Dialer] Sessão removida do localStorage")}catch(c){console.warn("[Callix Dialer] Não foi possível limpar sessão:",c)}},[r,N,e.engineUrl,V]);t.useEffect(()=>{G.current=ie},[ie]);const oe=t.useCallback(async()=>{const e=r,t=F.current;if(!e||!t)return;d(!0),u(null),x("Trazendo o discador para esta aba..."),t.post({type:"takeover"}),await new Promise(e=>setTimeout(e,1500));const n=Ry(e);if(n&&n.tabId!==O.current)return console.log("[Callix Dialer] a outra aba não soltou a conexão; continuando como membro"),d(!1),void x(null);await W.current(e)},[r]),ae=t.useCallback(()=>{G.current()},[]),se=t.useCallback((e,t)=>{var n;r&&Dy(r,O.current),null==(n=F.current)||n.post({type:"dropped",originator:e}),k(null),Uy(),u(`${t.title}: ${t.detail}${t.action?` ${t.action}`:""}`),a(!1),f(null),p(null)},[r]),de=Boolean(r)&&!o&&(Y?M:!R),le=t.useMemo(()=>o||s||m||S||!r||de?null:{username:r,locked:Boolean(N),elsewhere:!Y&&"member"===I,note:D},[o,s,m,S,r,N,de,Y,I,D]),ue=t.useCallback(()=>{if(i(null),u(null),"undefined"!=typeof window)try{localStorage.removeItem(Qy)}catch{}},[]),ce="inline"===e.mode||"mobile"===T?Sy:q$,fe=e.mode,he=!1===(pe=e.clickToCall)?{enabled:!1}:!0===pe||null==pe?{enabled:!0}:{...pe,enabled:!1!==pe.enabled};var pe;return S?$.jsx(Ky.Provider,{value:{skipManualQualification:v},children:$.jsx(ce,{isAuthenticated:!1,username:r,onLogin:re,onLogout:ie,isLoadingSession:!0,sessionError:null,sessionStatus:"Encerrando sessão anterior...",variant:T,portalTarget:A,density:e.density,mode:fe})}):o&&(Y||c&&h)?Y&&J.current?$.jsx(Ky.Provider,{value:{skipManualQualification:v},children:$.jsxs(Mu,{client:J.current,children:[$.jsx(ce,{isAuthenticated:o,username:r,onLogin:re,onLogout:ie,isLoadingSession:s,sessionError:l,sessionStatus:b,variant:T,portalTarget:A,density:e.density,mode:fe}),c&&$.jsx(Hy,{enabled:he.enabled,pollIntervalMs:he.pollIntervalMs,sessionToken:c,onTask:he.onTask})]},_)}):c&&h?$.jsx(Ky.Provider,{value:{skipManualQualification:v},children:$.jsx(ku.CallixClientProvider,{domain:h,userSessionToken:c,children:$.jsxs(Xy,{ref:w,onSessionDropped:se,children:[$.jsx(ce,{isAuthenticated:o,username:r,onLogin:re,onLogout:ie,isLoadingSession:s,sessionError:l,sessionStatus:b,variant:T,portalTarget:A,density:e.density,mode:fe}),$.jsx(Hy,{enabled:he.enabled,pollIntervalMs:he.pollIntervalMs,sessionToken:c,onTask:he.onTask})]})},_)}):null:$.jsx(Ky.Provider,{value:{skipManualQualification:v},children:$.jsx(ce,{isAuthenticated:!1,username:r,onLogin:re,onLogout:ie,isLoadingSession:s||m||de,sessionError:l,sessionStatus:b,loginConfirmation:le,onCancelLoginConfirmation:ue,onTakeOverSession:oe,onLogoutAllTabs:ae,variant:T,portalTarget:A,density:e.density,mode:fe})})}function nb(e){console.log(`[Callix Dialer] 🔧 Widget v${Wy} inicializando...`);const t=new Jy(e);return t.init(),t}const rb={CallixDialerWidget:Jy,init:nb,version:Wy};"undefined"!=typeof window&&(window.CallixDialer=rb),e.CallixDialerWidget=Jy,e.WIDGET_VERSION=Wy,e.default=rb,e.init=nb,e.useDialerConfig=Yy,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
25
+ */var ku=function(){if(Tu)return Nu;Tu=1;var e,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(a,{CallOperatorStartupError:()=>s.CallOperatorStartupError,CallixClientParams:()=>s.CallixClientParams,CallixClientProvider:()=>g,CallixClientSdk:()=>s.CallixClientSdk,useCallOperator:()=>_,useCallOperatorAudioInputMuted:()=>M,useCallOperatorAudioOutputControls:()=>P,useCallOperatorAudioOutputMuted:()=>L,useCallOperatorAudioOutputVolume:()=>D,useCallOperatorBreaks:()=>U,useCallOperatorControls:()=>E,useCallOperatorCurrentBreak:()=>k,useCallOperatorCurrentCall:()=>N,useCallOperatorCurrentCallControls:()=>I,useCallOperatorCurrentCallInfo:()=>T,useCallOperatorDiscardQualifications:()=>O,useCallOperatorEventListener:()=>R,useCallOperatorStartupError:()=>j,useCallOperatorState:()=>C,useCallOperatorSuccessQualifications:()=>A,useCallixClient:()=>p}),e=a,Nu=((e,t,a,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let d of i(t))!o.call(e,d)&&d!==a&&n(e,d,{get:()=>t[d],enumerable:!(s=r(t,d))||s.enumerable});return e})(n({},"__esModule",{value:!0}),e);var s=vu(),d=vu(),l=Cu(),u=Iu(),c=m(),f=(0,l.createScope)(null),h=(0,l.molecule)((e,t)=>{let n=t(f);if(!n)throw new Error("Missing CallixClient parameters. You must wrap your component tree with CallixClientProvider.");return new d.CallixClientSdk(n)});function p(){return(0,u.useMolecule)(h)}function g({children:e,...t}){return(0,c.jsx)(u.ScopeProvider,{scope:f,value:t,children:e})}var $=Cu(),v=Iu(),y=t,b=t;function x(e){return(0,b.useSyncExternalStore)(e.subscribe.bind(e),e.get.bind(e),e.get.bind(e))}var w=(0,$.molecule)(e=>{let t=e(h).createCallOperator();return(0,$.onMount)(()=>{t.start();let e=()=>{t.stop()};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}}),(0,$.onUnmount)(()=>{t.stop()}),t});function _(){return(0,v.useMolecule)(w)}function C(){let e=_(),t=x(e.currentStateKeys);for(let n of t){if("startup.error"===n)return{state:"startupError",error:e.startupError.get()};if("startup"===n)return{state:"starting"};if("offline"===n||"available.networkDown"===n||"onBreak.networkDown"===n)return{state:"offline"};if("onBreak"===n)return{state:"onBreak",break:e.currentBreak.get()};if("available.callRinging"===n)return{state:"callRinging",call:e.currentCall.get()};if("manualCall.callSetup"===n)return{state:"manualCallSetup",call:e.currentCall.get()};if("manualCall.callRinging"===n)return{state:"manualCallRinging",call:e.currentCall.get()};if("manualCall.callFailed"===n)return{state:"manualCallFailed",call:e.currentCall.get()};if("available"===n||"manualCall.idle"===n)return{state:"idle"};if("inCall"===n)return{state:"callInProgress",call:e.currentCall.get()};if("afterCall"===n)return{state:"afterCall"}}}function S(e,t,n){return Object.fromEntries(n.map(n=>[n,(0,y.useCallback)((...r)=>{if(t){if("function"==typeof t[n])return t[n].apply(t,r);console.warn(`Method ${String(n)} is not a function on obj ${e}.`)}else console.warn(`Obj ${e} is null or undefined, cannot call method ${String(n)}.`)},[t])]))}function E(){return S("callOperator",_(),["becomeAvailable","goOffline","enterOnBreak","makeManualCall","finishAfterCall"])}function N(){return x(_().currentCall)}function T(){return x(_().currentCallInfo)}function A(){return x(_().successQualifications)}function O(){return x(_().discardQualifications)}function I(){return S("currentCall",N(),["answer","reject","hangup","isOnHold","hold","unhold","isMuted","mute","unmute"])}function k(){return x(_().currentBreak)}function j(){let e=C();if("startupError"===(null==e?void 0:e.state))return e.error}function R(e,t){let n=_(),r=(0,y.useRef)(t);r.current=t,(0,y.useEffect)(()=>{if(n)return n.on(e,(...e)=>{r.current.apply(null,e)})},[e,n])}function P(){return S("audioOutput",_().audioOutput,["setVolume","setMute"])}function D(){let e=_(),{setVolume:t}=P();return[x(e.audioOutput.volume),t]}function L(){let e=_(),{setMute:t}=P();return[x(e.audioOutput.isMuted),t]}function M(){let e=N(),[t,n]=(0,y.useState)((null==e?void 0:e.isMuted())??!1);return[t,(0,y.useCallback)(t=>{e&&(t?e.mute():e.unmute(),n(t))},[e])]}function U(){return x(_().breaks)}return Nu}();class ju extends Error{constructor(e,t){super(t),this.code=e,this.name="EngineAccessError"}}class Ru{constructor(e){this.value=e,this.listeners=new Set}get(){return this.value}set(e){if(JSON.stringify(e)!==JSON.stringify(this.value)){this.value=e;for(const t of this.listeners)t(e)}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}}const Pu={segments:[],status:null,insight:null,interims:0};class Du{constructor(e){this.options=e,this.userSignal=new Ru(void 0),this.listeners=new Set,this.sessionLostListeners=new Set,this.viewWaiters=[],this.ws=null,this.reconnectDelay=500,this.pendingCommands=[],this.reconnectTimer=null,this.closed=!1,this.iceServers=[{urls:"stun:stun.l.google.com:19302"}],this.pc=null,this.connectionId=null,this.remoteSet=!1,this.pendingCandidates=[],this.micStream=null,this.audioSeq=0,this.unlockListener=null,this.agentId=e.agentId,this.session=e.session??null,this.log=e.log??(()=>{}),this.audio=void 0!==e.audioElement?e.audioElement:function(){if("undefined"==typeof document)return null;const e=document.createElement("audio");return e.autoplay=!0,e.setAttribute("playsinline","true"),e.style.display="none",e.dataset.callixEngineAudio="true",document.body.appendChild(e),e}(),this.state={wsState:"idle",tabId:null,view:null,engaged:!1,pcState:"idle",needsUnlock:!1,micError:null,lastError:null,inputMuted:!1,outputMuted:!1,outputVolume:100,transcript:Pu,sessionLost:null,rejected:null}}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setState(e){this.state={...this.state,...e};for(const t of this.listeners)t()}get currentCall(){var e,t;return(null==(t=null==(e=this.state.view)?void 0:e.snapshot)?void 0:t.leg.call)??null}connect(){if(this.closed&&(this.closed=!1),this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING))return;const e=this.options.WebSocketImpl??WebSocket;this.setState({wsState:"connecting"});const t=new e(function(e){const t=new URL(e,"undefined"!=typeof window?window.location.href:"http://localhost");return t.protocol="https:"===t.protocol?"wss:":"ws:",t.pathname=`${t.pathname.replace(/\/+$/,"")}/ws`,t.search="",t.hash="",t.toString()}(this.options.url));this.ws=t,t.onopen=()=>{var e,n;if(this.ws!==t)return;void 0!==this.pendingLogoffToken&&(null==(n=(e=this.options).sessionToken)?void 0:n.call(e))!==this.pendingLogoffToken&&(this.pendingCommands=this.pendingCommands.filter(e=>"logoff"!==e.command.name),this.rejectWaiters(new ju("session-changed","A sessão mudou antes de confirmar a saída."))),this.reconnectDelay=500,this.setState({wsState:"open"});const r=!this.session&&this.options.sessionToken?this.options.sessionToken():null,i={type:"hello",role:"tab",agentId:this.agentId,...this.options.token?{token:this.options.token}:{},...this.options.version?{version:this.options.version}:{},...r?{sessionToken:r}:{},label:this.options.label??"Discador",...this.session?{session:this.session}:{}};this.send(i),this.log("conectado ao host do motor")},t.onmessage=e=>{if(this.ws!==t)return;let n;try{n=JSON.parse(String(e.data))}catch{return}this.handle(n)},t.onclose=()=>{if(this.ws!==t)return;this.ws=null;const e=this.state.engaged;this.setState({wsState:"closed",tabId:null,engaged:!1}),e&&this.stopAudio(),this.closed||(this.log(`conexão com o motor caiu; nova tentativa em ${this.reconnectDelay} ms`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},this.reconnectDelay),this.reconnectDelay=Math.min(2*this.reconnectDelay,5e3))},t.onerror=()=>{}}close(){this.closed=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopAudio();const e=this.ws;this.ws=null,e&&(e.onclose=null,e.close()),this.pendingCommands=[],this.rejectWaiters(new Error("a conexão com o motor foi encerrada")),this.setState({wsState:"closed",tabId:null,engaged:!1})}waitForView(e=15e3,t,n){const r=this.state.rejected;return r?Promise.reject(new ju(r.code,r.message)):(null==n?void 0:n.fresh)||!this.state.view||!this.state.tabId||t&&!t(this.state.view)?new Promise((n,r)=>{const i=setTimeout(()=>{const e=this.viewWaiters.findIndex(e=>e.timer===i);e>=0&&this.viewWaiters.splice(e,1),r(new Error("o motor não respondeu"))},e);this.viewWaiters.push({resolve:n,reject:r,accept:t,timer:i})}):Promise.resolve(this.state.view)}rejectWaiters(e){for(const t of this.viewWaiters.splice(0))clearTimeout(t.timer),t.reject(e)}send(e){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}handle(e){switch(e.type){case"welcome":Array.isArray(e.iceServers)&&e.iceServers.length>0&&(this.iceServers=e.iceServers),this.setState({tabId:e.tabId,rejected:null}),this.flushPendingCommands(),this.applyView(e.view),this.log(`sou a aba ${e.tabId}`),!1!==this.options.autoEngage&&e.view.engagedTabId!==e.tabId&&this.engage();break;case"view":this.applyView(e.view);break;case"engage":this.setState({engaged:e.engaged}),e.engaged?this.startAudio():this.stopAudio();break;case"signal":this.onSignal(e.payload);break;case"error":if("unauthorized"===e.code){this.setState({lastError:e.message,rejected:{code:e.code,message:e.message}}),this.session=null,this.reconnectDelay=5e3,this.log(`acesso recusado pelo host: ${e.message}`),this.rejectWaiters(new ju(e.code,e.message));break}if("session-changed"===e.code){void 0!==this.pendingLogoffToken&&(this.pendingCommands=this.pendingCommands.filter(e=>"logoff"!==e.command.name),this.rejectWaiters(new ju(e.code,e.message))),this.session=null,this.log("a sessão deste agente foi trocada por um login novo; reconectando com a credencial atual");break}this.setState({lastError:e.message}),this.log(`erro do host: ${e.message}`);break;case"transcript":this.pushSegment(e.segment);break;case"transcript-sync":this.setState({transcript:{segments:e.segments??[],status:e.status??null,insight:e.insight??null,interims:0}});break;case"insight":{const t=this.state.transcript.insight;(!t||e.insight.revision>=t.revision||e.insight.callId!==t.callId)&&this.setState({transcript:{...this.state.transcript,insight:e.insight}});break}case"transcript-status":this.onTranscriptStatus(e.status)}}applyView(e){var t,n;const r=this.state.view,i=e.sessionLost??null,o=Boolean(i)&&!(null==r?void 0:r.sessionLost);o&&(this.session=null,this.log(`o Callix derrubou a sessão: ${(null==i?void 0:i.message)??""}`));const a=null==(t=e.snapshot)?void 0:t.leg.user;this.userSignal.set(a?{...a,sessionId:0}:void 0);const s=null==(n=e.snapshot)?void 0:n.leg.call,d={view:e,sessionLost:i?{originator:i.originator,message:i.message}:null};s&&"boolean"==typeof s.muted&&s.muted!==this.state.inputMuted&&"ended"!==s.state&&(d.inputMuted=s.muted),this.setState(d);for(const l of this.viewWaiters.splice(0))!l.accept||l.accept(e)?(clearTimeout(l.timer),l.resolve(e)):this.viewWaiters.push(l);if(o&&i)for(const l of this.sessionLostListeners)l(i)}onSessionLost(e){return this.sessionLostListeners.add(e),()=>{this.sessionLostListeners.delete(e)}}setSession(e){if(void 0!==this.pendingLogoffToken&&(this.pendingCommands=this.pendingCommands.filter(e=>"logoff"!==e.command.name),this.rejectWaiters(new ju("session-changed","Uma sessão nova substituiu o pedido de saída anterior."))),this.session=e,this.setState({rejected:null,sessionLost:null}),this.ws&&this.ws.readyState===WebSocket.OPEN){if(this.state.tabId)return void this.send({type:"session",session:e});const t=this.ws;this.ws=null,t.onopen=null,t.onmessage=null,t.onclose=null,t.close(),this.setState({wsState:"closed"})}this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.reconnectDelay=500,this.connect()}engage(){this.send({type:"engage"})}release(){this.send({type:"release"})}async logoff(e=4e4){var t,n;if(this.state.rejected)throw new ju(this.state.rejected.code,this.state.rejected.message);this.session=null,this.pendingCommands=[],this.pendingLogoffToken=null==(n=(t=this.options).sessionToken)?void 0:n.call(t);const r={name:"logoff"};let i=!1;const o=this.waitForView(e,e=>e.loggingOff?(i=!0,!1):"stopped"===e.engine||"crashed"===e.engine||i&&Boolean(e.logoffError),{fresh:!0});this.command(r);try{const e=await o;if(e.logoffError)throw new Error(e.logoffError);if(!i||"stopped"!==e.engine)throw new Error("O motor parou sem confirmar o encerramento da sessão no Callix.")}catch(a){if(a instanceof ju)throw a;throw new Error(a instanceof Error&&"o motor não respondeu"!==a.message?a.message:"O motor não confirmou o encerramento da sessão.")}finally{this.pendingCommands=this.pendingCommands.filter(e=>e.command!==r),this.pendingLogoffToken=void 0}}command(e){if(this.ws&&this.ws.readyState===WebSocket.OPEN&&this.state.tabId)return this.send({type:"command",command:e}),void this.log(`comando: ${e.name}${e.phone?` ${e.phone}`:""}`);this.pendingCommands.push({command:e,at:Date.now()}),this.pendingCommands.length>10&&this.pendingCommands.shift(),this.log(`comando: ${e.name} guardado até a conexão com o motor voltar`),this.setState({lastError:"Sem conexão com o motor neste momento; o comando será enviado assim que ela voltar."}),this.connect()}flushPendingCommands(){const e=Date.now(),t=this.pendingCommands.splice(0);for(const n of t)e-n.at>15e3?this.log(`comando ${n.command.name} descartado: a conexão demorou demais para voltar`):(this.send({type:"command",command:n.command}),this.log(`comando: ${n.command.name} (enviado depois da reconexão)`))}setInputMuted(e){if(this.micStream)for(const t of this.micStream.getAudioTracks())t.enabled=!e;this.setState({inputMuted:e}),this.currentCall&&this.command({name:e?"mute":"unmute"})}setOutputMuted(e){this.audio&&(this.audio.muted=e),this.setState({outputMuted:e})}setOutputVolume(e){const t=Math.max(0,Math.min(100,Math.round(e)));this.audio&&(this.audio.volume=t/100),this.setState({outputVolume:t})}async setOutputDevice(e){const t=this.audio;if(!(null==t?void 0:t.setSinkId))throw new Error("este navegador não permite escolher a saída de som");await t.setSinkId(e)}async unlockAudio(){if(this.audio&&this.audio.srcObject)try{await this.audio.play(),this.setState({needsUnlock:!1})}catch{this.setState({needsUnlock:!0})}}async startAudio(){const e=++this.audioSeq;this.stopAudio();const t=void 0===this.options.mediaDevices?"undefined"!=typeof navigator?navigator.mediaDevices:null:this.options.mediaDevices;if(!(null==t?void 0:t.getUserMedia))return void this.setState({micError:"Este navegador não permite usar o microfone pela página."});let n;try{n=await t.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})}catch(a){const e=`Microfone indisponível: ${a.message}`;return this.setState({micError:e}),void this.log(e)}if(e!==this.audioSeq||!this.state.engaged){for(const e of n.getTracks())e.stop();return}this.micStream=n;for(const s of n.getAudioTracks())s.enabled=!this.state.inputMuted;this.setState({micError:null});const r=new(this.options.PeerConnectionImpl??RTCPeerConnection)({iceServers:this.iceServers});this.pc=r;const i=Math.random().toString(36).slice(2,10);this.connectionId=i,this.remoteSet=!1,this.pendingCandidates=[];for(const s of n.getAudioTracks())r.addTrack(s,n);r.onicecandidate=e=>{this.send({type:"signal",payload:{connectionId:i,candidate:e.candidate?e.candidate.toJSON():null}})},r.ontrack=e=>{const t=e.streams[0]??new MediaStream([e.track]);this.audio&&(this.audio.srcObject=t,this.audio.muted=this.state.outputMuted,this.audio.volume=this.state.outputVolume/100,this.audio.play().then(()=>this.setState({needsUnlock:!1})).catch(()=>{this.setState({needsUnlock:!0}),this.armUnlock()})),this.log("áudio do motor chegou")},r.onconnectionstatechange=()=>{this.pc===r&&(this.setState({pcState:r.connectionState}),this.log(`WebRTC: ${r.connectionState}`),"failed"===r.connectionState&&this.state.engaged&&(this.log("conexão de áudio com o motor falhou; renegociando"),this.startAudio()))};const o=await r.createOffer();this.pc===r&&(await r.setLocalDescription(o),this.send({type:"signal",payload:{connectionId:i,description:{type:o.type,sdp:o.sdp}}}),this.setState({pcState:r.connectionState}))}stopAudio(){if(this.pc&&(this.pc.onconnectionstatechange=null,this.pc.onicecandidate=null,this.pc.ontrack=null,this.pc.close(),this.pc=null),this.connectionId=null,this.micStream){for(const e of this.micStream.getTracks())e.stop();this.micStream=null}this.audio&&(this.audio.srcObject=null),"idle"!==this.state.pcState&&this.setState({pcState:"idle"})}async onSignal(e){const t=this.pc;if(t&&(!e.connectionId||e.connectionId===this.connectionId))try{if(e.description){await t.setRemoteDescription(e.description),this.remoteSet=!0;for(const e of this.pendingCandidates.splice(0))await t.addIceCandidate(e).catch(()=>{})}if(void 0!==e.candidate){const n=e.candidate??void 0;!this.remoteSet&&n?this.pendingCandidates.push(n):await t.addIceCandidate(n).catch(()=>{})}}catch(n){this.log(`sinalização: ${n.message}`)}}armUnlock(){if(this.unlockListener||"undefined"==typeof document)return;const e=()=>{document.removeEventListener("pointerdown",e,!0),document.removeEventListener("keydown",e,!0),this.unlockListener=null,this.unlockAudio()};this.unlockListener=e,document.addEventListener("pointerdown",e,!0),document.addEventListener("keydown",e,!0)}pushSegment(e){const t=this.state.transcript;let n=t.segments,r=t.insight,i=t.interims;n.length&&n[0].callId!==e.callId&&(n=[],r=null,i=0);const o=n.findIndex(t=>t.id===e.id),a=o>=0?n.map((t,n)=>n===o?e:t):[...n,e];a.length>300&&a.shift(),e.interim&&(i+=1),this.setState({transcript:{...t,segments:a,insight:r,interims:i}})}onTranscriptStatus(e){const t=this.state.transcript;if(!t.status||t.status.recordingId===e.recordingId||"running"===e.live){const n=t.status&&t.status.recordingId!==e.recordingId;this.setState({transcript:{...t,status:e,...n?{segments:[],insight:null,interims:0}:{}}})}}}const Lu=t.createContext(null);function Mu({client:e,children:t}){return $.jsx(Lu.Provider,{value:e,children:t})}function Uu(e){return t.useSyncExternalStore(e.subscribe.bind(e),e.getState.bind(e),e.getState.bind(e))}const Fu=[{id:0,name:"Pausa"}];function Bu(e){var t;const n=null==(t=null==e?void 0:e.snapshot)?void 0:t.leg.breaks;return n&&n.length>0?n.map(e=>({id:e.id,name:e.name})):Fu}function qu(e){var t;return(null==(t=e.snapshot)?void 0:t.leg.break)??Bu(e)[0]}function zu(e){return"number"==typeof e?{name:"pause",breakId:e}:{name:"pause"}}function Hu(e){return{id:e.id,name:e.name,isSystemQualification:!1,systemQualificationType:0}}function Wu(e,t){var n;return((null==(n=null==e?void 0:e.snapshot)?void 0:n.leg.qualifications)??[]).filter(e=>e.kind===t).map(Hu)}class Gu{constructor(e,t){this.client=e,this.listeners=new Map,this.snapshot=t}get id(){return this.snapshot.id}get direction(){return this.snapshot.direction}get data(){var e;return{destinationNumber:null==(e=this.snapshot.contact)?void 0:e.phone,campaignContactPhoneId:this.snapshot.campaignContactPhoneId,answeredAt:this.snapshot.answeredAt?new Date(this.snapshot.answeredAt):void 0}}get callerNumber(){var e;return null==(e=this.snapshot.contact)?void 0:e.phone}get peerDisplayName(){var e;return null==(e=this.snapshot.contact)?void 0:e.name}get isEstablished(){return"active"===this.snapshot.state}get isEnded(){return"ended"===this.snapshot.state}get currentDurationSeconds(){const e=this.snapshot.answeredAt??this.snapshot.startedAt;return Math.max(0,Math.floor((Date.now()-e)/1e3))}answer(){this.client.command({name:"answer"})}reject(){this.client.command({name:"reject"})}hangup(){this.client.command({name:"hangup"})}isOnHold(){return{local:!1,remote:!1}}async hold(){}async unhold(){}isMuted(){return this.client.getState().inputMuted}mute(){this.client.setInputMuted(!0)}unmute(){this.client.setInputMuted(!1)}sendDtmf(e){this.client.command({name:"dtmf",tones:e})}on(e,t){let n=this.listeners.get(e);return n||(n=new Set,this.listeners.set(e,n)),n.add(t),this}once(e,t){const n=(...r)=>{this.off(e,n),t(...r)};return this.on(e,n)}off(e,t){var n;return null==(n=this.listeners.get(e))||n.delete(t),this}toCallData(){var e;return{id:this.snapshot.id,direction:this.snapshot.direction,destinationNumber:(null==(e=this.snapshot.contact)?void 0:e.phone)??"",answeredAt:this.snapshot.answeredAt?new Date(this.snapshot.answeredAt).toISOString():void 0,campaignContactPhoneId:this.snapshot.campaignContactPhoneId,isMuted:this.snapshot.muted}}}function Vu(e){var n,r;const i=(null==(r=null==(n=Uu(e).view)?void 0:n.snapshot)?void 0:r.leg.call)??null,o=t.useRef(null);return i&&"ended"!==i.state?o.current&&o.current.id===i.id?o.current.snapshot=i:o.current=new Gu(e,i):o.current=null,o.current}function Ku(e){const n=Uu(e),r=Vu(e);return t.useMemo(()=>function(e,t){var n,r,i;if(!e)return;if("anotherDevice"===(null==(n=e.sessionLost)?void 0:n.originator))return{state:"startupError",error:"userIsAlreadyConnectedOnAnotherDevice"};const o=null==(r=e.snapshot)?void 0:r.leg;if(!o)return"starting"===e.engine||"running"===e.engine?{state:"starting"}:{state:"offline"};const a=t??void 0;switch(o.status){case"starting":return{state:"starting"};case"available":return{state:"idle"};case"ringing":return{state:"callRinging",call:a};case"dialing":return"ringing"===(null==(i=o.call)?void 0:i.state)?{state:"manualCallRinging",call:a}:{state:"manualCallSetup",call:a};case"inCall":return{state:"callInProgress",call:a};case"afterCall":return{state:"afterCall"};case"onBreak":return{state:"onBreak",break:qu(e)};case"offline":return{state:"offline"};case"error":return{state:"startupError",error:"unknownError"}}}(n.view,r),[n.view,r])}function Yu(e){var n,r,i,o,a;const s=Uu(e).view,d=JSON.stringify([null==(r=null==(n=null==s?void 0:s.snapshot)?void 0:n.leg.call)?void 0:r.id,null==(o=null==(i=null==s?void 0:s.snapshot)?void 0:i.leg.call)?void 0:o.contact,null==(a=null==s?void 0:s.snapshot)?void 0:a.leg.qualifications]);return t.useMemo(()=>function(e){var t;const n=null==(t=null==e?void 0:e.snapshot)?void 0:t.leg,r=null==n?void 0:n.call;if(!n||!r)return;const i=Wu(e,"success"),o=Wu(e,"discard"),a=r.contact;if(null==a?void 0:a.campaign)return{type:"campaign",info:{campaign:{id:0,name:a.campaign,type:0,requireCallComments:!1,enableTransfer:!1,enableScheduledCall:!1,successQualifications:i,discardQualifications:o,previewDuration:"",showCampaignModelOnService:!1,skipCallQualification:!1},campaignList:{id:0,name:""},campaignContact:{id:r.campaignContactPhoneId??0,label:a.name,phoneNumber:a.phone}}};return{type:"manual",info:{successQualifications:i,discardQualifications:o}}}(s),[d])}function Xu(e,n){var r,i;const o=Uu(e),a=(null==(i=null==(r=o.view)?void 0:r.snapshot)?void 0:i.leg.qualifications)??[],s=JSON.stringify(a);return t.useMemo(()=>Wu(o.view,n),[s,n])}const Ju=new WeakMap;function Zu(e){return t.useMemo(()=>function(e){let t=Ju.get(e);if(!t){const n=new Ru(Bu(e.getState().view));e.subscribe(()=>n.set(Bu(e.getState().view))),t={breaks:n,user:e.userSignal,audioOutput:{setAudioOutputDevice:t=>{e.setOutputDevice(t).catch(()=>{})},setVolume:t=>e.setOutputVolume(t),setMute:t=>e.setOutputMuted(t)},stop:()=>{},goOffline:()=>{},becomeAvailable:()=>{var t,n;"onBreak"===(null==(n=null==(t=e.getState().view)?void 0:t.snapshot)?void 0:n.leg.status)&&e.command({name:"resume"})},enterOnBreak:t=>e.command(zu(t)),makeManualCall:t=>e.command({name:"dial",phone:t}),finishAfterCall:t=>{"number"==typeof t.qualificationId?e.command({name:"qualify",qualificationId:t.qualificationId,result:"failure"===t.result?"discard":"success"}):e.command({name:"finish"})}},Ju.set(e,t)}return t}(e),[e])}function Qu(){const e=t.useContext(Lu);return e?Zu(e):ku.useCallOperator()}function ec(){const e=t.useContext(Lu);return e?Ku(e):ku.useCallOperatorState()}function tc(){const e=t.useContext(Lu);return e?(n=e,t.useMemo(()=>({becomeAvailable:()=>{var e,t;"onBreak"===(null==(t=null==(e=n.getState().view)?void 0:e.snapshot)?void 0:t.leg.status)&&n.command({name:"resume"})},goOffline:()=>{},enterOnBreak:e=>n.command(zu(e)),makeManualCall:e=>n.command({name:"dial",phone:e}),finishAfterCall:e=>{"number"==typeof e.qualificationId?n.command({name:"qualify",qualificationId:e.qualificationId,result:"failure"===e.result?"discard":"success"}):n.command({name:"finish"})}}),[n])):ku.useCallOperatorControls();var n}function nc(){const e=t.useContext(Lu);return e?Vu(e)??void 0:ku.useCallOperatorCurrentCall()}function rc(){const e=t.useContext(Lu);return e?Yu(e):ku.useCallOperatorCurrentCallInfo()}function ic(){const e=t.useContext(Lu);return e?Xu(e,"success"):ku.useCallOperatorSuccessQualifications()}function oc(){const e=t.useContext(Lu);return e?Xu(e,"discard"):ku.useCallOperatorDiscardQualifications()}function ac(){const e=t.useContext(Lu);return e?(n=e,t.useMemo(()=>({answer:()=>n.command({name:"answer"}),reject:()=>n.command({name:"reject"}),hangup:()=>n.command({name:"hangup"}),isOnHold:()=>({local:!1,remote:!1}),hold:async()=>{},unhold:async()=>{},isMuted:()=>n.getState().inputMuted,mute:()=>n.setInputMuted(!0),unmute:()=>n.setInputMuted(!1)}),[n])):ku.useCallOperatorCurrentCallControls();var n}function sc(){const e=t.useContext(Lu);return e?function(e){const n=Uu(e),r=t.useCallback(t=>e.setInputMuted(t),[e]);return[n.inputMuted,r]}(e):ku.useCallOperatorAudioInputMuted()}function dc(){const e=t.useContext(Lu);return e?function(e){const n=Uu(e),r=t.useCallback(t=>e.setOutputMuted(t),[e]);return[n.outputMuted,r]}(e):ku.useCallOperatorAudioOutputMuted()}function lc(){const e=t.useContext(Lu);return e?function(e){const n=Uu(e),r=t.useCallback(t=>e.setOutputVolume(t),[e]);return[n.outputVolume,r]}(e):ku.useCallOperatorAudioOutputVolume()}function uc(e,n){const r=t.useContext(Lu);r?function(e,n,r){const i=t.useRef(r);i.current=r,t.useEffect(()=>e.onSessionLost(e=>{i.current({originator:e.originator})}),[e,n])}(r,e,n):ku.useCallOperatorEventListener(e,n)}var cc={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},fc=t.createContext&&t.createContext(cc),hc=["attr","size","title"];function pc(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mc(){return mc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mc.apply(this,arguments)}function gc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gc(Object(n),!0).forEach(function(t){vc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vc(e,t,n){var r;return(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?r:r+"")in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yc(e){return e&&e.map((e,n)=>t.createElement(e.tag,$c({key:n},e.attr),yc(e.child)))}function bc(e){return n=>t.createElement(xc,mc({attr:$c({},e.attr)},n),yc(e.child))}function xc(e){var n=n=>{var r,{attr:i,size:o,title:a}=e,s=pc(e,hc),d=o||n.size||"1em";return n.className&&(r=n.className),e.className&&(r=(r?r+" ":"")+e.className),t.createElement("svg",mc({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,i,s,{className:r,style:$c($c({color:e.color||n.color},n.style),e.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),a&&t.createElement("title",null,a),e.children)};return void 0!==fc?t.createElement(fc.Consumer,null,e=>n(e)):n(cc)}function wc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"22 12 18 12 15 21 9 3 6 12 2 12"},child:[]}]})(e)}function _c(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"16",x2:"12.01",y2:"16"},child:[]}]})(e)}function Cc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"},child:[]},{tag:"line",attr:{x1:"12",y1:"9",x2:"12",y2:"13"},child:[]},{tag:"line",attr:{x1:"12",y1:"17",x2:"12.01",y2:"17"},child:[]}]})(e)}function Sc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"19",y1:"12",x2:"5",y2:"12"},child:[]},{tag:"polyline",attr:{points:"12 19 5 12 12 5"},child:[]}]})(e)}function Ec(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"2",y:"7",width:"20",height:"14",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"},child:[]}]})(e)}function Nc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"},child:[]},{tag:"polyline",attr:{points:"22 4 12 14.01 9 11.01"},child:[]}]})(e)}function Tc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"polyline",attr:{points:"12 6 12 12 16 14"},child:[]}]})(e)}function Ac(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"},child:[]},{tag:"line",attr:{x1:"18",y1:"9",x2:"12",y2:"15"},child:[]},{tag:"line",attr:{x1:"12",y1:"9",x2:"18",y2:"15"},child:[]}]})(e)}function Oc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"4",y1:"9",x2:"20",y2:"9"},child:[]},{tag:"line",attr:{x1:"4",y1:"15",x2:"20",y2:"15"},child:[]},{tag:"line",attr:{x1:"10",y1:"3",x2:"8",y2:"21"},child:[]},{tag:"line",attr:{x1:"16",y1:"3",x2:"14",y2:"21"},child:[]}]})(e)}function Ic(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 18v-6a9 9 0 0 1 18 0v6"},child:[]},{tag:"path",attr:{d:"M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"},child:[]}]})(e)}function kc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"},child:[]},{tag:"polyline",attr:{points:"16 17 21 12 16 7"},child:[]},{tag:"line",attr:{x1:"21",y1:"12",x2:"9",y2:"12"},child:[]}]})(e)}function jc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"1",y1:"1",x2:"23",y2:"23"},child:[]},{tag:"path",attr:{d:"M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6"},child:[]},{tag:"path",attr:{d:"M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23"},child:[]},{tag:"line",attr:{x1:"12",y1:"19",x2:"12",y2:"23"},child:[]},{tag:"line",attr:{x1:"8",y1:"23",x2:"16",y2:"23"},child:[]}]})(e)}function Rc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"},child:[]},{tag:"path",attr:{d:"M19 10v2a7 7 0 0 1-14 0v-2"},child:[]},{tag:"line",attr:{x1:"12",y1:"19",x2:"12",y2:"23"},child:[]},{tag:"line",attr:{x1:"8",y1:"23",x2:"16",y2:"23"},child:[]}]})(e)}function Pc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]}]})(e)}function Dc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"10",y1:"15",x2:"10",y2:"9"},child:[]},{tag:"line",attr:{x1:"14",y1:"15",x2:"14",y2:"9"},child:[]}]})(e)}function Lc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.05 5A5 5 0 0 1 19 8.95M15.05 1A9 9 0 0 1 23 8.94m-1 7.98v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"},child:[]}]})(e)}function Mc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"16 2 16 8 22 8"},child:[]},{tag:"line",attr:{x1:"23",y1:"1",x2:"16",y2:"8"},child:[]},{tag:"path",attr:{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"},child:[]}]})(e)}function Uc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"},child:[]},{tag:"line",attr:{x1:"23",y1:"1",x2:"1",y2:"23"},child:[]}]})(e)}function Fc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"},child:[]}]})(e)}function Bc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"5",x2:"12",y2:"19"},child:[]},{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]}]})(e)}function qc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(e)}function zc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"},child:[]},{tag:"line",attr:{x1:"12",y1:"18",x2:"12.01",y2:"18"},child:[]}]})(e)}function Hc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"},child:[]},{tag:"circle",attr:{cx:"12",cy:"7",r:"4"},child:[]}]})(e)}function Wc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"},child:[]},{tag:"path",attr:{d:"M15.54 8.46a5 5 0 0 1 0 7.07"},child:[]}]})(e)}function Gc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"},child:[]},{tag:"path",attr:{d:"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"},child:[]}]})(e)}function Vc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"},child:[]},{tag:"line",attr:{x1:"23",y1:"9",x2:"17",y2:"15"},child:[]},{tag:"line",attr:{x1:"17",y1:"9",x2:"23",y2:"15"},child:[]}]})(e)}function Kc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"15",y1:"9",x2:"9",y2:"15"},child:[]},{tag:"line",attr:{x1:"9",y1:"9",x2:"15",y2:"15"},child:[]}]})(e)}function Yc(e){return bc({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}var Xc=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);var Jc,Zc,Qc,ef,tf,nf,rf,of,af=(e,t)=>!!~e.indexOf(t),sf=(e,t="-")=>e.join(t),df=(e,t)=>sf(e.filter(Boolean),t),lf=(e,t=1)=>e.slice(t),uf=e=>e,cf=()=>{},ff=e=>e[0].toUpperCase()+lf(e),hf=e=>e.replace(/[A-Z]/g,"-$&").toLowerCase(),pf=(e,t)=>{for(;"function"==typeof e;)e=e(t);return e},mf=(e,t)=>{e.size>t&&e.delete(e.keys().next().value)},gf=(e,t)=>!af("@:&",e[0])&&(af("rg",(typeof t)[5])||Array.isArray(t)),$f=(e,t,n)=>t?Object.keys(t).reduce((e,r)=>{const i=pf(t[r],n);return gf(r,i)?e[hf(r)]=i:e[r]="@"==r[0]&&af("figa",r[1])?(e[r]||[]).concat(i):$f(e[r]||{},i,n),e},e):e,vf="undefined"!=typeof CSS&&CSS.escape||(e=>e.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& ")),yf=e=>(Array.isArray(e)||(e=[e]),"@media "+sf(e.map(e=>("string"==typeof e&&(e={min:e}),e.raw||sf(Object.keys(e).map(t=>`(${t}-width:${e[t]})`)," and "))),",")),bf=e=>{for(var t=9,n=e.length;n--;)t=Math.imul(t^e.charCodeAt(n),1597334677);return"tw-"+((t^t>>>9)>>>0).toString(36)},xf=(e="")=>(Jc.push(e),""),wf=e=>{Jc.length=Math.max(Jc.lastIndexOf("")+~~e,0)},_f=e=>e&&!af("!:",e[0]),Cf=e=>":"==e[0],Sf=(e,t)=>{Zc.push({v:Jc.filter(Cf),d:e,n:t,i:af(Jc,"!"),$:""})},Ef=e=>{const t="-"==e[0];t&&(e=lf(e));const n=sf(Jc.filter(_f));return Sf("&"==e?n:(n&&n+"-")+e,t),""},Nf=(e,t)=>{let n="";for(let r,i=!1,o=0;r=e[o++];)if(i||"["==r)n+=r,i="]"!=r;else switch(r){case":":n=n&&xf(":"+(e[o]==r?e[o++]:"")+n);break;case"(":n=n&&xf(n),xf();break;case"!":xf(r);break;case")":case" ":case"\t":case"\n":case"\r":n=n&&Ef(n),wf(")"!==r);break;default:n+=r}n&&(t?xf(":"+n):"-"==n.slice(-1)?xf(n.slice(0,-1)):Ef(n))},Tf=e=>{xf(),Af(e),wf()},Af=e=>{switch(typeof e){case"string":Nf(e);break;case"function":Sf(e);break;case"object":Array.isArray(e)?e.forEach(Tf):e&&Object.keys(e).forEach(t=>{((e,t)=>{if(t){xf();const n=af("tbu",(typeof t)[1]);Nf(e,n),n&&Tf(t),wf()}})(t,e[t])})}},Of=new WeakMap,If=e=>(Jc=[],Zc=[],Array.isArray(e[0])&&Array.isArray(e[0].raw)?(e=>{let t=Of.get(e);if(!t){let n=NaN,r="";t=e.map((t,i)=>{if(n==n||"["!=t.slice(-1)&&!af(":-(",(e[i+1]||"")[0])||(n=i),i>=n)return o=>{i==n&&(r=""),r+=t,af("rg",(typeof o)[5])?r+=o:o&&(Nf(r),r="",Af(o)),i==e.length-1&&Nf(r)};const o=Zc=[];Nf(t);const a=[...Jc];return Zc=[],e=>{Zc.push(...o),Jc=[...a],e&&Af(e)}}),Of.set(e,t)}return t})(e[0]).forEach((t,n)=>t(e[n+1])):Af(e),Zc),kf=(e,t)=>("function"==typeof t&&(Qc=!1),t),jf=new WeakMap,Rf=(e,t)=>{const n=(e=>{Qc=!0;const t=JSON.stringify(e,kf);return Qc&&t})(t);let r;if(n){var i=jf.get(e);i||jf.set(e,i=new Map),r=i.get(n)}return r||(r=Object.defineProperty((n,r)=>(r=Array.isArray(n)?r:n,pf(e(t,r),r)),"toJSON",{value:()=>n||t}),i&&(i.set(n,r),mf(i,1e4))),r},Pf=(e,{css:t})=>t(If(e)),Df=e=>(t,n,r,i)=>{if(t){const o=n&&e(n);if(o&&o.length>0)return o.reduce((e,n)=>(e[df([r,n,i])]=t,e),{})}},Lf=Df(e=>({t:["top-left","top-right"],r:["top-right","bottom-right"],b:["bottom-left","bottom-right"],l:["bottom-left","top-left"],tl:["top-left"],tr:["top-right"],bl:["bottom-left"],br:["bottom-right"]}[e])),Mf=e=>{const t=({x:"lr",y:"tb"}[e]||e||"").split("").sort();for(let n=t.length;n--;)if(!(t[n]={t:"top",r:"right",b:"bottom",l:"left"}[t[n]]))return;if(t.length)return t},Uf=Df(Mf),Ff=(e,t)=>e+(":"==t[1]?lf(t,2)+":":lf(t))+":",Bf=(e,t=e.d)=>"function"==typeof t?"":e.v.reduce(Ff,"")+(e.i?"!":"")+(e.n?"-":"")+t,qf=e=>"cols"==e?"columns":"rows",zf=e=>(t,n,r)=>({[e]:r+((ef=sf(t))&&"-"+ef)}),Hf=(e,t)=>(n,r,i)=>(ef=sf(n,t))&&{[e||i]:ef},Wf=e=>(t,{theme:n},r)=>(ef=n(e||r,t))&&{[e||r]:ef},Gf=(e,t)=>(n,{theme:r},i)=>(ef=r(e||i,n,sf(n,t)))&&{[e||i]:ef},Vf=(e,t)=>(n,r)=>e(n,r,t),Kf=zf("display"),Yf=zf("position"),Xf=zf("textTransform"),Jf=zf("textDecoration"),Zf=zf("fontStyle"),Qf=e=>(t,n,r)=>({["--tw-"+e]:r,fontVariantNumeric:"var(--tw-ordinal,/*!*/ /*!*/) var(--tw-slashed-zero,/*!*/ /*!*/) var(--tw-numeric-figure,/*!*/ /*!*/) var(--tw-numeric-spacing,/*!*/ /*!*/) var(--tw-numeric-fraction,/*!*/ /*!*/)"}),eh=(e,{theme:t},n)=>(ef=t("inset",e))&&{[n]:ef},th=(e,t,n,r=n)=>(ef=t(r+"Opacity",lf(e)))&&{[`--tw-${n}-opacity`]:ef},nh=(e,t)=>Math.round(parseInt(e,16)*t),rh=(e,t,n)=>e&&"#"==e[0]&&(ef=(e.length-1)/3)&&(nf=[17,1,.062272][ef-1])?`rgba(${nh(e.substr(1,ef),nf)},${nh(e.substr(1+ef,ef),nf)},${nh(e.substr(1+2*ef,ef),nf)},${t?`var(--tw-${t}${n?","+n:""})`:n||1})`:e,ih=(e,t,n)=>n&&"string"==typeof n?(ef=rh(n,t+"-opacity"))&&ef!==n?{[`--tw-${t}-opacity`]:"1",[e]:[n,ef]}:{[e]:n}:void 0,oh=e=>(nf=rh(e,"","0"))==ef?"transparent":nf,ah=(e,{theme:t},n,r,i,o)=>(ef={x:["right","left"],y:["bottom","top"]}[e[0]])&&(nf=`--tw-${n}-${e[0]}-reverse`)?"reverse"==e[1]?{[nf]:"1"}:{[nf]:"0",[df([i,ef[0],o])]:(tf=t(r,lf(e)))&&`calc(${tf} * var(${nf}))`,[df([i,ef[1],o])]:tf&&[tf,`calc(${tf} * calc(1 - var(${nf})))`]}:void 0,sh=(e,t)=>t[0]&&{[e]:(af("wun",(t[0]||"")[3])?"space-":"")+t[0]},dh=e=>t=>af(["start","end"],t[0])?{[e]:"flex-"+t[0]}:sh(e,t),lh=e=>(t,{theme:n})=>{if(ef=n("grid"+ff(e),t,""))return{["grid-"+e]:ef};switch(t[0]){case"span":return t[1]&&{["grid-"+e]:`span ${t[1]} / span ${t[1]}`};case"start":case"end":return(ef=n("grid"+ff(e)+ff(t[0]),lf(t),sf(lf(t))))&&{[`grid-${e}-${t[0]}`]:ef}}},uh=(e,{theme:t},n)=>{switch(e[0]){case"solid":case"dashed":case"dotted":case"double":case"none":return Hf("borderStyle")(e);case"collapse":case"separate":return Hf("borderCollapse")(e);case"opacity":return th(e,t,n)}return(ef=t(n+"Width",e,""))?{borderWidth:ef}:ih("borderColor",n,t(n+"Color",e))},ch=e=>(e?"translate3d(var(--tw-translate-x,0),var(--tw-translate-y,0),0)":"translateX(var(--tw-translate-x,0)) translateY(var(--tw-translate-y,0))")+" rotate(var(--tw-rotate,0)) skewX(var(--tw-skew-x,0)) skewY(var(--tw-skew-y,0)) scaleX(var(--tw-scale-x,1)) scaleY(var(--tw-scale-y,1))",fh=(e,t,n)=>e[0]&&(ef=t.theme(n,e[1]||e[0]))&&{[`--tw-${n}-x`]:"y"!==e[0]&&ef,[`--tw-${n}-y`]:"x"!==e[0]&&ef,transform:[`${n}${e[1]?e[0].toUpperCase():""}(${ef})`,ch()]},hh=e=>(t,n,r)=>r[1]?Uf(n.theme(e,t),r[1],e):Wf(e)(t,n,r),ph=hh("padding"),mh=hh("margin"),gh=(e,{theme:t},n)=>(ef={w:"width",h:"height"}[e[0]])&&{[ef=`${n}${ff(ef)}`]:t(ef,lf(e))},$h=(e,{theme:t},n)=>{const r=n.split("-"),i="backdrop"==r[0]?r[0]+"-":"";if(i||e.unshift(...r),"filter"==e[0]){const t=["blur","brightness","contrast","grayscale","hue-rotate","invert",i&&"opacity","saturate","sepia",!i&&"drop-shadow"].filter(Boolean);return"none"==e[1]?{[i+"filter"]:"none"}:t.reduce((e,t)=>(e["--tw-"+i+t]="var(--tw-empty,/*!*/ /*!*/)",e),{[i+"filter"]:t.map(e=>`var(--tw-${i}${e})`).join(" ")})}return nf=e.shift(),af(["hue","drop"],nf)&&(nf+=ff(e.shift())),(ef=t(i?"backdrop"+ff(nf):nf,e))&&{["--tw-"+i+nf]:(Array.isArray(ef)?ef:[ef]).map(e=>`${hf(nf)}(${e})`).join(" ")}},vh={group:(e,{tag:t},n)=>t(sf([n,...e])),hidden:Vf(Kf,"none"),inline:Kf,block:Kf,contents:Kf,flow:Kf,table:(e,t,n)=>af(["auto","fixed"],e[0])?{tableLayout:e[0]}:Kf(e,t,n),flex(e,t,n){switch(e[0]){case"row":case"col":return{flexDirection:sf("col"==e[0]?["column",...lf(e)]:e)};case"nowrap":case"wrap":return{flexWrap:sf(e)};case"grow":case"shrink":return null!=(ef=t.theme("flex"+ff(e[0]),lf(e),e[1]||1))&&{["flex-"+e[0]]:""+ef}}return(ef=t.theme("flex",e,""))?{flex:ef}:Kf(e,t,n)},grid(e,t,n){switch(e[0]){case"cols":case"rows":return(ef=t.theme("gridTemplate"+ff(qf(e[0])),lf(e),2==e.length&&Number(e[1])?`repeat(${e[1]},minmax(0,1fr))`:sf(lf(e))))&&{["gridTemplate-"+qf(e[0])]:ef};case"flow":return e.length>1&&{gridAutoFlow:sf("col"==e[1]?["column",...lf(e,2)]:lf(e)," ")}}return Kf(e,t,n)},auto:(e,{theme:t})=>af(["cols","rows"],e[0])&&(ef=t("gridAuto"+ff(qf(e[0])),lf(e),sf(lf(e))))&&{["gridAuto-"+qf(e[0])]:ef},static:Yf,fixed:Yf,absolute:Yf,relative:Yf,sticky:Yf,visible:{visibility:"visible"},invisible:{visibility:"hidden"},antialiased:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},"subpixel-antialiased":{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"},truncate:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},"sr-only":{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"},"not-sr-only":{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"},resize:e=>({resize:{x:"horizontal",y:"vertical"}[e[0]]||e[0]||"both"}),box:e=>e[0]&&{boxSizing:e[0]+"-box"},appearance:Hf(),cursor:Gf(),float:Hf(),clear:Hf(),decoration:Hf("boxDecorationBreak"),isolate:{isolation:"isolate"},isolation:Hf(),"mix-blend":Hf("mixBlendMode"),top:eh,right:eh,bottom:eh,left:eh,inset:(e,{theme:t})=>(ef=Mf(e[0]))?Uf(t("inset",lf(e)),e[0]):(ef=t("inset",e))&&{top:ef,right:ef,bottom:ef,left:ef},underline:Jf,"line-through":Jf,"no-underline":Vf(Jf,"none"),"text-underline":Vf(Jf,"underline"),"text-no-underline":Vf(Jf,"none"),"text-line-through":Vf(Jf,"line-through"),uppercase:Xf,lowercase:Xf,capitalize:Xf,"normal-case":Vf(Xf,"none"),"text-normal-case":Vf(Xf,"none"),italic:Zf,"not-italic":Vf(Zf,"normal"),"font-italic":Vf(Zf,"italic"),"font-not-italic":Vf(Zf,"normal"),font:(e,t,n)=>(ef=t.theme("fontFamily",e,""))?{fontFamily:ef}:Wf("fontWeight")(e,t,n),items:e=>e[0]&&{alignItems:af(["start","end"],e[0])?"flex-"+e[0]:sf(e)},"justify-self":Hf(),"justify-items":Hf(),justify:dh("justifyContent"),content:dh("alignContent"),self:dh("alignSelf"),place:e=>e[0]&&sh("place-"+e[0],lf(e)),overscroll:e=>e[0]&&{["overscrollBehavior"+(e[1]?"-"+e[0]:"")]:e[1]||e[0]},col:lh("column"),row:lh("row"),duration:Wf("transitionDuration"),delay:Wf("transitionDelay"),tracking:Wf("letterSpacing"),leading:Wf("lineHeight"),z:Wf("zIndex"),opacity:Wf(),ease:Wf("transitionTimingFunction"),p:ph,py:ph,px:ph,pt:ph,pr:ph,pb:ph,pl:ph,m:mh,my:mh,mx:mh,mt:mh,mr:mh,mb:mh,ml:mh,w:Wf("width"),h:Wf("height"),min:gh,max:gh,fill:Wf(),order:Wf(),origin:Gf("transformOrigin"," "),select:Hf("userSelect"),"pointer-events":Hf(),align:Hf("verticalAlign"),whitespace:Hf("whiteSpace"),"normal-nums":{fontVariantNumeric:"normal"},ordinal:Qf("ordinal"),"slashed-zero":Qf("slashed-zero"),"lining-nums":Qf("numeric-figure"),"oldstyle-nums":Qf("numeric-figure"),"proportional-nums":Qf("numeric-spacing"),"tabular-nums":Qf("numeric-spacing"),"diagonal-fractions":Qf("numeric-fraction"),"stacked-fractions":Qf("numeric-fraction"),overflow:(e,t,n)=>af(["ellipsis","clip"],e[0])?Hf("textOverflow")(e):e[1]?{["overflow-"+e[0]]:e[1]}:Hf()(e,t,n),transform:e=>"none"==e[0]?{transform:"none"}:{"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1",transform:ch("gpu"==e[0])},rotate:(e,{theme:t})=>(ef=t("rotate",e))&&{"--tw-rotate":ef,transform:[`rotate(${ef})`,ch()]},scale:fh,translate:fh,skew:fh,gap:(e,t,n)=>(ef={x:"column",y:"row"}[e[0]])?{[ef+"Gap"]:t.theme("gap",lf(e))}:Wf("gap")(e,t,n),stroke:(e,t,n)=>(ef=t.theme("stroke",e,""))?{stroke:ef}:Wf("strokeWidth")(e,t,n),outline:(e,{theme:t})=>(ef=t("outline",e))&&{outline:ef[0],outlineOffset:ef[1]},"break-normal":{wordBreak:"normal",overflowWrap:"normal"},"break-words":{overflowWrap:"break-word"},"break-all":{wordBreak:"break-all"},text(e,{theme:t},n){switch(e[0]){case"left":case"center":case"right":case"justify":return{textAlign:e[0]};case"uppercase":case"lowercase":case"capitalize":return Xf([],ef,e[0]);case"opacity":return th(e,t,n)}const r=t("fontSize",e,"");return r?"string"==typeof r?{fontSize:r}:{fontSize:r[0],..."string"==typeof r[1]?{lineHeight:r[1]}:r[1]}:ih("color","text",t("textColor",e))},bg(e,{theme:t},n){switch(e[0]){case"fixed":case"local":case"scroll":return Hf("backgroundAttachment",",")(e);case"bottom":case"center":case"left":case"right":case"top":return Hf("backgroundPosition"," ")(e);case"no":return"repeat"==e[1]&&Hf("backgroundRepeat")(e);case"repeat":return af("xy",e[1])?Hf("backgroundRepeat")(e):{backgroundRepeat:e[1]||e[0]};case"opacity":return th(e,t,n,"background");case"clip":case"origin":return e[1]&&{["background-"+e[0]]:e[1]+("text"==e[1]?"":"-box")};case"blend":return Hf("background-blend-mode")(lf(e));case"gradient":if("to"==e[1]&&(ef=Mf(e[2])))return{backgroundImage:`linear-gradient(to ${sf(ef," ")},var(--tw-gradient-stops))`}}return(ef=t("backgroundPosition",e,""))?{backgroundPosition:ef}:(ef=t("backgroundSize",e,""))?{backgroundSize:ef}:(ef=t("backgroundImage",e,""))?{backgroundImage:ef}:ih("backgroundColor","bg",t("backgroundColor",e))},from:(e,{theme:t})=>(ef=t("gradientColorStops",e))&&{"--tw-gradient-from":ef,"--tw-gradient-stops":`var(--tw-gradient-from),var(--tw-gradient-to,${oh(ef)})`},via:(e,{theme:t})=>(ef=t("gradientColorStops",e))&&{"--tw-gradient-stops":`var(--tw-gradient-from),${ef},var(--tw-gradient-to,${oh(ef)})`},to:(e,{theme:t})=>(ef=t("gradientColorStops",e))&&{"--tw-gradient-to":ef},border:(e,t,n)=>{var r;const i=null==(r=Mf(e[0]))?void 0:r.map(ff);i&&(e=lf(e));let o=uh(e,t,n);return i&&o&&"object"==typeof o&&(o=Object.entries(o).reduce((e,[t,n])=>{if(t.startsWith("border"))for(const r of i)e[t.slice(0,6)+r+t.slice(6)]=n;else e[t]=n;return e},{})),o},divide:(e,t,n)=>(ef=ah(e,t,n,"divideWidth","border","width")||uh(e,t,n))&&{"&>:not([hidden])~:not([hidden])":ef},space:(e,t,n)=>(ef=ah(e,t,n,"space","margin"))&&{"&>:not([hidden])~:not([hidden])":ef},placeholder:(e,{theme:t},n)=>(ef="opacity"==e[0]?th(e,t,n):ih("color","placeholder",t("placeholderColor",e)))&&{"&::placeholder":ef},shadow:(e,{theme:t})=>(ef=t("boxShadow",e))&&{":global":{"*":{"--tw-shadow":"0 0 transparent"}},"--tw-shadow":"none"==ef?"0 0 transparent":ef,boxShadow:[ef,"var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)"]},animate:(e,{theme:t,tag:n})=>{if(nf=t("animation",e)){const e=nf.split(" ");return(ef=t("keyframes",e[0],tf={}))!==tf?(nf=n(e[0]))&&{animation:nf+" "+sf(lf(e)," "),["@keyframes "+nf]:ef}:{animation:nf}}},ring(e,{theme:t},n){switch(e[0]){case"inset":return{"--tw-ring-inset":"inset"};case"opacity":return th(e,t,n);case"offset":return(ef=t("ringOffsetWidth",lf(e),""))?{"--tw-ring-offset-width":ef}:{"--tw-ring-offset-color":t("ringOffsetColor",lf(e))}}return(ef=t("ringWidth",e,""))?{"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${ef} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)",":global":{"*":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":t("ringOffsetWidth","","0px"),"--tw-ring-offset-color":t("ringOffsetColor","","#fff"),"--tw-ring-color":rh(t("ringColor","","#93c5fd"),"ring-opacity",t("ringOpacity","","0.5")),"--tw-ring-offset-shadow":"0 0 transparent","--tw-ring-shadow":"0 0 transparent"}}}:{"--tw-ring-opacity":"1","--tw-ring-color":rh(t("ringColor",e),"ring-opacity")}},object:(e,t,n)=>af(["contain","cover","fill","none","scale-down"],sf(e))?{objectFit:sf(e)}:Gf("objectPosition"," ")(e,t,n),list:(e,t,n)=>"item"==sf(e)?Kf(e,t,n):af(["inside","outside"],sf(e))?{listStylePosition:e[0]}:Gf("listStyleType")(e,t,n),rounded:(e,t,n)=>Lf(t.theme("borderRadius",lf(e),""),e[0],"border","radius")||Wf("borderRadius")(e,t,n),"transition-none":{transitionProperty:"none"},transition:(e,{theme:t})=>({transitionProperty:t("transitionProperty",e),transitionTimingFunction:t("transitionTimingFunction",""),transitionDuration:t("transitionDuration","")}),container:(e,{theme:t})=>{const{screens:n=t("screens"),center:r,padding:i}=t("container"),o=e=>(ef=i&&("string"==typeof i?i:i[e]||i.DEFAULT))?{paddingRight:ef,paddingLeft:ef}:{};return Object.keys(n).reduce((e,t)=>((nf=n[t])&&"string"==typeof nf&&(e[yf(nf)]={"&":{"max-width":nf,...o(t)}}),e),{width:"100%",...r?{marginRight:"auto",marginLeft:"auto"}:{},...o("xs")})},filter:$h,blur:$h,brightness:$h,contrast:$h,grayscale:$h,"hue-rotate":$h,invert:$h,saturate:$h,sepia:$h,"drop-shadow":$h,backdrop:$h},yh={dark:"@media (prefers-color-scheme:dark)",sticky:"@supports ((position: -webkit-sticky) or (position:sticky))","motion-reduce":"@media (prefers-reduced-motion:reduce)","motion-safe":"@media (prefers-reduced-motion:no-preference)",first:"&:first-child",last:"&:last-child",even:"&:nth-child(2n)",odd:"&:nth-child(odd)",children:"&>*",siblings:"&~*",sibling:"&+*",override:"&&"},bh="__twind",xh=e=>{let t=self[bh];return t||(t=document.head.appendChild(document.createElement("style")),t.id=bh,e&&(t.nonce=e),t.appendChild(document.createTextNode(""))),t},wh=e=>({unknown(e,t=[],n,r){n||this.report({id:"UNKNOWN_THEME_VALUE",key:e+"."+sf(t)},r)},report:({id:t,...n})=>e(`[${t}] ${JSON.stringify(n)}`)}),_h=wh(e=>console.warn(e)),Ch=wh(e=>{throw new Error(e)}),Sh=wh(cf),Eh=(e,t,n)=>`${e}:${t}${n?" !important":""}`,Nh=(e,t,n)=>{let r="";const i=(o=e,Xc.get(o));var o;i&&(r+=`${Eh(i,t,n)};`);let a=function(e){var t=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(e);return t?t[1]?1:t[2]?2:t[3]?3:5:0}(e);return 1&a&&(r+=`-webkit-${Eh(e,t,n)};`),2&a&&(r+=`-moz-${Eh(e,t,n)};`),4&a&&(r+=`-ms-${Eh(e,t,n)};`),a=function(e,t){var n=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(e);return n?n[1]?/^sti/i.test(t)?1:0:n[2]?/^pat/i.test(t)?1:0:n[3]?/^image-/i.test(t)?1:0:n[4]?"-"===t[3]?2:0:/^(?:inline-)?grid$/i.test(t)?4:0:0}(e,t),1&a&&(r+=`${Eh(e,`-webkit-${t}`,n)};`),2&a&&(r+=`${Eh(e,`-moz-${t}`,n)};`),4&a&&(r+=`${Eh(e,`-ms-${t}`,n)};`),r+=Eh(e,t,n),r},Th=(e,t)=>{const n={};do{for(let t=1;t<e;t++)n[`${t}/${e}`]=Number((t/e*100).toFixed(6))+"%"}while(++e<=t);return n},Ah=(e,t,n=0)=>{const r={};for(;n<=e;n=2*n||1)r[n]=n+t;return r},Oh=(e,t="",n=1,r=0,i=1,o={})=>{for(;r<=e;r+=i)o[r]=r/n+t;return o},Ih=e=>t=>t(e),kh={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},colors:{transparent:"transparent",current:"currentColor",black:"#000",white:"#fff",gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},yellow:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},green:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},purple:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"}},spacing:{px:"1px",0:"0px",...Oh(4,"rem",4,.5,.5),...Oh(12,"rem",4,5),14:"3.5rem",...Oh(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},backdropBlur:Ih("blur"),backdropBrightness:Ih("brightness"),backdropContrast:Ih("contrast"),backdropGrayscale:Ih("grayscale"),backdropHueRotate:Ih("hueRotate"),backdropInvert:Ih("invert"),backdropOpacity:Ih("opacity"),backdropSaturate:Ih("saturate"),backdropSepia:Ih("sepia"),backgroundColor:Ih("colors"),backgroundImage:{none:"none"},backgroundOpacity:Ih("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...Oh(200,"",100,0,50),...Oh(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:e=>({...e("colors"),DEFAULT:e("colors.gray.200","currentColor")}),borderOpacity:Ih("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderWidth:{DEFAULT:"1px",...Ah(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none"},contrast:{...Oh(200,"",100,0,50),75:"0.75",125:"1.25"},divideColor:Ih("borderColor"),divideOpacity:Ih("borderOpacity"),divideWidth:Ih("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:{current:"currentColor"},grayscale:{0:"0",DEFAULT:"100%"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{0:"0",DEFAULT:"100%"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gridTemplateColumns:{},gridTemplateRows:{},gridAutoColumns:{min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gap:Ih("spacing"),gradientColorStops:Ih("colors"),height:e=>({auto:"auto",...e("spacing"),...Th(2,6),full:"100%",screen:"100vh"}),inset:e=>({auto:"auto",...e("spacing"),...Th(2,4),full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",...Oh(10,"rem",4,3)},margin:e=>({auto:"auto",...e("spacing")}),maxHeight:e=>({...e("spacing"),full:"100%",screen:"100vh"}),maxWidth:(e,{breakpoints:t})=>({none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",prose:"65ch",...t(e("screens"))}),minHeight:{0:"0px",full:"100%",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content"},opacity:{...Oh(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0",...Oh(12,"",1,1)},outline:{none:["2px solid transparent","2px"],white:["2px dotted white","2px"],black:["2px dotted black","2px"]},padding:Ih("spacing"),placeholderColor:Ih("colors"),placeholderOpacity:Ih("opacity"),ringColor:e=>({DEFAULT:e("colors.blue.500","#3b82f6"),...e("colors")}),ringOffsetColor:Ih("colors"),ringOffsetWidth:Ah(8,"px"),ringOpacity:e=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",...Ah(8,"px")},rotate:{...Ah(2,"deg"),...Ah(12,"deg",3),...Ah(180,"deg",45)},saturate:Oh(200,"",100,0,50),scale:{...Oh(150,"",100,0,50),...Oh(110,"",100,90,5),75:"0.75",125:"1.25"},sepia:{0:"0",DEFAULT:"100%"},skew:{...Ah(2,"deg"),...Ah(12,"deg",3)},space:Ih("spacing"),stroke:{current:"currentColor"},strokeWidth:Oh(2),textColor:Ih("colors"),textOpacity:Ih("opacity"),transitionDuration:e=>({DEFAULT:"150ms",...e("durations")}),transitionDelay:Ih("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"background-color,border-color,color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:e=>({...e("spacing"),...Th(2,4),full:"100%"}),width:e=>({auto:"auto",...e("spacing"),...Th(2,6),...Th(12,12),screen:"100vw",full:"100%",min:"min-content",max:"max-content"}),zIndex:{auto:"auto",...Oh(50,"",1,0,10)}},jh=(e,t={},n=[])=>(Object.keys(e).forEach(r=>{const i=e[r];"DEFAULT"==r&&(t[sf(n)]=i,t[sf(n,".")]=i);const o=[...n,r];t[sf(o)]=i,t[sf(o,".")]=i,i&&"object"==typeof i&&jh(i,t,o)},t),t),Rh={negative:()=>({}),breakpoints:e=>Object.keys(e).filter(t=>"string"==typeof e[t]).reduce((t,n)=>(t["screen-"+n]=e[n],t),{})},Ph=e=>{const t=new Map,n={...kh,...e},r=(e,t)=>{const n=e&&e[t],r="function"==typeof n?n(i,Rh):n;return r&&"colors"==t?jh(r):r},i=(e,i,o)=>{const a=e.split(".");e=a[0],a.length>1&&(o=i,i=sf(lf(a),"."));let s=t.get(e);if(s||(t.set(e,s={...r(n,e)}),Object.assign(s,r(n.extend,e))),null!=i){const t=((e,t)=>(t="["==t[0]&&"]"==t.slice(-1)&&t.slice(1,-1))&&af(e,"olor")==/^(#|(hsl|rgb)a?\(|[a-z]+$)/.test(t)&&(af(t,"calc(")?t.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "):t))(e,i=(Array.isArray(i)?sf(i):i)||"DEFAULT")||s[i];return null==t?o:Array.isArray(t)&&!af(["fontSize","outline","dropShadow"],e)?sf(t,","):t}return s};return i},Dh=/^:(group(?:(?!-focus).+?)*)-(.+)$/,Lh=/^(:not)-(.+)/,Mh=e=>"["==e[1]?lf(e):e,Uh=e=>(31&((of=/(?:^|min-width: *)(\d+(?:.\d+)?)(p)?/.exec(e))?+of[1]/(of[2]?15:1)/10:0))<<22,Fh=e=>{of=0;for(let t=e.length;t--;)of+=af("-:,",e[t]);return of},Bh=e=>(15&Fh(e))<<18,qh=["rst","st","en","d","nk","sited","pty","ecked","cus-w","ver","cus","cus-v","tive","sable","ad-on","tiona","quire"],zh=(e,t)=>(n,r)=>{return n|((of=e("screens",lf(r),""))?1<<27|Uh(yf(of)):":dark"==r?1<<30:"@"==(of=t[r]||r.replace(Lh,":$2"))[0]?Bh(of):(i=r,1<<(~(of=qh.indexOf(i.replace(Dh,":$2").slice(3,8)))?of:17)));var i},Hh=(e,t)=>t+"{"+e+"}",Wh=(e,t,n)=>{const{theme:r,tag:i}=n,o=(e,t)=>"--"+i(t),a=e=>`${e}`.replace(/--(tw-[\w-]+)\b/g,o);let s;const d=(t,r,i,o,l)=>{if(Array.isArray(o))return void o.forEach(e=>e&&d(t,r,i,e,l));let u="",c=0,f=0;o["@apply"]&&(o=$f(pf(((...e)=>Rf(Pf,e))(o["@apply"]),n),{...o,"@apply":void 0},n)),Object.keys(o).forEach(h=>{const p=pf(o[h],n);if(gf(h,p)){if(""!==p&&h.length>1){const t=hf(h);f+=1,c=Math.max(c,(e=>"-"==e[0]?0:Fh(e)+((of=/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7}$)|([fl].{5}l|g.{8}$|pl))/.exec(e))?+!!of[1]||-!!of[2]:0)+1)(t)),u=(u&&u+";")+((t,n,r)=>(t=a(t),Array.isArray(n)?sf(n.filter(Boolean).map(n=>e(t,a(n),r)),";"):e(t,a(n),r)))(t,p,l)}}else if(p)if(":global"==h&&(h="@global"),"@"==h[0])if("g"==h[1])d([],"",0,p,l);else if("f"==h[1])d([],h,0,p,l);else if("k"==h[1]){const e=s.length;d([],"",0,p,l);const t=s.splice(e,s.length-e);s.push({r:Hh(sf(t.map(e=>e.r),""),h),p:t.reduce((e,t)=>e+t.p,0)})}else"i"==h[1]?(Array.isArray(p)?p:[p]).forEach(e=>e&&s.push({p:0,r:`${h} ${e};`})):("c"==h[2]&&(h=yf(n.theme("screens",lf(h,8).trim()))),d([...t,h],r,i|Uh(h)|Bh(h),p,l));else d(t,r?r.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(e,t,n)=>h.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(e,n,r)=>(af(n,"&")?n.replace(/&/g,t):(t&&t+" ")+n)+r)+n):h,i,p,l)}),f&&s.push({r:t.reduceRight(Hh,Hh(u,r)),p:256*i+((15&Math.max(0,15-f))<<4|15&(c||15))})},l=zh(r,t);return(e,t,n,r=0)=>(r<<=28,s=[],d([],t?"."+vf(t):"",n?n.v.reduceRight(l,r):r,e,n&&n.i),s)},Gh=(e,t,n,r=t)=>!1===e?n:!0===e?r:e||t,Vh={_:{value:"",writable:!0}},Kh=(e={})=>{const t=Ph(e.theme),n=(e=>("string"==typeof e?{t:Ch,a:_h,i:Sh}[e[1]]:e)||_h)(e.mode),r=Gh(e.hash,!1,!1,bf),i=e.important;let o={v:[]},a=0;const s=[],d={tw:(...e)=>b(e),theme:(e,r,i)=>{var a;const s=null!=(a=t(e,r,i))?a:n.unknown(e,null==r||Array.isArray(r)?r:r.split("."),null!=i,d);return o.n&&s&&af("rg",(typeof s)[5])?`calc(${s} * -1)`:s},tag:e=>r?r(e):e,css:e=>{a++;const t=s.length;try{("string"==typeof e?If([e]):e).forEach(y);const n=Object.create(null,Vh);for(let e=t;e<s.length;e++){const t=s[e];if(t)switch(typeof t){case"object":$f(n,t,d);break;case"string":n._+=(n._&&" ")+t}}return n}finally{s.length=t,a--}}},l=((e,t)=>(n,r)=>{if("function"==typeof n.d)return n.d(t);const i=n.d.split(/-(?![^[]*])/g);if(!r&&"tw"==i[0]&&n.$==n.d)return n.$;for(let o=i.length;o;o--){const n=sf(i.slice(0,o));if(Object.prototype.hasOwnProperty.call(e,n)){const a=e[n];return"function"==typeof a?a(lf(i,o),t,n):"string"==typeof a?t[r?"css":"tw"](a):a}}})({...vh,...e.plugins},d),u={...yh,...e.variants},c=((e,t,{theme:n,tag:r})=>{const i=(i,o)=>(rf=n("screens",lf(o),""))?{[yf(rf)]:i}:":dark"==o&&"class"==e?{".dark &":i}:(rf=Dh.exec(o))?{[`.${vf(r(rf[1]))}:${rf[2]} &`]:i}:{[t[lf(o)]||"&"+o.replace(Lh,(e,t,n)=>t+"("+Mh(":"+n)+")")]:i};return(e,t)=>t.v.reduceRight(i,e)})(e.darkMode||"media",u,d),f=Wh(Gh(e.prefix,Nh,Eh),u,d),h=e.sheet||("undefined"==typeof window?{target:null,insert:cf}:(({nonce:e,target:t=xh(e).sheet}={})=>{const n=t.cssRules.length;return{target:t,insert:(e,r)=>t.insertRule(e,n+r)}})(e)),{init:p=e=>e()}=h,m=((e,t,n,r)=>{let i,o;return n((e=[])=>i=e),n((e=new Set)=>o=e),({r:n,p:a})=>{if(!o.has(n)){o.add(n);const d=((e,t)=>{for(var n=0,r=e.length;n<r;){const i=r+n>>1;e[i]<=t?n=i+1:r=i}return r})(i,a);try{e.insert(n,d),i.splice(d,0,a)}catch(s){/:-[mwo]/.test(n)||t.report({id:"INJECT_CSS_ERROR",css:n,error:s},r)}}}})(h,n,p,d);let g;p((e=new Map)=>g=e);const $=new WeakMap,v=(e,t)=>"_"==e?void 0:"function"==typeof t?JSON.stringify(pf(t,d),v):t,y=e=>{!a&&o.v.length&&(e={...e,v:[...o.v,...e.v],$:""}),e.$||(e.$=Bf(e,$.get(e.d)));let t=a?null:g.get(e.$);if(null==t){let u=(e=>{const t=o;o=e;try{return pf(l(e),d)}finally{o=t}})(e);if(e.$||(e.$=bf(JSON.stringify(u,v)),$.set(e.d,e.$),e.$=Bf(e,e.$)),u&&"object"==typeof u)if(e.v=e.v.map(Mh),i&&(e.i=i),u=c(u,e),a)s.push(u);else{const n="function"==typeof e.d?"string"==typeof u._?1:3:2;t=r||"function"==typeof e.d?(r||bf)(n+e.$):e.$,f(u,t,e,n).forEach(m),u._&&(t+=" "+u._)}else"string"==typeof u?t=u:(t=e.$,n.report({id:"UNKNOWN_DIRECTIVE",rule:t},d)),a&&"function"!=typeof e.d&&s.push(t);a||(g.set(e.$,t),mf(g,3e4))}return t},b=e=>sf(If(e).map(y).filter(Boolean)," "),x=Gh(e.preflight,uf,!1);if(x){const e=(e=>({":root":{tabSize:4},"body,blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre,fieldset,ol,ul":{margin:"0"},button:{backgroundColor:"transparent",backgroundImage:"none"},'button,[type="button"],[type="reset"],[type="submit"]':{WebkitAppearance:"button"},"button:focus":{outline:["1px dotted","5px auto -webkit-focus-ring-color"]},"fieldset,ol,ul,legend":{padding:"0"},"ol,ul":{listStyle:"none"},html:{lineHeight:"1.5",WebkitTextSizeAdjust:"100%",fontFamily:e("fontFamily.sans","ui-sans-serif,system-ui,sans-serif")},body:{fontFamily:"inherit",lineHeight:"inherit"},"*,::before,::after":{boxSizing:"border-box",border:`0 solid ${e("borderColor.DEFAULT","currentColor")}`},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},img:{borderStyle:"solid"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:"1",color:e("placeholderColor.DEFAULT",e("colors.gray.400","#a1a1aa"))},'button,[role="button"]':{cursor:"pointer"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",margin:"0",padding:"0",lineHeight:"inherit",color:"inherit"},"button,select":{textTransform:"none"},"::-moz-focus-inner":{borderStyle:"none",padding:"0"},":-moz-focusring":{outline:"1px dotted ButtonText"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},'[type="search"]':{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"abbr[title]":{textDecoration:"underline dotted"},"b,strong":{fontWeight:"bolder"},"pre,code,kbd,samp":{fontFamily:e("fontFamily","mono","ui-monospace,monospace"),fontSize:"1em"},"sub,sup":{fontSize:"75%",lineHeight:"0",position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"}}))(t),n=f("function"==typeof x?pf(x(e,d),d)||e:{...e,...x});p((e=(n.forEach(m),!0))=>e)}return{init:()=>n.report({id:"LATE_SETUP_CALL"},d),process:b}},Yh=e=>{let t,n=e=>(r(),n(e)),r=e=>{({process:n,init:r}=Kh(e))};return{tw:Object.defineProperties((...e)=>n(e),{theme:{get:(i="theme",()=>(t||n([e=>(t=e,"")]),t[i]))}}),setup:e=>r(e)};var i},{tw:Xh,setup:Jh}=Yh();let Zh={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...tp(4,"rem",4,.5,.5),...tp(12,"rem",4,5),14:"3.5rem",...tp(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:np("blur"),backdropBrightness:np("brightness"),backdropContrast:np("contrast"),backdropGrayscale:np("grayscale"),backdropHueRotate:np("hueRotate"),backdropInvert:np("invert"),backdropOpacity:np("opacity"),backdropSaturate:np("saturate"),backdropSepia:np("sepia"),backgroundColor:np("colors"),backgroundImage:{none:"none"},backgroundOpacity:np("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...tp(200,"",100,0,50),...tp(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:e})=>({DEFAULT:e("colors.gray.200","currentColor"),...e("colors")}),borderOpacity:np("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:np("spacing"),borderWidth:{DEFAULT:"1px",...ep(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:np("colors"),caretColor:np("colors"),accentColor:({theme:e})=>({auto:"auto",...e("colors")}),contrast:{...tp(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:np("borderColor"),divideOpacity:np("borderOpacity"),divideWidth:np("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:e})=>({...e("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({...e("spacing"),...Qh(2,6),...Qh(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:np("spacing"),gradientColorStops:np("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:e})=>({...e("spacing"),...Qh(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:e})=>({...e("spacing"),...Qh(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...tp(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),maxHeight:({theme:e})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...e("spacing")}),maxWidth:({theme:e,breakpoints:t})=>({...t(e("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...tp(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:np("spacing"),placeholderColor:np("colors"),placeholderOpacity:np("opacity"),outlineColor:np("colors"),outlineOffset:ep(8,"px"),outlineWidth:ep(8,"px"),ringColor:({theme:e})=>({...e("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:np("colors"),ringOffsetWidth:ep(8,"px"),ringOpacity:({theme:e})=>({...e("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...ep(8,"px")},rotate:{...ep(2,"deg"),...ep(12,"deg",3),...ep(180,"deg",45)},saturate:tp(200,"",100,0,50),scale:{...tp(150,"",100,0,50),...tp(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:np("spacing"),scrollPadding:np("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...ep(2,"deg"),...ep(12,"deg",3)},space:np("spacing"),stroke:({theme:e})=>({...e("colors"),none:"none"}),strokeWidth:tp(2),textColor:np("colors"),textDecorationColor:np("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...ep(8,"px")},textUnderlineOffset:{auto:"auto",...ep(8,"px")},textIndent:np("spacing"),textOpacity:np("opacity"),transitionDuration:({theme:e})=>({...e("durations"),DEFAULT:"150ms"}),transitionDelay:np("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:e})=>({...e("spacing"),...Qh(2,4),full:"100%"}),width:({theme:e})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...e("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...tp(50,"",1,0,10),auto:"auto"}};function Qh(e,t){let n={};do{for(var r=1;r<e;r++)n[`${r}/${e}`]=Number((r/e*100).toFixed(6))+"%"}while(++e<=t);return n}function ep(e,t,n=0){let r={};for(;n<=e;n=2*n||1)r[n]=n+t;return r}function tp(e,t="",n=1,r=0,i=1,o={}){for(;r<=e;r+=i)o[r]=r/n+t;return o}function np(e){return({theme:t})=>t(e)}let rp={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${Zh.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${Zh.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};function ip(e,t="@media "){return t+op(e).map(e=>("string"==typeof e&&(e={min:e}),e.raw||Object.keys(e).map(t=>`(${t}-width:${e[t]})`).join(" and "))).join(",")}function op(e=[]){return Array.isArray(e)?e:null==e?[]:[e]}function ap(e,t){return Math.round(parseInt(e,16)*t)}function sp(e,t={}){if("function"==typeof e)return e(t);let{opacityValue:n="1",opacityVariable:r}=t,i=r?`var(${r})`:n;if(e.includes("<alpha-value>"))return e.replace("<alpha-value>",i);if("#"==e[0]&&(4==e.length||7==e.length)){let t=(e.length-1)/3,n=[17,1,.062272][t-1];return`rgba(${[ap(e.substr(1,t),n),ap(e.substr(1+t,t),n),ap(e.substr(1+2*t,t),n),i]})`}return"1"==i?e:"0"==i?"#0000":e.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${i})`)}function dp(e,t,n){return[e,lp(t,n)]}function lp(e,t){return"function"==typeof e?e:"string"==typeof e&&/^[\w-]+$/.test(e)?(n,r)=>({[e]:t?t(n,r):up(n,1)}):t=>e||{[t[1]]:up(t,2)}}function up(e,t,n=e.slice(t).find(Boolean)||e.$$||e.input){return"-"==e.input[0]?`calc(${n} * -1)`:n}function cp(e,t,n,r){return[e,fp(t,n,r)]}function fp(e,t,n){let r="string"==typeof t?(e,r)=>({[t]:n?n(e,r):e._}):t||(({1:e,_:t},n,r)=>({[e||r]:t}));return(t,n)=>{let i=$p(e||t[1]),o=n.theme(i,t.$$)??gp(t.$$,i,n);if(null!=o)return t._=up(t,0,o),r(t,n,i)}}function hp(e,t={},n){return[e,pp(t,n)]}function pp(e={},t){return(n,r)=>{let{section:i=$p(n[0]).replace("-","")+"Color"}=e,[o,a]=(n.$$.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1);if(!o)return;let s=r.theme(i,o)||gp(o,i,r);if(!s||"object"==typeof s)return;let{opacityVariable:d=`--tw-${n[0].replace(/-$/,"")}-opacity`,opacitySection:l=i.replace("Color","Opacity"),property:u=i,selector:c}=e,f=r.theme(l,a||"DEFAULT")||a&&gp(a,l,r),h=t||(({_:e})=>{let t=mp(u,e);return c?{[c]:t}:t});n._={value:sp(s,{opacityVariable:d||void 0,opacityValue:f||void 0}),color:e=>sp(s,e),opacityVariable:d||void 0,opacityValue:f||void 0};let p=h(n,r);if(!n.dark){let e=r.d(i,o,s);e&&e!==s&&(n._={value:sp(e,{opacityVariable:d||void 0,opacityValue:f||"1"}),color:t=>sp(e,t),opacityVariable:d||void 0,opacityValue:f||void 0},p={"&":p,[r.v("dark")]:h(n,r)})}return p}}function mp(e,t){let n={};return"string"==typeof t?n[e]=t:(t.opacityVariable&&t.value.includes(t.opacityVariable)&&(n[t.opacityVariable]=t.opacityValue||"1"),n[e]=t.value),n}function gp(e,t,n){if("["==e[0]&&"]"==e.slice(-1)){if(e=vp(function(e,t){return e.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(e,n,r,i,o="")=>{let a=t(r,o);return"function"==typeof a&&/color|fill|stroke/i.test(r)?sp(a):""+op(a).filter(e=>Object(e)!==e)})}(e.slice(1,-1),n.theme)),!t)return e;if(!(/color|fill|stroke/i.test(t)&&!/^color:/.test(e)&&!/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(e)||/image/i.test(t)&&!/^image:/.test(e)&&!/^[a-z-]+\(/.test(e)||/weight/i.test(t)&&!/^(number|any):/.test(e)&&!/^\d+$/.test(e)||/position/i.test(t)&&/^(length|size):/.test(e)))return e.replace(/^[a-z-]+:/,"")}}function $p(e){return e.replace(/-./g,e=>e[1].toUpperCase())}function vp(e){return e.includes("url(")?e.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",n,r="")=>vp(t)+n+vp(r)):e.replace(/(^|[^\\])_+/g,(e,t)=>t+" ".repeat(e.length-t.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}let yp=[dp("\\[([-\\w]+):(.+)]",({1:e,2:t},n)=>({"@layer overrides":{"&":{[e]:gp(`[${t}]`,"",n)}}})),dp("(group|peer)([~/][^-[]+)?",({input:e},{h:t})=>[{c:t(e)}]),cp("aspect-","aspectRatio"),dp("container",(e,{theme:t})=>{let{screens:n=t("screens"),center:r,padding:i}=t("container"),o={width:"100%",marginRight:r&&"auto",marginLeft:r&&"auto",...a("xs")};for(let s in n){let e=n[s];"string"==typeof e&&(o[ip(e)]={"&":{maxWidth:e,...a(s)}})}return o;function a(e){let t=i&&("string"==typeof i?i:i[e]||i.DEFAULT);if(t)return{paddingRight:t,paddingLeft:t}}}),cp("content-","content",({_:e})=>({"--tw-content":e,content:"var(--tw-content)"})),dp("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),dp("box-(border|content)","boxSizing",({1:e})=>e+"-box"),dp("hidden",{display:"none"}),dp("table-(auto|fixed)","tableLayout"),dp(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",dp("isolate","isolation"),dp("object-(contain|cover|fill|none|scale-down)","objectFit"),cp("object-","objectPosition"),dp("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",bp),dp("overscroll(-[xy])?-(auto|contain|none)",({1:e="",2:t})=>({["overscroll-behavior"+e]:t})),dp("(static|fixed|absolute|relative|sticky)","position"),cp("-?inset(-[xy])?(?:$|-)","inset",({1:e,_:t})=>({top:"-x"!=e&&t,right:"-y"!=e&&t,bottom:"-x"!=e&&t,left:"-y"!=e&&t})),cp("-?(top|bottom|left|right)(?:$|-)","inset"),dp("(visible|collapse)","visibility"),dp("invisible",{visibility:"hidden"}),cp("-?z-","zIndex"),dp("flex-((row|col)(-reverse)?)","flexDirection",xp),dp("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),cp("(flex-(?:grow|shrink))(?:$|-)"),cp("(flex)-"),cp("grow(?:$|-)","flexGrow"),cp("shrink(?:$|-)","flexShrink"),cp("basis-","flexBasis"),cp("-?(order)-"),"-?(order)-(\\d+)",cp("grid-cols-","gridTemplateColumns"),dp("grid-cols-(\\d+)","gridTemplateColumns",Ip),cp("col-","gridColumn"),dp("col-(span)-(\\d+)","gridColumn",Op),cp("col-start-","gridColumnStart"),dp("col-start-(auto|\\d+)","gridColumnStart"),cp("col-end-","gridColumnEnd"),dp("col-end-(auto|\\d+)","gridColumnEnd"),cp("grid-rows-","gridTemplateRows"),dp("grid-rows-(\\d+)","gridTemplateRows",Ip),cp("row-","gridRow"),dp("row-(span)-(\\d+)","gridRow",Op),cp("row-start-","gridRowStart"),dp("row-start-(auto|\\d+)","gridRowStart"),cp("row-end-","gridRowEnd"),dp("row-end-(auto|\\d+)","gridRowEnd"),dp("grid-flow-((row|col)(-dense)?)","gridAutoFlow",e=>bp(xp(e))),dp("grid-flow-(dense)","gridAutoFlow"),cp("auto-cols-","gridAutoColumns"),cp("auto-rows-","gridAutoRows"),cp("gap-x(?:$|-)","gap","columnGap"),cp("gap-y(?:$|-)","gap","rowGap"),cp("gap(?:$|-)","gap"),"(justify-(?:items|self))-",dp("justify-","justifyContent",Cp),dp("(content|items|self)-",e=>({["align-"+e[1]]:Cp(e)})),dp("(place-(content|items|self))-",({1:e,$$:t})=>({[e]:("wun".includes(t[3])?"space-":"")+t})),cp("p([xytrbl])?(?:$|-)","padding",Sp("padding")),cp("-?m([xytrbl])?(?:$|-)","margin",Sp("margin")),cp("-?space-(x|y)(?:$|-)","space",({1:e,_:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${e}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[e]]:`calc(${t} * calc(1 - var(--tw-space-${e}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[e]]:`calc(${t} * var(--tw-space-${e}-reverse))`}})),dp("space-(x|y)-reverse",({1:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${e}-reverse`]:"1"}})),cp("w-","width"),cp("min-w-","minWidth"),cp("max-w-","maxWidth"),cp("h-","height"),cp("min-h-","minHeight"),cp("max-h-","maxHeight"),cp("font-","fontWeight"),cp("font-","fontFamily",({_:e})=>"string"==typeof(e=op(e))[1]?{fontFamily:_p(e)}:{fontFamily:_p(e[0]),...e[1]}),dp("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),dp("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),dp("italic","fontStyle"),dp("not-italic",{fontStyle:"normal"}),dp("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:e,2:t="",3:n})=>"normal"==t?{fontVariantNumeric:"normal"}:{["--tw-"+(n?"numeric-fraction":"pt".includes(t[0])?"numeric-spacing":t?"numeric-figure":e)]:e,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...kp({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),cp("tracking-","letterSpacing"),cp("leading-","lineHeight"),dp("list-(inside|outside)","listStylePosition"),cp("list-","listStyleType"),dp("list-","listStyleType"),cp("placeholder-opacity-","placeholderOpacity",({_:e})=>({"&::placeholder":{"--tw-placeholder-opacity":e}})),hp("placeholder-",{property:"color",selector:"&::placeholder"}),dp("text-(left|center|right|justify|start|end)","textAlign"),dp("text-(ellipsis|clip)","textOverflow"),cp("text-opacity-","textOpacity","--tw-text-opacity"),hp("text-",{property:"color"}),cp("text-","fontSize",({_:e})=>"string"==typeof e?{fontSize:e}:{fontSize:e[0],..."string"==typeof e[1]?{lineHeight:e[1]}:e[1]}),cp("indent-","textIndent"),dp("(overline|underline|line-through)","textDecorationLine"),dp("no-underline",{textDecorationLine:"none"}),cp("underline-offset-","textUnderlineOffset"),hp("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),cp("decoration-","textDecorationThickness"),dp("decoration-","textDecorationStyle"),dp("(uppercase|lowercase|capitalize)","textTransform"),dp("normal-case",{textTransform:"none"}),dp("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),dp("align-","verticalAlign"),dp("whitespace-","whiteSpace"),dp("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),dp("break-words",{overflowWrap:"break-word"}),dp("break-all",{wordBreak:"break-all"}),dp("break-keep",{wordBreak:"keep-all"}),hp("caret-",{opacityVariable:!1,opacitySection:"opacity"}),hp("accent-",{opacityVariable:!1,opacitySection:"opacity"}),dp("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:e})=>`linear-gradient(to ${wp(e," ")},var(--tw-gradient-stops))`),hp("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:e})=>({"--tw-gradient-from":e.value,"--tw-gradient-to":e.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),hp("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:e})=>({"--tw-gradient-to":e.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${e.value},var(--tw-gradient-to)`})),hp("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),dp("bg-(fixed|local|scroll)","backgroundAttachment"),dp("bg-origin-(border|padding|content)","backgroundOrigin",({1:e})=>e+"-box"),dp(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),dp("bg-blend-","backgroundBlendMode"),dp("bg-clip-(border|padding|content|text)","backgroundClip",({1:e})=>e+("text"==e?"":"-box")),cp("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),hp("bg-",{section:"backgroundColor"}),cp("bg-","backgroundImage"),cp("bg-","backgroundPosition"),dp("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",bp),cp("bg-","backgroundSize"),cp("rounded(?:$|-)","borderRadius"),cp("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:e,_:t})=>{let n={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[e]||[e,e];return{[`border-${wp(n[0])}-radius`]:t,[`border-${wp(n[1])}-radius`]:t}}),dp("border-(collapse|separate)","borderCollapse"),cp("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),dp("border-(solid|dashed|dotted|double|none)","borderStyle"),cp("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:e,_:t})=>({...kp({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(e||"-x")]:t,["--tw-border-spacing"+(e||"-y")]:t,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),hp("border-([xytrbl])-",{section:"borderColor"},Sp("border","Color")),hp("border-"),cp("border-([xytrbl])(?:$|-)","borderWidth",Sp("border","Width")),cp("border(?:$|-)","borderWidth"),cp("divide-opacity(?:$|-)","divideOpacity",({_:e})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":e}})),dp("divide-(solid|dashed|dotted|double|none)",({1:e})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:e}})),dp("divide-([xy]-reverse)",({1:e})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+e]:"1"}})),cp("divide-([xy])(?:$|-)","divideWidth",({1:e,_:t})=>{let n={x:"lr",y:"tb"}[e];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${e}-reverse`]:"0",[`border-${wp(n[0])}Width`]:`calc(${t} * calc(1 - var(--tw-divide-${e}-reverse)))`,[`border-${wp(n[1])}Width`]:`calc(${t} * var(--tw-divide-${e}-reverse))`}}}),hp("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),cp("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),hp("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),cp("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),dp("ring-inset",{"--tw-ring-inset":"inset"}),hp("ring-",{property:"--tw-ring-color"}),cp("ring(?:$|-)","ringWidth",({_:e},{theme:t})=>({...kp({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":t("ringOffsetWidth","","0px"),"--tw-ring-offset-color":sp(t("ringOffsetColor","","#fff")),"--tw-ring-color":sp(t("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":t("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${e} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),hp("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:e})=>({"--tw-shadow-color":e.value,"--tw-shadow":"var(--tw-shadow-colored)"})),cp("shadow(?:$|-)","boxShadow",({_:e})=>({...kp({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":_p(e),"--tw-shadow-colored":_p(e).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),cp("(opacity)-"),dp("mix-blend-","mixBlendMode"),...Ep(),...Ep("backdrop-"),cp("transition(?:$|-)","transitionProperty",(e,{theme:t})=>({transitionProperty:_p(e),transitionTimingFunction:"none"==e._?void 0:_p(t("transitionTimingFunction","")),transitionDuration:"none"==e._?void 0:_p(t("transitionDuration",""))})),cp("duration(?:$|-)","transitionDuration","transitionDuration",_p),cp("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",_p),cp("delay(?:$|-)","transitionDelay","transitionDelay",_p),cp("animate(?:$|-)","animation",(e,{theme:t,h:n,e:r})=>{let i=_p(e),o=i.split(" "),a=t("keyframes",o[0]);return a?{["@keyframes "+(o[0]=r(n(o[0])))]:a,animation:o.join(" ")}:{animation:i}}),"(transform)-(none)",dp("transform",Tp),dp("transform-(cpu|gpu)",({1:e})=>({"--tw-transform":Ap("gpu"==e)})),cp("scale(-[xy])?-","scale",({1:e,_:t})=>({["--tw-scale"+(e||"-x")]:t,["--tw-scale"+(e||"-y")]:t,...Tp()})),cp("-?(rotate)-","rotate",Np),cp("-?(translate-[xy])-","translate",Np),cp("-?(skew-[xy])-","skew",Np),dp("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",bp),"(appearance)-",cp("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",cp("(cursor)-"),"(cursor)-",dp("snap-(none)","scroll-snap-type"),dp("snap-(x|y|both)",({1:e})=>({...kp({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":e+" var(--tw-scroll-snap-strictness)"})),dp("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),dp("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),dp("snap-(normal|always)","scroll-snap-stop"),dp("scroll-(auto|smooth)","scroll-behavior"),cp("scroll-p([xytrbl])?(?:$|-)","padding",Sp("scroll-padding")),cp("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",Sp("scroll-margin")),dp("touch-(auto|none|manipulation)","touch-action"),dp("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:e,2:t,3:n})=>({...kp({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${t?"pan-x":n?"pan-y":e}`]:e,"touch-action":"var(--tw-touch-action)"})),dp("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),dp("outline",{outlineStyle:"solid"}),dp("outline-(dashed|dotted|double)","outlineStyle"),cp("-?(outline-offset)-"),hp("outline-",{opacityVariable:!1,opacitySection:"opacity"}),cp("outline-","outlineWidth"),"(pointer-events)-",cp("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:e})=>({x:"horizontal",y:"vertical"}[e]||e||"both")],dp("select-(none|text|all|auto)","userSelect"),hp("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),hp("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),cp("stroke-","strokeWidth"),dp("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),dp("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function bp(e){return("string"==typeof e?e:e[1]).replace(/-/g," ").trim()}function xp(e){return("string"==typeof e?e:e[1]).replace("col","column")}function wp(e,t="-"){let n=[];for(let r of e)n.push({t:"top",r:"right",b:"bottom",l:"left"}[r]);return n.join(t)}function _p(e){return e&&""+(e._||e)}function Cp({$$:e}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[e[3]||""]||"")+e}function Sp(e,t=""){return({1:n,_:r})=>{let i={x:"lr",y:"tb"}[n]||n+n;return i?{...mp(e+"-"+wp(i[0])+t,r),...mp(e+"-"+wp(i[1])+t,r)}:mp(e+t,r)}}function Ep(e=""){let t=["blur","brightness","contrast","grayscale","hue-rotate","invert",e&&"opacity","saturate","sepia",!e&&"drop-shadow"].filter(Boolean),n={};for(let r of t)n[`--tw-${e}${r}`]="var(--tw-empty,/*!*/ /*!*/)";return n={...kp(n),[`${e}filter`]:t.map(t=>`var(--tw-${e}${t})`).join(" ")},[`(${e}filter)-(none)`,dp(`${e}filter`,n),...t.map(t=>cp(`${"h"==t[0]?"-?":""}(${e}${t})(?:$|-)`,t,({1:e,_:r})=>({[`--tw-${e}`]:op(r).map(e=>`${t}(${e})`).join(" "),...n})))]}function Np({1:e,_:t}){return{["--tw-"+e]:t,...Tp()}}function Tp(){return{...kp({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":Ap()}),transform:"var(--tw-transform)"}}function Ap(e){return[e?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function Op({1:e,2:t}){return`${e} ${t} / ${e} ${t}`}function Ip({1:e}){return`repeat(${e},minmax(0,1fr))`}function kp(e){return{"@layer defaults":{"*,::before,::after":e,"::backdrop":e}}}let jp=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:e})=>`@media (orientation:${e})`],["contrast-(more|less)",({1:e})=>`@media (prefers-contrast:${e})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:e})=>`&::${e}`],["(marker|selection)",({1:e})=>`& *::${e},&::${e}`],["file","&::file-selector-button"],["(first|last|only)",({1:e})=>`&:${e}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:e,$$:t},n)=>t&&`&[${e}-${n.theme(e,t)||gp(t,"",n)||`${t}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:e,3:t="",4:n,5:r="",6:i=t},{e:o,h:a,v:s})=>{let d=vp(r)||("["==n[0]?n:s(n.slice(1)));return`${(d.includes("&")?d:"&"+d).replace(/&/g,`:merge(.${o(a(e+i))})`)}${"p"==e[0]?"~":" "}&`}],["(ltr|rtl)",({1:e})=>`[dir="${e}"] &`],["supports-",({$$:e},t)=>{if(e&&(e=t.theme("supports",e)||gp(e,"",t)),e)return e.includes(":")||(e+=":var(--tw)"),/^\w*\s*\(/.test(e)||(e=`(${e})`),`@supports ${e.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:e},t)=>{if(e&&(e=t.theme("screens",e)||gp(e,"",t)),"string"==typeof e)return`@media not all and (min-width:${e})`}],["min-",({$$:e},t)=>(e&&(e=gp(e,"",t)),e&&`@media (min-width:${e})`)],[/^\[(.+)]$/,({1:e})=>/[&@]/.test(e)&&vp(e).replace(/[}]+$/,"").split("{")]];let Rp={__proto__:null,slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"}};const Pp=globalThis;if(!Pp.__twindInitialized){Jh({presets:[function({disablePreflight:e}={}){return function({colors:e,disablePreflight:t}={}){return{preflight:t?void 0:rp,theme:{...Zh,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...e}},variants:jp,rules:yp,finalize:e=>e.n&&e.d&&e.r.some(e=>/^&::(before|after)$/.test(e))&&!/(^|;)content:/.test(e.d)?{...e,d:"content:var(--tw-content);"+e.d}:e}}({colors:Rp,disablePreflight:e})}({disablePreflight:!0})],theme:{extend:{colors:{primary:"#1f7aed",primaryDark:"#1557a5",accent:"#1dd1a1"}}}}),Pp.__twindInitialized=!0}const Dp={unsupported:{level:"error",title:"Navegador sem acesso ao microfone",detail:"Este navegador não permite usar o microfone pela página.",action:"Use Chrome, Edge ou Firefox atualizados."},"insecure-context":{level:"error",title:"Página sem HTTPS",detail:"O navegador só libera o microfone em páginas HTTPS (ou localhost).",action:"Abra o discador pelo endereço com https://."},"no-microphone":{level:"error",title:"Sem microfone",detail:"Nenhum microfone foi encontrado neste computador, por isso o discador não consegue conectar nem ligar.",action:"Conecte um fone ou headset e confira se o microfone está habilitado nas configurações de som do Windows; o discador reconhece sozinho quando aparecer."},"mic-permission-denied":{level:"error",title:"Microfone bloqueado pelo navegador",detail:"O navegador não permitiu que o discador use o microfone.",action:"Clique no cadeado ao lado do endereço, permita o microfone e recarregue a página."},"mic-unavailable":{level:"error",title:"Microfone em uso ou com falha",detail:"Outro programa pode estar usando o microfone, ou o dispositivo falhou ao iniciar.",action:"Feche outros aplicativos de áudio (Teams, Meet, gravadores) e tente de novo."},"no-speaker":{level:"warning",title:"Sem saída de som",detail:"Nenhum alto-falante ou fone foi encontrado: você não vai ouvir o cliente.",action:"Conecte um fone e confira o dispositivo de saída nas configurações de som."},"enumerate-failed":{level:"warning",title:"Não foi possível verificar os dispositivos de áudio",detail:"O navegador não listou os dispositivos de áudio.",action:"Confira as permissões da página e recarregue."}};function Lp(e,t){const n=Dp[e];return{...n,detail:t?`${n.detail} (${t})`:n.detail,kind:e,source:"device",code:`device:${e}`}}const Mp=new Set(["NotFoundError","DevicesNotFoundError","OverconstrainedError"]),Up=new Set(["NotAllowedError","PermissionDeniedError","PermissionDismissedError","SecurityError"]),Fp=new Set(["NotReadableError","TrackStartError","AbortError","SourceUnavailableError"]);async function Bp(e={}){const t=void 0===e.mediaDevices?"undefined"!=typeof navigator?navigator.mediaDevices:null:e.mediaDevices,n=e.isSecureContext??("undefined"==typeof window||!1!==window.isSecureContext);if(!t||"function"!=typeof t.getUserMedia)return Lp(n?"unsupported":"insecure-context");try{const e=await t.getUserMedia({audio:!0});for(const t of e.getTracks())t.stop()}catch(i){const e=function(e){const t=(null==e?void 0:e.name)??"";return Mp.has(t)?"no-microphone":Up.has(t)?"mic-permission-denied":(Fp.has(t),"mic-unavailable")}(i),t=null==i?void 0:i.name;return Lp(e,"mic-unavailable"===e&&t?t:void 0)}if("function"!=typeof t.enumerateDevices)return null;let r;try{r=await t.enumerateDevices()}catch{return Lp("enumerate-failed")}if(!r.some(e=>"audioinput"===e.kind))return Lp("no-microphone");return(e.canListOutputs??("undefined"!=typeof HTMLMediaElement&&"setSinkId"in HTMLMediaElement.prototype))&&!r.some(e=>"audiooutput"===e.kind)?Lp("no-speaker"):null}const qp={missingAudioPermissions:{level:"error",title:"Discador sem acesso ao microfone",detail:"O Callix não conseguiu usar o microfone para iniciar o atendimento.",action:"Conecte ou habilite um microfone, permita o uso no navegador e recarregue a página."},maxUsersReached:{level:"error",title:"Limite de usuários do Callix atingido",detail:"O serviço já está com o número máximo de agentes conectados.",action:"Aguarde um colega sair ou fale com o supervisor."},userIsAlreadyConnectedOnAnotherDevice:{level:"error",title:"Usuário já conectado em outro lugar",detail:"Este login está ativo em outro computador, aba ou no Callix web.",action:"Saia de lá (ou feche a outra aba) e entre de novo aqui."},unknownError:{level:"error",title:"O discador não conseguiu iniciar",detail:"O Callix não respondeu como esperado ao iniciar o atendimento.",action:"Recarregue a página; se continuar, confira a internet e avise o suporte."}};function zp(e){const t=e&&e in qp?e:"unknownError";return{...qp[t],source:"startup",code:`startup:${t}`}}const Hp={exclusiveLogin:{level:"error",title:"Você entrou em outro lugar",detail:"Este login foi aberto em outro computador, aba ou no Callix web, e a sessão daqui foi encerrada.",action:"Feche o outro acesso e entre de novo aqui."},supervisor:{level:"error",title:"Sessão encerrada pelo supervisor",detail:"Um supervisor desconectou você do atendimento.",action:"Fale com o supervisor antes de entrar de novo."},userBlocked:{level:"error",title:"Usuário bloqueado",detail:"Seu usuário foi bloqueado no Callix.",action:"Fale com o supervisor ou o administrador."},breakTimeLimit:{level:"warning",title:"Tempo de pausa excedido",detail:"A pausa passou do limite e o Callix encerrou a sessão.",action:"Entre de novo para voltar ao atendimento."},manualCallTimeLimit:{level:"warning",title:"Tempo de chamada manual excedido",detail:"A chamada manual passou do limite configurado e a sessão foi encerrada.",action:"Entre de novo para continuar."},idle:{level:"warning",title:"Sessão encerrada por inatividade",detail:"Ficou muito tempo sem atividade e o Callix desconectou.",action:"Entre de novo para continuar."},user:{level:"warning",title:"Você saiu do atendimento",detail:"A sessão foi encerrada a seu pedido.",action:"Entre de novo quando quiser voltar."}};function Wp(e){const t=e&&e in Hp?e:null;return t?{...Hp[t],source:"session",code:`session:${t}`}:{level:"error",source:"session",code:"session:unknown",title:"Sessão encerrada",detail:`A sessão no Callix foi encerrada${e?` (${e})`:""}.`,action:"Entre de novo para continuar."}}const Gp={1:{title:"Número inválido",detail:"O Callix recusou o número discado.",action:"Confira o DDD e o número."},2:{title:"Usuário não encontrado",detail:"O Callix não reconheceu o usuário para esta chamada.",action:"Saia e entre de novo no discador."},3:{title:"Equipe bloqueada para ligar",detail:"Sua equipe está sem permissão de chamada manual neste momento.",action:"Fale com o supervisor."},4:{title:"Número na black list",detail:"Este número está na lista de bloqueio e não pode ser discado."},5:{title:"Sem rota para este número",detail:"A telefonia não tem rota de saída para este destino.",action:"Confira o número ou fale com o suporte."},6:{title:"Chamada recusada pelo Callix",detail:"O Callix não autorizou esta chamada."},7:{title:"Erro interno do Callix",detail:"O Callix falhou ao iniciar a chamada.",action:"Tente de novo em instantes."},8:{title:"Ligação internacional não autorizada",detail:"Chamadas internacionais estão desligadas para o seu usuário.",action:"Fale com o supervisor."},9:{title:"Saldo de telefonia insuficiente",detail:"A conta de telefonia do Callix está sem saldo.",action:"Avise o administrador."},10:{title:"Caixa postal ou silêncio",detail:"A chamada caiu em caixa postal ou ninguém falou do outro lado."}},Vp={Busy:{title:"Número ocupado",detail:"O destino está em outra ligação.",action:"Tente de novo em alguns minutos."},Unavailable:{title:"Número indisponível",detail:"O destino não atendeu ou está fora de área."},"Not Found":{title:"Número não existe",detail:"A operadora respondeu que este número não existe.",action:"Confira o DDD e o número."},"Address Incomplete":{title:"Número incompleto",detail:"Faltam dígitos no número discado.",action:"Confira o DDD e o número."},"Blocked By Carrier":{title:"Bloqueado pela operadora",detail:"A operadora bloqueou a chamada para este destino."},Rejected:{title:"Chamada recusada",detail:"O destino ou a operadora recusou a chamada."},"SIP Failure Code":{title:"Falha na telefonia",detail:"A operadora devolveu um erro ao completar a chamada.",action:"Tente de novo; se repetir, avise o suporte."},"Bad Media Description":{title:"Falha de áudio na chamada",detail:"A negociação de áudio com a operadora falhou.",action:"Recarregue a página e tente de novo."},"Silence or Machine Detected":{title:"Caixa postal ou silêncio",detail:"A chamada caiu em caixa postal ou ninguém falou do outro lado."}};function Kp(e){const t=null!=(null==e?void 0:e.rejectReason)?Gp[e.rejectReason]:void 0,n=(null==e?void 0:e.cause)?Vp[e.cause]:void 0,r=t??n;if(r)return{level:"warning",source:"call",code:`call:${null!=(null==e?void 0:e.rejectReason)?`reject-${e.rejectReason}`:null==e?void 0:e.cause}`,...r};const i=(null==e?void 0:e.message)||(null==e?void 0:e.cause);return{level:"warning",source:"call",code:"call:unknown",title:"Chamada não concluída",detail:i?`O Callix informou: ${i}.`:"O Callix não informou o motivo.",action:"Tente de novo; se repetir, avise o suporte."}}const Yp="https://callix-zeta.vercel.app";const Xp=function(){if("undefined"==typeof window)return Yp;const e=window.__CALLIX_API_BASE_URL__;return"string"==typeof e&&e.trim()?e.trim().replace(/\/+$/,""):Yp}();function Jp(){const e={"Content-Type":"application/json"},t=function(){if("undefined"==typeof window)return null;try{const e=localStorage.getItem("callix_dialer_last_username");if(e){const t=localStorage.getItem(`callix_dialer_${e}_session_token`);if(t)return t}for(let t=0;t<localStorage.length;t++){const e=localStorage.key(t);if(e&&/^callix_dialer_.*_session_token$/.test(e)){const t=localStorage.getItem(e);if(t)return t}}}catch{}return null}();return t&&(e["x-session-token"]=t,e.Authorization=`Bearer ${t}`),e}const Zp=new Map;function Qp(e){return`${e.source}:${e.id}`}function em(e,t){var n,r;const i=null==e?void 0:e.campaignContact;if(!(null==i?void 0:i.id))return null;const o=i.customer;return(null==o?void 0:o.id)&&(null==o?void 0:o.formId)?{source:"customer",id:o.id,formId:o.formId,campaignId:(null==(n=null==e?void 0:e.campaign)?void 0:n.id)??null,phoneId:t??null}:{source:"campaign",id:i.id,campaignId:(null==(r=null==e?void 0:e.campaign)?void 0:r.id)??null,phoneId:t??null}}async function tm(e,t){const n=new AbortController,r=setTimeout(()=>n.abort(),15e3);try{const r=await fetch(e,{method:"GET",headers:t,credentials:"omit",signal:n.signal});if(!r.ok){const e=await r.json().catch(()=>({})),t=new Error(function(e,t){if(401===e)return"Sessão expirada. Entre novamente no discador.";const n=t.message||t.error;return n||(404===e?"Rota do formulário não encontrada no servidor do discador. Atualize o back-end (deploy) para esta versão do widget.":`Erro ${e}`)}(r.status,e));throw t.status=r.status,t}const i=await r.json();if(!function(e){if(!e||"object"!=typeof e)return!1;const t=e;return"number"==typeof t.id&&!!t.values&&"object"==typeof t.values&&Array.isArray(t.fields)}(i))throw new Error("Resposta inesperada do servidor");return i}catch(i){if(i instanceof Error&&"AbortError"===i.name)throw new Error("Tempo esgotado ao buscar o formulário");if(i instanceof TypeError){const e=new Error("Não foi possível conectar ao servidor do discador. Verifique a conexão ou se o back-end está atualizado.");throw e.cause=i,e}throw i}finally{clearTimeout(r)}}function nm(e){const t=null==e?void 0:e.status;return void 0===t||(t>=500||408===t||429===t)}function rm(e,t={}){const n=Qp(e),r=Date.now(),i=Zp.get(n);if(i&&i.until>r&&!t.force)return i.promise;const o=function(e,t){const n=new URLSearchParams;"customer"===t.source&&n.set("source","customer"),t.campaignId&&n.set("campaignId",String(t.campaignId)),t.formId&&n.set("formId",String(t.formId)),t.phoneId&&n.set("phoneId",String(t.phoneId)),t.signature&&t.expiresAt&&(n.set("sig",t.signature),n.set("exp",String(t.expiresAt)));const r=n.toString();return`${e}/api/campaign-form/${encodeURIComponent(String(t.id))}${r?`?${r}`:""}`}(t.apiBaseUrl??Xp,e),a=t.headers??Jp(),s=Math.max(0,t.retries??2),d=(async()=>{let e;for(let n=0;n<=s;n++)try{return await tm(o,a)}catch(t){if(e=t,n===s||!nm(t))break;await new Promise(e=>setTimeout(e,800*2**n))}throw e instanceof Error?e:new Error("Erro ao buscar o formulário")})();return Zp.set(n,{promise:d,until:r+3e5}),d.then(e=>{var t;e.partial&&(null==(t=Zp.get(n))?void 0:t.promise)===d&&Zp.delete(n)}).catch(()=>{var e;(null==(e=Zp.get(n))?void 0:e.promise)===d&&Zp.delete(n)}),d}function im(e){return String(e??"").normalize("NFC").trim().toLowerCase().replace(/\s+/g," ")}function om(e,t){if(!(null==e?void 0:e.values))return;const n=new Map;for(const[r,i]of Object.entries(e.values)){const e=am(im(r));n.has(e)||null==i||""===String(i).trim()||n.set(e,String(i))}for(const r of t){const e=n.get(am(im(r)));if(void 0!==e)return e}}function am(e){return e.normalize("NFD").replace(/[̀-ͯ]/g,"")}function sm(){var e;const t=rc(),n=nc(),r=(null==(e=null==n?void 0:n.data)?void 0:e.campaignContactPhoneId)??null;return"campaign"===(null==t?void 0:t.type)?$.jsx(dm,{campaignCallInfo:t.info,campaignContactPhoneId:r}):t?$.jsx("div",{className:"mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2",children:$.jsx("p",{className:"text-xs font-semibold text-amber-700",children:"Chamada manual (sem informações de campanha)"})}):null}function dm(e){const{campaign:n,campaignContact:r}=e.campaignCallInfo,[i,o]=t.useState({form:null,isLoading:!1,error:null}),[a,s]=t.useState({key:null,n:0}),d=t.useMemo(()=>em(e.campaignCallInfo,e.campaignContactPhoneId),[e.campaignCallInfo,e.campaignContactPhoneId]),l=d?Qp(d):null,u=t.useRef(d);u.current=d;const c=t.useRef(null);t.useEffect(()=>{const e=u.current;if(!e||!l)return void o({form:null,isLoading:!1,error:null});let t=!1,n=null;return o({form:null,isLoading:!0,error:null}),rm(e,{force:a.key===l&&a.n>0}).then(e=>{t||(o({form:e,isLoading:!1,error:null}),e.partial&&c.current!==l&&(c.current=l,n=setTimeout(()=>s(e=>({key:l,n:e.n+1})),3e3)))}).catch(e=>{t||(console.error("[CampaignCallInfoDisplay] Erro ao buscar dados:",e),o({form:null,isLoading:!1,error:e instanceof Error?e.message:"Erro ao buscar dados do contato"}))}),()=>{t=!0,n&&clearTimeout(n)}},[l,a]);const f=t.useMemo(()=>[{label:"Decisor",keys:["DECISOR","CONTATO","NOME"],icon:$.jsx(Hc,{className:"text-sm"})},{label:"Empresa",keys:["EMPRESA","RAZAO SOCIAL","RAZÃO SOCIAL","CLIENTE"],icon:$.jsx(Ec,{className:"text-sm"})},{label:"Dívida ativa",keys:["DIVIDA ATIVA","DÍVIDA ATIVA","VALOR TOTAL DEVIDO"],icon:$.jsx(Oc,{className:"text-sm"})},{label:"Telefone",keys:["TELEFONE","CELULAR","WHATSAPP"],icon:$.jsx(zc,{className:"text-sm"})}],[]),h=t.useMemo(()=>f.map(e=>{const t=("Telefone"===e.label?om(i.form,e.keys)??(null==r?void 0:r.phoneNumber):om(i.form,e.keys))||"",n="Telefone"===e.label?function(e){if(!e)return"-";const t=e.replace(/\D/g,"");if(t.length>=10){const e=t.slice(0,2),n=t.slice(2,t.length-4),r=t.slice(-4);return`(${e}) ${n.length>5?`${n.slice(0,n.length-4)} ${n.slice(n.length-4)}`:n}-${r}`.replace(/\s+/g," ").trim()}return e.trim()}(t):(t||"-").toString().trim()||"-";return{...e,value:n,isEmpty:!t}}),[null==r?void 0:r.phoneNumber,i.form,f]),p=h.some(e=>!e.isEmpty);return $.jsxs("div",{className:"mb-4 rounded-2xl border border-slate-200 bg-white/90 p-3 shadow-sm",children:[$.jsxs("div",{className:"mb-3 flex items-center justify-between gap-2",children:[$.jsxs("div",{className:"flex items-center gap-3",children:[$.jsx("span",{className:"inline-flex h-9 w-9 items-center justify-center rounded-2xl bg-emerald-500 text-white shadow-inner",children:$.jsx(Lc,{className:"text-base"})}),$.jsxs("div",{className:"min-w-0",children:[$.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.15em] text-slate-500",children:"Campanha"}),$.jsx("p",{className:"truncate text-sm font-bold text-slate-900",children:(null==n?void 0:n.name)||"Chamada de campanha"})]})]}),$.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-1 text-[10px] font-bold uppercase text-emerald-700",children:[$.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500"}),"Em chamada"]})]}),i.isLoading&&$.jsxs("div",{className:"rounded-xl border border-slate-200 bg-slate-50 p-4 text-center",role:"status",children:[$.jsx("div",{className:"mx-auto mb-2 inline-block h-7 w-7 animate-spin rounded-full border-2 border-emerald-500 border-t-transparent"}),$.jsx("p",{className:"text-xs font-medium text-slate-600",children:"Carregando dados do contato..."})]}),i.error&&$.jsxs("div",{className:"rounded-xl border border-rose-200 bg-rose-50 p-3",children:[$.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[$.jsx(Cc,{className:"text-sm text-rose-600"}),$.jsx("p",{className:"text-xs font-semibold text-rose-700",children:"Erro ao carregar dados"})]}),$.jsx("p",{className:"ml-6 text-[11px] text-rose-600",children:i.error}),$.jsx("button",{type:"button",onClick:()=>s(e=>({key:l,n:e.n+1})),className:"mt-2 ml-6 text-[11px] font-semibold text-rose-700 underline hover:text-rose-800",children:"Tentar novamente"})]}),!i.isLoading&&!i.error&&$.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:h.map(e=>$.jsxs("div",{className:"flex flex-col gap-1 rounded-xl border border-slate-200 bg-slate-50 p-2.5 shadow-[inset_0_1px_0_rgba(255,255,255,0.6)]",children:[$.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-slate-500",children:[e.icon,$.jsx("span",{className:"truncate",children:e.label})]}),$.jsx("p",{className:"break-words text-sm font-bold leading-tight text-slate-900",children:e.value||"-"})]},e.label))}),!i.isLoading&&!i.error&&!p&&$.jsx("div",{className:"rounded-xl border border-slate-200 bg-slate-50 p-3 text-xs font-medium text-slate-600",children:"Nenhuma informação de campanha disponível para este contato."})]})}function lm(e){const[n,r]=t.useState(null==e?void 0:e.get());return t.useEffect(()=>{if(!e)return void r(void 0);r(e.get());return e.subscribe(e=>{r(e)})},[e]),n}function um(){const{enterOnBreak:e,becomeAvailable:t}=tc();return{goOnBreak:e,goOffBreak:t}}const cm={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6],0,0,0,0,0,0,0,[["6[2-467]\\d{3}",[5]],["4\\d{4}",[5]],0,0,0,0,["(?:0[1-9]|[1589]\\d)\\d{4}",[6]]]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[["[78]\\d{5}",[6]],["690\\d{6}|[356]\\d{5}",[6,9]],["180[02]\\d{4}",[8]],["[19]\\d{5}",[6]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0",0,0,0,0,0,[["[2-4679][2-8]\\d{6}",[8]],["5[024-68]\\d{7}",[9]],["400\\d{6}|800\\d{2,9}"],["900[02]\\d{5}",[9]],0,0,["600[25]\\d{5}",[9]],0,0,["700[05]\\d{5}",[9]]]],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0",0,0,0,0,0,[["(?:[25][0-8]|[34][0-4]|6[0-5])[2-9]\\d{6}"],["7\\d{8}"]]],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268",[["268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}"],["268(?:464|7(?:1[3-9]|[28]\\d|3[0246]|64|7[0-689]))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,["26840[69]\\d{4}"],["26848[01]\\d{4}"]]],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264",[["264(?:292|4(?:6[12]|9[78]))\\d{4}"],["264(?:235|4(?:69|76)|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,["264724\\d{4}"]]],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0",0,0,0,0,0,[["4505[0-2]\\d{3}|(?:[2358][16-9]\\d[2-9]|4410)\\d{4}|(?:[2358][2-5][2-9]|4(?:[2-57-9][2-9]|6\\d))\\d{5}",[8]],["6(?:[78][2-9]|9\\d)\\d{6}",[9]],["800\\d{4}",[7]],["900[1-9]\\d\\d",[6]],["700[2-9]\\d{4}",[8]],0,0,0,0,["808[1-9]\\d\\d",[6]]]],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:1[0-25]|47)\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2)\\d{5}"],["(?:33|4[1349]|55|77|88|9[13-9])\\d{6}"],["800\\d{5}"],["90[016]\\d{5}"],0,0,0,0,["60(?:2[78]|3[5-9]|4[02-9]|5[0-46-9]|[6-8]\\d|9[0-2])\\d{4}"],["80[1-4]\\d{5}"]]],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]],0,0,0,0,0,0,[["2\\d(?:[0134][25-9]|[25-9]\\d)\\d{5}"],["9[1-79]\\d{7}"]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1",0,0,[["3(?:7(?:1[15]|81)|8(?:21|4[16]|69|9[12]))[46]\\d{5}|(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|47[35]|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|(?:2(?:657|9(?:54|66))|3(?:48[27]|7(?:55|77)|8(?:65|78)))[2-8]\\d{5}|(?:2(?:284|3(?:02|23)|477|622|920)|3(?:4(?:46|89|92)|541))[2-7]\\d{5}|(?:(?:11[1-8]|670)\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[25][4-6]|3[3-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|1[2-7]|3[4-6]|5[3-6]|7[2-6]|8[3-68])))\\d{6}|(?:2(?:2(?:62|81)|320|9(?:42|83))|3(?:329|4(?:62|7[16])|5(?:43|64)|7(?:18|5[17])))[2-6]\\d{5}|2(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|(?:2(?:257|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|64)|5(?:25|37|4[47]|71)|7(?:35|72)|825))[3-6]\\d{5}|(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[035-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[14]|4[13]|5[468]|7[3-5]|8[26])|8(?:2[67]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}",[10]],["93(?:7(?:1[15]|81)|8(?:21|4[16]|69|9[12]))[46]\\d{5}|9(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|47[35]|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|9(?:2(?:657|9(?:54|66))|3(?:48[27]|7(?:55|77)|8(?:65|78)))[2-8]\\d{5}|9(?:2(?:284|3(?:02|23)|477|622|920)|3(?:4(?:46|89|92)|541))[2-7]\\d{5}|(?:675\\d|9(?:11[1-8]\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[25][4-6]|3[3-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|1[2-7]|3[4-6]|5[3-6]|7[2-6]|8[3-68]))))\\d{6}|9(?:2(?:2(?:62|81)|320|9(?:42|83))|3(?:329|4(?:62|7[16])|5(?:43|64)|7(?:18|5[17])))[2-6]\\d{5}|92(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|9(?:2(?:257|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|64)|5(?:25|37|4[47]|71)|7(?:35|72)|825))[3-6]\\d{5}|9(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[035-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[14]|4[13]|5[468]|7[3-5]|8[26])|8(?:2[67]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}"],["800\\d{7,8}"],["60[04579]\\d{7}",[10]],0,0,["810\\d{7}",[10]]]],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684",[["6846(?:22|33|44|55|77|88|9[19])\\d{4}"],["684(?:2(?:48|5[2468]|7[26])|7(?:3[13]|70|82))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0",0,0,0,0,0,[["1(?:11\\d|[2-9]\\d{3,11})|(?:316|463)\\d{3,10}|648[34]\\d{3,9}|(?:51|66|73)2\\d{3,10}|(?:2(?:1[467]|2[13-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|9[1458])|3(?:1[1-578]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|7[1368]|8[2457])|5(?:2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[135-7]|5[468])|7(?:2[1-8]|35|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{4,10}"],["6(?:485|(?:5[0-3579]|6[013-9]|[7-9]\\d)\\d)\\d{3,9}",[7,8,9,10,11,12,13]],["800\\d{6,10}",[9,10,11,12,13]],["(?:8[69][2-68]|9(?:0[01]|3[019]))\\d{6,10}",[9,10,11,12,13]],0,0,0,0,["5(?:0[1-9]|17|[79]\\d)\\d{2,10}|7[28]0\\d{6,10}",[5,6,7,8,9,10,11,12,13]],["8(?:10|2[018])\\d{6,10}|828\\d{5}",[8,9,10,11,12,13]]]],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:2(?:(?:[0-26-9]\\d|3[0-8]|5[0135-9])\\d|4(?:[02-9]\\d|10))|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90))|7(?:[013-57-9]\\d|2[0-8])\\d)\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-478])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]],0,0,0,0,0,0,[["5(?:2\\d|8[1-9])\\d{4}"],["(?:290|5[69]\\d|6(?:[03]0|22|4[0-2]|[69]\\d)|7(?:[34]\\d|7[07])|9(?:6[45]|9[4-8]))\\d{4}"],["800\\d{4}"],["900\\d{4}"],0,0,0,0,["(?:28\\d|501)\\d{4}"]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",[["18[1-8]\\d{3,6}",[6,7,8,9]],["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}",[6,7,8,9,10]],["800\\d{4,6}",[7,8,9]],["[67]00\\d{5,6}",[8,9]],0,0,["20\\d{4,8}|60[12]\\d{5,6}|7(?:099\\d{4,5}|5[03-9]\\d{3,7})|20[2-59]\\d\\d|(?:606|7(?:0[78]|1|3\\d))\\d{7}|(?:10|29|3[09]|70[1-5]\\d)\\d{4,8}"]],"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:2[12]428|3655[02])\\d{4}|(?:2(?:22[0-79]|63[0-28])|3654)\\d{5}|(?:(?:1[28]|46)\\d|2(?:[014-6]2|[23]3))\\d{6}"],["36554\\d{4}|(?:[16]0|4[04]|5[015]|7[07]|99)\\d{7}"],["88\\d{7}"],["900200\\d{3}"]]],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0",0,0,0,0,0,[["(?:3(?:[05-79][2-9]|1[4579]|[23][24-9]|4[2-4689]|8[2457-9])|49[2-579]|5(?:0[2-49]|[13][2-9]|[268][2-4679]|4[4689]|5[2-79]|7[2-69]|9[2-4689]))\\d{5}",[8]],["6040\\d{5}|6(?:03|[1-356]|44|7\\d)\\d{6}"],["8[08]\\d{6}",[8]],["9[0246]\\d{6}",[8]],0,0,["703[235]0\\d{3}|70(?:2[0-5]|3[0146]|[56]0)\\d{4}",[8]],0,0,["8[12]\\d{6}",[8]]]],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246",[["246521[0369]\\d{3}|246(?:2(?:2[78]|7[0-4])|4(?:1[024-6]|2\\d|3[2-9])|5(?:20|[34]\\d|54|7[1-3])|6(?:2\\d|38)|7[35]7|9(?:1[89]|63))\\d{4}"],["246(?:(?:2(?:[3568]\\d|4[0-57-9])|3(?:5[2-9]|6[0-6])|4(?:46|5\\d)|69[5-7]|8(?:[2-5]\\d|83))\\d|52(?:1[147]|20))\\d{3}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["(?:246976|900[2-9]\\d\\d)\\d{4}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,["246(?:292|367|4(?:1[7-9]|3[01]|4[47-9]|67)|7(?:1[2-9]|2\\d|3[016]|53))\\d{4}"],0,["24631\\d{5}"]]],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0",0,0,0,0,0,[["(?:4(?:31\\d\\d|423)|5222)\\d{3}(?:\\d{2})?|8332[6-9]\\d\\d|(?:3(?:03[56]|224)|4(?:22[25]|653))\\d{3,4}|(?:3(?:42[47]|529|823)|4(?:027|525|65(?:28|8))|562|6257|7(?:1(?:5[3-5]|6[12]|7[156]|89)|22[589]56|32|42675|52(?:[25689](?:56|8)|[347]8)|71(?:6[1267]|75|89)|92374)|82(?:2[59]|32)56|9(?:03[23]56|23(?:256|373)|31|5(?:1|2[4589]56)))\\d{3}|(?:3(?:02[348]|22[35]|324|422)|4(?:22[67]|32[236-9]|6(?:2[46]|5[57])|953)|5526|6(?:024|6655)|81)\\d{4,5}|(?:2(?:7(?:1[0-267]|2[0-289]|3[0-29]|4[01]|5[1-3]|6[013]|7[0178]|91)|8(?:0[125]|1[1-6]|2[0157-9]|3[1-69]|41|6[1-35]|7[1-5]|8[1-8]|9[0-6])|9(?:0[0-2]|1[0-4]|2[568]|3[3-6]|5[5-7]|6[0136-9]|7[0-7]|8[014-9]))|3(?:0(?:2[025-79]|3[2-4])|181|22[12]|32[2356]|824)|4(?:02[09]|22[348]|32[045]|523|6(?:27|54))|666(?:22|53)|7(?:22[57-9]|42[56]|82[35])8|8(?:0[124-9]|2(?:181|2[02-4679]8)|4[12]|[5-7]2)|9(?:[04]2|2(?:2|328)|81))\\d{4}|(?:2(?:[23]\\d|[45])\\d\\d|3(?:1(?:2[5-7]|[5-7])|425|822)|4(?:033|1\\d|[257]1|332|4(?:2[246]|5[25])|6(?:2[35]|56|62)|8(?:23|54)|92[2-5])|5(?:02[03489]|22[457]|32[35-79]|42[46]|6(?:[18]|53)|724|826)|6(?:023|2(?:2[2-5]|5[3-5]|8)|32[3478]|42[34]|52[47]|6(?:[18]|6(?:2[34]|5[24]))|[78]2[2-5]|92[2-6])|7(?:02|21\\d|[3-589]1|6[12]|72[24])|8(?:217|3[12]|[5-7]1)|9[24]1)\\d{5}|(?:(?:3[2-8]|5[2-57-9]|6[03-589])1|4[4689][18])\\d{5}|[59]1\\d{5}"],["(?:1[13-9]\\d|644)\\d{7}|(?:3[78]|44|66)[02-9]\\d{7}",[10]],["80[03]\\d{7}",[10]],0,0,0,0,0,["96(?:0[469]|1[0-47]|3[389]|43|6[69]|7[78])\\d{6}",[10]]]],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0",0,0,0,0,0,[["80[2-8]\\d{5}|(?:1[0-69]|[23][2-8]|4[23]|5\\d|6[013-57-9]|71|8[1-79]|9[2-4])\\d{6}",[8]],["4[5-9]\\d{7}",[9]],["800[1-9]\\d{4}",[8]],["(?:70(?:2[0-57]|3[04-7]|44|6[04-69]|7[0579])|90\\d\\d)\\d{4}",[8]],0,0,["78(?:0[578]|1[014-8]|2[25]|3[15-8]|48|5[05]|60|7[06-8]|9\\d)\\d{4}",[8]],0,0,["7879\\d{4}",[8]]]],BF:["226","00","(?:[025-7]\\d|44)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]],0,0,0,0,0,0,[["2(?:0(?:49|5[23]|6[5-7]|9[016-9])|4(?:4[569]|5[4-6]|6[5-7]|7[0179])|5(?:[34]\\d|50|6[5-7]))\\d{4}"],["(?:0[1-7]|44|5[0-8]|[67]\\d)\\d{6}"]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[["2\\d{5,7}|(?:43[1-6]|70[1-9])\\d{4,5}|(?:[36]\\d|4[124-7]|[57][1-9]|8[1-6]|9[1-7])\\d{5,6}",[6,7,8]],["(?:43[07-9]|99[69]\\d)\\d{5}|(?:8[7-9]|98)\\d{7}",[8,9]],["(?:00800\\d\\d|800)\\d{5}",[8,12]],["90\\d{6}",[8]],0,0,0,0,0,["700\\d{5}",[8]]]],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]],0,0,0,0,0,0,[["(?:1(?:3[1356]|6[0156]|7\\d)\\d|6(?:1[16]\\d|500|6(?:0\\d|3[12]|44|55|7[7-9]|88)|9[69][69])|7(?:[07]\\d\\d|1(?:11|78)))\\d{4}"],["(?:3(?:[0-79]\\d|8[0-57-9])\\d|6(?:3(?:00|33|6[16])|441|6(?:3[03-9]|[69]\\d|7[0-689])))\\d{4}"],["8[02369]\\d{6}"],["(?:87|9[0-8])\\d{6}"],0,0,0,0,0,["84\\d{6}"]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]],0,0,0,0,0,0,[["(?:22|31)\\d{6}"],["(?:29|6[124-9]|7[125-9])\\d{6}"]]],BJ:["229","00","(?:01\\d|[24-689])\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]],0,0,0,0,0,0,[["2090\\d{4}|(?:012\\d\\d|2(?:02|1[037]|2[45]|3[68]|4\\d))\\d{5}"],["(?:01(?:2[5-9]|[4-69]\\d)|4[0-8]|[56]\\d|9[013-9])\\d{6}"],0,0,0,0,["81\\d{6}",[8]],0,["857[58]\\d{4}",[8]]]],BL:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441",[["441(?:[46]\\d\\d|5(?:4\\d|60|89))\\d{4}"],["441(?:[2378]\\d|5[0-39]|9[02])\\d{5}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]],0,0,0,0,0,0,[["22[0-7]\\d{4}|(?:2[013-9]|[34]\\d|5[0-25-9])\\d{5}"],["(?:22[89]|[78]\\d\\d)\\d{4}"],0,0,0,0,0,0,["5[34]\\d{5}"]]],BO:["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?",0,0,0,[["(?:2(?:2\\d\\d|5(?:11|[258]\\d|9[67])|6(?:12|2\\d|9[34])|8(?:2[34]|39|62))|3(?:3\\d\\d|4(?:6\\d|8[24])|8(?:25|42|5[257]|86|9[25])|9(?:[27]\\d|3[2-4]|4[248]|5[24]|6[2-6]))|4(?:4\\d\\d|6(?:11|[24689]\\d|72)))\\d{4}",[8]],["[67]\\d{7}",[8]],["8001[07]\\d{4}",[9]],0,0,0,0,0,["50\\d{6}",[8]]]],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]",[["(?:318[023]|41(?:6[023]|70)|7(?:1[578]|2[05]|50)\\d)\\d{3}"],["(?:31(?:8[14-8]|9[14578])|416[14-9]|7(?:0[01]|7[07]|8\\d|9[056])\\d)\\d{3}"]]],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2",0,0,[["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\\d{7}",[10]],["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])(?:7|9\\d)\\d{7}",[10,11]],["800\\d{6,7}",[9,10]],["[59]00\\d{6,7}",[9,10]],0,0,0,0,0,["(?:30[03]\\d{3}|4(?:0(?:0\\d|20)|370|864))\\d{4}|300\\d{5}",[8,10]]]],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242",[["242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[347]|8[0-4]|9[2-467])|461|502|6(?:0[1-5]|12|2[013]|[45]0|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}"],["242(?:3(?:5[79]|7[56]|95)|4(?:[23][1-9]|4[1-35-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-46-9]|65|77)|6[34]6|7(?:27|38)|8(?:0[1-9]|1[02-9]|2\\d|3[0-4]|[89]9))\\d{4}"],["242300\\d{4}|8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,["242225\\d{4}"]]],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]],0,0,0,0,0,0,[["(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\d{5}",[7]],["(?:1[67]|[78]7)\\d{6}",[8]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0-35-9]|55|[69]\\d|7[013]|81)|4(?:6[03]|7[1267]|9[0-5])|5(?:3[03489]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[013467]))\\d{4}",[7]],["(?:321|7[1-8]\\d)\\d{5}",[8]],["(?:0800|800\\d)\\d{6}",[10]],["90\\d{5}",[7]],0,0,0,0,["79(?:1(?:[0-2]\\d|3[0-8])|2[0-7]\\d)\\d{3}",[8]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,[["(?:1(?:5(?:1[1-5]|[24]\\d|6[2-4]|9[1-7])|6(?:[235]\\d|4[1-7])|7\\d\\d)|2(?:1(?:[246]\\d|3[0-35-9]|5[1-9])|2(?:[235]\\d|4[0-8])|3(?:[26]\\d|3[02-79]|4[024-7]|5[03-7])))\\d{5}",[9]],["(?:2(?:5[5-79]|9[1-9])|(?:33|44)\\d)\\d{6}",[9]],["800\\d{3,7}|8(?:0[13]|20\\d)\\d{7}"],["(?:810|902)\\d{7}",[10]],0,0,0,0,["249\\d{6}",[9]]],"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]],0,0,0,0,0,0,[["(?:2(?:[02]\\d|36|[68]0)|[3-58](?:[02]\\d|[68]0)|7(?:[02]\\d|32|[68]0))\\d{4}",[7]],["6[0-35-7]\\d{5}",[7]],["0800\\d{7}",[11]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|33|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-478])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:12|573)\\d\\d|276)\\d{5}|[1-6]\\d{6}"],["88\\d{5}|(?:8[0-69]|9[017-9])\\d{7}",[7,9]]]],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]],0,0,0,0,0,0,[["2[12]\\d{6}"],["7[024-7]\\d{6}"],0,["8776\\d{4}"]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]],0,0,0,0,0,0,[["222[1-589]\\d{5}"],["026(?:1[0-5]|6[6-9])\\d{4}|0(?:[14-6]\\d\\d|2(?:40|5[5-8]|6[07-9]))\\d{5}"],0,["80[0-2]\\d{6}"]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:2[12467]|3[1-4]|4[134]|5[256]|6[12]|[7-9]1)\\d{7}",[9]],["(?:6[89]|7[235-9])\\d{7}",[9]],["800\\d{6}",[9]],["90[016]\\d{6}",[9]],["878\\d{6}",[9]],["860\\d{9}",[12]],["5[18]\\d{7}",[9]],["74[0248]\\d{6}",[9]],0,["84[0248]\\d{6}",[9]]]],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]],0,0,0,0,0,0,[["2(?:[15]\\d{3}|7(?:2(?:0[23]|1[2357]|2[245]|3[45]|4[3-5])|3(?:06|1[69]|[2-6]7)))\\d{5}"],["0[157]\\d{8}"]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]],0,0,0,0,0,0,[["(?:2\\d|3[13-7]|4[1-5])\\d{3}"],["[578]\\d{4}"]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]],0,0,0,0,0,0,[["2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|2\\d{3}|3(?:(?:2\\d|50)\\d|3(?:[03467]\\d|1[0-35-9]|2[1-9]|5[0-24-9]|8[0-389]|9[0-8])|600)|646[59])|(?:(?:3[2-5]|[47][1-35]|5[1-3578])\\d|6(?:00|[13-57]\\d)|8(?:0[1-9]|[1-9]\\d))\\d\\d|9(?:(?:10[01]|(?:[2458]\\d|7[1-9])\\d)\\d|3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}",[9]],["2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|2\\d{3}|3(?:(?:2\\d|50)\\d|3(?:[03467]\\d|1[0-35-9]|2[1-9]|5[0-24-9]|8[0-389]|9[0-8])|600)|646[59])|(?:(?:3[2-5]|[47][1-35]|5[1-3578]|6[13-57])\\d|8(?:0[1-8]|[1-9]\\d))\\d\\d|9(?:(?:10[01]|(?:[2458]\\d|7[1-9])\\d)\\d|3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}",[9]],["(?:123|8)00\\d{6}",[9,11]],0,0,0,0,0,["44\\d{7}",[9]],["600\\d{7,8}",[10,11]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]],0,0,0,0,0,0,[["2(?:22|33)\\d{6}",[9]],["(?:24[23]|6(?:[25-9]\\d|40))\\d{6}",[9]],["88\\d{6,7}"]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,[["(?:10(?:[02-79]\\d\\d|[18](?:0[1-9]|[1-9]\\d))|2(?:[02-57-9]\\d{3}|1(?:[18](?:0[1-9]|[1-9]\\d)|[2-79]\\d\\d))|(?:41[03]|8078|9(?:78|94))\\d\\d)\\d{5}|(?:10|2[0-57-9])(?:1(?:00|23)\\d\\d|95\\d{3,4})|(?:41[03]|9(?:78|94))(?:100\\d\\d|95\\d{3,4})|8078123|(?:43[35]|754|851)\\d{7,8}|(?:43[35]|754|851)(?:1(?:00\\d|23)\\d|95\\d{3,4})|(?:3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1\\d|2[37]|3[12]|51|7[13-79]|9[15])|7(?:[39]1|5[57]|6[09])|8(?:71|98))(?:[02-8]\\d{7}|1(?:0(?:0\\d\\d(?:\\d{3})?|[1-9]\\d{5})|[13-9]\\d{6}|2(?:[0-24-9]\\d{5}|3\\d(?:\\d{4})?))|9(?:[0-46-9]\\d{6}|5\\d{3}(?:\\d(?:\\d{2})?)?))|(?:3(?:1[02-9]|35|49|5\\d|7[02-68]|9[1-68])|4(?:1[24-9]|2[179]|3[46-9]|5[2-9]|6[47-9]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[17]\\d|2[248]|3[04-9]|4[3-6]|5[0-3689]|6[2368]|9[02-9])|8(?:1[236-8]|2[5-7]|3\\d|5[2-9]|7[02-9]|8[36-8]|9[1-7])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))(?:[02-8]\\d{6}|1(?:0(?:0\\d\\d(?:\\d{2})?|[1-9]\\d{4})|[13-9]\\d{5}|2(?:[0-24-9]\\d{4}|3\\d(?:\\d{3})?))|9(?:[0-46-9]\\d{5}|5\\d{3,5}))",[7,8,9,10,11]],["1740[0-5]\\d{6}|1(?:[38]\\d|4[57]|[59][0-35-9]|6[25-7]|7[0-35-8])\\d{8}",[11]],["(?:(?:10|21)8|8)00\\d{7}",[10,12]],["16[08]\\d{5}",[8]],0,0,0,0,0,["10(?:10\\d{4}|96\\d{3,4})|400\\d{7}|950\\d{7,8}|(?:2[0-57-9]|3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))96\\d{3,4}",[7,8,9,10,11]]],"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?",0,0,0,[["601055(?:[0-4]\\d|50)\\d\\d|6010(?:[0-4]\\d|5[0-4])\\d{4}|(?:46|60(?:[18][1-9]|[24-7][2-9]))\\d{6}",[8,10]],["333301[0-5]\\d{3}|3333(?:00|2[5-9]|[3-9]\\d)\\d{4}|(?:3(?:(?:0[0-5]|1\\d|5[01]|70)\\d|2(?:[0-3]\\d|4[1-9])|3(?:00|3[0-24-9]))|9(?:101|408))\\d{6}",[10]],["1800\\d{7}",[11]],["(?:19(?:0[01]|4[78])|901)\\d{7}",[10,11]]]],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))",0,0,0,[["210[7-9]\\d{4}|2(?:[024-7]\\d|1[1-9])\\d{5}",[8]],["(?:3005\\d|6500[01])\\d{3}|(?:5[07]|6[0-4]|7[0-3]|8[3-9])\\d{6}",[8]],["800\\d{7}",[10]],["90[059]\\d{7}",[10]],0,0,0,0,["(?:210[0-6]|4\\d{3}|5100)\\d{4}",[8]]]],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:3[23]|4[89])\\d{4,6}|(?:31|4[36]|8(?:0[25]|78)\\d)\\d{6}|(?:2[1-4]|4[1257]|7\\d)\\d{5,6}"],["(?:5\\d|6[2-4])\\d{6}",[8]],["800\\d{7}",[10]],0,0,0,0,0,0,["807\\d{7}",[10]]]],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]],0,0,0,0,0,0,[["2(?:2[1-7]|3[0-8]|4[12]|5[1256]|6\\d|7[1-3]|8[1-5])\\d{4}"],["(?:36|5[1-389]|9\\d)\\d{5}"],["800\\d{4}"],0,0,0,0,0,["(?:3[3-5]|4[356])\\d{5}"]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]",[["9(?:4(?:3[0-5]|4[14]|6\\d)|50\\d|7(?:2[014]|3[02-9]|4[4-9]|6[357]|77|8[7-9])|8(?:3[39]|[46]\\d|7[01]|8[57-9]))\\d{4}"],["953[01]\\d{4}|9(?:5[12467]|6[5-9])\\d{5}"],0,0,0,0,0,["955\\d{5}",[8]],0,["60[0-2]\\d{4}",[7]]]],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-478])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]],0,0,0,0,0,0,[["2[2-6]\\d{6}"],["9(?:10|[4-79]\\d)\\d{5}"],["800\\d{5}"],["90[09]\\d{5}"],["700\\d{5}"],0,["(?:50|77)\\d{6}"],0,0,["80[1-9]\\d{5}"]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,[["(?:2\\d|3[1257-9]|4[16-9]|5[13-9])\\d{7}",[9]],["7(?:060\\d|19(?:[0-4]\\d|50))\\d{4}|(?:60[1-8]|7(?:0[2-5]|[2379]\\d))\\d{6}",[9]],["800\\d{6}",[9]],["9(?:0[05689]|76)\\d{6}",[9]],["70[01]\\d{6}",[9]],["9(?:3\\d{9}|6\\d{7,10})"],["9(?:5\\d|7[2-4])\\d{6}",[9]],0,["9[17]0\\d{6}",[9]],["8[134]\\d{7}",[9]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0",0,0,0,0,0,[["32\\d{9,11}|49[1-6]\\d{10}|322\\d{6}|49[0-7]\\d{3,9}|(?:[34]0|[68]9)\\d{3,13}|(?:2(?:0[1-689]|[1-3569]\\d|4[0-8]|7[1-7]|8[0-7])|3(?:[3569]\\d|4[0-79]|7[1-7]|8[1-8])|4(?:1[02-9]|[2-48]\\d|5[0-6]|6[0-8]|7[0-79])|5(?:0[2-8]|[124-6]\\d|[38][0-8]|[79][0-7])|6(?:0[02-9]|[1-358]\\d|[47][0-8]|6[1-9])|7(?:0[2-8]|1[1-9]|[27][0-7]|3\\d|[4-6][0-8]|8[0-5]|9[013-7])|8(?:0[2-9]|1[0-79]|2\\d|3[0-46-9]|4[0-6]|5[013-9]|6[1-8]|7[0-8]|8[0-24-6])|9(?:0[6-9]|[1-4]\\d|[589][0-7]|6[0-8]|7[0-467]))\\d{3,12}",[5,6,7,8,9,10,11,12,13,14,15]],["1(?:(?:5(?:[0-25-9]\\d\\d|3(?:10|33))|7[26-9]\\d\\d)\\d{6}|6[023]\\d{7,8})|17\\d{8}",[10,11]],["800\\d{7,12}",[10,11,12,13,14,15]],["(?:137[7-9]|900(?:[135]|9\\d))\\d{6}",[10,11]],["700\\d{8}",[11]],["1(?:6(?:013|255|399)|7(?:(?:[015]1|[69]3)3|[2-4]55|[78]99))\\d{7,8}|15(?:(?:[03-68]00|113)\\d|2\\d55|7\\d99|9\\d33)\\d{7}",[12,13]],["18(?:1\\d{5,11}|[2-9]\\d{8})",[8,9,10,11,12,13,14]],["16(?:4\\d{1,10}|[89]\\d{1,11})",[4,5,6,7,8,9,10,11,12,13,14]],0,["180\\d{5,11}|13(?:7[1-6]\\d\\d|8)\\d{4}",[7,8,9,10,11,12,13,14]]]],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]],0,0,0,0,0,0,[["2(?:1[2-5]|7[45])\\d{5}"],["77\\d{6}"]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:[0-59][1-9]|[6-8]\\d)|3(?:[0-3][1-9]|4[13]|5[1-58]|6[1347-9]|7\\d|8[1-8]|9[1-79])|4(?:[0-25][1-9]|[34][2-9]|6[13-579]|7[13579]|8[1-47]|9[127])|5(?:[0-36][1-9]|4[146-9]|5[3-57-9]|7[568]|8[1-358]|9[1-69])|6(?:[0135][1-9]|2[1-68]|4[2-8]|6[1689]|[78]\\d|9[15689])|7(?:[0-69][1-9]|7[3-9]|8[147])|8(?:[16-9][1-9]|2[1-58])|9(?:[1-47-9][1-9]|6\\d))\\d{5}"],["(?:2[6-8]|37|6[78]|96)\\d{6}|(?:2[0-59]|3[0-689]|[457]\\d|6[0-69]|8[126-9]|9[1-47-9])[1-9]\\d{5}"],["80\\d{6}"],["90\\d{6}"]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767",[["767(?:2(?:55|66)|4(?:2[01]|4[0-25-9])|50[0-4])\\d{4}"],["767(?:2(?:[2-4689]5|7[5-7])|31[5-7]|61[1-8]|70[1-6])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9",[["8(?:[04]9[2-9]\\d\\d|29(?:2(?:[0-59]\\d|6[04-9]|7[0-27]|8[0237-9])|3(?:[0-35-9]\\d|4[7-9])|[45]\\d\\d|6(?:[0-27-9]\\d|[3-5][1-9]|6[0135-8])|7(?:0[013-9]|[1-37]\\d|4[1-35689]|5[1-4689]|6[1-57-9]|8[1-79]|9[1-8])|8(?:0[146-9]|1[0-48]|[248]\\d|3[1-79]|5[01589]|6[013-68]|7[124-8]|9[0-8])|9(?:[0-24]\\d|3[02-46-9]|5[0-79]|60|7[0169]|8[57-9]|9[02-9])))\\d{4}"],["8[024]9[2-9]\\d{6}"],["800(?:14|[2-9]\\d)\\d{5}|8[024]9[01]\\d{6}|8(?:33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0",0,0,0,0,0,[["9619\\d{5}|(?:1\\d|2[013-79]|3[0-8]|4[013-689])\\d{6}"],["(?:5(?:4[0-29]|5\\d|6[0-3])|6(?:[569]\\d|7[0-6])|7[7-9]\\d)\\d{6}",[9]],["800\\d{6}",[9]],["80[3-689]1\\d{5}",[9]],0,0,0,0,["98[23]\\d{6}",[9]],["80[12]1\\d{5}",[9]]]],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["[2-7][2-7]\\d{6}",[8]],["964[0-2]\\d{5}|9(?:39|[57][89]|6[0-36-9]|[89]\\d)\\d{6}",[9]],["1800\\d{7}|1[78]00\\d{6}",[10,11]],0,0,0,0,0,["[2-7]890\\d{4}",[8]]]],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:3[23589]|4[3-8]|6\\d|7[1-9]|88)\\d{5}",[7]],["(?:5\\d{5}|8(?:1(?:0(?:0(?:00|[178]\\d)|[3-9]\\d\\d)|(?:1(?:0[2-6]|1\\d)|(?:2[0-59]|[3-79]\\d)\\d)\\d)|2(?:0(?:0(?:00|4\\d)|(?:19|[2-7]\\d)\\d)|(?:(?:[124-69]\\d|3[5-9])\\d|7(?:[0-79]\\d|8[13-9])|8(?:[2-6]\\d|7[01]))\\d)|[349]\\d{4}))\\d\\d|5(?:(?:[02]\\d|5[0-478])\\d|1(?:[0-8]\\d|95)|6(?:4[0-4]|5[1-589]))\\d{3}",[7,8]],["800(?:(?:0\\d\\d|1)\\d|[2-9])\\d{3}"],["(?:40\\d\\d|900)\\d{4}",[7,8]],["70[0-2]\\d{5}",[8]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0",0,0,0,0,0,[["13[23]\\d{6}|(?:15|57)\\d{6,7}|(?:2\\d|3|4[05-8]|5[05]|6[24-689]|8[2468]|9[235-7])\\d{7}",[8,9]],["1[0-25]\\d{8}",[10]],["800\\d{7}",[10]],["900\\d{7}",[10]]]],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]",[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-8]|5[0-5]|8[0-7]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1[12568]|[24]0|55|6[146])|8\\d\\d)\\d{4}"],["(?:17[1-3]|7\\d\\d)\\d{4}"]]],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]],0,0,0,0,0,0,[["96906(?:0[0-8]|1[1-9]|[2-9]\\d)\\d\\d|9(?:69(?:0[0-57-9]|[1-9]\\d)|73(?:[0-8]\\d|9[1-9]))\\d{4}|(?:8(?:[1356]\\d|[28][0-8]|[47][1-9])|9(?:[135]\\d|[268][0-8]|4[1-9]|7[124-9]))\\d{6}"],["(?:590[16]00\\d|9(?:6906(?:09|10)|7390\\d\\d))\\d\\d|(?:6\\d|7[1-48])\\d{7}"],["[89]00\\d{6}"],["80[367]\\d{6}"],["70\\d{7}"],0,["51\\d{7}"],0,0,["90[12]\\d{6}"]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0",0,0,0,0,0,[["11667[01]\\d{3}|(?:11(?:1(?:1[1-468]|2[2-7]|3[1-5]|5[5-8]|8[6-8])|2(?:13|3[6-8]|5[89]|7[05-9]|8[2-6])|3(?:2[01]|3[0-289]|4[1289]|7[1-4]|87)|4(?:1[69]|3[2-49]|4[0-3]|6[5-8]|7\\d)|5(?:1[578]|44|5[0-4])|6(?:1[578]|2[69]|39|4[5-7]|5[0-5]|6[0-59]|8[015-8]))|2(?:2(?:11[1-9]|22[0-7]|33\\d|44[1467]|66[1-68])|5(?:11[124-6]|33[2-8]|44[1467]|55[14]|66[1-3679]|77[124-79]|880))|3(?:3(?:11[0-46-8]|(?:22|55)[0-6]|33[0134689]|44[04]|66[01467])|4(?:44[0-8]|55[0-69]|66[0-3]|77[1-5]))|4(?:6(?:119|22[0-24-7]|33[1-5]|44[13-69]|55[14-689]|660|88[1-4])|7(?:(?:11|22)[1-9]|33[13-7]|44[13-6]|55[1-689]))|5(?:7(?:227|55[05]|(?:66|77)[14-8])|8(?:11[149]|22[013-79]|33[0-68]|44[013-8]|550|66[1-5]|77\\d)))\\d{4}"],["700[1-9]\\d{5}|(?:7(?:0[1-9]|1[0-8]|22|77|86|99)|9\\d\\d)\\d{6}"]]],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",[["1[3-7][1-8]\\d{3,6}|(?:19[1-8]|[23568][1-8]\\d|9(?:00|[1-8]\\d))\\d{2,6}",[5,6,7,8,9]],["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}",[6,7,8,9,10]],["800\\d{4,6}",[7,8,9]],["[67]00\\d{5,6}",[8,9]],0,0,["20\\d{4,8}|60[12]\\d{5,6}|7(?:099\\d{4,5}|5[03-9]\\d{3,7})|20[2-59]\\d\\d|(?:606|7(?:0[78]|1|3\\d))\\d{7}|(?:10|29|3[09]|70[1-5]\\d)\\d{4,8}"]],"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,[["603\\d{4}|(?:3[0-5]|6[25-7]|8[58])\\d{5}",[7]],["(?:[279]\\d|45|5[01568]|8[034679])\\d{5}",[7]],["0800\\d{7}",[11]]],"00"],FK:["500","00","[2-7]\\d{4}",[5],0,0,0,0,0,0,0,[["[2-47]\\d{4}"],["[56]\\d{4}"]]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]],0,0,0,0,0,0,[["31(?:00[67]|208|309)\\d\\d|(?:3(?:[2357]0[1-9]|602|804|905)|(?:820|9[2-6]\\d)\\d)\\d{3}"],["31(?:00[67]|208|309)\\d\\d|(?:3(?:[2357]0[1-9]|602|804|905)|(?:820|9[2-7]\\d)\\d)\\d{3}"]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))",0,0,0,[["(?:20|[34]\\d|8[19])\\d{4}"],["(?:[27][1-9]|5\\d|9[16])\\d{4}"],["80[257-9]\\d{3}"],["90(?:[13-5][15-7]|2[125-7]|9\\d)\\d\\d"],0,0,0,0,["(?:6[0-36]|88)\\d{4}"]]],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0",0,0,0,0,0,[["(?:26[013-9]|59[1-35-9])\\d{6}|(?:[13]\\d|2[0-57-9]|4[1-9]|5[0-8])\\d{7}"],["(?:6(?:[0-24-8]\\d|3[0-8]|9[589])|7[3-9]\\d)\\d{6}"],["80[0-5]\\d{6}"],["836(?:0[0-36-9]|[1-9]\\d)\\d{4}|8(?:1[2-9]|2[2-47-9]|3[0-57-9]|[569]\\d|8[0-35-9])\\d{6}"],0,0,["80[6-9]\\d{6}"],0,["9\\d{8}"],["8(?:1[01]|2[0156]|4[024]|84)\\d{6}"]]],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1",0,0,[["[01]1\\d{6}",[8]],["(?:(?:0[2-7]|7[467])\\d|6(?:0[0-4]|10|[256]\\d))\\d{5}|[2-7]\\d{6}"]]],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-35])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473",[["473(?:2(?:3[0-2]|69)|3(?:2[89]|86)|4(?:[06]8|3[5-9]|4[0-4]|5[59]|73|90)|63[68]|7(?:58|84)|800|938)\\d{4}"],["473(?:4(?:0[2-79]|1[04-9]|2[0-5]|49|5[6-8])|5(?:2[01]|3[3-8])|901)\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0",0,0,0,0,0,[["(?:3(?:[256]\\d|4[124-9]|7[0-4])|4(?:1\\d|2[2-7]|3[1-79]|4[2-8]|7[239]|9[1-7]))\\d{6}"],["5(?:(?:(?:0555|1(?:[17]77|555))[5-9]|757(?:7[7-9]|8[01]))\\d|22252[0-4])\\d\\d|5(?:0(?:0[17]0|505)|1(?:0[01]0|1(?:07|33|51))|2(?:0[02]0|2[25]2)|3(?:0[03]0|3[35]3)|(?:40[04]|900)0|5222)[0-4]\\d{3}|(?:5(?:0(?:0(?:0\\d|11|22|3[0-6]|44|5[05]|77|88|9[09])|(?:[14]\\d|77)\\d|22[02])|1(?:1(?:[03][01]|[124]\\d|5[2-6]|7[0-4])|4\\d\\d)|[23]555|4(?:4\\d\\d|555)|5(?:[0157-9]\\d\\d|200|333|444)|6[89]\\d\\d|7(?:[0147-9]\\d\\d|5(?:00|[57]5))|8(?:0(?:[018]\\d|2[0-4])|5(?:55|8[89])|8(?:55|88))|9(?:090|[1-35-9]\\d\\d))|790\\d\\d)\\d{4}"],["800\\d{6}"],0,0,0,0,0,["70[67]\\d{6}"]]],GF:["594","00","(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0",0,0,0,0,0,[["594(?:[02-49]\\d|1[0-5]|5[6-9]|6[0-3]|80)\\d{4}"],["(?:694(?:[0-249]\\d|3[0-8])|7093[0-3])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:396|76\\d)\\d|476[0-6])\\d{4}"]]],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0",0,0,0,0,0,[["3082[0-5]\\d{4}|3(?:0(?:[237]\\d|8[01])|[167](?:2[0-6]|7\\d|80)|2(?:2[0-5]|7\\d|80)|3(?:2[0-3]|7\\d|80)|4(?:2[013-9]|3[01]|7\\d|80)|5(?:2[0-7]|7\\d|80)|8(?:2[0-2]|7\\d|80)|9(?:[28]0|7\\d))\\d{5}",[9]],["(?:2(?:[0346-9]\\d|5[67])|5(?:[03-7]\\d|9[1-9]))\\d{6}",[9]],["800\\d{5}",[8]]]],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]],0,0,0,0,0,0,[["2190[0-2]\\d{3}|2(?:0(?:[02]\\d|3[01])|16[24-9]|2[2-5]\\d)\\d{4}"],["5251[0-4]\\d{3}|(?:5(?:[146-8]\\d\\d|250)|60(?:1[01]|6\\d))\\d{4}"]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]],0,0,0,0,0,0,[["(?:19|3[1-7]|[68][1-9]|70|9\\d)\\d{4}"],["[245]\\d{5}"],["80\\d{4}"],0,0,0,0,0,["3[89]\\d{4}"]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[["(?:4(?:[23]\\d\\d|4(?:1[024679]|[6-9]\\d))|5(?:5(?:3\\d|4[0-7])|6[67]\\d|7(?:1[04]|2[035]|3[58]|48))|8[0-589]\\d\\d)\\d{3}"],["556\\d{4}|(?:[23679]\\d|4[015]|5[0-489]|8[67])\\d{5}"]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]],0,0,0,0,0,0,[["3(?:0(?:24|3[12]|4[1-35-7]|5[13]|6[189]|[78]1|9[1478])|1\\d\\d)\\d{4}",[8]],["6[0-356]\\d{7}",[9]],0,0,0,0,0,0,["722\\d{6}",[9]]]],GP:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]],0,0,0,0,0,0,[["33[0-24-9]\\d[46]\\d{4}|3(?:33|5\\d)\\d[7-9]\\d{4}"],["(?:222|55\\d)\\d{6}"],["80\\d[1-9]\\d{5}"],["90\\d[1-9]\\d{5}"]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["2(?:1\\d\\d|2(?:2[1-46-9]|[36][1-8]|4[1-7]|5[1-4]|7[1-5]|[89][1-9])|3(?:1\\d|2[1-57]|[35][1-3]|4[13]|7[1-7]|8[124-6]|9[1-79])|4(?:1\\d|2[1-8]|3[1-4]|4[13-5]|6[1-578]|9[1-5])|5(?:1\\d|[29][1-4]|3[1-5]|4[124]|5[1-6])|6(?:1\\d|[269][1-6]|3[1245]|4[1-7]|5[13-9]|7[14]|8[1-5])|7(?:1\\d|2[1-5]|3[1-6]|4[1-7]|5[1-57]|6[135]|9[125-7])|8(?:1\\d|2[1-5]|[34][1-4]|9[1-57]))\\d{6}",[10]],["68[57-9]\\d{7}|(?:69|94)\\d{8}",[10]],["800\\d{7,9}"],["90[19]\\d{7}",[10]],["70\\d{8}",[10]],0,["5005000\\d{3}",[10]],0,0,["8(?:0[16]|12|[27]5|50)\\d{7}",[10]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[["[267][2-9]\\d{6}",[8]],["(?:[3-5]\\d\\d|80[0-4])\\d{5}",[8]],["18[01]\\d{8}",[11]],["19\\d{9}",[11]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671",[["671(?:2\\d\\d|3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[02-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[478])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]],0,0,0,0,0,0,[["443\\d{6}",[9]],["9(?:5\\d|6[569]|77)\\d{6}",[9]],0,0,0,0,0,0,["40\\d{5}",[7]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:1[6-9]|2[0-35-9]|3[1-4]|5[3-9]|6\\d|7[0-79])|3(?:2[25-9]|3\\d)|4(?:4[0-24]|5[56])|50[0-6]|77[1-57])\\d{4}"],["(?:51[01]|6\\d\\d|7(?:[0-5]\\d|6[0-39]|70))\\d{4}"],["(?:289|8(?:00|6[28]|88|99))\\d{4}"],["9008\\d{3}"],0,0,0,0,["515\\d{4}"]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,[["(?:2(?:[13-9]\\d|2[013-9])\\d|3(?:(?:[1569][0-24-9]|4[0-246-9]|7[0-24-69])\\d|8(?:4[0-8]|[579]\\d|6[0-5]))|58(?:0[1-9]|1[2-9]))\\d{4}",[8]],["(?:4(?:44[0-35-9]|6(?:4[0-57-9]|6[0-4])|7(?:3[0-4]|4[0-48]|6[0-5]))|5(?:35[4-8]|73[0-6]|95[0-8])|6(?:26[013-8]|(?:66|78)[0-5])|70(?:7[1-8]|8[0-8])|84(?:4[0-2]|8[0-35-9])|9(?:29[013-9]|39[014-9]|59[0-4]|899))\\d{4}|(?:4(?:4[0-35-9]|6[0-357-9]|7[0-25])|5(?:[1-59][0-46-9]|6[0-4689]|7[0-246-9])|6(?:0[1-9]|[13-59]\\d|[268][0-57-9]|7[0-79])|70[1-59]|84[0-39]|9(?:0[1-9]|1[02-9]|[2358][0-8]|[467]\\d))\\d{5}",[8]],["800\\d{6}",[9]],["900(?:[0-24-9]\\d{7}|3\\d{1,4})",[5,6,7,8,11]],["8(?:1[0-4679]\\d|2(?:[0-36]\\d|7[0-4])|3(?:[034]\\d|2[09]|70))\\d{4}",[8]],0,["30(?:0[1-9]|[15-7]\\d|2[047]|89)\\d{4}",[8]],["7(?:1(?:0[0-38]|1[0-3679]|3[013]|69|9[0136])|2(?:[02389]\\d|1[18]|7[27-9])|3(?:[0-38]\\d|7[0-369]|9[2357-9])|47\\d|5(?:[178]\\d|5[0-5])|6(?:0[0-7]|2[236-9]|[35]\\d)|7(?:[27]\\d|8[7-9])|8(?:[23689]\\d|7[1-9])|9(?:[025]\\d|6[0-246-8]|7[0-36-9]|8[238]))\\d{4}",[8]]],"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]],0,0,0,0,0,0,[["2(?:2(?:0[0-59]|1[1-9]|[23]\\d|4[02-7]|5[57]|6[245]|7[0135689]|8[01346-9]|9[0-2])|4(?:0[578]|2[3-59]|3[13-9]|4[0-68]|5[1-3589])|5(?:0[2357-9]|1[1-356]|4[03-5]|5\\d|6[014-69]|7[04]|80)|6(?:[056]\\d|17|2[067]|3[047]|4[0-378]|[78][0-8]|9[01])|7(?:0[5-79]|6[46-9]|7[02-9]|8[034]|91)|8(?:79|8[0-357-9]|9[1-57-9]))\\d{4}",[8]],["[37-9]\\d{7}",[8]],["8002\\d{7}",[11]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[["1\\d{7}|(?:2[0-3]|3[1-5]|4[02-47-9]|5[1-3])\\d{6,7}",[8,9]],["9(?:(?:0[1-9]|[12589]\\d)\\d\\d|7(?:[0679]\\d\\d|5(?:[01]\\d|44|55|77|9[5-79])))\\d{4}|98\\d{6}",[8,9]],["80\\d{5,7}"],["6[01459]\\d{6}|6[01]\\d{5}",[7,8]],["7[45]\\d{6}",[8]],0,["62\\d{6,7}|72\\d{6}",[8,9]]]],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]],0,0,0,0,0,0,[["2(?:2\\d|5[1-5]|81|9[149])\\d{5}"],["(?:[34]\\d|5[56])\\d{6}"],["8\\d{7}"],0,0,0,0,0,["9(?:[67][0-4]|8[0-3589]|9\\d)\\d{5}"]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06",0,0,0,0,0,[["(?:1\\d|[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6[23689]|8[2-57-9]|9[2-69])\\d{6}",[8]],["(?:[257]0|3[01])\\d{7}",[9]],["(?:[48]0\\d|680[29])\\d{5}"],["9[01]\\d{6}",[8]],0,0,["38\\d{7}",[9]],0,["21\\d{7}",[9]]]],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0",0,0,0,0,0,[["2[124]\\d{7,8}|619\\d{8}|2(?:1(?:14|500)|2\\d{3})\\d{3}|61\\d{5,8}|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\d|9[1-8])|3(?:1|[25][1-8]|3[1-68]|4[1-3]|6[1-3568]|7[0-469]|8\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|43|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[124-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:[25]\\d|3[1-69]|4[1-6])|7(?:02|[125][1-9]|[36]\\d|4[1-8]|7[0-36-9])|9(?:0[12]|1[013-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\d{5,8}",[7,8,9,10,11]],["8[1-35-9]\\d{7,10}",[9,10,11,12]],["00(?:1803\\d{5,11}|7803\\d{7})|(?:177\\d|800)\\d{5,7}",[8,9,10,11,12,13,14,15,16,17]],["809\\d{7}",[10]],0,0,["(?:1500|8071\\d{3})\\d{3}",[7,10]],0,0,["804\\d{7}",[10]]]],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:1\\d|21)\\d{6,7}|(?:2[24-9]|4(?:0[24]|5\\d|7)|5(?:0[45]|1\\d|8)|6(?:1\\d|[237-9])|9(?:1\\d|[35-9]))\\d{5}|(?:23|4(?:[1-469]|8\\d)|5[23679]|6[4-6]|7[14]|9[04])\\d{7}"],["8(?:22|[35-9]\\d)\\d{6}",[9]],["1800\\d{6}",[10]],["15(?:1[2-8]|[2-8]0|9[089])\\d{6}",[10]],["700\\d{6}",[9]],["88210[1-9]\\d{4}|8(?:[35-79]5\\d\\d|8(?:[013-9]\\d\\d|2(?:[01][1-9]|[2-9]\\d)))\\d{5}",[10]],["818\\d{6}",[9]],0,["76\\d{7}",[9]],["18[59]0\\d{6}",[10]]]],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0",0,0,0,0,0,[["153\\d{8,9}|29[1-9]\\d{5}|(?:2[0-8]|[3489]\\d)\\d{6}",[8,11,12]],["55(?:4(?:0[01]|10|5[0-7])|57[0-289])\\d{4}|5(?:(?:[0-2][02-9]|[36]\\d|[49][2-9]|8[3-7])\\d|5(?:01|2\\d|3[0-3]|4[34]|5[0-25689]|6[6-8]|7[0-267]|8[7-9]|9[1-9]))\\d{5}",[9]],["1(?:255|80[019]\\d{3})\\d{3}",[7,10]],["1212\\d{4}|1(?:200|9(?:0[0-2]|19))\\d{6}",[8,10]],0,["151\\d{8,9}",[11,12]],["1599\\d{6}",[10]],0,["7(?:38(?:[05]\\d|8[018])|8(?:33|55|77|81)\\d)\\d{4}|7(?:18|2[23]|3[237]|47|6[258]|7\\d|82|9[2-9])\\d{6}",[9]],["1700\\d{6}",[10]]]],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24",[["1624(?:230|[5-8]\\d\\d)\\d{3}"],["76245[06]\\d{4}|7(?:4576|[59]24\\d|624[0-4689])\\d{5}"],["808162\\d{4}"],["8(?:440[49]06|72299\\d)\\d{3}|(?:8(?:45|70)|90[0167])624\\d{4}"],["70\\d{8}"],0,["3440[49]06\\d{3}|(?:3(?:08162|3\\d{4}|45624|7(?:0624|2299))|55\\d{4})\\d{4}"],0,["56\\d{8}"]]],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0",0,0,0,0,0,[["2717(?:[2-7]\\d|95)\\d{4}|(?:271[0-689]|782[0-6])[2-7]\\d{5}|(?:170[24]|2(?:(?:[02][2-79]|90)\\d|80[13468])|(?:3(?:23|80)|683|79[1-7])\\d|4(?:20[24]|72[2-8])|552[1-7])\\d{6}|(?:11|33|4[04]|80)[2-7]\\d{7}|(?:342|674|788)(?:[0189][2-7]|[2-7]\\d)\\d{5}|(?:1(?:2[0-249]|3[0-25]|4[145]|[59][14]|6[014]|7[1257]|8[01346])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568]|9[14])|3(?:26|4[13]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[014-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91))[2-7]\\d{6}|(?:1(?:2[35-8]|3[346-9]|4[236-9]|[59][0235-9]|6[235-9]|7[34689]|8[257-9])|2(?:1[134689]|3[24-8]|4[2-8]|5[25689]|6[2-4679]|7[3-79]|8[2-479]|9[235-9])|3(?:01|1[79]|2[1245]|4[5-8]|5[125689]|6[235-7]|7[157-9]|8[2-46-8])|4(?:1[14578]|2[5689]|3[2-467]|5[4-7]|6[35]|73|8[2689]|9[2389])|5(?:[16][146-9]|2[14-8]|3[1346]|4[14-69]|5[46]|7[2-4]|8[2-8]|9[246])|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])|7(?:1[013-9]|2[0235-9]|3[2679]|4[1-35689]|5[2-46-9]|[67][02-9]|8[013-7]|9[089])|8(?:1[1357-9]|2[235-8]|3[03-57-9]|4[0-24-9]|5\\d|6[2457-9]|7[1-6]|8[1256]|9[2-4]))\\d[2-7]\\d{5}",[10]],["(?:61279|7(?:887[02-9]|9(?:313|79[07-9]))|8(?:079[04-9]|(?:84|91)7[02-8]))\\d{5}|(?:6(?:12|[2-47]1|5[17]|6[13]|80)[0189]|7(?:1(?:2[0189]|9[0-5])|2(?:[14][017-9]|8[0-59])|3(?:2[5-8]|[34][017-9]|9[016-9])|4(?:1[015-9]|[29][89]|39|8[389])|5(?:[15][017-9]|2[04-9]|9[7-9])|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589])|70[0289]|88[089]|97[02-8])|8(?:0(?:6[67]|7[02-8])|70[017-9]|84[01489]|91[0-289]))\\d{6}|(?:7(?:31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[0189]\\d|7[02-8])\\d{5}|(?:6(?:[09]\\d|1[04679]|2[03689]|3[05-9]|4[0489]|50|6[069]|7[07]|8[7-9])|7(?:0\\d|2[0235-79]|3[05-8]|40|5[0346-8]|6[6-9]|7[1-9]|8[0-79]|9[089])|8(?:0[01589]|1[0-57-9]|2[235-9]|3[03-57-9]|[45]\\d|6[02457-9]|7[1-69]|8[0-25-9]|9[02-9])|9\\d\\d)\\d{7}|(?:6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|8[124-6])\\d|7(?:[235689]\\d|4[0189]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-5])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]|881))[0189]\\d{5}",[10]],["000800\\d{7}|1(?:600\\d{6}|80(?:0\\d{4,9}|3\\d{9}))"],["186[12]\\d{9}",[13]],0,0,["140\\d{7}",[10]],0,0,["1860\\d{7}",[11]]]],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]],0,0,0,0,0,0,[["37\\d{5}"],["38\\d{5}"]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["1\\d{7}|(?:2[13-5]|3[02367]|4[023]|5[03]|6[026])\\d{6,7}",[8,9]],["7[3-9]\\d{8}",[10]]]],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0",0,0,0,0,0,[["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])(?:[03-57]\\d{7}|[16]\\d{3}(?:\\d{4})?|[289]\\d{3}(?:\\d(?:\\d{3})?)?)|94(?:000[09]|(?:12\\d|30[0-2])\\d|2(?:121|[2689]0\\d)|4(?:111|40\\d))\\d{4}",[6,7,10]],["9(?:(?:0[0-5]|[13]\\d|2[0-3])\\d\\d|9(?:[0-46]\\d\\d|5(?:10|5\\d)|8(?:[12]\\d|88)|9(?:0[0-3]|[19]\\d|21|69|77|8[7-9])))\\d{5}",[10]],0,0,0,0,["96(?:0[12]|2[16-8]|3(?:08|[14]5|[23]|66)|4(?:0|80)|5[01]|6[89]|86|9[19])",[4,5]]]],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["(?:4(?:1[0-24-69]|2[0-7]|[37][0-8]|4[0-24589]|5[0-68]|6\\d|8[0-36-8])|5(?:05|[156]\\d|2[02578]|3[0-579]|4[03-7]|7[0-2578]|8[0-35-9]|9[013-689])|872)\\d{4}",[7]],["(?:38[589]\\d\\d|6(?:1[1-8]|2[0-6]|3[026-9]|4[014679]|5[0159]|6[0-69]|70|8[06-8]|9\\d)|7(?:5[057]|[6-9]\\d)|8(?:2[0-59]|[3-69]\\d|8[238]))\\d{4}"],["80[0-8]\\d{4}",[7]],["90(?:0\\d|1[5-79]|2[015-79]|3[135-79]|4[125-7]|5[25-79]|7[1-37]|8[0-35-7])\\d{3}",[7]],0,["(?:689|8(?:7[18]|80)|95[48])\\d{4}",[7]],["809\\d{4}",[7]],0,["49[0-24-79]\\d{4}",[7]]],"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876",[["8766060\\d{3}|(?:658(?:2(?:[0-8]\\d|9[0-46-9])|[3-9]\\d\\d)|876(?:52[35]|6(?:0[1-3579]|1[0235-9]|[23]\\d|40|5[06]|6[2-589]|7[0-25-9]|8[04]|9[4-9])|7(?:0[2-689]|[1-6]\\d|8[056]|9[45])|9(?:0[1-8]|1[02378]|[2-8]\\d|9[2-468])))\\d{4}"],["(?:658295|876(?:2(?:0[1-9]|[13-9]\\d|2[013-9])|[348]\\d\\d|5(?:0[1-9]|[1-9]\\d)|6(?:4[89]|6[67])|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579])))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["87(?:000|90[01])\\d{3}|(?:2(?:6(?:2[0-35-9]|3[0-578]|4[24-7]|5[0-24-8]|[6-8][023]|9[0-3])|7(?:0[1-79]|10|2[014-7]|3[0-689]|4[019]|5[0-3578]))|32(?:0[1-69]|1[1-35-7]|2[024-7]|3\\d|4[0-3]|[5-7][023])|53(?:0[0-3]|[13][023]|2[0-59]|49|5[0-35-9]|6[15]|7[45]|8[1-6]|9[0-36-9])|6(?:2(?:[05]0|22)|3(?:00|33)|4(?:0[0-25]|1[2-7]|2[0569]|[38][07-9]|4[025689]|6[0-589]|7\\d|9[0-2])|5(?:[01][056]|2[034]|3[0-57-9]|4[178]|5[0-69]|6[0-35-9]|7[1-379]|8[0-68]|9[0239]))|87(?:20|7[078]|99))\\d{4}",[8]],["7(?:[78][0-25-9]|9\\d)\\d{6}",[9]],["80\\d{6}",[8]],["9\\d{7}",[8]],["70\\d{7}",[9]],0,["8(?:10|8\\d)\\d{5}",[8]],["74(?:66|77)\\d{5}",[9]],0,["85\\d{6}",[8]]]],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1",0,0,[["(?:1(?:1[235-8]|2[3-6]|3[3-9]|4[2-6]|[58][2-8]|6[2-7]|7[2-9]|9[1-9])|(?:2[2-9]|[36][1-9])\\d|4(?:[2-578]\\d|6[02-8]|9[2-59])|5(?:[2-589]\\d|6[1-9]|7[2-8])|7(?:[25-9]\\d|3[4-9]|4[02-9])|8(?:[2679]\\d|3[2-9]|4[5-9]|5[1-9]|8[03-9])|9(?:[2-58]\\d|[679][1-9]))\\d{6}",[9]],["(?:601[0-4]0|[7-9]0[1-9]\\d\\d)\\d{5}",[10]],["00777(?:[01]|5\\d)\\d\\d|(?:00(?:7778|882[1245])|(?:120|800\\d)\\d\\d)\\d{4}|00(?:37|66|78)\\d{6,13}"],["990\\d{6}",[9]],["60\\d{7}",[9]],0,["570\\d{6}",[9]],["20\\d{8}",[10]],["50[1-9]\\d{7}",[10]]]],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,[["(?:4[245]|5[1-79]|6[01457-9])\\d{5,7}|(?:4[136]|5[08]|62)\\d{7}|(?:[24]0|66)\\d{6,7}",[7,8,9]],["(?:1(?:0[0-8]|1\\d|2[014]|[34]0)|7\\d\\d)\\d{6}",[9]],["800[02-8]\\d{5,6}",[9,10]],["900[02-9]\\d{5}",[9]]]],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["312(?:5[0-79]\\d|9(?:[0-689]\\d|7[0-24-9]))\\d{3}|(?:3(?:1(?:2[0-46-8]|3[1-9]|47|[56]\\d)|2(?:22|3[0-479]|6[0-7])|4(?:22|5[6-9]|6\\d)|5(?:22|3[4-7]|59|6\\d)|6(?:22|5[35-7]|6\\d)|7(?:22|3[468]|4[1-9]|59|[67]\\d)|9(?:22|4[1-8]|6\\d))|6(?:09|12|2[2-4])\\d)\\d{5}",[9]],["312(?:58\\d|973)\\d{3}|(?:2(?:0[0-35]|2\\d)|5[0-24-7]\\d|600|7(?:[07]\\d|55)|88[08]|9(?:12|9[05-9]))\\d{6}",[9]],["800\\d{6,7}"]]],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["23(?:4(?:[2-4]|[56]\\d)|[568]\\d\\d)\\d{4}|23[236-9]\\d{5}|(?:2[4-6]|3[2-6]|4[2-4]|[5-7][2-5])(?:(?:[237-9]|4[56]|5\\d)\\d{5}|6\\d{5,6})",[8,9]],["(?:(?:1[28]|3[18]|9[67])\\d|6[016-9]|7(?:[07-9]|[16]\\d)|8(?:[013-79]|8\\d))\\d{6}|(?:1\\d|9[0-57-9])\\d{6}|(?:2[3-6]|3[2-6]|4[2-4]|[5-7][2-5])48\\d{5}",[8,9]],["1800(?:1\\d|2[019])\\d{4}",[10]],["1900(?:1\\d|2[09])\\d{4}",[10]]]],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0",0,0,0,0,0,[["(?:[24]\\d|3[1-9]|50|65(?:02[12]|12[56]|22[89]|[3-5]00)|7(?:27\\d\\d|3100|5(?:02[12]|12[56]|22[89]|[34](?:00|81)|500))|8[0-5])\\d{3}"],["(?:6200[01]|7(?:310[1-9]|5(?:02[03-9]|12[0-47-9]|22[0-7]|[34](?:0[1-9]|8[02-9])|50[1-9])))\\d{3}|(?:63\\d\\d|7(?:(?:[0146-9]\\d|2[0-689])\\d|3(?:[02-9]\\d|1[1-9])|5(?:[0-2][013-9]|[34][1-79]|5[1-9]|[6-9]\\d)))\\d{4}",[8]],0,0,0,0,0,0,["30(?:0[01]\\d\\d|12(?:11|20))\\d\\d",[8]]]],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]],0,0,0,0,0,0,[["7[4-7]\\d{5}"],["[34]\\d{6}"],0,["8\\d{6}"]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869",[["869(?:2(?:29|36)|302|4(?:6[015-9]|70)|56[5-7])\\d{4}"],["869(?:48[89]|55[6-8]|66\\d|76[02-7])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:195|2)\\d|3[19]|4[159]|5[37]|6[17]|7[39]|85)\\d{6}"],["19[1-3]\\d{7}",[10]]]],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?",0,0,0,[["(?:2|3[1-3]|[46][1-4]|5[1-5])[1-9]\\d{6,7}|(?:3[1-3]|[46][1-4]|5[1-5])1\\d{2,3}",[5,6,8,9,10]],["1(?:05(?:[0-8]\\d|9[0-6])|22[13]\\d)\\d{4,5}|1(?:0[0-46-9]|[16-9]\\d|2[013-9])\\d{6,7}",[9,10]],["00(?:308\\d{6,7}|798\\d{7,9})|(?:00368|[38]0)\\d{7}",[9,11,12,13,14]],["60[2-9]\\d{6}",[9]],["50\\d{8,9}",[10,11]],0,["1(?:5(?:22|33|44|66|77|88|99)|6(?:[07]0|44|6[0168]|88)|8(?:00|33|55|77|99))\\d{4}",[8]],["15\\d{7,8}",[9,10]],["70\\d{8}",[10]]]],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]],0,0,0,0,0,0,[["2(?:[23]\\d\\d|4(?:[1-35-9]\\d|44)|5(?:0[034]|[2-46]\\d|5[1-3]|7[1-7]))\\d{4}",[8]],["(?:41\\d\\d|5(?:(?:[05]\\d|1[0-7]|6[56])\\d|2(?:22|5[25])|7(?:55|77)|88[58])|6(?:(?:0[034679]|5[015-9]|6\\d)\\d|1(?:00|11|6[16])|2[26]2|3[36]3|4[46]4|7(?:0[013-9]|[67]\\d)|8[68]8|9(?:[069]\\d|3[039]))|9(?:(?:[04679]\\d|8[057-9])\\d|1(?:00|1[01]|99)|2(?:00|2\\d)|3(?:00|3[03])|5(?:00|5\\d)))\\d{4}",[8]],["18\\d{5}",[7]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345",[["345(?:2(?:22|3[23]|44|66)|333|444|6(?:23|38|40)|7(?:30|4[35-79]|6[6-9]|77)|8(?:00|1[45]|4[89]|88)|9(?:14|4[035-9]))\\d{4}"],["345(?:32[1-9]|42[0-4]|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|82[56]|9(?:1[679]|2[2-9]|3[06-9]|90))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["(?:345976|900[2-9]\\d\\d)\\d{4}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33622|7",[["(?:33622|7(?:1(?:0(?:[23]\\d|4[0-3]|59|63)|1(?:[23]\\d|4[0-79]|59)|2(?:[23]\\d|59)|3(?:2\\d|3[0-79]|4[0-35-9]|59)|4(?:[24]\\d|3[013-9]|5[1-9]|97)|5(?:2\\d|3[1-9]|4[0-7]|59)|6(?:[2-4]\\d|5[19]|61)|72\\d|8(?:[27]\\d|3[1-46-9]|4[0-5]|59))|2(?:1(?:[23]\\d|4[46-9]|5[3469])|2(?:2\\d|3[0679]|46|5[12679])|3(?:[2-4]\\d|5[139])|4(?:2\\d|3[1-35-9]|59)|5(?:[23]\\d|4[0-8]|59|61)|6(?:2\\d|3[1-9]|4[0-4]|59)|7(?:[2379]\\d|40|5[279])|8(?:[23]\\d|4[0-3]|59)|9(?:2\\d|3[124578]|59))))\\d{5}",[10]],["7(?:0[0-25-8]|47|6[0-4]|7[15-8]|85)\\d{7}",[10]],["8(?:00|108\\d{3})\\d{7}"],["809\\d{7}",[10]],["808\\d{7}",[10]],0,0,0,["751\\d{7}",[10]]],"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,0,0,0,0,[["(?:2[13]|[35-7][14]|41|8[1468])\\d{6}",[8]],["(?:20(?:[23579]\\d|8[78])|30[24]\\d)\\d{6}|30\\d{7}",[9,10]]]],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0",0,0,0,0,0,[["7(?:62|8[0-6]|9[04-9])\\d{4}|(?:[14-69]\\d|2(?:[14-69]\\d|[78][1-9])|7[2-57]|8[02-9])\\d{5}"],["(?:(?:3|81)\\d|7(?:[01]\\d|6[013-9]|8[7-9]|9[1-3]))\\d{5}"],0,["9[01]\\d{6}",[8]],0,0,0,0,0,["80\\d{6}",[8]]]],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758",[["758(?:234|4(?:30|5\\d|6[2-9]|8[0-2])|57[0-2]|(?:63|75)8)\\d{4}"],["758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2\\d|3[0-3])|812)\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0",0,0,0,[["(?:2(?:01|1[27]|2[024]|3\\d|6[02-578]|96)|3(?:[24]0|33|7[0135-7]|8[048]|9[0269]))\\d{4}",[7]],["(?:6(?:(?:4[5-9]|5\\d)\\d|6(?:[024-6]\\d|[17]0|3[7-9]))\\d|7(?:[37-9]\\d|42|56))\\d{4}"],["8002[28]\\d\\d|80(?:05\\d|9)\\d{4}"],["90(?:02[258]|1(?:23|3[14])|66[136])\\d\\d",[7]],0,["697(?:42|56|[78]\\d)\\d{4}",[9]],["870(?:28|87)\\d\\d",[7]]]],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0",0,0,0,0,0,[["(?:12[2-9]|602|8[12]\\d|9(?:1\\d|22|9[245]))\\d{6}|(?:11|2[13-7]|3[1-8]|4[157]|5[12457]|6[35-7])[2-57]\\d{6}"],["7(?:[0-25-8]\\d|4[0-4])\\d{6}"],0,0,0,0,["1973\\d{5}"]]],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0",0,0,0,0,0,[["2\\d{7}",[8]],["(?:(?:(?:22|33)0|555|7(?:6[01]|7\\d)|88\\d)\\d|4(?:240|[67]))\\d{5}|[56]\\d{6}",[7,9]],0,["332(?:02|[34]\\d)\\d{4}",[9]]]],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]],0,0,0,0,0,0,[["2\\d{7}"],["[56]\\d{7}"],["800[1256]\\d{4}"]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]",0,0,0,[["(?:3[1478]|4[124-6]|52)\\d{6}"],["6\\d{7}"],["80[02]\\d{5}"],["9(?:0[0239]|10)\\d{5}"],["70[05]\\d{5}"],0,["70[67]\\d{5}"],0,["[89]01\\d{5}"],["808\\d{5}"]]],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)",0,0,0,[["(?:35[013-9]|80[2-9]|90[89])\\d{1,8}|(?:2[2-9]|3[0-46-9]|[457]\\d|8[13-9]|9[2-579])\\d{2,9}"],["6(?:[269][18]|5[1568]|7[189]|81)\\d{6}",[9]],["800\\d{5}",[8]],["90[015]\\d{5}",[8]],0,0,0,0,["20(?:1\\d{5}|[2-689]\\d{1,7})",[4,5,6,7,8,9,10]],["801\\d{5}",[8]]]],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]],0,0,0,0,0,0,[["6\\d{7}"],["2333[0-8]\\d{3}|2(?:[0-24-9]\\d\\d|3(?:0[07]|[14-9]\\d|2[02-9]|3[0-24-9]))\\d{4}"],["80\\d{6}"],["90\\d{6}"],0,0,0,0,0,["81\\d{6}"]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:0[56]|[1-6]\\d|7[124579]|8[124])|3(?:1\\d|2[2356])|4(?:[17]\\d|2[1-357]|5[2-4]|8[124])|5(?:[1347]\\d|2[1-469]|5[13-5]|8[1-4])|6(?:[1-479]\\d|5[2-57]|8[1-5])|7(?:[13]\\d|2[13-79])|8(?:[124]\\d|5[124]|84))\\d{6}"],["9[1-6]\\d{7}"]]],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-8]|5[0-5]|8[0-7]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0",0,0,0,0,0,[["(?:870|9[2-47-9]\\d)\\d{5}",[8]],["4(?:[469]\\d|5[1-9])\\d{5}|(?:3|6\\d)\\d{7}"],["(?:800|90\\d)\\d{5}",[8]]]],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:2[1-9]|3[1-79])\\d|5(?:33|5[257]))\\d{5}"],["562\\d{5}|(?:6\\d|7[16-9])\\d{6}"],["800\\d{5}"],["90[056]\\d{5}"],0,0,["803\\d{5}"],0,["3[08]\\d{6}"],["808\\d{5}"]]],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:20[2-8]|3(?:[0-2][2-7]|3[24-7])|4(?:0[2-467]|1[2467])|5(?:0[2467]|1[24-7]|2[2-467]))\\d{5}",[8]],["6(?:[07-9]\\d|3[024]|6[0-25])\\d{5}",[8]],["80(?:[0-2578]|9\\d)\\d{5}"],["9(?:4[1568]|5[178])\\d{5}",[8]],0,0,["77[1-9]\\d{5}",[8]],0,["78[1-49]\\d{5}",[8]]]],MF:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1",0,0,[["2072[29]\\d{4}|20(?:2\\d|4[47]|5[3467]|6[279]|7[356]|8[268]|9[2457])\\d{5}"],["3[2-47-9]\\d{7}"],0,0,0,0,0,0,["22\\d{7}"]]],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1",0,0,0,0,0,[["(?:247|528|625)\\d{4}"],["(?:(?:23|54)5|329|45[35-8])\\d{4}"],0,0,0,0,0,0,["635\\d{4}"]]],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:2(?:62|77)0|3444)\\d|4[56]440)\\d{3}|(?:34|4[357])700\\d{3}|(?:2(?:[0-3]\\d|5[0-578]|6[01]|82)|3(?:1[3-68]|[23][2-68]|4[23568])|4(?:[23][2-68]|4[3-68]|5[2568]|6[25-8]|7[24-68]|8[4-68]))\\d{5}"],["7(?:3555|(?:474|9[019]7)7)\\d{3}|7(?:[0-25-8]\\d\\d|3(?:[1-478]\\d|6[01])|4(?:2\\d|60|7[01578])|9(?:[2-4]\\d|5[01]|7[015]))\\d{4}"],["800\\d{5}"],["5\\d{7}"],0,0,0,0,0,["8(?:0[1-9]|[1-9]\\d)\\d{5}"]]],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]],0,0,0,0,0,0,[["2(?:07[0-8]|12[67])\\d{4}|(?:2(?:02|1[4-689])|4(?:0[0-4]|4[1-59]))\\d{5}"],["2(?:0(?:01|79)|17\\d)\\d{4}|(?:5[0-3]|[679]\\d|8[2-59])\\d{6}"],["80\\d{6}"]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:(?:12|[28]\\d|3[56]|7[3-6]|9[0-6])\\d|4(?:2[29]|7[0-2]|83)|6)|2(?:2(?:00|8[34])|4(?:0\\d|22|7[0-2]|83)|51\\d\\d)|4(?:2(?:2\\d\\d|48[013])|3(?:20\\d|4(?:70|83)|56)|420\\d|5(?:2\\d|470))|6(?:0(?:[23]|88\\d)|(?:124|[56]2\\d)\\d|2472|3(?:20\\d|470)|4(?:2[04]\\d|472)|7(?:3\\d\\d|4[67]0|8(?:[01459]\\d|8))))\\d{4}|5(?:2(?:2\\d{5,6}|47[02]\\d{4})|(?:3472|4(?:2(?:1|86)|470)|522\\d|6(?:20\\d|483)|7(?:20\\d|48[01])|8(?:20\\d|47[02])|9(?:20\\d|470))\\d{4})|7(?:(?:0470|4(?:25\\d|470)|5(?:202|470|96\\d))\\d{4}|1(?:20\\d{4,5}|4(?:70|83)\\d{4}))|8(?:1(?:2\\d{5,6}|4(?:10|7[01]\\d)\\d{3})|2(?:2\\d{5,6}|(?:320|490\\d)\\d{3})|(?:3(?:2\\d\\d|470)|4[24-7]|5(?:(?:2\\d|51)\\d|4(?:[1-35-9]\\d|4[0-57-9]))|6[23])\\d{4})|(?:1[2-6]\\d|4(?:2[24-8]|3[2-7]|[46][2-6]|5[3-5])|5(?:[27][2-8]|3[2-68]|4[24-8]|5[23]|6[2-4]|8[24-7]|9[2-7])|6(?:[19]20|42[03-6]|(?:52|7[45])\\d)|7(?:[04][24-8]|[15][2-7]|22|3[2-4])|8(?:1[2-689]|2[2-8]|(?:[35]2|64)\\d))\\d{4}|25\\d{5,6}|(?:2[2-9]|6(?:1[2356]|[24][2-6]|3[24-6]|5[2-4]|6[2-8]|7[235-7]|8[245]|9[24])|8(?:3[24]|5[245]))\\d{4}",[6,7,8,9]],["(?:17[01]|9(?:2(?:[0-4]|[56]\\d\\d)|(?:3(?:[0-36]|4\\d)|(?:6\\d|8[89]|9[4-8])\\d|7(?:3|40|[5-9]\\d))\\d|4(?:(?:[0245]\\d|[1379])\\d|88)|5[0-6])\\d)\\d{4}|9[69]1\\d{6}|9(?:[68]\\d|9[089])\\d{5}",[7,8,9,10]],["80080(?:0[1-9]|2\\d)\\d{3}",[10]],0,0,0,0,0,["1333\\d{4}",[8]]]],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0",0,0,0,0,0,[["[12]2[1-3]\\d{5,6}|(?:(?:[12](?:1|27)|5[368])\\d\\d|7(?:0(?:[0-5]\\d|7[078]|80)|128))\\d{4}|[12](?:3[2-8]|4[2-68]|5[1-4689])\\d{6,7}"],["92[0139]\\d{5}|(?:5[05]|6[069]|7[28]|8[0135689]|9[013-9])\\d{6}",[8]],0,0,0,0,0,0,["712[0-79]\\d{4}|7(?:1[013-9]|[5-79]\\d)\\d{5}",[8]]]],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]],0,0,0,0,0,0,[["(?:28[2-9]|8(?:11|[2-57-9]\\d))\\d{5}",[8]],["6800[0-79]\\d{3}|6(?:[235]\\d\\d|6(?:0[0-5]|[1-9]\\d)|8(?:0[1-9]|[14-8]\\d|2[5-9]|[39][0-4]))\\d{4}",[8]],["0800\\d{3}",[7]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670",[["670(?:2(?:3[3-7]|56|8[4-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],MQ:["596","00","(?:596\\d|7091)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:596(?:[03-7]\\d|1[05]|2[7-9]|8[0-39]|9[04-9])|80[6-9]\\d\\d|9(?:477[6-9]|767[4589]))\\d{4}"],["(?:69[67]\\d\\d|7091[0-3])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:397[0-3]|477[0-5]|76(?:6\\d|7[0-367]))\\d{4}"]]],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]],0,0,0,0,0,0,[["(?:25[08]|35\\d|45[1-7])\\d{5}"],["[2-4][0-46-9]\\d{6}"],["800\\d{5}"]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664",[["6644(?:1[0-3]|91)\\d{4}"],["664(?:3(?:49|9[1-6])|49[2-6])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]],0,0,0,0,0,0,[["20(?:3[1-4]|6[059])\\d{4}|2(?:0[19]|[1-357]\\d|60)\\d{5}"],["(?:7(?:210|[79]\\d\\d)|9(?:[29]\\d\\d|69[67]|8(?:1[1-3]|89|97)))\\d{4}"],["800(?:02|[3467]\\d)\\d{3}"],["5(?:0(?:0(?:37|43)|(?:6\\d|70|9[0168])\\d)|[12]\\d0[1-5])\\d{3}"],0,0,["501\\d{5}"],["7117\\d{4}"],["3550\\d{4}"]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,[["(?:2(?:[0346-8]\\d|1[0-8])|4(?:[013568]\\d|2[4-8]|71|90)|54(?:[3-5]\\d|71)|6\\d\\d|8(?:14|3[129]))\\d{4}",[7,8]],["5(?:4(?:2[1-389]|7[1-9])|87[15-8])\\d{4}|(?:5(?:2[5-9]|4[3-689]|[57]\\d|8[0-689]|9[0-8])|7(?:0[0-6]|3[013]))\\d{5}",[8]],["802\\d{7}|80[0-2]\\d{4}",[7,10]],["30\\d{5}",[7]],0,0,0,["219\\d{4}",[7]],["3(?:20|9\\d)\\d{4}",[7]]],"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,[["(?:3(?:0[0-4]|3[0-59])|6(?:[58][024689]|6[024-68]|7[02468]))\\d{4}",[7]],["(?:46[46]|[79]\\d\\d)\\d{4}",[7]],["800\\d{7}",[10]],["900\\d{7}",[10]],0,0,["4(?:0[01]|50)\\d{4}",[7]]],"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:1[2-9]|2[12]\\d\\d)\\d{5}"],["111\\d{6}|(?:31|77|[89][89])\\d{7}",[9]]]],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:0[01]|2\\d|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[267][1-9]|3[1-8]|[45]\\d|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-36-9]|6[0-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1346][1-9]|[27]\\d|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[0-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69]\\d|7[12]|8[1-8]))\\d{7}"],["(?:2(?:2\\d|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[267][1-9]|3[1-8]|[45]\\d|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-36-9]|6[0-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1346][1-9]|[27]\\d|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[0-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69]\\d|7[12]|8[1-8]))\\d{7}"],["8(?:00|88)\\d{7}"],["900\\d{7}"],["500\\d{7}"],0,0,0,0,["300\\d{7}"]],"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0",0,0,0,0,0,[["427[01]\\d{4}|(?:3(?:2[0-36-9]|3[0-368]|4[0-278]|5[0-24-8]|6[0-467]|7[1246-9]|8\\d|9[0-57])\\d|4(?:2[0-689]|[3-79]\\d|8[1-35689])|5(?:2[0-589]|[3468]\\d|5[0-489]|7[1-9]|9[23])|6(?:2[2-9]|3[1357-9]|[46]\\d|5[0-6]|7[0-35-9]|85|9[015-8])|7(?:[2579]\\d|3[03-68]|4[0-8]|6[5-9]|8[0-35-9])|8(?:[24][2-8]|3[2-5]|5[2-7]|6[2-589]|7[2-578]|[89][2-9])|9(?:0[57]|13|[25-7]\\d|[3489][0-8]))\\d{5}",[8,9]],["1(?:1888[689]|4400|8(?:47|8[27])[0-4])\\d{4}|1(?:0(?:[23568]\\d|4[0-6]|7[016-9]|9[0-8])|1(?:[1-5]\\d\\d|6(?:0[5-9]|[1-9]\\d)|7(?:[0-4]\\d|5[0-7]))|(?:[269]\\d|[37][1-9]|4[235-9])\\d|5(?:31|9\\d\\d)|8(?:1[23]|[236]\\d|4[06]|5(?:46|[7-9])|7[016-9]|8[01]|9[0-8]))\\d{5}",[9,10]],["1[378]00\\d{6}",[10]],["1600\\d{6}",[10]],0,0,0,0,["15(?:4(?:6[0-4]\\d|8(?:0[125]|[17]\\d|21|3[01]|4[01589]|5[014]|6[02]))|6(?:32[0-6]|78\\d))\\d{4}",[10]]]],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["2(?:[1346]\\d|5[0-2]|[78][12]|93)\\d{5}",[8]],["8[2-79]\\d{7}",[9]],["800\\d{6}",[9]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[["64426\\d{3}|6(?:1(?:2[2-7]|3[01378]|4[0-4])|254|32[0237]|4(?:27|41|5[25])|52[236-8]|626|7(?:2[2-4]|30))\\d{4,5}|6(?:1(?:(?:0\\d|2[0189]|3[24-69]|4[5-9])\\d|17|69|7[014])|2(?:17|5[0-36-8]|69|70)|3(?:17|2[14-689]|34|6[289]|7[01]|81)|4(?:17|2[0-2]|4[06]|5[0137]|69|7[01])|5(?:17|2[0459]|69|7[01])|6(?:17|25|38|42|69|7[01])|7(?:17|2[569]|3[13]|6[89]|7[01]))\\d{4}"],["(?:60|8[1245])\\d{7}",[9]],["80\\d{7}",[9]],["8701\\d{5}",[9]],0,0,0,0,["8(?:3\\d\\d|86)\\d{5}"]]],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]],0,0,0,0,0,0,[["(?:2[03-9]|3[0-5]|4[1-7]|88)\\d{4}"],["(?:[579]\\d|8[0-79])\\d{4}"],["050\\d{3}"],["36\\d{4}"]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]],0,0,0,0,0,0,[["2(?:0(?:20|3[1-8]|4[13-5]|5[14]|6[14578]|7[1-578])|1(?:4[145]|5[14]|6[14-68]|7[169]|88))\\d{4}"],["(?:23|7[0467]|[89]\\d)\\d{6}"],["08\\d{6}"],["09\\d{6}"]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1",0,0,[["(?:1(?:06|17|28|39)|3[0-2]\\d)\\d{3}"],["(?:14|3[58])\\d{4}"]]],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0",0,0,0,0,0,[["20(?:[1259]\\d|3[013-9]|4[1-8]|6[024-689]|7[1-79]|8[2-9])\\d{6}",[10]],["(?:702[0-24-9]|819[01])\\d{6}|(?:7(?:0[13-9]|[12]\\d)|8(?:0[1-9]|1[0-8])|9(?:0[1-9]|1[1-6]))\\d{7}",[10]],["800\\d{7,11}"],0,0,0,["700\\d{7,11}"]]],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]],0,0,0,0,0,0,[["2\\d{7}"],["(?:5(?:5[0-7]|[78]\\d)|6(?:20|3[035]|4[045]|5[05]|77|8[1-9]|9[059])|(?:7[5-8]|8\\d)\\d)\\d{5}"],["1800\\d{4}"]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:[035]\\d|1[13-578]|6[124-8]|7[24]|8[0-467])|2(?:[0346]\\d|2[2-46-9]|5[125]|9[479])|3(?:[03568]\\d|1[3-8]|2[01]|4[1-8])|4(?:[0356]\\d|1[1-368]|7[58]|8[15-8]|9[23579])|5(?:[0358]\\d|[19][1-9]|2[1-57-9]|4[13-8]|6[126]|7[0-3578])|7\\d\\d)\\d{6}",[9]],["(?:6[1-58]|970\\d)\\d{7}",[9,11]],["800\\d{4,7}",[7,8,9,10]],["90[069]\\d{4,7}",[7,8,9,10]],0,0,["140(?:1[035]|2[0346]|3[03568]|4[0356]|5[0358]|8[458])|(?:140(?:1[16-8]|2[259]|3[124]|4[17-9]|5[124679]|7)|8[478]\\d{6})\\d",[5,6,9]],["66\\d{7}",[9]],["(?:85|91)\\d{7}",[9]]]],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]",[["(?:2[1-4]|3[1-3578]|5[1-35-7]|6[1-4679]|7[0-8])\\d{6}",[8]],["(?:4[015-8]|9\\d)\\d{6}",[8]],["80[01]\\d{5}",[8]],["82[09]\\d{5}",[8]],["880\\d{5}",[8]],["81[23]\\d{5}",[8]],["(?:0[235-9]|81(?:0(?:0[7-9]|1\\d)|5\\d\\d))\\d{3}"],0,["85[0-5]\\d{5}",[8]],["810(?:0[0-6]|[2-8]\\d)\\d{3}",[8]]]],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0",0,0,0,0,0,[["(?:1[0-6]\\d|99[02-6])\\d{5}|(?:2[13-79]|3[135-8]|4[146-9]|5[135-7]|6[13-9]|7[15-9]|8[1-46-9]|9[1-7])[2-6]\\d{5}",[8]],["9(?:00|6[0-3]|7[0-24-6]|8[0-24-68])\\d{7}",[10]],["1(?:66001|800\\d\\d)\\d{5}",[11]]]],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]],0,0,0,0,0,0,[["444\\d{4}"],["(?:222|55[3-9]|666|777|8\\d\\d|999)\\d{4}"]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]],0,0,0,0,0,0,[["[47]\\d{3}",[4]],["(?:[56]|888[1-9])\\d{3}"]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,[["240\\d{5}|(?:3[2-79]|[49][2-9]|6[235-9]|7[2-57-9])\\d{6}",[8]],["2(?:[0-27-9]\\d|6)\\d{6,7}|2(?:1\\d|75)\\d{5}",[8,9,10]],["508\\d{6,7}|80\\d{6,8}",[8,9,10]],["(?:1[13-57-9]\\d{5}|50(?:0[08]|30|66|77|88))\\d{3}|90\\d{6,8}",[7,8,9,10]],["70\\d{7}",[9]],0,["8(?:1[16-9]|22|3\\d|4[045]|5[459]|6[235-9]|7[0-3579]|90)\\d{2,7}"]],"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]],0,0,0,0,0,0,[["2[1-6]\\d{6}",[8]],["1505\\d{4}|(?:7(?:[125-9]\\d|41)|9(?:0[1-9]|[1-9]\\d))\\d{5}",[8]],["8007\\d{4,5}|(?:500|800[05])\\d{4}"],["900\\d{5}",[8]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:1(?:0\\d|1[0479]|2[37]|3[0137]|4[17]|5[05]|6[058]|7[0167]|8[2358]|9[1389])|2(?:[0235-79]\\d|1[0-7]|4[013-9]|8[02-9])|3(?:[047-9]\\d|1[0-8]|2[0-5]|33|5[0-35]|6[068])|4(?:00|3[0-579]|4\\d|7[0-57-9])|5(?:[01]\\d|2[0-7]|[56]0|79)|7(?:0[09]|2[0-26-8]|3[03]|4[04]|5[05-9]|6[0156]|7[0-24-9]|8[4-9]|90)|8(?:09|2[89]|3\\d|4[0-24-689]|5[014]|8[02])|9(?:0[5-9]|1[0135-8]|2[036-9]|3[35-79]|40|5[0457-9]|6[05-9]|7[04-9]|8[35-8]|9\\d))\\d{4}",[7]],["(?:1[16]1|21[89]|6\\d{3}|8(?:1[01]|7[23]))\\d{4}",[7,8]],["800\\d{4,5}|(?:00800|800\\d)\\d{6}"],["(?:8(?:22|55|60|7[78]|86)|9(?:00|81))\\d{4}",[7]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,[["(?:(?:(?:4[34]|5[14])[0-8]|687)\\d|7(?:173|(?:3[0-8]|55)\\d)|8(?:10[05689]|6(?:0[06-9]|1[6-9]|29)|7(?:0[0569]|[56]0)))\\d{4}|(?:1[0-8]|4[12]|5[236]|6[1-7]|7[246]|8[2-4])\\d{6}",[8]],["9\\d{8}",[9]],["800\\d{5}",[8]],["805\\d{5}",[8]],["80[24]\\d{5}",[8]],0,0,0,0,["801\\d{5}",[8]]],"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]],0,0,0,0,0,0,[["4(?:0[4-689]|9[4-68])\\d{5}",[8]],["8[7-9]\\d{6}",[8]],["80[0-5]\\d{6}",[9]],0,0,0,["44\\d{4}",[6]],0,["499\\d{5}",[8]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,[["(?:(?:3[0-2]|4[257]|5[34]|9[78])\\d|64[1-9]|85[02-46-9])\\d{4}",[7]],["(?:7\\d|8[1-48])\\d{6}",[8]],["180\\d{4}",[7]],0,0,0,0,["27[01]\\d{4}",[7]],["2(?:0[0-57]|7[568])\\d{4}",[7]]],"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0",0,0,0,0,0,[["(?:(?:2[3-8]|3[2-68]|4[2-9]|5[2-6]|6[2-58]|7[24578])\\d{3}|88(?:22\\d\\d|42))\\d{4}|(?:2|8[2-8]\\d\\d)\\d{5}",[6,8,9,10]],["(?:8(?:1[37]|9[5-8])|9(?:0[5-9]|1[0-24-9]|[235-7]\\d|4[2-9]|8[135-9]|9[1-9]))\\d{7}",[10]],["1800\\d{7,9}",[11,12,13]]]],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0",0,0,0,0,0,[["(?:(?:21|42)[2-9]|58[126])\\d{7}|(?:2[25]|4[0146-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]\\d{6,7}|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8]))[2-9]\\d{5,6}",[9,10]],["3(?:[0-247]\\d|3[0-79]|55|64)\\d{7}",[10]],["800\\d{5}(?:\\d{3})?",[8,11]],["900\\d{5}",[8]],["122\\d{6}",[9]],0,["(?:2(?:[125]|3[2358]|4[2-4]|9[2-8])|4(?:[0-246-9]|5[3479])|5(?:[1-35-7]|4[2-467])|6(?:0[468]|[1-8])|7(?:[14]|2[236])|8(?:[16]|2[2-689]|3[23578]|4[3478]|5[2356])|9(?:1|22|3[27-9]|4[2-6]|6[3569]|9[2-7]))111\\d{6}",[11,12]]]],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["47\\d{7}|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])(?:[02-9]\\d{6}|1(?:[0-8]\\d{5}|9\\d{3}(?:\\d{2})?))",[7,9]],["2131[89]\\d{4}|21(?:1[013-5]|2\\d|3[2-9])\\d{5}|(?:45|5[0137]|6[069]|7[2389]|88)\\d{7}",[9]],["800\\d{6,7}",[9,10]],["70[01346-8]\\d{6}",[9]],0,0,["804\\d{6}",[9]],["64\\d{4,7}",[6,7,8,9]],["39\\d{7}",[9]],["801\\d{6}",[9]]]],PM:["508","00","[45]\\d{5}|(?:708|8\\d\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:4[1-35-9]|5[0-47-9]|80[6-9]\\d\\d)\\d{4}"],["(?:4[02-489]|5[02-9]|708(?:4[0-5]|5[0-6]))\\d{4}"],["80[0-5]\\d{6}",[9]],["8[129]\\d{7}",[9]]]],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939",[["(?:787|939)[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["(?:22[2-47-9]|42[45]|82[014-68]|92[3569])\\d{5}",[8]],["5[69]\\d{7}",[9]],["1800\\d{6}",[10]],0,0,0,0,0,0,["1700\\d{6}",[10]]]],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]],0,0,0,0,0,0,[["2(?:[12]\\d|3[1-689]|4[1-59]|[57][1-9]|6[1-35689]|8[1-69]|9[1256])\\d{6}"],["6(?:[06]92(?:30|9\\d)|[35]92(?:[049]\\d|3[034]))\\d{3}|(?:(?:16|6[0356])93|9(?:[1-36]\\d\\d|480))\\d{5}"],["80[02]\\d{6}"],["(?:6(?:0[178]|4[68])\\d|76(?:0[1-57]|1[2-47]|2[237]))\\d{5}"],["884[0-4689]\\d{5}"],["600\\d{6}|6[06]92(?:0\\d|3[349]|49)\\d{3}"],["70(?:38[01]|596|(?:7\\d|8[17])\\d)\\d{4}"],["6(?:222\\d|89(?:00|88|99))\\d{4}"],["30\\d{7}"],["80(?:8\\d|9[1579])\\d{5}"]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:55|77)|345|488|5(?:35|44|87)|6(?:22|54|79)|7(?:33|47)|8(?:24|55|76)|900)\\d{4}"],["(?:(?:46|83)[0-5]|(?:6[2-4689]|78)0)\\d{4}|(?:45|77|88)\\d{5}"]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,[["(?:[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36])\\d{5,7}|(?:2(?:2[4-68]|[4-68]\\d|7[15]|9[1-5])|3(?:18|3[167]|4[2357]|51|[67]\\d)|4(?:3[12]|5[13]|9[1-47])|5(?:[1-4]\\d|5[02-4])|6(?:3[1-3]|44|7[1-8])|7(?:4[0-4]|5\\d|6[1-578]|75|8[0-8])|858)\\d{5,6}",[7,8,9]],["9(?:51|6[129]|7[1-6]|8[1-7]|9[1-5])\\d{6}",[9]],["9800\\d{5,7}",[9,10,11]],0,0,0,["[2-9]0\\d{4,7}",[6,7,8,9]],0,["8700[0-4]\\d{4}",[9]]]],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]],0,0,0,0,0,0,[["4(?:1111|2022)\\d{3}|4(?:[04]\\d\\d|14[0-6]|999)\\d{4}",[8]],["[35-7]\\d{7}",[8]],["800\\d{4}|(?:0080[01]|800)\\d{6}",[7,9,11]],0,0,0,0,["2[136]\\d{5}",[7]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,[["[23][13-6]\\d{7}|(?:2(?:19\\d|[3-6]\\d9)|31\\d\\d)\\d\\d"],["(?:630|702)0\\d{5}|(?:6(?:00|2\\d)|7(?:0[013-9]|1[0-3]|[2-7]\\d|8[03-8]|9[0-39]))\\d{6}",[9]],["800\\d{6}",[9]],["90[0136]\\d{6}",[9]],0,0,["(?:37\\d|80[578])\\d{6}",[9]],0,0,["801\\d{6}",[9]]],0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0",0,0,0,0,0,[["(?:11[1-9]\\d|(?:2[389]|39)(?:0[2-9]|[2-9]\\d))\\d{3,8}|(?:1[02-9]|2[0-24-7]|3[0-8])[2-9]\\d{4,9}",[7,8,9,10,11,12]],["6(?:[0-689]|7\\d)\\d{6,7}",[8,9,10]],["800\\d{3,9}"],["(?:78\\d|90[0169])\\d{3,7}",[6,7,8,9,10]],0,0,["7[06]\\d{4,10}"]]],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,0,[["336(?:[013-9]\\d|2[013-9])\\d{5}|(?:3(?:0[12]|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15-7]|6[0-35-79]|7[1-37-9]))\\d{7}",[10]],["9\\d{9}",[10]],["8(?:0[04]|108\\d{3})\\d{7}"],["80[39]\\d{7}",[10]],["808\\d{7}",[10]]],"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:06|2[23568]\\d)\\d{6}"],["7[237-9]\\d{7}",[9]],["800\\d{6}",[9]],["900\\d{6}",[9]]]],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0",0,0,0,0,0,[["1(?:1\\d|2[24-8]|3[35-8]|4[3-68]|6[2-5]|7[235-7])\\d{6}",[9]],["579[01]\\d{5}|5(?:[013-689]\\d|7[0-8])\\d{6}",[9]],["800\\d{7}",[10]],["925\\d{6}",[9]],0,0,0,0,0,["920\\d{6}",[9]]]],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]],0,0,0,0,0,0,[["(?:1[4-79]|[23]\\d|4[0-2]|5[03]|6[0-37])\\d{3}",[5]],["48\\d{3}|(?:(?:6[89]|7[1-9]|8[4-9])\\d|9(?:1[2-9]|2[013-9]|3[0-2]|[46]\\d|5[0-46-9]|7[0-689]|8[0-79]|9[0-8]))\\d{4}"],["1[38]\\d{3}",[5]],0,0,0,0,0,["5[12]\\d{3}",[5]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,[["4[2-46]\\d{5}"],["2[125-8]\\d{5}"],["800[08]\\d{3}"],["85\\d{5}"],0,0,0,0,["971\\d{4}|(?:64|95)\\d{5}"]],"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0",0,0,0,0,0,[["1(?:5\\d|8[35-7])\\d{6}"],["(?:1[0-2]|9[0-3569])\\d{7}"]]],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0",0,0,0,0,0,[["(?:(?:[12][136]|3[356]|4[0246]|6[03]|8\\d)\\d|90[1-9])\\d{4,6}|(?:1(?:2[0-35]|4[0-4]|5[0-25-9]|7[13-6]|[89]\\d)|2(?:2[0-7]|4[0136-8]|5[0138]|7[018]|8[01]|9[0-57])|3(?:0[0-4]|1\\d|2[0-25]|4[056]|7[0-2]|8[0-3]|9[023])|4(?:1[013-8]|3[0135]|5[14-79]|7[0-246-9]|8[0156]|9[0-689])|5(?:0[0-6]|[15][0-5]|2[0-68]|3[0-4]|4\\d|6[03-5]|7[013]|8[0-79]|9[01])|6(?:1[1-3]|2[0-4]|4[02-57]|5[0-37]|6[0-3]|7[0-2]|8[0247]|9[0-356])|9(?:1[0-68]|2\\d|3[02-5]|4[0-3]|5[0-4]|[68][01]|7[0135-8]))\\d{5,6}",[7,8,9]],["7[02369]\\d{7}",[9]],["20\\d{4,7}",[6,7,8,9]],["649\\d{6}|99[1-59]\\d{4}(?:\\d{3})?|9(?:00|39|44)[1-8]\\d{3,6}",[7,8,9,10]],["75[1-8]\\d{6}",[9]],["(?:25[245]|67[3-68])\\d{9}",[12]],["10[1-8]\\d{6}",[9]],["74[02-9]\\d{6}",[9]],0,["77[0-7]\\d{6}",[9]]]],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[["662[0-24-9]\\d{4}|6(?:[0-578]\\d|6[013-57-9]|9[0-35-9])\\d{5}",[8]],["898[02-8]\\d{4}|(?:8(?:0[1-9]|[1-8]\\d|9[0-7])|9[0-8]\\d)\\d{5}",[8]],["(?:18|8)00\\d{7}",[10,11]],["1900\\d{7}",[11]],0,0,["7000\\d{7}",[11]],0,["(?:3[12]\\d|666)\\d{5}",[8]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]",[["2(?:[0-57-9]\\d|6[4-9])\\d\\d"],["[56]\\d{4}",[5]],0,0,0,0,0,0,["262\\d\\d",[5]]]],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,[["(?:[1-357][2-8]|4[24-8])\\d{6}",[8]],["65(?:[178]\\d|5[56]|6[01])\\d{4}|(?:[37][01]|4[0139]|51|6[489])\\d{6}",[8]],["80\\d{4,6}",[6,7,8]],["89[1-3]\\d{2,5}|90\\d{4,6}"],0,0,0,0,["(?:59\\d\\d|8(?:1(?:[67]\\d|8[0-589])|2(?:0\\d|2[0-37-9]|8[0-2489])|3[389]\\d))\\d{4}",[8]]],"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79",[["79\\d{6}",[8]],["(?:4[015-8]|9\\d)\\d{6}",[8]],["80[01]\\d{5}",[8]],["82[09]\\d{5}",[8]],["880\\d{5}",[8]],["81[23]\\d{5}",[8]],["(?:0[235-9]|81(?:0(?:0[7-9]|1\\d)|5\\d\\d))\\d{3}"],0,["85[0-5]\\d{5}",[8]],["810(?:0[0-6]|[2-8]\\d)\\d{3}",[8]]]],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:16|[2-9]\\d{3})|(?:(?:[3-5][1-8]\\d|819)\\d|601[1-5])\\d)\\d{4}|(?:2|[3-5][1-8])1[67]\\d{3}|[3-5][1-8]16\\d\\d"],["909[1-9]\\d{5}|9(?:0[1-8]|1[0-24-9]|4[03-57-9]|5\\d)\\d{6}",[9]],["800\\d{6}",[9]],["9(?:00|[78]\\d)\\d{6}",[9]],0,0,["96\\d{7}",[9]],["9090\\d{3}",[7]],["6(?:02|5[0-4]|9[0-6])\\d{6}",[9]],["8[5-9]\\d{7}",[9]]]],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0",0,0,0,0,0,[["22[2-4][2-9]\\d{4}"],["(?:25|3[0-5]|66|7[1-9]|8[08]|9[09])\\d{6}"]]],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1",0,0,[["0549(?:8[0157-9]|9\\d)\\d{4}",[10]],["6[16]\\d{6}",[8]],0,["7[178]\\d{6}",[8]],0,0,0,0,["5[158]\\d{6}",[8]]]],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]],0,0,0,0,0,0,[["3(?:0(?:1[0-2]|80)|282|3(?:8[1-9]|9[3-9])|611)\\d{5}"],["7(?:(?:[06-8]\\d|[19]0|21)\\d|5(?:0[01]|[19]0|2[25]|3[356]|[4-7]\\d|8[35]))\\d{5}"],["800\\d{6}"],["88[4689]\\d{6}"],0,0,0,0,["(?:3(?:392|9[01]\\d)\\d|93(?:3[13]0|929))\\d{4}"],["81[02468]\\d{6}"]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0",0,0,0,0,0,[["(?:1\\d|2[0-79]|3[0-46-8]|4[0-7]|5[57-9])\\d{5}|(?:[134]\\d|8[125])\\d{4}",[6,7]],["(?:(?:15|(?:3[59]|4[89]|6\\d|7[679]|8[08])\\d|9(?:0\\d|[2-9]))\\d|2(?:4\\d|8))\\d{5}|(?:[67]\\d\\d|904)\\d{5}",[7,8,9]]]],SR:["597","00","(?:[2-5]|[6-8]\\d|90)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]],0,0,0,0,0,0,[["(?:2[1-3]|3[0-7]|4\\d|5[2-58])\\d{4}",[6]],["(?:6[08]|7[124-7]|8[1-9])\\d{5}",[7]],["80\\d{5}",[7]],["90\\d{5}",[7]],0,0,0,0,["56\\d{4}",[6]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0",0,0,0,0,0,[["1[89]\\d{7}"],["(?:12|9[1257-9])\\d{7}"]]],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]],0,0,0,0,0,0,[["22\\d{5}"],["900[5-9]\\d{3}|9(?:0[1-9]|[89]\\d)\\d{4}"]]],SV:["503","00","[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,[["2(?:79(?:0[0347-9]|[1-9]\\d)|89(?:0[024589]|[1-9]\\d))\\d{3}|2(?:[1-69]\\d|[78][0-8])\\d{5}",[8]],["[67]\\d{7}",[8]],["800\\d{8}|80[01]\\d{4}",[7,11]],["900\\d{4}(?:\\d{4})?",[7,11]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721",[["7215(?:4[2-8]|8[239]|9[056])\\d{4}"],["7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0",0,0,0,0,0,[["21\\d{6,7}|(?:1(?:[14]\\d|[2356])|2[235]|3(?:[13]\\d|4)|4[134]|5[1-3])\\d{6}"],["(?:50|9[1-9])\\d{7}",[9]]]],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]],0,0,0,0,0,0,[["[23][2-5]\\d{6}",[8]],["7[5-9]\\d{6}",[8]],["0800\\d{4}",[8]],["900\\d{6}",[9]],0,0,0,0,["70\\d{6}",[8]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8",[["8\\d{3}"]]],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649",[["649(?:266|712|9(?:4\\d|50))\\d{4}"],["649(?:2(?:3[129]|4[1-79])|3\\d\\d|4[34][1-3])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["649(?:71[01]|966)\\d{4}"]]],TD:["235","00|16","(?:22|30|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,[["22(?:[37-9]0|5[0-5]|6[89])\\d{4}"],["(?:30|[69]\\d|77|8[56])\\d{6}"]],"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]],0,0,0,0,0,0,[["2(?:2[2-7]|3[23]|4[45]|55|6[67]|77)\\d{5}"],["(?:7[0-29]|9[0-36-9])\\d{6}"]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["(?:1[0689]|2\\d|3[2-9]|4[2-5]|5[2-6]|7[3-7])\\d{6}",[8]],["67(?:1[0-8]|2[4-7])\\d{5}|(?:14|6[1-6]|[89]\\d)\\d{7}",[9]],["(?:001800\\d|1800)\\d{6}",[10,13]],["1900\\d{6}",[10]],0,0,0,0,["6[08]\\d{7}",[9]]]],TJ:["992","810","[0-57-9]\\d{8}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,[["(?:3(?:1[3-5]|2[245]|3[12]|4[24-7]|5[25]|72)|4(?:46|74|87))\\d{6}"],["(?:33[03-9]|4(?:1[18]|4[02-479])|81[1-9])\\d{6}|(?:[09]\\d|1[0-27-9]|2[0-27]|[34]0|5[05]|7[01578]|8[078])\\d{7}"]],"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7],0,0,0,0,0,0,0,[["(?:2[2-4]|[34]\\d)\\d{2,5}"],["7[2-4]\\d{2,5}"]]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]],0,0,0,0,0,0,[["(?:2[1-5]|3[1-9]|4[1-4])\\d{5}",[7]],["7[2-8]\\d{6}",[8]],["80\\d{5}",[7]],["90\\d{5}",[7]],["70\\d{5}",[7]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,[["(?:1(?:2\\d|3[1-9])|2(?:22|4[0-35-8])|3(?:22|4[03-9])|4(?:22|3[128]|4\\d|6[15])|5(?:22|5[7-9]|6[014-689]))\\d{5}"],["(?:6\\d|71)\\d{6}"]],"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]],0,0,0,0,0,0,[["81200\\d{3}|(?:3[0-2]|7\\d)\\d{6}"],["3(?:001|[12]40)\\d{4}|(?:(?:[259]\\d|4[0-8])\\d|3(?:1[1-35]|6[0-4]|91))\\d{5}"],["8010\\d{4}"],["88\\d{6}"],0,0,0,0,0,["8[12]10\\d{4}"]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]],0,0,0,0,0,0,[["(?:2\\d|3[0-8]|4[0-4]|50|6[09]|7[0-24-69]|8[05])\\d{3}",[5]],["(?:5(?:4[0-5]|5[4-6])|6(?:[09]\\d|3[02]|8[15-9])|(?:7\\d|8[46-9])\\d|999)\\d{4}",[7]],["0800\\d{3}",[7]],0,0,0,0,0,["55[0-37-9]\\d{4}",[7]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0",0,0,0,0,0,[["(?:2(?:[13][26]|[28][2468]|[45][268]|[67][246])|3(?:[13][28]|[24-6][2468]|[78][02468]|92)|4(?:[16][246]|[23578][2468]|4[26]))\\d{7}",[10]],["561(?:011|61\\d)\\d{4}|5(?:0[15-7]|1[06]|24|[34]\\d|5[1-59]|9[46])\\d{7}",[10]],["8(?:00\\d{7}(?:\\d{2,3})?|11\\d{7})",[10,12,13]],["(?:8[89]8|900)\\d{7}",[10]],["592(?:21[12]|461)\\d{4}",[10]],0,["444\\d{4}",[7]],["512\\d{7}",[10]],["850\\d{7}",[10]]]],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868",[["868(?:2(?:01|1[5-9]|[23]\\d|4[0-2])|6(?:0[7-9]|1[02-8]|2[1-9]|[3-69]\\d|7[0-79])|82[124])\\d{4}"],["868(?:(?:2[5-9]|3\\d)\\d|4(?:3[0-6]|[6-9]\\d)|6(?:20|78|8\\d)|7(?:0[1-9]|1[02-9]|[2-9]\\d))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],["868619\\d{4}"]]],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]],0,0,0,0,0,0,[["2[02-9]\\d{3}",[5]],["(?:7[01]\\d|90)\\d{4}",[6,7]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["(?:2[2-8]\\d|370|55[01]|7[1-9])\\d{6}|4(?:(?:0(?:0[1-9]|[2-48]\\d)|1[023]\\d)\\d{4,5}|(?:[239]\\d\\d|4(?:0[56]|12|49))\\d{5})|6(?:[01]\\d{7}|4(?:0[56]|12|24|4[09])\\d{4,5})|8(?:(?:2(?:3\\d|4[0-269]|[578]0|66)|36[24-9]|90\\d\\d)\\d{4}|4(?:0[56]|12|24|4[09])\\d{4,5})|(?:2(?:2(?:0\\d\\d|4(?:0[68]|[249]0|3[0-467]|5[0-25-9]|6[0235689]))|(?:3(?:[09]\\d|1[0-4])|(?:4\\d|5[0-49]|6[0-29]|7[0-5])\\d)\\d)|(?:(?:3[2-9]|5[2-8]|6[0-35-79]|8[7-9])\\d\\d|4(?:2(?:[089]\\d|7[1-9])|(?:3[0-4]|[78]\\d|9[01])\\d))\\d)\\d{3}",[8,9]],["(?:40001[0-2]|9[0-8]\\d{4})\\d{3}",[9]],["80[0-79]\\d{6}|800\\d{5}",[8,9]],["20(?:[013-9]\\d\\d|2)\\d{4}",[7,9]],["99\\d{7}",[9]],0,["50[0-46-9]\\d{6}",[9]],0,["7010(?:[0-2679]\\d|3[0-7]|8[0-5])\\d{5}|70\\d{8}",[10,11]]],0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0",0,0,0,0,0,[["2[2-8]\\d{7}"],["(?:6[125-9]|7[13-9])\\d{7}"],["80[08]\\d{6}"],["90\\d{7}"],0,0,0,0,["41\\d{7}"],["8(?:40|6[01])\\d{6}"]]],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,[["(?:3[1-8]|4[13-8]|5[1-7]|6[12459])\\d{7}",[9]],["790\\d{6}|(?:39|50|6[36-8]|7[1-357]|9[1-9])\\d{7}",[9]],["800[1-8]\\d{5,6}"],["900[239]\\d{5,6}"],0,0,0,0,["89[1-579]\\d{6}",[9]]],"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0",0,0,0,0,0,[["20(?:(?:240|30[67])\\d|6(?:00[0-2]|30[0-4]))\\d{3}|(?:20(?:[017]\\d|2[5-9]|3[1-4]|5[0-4]|6[15-9])|[34]\\d{3})\\d{5}"],["72[48]0\\d{5}|7(?:[014-8]\\d|2[067]|36|9[0-289])\\d{6}"],["800[1-3]\\d{5}"],["90[1-3]\\d{6}"]]],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["3052(?:0[0-8]|[1-9]\\d)\\d{4}|(?:2742|305[3-9])\\d{6}|(?:472|983)[2-47-9]\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[0135-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["305209\\d{4}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,[["(?:1(?:770|9(?:20|[89]7))|(?:2\\d|4[2-7])\\d\\d)\\d{4}",[8]],["9[1-9]\\d{6}",[8]],["0004\\d{2,9}|(?:405|80[05])\\d{4}",[6,7,8,9,10,11,12,13]],["90[0-8]\\d{4}",[7]],0,0,["21\\d{2,3}",[4,5]]],"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]],0,0,0,0,0,0,[["(?:55\\d\\d|6(?:1(?:22|3[124]|4[1-4]|5[1-3578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|[69]\\d\\d|7(?:[23]\\d|7[69]))|7(?:0(?:5[4-9]|6[0146]|7[124-6]|9[135-8])|[168]\\d\\d|2(?:22|3[13-57-9]|4[1-3579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|9(?:22|5[1-9])))\\d{5}"],["(?:(?:[25]0|33|8[78]|9[0-57-9])\\d{3}|6(?:1(?:2(?:2[01]|98)|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:(?:11|7\\d)\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4]))|5(?:19[01]|2(?:27|9[26])|(?:30|59|7\\d)\\d)|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|(?:3[79]|9[0-3])\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79]))|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079])))|7(?:[07]\\d{3}|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|(?:33|9[4-6])\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078]))|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0-27]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[02569]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07]))))\\d{4}"]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698",[["06698\\d{1,6}",[6,7,8,9,10,11]],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784",[["784(?:266|3(?:6[6-9]|7\\d|8[0-6])|4(?:38|5[0-36-8]|8[0-8])|5(?:55|7[0-2]|93)|638|784)\\d{4}"],["784(?:4(?:3[0-5]|5[45]|89|9[0-8])|5(?:2[6-9]|3[0-4])|720)\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["78451[0-2]\\d{4}"]]],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:12|3[457-9]|[467]\\d|[58][1-9]|9[1-6])|[4-6]00)\\d{7}"],["4(?:1[24-8]|2[246])\\d{7}"],["800\\d{7}"],["90[01]\\d{7}"],0,0,["501\\d{7}"]]],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284",[["284(?:229|4(?:22|9[45])|774|8(?:52|6[459]))\\d{4}"],["284(?:245|3(?:0[0-3]|4[0-7]|68|9[34])|4(?:4[0-6]|68|9[69])|5(?:4[0-7]|68|9[69]))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340",[["340(?:2(?:0\\d|10|2[06-8]|4[49]|77)|3(?:32|44)|4(?:2[23]|44|7[34]|89)|5(?:1[34]|55)|6(?:2[56]|4[23]|77|9[023])|7(?:1[2-57-9]|2[57]|7\\d)|884|998)\\d{4}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0",0,0,0,0,0,[["2(?:0[3-9]|1[0-689]|2[0-25-9]|[38][2-9]|4[2-8]|5[124-9]|6[0-39]|7[0-7]|9[0-4679])\\d{7}",[10]],["(?:5(?:2[238]|59)|89[6-9]|99[013-9])\\d{6}|(?:3\\d|5[1689]|7[06-9]|8[1-8]|9[0-8])\\d{7}",[9]],["1800\\d{4,6}|12(?:0[13]|28)\\d{4}",[8,9,10]],["1900\\d{4,6}",[8,9,10]],0,0,["(?:[17]99|80\\d)\\d{4}|69\\d{5,6}",[7,8]],0,["672\\d{6}",[9]]]],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]],0,0,0,0,0,0,[["(?:38[0-8]|48[4-9])\\d\\d|(?:2[02-9]|3[4-7]|88)\\d{3}",[5]],["(?:[58]\\d|7[013-7])\\d{5}",[7]],["81[18]\\d\\d",[5]],0,0,0,["(?:3[03]|900\\d)\\d{3}"],0,["9(?:0[1-9]|1[01])\\d{4}",[7]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]],0,0,0,0,0,0,[["72\\d{4}",[6]],["(?:72|8[23])\\d{4}",[6]],["80[0-5]\\d{6}",[9]],0,0,["[48]0\\d{4}",[6]],0,0,["9[23]\\d{4}",[6]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]],0,0,0,0,0,0,[["6[1-9]\\d{3}|(?:[2-5]|60)\\d{4}",[5,6]],["(?:7[1-35-8]|8(?:[3-7]|9\\d{3}))\\d{5}",[7,10]],["800\\d{3}",[6]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0",0,0,0,0,0,[["38\\d{6,10}|(?:2[89]|39)(?:0\\d{5,6}|[1-9]\\d{5})"],["4[3-9]\\d{6}",[8]],["800\\d{5}",[8]],["900\\d{5}",[8]]]],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["78[0-7]\\d{4}|17\\d{6}|(?:[12][2-68]|3[2358]|4[2-58]|5[2-6]|6[3-58]|7[24-6])\\d{5}",[7,8]],["7[01378]\\d{7}",[9]]]],YT:["262","00","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:0330|4302)|52087)0\\d{3}|(?:1[0-8]|2[1-378]|3[1-69]|4\\d|5[1346-8])\\d{7}",[9]],["(?:1(?:3492[0-25]|4495[0235]|549(?:20|5[01]))|4[34]492[01])\\d{3}|8[1-4]\\d{3,7}|(?:2[27]|47|54)4950\\d{3}|(?:1(?:049[2-4]|9[12]\\d\\d)|(?:50[0-2]|6\\d\\d|7(?:[0-46-9]\\d|5[0-4]))\\d\\d|8(?:5\\d{3}|7(?:08[67]|158|28[5-9]|310)))\\d{4}|(?:1[6-8]|28|3[2-69]|4[025689]|5[36-8])4920\\d{3}|(?:12|[2-5]1)492\\d{4}",[5,6,7,8,9]],["80\\d{7}",[9]],["(?:86[2-9]|9[0-2]\\d)\\d{6}",[9]],0,0,["861\\d{6,7}",[9,10]],0,["87(?:08[0-589]|15[0-79]|28[0-4]|31[1-9])\\d{4}|87(?:[02][0-79]|1[0-46-9]|3[02-9]|[4-9]\\d)\\d{5}",[9]],["860\\d{6}",[9]]]],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0",0,0,0,0,0,[["21[1-8]\\d{6}"],["(?:[59][5-8]|7[5-9])\\d{7}"],["800\\d{6}"],0,0,0,0,0,["63\\d{7}"]]],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:(?:3\\d|9)\\d|[4-8])|2(?:(?:(?:0(?:2[014]|5)|(?:2[0157]|31|84|9)\\d\\d|[56](?:[14]\\d\\d|20)|7(?:[089]|2[03]|[35]\\d\\d))\\d|4(?:2\\d\\d|8))\\d|1(?:2|[39]\\d{4}))|3(?:(?:123|(?:29\\d|92)\\d)\\d\\d|7(?:[19]|[56]\\d))|5(?:0|1[2-478]|26|[37]2|4(?:2\\d{3}|83)|5(?:25\\d\\d|[78])|[689]\\d)|6(?:(?:[16-8]21|28|52[013])\\d\\d|[39])|8(?:[1349]28|523)\\d\\d)\\d{3}|(?:4\\d\\d|9[2-9])\\d{4,5}|(?:(?:2(?:(?:(?:0|8[146])\\d|7[1-7])\\d|2(?:[278]\\d|92)|58(?:2\\d|3))|3(?:[26]|9\\d{3})|5(?:4\\d|5)\\d\\d)\\d|6(?:(?:(?:[0-246]|[78]\\d)\\d|37)\\d|5[2-8]))\\d\\d|(?:2(?:[569]\\d|8[2-57-9])|3(?:[013-59]\\d|8[37])|6[89]8)\\d{3}"],["7(?:[1278]\\d|3[1-9])\\d{6}",[9]],["80(?:[01]\\d|20|8[0-8])\\d{3}",[7]],0,0,0,0,0,["86(?:1[12]|22|30|44|55|77|8[368])\\d{6}",[10]]]]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function fm(e,t){e=e.split("-"),t=t.split("-");for(var n=e[0].split("."),r=t[0].split("."),i=0;i<3;i++){var o=Number(n[i]),a=Number(r[i]);if(o>a)return 1;if(a>o)return-1;if(!isNaN(o)&&isNaN(a))return 1;if(isNaN(o)&&!isNaN(a))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}var hm={}.constructor;function pm(e){return null!=e&&e.constructor===hm}function mm(e){return(mm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $m(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,vm(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vm(e){var t=function(e,t){if("object"!=mm(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=mm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==mm(t)?t:t+""}var ym=" ext. ",bm=/^\d+$/,xm=function(){return $m(function e(t){gm(this,e),Nm(t),this.metadata=t,Om.call(this,t)},[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(e){return"001"!==e})}},{key:"getCountryMetadata",value:function(e){return this.metadata.countries[e]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(e){return void 0!==this.getCountryMetadata(e)}},{key:"hasCallingCode",value:function(e){if(this.getCountryCodesForCallingCode(e))return!0;if(this.nonGeographic()){if(this.nonGeographic()[e])return!0}else{var t=this.countryCallingCodes()[e];if(t&&1===t.length&&"001"===t[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(e){return this.nonGeographic()?!!this.nonGeographic()[e]:!this.getCountryCodesForCallingCode(e)}},{key:"country",value:function(e){return this.selectNumberingPlan(e)}},{key:"selectNumberingPlan",value:function(e,t){if(e&&bm.test(e)&&(t=e,e=null),e&&"001"!==e){if(!this.hasCountry(e))throw new Error("Unknown country: ".concat(e));this.numberingPlan=new wm(this.getCountryMetadata(e),this)}else if(t){if(!this.hasCallingCode(t))throw new Error("Unknown calling code: ".concat(t));this.numberingPlan=new wm(this.getNumberingPlanMetadata(t),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(e){var t=this.countryCallingCodes()[e];if(t){if(1===t.length&&3===t[0].length)return;return t}}},{key:"getCountryCodeForCallingCode",value:function(e){var t=this.getCountryCodesForCallingCode(e);if(t)return t[0]}},{key:"getNumberingPlanMetadata",value:function(e){var t=this.getCountryCodeForCallingCode(e);if(t)return this.getCountryMetadata(t);if(this.nonGeographic()){var n=this.nonGeographic()[e];if(n)return n}else{var r=this.countryCallingCodes()[e];if(r&&1===r.length&&"001"===r[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(e){return this.numberingPlan.type(e)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(e){return this.selectNumberingPlan(e)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}])}(),wm=function(){return $m(function e(t,n){gm(this,e),this.globalMetadataObject=n,this.metadata=t,Om.call(this,n.metadata)},[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(e){return e[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var e=this;return(this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[]).map(function(t){return new _m(t,e)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(e){return e[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return(!this.types()||0!==this.types().length)&&!!this.types()}},{key:"type",value:function(e){if(this.hasTypes()&&Em(this.types(),e))return new Sm(Em(this.types(),e),this)}},{key:"ext",value:function(){return this.v1||this.v2?ym:this.metadata[13]||ym}}])}(),_m=function(){return $m(function e(t,n){gm(this,e),this._format=t,this.metadata=n},[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||Cm.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])}(),Cm=/^\(?\$1\)?$/,Sm=function(){return $m(function e(t,n){gm(this,e),this.type=t,this.metadata=n},[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])}();function Em(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}function Nm(e){if(!e)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!pm(e)||!pm(e.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(pm(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+Tm(e)+": "+e,"."))}var Tm=function(e){return mm(e)};function Am(e,t){if((t=new xm(t)).hasCountry(e))return t.selectNumberingPlan(e).countryCallingCode();throw new Error("Unknown country: ".concat(e))}function Om(e){var t=e.version;"number"==typeof t?(this.v1=1===t,this.v2=2===t,this.v3=3===t,this.v4=4===t):t?-1===fm(t,"1.2.0")?this.v2=!0:-1===fm(t,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}function Im(e,t,n){return function(e,t,n,r){t&&(r=new xm(r.metadata)).selectNumberingPlan(t);var i=r.type(n),o=i&&i.possibleLengths()||r.possibleLengths();if(!o)return"IS_POSSIBLE";var a=e.length,s=o[0];if(s===a)return"IS_POSSIBLE";if(s>a)return"TOO_SHORT";if(o[o.length-1]<a)return"TOO_LONG";return o.indexOf(a,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}(e,t,void 0,n)}function km(e,t,n){return"IS_POSSIBLE"===Im(e,t,n)}function jm(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}function Rm(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Pm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pm(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Pm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Dm=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function Lm(e,t,n){if(t=t||{},e.country||e.countryCallingCode){(n=new xm(n)).selectNumberingPlan(e.country,e.countryCallingCode);var r=t.v2?e.nationalNumber:e.phone;if(jm(r,n.nationalNumberPattern())){if(Mm(r,"FIXED_LINE",n))return n.type("MOBILE")&&""===n.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":n.type("MOBILE")?Mm(r,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var i,o=Rm(Dm);!(i=o()).done;){var a=i.value;if(Mm(r,a,n))return a}}}}function Mm(e,t,n){return!(!(t=n.type(t))||!t.pattern())&&(!(t.possibleLengths()&&t.possibleLengths().indexOf(e.length)<0)&&jm(e,t.pattern()))}function Um(e,t,n){var r=new xm(n).getCountryCodesForCallingCode(e);return r?r.filter(function(e){return function(e,t,n){var r=new xm(n);if(r.selectNumberingPlan(t),r.numberingPlan.possibleLengths().indexOf(e.length)>=0)return!0;return!1}(t,e,n)}):[]}var Fm="0-90-9٠-٩۰-۹",Bm="".concat("-‐-―−ー-").concat("//").concat("..").concat("  ­​⁠ ").concat("()()[]\\[\\]").concat("~⁓∼~"),qm=new RegExp("(["+Fm+"])");function zm(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Hm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hm(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Hm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Wm(e,t){var n=t.nationalNumber,r=t.metadata,i=r.getCountryCodesForCallingCode(e);if(i)return 1===i.length?i[0]:function(e,t){var n=t.countries,r=t.metadata;r=new xm(r);for(var i,o=zm(n);!(i=o()).done;){var a=i.value;if(r.selectNumberingPlan(a),r.leadingDigits()){if(e&&0===e.search(r.leadingDigits()))return a}else if(Lm({phone:e,country:a},void 0,r.metadata))return a}}(n,{countries:i,metadata:r.metadata})}function Gm(e,t,n){var r=function(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(e);if(r){var i,o,a,s=r.length-1,d=s>0&&r[s];if(t.nationalPrefixTransformRule()&&d)i=e.replace(n,t.nationalPrefixTransformRule()),s>1&&(o=r[1]);else{var l=r[0];i=e.slice(l.length),d&&(o=r[1])}if(d){var u=e.indexOf(r[1]);e.slice(0,u)===t.numberingPlan.nationalPrefix()&&(a=t.numberingPlan.nationalPrefix())}else a=r[0];return{nationalNumber:i,nationalPrefix:a,carrierCode:o}}}return{nationalNumber:e}}(e,n),i=r.carrierCode,o=r.nationalNumber;if(o!==e){if(!function(e,t,n){if(jm(e,n.nationalNumberPattern())&&!jm(t,n.nationalNumberPattern()))return!1;return!0}(e,o,n))return{nationalNumber:e};if(n.numberingPlan.possibleLengths()&&(t||(t=Wm(n.numberingPlan.callingCode(),{nationalNumber:o,metadata:n})),!function(e,t,n){switch(Im(e,t,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(o,t,n)))return{nationalNumber:e}}return{nationalNumber:o,carrierCode:i}}function Vm(e,t,n,r,i){if(!e)return{};var o;if("+"!==e[0]){var a=function(e,t,n,r){if(t){var i=new xm(r);i.selectNumberingPlan(t,n);var o=new RegExp(i.IDDPrefix());if(0===e.search(o)){var a=(e=e.slice(e.match(o)[0].length)).match(qm);if(!(a&&null!=a[1]&&a[1].length>0&&"0"===a[1]))return e}}}(e,n,r,i);if(!a||a===e){if(n||r){var s=function(e,t,n,r,i){var o=n?Am(n,i):r;if(0===e.indexOf(o)){(i=new xm(i)).selectNumberingPlan(n,o);var a=e.slice(o.length),s=Gm(a,t,i).nationalNumber,d=Gm(e,t,i).nationalNumber;if(!jm(d,i.nationalNumberPattern())&&jm(s,i.nationalNumberPattern())||"TOO_LONG"===Im(d,t,i))return{countryCallingCode:o,number:a}}return{number:e}}(e,t,n,r,i),d=s.countryCallingCode,l=s.number;if(d)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:d,number:l}}return{number:e}}o=!0,e="+"+a}if("0"===e[1])return{};i=new xm(i);for(var u=2;u-1<=3&&u<=e.length;){var c=e.slice(1,u);if(i.hasCallingCode(c))return i.selectNumberingPlan(c),{countryCallingCodeSource:o?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:c,number:e.slice(u)};u++}return{}}var Km=/(\$\d)/;function Ym(e,t,n){var r=n.useInternationalFormat,i=n.withNationalPrefix,o=e.replace(new RegExp(t.pattern()),r?t.internationalFormat():i&&t.nationalPrefixFormattingRule()?t.format().replace(Km,t.nationalPrefixFormattingRule()):t.format());return r?function(e){return e.replace(new RegExp("[".concat(Bm,"]+"),"g")," ").trim()}(o):o}var Xm=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;var Jm=function(e){return"([".concat(Fm,"]{1,").concat(e,"})")};function Zm(e){var t="[  \\t,]*",n="[:\\..]?[  \\t,-]*",r="#?",i="[  \\t]*";return";ext="+Jm("20")+"|"+(t+"(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)"+n+Jm("20")+r)+"|"+(t+"(?:[xx##~~]|int|int)"+n+Jm("9")+r)+"|"+("[- ]+"+Jm("6")+"#")+"|"+(i+"(?:,{2}|;)"+n+Jm("15")+r)+"|"+(i+"(?:,)+"+n+Jm("9")+r)}var Qm="["+Fm+"]{2}",eg="[++]{0,1}(?:["+Bm+"]*["+Fm+"]){3,}["+Bm+Fm+"]*",tg=new RegExp("^[++]{0,1}(?:["+Bm+"]*["+Fm+"]){1,2}$","i"),ng=eg+"(?:"+Zm()+")?",rg=new RegExp("^"+Qm+"$|^"+ng+"$","i");var ig={formatExtension:function(e,t,n){return"".concat(e).concat(n.ext()).concat(t)}};function og(e,t,n,r){if(n=n?function(){for(var e=1,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(;e<n.length;){if(n[e])for(var i in n[e])n[0][i]=n[e][i];e++}return n[0]}({},ig,n):ig,r=new xm(r),e.country&&"001"!==e.country){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)return e.phone||"";r.selectNumberingPlan(e.countryCallingCode)}var i,o=r.countryCallingCode(),a=n.v2?e.nationalNumber:e.phone;switch(t){case"NATIONAL":return a?sg(i=ag(a,e.carrierCode,"NATIONAL",r,n),e.ext,r,n.formatExtension):"";case"INTERNATIONAL":return a?(i=ag(a,null,"INTERNATIONAL",r,n),sg(i="+".concat(o," ").concat(i),e.ext,r,n.formatExtension)):"+".concat(o);case"E.164":return"+".concat(o).concat(a);case"RFC3966":return function(e){var t=e.number,n=e.ext;if(!t)return"";if("+"!==t[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(n?";ext="+n:"")}({number:"+".concat(o).concat(a),ext:e.ext});case"IDD":if(!n.fromCountry)return;var s=function(e,t,n,r,i){var o=Am(r,i.metadata);if(o===n){var a=ag(e,t,"NATIONAL",i);return"1"===n?n+" "+a:a}var s=function(e,t,n){var r=new xm(n);return r.selectNumberingPlan(e,t),r.defaultIDDPrefix()?r.defaultIDDPrefix():Xm.test(r.IDDPrefix())?r.IDDPrefix():void 0}(r,void 0,i.metadata);if(s)return"".concat(s," ").concat(n," ").concat(ag(e,null,"INTERNATIONAL",i))}(a,e.carrierCode,o,n.fromCountry,r);return sg(s,e.ext,r,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function ag(e,t,n,r,i){var o,a,s=(o=r.formats(),a=e,function(e,t){for(var n=0;n<e.length;){if(t(e[n]))return e[n];n++}}(o,function(e){if(e.leadingDigitsPatterns().length>0){var t=e.leadingDigitsPatterns()[e.leadingDigitsPatterns().length-1];if(0!==a.search(t))return!1}return jm(a,e.pattern())}));return s?Ym(e,s,{useInternationalFormat:"INTERNATIONAL"===n,withNationalPrefix:!s.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!i||!1!==i.nationalPrefix}):e}function sg(e,t,n,r){return t?r(e,t,n):e}function dg(e){return(dg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ug(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lg(Object(n),!0).forEach(function(t){cg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cg(e,t,n){return(t=hg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fg(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hg(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function hg(e){var t=function(e,t){if("object"!=dg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=dg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==dg(t)?t:t+""}var pg=function(){return fg(function e(t,n,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new TypeError("First argument is required");if("string"!=typeof t)throw new TypeError("First argument must be a string");if("+"===t[0]&&!n)throw new TypeError("`metadata` argument not passed");if(pm(n)&&pm(n.countries)){r=n;var i=t;if(!gg.test(i))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var o=Vm(i,void 0,void 0,void 0,r);if(t=o.countryCallingCode,!(n=o.number))throw new Error("Invalid `number` argument passed: too short")}if(!n)throw new TypeError("`nationalNumber` argument is required");if("string"!=typeof n)throw new TypeError("`nationalNumber` argument must be a string");Nm(r);var a=function(e,t){var n,r,i=new xm(t);mg(e)?(n=e,i.selectNumberingPlan(n),r=i.countryCallingCode()):r=e;return{country:n,countryCallingCode:r}}(t,r),s=a.country,d=a.countryCallingCode;this.country=s,this.countryCallingCode=d,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}},[{key:"setExt",value:function(e){this.ext=e}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Um(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return function(e,t,n){if(void 0===t&&(t={}),n=new xm(n),t.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!n.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));n.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(e.countryCallingCode)}}if(n.possibleLengths())return km(e.phone||e.nationalNumber,e.country,n);if(e.countryCallingCode&&n.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return e=this,t={v2:!0},n=this.getMetadata(),t=t||{},(n=new xm(n)).selectNumberingPlan(e.country,e.countryCallingCode),n.hasTypes()?void 0!==Lm(e,t,n.metadata):jm(t.v2?e.nationalNumber:e.phone,n.nationalNumberPattern());var e,t,n}},{key:"isNonGeographic",value:function(){return new xm(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:"getType",value:function(){return Lm(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(e,t){return og(this,e,t?ug(ug({},t),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(e){return this.format("NATIONAL",e)}},{key:"formatInternational",value:function(e){return this.format("INTERNATIONAL",e)}},{key:"getURI",value:function(e){return this.format("RFC3966",e)}}])}(),mg=function(e){return/^[A-Z]{2}$/.test(e)};var gg=/^\+\d+$/;function $g(e){return($g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vg(e,t,n){return t=wg(t),function(e,t){if(t&&("object"==$g(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,bg()?Reflect.construct(t,n||[],wg(e).constructor):t.apply(e,n))}function yg(e){var t="function"==typeof Map?new Map:void 0;return yg=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(bg())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&xg(i,n.prototype),i}(e,arguments,wg(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),xg(n,e)},yg(e)}function bg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(bg=function(){return!!e})()}function xg(e,t){return(xg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function wg(e){return(wg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _g=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=vg(this,t,[e]),Object.setPrototypeOf(n,t.prototype),n.name=n.constructor.name,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xg(e,t)}(t,e),n=t,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(yg(Error)),Cg=new RegExp("(?:"+Zm()+")$","i");var Sg={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function Eg(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ng(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ng(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ng(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Tg(e){for(var t,n="",r=Eg(e.split(""));!(t=r()).done;){n+=Ag(t.value,n)||""}return n}function Ag(e,t,n){if("+"===e){if(t)return;return"+"}return function(e){return Sg[e]}(e)}var Og="(["+Fm+"]|[\\-\\.\\(\\)]?)",Ig=new RegExp("^\\+"+Og+"*["+Fm+"]"+Og+"*$","g"),kg=new RegExp("^("+("["+Fm+"]+((\\-)*["+Fm+"])*")+"\\.)*"+("[a-zA-Z]+((\\-)*["+Fm+"])*")+"\\.?$","g"),jg="tel:",Rg=";phone-context=";function Pg(e,t){var n,r=t.extractFormattedPhoneNumber,i=function(e){var t=e.indexOf(Rg);if(t<0)return null;var n=t+15;if(n>=e.length)return"";var r=e.indexOf(";",n);return r>=0?e.substring(n,r):e.substring(n)}(e);if(!function(e){return null===e||0!==e.length&&(Ig.test(e)||kg.test(e))}(i))throw new _g("NOT_A_NUMBER");if(null===i)n=r(e)||"";else{n="","+"===i.charAt(0)&&(n+=i);var o,a=e.indexOf(jg);o=a>=0?a+4:0;var s=e.indexOf(Rg);n+=e.substring(o,s)}var d=n.indexOf(";isub=");if(d>0&&(n=n.substring(0,d)),""!==n)return n}var Dg=new RegExp("[++"+Fm+"]"),Lg=new RegExp("[^"+Fm+"#]+$");function Mg(e,t,n){if(t=t||{},n=new xm(n),t.defaultCountry&&!n.hasCountry(t.defaultCountry)){if(t.v2)throw new _g("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(t.defaultCountry))}var r=function(e,t,n){var r=Pg(e,{extractFormattedPhoneNumber:function(e){return function(e,t,n){if(!e)return;if(e.length>250){if(n)throw new _g("TOO_LONG");return}if(!1===t)return e;var r=e.search(Dg);if(r<0)return;return e.slice(r).replace(Lg,"")}(e,n,t)}});if(!r)return{};if(!function(e){return e.length>=2&&rg.test(e)}(r))return function(e){return tg.test(e)}(r)?{error:"TOO_SHORT"}:{};var i=function(e){var t=e.search(Cg);if(t<0)return{};for(var n=e.slice(0,t),r=e.match(Cg),i=1;i<r.length;){if(r[i])return{number:n,ext:r[i]};i++}}(r);if(i.ext)return i;return{number:r}}(e,t.v2,t.extract),i=r.number,o=r.ext,a=r.error;if(!i){if(t.v2){if("TOO_SHORT"===a)throw new _g("TOO_SHORT");throw new _g("NOT_A_NUMBER")}return{}}var s=function(e,t,n,r){var i,o=Vm(Tg(e),void 0,t,n,r.metadata),a=o.countryCallingCodeSource,s=o.countryCallingCode,d=o.number;if(s)r.selectNumberingPlan(s);else{if(!d||!t&&!n)return{};r.selectNumberingPlan(t,n),t&&(i=t),s=n||Am(t,r.metadata)}if(!d)return{countryCallingCodeSource:a,countryCallingCode:s};var l=Gm(Tg(d),i,r),u=l.nationalNumber,c=l.carrierCode,f=Wm(s,{nationalNumber:u,metadata:r});f&&(i=f,"001"===f||r.selectNumberingPlan(i));return{country:i,countryCallingCode:s,countryCallingCodeSource:a,nationalNumber:u,carrierCode:c}}(i,t.defaultCountry,t.defaultCallingCode,n),d=s.country,l=s.nationalNumber,u=s.countryCallingCode,c=s.countryCallingCodeSource,f=s.carrierCode;if(!n.hasSelectedNumberingPlan()){if(t.v2)throw new _g("INVALID_COUNTRY");return{}}if(!l||l.length<2){if(t.v2)throw new _g("TOO_SHORT");return{}}if(l.length>17){if(t.v2)throw new _g("TOO_LONG");return{}}if(t.v2){var h=new pg(u,l,n.metadata);return d&&(h.country=d),f&&(h.carrierCode=f),o&&(h.ext=o),h.__countryCallingCodeSource=c,h}var p=!!(t.extended?n.hasSelectedNumberingPlan():d)&&jm(l,n.nationalNumberPattern());return t.extended?{country:d,countryCallingCode:u,carrierCode:f,valid:p,possible:!!p||!(!0!==t.extended||!n.possibleLengths()||!km(l,d,n)),phone:l,ext:o}:p?function(e,t,n){var r={country:e,phone:t};n&&(r.ext=n);return r}(d,l,o):{}}function Ug(e){return(Ug="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Bg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fg(Object(n),!0).forEach(function(t){qg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qg(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Ug(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Ug(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ug(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zg(e){return(zg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wg(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=zg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=zg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==zg(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],d=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(d=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);d=!0);}catch(u){l=!0,i=u}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Vg(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Kg(e){var t,n,r,i=Gg(Array.prototype.slice.call(e),4),o=i[0],a=i[1],s=i[2],d=i[3];if("string"!=typeof o)throw new TypeError("A text for parsing must be a string.");if(t=o,a&&"string"!=typeof a){if(!pm(a))throw new Error("Invalid second argument: ".concat(a));s?(n=a,r=s):r=a}else d?(n=s,r=d):(n=void 0,r=s),a&&(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hg(Object(n),!0).forEach(function(t){Wg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({defaultCountry:a},n));return{text:t,options:n,metadata:r}}function Yg(e){return(Yg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Jg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xg(Object(n),!0).forEach(function(t){Zg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Zg(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Yg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Yg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Yg(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qg(e,t,n){t&&t.defaultCountry&&!function(e,t){return t.countries.hasOwnProperty(e)}(t.defaultCountry,n)&&(t=Jg(Jg({},t),{},{defaultCountry:void 0}));try{return function(e,t,n){return Mg(e,Bg(Bg({},t),{},{v2:!0}),n)}(e,t,n)}catch(r){if(!(r instanceof _g))throw r}}function e$(e){return(e$="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function t$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function n$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?t$(Object(n),!0).forEach(function(t){r$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function r$(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=e$(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=e$(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==e$(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i$(){var e=Kg(arguments),t=e.text,n=e.options,r=e.metadata,i=Qg(t,n=n$(n$({},n),{},{extract:!1}),r);return i&&i.isValid()||!1}function o$(){return function(e,t){var n=Array.prototype.slice.call(t);return n.push(cm),e.apply(this,n)}(i$,arguments)}const a$="55";function s$(e){return null==e?"":String(e).replace(/\D/g,"")}const d$=/^0?((?:800|300|500|900)\d{6,7})$/;function l$(e){const t=s$(e).match(d$);return t?t[1]:null}function u$(e){const t=s$(e);return 8===t.length?/^[2-5]/.test(t)?"landline":/^[6-9]/.test(t)?"mobile":"unknown":9===t.length&&t.startsWith("9")?"mobile":"unknown"}function c$(e){let t=s$(e);for(;t.startsWith("0")&&t.length>10;)t=t.slice(1);return!t.startsWith(a$)||12!==t.length&&13!==t.length||(t=t.slice(2)),t}const f$=["12","14","15","17","21","23","25","31","41","43"];function h$(e,t={}){const n=void 0===t.defaultDDD?"48":t.defaultDDD,r=t.legacyMobile??"all",i=s$(e),o=i.startsWith("0"),a=l$(i);if(a)return a;let s=c$(i);if(!s)return"";const d=l$(s);if(d)return d;if(s.length>13)return s;if(12===s.length||13===s.length){const e=s.slice(0,2);if(!o||!f$.includes(e))return s;s=s.slice(2)}const l=e=>"mobile"===u$(e)&&("all"===r||!e.startsWith("9"));if(11===s.length)return s;if(10===s.length){const e=s.slice(0,2),t=s.slice(2);return l(t)?`${e}9${t}`:s}if(9===s.length)return s.startsWith("9")&&n?`${n}${s}`:s;if(8===s.length){const e=u$(s);return n&&"unknown"!==e?l(s)?`${n}9${s}`:`${n}${s}`:s}return s}function p$(e){return h$(e)}function m$(e){if(!e)return"";const t=String(e);if(/[*#]/.test(t))return t;let n=s$(t);if(!n)return t;let r="";const i=t.trim().startsWith("+");if(n.startsWith(a$)&&(i||n.length>=12)&&n.length<=13&&(r="+55 ",n=n.slice(2)),n.length<=2)return`${r}${n}`;const o=n.match(/^(0?)((?:800|300|500|900))(\d{0,7})$/);if(o){const e=o[3],t=e.length<=3?e:`${e.slice(0,3)} ${e.slice(3)}`;return`${r}${o[1]}${o[2]}${t?` ${t}`:""}`}const a=n.slice(0,2),s=n.slice(2);return s.length<=4?`${r}(${a}) ${s}`:s.length<=8?`${r}(${a}) ${s.slice(0,4)}-${s.slice(4)}`:9===s.length?`${r}(${a}) ${s.slice(0,5)}-${s.slice(5)}`:`${r}${n}`}function g$(e){const t=(e??"").trim();if(t.startsWith("+")){const e=s$(t);return e?`+${e}`:null}const n=c$(t),r=l$(n);return r?`+${a$}${r}`:10!==n.length&&11!==n.length?null:`+${a$}${n}`}function $$(e){if(!e)return!1;try{return o$(e)}catch{return!1}}function v$(e){const t=g$(e);return!!t&&(t.startsWith(`+${a$}`)&&$$(t))}const y$="+55";function b$(e){if(!e)return"";const t=e.normalize("NFKC");let n="";for(const r of t)(/^[0-9*#]$/.test(r)||"+"===r&&0===n.length)&&(n+=r);return n}function x$(e,t=y$){const n=b$(e);if(!n)return"";const r=n.startsWith("+"),i=n.replace(/[^0-9]/g,""),o=t.replace(/[^0-9]/g,""),a=o.length||2,s=r?i.slice(0,Math.min(a,i.length)):o||i.slice(0,a);let d=r?i.slice(s.length):i;const l=r?`+${s}`:t,u="55"===s?d.match(/^(0?)((?:800|300|500|900))(\d{0,7})$/):null;if(u){const e=u[3],t=e.length<=3?e:`${e.slice(0,3)} ${e.slice(3)}`;return`${l} ${u[1]}${u[2]}${t?` ${t}`:""}`}if("55"===s&&d.length>=8){return`${l} (${d.slice(0,2)}) ${d.slice(2,Math.max(d.length-4,2))}-${d.slice(-4)}`.replace(/\s+/g," ").trim()}if(!d)return l.trim();const c=[];for(;d.length>4;)c.push(d.slice(0,3)),d=d.slice(3);d&&c.push(d);return`${l} ${c.join(" ")}`.replace(/\s+/g," ").trim()}function w$(e,t=y$){const n=b$(e).slice(0,32),r=x$(n,t),i=function(e,t=y$){const n=b$(e);if(!n)return null;if(n.startsWith("+")){const e=n.replace(/[^0-9]/g,"");return e?`+${e}`:null}const r=s$(n);if(!r)return null;const i=t.replace(/[^0-9]/g,"");if("55"!==i)return i?`+${i}${r}`:`+${r}`;const o=h$(r,{defaultDDD:null,legacyMobile:"unambiguous"});return o.length<10&&!l$(o)?null:`+55${o}`}(n,t),o=$$(i),a=i?x$(i,t):null,s=n.startsWith("+")?s$(n):`${t.replace(/[^0-9]/g,"")}${s$(n)}`;return{raw:n,display:r,e164:i,dialDisplay:a,isValid:o,differs:Boolean(i)&&s$(i??"")!==s}}const _$={fine:"(pointer: fine)",coarse:"(pointer: coarse)",hover:"(hover: hover)"};function C$(e){if("undefined"==typeof window||"function"!=typeof window.matchMedia)return null;try{return window.matchMedia(e).matches}catch{return null}}function S$(){const e=C$(_$.fine),t=C$(_$.coarse),n=C$(_$.hover),r=t?"coarse":e?"fine":"unknown";return{pointer:r,hover:!0===n,touchLike:"coarse"===r||"fine"!==r&&!1===n}}function E$(){const[e,n]=t.useState(()=>S$());return t.useEffect(()=>{if("undefined"==typeof window||"function"!=typeof window.matchMedia)return;const e=()=>n(S$()),t=[];for(const n of Object.values(_$))try{const r=window.matchMedia(n);"function"==typeof r.addEventListener?r.addEventListener("change",e):"function"==typeof r.addListener&&r.addListener(e),t.push(r)}catch{}return e(),()=>{for(const n of t)"function"==typeof n.removeEventListener?n.removeEventListener("change",e):"function"==typeof n.removeListener&&n.removeListener(e)}},[]),e}const N$="callix:click-to-call";function T$(e){if(!e)return"unknown";switch(e){case"idle":return"available";case"onBreak":return"on_break";case"afterCall":case"manualCallFailed":return"after_call";case"offline":case"stopped":case"startupError":case"startup.error":case"networkDown":return"offline";case"starting":return"unknown";case"callRinging":case"manualCallSetup":case"manualCallRinging":case"callInProgress":return"in_call";default:return/call|ringing|dial/i.test(e)?"in_call":"unknown"}}function A$(e){return"available"===e||"on_break"===e}function O$(e){const t=new AbortController,n=setTimeout(()=>t.abort(),1e4);return e&&(e.aborted?t.abort():e.addEventListener("abort",()=>t.abort(),{once:!0})),{signal:t.signal,clear:()=>clearTimeout(n)}}async function I$(e){const{signal:t,clear:n}=O$();try{const n=await fetch(`${e.apiBaseUrl}/api/click-to-call/${encodeURIComponent(e.taskId)}`,{method:"PATCH",headers:e.headers,body:JSON.stringify({status:e.status,error:e.error,retry:!0===e.retry}),credentials:"omit",keepalive:!0,signal:t});if(!n.ok){let e=null;try{const t=await n.json();e="string"==typeof(null==t?void 0:t.error)?t.error:null}catch{}return{ok:!1,status:n.status,code:e}}return{ok:!0,task:(await n.json()).task??null}}finally{n()}}function k$(e){const t=(e??"").replace(/\D/g,"");return!t.startsWith("55")||12!==t.length&&13!==t.length?e.startsWith("+")?`+${t}`:t:t.slice(2)}const j$={width:448,height:640},R$=280,P$=420,D$=1024,L$=[{value:"1",detail:""},{value:"2",detail:"ABC"},{value:"3",detail:"DEF"},{value:"4",detail:"GHI"},{value:"5",detail:"JKL"},{value:"6",detail:"MNO"},{value:"7",detail:"PQRS"},{value:"8",detail:"TUV"},{value:"9",detail:"WXYZ"},{value:"*",detail:""},{value:"0",detail:"+"},{value:"#",detail:""}],M$={rttMs:null,bitrateKbps:null,packetLossRatio:null},U$={jitterMs:null,packetLossRatio:null,audioLevel:null},F$="candidate-pair",B$="inbound-rtp";function q$({isAuthenticated:e,username:n,onLogin:r,onLogout:i,isLoadingSession:o,sessionError:a,sessionStatus:s=null,loginConfirmation:d=null,onCancelLoginConfirmation:l,onTakeOverSession:u,onLogoutAllTabs:c,variant:f="default",portalTarget:h=null}){const p=t.useRef(null),m=t.useRef(null),g=t.useRef({pointerId:null,offsetX:0,offsetY:0}),v=t.useRef({pointerId:null,originX:0,originY:0,startWidth:j$.width,startHeight:j$.height,edge:"corner"}),y=t.useRef(!1),[b,x]=t.useState({x:24,y:24}),[w,_]=t.useState(!1),[C,S]=t.useState(!1),[E,N]=t.useState(!1),[T,A]=t.useState(""),[O,I]=t.useState(null),[k,j]=t.useState({width:j$.width,height:j$.height}),R=t.useRef(e),P=t.useMemo(()=>b$(T),[T]),D="min"===f,L=t.useMemo(()=>{const e=k.width/j$.width,t=k.height/j$.height;return X$(Math.min(e,t),.55,2.5)},[k]),M=t.useCallback(e=>{if("undefined"==typeof window)return{width:X$(e.width,R$,D$),height:X$(e.height,P$,960)};const t=window.innerWidth,n=window.innerHeight,r=t<640?12:16,i=Math.min(D$,t-2*r),o=Math.min(960,n-2*r);return{width:X$(e.width,R$,Math.max(R$,i)),height:X$(e.height,P$,Math.max(P$,o))}},[]),U=t.useCallback(e=>{if("undefined"==typeof window)return e;const t=window.innerWidth,n=window.innerHeight,r=p.current,i=(null==r?void 0:r.offsetWidth)??0,o=(null==r?void 0:r.offsetHeight)??0,a=O??k??j$,s=E?a.width:80,d=E?a.height:80,l=i>0?i:s,u=o>0?o:d,c=t<640?12:16,f=c,h=c,m=Math.max(f,t-l-c),g=Math.max(h,n-u-c);let $=e.x,v=e.y;return t<640&&E&&($=Math.round((t-l)/2),v=c),n<u+2*c&&(v=c),{x:X$($,f,m),y:X$(v,h,g)}},[E,O,k]),F=t.useCallback(e=>{A(t=>b$("function"==typeof e?e(t):e))},[]);t.useEffect(()=>{var e,t;if("undefined"==typeof window)return;const n=(null==(e=p.current)?void 0:e.offsetWidth)??96,r=(null==(t=p.current)?void 0:t.offsetHeight)??96,i=window.innerWidth-n-24,o=window.innerHeight-r-24;x(U({x:i,y:o}))},[U]),t.useEffect(()=>{x(e=>U(e))},[E,U]),t.useEffect(()=>{if("undefined"==typeof window)return;const e=()=>{x(e=>U(e)),I(e=>e?M(e):e)};return window.addEventListener("resize",e),window.addEventListener("orientationchange",e),()=>{window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}},[U,M]),t.useEffect(()=>{if(!E)return;const e=m.current;if(!e)return;const t=(e,t)=>{j({width:e,height:t})};if("undefined"!=typeof ResizeObserver){const n=new ResizeObserver(e=>{const n=e[0];if(n){const{width:e,height:r}=n.contentRect;t(e,r)}});return n.observe(e),()=>n.disconnect()}const n=e.getBoundingClientRect();t(n.width,n.height)},[E,O]),t.useEffect(()=>{e&&!R.current&&N(!0),R.current=e},[e]),t.useEffect(()=>{const e=e=>{const t=e.detail;N(!0),(null==t?void 0:t.phone)&&F(k$(t.phone).slice(0,32))};return window.addEventListener(N$,e),()=>window.removeEventListener(N$,e)},[F]);const B=t.useRef(!1);t.useEffect(()=>{const t=!e&&Boolean(d||a);t&&!B.current&&N(!0),B.current=t},[e,d,a]),t.useEffect(()=>{if(!w)return;const e=e=>{var t,n;if(g.current.pointerId!==e.pointerId)return;y.current=!0;const r=(null==(t=p.current)?void 0:t.offsetWidth)??0,i=(null==(n=p.current)?void 0:n.offsetHeight)??0,o=e.clientX-g.current.offsetX,a=e.clientY-g.current.offsetY,s="undefined"!=typeof window?window.innerWidth:0,d=s<640?12:16,l=s-r-d,u=("undefined"!=typeof window?window.innerHeight:0)-i-d,c=Math.max(d,l),f=Math.max(d,u);x({x:X$(o,d,c),y:X$(a,d,f)})},t=e=>{g.current.pointerId===e.pointerId&&(_(!1),g.current={pointerId:null,offsetX:0,offsetY:0})};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t)}},[w]),t.useEffect(()=>{if(!C)return;const e=e=>{if(v.current.pointerId!==e.pointerId)return;e.preventDefault();const{edge:t,startWidth:n,startHeight:r,originX:i,originY:o}=v.current;let a=n,s=r;"right"!==t&&"corner"!==t||(a=n+(e.clientX-i)),"bottom"!==t&&"corner"!==t||(s=r+(e.clientY-o));const d=M({width:a,height:s});I(e=>e&&e.width===d.width&&e.height===d.height?e:d)},t=e=>{var t,n;if(v.current.pointerId===e.pointerId){try{null==(n=null==(t=e.target)?void 0:t.releasePointerCapture)||n.call(t,e.pointerId)}catch{}S(!1),v.current={...v.current,pointerId:null}}};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[C,M]),t.useEffect(()=>{E||(y.current=!1)},[E]),t.useEffect(()=>{x(e=>U(e))},[O,k,U]);const q=t.useCallback(e=>t=>{var n,r;if(0!==t.button&&"touch"!==t.pointerType)return;t.preventDefault(),t.stopPropagation();const i=m.current,o=null==i?void 0:i.getBoundingClientRect(),a=(null==o?void 0:o.width)??(null==O?void 0:O.width)??j$.width,s=(null==o?void 0:o.height)??(null==O?void 0:O.height)??j$.height;v.current={pointerId:t.pointerId,originX:t.clientX,originY:t.clientY,startWidth:a,startHeight:s,edge:e};try{null==(r=(n=t.currentTarget).setPointerCapture)||r.call(n,t.pointerId)}catch{}S(!0)},[O]),z=t.useCallback(e=>{var t;if(0!==e.button)return;const n=null==(t=p.current)?void 0:t.getBoundingClientRect();g.current={pointerId:e.pointerId,offsetX:e.clientX-((null==n?void 0:n.left)??0),offsetY:e.clientY-((null==n?void 0:n.top)??0)},y.current=!1,_(!0)},[]),H=t.useCallback(()=>{y.current?y.current=!1:N(e=>!e)},[]),W=t.useCallback(async e=>{const t=e.trim();t&&await r(t)},[r]),G=e?$.jsx(H$,{username:n??"",dialValue:P,setDialValue:F,onLogout:i,variant:f,onRequestClose:()=>N(!1),portalTarget:h}):$.jsx(z$,{defaultValue:n??"",onSubmit:W,isLoading:o,error:a,statusMessage:s,confirmation:d,onCancelConfirmation:l,onTakeOver:u,onLogoutAll:c});if(D)return G;const V=Number.isFinite(L)&&L>0?L:1,K=j$.width/V,Y=j$.height/V,X={width:O?`${O.width}px`:void 0,height:O?`${O.height}px`:void 0,minWidth:"280px",minHeight:"420px",maxWidth:"min(1024px, calc(100vw - 1.5rem))",maxHeight:"calc(100vh - 3rem)"},J={flex:1,display:"flex",flexDirection:"column",transform:`scale(${V})`,transformOrigin:"top left",width:`${K}px`,minHeight:`${Y}px`},Z={flex:1,display:"flex",flexDirection:"column",width:`${j$.width}px`,minHeight:`${j$.height}px`};return $.jsx("div",{ref:p,className:["callix","mode","full",Xh`fixed z-50 select-none`].join(" "),"data-callix-variant":"default",style:{transform:`translate3d(${b.x}px, ${b.y}px, 0)`,top:0,left:0},children:E?$.jsxs("div",{ref:m,"data-floating-dialer-card":"true",className:Xh`relative flex flex-col items-start overflow-hidden rounded-3xl border border-slate-200/60 bg-gradient-to-br from-white/95 via-slate-50/95 to-white/90 shadow-2xl backdrop-blur-lg transition-all duration-300 w-[min(32rem,calc(100vw-1.5rem))] max-w-[calc(100vw-1.5rem)] sm:w-[28rem] md:w-[30rem] max-h-[calc(100vh-3rem)] sm:max-h-none`,style:X,children:[$.jsx("div",{className:Xh`flex flex-1 flex-col overflow-hidden`,style:J,children:$.jsxs("div",{"data-floating-dialer-content":!0,className:Xh`flex flex-1 flex-col rounded-3xl overflow-hidden`,style:Z,children:[$.jsxs("div",{className:Xh`cursor-grab touch-none active:cursor-grabbing flex items-center justify-between bg-gradient-to-r from-primary to-primaryDark px-4 py-3 text-white shadow-sm`,onPointerDown:z,children:[$.jsxs("div",{className:Xh`flex items-center gap-3`,children:[$.jsx("span",{className:Xh`inline-flex h-10 w-10 items-center justify-center rounded-2xl bg-white/15 shadow-inner`,children:$.jsx(Lc,{className:Xh`text-xl`})}),$.jsxs("div",{className:Xh`space-y-0.5`,children:[$.jsx("p",{className:Xh`text-[11px] uppercase tracking-[0.2em] text-white/70`,children:"Discadora"}),$.jsx("p",{className:Xh`text-base font-semibold`,children:n??"Visitante"})]})]}),$.jsx("button",{type:"button",className:Xh`rounded-full p-2 text-white/80 transition hover:bg-white/15 hover:text-white`,onClick:()=>N(!1),"aria-label":"Fechar discadora",children:$.jsx(Yc,{className:Xh`text-lg`})})]}),$.jsx("div",{className:Xh`flex-1 overflow-y-auto p-3`,children:G})]})}),$.jsx("div",{role:"presentation","data-floating-dialer-resize":"right","aria-hidden":"true",className:Xh`absolute right-0 top-16 bottom-12 w-3 cursor-ew-resize touch-none rounded-md border border-transparent transition-colors duration-150 hover:border-primary/30 hover:bg-primary/10`,onPointerDown:q("right")}),$.jsx("div",{role:"presentation","data-floating-dialer-resize":"bottom","aria-hidden":"true",className:Xh`absolute left-16 right-12 bottom-0 h-3 cursor-ns-resize touch-none rounded-md border border-transparent transition-colors duration-150 hover:border-primary/30 hover:bg-primary/10`,onPointerDown:q("bottom")}),$.jsx("div",{role:"presentation","data-floating-dialer-resize":"corner",className:Xh`absolute bottom-1 right-1 flex h-6 w-6 items-center justify-center cursor-nwse-resize touch-none`,onPointerDown:q("corner"),"aria-label":"Redimensionar discadora",children:$.jsx("span",{className:Xh`h-3 w-3 rotate-45 rounded-sm border border-slate-300 bg-white/80 shadow`})})]}):$.jsx("button",{type:"button",onPointerDown:z,onClick:H,className:Xh`flex h-16 w-16 items-center justify-center rounded-full bg-primary text-white shadow-xl transition-transform hover:scale-105 hover:bg-primaryDark focus:outline-none focus:ring-4 focus:ring-primary/30`,"aria-label":"Abrir discadora",children:$.jsx(Fc,{className:Xh`text-2xl`})})})}function z$({defaultValue:e,onSubmit:n,isLoading:r,error:i,statusMessage:o,confirmation:a,onCancelConfirmation:s,onTakeOver:d,onLogoutAll:l}){const[u,c]=t.useState(e),[f,h]=t.useState(!1);t.useEffect(()=>{c(e)},[e]);const p=f&&!u.trim();if(r){const e=((null==a?void 0:a.username)||u||"").trim();return $.jsxs("div",{className:Xh`flex flex-col items-center justify-center gap-3 rounded-2xl border border-slate-200 bg-white px-4 py-8 text-center`,role:"status","aria-live":"polite",children:[$.jsx("span",{className:Xh`inline-flex h-10 w-10 animate-spin rounded-full border-4 border-primary/20 border-t-primary`}),e&&$.jsx("p",{className:Xh`text-sm font-semibold text-slate-800`,children:e}),$.jsx("p",{className:Xh`text-xs text-slate-500`,children:o||"Conectando..."})]})}return(null==a?void 0:a.elsewhere)?$.jsxs("div",{className:Xh`space-y-4`,"data-login-state":"elsewhere",children:[$.jsxs("div",{className:Xh`space-y-2 text-center`,children:[$.jsx("p",{className:Xh`text-[11px] font-semibold uppercase tracking-wide text-slate-500`,children:"Discador ativo em outra aba"}),$.jsxs("p",{className:Xh`inline-flex items-center gap-2 rounded-full border border-slate-200 bg-slate-50 px-3 py-1 text-sm font-semibold text-slate-800`,children:[$.jsx(Hc,{className:Xh`text-primary`}),a.username]})]}),i&&$.jsx("p",{className:Xh`text-center text-xs text-red-500`,children:i}),$.jsx("button",{type:"button",id:"takeOverBtn",onClick:()=>null==d?void 0:d(),className:Xh`flex w-full items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2 text-white shadow-lg transition hover:bg-primaryDark`,children:"Usar o discador nesta aba"}),$.jsx("button",{type:"button",id:"logoutAllBtn",onClick:()=>null==l?void 0:l(),className:Xh`w-full text-center text-xs font-semibold text-red-500 transition hover:text-red-600`,children:"Sair em todas as abas"}),$.jsx("p",{className:Xh`text-center text-[11px] text-slate-400`,children:"O Callix aceita uma conexão por usuário: você já está conectado em outra aba deste navegador e pode continuar por lá."})]}):a?$.jsxs("div",{className:Xh`space-y-4`,"data-login-state":"choose",children:[$.jsxs("div",{className:Xh`space-y-2 text-center`,children:[$.jsx("p",{className:Xh`text-[11px] font-semibold uppercase tracking-wide text-slate-500`,children:"Entrar como"}),$.jsxs("p",{className:Xh`inline-flex items-center gap-2 rounded-full border border-slate-200 bg-slate-50 px-3 py-1 text-sm font-semibold text-slate-800`,children:[$.jsx(Hc,{className:Xh`text-primary`}),a.username]})]}),i&&$.jsx("p",{className:Xh`text-center text-xs text-red-500`,children:i}),!i&&a.note&&$.jsx("p",{className:Xh`text-center text-xs text-slate-500`,children:a.note}),$.jsx("button",{type:"button",id:"loginConfirmBtn",onClick:()=>{n(a.username)},className:Xh`flex w-full items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2 text-white shadow-lg transition hover:bg-primaryDark`,children:"Entrar"}),!a.locked&&s&&$.jsx("button",{type:"button",onClick:s,className:Xh`w-full text-center text-xs font-semibold text-slate-500 transition hover:text-primary`,children:"Usar outro usuário"}),$.jsx("p",{className:Xh`text-center text-[11px] text-slate-400`,children:"Ao entrar, todas as abas abertas passam a usar o discador. Vai usar o Callix web? Então não entre aqui: nada é conectado sem a sua confirmação."})]}):$.jsxs("form",{className:Xh`space-y-4`,onSubmit:async e=>{e.preventDefault(),h(!0),u.trim()&&await n(u)},children:[$.jsxs("div",{className:Xh`space-y-2`,children:[$.jsxs("label",{className:Xh`flex items-center gap-2 text-sm font-medium text-slate-700`,htmlFor:"dialer-username",children:[$.jsx(Hc,{className:Xh`text-base text-primary`}),"Usuario"]}),$.jsx("input",{id:"dialer-username",type:"text",placeholder:"Digite seu usuario Callix",className:Xh`w-full rounded-xl border border-slate-200 bg-white px-3 py-2 text-base shadow-inner focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/40`,value:u,onChange:e=>c(e.target.value),onBlur:()=>h(!0),autoCapitalize:"none",autoCorrect:"off",spellCheck:!1}),p&&$.jsx("p",{className:Xh`text-xs text-red-500`,children:"Informe um usuario para continuar."}),i&&$.jsx("p",{className:Xh`text-xs text-red-500`,children:i})]}),$.jsx("button",{type:"submit",className:Xh`flex w-full items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2 text-white shadow-lg transition hover:bg-primaryDark`,children:"Entrar"})]})}function H$({username:e,dialValue:r,setDialValue:i,onLogout:o,variant:a,onRequestClose:s,portalTarget:d=null}){var l,u;const c="min"===a,{skipManualQualification:f}=Xy();console.log("[FloatingDialer/AuthenticatedDialer] 🔧 skipManualQualification:",f);const h=Qu(),p=ec(),m=nc(),g=rc(),v=ic(),y=oc(),b=t.useMemo(()=>v??[],[v]),x=t.useMemo(()=>y??[],[y]),{makeManualCall:w,becomeAvailable:_,finishAfterCall:C}=tc(),{hangup:S,answer:E,reject:N}=ac(),[T,A]=sc(),[O,I]=dc(),[k,j]=lc();t.useEffect(()=>{console.log("[FloatingDialer] Estado do operador mudou:",{state:null==p?void 0:p.state,operatorState:p,hasCall:!!m,currentCall:m})},[p,m]),t.useEffect(()=>{console.log("[FloatingDialer] Qualificações:",{success:b,discard:x,callState:null==p?void 0:p.state})},[b,x,null==p?void 0:p.state]),t.useEffect(()=>{"incoming"===(null==m?void 0:m.direction)&&console.log("[FloatingDialer] 📞 CHAMADA RECEBIDA:",{call:m,direction:m.direction,state:null==p?void 0:p.state,counterpart:V$(m)})},[m,null==p?void 0:p.state]);const[R,P]=t.useState(!1),D=t.useRef(null),L=t.useRef(null),M=t.useRef(null),U=t.useRef(null),[F,B]=t.useState(null),[q,z]=t.useState(null);uc("userSessionDropped",e=>{const t=Wp(null==e?void 0:e.originator);z(`${t.title}: ${t.detail}${t.action?` ${t.action}`:""}`)});const[H,W]=t.useState(null),[G,V]=t.useState(!1),[K,Y]=t.useState("success"),[X,J]=t.useState(null),[Z,Q]=t.useState(0),[ee,te]=t.useState(0),[ne,re]=t.useState(M$),[ie,oe]=t.useState(U$),ae=t.useRef(null),se=t.useRef(!1),[de,le]=t.useState({inputs:[],outputs:[]}),[ue,ce]=t.useState(null),[fe,he]=t.useState(null),[pe,me]=t.useState(null),[ge,$e]=t.useState(!1),ve=t.useRef(null),[ye,be]=t.useState(null),[xe,we]=t.useState(!1),[_e,Ce]=t.useState(null),[Se,Ee]=t.useState("undefined"!=typeof window&&window.innerWidth<=640),Ne="mobile"===a,Te=E$(),Ae=Ne||Se&&Te.touchLike,Oe=lm(null==h?void 0:h.breaks)||[],{goOnBreak:Ie,goOffBreak:ke}=um(),je=t.useMemo(()=>r.slice(0,32),[r]),Re=t.useMemo(()=>w$(je,y$),[je]),Pe=Re.e164,De=Re.display,Le=Re.differs?Re.dialDisplay:null,Me=null==p?void 0:p.state,Ue="idle"===Me,Fe="onBreak"===Me,Be="incoming"===(null==m?void 0:m.direction),qe="callInProgress"===Me,ze="manualCallRinging"===Me||"callRinging"===Me,He="manualCallSetup"===Me||ze,We=!Me||"starting"===Me||"idle"===Me||"manualCallSetup"===Me||"onBreak"===Me,Ge=We||qe||ze,Ve=Re.isValid,Ke=t.useCallback(async e=>{if("function"==typeof _)try{await Promise.resolve(_())}catch(t){console.error(e,t),z(e)}else z(e)},[_]);t.useEffect(()=>{if(se.current)return;se.current=!0;Me&&["onBreak","manualCallSetup","manualCallRinging","manualCallFailed","callRinging","callInProgress","afterCall"].includes(Me)||Ke("Nao foi possivel ficar disponivel automaticamente.")},[Ke,Me]),t.useEffect(()=>{"idle"===Me&&(z(null),B(null))},[Me]),t.useEffect(()=>{if("undefined"==typeof window)return;const e=()=>Ee(window.innerWidth<=640);return e(),window.addEventListener("resize",e),window.addEventListener("orientationchange",e),()=>{window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}},[]),t.useEffect(()=>{"offline"===Me&&(z("Conexao perdida. Tentando reconectar..."),Ke("Conexao perdida. Tentando reconectar..."))},[Me,Ke]),t.useEffect(()=>{if("afterCall"===Me){if("campaign"===(null==g?void 0:g.type)&&!0===g.info.campaign.skipCallQualification)return console.log("[FloatingDialer] 🚀 skipCallQualification ativado - finalizando automaticamente"),void("function"==typeof C&&Promise.resolve(C({result:"success",qualificationId:void 0})));if("manual"===(null==g?void 0:g.type))return console.log("[FloatingDialer] 🚀 Chamada MANUAL detectada - finalizando automaticamente (chamadas manuais NUNCA exibem qualificação)"),void("function"==typeof C&&Promise.resolve(C({result:"success",qualificationId:void 0})));if(0===b.length&&0===x.length)return console.log("[FloatingDialer] 🚀 Sem qualificações configuradas - finalizando automaticamente"),void("function"==typeof C&&Promise.resolve(C({result:"success",qualificationId:void 0})));const e=b.length>0;Y(e?"success":"failure"),J(null),W(null)}},[Me,b.length,x.length,g,C,f]),t.useEffect(()=>{if("undefined"==typeof window)return;if("starting"!==Me)return;const e=window.setTimeout(()=>{z(e=>e??"Conexao demorando mais que o esperado. Verifique rede ou credenciais.")},8e3);return()=>window.clearTimeout(e)},[Me]);const Ye=t.useRef(Pe);Ye.current=Pe,t.useEffect(()=>{if("manualCallRinging"===Me||"callInProgress"===Me){const e=Ye.current;e&&be(t=>t??e),i("")}"idle"===Me&&be(null)},[Me,i]),t.useEffect(()=>{var e;if("undefined"==typeof navigator||!(null==(e=navigator.mediaDevices)?void 0:e.enumerateDevices))return;let t=!1;const n=async()=>{try{navigator.mediaDevices.getUserMedia&&await navigator.mediaDevices.getUserMedia({audio:!0})}catch(e){console.warn("Permissao de microfone nao concedida ainda",e)}try{const e=await navigator.mediaDevices.enumerateDevices();if(t)return;const n=e.filter(e=>"audioinput"===e.kind),r=e.filter(e=>"audiooutput"===e.kind);le({inputs:n,outputs:r});const i=await Bp();if(t)return;me(i?`${i.title}: ${i.detail}${i.action?` ${i.action}`:""}`:null),ce(e=>{var t;return e??(null==(t=n[0])?void 0:t.deviceId)??null}),he(e=>{var t;return e??(null==(t=r[0])?void 0:t.deviceId)??null})}catch(e){t||(console.error("Listagem de dispositivos falhou",e),me("Nao foi possivel listar dispositivos de audio. Verifique as permissoes."))}};n();const r=()=>{n()},i=navigator.mediaDevices;return"addEventListener"in i?i.addEventListener("devicechange",r):"ondevicechange"in i&&(i.ondevicechange=r),()=>{t=!0,"removeEventListener"in i?i.removeEventListener("devicechange",r):"ondevicechange"in i&&(i.ondevicechange=null)}},[]),t.useEffect(()=>{if(!m||"callInProgress"!==Me)return Q(0),re(M$),void oe(U$);const e=Math.floor(m.currentDurationSeconds??0);Q(e),console.log("[FloatingDialer] ?? Timer iniciado:",{initialDuration:e,currentDurationSeconds:m.currentDurationSeconds,callState:Me});const t=window.setInterval(()=>{const e=Math.floor(m.currentDurationSeconds??0);Q(e),e%5==0&&e>0&&console.log("[FloatingDialer] ?? Timer atualizado:",e,"segundos")},1e3);return()=>{console.log("[FloatingDialer] ?? Timer parado"),window.clearInterval(t)}},[m,Me]),t.useEffect(()=>{if(!m||"callInProgress"!==Me)return;const e=e=>{const t=W$(e,"stat")??{},n="string"==typeof t.type?t.type:void 0;if(n===F$){const e=K$(t,"currentRoundTripTime"),n=K$(t,"availableOutgoingBitrate");re(t=>({rttMs:null!=e?1e3*e:t.rttMs,bitrateKbps:null!=n?n/1e3:t.bitrateKbps,packetLossRatio:t.packetLossRatio}))}if(n===B$){const e=K$(t,"packetsReceived")??0,n=K$(t,"packetsLost")??0,r=e+n,i=r>0?n/r:null,o=K$(t,"jitter"),a=K$(t,"audioLevel");oe(e=>({jitterMs:null!=o?1e3*o:e.jitterMs,packetLossRatio:i??e.packetLossRatio,audioLevel:a??e.audioLevel})),re(e=>({rttMs:e.rttMs,bitrateKbps:e.bitrateKbps,packetLossRatio:i??e.packetLossRatio}))}};return m.on("webRTCStat",e),()=>{m.off("webRTCStat",e)}},[m,Me]),t.useEffect(()=>{var e;if(!ue)return;if("undefined"==typeof navigator||!(null==(e=navigator.mediaDevices)?void 0:e.getUserMedia))return;let t=!1;return(async()=>{var e,n,r,i;const o=null==(n=null==(e=ve.current)?void 0:e.getAudioTracks)?void 0:n.call(e)[0],a=null==(r=null==o?void 0:o.getSettings)?void 0:r.call(o).deviceId;let s=ve.current;if(!s||a!==ue)try{const e=await navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:ue}}});if(t)return void e.getTracks().forEach(e=>e.stop());ve.current&&ve.current!==e&&ve.current.getTracks().forEach(e=>e.stop()),ve.current=e,s=e}catch(l){return void(t||(console.error("Falha ao acessar microfone selecionado",l),me("Nao foi possivel acessar o microfone selecionado.")))}if(!s)return;const d=s.getAudioTracks()[0];if(d)try{const e=G$(h,"setAudioInputDevice");if(e)return await Promise.resolve(e(ue)),void me(null);const t=function(e){const t=W$(e,"rtcSession")??W$(e,"_session")??W$(e,"session"),n=W$(t,"_connection")??W$(t,"connection");if(n)return n;return W$(e,"pc")??void 0}(m),n=null==(i=null==t?void 0:t.getSenders)?void 0:i.call(t).find(e=>{var t;return"audio"===(null==(t=e.track)?void 0:t.kind)});if(null==n?void 0:n.replaceTrack)return await n.replaceTrack(d),void me(null);const r=G$(m,"setInputTrack");if(r)return await Promise.resolve(r(d)),void me(null);const o=G$(m,"replaceTrack");if(o)return await Promise.resolve(o(d)),void me(null);console.warn("Nao foi possivel aplicar o microfone via API conhecida"),me(null)}catch(l){t||(console.error("Erro ao aplicar microfone",l),me("Nao foi possivel aplicar o microfone selecionado."))}})(),()=>{t=!0}},[ue,h,m]),t.useEffect(()=>{if(!fe||!h)return;(async()=>{try{const e=G$(W$(h,"audioOutput"),"setAudioOutputDevice");if(!e)return void console.warn("Nao foi possivel localizar API para alterar dispositivo de saida.");await Promise.resolve(e(fe)),me(null)}catch(e){console.error("Erro ao aplicar dispositivo de saida",e),me("Nao foi possivel aplicar a saida de audio selecionada.")}})()},[fe,h]),t.useEffect(()=>{if(!m)return;const e=e=>{const t=Kp(null==e?void 0:e.failure);B(`${t.title}: ${t.detail}${t.action?` ${t.action}`:""}`)};return m.on("failed",e),()=>{m.off("failed",e)}},[m]),t.useEffect(()=>()=>{const e=ae.current;e&&e.close().catch(()=>{})},[]),t.useEffect(()=>()=>{var e;null==(e=ve.current)||e.getTracks().forEach(e=>e.stop()),ve.current=null},[]);const Xe=t.useCallback(async()=>{if("undefined"==typeof window)return null;const e=window.AudioContext||window.webkitAudioContext;if(!e)return null;if(ae.current||(ae.current=new e),"suspended"===ae.current.state)try{await ae.current.resume()}catch(t){console.error("Falha ao retomar audio",t)}return ae.current},[]),Je=t.useCallback(async e=>{const t=Y$[e];if(!t)return;const n=await Xe();if(!n)return;const r=n.createGain(),[i,o]=t,a=n.createOscillator(),s=n.createOscillator();a.type="sine",s.type="sine",a.frequency.setValueAtTime(i,n.currentTime),s.frequency.setValueAtTime(o,n.currentTime),r.gain.setValueAtTime(0,n.currentTime),r.gain.linearRampToValueAtTime(.22,n.currentTime+.01),r.gain.linearRampToValueAtTime(0,n.currentTime+.18),a.connect(r),s.connect(r),r.connect(n.destination);const d=n.currentTime,l=d+.2;a.start(d),s.start(d),a.stop(l),s.stop(l);const u=()=>{try{a.disconnect(),s.disconnect(),r.disconnect()}catch(e){console.error("Erro ao limpar tons DTMF",e)}};a.onended=u,s.onended=u},[Xe]),Ze=t.useCallback(e=>{if(Je(e),m&&(qe||ze)){try{m.sendDtmf(e)}catch(n){console.error("Falha ao enviar DTMF",n),B("Nao foi possivel enviar o tom DTMF.")}return}if(!We)return;if(B(null),!/^[0-9*#]$/.test(e))return void console.warn("[handleDial] Dígito inválido ignorado:",e);const t=ee;i(n=>{const r=n,i=(r.slice(0,t)+e+r.slice(t)).slice(0,32),o=Math.min(t+1,i.length);return te(o),setTimeout(()=>{U.current&&(U.current.focus(),U.current.setSelectionRange(o,o))},0),i})},[Je,m,qe,ze,We,ee,i]),Qe=t.useCallback(()=>{B(null),i(""),te(0),setTimeout(()=>{U.current&&U.current.focus()},0)},[i]),et=t.useCallback(()=>{B(null);const e=ee;0!==e&&i(t=>{const n=t.slice(0,e-1)+t.slice(e),r=e-1;return te(r),setTimeout(()=>{U.current&&(U.current.focus(),U.current.setSelectionRange(r,r))},0),n})},[i,ee]);t.useEffect(()=>{const e=e=>{const t=e.detail;(null==t?void 0:t.phone)&&(B(null),be(t.phone))};return window.addEventListener(N$,e),()=>window.removeEventListener(N$,e)},[]);const tt=t.useCallback(async()=>{if(!Ue&&!Fe)return;if(!je)return void B("Informe um numero para ligar.");const e=Pe;if(console.log("[handleCall] sanitizedDialValue:",je,"-> E.164:",e),e)if($$(e)){console.log("[handleCall] 🚀 Ligando para:",e);try{B(null),be(e),w&&w(e)}catch(t){console.error("Erro ao iniciar chamada",t),B("Nao foi possivel iniciar a ligacao.")}}else B("Numero invalido. Informe o DDD e o numero (fixo com 8 ou celular com 9 digitos).");else B("Informe um numero para ligar.")},[Ue,Fe,je,Pe,w]),nt=t.useCallback(async e=>{if(Ie)try{Ce(null),await Ie(e),we(!1),console.log("[FloatingDialer] Entrou em pausa com sucesso:",e)}catch(t){console.error("[FloatingDialer] Erro ao entrar em pausa:",t),Ce(t instanceof Error?t.message:"N�o foi poss�vel entrar em pausa.")}},[Ie]),rt=t.useCallback(async()=>{if(ke)try{await ke(),console.log("[FloatingDialer] Saiu da pausa com sucesso")}catch(e){console.error("[FloatingDialer] Erro ao sair da pausa:",e),z("N�o foi poss�vel sair da pausa.")}},[ke]);t.useEffect(()=>{if(U.current&&je.length<ee){const e=je.length;te(e),U.current.setSelectionRange(e,e)}},[je,ee]),t.useEffect(()=>{if(c)return;if(!R)return;const e=e=>{if(e.metaKey||e.ctrlKey||e.altKey)return;const t=e.key;if("Backspace"===t)return e.preventDefault(),void et();if("Delete"===t)return e.preventDefault(),void Qe();if("Enter"===t)return void(Ue&&(e.preventDefault(),tt()));const n="NumpadEnter"===t?null:t;if(n&&["0","1","2","3","4","5","6","7","8","9","#","*","+"].includes(n))return e.preventDefault(),void Ze(n);if(t.startsWith("Numpad")){const n=t.replace("Numpad","");if("Add"===n)return e.preventDefault(),void Ze("+");if("Multiply"===n)return e.preventDefault(),void Ze("*");/^[0-9]$/.test(n)&&(e.preventDefault(),Ze(n))}};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[c,R,et,Qe,Ze,tt,Ue]);const it=t.useCallback(async()=>{if(S)try{await S()}catch(e){console.error("Erro ao encerrar chamada",e),B("Falha ao encerrar chamada.")}},[S]),ot=t.useCallback(async()=>{if(E)try{await E()}catch(e){console.error("Erro ao atender chamada",e),B("Nao foi possivel atender.")}},[E]),at=t.useCallback(async()=>{if(N)try{await N()}catch(e){console.error("Erro ao rejeitar chamada",e),B("Nao foi possivel rejeitar.")}},[N]),st=t.useCallback(async()=>{if(("success"===K?b:x).length)if(X)if("function"==typeof C)try{V(!0),W(null),await Promise.resolve(C({result:K,qualificationId:X}))}catch(e){console.error("Erro ao finalizar pos-chamada",e),W("Falha ao finalizar atendimento. Tente novamente.")}finally{V(!1)}else W("Nao foi possivel enviar a qualificacao.");else W("Selecione uma qualificacao para finalizar.");else W("Nenhuma qualificacao configurada para este resultado.")},[K,x,C,X,b]),dt=t.useCallback(()=>{P(!0)},[]),lt=t.useCallback(e=>{const t=e.relatedTarget;D.current&&t&&D.current.contains(t)||P(!1)},[]),ut=t.useCallback(e=>{e.preventDefault();const t=e.clipboardData.getData("text");if(!t)return;const n=p$(t);i(n),te(n.length),setTimeout(()=>{U.current&&(U.current.focus(),U.current.setSelectionRange(n.length,n.length))},0)},[i]),ct=t.useCallback(e=>{const t=e.target,n=b$(t.value).slice(0,32);B(null),i(n),te(Math.min(t.selectionStart??n.length,n.length))},[i]),ft=t.useCallback((e,t)=>{if(!t)return void e.preventDefault();const n=e.key;return"Enter"===n?(e.preventDefault(),void tt()):/^[0-9*#]$/.test(n)&&m&&(qe||ze)?(e.preventDefault(),void Ze(n)):void(/^[0-9*#+]$/.test(n)?Je(n):1!==n.length||e.ctrlKey||e.metaKey||e.altKey||e.preventDefault())},[tt,Ze,m,qe,ze,Je]),ht=t.useCallback(e=>{const t=e.target.value;ce(t||null)},[]),pt=t.useCallback(e=>{const t=e.target.value;he(t||null)},[]),mt=t.useCallback(e=>{const t=Number.isFinite(e)?e:0,n=Math.min(Math.max(t,0),1);j(Number((n*(("number"==typeof k?k:0)>1?100:1)).toFixed(2)))},[k,j]),gt=p&&"call"in p?p.call:void 0,$t=V$(m)??V$(gt),vt=Pe||ye,yt=(null==$t?void 0:$t.displayName)??(null==$t?void 0:$t.phoneNumber)??("campaign"===(null==g?void 0:g.type)?g.info.campaignContact.phoneNumber:void 0)??((qe||He)&&vt?vt:void 0),bt=function(e){switch(e){case"starting":return"Conectando";case"idle":return"Disponivel";case"manualCallSetup":return"Preparando";case"manualCallRinging":return"Chamando";case"callRinging":return"Recebida";case"callInProgress":return"Em chamada";case"afterCall":return"Finalizando";case"onBreak":return"Em pausa";case"offline":return"Offline";case"error":return"Erro";default:return"Aguardando"}}(Me),xt=De||je,wt=(null==(l=de.inputs.find(e=>e.deviceId===ue))?void 0:l.label)||"Microfone padrao",_t=(null==(u=de.outputs.find(e=>e.deviceId===fe))?void 0:u.label)||"Saida padrao",Ct="number"==typeof k?k:0,St=Ct>1?100:1,Et=Math.min(Math.max(Ct/St,0),1),Nt=Math.round(100*Et),Tt=O?Vc:Et>.65?Gc:Wc,At=T?jc:Rc,Ot=function(e){switch(e){case"idle":return{Icon:Nc,badgeClass:Xh`border-green-200 bg-green-50 text-green-700`,dotClass:Xh`bg-green-500`};case"callInProgress":case"manualCallSetup":case"manualCallRinging":case"callRinging":return{Icon:wc,badgeClass:Xh`border-primary/30 bg-primary/10 text-primary`,dotClass:Xh`bg-primary`};case"onBreak":return{Icon:Dc,badgeClass:Xh`border-amber-200 bg-amber-50 text-amber-700`,dotClass:Xh`bg-amber-500`};case"offline":case"error":return{Icon:Cc,badgeClass:Xh`border-rose-200 bg-rose-50 text-rose-700`,dotClass:Xh`bg-rose-500`};default:return{Icon:Lc,badgeClass:Xh`border-slate-200 bg-slate-50 text-slate-600`,dotClass:Xh`bg-slate-500`}}}(Me);if("afterCall"===Me&&!c)return $.jsx(Z$,{username:e,result:K,onChangeResult:Y,successQualifications:b,discardQualifications:x,selectedQualificationId:X,onSelectQualification:J,onSubmit:st,isSubmitting:G,errorMessage:H,onLogout:o,isMobile:Ae,onClose:s});const It=d?Xh`absolute inset-0 z-50 flex items-center justify-center bg-black/50 p-4`:Xh`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4`,kt=$.jsx("div",{className:It,children:$.jsxs("div",{className:Xh`bg-white rounded-2xl shadow-2xl max-w-md w-full p-6 space-y-4`,children:[$.jsxs("div",{className:Xh`flex items-center justify-between`,children:[$.jsx("h3",{className:Xh`text-lg font-bold text-slate-800`,children:"Selecione uma Pausa"}),$.jsx("button",{type:"button",onClick:()=>{we(!1),Ce(null)},className:Xh`text-slate-400 hover:text-slate-600 transition`,children:$.jsx(Yc,{className:Xh`text-xl`})})]}),_e&&$.jsxs("div",{className:Xh`rounded-lg bg-red-50 border border-red-200 px-3 py-2 flex items-start gap-2`,children:[$.jsx(Cc,{className:Xh`text-red-500 shrink-0 mt-0.5`}),$.jsx("p",{className:Xh`text-sm text-red-700`,children:_e})]}),Oe&&0!==Oe.length?$.jsx("div",{className:Xh`space-y-2 max-h-96 overflow-y-auto`,children:Oe.map(e=>$.jsxs("button",{type:"button",onClick:()=>nt(e.id),className:Xh`w-full flex items-center gap-3 rounded-lg border border-slate-200 bg-white px-4 py-3 text-left transition-all hover:border-amber-300 hover:bg-amber-50 hover:shadow-md`,children:[$.jsx(Dc,{className:Xh`text-xl text-amber-600 shrink-0`}),$.jsxs("div",{className:Xh`flex-1 min-w-0`,children:[$.jsx("p",{className:Xh`font-semibold text-slate-800 truncate`,children:e.name}),$.jsxs("p",{className:Xh`text-xs text-slate-500`,children:["ID: ",e.id]})]})]},e.id))}):$.jsx("div",{className:Xh`text-center py-8`,children:$.jsx("p",{className:Xh`text-slate-500`,children:"Nenhuma pausa disponivel"})}),$.jsx("button",{type:"button",onClick:()=>{we(!1),Ce(null)},className:Xh`w-full rounded-lg border border-slate-200 bg-slate-50 px-4 py-2 text-sm font-semibold text-slate-600 transition hover:bg-slate-100`,children:"Cancelar"})]})}),jt=xe?d?n.createPortal(kt,d):kt:null,Rt=qe||He;if(Ae&&!c){const e=!q&&(Ge||Ue||Fe),t=xt||je||"Digite ou cole um numero";return $.jsxs("div",{ref:D,tabIndex:0,role:"application","aria-label":"Discador mobile",onFocusCapture:dt,onBlurCapture:lt,className:Xh`callix mobile flex min-h-[calc(100vh-3rem)] w-full max-w-full flex-col gap-4 rounded-3xl border border-slate-200 bg-gradient-to-b from-white via-slate-50 to-white p-4 shadow-xl outline-none`,children:[$.jsxs("div",{className:Xh`flex items-center justify-between gap-2`,children:[$.jsxs("button",{type:"button",onClick:()=>{s?s():Qe()},className:Xh`inline-flex items-center gap-2 rounded-full border border-slate-200 bg-white px-3 py-2 text-sm font-semibold text-slate-700 shadow-sm transition hover:border-slate-300 hover:shadow-md`,children:[$.jsx(Sc,{className:Xh`text-base`}),"Voltar"]}),$.jsxs("div",{className:Xh`${Ot.badgeClass} inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-[11px] font-bold`,children:[$.jsx(Ot.Icon,{className:Xh`text-xs`}),$.jsx("span",{children:bt})]}),$.jsxs("button",{type:"button",onClick:Fe?rt:()=>we(!0),className:Xh`inline-flex items-center gap-1.5 rounded-full border ${Fe?"border-green-200 bg-green-50 text-green-700":"border-amber-200 bg-amber-50 text-amber-700"} px-3 py-2 text-sm font-semibold transition hover:shadow-md`,children:[Fe?$.jsx(Nc,{className:Xh`text-sm`}):$.jsx(Dc,{className:Xh`text-sm`}),Fe?"Voltar":"Pausa"]})]}),Rt?$.jsxs("div",{className:Xh`space-y-3`,children:[$.jsx(Q$,{statusLabel:bt,callTarget:yt,durationSeconds:Z}),$.jsx(sm,{})]}):$.jsxs("div",{className:Xh`space-y-2 rounded-2xl border border-slate-200 bg-white px-3 py-3 shadow-inner`,children:[$.jsxs("div",{className:Xh`flex items-center justify-between`,children:[$.jsx("span",{className:Xh`text-[11px] font-semibold uppercase tracking-wide text-slate-500`,children:"Número"}),De&&$.jsx("span",{className:Xh`text-[11px] font-semibold text-primary`,children:De})]}),$.jsxs("div",{className:Xh`flex items-center gap-3`,children:[$.jsx("input",{ref:U,type:"text",inputMode:"tel",value:je,onChange:ct,onClick:e=>te(e.target.selectionStart||0),onKeyUp:e=>te(e.target.selectionStart||0),onSelect:e=>te(e.target.selectionStart||0),onKeyDown:t=>ft(t,e),onPaste:ut,disabled:!e,placeholder:"Digite ou cole um numero",className:Xh`flex-1 bg-transparent text-3xl font-bold text-slate-900 outline-none placeholder:text-slate-300 disabled:opacity-60`}),$.jsxs("div",{className:Xh`flex items-center gap-2`,children:[$.jsx("button",{type:"button",onClick:et,disabled:!e,className:Xh`inline-flex h-10 w-10 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-700 shadow-sm transition hover:border-slate-300 hover:shadow-md disabled:opacity-40`,"aria-label":"Apagar último digito",children:$.jsx(Ac,{className:Xh`text-lg`})}),$.jsx("button",{type:"button",onClick:Qe,disabled:!e,className:Xh`inline-flex h-10 w-10 items-center justify-center rounded-full border border-rose-300 bg-rose-50 text-rose-600 shadow-sm transition hover:border-rose-400 hover:bg-rose-100 hover:shadow-md disabled:opacity-40`,"aria-label":"Limpar número",children:$.jsx(Yc,{className:Xh`text-lg`})})]})]}),$.jsx("p",{className:Xh`text-[11px] font-medium ${Le?"text-primary":"text-slate-500"}`,children:Le?`Será discado: ${Le}`:`Formatação automática: ${t}`})]}),$.jsx("div",{className:Xh`grid grid-cols-3 gap-2`,children:L$.map(t=>$.jsxs("button",{type:"button",onClick:()=>Ze(t.value),disabled:!e,className:Xh`flex h-14 flex-col items-center justify-center rounded-xl border border-slate-200 bg-white text-xl font-bold text-slate-900 shadow-sm transition active:scale-95 hover:border-slate-300 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-40`,children:[$.jsx("span",{children:t.value}),t.detail&&$.jsx("span",{className:Xh`text-[9px] font-semibold uppercase tracking-widest text-slate-400`,children:t.detail})]},t.value))}),$.jsxs("div",{className:Xh`grid grid-cols-3 gap-2`,children:[$.jsxs("button",{type:"button",onClick:()=>A(!T),className:Xh`${T?"border-rose-300 bg-rose-50 text-rose-700":"border-slate-200 bg-white text-slate-700"} flex items-center justify-center gap-2 rounded-xl border px-3 py-2 text-sm font-semibold shadow-sm transition hover:border-slate-300 hover:shadow-md`,children:[$.jsx(At,{className:Xh`text-base`}),T?"Mudo":"Áudio"]}),$.jsxs("button",{type:"button",onClick:()=>I(!O),className:Xh`${O?"border-amber-300 bg-amber-50 text-amber-700":"border-slate-200 bg-white text-slate-700"} flex items-center justify-center gap-2 rounded-xl border px-3 py-2 text-sm font-semibold shadow-sm transition hover:border-slate-300 hover:shadow-md`,children:[$.jsx(Tt,{className:Xh`text-base`}),O?"Saída off":`${Nt}%`]}),$.jsxs("button",{type:"button",onClick:Fe?rt:()=>we(!0),className:Xh`${Fe?"border-green-300 bg-green-50 text-green-700":"border-amber-300 bg-amber-50 text-amber-700"} flex items-center justify-center gap-2 rounded-xl border px-3 py-2 text-sm font-semibold shadow-sm transition hover:shadow-md`,children:[Fe?$.jsx(Nc,{className:Xh`text-base`}):$.jsx(Dc,{className:Xh`text-base`}),Fe?"Voltar":"Pausa"]})]}),$.jsxs("div",{className:Xh`flex flex-wrap items-center gap-2`,children:[Ue||Fe?$.jsxs("button",{type:"button",onClick:tt,disabled:!Ve,className:Xh`flex flex-1 min-w-[8rem] items-center justify-center gap-2 rounded-xl bg-green-500 px-4 py-3 text-base font-bold text-white shadow-lg transition hover:bg-green-600 hover:shadow-xl disabled:cursor-not-allowed disabled:opacity-60`,children:[$.jsx(Fc,{className:Xh`text-lg`}),"Ligar"]}):Be?$.jsxs($.Fragment,{children:[$.jsxs("button",{type:"button",onClick:at,className:Xh`flex flex-1 min-w-[7rem] items-center justify-center gap-2 rounded-xl bg-rose-500 px-4 py-3 text-sm font-bold text-white shadow-lg transition hover:bg-rose-600`,children:[$.jsx(Uc,{className:Xh`text-base`}),"Recusar"]}),$.jsxs("button",{type:"button",onClick:ot,className:Xh`flex flex-1 min-w-[7rem] items-center justify-center gap-2 rounded-xl bg-green-500 px-4 py-3 text-sm font-bold text-white shadow-lg transition hover:bg-green-600`,children:[$.jsx(Mc,{className:Xh`text-base`}),"Atender"]})]}):$.jsxs("button",{type:"button",onClick:it,className:Xh`flex flex-1 min-w-[8rem] items-center justify-center gap-2 rounded-xl bg-rose-500 px-4 py-3 text-base font-bold text-white shadow-lg transition hover:bg-rose-600 hover:shadow-xl`,children:[$.jsx(Uc,{className:Xh`text-lg`}),"Encerrar"]}),$.jsxs("button",{type:"button",onClick:o,className:Xh`inline-flex items-center justify-center gap-2 rounded-xl border border-slate-200 bg-white px-4 py-3 text-sm font-semibold text-slate-700 shadow-sm transition hover:border-red-400 hover:text-red-500`,children:[$.jsx(kc,{className:Xh`text-base`}),"Sair"]})]}),(F||q||pe)&&$.jsxs("div",{className:Xh`space-y-1.5`,children:[F&&$.jsxs("div",{className:Xh`flex items-start gap-2 rounded-xl border border-rose-200 bg-rose-50 px-2.5 py-2 text-[11px] text-rose-700`,children:[$.jsx(Cc,{className:Xh`mt-0.5 text-xs`}),$.jsx("span",{children:F})]}),q&&$.jsxs("div",{className:Xh`flex items-start gap-2 rounded-xl border border-amber-200 bg-amber-50 px-2.5 py-2 text-[11px] text-amber-700`,children:[$.jsx(Cc,{className:Xh`mt-0.5 text-xs`}),$.jsx("span",{children:q})]}),pe&&$.jsxs("div",{className:Xh`flex items-start gap-2 rounded-xl border border-sky-200 bg-sky-50 px-2.5 py-2 text-[11px] text-sky-700`,children:[$.jsx(Cc,{className:Xh`mt-0.5 text-xs`}),$.jsx("span",{children:pe})]})]}),jt]})}if(c){const e=qe||He,t=je.length>0,n=!e&&!t,r=!q&&(Ge||Ue||Fe);if(console.log("[FloatingDialer Mini] Estado:",{miniCanUseKeypad:r,callButtonDisabled:n,hasNumber:t,dialValue:je,isNumberValid:Ve,availabilityError:q,callState:Me,operatorState:null==p?void 0:p.state}),"afterCall"===Me){const e="success"===K?b:x,t=e.length>0;return console.log("[FloatingDialer Mini] ?? TELA DE QUALIFICA��O:",{callState:Me,afterCallResult:K,successQualifications:b.length,discardQualifications:x.length,hasOptions:t,selectedQualificationId:X}),$.jsx("div",{className:["callix","mode","min",Xh`flex w-full max-w-full flex-col gap-1 rounded-xl border border-slate-200 bg-white/95 p-1.5 shadow-sm text-slate-800 overflow-hidden`].join(" "),"data-callix-variant":"min",children:$.jsxs("div",{className:Xh`space-y-1 rounded-lg border border-slate-200 bg-slate-50 px-1.5 py-1 overflow-hidden`,children:[$.jsx("div",{className:Xh`text-center`,children:$.jsx("p",{className:Xh`text-[9px] font-semibold text-slate-700`,children:"Qualifique a chamada"})}),$.jsxs("div",{className:Xh`grid grid-cols-2 gap-0.5`,children:[$.jsx("button",{type:"button",onClick:()=>Y("success"),className:Xh`${"success"===K?"bg-green-500 text-white":"bg-white text-slate-600"} rounded border border-slate-200 px-1 py-0.5 text-[7px] font-semibold transition`,children:"✓ Concluído"}),$.jsx("button",{type:"button",onClick:()=>Y("failure"),className:Xh`${"failure"===K?"bg-rose-500 text-white":"bg-white text-slate-600"} rounded border border-slate-200 px-1 py-0.5 text-[7px] font-semibold transition`,children:"✗ Descartado"})]}),$.jsxs("div",{className:Xh`space-y-0.5`,children:[$.jsx("p",{className:Xh`text-[7px] font-medium text-slate-700 text-center`,children:"Selecione qualificação"}),t?$.jsx("div",{className:Xh`max-h-16 space-y-0.5 overflow-y-auto`,children:e.map(e=>{const t=X===e.id;return $.jsx("button",{type:"button",onClick:()=>J(e.id),className:Xh`${t?"bg-blue-100 border-blue-300 text-blue-800":"border-slate-200 bg-white text-slate-700"} w-full rounded border px-1 py-0.5 text-left transition`,children:$.jsx("p",{className:Xh`text-[7px] font-medium leading-tight truncate`,children:e.name})},e.id)})}):$.jsx("div",{className:Xh`rounded border border-amber-200 bg-amber-50 px-1 py-0.5 text-[7px] text-amber-700 text-center`,children:"Nenhuma qualificação"})]}),H&&$.jsx("p",{className:Xh`text-[7px] text-red-500 text-center`,children:H}),$.jsxs("button",{type:"button",onClick:st,disabled:!t||!X||G,className:Xh`flex w-full items-center justify-center gap-1 rounded bg-blue-500 px-1.5 py-1 text-[7px] font-bold text-white transition hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-60`,children:[G&&$.jsx("span",{className:Xh`inline-flex h-2 w-2 animate-spin rounded-full border border-white/50 border-t-white`}),"Finalizar"]})]})})}return console.log("[FloatingDialer Mini] ?? Estado da Chamada:",{isCallActive:e,callState:Me,statusLabel:bt,isInCall:qe,isConnecting:He,isRinging:ze,callDurationSeconds:Z,callTarget:yt,statusVisualUsed:e?"GREEN (green)":"statusVisual",timerVisible:e&&Z>0}),$.jsxs("div",{className:["callix","mode","min",Xh`flex w-full max-w-full flex-col gap-3 rounded-2xl border border-slate-200 bg-white/95 p-3 shadow-sm text-slate-800`].join(" "),"data-callix-variant":"min",children:[$.jsx("input",{ref:M,type:"tel",inputMode:"tel",value:je,onChange:e=>i(e.target.value),onPaste:ut,className:Xh`sr-only`,tabIndex:-1,"aria-hidden":"true"}),$.jsxs("div",{className:Xh`flex items-center justify-between gap-2`,children:[$.jsxs("div",{className:Xh`${e?"border-green-200 bg-green-50 text-green-700":Ot.badgeClass} flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-semibold uppercase leading-tight`,children:[$.jsx(Ot.Icon,{className:Xh`text-xs`}),$.jsx("span",{children:bt})]}),Fe?$.jsxs("button",{type:"button",onClick:()=>rt(),className:Xh`inline-flex items-center gap-1 rounded-full border border-green-400 bg-green-50 px-2.5 py-1 text-[10px] font-semibold text-green-700 transition hover:bg-green-100`,children:[$.jsx(Nc,{className:Xh`text-xs`}),"Voltar"]}):$.jsxs("button",{type:"button",onClick:()=>we(!0),className:Xh`inline-flex items-center gap-1 rounded-full border border-amber-300 bg-amber-50 px-2.5 py-1 text-[10px] font-semibold text-amber-700 transition hover:bg-amber-100`,children:[$.jsx(Dc,{className:Xh`text-xs`}),"Pausa"]})]}),e?$.jsx("div",{className:Xh`rounded-xl border border-green-200 bg-gradient-to-br from-green-50 to-white px-3 py-2`,children:$.jsxs("div",{className:Xh`flex items-center gap-2`,children:[$.jsx("div",{className:Xh`flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-green-500 ${Z>0?"animate-pulse":""}`,children:$.jsx(Lc,{className:Xh`text-xs text-white`})}),$.jsxs("div",{className:Xh`flex min-w-0 flex-1 flex-col gap-0.5`,children:[$.jsx("span",{className:Xh`truncate font-mono text-sm font-bold text-slate-800`,children:(null==yt?void 0:yt.replace(/^\+55/,""))||"Conectando..."}),$.jsx("span",{className:Xh`text-[9px] font-medium uppercase tracking-wider text-green-600`,children:bt})]}),Z>0&&$.jsxs("div",{className:Xh`flex shrink-0 items-center gap-1 rounded-lg bg-green-500 px-2 py-1`,children:[$.jsx(Tc,{className:Xh`text-[10px] text-white`}),$.jsx("span",{className:Xh`tabular-nums text-xs font-bold text-white`,children:J$(Z)})]})]})}):$.jsxs("div",{className:Xh`space-y-1 rounded-xl border border-slate-200 bg-slate-50 px-3 py-2`,children:[$.jsx("span",{className:Xh`text-[10px] font-semibold uppercase tracking-wide text-slate-500`,children:"Numero"}),$.jsxs("div",{className:Xh`flex items-center gap-2`,children:[$.jsx("input",{ref:U,type:"text",inputMode:"tel",value:je,onChange:ct,onClick:e=>{te(e.target.selectionStart||0)},onKeyUp:e=>{te(e.target.selectionStart||0)},onSelect:e=>{te(e.target.selectionStart||0)},onKeyDown:e=>ft(e,r),onPaste:ut,disabled:!r,placeholder:"Digite ou cole um numero",className:Xh`flex-1 bg-transparent text-sm font-semibold text-slate-800 outline-none placeholder:text-slate-400 placeholder:text-xs placeholder:font-normal disabled:opacity-60 disabled:cursor-not-allowed`}),$.jsx("button",{type:"button",onClick:et,disabled:!r,className:Xh`inline-flex h-8 w-8 items-center justify-center rounded-lg border border-slate-300 bg-white text-slate-600 transition hover:border-slate-400 hover:text-slate-800 disabled:opacity-40 disabled:cursor-not-allowed`,"aria-label":"Apagar ultimo digito",children:$.jsx(Ac,{className:Xh`text-base`})}),$.jsx("button",{type:"button",onClick:Qe,disabled:!r,className:Xh`inline-flex h-8 w-8 items-center justify-center rounded-lg border border-rose-300 bg-rose-50 text-rose-600 transition hover:border-rose-400 hover:bg-rose-100 disabled:opacity-40 disabled:cursor-not-allowed`,"aria-label":"Limpar numero",children:$.jsx(Yc,{className:Xh`text-sm`})})]}),Le&&$.jsxs("p",{className:Xh`text-[10px] font-medium text-primary`,children:["Será discado: ",Le]})]}),$.jsx("div",{className:Xh`grid grid-cols-3 gap-2`,children:L$.map(e=>$.jsxs("button",{type:"button",onClick:()=>Ze(e.value),disabled:!r,className:Xh`flex h-12 flex-col items-center justify-center rounded-lg border border-slate-200 bg-white text-base font-semibold text-slate-800 shadow-sm transition active:scale-95 hover:border-slate-300 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-40`,children:[$.jsx("span",{children:e.value}),e.detail&&$.jsx("span",{className:Xh`text-[8px] font-semibold uppercase tracking-widest text-slate-400`,children:e.detail})]},e.value))}),$.jsxs("button",{type:"button",onClick:()=>{e?it():tt()},disabled:n,className:Xh`${e?"bg-rose-500 hover:bg-rose-600":"bg-green-500 hover:bg-green-600"} flex h-11 w-full items-center justify-center gap-2 rounded-xl text-sm font-bold text-white shadow-md transition disabled:cursor-not-allowed disabled:opacity-60`,children:[$.jsx(Fc,{className:Xh`text-base`}),e?"Encerrar":"Ligar"]}),(F||q||pe)&&$.jsxs("div",{className:Xh`rounded-lg border border-rose-200 bg-rose-50 px-2.5 py-2 text-[11px] text-rose-700`,children:[$.jsx(Cc,{className:Xh`mr-1 inline text-xs`}),F||q||pe]}),jt]})}return $.jsxs("div",{ref:D,tabIndex:0,role:"application","aria-label":"Discador manual",onFocusCapture:dt,onBlurCapture:lt,className:Xh`space-y-3 rounded-2xl outline-none`,children:[$.jsxs("div",{className:Xh`flex items-center justify-between gap-2`,children:[$.jsxs("div",{className:Xh`flex items-center gap-2 min-w-0 flex-1`,children:[$.jsx("span",{className:Xh`inline-flex h-8 w-8 items-center justify-center rounded-lg bg-primary/10 text-primary shrink-0`,children:$.jsx(Hc,{className:Xh`text-sm`})}),$.jsxs("div",{className:Xh`min-w-0 flex-1`,children:[$.jsx("p",{className:Xh`text-sm font-bold text-slate-800 truncate`,children:e}),$.jsx("p",{className:Xh`text-[9px] uppercase tracking-wide text-slate-500 font-medium`,children:"Operador"})]})]}),$.jsxs("div",{className:Xh`flex items-center gap-2 shrink-0`,children:[Ue&&$.jsxs("button",{type:"button",onClick:()=>we(!0),className:Xh`inline-flex items-center gap-1 rounded-lg border border-amber-300 bg-amber-50 px-2 py-1 text-[10px] font-bold text-amber-700 transition-all hover:bg-amber-100 hover:shadow-sm`,"aria-label":"Entrar em pausa",children:[$.jsx(Dc,{className:Xh`text-xs`}),$.jsx("span",{children:"Pausa"})]}),Fe&&$.jsxs("button",{type:"button",onClick:rt,className:Xh`inline-flex items-center gap-1 rounded-lg border border-green-300 bg-green-50 px-2 py-1 text-[10px] font-bold text-green-700 transition-all hover:bg-green-100 hover:shadow-sm`,"aria-label":"Sair da pausa",children:[$.jsx(Nc,{className:Xh`text-xs`}),$.jsx("span",{children:"Voltar"})]}),$.jsxs("div",{className:Xh`${Ot.badgeClass} inline-flex items-center gap-1.5 rounded-lg border px-2 py-1 text-[10px] font-bold ${qe?"animate-pulse":""}`,children:[$.jsx(Ot.Icon,{className:Xh`text-xs`}),$.jsx("span",{children:bt}),$.jsx("span",{className:Xh`${Ot.dotClass} inline-flex h-1.5 w-1.5 rounded-full`,"aria-hidden":!0})]})]})]}),Rt&&$.jsxs($.Fragment,{children:[$.jsx(Q$,{statusLabel:bt,callTarget:yt,durationSeconds:Z}),$.jsx(sm,{})]}),!Rt&&$.jsxs("div",{ref:L,className:Xh`${R?"ring-2 ring-primary/50 shadow-lg":"shadow-sm"} relative overflow-hidden rounded-xl border border-slate-200 bg-gradient-to-br from-white to-slate-50 px-4 py-3 transition-all hover:shadow-md`,onClick:()=>{var e;return null==(e=D.current)?void 0:e.focus()},children:[$.jsx("input",{ref:M,id:"dialer-number",type:"tel",inputMode:"tel",value:je,onChange:e=>i(e.target.value),onPaste:ut,className:Xh`sr-only`,tabIndex:-1,"aria-hidden":"true"}),$.jsxs("div",{className:Xh`flex items-center justify-between mb-2`,children:[$.jsxs("div",{className:Xh`flex items-center gap-1.5`,children:[$.jsx(Fc,{className:Xh`text-sm text-primary`}),$.jsx("span",{className:Xh`text-[10px] uppercase tracking-wider text-slate-500 font-semibold`,children:"N�mero"})]}),R&&$.jsxs("span",{className:Xh`inline-flex items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-[9px] font-semibold text-primary`,children:[$.jsx("span",{className:Xh`inline-block h-1.5 w-1.5 rounded-full bg-primary animate-pulse`}),"Ativo"]})]}),$.jsx("div",{className:Xh`min-h-[2.5rem] flex items-center`,children:$.jsx("p",{className:Xh`text-2xl font-semibold tabular-nums tracking-tight text-slate-800 flex-1 truncate`,children:xt||$.jsx("span",{className:Xh`text-slate-400 text-lg font-normal`,children:"Digite um n�mero"})})}),Le&&$.jsxs("p",{className:Xh`mt-1 text-[11px] font-medium text-primary`,children:["Será discado: ",Le]})]}),$.jsx("div",{className:Xh`grid grid-cols-3 gap-2`,children:L$.map(e=>$.jsxs("button",{type:"button",onClick:()=>Ze(e.value),disabled:!Ge,className:Xh`relative flex h-14 flex-col items-center justify-center rounded-lg border border-slate-200 bg-gradient-to-b from-white to-slate-50 text-lg font-bold text-slate-800 shadow-sm transition-all active:scale-95 hover:border-slate-300 hover:shadow-md outline-none disabled:cursor-not-allowed disabled:opacity-40`,children:[$.jsx("span",{children:e.value}),e.detail&&$.jsx("span",{className:Xh`text-[8px] font-semibold tracking-widest text-slate-400 uppercase`,children:e.detail})]},e.value))}),$.jsxs("div",{className:Xh`space-y-2`,children:[$.jsxs("div",{className:Xh`flex flex-wrap items-center gap-2`,children:[Ue||Fe?$.jsxs("button",{type:"button",onClick:tt,disabled:!Ve,className:Xh`flex flex-1 min-w-[7rem] items-center justify-center gap-2 rounded-lg bg-green-500 px-4 py-2.5 text-sm font-bold text-white shadow-lg transition-all hover:bg-green-600 hover:shadow-xl disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:shadow-lg`,children:[$.jsx(Fc,{className:Xh`text-base`}),"Ligar"]}):Be?$.jsxs($.Fragment,{children:[$.jsxs("button",{type:"button",onClick:at,className:Xh`flex flex-1 min-w-[6rem] items-center justify-center gap-1.5 rounded-lg bg-rose-500 px-3 py-2 text-xs font-bold text-white shadow-md transition-all hover:bg-rose-600 hover:shadow-lg`,children:[$.jsx(Uc,{className:Xh`text-sm`}),"Recusar"]}),$.jsxs("button",{type:"button",onClick:ot,className:Xh`flex flex-1 min-w-[6rem] items-center justify-center gap-1.5 rounded-lg bg-green-500 px-3 py-2 text-xs font-bold text-white shadow-md transition-all hover:bg-green-600 hover:shadow-lg`,children:[$.jsx(Mc,{className:Xh`text-sm`}),"Atender"]})]}):$.jsxs("button",{type:"button",onClick:it,className:Xh`flex flex-1 min-w-[7rem] items-center justify-center gap-2 rounded-lg bg-rose-500 px-4 py-2.5 text-sm font-bold text-white shadow-lg transition-all hover:bg-rose-600 hover:shadow-xl`,children:[$.jsx(Uc,{className:Xh`text-base`}),"Encerrar"]}),$.jsxs("button",{type:"button",onClick:()=>A(!T),className:Xh`${T?"border-rose-300 bg-rose-50 text-rose-600":"border-slate-300 bg-white text-slate-700"} flex h-9 min-w-[4.5rem] flex-1 items-center justify-center gap-1 rounded-lg border px-2 py-1.5 text-[10px] font-bold transition-all hover:border-slate-400 hover:shadow-md disabled:cursor-not-allowed`,children:[$.jsx(At,{className:Xh`text-xs`}),T?"Mudo":"Mic"]}),$.jsxs("button",{type:"button",onClick:()=>I(!O),className:Xh`${O?"border-amber-300 bg-amber-50 text-amber-700":"border-slate-300 bg-white text-slate-700"} flex h-9 min-w-[4.5rem] flex-1 items-center justify-center gap-1 rounded-lg border px-2 py-1.5 text-[10px] font-bold transition-all hover:border-slate-400 hover:shadow-md`,children:[$.jsx(Tt,{className:Xh`text-xs`}),O?"Mudo":`${Nt}%`]}),$.jsx("button",{type:"button",onClick:et,className:Xh`flex h-9 w-9 items-center justify-center rounded-lg border border-slate-300 bg-white text-slate-700 transition-all hover:border-slate-400 hover:shadow-md`,"aria-label":"Apagar ultimo digito",children:$.jsx(Ac,{className:Xh`text-base`})}),$.jsx("button",{type:"button",onClick:Qe,className:Xh`flex h-9 w-9 items-center justify-center rounded-lg border border-rose-300 bg-rose-50 text-rose-700 font-bold text-xs transition-all hover:border-rose-400 hover:bg-rose-100 hover:shadow-md active:bg-rose-200`,"aria-label":"Limpar numero",children:"C"})]}),$.jsxs("div",{className:Xh`rounded-xl border border-slate-200 bg-white/80 p-3 shadow-sm`,children:[$.jsxs("div",{className:Xh`flex flex-wrap items-center justify-between gap-2`,children:[$.jsxs("div",{children:[$.jsx("p",{className:Xh`text-[10px] uppercase tracking-wide text-slate-500`,children:"Volume"}),$.jsxs("p",{className:Xh`text-sm font-semibold text-slate-800`,children:["Sa�da ",Nt,"%"]})]}),$.jsxs("div",{className:Xh`flex items-center gap-2`,children:[$.jsx("button",{type:"button",onClick:()=>mt((k??0)-.05),className:Xh`inline-flex h-8 w-8 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-600 transition hover:border-primary/60 hover:text-primary`,"aria-label":"Diminuir volume",children:$.jsx(Pc,{className:Xh`text-sm`})}),$.jsx("input",{type:"range",min:0,max:1,step:.01,value:Number.isFinite(k)?k:0,onChange:e=>mt(parseFloat(e.target.value)),className:Xh`h-1 w-full max-w-full cursor-pointer appearance-none rounded-full bg-slate-200 accent-primary`,"aria-label":"Volume de saida"}),$.jsx("button",{type:"button",onClick:()=>mt((k??0)+.05),className:Xh`inline-flex h-8 w-8 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-600 transition hover:border-primary/60 hover:text-primary`,"aria-label":"Aumentar volume",children:$.jsx(Bc,{className:Xh`text-sm`})})]})]}),$.jsxs("div",{className:Xh`mt-2 flex flex-wrap items-center gap-2 text-xs text-slate-600`,children:[$.jsxs("div",{className:Xh`flex items-center gap-1.5`,children:[$.jsx(Rc,{className:Xh`text-sm text-primary`}),$.jsx("span",{className:Xh`truncate max-w-full`,children:wt})]}),$.jsxs("div",{className:Xh`flex items-center gap-1.5`,children:[$.jsx(Ic,{className:Xh`text-sm text-primary`}),$.jsx("span",{className:Xh`truncate max-w-full`,children:_t})]}),(de.inputs.length>0||de.outputs.length>0)&&$.jsxs("button",{type:"button",onClick:()=>$e(e=>!e),className:Xh`inline-flex items-center gap-1 rounded-md border border-slate-300 bg-white px-2 py-0.5 text-[9px] font-bold text-slate-700 transition-all hover:border-slate-400 hover:shadow-sm`,children:[$.jsx(qc,{className:Xh`text-[10px]`}),ge?"Ocultar":"Config"]})]}),ge&&$.jsxs("div",{className:Xh`mt-3 grid gap-2`,children:[$.jsxs("label",{className:Xh`space-y-1 text-xs text-slate-700`,children:[$.jsxs("span",{className:Xh`flex items-center gap-1.5 font-semibold`,children:[$.jsx(Rc,{className:Xh`text-sm text-primary`}),"Entrada"]}),$.jsxs("select",{className:Xh`w-full rounded-lg border border-slate-200 bg-white px-2.5 py-1.5 text-xs shadow-inner focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/40`,value:ue??"",onChange:ht,children:[0===de.inputs.length&&$.jsx("option",{value:"",children:"Padr�o"}),de.inputs.map(e=>$.jsx("option",{value:e.deviceId,children:e.label||"Padr�o"},e.deviceId||e.label))]})]}),$.jsxs("label",{className:Xh`space-y-1 text-xs text-slate-700`,children:[$.jsxs("span",{className:Xh`flex items-center gap-1.5 font-semibold`,children:[$.jsx(Ic,{className:Xh`text-sm text-primary`}),"Sa�da"]}),$.jsxs("select",{className:Xh`w-full rounded-lg border border-slate-200 bg-white px-2.5 py-1.5 text-xs shadow-inner focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/40`,value:fe??"",onChange:pt,children:[0===de.outputs.length&&$.jsx("option",{value:"",children:"Padr�o"}),de.outputs.map(e=>$.jsx("option",{value:e.deviceId,children:e.label||"Padr�o"},e.deviceId||e.label))]})]})]})]})]}),(F||q||pe)&&$.jsxs("div",{className:Xh`space-y-1.5`,children:[F&&$.jsxs("div",{className:Xh`flex items-start gap-2 rounded-xl border border-rose-200 bg-rose-50 px-2.5 py-2 text-[11px] text-rose-700`,children:[$.jsx(Cc,{className:Xh`mt-0.5 text-xs`}),$.jsx("span",{children:F})]}),q&&$.jsxs("div",{className:Xh`flex items-start gap-2 rounded-xl border border-amber-200 bg-amber-50 px-2.5 py-2 text-[11px] text-amber-700`,children:[$.jsx(Cc,{className:Xh`mt-0.5 text-xs`}),$.jsx("span",{children:q})]}),pe&&$.jsxs("div",{className:Xh`flex items-start gap-2 rounded-xl border border-sky-200 bg-sky-50 px-2.5 py-2 text-[11px] text-sky-700`,children:[$.jsx(Cc,{className:Xh`mt-0.5 text-xs`}),$.jsx("span",{children:pe})]})]}),jt,$.jsxs("button",{type:"button",onClick:o,className:Xh`flex w-full items-center justify-center gap-2 rounded-2xl border border-slate-200 bg-white px-4 py-3 text-sm font-semibold text-slate-600 transition hover:border-red-400 hover:text-red-500`,children:[$.jsx(kc,{className:Xh`text-base`}),"Sair"]})]})}function W$(e,t){const n=function(e){return e&&"object"==typeof e?e:null}(e);if(n&&t in n)return n[t]}function G$(e,t){const n=W$(e,t);return"function"==typeof n?n:void 0}function V$(e){const t=W$(e,"counterpart");return function(e){if(!e||"object"!=typeof e)return!1;const t=e,n=t.displayName,r=t.phoneNumber;return!(null!=n&&"string"!=typeof n||null!=r&&"string"!=typeof r)}(t)?t:null}function K$(e,t){const n=e[t];if("number"==typeof n&&Number.isFinite(n))return n;if("string"==typeof n){const e=Number(n);if(Number.isFinite(e))return e}return null}const Y$={1:[1209,697],2:[1336,697],3:[1477,697],4:[1209,770],5:[1336,770],6:[1477,770],7:[1209,852],8:[1336,852],9:[1477,852],"*":[1209,941],0:[1336,941],"#":[1477,941]};function X$(e,t,n){return Number.isFinite(e)?n<t?t:Math.min(Math.max(e,t),n):t}function J$(e){const t=Math.max(0,Math.floor(e));return`${Math.floor(t/60).toString().padStart(2,"0")}:${(t%60).toString().padStart(2,"0")}`}function Z$({username:e,result:t,onChangeResult:n,successQualifications:r,discardQualifications:i,selectedQualificationId:o,onSelectQualification:a,onSubmit:s,isSubmitting:d,errorMessage:l,onLogout:u,isMobile:c=!1,onClose:f}){const h="success"===t?r:i,p=h.length>0;return $.jsxs("div",{className:Xh`${c?"min-h-[70vh] rounded-3xl border border-slate-200 bg-white p-4 shadow-xl":"space-y-5"}`,children:[$.jsxs("div",{className:Xh`mb-3 flex items-center justify-between`,children:[$.jsx("p",{className:Xh`text-xs uppercase tracking-wide text-slate-500`,children:"Logado como"}),f&&$.jsxs("button",{type:"button",onClick:f,className:Xh`inline-flex items-center gap-1 rounded-full border border-slate-200 bg-slate-50 px-3 py-1 text-xs font-semibold text-slate-600 transition hover:border-slate-300`,children:[$.jsx(Sc,{className:Xh`text-xs`}),"Voltar"]})]}),$.jsx("div",{className:Xh`${c?"space-y-3":"space-y-1"}`,children:$.jsx("p",{className:Xh`text-sm font-semibold text-slate-800`,children:e})}),$.jsxs("div",{className:Xh`space-y-4 rounded-2xl border border-slate-200 bg-slate-50 px-4 py-5 ${c?"shadow-inner":""}`,children:[$.jsxs("div",{children:[$.jsx("p",{className:Xh`text-sm font-semibold text-slate-700`,children:"Qualifique a chamada"}),$.jsx("p",{className:Xh`text-xs text-slate-500`,children:"Esta etapa e obrigatoria para registrar o desfecho do atendimento."})]}),$.jsxs("div",{className:Xh`${c?"grid grid-cols-1 gap-2":"grid grid-cols-2 gap-2"}`,children:[$.jsx("button",{type:"button",onClick:()=>n("success"),className:Xh`${"success"===t?"bg-green-500 text-white shadow-lg":"bg-white text-slate-600"} rounded-xl border border-slate-200 px-3 py-3 text-sm font-semibold transition hover:border-green-400`,children:"Atendimento concluido"}),$.jsx("button",{type:"button",onClick:()=>n("failure"),className:Xh`${"failure"===t?"bg-rose-500 text-white shadow-lg":"bg-white text-slate-600"} rounded-xl border border-slate-200 px-3 py-3 text-sm font-semibold transition hover:border-rose-400`,children:"Atendimento descartado"})]}),$.jsxs("div",{className:Xh`space-y-2`,children:[$.jsx("p",{className:Xh`text-sm font-medium text-slate-700`,children:"Selecione uma qualificacao"}),p?$.jsx("div",{className:Xh`${c?"max-h-64":"max-h-52"} space-y-2 overflow-y-auto pr-1`,children:h.map(e=>{const t=o===e.id;return $.jsx("button",{type:"button",onClick:()=>a(e.id),className:Xh`${t?"ring-2 ring-primary bg-primary/5 border-primary":"border-slate-200 bg-white"} w-full rounded-xl border px-3 py-3 text-left text-sm font-semibold transition hover:border-primary`,children:$.jsx("p",{className:Xh`text-sm font-semibold text-slate-800`,children:e.name})},e.id)})}):$.jsx("div",{className:Xh`rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-700`,children:"Nenhuma qualificacao disponivel para este tipo de resultado."})]}),l&&$.jsx("p",{className:Xh`text-xs text-red-500`,children:l}),$.jsxs("button",{type:"button",onClick:s,disabled:!p||!o||d,className:Xh`flex w-full items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2 text-sm font-semibold text-white shadow-lg transition hover:bg-primaryDark disabled:cursor-not-allowed disabled:opacity-60`,children:[d&&$.jsx("span",{className:Xh`inline-flex h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white`}),"Finalizar atendimento"]})]}),$.jsxs("button",{type:"button",onClick:u,className:Xh`flex w-full items-center justify-center gap-2 rounded-xl border border-slate-200 bg-white px-4 py-2 text-sm font-semibold text-slate-600 transition hover:border-red-400 hover:text-red-500`,children:[$.jsx(kc,{className:Xh`text-base`}),"Sair"]})]})}function Q$({statusLabel:e,callTarget:t,durationSeconds:n}){const r=n>0?J$(n):"00:00",i=(null==t?void 0:t.replace(/^\+55/,""))||"Conectando...";return $.jsx("div",{className:Xh`rounded-lg border border-green-200 bg-gradient-to-br from-green-50 to-white px-3 py-2`,children:$.jsxs("div",{className:Xh`flex items-center justify-between gap-3`,children:[$.jsxs("div",{className:Xh`flex items-center gap-2.5 min-w-0 flex-1`,children:[$.jsx("div",{className:Xh`flex items-center justify-center w-8 h-8 rounded-full bg-green-500 shrink-0 ${n>0?"animate-pulse":""}`,children:$.jsx(Lc,{className:Xh`text-sm text-white`})}),$.jsxs("div",{className:Xh`flex flex-col gap-0.5 min-w-0 flex-1`,children:[$.jsx("span",{className:Xh`text-base font-bold text-slate-800 truncate font-mono`,children:i}),$.jsx("span",{className:Xh`text-[9px] font-medium text-green-600 uppercase tracking-wider`,children:e})]})]}),n>0&&$.jsxs("div",{className:Xh`flex items-center gap-1.5 bg-green-500 rounded-lg px-2.5 py-1.5 shrink-0`,children:[$.jsx(Tc,{className:Xh`text-xs text-white`}),$.jsx("span",{className:Xh`text-sm font-bold tabular-nums text-white`,children:r})]})]})})}const ev=/[0-9*#]/;function tv(e){return(e??"").replace(/[^0-9*#]/g,"")}function nv(e,t){if(t<=0){const t=e.search(ev);return t<0?e.length:t}let n=0;for(let r=0;r<e.length;r++)if(ev.test(e[r])&&(n++,n===t))return r+1;return e.length}const rv=t.forwardRef(function({value:e,onChange:n,onSubmit:r,onKeyDown:i,inputMode:o="tel",autoComplete:a="off",...s},d){const l=t.useRef(null),u=t.useRef(null),c=m$(e),f=t.useRef(c),h=t.useCallback(e=>{l.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]);t.useLayoutEffect(()=>{f.current=c;const e=l.current,t=u.current;if(!e||null===t)return;if(u.current=null,"undefined"!=typeof document&&document.activeElement!==e)return;const n=nv(c,t);try{e.setSelectionRange(n,n)}catch{}},[c]);const p=t.useCallback(e=>{var t;const r=e.target,i=r.value,o=r.selectionStart??i.length,a=f.current,s=tv(a),d=(null==(t=e.nativeEvent)?void 0:t.inputType)??"";let l=function(e){let t=0;for(const n of e)ev.test(n)&&t++;return t}(i.slice(0,o)),c=tv(i);if(c===s&&i.length<a.length&&("deleteContentForward"===d?l<c.length&&(c=c.slice(0,l)+c.slice(l+1)):l>0&&(c=c.slice(0,l-1)+c.slice(l),l-=1)),c===s){r.value=a;const e=nv(a,l);try{r.setSelectionRange(e,e)}catch{}return}u.current=l,n(c)},[n]),m=t.useCallback(e=>{var t;const r=(null==(t=e.clipboardData)?void 0:t.getData("text"))??"";if(!r)return;e.preventDefault();const i=p$(r);i&&(u.current=i.length,n(i))},[n]),g=t.useCallback(e=>{null==i||i(e),e.defaultPrevented||"Enter"===e.key&&r&&(e.preventDefault(),r())},[i,r]);return $.jsx("input",{ref:h,type:"tel",inputMode:o,autoComplete:a,value:c,onChange:p,onPaste:m,onKeyDown:g,...s})});function iv(e,t="America/Sao_Paulo"){const n=function(e,t){const n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}),r={};for(const o of n.formatToParts(e))"literal"!==o.type&&(r[o.type]=o.value);const i="24"===r.hour?"00":r.hour;return{year:r.year,month:r.month,day:r.day,hour:i,minute:r.minute,second:r.second}}(e,t);return`${n.year}-${n.month}-${n.day}`}function ov(e,t,n=new Date){if(e===iv(n))return"Hoje";return e===iv(new Date(n.getTime()-864e5))?"Ontem":t}function av(e){const t=s$(e.phoneNumber);return!t.startsWith("55")||12!==t.length&&13!==t.length?t:t.slice(2)}function sv(e){return(e??"").toString().normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/\s+/g," ").trim()}function dv(e){const t=(e??"").trim();if(!t)return{kind:"empty",digits:"",text:""};const n=s$(t),r=t.replace(/[\d\s()+\-.]/g,"");return n.length>=3&&0===r.length?{kind:"phone",digits:n,text:sv(t)}:{kind:"text",digits:n,text:sv(t)}}function lv(e,t){if("empty"===t.kind)return!0;if("phone"===t.kind)return av(e).includes(t.digits)||s$(e.phoneNumber).includes(t.digits)||void 0!==e.protocol&&String(e.protocol).includes(t.digits);const n=function(e){const t=[e.formattedPhone,av(e),e.callTypeLabel,e.campaignName,e.contactLabel,e.qualificationName,e.failureCauseLabel,e.hangupCauseLabel,e.formattedDate,e.note,void 0!==e.protocol?String(e.protocol):void 0];if(e.fields)for(const n of Object.values(e.fields))null!=n&&t.push(String(n));return sv(t.filter(Boolean).join(" | "))}(e);return t.text.split(" ").filter(Boolean).every(e=>n.includes(e))}const uv=1,cv=2,fv=3,hv={manual:"Chamadas manuais",campaign:"Chamadas de campanha"},pv={audio:"Áudios (zip)",data:"Dados (planilha)"},mv=e=>new Intl.DateTimeFormat("en-CA",{timeZone:"America/Sao_Paulo",year:"numeric",month:"2-digit",day:"2-digit"}).format(e);function gv(e){const t=`${e.kind?hv[e.kind]:"Exportação"} · ${e.content?pv[e.content].toLowerCase():""}`.replace(/ · $/,"");return e.status===fv?`${t}: pronta${e.fileSize?` (${n=e.fileSize,!n||n<=0?"":n<1048576?`${Math.max(1,Math.round(n/1024))} KB`:`${(n/1024/1024).toFixed(1)} MB`})`:""}`:e.status===cv?`${t}: processando${e.progress?` ${e.progress}%`:""}`:e.status===uv?`${t}: na fila do Callix`:`${t}: ${e.statusLabel}`;var n}async function $v(e,t){const n=await e.json().catch(()=>null);return"string"==typeof(null==n?void 0:n.error)&&n.error?n.error:t}async function vv(e,t,n){const r=await fetch(`${e}/api/call-exports/${encodeURIComponent(n)}/download`,{method:"GET",headers:t,credentials:"omit"}),i=await r.json().catch(()=>null);return r.ok&&(null==i?void 0:i.url)&&i.export?{state:"ready",url:i.url,filename:i.filename??null,fileSize:i.fileSize??null,export:i.export}:409===r.status&&(null==i?void 0:i.export)?i.export.status<=fv?{state:"pending",export:i.export}:{state:"failed",message:i.error??`Exportação ${i.export.statusLabel}`,export:i.export}:{state:"failed",message:(null==i?void 0:i.error)??`Não foi possível consultar a exportação (${r.status})`,export:null==i?void 0:i.export}}function yv({apiBaseUrl:e,getAuthHeaders:n,onClose:r,pollIntervalMs:i=5e3}){const[o]=t.useState(()=>function(e=new Date){return{from:mv(new Date(e.getTime()-2592e6)),to:mv(e)}}()),[a,s]=t.useState("manual"),[d,l]=t.useState("audio"),[u,c]=t.useState(o.from),[f,h]=t.useState(o.to),[p,m]=t.useState(!1),[g,v]=t.useState(null),[y,b]=t.useState(null),[x,w]=t.useState(null),[_,C]=t.useState([]),[S,E]=t.useState(null),N=t.useRef(!0);t.useEffect(()=>(N.current=!0,()=>{N.current=!1}),[]),t.useEffect(()=>{let t=!0;return async function(e,t){const n=await fetch(`${e}/api/call-exports`,{method:"GET",headers:t,credentials:"omit"});if(!n.ok)throw new Error(await $v(n,`Não foi possível listar as exportações (${n.status})`));return(await n.json()).items??[]}(e,n()).then(e=>{t&&C(e.slice(0,3))}).catch(()=>{}),()=>{t=!1}},[e,n]),t.useEffect(()=>{if(!y||"ready"===(null==x?void 0:x.state)||"failed"===(null==x?void 0:x.state))return;let t=null,r=!0;const o=async()=>{const a=await vv(e,n(),y.id);r&&(w(a),"pending"===a.state?(b(a.export),t=setTimeout(o,i)):"ready"===a.state&&(b(a.export),C(e=>[a.export,...e.filter(e=>e.id!==a.export.id)].slice(0,3))))};return o(),()=>{r=!1,t&&clearTimeout(t)}},[null==y?void 0:y.id,e,n,i]);const T=t.useCallback(async()=>{if(v(null),u&&f)if(f<u)v("O fim do período vem antes do início.");else{m(!0),w(null);try{const t=await async function(e,t,n){const r=await fetch(`${e}/api/call-exports`,{method:"POST",headers:{"Content-Type":"application/json",...t},credentials:"omit",body:JSON.stringify(n)});if(!r.ok)throw new Error(await $v(r,`Não foi possível pedir a exportação (${r.status})`));return(await r.json()).export}(e,n(),{kind:a,content:d,from:u,to:f});if(!N.current)return;b(t),C(e=>[t,...e.filter(e=>e.id!==t.id)].slice(0,3))}catch(t){N.current&&v(t instanceof Error?t.message:"Não foi possível pedir a exportação.")}finally{N.current&&m(!1)}}else v("Informe o período.")},[e,n,a,d,u,f]),A=t.useCallback(async t=>{E(t.id),v(null);try{const r=await vv(e,n(),t.id);if(!N.current)return;"ready"===r.state?window.open(r.url,"_blank","noopener,noreferrer"):v("pending"===r.state?gv(r.export):r.message)}finally{N.current&&E(null)}},[e,n]);return $.jsxs("div",{className:"export-panel",role:"region","aria-label":"Exportar histórico",children:[$.jsxs("div",{className:"export-panel-header",children:[$.jsx("span",{className:"export-panel-title",children:"Exportar histórico"}),$.jsx("button",{type:"button",className:"export-panel-close",onClick:r,"aria-label":"Fechar exportação",children:$.jsx("i",{className:"fas fa-xmark","aria-hidden":"true"})})]}),$.jsxs("div",{className:"export-panel-form",children:[$.jsxs("label",{className:"export-panel-field",children:[$.jsx("span",{children:"Tipo"}),$.jsx("select",{value:a,onChange:e=>s(e.target.value),"aria-label":"Tipo de chamada",children:Object.keys(hv).map(e=>$.jsx("option",{value:e,children:hv[e]},e))})]}),$.jsxs("label",{className:"export-panel-field",children:[$.jsx("span",{children:"Conteúdo"}),$.jsx("select",{value:d,onChange:e=>l(e.target.value),"aria-label":"Conteúdo",children:Object.keys(pv).map(e=>$.jsx("option",{value:e,children:pv[e]},e))})]}),$.jsxs("label",{className:"export-panel-field",children:[$.jsx("span",{children:"De"}),$.jsx("input",{type:"date",value:u,max:f,onChange:e=>c(e.target.value),"aria-label":"Início do período"})]}),$.jsxs("label",{className:"export-panel-field",children:[$.jsx("span",{children:"Até"}),$.jsx("input",{type:"date",value:f,min:u,onChange:e=>h(e.target.value),"aria-label":"Fim do período"})]}),$.jsx("button",{type:"button",className:"retry-btn export-panel-submit",onClick:()=>{T()},disabled:p,children:p?"Pedindo...":"Exportar"})]}),g&&$.jsx("div",{className:"export-panel-error",role:"alert",children:g}),y&&$.jsxs("div",{className:"export-panel-job",role:"status",children:[$.jsx("span",{children:"failed"===(null==x?void 0:x.state)?x.message:gv(y)}),"ready"===(null==x?void 0:x.state)&&$.jsxs("a",{className:"export-panel-link",href:x.url,target:"_blank",rel:"noopener noreferrer",children:[$.jsx("i",{className:"fas fa-download","aria-hidden":"true"})," Baixar ",x.filename??"arquivo"]})]}),_.length>0&&$.jsx("ul",{className:"export-panel-recent","aria-label":"Exportações recentes",children:_.map(e=>$.jsxs("li",{children:[$.jsx("span",{children:gv(e)}),e.status===fv&&$.jsx("button",{type:"button",className:"export-panel-recent-btn",onClick:()=>{A(e)},disabled:S===e.id,children:S===e.id?"...":"Baixar"})]},e.id))}),$.jsx("p",{className:"export-panel-hint",children:"O Callix prepara o arquivo em alguns minutos; o link de download vale por cerca de uma hora."})]})}function bv(){return $.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[$.jsx("line",{x1:"7",y1:"17",x2:"17",y2:"7"}),$.jsx("polyline",{points:"7 7 17 7 17 17"})]})}function xv(){return $.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[$.jsx("line",{x1:"17",y1:"7",x2:"7",y2:"17"}),$.jsx("polyline",{points:"17 17 7 17 7 7"})]})}function wv({state:e,onRetry:n,autoPlay:r}){const i=t.useRef(null),o="ready"===(null==e?void 0:e.status)?e.url:void 0;return t.useEffect(()=>{const e=i.current;if(r&&o&&e&&"function"==typeof e.play)try{const t=e.play();t&&"function"==typeof t.catch&&t.catch(()=>{})}catch{}},[r,o]),e&&"loading"!==e.status?"error"===e.status?$.jsxs("div",{className:"history-player error",role:"alert",children:[$.jsx("i",{className:"fas fa-circle-exclamation","aria-hidden":"true"}),$.jsx("span",{children:e.error||"Erro ao carregar gravação"}),$.jsx("button",{type:"button",className:"retry-link",onClick:n,children:"Tentar novamente"})]}):$.jsx("div",{className:"history-player",children:$.jsx("audio",{ref:i,controls:!0,preload:"metadata",src:e.url,"aria-label":"Gravação da chamada"})}):$.jsxs("div",{className:"history-player loading",role:"status",children:[$.jsx("i",{className:"fas fa-spinner fa-spin","aria-hidden":"true"}),$.jsx("span",{children:"Carregando gravação..."})]})}function _v({item:e,dayLabel:t,isPlayerOpen:n,recording:r,onTogglePlayer:i,onRetryRecording:o,onOpenDetails:a,onCall:s,onWhatsApp:d}){const l=e.wasAnswered?"":"missed",u=e=>e.stopPropagation(),c=!(!(f=e.qualificationName)||"chamada sem qualificação"===f.trim().toLowerCase());var f;let h=null;return e.wasAnswered?"campaign"===e.callType?h=$.jsxs("span",{className:"history-item-sub campaign "+(c?"with-qualification":""),children:[$.jsx("span",{className:"history-campaign-name",title:e.campaignName,children:e.campaignName||"Campanha"}),c&&$.jsxs($.Fragment,{children:[$.jsx("span",{className:"history-meta-dot",children:"•"}),$.jsx("span",{className:"history-qualification",title:e.qualificationName,children:e.qualificationName})]})]}):c&&(h=$.jsx("span",{className:"history-item-sub",children:$.jsx("span",{className:"history-qualification",title:e.qualificationName,children:e.qualificationName})})):h=$.jsxs("span",{className:"history-item-sub failure",children:[$.jsx("i",{className:"fas fa-circle-exclamation","aria-hidden":"true"}),$.jsx("span",{children:e.failureCauseLabel||"Não completada"})]}),$.jsxs("div",{className:`history-item ${l} ${n?"expanded":""}`,"data-call-id":e.id,children:[$.jsxs("div",{className:"history-item-row",children:[$.jsx("div",{className:"history-arrow "+(e.wasAnswered?"answered":"missed"),children:"incoming"===e.callDirection?$.jsx(xv,{}):$.jsx(bv,{})}),$.jsxs("button",{type:"button",className:"history-item-info",onClick:()=>a(e),title:"Ver detalhes da chamada",children:[$.jsx("span",{className:`history-item-number ${l} ${"campaign"===e.callType?"linked":""}`,children:e.formattedPhone}),$.jsxs("span",{className:"history-item-meta",children:[$.jsx("span",{className:`history-type-badge ${e.callType}`,children:e.callTypeLabel}),$.jsxs("span",{className:"history-item-datetime",children:[t," ",e.formattedTime]}),e.wasAnswered&&void 0!==e.duration&&$.jsx("span",{className:"history-item-duration",children:e.formattedDuration})]}),h]}),$.jsxs("div",{className:"history-actions",children:[e.hasAudio&&$.jsx("button",{type:"button",className:"history-action-btn play-btn "+(n?"active":""),onClick:t=>{u(t),i(e)},title:n?"Fechar gravação":"Ouvir gravação","aria-label":n?"Fechar gravação":"Ouvir gravação",children:$.jsx("i",{className:"fas "+(n?"fa-xmark":"fa-play"),"aria-hidden":"true"})}),$.jsx("button",{type:"button",className:"history-action-btn call-btn",onClick:t=>{u(t),s(e)},title:"Ligar","aria-label":"Ligar",children:$.jsx("i",{className:"fas fa-phone","aria-hidden":"true"})}),$.jsx("button",{type:"button",className:"history-action-btn whatsapp-btn",onClick:t=>{u(t),d(e)},title:"WhatsApp","aria-label":"WhatsApp",children:$.jsx("i",{className:"fab fa-whatsapp","aria-hidden":"true"})})]})]}),n&&e.hasAudio&&$.jsx(wv,{state:r,onRetry:()=>o(e),autoPlay:!0})]})}function Cv({label:e,value:t,tone:n,wide:r}){return t?$.jsxs("div",{className:"details-row "+(r?"wide":""),children:[$.jsx("div",{className:"details-label",children:e}),$.jsx("div",{className:`details-value ${n??""}`,children:t})]}):null}function Sv({item:e,dayLabel:n,apiBaseUrl:r,getAuthHeaders:i,recording:o,onLoadRecording:a,onClose:s,onCall:d,onWhatsApp:l}){const[u,c]=t.useState({status:"idle",form:null}),f=t.useRef(null),h="campaign"===e.callType;t.useEffect(()=>{var e;if("undefined"==typeof document)return;const t=document.activeElement;null==(e=f.current)||e.focus();const n=e=>{"Escape"===e.key&&(e.stopPropagation(),s())};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n),t&&"function"==typeof t.focus&&document.contains(t)&&t.focus()}},[s]),t.useEffect(()=>{if(!h||!e.campaignContactId)return void c({status:"idle",form:null});let t=!1;return c({status:"loading",form:null}),rm({source:"campaign",id:e.campaignContactId,campaignId:e.campaignId??null,signature:e.formSignature??null,expiresAt:e.formExpiresAt??null},{apiBaseUrl:r,headers:i(),retries:0}).then(e=>{t||c({status:"ready",form:e})}).catch(e=>{t||(console.warn("[CallHistoryList] Formulário da campanha indisponível, usando campos do histórico:",e),c({status:"error",form:null,error:e instanceof Error?e.message:"Erro ao carregar formulário"}))}),()=>{t=!0}},[r,i,h,e.campaignContactId,e.campaignId,e.id]);const p=t.useMemo(()=>Object.entries(e.fields??{}).filter(([e,t])=>null!=t&&""!==String(t).trim()&&!function(e){const t=e.trim().toLowerCase();return/(^|[\s_-])id$/.test(t)}(e)),[e.fields]),m=t.useMemo(()=>{const t=new Map;for(const[n,r]of Object.entries(e.fields??{}))null!=r&&""!==String(r).trim()&&t.set(am(im(n)),String(r));return t},[e.fields]),g=e=>{if(e.value&&""!==e.value.trim())return e.value;return m.get(am(im(e.label)))??m.get(am(im(e.key)))??"-"},v="ready"===u.status&&u.form?u.form.rows&&u.form.rows.length>0?u.form.rows:u.form.fields.length>0?[u.form.fields]:[]:[],y=v.length>0;let b;b="loading"===u.status&&0===p.length?$.jsxs("div",{className:"details-loading",role:"status",children:[$.jsx("i",{className:"fas fa-spinner fa-spin","aria-hidden":"true"}),$.jsx("span",{children:"Carregando formulário..."})]}):y?v.map((e,t)=>$.jsx("div",{className:"details-form-row",children:e.map((e,n)=>$.jsxs("div",{className:"details-field",children:[$.jsx("div",{className:"details-field-label",title:e.label,children:e.label}),$.jsx("div",{className:"details-field-value",children:g(e)})]},`${t}-${n}-${e.key}`))},t)):p.length>0?$.jsxs($.Fragment,{children:["loading"===u.status&&$.jsxs("div",{className:"details-loading details-loading-inline",role:"status",children:[$.jsx("i",{className:"fas fa-spinner fa-spin","aria-hidden":"true"}),$.jsx("span",{children:"Atualizando formulário..."})]}),$.jsx("div",{className:"details-form-row",children:p.map(([e,t])=>$.jsxs("div",{className:"details-field",children:[$.jsx("div",{className:"details-field-label",title:e,children:e}),$.jsx("div",{className:"details-field-value",children:t})]},e))})]}):$.jsxs("div",{className:"details-empty",children:[$.jsx("i",{className:"fas fa-user","aria-hidden":"true"}),$.jsx("span",{children:"error"===u.status?u.error||"Formulário indisponível":"Nenhum dado do cliente disponível"})]});let x=null;return e.hasAudio&&(x="ready"===(null==o?void 0:o.status)?$.jsx("audio",{controls:!0,preload:"metadata",src:o.url,"aria-label":"Gravação da chamada"}):"loading"===(null==o?void 0:o.status)?$.jsxs("div",{className:"details-loading",role:"status",children:[$.jsx("i",{className:"fas fa-spinner fa-spin","aria-hidden":"true"}),$.jsx("span",{children:"Carregando gravação..."})]}):"error"===(null==o?void 0:o.status)?$.jsxs("div",{className:"details-error",role:"alert",children:[$.jsx("i",{className:"fas fa-circle-exclamation","aria-hidden":"true"}),$.jsx("span",{children:o.error}),$.jsx("button",{type:"button",className:"retry-link",onClick:()=>a(e,!0),children:"Tentar novamente"})]}):$.jsxs("button",{type:"button",className:"details-play-btn",onClick:()=>a(e),children:[$.jsx("i",{className:"fas fa-play","aria-hidden":"true"}),$.jsx("span",{children:"Ouvir gravação"})]})),$.jsx("div",{className:"modal-overlay history-details-overlay active",onClick:s,role:"presentation",children:$.jsxs("div",{className:"modal-content history-details-sheet",onClick:e=>e.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":`Detalhes da chamada para ${e.formattedPhone}`,children:[$.jsxs("div",{className:"modal-header",children:[$.jsxs("div",{className:"history-details-heading",children:[$.jsx("h2",{className:"modal-title",children:e.formattedPhone}),$.jsxs("div",{className:"history-details-subtitle",children:[$.jsx("span",{className:`history-type-badge ${e.callType}`,children:e.callTypeLabel}),$.jsxs("span",{children:[n," ",e.formattedTimeWithSeconds]})]})]}),$.jsx("button",{ref:f,type:"button",className:"modal-close",onClick:s,"aria-label":"Fechar",children:$.jsx("i",{className:"fas fa-xmark","aria-hidden":"true"})})]}),$.jsxs("div",{className:"history-details-body",children:[h&&$.jsxs("section",{className:"details-section",children:[$.jsx("div",{className:"details-section-title",children:"Campanha"}),$.jsx("div",{className:"details-campaign-name",children:e.campaignName||"-"}),e.contactLabel&&$.jsxs("div",{className:"details-contact-label",children:["Cliente: ",e.contactLabel]})]}),$.jsxs("section",{className:"details-section details-grid",children:[$.jsx(Cv,{label:"Status",value:e.wasAnswered?"Completada":"Não completada",tone:e.wasAnswered?"success":"failure"}),$.jsx(Cv,{label:"Duração",value:e.formattedDuration}),!e.wasAnswered&&$.jsx(Cv,{label:"Motivo",value:e.failureCauseLabel||"Não informado",tone:"failure"}),e.wasAnswered&&$.jsx(Cv,{label:"Quem desligou",value:e.hangupCauseLabel}),$.jsx(Cv,{label:"Qualificação",value:e.qualificationName,wide:!0}),$.jsx(Cv,{label:"Protocolo",value:e.protocol?String(e.protocol):void 0}),$.jsx(Cv,{label:"Data",value:e.formattedDate}),$.jsx(Cv,{label:"Observação",value:e.note,wide:!0})]}),e.hasAudio&&$.jsxs("section",{className:"details-section",children:[$.jsx("div",{className:"details-section-title",children:"Gravação"}),x]}),h&&$.jsxs("section",{className:"details-section",children:[$.jsx("div",{className:"details-section-title",children:"Formulário da campanha"}),b]})]}),$.jsxs("div",{className:"history-details-actions",children:[$.jsxs("button",{type:"button",className:"details-action-btn call",onClick:()=>d(e),children:[$.jsx("i",{className:"fas fa-phone","aria-hidden":"true"}),$.jsx("span",{children:"Ligar"})]}),$.jsxs("button",{type:"button",className:"details-action-btn whatsapp",onClick:()=>l(e),children:[$.jsx("i",{className:"fab fa-whatsapp","aria-hidden":"true"}),$.jsx("span",{children:"WhatsApp"})]})]})]})})}function Ev({items:e,isLoading:n,error:r,onRefresh:i,onCall:o,onWhatsApp:a,apiBaseUrl:s,getAuthHeaders:d,query:l,onQueryChange:u,isSearching:c=!1,searchHint:f=null}){const[h,p]=t.useState(null),[m,g]=t.useState(null),[v,y]=t.useState(!1),b=function(e,n){const[i,o]=t.useState({}),a=t.useRef(i),s=t.useRef(new Map),d=t.useRef(new Set);t.useEffect(()=>{a.current=i},[i]);const l=t.useCallback(e=>{const t=s.current.get(e);t&&(URL.revokeObjectURL(t),s.current.delete(e))},[]);t.useEffect(()=>{const e=s.current;return()=>{e.forEach(e=>URL.revokeObjectURL(e)),e.clear()}},[]);const u=t.useCallback(e=>{d.current=e;const t=Object.keys(a.current).filter(t=>!e.has(t));0!==t.length&&(t.forEach(l),o(e=>{const n={...e};return t.forEach(e=>{delete n[e]}),n}))},[l]),c=t.useCallback(async(t,i=!1)=>{if(!t.audioPath)return;const u=a.current[t.id];if(i||!u||"loading"!==u.status&&"ready"!==u.status){d.current=new Set([...d.current,t.id]),l(t.id),o(e=>({...e,[t.id]:{status:"loading"}}));try{if(!t.audioSignature||!t.audioExpiresAt)throw new Error("Gravação indisponível. Atualize o histórico.");const r=new URLSearchParams({path:t.audioPath,exp:String(t.audioExpiresAt),sig:t.audioSignature}),i=`${e}/api/call-audio?${r.toString()}`,a=await fetch(i,{method:"GET",headers:n(),credentials:"omit"});if(!a.ok){const e=await a.json().catch(()=>({}));throw new Error(e.error||`Erro ${a.status}`)}const u=await a.blob();if(!d.current.has(t.id))return void o(e=>{const n={...e};return delete n[t.id],n});l(t.id);const c=URL.createObjectURL(u);s.current.set(t.id,c),o(e=>({...e,[t.id]:{status:"ready",url:c}}))}catch(r){const n=r instanceof Error?r.message:"Erro ao carregar gravação";console.error("[CallHistoryList] Erro ao carregar gravação:",r),o(e=>({...e,[t.id]:{status:"error",error:n}}))}}},[e,n,l]);return t.useMemo(()=>({states:i,load:c,retain:u}),[i,c,u])}(s,d),{retain:x}=b,[w,_]=t.useState(l??""),C=t.useRef(l??""),S=t.useRef(null);t.useEffect(()=>{const e=l??"";e!==C.current&&(C.current=e,_(e))},[l]),t.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]);const E=t.useCallback(e=>{_(e),u&&(S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{C.current=e,u(e)},350))},[u]),N=t.useCallback(()=>{_(""),S.current&&clearTimeout(S.current),C.current="",null==u||u("")},[u]),T=t.useMemo(()=>dv(w),[w]),A=t.useMemo(()=>function(e,t){const n="string"==typeof t?dv(t):t;return"empty"===n.kind?e:e.filter(e=>lv(e,n))}(e,T),[e,T]),O="empty"!==T.kind,I=t.useMemo(()=>{const t=new Date,n={};for(const r of e)n[r.id]=ov(r.dateKey,r.formattedDate,t);return n},[e]),k=t.useMemo(()=>e.find(e=>e.id===m)??null,[e,m]);t.useEffect(()=>{const t=new Set(e.map(e=>e.id)),n=new Set;h&&t.has(h)&&n.add(h),m&&t.has(m)&&n.add(m),x(n)},[h,m,e,x]);const j=t.useCallback(e=>{h!==e.id?(p(e.id),b.load(e)):p(null)},[h,b]),R=t.useCallback(e=>{b.load(e,!0)},[b]),P=t.useCallback((e,t=!1)=>{b.load(e,t)},[b]),D=t.useCallback(e=>{p(null),g(e.id)},[]),L=t.useCallback(()=>g(null),[]);return $.jsxs($.Fragment,{children:[$.jsxs("div",{className:"history-header",children:[$.jsx("h1",{className:"header-title",children:"Recentes"}),$.jsxs("div",{className:"history-header-actions",children:[$.jsx("button",{type:"button",className:"history-refresh-btn history-export-btn "+(v?"active":""),onClick:()=>y(e=>!e),"aria-label":"Exportar histórico","aria-pressed":v,title:"Exportar áudios ou dados do período",children:$.jsx("i",{className:"fas fa-file-export","aria-hidden":"true"})}),$.jsx("button",{type:"button",className:"history-refresh-btn",onClick:i,disabled:n,"aria-label":"Atualizar histórico",children:$.jsx("i",{className:"fas fa-arrows-rotate "+(n?"fa-spin":""),"aria-hidden":"true"})})]})]}),v&&$.jsx(yv,{apiBaseUrl:s,getAuthHeaders:d,onClose:()=>y(!1)}),$.jsxs("div",{className:"history-search-bar",children:[$.jsxs("label",{className:"history-search",children:[$.jsx("i",{className:"fas fa-magnifying-glass history-search-icon","aria-hidden":"true"}),$.jsx("input",{type:"search",className:"history-search-input",placeholder:"Buscar número, campanha, cliente...","aria-label":"Buscar no histórico",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,value:w,onChange:e=>E(e.target.value)}),c?$.jsx("i",{className:"fas fa-spinner fa-spin history-search-spinner","aria-hidden":"true",title:"Buscando..."}):w?$.jsx("button",{type:"button",className:"history-search-clear",onClick:N,"aria-label":"Limpar busca",children:$.jsx("i",{className:"fas fa-xmark","aria-hidden":"true"})}):null]}),O&&f&&$.jsx("div",{className:"history-search-hint",children:f})]}),$.jsx("div",{className:"call-history-list",id:"callHistoryList",children:n&&0===e.length?$.jsxs("div",{className:"history-loading",role:"status",children:[$.jsx("i",{className:"fas fa-spinner fa-spin","aria-hidden":"true"}),$.jsx("span",{children:"Carregando..."})]}):r?$.jsxs("div",{className:"history-error",role:"alert",children:[$.jsx("i",{className:"fas fa-exclamation-circle","aria-hidden":"true"}),$.jsx("span",{children:r}),$.jsx("button",{type:"button",className:"retry-btn",onClick:i,children:"Tentar novamente"})]}):0===e.length?$.jsxs("div",{className:"history-empty",children:[$.jsx("i",{className:"fas fa-phone-slash","aria-hidden":"true"}),$.jsx("span",{children:"Nenhuma ligação recente"})]}):0===A.length?$.jsxs("div",{className:"history-empty history-empty-search",children:[$.jsx("i",{className:"fas fa-magnifying-glass","aria-hidden":"true"}),$.jsxs("span",{children:["Nenhuma chamada encontrada para ",$.jsxs("strong",{children:["“",w.trim(),"”"]})]}),c&&$.jsx("span",{className:"history-search-status",children:"Buscando no servidor..."})]}):A.map(e=>$.jsx(_v,{item:e,dayLabel:I[e.id]??e.formattedDate,isPlayerOpen:h===e.id,recording:b.states[e.id],onTogglePlayer:j,onRetryRecording:R,onOpenDetails:D,onCall:o,onWhatsApp:a},e.id))}),k&&$.jsx(Sv,{item:k,dayLabel:I[k.id]??k.formattedDate,apiBaseUrl:s,getAuthHeaders:d,recording:b.states[k.id],onLoadRecording:P,onClose:L,onCall:e=>{g(null),o(e)},onWhatsApp:a})]})}const Nv={light:10,medium:20,heavy:30,selection:10,success:[10,30,10],warning:[20,30,20],error:[30,50,30,50,30]};const Tv={1:[697,1209],2:[697,1336],3:[697,1477],4:[770,1209],5:[770,1336],6:[770,1477],7:[852,1209],8:[852,1336],9:[852,1477],"*":[941,1209],0:[941,1336],"#":[941,1477]},Av=120,Ov=.08,Iv=.01;let kv=0,jv=0;const Rv=[],Pv=[],Dv=new Set,Lv={log:console.log.bind(console),info:console.info.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),debug:console.debug.bind(console)};let Mv=!1;function Uv(e,t,n,r,i){const o={id:++kv,timestamp:new Date,level:e,category:t,message:n,data:r,stack:i};for(Rv.push(o);Rv.length>1e3;)Rv.shift();return Dv.forEach(e=>e()),o}function Fv(e){const t={id:++jv,timestamp:new Date,...e};for(Pv.push(t);Pv.length>200;)Pv.shift();return Dv.forEach(e=>e()),t}function Bv(){if(Mv)return;Mv=!0;const e=(e,t)=>(...n)=>{var r;t(...n);const{category:i,isSIP:o}=function(e){const t=e[0];if("string"==typeof t){if(t.includes("[Callix Dialer]"))return{category:"Callix",isSIP:!1};if(t.includes("[MobileDialer]"))return{category:"MobileDialer",isSIP:!1};if(t.includes("[FloatingDialer]"))return{category:"FloatingDialer",isSIP:!1};if(t.includes("[InlineDialer]"))return{category:"InlineDialer",isSIP:!1};if(t.includes("[DraggableClientInfoModal]"))return{category:"ClientInfo",isSIP:!1};if(t.includes("[WhatsApp"))return{category:"WhatsApp",isSIP:!1};if(t.includes("[API"))return{category:"API",isSIP:!1};if(t.includes("SIP")||t.includes("sip:"))return{category:"SIP",isSIP:!0};if(t.includes("WebSocket"))return{category:"WebSocket",isSIP:!0};if(t.includes("WebRTC")||t.includes("RTC"))return{category:"WebRTC",isSIP:!0};if(t.includes("ICE"))return{category:"ICE",isSIP:!0};if(t.includes("SRTP")||t.includes("DTLS"))return{category:"Media",isSIP:!0};if(t.includes("SDK")||t.includes("sdk"))return{category:"SDK",isSIP:!1};if(t.includes("CallOperator"))return{category:"CallOperator",isSIP:!1};if(t.includes("useEffect")||t.includes("useState"))return{category:"React",isSIP:!1};if(t.includes("render")||t.includes("Render"))return{category:"React",isSIP:!1}}return{category:"General",isSIP:!1}}(n),{message:a,data:s}=function(e){if(0===e.length)return{message:""};const t=[];let n;for(let r=0;r<e.length;r++){const i=e[r];"string"==typeof i?t.push(i):"number"==typeof i||"boolean"==typeof i?t.push(String(i)):i instanceof Error?(t.push(`${i.name}: ${i.message}`),n={errorStack:i.stack}):void 0!==i&&(void 0===n?n=i:Array.isArray(n)?n.push(i):n=[n,i],t.push("object"==typeof i?"[Object]":String(i)))}return{message:t.join(" "),data:n}}(n);let d;"error"===e&&(d=null==(r=(new Error).stack)?void 0:r.split("\n").slice(2).join("\n")),Uv(o?"sip":e,i,a,s,d)};console.log=e("log",Lv.log),console.info=e("info",Lv.info),console.warn=e("warn",Lv.warn),console.error=e("error",Lv.error),console.debug=e("debug",Lv.debug)}async function qv(){const e={userAgent:navigator.userAgent,platform:navigator.platform,language:navigator.language,cookieEnabled:navigator.cookieEnabled,onLine:navigator.onLine,screenWidth:screen.width,screenHeight:screen.height,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,devicePixelRatio:window.devicePixelRatio,touchSupport:"ontouchstart"in window||navigator.maxTouchPoints>0,mediaDevices:{audioInputs:0,audioOutputs:0,videoInputs:0},permissions:{}};try{const t=await navigator.mediaDevices.enumerateDevices();e.mediaDevices={audioInputs:t.filter(e=>"audioinput"===e.kind).length,audioOutputs:t.filter(e=>"audiooutput"===e.kind).length,videoInputs:t.filter(e=>"videoinput"===e.kind).length}}catch(r){Uv("warn","DeviceInfo","Failed to enumerate media devices",r)}try{if("permissions"in navigator){const t=await navigator.permissions.query({name:"microphone"});e.permissions.microphone=t.state;const n=await navigator.permissions.query({name:"notifications"});e.permissions.notifications=n.state}}catch(r){}const t=navigator.connection;t&&(e.connection={type:t.type,effectiveType:t.effectiveType,downlink:t.downlink,rtt:t.rtt});const n=performance;return n.memory&&(e.memory={jsHeapSizeLimit:n.memory.jsHeapSizeLimit,totalJSHeapSize:n.memory.totalJSHeapSize,usedJSHeapSize:n.memory.usedJSHeapSize}),e}async function zv(){const e=await qv(),t=[];if(t.push("═══════════════════════════════════════════════════════════════"),t.push(" CALLIX DIALER DEBUG LOG "),t.push("═══════════════════════════════════════════════════════════════"),t.push(`Exported: ${(new Date).toISOString()}`),t.push(""),t.push("┌─────────────────────────────────────────────────────────────┐"),t.push("│ DEVICE INFO │"),t.push("├─────────────────────────────────────────────────────────────┤"),t.push(`│ User Agent: ${e.userAgent.substring(0,50)}...`),t.push(`│ Platform: ${e.platform}`),t.push(`│ Language: ${e.language}`),t.push(`│ Online: ${e.onLine}`),t.push(`│ Screen: ${e.screenWidth}x${e.screenHeight}`),t.push(`│ Viewport: ${e.viewportWidth}x${e.viewportHeight}`),t.push(`│ Pixel Ratio: ${e.devicePixelRatio}`),t.push(`│ Touch Support: ${e.touchSupport}`),t.push(`│ Audio Inputs: ${e.mediaDevices.audioInputs}`),t.push(`│ Audio Outputs: ${e.mediaDevices.audioOutputs}`),t.push(`│ Microphone Permission: ${e.permissions.microphone||"unknown"}`),e.connection&&(t.push(`│ Connection Type: ${e.connection.effectiveType||e.connection.type||"unknown"}`),t.push(`│ RTT: ${e.connection.rtt??"unknown"}ms`)),e.memory){const n=Math.round((e.memory.usedJSHeapSize||0)/1024/1024),r=Math.round((e.memory.totalJSHeapSize||0)/1024/1024);t.push(`│ Memory: ${n}MB / ${r}MB`)}if(t.push("└─────────────────────────────────────────────────────────────┘"),t.push(""),t.push("┌─────────────────────────────────────────────────────────────┐"),t.push("│ NETWORK REQUESTS │"),t.push("├─────────────────────────────────────────────────────────────┤"),0===Pv.length)t.push("│ No network requests logged");else for(const r of Pv){const e=r.timestamp.toISOString().split("T")[1].split(".")[0],n=r.status?`${r.status}`:"FAIL",i=r.duration?`${r.duration}ms`:"-";t.push(`│ [${e}] ${r.method} ${n} (${i})`),t.push(`│ URL: ${r.url.substring(0,60)}${r.url.length>60?"...":""}`),r.error&&t.push(`│ ERROR: ${r.error}`)}t.push("└─────────────────────────────────────────────────────────────┘"),t.push(""),t.push("┌─────────────────────────────────────────────────────────────┐"),t.push("│ APPLICATION LOGS │"),t.push("├─────────────────────────────────────────────────────────────┤");const n={log:"📝",info:"ℹ️",warn:"⚠️",error:"❌",debug:"🔍",network:"🌐",event:"⚡",state:"📊",sip:"📞"};for(const r of Rv){const e=r.timestamp.toISOString().split("T")[1].split(".")[0],i=n[r.level]||"•",o=r.level.toUpperCase().padEnd(7),a=`[${r.category}]`.padEnd(20);if(t.push(`│ ${e} ${i} ${o} ${a}`),t.push(`│ ${r.message.substring(0,70)}${r.message.length>70?"...":""}`),r.data)try{const e=JSON.stringify(r.data,null,2).split("\n");for(const n of e.slice(0,10))t.push(`│ ${n}`);e.length>10&&t.push(`│ ... (${e.length-10} more lines)`)}catch{t.push("│ [Data could not be serialized]")}if(r.stack){const e=r.stack.split("\n").slice(0,5);for(const n of e)t.push(`│ ${n.trim()}`)}t.push("│")}return t.push("└─────────────────────────────────────────────────────────────┘"),t.push(""),t.push(`Total Logs: ${Rv.length}`),t.push(`Total Network Requests: ${Pv.length}`),t.push("═══════════════════════════════════════════════════════════════"),t.join("\n")}function Hv(){const[e,n]=t.useState([]),[r,i]=t.useState([]),[o,a]=t.useState(0),s=t.useRef(!1);t.useEffect(()=>{if(s.current)return;s.current=!0,Bv(),function(){if("undefined"==typeof window)return;const e=window.fetch;window.fetch=async(t,n)=>{const r=Date.now(),i="string"==typeof t?t:t instanceof URL?t.toString():t.url,o=(null==n?void 0:n.method)||"GET",a={};let s;(null==n?void 0:n.headers)&&new Headers(n.headers).forEach((e,t)=>{t.toLowerCase().includes("auth")||t.toLowerCase().includes("token")?a[t]=e.substring(0,20)+"...":a[t]=e}),(null==n?void 0:n.body)&&(s="string"==typeof n.body?n.body.substring(0,500):n.body instanceof FormData?"[FormData]":"[Binary/Stream]");try{const d=await e(t,n),l=Date.now()-r,u=d.clone();let c;try{const e=d.headers.get("content-type")||"";if(e.includes("application/json")){const e=await u.json();c=JSON.stringify(e).substring(0,1e3)}else c=e.includes("text")?(await u.text()).substring(0,500):`[${e||"unknown content-type"}]`}catch{c="[Could not read response body]"}const f={};return d.headers.forEach((e,t)=>{f[t]=e}),Fv({method:o,url:i,status:d.status,duration:l,requestHeaders:a,responseHeaders:f,requestBody:s,responseBody:c}),Uv("network","Network",`${d.ok?"✅":"❌"} ${o} ${i} - ${d.status} (${l}ms)`,{status:d.status,duration:l}),d}catch(d){const e=Date.now()-r,t=d instanceof Error?d.message:String(d);throw Fv({method:o,url:i,duration:e,requestHeaders:a,requestBody:s,error:t}),Uv("network","Network",`❌ ${o} ${i} - FAILED: ${t}`,{error:t,duration:e}),d}}}();const e=function(){if("undefined"==typeof window)return()=>{};const e=e=>{var t;Uv("error","GlobalError",`Uncaught: ${e.message}`,{filename:e.filename,lineno:e.lineno,colno:e.colno},null==(t=e.error)?void 0:t.stack)},t=e=>{const t=e.reason;Uv("error","UnhandledRejection",`Unhandled Promise Rejection: ${t instanceof Error?t.message:String(t)}`,{reason:t instanceof Error?{name:t.name,message:t.message}:t},t instanceof Error?t.stack:void 0)};return window.addEventListener("error",e),window.addEventListener("unhandledrejection",t),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",t)}}();return Uv("info","DebugLogger","🚀 Debug Logger initialized",{timestamp:(new Date).toISOString(),version:"1.0.0"}),()=>{e()}},[]),t.useEffect(()=>{const e=()=>{a(e=>e+1)};return Dv.add(e),()=>{Dv.delete(e)}},[]),t.useEffect(()=>{n([...Rv]),i([...Pv])},[o]);return{logs:e,networkLogs:r,clear:t.useCallback(()=>{Rv.length=0,Pv.length=0,Dv.forEach(e=>e())},[]),exportText:t.useCallback(async()=>zv(),[]),copyToClipboard:t.useCallback(async()=>{const e=await zv();try{return await navigator.clipboard.writeText(e),Uv("info","DebugLogger","📋 Logs copied to clipboard"),!0}catch(t){return Uv("error","DebugLogger","Failed to copy logs to clipboard",t),!1}},[]),addLog:t.useCallback((e,t,n,r)=>{Uv(e,t,n,r)},[]),collectDeviceInfo:qv}}const Wv={container:{position:"fixed",inset:0,zIndex:99999,display:"flex",flexDirection:"column",backgroundColor:"#0f172a",color:"#e2e8f0",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',fontSize:"12px",overflow:"hidden"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",backgroundColor:"#1e293b",borderBottom:"1px solid #334155",flexShrink:0},headerTitle:{display:"flex",alignItems:"center",gap:"8px",fontSize:"14px",fontWeight:700},headerActions:{display:"flex",alignItems:"center",gap:"8px"},button:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",padding:"8px 12px",borderRadius:"6px",border:"none",fontSize:"11px",fontWeight:600,cursor:"pointer",transition:"all 0.2s"},primaryButton:{backgroundColor:"#3b82f6",color:"#fff"},dangerButton:{backgroundColor:"#dc2626",color:"#fff"},successButton:{backgroundColor:"#16a34a",color:"#fff"},tabs:{display:"flex",backgroundColor:"#1e293b",borderBottom:"1px solid #334155",padding:"0 16px",flexShrink:0,overflowX:"auto"},tab:{padding:"10px 16px",fontSize:"11px",fontWeight:600,cursor:"pointer",borderBottom:"2px solid transparent",color:"#94a3b8",whiteSpace:"nowrap",transition:"all 0.2s"},tabActive:{color:"#3b82f6",borderBottomColor:"#3b82f6"},filters:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",backgroundColor:"#1e293b",borderBottom:"1px solid #334155",flexWrap:"wrap",flexShrink:0},filterChip:{padding:"4px 10px",borderRadius:"12px",fontSize:"10px",fontWeight:600,cursor:"pointer",transition:"all 0.2s"},content:{flex:1,overflow:"auto",padding:"8px"},logEntry:{display:"flex",alignItems:"flex-start",padding:"6px 8px",borderRadius:"4px",marginBottom:"2px",fontSize:"11px",lineHeight:1.4},logTime:{flexShrink:0,width:"75px",color:"#64748b",fontSize:"10px"},logLevel:{flexShrink:0,width:"55px",fontWeight:700,fontSize:"9px",textTransform:"uppercase"},logCategory:{flexShrink:0,width:"100px",color:"#8b5cf6",fontSize:"10px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},logMessage:{flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap"},logData:{marginTop:"4px",padding:"6px",backgroundColor:"#0f172a",borderRadius:"4px",fontSize:"10px",whiteSpace:"pre-wrap",overflow:"auto",maxHeight:"200px"},deviceInfoGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"12px",padding:"16px"},deviceInfoCard:{backgroundColor:"#1e293b",borderRadius:"8px",padding:"12px",border:"1px solid #334155"},deviceInfoTitle:{fontSize:"11px",fontWeight:700,color:"#3b82f6",marginBottom:"8px",textTransform:"uppercase",letterSpacing:"0.05em"},deviceInfoRow:{display:"flex",justifyContent:"space-between",padding:"4px 0",borderBottom:"1px solid #334155",fontSize:"11px"},deviceInfoLabel:{color:"#94a3b8"},deviceInfoValue:{color:"#e2e8f0",fontWeight:600},networkEntry:{backgroundColor:"#1e293b",borderRadius:"6px",marginBottom:"8px",overflow:"hidden"},networkHeader:{display:"flex",alignItems:"center",gap:"12px",padding:"10px 12px",cursor:"pointer",transition:"background-color 0.2s"},networkMethod:{padding:"2px 8px",borderRadius:"4px",fontSize:"10px",fontWeight:700},networkUrl:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"11px"},networkStatus:{fontWeight:700,fontSize:"11px"},networkDetails:{padding:"12px",backgroundColor:"#0f172a",borderTop:"1px solid #334155",fontSize:"10px"},stats:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:"12px",padding:"16px"},statCard:{backgroundColor:"#1e293b",borderRadius:"8px",padding:"16px",textAlign:"center"},statValue:{fontSize:"28px",fontWeight:700,color:"#3b82f6"},statLabel:{fontSize:"10px",color:"#94a3b8",marginTop:"4px",textTransform:"uppercase"},emptyState:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"48px",color:"#64748b"},copySuccess:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",backgroundColor:"#16a34a",color:"#fff",padding:"16px 32px",borderRadius:"12px",fontSize:"16px",fontWeight:700,zIndex:1e5,animation:"fadeInOut 2s ease-in-out"}},Gv={log:{bg:"#374151",text:"#9ca3af"},info:{bg:"#1e3a5f",text:"#60a5fa"},warn:{bg:"#713f12",text:"#fbbf24"},error:{bg:"#7f1d1d",text:"#f87171"},debug:{bg:"#3f3f46",text:"#a1a1aa"},network:{bg:"#164e63",text:"#22d3ee"},event:{bg:"#4c1d95",text:"#a78bfa"},state:{bg:"#14532d",text:"#4ade80"},sip:{bg:"#581c87",text:"#c084fc"}},Vv={log:"📝",info:"ℹ️",warn:"⚠️",error:"❌",debug:"🔍",network:"🌐",event:"⚡",state:"📊",sip:"📞"};function Kv({onClose:e}){const{logs:n,networkLogs:r,clear:i,copyToClipboard:o}=Hv(),[a,s]=t.useState("logs"),[d,l]=t.useState(new Set),[u,c]=t.useState(""),[f,h]=t.useState(""),[p,m]=t.useState(new Set),[g,v]=t.useState(null),[y,b]=t.useState(!1),[x,w]=t.useState(new Set);t.useEffect(()=>{qv().then(v)},[]);const _=t.useMemo(()=>n.filter(e=>{if(d.size>0&&!d.has(e.level))return!1;if(u&&!e.category.toLowerCase().includes(u.toLowerCase()))return!1;if(f){const t=f.toLowerCase();return e.message.toLowerCase().includes(t)||e.category.toLowerCase().includes(t)||e.data&&JSON.stringify(e.data).toLowerCase().includes(t)}return!0}),[n,d,u,f]),C=t.useMemo(()=>{const e=new Set(n.map(e=>e.category));return Array.from(e).sort()},[n]),S=t.useMemo(()=>{const e={},t={};for(const r of n)e[r.level]=(e[r.level]||0)+1,t[r.category]=(t[r.category]||0)+1;return{byLevel:e,byCategory:t,networkSuccess:r.filter(e=>e.status&&e.status>=200&&e.status<400).length,networkError:r.filter(e=>!e.status||e.status>=400).length,avgDuration:r.length>0?Math.round(r.reduce((e,t)=>e+(t.duration||0),0)/r.length):0}},[n,r]),E=t.useCallback(e=>{l(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),N=t.useCallback(e=>{m(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),T=t.useCallback(e=>{w(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),A=t.useCallback(async()=>{await o()&&(b(!0),setTimeout(()=>b(!1),2e3))},[o]),O=e=>e.toTimeString().split(" ")[0]+"."+e.getMilliseconds().toString().padStart(3,"0");return $.jsxs("div",{style:Wv.container,children:[$.jsxs("div",{style:Wv.header,children:[$.jsxs("div",{style:Wv.headerTitle,children:[$.jsx("span",{children:"🔧"}),$.jsx("span",{children:"Debug Console"}),$.jsxs("span",{style:{fontSize:"10px",backgroundColor:"#374151",padding:"2px 8px",borderRadius:"10px"},children:[n.length," logs"]})]}),$.jsxs("div",{style:Wv.headerActions,children:[$.jsx("button",{style:{...Wv.button,...Wv.successButton},onClick:A,children:"📋 Copiar Todos"}),$.jsx("button",{style:{...Wv.button,...Wv.dangerButton},onClick:i,children:"🗑️ Limpar"}),$.jsx("button",{style:{...Wv.button,...Wv.primaryButton},onClick:e,children:"← Voltar"})]})]}),$.jsxs("div",{style:Wv.tabs,children:[$.jsxs("div",{style:{...Wv.tab,..."logs"===a?Wv.tabActive:{}},onClick:()=>s("logs"),children:["📝 Logs (",n.length,")"]}),$.jsxs("div",{style:{...Wv.tab,..."network"===a?Wv.tabActive:{}},onClick:()=>s("network"),children:["🌐 Network (",r.length,")"]}),$.jsx("div",{style:{...Wv.tab,..."device"===a?Wv.tabActive:{}},onClick:()=>s("device"),children:"📱 Device"}),$.jsx("div",{style:{...Wv.tab,..."stats"===a?Wv.tabActive:{}},onClick:()=>s("stats"),children:"📊 Stats"})]}),"logs"===a&&$.jsxs("div",{style:Wv.filters,children:[$.jsx("input",{type:"text",placeholder:"🔍 Buscar...",value:f,onChange:e=>h(e.target.value),style:{padding:"6px 12px",borderRadius:"6px",border:"1px solid #374151",backgroundColor:"#0f172a",color:"#e2e8f0",fontSize:"11px",width:"150px"}}),$.jsxs("select",{value:u,onChange:e=>c(e.target.value),style:{padding:"6px 12px",borderRadius:"6px",border:"1px solid #374151",backgroundColor:"#0f172a",color:"#e2e8f0",fontSize:"11px"},children:[$.jsx("option",{value:"",children:"Todas categorias"}),C.map(e=>$.jsx("option",{value:e,children:e},e))]}),$.jsx("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap"},children:Object.keys(Gv).map(e=>{const t=d.has(e),n=Gv[e];return $.jsxs("span",{style:{...Wv.filterChip,backgroundColor:t?n.text:"#374151",color:t?"#000":"#94a3b8"},onClick:()=>E(e),children:[Vv[e]," ",e]},e)})})]}),$.jsxs("div",{style:Wv.content,children:["logs"===a&&$.jsx($.Fragment,{children:0===_.length?$.jsxs("div",{style:Wv.emptyState,children:[$.jsx("span",{style:{fontSize:"48px",marginBottom:"16px"},children:"📭"}),$.jsx("span",{children:"Nenhum log encontrado"})]}):_.slice(-200).reverse().map(e=>{const t=Gv[e.level],n=x.has(e.id),r=void 0!==e.data||e.stack;return $.jsxs("div",{style:{...Wv.logEntry,backgroundColor:t.bg+"40",cursor:r?"pointer":"default"},onClick:()=>r&&T(e.id),children:[$.jsx("span",{style:Wv.logTime,children:O(e.timestamp)}),$.jsxs("span",{style:{...Wv.logLevel,color:t.text},children:[Vv[e.level]," ",e.level]}),$.jsxs("span",{style:Wv.logCategory,children:["[",e.category,"]"]}),$.jsxs("div",{style:{flex:1},children:[$.jsx("span",{style:Wv.logMessage,children:e.message}),r&&$.jsxs("span",{style:{color:"#64748b",fontSize:"10px",marginLeft:"8px"},children:[n?"▼":"▶"," ",r?"data":""]}),n&&$.jsxs("div",{style:Wv.logData,children:[void 0!==e.data&&$.jsx("pre",{children:(()=>{try{return JSON.stringify(e.data,null,2)}catch{return"[Não serializável]"}})()}),e.stack&&$.jsx("pre",{style:{color:"#f87171",marginTop:e.data?"8px":0},children:e.stack})]})]})]},e.id)})}),"network"===a&&$.jsx($.Fragment,{children:0===r.length?$.jsxs("div",{style:Wv.emptyState,children:[$.jsx("span",{style:{fontSize:"48px",marginBottom:"16px"},children:"🌐"}),$.jsx("span",{children:"Nenhuma requisição registrada"})]}):[...r].reverse().map(e=>{const t=e.status&&e.status>=200&&e.status<400,n=p.has(e.id),r={GET:"#22c55e",POST:"#3b82f6",PUT:"#f59e0b",DELETE:"#ef4444",PATCH:"#8b5cf6"};return $.jsxs("div",{style:Wv.networkEntry,children:[$.jsxs("div",{style:{...Wv.networkHeader,backgroundColor:n?"#334155":"transparent"},onClick:()=>N(e.id),children:[$.jsx("span",{style:{color:"#64748b",fontSize:"10px"},children:O(e.timestamp)}),$.jsx("span",{style:{...Wv.networkMethod,backgroundColor:(r[e.method]||"#6b7280")+"30",color:r[e.method]||"#6b7280"},children:e.method}),$.jsx("span",{style:Wv.networkUrl,title:e.url,children:e.url}),$.jsx("span",{style:{...Wv.networkStatus,color:t?"#22c55e":"#ef4444"},children:e.status||"FAILED"}),$.jsx("span",{style:{color:"#64748b",fontSize:"10px"},children:e.duration?`${e.duration}ms`:"-"}),$.jsx("span",{style:{color:"#64748b"},children:n?"▼":"▶"})]}),n&&$.jsxs("div",{style:Wv.networkDetails,children:[e.error&&$.jsxs("div",{style:{color:"#f87171",marginBottom:"8px"},children:[$.jsx("strong",{children:"Error:"})," ",e.error]}),e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&$.jsxs("div",{style:{marginBottom:"8px"},children:[$.jsx("strong",{style:{color:"#94a3b8"},children:"Request Headers:"}),$.jsx("pre",{style:{marginTop:"4px"},children:JSON.stringify(e.requestHeaders,null,2)})]}),e.requestBody&&$.jsxs("div",{style:{marginBottom:"8px"},children:[$.jsx("strong",{style:{color:"#94a3b8"},children:"Request Body:"}),$.jsx("pre",{style:{marginTop:"4px"},children:e.requestBody})]}),e.responseHeaders&&Object.keys(e.responseHeaders).length>0&&$.jsxs("div",{style:{marginBottom:"8px"},children:[$.jsx("strong",{style:{color:"#94a3b8"},children:"Response Headers:"}),$.jsx("pre",{style:{marginTop:"4px"},children:JSON.stringify(e.responseHeaders,null,2)})]}),e.responseBody&&$.jsxs("div",{children:[$.jsx("strong",{style:{color:"#94a3b8"},children:"Response Body:"}),$.jsx("pre",{style:{marginTop:"4px"},children:e.responseBody})]})]})]},e.id)})}),"device"===a&&g&&$.jsxs("div",{style:Wv.deviceInfoGrid,children:[$.jsxs("div",{style:Wv.deviceInfoCard,children:[$.jsx("div",{style:Wv.deviceInfoTitle,children:"📱 Sistema"}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"User Agent"}),$.jsxs("span",{style:{...Wv.deviceInfoValue,fontSize:"9px",maxWidth:"150px",overflow:"hidden",textOverflow:"ellipsis"},children:[g.userAgent.substring(0,50),"..."]})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Platform"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.platform})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Language"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.language})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Online"}),$.jsx("span",{style:{...Wv.deviceInfoValue,color:g.onLine?"#22c55e":"#ef4444"},children:g.onLine?"✅ Sim":"❌ Não"})]})]}),$.jsxs("div",{style:Wv.deviceInfoCard,children:[$.jsx("div",{style:Wv.deviceInfoTitle,children:"📐 Tela"}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Screen"}),$.jsxs("span",{style:Wv.deviceInfoValue,children:[g.screenWidth,"x",g.screenHeight]})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Viewport"}),$.jsxs("span",{style:Wv.deviceInfoValue,children:[g.viewportWidth,"x",g.viewportHeight]})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Pixel Ratio"}),$.jsxs("span",{style:Wv.deviceInfoValue,children:[g.devicePixelRatio,"x"]})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Touch"}),$.jsx("span",{style:{...Wv.deviceInfoValue,color:g.touchSupport?"#22c55e":"#94a3b8"},children:g.touchSupport?"✅ Suportado":"❌ Não"})]})]}),$.jsxs("div",{style:Wv.deviceInfoCard,children:[$.jsx("div",{style:Wv.deviceInfoTitle,children:"🎤 Mídia"}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Audio Inputs"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.mediaDevices.audioInputs})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Audio Outputs"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.mediaDevices.audioOutputs})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Video Inputs"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.mediaDevices.videoInputs})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Mic Permission"}),$.jsx("span",{style:{...Wv.deviceInfoValue,color:"granted"===g.permissions.microphone?"#22c55e":"#f59e0b"},children:g.permissions.microphone||"unknown"})]})]}),g.connection&&$.jsxs("div",{style:Wv.deviceInfoCard,children:[$.jsx("div",{style:Wv.deviceInfoTitle,children:"📶 Conexão"}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Type"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.connection.type||"-"})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Effective"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.connection.effectiveType||"-"})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Downlink"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.connection.downlink?`${g.connection.downlink} Mbps`:"-"})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"RTT"}),$.jsx("span",{style:Wv.deviceInfoValue,children:g.connection.rtt?`${g.connection.rtt}ms`:"-"})]})]}),g.memory&&$.jsxs("div",{style:Wv.deviceInfoCard,children:[$.jsx("div",{style:Wv.deviceInfoTitle,children:"💾 Memória"}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Heap Used"}),$.jsxs("span",{style:Wv.deviceInfoValue,children:[Math.round((g.memory.usedJSHeapSize||0)/1024/1024)," MB"]})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Heap Total"}),$.jsxs("span",{style:Wv.deviceInfoValue,children:[Math.round((g.memory.totalJSHeapSize||0)/1024/1024)," MB"]})]}),$.jsxs("div",{style:Wv.deviceInfoRow,children:[$.jsx("span",{style:Wv.deviceInfoLabel,children:"Heap Limit"}),$.jsxs("span",{style:Wv.deviceInfoValue,children:[Math.round((g.memory.jsHeapSizeLimit||0)/1024/1024)," MB"]})]})]})]}),"stats"===a&&$.jsxs($.Fragment,{children:[$.jsxs("div",{style:Wv.stats,children:[$.jsxs("div",{style:Wv.statCard,children:[$.jsx("div",{style:Wv.statValue,children:n.length}),$.jsx("div",{style:Wv.statLabel,children:"Total Logs"})]}),$.jsxs("div",{style:Wv.statCard,children:[$.jsx("div",{style:{...Wv.statValue,color:"#ef4444"},children:S.byLevel.error||0}),$.jsx("div",{style:Wv.statLabel,children:"Erros"})]}),$.jsxs("div",{style:Wv.statCard,children:[$.jsx("div",{style:{...Wv.statValue,color:"#f59e0b"},children:S.byLevel.warn||0}),$.jsx("div",{style:Wv.statLabel,children:"Warnings"})]}),$.jsxs("div",{style:Wv.statCard,children:[$.jsx("div",{style:{...Wv.statValue,color:"#22c55e"},children:S.networkSuccess}),$.jsx("div",{style:Wv.statLabel,children:"Requests OK"})]}),$.jsxs("div",{style:Wv.statCard,children:[$.jsx("div",{style:{...Wv.statValue,color:"#ef4444"},children:S.networkError}),$.jsx("div",{style:Wv.statLabel,children:"Requests Failed"})]}),$.jsxs("div",{style:Wv.statCard,children:[$.jsxs("div",{style:Wv.statValue,children:[S.avgDuration,"ms"]}),$.jsx("div",{style:Wv.statLabel,children:"Avg Response Time"})]})]}),$.jsxs("div",{style:{padding:"16px"},children:[$.jsx("h3",{style:{color:"#94a3b8",marginBottom:"12px"},children:"Logs por Categoria"}),$.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:Object.entries(S.byCategory).sort((e,t)=>t[1]-e[1]).map(([e,t])=>$.jsxs("span",{style:{padding:"6px 12px",backgroundColor:"#1e293b",borderRadius:"6px",fontSize:"11px"},children:[e,": ",$.jsx("strong",{children:t})]},e))})]})]})]}),y&&$.jsx("div",{style:Wv.copySuccess,children:"✅ Logs copiados para a área de transferência!"})]})}function Yv({notice:e,onDismiss:n,onRecheck:r,onHeightChange:i}){const o=t.useRef(null),a=null!==e;if(t.useLayoutEffect(()=>{const e=o.current;if(!i)return;if(!e)return void i(0);const t=()=>i(e.offsetHeight);if(t(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect(),i(0)}},[a,i]),!e)return null;const s="call"===e.source||"session"===e.source;return $.jsxs("div",{ref:o,className:`dialer-notice ${e.level}`,role:"error"===e.level?"alert":"status","data-code":e.code,children:[$.jsx("i",{className:`fas ${"error"===e.level?"fa-circle-exclamation":"fa-triangle-exclamation"} dialer-notice-icon`,"aria-hidden":"true"}),$.jsxs("div",{className:"dialer-notice-body",children:[$.jsx("strong",{className:"dialer-notice-title",children:e.title}),$.jsx("span",{className:"dialer-notice-detail",children:e.detail}),e.action&&$.jsx("span",{className:"dialer-notice-action",children:e.action}),"device"===e.source&&r&&$.jsx("button",{type:"button",className:"dialer-notice-btn",onClick:r,children:"Verificar de novo"})]}),s&&n&&$.jsx("button",{type:"button",className:"dialer-notice-close",onClick:n,"aria-label":"Fechar aviso",children:$.jsx("i",{className:"fas fa-xmark","aria-hidden":"true"})})]})}const Xv={raiva:"raiva",irritacao:"irritação",frustracao:"frustração",desconfianca:"desconfiança",impaciencia:"impaciência",confusao:"confusão",nervosismo:"nervosismo",surpresa:"surpresa",desanimo:"desânimo",cansaco:"cansaço",interesse:"interesse",entusiasmo:"entusiasmo",satisfacao:"satisfação",alivio:"alívio",neutro:"neutro"},Jv={aberto:"cliente aberto",neutro:"cliente neutro",resistente:"cliente resistente",hostil:"cliente hostil",indefinido:"lendo a conversa"},Zv={agent:"Você",customer:"Cliente",mixed:""};function Qv(e,t=2){return(e.emotions??[]).filter(e=>"neutro"!==e.label&&e.intensity>=.3).slice(0,t)}function ey({maxLines:e=4}){const n=t.useContext(Lu);return n?$.jsx(ty,{client:n,maxLines:e}):null}function ty({client:e,maxLines:t}){const{segments:n,insight:r,status:i}=function(e){return Uu(e).transcript}(e),o="running"===(null==i?void 0:i.live);if(0===n.length&&!r&&!o)return null;const a=n.slice(-t);return $.jsxs("div",{className:"live-captions",id:"liveCaptions","aria-live":"polite",children:[r&&$.jsxs("div",{className:`live-insight stance-${r.customer.stance}`,id:"liveInsight",title:r.summary,children:[$.jsx("span",{className:"live-insight-stance",children:Jv[r.customer.stance]??r.customer.stance}),$.jsxs("span",{className:"live-insight-interest",children:["interesse ",Math.round(r.customer.interest),"%"]}),r.nextMove&&$.jsx("span",{className:"live-insight-next",children:r.nextMove})]}),a.length>0?$.jsx("ul",{className:"live-caption-list",children:a.map(e=>$.jsxs("li",{className:`live-caption ${e.speaker}${e.interim?" interim":""}${e.refined?" refined":""}`,children:[$.jsx("span",{className:"live-caption-speaker",children:Zv[e.speaker]}),$.jsx("span",{className:"live-caption-text",children:e.text}),Qv(e).map(e=>$.jsxs("span",{className:"live-caption-emotion"+("context"===e.source?" ctx":""),title:e.evidence??"",children:[Xv[e.label]??e.label," ",Math.round(100*e.intensity),"%"]},e.label))]},e.id))}):$.jsx("div",{className:"live-caption-waiting",children:"Ouvindo a conversa…"})]})}function ny(e={}){const n=ec(),r=nc(),[i,o]=t.useState(null),[a,s]=t.useState(null),[d,l]=t.useState(null),[u,c]=t.useState(null),f=t.useRef(null),h=e.callFailureTtlMs??2e4,p=t.useCallback(async()=>{if(!1===e.checkDevices)return;const t=await Bp();o(t)},[e.checkDevices]);t.useEffect(()=>{var t;if(!1===e.checkDevices)return;let n=!1;const r=async()=>{const e=await Bp();n||o(e)};r();const i="undefined"!=typeof navigator?navigator.mediaDevices:void 0,a=()=>{r()};return null==(t=null==i?void 0:i.addEventListener)||t.call(i,"devicechange",a),()=>{var e;n=!0,null==(e=null==i?void 0:i.removeEventListener)||e.call(i,"devicechange",a)}},[e.checkDevices]),uc("userSessionDropped",e=>{s((null==e?void 0:e.originator)??"unknown")}),t.useEffect(()=>{if(!(null==r?void 0:r.on))return;const e=e=>{var t;const n=(null==e?void 0:e.failure)??(null==(t=r.toCallData)?void 0:t.call(r).failure)??null;l(n??{cause:null}),c(null),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>l(null),h)};return r.on("failed",e),()=>{var t;null==(t=r.off)||t.call(r,"failed",e)}},[r,h]),t.useEffect(()=>{var e,t;if("manualCallFailed"!==(null==n?void 0:n.state))return;const r=(null==(t=null==(e=n.call)?void 0:e.toCallData)?void 0:t.call(e).failure)??null;l(e=>e??r??{cause:null}),c(null)},[n]),t.useEffect(()=>{"callInProgress"!==(null==n?void 0:n.state)&&"manualCallRinging"!==(null==n?void 0:n.state)&&"callRinging"!==(null==n?void 0:n.state)||l(null),"idle"!==(null==n?void 0:n.state)&&"onBreak"!==(null==n?void 0:n.state)||s(null)},[null==n?void 0:n.state]),t.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const m=function(e){if(e.sessionDrop)return Wp(e.sessionDrop);if("startupError"===e.operatorState){if("missingAudioPermissions"===e.startupError&&e.deviceIssue){const t=e.deviceIssue.action??"";return{...e.deviceIssue,action:/recarregue a página/i.test(t)?t:`${t} Depois, recarregue a página para o discador iniciar.`.trim()}}return zp(e.startupError)}return e.deviceIssue?e.deviceIssue:"manualCallFailed"===e.operatorState||e.callFailure?Kp(e.callFailure):"offline"===e.operatorState?{level:"error",source:"offline",code:"offline",title:"Discador desconectado do Callix",detail:"O atendimento está offline: sem internet, sem microfone ou o Callix derrubou a conexão.",action:"Confira a internet e o microfone; o discador tenta reconectar sozinho. Se não voltar, recarregue a página."}:null}({deviceIssue:i,operatorState:(null==n?void 0:n.state)??null,startupError:"startupError"===(null==n?void 0:n.state)?n.error??null:null,sessionDrop:a,callFailure:d});return{notice:m&&m.code!==u?m:null,deviceIssue:i,dismiss:t.useCallback(()=>{m&&("call"===m.source?l(null):"session"===m.source?s(null):c(m.code))},[m]),recheckDevices:p}}const ry=16,iy="callix_dialer_form_scale",oy=100,ay="flex flex-shrink-0 items-center justify-center rounded-md transition hover:bg-black hover:bg-opacity-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white",sy="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;function dy(e,t,n){return Math.min(Math.max(e,t),n)}function ly(e){if(!Number.isFinite(e))return oy;return dy(10*Math.round(e/10),70,180)}function uy(){if("undefined"==typeof window)return oy;try{const e=window.localStorage.getItem(iy);return null===e||""===e.trim()?oy:ly(Number(e))}catch{return oy}}function cy(){if("undefined"==typeof CSS||"function"!=typeof CSS.supports)return!0;try{if(!CSS.supports("zoom","1.5"))return!1}catch{return!0}const e="undefined"!=typeof navigator?/\bFirefox\/(\d+)/.exec(navigator.userAgent):null;return!(e&&Number(e[1])<131)}function fy(){return"undefined"==typeof window?{width:1024,height:768}:{width:window.innerWidth,height:window.innerHeight}}function hy(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return t>0?`${t}:${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${n}:${r.toString().padStart(2,"0")}`}function py({isOpen:e,campaignCallInfo:r,campaignContactPhoneId:i,callDuration:o,isCallActive:a,onClose:s,portalTarget:d}){const l=t.useRef(null),u=t.useRef({pointerId:null,offsetX:0,offsetY:0}),c=t.useRef(!1),f=t.useRef(!1),h=t.useRef(null),p=t.useId(),[m,g]=t.useState({x:100,y:100}),[v,y]=t.useState(!1),[b,x]=t.useState(fy),w=t.useMemo(cy,[]),[_,C]=t.useState(uy),[S,E]=t.useState(""),N=w?_/100:1,T=t.useRef(N);T.current=N;const[A,O]=t.useState(null),[I,k]=t.useState(!1),[j,R]=t.useState(null),[P,D]=t.useState({key:null,n:0}),L=null==r?void 0:r.campaignContact,M=t.useMemo(()=>em(r,i),[r,i]),U=M?Qp(M):null,F=t.useRef(M);F.current=M;const B=t.useRef(null),q=t.useCallback(()=>{var e;const t=null==(e=l.current)?void 0:e.getBoundingClientRect(),n=T.current;return{width:t&&t.width>0?t.width:520*n,height:t&&t.height>0?t.height:600*n}},[]),z=t.useCallback(e=>{if("undefined"==typeof window)return e;const{width:t,height:n}=q(),r=Math.max(16,window.innerWidth-t-ry),i=Math.max(16,window.innerHeight-n-ry);return{x:dy(e.x,16,r),y:dy(e.y,16,i)}},[q]);sy(()=>{if(e&&"undefined"!=typeof window){x(fy());const{width:e,height:t}=q(),n=(window.innerWidth-e)/2,r=(window.innerHeight-t)/2;g(z({x:n,y:r}))}},[e,q,z]),t.useEffect(()=>{if(!e||"undefined"==typeof window)return;const t=()=>{x(fy()),g(e=>z(e))};return window.addEventListener("resize",t),window.addEventListener("orientationchange",t),()=>{window.removeEventListener("resize",t),window.removeEventListener("orientationchange",t)}},[e,z]);const H=t.useCallback(()=>{g(e=>{const t=z(e);return t.x===e.x&&t.y===e.y?e:t})},[z]);t.useEffect(()=>{e&&H()},[e,_,H]),t.useEffect(()=>{const t=l.current;if(!e||!t||"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(()=>H());return n.observe(t),()=>n.disconnect()},[e,H]),t.useEffect(()=>{const e=F.current;if(!e||!U)return O(null),R(null),void k(!1);let t=!1,n=null;return k(!0),R(null),rm(e,{force:P.key===U&&P.n>0}).then(e=>{t||(console.log("[DraggableClientInfoModal] ✅ Formulário carregado:",e.valuesSource,e.layoutSource,e.fields.length,"campos",e.partial?"(parcial)":""),O(e),k(!1),e.partial&&B.current!==U&&(B.current=U,n=setTimeout(()=>D(e=>({key:U,n:e.n+1})),3e3)))}).catch(e=>{t||(console.error("[DraggableClientInfoModal] ❌ Erro ao buscar o formulário:",e),O(null),R(e instanceof Error?e.message:"Erro ao buscar dados do contato"),k(!1))}),()=>{t=!0,n&&clearTimeout(n)}},[U,P]),t.useEffect(()=>{if(!v)return;const e=e=>{if(u.current.pointerId!==e.pointerId)return;c.current=!0;const{width:t,height:n}=q(),r=e.clientX-u.current.offsetX,i=e.clientY-u.current.offsetY,o="undefined"!=typeof window?window.innerWidth:0,a="undefined"!=typeof window?window.innerHeight:0,s=o-t-ry,d=a-n-ry,l=Math.max(ry,s),f=Math.max(ry,d);g({x:dy(r,ry,l),y:dy(i,ry,f)})},t=e=>{u.current.pointerId===e.pointerId&&(y(!1),u.current={pointerId:null,offsetX:0,offsetY:0})};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[v,q]);const W=t.useCallback(e=>{if(0!==e.button&&"touch"!==e.pointerType)return;if(e.target instanceof Element&&e.target.closest("button"))return;const t=l.current;if(!t)return;e.preventDefault();const n=e.currentTarget;if("function"==typeof n.setPointerCapture)try{n.setPointerCapture(e.pointerId)}catch{}const r=t.getBoundingClientRect();u.current={pointerId:e.pointerId,offsetX:e.clientX-r.left,offsetY:e.clientY-r.top},c.current=!1,y(!0)},[]),G=t.useCallback(()=>{!a&&s&&s()},[a,s]),V=t.useCallback(()=>{D(e=>({key:U,n:e.n+1}))},[U]),K=t.useCallback(e=>{const t=ly(e);return C(t),function(e){try{window.localStorage.setItem(iy,String(e))}catch{}}(t),t},[]),Y=_>70,X=_<180,J=t.useCallback(()=>{Y&&E(`Tamanho do formulário: ${K(_-10)}%`)},[K,Y,_]),Z=t.useCallback(()=>{X&&E(`Tamanho do formulário: ${K(_+10)}%`)},[K,X,_]),Q=t.useCallback(()=>{K(oy),E("")},[K]);t.useEffect(()=>{if(!e||"undefined"==typeof document)return;const t=l.current,n=document.activeElement;return h.current=n&&n!==document.body?n:null,!t||n&&n!==document.body||t.focus({preventScroll:!0}),()=>{const e=h.current;f.current&&e&&e.isConnected&&e.focus({preventScroll:!0}),f.current=!1}},[e]);const ee=t.useCallback(()=>{f.current=!0},[]),te=t.useCallback(e=>{e.currentTarget.contains(e.relatedTarget)||(f.current=!1)},[]),ne=t.useCallback(e=>{"Escape"!==e.key||a||(e.stopPropagation(),G())},[G,a]);if(!e)return null;const re=(null==A?void 0:A.rows)&&A.rows.length>0?A.rows:[],ie=re.length>0,oe=Boolean(A&&A.fields.length>0),ae=ie||oe,se={zoom:N,width:"520px",maxWidth:`${Math.max(160,Math.floor((b.width-32)/N))}px`,maxHeight:`${Math.max(120,Math.floor((b.height-32)/N))}px`},de=N<1?Math.ceil(28/N):28,le={width:`${de}px`,height:`${de}px`},ue={height:`${de}px`,minWidth:`${Math.ceil(48/Math.min(N,1))}px`},ce=$.jsx("div",{ref:l,role:"dialog","aria-labelledby":p,tabIndex:-1,onKeyDown:ne,onFocus:ee,onBlur:te,className:Xh`fixed z-[9999] overflow-hidden rounded-xl border border-gray-300 bg-white text-gray-900 shadow-2xl focus:outline-none`,style:{left:`${m.x}px`,top:`${m.y}px`,maxWidth:"calc(100vw - 32px)",maxHeight:"calc(100vh - 32px)"},children:$.jsxs("div",{"data-testid":"campaign-form-scaled","data-scale":w?_:oy,className:Xh`flex flex-col`,style:se,children:[$.jsxs("div",{onPointerDown:W,className:Xh`flex flex-wrap cursor-move select-none items-center gap-2 border-b border-gray-200 bg-gradient-to-r from-blue-600 to-blue-700 px-3 py-2.5 text-white`,style:{touchAction:"none"},children:[$.jsxs("div",{className:Xh`flex min-w-[7rem] flex-1 items-center gap-2`,children:[$.jsx(Hc,{"aria-hidden":!0,className:Xh`h-5 w-5 flex-shrink-0`}),$.jsx("h3",{id:p,className:Xh`truncate text-sm font-bold`,children:"Informações da Campanha"})]}),w&&$.jsxs("div",{role:"group","aria-label":"Tamanho do formulário",className:Xh`ml-auto flex flex-shrink-0 items-center gap-0.5`,children:[$.jsx("button",{type:"button",onClick:J,"aria-disabled":!Y,"aria-label":"Diminuir o tamanho do formulário",title:"Diminuir o formulário e o texto",className:Xh`${ay} ${Y?"":"cursor-not-allowed"}`,style:le,children:$.jsx(Pc,{"aria-hidden":!0,className:Xh`h-4 w-4 ${Y?"":"opacity-40"}`})}),$.jsxs("button",{type:"button",onClick:Q,"aria-label":`Tamanho atual ${_}%. Restaurar o tamanho padrão`,title:"Restaurar o tamanho padrão (100%)",className:Xh`flex-shrink-0 rounded-md px-1 text-center text-xs font-semibold tabular-nums transition hover:bg-black hover:bg-opacity-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white`,style:ue,children:[_,"%"]}),$.jsx("button",{type:"button",onClick:Z,"aria-disabled":!X,"aria-label":"Aumentar o tamanho do formulário",title:"Aumentar o formulário e o texto",className:Xh`${ay} ${X?"":"cursor-not-allowed"}`,style:le,children:$.jsx(Bc,{"aria-hidden":!0,className:Xh`h-4 w-4 ${X?"":"opacity-40"}`})}),$.jsx("span",{role:"status",className:Xh`sr-only`,children:S})]}),$.jsx("button",{type:"button",onClick:G,disabled:a,"aria-label":a?"Aguarde o fim da chamada para fechar":"Fechar",className:Xh`${ay} rounded-full disabled:cursor-not-allowed disabled:opacity-40`,style:le,title:a?"Aguarde o fim da chamada para fechar":"Fechar",children:$.jsx(Yc,{"aria-hidden":!0,className:Xh`h-5 w-5`})})]}),$.jsxs("div",{tabIndex:0,role:"region","aria-label":"Dados do contato",className:Xh`min-h-0 flex-1 space-y-3 overflow-y-auto p-4 focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500`,children:[$.jsxs("div",{className:Xh`grid grid-cols-2 gap-3`,children:[$.jsxs("div",{className:Xh`flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2`,children:[$.jsx(Tc,{"aria-hidden":!0,className:Xh`h-4 w-4 text-gray-500`}),$.jsxs("div",{children:[$.jsx("p",{className:Xh`text-[10px] text-gray-500 uppercase tracking-wide font-medium`,children:"Duração"}),$.jsx("p",{className:Xh`text-sm font-bold text-gray-800`,children:hy(o)})]})]}),$.jsxs("div",{className:Xh`flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2`,children:[$.jsx(Hc,{"aria-hidden":!0,className:Xh`h-4 w-4 text-gray-500`}),$.jsxs("div",{className:Xh`min-w-0 flex-1`,children:[$.jsx("p",{className:Xh`text-[10px] text-gray-500 uppercase tracking-wide font-medium`,children:"Cliente"}),$.jsx("p",{className:Xh`truncate text-sm font-bold text-gray-800`,children:(null==L?void 0:L.label)||"N/A"})]})]})]}),I&&$.jsxs("div",{className:Xh`rounded-lg border border-blue-200 bg-blue-50 p-6 text-center`,role:"status",children:[$.jsx("div",{className:Xh`mx-auto mb-2 inline-block h-6 w-6 animate-spin rounded-full border-2 border-blue-500 border-t-transparent`}),$.jsx("p",{className:Xh`text-xs font-medium text-blue-700`,children:"Carregando dados do contato..."})]}),j&&!I&&$.jsx("div",{className:Xh`rounded-lg border border-red-200 bg-red-50 p-3`,children:$.jsxs("div",{className:Xh`flex items-center gap-2`,children:[$.jsx(_c,{"aria-hidden":!0,className:Xh`h-4 w-4 flex-shrink-0 text-red-600`}),$.jsxs("div",{className:Xh`min-w-0 flex-1`,children:[$.jsx("p",{className:Xh`text-xs font-semibold text-red-700`,children:"Erro ao carregar dados"}),$.jsx("p",{className:Xh`text-[10px] text-red-600`,children:j})]}),$.jsx("button",{type:"button",onClick:V,className:Xh`rounded-md border border-red-300 bg-white px-2 py-1 text-[11px] font-semibold text-red-700 transition hover:bg-red-100`,children:"Tentar novamente"})]})}),!I&&!j&&ie&&$.jsx("div",{className:Xh`space-y-2`,children:re.map((e,t)=>{return $.jsx("div",{className:Xh`grid gap-2 ${n=e.length,2===n?"grid-cols-2":3===n?"grid-cols-3":4===n?"grid-cols-4":n>=5?"grid-cols-5":"grid-cols-1"}`,children:e.map((e,n)=>$.jsx(my,{label:e.label,value:e.value||"-",fullWidth:"100%"===e.width},`${t}-${n}-${e.key}`))},t);var n})}),!I&&!j&&!ie&&oe&&A&&$.jsx("div",{className:Xh`grid grid-cols-2 gap-2`,children:A.fields.map(e=>$.jsx(my,{label:e.label,value:e.value||"-"},e.key))}),!I&&!j&&!ae&&$.jsxs("div",{className:Xh`flex flex-col items-center justify-center rounded-lg border border-gray-200 bg-gray-50 px-4 py-8 text-center`,children:[$.jsx(Hc,{"aria-hidden":!0,className:Xh`mb-2 h-8 w-8 text-gray-400`}),$.jsx("p",{className:Xh`text-sm text-gray-500`,children:"Nenhum dado disponível"})]})]}),a&&$.jsx("div",{className:Xh`border-t border-gray-200 bg-gray-50 px-4 py-2`,children:$.jsx("p",{className:Xh`text-center text-xs text-gray-500`,children:"Aguarde o fim da chamada para fechar"})})]})});return"undefined"!=typeof document?n.createPortal(ce,d??document.body):null}function my({label:e,value:t,fullWidth:n}){const r=n?"col-span-full":"";return $.jsxs("div",{className:Xh`rounded-lg border border-gray-200 bg-white p-2 ${r}`,children:[$.jsx("p",{className:Xh`mb-0.5 truncate text-[9px] font-semibold uppercase tracking-wide text-gray-500`,children:e}),$.jsx("p",{className:Xh`overflow-hidden break-words text-xs font-semibold text-gray-800`,style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:t})]})}if("undefined"!=typeof window&&!window.__fetchIntercepted__){window.__fetchIntercepted__=!0;const e=window.fetch.bind(window);window.fetch=async function(t,n){const r=`req_${Date.now()}_${Math.random().toString(36).substring(2,8)}`,i="string"==typeof t?t:t instanceof URL?t.href:t.url,o=(null==n?void 0:n.method)||(t instanceof Request?t.method:"GET"),a={};(null==n?void 0:n.headers)&&(n.headers instanceof Headers?n.headers.forEach((e,t)=>{a[t]=t.toLowerCase().includes("token")||t.toLowerCase().includes("auth")?`${e.substring(0,30)}...(${e.length} chars)`:e}):Array.isArray(n.headers)?n.headers.forEach(([e,t])=>{a[e]=e.toLowerCase().includes("token")||e.toLowerCase().includes("auth")?`${t.substring(0,30)}...(${t.length} chars)`:t}):Object.entries(n.headers).forEach(([e,t])=>{a[e]=e.toLowerCase().includes("token")||e.toLowerCase().includes("auth")?`${String(t).substring(0,30)}...(${String(t).length} chars)`:String(t)}));const s=performance.now();if(console.log(`%c[FETCH ${r}] ➡️ ${o} ${i}`,"color: #4CAF50; font-weight: bold"),console.log(`[FETCH ${r}] Headers:`,JSON.stringify(a,null,2)),null==n?void 0:n.body)try{const e="string"==typeof n.body?n.body:JSON.stringify(n.body);console.log(`[FETCH ${r}] Body:`,e.substring(0,500))}catch{console.log(`[FETCH ${r}] Body: [não serializável]`)}console.log(`[FETCH ${r}] credentials: ${(null==n?void 0:n.credentials)||"default"}, mode: ${(null==n?void 0:n.mode)||"default"}`),Uv("network","Request",`➡️ ${o} ${i.substring(0,60)}...`,{requestId:r,method:o,url:i,headers:a,credentials:null==n?void 0:n.credentials});try{const o=await e(t,n),l=performance.now(),u=Math.round(l-s),c={};o.headers.forEach((e,t)=>{c[t]=e});const f=o.ok?"#4CAF50":"#F44336";if(console.log(`%c[FETCH ${r}] ⬅️ ${o.status} ${o.statusText} (${u}ms)`,`color: ${f}; font-weight: bold`),console.log(`[FETCH ${r}] Response Headers:`,JSON.stringify(c,null,2)),Uv(o.ok?"network":"error","Response",`⬅️ ${o.status} ${i.substring(0,40)}... (${u}ms)`,{requestId:r,status:o.status,statusText:o.statusText,duration:u,headers:c}),401===o.status||403===o.status){console.error(`%c[FETCH ${r}] ❌ AUTH ERROR ${o.status}`,"color: #F44336; font-weight: bold; font-size: 14px"),console.error(`[FETCH ${r}] URL completa:`,i),console.error(`[FETCH ${r}] Todos os headers enviados:`,a);try{const e=o.clone(),t=await e.text();console.error(`[FETCH ${r}] Response Body:`,t),Uv("error","AuthError",`❌ ${o.status} - ${t.substring(0,200)}`,{requestId:r,url:i,headers:a,responseBody:t})}catch(d){console.error(`[FETCH ${r}] Não foi possível ler body do erro:`,d)}}return o}catch(l){const e=performance.now(),t=Math.round(e-s);throw console.error(`%c[FETCH ${r}] ❌ NETWORK ERROR (${t}ms)`,"color: #F44336; font-weight: bold"),console.error(`[FETCH ${r}] Error:`,l),Uv("error","NetworkError",`❌ ${i.substring(0,40)}... - ${String(l)}`,{requestId:r,url:i,error:String(l),duration:t}),l}},console.log("%c[FETCH INTERCEPTOR] ✅ Ativo - todas as requisições serão logadas","color: #2196F3; font-weight: bold; font-size: 12px")}function gy(e,t){return om({values:e},t)}function $y(e){t.useEffect(()=>{if(!document.querySelector('link[data-mobile-dialer-fa="true"]')){const e=document.createElement("link");e.rel="stylesheet",e.href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css",e.dataset.mobileDialerFa="true",document.head.appendChild(e)}},[]);const n=E$(),r=function(e,t){return"compact"===e||"comfortable"===e?e:t.touchLike?"comfortable":"compact"}(e.density,n);return e.isAuthenticated?$.jsx(xy,{...e,density:r}):$.jsx(vy,{...e,density:r})}function vy({username:e,onLogin:n,isLoadingSession:r,sessionError:i,sessionStatus:o,loginConfirmation:a,onCancelLoginConfirmation:s,onTakeOverSession:d,onLogoutAllTabs:l,density:u}){const[c,f]=t.useState(e??""),[h,p]=t.useState(null);t.useEffect(()=>{f(e??"")},[e]);const m=t.useCallback(async e=>{const t=e.trim();if(t){p(null);try{await Promise.resolve(n(t))}catch(r){p("Falha ao autenticar."),console.error("Erro login",r)}}else p("Informe o usuário Callix.")},[n]),g=t.useCallback(()=>m(c),[m,c]),v=Boolean(a)&&!r,y=((null==a?void 0:a.username)||c||e||"").trim();return $.jsx("div",{className:"phone-container","data-density":"compact"===u?"compact":"comfortable",children:$.jsxs("div",{className:"screen dialer-screen login-screen active",id:"dialerScreen",children:[$.jsx("div",{className:"dialer-header",children:$.jsx("div",{className:"status-container",children:$.jsxs("button",{type:"button",className:"status-badge "+(r?"connecting":"available"),children:[$.jsx("span",{className:"status-dot"}),$.jsx("span",{className:"status-text",children:r?"Conectando":"Login"})]})})}),r?$.jsxs("div",{className:"login-loading",role:"status","aria-live":"polite",children:[$.jsx("div",{className:"login-spinner","aria-hidden":"true"}),y&&$.jsx("div",{className:"login-loading-user",children:y}),$.jsx("div",{className:"login-status",children:o||"Conectando..."})]}):v&&a?a.elsewhere?$.jsxs("div",{className:"login-confirm","data-login-state":"elsewhere",children:[$.jsx("div",{className:"login-confirm-label",children:"Discador ativo em outra aba"}),$.jsxs("div",{className:"login-user-chip",children:[$.jsx("i",{className:"fas fa-user-check","aria-hidden":"true"}),$.jsx("span",{children:a.username})]}),i&&$.jsx("div",{className:"input-error",children:i}),$.jsxs("button",{type:"button",className:"login-confirm-btn login-confirm-btn-blue",id:"takeOverBtn",onClick:()=>null==d?void 0:d(),children:[$.jsx("i",{className:"fas fa-arrow-down","aria-hidden":"true"}),$.jsx("span",{children:"Usar o discador nesta aba"})]}),$.jsx("button",{type:"button",className:"login-secondary-btn login-secondary-danger",id:"logoutAllBtn",onClick:()=>null==l?void 0:l(),children:"Sair em todas as abas"}),$.jsx("p",{className:"login-hint",children:"O Callix aceita uma conexão por usuário: você já está conectado em outra aba deste navegador e pode continuar por lá."})]}):$.jsxs("div",{className:"login-confirm","data-login-state":"choose",children:[$.jsx("div",{className:"login-confirm-label",children:"Entrar como"}),$.jsxs("div",{className:"login-user-chip",children:[$.jsx("i",{className:"fas fa-user","aria-hidden":"true"}),$.jsx("span",{children:a.username})]}),i&&$.jsx("div",{className:"input-error",children:i}),!i&&a.note&&$.jsx("div",{className:"login-note",children:a.note}),$.jsxs("button",{type:"button",className:"login-confirm-btn",id:"loginConfirmBtn",onClick:()=>{m(a.username)},children:[$.jsx("i",{className:"fas fa-sign-in-alt","aria-hidden":"true"}),$.jsx("span",{children:"Entrar"})]}),!a.locked&&s&&$.jsx("button",{type:"button",className:"login-secondary-btn",onClick:s,children:"Usar outro usuário"}),$.jsx("p",{className:"login-hint",children:"Ao entrar, todas as abas abertas passam a usar o discador. Vai usar o Callix web? Então não entre aqui: nada é conectado sem a sua confirmação."})]}):$.jsxs($.Fragment,{children:[$.jsx("div",{className:"phone-number-display",children:$.jsx("input",{type:"text",className:"phone-input",placeholder:"Digite seu usuário Callix",value:c,onChange:e=>f(e.target.value),onKeyDown:e=>"Enter"===e.key&&g(),autoCapitalize:"none",autoCorrect:"off",spellCheck:!1})}),h&&$.jsx("div",{className:"input-error",children:h}),i&&$.jsx("div",{className:"input-error",children:i}),$.jsxs("div",{className:"call-actions",children:[$.jsx("div",{className:"empty-space"}),$.jsx("button",{type:"button",className:"call-button",onClick:g,"aria-label":"Entrar",children:$.jsx("i",{className:"fas fa-sign-in-alt"})}),$.jsx("div",{className:"empty-space"})]})]})]})})}function yy(e,t){if(!e)return;const n=Object.entries(e),r=t.map(e=>e.toLowerCase());for(const[i,o]of n)if(r.includes(i.toLowerCase()))return o}function by(e,t){const n=function(e){if(!e)return"";const t=e.trim().split(/\s+/)[0]||"";return t?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():""}(e);if(!t||"object"!=typeof t||0===Object.keys(t).length)return console.log("[WhatsApp Template] Sem dados de contato, usando mensagem genérica"),`Olá! Aqui é *${n}*, do Grupo Villela. Estou entrando em contato para dar continuidade ao nosso atendimento. Posso ajudar?`;console.log("[WhatsApp Template] Operador:",e,"-> Primeiro nome:",n),console.log("[WhatsApp Template] Campos recebidos:",t),console.log("[WhatsApp Template] Chaves disponíveis:",Object.keys(t));const r=yy(t,["DECISOR","SOCIO","NOME","PROSPECT","CLIENTE","CONTATO"]);console.log("[WhatsApp Template] Prospect encontrado:",r);const i=yy(t,["EMPRESA","RAZAO SOCIAL","RAZÃO SOCIAL","RAZAO_SOCIAL","COMPANY","NOME_EMPRESA"]);console.log("[WhatsApp Template] Empresa encontrada:",i);const o=yy(t,["BENEFICIO","BENEFÍCIO","CAPITAL_RECUPERAR","CAPITAL A RECUPERAR","POTENCIAL","VALOR_RECUPERAR","VALOR RECUPERADO"]);if(console.log("[WhatsApp Template] Potencial encontrado:",o),!r&&!i&&!o)return console.log("[WhatsApp Template] Nenhum campo útil encontrado, usando mensagem genérica"),`Olá! Aqui é *${n}*, do Grupo Villela. Estou entrando em contato para dar continuidade ao nosso atendimento. Posso ajudar?`;let a=`Oi, *${r||"tudo bem"}*. Aqui é *${n}*, do Grupo Villela. Empresa líder no mercado de redução de dívidas e recuperação de capital, com mais de 20 anos de experiência.`;return i&&(a+=`\n\nVimos que a *${i}* tem um débito federal que contém cobranças indevidas.`),o?a+=`\n\nEm uma análise preliminar, verificamos que é possível recuperar para sua empresa um valor aproximado de *${o}*.`:i&&(a+="\n\nEm uma análise preliminar, verificamos que é possível recuperar valores significativos para sua empresa."),a+="\n\nGostaríamos de fazer um *diagnóstico gratuito* para te apresentar os valores reais que a empresa pode economizar. Posso te encaminhar o link para autorização?",a}function xy({username:e,onLogout:n,showClientInfoModal:r=!1,density:i}){var o,a,s,d,l,u;const{skipManualQualification:c}=Xy(),[f,h]=t.useState(""),[p,m]=t.useState("dialer"),[g,v]=t.useState(!1),[y,b]=t.useState(!1),[x,w]=t.useState("success"),[_,C]=t.useState(null),[S,E]=t.useState(null),[N,T]=t.useState(0),[A,O]=t.useState(null),[I,k]=t.useState(!1),[j,R]=t.useState(!1);Hv();const[P,D]=t.useState(null),[L,M]=t.useState(null),[U,F]=t.useState(0),[B,q]=t.useState({finalData:{},isLoading:!1,error:null}),[z,H]=t.useState([]),[W,G]=t.useState(!1),[V,K]=t.useState(null),[Y,X]=t.useState(""),[J,Z]=t.useState(null),[Q,ee]=t.useState(!1),te=t.useRef(null),ne=t.useRef(0),[re,ie]=t.useState(!1),[oe,ae]=t.useState([]),[se,de]=t.useState(null),[le,ue]=t.useState("default"),[ce,fe]=t.useState(null),he=Qu(),pe=ec(),me=nc(),{hangup:ge,answer:$e,reject:ve}=ac(),ye=rc(),be=(null==(o=null==me?void 0:me.data)?void 0:o.destinationNumber)||(null==me?void 0:me.callerNumber)||"",xe=ic(),we=oc(),_e=t.useMemo(()=>xe??[],[xe]),Ce=t.useMemo(()=>we??[],[we]),{makeManualCall:Se,finishAfterCall:Ee}=tc(),{goOnBreak:Ne,goOffBreak:Te}=um(),Ae=lm(null==he?void 0:he.breaks)||[],Oe=lm(null==he?void 0:he.user),Ie="onBreak"===(null==pe?void 0:pe.state),[ke,je]=sc(),Re=function(){const e=t.useCallback((e="light")=>{if("undefined"==typeof navigator||!("vibrate"in navigator))return;const t=Nv[e];try{navigator.vibrate(t)}catch{}},[]),n=t.useCallback(()=>e("light"),[e]),r=t.useCallback(()=>e("medium"),[e]),i=t.useCallback(()=>e("heavy"),[e]),o=t.useCallback(()=>e("selection"),[e]),a=t.useCallback(()=>e("success"),[e]),s=t.useCallback(()=>e("warning"),[e]),d=t.useCallback(()=>e("error"),[e]);return{trigger:e,impactLight:n,impactMedium:r,impactHeavy:i,selectionChanged:o,notificationSuccess:a,notificationWarning:s,notificationError:d}}(),Pe=function(e={}){const{enabled:n=!0,volume:r=Ov,duration:i=Av}=e,o=t.useRef(null),a=t.useRef([]),s=t.useCallback(()=>{var e;if(!n)return null;if(!o.current)try{const e=window.AudioContext||window.webkitAudioContext;e&&(o.current=new e)}catch{return console.warn("[useDTMF] Web Audio API não suportada"),null}return"suspended"===(null==(e=o.current)?void 0:e.state)&&o.current.resume().catch(()=>{}),o.current},[n]),d=t.useCallback(e=>{const t=s();if(!t)return;const n=Tv[e];if(!n)return;const[o,d]=n,l=t.currentTime,u=l+i/1e3;try{const e=t.createOscillator(),n=t.createOscillator(),s=t.createGain(),c=t.createGain();e.type="sine",n.type="sine",e.frequency.setValueAtTime(o,l),n.frequency.setValueAtTime(d,l),s.gain.setValueAtTime(0,l),s.gain.linearRampToValueAtTime(r,l+Iv),s.gain.setValueAtTime(r,u-Iv),s.gain.linearRampToValueAtTime(0,u),c.gain.setValueAtTime(0,l),c.gain.linearRampToValueAtTime(r,l+Iv),c.gain.setValueAtTime(r,u-Iv),c.gain.linearRampToValueAtTime(0,u),e.connect(s),s.connect(t.destination),n.connect(c),c.connect(t.destination),e.start(l),n.start(l),e.stop(u+.01),n.stop(u+.01),a.current.push(e,n),setTimeout(()=>{a.current=a.current.filter(t=>t!==e&&t!==n)},i+50)}catch(c){console.warn("[useDTMF] Erro ao tocar tom:",c)}},[s,i,r]),l=t.useCallback(()=>{a.current.forEach(e=>{try{e.stop()}catch{}}),a.current=[]},[]);return t.useEffect(()=>()=>{l(),o.current&&(o.current.close().catch(()=>{}),o.current=null)},[l]),{play:d,stopAll:l,isSupported:"undefined"!=typeof window&&!(!window.AudioContext&&!window.webkitAudioContext)}}({enabled:!0}),De=t.useRef(""),Le=t.useRef(null),Me=t.useCallback(e=>!!["*#0000#","*#3284#"].includes(e)&&(Uv("info","Debug","🔓 Código secreto detectado - abrindo painel de debug"),R(!0),h(""),De.current="",!0),[]);t.useEffect(()=>{var e,t;const n=async()=>{try{const t=document.createElement("audio");if(!("setSinkId"in t))return console.log("[MobileDialer] setSinkId não suportado neste navegador"),void fe(!1);let n=!1,r=await navigator.mediaDevices.enumerateDevices(),i=r.filter(e=>"audiooutput"===e.kind);if(!i.some(e=>e.label&&e.label.length>0)&&i.length>0){console.log("[MobileDialer] Labels vazios, solicitando permissão de áudio...");try{const e=await navigator.mediaDevices.getUserMedia({audio:!0});n=!0,e.getTracks().forEach(e=>e.stop()),r=await navigator.mediaDevices.enumerateDevices(),i=r.filter(e=>"audiooutput"===e.kind),console.log("[MobileDialer] Permissão concedida. Dispositivos:",i.length,i)}catch(e){console.log("[MobileDialer] Usuário negou permissão de áudio:",e)}}else n=!0;if(console.log("[MobileDialer] Dispositivos de saída encontrados:",i.length,i),i.length<=1)return console.log("[MobileDialer] Apenas um dispositivo de saída - viva-voz não disponível"),void fe(!1);ae(i);const o=i.find(e=>e.label.toLowerCase().includes("speaker")||e.label.toLowerCase().includes("alto-falante")||e.label.toLowerCase().includes("viva-voz")),a=i.find(e=>"default"===e.deviceId||e.label.toLowerCase().includes("default")||e.label.toLowerCase().includes("earpiece")||e.label.toLowerCase().includes("fone"))||i[0];if(o&&o.deviceId!==(null==a?void 0:a.deviceId))de(o.deviceId),ue((null==a?void 0:a.deviceId)||"default"),fe(!0),console.log("[MobileDialer] Viva-voz disponível:",o.label);else if(i.length>1){const e=i.find(e=>e.deviceId!==(null==a?void 0:a.deviceId));e?(de(e.deviceId),ue((null==a?void 0:a.deviceId)||"default"),fe(!0),console.log("[MobileDialer] Usando dispositivo alternativo para viva-voz:",e.label)):fe(!1)}else fe(!1)}catch(t){console.error("[MobileDialer] Erro ao detectar dispositivos de áudio:",t),fe(!1)}};n();const r=()=>{console.log("[MobileDialer] Mudança de dispositivos detectada"),n()};return null==(t=null==(e=navigator.mediaDevices)?void 0:e.addEventListener)||t.call(e,"devicechange",r),()=>{var e,t;null==(t=null==(e=navigator.mediaDevices)?void 0:e.removeEventListener)||t.call(e,"devicechange",r)}},[]);const Ue=null==pe?void 0:pe.state,Fe=t.useRef(!1);t.useEffect(()=>{if(0===Ae.length||"idle"!==Ue||Fe.current||Ie)return;if(!Ne)return;Fe.current=!0;const e=Ae.find(e=>5===e.id||e.name.toLowerCase()==="Reunião".toLowerCase());if(e)console.log("[MobileDialer] Operador conectado (idle), entrando em pausa inicial:",e.name),Promise.resolve(Ne(e.id)).then(()=>{console.log("[MobileDialer] Pausa inicial aplicada com sucesso:",e.name),D(e.name),M(Date.now())}).catch(e=>{console.error("[MobileDialer] Falha ao entrar em pausa:",e),Fe.current=!1});else{const e=Ae[0];console.log('[MobileDialer] Pausa "Reunião" não encontrada, usando:',e.name),Promise.resolve(Ne(e.id)).then(()=>{console.log("[MobileDialer] Pausa inicial aplicada com sucesso:",e.name),D(e.name),M(Date.now())}).catch(e=>{console.error("[MobileDialer] Falha ao entrar em pausa:",e),Fe.current=!1})}},[Ae,Ue,Ie,Ne]),t.useEffect(()=>{console.log("[MobileDialer] Breaks loaded:",Ae),Uv("state","Breaks",`Pausas carregadas: ${Ae.length}`,Ae)},[Ae]),t.useEffect(()=>{console.log("[MobileDialer] Call state changed:",Ue),Uv("state","CallState",`Estado da chamada: ${Ue}`,{callState:Ue,isOnBreak:Ie}),"offline"===Ue&&(console.warn("[MobileDialer] Estado OFFLINE detectado - verifique a conexão"),Uv("warn","Connection","⚠️ Estado OFFLINE detectado"))},[Ue,Ie]),t.useEffect(()=>{ye&&console.log("[MobileDialer] Call info atualizado:",{type:null==ye?void 0:ye.type,info:"campaign"===(null==ye?void 0:ye.type)?{campaign:ye.info.campaign,campaignContact:ye.info.campaignContact}:ye})},[ye]);const Be=t.useMemo(()=>{var e;return"campaign"===(null==ye?void 0:ye.type)?em(ye.info,(null==(e=null==me?void 0:me.data)?void 0:e.campaignContactPhoneId)??null):null},[ye,me]),qe=Be?Qp(Be):null,ze=t.useRef(Be);ze.current=Be,t.useEffect(()=>{const e=ze.current;if(!e||!qe)return void q({finalData:{},isLoading:!1,error:null});let t=!1,n=null;q({finalData:{},isLoading:!0,error:null}),Uv("debug","FetchContact","Buscando formulário do contato",{contactId:e.id,source:e.source});const r=t=>{q({finalData:t.values,isLoading:!1,error:null}),Uv("info","FetchContact",`✅ Formulário: ${t.fields.length} campos (${t.valuesSource}, layout ${t.layoutSource})`,{contactId:e.id,partial:!0===t.partial})};return rm(e).then(i=>{t||(r(i),i.partial&&(n=setTimeout(()=>{t||rm(e,{force:!0}).then(e=>{t||r(e)}).catch(()=>{})},3e3)))}).catch(e=>{t||(console.error("[MobileDialer] Erro ao buscar o formulário:",e),q({finalData:{},isLoading:!1,error:e instanceof Error?e.message:"Erro ao buscar dados"}))}),()=>{t=!0,n&&clearTimeout(n)}},[qe]);const He=Ue,{notice:We,dismiss:Ge,recheckDevices:Ve}=ny(),[Ke,Ye]=t.useState(0),Xe="startupError"===He||"offline"===He||"device"===(null==We?void 0:We.source)||"session"===(null==We?void 0:We.source),Je=!He||"starting"===He||"idle"===He||"manualCallSetup"===He||"onBreak"===He,Ze="manualCallSetup"===Ue||"manualCallRinging"===Ue||"callRinging"===Ue,Qe="callInProgress"===Ue,et="afterCall"===Ue,tt=t.useMemo(()=>ye&&"campaign"===ye.type?ye.info:null,[ye]);t.useEffect(()=>{r&&(Qe||Ze)&&"campaign"===(null==ye?void 0:ye.type)&&k(!0)},[r,Qe,Ze,ye]),t.useEffect(()=>{r&&(Qe||Ze||et||k(!1))},[r,Qe,Ze,et]),t.useEffect(()=>{if(!Qe)return void T(0);const e=setInterval(()=>{T(e=>e+1)},1e3);return()=>clearInterval(e)},[Qe]),t.useEffect(()=>{if(!Ie||!L)return;const e=setInterval(()=>{const e=Math.floor((Date.now()-L)/1e3);F(e)},1e3);return()=>clearInterval(e)},[Ie,L]),t.useEffect(()=>{!Ie&&P&&(D(null),M(null),F(0))},[Ie,P]),t.useEffect(()=>{const e=e=>{const t=e.detail;(null==t?void 0:t.phone)&&(O(null),h(k$(t.phone).slice(0,32)),m("dialer"),Uv("event","Call",`🖱️ Click-to-call recebido: ${t.phoneDisplay}`,{taskId:t.id,source:t.source}))};return window.addEventListener(N$,e),()=>window.removeEventListener(N$,e)},[]),t.useEffect(()=>{console.log("[MobileDialer] Screen control effect - callState:",Ue,"isInCall:",Qe,"isConnecting:",Ze,"isAfterCall:",et),Qe||Ze?m("call"):(et||Je||Ie)&&m("dialer")},[Qe,Ze,et,Je,Ie,Ue]),t.useEffect(()=>{if(et){console.log("[MobileDialer] 📋 afterCall triggered - callInfo:",JSON.stringify(ye,null,2)),console.log("[MobileDialer] 📋 afterCall - callInfo?.type:",null==ye?void 0:ye.type),console.log("[MobileDialer] 📋 afterCall - skipManualQualification:",c),console.log("[MobileDialer] 📋 afterCall - successQualifications:",_e.length),console.log("[MobileDialer] 📋 afterCall - discardQualifications:",Ce.length);if("campaign"===(null==ye?void 0:ye.type)&&!0===ye.info.campaign.skipCallQualification&&Ee)return console.log("[MobileDialer] 🚀 Campanha com skipCallQualification - finalizando automaticamente"),void Promise.resolve(Ee({result:"success",qualificationId:void 0}));if("manual"===(null==ye?void 0:ye.type)&&Ee)return console.log("[MobileDialer] 🚀 Chamada MANUAL detectada - finalizando automaticamente (chamadas manuais NUNCA exibem qualificação)"),void Promise.resolve(Ee({result:"success",qualificationId:void 0}));if(0===_e.length&&0===Ce.length&&Ee)return console.log("[MobileDialer] 🚀 Sem qualificações configuradas - finalizando automaticamente"),void Promise.resolve(Ee({result:"success",qualificationId:void 0}));console.log("[MobileDialer] ⚠️ Abrindo modal de qualificação - tipo:",null==ye?void 0:ye.type);const e=_e.length>0;w(e?"success":"failure"),C(null),E(null),b(!0)}else b(!1)},[et,ye,Ee,_e,Ce,c]);const nt=t.useMemo(()=>m$(f),[f]),rt=t.useMemo(()=>{if(/[*#]/.test(f))return null;const e=f.replace(/\D/g,"");if(!e)return null;const t=p$(e);return t&&t!==e&&v$(t)?m$(t):null},[f]),it=t.useCallback(e=>p$(e),[]),ot=t.useCallback(e=>{if(Re.impactLight(),Pe.play(e),Le.current&&clearTimeout(Le.current),De.current+=e,console.log("[MobileDialer] Sequência atual:",De.current),Me(De.current))return console.log("[MobileDialer] 🔓 Código secreto detectado!"),void h("");if(De.current.length>20&&(De.current=De.current.slice(-10)),Le.current=setTimeout(()=>{De.current=""},3e3),Qe||Ze){if(me&&"function"==typeof me.sendDtmf)try{me.sendDtmf(e)}catch(t){console.error("Falha ao enviar DTMF",t)}}else h(t=>(t+e).slice(0,32))},[me,Qe,Ze,Re,Pe,Me]),at=t.useCallback(()=>{Re.impactLight(),h(e=>e.slice(0,-1))},[Re]),st=t.useCallback(async()=>{console.log("[MobileDialer] handleCall triggered, dialValue:",f),Uv("event","Call","📞 Iniciando chamada manual",{dialValue:f});const e=it(f);if(console.log("[MobileDialer] Sanitized number:",e),!e||!v$(e))return console.log("[MobileDialer] Invalid phone format"),Uv("warn","Call","⚠️ Número inválido",{sanitized:e,isValid:!1}),O("Número inválido. Informe o DDD e o número (fixo com 8 ou celular com 9 dígitos)."),void Re.notificationError();if(O(null),!Se)return console.error("[MobileDialer] makeManualCall is not available"),Uv("error","Call","❌ makeManualCall não disponível"),void O("Função de chamada não disponível.");const t=g$(e)??`+55${e}`;console.log("[MobileDialer] Calling makeManualCall with E.164:",t),Uv("info","Call",`📞 Ligando para ${t}`,{e164Number:t}),Re.impactMedium();try{Se(t),console.log("[MobileDialer] makeManualCall called successfully"),Uv("info","Call","✅ makeManualCall executado com sucesso")}catch(n){console.error("[MobileDialer] Erro ao iniciar chamada manual:",n),Uv("error","Call","❌ Erro ao iniciar chamada",n),O("Erro ao iniciar chamada."),Re.notificationError()}},[f,Se,it,Re]),dt=t.useCallback(async()=>{if(ge){Uv("event","Call","📴 Encerrando chamada"),Re.impactHeavy();try{await ge(),Uv("info","Call","✅ Chamada encerrada")}catch(e){console.error("[MobileDialer] Erro ao desligar",e)}}},[ge,Re]),lt=t.useCallback(()=>{Re.impactLight(),je(!ke)},[ke,je,Re]),ut=t.useCallback(()=>{if(Re.impactLight(),!1===ce)return console.warn("[MobileDialer] Viva-voz não suportado neste navegador/dispositivo"),void Re.notificationWarning();if(!se||null===ce)return console.warn("[MobileDialer] Dispositivos de saída não detectados ainda"),void Re.notificationWarning();const e=!re,t=e?se:le;console.log("[MobileDialer] Alternando viva-voz:",e?"LIGADO":"DESLIGADO","Device:",t);try{(null==he?void 0:he.audioOutput)?(he.audioOutput.setAudioOutputDevice(t),ie(e),Re.notificationSuccess(),console.log("[MobileDialer] Dispositivo de saída alterado com sucesso")):(console.warn("[MobileDialer] audioOutput não disponível no operator"),Re.notificationError())}catch(n){console.error("[MobileDialer] Erro ao alternar viva-voz:",n),Re.notificationError()}},[Re,ce,se,le,re,he]),ct=t.useCallback(async({phone:e,limit:t})=>{const n=null==Oe?void 0:Oe.id;if(!n)throw new Error("Aguardando ID do usuário");const r=new URLSearchParams({agent_id:String(n),limit:String(t)});e&&r.set("phone",e);const i=await fetch(`${Xp}/api/call-history?${r.toString()}`,{method:"GET",headers:Jp(),credentials:"omit"});if(!i.ok)throw new Error(401===i.status||403===i.status?"Sessão expirada. Entre novamente para ver o histórico.":`Erro ${i.status}`);return(await i.json()).items||[]},[null==Oe?void 0:Oe.id]),ft=t.useCallback(async()=>{if(null==Oe?void 0:Oe.id){G(!0),K(null),te.current=null;try{const e=await ct({limit:50});console.log("[MobileDialer] Histórico recebido:",e.length,"registros"),H(e)}catch(e){console.error("[MobileDialer] Erro ao buscar histórico:",e),K(e instanceof Error&&e.message.startsWith("Sessão")?e.message:"Erro ao carregar histórico"),H([])}finally{G(!1)}}else console.log("[MobileDialer] Aguardando ID do usuário para buscar histórico")},[ct,null==Oe?void 0:Oe.id]),ht=t.useCallback(async e=>{X(e);const t=dv(e),n=++ne.current;if("empty"===t.kind)return Z(null),void ee(!1);ee(!0);try{let e;"phone"===t.kind?e=await ct({phone:t.digits,limit:100}):(te.current||(te.current=await ct({limit:200})),e=te.current),n===ne.current&&Z(e)}catch(r){console.error("[MobileDialer] Erro na busca do histórico:",r),n===ne.current&&Z(null)}finally{n===ne.current&&ee(!1)}},[ct]),pt=t.useMemo(()=>{const e=dv(Y);return"phone"===e.kind?"Busca por número em todo o histórico":"text"===e.kind?J?"Busca por texto nas últimas 200 chamadas":"Busca por texto nas chamadas carregadas":null},[Y,J]);t.useEffect(()=>{"history"===p&&ft()},[p,ft]);const mt=t.useCallback(()=>{var t;let n="";"campaign"===(null==ye?void 0:ye.type)&&(null==(t=ye.info.campaignContact)?void 0:t.phoneNumber)?n=ye.info.campaignContact.phoneNumber:f?n=f:be&&(n=be);let r=n.replace(/[^\d+]/g,"");r.startsWith("+")||(r.startsWith("55")||(r="55"+r),r="+"+r);const i=by((null==Oe?void 0:Oe.name)||e||"",B.finalData),o=encodeURIComponent(i),a=`https://wa.me/${r.replace("+","")}?text=${o}`;console.log("[MobileDialer] Abrindo WhatsApp com template:",a),window.open(a,"_blank")},[ye,f,Oe,e,B.finalData,be]),gt=t.useCallback(async e=>{if(Ne)try{const t=Ae.find(t=>t.id===e);await Ne(e),Re.notificationSuccess(),D((null==t?void 0:t.name)??"Em pausa"),M(Date.now()),F(0),v(!1)}catch(t){console.error("Erro ao entrar em pausa",t),Re.notificationError()}},[Ne,Ae,Re]),$t=t.useCallback(async()=>{if(Te)try{await Te(),Re.notificationSuccess(),D(null),M(null),F(0),v(!1)}catch(e){console.error("Erro ao sair de pausa",e),Re.notificationError()}},[Te,Re]),vt=t.useCallback(async()=>{if(!Ee)return;if(!("success"===x?_e:Ce).length)return E("Nenhuma qualificação disponível."),void Re.notificationWarning();if(!_)return E("Selecione uma qualificação."),void Re.notificationWarning();E(null),Re.impactMedium();try{await Promise.resolve(Ee({result:x,qualificationId:_})),Re.notificationSuccess(),b(!1)}catch(e){E("Erro ao enviar qualificação."),Re.notificationError(),console.error("Erro finishAfterCall",e)}},[Ce,Ee,x,_,_e,Re]),yt=t.useMemo(()=>{var e;return"campaign"===(null==ye?void 0:ye.type)&&(null==(e=ye.info.campaignContact)?void 0:e.phoneNumber)?m$(ye.info.campaignContact.phoneNumber):nt||(be?m$(be):"(--) ----- ----")},[ye,nt,be]),bt=t.useMemo(()=>Ze?"Ligando...":Qe?"Em chamada":et?"Encerrando...":"manualCallFailed"===He?"Chamada não concluída":Xe?(null==We?void 0:We.title)??"Erro de conexão":Ie?"Em pausa":"Disponível",[He,We,et,Ze,Xe,Qe,Ie]),xt=t.useMemo(()=>Xe?"error":Ie?"paused":"available",[Xe,Ie]),wt="onBreak"===(null==pe?void 0:pe.state)?null==(a=pe.break)?void 0:a.name:void 0,_t=t.useMemo(()=>Xe?"device"===(null==We?void 0:We.source)?We.title:"Erro":Ie?P||wt||"Em pausa":"Disponível",[We,Xe,Ie,P,wt]),Ct=t.useMemo(()=>{const e=Math.floor(U/3600),t=Math.floor(U%3600/60).toString().padStart(2,"0"),n=(U%60).toString().padStart(2,"0");return e>0?`${e}:${t}:${n}`:`${t}:${n}`},[U]),St=t.useMemo(()=>`${Math.floor(N/60).toString().padStart(2,"0")}:${(N%60).toString().padStart(2,"0")}`,[N]),Et=(e,t)=>$.jsxs("div",{className:"key","data-value":e,onClick:()=>ot(e),role:"button","aria-label":`Tecla ${e}`,children:[$.jsx("span",{className:"number","aria-hidden":"true",children:e}),$.jsx("span",{className:"letters","aria-hidden":"true",children:t||" "})]},e);return j?$.jsx(Kv,{onClose:()=>{R(!1),Uv("info","Debug","🔒 Painel de debug fechado")}}):$.jsxs("div",{className:"phone-container","data-density":"compact"===i?"compact":"comfortable",style:{"--notice-h":`${Ke}px`},children:[$.jsxs("div",{className:"screen dialer-screen "+("dialer"===p?"active":""),id:"dialerScreen",children:[$.jsxs("div",{className:"dialer-header",children:[$.jsx("div",{className:"status-container",children:$.jsxs("button",{className:`status-badge ${xt}`,id:"statusBadge",children:[$.jsx("span",{className:"status-dot"}),Ie?$.jsxs("div",{className:"status-info",children:[$.jsx("span",{className:"status-text",children:_t}),$.jsx("span",{className:"pause-timer",children:Ct})]}):$.jsx("span",{className:"status-text",children:_t})]})}),$.jsxs("div",{className:"status-actions",children:[Ie?$.jsxs("button",{className:"resume-btn",id:"resumeBtn",onClick:$t,children:[$.jsx("i",{className:"fas fa-play"}),$.jsx("span",{children:"Voltar"})]}):$.jsxs("button",{className:"pause-btn",id:"pauseBtn",onClick:()=>v(!0),children:[$.jsx("i",{className:"fas fa-pause"}),$.jsx("span",{children:"Pausa"})]}),$.jsx("button",{type:"button",className:"logout-btn",id:"logoutBtn",title:"Sair do discador (todas as abas)","aria-label":"Sair do discador",onClick:()=>{("undefined"==typeof window||window.confirm("Sair do discador em todas as abas?"))&&n()},children:$.jsx("i",{className:"fas fa-right-from-bracket"})})]})]}),$.jsx(Yv,{notice:We,onDismiss:Ge,onRecheck:()=>{Ve()},onHeightChange:Ye}),$.jsx("div",{className:"phone-number-display",children:$.jsx(rv,{id:"phoneNumber",className:"phone-input",placeholder:"","aria-label":"Número de telefone",value:f,onChange:e=>h(e.slice(0,32)),onSubmit:()=>{st()}})}),rt&&$.jsxs("div",{className:"dial-preview",children:["Será discado: ",rt]}),$.jsxs("div",{className:"keypad",children:[Et("1",""),Et("2","ABC"),Et("3","DEF"),Et("4","GHI"),Et("5","JKL"),Et("6","MNO"),Et("7","PQRS"),Et("8","TUV"),Et("9","WXYZ"),Et("*",""),Et("0","+"),Et("#","")]}),A&&$.jsx("div",{className:"input-error",children:A}),$.jsxs("div",{className:"call-actions",children:[$.jsx("div",{className:"empty-space"}),$.jsx("button",{className:"call-button",id:"callButton",onClick:st,disabled:!nt||!Je,children:$.jsx("i",{className:"fas fa-phone"})}),$.jsx("button",{className:"delete-button",id:"deleteButton",style:{visibility:f?"visible":"hidden"},onClick:at,children:$.jsx("i",{className:"fas fa-delete-left"})})]})]}),$.jsxs("div",{className:"screen call-screen "+("call"===p?"active":""),id:"callScreen",children:[$.jsxs("div",{className:"call-info",children:[$.jsxs("div",{className:"call-status",children:[$.jsx("span",{className:"operator-badge-small",children:(null==e?void 0:e.slice(0,2).toUpperCase())||"OP"}),Qe?$.jsx("span",{id:"callTimer",children:St}):$.jsx("span",{id:"callStatus",children:bt})]}),$.jsx("div",{className:"call-number",id:"callNumber",children:yt}),$.jsx("div",{className:"call-location",children:"Brasil"}),"campaign"===(null==ye?void 0:ye.type)&&$.jsx("div",{className:"client-card",id:"clientCard",children:B.isLoading?$.jsxs("div",{className:"client-card-loading",children:[$.jsx("i",{className:"fas fa-spinner fa-spin"}),$.jsx("span",{children:"Carregando dados..."})]}):B.error?$.jsxs("div",{className:"client-card-error",children:[$.jsx("i",{className:"fas fa-exclamation-circle"}),$.jsx("span",{children:B.error})]}):$.jsxs($.Fragment,{children:[$.jsxs("div",{className:"client-card-header",children:[$.jsx("i",{className:"fas fa-user-circle client-avatar"}),$.jsxs("div",{className:"client-main-info",children:[$.jsx("span",{className:"client-name",id:"clientName",children:gy(B.finalData,["DECISOR","NOME","CLIENTE","PROSPECT"])??(null==(s=ye.info.campaignContact)?void 0:s.label)??"--"}),$.jsx("span",{className:"client-company",id:"clientCompany",children:gy(B.finalData,["EMPRESA","RAZAO SOCIAL","RAZÃO SOCIAL","RAZAO_SOCIAL"])??(null==(d=ye.info.campaign)?void 0:d.name)??"--"})]})]}),$.jsx("div",{className:"client-card-divider"}),$.jsxs("div",{className:"client-info-list",children:[$.jsxs("div",{className:"client-info-row",children:[$.jsx("span",{className:"client-info-label",children:"Socio"}),$.jsx("span",{className:"client-info-value",children:gy(B.finalData,["SOCIO","PROSPECT","DECISOR","NOME","CLIENTE"])??(null==(l=ye.info.campaignContact)?void 0:l.label)??"--"})]}),$.jsxs("div",{className:"client-info-row",children:[$.jsx("span",{className:"client-info-label",children:"Empresa"}),$.jsx("span",{className:"client-info-value",children:gy(B.finalData,["EMPRESA","RAZAO SOCIAL","RAZÃO SOCIAL","RAZAO_SOCIAL","COMPANY"])??"--"})]}),$.jsxs("div",{className:"client-info-row",children:[$.jsx("span",{className:"client-info-label",children:"CNPJ"}),$.jsx("span",{className:"client-info-value",children:gy(B.finalData,["CNPJ","CPF_CNPJ","CPF/CNPJ","DOCUMENTO"])??"--"})]}),$.jsxs("div",{className:"client-info-row",children:[$.jsx("span",{className:"client-info-label",children:"Dívida federal ativa"}),$.jsx("span",{className:"client-info-value debt",children:gy(B.finalData,["DIVIDA_ATIVA","DIVIDA ATIVA","DÍVIDA ATIVA","DIVIDA FEDERAL","DÍVIDA FEDERAL ATIVA","VALOR DIVIDA"])??"R$ 0,00"})]})]}),$.jsx("div",{className:"client-card-divider"}),$.jsxs("div",{className:"client-capital-section",children:[$.jsx("span",{className:"client-capital-label",children:"Capital a recuperar"}),$.jsx("span",{className:"client-capital-value",children:gy(B.finalData,["CAPITAL_RECUPERAR","CAPITAL A RECUPERAR","BENEFICIO","BENEFÍCIO","VALOR_TOTAL","VALOR RECUPERADO"])??"R$ 0,00"})]})]})})]}),$.jsx(ey,{}),$.jsxs("div",{className:"call-controls",children:[$.jsxs("div",{className:"control-row",children:[$.jsxs("button",{className:`control-button ${re?"active":""} ${!1===ce?"disabled":""}`,id:"speakerBtn",onClick:ut,disabled:!1===ce,title:!1===ce?"Viva-voz não suportado neste dispositivo":"",children:[$.jsx("div",{className:"control-icon",children:$.jsx("i",{className:"fas "+(re?"fa-volume-high":"fa-volume-low")})}),$.jsx("span",{children:re?"Viva-voz":"Alto-falante"})]}),$.jsxs("button",{className:"control-button "+(ke?"active":""),id:"muteBtn",onClick:lt,children:[$.jsx("div",{className:"control-icon",children:$.jsx("i",{className:"fas "+(ke?"fa-microphone-slash":"fa-microphone")})}),$.jsx("span",{children:"Mudo"})]}),$.jsxs("button",{className:"control-button",id:"keypadBtn",onClick:()=>m("incallKeypad"),children:[$.jsx("div",{className:"control-icon",children:$.jsx("i",{className:"fas fa-th"})}),$.jsx("span",{children:"Teclado"})]})]}),$.jsxs("div",{className:"control-row control-row-center",children:[$.jsxs("button",{className:"control-button whatsapp-btn",id:"whatsappBtn",onClick:mt,children:[$.jsx("div",{className:"control-icon whatsapp-icon",children:$.jsx("i",{className:"fab fa-whatsapp"})}),$.jsx("span",{children:"WhatsApp"})]}),$.jsxs("div",{className:"end-call-wrapper",children:[$.jsx("button",{className:"end-call-button",id:"endCallButton",onClick:dt,children:$.jsx("i",{className:"fas fa-phone-slash"})}),$.jsx("span",{className:"end-call-label",children:"Desligar"})]})]})]})]}),$.jsxs("div",{className:"screen incall-keypad-screen "+("incallKeypad"===p?"active":""),id:"incallKeypadScreen",children:[$.jsx("div",{className:"incall-header",children:$.jsx("button",{className:"hide-keypad-btn",id:"hideKeypadBtn",onClick:()=>m("call"),children:$.jsx("span",{children:"Ocultar"})})}),$.jsx("div",{className:"incall-number-display",children:$.jsx("span",{id:"incallPhoneNumber",children:yt})}),$.jsx("div",{className:"keypad incall-keypad",children:["1","2","3","4","5","6","7","8","9","*","0","#"].map(e=>$.jsxs("div",{className:"key incall-key","data-value":e,onClick:()=>ot(e),children:[$.jsx("span",{className:"number",children:e}),$.jsx("span",{className:"letters",children:" "})]},e))}),$.jsx("div",{className:"incall-actions",children:$.jsx("button",{className:"end-call-button",id:"endCallButton2",onClick:dt,children:$.jsx("i",{className:"fas fa-phone-slash"})})})]}),$.jsx("div",{className:"screen call-history-screen "+("history"===p?"active":""),id:"callHistoryScreen",children:$.jsx(Ev,{items:J??z,isLoading:W,error:V,onRefresh:ft,query:Y,onQueryChange:ht,isSearching:Q,searchHint:pt,onCall:e=>{Re.impactLight(),h(av(e)),m("dialer")},onWhatsApp:t=>{Re.impactLight();const n=`55${av(t)}`,r=by((null==Oe?void 0:Oe.name)||e||"",t.fields);window.open(`https://wa.me/${n}?text=${encodeURIComponent(r)}`,"_blank")},apiBaseUrl:Xp,getAuthHeaders:Jp})}),$.jsxs("nav",{className:"bottom-nav "+("call"===p||"incallKeypad"===p?"hidden":""),id:"bottomNav",children:[$.jsxs("div",{className:"nav-item "+("history"===p?"active":""),id:"navCalls",onClick:()=>m("history"),children:[$.jsx("div",{className:"nav-icon",children:$.jsx("i",{className:"fas fa-clock-rotate-left"})}),$.jsx("span",{children:"Recentes"})]}),$.jsxs("div",{className:"nav-item "+("dialer"===p||"call"===p||"incallKeypad"===p?"active":""),id:"navKeypad",onClick:()=>m("dialer"),children:[$.jsx("div",{className:"nav-icon",children:$.jsx("i",{className:"fas fa-th"})}),$.jsx("span",{children:"Teclado"})]})]}),$.jsx("div",{className:"modal-overlay "+(g?"active":""),id:"pauseModal",children:$.jsxs("div",{className:"modal-content",children:[$.jsxs("div",{className:"modal-header",children:[$.jsx("h2",{className:"modal-title",children:"Selecionar Pausa"}),$.jsx("button",{className:"modal-close",id:"closePauseModal",onClick:()=>v(!1),children:$.jsx("i",{className:"fas fa-xmark"})})]}),$.jsxs("div",{className:"pause-options",id:"pauseOptions",children:[Ae.map(e=>$.jsxs("div",{className:"pause-option",onClick:()=>gt(e.id),children:[$.jsx("div",{className:"pause-option-icon",children:$.jsx("i",{className:`fas ${e.icon||"fa-circle-pause"}`})}),$.jsxs("div",{className:"pause-option-info",children:[$.jsx("div",{className:"pause-option-name",children:e.name}),$.jsxs("div",{className:"pause-option-id",children:["ID: ",e.id]})]})]},e.id)),!Ae.length&&$.jsx("div",{className:"history-empty",children:"Nenhuma pausa configurada."})]}),$.jsx("button",{className:"modal-cancel-btn",id:"cancelPauseBtn",onClick:()=>v(!1),children:"Cancelar"})]})}),$.jsx("div",{className:"modal-overlay qualification-modal "+(y?"active":""),id:"qualificationModal",children:$.jsxs("div",{className:"qualification-sheet",children:[$.jsx("div",{className:"sheet-handle"}),$.jsxs("div",{className:"sheet-header",children:[$.jsx("span",{className:"sheet-title",children:"Qualificar Chamada"}),$.jsx("span",{className:"sheet-subtitle",children:"Registre o resultado do atendimento"})]}),$.jsxs("div",{className:"result-segmented",children:[$.jsx("button",{className:"segment "+("success"===x?"active":""),id:"resultSuccess","data-type":"success",onClick:()=>{w("success"),C(null)},children:"Sucesso"}),$.jsx("button",{className:"segment "+("failure"===x?"active":""),id:"resultFailure","data-type":"failure",onClick:()=>{w("failure"),C(null)},children:"Falha"}),$.jsx("div",{className:"segment-indicator"})]}),$.jsx("div",{className:"qualifications-container",children:$.jsxs("div",{className:"qualification-list",id:"qualificationList",children:[("success"===x?_e:Ce).map(e=>$.jsx("button",{className:"qualification-item "+(_===e.id?"selected":""),onClick:()=>C(e.id),children:$.jsx("span",{children:e.name})},e.id)),!("success"===x?_e:Ce).length&&$.jsx("div",{className:"history-empty",children:"Nenhuma qualificação configurada."})]})}),S&&$.jsx("div",{className:"input-error",children:S}),$.jsx("div",{className:"sheet-footer",children:$.jsx("button",{className:"confirm-btn",id:"confirmQualificationBtn",onClick:vt,disabled:!_,children:"Confirmar"})})]})}),r&&$.jsx(py,{isOpen:I,campaignCallInfo:tt,campaignContactPhoneId:(null==(u=null==me?void 0:me.data)?void 0:u.campaignContactPhoneId)??null,callDuration:N,isCallActive:Qe||Ze,onClose:()=>k(!1)})]})}const wy=16;function _y(e,t,n){return Math.min(Math.max(e,t),n)}function Cy({isOpen:e,result:r,onChangeResult:i,successQualifications:o,discardQualifications:a,selectedQualificationId:s,onSelectQualification:d,onSubmit:l,isSubmitting:u,errorMessage:c,portalTarget:f=null}){const h=t.useRef(null),p=t.useRef({pointerId:null,offsetX:0,offsetY:0}),m=t.useRef(!1),[g,v]=t.useState({x:100,y:100}),[y,b]=t.useState(!1),x="success"===r?o:a,w=x.length>0,_=t.useCallback(e=>{if("undefined"==typeof window)return e;const t=window.innerWidth,n=window.innerHeight,r=h.current,i=(null==r?void 0:r.offsetWidth)??400,o=(null==r?void 0:r.offsetHeight)??500,a=Math.max(16,t-i-wy),s=Math.max(16,n-o-wy);return{x:_y(e.x,16,a),y:_y(e.y,16,s)}},[]);t.useEffect(()=>{if(e&&"undefined"!=typeof window){const e=h.current,t=(null==e?void 0:e.offsetWidth)??400,n=(null==e?void 0:e.offsetHeight)??500,r=(window.innerWidth-t)/2,i=(window.innerHeight-n)/2;v(_({x:r,y:i}))}},[e,_]),t.useEffect(()=>{if(!e||"undefined"==typeof window)return;const t=()=>{v(e=>_(e))};return window.addEventListener("resize",t),window.addEventListener("orientationchange",t),()=>{window.removeEventListener("resize",t),window.removeEventListener("orientationchange",t)}},[e,_]),t.useEffect(()=>{if(!y)return;const e=e=>{var t,n;if(p.current.pointerId!==e.pointerId)return;m.current=!0;const r=(null==(t=h.current)?void 0:t.offsetWidth)??0,i=(null==(n=h.current)?void 0:n.offsetHeight)??0,o=e.clientX-p.current.offsetX,a=e.clientY-p.current.offsetY,s="undefined"!=typeof window?window.innerWidth:0,d="undefined"!=typeof window?window.innerHeight:0,l=s-r-wy,u=d-i-wy,c=Math.max(wy,l),f=Math.max(wy,u);v({x:_y(o,wy,c),y:_y(a,wy,f)})},t=e=>{p.current.pointerId===e.pointerId&&(b(!1),p.current={pointerId:null,offsetX:0,offsetY:0})};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t)}},[y]);const C=t.useCallback(e=>{if(0!==e.button&&"touch"!==e.pointerType)return;const t=h.current;if(!t)return;const n=t.getBoundingClientRect();p.current={pointerId:e.pointerId,offsetX:e.clientX-n.left,offsetY:e.clientY-n.top},m.current=!1,b(!0)},[]);if(!e)return null;const S=$.jsxs("div",{ref:h,className:Xh`fixed z-[9999] flex flex-col overflow-hidden rounded-xl border border-slate-300 bg-white shadow-2xl`,style:{left:`${g.x}px`,top:`${g.y}px`,width:"420px",maxWidth:"calc(100vw - 32px)",maxHeight:"calc(100vh - 32px)"},children:[$.jsx("div",{onPointerDown:C,className:Xh`flex cursor-move items-center justify-center border-b border-slate-200 bg-gradient-to-r from-indigo-500 to-indigo-600 px-4 py-3 text-white`,children:$.jsx("h3",{className:Xh`text-sm font-bold`,children:"Qualificar Chamada"})}),$.jsxs("div",{className:Xh`flex-1 space-y-4 overflow-y-auto p-5`,children:[$.jsx("div",{className:Xh`text-center`,children:$.jsx("p",{className:Xh`text-sm text-slate-600`,children:"Esta etapa é obrigatória para registrar o desfecho do atendimento."})}),$.jsxs("div",{className:Xh`space-y-2`,children:[$.jsx("p",{className:Xh`text-sm font-semibold text-slate-700`,children:"Resultado da chamada"}),$.jsxs("div",{className:Xh`grid grid-cols-2 gap-3`,children:[$.jsxs("button",{type:"button",onClick:()=>i("success"),className:Xh`${"success"===r?"border-emerald-500 bg-emerald-50 ring-2 ring-emerald-500":"border-slate-200 bg-white hover:border-emerald-300"} flex flex-col items-center justify-center gap-2 rounded-lg border px-4 py-3 transition`,children:[$.jsx(Nc,{className:Xh`h-6 w-6 ${"success"===r?"text-emerald-600":"text-slate-400"}`}),$.jsx("span",{className:Xh`text-sm font-semibold ${"success"===r?"text-emerald-700":"text-slate-600"}`,children:"Sucesso"})]}),$.jsxs("button",{type:"button",onClick:()=>i("failure"),className:Xh`${"failure"===r?"border-rose-500 bg-rose-50 ring-2 ring-rose-500":"border-slate-200 bg-white hover:border-rose-300"} flex flex-col items-center justify-center gap-2 rounded-lg border px-4 py-3 transition`,children:[$.jsx(Kc,{className:Xh`h-6 w-6 ${"failure"===r?"text-rose-600":"text-slate-400"}`}),$.jsx("span",{className:Xh`text-sm font-semibold ${"failure"===r?"text-rose-700":"text-slate-600"}`,children:"Falha"})]})]})]}),$.jsxs("div",{className:Xh`space-y-2`,children:[$.jsx("p",{className:Xh`text-sm font-semibold text-slate-700`,children:"Selecione uma qualificação"}),w?$.jsx("div",{className:Xh`max-h-64 space-y-2 overflow-y-auto rounded-lg border border-slate-200 bg-slate-50 p-2`,children:x.map(e=>{const t=s===e.id;return $.jsx("button",{type:"button",onClick:()=>d(e.id),className:Xh`${t?"border-blue-400 bg-blue-100 ring-2 ring-blue-400":"border-slate-200 bg-white hover:border-blue-300"} w-full rounded-lg border px-4 py-3 text-left transition`,children:$.jsx("p",{className:Xh`text-sm font-semibold ${t?"text-blue-800":"text-slate-800"}`,children:e.name})},e.id)})}):$.jsxs("div",{className:Xh`flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700`,children:[$.jsx(_c,{className:Xh`h-5 w-5 flex-shrink-0`}),$.jsx("span",{children:"Nenhuma qualificação disponível para este tipo de resultado."})]})]}),c&&$.jsxs("div",{className:Xh`flex items-center gap-2 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700`,children:[$.jsx(_c,{className:Xh`h-5 w-5 flex-shrink-0`}),$.jsx("span",{children:c})]})]}),$.jsx("div",{className:Xh`border-t border-slate-200 bg-slate-50 px-5 py-4`,children:$.jsxs("button",{type:"button",onClick:l,disabled:!w||!s||u,className:Xh`flex w-full items-center justify-center gap-2 rounded-lg bg-indigo-600 px-4 py-3 text-sm font-bold text-white shadow-md transition hover:bg-indigo-700 disabled:cursor-not-allowed disabled:opacity-50`,children:[u&&$.jsxs("svg",{className:Xh`h-4 w-4 animate-spin text-white`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[$.jsx("circle",{className:Xh`opacity-25`,cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),$.jsx("path",{className:Xh`opacity-75`,fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),u?"Enviando...":"Confirmar Qualificação"]})})]});return"undefined"!=typeof document?n.createPortal(S,f??document.body):null}function Sy({variant:e="default",portalTarget:t,isAuthenticated:n,mode:r,...i}){const o="min"===e;return"mobile"===e?$.jsx($y,{isAuthenticated:n,showClientInfoModal:"inline"===r,...i}):n&&o?$.jsx(Ey,{portalTarget:t,...i}):$.jsx(q$,{variant:e,portalTarget:t,isAuthenticated:n,...i})}function Ey({username:e,onLogin:n,onLogout:r,isLoadingSession:i,sessionError:o,portalTarget:a}){var s;const{skipManualQualification:d}=Xy(),l=ec(),u=rc(),c=nc(),f=ic(),h=oc(),p=t.useMemo(()=>f??[],[f]),m=t.useMemo(()=>h??[],[h]),{finishAfterCall:g}=tc(),[v,y]=t.useState(!1),[b,x]=t.useState(!1),[w,_]=t.useState(0),[C,S]=t.useState("success"),[E,N]=t.useState(null),[T,A]=t.useState(!1),[O,I]=t.useState(null),k=null==l?void 0:l.state,j="callInProgress"===k,R="manualCallSetup"===k||("manualCallRinging"===k||"callRinging"===k),P="afterCall"===k;t.useEffect(()=>{if(!j)return void _(0);const e=setInterval(()=>{_(e=>e+1)},1e3);return()=>clearInterval(e)},[j]),t.useEffect(()=>{(j||R)&&"campaign"===(null==u?void 0:u.type)&&y(!0)},[j,R,u]),t.useEffect(()=>{if(P){if("campaign"===(null==u?void 0:u.type)&&!0===u.info.campaign.skipCallQualification&&g)return void Promise.resolve(g({result:"success",qualificationId:void 0}));if("manual"===(null==u?void 0:u.type)&&g)return console.log("[InlineDialer] 🚀 Chamada MANUAL detectada - finalizando automaticamente (chamadas manuais NUNCA exibem qualificação)"),void Promise.resolve(g({result:"success",qualificationId:void 0}));if(0===p.length&&0===m.length&&g)return console.log("[InlineDialer] 🚀 Sem qualificações configuradas - finalizando automaticamente"),void Promise.resolve(g({result:"success",qualificationId:void 0}));const e=p.length>0;S(e?"success":"failure"),N(null),I(null),x(!0)}else x(!1)},[P,u,g,p,m,d]),t.useEffect(()=>{j||R||P||y(!1)},[j,R,P]);const D=t.useMemo(()=>u&&"campaign"===u.type?u.info:null,[u]);return $.jsxs($.Fragment,{children:[$.jsx("style",{dangerouslySetInnerHTML:{__html:'\n /* Container externo do HTML - SEM padding/border para não vazar */\n #dialer-inline.callix.mode.min {\n display: block !important;\n width: 100% !important;\n max-width: 100% !important;\n padding: 0 !important;\n border: none !important;\n background: transparent !important;\n box-shadow: none !important;\n }\n\n /* Estilos para modo mini quando Tailwind CDN não processa classes */\n .callix.mode.min {\n display: flex !important;\n flex-direction: column !important;\n gap: 0.75rem !important;\n border-radius: 1rem !important;\n border: 1px solid #e2e8f0 !important;\n background: rgba(255, 255, 255, 0.95) !important;\n padding: 0.75rem !important;\n box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;\n color: #1e293b !important;\n width: 100% !important;\n max-width: 100% !important;\n box-sizing: border-box !important;\n }\n\n /* Visor de número - fonte menor para caber todos os dígitos */\n .callix.mode.min [class*="truncate"] {\n font-size: 0.875rem !important; /* text-sm */\n line-height: 1.25rem !important;\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n }\n\n /* Botões do modo mini */\n .callix.mode.min button {\n cursor: pointer !important;\n transition: all 0.2s ease !important;\n }\n \n .callix.mode.min button:disabled {\n cursor: not-allowed !important;\n opacity: 0.6 !important;\n }\n\n /* Grid do teclado numérico */\n .callix.mode.min [class*="grid-cols-3"] {\n display: grid !important;\n grid-template-columns: repeat(3, minmax(0, 1fr)) !important;\n gap: 0.5rem !important;\n }\n\n /* Botões do teclado */\n .callix.mode.min [class*="grid-cols-3"] button {\n display: flex !important;\n height: 3rem !important;\n flex-direction: column !important;\n align-items: center !important;\n justify-content: center !important;\n border-radius: 0.5rem !important;\n border: 1px solid #e2e8f0 !important;\n background: white !important;\n font-size: 1rem !important;\n font-weight: 600 !important;\n color: #1e293b !important;\n box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;\n }\n\n .callix.mode.min [class*="grid-cols-3"] button:hover:not(:disabled) {\n border-color: #cbd5e1 !important;\n box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1) !important;\n }\n\n .callix.mode.min [class*="grid-cols-3"] button:active:not(:disabled) {\n transform: scale(0.95) !important;\n }\n\n /* Botão principal de Ligar/Encerrar */\n .callix.mode.min > button[class*="bg-emerald"],\n .callix.mode.min > button[class*="bg-rose"] {\n display: flex !important;\n height: 2.75rem !important;\n width: 100% !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 0.5rem !important;\n border-radius: 0.75rem !important;\n font-size: 0.875rem !important;\n font-weight: 700 !important;\n color: white !important;\n box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1) !important;\n border: none !important;\n }\n\n .callix.mode.min > button[class*="bg-emerald"] {\n background: #10b981 !important;\n }\n\n .callix.mode.min > button[class*="bg-emerald"]:hover:not(:disabled) {\n background: #059669 !important;\n }\n\n .callix.mode.min > button[class*="bg-rose"] {\n background: #f43f5e !important;\n }\n\n .callix.mode.min > button[class*="bg-rose"]:hover:not(:disabled) {\n background: #e11d48 !important;\n }\n '}}),$.jsx(q$,{isAuthenticated:!0,username:e,onLogin:n,onLogout:r,isLoadingSession:i,sessionError:o,variant:"min"}),$.jsx(py,{isOpen:v,campaignCallInfo:D,campaignContactPhoneId:(null==(s=null==c?void 0:c.data)?void 0:s.campaignContactPhoneId)??null,callDuration:w,isCallActive:j||R,onClose:()=>y(!1),portalTarget:a}),$.jsx(Cy,{isOpen:b,result:C,onChangeResult:S,successQualifications:p,discardQualifications:m,selectedQualificationId:E,onSelectQualification:N,onSubmit:async()=>{if(("success"===C?p:m).length)if(E)if("function"==typeof g){A(!0),I(null);try{await Promise.resolve(g({result:C,qualificationId:E})),x(!1)}catch(e){I("Erro ao enviar qualificacao."),console.error("Erro ao finalizar afterCall:",e)}finally{A(!1)}}else I("Não foi possível enviar a qualificação.");else I("Selecione uma qualificação para finalizar.");else I("Nenhuma qualificação configurada para este resultado.")},isSubmitting:T,errorMessage:O})]})}async function Ny(e,t,n=2e4){const r=new AbortController,i=setTimeout(()=>r.abort(),n);try{const n=await fetch(e,{method:"DELETE",headers:{Authorization:`Bearer ${t}`,"x-session-token":t},credentials:"same-origin",signal:r.signal}),i=await n.json().catch(()=>null);if(!n.ok||!1===(null==i?void 0:i.success))throw new Error((null==i?void 0:i.error)||`O Callix não confirmou o encerramento da sessão (${n.status}).`)}catch(o){if(r.signal.aborted)throw new Error("O Callix não respondeu ao pedido de encerramento da sessão.");throw o}finally{clearTimeout(i)}}function Ty(e){return`callix_dialer_${e}_leader`}const Ay="callix_dialer_tab_role";function Oy(){const e=void 0!==globalThis.crypto?globalThis.crypto:void 0;return e&&"randomUUID"in e?e.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10)}function Iy(e){if("undefined"==typeof BroadcastChannel)return null;try{return new BroadcastChannel(e)}catch{return null}}function ky(){try{return"undefined"!=typeof localStorage?localStorage:null}catch{return null}}class jy{constructor(e){this.listeners=new Set,this.storageListener=null,this.closed=!1,this.username=e.username,this.tabId=e.tabId??Oy(),this.status=e.status,this.storage=void 0===e.storage?ky():e.storage;const t=e.channelFactory??Iy;if(this.channel=t(`callix-dialer:${this.username.trim().toLowerCase()}`),this.channel)this.channel.onmessage=e=>this.receive(e.data);else if("undefined"!=typeof window&&this.storage){const e=this.fallbackKey();this.storageListener=t=>{if(t.key===e&&t.newValue)try{const e=JSON.parse(t.newValue);this.receive(e.message)}catch{}},window.addEventListener("storage",this.storageListener)}}fallbackKey(){return`callix_dialer_${this.username}_bus`}on(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(this.closed)return;const t={...e,from:this.tabId};if(this.channel)try{this.channel.postMessage(t)}catch{}else if(this.storage)try{this.storage.setItem(this.fallbackKey(),JSON.stringify({nonce:Math.random(),at:Date.now(),message:t}))}catch{}}receive(e){if(this.closed||!e||"object"!=typeof e)return;const t=e;if("string"==typeof t.type&&"string"==typeof t.from&&t.from!==this.tabId){if("ping"===t.type){const e=this.status();this.post({type:"pong",role:e.role,authenticated:e.authenticated})}for(const e of this.listeners)e(t)}}probe(e=600){return new Promise(t=>{const n=new Map,r=this.on(e=>{"pong"===e.type&&n.set(e.from,{tabId:e.from,role:e.role,authenticated:e.authenticated})});this.post({type:"ping"}),setTimeout(()=>{r(),t([...n.values()])},e)})}close(){if(this.closed=!0,this.listeners.clear(),this.channel){this.channel.onmessage=null;try{this.channel.close()}catch{}}this.storageListener&&"undefined"!=typeof window&&(window.removeEventListener("storage",this.storageListener),this.storageListener=null)}}function Ry(e){return e.find(e=>"leader"===e.role&&e.authenticated)??null}function Py(e,t=ky(),n=Date.now()){if(!t)return null;try{const r=t.getItem(Ty(e));if(!r)return null;const i=JSON.parse(r);return"string"!=typeof i.tabId||"number"!=typeof i.at||n-i.at>9e3?null:{tabId:i.tabId,at:i.at}}catch{return null}}function Dy(e,t,n=ky(),r=Date.now()){if(!n)return!0;const i=Py(e,n,r);if(i&&i.tabId!==t)return!1;try{n.setItem(Ty(e),JSON.stringify({tabId:t,at:r}))}catch{}return!0}function Ly(e,t,n=ky()){if(n)try{const r=n.getItem(Ty(e));if(!r)return;JSON.parse(r).tabId===t&&n.removeItem(Ty(e))}catch{}}function My(){try{return"undefined"!=typeof sessionStorage?sessionStorage:null}catch{return null}}function Uy(e,t,n=My()){if(n)try{n.setItem(Ay,JSON.stringify({username:e,role:t,at:Date.now()}))}catch{}}function Fy(e=My()){if(e)try{e.removeItem(Ay)}catch{}}const By=new Set(["STORE_NOT_CONFIGURED","SERVER_NOT_CONFIGURED"]),qy=new Set(["manualCallSetup","manualCallRinging","callInProgress","afterCall"]);function zy(e){return e?{"Content-Type":"application/json","x-session-token":e,Authorization:`Bearer ${e}`}:Jp()}const Hy=e=>new Promise(t=>setTimeout(t,e));function Wy({enabled:e=!0,pollIntervalMs:n,sessionToken:r,onTask:i}){const o=ec(),{makeManualCall:a,becomeAvailable:s}=tc(),d=t.useRef(null==o?void 0:o.state);d.current=null==o?void 0:o.state;const l=t.useRef(a);l.current=a;const u=t.useRef(s);u.current=s;const c=t.useRef(i);c.current=i;const f=t.useRef(null),h=t.useRef(null);return t.useEffect(()=>{var e;null==(e=h.current)||e.call(h)},[null==o?void 0:o.state]),t.useEffect(()=>{if(!e)return;let t=!1,i=!1,o=0,a=0,s="normal",p=!1,m=45e3,g=Math.max(1e3,n??4e3);const $={apiBaseUrl:Xp,headers:zy(r)},v=()=>{if("notConfigured"===s)return 3e5;const e=Math.max(1e3,Math.floor(m/2)),t=Math.min(g,e);if("backoff"===s)return Math.min(t*2**a,6e4);const n=Math.min(3*t,e);return A$(T$(d.current))?t:n},y=()=>{var e;return null==(e=f.current)?void 0:e.setInterval(v())};h.current=y;const b=async e=>{for(let r=0;r<3;r++){try{const t=await I$({...$,...e});if(t.ok)return!0;if(!(t.status>=500||408===t.status||429===t.status))return console.warn("[ClickToCall] confirmação recusada pelo servidor:",t.status,t.code??"","(tarefa",e.taskId,")"),!1}catch(n){console.warn("[ClickToCall] confirmação falhou (tentativa",r+1,"):",n instanceof Error?n.message:n)}if(t||2===r)break;await Hy(1500*(r+1))}return console.error("[ClickToCall] não foi possível confirmar a tarefa",e.taskId,"; o servidor a marcará como não confirmada"),!1},x=async e=>{var n;const r=d.current;if(o=Date.now()+6e3,!A$(T$(r)))return console.warn("[ClickToCall] tarefa",e.id,"recebida com operador ocupado (",r,"): devolvendo à fila"),void(await b({taskId:e.id,status:"failed",error:`Operador indisponível (${r??"desconhecido"})`,retry:!0}));console.log("[ClickToCall] 🖱️ ligação pedida pela API:",e.phoneDisplay,"(tarefa",e.id,")");try{window.dispatchEvent(new CustomEvent(N$,{detail:e}))}catch(f){console.warn("[ClickToCall] falha ao notificar o discador:",f)}try{null==(n=c.current)||n.call(c,e)}catch(f){console.warn("[ClickToCall] onTask lançou erro:",f)}if("on_break"===T$(d.current)){console.log("[ClickToCall] operador em pausa: saindo da pausa para ligar");try{u.current()}catch(f){const t=f instanceof Error?f.message:String(f);return console.error("[ClickToCall] becomeAvailable falhou:",t),void(await b({taskId:e.id,status:"failed",error:`Não deu para sair da pausa: ${t}`,retry:!0}))}if(!(await(i=e=>"idle"===e,a=8e3,new Promise(e=>{const n=Date.now()+a,r=()=>t?e(!1):i(d.current)?e(!0):Date.now()>=n?e(!1):void setTimeout(r,100);r()}))))return console.warn("[ClickToCall] o operador não saiu da pausa a tempo (estado",d.current,"): devolvendo à fila"),void(await b({taskId:e.id,status:"failed",error:`Operador não saiu da pausa (${d.current??"desconhecido"})`,retry:!0}))}var i,a;try{l.current(e.phone)}catch(f){const t=f instanceof Error?f.message:String(f);return console.error("[ClickToCall] makeManualCall falhou:",t),void(await b({taskId:e.id,status:"failed",error:t,retry:!1}))}const s=await new Promise(e=>{const n=Date.now()+4e3,r=()=>{if(t)return e("disposed");const i=d.current;return i&&qy.has(i)?e("started"):"manualCallFailed"===i?e("manual_failed"):"callRinging"===i||"offline"===T$(i)?e("interrupted"):Date.now()>=n?e("not_started"):void setTimeout(r,100)};r()});switch(s){case"started":return void(await b({taskId:e.id,status:"calling"}));case"manual_failed":return console.error("[ClickToCall] o SDK não conseguiu completar a chamada manual"),void(await b({taskId:e.id,status:"failed",error:"Chamada manual falhou no SDK",retry:!1}));case"interrupted":return console.warn("[ClickToCall] chamada manual não aconteceu (estado",d.current,"): devolvendo à fila"),void(await b({taskId:e.id,status:"failed",error:`Discador interrompido (${d.current??"desconhecido"})`,retry:!0}));case"disposed":return void(await b({taskId:e.id,status:"failed",error:"Discador encerrado durante a discagem",retry:!0}));default:{const t=`SDK não iniciou a chamada (estado continua ${d.current??"desconhecido"})`;console.error("[ClickToCall]",t),await b({taskId:e.id,status:"failed",error:t,retry:!1})}}},w=async()=>{if(!t&&!i){i=!0;try{const r=d.current,i=A$(T$(r))&&Date.now()>=o;let l;try{l=await async function(e){const{signal:t,clear:n}=O$(e.signal);try{const n=await fetch(`${e.apiBaseUrl}/api/click-to-call/poll`,{method:"POST",headers:e.headers,body:JSON.stringify({state:e.state??null,claim:e.claim}),credentials:"omit",signal:t});if(!n.ok){let e=null;try{const t=await n.json();e="string"==typeof(null==t?void 0:t.error)?t.error:null}catch{}return{ok:!1,status:n.status,code:e}}const r=await n.json();return{ok:!0,presence:r.presence??"unknown",task:r.task&&"object"==typeof r.task&&"string"==typeof r.task.phone?r.task:null,pollIntervalMs:"number"==typeof r.pollIntervalMs?r.pollIntervalMs:0,presenceTtlSeconds:"number"==typeof r.presenceTtlSeconds&&r.presenceTtlSeconds>0?r.presenceTtlSeconds:45}}finally{n()}}({...$,state:r,claim:i})}catch(e){l={ok:!1,status:0,code:e instanceof Error&&"AbortError"===e.name?"TIMEOUT":"NETWORK"}}if(t)return void(l.ok&&l.task&&await b({taskId:l.task.id,status:"failed",error:"Discador encerrado antes de discar",retry:!0}));if(!l.ok){a+=1;const e=null!==l.code&&By.has(l.code);return s=e?"notConfigured":"backoff",e?p||(p=!0,console.warn("[ClickToCall] backend sem click-to-call configurado (",l.code,"); nova tentativa em 5 min")):1===a&&console.warn("[ClickToCall] polling falhou (HTTP",l.status,l.code??"","); aplicando backoff"),void y()}if("normal"!==s&&(s="normal",a=0),m=1e3*l.presenceTtlSeconds,void 0===n&&l.pollIntervalMs>0&&(g=Math.max(1e3,l.pollIntervalMs)),y(),l.task)try{await x(l.task)}catch(e){console.error("[ClickToCall] erro ao tratar a tarefa",l.task.id,":",e instanceof Error?e.message:e)}}finally{i=!1}}},_=function(e,t){let n=Math.max(250,Math.round(t)),r=null,i=null,o=null,a=!1;const s=()=>{a||(r&&clearInterval(r),r=setInterval(e,n))};try{"undefined"!=typeof Worker&&"undefined"!=typeof Blob&&"undefined"!=typeof URL&&URL.createObjectURL?(o=URL.createObjectURL(new Blob(["\nlet timer = null;\nself.onmessage = (event) => {\n const interval = Number(event && event.data && event.data.interval) || 0;\n if (timer) { clearInterval(timer); timer = null; }\n if (interval > 0) { timer = setInterval(() => self.postMessage('tick'), interval); }\n};\n"],{type:"application/javascript"})),i=new Worker(o),i.onmessage=()=>{a||e()},i.onerror=()=>{null==i||i.terminate(),i=null,s()},i.postMessage({interval:n})):s()}catch{i=null,s()}return{setInterval(e){if(a)return;const t=Math.max(250,Math.round(e));t!==n&&(n=t,i?i.postMessage({interval:n}):s())},stop(){a=!0,i&&(i.terminate(),i=null),o&&(URL.revokeObjectURL(o),o=null),r&&(clearInterval(r),r=null)}}}(()=>{w()},v());return f.current=_,w(),()=>{t=!0,_.stop(),f.current===_&&(f.current=null),h.current===y&&(h.current=null),function(e){try{fetch(`${e.apiBaseUrl}/api/click-to-call/poll`,{method:"POST",headers:e.headers,body:JSON.stringify({state:"offline",claim:!1}),credentials:"omit",keepalive:!0}).catch(()=>{})}catch{}}($)}},[e,n,r]),null}const Gy="2.8.4";let Vy=null;function Ky(){return new Promise(e=>{if(!Vy)return console.log("[Callix Dialer] 📭 Nenhum WebSocket SIP ativo para fechar"),void e();if(Vy.readyState===WebSocket.CLOSED||Vy.readyState===WebSocket.CLOSING)return console.log("[Callix Dialer] 📭 WebSocket SIP já está fechando/fechado"),Vy=null,void e();console.log("[Callix Dialer] 🔌 Fechando WebSocket SIP existente...");const t=Vy;!function(e){if(e.readyState===WebSocket.OPEN)try{console.log("[Callix Dialer] 📤 Tentando enviar sinalização de fechamento...");const t=e;t._ua&&"function"==typeof t._ua.stop?(console.log("[Callix Dialer] 🔌 Encontrado UA, chamando stop()..."),t._ua.stop()):t._connection&&"function"==typeof t._connection.close&&(console.log("[Callix Dialer] 🔌 Fechando conexão interna..."),t._connection.close())}catch(t){console.warn("[Callix Dialer] ⚠️ Não foi possível enviar UNREGISTER:",t)}}(t);const n=setTimeout(()=>{console.log("[Callix Dialer] ⏱️ Timeout ao fechar WebSocket, continuando...");try{t.close(1e3,"Force close after timeout")}catch{}e()},3e3);t.addEventListener("close",()=>{clearTimeout(n),console.log("[Callix Dialer] ✅ WebSocket SIP fechado com sucesso"),e()},{once:!0}),setTimeout(()=>{t.close(1e3,"Page reload - cleaning up SIP connection")},500)})}!function(){if("undefined"==typeof window)return;if(window.__callixWsInterceptorSetup)return;window.__callixWsInterceptorSetup=!0;const e=window.WebSocket;window.WebSocket=function(t,n){const r=new e(t,n);return"string"==typeof t&&t.includes("callix")&&t.includes("/ws")&&(console.log("[Callix Dialer] 🔌 WebSocket SIP detectado:",t),Vy=r,r.addEventListener("message",e=>{if("string"==typeof e.data&&e.data.includes("Call-ID:")){const t=e.data.match(/Call-ID:\s*([^\r\n]+)/i);t&&t[1].trim()}}),r.addEventListener("close",()=>{console.log("[Callix Dialer] 🔌 WebSocket SIP fechado"),Vy===r&&(Vy=null)})),r},Object.assign(window.WebSocket,{CONNECTING:e.CONNECTING,OPEN:e.OPEN,CLOSING:e.CLOSING,CLOSED:e.CLOSED}),console.log("[Callix Dialer] ✅ WebSocket interceptor configurado")}(),"undefined"!=typeof window&&(window.__callixUnloadSetup||(window.__callixUnloadSetup=!0,window.addEventListener("beforeunload",()=>{console.log("[Callix Dialer] 🚪 Página fechando, limpando WebSocket SIP..."),Vy&&Vy.readyState===WebSocket.OPEN&&Vy.close(1e3,"Page unload")}),window.addEventListener("pagehide",()=>{Vy&&Vy.readyState===WebSocket.OPEN&&Vy.close(1e3,"Page hide")}),console.log("[Callix Dialer] ✅ Page unload cleanup configurado"))),function(){if("undefined"==typeof document)return;if(document.querySelector('meta[name="format-detection"]'))return;const e=document.createElement("meta");e.name="format-detection",e.content="telephone=no, date=no, email=no, address=no",document.head.appendChild(e),console.log("[Callix Dialer] ✅ iOS format-detection meta tag adicionada")}();const Yy=t.createContext(null);function Xy(){const e=t.useContext(Yy);return e||{skipManualQualification:!1}}const Jy=t.forwardRef(function({children:e,onSessionDropped:n},r){const i=Qu(),o=tc(),a=ec(),s=t.useRef(n);s.current=n,uc("userSessionDropped",e=>{var t;const n=(null==e?void 0:e.originator)??null;null==(t=s.current)||t.call(s,n,Wp(n))});const d="startupError"===(null==a?void 0:a.state)?a.error??null:null;t.useEffect(()=>{var e;"userIsAlreadyConnectedOnAnotherDevice"===d&&(null==(e=s.current)||e.call(s,"anotherDevice",zp(d)))},[d]),t.useImperativeHandle(r,()=>({goOffline:()=>{console.log("[Callix Dialer] 📴 Chamando goOffline() para enviar SIP UNREGISTER...");try{o.goOffline(),console.log("[Callix Dialer] ✅ goOffline() chamado com sucesso")}catch(e){console.error("[Callix Dialer] ❌ Erro ao chamar goOffline():",e)}},stop:()=>{console.log("[Callix Dialer] 🛑 Chamando stop() no CallOperator...");try{i.stop(),console.log("[Callix Dialer] ✅ stop() chamado com sucesso")}catch(e){console.error("[Callix Dialer] ❌ Erro ao chamar stop():",e)}}}),[i,o]);const l=t.useRef(o);return l.current=o,t.useEffect(()=>()=>{console.log("[Callix Dialer] 🔌 SdkCleanupManager desmontando, chamando goOffline()...");try{l.current.goOffline()}catch(e){console.warn("[Callix Dialer] ⚠️ Erro no cleanup automático:",e)}},[]),$.jsx($.Fragment,{children:e})});class Zy{constructor(e){this.root=null,this.container=null,this.options=e}init(){try{if("string"==typeof this.options.container?this.container=document.querySelector(this.options.container):this.container=this.options.container,!this.container)throw new Error(`Container não encontrado: ${this.options.container}`);const e=function(e){const t={},n=e.getAttribute("data-callix-engine-url")??e.dataset.callixEngineUrl;n&&n.trim()&&(t.engineUrl=n.trim());const r=e.getAttribute("data-callix-engine-token")??e.dataset.callixEngineToken;r&&r.trim()&&(t.engineToken=r.trim());const i=e.getAttribute("data-callix-mode")||e.dataset.callixMode||e.dataset.mode,o=e.getAttribute("data-callix-username")||e.dataset.callixUsername||e.dataset.username,a=Array.from(e.classList),s=a.map(e=>e.toLowerCase()),d=s.includes("callix"),l=i?i.toLowerCase():void 0;if("min"===l||"mini"===l?t.uiVariant="min":"mobile"===l?t.uiVariant="mobile":"default"===l||"floating"===l||"full"===l||"inline"===l?t.uiVariant="default":d&&(s.includes("mode-min")||s.includes("mode-mini")||s.includes("mode")&&s.includes("min"))&&(t.uiVariant="min"),!t.presetUsername&&o&&(t.presetUsername=o.trim()),!t.presetUsername)for(const h of a){const e=h.match(/(?:user|username|callix-user)[-_:]([A-Za-z0-9.@_-]+)/i);if(e){t.presetUsername=e[1];break}}t.presetUsername&&(t.presetUsername=t.presetUsername.trim());const u=e.getAttribute("data-callix-auto-login")??e.dataset.callixAutoLogin??e.dataset.autoLogin;null!=u&&(t.autoLogin=["true","1","yes",""].includes(u.trim().toLowerCase()));const c=function(e){const t=(e??"").trim().toLowerCase();return"compact"===t||"compacta"===t||"compacto"===t?"compact":"comfortable"===t||"confortavel"===t||"confortável"===t||"touch"===t?"comfortable":"auto"===t?"auto":void 0}(e.getAttribute("data-callix-density")??e.dataset.callixDensity);c&&(t.density=c);const f=e.getAttribute("data-callix-click-to-call")??e.dataset.callixClickToCall;return null!=f&&(t.clickToCall=!["false","0","no","off"].includes(f.trim().toLowerCase())),t}(this.container);!this.options.uiVariant&&e.uiVariant&&(this.options.uiVariant=e.uiVariant),!this.options.presetUsername&&e.presetUsername&&(this.options.presetUsername=e.presetUsername),void 0===this.options.autoLogin&&void 0!==e.autoLogin&&(this.options.autoLogin=e.autoLogin),void 0===this.options.density&&void 0!==e.density&&(this.options.density=e.density),void 0===this.options.clickToCall&&void 0!==e.clickToCall&&(this.options.clickToCall=e.clickToCall),!this.options.engineUrl&&e.engineUrl&&(this.options.engineUrl=e.engineUrl),!this.options.engineToken&&e.engineToken&&(this.options.engineToken=e.engineToken),this.root=x.createRoot(this.container),this.root.render($.jsx(t.StrictMode,{children:$.jsx(nb,{options:this.options,containerEl:this.container})})),this.options.onReady&&this.options.onReady()}catch(e){this.options.onError?this.options.onError(e):console.error("[Callix Dialer] Erro ao inicializar:",e)}}destroy(){this.root&&(this.root.unmount(),this.root=null)}}const Qy=e=>({SESSION_TOKEN:`callix_dialer_${e}_session_token`,DOMAIN:`callix_dialer_${e}_domain`,TIMESTAMP:`callix_dialer_${e}_timestamp`,SKIP_MANUAL_QUALIFICATION:`callix_dialer_${e}_skip_manual_qualification`}),eb="callix_dialer_last_username";function tb(e){try{return localStorage.getItem(Qy(e).SESSION_TOKEN)}catch{return null}}function nb({options:e,containerEl:n}){const[r,i]=t.useState(null),[o,a]=t.useState(!1),[s,d]=t.useState(!1),[l,u]=t.useState(null),[c,f]=t.useState(null),[h,p]=t.useState(null),[m,g]=t.useState(!0),[v,y]=t.useState(!1),[b,x]=t.useState(null),w=t.useRef(null),[_,C]=t.useState(()=>Date.now()),[S,E]=t.useState(!1),N=e.presetUsername?e.presetUsername.trim():null,T=e.uiVariant??"default",A=t.useMemo(()=>e.portalTarget??n??null,[e.portalTarget,n]),O=t.useRef("");O.current||(O.current=Oy());const[I,k]=t.useState(null),j=t.useRef(null);j.current=I;const[R,P]=t.useState(!1),[D,L]=t.useState(null),[M,U]=t.useState(!1),F=t.useRef(null),B=t.useRef(null),q=t.useRef(!1);q.current=o;const z=t.useRef(!1);z.current=s;const H=t.useRef(!1),W=t.useRef(null),G=t.useRef(!1),V=t.useRef(async()=>{}),K=t.useRef(async()=>{}),Y=t.useCallback(()=>{B.current&&(clearTimeout(B.current),B.current=null)},[]);t.useEffect(()=>{e.autoLogin&&console.info("[Callix Dialer] autoLogin: desde a 2.7.0 o widget não cria sessão sem confirmação; ele entra sozinho só quando já existe uma conexão ativa deste usuário (outra aba ou o motor).")},[e.autoLogin]);const X=t.useRef({apiUrl:e.apiUrl||"/api/user-sdk-session",token:null});t.useEffect(()=>{X.current.token=c},[c]);const J=Boolean(e.engineUrl),Z=t.useRef(J);Z.current=J;const Q=t.useRef(null),ee=t.useCallback(t=>{const n=Q.current;if(n&&n.agentId===t)return n.connect(),n;null==n||n.close();const r=new Du({url:e.engineUrl??"",token:e.engineToken||void 0,version:Gy,sessionToken:()=>tb(t),agentId:t,label:"Discador",log:e=>console.log("[Callix Dialer/motor]",e)});return r.onSessionLost(e=>{if(H.current)return;const t=Wp(e.originator);u(`${t.title}: ${t.detail}${t.action?` ${t.action}`:""}`),a(!1),f(null),L(null)}),r.connect(),Q.current=r,r},[e.engineUrl,e.engineToken]);t.useEffect(()=>()=>{var e;null==(e=Q.current)||e.close(),Q.current=null},[]),t.useEffect(()=>{let e=!1;const t=()=>{var t;if(Z.current||e)return;e=!0,setTimeout(()=>{e=!1},2e3);const{apiUrl:n,token:r}=X.current;if("leader"===j.current&&(null==(t=F.current)||t.post({type:"leaving"}),F.current&&Ly(F.current.username,O.current)),r){const e=JSON.stringify({logout:!0}),t=`${n}?logout=true`;if(navigator.sendBeacon){const n=new Blob([e],{type:"application/json"});navigator.sendBeacon(t,n),console.log("[Callix Dialer] Logout enviado via sendBeacon")}else fetch(n,{method:"DELETE",headers:{Authorization:`Bearer ${r}`},keepalive:!0}).catch(()=>{})}};return window.addEventListener("beforeunload",t),window.addEventListener("pagehide",t),()=>{window.removeEventListener("beforeunload",t),window.removeEventListener("pagehide",t)}},[]),t.useEffect(()=>{if("undefined"!=typeof window)try{const e=localStorage.getItem(eb);if(!e)return console.log("[Callix Dialer] Nenhum username salvo, aguardando login manual"),void g(!1);if(N&&e!==N)return console.log("[Callix Dialer] Ignorando sessao salva por mismatch com preset:",e,"!=",N),void g(!1);console.log("[Callix Dialer] Username encontrado, irá fazer novo login:",e),i(e);const t=Qy(e),n=localStorage.getItem(t.SKIP_MANUAL_QUALIFICATION);n&&y("true"===n)}catch(e){console.error("[Callix Dialer] Erro ao verificar sessão:",e)}finally{g(!1)}else g(!1)},[N]),t.useEffect(()=>{N&&r!==N&&i(N)},[N,r]);const te=t.useCallback(()=>e.domain||new URL(e.apiUrl||"/api/user-sdk-session",window.location.href).host,[e.domain,e.apiUrl]),ne=t.useCallback(async(e,t,n)=>{if(n){const r=await async function(e,t){var n,r;try{const i=await fetch(`https://${e}/sdk/v1/client/user-service/config`,{headers:{Authorization:`Bearer ${t}`},credentials:"omit"});if(!i.ok)return null;const o=await i.json();return!0===(null==(r=null==(n=null==o?void 0:o.service)?void 0:n.outboundOptions)?void 0:r.skipQualification)}catch{return null}}(t,n);if(null!==r){y(r);try{localStorage.setItem(Qy(e).SKIP_MANUAL_QUALIFICATION,String(r))}catch{}}}try{if(localStorage.setItem(eb,e),n){const r=Qy(e);localStorage.setItem(r.SESSION_TOKEN,n),localStorage.setItem(r.DOMAIN,t),localStorage.setItem(r.TIMESTAMP,Date.now().toString())}}catch{}f(n),p(t),i(e),a(!0),u(null),L(null),C(Date.now())},[]),re=t.useCallback(async e=>{d(!0),u(null),x("Entrando na sessão do motor...");try{await ne(e,te(),tb(e)),console.log("[Callix Dialer] Conectado ao motor como",e)}catch(t){console.error("[Callix Dialer] Erro ao entrar na sessão do motor:",t),u(t instanceof Error?t.message:"Erro ao conectar ao motor")}finally{d(!1),x(null)}},[ne,te]);t.useEffect(()=>{if(!J||!r||m)return;const e=r,t=ee(e);U(!t.getState().view);const n=setTimeout(()=>U(!1),15e3);let i=!1,o=!1;const s=()=>{const{view:n,sessionLost:r,rejected:s}=t.getState();if(!s&&o&&(o=!1,L(null)),s){if(o=!0,U(!1),z.current)return;return q.current&&(console.log("[Callix Dialer] o motor recusou esta aba: a sessão do agente foi trocada por um login em outro lugar"),a(!1),f(null),p(null)),void L(s.message)}if(!n)return;U(!1);!(("running"===n.engine||"starting"===n.engine)&&!r)||n.loggingOff||n.logoffError||H.current||q.current||z.current||i?"stopped"===n.engine&&q.current&&!z.current&&(console.log("[Callix Dialer] o motor desligou (Sair em outra aba ou servidor reiniciado); voltando à tela de login"),a(!1),f(null),p(null),L("O discador foi encerrado em outra aba ou o motor foi reiniciado.")):(i=!0,console.log("[Callix Dialer] o motor já segura a sessão deste agente; entrando por aqui também"),re(e).finally(()=>{i=!1}))};s();const d=t.subscribe(s);return()=>{d(),clearTimeout(n)}},[J,r,m,ee,re]);const ie=t.useRef(null);t.useEffect(()=>{if(J||!r)return void P(!0);P(!1);const e=r,t=new jy({username:e,tabId:O.current,status:()=>({role:j.current,authenticated:q.current})});F.current=t;const n=()=>{Y(),B.current=setTimeout(()=>{if(B.current=null,"member"!==j.current||q.current||z.current)return;const n=Py(e);n&&n.tabId!==O.current||Dy(e,O.current)&&(t.post({type:"claim"}),console.log("[Callix Dialer] a aba com o discador fechou; esta aba assume a conexão"),V.current(e))},function(e=Math.random()){return 3e3+Math.floor(600*e)}())};ie.current=n;const i=t.on(t=>{switch(t.type){case"login":case"claim":Y(),q.current||"leader"===j.current||(k("member"),Uy(e,"member"),L(null),u(null),P(!0));break;case"leaving":"member"!==j.current||q.current||n();break;case"takeover":"leader"===j.current&&(console.log("[Callix Dialer] outra aba pediu o discador; soltando a conexão"),K.current({broadcast:!1,keepDecision:!0}));break;case"logout":Y(),K.current({broadcast:!1}),L("Você saiu do discador em outra aba.");break;case"dropped":{Y(),Ly(e,O.current),k(null),Fy();const n=Wp(t.originator);u(`${n.title}: ${n.detail}${n.action?` ${n.action}`:""}`);break}}});return()=>{i(),t.close(),Y(),ie.current=null,F.current===t&&(F.current=null),P(!1)}},[J,r,Y]),t.useEffect(()=>{if(J||!r||o||R||m||s)return;const e=F.current;if(!e)return;const t=r,n=function(e,t=My()){if(!t)return null;try{const n=t.getItem(Ay);if(!n)return null;const r=JSON.parse(n);return r.username!==e?null:"leader"===r.role||"member"===r.role?r.role:null}catch{return null}}(t);if("leader"===n)return Y(),P(!0),void(Dy(t,O.current)?(e.post({type:"claim"}),console.log("[Callix Dialer] esta aba segurava o discador antes de recarregar; reconectando"),V.current(t)):(k("member"),Uy(t,"member")));let i=!1;return e.probe().then(e=>{var r;if(i)return;P(!0);const o=Py(t);Ry(e)||o&&o.tabId!==O.current||"member"===n&&function(e){return e.some(e=>null!==e.role)}(e)?(k("member"),Uy(t,"member")):"member"===n?(k("member"),null==(r=ie.current)||r.call(ie)):(k(null),Fy())}),()=>{i=!0}},[J,r,o,R,m,s,Y]),t.useEffect(()=>{if(J||"leader"!==I||!r)return;const e=r;Dy(e,O.current);const t=setInterval(()=>Dy(e,O.current),3e3);return()=>clearInterval(t)},[J,I,r]),t.useEffect(()=>{if(J||"member"!==I||!r)return;const e=r,t=()=>{if("visible"!==document.visibilityState||B.current)return;const t=F.current;t&&t.probe().then(t=>{var n;"member"!==j.current||q.current||B.current||Ry(t)||Py(e)||(console.log("[Callix Dialer] a aba com o discador não responde; esta aba vai assumir"),null==(n=ie.current)||n.call(ie))})};return document.addEventListener("visibilitychange",t),window.addEventListener("focus",t),()=>{document.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t)}},[J,I,r]);const oe=t.useCallback(async t=>{var n,r,s,l;if(W.current)return;if(G.current&&(await K.current({broadcast:!1}),G.current))return;if(d(!0),u(null),x("Preparando login..."),console.log("[Callix Dialer] 🚀 handleLogin iniciado para usuário:",t),e.engineUrl){const n=e.apiUrl||"/api/user-sdk-session";try{x("Conectando ao motor..."),H.current=!1;const e=ee(t);let r=null;try{r=await e.waitForView(15e3)}catch(g){if(!(g instanceof ju))throw g;console.log("[Callix Dialer] o motor recusou a credencial desta aba; fazendo login novo que substitui a sessão de lá")}const i=te();if((null==r?void 0:r.loggingOff)||(null==r?void 0:r.logoffError)&&("running"===r.engine||"starting"===r.engine))throw new Error(r.logoffError||"A sessão anterior ainda está sendo encerrada. Aguarde antes de entrar novamente.");const o=null!==r&&("running"===r.engine||"starting"===r.engine)&&!r.sessionLost;let a=null;if(o)a=tb(t),console.log("[Callix Dialer] motor já tem a sessão do agente; entrando sem novo login");else{x("Autenticando no Callix...");const r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t}),credentials:"same-origin"});if(!r.ok){const e=await r.json().catch(()=>({error:"Erro desconhecido"}));throw new Error(e.error||`Falha na autenticação: ${r.status}`)}a=(await r.json()).userSessionToken;try{const e=Qy(t);localStorage.setItem(eb,t),localStorage.setItem(e.SESSION_TOKEN,a),localStorage.setItem(e.DOMAIN,i),localStorage.setItem(e.TIMESTAMP,Date.now().toString())}catch{}e.setSession({domain:i,userSessionToken:a}),x("Subindo o motor...");const o=await e.waitForView(2e4,e=>"running"===e.engine||"starting"===e.engine||Boolean(e.sessionLost),{fresh:!0});if(o.sessionLost)throw new Error(o.sessionLost.message)}await ne(t,i,a),console.log("[Callix Dialer] Conectado ao motor como",t)}catch(g){console.error("[Callix Dialer] Erro ao entrar pelo motor:",g),u(g instanceof Error?g.message:"Erro ao conectar ao motor"),a(!1),f(null)}finally{d(!1),x(null)}return}if(!Dy(t,O.current))return console.log("[Callix Dialer] outra aba já segura a conexão deste usuário; esta aba vira membro"),k("member"),Uy(t,"member"),P(!0),i(t),d(!1),void x(null);null==(n=F.current)||n.post({type:"claim"}),Y(),k("leader"),Uy(t,"leader");const h=e.apiUrl||"/api/user-sdk-session";let m;if("undefined"!=typeof window)try{const e=Qy(t);m=localStorage.getItem(e.SESSION_TOKEN)||void 0,console.log("[Callix Dialer] 🔍 Token anterior no localStorage:",m?"ENCONTRADO":"NÃO ENCONTRADO")}catch(g){console.warn("[Callix Dialer] Erro ao buscar token anterior:",g)}if(m){x("Encerrando sessão anterior..."),console.log("[Callix Dialer] 🔌 Token anterior encontrado, fazendo logout no servidor...");try{const e=await fetch(h,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${m}`,"x-session-token":m},credentials:"same-origin"});console.log("[Callix Dialer] 📡 Resposta do logout:",e.status),e.ok?console.log("[Callix Dialer] ✅ Logout no servidor concluído"):console.log("[Callix Dialer] ⚠️ Logout retornou status:",e.status)}catch($){console.warn("[Callix Dialer] ⚠️ Erro no logout (pode ser sessão expirada):",$)}x("Aguardando liberação da sessão anterior..."),console.log("[Callix Dialer] ⏳ Aguardando Kamailio processar unregister (5 segundos)..."),await new Promise(e=>setTimeout(e,5e3)),console.log("[Callix Dialer] ✅ Período de espera concluído")}if("undefined"!=typeof window)try{const e=Qy(t);localStorage.removeItem(e.SESSION_TOKEN),localStorage.removeItem(e.TIMESTAMP),console.log("[Callix Dialer] 🗑️ Token antigo removido do localStorage")}catch(g){console.warn("[Callix Dialer] Erro ao limpar localStorage:",g)}x("Fechando conexão anterior..."),console.log("[Callix Dialer] 🔌 Verificando WebSocket SIP local..."),await Ky(),(o||c)&&(console.log("[Callix Dialer] 🔌 Preparando para fechar conexão SIP local..."),w.current&&(console.log("[Callix Dialer] 📴 Chamando goOffline() via cleanupRef..."),w.current.goOffline(),await new Promise(e=>setTimeout(e,500)),console.log("[Callix Dialer] 🛑 Chamando stop() via cleanupRef..."),w.current.stop(),await new Promise(e=>setTimeout(e,500))),console.log("[Callix Dialer] ⏳ Desmontando CallixClientProvider..."),a(!1),f(null),E(!0),await new Promise(e=>setTimeout(e,1e3)),E(!1),console.log("[Callix Dialer] ✅ SDK desmontado"));try{x("Autenticando no Callix..."),console.log("[Callix Dialer] 🔐 Criando nova sessão no servidor...");const n=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t,previousToken:m}),credentials:"same-origin"});if(!n.ok){const e=await n.json().catch(()=>({error:"Erro desconhecido"}));throw new Error(e.error||`Falha na autenticação: ${n.status}`)}const o=await n.json(),d=e.domain||o.domain||"villelabrasil.callix.com.br";f(o.userSessionToken),p(d),i(t),a(!0),u(null),C(Date.now()),console.log("[Callix Dialer] Nova providerKey gerada para forçar recriação do SDK"),L(null),P(!0),null==(r=F.current)||r.post({type:"login"});try{const e=`https://${d}/sdk/v1/client/user-service/config`;x("Carregando configurações..."),console.log("[Callix Dialer] 🔍 Buscando configuração do serviço:",e);const n=await fetch(e,{headers:{Authorization:`Bearer ${o.userSessionToken}`},credentials:"omit"});if(console.log("[Callix Dialer] 📡 Resposta da config:",n.status),n.ok){const e=await n.json();console.log("[Callix Dialer] 📦 Dados da config recebidos:",JSON.stringify(e,null,2));const r=!0===(null==(l=null==(s=null==e?void 0:e.service)?void 0:s.outboundOptions)?void 0:l.skipQualification);if(console.log("[Callix Dialer] ✅ skipQualification configurado:",r),y(r),"undefined"!=typeof window){const e=Qy(t);localStorage.setItem(e.SKIP_MANUAL_QUALIFICATION,r.toString()),console.log("[Callix Dialer] 💾 skipQualification salvo no localStorage")}}else{const e=await n.text();console.warn("[Callix Dialer] ⚠️ Erro ao buscar config do serviço:",n.status,e)}}catch(v){console.error("[Callix Dialer] ❌ Erro ao buscar config do serviço:",v)}if("undefined"!=typeof window)try{const e=Qy(t);localStorage.setItem(eb,t),localStorage.setItem(e.SESSION_TOKEN,o.userSessionToken),localStorage.setItem(e.DOMAIN,d),localStorage.setItem(e.TIMESTAMP,Date.now().toString()),console.log("[Callix Dialer] Sessão salva no localStorage")}catch(g){console.warn("[Callix Dialer] Não foi possível salvar sessão:",g)}x("Conectando ao discador..."),console.log("[Callix Dialer] Autenticado com sucesso:",t)}catch(g){console.error("[Callix Dialer] Erro ao autenticar:",g),u(g instanceof Error?g.message:"Erro ao autenticar"),a(!1),f(null),Ly(t,O.current),k(null),Fy()}finally{d(!1),x(null)}},[e.apiUrl,e.domain,e.engineUrl,o,c,ee,ne,te,Y]);t.useEffect(()=>{V.current=oe},[oe]);const ae=t.useCallback(t=>{if(W.current)return W.current;const n=!1!==(null==t?void 0:t.broadcast),o=!0===(null==t?void 0:t.keepDecision),s=r,l=c??(s?tb(s):null),h="leader"===j.current||q.current;Y(),d(!0),z.current=!0,x("Encerrando sessão..."),u(null);const m=(async()=>{var t,r;try{if(e.engineUrl){const t=Q.current,n=null==t?void 0:t.getState();if(!t)throw new Error("Não há conexão com o motor para confirmar a saída.");if(!(null==n?void 0:n.rejected)&&!(null==n?void 0:n.sessionLost)){H.current=!0;const n=async()=>{if(!l)throw new Error("O motor parou sem confirmar a saída e esta aba não tem o token da sessão.");const t=s?tb(s):null;if(t&&t!==l)throw new ju("session-changed","Outra aba substituiu a sessão durante o encerramento.");await Ny(e.apiUrl||"/api/user-sdk-session",l)},r=()=>{const e=t.getState().view;return"stopped"===(null==e?void 0:e.engine)||"crashed"===(null==e?void 0:e.engine)};if(r())await n();else try{await t.logoff()}catch(c){if(!r())throw c;await n()}}}else{if(n&&(null==(t=F.current)||t.post({type:"logout"})),w.current&&(w.current.goOffline(),await new Promise(e=>setTimeout(e,500)),null==(r=w.current)||r.stop(),await new Promise(e=>setTimeout(e,500))),h&&!o){if(!l)throw new Error("Não há token para encerrar a sessão no Callix.");const t=s?tb(s):null;if(t&&t!==l)throw new ju("session-changed","Outra aba substituiu a sessão durante o encerramento.");await Ny(e.apiUrl||"/api/user-sdk-session",l)}s&&Ly(s,O.current)}if(G.current=!1,H.current=!1,a(!1),f(null),X.current.token=null,p(null),o)return k("member"),void(s&&Uy(s,"member"));if(k(null),Fy(),i(N??null),"undefined"!=typeof window&&s&&(e.engineUrl||h))try{const e=Qy(s);localStorage.getItem(e.SESSION_TOKEN)===l&&(localStorage.getItem(eb)===s&&localStorage.removeItem(eb),localStorage.removeItem(e.SESSION_TOKEN),localStorage.removeItem(e.DOMAIN),localStorage.removeItem(e.TIMESTAMP))}catch(c){console.warn("[Callix Dialer] Não foi possível limpar os dados locais da sessão:",c)}}catch(c){if(console.error("[Callix Dialer] Não foi possível confirmar a saída:",c),c instanceof ju&&"session-changed"===c.code)return G.current=!1,H.current=!1,f(null),a(!1),void u("A sessão foi substituída por outro login durante a saída. Entre novamente para usar a sessão atual.");G.current=!0,a(!1),u(`Não foi possível confirmar a saída: ${c instanceof Error?c.message:"falha ao encerrar a sessão"}. Ao entrar novamente, o discador tentará concluir o encerramento primeiro.`)}finally{d(!1),z.current=!1,x(null)}})().finally(()=>{W.current=null});return W.current=m,m},[r,c,N,e.apiUrl,e.engineUrl,Y]);t.useEffect(()=>{K.current=ae},[ae]);const se=t.useCallback(async()=>{const e=r,t=F.current;if(!e||!t)return;d(!0),u(null),x("Trazendo o discador para esta aba..."),t.post({type:"takeover"}),await new Promise(e=>setTimeout(e,1500));const n=Py(e);if(n&&n.tabId!==O.current)return console.log("[Callix Dialer] a outra aba não soltou a conexão; continuando como membro"),d(!1),void x(null);await V.current(e)},[r]),de=t.useCallback(()=>{K.current()},[]),le=t.useCallback((e,t)=>{var n;if(W.current)return;r&&Ly(r,O.current),null==(n=F.current)||n.post({type:"dropped",originator:e}),k(null),Fy(),u(`${t.title}: ${t.detail}${t.action?` ${t.action}`:""}`),a(!1),f(null),p(null)},[r]),ue=Boolean(r)&&!o&&(J?M:!R),ce=t.useMemo(()=>o||s||m||S||!r||ue?null:{username:r,locked:Boolean(N),elsewhere:!J&&"member"===I,note:D},[o,s,m,S,r,N,ue,J,I,D]),fe=t.useCallback(()=>{if(i(null),u(null),"undefined"!=typeof window)try{localStorage.removeItem(eb)}catch{}},[]),he="inline"===e.mode||"mobile"===T?Sy:q$,pe=e.mode,me=!1===(ge=e.clickToCall)?{enabled:!1}:!0===ge||null==ge?{enabled:!0}:{...ge,enabled:!1!==ge.enabled};var ge;return S?$.jsx(Yy.Provider,{value:{skipManualQualification:v},children:$.jsx(he,{isAuthenticated:!1,username:r,onLogin:oe,onLogout:ae,isLoadingSession:!0,sessionError:null,sessionStatus:"Encerrando sessão anterior...",variant:T,portalTarget:A,density:e.density,mode:pe})}):o&&(J||c&&h)?J&&Q.current?$.jsx(Yy.Provider,{value:{skipManualQualification:v},children:$.jsxs(Mu,{client:Q.current,children:[$.jsx(he,{isAuthenticated:o,username:r,onLogin:oe,onLogout:ae,isLoadingSession:s,sessionError:l,sessionStatus:b,variant:T,portalTarget:A,density:e.density,mode:pe}),c&&$.jsx(Wy,{enabled:me.enabled,pollIntervalMs:me.pollIntervalMs,sessionToken:c,onTask:me.onTask})]},_)}):c&&h?$.jsx(Yy.Provider,{value:{skipManualQualification:v},children:$.jsx(ku.CallixClientProvider,{domain:h,userSessionToken:c,children:$.jsxs(Jy,{ref:w,onSessionDropped:le,children:[$.jsx(he,{isAuthenticated:o,username:r,onLogin:oe,onLogout:ae,isLoadingSession:s,sessionError:l,sessionStatus:b,variant:T,portalTarget:A,density:e.density,mode:pe}),$.jsx(Wy,{enabled:me.enabled,pollIntervalMs:me.pollIntervalMs,sessionToken:c,onTask:me.onTask})]})},_)}):null:$.jsx(Yy.Provider,{value:{skipManualQualification:v},children:$.jsx(he,{isAuthenticated:!1,username:r,onLogin:oe,onLogout:ae,isLoadingSession:s||m||ue,sessionError:l,sessionStatus:b,loginConfirmation:ce,onCancelLoginConfirmation:fe,onTakeOverSession:se,onLogoutAllTabs:de,variant:T,portalTarget:A,density:e.density,mode:pe})})}function rb(e){console.log(`[Callix Dialer] 🔧 Widget v${Gy} inicializando...`);const t=new Zy(e);return t.init(),t}const ib={CallixDialerWidget:Zy,init:rb,version:Gy};"undefined"!=typeof window&&(window.CallixDialer=ib),e.CallixDialerWidget=Zy,e.WIDGET_VERSION=Gy,e.default=ib,e.init=rb,e.useDialerConfig=Xy,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
26
26
  //# sourceMappingURL=callix-dialer.umd.js.map