2026-04-14 17:41:39 +02:00

221 lines
613 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var h1=Object.defineProperty,d1=Object.defineProperties;var p1=Object.getOwnPropertyDescriptors;var fs=Object.getOwnPropertySymbols;var bh=Object.prototype.hasOwnProperty,wh=Object.prototype.propertyIsEnumerable;var g1=r=>{throw TypeError(r)},dn=Math.pow,au=(r,t,e)=>t in r?h1(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,st=(r,t)=>{for(var e in t||(t={}))bh.call(t,e)&&au(r,e,t[e]);if(fs)for(var e of fs(t))wh.call(t,e)&&au(r,e,t[e]);return r},Ut=(r,t)=>d1(r,p1(t));var hs=(r,t)=>{var e={};for(var n in r)bh.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&fs)for(var n of fs(r))t.indexOf(n)<0&&wh.call(r,n)&&(e[n]=r[n]);return e};var Se=(r,t,e)=>au(r,typeof t!="symbol"?t+"":t,e);var Xo=(r,t,e)=>t.has(r)?g1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e);var tt=(r,t,e)=>new Promise((n,i)=>{var l=d=>{try{h(e.next(d))}catch(g){i(g)}},c=d=>{try{h(e.throw(d))}catch(g){i(g)}},h=d=>d.done?n(d.value):Promise.resolve(d.value).then(l,c);h((e=e.apply(r,t)).next())});function m1(r,t){for(var e=0;e<t.length;e++){const n=t[e];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const l=Object.getOwnPropertyDescriptor(n,i);l&&Object.defineProperty(r,i,l.get?l:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var bt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function v1(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var y1={};/*!
* howler.js v2.2.4
* howlerjs.com
*
* (c) 2013-2020, James Simpson of GoldFire Studios
* goldfirestudios.com
*
* MIT License
*/(function(r){(function(){var t=function(){this.init()};t.prototype={init:function(){var a=this||e;return a._counter=1e3,a._html5AudioPool=[],a.html5PoolSize=10,a._codecs={},a._howls=[],a._muted=!1,a._volume=1,a._canPlayEvent="canplaythrough",a._navigator=typeof window!="undefined"&&window.navigator?window.navigator:null,a.masterGain=null,a.noAudio=!1,a.usingWebAudio=!0,a.autoSuspend=!0,a.ctx=null,a.autoUnlock=!0,a._setup(),a},volume:function(a){var u=this||e;if(a=parseFloat(a),u.ctx||p(),typeof a!="undefined"&&a>=0&&a<=1){if(u._volume=a,u._muted)return u;u.usingWebAudio&&u.masterGain.gain.setValueAtTime(a,e.ctx.currentTime);for(var f=0;f<u._howls.length;f++)if(!u._howls[f]._webAudio)for(var y=u._howls[f]._getSoundIds(),_=0;_<y.length;_++){var b=u._howls[f]._soundById(y[_]);b&&b._node&&(b._node.volume=b._volume*a)}return u}return u._volume},mute:function(a){var u=this||e;u.ctx||p(),u._muted=a,u.usingWebAudio&&u.masterGain.gain.setValueAtTime(a?0:u._volume,e.ctx.currentTime);for(var f=0;f<u._howls.length;f++)if(!u._howls[f]._webAudio)for(var y=u._howls[f]._getSoundIds(),_=0;_<y.length;_++){var b=u._howls[f]._soundById(y[_]);b&&b._node&&(b._node.muted=a?!0:b._muted)}return u},stop:function(){for(var a=this||e,u=0;u<a._howls.length;u++)a._howls[u].stop();return a},unload:function(){for(var a=this||e,u=a._howls.length-1;u>=0;u--)a._howls[u].unload();return a.usingWebAudio&&a.ctx&&typeof a.ctx.close!="undefined"&&(a.ctx.close(),a.ctx=null,p()),a},codecs:function(a){return(this||e)._codecs[a.replace(/^x-/,"")]},_setup:function(){var a=this||e;if(a.state=a.ctx&&a.ctx.state||"suspended",a._autoSuspend(),!a.usingWebAudio)if(typeof Audio!="undefined")try{var u=new Audio;typeof u.oncanplaythrough=="undefined"&&(a._canPlayEvent="canplay")}catch(f){a.noAudio=!0}else a.noAudio=!0;try{var u=new Audio;u.muted&&(a.noAudio=!0)}catch(f){}return a.noAudio||a._setupCodecs(),a},_setupCodecs:function(){var a=this||e,u=null;try{u=typeof Audio!="undefined"?new Audio:null}catch(x){return a}if(!u||typeof u.canPlayType!="function")return a;var f=u.canPlayType("audio/mpeg;").replace(/^no$/,""),y=a._navigator?a._navigator.userAgent:"",_=y.match(/OPR\/(\d+)/g),b=_&&parseInt(_[0].split("/")[1],10)<33,v=y.indexOf("Safari")!==-1&&y.indexOf("Chrome")===-1,w=y.match(/Version\/(.*?) /),T=v&&w&&parseInt(w[1],10)<15;return a._codecs={mp3:!!(!b&&(f||u.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!f,opus:!!u.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!u.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!u.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(u.canPlayType('audio/wav; codecs="1"')||u.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!u.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!u.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(u.canPlayType("audio/x-m4a;")||u.canPlayType("audio/m4a;")||u.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(u.canPlayType("audio/x-m4b;")||u.canPlayType("audio/m4b;")||u.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(u.canPlayType("audio/x-mp4;")||u.canPlayType("audio/mp4;")||u.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!T&&u.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!T&&u.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!u.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(u.canPlayType("audio/x-flac;")||u.canPlayType("audio/flac;")).replace(/^no$/,"")},a},_unlockAudio:function(){var a=this||e;if(!(a._audioUnlocked||!a.ctx)){a._audioUnlocked=!1,a.autoUnlock=!1,!a._mobileUnloaded&&a.ctx.sampleRate!==44100&&(a._mobileUnloaded=!0,a.unload()),a._scratchBuffer=a.ctx.createBuffer(1,1,22050);var u=function(f){for(;a._html5AudioPool.length<a.html5PoolSize;)try{var y=new Audio;y._unlocked=!0,a._releaseHtml5Audio(y)}catch(x){a.noAudio=!0;break}for(var _=0;_<a._howls.length;_++)if(!a._howls[_]._webAudio)for(var b=a._howls[_]._getSoundIds(),v=0;v<b.length;v++){var w=a._howls[_]._soundById(b[v]);w&&w._node&&!w._node._unlocked&&(w._node._unlocked=!0,w._node.load())}a._autoResume();var T=a.ctx.createBufferSource();T.buffer=a._scratchBuffer,T.connect(a.ctx.destination),typeof T.start=="undefined"?T.noteOn(0):T.start(0),typeof a.ctx.resume=="function"&&a.ctx.resume(),T.onended=function(){T.disconnect(0),a._audioUnlocked=!0,document.removeEventListener("touchstart",u,!0),document.removeEventListener("touchend",u,!0),document.removeEventListener("click",u,!0),document.removeEventListener("keydown",u,!0);for(var x=0;x<a._howls.length;x++)a._howls[x]._emit("unlock")}};return document.addEventListener("touchstart",u,!0),document.addEventListener("touchend",u,!0),document.addEventListener("click",u,!0),document.addEventListener("keydown",u,!0),a}},_obtainHtml5Audio:function(){var a=this||e;if(a._html5AudioPool.length)return a._html5AudioPool.pop();var u=new Audio().play();return u&&typeof Promise!="undefined"&&(u instanceof Promise||typeof u.then=="function")&&u.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(a){var u=this||e;return a._unlocked&&u._html5AudioPool.push(a),u},_autoSuspend:function(){var a=this;if(!(!a.autoSuspend||!a.ctx||typeof a.ctx.suspend=="undefined"||!e.usingWebAudio)){for(var u=0;u<a._howls.length;u++)if(a._howls[u]._webAudio){for(var f=0;f<a._howls[u]._sounds.length;f++)if(!a._howls[u]._sounds[f]._paused)return a}return a._suspendTimer&&clearTimeout(a._suspendTimer),a._suspendTimer=setTimeout(function(){if(a.autoSuspend){a._suspendTimer=null,a.state="suspending";var y=function(){a.state="suspended",a._resumeAfterSuspend&&(delete a._resumeAfterSuspend,a._autoResume())};a.ctx.suspend().then(y,y)}},3e4),a}},_autoResume:function(){var a=this;if(!(!a.ctx||typeof a.ctx.resume=="undefined"||!e.usingWebAudio))return a.state==="running"&&a.ctx.state!=="interrupted"&&a._suspendTimer?(clearTimeout(a._suspendTimer),a._suspendTimer=null):a.state==="suspended"||a.state==="running"&&a.ctx.state==="interrupted"?(a.ctx.resume().then(function(){a.state="running";for(var u=0;u<a._howls.length;u++)a._howls[u]._emit("resume")}),a._suspendTimer&&(clearTimeout(a._suspendTimer),a._suspendTimer=null)):a.state==="suspending"&&(a._resumeAfterSuspend=!0),a}};var e=new t,n=function(a){var u=this;if(!a.src||a.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}u.init(a)};n.prototype={init:function(a){var u=this;return e.ctx||p(),u._autoplay=a.autoplay||!1,u._format=typeof a.format!="string"?a.format:[a.format],u._html5=a.html5||!1,u._muted=a.mute||!1,u._loop=a.loop||!1,u._pool=a.pool||5,u._preload=typeof a.preload=="boolean"||a.preload==="metadata"?a.preload:!0,u._rate=a.rate||1,u._sprite=a.sprite||{},u._src=typeof a.src!="string"?a.src:[a.src],u._volume=a.volume!==void 0?a.volume:1,u._xhr={method:a.xhr&&a.xhr.method?a.xhr.method:"GET",headers:a.xhr&&a.xhr.headers?a.xhr.headers:null,withCredentials:a.xhr&&a.xhr.withCredentials?a.xhr.withCredentials:!1},u._duration=0,u._state="unloaded",u._sounds=[],u._endTimers={},u._queue=[],u._playLock=!1,u._onend=a.onend?[{fn:a.onend}]:[],u._onfade=a.onfade?[{fn:a.onfade}]:[],u._onload=a.onload?[{fn:a.onload}]:[],u._onloaderror=a.onloaderror?[{fn:a.onloaderror}]:[],u._onplayerror=a.onplayerror?[{fn:a.onplayerror}]:[],u._onpause=a.onpause?[{fn:a.onpause}]:[],u._onplay=a.onplay?[{fn:a.onplay}]:[],u._onstop=a.onstop?[{fn:a.onstop}]:[],u._onmute=a.onmute?[{fn:a.onmute}]:[],u._onvolume=a.onvolume?[{fn:a.onvolume}]:[],u._onrate=a.onrate?[{fn:a.onrate}]:[],u._onseek=a.onseek?[{fn:a.onseek}]:[],u._onunlock=a.onunlock?[{fn:a.onunlock}]:[],u._onresume=[],u._webAudio=e.usingWebAudio&&!u._html5,typeof e.ctx!="undefined"&&e.ctx&&e.autoUnlock&&e._unlockAudio(),e._howls.push(u),u._autoplay&&u._queue.push({event:"play",action:function(){u.play()}}),u._preload&&u._preload!=="none"&&u.load(),u},load:function(){var a=this,u=null;if(e.noAudio){a._emit("loaderror",null,"No audio support.");return}typeof a._src=="string"&&(a._src=[a._src]);for(var f=0;f<a._src.length;f++){var y,_;if(a._format&&a._format[f])y=a._format[f];else{if(_=a._src[f],typeof _!="string"){a._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}y=/^data:audio\/([^;,]+);/i.exec(_),y||(y=/\.([^.]+)$/.exec(_.split("?",1)[0])),y&&(y=y[1].toLowerCase())}if(y||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),y&&e.codecs(y)){u=a._src[f];break}}if(!u){a._emit("loaderror",null,"No codec support for selected audio sources.");return}return a._src=u,a._state="loading",window.location.protocol==="https:"&&u.slice(0,5)==="http:"&&(a._html5=!0,a._webAudio=!1),new i(a),a._webAudio&&c(a),a},play:function(a,u){var f=this,y=null;if(typeof a=="number")y=a,a=null;else{if(typeof a=="string"&&f._state==="loaded"&&!f._sprite[a])return null;if(typeof a=="undefined"&&(a="__default",!f._playLock)){for(var _=0,b=0;b<f._sounds.length;b++)f._sounds[b]._paused&&!f._sounds[b]._ended&&(_++,y=f._sounds[b]._id);_===1?a=null:y=null}}var v=y?f._soundById(y):f._inactiveSound();if(!v)return null;if(y&&!a&&(a=v._sprite||"__default"),f._state!=="loaded"){v._sprite=a,v._ended=!1;var w=v._id;return f._queue.push({event:"play",action:function(){f.play(w)}}),w}if(y&&!v._paused)return u||f._loadQueue("play"),v._id;f._webAudio&&e._autoResume();var T=Math.max(0,v._seek>0?v._seek:f._sprite[a][0]/1e3),x=Math.max(0,(f._sprite[a][0]+f._sprite[a][1])/1e3-T),S=x*1e3/Math.abs(v._rate),C=f._sprite[a][0]/1e3,A=(f._sprite[a][0]+f._sprite[a][1])/1e3;v._sprite=a,v._ended=!1;var R=function(){v._paused=!1,v._seek=T,v._start=C,v._stop=A,v._loop=!!(v._loop||f._sprite[a][2])};if(T>=A){f._ended(v);return}var L=v._node;if(f._webAudio){var M=function(){f._playLock=!1,R(),f._refreshBuffer(v);var j=v._muted||f._muted?0:v._volume;L.gain.setValueAtTime(j,e.ctx.currentTime),v._playStart=e.ctx.currentTime,typeof L.bufferSource.start=="undefined"?v._loop?L.bufferSource.noteGrainOn(0,T,86400):L.bufferSource.noteGrainOn(0,T,x):v._loop?L.bufferSource.start(0,T,86400):L.bufferSource.start(0,T,x),S!==1/0&&(f._endTimers[v._id]=setTimeout(f._ended.bind(f,v),S)),u||setTimeout(function(){f._emit("play",v._id),f._loadQueue()},0)};e.state==="running"&&e.ctx.state!=="interrupted"?M():(f._playLock=!0,f.once("resume",M),f._clearTimer(v._id))}else{var k=function(){L.currentTime=T,L.muted=v._muted||f._muted||e._muted||L.muted,L.volume=v._volume*e.volume(),L.playbackRate=v._rate;try{var j=L.play();if(j&&typeof Promise!="undefined"&&(j instanceof Promise||typeof j.then=="function")?(f._playLock=!0,R(),j.then(function(){f._playLock=!1,L._unlocked=!0,u?f._loadQueue():f._emit("play",v._id)}).catch(function(){f._playLock=!1,f._emit("playerror",v._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),v._ended=!0,v._paused=!0})):u||(f._playLock=!1,R(),f._emit("play",v._id)),L.playbackRate=v._rate,L.paused){f._emit("playerror",v._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}a!=="__default"||v._loop?f._endTimers[v._id]=setTimeout(f._ended.bind(f,v),S):(f._endTimers[v._id]=function(){f._ended(v),L.removeEventListener("ended",f._endTimers[v._id],!1)},L.addEventListener("ended",f._endTimers[v._id],!1))}catch(W){f._emit("playerror",v._id,W)}};L.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(L.src=f._src,L.load());var P=window&&window.ejecta||!L.readyState&&e._navigator.isCocoonJS;if(L.readyState>=3||P)k();else{f._playLock=!0,f._state="loading";var I=function(){f._state="loaded",k(),L.removeEventListener(e._canPlayEvent,I,!1)};L.addEventListener(e._canPlayEvent,I,!1),f._clearTimer(v._id)}}return v._id},pause:function(a){var u=this;if(u._state!=="loaded"||u._playLock)return u._queue.push({event:"pause",action:function(){u.pause(a)}}),u;for(var f=u._getSoundIds(a),y=0;y<f.length;y++){u._clearTimer(f[y]);var _=u._soundById(f[y]);if(_&&!_._paused&&(_._seek=u.seek(f[y]),_._rateSeek=0,_._paused=!0,u._stopFade(f[y]),_._node))if(u._webAudio){if(!_._node.bufferSource)continue;typeof _._node.bufferSource.stop=="undefined"?_._node.bufferSource.noteOff(0):_._node.bufferSource.stop(0),u._cleanBuffer(_._node)}else(!isNaN(_._node.duration)||_._node.duration===1/0)&&_._node.pause();arguments[1]||u._emit("pause",_?_._id:null)}return u},stop:function(a,u){var f=this;if(f._state!=="loaded"||f._playLock)return f._queue.push({event:"stop",action:function(){f.stop(a)}}),f;for(var y=f._getSoundIds(a),_=0;_<y.length;_++){f._clearTimer(y[_]);var b=f._soundById(y[_]);b&&(b._seek=b._start||0,b._rateSeek=0,b._paused=!0,b._ended=!0,f._stopFade(y[_]),b._node&&(f._webAudio?b._node.bufferSource&&(typeof b._node.bufferSource.stop=="undefined"?b._node.bufferSource.noteOff(0):b._node.bufferSource.stop(0),f._cleanBuffer(b._node)):(!isNaN(b._node.duration)||b._node.duration===1/0)&&(b._node.currentTime=b._start||0,b._node.pause(),b._node.duration===1/0&&f._clearSound(b._node))),u||f._emit("stop",b._id))}return f},mute:function(a,u){var f=this;if(f._state!=="loaded"||f._playLock)return f._queue.push({event:"mute",action:function(){f.mute(a,u)}}),f;if(typeof u=="undefined")if(typeof a=="boolean")f._muted=a;else return f._muted;for(var y=f._getSoundIds(u),_=0;_<y.length;_++){var b=f._soundById(y[_]);b&&(b._muted=a,b._interval&&f._stopFade(b._id),f._webAudio&&b._node?b._node.gain.setValueAtTime(a?0:b._volume,e.ctx.currentTime):b._node&&(b._node.muted=e._muted?!0:a),f._emit("mute",b._id))}return f},volume:function(){var a=this,u=arguments,f,y;if(u.length===0)return a._volume;if(u.length===1||u.length===2&&typeof u[1]=="undefined"){var _=a._getSoundIds(),b=_.indexOf(u[0]);b>=0?y=parseInt(u[0],10):f=parseFloat(u[0])}else u.length>=2&&(f=parseFloat(u[0]),y=parseInt(u[1],10));var v;if(typeof f!="undefined"&&f>=0&&f<=1){if(a._state!=="loaded"||a._playLock)return a._queue.push({event:"volume",action:function(){a.volume.apply(a,u)}}),a;typeof y=="undefined"&&(a._volume=f),y=a._getSoundIds(y);for(var w=0;w<y.length;w++)v=a._soundById(y[w]),v&&(v._volume=f,u[2]||a._stopFade(y[w]),a._webAudio&&v._node&&!v._muted?v._node.gain.setValueAtTime(f,e.ctx.currentTime):v._node&&!v._muted&&(v._node.volume=f*e.volume()),a._emit("volume",v._id))}else return v=y?a._soundById(y):a._sounds[0],v?v._volume:0;return a},fade:function(a,u,f,y){var _=this;if(_._state!=="loaded"||_._playLock)return _._queue.push({event:"fade",action:function(){_.fade(a,u,f,y)}}),_;a=Math.min(Math.max(0,parseFloat(a)),1),u=Math.min(Math.max(0,parseFloat(u)),1),f=parseFloat(f),_.volume(a,y);for(var b=_._getSoundIds(y),v=0;v<b.length;v++){var w=_._soundById(b[v]);if(w){if(y||_._stopFade(b[v]),_._webAudio&&!w._muted){var T=e.ctx.currentTime,x=T+f/1e3;w._volume=a,w._node.gain.setValueAtTime(a,T),w._node.gain.linearRampToValueAtTime(u,x)}_._startFadeInterval(w,a,u,f,b[v],typeof y=="undefined")}}return _},_startFadeInterval:function(a,u,f,y,_,b){var v=this,w=u,T=f-u,x=Math.abs(T/.01),S=Math.max(4,x>0?y/x:y),C=Date.now();a._fadeTo=f,a._interval=setInterval(function(){var A=(Date.now()-C)/y;C=Date.now(),w+=T*A,w=Math.round(w*100)/100,T<0?w=Math.max(f,w):w=Math.min(f,w),v._webAudio?a._volume=w:v.volume(w,a._id,!0),b&&(v._volume=w),(f<u&&w<=f||f>u&&w>=f)&&(clearInterval(a._interval),a._interval=null,a._fadeTo=null,v.volume(f,a._id),v._emit("fade",a._id))},S)},_stopFade:function(a){var u=this,f=u._soundById(a);return f&&f._interval&&(u._webAudio&&f._node.gain.cancelScheduledValues(e.ctx.currentTime),clearInterval(f._interval),f._interval=null,u.volume(f._fadeTo,a),f._fadeTo=null,u._emit("fade",a)),u},loop:function(){var a=this,u=arguments,f,y,_;if(u.length===0)return a._loop;if(u.length===1)if(typeof u[0]=="boolean")f=u[0],a._loop=f;else return _=a._soundById(parseInt(u[0],10)),_?_._loop:!1;else u.length===2&&(f=u[0],y=parseInt(u[1],10));for(var b=a._getSoundIds(y),v=0;v<b.length;v++)_=a._soundById(b[v]),_&&(_._loop=f,a._webAudio&&_._node&&_._node.bufferSource&&(_._node.bufferSource.loop=f,f&&(_._node.bufferSource.loopStart=_._start||0,_._node.bufferSource.loopEnd=_._stop,a.playing(b[v])&&(a.pause(b[v],!0),a.play(b[v],!0)))));return a},rate:function(){var a=this,u=arguments,f,y;if(u.length===0)y=a._sounds[0]._id;else if(u.length===1){var _=a._getSoundIds(),b=_.indexOf(u[0]);b>=0?y=parseInt(u[0],10):f=parseFloat(u[0])}else u.length===2&&(f=parseFloat(u[0]),y=parseInt(u[1],10));var v;if(typeof f=="number"){if(a._state!=="loaded"||a._playLock)return a._queue.push({event:"rate",action:function(){a.rate.apply(a,u)}}),a;typeof y=="undefined"&&(a._rate=f),y=a._getSoundIds(y);for(var w=0;w<y.length;w++)if(v=a._soundById(y[w]),v){a.playing(y[w])&&(v._rateSeek=a.seek(y[w]),v._playStart=a._webAudio?e.ctx.currentTime:v._playStart),v._rate=f,a._webAudio&&v._node&&v._node.bufferSource?v._node.bufferSource.playbackRate.setValueAtTime(f,e.ctx.currentTime):v._node&&(v._node.playbackRate=f);var T=a.seek(y[w]),x=(a._sprite[v._sprite][0]+a._sprite[v._sprite][1])/1e3-T,S=x*1e3/Math.abs(v._rate);(a._endTimers[y[w]]||!v._paused)&&(a._clearTimer(y[w]),a._endTimers[y[w]]=setTimeout(a._ended.bind(a,v),S)),a._emit("rate",v._id)}}else return v=a._soundById(y),v?v._rate:a._rate;return a},seek:function(){var a=this,u=arguments,f,y;if(u.length===0)a._sounds.length&&(y=a._sounds[0]._id);else if(u.length===1){var _=a._getSoundIds(),b=_.indexOf(u[0]);b>=0?y=parseInt(u[0],10):a._sounds.length&&(y=a._sounds[0]._id,f=parseFloat(u[0]))}else u.length===2&&(f=parseFloat(u[0]),y=parseInt(u[1],10));if(typeof y=="undefined")return 0;if(typeof f=="number"&&(a._state!=="loaded"||a._playLock))return a._queue.push({event:"seek",action:function(){a.seek.apply(a,u)}}),a;var v=a._soundById(y);if(v)if(typeof f=="number"&&f>=0){var w=a.playing(y);w&&a.pause(y,!0),v._seek=f,v._ended=!1,a._clearTimer(y),!a._webAudio&&v._node&&!isNaN(v._node.duration)&&(v._node.currentTime=f);var T=function(){w&&a.play(y,!0),a._emit("seek",y)};if(w&&!a._webAudio){var x=function(){a._playLock?setTimeout(x,0):T()};setTimeout(x,0)}else T()}else if(a._webAudio){var S=a.playing(y)?e.ctx.currentTime-v._playStart:0,C=v._rateSeek?v._rateSeek-v._seek:0;return v._seek+(C+S*Math.abs(v._rate))}else return v._node.currentTime;return a},playing:function(a){var u=this;if(typeof a=="number"){var f=u._soundById(a);return f?!f._paused:!1}for(var y=0;y<u._sounds.length;y++)if(!u._sounds[y]._paused)return!0;return!1},duration:function(a){var u=this,f=u._duration,y=u._soundById(a);return y&&(f=u._sprite[y._sprite][1]/1e3),f},state:function(){return this._state},unload:function(){for(var a=this,u=a._sounds,f=0;f<u.length;f++)u[f]._paused||a.stop(u[f]._id),a._webAudio||(a._clearSound(u[f]._node),u[f]._node.removeEventListener("error",u[f]._errorFn,!1),u[f]._node.removeEventListener(e._canPlayEvent,u[f]._loadFn,!1),u[f]._node.removeEventListener("ended",u[f]._endFn,!1),e._releaseHtml5Audio(u[f]._node)),delete u[f]._node,a._clearTimer(u[f]._id);var y=e._howls.indexOf(a);y>=0&&e._howls.splice(y,1);var _=!0;for(f=0;f<e._howls.length;f++)if(e._howls[f]._src===a._src||a._src.indexOf(e._howls[f]._src)>=0){_=!1;break}return l&&_&&delete l[a._src],e.noAudio=!1,a._state="unloaded",a._sounds=[],a=null,null},on:function(a,u,f,y){var _=this,b=_["_on"+a];return typeof u=="function"&&b.push(y?{id:f,fn:u,once:y}:{id:f,fn:u}),_},off:function(a,u,f){var y=this,_=y["_on"+a],b=0;if(typeof u=="number"&&(f=u,u=null),u||f)for(b=0;b<_.length;b++){var v=f===_[b].id;if(u===_[b].fn&&v||!u&&v){_.splice(b,1);break}}else if(a)y["_on"+a]=[];else{var w=Object.keys(y);for(b=0;b<w.length;b++)w[b].indexOf("_on")===0&&Array.isArray(y[w[b]])&&(y[w[b]]=[])}return y},once:function(a,u,f){var y=this;return y.on(a,u,f,1),y},_emit:function(a,u,f){for(var y=this,_=y["_on"+a],b=_.length-1;b>=0;b--)(!_[b].id||_[b].id===u||a==="load")&&(setTimeout(function(v){v.call(this,u,f)}.bind(y,_[b].fn),0),_[b].once&&y.off(a,_[b].fn,_[b].id));return y._loadQueue(a),y},_loadQueue:function(a){var u=this;if(u._queue.length>0){var f=u._queue[0];f.event===a&&(u._queue.shift(),u._loadQueue()),a||f.action()}return u},_ended:function(a){var u=this,f=a._sprite;if(!u._webAudio&&a._node&&!a._node.paused&&!a._node.ended&&a._node.currentTime<a._stop)return setTimeout(u._ended.bind(u,a),100),u;var y=!!(a._loop||u._sprite[f][2]);if(u._emit("end",a._id),!u._webAudio&&y&&u.stop(a._id,!0).play(a._id),u._webAudio&&y){u._emit("play",a._id),a._seek=a._start||0,a._rateSeek=0,a._playStart=e.ctx.currentTime;var _=(a._stop-a._start)*1e3/Math.abs(a._rate);u._endTimers[a._id]=setTimeout(u._ended.bind(u,a),_)}return u._webAudio&&!y&&(a._paused=!0,a._ended=!0,a._seek=a._start||0,a._rateSeek=0,u._clearTimer(a._id),u._cleanBuffer(a._node),e._autoSuspend()),!u._webAudio&&!y&&u.stop(a._id,!0),u},_clearTimer:function(a){var u=this;if(u._endTimers[a]){if(typeof u._endTimers[a]!="function")clearTimeout(u._endTimers[a]);else{var f=u._soundById(a);f&&f._node&&f._node.removeEventListener("ended",u._endTimers[a],!1)}delete u._endTimers[a]}return u},_soundById:function(a){for(var u=this,f=0;f<u._sounds.length;f++)if(a===u._sounds[f]._id)return u._sounds[f];return null},_inactiveSound:function(){var a=this;a._drain();for(var u=0;u<a._sounds.length;u++)if(a._sounds[u]._ended)return a._sounds[u].reset();return new i(a)},_drain:function(){var a=this,u=a._pool,f=0,y=0;if(!(a._sounds.length<u)){for(y=0;y<a._sounds.length;y++)a._sounds[y]._ended&&f++;for(y=a._sounds.length-1;y>=0;y--){if(f<=u)return;a._sounds[y]._ended&&(a._webAudio&&a._sounds[y]._node&&a._sounds[y]._node.disconnect(0),a._sounds.splice(y,1),f--)}}},_getSoundIds:function(a){var u=this;if(typeof a=="undefined"){for(var f=[],y=0;y<u._sounds.length;y++)f.push(u._sounds[y]._id);return f}else return[a]},_refreshBuffer:function(a){var u=this;return a._node.bufferSource=e.ctx.createBufferSource(),a._node.bufferSource.buffer=l[u._src],a._panner?a._node.bufferSource.connect(a._panner):a._node.bufferSource.connect(a._node),a._node.bufferSource.loop=a._loop,a._loop&&(a._node.bufferSource.loopStart=a._start||0,a._node.bufferSource.loopEnd=a._stop||0),a._node.bufferSource.playbackRate.setValueAtTime(a._rate,e.ctx.currentTime),u},_cleanBuffer:function(a){var u=this,f=e._navigator&&e._navigator.vendor.indexOf("Apple")>=0;if(!a.bufferSource)return u;if(e._scratchBuffer&&a.bufferSource&&(a.bufferSource.onended=null,a.bufferSource.disconnect(0),f))try{a.bufferSource.buffer=e._scratchBuffer}catch(y){}return a.bufferSource=null,u},_clearSound:function(a){var u=/MSIE |Trident\//.test(e._navigator&&e._navigator.userAgent);u||(a.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var i=function(a){this._parent=a,this.init()};i.prototype={init:function(){var a=this,u=a._parent;return a._muted=u._muted,a._loop=u._loop,a._volume=u._volume,a._rate=u._rate,a._seek=0,a._paused=!0,a._ended=!0,a._sprite="__default",a._id=++e._counter,u._sounds.push(a),a.create(),a},create:function(){var a=this,u=a._parent,f=e._muted||a._muted||a._parent._muted?0:a._volume;return u._webAudio?(a._node=typeof e.ctx.createGain=="undefined"?e.ctx.createGainNode():e.ctx.createGain(),a._node.gain.setValueAtTime(f,e.ctx.currentTime),a._node.paused=!0,a._node.connect(e.masterGain)):e.noAudio||(a._node=e._obtainHtml5Audio(),a._errorFn=a._errorListener.bind(a),a._node.addEventListener("error",a._errorFn,!1),a._loadFn=a._loadListener.bind(a),a._node.addEventListener(e._canPlayEvent,a._loadFn,!1),a._endFn=a._endListener.bind(a),a._node.addEventListener("ended",a._endFn,!1),a._node.src=u._src,a._node.preload=u._preload===!0?"auto":u._preload,a._node.volume=f*e.volume(),a._node.load()),a},reset:function(){var a=this,u=a._parent;return a._muted=u._muted,a._loop=u._loop,a._volume=u._volume,a._rate=u._rate,a._seek=0,a._rateSeek=0,a._paused=!0,a._ended=!0,a._sprite="__default",a._id=++e._counter,a},_errorListener:function(){var a=this;a._parent._emit("loaderror",a._id,a._node.error?a._node.error.code:0),a._node.removeEventListener("error",a._errorFn,!1)},_loadListener:function(){var a=this,u=a._parent;u._duration=Math.ceil(a._node.duration*10)/10,Object.keys(u._sprite).length===0&&(u._sprite={__default:[0,u._duration*1e3]}),u._state!=="loaded"&&(u._state="loaded",u._emit("load"),u._loadQueue()),a._node.removeEventListener(e._canPlayEvent,a._loadFn,!1)},_endListener:function(){var a=this,u=a._parent;u._duration===1/0&&(u._duration=Math.ceil(a._node.duration*10)/10,u._sprite.__default[1]===1/0&&(u._sprite.__default[1]=u._duration*1e3),u._ended(a)),a._node.removeEventListener("ended",a._endFn,!1)}};var l={},c=function(a){var u=a._src;if(l[u]){a._duration=l[u].duration,g(a);return}if(/^data:[^;]+;base64,/.test(u)){for(var f=atob(u.split(",")[1]),y=new Uint8Array(f.length),_=0;_<f.length;++_)y[_]=f.charCodeAt(_);d(y.buffer,a)}else{var b=new XMLHttpRequest;b.open(a._xhr.method,u,!0),b.withCredentials=a._xhr.withCredentials,b.responseType="arraybuffer",a._xhr.headers&&Object.keys(a._xhr.headers).forEach(function(v){b.setRequestHeader(v,a._xhr.headers[v])}),b.onload=function(){var v=(b.status+"")[0];if(v!=="0"&&v!=="2"&&v!=="3"){a._emit("loaderror",null,"Failed loading audio file with status: "+b.status+".");return}d(b.response,a)},b.onerror=function(){a._webAudio&&(a._html5=!0,a._webAudio=!1,a._sounds=[],delete l[u],a.load())},h(b)}},h=function(a){try{a.send()}catch(u){a.onerror()}},d=function(a,u){var f=function(){u._emit("loaderror",null,"Decoding audio data failed.")},y=function(_){_&&u._sounds.length>0?(l[u._src]=_,g(u,_)):f()};typeof Promise!="undefined"&&e.ctx.decodeAudioData.length===1?e.ctx.decodeAudioData(a).then(y).catch(f):e.ctx.decodeAudioData(a,y,f)},g=function(a,u){u&&!a._duration&&(a._duration=u.duration),Object.keys(a._sprite).length===0&&(a._sprite={__default:[0,a._duration*1e3]}),a._state!=="loaded"&&(a._state="loaded",a._emit("load"),a._loadQueue())},p=function(){if(e.usingWebAudio){try{typeof AudioContext!="undefined"?e.ctx=new AudioContext:typeof webkitAudioContext!="undefined"?e.ctx=new webkitAudioContext:e.usingWebAudio=!1}catch(_){e.usingWebAudio=!1}e.ctx||(e.usingWebAudio=!1);var a=/iP(hone|od|ad)/.test(e._navigator&&e._navigator.platform),u=e._navigator&&e._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),f=u?parseInt(u[1],10):null;if(a&&f&&f<9){var y=/safari/.test(e._navigator&&e._navigator.userAgent.toLowerCase());e._navigator&&!y&&(e.usingWebAudio=!1)}e.usingWebAudio&&(e.masterGain=typeof e.ctx.createGain=="undefined"?e.ctx.createGainNode():e.ctx.createGain(),e.masterGain.gain.setValueAtTime(e._muted?0:e._volume,e.ctx.currentTime),e.masterGain.connect(e.ctx.destination)),e._setup()}};r.Howler=e,r.Howl=n,typeof bt!="undefined"?(bt.HowlerGlobal=t,bt.Howler=e,bt.Howl=n,bt.Sound=i):typeof window!="undefined"&&(window.HowlerGlobal=t,window.Howler=e,window.Howl=n,window.Sound=i)})();/*!
* Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
*
* howler.js v2.2.4
* howlerjs.com
*
* (c) 2013-2020, James Simpson of GoldFire Studios
* goldfirestudios.com
*
* MIT License
*/(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var n=this;if(!n.ctx||!n.ctx.listener)return n;for(var i=n._howls.length-1;i>=0;i--)n._howls[i].stereo(e);return n},HowlerGlobal.prototype.pos=function(e,n,i){var l=this;if(!l.ctx||!l.ctx.listener)return l;if(n=typeof n!="number"?l._pos[1]:n,i=typeof i!="number"?l._pos[2]:i,typeof e=="number")l._pos=[e,n,i],typeof l.ctx.listener.positionX!="undefined"?(l.ctx.listener.positionX.setTargetAtTime(l._pos[0],Howler.ctx.currentTime,.1),l.ctx.listener.positionY.setTargetAtTime(l._pos[1],Howler.ctx.currentTime,.1),l.ctx.listener.positionZ.setTargetAtTime(l._pos[2],Howler.ctx.currentTime,.1)):l.ctx.listener.setPosition(l._pos[0],l._pos[1],l._pos[2]);else return l._pos;return l},HowlerGlobal.prototype.orientation=function(e,n,i,l,c,h){var d=this;if(!d.ctx||!d.ctx.listener)return d;var g=d._orientation;if(n=typeof n!="number"?g[1]:n,i=typeof i!="number"?g[2]:i,l=typeof l!="number"?g[3]:l,c=typeof c!="number"?g[4]:c,h=typeof h!="number"?g[5]:h,typeof e=="number")d._orientation=[e,n,i,l,c,h],typeof d.ctx.listener.forwardX!="undefined"?(d.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),d.ctx.listener.forwardY.setTargetAtTime(n,Howler.ctx.currentTime,.1),d.ctx.listener.forwardZ.setTargetAtTime(i,Howler.ctx.currentTime,.1),d.ctx.listener.upX.setTargetAtTime(l,Howler.ctx.currentTime,.1),d.ctx.listener.upY.setTargetAtTime(c,Howler.ctx.currentTime,.1),d.ctx.listener.upZ.setTargetAtTime(h,Howler.ctx.currentTime,.1)):d.ctx.listener.setOrientation(e,n,i,l,c,h);else return g;return d},Howl.prototype.init=function(e){return function(n){var i=this;return i._orientation=n.orientation||[1,0,0],i._stereo=n.stereo||null,i._pos=n.pos||null,i._pannerAttr={coneInnerAngle:typeof n.coneInnerAngle!="undefined"?n.coneInnerAngle:360,coneOuterAngle:typeof n.coneOuterAngle!="undefined"?n.coneOuterAngle:360,coneOuterGain:typeof n.coneOuterGain!="undefined"?n.coneOuterGain:0,distanceModel:typeof n.distanceModel!="undefined"?n.distanceModel:"inverse",maxDistance:typeof n.maxDistance!="undefined"?n.maxDistance:1e4,panningModel:typeof n.panningModel!="undefined"?n.panningModel:"HRTF",refDistance:typeof n.refDistance!="undefined"?n.refDistance:1,rolloffFactor:typeof n.rolloffFactor!="undefined"?n.rolloffFactor:1},i._onstereo=n.onstereo?[{fn:n.onstereo}]:[],i._onpos=n.onpos?[{fn:n.onpos}]:[],i._onorientation=n.onorientation?[{fn:n.onorientation}]:[],e.call(this,n)}}(Howl.prototype.init),Howl.prototype.stereo=function(e,n){var i=this;if(!i._webAudio)return i;if(i._state!=="loaded")return i._queue.push({event:"stereo",action:function(){i.stereo(e,n)}}),i;var l=typeof Howler.ctx.createStereoPanner=="undefined"?"spatial":"stereo";if(typeof n=="undefined")if(typeof e=="number")i._stereo=e,i._pos=[e,0,0];else return i._stereo;for(var c=i._getSoundIds(n),h=0;h<c.length;h++){var d=i._soundById(c[h]);if(d)if(typeof e=="number")d._stereo=e,d._pos=[e,0,0],d._node&&(d._pannerAttr.panningModel="equalpower",(!d._panner||!d._panner.pan)&&t(d,l),l==="spatial"?typeof d._panner.positionX!="undefined"?(d._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),d._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),d._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):d._panner.setPosition(e,0,0):d._panner.pan.setValueAtTime(e,Howler.ctx.currentTime)),i._emit("stereo",d._id);else return d._stereo}return i},Howl.prototype.pos=function(e,n,i,l){var c=this;if(!c._webAudio)return c;if(c._state!=="loaded")return c._queue.push({event:"pos",action:function(){c.pos(e,n,i,l)}}),c;if(n=typeof n!="number"?0:n,i=typeof i!="number"?-.5:i,typeof l=="undefined")if(typeof e=="number")c._pos=[e,n,i];else return c._pos;for(var h=c._getSoundIds(l),d=0;d<h.length;d++){var g=c._soundById(h[d]);if(g)if(typeof e=="number")g._pos=[e,n,i],g._node&&((!g._panner||g._panner.pan)&&t(g,"spatial"),typeof g._panner.positionX!="undefined"?(g._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),g._panner.positionY.setValueAtTime(n,Howler.ctx.currentTime),g._panner.positionZ.setValueAtTime(i,Howler.ctx.currentTime)):g._panner.setPosition(e,n,i)),c._emit("pos",g._id);else return g._pos}return c},Howl.prototype.orientation=function(e,n,i,l){var c=this;if(!c._webAudio)return c;if(c._state!=="loaded")return c._queue.push({event:"orientation",action:function(){c.orientation(e,n,i,l)}}),c;if(n=typeof n!="number"?c._orientation[1]:n,i=typeof i!="number"?c._orientation[2]:i,typeof l=="undefined")if(typeof e=="number")c._orientation=[e,n,i];else return c._orientation;for(var h=c._getSoundIds(l),d=0;d<h.length;d++){var g=c._soundById(h[d]);if(g)if(typeof e=="number")g._orientation=[e,n,i],g._node&&(g._panner||(g._pos||(g._pos=c._pos||[0,0,-.5]),t(g,"spatial")),typeof g._panner.orientationX!="undefined"?(g._panner.orientationX.setValueAtTime(e,Howler.ctx.currentTime),g._panner.orientationY.setValueAtTime(n,Howler.ctx.currentTime),g._panner.orientationZ.setValueAtTime(i,Howler.ctx.currentTime)):g._panner.setOrientation(e,n,i)),c._emit("orientation",g._id);else return g._orientation}return c},Howl.prototype.pannerAttr=function(){var e=this,n=arguments,i,l,c;if(!e._webAudio)return e;if(n.length===0)return e._pannerAttr;if(n.length===1)if(typeof n[0]=="object")i=n[0],typeof l=="undefined"&&(i.pannerAttr||(i.pannerAttr={coneInnerAngle:i.coneInnerAngle,coneOuterAngle:i.coneOuterAngle,coneOuterGain:i.coneOuterGain,distanceModel:i.distanceModel,maxDistance:i.maxDistance,refDistance:i.refDistance,rolloffFactor:i.rolloffFactor,panningModel:i.panningModel}),e._pannerAttr={coneInnerAngle:typeof i.pannerAttr.coneInnerAngle!="undefined"?i.pannerAttr.coneInnerAngle:e._coneInnerAngle,coneOuterAngle:typeof i.pannerAttr.coneOuterAngle!="undefined"?i.pannerAttr.coneOuterAngle:e._coneOuterAngle,coneOuterGain:typeof i.pannerAttr.coneOuterGain!="undefined"?i.pannerAttr.coneOuterGain:e._coneOuterGain,distanceModel:typeof i.pannerAttr.distanceModel!="undefined"?i.pannerAttr.distanceModel:e._distanceModel,maxDistance:typeof i.pannerAttr.maxDistance!="undefined"?i.pannerAttr.maxDistance:e._maxDistance,refDistance:typeof i.pannerAttr.refDistance!="undefined"?i.pannerAttr.refDistance:e._refDistance,rolloffFactor:typeof i.pannerAttr.rolloffFactor!="undefined"?i.pannerAttr.rolloffFactor:e._rolloffFactor,panningModel:typeof i.pannerAttr.panningModel!="undefined"?i.pannerAttr.panningModel:e._panningModel});else return c=e._soundById(parseInt(n[0],10)),c?c._pannerAttr:e._pannerAttr;else n.length===2&&(i=n[0],l=parseInt(n[1],10));for(var h=e._getSoundIds(l),d=0;d<h.length;d++)if(c=e._soundById(h[d]),c){var g=c._pannerAttr;g={coneInnerAngle:typeof i.coneInnerAngle!="undefined"?i.coneInnerAngle:g.coneInnerAngle,coneOuterAngle:typeof i.coneOuterAngle!="undefined"?i.coneOuterAngle:g.coneOuterAngle,coneOuterGain:typeof i.coneOuterGain!="undefined"?i.coneOuterGain:g.coneOuterGain,distanceModel:typeof i.distanceModel!="undefined"?i.distanceModel:g.distanceModel,maxDistance:typeof i.maxDistance!="undefined"?i.maxDistance:g.maxDistance,refDistance:typeof i.refDistance!="undefined"?i.refDistance:g.refDistance,rolloffFactor:typeof i.rolloffFactor!="undefined"?i.rolloffFactor:g.rolloffFactor,panningModel:typeof i.panningModel!="undefined"?i.panningModel:g.panningModel};var p=c._panner;p||(c._pos||(c._pos=e._pos||[0,0,-.5]),t(c,"spatial"),p=c._panner),p.coneInnerAngle=g.coneInnerAngle,p.coneOuterAngle=g.coneOuterAngle,p.coneOuterGain=g.coneOuterGain,p.distanceModel=g.distanceModel,p.maxDistance=g.maxDistance,p.refDistance=g.refDistance,p.rolloffFactor=g.rolloffFactor,p.panningModel=g.panningModel}return e},Sound.prototype.init=function(e){return function(){var n=this,i=n._parent;n._orientation=i._orientation,n._stereo=i._stereo,n._pos=i._pos,n._pannerAttr=i._pannerAttr,e.call(this),n._stereo?i.stereo(n._stereo):n._pos&&i.pos(n._pos[0],n._pos[1],n._pos[2],n._id)}}(Sound.prototype.init),Sound.prototype.reset=function(e){return function(){var n=this,i=n._parent;return n._orientation=i._orientation,n._stereo=i._stereo,n._pos=i._pos,n._pannerAttr=i._pannerAttr,n._stereo?i.stereo(n._stereo):n._pos?i.pos(n._pos[0],n._pos[1],n._pos[2],n._id):n._panner&&(n._panner.disconnect(0),n._panner=void 0,i._refreshBuffer(n)),e.call(this)}}(Sound.prototype.reset);var t=function(e,n){n=n||"spatial",n==="spatial"?(e._panner=Howler.ctx.createPanner(),e._panner.coneInnerAngle=e._pannerAttr.coneInnerAngle,e._panner.coneOuterAngle=e._pannerAttr.coneOuterAngle,e._panner.coneOuterGain=e._pannerAttr.coneOuterGain,e._panner.distanceModel=e._pannerAttr.distanceModel,e._panner.maxDistance=e._pannerAttr.maxDistance,e._panner.refDistance=e._pannerAttr.refDistance,e._panner.rolloffFactor=e._pannerAttr.rolloffFactor,e._panner.panningModel=e._pannerAttr.panningModel,typeof e._panner.positionX!="undefined"?(e._panner.positionX.setValueAtTime(e._pos[0],Howler.ctx.currentTime),e._panner.positionY.setValueAtTime(e._pos[1],Howler.ctx.currentTime),e._panner.positionZ.setValueAtTime(e._pos[2],Howler.ctx.currentTime)):e._panner.setPosition(e._pos[0],e._pos[1],e._pos[2]),typeof e._panner.orientationX!="undefined"?(e._panner.orientationX.setValueAtTime(e._orientation[0],Howler.ctx.currentTime),e._panner.orientationY.setValueAtTime(e._orientation[1],Howler.ctx.currentTime),e._panner.orientationZ.setValueAtTime(e._orientation[2],Howler.ctx.currentTime)):e._panner.setOrientation(e._orientation[0],e._orientation[1],e._orientation[2])):(e._panner=Howler.ctx.createStereoPanner(),e._panner.pan.setValueAtTime(e._stereo,Howler.ctx.currentTime)),e._panner.connect(e._node),e._paused||e._parent.pause(e._id,!0).play(e._id,!0)}})()})(y1);class _1{constructor(){this.encoder=new TextEncoder,this._pieces=[],this._parts=[]}append_buffer(t){this.flush(),this._parts.push(t)}append(t){this._pieces.push(t)}flush(){if(this._pieces.length>0){const t=new Uint8Array(this._pieces);this._parts.push(t),this._pieces=[]}}toArrayBuffer(){const t=[];for(const e of this._parts)t.push(e);return b1(t).buffer}}function b1(r){let t=0;for(const i of r)t+=i.byteLength;const e=new Uint8Array(t);let n=0;for(const i of r){const l=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);e.set(l,n),n+=i.byteLength}return e}function vd(r){return new w1(r).unpack()}function yd(r){const t=new x1,e=t.pack(r);return e instanceof Promise?e.then(()=>t.getBuffer()):t.getBuffer()}class w1{constructor(t){this.index=0,this.dataBuffer=t,this.dataView=new Uint8Array(this.dataBuffer),this.length=this.dataBuffer.byteLength}unpack(){const t=this.unpack_uint8();if(t<128)return t;if((t^224)<32)return(t^224)-32;let e;if((e=t^160)<=15)return this.unpack_raw(e);if((e=t^176)<=15)return this.unpack_string(e);if((e=t^144)<=15)return this.unpack_array(e);if((e=t^128)<=15)return this.unpack_map(e);switch(t){case 192:return null;case 193:return;case 194:return!1;case 195:return!0;case 202:return this.unpack_float();case 203:return this.unpack_double();case 204:return this.unpack_uint8();case 205:return this.unpack_uint16();case 206:return this.unpack_uint32();case 207:return this.unpack_uint64();case 208:return this.unpack_int8();case 209:return this.unpack_int16();case 210:return this.unpack_int32();case 211:return this.unpack_int64();case 212:return;case 213:return;case 214:return;case 215:return;case 216:return e=this.unpack_uint16(),this.unpack_string(e);case 217:return e=this.unpack_uint32(),this.unpack_string(e);case 218:return e=this.unpack_uint16(),this.unpack_raw(e);case 219:return e=this.unpack_uint32(),this.unpack_raw(e);case 220:return e=this.unpack_uint16(),this.unpack_array(e);case 221:return e=this.unpack_uint32(),this.unpack_array(e);case 222:return e=this.unpack_uint16(),this.unpack_map(e);case 223:return e=this.unpack_uint32(),this.unpack_map(e)}}unpack_uint8(){const t=this.dataView[this.index]&255;return this.index++,t}unpack_uint16(){const t=this.read(2),e=(t[0]&255)*256+(t[1]&255);return this.index+=2,e}unpack_uint32(){const t=this.read(4),e=((t[0]*256+t[1])*256+t[2])*256+t[3];return this.index+=4,e}unpack_uint64(){const t=this.read(8),e=((((((t[0]*256+t[1])*256+t[2])*256+t[3])*256+t[4])*256+t[5])*256+t[6])*256+t[7];return this.index+=8,e}unpack_int8(){const t=this.unpack_uint8();return t<128?t:t-256}unpack_int16(){const t=this.unpack_uint16();return t<32768?t:t-65536}unpack_int32(){const t=this.unpack_uint32();return t<dn(2,31)?t:t-dn(2,32)}unpack_int64(){const t=this.unpack_uint64();return t<dn(2,63)?t:t-dn(2,64)}unpack_raw(t){if(this.length<this.index+t)throw new Error(`BinaryPackFailure: index is out of range ${this.index} ${t} ${this.length}`);const e=this.dataBuffer.slice(this.index,this.index+t);return this.index+=t,e}unpack_string(t){const e=this.read(t);let n=0,i="",l,c;for(;n<t;)l=e[n],l<160?(c=l,n++):(l^192)<32?(c=(l&31)<<6|e[n+1]&63,n+=2):(l^224)<16?(c=(l&15)<<12|(e[n+1]&63)<<6|e[n+2]&63,n+=3):(c=(l&7)<<18|(e[n+1]&63)<<12|(e[n+2]&63)<<6|e[n+3]&63,n+=4),i+=String.fromCodePoint(c);return this.index+=t,i}unpack_array(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=this.unpack();return e}unpack_map(t){const e={};for(let n=0;n<t;n++){const i=this.unpack();e[i]=this.unpack()}return e}unpack_float(){const t=this.unpack_uint32(),e=t>>31,n=(t>>23&255)-127,i=t&8388607|8388608;return(e===0?1:-1)*i*dn(2,n-23)}unpack_double(){const t=this.unpack_uint32(),e=this.unpack_uint32(),n=t>>31,i=(t>>20&2047)-1023,c=(t&1048575|1048576)*dn(2,i-20)+e*dn(2,i-52);return(n===0?1:-1)*c}read(t){const e=this.index;if(e+t<=this.length)return this.dataView.subarray(e,e+t);throw new Error("BinaryPackFailure: read index out of range")}}class x1{getBuffer(){return this._bufferBuilder.toArrayBuffer()}pack(t){if(typeof t=="string")this.pack_string(t);else if(typeof t=="number")Math.floor(t)===t?this.pack_integer(t):this.pack_double(t);else if(typeof t=="boolean")t===!0?this._bufferBuilder.append(195):t===!1&&this._bufferBuilder.append(194);else if(t===void 0)this._bufferBuilder.append(192);else if(typeof t=="object")if(t===null)this._bufferBuilder.append(192);else{const e=t.constructor;if(t instanceof Array){const n=this.pack_array(t);if(n instanceof Promise)return n.then(()=>this._bufferBuilder.flush())}else if(t instanceof ArrayBuffer)this.pack_bin(new Uint8Array(t));else if("BYTES_PER_ELEMENT"in t){const n=t;this.pack_bin(new Uint8Array(n.buffer,n.byteOffset,n.byteLength))}else if(t instanceof Date)this.pack_string(t.toString());else{if(t instanceof Blob)return t.arrayBuffer().then(n=>{this.pack_bin(new Uint8Array(n)),this._bufferBuilder.flush()});if(e==Object||e.toString().startsWith("class")){const n=this.pack_object(t);if(n instanceof Promise)return n.then(()=>this._bufferBuilder.flush())}else throw new Error(`Type "${e.toString()}" not yet supported`)}}else throw new Error(`Type "${typeof t}" not yet supported`);this._bufferBuilder.flush()}pack_bin(t){const e=t.length;if(e<=15)this.pack_uint8(160+e);else if(e<=65535)this._bufferBuilder.append(218),this.pack_uint16(e);else if(e<=4294967295)this._bufferBuilder.append(219),this.pack_uint32(e);else throw new Error("Invalid length");this._bufferBuilder.append_buffer(t)}pack_string(t){const e=this._textEncoder.encode(t),n=e.length;if(n<=15)this.pack_uint8(176+n);else if(n<=65535)this._bufferBuilder.append(216),this.pack_uint16(n);else if(n<=4294967295)this._bufferBuilder.append(217),this.pack_uint32(n);else throw new Error("Invalid length");this._bufferBuilder.append_buffer(e)}pack_array(t){const e=t.length;if(e<=15)this.pack_uint8(144+e);else if(e<=65535)this._bufferBuilder.append(220),this.pack_uint16(e);else if(e<=4294967295)this._bufferBuilder.append(221),this.pack_uint32(e);else throw new Error("Invalid length");const n=i=>{if(i<e){const l=this.pack(t[i]);return l instanceof Promise?l.then(()=>n(i+1)):n(i+1)}};return n(0)}pack_integer(t){if(t>=-32&&t<=127)this._bufferBuilder.append(t&255);else if(t>=0&&t<=255)this._bufferBuilder.append(204),this.pack_uint8(t);else if(t>=-128&&t<=127)this._bufferBuilder.append(208),this.pack_int8(t);else if(t>=0&&t<=65535)this._bufferBuilder.append(205),this.pack_uint16(t);else if(t>=-32768&&t<=32767)this._bufferBuilder.append(209),this.pack_int16(t);else if(t>=0&&t<=4294967295)this._bufferBuilder.append(206),this.pack_uint32(t);else if(t>=-2147483648&&t<=2147483647)this._bufferBuilder.append(210),this.pack_int32(t);else if(t>=-9223372036854776e3&&t<=9223372036854776e3)this._bufferBuilder.append(211),this.pack_int64(t);else if(t>=0&&t<=18446744073709552e3)this._bufferBuilder.append(207),this.pack_uint64(t);else throw new Error("Invalid integer")}pack_double(t){let e=0;t<0&&(e=1,t=-t);const n=Math.floor(Math.log(t)/Math.LN2),i=t/dn(2,n)-1,l=Math.floor(i*dn(2,52)),c=dn(2,32),h=e<<31|n+1023<<20|l/c&1048575,d=l%c;this._bufferBuilder.append(203),this.pack_int32(h),this.pack_int32(d)}pack_object(t){const e=Object.keys(t),n=e.length;if(n<=15)this.pack_uint8(128+n);else if(n<=65535)this._bufferBuilder.append(222),this.pack_uint16(n);else if(n<=4294967295)this._bufferBuilder.append(223),this.pack_uint32(n);else throw new Error("Invalid length");const i=l=>{if(l<e.length){const c=e[l];if(t.hasOwnProperty(c)){this.pack(c);const h=this.pack(t[c]);if(h instanceof Promise)return h.then(()=>i(l+1))}return i(l+1)}};return i(0)}pack_uint8(t){this._bufferBuilder.append(t)}pack_uint16(t){this._bufferBuilder.append(t>>8),this._bufferBuilder.append(t&255)}pack_uint32(t){const e=t&4294967295;this._bufferBuilder.append((e&4278190080)>>>24),this._bufferBuilder.append((e&16711680)>>>16),this._bufferBuilder.append((e&65280)>>>8),this._bufferBuilder.append(e&255)}pack_uint64(t){const e=t/4294967296,n=t%dn(2,32);this._bufferBuilder.append((e&4278190080)>>>24),this._bufferBuilder.append((e&16711680)>>>16),this._bufferBuilder.append((e&65280)>>>8),this._bufferBuilder.append(e&255),this._bufferBuilder.append((n&4278190080)>>>24),this._bufferBuilder.append((n&16711680)>>>16),this._bufferBuilder.append((n&65280)>>>8),this._bufferBuilder.append(n&255)}pack_int8(t){this._bufferBuilder.append(t&255)}pack_int16(t){this._bufferBuilder.append((t&65280)>>8),this._bufferBuilder.append(t&255)}pack_int32(t){this._bufferBuilder.append(t>>>24&255),this._bufferBuilder.append((t&16711680)>>>16),this._bufferBuilder.append((t&65280)>>>8),this._bufferBuilder.append(t&255)}pack_int64(t){const e=Math.floor(t/4294967296),n=t%dn(2,32);this._bufferBuilder.append((e&4278190080)>>>24),this._bufferBuilder.append((e&16711680)>>>16),this._bufferBuilder.append((e&65280)>>>8),this._bufferBuilder.append(e&255),this._bufferBuilder.append((n&4278190080)>>>24),this._bufferBuilder.append((n&16711680)>>>16),this._bufferBuilder.append((n&65280)>>>8),this._bufferBuilder.append(n&255)}constructor(){this._bufferBuilder=new _1,this._textEncoder=new TextEncoder}}let _d=!0,bd=!0;function na(r,t,e){const n=r.match(t);return n&&n.length>=e&&parseFloat(n[e],10)}function bi(r,t,e){if(!r.RTCPeerConnection)return;const n=r.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(c,h){if(c!==t)return i.apply(this,arguments);const d=g=>{const p=e(g);p&&(h.handleEvent?h.handleEvent(p):h(p))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(h,d),i.apply(this,[c,d])};const l=n.removeEventListener;n.removeEventListener=function(c,h){if(c!==t||!this._eventMap||!this._eventMap[t])return l.apply(this,arguments);if(!this._eventMap[t].has(h))return l.apply(this,arguments);const d=this._eventMap[t].get(h);return this._eventMap[t].delete(h),this._eventMap[t].size===0&&delete this._eventMap[t],Object.keys(this._eventMap).length===0&&delete this._eventMap,l.apply(this,[c,d])},Object.defineProperty(n,"on"+t,{get(){return this["_on"+t]},set(c){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),c&&this.addEventListener(t,this["_on"+t]=c)},enumerable:!0,configurable:!0})}function T1(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(_d=r,r?"adapter.js logging disabled":"adapter.js logging enabled")}function S1(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(bd=!r,"adapter.js deprecation warnings "+(r?"disabled":"enabled"))}function wd(){if(typeof window=="object"){if(_d)return;typeof console!="undefined"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Xu(r,t){bd&&console.warn(r+" is deprecated, please use "+t+" instead.")}function O1(r){const t={browser:null,version:null};if(typeof r=="undefined"||!r.navigator||!r.navigator.userAgent)return t.browser="Not a browser.",t;const{navigator:e}=r;if(e.userAgentData&&e.userAgentData.brands){const n=e.userAgentData.brands.find(i=>i.brand==="Chromium");if(n)return{browser:"chrome",version:parseInt(n.version,10)}}if(e.mozGetUserMedia)t.browser="firefox",t.version=parseInt(na(e.userAgent,/Firefox\/(\d+)\./,1));else if(e.webkitGetUserMedia||r.isSecureContext===!1&&r.webkitRTCPeerConnection)t.browser="chrome",t.version=parseInt(na(e.userAgent,/Chrom(e|ium)\/(\d+)\./,2));else if(r.RTCPeerConnection&&e.userAgent.match(/AppleWebKit\/(\d+)\./))t.browser="safari",t.version=parseInt(na(e.userAgent,/AppleWebKit\/(\d+)\./,1)),t.supportsUnifiedPlan=r.RTCRtpTransceiver&&"currentDirection"in r.RTCRtpTransceiver.prototype,t._safariVersion=na(e.userAgent,/Version\/(\d+(\.?\d+))/,1);else return t.browser="Not a supported browser.",t;return t}function xh(r){return Object.prototype.toString.call(r)==="[object Object]"}function xd(r){return xh(r)?Object.keys(r).reduce(function(t,e){const n=xh(r[e]),i=n?xd(r[e]):r[e],l=n&&!Object.keys(i).length;return i===void 0||l?t:Object.assign(t,{[e]:i})},{}):r}function wu(r,t,e){!t||e.has(t.id)||(e.set(t.id,t),Object.keys(t).forEach(n=>{n.endsWith("Id")?wu(r,r.get(t[n]),e):n.endsWith("Ids")&&t[n].forEach(i=>{wu(r,r.get(i),e)})}))}function Th(r,t,e){const n=e?"outbound-rtp":"inbound-rtp",i=new Map;if(t===null)return i;const l=[];return r.forEach(c=>{c.type==="track"&&c.trackIdentifier===t.id&&l.push(c)}),l.forEach(c=>{r.forEach(h=>{h.type===n&&h.trackId===c.id&&wu(r,h,i)})}),i}const Sh=wd;function Td(r,t){const e=r&&r.navigator;if(!e.mediaDevices)return;const n=function(h){if(typeof h!="object"||h.mandatory||h.optional)return h;const d={};return Object.keys(h).forEach(g=>{if(g==="require"||g==="advanced"||g==="mediaSource")return;const p=typeof h[g]=="object"?h[g]:{ideal:h[g]};p.exact!==void 0&&typeof p.exact=="number"&&(p.min=p.max=p.exact);const a=function(u,f){return u?u+f.charAt(0).toUpperCase()+f.slice(1):f==="deviceId"?"sourceId":f};if(p.ideal!==void 0){d.optional=d.optional||[];let u={};typeof p.ideal=="number"?(u[a("min",g)]=p.ideal,d.optional.push(u),u={},u[a("max",g)]=p.ideal,d.optional.push(u)):(u[a("",g)]=p.ideal,d.optional.push(u))}p.exact!==void 0&&typeof p.exact!="number"?(d.mandatory=d.mandatory||{},d.mandatory[a("",g)]=p.exact):["min","max"].forEach(u=>{p[u]!==void 0&&(d.mandatory=d.mandatory||{},d.mandatory[a(u,g)]=p[u])})}),h.advanced&&(d.optional=(d.optional||[]).concat(h.advanced)),d},i=function(h,d){if(t.version>=61)return d(h);if(h=JSON.parse(JSON.stringify(h)),h&&typeof h.audio=="object"){const g=function(p,a,u){a in p&&!(u in p)&&(p[u]=p[a],delete p[a])};h=JSON.parse(JSON.stringify(h)),g(h.audio,"autoGainControl","googAutoGainControl"),g(h.audio,"noiseSuppression","googNoiseSuppression"),h.audio=n(h.audio)}if(h&&typeof h.video=="object"){let g=h.video.facingMode;g=g&&(typeof g=="object"?g:{ideal:g});const p=t.version<66;if(g&&(g.exact==="user"||g.exact==="environment"||g.ideal==="user"||g.ideal==="environment")&&!(e.mediaDevices.getSupportedConstraints&&e.mediaDevices.getSupportedConstraints().facingMode&&!p)){delete h.video.facingMode;let a;if(g.exact==="environment"||g.ideal==="environment"?a=["back","rear"]:(g.exact==="user"||g.ideal==="user")&&(a=["front"]),a)return e.mediaDevices.enumerateDevices().then(u=>{u=u.filter(y=>y.kind==="videoinput");let f=u.find(y=>a.some(_=>y.label.toLowerCase().includes(_)));return!f&&u.length&&a.includes("back")&&(f=u[u.length-1]),f&&(h.video.deviceId=g.exact?{exact:f.deviceId}:{ideal:f.deviceId}),h.video=n(h.video),Sh("chrome: "+JSON.stringify(h)),d(h)})}h.video=n(h.video)}return Sh("chrome: "+JSON.stringify(h)),d(h)},l=function(h){return t.version>=64?h:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[h.name]||h.name,message:h.message,constraint:h.constraint||h.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},c=function(h,d,g){i(h,p=>{e.webkitGetUserMedia(p,d,a=>{g&&g(l(a))})})};if(e.getUserMedia=c.bind(e),e.mediaDevices.getUserMedia){const h=e.mediaDevices.getUserMedia.bind(e.mediaDevices);e.mediaDevices.getUserMedia=function(d){return i(d,g=>h(g).then(p=>{if(g.audio&&!p.getAudioTracks().length||g.video&&!p.getVideoTracks().length)throw p.getTracks().forEach(a=>{a.stop()}),new DOMException("","NotFoundError");return p},p=>Promise.reject(l(p))))}}}function Sd(r){r.MediaStream=r.MediaStream||r.webkitMediaStream}function Od(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("ontrack"in r.RTCPeerConnection.prototype)){Object.defineProperty(r.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=n=>{n.stream.addEventListener("addtrack",i=>{let l;r.RTCPeerConnection.prototype.getReceivers?l=this.getReceivers().find(h=>h.track&&h.track.id===i.track.id):l={track:i.track};const c=new Event("track");c.track=i.track,c.receiver=l,c.transceiver={receiver:l},c.streams=[n.stream],this.dispatchEvent(c)}),n.stream.getTracks().forEach(i=>{let l;r.RTCPeerConnection.prototype.getReceivers?l=this.getReceivers().find(h=>h.track&&h.track.id===i.id):l={track:i};const c=new Event("track");c.track=i,c.receiver=l,c.transceiver={receiver:l},c.streams=[n.stream],this.dispatchEvent(c)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else bi(r,"track",t=>(t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t))}function Ed(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("getSenders"in r.RTCPeerConnection.prototype)&&"createDTMFSender"in r.RTCPeerConnection.prototype){const t=function(i,l){return{track:l,get dtmf(){return this._dtmf===void 0&&(l.kind==="audio"?this._dtmf=i.createDTMFSender(l):this._dtmf=null),this._dtmf},_pc:i}};if(!r.RTCPeerConnection.prototype.getSenders){r.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(h,d){let g=i.apply(this,arguments);return g||(g=t(this,h),this._senders.push(g)),g};const l=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(h){l.apply(this,arguments);const d=this._senders.indexOf(h);d!==-1&&this._senders.splice(d,1)}}const e=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(l){this._senders=this._senders||[],e.apply(this,[l]),l.getTracks().forEach(c=>{this._senders.push(t(this,c))})};const n=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(l){this._senders=this._senders||[],n.apply(this,[l]),l.getTracks().forEach(c=>{const h=this._senders.find(d=>d.track===c);h&&this._senders.splice(this._senders.indexOf(h),1)})}}else if(typeof r=="object"&&r.RTCPeerConnection&&"getSenders"in r.RTCPeerConnection.prototype&&"createDTMFSender"in r.RTCPeerConnection.prototype&&r.RTCRtpSender&&!("dtmf"in r.RTCRtpSender.prototype)){const t=r.RTCPeerConnection.prototype.getSenders;r.RTCPeerConnection.prototype.getSenders=function(){const n=t.apply(this,[]);return n.forEach(i=>i._pc=this),n},Object.defineProperty(r.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Ad(r){if(!(typeof r=="object"&&r.RTCPeerConnection&&r.RTCRtpSender&&r.RTCRtpReceiver))return;if(!("getStats"in r.RTCRtpSender.prototype)){const e=r.RTCPeerConnection.prototype.getSenders;e&&(r.RTCPeerConnection.prototype.getSenders=function(){const l=e.apply(this,[]);return l.forEach(c=>c._pc=this),l});const n=r.RTCPeerConnection.prototype.addTrack;n&&(r.RTCPeerConnection.prototype.addTrack=function(){const l=n.apply(this,arguments);return l._pc=this,l}),r.RTCRtpSender.prototype.getStats=function(){const l=this;return this._pc.getStats().then(c=>Th(c,l.track,!0))}}if(!("getStats"in r.RTCRtpReceiver.prototype)){const e=r.RTCPeerConnection.prototype.getReceivers;e&&(r.RTCPeerConnection.prototype.getReceivers=function(){const i=e.apply(this,[]);return i.forEach(l=>l._pc=this),i}),bi(r,"track",n=>(n.receiver._pc=n.srcElement,n)),r.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(l=>Th(l,i.track,!1))}}if(!("getStats"in r.RTCRtpSender.prototype&&"getStats"in r.RTCRtpReceiver.prototype))return;const t=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof r.MediaStreamTrack){const n=arguments[0];let i,l,c;return this.getSenders().forEach(h=>{h.track===n&&(i?c=!0:i=h)}),this.getReceivers().forEach(h=>(h.track===n&&(l?c=!0:l=h),h.track===n)),c||i&&l?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():l?l.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function Cd(r){r.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(c=>this._shimmedLocalStreams[c][0])};const t=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(c,h){if(!h)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const d=t.apply(this,arguments);return this._shimmedLocalStreams[h.id]?this._shimmedLocalStreams[h.id].indexOf(d)===-1&&this._shimmedLocalStreams[h.id].push(d):this._shimmedLocalStreams[h.id]=[h,d],d};const e=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(c){this._shimmedLocalStreams=this._shimmedLocalStreams||{},c.getTracks().forEach(g=>{if(this.getSenders().find(a=>a.track===g))throw new DOMException("Track already exists.","InvalidAccessError")});const h=this.getSenders();e.apply(this,arguments);const d=this.getSenders().filter(g=>h.indexOf(g)===-1);this._shimmedLocalStreams[c.id]=[c].concat(d)};const n=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(c){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[c.id],n.apply(this,arguments)};const i=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(c){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},c&&Object.keys(this._shimmedLocalStreams).forEach(h=>{const d=this._shimmedLocalStreams[h].indexOf(c);d!==-1&&this._shimmedLocalStreams[h].splice(d,1),this._shimmedLocalStreams[h].length===1&&delete this._shimmedLocalStreams[h]}),i.apply(this,arguments)}}function kd(r,t){if(!r.RTCPeerConnection)return;if(r.RTCPeerConnection.prototype.addTrack&&t.version>=65)return Cd(r);const e=r.RTCPeerConnection.prototype.getLocalStreams;r.RTCPeerConnection.prototype.getLocalStreams=function(){const p=e.apply(this);return this._reverseStreams=this._reverseStreams||{},p.map(a=>this._reverseStreams[a.id])};const n=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(p){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},p.getTracks().forEach(a=>{if(this.getSenders().find(f=>f.track===a))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[p.id]){const a=new r.MediaStream(p.getTracks());this._streams[p.id]=a,this._reverseStreams[a.id]=p,p=a}n.apply(this,[p])};const i=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(p){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[p.id]||p]),delete this._reverseStreams[this._streams[p.id]?this._streams[p.id].id:p.id],delete this._streams[p.id]},r.RTCPeerConnection.prototype.addTrack=function(p,a){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const u=[].slice.call(arguments,1);if(u.length!==1||!u[0].getTracks().find(_=>_===p))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(_=>_.track===p))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const y=this._streams[a.id];if(y)y.addTrack(p),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const _=new r.MediaStream([p]);this._streams[a.id]=_,this._reverseStreams[_.id]=a,this.addStream(_)}return this.getSenders().find(_=>_.track===p)};function l(g,p){let a=p.sdp;return Object.keys(g._reverseStreams||[]).forEach(u=>{const f=g._reverseStreams[u],y=g._streams[f.id];a=a.replace(new RegExp(y.id,"g"),f.id)}),new RTCSessionDescription({type:p.type,sdp:a})}function c(g,p){let a=p.sdp;return Object.keys(g._reverseStreams||[]).forEach(u=>{const f=g._reverseStreams[u],y=g._streams[f.id];a=a.replace(new RegExp(f.id,"g"),y.id)}),new RTCSessionDescription({type:p.type,sdp:a})}["createOffer","createAnswer"].forEach(function(g){const p=r.RTCPeerConnection.prototype[g],a={[g](){const u=arguments;return arguments.length&&typeof arguments[0]=="function"?p.apply(this,[y=>{const _=l(this,y);u[0].apply(null,[_])},y=>{u[1]&&u[1].apply(null,y)},arguments[2]]):p.apply(this,arguments).then(y=>l(this,y))}};r.RTCPeerConnection.prototype[g]=a[g]});const h=r.RTCPeerConnection.prototype.setLocalDescription;r.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?h.apply(this,arguments):(arguments[0]=c(this,arguments[0]),h.apply(this,arguments))};const d=Object.getOwnPropertyDescriptor(r.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(r.RTCPeerConnection.prototype,"localDescription",{get(){const g=d.get.apply(this);return g.type===""?g:l(this,g)}}),r.RTCPeerConnection.prototype.removeTrack=function(p){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!p._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(p._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let u;Object.keys(this._streams).forEach(f=>{this._streams[f].getTracks().find(_=>p.track===_)&&(u=this._streams[f])}),u&&(u.getTracks().length===1?this.removeStream(this._reverseStreams[u.id]):u.removeTrack(p.track),this.dispatchEvent(new Event("negotiationneeded")))}}function xu(r,t){!r.RTCPeerConnection&&r.webkitRTCPeerConnection&&(r.RTCPeerConnection=r.webkitRTCPeerConnection),r.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){const n=r.RTCPeerConnection.prototype[e],i={[e](){return arguments[0]=new(e==="addIceCandidate"?r.RTCIceCandidate:r.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};r.RTCPeerConnection.prototype[e]=i[e]})}function Pd(r,t){bi(r,"negotiationneeded",e=>{const n=e.target;if(!((t.version<72||n.getConfiguration&&n.getConfiguration().sdpSemantics==="plan-b")&&n.signalingState!=="stable"))return e})}const Oh=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:Pd,shimAddTrackRemoveTrack:kd,shimAddTrackRemoveTrackWithNative:Cd,shimGetSendersWithDtmf:Ed,shimGetUserMedia:Td,shimMediaStream:Sd,shimOnTrack:Od,shimPeerConnection:xu,shimSenderReceiverGetStats:Ad},Symbol.toStringTag,{value:"Module"}));function Rd(r,t){const e=r&&r.navigator,n=r&&r.MediaStreamTrack;if(e.getUserMedia=function(i,l,c){Xu("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),e.mediaDevices.getUserMedia(i).then(l,c)},!(t.version>55&&"autoGainControl"in e.mediaDevices.getSupportedConstraints())){const i=function(c,h,d){h in c&&!(d in c)&&(c[d]=c[h],delete c[h])},l=e.mediaDevices.getUserMedia.bind(e.mediaDevices);if(e.mediaDevices.getUserMedia=function(c){return typeof c=="object"&&typeof c.audio=="object"&&(c=JSON.parse(JSON.stringify(c)),i(c.audio,"autoGainControl","mozAutoGainControl"),i(c.audio,"noiseSuppression","mozNoiseSuppression")),l(c)},n&&n.prototype.getSettings){const c=n.prototype.getSettings;n.prototype.getSettings=function(){const h=c.apply(this,arguments);return i(h,"mozAutoGainControl","autoGainControl"),i(h,"mozNoiseSuppression","noiseSuppression"),h}}if(n&&n.prototype.applyConstraints){const c=n.prototype.applyConstraints;n.prototype.applyConstraints=function(h){return this.kind==="audio"&&typeof h=="object"&&(h=JSON.parse(JSON.stringify(h)),i(h,"autoGainControl","mozAutoGainControl"),i(h,"noiseSuppression","mozNoiseSuppression")),c.apply(this,[h])}}}}function E1(r,t){r.navigator.mediaDevices&&"getDisplayMedia"in r.navigator.mediaDevices||r.navigator.mediaDevices&&(r.navigator.mediaDevices.getDisplayMedia=function(n){if(!(n&&n.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return n.video===!0?n.video={mediaSource:t}:n.video.mediaSource=t,r.navigator.mediaDevices.getUserMedia(n)})}function Md(r){typeof r=="object"&&r.RTCTrackEvent&&"receiver"in r.RTCTrackEvent.prototype&&!("transceiver"in r.RTCTrackEvent.prototype)&&Object.defineProperty(r.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Tu(r,t){if(typeof r!="object"||!(r.RTCPeerConnection||r.mozRTCPeerConnection))return;!r.RTCPeerConnection&&r.mozRTCPeerConnection&&(r.RTCPeerConnection=r.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(i){const l=r.RTCPeerConnection.prototype[i],c={[i](){return arguments[0]=new(i==="addIceCandidate"?r.RTCIceCandidate:r.RTCSessionDescription)(arguments[0]),l.apply(this,arguments)}};r.RTCPeerConnection.prototype[i]=c[i]});const e={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){const[l,c,h]=arguments;return n.apply(this,[l||null]).then(d=>{if(t.version<53&&!c)try{d.forEach(g=>{g.type=e[g.type]||g.type})}catch(g){if(g.name!=="TypeError")throw g;d.forEach((p,a)=>{d.set(a,Object.assign({},p,{type:e[p.type]||p.type}))})}return d}).then(c,h)}}function Dd(r){if(!(typeof r=="object"&&r.RTCPeerConnection&&r.RTCRtpSender)||r.RTCRtpSender&&"getStats"in r.RTCRtpSender.prototype)return;const t=r.RTCPeerConnection.prototype.getSenders;t&&(r.RTCPeerConnection.prototype.getSenders=function(){const i=t.apply(this,[]);return i.forEach(l=>l._pc=this),i});const e=r.RTCPeerConnection.prototype.addTrack;e&&(r.RTCPeerConnection.prototype.addTrack=function(){const i=e.apply(this,arguments);return i._pc=this,i}),r.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function Ld(r){if(!(typeof r=="object"&&r.RTCPeerConnection&&r.RTCRtpSender)||r.RTCRtpSender&&"getStats"in r.RTCRtpReceiver.prototype)return;const t=r.RTCPeerConnection.prototype.getReceivers;t&&(r.RTCPeerConnection.prototype.getReceivers=function(){const n=t.apply(this,[]);return n.forEach(i=>i._pc=this),n}),bi(r,"track",e=>(e.receiver._pc=e.srcElement,e)),r.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Id(r){!r.RTCPeerConnection||"removeStream"in r.RTCPeerConnection.prototype||(r.RTCPeerConnection.prototype.removeStream=function(e){Xu("removeStream","removeTrack"),this.getSenders().forEach(n=>{n.track&&e.getTracks().includes(n.track)&&this.removeTrack(n)})})}function Nd(r){r.DataChannel&&!r.RTCDataChannel&&(r.RTCDataChannel=r.DataChannel)}function Bd(r){if(!(typeof r=="object"&&r.RTCPeerConnection))return;const t=r.RTCPeerConnection.prototype.addTransceiver;t&&(r.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let n=arguments[1]&&arguments[1].sendEncodings;n===void 0&&(n=[]),n=[...n];const i=n.length>0;i&&n.forEach(c=>{if("rid"in c&&!/^[a-z0-9]{0,16}$/i.test(c.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in c&&!(parseFloat(c.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in c&&!(parseFloat(c.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const l=t.apply(this,arguments);if(i){const{sender:c}=l,h=c.getParameters();(!("encodings"in h)||h.encodings.length===1&&Object.keys(h.encodings[0]).length===0)&&(h.encodings=n,c.sendEncodings=n,this.setParametersPromises.push(c.setParameters(h).then(()=>{delete c.sendEncodings}).catch(()=>{delete c.sendEncodings})))}return l})}function Fd(r){if(!(typeof r=="object"&&r.RTCRtpSender))return;const t=r.RTCRtpSender.prototype.getParameters;t&&(r.RTCRtpSender.prototype.getParameters=function(){const n=t.apply(this,arguments);return"encodings"in n||(n.encodings=[].concat(this.sendEncodings||[{}])),n})}function qd(r){if(!(typeof r=="object"&&r.RTCPeerConnection))return;const t=r.RTCPeerConnection.prototype.createOffer;r.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}function jd(r){if(!(typeof r=="object"&&r.RTCPeerConnection))return;const t=r.RTCPeerConnection.prototype.createAnswer;r.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}const Eh=Object.freeze(Object.defineProperty({__proto__:null,shimAddTransceiver:Bd,shimCreateAnswer:jd,shimCreateOffer:qd,shimGetDisplayMedia:E1,shimGetParameters:Fd,shimGetUserMedia:Rd,shimOnTrack:Md,shimPeerConnection:Tu,shimRTCDataChannel:Nd,shimReceiverGetStats:Ld,shimRemoveStream:Id,shimSenderGetStats:Dd},Symbol.toStringTag,{value:"Module"}));function $d(r){if(!(typeof r!="object"||!r.RTCPeerConnection)){if("getLocalStreams"in r.RTCPeerConnection.prototype||(r.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in r.RTCPeerConnection.prototype)){const t=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addStream=function(n){this._localStreams||(this._localStreams=[]),this._localStreams.includes(n)||this._localStreams.push(n),n.getAudioTracks().forEach(i=>t.call(this,i,n)),n.getVideoTracks().forEach(i=>t.call(this,i,n))},r.RTCPeerConnection.prototype.addTrack=function(n,...i){return i&&i.forEach(l=>{this._localStreams?this._localStreams.includes(l)||this._localStreams.push(l):this._localStreams=[l]}),t.apply(this,arguments)}}"removeStream"in r.RTCPeerConnection.prototype||(r.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const n=this._localStreams.indexOf(e);if(n===-1)return;this._localStreams.splice(n,1);const i=e.getTracks();this.getSenders().forEach(l=>{i.includes(l.track)&&this.removeTrack(l)})})}}function Ud(r){if(!(typeof r!="object"||!r.RTCPeerConnection)&&("getRemoteStreams"in r.RTCPeerConnection.prototype||(r.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in r.RTCPeerConnection.prototype))){Object.defineProperty(r.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=n=>{n.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const l=new Event("addstream");l.stream=i,this.dispatchEvent(l)})})}});const t=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){const n=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(l=>{if(n._remoteStreams||(n._remoteStreams=[]),n._remoteStreams.indexOf(l)>=0)return;n._remoteStreams.push(l);const c=new Event("addstream");c.stream=l,n.dispatchEvent(c)})}),t.apply(n,arguments)}}}function Hd(r){if(typeof r!="object"||!r.RTCPeerConnection)return;const t=r.RTCPeerConnection.prototype,e=t.createOffer,n=t.createAnswer,i=t.setLocalDescription,l=t.setRemoteDescription,c=t.addIceCandidate;t.createOffer=function(g,p){const a=arguments.length>=2?arguments[2]:arguments[0],u=e.apply(this,[a]);return p?(u.then(g,p),Promise.resolve()):u},t.createAnswer=function(g,p){const a=arguments.length>=2?arguments[2]:arguments[0],u=n.apply(this,[a]);return p?(u.then(g,p),Promise.resolve()):u};let h=function(d,g,p){const a=i.apply(this,[d]);return p?(a.then(g,p),Promise.resolve()):a};t.setLocalDescription=h,h=function(d,g,p){const a=l.apply(this,[d]);return p?(a.then(g,p),Promise.resolve()):a},t.setRemoteDescription=h,h=function(d,g,p){const a=c.apply(this,[d]);return p?(a.then(g,p),Promise.resolve()):a},t.addIceCandidate=h}function Wd(r){const t=r&&r.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=i=>n(zd(i))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(n,i,l){t.mediaDevices.getUserMedia(n).then(i,l)}.bind(t))}function zd(r){return r&&r.video!==void 0?Object.assign({},r,{video:xd(r.video)}):r}function Gd(r){if(!r.RTCPeerConnection)return;const t=r.RTCPeerConnection;r.RTCPeerConnection=function(n,i){if(n&&n.iceServers){const l=[];for(let c=0;c<n.iceServers.length;c++){let h=n.iceServers[c];h.urls===void 0&&h.url?(Xu("RTCIceServer.url","RTCIceServer.urls"),h=JSON.parse(JSON.stringify(h)),h.urls=h.url,delete h.url,l.push(h)):l.push(n.iceServers[c])}n.iceServers=l}return new t(n,i)},r.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(r.RTCPeerConnection,"generateCertificate",{get(){return t.generateCertificate}})}function Yd(r){typeof r=="object"&&r.RTCTrackEvent&&"receiver"in r.RTCTrackEvent.prototype&&!("transceiver"in r.RTCTrackEvent.prototype)&&Object.defineProperty(r.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Vd(r){const t=r.RTCPeerConnection.prototype.createOffer;r.RTCPeerConnection.prototype.createOffer=function(n){if(n){typeof n.offerToReceiveAudio!="undefined"&&(n.offerToReceiveAudio=!!n.offerToReceiveAudio);const i=this.getTransceivers().find(c=>c.receiver.track.kind==="audio");n.offerToReceiveAudio===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):n.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof n.offerToReceiveVideo!="undefined"&&(n.offerToReceiveVideo=!!n.offerToReceiveVideo);const l=this.getTransceivers().find(c=>c.receiver.track.kind==="video");n.offerToReceiveVideo===!1&&l?l.direction==="sendrecv"?l.setDirection?l.setDirection("sendonly"):l.direction="sendonly":l.direction==="recvonly"&&(l.setDirection?l.setDirection("inactive"):l.direction="inactive"):n.offerToReceiveVideo===!0&&!l&&this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function Kd(r){typeof r!="object"||r.AudioContext||(r.AudioContext=r.webkitAudioContext)}const Ah=Object.freeze(Object.defineProperty({__proto__:null,shimAudioContext:Kd,shimCallbacksAPI:Hd,shimConstraints:zd,shimCreateOfferLegacy:Vd,shimGetUserMedia:Wd,shimLocalStreamsAPI:$d,shimRTCIceServerUrls:Gd,shimRemoteStreamsAPI:Ud,shimTrackEventTransceiver:Yd},Symbol.toStringTag,{value:"Module"}));var Xd={exports:{}};(function(r){const t={};t.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split(`
`).map(n=>n.trim())},t.splitSections=function(e){return e.split(`
m=`).map((i,l)=>(l>0?"m="+i:i).trim()+`\r
`)},t.getDescription=function(e){const n=t.splitSections(e);return n&&n[0]},t.getMediaSections=function(e){const n=t.splitSections(e);return n.shift(),n},t.matchPrefix=function(e,n){return t.splitLines(e).filter(i=>i.indexOf(n)===0)},t.parseCandidate=function(e){let n;e.indexOf("a=candidate:")===0?n=e.substring(12).split(" "):n=e.substring(10).split(" ");const i={foundation:n[0],component:{1:"rtp",2:"rtcp"}[n[1]]||n[1],protocol:n[2].toLowerCase(),priority:parseInt(n[3],10),ip:n[4],address:n[4],port:parseInt(n[5],10),type:n[7]};for(let l=8;l<n.length;l+=2)switch(n[l]){case"raddr":i.relatedAddress=n[l+1];break;case"rport":i.relatedPort=parseInt(n[l+1],10);break;case"tcptype":i.tcpType=n[l+1];break;case"ufrag":i.ufrag=n[l+1],i.usernameFragment=n[l+1];break;default:i[n[l]]===void 0&&(i[n[l]]=n[l+1]);break}return i},t.writeCandidate=function(e){const n=[];n.push(e.foundation);const i=e.component;i==="rtp"?n.push(1):i==="rtcp"?n.push(2):n.push(i),n.push(e.protocol.toUpperCase()),n.push(e.priority),n.push(e.address||e.ip),n.push(e.port);const l=e.type;return n.push("typ"),n.push(l),l!=="host"&&e.relatedAddress&&e.relatedPort&&(n.push("raddr"),n.push(e.relatedAddress),n.push("rport"),n.push(e.relatedPort)),e.tcpType&&e.protocol.toLowerCase()==="tcp"&&(n.push("tcptype"),n.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(n.push("ufrag"),n.push(e.usernameFragment||e.ufrag)),"candidate:"+n.join(" ")},t.parseIceOptions=function(e){return e.substring(14).split(" ")},t.parseRtpMap=function(e){let n=e.substring(9).split(" ");const i={payloadType:parseInt(n.shift(),10)};return n=n[0].split("/"),i.name=n[0],i.clockRate=parseInt(n[1],10),i.channels=n.length===3?parseInt(n[2],10):1,i.numChannels=i.channels,i},t.writeRtpMap=function(e){let n=e.payloadType;e.preferredPayloadType!==void 0&&(n=e.preferredPayloadType);const i=e.channels||e.numChannels||1;return"a=rtpmap:"+n+" "+e.name+"/"+e.clockRate+(i!==1?"/"+i:"")+`\r
`},t.parseExtmap=function(e){const n=e.substring(9).split(" ");return{id:parseInt(n[0],10),direction:n[0].indexOf("/")>0?n[0].split("/")[1]:"sendrecv",uri:n[1],attributes:n.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&e.direction!=="sendrecv"?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+`\r
`},t.parseFmtp=function(e){const n={};let i;const l=e.substring(e.indexOf(" ")+1).split(";");for(let c=0;c<l.length;c++)i=l[c].trim().split("="),n[i[0].trim()]=i[1];return n},t.writeFmtp=function(e){let n="",i=e.payloadType;if(e.preferredPayloadType!==void 0&&(i=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const l=[];Object.keys(e.parameters).forEach(c=>{e.parameters[c]!==void 0?l.push(c+"="+e.parameters[c]):l.push(c)}),n+="a=fmtp:"+i+" "+l.join(";")+`\r
`}return n},t.parseRtcpFb=function(e){const n=e.substring(e.indexOf(" ")+1).split(" ");return{type:n.shift(),parameter:n.join(" ")}},t.writeRtcpFb=function(e){let n="",i=e.payloadType;return e.preferredPayloadType!==void 0&&(i=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(l=>{n+="a=rtcp-fb:"+i+" "+l.type+(l.parameter&&l.parameter.length?" "+l.parameter:"")+`\r
`}),n},t.parseSsrcMedia=function(e){const n=e.indexOf(" "),i={ssrc:parseInt(e.substring(7,n),10)},l=e.indexOf(":",n);return l>-1?(i.attribute=e.substring(n+1,l),i.value=e.substring(l+1)):i.attribute=e.substring(n+1),i},t.parseSsrcGroup=function(e){const n=e.substring(13).split(" ");return{semantics:n.shift(),ssrcs:n.map(i=>parseInt(i,10))}},t.getMid=function(e){const n=t.matchPrefix(e,"a=mid:")[0];if(n)return n.substring(6)},t.parseFingerprint=function(e){const n=e.substring(14).split(" ");return{algorithm:n[0].toLowerCase(),value:n[1].toUpperCase()}},t.getDtlsParameters=function(e,n){return{role:"auto",fingerprints:t.matchPrefix(e+n,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,n){let i="a=setup:"+n+`\r
`;return e.fingerprints.forEach(l=>{i+="a=fingerprint:"+l.algorithm+" "+l.value+`\r
`}),i},t.parseCryptoLine=function(e){const n=e.substring(9).split(" ");return{tag:parseInt(n[0],10),cryptoSuite:n[1],keyParams:n[2],sessionParams:n.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+(typeof e.keyParams=="object"?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+`\r
`},t.parseCryptoKeyParams=function(e){if(e.indexOf("inline:")!==0)return null;const n=e.substring(7).split("|");return{keyMethod:"inline",keySalt:n[0],lifeTime:n[1],mkiValue:n[2]?n[2].split(":")[0]:void 0,mkiLength:n[2]?n[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,n){return t.matchPrefix(e+n,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,n){const i=t.matchPrefix(e+n,"a=ice-ufrag:")[0],l=t.matchPrefix(e+n,"a=ice-pwd:")[0];return i&&l?{usernameFragment:i.substring(12),password:l.substring(10)}:null},t.writeIceParameters=function(e){let n="a=ice-ufrag:"+e.usernameFragment+`\r
a=ice-pwd:`+e.password+`\r
`;return e.iceLite&&(n+=`a=ice-lite\r
`),n},t.parseRtpParameters=function(e){const n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},l=t.splitLines(e)[0].split(" ");n.profile=l[2];for(let h=3;h<l.length;h++){const d=l[h],g=t.matchPrefix(e,"a=rtpmap:"+d+" ")[0];if(g){const p=t.parseRtpMap(g),a=t.matchPrefix(e,"a=fmtp:"+d+" ");switch(p.parameters=a.length?t.parseFmtp(a[0]):{},p.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+d+" ").map(t.parseRtcpFb),n.codecs.push(p),p.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(p.name.toUpperCase());break}}}t.matchPrefix(e,"a=extmap:").forEach(h=>{n.headerExtensions.push(t.parseExtmap(h))});const c=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return n.codecs.forEach(h=>{c.forEach(d=>{h.rtcpFeedback.find(p=>p.type===d.type&&p.parameter===d.parameter)||h.rtcpFeedback.push(d)})}),n},t.writeRtpDescription=function(e,n){let i="";i+="m="+e+" ",i+=n.codecs.length>0?"9":"0",i+=" "+(n.profile||"UDP/TLS/RTP/SAVPF")+" ",i+=n.codecs.map(c=>c.preferredPayloadType!==void 0?c.preferredPayloadType:c.payloadType).join(" ")+`\r
`,i+=`c=IN IP4 0.0.0.0\r
`,i+=`a=rtcp:9 IN IP4 0.0.0.0\r
`,n.codecs.forEach(c=>{i+=t.writeRtpMap(c),i+=t.writeFmtp(c),i+=t.writeRtcpFb(c)});let l=0;return n.codecs.forEach(c=>{c.maxptime>l&&(l=c.maxptime)}),l>0&&(i+="a=maxptime:"+l+`\r
`),n.headerExtensions&&n.headerExtensions.forEach(c=>{i+=t.writeExtmap(c)}),i},t.parseRtpEncodingParameters=function(e){const n=[],i=t.parseRtpParameters(e),l=i.fecMechanisms.indexOf("RED")!==-1,c=i.fecMechanisms.indexOf("ULPFEC")!==-1,h=t.matchPrefix(e,"a=ssrc:").map(u=>t.parseSsrcMedia(u)).filter(u=>u.attribute==="cname"),d=h.length>0&&h[0].ssrc;let g;const p=t.matchPrefix(e,"a=ssrc-group:FID").map(u=>u.substring(17).split(" ").map(y=>parseInt(y,10)));p.length>0&&p[0].length>1&&p[0][0]===d&&(g=p[0][1]),i.codecs.forEach(u=>{if(u.name.toUpperCase()==="RTX"&&u.parameters.apt){let f={ssrc:d,codecPayloadType:parseInt(u.parameters.apt,10)};d&&g&&(f.rtx={ssrc:g}),n.push(f),l&&(f=JSON.parse(JSON.stringify(f)),f.fec={ssrc:d,mechanism:c?"red+ulpfec":"red"},n.push(f))}}),n.length===0&&d&&n.push({ssrc:d});let a=t.matchPrefix(e,"b=");return a.length&&(a[0].indexOf("b=TIAS:")===0?a=parseInt(a[0].substring(7),10):a[0].indexOf("b=AS:")===0?a=parseInt(a[0].substring(5),10)*1e3*.95-50*40*8:a=void 0,n.forEach(u=>{u.maxBitrate=a})),n},t.parseRtcpParameters=function(e){const n={},i=t.matchPrefix(e,"a=ssrc:").map(h=>t.parseSsrcMedia(h)).filter(h=>h.attribute==="cname")[0];i&&(n.cname=i.value,n.ssrc=i.ssrc);const l=t.matchPrefix(e,"a=rtcp-rsize");n.reducedSize=l.length>0,n.compound=l.length===0;const c=t.matchPrefix(e,"a=rtcp-mux");return n.mux=c.length>0,n},t.writeRtcpParameters=function(e){let n="";return e.reducedSize&&(n+=`a=rtcp-rsize\r
`),e.mux&&(n+=`a=rtcp-mux\r
`),e.ssrc!==void 0&&e.cname&&(n+="a=ssrc:"+e.ssrc+" cname:"+e.cname+`\r
`),n},t.parseMsid=function(e){let n;const i=t.matchPrefix(e,"a=msid:");if(i.length===1)return n=i[0].substring(7).split(" "),{stream:n[0],track:n[1]};const l=t.matchPrefix(e,"a=ssrc:").map(c=>t.parseSsrcMedia(c)).filter(c=>c.attribute==="msid");if(l.length>0)return n=l[0].value.split(" "),{stream:n[0],track:n[1]}},t.parseSctpDescription=function(e){const n=t.parseMLine(e),i=t.matchPrefix(e,"a=max-message-size:");let l;i.length>0&&(l=parseInt(i[0].substring(19),10)),isNaN(l)&&(l=65536);const c=t.matchPrefix(e,"a=sctp-port:");if(c.length>0)return{port:parseInt(c[0].substring(12),10),protocol:n.fmt,maxMessageSize:l};const h=t.matchPrefix(e,"a=sctpmap:");if(h.length>0){const d=h[0].substring(10).split(" ");return{port:parseInt(d[0],10),protocol:d[1],maxMessageSize:l}}},t.writeSctpDescription=function(e,n){let i=[];return e.protocol!=="DTLS/SCTP"?i=["m="+e.kind+" 9 "+e.protocol+" "+n.protocol+`\r
`,`c=IN IP4 0.0.0.0\r
`,"a=sctp-port:"+n.port+`\r
`]:i=["m="+e.kind+" 9 "+e.protocol+" "+n.port+`\r
`,`c=IN IP4 0.0.0.0\r
`,"a=sctpmap:"+n.port+" "+n.protocol+` 65535\r
`],n.maxMessageSize!==void 0&&i.push("a=max-message-size:"+n.maxMessageSize+`\r
`),i.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,n,i){let l;const c=n!==void 0?n:2;return e?l=e:l=t.generateSessionId(),`v=0\r
o=`+(i||"thisisadapterortc")+" "+l+" "+c+` IN IP4 127.0.0.1\r
s=-\r
t=0 0\r
`},t.getDirection=function(e,n){const i=t.splitLines(e);for(let l=0;l<i.length;l++)switch(i[l]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[l].substring(2)}return n?t.getDirection(n):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return e.split(" ",2)[1]==="0"},t.parseMLine=function(e){const i=t.splitLines(e)[0].substring(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},t.parseOLine=function(e){const i=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:i[0],sessionId:i[1],sessionVersion:parseInt(i[2],10),netType:i[3],addressType:i[4],address:i[5]}},t.isValidSDP=function(e){if(typeof e!="string"||e.length===0)return!1;const n=t.splitLines(e);for(let i=0;i<n.length;i++)if(n[i].length<2||n[i].charAt(1)!=="=")return!1;return!0},r.exports=t})(Xd);var Zd=Xd.exports;const ro=v1(Zd),A1=m1({__proto__:null,default:ro},[Zd]);function _s(r){if(!r.RTCIceCandidate||r.RTCIceCandidate&&"foundation"in r.RTCIceCandidate.prototype)return;const t=r.RTCIceCandidate;r.RTCIceCandidate=function(n){if(typeof n=="object"&&n.candidate&&n.candidate.indexOf("a=")===0&&(n=JSON.parse(JSON.stringify(n)),n.candidate=n.candidate.substring(2)),n.candidate&&n.candidate.length){const i=new t(n),l=ro.parseCandidate(n.candidate);for(const c in l)c in i||Object.defineProperty(i,c,{value:l[c]});return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new t(n)},r.RTCIceCandidate.prototype=t.prototype,bi(r,"icecandidate",e=>(e.candidate&&Object.defineProperty(e,"candidate",{value:new r.RTCIceCandidate(e.candidate),writable:"false"}),e))}function Su(r){!r.RTCIceCandidate||r.RTCIceCandidate&&"relayProtocol"in r.RTCIceCandidate.prototype||bi(r,"icecandidate",t=>{if(t.candidate){const e=ro.parseCandidate(t.candidate.candidate);e.type==="relay"&&(t.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[e.priority>>24])}return t})}function bs(r,t){if(!r.RTCPeerConnection)return;"sctp"in r.RTCPeerConnection.prototype||Object.defineProperty(r.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp=="undefined"?null:this._sctp}});const e=function(h){if(!h||!h.sdp)return!1;const d=ro.splitSections(h.sdp);return d.shift(),d.some(g=>{const p=ro.parseMLine(g);return p&&p.kind==="application"&&p.protocol.indexOf("SCTP")!==-1})},n=function(h){const d=h.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(d===null||d.length<2)return-1;const g=parseInt(d[1],10);return g!==g?-1:g},i=function(h){let d=65536;return t.browser==="firefox"&&(t.version<57?h===-1?d=16384:d=2147483637:t.version<60?d=t.version===57?65535:65536:d=2147483637),d},l=function(h,d){let g=65536;t.browser==="firefox"&&t.version===57&&(g=65535);const p=ro.matchPrefix(h.sdp,"a=max-message-size:");return p.length>0?g=parseInt(p[0].substring(19),10):t.browser==="firefox"&&d!==-1&&(g=2147483637),g},c=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,t.browser==="chrome"&&t.version>=76){const{sdpSemantics:d}=this.getConfiguration();d==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp=="undefined"?null:this._sctp},enumerable:!0,configurable:!0})}if(e(arguments[0])){const d=n(arguments[0]),g=i(d),p=l(arguments[0],d);let a;g===0&&p===0?a=Number.POSITIVE_INFINITY:g===0||p===0?a=Math.max(g,p):a=Math.min(g,p);const u={};Object.defineProperty(u,"maxMessageSize",{get(){return a}}),this._sctp=u}return c.apply(this,arguments)}}function ws(r){if(!(r.RTCPeerConnection&&"createDataChannel"in r.RTCPeerConnection.prototype))return;function t(n,i){const l=n.send;n.send=function(){const h=arguments[0],d=h.length||h.size||h.byteLength;if(n.readyState==="open"&&i.sctp&&d>i.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+i.sctp.maxMessageSize+" bytes)");return l.apply(n,arguments)}}const e=r.RTCPeerConnection.prototype.createDataChannel;r.RTCPeerConnection.prototype.createDataChannel=function(){const i=e.apply(this,arguments);return t(i,this),i},bi(r,"datachannel",n=>(t(n.channel,n.target),n))}function Ou(r){if(!r.RTCPeerConnection||"connectionState"in r.RTCPeerConnection.prototype)return;const t=r.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=i=>{const l=i.target;if(l._lastConnectionState!==l.connectionState){l._lastConnectionState=l.connectionState;const c=new Event("connectionstatechange",i);l.dispatchEvent(c)}return i},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}function Eu(r,t){if(!r.RTCPeerConnection||t.browser==="chrome"&&t.version>=71||t.browser==="safari"&&t._safariVersion>=13.1)return;const e=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(i){if(i&&i.sdp&&i.sdp.indexOf(`
a=extmap-allow-mixed`)!==-1){const l=i.sdp.split(`
`).filter(c=>c.trim()!=="a=extmap-allow-mixed").join(`
`);r.RTCSessionDescription&&i instanceof r.RTCSessionDescription?arguments[0]=new r.RTCSessionDescription({type:i.type,sdp:l}):i.sdp=l}return e.apply(this,arguments)}}function xs(r,t){if(!(r.RTCPeerConnection&&r.RTCPeerConnection.prototype))return;const e=r.RTCPeerConnection.prototype.addIceCandidate;!e||e.length===0||(r.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(t.browser==="chrome"&&t.version<78||t.browser==="firefox"&&t.version<68||t.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():e.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Ts(r,t){if(!(r.RTCPeerConnection&&r.RTCPeerConnection.prototype))return;const e=r.RTCPeerConnection.prototype.setLocalDescription;!e||e.length===0||(r.RTCPeerConnection.prototype.setLocalDescription=function(){let i=arguments[0]||{};if(typeof i!="object"||i.type&&i.sdp)return e.apply(this,arguments);if(i={type:i.type,sdp:i.sdp},!i.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":i.type="offer";break;default:i.type="answer";break}return i.sdp||i.type!=="offer"&&i.type!=="answer"?e.apply(this,[i]):(i.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(c=>e.apply(this,[c]))})}const C1=Object.freeze(Object.defineProperty({__proto__:null,removeExtmapAllowMixed:Eu,shimAddIceCandidateNullOrEmpty:xs,shimConnectionState:Ou,shimMaxMessageSize:bs,shimParameterlessSetLocalDescription:Ts,shimRTCIceCandidate:_s,shimRTCIceCandidateRelayProtocol:Su,shimSendThrowTypeError:ws},Symbol.toStringTag,{value:"Module"}));function k1({window:r}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const e=wd,n=O1(r),i={browserDetails:n,commonShim:C1,extractVersion:na,disableLog:T1,disableWarnings:S1,sdp:A1};switch(n.browser){case"chrome":if(!Oh||!xu||!t.shimChrome)return e("Chrome shim is not included in this adapter release."),i;if(n.version===null)return e("Chrome shim can not determine version, not shimming."),i;e("adapter.js shimming chrome."),i.browserShim=Oh,xs(r,n),Ts(r),Td(r,n),Sd(r),xu(r,n),Od(r),kd(r,n),Ed(r),Ad(r),Pd(r,n),_s(r),Su(r),Ou(r),bs(r,n),ws(r),Eu(r,n);break;case"firefox":if(!Eh||!Tu||!t.shimFirefox)return e("Firefox shim is not included in this adapter release."),i;e("adapter.js shimming firefox."),i.browserShim=Eh,xs(r,n),Ts(r),Rd(r,n),Tu(r,n),Md(r),Id(r),Dd(r),Ld(r),Nd(r),Bd(r),Fd(r),qd(r),jd(r),_s(r),Ou(r),bs(r,n),ws(r);break;case"safari":if(!Ah||!t.shimSafari)return e("Safari shim is not included in this adapter release."),i;e("adapter.js shimming safari."),i.browserShim=Ah,xs(r,n),Ts(r),Gd(r),Vd(r),Hd(r),$d(r),Ud(r),Yd(r),Wd(r),Kd(r),_s(r),Su(r),bs(r,n),ws(r),Eu(r,n);break;default:e("Unsupported browser!");break}return i}const Ch=k1({window:typeof window=="undefined"?void 0:window});function wi(r,t,e,n){Object.defineProperty(r,t,{get:e,set:n,enumerable:!0,configurable:!0})}class Qd{constructor(){this.chunkedMTU=16300,this._dataCount=1,this.chunk=t=>{const e=[],n=t.byteLength,i=Math.ceil(n/this.chunkedMTU);let l=0,c=0;for(;c<n;){const h=Math.min(n,c+this.chunkedMTU),d=t.slice(c,h),g={__peerData:this._dataCount,n:l,data:d,total:i};e.push(g),c=h,l++}return this._dataCount++,e}}}function P1(r){let t=0;for(const i of r)t+=i.byteLength;const e=new Uint8Array(t);let n=0;for(const i of r)e.set(i,n),n+=i.byteLength;return e}const su=Ch.default||Ch,Zo=new class{isWebRTCSupported(){return typeof RTCPeerConnection!="undefined"}isBrowserSupported(){const r=this.getBrowser(),t=this.getVersion();return this.supportedBrowsers.includes(r)?r==="chrome"?t>=this.minChromeVersion:r==="firefox"?t>=this.minFirefoxVersion:r==="safari"?!this.isIOS&&t>=this.minSafariVersion:!1:!1}getBrowser(){return su.browserDetails.browser}getVersion(){return su.browserDetails.version||0}isUnifiedPlanSupported(){const r=this.getBrowser(),t=su.browserDetails.version||0;if(r==="chrome"&&t<this.minChromeVersion)return!1;if(r==="firefox"&&t>=this.minFirefoxVersion)return!0;if(!window.RTCRtpTransceiver||!("currentDirection"in RTCRtpTransceiver.prototype))return!1;let e,n=!1;try{e=new RTCPeerConnection,e.addTransceiver("audio"),n=!0}catch(i){}finally{e&&e.close()}return n}toString(){return`Supports:
browser:${this.getBrowser()}
version:${this.getVersion()}
isIOS:${this.isIOS}
isWebRTCSupported:${this.isWebRTCSupported()}
isBrowserSupported:${this.isBrowserSupported()}
isUnifiedPlanSupported:${this.isUnifiedPlanSupported()}`}constructor(){this.isIOS=typeof navigator!="undefined"?["iPad","iPhone","iPod"].includes(navigator.platform):!1,this.supportedBrowsers=["firefox","chrome","safari"],this.minFirefoxVersion=59,this.minChromeVersion=72,this.minSafariVersion=605}},R1=r=>!r||/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.test(r),Jd=()=>Math.random().toString(36).slice(2),kh={iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:["turn:eu-0.turn.peerjs.com:3478","turn:us-0.turn.peerjs.com:3478"],username:"peerjs",credential:"peerjsp"}],sdpSemantics:"unified-plan"};class M1 extends Qd{noop(){}blobToArrayBuffer(t,e){const n=new FileReader;return n.onload=function(i){i.target&&e(i.target.result)},n.readAsArrayBuffer(t),n}binaryStringToArrayBuffer(t){const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n)&255;return e.buffer}isSecure(){return location.protocol==="https:"}constructor(...t){super(...t),this.CLOUD_HOST="0.peerjs.com",this.CLOUD_PORT=443,this.chunkedBrowsers={Chrome:1,chrome:1},this.defaultConfig=kh,this.browser=Zo.getBrowser(),this.browserVersion=Zo.getVersion(),this.pack=yd,this.unpack=vd,this.supports=function(){const e={browser:Zo.isBrowserSupported(),webRTC:Zo.isWebRTCSupported(),audioVideo:!1,data:!1,binaryBlob:!1,reliable:!1};if(!e.webRTC)return e;let n;try{n=new RTCPeerConnection(kh),e.audioVideo=!0;let i;try{i=n.createDataChannel("_PEERJSTEST",{ordered:!0}),e.data=!0,e.reliable=!!i.ordered;try{i.binaryType="blob",e.binaryBlob=!Zo.isIOS}catch(l){}}catch(l){}finally{i&&i.close()}}catch(i){}finally{n&&n.close()}return e}(),this.validateId=R1,this.randomToken=Jd}}const pn=new M1,D1="PeerJS: ";class L1{get logLevel(){return this._logLevel}set logLevel(t){this._logLevel=t}log(...t){this._logLevel>=3&&this._print(3,...t)}warn(...t){this._logLevel>=2&&this._print(2,...t)}error(...t){this._logLevel>=1&&this._print(1,...t)}setLogFunction(t){this._print=t}_print(t,...e){const n=[D1,...e];for(const i in n)n[i]instanceof Error&&(n[i]="("+n[i].name+") "+n[i].message);t>=3?console.log(...n):t>=2?console.warn("WARNING",...n):t>=1&&console.error("ERROR",...n)}constructor(){this._logLevel=0}}var Ce=new L1,Zu={},I1=Object.prototype.hasOwnProperty,ln="~";function ua(){}Object.create&&(ua.prototype=Object.create(null),new ua().__proto__||(ln=!1));function N1(r,t,e){this.fn=r,this.context=t,this.once=e||!1}function ep(r,t,e,n,i){if(typeof e!="function")throw new TypeError("The listener must be a function");var l=new N1(e,n||r,i),c=ln?ln+t:t;return r._events[c]?r._events[c].fn?r._events[c]=[r._events[c],l]:r._events[c].push(l):(r._events[c]=l,r._eventsCount++),r}function Ss(r,t){--r._eventsCount===0?r._events=new ua:delete r._events[t]}function tn(){this._events=new ua,this._eventsCount=0}tn.prototype.eventNames=function(){var t=[],e,n;if(this._eventsCount===0)return t;for(n in e=this._events)I1.call(e,n)&&t.push(ln?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};tn.prototype.listeners=function(t){var e=ln?ln+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,l=n.length,c=new Array(l);i<l;i++)c[i]=n[i].fn;return c};tn.prototype.listenerCount=function(t){var e=ln?ln+t:t,n=this._events[e];return n?n.fn?1:n.length:0};tn.prototype.emit=function(t,e,n,i,l,c){var h=ln?ln+t:t;if(!this._events[h])return!1;var d=this._events[h],g=arguments.length,p,a;if(d.fn){switch(d.once&&this.removeListener(t,d.fn,void 0,!0),g){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,e),!0;case 3:return d.fn.call(d.context,e,n),!0;case 4:return d.fn.call(d.context,e,n,i),!0;case 5:return d.fn.call(d.context,e,n,i,l),!0;case 6:return d.fn.call(d.context,e,n,i,l,c),!0}for(a=1,p=new Array(g-1);a<g;a++)p[a-1]=arguments[a];d.fn.apply(d.context,p)}else{var u=d.length,f;for(a=0;a<u;a++)switch(d[a].once&&this.removeListener(t,d[a].fn,void 0,!0),g){case 1:d[a].fn.call(d[a].context);break;case 2:d[a].fn.call(d[a].context,e);break;case 3:d[a].fn.call(d[a].context,e,n);break;case 4:d[a].fn.call(d[a].context,e,n,i);break;default:if(!p)for(f=1,p=new Array(g-1);f<g;f++)p[f-1]=arguments[f];d[a].fn.apply(d[a].context,p)}}return!0};tn.prototype.on=function(t,e,n){return ep(this,t,e,n,!1)};tn.prototype.once=function(t,e,n){return ep(this,t,e,n,!0)};tn.prototype.removeListener=function(t,e,n,i){var l=ln?ln+t:t;if(!this._events[l])return this;if(!e)return Ss(this,l),this;var c=this._events[l];if(c.fn)c.fn===e&&(!i||c.once)&&(!n||c.context===n)&&Ss(this,l);else{for(var h=0,d=[],g=c.length;h<g;h++)(c[h].fn!==e||i&&!c[h].once||n&&c[h].context!==n)&&d.push(c[h]);d.length?this._events[l]=d.length===1?d[0]:d:Ss(this,l)}return this};tn.prototype.removeAllListeners=function(t){var e;return t?(e=ln?ln+t:t,this._events[e]&&Ss(this,e)):(this._events=new ua,this._eventsCount=0),this};tn.prototype.off=tn.prototype.removeListener;tn.prototype.addListener=tn.prototype.on;tn.prefixed=ln;tn.EventEmitter=tn;Zu=tn;var xi={};wi(xi,"ConnectionType",()=>jr);wi(xi,"PeerErrorType",()=>It);wi(xi,"BaseConnectionErrorType",()=>Au);wi(xi,"DataConnectionErrorType",()=>Qu);wi(xi,"SerializationType",()=>$s);wi(xi,"SocketEventType",()=>Br);wi(xi,"ServerMessageType",()=>en);var jr=function(r){return r.Data="data",r.Media="media",r}({}),It=function(r){return r.BrowserIncompatible="browser-incompatible",r.Disconnected="disconnected",r.InvalidID="invalid-id",r.InvalidKey="invalid-key",r.Network="network",r.PeerUnavailable="peer-unavailable",r.SslUnavailable="ssl-unavailable",r.ServerError="server-error",r.SocketError="socket-error",r.SocketClosed="socket-closed",r.UnavailableID="unavailable-id",r.WebRTC="webrtc",r}({}),Au=function(r){return r.NegotiationFailed="negotiation-failed",r.ConnectionClosed="connection-closed",r}({}),Qu=function(r){return r.NotOpenYet="not-open-yet",r.MessageToBig="message-too-big",r}({}),$s=function(r){return r.Binary="binary",r.BinaryUTF8="binary-utf8",r.JSON="json",r.None="raw",r}({}),Br=function(r){return r.Message="message",r.Disconnected="disconnected",r.Error="error",r.Close="close",r}({}),en=function(r){return r.Heartbeat="HEARTBEAT",r.Candidate="CANDIDATE",r.Offer="OFFER",r.Answer="ANSWER",r.Open="OPEN",r.Error="ERROR",r.IdTaken="ID-TAKEN",r.InvalidKey="INVALID-KEY",r.Leave="LEAVE",r.Expire="EXPIRE",r}({});const tp="1.5.5";class B1 extends Zu.EventEmitter{constructor(t,e,n,i,l,c=5e3){super(),this.pingInterval=c,this._disconnected=!0,this._messagesQueue=[];const h=t?"wss://":"ws://";this._baseUrl=h+e+":"+n+i+"peerjs?key="+l}start(t,e){this._id=t;const n=`${this._baseUrl}&id=${t}&token=${e}`;this._socket||!this._disconnected||(this._socket=new WebSocket(n+"&version="+tp),this._disconnected=!1,this._socket.onmessage=i=>{let l;try{l=JSON.parse(i.data),Ce.log("Server message received:",l)}catch(c){Ce.log("Invalid server message",i.data);return}this.emit(Br.Message,l)},this._socket.onclose=i=>{this._disconnected||(Ce.log("Socket closed.",i),this._cleanup(),this._disconnected=!0,this.emit(Br.Disconnected))},this._socket.onopen=()=>{this._disconnected||(this._sendQueuedMessages(),Ce.log("Socket open"),this._scheduleHeartbeat())})}_scheduleHeartbeat(){this._wsPingTimer=setTimeout(()=>{this._sendHeartbeat()},this.pingInterval)}_sendHeartbeat(){if(!this._wsOpen()){Ce.log("Cannot send heartbeat, because socket closed");return}const t=JSON.stringify({type:en.Heartbeat});this._socket.send(t),this._scheduleHeartbeat()}_wsOpen(){return!!this._socket&&this._socket.readyState===1}_sendQueuedMessages(){const t=[...this._messagesQueue];this._messagesQueue=[];for(const e of t)this.send(e)}send(t){if(this._disconnected)return;if(!this._id){this._messagesQueue.push(t);return}if(!t.type){this.emit(Br.Error,"Invalid message");return}if(!this._wsOpen())return;const e=JSON.stringify(t);this._socket.send(e)}close(){this._disconnected||(this._cleanup(),this._disconnected=!0)}_cleanup(){this._socket&&(this._socket.onopen=this._socket.onmessage=this._socket.onclose=null,this._socket.close(),this._socket=void 0),clearTimeout(this._wsPingTimer)}}class np{constructor(t){this.connection=t}startConnection(t){const e=this._startPeerConnection();if(this.connection.peerConnection=e,this.connection.type===jr.Media&&t._stream&&this._addTracksToConnection(t._stream,e),t.originator){const n=this.connection,i={ordered:!!t.reliable},l=e.createDataChannel(n.label,i);n._initializeDataChannel(l),this._makeOffer()}else this.handleSDP("OFFER",t.sdp)}_startPeerConnection(){Ce.log("Creating RTCPeerConnection.");const t=new RTCPeerConnection(this.connection.provider.options.config);return this._setupListeners(t),t}_setupListeners(t){const e=this.connection.peer,n=this.connection.connectionId,i=this.connection.type,l=this.connection.provider;Ce.log("Listening for ICE candidates."),t.onicecandidate=c=>{!c.candidate||!c.candidate.candidate||(Ce.log(`Received ICE candidates for ${e}:`,c.candidate),l.socket.send({type:en.Candidate,payload:{candidate:c.candidate,type:i,connectionId:n},dst:e}))},t.oniceconnectionstatechange=()=>{switch(t.iceConnectionState){case"failed":Ce.log("iceConnectionState is failed, closing connections to "+e),this.connection.emitError(Au.NegotiationFailed,"Negotiation of connection to "+e+" failed."),this.connection.close();break;case"closed":Ce.log("iceConnectionState is closed, closing connections to "+e),this.connection.emitError(Au.ConnectionClosed,"Connection to "+e+" closed."),this.connection.close();break;case"disconnected":Ce.log("iceConnectionState changed to disconnected on the connection with "+e);break;case"completed":t.onicecandidate=()=>{};break}this.connection.emit("iceStateChanged",t.iceConnectionState)},Ce.log("Listening for data channel"),t.ondatachannel=c=>{Ce.log("Received data channel");const h=c.channel;l.getConnection(e,n)._initializeDataChannel(h)},Ce.log("Listening for remote stream"),t.ontrack=c=>{Ce.log("Received remote stream");const h=c.streams[0],d=l.getConnection(e,n);if(d.type===jr.Media){const g=d;this._addStreamToMediaConnection(h,g)}}}cleanup(){Ce.log("Cleaning up PeerConnection to "+this.connection.peer);const t=this.connection.peerConnection;if(!t)return;this.connection.peerConnection=null,t.onicecandidate=t.oniceconnectionstatechange=t.ondatachannel=t.ontrack=()=>{};const e=t.signalingState!=="closed";let n=!1;const i=this.connection.dataChannel;i&&(n=!!i.readyState&&i.readyState!=="closed"),(e||n)&&t.close()}_makeOffer(){return tt(this,null,function*(){const t=this.connection.peerConnection,e=this.connection.provider;try{const n=yield t.createOffer(this.connection.options.constraints);Ce.log("Created offer."),this.connection.options.sdpTransform&&typeof this.connection.options.sdpTransform=="function"&&(n.sdp=this.connection.options.sdpTransform(n.sdp)||n.sdp);try{yield t.setLocalDescription(n),Ce.log("Set localDescription:",n,`for:${this.connection.peer}`);let i={sdp:n,type:this.connection.type,connectionId:this.connection.connectionId,metadata:this.connection.metadata};if(this.connection.type===jr.Data){const l=this.connection;i=Ut(st({},i),{label:l.label,reliable:l.reliable,serialization:l.serialization})}e.socket.send({type:en.Offer,payload:i,dst:this.connection.peer})}catch(i){i!="OperationError: Failed to set local offer sdp: Called in wrong state: kHaveRemoteOffer"&&(e.emitError(It.WebRTC,i),Ce.log("Failed to setLocalDescription, ",i))}}catch(n){e.emitError(It.WebRTC,n),Ce.log("Failed to createOffer, ",n)}})}_makeAnswer(){return tt(this,null,function*(){const t=this.connection.peerConnection,e=this.connection.provider;try{const n=yield t.createAnswer();Ce.log("Created answer."),this.connection.options.sdpTransform&&typeof this.connection.options.sdpTransform=="function"&&(n.sdp=this.connection.options.sdpTransform(n.sdp)||n.sdp);try{yield t.setLocalDescription(n),Ce.log("Set localDescription:",n,`for:${this.connection.peer}`),e.socket.send({type:en.Answer,payload:{sdp:n,type:this.connection.type,connectionId:this.connection.connectionId},dst:this.connection.peer})}catch(i){e.emitError(It.WebRTC,i),Ce.log("Failed to setLocalDescription, ",i)}}catch(n){e.emitError(It.WebRTC,n),Ce.log("Failed to create answer, ",n)}})}handleSDP(t,e){return tt(this,null,function*(){e=new RTCSessionDescription(e);const n=this.connection.peerConnection,i=this.connection.provider;Ce.log("Setting remote description",e);const l=this;try{yield n.setRemoteDescription(e),Ce.log(`Set remoteDescription:${t} for:${this.connection.peer}`),t==="OFFER"&&(yield l._makeAnswer())}catch(c){i.emitError(It.WebRTC,c),Ce.log("Failed to setRemoteDescription, ",c)}})}handleCandidate(t){return tt(this,null,function*(){Ce.log("handleCandidate:",t);try{yield this.connection.peerConnection.addIceCandidate(t),Ce.log(`Added ICE candidate for:${this.connection.peer}`)}catch(e){this.connection.provider.emitError(It.WebRTC,e),Ce.log("Failed to handleCandidate, ",e)}})}_addTracksToConnection(t,e){if(Ce.log(`add tracks from stream ${t.id} to peer connection`),!e.addTrack)return Ce.error("Your browser does't support RTCPeerConnection#addTrack. Ignored.");t.getTracks().forEach(n=>{e.addTrack(n,t)})}_addStreamToMediaConnection(t,e){Ce.log(`add stream ${t.id} to media connection ${e.connectionId}`),e.addStream(t)}}class rp extends Zu.EventEmitter{emitError(t,e){Ce.error("Error:",e),this.emit("error",new F1(`${t}`,e))}}class F1 extends Error{constructor(t,e){typeof e=="string"?super(e):(super(),Object.assign(this,e)),this.type=t}}class ip extends rp{get open(){return this._open}constructor(t,e,n){super(),this.peer=t,this.provider=e,this.options=n,this._open=!1,this.metadata=n.metadata}}var Gu;const sa=class sa extends ip{get type(){return jr.Media}get localStream(){return this._localStream}get remoteStream(){return this._remoteStream}constructor(t,e,n){super(t,e,n),this._localStream=this.options._stream,this.connectionId=this.options.connectionId||sa.ID_PREFIX+pn.randomToken(),this._negotiator=new np(this),this._localStream&&this._negotiator.startConnection({_stream:this._localStream,originator:!0})}_initializeDataChannel(t){this.dataChannel=t,this.dataChannel.onopen=()=>{Ce.log(`DC#${this.connectionId} dc connection success`),this.emit("willCloseOnRemote")},this.dataChannel.onclose=()=>{Ce.log(`DC#${this.connectionId} dc closed for:`,this.peer),this.close()}}addStream(t){Ce.log("Receiving stream",t),this._remoteStream=t,super.emit("stream",t)}handleMessage(t){const e=t.type,n=t.payload;switch(t.type){case en.Answer:this._negotiator.handleSDP(e,n.sdp),this._open=!0;break;case en.Candidate:this._negotiator.handleCandidate(n.candidate);break;default:Ce.warn(`Unrecognized message type:${e} from peer:${this.peer}`);break}}answer(t,e={}){if(this._localStream){Ce.warn("Local stream already exists on this MediaConnection. Are you answering a call twice?");return}this._localStream=t,e&&e.sdpTransform&&(this.options.sdpTransform=e.sdpTransform),this._negotiator.startConnection(Ut(st({},this.options._payload),{_stream:t}));const n=this.provider._getMessages(this.connectionId);for(const i of n)this.handleMessage(i);this._open=!0}close(){this._negotiator&&(this._negotiator.cleanup(),this._negotiator=null),this._localStream=null,this._remoteStream=null,this.provider&&(this.provider._removeConnection(this),this.provider=null),this.options&&this.options._stream&&(this.options._stream=null),this.open&&(this._open=!1,super.emit("close"))}};Gu=new WeakMap,Xo(sa,Gu,sa.ID_PREFIX="mc_");let As=sa;class q1{constructor(t){this._options=t}_buildRequest(t){const e=this._options.secure?"https":"http",{host:n,port:i,path:l,key:c}=this._options,h=new URL(`${e}://${n}:${i}${l}${c}/${t}`);return h.searchParams.set("ts",`${Date.now()}${Math.random()}`),h.searchParams.set("version",tp),fetch(h.href,{referrerPolicy:this._options.referrerPolicy})}retrieveId(){return tt(this,null,function*(){try{const t=yield this._buildRequest("id");if(t.status!==200)throw new Error(`Error. Status:${t.status}`);return t.text()}catch(t){Ce.error("Error retrieving ID",t);let e="";throw this._options.path==="/"&&this._options.host!==pn.CLOUD_HOST&&(e=" If you passed in a `path` to your self-hosted PeerServer, you'll also need to pass in that same path when creating a new Peer."),new Error("Could not get an ID from the server."+e)}})}listAllPeers(){return tt(this,null,function*(){try{const t=yield this._buildRequest("peers");if(t.status!==200){if(t.status===401){let e="";throw this._options.host===pn.CLOUD_HOST?e="It looks like you're using the cloud server. You can email team@peerjs.com to enable peer listing for your API key.":e="You need to enable `allow_discovery` on your self-hosted PeerServer to use this feature.",new Error("It doesn't look like you have permission to list peers IDs. "+e)}throw new Error(`Error. Status:${t.status}`)}return t.json()}catch(t){throw Ce.error("Error retrieving list peers",t),new Error("Could not get list peers from the server."+t)}})}}var Yu,Vu;const pi=class pi extends ip{get type(){return jr.Data}constructor(t,e,n){super(t,e,n),this.connectionId=this.options.connectionId||pi.ID_PREFIX+Jd(),this.label=this.options.label||this.connectionId,this.reliable=!!this.options.reliable,this._negotiator=new np(this),this._negotiator.startConnection(this.options._payload||{originator:!0,reliable:this.reliable})}_initializeDataChannel(t){this.dataChannel=t,this.dataChannel.onopen=()=>{Ce.log(`DC#${this.connectionId} dc connection success`),this._open=!0,this.emit("open")},this.dataChannel.onmessage=e=>{Ce.log(`DC#${this.connectionId} dc onmessage:`,e.data)},this.dataChannel.onclose=()=>{Ce.log(`DC#${this.connectionId} dc closed for:`,this.peer),this.close()}}close(t){if(t!=null&&t.flush){this.send({__peerData:{type:"close"}});return}this._negotiator&&(this._negotiator.cleanup(),this._negotiator=null),this.provider&&(this.provider._removeConnection(this),this.provider=null),this.dataChannel&&(this.dataChannel.onopen=null,this.dataChannel.onmessage=null,this.dataChannel.onclose=null,this.dataChannel=null),this.open&&(this._open=!1,super.emit("close"))}send(t,e=!1){if(!this.open){this.emitError(Qu.NotOpenYet,"Connection is not open. You should listen for the `open` event before sending messages.");return}return this._send(t,e)}handleMessage(t){return tt(this,null,function*(){const e=t.payload;switch(t.type){case en.Answer:yield this._negotiator.handleSDP(t.type,e.sdp);break;case en.Candidate:yield this._negotiator.handleCandidate(e.candidate);break;default:Ce.warn("Unrecognized message type:",t.type,"from peer:",this.peer);break}})}};Yu=new WeakMap,Vu=new WeakMap,Xo(pi,Yu,pi.ID_PREFIX="dc_"),Xo(pi,Vu,pi.MAX_BUFFERED_AMOUNT=8388608);let Cs=pi;class Ju extends Cs{get bufferSize(){return this._bufferSize}_initializeDataChannel(t){super._initializeDataChannel(t),this.dataChannel.binaryType="arraybuffer",this.dataChannel.addEventListener("message",e=>this._handleDataMessage(e))}_bufferedSend(t){(this._buffering||!this._trySend(t))&&(this._buffer.push(t),this._bufferSize=this._buffer.length)}_trySend(t){if(!this.open)return!1;if(this.dataChannel.bufferedAmount>Cs.MAX_BUFFERED_AMOUNT)return this._buffering=!0,setTimeout(()=>{this._buffering=!1,this._tryBuffer()},50),!1;try{this.dataChannel.send(t)}catch(e){return Ce.error(`DC#:${this.connectionId} Error when sending:`,e),this._buffering=!0,this.close(),!1}return!0}_tryBuffer(){if(!this.open||this._buffer.length===0)return;const t=this._buffer[0];this._trySend(t)&&(this._buffer.shift(),this._bufferSize=this._buffer.length,this._tryBuffer())}close(t){if(t!=null&&t.flush){this.send({__peerData:{type:"close"}});return}this._buffer=[],this._bufferSize=0,super.close()}constructor(...t){super(...t),this._buffer=[],this._bufferSize=0,this._buffering=!1}}class lu extends Ju{close(t){super.close(t),this._chunkedData={}}constructor(t,e,n){super(t,e,n),this.chunker=new Qd,this.serialization=$s.Binary,this._chunkedData={}}_handleDataMessage({data:t}){const e=vd(t),n=e.__peerData;if(n){if(n.type==="close"){this.close();return}this._handleChunk(e);return}this.emit("data",e)}_handleChunk(t){const e=t.__peerData,n=this._chunkedData[e]||{data:[],count:0,total:t.total};if(n.data[t.n]=new Uint8Array(t.data),n.count++,this._chunkedData[e]=n,n.total===n.count){delete this._chunkedData[e];const i=P1(n.data);this._handleDataMessage({data:i})}}_send(t,e){const n=yd(t);if(n instanceof Promise)return this._send_blob(n);if(!e&&n.byteLength>this.chunker.chunkedMTU){this._sendChunks(n);return}this._bufferedSend(n)}_send_blob(t){return tt(this,null,function*(){const e=yield t;if(e.byteLength>this.chunker.chunkedMTU){this._sendChunks(e);return}this._bufferedSend(e)})}_sendChunks(t){const e=this.chunker.chunk(t);Ce.log(`DC#${this.connectionId} Try to send ${e.length} chunks...`);for(const n of e)this.send(n,!0)}}class j1 extends Ju{_handleDataMessage({data:t}){super.emit("data",t)}_send(t,e){this._bufferedSend(t)}constructor(...t){super(...t),this.serialization=$s.None}}class $1 extends Ju{_handleDataMessage({data:t}){const e=this.parse(this.decoder.decode(t)),n=e.__peerData;if(n&&n.type==="close"){this.close();return}this.emit("data",e)}_send(t,e){const n=this.encoder.encode(this.stringify(t));if(n.byteLength>=pn.chunkedMTU){this.emitError(Qu.MessageToBig,"Message too big for JSON channel");return}this._bufferedSend(n)}constructor(...t){super(...t),this.serialization=$s.JSON,this.encoder=new TextEncoder,this.decoder=new TextDecoder,this.stringify=JSON.stringify,this.parse=JSON.parse}}var Ku;const la=class la extends rp{get id(){return this._id}get options(){return this._options}get open(){return this._open}get socket(){return this._socket}get connections(){const t=Object.create(null);for(const[e,n]of this._connections)t[e]=n;return t}get destroyed(){return this._destroyed}get disconnected(){return this._disconnected}constructor(t,e){super(),this._serializers={raw:j1,json:$1,binary:lu,"binary-utf8":lu,default:lu},this._id=null,this._lastServerId=null,this._destroyed=!1,this._disconnected=!1,this._open=!1,this._connections=new Map,this._lostMessages=new Map;let n;if(t&&t.constructor==Object?e=t:t&&(n=t.toString()),e=st({debug:0,host:pn.CLOUD_HOST,port:pn.CLOUD_PORT,path:"/",key:la.DEFAULT_KEY,token:pn.randomToken(),config:pn.defaultConfig,referrerPolicy:"strict-origin-when-cross-origin",serializers:{}},e),this._options=e,this._serializers=st(st({},this._serializers),this.options.serializers),this._options.host==="/"&&(this._options.host=window.location.hostname),this._options.path&&(this._options.path[0]!=="/"&&(this._options.path="/"+this._options.path),this._options.path[this._options.path.length-1]!=="/"&&(this._options.path+="/")),this._options.secure===void 0&&this._options.host!==pn.CLOUD_HOST?this._options.secure=pn.isSecure():this._options.host==pn.CLOUD_HOST&&(this._options.secure=!0),this._options.logFunction&&Ce.setLogFunction(this._options.logFunction),Ce.logLevel=this._options.debug||0,this._api=new q1(e),this._socket=this._createServerConnection(),!pn.supports.audioVideo&&!pn.supports.data){this._delayedAbort(It.BrowserIncompatible,"The current browser does not support WebRTC");return}if(n&&!pn.validateId(n)){this._delayedAbort(It.InvalidID,`ID "${n}" is invalid`);return}n?this._initialize(n):this._api.retrieveId().then(i=>this._initialize(i)).catch(i=>this._abort(It.ServerError,i))}_createServerConnection(){const t=new B1(this._options.secure,this._options.host,this._options.port,this._options.path,this._options.key,this._options.pingInterval);return t.on(Br.Message,e=>{this._handleMessage(e)}),t.on(Br.Error,e=>{this._abort(It.SocketError,e)}),t.on(Br.Disconnected,()=>{this.disconnected||(this.emitError(It.Network,"Lost connection to server."),this.disconnect())}),t.on(Br.Close,()=>{this.disconnected||this._abort(It.SocketClosed,"Underlying socket is already closed.")}),t}_initialize(t){this._id=t,this.socket.start(t,this._options.token)}_handleMessage(t){const e=t.type,n=t.payload,i=t.src;switch(e){case en.Open:this._lastServerId=this.id,this._open=!0,this.emit("open",this.id);break;case en.Error:this._abort(It.ServerError,n.msg);break;case en.IdTaken:this._abort(It.UnavailableID,`ID "${this.id}" is taken`);break;case en.InvalidKey:this._abort(It.InvalidKey,`API KEY "${this._options.key}" is invalid`);break;case en.Leave:Ce.log(`Received leave message from ${i}`),this._cleanupPeer(i),this._connections.delete(i);break;case en.Expire:this.emitError(It.PeerUnavailable,`Could not connect to peer ${i}`);break;case en.Offer:{const l=n.connectionId;let c=this.getConnection(i,l);if(c&&(c.close(),Ce.warn(`Offer received for existing Connection ID:${l}`)),n.type===jr.Media){const d=new As(i,this,{connectionId:l,_payload:n,metadata:n.metadata});c=d,this._addConnection(i,c),this.emit("call",d)}else if(n.type===jr.Data){const d=new this._serializers[n.serialization](i,this,{connectionId:l,_payload:n,metadata:n.metadata,label:n.label,serialization:n.serialization,reliable:n.reliable});c=d,this._addConnection(i,c),this.emit("connection",d)}else{Ce.warn(`Received malformed connection type:${n.type}`);return}const h=this._getMessages(l);for(const d of h)c.handleMessage(d);break}default:{if(!n){Ce.warn(`You received a malformed message from ${i} of type ${e}`);return}const l=n.connectionId,c=this.getConnection(i,l);c&&c.peerConnection?c.handleMessage(t):l?this._storeMessage(l,t):Ce.warn("You received an unrecognized message:",t);break}}}_storeMessage(t,e){this._lostMessages.has(t)||this._lostMessages.set(t,[]),this._lostMessages.get(t).push(e)}_getMessages(t){const e=this._lostMessages.get(t);return e?(this._lostMessages.delete(t),e):[]}connect(t,e={}){if(e=st({serialization:"default"},e),this.disconnected){Ce.warn("You cannot connect to a new Peer because you called .disconnect() on this Peer and ended your connection with the server. You can create a new Peer to reconnect, or call reconnect on this peer if you believe its ID to still be available."),this.emitError(It.Disconnected,"Cannot connect to new Peer after disconnecting from server.");return}const n=new this._serializers[e.serialization](t,this,e);return this._addConnection(t,n),n}call(t,e,n={}){if(this.disconnected){Ce.warn("You cannot connect to a new Peer because you called .disconnect() on this Peer and ended your connection with the server. You can create a new Peer to reconnect."),this.emitError(It.Disconnected,"Cannot connect to new Peer after disconnecting from server.");return}if(!e){Ce.error("To call a peer, you must provide a stream from your browser's `getUserMedia`.");return}const i=new As(t,this,Ut(st({},n),{_stream:e}));return this._addConnection(t,i),i}_addConnection(t,e){Ce.log(`add connection ${e.type}:${e.connectionId} to peerId:${t}`),this._connections.has(t)||this._connections.set(t,[]),this._connections.get(t).push(e)}_removeConnection(t){const e=this._connections.get(t.peer);if(e){const n=e.indexOf(t);n!==-1&&e.splice(n,1)}this._lostMessages.delete(t.connectionId)}getConnection(t,e){const n=this._connections.get(t);if(!n)return null;for(const i of n)if(i.connectionId===e)return i;return null}_delayedAbort(t,e){setTimeout(()=>{this._abort(t,e)},0)}_abort(t,e){Ce.error("Aborting!"),this.emitError(t,e),this._lastServerId?this.disconnect():this.destroy()}destroy(){this.destroyed||(Ce.log(`Destroy peer with ID:${this.id}`),this.disconnect(),this._cleanup(),this._destroyed=!0,this.emit("close"))}_cleanup(){for(const t of this._connections.keys())this._cleanupPeer(t),this._connections.delete(t);this.socket.removeAllListeners()}_cleanupPeer(t){const e=this._connections.get(t);if(e)for(const n of e)n.close()}disconnect(){if(this.disconnected)return;const t=this.id;Ce.log(`Disconnect peer with ID:${t}`),this._disconnected=!0,this._open=!1,this.socket.close(),this._lastServerId=t,this._id=null,this.emit("disconnected",t)}reconnect(){if(this.disconnected&&!this.destroyed)Ce.log(`Attempting reconnection to server with ID ${this._lastServerId}`),this._disconnected=!1,this._initialize(this._lastServerId);else{if(this.destroyed)throw new Error("This peer cannot reconnect to the server. It has already been destroyed.");if(!this.disconnected&&!this.open)Ce.error("In a hurry? We're still trying to make the initial connection!");else throw new Error(`Peer ${this.id} cannot reconnect because it is not disconnected from the server!`)}}listAllPeers(t=e=>{}){this._api.listAllPeers().then(e=>t(e)).catch(e=>this._abort(It.ServerError,e))}};Ku=new WeakMap,Xo(la,Ku,la.DEFAULT_KEY="peerjs");let Cu=la;var uA=Cu,ks={exports:{}};/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/ks.exports;(function(r,t){(function(){var e,n="4.17.21",i=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",h="Invalid `variable` option passed into `_.template`",d="__lodash_hash_undefined__",g=500,p="__lodash_placeholder__",a=1,u=2,f=4,y=1,_=2,b=1,v=2,w=4,T=8,x=16,S=32,C=64,A=128,R=256,L=512,M=30,k="...",P=800,I=16,j=1,W=2,J=3,ee=1/0,oe=9007199254740991,V=17976931348623157e292,$=NaN,N=4294967295,H=N-1,G=N>>>1,ne=[["ary",A],["bind",b],["bindKey",v],["curry",T],["curryRight",x],["flip",L],["partial",S],["partialRight",C],["rearg",R]],X="[object Arguments]",U="[object Array]",Q="[object AsyncFunction]",ie="[object Boolean]",ae="[object Date]",de="[object DOMException]",we="[object Error]",Pe="[object Function]",Me="[object GeneratorFunction]",De="[object Map]",ze="[object Number]",xt="[object Null]",Je="[object Object]",le="[object Promise]",he="[object Proxy]",_e="[object RegExp]",be="[object Set]",ve="[object String]",Be="[object Symbol]",Le="[object Undefined]",Ee="[object WeakMap]",$e="[object WeakSet]",vt="[object ArrayBuffer]",Ve="[object DataView]",nn="[object Float32Array]",z="[object Float64Array]",ue="[object Int8Array]",pe="[object Int16Array]",Te="[object Int32Array]",Ae="[object Uint8Array]",Ie="[object Uint8ClampedArray]",at="[object Uint16Array]",wt="[object Uint32Array]",Ze=/\b__p \+= '';/g,yt=/\b(__p \+=) '' \+/g,Ht=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Kt=/&(?:amp|lt|gt|quot|#39);/g,Wn=/[&<>"']/g,zr=RegExp(Kt.source),ir=RegExp(Wn.source),Gr=/<%-([\s\S]+?)%>/g,Yr=/<%([\s\S]+?)%>/g,br=/<%=([\s\S]+?)%>/g,zn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Si=/^\w*$/,Ln=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Vr=/[\\^$.*+?()[\]{}|]/g,po=RegExp(Vr.source),Kr=/^\s+/,Oi=/\s/,Xr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Nt=/\{\n\/\* \[wrapped with (.+)\] \*/,go=/,? & /,mo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,vo=/[()=,{}\[\]\/\s]/,yo=/\\(\\)?/g,_o=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Bt=/\w*$/,bo=/^[-+]0x[0-9a-f]+$/i,wo=/^0b[01]+$/i,xo=/^\[object .+?Constructor\]$/,To=/^0o[0-7]+$/i,So=/^(?:0|[1-9]\d*)$/,Xt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wr=/($^)/,Oo=/['\n\r\u2028\u2029\\]/g,xr="\\ud800-\\udfff",Eo="\\u0300-\\u036f",Ao="\\ufe20-\\ufe2f",Tr="\\u20d0-\\u20ff",Zr=Eo+Ao+Tr,or="\\u2700-\\u27bf",mn="a-z\\xdf-\\xf6\\xf8-\\xff",Qr="\\xac\\xb1\\xd7\\xf7",Co="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ko="\\u2000-\\u206f",Po=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ei="A-Z\\xc0-\\xd6\\xd8-\\xde",Ai="\\ufe0e\\ufe0f",ar=Qr+Co+ko+Po,sr="[']",lr="["+xr+"]",Jr="["+ar+"]",ur="["+Zr+"]",Ci="\\d+",Ro="["+or+"]",ki="["+mn+"]",Pi="[^"+xr+ar+Ci+or+mn+Ei+"]",cr="\\ud83c[\\udffb-\\udfff]",Mo="(?:"+ur+"|"+cr+")",Ri="[^"+xr+"]",In="(?:\\ud83c[\\udde6-\\uddff]){2}",rn="[\\ud800-\\udbff][\\udc00-\\udfff]",Zt="["+Ei+"]",Tn="\\u200d",Mi="(?:"+ki+"|"+Pi+")",Sn="(?:"+Zt+"|"+Pi+")",Di="(?:"+sr+"(?:d|ll|m|re|s|t|ve))?",Li="(?:"+sr+"(?:D|LL|M|RE|S|T|VE))?",Ii=Mo+"?",Ni="["+Ai+"]?",Bi="(?:"+Tn+"(?:"+[Ri,In,rn].join("|")+")"+Ni+Ii+")*",Wt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fi="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ei=Ni+Ii+Bi,Sr="(?:"+[Ro,In,rn].join("|")+")"+ei,ti="(?:"+[Ri+ur+"?",ur,In,rn,lr].join("|")+")",Or=RegExp(sr,"g"),Do=RegExp(ur,"g"),Er=RegExp(cr+"(?="+cr+")|"+ti+ei,"g"),ni=RegExp([Zt+"?"+ki+"+"+Di+"(?="+[Jr,Zt,"$"].join("|")+")",Sn+"+"+Li+"(?="+[Jr,Zt+Mi,"$"].join("|")+")",Zt+"?"+Mi+"+"+Di,Zt+"+"+Li,Fi,Wt,Ci,Sr].join("|"),"g"),qi=RegExp("["+Tn+xr+Zr+Ai+"]"),On=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ji=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ri=-1,ht={};ht[nn]=ht[z]=ht[ue]=ht[pe]=ht[Te]=ht[Ae]=ht[Ie]=ht[at]=ht[wt]=!0,ht[X]=ht[U]=ht[vt]=ht[ie]=ht[Ve]=ht[ae]=ht[we]=ht[Pe]=ht[De]=ht[ze]=ht[Je]=ht[_e]=ht[be]=ht[ve]=ht[Ee]=!1;var ct={};ct[X]=ct[U]=ct[vt]=ct[Ve]=ct[ie]=ct[ae]=ct[nn]=ct[z]=ct[ue]=ct[pe]=ct[Te]=ct[De]=ct[ze]=ct[Je]=ct[_e]=ct[be]=ct[ve]=ct[Be]=ct[Ae]=ct[Ie]=ct[at]=ct[wt]=!0,ct[we]=ct[Pe]=ct[Ee]=!1;var E={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},F={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},K={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,Re=parseInt,nt=typeof bt=="object"&&bt&&bt.Object===Object&&bt,rt=typeof self=="object"&&self&&self.Object===Object&&self,Xe=nt||rt||Function("return this")(),ot=t&&!t.nodeType&&t,Tt=ot&&!0&&r&&!r.nodeType&&r,zt=Tt&&Tt.exports===ot,Ot=zt&&nt.process,dt=function(){try{var te=Tt&&Tt.require&&Tt.require("util").types;return te||Ot&&Ot.binding&&Ot.binding("util")}catch(fe){}}(),Lt=dt&&dt.isArrayBuffer,Nn=dt&&dt.isDate,En=dt&&dt.isMap,Gn=dt&&dt.isRegExp,Lo=dt&&dt.isSet,ii=dt&&dt.isTypedArray;function jt(te,fe,se){switch(se.length){case 0:return te.call(fe);case 1:return te.call(fe,se[0]);case 2:return te.call(fe,se[0],se[1]);case 3:return te.call(fe,se[0],se[1],se[2])}return te.apply(fe,se)}function Ig(te,fe,se,Oe){for(var He=-1,lt=te==null?0:te.length;++He<lt;){var Ft=te[He];fe(Oe,Ft,se(Ft),te)}return Oe}function An(te,fe){for(var se=-1,Oe=te==null?0:te.length;++se<Oe&&fe(te[se],se,te)!==!1;);return te}function Ng(te,fe){for(var se=te==null?0:te.length;se--&&fe(te[se],se,te)!==!1;);return te}function bc(te,fe){for(var se=-1,Oe=te==null?0:te.length;++se<Oe;)if(!fe(te[se],se,te))return!1;return!0}function Ar(te,fe){for(var se=-1,Oe=te==null?0:te.length,He=0,lt=[];++se<Oe;){var Ft=te[se];fe(Ft,se,te)&&(lt[He++]=Ft)}return lt}function Ea(te,fe){var se=te==null?0:te.length;return!!se&&$i(te,fe,0)>-1}function rl(te,fe,se){for(var Oe=-1,He=te==null?0:te.length;++Oe<He;)if(se(fe,te[Oe]))return!0;return!1}function St(te,fe){for(var se=-1,Oe=te==null?0:te.length,He=Array(Oe);++se<Oe;)He[se]=fe(te[se],se,te);return He}function Cr(te,fe){for(var se=-1,Oe=fe.length,He=te.length;++se<Oe;)te[He+se]=fe[se];return te}function il(te,fe,se,Oe){var He=-1,lt=te==null?0:te.length;for(Oe&&lt&&(se=te[++He]);++He<lt;)se=fe(se,te[He],He,te);return se}function Bg(te,fe,se,Oe){var He=te==null?0:te.length;for(Oe&&He&&(se=te[--He]);He--;)se=fe(se,te[He],He,te);return se}function ol(te,fe){for(var se=-1,Oe=te==null?0:te.length;++se<Oe;)if(fe(te[se],se,te))return!0;return!1}var Fg=al("length");function qg(te){return te.split("")}function jg(te){return te.match(mo)||[]}function wc(te,fe,se){var Oe;return se(te,function(He,lt,Ft){if(fe(He,lt,Ft))return Oe=lt,!1}),Oe}function Aa(te,fe,se,Oe){for(var He=te.length,lt=se+(Oe?1:-1);Oe?lt--:++lt<He;)if(fe(te[lt],lt,te))return lt;return-1}function $i(te,fe,se){return fe===fe?Qg(te,fe,se):Aa(te,xc,se)}function $g(te,fe,se,Oe){for(var He=se-1,lt=te.length;++He<lt;)if(Oe(te[He],fe))return He;return-1}function xc(te){return te!==te}function Tc(te,fe){var se=te==null?0:te.length;return se?ll(te,fe)/se:$}function al(te){return function(fe){return fe==null?e:fe[te]}}function sl(te){return function(fe){return te==null?e:te[fe]}}function Sc(te,fe,se,Oe,He){return He(te,function(lt,Ft,_t){se=Oe?(Oe=!1,lt):fe(se,lt,Ft,_t)}),se}function Ug(te,fe){var se=te.length;for(te.sort(fe);se--;)te[se]=te[se].value;return te}function ll(te,fe){for(var se,Oe=-1,He=te.length;++Oe<He;){var lt=fe(te[Oe]);lt!==e&&(se=se===e?lt:se+lt)}return se}function ul(te,fe){for(var se=-1,Oe=Array(te);++se<te;)Oe[se]=fe(se);return Oe}function Hg(te,fe){return St(fe,function(se){return[se,te[se]]})}function Oc(te){return te&&te.slice(0,kc(te)+1).replace(Kr,"")}function vn(te){return function(fe){return te(fe)}}function cl(te,fe){return St(fe,function(se){return te[se]})}function Io(te,fe){return te.has(fe)}function Ec(te,fe){for(var se=-1,Oe=te.length;++se<Oe&&$i(fe,te[se],0)>-1;);return se}function Ac(te,fe){for(var se=te.length;se--&&$i(fe,te[se],0)>-1;);return se}function Wg(te,fe){for(var se=te.length,Oe=0;se--;)te[se]===fe&&++Oe;return Oe}var zg=sl(E),Gg=sl(F);function Yg(te){return"\\"+ce[te]}function Vg(te,fe){return te==null?e:te[fe]}function Ui(te){return qi.test(te)}function Kg(te){return On.test(te)}function Xg(te){for(var fe,se=[];!(fe=te.next()).done;)se.push(fe.value);return se}function fl(te){var fe=-1,se=Array(te.size);return te.forEach(function(Oe,He){se[++fe]=[He,Oe]}),se}function Cc(te,fe){return function(se){return te(fe(se))}}function kr(te,fe){for(var se=-1,Oe=te.length,He=0,lt=[];++se<Oe;){var Ft=te[se];(Ft===fe||Ft===p)&&(te[se]=p,lt[He++]=se)}return lt}function Ca(te){var fe=-1,se=Array(te.size);return te.forEach(function(Oe){se[++fe]=Oe}),se}function Zg(te){var fe=-1,se=Array(te.size);return te.forEach(function(Oe){se[++fe]=[Oe,Oe]}),se}function Qg(te,fe,se){for(var Oe=se-1,He=te.length;++Oe<He;)if(te[Oe]===fe)return Oe;return-1}function Jg(te,fe,se){for(var Oe=se+1;Oe--;)if(te[Oe]===fe)return Oe;return Oe}function Hi(te){return Ui(te)?tm(te):Fg(te)}function Bn(te){return Ui(te)?nm(te):qg(te)}function kc(te){for(var fe=te.length;fe--&&Oi.test(te.charAt(fe)););return fe}var em=sl(K);function tm(te){for(var fe=Er.lastIndex=0;Er.test(te);)++fe;return fe}function nm(te){return te.match(Er)||[]}function rm(te){return te.match(ni)||[]}var im=function te(fe){fe=fe==null?Xe:Wi.defaults(Xe.Object(),fe,Wi.pick(Xe,ji));var se=fe.Array,Oe=fe.Date,He=fe.Error,lt=fe.Function,Ft=fe.Math,_t=fe.Object,hl=fe.RegExp,om=fe.String,Cn=fe.TypeError,ka=se.prototype,am=lt.prototype,zi=_t.prototype,Pa=fe["__core-js_shared__"],Ra=am.toString,pt=zi.hasOwnProperty,sm=0,Pc=function(){var o=/[^.]+$/.exec(Pa&&Pa.keys&&Pa.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Ma=zi.toString,lm=Ra.call(_t),um=Xe._,cm=hl("^"+Ra.call(pt).replace(Vr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Da=zt?fe.Buffer:e,Pr=fe.Symbol,La=fe.Uint8Array,Rc=Da?Da.allocUnsafe:e,Ia=Cc(_t.getPrototypeOf,_t),Mc=_t.create,Dc=zi.propertyIsEnumerable,Na=ka.splice,Lc=Pr?Pr.isConcatSpreadable:e,No=Pr?Pr.iterator:e,oi=Pr?Pr.toStringTag:e,Ba=function(){try{var o=ci(_t,"defineProperty");return o({},"",{}),o}catch(s){}}(),fm=fe.clearTimeout!==Xe.clearTimeout&&fe.clearTimeout,hm=Oe&&Oe.now!==Xe.Date.now&&Oe.now,dm=fe.setTimeout!==Xe.setTimeout&&fe.setTimeout,Fa=Ft.ceil,qa=Ft.floor,dl=_t.getOwnPropertySymbols,pm=Da?Da.isBuffer:e,Ic=fe.isFinite,gm=ka.join,mm=Cc(_t.keys,_t),qt=Ft.max,Qt=Ft.min,vm=Oe.now,ym=fe.parseInt,Nc=Ft.random,_m=ka.reverse,pl=ci(fe,"DataView"),Bo=ci(fe,"Map"),gl=ci(fe,"Promise"),Gi=ci(fe,"Set"),Fo=ci(fe,"WeakMap"),qo=ci(_t,"create"),ja=Fo&&new Fo,Yi={},bm=fi(pl),wm=fi(Bo),xm=fi(gl),Tm=fi(Gi),Sm=fi(Fo),$a=Pr?Pr.prototype:e,jo=$a?$a.valueOf:e,Bc=$a?$a.toString:e;function B(o){if(Ct(o)&&!We(o)&&!(o instanceof et)){if(o instanceof kn)return o;if(pt.call(o,"__wrapped__"))return qf(o)}return new kn(o)}var Vi=function(){function o(){}return function(s){if(!Et(s))return{};if(Mc)return Mc(s);o.prototype=s;var m=new o;return o.prototype=e,m}}();function Ua(){}function kn(o,s){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!s,this.__index__=0,this.__values__=e}B.templateSettings={escape:Gr,evaluate:Yr,interpolate:br,variable:"",imports:{_:B}},B.prototype=Ua.prototype,B.prototype.constructor=B,kn.prototype=Vi(Ua.prototype),kn.prototype.constructor=kn;function et(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=N,this.__views__=[]}function Om(){var o=new et(this.__wrapped__);return o.__actions__=un(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=un(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=un(this.__views__),o}function Em(){if(this.__filtered__){var o=new et(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function Am(){var o=this.__wrapped__.value(),s=this.__dir__,m=We(o),O=s<0,D=m?o.length:0,q=qv(0,D,this.__views__),Y=q.start,Z=q.end,re=Z-Y,ge=O?Z:Y-1,me=this.__iteratees__,ye=me.length,xe=0,ke=Qt(re,this.__takeCount__);if(!m||!O&&D==re&&ke==re)return lf(o,this.__actions__);var Fe=[];e:for(;re--&&xe<ke;){ge+=s;for(var Ye=-1,qe=o[ge];++Ye<ye;){var Qe=me[Ye],it=Qe.iteratee,bn=Qe.type,sn=it(qe);if(bn==W)qe=sn;else if(!sn){if(bn==j)continue e;break e}}Fe[xe++]=qe}return Fe}et.prototype=Vi(Ua.prototype),et.prototype.constructor=et;function ai(o){var s=-1,m=o==null?0:o.length;for(this.clear();++s<m;){var O=o[s];this.set(O[0],O[1])}}function Cm(){this.__data__=qo?qo(null):{},this.size=0}function km(o){var s=this.has(o)&&delete this.__data__[o];return this.size-=s?1:0,s}function Pm(o){var s=this.__data__;if(qo){var m=s[o];return m===d?e:m}return pt.call(s,o)?s[o]:e}function Rm(o){var s=this.__data__;return qo?s[o]!==e:pt.call(s,o)}function Mm(o,s){var m=this.__data__;return this.size+=this.has(o)?0:1,m[o]=qo&&s===e?d:s,this}ai.prototype.clear=Cm,ai.prototype.delete=km,ai.prototype.get=Pm,ai.prototype.has=Rm,ai.prototype.set=Mm;function fr(o){var s=-1,m=o==null?0:o.length;for(this.clear();++s<m;){var O=o[s];this.set(O[0],O[1])}}function Dm(){this.__data__=[],this.size=0}function Lm(o){var s=this.__data__,m=Ha(s,o);if(m<0)return!1;var O=s.length-1;return m==O?s.pop():Na.call(s,m,1),--this.size,!0}function Im(o){var s=this.__data__,m=Ha(s,o);return m<0?e:s[m][1]}function Nm(o){return Ha(this.__data__,o)>-1}function Bm(o,s){var m=this.__data__,O=Ha(m,o);return O<0?(++this.size,m.push([o,s])):m[O][1]=s,this}fr.prototype.clear=Dm,fr.prototype.delete=Lm,fr.prototype.get=Im,fr.prototype.has=Nm,fr.prototype.set=Bm;function hr(o){var s=-1,m=o==null?0:o.length;for(this.clear();++s<m;){var O=o[s];this.set(O[0],O[1])}}function Fm(){this.size=0,this.__data__={hash:new ai,map:new(Bo||fr),string:new ai}}function qm(o){var s=ts(this,o).delete(o);return this.size-=s?1:0,s}function jm(o){return ts(this,o).get(o)}function $m(o){return ts(this,o).has(o)}function Um(o,s){var m=ts(this,o),O=m.size;return m.set(o,s),this.size+=m.size==O?0:1,this}hr.prototype.clear=Fm,hr.prototype.delete=qm,hr.prototype.get=jm,hr.prototype.has=$m,hr.prototype.set=Um;function si(o){var s=-1,m=o==null?0:o.length;for(this.__data__=new hr;++s<m;)this.add(o[s])}function Hm(o){return this.__data__.set(o,d),this}function Wm(o){return this.__data__.has(o)}si.prototype.add=si.prototype.push=Hm,si.prototype.has=Wm;function Fn(o){var s=this.__data__=new fr(o);this.size=s.size}function zm(){this.__data__=new fr,this.size=0}function Gm(o){var s=this.__data__,m=s.delete(o);return this.size=s.size,m}function Ym(o){return this.__data__.get(o)}function Vm(o){return this.__data__.has(o)}function Km(o,s){var m=this.__data__;if(m instanceof fr){var O=m.__data__;if(!Bo||O.length<i-1)return O.push([o,s]),this.size=++m.size,this;m=this.__data__=new hr(O)}return m.set(o,s),this.size=m.size,this}Fn.prototype.clear=zm,Fn.prototype.delete=Gm,Fn.prototype.get=Ym,Fn.prototype.has=Vm,Fn.prototype.set=Km;function Fc(o,s){var m=We(o),O=!m&&hi(o),D=!m&&!O&&Ir(o),q=!m&&!O&&!D&&Qi(o),Y=m||O||D||q,Z=Y?ul(o.length,om):[],re=Z.length;for(var ge in o)(s||pt.call(o,ge))&&!(Y&&(ge=="length"||D&&(ge=="offset"||ge=="parent")||q&&(ge=="buffer"||ge=="byteLength"||ge=="byteOffset")||mr(ge,re)))&&Z.push(ge);return Z}function qc(o){var s=o.length;return s?o[El(0,s-1)]:e}function Xm(o,s){return ns(un(o),li(s,0,o.length))}function Zm(o){return ns(un(o))}function ml(o,s,m){(m!==e&&!qn(o[s],m)||m===e&&!(s in o))&&dr(o,s,m)}function $o(o,s,m){var O=o[s];(!(pt.call(o,s)&&qn(O,m))||m===e&&!(s in o))&&dr(o,s,m)}function Ha(o,s){for(var m=o.length;m--;)if(qn(o[m][0],s))return m;return-1}function Qm(o,s,m,O){return Rr(o,function(D,q,Y){s(O,D,m(D),Y)}),O}function jc(o,s){return o&&Vn(s,$t(s),o)}function Jm(o,s){return o&&Vn(s,fn(s),o)}function dr(o,s,m){s=="__proto__"&&Ba?Ba(o,s,{configurable:!0,enumerable:!0,value:m,writable:!0}):o[s]=m}function vl(o,s){for(var m=-1,O=s.length,D=se(O),q=o==null;++m<O;)D[m]=q?e:Zl(o,s[m]);return D}function li(o,s,m){return o===o&&(m!==e&&(o=o<=m?o:m),s!==e&&(o=o>=s?o:s)),o}function Pn(o,s,m,O,D,q){var Y,Z=s&a,re=s&u,ge=s&f;if(m&&(Y=D?m(o,O,D,q):m(o)),Y!==e)return Y;if(!Et(o))return o;var me=We(o);if(me){if(Y=$v(o),!Z)return un(o,Y)}else{var ye=Jt(o),xe=ye==Pe||ye==Me;if(Ir(o))return ff(o,Z);if(ye==Je||ye==X||xe&&!D){if(Y=re||xe?{}:Pf(o),!Z)return re?Pv(o,Jm(Y,o)):kv(o,jc(Y,o))}else{if(!ct[ye])return D?o:{};Y=Uv(o,ye,Z)}}q||(q=new Fn);var ke=q.get(o);if(ke)return ke;q.set(o,Y),oh(o)?o.forEach(function(qe){Y.add(Pn(qe,s,m,qe,o,q))}):rh(o)&&o.forEach(function(qe,Qe){Y.set(Qe,Pn(qe,s,m,Qe,o,q))});var Fe=ge?re?Bl:Nl:re?fn:$t,Ye=me?e:Fe(o);return An(Ye||o,function(qe,Qe){Ye&&(Qe=qe,qe=o[Qe]),$o(Y,Qe,Pn(qe,s,m,Qe,o,q))}),Y}function ev(o){var s=$t(o);return function(m){return $c(m,o,s)}}function $c(o,s,m){var O=m.length;if(o==null)return!O;for(o=_t(o);O--;){var D=m[O],q=s[D],Y=o[D];if(Y===e&&!(D in o)||!q(Y))return!1}return!0}function Uc(o,s,m){if(typeof o!="function")throw new Cn(c);return Vo(function(){o.apply(e,m)},s)}function Uo(o,s,m,O){var D=-1,q=Ea,Y=!0,Z=o.length,re=[],ge=s.length;if(!Z)return re;m&&(s=St(s,vn(m))),O?(q=rl,Y=!1):s.length>=i&&(q=Io,Y=!1,s=new si(s));e:for(;++D<Z;){var me=o[D],ye=m==null?me:m(me);if(me=O||me!==0?me:0,Y&&ye===ye){for(var xe=ge;xe--;)if(s[xe]===ye)continue e;re.push(me)}else q(s,ye,O)||re.push(me)}return re}var Rr=mf(Yn),Hc=mf(_l,!0);function tv(o,s){var m=!0;return Rr(o,function(O,D,q){return m=!!s(O,D,q),m}),m}function Wa(o,s,m){for(var O=-1,D=o.length;++O<D;){var q=o[O],Y=s(q);if(Y!=null&&(Z===e?Y===Y&&!_n(Y):m(Y,Z)))var Z=Y,re=q}return re}function nv(o,s,m,O){var D=o.length;for(m=Ge(m),m<0&&(m=-m>D?0:D+m),O=O===e||O>D?D:Ge(O),O<0&&(O+=D),O=m>O?0:sh(O);m<O;)o[m++]=s;return o}function Wc(o,s){var m=[];return Rr(o,function(O,D,q){s(O,D,q)&&m.push(O)}),m}function Gt(o,s,m,O,D){var q=-1,Y=o.length;for(m||(m=Wv),D||(D=[]);++q<Y;){var Z=o[q];s>0&&m(Z)?s>1?Gt(Z,s-1,m,O,D):Cr(D,Z):O||(D[D.length]=Z)}return D}var yl=vf(),zc=vf(!0);function Yn(o,s){return o&&yl(o,s,$t)}function _l(o,s){return o&&zc(o,s,$t)}function za(o,s){return Ar(s,function(m){return vr(o[m])})}function ui(o,s){s=Dr(s,o);for(var m=0,O=s.length;o!=null&&m<O;)o=o[Kn(s[m++])];return m&&m==O?o:e}function Gc(o,s,m){var O=s(o);return We(o)?O:Cr(O,m(o))}function on(o){return o==null?o===e?Le:xt:oi&&oi in _t(o)?Fv(o):Zv(o)}function bl(o,s){return o>s}function rv(o,s){return o!=null&&pt.call(o,s)}function iv(o,s){return o!=null&&s in _t(o)}function ov(o,s,m){return o>=Qt(s,m)&&o<qt(s,m)}function wl(o,s,m){for(var O=m?rl:Ea,D=o[0].length,q=o.length,Y=q,Z=se(q),re=1/0,ge=[];Y--;){var me=o[Y];Y&&s&&(me=St(me,vn(s))),re=Qt(me.length,re),Z[Y]=!m&&(s||D>=120&&me.length>=120)?new si(Y&&me):e}me=o[0];var ye=-1,xe=Z[0];e:for(;++ye<D&&ge.length<re;){var ke=me[ye],Fe=s?s(ke):ke;if(ke=m||ke!==0?ke:0,!(xe?Io(xe,Fe):O(ge,Fe,m))){for(Y=q;--Y;){var Ye=Z[Y];if(!(Ye?Io(Ye,Fe):O(o[Y],Fe,m)))continue e}xe&&xe.push(Fe),ge.push(ke)}}return ge}function av(o,s,m,O){return Yn(o,function(D,q,Y){s(O,m(D),q,Y)}),O}function Ho(o,s,m){s=Dr(s,o),o=Lf(o,s);var O=o==null?o:o[Kn(Mn(s))];return O==null?e:jt(O,o,m)}function Yc(o){return Ct(o)&&on(o)==X}function sv(o){return Ct(o)&&on(o)==vt}function lv(o){return Ct(o)&&on(o)==ae}function Wo(o,s,m,O,D){return o===s?!0:o==null||s==null||!Ct(o)&&!Ct(s)?o!==o&&s!==s:uv(o,s,m,O,Wo,D)}function uv(o,s,m,O,D,q){var Y=We(o),Z=We(s),re=Y?U:Jt(o),ge=Z?U:Jt(s);re=re==X?Je:re,ge=ge==X?Je:ge;var me=re==Je,ye=ge==Je,xe=re==ge;if(xe&&Ir(o)){if(!Ir(s))return!1;Y=!0,me=!1}if(xe&&!me)return q||(q=new Fn),Y||Qi(o)?Af(o,s,m,O,D,q):Nv(o,s,re,m,O,D,q);if(!(m&y)){var ke=me&&pt.call(o,"__wrapped__"),Fe=ye&&pt.call(s,"__wrapped__");if(ke||Fe){var Ye=ke?o.value():o,qe=Fe?s.value():s;return q||(q=new Fn),D(Ye,qe,m,O,q)}}return xe?(q||(q=new Fn),Bv(o,s,m,O,D,q)):!1}function cv(o){return Ct(o)&&Jt(o)==De}function xl(o,s,m,O){var D=m.length,q=D,Y=!O;if(o==null)return!q;for(o=_t(o);D--;){var Z=m[D];if(Y&&Z[2]?Z[1]!==o[Z[0]]:!(Z[0]in o))return!1}for(;++D<q;){Z=m[D];var re=Z[0],ge=o[re],me=Z[1];if(Y&&Z[2]){if(ge===e&&!(re in o))return!1}else{var ye=new Fn;if(O)var xe=O(ge,me,re,o,s,ye);if(!(xe===e?Wo(me,ge,y|_,O,ye):xe))return!1}}return!0}function Vc(o){if(!Et(o)||Gv(o))return!1;var s=vr(o)?cm:xo;return s.test(fi(o))}function fv(o){return Ct(o)&&on(o)==_e}function hv(o){return Ct(o)&&Jt(o)==be}function dv(o){return Ct(o)&&ls(o.length)&&!!ht[on(o)]}function Kc(o){return typeof o=="function"?o:o==null?hn:typeof o=="object"?We(o)?Qc(o[0],o[1]):Zc(o):yh(o)}function Tl(o){if(!Yo(o))return mm(o);var s=[];for(var m in _t(o))pt.call(o,m)&&m!="constructor"&&s.push(m);return s}function pv(o){if(!Et(o))return Xv(o);var s=Yo(o),m=[];for(var O in o)O=="constructor"&&(s||!pt.call(o,O))||m.push(O);return m}function Sl(o,s){return o<s}function Xc(o,s){var m=-1,O=cn(o)?se(o.length):[];return Rr(o,function(D,q,Y){O[++m]=s(D,q,Y)}),O}function Zc(o){var s=ql(o);return s.length==1&&s[0][2]?Mf(s[0][0],s[0][1]):function(m){return m===o||xl(m,o,s)}}function Qc(o,s){return $l(o)&&Rf(s)?Mf(Kn(o),s):function(m){var O=Zl(m,o);return O===e&&O===s?Ql(m,o):Wo(s,O,y|_)}}function Ga(o,s,m,O,D){o!==s&&yl(s,function(q,Y){if(D||(D=new Fn),Et(q))gv(o,s,Y,m,Ga,O,D);else{var Z=O?O(Hl(o,Y),q,Y+"",o,s,D):e;Z===e&&(Z=q),ml(o,Y,Z)}},fn)}function gv(o,s,m,O,D,q,Y){var Z=Hl(o,m),re=Hl(s,m),ge=Y.get(re);if(ge){ml(o,m,ge);return}var me=q?q(Z,re,m+"",o,s,Y):e,ye=me===e;if(ye){var xe=We(re),ke=!xe&&Ir(re),Fe=!xe&&!ke&&Qi(re);me=re,xe||ke||Fe?We(Z)?me=Z:Pt(Z)?me=un(Z):ke?(ye=!1,me=ff(re,!0)):Fe?(ye=!1,me=hf(re,!0)):me=[]:Ko(re)||hi(re)?(me=Z,hi(Z)?me=lh(Z):(!Et(Z)||vr(Z))&&(me=Pf(re))):ye=!1}ye&&(Y.set(re,me),D(me,re,O,q,Y),Y.delete(re)),ml(o,m,me)}function Jc(o,s){var m=o.length;if(m)return s+=s<0?m:0,mr(s,m)?o[s]:e}function ef(o,s,m){s.length?s=St(s,function(q){return We(q)?function(Y){return ui(Y,q.length===1?q[0]:q)}:q}):s=[hn];var O=-1;s=St(s,vn(Ne()));var D=Xc(o,function(q,Y,Z){var re=St(s,function(ge){return ge(q)});return{criteria:re,index:++O,value:q}});return Ug(D,function(q,Y){return Cv(q,Y,m)})}function mv(o,s){return tf(o,s,function(m,O){return Ql(o,O)})}function tf(o,s,m){for(var O=-1,D=s.length,q={};++O<D;){var Y=s[O],Z=ui(o,Y);m(Z,Y)&&zo(q,Dr(Y,o),Z)}return q}function vv(o){return function(s){return ui(s,o)}}function Ol(o,s,m,O){var D=O?$g:$i,q=-1,Y=s.length,Z=o;for(o===s&&(s=un(s)),m&&(Z=St(o,vn(m)));++q<Y;)for(var re=0,ge=s[q],me=m?m(ge):ge;(re=D(Z,me,re,O))>-1;)Z!==o&&Na.call(Z,re,1),Na.call(o,re,1);return o}function nf(o,s){for(var m=o?s.length:0,O=m-1;m--;){var D=s[m];if(m==O||D!==q){var q=D;mr(D)?Na.call(o,D,1):kl(o,D)}}return o}function El(o,s){return o+qa(Nc()*(s-o+1))}function yv(o,s,m,O){for(var D=-1,q=qt(Fa((s-o)/(m||1)),0),Y=se(q);q--;)Y[O?q:++D]=o,o+=m;return Y}function Al(o,s){var m="";if(!o||s<1||s>oe)return m;do s%2&&(m+=o),s=qa(s/2),s&&(o+=o);while(s);return m}function Ke(o,s){return Wl(Df(o,s,hn),o+"")}function _v(o){return qc(Ji(o))}function bv(o,s){var m=Ji(o);return ns(m,li(s,0,m.length))}function zo(o,s,m,O){if(!Et(o))return o;s=Dr(s,o);for(var D=-1,q=s.length,Y=q-1,Z=o;Z!=null&&++D<q;){var re=Kn(s[D]),ge=m;if(re==="__proto__"||re==="constructor"||re==="prototype")return o;if(D!=Y){var me=Z[re];ge=O?O(me,re,Z):e,ge===e&&(ge=Et(me)?me:mr(s[D+1])?[]:{})}$o(Z,re,ge),Z=Z[re]}return o}var rf=ja?function(o,s){return ja.set(o,s),o}:hn,wv=Ba?function(o,s){return Ba(o,"toString",{configurable:!0,enumerable:!1,value:eu(s),writable:!0})}:hn;function xv(o){return ns(Ji(o))}function Rn(o,s,m){var O=-1,D=o.length;s<0&&(s=-s>D?0:D+s),m=m>D?D:m,m<0&&(m+=D),D=s>m?0:m-s>>>0,s>>>=0;for(var q=se(D);++O<D;)q[O]=o[O+s];return q}function Tv(o,s){var m;return Rr(o,function(O,D,q){return m=s(O,D,q),!m}),!!m}function Ya(o,s,m){var O=0,D=o==null?O:o.length;if(typeof s=="number"&&s===s&&D<=G){for(;O<D;){var q=O+D>>>1,Y=o[q];Y!==null&&!_n(Y)&&(m?Y<=s:Y<s)?O=q+1:D=q}return D}return Cl(o,s,hn,m)}function Cl(o,s,m,O){var D=0,q=o==null?0:o.length;if(q===0)return 0;s=m(s);for(var Y=s!==s,Z=s===null,re=_n(s),ge=s===e;D<q;){var me=qa((D+q)/2),ye=m(o[me]),xe=ye!==e,ke=ye===null,Fe=ye===ye,Ye=_n(ye);if(Y)var qe=O||Fe;else ge?qe=Fe&&(O||xe):Z?qe=Fe&&xe&&(O||!ke):re?qe=Fe&&xe&&!ke&&(O||!Ye):ke||Ye?qe=!1:qe=O?ye<=s:ye<s;qe?D=me+1:q=me}return Qt(q,H)}function of(o,s){for(var m=-1,O=o.length,D=0,q=[];++m<O;){var Y=o[m],Z=s?s(Y):Y;if(!m||!qn(Z,re)){var re=Z;q[D++]=Y===0?0:Y}}return q}function af(o){return typeof o=="number"?o:_n(o)?$:+o}function yn(o){if(typeof o=="string")return o;if(We(o))return St(o,yn)+"";if(_n(o))return Bc?Bc.call(o):"";var s=o+"";return s=="0"&&1/o==-ee?"-0":s}function Mr(o,s,m){var O=-1,D=Ea,q=o.length,Y=!0,Z=[],re=Z;if(m)Y=!1,D=rl;else if(q>=i){var ge=s?null:Lv(o);if(ge)return Ca(ge);Y=!1,D=Io,re=new si}else re=s?[]:Z;e:for(;++O<q;){var me=o[O],ye=s?s(me):me;if(me=m||me!==0?me:0,Y&&ye===ye){for(var xe=re.length;xe--;)if(re[xe]===ye)continue e;s&&re.push(ye),Z.push(me)}else D(re,ye,m)||(re!==Z&&re.push(ye),Z.push(me))}return Z}function kl(o,s){return s=Dr(s,o),o=Lf(o,s),o==null||delete o[Kn(Mn(s))]}function sf(o,s,m,O){return zo(o,s,m(ui(o,s)),O)}function Va(o,s,m,O){for(var D=o.length,q=O?D:-1;(O?q--:++q<D)&&s(o[q],q,o););return m?Rn(o,O?0:q,O?q+1:D):Rn(o,O?q+1:0,O?D:q)}function lf(o,s){var m=o;return m instanceof et&&(m=m.value()),il(s,function(O,D){return D.func.apply(D.thisArg,Cr([O],D.args))},m)}function Pl(o,s,m){var O=o.length;if(O<2)return O?Mr(o[0]):[];for(var D=-1,q=se(O);++D<O;)for(var Y=o[D],Z=-1;++Z<O;)Z!=D&&(q[D]=Uo(q[D]||Y,o[Z],s,m));return Mr(Gt(q,1),s,m)}function uf(o,s,m){for(var O=-1,D=o.length,q=s.length,Y={};++O<D;){var Z=O<q?s[O]:e;m(Y,o[O],Z)}return Y}function Rl(o){return Pt(o)?o:[]}function Ml(o){return typeof o=="function"?o:hn}function Dr(o,s){return We(o)?o:$l(o,s)?[o]:Ff(ft(o))}var Sv=Ke;function Lr(o,s,m){var O=o.length;return m=m===e?O:m,!s&&m>=O?o:Rn(o,s,m)}var cf=fm||function(o){return Xe.clearTimeout(o)};function ff(o,s){if(s)return o.slice();var m=o.length,O=Rc?Rc(m):new o.constructor(m);return o.copy(O),O}function Dl(o){var s=new o.constructor(o.byteLength);return new La(s).set(new La(o)),s}function Ov(o,s){var m=s?Dl(o.buffer):o.buffer;return new o.constructor(m,o.byteOffset,o.byteLength)}function Ev(o){var s=new o.constructor(o.source,Bt.exec(o));return s.lastIndex=o.lastIndex,s}function Av(o){return jo?_t(jo.call(o)):{}}function hf(o,s){var m=s?Dl(o.buffer):o.buffer;return new o.constructor(m,o.byteOffset,o.length)}function df(o,s){if(o!==s){var m=o!==e,O=o===null,D=o===o,q=_n(o),Y=s!==e,Z=s===null,re=s===s,ge=_n(s);if(!Z&&!ge&&!q&&o>s||q&&Y&&re&&!Z&&!ge||O&&Y&&re||!m&&re||!D)return 1;if(!O&&!q&&!ge&&o<s||ge&&m&&D&&!O&&!q||Z&&m&&D||!Y&&D||!re)return-1}return 0}function Cv(o,s,m){for(var O=-1,D=o.criteria,q=s.criteria,Y=D.length,Z=m.length;++O<Y;){var re=df(D[O],q[O]);if(re){if(O>=Z)return re;var ge=m[O];return re*(ge=="desc"?-1:1)}}return o.index-s.index}function pf(o,s,m,O){for(var D=-1,q=o.length,Y=m.length,Z=-1,re=s.length,ge=qt(q-Y,0),me=se(re+ge),ye=!O;++Z<re;)me[Z]=s[Z];for(;++D<Y;)(ye||D<q)&&(me[m[D]]=o[D]);for(;ge--;)me[Z++]=o[D++];return me}function gf(o,s,m,O){for(var D=-1,q=o.length,Y=-1,Z=m.length,re=-1,ge=s.length,me=qt(q-Z,0),ye=se(me+ge),xe=!O;++D<me;)ye[D]=o[D];for(var ke=D;++re<ge;)ye[ke+re]=s[re];for(;++Y<Z;)(xe||D<q)&&(ye[ke+m[Y]]=o[D++]);return ye}function un(o,s){var m=-1,O=o.length;for(s||(s=se(O));++m<O;)s[m]=o[m];return s}function Vn(o,s,m,O){var D=!m;m||(m={});for(var q=-1,Y=s.length;++q<Y;){var Z=s[q],re=O?O(m[Z],o[Z],Z,m,o):e;re===e&&(re=o[Z]),D?dr(m,Z,re):$o(m,Z,re)}return m}function kv(o,s){return Vn(o,jl(o),s)}function Pv(o,s){return Vn(o,Cf(o),s)}function Ka(o,s){return function(m,O){var D=We(m)?Ig:Qm,q=s?s():{};return D(m,o,Ne(O,2),q)}}function Ki(o){return Ke(function(s,m){var O=-1,D=m.length,q=D>1?m[D-1]:e,Y=D>2?m[2]:e;for(q=o.length>3&&typeof q=="function"?(D--,q):e,Y&&an(m[0],m[1],Y)&&(q=D<3?e:q,D=1),s=_t(s);++O<D;){var Z=m[O];Z&&o(s,Z,O,q)}return s})}function mf(o,s){return function(m,O){if(m==null)return m;if(!cn(m))return o(m,O);for(var D=m.length,q=s?D:-1,Y=_t(m);(s?q--:++q<D)&&O(Y[q],q,Y)!==!1;);return m}}function vf(o){return function(s,m,O){for(var D=-1,q=_t(s),Y=O(s),Z=Y.length;Z--;){var re=Y[o?Z:++D];if(m(q[re],re,q)===!1)break}return s}}function Rv(o,s,m){var O=s&b,D=Go(o);function q(){var Y=this&&this!==Xe&&this instanceof q?D:o;return Y.apply(O?m:this,arguments)}return q}function yf(o){return function(s){s=ft(s);var m=Ui(s)?Bn(s):e,O=m?m[0]:s.charAt(0),D=m?Lr(m,1).join(""):s.slice(1);return O[o]()+D}}function Xi(o){return function(s){return il(mh(gh(s).replace(Or,"")),o,"")}}function Go(o){return function(){var s=arguments;switch(s.length){case 0:return new o;case 1:return new o(s[0]);case 2:return new o(s[0],s[1]);case 3:return new o(s[0],s[1],s[2]);case 4:return new o(s[0],s[1],s[2],s[3]);case 5:return new o(s[0],s[1],s[2],s[3],s[4]);case 6:return new o(s[0],s[1],s[2],s[3],s[4],s[5]);case 7:return new o(s[0],s[1],s[2],s[3],s[4],s[5],s[6])}var m=Vi(o.prototype),O=o.apply(m,s);return Et(O)?O:m}}function Mv(o,s,m){var O=Go(o);function D(){for(var q=arguments.length,Y=se(q),Z=q,re=Zi(D);Z--;)Y[Z]=arguments[Z];var ge=q<3&&Y[0]!==re&&Y[q-1]!==re?[]:kr(Y,re);if(q-=ge.length,q<m)return Tf(o,s,Xa,D.placeholder,e,Y,ge,e,e,m-q);var me=this&&this!==Xe&&this instanceof D?O:o;return jt(me,this,Y)}return D}function _f(o){return function(s,m,O){var D=_t(s);if(!cn(s)){var q=Ne(m,3);s=$t(s),m=function(Z){return q(D[Z],Z,D)}}var Y=o(s,m,O);return Y>-1?D[q?s[Y]:Y]:e}}function bf(o){return gr(function(s){var m=s.length,O=m,D=kn.prototype.thru;for(o&&s.reverse();O--;){var q=s[O];if(typeof q!="function")throw new Cn(c);if(D&&!Y&&es(q)=="wrapper")var Y=new kn([],!0)}for(O=Y?O:m;++O<m;){q=s[O];var Z=es(q),re=Z=="wrapper"?Fl(q):e;re&&Ul(re[0])&&re[1]==(A|T|S|R)&&!re[4].length&&re[9]==1?Y=Y[es(re[0])].apply(Y,re[3]):Y=q.length==1&&Ul(q)?Y[Z]():Y.thru(q)}return function(){var ge=arguments,me=ge[0];if(Y&&ge.length==1&&We(me))return Y.plant(me).value();for(var ye=0,xe=m?s[ye].apply(this,ge):me;++ye<m;)xe=s[ye].call(this,xe);return xe}})}function Xa(o,s,m,O,D,q,Y,Z,re,ge){var me=s&A,ye=s&b,xe=s&v,ke=s&(T|x),Fe=s&L,Ye=xe?e:Go(o);function qe(){for(var Qe=arguments.length,it=se(Qe),bn=Qe;bn--;)it[bn]=arguments[bn];if(ke)var sn=Zi(qe),wn=Wg(it,sn);if(O&&(it=pf(it,O,D,ke)),q&&(it=gf(it,q,Y,ke)),Qe-=wn,ke&&Qe<ge){var Rt=kr(it,sn);return Tf(o,s,Xa,qe.placeholder,m,it,Rt,Z,re,ge-Qe)}var jn=ye?m:this,_r=xe?jn[o]:o;return Qe=it.length,Z?it=Qv(it,Z):Fe&&Qe>1&&it.reverse(),me&&re<Qe&&(it.length=re),this&&this!==Xe&&this instanceof qe&&(_r=Ye||Go(_r)),_r.apply(jn,it)}return qe}function wf(o,s){return function(m,O){return av(m,o,s(O),{})}}function Za(o,s){return function(m,O){var D;if(m===e&&O===e)return s;if(m!==e&&(D=m),O!==e){if(D===e)return O;typeof m=="string"||typeof O=="string"?(m=yn(m),O=yn(O)):(m=af(m),O=af(O)),D=o(m,O)}return D}}function Ll(o){return gr(function(s){return s=St(s,vn(Ne())),Ke(function(m){var O=this;return o(s,function(D){return jt(D,O,m)})})})}function Qa(o,s){s=s===e?" ":yn(s);var m=s.length;if(m<2)return m?Al(s,o):s;var O=Al(s,Fa(o/Hi(s)));return Ui(s)?Lr(Bn(O),0,o).join(""):O.slice(0,o)}function Dv(o,s,m,O){var D=s&b,q=Go(o);function Y(){for(var Z=-1,re=arguments.length,ge=-1,me=O.length,ye=se(me+re),xe=this&&this!==Xe&&this instanceof Y?q:o;++ge<me;)ye[ge]=O[ge];for(;re--;)ye[ge++]=arguments[++Z];return jt(xe,D?m:this,ye)}return Y}function xf(o){return function(s,m,O){return O&&typeof O!="number"&&an(s,m,O)&&(m=O=e),s=yr(s),m===e?(m=s,s=0):m=yr(m),O=O===e?s<m?1:-1:yr(O),yv(s,m,O,o)}}function Ja(o){return function(s,m){return typeof s=="string"&&typeof m=="string"||(s=Dn(s),m=Dn(m)),o(s,m)}}function Tf(o,s,m,O,D,q,Y,Z,re,ge){var me=s&T,ye=me?Y:e,xe=me?e:Y,ke=me?q:e,Fe=me?e:q;s|=me?S:C,s&=~(me?C:S),s&w||(s&=-4);var Ye=[o,s,D,ke,ye,Fe,xe,Z,re,ge],qe=m.apply(e,Ye);return Ul(o)&&If(qe,Ye),qe.placeholder=O,Nf(qe,o,s)}function Il(o){var s=Ft[o];return function(m,O){if(m=Dn(m),O=O==null?0:Qt(Ge(O),292),O&&Ic(m)){var D=(ft(m)+"e").split("e"),q=s(D[0]+"e"+(+D[1]+O));return D=(ft(q)+"e").split("e"),+(D[0]+"e"+(+D[1]-O))}return s(m)}}var Lv=Gi&&1/Ca(new Gi([,-0]))[1]==ee?function(o){return new Gi(o)}:ru;function Sf(o){return function(s){var m=Jt(s);return m==De?fl(s):m==be?Zg(s):Hg(s,o(s))}}function pr(o,s,m,O,D,q,Y,Z){var re=s&v;if(!re&&typeof o!="function")throw new Cn(c);var ge=O?O.length:0;if(ge||(s&=-97,O=D=e),Y=Y===e?Y:qt(Ge(Y),0),Z=Z===e?Z:Ge(Z),ge-=D?D.length:0,s&C){var me=O,ye=D;O=D=e}var xe=re?e:Fl(o),ke=[o,s,m,O,D,me,ye,q,Y,Z];if(xe&&Kv(ke,xe),o=ke[0],s=ke[1],m=ke[2],O=ke[3],D=ke[4],Z=ke[9]=ke[9]===e?re?0:o.length:qt(ke[9]-ge,0),!Z&&s&(T|x)&&(s&=-25),!s||s==b)var Fe=Rv(o,s,m);else s==T||s==x?Fe=Mv(o,s,Z):(s==S||s==(b|S))&&!D.length?Fe=Dv(o,s,m,O):Fe=Xa.apply(e,ke);var Ye=xe?rf:If;return Nf(Ye(Fe,ke),o,s)}function Of(o,s,m,O){return o===e||qn(o,zi[m])&&!pt.call(O,m)?s:o}function Ef(o,s,m,O,D,q){return Et(o)&&Et(s)&&(q.set(s,o),Ga(o,s,e,Ef,q),q.delete(s)),o}function Iv(o){return Ko(o)?e:o}function Af(o,s,m,O,D,q){var Y=m&y,Z=o.length,re=s.length;if(Z!=re&&!(Y&&re>Z))return!1;var ge=q.get(o),me=q.get(s);if(ge&&me)return ge==s&&me==o;var ye=-1,xe=!0,ke=m&_?new si:e;for(q.set(o,s),q.set(s,o);++ye<Z;){var Fe=o[ye],Ye=s[ye];if(O)var qe=Y?O(Ye,Fe,ye,s,o,q):O(Fe,Ye,ye,o,s,q);if(qe!==e){if(qe)continue;xe=!1;break}if(ke){if(!ol(s,function(Qe,it){if(!Io(ke,it)&&(Fe===Qe||D(Fe,Qe,m,O,q)))return ke.push(it)})){xe=!1;break}}else if(!(Fe===Ye||D(Fe,Ye,m,O,q))){xe=!1;break}}return q.delete(o),q.delete(s),xe}function Nv(o,s,m,O,D,q,Y){switch(m){case Ve:if(o.byteLength!=s.byteLength||o.byteOffset!=s.byteOffset)return!1;o=o.buffer,s=s.buffer;case vt:return!(o.byteLength!=s.byteLength||!q(new La(o),new La(s)));case ie:case ae:case ze:return qn(+o,+s);case we:return o.name==s.name&&o.message==s.message;case _e:case ve:return o==s+"";case De:var Z=fl;case be:var re=O&y;if(Z||(Z=Ca),o.size!=s.size&&!re)return!1;var ge=Y.get(o);if(ge)return ge==s;O|=_,Y.set(o,s);var me=Af(Z(o),Z(s),O,D,q,Y);return Y.delete(o),me;case Be:if(jo)return jo.call(o)==jo.call(s)}return!1}function Bv(o,s,m,O,D,q){var Y=m&y,Z=Nl(o),re=Z.length,ge=Nl(s),me=ge.length;if(re!=me&&!Y)return!1;for(var ye=re;ye--;){var xe=Z[ye];if(!(Y?xe in s:pt.call(s,xe)))return!1}var ke=q.get(o),Fe=q.get(s);if(ke&&Fe)return ke==s&&Fe==o;var Ye=!0;q.set(o,s),q.set(s,o);for(var qe=Y;++ye<re;){xe=Z[ye];var Qe=o[xe],it=s[xe];if(O)var bn=Y?O(it,Qe,xe,s,o,q):O(Qe,it,xe,o,s,q);if(!(bn===e?Qe===it||D(Qe,it,m,O,q):bn)){Ye=!1;break}qe||(qe=xe=="constructor")}if(Ye&&!qe){var sn=o.constructor,wn=s.constructor;sn!=wn&&"constructor"in o&&"constructor"in s&&!(typeof sn=="function"&&sn instanceof sn&&typeof wn=="function"&&wn instanceof wn)&&(Ye=!1)}return q.delete(o),q.delete(s),Ye}function gr(o){return Wl(Df(o,e,Uf),o+"")}function Nl(o){return Gc(o,$t,jl)}function Bl(o){return Gc(o,fn,Cf)}var Fl=ja?function(o){return ja.get(o)}:ru;function es(o){for(var s=o.name+"",m=Yi[s],O=pt.call(Yi,s)?m.length:0;O--;){var D=m[O],q=D.func;if(q==null||q==o)return D.name}return s}function Zi(o){var s=pt.call(B,"placeholder")?B:o;return s.placeholder}function Ne(){var o=B.iteratee||tu;return o=o===tu?Kc:o,arguments.length?o(arguments[0],arguments[1]):o}function ts(o,s){var m=o.__data__;return zv(s)?m[typeof s=="string"?"string":"hash"]:m.map}function ql(o){for(var s=$t(o),m=s.length;m--;){var O=s[m],D=o[O];s[m]=[O,D,Rf(D)]}return s}function ci(o,s){var m=Vg(o,s);return Vc(m)?m:e}function Fv(o){var s=pt.call(o,oi),m=o[oi];try{o[oi]=e;var O=!0}catch(q){}var D=Ma.call(o);return O&&(s?o[oi]=m:delete o[oi]),D}var jl=dl?function(o){return o==null?[]:(o=_t(o),Ar(dl(o),function(s){return Dc.call(o,s)}))}:iu,Cf=dl?function(o){for(var s=[];o;)Cr(s,jl(o)),o=Ia(o);return s}:iu,Jt=on;(pl&&Jt(new pl(new ArrayBuffer(1)))!=Ve||Bo&&Jt(new Bo)!=De||gl&&Jt(gl.resolve())!=le||Gi&&Jt(new Gi)!=be||Fo&&Jt(new Fo)!=Ee)&&(Jt=function(o){var s=on(o),m=s==Je?o.constructor:e,O=m?fi(m):"";if(O)switch(O){case bm:return Ve;case wm:return De;case xm:return le;case Tm:return be;case Sm:return Ee}return s});function qv(o,s,m){for(var O=-1,D=m.length;++O<D;){var q=m[O],Y=q.size;switch(q.type){case"drop":o+=Y;break;case"dropRight":s-=Y;break;case"take":s=Qt(s,o+Y);break;case"takeRight":o=qt(o,s-Y);break}}return{start:o,end:s}}function jv(o){var s=o.match(Nt);return s?s[1].split(go):[]}function kf(o,s,m){s=Dr(s,o);for(var O=-1,D=s.length,q=!1;++O<D;){var Y=Kn(s[O]);if(!(q=o!=null&&m(o,Y)))break;o=o[Y]}return q||++O!=D?q:(D=o==null?0:o.length,!!D&&ls(D)&&mr(Y,D)&&(We(o)||hi(o)))}function $v(o){var s=o.length,m=new o.constructor(s);return s&&typeof o[0]=="string"&&pt.call(o,"index")&&(m.index=o.index,m.input=o.input),m}function Pf(o){return typeof o.constructor=="function"&&!Yo(o)?Vi(Ia(o)):{}}function Uv(o,s,m){var O=o.constructor;switch(s){case vt:return Dl(o);case ie:case ae:return new O(+o);case Ve:return Ov(o,m);case nn:case z:case ue:case pe:case Te:case Ae:case Ie:case at:case wt:return hf(o,m);case De:return new O;case ze:case ve:return new O(o);case _e:return Ev(o);case be:return new O;case Be:return Av(o)}}function Hv(o,s){var m=s.length;if(!m)return o;var O=m-1;return s[O]=(m>1?"& ":"")+s[O],s=s.join(m>2?", ":" "),o.replace(Xr,`{
/* [wrapped with `+s+`] */
`)}function Wv(o){return We(o)||hi(o)||!!(Lc&&o&&o[Lc])}function mr(o,s){var m=typeof o;return s=s==null?oe:s,!!s&&(m=="number"||m!="symbol"&&So.test(o))&&o>-1&&o%1==0&&o<s}function an(o,s,m){if(!Et(m))return!1;var O=typeof s;return(O=="number"?cn(m)&&mr(s,m.length):O=="string"&&s in m)?qn(m[s],o):!1}function $l(o,s){if(We(o))return!1;var m=typeof o;return m=="number"||m=="symbol"||m=="boolean"||o==null||_n(o)?!0:Si.test(o)||!zn.test(o)||s!=null&&o in _t(s)}function zv(o){var s=typeof o;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?o!=="__proto__":o===null}function Ul(o){var s=es(o),m=B[s];if(typeof m!="function"||!(s in et.prototype))return!1;if(o===m)return!0;var O=Fl(m);return!!O&&o===O[0]}function Gv(o){return!!Pc&&Pc in o}var Yv=Pa?vr:ou;function Yo(o){var s=o&&o.constructor,m=typeof s=="function"&&s.prototype||zi;return o===m}function Rf(o){return o===o&&!Et(o)}function Mf(o,s){return function(m){return m==null?!1:m[o]===s&&(s!==e||o in _t(m))}}function Vv(o){var s=as(o,function(O){return m.size===g&&m.clear(),O}),m=s.cache;return s}function Kv(o,s){var m=o[1],O=s[1],D=m|O,q=D<(b|v|A),Y=O==A&&m==T||O==A&&m==R&&o[7].length<=s[8]||O==(A|R)&&s[7].length<=s[8]&&m==T;if(!(q||Y))return o;O&b&&(o[2]=s[2],D|=m&b?0:w);var Z=s[3];if(Z){var re=o[3];o[3]=re?pf(re,Z,s[4]):Z,o[4]=re?kr(o[3],p):s[4]}return Z=s[5],Z&&(re=o[5],o[5]=re?gf(re,Z,s[6]):Z,o[6]=re?kr(o[5],p):s[6]),Z=s[7],Z&&(o[7]=Z),O&A&&(o[8]=o[8]==null?s[8]:Qt(o[8],s[8])),o[9]==null&&(o[9]=s[9]),o[0]=s[0],o[1]=D,o}function Xv(o){var s=[];if(o!=null)for(var m in _t(o))s.push(m);return s}function Zv(o){return Ma.call(o)}function Df(o,s,m){return s=qt(s===e?o.length-1:s,0),function(){for(var O=arguments,D=-1,q=qt(O.length-s,0),Y=se(q);++D<q;)Y[D]=O[s+D];D=-1;for(var Z=se(s+1);++D<s;)Z[D]=O[D];return Z[s]=m(Y),jt(o,this,Z)}}function Lf(o,s){return s.length<2?o:ui(o,Rn(s,0,-1))}function Qv(o,s){for(var m=o.length,O=Qt(s.length,m),D=un(o);O--;){var q=s[O];o[O]=mr(q,m)?D[q]:e}return o}function Hl(o,s){if(!(s==="constructor"&&typeof o[s]=="function")&&s!="__proto__")return o[s]}var If=Bf(rf),Vo=dm||function(o,s){return Xe.setTimeout(o,s)},Wl=Bf(wv);function Nf(o,s,m){var O=s+"";return Wl(o,Hv(O,Jv(jv(O),m)))}function Bf(o){var s=0,m=0;return function(){var O=vm(),D=I-(O-m);if(m=O,D>0){if(++s>=P)return arguments[0]}else s=0;return o.apply(e,arguments)}}function ns(o,s){var m=-1,O=o.length,D=O-1;for(s=s===e?O:s;++m<s;){var q=El(m,D),Y=o[q];o[q]=o[m],o[m]=Y}return o.length=s,o}var Ff=Vv(function(o){var s=[];return o.charCodeAt(0)===46&&s.push(""),o.replace(Ln,function(m,O,D,q){s.push(D?q.replace(yo,"$1"):O||m)}),s});function Kn(o){if(typeof o=="string"||_n(o))return o;var s=o+"";return s=="0"&&1/o==-ee?"-0":s}function fi(o){if(o!=null){try{return Ra.call(o)}catch(s){}try{return o+""}catch(s){}}return""}function Jv(o,s){return An(ne,function(m){var O="_."+m[0];s&m[1]&&!Ea(o,O)&&o.push(O)}),o.sort()}function qf(o){if(o instanceof et)return o.clone();var s=new kn(o.__wrapped__,o.__chain__);return s.__actions__=un(o.__actions__),s.__index__=o.__index__,s.__values__=o.__values__,s}function ey(o,s,m){(m?an(o,s,m):s===e)?s=1:s=qt(Ge(s),0);var O=o==null?0:o.length;if(!O||s<1)return[];for(var D=0,q=0,Y=se(Fa(O/s));D<O;)Y[q++]=Rn(o,D,D+=s);return Y}function ty(o){for(var s=-1,m=o==null?0:o.length,O=0,D=[];++s<m;){var q=o[s];q&&(D[O++]=q)}return D}function ny(){var o=arguments.length;if(!o)return[];for(var s=se(o-1),m=arguments[0],O=o;O--;)s[O-1]=arguments[O];return Cr(We(m)?un(m):[m],Gt(s,1))}var ry=Ke(function(o,s){return Pt(o)?Uo(o,Gt(s,1,Pt,!0)):[]}),iy=Ke(function(o,s){var m=Mn(s);return Pt(m)&&(m=e),Pt(o)?Uo(o,Gt(s,1,Pt,!0),Ne(m,2)):[]}),oy=Ke(function(o,s){var m=Mn(s);return Pt(m)&&(m=e),Pt(o)?Uo(o,Gt(s,1,Pt,!0),e,m):[]});function ay(o,s,m){var O=o==null?0:o.length;return O?(s=m||s===e?1:Ge(s),Rn(o,s<0?0:s,O)):[]}function sy(o,s,m){var O=o==null?0:o.length;return O?(s=m||s===e?1:Ge(s),s=O-s,Rn(o,0,s<0?0:s)):[]}function ly(o,s){return o&&o.length?Va(o,Ne(s,3),!0,!0):[]}function uy(o,s){return o&&o.length?Va(o,Ne(s,3),!0):[]}function cy(o,s,m,O){var D=o==null?0:o.length;return D?(m&&typeof m!="number"&&an(o,s,m)&&(m=0,O=D),nv(o,s,m,O)):[]}function jf(o,s,m){var O=o==null?0:o.length;if(!O)return-1;var D=m==null?0:Ge(m);return D<0&&(D=qt(O+D,0)),Aa(o,Ne(s,3),D)}function $f(o,s,m){var O=o==null?0:o.length;if(!O)return-1;var D=O-1;return m!==e&&(D=Ge(m),D=m<0?qt(O+D,0):Qt(D,O-1)),Aa(o,Ne(s,3),D,!0)}function Uf(o){var s=o==null?0:o.length;return s?Gt(o,1):[]}function fy(o){var s=o==null?0:o.length;return s?Gt(o,ee):[]}function hy(o,s){var m=o==null?0:o.length;return m?(s=s===e?1:Ge(s),Gt(o,s)):[]}function dy(o){for(var s=-1,m=o==null?0:o.length,O={};++s<m;){var D=o[s];O[D[0]]=D[1]}return O}function Hf(o){return o&&o.length?o[0]:e}function py(o,s,m){var O=o==null?0:o.length;if(!O)return-1;var D=m==null?0:Ge(m);return D<0&&(D=qt(O+D,0)),$i(o,s,D)}function gy(o){var s=o==null?0:o.length;return s?Rn(o,0,-1):[]}var my=Ke(function(o){var s=St(o,Rl);return s.length&&s[0]===o[0]?wl(s):[]}),vy=Ke(function(o){var s=Mn(o),m=St(o,Rl);return s===Mn(m)?s=e:m.pop(),m.length&&m[0]===o[0]?wl(m,Ne(s,2)):[]}),yy=Ke(function(o){var s=Mn(o),m=St(o,Rl);return s=typeof s=="function"?s:e,s&&m.pop(),m.length&&m[0]===o[0]?wl(m,e,s):[]});function _y(o,s){return o==null?"":gm.call(o,s)}function Mn(o){var s=o==null?0:o.length;return s?o[s-1]:e}function by(o,s,m){var O=o==null?0:o.length;if(!O)return-1;var D=O;return m!==e&&(D=Ge(m),D=D<0?qt(O+D,0):Qt(D,O-1)),s===s?Jg(o,s,D):Aa(o,xc,D,!0)}function wy(o,s){return o&&o.length?Jc(o,Ge(s)):e}var xy=Ke(Wf);function Wf(o,s){return o&&o.length&&s&&s.length?Ol(o,s):o}function Ty(o,s,m){return o&&o.length&&s&&s.length?Ol(o,s,Ne(m,2)):o}function Sy(o,s,m){return o&&o.length&&s&&s.length?Ol(o,s,e,m):o}var Oy=gr(function(o,s){var m=o==null?0:o.length,O=vl(o,s);return nf(o,St(s,function(D){return mr(D,m)?+D:D}).sort(df)),O});function Ey(o,s){var m=[];if(!(o&&o.length))return m;var O=-1,D=[],q=o.length;for(s=Ne(s,3);++O<q;){var Y=o[O];s(Y,O,o)&&(m.push(Y),D.push(O))}return nf(o,D),m}function zl(o){return o==null?o:_m.call(o)}function Ay(o,s,m){var O=o==null?0:o.length;return O?(m&&typeof m!="number"&&an(o,s,m)?(s=0,m=O):(s=s==null?0:Ge(s),m=m===e?O:Ge(m)),Rn(o,s,m)):[]}function Cy(o,s){return Ya(o,s)}function ky(o,s,m){return Cl(o,s,Ne(m,2))}function Py(o,s){var m=o==null?0:o.length;if(m){var O=Ya(o,s);if(O<m&&qn(o[O],s))return O}return-1}function Ry(o,s){return Ya(o,s,!0)}function My(o,s,m){return Cl(o,s,Ne(m,2),!0)}function Dy(o,s){var m=o==null?0:o.length;if(m){var O=Ya(o,s,!0)-1;if(qn(o[O],s))return O}return-1}function Ly(o){return o&&o.length?of(o):[]}function Iy(o,s){return o&&o.length?of(o,Ne(s,2)):[]}function Ny(o){var s=o==null?0:o.length;return s?Rn(o,1,s):[]}function By(o,s,m){return o&&o.length?(s=m||s===e?1:Ge(s),Rn(o,0,s<0?0:s)):[]}function Fy(o,s,m){var O=o==null?0:o.length;return O?(s=m||s===e?1:Ge(s),s=O-s,Rn(o,s<0?0:s,O)):[]}function qy(o,s){return o&&o.length?Va(o,Ne(s,3),!1,!0):[]}function jy(o,s){return o&&o.length?Va(o,Ne(s,3)):[]}var $y=Ke(function(o){return Mr(Gt(o,1,Pt,!0))}),Uy=Ke(function(o){var s=Mn(o);return Pt(s)&&(s=e),Mr(Gt(o,1,Pt,!0),Ne(s,2))}),Hy=Ke(function(o){var s=Mn(o);return s=typeof s=="function"?s:e,Mr(Gt(o,1,Pt,!0),e,s)});function Wy(o){return o&&o.length?Mr(o):[]}function zy(o,s){return o&&o.length?Mr(o,Ne(s,2)):[]}function Gy(o,s){return s=typeof s=="function"?s:e,o&&o.length?Mr(o,e,s):[]}function Gl(o){if(!(o&&o.length))return[];var s=0;return o=Ar(o,function(m){if(Pt(m))return s=qt(m.length,s),!0}),ul(s,function(m){return St(o,al(m))})}function zf(o,s){if(!(o&&o.length))return[];var m=Gl(o);return s==null?m:St(m,function(O){return jt(s,e,O)})}var Yy=Ke(function(o,s){return Pt(o)?Uo(o,s):[]}),Vy=Ke(function(o){return Pl(Ar(o,Pt))}),Ky=Ke(function(o){var s=Mn(o);return Pt(s)&&(s=e),Pl(Ar(o,Pt),Ne(s,2))}),Xy=Ke(function(o){var s=Mn(o);return s=typeof s=="function"?s:e,Pl(Ar(o,Pt),e,s)}),Zy=Ke(Gl);function Qy(o,s){return uf(o||[],s||[],$o)}function Jy(o,s){return uf(o||[],s||[],zo)}var e0=Ke(function(o){var s=o.length,m=s>1?o[s-1]:e;return m=typeof m=="function"?(o.pop(),m):e,zf(o,m)});function Gf(o){var s=B(o);return s.__chain__=!0,s}function t0(o,s){return s(o),o}function rs(o,s){return s(o)}var n0=gr(function(o){var s=o.length,m=s?o[0]:0,O=this.__wrapped__,D=function(q){return vl(q,o)};return s>1||this.__actions__.length||!(O instanceof et)||!mr(m)?this.thru(D):(O=O.slice(m,+m+(s?1:0)),O.__actions__.push({func:rs,args:[D],thisArg:e}),new kn(O,this.__chain__).thru(function(q){return s&&!q.length&&q.push(e),q}))});function r0(){return Gf(this)}function i0(){return new kn(this.value(),this.__chain__)}function o0(){this.__values__===e&&(this.__values__=ah(this.value()));var o=this.__index__>=this.__values__.length,s=o?e:this.__values__[this.__index__++];return{done:o,value:s}}function a0(){return this}function s0(o){for(var s,m=this;m instanceof Ua;){var O=qf(m);O.__index__=0,O.__values__=e,s?D.__wrapped__=O:s=O;var D=O;m=m.__wrapped__}return D.__wrapped__=o,s}function l0(){var o=this.__wrapped__;if(o instanceof et){var s=o;return this.__actions__.length&&(s=new et(this)),s=s.reverse(),s.__actions__.push({func:rs,args:[zl],thisArg:e}),new kn(s,this.__chain__)}return this.thru(zl)}function u0(){return lf(this.__wrapped__,this.__actions__)}var c0=Ka(function(o,s,m){pt.call(o,m)?++o[m]:dr(o,m,1)});function f0(o,s,m){var O=We(o)?bc:tv;return m&&an(o,s,m)&&(s=e),O(o,Ne(s,3))}function h0(o,s){var m=We(o)?Ar:Wc;return m(o,Ne(s,3))}var d0=_f(jf),p0=_f($f);function g0(o,s){return Gt(is(o,s),1)}function m0(o,s){return Gt(is(o,s),ee)}function v0(o,s,m){return m=m===e?1:Ge(m),Gt(is(o,s),m)}function Yf(o,s){var m=We(o)?An:Rr;return m(o,Ne(s,3))}function Vf(o,s){var m=We(o)?Ng:Hc;return m(o,Ne(s,3))}var y0=Ka(function(o,s,m){pt.call(o,m)?o[m].push(s):dr(o,m,[s])});function _0(o,s,m,O){o=cn(o)?o:Ji(o),m=m&&!O?Ge(m):0;var D=o.length;return m<0&&(m=qt(D+m,0)),us(o)?m<=D&&o.indexOf(s,m)>-1:!!D&&$i(o,s,m)>-1}var b0=Ke(function(o,s,m){var O=-1,D=typeof s=="function",q=cn(o)?se(o.length):[];return Rr(o,function(Y){q[++O]=D?jt(s,Y,m):Ho(Y,s,m)}),q}),w0=Ka(function(o,s,m){dr(o,m,s)});function is(o,s){var m=We(o)?St:Xc;return m(o,Ne(s,3))}function x0(o,s,m,O){return o==null?[]:(We(s)||(s=s==null?[]:[s]),m=O?e:m,We(m)||(m=m==null?[]:[m]),ef(o,s,m))}var T0=Ka(function(o,s,m){o[m?0:1].push(s)},function(){return[[],[]]});function S0(o,s,m){var O=We(o)?il:Sc,D=arguments.length<3;return O(o,Ne(s,4),m,D,Rr)}function O0(o,s,m){var O=We(o)?Bg:Sc,D=arguments.length<3;return O(o,Ne(s,4),m,D,Hc)}function E0(o,s){var m=We(o)?Ar:Wc;return m(o,ss(Ne(s,3)))}function A0(o){var s=We(o)?qc:_v;return s(o)}function C0(o,s,m){(m?an(o,s,m):s===e)?s=1:s=Ge(s);var O=We(o)?Xm:bv;return O(o,s)}function k0(o){var s=We(o)?Zm:xv;return s(o)}function P0(o){if(o==null)return 0;if(cn(o))return us(o)?Hi(o):o.length;var s=Jt(o);return s==De||s==be?o.size:Tl(o).length}function R0(o,s,m){var O=We(o)?ol:Tv;return m&&an(o,s,m)&&(s=e),O(o,Ne(s,3))}var M0=Ke(function(o,s){if(o==null)return[];var m=s.length;return m>1&&an(o,s[0],s[1])?s=[]:m>2&&an(s[0],s[1],s[2])&&(s=[s[0]]),ef(o,Gt(s,1),[])}),os=hm||function(){return Xe.Date.now()};function D0(o,s){if(typeof s!="function")throw new Cn(c);return o=Ge(o),function(){if(--o<1)return s.apply(this,arguments)}}function Kf(o,s,m){return s=m?e:s,s=o&&s==null?o.length:s,pr(o,A,e,e,e,e,s)}function Xf(o,s){var m;if(typeof s!="function")throw new Cn(c);return o=Ge(o),function(){return--o>0&&(m=s.apply(this,arguments)),o<=1&&(s=e),m}}var Yl=Ke(function(o,s,m){var O=b;if(m.length){var D=kr(m,Zi(Yl));O|=S}return pr(o,O,s,m,D)}),Zf=Ke(function(o,s,m){var O=b|v;if(m.length){var D=kr(m,Zi(Zf));O|=S}return pr(s,O,o,m,D)});function Qf(o,s,m){s=m?e:s;var O=pr(o,T,e,e,e,e,e,s);return O.placeholder=Qf.placeholder,O}function Jf(o,s,m){s=m?e:s;var O=pr(o,x,e,e,e,e,e,s);return O.placeholder=Jf.placeholder,O}function eh(o,s,m){var O,D,q,Y,Z,re,ge=0,me=!1,ye=!1,xe=!0;if(typeof o!="function")throw new Cn(c);s=Dn(s)||0,Et(m)&&(me=!!m.leading,ye="maxWait"in m,q=ye?qt(Dn(m.maxWait)||0,s):q,xe="trailing"in m?!!m.trailing:xe);function ke(Rt){var jn=O,_r=D;return O=D=e,ge=Rt,Y=o.apply(_r,jn),Y}function Fe(Rt){return ge=Rt,Z=Vo(Qe,s),me?ke(Rt):Y}function Ye(Rt){var jn=Rt-re,_r=Rt-ge,_h=s-jn;return ye?Qt(_h,q-_r):_h}function qe(Rt){var jn=Rt-re,_r=Rt-ge;return re===e||jn>=s||jn<0||ye&&_r>=q}function Qe(){var Rt=os();if(qe(Rt))return it(Rt);Z=Vo(Qe,Ye(Rt))}function it(Rt){return Z=e,xe&&O?ke(Rt):(O=D=e,Y)}function bn(){Z!==e&&cf(Z),ge=0,O=re=D=Z=e}function sn(){return Z===e?Y:it(os())}function wn(){var Rt=os(),jn=qe(Rt);if(O=arguments,D=this,re=Rt,jn){if(Z===e)return Fe(re);if(ye)return cf(Z),Z=Vo(Qe,s),ke(re)}return Z===e&&(Z=Vo(Qe,s)),Y}return wn.cancel=bn,wn.flush=sn,wn}var L0=Ke(function(o,s){return Uc(o,1,s)}),I0=Ke(function(o,s,m){return Uc(o,Dn(s)||0,m)});function N0(o){return pr(o,L)}function as(o,s){if(typeof o!="function"||s!=null&&typeof s!="function")throw new Cn(c);var m=function(){var O=arguments,D=s?s.apply(this,O):O[0],q=m.cache;if(q.has(D))return q.get(D);var Y=o.apply(this,O);return m.cache=q.set(D,Y)||q,Y};return m.cache=new(as.Cache||hr),m}as.Cache=hr;function ss(o){if(typeof o!="function")throw new Cn(c);return function(){var s=arguments;switch(s.length){case 0:return!o.call(this);case 1:return!o.call(this,s[0]);case 2:return!o.call(this,s[0],s[1]);case 3:return!o.call(this,s[0],s[1],s[2])}return!o.apply(this,s)}}function B0(o){return Xf(2,o)}var F0=Sv(function(o,s){s=s.length==1&&We(s[0])?St(s[0],vn(Ne())):St(Gt(s,1),vn(Ne()));var m=s.length;return Ke(function(O){for(var D=-1,q=Qt(O.length,m);++D<q;)O[D]=s[D].call(this,O[D]);return jt(o,this,O)})}),Vl=Ke(function(o,s){var m=kr(s,Zi(Vl));return pr(o,S,e,s,m)}),th=Ke(function(o,s){var m=kr(s,Zi(th));return pr(o,C,e,s,m)}),q0=gr(function(o,s){return pr(o,R,e,e,e,s)});function j0(o,s){if(typeof o!="function")throw new Cn(c);return s=s===e?s:Ge(s),Ke(o,s)}function $0(o,s){if(typeof o!="function")throw new Cn(c);return s=s==null?0:qt(Ge(s),0),Ke(function(m){var O=m[s],D=Lr(m,0,s);return O&&Cr(D,O),jt(o,this,D)})}function U0(o,s,m){var O=!0,D=!0;if(typeof o!="function")throw new Cn(c);return Et(m)&&(O="leading"in m?!!m.leading:O,D="trailing"in m?!!m.trailing:D),eh(o,s,{leading:O,maxWait:s,trailing:D})}function H0(o){return Kf(o,1)}function W0(o,s){return Vl(Ml(s),o)}function z0(){if(!arguments.length)return[];var o=arguments[0];return We(o)?o:[o]}function G0(o){return Pn(o,f)}function Y0(o,s){return s=typeof s=="function"?s:e,Pn(o,f,s)}function V0(o){return Pn(o,a|f)}function K0(o,s){return s=typeof s=="function"?s:e,Pn(o,a|f,s)}function X0(o,s){return s==null||$c(o,s,$t(s))}function qn(o,s){return o===s||o!==o&&s!==s}var Z0=Ja(bl),Q0=Ja(function(o,s){return o>=s}),hi=Yc(function(){return arguments}())?Yc:function(o){return Ct(o)&&pt.call(o,"callee")&&!Dc.call(o,"callee")},We=se.isArray,J0=Lt?vn(Lt):sv;function cn(o){return o!=null&&ls(o.length)&&!vr(o)}function Pt(o){return Ct(o)&&cn(o)}function e_(o){return o===!0||o===!1||Ct(o)&&on(o)==ie}var Ir=pm||ou,t_=Nn?vn(Nn):lv;function n_(o){return Ct(o)&&o.nodeType===1&&!Ko(o)}function r_(o){if(o==null)return!0;if(cn(o)&&(We(o)||typeof o=="string"||typeof o.splice=="function"||Ir(o)||Qi(o)||hi(o)))return!o.length;var s=Jt(o);if(s==De||s==be)return!o.size;if(Yo(o))return!Tl(o).length;for(var m in o)if(pt.call(o,m))return!1;return!0}function i_(o,s){return Wo(o,s)}function o_(o,s,m){m=typeof m=="function"?m:e;var O=m?m(o,s):e;return O===e?Wo(o,s,e,m):!!O}function Kl(o){if(!Ct(o))return!1;var s=on(o);return s==we||s==de||typeof o.message=="string"&&typeof o.name=="string"&&!Ko(o)}function a_(o){return typeof o=="number"&&Ic(o)}function vr(o){if(!Et(o))return!1;var s=on(o);return s==Pe||s==Me||s==Q||s==he}function nh(o){return typeof o=="number"&&o==Ge(o)}function ls(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=oe}function Et(o){var s=typeof o;return o!=null&&(s=="object"||s=="function")}function Ct(o){return o!=null&&typeof o=="object"}var rh=En?vn(En):cv;function s_(o,s){return o===s||xl(o,s,ql(s))}function l_(o,s,m){return m=typeof m=="function"?m:e,xl(o,s,ql(s),m)}function u_(o){return ih(o)&&o!=+o}function c_(o){if(Yv(o))throw new He(l);return Vc(o)}function f_(o){return o===null}function h_(o){return o==null}function ih(o){return typeof o=="number"||Ct(o)&&on(o)==ze}function Ko(o){if(!Ct(o)||on(o)!=Je)return!1;var s=Ia(o);if(s===null)return!0;var m=pt.call(s,"constructor")&&s.constructor;return typeof m=="function"&&m instanceof m&&Ra.call(m)==lm}var Xl=Gn?vn(Gn):fv;function d_(o){return nh(o)&&o>=-oe&&o<=oe}var oh=Lo?vn(Lo):hv;function us(o){return typeof o=="string"||!We(o)&&Ct(o)&&on(o)==ve}function _n(o){return typeof o=="symbol"||Ct(o)&&on(o)==Be}var Qi=ii?vn(ii):dv;function p_(o){return o===e}function g_(o){return Ct(o)&&Jt(o)==Ee}function m_(o){return Ct(o)&&on(o)==$e}var v_=Ja(Sl),y_=Ja(function(o,s){return o<=s});function ah(o){if(!o)return[];if(cn(o))return us(o)?Bn(o):un(o);if(No&&o[No])return Xg(o[No]());var s=Jt(o),m=s==De?fl:s==be?Ca:Ji;return m(o)}function yr(o){if(!o)return o===0?o:0;if(o=Dn(o),o===ee||o===-ee){var s=o<0?-1:1;return s*V}return o===o?o:0}function Ge(o){var s=yr(o),m=s%1;return s===s?m?s-m:s:0}function sh(o){return o?li(Ge(o),0,N):0}function Dn(o){if(typeof o=="number")return o;if(_n(o))return $;if(Et(o)){var s=typeof o.valueOf=="function"?o.valueOf():o;o=Et(s)?s+"":s}if(typeof o!="string")return o===0?o:+o;o=Oc(o);var m=wo.test(o);return m||To.test(o)?Re(o.slice(2),m?2:8):bo.test(o)?$:+o}function lh(o){return Vn(o,fn(o))}function __(o){return o?li(Ge(o),-oe,oe):o===0?o:0}function ft(o){return o==null?"":yn(o)}var b_=Ki(function(o,s){if(Yo(s)||cn(s)){Vn(s,$t(s),o);return}for(var m in s)pt.call(s,m)&&$o(o,m,s[m])}),uh=Ki(function(o,s){Vn(s,fn(s),o)}),cs=Ki(function(o,s,m,O){Vn(s,fn(s),o,O)}),w_=Ki(function(o,s,m,O){Vn(s,$t(s),o,O)}),x_=gr(vl);function T_(o,s){var m=Vi(o);return s==null?m:jc(m,s)}var S_=Ke(function(o,s){o=_t(o);var m=-1,O=s.length,D=O>2?s[2]:e;for(D&&an(s[0],s[1],D)&&(O=1);++m<O;)for(var q=s[m],Y=fn(q),Z=-1,re=Y.length;++Z<re;){var ge=Y[Z],me=o[ge];(me===e||qn(me,zi[ge])&&!pt.call(o,ge))&&(o[ge]=q[ge])}return o}),O_=Ke(function(o){return o.push(e,Ef),jt(ch,e,o)});function E_(o,s){return wc(o,Ne(s,3),Yn)}function A_(o,s){return wc(o,Ne(s,3),_l)}function C_(o,s){return o==null?o:yl(o,Ne(s,3),fn)}function k_(o,s){return o==null?o:zc(o,Ne(s,3),fn)}function P_(o,s){return o&&Yn(o,Ne(s,3))}function R_(o,s){return o&&_l(o,Ne(s,3))}function M_(o){return o==null?[]:za(o,$t(o))}function D_(o){return o==null?[]:za(o,fn(o))}function Zl(o,s,m){var O=o==null?e:ui(o,s);return O===e?m:O}function L_(o,s){return o!=null&&kf(o,s,rv)}function Ql(o,s){return o!=null&&kf(o,s,iv)}var I_=wf(function(o,s,m){s!=null&&typeof s.toString!="function"&&(s=Ma.call(s)),o[s]=m},eu(hn)),N_=wf(function(o,s,m){s!=null&&typeof s.toString!="function"&&(s=Ma.call(s)),pt.call(o,s)?o[s].push(m):o[s]=[m]},Ne),B_=Ke(Ho);function $t(o){return cn(o)?Fc(o):Tl(o)}function fn(o){return cn(o)?Fc(o,!0):pv(o)}function F_(o,s){var m={};return s=Ne(s,3),Yn(o,function(O,D,q){dr(m,s(O,D,q),O)}),m}function q_(o,s){var m={};return s=Ne(s,3),Yn(o,function(O,D,q){dr(m,D,s(O,D,q))}),m}var j_=Ki(function(o,s,m){Ga(o,s,m)}),ch=Ki(function(o,s,m,O){Ga(o,s,m,O)}),$_=gr(function(o,s){var m={};if(o==null)return m;var O=!1;s=St(s,function(q){return q=Dr(q,o),O||(O=q.length>1),q}),Vn(o,Bl(o),m),O&&(m=Pn(m,a|u|f,Iv));for(var D=s.length;D--;)kl(m,s[D]);return m});function U_(o,s){return fh(o,ss(Ne(s)))}var H_=gr(function(o,s){return o==null?{}:mv(o,s)});function fh(o,s){if(o==null)return{};var m=St(Bl(o),function(O){return[O]});return s=Ne(s),tf(o,m,function(O,D){return s(O,D[0])})}function W_(o,s,m){s=Dr(s,o);var O=-1,D=s.length;for(D||(D=1,o=e);++O<D;){var q=o==null?e:o[Kn(s[O])];q===e&&(O=D,q=m),o=vr(q)?q.call(o):q}return o}function z_(o,s,m){return o==null?o:zo(o,s,m)}function G_(o,s,m,O){return O=typeof O=="function"?O:e,o==null?o:zo(o,s,m,O)}var hh=Sf($t),dh=Sf(fn);function Y_(o,s,m){var O=We(o),D=O||Ir(o)||Qi(o);if(s=Ne(s,4),m==null){var q=o&&o.constructor;D?m=O?new q:[]:Et(o)?m=vr(q)?Vi(Ia(o)):{}:m={}}return(D?An:Yn)(o,function(Y,Z,re){return s(m,Y,Z,re)}),m}function V_(o,s){return o==null?!0:kl(o,s)}function K_(o,s,m){return o==null?o:sf(o,s,Ml(m))}function X_(o,s,m,O){return O=typeof O=="function"?O:e,o==null?o:sf(o,s,Ml(m),O)}function Ji(o){return o==null?[]:cl(o,$t(o))}function Z_(o){return o==null?[]:cl(o,fn(o))}function Q_(o,s,m){return m===e&&(m=s,s=e),m!==e&&(m=Dn(m),m=m===m?m:0),s!==e&&(s=Dn(s),s=s===s?s:0),li(Dn(o),s,m)}function J_(o,s,m){return s=yr(s),m===e?(m=s,s=0):m=yr(m),o=Dn(o),ov(o,s,m)}function eb(o,s,m){if(m&&typeof m!="boolean"&&an(o,s,m)&&(s=m=e),m===e&&(typeof s=="boolean"?(m=s,s=e):typeof o=="boolean"&&(m=o,o=e)),o===e&&s===e?(o=0,s=1):(o=yr(o),s===e?(s=o,o=0):s=yr(s)),o>s){var O=o;o=s,s=O}if(m||o%1||s%1){var D=Nc();return Qt(o+D*(s-o+Ue("1e-"+((D+"").length-1))),s)}return El(o,s)}var tb=Xi(function(o,s,m){return s=s.toLowerCase(),o+(m?ph(s):s)});function ph(o){return Jl(ft(o).toLowerCase())}function gh(o){return o=ft(o),o&&o.replace(Xt,zg).replace(Do,"")}function nb(o,s,m){o=ft(o),s=yn(s);var O=o.length;m=m===e?O:li(Ge(m),0,O);var D=m;return m-=s.length,m>=0&&o.slice(m,D)==s}function rb(o){return o=ft(o),o&&ir.test(o)?o.replace(Wn,Gg):o}function ib(o){return o=ft(o),o&&po.test(o)?o.replace(Vr,"\\$&"):o}var ob=Xi(function(o,s,m){return o+(m?"-":"")+s.toLowerCase()}),ab=Xi(function(o,s,m){return o+(m?" ":"")+s.toLowerCase()}),sb=yf("toLowerCase");function lb(o,s,m){o=ft(o),s=Ge(s);var O=s?Hi(o):0;if(!s||O>=s)return o;var D=(s-O)/2;return Qa(qa(D),m)+o+Qa(Fa(D),m)}function ub(o,s,m){o=ft(o),s=Ge(s);var O=s?Hi(o):0;return s&&O<s?o+Qa(s-O,m):o}function cb(o,s,m){o=ft(o),s=Ge(s);var O=s?Hi(o):0;return s&&O<s?Qa(s-O,m)+o:o}function fb(o,s,m){return m||s==null?s=0:s&&(s=+s),ym(ft(o).replace(Kr,""),s||0)}function hb(o,s,m){return(m?an(o,s,m):s===e)?s=1:s=Ge(s),Al(ft(o),s)}function db(){var o=arguments,s=ft(o[0]);return o.length<3?s:s.replace(o[1],o[2])}var pb=Xi(function(o,s,m){return o+(m?"_":"")+s.toLowerCase()});function gb(o,s,m){return m&&typeof m!="number"&&an(o,s,m)&&(s=m=e),m=m===e?N:m>>>0,m?(o=ft(o),o&&(typeof s=="string"||s!=null&&!Xl(s))&&(s=yn(s),!s&&Ui(o))?Lr(Bn(o),0,m):o.split(s,m)):[]}var mb=Xi(function(o,s,m){return o+(m?" ":"")+Jl(s)});function vb(o,s,m){return o=ft(o),m=m==null?0:li(Ge(m),0,o.length),s=yn(s),o.slice(m,m+s.length)==s}function yb(o,s,m){var O=B.templateSettings;m&&an(o,s,m)&&(s=e),o=ft(o),s=cs({},s,O,Of);var D=cs({},s.imports,O.imports,Of),q=$t(D),Y=cl(D,q),Z,re,ge=0,me=s.interpolate||wr,ye="__p += '",xe=hl((s.escape||wr).source+"|"+me.source+"|"+(me===br?_o:wr).source+"|"+(s.evaluate||wr).source+"|$","g"),ke="//# sourceURL="+(pt.call(s,"sourceURL")?(s.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ri+"]")+`
`;o.replace(xe,function(qe,Qe,it,bn,sn,wn){return it||(it=bn),ye+=o.slice(ge,wn).replace(Oo,Yg),Qe&&(Z=!0,ye+=`' +
__e(`+Qe+`) +
'`),sn&&(re=!0,ye+=`';
`+sn+`;
__p += '`),it&&(ye+=`' +
((__t = (`+it+`)) == null ? '' : __t) +
'`),ge=wn+qe.length,qe}),ye+=`';
`;var Fe=pt.call(s,"variable")&&s.variable;if(!Fe)ye=`with (obj) {
`+ye+`
}
`;else if(vo.test(Fe))throw new He(h);ye=(re?ye.replace(Ze,""):ye).replace(yt,"$1").replace(Ht,"$1;"),ye="function("+(Fe||"obj")+`) {
`+(Fe?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(Z?", __e = _.escape":"")+(re?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+ye+`return __p
}`;var Ye=vh(function(){return lt(q,ke+"return "+ye).apply(e,Y)});if(Ye.source=ye,Kl(Ye))throw Ye;return Ye}function _b(o){return ft(o).toLowerCase()}function bb(o){return ft(o).toUpperCase()}function wb(o,s,m){if(o=ft(o),o&&(m||s===e))return Oc(o);if(!o||!(s=yn(s)))return o;var O=Bn(o),D=Bn(s),q=Ec(O,D),Y=Ac(O,D)+1;return Lr(O,q,Y).join("")}function xb(o,s,m){if(o=ft(o),o&&(m||s===e))return o.slice(0,kc(o)+1);if(!o||!(s=yn(s)))return o;var O=Bn(o),D=Ac(O,Bn(s))+1;return Lr(O,0,D).join("")}function Tb(o,s,m){if(o=ft(o),o&&(m||s===e))return o.replace(Kr,"");if(!o||!(s=yn(s)))return o;var O=Bn(o),D=Ec(O,Bn(s));return Lr(O,D).join("")}function Sb(o,s){var m=M,O=k;if(Et(s)){var D="separator"in s?s.separator:D;m="length"in s?Ge(s.length):m,O="omission"in s?yn(s.omission):O}o=ft(o);var q=o.length;if(Ui(o)){var Y=Bn(o);q=Y.length}if(m>=q)return o;var Z=m-Hi(O);if(Z<1)return O;var re=Y?Lr(Y,0,Z).join(""):o.slice(0,Z);if(D===e)return re+O;if(Y&&(Z+=re.length-Z),Xl(D)){if(o.slice(Z).search(D)){var ge,me=re;for(D.global||(D=hl(D.source,ft(Bt.exec(D))+"g")),D.lastIndex=0;ge=D.exec(me);)var ye=ge.index;re=re.slice(0,ye===e?Z:ye)}}else if(o.indexOf(yn(D),Z)!=Z){var xe=re.lastIndexOf(D);xe>-1&&(re=re.slice(0,xe))}return re+O}function Ob(o){return o=ft(o),o&&zr.test(o)?o.replace(Kt,em):o}var Eb=Xi(function(o,s,m){return o+(m?" ":"")+s.toUpperCase()}),Jl=yf("toUpperCase");function mh(o,s,m){return o=ft(o),s=m?e:s,s===e?Kg(o)?rm(o):jg(o):o.match(s)||[]}var vh=Ke(function(o,s){try{return jt(o,e,s)}catch(m){return Kl(m)?m:new He(m)}}),Ab=gr(function(o,s){return An(s,function(m){m=Kn(m),dr(o,m,Yl(o[m],o))}),o});function Cb(o){var s=o==null?0:o.length,m=Ne();return o=s?St(o,function(O){if(typeof O[1]!="function")throw new Cn(c);return[m(O[0]),O[1]]}):[],Ke(function(O){for(var D=-1;++D<s;){var q=o[D];if(jt(q[0],this,O))return jt(q[1],this,O)}})}function kb(o){return ev(Pn(o,a))}function eu(o){return function(){return o}}function Pb(o,s){return o==null||o!==o?s:o}var Rb=bf(),Mb=bf(!0);function hn(o){return o}function tu(o){return Kc(typeof o=="function"?o:Pn(o,a))}function Db(o){return Zc(Pn(o,a))}function Lb(o,s){return Qc(o,Pn(s,a))}var Ib=Ke(function(o,s){return function(m){return Ho(m,o,s)}}),Nb=Ke(function(o,s){return function(m){return Ho(o,m,s)}});function nu(o,s,m){var O=$t(s),D=za(s,O);m==null&&!(Et(s)&&(D.length||!O.length))&&(m=s,s=o,o=this,D=za(s,$t(s)));var q=!(Et(m)&&"chain"in m)||!!m.chain,Y=vr(o);return An(D,function(Z){var re=s[Z];o[Z]=re,Y&&(o.prototype[Z]=function(){var ge=this.__chain__;if(q||ge){var me=o(this.__wrapped__),ye=me.__actions__=un(this.__actions__);return ye.push({func:re,args:arguments,thisArg:o}),me.__chain__=ge,me}return re.apply(o,Cr([this.value()],arguments))})}),o}function Bb(){return Xe._===this&&(Xe._=um),this}function ru(){}function Fb(o){return o=Ge(o),Ke(function(s){return Jc(s,o)})}var qb=Ll(St),jb=Ll(bc),$b=Ll(ol);function yh(o){return $l(o)?al(Kn(o)):vv(o)}function Ub(o){return function(s){return o==null?e:ui(o,s)}}var Hb=xf(),Wb=xf(!0);function iu(){return[]}function ou(){return!1}function zb(){return{}}function Gb(){return""}function Yb(){return!0}function Vb(o,s){if(o=Ge(o),o<1||o>oe)return[];var m=N,O=Qt(o,N);s=Ne(s),o-=N;for(var D=ul(O,s);++m<o;)s(m);return D}function Kb(o){return We(o)?St(o,Kn):_n(o)?[o]:un(Ff(ft(o)))}function Xb(o){var s=++sm;return ft(o)+s}var Zb=Za(function(o,s){return o+s},0),Qb=Il("ceil"),Jb=Za(function(o,s){return o/s},1),e1=Il("floor");function t1(o){return o&&o.length?Wa(o,hn,bl):e}function n1(o,s){return o&&o.length?Wa(o,Ne(s,2),bl):e}function r1(o){return Tc(o,hn)}function i1(o,s){return Tc(o,Ne(s,2))}function o1(o){return o&&o.length?Wa(o,hn,Sl):e}function a1(o,s){return o&&o.length?Wa(o,Ne(s,2),Sl):e}var s1=Za(function(o,s){return o*s},1),l1=Il("round"),u1=Za(function(o,s){return o-s},0);function c1(o){return o&&o.length?ll(o,hn):0}function f1(o,s){return o&&o.length?ll(o,Ne(s,2)):0}return B.after=D0,B.ary=Kf,B.assign=b_,B.assignIn=uh,B.assignInWith=cs,B.assignWith=w_,B.at=x_,B.before=Xf,B.bind=Yl,B.bindAll=Ab,B.bindKey=Zf,B.castArray=z0,B.chain=Gf,B.chunk=ey,B.compact=ty,B.concat=ny,B.cond=Cb,B.conforms=kb,B.constant=eu,B.countBy=c0,B.create=T_,B.curry=Qf,B.curryRight=Jf,B.debounce=eh,B.defaults=S_,B.defaultsDeep=O_,B.defer=L0,B.delay=I0,B.difference=ry,B.differenceBy=iy,B.differenceWith=oy,B.drop=ay,B.dropRight=sy,B.dropRightWhile=ly,B.dropWhile=uy,B.fill=cy,B.filter=h0,B.flatMap=g0,B.flatMapDeep=m0,B.flatMapDepth=v0,B.flatten=Uf,B.flattenDeep=fy,B.flattenDepth=hy,B.flip=N0,B.flow=Rb,B.flowRight=Mb,B.fromPairs=dy,B.functions=M_,B.functionsIn=D_,B.groupBy=y0,B.initial=gy,B.intersection=my,B.intersectionBy=vy,B.intersectionWith=yy,B.invert=I_,B.invertBy=N_,B.invokeMap=b0,B.iteratee=tu,B.keyBy=w0,B.keys=$t,B.keysIn=fn,B.map=is,B.mapKeys=F_,B.mapValues=q_,B.matches=Db,B.matchesProperty=Lb,B.memoize=as,B.merge=j_,B.mergeWith=ch,B.method=Ib,B.methodOf=Nb,B.mixin=nu,B.negate=ss,B.nthArg=Fb,B.omit=$_,B.omitBy=U_,B.once=B0,B.orderBy=x0,B.over=qb,B.overArgs=F0,B.overEvery=jb,B.overSome=$b,B.partial=Vl,B.partialRight=th,B.partition=T0,B.pick=H_,B.pickBy=fh,B.property=yh,B.propertyOf=Ub,B.pull=xy,B.pullAll=Wf,B.pullAllBy=Ty,B.pullAllWith=Sy,B.pullAt=Oy,B.range=Hb,B.rangeRight=Wb,B.rearg=q0,B.reject=E0,B.remove=Ey,B.rest=j0,B.reverse=zl,B.sampleSize=C0,B.set=z_,B.setWith=G_,B.shuffle=k0,B.slice=Ay,B.sortBy=M0,B.sortedUniq=Ly,B.sortedUniqBy=Iy,B.split=gb,B.spread=$0,B.tail=Ny,B.take=By,B.takeRight=Fy,B.takeRightWhile=qy,B.takeWhile=jy,B.tap=t0,B.throttle=U0,B.thru=rs,B.toArray=ah,B.toPairs=hh,B.toPairsIn=dh,B.toPath=Kb,B.toPlainObject=lh,B.transform=Y_,B.unary=H0,B.union=$y,B.unionBy=Uy,B.unionWith=Hy,B.uniq=Wy,B.uniqBy=zy,B.uniqWith=Gy,B.unset=V_,B.unzip=Gl,B.unzipWith=zf,B.update=K_,B.updateWith=X_,B.values=Ji,B.valuesIn=Z_,B.without=Yy,B.words=mh,B.wrap=W0,B.xor=Vy,B.xorBy=Ky,B.xorWith=Xy,B.zip=Zy,B.zipObject=Qy,B.zipObjectDeep=Jy,B.zipWith=e0,B.entries=hh,B.entriesIn=dh,B.extend=uh,B.extendWith=cs,nu(B,B),B.add=Zb,B.attempt=vh,B.camelCase=tb,B.capitalize=ph,B.ceil=Qb,B.clamp=Q_,B.clone=G0,B.cloneDeep=V0,B.cloneDeepWith=K0,B.cloneWith=Y0,B.conformsTo=X0,B.deburr=gh,B.defaultTo=Pb,B.divide=Jb,B.endsWith=nb,B.eq=qn,B.escape=rb,B.escapeRegExp=ib,B.every=f0,B.find=d0,B.findIndex=jf,B.findKey=E_,B.findLast=p0,B.findLastIndex=$f,B.findLastKey=A_,B.floor=e1,B.forEach=Yf,B.forEachRight=Vf,B.forIn=C_,B.forInRight=k_,B.forOwn=P_,B.forOwnRight=R_,B.get=Zl,B.gt=Z0,B.gte=Q0,B.has=L_,B.hasIn=Ql,B.head=Hf,B.identity=hn,B.includes=_0,B.indexOf=py,B.inRange=J_,B.invoke=B_,B.isArguments=hi,B.isArray=We,B.isArrayBuffer=J0,B.isArrayLike=cn,B.isArrayLikeObject=Pt,B.isBoolean=e_,B.isBuffer=Ir,B.isDate=t_,B.isElement=n_,B.isEmpty=r_,B.isEqual=i_,B.isEqualWith=o_,B.isError=Kl,B.isFinite=a_,B.isFunction=vr,B.isInteger=nh,B.isLength=ls,B.isMap=rh,B.isMatch=s_,B.isMatchWith=l_,B.isNaN=u_,B.isNative=c_,B.isNil=h_,B.isNull=f_,B.isNumber=ih,B.isObject=Et,B.isObjectLike=Ct,B.isPlainObject=Ko,B.isRegExp=Xl,B.isSafeInteger=d_,B.isSet=oh,B.isString=us,B.isSymbol=_n,B.isTypedArray=Qi,B.isUndefined=p_,B.isWeakMap=g_,B.isWeakSet=m_,B.join=_y,B.kebabCase=ob,B.last=Mn,B.lastIndexOf=by,B.lowerCase=ab,B.lowerFirst=sb,B.lt=v_,B.lte=y_,B.max=t1,B.maxBy=n1,B.mean=r1,B.meanBy=i1,B.min=o1,B.minBy=a1,B.stubArray=iu,B.stubFalse=ou,B.stubObject=zb,B.stubString=Gb,B.stubTrue=Yb,B.multiply=s1,B.nth=wy,B.noConflict=Bb,B.noop=ru,B.now=os,B.pad=lb,B.padEnd=ub,B.padStart=cb,B.parseInt=fb,B.random=eb,B.reduce=S0,B.reduceRight=O0,B.repeat=hb,B.replace=db,B.result=W_,B.round=l1,B.runInContext=te,B.sample=A0,B.size=P0,B.snakeCase=pb,B.some=R0,B.sortedIndex=Cy,B.sortedIndexBy=ky,B.sortedIndexOf=Py,B.sortedLastIndex=Ry,B.sortedLastIndexBy=My,B.sortedLastIndexOf=Dy,B.startCase=mb,B.startsWith=vb,B.subtract=u1,B.sum=c1,B.sumBy=f1,B.template=yb,B.times=Vb,B.toFinite=yr,B.toInteger=Ge,B.toLength=sh,B.toLower=_b,B.toNumber=Dn,B.toSafeInteger=__,B.toString=ft,B.toUpper=bb,B.trim=wb,B.trimEnd=xb,B.trimStart=Tb,B.truncate=Sb,B.unescape=Ob,B.uniqueId=Xb,B.upperCase=Eb,B.upperFirst=Jl,B.each=Yf,B.eachRight=Vf,B.first=Hf,nu(B,function(){var o={};return Yn(B,function(s,m){pt.call(B.prototype,m)||(o[m]=s)}),o}(),{chain:!1}),B.VERSION=n,An(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){B[o].placeholder=B}),An(["drop","take"],function(o,s){et.prototype[o]=function(m){m=m===e?1:qt(Ge(m),0);var O=this.__filtered__&&!s?new et(this):this.clone();return O.__filtered__?O.__takeCount__=Qt(m,O.__takeCount__):O.__views__.push({size:Qt(m,N),type:o+(O.__dir__<0?"Right":"")}),O},et.prototype[o+"Right"]=function(m){return this.reverse()[o](m).reverse()}}),An(["filter","map","takeWhile"],function(o,s){var m=s+1,O=m==j||m==J;et.prototype[o]=function(D){var q=this.clone();return q.__iteratees__.push({iteratee:Ne(D,3),type:m}),q.__filtered__=q.__filtered__||O,q}}),An(["head","last"],function(o,s){var m="take"+(s?"Right":"");et.prototype[o]=function(){return this[m](1).value()[0]}}),An(["initial","tail"],function(o,s){var m="drop"+(s?"":"Right");et.prototype[o]=function(){return this.__filtered__?new et(this):this[m](1)}}),et.prototype.compact=function(){return this.filter(hn)},et.prototype.find=function(o){return this.filter(o).head()},et.prototype.findLast=function(o){return this.reverse().find(o)},et.prototype.invokeMap=Ke(function(o,s){return typeof o=="function"?new et(this):this.map(function(m){return Ho(m,o,s)})}),et.prototype.reject=function(o){return this.filter(ss(Ne(o)))},et.prototype.slice=function(o,s){o=Ge(o);var m=this;return m.__filtered__&&(o>0||s<0)?new et(m):(o<0?m=m.takeRight(-o):o&&(m=m.drop(o)),s!==e&&(s=Ge(s),m=s<0?m.dropRight(-s):m.take(s-o)),m)},et.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},et.prototype.toArray=function(){return this.take(N)},Yn(et.prototype,function(o,s){var m=/^(?:filter|find|map|reject)|While$/.test(s),O=/^(?:head|last)$/.test(s),D=B[O?"take"+(s=="last"?"Right":""):s],q=O||/^find/.test(s);D&&(B.prototype[s]=function(){var Y=this.__wrapped__,Z=O?[1]:arguments,re=Y instanceof et,ge=Z[0],me=re||We(Y),ye=function(Qe){var it=D.apply(B,Cr([Qe],Z));return O&&xe?it[0]:it};me&&m&&typeof ge=="function"&&ge.length!=1&&(re=me=!1);var xe=this.__chain__,ke=!!this.__actions__.length,Fe=q&&!xe,Ye=re&&!ke;if(!q&&me){Y=Ye?Y:new et(this);var qe=o.apply(Y,Z);return qe.__actions__.push({func:rs,args:[ye],thisArg:e}),new kn(qe,xe)}return Fe&&Ye?o.apply(this,Z):(qe=this.thru(ye),Fe?O?qe.value()[0]:qe.value():qe)})}),An(["pop","push","shift","sort","splice","unshift"],function(o){var s=ka[o],m=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",O=/^(?:pop|shift)$/.test(o);B.prototype[o]=function(){var D=arguments;if(O&&!this.__chain__){var q=this.value();return s.apply(We(q)?q:[],D)}return this[m](function(Y){return s.apply(We(Y)?Y:[],D)})}}),Yn(et.prototype,function(o,s){var m=B[s];if(m){var O=m.name+"";pt.call(Yi,O)||(Yi[O]=[]),Yi[O].push({name:s,func:m})}}),Yi[Xa(e,v).name]=[{name:"wrapper",func:e}],et.prototype.clone=Om,et.prototype.reverse=Em,et.prototype.value=Am,B.prototype.at=n0,B.prototype.chain=r0,B.prototype.commit=i0,B.prototype.next=o0,B.prototype.plant=s0,B.prototype.reverse=l0,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=u0,B.prototype.first=B.prototype.head,No&&(B.prototype[No]=a0),B},Wi=im();Tt?((Tt.exports=Wi)._=Wi,ot._=Wi):Xe._=Wi}).call(bt)})(ks,ks.exports);var cA=ks.exports;function U1(r,t){return r[13]=1,r[14]=t>>8,r[15]=t&255,r[16]=t>>8,r[17]=t&255,r}const op=112,ap=72,sp=89,lp=115;let uu;function H1(){const r=new Int32Array(256);for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;r[t]=e}return r}function W1(r){let t=-1;uu||(uu=H1());for(let e=0;e<r.length;e++)t=uu[(t^r[e])&255]^t>>>8;return t^-1}function z1(r){const t=r.length-1;for(let e=t;e>=4;e--)if(r[e-4]===9&&r[e-3]===op&&r[e-2]===ap&&r[e-1]===sp&&r[e]===lp)return e-3;return 0}function G1(r,t,e=!1){const n=new Uint8Array(13);t*=39.3701,n[0]=op,n[1]=ap,n[2]=sp,n[3]=lp,n[4]=t>>>24,n[5]=t>>>16,n[6]=t>>>8,n[7]=t&255,n[8]=n[4],n[9]=n[5],n[10]=n[6],n[11]=n[7],n[12]=1;const i=W1(n),l=new Uint8Array(4);if(l[0]=i>>>24,l[1]=i>>>16,l[2]=i>>>8,l[3]=i&255,e){const c=z1(r);return r.set(n,c),r.set(l,c+13),r}else{const c=new Uint8Array(4);c[0]=0,c[1]=0,c[2]=0,c[3]=9;const h=new Uint8Array(54);return h.set(r,0),h.set(c,33),h.set(n,37),h.set(l,50),h}}const Y1="AAlwSFlz",V1="AAAJcEhZ",K1="AAAACXBI";function X1(r){let t=r.indexOf(Y1);return t===-1&&(t=r.indexOf(V1)),t===-1&&(t=r.indexOf(K1)),t}const up="[modern-screenshot]",$r=typeof window!="undefined",Z1=$r&&"Worker"in window,Q1=$r&&"atob"in window,J1=$r&&"btoa"in window;var md;const ec=$r?(md=window.navigator)==null?void 0:md.userAgent:"",cp=ec.includes("Chrome"),Ps=ec.includes("AppleWebKit")&&!cp,tc=ec.includes("Firefox"),ew=r=>r&&"__CONTEXT__"in r,tw=r=>r.constructor.name==="CSSFontFaceRule",nw=r=>r.constructor.name==="CSSImportRule",tr=r=>r.nodeType===1,va=r=>typeof r.className=="object",fp=r=>r.tagName==="image",rw=r=>r.tagName==="use",ca=r=>tr(r)&&typeof r.style!="undefined"&&!va(r),iw=r=>r.nodeType===8,ow=r=>r.nodeType===3,so=r=>r.tagName==="IMG",Us=r=>r.tagName==="VIDEO",aw=r=>r.tagName==="CANVAS",sw=r=>r.tagName==="TEXTAREA",lw=r=>r.tagName==="INPUT",uw=r=>r.tagName==="STYLE",cw=r=>r.tagName==="SCRIPT",fw=r=>r.tagName==="SELECT",hw=r=>r.tagName==="SLOT",dw=r=>r.tagName==="IFRAME",pw=(...r)=>console.warn(up,...r);function gw(r){var e;const t=(e=r==null?void 0:r.createElement)==null?void 0:e.call(r,"canvas");return t&&(t.height=t.width=1),!!t&&"toDataURL"in t&&!!t.toDataURL("image/webp").includes("image/webp")}const ku=r=>r.startsWith("data:");function hp(r,t){if(r.match(/^[a-z]+:\/\//i))return r;if($r&&r.match(/^\/\//))return window.location.protocol+r;if(r.match(/^[a-z]+:/i)||!$r)return r;const e=Hs().implementation.createHTMLDocument(),n=e.createElement("base"),i=e.createElement("a");return e.head.appendChild(n),e.body.appendChild(i),t&&(n.href=t),i.href=r,i.href}function Hs(r){var t;return(t=r&&tr(r)?r==null?void 0:r.ownerDocument:r)!=null?t:window.document}const Ws="http://www.w3.org/2000/svg";function mw(r,t,e){const n=Hs(e).createElementNS(Ws,"svg");return n.setAttributeNS(null,"width",r.toString()),n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"viewBox",`0 0 ${r} ${t}`),n}function vw(r,t){let e=new XMLSerializer().serializeToString(r);return t&&(e=e.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function yw(r,t){return new Promise((e,n)=>{const i=new FileReader;i.onload=()=>e(i.result),i.onerror=()=>n(i.error),i.onabort=()=>n(new Error(`Failed read blob to ${t}`)),i.readAsDataURL(r)})}const _w=r=>yw(r,"dataUrl");function io(r,t){const e=Hs(t).createElement("img");return e.decoding="sync",e.loading="eager",e.src=r,e}function fa(r,t){return new Promise(e=>{const{timeout:n,ownerDocument:i,onError:l,onWarn:c}=t!=null?t:{},h=typeof r=="string"?io(r,Hs(i)):r;let d=null,g=null;function p(){e(h),d&&clearTimeout(d),g==null||g()}if(n&&(d=setTimeout(p,n)),Us(h)){const a=h.currentSrc||h.src;if(!a)return h.poster?fa(h.poster,t).then(e):p();if(h.readyState>=2)return p();const u=p,f=y=>{c==null||c("Failed video load",a,y),l==null||l(y),p()};g=()=>{h.removeEventListener("loadeddata",u),h.removeEventListener("error",f)},h.addEventListener("loadeddata",u,{once:!0}),h.addEventListener("error",f,{once:!0})}else{const a=fp(h)?h.href.baseVal:h.currentSrc||h.src;if(!a)return p();const u=()=>tt(this,null,function*(){if(so(h)&&"decode"in h)try{yield h.decode()}catch(y){c==null||c("Failed to decode image, trying to render anyway",h.dataset.originalSrc||a,y)}p()}),f=y=>{c==null||c("Failed image load",h.dataset.originalSrc||a,y),p()};if(so(h)&&h.complete)return u();g=()=>{h.removeEventListener("load",u),h.removeEventListener("error",f)},h.addEventListener("load",u,{once:!0}),h.addEventListener("error",f,{once:!0})}})}function bw(r,t){return tt(this,null,function*(){ca(r)&&(so(r)||Us(r)?yield fa(r,t):yield Promise.all(["img","video"].flatMap(e=>Array.from(r.querySelectorAll(e)).map(n=>fa(n,t)))))})}const dp=function(){let t=0;const e=()=>`0000${(Math.random()*dn(36,4)<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)}();function pp(r){return r==null?void 0:r.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}let Ph=0;function ww(r){const t=`${up}[#${Ph}]`;return Ph++,{time:e=>r&&console.time(`${t} ${e}`),timeEnd:e=>r&&console.timeEnd(`${t} ${e}`),warn:(...e)=>r&&pw(...e)}}function xw(r){return{cache:r?"no-cache":"force-cache"}}function zs(r,t){return tt(this,null,function*(){return ew(r)?r:Tw(r,Ut(st({},t),{autoDestruct:!0}))})}function Tw(r,t){return tt(this,null,function*(){var f,y,_,b,v;const{scale:e=1,workerUrl:n,workerNumber:i=1}=t||{},l=!!(t!=null&&t.debug),c=(f=t==null?void 0:t.features)!=null?f:!0,h=(y=r.ownerDocument)!=null?y:$r?window.document:void 0,d=(b=(_=r.ownerDocument)==null?void 0:_.defaultView)!=null?b:$r?window:void 0,g=new Map,p=Ut(st({width:0,height:0,quality:1,type:"image/png",scale:e,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:l,fetch:st({requestInit:xw((v=t==null?void 0:t.fetch)==null?void 0:v.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1},t==null?void 0:t.fetch),fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:i,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1},t),{__CONTEXT__:!0,log:ww(l),node:r,ownerDocument:h,ownerWindow:d,dpi:e===1?null:96*e,svgStyleElement:gp(h),svgDefsElement:h==null?void 0:h.createElementNS(Ws,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Z1&&n&&i?i:0})].map(()=>{try{const w=new Worker(n);return w.onmessage=T=>tt(this,null,function*(){var C,A,R,L;const{url:x,result:S}=T.data;S?(A=(C=g.get(x))==null?void 0:C.resolve)==null||A.call(C,S):(L=(R=g.get(x))==null?void 0:R.reject)==null||L.call(R,new Error(`Error receiving message from worker: ${x}`))}),w.onmessageerror=T=>{var S,C;const{url:x}=T.data;(C=(S=g.get(x))==null?void 0:S.reject)==null||C.call(S,new Error(`Error receiving message from worker: ${x}`))},w}catch(w){return p.log.warn("Failed to new Worker",w),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[gw(h)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:g,drawImageCount:0,tasks:[],features:c,isEnable:w=>{var T,x;return w==="restoreScrollPosition"?typeof c=="boolean"?!1:(T=c[w])!=null?T:!1:typeof c=="boolean"?c:(x=c[w])!=null?x:!0},shadowRoots:[]});p.log.time("wait until load"),yield bw(r,{timeout:p.timeout,onWarn:p.log.warn}),p.log.timeEnd("wait until load");const{width:a,height:u}=Sw(r,p);return p.width=a,p.height=u,p})}function gp(r){if(!r)return;const t=r.createElement("style"),e=t.ownerDocument.createTextNode(`
.______background-clip--text {
background-clip: text;
-webkit-background-clip: text;
}
`);return t.appendChild(e),t}function Sw(r,t){let{width:e,height:n}=t;if(tr(r)&&(!e||!n)){const i=r.getBoundingClientRect();e=e||i.width||Number(r.getAttribute("width"))||0,n=n||i.height||Number(r.getAttribute("height"))||0}return{width:e,height:n}}function Ow(r,t){return tt(this,null,function*(){const{log:e,timeout:n,drawImageCount:i,drawImageInterval:l}=t;e.time("image to canvas");const c=yield fa(r,{timeout:n,onWarn:t.log.warn}),{canvas:h,context2d:d}=Ew(r.ownerDocument,t),g=()=>{try{d==null||d.drawImage(c,0,0,h.width,h.height)}catch(p){t.log.warn("Failed to drawImage",p)}};if(g(),t.isEnable("fixSvgXmlDecode"))for(let p=0;p<i;p++)yield new Promise(a=>{setTimeout(()=>{d==null||d.clearRect(0,0,h.width,h.height),g(),a()},p+l)});return t.drawImageCount=0,e.timeEnd("image to canvas"),h})}function Ew(r,t){const{width:e,height:n,scale:i,backgroundColor:l,maximumCanvasSize:c}=t,h=r.createElement("canvas");h.width=Math.floor(e*i),h.height=Math.floor(n*i),h.style.width=`${e}px`,h.style.height=`${n}px`,c&&(h.width>c||h.height>c)&&(h.width>c&&h.height>c?h.width>h.height?(h.height*=c/h.width,h.width=c):(h.width*=c/h.height,h.height=c):h.width>c?(h.height*=c/h.width,h.width=c):(h.width*=c/h.height,h.height=c));const d=h.getContext("2d");return d&&l&&(d.fillStyle=l,d.fillRect(0,0,h.width,h.height)),{canvas:h,context2d:d}}function mp(r,t){if(r.ownerDocument)try{const l=r.toDataURL();if(l!=="data:,")return io(l,r.ownerDocument)}catch(l){t.log.warn("Failed to clone canvas",l)}const e=r.cloneNode(!1),n=r.getContext("2d"),i=e.getContext("2d");try{return n&&i&&i.putImageData(n.getImageData(0,0,r.width,r.height),0,0),e}catch(l){t.log.warn("Failed to clone canvas",l)}return e}function Aw(r,t){var e;try{if((e=r==null?void 0:r.contentDocument)!=null&&e.body)return nc(r.contentDocument.body,t)}catch(n){t.log.warn("Failed to clone iframe",n)}return r.cloneNode(!1)}function Cw(r){const t=r.cloneNode(!1);return r.currentSrc&&r.currentSrc!==r.src&&(t.src=r.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager"),t}function kw(r,t){return tt(this,null,function*(){if(r.ownerDocument&&!r.currentSrc&&r.poster)return io(r.poster,r.ownerDocument);const e=r.cloneNode(!1);e.crossOrigin="anonymous",r.currentSrc&&r.currentSrc!==r.src&&(e.src=r.currentSrc);const n=e.ownerDocument;if(n){let i=!0;if(yield fa(e,{onError:()=>i=!1,onWarn:t.log.warn}),!i)return r.poster?io(r.poster,r.ownerDocument):e;e.currentTime=r.currentTime,yield new Promise(c=>{e.addEventListener("seeked",c,{once:!0})});const l=n.createElement("canvas");l.width=r.offsetWidth,l.height=r.offsetHeight;try{const c=l.getContext("2d");c&&c.drawImage(e,0,0,l.width,l.height)}catch(c){return t.log.warn("Failed to clone video",c),r.poster?io(r.poster,r.ownerDocument):e}return mp(l,t)}return e})}function Pw(r,t){return aw(r)?mp(r,t):dw(r)?Aw(r,t):so(r)?Cw(r):Us(r)?kw(r,t):r.cloneNode(!1)}function Rw(r){let t=r.sandbox;if(!t){const{ownerDocument:e}=r;try{e&&(t=e.createElement("iframe"),t.id=`__SANDBOX__${dp()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",e.body.appendChild(t),t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',r.sandbox=t)}catch(n){r.log.warn("Failed to getSandBox",n)}}return t}const Mw=["width","height","-webkit-text-fill-color"],Dw=["stroke","fill"];function vp(r,t,e){const{defaultComputedStyles:n}=e,i=r.nodeName.toLowerCase(),l=va(r)&&i!=="svg",c=l?Dw.map(_=>[_,r.getAttribute(_)]).filter(([,_])=>_!==null):[],h=[l&&"svg",i,c.map((_,b)=>`${_}=${b}`).join(","),t].filter(Boolean).join(":");if(n.has(h))return n.get(h);const d=Rw(e),g=d==null?void 0:d.contentWindow;if(!g)return new Map;const p=g==null?void 0:g.document;let a,u;l?(a=p.createElementNS(Ws,"svg"),u=a.ownerDocument.createElementNS(a.namespaceURI,i),c.forEach(([_,b])=>{u.setAttributeNS(null,_,b)}),a.appendChild(u)):a=u=p.createElement(i),u.textContent=" ",p.body.appendChild(a);const f=g.getComputedStyle(u,t),y=new Map;for(let _=f.length,b=0;b<_;b++){const v=f.item(b);Mw.includes(v)||y.set(v,f.getPropertyValue(v))}return p.body.removeChild(a),n.set(h,y),y}function yp(r,t,e){var h;const n=new Map,i=[],l=new Map;if(e)for(const d of e)c(d);else for(let d=r.length,g=0;g<d;g++){const p=r.item(g);c(p)}for(let d=i.length,g=0;g<d;g++)(h=l.get(i[g]))==null||h.forEach((p,a)=>n.set(a,p));function c(d){const g=r.getPropertyValue(d),p=r.getPropertyPriority(d),a=d.lastIndexOf("-"),u=a>-1?d.substring(0,a):void 0;if(u){let f=l.get(u);f||(f=new Map,l.set(u,f)),f.set(d,[g,p])}t.get(d)===g&&!p||(u?i.push(u):n.set(d,[g,p]))}return n}function Lw(r,t,e,n){var a,u,f,y;const{ownerWindow:i,includeStyleProperties:l,currentParentNodeStyle:c}=n,h=t.style,d=i.getComputedStyle(r),g=vp(r,null,n);c==null||c.forEach((_,b)=>{g.delete(b)});const p=yp(d,g,l);p.delete("transition-property"),p.delete("all"),p.delete("d"),p.delete("content"),e&&(p.delete("margin-top"),p.delete("margin-right"),p.delete("margin-bottom"),p.delete("margin-left"),p.delete("margin-block-start"),p.delete("margin-block-end"),p.delete("margin-inline-start"),p.delete("margin-inline-end"),p.set("box-sizing",["border-box",""])),((a=p.get("background-clip"))==null?void 0:a[0])==="text"&&t.classList.add("______background-clip--text"),cp&&(p.has("font-kerning")||p.set("font-kerning",["normal",""]),(((u=p.get("overflow-x"))==null?void 0:u[0])==="hidden"||((f=p.get("overflow-y"))==null?void 0:f[0])==="hidden")&&((y=p.get("text-overflow"))==null?void 0:y[0])==="ellipsis"&&r.scrollWidth===r.clientWidth&&p.set("text-overflow",["clip",""]));for(let _=h.length,b=0;b<_;b++)h.removeProperty(h.item(b));return p.forEach(([_,b],v)=>{h.setProperty(v,_,b)}),p}function Iw(r,t){(sw(r)||lw(r)||fw(r))&&t.setAttribute("value",r.value)}const Nw=[":before",":after"],Bw=[":-webkit-scrollbar",":-webkit-scrollbar-button",":-webkit-scrollbar-thumb",":-webkit-scrollbar-track",":-webkit-scrollbar-track-piece",":-webkit-scrollbar-corner",":-webkit-resizer"];function Fw(r,t,e,n,i){const{ownerWindow:l,svgStyleElement:c,svgStyles:h,currentNodeStyle:d}=n;if(!c||!l)return;function g(p){var T;const a=l.getComputedStyle(r,p);let u=a.getPropertyValue("content");if(!u||u==="none")return;i==null||i(u),u=u.replace(/(')|(")|(counter\(.+\))/g,"");const f=[dp()],y=vp(r,p,n);d==null||d.forEach((x,S)=>{y.delete(S)});const _=yp(a,y,n.includeStyleProperties);_.delete("content"),_.delete("-webkit-locale"),((T=_.get("background-clip"))==null?void 0:T[0])==="text"&&t.classList.add("______background-clip--text");const b=[`content: '${u}';`];if(_.forEach(([x,S],C)=>{b.push(`${C}: ${x}${S?" !important":""};`)}),b.length===1)return;try{t.className=[t.className,...f].join(" ")}catch(x){n.log.warn("Failed to copyPseudoClass",x);return}const v=b.join(`
`);let w=h.get(v);w||(w=[],h.set(v,w)),w.push(`.${f[0]}:${p}`)}Nw.forEach(g),e&&Bw.forEach(g)}const Rh=new Set(["symbol"]);function Mh(r,t,e,n,i){return tt(this,null,function*(){if(tr(e)&&(uw(e)||cw(e))||n.filter&&!n.filter(e))return;Rh.has(t.nodeName)||Rh.has(e.nodeName)?n.currentParentNodeStyle=void 0:n.currentParentNodeStyle=n.currentNodeStyle;const l=yield nc(e,n,!1,i);n.isEnable("restoreScrollPosition")&&qw(r,l),t.appendChild(l)})}function Dh(r,t,e,n){return tt(this,null,function*(){var l;let i=r.firstChild;tr(r)&&r.shadowRoot&&(i=(l=r.shadowRoot)==null?void 0:l.firstChild,e.shadowRoots.push(r.shadowRoot));for(let c=i;c;c=c.nextSibling)if(!iw(c))if(tr(c)&&hw(c)&&typeof c.assignedNodes=="function"){const h=c.assignedNodes();for(let d=0;d<h.length;d++)yield Mh(r,t,h[d],e,n)}else yield Mh(r,t,c,e,n)})}function qw(r,t){if(!ca(r)||!ca(t))return;const{scrollTop:e,scrollLeft:n}=r;if(!e&&!n)return;const{transform:i}=t.style,l=new DOMMatrix(i),{a:c,b:h,c:d,d:g}=l;l.a=1,l.b=0,l.c=0,l.d=1,l.translateSelf(-n,-e),l.a=c,l.b=h,l.c=d,l.d=g,t.style.transform=l.toString()}function jw(r,t){const{backgroundColor:e,width:n,height:i,style:l}=t,c=r.style;if(e&&c.setProperty("background-color",e,"important"),n&&c.setProperty("width",`${n}px`,"important"),i&&c.setProperty("height",`${i}px`,"important"),l)for(const h in l)c[h]=l[h]}const $w=/^[\w-:]+$/;function nc(r,t,e=!1,n){return tt(this,null,function*(){var g,p,a,u;const{ownerDocument:i,ownerWindow:l,fontFamilies:c,onCloneEachNode:h}=t;if(i&&ow(r))return n&&/\S/.test(r.data)&&n(r.data),i.createTextNode(r.data);if(i&&l&&tr(r)&&(ca(r)||va(r))){const f=yield Pw(r,t);if(t.isEnable("removeAbnormalAttributes")){const T=f.getAttributeNames();for(let x=T.length,S=0;S<x;S++){const C=T[S];$w.test(C)||f.removeAttribute(C)}}const y=t.currentNodeStyle=Lw(r,f,e,t);e&&jw(f,t);let _=!1;if(t.isEnable("copyScrollbar")){const T=[(g=y.get("overflow-x"))==null?void 0:g[0],(p=y.get("overflow-y"))==null?void 0:p[0]];_=T.includes("scroll")||(T.includes("auto")||T.includes("overlay"))&&(r.scrollHeight>r.clientHeight||r.scrollWidth>r.clientWidth)}const b=(a=y.get("text-transform"))==null?void 0:a[0],v=pp((u=y.get("font-family"))==null?void 0:u[0]),w=v?T=>{b==="uppercase"?T=T.toUpperCase():b==="lowercase"?T=T.toLowerCase():b==="capitalize"&&(T=T[0].toUpperCase()+T.substring(1)),v.forEach(x=>{let S=c.get(x);S||c.set(x,S=new Set),T.split("").forEach(C=>S.add(C))})}:void 0;return Fw(r,f,_,t,w),Iw(r,f),Us(r)||(yield Dh(r,f,t,w)),yield h==null?void 0:h(f),f}const d=r.cloneNode(!1);return yield Dh(r,d,t),yield h==null?void 0:h(d),d})}function Uw(r){if(r.ownerDocument=void 0,r.ownerWindow=void 0,r.svgStyleElement=void 0,r.svgDefsElement=void 0,r.svgStyles.clear(),r.defaultComputedStyles.clear(),r.sandbox){try{r.sandbox.remove()}catch(t){r.log.warn("Failed to destroyContext",t)}r.sandbox=void 0}r.workers=[],r.fontFamilies.clear(),r.fontCssTexts.clear(),r.requests.clear(),r.tasks=[],r.shadowRoots=[]}function Hw(r){const h=r,{url:t,timeout:e,responseType:n}=h,i=hs(h,["url","timeout","responseType"]),l=new AbortController,c=e?setTimeout(()=>l.abort(),e):void 0;return fetch(t,st({signal:l.signal},i)).then(d=>{if(!d.ok)throw new Error("Failed fetch, not 2xx response",{cause:d});switch(n){case"arrayBuffer":return d.arrayBuffer();case"dataUrl":return d.blob().then(_w);case"text":default:return d.text()}}).finally(()=>clearTimeout(c))}function ha(r,t){const{url:e,requestType:n="text",responseType:i="text",imageDom:l}=t;let c=e;const{timeout:h,acceptOfImage:d,requests:g,fetchFn:p,fetch:{requestInit:a,bypassingCache:u,placeholderImage:f},font:y,workers:_,fontFamilies:b}=r;n==="image"&&(Ps||tc)&&r.drawImageCount++;let v=g.get(e);if(!v){u&&u instanceof RegExp&&u.test(c)&&(c+=(/\?/.test(c)?"&":"?")+new Date().getTime());const w=n.startsWith("font")&&y&&y.minify,T=new Set;w&&n.split(";")[1].split(",").forEach(A=>{b.has(A)&&b.get(A).forEach(R=>T.add(R))});const x=w&&T.size,S=st({url:c,timeout:h,responseType:x?"arrayBuffer":i,headers:n==="image"?{accept:d}:void 0},a);v={type:n,resolve:void 0,reject:void 0,response:null},v.response=tt(this,null,function*(){if(p&&n==="image"){const C=yield p(e);if(C)return C}return!Ps&&e.startsWith("http")&&_.length?new Promise((C,A)=>{_[g.size&_.length-1].postMessage(st({rawUrl:e},S)),v.resolve=C,v.reject=A}):Hw(S)}).catch(C=>{if(g.delete(e),n==="image"&&f)return r.log.warn("Failed to fetch image base64, trying to use placeholder image",c),typeof f=="string"?f:f(l);throw C}),g.set(e,v)}return v.response}function _p(r,t,e,n){return tt(this,null,function*(){if(!bp(r))return r;for(const[i,l]of Ww(r,t))try{const c=yield ha(e,{url:l,requestType:n?"image":"text",responseType:"dataUrl"});r=r.replace(zw(i),`$1${c}$3`)}catch(c){e.log.warn("Failed to fetch css data url",i,c)}return r})}function bp(r){return/url\((['"]?)([^'"]+?)\1\)/.test(r)}const wp=/url\((['"]?)([^'"]+?)\1\)/g;function Ww(r,t){const e=[];return r.replace(wp,(n,i,l)=>(e.push([l,hp(l,t)]),n)),e.filter(([n])=>!ku(n))}function zw(r){const t=r.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}const Gw=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function Yw(r,t){return Gw.map(e=>{const n=r.getPropertyValue(e);return!n||n==="none"?null:((Ps||tc)&&t.drawImageCount++,_p(n,null,t,!0).then(i=>{!i||n===i||r.setProperty(e,i,r.getPropertyPriority(e))}))}).filter(Boolean)}function Vw(r,t){if(so(r)){const e=r.currentSrc||r.src;if(!ku(e))return[ha(t,{url:e,imageDom:r,requestType:"image",responseType:"dataUrl"}).then(n=>{n&&(r.srcset="",r.dataset.originalSrc=e,r.src=n||"")})];(Ps||tc)&&t.drawImageCount++}else if(va(r)&&!ku(r.href.baseVal)){const e=r.href.baseVal;return[ha(t,{url:e,imageDom:r,requestType:"image",responseType:"dataUrl"}).then(n=>{n&&(r.dataset.originalSrc=e,r.href.baseVal=n||"")})]}return[]}function Kw(r,t){var h;const{ownerDocument:e,svgDefsElement:n}=t,i=(h=r.getAttribute("href"))!=null?h:r.getAttribute("xlink:href");if(!i)return[];const[l,c]=i.split("#");if(c){const d=`#${c}`,g=t.shadowRoots.reduce((p,a)=>p!=null?p:a.querySelector(`svg ${d}`),e==null?void 0:e.querySelector(`svg ${d}`));if(l&&r.setAttribute("href",d),n!=null&&n.querySelector(d))return[];if(g)return n==null||n.appendChild(g.cloneNode(!0)),[];if(l)return[ha(t,{url:l,responseType:"text"}).then(p=>{n==null||n.insertAdjacentHTML("beforeend",p)})]}return[]}function xp(r,t){const{tasks:e}=t;tr(r)&&((so(r)||fp(r))&&e.push(...Vw(r,t)),rw(r)&&e.push(...Kw(r,t))),ca(r)&&e.push(...Yw(r.style,t)),r.childNodes.forEach(n=>{xp(n,t)})}function Xw(r,t){return tt(this,null,function*(){const{ownerDocument:e,svgStyleElement:n,fontFamilies:i,fontCssTexts:l,tasks:c,font:h}=t;if(!(!e||!n||!i.size))if(h&&h.cssText){const d=Ih(h.cssText,t);n.appendChild(e.createTextNode(`${d}
`))}else{const d=Array.from(e.styleSheets).filter(p=>{try{return"cssRules"in p&&!!p.cssRules.length}catch(a){return t.log.warn(`Error while reading CSS rules from ${p.href}`,a),!1}});yield Promise.all(d.flatMap(p=>Array.from(p.cssRules).map((a,u)=>tt(this,null,function*(){if(nw(a)){let f=u+1;const y=a.href;let _="";try{_=yield ha(t,{url:y,requestType:"text",responseType:"text"})}catch(v){t.log.warn(`Error fetch remote css import from ${y}`,v)}const b=_.replace(wp,(v,w,T)=>v.replace(T,hp(T,y)));for(const v of Qw(b))try{p.insertRule(v,v.startsWith("@import")?f+=1:p.cssRules.length)}catch(w){t.log.warn("Error inserting rule from remote css import",{rule:v,error:w})}}})))),d.flatMap(p=>Array.from(p.cssRules)).filter(p=>{var a;return tw(p)&&bp(p.style.getPropertyValue("src"))&&((a=pp(p.style.getPropertyValue("font-family")))==null?void 0:a.some(u=>i.has(u)))}).forEach(p=>{const a=p,u=l.get(a.cssText);u?n.appendChild(e.createTextNode(`${u}
`)):c.push(_p(a.cssText,a.parentStyleSheet?a.parentStyleSheet.href:null,t).then(f=>{f=Ih(f,t),l.set(a.cssText,f),n.appendChild(e.createTextNode(`${f}
`))}))})}})}const Zw=/(\/\*[\s\S]*?\*\/)/g,Lh=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function Qw(r){if(r==null)return[];const t=[];let e=r.replace(Zw,"");for(;;){const l=Lh.exec(e);if(!l)break;t.push(l[0])}e=e.replace(Lh,"");const n=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let l=n.exec(e);if(l)i.lastIndex=n.lastIndex;else if(l=i.exec(e),l)n.lastIndex=i.lastIndex;else break;t.push(l[0])}return t}const Jw=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ex=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Ih(r,t){const{font:e}=t,n=e?e==null?void 0:e.preferredFormat:void 0;return n?r.replace(ex,i=>{for(;;){const[l,,c]=Jw.exec(i)||[];if(!c)return"";if(c===n)return`src: ${l};`}}):r}function tx(r,t){return tt(this,null,function*(){const e=yield zs(r,t);if(tr(e.node)&&va(e.node))return e.node;const{ownerDocument:n,log:i,tasks:l,svgStyleElement:c,svgDefsElement:h,svgStyles:d,font:g,progress:p,autoDestruct:a,onCloneNode:u,onEmbedNode:f,onCreateForeignObjectSvg:y}=e;i.time("clone node");const _=yield nc(e.node,e,!0);if(c&&n){let x="";d.forEach((S,C)=>{x+=`${S.join(`,
`)} {
${C}
}
`}),c.appendChild(n.createTextNode(x))}i.timeEnd("clone node"),yield u==null?void 0:u(_),g!==!1&&tr(_)&&(i.time("embed web font"),yield Xw(_,e),i.timeEnd("embed web font")),i.time("embed node"),xp(_,e);const b=l.length;let v=0;const w=()=>tt(this,null,function*(){for(;;){const x=l.pop();if(!x)break;try{yield x}catch(S){e.log.warn("Failed to run task",S)}p==null||p(++v,b)}});p==null||p(v,b),yield Promise.all([...Array.from({length:4})].map(w)),i.timeEnd("embed node"),yield f==null?void 0:f(_);const T=nx(_,e);return h&&T.insertBefore(h,T.children[0]),c&&T.insertBefore(c,T.children[0]),a&&Uw(e),yield y==null?void 0:y(T),T})}function nx(r,t){const{width:e,height:n}=t,i=mw(e,n,r.ownerDocument),l=i.ownerDocument.createElementNS(i.namespaceURI,"foreignObject");return l.setAttributeNS(null,"x","0%"),l.setAttributeNS(null,"y","0%"),l.setAttributeNS(null,"width","100%"),l.setAttributeNS(null,"height","100%"),l.append(r),i.appendChild(l),i}function rx(r,t){return tt(this,null,function*(){var c;const e=yield zs(r,t),n=yield tx(e),i=vw(n,e.isEnable("removeControlCharacter"));e.autoDestruct||(e.svgStyleElement=gp(e.ownerDocument),e.svgDefsElement=(c=e.ownerDocument)==null?void 0:c.createElementNS(Ws,"defs"),e.svgStyles.clear());const l=io(i,n.ownerDocument);return yield Ow(l,e)})}function ix(r,t){return tt(this,null,function*(){const e=yield zs(r,t),{log:n,quality:i,type:l,dpi:c}=e,h=yield rx(e);n.time("canvas to data url");let d=h.toDataURL(l,i);if(["image/png","image/jpeg"].includes(l)&&c&&Q1&&J1){const[g,p]=d.split(",");let a=0,u=!1;if(l==="image/png"){const T=X1(p);T>=0?(a=Math.ceil((T+28)/3)*4,u=!0):a=33/3*4}else l==="image/jpeg"&&(a=18/3*4);const f=p.substring(0,a),y=p.substring(a),_=window.atob(f),b=new Uint8Array(_.length);for(let T=0;T<b.length;T++)b[T]=_.charCodeAt(T);const v=l==="image/png"?G1(b,c,u):U1(b,c),w=window.btoa(String.fromCharCode(...v));d=[g,",",w,y].join("")}return n.timeEnd("canvas to data url"),d})}function fA(r,t){return tt(this,null,function*(){return ix(yield zs(r,Ut(st({},t),{type:"image/png"})))})}function cu(r){if(r===null||typeof r!="object")return!1;const t=Object.getPrototypeOf(r);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in r?!1:Symbol.toStringTag in r?Object.prototype.toString.call(r)==="[object Module]":!0}function Pu(r,t,e=".",n){if(!cu(t))return Pu(r,{},e,n);const i=Object.assign({},t);for(const l in r){if(l==="__proto__"||l==="constructor")continue;const c=r[l];c!=null&&(n&&n(i,l,c,e)||(Array.isArray(c)&&Array.isArray(i[l])?i[l]=[...c,...i[l]]:cu(c)&&cu(i[l])?i[l]=Pu(c,i[l],(e?`${e}.`:"")+l.toString(),n):i[l]=c))}return i}function ox(r){return(...t)=>t.reduce((e,n)=>Pu(e,n,"",r),{})}const hA=ox(),Tp=1/60*1e3,ax=typeof performance!="undefined"?()=>performance.now():()=>Date.now(),Sp=typeof window!="undefined"?r=>window.requestAnimationFrame(r):r=>setTimeout(()=>r(ax()),Tp);function sx(r){let t=[],e=[],n=0,i=!1,l=!1;const c=new WeakSet,h={schedule:(d,g=!1,p=!1)=>{const a=p&&i,u=a?t:e;return g&&c.add(d),u.indexOf(d)===-1&&(u.push(d),a&&i&&(n=t.length)),d},cancel:d=>{const g=e.indexOf(d);g!==-1&&e.splice(g,1),c.delete(d)},process:d=>{if(i){l=!0;return}if(i=!0,[t,e]=[e,t],e.length=0,n=t.length,n)for(let g=0;g<n;g++){const p=t[g];p(d),c.has(p)&&(h.schedule(p),r())}i=!1,l&&(l=!1,h.process(d))}};return h}const lx=40;let Ru=!0,da=!1,Mu=!1;const oo={delta:0,timestamp:0},ya=["read","update","preRender","render","postRender"],Gs=ya.reduce((r,t)=>(r[t]=sx(()=>da=!0),r),{}),ux=ya.reduce((r,t)=>{const e=Gs[t];return r[t]=(n,i=!1,l=!1)=>(da||hx(),e.schedule(n,i,l)),r},{}),cx=ya.reduce((r,t)=>(r[t]=Gs[t].cancel,r),{});ya.reduce((r,t)=>(r[t]=()=>Gs[t].process(oo),r),{});const fx=r=>Gs[r].process(oo),Op=r=>{da=!1,oo.delta=Ru?Tp:Math.max(Math.min(r-oo.timestamp,lx),1),oo.timestamp=r,Mu=!0,ya.forEach(fx),Mu=!1,da&&(Ru=!1,Sp(Op))},hx=()=>{da=!0,Ru=!0,Mu||Sp(Op)},dx=()=>oo;function Ep(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e}var Nh=function(){};const Du=(r,t,e)=>Math.min(Math.max(e,r),t),fu=.001,px=.01,gx=10,mx=.05,vx=1;function yx({duration:r=800,bounce:t=.25,velocity:e=0,mass:n=1}){let i,l,c=1-t;c=Du(mx,vx,c),r=Du(px,gx,r/1e3),c<1?(i=g=>{const p=g*c,a=p*r,u=p-e,f=Lu(g,c),y=Math.exp(-a);return fu-u/f*y},l=g=>{const a=g*c*r,u=a*e+e,f=Math.pow(c,2)*Math.pow(g,2)*r,y=Math.exp(-a),_=Lu(Math.pow(g,2),c);return(-i(g)+fu>0?-1:1)*((u-f)*y)/_}):(i=g=>{const p=Math.exp(-g*r),a=(g-e)*r+1;return-fu+p*a},l=g=>{const p=Math.exp(-g*r),a=(e-g)*(r*r);return p*a});const h=5/r,d=bx(i,l,h);if(r=r*1e3,isNaN(d))return{stiffness:100,damping:10,duration:r};{const g=Math.pow(d,2)*n;return{stiffness:g,damping:c*2*Math.sqrt(n*g),duration:r}}}const _x=12;function bx(r,t,e){let n=e;for(let i=1;i<_x;i++)n=n-r(n)/t(n);return n}function Lu(r,t){return r*Math.sqrt(1-t*t)}const wx=["duration","bounce"],xx=["stiffness","damping","mass"];function Bh(r,t){return t.some(e=>r[e]!==void 0)}function Tx(r){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},r);if(!Bh(r,xx)&&Bh(r,wx)){const e=yx(r);t=Object.assign(Object.assign(Object.assign({},t),e),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function rc(r){var{from:t=0,to:e=1,restSpeed:n=2,restDelta:i}=r,l=Ep(r,["from","to","restSpeed","restDelta"]);const c={done:!1,value:t};let{stiffness:h,damping:d,mass:g,velocity:p,duration:a,isResolvedFromDuration:u}=Tx(l),f=Fh,y=Fh;function _(){const b=p?-(p/1e3):0,v=e-t,w=d/(2*Math.sqrt(h*g)),T=Math.sqrt(h/g)/1e3;if(i===void 0&&(i=Math.min(Math.abs(e-t)/100,.4)),w<1){const x=Lu(T,w);f=S=>{const C=Math.exp(-w*T*S);return e-C*((b+w*T*v)/x*Math.sin(x*S)+v*Math.cos(x*S))},y=S=>{const C=Math.exp(-w*T*S);return w*T*C*(Math.sin(x*S)*(b+w*T*v)/x+v*Math.cos(x*S))-C*(Math.cos(x*S)*(b+w*T*v)-x*v*Math.sin(x*S))}}else if(w===1)f=x=>e-Math.exp(-T*x)*(v+(b+T*v)*x);else{const x=T*Math.sqrt(w*w-1);f=S=>{const C=Math.exp(-w*T*S),A=Math.min(x*S,300);return e-C*((b+w*T*v)*Math.sinh(A)+x*v*Math.cosh(A))/x}}}return _(),{next:b=>{const v=f(b);if(u)c.done=b>=a;else{const w=y(b)*1e3,T=Math.abs(w)<=n,x=Math.abs(e-v)<=i;c.done=T&&x}return c.value=c.done?e:v,c},flipTarget:()=>{p=-p,[t,e]=[e,t],_()}}}rc.needsInterpolation=(r,t)=>typeof r=="string"||typeof t=="string";const Fh=r=>0,Ap=(r,t,e)=>{const n=t-r;return n===0?1:(e-r)/n},ic=(r,t,e)=>-e*r+e*t+r,Cp=(r,t)=>e=>Math.max(Math.min(e,t),r),oa=r=>r%1?Number(r.toFixed(5)):r,pa=/(-)?([\d]*\.?[\d])+/g,Iu=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Sx=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function _a(r){return typeof r=="string"}const Ys={test:r=>typeof r=="number",parse:parseFloat,transform:r=>r},kp=Object.assign(Object.assign({},Ys),{transform:Cp(0,1)}),dA=Object.assign(Object.assign({},Ys),{default:1}),oc=r=>({test:t=>_a(t)&&t.endsWith(r)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${r}`}),pA=oc("deg"),aa=oc("%"),gA=oc("px"),mA=Object.assign(Object.assign({},aa),{parse:r=>aa.parse(r)/100,transform:r=>aa.transform(r*100)}),ac=(r,t)=>e=>!!(_a(e)&&Sx.test(e)&&e.startsWith(r)||t&&Object.prototype.hasOwnProperty.call(e,t)),Pp=(r,t,e)=>n=>{if(!_a(n))return n;const[i,l,c,h]=n.match(pa);return{[r]:parseFloat(i),[t]:parseFloat(l),[e]:parseFloat(c),alpha:h!==void 0?parseFloat(h):1}},gi={test:ac("hsl","hue"),parse:Pp("hue","saturation","lightness"),transform:({hue:r,saturation:t,lightness:e,alpha:n=1})=>"hsla("+Math.round(r)+", "+aa.transform(oa(t))+", "+aa.transform(oa(e))+", "+oa(kp.transform(n))+")"},Ox=Cp(0,255),hu=Object.assign(Object.assign({},Ys),{transform:r=>Math.round(Ox(r))}),Fr={test:ac("rgb","red"),parse:Pp("red","green","blue"),transform:({red:r,green:t,blue:e,alpha:n=1})=>"rgba("+hu.transform(r)+", "+hu.transform(t)+", "+hu.transform(e)+", "+oa(kp.transform(n))+")"};function Ex(r){let t="",e="",n="",i="";return r.length>5?(t=r.substr(1,2),e=r.substr(3,2),n=r.substr(5,2),i=r.substr(7,2)):(t=r.substr(1,1),e=r.substr(2,1),n=r.substr(3,1),i=r.substr(4,1),t+=t,e+=e,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(e,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const Nu={test:ac("#"),parse:Ex,transform:Fr.transform},Vs={test:r=>Fr.test(r)||Nu.test(r)||gi.test(r),parse:r=>Fr.test(r)?Fr.parse(r):gi.test(r)?gi.parse(r):Nu.parse(r),transform:r=>_a(r)?r:r.hasOwnProperty("red")?Fr.transform(r):gi.transform(r)},Rp="${c}",Mp="${n}";function Ax(r){var t,e,n,i;return isNaN(r)&&_a(r)&&((e=(t=r.match(pa))===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0)+((i=(n=r.match(Iu))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0)>0}function Dp(r){typeof r=="number"&&(r=`${r}`);const t=[];let e=0;const n=r.match(Iu);n&&(e=n.length,r=r.replace(Iu,Rp),t.push(...n.map(Vs.parse)));const i=r.match(pa);return i&&(r=r.replace(pa,Mp),t.push(...i.map(Ys.parse))),{values:t,numColors:e,tokenised:r}}function Lp(r){return Dp(r).values}function Ip(r){const{values:t,numColors:e,tokenised:n}=Dp(r),i=t.length;return l=>{let c=n;for(let h=0;h<i;h++)c=c.replace(h<e?Rp:Mp,h<e?Vs.transform(l[h]):oa(l[h]));return c}}const Cx=r=>typeof r=="number"?0:r;function kx(r){const t=Lp(r);return Ip(r)(t.map(Cx))}const sc={test:Ax,parse:Lp,createTransformer:Ip,getAnimatableNone:kx},Px=new Set(["brightness","contrast","saturate","opacity"]);function Rx(r){let[t,e]=r.slice(0,-1).split("(");if(t==="drop-shadow")return r;const[n]=e.match(pa)||[];if(!n)return r;const i=e.replace(n,"");let l=Px.has(t)?1:0;return n!==e&&(l*=100),t+"("+l+i+")"}const Mx=/([a-z-]*)\(.*?\)/g,vA=Object.assign(Object.assign({},sc),{getAnimatableNone:r=>{const t=r.match(Mx);return t?t.map(Rx).join(" "):r}});function du(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*(2/3-e)*6:r}function qh({hue:r,saturation:t,lightness:e,alpha:n}){r/=360,t/=100,e/=100;let i=0,l=0,c=0;if(!t)i=l=c=e;else{const h=e<.5?e*(1+t):e+t-e*t,d=2*e-h;i=du(d,h,r+1/3),l=du(d,h,r),c=du(d,h,r-1/3)}return{red:Math.round(i*255),green:Math.round(l*255),blue:Math.round(c*255),alpha:n}}const Dx=(r,t,e)=>{const n=r*r,i=t*t;return Math.sqrt(Math.max(0,e*(i-n)+n))},Lx=[Nu,Fr,gi],jh=r=>Lx.find(t=>t.test(r)),Np=(r,t)=>{let e=jh(r),n=jh(t),i=e.parse(r),l=n.parse(t);e===gi&&(i=qh(i),e=Fr),n===gi&&(l=qh(l),n=Fr);const c=Object.assign({},i);return h=>{for(const d in c)d!=="alpha"&&(c[d]=Dx(i[d],l[d],h));return c.alpha=ic(i.alpha,l.alpha,h),e.transform(c)}},Ix=r=>typeof r=="number",Nx=(r,t)=>e=>t(r(e)),Bp=(...r)=>r.reduce(Nx);function Fp(r,t){return Ix(r)?e=>ic(r,t,e):Vs.test(r)?Np(r,t):jp(r,t)}const qp=(r,t)=>{const e=[...r],n=e.length,i=r.map((l,c)=>Fp(l,t[c]));return l=>{for(let c=0;c<n;c++)e[c]=i[c](l);return e}},Bx=(r,t)=>{const e=Object.assign(Object.assign({},r),t),n={};for(const i in e)r[i]!==void 0&&t[i]!==void 0&&(n[i]=Fp(r[i],t[i]));return i=>{for(const l in n)e[l]=n[l](i);return e}};function $h(r){const t=sc.parse(r),e=t.length;let n=0,i=0,l=0;for(let c=0;c<e;c++)n||typeof t[c]=="number"?n++:t[c].hue!==void 0?l++:i++;return{parsed:t,numNumbers:n,numRGB:i,numHSL:l}}const jp=(r,t)=>{const e=sc.createTransformer(t),n=$h(r),i=$h(t);return n.numHSL===i.numHSL&&n.numRGB===i.numRGB&&n.numNumbers>=i.numNumbers?Bp(qp(n.parsed,i.parsed),e):c=>`${c>0?t:r}`},Fx=(r,t)=>e=>ic(r,t,e);function qx(r){if(typeof r=="number")return Fx;if(typeof r=="string")return Vs.test(r)?Np:jp;if(Array.isArray(r))return qp;if(typeof r=="object")return Bx}function jx(r,t,e){const n=[],i=e||qx(r[0]),l=r.length-1;for(let c=0;c<l;c++){let h=i(r[c],r[c+1]);if(t){const d=Array.isArray(t)?t[c]:t;h=Bp(d,h)}n.push(h)}return n}function $x([r,t],[e]){return n=>e(Ap(r,t,n))}function Ux(r,t){const e=r.length,n=e-1;return i=>{let l=0,c=!1;if(i<=r[0]?c=!0:i>=r[n]&&(l=n-1,c=!0),!c){let d=1;for(;d<e&&!(r[d]>i||d===n);d++);l=d-1}const h=Ap(r[l],r[l+1],i);return t[l](h)}}function $p(r,t,{clamp:e=!0,ease:n,mixer:i}={}){const l=r.length;Nh(l===t.length),Nh(!n||!Array.isArray(n)||n.length===l-1),r[0]>r[l-1]&&(r=[].concat(r),t=[].concat(t),r.reverse(),t.reverse());const c=jx(t,n,i),h=l===2?$x(r,c):Ux(r,c);return e?d=>h(Du(r[0],r[l-1],d)):h}const Ks=r=>t=>1-r(1-t),lc=r=>t=>t<=.5?r(2*t)/2:(2-r(2*(1-t)))/2,Hx=r=>t=>Math.pow(t,r),Up=r=>t=>t*t*((r+1)*t-r),Wx=r=>{const t=Up(r);return e=>(e*=2)<1?.5*t(e):.5*(2-Math.pow(2,-10*(e-1)))},Hp=1.525,zx=4/11,Gx=8/11,Yx=9/10,Vx=r=>r,Wp=Hx(2),yA=Ks(Wp),Kx=lc(Wp),Xx=r=>1-Math.sin(Math.acos(r)),Zx=Ks(Xx),_A=lc(Zx),zp=Up(Hp),bA=Ks(zp),wA=lc(zp),xA=Wx(Hp),Qx=4356/361,Jx=35442/1805,eT=16061/1805,Bu=r=>{if(r===1||r===0)return r;const t=r*r;return r<zx?7.5625*t:r<Gx?9.075*t-9.9*r+3.4:r<Yx?Qx*t-Jx*r+eT:10.8*r*r-20.52*r+10.72},TA=Ks(Bu),SA=r=>r<.5?.5*(1-Bu(1-r*2)):.5*Bu(r*2-1)+.5;function tT(r,t){return r.map(()=>t||Kx).splice(0,r.length-1)}function nT(r){const t=r.length;return r.map((e,n)=>n!==0?n/(t-1):0)}function rT(r,t){return r.map(e=>e*t)}function Os({from:r=0,to:t=1,ease:e,offset:n,duration:i=300}){const l={done:!1,value:r},c=Array.isArray(t)?t:[r,t],h=rT(n&&n.length===c.length?n:nT(c),i);function d(){return $p(h,c,{ease:Array.isArray(e)?e:tT(c,e)})}let g=d();return{next:p=>(l.value=g(p),l.done=p>=i,l),flipTarget:()=>{c.reverse(),g=d()}}}function iT({velocity:r=0,from:t=0,power:e=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:l}){const c={done:!1,value:t};let h=e*r;const d=t+h,g=l===void 0?d:l(d);return g!==d&&(h=g-t),{next:p=>{const a=-h*Math.exp(-p/n);return c.done=!(a>i||a<-i),c.value=c.done?g:g+a,c},flipTarget:()=>{}}}const Uh={keyframes:Os,spring:rc,decay:iT};function oT(r){if(Array.isArray(r.to))return Os;if(Uh[r.type])return Uh[r.type];const t=new Set(Object.keys(r));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?Os:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?rc:Os}function Gp(r,t,e=0){return r-t-e}function aT(r,t,e=0,n=!0){return n?Gp(t+-r,t,e):t-(r-t)+e}function sT(r,t,e,n){return n?r>=t+e:r<=-e}const lT=r=>{const t=({delta:e})=>r(e);return{start:()=>ux.update(t,!0),stop:()=>cx.update(t)}};function uT(r){var t,e,{from:n,autoplay:i=!0,driver:l=lT,elapsed:c=0,repeat:h=0,repeatType:d="loop",repeatDelay:g=0,onPlay:p,onStop:a,onComplete:u,onRepeat:f,onUpdate:y}=r,_=Ep(r,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:b}=_,v,w=0,T=_.duration,x,S=!1,C=!0,A;const R=oT(_);!((e=(t=R).needsInterpolation)===null||e===void 0)&&e.call(t,n,b)&&(A=$p([0,100],[n,b],{clamp:!1}),n=0,b=100);const L=R(Object.assign(Object.assign({},_),{from:n,to:b}));function M(){w++,d==="reverse"?(C=w%2===0,c=aT(c,T,g,C)):(c=Gp(c,T,g),d==="mirror"&&L.flipTarget()),S=!1,f&&f()}function k(){v.stop(),u&&u()}function P(j){if(C||(j=-j),c+=j,!S){const W=L.next(Math.max(0,c));x=W.value,A&&(x=A(x)),S=C?W.done:c<=0}y==null||y(x),S&&(w===0&&(T!=null||(T=c)),w<h?sT(c,T,g,C)&&M():k())}function I(){p==null||p(),v=l(P),v.start()}return i&&I(),{stop:()=>{a==null||a(),v.stop()}}}function cT(r,t){return t?r*(1e3/t):0}function OA({from:r=0,velocity:t=0,min:e,max:n,power:i=.8,timeConstant:l=750,bounceStiffness:c=500,bounceDamping:h=10,restDelta:d=1,modifyTarget:g,driver:p,onUpdate:a,onComplete:u,onStop:f}){let y;function _(T){return e!==void 0&&T<e||n!==void 0&&T>n}function b(T){return e===void 0?n:n===void 0||Math.abs(e-T)<Math.abs(n-T)?e:n}function v(T){y==null||y.stop(),y=uT(Object.assign(Object.assign({},T),{driver:p,onUpdate:x=>{var S;a==null||a(x),(S=T.onUpdate)===null||S===void 0||S.call(T,x)},onComplete:u,onStop:f}))}function w(T){v(Object.assign({type:"spring",stiffness:c,damping:h,restDelta:d},T))}if(_(r))w({from:r,velocity:t,to:b(r)});else{let T=i*t+r;typeof g!="undefined"&&(T=g(T));const x=b(T),S=x===e?-1:1;let C,A;const R=L=>{C=A,A=L,t=cT(L-C,dx().delta),(S===1&&L>x||S===-1&&L<x)&&w({from:L,to:x,velocity:t})};v({type:"decay",from:r,velocity:t,timeConstant:l,power:i,restDelta:d,modifyTarget:g,onUpdate:_(T)?R:void 0})}return{stop:()=>y==null?void 0:y.stop()}}const Yp=(r,t)=>1-3*t+3*r,Vp=(r,t)=>3*t-6*r,Kp=r=>3*r,Rs=(r,t,e)=>((Yp(t,e)*r+Vp(t,e))*r+Kp(t))*r,Xp=(r,t,e)=>3*Yp(t,e)*r*r+2*Vp(t,e)*r+Kp(t),fT=1e-7,hT=10;function dT(r,t,e,n,i){let l,c,h=0;do c=t+(e-t)/2,l=Rs(c,n,i)-r,l>0?e=c:t=c;while(Math.abs(l)>fT&&++h<hT);return c}const pT=8,gT=.001;function mT(r,t,e,n){for(let i=0;i<pT;++i){const l=Xp(t,e,n);if(l===0)return t;const c=Rs(t,e,n)-r;t-=c/l}return t}const Es=11,ds=1/(Es-1);function EA(r,t,e,n){if(r===t&&e===n)return Vx;const i=new Float32Array(Es);for(let c=0;c<Es;++c)i[c]=Rs(c*ds,r,e);function l(c){let h=0,d=1;const g=Es-1;for(;d!==g&&i[d]<=c;++d)h+=ds;--d;const p=(c-i[d])/(i[d+1]-i[d]),a=h+p*ds,u=Xp(a,r,e);return u>=gT?mT(c,a,r,e):u===0?a:dT(c,h,h+ds,r,e)}return c=>c===0||c===1?c:Rs(l(c),t,n)}const Wr=(()=>{/*!
* Copyright (c) 2021-2024 Momo Bassit.
* Licensed under the MIT License (MIT)
* https://github.com/mdbassit/Coloris
* Version: 0.25.0
* NPM: https://github.com/melloware/coloris-npm
*/return((r,t,e,n)=>{const i=t.createElement("canvas").getContext("2d"),l={r:0,g:0,b:0,h:0,s:0,v:0,a:1};let c,h,d,g,p,a,u,f,y,_,b,v,w,T,x,S,C={};const A={el:"[data-coloris]",parent:"body",theme:"default",themeMode:"light",rtl:!1,wrap:!0,margin:2,format:"hex",formatToggle:!1,swatches:[],swatchesOnly:!1,alpha:!0,forceAlpha:!1,focusInput:!0,selectInput:!1,inline:!1,defaultColor:"#000000",clearButton:!1,clearLabel:"Clear",closeButton:!1,closeLabel:"Close",onChange:()=>n,a11y:{open:"Open color picker",close:"Close color picker",clear:"Clear the selected color",marker:"Saturation: {s}. Brightness: {v}.",hueSlider:"Hue slider",alphaSlider:"Opacity slider",input:"Color value field",format:"Color format",swatch:"Color swatch",instruction:"Saturation and brightness selector. Use up, down, left and right arrow keys to select."}},R={};let L="",M={},k=!1;function P(z){if(typeof z=="object")for(const ue in z)switch(ue){case"el":ee(z.el),z.wrap!==!1&&$(z.el);break;case"parent":c=z.parent instanceof HTMLElement?z.parent:t.querySelector(z.parent),c&&(c.appendChild(h),A.parent=z.parent,c===t.body&&(c=n));break;case"themeMode":A.themeMode=z.themeMode,z.themeMode==="auto"&&r.matchMedia&&r.matchMedia("(prefers-color-scheme: dark)").matches&&(A.themeMode="dark");case"theme":z.theme&&(A.theme=z.theme),h.className=`clr-picker clr-${A.theme} clr-${A.themeMode}`,A.inline&&V();break;case"rtl":A.rtl=!!z.rtl,Array.from(t.getElementsByClassName("clr-field")).forEach(Ae=>Ae.classList.toggle("clr-rtl",A.rtl));break;case"margin":z.margin*=1,A.margin=isNaN(z.margin)?A.margin:z.margin;break;case"wrap":z.el&&z.wrap&&$(z.el);break;case"formatToggle":A.formatToggle=!!z.formatToggle,Ee("clr-format").style.display=A.formatToggle?"block":"none",A.formatToggle&&(A.format="auto");break;case"swatches":if(Array.isArray(z.swatches)){const Ae=Ee("clr-swatches"),Ie=t.createElement("div");Ae.textContent="",z.swatches.forEach((at,wt)=>{const Ze=t.createElement("button");Ze.setAttribute("type","button"),Ze.setAttribute("id",`clr-swatch-${wt}`),Ze.setAttribute("aria-labelledby",`clr-swatch-label clr-swatch-${wt}`),Ze.style.color=at,Ze.textContent=at,Ie.appendChild(Ze)}),z.swatches.length&&Ae.appendChild(Ie),A.swatches=z.swatches.slice()}break;case"swatchesOnly":A.swatchesOnly=!!z.swatchesOnly,h.setAttribute("data-minimal",A.swatchesOnly);break;case"alpha":A.alpha=!!z.alpha,h.setAttribute("data-alpha",A.alpha);break;case"inline":if(A.inline=!!z.inline,h.setAttribute("data-inline",A.inline),A.inline){const Ae=z.defaultColor||A.defaultColor;T=X(Ae),V(),ne(Ae)}break;case"clearButton":typeof z.clearButton=="object"&&(z.clearButton.label&&(A.clearLabel=z.clearButton.label,u.innerHTML=A.clearLabel),z.clearButton=z.clearButton.show),A.clearButton=!!z.clearButton,u.style.display=A.clearButton?"block":"none";break;case"clearLabel":A.clearLabel=z.clearLabel,u.innerHTML=A.clearLabel;break;case"closeButton":A.closeButton=!!z.closeButton,A.closeButton?h.insertBefore(f,p):p.appendChild(f);break;case"closeLabel":A.closeLabel=z.closeLabel,f.innerHTML=A.closeLabel;break;case"a11y":const pe=z.a11y;let Te=!1;if(typeof pe=="object")for(const Ae in pe)pe[Ae]&&A.a11y[Ae]&&(A.a11y[Ae]=pe[Ae],Te=!0);if(Te){const Ae=Ee("clr-open-label"),Ie=Ee("clr-swatch-label");Ae.innerHTML=A.a11y.open,Ie.innerHTML=A.a11y.swatch,f.setAttribute("aria-label",A.a11y.close),u.setAttribute("aria-label",A.a11y.clear),y.setAttribute("aria-label",A.a11y.hueSlider),b.setAttribute("aria-label",A.a11y.alphaSlider),a.setAttribute("aria-label",A.a11y.input),d.setAttribute("aria-label",A.a11y.instruction)}break;default:A[ue]=z[ue]}}function I(z,ue){typeof z=="string"&&typeof ue=="object"&&(R[z]=ue,k=!0)}function j(z){delete R[z],Object.keys(R).length===0&&(k=!1,z===L&&J())}function W(z){if(k){const ue=["el","wrap","rtl","inline","defaultColor","a11y"];for(let pe in R){const Te=R[pe];if(z.matches(pe)){L=pe,M={},ue.forEach(Ae=>delete Te[Ae]);for(let Ae in Te)M[Ae]=Array.isArray(A[Ae])?A[Ae].slice():A[Ae];P(Te);break}}}}function J(){Object.keys(M).length>0&&(P(M),L="",M={})}function ee(z){z instanceof HTMLElement&&(z=[z]),Array.isArray(z)?z.forEach(ue=>{$e(ue,"click",oe),$e(ue,"input",H)}):($e(t,"click",z,oe),$e(t,"input",z,H))}function oe(z){A.inline||(W(z.target),w=z.target,x=w.value,T=X(x),h.classList.add("clr-open"),V(),ne(x),(A.focusInput||A.selectInput)&&(a.focus({preventScroll:!0}),a.setSelectionRange(w.selectionStart,w.selectionEnd)),A.selectInput&&a.select(),(S||A.swatchesOnly)&&Le().shift().focus(),w.dispatchEvent(new Event("open",{bubbles:!1})))}function V(){if(!h||!w&&!A.inline)return;const z=c,ue=r.scrollY,pe=h.offsetWidth,Te=h.offsetHeight,Ae={left:!1,top:!1};let Ie,at,wt,Ze={x:0,y:0};if(z&&(Ie=r.getComputedStyle(z),at=parseFloat(Ie.marginTop),wt=parseFloat(Ie.borderTopWidth),Ze=z.getBoundingClientRect(),Ze.y+=wt+ue),!A.inline){const yt=w.getBoundingClientRect();let Ht=yt.x,Kt=ue+yt.y+yt.height+A.margin;z?(Ht-=Ze.x,Kt-=Ze.y,Ht+pe>z.clientWidth&&(Ht+=yt.width-pe,Ae.left=!0),Kt+Te>z.clientHeight-at&&Te+A.margin<=yt.top-(Ze.y-ue)&&(Kt-=yt.height+Te+A.margin*2,Ae.top=!0),Kt+=z.scrollTop):(Ht+pe>t.documentElement.clientWidth&&(Ht+=yt.width-pe,Ae.left=!0),Kt+Te-ue>t.documentElement.clientHeight&&Te+A.margin<=yt.top&&(Kt=ue+yt.y-Te-A.margin,Ae.top=!0)),h.classList.toggle("clr-left",Ae.left),h.classList.toggle("clr-top",Ae.top),h.style.left=`${Ht}px`,h.style.top=`${Kt}px`,Ze.x+=h.offsetLeft,Ze.y+=h.offsetTop}C={width:d.offsetWidth,height:d.offsetHeight,x:d.offsetLeft+Ze.x,y:d.offsetTop+Ze.y}}function $(z){z instanceof HTMLElement?N(z):Array.isArray(z)?z.forEach(N):t.querySelectorAll(z).forEach(N)}function N(z){const ue=z.parentNode;if(!ue.classList.contains("clr-field")){const pe=t.createElement("div");let Te="clr-field";(A.rtl||z.classList.contains("clr-rtl"))&&(Te+=" clr-rtl"),pe.innerHTML='<button type="button" aria-labelledby="clr-open-label"></button>',ue.insertBefore(pe,z),pe.className=Te,pe.style.color=z.value,pe.appendChild(z)}}function H(z){const ue=z.target.parentNode;ue.classList.contains("clr-field")&&(ue.style.color=z.target.value)}function G(z){if(w&&!A.inline){const ue=w;z&&(w=n,x!==ue.value&&(ue.value=x,ue.dispatchEvent(new Event("input",{bubbles:!0})))),setTimeout(()=>{x!==ue.value&&ue.dispatchEvent(new Event("change",{bubbles:!0}))}),h.classList.remove("clr-open"),k&&J(),ue.dispatchEvent(new Event("close",{bubbles:!1})),A.focusInput&&ue.focus({preventScroll:!0}),w=n}}function ne(z){const ue=he(z),pe=le(ue);ie(pe.s,pe.v),Me(ue,pe),y.value=pe.h,h.style.color=`hsl(${pe.h}, 100%, 50%)`,_.style.left=`${pe.h/360*100}%`,g.style.left=`${C.width*pe.s/100}px`,g.style.top=`${C.height-C.height*pe.v/100}px`,b.value=pe.a*100,v.style.left=`${pe.a*100}%`}function X(z){const ue=z.substring(0,3).toLowerCase();return ue==="rgb"||ue==="hsl"?ue:"hex"}function U(z){z=z!==n?z:a.value,w&&(w.value=z,w.dispatchEvent(new Event("input",{bubbles:!0}))),A.onChange&&A.onChange.call(r,z,w),t.dispatchEvent(new CustomEvent("coloris:pick",{detail:{color:z,currentEl:w}}))}function Q(z,ue){const pe={h:y.value*1,s:z/C.width*100,v:100-ue/C.height*100,a:b.value/100},Te=xt(pe);ie(pe.s,pe.v),Me(Te,pe),U()}function ie(z,ue){let pe=A.a11y.marker;z=z.toFixed(1)*1,ue=ue.toFixed(1)*1,pe=pe.replace("{s}",z),pe=pe.replace("{v}",ue),g.setAttribute("aria-label",pe)}function ae(z){return{pageX:z.changedTouches?z.changedTouches[0].pageX:z.pageX,pageY:z.changedTouches?z.changedTouches[0].pageY:z.pageY}}function de(z){const ue=ae(z);let pe=ue.pageX-C.x,Te=ue.pageY-C.y;c&&(Te+=c.scrollTop),Pe(pe,Te),z.preventDefault(),z.stopPropagation()}function we(z,ue){let pe=g.style.left.replace("px","")*1+z,Te=g.style.top.replace("px","")*1+ue;Pe(pe,Te)}function Pe(z,ue){z=z<0?0:z>C.width?C.width:z,ue=ue<0?0:ue>C.height?C.height:ue,g.style.left=`${z}px`,g.style.top=`${ue}px`,Q(z,ue),g.focus()}function Me(z,ue){z===void 0&&(z={}),ue===void 0&&(ue={});let pe=A.format;for(const Ie in z)l[Ie]=z[Ie];for(const Ie in ue)l[Ie]=ue[Ie];const Te=_e(l),Ae=Te.substring(0,7);switch(g.style.color=Ae,v.parentNode.style.color=Ae,v.style.color=Te,p.style.color=Te,d.style.display="none",d.offsetHeight,d.style.display="",v.nextElementSibling.style.display="none",v.nextElementSibling.offsetHeight,v.nextElementSibling.style.display="",pe==="mixed"?pe=l.a===1?"hex":"rgb":pe==="auto"&&(pe=T),pe){case"hex":a.value=Te;break;case"rgb":a.value=be(l);break;case"hsl":a.value=ve(Je(l));break}t.querySelector(`.clr-format [value="${pe}"]`).checked=!0}function De(){const z=y.value*1,ue=g.style.left.replace("px","")*1,pe=g.style.top.replace("px","")*1;h.style.color=`hsl(${z}, 100%, 50%)`,_.style.left=`${z/360*100}%`,Q(ue,pe)}function ze(){const z=b.value/100;v.style.left=`${z*100}%`,Me({a:z}),U()}function xt(z){const ue=z.s/100,pe=z.v/100;let Te=ue*pe,Ae=z.h/60,Ie=Te*(1-e.abs(Ae%2-1)),at=pe-Te;Te=Te+at,Ie=Ie+at;const wt=e.floor(Ae)%6,Ze=[Te,Ie,at,at,Ie,Te][wt],yt=[Ie,Te,Te,Ie,at,at][wt],Ht=[at,at,Ie,Te,Te,Ie][wt];return{r:e.round(Ze*255),g:e.round(yt*255),b:e.round(Ht*255),a:z.a}}function Je(z){const ue=z.v/100,pe=ue*(1-z.s/100/2);let Te;return pe>0&&pe<1&&(Te=e.round((ue-pe)/e.min(pe,1-pe)*100)),{h:z.h,s:Te||0,l:e.round(pe*100),a:z.a}}function le(z){const ue=z.r/255,pe=z.g/255,Te=z.b/255,Ae=e.max(ue,pe,Te),Ie=e.min(ue,pe,Te),at=Ae-Ie,wt=Ae;let Ze=0,yt=0;return at&&(Ae===ue&&(Ze=(pe-Te)/at),Ae===pe&&(Ze=2+(Te-ue)/at),Ae===Te&&(Ze=4+(ue-pe)/at),Ae&&(yt=at/Ae)),Ze=e.floor(Ze*60),{h:Ze<0?Ze+360:Ze,s:e.round(yt*100),v:e.round(wt*100),a:z.a}}function he(z){const ue=/^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i;let pe,Te;return i.fillStyle="#000",i.fillStyle=z,pe=ue.exec(i.fillStyle),pe?Te={r:pe[3]*1,g:pe[4]*1,b:pe[5]*1,a:pe[6]*1}:(pe=i.fillStyle.replace("#","").match(/.{2}/g).map(Ae=>parseInt(Ae,16)),Te={r:pe[0],g:pe[1],b:pe[2],a:1}),Te}function _e(z){let ue=z.r.toString(16),pe=z.g.toString(16),Te=z.b.toString(16),Ae="";if(z.r<16&&(ue="0"+ue),z.g<16&&(pe="0"+pe),z.b<16&&(Te="0"+Te),A.alpha&&(z.a<1||A.forceAlpha)){const Ie=z.a*255|0;Ae=Ie.toString(16),Ie<16&&(Ae="0"+Ae)}return"#"+ue+pe+Te+Ae}function be(z){return!A.alpha||z.a===1&&!A.forceAlpha?`rgb(${z.r}, ${z.g}, ${z.b})`:`rgba(${z.r}, ${z.g}, ${z.b}, ${z.a})`}function ve(z){return!A.alpha||z.a===1&&!A.forceAlpha?`hsl(${z.h}, ${z.s}%, ${z.l}%)`:`hsla(${z.h}, ${z.s}%, ${z.l}%, ${z.a})`}function Be(){t.getElementById("clr-picker")||(c=n,h=t.createElement("div"),h.setAttribute("id","clr-picker"),h.className="clr-picker",h.innerHTML=`<input id="clr-color-value" name="clr-color-value" class="clr-color" type="text" value="" spellcheck="false" aria-label="${A.a11y.input}"><div id="clr-color-area" class="clr-gradient" role="application" aria-label="${A.a11y.instruction}"><div id="clr-color-marker" class="clr-marker" tabindex="0"></div></div><div class="clr-hue"><input id="clr-hue-slider" name="clr-hue-slider" type="range" min="0" max="360" step="1" aria-label="${A.a11y.hueSlider}"><div id="clr-hue-marker"></div></div><div class="clr-alpha"><input id="clr-alpha-slider" name="clr-alpha-slider" type="range" min="0" max="100" step="1" aria-label="${A.a11y.alphaSlider}"><div id="clr-alpha-marker"></div><span></span></div><div id="clr-format" class="clr-format"><fieldset class="clr-segmented"><legend>${A.a11y.format}</legend><input id="clr-f1" type="radio" name="clr-format" value="hex"><label for="clr-f1">Hex</label><input id="clr-f2" type="radio" name="clr-format" value="rgb"><label for="clr-f2">RGB</label><input id="clr-f3" type="radio" name="clr-format" value="hsl"><label for="clr-f3">HSL</label><span></span></fieldset></div><div id="clr-swatches" class="clr-swatches"></div><button type="button" id="clr-clear" class="clr-clear" aria-label="${A.a11y.clear}">${A.clearLabel}</button><div id="clr-color-preview" class="clr-preview"><button type="button" id="clr-close" class="clr-close" aria-label="${A.a11y.close}">${A.closeLabel}</button></div><span id="clr-open-label" hidden>${A.a11y.open}</span><span id="clr-swatch-label" hidden>${A.a11y.swatch}</span>`,t.body.appendChild(h),d=Ee("clr-color-area"),g=Ee("clr-color-marker"),u=Ee("clr-clear"),f=Ee("clr-close"),p=Ee("clr-color-preview"),a=Ee("clr-color-value"),y=Ee("clr-hue-slider"),_=Ee("clr-hue-marker"),b=Ee("clr-alpha-slider"),v=Ee("clr-alpha-marker"),ee(A.el),$(A.el),$e(h,"mousedown",z=>{h.classList.remove("clr-keyboard-nav"),z.stopPropagation()}),$e(d,"mousedown",z=>{$e(t,"mousemove",de)}),$e(d,"contextmenu",z=>{z.preventDefault()}),$e(d,"touchstart",z=>{t.addEventListener("touchmove",de,{passive:!1})}),$e(g,"mousedown",z=>{$e(t,"mousemove",de)}),$e(g,"touchstart",z=>{t.addEventListener("touchmove",de,{passive:!1})}),$e(a,"change",z=>{const ue=a.value;if(w||A.inline){const pe=ue===""?ue:ne(ue);U(pe)}}),$e(u,"click",z=>{U(""),G()}),$e(f,"click",z=>{U(),G()}),$e(Ee("clr-format"),"click",".clr-format input",z=>{T=z.target.value,Me(),U()}),$e(h,"click",".clr-swatches button",z=>{ne(z.target.textContent),U(),A.swatchesOnly&&G()}),$e(t,"mouseup",z=>{t.removeEventListener("mousemove",de)}),$e(t,"touchend",z=>{t.removeEventListener("touchmove",de)}),$e(t,"mousedown",z=>{S=!1,h.classList.remove("clr-keyboard-nav"),G()}),$e(t,"keydown",z=>{const ue=z.key,pe=z.target,Te=z.shiftKey,Ae=["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"];if(ue==="Escape"){G(!0);return}else if(ue==="Enter"&&pe.tagName!=="BUTTON"){G();return}else Ae.includes(ue)&&(S=!0,h.classList.add("clr-keyboard-nav"));if(ue==="Tab"&&pe.matches(".clr-picker *")){const Ie=Le(),at=Ie.shift(),wt=Ie.pop();Te&&pe===at?(wt.focus(),z.preventDefault()):!Te&&pe===wt&&(at.focus(),z.preventDefault())}}),$e(t,"click",".clr-field button",z=>{k&&J(),z.target.nextElementSibling.dispatchEvent(new Event("click",{bubbles:!0}))}),$e(g,"keydown",z=>{const ue={ArrowUp:[0,-1],ArrowDown:[0,1],ArrowLeft:[-1,0],ArrowRight:[1,0]};Object.keys(ue).includes(z.key)&&(we(...ue[z.key]),z.preventDefault())}),$e(d,"click",de),$e(y,"input",De),$e(b,"input",ze))}function Le(){return Array.from(h.querySelectorAll("input, button")).filter(pe=>!!pe.offsetWidth)}function Ee(z){return t.getElementById(z)}function $e(z,ue,pe,Te){const Ae=Element.prototype.matches||Element.prototype.msMatchesSelector;typeof pe=="string"?z.addEventListener(ue,Ie=>{Ae.call(Ie.target,pe)&&Te.call(Ie.target,Ie)}):(Te=pe,z.addEventListener(ue,Te))}function vt(z,ue){ue=ue!==n?ue:[],t.readyState!=="loading"?z(...ue):t.addEventListener("DOMContentLoaded",()=>{z(...ue)})}NodeList!==n&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach);function Ve(z,ue){w=ue,x=w.value,W(ue),T=X(z),V(),ne(z),U(),x!==z&&w.dispatchEvent(new Event("change",{bubbles:!0}))}const nn=(()=>{const z={init:Be,set:P,wrap:$,close:G,setInstance:I,setColor:Ve,removeInstance:j,updatePosition:V,ready:vt};function ue(pe){vt(()=>{pe&&(typeof pe=="string"?ee(pe):P(pe))})}for(const pe in z)ue[pe]=function(){for(var Te=arguments.length,Ae=new Array(Te),Ie=0;Ie<Te;Ie++)Ae[Ie]=arguments[Ie];vt(z[pe],Ae)};return vt(()=>{r.addEventListener("resize",pe=>{ue.updatePosition()}),r.addEventListener("scroll",pe=>{ue.updatePosition()})}),ue})();return nn.coloris=nn,nn})(window,document,Math)})();Wr.coloris;Wr.init;Wr.set;Wr.wrap;Wr.close;Wr.setInstance;Wr.removeInstance;Wr.updatePosition;var vT=typeof global=="object"&&global&&global.Object===Object&&global,yT=typeof self=="object"&&self&&self.Object===Object&&self,Zp=vT||yT||Function("return this")(),Ms=Zp.Symbol,Qp=Object.prototype,_T=Qp.hasOwnProperty,bT=Qp.toString,Qo=Ms?Ms.toStringTag:void 0;function wT(r){var t=_T.call(r,Qo),e=r[Qo];try{r[Qo]=void 0;var n=!0}catch(l){}var i=bT.call(r);return n&&(t?r[Qo]=e:delete r[Qo]),i}var xT=Object.prototype,TT=xT.toString;function ST(r){return TT.call(r)}var OT="[object Null]",ET="[object Undefined]",Hh=Ms?Ms.toStringTag:void 0;function AT(r){return r==null?r===void 0?ET:OT:Hh&&Hh in Object(r)?wT(r):ST(r)}function CT(r){return r!=null&&typeof r=="object"}var kT="[object Symbol]";function PT(r){return typeof r=="symbol"||CT(r)&&AT(r)==kT}var RT=/\s/;function MT(r){for(var t=r.length;t--&&RT.test(r.charAt(t)););return t}var DT=/^\s+/;function LT(r){return r&&r.slice(0,MT(r)+1).replace(DT,"")}function Fu(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}var Wh=NaN,IT=/^[-+]0x[0-9a-f]+$/i,NT=/^0b[01]+$/i,BT=/^0o[0-7]+$/i,FT=parseInt;function zh(r){if(typeof r=="number")return r;if(PT(r))return Wh;if(Fu(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=Fu(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=LT(r);var e=NT.test(r);return e||BT.test(r)?FT(r.slice(2),e?2:8):IT.test(r)?Wh:+r}var pu=function(){return Zp.Date.now()},qT="Expected a function",jT=Math.max,$T=Math.min;function AA(r,t,e){var n,i,l,c,h,d,g=0,p=!1,a=!1,u=!0;if(typeof r!="function")throw new TypeError(qT);t=zh(t)||0,Fu(e)&&(p=!!e.leading,a="maxWait"in e,l=a?jT(zh(e.maxWait)||0,t):l,u="trailing"in e?!!e.trailing:u);function f(C){var A=n,R=i;return n=i=void 0,g=C,c=r.apply(R,A),c}function y(C){return g=C,h=setTimeout(v,t),p?f(C):c}function _(C){var A=C-d,R=C-g,L=t-A;return a?$T(L,l-R):L}function b(C){var A=C-d,R=C-g;return d===void 0||A>=t||A<0||a&&R>=l}function v(){var C=pu();if(b(C))return w(C);h=setTimeout(v,_(C))}function w(C){return h=void 0,u&&n?f(C):(n=i=void 0,c)}function T(){h!==void 0&&clearTimeout(h),g=0,n=d=i=h=void 0}function x(){return h===void 0?c:w(pu())}function S(){var C=pu(),A=b(C);if(n=arguments,i=this,d=C,A){if(h===void 0)return y(d);if(a)return clearTimeout(h),h=setTimeout(v,t),f(d)}return h===void 0&&(h=setTimeout(v,t)),c}return S.cancel=T,S.flush=x,S}function Vt(r,t,e,n){return new(e||(e=Promise))(function(i,l){function c(g){try{d(n.next(g))}catch(p){l(p)}}function h(g){try{d(n.throw(g))}catch(p){l(p)}}function d(g){var p;g.done?i(g.value):(p=g.value,p instanceof e?p:new e(function(a){a(p)})).then(c,h)}d((n=n.apply(r,t||[])).next())})}class ba{constructor(){this.listeners={}}on(t,e,n){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),n==null?void 0:n.once){const i=()=>{this.un(t,i),this.un(t,e)};return this.on(t,i),i}return()=>this.un(t,e)}un(t,e){var n;(n=this.listeners[t])===null||n===void 0||n.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(n=>n(...e))}}const ps={decode:function(r,t){return Vt(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(r).finally(()=>e.close())})},createBuffer:function(r,t){return typeof r[0]=="number"&&(r=[r]),function(e){const n=e[0];if(n.some(i=>i>1||i<-1)){const i=n.length;let l=0;for(let c=0;c<i;c++){const h=Math.abs(n[c]);h>l&&(l=h)}for(const c of e)for(let h=0;h<i;h++)c[h]/=l}}(r),{duration:t,length:r[0].length,sampleRate:r[0].length/t,numberOfChannels:r.length,getChannelData:e=>r==null?void 0:r[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Jp(r,t){const e=t.xmlns?document.createElementNS(t.xmlns,r):document.createElement(r);for(const[n,i]of Object.entries(t))if(n==="children"&&i)for(const[l,c]of Object.entries(i))c instanceof Node?e.appendChild(c):typeof c=="string"?e.appendChild(document.createTextNode(c)):e.appendChild(Jp(l,c));else n==="style"?Object.assign(e.style,i):n==="textContent"?e.textContent=i:e.setAttribute(n,i.toString());return e}function Gh(r,t,e){const n=Jp(r,t||{});return e==null||e.appendChild(n),n}var UT=Object.freeze({__proto__:null,createElement:Gh,default:Gh});const HT={fetchBlob:function(r,t,e){return Vt(this,void 0,void 0,function*(){const n=yield fetch(r,e);if(n.status>=400)throw new Error(`Failed to fetch ${r}: ${n.status} (${n.statusText})`);return function(i,l){Vt(this,void 0,void 0,function*(){if(!i.body||!i.headers)return;const c=i.body.getReader(),h=Number(i.headers.get("Content-Length"))||0;let d=0;const g=a=>Vt(this,void 0,void 0,function*(){d+=(a==null?void 0:a.length)||0;const u=Math.round(d/h*100);l(u)}),p=()=>Vt(this,void 0,void 0,function*(){let a;try{a=yield c.read()}catch(u){return}a.done||(g(a.value),yield p())});p()})}(n.clone(),t),n.blob()})}};class WT extends ba{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,n){return this.media.addEventListener(t,e,n),()=>this.media.removeEventListener(t,e,n)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const n=this.getSrc();if(t&&n===t)return;this.revokeSrc();const i=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;if(n&&this.media.removeAttribute("src"),i||t)try{this.media.src=i}catch(l){this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.removeAttribute("src"),this.media.load())}setMediaElement(t){this.media=t}play(){return Vt(this,void 0,void 0,function*(){try{return yield this.media.play()}catch(t){if(t instanceof DOMException&&t.name==="AbortError")return;throw t}})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class lo extends ba{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=t;const n=this.parentFromOptionsContainer(t.container);this.parent=n;const[i,l]=this.initHtml();n.appendChild(i),this.container=i,this.scrollContainer=l.querySelector(".scroll"),this.wrapper=l.querySelector(".wrapper"),this.canvasWrapper=l.querySelector(".canvases"),this.progressWrapper=l.querySelector(".progress"),this.cursor=l.querySelector(".cursor"),e&&l.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const n=this.wrapper.getBoundingClientRect(),i=e.clientX-n.left,l=e.clientY-n.top;return[i/n.width,l/n.height]};if(this.wrapper.addEventListener("click",e=>{const[n,i]=t(e);this.emit("click",n,i)}),this.wrapper.addEventListener("dblclick",e=>{const[n,i]=t(e);this.emit("dblclick",n,i)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:n,clientWidth:i}=this.scrollContainer,l=e/n,c=(e+i)/n;this.emit("scroll",l,c,e,e+i)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,n,i,l=3,c=0,h=100){if(!t)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let g=()=>{};const p=a=>{if(a.button!==c)return;a.preventDefault(),a.stopPropagation();let u=a.clientX,f=a.clientY,y=!1;const _=Date.now(),b=S=>{if(S.preventDefault(),S.stopPropagation(),d&&Date.now()-_<h)return;const C=S.clientX,A=S.clientY,R=C-u,L=A-f;if(y||Math.abs(R)>l||Math.abs(L)>l){const M=t.getBoundingClientRect(),{left:k,top:P}=M;y||(n==null||n(u-k,f-P),y=!0),e(R,L,C-k,A-P),u=C,f=A}},v=S=>{if(y){const C=S.clientX,A=S.clientY,R=t.getBoundingClientRect(),{left:L,top:M}=R;i==null||i(C-L,A-M)}g()},w=S=>{S.relatedTarget&&S.relatedTarget!==document.documentElement||v(S)},T=S=>{y&&(S.stopPropagation(),S.preventDefault())},x=S=>{y&&S.preventDefault()};document.addEventListener("pointermove",b),document.addEventListener("pointerup",v),document.addEventListener("pointerout",w),document.addEventListener("pointercancel",w),document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("click",T,{capture:!0}),g=()=>{document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",v),document.removeEventListener("pointerout",w),document.removeEventListener("pointercancel",w),document.removeEventListener("touchmove",x),setTimeout(()=>{document.removeEventListener("click",T,{capture:!0})},10)}};return t.addEventListener("pointerdown",p),()=>{g(),t.removeEventListener("pointerdown",p)}}(this.wrapper,(t,e,n)=>{this.emit("drag",Math.max(0,Math.min(1,n/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var n;const i=((n=this.audioData)===null||n===void 0?void 0:n.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const l=this.parent.clientHeight||128;return e!=null&&e.every(c=>!c.overlay)?l/i:l}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),n=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
<style${n?` nonce="${n}"`:""}>
:host {
user-select: none;
min-width: 1px;
}
:host audio {
display: block;
width: 100%;
}
:host .scroll {
overflow-x: auto;
overflow-y: hidden;
width: 100%;
position: relative;
}
:host .noScrollbar {
scrollbar-color: transparent;
scrollbar-width: none;
}
:host .noScrollbar::-webkit-scrollbar {
display: none;
-webkit-appearance: none;
}
:host .wrapper {
position: relative;
overflow: visible;
z-index: 2;
}
:host .canvases {
min-height: ${this.getHeight(this.options.height,this.options.splitChannels)}px;
}
:host .canvases > div {
position: relative;
}
:host canvas {
display: block;
position: absolute;
top: 0;
image-rendering: pixelated;
}
:host .progress {
pointer-events: none;
position: absolute;
z-index: 2;
top: 0;
left: 0;
width: 0;
height: 100%;
overflow: hidden;
}
:host .progress > div {
position: relative;
}
:host .cursor {
pointer-events: none;
position: absolute;
z-index: 5;
top: 0;
left: 0;
height: 100%;
border-radius: 2px;
}
</style>
<div class="scroll" part="scroll">
<div class="wrapper" part="wrapper">
<div class="canvases" part="canvases"></div>
<div class="progress" part="progress"></div>
<div class="cursor" part="cursor"></div>
</div>
</div>
`,[t,e]}setOptions(t){if(this.options.container!==t.container){const e=this.parentFromOptionsContainer(t.container);e.appendChild(this.container),this.parent=e}t.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.options=t,this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth}getScroll(){return this.scrollContainer.scrollLeft}setScroll(t){this.scrollContainer.scrollLeft=t}setScrollPercentage(t){const{scrollWidth:e}=this.scrollContainer,n=e*t;this.setScroll(n)}destroy(){var t,e;this.subscriptions.forEach(n=>n()),this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(e=this.unsubscribeOnScroll)===null||e===void 0||e.forEach(n=>n()),this.unsubscribeOnScroll=[]}createDelay(t=10){let e,n;const i=()=>{e&&clearTimeout(e),n&&n()};return this.timeouts.push(i),()=>new Promise((l,c)=>{i(),n=c,e=setTimeout(()=>{e=void 0,n=void 0,l()},t)})}convertColorValues(t){if(!Array.isArray(t))return t||"";if(t.length<2)return t[0]||"";const e=document.createElement("canvas"),n=e.getContext("2d"),i=e.height*(window.devicePixelRatio||1),l=n.createLinearGradient(0,0,0,i),c=1/(t.length-1);return t.forEach((h,d)=>{const g=d*c;l.addColorStop(g,h)}),l}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(t,e,n,i){const l=t[0],c=t[1]||t[0],h=l.length,{width:d,height:g}=n.canvas,p=g/2,a=this.getPixelRatio(),u=e.barWidth?e.barWidth*a:1,f=e.barGap?e.barGap*a:e.barWidth?u/2:0,y=e.barRadius||0,_=d/(u+f)/h,b=y&&"roundRect"in n?"roundRect":"rect";n.beginPath();let v=0,w=0,T=0;for(let x=0;x<=h;x++){const S=Math.round(x*_);if(S>v){const R=Math.round(w*p*i),L=R+Math.round(T*p*i)||1;let M=p-R;e.barAlign==="top"?M=0:e.barAlign==="bottom"&&(M=g-L),n[b](v*(u+f),M,u,L,y),v=S,w=0,T=0}const C=Math.abs(l[x]||0),A=Math.abs(c[x]||0);C>w&&(w=C),A>T&&(T=A)}n.fill(),n.closePath()}renderLineWaveform(t,e,n,i){const l=c=>{const h=t[c]||t[0],d=h.length,{height:g}=n.canvas,p=g/2,a=n.canvas.width/d;n.moveTo(0,p);let u=0,f=0;for(let y=0;y<=d;y++){const _=Math.round(y*a);if(_>u){const v=p+(Math.round(f*p*i)||1)*(c===0?-1:1);n.lineTo(u,v),u=_,f=0}const b=Math.abs(h[y]||0);b>f&&(f=b)}n.lineTo(u,p)};n.beginPath(),l(0),l(1),n.fill(),n.closePath()}renderWaveform(t,e,n){if(n.fillStyle=this.convertColorValues(e.waveColor),e.renderFunction)return void e.renderFunction(t,n);let i=e.barHeight||1;if(e.normalize){const l=Array.from(t[0]).reduce((c,h)=>Math.max(c,Math.abs(h)),0);i=l?1/l:1}e.barWidth||e.barGap||e.barAlign?this.renderBarWaveform(t,e,n,i):this.renderLineWaveform(t,e,n,i)}renderSingleCanvas(t,e,n,i,l,c,h){const d=this.getPixelRatio(),g=document.createElement("canvas");g.width=Math.round(n*d),g.height=Math.round(i*d),g.style.width=`${n}px`,g.style.height=`${i}px`,g.style.left=`${Math.round(l)}px`,c.appendChild(g);const p=g.getContext("2d");if(this.renderWaveform(t,e,p),g.width>0&&g.height>0){const a=g.cloneNode(),u=a.getContext("2d");u.drawImage(g,0,0),u.globalCompositeOperation="source-in",u.fillStyle=this.convertColorValues(e.progressColor),u.fillRect(0,0,g.width,g.height),h.appendChild(a)}}renderMultiCanvas(t,e,n,i,l,c){const h=this.getPixelRatio(),{clientWidth:d}=this.scrollContainer,g=n/h;let p=Math.min(lo.MAX_CANVAS_WIDTH,d,g),a={};if(e.barWidth||e.barGap){const b=e.barWidth||.5,v=b+(e.barGap||b/2);p%v!=0&&(p=Math.floor(p/v)*v)}if(p===0)return;const u=b=>{if(b<0||b>=f||a[b])return;a[b]=!0;const v=b*p;let w=Math.min(g-v,p);if(e.barWidth||e.barGap){const x=e.barWidth||.5,S=x+(e.barGap||x/2);w=Math.floor(w/S)*S}if(w<=0)return;const T=t.map(x=>{const S=Math.floor(v/g*x.length),C=Math.floor((v+w)/g*x.length);return x.slice(S,C)});this.renderSingleCanvas(T,e,w,i,v,l,c)},f=Math.ceil(g/p);if(!this.isScrollable){for(let b=0;b<f;b++)u(b);return}const y=this.scrollContainer.scrollLeft/g,_=Math.floor(y*f);if(u(_-1),u(_),u(_+1),f>1){const b=this.on("scroll",()=>{const{scrollLeft:v}=this.scrollContainer,w=Math.floor(v/g*f);Object.keys(a).length>lo.MAX_NODES&&(l.innerHTML="",c.innerHTML="",a={}),u(w-1),u(w),u(w+1)});this.unsubscribeOnScroll.push(b)}}renderChannel(t,e,n,i){var{overlay:l}=e,c=function(p,a){var u={};for(var f in p)Object.prototype.hasOwnProperty.call(p,f)&&a.indexOf(f)<0&&(u[f]=p[f]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function"){var y=0;for(f=Object.getOwnPropertySymbols(p);y<f.length;y++)a.indexOf(f[y])<0&&Object.prototype.propertyIsEnumerable.call(p,f[y])&&(u[f[y]]=p[f[y]])}return u}(e,["overlay"]);const h=document.createElement("div"),d=this.getHeight(c.height,c.splitChannels);h.style.height=`${d}px`,l&&i>0&&(h.style.marginTop=`-${d}px`),this.canvasWrapper.style.minHeight=`${d}px`,this.canvasWrapper.appendChild(h);const g=h.cloneNode();this.progressWrapper.appendChild(g),this.renderMultiCanvas(t,c,n,d,h,g)}render(t){return Vt(this,void 0,void 0,function*(){var e;this.timeouts.forEach(d=>d()),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const n=this.getPixelRatio(),i=this.scrollContainer.clientWidth,l=Math.ceil(t.duration*(this.options.minPxPerSec||0));this.isScrollable=l>i;const c=this.options.fillParent&&!this.isScrollable,h=(c?i:l)*n;if(this.wrapper.style.width=c?"100%":`${l}px`,this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}px`,this.audioData=t,this.emit("render"),this.options.splitChannels)for(let d=0;d<t.numberOfChannels;d++){const g=Object.assign(Object.assign({},this.options),(e=this.options.splitChannels)===null||e===void 0?void 0:e[d]);this.renderChannel([t.getChannelData(d)],g,h,d)}else{const d=[t.getChannelData(0)];t.numberOfChannels>1&&d.push(t.getChannelData(1)),this.renderChannel(d,this.options,h,0)}Promise.resolve().then(()=>this.emit("rendered"))})}reRender(){if(this.unsubscribeOnScroll.forEach(n=>n()),this.unsubscribeOnScroll=[],!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:e}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:n}=this.progressWrapper.getBoundingClientRect();let i=n-e;i*=2,i=i<0?Math.floor(i):Math.ceil(i),i/=2,this.scrollContainer.scrollLeft+=i}}zoom(t){this.options.minPxPerSec=t,this.reRender()}scrollIntoView(t,e=!1){const{scrollLeft:n,scrollWidth:i,clientWidth:l}=this.scrollContainer,c=t*i,h=n,d=n+l,g=l/2;if(this.isDragging)c+30>d?this.scrollContainer.scrollLeft+=30:c-30<h&&(this.scrollContainer.scrollLeft-=30);else{(c<h||c>d)&&(this.scrollContainer.scrollLeft=c-(this.options.autoCenter?g:0));const p=c-n-g;e&&this.options.autoCenter&&p>0&&(this.scrollContainer.scrollLeft+=Math.min(p,10))}{const p=this.scrollContainer.scrollLeft,a=p/i,u=(p+l)/i;this.emit("scroll",a,u,p,p+l)}}renderProgress(t,e){if(isNaN(t))return;const n=100*t;this.canvasWrapper.style.clipPath=`polygon(${n}% 0%, 100% 0%, 100% 100%, ${n}% 100%)`,this.progressWrapper.style.width=`${n}%`,this.cursor.style.left=`${n}%`,this.cursor.style.transform=this.options.cursorWidth?`translateX(-${t*this.options.cursorWidth}px)`:"",this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(t,e)}exportImage(t,e,n){return Vt(this,void 0,void 0,function*(){const i=this.canvasWrapper.querySelectorAll("canvas");if(!i.length)throw new Error("No waveform data");if(n==="dataURL"){const l=Array.from(i).map(c=>c.toDataURL(t,e));return Promise.resolve(l)}return Promise.all(Array.from(i).map(l=>new Promise((c,h)=>{l.toBlob(d=>{d?c(d):h(new Error("Could not export image"))},t,e)})))})}}lo.MAX_CANVAS_WIDTH=8e3,lo.MAX_NODES=10;class zT extends ba{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}}class gu extends ba{constructor(t=new AudioContext){super(),this.bufferNode=null,this.playStartTime=0,this.playedDuration=0,this._muted=!1,this._playbackRate=1,this._duration=void 0,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.seeking=!1,this.autoplay=!1,this.addEventListener=this.on,this.removeEventListener=this.un,this.audioContext=t,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return Vt(this,void 0,void 0,function*(){})}get src(){return this.currentSrc}set src(t){if(this.currentSrc=t,this._duration=void 0,!t)return this.buffer=null,void this.emit("emptied");fetch(t).then(e=>{if(e.status>=400)throw new Error(`Failed to fetch ${t}: ${e.status} (${e.statusText})`);return e.arrayBuffer()}).then(e=>this.currentSrc!==t?null:this.audioContext.decodeAudioData(e)).then(e=>{this.currentSrc===t&&(this.buffer=e,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())})}_play(){var t;if(!this.paused)return;this.paused=!1,(t=this.bufferNode)===null||t===void 0||t.disconnect(),this.bufferNode=this.audioContext.createBufferSource(),this.buffer&&(this.bufferNode.buffer=this.buffer),this.bufferNode.playbackRate.value=this._playbackRate,this.bufferNode.connect(this.gainNode);let e=this.playedDuration*this._playbackRate;(e>=this.duration||e<0)&&(e=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,e),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var t;this.paused=!0,(t=this.bufferNode)===null||t===void 0||t.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return Vt(this,void 0,void 0,function*(){this.paused&&(this._play(),this.emit("play"))})}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(t){const e=t-this.currentTime,n=this.bufferNode;n==null||n.stop(this.audioContext.currentTime+e),n==null||n.addEventListener("ended",()=>{n===this.bufferNode&&(this.bufferNode=null,this.pause())},{once:!0})}setSinkId(t){return Vt(this,void 0,void 0,function*(){return this.audioContext.setSinkId(t)})}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,this.bufferNode&&(this.bufferNode.playbackRate.value=t)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(t){const e=!this.paused;e&&this._pause(),this.playedDuration=t/this._playbackRate,e&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var t,e;return(t=this._duration)!==null&&t!==void 0?t:((e=this.buffer)===null||e===void 0?void 0:e.duration)||0}set duration(t){this._duration=t}get volume(){return this.gainNode.gain.value}set volume(t){this.gainNode.gain.value=t,this.emit("volumechange")}get muted(){return this._muted}set muted(t){this._muted!==t&&(this._muted=t,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(t){return/^(audio|video)\//.test(t)}getGainNode(){return this.gainNode}getChannelData(){const t=[];if(!this.buffer)return t;const e=this.buffer.numberOfChannels;for(let n=0;n<e;n++)t.push(this.buffer.getChannelData(n));return t}removeAttribute(t){switch(t){case"src":this.src="";break;case"playbackRate":this.playbackRate=0;break;case"currentTime":this.currentTime=0;break;case"duration":this.duration=0;break;case"volume":this.volume=0;break;case"muted":this.muted=!1}}}const GT={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};class Ds extends WT{static create(t){return new Ds(t)}constructor(t){const e=t.media||(t.backend==="WebAudio"?new gu:void 0);super({media:e,mediaControls:t.mediaControls,autoplay:t.autoplay,playbackRate:t.audioRate}),this.plugins=[],this.decodedData=null,this.stopAtPosition=null,this.subscriptions=[],this.mediaSubscriptions=[],this.abortController=null,this.options=Object.assign({},GT,t),this.timer=new zT;const n=e?void 0:this.getMediaElement();this.renderer=new lo(this.options,n),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const i=this.options.url||this.getSrc()||"";Promise.resolve().then(()=>{this.emit("init");const{peaks:l,duration:c}=this.options;(i||l&&c)&&this.load(i,l,c).catch(()=>null)})}updateProgress(t=this.getCurrentTime()){return this.renderer.renderProgress(t/this.getDuration(),this.isPlaying()),t}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",()=>{if(!this.isSeeking()){const t=this.updateProgress();this.emit("timeupdate",t),this.emit("audioprocess",t),this.stopAtPosition!=null&&this.isPlaying()&&t>=this.stopAtPosition&&this.pause()}}))}initPlayerEvents(){this.isPlaying()&&(this.emit("play"),this.timer.start()),this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",()=>{const t=this.updateProgress();this.emit("timeupdate",t)}),this.onMediaEvent("play",()=>{this.emit("play"),this.timer.start()}),this.onMediaEvent("pause",()=>{this.emit("pause"),this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("emptied",()=>{this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("ended",()=>{this.emit("timeupdate",this.getDuration()),this.emit("finish"),this.stopAtPosition=null}),this.onMediaEvent("seeking",()=>{this.emit("seeking",this.getCurrentTime())}),this.onMediaEvent("error",()=>{var t;this.emit("error",(t=this.getMediaElement().error)!==null&&t!==void 0?t:new Error("Media error")),this.stopAtPosition=null}))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",(t,e)=>{this.options.interact&&(this.seekTo(t),this.emit("interaction",t*this.getDuration()),this.emit("click",t,e))}),this.renderer.on("dblclick",(t,e)=>{this.emit("dblclick",t,e)}),this.renderer.on("scroll",(t,e,n,i)=>{const l=this.getDuration();this.emit("scroll",t*l,e*l,n,i)}),this.renderer.on("render",()=>{this.emit("redraw")}),this.renderer.on("rendered",()=>{this.emit("redrawcomplete")}),this.renderer.on("dragstart",t=>{this.emit("dragstart",t)}),this.renderer.on("dragend",t=>{this.emit("dragend",t)}));{let t;this.subscriptions.push(this.renderer.on("drag",e=>{if(!this.options.interact)return;let n;this.renderer.renderProgress(e),clearTimeout(t),this.isPlaying()?n=0:this.options.dragToSeek===!0?n=200:typeof this.options.dragToSeek=="object"&&this.options.dragToSeek!==void 0&&(n=this.options.dragToSeek.debounceTime),t=setTimeout(()=>{this.seekTo(e)},n),this.emit("interaction",e*this.getDuration()),this.emit("drag",e)}))}}initPlugins(){var t;!((t=this.options.plugins)===null||t===void 0)&&t.length&&this.options.plugins.forEach(e=>{this.registerPlugin(e)})}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach(t=>t()),this.mediaSubscriptions=[]}setOptions(t){this.options=Object.assign({},this.options,t),t.duration&&!t.peaks&&(this.decodedData=ps.createBuffer(this.exportPeaks(),t.duration)),t.peaks&&t.duration&&(this.decodedData=ps.createBuffer(t.peaks,t.duration)),this.renderer.setOptions(this.options),t.audioRate&&this.setPlaybackRate(t.audioRate),t.mediaControls!=null&&(this.getMediaElement().controls=t.mediaControls)}registerPlugin(t){if(this.plugins.includes(t))return t;t._init(this),this.plugins.push(t);const e=t.once("destroy",()=>{this.plugins=this.plugins.filter(n=>n!==t),this.subscriptions=this.subscriptions.filter(n=>n!==e)});return this.subscriptions.push(e),t}unregisterPlugin(t){this.plugins=this.plugins.filter(e=>e!==t),t.destroy()}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(t){return this.renderer.setScroll(t)}setScrollTime(t){const e=t/this.getDuration();this.renderer.setScrollPercentage(e)}getActivePlugins(){return this.plugins}loadAudio(t,e,n,i){return Vt(this,void 0,void 0,function*(){var l;if(this.emit("load",t),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,this.stopAtPosition=null,!e&&!n){const h=this.options.fetchParams||{};window.AbortController&&!h.signal&&(this.abortController=new AbortController,h.signal=(l=this.abortController)===null||l===void 0?void 0:l.signal);const d=p=>this.emit("loading",p);e=yield HT.fetchBlob(t,d,h);const g=this.options.blobMimeType;g&&(e=new Blob([e],{type:g}))}this.setSrc(t,e);const c=yield new Promise(h=>{const d=i||this.getDuration();d?h(d):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",()=>h(this.getDuration()),{once:!0}))});if(!t&&!e){const h=this.getMediaElement();h instanceof gu&&(h.duration=c)}if(n)this.decodedData=ps.createBuffer(n,c||0);else if(e){const h=yield e.arrayBuffer();this.decodedData=yield ps.decode(h,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())})}load(t,e,n){return Vt(this,void 0,void 0,function*(){try{return yield this.loadAudio(t,void 0,e,n)}catch(i){throw this.emit("error",i),i}})}loadBlob(t,e,n){return Vt(this,void 0,void 0,function*(){try{return yield this.loadAudio("",t,e,n)}catch(i){throw this.emit("error",i),i}})}zoom(t){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(t),this.emit("zoom",t)}getDecodedData(){return this.decodedData}exportPeaks({channels:t=2,maxLength:e=8e3,precision:n=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const i=Math.min(t,this.decodedData.numberOfChannels),l=[];for(let c=0;c<i;c++){const h=this.decodedData.getChannelData(c),d=[],g=h.length/e;for(let p=0;p<e;p++){const a=h.slice(Math.floor(p*g),Math.ceil((p+1)*g));let u=0;for(let f=0;f<a.length;f++){const y=a[f];Math.abs(y)>Math.abs(u)&&(u=y)}d.push(Math.round(u*n)/n)}l.push(d)}return l}getDuration(){let t=super.getDuration()||0;return t!==0&&t!==1/0||!this.decodedData||(t=this.decodedData.duration),t}toggleInteraction(t){this.options.interact=t}setTime(t){this.stopAtPosition=null,super.setTime(t),this.updateProgress(t),this.emit("timeupdate",t)}seekTo(t){const e=this.getDuration()*t;this.setTime(e)}play(t,e){const n=Object.create(null,{play:{get:()=>super.play}});return Vt(this,void 0,void 0,function*(){t!=null&&this.setTime(t);const i=yield n.play.call(this);return e!=null&&(this.media instanceof gu?this.media.stopAt(e):this.stopAtPosition=e),i})}playPause(){return Vt(this,void 0,void 0,function*(){return this.isPlaying()?this.pause():this.play()})}stop(){this.pause(),this.setTime(0)}skip(t){this.setTime(this.getCurrentTime()+t)}empty(){this.load("",[[0]],.001)}setMediaElement(t){this.unsubscribePlayerEvents(),super.setMediaElement(t),this.initPlayerEvents()}exportImage(){return Vt(this,arguments,void 0,function*(t="image/png",e=1,n="dataURL"){return this.renderer.exportImage(t,e,n)})}destroy(){var t;this.emit("destroy"),(t=this.abortController)===null||t===void 0||t.abort(),this.plugins.forEach(e=>e.destroy()),this.subscriptions.forEach(e=>e()),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}}Ds.BasePlugin=class extends ba{constructor(r){super(),this.subscriptions=[],this.isDestroyed=!1,this.options=r}onInit(){}_init(r){this.isDestroyed&&(this.subscriptions=[],this.isDestroyed=!1),this.wavesurfer=r,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(r=>r()),this.subscriptions=[],this.isDestroyed=!0,this.wavesurfer=void 0}},Ds.dom=UT;function eo(r,t,e){var h;let n=(h=e.initialDeps)!=null?h:[],i,l=!0;function c(){var d,g,p;let a;e.key&&((d=e.debug)!=null&&d.call(e))&&(a=Date.now());const u=r();if(!(u.length!==n.length||u.some((_,b)=>n[b]!==_)))return i;n=u;let y;if(e.key&&((g=e.debug)!=null&&g.call(e))&&(y=Date.now()),i=t(...u),e.key&&((p=e.debug)!=null&&p.call(e))){const _=Math.round((Date.now()-a)*100)/100,b=Math.round((Date.now()-y)*100)/100,v=b/16,w=(T,x)=>{for(T=String(T);T.length<x;)T=" "+T;return T};console.info(`%c⏱ ${w(b,5)} /${w(_,5)} ms`,`
font-size: .6rem;
font-weight: bold;
color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,e==null?void 0:e.key)}return e!=null&&e.onChange&&!(l&&e.skipInitialOnChange)&&e.onChange(i),l=!1,i}return c.updateDeps=d=>{n=d},c}function Yh(r,t){if(r===void 0)throw new Error("Unexpected undefined");return r}const YT=(r,t)=>Math.abs(r-t)<1.01,VT=(r,t,e)=>{let n;return function(...i){r.clearTimeout(n),n=r.setTimeout(()=>t.apply(this,i),e)}},Vh=r=>{const{offsetWidth:t,offsetHeight:e}=r;return{width:t,height:e}},KT=r=>r,XT=r=>{const t=Math.max(r.startIndex-r.overscan,0),e=Math.min(r.endIndex+r.overscan,r.count-1),n=[];for(let i=t;i<=e;i++)n.push(i);return n},CA=(r,t)=>{const e=r.scrollElement;if(!e)return;const n=r.targetWindow;if(!n)return;const i=c=>{const{width:h,height:d}=c;t({width:Math.round(h),height:Math.round(d)})};if(i(Vh(e)),!n.ResizeObserver)return()=>{};const l=new n.ResizeObserver(c=>{const h=()=>{const d=c[0];if(d!=null&&d.borderBoxSize){const g=d.borderBoxSize[0];if(g){i({width:g.inlineSize,height:g.blockSize});return}}i(Vh(e))};r.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(h):h()});return l.observe(e,{box:"border-box"}),()=>{l.unobserve(e)}},Kh={passive:!0},Xh=typeof window=="undefined"?!0:"onscrollend"in window,kA=(r,t)=>{const e=r.scrollElement;if(!e)return;const n=r.targetWindow;if(!n)return;let i=0;const l=r.options.useScrollendEvent&&Xh?()=>{}:VT(n,()=>{t(i,!1)},r.options.isScrollingResetDelay),c=p=>()=>{const{horizontal:a,isRtl:u}=r.options;i=a?e.scrollLeft*(u&&-1||1):e.scrollTop,l(),t(i,p)},h=c(!0),d=c(!1);d(),e.addEventListener("scroll",h,Kh);const g=r.options.useScrollendEvent&&Xh;return g&&e.addEventListener("scrollend",d,Kh),()=>{e.removeEventListener("scroll",h),g&&e.removeEventListener("scrollend",d)}},ZT=(r,t,e)=>{if(t!=null&&t.borderBoxSize){const n=t.borderBoxSize[0];if(n)return Math.round(n[e.options.horizontal?"inlineSize":"blockSize"])}return r[e.options.horizontal?"offsetWidth":"offsetHeight"]},PA=(r,{adjustments:t=0,behavior:e},n)=>{var i,l;const c=r+t;(l=(i=n.scrollElement)==null?void 0:i.scrollTo)==null||l.call(i,{[n.options.horizontal?"left":"top"]:c,behavior:e})};class RA{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const n=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(i=>{i.forEach(l=>{const c=()=>{this._measureElement(l.target,l)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()})}));return{disconnect:()=>{var i;(i=n())==null||i.disconnect(),e=null},observe:i=>{var l;return(l=n())==null?void 0:l.observe(i,{box:"border-box"})},unobserve:i=>{var l;return(l=n())==null?void 0:l.unobserve(i)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([n,i])=>{typeof i=="undefined"&&delete e[n]}),this.options=st({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:KT,rangeExtractor:XT,onChange:()=>{},measureElement:ZT,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1},e)},this.notify=e=>{var n,i;(i=(n=this.options).onChange)==null||i.call(n,this,e)},this.maybeNotify=eo(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;var e;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(i=(e=this.scrollElement)==null?void 0:e.window)!=null?i:null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,c)=>{this.scrollAdjustments=0,this.scrollDirection=c?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=c,this.maybeNotify()}))}},this.getSize=()=>{var e;return this.options.enabled?(this.scrollRect=(e=this.scrollRect)!=null?e:this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0)},this.getScrollOffset=()=>{var e;return this.options.enabled?(this.scrollOffset=(e=this.scrollOffset)!=null?e:typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset,this.scrollOffset):(this.scrollOffset=null,0)},this.getFurthestMeasurement=(e,n)=>{const i=new Map,l=new Map;for(let c=n-1;c>=0;c--){const h=e[c];if(i.has(h.lane))continue;const d=l.get(h.lane);if(d==null||h.end>d.end?l.set(h.lane,h):h.end<d.end&&i.set(h.lane,!0),i.size===this.options.lanes)break}return l.size===this.options.lanes?Array.from(l.values()).sort((c,h)=>c.end===h.end?c.index-h.index:c.end-h.end)[0]:void 0},this.getMeasurementOptions=eo(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,n,i,l,c,h)=>(this.prevLanes!==void 0&&this.prevLanes!==h&&(this.lanesChangedFlag=!0),this.prevLanes=h,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:n,scrollMargin:i,getItemKey:l,enabled:c,lanes:h}),{key:!1,skipInitialOnChange:!0,onChange:()=>{this.notify(this.isScrolling)}}),this.getMeasurements=eo(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:n,scrollMargin:i,getItemKey:l,enabled:c,lanes:h},d)=>{if(!c)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const u of this.laneAssignments.keys())u>=e&&this.laneAssignments.delete(u);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const g=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);const p=this.measurementsCache.slice(0,g),a=new Array(h).fill(void 0);for(let u=0;u<g;u++){const f=p[u];f&&(a[f.lane]=u)}for(let u=g;u<e;u++){const f=l(u),y=this.laneAssignments.get(u);let _,b;if(y!==void 0&&this.options.lanes>1){_=y;const x=a[_],S=x!==void 0?p[x]:void 0;b=S?S.end+this.options.gap:n+i}else{const x=this.options.lanes===1?p[u-1]:this.getFurthestMeasurement(p,u);b=x?x.end+this.options.gap:n+i,_=x?x.lane:u%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(u,_)}const v=d.get(f),w=typeof v=="number"?v:this.options.estimateSize(u),T=b+w;p[u]={index:u,start:b,size:w,end:T,key:f,lane:_},a[_]=u}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=eo(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,n,i,l)=>this.range=e.length>0&&n>0?QT({measurements:e,outerSize:n,scrollOffset:i,lanes:l}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=eo(()=>{let e=null,n=null;const i=this.calculateRange();return i&&(e=i.startIndex,n=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,n]},(e,n,i,l,c)=>l===null||c===null?[]:e({startIndex:l,endIndex:c,overscan:n,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const n=this.options.indexAttribute,i=e.getAttribute(n);return i?parseInt(i,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this._measureElement=(e,n)=>{const i=this.indexFromElement(e),l=this.measurementsCache[i];if(!l)return;const c=l.key,h=this.elementsCache.get(c);h!==e&&(h&&this.observer.unobserve(h),this.observer.observe(e),this.elementsCache.set(c,e)),e.isConnected&&this.resizeItem(i,this.options.measureElement(e,n,this))},this.resizeItem=(e,n)=>{var h;const i=this.measurementsCache[e];if(!i)return;const l=(h=this.itemSizeCache.get(i.key))!=null?h:i.size,c=n-l;c!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,c,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=c,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,n)),this.notify(!1))},this.measureElement=e=>{if(!e){this.elementsCache.forEach((n,i)=>{n.isConnected||(this.observer.unobserve(n),this.elementsCache.delete(i))});return}this._measureElement(e,void 0)},this.getVirtualItems=eo(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,n)=>{const i=[];for(let l=0,c=e.length;l<c;l++){const h=e[l],d=n[h];i.push(d)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const n=this.getMeasurements();if(n.length!==0)return Yh(n[eg(0,n.length-1,i=>Yh(n[i]).start,e)])},this.getOffsetForAlignment=(e,n,i=0)=>{const l=this.getSize(),c=this.getScrollOffset();n==="auto"&&(n=e>=c+l?"end":"start"),n==="center"?e+=(i-l)/2:n==="end"&&(e-=l);const h=this.getTotalSize()+this.options.scrollMargin-l;return Math.max(Math.min(h,e),0)},this.getOffsetForIndex=(e,n="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const i=this.measurementsCache[e];if(!i)return;const l=this.getSize(),c=this.getScrollOffset();if(n==="auto")if(i.end>=c+l-this.options.scrollPaddingEnd)n="end";else if(i.start<=c+this.options.scrollPaddingStart)n="start";else return[c,n];const h=n==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(h,n,i.size),n]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:n="start",behavior:i}={})=>{i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,n),{adjustments:void 0,behavior:i})},this.scrollToIndex=(e,{align:n="auto",behavior:i}={})=>{i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1));let l=0;const c=10,h=g=>{if(!this.targetWindow)return;const p=this.getOffsetForIndex(e,g);if(!p){console.warn("Failed to get offset for index:",e);return}const[a,u]=p;this._scrollToOffset(a,{adjustments:void 0,behavior:i}),this.targetWindow.requestAnimationFrame(()=>{const f=this.getScrollOffset(),y=this.getOffsetForIndex(e,u);if(!y){console.warn("Failed to get offset for index:",e);return}YT(y[0],f)||d(u)})},d=g=>{this.targetWindow&&(l++,l<c?this.targetWindow.requestAnimationFrame(()=>h(g)):console.warn(`Failed to scroll to index ${e} after ${c} attempts.`))};h(n)},this.scrollBy=(e,{behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:n})},this.getTotalSize=()=>{var l;var e;const n=this.getMeasurements();let i;if(n.length===0)i=this.options.paddingStart;else if(this.options.lanes===1)i=(l=(e=n[n.length-1])==null?void 0:e.end)!=null?l:0;else{const c=Array(this.options.lanes).fill(null);let h=n.length-1;for(;h>=0&&c.some(d=>d===null);){const d=n[h];c[d.lane]===null&&(c[d.lane]=d.end),h--}i=Math.max(...c.filter(d=>d!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:n,behavior:i})=>{this.options.scrollToFn(e,{behavior:i,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const eg=(r,t,e,n)=>{for(;r<=t;){const i=(r+t)/2|0,l=e(i);if(l<n)r=i+1;else if(l>n)t=i-1;else return i}return r>0?r-1:0};function QT({measurements:r,outerSize:t,scrollOffset:e,lanes:n}){const i=r.length-1,l=d=>r[d].start;if(r.length<=n)return{startIndex:0,endIndex:i};let c=eg(0,i,l,e),h=c;if(n===1)for(;h<i&&r[h].end<e+t;)h++;else if(n>1){const d=Array(n).fill(0);for(;h<i&&d.some(p=>p<e+t);){const p=r[h];d[p.lane]=p.end,h++}const g=Array(n).fill(e+t);for(;c>=0&&g.some(p=>p>=e);){const p=r[c];g[p.lane]=p.start,c--}c=Math.max(0,c-c%n),h=Math.min(i,h+(n-1-h%n))}return{startIndex:c,endIndex:h}}const uo=Math.min,vi=Math.max,Ls=Math.round,gs=Math.floor,er=r=>({x:r,y:r}),JT={left:"right",right:"left",bottom:"top",top:"bottom"},eS={start:"end",end:"start"};function qu(r,t,e){return vi(r,uo(t,e))}function wa(r,t){return typeof r=="function"?r(t):r}function yi(r){return r.split("-")[0]}function xa(r){return r.split("-")[1]}function tg(r){return r==="x"?"y":"x"}function uc(r){return r==="y"?"height":"width"}const tS=new Set(["top","bottom"]);function qr(r){return tS.has(yi(r))?"y":"x"}function cc(r){return tg(qr(r))}function nS(r,t,e){e===void 0&&(e=!1);const n=xa(r),i=cc(r),l=uc(i);let c=i==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=Is(c)),[c,Is(c)]}function rS(r){const t=Is(r);return[ju(r),t,ju(t)]}function ju(r){return r.replace(/start|end/g,t=>eS[t])}const Zh=["left","right"],Qh=["right","left"],iS=["top","bottom"],oS=["bottom","top"];function aS(r,t,e){switch(r){case"top":case"bottom":return e?t?Qh:Zh:t?Zh:Qh;case"left":case"right":return t?iS:oS;default:return[]}}function sS(r,t,e,n){const i=xa(r);let l=aS(yi(r),e==="start",n);return i&&(l=l.map(c=>c+"-"+i),t&&(l=l.concat(l.map(ju)))),l}function Is(r){return r.replace(/left|right|bottom|top/g,t=>JT[t])}function lS(r){return st({top:0,right:0,bottom:0,left:0},r)}function ng(r){return typeof r!="number"?lS(r):{top:r,right:r,bottom:r,left:r}}function Ns(r){const{x:t,y:e,width:n,height:i}=r;return{width:n,height:i,top:e,left:t,right:t+n,bottom:e+i,x:t,y:e}}function Jh(r,t,e){let{reference:n,floating:i}=r;const l=qr(t),c=cc(t),h=uc(c),d=yi(t),g=l==="y",p=n.x+n.width/2-i.width/2,a=n.y+n.height/2-i.height/2,u=n[h]/2-i[h]/2;let f;switch(d){case"top":f={x:p,y:n.y-i.height};break;case"bottom":f={x:p,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:a};break;case"left":f={x:n.x-i.width,y:a};break;default:f={x:n.x,y:n.y}}switch(xa(t)){case"start":f[c]-=u*(e&&g?-1:1);break;case"end":f[c]+=u*(e&&g?-1:1);break}return f}const uS=(r,t,e)=>tt(void 0,null,function*(){const{placement:n="bottom",strategy:i="absolute",middleware:l=[],platform:c}=e,h=l.filter(Boolean),d=yield c.isRTL==null?void 0:c.isRTL(t);let g=yield c.getElementRects({reference:r,floating:t,strategy:i}),{x:p,y:a}=Jh(g,n,d),u=n,f={},y=0;for(let _=0;_<h.length;_++){const{name:b,fn:v}=h[_],{x:w,y:T,data:x,reset:S}=yield v({x:p,y:a,initialPlacement:n,placement:u,strategy:i,middlewareData:f,rects:g,platform:c,elements:{reference:r,floating:t}});p=w!=null?w:p,a=T!=null?T:a,f=Ut(st({},f),{[b]:st(st({},f[b]),x)}),S&&y<=50&&(y++,typeof S=="object"&&(S.placement&&(u=S.placement),S.rects&&(g=S.rects===!0?yield c.getElementRects({reference:r,floating:t,strategy:i}):S.rects),{x:p,y:a}=Jh(g,u,d)),_=-1)}return{x:p,y:a,placement:u,strategy:i,middlewareData:f}});function rg(r,t){return tt(this,null,function*(){var e;t===void 0&&(t={});const{x:n,y:i,platform:l,rects:c,elements:h,strategy:d}=r,{boundary:g="clippingAncestors",rootBoundary:p="viewport",elementContext:a="floating",altBoundary:u=!1,padding:f=0}=wa(t,r),y=ng(f),b=h[u?a==="floating"?"reference":"floating":a],v=Ns(yield l.getClippingRect({element:(e=yield l.isElement==null?void 0:l.isElement(b))==null||e?b:b.contextElement||(yield l.getDocumentElement==null?void 0:l.getDocumentElement(h.floating)),boundary:g,rootBoundary:p,strategy:d})),w=a==="floating"?{x:n,y:i,width:c.floating.width,height:c.floating.height}:c.reference,T=yield l.getOffsetParent==null?void 0:l.getOffsetParent(h.floating),x=(yield l.isElement==null?void 0:l.isElement(T))?(yield l.getScale==null?void 0:l.getScale(T))||{x:1,y:1}:{x:1,y:1},S=Ns(l.convertOffsetParentRelativeRectToViewportRelativeRect?yield l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:w,offsetParent:T,strategy:d}):w);return{top:(v.top-S.top+y.top)/x.y,bottom:(S.bottom-v.bottom+y.bottom)/x.y,left:(v.left-S.left+y.left)/x.x,right:(S.right-v.right+y.right)/x.x}})}const cS=r=>({name:"arrow",options:r,fn(e){return tt(this,null,function*(){const{x:n,y:i,placement:l,rects:c,platform:h,elements:d,middlewareData:g}=e,{element:p,padding:a=0}=wa(r,e)||{};if(p==null)return{};const u=ng(a),f={x:n,y:i},y=cc(l),_=uc(y),b=yield h.getDimensions(p),v=y==="y",w=v?"top":"left",T=v?"bottom":"right",x=v?"clientHeight":"clientWidth",S=c.reference[_]+c.reference[y]-f[y]-c.floating[_],C=f[y]-c.reference[y],A=yield h.getOffsetParent==null?void 0:h.getOffsetParent(p);let R=A?A[x]:0;(!R||!(yield h.isElement==null?void 0:h.isElement(A)))&&(R=d.floating[x]||c.floating[_]);const L=S/2-C/2,M=R/2-b[_]/2-1,k=uo(u[w],M),P=uo(u[T],M),I=k,j=R-b[_]-P,W=R/2-b[_]/2+L,J=qu(I,W,j),ee=!g.arrow&&xa(l)!=null&&W!==J&&c.reference[_]/2-(W<I?k:P)-b[_]/2<0,oe=ee?W<I?W-I:W-j:0;return{[y]:f[y]+oe,data:st({[y]:J,centerOffset:W-J-oe},ee&&{alignmentOffset:oe}),reset:ee}})}}),fS=function(r){return r===void 0&&(r={}),{name:"flip",options:r,fn(e){return tt(this,null,function*(){var n,i;const{placement:l,middlewareData:c,rects:h,initialPlacement:d,platform:g,elements:p}=e,W=wa(r,e),{mainAxis:a=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:b=!0}=W,v=hs(W,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=c.arrow)!=null&&n.alignmentOffset)return{};const w=yi(l),T=qr(d),x=yi(d)===d,S=yield g.isRTL==null?void 0:g.isRTL(p.floating),C=f||(x||!b?[Is(d)]:rS(d)),A=_!=="none";!f&&A&&C.push(...sS(d,b,_,S));const R=[d,...C],L=yield rg(e,v),M=[];let k=((i=c.flip)==null?void 0:i.overflows)||[];if(a&&M.push(L[w]),u){const J=nS(l,h,S);M.push(L[J[0]],L[J[1]])}if(k=[...k,{placement:l,overflows:M}],!M.every(J=>J<=0)){var P,I;const J=(((P=c.flip)==null?void 0:P.index)||0)+1,ee=R[J];if(ee&&(!(u==="alignment"?T!==qr(ee):!1)||k.every($=>qr($.placement)===T?$.overflows[0]>0:!0)))return{data:{index:J,overflows:k},reset:{placement:ee}};let oe=(I=k.filter(V=>V.overflows[0]<=0).sort((V,$)=>V.overflows[1]-$.overflows[1])[0])==null?void 0:I.placement;if(!oe)switch(y){case"bestFit":{var j;const V=(j=k.filter($=>{if(A){const N=qr($.placement);return N===T||N==="y"}return!0}).map($=>[$.placement,$.overflows.filter(N=>N>0).reduce((N,H)=>N+H,0)]).sort(($,N)=>$[1]-N[1])[0])==null?void 0:j[0];V&&(oe=V);break}case"initialPlacement":oe=d;break}if(l!==oe)return{reset:{placement:oe}}}return{}})}}},hS=new Set(["left","top"]);function dS(r,t){return tt(this,null,function*(){const{placement:e,platform:n,elements:i}=r,l=yield n.isRTL==null?void 0:n.isRTL(i.floating),c=yi(e),h=xa(e),d=qr(e)==="y",g=hS.has(c)?-1:1,p=l&&d?-1:1,a=wa(t,r);let{mainAxis:u,crossAxis:f,alignmentAxis:y}=typeof a=="number"?{mainAxis:a,crossAxis:0,alignmentAxis:null}:{mainAxis:a.mainAxis||0,crossAxis:a.crossAxis||0,alignmentAxis:a.alignmentAxis};return h&&typeof y=="number"&&(f=h==="end"?y*-1:y),d?{x:f*p,y:u*g}:{x:u*g,y:f*p}})}const pS=function(r){return r===void 0&&(r=0),{name:"offset",options:r,fn(e){return tt(this,null,function*(){var n,i;const{x:l,y:c,placement:h,middlewareData:d}=e,g=yield dS(e,r);return h===((n=d.offset)==null?void 0:n.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:l+g.x,y:c+g.y,data:Ut(st({},g),{placement:h})}})}}},gS=function(r){return r===void 0&&(r={}),{name:"shift",options:r,fn(e){return tt(this,null,function*(){const{x:n,y:i,placement:l}=e,v=wa(r,e),{mainAxis:c=!0,crossAxis:h=!1,limiter:d={fn:w=>{let{x:T,y:x}=w;return{x:T,y:x}}}}=v,g=hs(v,["mainAxis","crossAxis","limiter"]),p={x:n,y:i},a=yield rg(e,g),u=qr(yi(l)),f=tg(u);let y=p[f],_=p[u];if(c){const w=f==="y"?"top":"left",T=f==="y"?"bottom":"right",x=y+a[w],S=y-a[T];y=qu(x,y,S)}if(h){const w=u==="y"?"top":"left",T=u==="y"?"bottom":"right",x=_+a[w],S=_-a[T];_=qu(x,_,S)}const b=d.fn(Ut(st({},e),{[f]:y,[u]:_}));return Ut(st({},b),{data:{x:b.x-n,y:b.y-i,enabled:{[f]:c,[u]:h}}})})}}};function Xs(){return typeof window!="undefined"}function ho(r){return ig(r)?(r.nodeName||"").toLowerCase():"#document"}function xn(r){var t;return(r==null||(t=r.ownerDocument)==null?void 0:t.defaultView)||window}function rr(r){var t;return(t=(ig(r)?r.ownerDocument:r.document)||window.document)==null?void 0:t.documentElement}function ig(r){return Xs()?r instanceof Node||r instanceof xn(r).Node:!1}function Un(r){return Xs()?r instanceof Element||r instanceof xn(r).Element:!1}function nr(r){return Xs()?r instanceof HTMLElement||r instanceof xn(r).HTMLElement:!1}function ed(r){return!Xs()||typeof ShadowRoot=="undefined"?!1:r instanceof ShadowRoot||r instanceof xn(r).ShadowRoot}const mS=new Set(["inline","contents"]);function Ta(r){const{overflow:t,overflowX:e,overflowY:n,display:i}=Hn(r);return/auto|scroll|overlay|hidden|clip/.test(t+n+e)&&!mS.has(i)}const vS=new Set(["table","td","th"]);function yS(r){return vS.has(ho(r))}const _S=[":popover-open",":modal"];function Zs(r){return _S.some(t=>{try{return r.matches(t)}catch(e){return!1}})}const bS=["transform","translate","scale","rotate","perspective"],wS=["transform","translate","scale","rotate","perspective","filter"],xS=["paint","layout","strict","content"];function fc(r){const t=hc(),e=Un(r)?Hn(r):r;return bS.some(n=>e[n]?e[n]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||wS.some(n=>(e.willChange||"").includes(n))||xS.some(n=>(e.contain||"").includes(n))}function TS(r){let t=Ur(r);for(;nr(t)&&!co(t);){if(fc(t))return t;if(Zs(t))return null;t=Ur(t)}return null}function hc(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const SS=new Set(["html","body","#document"]);function co(r){return SS.has(ho(r))}function Hn(r){return xn(r).getComputedStyle(r)}function Qs(r){return Un(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function Ur(r){if(ho(r)==="html")return r;const t=r.assignedSlot||r.parentNode||ed(r)&&r.host||rr(r);return ed(t)?t.host:t}function og(r){const t=Ur(r);return co(t)?r.ownerDocument?r.ownerDocument.body:r.body:nr(t)&&Ta(t)?t:og(t)}function ga(r,t,e){var n;t===void 0&&(t=[]),e===void 0&&(e=!0);const i=og(r),l=i===((n=r.ownerDocument)==null?void 0:n.body),c=xn(i);if(l){const h=$u(c);return t.concat(c,c.visualViewport||[],Ta(i)?i:[],h&&e?ga(h):[])}return t.concat(i,ga(i,[],e))}function $u(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function ag(r){const t=Hn(r);let e=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=nr(r),l=i?r.offsetWidth:e,c=i?r.offsetHeight:n,h=Ls(e)!==l||Ls(n)!==c;return h&&(e=l,n=c),{width:e,height:n,$:h}}function dc(r){return Un(r)?r:r.contextElement}function ao(r){const t=dc(r);if(!nr(t))return er(1);const e=t.getBoundingClientRect(),{width:n,height:i,$:l}=ag(t);let c=(l?Ls(e.width):e.width)/n,h=(l?Ls(e.height):e.height)/i;return(!c||!Number.isFinite(c))&&(c=1),(!h||!Number.isFinite(h))&&(h=1),{x:c,y:h}}const OS=er(0);function sg(r){const t=xn(r);return!hc()||!t.visualViewport?OS:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ES(r,t,e){return t===void 0&&(t=!1),!e||t&&e!==xn(r)?!1:t}function _i(r,t,e,n){t===void 0&&(t=!1),e===void 0&&(e=!1);const i=r.getBoundingClientRect(),l=dc(r);let c=er(1);t&&(n?Un(n)&&(c=ao(n)):c=ao(r));const h=ES(l,e,n)?sg(l):er(0);let d=(i.left+h.x)/c.x,g=(i.top+h.y)/c.y,p=i.width/c.x,a=i.height/c.y;if(l){const u=xn(l),f=n&&Un(n)?xn(n):n;let y=u,_=$u(y);for(;_&&n&&f!==y;){const b=ao(_),v=_.getBoundingClientRect(),w=Hn(_),T=v.left+(_.clientLeft+parseFloat(w.paddingLeft))*b.x,x=v.top+(_.clientTop+parseFloat(w.paddingTop))*b.y;d*=b.x,g*=b.y,p*=b.x,a*=b.y,d+=T,g+=x,y=xn(_),_=$u(y)}}return Ns({width:p,height:a,x:d,y:g})}function Js(r,t){const e=Qs(r).scrollLeft;return t?t.left+e:_i(rr(r)).left+e}function lg(r,t){const e=r.getBoundingClientRect(),n=e.left+t.scrollLeft-Js(r,e),i=e.top+t.scrollTop;return{x:n,y:i}}function AS(r){let{elements:t,rect:e,offsetParent:n,strategy:i}=r;const l=i==="fixed",c=rr(n),h=t?Zs(t.floating):!1;if(n===c||h&&l)return e;let d={scrollLeft:0,scrollTop:0},g=er(1);const p=er(0),a=nr(n);if((a||!a&&!l)&&((ho(n)!=="body"||Ta(c))&&(d=Qs(n)),nr(n))){const f=_i(n);g=ao(n),p.x=f.x+n.clientLeft,p.y=f.y+n.clientTop}const u=c&&!a&&!l?lg(c,d):er(0);return{width:e.width*g.x,height:e.height*g.y,x:e.x*g.x-d.scrollLeft*g.x+p.x+u.x,y:e.y*g.y-d.scrollTop*g.y+p.y+u.y}}function CS(r){return Array.from(r.getClientRects())}function kS(r){const t=rr(r),e=Qs(r),n=r.ownerDocument.body,i=vi(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),l=vi(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let c=-e.scrollLeft+Js(r);const h=-e.scrollTop;return Hn(n).direction==="rtl"&&(c+=vi(t.clientWidth,n.clientWidth)-i),{width:i,height:l,x:c,y:h}}const td=25;function PS(r,t){const e=xn(r),n=rr(r),i=e.visualViewport;let l=n.clientWidth,c=n.clientHeight,h=0,d=0;if(i){l=i.width,c=i.height;const p=hc();(!p||p&&t==="fixed")&&(h=i.offsetLeft,d=i.offsetTop)}const g=Js(n);if(g<=0){const p=n.ownerDocument,a=p.body,u=getComputedStyle(a),f=p.compatMode==="CSS1Compat"&&parseFloat(u.marginLeft)+parseFloat(u.marginRight)||0,y=Math.abs(n.clientWidth-a.clientWidth-f);y<=td&&(l-=y)}else g<=td&&(l+=g);return{width:l,height:c,x:h,y:d}}const RS=new Set(["absolute","fixed"]);function MS(r,t){const e=_i(r,!0,t==="fixed"),n=e.top+r.clientTop,i=e.left+r.clientLeft,l=nr(r)?ao(r):er(1),c=r.clientWidth*l.x,h=r.clientHeight*l.y,d=i*l.x,g=n*l.y;return{width:c,height:h,x:d,y:g}}function nd(r,t,e){let n;if(t==="viewport")n=PS(r,e);else if(t==="document")n=kS(rr(r));else if(Un(t))n=MS(t,e);else{const i=sg(r);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ns(n)}function ug(r,t){const e=Ur(r);return e===t||!Un(e)||co(e)?!1:Hn(e).position==="fixed"||ug(e,t)}function DS(r,t){const e=t.get(r);if(e)return e;let n=ga(r,[],!1).filter(h=>Un(h)&&ho(h)!=="body"),i=null;const l=Hn(r).position==="fixed";let c=l?Ur(r):r;for(;Un(c)&&!co(c);){const h=Hn(c),d=fc(c);!d&&h.position==="fixed"&&(i=null),(l?!d&&!i:!d&&h.position==="static"&&!!i&&RS.has(i.position)||Ta(c)&&!d&&ug(r,c))?n=n.filter(p=>p!==c):i=h,c=Ur(c)}return t.set(r,n),n}function LS(r){let{element:t,boundary:e,rootBoundary:n,strategy:i}=r;const c=[...e==="clippingAncestors"?Zs(t)?[]:DS(t,this._c):[].concat(e),n],h=c[0],d=c.reduce((g,p)=>{const a=nd(t,p,i);return g.top=vi(a.top,g.top),g.right=uo(a.right,g.right),g.bottom=uo(a.bottom,g.bottom),g.left=vi(a.left,g.left),g},nd(t,h,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function IS(r){const{width:t,height:e}=ag(r);return{width:t,height:e}}function NS(r,t,e){const n=nr(t),i=rr(t),l=e==="fixed",c=_i(r,!0,l,t);let h={scrollLeft:0,scrollTop:0};const d=er(0);function g(){d.x=Js(i)}if(n||!n&&!l)if((ho(t)!=="body"||Ta(i))&&(h=Qs(t)),n){const f=_i(t,!0,l,t);d.x=f.x+t.clientLeft,d.y=f.y+t.clientTop}else i&&g();l&&!n&&i&&g();const p=i&&!n&&!l?lg(i,h):er(0),a=c.left+h.scrollLeft-d.x-p.x,u=c.top+h.scrollTop-d.y-p.y;return{x:a,y:u,width:c.width,height:c.height}}function mu(r){return Hn(r).position==="static"}function rd(r,t){if(!nr(r)||Hn(r).position==="fixed")return null;if(t)return t(r);let e=r.offsetParent;return rr(r)===e&&(e=e.ownerDocument.body),e}function cg(r,t){const e=xn(r);if(Zs(r))return e;if(!nr(r)){let i=Ur(r);for(;i&&!co(i);){if(Un(i)&&!mu(i))return i;i=Ur(i)}return e}let n=rd(r,t);for(;n&&yS(n)&&mu(n);)n=rd(n,t);return n&&co(n)&&mu(n)&&!fc(n)?e:n||TS(r)||e}const BS=function(r){return tt(this,null,function*(){const t=this.getOffsetParent||cg,e=this.getDimensions,n=yield e(r.floating);return{reference:NS(r.reference,yield t(r.floating),r.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}})};function FS(r){return Hn(r).direction==="rtl"}const qS={convertOffsetParentRelativeRectToViewportRelativeRect:AS,getDocumentElement:rr,getClippingRect:LS,getOffsetParent:cg,getElementRects:BS,getClientRects:CS,getDimensions:IS,getScale:ao,isElement:Un,isRTL:FS};function fg(r,t){return r.x===t.x&&r.y===t.y&&r.width===t.width&&r.height===t.height}function jS(r,t){let e=null,n;const i=rr(r);function l(){var h;clearTimeout(n),(h=e)==null||h.disconnect(),e=null}function c(h,d){h===void 0&&(h=!1),d===void 0&&(d=1),l();const g=r.getBoundingClientRect(),{left:p,top:a,width:u,height:f}=g;if(h||t(),!u||!f)return;const y=gs(a),_=gs(i.clientWidth-(p+u)),b=gs(i.clientHeight-(a+f)),v=gs(p),T={rootMargin:-y+"px "+-_+"px "+-b+"px "+-v+"px",threshold:vi(0,uo(1,d))||1};let x=!0;function S(C){const A=C[0].intersectionRatio;if(A!==d){if(!x)return c();A?c(!1,A):n=setTimeout(()=>{c(!1,1e-7)},1e3)}A===1&&!fg(g,r.getBoundingClientRect())&&c(),x=!1}try{e=new IntersectionObserver(S,Ut(st({},T),{root:i.ownerDocument}))}catch(C){e=new IntersectionObserver(S,T)}e.observe(r)}return c(!0),l}function MA(r,t,e,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,g=dc(r),p=i||l?[...g?ga(g):[],...ga(t)]:[];p.forEach(v=>{i&&v.addEventListener("scroll",e,{passive:!0}),l&&v.addEventListener("resize",e)});const a=g&&h?jS(g,e):null;let u=-1,f=null;c&&(f=new ResizeObserver(v=>{let[w]=v;w&&w.target===g&&f&&(f.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var T;(T=f)==null||T.observe(t)})),e()}),g&&!d&&f.observe(g),f.observe(t));let y,_=d?_i(r):null;d&&b();function b(){const v=_i(r);_&&!fg(_,v)&&e(),_=v,y=requestAnimationFrame(b)}return e(),()=>{var v;p.forEach(w=>{i&&w.removeEventListener("scroll",e),l&&w.removeEventListener("resize",e)}),a==null||a(),(v=f)==null||v.disconnect(),f=null,d&&cancelAnimationFrame(y)}}const DA=pS,LA=gS,IA=fS,NA=cS,BA=(r,t,e)=>{const n=new Map,i=st({platform:qS},e),l=Ut(st({},i.platform),{_c:n});return uS(r,t,Ut(st({},i),{platform:l}))},hg=6048e5,$S=864e5,US=6e4,HS=36e5,WS=1e3,id=Symbol.for("constructDateFrom");function mt(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&id in r?r[id](t):r instanceof Date?new r.constructor(t):new Date(t)}function je(r,t){return mt(t||r,r)}function el(r,t,e){const n=je(r,e==null?void 0:e.in);return isNaN(t)?mt((e==null?void 0:e.in)||r,NaN):(t&&n.setDate(n.getDate()+t),n)}function tl(r,t,e){const n=je(r,e==null?void 0:e.in);if(isNaN(t))return mt(r,NaN);if(!t)return n;const i=n.getDate(),l=mt(r,n.getTime());l.setMonth(n.getMonth()+t+1,0);const c=l.getDate();return i>=c?l:(n.setFullYear(l.getFullYear(),l.getMonth(),i),n)}function FA(r,t,e){const{years:n=0,months:i=0,weeks:l=0,days:c=0,hours:h=0,minutes:d=0,seconds:g=0}=t,p=je(r,e==null?void 0:e.in),a=i||n?tl(p,i+n*12):p,u=c||l?el(a,c+l*7):a,f=d+h*60,_=(g+f*60)*1e3;return mt(r,+u+_)}let zS={};function Ti(){return zS}function Hr(r,t){var h,d,g,p,a,u,f,y;const e=Ti(),n=(y=(f=(p=(g=t==null?void 0:t.weekStartsOn)!=null?g:(d=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:d.weekStartsOn)!=null?p:e.weekStartsOn)!=null?f:(u=(a=e.locale)==null?void 0:a.options)==null?void 0:u.weekStartsOn)!=null?y:0,i=je(r,t==null?void 0:t.in),l=i.getDay(),c=(l<n?7:0)+l-n;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function fo(r,t){return Hr(r,Ut(st({},t),{weekStartsOn:1}))}function dg(r,t){const e=je(r,t==null?void 0:t.in),n=e.getFullYear(),i=mt(e,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const l=fo(i),c=mt(e,0);c.setFullYear(n,0,4),c.setHours(0,0,0,0);const h=fo(c);return e.getTime()>=l.getTime()?n+1:e.getTime()>=h.getTime()?n:n-1}function Bs(r){const t=je(r),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+r-+e}function Sa(r,...t){const e=mt.bind(null,t.find(n=>typeof n=="object"));return t.map(e)}function od(r,t){const e=je(r,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function GS(r,t,e){const[n,i]=Sa(e==null?void 0:e.in,r,t),l=od(n),c=od(i),h=+l-Bs(l),d=+c-Bs(c);return Math.round((h-d)/$S)}function YS(r,t){const e=dg(r,t),n=mt(r,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),fo(n)}function VS(r,t,e){return tl(r,t*3,e)}function KS(r,t,e){return tl(r,t*12,e)}function ad(r,t){const e=+je(r)-+je(t);return e<0?-1:e>0?1:e}function XS(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function ZS(r){return!(!XS(r)&&typeof r!="number"||isNaN(+je(r)))}function qA(r,t){const e=je(r,t==null?void 0:t.in);return Math.trunc(e.getMonth()/3)+1}function QS(r,t,e){const[n,i]=Sa(e==null?void 0:e.in,r,t);return n.getFullYear()-i.getFullYear()}function JS(r){return t=>{const n=(r?Math[r]:Math.trunc)(t);return n===0?0:n}}function jA(r,t,e){const[n,i]=Sa(e==null?void 0:e.in,r,t),l=ad(n,i),c=Math.abs(QS(n,i));n.setFullYear(1584),i.setFullYear(1584);const h=ad(n,i)===-l,d=l*(c-+h);return d===0?0:d}function pg(r,t){const[e,n]=Sa(r,t.start,t.end);return{start:e,end:n}}function $A(r,t){const{start:e,end:n}=pg(t==null?void 0:t.in,r);let i=+e>+n;const l=i?+e:+n,c=i?n:e;c.setHours(0,0,0,0);let h=1;const d=[];for(;+c<=l;)d.push(mt(e,c)),c.setDate(c.getDate()+h),c.setHours(0,0,0,0);return i?d.reverse():d}function no(r,t){const e=je(r,t==null?void 0:t.in),n=e.getMonth(),i=n-n%3;return e.setMonth(i,1),e.setHours(0,0,0,0),e}function UA(r,t){const{start:e,end:n}=pg(t==null?void 0:t.in,r);let i=+e>+n;const l=i?+no(e):+no(n);let c=no(i?n:e),h=1;const d=[];for(;+c<=l;)d.push(mt(e,c)),c=VS(c,h);return i?d.reverse():d}function HA(r,t){const e=je(r,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function WA(r,t){const e=je(r,t==null?void 0:t.in),n=e.getFullYear();return e.setFullYear(n+1,0,0),e.setHours(23,59,59,999),e}function eO(r,t){const e=je(r,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function zA(r,t){var h,d,g,p,a,u,f,y;const e=Ti(),n=(y=(f=(p=(g=t==null?void 0:t.weekStartsOn)!=null?g:(d=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:d.weekStartsOn)!=null?p:e.weekStartsOn)!=null?f:(u=(a=e.locale)==null?void 0:a.options)==null?void 0:u.weekStartsOn)!=null?y:0,i=je(r,t==null?void 0:t.in),l=i.getDay(),c=(l<n?-7:0)+6-(l-n);return i.setDate(i.getDate()+c),i.setHours(23,59,59,999),i}function GA(r,t){const e=je(r,t==null?void 0:t.in),n=e.getMonth(),i=n-n%3+3;return e.setMonth(i,0),e.setHours(23,59,59,999),e}const tO={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},nO=(r,t,e)=>{let n;const i=tO[r];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+n:n+" ago":n};function vu(r){return(t={})=>{const e=t.width?String(t.width):r.defaultWidth;return r.formats[e]||r.formats[r.defaultWidth]}}const rO={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},iO={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},oO={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},aO={date:vu({formats:rO,defaultWidth:"full"}),time:vu({formats:iO,defaultWidth:"full"}),dateTime:vu({formats:oO,defaultWidth:"full"})},sO={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lO=(r,t,e,n)=>sO[r];function Jo(r){return(t,e)=>{const n=e!=null&&e.context?String(e.context):"standalone";let i;if(n==="formatting"&&r.formattingValues){const c=r.defaultFormattingWidth||r.defaultWidth,h=e!=null&&e.width?String(e.width):c;i=r.formattingValues[h]||r.formattingValues[c]}else{const c=r.defaultWidth,h=e!=null&&e.width?String(e.width):r.defaultWidth;i=r.values[h]||r.values[c]}const l=r.argumentCallback?r.argumentCallback(t):t;return i[l]}}const uO={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},cO={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},fO={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},hO={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},pO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},gO=(r,t)=>{const e=Number(r),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},mO={ordinalNumber:gO,era:Jo({values:uO,defaultWidth:"wide"}),quarter:Jo({values:cO,defaultWidth:"wide",argumentCallback:r=>r-1}),month:Jo({values:fO,defaultWidth:"wide"}),day:Jo({values:hO,defaultWidth:"wide"}),dayPeriod:Jo({values:dO,defaultWidth:"wide",formattingValues:pO,defaultFormattingWidth:"wide"})};function ea(r){return(t,e={})=>{const n=e.width,i=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],l=t.match(i);if(!l)return null;const c=l[0],h=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],d=Array.isArray(h)?yO(h,a=>a.test(c)):vO(h,a=>a.test(c));let g;g=r.valueCallback?r.valueCallback(d):d,g=e.valueCallback?e.valueCallback(g):g;const p=t.slice(c.length);return{value:g,rest:p}}}function vO(r,t){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&t(r[e]))return e}function yO(r,t){for(let e=0;e<r.length;e++)if(t(r[e]))return e}function _O(r){return(t,e={})=>{const n=t.match(r.matchPattern);if(!n)return null;const i=n[0],l=t.match(r.parsePattern);if(!l)return null;let c=r.valueCallback?r.valueCallback(l[0]):l[0];c=e.valueCallback?e.valueCallback(c):c;const h=t.slice(i.length);return{value:c,rest:h}}}const bO=/^(\d+)(th|st|nd|rd)?/i,wO=/\d+/i,xO={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},TO={any:[/^b/i,/^(a|c)/i]},SO={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},OO={any:[/1/i,/2/i,/3/i,/4/i]},EO={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},AO={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},CO={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},kO={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},PO={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},RO={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},MO={ordinalNumber:_O({matchPattern:bO,parsePattern:wO,valueCallback:r=>parseInt(r,10)}),era:ea({matchPatterns:xO,defaultMatchWidth:"wide",parsePatterns:TO,defaultParseWidth:"any"}),quarter:ea({matchPatterns:SO,defaultMatchWidth:"wide",parsePatterns:OO,defaultParseWidth:"any",valueCallback:r=>r+1}),month:ea({matchPatterns:EO,defaultMatchWidth:"wide",parsePatterns:AO,defaultParseWidth:"any"}),day:ea({matchPatterns:CO,defaultMatchWidth:"wide",parsePatterns:kO,defaultParseWidth:"any"}),dayPeriod:ea({matchPatterns:PO,defaultMatchWidth:"any",parsePatterns:RO,defaultParseWidth:"any"})},gg={code:"en-US",formatDistance:nO,formatLong:aO,formatRelative:lO,localize:mO,match:MO,options:{weekStartsOn:0,firstWeekContainsDate:1}};function DO(r,t){const e=je(r,t==null?void 0:t.in);return GS(e,eO(e))+1}function mg(r,t){const e=je(r,t==null?void 0:t.in),n=+fo(e)-+YS(e);return Math.round(n/hg)+1}function pc(r,t){var p,a,u,f,y,_,b,v;const e=je(r,t==null?void 0:t.in),n=e.getFullYear(),i=Ti(),l=(v=(b=(f=(u=t==null?void 0:t.firstWeekContainsDate)!=null?u:(a=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:a.firstWeekContainsDate)!=null?f:i.firstWeekContainsDate)!=null?b:(_=(y=i.locale)==null?void 0:y.options)==null?void 0:_.firstWeekContainsDate)!=null?v:1,c=mt((t==null?void 0:t.in)||r,0);c.setFullYear(n+1,0,l),c.setHours(0,0,0,0);const h=Hr(c,t),d=mt((t==null?void 0:t.in)||r,0);d.setFullYear(n,0,l),d.setHours(0,0,0,0);const g=Hr(d,t);return+e>=+h?n+1:+e>=+g?n:n-1}function LO(r,t){var h,d,g,p,a,u,f,y;const e=Ti(),n=(y=(f=(p=(g=t==null?void 0:t.firstWeekContainsDate)!=null?g:(d=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)!=null?p:e.firstWeekContainsDate)!=null?f:(u=(a=e.locale)==null?void 0:a.options)==null?void 0:u.firstWeekContainsDate)!=null?y:1,i=pc(r,t),l=mt((t==null?void 0:t.in)||r,0);return l.setFullYear(i,0,n),l.setHours(0,0,0,0),Hr(l,t)}function vg(r,t){const e=je(r,t==null?void 0:t.in),n=+Hr(e,t)-+LO(e,t);return Math.round(n/hg)+1}function gt(r,t){const e=r<0?"-":"",n=Math.abs(r).toString().padStart(t,"0");return e+n}const Nr={y(r,t){const e=r.getFullYear(),n=e>0?e:1-e;return gt(t==="yy"?n%100:n,t.length)},M(r,t){const e=r.getMonth();return t==="M"?String(e+1):gt(e+1,2)},d(r,t){return gt(r.getDate(),t.length)},a(r,t){const e=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(r,t){return gt(r.getHours()%12||12,t.length)},H(r,t){return gt(r.getHours(),t.length)},m(r,t){return gt(r.getMinutes(),t.length)},s(r,t){return gt(r.getSeconds(),t.length)},S(r,t){const e=t.length,n=r.getMilliseconds(),i=Math.trunc(n*Math.pow(10,e-3));return gt(i,t.length)}},to={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sd={G:function(r,t,e){const n=r.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(n,{width:"abbreviated"});case"GGGGG":return e.era(n,{width:"narrow"});case"GGGG":default:return e.era(n,{width:"wide"})}},y:function(r,t,e){if(t==="yo"){const n=r.getFullYear(),i=n>0?n:1-n;return e.ordinalNumber(i,{unit:"year"})}return Nr.y(r,t)},Y:function(r,t,e,n){const i=pc(r,n),l=i>0?i:1-i;if(t==="YY"){const c=l%100;return gt(c,2)}return t==="Yo"?e.ordinalNumber(l,{unit:"year"}):gt(l,t.length)},R:function(r,t){const e=dg(r);return gt(e,t.length)},u:function(r,t){const e=r.getFullYear();return gt(e,t.length)},Q:function(r,t,e){const n=Math.ceil((r.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return gt(n,2);case"Qo":return e.ordinalNumber(n,{unit:"quarter"});case"QQQ":return e.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,t,e){const n=Math.ceil((r.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return gt(n,2);case"qo":return e.ordinalNumber(n,{unit:"quarter"});case"qqq":return e.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,t,e){const n=r.getMonth();switch(t){case"M":case"MM":return Nr.M(r,t);case"Mo":return e.ordinalNumber(n+1,{unit:"month"});case"MMM":return e.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(n,{width:"wide",context:"formatting"})}},L:function(r,t,e){const n=r.getMonth();switch(t){case"L":return String(n+1);case"LL":return gt(n+1,2);case"Lo":return e.ordinalNumber(n+1,{unit:"month"});case"LLL":return e.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(n,{width:"wide",context:"standalone"})}},w:function(r,t,e,n){const i=vg(r,n);return t==="wo"?e.ordinalNumber(i,{unit:"week"}):gt(i,t.length)},I:function(r,t,e){const n=mg(r);return t==="Io"?e.ordinalNumber(n,{unit:"week"}):gt(n,t.length)},d:function(r,t,e){return t==="do"?e.ordinalNumber(r.getDate(),{unit:"date"}):Nr.d(r,t)},D:function(r,t,e){const n=DO(r);return t==="Do"?e.ordinalNumber(n,{unit:"dayOfYear"}):gt(n,t.length)},E:function(r,t,e){const n=r.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(n,{width:"short",context:"formatting"});case"EEEE":default:return e.day(n,{width:"wide",context:"formatting"})}},e:function(r,t,e,n){const i=r.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return gt(l,2);case"eo":return e.ordinalNumber(l,{unit:"day"});case"eee":return e.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(i,{width:"short",context:"formatting"});case"eeee":default:return e.day(i,{width:"wide",context:"formatting"})}},c:function(r,t,e,n){const i=r.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return gt(l,t.length);case"co":return e.ordinalNumber(l,{unit:"day"});case"ccc":return e.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(i,{width:"narrow",context:"standalone"});case"cccccc":return e.day(i,{width:"short",context:"standalone"});case"cccc":default:return e.day(i,{width:"wide",context:"standalone"})}},i:function(r,t,e){const n=r.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return gt(i,t.length);case"io":return e.ordinalNumber(i,{unit:"day"});case"iii":return e.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(n,{width:"short",context:"formatting"});case"iiii":default:return e.day(n,{width:"wide",context:"formatting"})}},a:function(r,t,e){const i=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(r,t,e){const n=r.getHours();let i;switch(n===12?i=to.noon:n===0?i=to.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(r,t,e){const n=r.getHours();let i;switch(n>=17?i=to.evening:n>=12?i=to.afternoon:n>=4?i=to.morning:i=to.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(r,t,e){if(t==="ho"){let n=r.getHours()%12;return n===0&&(n=12),e.ordinalNumber(n,{unit:"hour"})}return Nr.h(r,t)},H:function(r,t,e){return t==="Ho"?e.ordinalNumber(r.getHours(),{unit:"hour"}):Nr.H(r,t)},K:function(r,t,e){const n=r.getHours()%12;return t==="Ko"?e.ordinalNumber(n,{unit:"hour"}):gt(n,t.length)},k:function(r,t,e){let n=r.getHours();return n===0&&(n=24),t==="ko"?e.ordinalNumber(n,{unit:"hour"}):gt(n,t.length)},m:function(r,t,e){return t==="mo"?e.ordinalNumber(r.getMinutes(),{unit:"minute"}):Nr.m(r,t)},s:function(r,t,e){return t==="so"?e.ordinalNumber(r.getSeconds(),{unit:"second"}):Nr.s(r,t)},S:function(r,t){return Nr.S(r,t)},X:function(r,t,e){const n=r.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return ud(n);case"XXXX":case"XX":return di(n);case"XXXXX":case"XXX":default:return di(n,":")}},x:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"x":return ud(n);case"xxxx":case"xx":return di(n);case"xxxxx":case"xxx":default:return di(n,":")}},O:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ld(n,":");case"OOOO":default:return"GMT"+di(n,":")}},z:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ld(n,":");case"zzzz":default:return"GMT"+di(n,":")}},t:function(r,t,e){const n=Math.trunc(+r/1e3);return gt(n,t.length)},T:function(r,t,e){return gt(+r,t.length)}};function ld(r,t=""){const e=r>0?"-":"+",n=Math.abs(r),i=Math.trunc(n/60),l=n%60;return l===0?e+String(i):e+String(i)+t+gt(l,2)}function ud(r,t){return r%60===0?(r>0?"-":"+")+gt(Math.abs(r)/60,2):di(r,t)}function di(r,t=""){const e=r>0?"-":"+",n=Math.abs(r),i=gt(Math.trunc(n/60),2),l=gt(n%60,2);return e+i+t+l}const cd=(r,t)=>{switch(r){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},yg=(r,t)=>{switch(r){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},IO=(r,t)=>{const e=r.match(/(P+)(p+)?/)||[],n=e[1],i=e[2];if(!i)return cd(r,t);let l;switch(n){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",cd(n,t)).replace("{{time}}",yg(i,t))},Uu={p:yg,P:IO},NO=/^D+$/,BO=/^Y+$/,FO=["D","DD","YY","YYYY"];function _g(r){return NO.test(r)}function bg(r){return BO.test(r)}function Hu(r,t,e){const n=qO(r,t,e);if(console.warn(n),FO.includes(r))throw new RangeError(n)}function qO(r,t,e){const n=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${t}\`) for formatting ${n} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const jO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$O=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,UO=/^'([^]*?)'?$/,HO=/''/g,WO=/[a-zA-Z]/;function YA(r,t,e){var p,a,u,f,y,_,b,v,w,T,x,S,C,A,R,L,M,k;const n=Ti(),i=(a=(p=e==null?void 0:e.locale)!=null?p:n.locale)!=null?a:gg,l=(T=(w=(_=(y=e==null?void 0:e.firstWeekContainsDate)!=null?y:(f=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)!=null?_:n.firstWeekContainsDate)!=null?w:(v=(b=n.locale)==null?void 0:b.options)==null?void 0:v.firstWeekContainsDate)!=null?T:1,c=(k=(M=(A=(C=e==null?void 0:e.weekStartsOn)!=null?C:(S=(x=e==null?void 0:e.locale)==null?void 0:x.options)==null?void 0:S.weekStartsOn)!=null?A:n.weekStartsOn)!=null?M:(L=(R=n.locale)==null?void 0:R.options)==null?void 0:L.weekStartsOn)!=null?k:0,h=je(r,e==null?void 0:e.in);if(!ZS(h))throw new RangeError("Invalid time value");let d=t.match($O).map(P=>{const I=P[0];if(I==="p"||I==="P"){const j=Uu[I];return j(P,i.formatLong)}return P}).join("").match(jO).map(P=>{if(P==="''")return{isToken:!1,value:"'"};const I=P[0];if(I==="'")return{isToken:!1,value:zO(P)};if(sd[I])return{isToken:!0,value:P};if(I.match(WO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+I+"`");return{isToken:!1,value:P}});i.localize.preprocessor&&(d=i.localize.preprocessor(h,d));const g={firstWeekContainsDate:l,weekStartsOn:c,locale:i};return d.map(P=>{if(!P.isToken)return P.value;const I=P.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&bg(I)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&_g(I))&&Hu(I,t,String(r));const j=sd[I[0]];return j(h,I,i.localize,g)}).join("")}function zO(r){const t=r.match(UO);return t?t[1].replace(HO,"'"):r}function VA(r,t){return je(r,t==null?void 0:t.in).getDay()}function GO(r,t){const e=je(r,t==null?void 0:t.in),n=e.getFullYear(),i=e.getMonth(),l=mt(e,0);return l.setFullYear(n,i+1,0),l.setHours(0,0,0,0),l.getDate()}function YO(){return Object.assign({},Ti())}function KA(r,t){return je(r,t==null?void 0:t.in).getHours()}function VO(r,t){const e=je(r,t==null?void 0:t.in).getDay();return e===0?7:e}function XA(r,t){return je(r,t==null?void 0:t.in).getMinutes()}function ZA(r,t){return je(r,t==null?void 0:t.in).getMonth()}function QA(r){return je(r).getSeconds()}function JA(r,t){return je(r,t==null?void 0:t.in).getFullYear()}function eC(r,t){return+je(r)>+je(t)}function tC(r,t){return+je(r)<+je(t)}function nC(r,t){return+je(r)==+je(t)}function KO(r,t){const e=XO(t)?new t(0):mt(t,0);return e.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),e}function XO(r){var t;return typeof r=="function"&&((t=r.prototype)==null?void 0:t.constructor)===r}const ZO=10;class wg{constructor(){Se(this,"subPriority",0)}validate(t,e){return!0}}class QO extends wg{constructor(t,e,n,i,l){super(),this.value=t,this.validateValue=e,this.setValue=n,this.priority=i,l&&(this.subPriority=l)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,n){return this.setValue(t,e,this.value,n)}}class JO extends wg{constructor(e,n){super();Se(this,"priority",ZO);Se(this,"subPriority",-1);this.context=e||(i=>mt(n,i))}set(e,n){return n.timestampIsSet?e:mt(e,KO(e,this.context))}}class ut{run(t,e,n,i){const l=this.parse(t,e,n,i);return l?{setter:new QO(l.value,this.validate,this.set,this.priority,this.subPriority),rest:l.rest}:null}validate(t,e,n){return!0}}class eE extends ut{constructor(){super(...arguments);Se(this,"priority",140);Se(this,"incompatibleTokens",["R","u","t","T"])}parse(e,n,i){switch(n){case"G":case"GG":case"GGG":return i.era(e,{width:"abbreviated"})||i.era(e,{width:"narrow"});case"GGGGG":return i.era(e,{width:"narrow"});case"GGGG":default:return i.era(e,{width:"wide"})||i.era(e,{width:"abbreviated"})||i.era(e,{width:"narrow"})}}set(e,n,i){return n.era=i,e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}}const Mt={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Xn={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Dt(r,t){return r&&{value:t(r.value),rest:r.rest}}function At(r,t){const e=t.match(r);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Zn(r,t){const e=t.match(r);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const n=e[1]==="+"?1:-1,i=e[2]?parseInt(e[2],10):0,l=e[3]?parseInt(e[3],10):0,c=e[5]?parseInt(e[5],10):0;return{value:n*(i*HS+l*US+c*WS),rest:t.slice(e[0].length)}}function xg(r){return At(Mt.anyDigitsSigned,r)}function kt(r,t){switch(r){case 1:return At(Mt.singleDigit,t);case 2:return At(Mt.twoDigits,t);case 3:return At(Mt.threeDigits,t);case 4:return At(Mt.fourDigits,t);default:return At(new RegExp("^\\d{1,"+r+"}"),t)}}function Fs(r,t){switch(r){case 1:return At(Mt.singleDigitSigned,t);case 2:return At(Mt.twoDigitsSigned,t);case 3:return At(Mt.threeDigitsSigned,t);case 4:return At(Mt.fourDigitsSigned,t);default:return At(new RegExp("^-?\\d{1,"+r+"}"),t)}}function gc(r){switch(r){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Tg(r,t){const e=t>0,n=e?t:1-t;let i;if(n<=50)i=r||100;else{const l=n+50,c=Math.trunc(l/100)*100,h=r>=l%100;i=r+c-(h?100:0)}return e?i:1-i}function Sg(r){return r%400===0||r%4===0&&r%100!==0}class tE extends ut{constructor(){super(...arguments);Se(this,"priority",130);Se(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,n,i){const l=c=>({year:c,isTwoDigitYear:n==="yy"});switch(n){case"y":return Dt(kt(4,e),l);case"yo":return Dt(i.ordinalNumber(e,{unit:"year"}),l);default:return Dt(kt(n.length,e),l)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,i){const l=e.getFullYear();if(i.isTwoDigitYear){const h=Tg(i.year,l);return e.setFullYear(h,0,1),e.setHours(0,0,0,0),e}const c=!("era"in n)||n.era===1?i.year:1-i.year;return e.setFullYear(c,0,1),e.setHours(0,0,0,0),e}}class nE extends ut{constructor(){super(...arguments);Se(this,"priority",130);Se(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,n,i){const l=c=>({year:c,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Dt(kt(4,e),l);case"Yo":return Dt(i.ordinalNumber(e,{unit:"year"}),l);default:return Dt(kt(n.length,e),l)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,i,l){const c=pc(e,l);if(i.isTwoDigitYear){const d=Tg(i.year,c);return e.setFullYear(d,0,l.firstWeekContainsDate),e.setHours(0,0,0,0),Hr(e,l)}const h=!("era"in n)||n.era===1?i.year:1-i.year;return e.setFullYear(h,0,l.firstWeekContainsDate),e.setHours(0,0,0,0),Hr(e,l)}}class rE extends ut{constructor(){super(...arguments);Se(this,"priority",130);Se(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,n){return Fs(n==="R"?4:n.length,e)}set(e,n,i){const l=mt(e,0);return l.setFullYear(i,0,4),l.setHours(0,0,0,0),fo(l)}}class iE extends ut{constructor(){super(...arguments);Se(this,"priority",130);Se(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,n){return Fs(n==="u"?4:n.length,e)}set(e,n,i){return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}}class oE extends ut{constructor(){super(...arguments);Se(this,"priority",120);Se(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,n,i){switch(n){case"Q":case"QQ":return kt(n.length,e);case"Qo":return i.ordinalNumber(e,{unit:"quarter"});case"QQQ":return i.quarter(e,{width:"abbreviated",context:"formatting"})||i.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(e,{width:"wide",context:"formatting"})||i.quarter(e,{width:"abbreviated",context:"formatting"})||i.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=1&&n<=4}set(e,n,i){return e.setMonth((i-1)*3,1),e.setHours(0,0,0,0),e}}class aE extends ut{constructor(){super(...arguments);Se(this,"priority",120);Se(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,n,i){switch(n){case"q":case"qq":return kt(n.length,e);case"qo":return i.ordinalNumber(e,{unit:"quarter"});case"qqq":return i.quarter(e,{width:"abbreviated",context:"standalone"})||i.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(e,{width:"wide",context:"standalone"})||i.quarter(e,{width:"abbreviated",context:"standalone"})||i.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=1&&n<=4}set(e,n,i){return e.setMonth((i-1)*3,1),e.setHours(0,0,0,0),e}}class sE extends ut{constructor(){super(...arguments);Se(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);Se(this,"priority",110)}parse(e,n,i){const l=c=>c-1;switch(n){case"M":return Dt(At(Mt.month,e),l);case"MM":return Dt(kt(2,e),l);case"Mo":return Dt(i.ordinalNumber(e,{unit:"month"}),l);case"MMM":return i.month(e,{width:"abbreviated",context:"formatting"})||i.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(e,{width:"wide",context:"formatting"})||i.month(e,{width:"abbreviated",context:"formatting"})||i.month(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=11}set(e,n,i){return e.setMonth(i,1),e.setHours(0,0,0,0),e}}class lE extends ut{constructor(){super(...arguments);Se(this,"priority",110);Se(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,n,i){const l=c=>c-1;switch(n){case"L":return Dt(At(Mt.month,e),l);case"LL":return Dt(kt(2,e),l);case"Lo":return Dt(i.ordinalNumber(e,{unit:"month"}),l);case"LLL":return i.month(e,{width:"abbreviated",context:"standalone"})||i.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(e,{width:"wide",context:"standalone"})||i.month(e,{width:"abbreviated",context:"standalone"})||i.month(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=0&&n<=11}set(e,n,i){return e.setMonth(i,1),e.setHours(0,0,0,0),e}}function uE(r,t,e){const n=je(r,e==null?void 0:e.in),i=vg(n,e)-t;return n.setDate(n.getDate()-i*7),je(n,e==null?void 0:e.in)}class cE extends ut{constructor(){super(...arguments);Se(this,"priority",100);Se(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,n,i){switch(n){case"w":return At(Mt.week,e);case"wo":return i.ordinalNumber(e,{unit:"week"});default:return kt(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,i,l){return Hr(uE(e,i,l),l)}}function fE(r,t,e){const n=je(r,e==null?void 0:e.in),i=mg(n,e)-t;return n.setDate(n.getDate()-i*7),n}class hE extends ut{constructor(){super(...arguments);Se(this,"priority",100);Se(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,n,i){switch(n){case"I":return At(Mt.week,e);case"Io":return i.ordinalNumber(e,{unit:"week"});default:return kt(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,i){return fo(fE(e,i))}}const dE=[31,28,31,30,31,30,31,31,30,31,30,31],pE=[31,29,31,30,31,30,31,31,30,31,30,31];class gE extends ut{constructor(){super(...arguments);Se(this,"priority",90);Se(this,"subPriority",1);Se(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,n,i){switch(n){case"d":return At(Mt.date,e);case"do":return i.ordinalNumber(e,{unit:"date"});default:return kt(n.length,e)}}validate(e,n){const i=e.getFullYear(),l=Sg(i),c=e.getMonth();return l?n>=1&&n<=pE[c]:n>=1&&n<=dE[c]}set(e,n,i){return e.setDate(i),e.setHours(0,0,0,0),e}}class mE extends ut{constructor(){super(...arguments);Se(this,"priority",90);Se(this,"subpriority",1);Se(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,n,i){switch(n){case"D":case"DD":return At(Mt.dayOfYear,e);case"Do":return i.ordinalNumber(e,{unit:"date"});default:return kt(n.length,e)}}validate(e,n){const i=e.getFullYear();return Sg(i)?n>=1&&n<=366:n>=1&&n<=365}set(e,n,i){return e.setMonth(0,i),e.setHours(0,0,0,0),e}}function mc(r,t,e){var a,u,f,y,_,b,v,w;const n=Ti(),i=(w=(v=(y=(f=e==null?void 0:e.weekStartsOn)!=null?f:(u=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:u.weekStartsOn)!=null?y:n.weekStartsOn)!=null?v:(b=(_=n.locale)==null?void 0:_.options)==null?void 0:b.weekStartsOn)!=null?w:0,l=je(r,e==null?void 0:e.in),c=l.getDay(),d=(t%7+7)%7,g=7-i,p=t<0||t>6?t-(c+g)%7:(d+g)%7-(c+g)%7;return el(l,p,e)}class vE extends ut{constructor(){super(...arguments);Se(this,"priority",90);Se(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,n,i){switch(n){case"E":case"EE":case"EEE":return i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return i.day(e,{width:"wide",context:"formatting"})||i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=6}set(e,n,i,l){return e=mc(e,i,l),e.setHours(0,0,0,0),e}}class yE extends ut{constructor(){super(...arguments);Se(this,"priority",90);Se(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,n,i,l){const c=h=>{const d=Math.floor((h-1)/7)*7;return(h+l.weekStartsOn+6)%7+d};switch(n){case"e":case"ee":return Dt(kt(n.length,e),c);case"eo":return Dt(i.ordinalNumber(e,{unit:"day"}),c);case"eee":return i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"eeeee":return i.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return i.day(e,{width:"wide",context:"formatting"})||i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=6}set(e,n,i,l){return e=mc(e,i,l),e.setHours(0,0,0,0),e}}class _E extends ut{constructor(){super(...arguments);Se(this,"priority",90);Se(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,n,i,l){const c=h=>{const d=Math.floor((h-1)/7)*7;return(h+l.weekStartsOn+6)%7+d};switch(n){case"c":case"cc":return Dt(kt(n.length,e),c);case"co":return Dt(i.ordinalNumber(e,{unit:"day"}),c);case"ccc":return i.day(e,{width:"abbreviated",context:"standalone"})||i.day(e,{width:"short",context:"standalone"})||i.day(e,{width:"narrow",context:"standalone"});case"ccccc":return i.day(e,{width:"narrow",context:"standalone"});case"cccccc":return i.day(e,{width:"short",context:"standalone"})||i.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return i.day(e,{width:"wide",context:"standalone"})||i.day(e,{width:"abbreviated",context:"standalone"})||i.day(e,{width:"short",context:"standalone"})||i.day(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=0&&n<=6}set(e,n,i,l){return e=mc(e,i,l),e.setHours(0,0,0,0),e}}function bE(r,t,e){const n=je(r,e==null?void 0:e.in),i=VO(n,e),l=t-i;return el(n,l,e)}class wE extends ut{constructor(){super(...arguments);Se(this,"priority",90);Se(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,n,i){const l=c=>c===0?7:c;switch(n){case"i":case"ii":return kt(n.length,e);case"io":return i.ordinalNumber(e,{unit:"day"});case"iii":return Dt(i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"}),l);case"iiiii":return Dt(i.day(e,{width:"narrow",context:"formatting"}),l);case"iiiiii":return Dt(i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"}),l);case"iiii":default:return Dt(i.day(e,{width:"wide",context:"formatting"})||i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"}),l)}}validate(e,n){return n>=1&&n<=7}set(e,n,i){return e=bE(e,i),e.setHours(0,0,0,0),e}}class xE extends ut{constructor(){super(...arguments);Se(this,"priority",80);Se(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,n,i){switch(n){case"a":case"aa":case"aaa":return i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(e,{width:"wide",context:"formatting"})||i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,i){return e.setHours(gc(i),0,0,0),e}}class TE extends ut{constructor(){super(...arguments);Se(this,"priority",80);Se(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,n,i){switch(n){case"b":case"bb":case"bbb":return i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(e,{width:"wide",context:"formatting"})||i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,i){return e.setHours(gc(i),0,0,0),e}}class SE extends ut{constructor(){super(...arguments);Se(this,"priority",80);Se(this,"incompatibleTokens",["a","b","t","T"])}parse(e,n,i){switch(n){case"B":case"BB":case"BBB":return i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(e,{width:"wide",context:"formatting"})||i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,i){return e.setHours(gc(i),0,0,0),e}}class OE extends ut{constructor(){super(...arguments);Se(this,"priority",70);Se(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,n,i){switch(n){case"h":return At(Mt.hour12h,e);case"ho":return i.ordinalNumber(e,{unit:"hour"});default:return kt(n.length,e)}}validate(e,n){return n>=1&&n<=12}set(e,n,i){const l=e.getHours()>=12;return l&&i<12?e.setHours(i+12,0,0,0):!l&&i===12?e.setHours(0,0,0,0):e.setHours(i,0,0,0),e}}class EE extends ut{constructor(){super(...arguments);Se(this,"priority",70);Se(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,n,i){switch(n){case"H":return At(Mt.hour23h,e);case"Ho":return i.ordinalNumber(e,{unit:"hour"});default:return kt(n.length,e)}}validate(e,n){return n>=0&&n<=23}set(e,n,i){return e.setHours(i,0,0,0),e}}class AE extends ut{constructor(){super(...arguments);Se(this,"priority",70);Se(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,n,i){switch(n){case"K":return At(Mt.hour11h,e);case"Ko":return i.ordinalNumber(e,{unit:"hour"});default:return kt(n.length,e)}}validate(e,n){return n>=0&&n<=11}set(e,n,i){return e.getHours()>=12&&i<12?e.setHours(i+12,0,0,0):e.setHours(i,0,0,0),e}}class CE extends ut{constructor(){super(...arguments);Se(this,"priority",70);Se(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,n,i){switch(n){case"k":return At(Mt.hour24h,e);case"ko":return i.ordinalNumber(e,{unit:"hour"});default:return kt(n.length,e)}}validate(e,n){return n>=1&&n<=24}set(e,n,i){const l=i<=24?i%24:i;return e.setHours(l,0,0,0),e}}class kE extends ut{constructor(){super(...arguments);Se(this,"priority",60);Se(this,"incompatibleTokens",["t","T"])}parse(e,n,i){switch(n){case"m":return At(Mt.minute,e);case"mo":return i.ordinalNumber(e,{unit:"minute"});default:return kt(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,i){return e.setMinutes(i,0,0),e}}class PE extends ut{constructor(){super(...arguments);Se(this,"priority",50);Se(this,"incompatibleTokens",["t","T"])}parse(e,n,i){switch(n){case"s":return At(Mt.second,e);case"so":return i.ordinalNumber(e,{unit:"second"});default:return kt(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,i){return e.setSeconds(i,0),e}}class RE extends ut{constructor(){super(...arguments);Se(this,"priority",30);Se(this,"incompatibleTokens",["t","T"])}parse(e,n){const i=l=>Math.trunc(l*Math.pow(10,-n.length+3));return Dt(kt(n.length,e),i)}set(e,n,i){return e.setMilliseconds(i),e}}class ME extends ut{constructor(){super(...arguments);Se(this,"priority",10);Se(this,"incompatibleTokens",["t","T","x"])}parse(e,n){switch(n){case"X":return Zn(Xn.basicOptionalMinutes,e);case"XX":return Zn(Xn.basic,e);case"XXXX":return Zn(Xn.basicOptionalSeconds,e);case"XXXXX":return Zn(Xn.extendedOptionalSeconds,e);case"XXX":default:return Zn(Xn.extended,e)}}set(e,n,i){return n.timestampIsSet?e:mt(e,e.getTime()-Bs(e)-i)}}class DE extends ut{constructor(){super(...arguments);Se(this,"priority",10);Se(this,"incompatibleTokens",["t","T","X"])}parse(e,n){switch(n){case"x":return Zn(Xn.basicOptionalMinutes,e);case"xx":return Zn(Xn.basic,e);case"xxxx":return Zn(Xn.basicOptionalSeconds,e);case"xxxxx":return Zn(Xn.extendedOptionalSeconds,e);case"xxx":default:return Zn(Xn.extended,e)}}set(e,n,i){return n.timestampIsSet?e:mt(e,e.getTime()-Bs(e)-i)}}class LE extends ut{constructor(){super(...arguments);Se(this,"priority",40);Se(this,"incompatibleTokens","*")}parse(e){return xg(e)}set(e,n,i){return[mt(e,i*1e3),{timestampIsSet:!0}]}}class IE extends ut{constructor(){super(...arguments);Se(this,"priority",20);Se(this,"incompatibleTokens","*")}parse(e){return xg(e)}set(e,n,i){return[mt(e,i),{timestampIsSet:!0}]}}const NE={G:new eE,y:new tE,Y:new nE,R:new rE,u:new iE,Q:new oE,q:new aE,M:new sE,L:new lE,w:new cE,I:new hE,d:new gE,D:new mE,E:new vE,e:new yE,c:new _E,i:new wE,a:new xE,b:new TE,B:new SE,h:new OE,H:new EE,K:new AE,k:new CE,m:new kE,s:new PE,S:new RE,X:new ME,x:new DE,t:new LE,T:new IE},BE=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,FE=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,qE=/^'([^]*?)'?$/,jE=/''/g,$E=/\S/,UE=/[a-zA-Z]/;function rC(r,t,e,n){var b,v,w,T,x,S,C,A,R,L,M,k,P,I,j,W,J,ee;const i=()=>mt((n==null?void 0:n.in)||e,NaN),l=YO(),c=(v=(b=n==null?void 0:n.locale)!=null?b:l.locale)!=null?v:gg,h=(L=(R=(S=(x=n==null?void 0:n.firstWeekContainsDate)!=null?x:(T=(w=n==null?void 0:n.locale)==null?void 0:w.options)==null?void 0:T.firstWeekContainsDate)!=null?S:l.firstWeekContainsDate)!=null?R:(A=(C=l.locale)==null?void 0:C.options)==null?void 0:A.firstWeekContainsDate)!=null?L:1,d=(ee=(J=(I=(P=n==null?void 0:n.weekStartsOn)!=null?P:(k=(M=n==null?void 0:n.locale)==null?void 0:M.options)==null?void 0:k.weekStartsOn)!=null?I:l.weekStartsOn)!=null?J:(W=(j=l.locale)==null?void 0:j.options)==null?void 0:W.weekStartsOn)!=null?ee:0;if(!t)return r?i():je(e,n==null?void 0:n.in);const g={firstWeekContainsDate:h,weekStartsOn:d,locale:c},p=[new JO(n==null?void 0:n.in,e)],a=t.match(FE).map(oe=>{const V=oe[0];if(V in Uu){const $=Uu[V];return $(oe,c.formatLong)}return oe}).join("").match(BE),u=[];for(let oe of a){!(n!=null&&n.useAdditionalWeekYearTokens)&&bg(oe)&&Hu(oe,t,r),!(n!=null&&n.useAdditionalDayOfYearTokens)&&_g(oe)&&Hu(oe,t,r);const V=oe[0],$=NE[V];if($){const{incompatibleTokens:N}=$;if(Array.isArray(N)){const G=u.find(ne=>N.includes(ne.token)||ne.token===V);if(G)throw new RangeError(`The format string mustn't contain \`${G.fullToken}\` and \`${oe}\` at the same time`)}else if($.incompatibleTokens==="*"&&u.length>0)throw new RangeError(`The format string mustn't contain \`${oe}\` and any other token at the same time`);u.push({token:V,fullToken:oe});const H=$.run(r,oe,c.match,g);if(!H)return i();p.push(H.setter),r=H.rest}else{if(V.match(UE))throw new RangeError("Format string contains an unescaped latin alphabet character `"+V+"`");if(oe==="''"?oe="'":V==="'"&&(oe=HE(oe)),r.indexOf(oe)===0)r=r.slice(oe.length);else return i()}}if(r.length>0&&$E.test(r))return i();const f=p.map(oe=>oe.priority).sort((oe,V)=>V-oe).filter((oe,V,$)=>$.indexOf(oe)===V).map(oe=>p.filter(V=>V.priority===oe).sort((V,$)=>$.subPriority-V.subPriority)).map(oe=>oe[0]);let y=je(e,n==null?void 0:n.in);if(isNaN(+y))return i();const _={};for(const oe of f){if(!oe.validate(y,g))return i();const V=oe.set(y,_,g);Array.isArray(V)?(y=V[0],Object.assign(_,V[1])):y=V}return y}function HE(r){return r.match(qE)[1].replace(jE,"'")}function iC(r,t,e){const[n,i]=Sa(e==null?void 0:e.in,r,t);return+no(n)==+no(i)}function WE(r,t,e){return el(r,-t,e)}function oC(r,t){var p,a;const e=(p=t==null?void 0:t.nearestTo)!=null?p:1;if(e<1||e>30)return mt(r,NaN);const n=je(r,t==null?void 0:t.in),i=n.getSeconds()/60,l=n.getMilliseconds()/1e3/60,c=n.getMinutes()+i+l,h=(a=t==null?void 0:t.roundingMethod)!=null?a:"round",g=JS(h)(c/e)*e;return n.setMinutes(g,0,0),n}function zE(r,t,e){const n=je(r,e==null?void 0:e.in),i=n.getFullYear(),l=n.getDate(),c=mt(r,0);c.setFullYear(i,t,15),c.setHours(0,0,0,0);const h=GO(c);return n.setMonth(t,Math.min(l,h)),n}function aC(r,t,e){let n=je(r,e==null?void 0:e.in);return isNaN(+n)?mt(r,NaN):(t.year!=null&&n.setFullYear(t.year),t.month!=null&&(n=zE(n,t.month)),t.date!=null&&n.setDate(t.date),t.hours!=null&&n.setHours(t.hours),t.minutes!=null&&n.setMinutes(t.minutes),t.seconds!=null&&n.setSeconds(t.seconds),t.milliseconds!=null&&n.setMilliseconds(t.milliseconds),n)}function sC(r,t,e){const n=je(r,e==null?void 0:e.in);return n.setMilliseconds(t),n}function lC(r,t,e){const n=je(r,e==null?void 0:e.in);return n.setSeconds(t),n}function uC(r,t,e){const n=je(r,e==null?void 0:e.in);return isNaN(+n)?mt(r,NaN):(n.setFullYear(t),n)}function GE(r,t,e){return tl(r,-t,e)}function cC(r,t,e){const{years:n=0,months:i=0,weeks:l=0,days:c=0,hours:h=0,minutes:d=0,seconds:g=0}=t,p=GE(r,i+n*12,e),a=WE(p,c+l*7,e),u=d+h*60,y=(g+u*60)*1e3;return mt(r,+a-y)}function fC(r,t,e){return KS(r,-t,e)}function YE(r,t,e="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:r,timeZoneName:e}).format(t).split(/\s/g).slice(2).join(" ")}const yu={},ra={};function mi(r,t){try{const n=(yu[r]||(yu[r]=new Intl.DateTimeFormat("en-US",{timeZone:r,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return n in ra?ra[n]:fd(n,n.split(":"))}catch(e){if(r in ra)return ra[r];const n=r==null?void 0:r.match(VE);return n?fd(r,n.slice(1)):NaN}}const VE=/([+-]\d\d):?(\d\d)?/;function fd(r,t){const e=+(t[0]||0),n=+(t[1]||0),i=+(t[2]||0)/60;return ra[r]=e*60+n>0?e*60+n+i:e*60-n-i}class Qn extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(mi(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Og(this),Wu(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Qn(...e,t):new Qn(Date.now(),t)}withTimeZone(t){return new Qn(+this,t)}getTimezoneOffset(){const t=-mi(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Wu(this),+this}[Symbol.for("constructDateFrom")](t){return new Qn(+new Date(t),this.timeZone)}}const hd=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!hd.test(r))return;const t=r.replace(hd,"$1UTC");Qn.prototype[t]&&(r.startsWith("get")?Qn.prototype[r]=function(){return this.internal[t]()}:(Qn.prototype[r]=function(){return Date.prototype[t].apply(this.internal,arguments),KE(this),+this},Qn.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Wu(this),+this}))});function Wu(r){r.internal.setTime(+r),r.internal.setUTCSeconds(r.internal.getUTCSeconds()-Math.round(-mi(r.timeZone,r)*60))}function KE(r){Date.prototype.setFullYear.call(r,r.internal.getUTCFullYear(),r.internal.getUTCMonth(),r.internal.getUTCDate()),Date.prototype.setHours.call(r,r.internal.getUTCHours(),r.internal.getUTCMinutes(),r.internal.getUTCSeconds(),r.internal.getUTCMilliseconds()),Og(r)}function Og(r){const t=mi(r.timeZone,r),e=t>0?Math.floor(t):Math.ceil(t),n=new Date(+r);n.setUTCHours(n.getUTCHours()-1);const i=-new Date(+r).getTimezoneOffset(),l=-new Date(+n).getTimezoneOffset(),c=i-l,h=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();c&&h&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+c);const d=i-e;d&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+d);const g=new Date(+r);g.setUTCSeconds(0);const p=i>0?g.getSeconds():(g.getSeconds()-60)%60,a=Math.round(-(mi(r.timeZone,r)*60))%60;(a||p)&&(r.internal.setUTCSeconds(r.internal.getUTCSeconds()+a),Date.prototype.setUTCSeconds.call(r,Date.prototype.getUTCSeconds.call(r)+a+p));const u=mi(r.timeZone,r),f=u>0?Math.floor(u):Math.ceil(u),_=-new Date(+r).getTimezoneOffset()-f,b=f!==e,v=_-d;if(b&&v){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+v);const w=mi(r.timeZone,r),T=w>0?Math.floor(w):Math.ceil(w),x=f-T;x&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+x),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+x))}}class ia extends Qn{static tz(t,...e){return e.length?new ia(...e,t):new ia(Date.now(),t)}toISOString(){const[t,e,n]=this.tzComponents(),i=`${t}${e}:${n}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,n,i]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${n} ${e} ${i}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,n,i]=this.tzComponents();return`${t} GMT${e}${n}${i} (${YE(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,Ut(st({},e),{timeZone:(e==null?void 0:e.timeZone)||this.timeZone}))}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,Ut(st({},e),{timeZone:(e==null?void 0:e.timeZone)||this.timeZone}))}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,Ut(st({},e),{timeZone:(e==null?void 0:e.timeZone)||this.timeZone}))}tzComponents(){const t=this.getTimezoneOffset(),e=t>0?"-":"+",n=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),i=String(Math.abs(t)%60).padStart(2,"0");return[e,n,i]}withTimeZone(t){return new ia(+this,t)}[Symbol.for("constructDateFrom")](t){return new ia(+new Date(t),this.timeZone)}}var XE={exports:{}};/*!
* Quill Editor v1.3.7
* https://quilljs.com/
* Copyright (c) 2014, Jason Chen
* Copyright (c) 2013, salesforce.com
*/(function(r,t){(function(n,i){r.exports=i()})(typeof self!="undefined"?self:bt,function(){return function(e){var n={};function i(l){if(n[l])return n[l].exports;var c=n[l]={i:l,l:!1,exports:{}};return e[l].call(c.exports,c,c.exports,i),c.l=!0,c.exports}return i.m=e,i.c=n,i.d=function(l,c,h){i.o(l,c)||Object.defineProperty(l,c,{configurable:!1,enumerable:!0,get:h})},i.n=function(l){var c=l&&l.__esModule?function(){return l.default}:function(){return l};return i.d(c,"a",c),c},i.o=function(l,c){return Object.prototype.hasOwnProperty.call(l,c)},i.p="",i(i.s=109)}([function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=i(17),c=i(18),h=i(19),d=i(45),g=i(46),p=i(47),a=i(48),u=i(49),f=i(12),y=i(32),_=i(33),b=i(31),v=i(1),w={Scope:v.Scope,create:v.create,find:v.find,query:v.query,register:v.register,Container:l.default,Format:c.default,Leaf:h.default,Embed:a.default,Scroll:d.default,Block:p.default,Inline:g.default,Text:u.default,Attributor:{Attribute:f.default,Class:y.default,Style:_.default,Store:b.default}};n.default=w},function(e,n,i){var l=this&&this.__extends||function(){var b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var T in w)w.hasOwnProperty(T)&&(v[T]=w[T])};return function(v,w){b(v,w);function T(){this.constructor=v}v.prototype=w===null?Object.create(w):(T.prototype=w.prototype,new T)}}();Object.defineProperty(n,"__esModule",{value:!0});var c=function(b){l(v,b);function v(w){var T=this;return w="[Parchment] "+w,T=b.call(this,w)||this,T.message=w,T.name=T.constructor.name,T}return v}(Error);n.ParchmentError=c;var h={},d={},g={},p={};n.DATA_KEY="__blot";var a;(function(b){b[b.TYPE=3]="TYPE",b[b.LEVEL=12]="LEVEL",b[b.ATTRIBUTE=13]="ATTRIBUTE",b[b.BLOT=14]="BLOT",b[b.INLINE=7]="INLINE",b[b.BLOCK=11]="BLOCK",b[b.BLOCK_BLOT=10]="BLOCK_BLOT",b[b.INLINE_BLOT=6]="INLINE_BLOT",b[b.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",b[b.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",b[b.ANY=15]="ANY"})(a=n.Scope||(n.Scope={}));function u(b,v){var w=y(b);if(w==null)throw new c("Unable to create "+b+" blot");var T=w,x=b instanceof Node||b.nodeType===Node.TEXT_NODE?b:T.create(v);return new T(x,v)}n.create=u;function f(b,v){return v===void 0&&(v=!1),b==null?null:b[n.DATA_KEY]!=null?b[n.DATA_KEY].blot:v?f(b.parentNode,v):null}n.find=f;function y(b,v){v===void 0&&(v=a.ANY);var w;if(typeof b=="string")w=p[b]||h[b];else if(b instanceof Text||b.nodeType===Node.TEXT_NODE)w=p.text;else if(typeof b=="number")b&a.LEVEL&a.BLOCK?w=p.block:b&a.LEVEL&a.INLINE&&(w=p.inline);else if(b instanceof HTMLElement){var T=(b.getAttribute("class")||"").split(/\s+/);for(var x in T)if(w=d[T[x]],w)break;w=w||g[b.tagName]}return w==null?null:v&a.LEVEL&w.scope&&v&a.TYPE&w.scope?w:null}n.query=y;function _(){for(var b=[],v=0;v<arguments.length;v++)b[v]=arguments[v];if(b.length>1)return b.map(function(x){return _(x)});var w=b[0];if(typeof w.blotName!="string"&&typeof w.attrName!="string")throw new c("Invalid definition");if(w.blotName==="abstract")throw new c("Cannot register abstract class");if(p[w.blotName||w.attrName]=w,typeof w.keyName=="string")h[w.keyName]=w;else if(w.className!=null&&(d[w.className]=w),w.tagName!=null){Array.isArray(w.tagName)?w.tagName=w.tagName.map(function(x){return x.toUpperCase()}):w.tagName=w.tagName.toUpperCase();var T=Array.isArray(w.tagName)?w.tagName:[w.tagName];T.forEach(function(x){(g[x]==null||w.className==null)&&(g[x]=w)})}return w}n.register=_},function(e,n,i){var l=i(51),c=i(11),h=i(3),d=i(20),g="\0",p=function(a){Array.isArray(a)?this.ops=a:a!=null&&Array.isArray(a.ops)?this.ops=a.ops:this.ops=[]};p.prototype.insert=function(a,u){var f={};return a.length===0?this:(f.insert=a,u!=null&&typeof u=="object"&&Object.keys(u).length>0&&(f.attributes=u),this.push(f))},p.prototype.delete=function(a){return a<=0?this:this.push({delete:a})},p.prototype.retain=function(a,u){if(a<=0)return this;var f={retain:a};return u!=null&&typeof u=="object"&&Object.keys(u).length>0&&(f.attributes=u),this.push(f)},p.prototype.push=function(a){var u=this.ops.length,f=this.ops[u-1];if(a=h(!0,{},a),typeof f=="object"){if(typeof a.delete=="number"&&typeof f.delete=="number")return this.ops[u-1]={delete:f.delete+a.delete},this;if(typeof f.delete=="number"&&a.insert!=null&&(u-=1,f=this.ops[u-1],typeof f!="object"))return this.ops.unshift(a),this;if(c(a.attributes,f.attributes)){if(typeof a.insert=="string"&&typeof f.insert=="string")return this.ops[u-1]={insert:f.insert+a.insert},typeof a.attributes=="object"&&(this.ops[u-1].attributes=a.attributes),this;if(typeof a.retain=="number"&&typeof f.retain=="number")return this.ops[u-1]={retain:f.retain+a.retain},typeof a.attributes=="object"&&(this.ops[u-1].attributes=a.attributes),this}}return u===this.ops.length?this.ops.push(a):this.ops.splice(u,0,a),this},p.prototype.chop=function(){var a=this.ops[this.ops.length-1];return a&&a.retain&&!a.attributes&&this.ops.pop(),this},p.prototype.filter=function(a){return this.ops.filter(a)},p.prototype.forEach=function(a){this.ops.forEach(a)},p.prototype.map=function(a){return this.ops.map(a)},p.prototype.partition=function(a){var u=[],f=[];return this.forEach(function(y){var _=a(y)?u:f;_.push(y)}),[u,f]},p.prototype.reduce=function(a,u){return this.ops.reduce(a,u)},p.prototype.changeLength=function(){return this.reduce(function(a,u){return u.insert?a+d.length(u):u.delete?a-u.delete:a},0)},p.prototype.length=function(){return this.reduce(function(a,u){return a+d.length(u)},0)},p.prototype.slice=function(a,u){a=a||0,typeof u!="number"&&(u=1/0);for(var f=[],y=d.iterator(this.ops),_=0;_<u&&y.hasNext();){var b;_<a?b=y.next(a-_):(b=y.next(u-_),f.push(b)),_+=d.length(b)}return new p(f)},p.prototype.compose=function(a){var u=d.iterator(this.ops),f=d.iterator(a.ops),y=[],_=f.peek();if(_!=null&&typeof _.retain=="number"&&_.attributes==null){for(var b=_.retain;u.peekType()==="insert"&&u.peekLength()<=b;)b-=u.peekLength(),y.push(u.next());_.retain-b>0&&f.next(_.retain-b)}for(var v=new p(y);u.hasNext()||f.hasNext();)if(f.peekType()==="insert")v.push(f.next());else if(u.peekType()==="delete")v.push(u.next());else{var w=Math.min(u.peekLength(),f.peekLength()),T=u.next(w),x=f.next(w);if(typeof x.retain=="number"){var S={};typeof T.retain=="number"?S.retain=w:S.insert=T.insert;var C=d.attributes.compose(T.attributes,x.attributes,typeof T.retain=="number");if(C&&(S.attributes=C),v.push(S),!f.hasNext()&&c(v.ops[v.ops.length-1],S)){var A=new p(u.rest());return v.concat(A).chop()}}else typeof x.delete=="number"&&typeof T.retain=="number"&&v.push(x)}return v.chop()},p.prototype.concat=function(a){var u=new p(this.ops.slice());return a.ops.length>0&&(u.push(a.ops[0]),u.ops=u.ops.concat(a.ops.slice(1))),u},p.prototype.diff=function(a,u){if(this.ops===a.ops)return new p;var f=[this,a].map(function(w){return w.map(function(T){if(T.insert!=null)return typeof T.insert=="string"?T.insert:g;var x=w===a?"on":"with";throw new Error("diff() called "+x+" non-document")}).join("")}),y=new p,_=l(f[0],f[1],u),b=d.iterator(this.ops),v=d.iterator(a.ops);return _.forEach(function(w){for(var T=w[1].length;T>0;){var x=0;switch(w[0]){case l.INSERT:x=Math.min(v.peekLength(),T),y.push(v.next(x));break;case l.DELETE:x=Math.min(T,b.peekLength()),b.next(x),y.delete(x);break;case l.EQUAL:x=Math.min(b.peekLength(),v.peekLength(),T);var S=b.next(x),C=v.next(x);c(S.insert,C.insert)?y.retain(x,d.attributes.diff(S.attributes,C.attributes)):y.push(C).delete(x);break}T-=x}}),y.chop()},p.prototype.eachLine=function(a,u){u=u||`
`;for(var f=d.iterator(this.ops),y=new p,_=0;f.hasNext();){if(f.peekType()!=="insert")return;var b=f.peek(),v=d.length(b)-f.peekLength(),w=typeof b.insert=="string"?b.insert.indexOf(u,v)-v:-1;if(w<0)y.push(f.next());else if(w>0)y.push(f.next(w));else{if(a(y,f.next(1).attributes||{},_)===!1)return;_+=1,y=new p}}y.length()>0&&a(y,{},_)},p.prototype.transform=function(a,u){if(u=!!u,typeof a=="number")return this.transformPosition(a,u);for(var f=d.iterator(this.ops),y=d.iterator(a.ops),_=new p;f.hasNext()||y.hasNext();)if(f.peekType()==="insert"&&(u||y.peekType()!=="insert"))_.retain(d.length(f.next()));else if(y.peekType()==="insert")_.push(y.next());else{var b=Math.min(f.peekLength(),y.peekLength()),v=f.next(b),w=y.next(b);if(v.delete)continue;w.delete?_.push(w):_.retain(b,d.attributes.transform(v.attributes,w.attributes,u))}return _.chop()},p.prototype.transformPosition=function(a,u){u=!!u;for(var f=d.iterator(this.ops),y=0;f.hasNext()&&y<=a;){var _=f.peekLength(),b=f.peekType();if(f.next(),b==="delete"){a-=Math.min(_,a-y);continue}else b==="insert"&&(y<a||!u)&&(a+=_);y+=_}return a},e.exports=p},function(e,n){var i=Object.prototype.hasOwnProperty,l=Object.prototype.toString,c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,d=function(f){return typeof Array.isArray=="function"?Array.isArray(f):l.call(f)==="[object Array]"},g=function(f){if(!f||l.call(f)!=="[object Object]")return!1;var y=i.call(f,"constructor"),_=f.constructor&&f.constructor.prototype&&i.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!y&&!_)return!1;var b;for(b in f);return typeof b=="undefined"||i.call(f,b)},p=function(f,y){c&&y.name==="__proto__"?c(f,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):f[y.name]=y.newValue},a=function(f,y){if(y==="__proto__")if(i.call(f,y)){if(h)return h(f,y).value}else return;return f[y]};e.exports=function u(){var f,y,_,b,v,w,T=arguments[0],x=1,S=arguments.length,C=!1;for(typeof T=="boolean"&&(C=T,T=arguments[1]||{},x=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});x<S;++x)if(f=arguments[x],f!=null)for(y in f)_=a(T,y),b=a(f,y),T!==b&&(C&&b&&(g(b)||(v=d(b)))?(v?(v=!1,w=_&&d(_)?_:[]):w=_&&g(_)?_:{},p(T,{name:y,newValue:u(C,w,b)})):typeof b!="undefined"&&p(T,{name:y,newValue:b}));return T}},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var l=function(){function k(P,I){for(var j=0;j<I.length;j++){var W=I[j];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(P,W.key,W)}}return function(P,I,j){return I&&k(P.prototype,I),j&&k(P,j),P}}(),c=function k(P,I,j){P===null&&(P=Function.prototype);var W=Object.getOwnPropertyDescriptor(P,I);if(W===void 0){var J=Object.getPrototypeOf(P);return J===null?void 0:k(J,I,j)}else{if("value"in W)return W.value;var ee=W.get;return ee===void 0?void 0:ee.call(j)}},h=i(3),d=T(h),g=i(2),p=T(g),a=i(0),u=T(a),f=i(16),y=T(f),_=i(6),b=T(_),v=i(7),w=T(v);function T(k){return k&&k.__esModule?k:{default:k}}function x(k,P){if(!(k instanceof P))throw new TypeError("Cannot call a class as a function")}function S(k,P){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:k}function C(k,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);k.prototype=Object.create(P&&P.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(k,P):k.__proto__=P)}var A=1,R=function(k){C(P,k);function P(){return x(this,P),S(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return l(P,[{key:"attach",value:function(){c(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"attach",this).call(this),this.attributes=new u.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new p.default().insert(this.value(),(0,d.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(j,W){var J=u.default.query(j,u.default.Scope.BLOCK_ATTRIBUTE);J!=null&&this.attributes.attribute(J,W)}},{key:"formatAt",value:function(j,W,J,ee){this.format(J,ee)}},{key:"insertAt",value:function(j,W,J){if(typeof W=="string"&&W.endsWith(`
`)){var ee=u.default.create(L.blotName);this.parent.insertBefore(ee,j===0?this:this.next),ee.insertAt(0,W.slice(0,-1))}else c(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"insertAt",this).call(this,j,W,J)}}]),P}(u.default.Embed);R.scope=u.default.Scope.BLOCK_BLOT;var L=function(k){C(P,k);function P(I){x(this,P);var j=S(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,I));return j.cache={},j}return l(P,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(u.default.Leaf).reduce(function(j,W){return W.length()===0?j:j.insert(W.value(),M(W))},new p.default).insert(`
`,M(this))),this.cache.delta}},{key:"deleteAt",value:function(j,W){c(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"deleteAt",this).call(this,j,W),this.cache={}}},{key:"formatAt",value:function(j,W,J,ee){W<=0||(u.default.query(J,u.default.Scope.BLOCK)?j+W===this.length()&&this.format(J,ee):c(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"formatAt",this).call(this,j,Math.min(W,this.length()-j-1),J,ee),this.cache={})}},{key:"insertAt",value:function(j,W,J){if(J!=null)return c(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"insertAt",this).call(this,j,W,J);if(W.length!==0){var ee=W.split(`
`),oe=ee.shift();oe.length>0&&(j<this.length()-1||this.children.tail==null?c(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"insertAt",this).call(this,Math.min(j,this.length()-1),oe):this.children.tail.insertAt(this.children.tail.length(),oe),this.cache={});var V=this;ee.reduce(function($,N){return V=V.split($,!0),V.insertAt(0,N),N.length},j+oe.length)}}},{key:"insertBefore",value:function(j,W){var J=this.children.head;c(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"insertBefore",this).call(this,j,W),J instanceof y.default&&J.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=c(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"length",this).call(this)+A),this.cache.length}},{key:"moveChildren",value:function(j,W){c(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"moveChildren",this).call(this,j,W),this.cache={}}},{key:"optimize",value:function(j){c(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,j),this.cache={}}},{key:"path",value:function(j){return c(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"path",this).call(this,j,!0)}},{key:"removeChild",value:function(j){c(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"removeChild",this).call(this,j),this.cache={}}},{key:"split",value:function(j){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(W&&(j===0||j>=this.length()-A)){var J=this.clone();return j===0?(this.parent.insertBefore(J,this),this):(this.parent.insertBefore(J,this.next),J)}else{var ee=c(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"split",this).call(this,j,W);return this.cache={},ee}}}]),P}(u.default.Block);L.blotName="block",L.tagName="P",L.defaultChild="break",L.allowedChildren=[b.default,u.default.Embed,w.default];function M(k){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return k==null||(typeof k.formats=="function"&&(P=(0,d.default)(P,k.formats())),k.parent==null||k.parent.blotName=="scroll"||k.parent.statics.scope!==k.statics.scope)?P:M(k.parent,P)}n.bubbleFormats=M,n.BlockEmbed=R,n.default=L},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},c=function(){function V($,N){var H=[],G=!0,ne=!1,X=void 0;try{for(var U=$[Symbol.iterator](),Q;!(G=(Q=U.next()).done)&&(H.push(Q.value),!(N&&H.length===N));G=!0);}catch(ie){ne=!0,X=ie}finally{try{!G&&U.return&&U.return()}finally{if(ne)throw X}}return H}return function($,N){if(Array.isArray($))return $;if(Symbol.iterator in Object($))return V($,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function V($,N){for(var H=0;H<N.length;H++){var G=N[H];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty($,G.key,G)}}return function($,N,H){return N&&V($.prototype,N),H&&V($,H),$}}();i(50);var d=i(2),g=M(d),p=i(14),a=M(p),u=i(8),f=M(u),y=i(9),_=M(y),b=i(0),v=M(b),w=i(15),T=M(w),x=i(3),S=M(x),C=i(10),A=M(C),R=i(34),L=M(R);function M(V){return V&&V.__esModule?V:{default:V}}function k(V,$,N){return $ in V?Object.defineProperty(V,$,{value:N,enumerable:!0,configurable:!0,writable:!0}):V[$]=N,V}function P(V,$){if(!(V instanceof $))throw new TypeError("Cannot call a class as a function")}var I=(0,A.default)("quill"),j=function(){h(V,null,[{key:"debug",value:function(N){N===!0&&(N="log"),A.default.level(N)}},{key:"find",value:function(N){return N.__quill||v.default.find(N)}},{key:"import",value:function(N){return this.imports[N]==null&&I.error("Cannot import "+N+". Are you sure it was registered?"),this.imports[N]}},{key:"register",value:function(N,H){var G=this,ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof N!="string"){var X=N.attrName||N.blotName;typeof X=="string"?this.register("formats/"+X,N,H):Object.keys(N).forEach(function(U){G.register(U,N[U],H)})}else this.imports[N]!=null&&!ne&&I.warn("Overwriting "+N+" with",H),this.imports[N]=H,(N.startsWith("blots/")||N.startsWith("formats/"))&&H.blotName!=="abstract"?v.default.register(H):N.startsWith("modules")&&typeof H.register=="function"&&H.register()}}]);function V($){var N=this,H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(P(this,V),this.options=W($,H),this.container=this.options.container,this.container==null)return I.error("Invalid Quill container",$);this.options.debug&&V.debug(this.options.debug);var G=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new f.default,this.scroll=v.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new a.default(this.scroll),this.selection=new T.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(f.default.events.EDITOR_CHANGE,function(X){X===f.default.events.TEXT_CHANGE&&N.root.classList.toggle("ql-blank",N.editor.isBlank())}),this.emitter.on(f.default.events.SCROLL_UPDATE,function(X,U){var Q=N.selection.lastRange,ie=Q&&Q.length===0?Q.index:void 0;J.call(N,function(){return N.editor.update(null,U,ie)},X)});var ne=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+G+"<p><br></p></div>");this.setContents(ne),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return h(V,[{key:"addContainer",value:function(N){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof N=="string"){var G=N;N=document.createElement("div"),N.classList.add(G)}return this.container.insertBefore(N,H),N}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(N,H,G){var ne=this,X=ee(N,H,G),U=c(X,4);return N=U[0],H=U[1],G=U[3],J.call(this,function(){return ne.editor.deleteText(N,H)},G,N,-1*H)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(N),this.container.classList.toggle("ql-disabled",!N)}},{key:"focus",value:function(){var N=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=N,this.scrollIntoView()}},{key:"format",value:function(N,H){var G=this,ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.default.sources.API;return J.call(this,function(){var X=G.getSelection(!0),U=new g.default;if(X==null)return U;if(v.default.query(N,v.default.Scope.BLOCK))U=G.editor.formatLine(X.index,X.length,k({},N,H));else{if(X.length===0)return G.selection.format(N,H),U;U=G.editor.formatText(X.index,X.length,k({},N,H))}return G.setSelection(X,f.default.sources.SILENT),U},ne)}},{key:"formatLine",value:function(N,H,G,ne,X){var U=this,Q=void 0,ie=ee(N,H,G,ne,X),ae=c(ie,4);return N=ae[0],H=ae[1],Q=ae[2],X=ae[3],J.call(this,function(){return U.editor.formatLine(N,H,Q)},X,N,0)}},{key:"formatText",value:function(N,H,G,ne,X){var U=this,Q=void 0,ie=ee(N,H,G,ne,X),ae=c(ie,4);return N=ae[0],H=ae[1],Q=ae[2],X=ae[3],J.call(this,function(){return U.editor.formatText(N,H,Q)},X,N,0)}},{key:"getBounds",value:function(N){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,G=void 0;typeof N=="number"?G=this.selection.getBounds(N,H):G=this.selection.getBounds(N.index,N.length);var ne=this.container.getBoundingClientRect();return{bottom:G.bottom-ne.top,height:G.height,left:G.left-ne.left,right:G.right-ne.left,top:G.top-ne.top,width:G.width}}},{key:"getContents",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-N,G=ee(N,H),ne=c(G,2);return N=ne[0],H=ne[1],this.editor.getContents(N,H)}},{key:"getFormat",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof N=="number"?this.editor.getFormat(N,H):this.editor.getFormat(N.index,N.length)}},{key:"getIndex",value:function(N){return N.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(N){return this.scroll.leaf(N)}},{key:"getLine",value:function(N){return this.scroll.line(N)}},{key:"getLines",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof N!="number"?this.scroll.lines(N.index,N.length):this.scroll.lines(N,H)}},{key:"getModule",value:function(N){return this.theme.modules[N]}},{key:"getSelection",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return N&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-N,G=ee(N,H),ne=c(G,2);return N=ne[0],H=ne[1],this.editor.getText(N,H)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(N,H,G){var ne=this,X=arguments.length>3&&arguments[3]!==void 0?arguments[3]:V.sources.API;return J.call(this,function(){return ne.editor.insertEmbed(N,H,G)},X,N)}},{key:"insertText",value:function(N,H,G,ne,X){var U=this,Q=void 0,ie=ee(N,0,G,ne,X),ae=c(ie,4);return N=ae[0],Q=ae[2],X=ae[3],J.call(this,function(){return U.editor.insertText(N,H,Q)},X,N,H.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(N,H,G){this.clipboard.dangerouslyPasteHTML(N,H,G)}},{key:"removeFormat",value:function(N,H,G){var ne=this,X=ee(N,H,G),U=c(X,4);return N=U[0],H=U[1],G=U[3],J.call(this,function(){return ne.editor.removeFormat(N,H)},G,N)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(N){var H=this,G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API;return J.call(this,function(){N=new g.default(N);var ne=H.getLength(),X=H.editor.deleteText(0,ne),U=H.editor.applyDelta(N),Q=U.ops[U.ops.length-1];Q!=null&&typeof Q.insert=="string"&&Q.insert[Q.insert.length-1]===`
`&&(H.editor.deleteText(H.getLength()-1,1),U.delete(1));var ie=X.compose(U);return ie},G)}},{key:"setSelection",value:function(N,H,G){if(N==null)this.selection.setRange(null,H||V.sources.API);else{var ne=ee(N,H,G),X=c(ne,4);N=X[0],H=X[1],G=X[3],this.selection.setRange(new w.Range(N,H),G),G!==f.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(N){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API,G=new g.default().insert(N);return this.setContents(G,H)}},{key:"update",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f.default.sources.USER,H=this.scroll.update(N);return this.selection.update(N),H}},{key:"updateContents",value:function(N){var H=this,G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API;return J.call(this,function(){return N=new g.default(N),H.editor.applyDelta(N,G)},G,!0)}}]),V}();j.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},j.events=f.default.events,j.sources=f.default.sources,j.version="1.3.7",j.imports={delta:g.default,parchment:v.default,"core/module":_.default,"core/theme":L.default};function W(V,$){if($=(0,S.default)(!0,{container:V,modules:{clipboard:!0,keyboard:!0,history:!0}},$),!$.theme||$.theme===j.DEFAULTS.theme)$.theme=L.default;else if($.theme=j.import("themes/"+$.theme),$.theme==null)throw new Error("Invalid theme "+$.theme+". Did you register it?");var N=(0,S.default)(!0,{},$.theme.DEFAULTS);[N,$].forEach(function(ne){ne.modules=ne.modules||{},Object.keys(ne.modules).forEach(function(X){ne.modules[X]===!0&&(ne.modules[X]={})})});var H=Object.keys(N.modules).concat(Object.keys($.modules)),G=H.reduce(function(ne,X){var U=j.import("modules/"+X);return U==null?I.error("Cannot load "+X+" module. Are you sure you registered it?"):ne[X]=U.DEFAULTS||{},ne},{});return $.modules!=null&&$.modules.toolbar&&$.modules.toolbar.constructor!==Object&&($.modules.toolbar={container:$.modules.toolbar}),$=(0,S.default)(!0,{},j.DEFAULTS,{modules:G},N,$),["bounds","container","scrollingContainer"].forEach(function(ne){typeof $[ne]=="string"&&($[ne]=document.querySelector($[ne]))}),$.modules=Object.keys($.modules).reduce(function(ne,X){return $.modules[X]&&(ne[X]=$.modules[X]),ne},{}),$}function J(V,$,N,H){if(this.options.strict&&!this.isEnabled()&&$===f.default.sources.USER)return new g.default;var G=N==null?null:this.getSelection(),ne=this.editor.delta,X=V();if(G!=null&&(N===!0&&(N=G.index),H==null?G=oe(G,X,$):H!==0&&(G=oe(G,N,H,$)),this.setSelection(G,f.default.sources.SILENT)),X.length()>0){var U,Q=[f.default.events.TEXT_CHANGE,X,ne,$];if((U=this.emitter).emit.apply(U,[f.default.events.EDITOR_CHANGE].concat(Q)),$!==f.default.sources.SILENT){var ie;(ie=this.emitter).emit.apply(ie,Q)}}return X}function ee(V,$,N,H,G){var ne={};return typeof V.index=="number"&&typeof V.length=="number"?typeof $!="number"?(G=H,H=N,N=$,$=V.length,V=V.index):($=V.length,V=V.index):typeof $!="number"&&(G=H,H=N,N=$,$=0),(typeof N=="undefined"?"undefined":l(N))==="object"?(ne=N,G=H):typeof N=="string"&&(H!=null?ne[N]=H:G=N),G=G||f.default.sources.API,[V,$,ne,G]}function oe(V,$,N,H){if(V==null)return null;var G=void 0,ne=void 0;if($ instanceof g.default){var X=[V.index,V.index+V.length].map(function(ae){return $.transformPosition(ae,H!==f.default.sources.USER)}),U=c(X,2);G=U[0],ne=U[1]}else{var Q=[V.index,V.index+V.length].map(function(ae){return ae<$||ae===$&&H===f.default.sources.USER?ae:N>=0?ae+N:Math.max($,ae+N)}),ie=c(Q,2);G=ie[0],ne=ie[1]}return new w.Range(G,ne-G)}n.expandConfig=W,n.overload=ee,n.default=j},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function b(v,w){for(var T=0;T<w.length;T++){var x=w[T];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,x.key,x)}}return function(v,w,T){return w&&b(v.prototype,w),T&&b(v,T),v}}(),c=function b(v,w,T){v===null&&(v=Function.prototype);var x=Object.getOwnPropertyDescriptor(v,w);if(x===void 0){var S=Object.getPrototypeOf(v);return S===null?void 0:b(S,w,T)}else{if("value"in x)return x.value;var C=x.get;return C===void 0?void 0:C.call(T)}},h=i(7),d=a(h),g=i(0),p=a(g);function a(b){return b&&b.__esModule?b:{default:b}}function u(b,v){if(!(b instanceof v))throw new TypeError("Cannot call a class as a function")}function f(b,v){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:b}function y(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);b.prototype=Object.create(v&&v.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(b,v):b.__proto__=v)}var _=function(b){y(v,b);function v(){return u(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return l(v,[{key:"formatAt",value:function(T,x,S,C){if(v.compare(this.statics.blotName,S)<0&&p.default.query(S,p.default.Scope.BLOT)){var A=this.isolate(T,x);C&&A.wrap(S,C)}else c(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"formatAt",this).call(this,T,x,S,C)}},{key:"optimize",value:function(T){if(c(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,T),this.parent instanceof v&&v.compare(this.statics.blotName,this.parent.statics.blotName)>0){var x=this.parent.isolate(this.offset(),this.length());this.moveChildren(x),x.wrap(this)}}}],[{key:"compare",value:function(T,x){var S=v.order.indexOf(T),C=v.order.indexOf(x);return S>=0||C>=0?S-C:T===x?0:T<x?-1:1}}]),v}(p.default.Inline);_.allowedChildren=[_,p.default.Embed,d.default],_.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=_},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=i(0),c=h(l);function h(u){return u&&u.__esModule?u:{default:u}}function d(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}function g(u,f){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:u}function p(u,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);u.prototype=Object.create(f&&f.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(u,f):u.__proto__=f)}var a=function(u){p(f,u);function f(){return d(this,f),g(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(c.default.Text);n.default=a},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function w(T,x){for(var S=0;S<x.length;S++){var C=x[S];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(T,C.key,C)}}return function(T,x,S){return x&&w(T.prototype,x),S&&w(T,S),T}}(),c=function w(T,x,S){T===null&&(T=Function.prototype);var C=Object.getOwnPropertyDescriptor(T,x);if(C===void 0){var A=Object.getPrototypeOf(T);return A===null?void 0:w(A,x,S)}else{if("value"in C)return C.value;var R=C.get;return R===void 0?void 0:R.call(S)}},h=i(54),d=a(h),g=i(10),p=a(g);function a(w){return w&&w.__esModule?w:{default:w}}function u(w,T){if(!(w instanceof T))throw new TypeError("Cannot call a class as a function")}function f(w,T){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:w}function y(w,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);w.prototype=Object.create(T&&T.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(w,T):w.__proto__=T)}var _=(0,p.default)("quill:events"),b=["selectionchange","mousedown","mouseup","click"];b.forEach(function(w){document.addEventListener(w,function(){for(var T=arguments.length,x=Array(T),S=0;S<T;S++)x[S]=arguments[S];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(C){if(C.__quill&&C.__quill.emitter){var A;(A=C.__quill.emitter).handleDOM.apply(A,x)}})})});var v=function(w){y(T,w);function T(){u(this,T);var x=f(this,(T.__proto__||Object.getPrototypeOf(T)).call(this));return x.listeners={},x.on("error",_.error),x}return l(T,[{key:"emit",value:function(){_.log.apply(_,arguments),c(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(S){for(var C=arguments.length,A=Array(C>1?C-1:0),R=1;R<C;R++)A[R-1]=arguments[R];(this.listeners[S.type]||[]).forEach(function(L){var M=L.node,k=L.handler;(S.target===M||M.contains(S.target))&&k.apply(void 0,[S].concat(A))})}},{key:"listenDOM",value:function(S,C,A){this.listeners[S]||(this.listeners[S]=[]),this.listeners[S].push({node:C,handler:A})}}]),T}(d.default);v.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},v.sources={API:"api",SILENT:"silent",USER:"user"},n.default=v},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});function l(h,d){if(!(h instanceof d))throw new TypeError("Cannot call a class as a function")}var c=function h(d){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l(this,h),this.quill=d,this.options=g};c.DEFAULTS={},n.default=c},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=["error","warn","log","info"],c="warn";function h(g){if(l.indexOf(g)<=l.indexOf(c)){for(var p,a=arguments.length,u=Array(a>1?a-1:0),f=1;f<a;f++)u[f-1]=arguments[f];(p=console)[g].apply(p,u)}}function d(g){return l.reduce(function(p,a){return p[a]=h.bind(console,a,g),p},{})}h.level=d.level=function(g){c=g},n.default=d},function(e,n,i){var l=Array.prototype.slice,c=i(52),h=i(53),d=e.exports=function(u,f,y){return y||(y={}),u===f?!0:u instanceof Date&&f instanceof Date?u.getTime()===f.getTime():!u||!f||typeof u!="object"&&typeof f!="object"?y.strict?u===f:u==f:a(u,f,y)};function g(u){return u==null}function p(u){return!(!u||typeof u!="object"||typeof u.length!="number"||typeof u.copy!="function"||typeof u.slice!="function"||u.length>0&&typeof u[0]!="number")}function a(u,f,y){var _,b;if(g(u)||g(f)||u.prototype!==f.prototype)return!1;if(h(u))return h(f)?(u=l.call(u),f=l.call(f),d(u,f,y)):!1;if(p(u)){if(!p(f)||u.length!==f.length)return!1;for(_=0;_<u.length;_++)if(u[_]!==f[_])return!1;return!0}try{var v=c(u),w=c(f)}catch(T){return!1}if(v.length!=w.length)return!1;for(v.sort(),w.sort(),_=v.length-1;_>=0;_--)if(v[_]!=w[_])return!1;for(_=v.length-1;_>=0;_--)if(b=v[_],!d(u[b],f[b],y))return!1;return typeof u==typeof f}},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=i(1),c=function(){function h(d,g,p){p===void 0&&(p={}),this.attrName=d,this.keyName=g;var a=l.Scope.TYPE&l.Scope.ATTRIBUTE;p.scope!=null?this.scope=p.scope&l.Scope.LEVEL|a:this.scope=l.Scope.ATTRIBUTE,p.whitelist!=null&&(this.whitelist=p.whitelist)}return h.keys=function(d){return[].map.call(d.attributes,function(g){return g.name})},h.prototype.add=function(d,g){return this.canAdd(d,g)?(d.setAttribute(this.keyName,g),!0):!1},h.prototype.canAdd=function(d,g){var p=l.query(d,l.Scope.BLOT&(this.scope|l.Scope.TYPE));return p==null?!1:this.whitelist==null?!0:typeof g=="string"?this.whitelist.indexOf(g.replace(/["']/g,""))>-1:this.whitelist.indexOf(g)>-1},h.prototype.remove=function(d){d.removeAttribute(this.keyName)},h.prototype.value=function(d){var g=d.getAttribute(this.keyName);return this.canAdd(d,g)&&g?g:""},h}();n.default=c},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var l=function(){function R(L,M){var k=[],P=!0,I=!1,j=void 0;try{for(var W=L[Symbol.iterator](),J;!(P=(J=W.next()).done)&&(k.push(J.value),!(M&&k.length===M));P=!0);}catch(ee){I=!0,j=ee}finally{try{!P&&W.return&&W.return()}finally{if(I)throw j}}return k}return function(L,M){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return R(L,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function R(L,M){for(var k=0;k<M.length;k++){var P=M[k];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(L,P.key,P)}}return function(L,M,k){return M&&R(L.prototype,M),k&&R(L,k),L}}(),h=function R(L,M,k){L===null&&(L=Function.prototype);var P=Object.getOwnPropertyDescriptor(L,M);if(P===void 0){var I=Object.getPrototypeOf(L);return I===null?void 0:R(I,M,k)}else{if("value"in P)return P.value;var j=P.get;return j===void 0?void 0:j.call(k)}},d=i(2),g=w(d),p=i(0),a=w(p),u=i(4),f=w(u),y=i(6),_=w(y),b=i(7),v=w(b);function w(R){return R&&R.__esModule?R:{default:R}}function T(R,L){if(!(R instanceof L))throw new TypeError("Cannot call a class as a function")}function x(R,L){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:R}function S(R,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);R.prototype=Object.create(L&&L.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(R,L):R.__proto__=L)}var C=function(R){S(L,R);function L(){return T(this,L),x(this,(L.__proto__||Object.getPrototypeOf(L)).apply(this,arguments))}return L}(_.default);C.blotName="code",C.tagName="CODE";var A=function(R){S(L,R);function L(){return T(this,L),x(this,(L.__proto__||Object.getPrototypeOf(L)).apply(this,arguments))}return c(L,[{key:"delta",value:function(){var k=this,P=this.domNode.textContent;return P.endsWith(`
`)&&(P=P.slice(0,-1)),P.split(`
`).reduce(function(I,j){return I.insert(j).insert(`
`,k.formats())},new g.default)}},{key:"format",value:function(k,P){if(!(k===this.statics.blotName&&P)){var I=this.descendant(v.default,this.length()-1),j=l(I,1),W=j[0];W!=null&&W.deleteAt(W.length()-1,1),h(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"format",this).call(this,k,P)}}},{key:"formatAt",value:function(k,P,I,j){if(P!==0&&!(a.default.query(I,a.default.Scope.BLOCK)==null||I===this.statics.blotName&&j===this.statics.formats(this.domNode))){var W=this.newlineIndex(k);if(!(W<0||W>=k+P)){var J=this.newlineIndex(k,!0)+1,ee=W-J+1,oe=this.isolate(J,ee),V=oe.next;oe.format(I,j),V instanceof L&&V.formatAt(0,k-J+P-ee,I,j)}}}},{key:"insertAt",value:function(k,P,I){if(I==null){var j=this.descendant(v.default,k),W=l(j,2),J=W[0],ee=W[1];J.insertAt(ee,P)}}},{key:"length",value:function(){var k=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
`)?k:k+1}},{key:"newlineIndex",value:function(k){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(P)return this.domNode.textContent.slice(0,k).lastIndexOf(`
`);var I=this.domNode.textContent.slice(k).indexOf(`
`);return I>-1?k+I:-1}},{key:"optimize",value:function(k){this.domNode.textContent.endsWith(`
`)||this.appendChild(a.default.create("text",`
`)),h(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"optimize",this).call(this,k);var P=this.next;P!=null&&P.prev===this&&P.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===P.statics.formats(P.domNode)&&(P.optimize(k),P.moveChildren(this),P.remove())}},{key:"replace",value:function(k){h(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"replace",this).call(this,k),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(P){var I=a.default.find(P);I==null?P.parentNode.removeChild(P):I instanceof a.default.Embed?I.remove():I.unwrap()})}}],[{key:"create",value:function(k){var P=h(L.__proto__||Object.getPrototypeOf(L),"create",this).call(this,k);return P.setAttribute("spellcheck",!1),P}},{key:"formats",value:function(){return!0}}]),L}(f.default);A.blotName="code-block",A.tagName="PRE",A.TAB=" ",n.Code=C,n.default=A},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},c=function(){function V($,N){var H=[],G=!0,ne=!1,X=void 0;try{for(var U=$[Symbol.iterator](),Q;!(G=(Q=U.next()).done)&&(H.push(Q.value),!(N&&H.length===N));G=!0);}catch(ie){ne=!0,X=ie}finally{try{!G&&U.return&&U.return()}finally{if(ne)throw X}}return H}return function($,N){if(Array.isArray($))return $;if(Symbol.iterator in Object($))return V($,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function V($,N){for(var H=0;H<N.length;H++){var G=N[H];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty($,G.key,G)}}return function($,N,H){return N&&V($.prototype,N),H&&V($,H),$}}(),d=i(2),g=P(d),p=i(20),a=P(p),u=i(0),f=P(u),y=i(13),_=P(y),b=i(24),v=P(b),w=i(4),T=P(w),x=i(16),S=P(x),C=i(21),A=P(C),R=i(11),L=P(R),M=i(3),k=P(M);function P(V){return V&&V.__esModule?V:{default:V}}function I(V,$,N){return $ in V?Object.defineProperty(V,$,{value:N,enumerable:!0,configurable:!0,writable:!0}):V[$]=N,V}function j(V,$){if(!(V instanceof $))throw new TypeError("Cannot call a class as a function")}var W=/^[ -~]*$/,J=function(){function V($){j(this,V),this.scroll=$,this.delta=this.getDelta()}return h(V,[{key:"applyDelta",value:function(N){var H=this,G=!1;this.scroll.update();var ne=this.scroll.length();return this.scroll.batchStart(),N=oe(N),N.reduce(function(X,U){var Q=U.retain||U.delete||U.insert.length||1,ie=U.attributes||{};if(U.insert!=null){if(typeof U.insert=="string"){var ae=U.insert;ae.endsWith(`
`)&&G&&(G=!1,ae=ae.slice(0,-1)),X>=ne&&!ae.endsWith(`
`)&&(G=!0),H.scroll.insertAt(X,ae);var de=H.scroll.line(X),we=c(de,2),Pe=we[0],Me=we[1],De=(0,k.default)({},(0,w.bubbleFormats)(Pe));if(Pe instanceof T.default){var ze=Pe.descendant(f.default.Leaf,Me),xt=c(ze,1),Je=xt[0];De=(0,k.default)(De,(0,w.bubbleFormats)(Je))}ie=a.default.attributes.diff(De,ie)||{}}else if(l(U.insert)==="object"){var le=Object.keys(U.insert)[0];if(le==null)return X;H.scroll.insertAt(X,le,U.insert[le])}ne+=Q}return Object.keys(ie).forEach(function(he){H.scroll.formatAt(X,Q,he,ie[he])}),X+Q},0),N.reduce(function(X,U){return typeof U.delete=="number"?(H.scroll.deleteAt(X,U.delete),X):X+(U.retain||U.insert.length||1)},0),this.scroll.batchEnd(),this.update(N)}},{key:"deleteText",value:function(N,H){return this.scroll.deleteAt(N,H),this.update(new g.default().retain(N).delete(H))}},{key:"formatLine",value:function(N,H){var G=this,ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(ne).forEach(function(X){if(!(G.scroll.whitelist!=null&&!G.scroll.whitelist[X])){var U=G.scroll.lines(N,Math.max(H,1)),Q=H;U.forEach(function(ie){var ae=ie.length();if(!(ie instanceof _.default))ie.format(X,ne[X]);else{var de=N-ie.offset(G.scroll),we=ie.newlineIndex(de+Q)-de+1;ie.formatAt(de,we,X,ne[X])}Q-=ae})}}),this.scroll.optimize(),this.update(new g.default().retain(N).retain(H,(0,A.default)(ne)))}},{key:"formatText",value:function(N,H){var G=this,ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(ne).forEach(function(X){G.scroll.formatAt(N,H,X,ne[X])}),this.update(new g.default().retain(N).retain(H,(0,A.default)(ne)))}},{key:"getContents",value:function(N,H){return this.delta.slice(N,N+H)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(N,H){return N.concat(H.delta())},new g.default)}},{key:"getFormat",value:function(N){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,G=[],ne=[];H===0?this.scroll.path(N).forEach(function(U){var Q=c(U,1),ie=Q[0];ie instanceof T.default?G.push(ie):ie instanceof f.default.Leaf&&ne.push(ie)}):(G=this.scroll.lines(N,H),ne=this.scroll.descendants(f.default.Leaf,N,H));var X=[G,ne].map(function(U){if(U.length===0)return{};for(var Q=(0,w.bubbleFormats)(U.shift());Object.keys(Q).length>0;){var ie=U.shift();if(ie==null)return Q;Q=ee((0,w.bubbleFormats)(ie),Q)}return Q});return k.default.apply(k.default,X)}},{key:"getText",value:function(N,H){return this.getContents(N,H).filter(function(G){return typeof G.insert=="string"}).map(function(G){return G.insert}).join("")}},{key:"insertEmbed",value:function(N,H,G){return this.scroll.insertAt(N,H,G),this.update(new g.default().retain(N).insert(I({},H,G)))}},{key:"insertText",value:function(N,H){var G=this,ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return H=H.replace(/\r\n/g,`
`).replace(/\r/g,`
`),this.scroll.insertAt(N,H),Object.keys(ne).forEach(function(X){G.scroll.formatAt(N,H.length,X,ne[X])}),this.update(new g.default().retain(N).insert(H,(0,A.default)(ne)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var N=this.scroll.children.head;return N.statics.blotName!==T.default.blotName||N.children.length>1?!1:N.children.head instanceof S.default}},{key:"removeFormat",value:function(N,H){var G=this.getText(N,H),ne=this.scroll.line(N+H),X=c(ne,2),U=X[0],Q=X[1],ie=0,ae=new g.default;U!=null&&(U instanceof _.default?ie=U.newlineIndex(Q)-Q+1:ie=U.length()-Q,ae=U.delta().slice(Q,Q+ie-1).insert(`
`));var de=this.getContents(N,H+ie),we=de.diff(new g.default().insert(G).concat(ae)),Pe=new g.default().retain(N).concat(we);return this.applyDelta(Pe)}},{key:"update",value:function(N){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,ne=this.delta;if(H.length===1&&H[0].type==="characterData"&&H[0].target.data.match(W)&&f.default.find(H[0].target)){var X=f.default.find(H[0].target),U=(0,w.bubbleFormats)(X),Q=X.offset(this.scroll),ie=H[0].oldValue.replace(v.default.CONTENTS,""),ae=new g.default().insert(ie),de=new g.default().insert(X.value()),we=new g.default().retain(Q).concat(ae.diff(de,G));N=we.reduce(function(Pe,Me){return Me.insert?Pe.insert(Me.insert,U):Pe.push(Me)},new g.default),this.delta=ne.compose(N)}else this.delta=this.getDelta(),(!N||!(0,L.default)(ne.compose(N),this.delta))&&(N=ne.diff(this.delta,G));return N}}]),V}();function ee(V,$){return Object.keys($).reduce(function(N,H){return V[H]==null||($[H]===V[H]?N[H]=$[H]:Array.isArray($[H])?$[H].indexOf(V[H])<0&&(N[H]=$[H].concat([V[H]])):N[H]=[$[H],V[H]]),N},{})}function oe(V){return V.reduce(function($,N){if(N.insert===1){var H=(0,A.default)(N.attributes);return delete H.image,$.insert({image:N.attributes.image},H)}if(N.attributes!=null&&(N.attributes.list===!0||N.attributes.bullet===!0)&&(N=(0,A.default)(N),N.attributes.list?N.attributes.list="ordered":(N.attributes.list="bullet",delete N.attributes.bullet)),typeof N.insert=="string"){var G=N.insert.replace(/\r\n/g,`
`).replace(/\r/g,`
`);return $.insert(G,N.attributes)}return $.push(N)},new g.default)}n.default=J},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var l=function(){function R(L,M){var k=[],P=!0,I=!1,j=void 0;try{for(var W=L[Symbol.iterator](),J;!(P=(J=W.next()).done)&&(k.push(J.value),!(M&&k.length===M));P=!0);}catch(ee){I=!0,j=ee}finally{try{!P&&W.return&&W.return()}finally{if(I)throw j}}return k}return function(L,M){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return R(L,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function R(L,M){for(var k=0;k<M.length;k++){var P=M[k];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(L,P.key,P)}}return function(L,M,k){return M&&R(L.prototype,M),k&&R(L,k),L}}(),h=i(0),d=v(h),g=i(21),p=v(g),a=i(11),u=v(a),f=i(8),y=v(f),_=i(10),b=v(_);function v(R){return R&&R.__esModule?R:{default:R}}function w(R){if(Array.isArray(R)){for(var L=0,M=Array(R.length);L<R.length;L++)M[L]=R[L];return M}else return Array.from(R)}function T(R,L){if(!(R instanceof L))throw new TypeError("Cannot call a class as a function")}var x=(0,b.default)("quill:selection"),S=function R(L){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;T(this,R),this.index=L,this.length=M},C=function(){function R(L,M){var k=this;T(this,R),this.emitter=M,this.scroll=L,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=d.default.create("cursor",this),this.lastRange=this.savedRange=new S(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){k.mouseDown||setTimeout(k.update.bind(k,y.default.sources.USER),1)}),this.emitter.on(y.default.events.EDITOR_CHANGE,function(P,I){P===y.default.events.TEXT_CHANGE&&I.length()>0&&k.update(y.default.sources.SILENT)}),this.emitter.on(y.default.events.SCROLL_BEFORE_UPDATE,function(){if(k.hasFocus()){var P=k.getNativeRange();P!=null&&P.start.node!==k.cursor.textNode&&k.emitter.once(y.default.events.SCROLL_UPDATE,function(){try{k.setNativeRange(P.start.node,P.start.offset,P.end.node,P.end.offset)}catch(I){}})}}),this.emitter.on(y.default.events.SCROLL_OPTIMIZE,function(P,I){if(I.range){var j=I.range,W=j.startNode,J=j.startOffset,ee=j.endNode,oe=j.endOffset;k.setNativeRange(W,J,ee,oe)}}),this.update(y.default.sources.SILENT)}return c(R,[{key:"handleComposition",value:function(){var M=this;this.root.addEventListener("compositionstart",function(){M.composing=!0}),this.root.addEventListener("compositionend",function(){if(M.composing=!1,M.cursor.parent){var k=M.cursor.restore();if(!k)return;setTimeout(function(){M.setNativeRange(k.startNode,k.startOffset,k.endNode,k.endOffset)},1)}})}},{key:"handleDragging",value:function(){var M=this;this.emitter.listenDOM("mousedown",document.body,function(){M.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){M.mouseDown=!1,M.update(y.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(M,k){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[M])){this.scroll.update();var P=this.getNativeRange();if(!(P==null||!P.native.collapsed||d.default.query(M,d.default.Scope.BLOCK))){if(P.start.node!==this.cursor.textNode){var I=d.default.find(P.start.node,!1);if(I==null)return;if(I instanceof d.default.Leaf){var j=I.split(P.start.offset);I.parent.insertBefore(this.cursor,j)}else I.insertBefore(this.cursor,P.start.node);this.cursor.attach()}this.cursor.format(M,k),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(M){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,P=this.scroll.length();M=Math.min(M,P-1),k=Math.min(M+k,P-1)-M;var I=void 0,j=this.scroll.leaf(M),W=l(j,2),J=W[0],ee=W[1];if(J==null)return null;var oe=J.position(ee,!0),V=l(oe,2);I=V[0],ee=V[1];var $=document.createRange();if(k>0){$.setStart(I,ee);var N=this.scroll.leaf(M+k),H=l(N,2);if(J=H[0],ee=H[1],J==null)return null;var G=J.position(ee,!0),ne=l(G,2);return I=ne[0],ee=ne[1],$.setEnd(I,ee),$.getBoundingClientRect()}else{var X="left",U=void 0;return I instanceof Text?(ee<I.data.length?($.setStart(I,ee),$.setEnd(I,ee+1)):($.setStart(I,ee-1),$.setEnd(I,ee),X="right"),U=$.getBoundingClientRect()):(U=J.domNode.getBoundingClientRect(),ee>0&&(X="right")),{bottom:U.top+U.height,height:U.height,left:U[X],right:U[X],top:U.top,width:0}}}},{key:"getNativeRange",value:function(){var M=document.getSelection();if(M==null||M.rangeCount<=0)return null;var k=M.getRangeAt(0);if(k==null)return null;var P=this.normalizeNative(k);return x.info("getNativeRange",P),P}},{key:"getRange",value:function(){var M=this.getNativeRange();if(M==null)return[null,null];var k=this.normalizedToRange(M);return[k,M]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(M){var k=this,P=[[M.start.node,M.start.offset]];M.native.collapsed||P.push([M.end.node,M.end.offset]);var I=P.map(function(J){var ee=l(J,2),oe=ee[0],V=ee[1],$=d.default.find(oe,!0),N=$.offset(k.scroll);return V===0?N:$ instanceof d.default.Container?N+$.length():N+$.index(oe,V)}),j=Math.min(Math.max.apply(Math,w(I)),this.scroll.length()-1),W=Math.min.apply(Math,[j].concat(w(I)));return new S(W,j-W)}},{key:"normalizeNative",value:function(M){if(!A(this.root,M.startContainer)||!M.collapsed&&!A(this.root,M.endContainer))return null;var k={start:{node:M.startContainer,offset:M.startOffset},end:{node:M.endContainer,offset:M.endOffset},native:M};return[k.start,k.end].forEach(function(P){for(var I=P.node,j=P.offset;!(I instanceof Text)&&I.childNodes.length>0;)if(I.childNodes.length>j)I=I.childNodes[j],j=0;else if(I.childNodes.length===j)I=I.lastChild,j=I instanceof Text?I.data.length:I.childNodes.length+1;else break;P.node=I,P.offset=j}),k}},{key:"rangeToNative",value:function(M){var k=this,P=M.collapsed?[M.index]:[M.index,M.index+M.length],I=[],j=this.scroll.length();return P.forEach(function(W,J){W=Math.min(j-1,W);var ee=void 0,oe=k.scroll.leaf(W),V=l(oe,2),$=V[0],N=V[1],H=$.position(N,J!==0),G=l(H,2);ee=G[0],N=G[1],I.push(ee,N)}),I.length<2&&(I=I.concat(I)),I}},{key:"scrollIntoView",value:function(M){var k=this.lastRange;if(k!=null){var P=this.getBounds(k.index,k.length);if(P!=null){var I=this.scroll.length()-1,j=this.scroll.line(Math.min(k.index,I)),W=l(j,1),J=W[0],ee=J;if(k.length>0){var oe=this.scroll.line(Math.min(k.index+k.length,I)),V=l(oe,1);ee=V[0]}if(!(J==null||ee==null)){var $=M.getBoundingClientRect();P.top<$.top?M.scrollTop-=$.top-P.top:P.bottom>$.bottom&&(M.scrollTop+=P.bottom-$.bottom)}}}}},{key:"setNativeRange",value:function(M,k){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:M,I=arguments.length>3&&arguments[3]!==void 0?arguments[3]:k,j=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(x.info("setNativeRange",M,k,P,I),!(M!=null&&(this.root.parentNode==null||M.parentNode==null||P.parentNode==null))){var W=document.getSelection();if(W!=null)if(M!=null){this.hasFocus()||this.root.focus();var J=(this.getNativeRange()||{}).native;if(J==null||j||M!==J.startContainer||k!==J.startOffset||P!==J.endContainer||I!==J.endOffset){M.tagName=="BR"&&(k=[].indexOf.call(M.parentNode.childNodes,M),M=M.parentNode),P.tagName=="BR"&&(I=[].indexOf.call(P.parentNode.childNodes,P),P=P.parentNode);var ee=document.createRange();ee.setStart(M,k),ee.setEnd(P,I),W.removeAllRanges(),W.addRange(ee)}}else W.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(M){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.default.sources.API;if(typeof k=="string"&&(P=k,k=!1),x.info("setRange",M),M!=null){var I=this.rangeToNative(M);this.setNativeRange.apply(this,w(I).concat([k]))}else this.setNativeRange(null);this.update(P)}},{key:"update",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y.default.sources.USER,k=this.lastRange,P=this.getRange(),I=l(P,2),j=I[0],W=I[1];if(this.lastRange=j,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,u.default)(k,this.lastRange)){var J;!this.composing&&W!=null&&W.native.collapsed&&W.start.node!==this.cursor.textNode&&this.cursor.restore();var ee=[y.default.events.SELECTION_CHANGE,(0,p.default)(this.lastRange),(0,p.default)(k),M];if((J=this.emitter).emit.apply(J,[y.default.events.EDITOR_CHANGE].concat(ee)),M!==y.default.sources.SILENT){var oe;(oe=this.emitter).emit.apply(oe,ee)}}}}]),R}();function A(R,L){try{L.parentNode}catch(M){return!1}return L instanceof Text&&(L=L.parentNode),R.contains(L)}n.Range=S,n.default=C},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function y(_,b){for(var v=0;v<b.length;v++){var w=b[v];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(_,w.key,w)}}return function(_,b,v){return b&&y(_.prototype,b),v&&y(_,v),_}}(),c=function y(_,b,v){_===null&&(_=Function.prototype);var w=Object.getOwnPropertyDescriptor(_,b);if(w===void 0){var T=Object.getPrototypeOf(_);return T===null?void 0:y(T,b,v)}else{if("value"in w)return w.value;var x=w.get;return x===void 0?void 0:x.call(v)}},h=i(0),d=g(h);function g(y){return y&&y.__esModule?y:{default:y}}function p(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function a(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function u(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var f=function(y){u(_,y);function _(){return p(this,_),a(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return l(_,[{key:"insertInto",value:function(v,w){v.children.length===0?c(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertInto",this).call(this,v,w):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),_}(d.default.Embed);f.blotName="break",f.tagName="BR",n.default=f},function(e,n,i){var l=this&&this.__extends||function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var y in f)f.hasOwnProperty(y)&&(u[y]=f[y])};return function(u,f){a(u,f);function y(){this.constructor=u}u.prototype=f===null?Object.create(f):(y.prototype=f.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var c=i(44),h=i(30),d=i(1),g=function(a){l(u,a);function u(f){var y=a.call(this,f)||this;return y.build(),y}return u.prototype.appendChild=function(f){this.insertBefore(f)},u.prototype.attach=function(){a.prototype.attach.call(this),this.children.forEach(function(f){f.attach()})},u.prototype.build=function(){var f=this;this.children=new c.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(y){try{var _=p(y);f.insertBefore(_,f.children.head||void 0)}catch(b){if(b instanceof d.ParchmentError)return;throw b}})},u.prototype.deleteAt=function(f,y){if(f===0&&y===this.length())return this.remove();this.children.forEachAt(f,y,function(_,b,v){_.deleteAt(b,v)})},u.prototype.descendant=function(f,y){var _=this.children.find(y),b=_[0],v=_[1];return f.blotName==null&&f(b)||f.blotName!=null&&b instanceof f?[b,v]:b instanceof u?b.descendant(f,v):[null,-1]},u.prototype.descendants=function(f,y,_){y===void 0&&(y=0),_===void 0&&(_=Number.MAX_VALUE);var b=[],v=_;return this.children.forEachAt(y,_,function(w,T,x){(f.blotName==null&&f(w)||f.blotName!=null&&w instanceof f)&&b.push(w),w instanceof u&&(b=b.concat(w.descendants(f,T,v))),v-=x}),b},u.prototype.detach=function(){this.children.forEach(function(f){f.detach()}),a.prototype.detach.call(this)},u.prototype.formatAt=function(f,y,_,b){this.children.forEachAt(f,y,function(v,w,T){v.formatAt(w,T,_,b)})},u.prototype.insertAt=function(f,y,_){var b=this.children.find(f),v=b[0],w=b[1];if(v)v.insertAt(w,y,_);else{var T=_==null?d.create("text",y):d.create(y,_);this.appendChild(T)}},u.prototype.insertBefore=function(f,y){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(_){return f instanceof _}))throw new d.ParchmentError("Cannot insert "+f.statics.blotName+" into "+this.statics.blotName);f.insertInto(this,y)},u.prototype.length=function(){return this.children.reduce(function(f,y){return f+y.length()},0)},u.prototype.moveChildren=function(f,y){this.children.forEach(function(_){f.insertBefore(_,y)})},u.prototype.optimize=function(f){if(a.prototype.optimize.call(this,f),this.children.length===0)if(this.statics.defaultChild!=null){var y=d.create(this.statics.defaultChild);this.appendChild(y),y.optimize(f)}else this.remove()},u.prototype.path=function(f,y){y===void 0&&(y=!1);var _=this.children.find(f,y),b=_[0],v=_[1],w=[[this,f]];return b instanceof u?w.concat(b.path(v,y)):(b!=null&&w.push([b,v]),w)},u.prototype.removeChild=function(f){this.children.remove(f)},u.prototype.replace=function(f){f instanceof u&&f.moveChildren(this),a.prototype.replace.call(this,f)},u.prototype.split=function(f,y){if(y===void 0&&(y=!1),!y){if(f===0)return this;if(f===this.length())return this.next}var _=this.clone();return this.parent.insertBefore(_,this.next),this.children.forEachAt(f,this.length(),function(b,v,w){b=b.split(v,y),_.appendChild(b)}),_},u.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},u.prototype.update=function(f,y){var _=this,b=[],v=[];f.forEach(function(w){w.target===_.domNode&&w.type==="childList"&&(b.push.apply(b,w.addedNodes),v.push.apply(v,w.removedNodes))}),v.forEach(function(w){if(!(w.parentNode!=null&&w.tagName!=="IFRAME"&&document.body.compareDocumentPosition(w)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var T=d.find(w);T!=null&&(T.domNode.parentNode==null||T.domNode.parentNode===_.domNode)&&T.detach()}}),b.filter(function(w){return w.parentNode==_.domNode}).sort(function(w,T){return w===T?0:w.compareDocumentPosition(T)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(w){var T=null;w.nextSibling!=null&&(T=d.find(w.nextSibling));var x=p(w);(x.next!=T||x.next==null)&&(x.parent!=null&&x.parent.removeChild(_),_.insertBefore(x,T||void 0))})},u}(h.default);function p(a){var u=d.find(a);if(u==null)try{u=d.create(a)}catch(f){u=d.create(d.Scope.INLINE),[].slice.call(a.childNodes).forEach(function(y){u.domNode.appendChild(y)}),a.parentNode&&a.parentNode.replaceChild(u.domNode,a),u.attach()}return u}n.default=g},function(e,n,i){var l=this&&this.__extends||function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var y in f)f.hasOwnProperty(y)&&(u[y]=f[y])};return function(u,f){a(u,f);function y(){this.constructor=u}u.prototype=f===null?Object.create(f):(y.prototype=f.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var c=i(12),h=i(31),d=i(17),g=i(1),p=function(a){l(u,a);function u(f){var y=a.call(this,f)||this;return y.attributes=new h.default(y.domNode),y}return u.formats=function(f){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return f.tagName.toLowerCase()},u.prototype.format=function(f,y){var _=g.query(f);_ instanceof c.default?this.attributes.attribute(_,y):y&&_!=null&&(f!==this.statics.blotName||this.formats()[f]!==y)&&this.replaceWith(f,y)},u.prototype.formats=function(){var f=this.attributes.values(),y=this.statics.formats(this.domNode);return y!=null&&(f[this.statics.blotName]=y),f},u.prototype.replaceWith=function(f,y){var _=a.prototype.replaceWith.call(this,f,y);return this.attributes.copy(_),_},u.prototype.update=function(f,y){var _=this;a.prototype.update.call(this,f,y),f.some(function(b){return b.target===_.domNode&&b.type==="attributes"})&&this.attributes.build()},u.prototype.wrap=function(f,y){var _=a.prototype.wrap.call(this,f,y);return _ instanceof u&&_.statics.scope===this.statics.scope&&this.attributes.move(_),_},u}(d.default);n.default=p},function(e,n,i){var l=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,a){p.__proto__=a}||function(p,a){for(var u in a)a.hasOwnProperty(u)&&(p[u]=a[u])};return function(p,a){g(p,a);function u(){this.constructor=p}p.prototype=a===null?Object.create(a):(u.prototype=a.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var c=i(30),h=i(1),d=function(g){l(p,g);function p(){return g!==null&&g.apply(this,arguments)||this}return p.value=function(a){return!0},p.prototype.index=function(a,u){return this.domNode===a||this.domNode.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(u,1):-1},p.prototype.position=function(a,u){var f=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return a>0&&(f+=1),[this.parent.domNode,f]},p.prototype.value=function(){var a;return a={},a[this.statics.blotName]=this.statics.value(this.domNode)||!0,a},p.scope=h.Scope.INLINE_BLOT,p}(c.default);n.default=d},function(e,n,i){var l=i(11),c=i(3),h={attributes:{compose:function(g,p,a){typeof g!="object"&&(g={}),typeof p!="object"&&(p={});var u=c(!0,{},p);a||(u=Object.keys(u).reduce(function(y,_){return u[_]!=null&&(y[_]=u[_]),y},{}));for(var f in g)g[f]!==void 0&&p[f]===void 0&&(u[f]=g[f]);return Object.keys(u).length>0?u:void 0},diff:function(g,p){typeof g!="object"&&(g={}),typeof p!="object"&&(p={});var a=Object.keys(g).concat(Object.keys(p)).reduce(function(u,f){return l(g[f],p[f])||(u[f]=p[f]===void 0?null:p[f]),u},{});return Object.keys(a).length>0?a:void 0},transform:function(g,p,a){if(typeof g!="object")return p;if(typeof p=="object"){if(!a)return p;var u=Object.keys(p).reduce(function(f,y){return g[y]===void 0&&(f[y]=p[y]),f},{});return Object.keys(u).length>0?u:void 0}}},iterator:function(g){return new d(g)},length:function(g){return typeof g.delete=="number"?g.delete:typeof g.retain=="number"?g.retain:typeof g.insert=="string"?g.insert.length:1}};function d(g){this.ops=g,this.index=0,this.offset=0}d.prototype.hasNext=function(){return this.peekLength()<1/0},d.prototype.next=function(g){g||(g=1/0);var p=this.ops[this.index];if(p){var a=this.offset,u=h.length(p);if(g>=u-a?(g=u-a,this.index+=1,this.offset=0):this.offset+=g,typeof p.delete=="number")return{delete:g};var f={};return p.attributes&&(f.attributes=p.attributes),typeof p.retain=="number"?f.retain=g:typeof p.insert=="string"?f.insert=p.insert.substr(a,g):f.insert=p.insert,f}else return{retain:1/0}},d.prototype.peek=function(){return this.ops[this.index]},d.prototype.peekLength=function(){return this.ops[this.index]?h.length(this.ops[this.index])-this.offset:1/0},d.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},d.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var g=this.offset,p=this.index,a=this.next(),u=this.ops.slice(this.index);return this.offset=g,this.index=p,[a].concat(u)}else return[]},e.exports=h},function(e,n){var i=function(){function l(_,b){return b!=null&&_ instanceof b}var c;try{c=Map}catch(_){c=function(){}}var h;try{h=Set}catch(_){h=function(){}}var d;try{d=Promise}catch(_){d=function(){}}function g(_,b,v,w,T){typeof b=="object"&&(v=b.depth,w=b.prototype,T=b.includeNonEnumerable,b=b.circular);var x=[],S=[],C=typeof Buffer!="undefined";typeof b=="undefined"&&(b=!0),typeof v=="undefined"&&(v=1/0);function A(R,L){if(R===null)return null;if(L===0)return R;var M,k;if(typeof R!="object")return R;if(l(R,c))M=new c;else if(l(R,h))M=new h;else if(l(R,d))M=new d(function($,N){R.then(function(H){$(A(H,L-1))},function(H){N(A(H,L-1))})});else if(g.__isArray(R))M=[];else if(g.__isRegExp(R))M=new RegExp(R.source,y(R)),R.lastIndex&&(M.lastIndex=R.lastIndex);else if(g.__isDate(R))M=new Date(R.getTime());else{if(C&&Buffer.isBuffer(R))return Buffer.allocUnsafe?M=Buffer.allocUnsafe(R.length):M=new Buffer(R.length),R.copy(M),M;l(R,Error)?M=Object.create(R):typeof w=="undefined"?(k=Object.getPrototypeOf(R),M=Object.create(k)):(M=Object.create(w),k=w)}if(b){var P=x.indexOf(R);if(P!=-1)return S[P];x.push(R),S.push(M)}l(R,c)&&R.forEach(function($,N){var H=A(N,L-1),G=A($,L-1);M.set(H,G)}),l(R,h)&&R.forEach(function($){var N=A($,L-1);M.add(N)});for(var I in R){var j;k&&(j=Object.getOwnPropertyDescriptor(k,I)),!(j&&j.set==null)&&(M[I]=A(R[I],L-1))}if(Object.getOwnPropertySymbols)for(var W=Object.getOwnPropertySymbols(R),I=0;I<W.length;I++){var J=W[I],ee=Object.getOwnPropertyDescriptor(R,J);ee&&!ee.enumerable&&!T||(M[J]=A(R[J],L-1),ee.enumerable||Object.defineProperty(M,J,{enumerable:!1}))}if(T)for(var oe=Object.getOwnPropertyNames(R),I=0;I<oe.length;I++){var V=oe[I],ee=Object.getOwnPropertyDescriptor(R,V);ee&&ee.enumerable||(M[V]=A(R[V],L-1),Object.defineProperty(M,V,{enumerable:!1}))}return M}return A(_,v)}g.clonePrototype=function(b){if(b===null)return null;var v=function(){};return v.prototype=b,new v};function p(_){return Object.prototype.toString.call(_)}g.__objToStr=p;function a(_){return typeof _=="object"&&p(_)==="[object Date]"}g.__isDate=a;function u(_){return typeof _=="object"&&p(_)==="[object Array]"}g.__isArray=u;function f(_){return typeof _=="object"&&p(_)==="[object RegExp]"}g.__isRegExp=f;function y(_){var b="";return _.global&&(b+="g"),_.ignoreCase&&(b+="i"),_.multiline&&(b+="m"),b}return g.__getRegExpFlags=y,g}();typeof e=="object"&&e.exports&&(e.exports=i)},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function M(k,P){var I=[],j=!0,W=!1,J=void 0;try{for(var ee=k[Symbol.iterator](),oe;!(j=(oe=ee.next()).done)&&(I.push(oe.value),!(P&&I.length===P));j=!0);}catch(V){W=!0,J=V}finally{try{!j&&ee.return&&ee.return()}finally{if(W)throw J}}return I}return function(k,P){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return M(k,P);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function M(k,P){for(var I=0;I<P.length;I++){var j=P[I];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(k,j.key,j)}}return function(k,P,I){return P&&M(k.prototype,P),I&&M(k,I),k}}(),h=function M(k,P,I){k===null&&(k=Function.prototype);var j=Object.getOwnPropertyDescriptor(k,P);if(j===void 0){var W=Object.getPrototypeOf(k);return W===null?void 0:M(W,P,I)}else{if("value"in j)return j.value;var J=j.get;return J===void 0?void 0:J.call(I)}},d=i(0),g=x(d),p=i(8),a=x(p),u=i(4),f=x(u),y=i(16),_=x(y),b=i(13),v=x(b),w=i(25),T=x(w);function x(M){return M&&M.__esModule?M:{default:M}}function S(M,k){if(!(M instanceof k))throw new TypeError("Cannot call a class as a function")}function C(M,k){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:M}function A(M,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);M.prototype=Object.create(k&&k.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(M,k):M.__proto__=k)}function R(M){return M instanceof f.default||M instanceof u.BlockEmbed}var L=function(M){A(k,M);function k(P,I){S(this,k);var j=C(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,P));return j.emitter=I.emitter,Array.isArray(I.whitelist)&&(j.whitelist=I.whitelist.reduce(function(W,J){return W[J]=!0,W},{})),j.domNode.addEventListener("DOMNodeInserted",function(){}),j.optimize(),j.enable(),j}return c(k,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(I,j){var W=this.line(I),J=l(W,2),ee=J[0],oe=J[1],V=this.line(I+j),$=l(V,1),N=$[0];if(h(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"deleteAt",this).call(this,I,j),N!=null&&ee!==N&&oe>0){if(ee instanceof u.BlockEmbed||N instanceof u.BlockEmbed){this.optimize();return}if(ee instanceof v.default){var H=ee.newlineIndex(ee.length(),!0);if(H>-1&&(ee=ee.split(H+1),ee===N)){this.optimize();return}}else if(N instanceof v.default){var G=N.newlineIndex(0);G>-1&&N.split(G+1)}var ne=N.children.head instanceof _.default?null:N.children.head;ee.moveChildren(N,ne),ee.remove()}this.optimize()}},{key:"enable",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",I)}},{key:"formatAt",value:function(I,j,W,J){this.whitelist!=null&&!this.whitelist[W]||(h(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"formatAt",this).call(this,I,j,W,J),this.optimize())}},{key:"insertAt",value:function(I,j,W){if(!(W!=null&&this.whitelist!=null&&!this.whitelist[j])){if(I>=this.length())if(W==null||g.default.query(j,g.default.Scope.BLOCK)==null){var J=g.default.create(this.statics.defaultChild);this.appendChild(J),W==null&&j.endsWith(`
`)&&(j=j.slice(0,-1)),J.insertAt(0,j,W)}else{var ee=g.default.create(j,W);this.appendChild(ee)}else h(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertAt",this).call(this,I,j,W);this.optimize()}}},{key:"insertBefore",value:function(I,j){if(I.statics.scope===g.default.Scope.INLINE_BLOT){var W=g.default.create(this.statics.defaultChild);W.appendChild(I),I=W}h(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertBefore",this).call(this,I,j)}},{key:"leaf",value:function(I){return this.path(I).pop()||[null,-1]}},{key:"line",value:function(I){return I===this.length()?this.line(I-1):this.descendant(R,I)}},{key:"lines",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,W=function J(ee,oe,V){var $=[],N=V;return ee.children.forEachAt(oe,V,function(H,G,ne){R(H)?$.push(H):H instanceof g.default.Container&&($=$.concat(J(H,G,N))),N-=ne}),$};return W(this,I,j)}},{key:"optimize",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(h(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"optimize",this).call(this,I,j),I.length>0&&this.emitter.emit(a.default.events.SCROLL_OPTIMIZE,I,j))}},{key:"path",value:function(I){return h(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"path",this).call(this,I).slice(1)}},{key:"update",value:function(I){if(this.batch!==!0){var j=a.default.sources.USER;typeof I=="string"&&(j=I),Array.isArray(I)||(I=this.observer.takeRecords()),I.length>0&&this.emitter.emit(a.default.events.SCROLL_BEFORE_UPDATE,j,I),h(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"update",this).call(this,I.concat([])),I.length>0&&this.emitter.emit(a.default.events.SCROLL_UPDATE,j,I)}}}]),k}(g.default.Scroll);L.blotName="scroll",L.className="ql-editor",L.tagName="DIV",L.defaultChild="block",L.allowedChildren=[f.default,u.BlockEmbed,T.default],n.default=L},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},c=function(){function U(Q,ie){var ae=[],de=!0,we=!1,Pe=void 0;try{for(var Me=Q[Symbol.iterator](),De;!(de=(De=Me.next()).done)&&(ae.push(De.value),!(ie&&ae.length===ie));de=!0);}catch(ze){we=!0,Pe=ze}finally{try{!de&&Me.return&&Me.return()}finally{if(we)throw Pe}}return ae}return function(Q,ie){if(Array.isArray(Q))return Q;if(Symbol.iterator in Object(Q))return U(Q,ie);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function U(Q,ie){for(var ae=0;ae<ie.length;ae++){var de=ie[ae];de.enumerable=de.enumerable||!1,de.configurable=!0,"value"in de&&(de.writable=!0),Object.defineProperty(Q,de.key,de)}}return function(Q,ie,ae){return ie&&U(Q.prototype,ie),ae&&U(Q,ae),Q}}(),d=i(21),g=M(d),p=i(11),a=M(p),u=i(3),f=M(u),y=i(2),_=M(y),b=i(20),v=M(b),w=i(0),T=M(w),x=i(5),S=M(x),C=i(10),A=M(C),R=i(9),L=M(R);function M(U){return U&&U.__esModule?U:{default:U}}function k(U,Q,ie){return Q in U?Object.defineProperty(U,Q,{value:ie,enumerable:!0,configurable:!0,writable:!0}):U[Q]=ie,U}function P(U,Q){if(!(U instanceof Q))throw new TypeError("Cannot call a class as a function")}function I(U,Q){if(!U)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Q&&(typeof Q=="object"||typeof Q=="function")?Q:U}function j(U,Q){if(typeof Q!="function"&&Q!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Q);U.prototype=Object.create(Q&&Q.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}}),Q&&(Object.setPrototypeOf?Object.setPrototypeOf(U,Q):U.__proto__=Q)}var W=(0,A.default)("quill:keyboard"),J=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",ee=function(U){j(Q,U),h(Q,null,[{key:"match",value:function(ae,de){return de=X(de),["altKey","ctrlKey","metaKey","shiftKey"].some(function(we){return!!de[we]!==ae[we]&&de[we]!==null})?!1:de.key===(ae.which||ae.keyCode)}}]);function Q(ie,ae){P(this,Q);var de=I(this,(Q.__proto__||Object.getPrototypeOf(Q)).call(this,ie,ae));return de.bindings={},Object.keys(de.options.bindings).forEach(function(we){we==="list autofill"&&ie.scroll.whitelist!=null&&!ie.scroll.whitelist.list||de.options.bindings[we]&&de.addBinding(de.options.bindings[we])}),de.addBinding({key:Q.keys.ENTER,shiftKey:null},H),de.addBinding({key:Q.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(de.addBinding({key:Q.keys.BACKSPACE},{collapsed:!0},V),de.addBinding({key:Q.keys.DELETE},{collapsed:!0},$)):(de.addBinding({key:Q.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},V),de.addBinding({key:Q.keys.DELETE},{collapsed:!0,suffix:/^.?$/},$)),de.addBinding({key:Q.keys.BACKSPACE},{collapsed:!1},N),de.addBinding({key:Q.keys.DELETE},{collapsed:!1},N),de.addBinding({key:Q.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},V),de.listen(),de}return h(Q,[{key:"addBinding",value:function(ae){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Pe=X(ae);if(Pe==null||Pe.key==null)return W.warn("Attempted to add invalid keyboard binding",Pe);typeof de=="function"&&(de={handler:de}),typeof we=="function"&&(we={handler:we}),Pe=(0,f.default)(Pe,de,we),this.bindings[Pe.key]=this.bindings[Pe.key]||[],this.bindings[Pe.key].push(Pe)}},{key:"listen",value:function(){var ae=this;this.quill.root.addEventListener("keydown",function(de){if(!de.defaultPrevented){var we=de.which||de.keyCode,Pe=(ae.bindings[we]||[]).filter(function(z){return Q.match(de,z)});if(Pe.length!==0){var Me=ae.quill.getSelection();if(!(Me==null||!ae.quill.hasFocus())){var De=ae.quill.getLine(Me.index),ze=c(De,2),xt=ze[0],Je=ze[1],le=ae.quill.getLeaf(Me.index),he=c(le,2),_e=he[0],be=he[1],ve=Me.length===0?[_e,be]:ae.quill.getLeaf(Me.index+Me.length),Be=c(ve,2),Le=Be[0],Ee=Be[1],$e=_e instanceof T.default.Text?_e.value().slice(0,be):"",vt=Le instanceof T.default.Text?Le.value().slice(Ee):"",Ve={collapsed:Me.length===0,empty:Me.length===0&&xt.length()<=1,format:ae.quill.getFormat(Me),offset:Je,prefix:$e,suffix:vt},nn=Pe.some(function(z){if(z.collapsed!=null&&z.collapsed!==Ve.collapsed||z.empty!=null&&z.empty!==Ve.empty||z.offset!=null&&z.offset!==Ve.offset)return!1;if(Array.isArray(z.format)){if(z.format.every(function(ue){return Ve.format[ue]==null}))return!1}else if(l(z.format)==="object"&&!Object.keys(z.format).every(function(ue){return z.format[ue]===!0?Ve.format[ue]!=null:z.format[ue]===!1?Ve.format[ue]==null:(0,a.default)(z.format[ue],Ve.format[ue])}))return!1;return z.prefix!=null&&!z.prefix.test(Ve.prefix)||z.suffix!=null&&!z.suffix.test(Ve.suffix)?!1:z.handler.call(ae,Me,Ve)!==!0});nn&&de.preventDefault()}}}})}}]),Q}(L.default);ee.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},ee.DEFAULTS={bindings:{bold:ne("bold"),italic:ne("italic"),underline:ne("underline"),indent:{key:ee.keys.TAB,format:["blockquote","indent","list"],handler:function(Q,ie){if(ie.collapsed&&ie.offset!==0)return!0;this.quill.format("indent","+1",S.default.sources.USER)}},outdent:{key:ee.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(Q,ie){if(ie.collapsed&&ie.offset!==0)return!0;this.quill.format("indent","-1",S.default.sources.USER)}},"outdent backspace":{key:ee.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(Q,ie){ie.format.indent!=null?this.quill.format("indent","-1",S.default.sources.USER):ie.format.list!=null&&this.quill.format("list",!1,S.default.sources.USER)}},"indent code-block":G(!0),"outdent code-block":G(!1),"remove tab":{key:ee.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(Q){this.quill.deleteText(Q.index-1,1,S.default.sources.USER)}},tab:{key:ee.keys.TAB,handler:function(Q){this.quill.history.cutoff();var ie=new _.default().retain(Q.index).delete(Q.length).insert(" ");this.quill.updateContents(ie,S.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(Q.index+1,S.default.sources.SILENT)}},"list empty enter":{key:ee.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(Q,ie){this.quill.format("list",!1,S.default.sources.USER),ie.format.indent&&this.quill.format("indent",!1,S.default.sources.USER)}},"checklist enter":{key:ee.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(Q){var ie=this.quill.getLine(Q.index),ae=c(ie,2),de=ae[0],we=ae[1],Pe=(0,f.default)({},de.formats(),{list:"checked"}),Me=new _.default().retain(Q.index).insert(`
`,Pe).retain(de.length()-we-1).retain(1,{list:"unchecked"});this.quill.updateContents(Me,S.default.sources.USER),this.quill.setSelection(Q.index+1,S.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:ee.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(Q,ie){var ae=this.quill.getLine(Q.index),de=c(ae,2),we=de[0],Pe=de[1],Me=new _.default().retain(Q.index).insert(`
`,ie.format).retain(we.length()-Pe-1).retain(1,{header:null});this.quill.updateContents(Me,S.default.sources.USER),this.quill.setSelection(Q.index+1,S.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(Q,ie){var ae=ie.prefix.length,de=this.quill.getLine(Q.index),we=c(de,2),Pe=we[0],Me=we[1];if(Me>ae)return!0;var De=void 0;switch(ie.prefix.trim()){case"[]":case"[ ]":De="unchecked";break;case"[x]":De="checked";break;case"-":case"*":De="bullet";break;default:De="ordered"}this.quill.insertText(Q.index," ",S.default.sources.USER),this.quill.history.cutoff();var ze=new _.default().retain(Q.index-Me).delete(ae+1).retain(Pe.length()-2-Me).retain(1,{list:De});this.quill.updateContents(ze,S.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(Q.index-ae,S.default.sources.SILENT)}},"code exit":{key:ee.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(Q){var ie=this.quill.getLine(Q.index),ae=c(ie,2),de=ae[0],we=ae[1],Pe=new _.default().retain(Q.index+de.length()-we-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(Pe,S.default.sources.USER)}},"embed left":oe(ee.keys.LEFT,!1),"embed left shift":oe(ee.keys.LEFT,!0),"embed right":oe(ee.keys.RIGHT,!1),"embed right shift":oe(ee.keys.RIGHT,!0)}};function oe(U,Q){var ie,ae=U===ee.keys.LEFT?"prefix":"suffix";return ie={key:U,shiftKey:Q,altKey:null},k(ie,ae,/^$/),k(ie,"handler",function(we){var Pe=we.index;U===ee.keys.RIGHT&&(Pe+=we.length+1);var Me=this.quill.getLeaf(Pe),De=c(Me,1),ze=De[0];return ze instanceof T.default.Embed?(U===ee.keys.LEFT?Q?this.quill.setSelection(we.index-1,we.length+1,S.default.sources.USER):this.quill.setSelection(we.index-1,S.default.sources.USER):Q?this.quill.setSelection(we.index,we.length+1,S.default.sources.USER):this.quill.setSelection(we.index+we.length+1,S.default.sources.USER),!1):!0}),ie}function V(U,Q){if(!(U.index===0||this.quill.getLength()<=1)){var ie=this.quill.getLine(U.index),ae=c(ie,1),de=ae[0],we={};if(Q.offset===0){var Pe=this.quill.getLine(U.index-1),Me=c(Pe,1),De=Me[0];if(De!=null&&De.length()>1){var ze=de.formats(),xt=this.quill.getFormat(U.index-1,1);we=v.default.attributes.diff(ze,xt)||{}}}var Je=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(Q.prefix)?2:1;this.quill.deleteText(U.index-Je,Je,S.default.sources.USER),Object.keys(we).length>0&&this.quill.formatLine(U.index-Je,Je,we,S.default.sources.USER),this.quill.focus()}}function $(U,Q){var ie=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(Q.suffix)?2:1;if(!(U.index>=this.quill.getLength()-ie)){var ae={},de=0,we=this.quill.getLine(U.index),Pe=c(we,1),Me=Pe[0];if(Q.offset>=Me.length()-1){var De=this.quill.getLine(U.index+1),ze=c(De,1),xt=ze[0];if(xt){var Je=Me.formats(),le=this.quill.getFormat(U.index,1);ae=v.default.attributes.diff(Je,le)||{},de=xt.length()}}this.quill.deleteText(U.index,ie,S.default.sources.USER),Object.keys(ae).length>0&&this.quill.formatLine(U.index+de-1,ie,ae,S.default.sources.USER)}}function N(U){var Q=this.quill.getLines(U),ie={};if(Q.length>1){var ae=Q[0].formats(),de=Q[Q.length-1].formats();ie=v.default.attributes.diff(de,ae)||{}}this.quill.deleteText(U,S.default.sources.USER),Object.keys(ie).length>0&&this.quill.formatLine(U.index,1,ie,S.default.sources.USER),this.quill.setSelection(U.index,S.default.sources.SILENT),this.quill.focus()}function H(U,Q){var ie=this;U.length>0&&this.quill.scroll.deleteAt(U.index,U.length);var ae=Object.keys(Q.format).reduce(function(de,we){return T.default.query(we,T.default.Scope.BLOCK)&&!Array.isArray(Q.format[we])&&(de[we]=Q.format[we]),de},{});this.quill.insertText(U.index,`
`,ae,S.default.sources.USER),this.quill.setSelection(U.index+1,S.default.sources.SILENT),this.quill.focus(),Object.keys(Q.format).forEach(function(de){ae[de]==null&&(Array.isArray(Q.format[de])||de!=="link"&&ie.quill.format(de,Q.format[de],S.default.sources.USER))})}function G(U){return{key:ee.keys.TAB,shiftKey:!U,format:{"code-block":!0},handler:function(ie){var ae=T.default.query("code-block"),de=ie.index,we=ie.length,Pe=this.quill.scroll.descendant(ae,de),Me=c(Pe,2),De=Me[0],ze=Me[1];if(De!=null){var xt=this.quill.getIndex(De),Je=De.newlineIndex(ze,!0)+1,le=De.newlineIndex(xt+ze+we),he=De.domNode.textContent.slice(Je,le).split(`
`);ze=0,he.forEach(function(_e,be){U?(De.insertAt(Je+ze,ae.TAB),ze+=ae.TAB.length,be===0?de+=ae.TAB.length:we+=ae.TAB.length):_e.startsWith(ae.TAB)&&(De.deleteAt(Je+ze,ae.TAB.length),ze-=ae.TAB.length,be===0?de-=ae.TAB.length:we-=ae.TAB.length),ze+=_e.length+1}),this.quill.update(S.default.sources.USER),this.quill.setSelection(de,we,S.default.sources.SILENT)}}}}function ne(U){return{key:U[0].toUpperCase(),shortKey:!0,handler:function(ie,ae){this.quill.format(U,!ae.format[U],S.default.sources.USER)}}}function X(U){if(typeof U=="string"||typeof U=="number")return X({key:U});if((typeof U=="undefined"?"undefined":l(U))==="object"&&(U=(0,g.default)(U,!1)),typeof U.key=="string")if(ee.keys[U.key.toUpperCase()]!=null)U.key=ee.keys[U.key.toUpperCase()];else if(U.key.length===1)U.key=U.key.toUpperCase().charCodeAt(0);else return null;return U.shortKey&&(U[J]=U.shortKey,delete U.shortKey),U}n.default=ee,n.SHORTKEY=J},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function v(w,T){var x=[],S=!0,C=!1,A=void 0;try{for(var R=w[Symbol.iterator](),L;!(S=(L=R.next()).done)&&(x.push(L.value),!(T&&x.length===T));S=!0);}catch(M){C=!0,A=M}finally{try{!S&&R.return&&R.return()}finally{if(C)throw A}}return x}return function(w,T){if(Array.isArray(w))return w;if(Symbol.iterator in Object(w))return v(w,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function v(w,T,x){w===null&&(w=Function.prototype);var S=Object.getOwnPropertyDescriptor(w,T);if(S===void 0){var C=Object.getPrototypeOf(w);return C===null?void 0:v(C,T,x)}else{if("value"in S)return S.value;var A=S.get;return A===void 0?void 0:A.call(x)}},h=function(){function v(w,T){for(var x=0;x<T.length;x++){var S=T[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(w,S.key,S)}}return function(w,T,x){return T&&v(w.prototype,T),x&&v(w,x),w}}(),d=i(0),g=u(d),p=i(7),a=u(p);function u(v){return v&&v.__esModule?v:{default:v}}function f(v,w){if(!(v instanceof w))throw new TypeError("Cannot call a class as a function")}function y(v,w){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:v}function _(v,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);v.prototype=Object.create(w&&w.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(v,w):v.__proto__=w)}var b=function(v){_(w,v),h(w,null,[{key:"value",value:function(){}}]);function w(T,x){f(this,w);var S=y(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,T));return S.selection=x,S.textNode=document.createTextNode(w.CONTENTS),S.domNode.appendChild(S.textNode),S._length=0,S}return h(w,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(x,S){if(this._length!==0)return c(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"format",this).call(this,x,S);for(var C=this,A=0;C!=null&&C.statics.scope!==g.default.Scope.BLOCK_BLOT;)A+=C.offset(C.parent),C=C.parent;C!=null&&(this._length=w.CONTENTS.length,C.optimize(),C.formatAt(A,w.CONTENTS.length,x,S),this._length=0)}},{key:"index",value:function(x,S){return x===this.textNode?0:c(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"index",this).call(this,x,S)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){c(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var x=this.textNode,S=this.selection.getNativeRange(),C=void 0,A=void 0,R=void 0;if(S!=null&&S.start.node===x&&S.end.node===x){var L=[x,S.start.offset,S.end.offset];C=L[0],A=L[1],R=L[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==w.CONTENTS){var M=this.textNode.data.split(w.CONTENTS).join("");this.next instanceof a.default?(C=this.next.domNode,this.next.insertAt(0,M),this.textNode.data=w.CONTENTS):(this.textNode.data=M,this.parent.insertBefore(g.default.create(this.textNode),this),this.textNode=document.createTextNode(w.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),A!=null){var k=[A,R].map(function(I){return Math.max(0,Math.min(C.data.length,I-1))}),P=l(k,2);return A=P[0],R=P[1],{startNode:C,startOffset:A,endNode:C,endOffset:R}}}}},{key:"update",value:function(x,S){var C=this;if(x.some(function(R){return R.type==="characterData"&&R.target===C.textNode})){var A=this.restore();A&&(S.range=A)}}},{key:"value",value:function(){return""}}]),w}(g.default.Embed);b.blotName="cursor",b.className="ql-cursor",b.tagName="span",b.CONTENTS="\uFEFF",n.default=b},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=i(0),c=g(l),h=i(4),d=g(h);function g(y){return y&&y.__esModule?y:{default:y}}function p(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function a(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function u(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var f=function(y){u(_,y);function _(){return p(this,_),a(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return _}(c.default.Container);f.allowedChildren=[d.default,h.BlockEmbed,f],n.default=f},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var l=function(){function b(v,w){for(var T=0;T<w.length;T++){var x=w[T];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,x.key,x)}}return function(v,w,T){return w&&b(v.prototype,w),T&&b(v,T),v}}(),c=function b(v,w,T){v===null&&(v=Function.prototype);var x=Object.getOwnPropertyDescriptor(v,w);if(x===void 0){var S=Object.getPrototypeOf(v);return S===null?void 0:b(S,w,T)}else{if("value"in x)return x.value;var C=x.get;return C===void 0?void 0:C.call(T)}},h=i(0),d=g(h);function g(b){return b&&b.__esModule?b:{default:b}}function p(b,v){if(!(b instanceof v))throw new TypeError("Cannot call a class as a function")}function a(b,v){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:b}function u(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);b.prototype=Object.create(v&&v.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(b,v):b.__proto__=v)}var f=function(b){u(v,b);function v(){return p(this,v),a(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return l(v,[{key:"value",value:function(T){var x=c(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"value",this).call(this,T);return x.startsWith("rgb(")?(x=x.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+x.split(",").map(function(S){return("00"+parseInt(S).toString(16)).slice(-2)}).join("")):x}}]),v}(d.default.Attributor.Style),y=new d.default.Attributor.Class("color","ql-color",{scope:d.default.Scope.INLINE}),_=new f("color","color",{scope:d.default.Scope.INLINE});n.ColorAttributor=f,n.ColorClass=y,n.ColorStyle=_},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var l=function(){function _(b,v){for(var w=0;w<v.length;w++){var T=v[w];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(b,T.key,T)}}return function(b,v,w){return v&&_(b.prototype,v),w&&_(b,w),b}}(),c=function _(b,v,w){b===null&&(b=Function.prototype);var T=Object.getOwnPropertyDescriptor(b,v);if(T===void 0){var x=Object.getPrototypeOf(b);return x===null?void 0:_(x,v,w)}else{if("value"in T)return T.value;var S=T.get;return S===void 0?void 0:S.call(w)}},h=i(6),d=g(h);function g(_){return _&&_.__esModule?_:{default:_}}function p(_,b){if(!(_ instanceof b))throw new TypeError("Cannot call a class as a function")}function a(_,b){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:_}function u(_,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);_.prototype=Object.create(b&&b.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(_,b):_.__proto__=b)}var f=function(_){u(b,_);function b(){return p(this,b),a(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return l(b,[{key:"format",value:function(w,T){if(w!==this.statics.blotName||!T)return c(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,w,T);T=this.constructor.sanitize(T),this.domNode.setAttribute("href",T)}}],[{key:"create",value:function(w){var T=c(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,w);return w=this.sanitize(w),T.setAttribute("href",w),T.setAttribute("rel","noopener noreferrer"),T.setAttribute("target","_blank"),T}},{key:"formats",value:function(w){return w.getAttribute("href")}},{key:"sanitize",value:function(w){return y(w,this.PROTOCOL_WHITELIST)?w:this.SANITIZED_URL}}]),b}(d.default);f.blotName="link",f.tagName="A",f.SANITIZED_URL="about:blank",f.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function y(_,b){var v=document.createElement("a");v.href=_;var w=v.href.slice(0,v.href.indexOf(":"));return b.indexOf(w)>-1}n.default=f,n.sanitize=y},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},c=function(){function b(v,w){for(var T=0;T<w.length;T++){var x=w[T];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,x.key,x)}}return function(v,w,T){return w&&b(v.prototype,w),T&&b(v,T),v}}(),h=i(23),d=a(h),g=i(107),p=a(g);function a(b){return b&&b.__esModule?b:{default:b}}function u(b,v){if(!(b instanceof v))throw new TypeError("Cannot call a class as a function")}var f=0;function y(b,v){b.setAttribute(v,b.getAttribute(v)!=="true")}var _=function(){function b(v){var w=this;u(this,b),this.select=v,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){w.togglePicker()}),this.label.addEventListener("keydown",function(T){switch(T.keyCode){case d.default.keys.ENTER:w.togglePicker();break;case d.default.keys.ESCAPE:w.escape(),T.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return c(b,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),y(this.label,"aria-expanded"),y(this.options,"aria-hidden")}},{key:"buildItem",value:function(w){var T=this,x=document.createElement("span");return x.tabIndex="0",x.setAttribute("role","button"),x.classList.add("ql-picker-item"),w.hasAttribute("value")&&x.setAttribute("data-value",w.getAttribute("value")),w.textContent&&x.setAttribute("data-label",w.textContent),x.addEventListener("click",function(){T.selectItem(x,!0)}),x.addEventListener("keydown",function(S){switch(S.keyCode){case d.default.keys.ENTER:T.selectItem(x,!0),S.preventDefault();break;case d.default.keys.ESCAPE:T.escape(),S.preventDefault();break}}),x}},{key:"buildLabel",value:function(){var w=document.createElement("span");return w.classList.add("ql-picker-label"),w.innerHTML=p.default,w.tabIndex="0",w.setAttribute("role","button"),w.setAttribute("aria-expanded","false"),this.container.appendChild(w),w}},{key:"buildOptions",value:function(){var w=this,T=document.createElement("span");T.classList.add("ql-picker-options"),T.setAttribute("aria-hidden","true"),T.tabIndex="-1",T.id="ql-picker-options-"+f,f+=1,this.label.setAttribute("aria-controls",T.id),this.options=T,[].slice.call(this.select.options).forEach(function(x){var S=w.buildItem(x);T.appendChild(S),x.selected===!0&&w.selectItem(S)}),this.container.appendChild(T)}},{key:"buildPicker",value:function(){var w=this;[].slice.call(this.select.attributes).forEach(function(T){w.container.setAttribute(T.name,T.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var w=this;this.close(),setTimeout(function(){return w.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(w){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,x=this.container.querySelector(".ql-selected");if(w!==x&&(x!=null&&x.classList.remove("ql-selected"),w!=null&&(w.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(w.parentNode.children,w),w.hasAttribute("data-value")?this.label.setAttribute("data-value",w.getAttribute("data-value")):this.label.removeAttribute("data-value"),w.hasAttribute("data-label")?this.label.setAttribute("data-label",w.getAttribute("data-label")):this.label.removeAttribute("data-label"),T))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event=="undefined"?"undefined":l(Event))==="object"){var S=document.createEvent("Event");S.initEvent("change",!0,!0),this.select.dispatchEvent(S)}this.close()}}},{key:"update",value:function(){var w=void 0;if(this.select.selectedIndex>-1){var T=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];w=this.select.options[this.select.selectedIndex],this.selectItem(T)}else this.selectItem(null);var x=w!=null&&w!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",x)}}]),b}();n.default=_},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=i(0),c=W(l),h=i(5),d=W(h),g=i(4),p=W(g),a=i(16),u=W(a),f=i(25),y=W(f),_=i(24),b=W(_),v=i(35),w=W(v),T=i(6),x=W(T),S=i(22),C=W(S),A=i(7),R=W(A),L=i(55),M=W(L),k=i(42),P=W(k),I=i(23),j=W(I);function W(J){return J&&J.__esModule?J:{default:J}}d.default.register({"blots/block":p.default,"blots/block/embed":g.BlockEmbed,"blots/break":u.default,"blots/container":y.default,"blots/cursor":b.default,"blots/embed":w.default,"blots/inline":x.default,"blots/scroll":C.default,"blots/text":R.default,"modules/clipboard":M.default,"modules/history":P.default,"modules/keyboard":j.default}),c.default.register(p.default,u.default,b.default,x.default,C.default,R.default),n.default=d.default},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=i(1),c=function(){function h(d){this.domNode=d,this.domNode[l.DATA_KEY]={blot:this}}return Object.defineProperty(h.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),h.create=function(d){if(this.tagName==null)throw new l.ParchmentError("Blot definition missing tagName");var g;return Array.isArray(this.tagName)?(typeof d=="string"&&(d=d.toUpperCase(),parseInt(d).toString()===d&&(d=parseInt(d))),typeof d=="number"?g=document.createElement(this.tagName[d-1]):this.tagName.indexOf(d)>-1?g=document.createElement(d):g=document.createElement(this.tagName[0])):g=document.createElement(this.tagName),this.className&&g.classList.add(this.className),g},h.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},h.prototype.clone=function(){var d=this.domNode.cloneNode(!1);return l.create(d)},h.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[l.DATA_KEY]},h.prototype.deleteAt=function(d,g){var p=this.isolate(d,g);p.remove()},h.prototype.formatAt=function(d,g,p,a){var u=this.isolate(d,g);if(l.query(p,l.Scope.BLOT)!=null&&a)u.wrap(p,a);else if(l.query(p,l.Scope.ATTRIBUTE)!=null){var f=l.create(this.statics.scope);u.wrap(f),f.format(p,a)}},h.prototype.insertAt=function(d,g,p){var a=p==null?l.create("text",g):l.create(g,p),u=this.split(d);this.parent.insertBefore(a,u)},h.prototype.insertInto=function(d,g){g===void 0&&(g=null),this.parent!=null&&this.parent.children.remove(this);var p=null;d.children.insertBefore(this,g),g!=null&&(p=g.domNode),(this.domNode.parentNode!=d.domNode||this.domNode.nextSibling!=p)&&d.domNode.insertBefore(this.domNode,p),this.parent=d,this.attach()},h.prototype.isolate=function(d,g){var p=this.split(d);return p.split(g),p},h.prototype.length=function(){return 1},h.prototype.offset=function(d){return d===void 0&&(d=this.parent),this.parent==null||this==d?0:this.parent.children.offset(this)+this.parent.offset(d)},h.prototype.optimize=function(d){this.domNode[l.DATA_KEY]!=null&&delete this.domNode[l.DATA_KEY].mutations},h.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},h.prototype.replace=function(d){d.parent!=null&&(d.parent.insertBefore(this,d.next),d.remove())},h.prototype.replaceWith=function(d,g){var p=typeof d=="string"?l.create(d,g):d;return p.replace(this),p},h.prototype.split=function(d,g){return d===0?this:this.next},h.prototype.update=function(d,g){},h.prototype.wrap=function(d,g){var p=typeof d=="string"?l.create(d,g):d;return this.parent!=null&&this.parent.insertBefore(p,this.next),p.appendChild(this),p},h.blotName="abstract",h}();n.default=c},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=i(12),c=i(32),h=i(33),d=i(1),g=function(){function p(a){this.attributes={},this.domNode=a,this.build()}return p.prototype.attribute=function(a,u){u?a.add(this.domNode,u)&&(a.value(this.domNode)!=null?this.attributes[a.attrName]=a:delete this.attributes[a.attrName]):(a.remove(this.domNode),delete this.attributes[a.attrName])},p.prototype.build=function(){var a=this;this.attributes={};var u=l.default.keys(this.domNode),f=c.default.keys(this.domNode),y=h.default.keys(this.domNode);u.concat(f).concat(y).forEach(function(_){var b=d.query(_,d.Scope.ATTRIBUTE);b instanceof l.default&&(a.attributes[b.attrName]=b)})},p.prototype.copy=function(a){var u=this;Object.keys(this.attributes).forEach(function(f){var y=u.attributes[f].value(u.domNode);a.format(f,y)})},p.prototype.move=function(a){var u=this;this.copy(a),Object.keys(this.attributes).forEach(function(f){u.attributes[f].remove(u.domNode)}),this.attributes={}},p.prototype.values=function(){var a=this;return Object.keys(this.attributes).reduce(function(u,f){return u[f]=a.attributes[f].value(a.domNode),u},{})},p}();n.default=g},function(e,n,i){var l=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,a){p.__proto__=a}||function(p,a){for(var u in a)a.hasOwnProperty(u)&&(p[u]=a[u])};return function(p,a){g(p,a);function u(){this.constructor=p}p.prototype=a===null?Object.create(a):(u.prototype=a.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var c=i(12);function h(g,p){var a=g.getAttribute("class")||"";return a.split(/\s+/).filter(function(u){return u.indexOf(p+"-")===0})}var d=function(g){l(p,g);function p(){return g!==null&&g.apply(this,arguments)||this}return p.keys=function(a){return(a.getAttribute("class")||"").split(/\s+/).map(function(u){return u.split("-").slice(0,-1).join("-")})},p.prototype.add=function(a,u){return this.canAdd(a,u)?(this.remove(a),a.classList.add(this.keyName+"-"+u),!0):!1},p.prototype.remove=function(a){var u=h(a,this.keyName);u.forEach(function(f){a.classList.remove(f)}),a.classList.length===0&&a.removeAttribute("class")},p.prototype.value=function(a){var u=h(a,this.keyName)[0]||"",f=u.slice(this.keyName.length+1);return this.canAdd(a,f)?f:""},p}(c.default);n.default=d},function(e,n,i){var l=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,a){p.__proto__=a}||function(p,a){for(var u in a)a.hasOwnProperty(u)&&(p[u]=a[u])};return function(p,a){g(p,a);function u(){this.constructor=p}p.prototype=a===null?Object.create(a):(u.prototype=a.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var c=i(12);function h(g){var p=g.split("-"),a=p.slice(1).map(function(u){return u[0].toUpperCase()+u.slice(1)}).join("");return p[0]+a}var d=function(g){l(p,g);function p(){return g!==null&&g.apply(this,arguments)||this}return p.keys=function(a){return(a.getAttribute("style")||"").split(";").map(function(u){var f=u.split(":");return f[0].trim()})},p.prototype.add=function(a,u){return this.canAdd(a,u)?(a.style[h(this.keyName)]=u,!0):!1},p.prototype.remove=function(a){a.style[h(this.keyName)]="",a.getAttribute("style")||a.removeAttribute("style")},p.prototype.value=function(a){var u=a.style[h(this.keyName)];return this.canAdd(a,u)?u:""},p}(c.default);n.default=d},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function d(g,p){for(var a=0;a<p.length;a++){var u=p[a];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(g,u.key,u)}}return function(g,p,a){return p&&d(g.prototype,p),a&&d(g,a),g}}();function c(d,g){if(!(d instanceof g))throw new TypeError("Cannot call a class as a function")}var h=function(){function d(g,p){c(this,d),this.quill=g,this.options=p,this.modules={}}return l(d,[{key:"init",value:function(){var p=this;Object.keys(this.options.modules).forEach(function(a){p.modules[a]==null&&p.addModule(a)})}},{key:"addModule",value:function(p){var a=this.quill.constructor.import("modules/"+p);return this.modules[p]=new a(this.quill,this.options.modules[p]||{}),this.modules[p]}}]),d}();h.DEFAULTS={modules:{}},h.themes={default:h},n.default=h},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function v(w,T){for(var x=0;x<T.length;x++){var S=T[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(w,S.key,S)}}return function(w,T,x){return T&&v(w.prototype,T),x&&v(w,x),w}}(),c=function v(w,T,x){w===null&&(w=Function.prototype);var S=Object.getOwnPropertyDescriptor(w,T);if(S===void 0){var C=Object.getPrototypeOf(w);return C===null?void 0:v(C,T,x)}else{if("value"in S)return S.value;var A=S.get;return A===void 0?void 0:A.call(x)}},h=i(0),d=a(h),g=i(7),p=a(g);function a(v){return v&&v.__esModule?v:{default:v}}function u(v,w){if(!(v instanceof w))throw new TypeError("Cannot call a class as a function")}function f(v,w){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:v}function y(v,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);v.prototype=Object.create(w&&w.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(v,w):v.__proto__=w)}var _="\uFEFF",b=function(v){y(w,v);function w(T){u(this,w);var x=f(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,T));return x.contentNode=document.createElement("span"),x.contentNode.setAttribute("contenteditable",!1),[].slice.call(x.domNode.childNodes).forEach(function(S){x.contentNode.appendChild(S)}),x.leftGuard=document.createTextNode(_),x.rightGuard=document.createTextNode(_),x.domNode.appendChild(x.leftGuard),x.domNode.appendChild(x.contentNode),x.domNode.appendChild(x.rightGuard),x}return l(w,[{key:"index",value:function(x,S){return x===this.leftGuard?0:x===this.rightGuard?1:c(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"index",this).call(this,x,S)}},{key:"restore",value:function(x){var S=void 0,C=void 0,A=x.data.split(_).join("");if(x===this.leftGuard)if(this.prev instanceof p.default){var R=this.prev.length();this.prev.insertAt(R,A),S={startNode:this.prev.domNode,startOffset:R+A.length}}else C=document.createTextNode(A),this.parent.insertBefore(d.default.create(C),this),S={startNode:C,startOffset:A.length};else x===this.rightGuard&&(this.next instanceof p.default?(this.next.insertAt(0,A),S={startNode:this.next.domNode,startOffset:A.length}):(C=document.createTextNode(A),this.parent.insertBefore(d.default.create(C),this.next),S={startNode:C,startOffset:A.length}));return x.data=_,S}},{key:"update",value:function(x,S){var C=this;x.forEach(function(A){if(A.type==="characterData"&&(A.target===C.leftGuard||A.target===C.rightGuard)){var R=C.restore(A.target);R&&(S.range=R)}})}}]),w}(d.default.Embed);n.default=b},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var l=i(0),c=h(l);function h(u){return u&&u.__esModule?u:{default:u}}var d={scope:c.default.Scope.BLOCK,whitelist:["right","center","justify"]},g=new c.default.Attributor.Attribute("align","align",d),p=new c.default.Attributor.Class("align","ql-align",d),a=new c.default.Attributor.Style("align","text-align",d);n.AlignAttribute=g,n.AlignClass=p,n.AlignStyle=a},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var l=i(0),c=d(l),h=i(26);function d(a){return a&&a.__esModule?a:{default:a}}var g=new c.default.Attributor.Class("background","ql-bg",{scope:c.default.Scope.INLINE}),p=new h.ColorAttributor("background","background-color",{scope:c.default.Scope.INLINE});n.BackgroundClass=g,n.BackgroundStyle=p},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var l=i(0),c=h(l);function h(u){return u&&u.__esModule?u:{default:u}}var d={scope:c.default.Scope.BLOCK,whitelist:["rtl"]},g=new c.default.Attributor.Attribute("direction","dir",d),p=new c.default.Attributor.Class("direction","ql-direction",d),a=new c.default.Attributor.Style("direction","direction",d);n.DirectionAttribute=g,n.DirectionClass=p,n.DirectionStyle=a},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var l=function(){function v(w,T){for(var x=0;x<T.length;x++){var S=T[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(w,S.key,S)}}return function(w,T,x){return T&&v(w.prototype,T),x&&v(w,x),w}}(),c=function v(w,T,x){w===null&&(w=Function.prototype);var S=Object.getOwnPropertyDescriptor(w,T);if(S===void 0){var C=Object.getPrototypeOf(w);return C===null?void 0:v(C,T,x)}else{if("value"in S)return S.value;var A=S.get;return A===void 0?void 0:A.call(x)}},h=i(0),d=g(h);function g(v){return v&&v.__esModule?v:{default:v}}function p(v,w){if(!(v instanceof w))throw new TypeError("Cannot call a class as a function")}function a(v,w){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:v}function u(v,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);v.prototype=Object.create(w&&w.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(v,w):v.__proto__=w)}var f={scope:d.default.Scope.INLINE,whitelist:["serif","monospace"]},y=new d.default.Attributor.Class("font","ql-font",f),_=function(v){u(w,v);function w(){return p(this,w),a(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return l(w,[{key:"value",value:function(x){return c(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"value",this).call(this,x).replace(/["']/g,"")}}]),w}(d.default.Attributor.Style),b=new _("font","font-family",f);n.FontStyle=b,n.FontClass=y},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var l=i(0),c=h(l);function h(p){return p&&p.__esModule?p:{default:p}}var d=new c.default.Attributor.Class("size","ql-size",{scope:c.default.Scope.INLINE,whitelist:["small","large","huge"]}),g=new c.default.Attributor.Style("size","font-size",{scope:c.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=d,n.SizeStyle=g},function(e,n,i){e.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var l=function(){function T(x,S){for(var C=0;C<S.length;C++){var A=S[C];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(x,A.key,A)}}return function(x,S,C){return S&&T(x.prototype,S),C&&T(x,C),x}}(),c=i(0),h=u(c),d=i(5),g=u(d),p=i(9),a=u(p);function u(T){return T&&T.__esModule?T:{default:T}}function f(T,x){if(!(T instanceof x))throw new TypeError("Cannot call a class as a function")}function y(T,x){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:T}function _(T,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);T.prototype=Object.create(x&&x.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(T,x):T.__proto__=x)}var b=function(T){_(x,T);function x(S,C){f(this,x);var A=y(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,S,C));return A.lastRecorded=0,A.ignoreChange=!1,A.clear(),A.quill.on(g.default.events.EDITOR_CHANGE,function(R,L,M,k){R!==g.default.events.TEXT_CHANGE||A.ignoreChange||(!A.options.userOnly||k===g.default.sources.USER?A.record(L,M):A.transform(L))}),A.quill.keyboard.addBinding({key:"Z",shortKey:!0},A.undo.bind(A)),A.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},A.redo.bind(A)),/Win/i.test(navigator.platform)&&A.quill.keyboard.addBinding({key:"Y",shortKey:!0},A.redo.bind(A)),A}return l(x,[{key:"change",value:function(C,A){if(this.stack[C].length!==0){var R=this.stack[C].pop();this.stack[A].push(R),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(R[C],g.default.sources.USER),this.ignoreChange=!1;var L=w(R[C]);this.quill.setSelection(L)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(C,A){if(C.ops.length!==0){this.stack.redo=[];var R=this.quill.getContents().diff(A),L=Date.now();if(this.lastRecorded+this.options.delay>L&&this.stack.undo.length>0){var M=this.stack.undo.pop();R=R.compose(M.undo),C=M.redo.compose(C)}else this.lastRecorded=L;this.stack.undo.push({redo:C,undo:R}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(C){this.stack.undo.forEach(function(A){A.undo=C.transform(A.undo,!0),A.redo=C.transform(A.redo,!0)}),this.stack.redo.forEach(function(A){A.undo=C.transform(A.undo,!0),A.redo=C.transform(A.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),x}(a.default);b.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function v(T){var x=T.ops[T.ops.length-1];return x==null?!1:x.insert!=null?typeof x.insert=="string"&&x.insert.endsWith(`
`):x.attributes!=null?Object.keys(x.attributes).some(function(S){return h.default.query(S,h.default.Scope.BLOCK)!=null}):!1}function w(T){var x=T.reduce(function(C,A){return C+=A.delete||0,C},0),S=T.length()-x;return v(T)&&(S-=1),S}n.default=b,n.getLastChangeIndex=w},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var l=function(){function H(G,ne){for(var X=0;X<ne.length;X++){var U=ne[X];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(G,U.key,U)}}return function(G,ne,X){return ne&&H(G.prototype,ne),X&&H(G,X),G}}(),c=function H(G,ne,X){G===null&&(G=Function.prototype);var U=Object.getOwnPropertyDescriptor(G,ne);if(U===void 0){var Q=Object.getPrototypeOf(G);return Q===null?void 0:H(Q,ne,X)}else{if("value"in U)return U.value;var ie=U.get;return ie===void 0?void 0:ie.call(X)}},h=i(3),d=L(h),g=i(2),p=L(g),a=i(8),u=L(a),f=i(23),y=L(f),_=i(34),b=L(_),v=i(59),w=L(v),T=i(60),x=L(T),S=i(28),C=L(S),A=i(61),R=L(A);function L(H){return H&&H.__esModule?H:{default:H}}function M(H,G){if(!(H instanceof G))throw new TypeError("Cannot call a class as a function")}function k(H,G){if(!H)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return G&&(typeof G=="object"||typeof G=="function")?G:H}function P(H,G){if(typeof G!="function"&&G!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof G);H.prototype=Object.create(G&&G.prototype,{constructor:{value:H,enumerable:!1,writable:!0,configurable:!0}}),G&&(Object.setPrototypeOf?Object.setPrototypeOf(H,G):H.__proto__=G)}var I=[!1,"center","right","justify"],j=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],W=[!1,"serif","monospace"],J=["1","2","3",!1],ee=["small",!1,"large","huge"],oe=function(H){P(G,H);function G(ne,X){M(this,G);var U=k(this,(G.__proto__||Object.getPrototypeOf(G)).call(this,ne,X)),Q=function ie(ae){if(!document.body.contains(ne.root))return document.body.removeEventListener("click",ie);U.tooltip!=null&&!U.tooltip.root.contains(ae.target)&&document.activeElement!==U.tooltip.textbox&&!U.quill.hasFocus()&&U.tooltip.hide(),U.pickers!=null&&U.pickers.forEach(function(de){de.container.contains(ae.target)||de.close()})};return ne.emitter.listenDOM("click",document.body,Q),U}return l(G,[{key:"addModule",value:function(X){var U=c(G.prototype.__proto__||Object.getPrototypeOf(G.prototype),"addModule",this).call(this,X);return X==="toolbar"&&this.extendToolbar(U),U}},{key:"buildButtons",value:function(X,U){X.forEach(function(Q){var ie=Q.getAttribute("class")||"";ie.split(/\s+/).forEach(function(ae){if(ae.startsWith("ql-")&&(ae=ae.slice(3),U[ae]!=null))if(ae==="direction")Q.innerHTML=U[ae][""]+U[ae].rtl;else if(typeof U[ae]=="string")Q.innerHTML=U[ae];else{var de=Q.value||"";de!=null&&U[ae][de]&&(Q.innerHTML=U[ae][de])}})})}},{key:"buildPickers",value:function(X,U){var Q=this;this.pickers=X.map(function(ae){if(ae.classList.contains("ql-align"))return ae.querySelector("option")==null&&N(ae,I),new x.default(ae,U.align);if(ae.classList.contains("ql-background")||ae.classList.contains("ql-color")){var de=ae.classList.contains("ql-background")?"background":"color";return ae.querySelector("option")==null&&N(ae,j,de==="background"?"#ffffff":"#000000"),new w.default(ae,U[de])}else return ae.querySelector("option")==null&&(ae.classList.contains("ql-font")?N(ae,W):ae.classList.contains("ql-header")?N(ae,J):ae.classList.contains("ql-size")&&N(ae,ee)),new C.default(ae)});var ie=function(){Q.pickers.forEach(function(de){de.update()})};this.quill.on(u.default.events.EDITOR_CHANGE,ie)}}]),G}(b.default);oe.DEFAULTS=(0,d.default)(!0,{},b.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var G=this,ne=this.container.querySelector("input.ql-image[type=file]");ne==null&&(ne=document.createElement("input"),ne.setAttribute("type","file"),ne.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),ne.classList.add("ql-image"),ne.addEventListener("change",function(){if(ne.files!=null&&ne.files[0]!=null){var X=new FileReader;X.onload=function(U){var Q=G.quill.getSelection(!0);G.quill.updateContents(new p.default().retain(Q.index).delete(Q.length).insert({image:U.target.result}),u.default.sources.USER),G.quill.setSelection(Q.index+1,u.default.sources.SILENT),ne.value=""},X.readAsDataURL(ne.files[0])}}),this.container.appendChild(ne)),ne.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var V=function(H){P(G,H);function G(ne,X){M(this,G);var U=k(this,(G.__proto__||Object.getPrototypeOf(G)).call(this,ne,X));return U.textbox=U.root.querySelector('input[type="text"]'),U.listen(),U}return l(G,[{key:"listen",value:function(){var X=this;this.textbox.addEventListener("keydown",function(U){y.default.match(U,"enter")?(X.save(),U.preventDefault()):y.default.match(U,"escape")&&(X.cancel(),U.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),U!=null?this.textbox.value=U:X!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+X)||""),this.root.setAttribute("data-mode",X)}},{key:"restoreFocus",value:function(){var X=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=X}},{key:"save",value:function(){var X=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var U=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",X,u.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",X,u.default.sources.USER)),this.quill.root.scrollTop=U;break}case"video":X=$(X);case"formula":{if(!X)break;var Q=this.quill.getSelection(!0);if(Q!=null){var ie=Q.index+Q.length;this.quill.insertEmbed(ie,this.root.getAttribute("data-mode"),X,u.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(ie+1," ",u.default.sources.USER),this.quill.setSelection(ie+2,u.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),G}(R.default);function $(H){var G=H.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||H.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return G?(G[1]||"https")+"://www.youtube.com/embed/"+G[2]+"?showinfo=0":(G=H.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(G[1]||"https")+"://player.vimeo.com/video/"+G[2]+"/":H}function N(H,G){var ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;G.forEach(function(X){var U=document.createElement("option");X===ne?U.setAttribute("selected","selected"):U.setAttribute("value",X),H.appendChild(U)})}n.BaseTooltip=V,n.default=oe},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function c(){this.head=this.tail=null,this.length=0}return c.prototype.append=function(){for(var h=[],d=0;d<arguments.length;d++)h[d]=arguments[d];this.insertBefore(h[0],null),h.length>1&&this.append.apply(this,h.slice(1))},c.prototype.contains=function(h){for(var d,g=this.iterator();d=g();)if(d===h)return!0;return!1},c.prototype.insertBefore=function(h,d){h&&(h.next=d,d!=null?(h.prev=d.prev,d.prev!=null&&(d.prev.next=h),d.prev=h,d===this.head&&(this.head=h)):this.tail!=null?(this.tail.next=h,h.prev=this.tail,this.tail=h):(h.prev=null,this.head=this.tail=h),this.length+=1)},c.prototype.offset=function(h){for(var d=0,g=this.head;g!=null;){if(g===h)return d;d+=g.length(),g=g.next}return-1},c.prototype.remove=function(h){this.contains(h)&&(h.prev!=null&&(h.prev.next=h.next),h.next!=null&&(h.next.prev=h.prev),h===this.head&&(this.head=h.next),h===this.tail&&(this.tail=h.prev),this.length-=1)},c.prototype.iterator=function(h){return h===void 0&&(h=this.head),function(){var d=h;return h!=null&&(h=h.next),d}},c.prototype.find=function(h,d){d===void 0&&(d=!1);for(var g,p=this.iterator();g=p();){var a=g.length();if(h<a||d&&h===a&&(g.next==null||g.next.length()!==0))return[g,h];h-=a}return[null,0]},c.prototype.forEach=function(h){for(var d,g=this.iterator();d=g();)h(d)},c.prototype.forEachAt=function(h,d,g){if(!(d<=0))for(var p=this.find(h),a=p[0],u=p[1],f,y=h-u,_=this.iterator(a);(f=_())&&y<h+d;){var b=f.length();h>y?g(f,h-y,Math.min(d,y+b-h)):g(f,0,Math.min(b,h+d-y)),y+=b}},c.prototype.map=function(h){return this.reduce(function(d,g){return d.push(h(g)),d},[])},c.prototype.reduce=function(h,d){for(var g,p=this.iterator();g=p();)d=h(d,g);return d},c}();n.default=l},function(e,n,i){var l=this&&this.__extends||function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var y in f)f.hasOwnProperty(y)&&(u[y]=f[y])};return function(u,f){a(u,f);function y(){this.constructor=u}u.prototype=f===null?Object.create(f):(y.prototype=f.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var c=i(17),h=i(1),d={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},g=100,p=function(a){l(u,a);function u(f){var y=a.call(this,f)||this;return y.scroll=y,y.observer=new MutationObserver(function(_){y.update(_)}),y.observer.observe(y.domNode,d),y.attach(),y}return u.prototype.detach=function(){a.prototype.detach.call(this),this.observer.disconnect()},u.prototype.deleteAt=function(f,y){this.update(),f===0&&y===this.length()?this.children.forEach(function(_){_.remove()}):a.prototype.deleteAt.call(this,f,y)},u.prototype.formatAt=function(f,y,_,b){this.update(),a.prototype.formatAt.call(this,f,y,_,b)},u.prototype.insertAt=function(f,y,_){this.update(),a.prototype.insertAt.call(this,f,y,_)},u.prototype.optimize=function(f,y){var _=this;f===void 0&&(f=[]),y===void 0&&(y={}),a.prototype.optimize.call(this,y);for(var b=[].slice.call(this.observer.takeRecords());b.length>0;)f.push(b.pop());for(var v=function(S,C){C===void 0&&(C=!0),!(S==null||S===_)&&S.domNode.parentNode!=null&&(S.domNode[h.DATA_KEY].mutations==null&&(S.domNode[h.DATA_KEY].mutations=[]),C&&v(S.parent))},w=function(S){S.domNode[h.DATA_KEY]==null||S.domNode[h.DATA_KEY].mutations==null||(S instanceof c.default&&S.children.forEach(w),S.optimize(y))},T=f,x=0;T.length>0;x+=1){if(x>=g)throw new Error("[Parchment] Maximum optimize iterations reached");for(T.forEach(function(S){var C=h.find(S.target,!0);C!=null&&(C.domNode===S.target&&(S.type==="childList"?(v(h.find(S.previousSibling,!1)),[].forEach.call(S.addedNodes,function(A){var R=h.find(A,!1);v(R,!1),R instanceof c.default&&R.children.forEach(function(L){v(L,!1)})})):S.type==="attributes"&&v(C.prev)),v(C))}),this.children.forEach(w),T=[].slice.call(this.observer.takeRecords()),b=T.slice();b.length>0;)f.push(b.pop())}},u.prototype.update=function(f,y){var _=this;y===void 0&&(y={}),f=f||this.observer.takeRecords(),f.map(function(b){var v=h.find(b.target,!0);return v==null?null:v.domNode[h.DATA_KEY].mutations==null?(v.domNode[h.DATA_KEY].mutations=[b],v):(v.domNode[h.DATA_KEY].mutations.push(b),null)}).forEach(function(b){b==null||b===_||b.domNode[h.DATA_KEY]==null||b.update(b.domNode[h.DATA_KEY].mutations||[],y)}),this.domNode[h.DATA_KEY].mutations!=null&&a.prototype.update.call(this,this.domNode[h.DATA_KEY].mutations,y),this.optimize(f,y)},u.blotName="scroll",u.defaultChild="block",u.scope=h.Scope.BLOCK_BLOT,u.tagName="DIV",u}(c.default);n.default=p},function(e,n,i){var l=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var f in u)u.hasOwnProperty(f)&&(a[f]=u[f])};return function(a,u){p(a,u);function f(){this.constructor=a}a.prototype=u===null?Object.create(u):(f.prototype=u.prototype,new f)}}();Object.defineProperty(n,"__esModule",{value:!0});var c=i(18),h=i(1);function d(p,a){if(Object.keys(p).length!==Object.keys(a).length)return!1;for(var u in p)if(p[u]!==a[u])return!1;return!0}var g=function(p){l(a,p);function a(){return p!==null&&p.apply(this,arguments)||this}return a.formats=function(u){if(u.tagName!==a.tagName)return p.formats.call(this,u)},a.prototype.format=function(u,f){var y=this;u===this.statics.blotName&&!f?(this.children.forEach(function(_){_ instanceof c.default||(_=_.wrap(a.blotName,!0)),y.attributes.copy(_)}),this.unwrap()):p.prototype.format.call(this,u,f)},a.prototype.formatAt=function(u,f,y,_){if(this.formats()[y]!=null||h.query(y,h.Scope.ATTRIBUTE)){var b=this.isolate(u,f);b.format(y,_)}else p.prototype.formatAt.call(this,u,f,y,_)},a.prototype.optimize=function(u){p.prototype.optimize.call(this,u);var f=this.formats();if(Object.keys(f).length===0)return this.unwrap();var y=this.next;y instanceof a&&y.prev===this&&d(f,y.formats())&&(y.moveChildren(this),y.remove())},a.blotName="inline",a.scope=h.Scope.INLINE_BLOT,a.tagName="SPAN",a}(c.default);n.default=g},function(e,n,i){var l=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,a){p.__proto__=a}||function(p,a){for(var u in a)a.hasOwnProperty(u)&&(p[u]=a[u])};return function(p,a){g(p,a);function u(){this.constructor=p}p.prototype=a===null?Object.create(a):(u.prototype=a.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var c=i(18),h=i(1),d=function(g){l(p,g);function p(){return g!==null&&g.apply(this,arguments)||this}return p.formats=function(a){var u=h.query(p.blotName).tagName;if(a.tagName!==u)return g.formats.call(this,a)},p.prototype.format=function(a,u){h.query(a,h.Scope.BLOCK)!=null&&(a===this.statics.blotName&&!u?this.replaceWith(p.blotName):g.prototype.format.call(this,a,u))},p.prototype.formatAt=function(a,u,f,y){h.query(f,h.Scope.BLOCK)!=null?this.format(f,y):g.prototype.formatAt.call(this,a,u,f,y)},p.prototype.insertAt=function(a,u,f){if(f==null||h.query(u,h.Scope.INLINE)!=null)g.prototype.insertAt.call(this,a,u,f);else{var y=this.split(a),_=h.create(u,f);y.parent.insertBefore(_,y)}},p.prototype.update=function(a,u){navigator.userAgent.match(/Trident/)?this.build():g.prototype.update.call(this,a,u)},p.blotName="block",p.scope=h.Scope.BLOCK_BLOT,p.tagName="P",p}(c.default);n.default=d},function(e,n,i){var l=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,p){g.__proto__=p}||function(g,p){for(var a in p)p.hasOwnProperty(a)&&(g[a]=p[a])};return function(g,p){d(g,p);function a(){this.constructor=g}g.prototype=p===null?Object.create(p):(a.prototype=p.prototype,new a)}}();Object.defineProperty(n,"__esModule",{value:!0});var c=i(19),h=function(d){l(g,d);function g(){return d!==null&&d.apply(this,arguments)||this}return g.formats=function(p){},g.prototype.format=function(p,a){d.prototype.formatAt.call(this,0,this.length(),p,a)},g.prototype.formatAt=function(p,a,u,f){p===0&&a===this.length()?this.format(u,f):d.prototype.formatAt.call(this,p,a,u,f)},g.prototype.formats=function(){return this.statics.formats(this.domNode)},g}(c.default);n.default=h},function(e,n,i){var l=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,a){p.__proto__=a}||function(p,a){for(var u in a)a.hasOwnProperty(u)&&(p[u]=a[u])};return function(p,a){g(p,a);function u(){this.constructor=p}p.prototype=a===null?Object.create(a):(u.prototype=a.prototype,new u)}}();Object.defineProperty(n,"__esModule",{value:!0});var c=i(19),h=i(1),d=function(g){l(p,g);function p(a){var u=g.call(this,a)||this;return u.text=u.statics.value(u.domNode),u}return p.create=function(a){return document.createTextNode(a)},p.value=function(a){var u=a.data;return u.normalize&&(u=u.normalize()),u},p.prototype.deleteAt=function(a,u){this.domNode.data=this.text=this.text.slice(0,a)+this.text.slice(a+u)},p.prototype.index=function(a,u){return this.domNode===a?u:-1},p.prototype.insertAt=function(a,u,f){f==null?(this.text=this.text.slice(0,a)+u+this.text.slice(a),this.domNode.data=this.text):g.prototype.insertAt.call(this,a,u,f)},p.prototype.length=function(){return this.text.length},p.prototype.optimize=function(a){g.prototype.optimize.call(this,a),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof p&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},p.prototype.position=function(a,u){return[this.domNode,a]},p.prototype.split=function(a,u){if(u===void 0&&(u=!1),!u){if(a===0)return this;if(a===this.length())return this.next}var f=h.create(this.domNode.splitText(a));return this.parent.insertBefore(f,this.next),this.text=this.statics.value(this.domNode),f},p.prototype.update=function(a,u){var f=this;a.some(function(y){return y.type==="characterData"&&y.target===f.domNode})&&(this.text=this.statics.value(this.domNode))},p.prototype.value=function(){return this.text},p.blotName="text",p.scope=h.Scope.INLINE_BLOT,p}(c.default);n.default=d},function(e,n,i){var l=document.createElement("div");if(l.classList.toggle("test-class",!1),l.classList.contains("test-class")){var c=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(h,d){return arguments.length>1&&!this.contains(h)==!d?d:c.call(this,h)}}String.prototype.startsWith||(String.prototype.startsWith=function(h,d){return d=d||0,this.substr(d,h.length)===h}),String.prototype.endsWith||(String.prototype.endsWith=function(h,d){var g=this.toString();(typeof d!="number"||!isFinite(d)||Math.floor(d)!==d||d>g.length)&&(d=g.length),d-=h.length;var p=g.indexOf(h,d);return p!==-1&&p===d}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(d){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof d!="function")throw new TypeError("predicate must be a function");for(var g=Object(this),p=g.length>>>0,a=arguments[1],u,f=0;f<p;f++)if(u=g[f],d.call(a,u,f,g))return u}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(e,n){var i=-1,l=1,c=0;function h(x,S,C){if(x==S)return x?[[c,x]]:[];(C<0||x.length<C)&&(C=null);var A=a(x,S),R=x.substring(0,A);x=x.substring(A),S=S.substring(A),A=u(x,S);var L=x.substring(x.length-A);x=x.substring(0,x.length-A),S=S.substring(0,S.length-A);var M=d(x,S);return R&&M.unshift([c,R]),L&&M.push([c,L]),y(M),C!=null&&(M=v(M,C)),M=w(M),M}function d(x,S){var C;if(!x)return[[l,S]];if(!S)return[[i,x]];var A=x.length>S.length?x:S,R=x.length>S.length?S:x,L=A.indexOf(R);if(L!=-1)return C=[[l,A.substring(0,L)],[c,R],[l,A.substring(L+R.length)]],x.length>S.length&&(C[0][0]=C[2][0]=i),C;if(R.length==1)return[[i,x],[l,S]];var M=f(x,S);if(M){var k=M[0],P=M[1],I=M[2],j=M[3],W=M[4],J=h(k,I),ee=h(P,j);return J.concat([[c,W]],ee)}return g(x,S)}function g(x,S){for(var C=x.length,A=S.length,R=Math.ceil((C+A)/2),L=R,M=2*R,k=new Array(M),P=new Array(M),I=0;I<M;I++)k[I]=-1,P[I]=-1;k[L+1]=0,P[L+1]=0;for(var j=C-A,W=j%2!=0,J=0,ee=0,oe=0,V=0,$=0;$<R;$++){for(var N=-$+J;N<=$-ee;N+=2){var H=L+N,G;N==-$||N!=$&&k[H-1]<k[H+1]?G=k[H+1]:G=k[H-1]+1;for(var ne=G-N;G<C&&ne<A&&x.charAt(G)==S.charAt(ne);)G++,ne++;if(k[H]=G,G>C)ee+=2;else if(ne>A)J+=2;else if(W){var X=L+j-N;if(X>=0&&X<M&&P[X]!=-1){var U=C-P[X];if(G>=U)return p(x,S,G,ne)}}}for(var Q=-$+oe;Q<=$-V;Q+=2){var X=L+Q,U;Q==-$||Q!=$&&P[X-1]<P[X+1]?U=P[X+1]:U=P[X-1]+1;for(var ie=U-Q;U<C&&ie<A&&x.charAt(C-U-1)==S.charAt(A-ie-1);)U++,ie++;if(P[X]=U,U>C)V+=2;else if(ie>A)oe+=2;else if(!W){var H=L+j-Q;if(H>=0&&H<M&&k[H]!=-1){var G=k[H],ne=L+G-H;if(U=C-U,G>=U)return p(x,S,G,ne)}}}}return[[i,x],[l,S]]}function p(x,S,C,A){var R=x.substring(0,C),L=S.substring(0,A),M=x.substring(C),k=S.substring(A),P=h(R,L),I=h(M,k);return P.concat(I)}function a(x,S){if(!x||!S||x.charAt(0)!=S.charAt(0))return 0;for(var C=0,A=Math.min(x.length,S.length),R=A,L=0;C<R;)x.substring(L,R)==S.substring(L,R)?(C=R,L=C):A=R,R=Math.floor((A-C)/2+C);return R}function u(x,S){if(!x||!S||x.charAt(x.length-1)!=S.charAt(S.length-1))return 0;for(var C=0,A=Math.min(x.length,S.length),R=A,L=0;C<R;)x.substring(x.length-R,x.length-L)==S.substring(S.length-R,S.length-L)?(C=R,L=C):A=R,R=Math.floor((A-C)/2+C);return R}function f(x,S){var C=x.length>S.length?x:S,A=x.length>S.length?S:x;if(C.length<4||A.length*2<C.length)return null;function R(ee,oe,V){for(var $=ee.substring(V,V+Math.floor(ee.length/4)),N=-1,H="",G,ne,X,U;(N=oe.indexOf($,N+1))!=-1;){var Q=a(ee.substring(V),oe.substring(N)),ie=u(ee.substring(0,V),oe.substring(0,N));H.length<ie+Q&&(H=oe.substring(N-ie,N)+oe.substring(N,N+Q),G=ee.substring(0,V-ie),ne=ee.substring(V+Q),X=oe.substring(0,N-ie),U=oe.substring(N+Q))}return H.length*2>=ee.length?[G,ne,X,U,H]:null}var L=R(C,A,Math.ceil(C.length/4)),M=R(C,A,Math.ceil(C.length/2)),k;if(!L&&!M)return null;M?L?k=L[4].length>M[4].length?L:M:k=M:k=L;var P,I,j,W;x.length>S.length?(P=k[0],I=k[1],j=k[2],W=k[3]):(j=k[0],W=k[1],P=k[2],I=k[3]);var J=k[4];return[P,I,j,W,J]}function y(x){x.push([c,""]);for(var S=0,C=0,A=0,R="",L="",M;S<x.length;)switch(x[S][0]){case l:A++,L+=x[S][1],S++;break;case i:C++,R+=x[S][1],S++;break;case c:C+A>1?(C!==0&&A!==0&&(M=a(L,R),M!==0&&(S-C-A>0&&x[S-C-A-1][0]==c?x[S-C-A-1][1]+=L.substring(0,M):(x.splice(0,0,[c,L.substring(0,M)]),S++),L=L.substring(M),R=R.substring(M)),M=u(L,R),M!==0&&(x[S][1]=L.substring(L.length-M)+x[S][1],L=L.substring(0,L.length-M),R=R.substring(0,R.length-M))),C===0?x.splice(S-A,C+A,[l,L]):A===0?x.splice(S-C,C+A,[i,R]):x.splice(S-C-A,C+A,[i,R],[l,L]),S=S-C-A+(C?1:0)+(A?1:0)+1):S!==0&&x[S-1][0]==c?(x[S-1][1]+=x[S][1],x.splice(S,1)):S++,A=0,C=0,R="",L="";break}x[x.length-1][1]===""&&x.pop();var k=!1;for(S=1;S<x.length-1;)x[S-1][0]==c&&x[S+1][0]==c&&(x[S][1].substring(x[S][1].length-x[S-1][1].length)==x[S-1][1]?(x[S][1]=x[S-1][1]+x[S][1].substring(0,x[S][1].length-x[S-1][1].length),x[S+1][1]=x[S-1][1]+x[S+1][1],x.splice(S-1,1),k=!0):x[S][1].substring(0,x[S+1][1].length)==x[S+1][1]&&(x[S-1][1]+=x[S+1][1],x[S][1]=x[S][1].substring(x[S+1][1].length)+x[S+1][1],x.splice(S+1,1),k=!0)),S++;k&&y(x)}var _=h;_.INSERT=l,_.DELETE=i,_.EQUAL=c,e.exports=_;function b(x,S){if(S===0)return[c,x];for(var C=0,A=0;A<x.length;A++){var R=x[A];if(R[0]===i||R[0]===c){var L=C+R[1].length;if(S===L)return[A+1,x];if(S<L){x=x.slice();var M=S-C,k=[R[0],R[1].slice(0,M)],P=[R[0],R[1].slice(M)];return x.splice(A,1,k,P),[A+1,x]}else C=L}}throw new Error("cursor_pos is out of bounds!")}function v(x,S){var C=b(x,S),A=C[1],R=C[0],L=A[R],M=A[R+1];if(L==null)return x;if(L[0]!==c)return x;if(M!=null&&L[1]+M[1]===M[1]+L[1])return A.splice(R,2,M,L),T(A,R,2);if(M!=null&&M[1].indexOf(L[1])===0){A.splice(R,2,[M[0],L[1]],[0,L[1]]);var k=M[1].slice(L[1].length);return k.length>0&&A.splice(R+2,0,[M[0],k]),T(A,R,3)}else return x}function w(x){for(var S=!1,C=function(M){return M.charCodeAt(0)>=56320&&M.charCodeAt(0)<=57343},A=function(M){return M.charCodeAt(M.length-1)>=55296&&M.charCodeAt(M.length-1)<=56319},R=2;R<x.length;R+=1)x[R-2][0]===c&&A(x[R-2][1])&&x[R-1][0]===i&&C(x[R-1][1])&&x[R][0]===l&&C(x[R][1])&&(S=!0,x[R-1][1]=x[R-2][1].slice(-1)+x[R-1][1],x[R][1]=x[R-2][1].slice(-1)+x[R][1],x[R-2][1]=x[R-2][1].slice(0,-1));if(!S)return x;for(var L=[],R=0;R<x.length;R+=1)x[R][1].length>0&&L.push(x[R]);return L}function T(x,S,C){for(var A=S+C-1;A>=0&&A>=S-1;A--)if(A+1<x.length){var R=x[A],L=x[A+1];R[0]===L[1]&&x.splice(A,2,[R[0],R[1]+L[1]])}return x}},function(e,n){n=e.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(l){var c=[];for(var h in l)c.push(h);return c}},function(e,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=e.exports=i?l:c,n.supported=l;function l(h){return Object.prototype.toString.call(h)=="[object Arguments]"}n.unsupported=c;function c(h){return h&&typeof h=="object"&&typeof h.length=="number"&&Object.prototype.hasOwnProperty.call(h,"callee")&&!Object.prototype.propertyIsEnumerable.call(h,"callee")||!1}},function(e,n){var i=Object.prototype.hasOwnProperty,l="~";function c(){}Object.create&&(c.prototype=Object.create(null),new c().__proto__||(l=!1));function h(g,p,a){this.fn=g,this.context=p,this.once=a||!1}function d(){this._events=new c,this._eventsCount=0}d.prototype.eventNames=function(){var p=[],a,u;if(this._eventsCount===0)return p;for(u in a=this._events)i.call(a,u)&&p.push(l?u.slice(1):u);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(a)):p},d.prototype.listeners=function(p,a){var u=l?l+p:p,f=this._events[u];if(a)return!!f;if(!f)return[];if(f.fn)return[f.fn];for(var y=0,_=f.length,b=new Array(_);y<_;y++)b[y]=f[y].fn;return b},d.prototype.emit=function(p,a,u,f,y,_){var b=l?l+p:p;if(!this._events[b])return!1;var v=this._events[b],w=arguments.length,T,x;if(v.fn){switch(v.once&&this.removeListener(p,v.fn,void 0,!0),w){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,a),!0;case 3:return v.fn.call(v.context,a,u),!0;case 4:return v.fn.call(v.context,a,u,f),!0;case 5:return v.fn.call(v.context,a,u,f,y),!0;case 6:return v.fn.call(v.context,a,u,f,y,_),!0}for(x=1,T=new Array(w-1);x<w;x++)T[x-1]=arguments[x];v.fn.apply(v.context,T)}else{var S=v.length,C;for(x=0;x<S;x++)switch(v[x].once&&this.removeListener(p,v[x].fn,void 0,!0),w){case 1:v[x].fn.call(v[x].context);break;case 2:v[x].fn.call(v[x].context,a);break;case 3:v[x].fn.call(v[x].context,a,u);break;case 4:v[x].fn.call(v[x].context,a,u,f);break;default:if(!T)for(C=1,T=new Array(w-1);C<w;C++)T[C-1]=arguments[C];v[x].fn.apply(v[x].context,T)}}return!0},d.prototype.on=function(p,a,u){var f=new h(a,u||this),y=l?l+p:p;return this._events[y]?this._events[y].fn?this._events[y]=[this._events[y],f]:this._events[y].push(f):(this._events[y]=f,this._eventsCount++),this},d.prototype.once=function(p,a,u){var f=new h(a,u||this,!0),y=l?l+p:p;return this._events[y]?this._events[y].fn?this._events[y]=[this._events[y],f]:this._events[y].push(f):(this._events[y]=f,this._eventsCount++),this},d.prototype.removeListener=function(p,a,u,f){var y=l?l+p:p;if(!this._events[y])return this;if(!a)return--this._eventsCount===0?this._events=new c:delete this._events[y],this;var _=this._events[y];if(_.fn)_.fn===a&&(!f||_.once)&&(!u||_.context===u)&&(--this._eventsCount===0?this._events=new c:delete this._events[y]);else{for(var b=0,v=[],w=_.length;b<w;b++)(_[b].fn!==a||f&&!_[b].once||u&&_[b].context!==u)&&v.push(_[b]);v.length?this._events[y]=v.length===1?v[0]:v:--this._eventsCount===0?this._events=new c:delete this._events[y]}return this},d.prototype.removeAllListeners=function(p){var a;return p?(a=l?l+p:p,this._events[a]&&(--this._eventsCount===0?this._events=new c:delete this._events[a])):(this._events=new c,this._eventsCount=0),this},d.prototype.off=d.prototype.removeListener,d.prototype.addListener=d.prototype.on,d.prototype.setMaxListeners=function(){return this},d.prefixed=l,d.EventEmitter=d,typeof e!="undefined"&&(e.exports=d)},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(le){return typeof le}:function(le){return le&&typeof Symbol=="function"&&le.constructor===Symbol&&le!==Symbol.prototype?"symbol":typeof le},c=function(){function le(he,_e){var be=[],ve=!0,Be=!1,Le=void 0;try{for(var Ee=he[Symbol.iterator](),$e;!(ve=($e=Ee.next()).done)&&(be.push($e.value),!(_e&&be.length===_e));ve=!0);}catch(vt){Be=!0,Le=vt}finally{try{!ve&&Ee.return&&Ee.return()}finally{if(Be)throw Le}}return be}return function(he,_e){if(Array.isArray(he))return he;if(Symbol.iterator in Object(he))return le(he,_e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function le(he,_e){for(var be=0;be<_e.length;be++){var ve=_e[be];ve.enumerable=ve.enumerable||!1,ve.configurable=!0,"value"in ve&&(ve.writable=!0),Object.defineProperty(he,ve.key,ve)}}return function(he,_e,be){return _e&&le(he.prototype,_e),be&&le(he,be),he}}(),d=i(3),g=P(d),p=i(2),a=P(p),u=i(0),f=P(u),y=i(5),_=P(y),b=i(10),v=P(b),w=i(9),T=P(w),x=i(36),S=i(37),C=i(13),A=P(C),R=i(26),L=i(38),M=i(39),k=i(40);function P(le){return le&&le.__esModule?le:{default:le}}function I(le,he,_e){return he in le?Object.defineProperty(le,he,{value:_e,enumerable:!0,configurable:!0,writable:!0}):le[he]=_e,le}function j(le,he){if(!(le instanceof he))throw new TypeError("Cannot call a class as a function")}function W(le,he){if(!le)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return he&&(typeof he=="object"||typeof he=="function")?he:le}function J(le,he){if(typeof he!="function"&&he!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof he);le.prototype=Object.create(he&&he.prototype,{constructor:{value:le,enumerable:!1,writable:!0,configurable:!0}}),he&&(Object.setPrototypeOf?Object.setPrototypeOf(le,he):le.__proto__=he)}var ee=(0,v.default)("quill:clipboard"),oe="__ql-matcher",V=[[Node.TEXT_NODE,Je],[Node.TEXT_NODE,De],["br",we],[Node.ELEMENT_NODE,De],[Node.ELEMENT_NODE,de],[Node.ELEMENT_NODE,ze],[Node.ELEMENT_NODE,ae],[Node.ELEMENT_NODE,xt],["li",Me],["b",ie.bind(ie,"bold")],["i",ie.bind(ie,"italic")],["style",Pe]],$=[x.AlignAttribute,L.DirectionAttribute].reduce(function(le,he){return le[he.keyName]=he,le},{}),N=[x.AlignStyle,S.BackgroundStyle,R.ColorStyle,L.DirectionStyle,M.FontStyle,k.SizeStyle].reduce(function(le,he){return le[he.keyName]=he,le},{}),H=function(le){J(he,le);function he(_e,be){j(this,he);var ve=W(this,(he.__proto__||Object.getPrototypeOf(he)).call(this,_e,be));return ve.quill.root.addEventListener("paste",ve.onPaste.bind(ve)),ve.container=ve.quill.addContainer("ql-clipboard"),ve.container.setAttribute("contenteditable",!0),ve.container.setAttribute("tabindex",-1),ve.matchers=[],V.concat(ve.options.matchers).forEach(function(Be){var Le=c(Be,2),Ee=Le[0],$e=Le[1];!be.matchVisual&&$e===ze||ve.addMatcher(Ee,$e)}),ve}return h(he,[{key:"addMatcher",value:function(be,ve){this.matchers.push([be,ve])}},{key:"convert",value:function(be){if(typeof be=="string")return this.container.innerHTML=be.replace(/\>\r?\n +\</g,"><"),this.convert();var ve=this.quill.getFormat(this.quill.selection.savedRange.index);if(ve[A.default.blotName]){var Be=this.container.innerText;return this.container.innerHTML="",new a.default().insert(Be,I({},A.default.blotName,ve[A.default.blotName]))}var Le=this.prepareMatching(),Ee=c(Le,2),$e=Ee[0],vt=Ee[1],Ve=Q(this.container,$e,vt);return X(Ve,`
`)&&Ve.ops[Ve.ops.length-1].attributes==null&&(Ve=Ve.compose(new a.default().retain(Ve.length()-1).delete(1))),ee.log("convert",this.container.innerHTML,Ve),this.container.innerHTML="",Ve}},{key:"dangerouslyPasteHTML",value:function(be,ve){var Be=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_.default.sources.API;if(typeof be=="string")this.quill.setContents(this.convert(be),ve),this.quill.setSelection(0,_.default.sources.SILENT);else{var Le=this.convert(ve);this.quill.updateContents(new a.default().retain(be).concat(Le),Be),this.quill.setSelection(be+Le.length(),_.default.sources.SILENT)}}},{key:"onPaste",value:function(be){var ve=this;if(!(be.defaultPrevented||!this.quill.isEnabled())){var Be=this.quill.getSelection(),Le=new a.default().retain(Be.index),Ee=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(_.default.sources.SILENT),setTimeout(function(){Le=Le.concat(ve.convert()).delete(Be.length),ve.quill.updateContents(Le,_.default.sources.USER),ve.quill.setSelection(Le.length()-Be.length,_.default.sources.SILENT),ve.quill.scrollingContainer.scrollTop=Ee,ve.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var be=this,ve=[],Be=[];return this.matchers.forEach(function(Le){var Ee=c(Le,2),$e=Ee[0],vt=Ee[1];switch($e){case Node.TEXT_NODE:Be.push(vt);break;case Node.ELEMENT_NODE:ve.push(vt);break;default:[].forEach.call(be.container.querySelectorAll($e),function(Ve){Ve[oe]=Ve[oe]||[],Ve[oe].push(vt)});break}}),[ve,Be]}}]),he}(T.default);H.DEFAULTS={matchers:[],matchVisual:!0};function G(le,he,_e){return(typeof he=="undefined"?"undefined":l(he))==="object"?Object.keys(he).reduce(function(be,ve){return G(be,ve,he[ve])},le):le.reduce(function(be,ve){return ve.attributes&&ve.attributes[he]?be.push(ve):be.insert(ve.insert,(0,g.default)({},I({},he,_e),ve.attributes))},new a.default)}function ne(le){if(le.nodeType!==Node.ELEMENT_NODE)return{};var he="__ql-computed-style";return le[he]||(le[he]=window.getComputedStyle(le))}function X(le,he){for(var _e="",be=le.ops.length-1;be>=0&&_e.length<he.length;--be){var ve=le.ops[be];if(typeof ve.insert!="string")break;_e=ve.insert+_e}return _e.slice(-1*he.length)===he}function U(le){if(le.childNodes.length===0)return!1;var he=ne(le);return["block","list-item"].indexOf(he.display)>-1}function Q(le,he,_e){return le.nodeType===le.TEXT_NODE?_e.reduce(function(be,ve){return ve(le,be)},new a.default):le.nodeType===le.ELEMENT_NODE?[].reduce.call(le.childNodes||[],function(be,ve){var Be=Q(ve,he,_e);return ve.nodeType===le.ELEMENT_NODE&&(Be=he.reduce(function(Le,Ee){return Ee(ve,Le)},Be),Be=(ve[oe]||[]).reduce(function(Le,Ee){return Ee(ve,Le)},Be)),be.concat(Be)},new a.default):new a.default}function ie(le,he,_e){return G(_e,le,!0)}function ae(le,he){var _e=f.default.Attributor.Attribute.keys(le),be=f.default.Attributor.Class.keys(le),ve=f.default.Attributor.Style.keys(le),Be={};return _e.concat(be).concat(ve).forEach(function(Le){var Ee=f.default.query(Le,f.default.Scope.ATTRIBUTE);Ee!=null&&(Be[Ee.attrName]=Ee.value(le),Be[Ee.attrName])||(Ee=$[Le],Ee!=null&&(Ee.attrName===Le||Ee.keyName===Le)&&(Be[Ee.attrName]=Ee.value(le)||void 0),Ee=N[Le],Ee!=null&&(Ee.attrName===Le||Ee.keyName===Le)&&(Ee=N[Le],Be[Ee.attrName]=Ee.value(le)||void 0))}),Object.keys(Be).length>0&&(he=G(he,Be)),he}function de(le,he){var _e=f.default.query(le);if(_e==null)return he;if(_e.prototype instanceof f.default.Embed){var be={},ve=_e.value(le);ve!=null&&(be[_e.blotName]=ve,he=new a.default().insert(be,_e.formats(le)))}else typeof _e.formats=="function"&&(he=G(he,_e.blotName,_e.formats(le)));return he}function we(le,he){return X(he,`
`)||he.insert(`
`),he}function Pe(){return new a.default}function Me(le,he){var _e=f.default.query(le);if(_e==null||_e.blotName!=="list-item"||!X(he,`
`))return he;for(var be=-1,ve=le.parentNode;!ve.classList.contains("ql-clipboard");)(f.default.query(ve)||{}).blotName==="list"&&(be+=1),ve=ve.parentNode;return be<=0?he:he.compose(new a.default().retain(he.length()-1).retain(1,{indent:be}))}function De(le,he){return X(he,`
`)||(U(le)||he.length()>0&&le.nextSibling&&U(le.nextSibling))&&he.insert(`
`),he}function ze(le,he){if(U(le)&&le.nextElementSibling!=null&&!X(he,`
`)){var _e=le.offsetHeight+parseFloat(ne(le).marginTop)+parseFloat(ne(le).marginBottom);le.nextElementSibling.offsetTop>le.offsetTop+_e*1.5&&he.insert(`
`)}return he}function xt(le,he){var _e={},be=le.style||{};return be.fontStyle&&ne(le).fontStyle==="italic"&&(_e.italic=!0),be.fontWeight&&(ne(le).fontWeight.startsWith("bold")||parseInt(ne(le).fontWeight)>=700)&&(_e.bold=!0),Object.keys(_e).length>0&&(he=G(he,_e)),parseFloat(be.textIndent||0)>0&&(he=new a.default().insert(" ").concat(he)),he}function Je(le,he){var _e=le.data;if(le.parentNode.tagName==="O:P")return he.insert(_e.trim());if(_e.trim().length===0&&le.parentNode.classList.contains("ql-clipboard"))return he;if(!ne(le.parentNode).whiteSpace.startsWith("pre")){var be=function(Be,Le){return Le=Le.replace(/[^\u00a0]/g,""),Le.length<1&&Be?" ":Le};_e=_e.replace(/\r\n/g," ").replace(/\n/g," "),_e=_e.replace(/\s\s+/g,be.bind(be,!0)),(le.previousSibling==null&&U(le.parentNode)||le.previousSibling!=null&&U(le.previousSibling))&&(_e=_e.replace(/^\s+/,be.bind(be,!1))),(le.nextSibling==null&&U(le.parentNode)||le.nextSibling!=null&&U(le.nextSibling))&&(_e=_e.replace(/\s+$/,be.bind(be,!1)))}return he.insert(_e)}n.default=H,n.matchAttributor=ae,n.matchBlot=de,n.matchNewline=De,n.matchSpacing=ze,n.matchText=Je},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function y(_,b){for(var v=0;v<b.length;v++){var w=b[v];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(_,w.key,w)}}return function(_,b,v){return b&&y(_.prototype,b),v&&y(_,v),_}}(),c=function y(_,b,v){_===null&&(_=Function.prototype);var w=Object.getOwnPropertyDescriptor(_,b);if(w===void 0){var T=Object.getPrototypeOf(_);return T===null?void 0:y(T,b,v)}else{if("value"in w)return w.value;var x=w.get;return x===void 0?void 0:x.call(v)}},h=i(6),d=g(h);function g(y){return y&&y.__esModule?y:{default:y}}function p(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function a(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function u(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var f=function(y){u(_,y);function _(){return p(this,_),a(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return l(_,[{key:"optimize",value:function(v){c(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,v),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return c(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),_}(d.default);f.blotName="bold",f.tagName=["STRONG","B"],n.default=f},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var l=function(){function k(P,I){var j=[],W=!0,J=!1,ee=void 0;try{for(var oe=P[Symbol.iterator](),V;!(W=(V=oe.next()).done)&&(j.push(V.value),!(I&&j.length===I));W=!0);}catch($){J=!0,ee=$}finally{try{!W&&oe.return&&oe.return()}finally{if(J)throw ee}}return j}return function(P,I){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return k(P,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function k(P,I){for(var j=0;j<I.length;j++){var W=I[j];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(P,W.key,W)}}return function(P,I,j){return I&&k(P.prototype,I),j&&k(P,j),P}}(),h=i(2),d=v(h),g=i(0),p=v(g),a=i(5),u=v(a),f=i(10),y=v(f),_=i(9),b=v(_);function v(k){return k&&k.__esModule?k:{default:k}}function w(k,P,I){return P in k?Object.defineProperty(k,P,{value:I,enumerable:!0,configurable:!0,writable:!0}):k[P]=I,k}function T(k,P){if(!(k instanceof P))throw new TypeError("Cannot call a class as a function")}function x(k,P){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:k}function S(k,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);k.prototype=Object.create(P&&P.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(k,P):k.__proto__=P)}var C=(0,y.default)("quill:toolbar"),A=function(k){S(P,k);function P(I,j){T(this,P);var W=x(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,I,j));if(Array.isArray(W.options.container)){var J=document.createElement("div");L(J,W.options.container),I.container.parentNode.insertBefore(J,I.container),W.container=J}else typeof W.options.container=="string"?W.container=document.querySelector(W.options.container):W.container=W.options.container;if(!(W.container instanceof HTMLElement)){var ee;return ee=C.error("Container required for toolbar",W.options),x(W,ee)}return W.container.classList.add("ql-toolbar"),W.controls=[],W.handlers={},Object.keys(W.options.handlers).forEach(function(oe){W.addHandler(oe,W.options.handlers[oe])}),[].forEach.call(W.container.querySelectorAll("button, select"),function(oe){W.attach(oe)}),W.quill.on(u.default.events.EDITOR_CHANGE,function(oe,V){oe===u.default.events.SELECTION_CHANGE&&W.update(V)}),W.quill.on(u.default.events.SCROLL_OPTIMIZE,function(){var oe=W.quill.selection.getRange(),V=l(oe,1),$=V[0];W.update($)}),W}return c(P,[{key:"addHandler",value:function(j,W){this.handlers[j]=W}},{key:"attach",value:function(j){var W=this,J=[].find.call(j.classList,function(oe){return oe.indexOf("ql-")===0});if(J){if(J=J.slice(3),j.tagName==="BUTTON"&&j.setAttribute("type","button"),this.handlers[J]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[J]==null){C.warn("ignoring attaching to disabled format",J,j);return}if(p.default.query(J)==null){C.warn("ignoring attaching to nonexistent format",J,j);return}}var ee=j.tagName==="SELECT"?"change":"click";j.addEventListener(ee,function(oe){var V=void 0;if(j.tagName==="SELECT"){if(j.selectedIndex<0)return;var $=j.options[j.selectedIndex];$.hasAttribute("selected")?V=!1:V=$.value||!1}else j.classList.contains("ql-active")?V=!1:V=j.value||!j.hasAttribute("value"),oe.preventDefault();W.quill.focus();var N=W.quill.selection.getRange(),H=l(N,1),G=H[0];if(W.handlers[J]!=null)W.handlers[J].call(W,V);else if(p.default.query(J).prototype instanceof p.default.Embed){if(V=prompt("Enter "+J),!V)return;W.quill.updateContents(new d.default().retain(G.index).delete(G.length).insert(w({},J,V)),u.default.sources.USER)}else W.quill.format(J,V,u.default.sources.USER);W.update(G)}),this.controls.push([J,j])}}},{key:"update",value:function(j){var W=j==null?{}:this.quill.getFormat(j);this.controls.forEach(function(J){var ee=l(J,2),oe=ee[0],V=ee[1];if(V.tagName==="SELECT"){var $=void 0;if(j==null)$=null;else if(W[oe]==null)$=V.querySelector("option[selected]");else if(!Array.isArray(W[oe])){var N=W[oe];typeof N=="string"&&(N=N.replace(/\"/g,'\\"')),$=V.querySelector('option[value="'+N+'"]')}$==null?(V.value="",V.selectedIndex=-1):$.selected=!0}else if(j==null)V.classList.remove("ql-active");else if(V.hasAttribute("value")){var H=W[oe]===V.getAttribute("value")||W[oe]!=null&&W[oe].toString()===V.getAttribute("value")||W[oe]==null&&!V.getAttribute("value");V.classList.toggle("ql-active",H)}else V.classList.toggle("ql-active",W[oe]!=null)})}}]),P}(b.default);A.DEFAULTS={};function R(k,P,I){var j=document.createElement("button");j.setAttribute("type","button"),j.classList.add("ql-"+P),I!=null&&(j.value=I),k.appendChild(j)}function L(k,P){Array.isArray(P[0])||(P=[P]),P.forEach(function(I){var j=document.createElement("span");j.classList.add("ql-formats"),I.forEach(function(W){if(typeof W=="string")R(j,W);else{var J=Object.keys(W)[0],ee=W[J];Array.isArray(ee)?M(j,J,ee):R(j,J,ee)}}),k.appendChild(j)})}function M(k,P,I){var j=document.createElement("select");j.classList.add("ql-"+P),I.forEach(function(W){var J=document.createElement("option");W!==!1?J.setAttribute("value",W):J.setAttribute("selected","selected"),j.appendChild(J)}),k.appendChild(j)}A.DEFAULTS={container:null,handlers:{clean:function(){var P=this,I=this.quill.getSelection();if(I!=null)if(I.length==0){var j=this.quill.getFormat();Object.keys(j).forEach(function(W){p.default.query(W,p.default.Scope.INLINE)!=null&&P.quill.format(W,!1)})}else this.quill.removeFormat(I,u.default.sources.USER)},direction:function(P){var I=this.quill.getFormat().align;P==="rtl"&&I==null?this.quill.format("align","right",u.default.sources.USER):!P&&I==="right"&&this.quill.format("align",!1,u.default.sources.USER),this.quill.format("direction",P,u.default.sources.USER)},indent:function(P){var I=this.quill.getSelection(),j=this.quill.getFormat(I),W=parseInt(j.indent||0);if(P==="+1"||P==="-1"){var J=P==="+1"?1:-1;j.direction==="rtl"&&(J*=-1),this.quill.format("indent",W+J,u.default.sources.USER)}},link:function(P){P===!0&&(P=prompt("Enter link URL:")),this.quill.format("link",P,u.default.sources.USER)},list:function(P){var I=this.quill.getSelection(),j=this.quill.getFormat(I);P==="check"?j.list==="checked"||j.list==="unchecked"?this.quill.format("list",!1,u.default.sources.USER):this.quill.format("list","unchecked",u.default.sources.USER):this.quill.format("list",P,u.default.sources.USER)}}},n.default=A,n.addControls=L},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function y(_,b){for(var v=0;v<b.length;v++){var w=b[v];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(_,w.key,w)}}return function(_,b,v){return b&&y(_.prototype,b),v&&y(_,v),_}}(),c=function y(_,b,v){_===null&&(_=Function.prototype);var w=Object.getOwnPropertyDescriptor(_,b);if(w===void 0){var T=Object.getPrototypeOf(_);return T===null?void 0:y(T,b,v)}else{if("value"in w)return w.value;var x=w.get;return x===void 0?void 0:x.call(v)}},h=i(28),d=g(h);function g(y){return y&&y.__esModule?y:{default:y}}function p(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function a(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function u(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var f=function(y){u(_,y);function _(b,v){p(this,_);var w=a(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,b));return w.label.innerHTML=v,w.container.classList.add("ql-color-picker"),[].slice.call(w.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(T){T.classList.add("ql-primary")}),w}return l(_,[{key:"buildItem",value:function(v){var w=c(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"buildItem",this).call(this,v);return w.style.backgroundColor=v.getAttribute("value")||"",w}},{key:"selectItem",value:function(v,w){c(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"selectItem",this).call(this,v,w);var T=this.label.querySelector(".ql-color-label"),x=v&&v.getAttribute("data-value")||"";T&&(T.tagName==="line"?T.style.stroke=x:T.style.fill=x)}}]),_}(d.default);n.default=f},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function y(_,b){for(var v=0;v<b.length;v++){var w=b[v];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(_,w.key,w)}}return function(_,b,v){return b&&y(_.prototype,b),v&&y(_,v),_}}(),c=function y(_,b,v){_===null&&(_=Function.prototype);var w=Object.getOwnPropertyDescriptor(_,b);if(w===void 0){var T=Object.getPrototypeOf(_);return T===null?void 0:y(T,b,v)}else{if("value"in w)return w.value;var x=w.get;return x===void 0?void 0:x.call(v)}},h=i(28),d=g(h);function g(y){return y&&y.__esModule?y:{default:y}}function p(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function a(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function u(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var f=function(y){u(_,y);function _(b,v){p(this,_);var w=a(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,b));return w.container.classList.add("ql-icon-picker"),[].forEach.call(w.container.querySelectorAll(".ql-picker-item"),function(T){T.innerHTML=v[T.getAttribute("data-value")||""]}),w.defaultItem=w.container.querySelector(".ql-selected"),w.selectItem(w.defaultItem),w}return l(_,[{key:"selectItem",value:function(v,w){c(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"selectItem",this).call(this,v,w),v=v||this.defaultItem,this.label.innerHTML=v.innerHTML}}]),_}(d.default);n.default=f},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function d(g,p){for(var a=0;a<p.length;a++){var u=p[a];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(g,u.key,u)}}return function(g,p,a){return p&&d(g.prototype,p),a&&d(g,a),g}}();function c(d,g){if(!(d instanceof g))throw new TypeError("Cannot call a class as a function")}var h=function(){function d(g,p){var a=this;c(this,d),this.quill=g,this.boundsContainer=p||document.body,this.root=g.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){a.root.style.marginTop=-1*a.quill.root.scrollTop+"px"}),this.hide()}return l(d,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(p){var a=p.left+p.width/2-this.root.offsetWidth/2,u=p.bottom+this.quill.root.scrollTop;this.root.style.left=a+"px",this.root.style.top=u+"px",this.root.classList.remove("ql-flip");var f=this.boundsContainer.getBoundingClientRect(),y=this.root.getBoundingClientRect(),_=0;if(y.right>f.right&&(_=f.right-y.right,this.root.style.left=a+_+"px"),y.left<f.left&&(_=f.left-y.left,this.root.style.left=a+_+"px"),y.bottom>f.bottom){var b=y.bottom-y.top,v=p.bottom-p.top+b;this.root.style.top=u-v+"px",this.root.classList.add("ql-flip")}return _}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),d}();n.default=h},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function M(k,P){var I=[],j=!0,W=!1,J=void 0;try{for(var ee=k[Symbol.iterator](),oe;!(j=(oe=ee.next()).done)&&(I.push(oe.value),!(P&&I.length===P));j=!0);}catch(V){W=!0,J=V}finally{try{!j&&ee.return&&ee.return()}finally{if(W)throw J}}return I}return function(k,P){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return M(k,P);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function M(k,P,I){k===null&&(k=Function.prototype);var j=Object.getOwnPropertyDescriptor(k,P);if(j===void 0){var W=Object.getPrototypeOf(k);return W===null?void 0:M(W,P,I)}else{if("value"in j)return j.value;var J=j.get;return J===void 0?void 0:J.call(I)}},h=function(){function M(k,P){for(var I=0;I<P.length;I++){var j=P[I];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(k,j.key,j)}}return function(k,P,I){return P&&M(k.prototype,P),I&&M(k,I),k}}(),d=i(3),g=T(d),p=i(8),a=T(p),u=i(43),f=T(u),y=i(27),_=T(y),b=i(15),v=i(41),w=T(v);function T(M){return M&&M.__esModule?M:{default:M}}function x(M,k){if(!(M instanceof k))throw new TypeError("Cannot call a class as a function")}function S(M,k){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:M}function C(M,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);M.prototype=Object.create(k&&k.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(M,k):M.__proto__=k)}var A=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],R=function(M){C(k,M);function k(P,I){x(this,k),I.modules.toolbar!=null&&I.modules.toolbar.container==null&&(I.modules.toolbar.container=A);var j=S(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,P,I));return j.quill.container.classList.add("ql-snow"),j}return h(k,[{key:"extendToolbar",value:function(I){I.container.classList.add("ql-snow"),this.buildButtons([].slice.call(I.container.querySelectorAll("button")),w.default),this.buildPickers([].slice.call(I.container.querySelectorAll("select")),w.default),this.tooltip=new L(this.quill,this.options.bounds),I.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(j,W){I.handlers.link.call(I,!W.format.link)})}}]),k}(f.default);R.DEFAULTS=(0,g.default)(!0,{},f.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(k){if(k){var P=this.quill.getSelection();if(P==null||P.length==0)return;var I=this.quill.getText(P);/^\S+@\S+\.\S+$/.test(I)&&I.indexOf("mailto:")!==0&&(I="mailto:"+I);var j=this.quill.theme.tooltip;j.edit("link",I)}else this.quill.format("link",!1)}}}}});var L=function(M){C(k,M);function k(P,I){x(this,k);var j=S(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,P,I));return j.preview=j.root.querySelector("a.ql-preview"),j}return h(k,[{key:"listen",value:function(){var I=this;c(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(j){I.root.classList.contains("ql-editing")?I.save():I.edit("link",I.preview.textContent),j.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(j){if(I.linkRange!=null){var W=I.linkRange;I.restoreFocus(),I.quill.formatText(W,"link",!1,a.default.sources.USER),delete I.linkRange}j.preventDefault(),I.hide()}),this.quill.on(a.default.events.SELECTION_CHANGE,function(j,W,J){if(j!=null){if(j.length===0&&J===a.default.sources.USER){var ee=I.quill.scroll.descendant(_.default,j.index),oe=l(ee,2),V=oe[0],$=oe[1];if(V!=null){I.linkRange=new b.Range(j.index-$,V.length());var N=_.default.formats(V.domNode);I.preview.textContent=N,I.preview.setAttribute("href",N),I.show(),I.position(I.quill.getBounds(I.linkRange));return}}else delete I.linkRange;I.hide()}})}},{key:"show",value:function(){c(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),k}(u.BaseTooltip);L.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),n.default=R},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=i(29),c=ve(l),h=i(36),d=i(38),g=i(64),p=i(65),a=ve(p),u=i(66),f=ve(u),y=i(67),_=ve(y),b=i(37),v=i(26),w=i(39),T=i(40),x=i(56),S=ve(x),C=i(68),A=ve(C),R=i(27),L=ve(R),M=i(69),k=ve(M),P=i(70),I=ve(P),j=i(71),W=ve(j),J=i(72),ee=ve(J),oe=i(73),V=ve(oe),$=i(13),N=ve($),H=i(74),G=ve(H),ne=i(75),X=ve(ne),U=i(57),Q=ve(U),ie=i(41),ae=ve(ie),de=i(28),we=ve(de),Pe=i(59),Me=ve(Pe),De=i(60),ze=ve(De),xt=i(61),Je=ve(xt),le=i(108),he=ve(le),_e=i(62),be=ve(_e);function ve(Be){return Be&&Be.__esModule?Be:{default:Be}}c.default.register({"attributors/attribute/direction":d.DirectionAttribute,"attributors/class/align":h.AlignClass,"attributors/class/background":b.BackgroundClass,"attributors/class/color":v.ColorClass,"attributors/class/direction":d.DirectionClass,"attributors/class/font":w.FontClass,"attributors/class/size":T.SizeClass,"attributors/style/align":h.AlignStyle,"attributors/style/background":b.BackgroundStyle,"attributors/style/color":v.ColorStyle,"attributors/style/direction":d.DirectionStyle,"attributors/style/font":w.FontStyle,"attributors/style/size":T.SizeStyle},!0),c.default.register({"formats/align":h.AlignClass,"formats/direction":d.DirectionClass,"formats/indent":g.IndentClass,"formats/background":b.BackgroundStyle,"formats/color":v.ColorStyle,"formats/font":w.FontClass,"formats/size":T.SizeClass,"formats/blockquote":a.default,"formats/code-block":N.default,"formats/header":f.default,"formats/list":_.default,"formats/bold":S.default,"formats/code":$.Code,"formats/italic":A.default,"formats/link":L.default,"formats/script":k.default,"formats/strike":I.default,"formats/underline":W.default,"formats/image":ee.default,"formats/video":V.default,"formats/list/item":y.ListItem,"modules/formula":G.default,"modules/syntax":X.default,"modules/toolbar":Q.default,"themes/bubble":he.default,"themes/snow":be.default,"ui/icons":ae.default,"ui/picker":we.default,"ui/icon-picker":ze.default,"ui/color-picker":Me.default,"ui/tooltip":Je.default},!0),n.default=c.default},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var l=function(){function _(b,v){for(var w=0;w<v.length;w++){var T=v[w];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(b,T.key,T)}}return function(b,v,w){return v&&_(b.prototype,v),w&&_(b,w),b}}(),c=function _(b,v,w){b===null&&(b=Function.prototype);var T=Object.getOwnPropertyDescriptor(b,v);if(T===void 0){var x=Object.getPrototypeOf(b);return x===null?void 0:_(x,v,w)}else{if("value"in T)return T.value;var S=T.get;return S===void 0?void 0:S.call(w)}},h=i(0),d=g(h);function g(_){return _&&_.__esModule?_:{default:_}}function p(_,b){if(!(_ instanceof b))throw new TypeError("Cannot call a class as a function")}function a(_,b){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:_}function u(_,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);_.prototype=Object.create(b&&b.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(_,b):_.__proto__=b)}var f=function(_){u(b,_);function b(){return p(this,b),a(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return l(b,[{key:"add",value:function(w,T){if(T==="+1"||T==="-1"){var x=this.value(w)||0;T=T==="+1"?x+1:x-1}return T===0?(this.remove(w),!0):c(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"add",this).call(this,w,T)}},{key:"canAdd",value:function(w,T){return c(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"canAdd",this).call(this,w,T)||c(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"canAdd",this).call(this,w,parseInt(T))}},{key:"value",value:function(w){return parseInt(c(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,w))||void 0}}]),b}(d.default.Attributor.Class),y=new f("indent","ql-indent",{scope:d.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=y},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=i(4),c=h(l);function h(u){return u&&u.__esModule?u:{default:u}}function d(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}function g(u,f){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:u}function p(u,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);u.prototype=Object.create(f&&f.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(u,f):u.__proto__=f)}var a=function(u){p(f,u);function f(){return d(this,f),g(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(c.default);a.blotName="blockquote",a.tagName="blockquote",n.default=a},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function f(y,_){for(var b=0;b<_.length;b++){var v=_[b];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(y,v.key,v)}}return function(y,_,b){return _&&f(y.prototype,_),b&&f(y,b),y}}(),c=i(4),h=d(c);function d(f){return f&&f.__esModule?f:{default:f}}function g(f,y){if(!(f instanceof y))throw new TypeError("Cannot call a class as a function")}function p(f,y){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:f}function a(f,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);f.prototype=Object.create(y&&y.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(f,y):f.__proto__=y)}var u=function(f){a(y,f);function y(){return g(this,y),p(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return l(y,null,[{key:"formats",value:function(b){return this.tagName.indexOf(b.tagName)+1}}]),y}(h.default);u.blotName="header",u.tagName=["H1","H2","H3","H4","H5","H6"],n.default=u},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var l=function(){function x(S,C){for(var A=0;A<C.length;A++){var R=C[A];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(S,R.key,R)}}return function(S,C,A){return C&&x(S.prototype,C),A&&x(S,A),S}}(),c=function x(S,C,A){S===null&&(S=Function.prototype);var R=Object.getOwnPropertyDescriptor(S,C);if(R===void 0){var L=Object.getPrototypeOf(S);return L===null?void 0:x(L,C,A)}else{if("value"in R)return R.value;var M=R.get;return M===void 0?void 0:M.call(A)}},h=i(0),d=f(h),g=i(4),p=f(g),a=i(25),u=f(a);function f(x){return x&&x.__esModule?x:{default:x}}function y(x,S,C){return S in x?Object.defineProperty(x,S,{value:C,enumerable:!0,configurable:!0,writable:!0}):x[S]=C,x}function _(x,S){if(!(x instanceof S))throw new TypeError("Cannot call a class as a function")}function b(x,S){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:x}function v(x,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);x.prototype=Object.create(S&&S.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(x,S):x.__proto__=S)}var w=function(x){v(S,x);function S(){return _(this,S),b(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return l(S,[{key:"format",value:function(A,R){A===T.blotName&&!R?this.replaceWith(d.default.create(this.statics.scope)):c(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"format",this).call(this,A,R)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():c(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(A,R){return this.parent.isolate(this.offset(this.parent),this.length()),A===this.parent.statics.blotName?(this.parent.replaceWith(A,R),this):(this.parent.unwrap(),c(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"replaceWith",this).call(this,A,R))}}],[{key:"formats",value:function(A){return A.tagName===this.tagName?void 0:c(S.__proto__||Object.getPrototypeOf(S),"formats",this).call(this,A)}}]),S}(p.default);w.blotName="list-item",w.tagName="LI";var T=function(x){v(S,x),l(S,null,[{key:"create",value:function(A){var R=A==="ordered"?"OL":"UL",L=c(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,R);return(A==="checked"||A==="unchecked")&&L.setAttribute("data-checked",A==="checked"),L}},{key:"formats",value:function(A){if(A.tagName==="OL")return"ordered";if(A.tagName==="UL")return A.hasAttribute("data-checked")?A.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function S(C){_(this,S);var A=b(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,C)),R=function(M){if(M.target.parentNode===C){var k=A.statics.formats(C),P=d.default.find(M.target);k==="checked"?P.format("list","unchecked"):k==="unchecked"&&P.format("list","checked")}};return C.addEventListener("touchstart",R),C.addEventListener("mousedown",R),A}return l(S,[{key:"format",value:function(A,R){this.children.length>0&&this.children.tail.format(A,R)}},{key:"formats",value:function(){return y({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(A,R){if(A instanceof w)c(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"insertBefore",this).call(this,A,R);else{var L=R==null?this.length():R.offset(this),M=this.split(L);M.parent.insertBefore(A,M)}}},{key:"optimize",value:function(A){c(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"optimize",this).call(this,A);var R=this.next;R!=null&&R.prev===this&&R.statics.blotName===this.statics.blotName&&R.domNode.tagName===this.domNode.tagName&&R.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(R.moveChildren(this),R.remove())}},{key:"replace",value:function(A){if(A.statics.blotName!==this.statics.blotName){var R=d.default.create(this.statics.defaultChild);A.moveChildren(R),this.appendChild(R)}c(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"replace",this).call(this,A)}}]),S}(u.default);T.blotName="list",T.scope=d.default.Scope.BLOCK_BLOT,T.tagName=["OL","UL"],T.defaultChild="list-item",T.allowedChildren=[w],n.ListItem=w,n.default=T},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=i(56),c=h(l);function h(u){return u&&u.__esModule?u:{default:u}}function d(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}function g(u,f){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:u}function p(u,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);u.prototype=Object.create(f&&f.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(u,f):u.__proto__=f)}var a=function(u){p(f,u);function f(){return d(this,f),g(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(c.default);a.blotName="italic",a.tagName=["EM","I"],n.default=a},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function y(_,b){for(var v=0;v<b.length;v++){var w=b[v];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(_,w.key,w)}}return function(_,b,v){return b&&y(_.prototype,b),v&&y(_,v),_}}(),c=function y(_,b,v){_===null&&(_=Function.prototype);var w=Object.getOwnPropertyDescriptor(_,b);if(w===void 0){var T=Object.getPrototypeOf(_);return T===null?void 0:y(T,b,v)}else{if("value"in w)return w.value;var x=w.get;return x===void 0?void 0:x.call(v)}},h=i(6),d=g(h);function g(y){return y&&y.__esModule?y:{default:y}}function p(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function a(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function u(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var f=function(y){u(_,y);function _(){return p(this,_),a(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return l(_,null,[{key:"create",value:function(v){return v==="super"?document.createElement("sup"):v==="sub"?document.createElement("sub"):c(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,v)}},{key:"formats",value:function(v){if(v.tagName==="SUB")return"sub";if(v.tagName==="SUP")return"super"}}]),_}(d.default);f.blotName="script",f.tagName=["SUB","SUP"],n.default=f},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=i(6),c=h(l);function h(u){return u&&u.__esModule?u:{default:u}}function d(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}function g(u,f){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:u}function p(u,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);u.prototype=Object.create(f&&f.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(u,f):u.__proto__=f)}var a=function(u){p(f,u);function f(){return d(this,f),g(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(c.default);a.blotName="strike",a.tagName="S",n.default=a},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=i(6),c=h(l);function h(u){return u&&u.__esModule?u:{default:u}}function d(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}function g(u,f){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:u}function p(u,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);u.prototype=Object.create(f&&f.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(u,f):u.__proto__=f)}var a=function(u){p(f,u);function f(){return d(this,f),g(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(c.default);a.blotName="underline",a.tagName="U",n.default=a},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function b(v,w){for(var T=0;T<w.length;T++){var x=w[T];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,x.key,x)}}return function(v,w,T){return w&&b(v.prototype,w),T&&b(v,T),v}}(),c=function b(v,w,T){v===null&&(v=Function.prototype);var x=Object.getOwnPropertyDescriptor(v,w);if(x===void 0){var S=Object.getPrototypeOf(v);return S===null?void 0:b(S,w,T)}else{if("value"in x)return x.value;var C=x.get;return C===void 0?void 0:C.call(T)}},h=i(0),d=p(h),g=i(27);function p(b){return b&&b.__esModule?b:{default:b}}function a(b,v){if(!(b instanceof v))throw new TypeError("Cannot call a class as a function")}function u(b,v){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:b}function f(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);b.prototype=Object.create(v&&v.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(b,v):b.__proto__=v)}var y=["alt","height","width"],_=function(b){f(v,b);function v(){return a(this,v),u(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return l(v,[{key:"format",value:function(T,x){y.indexOf(T)>-1?x?this.domNode.setAttribute(T,x):this.domNode.removeAttribute(T):c(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,T,x)}}],[{key:"create",value:function(T){var x=c(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,T);return typeof T=="string"&&x.setAttribute("src",this.sanitize(T)),x}},{key:"formats",value:function(T){return y.reduce(function(x,S){return T.hasAttribute(S)&&(x[S]=T.getAttribute(S)),x},{})}},{key:"match",value:function(T){return/\.(jpe?g|gif|png)$/.test(T)||/^data:image\/.+;base64/.test(T)}},{key:"sanitize",value:function(T){return(0,g.sanitize)(T,["http","https","data"])?T:"//:0"}},{key:"value",value:function(T){return T.getAttribute("src")}}]),v}(d.default.Embed);_.blotName="image",_.tagName="IMG",n.default=_},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function b(v,w){for(var T=0;T<w.length;T++){var x=w[T];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,x.key,x)}}return function(v,w,T){return w&&b(v.prototype,w),T&&b(v,T),v}}(),c=function b(v,w,T){v===null&&(v=Function.prototype);var x=Object.getOwnPropertyDescriptor(v,w);if(x===void 0){var S=Object.getPrototypeOf(v);return S===null?void 0:b(S,w,T)}else{if("value"in x)return x.value;var C=x.get;return C===void 0?void 0:C.call(T)}},h=i(4),d=i(27),g=p(d);function p(b){return b&&b.__esModule?b:{default:b}}function a(b,v){if(!(b instanceof v))throw new TypeError("Cannot call a class as a function")}function u(b,v){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:b}function f(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);b.prototype=Object.create(v&&v.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(b,v):b.__proto__=v)}var y=["height","width"],_=function(b){f(v,b);function v(){return a(this,v),u(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return l(v,[{key:"format",value:function(T,x){y.indexOf(T)>-1?x?this.domNode.setAttribute(T,x):this.domNode.removeAttribute(T):c(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,T,x)}}],[{key:"create",value:function(T){var x=c(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,T);return x.setAttribute("frameborder","0"),x.setAttribute("allowfullscreen",!0),x.setAttribute("src",this.sanitize(T)),x}},{key:"formats",value:function(T){return y.reduce(function(x,S){return T.hasAttribute(S)&&(x[S]=T.getAttribute(S)),x},{})}},{key:"sanitize",value:function(T){return g.default.sanitize(T)}},{key:"value",value:function(T){return T.getAttribute("src")}}]),v}(h.BlockEmbed);_.blotName="video",_.className="ql-video",_.tagName="IFRAME",n.default=_},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var l=function(){function T(x,S){for(var C=0;C<S.length;C++){var A=S[C];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(x,A.key,A)}}return function(x,S,C){return S&&T(x.prototype,S),C&&T(x,C),x}}(),c=function T(x,S,C){x===null&&(x=Function.prototype);var A=Object.getOwnPropertyDescriptor(x,S);if(A===void 0){var R=Object.getPrototypeOf(x);return R===null?void 0:T(R,S,C)}else{if("value"in A)return A.value;var L=A.get;return L===void 0?void 0:L.call(C)}},h=i(35),d=f(h),g=i(5),p=f(g),a=i(9),u=f(a);function f(T){return T&&T.__esModule?T:{default:T}}function y(T,x){if(!(T instanceof x))throw new TypeError("Cannot call a class as a function")}function _(T,x){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:T}function b(T,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);T.prototype=Object.create(x&&x.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(T,x):T.__proto__=x)}var v=function(T){b(x,T);function x(){return y(this,x),_(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return l(x,null,[{key:"create",value:function(C){var A=c(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,C);return typeof C=="string"&&(window.katex.render(C,A,{throwOnError:!1,errorColor:"#f00"}),A.setAttribute("data-value",C)),A}},{key:"value",value:function(C){return C.getAttribute("data-value")}}]),x}(d.default);v.blotName="formula",v.className="ql-formula",v.tagName="SPAN";var w=function(T){b(x,T),l(x,null,[{key:"register",value:function(){p.default.register(v,!0)}}]);function x(){y(this,x);var S=_(this,(x.__proto__||Object.getPrototypeOf(x)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return S}return x}(u.default);n.FormulaBlot=v,n.default=w},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var l=function(){function C(A,R){for(var L=0;L<R.length;L++){var M=R[L];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(A,M.key,M)}}return function(A,R,L){return R&&C(A.prototype,R),L&&C(A,L),A}}(),c=function C(A,R,L){A===null&&(A=Function.prototype);var M=Object.getOwnPropertyDescriptor(A,R);if(M===void 0){var k=Object.getPrototypeOf(A);return k===null?void 0:C(k,R,L)}else{if("value"in M)return M.value;var P=M.get;return P===void 0?void 0:P.call(L)}},h=i(0),d=_(h),g=i(5),p=_(g),a=i(9),u=_(a),f=i(13),y=_(f);function _(C){return C&&C.__esModule?C:{default:C}}function b(C,A){if(!(C instanceof A))throw new TypeError("Cannot call a class as a function")}function v(C,A){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:C}function w(C,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);C.prototype=Object.create(A&&A.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(C,A):C.__proto__=A)}var T=function(C){w(A,C);function A(){return b(this,A),v(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}return l(A,[{key:"replaceWith",value:function(L){this.domNode.textContent=this.domNode.textContent,this.attach(),c(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"replaceWith",this).call(this,L)}},{key:"highlight",value:function(L){var M=this.domNode.textContent;this.cachedText!==M&&((M.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=L(M),this.domNode.normalize(),this.attach()),this.cachedText=M)}}]),A}(y.default);T.className="ql-syntax";var x=new d.default.Attributor.Class("token","hljs",{scope:d.default.Scope.INLINE}),S=function(C){w(A,C),l(A,null,[{key:"register",value:function(){p.default.register(x,!0),p.default.register(T,!0)}}]);function A(R,L){b(this,A);var M=v(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,R,L));if(typeof M.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var k=null;return M.quill.on(p.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(k),k=setTimeout(function(){M.highlight(),k=null},M.options.interval)}),M.highlight(),M}return l(A,[{key:"highlight",value:function(){var L=this;if(!this.quill.selection.composing){this.quill.update(p.default.sources.USER);var M=this.quill.getSelection();this.quill.scroll.descendants(T).forEach(function(k){k.highlight(L.options.highlight)}),this.quill.update(p.default.sources.SILENT),M!=null&&this.quill.setSelection(M,p.default.sources.SILENT)}}}]),A}(u.default);S.DEFAULTS={highlight:function(){return window.hljs==null?null:function(C){var A=window.hljs.highlightAuto(C);return A.value}}(),interval:1e3},n.CodeBlock=T,n.CodeToken=x,n.default=S},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(e,n){e.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(e,n){e.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(e,n){e.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(e,n){e.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(e,n){e.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(e,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var l=function A(R,L,M){R===null&&(R=Function.prototype);var k=Object.getOwnPropertyDescriptor(R,L);if(k===void 0){var P=Object.getPrototypeOf(R);return P===null?void 0:A(P,L,M)}else{if("value"in k)return k.value;var I=k.get;return I===void 0?void 0:I.call(M)}},c=function(){function A(R,L){for(var M=0;M<L.length;M++){var k=L[M];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(R,k.key,k)}}return function(R,L,M){return L&&A(R.prototype,L),M&&A(R,M),R}}(),h=i(3),d=b(h),g=i(8),p=b(g),a=i(43),u=b(a),f=i(15),y=i(41),_=b(y);function b(A){return A&&A.__esModule?A:{default:A}}function v(A,R){if(!(A instanceof R))throw new TypeError("Cannot call a class as a function")}function w(A,R){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:A}function T(A,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);A.prototype=Object.create(R&&R.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(A,R):A.__proto__=R)}var x=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],S=function(A){T(R,A);function R(L,M){v(this,R),M.modules.toolbar!=null&&M.modules.toolbar.container==null&&(M.modules.toolbar.container=x);var k=w(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,L,M));return k.quill.container.classList.add("ql-bubble"),k}return c(R,[{key:"extendToolbar",value:function(M){this.tooltip=new C(this.quill,this.options.bounds),this.tooltip.root.appendChild(M.container),this.buildButtons([].slice.call(M.container.querySelectorAll("button")),_.default),this.buildPickers([].slice.call(M.container.querySelectorAll("select")),_.default)}}]),R}(u.default);S.DEFAULTS=(0,d.default)(!0,{},u.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(R){R?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var C=function(A){T(R,A);function R(L,M){v(this,R);var k=w(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,L,M));return k.quill.on(p.default.events.EDITOR_CHANGE,function(P,I,j,W){if(P===p.default.events.SELECTION_CHANGE)if(I!=null&&I.length>0&&W===p.default.sources.USER){k.show(),k.root.style.left="0px",k.root.style.width="",k.root.style.width=k.root.offsetWidth+"px";var J=k.quill.getLines(I.index,I.length);if(J.length===1)k.position(k.quill.getBounds(I));else{var ee=J[J.length-1],oe=k.quill.getIndex(ee),V=Math.min(ee.length()-1,I.index+I.length-oe),$=k.quill.getBounds(new f.Range(oe,V));k.position($)}}else document.activeElement!==k.textbox&&k.quill.hasFocus()&&k.hide()}),k}return c(R,[{key:"listen",value:function(){var M=this;l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){M.root.classList.remove("ql-editing")}),this.quill.on(p.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!M.root.classList.contains("ql-hidden")){var k=M.quill.getSelection();k!=null&&M.position(M.quill.getBounds(k))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(M){var k=l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"position",this).call(this,M),P=this.root.querySelector(".ql-tooltip-arrow");if(P.style.marginLeft="",k===0)return k;P.style.marginLeft=-1*k-P.offsetWidth/2+"px"}}]),R}(a.BaseTooltip);C.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),n.BubbleTooltip=C,n.default=S},function(e,n,i){e.exports=i(63)}]).default})})(XE);var Jn=-1,$n=1,gn=0;function ma(r,t,e,n){if(r===t)return r?[[gn,r]]:[];if(e!=null){var i=tA(r,t,e);if(i)return i}var l=vc(r,t),c=r.substring(0,l);r=r.substring(l),t=t.substring(l),l=yc(r,t);var h=r.substring(r.length-l);r=r.substring(0,r.length-l),t=t.substring(0,t.length-l);var d=ZE(r,t);return c&&d.unshift([gn,c]),h&&d.push([gn,h]),Eg(d,n),d}function ZE(r,t){var e;if(!r)return[[$n,t]];if(!t)return[[Jn,r]];var n=r.length>t.length?r:t,i=r.length>t.length?t:r,l=n.indexOf(i);if(l!==-1)return e=[[$n,n.substring(0,l)],[gn,i],[$n,n.substring(l+i.length)]],r.length>t.length&&(e[0][0]=e[2][0]=Jn),e;if(i.length===1)return[[Jn,r],[$n,t]];var c=JE(r,t);if(c){var h=c[0],d=c[1],g=c[2],p=c[3],a=c[4],u=ma(h,g),f=ma(d,p);return u.concat([[gn,a]],f)}return QE(r,t)}function QE(r,t){for(var e=r.length,n=t.length,i=Math.ceil((e+n)/2),l=i,c=2*i,h=new Array(c),d=new Array(c),g=0;g<c;g++)h[g]=-1,d[g]=-1;h[l+1]=0,d[l+1]=0;for(var p=e-n,a=p%2!==0,u=0,f=0,y=0,_=0,b=0;b<i;b++){for(var v=-b+u;v<=b-f;v+=2){var w=l+v,T;v===-b||v!==b&&h[w-1]<h[w+1]?T=h[w+1]:T=h[w-1]+1;for(var x=T-v;T<e&&x<n&&r.charAt(T)===t.charAt(x);)T++,x++;if(h[w]=T,T>e)f+=2;else if(x>n)u+=2;else if(a){var S=l+p-v;if(S>=0&&S<c&&d[S]!==-1){var C=e-d[S];if(T>=C)return dd(r,t,T,x)}}}for(var A=-b+y;A<=b-_;A+=2){var S=l+A,C;A===-b||A!==b&&d[S-1]<d[S+1]?C=d[S+1]:C=d[S-1]+1;for(var R=C-A;C<e&&R<n&&r.charAt(e-C-1)===t.charAt(n-R-1);)C++,R++;if(d[S]=C,C>e)_+=2;else if(R>n)y+=2;else if(!a){var w=l+p-A;if(w>=0&&w<c&&h[w]!==-1){var T=h[w],x=l+T-w;if(C=e-C,T>=C)return dd(r,t,T,x)}}}}return[[Jn,r],[$n,t]]}function dd(r,t,e,n){var i=r.substring(0,e),l=t.substring(0,n),c=r.substring(e),h=t.substring(n),d=ma(i,l),g=ma(c,h);return d.concat(g)}function vc(r,t){if(!r||!t||r.charAt(0)!==t.charAt(0))return 0;for(var e=0,n=Math.min(r.length,t.length),i=n,l=0;e<i;)r.substring(l,i)==t.substring(l,i)?(e=i,l=e):n=i,i=Math.floor((n-e)/2+e);return Ag(r.charCodeAt(i-1))&&i--,i}function yc(r,t){if(!r||!t||r.slice(-1)!==t.slice(-1))return 0;for(var e=0,n=Math.min(r.length,t.length),i=n,l=0;e<i;)r.substring(r.length-i,r.length-l)==t.substring(t.length-i,t.length-l)?(e=i,l=e):n=i,i=Math.floor((n-e)/2+e);return Cg(r.charCodeAt(r.length-i))&&i--,i}function JE(r,t){var e=r.length>t.length?r:t,n=r.length>t.length?t:r;if(e.length<4||n.length*2<e.length)return null;function i(f,y,_){for(var b=f.substring(_,_+Math.floor(f.length/4)),v=-1,w="",T,x,S,C;(v=y.indexOf(b,v+1))!==-1;){var A=vc(f.substring(_),y.substring(v)),R=yc(f.substring(0,_),y.substring(0,v));w.length<R+A&&(w=y.substring(v-R,v)+y.substring(v,v+A),T=f.substring(0,_-R),x=f.substring(_+A),S=y.substring(0,v-R),C=y.substring(v+A))}return w.length*2>=f.length?[T,x,S,C,w]:null}var l=i(e,n,Math.ceil(e.length/4)),c=i(e,n,Math.ceil(e.length/2)),h;if(!l&&!c)return null;c?l?h=l[4].length>c[4].length?l:c:h=c:h=l;var d,g,p,a;r.length>t.length?(d=h[0],g=h[1],p=h[2],a=h[3]):(p=h[0],a=h[1],d=h[2],g=h[3]);var u=h[4];return[d,g,p,a,u]}function Eg(r,t){r.push([gn,""]);for(var e=0,n=0,i=0,l="",c="",h;e<r.length;){if(e<r.length-1&&!r[e][1]){r.splice(e,1);continue}switch(r[e][0]){case $n:i++,c+=r[e][1],e++;break;case Jn:n++,l+=r[e][1],e++;break;case gn:var d=e-i-n-1;if(t){if(d>=0&&Pg(r[d][1])){var g=r[d][1].slice(-1);if(r[d][1]=r[d][1].slice(0,-1),l=g+l,c=g+c,!r[d][1]){r.splice(d,1),e--;var p=d-1;r[p]&&r[p][0]===$n&&(i++,c=r[p][1]+c,p--),r[p]&&r[p][0]===Jn&&(n++,l=r[p][1]+l,p--),d=p}}if(kg(r[e][1])){var g=r[e][1].charAt(0);r[e][1]=r[e][1].slice(1),l+=g,c+=g}}if(e<r.length-1&&!r[e][1]){r.splice(e,1);break}if(l.length>0||c.length>0){l.length>0&&c.length>0&&(h=vc(c,l),h!==0&&(d>=0?r[d][1]+=c.substring(0,h):(r.splice(0,0,[gn,c.substring(0,h)]),e++),c=c.substring(h),l=l.substring(h)),h=yc(c,l),h!==0&&(r[e][1]=c.substring(c.length-h)+r[e][1],c=c.substring(0,c.length-h),l=l.substring(0,l.length-h)));var a=i+n;l.length===0&&c.length===0?(r.splice(e-a,a),e=e-a):l.length===0?(r.splice(e-a,a,[$n,c]),e=e-a+1):c.length===0?(r.splice(e-a,a,[Jn,l]),e=e-a+1):(r.splice(e-a,a,[Jn,l],[$n,c]),e=e-a+2)}e!==0&&r[e-1][0]===gn?(r[e-1][1]+=r[e][1],r.splice(e,1)):e++,i=0,n=0,l="",c="";break}}r[r.length-1][1]===""&&r.pop();var u=!1;for(e=1;e<r.length-1;)r[e-1][0]===gn&&r[e+1][0]===gn&&(r[e][1].substring(r[e][1].length-r[e-1][1].length)===r[e-1][1]?(r[e][1]=r[e-1][1]+r[e][1].substring(0,r[e][1].length-r[e-1][1].length),r[e+1][1]=r[e-1][1]+r[e+1][1],r.splice(e-1,1),u=!0):r[e][1].substring(0,r[e+1][1].length)==r[e+1][1]&&(r[e-1][1]+=r[e+1][1],r[e][1]=r[e][1].substring(r[e+1][1].length)+r[e+1][1],r.splice(e+1,1),u=!0)),e++;u&&Eg(r,t)}function Ag(r){return r>=55296&&r<=56319}function Cg(r){return r>=56320&&r<=57343}function kg(r){return Cg(r.charCodeAt(0))}function Pg(r){return Ag(r.charCodeAt(r.length-1))}function eA(r){for(var t=[],e=0;e<r.length;e++)r[e][1].length>0&&t.push(r[e]);return t}function _u(r,t,e,n){return Pg(r)||kg(n)?null:eA([[gn,r],[Jn,t],[$n,e],[gn,n]])}function tA(r,t,e){var n=typeof e=="number"?{index:e,length:0}:e.oldRange,i=typeof e=="number"?null:e.newRange,l=r.length,c=t.length;if(n.length===0&&(i===null||i.length===0)){var h=n.index,d=r.slice(0,h),g=r.slice(h),p=i?i.index:null;e:{var a=h+c-l;if(p!==null&&p!==a||a<0||a>c)break e;var u=t.slice(0,a),f=t.slice(a);if(f!==g)break e;var y=Math.min(h,a),_=d.slice(0,y),b=u.slice(0,y);if(_!==b)break e;var v=d.slice(y),w=u.slice(y);return _u(_,v,w,g)}e:{if(p!==null&&p!==h)break e;var T=h,u=t.slice(0,T),f=t.slice(T);if(u!==d)break e;var x=Math.min(l-T,c-T),S=g.slice(g.length-x),C=f.slice(f.length-x);if(S!==C)break e;var v=g.slice(0,g.length-x),w=f.slice(0,f.length-x);return _u(d,v,w,S)}}if(n.length>0&&i&&i.length===0)e:{var _=r.slice(0,n.index),S=r.slice(n.index+n.length),y=_.length,x=S.length;if(c<y+x)break e;var b=t.slice(0,y),C=t.slice(c-x);if(_!==b||S!==C)break e;var v=r.slice(y,l-x),w=t.slice(y,c-x);return _u(_,v,w,S)}return null}function nl(r,t,e){return ma(r,t,e,!0)}nl.INSERT=$n;nl.DELETE=Jn;nl.EQUAL=gn;var nA=nl,qs={exports:{}};qs.exports;(function(r,t){var e=200,n="__lodash_hash_undefined__",i=9007199254740991,l="[object Arguments]",c="[object Array]",h="[object Boolean]",d="[object Date]",g="[object Error]",p="[object Function]",a="[object GeneratorFunction]",u="[object Map]",f="[object Number]",y="[object Object]",_="[object Promise]",b="[object RegExp]",v="[object Set]",w="[object String]",T="[object Symbol]",x="[object WeakMap]",S="[object ArrayBuffer]",C="[object DataView]",A="[object Float32Array]",R="[object Float64Array]",L="[object Int8Array]",M="[object Int16Array]",k="[object Int32Array]",P="[object Uint8Array]",I="[object Uint8ClampedArray]",j="[object Uint16Array]",W="[object Uint32Array]",J=/[\\^$.*+?()[\]{}|]/g,ee=/\w*$/,oe=/^\[object .+?Constructor\]$/,V=/^(?:0|[1-9]\d*)$/,$={};$[l]=$[c]=$[S]=$[C]=$[h]=$[d]=$[A]=$[R]=$[L]=$[M]=$[k]=$[u]=$[f]=$[y]=$[b]=$[v]=$[w]=$[T]=$[P]=$[I]=$[j]=$[W]=!0,$[g]=$[p]=$[x]=!1;var N=typeof bt=="object"&&bt&&bt.Object===Object&&bt,H=typeof self=="object"&&self&&self.Object===Object&&self,G=N||H||Function("return this")(),ne=t&&!t.nodeType&&t,X=ne&&!0&&r&&!r.nodeType&&r,U=X&&X.exports===ne;function Q(E,F){return E.set(F[0],F[1]),E}function ie(E,F){return E.add(F),E}function ae(E,F){for(var K=-1,ce=E?E.length:0;++K<ce&&F(E[K],K,E)!==!1;);return E}function de(E,F){for(var K=-1,ce=F.length,Ue=E.length;++K<ce;)E[Ue+K]=F[K];return E}function we(E,F,K,ce){for(var Ue=-1,Re=E?E.length:0;++Ue<Re;)K=F(K,E[Ue],Ue,E);return K}function Pe(E,F){for(var K=-1,ce=Array(E);++K<E;)ce[K]=F(K);return ce}function Me(E,F){return E==null?void 0:E[F]}function De(E){var F=!1;if(E!=null&&typeof E.toString!="function")try{F=!!(E+"")}catch(K){}return F}function ze(E){var F=-1,K=Array(E.size);return E.forEach(function(ce,Ue){K[++F]=[Ue,ce]}),K}function xt(E,F){return function(K){return E(F(K))}}function Je(E){var F=-1,K=Array(E.size);return E.forEach(function(ce){K[++F]=ce}),K}var le=Array.prototype,he=Function.prototype,_e=Object.prototype,be=G["__core-js_shared__"],ve=function(){var E=/[^.]+$/.exec(be&&be.keys&&be.keys.IE_PROTO||"");return E?"Symbol(src)_1."+E:""}(),Be=he.toString,Le=_e.hasOwnProperty,Ee=_e.toString,$e=RegExp("^"+Be.call(Le).replace(J,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vt=U?G.Buffer:void 0,Ve=G.Symbol,nn=G.Uint8Array,z=xt(Object.getPrototypeOf,Object),ue=Object.create,pe=_e.propertyIsEnumerable,Te=le.splice,Ae=Object.getOwnPropertySymbols,Ie=vt?vt.isBuffer:void 0,at=xt(Object.keys,Object),wt=rn(G,"DataView"),Ze=rn(G,"Map"),yt=rn(G,"Promise"),Ht=rn(G,"Set"),Kt=rn(G,"WeakMap"),Wn=rn(Object,"create"),zr=Wt(wt),ir=Wt(Ze),Gr=Wt(yt),Yr=Wt(Ht),br=Wt(Kt),zn=Ve?Ve.prototype:void 0,Si=zn?zn.valueOf:void 0;function Ln(E){var F=-1,K=E?E.length:0;for(this.clear();++F<K;){var ce=E[F];this.set(ce[0],ce[1])}}function Vr(){this.__data__=Wn?Wn(null):{}}function po(E){return this.has(E)&&delete this.__data__[E]}function Kr(E){var F=this.__data__;if(Wn){var K=F[E];return K===n?void 0:K}return Le.call(F,E)?F[E]:void 0}function Oi(E){var F=this.__data__;return Wn?F[E]!==void 0:Le.call(F,E)}function Xr(E,F){var K=this.__data__;return K[E]=Wn&&F===void 0?n:F,this}Ln.prototype.clear=Vr,Ln.prototype.delete=po,Ln.prototype.get=Kr,Ln.prototype.has=Oi,Ln.prototype.set=Xr;function Nt(E){var F=-1,K=E?E.length:0;for(this.clear();++F<K;){var ce=E[F];this.set(ce[0],ce[1])}}function go(){this.__data__=[]}function mo(E){var F=this.__data__,K=or(F,E);if(K<0)return!1;var ce=F.length-1;return K==ce?F.pop():Te.call(F,K,1),!0}function vo(E){var F=this.__data__,K=or(F,E);return K<0?void 0:F[K][1]}function yo(E){return or(this.__data__,E)>-1}function _o(E,F){var K=this.__data__,ce=or(K,E);return ce<0?K.push([E,F]):K[ce][1]=F,this}Nt.prototype.clear=go,Nt.prototype.delete=mo,Nt.prototype.get=vo,Nt.prototype.has=yo,Nt.prototype.set=_o;function Bt(E){var F=-1,K=E?E.length:0;for(this.clear();++F<K;){var ce=E[F];this.set(ce[0],ce[1])}}function bo(){this.__data__={hash:new Ln,map:new(Ze||Nt),string:new Ln}}function wo(E){return In(this,E).delete(E)}function xo(E){return In(this,E).get(E)}function To(E){return In(this,E).has(E)}function So(E,F){return In(this,E).set(E,F),this}Bt.prototype.clear=bo,Bt.prototype.delete=wo,Bt.prototype.get=xo,Bt.prototype.has=To,Bt.prototype.set=So;function Xt(E){this.__data__=new Nt(E)}function wr(){this.__data__=new Nt}function Oo(E){return this.__data__.delete(E)}function xr(E){return this.__data__.get(E)}function Eo(E){return this.__data__.has(E)}function Ao(E,F){var K=this.__data__;if(K instanceof Nt){var ce=K.__data__;if(!Ze||ce.length<e-1)return ce.push([E,F]),this;K=this.__data__=new Bt(ce)}return K.set(E,F),this}Xt.prototype.clear=wr,Xt.prototype.delete=Oo,Xt.prototype.get=xr,Xt.prototype.has=Eo,Xt.prototype.set=Ao;function Tr(E,F){var K=ti(E)||Sr(E)?Pe(E.length,String):[],ce=K.length,Ue=!!ce;for(var Re in E)Le.call(E,Re)&&!(Ue&&(Re=="length"||Li(Re,ce)))&&K.push(Re);return K}function Zr(E,F,K){var ce=E[F];(!(Le.call(E,F)&&ei(ce,K))||K===void 0&&!(F in E))&&(E[F]=K)}function or(E,F){for(var K=E.length;K--;)if(ei(E[K][0],F))return K;return-1}function mn(E,F){return E&&cr(F,ri(F),E)}function Qr(E,F,K,ce,Ue,Re,nt){var rt;if(ce&&(rt=Re?ce(E,Ue,Re,nt):ce(E)),rt!==void 0)return rt;if(!On(E))return E;var Xe=ti(E);if(Xe){if(rt=Mi(E),!F)return Pi(E,rt)}else{var ot=Tn(E),Tt=ot==p||ot==a;if(Er(E))return ar(E,F);if(ot==y||ot==l||Tt&&!Re){if(De(E))return Re?E:{};if(rt=Sn(Tt?{}:E),!F)return Mo(E,mn(rt,E))}else{if(!$[ot])return Re?E:{};rt=Di(E,ot,Qr,F)}}nt||(nt=new Xt);var zt=nt.get(E);if(zt)return zt;if(nt.set(E,rt),!Xe)var Ot=K?Ri(E):ri(E);return ae(Ot||E,function(dt,Lt){Ot&&(Lt=dt,dt=E[Lt]),Zr(rt,Lt,Qr(dt,F,K,ce,Lt,E,nt))}),rt}function Co(E){return On(E)?ue(E):{}}function ko(E,F,K){var ce=F(E);return ti(E)?ce:de(ce,K(E))}function Po(E){return Ee.call(E)}function Ei(E){if(!On(E)||Ni(E))return!1;var F=ni(E)||De(E)?$e:oe;return F.test(Wt(E))}function Ai(E){if(!Bi(E))return at(E);var F=[];for(var K in Object(E))Le.call(E,K)&&K!="constructor"&&F.push(K);return F}function ar(E,F){if(F)return E.slice();var K=new E.constructor(E.length);return E.copy(K),K}function sr(E){var F=new E.constructor(E.byteLength);return new nn(F).set(new nn(E)),F}function lr(E,F){var K=F?sr(E.buffer):E.buffer;return new E.constructor(K,E.byteOffset,E.byteLength)}function Jr(E,F,K){var ce=F?K(ze(E),!0):ze(E);return we(ce,Q,new E.constructor)}function ur(E){var F=new E.constructor(E.source,ee.exec(E));return F.lastIndex=E.lastIndex,F}function Ci(E,F,K){var ce=F?K(Je(E),!0):Je(E);return we(ce,ie,new E.constructor)}function Ro(E){return Si?Object(Si.call(E)):{}}function ki(E,F){var K=F?sr(E.buffer):E.buffer;return new E.constructor(K,E.byteOffset,E.length)}function Pi(E,F){var K=-1,ce=E.length;for(F||(F=Array(ce));++K<ce;)F[K]=E[K];return F}function cr(E,F,K,ce){K||(K={});for(var Ue=-1,Re=F.length;++Ue<Re;){var nt=F[Ue],rt=void 0;Zr(K,nt,rt===void 0?E[nt]:rt)}return K}function Mo(E,F){return cr(E,Zt(E),F)}function Ri(E){return ko(E,ri,Zt)}function In(E,F){var K=E.__data__;return Ii(F)?K[typeof F=="string"?"string":"hash"]:K.map}function rn(E,F){var K=Me(E,F);return Ei(K)?K:void 0}var Zt=Ae?xt(Ae,Object):ht,Tn=Po;(wt&&Tn(new wt(new ArrayBuffer(1)))!=C||Ze&&Tn(new Ze)!=u||yt&&Tn(yt.resolve())!=_||Ht&&Tn(new Ht)!=v||Kt&&Tn(new Kt)!=x)&&(Tn=function(E){var F=Ee.call(E),K=F==y?E.constructor:void 0,ce=K?Wt(K):void 0;if(ce)switch(ce){case zr:return C;case ir:return u;case Gr:return _;case Yr:return v;case br:return x}return F});function Mi(E){var F=E.length,K=E.constructor(F);return F&&typeof E[0]=="string"&&Le.call(E,"index")&&(K.index=E.index,K.input=E.input),K}function Sn(E){return typeof E.constructor=="function"&&!Bi(E)?Co(z(E)):{}}function Di(E,F,K,ce){var Ue=E.constructor;switch(F){case S:return sr(E);case h:case d:return new Ue(+E);case C:return lr(E,ce);case A:case R:case L:case M:case k:case P:case I:case j:case W:return ki(E,ce);case u:return Jr(E,ce,K);case f:case w:return new Ue(E);case b:return ur(E);case v:return Ci(E,ce,K);case T:return Ro(E)}}function Li(E,F){return F=F==null?i:F,!!F&&(typeof E=="number"||V.test(E))&&E>-1&&E%1==0&&E<F}function Ii(E){var F=typeof E;return F=="string"||F=="number"||F=="symbol"||F=="boolean"?E!=="__proto__":E===null}function Ni(E){return!!ve&&ve in E}function Bi(E){var F=E&&E.constructor,K=typeof F=="function"&&F.prototype||_e;return E===K}function Wt(E){if(E!=null){try{return Be.call(E)}catch(F){}try{return E+""}catch(F){}}return""}function Fi(E){return Qr(E,!0,!0)}function ei(E,F){return E===F||E!==E&&F!==F}function Sr(E){return Do(E)&&Le.call(E,"callee")&&(!pe.call(E,"callee")||Ee.call(E)==l)}var ti=Array.isArray;function Or(E){return E!=null&&qi(E.length)&&!ni(E)}function Do(E){return ji(E)&&Or(E)}var Er=Ie||ct;function ni(E){var F=On(E)?Ee.call(E):"";return F==p||F==a}function qi(E){return typeof E=="number"&&E>-1&&E%1==0&&E<=i}function On(E){var F=typeof E;return!!E&&(F=="object"||F=="function")}function ji(E){return!!E&&typeof E=="object"}function ri(E){return Or(E)?Tr(E):Ai(E)}function ht(){return[]}function ct(){return!1}r.exports=Fi})(qs,qs.exports);var Rg=qs.exports,js={exports:{}};js.exports;(function(r,t){var e=200,n="__lodash_hash_undefined__",i=1,l=2,c=9007199254740991,h="[object Arguments]",d="[object Array]",g="[object AsyncFunction]",p="[object Boolean]",a="[object Date]",u="[object Error]",f="[object Function]",y="[object GeneratorFunction]",_="[object Map]",b="[object Number]",v="[object Null]",w="[object Object]",T="[object Promise]",x="[object Proxy]",S="[object RegExp]",C="[object Set]",A="[object String]",R="[object Symbol]",L="[object Undefined]",M="[object WeakMap]",k="[object ArrayBuffer]",P="[object DataView]",I="[object Float32Array]",j="[object Float64Array]",W="[object Int8Array]",J="[object Int16Array]",ee="[object Int32Array]",oe="[object Uint8Array]",V="[object Uint8ClampedArray]",$="[object Uint16Array]",N="[object Uint32Array]",H=/[\\^$.*+?()[\]{}|]/g,G=/^\[object .+?Constructor\]$/,ne=/^(?:0|[1-9]\d*)$/,X={};X[I]=X[j]=X[W]=X[J]=X[ee]=X[oe]=X[V]=X[$]=X[N]=!0,X[h]=X[d]=X[k]=X[p]=X[P]=X[a]=X[u]=X[f]=X[_]=X[b]=X[w]=X[S]=X[C]=X[A]=X[M]=!1;var U=typeof bt=="object"&&bt&&bt.Object===Object&&bt,Q=typeof self=="object"&&self&&self.Object===Object&&self,ie=U||Q||Function("return this")(),ae=t&&!t.nodeType&&t,de=ae&&!0&&r&&!r.nodeType&&r,we=de&&de.exports===ae,Pe=we&&U.process,Me=function(){try{return Pe&&Pe.binding&&Pe.binding("util")}catch(E){}}(),De=Me&&Me.isTypedArray;function ze(E,F){for(var K=-1,ce=E==null?0:E.length,Ue=0,Re=[];++K<ce;){var nt=E[K];F(nt,K,E)&&(Re[Ue++]=nt)}return Re}function xt(E,F){for(var K=-1,ce=F.length,Ue=E.length;++K<ce;)E[Ue+K]=F[K];return E}function Je(E,F){for(var K=-1,ce=E==null?0:E.length;++K<ce;)if(F(E[K],K,E))return!0;return!1}function le(E,F){for(var K=-1,ce=Array(E);++K<E;)ce[K]=F(K);return ce}function he(E){return function(F){return E(F)}}function _e(E,F){return E.has(F)}function be(E,F){return E==null?void 0:E[F]}function ve(E){var F=-1,K=Array(E.size);return E.forEach(function(ce,Ue){K[++F]=[Ue,ce]}),K}function Be(E,F){return function(K){return E(F(K))}}function Le(E){var F=-1,K=Array(E.size);return E.forEach(function(ce){K[++F]=ce}),K}var Ee=Array.prototype,$e=Function.prototype,vt=Object.prototype,Ve=ie["__core-js_shared__"],nn=$e.toString,z=vt.hasOwnProperty,ue=function(){var E=/[^.]+$/.exec(Ve&&Ve.keys&&Ve.keys.IE_PROTO||"");return E?"Symbol(src)_1."+E:""}(),pe=vt.toString,Te=RegExp("^"+nn.call(z).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ae=we?ie.Buffer:void 0,Ie=ie.Symbol,at=ie.Uint8Array,wt=vt.propertyIsEnumerable,Ze=Ee.splice,yt=Ie?Ie.toStringTag:void 0,Ht=Object.getOwnPropertySymbols,Kt=Ae?Ae.isBuffer:void 0,Wn=Be(Object.keys,Object),zr=Zt(ie,"DataView"),ir=Zt(ie,"Map"),Gr=Zt(ie,"Promise"),Yr=Zt(ie,"Set"),br=Zt(ie,"WeakMap"),zn=Zt(Object,"create"),Si=Wt(zr),Ln=Wt(ir),Vr=Wt(Gr),po=Wt(Yr),Kr=Wt(br),Oi=Ie?Ie.prototype:void 0,Xr=Oi?Oi.valueOf:void 0;function Nt(E){var F=-1,K=E==null?0:E.length;for(this.clear();++F<K;){var ce=E[F];this.set(ce[0],ce[1])}}function go(){this.__data__=zn?zn(null):{},this.size=0}function mo(E){var F=this.has(E)&&delete this.__data__[E];return this.size-=F?1:0,F}function vo(E){var F=this.__data__;if(zn){var K=F[E];return K===n?void 0:K}return z.call(F,E)?F[E]:void 0}function yo(E){var F=this.__data__;return zn?F[E]!==void 0:z.call(F,E)}function _o(E,F){var K=this.__data__;return this.size+=this.has(E)?0:1,K[E]=zn&&F===void 0?n:F,this}Nt.prototype.clear=go,Nt.prototype.delete=mo,Nt.prototype.get=vo,Nt.prototype.has=yo,Nt.prototype.set=_o;function Bt(E){var F=-1,K=E==null?0:E.length;for(this.clear();++F<K;){var ce=E[F];this.set(ce[0],ce[1])}}function bo(){this.__data__=[],this.size=0}function wo(E){var F=this.__data__,K=ar(F,E);if(K<0)return!1;var ce=F.length-1;return K==ce?F.pop():Ze.call(F,K,1),--this.size,!0}function xo(E){var F=this.__data__,K=ar(F,E);return K<0?void 0:F[K][1]}function To(E){return ar(this.__data__,E)>-1}function So(E,F){var K=this.__data__,ce=ar(K,E);return ce<0?(++this.size,K.push([E,F])):K[ce][1]=F,this}Bt.prototype.clear=bo,Bt.prototype.delete=wo,Bt.prototype.get=xo,Bt.prototype.has=To,Bt.prototype.set=So;function Xt(E){var F=-1,K=E==null?0:E.length;for(this.clear();++F<K;){var ce=E[F];this.set(ce[0],ce[1])}}function wr(){this.size=0,this.__data__={hash:new Nt,map:new(ir||Bt),string:new Nt}}function Oo(E){var F=rn(this,E).delete(E);return this.size-=F?1:0,F}function xr(E){return rn(this,E).get(E)}function Eo(E){return rn(this,E).has(E)}function Ao(E,F){var K=rn(this,E),ce=K.size;return K.set(E,F),this.size+=K.size==ce?0:1,this}Xt.prototype.clear=wr,Xt.prototype.delete=Oo,Xt.prototype.get=xr,Xt.prototype.has=Eo,Xt.prototype.set=Ao;function Tr(E){var F=-1,K=E==null?0:E.length;for(this.__data__=new Xt;++F<K;)this.add(E[F])}function Zr(E){return this.__data__.set(E,n),this}function or(E){return this.__data__.has(E)}Tr.prototype.add=Tr.prototype.push=Zr,Tr.prototype.has=or;function mn(E){var F=this.__data__=new Bt(E);this.size=F.size}function Qr(){this.__data__=new Bt,this.size=0}function Co(E){var F=this.__data__,K=F.delete(E);return this.size=F.size,K}function ko(E){return this.__data__.get(E)}function Po(E){return this.__data__.has(E)}function Ei(E,F){var K=this.__data__;if(K instanceof Bt){var ce=K.__data__;if(!ir||ce.length<e-1)return ce.push([E,F]),this.size=++K.size,this;K=this.__data__=new Xt(ce)}return K.set(E,F),this.size=K.size,this}mn.prototype.clear=Qr,mn.prototype.delete=Co,mn.prototype.get=ko,mn.prototype.has=Po,mn.prototype.set=Ei;function Ai(E,F){var K=Sr(E),ce=!K&&ei(E),Ue=!K&&!ce&&Or(E),Re=!K&&!ce&&!Ue&&ji(E),nt=K||ce||Ue||Re,rt=nt?le(E.length,String):[],Xe=rt.length;for(var ot in E)z.call(E,ot)&&!(nt&&(ot=="length"||Ue&&(ot=="offset"||ot=="parent")||Re&&(ot=="buffer"||ot=="byteLength"||ot=="byteOffset")||Di(ot,Xe)))&&rt.push(ot);return rt}function ar(E,F){for(var K=E.length;K--;)if(Fi(E[K][0],F))return K;return-1}function sr(E,F,K){var ce=F(E);return Sr(E)?ce:xt(ce,K(E))}function lr(E){return E==null?E===void 0?L:v:yt&&yt in Object(E)?Tn(E):Bi(E)}function Jr(E){return On(E)&&lr(E)==h}function ur(E,F,K,ce,Ue){return E===F?!0:E==null||F==null||!On(E)&&!On(F)?E!==E&&F!==F:Ci(E,F,K,ce,ur,Ue)}function Ci(E,F,K,ce,Ue,Re){var nt=Sr(E),rt=Sr(F),Xe=nt?d:Sn(E),ot=rt?d:Sn(F);Xe=Xe==h?w:Xe,ot=ot==h?w:ot;var Tt=Xe==w,zt=ot==w,Ot=Xe==ot;if(Ot&&Or(E)){if(!Or(F))return!1;nt=!0,Tt=!1}if(Ot&&!Tt)return Re||(Re=new mn),nt||ji(E)?cr(E,F,K,ce,Ue,Re):Mo(E,F,Xe,K,ce,Ue,Re);if(!(K&i)){var dt=Tt&&z.call(E,"__wrapped__"),Lt=zt&&z.call(F,"__wrapped__");if(dt||Lt){var Nn=dt?E.value():E,En=Lt?F.value():F;return Re||(Re=new mn),Ue(Nn,En,K,ce,Re)}}return Ot?(Re||(Re=new mn),Ri(E,F,K,ce,Ue,Re)):!1}function Ro(E){if(!qi(E)||Ii(E))return!1;var F=Er(E)?Te:G;return F.test(Wt(E))}function ki(E){return On(E)&&ni(E.length)&&!!X[lr(E)]}function Pi(E){if(!Ni(E))return Wn(E);var F=[];for(var K in Object(E))z.call(E,K)&&K!="constructor"&&F.push(K);return F}function cr(E,F,K,ce,Ue,Re){var nt=K&i,rt=E.length,Xe=F.length;if(rt!=Xe&&!(nt&&Xe>rt))return!1;var ot=Re.get(E);if(ot&&Re.get(F))return ot==F;var Tt=-1,zt=!0,Ot=K&l?new Tr:void 0;for(Re.set(E,F),Re.set(F,E);++Tt<rt;){var dt=E[Tt],Lt=F[Tt];if(ce)var Nn=nt?ce(Lt,dt,Tt,F,E,Re):ce(dt,Lt,Tt,E,F,Re);if(Nn!==void 0){if(Nn)continue;zt=!1;break}if(Ot){if(!Je(F,function(En,Gn){if(!_e(Ot,Gn)&&(dt===En||Ue(dt,En,K,ce,Re)))return Ot.push(Gn)})){zt=!1;break}}else if(!(dt===Lt||Ue(dt,Lt,K,ce,Re))){zt=!1;break}}return Re.delete(E),Re.delete(F),zt}function Mo(E,F,K,ce,Ue,Re,nt){switch(K){case P:if(E.byteLength!=F.byteLength||E.byteOffset!=F.byteOffset)return!1;E=E.buffer,F=F.buffer;case k:return!(E.byteLength!=F.byteLength||!Re(new at(E),new at(F)));case p:case a:case b:return Fi(+E,+F);case u:return E.name==F.name&&E.message==F.message;case S:case A:return E==F+"";case _:var rt=ve;case C:var Xe=ce&i;if(rt||(rt=Le),E.size!=F.size&&!Xe)return!1;var ot=nt.get(E);if(ot)return ot==F;ce|=l,nt.set(E,F);var Tt=cr(rt(E),rt(F),ce,Ue,Re,nt);return nt.delete(E),Tt;case R:if(Xr)return Xr.call(E)==Xr.call(F)}return!1}function Ri(E,F,K,ce,Ue,Re){var nt=K&i,rt=In(E),Xe=rt.length,ot=In(F),Tt=ot.length;if(Xe!=Tt&&!nt)return!1;for(var zt=Xe;zt--;){var Ot=rt[zt];if(!(nt?Ot in F:z.call(F,Ot)))return!1}var dt=Re.get(E);if(dt&&Re.get(F))return dt==F;var Lt=!0;Re.set(E,F),Re.set(F,E);for(var Nn=nt;++zt<Xe;){Ot=rt[zt];var En=E[Ot],Gn=F[Ot];if(ce)var Lo=nt?ce(Gn,En,Ot,F,E,Re):ce(En,Gn,Ot,E,F,Re);if(!(Lo===void 0?En===Gn||Ue(En,Gn,K,ce,Re):Lo)){Lt=!1;break}Nn||(Nn=Ot=="constructor")}if(Lt&&!Nn){var ii=E.constructor,jt=F.constructor;ii!=jt&&"constructor"in E&&"constructor"in F&&!(typeof ii=="function"&&ii instanceof ii&&typeof jt=="function"&&jt instanceof jt)&&(Lt=!1)}return Re.delete(E),Re.delete(F),Lt}function In(E){return sr(E,ri,Mi)}function rn(E,F){var K=E.__data__;return Li(F)?K[typeof F=="string"?"string":"hash"]:K.map}function Zt(E,F){var K=be(E,F);return Ro(K)?K:void 0}function Tn(E){var F=z.call(E,yt),K=E[yt];try{E[yt]=void 0;var ce=!0}catch(Re){}var Ue=pe.call(E);return ce&&(F?E[yt]=K:delete E[yt]),Ue}var Mi=Ht?function(E){return E==null?[]:(E=Object(E),ze(Ht(E),function(F){return wt.call(E,F)}))}:ht,Sn=lr;(zr&&Sn(new zr(new ArrayBuffer(1)))!=P||ir&&Sn(new ir)!=_||Gr&&Sn(Gr.resolve())!=T||Yr&&Sn(new Yr)!=C||br&&Sn(new br)!=M)&&(Sn=function(E){var F=lr(E),K=F==w?E.constructor:void 0,ce=K?Wt(K):"";if(ce)switch(ce){case Si:return P;case Ln:return _;case Vr:return T;case po:return C;case Kr:return M}return F});function Di(E,F){return F=F==null?c:F,!!F&&(typeof E=="number"||ne.test(E))&&E>-1&&E%1==0&&E<F}function Li(E){var F=typeof E;return F=="string"||F=="number"||F=="symbol"||F=="boolean"?E!=="__proto__":E===null}function Ii(E){return!!ue&&ue in E}function Ni(E){var F=E&&E.constructor,K=typeof F=="function"&&F.prototype||vt;return E===K}function Bi(E){return pe.call(E)}function Wt(E){if(E!=null){try{return nn.call(E)}catch(F){}try{return E+""}catch(F){}}return""}function Fi(E,F){return E===F||E!==E&&F!==F}var ei=Jr(function(){return arguments}())?Jr:function(E){return On(E)&&z.call(E,"callee")&&!wt.call(E,"callee")},Sr=Array.isArray;function ti(E){return E!=null&&ni(E.length)&&!Er(E)}var Or=Kt||ct;function Do(E,F){return ur(E,F)}function Er(E){if(!qi(E))return!1;var F=lr(E);return F==f||F==y||F==g||F==x}function ni(E){return typeof E=="number"&&E>-1&&E%1==0&&E<=c}function qi(E){var F=typeof E;return E!=null&&(F=="object"||F=="function")}function On(E){return E!=null&&typeof E=="object"}var ji=De?he(De):ki;function ri(E){return ti(E)?Ai(E):Pi(E)}function ht(){return[]}function ct(){return!1}r.exports=Do})(js,js.exports);var Mg=js.exports,_c={},Dg=bt&&bt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_c,"__esModule",{value:!0});var rA=Dg(Rg),iA=Dg(Mg),zu;(function(r){function t(l,c,h){l===void 0&&(l={}),c===void 0&&(c={}),typeof l!="object"&&(l={}),typeof c!="object"&&(c={});var d=rA.default(c);h||(d=Object.keys(d).reduce(function(p,a){return d[a]!=null&&(p[a]=d[a]),p},{}));for(var g in l)l[g]!==void 0&&c[g]===void 0&&(d[g]=l[g]);return Object.keys(d).length>0?d:void 0}r.compose=t;function e(l,c){l===void 0&&(l={}),c===void 0&&(c={}),typeof l!="object"&&(l={}),typeof c!="object"&&(c={});var h=Object.keys(l).concat(Object.keys(c)).reduce(function(d,g){return iA.default(l[g],c[g])||(d[g]=c[g]===void 0?null:c[g]),d},{});return Object.keys(h).length>0?h:void 0}r.diff=e;function n(l,c){l===void 0&&(l={}),c===void 0&&(c={}),l=l||{};var h=Object.keys(c).reduce(function(d,g){return c[g]!==l[g]&&l[g]!==void 0&&(d[g]=c[g]),d},{});return Object.keys(l).reduce(function(d,g){return l[g]!==c[g]&&c[g]===void 0&&(d[g]=null),d},h)}r.invert=n;function i(l,c,h){if(h===void 0&&(h=!1),typeof l!="object")return c;if(typeof c=="object"){if(!h)return c;var d=Object.keys(c).reduce(function(g,p){return l[p]===void 0&&(g[p]=c[p]),g},{});return Object.keys(d).length>0?d:void 0}}r.transform=i})(zu||(zu={}));_c.default=zu;var ms={},vs={},pd;function oA(){if(pd)return vs;pd=1;var r=bt&&bt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(vs,"__esModule",{value:!0});var t=r(Lg()),e=function(){function n(i){this.ops=i,this.index=0,this.offset=0}return n.prototype.hasNext=function(){return this.peekLength()<1/0},n.prototype.next=function(i){i||(i=1/0);var l=this.ops[this.index];if(l){var c=this.offset,h=t.default.length(l);if(i>=h-c?(i=h-c,this.index+=1,this.offset=0):this.offset+=i,typeof l.delete=="number")return{delete:i};var d={};return l.attributes&&(d.attributes=l.attributes),typeof l.retain=="number"?d.retain=i:typeof l.insert=="string"?d.insert=l.insert.substr(c,i):d.insert=l.insert,d}else return{retain:1/0}},n.prototype.peek=function(){return this.ops[this.index]},n.prototype.peekLength=function(){return this.ops[this.index]?t.default.length(this.ops[this.index])-this.offset:1/0},n.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},n.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var i=this.offset,l=this.index,c=this.next(),h=this.ops.slice(this.index);return this.offset=i,this.index=l,[c].concat(h)}else return[]},n}();return vs.default=e,vs}var gd;function Lg(){if(gd)return ms;gd=1;var r=bt&&bt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ms,"__esModule",{value:!0});var t=r(oA()),e;return function(n){function i(c){return new t.default(c)}n.iterator=i;function l(c){return typeof c.delete=="number"?c.delete:typeof c.retain=="number"?c.retain:typeof c.insert=="string"?c.insert.length:1}n.length=l}(e||(e={})),ms.default=e,ms}var Oa=bt&&bt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},ys=Oa(nA),aA=Oa(Rg),bu=Oa(Mg),ta=Oa(_c),Yt=Oa(Lg()),sA="\0";(function(){function r(t){Array.isArray(t)?this.ops=t:t!=null&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}return r.prototype.insert=function(t,e){var n={};return typeof t=="string"&&t.length===0?this:(n.insert=t,e!=null&&typeof e=="object"&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))},r.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},r.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return e!=null&&typeof e=="object"&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},r.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=aA.default(t),typeof n=="object"){if(typeof t.delete=="number"&&typeof n.delete=="number")return this.ops[e-1]={delete:n.delete+t.delete},this;if(typeof n.delete=="number"&&t.insert!=null&&(e-=1,n=this.ops[e-1],typeof n!="object"))return this.ops.unshift(t),this;if(bu.default(t.attributes,n.attributes)){if(typeof t.insert=="string"&&typeof n.insert=="string")return this.ops[e-1]={insert:n.insert+t.insert},typeof t.attributes=="object"&&(this.ops[e-1].attributes=t.attributes),this;if(typeof t.retain=="number"&&typeof n.retain=="number")return this.ops[e-1]={retain:n.retain+t.retain},typeof t.attributes=="object"&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},r.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},r.prototype.filter=function(t){return this.ops.filter(t)},r.prototype.forEach=function(t){this.ops.forEach(t)},r.prototype.map=function(t){return this.ops.map(t)},r.prototype.partition=function(t){var e=[],n=[];return this.forEach(function(i){var l=t(i)?e:n;l.push(i)}),[e,n]},r.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},r.prototype.changeLength=function(){return this.reduce(function(t,e){return e.insert?t+Yt.default.length(e):e.delete?t-e.delete:t},0)},r.prototype.length=function(){return this.reduce(function(t,e){return t+Yt.default.length(e)},0)},r.prototype.slice=function(t,e){t===void 0&&(t=0),e===void 0&&(e=1/0);for(var n=[],i=Yt.default.iterator(this.ops),l=0;l<e&&i.hasNext();){var c=void 0;l<t?c=i.next(t-l):(c=i.next(e-l),n.push(c)),l+=Yt.default.length(c)}return new r(n)},r.prototype.compose=function(t){var e=Yt.default.iterator(this.ops),n=Yt.default.iterator(t.ops),i=[],l=n.peek();if(l!=null&&typeof l.retain=="number"&&l.attributes==null){for(var c=l.retain;e.peekType()==="insert"&&e.peekLength()<=c;)c-=e.peekLength(),i.push(e.next());l.retain-c>0&&n.next(l.retain-c)}for(var h=new r(i);e.hasNext()||n.hasNext();)if(n.peekType()==="insert")h.push(n.next());else if(e.peekType()==="delete")h.push(e.next());else{var d=Math.min(e.peekLength(),n.peekLength()),g=e.next(d),p=n.next(d);if(typeof p.retain=="number"){var a={};typeof g.retain=="number"?a.retain=d:a.insert=g.insert;var u=ta.default.compose(g.attributes,p.attributes,typeof g.retain=="number");if(u&&(a.attributes=u),h.push(a),!n.hasNext()&&bu.default(h.ops[h.ops.length-1],a)){var f=new r(e.rest());return h.concat(f).chop()}}else typeof p.delete=="number"&&typeof g.retain=="number"&&h.push(p)}return h.chop()},r.prototype.concat=function(t){var e=new r(this.ops.slice());return t.ops.length>0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},r.prototype.diff=function(t,e){if(this.ops===t.ops)return new r;var n=[this,t].map(function(d){return d.map(function(g){if(g.insert!=null)return typeof g.insert=="string"?g.insert:sA;var p=d===t?"on":"with";throw new Error("diff() called "+p+" non-document")}).join("")}),i=new r,l=ys.default(n[0],n[1],e),c=Yt.default.iterator(this.ops),h=Yt.default.iterator(t.ops);return l.forEach(function(d){for(var g=d[1].length;g>0;){var p=0;switch(d[0]){case ys.default.INSERT:p=Math.min(h.peekLength(),g),i.push(h.next(p));break;case ys.default.DELETE:p=Math.min(g,c.peekLength()),c.next(p),i.delete(p);break;case ys.default.EQUAL:p=Math.min(c.peekLength(),h.peekLength(),g);var a=c.next(p),u=h.next(p);bu.default(a.insert,u.insert)?i.retain(p,ta.default.diff(a.attributes,u.attributes)):i.push(u).delete(p);break}g-=p}}),i.chop()},r.prototype.eachLine=function(t,e){e===void 0&&(e=`
`);for(var n=Yt.default.iterator(this.ops),i=new r,l=0;n.hasNext();){if(n.peekType()!=="insert")return;var c=n.peek(),h=Yt.default.length(c)-n.peekLength(),d=typeof c.insert=="string"?c.insert.indexOf(e,h)-h:-1;if(d<0)i.push(n.next());else if(d>0)i.push(n.next(d));else{if(t(i,n.next(1).attributes||{},l)===!1)return;l+=1,i=new r}}i.length()>0&&t(i,{},l)},r.prototype.invert=function(t){var e=new r;return this.reduce(function(n,i){if(i.insert)e.delete(Yt.default.length(i));else{if(i.retain&&i.attributes==null)return e.retain(i.retain),n+i.retain;if(i.delete||i.retain&&i.attributes){var l=i.delete||i.retain,c=t.slice(n,n+l);return c.forEach(function(h){i.delete?e.push(h):i.retain&&i.attributes&&e.retain(Yt.default.length(h),ta.default.invert(i.attributes,h.attributes))}),n+l}}return n},0),e.chop()},r.prototype.transform=function(t,e){if(e===void 0&&(e=!1),e=!!e,typeof t=="number")return this.transformPosition(t,e);for(var n=t,i=Yt.default.iterator(this.ops),l=Yt.default.iterator(n.ops),c=new r;i.hasNext()||l.hasNext();)if(i.peekType()==="insert"&&(e||l.peekType()!=="insert"))c.retain(Yt.default.length(i.next()));else if(l.peekType()==="insert")c.push(l.next());else{var h=Math.min(i.peekLength(),l.peekLength()),d=i.next(h),g=l.next(h);if(d.delete)continue;g.delete?c.push(g):c.retain(h,ta.default.transform(d.attributes,g.attributes,e))}return c.chop()},r.prototype.transformPosition=function(t,e){e===void 0&&(e=!1),e=!!e;for(var n=Yt.default.iterator(this.ops),i=0;n.hasNext()&&i<=t;){var l=n.peekLength(),c=n.peekType();if(n.next(),c==="delete"){t-=Math.min(l,t-i);continue}else c==="insert"&&(i<t||!e)&&(t+=l);i+=l}return t},r.Op=Yt.default,r.AttributeMap=ta.default,r})();export{nC as $,_A as A,Xx as B,yA as C,Kx as D,Wp as E,Vx as F,PA as G,kA as H,CA as I,NA as J,ig as K,ho as L,BA as M,JA as N,ZA as O,DA as P,IA as Q,LA as R,YA as S,QA as T,XA as U,RA as V,KA as W,ZS as X,MA as Y,aC as Z,ia as _,sc as a,eC as a0,tC as a1,WE as a2,el as a3,tl as a4,GE as a5,GS as a6,$A as a7,VA as a8,rC as a9,fA as aA,Wr as aB,AA as aC,Ds as aD,uC as aa,Hr as ab,zA as ac,HA as ad,zE as ae,XS as af,eO as ag,iC as ah,UA as ai,WA as aj,no as ak,GA as al,FA as am,vg as an,mg as ao,lC as ap,cC as aq,qA as ar,sC as as,oC as at,KS as au,fC as av,jA as aw,y1 as ax,uA as ay,cA as az,kp as b,bt as c,hA as d,mA as e,vA as f,v1 as g,pA as h,Vs as i,OA as j,uT as k,dx as l,ux as m,Ys as n,EA as o,gA as p,Bu as q,SA as r,dA as s,TA as t,xA as u,cT as v,bA as w,wA as x,zp as y,Zx as z};