1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.BUlfCqsY.js","assets/react-vendor.B75MsAI9.js","assets/AuthModalContainer.D3JsQqnf.js","assets/AuthModalContainer-BhQ3rY72.css"])))=>i.map(i=>d[i]); 2import{u as e,t,D as i,p as o,ek as n,bS as a,el as r,ez as s,em as d,bO as c,en as u,eo as l,bK as f,bT as g,ep as m,eA as h,eq as p,er as v,es as b,et as w,eu as y,gs as R,gt as k,gu as S,b5 as C,g as x,H as T,gv as L,gw as M,gx as A,bU as B,bR as D,w as j,cu as U,Q as _,S as E,bP as I,bQ as P,bx as N,bN as F,aX as O,bV as z,bW as $,E as V,bX as W,bY as G,bZ as q,b_ as H,b$ as K,c0 as Y,c1 as Q,c2 as J,c3 as X,c4 as Z,c5 as ee,c6 as te,c7 as ie,c8 as oe,ew as ne,cr as ae,aB as re,z as se,a1 as de}from"./AuthModalContainer.D3JsQqnf.js";import{e as ce,g as ue,r as le,j as fe}from"./react-vendor.B75MsAI9.js";import{L as ge}from"./LazyFontLoader.5DGfhuFK.js";import me from"./index.Bx1hJalZ.js";import{M as he,a as pe}from"./MobileTranslateSubheader.BbB97n_0.js";import{t as ve}from"./index.W3QIN98f.js";import"./SiteNavLink.CgvBTSZT.js";var be,we={exports:{}};const ye=ue((be||(be=1,function(e){function t(e,n){if(!e)throw"First parameter is required.";n=new i(e,n=n||{type:"video"});var a,r=this;function s(t){t&&(n.initCallback=function(){t(),t=n.initCallback=null});var i=new o(e,n);(a=new i(e,n)).record(),g("recording"),n.disableLogs}function d(e){if(e=e||function(){},a){if("paused"===r.state)return r.resumeRecording(),void setTimeout(function(){d(e)},1);"recording"!==r.state&&n.disableLogs,n.disableLogs,"gif"!==n.type?a.stop(t):(a.stop(),t()),g("stopped")}else m();function t(t){if(a){Object.keys(a).forEach(function(e){"function"!=typeof a[e]&&(r[e]=a[e])});var i=a.blob;if(!i){if(!t)throw"Recording failed.";a.blob=i=t}if(i&&n.disableLogs,e){var o;try{o=u.createObjectURL(i)}catch(s){}"function"==typeof e.call?e.call(r,o):e(o)}n.autoWriteToDisk&&l(function(e){var t={};t[n.type+"Blob"]=e,A.Store(t)})}else"function"==typeof e.call?e.call(r,""):e("")}}function c(e){postMessage((new FileReaderSync).readAsDataURL(e))}function l(e,t){if(!e)throw"Pass a callback function over getDataURL.";var i=t?t.blob:(a||{}).blob;if(!i)return n.disableLogs,void setTimeout(function(){l(e,t)},1e3);if("undefined"==typeof Worker||navigator.mozGetUserMedia){var o=new FileReader;o.readAsDataURL(i),o.onload=function(t){e(t.target.result)}}else{var r=function(e){try{var t=u.createObjectURL(new Blob([e.toString(),"this.onmessage = function (eee) {"+e.name+"(eee.data);}"],{type:"application/javascript"})),i=new Worker(t);return u.revokeObjectURL(t),i}catch(o){}}(c);r.onmessage=function(t){e(t.data)},r.postMessage(i)}}function f(e){e=e||0,"paused"!==r.state?"stopped"!==r.state&&(e>=r.recordingDuration?d(r.onRecordingStopped):(e+=1e3,setTimeout(function(){f(e)},1e3))):setTimeout(function(){f(e)},1e3)}function g(e){r&&(r.state=e,"function"==typeof r.onStateChanged.call?r.onStateChanged.call(r,e):r.onStateChanged(e))}function m(){n.disableLogs}n.type;var h={startRecording:function(t){return n.disableLogs,t&&(n=new i(e,t)),n.disableLogs,a?(a.clearRecordedData(),a.record(),g("recording"),r.recordingDuration&&f(),r):(s(function(){r.recordingDuration&&f()}),r)},stopRecording:d,pauseRecording:function(){a?"recording"===r.state?(g("paused"),a.pause(),n.disableLogs):n.disableLogs:m()},resumeRecording:function(){a?"paused"===r.state?(g("recording"),a.resume(),n.disableLogs):n.disableLogs:m()},initRecorder:s,setRecordingDuration:function(e,t){if(void 0===e)throw"recordingDuration is required.";if("number"!=typeof e)throw"recordingDuration must be a number.";return r.recordingDuration=e,r.onRecordingStopped=t||function(){},{onRecordingStopped:function(e){r.onRecordingStopped=e}}},clearRecordedData:function(){a?(a.clearRecordedData(),n.disableLogs):m()},getBlob:function(){if(a)return a.blob;m()},getDataURL:l,toURL:function(){if(a)return u.createObjectURL(a.blob);m()},getInternalRecorder:function(){return a},save:function(e){a?b(a.blob,e):m()},getFromDisk:function(e){a?t.getFromDisk(n.type,e):m()},setAdvertisementArray:function(e){n.advertisement=[];for(var t=e.length,i=0;i<t;i++)n.advertisement.push({duration:i,image:e[i]})},blob:null,bufferSize:0,sampleRate:0,buffer:null,reset:function(){"recording"===r.state&&n.disableLogs,a&&"function"==typeof a.clearRecordedData&&a.clearRecordedData(),a=null,g("inactive"),r.blob=null},onStateChanged:function(e){n.disableLogs},state:"inactive",getState:function(){return r.state},destroy:function(){var e=n.disableLogs;n={disableLogs:!0},r.reset(),g("destroyed"),h=r=null,k.AudioContextConstructor&&(k.AudioContextConstructor.close(),k.AudioContextConstructor=null),n.disableLogs=e,n.disableLogs},version:"5.6.2"};if(!this)return r=h,h;for(var p in h)this[p]=h[p];return r=this,h}function i(e,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===L||t.recorderType===T||void 0!==U&&t.recorderType===U?t.type="video":t.recorderType===B?t.type="gif":t.re
2corderType===x?t.type="audio":t.recorderType===C&&(y(e,"audio").length&&y(e,"video").length||!y(e,"audio").length&&y(e,"video").length?t.type="video":y(e,"audio").length&&!y(e,"video").length&&(t.type="audio"))),void 0!==C&&"undefined"!=typeof MediaRecorder&&"requestData"in MediaRecorder.prototype&&(t.mimeType||(t.mimeType="video/webm"),t.type||(t.type=t.mimeType.split("/")[0]),t.bitsPerSecond),t.type||(t.mimeType&&(t.type=t.mimeType.split("/")[0]),t.type||(t.type="audio")),t}function o(e,t){var i;return(m||l||f)&&(i=x),"undefined"!=typeof MediaRecorder&&"requestData"in MediaRecorder.prototype&&!m&&(i=C),"video"===t.type&&(m||f)&&(i=L,void 0!==U&&"undefined"!=typeof ReadableStream&&(i=U)),"gif"===t.type&&(i=B),"canvas"===t.type&&(i=T),S()&&i!==T&&i!==B&&"undefined"!=typeof MediaRecorder&&"requestData"in MediaRecorder.prototype&&(y(e,"video").length||y(e,"audio").length)&&("audio"===t.type?"function"==typeof MediaRecorder.isTypeSupported&&MediaRecorder.isTypeSupported("audio/webm")&&(i=C):"function"==typeof MediaRecorder.isTypeSupported&&MediaRecorder.isTypeSupported("video/webm")&&(i=C)),e instanceof Array&&e.length&&(i=j),t.recorderType&&(i=t.recorderType),!t.disableLogs&&i&&i.name,!i&&h&&(i=C),i}function n(e){this.addStream=function(t){t&&(e=t)},this.mediaType={audio:!0,video:!0},this.startRecording=function(){var i,o=this.mediaType,n=this.mimeType||{audio:null,video:null,gif:null};if("function"!=typeof o.audio&&S()&&!y(e,"audio").length&&(o.audio=!1),"function"!=typeof o.video&&S()&&!y(e,"video").length&&(o.video=!1),"function"!=typeof o.gif&&S()&&!y(e,"video").length&&(o.gif=!1),!o.audio&&!o.video&&!o.gif)throw"MediaStream must have either audio or video tracks.";if(o.audio&&(i=null,"function"==typeof o.audio&&(i=o.audio),this.audioRecorder=new t(e,{type:"audio",bufferSize:this.bufferSize,sampleRate:this.sampleRate,numberOfAudioChannels:this.numberOfAudioChannels||2,disableLogs:this.disableLogs,recorderType:i,mimeType:n.audio,timeSlice:this.timeSlice,onTimeStamp:this.onTimeStamp}),o.video||this.audioRecorder.startRecording()),o.video){i=null,"function"==typeof o.video&&(i=o.video);var a=e;if(S()&&o.audio&&"function"==typeof o.audio){var r=y(e,"video")[0];g?((a=new p).addTrack(r),i&&i===L&&(i=C)):(a=new p).addTrack(r)}this.videoRecorder=new t(a,{type:"video",video:this.video,canvas:this.canvas,frameInterval:this.frameInterval||10,disableLogs:this.disableLogs,recorderType:i,mimeType:n.video,timeSlice:this.timeSlice,onTimeStamp:this.onTimeStamp,workerPath:this.workerPath,webAssemblyPath:this.webAssemblyPath,frameRate:this.frameRate,bitrate:this.bitrate}),o.audio||this.videoRecorder.startRecording()}if(o.audio&&o.video){var s=this,d=!0===S();(o.audio instanceof x&&o.video||!0!==o.audio&&!0!==o.video&&o.audio!==o.video)&&(d=!1),!0===d?(s.audioRecorder=null,s.videoRecorder.startRecording()):s.videoRecorder.initRecorder(function(){s.audioRecorder.initRecorder(function(){s.videoRecorder.startRecording(),s.audioRecorder.startRecording()})})}o.gif&&(i=null,"function"==typeof o.gif&&(i=o.gif),this.gifRecorder=new t(e,{type:"gif",frameRate:this.frameRate||200,quality:this.quality||10,disableLogs:this.disableLogs,recorderType:i,mimeType:n.gif}),this.gifRecorder.startRecording())},this.stopRecording=function(e){e=e||function(){},this.audioRecorder&&this.audioRecorder.stopRecording(function(t){e(t,"audio")}),this.videoRecorder&&this.videoRecorder.stopRecording(function(t){e(t,"video")}),this.gifRecorder&&this.gifRecorder.stopRecording(function(t){e(t,"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(e){var t={};return this.audioRecorder&&(t.audio=this.audioRecorder.getBlob()),this.videoRecorder&&(t.video=this.videoRecorder.getBlob()),this.gifRecorder&&(t.gif=this.gifRecorder.getBlob()),e&&e(t),t},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(e){function t(e,t){if("undefined"!=typeof Worker){var i=function(e){var t,i=u.createObjectURL(new Blob([e.toString(),"this.onmessage = function (eee) {"+e.name+"(eee.data);}"],{type:"application/javascript"})),o=new Worker(i);if(void 0!==u)t=u;else{if("undefined"==typeof webkitURL)throw"Neither URL nor webkitURL detected.";t=webkitURL}return t.revokeObjectURL(i),o}(function(e){postMessage((new FileReaderSync).readAsDataURL(e))});i.onmessage=function(e){t(e.data)},i.postMessage(e)}else{var o=new FileReader;o.readAsDataURL(e),o.onload=function(e){t(e.target.result)}}}this.getBlob(function(i){i.audio&&i.video?t(i.audio,function(o){t(i.video,function(t){e({audio:o,video:t})})}):i.audio?t(i.audio,function(t){e({audio:t})}):i.video&&t(i.video,function(t){e({video:t})})})},this.writeToDisk=function(){t.writeToDisk({audio:this.audioRecorder,video:this.videoRecorder,gif:this.gifRecorder})},this.save=function(e){(e=e||{audio:!0,video:!0,gif:!0}).audio&&this.audioRecorder&&this.audioRecorder.save("string"==typeof e.audio?e.audio:""),e.video&&this.videoRecorder&&this.videoRecorder.save("string"==typeof e.video?e.video:""),e.gif&&this.gifRecorder&&this.gifRecorder.save("string"==typeof e.gif?e.gif:"")}}var a;t.version="5.6.2",e.exports=t,t.getFromDisk=function(e,t){if(!t)throw"callback is mandatory.";A.Fetch(function(i,o){"all"!==e&&o===e+"Blob"&&t&&t(i),"all"===e&&t&&t(i,o.replace("Blob",""))})},t.writeToDisk=function(e){(e=e||{}).audio&&e.video&&e.gif?e.audio.getDataURL(function(t){e.video.getDataURL(function(i){e.gif.getDataURL(function(e){A.Store({audio
2Blob:t,videoBlob:i,gifBlob:e})})})}):e.audio&&e.video?e.audio.getDataURL(function(t){e.video.getDataURL(function(e){A.Store({audioBlob:t,videoBlob:e})})}):e.audio&&e.gif?e.audio.getDataURL(function(t){e.gif.getDataURL(function(e){A.Store({audioBlob:t,gifBlob:e})})}):e.video&&e.gif?e.video.getDataURL(function(t){e.gif.getDataURL(function(e){A.Store({videoBlob:t,gifBlob:e})})}):e.audio?e.audio.getDataURL(function(e){A.Store({audioBlob:e})}):e.video?e.video.getDataURL(function(e){A.Store({videoBlob:e})}):e.gif&&e.gif.getDataURL(function(e){A.Store({gifBlob:e})})},n.getFromDisk=t.getFromDisk,n.writeToDisk=t.writeToDisk,void 0!==t&&(t.MRecordRTC=n),(a=void 0!==ce?ce:null)&&"undefined"==typeof window&&void 0!==ce&&(ce.navigator={userAgent:"Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45",getUserMedia:function(){}},ce.console||(ce.console={}),void 0!==ce.console.log&&void 0!==ce.console.error||(ce.console.error=ce.console.log=ce.console.log||function(){}),"undefined"==typeof document&&(a.document={documentElement:{appendChild:function(){return""}}},document.createElement=document.captureStream=document.mozCaptureStream=function(){var e={getContext:function(){return e},play:function(){},pause:function(){},drawImage:function(){},toDataURL:function(){return""},style:{}};return e},a.HTMLVideoElement=function(){}),"undefined"==typeof location&&(a.location={protocol:"file:",href:"",hash:""}),"undefined"==typeof screen&&(a.screen={width:0,height:0}),void 0===u&&(a.URL={createObjectURL:function(){return""},revokeObjectURL:function(){return""}}),a.window=ce);var r=window.requestAnimationFrame;if(void 0===r)if("undefined"!=typeof webkitRequestAnimationFrame)r=webkitRequestAnimationFrame;else if("undefined"!=typeof mozRequestAnimationFrame)r=mozRequestAnimationFrame;else if("undefined"!=typeof msRequestAnimationFrame)r=msRequestAnimationFrame;else if(void 0===r){var s=0;r=function(e,t){var i=(new Date).getTime(),o=Math.max(0,16-(i-s)),n=setTimeout(function(){e(i+o)},o);return s=i+o,n}}var d=window.cancelAnimationFrame;void 0===d&&("undefined"!=typeof webkitCancelAnimationFrame?d=webkitCancelAnimationFrame:"undefined"!=typeof mozCancelAnimationFrame?d=mozCancelAnimationFrame:"undefined"!=typeof msCancelAnimationFrame?d=msCancelAnimationFrame:void 0===d&&(d=function(e){clearTimeout(e)}));var c=window.AudioContext;void 0===c&&("undefined"!=typeof webkitAudioContext&&(c=webkitAudioContext),"undefined"!=typeof mozAudioContext&&(c=mozAudioContext));var u=window.URL;void 0===u&&"undefined"!=typeof webkitURL&&(u=webkitURL),"undefined"!=typeof navigator&&void 0===navigator.getUserMedia&&(void 0!==navigator.webkitGetUserMedia&&(navigator.getUserMedia=navigator.webkitGetUserMedia),void 0!==navigator.mozGetUserMedia&&(navigator.getUserMedia=navigator.mozGetUserMedia));var l=!(-1===navigator.userAgent.indexOf("Edge")||!navigator.msSaveBlob&&!navigator.msSaveOrOpenBlob),f=!!window.opera||-1!==navigator.userAgent.indexOf("OPR/"),g=navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&"netscape"in window&&/ rv:/.test(navigator.userAgent),m=!f&&!l&&!!navigator.webkitGetUserMedia||w()||-1!==navigator.userAgent.toLowerCase().indexOf("chrome/"),h=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);h&&!m&&-1!==navigator.userAgent.indexOf("CriOS")&&(h=!1,m=!0);var p=window.MediaStream;function v(e){if(0===e)return"0 Bytes";var t=parseInt(Math.floor(Math.log(e)/Math.log(1e3)),10);return(e/Math.pow(1e3,t)).toPrecision(3)+" "+["Bytes","KB","MB","GB","TB"][t]}function b(e,t){if(!e)throw"Blob object is required.";if(!e.type)try{e.type="video/webm"}catch(r){}var i=(e.type||"video/webm").split("/")[1];if(-1!==i.indexOf(";")&&(i=i.split(";")[0]),t&&-1!==t.indexOf(".")){var o=t.split(".");t=o[0],i=o[1]}var n=(t||Math.round(9999999999*Math.random())+888888888)+"."+i;if(void 0!==navigator.msSaveOrOpenBlob)return navigator.msSaveOrOpenBlob(e,n);if(void 0!==navigator.msSaveBlob)return navigator.msSaveBlob(e,n);var a=document.createElement("a");a.href=u.createObjectURL(e),a.download=n,a.style="display:none;opacity:0;color:transparent;",(document.body||document.documentElement).appendChild(a),"function"==typeof a.click?a.click():(a.target="_blank",a.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0}))),u.revokeObjectURL(a.href)}function w(){return"undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||!("undefined"==typeof process||"object"!=typeof process.versions||!process.versions.electron)||"object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}function y(e,t){return e&&e.getTracks?e.getTracks().filter(function(e){return e.kind===(t||"audio")}):[]}function R(e,t){"srcObject"in t?t.srcObject=e:"mozSrcObject"in t?t.mozSrcObject=e:t.srcObject=e}void 0===p&&"undefined"!=typeof webkitMediaStream&&(p=webkitMediaStream),void 0!==p&&void 0===p.prototype.stop&&(p.prototype.stop=function(){this.getTracks().forEac
2h(function(e){e.stop()})}),void 0!==t&&(t.invokeSaveAsDialog=b,t.getTracks=y,t.getSeekableBlob=function(e,t){if("undefined"==typeof EBML)throw new Error("Please link: https://www.webrtc-experiment.com/EBML.js");var i=new EBML.Reader,o=new EBML.Decoder,n=EBML.tools,a=new FileReader;a.onload=function(e){o.decode(this.result).forEach(function(e){i.read(e)}),i.stop();var a=n.makeMetadataSeekable(i.metadatas,i.duration,i.cues),r=this.result.slice(i.metadataSize),s=new Blob([a,r],{type:"video/webm"});t(s)},a.readAsArrayBuffer(e)},t.bytesToSize=v,t.isElectron=w);var k={};function S(){if(g||h||l)return!0;var e,t,i=navigator.userAgent,o=""+parseFloat(navigator.appVersion),n=parseInt(navigator.appVersion,10);return(m||f)&&(e=i.indexOf("Chrome"),o=i.substring(e+7)),-1!==(t=o.indexOf(";"))&&(o=o.substring(0,t)),-1!==(t=o.indexOf(" "))&&(o=o.substring(0,t)),n=parseInt(""+o,10),isNaN(n)&&(o=""+parseFloat(navigator.appVersion),n=parseInt(navigator.appVersion,10)),n>=49}function C(e,t){var i,o=this;if(void 0===e)throw'First argument "MediaStream" is required.';if("undefined"==typeof MediaRecorder)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&&(y(e,"video").length&&y(e,"audio").length&&(navigator.mozGetUserMedia?(i=new p).addTrack(y(e,"audio")[0]):i=new p(y(e,"audio")),e=i),t.mimeType&&-1!==t.mimeType.toString().toLowerCase().indexOf("audio")||(t.mimeType=m?"audio/webm":"audio/ogg"),t.mimeType&&"audio/ogg"!==t.mimeType.toString().toLowerCase()&&navigator.mozGetUserMedia&&(t.mimeType="audio/ogg"));var n,a=[];function r(){o.timestamps.push((new Date).getTime()),"function"==typeof t.onTimeStamp&&t.onTimeStamp(o.timestamps[o.timestamps.length-1],o.timestamps)}function s(e){return n&&n.mimeType?n.mimeType:e.mimeType||"video/webm"}function d(){a=[],n=null,o.timestamps=[]}this.getArrayOfBlobs=function(){return a},this.record=function(){o.blob=null,o.clearRecordedData(),o.timestamps=[],c=[],a=[];var i=t;t.disableLogs,n&&(n=null),m&&!S()&&(i="video/vp8"),"function"==typeof MediaRecorder.isTypeSupported&&i.mimeType&&(MediaRecorder.isTypeSupported(i.mimeType)||(t.disableLogs,i.mimeType="audio"===t.type?"audio/webm":"video/webm"));try{n=new MediaRecorder(e,i),t.mimeType=i.mimeType}catch(d){n=new MediaRecorder(e)}i.mimeType&&!MediaRecorder.isTypeSupported&&"canRecordMimeType"in n&&!1===n.canRecordMimeType(i.mimeType)&&t.disableLogs,n.ondataavailable=function(e){if(e.data&&c.push("ondataavailable: "+v(e.data.size)),"number"!=typeof t.timeSlice)!e.data||!e.data.size||e.data.size<100||o.blob?o.recordingCallback&&(o.recordingCallback(new Blob([],{type:s(i)})),o.recordingCallback=null):(o.blob=t.getNativeBlob?e.data:new Blob([e.data],{type:s(i)}),o.recordingCallback&&(o.recordingCallback(o.blob),o.recordingCallback=null));else if(e.data&&e.data.size&&(a.push(e.data),r(),"function"==typeof t.ondataavailable)){var n=t.getNativeBlob?e.data:new Blob([e.data],{type:s(i)});t.ondataavailable(n)}},n.onstart=function(){c.push("started")},n.onpause=function(){c.push("paused")},n.onresume=function(){c.push("resumed")},n.onstop=function(){c.push("stopped")},n.onerror=function(e){e&&(e.name||(e.name="UnknownError"),c.push("error: "+e),t.disableLogs||-1!==e.name.toString().toLowerCase().indexOf("invalidstate")||-1!==e.name.toString().toLowerCase().indexOf("notsupported")||-1!==e.name.toString().toLowerCase().indexOf("security")||"OutOfMemory"===e.name||"IllegalStreamModification"===e.name||"OtherRecordingError"===e.name||e.name,function(){if(!o.manuallyStopped&&n&&"inactive"===n.state)return delete t.timeslice,void n.start(6e5);setTimeout(void 0,1e3)}(),"inactive"!==n.state&&"stopped"!==n.state&&n.stop())},"number"==typeof t.timeSlice?(r(),n.start(t.timeSlice)):n.start(36e5),t.initCallback&&t.initCallback()},this.timestamps=[],this.stop=function(e){e=e||function(){},o.manuallyStopped=!0,n&&(this.recordingCallback=e,"recording"===n.state&&n.stop(),"number"==typeof t.timeSlice&&setTimeout(function(){o.blob=new Blob(a,{type:s(t)}),o.recordingCallback(o.blob)},100))},this.pause=function(){n&&"recording"===n.state&&n.pause()},this.resume=function(){n&&"paused"===n.state&&n.resume()},this.clearRecordedData=function(){n&&"recording"===n.state&&o.stop(d),d()},this.getInternalRecorder=function(){return n}
vendor: 4,112 bytes, line 2
2,this.blob=null,this.getState=function(){return n&&n.state||"inactive"};var c=[];this.getAllStates=function(){return c},void 0===t.checkForInactiveTracks&&(t.checkForInactiveTracks=!1),o=this,function i(){if(n&&!1!==t.checkForInactiveTracks)return!1===function(){if("active"in e){if(!e.active)return!1}else if("ended"in e&&e.ended)return!1;return!0}()?(t.disableLogs,void o.stop()):void setTimeout(i,1e3)}(),this.name="MediaStreamRecorder",this.toString=function(){return this.name}}function x(e,i){if(!y(e,"audio").length)throw"Your stream has no audio tracks.";var o,n=this,a=[],r=[],s=!1,d=0,c=2,l=(i=i||{}).desiredSampRate;function f(){if(!1===i.checkForInactiveTracks)return!0;if("active"in e){if(!e.active)return!1}else if("ended"in e&&e.ended)return!1;return!0}function g(e,t){function i(e,t){var i,o=e.numberOfAudioChannels,n=e.leftBuffers.slice(0),a=e.rightBuffers.slice(0),r=e.sampleRate,s=e.internalInterleavedLength,d=e.desiredSampRate;function c(e,t,i){var o=Math.round(e.length*(t/i)),n=[],a=Number((e.length-1)/(o-1));n[0]=e[0];for(var r=1;r<o-1;r++){var s=r*a,d=Number(Math.floor(s)).toFixed(),c=Number(Math.ceil(s)).toFixed(),l=s-d;n[r]=u(e[d],e[c],l)}return n[o-1]=e[e.length-1],n}function u(e,t,i){return e+(t-e)*i}function l(e,t){for(var i=new Float64Array(t),o=0,n=e.length,a=0;a<n;a++){var r=e[a];i.set(r,o),o+=r.length}return i}function f(e,t,i){for(var o=i.length,n=0;n<o;n++)e.setUint8(t+n,i.charCodeAt(n))}2===o&&(n=l(n,s),a=l(a,s),d&&(n=c(n,d,r),a=c(a,d,r))),1===o&&(n=l(n,s),d&&(n=c(n,d,r))),d&&(r=d),2===o&&(i=function(e,t){for(var i=e.length+t.length,o=new Float64Array(i),n=0,a=0;a<i;)o[a++]=e[n],o[a++]=t[n],n++;return o}(n,a)),1===o&&(i=n);var g=i.length,m=new ArrayBuffer(44+2*g),h=new DataView(m);f(h,0,"RIFF"),h.setUint32(4,36+2*g,!0),f(h,8,"WAVE"),f(h,12,"fmt "),h.setUint32(16,16,!0),h.setUint16(20,1,!0),h.setUint16(22,o,!0),h.setUint32(24,r,!0),h.setUint32(28,r*o*2,!0),h.setUint16(32,2*o,!0),h.setUint16(34,16,!0),f(h,36,"data"),h.setUint32(40,2*g,!0);for(var p=g,v=44,b=0;b<p;b++)h.setInt16(v,32767*i[b],!0),v+=2;if(t)return t({buffer:m,view:h});postMessage({buffer:m,view:h})}if(e.noWorker)i(e,function(e){t(e.buffer,e.view)});else{var o,n,a,r=(o=i,n=u.createObjectURL(new Blob([o.toString(),";this.onmessage = function (eee) {"+o.name+"(eee.data);}"],{type:"application/javascript"})),(a=new Worker(n)).workerURL=n,a);r.onmessage=function(e){t(e.data.buffer,e.data.view),u.revokeObjectURL(r.workerURL),r.terminate()},r.postMessage(e)}}!0===i.leftChannel&&(c=1),1===i.numberOfAudioChannels&&(c=1),(!c||c<1)&&(c=2),i.disableLogs,void 0===i.checkForInactiveTracks&&(i.checkForInactiveTracks=!0),this.record=function(){if(!1===f())throw"Please make sure MediaStream is active.";w(),k=b=!1,s=!0,void 0!==i.timeSlice&&C()},this.stop=function(e){e=e||function(){},s=!1,g({desiredSampRate:l,sampleRate:v,numberOfAudioChannels:c,internalInterleavedLength:d,leftBuffers:a,rightBuffers:1===c?[]:r,noWorker:i.noWorker},function(t,i){n.blob=new Blob([i],{type:"audio/wav"}),n.buffer=new ArrayBuffer(i.buffer.byteLength),n.view=i,n.sampleRate=l||v,n.bufferSize=p,n.length=d,k=!1,e&&e(n.blob)})},void 0===t.Storage&&(t.Storage={AudioContextConstructor:null,AudioContext:window.AudioContext||window.webkitAudioContext}),t.Storage.AudioContextConstructor&&"closed"!==t.Storage.AudioContextConstructor.state||(t.Storage.AudioContextConstructor=new t.Storage.AudioContext);var m=t.Storage.AudioContextConstructor,h=m.createMediaStreamSource(e),p=void 0===i.bufferSize?4096:i.bufferSize;if(-1===[0,256,512,1024,2048,4096,8192,16384].indexOf(p)&&i.disableLogs,m.createJavaScriptNode)o=m.createJavaScriptNode(p,c,c);else{if(!m.createScriptProcessor)throw"WebAudio API has no support on this browser.";o=m.createScriptProcessor(p,c,c)}h.connect(o),i.bufferSize||(p=o.bufferSize);var v=void 0!==i.sampleRate?i.sampleRate:m.sampleRate||44100;(v<22050||v>96e3)&&i.disableLogs,i.disableLogs||i.desiredSampRate;var b=!1;function w(){a=[],r=[],d=0,k=!1,s=!1,b=!1,m=null,n.leftchannel=a,n.rightchannel=r,n.numberOfAudioChannels=c,n.desiredSampRate=l,n.sampleRate=v,n.recordingLength=d,S={left:[],r
2ight:[],recordingLength:0}}function R(){o&&(o.onaudioprocess=null,o.disconnect(),o=null),h&&(h.disconnect(),h=null),w()}this.pause=function(){b=!0},this.resume=function(){if(!1===f())throw"Please make sure MediaStream is active.";if(!s)return i.disableLogs,void this.record();b=!1},this.clearRecordedData=function(){i.checkForInactiveTracks=!1,s&&this.stop(R),R()},this.name="StereoAudioRecorder",this.toString=function(){return this.name};var k=!1;o.onaudioprocess=function(e){if(!b)if(!1===f()&&(i.disableLogs,o.disconnect(),s=!1),s){k||(k=!0,i.onAudioProcessStarted&&i.onAudioProcessStarted(),i.initCallback&&i.initCallback());var t=e.inputBuffer.getChannelData(0),u=new Float32Array(t);if(a.push(u),2===c){var l=e.inputBuffer.getChannelData(1),g=new Float32Array(l);r.push(g)}d+=p,n.recordingLength=d,void 0!==i.timeSlice&&(S.recordingLength+=p,S.left.push(u),2===c&&S.right.push(g))}else h&&(h.disconnect(),h=null)},m.createMediaStreamDestination?o.connect(m.createMediaStreamDestination()):o.connect(m.destination),this.leftchannel=a,this.rightchannel=r,this.numberOfAudioChannels=c,this.desiredSampRate=l,this.sampleRate=v,n.recordingLength=d;var S={left:[],right:[],recordingLength:0};function C(){s&&"function"==typeof i.ondataavailable&&void 0!==i.timeSlice&&(S.left.length?(g({desiredSampRate:l,sampleRate:v,numberOfAudioChannels:c,internalInterleavedLength:S.recordingLength,leftBuffers:S.left,rightBuffers:1===c?[]:S.right},function(e,t){var o=new Blob([t],{type:"audio/wav"});i.ondataavailable(o),setTimeout(C,i.timeSlice)}),S={left:[],right:[],recordingLength:0}):setTimeout(C,i.timeSlice))}}function T(e,t){if("undefined"==typeof html2canvas)throw"Please link: https://www.webrtc-experiment.com/screenshot.js";(t=t||{}).frameInterval||(t.frameInterval=10);var i=!1;["captureStream","mozCaptureStream","webkitCaptureStream"].forEach(function(e){e in document.createElement("canvas")&&(i=!0)});var o,n,a,r=!(!window.webkitRTCPeerConnection&&!window.webkitGetUserMedia||!window.chrome),s=50,d=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);if(r&&d&&d[2]&&(s=parseInt(d[2],10)),r&&s<52&&(i=!1),t.useWhammyRecorder&&(i=!1),i)if(t.disableLogs,e instanceof HTMLCanvasElement)o=e;else{if(!(e instanceof CanvasRenderingContext2D))throw"Please pass either HTMLCanvasElement or CanvasRenderingContext2D.";o=e.canvas}else navigator.mozGetUserMedia&&t.disableLogs;this.record=function(){if(a=!0,i&&!t.useWhammyRecorder){var e;"captureStream"in o?e=o.captureStream(25):"mozCaptureStream"in o?e=o.mozCaptureStream(25):"webkitCaptureStream"in o&&(e=o.webkitCaptureStream(25));try{var r=new p;r.addTrack(y(e,"video")[0]),e=r}catch(s){}if(!e)throw"captureStream API are NOT available.";(n=new C(e,{mimeType:t.mimeType||"video/webm"})).record()}else g.frames=[],f=(new Date).getTime(),l();t.initCallback&&t.initCallback()},this.getWebPImages=function(i){if("canvas"===e.nodeName.toLowerCase()){var o=g.frames.length;g.frames.forEach(function(e,i){var n=o-i;t.disableLogs,t.onEncodingCallback&&t.onEncodingCallback(n,o);var a=e.image.toDataURL("image/webp",1);g.frames[i].image=a}),t.disableLogs,i()}else i()},this.stop=function(e){a=!1;var o=this;i&&n?n.stop(e):this.getWebPImages(function(){g.compile(function(i){t.disableLogs,o.blob=i,o.blob.forEach&&(o.blob=new Blob([],{type:"video/webm"})),e&&e(o.blob),g.frames=[]})})};var c=!1;function u(){g.frames=[],a=!1,c=!1}function l(){if(c)return f=(new Date).getTime(),setTimeout(l,500);if("canvas"===e.nodeName.toLowerCase()){var i=(new Date).getTime()-f;return f=(new Date).getTime(),g.frames.push({image:(o=document.createElement("canvas"),n=o.getContext("2d"),o.width=e.width,o.height=e.height,n.drawImage(e,0,0),o),duration:i}),void(a&&setTimeout(l,t.frameInterval))}var o,n;html2canvas(e,{grabMouse:void 0===t.showMousePointer||t.showMousePointer,onrendered:function(e){var i=(new Date).getTime()-f;if(!i)return setTimeout(l,t.frameInterval);f=(new Date).getTime(),g.frames.push({image:e.toDataURL("image/webp",1),duration:i}),a&&setTimeout(l,t.frameInterval)}})}this.pause=function(){c=!0,n instanceof C&&n.pause()},this.resume=function(){c=!1,n instanceof C?n.resume():a||this.record()},this.clearRecordedData=function(){a&&this.stop(u),u()},this.name="CanvasRecorder",this.toString=function(){return this.name};var f=(new Date).getTime(),g=new M.Video(100)}function L(e,t){function i(e){e=void 0!==e?e:10;var t=(new Date).getTime()-s;return t?n?(s=(new Date).getTime(),setTimeout(i,100)):(s=(new Date).getTime(),r.paused&&r.play(),u.drawImage(r,0,0,c.width,c.height),d.frames.push({duration:t,image:c.toDataURL("image/webp")}),void(o||setTimeout(i,e,e))):setTimeout(i,e,e)}(t=t||{}).frameInterval||(t.frameInterval=10),t.disableLogs,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}),c.width=t.canvas.width||320,c.height=t.canvas.height||240,u=c.getContext("2d"),t.video&&t.video instanceof HTMLVideoElement?(r=t.video.cloneNode(),t.initCallback&&t.initCallback()):(r=document.createElement("video"),R(e,r),r.onloadedmetadata=function(){t.initCallback&&t.initCallback()},r.width=t.video.width,r.height=t.video.height),r.muted=!0,r.play(),s=(new Date).getTime(),d=new M.Video,t.disableLogs,i(t.frameInterval)};var o=!1;this.stop=function(e){e=e||function(){},o=!0;var i=this;setTimeout(function(){!function(e,t,i,o,n){var a=document.createElement("canvas");a.width=c.width,a.height=c.height;var r,s,d,u=a.getContext("2d"),l=[],f=e.length,g=Math.sqrt(Math.pow(255,2)+Math.pow(255,2)+Math.pow(255,2)),m=!1;s=-1,d=(r={length:f,functionToLoop:function(t,i){var o,n,a,r=function(){!m&&a-o<=0*a||(m=!0,l.push(e[i])),t()};if(m)r();else{var s=new Image;s.onload=function(){u.drawImage(s,0,0,c.width,c.height);var e=u.getImageData(0,0,c.width,c.height);o=0,n=e.data.length,a=e.data.length/4;for(var t=0;t<n;t+=4){var i={r:e.data[t],g:e.data[t+1],b:e.data[t+2]};Math.sqrt(Math.pow(i.r-0,2)+Math.pow(i.g-0,2)+Math.pow(i.b-0,2))<=0*g&&o++}r()},s.src=e[i].image}},callback:function(){(l=l.concat(e.slice(f))).length<=0&&l.push(e[e.length-1]),n(l)}}).length,function e(){++s!==d?setTimeout(function(){r.functionToLoop(e,s)},1):r.callback()}()}(d.frames,0,0,0,function(o){d.frames=o,t.advertisement&&t.advertisement.length&&(d.frames=t.advertisement.concat(d.frames)),d.compile(function(t){i.blob=t,i.blob.forEach&&(i.blob=new Blob([],{type:"video/webm"})),e&&e(i.blob)})})},10)};var n=!1;function a(){d.frames=[],o=!0,n=!1}this.pause=function(){n=!0},this.resume=function(){n=!1,o&&this.record()},this.clearRecordedData=function(){o||this.stop(a),a()},this.name="WhammyRecorder",this.toString=function(){return this.name};var r,s,d,c=document.createElement("canvas"),u=c.getContext("2d")}void 0!==c?k.AudioContext=c:"undefined"!=typeof webkitAudioContext&&(k.AudioContext=webkitAudioContext),void 0!==t&&(t.Storage=k),void 0!==t&&(t.MediaStreamRecorder=C),void 0!==t&&(t.StereoAudioRecorder=x),void 0!==t&&(t.CanvasRecorder=T),void 0!==t&&(t.WhammyRecorder=L);var M=function(){function e(e){this.frames=[],this.duration=e||1,this.qual
2ity=.8}function t(e){function t(e,t,i){return[{data:e,id:231}].concat(i.map(function(e){var i,o,n=(o=0,[128|(i={frame:e.data.slice(4),trackNum:1,timecode:Math.round(t)}).trackNum,i.timecode>>8,255&i.timecode,o|=128].map(function(e){return String.fromCharCode(e)}).join("")+i.frame);return t+=e.duration,{data:n,id:163}}))}function i(e){for(var t=[];e>0;)t.push(255&e),e>>=8;return new Uint8Array(t.reverse())}function o(e){return new Uint8Array(e.split("").map(function(e){return e.charCodeAt(0)}))}function n(e){var t=[];e=(e.length%8?new Array(9-e.length%8).join("0"):"")+e;for(var i=0;i<e.length;i+=8)t.push(parseInt(e.substr(i,8),2));return new Uint8Array(t)}function a(e){for(var t=[],r=0;r<e.length;r++){var s=e[r].data;"object"==typeof s&&(s=a(s)),"number"==typeof s&&(s=n(s.toString(2))),"string"==typeof s&&(s=o(s));var d=s.size||s.byteLength||s.length,c=Math.ceil(Math.ceil(Math.log(d)/Math.log(2))/8),u=d.toString(2),l=new Array(7*c+7+1-u.length).join("0")+u,f=new Array(c).join("0")+"1"+l;t.push(i(e[r].id)),t.push(n(f)),t.push(s)}return new Blob(t,{type:"video/webm"})}function r(e,t){return parseInt(e.substr(t+4,4).split("").map(function(e){var t=e.charCodeAt(0).toString(2);return new Array(8-t.length+1).join("0")+t}).join(""),2)}function s(e){for(var t=0,i={};t<e.length;){var o=e.substr(t,4),n=r(e,t),a=e.substr(t+4+4,n);t+=8+n,i[o]=i[o]||[],"RIFF"===o||"LIST"===o?i[o].push(s(a)):i[o].push(a)}return i}var d=new function(e){var i=function(e){if(e[0]){for(var t=e[0].width,i=e[0].height,o=e[0].duration,n=1;n<e.length;n++)o+=e[n].duration;return{duration:o,width:t,height:i}}postMessage({error:"Something went wrong. Maybe WebP format is not supported in the current browser."})}(e);if(!i)return[];for(var o,n=[{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:(o=i.duration,[].slice.call(new Uint8Array(new Float64Array([o]).buffer),0).map(function(e){return String.fromCharCode(e)}).reverse().join("")),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:i.width,id:176},{data:i.height,id:186}]}]}]}]}],r=0,s=0;r<e.length;){var d=[],c=0;do{d.push(e[r]),c+=e[r].duration,r++}while(r<e.length&&c<3e4);var u={id:524531317,data:t(s,0,d)};n[1].data.push(u),s+=c}return a(n)}(e.map(function(e){var t=function(e){for(var t=e.RIFF[0].WEBP[0],i=t.indexOf("�*"),o=0,n=[];o<4;o++)n[o]=t.charCodeAt(i+3+o);return{width:16383&(n[1]<<8|n[0]),height:16383&(n[3]<<8|n[2]),data:t,riff:e}}(s(atob(e.image.slice(23))));return t.duration=e.duration,t}));postMessage(d)}return e.prototype.add=function(e,t){if("canvas"in e&&(e=e.canvas),"toDataURL"in e&&(e=e.toDataURL("image/webp",this.quality)),!/^data:image\/webp;base64,/gi.test(e))throw"Input must be formatted properly as a base64 encoded DataURI of type image/webp";this.frames.push({image:e,duration:t||this.duration})},e.prototype.compile=function(e){var i,o,n,a=(i=t,o=u.createObjectURL(new Blob([i.toString(),"this.onmessage = function (eee) {"+i.name+"(eee.data);}"],{type:"application/javascript"})),n=new Worker(o),u.revokeObjectURL(o),n);a.onmessage=function(t){t.data.error||e(t.data)},a.postMessage(this.frames)},{Video:e}}();void 0!==t&&(t.Whammy=M);var A={init:function(){var e=this;if("undefined"!=typeof indexedDB&&void 0!==indexedDB.open){var t,i=this.dbName||location.href.replace(/\/|:|#|%|\.|\[|\]/g,""),o=indexedDB.open(i,1);o.onerror=e.onError,o.onsuccess=function(){(t=o.result).onerror=e.onError,t.setVersion&&1!==t.version?t.setVersion(1).onsuccess=function(){n(t),a()}:a()},o.onupgradeneeded=function(e){n(e.target.result)}}function n(t){t.createObjectStore(e.dataStoreName)}function a(){var i=t.transaction([e.dataStoreName],"readwrite");function o(t){i.objectStore(e.dataStoreName).get(t).onsuccess=function(i){e.callback&&e.callback(i.target.result,t)}}e.videoBlob&&i.objectStore(e.dataStoreName).put(e.videoBlob,"videoBlob"),e.gifBlob&&i.objectStore(e.dataStoreName).put(e.gifBlob,"gifBlob"),e.audioBlob&&i.objectStore(e.dataStoreName).put(e.audioBlob,"audio
2Blob"),o("audioBlob"),o("videoBlob"),o("gifBlob")}},Fetch:function(e){return this.callback=e,this.init(),this},Store:function(e){return this.audioBlob=e.audioBlob,this.videoBlob=e.videoBlob,this.gifBlob=e.gifBlob,this.init(),this},onError:function(e){},dataStoreName:"recordRTC",dbName:null};function B(e,t){if("undefined"==typeof GIFEncoder){var i=document.createElement("script");i.src="https://www.webrtc-experiment.com/gif-recorder.js",(document.body||document.documentElement).appendChild(i)}t=t||{};var o=e instanceof CanvasRenderingContext2D||e instanceof HTMLCanvasElement;this.record=function(){"undefined"!=typeof GIFEncoder&&c?(o||(t.width||(t.width=u.offsetWidth||320),t.height||(t.height=u.offsetHeight||240),t.video||(t.video={width:t.width,height:t.height}),t.canvas||(t.canvas={width:t.width,height:t.height}),a.width=t.canvas.width||320,a.height=t.canvas.height||240,u.width=t.video.width||320,u.height=t.video.height||240),(f=new GIFEncoder).setRepeat(0),f.setDelay(t.frameRate||200),f.setQuality(t.quality||10),f.start(),"function"==typeof t.onGifRecordingStarted&&t.onGifRecordingStarted(),g=r(function e(i){if(!0!==m.clearedRecordedData){if(n)return setTimeout(function(){e(i)},100);g=r(e),void 0===typeof l&&(l=i),i-l<90||(!o&&u.paused&&u.play(),o||s.drawImage(u,0,0,a.width,a.height),t.onGifPreview&&t.onGifPreview(a.toDataURL("image/png")),f.addFrame(s),l=i)}}),t.initCallback&&t.initCallback()):setTimeout(m.record,1e3)},this.stop=function(e){e=e||function(){},g&&d(g),this.blob=new Blob([new Uint8Array(f.stream().bin)],{type:"image/gif"}),e(this.blob),f.stream().bin=[]};var n=!1;this.pause=function(){n=!0},this.resume=function(){n=!1},this.clearRecordedData=function(){m.clearedRecordedData=!0,f&&(f.stream().bin=[])},this.name="GifRecorder",this.toString=function(){return this.name};var a=document.createElement("canvas"),s=a.getContext("2d");o&&(e instanceof CanvasRenderingContext2D?a=(s=e).canvas:e instanceof HTMLCanvasElement&&(s=e.getContext("2d"),a=e));var c=!0;if(!o){var u=document.createElement("video");u.muted=!0,u.autoplay=!0,u.playsInline=!0,c=!1,u.onloadedmetadata=function(){c=!0},R(e,u),u.play()}var l,f,g=null,m=this}function D(e,i){!function(e){void 0===t&&e&&"undefined"==typeof window&&void 0!==ce&&(ce.navigator={userAgent:"Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45",getUserMedia:function(){}},ce.console||(ce.console={}),void 0!==ce.console.log&&void 0!==ce.console.error||(ce.console.error=ce.console.log=ce.console.log||function(){}),"undefined"==typeof document&&(e.document={documentElement:{appendChild:function(){return""}}},document.createElement=document.captureStream=document.mozCaptureStream=function(){var e={getContext:function(){return e},play:function(){},pause:function(){},drawImage:function(){},toDataURL:function(){return""},style:{}};return e},e.HTMLVideoElement=function(){}),"undefined"==typeof location&&(e.location={protocol:"file:",href:"",hash:""}),"undefined"==typeof screen&&(e.screen={width:0,height:0}),void 0===c&&(e.URL={createObjectURL:function(){return""},revokeObjectURL:function(){return""}}),e.window=ce)}(void 0!==ce?ce:null),i=i||"multi-streams-mixer";var o=[],n=!1,a=document.createElement("canvas"),r=a.getContext("2d");a.style.opacity=0,a.style.position="absolute",a.style.zIndex=-1,a.style.top="-1000em",a.style.left="-1000em",a.className=i,(document.body||document.documentElement).appendChild(a),this.disableLogs=!1,this.frameInterval=10,this.width=360,this.height=240,this.useGainNode=!0;var s=this,d=window.AudioContext;void 0===d&&("undefined"!=typeof webkitAudioContext&&(d=webkitAudioContext),"undefined"!=typeof mozAudioContext&&(d=mozAudioContext));var c=window.URL;void 0===c&&"undefined"!=typeof webkitURL&&(c=webkitURL),"undefined"!=typeof navigator&&void 0===navigator.getUserMedia&&(void 0!==navigator.webkitGetUserMedia&&(navigator.getUserMedia=navigator.webkitGetUserMedia),void 0!==navigator.mozGetUserMedia&&(navigator.getUserMedia=navigator.mozGetUserMedia));var u=window.MediaStream;void 0===u&&"undefined"!=typeof webkitMediaStream&&(u=webkitMediaStream),void 0!==u&&void 0===u.prototype.stop&&(u.prototype.stop=function(){this.getTracks().forEac
2h(function(e){e.stop()})});var l={};function f(){if(!n){var e=o.length,t=!1,i=[];if(o.forEach(function(e){e.stream||(e.stream={}),e.stream.fullcanvas?t=e:i.push(e)}),t)a.width=t.stream.width,a.height=t.stream.height;else if(i.length){a.width=e>1?2*i[0].width:i[0].width;var r=1;3!==e&&4!==e||(r=2),5!==e&&6!==e||(r=3),7!==e&&8!==e||(r=4),9!==e&&10!==e||(r=5),a.height=i[0].height*r}else a.width=s.width||360,a.height=s.height||240;t&&t instanceof HTMLVideoElement&&g(t),i.forEach(function(e,t){g(e,t)}),setTimeout(f,s.frameInterval)}}function g(e,t){if(!n){var i=0,o=0,a=e.width,s=e.height;1===t&&(i=e.width),2===t&&(o=e.height),3===t&&(i=e.width,o=e.height),4===t&&(o=2*e.height),5===t&&(i=e.width,o=2*e.height),6===t&&(o=3*e.height),7===t&&(i=e.width,o=3*e.height),void 0!==e.stream.left&&(i=e.stream.left),void 0!==e.stream.top&&(o=e.stream.top),void 0!==e.stream.width&&(a=e.stream.width),void 0!==e.stream.height&&(s=e.stream.height),r.drawImage(e,i,o,a,s),"function"==typeof e.stream.onRender&&e.stream.onRender(r,i,o,a,s,t)}}function m(e){var t=document.createElement("video");return function(e,t){"srcObject"in t?t.srcObject=e:"mozSrcObject"in t?t.mozSrcObject=e:t.srcObject=e}(e,t),t.className=i,t.muted=!0,t.volume=0,t.width=e.width||s.width||360,t.height=e.height||s.height||240,t.play(),t}function h(t){o=[],(t=t||e).forEach(function(e){if(e.getTracks().filter(function(e){return"video"===e.kind}).length){var t=m(e);t.stream=e,o.push(t)}})}void 0!==d?l.AudioContext=d:"undefined"!=typeof webkitAudioContext&&(l.AudioContext=webkitAudioContext),this.startDrawingFrames=function(){f()},this.appendStreams=function(t){if(!t)throw"First parameter is required.";t instanceof Array||(t=[t]),t.forEach(function(t){var i=new u;if(t.getTracks().filter(function(e){return"video"===e.kind}).length){var n=m(t);n.stream=t,o.push(n),i.addTrack(t.getTracks().filter(function(e){return"video"===e.kind})[0])}if(t.getTracks().filter(function(e){return"audio"===e.kind}).length){var a=s.audioContext.createMediaStreamSource(t);s.audioDestination=s.audioContext.createMediaStreamDestination(),a.connect(s.audioDestination),i.addTrack(s.audioDestination.stream.getTracks().filter(function(e){return"audio"===e.kind})[0])}e.push(i)})},this.releaseStreams=function(){o=[],n=!0,s.gainNode&&(s.gainNode.disconnect(),s.gainNode=null),s.audioSources.length&&(s.audioSources.forEach(function(e){e.disconnect()}),s.audioSources=[]),s.audioDestination&&(s.audioDestination.disconnect(),s.audioDestination=null),s.audioContext&&s.audioContext.close(),s.audioContext=null,r.clearRect(0,0,a.width,a.height),a.stream&&(a.stream.stop(),a.stream=null)},this.resetVideoStreams=function(e){!e||e instanceof Array||(e=[e]),h(e)},this.name="MultiStreamsMixer",this.toString=function(){return this.name},this.getMixedStream=function(){n=!1;var t=function(){var e;h(),"captureStream"in a?e=a.captureStream():"mozCaptureStream"in a?e=a.mozCaptureStream():s.disableLogs;var t=new u;return e.getTracks().filter(function(e){return"video"===e.kind}).forEach(function(e){t.addTrack(e)}),a.stream=t,t}(),i=function(){l.AudioContextConstructor||(l.AudioContextConstructor=new l.AudioContext),s.audioContext=l.AudioContextConstructor,s.audioSources=[],!0===s.useGainNode&&(s.gainNode=s.audioContext.createGain(),s.gainNode.connect(s.audioContext.destination),s.gainNode.gain.value=0);var t=0;if(e.forEach(function(e){if(e.getTracks().filter(function(e){return"audio"===e.kind}).length){t++;var i=s.audioContext.createMediaStreamSource(e);!0===s.useGainNode&&i.connect(s.gainNode),s.audioSources.push(i)}}),t)return s.audioDestination=s.audioContext.createMediaStreamDestination(),s.audioSources.forEach(function(e){e.connect(s.audioDestination)}),s.audioDestination.stream}();return i&&i.getTracks().filter(function(e){return"audio"===e.kind}).forEach(function(e){t.addTrack(e)}),e.forEach(function(e){e.fullcanvas}),t}}function j(e,t){e=e||[];var i,o,n=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(){var n;i=new D(e,t.elementClass||"multi-streams-mixer"),(n=[],e.forEach(function(e){y(e,"video").forEach(function(e){n.push(e)})}),n).length&&(i.frameInterval=t.frameInterval||10,i.width=t.video.width||360,i.height=t.video.height||240,i.startDrawingFrames()),t.previewStream&&"function"==typeof t.previewStream&&t.previewStream(i.getMixedStream()),(o=new C(i.getMixedStream(),t)).record()},this.stop=function(e){o&&o.stop(function(t){n.blob=t,e(t),n.clearRecordedData()})},this.pause=function(){o&&o.pause()},this.resume=function(){o&&o.resume()},this.clearRecordedData=function(){o&&(o.clearRecordedData(),o=null),i&&(i.releaseStreams(),i=null)},this.addStreams=function(n){if(!n)throw"First parameter is required.";n instanceof Array||(n=[n]),e.concat(n),o&&i&&(i.appendStreams(n),t.previewStream&&"function"==typeof t.previewStream&&t.previewStream(i.getMixedStream()))},this.resetVideoStreams=function(e){i&&(!e||e instanceof Array||(e=[e]),i.resetVideoStreams(e))},this.getMixer=function(){return i},this.name="MultiStreamRecorder",this.toString=function(){return this.name}}function U(e,t){var i,o,n;
2function a(s,d){if(!t.workerPath&&!d)return i=!1,void fetch("https://unpkg.com/webm-wasm@latest/dist/webm-worker.js").then(function(e){e.arrayBuffer().then(function(e){a(s,e)})});if(!t.workerPath&&d instanceof ArrayBuffer){var c=new Blob([d],{type:"text/javascript"});t.workerPath=u.createObjectURL(c)}t.workerPath,(o=new Worker(t.workerPath)).postMessage(t.webAssemblyPath||"https://unpkg.com/webm-wasm@latest/dist/webm-wasm.wasm"),o.addEventListener("message",function(a){"READY"===a.data?(o.postMessage({width:t.width,height:t.height,bitrate:t.bitrate||1200,timebaseDen:t.frameRate||30,realtime:t.realtime}),new ReadableStream({start:function(o){var n=document.createElement("canvas"),a=document.createElement("video"),r=!0;a.srcObject=e,a.muted=!0,a.height=t.height,a.width=t.width,a.volume=0,a.onplaying=function(){n.width=t.width,n.height=t.height;var e=n.getContext("2d"),s=1e3/t.frameRate,d=setInterval(function(){if(i&&(clearInterval(d),o.close()),r&&(r=!1,t.onVideoProcessStarted&&t.onVideoProcessStarted()),e.drawImage(a,0,0),"closed"!==o._controlledReadableStream.state)try{o.enqueue(e.getImageData(0,0,t.width,t.height))}catch(n){}},s)},a.play()}}).pipeTo(new WritableStream({write:function(e){i||o.postMessage(e.data.buffer,[e.data.buffer])}}))):a.data&&(n||r.push(a.data))})}(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(){r=[],n=!1,this.blob=null,a(e),"function"==typeof t.initCallback&&t.initCallback()},this.pause=function(){n=!0},this.resume=function(){n=!1};var r=[];this.stop=function(e){i=!0;var t=this;!function(e){o?(o.addEventListener("message",function(t){null===t.data&&(o.terminate(),o=null,e&&e())}),o.postMessage(null)):e&&e()}(function(){t.blob=new Blob(r,{type:"video/webm"}),e(t.blob)})},this.name="WebAssemblyRecorder",this.toString=function(){return this.name},this.clearRecordedData=function(){r=[],n=!1,this.blob=null},this.blob=null}void 0!==t&&(t.DiskStorage=A),void 0!==t&&(t.GifRecorder=B),void 0===t&&(e.exports=D),void 0!==t&&(t.MultiStreamRecorder=j),void 0!==t&&(t.RecordRTCPromisesHandler=function(e,i){if(!this)throw'Use "new RecordRTCPromisesHandler()"';if(void 0===e)throw'First argument "MediaStream" is required.';var o=this;o.recordRTC=new t(e,i),this.startRecording=function(){return new Promise(function(e,t){try{o.recordRTC.startRecording(),e()}catch(i){t(i)}})},this.stopRecording=function(){return new Promise(function(e,t){try{o.recordRTC.stopRecording(function(i){o.blob=o.recordRTC.getBlob(),o.blob&&o.blob.size?e(i):t("Empty blob.",o.blob)})}catch(i){t(i)}})},this.pauseRecording=function(){return new Promise(function(e,t){try{o.recordRTC.pauseRecording(),e()}catch(i){t(i)}})},this.resumeRecording=function(){return new Promise(function(e,t){try{o.recordRTC.resumeRecording(),e()}catch(i){t(i)}})},this.getDataURL=function(e){return new Promise(function(e,t){try{o.recordRTC.getDataURL(function(t){e(t)})}catch(i){t(i)}})},this.getBlob=function(){return new Promise(function(e,t){try{e(o.recordRTC.getBlob())}catch(i){t(i)}})},this.getInternalRecorder=function(){return new Promise(function(e,t){try{e(o.recordRTC.getInternalRecorder())}catch(i){t(i)}})},this.reset=function(){return new Promise(function(e,t){try{e(o.recordRTC.reset())}catch(i){t(i)}})},this.destroy=function(){return new Promise(function(e,t){try{e(o.recordRTC.destroy())}catch(i){t(i)}})},this.getState=function(){return new Promise(function(e,t){try{e(o.recordRTC.getState())}catch(i){t(i)}})},this.blob=null,this.version="5.6.2"}),void 0!==t&&(t.WebAssemblyRecorder=U)}(we)),we.exports)),Re=le.lazy(()=>re(()=>import("./index.BUlfCqsY.js"),__vite__mapDeps([0,1,2,3]))),ke=()=>{const re=e(),ce=t(),{parentId:ue,templateId:be}=i(),we="pb-mobile-translate",ke=le.useRef(null),Se=o(e=>e.allMobileTranslate),Ce=o(e=>e.user),xe=o(e=>e.viewport),Te=o(e=>e.book),Le=o(e=>e.network),Me=o(e=>e.windowDimensions),Ae=o(e=>e.allFluences),{bookPages:Be,bookCurrentPage:De,pageContent:je,isFetchingPageContent:Ue,storyPages:_e,storyLanguage:Ee,confirmModalVisible:Ie,isFetchingStoryLanguage:Pe,isFetchingAudioResponse:Ne,isOriginalBookReaderVisible:Fe,showPublish:Oe}=Se,[ze,$e]=le.useState(!1),[Ve,We]=le.useState(!1),[Ge,qe]=le.useState(null),[He,Ke]=le.useState(""),[Ye,Qe]=le.useState(""),[Je,Xe]=le.useState(!1),[Ze,et]=le.useState(!1),[tt,it]=le.useState(""),[ot,nt]=le.useState(!1),[at,rt]=le.useState(!1),[st,dt]=le.useState(!1),ct=(null==Ee?void 0:Ee.name)&&n.includes(Ee.name),ut=le.useCallback(ve(1e4,(e,t)=>{ce(a({id:e,content:t}))}),[ce]),lt=le.useCallback(()=>
2{if(void 0!==window.screen.orientation){const e=window.screen.orientation.type.includes("landscape");et(e)}},[]);le.useEffect(()=>(window.addEventListener("orientationchange",lt),lt(),()=>{window.removeEventListener("orientationchange",lt)}),[lt]),le.useEffect(()=>{ce(r())},[ce]);const ft=le.useCallback(()=>{const e=document.getElementById("page-content-text");e&&e.querySelectorAll("span, p, strong, br").forEach(e=>""===e.textContent.trim()&&e.parentNode.removeChild(e))},[]),gt=le.useRef(0),mt=le.useRef(De),ht=le.useRef(je);le.useEffect(()=>{be&&ue&&($e(!1),ce(s({id:be})),ce(d({slug:ue})).then(e=>{var t,i,o,n;if(null==(t=e.data)?void 0:t.pages){const t=null==(i=e.data)?void 0:i.pages;ce(c({bookPages:t}));const a=document.getElementById("translate-text-area");if(a&&(a.setAttribute("placeholder",re("global.translate-panel-placeholder")),$e(!0),_e&&(null==(o=_e[De-1])?void 0:o.content)&&"null"!==(null==(n=_e[De-1])?void 0:n.content))){const e=document.createElement("div");e.innerHTML=_e[De-1].content,a.value=e.textContent||e.innerText||"",a.setAttribute("placeholder",e.textContent||e.innerText?e.textContent||e.innerText:re("global.translate-panel-placeholder"))}}}).then(()=>{var e;(null==(e=Ce.profile)?void 0:e.id)&&ce(u({userId:Ce.profile.id,phaseName:"translate"})).then(e=>{e.ok&&(Xe(!0),ce(l({userId:Ce.profile.id,phaseName:"translate"})))})}),ce(f({id:be,isTemplate:!0})).then(e=>{if(e.ok){const t=e.data;Qe(t.language),Ke(t.story)}}))},[be,ue]),le.useEffect(()=>{var e;Be&&Be.length>0&&Be.length!==gt.current&&(null==(e=Be[De-1])?void 0:e.pageId)&&(ce(g({id:Be[De-1].pageId})),gt.current=Be.length)},[null==Be?void 0:Be.length,De,ce]),le.useEffect(()=>{const e=je!==ht.current,t=De!==mt.current;je&&_e&&_e.length>0&&De&&(t||e)&&ce(s({id:be})).then(()=>{const e=document.getElementById("translate-text-area");if(e&&_e[De-1]){e.setAttribute("placeholder",re("global.translate-panel-placeholder"));const t=document.createElement("div");t.innerHTML=_e[De-1].content||"",e.value=_e[De-1].content&&"null"!==_e[De-1].content&&" "!==_e[De-1].content?t.textContent||t.innerText||"":null,We(!1)}}),mt.current=De,ht.current=je},[De,je,null==_e?void 0:_e.length,be,ce,re]),le.useEffect(()=>{var e;De===mt.current||Fe||(window.scrollTo(0,0),ce(s({id:be})),Be&&(null==(e=Be[De-1])?void 0:e.pageId)&&ce(g({id:Be[De-1].pageId})))},[De,Fe,be,ce]),le.useEffect(()=>{ft()},[ft]);const pt=le.useCallback((e,t)=>{var i,o,n;13===(null==(i=window.event)?void 0:i.keyCode)&&(e.target.value=e.target.value+"\n");const r={page:{content:`<p class="text-font-normal">${e.target.value}</p>`}};t?ut(null==(o=_e[De-1])?void 0:o.id,r):ce(a({id:null==(n=_e[De-1])?void 0:n.id,content:r}));let s="",d=0;const c=e.target.selectionStart||0;if(c<e.target.value.length){for(let a=c;a<=e.target.value.length;a++)if(" "===e.target.value[a]||"\n"===e.target.value[a]||a===e.target.value.length){d=a;break}}else d=c;for(let a=c-1;a>=0;a--)if(" "===e.target.value[a]||"\n"===e.target.value[a]||0===a){s=e.target.value.slice(a,d);break}if(m.includes(null==Ye?void 0:Ye.name)&&t){let e=Ye.name;if(h.includes(Ye.name)&&(e="Hindi"),""===s.trim())qe(null);else if(c>0){const t=/[a-zA-Z]+/,i=s.slice(s.search(t));it(s.slice(0,s.search(t))),ce(p({string:i,language:e.toLowerCase()})).then(e=>{e&&e.twords&&qe(e.twords[0].options)})}else qe(null)}if(v.includes(null==Ye?void 0:Ye.name)&&t){const e="Sanskrit"===Ye.name?"sa":Ye.locale;ce(b({string:s.trim(),language:e})).then(e=>{e&&e.success&&e.result?qe(e.result):qe(null)})}if(w.includes(null==Ye?void 0:Ye.name)&&t){let e;switch(Ye.name){case"Konkani":e="gom";break;case"Maithili":e="mai";break;case"Bodo":e="brx";break;case"Nepali":e="ne";break;case"Kashmiri":e="ks";break;case"Urdu":e="ur";break;case"Manipuri (Meetei Mayek Script)":e="mni";break;default:e="en"}ce(y({string:s.trim(),language:e})).then(e=>{e&&e.success&&e.result?qe(e.result):qe(null)})}},[_e,De,ut,ce,Ye]),vt=()=>{We(!0)},bt=()=>{ke.current&&ke.current.focus()},wt=le.useCallback(()=>{let e,t;navigator.mediaDevices.getUserMedia({audio:!0}).then(i=>{t=i,e=ye(i,{type:"audio",mimeType:"audio/webm",sampleRate:S,desiredSampRate:k,recorderType:ye.StereoAudioRecorder,numberOfAudioChannels:R}),nt(!0),e.startRecording(),xt({gtmAction:"initiated_voice_translate",gtmLabel:"translation_inprogress",itemType:x.bookLangLevel,itemId:be,itemValue:`${null==Ye?void 0:Ye.name}_${"5"===(null==He?void 0:He.reading_level)?C.emergentReader:null==He?void 0:He.reading_level}`})}).catch(e=>{ce(T({type:"danger",content:"Could not access microphone. Please check permissions."}))}),setTimeout(()=>{nt(!1),e&&(rt(!0),e.stopRecording(()=>
2{t&&t.getTracks().forEach(e=>{e.stop()}),e?e.getDataURL(e=>{var t;const i=null==(t=L.find(e=>e.lang===(null==Ye?void 0:Ye.name)))?void 0:t.bcpValue;i?ce(M({file:e.split(",")[1],lang:i})).then(e=>{var t;let i=document.getElementById("translate-text-area");const o=e.data;if(i&&e.ok&&(null==o?void 0:o.text)){i.value+=" "+o.text;const e={page:{content:`<p class="text-font-normal">${i.value}</p>`}};xt({gtmAction:"attempted_voice_translate",gtmLabel:"translation_inprogress",itemType:x.bookLangLevel,itemId:be,itemValue:`${null==Ye?void 0:Ye.name}_${"5"===(null==He?void 0:He.reading_level)?C.emergentReader:null==He?void 0:He.reading_level}`}),ce(a({id:null==(t=_e[De-1])?void 0:t.id,content:e}))}}).finally(()=>{rt(!1)}):rt(!1)}):rt(!1)}))},A)},[be,Ye,He,ce,_e,De]),yt=le.useCallback(e=>{const t=document.createElement("div");return t.innerHTML=e,""===t.innerText.trim()},[]),Rt=le.useCallback(e=>{var t,i;if(null==(t=Be[e-1])?void 0:t.isLastStoryPage)if(!Fe&&be){const e=(null==(i=Be.filter(e=>e.isLastStoryPage)[0])?void 0:i.pagePostion)||0;let t=[],o=[];ce(s({id:be})).then(i=>{var n;const a=(null==(n=i.data)?void 0:n.pages)||[];o=Be.filter(t=>(null===t.content||""===t.content)&&1!==t.pagePostion&&t.pagePostion<=e).map(e=>e.pagePostion),t=a.filter(t=>1!==t.position&&t.position<=e&&!o.includes(t.position)&&(t.content?yt(t.content):null===t.content||""===t.content)).map(e=>e.position),t.length>0?dt(!0):ce(D({confirmModalVisible:!0}))}).catch(e=>{ce(D({confirmModalVisible:!0}))})}else ce(D({confirmModalVisible:!0}));else ce(B({bookCurrentPage:e+1})),qe(null)},[Be,Fe,be,ce,yt]),kt=()=>{ce(D({confirmModalVisible:!1}))},St=()=>{window.location.href=`/${se}/v0/editor/story/${be}?is_mobile=true&parent_id=${ue}`},Ct=e=>{var t;const i=De;return(null==(t=Be[i-1])?void 0:t.html)?{__html:de(Be[i-1].html.replace(/\s\s+/g," "))}:{__html:e||""}},xt=le.useCallback(e=>{var t,i;const{gtmAction:o,gtmLabel:n,itemType:a,itemValue:r,itemId:s}=e;window.dataLayer&&window.dataLayer.push({category:j.mobileTranslate,label:n,event:o,item_type:a||null,item_id:s||null,item_value:r||null,user_profile:null==(t=Ce.profile)?void 0:t.profile_type,user_id:(null==(i=Ce.profile)?void 0:i.id)||"00000"})},[Ce.profile]),Tt={[we]:!0},Lt={[`${we}__page-source-text`]:!0,[`${we}__page-source-text--no-background`]:!(null==je?void 0:je.content)},Mt={[`${we}__page-content-new-text`]:!0,[`${we}__page-content-new-text--hide`]:""===(null==je?void 0:je.content)},At={[`${we}__page-content-textarea`]:!0,[`${we}__page-content-textarea--rtl`]:ct};return fe.jsxs("div",{className:_(Tt),children:[U[null==Ye?void 0:Ye.name]&&fe.jsx(ge,{languages:[Ye.name]}),Je&&!Ze&&fe.jsx(le.Suspense,{fallback:null,children:fe.jsx(Re,{steps:[{target:".pb-mobile-translate-subheader__preview",content:fe.jsxs("div",{className:`${we}__tooltip-wrapper`,children:[fe.jsx("div",{className:`${we}__tooltip-image`,children:fe.jsx(E,{name:"sw-logo",size:"m-ml"})}),fe.jsxs("div",{className:`${we}__tooltip-content`,children:[fe.jsx("b",{children:re("MobileTranslate.coachmark-step-1-title")}),fe.jsx("p",{children:re("MobileTranslate.coachmark-step-1")})]})]}),placement:"bottom",offset:"0",disableBeacon:!0},{target:".pb-mobile-translate-subheader-el__page-count",content:fe.jsxs("div",{className:`${we}__tooltip-wrapper`,children:[fe.jsx("div",{className:`${we}__tooltip-image`,children:fe.jsx(E,{name:"sw-logo",size:"m-ml"})}),fe.jsxs("div",{className:`${we}__tooltip-content`,children:[fe.jsx("b",{children:re("MobileTranslate.coachmark-step-2-title")}),fe.jsx("p",{children:re("MobileTranslate.coachmark-step-2-text-1")}),fe.jsx("p",{children:re("MobileTranslate.coachmark-step-2-text-2")})]})]}),placement:"bottom",offset:"0"}],continuous:!0,showSkipButton:!0,disableScrolling:!0,hideBackButton:!0,disableOverlayClose:!0,disableCloseOnEsc:!0,locale:{next:"Ok!",last:"Ok!"},floaterProps:{styles:{wrapper:{zIndex:1e4}}},styles:{options:{zIndex:1e4,width:"300px"},overlay:{backgroundColor:"none",cursor:"auto",mixBlendMode:"unset"},spotlight:{backgroundColor:"none",borderRadius:0,boxShadow:"0px 0px 0px 9999px rgba(0,0,0,0.5)"},buttonClose:{display:"none"},buttonSkip:{backgroundColor:"white",color:"#2196F3",position:"absolute",bottom:"20px",right:"40px",marginTop:"0px",fontSize:"16px"},buttonNext:{backgroundColor:"white",color:"#2196F3",position:"absolute",bottom:"20px",marginTop:"0px",left:"67px"},tooltipContent:{padding:"10px"}}})}),fe.jsx(he,{step:1,viewport:xe,bookPages:Be,params:{parentId:ue,templateId:be},showPublish:Oe,profile:Ce.profile}),fe.jsx(pe,{displayText:"See Original Page",bookAssets:Te.assets,bookPages:Be,showAttributionPage:Te.showAttributionPage,isUserBlocked:Te.isUserBlocked,startPage:De,closeGlobalBookReader:()=>ce(oe()),viewport:xe,isLoggedIn:Ce.isLoggedIn,assets:Te.assets,offline:!Le.online,profile:Ce.profile,book:Te.currentGlobalBookReaderBook,windowDimensions:Me,openNextReadSuggestions:()=>ce(ie()),showAudioBookReader:Te.showAudioBookReader,addSmileyRatingModal:e=>ce(te(e)),slug:Te.currentGlobalBookReaderSlug,fetchSmileyRatingBook:e=>ce(ee({slug:e})),changeUserFeedbackModalStatusWorkflow:()=>{},addSlimNotification:e=>ce(T(e)),postSuggestionWorkflow:e=>ce(Z(e)),fetchSuggestionsWorkflow:e=>ce(X({query:e})),resetSuggestions:()=>ce(J()),updatePageContent:e=>ce(Q(e)),userBlockedById:e=>ce(Y({isUserBlocked:e})),updateReviewerSuggestions:e=>ce(K({suggestionId:e})),suggestions:Te.suggestions,isFetchingSuggestions:Te.isFetchingSuggestions,isEditingBook:Te.isEditingBook,onEditBookDetailClicked:e=>ce(H(e)),blockUserWorkflow:e=>ce(q({user_id:e})),blockStoryWorkflow:e=>
2ce(G({story_id:e})),resolveSuggestionsWorkflow:e=>ce(W(e)),readingProgramBook:Te.readingProgramBook,setStoryStatusFn:()=>{},storyId:Te.storyId,themeNumber:Te.themeNumber,enrollmentId:Te.enrollmentId,openAuthModal:()=>ce(V()),disablePortraitViewMessage:()=>ce($()),enablePortraitViewMessage:()=>ce(z()),readStoryStatus:Ae.readStoryStatus,fluencyNumber:Te.fluencyNumber,themeName:Te.themeName,readSource:Te.readSource,mobileTranslate:!0,bookCurrentPage:De,setBookCurrentPage:e=>ce(B(e)),bookPageContent:e=>ce(g({id:e})),updateSinglePageContent:e=>ce(a(e)),fetchBookAssetsWorkflow:(e,t,i)=>ce("object"==typeof e?O(e):i?d({slug:e}):O({slug:e,offline:t})),confirmModalVisibleAct:e=>ce(D(e)),setPageContent:e=>{var t;ce(B({bookCurrentPage:e-1})),ce(g({id:null==(t=Be[e-1])?void 0:t.pageId}))},bookSlug:ue,fromRails:!0,setBookPage:e=>ce(c(e)),onWindowSizeChange:()=>ce(F()),goPreviousPage:e=>{e>2&&(ce(B({bookCurrentPage:e-1})),qe(null))},goNextPage:Rt,gotoPageNumber:e=>{ce(B({bookCurrentPage:e+1})),qe(null)},updateActiveDropdownLink:e=>ce(N(e)),openOriginalBookReader:()=>ce(P()),closeOriginalBookReader:()=>ce(I()),sticky:!0}),(Te.isFetchingAssets||Ue||Pe||!ze)&&fe.jsxs("div",{className:`${we}__loading-container`,children:[!(De>=2)&&fe.jsx("div",{className:`${we}__image_container`,children:fe.jsx("img",{src:ne.loadingImage,className:`${we}__loading-image`,alt:"mobile-translate-landing"})}),!(De>=2)&&fe.jsx("div",{className:`${we}__loading-text`,children:re("global.mobile-translate-loading-text")}),fe.jsx("div",{className:`${we}__loader-container`,children:fe.jsx(ae,{})})]}),_e[De-1]?(()=>{const e={[`${we}__suggestions`]:!0,[`${we}__suggestions--hidden`]:!Ge},t=L.filter(e=>e.lang===(null==Ye?void 0:Ye.name)).length>0;return fe.jsxs("div",{className:`${we}__page-content-el`,children:[fe.jsxs("div",{className:_(Lt),children:[(null==je?void 0:je.content)&&fe.jsx("h3",{className:`${we}__source-text`,children:re("global.translate-source-header")}),(null==je?void 0:je.content)?fe.jsx("div",{id:"page-content-text",className:`${we}__page-content-text`,dangerouslySetInnerHTML:Ct(je.content)}):fe.jsx("div",{className:`${we}__page-content-text--empty-box`,children:re("global.translate-empty-page")})]}),ke.current&&ke.current.selectionStart>0&&fe.jsx("div",{className:_(e),children:fe.jsx("ul",{id:"suggestions",className:`${we}__suggestions-ul`,children:Ge&&Ge.map((e,t)=>fe.jsx("li",{onClick:()=>(e=>{if(ke.current){const t=ke.current,i=t.selectionStart||0;let o=i;for(let e=i;e<=t.value.length;e++)if(" "===t.value[e]||"\n"===t.value[e]||e===t.value.length){o=e;break}for(let n=i-1;n>=0;n--)if(" "===t.value[n]||"\n"===t.value[n]||0===n){t.value=t.value.slice(0,n)+" "+e+t.value.slice(o,t.value.length);const i=n+e.length+1;t.focus(),t.setSelectionRange(i,i),qe(null);break}}})(tt+e),children:tt+e},t))})}),fe.jsxs("div",{className:_(Mt),children:[fe.jsx("h3",{className:`${we}__source-text`,children:re("global.translate-panel-header")}),fe.jsx("textarea",{id:"translate-text-area",ref:ke,className:_(At),onBlur:e=>pt(e,!1),rows:"4",onChange:e=>pt(e,!0),onFocus:vt,placeholder:re("global.translate-panel-placeholder")})]}),ot&&t&&fe.jsxs("div",{className:`${we}__listen-bar`,children:[re("global.listening"),fe.jsx(E,{name:"keyboard-voice"})]}),!ot&&(at||Ne)&&t&&fe.jsxs("div",{className:`${we}__listen-bar ${we}__listen-bar--processing`,children:[re("global.loading"),fe.jsx(ae,{size:"s"})]}),!ot&&!(at||Ne)&&(null==je?void 0:je.content)&&t&&fe.jsxs("div",{className:`${we}__floating-button-div`,children:[fe.jsx("button",{className:`${we}__floating-button ${we}__floating-button--left`,onClick:bt,children:re("global.start-typing")}),fe.jsxs("button",{className:`${we}__floating-button ${we}__floating-button--right`,onClick:wt,children:[fe.jsx(E,{name:"keyboard-voice"})," ",re("global.use-voice")]})]})]})})():null,fe.jsxs("div",{className:`${we}__book-reader-div`,children:[Ie&&!Fe&&fe.jsx(me,{title:re("global.well-done"),text:re("global.mobile-translate-confirm-modal"),customLeftButton:re("global.go-to-check"),customRightButton:re("global.stay-on-translate"),onConfirm:St,onClose:kt,onModalClose:kt,viewport:xe}),st&&fe.jsx(me,{title:re("global.uh-oh"),text:re("global.mobile-translate-incomplete-translations"),customLeftButton:re("global.stay-on-translate"),customRightButton:re("global.go-to-check"),onConfirm:()=>dt(!1),onClose:St,onModalClose:()=>dt(!1),viewport:xe})]})]})};export{ke as default};
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.