1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[6660,3239],{83239:function(C,v,o){o.r(v),o.d(v,{addUserToParticipantsPanel:function(){return A},initParticipantsPanel:function(){return L},removeUserFromParticipantsPanel:function(){return w},updateParticipantVisitFormState:function(){return P}});var d=o(56004),I=o(48349),g=o(91220),F=o(50913),V=o(53285);let p;function S(){if(p)return p;const t=document.getElementById("visitFormReviewContent");return p=new g.Z(t,{modalClasses:"visit-form-review-modal",closeButton:!1,modalAnimation:"fade",width:490,height:560,fullScreenBreakpointWidth:430,fullScreenBreakpointHeight:450,fitContent:!0,customProps:{user:{}}}),u(p),p}function u(t){t.modal.querySelector("#visitFormReviewConfirmButton").addEventListener("click",()=>{t.user.visitFormState=d.Z.ACCEPTED,P(t.user),e(t.user.userId),t.closeModal()});function e(s){F.R.signal({event:"FORM_REVIEW",userId:s,visitFormState:d.Z.ACCEPTED})}t.modal.querySelector("#visitFormReviewRequestAgainButton").addEventListener("click",()=>{t.user.visitFormState=d.Z.FILLING,P(t.user),a(t.user.userId),t.closeModal(),(0,V.O)({title:GFT.translate("certificateRequestedAgain")},{groupId:"visitFormReviewSnackbar"})});function a(s){F.R.signal({event:"FORM_REVIEW",userId:s,visitFormState:d.Z.FILLING})}}var E=o(4468);function h(t,n,e){return new Promise((i,a)=>{fetch(n,{method:e}).then(s=>{s.ok?s.json().then(c=>{i({response:c,requestName:t})}):s.json().then(c=>{a({error:c,requestName:t})}).catch(()=>{a({error:"Unhandled response",requestName:t})})}).catch(()=>{a({error:"Network error encountered",requestName:t})})})}var f=o(19755),B=(t,n,e)=>new Promise((i,a)=>{var s=r=>{try{l(e.next(r))}catch(m){a(m)}},c=r=>{try{l(e.throw(r))}catch(m){a(m)}},l=r=>r.done?i(r.value):Promise.resolve(r.value).then(s,c);l((e=e.apply(t,n)).next())});function L(){A({isAgent:!0}),R()}function A(t){if(document.getElementById("participant-"+t.userId))return;const n=t.isAgent?document.getElementById("participant-agent"):T(t);P(t),O(n)}function R(){document.getElementById("addParticipantsButton").addEventListener("click",()=>{f("#inviteUserVideocalls").modal("show")})}function T(t){const n=document.getElementById("cdn_string").value,e=document.getElementById("participantsList"),i=document.createElement("LI");return i.id=`participant-${t.userId}`,i.dataset.connectionId=t.connectionId,i.classList.add("participants__participant","participants__visitor"),i.innerHTML=` 2 <div class="participants__participant__sound"> 3 <div class="bars"> 4 <div class="bar"></div> 5 <div class="bar"></div> 6 <div class="bar"></div> 7 </div> 8 <img class="muted-icon" 9 src="${n}/img/icons/muted-icon.svg" 10 alt="${VTFT.translate("globalMuted")}" 11 > 12 </div> 13 <div class="participants__participant__name"> 14 <span class="participants__participant__name__name">${t.name}</span> 15 </div> 16 <div class="participants__participant__visit-form-state view-visit-form-button"> 17 <img src="${n}/global/icons/certificate_icon.svg" alt="${VTFT.translate("participantsPanelParticipantVisitFormStateImageAlt")}"> 18 <div class="participants__participant__visit-form-state-dot"></div> 19 </div> 20 `,e==null||e.append(i),i}function O(t){_(t)}function M(t){return h("visitFormReview",`/live/${I.default.state.liveId}/forms/${t}`,"GET")}function U(t){const n=document.getElementById("visitFormVisitorName"),e=document.getElementById("visitFormVisitorId"),i=document.getElementById("visitFormVisitorPhone"),a=document.getElementById("visitFormVisitorEmail"),s=document.getElementById("visitFormVisitorSignatureImage");n.textContent=t.name,n.parentElement.title=t.name,e.textContent=t.id,e.parentElement.title=t.id,i.textContent=t.phone,i.parentElement.title=t.phone,a.textContent=t.email,a.parentElement.title=t.email,s.src=t.signature}function _(t){const n=S();t.querySelectorAll(".view-visit-form-button").forEach(i=>{i==null||i.addEventListener("click",()=>B(this,null,function*(){if(!i.classList.contains("disabled")){const a=E.pc.find(r=>r.userId===parseInt(t.id.replace("participant-",""))),s=a.connectionId,l=(yield M(s)).response.form;l&&(U(l),n.user=a,n.openModal())}}))})}function Z(t){n(t),setTimeout(()=>e(t),1e3);function n(i){try{i.scrollIntoViewIfNeeded(!1)}catch(a){i.scrollIntoView(!1)}}function e(i){const a=i.querySelector(".participants__participant__visit-form-state"),s=i.querySelector(".participants__participant__visit-form-state-dot");a.style.setProperty("--dot-top-position",s.getBoundingClientRect().top+"px"),s.addEventListener("animationend",()=>{s.classList.toggle("animate-dot")},{once:!0}),s.classList.toggle("animate-dot")}}function w(t){document.getElementById(`participant-${t}`).remove()}function P(t){if(t.isAgent||!I.default.state.visitFormRequired)return;const n=document.getElementById(`participant-${t.userId||t.userId}`),e=t.visitFormState||d.Z.FILLING;i(n,e),a(n,e),s(n,e),t.visitFormState===d.Z.REVIEWING&&Z(n);function i(c,l){const r="participants__participant--visit-form-",m=r+l;
20Object.keys(d.Z).forEach(y=>{c.classList.remove(r+d.Z[y])}),c.classList.add(m)}function a(c,l){const r=c.querySelector(".participants__participant__visit-form-state"),m="participantsPanelParticipantVisitFormStateTitleAttribute",y=l.charAt(0).toUpperCase()+l.slice(1),$=m+y;r.setAttribute("title",VTFT.translate($))}function s(c,l){c.querySelectorAll(".view-visit-form-button").forEach(m=>{m.classList.toggle("disabled",l===d.Z.FILLING)})}}},86660:function(C,v,o){o.r(v),o.d(v,{updateParticipantVisitFormState:function(){return p}});var d=o(56004),I=o(83239),g=o(31360),F=o(4468);const V=[];function p(u){S(u),(0,I.updateParticipantVisitFormState)(u),E(u.visitFormState)&&h(u);function E(f){return f===d.Z.REVIEWING}function h(f){const B=F.pc.find(L=>L.userId===f.userId);(0,g.x)(B.name,"visitFormFilledOut")}}function S(u){Object.values(d.Z).includes(u.visitFormState)&&(V[u.userId]=u.visitFormState)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.