1"use strict";(self.webpackChunkhimenus=self.webpackChunkhimenus||[]).push([[511],{34271:(ye,de)=>{var J,a;function U(a,t){if(!a)throw"First parameter is required.";t=new xe(a,t=t||{type:"video"});var r=this;function f(y){y&&(t.initCallback=function(){y(),y=t.initCallback=null});var h=new Pe(a,t);(g=new h(a,t)).record(),T("recording"),t.disableLogs||console.log("Initialized recorderType:",g.constructor.name,"for output-type:",t.type)}function l(y){if(y=y||function(){},g){if("paused"===r.state)return r.resumeRecording(),void setTimeout(function(){l(y)},1);"recording"!==r.state&&!t.disableLogs&&console.warn('Recording state should be: "recording", however current state is: ',r.state),t.disableLogs||console.log("Stopped recording "+t.type+" stream."),"gif"!==t.type?g.stop(h):(g.stop(),h()),T("stopped")}else b();function h(x){if(g){Object.keys(g).forEach(function(R){"function"!=typeof g[R]&&(r[R]=g[R])});var c=g.blob;if(!c){if(!x)throw"Recording failed.";g.blob=c=x}if(c&&!t.disableLogs&&console.log(c.type,"->",Oe(c.size)),y){var u;try{u=z.createObjectURL(c)}catch{}"function"==typeof y.call?y.call(r,u):y(u)}t.autoWriteToDisk&&I(function(R){var S={};S[t.type+"Blob"]=R,D.Store(S)})}else"function"==typeof y.call?y.call(r,""):y("")}}function w(y){postMessage((new FileReaderSync).readAsDataURL(y))}function I(y,h){if(!y)throw"Pass a callback function over getDataURL.";var x=h?h.blob:(g||{}).blob;if(!x)return t.disableLogs||console.warn("Blob encoder did not finish its job yet."),void setTimeout(function(){I(y,h)},1e3);if(typeof Worker<"u"&&!navigator.mozGetUserMedia){var c=function R(S){try{var F=z.createObjectURL(new Blob([S.toString(),"this.onmessage = function (eee) {"+S.name+"(eee.data);}"],{type:"application/javascript"})),k=new Worker(F);return z.revokeObjectURL(F),k}catch{}}(w);c.onmessage=function(S){y(S.data)},c.postMessage(x)}else{var u=new FileReader;u.readAsDataURL(x),u.onload=function(S){y(S.target.result)}}}function v(y){if(y=y||0,"paused"!==r.state){if("stopped"!==r.state){if(y>=r.recordingDuration)return void l(r.onRecordingStopped);y+=1e3,setTimeout(function(){v(y)},1e3)}}else setTimeout(function(){v(y)},1e3)}function T(y){r&&(r.state=y,"function"==typeof r.onStateChanged.call?r.onStateChanged.call(r,y):r.onStateChanged(y))}var C='It seems that recorder is destroyed or "startRecording" is not invoked for '+t.type+" recorder.";function b(){!0!==t.disableLogs&&console.warn(C)}var g,L={startRecording:function p(y){return t.disableLogs||console.log("RecordRTC version: ",r.version),y&&(t=new xe(a,y)),t.disableLogs||console.log("started recording "+t.type+" stream."),g?(g.clearRecordedData(),g.record(),T("recording"),r.recordingDuration&&v(),r):(f(function(){r.recordingDuration&&v()}),r)},stopRecording:l,pauseRecording:function m(){g?"recording"===r.state?(T("paused"),g.pause(),t.disableLogs||console.log("Paused recording.")):t.disableLogs||console.warn("Unable to pause the recording. Recording state: ",r.state):b()},resumeRecording:function d(){g?"paused"===r.state?(T("recording"),g.resume(),t.disableLogs||console.log("Resumed recording.")):t.disableLogs||console.warn("Unable to resume the recording. Recording state: ",r.state):b()},initRecorder:f,setRecordingDuration:function(y,h){if(typeof y>"u")throw"recordingDuration is required.";if("number"!=typeof y)throw"recordingDuration must be a number.";return r.recordingDuration=y,r.onRecordingStopped=h||function(){},{onRecordingStopped:function(x){r.onRecordingStopped=x}}},clearRecordedData:function(){g?(g.clearRecordedData(),t.disableLogs||console.log("Cleared old recorded data.")):b()},getBlob:function(){if(g)return g.blob;b()},getDataURL:I,toURL:function(){if(g)return z.createObjectURL(g.blob);b()},getInternalRecorder:function(){return g},save:function(y){g?oe(g.blob,y):b()},getFromDisk:function(y){g?U.getFromDisk(t.type,y):b()},setAdvertisementArray:function(y){t.advertisement=[];for(var h=y.length,x=0;x<h;x++)t.advertisement.push({duration:x,image:y[x]})},blob:null,bufferSize:0,sampleRate:0,buffer:null,reset:function(){"recording"===r.state&&!t.disableLogs&&console.warn("Stop an active recorder."),g&&"function"==typeof g.clearRecordedData&&g.clearRecordedData(),g=null,T("inactive"),r.blob=null},onStateChanged:function(y){t.disableLogs||console.log("Recorder state changed:",y)},state:"inactive",getState:function(){return r.state},destroy:function(){var y=t.disableLogs;t={disableLogs:!0},r.reset(),T("destroyed"),L=r=null,we.AudioContextConstructor&&(we.AudioContextConstructor.close(),we.AudioContextConstructor=null),t.disableLogs=y,t.disableLogs||console.log("RecordRTC is destroyed.")},version:"5.6.2"};if(!this)return r=L,L;for(var P in L)this[P]=L[P];return r=this,L}function xe(a,t){return!t.recorderType&&!t.type&&(t.audio&&t.video?t.type="video":t.audio&&!t.video&&(t.type="audio")),t.recorderType&&!t.type&&(t.recorderType===Ue||t.recorderType===Re||t.recorderType===me?t.type="video":t.recorderType===ee?t.type="gif":t.re
1corderType===Ie?t.type="audio":t.recorderType===Y&&(N(a,"audio").length&&N(a,"video").length||!N(a,"audio").length&&N(a,"video").length?t.type="video":N(a,"audio").length&&!N(a,"video").length&&(t.type="audio"))),typeof MediaRecorder<"u"&&"requestData"in MediaRecorder.prototype&&(t.mimeType||(t.mimeType="video/webm"),t.type||(t.type=t.mimeType.split("/")[0])),t.type||(t.mimeType&&(t.type=t.mimeType.split("/")[0]),t.type||(t.type="audio")),t}function Pe(a,t){var r;return(ce||Se||Ce)&&(r=Ie),typeof MediaRecorder<"u"&&"requestData"in MediaRecorder.prototype&&!ce&&(r=Y),"video"===t.type&&(ce||Ce)&&(r=Ue,typeof ReadableStream<"u"&&(r=me)),"gif"===t.type&&(r=ee),"canvas"===t.type&&(r=Re),ge()&&r!==Re&&r!==ee&&typeof MediaRecorder<"u"&&"requestData"in MediaRecorder.prototype&&(N(a,"video").length||N(a,"audio").length)&&("audio"===t.type?"function"==typeof MediaRecorder.isTypeSupported&&MediaRecorder.isTypeSupported("audio/webm")&&(r=Y):"function"==typeof MediaRecorder.isTypeSupported&&MediaRecorder.isTypeSupported("video/webm")&&(r=Y)),a instanceof Array&&a.length&&(r=We),t.recorderType&&(r=t.recorderType),!t.disableLogs&&r&&r.name&&console.log("Using recorderType:",r.name||r.constructor.name),!r&&Me&&(r=Y),r}function V(a){this.addStream=function(t){t&&(a=t)},this.mediaType={audio:!0,video:!0},this.startRecording=function(){var r,t=this.mediaType,p=this.mimeType||{audio:null,video:null,gif:null};if("function"!=typeof t.audio&&ge()&&!N(a,"audio").length&&(t.audio=!1),"function"!=typeof t.video&&ge()&&!N(a,"video").length&&(t.video=!1),"function"!=typeof t.gif&&ge()&&!N(a,"video").length&&(t.gif=!1),!t.audio&&!t.video&&!t.gif)throw"MediaStream must have either audio or video tracks.";if(t.audio&&(r=null,"function"==typeof t.audio&&(r=t.audio),this.audioRecorder=new U(a,{type:"audio",bufferSize:this.bufferSize,sampleRate:this.sampleRate,numberOfAudioChannels:this.numberOfAudioChannels||2,disableLogs:this.disableLogs,recorderType:r,mimeType:p.audio,timeSlice:this.timeSlice,onTimeStamp:this.onTimeStamp}),t.video||this.audioRecorder.startRecording()),t.video){r=null,"function"==typeof t.video&&(r=t.video);var f=a;if(ge()&&t.audio&&"function"==typeof t.audio){var l=N(a,"video")[0];_e?((f=new $).addTrack(l),r&&r===Ue&&(r=Y)):(f=new $).addTrack(l)}this.videoRecorder=new U(f,{type:"video",video:this.video,canvas:this.canvas,frameInterval:this.frameInterval||10,disableLogs:this.disableLogs,recorderType:r,mimeType:p.video,timeSlice:this.timeSlice,onTimeStamp:this.onTimeStamp,workerPath:this.workerPath,webAssemblyPath:this.webAssemblyPath,frameRate:this.frameRate,bitrate:this.bitrate}),t.audio||this.videoRecorder.startRecording()}if(t.audio&&t.video){var m=this,d=!0===ge();(t.audio instanceof Ie&&t.video||!0!==t.audio&&!0!==t.video&&t.audio!==t.video)&&(d=!1),!0===d?(m.audioRecorder=null,m.videoRecorder.startRecording()):m.videoRecorder.initRecorder(function(){m.audioRecorder.initRecorder(function(){m.videoRecorder.startRecording(),m.audioRecorder.startRecording()})})}t.gif&&(r=null,"function"==typeof t.gif&&(r=t.gif),this.gifRecorder=new U(a,{type:"gif",frameRate:this.frameRate||200,quality:this.quality||10,disableLogs:this.disableLogs,recorderType:r,mimeType:p.gif}),this.gifRecorder.startRecording())},this.stopRecording=function(t){t=t||function(){},this.audioRecorder&&this.audioRecorder.stopRecording(function(r){t(r,"audio")}),this.videoRecorder&&this.videoRecorder.stopRecording(function(r){t(r,"video")}),this.gifRecorder&&this.gifRecorder.stopRecording(function(r){t(r,"gif")})},this.pauseRecording=function(){this.audioRecorder&&this.audioRecorder.pauseRecording(),this.videoRecorder&&this.videoRecorder.pauseRecording(),this.gifRecorder&&this.gifRecorder.pauseRecording()},this.resumeRecording=function(){this.audioRecorder&&this.audioRecorder.resumeRecording(),this.videoRecorder&&this.videoRecorder.resumeRecording(),this.gifRecorder&&this.gifRecorder.resumeRecording()},this.getBlob=function(t){var r={};return this.audioRecorder&&(r.audio=this.audioRecorder.getBlob()),this.videoRecorder&&(r.video=this.videoRecorder.getBlob()),this.gifRecorder&&(r.gif=this.gifRecorder.getBlob()),t&&t(r),r},this.destroy=function(){this.audioRecorder&&(this.audioRecorder.destroy(),this.audioRecorder=null),this.videoRecorder&&(this.videoRecorder.destroy(),this.videoRecorder=null),this.gifRecorder&&(this.gifRecorder.destroy(),this.gifRecorder=null)},this.getDataURL=function(t){function r(f,l){if(typeof Worker<"u"){var m=function p(f){var d,l=z.createObjectURL(new Blob([f.toString(),"this.onmessage = function (eee) {"+f.name+"(eee.data);}"],{type:"application/javascript"})),m=new Worker(l);if(typeof z<"u")d=z;else{if(!(typeof webkitURL<"u"))throw"Neither URL nor webkitURL detected.";d=webkitURL}return d.revokeObjectURL(l),m}(function(I){postMessage((new FileReaderSync).readAsDataURL(I))});m.onmessage=function(w){l(w.data)},m.postMessage(f)}else{var d=new FileReader;d.readAsDataURL(f),d.onload=function(w){l(w.target.result)}}}this.getBlob(function(f){f.audio&&f.video?r(f.audio,function(l){r(f.video,function(m){t({audio:l,video:m})})}):f.audio?r(f.audio,function(l){t({audio:l})}):f.video&&r(f.video,function(l){t({video:l})})})},this.writeToDisk=function(){U.writeToDisk({audio:this.audioRecorder,video:this.videoRecorder,gif:this.gifRecorder})},this.save=function(t){(t=t||{audio:!0,video:!0,gif:!0}).audio&&this.audioRecorder&&this.audioRecorder.save("string"==typeof t.audio?t.audio:""),t.video&&this.videoRecorder&&this.videoRecorder.save("string"==typeof t.video?t.video:""),t.gif&&this.gifRecorder&&this.gifRecorder.save("string"==typeof t.gif?t.gif:"")}}U.version="5.6.2",ye.exports=U,void 0!==(J=function(){return U}.apply(de,[]))&&(ye.exports=J),U.getFromDisk=function(a,t){if(!t)throw"callback is mandatory.";console.log("Getting recorded "+("all"===a?"blobs":a+" blob ")+" from disk!"),D.Fetch(function(r,p){"all"!==a&&p===a+"Blob"&&t&&t(r),"all"===a&&t&&t(r,p.replace("Blob",""))})},U.writeToDisk=function(a){console.log("Writing recorded blob(s) to disk!"),(a=a||{}).audio&&a.video&&a.gif?a.audio.getDataURL(function(t){a.video.getDataURL(function(r){a.gif.getDataURL(function(p){D.Store({audio
1Blob:t,videoBlob:r,gifBlob:p})})})}):a.audio&&a.video?a.audio.getDataURL(function(t){a.video.getDataURL(function(r){D.Store({audioBlob:t,videoBlob:r})})}):a.audio&&a.gif?a.audio.getDataURL(function(t){a.gif.getDataURL(function(r){D.Store({audioBlob:t,gifBlob:r})})}):a.video&&a.gif?a.video.getDataURL(function(t){a.gif.getDataURL(function(r){D.Store({videoBlob:t,gifBlob:r})})}):a.audio?a.audio.getDataURL(function(t){D.Store({audioBlob:t})}):a.video?a.video.getDataURL(function(t){D.Store({videoBlob:t})}):a.gif&&a.gif.getDataURL(function(t){D.Store({gifBlob:t})})},V.getFromDisk=U.getFromDisk,V.writeToDisk=U.writeToDisk,U.MRecordRTC=V,(a=typeof global<"u"?global:null)&&(typeof window<"u"||typeof global>"u"||(global.navigator={userAgent:"Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45",getUserMedia:function(){}},global.console||(global.console={}),(typeof global.console.log>"u"||typeof global.console.error>"u")&&(global.console.error=global.console.log=global.console.log||function(){console.log(arguments)}),typeof document>"u"&&(a.document={documentElement:{appendChild:function(){return""}}},document.createElement=document.captureStream=document.mozCaptureStream=function(){var t={getContext:function(){return t},play:function(){},pause:function(){},drawImage:function(){},toDataURL:function(){return""},style:{}};return t},a.HTMLVideoElement=function(){}),typeof location>"u"&&(a.location={protocol:"file:",href:"",hash:""}),typeof screen>"u"&&(a.screen={width:0,height:0}),typeof z>"u"&&(a.URL={createObjectURL:function(){return""},revokeObjectURL:function(){return""}}),a.window=global));var _=window.requestAnimationFrame;if(typeof _>"u")if(typeof webkitRequestAnimationFrame<"u")_=webkitRequestAnimationFrame;else if(typeof mozRequestAnimationFrame<"u")_=mozRequestAnimationFrame;else if(typeof msRequestAnimationFrame<"u")_=msRequestAnimationFrame;else if(typeof _>"u"){var e=0;_=function(a,t){var r=(new Date).getTime(),p=Math.max(0,16-(r-e)),f=setTimeout(function(){a(r+p)},p);return e=r+p,f}}var B=window.cancelAnimationFrame;typeof B>"u"&&(typeof webkitCancelAnimationFrame<"u"?B=webkitCancelAnimationFrame:typeof mozCancelAnimationFrame<"u"?B=mozCancelAnimationFrame:typeof msCancelAnimationFrame<"u"?B=msCancelAnimationFrame:typeof B>"u"&&(B=function(a){clearTimeout(a)}));var le=window.AudioContext;typeof le>"u"&&(typeof webkitAudioContext<"u"&&(le=webkitAudioContext),typeof mozAudioContext<"u"&&(le=mozAudioContext));var z=window.URL;typeof z>"u"&&typeof webkitURL<"u"&&(z=webkitURL),typeof navigator<"u"&&typeof navigator.getUserMedia>"u"&&(typeof navigator.webkitGetUserMedia<"u"&&(navigator.getUserMedia=navigator.webkitGetUserMedia),typeof navigator.mozGetUserMedia<"u"&&(navigator.getUserMedia=navigator.mozGetUserMedia));var Se=!(-1===navigator.userAgent.indexOf("Edge")||!navigator.msSaveBlob&&!navigator.msSaveOrOpenBlob),Ce=!!window.opera||-1!==navigator.userAgent.indexOf("OPR/"),_e=navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&"netscape"in window&&/ rv:/.test(navigator.userAgent),ce=!Ce&&!Se&&!!navigator.webkitGetUserMedia||Te()||-1!==navigator.userAgent.toLowerCase().indexOf("chrome/"),Me=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);Me&&!ce&&-1!==navigator.userAgent.indexOf("CriOS")&&(Me=!1,ce=!0);var $=window.MediaStream;function Oe(a){if(0===a)return"0 Bytes";var p=parseInt(Math.floor(Math.log(a)/Math.log(1e3)),10);return(a/Math.pow(1e3,p)).toPrecision(3)+" "+["Bytes","KB","MB","GB","TB"][p]}function oe(a,t){if(!a)throw"Blob object is required.";if(!a.type)try{a.type="video/webm"}catch{}var r=(a.type||"video/webm").split("/")[1];if(-1!==r.indexOf(";")&&(r=r.split(";")[0]),t&&-1!==t.indexOf(".")){var p=t.split(".");t=p[0],r=p[1]}var f=(t||Math.round(9999999999*Math.random())+888888888)+"."+r;if(typeof navigator.msSaveOrOpenBlob<"u")return navigator.msSaveOrOpenBlob(a,f);if(typeof navigator.msSaveBlob<"u")return navigator.msSaveBlob(a,f);var l=document.createElement("a");l.href=z.createObjectURL(a),l.download=f,l.style="display:none;opacity:0;color:transparent;",(document.body||document.documentElement).appendChild(l),"function"==typeof l.click?l.click():(l.target="_blank",l.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0}))),z.revokeObjectURL(l.href)}function Te(){return!!(typeof window<"u"&&"object"==typeof window.process&&"renderer"===window.process.type||typeof process<"u"&&"object"==typeof process.versions&&process.versions.electron||"object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0)}function N(a,t){return a&&a.getTracks?a.getTracks().filter(function(r){return r.kind===(t||"audio")}):[]}function Ee(a,t){"srcObject"in t?t.srcObject=a:"mozSrcObject"in t?t.mozSrcObject=a:t.srcObject=a}typeof $>"u"&&typeof webkitMediaStream<"u"&&($=webkitMediaStream),typeof $<"u"&&typeof $.prototype.stop>
1"u"&&($.prototype.stop=function(){this.getTracks().forEach(function(a){a.stop()})}),U.invokeSaveAsDialog=oe,U.getTracks=N,U.getSeekableBlob=function De(a,t){if(typeof EBML>"u")throw new Error("Please link: https://www.webrtc-experiment.com/EBML.js");var r=new EBML.Reader,p=new EBML.Decoder,f=EBML.tools,l=new FileReader;l.onload=function(m){p.decode(this.result).forEach(function(T){r.read(T)}),r.stop();var w=f.makeMetadataSeekable(r.metadatas,r.duration,r.cues),I=this.result.slice(r.metadataSize),v=new Blob([w,I],{type:"video/webm"});t(v)},l.readAsArrayBuffer(a)},U.bytesToSize=Oe,U.isElectron=Te;var we={};function ge(){if(_e||Me||Se)return!0;navigator;var l,m,t=navigator.userAgent,r=""+parseFloat(navigator.appVersion),p=parseInt(navigator.appVersion,10);return(ce||Ce)&&(l=t.indexOf("Chrome"),r=t.substring(l+7)),-1!==(m=r.indexOf(";"))&&(r=r.substring(0,m)),-1!==(m=r.indexOf(" "))&&(r=r.substring(0,m)),p=parseInt(""+r,10),isNaN(p)&&(r=""+parseFloat(navigator.appVersion),p=parseInt(navigator.appVersion,10)),p>=49}function Y(a,t){var r,v=this;if(typeof a>"u")throw'First argument "MediaStream" is required.';if(typeof MediaRecorder>"u")throw"Your browser does not support the Media Recorder API. Please try other modules e.g. WhammyRecorder or StereoAudioRecorder.";"audio"===(t=t||{mimeType:"video/webm"}).type&&(N(a,"video").length&&N(a,"audio").length&&(navigator.mozGetUserMedia?(r=new $).addTrack(N(a,"audio")[0]):r=new $(N(a,"audio")),a=r),(!t.mimeType||-1===t.mimeType.toString().toLowerCase().indexOf("audio"))&&(t.mimeType=ce?"audio/webm":"audio/ogg"),t.mimeType&&"audio/ogg"!==t.mimeType.toString().toLowerCase()&&navigator.mozGetUserMedia&&(t.mimeType="audio/ogg"));var d,p=[];function f(){v.timestamps.push((new Date).getTime()),"function"==typeof t.onTimeStamp&&t.onTimeStamp(v.timestamps[v.timestamps.length-1],v.timestamps)}function l(T){return d&&d.mimeType?d.mimeType:T.mimeType||"video/webm"}function m(){p=[],d=null,v.timestamps=[]}this.getArrayOfBlobs=function(){return p},this.record=function(){v.blob=null,v.clearRecordedData(),v.timestamps=[],I=[],p=[];var T=t;t.disableLogs||console.log("Passing following config over MediaRecorder API.",T),d&&(d=null),ce&&!ge()&&(T="video/vp8"),"function"==typeof MediaRecorder.isTypeSupported&&T.mimeType&&(MediaRecorder.isTypeSupported(T.mimeType)||(t.disableLogs||console.warn("MediaRecorder API seems unable to record mimeType:",T.mimeType),T.mimeType="audio"===t.type?"audio/webm":"video/webm"));try{d=new MediaRecorder(a,T),t.mimeType=T.mimeType}catch{d=new MediaRecorder(a)}T.mimeType&&!MediaRecorder.isTypeSupported&&"canRecordMimeType"in d&&!1===d.canRecordMimeType(T.mimeType)&&(t.disableLogs||console.warn("MediaRecorder API seems unable to record mimeType:",T.mimeType)),d.ondataavailable=function(C){if(C.data&&I.push("ondataavailable: "+Oe(C.data.size)),"number"!=typeof t.timeSlice)!C.data||!C.data.size||C.data.size<100||v.blob?v.recordingCallback&&(v.recordingCallback(new Blob([],{type:l(T)})),v.recordingCallback=null):(v.blob=t.getNativeBlob?C.data:new Blob([C.data],{type:l(T)}),v.recordingCallback&&(v.recordingCallback(v.blob),v.recordingCallback=null));else if(C.data&&C.data.size&&(p.push(C.data),f(),"function"==typeof t.ondataavailable)){var b=t.getNativeBlob?C.data:new Blob([C.data],{type:l(T)});t.ondataavailable(b)}},d.onstart=function(){I.push("started")},d.onpause=function(){I.push("paused")},d.onresume=function(){I.push("resumed")},d.onstop=function(){I.push("stopped")},d.onerror=function(C){C&&(C.name||(C.name="UnknownError"),I.push("error: "+C),t.disableLogs||(-1!==C.name.toString().toLowerCase().indexOf("invalidstate")?console.error("The MediaRecorder is not in a state in which the proposed operation is allowed to be executed.",C):-1!==C.name.toString().toLowerCase().indexOf("notsupported")?console.error("MIME type (",T.mimeType,") is not supported.",C):-1!==C.name.toString().toLowerCase().indexOf("security")?console.error("MediaRecorder security error",C):"OutOfMemory"===C.name?console.error("The UA has exhaused the available memory. User agents SHOULD provide as much additional information as possible in the message attribute.",C):"IllegalStreamModification"===C.name?console.error("A modification to the stream has occurred that makes it impossible to continue recording. An example would be the addition of a Track
1while recording is occurring. User agents SHOULD provide as much additional information as possible in the message attribute.",C):"OtherRecordingError"===C.name?console.error("Used for an fatal error other than those listed above. User agents SHOULD provide as much additional information as possible in the message attribute.",C):"GenericError"===C.name?console.error("The UA cannot provide the codec or recording option that has been requested.",C):console.error("MediaRecorder Error",C)),function(b){if(!v.manuallyStopped&&d&&"inactive"===d.state)return delete t.timeslice,void d.start(6e5);setTimeout(void 0,1e3)}(),"inactive"!==d.state&&"stopped"!==d.state&&d.stop())},"number"==typeof t.timeSlice?(f(),d.start(t.timeSlice)):d.start(36e5),t.initCallback&&t.initCallback()},this.timestamps=[],this.stop=function(T){T=T||function(){},v.manuallyStopped=!0,d&&(this.recordingCallback=T,"recording"===d.state&&d.stop(),"number"==typeof t.timeSlice&&setTimeout(function(){v.blob=new Blob(p,{type:l(t)}),v.recordingCallback(v.blob)},100))},this.pause=function(){d&&"recording"===d.state&&d.pause()},this.resume=function(){d&&"paused"===d.state&&d.resume()},this.clearRecordedData=function(){d&&"recording"===d.state&&v.stop(m),m()},this.getInternalRecorder=function(){return d},this.blob=null,this.getState=function(){return d&&d.state||"inactive"};var I=[];this.getAllStates=function(){return I},typeof t.checkForInactiveTracks>"u"&&(t.checkForInactiveTracks=!1),v=this,function T(){if(d&&!1!==t.checkForInactiveTracks){if(!1===function w(){if("active"in a){if(!a.active)return!1}else if("ended"in a&&a.ended)return!1;return!0}())return t.disableLogs||console.log("MediaStream seems stopped."),void v.stop();setTimeout(T,1e3)}}(),this.name="MediaStreamRecorder",this.toString=function(){return this.name}}function Ie(a,t){if(!N(a,"audio").length)throw"Your stream has no audio tracks.";var d,r=this,p=[],f=[],l=!1,m=0,w=2,I=(t=t||{}).desiredSampRate;function v(){if(!1===t.checkForInactiveTracks)return!0;if("active"in a){if(!a.active)return!1}else if("ended"in a&&a.ended)return!1;return!0}function T(k,H){function W(j,be){var o,te=j.numberOfAudioChannels,G=j.leftBuffers.slice(0),ue=j.rightBuffers.slice(0),ie=j.sampleRate,se=j.internalInterleavedLength,Q=j.desiredSampRate;function fe(E,he,re){var ae=Math.round(E.length*(he/re)),K=[],ve=Number((E.length-1)/(ae-1));K[0]=E[0];for(var Ae=1;Ae<ae-1;Ae++){var je=Ae*ve,He=Number(Math.floor(je)).toFixed(),Je=Number(Math.ceil(je)).toFixed();K[Ae]=Fe(E[He],E[Je],je-He)}return K[ae-1]=E[E.length-1],K}function Fe(E,he,re){return E+(he-E)*re}function Ze(E,he){for(var re=new Float64Array(he),ae=0,K=E.length,ve=0;ve<K;ve++){var Ae=E[ve];re.set(Ae,ae),ae+=Ae.length}return re}function Le(E,he,re){for(var ae=re.length,K=0;K<ae;K++)E.setUint8(he+K,re.charCodeAt(K))}2===te&&(G=Ze(G,se),ue=Ze(ue,se),Q&&(G=fe(G,Q,ie),ue=fe(ue,Q,ie))),1===te&&(G=Ze(G,se),Q&&(G=fe(G,Q,ie))),Q&&(ie=Q),2===te&&(o=function ze(E,he){for(var re=E.length+he.length,ae=new Float64Array(re),K=0,ve=0;ve<re;)ae[ve++]=E[K],ae[ve++]=he[K],K++;return ae}(G,ue)),1===te&&(o=G);var M=o.length,n=new ArrayBuffer(44+2*M),s=new DataView(n);Le(s,0,"RIFF"),s.setUint32(4,36+2*M,!0),Le(s,8,"WAVE"),Le(s,12,"fmt "),s.setUint32(16,16,!0),s.setUint16(20,1,!0),s.setUint16(22,te,!0),s.setUint32(24,ie,!0),s.setUint32(28,ie*te*2,!0),s.setUint16(32,2*te,!0),s.setUint16(34,16,!0),Le(s,36,"data"),s.setUint32(40,2*M,!0);for(var A=M,Z=44,ne=0;ne<A;ne++)s.setInt16(Z,32767*o[ne],!0),Z+=2;if(be)return be({buffer:n,view:s});postMessage({buffer:n,view:s})}if(k.noWorker)W(k,function(j){H(j.buffer,j.view)});else{var pe=function C(k){var H=z.createObjectURL(new Blob([k.toString(),";this.onmessage = function (eee) {"+k.name+"(eee.data);}"],{type:"application/javascript"})),W=new Worker(H);return W.workerURL=H,W}(W);pe.onmessage=function(j){H(j.data.buffer,j.data.view),z.revokeObjectURL(pe.workerURL),pe.terminate()},pe.postMessage(k)}}!0===t.leftChannel&&(w=1),1===t.numberOfAudioChannels&&(w=1),(!w||w<1)&&(w=2),t.disableLogs||console.log("StereoAudioRecorder is set to record number of channels: "+w),typeof t.checkForInactiveTracks>"u"&&(t.checkForInactiveTracks=!0),this.record=function(){if(!1===v())throw"Please make sure MediaStream is active.";x(),u=h=!1,l=!0,typeof t.timeSlice<"u"&&F()},this.stop=function(k){k=k||function(){}
1,l=!1,T({desiredSampRate:I,sampleRate:y,numberOfAudioChannels:w,internalInterleavedLength:m,leftBuffers:p,rightBuffers:1===w?[]:f,noWorker:t.noWorker},function(H,W){r.blob=new Blob([W],{type:"audio/wav"}),r.buffer=new ArrayBuffer(W.buffer.byteLength),r.view=W,r.sampleRate=I||y,r.bufferSize=P,r.length=m,u=!1,k&&k(r.blob)})},typeof U.Storage>"u"&&(U.Storage={AudioContextConstructor:null,AudioContext:window.AudioContext||window.webkitAudioContext}),(!U.Storage.AudioContextConstructor||"closed"===U.Storage.AudioContextConstructor.state)&&(U.Storage.AudioContextConstructor=new U.Storage.AudioContext);var b=U.Storage.AudioContextConstructor,g=b.createMediaStreamSource(a),L=[0,256,512,1024,2048,4096,8192,16384],P=typeof t.bufferSize>"u"?4096:t.bufferSize;if(-1===L.indexOf(P)&&(t.disableLogs||console.log("Legal values for buffer-size are "+JSON.stringify(L,null,"\t"))),b.createJavaScriptNode)d=b.createJavaScriptNode(P,w,w);else{if(!b.createScriptProcessor)throw"WebAudio API has no support on this browser.";d=b.createScriptProcessor(P,w,w)}g.connect(d),t.bufferSize||(P=d.bufferSize);var y=typeof t.sampleRate<"u"?t.sampleRate:b.sampleRate||44100;(y<22050||y>96e3)&&(t.disableLogs||console.log("sample-rate must be under range 22050 and 96000.")),t.disableLogs||t.desiredSampRate&&console.log("Desired sample-rate: "+t.desiredSampRate);var h=!1;function x(){f=[],m=0,u=!1,l=!1,h=!1,b=null,r.leftchannel=p=[],r.rightchannel=f,r.numberOfAudioChannels=w,r.desiredSampRate=I,r.sampleRate=y,r.recordingLength=m,S={left:[],right:[],recordingLength:0}}function c(){d&&(d.onaudioprocess=null,d.disconnect(),d=null),g&&(g.disconnect(),g=null),x()}this.pause=function(){h=!0},this.resume=function(){if(!1===v())throw"Please make sure MediaStream is active.";if(!l)return t.disableLogs||console.log("Seems recording has been restarted."),void this.record();h=!1},this.clearRecordedData=function(){t.checkForInactiveTracks=!1,l&&this.stop(c),c()},this.name="StereoAudioRecorder",this.toString=function(){return this.name};var u=!1;d.onaudioprocess=function R(k){if(!h){if(!1===v()&&(t.disableLogs||console.log("MediaStream seems stopped."),d.disconnect(),l=!1),!l)return void(g&&(g.disconnect(),g=null));u||(u=!0,t.onAudioProcessStarted&&t.onAudioProcessStarted(),t.initCallback&&t.initCallback());var H=k.inputBuffer.getChannelData(0),W=new Float32Array(H);if(p.push(W),2===w){var pe=k.inputBuffer.getChannelData(1),j=new Float32Array(pe);f.push(j)}r.recordingLength=m+=P,typeof t.timeSlice<"u"&&(S.recordingLength+=P,S.left.push(W),2===w&&S.right.push(j))}},d.connect(b.createMediaStreamDestination?b.createMediaStreamDestination():b.destination),this.leftchannel=p,this.rightchannel=f,this.numberOfAudioChannels=w,this.desiredSampRate=I,this.sampleRate=y,r.recordingLength=m;var S={left:[],right:[],recordingLength:0};function F(){!l||"function"!=typeof t.ondataavailable||typeof t.timeSlice>"u"||(S.left.length?(T({desiredSampRate:I,sampleRate:y,numberOfAudioChannels:w,internalInterleavedLength:S.recordingLength,leftBuffers:S.left,rightBuffers:1===w?[]:S.right},function(k,H){var W=new Blob([H],{type:"audio/wav"});t.ondataavailable(W),setTimeout(F,t.timeSlice)}),S={left:[],right:[],recordingLength:0}):setTimeout(F,t.timeSlice))}}function Re(a,t){if(typeof html2canvas>"u")throw"Please link: https://www.webrtc-experiment.com/screenshot.js";(t=t||{}).frameInterval||(t.frameInterval=10);var r=!1;["captureStream","mozCaptureStream","webkitCaptureStream"].forEach(function(L){L in document.createElement("canvas")&&(r=!0)});var m,d,w,p=!(!window.webkitRTCPeerConnection&&!window.webkitGetUserMedia||!window.chrome),f=50,l=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);if(p&&l&&l[2]&&(f=parseInt(l[2],10)),p&&f<52&&(r=!1),t.useWhammyRecorder&&(r=!1),r)if(t.disableLogs||console.log("Your browser supports both MediRecorder API and canvas.captureStream!"),a instanceof HTMLCanvasElement)m=a;else{if(!(a instanceof CanvasRenderingContext2D))throw"Please pass either HTMLCanvasElement or CanvasRenderingContext2D.";m=a.canvas}else navigator.mozGetUserMedia&&(t.disableLogs||console.error("Canvas recording is NOT supported in Firefox."));this.record=function(){if(w=!0,r&&!t.useWhammyRecorder){var L;"captureStream"in m?L=m.captureStream(25):"mozCaptureStream"in m?L=m.mozCaptureStream(25):"webkitCaptureStream"in m&&(L=m.webkitCaptureStream(25));try{var P=new $;P.addTrack(N(L,"video")[0]),L=P}catch{}if(!L)throw"captureStream API are NOT available.";(d=new Y(L,{mimeType:t.mimeType||"video/webm"})).record()}else g.frames=[],b=(new Date).getTime(),C();t.initCallback&&t.initCallback()},this.getWebPImages=function(L){if("canvas"===a.nodeName.toLowerCase()){var P=g.frames.length;
1g.frames.forEach(function(y,h){var x=P-h;t.disableLogs||console.log(x+"/"+P+" frames remaining"),t.onEncodingCallback&&t.onEncodingCallback(x,P);var c=y.image.toDataURL("image/webp",1);g.frames[h].image=c}),t.disableLogs||console.log("Generating WebM"),L()}else L()},this.stop=function(L){w=!1;var P=this;r&&d?d.stop(L):this.getWebPImages(function(){g.compile(function(y){t.disableLogs||console.log("Recording finished!"),P.blob=y,P.blob.forEach&&(P.blob=new Blob([],{type:"video/webm"})),L&&L(P.blob),g.frames=[]})})};var I=!1;function v(){g.frames=[],w=!1,I=!1}function T(){var L=document.createElement("canvas"),P=L.getContext("2d");return L.width=a.width,L.height=a.height,P.drawImage(a,0,0),L}function C(){if(I)return b=(new Date).getTime(),setTimeout(C,500);if("canvas"===a.nodeName.toLowerCase()){var L=(new Date).getTime()-b;return b=(new Date).getTime(),g.frames.push({image:T(),duration:L}),void(w&&setTimeout(C,t.frameInterval))}html2canvas(a,{grabMouse:typeof t.showMousePointer>"u"||t.showMousePointer,onrendered:function(P){var y=(new Date).getTime()-b;if(!y)return setTimeout(C,t.frameInterval);b=(new Date).getTime(),g.frames.push({image:P.toDataURL("image/webp",1),duration:y}),w&&setTimeout(C,t.frameInterval)}})}this.pause=function(){I=!0,d instanceof Y&&d.pause()},this.resume=function(){I=!1,d instanceof Y?d.resume():w||this.record()},this.clearRecordedData=function(){w&&this.stop(v),v()},this.name="CanvasRecorder",this.toString=function(){return this.name};var b=(new Date).getTime(),g=new X.Video(100)}function Ue(a,t){function r(b){b=typeof b<"u"?b:10;var g=(new Date).getTime()-T;return g?m?(T=(new Date).getTime(),setTimeout(r,100)):(T=(new Date).getTime(),v.paused&&v.play(),I.drawImage(v,0,0,w.width,w.height),C.frames.push({duration:g,image:w.toDataURL("image/webp")}),void(l||setTimeout(r,b,b))):setTimeout(r,b,b)}(t=t||{}).frameInterval||(t.frameInterval=10),t.disableLogs||console.log("Using frames-interval:",t.frameInterval),this.record=function(){t.width||(t.width=320),t.height||(t.height=240),t.video||(t.video={width:t.width,height:t.height}),t.canvas||(t.canvas={width:t.width,height:t.height}),w.width=t.canvas.width||320,w.height=t.canvas.height||240,I=w.getContext("2d"),t.video&&t.video instanceof HTMLVideoElement?(v=t.video.cloneNode(),t.initCallback&&t.initCallback()):(v=document.createElement("video"),Ee(a,v),v.onloadedmetadata=function(){t.initCallback&&t.initCallback()},v.width=t.video.width,v.height=t.video.height),v.muted=!0,v.play(),T=(new Date).getTime(),C=new X.Video,t.disableLogs||(console.log("canvas resolutions",w.width,"*",w.height),console.log("video width/height",v.width||w.width,"*",v.height||w.height)),r(t.frameInterval)};var l=!1;this.stop=function(b){b=b||function(){},l=!0;var g=this;setTimeout(function(){!function f(b,g,L,P,y){var h=document.createElement("canvas");h.width=w.width,h.height=w.height;var x=h.getContext("2d"),c=[],u=-1===g,R=g&&g>0&&g<=b.length?g:b.length,F=Math.sqrt(Math.pow(255,2)+Math.pow(255,2)+Math.pow(255,2)),k=L&&L>=0&&L<=1?L:0,H=P&&P>=0&&P<=1?P:0,W=!1;!function p(b){var g=-1,L=b.length;!function P(){++g!==L?setTimeout(function(){b.functionToLoop(P,g)},1):b.callback()}()}({length:R,functionToLoop:function(pe,j){var be,te,G,ue=function(){!W&&G-be<=G*H||(u&&(W=!0),c.push(b[j])),pe()};if(W)ue();else{var ie=new Image;ie.onload=function(){x.drawImage(ie,0,0,w.width,w.height);var se=x.getImageData(0,0,w.width,w.height);be=0,te=se.data.length,G=se.data.length/4;for(var Q=0;Q<te;Q+=4){var fe={r:se.data[Q],g:se.data[Q+1],b:se.data[Q+2]};Math.sqrt(Math.pow(fe.r-0,2)+Math.pow(fe.g-0,2)+Math.pow(fe.b-0,2))<=F*k&&be++}ue()},ie.src=b[j].image}},callback:function(){(c=c.concat(b.slice(R))).length<=0&&c.push(b[b.length-1]),y(c)}})}(C.frames,-1,null,null,function(L){C.frames=L,t.advertisement&&t.advertisement.length&&(C.frames=t.advertisement.concat(C.frames)),C.compile(function(P){g.blob=P,g.blob.forEach&&(g.blob=new Blob([],{type:"video/webm"})),b&&b(g.blob)})})},10)};var m=!1;function d(){C.frames=[],l=!0,m=!1}this.pause=function(){m=!0},this.resume=function(){m=!1,l&&this.record()},this.clearRecordedData=function(){l||this.stop(d),d()},this.name="WhammyRecorder",this.toString=function(){return this.name};var v,T,C,w=document.createElement("canvas"),I=w.getContext("2d")}typeof le<"u"?we.AudioContext=le:typeof webkitAudioContext<"u"&&(we.AudioContext=webkitAudioContext),U.Storage=we,U.MediaStreamRecorder=Y,U.StereoAudioRecorder=Ie,U.CanvasRecorder=Re,U.WhammyRecorder=Ue;var X=function(){function a(p){this.frames=[],this.duration=p||1,this.qual
1ity=.8}function r(p){function l(h,x,c){return[{data:h,id:231}].concat(c.map(function(u){var R=function C(h){var x=0;if(h.keyframe&&(x|=128),h.invisible&&(x|=8),h.lacing&&(x|=h.lacing<<1),h.discardable&&(x|=1),h.trackNum>127)throw"TrackNumber > 127 not supported";var c=[128|h.trackNum,h.timecode>>8,255&h.timecode,x].map(function(u){return String.fromCharCode(u)}).join("")+h.frame;return c}({discardable:0,frame:u.data.slice(4),invisible:0,keyframe:1,lacing:0,trackNum:1,timecode:Math.round(x)});return x+=u.duration,{data:R,id:163}}))}function d(h){for(var x=[];h>0;)x.push(255&h),h>>=8;return new Uint8Array(x.reverse())}function w(h){return new Uint8Array(h.split("").map(function(x){return x.charCodeAt(0)}))}function I(h){var x=[];h=(h.length%8?new Array(9-h.length%8).join("0"):"")+h;for(var u=0;u<h.length;u+=8)x.push(parseInt(h.substr(u,8),2));return new Uint8Array(x)}function v(h){for(var x=[],c=0;c<h.length;c++){var u=h[c].data;"object"==typeof u&&(u=v(u)),"number"==typeof u&&(u=I(u.toString(2))),"string"==typeof u&&(u=w(u));var R=u.size||u.byteLength||u.length,S=Math.ceil(Math.ceil(Math.log(R)/Math.log(2))/8),F=R.toString(2),k=new Array(7*S+7+1-F.length).join("0")+F,H=new Array(S).join("0")+"1"+k;x.push(d(h[c].id)),x.push(I(H)),x.push(u)}return new Blob(x,{type:"video/webm"})}function g(h,x){return parseInt(h.substr(x+4,4).split("").map(function(c){var u=c.charCodeAt(0).toString(2);return new Array(8-u.length+1).join("0")+u}).join(""),2)}function L(h){for(var x=0,c={};x<h.length;){var u=h.substr(x,4),R=g(h,x),S=h.substr(x+4+4,R);x+=8+R,c[u]=c[u]||[],c[u].push("RIFF"===u||"LIST"===u?L(S):S)}return c}function P(h){return[].slice.call(new Uint8Array(new Float64Array([h]).buffer),0).map(function(x){return String.fromCharCode(x)}).reverse().join("")}var y=new function f(h){var x=function m(h){if(h[0]){for(var x=h[0].width,c=h[0].height,u=h[0].duration,R=1;R<h.length;R++)u+=h[R].duration;return{duration:u,width:x,height:c}}postMessage({error:"Something went wrong. Maybe WebP format is not supported in the current browser."})}(h);if(!x)return[];for(var u=[{id:440786851,data:[{data:1,id:17030},{data:1,id:17143},{data:4,id:17138},{data:8,id:17139},{data:"webm",id:17026},{data:2,id:17031},{data:2,id:17029}]},{id:408125543,data:[{id:357149030,data:[{data:1e6,id:2807729},{data:"whammy",id:19840},{data:"whammy",id:22337},{data:P(x.duration),id:17545}]},{id:374648427,data:[{id:174,data:[{data:1,id:215},{data:1,id:29637},{data:0,id:156},{data:"und",id:2274716},{data:"V_VP8",id:134},{data:"VP8",id:2459272},{data:1,id:131},{id:224,data:[{data:x.width,id:176},{data:x.height,id:186}]}]}]}]}],R=0,S=0;R<h.length;){var F=[],k=0;do{F.push(h[R]),k+=h[R].duration,R++}while(R<h.length&&k<3e4);var W={id:524531317,data:l(S,0,F)};u[1].data.push(W),S+=k}return v(u)}(p.map(function(h){var x=function b(h){for(var x=h.RIFF[0].WEBP[0],c=x.indexOf("\x9d\x01*"),u=0,R=[];u<4;u++)R[u]=x.charCodeAt(c+3+u);return{width:16383&(R[1]<<8|R[0]),height:16383&(R[3]<<8|R[2]),data:x,riff:h}}(L(atob(h.image.slice(23))));return x.duration=h.duration,x}));postMessage(y)}return a.prototype.add=function(p,f){if("canvas"in p&&(p=p.canvas),"toDataURL"in p&&(p=p.toDataURL("image/webp",this.quality)),!/^data:image\/webp;base64,/gi.test(p))throw"Input must be formatted properly as a base64 encoded DataURI of type image/webp";this.frames.push({image:p,duration:f||this.duration})},a.prototype.compile=function(p){var f=function t(p){var f=z.createObjectURL(new Blob([p.toString(),"this.onmessage = function (eee) {"+p.name+"(eee.data);}"],{type:"application/javascript"})),l=new Worker(f);return z.revokeObjectURL(f),l}(r);f.onmessage=function(l){l.data.error?console.error(l.data.error):p(l.data)},f.postMessage(this.frames)},{Video:a}}();U.Whammy=X;var D={init:function(){var a=this;if(typeof indexedDB>"u"||typeof indexedDB.open>"u")console.error("IndexedDB API are not available in this browser.");else{var p,r=this.dbName||location.href.replace(/\/|:|#|%|\.|\[|\]/g,""),f=indexedDB.open(r,1);f.onerror=a.onError,f.onsuccess=function(){(p=f.result).onerror=a.onError,p.setVersion&&1!==p.version?p.setVersion(1).onsuccess=function(){l(p),m()}:m()},f.onupgradeneeded=function(d){l(d.target.result)}}function l(d){d.createObjectStore(a.dataStoreName)}function m(){var d=p.transaction([a.dataStoreName],"readwrite");function w(I){d.objectStore(a.dataStoreName).get(I).onsuccess=function(v){a.callback&&a.callback(v.target.result,I)}}a.videoBlob&&d.objectStore(a.dataStoreName).put(a.videoBlob,"videoBlob"),a.gifBlob&&d.objectStore(a.dataStoreName).put(a.gifBlob,"gifBlob"),a.audioBlob&&d.objectStore(a.dataStoreName).put(a.audioBlob,"audio
1Blob"),w("audioBlob"),w("videoBlob"),w("gifBlob")}},Fetch:function(a){return this.callback=a,this.init(),this},Store:function(a){return this.audioBlob=a.audioBlob,this.videoBlob=a.videoBlob,this.gifBlob=a.gifBlob,this.init(),this},onError:function(a){console.error(JSON.stringify(a,null,"\t"))},dataStoreName:"recordRTC",dbName:null};function ee(a,t){if(typeof GIFEncoder>"u"){var r=document.createElement("script");r.src="https://www.webrtc-experiment.com/gif-recorder.js",(document.body||document.documentElement).appendChild(r)}t=t||{};var p=a instanceof CanvasRenderingContext2D||a instanceof HTMLCanvasElement;this.record=function(){typeof GIFEncoder>"u"?setTimeout(L.record,1e3):w?(p||(t.width||(t.width=I.offsetWidth||320),t.height||(t.height=I.offsetHeight||240),t.video||(t.video={width:t.width,height:t.height}),t.canvas||(t.canvas={width:t.width,height:t.height}),m.width=t.canvas.width||320,m.height=t.canvas.height||240,I.width=t.video.width||320,I.height=t.video.height||240),(g=new GIFEncoder).setRepeat(0),g.setDelay(t.frameRate||200),g.setQuality(t.quality||10),g.start(),"function"==typeof t.onGifRecordingStarted&&t.onGifRecordingStarted(),Date.now(),v=_(function P(y){if(!0!==L.clearedRecordedData){if(f)return setTimeout(function(){P(y)},100);v=_(P),void 0===typeof b&&(b=y),!(y-b<90)&&(!p&&I.paused&&I.play(),p||d.drawImage(I,0,0,m.width,m.height),t.onGifPreview&&t.onGifPreview(m.toDataURL("image/png")),g.addFrame(d),b=y)}}),t.initCallback&&t.initCallback()):setTimeout(L.record,1e3)},this.stop=function(P){P=P||function(){},v&&B(v),Date.now(),this.blob=new Blob([new Uint8Array(g.stream().bin)],{type:"image/gif"}),P(this.blob),g.stream().bin=[]};var f=!1;this.pause=function(){f=!0},this.resume=function(){f=!1},this.clearRecordedData=function(){L.clearedRecordedData=!0,function l(){g&&(g.stream().bin=[])}()},this.name="GifRecorder",this.toString=function(){return this.name};var m=document.createElement("canvas"),d=m.getContext("2d");p&&(a instanceof CanvasRenderingContext2D?m=(d=a).canvas:a instanceof HTMLCanvasElement&&(d=a.getContext("2d"),m=a));var w=!0;if(!p){var I=document.createElement("video");I.muted=!0,I.autoplay=!0,I.playsInline=!0,w=!1,I.onloadedmetadata=function(){w=!0},Ee(a,I),I.play()}var b,g,v=null,L=this}function Ne(a,t){typeof global<"u"&&global,t=t||"multi-streams-mixer";var p=[],f=!1,l=document.createElement("canvas"),m=l.getContext("2d");l.style.opacity=0,l.style.position="absolute",l.style.zIndex=-1,l.style.top="-1000em",l.style.left="-1000em",l.className=t,(document.body||document.documentElement).appendChild(l),this.disableLogs=!1,this.frameInterval=10,this.width=360,this.height=240,this.useGainNode=!0;var d=this,w=window.AudioContext;typeof w>"u"&&(typeof webkitAudioContext<"u"&&(w=webkitAudioContext),typeof mozAudioContext<"u"&&(w=mozAudioContext));var I=window.URL;typeof I>"u"&&typeof webkitURL<"u"&&(I=webkitURL),typeof navigator<"u"&&typeof navigator.getUserMedia>"u"&&(typeof navigator.webkitGetUserMedia<"u"&&(navigator.getUserMedia=navigator.webkitGetUserMedia),typeof navigator.mozGetUserMedia<"u"&&(navigator.getUserMedia=navigator.mozGetUserMedia));var v=window.MediaStream;typeof v>"u"&&typeof webkitMediaStream<"u"&&(v=webkitMediaStream),typeof v<"u"&&typeof v.prototype.stop>"u"&&(v.prototype.stop=function(){this.getTracks().forEach(function(c){c.stop()})});var T={};function b(){if(!f){var c=p.length,u=!1,R=[];if(p.forEach(function(F){F.stream||(F.stream={}),F.stream.fullcanvas?u=F:R.push(F)}),u)l.width=u.stream.width,l.height=u.stream.height;else if(R.length){l.width=c>1?2*R[0].width:R[0].width;var S=1;(3===c||4===c)&&(S=2),(5===c||6===c)&&(S=3),(7===c||8===c)&&(S=4),(9===c||10===c)&&(S=5),l.height=R[0].height*S}else l.width=d.width||360,l.height=d.height||240;u&&u instanceof HTMLVideoElement&&g(u),R.forEach(function(F,k){g(F,k)}),setTimeout(b,d.frameInterval)}}function g(c,u){if(!f){var R=0,S=0,F=c.width,k=c.height;1===u&&(R=c.width),2===u&&(S=c.height),3===u&&(R=c.width,S=c.height),4===u&&(S=2*c.height),5===u&&(R=c.width,S=2*c.height),6===u&&(S=3*c.height),7===u&&(R=c.width,S=3*c.height),typeof c.stream.left<"u"&&(R=c.stream.left),typeof c.stream.top<"u"&&(S=c.stream.top),typeof c.stream.width<"u"&&(F=c.stream.width),typeof c.stream.height<"u"&&(k=c.stream.height),m.drawImage(c,R,S,F,k),"function"==typeof c.stream.onRender&&c.stream.onRender(m,R,S,F,k,u)}}function h(c){var u=document.createElement("video");return function C(c,u){"srcObject"in u?u.srcObject=c:"mozSrcObject"in u?u.mozSrcObject=c:u.srcObject=c}(c,u),u.className=t,u.muted=!0,u.volume=0,u.width=c.width||d.width||360,u.height=c.height||d.height||240,u.play(),u}
1function x(c){p=[],(c=c||a).forEach(function(u){if(u.getTracks().filter(function(S){return"video"===S.kind}).length){var R=h(u);R.stream=u,p.push(R)}})}typeof w<"u"?T.AudioContext=w:typeof webkitAudioContext<"u"&&(T.AudioContext=webkitAudioContext),this.startDrawingFrames=function(){b()},this.appendStreams=function(c){if(!c)throw"First parameter is required.";c instanceof Array||(c=[c]),c.forEach(function(u){var R=new v;if(u.getTracks().filter(function(k){return"video"===k.kind}).length){var S=h(u);S.stream=u,p.push(S),R.addTrack(u.getTracks().filter(function(k){return"video"===k.kind})[0])}if(u.getTracks().filter(function(k){return"audio"===k.kind}).length){var F=d.audioContext.createMediaStreamSource(u);d.audioDestination=d.audioContext.createMediaStreamDestination(),F.connect(d.audioDestination),R.addTrack(d.audioDestination.stream.getTracks().filter(function(k){return"audio"===k.kind})[0])}a.push(R)})},this.releaseStreams=function(){p=[],f=!0,d.gainNode&&(d.gainNode.disconnect(),d.gainNode=null),d.audioSources.length&&(d.audioSources.forEach(function(c){c.disconnect()}),d.audioSources=[]),d.audioDestination&&(d.audioDestination.disconnect(),d.audioDestination=null),d.audioContext&&d.audioContext.close(),d.audioContext=null,m.clearRect(0,0,l.width,l.height),l.stream&&(l.stream.stop(),l.stream=null)},this.resetVideoStreams=function(c){c&&!(c instanceof Array)&&(c=[c]),x(c)},this.name="MultiStreamsMixer",this.toString=function(){return this.name},this.getMixedStream=function L(){f=!1;var c=function P(){var c;x(),"captureStream"in l?c=l.captureStream():"mozCaptureStream"in l?c=l.mozCaptureStream():d.disableLogs||console.error("Upgrade to latest Chrome or otherwise enable this flag: chrome://flags/#enable-experimental-web-platform-features");var u=new v;return c.getTracks().filter(function(R){return"video"===R.kind}).forEach(function(R){u.addTrack(R)}),l.stream=u,u}(),u=function y(){T.AudioContextConstructor||(T.AudioContextConstructor=new T.AudioContext),d.audioContext=T.AudioContextConstructor,d.audioSources=[],!0===d.useGainNode&&(d.gainNode=d.audioContext.createGain(),d.gainNode.connect(d.audioContext.destination),d.gainNode.gain.value=0);var c=0;if(a.forEach(function(u){if(u.getTracks().filter(function(S){return"audio"===S.kind}).length){c++;var R=d.audioContext.createMediaStreamSource(u);!0===d.useGainNode&&R.connect(d.gainNode),d.audioSources.push(R)}}),c)return d.audioDestination=d.audioContext.createMediaStreamDestination(),d.audioSources.forEach(function(u){u.connect(d.audioDestination)}),d.audioDestination.stream}();return u&&u.getTracks().filter(function(S){return"audio"===S.kind}).forEach(function(S){c.addTrack(S)}),a.forEach(function(S){}),c}}function We(a,t){a=a||[];var p,f,r=this;(t=t||{elementClass:"multi-streams-mixer",mimeType:"video/webm",video:{width:360,height:240}}).frameInterval||(t.frameInterval=10),t.video||(t.video={}),t.video.width||(t.video.width=360),t.video.height||(t.video.height=240),this.record=function(){p=new Ne(a,t.elementClass||"multi-streams-mixer"),function l(){var m=[];return a.forEach(function(d){N(d,"video").forEach(function(w){m.push(w)})}),m}().length&&(p.frameInterval=t.frameInterval||10,p.width=t.video.width||360,p.height=t.video.height||240,p.startDrawingFrames()),t.previewStream&&"function"==typeof t.previewStream&&t.previewStream(p.getMixedStream()),(f=new Y(p.getMixedStream(),t)).record()},this.stop=function(m){f&&f.stop(function(d){r.blob=d,m(d),r.clearRecordedData()})},this.pause=function(){f&&f.pause()},this.resume=function(){f&&f.resume()},this.clearRecordedData=function(){f&&(f.clearRecordedData(),f=null),p&&(p.releaseStreams(),p=null)},this.addStreams=function(m){if(!m)throw"First parameter is required.";m instanceof Array||(m=[m]),a.concat(m),f&&p&&(p.appendStreams(m),t.previewStream&&"function"==typeof t.previewStream&&t.previewStream(p.getMixedStream()))},this.resetVideoStreams=function(m){p&&(m&&!(m instanceof Array)&&(m=[m]),p.resetVideoStreams(m))},this.getMixer=function(){return p},this.name="MultiStreamRecorder",this.toString=function(){return this.name}}
1function me(a,t){var p,l,d;function m(v,T){if(!t.workerPath&&!T)return p=!1,void fetch("https://unpkg.com/webm-wasm@latest/dist/webm-worker.js").then(function(b){b.arrayBuffer().then(function(g){m(v,g)})});if(!t.workerPath&&T instanceof ArrayBuffer){var C=new Blob([T],{type:"text/javascript"});t.workerPath=z.createObjectURL(C)}t.workerPath||console.error("workerPath parameter is missing."),(l=new Worker(t.workerPath)).postMessage(t.webAssemblyPath||"https://unpkg.com/webm-wasm@latest/dist/webm-wasm.wasm"),l.addEventListener("message",function(b){"READY"===b.data?(l.postMessage({width:t.width,height:t.height,bitrate:t.bitrate||1200,timebaseDen:t.frameRate||30,realtime:t.realtime}),function f(){return new ReadableStream({start:function(v){var T=document.createElement("canvas"),C=document.createElement("video"),b=!0;C.srcObject=a,C.muted=!0,C.height=t.height,C.width=t.width,C.volume=0,C.onplaying=function(){T.width=t.width,T.height=t.height;var g=T.getContext("2d"),P=setInterval(function(){if(p&&(clearInterval(P),v.close()),b&&(b=!1,t.onVideoProcessStarted&&t.onVideoProcessStarted()),g.drawImage(C,0,0),"closed"!==v._controlledReadableStream.state)try{v.enqueue(g.getImageData(0,0,t.width,t.height))}catch{}},1e3/t.frameRate)},C.play()}})}().pipeTo(new WritableStream({write:function(g){p?console.error("Got image, but recorder is finished!"):l.postMessage(g.data.buffer,[g.data.buffer])}}))):b.data&&(d||I.push(b.data))})}(typeof ReadableStream>"u"||typeof WritableStream>"u")&&console.error("Following polyfill is strongly recommended: https://unpkg.com/@mattiasbuelens/web-streams-polyfill/dist/polyfill.min.js"),(t=t||{}).width=t.width||640,t.height=t.height||480,t.frameRate=t.frameRate||30,t.bitrate=t.bitrate||1200,t.realtime=t.realtime||!0,this.record=function(){I=[],d=!1,this.blob=null,m(a),"function"==typeof t.initCallback&&t.initCallback()},this.pause=function(){d=!0},this.resume=function(){d=!1};var I=[];this.stop=function(v){p=!0;var T=this;!function w(v){l?(l.addEventListener("message",function(T){null===T.data&&(l.terminate(),l=null,v&&v())}),l.postMessage(null)):v&&v()}(function(){T.blob=new Blob(I,{type:"video/webm"}),v(T.blob)})},this.name="WebAssemblyRecorder",this.toString=function(){return this.name},this.clearRecordedData=function(){I=[],d=!1,this.blob=null},this.blob=null}U.DiskStorage=D,U.GifRecorder=ee,U.MultiStreamRecorder=We,U.RecordRTCPromisesHandler=function Be(a,t){if(!this)throw'Use "new RecordRTCPromisesHandler()"';if(typeof a>"u")throw'First argument "MediaStream" is required.';var r=this;r.recordRTC=new U(a,t),this.startRecording=function(){return new Promise(function(p,f){try{r.recordRTC.startRecording(),p()}catch(l){f(l)}})},this.stopRecording=function(){return new Promise(function(p,f){try{r.recordRTC.stopRecording(function(l){r.blob=r.recordRTC.getBlob(),r.blob&&r.blob.size?p(l):f("Empty blob.",r.blob)})}catch(l){f(l)}})},this.pauseRecording=function(){return new Promise(function(p,f){try{r.recordRTC.pauseRecording(),p()}catch(l){f(l)}})},this.resumeRecording=function(){return new Promise(function(p,f){try{r.recordRTC.resumeRecording(),p()}catch(l){f(l)}})},this.getDataURL=function(p){return new Promise(function(f,l){try{r.recordRTC.getDataURL(function(m){f(m)})}catch(m){l(m)}})},this.getBlob=function(){return new Promise(function(p,f){try{p(r.recordRTC.getBlob())}catch(l){f(l)}})},this.getInternalRecorder=function(){return new Promise(function(p,f){try{p(r.recordRTC.getInternalRecorder())}catch(l){f(l)}})},this.reset=function(){return new Promise(function(p,f){try{p(r.recordRTC.reset())}catch(l){f(l)}})},this.destroy=function(){return new Promise(function(p,f){try{p(r.recordRTC.destroy())}catch(l){f(l)}})},this.getState=function(){return new Promise(function(p,f){try{p(r.recordRTC.getState())}catch(l){f(l)}})},this.blob=null,this.version="5.6.2"},U.WebAssemblyRecorder=me},58600:(ye,de,O)=>{Object.defineProperty(de,"__esModule",{value:!0});var J=O(23283);J.Observable.interval=J.interval},75262:(ye,de,O)=>{O(58600)},93511:(ye,de,O)=>{O.r(de),O.d(de,{MessagesModule:()=>Le});var J=O(40451),U=O(7976),xe=O(15606),Pe=O(8239),V=O(40783),ke=O(5609),_=O.n(ke),e=O(64537),B=O(15399),le=O(32921),z=O(97556),Se=O(12278);let Ce=(()=>{class o{constructor(i,n){this.httpService=i,this.URLService=n}GetUserWhatsappContract(i=null){return this.httpService.get(this.URLService.GetUserWhatsappContractsURL+(null===i?"":"whatsappContactsId="+i))}GetUsersForMessages(){return this.httpService.get(this.URLService.GetUsersForMessagesWhatsappURL)}GetUserWhatsappContractsHistory(i){return this.httpService.get(this.URLService.GetUserWhatsappContractsHistoryURL+"whatsappContactsId="+i)}AddMessage(i){return this.httpService.post(this.URLService.AddMessageURL,i)}AddWhatsappMessage(i){return this.httpService.post(this.URLService.AddWhatsappMessageURL,i)}StartNewConversation(i){return this.httpService.post(this.URLService.StartwhatsappNewConversationURL+"whatsappContactsId="+i)}}return o.\u0275fac=function(i){return new(i||o)(e.LFG(z.O),e.LFG
1(Se.j))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var _e=O(75629);const ce=["usersList"];let Me=(()=>{class o extends V.H{constructor(i,n,s){super(),this.loaderService=i,this.activeModal=n,this.whatsappService=s,this.whatsappUsersList=Array()}ngOnInit(){this.loaderService.show(),this.whatsappService.GetUsersForMessages().subscribe(i=>{this.loaderService.hide(),i.successed?(this.whatsappUsersList=i.data,this.usersList.focus()):this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError"))},i=>{typeof i.error<"u"&&this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError")),this.loaderService.hide()})}whatsappUsersOnValueChanged(i){this.activeModal.close(i.value)}}return o.\u0275fac=function(i){return new(i||o)(e.Y36(B.D),e.Y36(le.Kz),e.Y36(Ce))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-whatsapp-users"]],viewQuery:function(i,n){if(1&i&&e.Gf(ce,5),2&i){let s;e.iGM(s=e.CRH())&&(n.usersList=s.first)}},features:[e.qOj],decls:13,vars:6,consts:[[1,"modal-header"],["type","button","aria-label","Close",1,"btn-close",2,"cursor","pointer",3,"click"],[1,"modal-body"],[1,"text-danger"],[1,"modal-footer"],["type","button",1,"btn","btn-danger","float-end",3,"click"]],template:function(i,n){1&i&&(e.TgZ(0,"div",0)(1,"button",1),e.NdJ("click",function(){return n.activeModal.close()}),e.qZA()(),e.TgZ(2,"div",2)(3,"label"),e._uU(4),e.ALo(5,"translate"),e.TgZ(6,"span",3),e._uU(7,"*"),e.qZA()(),e._UZ(8,"div"),e.qZA(),e.TgZ(9,"div",4)(10,"button",5),e.NdJ("click",function(){return n.activeModal.close()}),e._uU(11),e.ALo(12,"translate"),e.qZA()()),2&i&&(e.xp6(4),e.hij("",e.lcZ(5,2,"pleaseSelectUser")," "),e.xp6(7),e.Oqu(e.l
1cZ(12,4,"cancel")))},dependencies:[_e.X$],encapsulation:2}),o})();var $=O(35752),Oe=O(34271),oe=O(88692),Te=O(48743),N=O(9638);function Ee(o,M){if(1&o&&e._UZ(0,"img",13),2&o){const i=e.oxw();e.s9C("src",i.photoUrl,e.LSH)}}function De(o,M){if(1&o){const i=e.EpF();e.TgZ(0,"button",14),e.NdJ("click",function(){e.CHM(i);const s=e.oxw();return e.KtG(s.removeCapturedImage())}),e._uU(1),e.ALo(2,"translate"),e.qZA()}2&o&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"removeImage")))}function we(o,M){if(1&o){const i=e.EpF();e.TgZ(0,"i",15),e.NdJ("click",function(){e.CHM(i);const s=e.oxw();return e.KtG(s.startRecordingVideo())}),e.ALo(1,"translate"),e.qZA()}2&o&&e.s9C("title",e.lcZ(1,1,"startRecording"))}function ge(o,M){if(1&o){const i=e.EpF();e.TgZ(0,"i",16),e.NdJ("click",function(){e.CHM(i);const s=e.oxw();return e.KtG(s.stopRecordingVideo())}),e.ALo(1,"translate"),e.qZA()}2&o&&e.s9C("title",e.lcZ(1,1,"stopRecording"))}const Y=function(o,M){return["app",o,M]};let Ie=(()=>{class o extends V.H{constructor(i,n){super(),this.loaderService=i,this.activeModal=n,this.currentActiveType="camera",this.showTakePictureCameraBtn=!0,this.showStartRecordVideoBtn=!1,this.showStopRecordVideoBtn=!1,this.showRemovePictureBtn=!1,this.isRunning=!1,this.disabledAll=!1,this.currentBlobImage=null,this.photoUrl=null}ngOnInit(){this.loaderService.show(),this.showRemovePictureBtn=!1}changeCaptureType(){this.disabledAll||(this.currentActiveType="camera",this.showTakePictureCameraBtn=!0,this.showStartRecordVideoBtn=!1)}setCaptureImage(i){var n=new FileReader;n.readAsDataURL(i),n.onload=s=>{this.photoUrl=s.target.result,this.showRemovePictureBtn=!0,this.showTakePictureCameraBtn=!1,this.currentBlobImage=i,this.disabledAll=!1,this.isRunning=!1}}removeCapturedImage(){this.currentBlobImage=null,this.showRemovePictureBtn=!1,this.showTakePictureCameraBtn=!0,this.photoUrl=null}closeActiveModel(){this.activeModal.close()}saveCaptureData(){this.activeModal.close(this.currentBlobImage)}startRecordingVideo(){this.showStopRecordVideoBtn=!0,this.showStartRecordVideoBtn=!1,this.disabledAll=!0}}return o.\u0275fac=function(i){return new(i||o)(e.Y36(B.D),e.Y36(le.Kz))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-popup-camera"]],features:[e.qOj],decls:17,vars:21,consts:[[1,"modal-header"],["type","button","aria-label","Close",1,"btn-close",2,"cursor","pointer",3,"click"],[1,"modal-body",2,"text-align","center",3,"ngClass"],["loading","lazy","style","width: 400px;height: 400px;",3,"src",4,"ngIf"],[2,"text-align","center"],["type","button","class","m-2","mat-raised-button","","color","primary",3,"click",4,"ngIf"],["class","fal fa-circle","style","font-size: 33px;font-weight: 600;color: red;cursor: pointer;",3,"title","click",4,"ngIf"],["class","fal fa-stop-circle","style","font-size: 33px;font-weight: 600;color: red;cursor: pointer;",3,"title","click",4,"ngIf"],[1,"modal-footer",3,"ngClass"],["type","button","mat-raised-button","","color","success",1,"m-2",3,"disabled","click"],[1,"fal","fa-check","margin-5px-left-right"],["type","button","mat-raised-button","","color","primary",3,"click"],[1,"fal","fa-times","margin-5px-left-right"],["loading","lazy",2,"width","400px","height","400px",3,"src"],["type","button","mat-raised-button","","color","primary",1,"m-2",3,"click"],[1,"fal","fa-circle",2,"font-size","33px","font-weight","600","color","red","cursor","pointer",3,"title","click"],[1,"fal","fa-stop-circle",2,"font-size","33px","font-weight","600","color","red","cursor","pointer",3,"title","click"]],template:function(i,n){1&i&&(e.TgZ(0,"div",0)(1,"button",1),e.NdJ("click",function(){return n.closeActiveModel()}),e.qZA()(),e.TgZ(2,"div",2),e.YNc(3,Ee,1,1,"img",3),e.TgZ(4,"div",4),e.YNc(5,De,3,3,"button",5),e.YNc(6,we,2,3,"i",6),e.YNc(7,ge,2,3,"i",7),e.qZA()(),e.TgZ(8,"div",8)(9,"button",9),e.NdJ("click",function(){return n.saveCaptureData()}),e._UZ(10,"i",10),e._uU(11),e.ALo(12,"translate"),e.qZA(),e.TgZ(13,"button",11),e.NdJ("click",function(){return n.closeActiveModel()}),e._UZ(14,"i",12),e._uU(15),e.ALo(16,"translate"),e.qZA()()),2&i&&(e.xp6(2),e.Q6J("ngClass",e.WLB(15,Y,n.settings.theme,"toolbar-"+n.settings.toolbar)),e.xp6(1),e.Q6J("ngIf",n.showRemovePictureBtn),e.xp6(2),e.Q6J("ngIf",n.showRemovePictureBtn),e.xp6(1),e.Q6J("ngIf",n.showStartRecordVideoBtn),e.xp6(1),e.Q6J("ngIf",n.showStopRecordVideoBtn),e.xp6(1),e.Q6J("ngClass",e.WLB(18,Y,n.settings.theme,"toolbar-"+n.settings.toolbar)),e.xp6(1),e.Q6J("disabled",n.isRunning||n.disabledAll),e.xp6(2),e.Oqu(e.l
1cZ(12,11,"ok")),e.xp6(2),e.ekj("float-end",!0),e.xp6(2),e.Oqu(e.lcZ(16,13,"cancel")))},dependencies:[oe.mk,oe.O5,Te.oO,N.lW,_e.X$],styles:["section[_ngcontent-%COMP%]{width:70%;margin-left:233px;margin-top:176px}img[_ngcontent-%COMP%]{border-radius:8px}.inputfile[_ngcontent-%COMP%] + label[_ngcontent-%COMP%]{font-size:1.25em;font-weight:700;color:#fff;background-color:#000;display:inline-block}.inputfile[_ngcontent-%COMP%]:focus + label[_ngcontent-%COMP%], .inputfile[_ngcontent-%COMP%] + label[_ngcontent-%COMP%]:hover{background-color:red}"]}),o})();const Re=function(o,M){return["app",o,M]};let Ue=(()=>{class o extends V.H{constructor(i){super(),this.activeModal=i,this.photoUrl=null}ngOnInit(){}closeActiveModel(){this.activeModal.close()}}return o.\u0275fac=function(i){return new(i||o)(e.Y36(le.Kz))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-popup-image"]],features:[e.qOj],decls:9,vars:14,consts:[[1,"modal-header"],["type","button","aria-label","Close",1,"btn-close",2,"cursor","pointer",3,"click"],[1,"modal-body",2,"text-align","center",3,"ngClass"],["loading","lazy",2,"height","350px","max-width","100%",3,"src"],[1,"modal-footer",3,"ngClass"],["type","button","mat-raised-button","","color","primary",3,"click"],[1,"fal","fa-times","margin-5px-left-right"]],template:function(i,n){1&i&&(e.TgZ(0,"div",0)(1,"button",1),e.NdJ("click",function(){return n.closeActiveModel()}),e.qZA()(),e.TgZ(2,"div",2),e._UZ(3,"img",3),e.qZA(),e.TgZ(4,"div",4)(5,"button",5),e.NdJ("click",function(){return n.closeActiveModel()}),e._UZ(6,"i",6),e._uU(7),e.ALo(8,"translate"),e.qZA()()),2&i&&(e.xp6(2),e.Q6J("ngClass",e.WLB(8,Re,n.settings.theme,"toolbar-"+n.settings.toolbar)),e.xp6(1),e.s9C("src",n.photoUrl,e.LSH),e.xp6(1),e.Q6J("ngClass",e.WLB(11,Re,n.settings.theme,"toolbar-"+n.settings.toolbar)),e.xp6(1),e.ekj("float-end",!0),e.xp6(2),e.Oqu(e.lcZ(8,6,"cancel")))},dependencies:[oe.mk,Te.oO,N.lW,_e.X$],styles:["section[_ngcontent-%COMP%]{width:70%;margin-left:233px;margin-top:176px}img[_ngcontent-%COMP%]{border-radius:8px}.inputfile[_ngcontent-%COMP%] + label[_ngcontent-%COMP%]{font-size:1.25em;font-weight:700;color:#fff;background-color:#000;display:inline-block}.inputfile[_ngcontent-%COMP%]:focus + label[_ngcontent-%COMP%], .inputfile[_ngcontent-%COMP%] + label[_ngcontent-%COMP%]:hover{background-color:red}"]}),o})();var X=(()=>{return(o=X||(X={}))[o.Text=0]="Text",o[o.Attachment=1]="Attachment",o[o.Audio=2]="Audio",o[o.Video=3]="Video",X;var o})(),D=(()=>{return(o=D||(D={}))[o.Incoming=1]="Incoming",o[o.Reply=2]="Reply",D;var o})(),ee=(()=>{return(o=ee||(ee={}))[o.Accepted=1]="Accepted",o[o.Delivered=2]="Delivered",o[o.Failed=3]="Failed",o[o.Queued=4]="Queued",o[o.Read=5]="Read",o[o.Recevied=6]="Recevied",o[o.Sent=7]="Sent",o[o.UnDelivered=8]="UnDelivered",ee;var o})(),We=(O(75262),O(7041)),Be=O(20092),me=O(72257),a=O(11997),t=O(98096),r=O(23425);const p=["contactsList"],f=["whatsappHistoryList"],l=["whatsappCenterAngularFileUploader"],m=["whatsappCenterCameraAngularFileUploader"];function d(o,M){if(1&o&&(e.TgZ(0,"span",33),e._uU(1),e.qZA()),2&o){const i=e.oxw().$implicit;e.xp6(1),e.hij(" ",i.whatsappHistoriesList[i.whatsappHistoriesList.length-1].body," ")}}function w(o,M){1&o&&(e.TgZ(0,"span",30),e._UZ(1,"i",34),e._uU(2),e.ALo(3,"translate"),e.qZA()),2&o&&(e.xp6(2),e.hij("",e.lcZ(3,1,"attachments")," "))}function I(o,M){1&o&&(e.TgZ(0,"span",30),e._UZ(1,"i",35),e._uU(2),e.ALo(3,"translate"),e.qZA()),2&o&&(e.xp6(2),e.hij("",e.lcZ(3,1,"audioRecord")," "))}function v(o,M){1&o&&(e.TgZ(0,"span",30),e._UZ(1,"i",36),e._uU(2),e.ALo(3,"translate"),e.qZA()),2&o&&(e.xp6(2),e.hij("",e.lcZ(3,1,"cameraImage")," "))}const T=function(){return{"background-color":"unset",border:"1px solid #1f4f95"}};function C(o,M){if(1&o){const i=e.EpF();e.TgZ(0,"mat-list-item",23),e.NdJ("click",function(){const A=e.CHM(i).$implicit,Z=e.oxw();return e.KtG(Z.contactsOnSelectionChanged(A))}),e.TgZ(1,"div",24)(2,"div",25),e._UZ(3,"img",26),e.qZA(),e.TgZ(4,"div",27)(5,"span",28),e._uU(6),e.qZA(),e._UZ(7,"br"),e.TgZ(8,"span",29),e._uU(9),e.qZA(),e._UZ(10,"br"),e.TgZ(11,"span",30),e._uU(12),e.qZA(),e._UZ(13,"br"),e.YNc(14,d,2,1,"span",31),e.YNc(15,w,4,3,"span",32),e.YNc(16,I,4,3,"span",32),e.YNc(17,v,4,3,"span",32),e.qZA()()()}if(2&o){const i=M.$implicit,n=e.oxw();
1e.Q6J("ngStyle",e.DdM(10,T)),e.xp6(3),e.s9C("src",i.userImage,e.LSH),e.s9C("title",i.userName),e.xp6(3),e.Oqu(i.userName),e.xp6(3),e.hij("",i.phoneNumber," "),e.xp6(3),e.Oqu(n.formatDateTime(i.lastMessageDate)),e.xp6(2),e.Q6J("ngIf",i.whatsappHistoriesList&&null!==i.whatsappHistoriesList&&i.whatsappHistoriesList.length>0&&i.whatsappHistoriesList[i.whatsappHistoriesList.length-1].messageBodyType===n.MessageBodyTypeEnum.Text),e.xp6(1),e.Q6J("ngIf",i.whatsappHistoriesList&&null!==i.whatsappHistoriesList&&i.whatsappHistoriesList.length>0&&i.whatsappHistoriesList[i.whatsappHistoriesList.length-1].messageBodyType===n.MessageBodyTypeEnum.Attachment),e.xp6(1),e.Q6J("ngIf",i.whatsappHistoriesList&&null!==i.whatsappHistoriesList&&i.whatsappHistoriesList.length>0&&i.whatsappHistoriesList[i.whatsappHistoriesList.length-1].messageBodyType===n.MessageBodyTypeEnum.Audio),e.xp6(1),e.Q6J("ngIf",i.whatsappHistoriesList&&null!==i.whatsappHistoriesList&&i.whatsappHistoriesList.length>0&&i.whatsappHistoriesList[i.whatsappHistoriesList.length-1].messageBodyType===n.MessageBodyTypeEnum.Attachment)}}function b(o,M){1&o&&(e.TgZ(0,"div",37)(1,"div",38),e._UZ(2,"img",39)(3,"br"),e.TgZ(4,"p"),e._uU(5),e.ALo(6,"translate"),e.qZA()()()),2&o&&(e.xp6(5),e.Oqu(e.l
1cZ(6,1,"currentlyNoWhatsapp")))}function g(o,M){1&o&&(e.TgZ(0,"strong",68),e._uU(1,"("),e._UZ(2,"i",69),e._uU(3),e.ALo(4,"translate"),e.qZA()),2&o&&(e.xp6(3),e.hij("",e.lcZ(4,1,"accepted"),")"))}function L(o,M){1&o&&(e.TgZ(0,"strong",68),e._uU(1,"("),e._UZ(2,"i",69),e._uU(3),e.ALo(4,"translate"),e.qZA()),2&o&&(e.xp6(3),e.hij("",e.lcZ(4,1,"delivered"),")"))}function P(o,M){1&o&&(e.TgZ(0,"strong",68),e._uU(1,"("),e._UZ(2,"i",70),e._uU(3),e.ALo(4,"translate"),e.qZA()),2&o&&(e.xp6(3),e.hij("",e.lcZ(4,1,"failed"),")"))}function y(o,M){1&o&&(e.TgZ(0,"strong",68),e._uU(1,"("),e._UZ(2,"i",71),e._uU(3),e.ALo(4,"translate"),e.qZA()),2&o&&(e.xp6(3),e.hij("",e.lcZ(4,1,"queued"),")"))}function h(o,M){1&o&&(e.TgZ(0,"strong",68),e._uU(1,"("),e._UZ(2,"i",72),e._uU(3),e.ALo(4,"translate"),e.qZA()),2&o&&(e.xp6(3),e.hij("",e.lcZ(4,1,"read"),")"))}function x(o,M){1&o&&(e.TgZ(0,"strong",68),e._uU(1,"("),e._UZ(2,"i",69),e._uU(3),e.ALo(4,"translate"),e.qZA()),2&o&&(e.xp6(3),e.hij("",e.lcZ(4,1,"recevied"),")"))}function c(o,M){1&o&&(e.TgZ(0,"strong",68),e._uU(1,"("),e._UZ(2,"i",69),e._uU(3),e.ALo(4,"translate"),e.qZA()),2&o&&(e.xp6(3),e.hij("",e.lcZ(4,1,"sent"),")"))}function u(o,M){1&o&&(e.TgZ(0,"strong",68),e._uU(1,"("),e._UZ(2,"i",70),e._uU(3),e.ALo(4,"translate"),e.qZA()),2&o&&(e.xp6(3),e.hij("",e.lcZ(4,1,"unDelivered"),")"))}function R(o,M){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&o){const i=e.oxw().$implicit;e.xp6(1),e.hij(" ",i.body," ")}}function S(o,M){if(1&o){const i=e.EpF();e.TgZ(0,"img",77),e.NdJ("click",function(){e.CHM(i);const s=e.oxw(2).$implicit,A=e.oxw(2);return e.KtG(A.openPopupImage(s.body))}),e.ALo(1,"translate"),e.qZA()}if(2&o){const i=e.oxw(2).$implicit;e.s9C("src",i.body,e.LSH),e.s9C("title",e.lcZ(1,2,"clickToView"))}}function F(o,M){if(1&o&&(e.TgZ(0,"a",78),e._UZ(1,"i",79),e.ALo(2,"translate"),e.qZA()),2&o){const i=e.oxw(2).$implicit;e.s9C("href",i.body,e.LSH),e.xp6(1),e.s9C("title",e.lcZ(2,2,"clickToDownload"))}}function k(o,M){if(1&o&&(e.TgZ(0,"a",78),e._UZ(1,"i",80),e.ALo(2,"translate"),e.qZA()),2&o){const i=e.oxw(2).$implicit;e.s9C("href",i.body,e.LSH),e.xp6(1),e.s9C("title",e.lcZ(2,2,"clickToDownload"))}}function H(o,M){if(1&o&&(e.TgZ(0,"a",78),e._UZ(1,"i",81),e.ALo(2,"translate"),e.qZA()),2&o){const i=e.oxw(2).$implicit;e.s9C("href",i.body,e.LSH),e.xp6(1),e.s9C("title",e.lcZ(2,2,"clickToDownload"))}}function W(o,M){if(1&o&&(e.TgZ(0,"div",73)(1,"div",74),e.YNc(2,S,2,4,"img",75),e.YNc(3,F,3,4,"a",76),e.YNc(4,k,3,4,"a",76),e.YNc(5,H,3,4,"a",76),e.qZA()()),2&o){const i=e.oxw().$implicit;e.xp6(2),e.Q6J("ngIf",-1!=i.contentType.indexOf("image")),e.xp6(1),e.Q6J("ngIf",-1!=i.contentType.indexOf("excel")),e.xp6(1),e.Q6J("ngIf",-1!=i.contentType.indexOf("pdf")),e.xp6(1),e.Q6J("ngIf",-1!=i.contentType.indexOf("other"))}}function pe(o,M){if(1&o){const i=e.EpF();e.TgZ(0,"audio",82),e.NdJ("play",function(s){e.CHM(i);const A=e.oxw(3);return e.KtG(A.onAudioPlay(s))}),e._UZ(1,"source",83),e.qZA()}if(2&o){const i=e.oxw().$implicit;e.MGl("id","audioWhatsappRecord_",i.id,""),e.xp6(1),e.s9C("src",i.body,e.LSH),e.s9C("type",i.contentType)}}function j(o,M){if(1&o){const i=e.EpF();e.TgZ(0,"video",84),e.NdJ("play",function(s){e.CHM(i);const A=e.oxw(3);return e.KtG(A.onVideoPlay(s))}),e._UZ(1,"source",83),e._uU(2," Your browser does not support the video tag. "),e.qZA()}if(2&o){const i=e.oxw().$implicit;e.MGl("id","videoWhatsappRecord_",i.id,""),e.xp6(1),e.s9C("src",i.body,e.LSH),e.s9C("type",i.contentType)}}const be=function(o,M){return{"whatsapp-me":o,"whatsapp-you":M}};function te(o,M){if(1&o&&(e.TgZ(0,"mat-list-item")(1,"div",54)(2,"span",55),e._UZ(3,"img",56),e.qZA(),e.TgZ(4,"div",57)(5,"div",58)(6,"strong",59),e._uU(7),e.qZA(),e.TgZ(8,"small",60),e._UZ(9,"span",61),e._uU(10),e.qZA(),e.YNc(11,g,5,3,"strong",62),e.YNc(12,L,5,3,"strong",62),e.YNc(13,P,5,3,"strong",62),e.YNc(14,y,5,3,"strong",62),e.YNc(15,h,5,3,"strong",62),e.YNc(16,x,5,3,"strong",62),e.YNc(17,c,5,3,"strong",62),e.YNc(18,u,5,3,"strong",62),e.qZA(),e.TgZ(19,"div",63),e.YNc(20,R,2,1,"span",64),e.YNc(21,W,6,4,"div",65),e.YNc(22,pe,2,3,"audio",66),e.YNc(23,j,3,3,"video",67),e.qZA()()()()),2&o){const i=M.$implicit,n=e.oxw(2);e.xp6(1),e.Q6J("ngClass",e.WLB(16,be,i.messageType===n.MessageTypeEnum.Reply,i.messageType===n.MessageTypeEnum.Incoming)),e.xp6(2),e.Q6J("src",n.getChatHistoryUserImage(i),e.LSH),e.xp6(4),e.Oqu(n.getChatHistoryUserName(i)),e.xp6(3),e.hij("",n.formatDateTime(i.createdOn)," "),e.xp6(1),e.Q6J("ngIf",1===i.messageStatus),e.xp6(1),e.Q6J("ngIf",2===i.messageStatus),e.xp6(1),e.Q6J("ngIf",3===i.messageStatus),e.xp6(1),e.Q6J("ngIf",4===i.messageStatus),e.xp6(1),e.Q6J("ngIf",5===i.messageStatus),e.xp6(1),e.Q6J("ngIf",6===i.messageStatus),e.xp6(1),e.Q6J("ngIf",7===i.messageStatus),e.xp6(1),e.Q6J("ngIf",8===i.messageStatus),e.xp6(2),e.Q6J("ngIf",i.messageBodyType===n.MessageBodyTypeEnum.Text),e.xp6(1),e.Q6J("ngIf",i.messageBodyType===n.MessageBodyTypeEnum.Attachment&&null!=i.contentType),e.xp6(1),e.Q6J("ngIf",i.messageBodyType===n.MessageBodyTypeEnum.Audio&&null!=i.contentType),e.xp6(1),e.Q6J("ngIf",i.messageBodyType===n.MessageBodyTypeEnum.Video&&null!=i.contentType)}}function G(o,M){1&o&&e._UZ(0,"i",89)}function ue(o,M){if(1&o){const i=e.EpF();e.TgZ(0,"button",85),e.NdJ("click",function(){e.CHM(i);const s=e.oxw(2);return e.KtG(s.sendNormalMessage())}),e.TgZ(1,"span",86),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.YNc(4,G,1,0,"i",87),e._UZ(5,"i",88),e.qZA()}if(2&o){const i=e.oxw(2);
1e.Q6J("disabled",i.isRecording),e.xp6(2),e.Oqu(e.lcZ(3,3,"send")),e.xp6(2),e.Q6J("ngIf",i.isSending)}}function ie(o,M){1&o&&e._UZ(0,"i",89)}function se(o,M){if(1&o){const i=e.EpF();e.TgZ(0,"button",85),e.NdJ("click",function(){e.CHM(i);const s=e.oxw(2);return e.KtG(s.sendAudioMessage())}),e.TgZ(1,"span",86),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.YNc(4,ie,1,0,"i",87),e._UZ(5,"i",88),e.qZA()}if(2&o){const i=e.oxw(2);e.Q6J("disabled",i.isRecording),e.xp6(2),e.Oqu(e.lcZ(3,3,"send")),e.xp6(2),e.Q6J("ngIf",i.isSendingAudioMessage)}}function Q(o,M){if(1&o){const i=e.EpF();e.TgZ(0,"div",40)(1,"div",41),e._UZ(2,"img",42),e.TgZ(3,"span"),e._uU(4),e.ALo(5,"translate"),e.TgZ(6,"span",43),e._uU(7),e.qZA()(),e._UZ(8,"br"),e.qZA(),e.TgZ(9,"mat-list"),e.YNc(10,te,24,19,"mat-list-item",44),e.qZA(),e.TgZ(11,"form",45)(12,"div",46)(13,"button",47),e.NdJ("click",function(){e.CHM(i);const s=e.oxw();return e.KtG(s.addAttachment())}),e.ALo(14,"translate"),e._UZ(15,"i",48),e.qZA(),e._UZ(16,"input",49),e.ALo(17,"translate"),e.TgZ(18,"span",50),e.YNc(19,ue,6,5,"button",51),e.YNc(20,se,6,5,"button",51),e.TgZ(21,"button",52),e.NdJ("click",function(){e.CHM(i);const s=e.oxw();return e.KtG(s.refreshCurrentConversation())}),e.ALo(22,"translate"),e._UZ(23,"i",53),e.qZA()()()()()}if(2&o){const i=e.oxw();e.xp6(2),e.s9C("src",i.currentActiveReceiverImage,e.LSH),e.s9C("title",i.currentActiveReceiverName),e.xp6(2),e.hij(" ",e.lcZ(5,14,"whatsappTo"),": "),e.xp6(3),e.AsE("",i.currentActiveReceiverName," ",i.currentActivePhoneNumber,""),e.xp6(3),e.Q6J("ngForOf",i.currentActiveHistory),e.xp6(3),e.s9C("title",e.lcZ(14,16,"addAttachment")),e.Q6J("disabled",i.disabledAll),e.xp6(3),e.MGl("placeholder","",e.lcZ(17,18,"typeYourMessageHere"),"..."),e.Q6J("disabled",i.disabledAll),e.xp6(3),e.Q6J("ngIf",!i.isRecording&&!i.audioExists||i.isSending),e.xp6(1),e.Q6J("ngIf",i.isRecording||i.audioExists),e.xp6(1),e.s9C("title",e.lcZ(22,20,"refresh")),e.Q6J("disabled",i.disabledAll)}}let fe=(()=>{class o extends V.H{constructor(i,n,s,A,Z,q,ne){super(),this.loaderService=i,this.route=n,this.whatsappService=s,this.location=A,this.modalService=Z,this.urlService=q,this.uploadService=ne,this.whatsappModel=Array(),this.currentActiveHistory=Array(),this.currentActiveId=null,this.currentActivePhoneNumber=null,this.showWhatsappHistory=!1,this.rtlEnabled=!1,this.whatsappContactsId=null,this.selectedFiles=[],this.stringYou="you",this.recorderTimerMinutesValue="00",this.recorderTimerSecondsValue="00",this.showRecorderTimer=!1,this.isRecording=!1,this.audioExists=!1,this.disabledAll=!1,this.isSending=!1,this.maxUploadSize=5,this.compressSize=2,this.allowedExtentions=".png,.jpg,.gif,.jpeg,.mp3,.wav,.wma,.rar,.zip,.csv,.ppt,.xls,.xlsx,.doc,.docx,.pdf,.txt,.3gp,.avi,.mp4,.wmv",this.isSendingAudioMessage=!1,this.contactsOnContentReady=this.contactsOnContentReady.bind(this),this.rtlEnabled="ar"===this.appTranslateService.getCurrentLang(),this.stringYou=this.appTranslateService.getTranslate("you");var E=this.route.snapshot.paramMap.get("whatsappContactsId");typeof E<"u"&&""!==E&&null!==E&&(this.whatsappContactsId=parseInt(E)),this.MessageTypeEnum=D,this.MessageBodyTypeEnum=X}ngOnInit(){this.afuConfig={uploadAPI:{url:""},multiple:!1,maxSize:this.maxUploadSize,formatsAllowed:this.allowedExtentions},this.loadData()}loadData(){this.loaderService.show(),this.whatsappService.GetUserWhatsappContract(this.whatsappContactsId).subscribe(n=>{if(this.loaderService.hide(),n.successed){if(this.whatsappModel=n.data,null!==this.whatsappContactsId){var s=this.whatsappModel.filter(A=>A.id===this.whatsappContactsId)[0];this.currentActiveId=s.id,this.currentActivePhoneNumber=s.phoneNumber,this.currentActiveHistory=s.whatsappHistoriesList,this.showWhatsappHistory=!0,this.currentActiveReceiverName=s.userName,this.currentActiveReceiverImage=s.userImage,this.currentActiveReceiverId=s.userId}}else this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("UnAuthorizedAccess"===n.errorCode?"unAuthorizedAccess":"general.generalError"))},n=>{typeof n.error<"u"&&this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError")),this.loaderService.hide()})}contactsOnSelectionChanged(i){this.location.replaceState("/message-center/whatsapp/"+i.id),this.whatsappContactsId=i.id,this.currentActiveId=i.id,this.currentActivePhoneNumber=i.phoneNumber,this.isRecording=!1,this.audioExists=!1,this.showRecorderTimer=!1,this.disabledAll=!1,this.getConversation(i.id)}getConversation(i){this.loaderService.show(),this.whatsappService.GetUserWhatsappContractsHistory(i).subscribe(s=>{if(this.loaderService.hide(),s.successed){var A=this.whatsappModel.filter(Z=>Z.id===i)[0];A.whatsappHistoriesList=s.data,this.currentActiveHistory=A.whatsappHistoriesList,this.showWhatsappHistory=!0,this.currentActiveReceiverName=A.userName,this.currentActiveReceiverImage=A.userImage,this.currentActiveReceiverId=A.userId,setTimeout(()=>{},0)}else this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("UnAuthorizedAccess"===s.errorCode?"unAuthorizedAccess":"general.generalError"))},s=>{typeof s.error<"u"&&this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError")),this.loaderService.hide()})}formatDateTime(i){if(!i||null===i)return"";var n=new Date(i).toLocaleDateString()+" "+new Date(i).toLocaleTimeString();return"ar"===this.lang&&(n=n.replace("PM","\u0645").replace("AM","\u0635")),n}contactsOnContentReady(i){}whatsappHistoryOnContentReady(i){setTimeout(()=>{window},100)}sendNormalMessage(){var i=_()("#whatsappInputId").val().toString().trim();if(""!==i){if(/(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/.test(i)||/\d{8}/.test(i))return _()("#whatsappInputId").val(""),void this.toastrAlertService.warningToastr(this.appTranslateService.getTranslate("messageContainsSensitiveInformation"));if(!this.isSending){this.isSending=!0;var A={whatsappContactsId:this.currentActiveId,body:i,messageBodyType:X.Text,messageType:D.Reply,messageStatus:ee.Sent};this.loaderService.show(),this.whatsappService.AddWhatsappMessage(A).subscribe(Z=>{this.loaderService.hide(),Z.successed?(document.getElementById("sendMessageSound").play(),_()("#whatsappInputId").val(""),this.whatsappModel.filter(E=>E.id===this.currentActiveId)[0].whatsappHistoriesList.push(Z.data)):this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError")),this.isSending=!1},Z=>{typeof Z.error<"u"&&this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError")),this.loaderService.hide(),this.isSending=!1})}}else this.toastrAlertService.warningToastr(this.appTranslateService.getTranslate("general.whatsappIsRequired"))}refreshCurrentConversation(){this.whatsappContactsId&&null!==this.whatsappContactsId&&this.getConversation(this.whatsappContactsId)}addNewConversation(){const i=this.modalService.open(Me,{size:"sm",centered:!0});var n=this;i.result.then(s=>{typeof s<"u"&&n.whatsappModel.filter(Z=>Z.id===s)})}startNewConversation(i){this.loaderService.show(),this.whatsappService.StartNewConversation(i).subscribe(n=>{this.loaderService.hide(),n.successed?0===this.whatsappModel.filter(s=>s.id===n.data.id).length&&(n.data.messagesHistoriesList=new Array,n.data.isSenderSeen=!0,n.data.senderSeenDate=new Date,this.whatsappModel.unshift(n.data)):this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError"))},n=>{typeof n.error<"u"&&this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError")),this.loaderService.hide()})}newMessageReceived(){var i=_()("#currentActiveDataDiv").data("json");if(null!==i&&""!==i){var n=JSON.parse(i);if(null!==n&&""!==n){var s=this.whatsappModel.filter(A=>A.id===n.WhatsappContactsId)[0];null!==s?s.whatsappHistoriesList.push({id:n.Id,userId:n.UserId,messageBodyType:n.MessageBodyType,body:n.Body,messageId:n.MessageId,messageType:n.MessageType,messageStatus:n.MessageStatus,status:n.Status,errorMessage:n.ErrorMessage,createdOn:n.CreatedOn,updatedOn:n.UpdatedOn,sentDate:n.SentDate,isProcessed:n.IsProcessed,isDelivered:n.IsDelivered,isDevelopment:n.IsDevelopment,messageStatusText:n.MessageStatusText,contentType:n.ContentType,userImage:n.UserImage,userName:n.UserName,whatsappContactsId:s.id}):this.whatsappModel.unshift(s={id:n.WhatsappContactsId,createdAt:n.CreatedAt,lastMessageDate:n.LastMessageDate,phoneNumber:n.PhoneNumber,userImage:n.UserImage,userName:n.UserName,userId:n.UserId,updatedAt:null,whatsappHistoriesList:[{id:n.Id,userId:n.UserId,messageBodyType:n.MessageBodyType,body:n.Body,messageId:n.MessageId,messageType:n.MessageType,messageStatus:n.MessageStatus,status:n.Status,errorMessage:n.ErrorMessage,createdOn:n.CreatedOn,updatedOn:n.UpdatedOn,sentDate:n.SentDate,isProcessed:n.IsProcessed,isDelivered:n.IsDelivered,isDevelopment:n.IsDevelopment,messageStatusText:n.MessageStatusText,contentType:n.ContentType,userImage:n.UserImage,userName:n.UserName,whatsappContactsId:n.WhatsappContactsId}]}
1),this.sortContactList()}}_()("#currentActiveDataDiv").data("json",null)}newConversationMessageReceived(){var n=_()("#currentActiveDataNewConversationDiv").data("json");if(null!==n&&""!==n){var s=JSON.parse(n);if(null!==s&&""!==s){var A=this.whatsappModel.filter(Z=>Z.id===s.WhatsappContactsId)[0];A&&null!==A?A.whatsappHistoriesList.push({id:s.Id,userId:s.UserId,messageBodyType:s.MessageBodyType,body:s.Body,messageId:s.MessageId,messageType:s.MessageType,messageStatus:s.MessageStatus,status:s.Status,errorMessage:s.ErrorMessage,createdOn:s.CreatedOn,updatedOn:s.UpdatedOn,sentDate:s.SentDate,isProcessed:s.IsProcessed,isDelivered:s.IsDelivered,isDevelopment:s.IsDevelopment,messageStatusText:s.MessageStatusText,contentType:s.ContentType,userImage:s.UserImage,userName:s.UserName,whatsappContactsId:A.id}):this.whatsappModel.unshift(A={id:s.WhatsappContactsId,createdAt:s.CreatedAt,lastMessageDate:s.LastMessageDate,phoneNumber:s.PhoneNumber,userImage:s.UserImage,userName:s.UserName,userId:s.UserId,updatedAt:null,whatsappHistoriesList:[{id:s.Id,userId:s.UserId,messageBodyType:s.MessageBodyType,body:s.Body,messageId:s.MessageId,messageType:s.MessageType,messageStatus:s.MessageStatus,status:s.Status,errorMessage:s.ErrorMessage,createdOn:s.CreatedOn,updatedOn:s.UpdatedOn,sentDate:s.SentDate,isProcessed:s.IsProcessed,isDelivered:s.IsDelivered,isDevelopment:s.IsDevelopment,messageStatusText:s.MessageStatusText,contentType:s.ContentType,userImage:s.UserImage,userName:s.UserName,whatsappContactsId:s.WhatsappContactsId}]})}}_()("#currentActiveDataNewConversationDiv").data("json",null)}addAttachment(){var i=this;const n=this.modalService.open($.v,{size:"lg",centered:!0});n.componentInstance.multiple=!0,n.componentInstance.allowEditFileName=!1,n.componentInstance.filePath="Uploads/WhatsappCenter/"+this.whatsappContactsId+"/Attachment",n.result.then(s=>{typeof s<"u"&&null!==s&&s.length>0&&s.forEach(function(A){i.postAttachmentWhatsapp(A.filePath,A.mediaType)})})}recordAudio(){var i=this;i.isRecording&&i.recorder&&null!==i.recorder?(document.getElementById("stopRecordingSound").play(),i.isRecording=!1,i.audioExists=!0,clearInterval(this.recorderInterval),i.recorderInterval=null,i.recorder.stopRecording(function(){i.currentRecordedFile=i.recorder.getBlob(),i.recorder=null})):(document.getElementById("startRecordingSound").play(),i.currentRecordedFile=null,i.recorderTimerMinutesValue="00",i.recorderTimerSecondsValue="00",i.recorder=null,this.audioExists=!1,clearInterval(i.recorderInterval),i.recorderInterval=null,navigator.mediaDevices.getUserMedia({audio:!0}).then(function(){var s=(0,Pe.Z)(function*(A){i.recorder=Oe(A,{type:"audio"}),i.recorder.startRecording(),i.startRecorderTimer(),i.isRecording=!0,i.disabledAll=!0,i.showRecorderTimer=!0});return function(A){return s.apply(this,arguments)}}()))}startRecorderTimer(){var i=this,n=0;function A(Z){var q=Z+"";return q.length<2?"0"+q:q}i.recorderInterval=setInterval(function s(){++n,i.recorderTimerSecondsValue=A(n%60),i.recorderTimerMinutesValue=A(parseInt((n/60).toString()))},1e3)}cancelRecordingAudio(){document.getElementById("cancelRecordingSound").play(),this.disabledAll=!1,this.showRecorderTimer=!1,this.isRecording=!1,this.audioExists=!1,this.currentRecordedFile=null,this.recorder=null,clearInterval(this.recorderInterval),this.recorderInterval=null,this.recorderTimerMinutesValue="00",this.recorderTimerSecondsValue="00"}sendAudioMessage(){this.whatsappCenterAngularFileUploader.uploadAPI=this.urlService.UploadAudioFileUrl+"?filePath=Uploads/WhatsappCenter/"+this.whatsappContactsId+"/Audio",this.whatsappCenterAngularFileUploader.maxSize=30,this.selectedFiles.push(this.currentRecordedFile),this.whatsappCenterAngularFileUploader.uploadFiles()}postAttachmentWhatsapp(i,n){var s={whatsappContactsId:this.currentActiveId,body:i,messageBodyType:X.Attachment,messageType:D.Reply,messageStatus:ee.Sent,contentType:n};this.loaderService.show(),this.whatsappService.AddWhatsappMessage(s).subscribe(A=>{this.loaderService.hide(),A.successed?(document.getElementById("sendMessageSound").play(),this.whatsappModel.filter(ne=>ne.id===this.whatsappContactsId)[0].whatsappHistoriesList.push(A.data)):this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError"))},A=>{typeof A.error<"u"&&this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError")),this.loaderService.hide()})}postAudioMessage(i,n){this.isSendingAudioMessage=!0;var s={whatsappContactsId:this.currentActiveId,body:i,messageBodyType:X.Audio,messageType:D.Reply,messageStatus:ee.Sent,contentType:n};this.loaderService.show(),this.whatsappService.AddWhatsappMessage(s).subscribe(A=>{this.isSendingAudioMessage=!1,this.loaderService.hide(),A.successed?(document.getElementById("sendMessageSound").play(),this.isRecording=!1,this.recorder=null,this.audioExists=!1,this.showRecorderTimer=!1,this.disabledAll=!1,this.currentRecordedFile=null,this.whatsappModel.filter(ne=>ne.id===this.whatsappContactsId)[0].whatsappHistoriesList.push(A.data),this.whatsappCenterAngularFileUploader.resetFileUpload()):this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError"))},A=>{this.isSendingAudioMessage=!1,typeof A.error<"u"&&this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError")),this.loaderService.hide()})}postCameraMessage(i,n){var s={whatsappContactsId:this.currentActiveId,body:i,messageBodyType:X.Attachment,messageType:D.Reply,messageStatus:ee.Sent,contentType:n};this.loaderService.show(),this.whatsappService.AddWhatsappMessage(s).subscribe(A=>{this.loaderService.hide(),A.successed?(document.getElementById("sendMessageSound").play(),this.whatsappModel.filter(ne=>ne.id===this.whatsappContactsId)[0].whatsappHistoriesList.push(A.data),this.whatsappCenterCameraAngularFileUploader.resetFileUpload()):this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError"))},A=>{typeof A.error<"u"&&this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError")),this.loaderService.hide()})}CameraFileUpload(i){this.loaderService.hide();var n=JSON.parse(i.response);!0===n.successed?this.postCameraMessage(n.data[0].httpPath,n.data[0].type):this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError"))}AudioRecordFileUpload(i){this.loaderService.hide();var n=JSON.parse(i.response);!0===n.successed?this.postAudioMessage(n.data[0].httpPath,n.data[0].type):this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("general.generalError"))}onAudioPlay(i){_()(".audioRecords").each(function(n,s){i.srcElement.id!==s.id&&document.getElementById(s.id).pause()})}onVideoPlay(i){_()(".videoRecords").each(function(n,s){i.srcElement.id!==s.id&&document.getElementById(s.id).pause()})}getAttachmentsFromContent(i){var n=this;if(null===i||""===i)return[];var s=i.split(";");s.length>0&&(s=s.filter(Z=>""!==Z));var A=[];
1return s.forEach(function(Z){var q="other";n.uploadService.fileIsImage(Z)?q="image":n.uploadService.fileIsExcel(Z)?q="excel":n.uploadService.fileIsPdf(Z)&&(q="pdf"),A.push({type:q,httpPath:Z})}),A}openCamera(){const i=this.modalService.open(Ie,{size:"lg",centered:!0,backdrop:"static",keyboard:!1});var n=this;i.result.then(s=>{typeof s<"u"&&null!==s&&(n.whatsappCenterCameraAngularFileUploader.uploadAPI=this.urlService.UploadFile+"?filePath=Uploads/WhatsappCenter/"+this.whatsappContactsId+"/Camera",n.whatsappCenterCameraAngularFileUploader.maxSize=30,n.selectedFiles.push(s),n.whatsappCenterCameraAngularFileUploader.uploadFiles())})}openPopupImage(i){this.modalService.open(Ue,{size:"lg",centered:!0}).componentInstance.photoUrl=i}getChatHistoryUserName(i){return i.messageType===D.Reply?null!==i.userId?i.userName:i.userId===this.userprofile.id?this.stringYou:this.appTranslateService.getTranslate("systemName"):this.currentActiveReceiverName}onSelectionChanged(i){if(this.selectedFiles=i.target.files,this.whatsappCenterAngularFileUploader.notAllowedFiles&&this.whatsappCenterAngularFileUploader.notAllowedFiles.length>0)return this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("Invalid size"===this.whatsappCenterAngularFileUploader.notAllowedFiles[0].errorMsg?"selectedFilesExceededAllowedSize":"selectedFilesExtentionsNotAllowed")),void this.whatsappCenterAngularFileUploader.resetFileUpload();this.selectedFiles&&this.selectedFiles.length>0&&(this.whatsappCenterAngularFileUploader.uploadFiles(),this.loaderService.show())}onCameraSelectionChanged(i){if(this.selectedFiles=i.target.files,this.whatsappCenterCameraAngularFileUploader.notAllowedFiles&&this.whatsappCenterCameraAngularFileUploader.notAllowedFiles.length>0)return this.toastrAlertService.errorToastr(this.appTranslateService.getTranslate("Invalid size"===this.whatsappCenterCameraAngularFileUploader.notAllowedFiles[0].errorMsg?"selectedFilesExceededAllowedSize":"selectedFilesExtentionsNotAllowed")),void this.whatsappCenterCameraAngularFileUploader.resetFileUpload();this.selectedFiles&&this.selectedFiles.length>0&&(this.whatsappCenterCameraAngularFileUploader.uploadFiles(),this.loaderService.show())}getChatHistoryUserImage(i){return i.messageType===D.Reply?null!==i.userId?i.userImage:i.userId===this.userprofile.id?this.userprofile.photoUrl:"assets/images/favicon.png":this.currentActiveReceiverImage}sortContactList(){this.whatsappModel=this.whatsappModel.sort((i,n)=>new Date(n.updatedAt).getTime()-new Date(i.updatedAt).getTime())}}return o.\u0275fac=function(i){return new(i||o)(e.Y36(B.D),e.Y36(U.gz),e.Y36(Ce),e.Y36(oe.Ye),e.Y36(le.FF),e.Y36(Se.j),e.Y36(We.C))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-whatsapp"]],viewQuery:function(i,n){if(1&i&&(e.Gf(p,5),e.Gf(f,5),e.Gf(l,7),e.Gf(m,7)),2&i){let s;e.iGM(s=e.CRH())&&(n.contactsList=s.first),e.iGM(s=e.CRH())&&(n.whatsappHistoryList=s.first),e.iGM(s=e.CRH())&&(n.whatsappCenterAngularFileUploader=s.first),e.iGM(s=e.CRH())&&(n.whatsappCenterCameraAngularFileUploader=s.first)}},features:[e.qOj],decls:28,vars:12,consts:[["fxLayout","column","fxLayoutAlign","stretch",1,"p-2"],["fxLayout","row","fxLayout.sm","column","fxLayout.xs","column","fxLayoutAlign","space-between center","fxFlex","auto",1,"breadcrumb"],[1,"fab","fa-whatsapp"],[1,"row","col-12","p-0","m-0"],[1,"col-xl-3","col-lg-3"],[1,"sideBarbox",2,"text-align","unset"],[3,"ngStyle","click",4,"ngFor","ngForOf"],[1,"col-xl-9","col-lg-9","sideBarboxLeft"],["class","row",4,"ngIf"],["style","text-align: unset;",4,"ngIf"],["id","currentActiveDataDiv",2,"display","none",3,"click"],["id","currentActiveDataNewConversationDiv",2,"display","none",3,"click"],["id","startRecordingSound","src","../../../assets/sounds/startRecording.mp3",2,"display","none",3,"autoplay"],["startRecordingSound",""],["id","stopRecordingSound","src","../../../assets/sounds/stopRecording.mp3",2,"display","none",3,"autoplay"],["stopRecordingSound",""],["id","cancelRecordingSound","src","../../../assets/sounds/cancelRecording.mp3",2,"display","none",3,"autoplay"],["cancelRecordingSound",""],["id","sendMessageSound","src","../../../assets/sounds/sendMessage.mp3",2,"display","none",3,"auto
1play"],["sendMessageSound",""],[2,"display","none",3,"config","ApiResponse","change"],["whatsappCenterAngularFileUploader",""],["whatsappCenterCameraAngularFileUploader",""],[3,"ngStyle","click"],[1,"userLst"],[1,"userPic"],["loading","lazy","onerror","this.src='assets/images/customerProfile.png'",2,"height","3.25em","width","3.25em","border-radius","50%","margin-right","5px",3,"src","title"],[1,"userConent"],[2,"color","black","text-transform","capitalize","font-weight","bold"],[2,"color","black"],[2,"color","#a8a8a8","font-size","12px"],["style","overflow: hidden;text-overflow: ellipsis;max-width: 100%;display: inline-block;color: #a8a8a8;font-size: 12px;",4,"ngIf"],["style","color: #a8a8a8;font-size: 12px;",4,"ngIf"],[2,"overflow","hidden","text-overflow","ellipsis","max-width","100%","display","inline-block","color","#a8a8a8","font-size","12px"],[1,"fad","fa-link",2,"padding-left","5px","padding-right","5px"],[1,"fad","fa-microphone-alt",2,"padding-left","5px","padding-right","5px"],[1,"fad","fa-images",2,"padding-left","5px","padding-right","5px"],[1,"row"],[1,"col-md-12","text-center","noMsgBlock"],["src","assets/images/no-message.png","alt",""],[2,"text-align","unset"],[2,"margin-bottom","5px"],["loading","lazy","onerror","this.src='assets/images/customerProfile.png'",2,"height","2.59em","width","2.59em","border-radius","50%","margin-right","5px",3,"src","title"],[2,"font-weight","bold"],[4,"ngFor","ngForOf"],["id","send-whatsapp",1,"send-whatsapp-form",2,"margin-top","5px"],[1,"input-group"],["type","button",1,"btn","btnAP",2,"margin-left","2px","margin-right","2px",3,"disabled","title","click"],[1,"fad","fa-link"],["id","whatsappInputId","type","text","name","myWhatsapps",1,"form-control","input-sm",3,"disabled","placeholder"],[1,"input-group-append"],["class","btn btn-primary","type","submit",3,"disabled","click",4,"ngIf"],["id","refreshCurrentConversationBtn","type","button",1,"btn","btnAP",2,"margin-left","2px","margin-right","2px",3,"disabled","title","click"],[1,"fad","fa-sync"],[1,"clearfix",3,"ngClass"],[1,"whatsapp-img","img-circle"],["loading","lazy","onerror","this.src='assets/images/customerProfile.png'",1,"avatar-sm","border","rounded-circle",3,"src"],[1,"whatsapp-body","clearfix"],[1,"whatsapp-header"],[1,"whatsapp-title"],[1,"time-whatsapp","text-muted"],[1,"fas","fa-time"],["class","whatsapp-title","style","margin-right: 5px;margin-left: 5px;",4,"ngIf"],[1,"whatsapp-p"],[4,"ngIf"],["class","col-xs-12 col-sm-12 col-md-2 col-lg-2 imgBlock","style","display: contents;",4,"ngIf"],["style","height: 40px;margin-top: 5px;","controls","","class","audioRecords",3,"id","play",4,"ngIf"],["style","display:block;margin-top: 5px;position: relative;","controls","","class","videoRecords",3,"id","play",4,"ngIf"],[1,"whatsapp-title",2,"margin-right","5px","margin-left","5px"],[1,"fad","fa-check",2,"padding-left","5px","padding-right","5px","font-size","17px"],[1,"fad","fa-exclamation-circle",2,"padding-left","5px","padding-right","5px","font-size","17px"],[1,"fad","fa-clock",2,"padding-left","5px","padding-right","5px","font-size","17px"],[1,"fad","fa-check-double",2,"padding-left","5px","padding-right","5px","font-size","17px"],[1,"col-xs-12","col-sm-12","col-md-2","col-lg-2","imgBlock",2,"display","contents"],[1,"thumBlock",2,"padding-left","5px","padding-right","5px","margin-top","5px"],["style","width: 80px;height: 80px;padding: 5px;",3,"src","title","click",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[2,"width","80px","height","80px","padding","5px",3,"src","title","click"],["target","_blank",3,"href"],[1,"fad","fa-file-excel",2,"font-size","80px",3,"title"],[1,"fad","fa-file-pdf",2,"font-size","80px",3,"title"],[1,"fa","fa-file",2,"font-size","80px",3,"title"],["controls","",1,"audioRecords",2,"height","40px","margin-top","5px",3,"id","play"],[3,"src","type"],["controls","",1,"videoRecords",2,"display","block","margin-top","5px","position","relative",3,"id","play"],["type","submit",1,"btn","btn-primary",3,"disabled","click"],[1,"sendTxt"],["class","fad fa-spinner fa-spin",4,"ngIf"],[1,"fad","fa-paper-plane"],[1,"fad","fa-spinner","fa-spin"]],template:function(i,n){1&i&&(e.TgZ(0,"div",0)(1,"mat-card",1)(2,"h4"),e._UZ(3,"i",2),e._uU(4),e.ALo(5,"translate"),e.qZA()()(),e.TgZ(6,"div",3)(7,"div",4)(8,"div",5)(9,"mat-list"),e.YNc(10,C,18,11,"mat-list-item",6),e.qZA()()(),e.TgZ(11,"div",7),e.YNc(12,b,7,3,"div",8),e.YNc(13,Q,24,22,"div",9),e.qZA()(),e.TgZ(14,"div",10),e.NdJ("click",function(){return n.newMessageReceived()}),e.qZA(),e.TgZ(15,"div",11),e.NdJ("click",function(){return n.newConversationMessageReceived()}),e.qZA(),e._UZ(16,"audio",12,13)(18,"audio",14,15)(20,"audio",16,17)(22,"audio",18,19),e.TgZ(24,"angular-file-uploader",20,21),e.NdJ("ApiResponse",function(A){return n.AudioRecordFileUpload(A)})("change",function(A){return n.onSelectionChanged(A)}),e.qZA(),e.TgZ(26,"angular-file-uploader",20,22),e.NdJ("ApiResponse",function(A){return n.CameraFileUpload(A)})("change",function(A){return n.onCameraSelectionChanged(A)}),e.qZA()),2&i&&(e.xp6(4),e.hij(" ",e.lcZ(5,10,"whatsappCenter"),""),e.xp6(6),e.Q6J("ngForOf",n.whatsappModel),e.xp6(2),e.Q6J("ngIf",(null==n.currentActiveHistory||0==n.currentActiveHistory.length)&&0==n.showWhatsappHistory),e.xp6(1),e.Q6J("ngIf",n.showWhatsappHistory),e.xp6(3),e.Q6J("autoplay",!1),e.xp6(2),e.Q6J("autoplay",!1),e.xp6(2),e.Q6J("autoplay",!1),e.xp6(2),e.Q6J("autoplay",!1),e.xp6(2),e.Q6J("config",n.afuConfig),e.xp6(2),e.Q6J("config",n.afuConfig))},dependencies:[Be._Y,Be.JL,Be.F,me.xw,me.Wh,me.yH,Te.oO,Te.Zl,oe.mk,oe.sg,oe.O5,oe.PC,a.a8,t.i$,t.Tg,r.Q,_e.X$],styles:[".unread[_ngcontent-%COMP%]{cursor:pointer;background-color:#f4f4f4}.whatsapp-box[_ngcontent-%COMP%]{max-height:28rem;overflow:auto}
1.online-circle[_ngcontent-%COMP%]{border-radius:5rem;width:5rem;height:5rem}.whatsapp-title[_ngcontent-%COMP%]{float:right;margin:0 5px;color:#000}.whatsapp-img[_ngcontent-%COMP%]{float:right;margin:0 5px}.whatsapp-header[_ngcontent-%COMP%]{text-align:right;width:100%;margin-bottom:.5rem}.text-editor[_ngcontent-%COMP%]{min-height:18rem}.whatsapp-you[_ngcontent-%COMP%] .whatsapp-title[_ngcontent-%COMP%], .whatsapp-you[_ngcontent-%COMP%] .whatsapp-img[_ngcontent-%COMP%]{float:left}.whatsapp-you[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{float:left;text-align:left;color:#000}.whatsapp-you[_ngcontent-%COMP%] .whatsapp-header[_ngcontent-%COMP%]{text-align:left}.whatsapp-me[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{float:right;color:#000}.ql-editor[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:1rem} .dx-scrollable-wrapper .dx-scrollable-container .dx-scrollable-content .dx-scrollview-content .dx-item.dx-list-item.dx-state-focused{background-color:unset!important}.newConversation[_ngcontent-%COMP%]{background-color:#d4d4d4!important;border:2px solid #29b57b!important}.activeConversation[_ngcontent-%COMP%]{border:1px solid #1f4f95!important;background-color:#fff!important}main[_ngcontent-%COMP%], #breadcrumb[_ngcontent-%COMP%]{background:#fff!important}.sideBarbox[_ngcontent-%COMP%] .dx-list[_ngcontent-%COMP%]:not(.dx-list-select-decorator-enabled) .dx-list-item.dx-list-item-selected[_ngcontent-%COMP%]{background-color:#0000000d;border-radius:10px}.sideBarbox[_ngcontent-%COMP%] .dx-list[_ngcontent-%COMP%] .dx-empty-message[_ngcontent-%COMP%], .dx-list-item-content[_ngcontent-%COMP%]{padding:8px}.sideBarbox[_ngcontent-%COMP%] .dx-list[_ngcontent-%COMP%] .dx-empty-message[_ngcontent-%COMP%], .dx-list-item[_ngcontent-%COMP%]{border-top:0px!important;border-radius:10px}.sideBarbox[_ngcontent-%COMP%] .dx-texteditor.dx-editor-outlined[_ngcontent-%COMP%]{background:rgba(0,0,0,.04);border-radius:20px!important;border:0px!important}.sideBarbox[_ngcontent-%COMP%] .userLst[_ngcontent-%COMP%]{display:inline-flex}.sideBarboxLeft[_ngcontent-%COMP%]{border-left:1px solid #ececec}.sideBarboxLeft[_ngcontent-%COMP%] .dx-list[_ngcontent-%COMP%]:not(.dx-list-select-decorator-enabled) .dx-list-item.dx-list-item-selected[_ngcontent-%COMP%], .sideBarboxLeft[_ngcontent-%COMP%] .dx-list[_ngcontent-%COMP%]:not(.dx-list-select-decorator-enabled) .dx-list-item.dx-state-hover[_ngcontent-%COMP%]{background-color:#fff!important;border-radius:10px}.sideBarboxLeft[_ngcontent-%COMP%] .message-img[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .sideBarboxLeft[_ngcontent-%COMP%] .whatsapp-img[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:35px;height:35px}.sideBarboxLeft[_ngcontent-%COMP%] .messages-p[_ngcontent-%COMP%], .sideBarboxLeft[_ngcontent-%COMP%] .whatsapp-p[_ngcontent-%COMP%]{padding:0 6px}.sideBarboxLeft[_ngcontent-%COMP%] .message-header[_ngcontent-%COMP%], .sideBarboxLeft[_ngcontent-%COMP%] .whatsapp-header[_ngcontent-%COMP%]{margin-bottom:0!important}.sideBarboxLeft[_ngcontent-%COMP%] audio[_ngcontent-%COMP%]{height:33px;margin-top:5px;outline:none}.sideBarboxLeft[_ngcontent-%COMP%] .dx-list-search[_ngcontent-%COMP%]{border-radius:20px!important}.sideBarboxLeft[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{box-shadow:none}.sideBarboxLeft[_ngcontent-%COMP%] .btnAP[_ngcontent-%COMP%]{background:transparent;border:0px;color:#7150f1;padding:0 10px;font-size:22px}.sideBarboxLeft[_ngcontent-%COMP%] #messageInputId[_ngcontent-%COMP%]{border-top-left-radius:20px;border-bottom-left-radius:20px}.sideBarboxLeft[_ngcontent-%COMP%] #messageInputId[_ngcontent-%COMP%] + .input-group-append[_ngcontent-%COMP%] .btn-primary[_ngcontent-%COMP%]{border-top-right-radius:20px;border-bottom-right-radius:20px}.sideBarboxLeft[_ngcontent-%COMP%] .messages-title[_ngcontent-%COMP%]{text-transform:capitalize;color:#484747!important}@media screen and (max-width: 767px){.sendTxt[_ngcontent-%COMP%]{display:none}#send-message[_ngcontent-%COMP%]{zoom:.85}.messages-p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{padding-left:5px;padding-right:5px}.messages-you[_ngcontent-%COMP%] div[_ngcontent-%COMP%], .messages-me[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{float:inherit!important}.messages-me[_ngcontent-%COMP%] audio[_ngcontent-%COMP%]{zoom:.7;float:right}.messages-me[_ngcontent-%COMP%]{text-align:right}.messages-you[_ngcontent-%COMP%] audio[_ngcontent-%COMP%]{zoom:.7;float:left}.sideBarboxLeft[_ngcontent-%COMP%] .btnAP[_ngcontent-%COMP%]{padding:0 5px;font-size:20px}#send-message[_ngcontent-%COMP%]{margin-top:20px}.messages-you[_ngcontent-%COMP%] .thumBlock[_ngcontent-%COMP%], .messages-me[_ngcontent-%COMP%] .thumBlock[_ngcontent-%COMP%]{float:left!important}.messages-you[_ngcontent-%COMP%] .thumBlock[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .messages-me[_ngcontent-%COMP%] .thumBlock[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:50px!important}.messages-you[_ngcontent-%COMP%] .thumBlock[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .messages-me[_ngcontent-%COMP%] .thumBlock[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:50px!important;width:50px!important}}mat-list-item.mat-list-item.mat-focus-indicator[_ngcontent-%COMP%]{height:120px;border:0px!important;cursor:pointer}.clearfix.whatsapp-me[_ngcontent-%COMP%]{width:100%}.sideBarbox[_ngcontent-%COMP%]{height:75vh;overflow:auto}.sideBarboxLeft[_ngcontent-%COMP%] .mat-list-base[_ngcontent-%COMP%]{height:70vh;overflow:auto}"]}),o})();const Ze=[{path:"",data:{breadcrumb:{skip:!0}},component:O(65986).w,children:[{path:"whatsapp",component:fe,canActivate:[xe.P],data:{breadcrumb:"whatsapp"}},{path:"whatsapp/:whatsappContactsId",component:fe,canActivate:[xe.P],data:{breadcrumb:"whatsapp"}}]}];let ze=(()=>{class o{}return o.\u0275fac=function(i){return new(i||o)}
1,o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[U.Bz.forChild(Ze),U.Bz]}),o})(),Le=(()=>{class o{}return o.\u0275fac=function(i){return new(i||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[ze,J.m,r.F]}),o})()},7041:(ye,de,O)=>{O.d(de,{C:()=>Pe});var J=O(64537),U=O(97556),xe=O(12278);let Pe=(()=>{class V{constructor(_,e){this.httpService=_,this.URLService=e,this.filesTypesExtentions=[{type:"text/html",extentions:"html htm shtml"},{type:"text/css",extentions:"css"},{type:"text/xml",extentions:"xml"},{type:"text/mathml",extentions:"mml"},{type:"text/plain",extentions:"txt"},{type:"text/vnd.sun.j2me.app-descriptor",extentions:"jad"},{type:"text/vnd.wap.wml",extentions:"wml"},{type:"text/x-component",extentions:"htc"},{type:"image/tiff",extentions:"tif tiff"},{type:"image/vnd.wap.wbmp",extentions:"wbmp"},{type:"image/x-icon",extentions:"ico"},{type:"image/x-jng",extentions:"jng"},{type:"image/x-ms-bmp",extentions:"bmp"},{type:"image/svg+xml",extentions:"svg"},{type:"image/webp",extentions:"webp"},{type:"image/gif",extentions:"gif"},{type:"image/jpeg",extentions:"jpeg jpg"},{type:"image/png",extentions:"png"},{type:"application/x-javascript",extentions:"js"},{type:"application/atom+xml",extentions:"atom"},{type:"application/rss+xml",extentions:"rss"},{type:"application/java-archive",extentions:"jar war ear"},{type:"application/mac-binhex40",extentions:"hqx"},{type:"application/msword",extentions:"doc"},{type:"application/pdf",extentions:"pdf"},{type:"application/postscript",extentions:"ps eps ai"},{type:"application/rtf",extentions:"rtf"},{type:"application/vnd.ms-excel",extentions:"xls"},{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",extentions:"xlsx"},{type:"application/vnd.ms-powerpoint",extentions:"ppt"},{type:"application/vnd.wap.wmlc",extentions:"wmlc"},{type:"application/vnd.google-earth.kml+xml",extentions:"kml"},{type:"application/vnd.google-earth.kmz",extentions:"kmz"},{type:"application/x-7z-compressed",extentions:"7z"},{type:"application/x-cocoa",extentions:"cco"},{type:"application/x-java-archive-diff",extentions:"jardiff"},{type:"application/x-java-jnlp-file",extentions:"jnlp"},{type:"application/x-makeself",extentions:"run"},{type:"application/x-perl",extentions:"pl pm"},{type:"application/x-pilot",extentions:"prc pdb"},{type:"application/x-rar-compressed",extentions:"rar"},{type:"application/x-redhat-package-manager",extentions:"rpm"},{type:"application/x-sea",extentions:"sea"},{type:"application/x-shockwave-flash",extentions:"swf"},{type:"application/x-stuffit",extentions:"sit"},{type:"application/x-tcl",extentions:"tcl tk"},{type:"application/x-x509-ca-cert",extentions:"der pem crt"},{type:"application/x-xpinstall",extentions:"xpi"},{type:"application/xhtml+xml",extentions:"xhtml"},{type:"application/zip",extentions:"zip"},{type:"application/octet-stream",extentions:"bin exe dll deb dmg eot iso img msi msp msm"},{type:"audio/midi",extentions:"mid midi kar"},{type:"audio/mpeg",extentions:"mp3"},{type:"audio/ogg",extentions:"ogg"},{type:"audio/x-realaudio",extentions:"ra"},{type:"video/3gpp",extentions:"3gpp 3gp"},{type:"video/mpeg",extentions:"mpeg mpg"},{type:"video/quicktime",extentions:"mov"},{type:"video/x-flv",extentions:"flv"},{type:"video/x-mng",extentions:"mng"},{type:"video/x-ms-asf",extentions:"asx asf"},{type:"video/x-ms-wmv",extentions:"wmv"},{type:"video/x-msvideo",extentions:"avi"},{type:"video/mp4",extentions:"m4v mp4"}]}uploadFile(_,e){return this.httpService.post(_,e)}getFileType(_){if(!_||null===_||""===_)return null;_.includes(".")&&(_=_.replace(".",""));var e=this.filesTypesExtentions.filter(B=>B.extentions.includes(_.toLowerCase()))[0];return e&&null!==e?e.type:null}fileIsImage(_){if(!_||null===_||""===_)return!1;var e=_.substr(_.lastIndexOf("."),_.length),B=this.getFileType(e);return!(!B||null===B||""===B||!B.includes("image"))}fileIsPdf(_){if(!_||null===_||""===_)return!1;var e=_.substr(_.lastIndexOf("."),_.length),B=this.getFileType(e);return!(!B||null===B||""===B||!B.includes("pdf"))}fileIsExcel(_){if(!_||null===_||""===_)return!1;var e=_.substr(_.lastIndexOf("."),_.length),B=this.getFileType(e);return!(!B||null===B||""===B||!B.includes("ms-excel")&&!B.includes("spreadsheetml.sheet"))}fileIsOtherType(_){if(!_||null===_||""===_)return!1;var e=_.substr(_.lastIndexOf("."),_.length),B=this.getFileType(e);return!(!B||null===B||""===B||this.fileIsImage(_)||this.fileIsPdf(_)||this.fileIsExcel(_))}getFileExtention(_){return _&&null!==_&&""!==_?_.substr(_.lastIndexOf("."),_.length):null}}return V.\u0275fac=function(_){return new(_||V)(J.LFG(U.O),J.LFG(xe.j))},V.\u0275prov=J.Yz7({token:V,factory:V.\u0275fac,providedIn:"root"}),V})()}}]);
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.