diff --git a/label_studio/core/all_urls.json b/label_studio/core/all_urls.json index 65bc129c5136..3e03a652822e 100644 --- a/label_studio/core/all_urls.json +++ b/label_studio/core/all_urls.json @@ -5,6 +5,18 @@ "name": "main", "decorators": "" }, + { + "url": "/sw\\.js", + "module": "core.views.serve_file", + "name": "", + "decorators": "" + }, + { + "url": "/sw-fallback\\.js", + "module": "core.views.serve_file", + "name": "", + "decorators": "" + }, { "url": "/favicon\\.ico", "module": "django.views.generic.base.RedirectView", diff --git a/label_studio/core/settings/base.py b/label_studio/core/settings/base.py index be6f6ca972eb..f69d1f9f363c 100644 --- a/label_studio/core/settings/base.py +++ b/label_studio/core/settings/base.py @@ -65,7 +65,7 @@ }, 'ldclient.util': { 'handlers': ['console'], - 'level': 'WARNING', + 'level': 'ERROR', }, }, } @@ -587,6 +587,9 @@ def collect_versions_dummy(**kwargs): FUTURE_SAVE_TASK_TO_STORAGE = get_bool_env('FUTURE_SAVE_TASK_TO_STORAGE', default=False) FUTURE_SAVE_TASK_TO_STORAGE_JSON_EXT = get_bool_env('FUTURE_SAVE_TASK_TO_STORAGE_JSON_EXT', default=True) +STORAGE_IN_PROGRESS_TIMER = get_env('STORAGE_IN_PROGRESS_TIMER', 5.0) + +USE_NGINX_FOR_EXPORT_DOWNLOADS = get_bool_env('USE_NGINX_FOR_EXPORT_DOWNLOADS', False) if get_env('MINIO_STORAGE_ENDPOINT') and not get_bool_env('MINIO_SKIP', False): CLOUD_FILE_STORAGE_ENABLED = True diff --git a/label_studio/data_export/api.py b/label_studio/data_export/api.py index cdc5d43c3851..622319ee73e1 100644 --- a/label_studio/data_export/api.py +++ b/label_studio/data_export/api.py @@ -490,14 +490,24 @@ def get(self, request, *args, **kwargs): url = file.storage.url(file.name, storage_url=True) protocol = urlparse(url).scheme - # Let NGINX handle it - response = HttpResponse() - # The below header tells NGINX to catch it and serve, see docker-config/nginx-app.conf - redirect = '/file_download/' + protocol + '/' + url.replace(protocol + '://', '') - - response['X-Accel-Redirect'] = redirect - response['Content-Disposition'] = 'attachment; filename="{}"'.format(file.name) - return response + # NGINX downloads are a solid way to make uwsgi workers free + if settings.USE_NGINX_FOR_EXPORT_DOWNLOADS: + # let NGINX handle it + response = HttpResponse() + # below header tells NGINX to catch it and serve, see docker-config/nginx-app.conf + redirect = '/file_download/' + protocol + '/' + url.replace(protocol + '://', '') + response['X-Accel-Redirect'] = redirect + response['Content-Disposition'] = 'attachment; filename="{}"'.format(file.name) + response['filename'] = os.path.basename(file.name) + return response + + # No NGINX: standard way for export downloads in the community edition + else: + ext = file.name.split('.')[-1] + response = RangedFileResponse(request, file, content_type=f'application/{ext}') + response['Content-Disposition'] = f'attachment; filename="{file.name}"' + response['filename'] = os.path.basename(file.name) + return response else: if export_type is None: file_ = snapshot.file diff --git a/label_studio/data_export/migrations/0010_alter_convertedformat_export_type.py b/label_studio/data_export/migrations/0010_alter_convertedformat_export_type.py new file mode 100644 index 000000000000..1b63d9618d4a --- /dev/null +++ b/label_studio/data_export/migrations/0010_alter_convertedformat_export_type.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.16 on 2023-04-19 11:36 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('data_export', '0009_alter_convertedformat_traceback'), + ] + + operations = [ + migrations.AlterField( + model_name='convertedformat', + name='export_type', + field=models.CharField(max_length=64), + ), + ] diff --git a/label_studio/data_export/models.py b/label_studio/data_export/models.py index e82d2178d390..f8df0dc3294a 100644 --- a/label_studio/data_export/models.py +++ b/label_studio/data_export/models.py @@ -218,9 +218,7 @@ class Status(models.TextChoices): help_text='Traceback report in case of errors' ) export_type = models.CharField( - max_length=64, - choices=Status.choices, - default=Status.CREATED, + max_length=64 ) created_at = models.DateTimeField( _('created at'), diff --git a/label_studio/data_export/serializers.py b/label_studio/data_export/serializers.py index c068f95ad334..4038b543b65e 100644 --- a/label_studio/data_export/serializers.py +++ b/label_studio/data_export/serializers.py @@ -69,6 +69,7 @@ class Meta: expandable_fields = { 'drafts': (AnnotationDraftSerializer, {'many': True}), 'predictions': (PredictionSerializer, {'many': True}), + 'annotations': (AnnotationSerializer, {'many': True}) } diff --git a/label_studio/frontend/dist/react-app/index.js b/label_studio/frontend/dist/react-app/index.js index d2db1a0e5da4..dd2afb8e986a 100644 --- a/label_studio/frontend/dist/react-app/index.js +++ b/label_studio/frontend/dist/react-app/index.js @@ -1,3 +1,3 @@ /*! For license information please see index.js.LICENSE.txt */ -(()=>{var e={8554:(e,t,n)=>{"use strict";n.d(t,{Xb:()=>f,Gd:()=>m,cu:()=>p});var r=n(655),i=n(7199),o=n(2844),a=n(1170),s=n(2343),l=n(1422),u=n(6769),c=n(7482),d=function(){function e(e){this.errors=0,this.sid=(0,o.DM)(),this.duration=0,this.status=i.$.Ok,this.init=!0,this.ignoreDuration=!1;var t=(0,a.ph)();this.timestamp=t,this.started=t,e&&this.update(e)}return e.prototype.update=function(e){if(void 0===e&&(e={}),e.user&&(!this.ipAddress&&e.user.ip_address&&(this.ipAddress=e.user.ip_address),this.did||e.did||(this.did=e.user.id||e.user.email||e.user.username)),this.timestamp=e.timestamp||(0,a.ph)(),e.ignoreDuration&&(this.ignoreDuration=e.ignoreDuration),e.sid&&(this.sid=32===e.sid.length?e.sid:(0,o.DM)()),void 0!==e.init&&(this.init=e.init),!this.did&&e.did&&(this.did=""+e.did),"number"==typeof e.started&&(this.started=e.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof e.duration)this.duration=e.duration;else{var t=this.timestamp-this.started;this.duration=t>=0?t:0}e.release&&(this.release=e.release),e.environment&&(this.environment=e.environment),!this.ipAddress&&e.ipAddress&&(this.ipAddress=e.ipAddress),!this.userAgent&&e.userAgent&&(this.userAgent=e.userAgent),"number"==typeof e.errors&&(this.errors=e.errors),e.status&&(this.status=e.status)},e.prototype.close=function(e){e?this.update({status:e}):this.status===i.$.Ok?this.update({status:i.$.Exited}):this.update()},e.prototype.toJSON=function(){return(0,c.Jr)({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:(0,c.Jr)({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},e}(),f=function(){function e(e,t,n){void 0===t&&(t=new u.s),void 0===n&&(n=4),this._version=n,this._stack=[{}],this.getStackTop().scope=t,this.bindClient(e)}return e.prototype.isOlderThan=function(e){return this._version{"use strict";n.d(t,{c:()=>c,s:()=>l});var r=n(655),i=n(7597),o=n(1170),a=n(6893),s=n(2844),l=function(){function e(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={}}return e.clone=function(t){var n=new e;return t&&(n._breadcrumbs=(0,r.fl)(t._breadcrumbs),n._tags=(0,r.pi)({},t._tags),n._extra=(0,r.pi)({},t._extra),n._contexts=(0,r.pi)({},t._contexts),n._user=t._user,n._level=t._level,n._span=t._span,n._session=t._session,n._transactionName=t._transactionName,n._fingerprint=t._fingerprint,n._eventProcessors=(0,r.fl)(t._eventProcessors),n._requestSession=t._requestSession),n},e.prototype.addScopeListener=function(e){this._scopeListeners.push(e)},e.prototype.addEventProcessor=function(e){return this._eventProcessors.push(e),this},e.prototype.setUser=function(e){return this._user=e||{},this._session&&this._session.update({user:e}),this._notifyScopeListeners(),this},e.prototype.getUser=function(){return this._user},e.prototype.getRequestSession=function(){return this._requestSession},e.prototype.setRequestSession=function(e){return this._requestSession=e,this},e.prototype.setTags=function(e){return this._tags=(0,r.pi)((0,r.pi)({},this._tags),e),this._notifyScopeListeners(),this},e.prototype.setTag=function(e,t){var n;return this._tags=(0,r.pi)((0,r.pi)({},this._tags),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setExtras=function(e){return this._extra=(0,r.pi)((0,r.pi)({},this._extra),e),this._notifyScopeListeners(),this},e.prototype.setExtra=function(e,t){var n;return this._extra=(0,r.pi)((0,r.pi)({},this._extra),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setFingerprint=function(e){return this._fingerprint=e,this._notifyScopeListeners(),this},e.prototype.setLevel=function(e){return this._level=e,this._notifyScopeListeners(),this},e.prototype.setTransactionName=function(e){return this._transactionName=e,this._notifyScopeListeners(),this},e.prototype.setTransaction=function(e){return this.setTransactionName(e)},e.prototype.setContext=function(e,t){var n;return null===t?delete this._contexts[e]:this._contexts=(0,r.pi)((0,r.pi)({},this._contexts),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setSpan=function(e){return this._span=e,this._notifyScopeListeners(),this},e.prototype.getSpan=function(){return this._span},e.prototype.getTransaction=function(){var e,t,n,r,i=this.getSpan();return(null===(e=i)||void 0===e?void 0:e.transaction)?null===(t=i)||void 0===t?void 0:t.transaction:(null===(r=null===(n=i)||void 0===n?void 0:n.spanRecorder)||void 0===r?void 0:r.spans[0])?i.spanRecorder.spans[0]:void 0},e.prototype.setSession=function(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this},e.prototype.getSession=function(){return this._session},e.prototype.update=function(t){if(!t)return this;if("function"==typeof t){var n=t(this);return n instanceof e?n:this}return t instanceof e?(this._tags=(0,r.pi)((0,r.pi)({},this._tags),t._tags),this._extra=(0,r.pi)((0,r.pi)({},this._extra),t._extra),this._contexts=(0,r.pi)((0,r.pi)({},this._contexts),t._contexts),t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession)):(0,i.PO)(t)&&(t=t,this._tags=(0,r.pi)((0,r.pi)({},this._tags),t.tags),this._extra=(0,r.pi)((0,r.pi)({},this._extra),t.extra),this._contexts=(0,r.pi)((0,r.pi)({},this._contexts),t.contexts),t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession)),this},e.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},e.prototype.addBreadcrumb=function(e,t){var n="number"==typeof t?Math.min(t,100):100;if(n<=0)return this;var i=(0,r.pi)({timestamp:(0,o.yW)()},e);return this._breadcrumbs=(0,r.fl)(this._breadcrumbs,[i]).slice(-n),this._notifyScopeListeners(),this},e.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},e.prototype.applyToEvent=function(e,t){var n;if(this._extra&&Object.keys(this._extra).length&&(e.extra=(0,r.pi)((0,r.pi)({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=(0,r.pi)((0,r.pi)({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=(0,r.pi)((0,r.pi)({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=(0,r.pi)((0,r.pi)({},this._contexts),e.contexts)),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=(0,r.pi)({trace:this._span.getTraceContext()},e.contexts);var i=null===(n=this._span.transaction)||void 0===n?void 0:n.name;i&&(e.tags=(0,r.pi)({transaction:i},e.tags))}return this._applyFingerprint(e),e.breadcrumbs=(0,r.fl)(e.breadcrumbs||[],this._breadcrumbs),e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,this._notifyEventProcessors((0,r.fl)(u(),this._eventProcessors),e,t)},e.prototype._notifyEventProcessors=function(e,t,n,o){var s=this;return void 0===o&&(o=0),new a.c((function(a,l){var u=e[o];if(null===t||"function"!=typeof u)a(t);else{var c=u((0,r.pi)({},t),n);(0,i.J8)(c)?c.then((function(t){return s._notifyEventProcessors(e,t,n,o+1).then(a)})).then(null,l):s._notifyEventProcessors(e,c,n,o+1).then(a).then(null,l)}}))},e.prototype._notifyScopeListeners=function(){var e=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},e}();function u(){var e=(0,s.Rf)();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}function c(e){u().push(e)}},6141:(e,t,n)=>{"use strict";n.d(t,{ro:()=>y,lb:()=>g});var r,i=n(655),o=n(8554);!function(e){e.Explicit="explicitly_set",e.Sampler="client_sampler",e.Rate="client_rate",e.Inheritance="inheritance"}(r||(r={}));var a=n(2343),s=n(1422),l=n(9732),u=n(5734),c=n(3233);function d(){var e=(0,c.x1)();e&&(a.k.log("[Tracing] Transaction: "+u.p.InternalError+" -> Global error occured"),e.setStatus(u.p.InternalError))}var f=n(6458),p=n(3391);function h(){var e=this.getScope();if(e){var t=e.getSpan();if(t)return{"sentry-trace":t.toTraceparent()}}return{}}function m(e,t,n){return(0,c.zu)()?void 0!==e.sampled?(e.setMetadata({transactionSampling:{method:r.Explicit}}),e):("function"==typeof t.tracesSampler?(i=t.tracesSampler(n),e.setMetadata({transactionSampling:{method:r.Sampler,rate:Number(i)}})):void 0!==n.parentSampled?(i=n.parentSampled,e.setMetadata({transactionSampling:{method:r.Inheritance}})):(i=t.tracesSampleRate,e.setMetadata({transactionSampling:{method:r.Rate,rate:Number(i)}})),function(e){if(isNaN(e)||"number"!=typeof e&&"boolean"!=typeof e)return a.k.warn("[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got "+JSON.stringify(e)+" of type "+JSON.stringify(typeof e)+"."),!1;if(e<0||e>1)return a.k.warn("[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got "+e+"."),!1;return!0}(i)?i?(e.sampled=Math.random()0&&(t.__SENTRY__.integrations=(0,i.fl)(t.__SENTRY__.integrations||[],r))}}(),(0,l.o)({callback:d,type:"error"}),(0,l.o)({callback:d,type:"unhandledrejection"})}e=n.hmd(e)},6458:(e,t,n)=>{"use strict";n.d(t,{io:()=>d,nT:()=>u});var r=n(655),i=n(1170),o=n(2343),a=n(5334),s=n(5734),l=n(3391),u=1e3,c=function(e){function t(t,n,r,i){void 0===r&&(r="");var o=e.call(this,i)||this;return o._pushActivity=t,o._popActivity=n,o.transactionSpanId=r,o}return(0,r.ZT)(t,e),t.prototype.add=function(t){var n=this;t.spanId!==this.transactionSpanId&&(t.finish=function(e){t.endTimestamp="number"==typeof e?e:(0,i._I)(),n._popActivity(t.spanId)},void 0===t.endTimestamp&&this._pushActivity(t.spanId)),e.prototype.add.call(this,t)},t}(a.g),d=function(e){function t(t,n,r,i){void 0===r&&(r=u),void 0===i&&(i=!1);var a=e.call(this,t,n)||this;return a._idleHub=n,a._idleTimeout=r,a._onScope=i,a.activities={},a._heartbeatTimer=0,a._heartbeatCounter=0,a._finished=!1,a._beforeFinishCallbacks=[],n&&i&&(f(n),o.k.log("Setting idle transaction on scope. Span ID: "+a.spanId),n.configureScope((function(e){return e.setSpan(a)}))),a._initTimeout=setTimeout((function(){a._finished||a.finish()}),a._idleTimeout),a}return(0,r.ZT)(t,e),t.prototype.finish=function(t){var n,a,l=this;if(void 0===t&&(t=(0,i._I)()),this._finished=!0,this.activities={},this.spanRecorder){o.k.log("[Tracing] finishing IdleTransaction",new Date(1e3*t).toISOString(),this.op);try{for(var u=(0,r.XA)(this._beforeFinishCallbacks),c=u.next();!c.done;c=u.next()){(0,c.value)(this,t)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(n)throw n.error}}this.spanRecorder.spans=this.spanRecorder.spans.filter((function(e){if(e.spanId===l.spanId)return!0;e.endTimestamp||(e.endTimestamp=t,e.setStatus(s.p.Cancelled),o.k.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(e,void 0,2)));var n=e.startTimestamp=3?(o.k.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus(s.p.DeadlineExceeded),this.setTag("heartbeat","failed"),this.finish()):this._pingHeartbeat()}},t.prototype._pingHeartbeat=function(){var e=this;o.k.log("pinging Heartbeat -> current counter: "+this._heartbeatCounter),this._heartbeatTimer=setTimeout((function(){e._beat()}),5e3)},t}(l.Y);function f(e){if(e){var t=e.getScope();if(t)t.getTransaction()&&t.setSpan(void 0)}}},5334:(e,t,n)=>{"use strict";n.d(t,{D:()=>u,g:()=>l});var r=n(655),i=n(2844),o=n(1170),a=n(7482),s=n(5734),l=function(){function e(e){void 0===e&&(e=1e3),this.spans=[],this._maxlen=e}return e.prototype.add=function(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)},e}(),u=function(){function e(e){if(this.traceId=(0,i.DM)(),this.spanId=(0,i.DM)().substring(16),this.startTimestamp=(0,o._I)(),this.tags={},this.data={},!e)return this;e.traceId&&(this.traceId=e.traceId),e.spanId&&(this.spanId=e.spanId),e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.data&&(this.data=e.data),e.tags&&(this.tags=e.tags),e.status&&(this.status=e.status),e.startTimestamp&&(this.startTimestamp=e.startTimestamp),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}return e.prototype.child=function(e){return this.startChild(e)},e.prototype.startChild=function(t){var n=new e((0,r.pi)((0,r.pi)({},t),{parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId}));return n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n),n.transaction=this.transaction,n},e.prototype.setTag=function(e,t){var n;return this.tags=(0,r.pi)((0,r.pi)({},this.tags),((n={})[e]=t,n)),this},e.prototype.setData=function(e,t){var n;return this.data=(0,r.pi)((0,r.pi)({},this.data),((n={})[e]=t,n)),this},e.prototype.setStatus=function(e){return this.status=e,this},e.prototype.setHttpStatus=function(e){this.setTag("http.status_code",String(e));var t=s.p.fromHttpCode(e);return t!==s.p.UnknownError&&this.setStatus(t),this},e.prototype.isSuccess=function(){return this.status===s.p.Ok},e.prototype.finish=function(e){this.endTimestamp="number"==typeof e?e:(0,o._I)()},e.prototype.toTraceparent=function(){var e="";return void 0!==this.sampled&&(e=this.sampled?"-1":"-0"),this.traceId+"-"+this.spanId+e},e.prototype.toContext=function(){return(0,a.Jr)({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})},e.prototype.updateWithContext=function(e){var t,n,r,i,o;return this.data=null!=(t=e.data)?t:{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=null!=(n=e.spanId)?n:this.spanId,this.startTimestamp=null!=(r=e.startTimestamp)?r:this.startTimestamp,this.status=e.status,this.tags=null!=(i=e.tags)?i:{},this.traceId=null!=(o=e.traceId)?o:this.traceId,this},e.prototype.getTraceContext=function(){return(0,a.Jr)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})},e.prototype.toJSON=function(){return(0,a.Jr)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})},e}()},5734:(e,t,n)=>{"use strict";var r;n.d(t,{p:()=>r}),function(e){e.Ok="ok",e.DeadlineExceeded="deadline_exceeded",e.Unauthenticated="unauthenticated",e.PermissionDenied="permission_denied",e.NotFound="not_found",e.ResourceExhausted="resource_exhausted",e.InvalidArgument="invalid_argument",e.Unimplemented="unimplemented",e.Unavailable="unavailable",e.InternalError="internal_error",e.UnknownError="unknown_error",e.Cancelled="cancelled",e.AlreadyExists="already_exists",e.FailedPrecondition="failed_precondition",e.Aborted="aborted",e.OutOfRange="out_of_range",e.DataLoss="data_loss"}(r||(r={})),function(e){e.fromHttpCode=function(t){if(t<400)return e.Ok;if(t>=400&&t<500)switch(t){case 401:return e.Unauthenticated;case 403:return e.PermissionDenied;case 404:return e.NotFound;case 409:return e.AlreadyExists;case 413:return e.FailedPrecondition;case 429:return e.ResourceExhausted;default:return e.InvalidArgument}if(t>=500&&t<600)switch(t){case 501:return e.Unimplemented;case 503:return e.Unavailable;case 504:return e.DeadlineExceeded;default:return e.InternalError}return e.UnknownError}}(r||(r={}))},3391:(e,t,n)=>{"use strict";n.d(t,{Y:()=>u});var r=n(655),i=n(8554),o=n(7597),a=n(2343),s=n(7482),l=n(5334),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r._measurements={},r._hub=(0,i.Gd)(),(0,o.V9)(n,i.Xb)&&(r._hub=n),r.name=t.name||"",r.metadata=t.metadata||{},r._trimEnd=t.trimEnd,r.transaction=r,r}return(0,r.ZT)(t,e),t.prototype.setName=function(e){this.name=e},t.prototype.initSpanRecorder=function(e){void 0===e&&(e=1e3),this.spanRecorder||(this.spanRecorder=new l.g(e)),this.spanRecorder.add(this)},t.prototype.setMeasurements=function(e){this._measurements=(0,r.pi)({},e)},t.prototype.setMetadata=function(e){this.metadata=(0,r.pi)((0,r.pi)({},this.metadata),e)},t.prototype.finish=function(t){var n=this;if(void 0===this.endTimestamp){if(this.name||(a.k.warn("Transaction has no name, falling back to ``."),this.name=""),e.prototype.finish.call(this,t),!0===this.sampled){var r=this.spanRecorder?this.spanRecorder.spans.filter((function(e){return e!==n&&e.endTimestamp})):[];this._trimEnd&&r.length>0&&(this.endTimestamp=r.reduce((function(e,t){return e.endTimestamp&&t.endTimestamp?e.endTimestamp>t.endTimestamp?e:t:e})).endTimestamp);var i={contexts:{trace:this.getTraceContext()},spans:r,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",debug_meta:this.metadata};return Object.keys(this._measurements).length>0&&(a.k.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),a.k.log("[Tracing] Finishing "+this.op+" transaction: "+this.name+"."),this._hub.captureEvent(i)}a.k.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled.")}},t.prototype.toContext=function(){var t=e.prototype.toContext.call(this);return(0,s.Jr)((0,r.pi)((0,r.pi)({},t),{name:this.name,trimEnd:this._trimEnd}))},t.prototype.updateWithContext=function(t){var n;return e.prototype.updateWithContext.call(this,t),this.name=null!=(n=t.name)?n:"",this._trimEnd=t.trimEnd,this},t}(l.D)},3233:(e,t,n)=>{"use strict";n.d(t,{WB:()=>u,XL:()=>l,qG:()=>a,x1:()=>s,zu:()=>o});var r=n(8554),i=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function o(e){var t;return void 0===e&&(e=null===(t=(0,r.Gd)().getClient())||void 0===t?void 0:t.getOptions()),!!e&&("tracesSampleRate"in e||"tracesSampler"in e)}function a(e){var t=e.match(i);if(t){var n=void 0;return"1"===t[3]?n=!0:"0"===t[3]&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}}function s(e){var t,n;return void 0===e&&(e=(0,r.Gd)()),null===(n=null===(t=e)||void 0===t?void 0:t.getScope())||void 0===n?void 0:n.getTransaction()}function l(e){return e/1e3}function u(e){return 1e3*e}},7199:(e,t,n)=>{"use strict";var r,i;n.d(t,{$:()=>r}),function(e){e.Ok="ok",e.Exited="exited",e.Crashed="crashed",e.Abnormal="abnormal"}(r||(r={})),function(e){e.Ok="ok",e.Errored="errored",e.Crashed="crashed"}(i||(i={}))},8464:(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var r=n(7597);function i(e,t){try{for(var n=e,r=[],i=0,a=0,s=" > ".length,l=void 0;n&&i++<5&&!("html"===(l=o(n,t))||i>1&&a+r.length*s+l.length>=80);)r.push(l),a+=l.length,n=n.parentNode;return r.reverse().join(" > ")}catch(e){return""}}function o(e,t){var n,i,o,a,s,l,u,c=e,d=[];if(!c||!c.tagName)return"";d.push(c.tagName.toLowerCase());var f=(null===(n=t)||void 0===n?void 0:n.length)?t.filter((function(e){return c.getAttribute(e)})).map((function(e){return[e,c.getAttribute(e)]})):null;if(null===(i=f)||void 0===i?void 0:i.length)f.forEach((function(e){d.push("["+e[0]+'="'+e[1]+'"]')}));else if(c.id&&d.push("#"+c.id),(o=c.className)&&(0,r.HD)(o))for(a=o.split(/\s+/),u=0;u{"use strict";n.d(t,{o:()=>m});var r,i=n(655),o=n(7597),a=n(2343),s=n(2844),l=n(7482),u=n(360),c=n(8823),d=(0,s.Rf)(),f={},p={};function h(e){if(!p[e])switch(p[e]=!0,e){case"console":!function(){if(!("console"in d))return;["debug","info","warn","error","log","assert"].forEach((function(e){e in d.console&&(0,l.hl)(d.console,e,(function(t){return function(){for(var n=[],r=0;r2?t[2]:void 0;if(i){var o=r,a=String(i);r=a,v("history",{from:o,to:a})}return e.apply(this,t)}}d.onpopstate=function(){for(var t=[],n=0;n{"use strict";function r(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return m(e,Error)}}function i(e){return"[object ErrorEvent]"===Object.prototype.toString.call(e)}function o(e){return"[object DOMError]"===Object.prototype.toString.call(e)}function a(e){return"[object DOMException]"===Object.prototype.toString.call(e)}function s(e){return"[object String]"===Object.prototype.toString.call(e)}function l(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function u(e){return"[object Object]"===Object.prototype.toString.call(e)}function c(e){return"undefined"!=typeof Event&&m(e,Event)}function d(e){return"undefined"!=typeof Element&&m(e,Element)}function f(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function p(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function h(e){return u(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function m(e,t){try{return e instanceof t}catch(e){return!1}}n.d(t,{Cy:()=>h,HD:()=>s,J8:()=>p,Kj:()=>f,PO:()=>u,TX:()=>o,V9:()=>m,VW:()=>i,VZ:()=>r,cO:()=>c,fm:()=>a,kK:()=>d,pt:()=>l})},2343:(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var r=n(2844),i=(0,r.Rf)(),o="Sentry Logger ",a=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var e=[],t=0;t{"use strict";n.d(t,{Cf:()=>u,DM:()=>a,Db:()=>c,EG:()=>d,JY:()=>p,Rf:()=>o,en:()=>s,jH:()=>l,l4:()=>f});var r=n(1422),i={};function o(){return(0,r.KV)()?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}function a(){var e=o(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(e){for(var t=e.toString(16);t.length<4;)t="0"+t;return t};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function s(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}function l(e){if(e.message)return e.message;if(e.exception&&e.exception.values&&e.exception.values[0]){var t=e.exception.values[0];return t.type&&t.value?t.type+": "+t.value:t.type||t.value||e.event_id||""}return e.event_id||""}function u(e){var t=o();if(!("console"in t))return e();var n=t.console,r={};["debug","info","warn","error","log","assert"].forEach((function(e){e in t.console&&n[e].__sentry_original__&&(r[e]=n[e],n[e]=n[e].__sentry_original__)}));var i=e();return Object.keys(r).forEach((function(e){n[e]=r[e]})),i}function c(e,t,n){e.exception=e.exception||{},e.exception.values=e.exception.values||[],e.exception.values[0]=e.exception.values[0]||{},e.exception.values[0].value=e.exception.values[0].value||t||"",e.exception.values[0].type=e.exception.values[0].type||n||"Error"}function d(e,t){void 0===t&&(t={});try{e.exception.values[0].mechanism=e.exception.values[0].mechanism||{},Object.keys(t).forEach((function(n){e.exception.values[0].mechanism[n]=t[n]}))}catch(e){}}function f(){try{return document.location.href}catch(e){return""}}function p(e,t){if(!t)return 6e4;var n=parseInt(""+t,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+t);return isNaN(r)?6e4:r-e}},1422:(e,t,n)=>{"use strict";function r(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function i(e,t){return e.require(t)}function o(t){var n;try{n=i(e,t)}catch(e){}try{var r=i(e,"process").cwd;n=i(e,r()+"/node_modules/"+t)}catch(e){}return n}n.d(t,{$y:()=>o,KV:()=>r,l$:()=>i}),e=n.hmd(e)},7482:(e,t,n)=>{"use strict";n.d(t,{Jr:()=>y,zf:()=>g,hl:()=>u,Fv:()=>v,Qy:()=>p,_j:()=>c});var r=n(655),i=n(8464),o=n(7597),a=function(){function e(){this._hasWeakSet="function"==typeof WeakSet,this._inner=this._hasWeakSet?new WeakSet:[]}return e.prototype.memoize=function(e){if(this._hasWeakSet)return!!this._inner.has(e)||(this._inner.add(e),!1);for(var t=0;t"}try{s.currentTarget=(0,o.kK)(a.currentTarget)?(0,i.R)(a.currentTarget):Object.prototype.toString.call(a.currentTarget)}catch(e){s.currentTarget=""}for(var r in"undefined"!=typeof CustomEvent&&(0,o.V9)(e,CustomEvent)&&(s.detail=a.detail),a)Object.prototype.hasOwnProperty.call(a,r)&&(s[r]=a);return s}return e}function f(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}function p(e,t,n){void 0===t&&(t=3),void 0===n&&(n=102400);var r=v(e,t);return f(r)>n?p(e,t-1,n):r}function h(e,t){return"domain"===t&&e&&"object"==typeof e&&e._events?"[Domain]":"domainEmitter"===t?"[DomainEmitter]":void 0!==n.g&&e===n.g?"[Global]":"undefined"!=typeof window&&e===window?"[Window]":"undefined"!=typeof document&&e===document?"[Document]":(0,o.Cy)(e)?"[SyntheticEvent]":"number"==typeof e&&e!=e?"[NaN]":void 0===e?"[undefined]":"function"==typeof e?"[Function: "+(0,s.$)(e)+"]":"symbol"==typeof e?"["+String(e)+"]":"bigint"==typeof e?"[BigInt: "+String(e)+"]":e}function m(e,t,n,r){if(void 0===n&&(n=1/0),void 0===r&&(r=new a),0===n)return function(e){var t=Object.prototype.toString.call(e);if("string"==typeof e)return e;if("[object Object]"===t)return"[Object]";if("[object Array]"===t)return"[Array]";var n=h(e);return(0,o.pt)(n)?n:t}(t);if(null!=t&&"function"==typeof t.toJSON)return t.toJSON();var i=h(t,e);if((0,o.pt)(i))return i;var s=d(t),l=Array.isArray(t)?[]:{};if(r.memoize(t))return"[Circular ~]";for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(l[u]=m(u,s[u],n-1,r));return r.unmemoize(t),l}function v(e,t){try{return JSON.parse(JSON.stringify(e,(function(e,n){return m(e,n,t)})))}catch(e){return"**non-serializable**"}}function g(e,t){void 0===t&&(t=40);var n=Object.keys(d(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return(0,l.$G)(n[0],t);for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>t))return r===n.length?i:(0,l.$G)(i,t)}return""}function y(e){var t,n;if((0,o.PO)(e)){var i=e,a={};try{for(var s=(0,r.XA)(Object.keys(i)),l=s.next();!l.done;l=s.next()){var u=l.value;void 0!==i[u]&&(a[u]=y(i[u]))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}return Array.isArray(e)?e.map(y):e}},360:(e,t,n)=>{"use strict";n.d(t,{$:()=>i});var r="";function i(e){try{return e&&"function"==typeof e&&e.name||r}catch(e){return r}}},7321:(e,t,n)=>{"use strict";n.d(t,{$G:()=>i,nK:()=>o,zC:()=>a});var r=n(7597);function i(e,t){return void 0===t&&(t=0),"string"!=typeof e||0===t||e.length<=t?e:e.substr(0,t)+"..."}function o(e,t){if(!Array.isArray(e))return"";for(var n=[],r=0;r{"use strict";n.d(t,{Ak:()=>o,Bf:()=>u,Du:()=>a,hv:()=>l,t$:()=>s});var r=n(2343),i=n(2844);function o(){if(!("fetch"in(0,i.Rf)()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function a(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function s(){if(!o())return!1;var e=(0,i.Rf)();if(a(e.fetch))return!0;var t=!1,n=e.document;if(n&&"function"==typeof n.createElement)try{var s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s),s.contentWindow&&s.contentWindow.fetch&&(t=a(s.contentWindow.fetch)),n.head.removeChild(s)}catch(e){r.k.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}function l(){if(!o())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(e){return!1}}function u(){var e=(0,i.Rf)(),t=e.chrome,n=t&&t.app&&t.app.runtime,r="history"in e&&!!e.history.pushState&&!!e.history.replaceState;return!n&&r}},6893:(e,t,n)=>{"use strict";n.d(t,{c:()=>o});var r,i=n(7597);!function(e){e.PENDING="PENDING",e.RESOLVED="RESOLVED",e.REJECTED="REJECTED"}(r||(r={}));var o=function(){function e(e){var t=this;this._state=r.PENDING,this._handlers=[],this._resolve=function(e){t._setResult(r.RESOLVED,e)},this._reject=function(e){t._setResult(r.REJECTED,e)},this._setResult=function(e,n){t._state===r.PENDING&&((0,i.J8)(n)?n.then(t._resolve,t._reject):(t._state=e,t._value=n,t._executeHandlers()))},this._attachHandler=function(e){t._handlers=t._handlers.concat(e),t._executeHandlers()},this._executeHandlers=function(){if(t._state!==r.PENDING){var e=t._handlers.slice();t._handlers=[],e.forEach((function(e){e.done||(t._state===r.RESOLVED&&e.onfulfilled&&e.onfulfilled(t._value),t._state===r.REJECTED&&e.onrejected&&e.onrejected(t._value),e.done=!0)}))}};try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}return e.resolve=function(t){return new e((function(e){e(t)}))},e.reject=function(t){return new e((function(e,n){n(t)}))},e.all=function(t){return new e((function(n,r){if(Array.isArray(t))if(0!==t.length){var i=t.length,o=[];t.forEach((function(t,a){e.resolve(t).then((function(e){o[a]=e,0===(i-=1)&&n(o)})).then(null,r)}))}else n([]);else r(new TypeError("Promise.all requires an array as input."))}))},e.prototype.then=function(t,n){var r=this;return new e((function(e,i){r._attachHandler({done:!1,onfulfilled:function(n){if(t)try{return void e(t(n))}catch(e){return void i(e)}else e(n)},onrejected:function(t){if(n)try{return void e(n(t))}catch(e){return void i(e)}else i(t)}})}))},e.prototype.catch=function(e){return this.then((function(e){return e}),e)},e.prototype.finally=function(t){var n=this;return new e((function(e,r){var i,o;return n.then((function(e){o=!1,i=e,t&&t()}),(function(e){o=!0,i=e,t&&t()})).then((function(){o?r(i):e(i)}))}))},e.prototype.toString=function(){return"[object SyncPromise]"},e}()},1170:(e,t,n)=>{"use strict";n.d(t,{Z1:()=>d,_I:()=>c,ph:()=>u,yW:()=>l});var r=n(2844),i=n(1422);e=n.hmd(e);var o={nowSeconds:function(){return Date.now()/1e3}};var a=(0,i.KV)()?function(){try{return(0,i.l$)(e,"perf_hooks").performance}catch(e){return}}():function(){var e=(0,r.Rf)().performance;if(e&&e.now)return{now:function(){return e.now()},timeOrigin:Date.now()-e.now()}}(),s=void 0===a?o:{nowSeconds:function(){return(a.timeOrigin+a.now())/1e3}},l=o.nowSeconds.bind(o),u=s.nowSeconds.bind(s),c=u,d=function(){var e=(0,r.Rf)().performance;if(e&&e.now){var t=36e5,n=e.now(),i=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+n-i):t,a=on?n:e},t=function(t){t._clipped=!1,t._unclipped=t.slice(0);for(var n=0;n<=3;n++)n<3?((t[n]<0||t[n]>255)&&(t._clipped=!0),t[n]=e(t[n],0,255)):3===n&&(t[n]=e(t[n],0,1));return t},n={},r=0,i=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];r=3?Array.prototype.slice.call(e):"object"==a(e[0])&&t?t.split("").filter((function(t){return void 0!==e[0][t]})).map((function(t){return e[0][t]})):e[0]},l=function(e){if(e.length<2)return null;var t=e.length-1;return"string"==a(e[t])?e[t].toLowerCase():null},u=Math.PI,c={clip_rgb:t,limit:e,type:a,unpack:s,last:l,PI:u,TWOPI:2*u,PITHIRD:u/3,DEG2RAD:u/180,RAD2DEG:180/u},d={format:{},autodetect:[]},f=c.last,p=c.clip_rgb,h=c.type,m=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=this;if("object"===h(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];var r=f(e),i=!1;if(!r){i=!0,d.sorted||(d.autodetect=d.autodetect.sort((function(e,t){return t.p-e.p})),d.sorted=!0);for(var o=0,a=d.autodetect;o4?e[4]:1;return 1===o?[0,0,0,a]:[n>=1?0:255*(1-n)*(1-o),r>=1?0:255*(1-r)*(1-o),i>=1?0:255*(1-i)*(1-o),a]},S=c.unpack,C=c.type;v.prototype.cmyk=function(){return x(this._rgb)},y.cmyk=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["cmyk"])))},d.format.cmyk=_,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=S(e,"cmyk"),"array"===C(e)&&4===e.length)return"cmyk"}});var E=c.unpack,j=c.last,T=function(e){return Math.round(100*e)/100},O=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=E(e,"hsla"),r=j(e)||"lsa";return n[0]=T(n[0]||0),n[1]=T(100*n[1])+"%",n[2]=T(100*n[2])+"%","hsla"===r||n.length>3&&n[3]<1?(n[3]=n.length>3?n[3]:1,r="hsla"):n.length=3,r+"("+n.join(",")+")"},N=c.unpack,M=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=(e=N(e,"rgba"))[0],r=e[1],i=e[2];n/=255,r/=255,i/=255;var o,a,s=Math.min(n,r,i),l=Math.max(n,r,i),u=(l+s)/2;return l===s?(o=0,a=Number.NaN):o=u<.5?(l-s)/(l+s):(l-s)/(2-l-s),n==l?a=(r-i)/(l-s):r==l?a=2+(i-n)/(l-s):i==l&&(a=4+(n-r)/(l-s)),(a*=60)<0&&(a+=360),e.length>3&&void 0!==e[3]?[a,o,u,e[3]]:[a,o,u]},L=c.unpack,P=c.last,A=Math.round,D=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=L(e,"rgba"),r=P(e)||"rgb";return"hsl"==r.substr(0,3)?O(M(n),r):(n[0]=A(n[0]),n[1]=A(n[1]),n[2]=A(n[2]),("rgba"===r||n.length>3&&n[3]<1)&&(n[3]=n.length>3?n[3]:1,r="rgba"),r+"("+n.slice(0,"rgb"===r?3:4).join(",")+")")},R=c.unpack,I=Math.round,F=function(){for(var e,t=[],n=arguments.length;n--;)t[n]=arguments[n];var r,i,o,a=(t=R(t,"hsl"))[0],s=t[1],l=t[2];if(0===s)r=i=o=255*l;else{var u=[0,0,0],c=[0,0,0],d=l<.5?l*(1+s):l+s-l*s,f=2*l-d,p=a/360;u[0]=p+1/3,u[1]=p,u[2]=p-1/3;for(var h=0;h<3;h++)u[h]<0&&(u[h]+=1),u[h]>1&&(u[h]-=1),6*u[h]<1?c[h]=f+6*(d-f)*u[h]:2*u[h]<1?c[h]=d:3*u[h]<2?c[h]=f+(d-f)*(2/3-u[h])*6:c[h]=f;r=(e=[I(255*c[0]),I(255*c[1]),I(255*c[2])])[0],i=e[1],o=e[2]}return t.length>3?[r,i,o,t[3]]:[r,i,o,1]},z=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,U=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,W=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,H=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,B=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,$=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,V=Math.round,q=function(e){var t;if(e=e.toLowerCase().trim(),d.format.named)try{return d.format.named(e)}catch(e){}if(t=e.match(z)){for(var n=t.slice(1,4),r=0;r<3;r++)n[r]=+n[r];return n[3]=1,n}if(t=e.match(U)){for(var i=t.slice(1,5),o=0;o<4;o++)i[o]=+i[o];return i}if(t=e.match(W)){for(var a=t.slice(1,4),s=0;s<3;s++)a[s]=V(2.55*a[s]);return a[3]=1,a}if(t=e.match(H)){for(var l=t.slice(1,5),u=0;u<3;u++)l[u]=V(2.55*l[u]);return l[3]=+l[3],l}if(t=e.match(B)){var c=t.slice(1,4);c[1]*=.01,c[2]*=.01;var f=F(c);return f[3]=1,f}if(t=e.match($)){var p=t.slice(1,4);p[1]*=.01,p[2]*=.01;var h=F(p);return h[3]=+t[4],h}};q.test=function(e){return z.test(e)||U.test(e)||W.test(e)||H.test(e)||B.test(e)||$.test(e)};var G=q,Y=c.type;v.prototype.css=function(e){return D(this._rgb,e)},y.css=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["css"])))},d.format.css=G,d.autodetect.push({p:5,test:function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(!t.length&&"string"===Y(e)&&G.test(e))return"css"}});var X=c.unpack;d.format.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=X(e,"rgba");return n[0]*=255,n[1]*=255,n[2]*=255,n},y.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["gl"])))},v.prototype.gl=function(){var e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};var K=c.unpack,Q=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r=K(e,"rgb"),i=r[0],o=r[1],a=r[2],s=Math.min(i,o,a),l=Math.max(i,o,a),u=l-s,c=100*u/255,d=s/(255-u)*100;return 0===u?n=Number.NaN:(i===l&&(n=(o-a)/u),o===l&&(n=2+(a-i)/u),a===l&&(n=4+(i-o)/u),(n*=60)<0&&(n+=360)),[n,c,d]},J=c.unpack,Z=Math.floor,ee=function(){for(var e,t,n,r,i,o,a=[],s=arguments.length;s--;)a[s]=arguments[s];var l,u,c,d=(a=J(a,"hcg"))[0],f=a[1],p=a[2];p*=255;var h=255*f;if(0===f)l=u=c=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var m=Z(d/=60),v=d-m,g=p*(1-f),y=g+h*(1-v),b=g+h*v,w=g+h;switch(m){case 0:l=(e=[w,b,g])[0],u=e[1],c=e[2];break;case 1:l=(t=[y,w,g])[0],u=t[1],c=t[2];break;case 2:l=(n=[g,w,b])[0],u=n[1],c=n[2];break;case 3:l=(r=[g,y,w])[0],u=r[1],c=r[2];break;case 4:l=(i=[b,g,w])[0],u=i[1],c=i[2];break;case 5:l=(o=[w,g,y])[0],u=o[1],c=o[2]}}return[l,u,c,a.length>3?a[3]:1]},te=c.unpack,ne=c.type;v.prototype.hcg=function(){return Q(this._rgb)},y.hcg=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hcg"])))},d.format.hcg=ee,d.autodetect.push({p:1,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=te(e,"hcg"),"array"===ne(e)&&3===e.length)return"hcg"}});var re=c.unpack,ie=c.last,oe=Math.round,ae=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=re(e,"rgba"),r=n[0],i=n[1],o=n[2],a=n[3],s=ie(e)||"auto";void 0===a&&(a=1),"auto"===s&&(s=a<1?"rgba":"rgb");var l="000000"+((r=oe(r))<<16|(i=oe(i))<<8|(o=oe(o))).toString(16);l=l.substr(l.length-6);var u="0"+oe(255*a).toString(16);switch(u=u.substr(u.length-2),s.toLowerCase()){case"rgba":return"#"+l+u;case"argb":return"#"+u+l;default:return"#"+l}},se=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,le=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,ue=function(e){if(e.match(se)){4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var t=parseInt(e,16);return[t>>16,t>>8&255,255&t,1]}if(e.match(le)){5!==e.length&&9!==e.length||(e=e.substr(1)),4===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);var n=parseInt(e,16);return[n>>24&255,n>>16&255,n>>8&255,Math.round((255&n)/255*100)/100]}throw new Error("unknown hex color: "+e)},ce=c.type;v.prototype.hex=function(e){return ae(this._rgb,e)},y.hex=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hex"])))},d.format.hex=ue,d.autodetect.push({p:4,test:function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(!t.length&&"string"===ce(e)&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});var de=c.unpack,fe=c.TWOPI,pe=Math.min,he=Math.sqrt,me=Math.acos,ve=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r=de(e,"rgb"),i=r[0],o=r[1],a=r[2],s=pe(i/=255,o/=255,a/=255),l=(i+o+a)/3,u=l>0?1-s/l:0;return 0===u?n=NaN:(n=(i-o+(i-a))/2,n/=he((i-o)*(i-o)+(i-a)*(o-a)),n=me(n),a>o&&(n=fe-n),n/=fe),[360*n,u,l]},ge=c.unpack,ye=c.limit,be=c.TWOPI,we=c.PITHIRD,xe=Math.cos,ke=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r,i,o=(e=ge(e,"hsi"))[0],a=e[1],s=e[2];return isNaN(o)&&(o=0),isNaN(a)&&(a=0),o>360&&(o-=360),o<0&&(o+=360),(o/=360)<1/3?r=1-((i=(1-a)/3)+(n=(1+a*xe(be*o)/xe(we-be*o))/3)):o<2/3?i=1-((n=(1-a)/3)+(r=(1+a*xe(be*(o-=1/3))/xe(we-be*o))/3)):n=1-((r=(1-a)/3)+(i=(1+a*xe(be*(o-=2/3))/xe(we-be*o))/3)),[255*(n=ye(s*n*3)),255*(r=ye(s*r*3)),255*(i=ye(s*i*3)),e.length>3?e[3]:1]},_e=c.unpack,Se=c.type;v.prototype.hsi=function(){return ve(this._rgb)},y.hsi=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hsi"])))},d.format.hsi=ke,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=_e(e,"hsi"),"array"===Se(e)&&3===e.length)return"hsi"}});var Ce=c.unpack,Ee=c.type;v.prototype.hsl=function(){return M(this._rgb)},y.hsl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hsl"])))},d.format.hsl=F,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Ce(e,"hsl"),"array"===Ee(e)&&3===e.length)return"hsl"}});var je=c.unpack,Te=Math.min,Oe=Math.max,Ne=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r,i,o=(e=je(e,"rgb"))[0],a=e[1],s=e[2],l=Te(o,a,s),u=Oe(o,a,s),c=u-l;return i=u/255,0===u?(n=Number.NaN,r=0):(r=c/u,o===u&&(n=(a-s)/c),a===u&&(n=2+(s-o)/c),s===u&&(n=4+(o-a)/c),(n*=60)<0&&(n+=360)),[n,r,i]},Me=c.unpack,Le=Math.floor,Pe=function(){for(var e,t,n,r,i,o,a=[],s=arguments.length;s--;)a[s]=arguments[s];var l,u,c,d=(a=Me(a,"hsv"))[0],f=a[1],p=a[2];if(p*=255,0===f)l=u=c=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var h=Le(d/=60),m=d-h,v=p*(1-f),g=p*(1-f*m),y=p*(1-f*(1-m));switch(h){case 0:l=(e=[p,y,v])[0],u=e[1],c=e[2];break;case 1:l=(t=[g,p,v])[0],u=t[1],c=t[2];break;case 2:l=(n=[v,p,y])[0],u=n[1],c=n[2];break;case 3:l=(r=[v,g,p])[0],u=r[1],c=r[2];break;case 4:l=(i=[y,v,p])[0],u=i[1],c=i[2];break;case 5:l=(o=[p,v,g])[0],u=o[1],c=o[2]}}return[l,u,c,a.length>3?a[3]:1]},Ae=c.unpack,De=c.type;v.prototype.hsv=function(){return Ne(this._rgb)},y.hsv=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hsv"])))},d.format.hsv=Pe,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Ae(e,"hsv"),"array"===De(e)&&3===e.length)return"hsv"}});var Re={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},Ie=c.unpack,Fe=Math.pow,ze=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=Ie(e,"rgb"),r=n[0],i=n[1],o=n[2],a=He(r,i,o),s=a[0],l=a[1],u=116*l-16;return[u<0?0:u,500*(s-l),200*(l-a[2])]},Ue=function(e){return(e/=255)<=.04045?e/12.92:Fe((e+.055)/1.055,2.4)},We=function(e){return e>Re.t3?Fe(e,1/3):e/Re.t2+Re.t0},He=function(e,t,n){return e=Ue(e),t=Ue(t),n=Ue(n),[We((.4124564*e+.3575761*t+.1804375*n)/Re.Xn),We((.2126729*e+.7151522*t+.072175*n)/Re.Yn),We((.0193339*e+.119192*t+.9503041*n)/Re.Zn)]},Be=ze,$e=c.unpack,Ve=Math.pow,qe=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r,i,o=(e=$e(e,"lab"))[0],a=e[1],s=e[2];return r=(o+16)/116,n=isNaN(a)?r:r+a/500,i=isNaN(s)?r:r-s/200,r=Re.Yn*Ye(r),n=Re.Xn*Ye(n),i=Re.Zn*Ye(i),[Ge(3.2404542*n-1.5371385*r-.4985314*i),Ge(-.969266*n+1.8760108*r+.041556*i),Ge(.0556434*n-.2040259*r+1.0572252*i),e.length>3?e[3]:1]},Ge=function(e){return 255*(e<=.00304?12.92*e:1.055*Ve(e,1/2.4)-.055)},Ye=function(e){return e>Re.t1?e*e*e:Re.t2*(e-Re.t0)},Xe=qe,Ke=c.unpack,Qe=c.type;v.prototype.lab=function(){return Be(this._rgb)},y.lab=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["lab"])))},d.format.lab=Xe,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Ke(e,"lab"),"array"===Qe(e)&&3===e.length)return"lab"}});var Je=c.unpack,Ze=c.RAD2DEG,et=Math.sqrt,tt=Math.atan2,nt=Math.round,rt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=Je(e,"lab"),r=n[0],i=n[1],o=n[2],a=et(i*i+o*o),s=(tt(o,i)*Ze+360)%360;return 0===nt(1e4*a)&&(s=Number.NaN),[r,a,s]},it=c.unpack,ot=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=it(e,"rgb"),r=n[0],i=n[1],o=n[2],a=Be(r,i,o),s=a[0],l=a[1],u=a[2];return rt(s,l,u)},at=c.unpack,st=c.DEG2RAD,lt=Math.sin,ut=Math.cos,ct=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=at(e,"lch"),r=n[0],i=n[1],o=n[2];return isNaN(o)&&(o=0),[r,ut(o*=st)*i,lt(o)*i]},dt=c.unpack,ft=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=(e=dt(e,"lch"))[0],r=e[1],i=e[2],o=ct(n,r,i),a=o[0],s=o[1],l=o[2],u=Xe(a,s,l);return[u[0],u[1],u[2],e.length>3?e[3]:1]},pt=c.unpack,ht=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=pt(e,"hcl").reverse();return ft.apply(void 0,n)},mt=c.unpack,vt=c.type;v.prototype.lch=function(){return ot(this._rgb)},v.prototype.hcl=function(){return ot(this._rgb).reverse()},y.lch=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["lch"])))},y.hcl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hcl"])))},d.format.lch=ft,d.format.hcl=ht,["lch","hcl"].forEach((function(e){return d.autodetect.push({p:2,test:function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];if(t=mt(t,e),"array"===vt(t)&&3===t.length)return e}})}));var gt={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},yt=c.type;v.prototype.name=function(){for(var e=ae(this._rgb,"rgb"),t=0,n=Object.keys(gt);t0;)t[n]=arguments[n+1];if(!t.length&&"string"===yt(e)&>[e.toLowerCase()])return"named"}});var bt=c.unpack,wt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=bt(e,"rgb");return(n[0]<<16)+(n[1]<<8)+n[2]},xt=c.type,kt=function(e){if("number"==xt(e)&&e>=0&&e<=16777215)return[e>>16,e>>8&255,255&e,1];throw new Error("unknown num color: "+e)},_t=c.type;v.prototype.num=function(){return wt(this._rgb)},y.num=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["num"])))},d.format.num=kt,d.autodetect.push({p:5,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(1===e.length&&"number"===_t(e[0])&&e[0]>=0&&e[0]<=16777215)return"num"}});var St=c.unpack,Ct=c.type,Et=Math.round;v.prototype.rgb=function(e){return void 0===e&&(e=!0),!1===e?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Et)},v.prototype.rgba=function(e){return void 0===e&&(e=!0),this._rgb.slice(0,4).map((function(t,n){return n<3?!1===e?t:Et(t):t}))},y.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["rgb"])))},d.format.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=St(e,"rgba");return void 0===n[3]&&(n[3]=1),n},d.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=St(e,"rgba"),"array"===Ct(e)&&(3===e.length||4===e.length&&"number"==Ct(e[3])&&e[3]>=0&&e[3]<=1))return"rgb"}});var jt=Math.log,Tt=function(e){var t,n,r,i=e/100;return i<66?(t=255,n=-155.25485562709179-.44596950469579133*(n=i-2)+104.49216199393888*jt(n),r=i<20?0:.8274096064007395*(r=i-10)-254.76935184120902+115.67994401066147*jt(r)):(t=351.97690566805693+.114206453784165*(t=i-55)-40.25366309332127*jt(t),n=325.4494125711974+.07943456536662342*(n=i-50)-28.0852963507957*jt(n),r=255),[t,n,r,1]},Ot=c.unpack,Nt=Math.round,Mt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n,r=Ot(e,"rgb"),i=r[0],o=r[2],a=1e3,s=4e4,l=.4;s-a>l;){var u=Tt(n=.5*(s+a));u[2]/u[0]>=o/i?s=n:a=n}return Nt(n)};v.prototype.temp=v.prototype.kelvin=v.prototype.temperature=function(){return Mt(this._rgb)},y.temp=y.kelvin=y.temperature=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["temp"])))},d.format.temp=d.format.kelvin=d.format.temperature=Tt;var Lt=c.type;v.prototype.alpha=function(e,t){return void 0===t&&(t=!1),void 0!==e&&"number"===Lt(e)?t?(this._rgb[3]=e,this):new v([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},v.prototype.clipped=function(){return this._rgb._clipped||!1},v.prototype.darken=function(e){void 0===e&&(e=1);var t=this,n=t.lab();return n[0]-=Re.Kn*e,new v(n,"lab").alpha(t.alpha(),!0)},v.prototype.brighten=function(e){return void 0===e&&(e=1),this.darken(-e)},v.prototype.darker=v.prototype.darken,v.prototype.brighter=v.prototype.brighten,v.prototype.get=function(e){var t=e.split("."),n=t[0],r=t[1],i=this[n]();if(r){var o=n.indexOf(r);if(o>-1)return i[o];throw new Error("unknown channel "+r+" in mode "+n)}return i};var Pt=c.type,At=Math.pow,Dt=1e-7,Rt=20;v.prototype.luminance=function(e){if(void 0!==e&&"number"===Pt(e)){if(0===e)return new v([0,0,0,this._rgb[3]],"rgb");if(1===e)return new v([255,255,255,this._rgb[3]],"rgb");var t=this.luminance(),n="rgb",r=Rt,i=function(t,o){var a=t.interpolate(o,.5,n),s=a.luminance();return Math.abs(e-s)e?i(t,a):i(a,o)},o=(t>e?i(new v([0,0,0]),this):i(this,new v([255,255,255]))).rgb();return new v(o.concat([this._rgb[3]]))}return It.apply(void 0,this._rgb.slice(0,3))};var It=function(e,t,n){return.2126*(e=Ft(e))+.7152*(t=Ft(t))+.0722*(n=Ft(n))},Ft=function(e){return(e/=255)<=.03928?e/12.92:At((e+.055)/1.055,2.4)},zt={},Ut=c.type,Wt=function(e,t,n){void 0===n&&(n=.5);for(var r=[],i=arguments.length-3;i-- >0;)r[i]=arguments[i+3];var o=r[0]||"lrgb";if(zt[o]||r.length||(o=Object.keys(zt)[0]),!zt[o])throw new Error("interpolation mode "+o+" is not defined");return"object"!==Ut(e)&&(e=new v(e)),"object"!==Ut(t)&&(t=new v(t)),zt[o](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};v.prototype.mix=v.prototype.interpolate=function(e,t){void 0===t&&(t=.5);for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return Wt.apply(void 0,[this,e,t].concat(n))},v.prototype.premultiply=function(e){void 0===e&&(e=!1);var t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new v([t[0]*n,t[1]*n,t[2]*n,n],"rgb")},v.prototype.saturate=function(e){void 0===e&&(e=1);var t=this,n=t.lch();return n[1]+=Re.Kn*e,n[1]<0&&(n[1]=0),new v(n,"lch").alpha(t.alpha(),!0)},v.prototype.desaturate=function(e){return void 0===e&&(e=1),this.saturate(-e)};var Ht=c.type;v.prototype.set=function(e,t,n){void 0===n&&(n=!1);var r=e.split("."),i=r[0],o=r[1],a=this[i]();if(o){var s=i.indexOf(o);if(s>-1){if("string"==Ht(t))switch(t.charAt(0)){case"+":case"-":a[s]+=+t;break;case"*":a[s]*=+t.substr(1);break;case"/":a[s]/=+t.substr(1);break;default:a[s]=+t}else{if("number"!==Ht(t))throw new Error("unsupported value for Color.set");a[s]=t}var l=new v(a,i);return n?(this._rgb=l._rgb,this):l}throw new Error("unknown channel "+o+" in mode "+i)}return a};var Bt=function(e,t,n){var r=e._rgb,i=t._rgb;return new v(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"rgb")};zt.rgb=Bt;var $t=Math.sqrt,Vt=Math.pow,qt=function(e,t,n){var r=e._rgb,i=r[0],o=r[1],a=r[2],s=t._rgb,l=s[0],u=s[1],c=s[2];return new v($t(Vt(i,2)*(1-n)+Vt(l,2)*n),$t(Vt(o,2)*(1-n)+Vt(u,2)*n),$t(Vt(a,2)*(1-n)+Vt(c,2)*n),"rgb")};zt.lrgb=qt;var Gt=function(e,t,n){var r=e.lab(),i=t.lab();return new v(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"lab")};zt.lab=Gt;var Yt=function(e,t,n,r){var i,o,a,s,l,u,c,d,f,p,h,m;return"hsl"===r?(a=e.hsl(),s=t.hsl()):"hsv"===r?(a=e.hsv(),s=t.hsv()):"hcg"===r?(a=e.hcg(),s=t.hcg()):"hsi"===r?(a=e.hsi(),s=t.hsi()):"lch"!==r&&"hcl"!==r||(r="hcl",a=e.hcl(),s=t.hcl()),"h"===r.substr(0,1)&&(l=(i=a)[0],c=i[1],f=i[2],u=(o=s)[0],d=o[1],p=o[2]),isNaN(l)||isNaN(u)?isNaN(l)?isNaN(u)?m=Number.NaN:(m=u,1!=f&&0!=f||"hsv"==r||(h=d)):(m=l,1!=p&&0!=p||"hsv"==r||(h=c)):m=l+n*(u>l&&u-l>180?u-(l+360):u180?u+360-l:u-l),void 0===h&&(h=c+n*(d-c)),new v([m,h,f+n*(p-f)],r)},Xt=function(e,t,n){return Yt(e,t,n,"lch")};zt.lch=Xt,zt.hcl=Xt;var Kt=function(e,t,n){var r=e.num(),i=t.num();return new v(r+n*(i-r),"num")};zt.num=Kt;var Qt=function(e,t,n){return Yt(e,t,n,"hcg")};zt.hcg=Qt;var Jt=function(e,t,n){return Yt(e,t,n,"hsi")};zt.hsi=Jt;var Zt=function(e,t,n){return Yt(e,t,n,"hsl")};zt.hsl=Zt;var en=function(e,t,n){return Yt(e,t,n,"hsv")};zt.hsv=en;var tn=c.clip_rgb,nn=Math.pow,rn=Math.sqrt,on=Math.PI,an=Math.cos,sn=Math.sin,ln=Math.atan2,un=function(e,t,n){void 0===t&&(t="lrgb"),void 0===n&&(n=null);var r=e.length;n||(n=Array.from(new Array(r)).map((function(){return 1})));var i=r/n.reduce((function(e,t){return e+t}));if(n.forEach((function(e,t){n[t]*=i})),e=e.map((function(e){return new v(e)})),"lrgb"===t)return cn(e,n);for(var o=e.shift(),a=o.get(t),s=[],l=0,u=0,c=0;c=360;)h-=360;a[p]=h}else a[p]=a[p]/s[p];return f/=r,new v(a,t).alpha(f>.99999?1:f,!0)},cn=function(e,t){for(var n=e.length,r=[0,0,0,0],i=0;i.9999999&&(r[3]=1),new v(tn(r))},dn=c.type,fn=Math.pow,pn=function(e){var t="rgb",n=y("#ccc"),r=0,i=[0,1],o=[],a=[0,0],s=!1,l=[],u=!1,c=0,d=1,f=!1,p={},h=!0,m=1,v=function(e){if((e=e||["#fff","#000"])&&"string"===dn(e)&&y.brewer&&y.brewer[e.toLowerCase()]&&(e=y.brewer[e.toLowerCase()]),"array"===dn(e)){1===e.length&&(e=[e[0],e[0]]),e=e.slice(0);for(var t=0;t=s[n];)n++;return n-1}return 0},b=function(e){return e},w=function(e){return e},x=function(e,r){var i,u;if(null==r&&(r=!1),isNaN(e)||null===e)return n;u=r?e:s&&s.length>2?g(e)/(s.length-2):d!==c?(e-c)/(d-c):1,u=w(u),r||(u=b(u)),1!==m&&(u=fn(u,m)),u=a[0]+u*(1-a[0]-a[1]),u=Math.min(1,Math.max(0,u));var f=Math.floor(1e4*u);if(h&&p[f])i=p[f];else{if("array"===dn(l))for(var v=0;v=x&&v===o.length-1){i=l[v];break}if(u>x&&u2){var u=e.map((function(t,n){return n/(e.length-1)})),f=e.map((function(e){return(e-c)/(d-c)}));f.every((function(e,t){return u[t]===e}))||(w=function(e){if(e<=0||e>=1)return e;for(var t=0;e>=f[t+1];)t++;var n=(e-f[t])/(f[t+1]-f[t]);return u[t]+n*(u[t+1]-u[t])})}}return i=[c,d],_},_.mode=function(e){return arguments.length?(t=e,k(),_):t},_.range=function(e,t){return v(e,t),_},_.out=function(e){return u=e,_},_.spread=function(e){return arguments.length?(r=e,_):r},_.correctLightness=function(e){return null==e&&(e=!0),f=e,k(),b=f?function(e){for(var t=x(0,!0).lab()[0],n=x(1,!0).lab()[0],r=t>n,i=x(e,!0).lab()[0],o=t+(n-t)*e,a=i-o,s=0,l=1,u=20;Math.abs(a)>.01&&u-- >0;)r&&(a*=-1),a<0?(s=e,e+=.5*(l-e)):(l=e,e+=.5*(s-e)),i=x(e,!0).lab()[0],a=i-o;return e}:function(e){return e},_},_.padding=function(e){return null!=e?("number"===dn(e)&&(e=[e,e]),a=e,_):a},_.colors=function(t,n){arguments.length<2&&(n="hex");var r=[];if(0===arguments.length)r=l.slice(0);else if(1===t)r=[_(.5)];else if(t>1){var o=i[0],a=i[1]-o;r=hn(0,t,!1).map((function(e){return _(o+e/(t-1)*a)}))}else{e=[];var u=[];if(s&&s.length>2)for(var c=1,d=s.length,f=1<=d;f?cd;f?c++:c--)u.push(.5*(s[c-1]+s[c]));else u=i;r=u.map((function(e){return _(e)}))}return y[n]&&(r=r.map((function(e){return e[n]()}))),r},_.cache=function(e){return null!=e?(h=e,_):h},_.gamma=function(e){return null!=e?(m=e,_):m},_.nodata=function(e){return null!=e?(n=y(e),_):n},_};function hn(e,t,n){for(var r=[],i=eo;i?a++:a--)r.push(a);return r}var mn=function(e){var t,n,r,i,o,a,s;if(2===(e=e.map((function(e){return new v(e)}))).length)t=e.map((function(e){return e.lab()})),o=t[0],a=t[1],i=function(e){var t=[0,1,2].map((function(t){return o[t]+e*(a[t]-o[t])}));return new v(t,"lab")};else if(3===e.length)n=e.map((function(e){return e.lab()})),o=n[0],a=n[1],s=n[2],i=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*o[t]+2*(1-e)*e*a[t]+e*e*s[t]}));return new v(t,"lab")};else if(4===e.length){var l;r=e.map((function(e){return e.lab()})),o=r[0],a=r[1],s=r[2],l=r[3],i=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*(1-e)*o[t]+3*(1-e)*(1-e)*e*a[t]+3*(1-e)*e*e*s[t]+e*e*e*l[t]}));return new v(t,"lab")}}else if(5===e.length){var u=mn(e.slice(0,3)),c=mn(e.slice(2,5));i=function(e){return e<.5?u(2*e):c(2*(e-.5))}}return i},vn=function(e){var t=mn(e);return t.scale=function(){return pn(t)},t},gn=function(e,t,n){if(!gn[n])throw new Error("unknown blend mode "+n);return gn[n](e,t)},yn=function(e){return function(t,n){var r=y(n).rgb(),i=y(t).rgb();return y.rgb(e(r,i))}},bn=function(e){return function(t,n){var r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r}},wn=function(e){return e},xn=function(e,t){return e*t/255},kn=function(e,t){return e>t?t:e},_n=function(e,t){return e>t?e:t},Sn=function(e,t){return 255*(1-(1-e/255)*(1-t/255))},Cn=function(e,t){return t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255))},En=function(e,t){return 255*(1-(1-t/255)/(e/255))},jn=function(e,t){return 255===e||(e=t/255*255/(1-e/255))>255?255:e};gn.normal=yn(bn(wn)),gn.multiply=yn(bn(xn)),gn.screen=yn(bn(Sn)),gn.overlay=yn(bn(Cn)),gn.darken=yn(bn(kn)),gn.lighten=yn(bn(_n)),gn.dodge=yn(bn(jn)),gn.burn=yn(bn(En));for(var Tn=gn,On=c.type,Nn=c.clip_rgb,Mn=c.TWOPI,Ln=Math.pow,Pn=Math.sin,An=Math.cos,Dn=function(e,t,n,r,i){void 0===e&&(e=300),void 0===t&&(t=-1.5),void 0===n&&(n=1),void 0===r&&(r=1),void 0===i&&(i=[0,1]);var o,a=0;"array"===On(i)?o=i[1]-i[0]:(o=0,i=[i,i]);var s=function(s){var l=Mn*((e+120)/360+t*s),u=Ln(i[0]+o*s,r),c=(0!==a?n[0]+s*a:n)*u*(1-u)/2,d=An(l),f=Pn(l);return y(Nn([255*(u+c*(-.14861*d+1.78277*f)),255*(u+c*(-.29227*d-.90649*f)),255*(u+c*(1.97294*d)),1]))};return s.start=function(t){return null==t?e:(e=t,s)},s.rotations=function(e){return null==e?t:(t=e,s)},s.gamma=function(e){return null==e?r:(r=e,s)},s.hue=function(e){return null==e?n:("array"===On(n=e)?0==(a=n[1]-n[0])&&(n=n[1]):a=0,s)},s.lightness=function(e){return null==e?i:("array"===On(e)?(i=e,o=e[1]-e[0]):(i=[e,e],o=0),s)},s.scale=function(){return y.scale(s)},s.hue(n),s},Rn="0123456789abcdef",In=Math.floor,Fn=Math.random,zn=function(){for(var e="#",t=0;t<6;t++)e+=Rn.charAt(In(16*Fn()));return new v(e,"hex")},Un=Math.log,Wn=Math.pow,Hn=Math.floor,Bn=Math.abs,$n=function(e,t){void 0===t&&(t=null);var n={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===a(e)&&(e=Object.values(e)),e.forEach((function(e){t&&"object"===a(e)&&(e=e[t]),null==e||isNaN(e)||(n.values.push(e),n.sum+=e,en.max&&(n.max=e),n.count+=1)})),n.domain=[n.min,n.max],n.limits=function(e,t){return Vn(n,e,t)},n},Vn=function(e,t,n){void 0===t&&(t="equal"),void 0===n&&(n=7),"array"==a(e)&&(e=$n(e));var r=e.min,i=e.max,o=e.values.sort((function(e,t){return e-t}));if(1===n)return[r,i];var s=[];if("c"===t.substr(0,1)&&(s.push(r),s.push(i)),"e"===t.substr(0,1)){s.push(r);for(var l=1;l 0");var u=Math.LOG10E*Un(r),c=Math.LOG10E*Un(i);s.push(r);for(var d=1;d200&&(w=!1)}for(var R={},I=0;Ir?(n+.05)/(r+.05):(r+.05)/(n+.05)},Yn=Math.sqrt,Xn=Math.atan2,Kn=Math.abs,Qn=Math.cos,Jn=Math.PI,Zn=function(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=1),e=new v(e),t=new v(t);for(var i=Array.from(e.lab()),o=i[0],a=i[1],s=i[2],l=Array.from(t.lab()),u=l[0],c=l[1],d=l[2],f=Yn(a*a+s*s),p=Yn(c*c+d*d),h=o<16?.511:.040975*o/(1+.01765*o),m=.0638*f/(1+.0131*f)+.638,g=f<1e-6?0:180*Xn(s,a)/Jn;g<0;)g+=360;for(;g>=360;)g-=360;var y=g>=164&&g<=345?.56+Kn(.2*Qn(Jn*(g+168)/180)):.36+Kn(.4*Qn(Jn*(g+35)/180)),b=f*f*f*f,w=Yn(b/(b+1900)),x=m*(w*y+1-w),k=f-p,_=a-c,S=s-d,C=(o-u)/(n*h),E=k/(r*m);return Yn(C*C+E*E+(_*_+S*S-k*k)/(x*x))},er=function(e,t,n){void 0===n&&(n="lab"),e=new v(e),t=new v(t);var r=e.get(n),i=t.get(n),o=0;for(var a in r){var s=(r[a]||0)-(i[a]||0);o+=s*s}return Math.sqrt(o)},tr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];try{return new(Function.prototype.bind.apply(v,[null].concat(e))),!0}catch(e){return!1}},nr={cool:function(){return pn([y.hsl(180,1,.9),y.hsl(250,.7,.4)])},hot:function(){return pn(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")}},rr={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},ir=0,or=Object.keys(rr);ir2),v=/Android/.test(e),g=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=d&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(d=!1,l=!0);var k=y&&(u||d&&(null==x||x<12.11)),_=n||a&&s>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var C,E=function(e,t){var n=e.className,r=S(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function j(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return j(e).appendChild(t)}function O(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?D=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(D=function(e){try{e.select()}catch(e){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function U(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var G=[""];function Y(e){for(;G.length<=e;)G.push(X(G)+" ");return G[e]}function X(e){return e[e.length-1]}function K(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function ae(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function le(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var ue=null;function ce(e,t,n){var r;ue=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ue=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ue=i)}return null!=r?r:ue}var de=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var u="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var c=e.length,d=[],f=0;f-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ge(e,t){var n=me(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function xe(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){ve(this,e,t)}}function ke(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function _e(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Se(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ce(e){ke(e),_e(e)}function Ee(e){return e.target||e.srcElement}function je(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Te,Oe,Ne=function(){if(a&&s<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}();function Me(e){if(null==Te){var t=O("span","​");T(e,O("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Te=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Te?O("span","​"):O("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Le(e){if(null!=Oe)return Oe;var t=T(e,document.createTextNode("AخA")),n=C(t,0,1).getBoundingClientRect(),r=C(t,1,2).getBoundingClientRect();return j(e),!(!n||n.left==n.right)&&(Oe=r.right-n.right<3)}var Pe,Ae=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},De=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Re="oncopy"in(Pe=O("div"))||(Pe.setAttribute("oncopy","return;"),"function"==typeof Pe.oncopy),Ie=null;function Fe(e){if(null!=Ie)return Ie;var t=T(e,O("span","x")),n=t.getBoundingClientRect(),r=C(t,0,1).getBoundingClientRect();return Ie=Math.abs(n.left-r.left)>1}var ze={},Ue={};function We(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ze[e]=t}function He(e,t){Ue[e]=t}function Be(e){if("string"==typeof e&&Ue.hasOwnProperty(e))e=Ue[e];else if(e&&"string"==typeof e.name&&Ue.hasOwnProperty(e.name)){var t=Ue[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Be("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Be("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function $e(e,t){t=Be(t);var n=ze[t.name];if(!n)return $e(e,"text/plain");var r=n(e,t);if(Ve.hasOwnProperty(t.name)){var i=Ve[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Ve={};function qe(e,t){I(t,Ve.hasOwnProperty(e)?Ve[e]:Ve[e]={})}function Ge(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ye(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Xe(e,t,n){return!e.startState||e.startState(t,n)}var Ke=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Qe(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?ot(n,Qe(e,n).text.length):pt(t,Qe(e,t.line).text.length)}function pt(e,t){var n=e.ch;return null==n||n>t?ot(e.line,t):n<0?ot(e.line,0):e}function ht(e,t){for(var n=[],r=0;r=this.string.length},Ke.prototype.sol=function(){return this.pos==this.lineStart},Ke.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ke.prototype.next=function(){if(this.post},Ke.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ke.prototype.skipToEnd=function(){this.pos=this.string.length},Ke.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ke.prototype.backUp=function(e){this.pos-=e},Ke.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ke.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ke.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ke.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ke.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var mt=function(e,t){this.state=e,this.lookAhead=t},vt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function gt(e,t,n,r){var i=[e.state.modeGen],o={};Et(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,u=0;n.state=!0,Et(e,t.text,s.mode,n,(function(e,t){for(var n=l;ue&&i.splice(l,1,e,i[l+1],r),l+=2,u=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&Ge(e.doc.mode,r.state),o=gt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function bt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new vt(r,!0,t);var o=jt(e,t,n),a=o>r.first&&Qe(r,o-1).stateAfter,s=a?vt.fromSaved(r,a,o):new vt(r,Xe(r.mode),o);return r.iter(o,t,(function(n){wt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}vt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},vt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},vt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},vt.fromSaved=function(e,t,n){return t instanceof mt?new vt(e,Ge(e.mode,t.state),n,t.lookAhead):new vt(e,Ge(e.mode,t),n)},vt.prototype.save=function(e){var t=!1!==e?Ge(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new mt(t,this.maxLookAhead):t};var _t=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function St(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=Qe(a,(t=ft(a,t)).line),u=bt(e,t.line,n),c=new Ke(l.text,e.options.tabSize,u);for(r&&(o=[]);(r||c.pose.options.maxHighlightLength?(s=!1,a&&wt(e,t,r,d.pos),d.pos=t.length,l=null):l=Ct(kt(n,d,r.state,f),o),f){var p=f[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||c!=l){for(;ua;--s){if(s<=o.first)return o.first;var l=Qe(o,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof mt?u.lookAhead:0)<=o.modeFrontier))return s;var c=F(l.text,null,e.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}function Tt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=Qe(e,r).stateAfter;if(i&&(!(i instanceof mt)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new Pt(a,o.from,s?null:o.to))}}return r}function Ft(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var b=0;b0)){var c=[l,1],d=at(u.from,s.from),f=at(u.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}function Ht(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!n||qt(n,o.marker)<0)&&(n=o.marker)}return n}function Qt(e,t,n,r,i){var o=Qe(e,t),a=Nt&&o.markedSpans;if(a)for(var s=0;s=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(u.to,n)>=0:at(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(u.from,r)<=0:at(u.from,r)<0)))return!0}}}function Jt(e){for(var t;t=Yt(e);)e=t.find(-1,!0).line;return e}function Zt(e){for(var t;t=Xt(e);)e=t.find(1,!0).line;return e}function en(e){for(var t,n;t=Xt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function tn(e,t){var n=Qe(e,t),r=Jt(n);return n==r?t:tt(r)}function nn(e,t){if(t>e.lastLine())return t;var n,r=Qe(e,t);if(!rn(e,r))return t;for(;n=Xt(r);)r=n.find(1,!0).line;return tt(r)+1}function rn(e,t){var n=Nt&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var un=function(e,t,n){this.text=e,Bt(this,t),this.height=n?n(this):1};function cn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ht(e),Bt(e,n);var i=r?r(e):1;i!=e.height&&et(e,i)}function dn(e){e.parent=null,Ht(e)}un.prototype.lineNo=function(){return tt(this)},xe(un);var fn={},pn={};function hn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?pn:fn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function mn(e,t){var n=N("span",null,null,l?"padding-right: .1px":null),r={pre:N("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=gn,Le(e.display.measure)&&(a=fe(o,e.doc.direction))&&(r.addToken=bn(r.addToken,a)),r.map=[],xn(o,r,yt(e,o,t!=e.display.externalMeasured&&tt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=A(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=A(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Me(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ge(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=A(r.pre.className,r.textClass||"")),r}function vn(e){var t=O("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gn(e,t,n,r,i,o,l){if(t){var u,c=e.splitSpaces?yn(t,e.trailingSpace):t,d=e.cm.state.specialChars,f=!1;if(d.test(t)){u=document.createDocumentFragment();for(var p=0;;){d.lastIndex=p;var h=d.exec(t),m=h?h.index-p:t.length-p;if(m){var v=document.createTextNode(c.slice(p,p+m));a&&s<9?u.appendChild(O("span",[v])):u.appendChild(v),e.map.push(e.pos,e.pos+m,v),e.col+=m,e.pos+=m}if(!h)break;p+=m+1;var g=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(g=u.appendChild(O("span",Y(b),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?((g=u.appendChild(O("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((g=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),a&&s<9?u.appendChild(O("span",[g])):u.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),a&&s<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||i||f||o||l){var w=n||"";r&&(w+=r),i&&(w+=i);var x=O("span",[u],w,o);if(l)for(var k in l)l.hasOwnProperty(k)&&"style"!=k&&"class"!=k&&x.setAttribute(k,l[k]);return e.content.appendChild(x)}e.content.appendChild(u)}}function yn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&d.from<=u);f++);if(d.to>=c)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-u),i,o,null,s,l),o=null,r=r.slice(d.to-u),u=d.to}}}function wn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function xn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,u,c,d,f,p=i.length,h=0,m=1,v="",g=0;;){if(g==h){l=u=c=s="",f=null,d=null,g=1/0;for(var y=[],b=void 0,w=0;wh||k.collapsed&&x.to==h&&x.from==h)){if(null!=x.to&&x.to!=h&&g>x.to&&(g=x.to,u=""),k.className&&(l+=" "+k.className),k.css&&(s=(s?s+";":"")+k.css),k.startStyle&&x.from==h&&(c+=" "+k.startStyle),k.endStyle&&x.to==g&&(b||(b=[])).push(k.endStyle,x.to),k.title&&((f||(f={})).title=k.title),k.attributes)for(var _ in k.attributes)(f||(f={}))[_]=k.attributes[_];k.collapsed&&(!d||qt(d.marker,k)<0)&&(d=x)}else x.from>h&&g>x.from&&(g=x.from)}if(b)for(var S=0;S=p)break;for(var E=Math.min(p,g);;){if(v){var j=h+v.length;if(!d){var T=j>E?v.slice(0,E-h):v;t.addToken(t,T,a?a+l:l,c,h+T.length==g?u:"",s,f)}if(j>=E){v=v.slice(E-h),h=E;break}h=j,c=""}v=i.slice(o,o=n[m++]),a=hn(n[m++],t.cm.options)}}else for(var O=1;O2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Jn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Zn(e,t){var n=tt(t=Jt(t)),r=e.display.externalMeasured=new kn(e.doc,t,n);r.lineN=n;var i=r.built=mn(e,r);return r.text=i.pre,T(e.display.lineMeasure,i.pre),r}function er(e,t,n,r){return rr(e,nr(e,t),n,r)}function tr(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],a="left";if("right"==n&&i==l-s)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function lr(e,t,n,r){var i,o=ar(t.map,n,r),l=o.node,u=o.start,c=o.end,d=o.collapse;if(3==l.nodeType){for(var f=0;f<4;f++){for(;u&&oe(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c0&&(d=r="right"),i=e.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==r?p.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!u&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+Nr(e.display),top:h.top,bottom:h.bottom}:or}for(var m=i.top-t.rect.top,v=i.bottom-t.rect.top,g=(m+v)/2,y=t.view.measure.heights,b=0;b=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var d=ce(s,l,u),f=ue,p=c(l,d,"before"==u);return null!=f&&(p.other=c(l,f,"before"!=u)),p}function wr(e,t){var n=0;t=ft(e.doc,t),e.options.lineWrapping||(n=Nr(e.display)*t.ch);var r=Qe(e.doc,t.line),i=an(r)+Vn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function xr(e,t,n,r,i){var o=ot(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function kr(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return xr(r.first,0,null,-1,-1);var i=nt(r,n),o=r.first+r.size-1;if(i>o)return xr(r.first+r.size-1,Qe(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Qe(r,i);;){var s=Er(e,a,i,t,n),l=Kt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;a=Qe(r,i=u.line)}}function _r(e,t,n,r){r-=mr(t);var i=t.text.length,o=se((function(t){return rr(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=se((function(t){return rr(e,n,t).top>r}),o,i)}}function Sr(e,t,n,r){return n||(n=nr(e,t)),_r(e,t,n,vr(e,t,rr(e,n,r),"line").top)}function Cr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Er(e,t,n,r,i){i-=an(t);var o=nr(e,t),a=mr(t),s=0,l=t.text.length,u=!0,c=fe(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?Tr:jr)(e,t,n,o,c,r,i);s=(u=1!=d.level)?d.from:d.to-1,l=u?d.to:d.from-1}var f,p,h=null,m=null,v=se((function(t){var n=rr(e,o,t);return n.top+=a,n.bottom+=a,!!Cr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(h=t,m=n),!0)}),s,l),g=!1;if(m){var y=r-m.left=w.bottom?1:0}return xr(n,v=ae(t.text,v,1),p,g,r-f)}function jr(e,t,n,r,i,o,a){var s=se((function(s){var l=i[s],u=1!=l.level;return Cr(br(e,ot(n,u?l.to:l.from,u?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var u=1!=l.level,c=br(e,ot(n,u?l.from:l.to,u?"after":"before"),"line",t,r);Cr(c,o,a,!0)&&c.top>a&&(l=i[s-1])}return l}function Tr(e,t,n,r,i,o,a){var s=_r(e,t,r,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,d=null,f=0;f=u||p.to<=l)){var h=rr(e,r,1!=p.level?Math.min(u,p.to)-1:Math.max(l,p.from)).right,m=hm)&&(c=p,d=m)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function Or(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ir){ir=O("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ir.appendChild(document.createTextNode("x")),ir.appendChild(O("br"));ir.appendChild(document.createTextNode("x"))}T(e.measure,ir);var n=ir.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),j(e.measure),n||1}function Nr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),n=O("pre",[t],"CodeMirror-line-like");T(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Mr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Lr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Lr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Pr(e){var t=Or(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Nr(e.display)-3);return function(i){if(rn(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=Qe(e.doc,u.line).text).length==u.ch){var c=F(l,l.length,e.options.tabSize)-l.length;u=ot(u.line,Math.max(0,Math.round((o-Gn(e.display).left)/Nr(e.display))-c))}return u}function Rr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Nt&&tn(e.doc,t)i.viewFrom?zr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)zr(e);else if(t<=i.viewFrom){var o=Ur(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):zr(e)}else if(n>=i.viewTo){var a=Ur(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):zr(e)}else{var s=Ur(e,t,t,-1),l=Ur(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(_n(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):zr(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Rr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==U(a,n)&&a.push(n)}}}function zr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ur(e,t,n,r){var i,o=Rr(e,t),a=e.display.view;if(!Nt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;tn(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Wr(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=_n(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=_n(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Rr(e,n)))),r.viewTo=n}function Hr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().line0?t.blinker=setInterval((function(){e.hasFocus()||Jr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Xr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Qr(e))}function Kr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Jr(e))}),100)}function Qr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ge(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Yr(e))}function Jr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ge(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Zr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||f<-.005)&&(et(i.line,l),ei(i.line),i.rest))for(var p=0;pe.display.sizerWidth){var h=Math.ceil(u/Nr(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function ei(e){if(e.widgets)for(var t=0;t=a&&(o=nt(t,an(Qe(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ni(e,t){if(!ye(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!h){var o=O("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Vn(e.display))+"px;\n height: "+(t.bottom-t.top+Yn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ri(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?ot(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ot(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=br(e,t),l=n&&n!=t?br(e,n):s,u=oi(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=u.scrollTop&&(fi(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(hi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function ii(e,t){var n=oi(e,t);null!=n.scrollTop&&fi(e,n.scrollTop),null!=n.scrollLeft&&hi(e,n.scrollLeft)}function oi(e,t){var n=e.display,r=Or(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Kn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+qn(n),l=t.tops-r;if(t.topi+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(a.scrollTop=c)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=Xn(e)-n.gutters.offsetWidth,h=t.right-t.left>p;return h&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.leftp+f-3&&(a.scrollLeft=t.right+(h?0:10)-p),a}function ai(e,t){null!=t&&(ci(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function si(e){ci(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function li(e,t,n){null==t&&null==n||ci(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ui(e,t){ci(e),e.curOp.scrollToPos=t}function ci(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,di(e,wr(e,t.from),wr(e,t.to),t.margin))}function di(e,t,n,r){var i=oi(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});li(e,i.scrollLeft,i.scrollTop)}function fi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Bi(e,{top:t}),pi(e,t,!0),n&&Bi(e),Di(e,100))}function pi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function hi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Gi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function mi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+qn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Yn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var vi=function(e,t,n){this.cm=n;var r=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),he(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),he(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};vi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},vi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},vi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},vi.prototype.zeroWidthHack=function(){var e=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},vi.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},vi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var gi=function(){};function yi(e,t){t||(t=mi(e));var n=e.display.barWidth,r=e.display.barHeight;bi(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Zr(e),bi(e,mi(e)),n=e.display.barWidth,r=e.display.barHeight}function bi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}gi.prototype.update=function(){return{bottom:0,right:0}},gi.prototype.setScrollLeft=function(){},gi.prototype.setScrollTop=function(){},gi.prototype.clear=function(){};var wi={native:vi,null:gi};function xi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new wi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?hi(e,t):fi(e,t)}),e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var ki=0;function _i(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ki},Cn(e.curOp)}function Si(e){var t=e.curOp;t&&jn(t,(function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ii(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ji(e){e.updatedDisplay=e.mustUpdate&&Wi(e.cm,e.update)}function Ti(e){var t=e.cm,n=t.display;e.updatedDisplay&&Zr(t),e.barMeasure=mi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=er(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Yn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Xn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Oi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=bt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Ge(t.mode,r.state):null,l=gt(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!d&&fn)return Di(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Mi(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Hr(e))return!1;Yi(e)&&(zr(e),t.dims=Mr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Nt&&(o=tn(e.doc,o),a=nn(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Wr(e,o,a),n.viewOffset=an(Qe(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Hr(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=zi(e);return l>4&&(n.lineDiv.style.display="none"),$i(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Ui(u),j(n.cursorDiv),j(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Di(e,400)),n.updateLineNumbers=null,!0}function Hi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Xn(e))r&&(t.visible=ti(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+qn(e.display)-Kn(e),n.top)}),t.visible=ti(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Wi(e,t))break;Zr(e);var i=mi(e);Br(e),yi(e,i),qi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Bi(e,t){var n=new Ii(e,t);if(Wi(e,n)){Zr(e),Hi(e,n);var r=mi(e);Br(e),yi(e,r),qi(e,r),n.finish()}}function $i(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=r.view,c=r.viewFrom,d=0;d-1&&(p=!1),Mn(e,f,c,n)),p&&(j(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(it(e.options,c)))),a=f.node.nextSibling}else{var h=zn(e,f,c,n);o.insertBefore(h,a)}c+=f.size}for(;a;)a=s(a)}function Vi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function qi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Yn(e)+"px"}function Gi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Lr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;as.clientWidth,c=s.scrollHeight>s.clientHeight;if(i&&u||o&&c){if(o&&y&&l)e:for(var f=t.target,p=a.view;f!=s;f=f.parentNode)for(var h=0;h=0&&at(e,r.to())<=0)return n}return-1};var oo=function(e,t){this.anchor=e,this.head=t};function ao(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return at(e.from(),t.from())})),n=U(t,i);for(var o=1;o0:l>=0){var u=ct(s.from(),a.from()),c=ut(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new oo(d?c:u,d?u:c))}}return new io(t,n)}function so(e,t){return new io([new oo(e,t||e)],0)}function lo(e){return e.text?ot(e.from.line+e.text.length-1,X(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function uo(e,t){if(at(e,t.from)<0)return e;if(at(e,t.to)<=0)return lo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=lo(t).ch-t.to.ch),ot(n,r)}function co(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,h-1),e.insert(s.line+1,g)}On(e,"change",e,t)}function yo(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges?(e.done.pop(),X(e.done)):void 0}function Eo(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=Co(i,i.lastOp==r)))a=X(o.changes),0==at(t.from,t.to)&&0==at(t.from,a.to)?a.to=lo(t):o.changes.push(_o(e,t));else{var l=X(i.done);for(l&&l.ranges||Oo(e.sel,i.done),o={changes:[_o(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||ge(e,"historyAdded")}function jo(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function To(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||jo(e,o,X(i.done),t))?i.done[i.done.length-1]=t:Oo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&So(i.undone)}function Oo(e,t){var n=X(t);n&&n.ranges&&n.equals(e)||t.push(e)}function No(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Mo(e){if(!e)return null;for(var t,n=0;n-1&&(X(s)[d]=u[d],delete u[d])}}}return r}function Do(e,t,n,r){if(r){var i=e.anchor;if(n){var o=at(t,i)<0;o!=at(n,i)<0?(i=t,t=n):o!=at(t,n)<0&&(t=n)}return new oo(i,t)}return new oo(n||t,t)}function Ro(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ho(e,new io([Do(e.sel.primary(),t,n,i)],0),r)}function Io(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(ge(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),f=void 0;if((r<0?c:u)&&(d=Xo(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(f=at(d,n))&&(r<0?f<0:f>0))return Go(e,d,t,r,i)}var p=l.find(r<0?-1:1);return(r<0?u:c)&&(p=Xo(e,p,r,p.line==t.line?o:null)),p?Go(e,p,t,r,i):null}}return t}function Yo(e,t,n,r,i){var o=r||1,a=Go(e,t,n,o,i)||!i&&Go(e,t,n,o,!0)||Go(e,t,n,-o,i)||!i&&Go(e,t,n,-o,!0);return a||(e.cantEdit=!0,ot(e.first,0))}function Xo(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ft(e,ot(t.line-1)):null:n>0&&t.ch==(r||Qe(e,t.line)).text.length?t.line=0;--i)Zo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Zo(e,t)}}function Zo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=at(t.from,t.to)){var n=co(e,t);Eo(e,t,n,e.cm?e.cm.curOp.id:NaN),na(e,t,n,zt(e,t));var r=[];yo(e,(function(e,n){n||-1!=U(r,e.history)||(sa(e.history,t),r.push(e.history)),na(e,t,null,zt(e,t))}))}}function ea(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,u=0;u=0;--p){var h=f(p);if(h)return h.v}}}}function ta(e,t){if(0!=t&&(e.first+=t,e.sel=new io(K(e.sel.ranges,(function(e){return new oo(ot(e.anchor.line+t,e.anchor.ch),ot(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Ir(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:ot(o,Qe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Je(e,t.from,t.to),n||(n=co(e,t)),e.cm?ra(e.cm,t,r):go(e,t,r),Bo(e,n,B),e.cantEdit&&Yo(e,ot(e.firstLine(),0))&&(e.cantEdit=!1)}}function ra(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=tt(Jt(Qe(r,o.line))),r.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&be(e),go(r,t,n,Pr(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=sn(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),Tt(r,o.line),Di(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?Ir(e):o.line!=a.line||1!=t.text.length||vo(e.doc,t)?Ir(e,o.line,a.line+1,u):Fr(e,o.line,"text");var c=we(e,"changes"),d=we(e,"change");if(d||c){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&On(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function ia(e,t,n,r,i){var o;r||(r=n),at(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Jo(e,{from:n,to:r,text:t,origin:i})}function oa(e,t,n,r){n1||!(this.children[0]instanceof ua))){var s=[];this.collapse(s),this.children=[new ua(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=N("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Qt(e,t.line,t,n,o)||t.line!=n.line&&Qt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Lt()}o.addToHistory&&Eo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,u=e.cm;if(e.iter(l,n.line+1,(function(e){u&&o.collapsed&&!u.options.lineWrapping&&Jt(e)==u.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&et(e,0),Rt(e,new Pt(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){rn(e,t)&&et(t,0)})),o.clearOnEnter&&he(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Mt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ha,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Ir(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)Fr(u,c,"text");o.atomic&&Vo(u.doc),On(u,"markerAdded",u,o)}return o}ma.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&_i(e),we(this,"clear")){var n=this.find();n&&On(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Ir(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Vo(e.doc)),e&&On(e,"markerCleared",e,this,r,i),t&&Si(e),this.parent&&this.parent.clear()}},ma.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;l--)Jo(this,r[l]);s?Wo(this,s):this.cm&&si(this.cm)})),undo:Ai((function(){ea(this,"undo")})),redo:Ai((function(){ea(this,"redo")})),undoSelection:Ai((function(){ea(this,"undo",!0)})),redoSelection:Ai((function(){ea(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ft(this,e),t=ft(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),ft(this,ot(n,t))},indexFromPos:function(e){var t=(e=ft(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Bo(t.doc,so(n,n)),f)for(var p=0;p=0;t--)ia(e.doc,"",r[t].from,r[t].to,"+delete");si(e)}))}function Ga(e,t,n){var r=ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ya(e,t,n){var r=Ga(e,t.ch,n);return null==r?null:new ot(t.line,r,n<0?"after":"before")}function Xa(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=fe(n,t.doc.direction);if(o){var a,s=i<0?X(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=nr(t,n);a=i<0?n.text.length-1:0;var c=rr(t,u,a).top;a=se((function(e){return rr(t,u,e).top==c}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Ga(n,a,1))}else a=i<0?s.to:s.from;return new ot(r,a,l)}}return new ot(r,i<0?n.text.length:0,i<0?"before":"after")}function Ka(e,t,n,r){var i=fe(t,e.doc.direction);if(!i)return Ya(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ce(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&f>=c.begin)){var p=d?"before":"after";return new ot(n.line,f,p)}}var h=function(e,t,r){for(var o=function(e,t){return t?new ot(n.line,l(e,1),"before"):new ot(n.line,e,"after")};e>=0&&e0==(1!=a.level),u=s?r.begin:l(r.end,-1);if(a.from<=u&&u0?c.end:l(c.begin,-1);return null==v||r>0&&v==t.text.length||!(m=h(r>0?0:i.length-1,r,u(v)))?null:m}Fa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Fa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Fa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Fa.default=y?Fa.macDefault:Fa.pcDefault;var Qa={selectAll:Ko,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),B)},killLine:function(e){return qa(e,(function(t){if(t.empty()){var n=Qe(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new ot(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ot(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Qe(e.doc,i.line-1).text;a&&(i=new ot(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ot(i.line-1,a.length-1),i,"+transpose"))}n.push(new oo(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Mi(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(at((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(at(i.to(),t)>0||t.xRel<0)?ks(e,r,t,o):Ss(e,r,t,o)}function ks(e,t,n,r){var i=e.display,o=!1,u=Li(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Kr(e)),ve(i.wrapper.ownerDocument,"mouseup",u),ve(i.wrapper.ownerDocument,"mousemove",c),ve(i.scroller,"dragstart",d),ve(i.scroller,"drop",u),o||(ke(t),r.addNew||Ro(e.doc,n,null,null,r.extend),l&&!f||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};l&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!r.moveOnDrag,he(i.wrapper.ownerDocument,"mouseup",u),he(i.wrapper.ownerDocument,"mousemove",c),he(i.scroller,"dragstart",d),he(i.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function _s(e,t,n){if("char"==n)return new oo(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new oo(ot(t.line,0),ft(e.doc,ot(t.line+1,0)));var r=n(e,t);return new oo(r.from,r.to)}function Ss(e,t,n,r){a&&Kr(e);var i=e.display,o=e.doc;ke(t);var s,l,u=o.sel,c=u.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),s=l>-1?c[l]:new oo(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new oo(n,n)),n=Dr(e,t,!0,!0),l=-1;else{var d=_s(e,n,r.unit);s=r.extend?Do(s,d.anchor,d.head,r.extend):d}r.addNew?-1==l?(l=c.length,Ho(o,ao(e,c.concat([s]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==r.unit&&!r.extend?(Ho(o,ao(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):Fo(o,l,s,$):(l=0,Ho(o,new io([s],0),$),u=o.sel);var f=n;function p(t){if(0!=at(f,t))if(f=t,"rectangle"==r.unit){for(var i=[],a=e.options.tabSize,c=F(Qe(o,n.line).text,n.ch,a),d=F(Qe(o,t.line).text,t.ch,a),p=Math.min(c,d),h=Math.max(c,d),m=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=v;m++){var g=Qe(o,m).text,y=q(g,p,a);p==h?i.push(new oo(ot(m,y),ot(m,y))):g.length>y&&i.push(new oo(ot(m,y),ot(m,q(g,h,a))))}i.length||i.push(new oo(n,n)),Ho(o,ao(e,u.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=s,x=_s(e,t,r.unit),k=w.anchor;at(x.anchor,k)>0?(b=x.head,k=ct(w.from(),x.anchor)):(b=x.anchor,k=ut(w.to(),x.head));var _=u.ranges.slice(0);_[l]=Cs(e,new oo(ft(o,k),b)),Ho(o,ao(e,_,l),$)}}var h=i.wrapper.getBoundingClientRect(),m=0;function v(t){var n=++m,a=Dr(e,t,!0,"rectangle"==r.unit);if(a)if(0!=at(a,f)){e.curOp.focus=L(),p(a);var s=ti(i,o);(a.line>=s.to||a.lineh.bottom?20:0;l&&setTimeout(Li(e,(function(){m==n&&(i.scroller.scrollTop+=l,v(t))})),50)}}function g(t){e.state.selectingText=!1,m=1/0,t&&(ke(t),i.input.focus()),ve(i.wrapper.ownerDocument,"mousemove",y),ve(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=Li(e,(function(e){0!==e.buttons&&je(e)?v(e):g(e)})),b=Li(e,g);e.state.selectingText=b,he(i.wrapper.ownerDocument,"mousemove",y),he(i.wrapper.ownerDocument,"mouseup",b)}function Cs(e,t){var n=t.anchor,r=t.head,i=Qe(e.doc,n.line);if(0==at(n,r)&&n.sticky==r.sticky)return t;var o=fe(i);if(!o)return t;var a=ce(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,u=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=ce(o,r.ch,r.sticky),d=c-a||(r.ch-n.ch)*(1==s.level?-1:1);l=c==u-1||c==u?d<0:d>0}var f=o[u+(l?-1:0)],p=l==(1==f.level),h=p?f.from:f.to,m=p?"after":"before";return n.ch==h&&n.sticky==m?t:new oo(new ot(n.line,h,m),r)}function Es(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ke(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!we(e,n))return Se(t);o-=s.top-a.viewOffset;for(var l=0;l=i)return ge(e,n,e,nt(e.doc,o),e.display.gutterSpecs[l].className,t),Se(t)}}function js(e,t){return Es(e,t,"gutterClick",!0)}function Ts(e,t){$n(e.display,t)||Os(e,t)||ye(e,t,"contextmenu")||_||e.display.input.onContextMenu(t)}function Os(e,t){return!!we(e,"gutterContextMenu")&&Es(e,t,"gutterContextMenu",!1)}function Ns(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),fr(e)}vs.prototype.compare=function(e,t,n){return this.time+ms>e&&0==at(t,this.pos)&&n==this.button};var Ms={toString:function(){return"CodeMirror.Init"}},Ls={},Ps={};function As(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Ms&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Ms,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,ho(e)}),!0),n("indentUnit",2,ho,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){mo(e),fr(e),Ir(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(ot(r,o))}r++}));for(var i=n.length-1;i>=0;i--)ia(e.doc,t,n[i],ot(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Ms&&e.refresh()})),n("specialCharPlaceholder",vn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",g?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ns(e),Qi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Va(t),i=n!=Ms&&Va(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Rs,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Xi(t,e.options.lineNumbers),Qi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Lr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return yi(e)}),!0),n("scrollbarStyle","native",(function(e){xi(e),yi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Xi(e.options.gutters,t),Qi(e)}),!0),n("firstLineNumber",1,Qi,!0),n("lineNumberFormatter",(function(e){return e}),Qi,!0),n("showCursorWhenSelecting",!1,Br,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Jr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Ds),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Br,!0),n("singleCursorHeightPerLine",!0,Br,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,mo,!0),n("addModeClass",!1,mo,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,mo,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Ds(e,t,n){if(!t!=!(n&&n!=Ms)){var r=e.display.dragFunctions,i=t?he:ve;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Rs(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),ln(e)),Ar(e),Ir(e),fr(e),setTimeout((function(){return yi(e)}),100)}function Is(e,t){var n=this;if(!(this instanceof Is))return new Is(e,t);this.options=t=t?I(t):{},I(Ls,t,!1);var r=t.value;"string"==typeof r?r=new _a(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Is.inputStyles[t.inputStyle](this),o=this.display=new Ji(e,r,i,t);for(var u in o.wrapper.CodeMirror=this,Ns(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),xi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new z,keySeq:null,specialChars:null},t.autofocus&&!g&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Fs(this),Ma(),_i(this),this.curOp.forceUpdate=!0,bo(this,r),t.autofocus&&!g||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Qr(n)}),20):Jr(this),Ps)Ps.hasOwnProperty(u)&&Ps[u](this,t[u],Ms);Yi(this),t.finishInit&&t.finishInit(this);for(var c=0;c400}he(t.scroller,"touchstart",(function(i){if(!ye(e,i)&&!o(i)&&!js(e,i)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!$n(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!r.prev||l(r,r.prev)?new oo(a,a):!r.prev.prev||l(r,r.prev.prev)?e.findWordAt(a):new oo(ot(a.line,0),ft(e.doc,ot(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),ke(n)}i()})),he(t.scroller,"touchcancel",i),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(fi(e,t.scroller.scrollTop),hi(e,t.scroller.scrollLeft,!0),ge(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return ro(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return ro(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ye(e,t)||Ce(t)},over:function(t){ye(e,t)||(ja(e,t),Ce(t))},start:function(t){return Ea(e,t)},drop:Li(e,Ca),leave:function(t){ye(e,t)||Ta(e)}};var u=t.input.getField();he(u,"keyup",(function(t){return ds.call(e,t)})),he(u,"keydown",Li(e,us)),he(u,"keypress",Li(e,fs)),he(u,"focus",(function(t){return Qr(e,t)})),he(u,"blur",(function(t){return Jr(e,t)}))}Is.defaults=Ls,Is.optionHandlers=Ps;var zs=[];function Us(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=bt(e,t).state:n="prev");var a=e.options.tabSize,s=Qe(o,t),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==H||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?F(Qe(o,t-1).text,null,a):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var d="",f=0;if(e.options.indentWithTabs)for(var p=Math.floor(u/a);p;--p)f+=a,d+="\t";if(fa,l=Ae(t),u=null;if(s&&r.ranges.length>1)if(Ws&&Ws.text.join("\n")==t){if(r.ranges.length%Ws.text.length==0){u=[];for(var c=0;c=0;f--){var p=r.ranges[f],h=p.from(),m=p.to();p.empty()&&(n&&n>0?h=ot(h.line,h.ch-n):e.state.overwrite&&!s?m=ot(m.line,Math.min(Qe(o,m.line).text.length,m.ch+X(l).length)):s&&Ws&&Ws.lineWise&&Ws.text.join("\n")==l.join("\n")&&(h=m=ot(h.line,0)));var v={from:h,to:m,text:u?u[f%u.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Jo(e.doc,v),On(e,"inputRead",e,v)}t&&!s&&Vs(e,t),si(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function $s(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Mi(t,(function(){return Bs(t,n,0,null,"paste")})),!0}function Vs(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Us(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Qe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Us(e,i.head.line,"smart"));a&&On(e,"electricInput",e,i.head.line)}}}function qs(e){for(var t=[],n=[],r=0;rn&&(Us(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&si(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Fo(this.doc,r,new oo(o,u[r].to()),B)}}})),getTokenAt:function(e,t){return St(this,e,t)},getLineTokens:function(e,t){return St(this,ot(e),t,!0)},getTokenTypeAt:function(e){e=ft(this.doc,e);var t,n=yt(this,Qe(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=Qe(this.doc,e)}else r=e;return vr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-an(r):0)},defaultTextHeight:function(){return Or(this.display)},defaultCharWidth:function(){return Nr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,a=(e=br(this,ft(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&ii(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Pi(us),triggerOnKeyPress:Pi(fs),triggerOnKeyUp:ds,triggerOnMouseDown:Pi(ys),execCommand:function(e){if(Qa.hasOwnProperty(e))return Qa[e].call(null,this)},triggerElectric:Pi((function(e){Vs(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ft(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&Ar(this),ge(this,"refresh",this)})),swapDoc:Pi((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),bo(this,e),fr(this),this.display.input.reset(),li(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,On(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},xe(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function Ks(e,t,n,r,i){var o=t,a=n,s=Qe(e,t.line),l=i&&"rtl"==e.direction?-n:n;function u(){var n=t.line+l;return!(n=e.first+e.size)&&(t=new ot(n,t.ch,t.sticky),s=Qe(e,n))}function c(o){var a;if("codepoint"==r){var c=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(c))a=null;else{var d=n>0?c>=55296&&c<56320:c>=56320&&c<57343;a=new ot(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(d?2:1))),-n)}}else a=i?Ka(e.cm,s,t,n):Ya(s,t,n);if(null==a){if(o||!u())return!1;t=Xa(i,e.cm,s,t.line,l)}else t=a;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var d=null,f="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(n<0)||c(!h);h=!1){var m=s.text.charAt(t.ch)||"\n",v=ne(m,p)?"w":f&&"\n"==m?"n":!f||/\s/.test(m)?null:"p";if(!f||h||v||(v="s"),d&&d!=v){n<0&&(n=1,c(),t.sticky="after");break}if(v&&(d=v),n>0&&!c(!h))break}var g=Yo(e,t,o,a,!0);return st(o,g)&&(g.hitSide=!0),g}function Qs(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*Or(e.display),3);i=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=kr(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Js=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Zs(e,t){var n=tr(e,t.line);if(!n||n.hidden)return null;var r=Qe(e.doc,t.line),i=Jn(n,r,t.line),o=fe(r,e.doc.direction),a="left";o&&(a=ce(o,t.ch)%2?"right":"left");var s=ar(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function el(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function tl(e,t){return t&&(e.bad=!0),e}function nl(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function u(e){return function(t){return t.id==e}}function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function d(e){e&&(c(),o+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void d(n);var o,p=t.getAttribute("cm-marker");if(p){var h=e.findMarks(ot(r,0),ot(i+1,0),u(+p));return void(h.length&&(o=h[0].find(0))&&d(Je(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&c();for(var v=0;v=t.display.viewTo||o.line=t.display.viewFrom&&Zs(t,i)||{node:l[0].measure.map[2],offset:0},c=o.liner.firstLine()&&(a=ot(a.line-1,Qe(r.doc,a.line-1).length)),s.ch==Qe(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=Rr(r,a.line))?(t=tt(i.view[0].line),n=i.view[0].node):(t=tt(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,u,c=Rr(r,s.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=tt(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(nl(r,n,u,t,l)),f=Je(r.doc,ot(t,0),ot(l,Qe(r.doc,l).text.length));d.length>1&&f.length>1;)if(X(d)==X(f))d.pop(),f.pop(),l--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var p=0,h=0,m=d[0],v=f[0],g=Math.min(m.length,v.length);pa.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)p--,h++;d[d.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var x=ot(t,p),k=ot(l,f.length?X(f).length-h:0);return d.length>1||d[0]||at(x,k)?(ia(r.doc,d,x,k,"+input"),!0):void 0},Js.prototype.ensurePolled=function(){this.forceCompositionEnd()},Js.prototype.reset=function(){this.forceCompositionEnd()},Js.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Js.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Js.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Mi(this.cm,(function(){return Ir(e.cm)}))},Js.prototype.setUneditable=function(e){e.contentEditable="false"},Js.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Li(this.cm,Bs)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Js.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Js.prototype.onContextMenu=function(){},Js.prototype.resetPosition=function(){},Js.prototype.needsContentAttribute=!0;var ol=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};function al(e,t){if((t=t?I(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=L();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(he(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(ve(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Is((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function sl(e){e.off=ve,e.on=he,e.wheelEventPixels=no,e.Doc=_a,e.splitLines=Ae,e.countColumn=F,e.findColumn=q,e.isWordChar=te,e.Pass=H,e.signal=ge,e.Line=un,e.changeEnd=lo,e.scrollbarModel=wi,e.Pos=ot,e.cmpPos=at,e.modes=ze,e.mimeModes=Ue,e.resolveMode=Be,e.getMode=$e,e.modeExtensions=Ve,e.extendMode=qe,e.copyState=Ge,e.startState=Xe,e.innerMode=Ye,e.commands=Qa,e.keyMap=Fa,e.keyName=$a,e.isModifierKey=Ha,e.lookupKey=Wa,e.normalizeKeyMap=Ua,e.StringStream=Ke,e.SharedTextMarker=ga,e.TextMarker=ma,e.LineWidget=da,e.e_preventDefault=ke,e.e_stopPropagation=_e,e.e_stop=Ce,e.addClass=P,e.contains=M,e.rmClass=E,e.keyNames=Aa}ol.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ye(r,e)){if(r.somethingSelected())Hs({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=qs(r);Hs({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,B):(n.prevInput="",i.value=t.text.join("\n"),D(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),he(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),he(i,"paste",(function(e){ye(r,e)||$s(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),he(i,"cut",o),he(i,"copy",o),he(e.scroller,"paste",(function(t){if(!$n(e,t)&&!ye(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),he(e.lineSpace,"selectstart",(function(t){$n(e,t)||ke(t)})),he(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),he(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},ol.prototype.createField=function(e){this.wrapper=Ys(),this.textarea=this.wrapper.firstChild},ol.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ol.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=$r(e);if(e.options.moveInputWithCursor){var i=br(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},ol.prototype.showSelection=function(e){var t=this.cm.display;T(t.cursorDiv,e.cursors),T(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ol.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&D(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},ol.prototype.getField=function(){return this.textarea},ol.prototype.supportsTouch=function(){return!1},ol.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||L()!=this.textarea))try{this.textarea.focus()}catch(e){}},ol.prototype.blur=function(){this.textarea.blur()},ol.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ol.prototype.receivedFocus=function(){this.slowPoll()},ol.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},ol.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},ol.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||De(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ol.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ol.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},ol.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Dr(n,e),u=r.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Li(n,Ho)(n.doc,so(o),B);var c,f=i.style.cssText,p=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),r.input.focus(),l&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=g,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&v(),_){Ce(e);var m=function(){ve(window,"mouseup",m),setTimeout(g,20)};he(window,"mouseup",m)}else setTimeout(g,50)}function v(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=f,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!a||a&&s<9)&&v();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Li(n,Ko)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},ol.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},ol.prototype.setUneditable=function(){},ol.prototype.needsContentAttribute=!1,As(Is),Xs(Is);var ll="iter insert remove copy getEditor constructor".split(" ");for(var ul in _a.prototype)_a.prototype.hasOwnProperty(ul)&&U(ll,ul)<0&&(Is.prototype[ul]=function(e){return function(){return e.apply(this.doc,arguments)}}(_a.prototype[ul]));return xe(_a),Is.inputStyles={textarea:ol,contenteditable:Js},Is.defineMode=function(e){Is.defaults.mode||"null"==e||(Is.defaults.mode=e),We.apply(this,arguments)},Is.defineMIME=He,Is.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Is.defineMIME("text/plain","null"),Is.defineExtension=function(e,t){Is.prototype[e]=t},Is.defineDocExtension=function(e,t){_a.prototype[e]=t},Is.fromTextArea=al,sl(Is),Is.version="5.59.4",Is}()},9589:(e,t,n)=>{!function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(r,i){var o,a,s=r.indentUnit,l={},u=i.htmlMode?t:n;for(var c in u)l[c]=u[c];for(var c in i)l[c]=i[c];function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return"<"==r?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(h("atom","]]>")):null:e.match("--")?n(h("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(m(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=h("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):"&"==r?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function f(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=d,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){t.tokenize=d,t.state=b,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=p(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=f;break}return"string"};return t.isInAttribute=!0,t}function h(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function m(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=m(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=d;break}return n.tokenize=m(e-1),n.tokenize(t,n)}}return"meta"}}function v(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function g(e){e.context&&(e.context=e.context.prev)}function y(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;g(e)}}function b(e,t,n){return"openTag"==e?(n.tagStart=t.column(),w):"closeTag"==e?x:b}function w(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",S):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",S(e,t,n)):(a="error",w)}function x(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&g(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",k):(a="tag error",_)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",k(e,t,n)):(a="error",_)}function k(e,t,n){return"endTag"!=e?(a="error",k):(g(n),b)}function _(e,t,n){return a="error",k(e,t,n)}function S(e,t,n){if("word"==e)return a="attribute",C;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?y(n,r):(y(n,r),n.context=new v(n,r,i==n.indented)),b}return a="error",S}function C(e,t,n){return"equals"==e?E:(l.allowMissing||(a="error"),S(e,t,n))}function E(e,t,n){return"string"==e?j:"word"==e&&l.allowUnquoted?(a="string",S):(a="error",S(e,t,n))}function j(e,t,n){return"string"==e?j:S(e,t,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==E&&(e.state=S)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(4631))},8679:(e,t,n)=>{"use strict";var r=n(9864),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var i=p(n);i&&i!==h&&e(t,i,r)}var a=c(n);d&&(a=a.concat(d(n)));for(var s=l(t),m=l(n),v=0;v{e.exports={CASE_SENSITIVE_TAG_NAMES:["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]}},8276:(e,t,n)=>{var r="html",i="head",o="body",a=/<([a-zA-Z]+[0-9]?)/,s=//i,l=//i,u=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},c=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if("function"==typeof window.DOMParser){var d=new window.DOMParser;u=c=function(e,t){return t&&(e="<"+t+">"+e+""),d.parseFromString(e,"text/html")}}if(document.implementation){var f=n(1507).isIE,p=document.implementation.createHTMLDocument(f()?"html-dom-parser":void 0);u=function(e,t){return t?(p.documentElement.getElementsByTagName(t)[0].innerHTML=e,p):(p.documentElement.innerHTML=e,p)}}var h,m=document.createElement("template");m.content&&(h=function(e){return m.innerHTML=e,m.content.childNodes}),e.exports=function(e){var t,n,d,f,p=e.match(a);switch(p&&p[1]&&(t=p[1].toLowerCase()),t){case r:return n=c(e),s.test(e)||(d=n.getElementsByTagName(i)[0])&&d.parentNode.removeChild(d),l.test(e)||(d=n.getElementsByTagName(o)[0])&&d.parentNode.removeChild(d),n.getElementsByTagName(r);case i:case o:return f=u(e).getElementsByTagName(t),l.test(e)&&s.test(e)?f[0].parentNode.childNodes:f;default:return h?h(e):u(e,o).getElementsByTagName(o)[0].childNodes}}},4152:(e,t,n)=>{var r=n(8276),i=n(1507).formatDOM,o=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(""===e)return[];var t,n=e.match(o);return n&&n[1]&&(t=n[1]),i(r(e),null,t)}},1507:(e,t,n)=>{for(var r,i=n(885),o=n(1642),a=i.CASE_SENSITIVE_TAG_NAMES,s=o.Comment,l=o.Element,u=o.ProcessingInstruction,c=o.Text,d={},f=0,p=a.length;f0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(a);t.NodeWithChildren=d;var f=function(e){function t(t){return e.call(this,"root",t)||this}return r(t,e),t}(d);t.Document=f;var p=function(e){function t(t,n,r){void 0===r&&(r=[]);var i=e.call(this,"script"===t?"script":"style"===t?"style":"tag",r)||this;return i.name=t,i.attribs=n,i.attribs=n,i}return r(t,e),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}}))},enumerable:!1,configurable:!0}),t}(d);function h(e,t){var n;switch(void 0===t&&(t=!1),e.type){case"text":n=new l(e.data);break;case"directive":var r=e;n=new c(r.name,r.data),null!=r["x-name"]&&(n["x-name"]=r["x-name"],n["x-publicId"]=r["x-publicId"],n["x-systemId"]=r["x-systemId"]);break;case"comment":n=new u(e.data);break;case"tag":case"script":case"style":var o=e,a=t?m(o.children):[],s=new p(o.name,i({},o.attribs),a);a.forEach((function(e){return e.parent=s})),o["x-attribsNamespace"]&&(s["x-attribsNamespace"]=i({},o["x-attribsNamespace"])),o["x-attribsPrefix"]&&(s["x-attribsPrefix"]=i({},o["x-attribsPrefix"])),n=s;break;case"cdata":a=t?m(e.children):[];var h=new d(e.type,a);a.forEach((function(e){return e.parent=h})),n=h;break;case"root":var v=e,g=(a=t?m(v.children):[],new f(a));a.forEach((function(e){return e.parent=g})),v["x-mode"]&&(g["x-mode"]=v["x-mode"]),n=g;break;case"doctype":throw new Error("Not implemented yet: ElementType.Doctype case")}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,n}function m(e){for(var t=e.map((function(e){return h(e,!0)})),n=1;n{var r=n(3670),i=n(484),o=n(4152),a={lowerCaseAttributeNames:!1};function s(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return""===e?[]:r(o(e,(t=t||{}).htmlparser2||a),t)}s.domToReact=r,s.htmlToDOM=o,s.attributesToProps=i,e.exports=s,e.exports.default=s},484:(e,t,n)=>{var r=n(2686),i=n(4606),o=i.setStyleProp,a=r.html,s=r.svg,l=r.isCustomAttribute,u=Object.prototype.hasOwnProperty;e.exports=function(e){var t,n,r,c;e=e||{};var d={};for(t in e)r=e[t],l(t)?d[t]=r:(n=t.toLowerCase(),u.call(a,n)?d[(c=a[n]).propertyName]=!!(c.hasBooleanValue||c.hasOverloadedBooleanValue&&!r)||r:u.call(s,t)?d[(c=s[t]).propertyName]=r:i.PRESERVE_CUSTOM_ATTRIBUTES&&(d[t]=r));return o(e.style,d),d}},3670:(e,t,n)=>{var r=n(7294),i=n(484),o=n(4606),a=o.setStyleProp;function s(e){return o.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&o.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,n){for(var o,l,u,c,d=(n=n||{}).library||r,f=d.cloneElement,p=d.createElement,h=d.isValidElement,m=[],v="function"==typeof n.replace,g=n.trim,y=0,b=t.length;y1&&(l=f(l,{key:l.key||y})),m.push(l);else if("text"!==o.type){switch(u=o.attribs,s(o)?a(u.style,u):u&&(u=i(u)),c=null,o.type){case"script":case"style":o.children[0]&&(u.dangerouslySetInnerHTML={__html:o.children[0].data});break;case"tag":"textarea"===o.name&&o.children[0]?u.defaultValue=o.children[0].data:o.children&&o.children.length&&(c=e(o.children,n));break;default:continue}b>1&&(u.key=y),m.push(p(o.name,u,c))}else g?o.data.trim()&&m.push(o.data):m.push(o.data);return 1===m.length?m[0]:m}},4606:(e,t,n)=>{var r=n(7294),i=n(1476).default;var o={reactCompat:!0};var a=r.version.split(".")[0]>=16;e.exports={PRESERVE_CUSTOM_ATTRIBUTES:a,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var n,r,i="function"==typeof t,o={},a={};for(n in e)r=e[n],i&&(o=t(n,r))&&2===o.length?a[o[0]]=o[1]:"string"==typeof r&&(a[r]=n);return a},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){null!=e&&(t.style=i(e,o))}}},8139:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,u="";function c(e){return e?e.replace(l,u):u}e.exports=function(e,l){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];l=l||{};var d=1,f=1;function p(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function h(){var e={line:d,column:f};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:d,column:f},this.source=l.source}m.prototype.content=e;var v=[];function g(t){var n=new Error(l.source+":"+d+":"+f+": "+t);if(n.reason=t,n.filename=l.source,n.line=d,n.column=f,n.source=e,!l.silent)throw n;v.push(n)}function y(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function b(){y(r)}function w(e){var t;for(e=e||[];t=x();)!1!==t&&e.push(t);return e}function x(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;u!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,u===e.charAt(n-1))return g("End of comment missing");var r=e.slice(2,n-2);return f+=2,p(r),e=e.slice(n),f+=2,t({type:"comment",comment:r})}}function k(){var e=h(),n=y(i);if(n){if(x(),!y(o))return g("property missing ':'");var r=y(a),l=e({type:"declaration",property:c(n[0].replace(t,u)),value:r?c(r[0].replace(t,u)):u});return y(s),l}}return b(),function(){var e,t=[];for(w(t);e=k();)!1!==e&&(t.push(e),w(t));return t}()}},6486:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",l=16,u=32,c=64,d=128,f=256,p=1/0,h=9007199254740991,m=NaN,v=4294967295,g=[["ary",d],["bind",1],["bindKey",2],["curry",8],["curryRight",l],["flip",512],["partial",u],["partialRight",c],["rearg",f]],y="[object Arguments]",b="[object Array]",w="[object Boolean]",x="[object Date]",k="[object Error]",_="[object Function]",S="[object GeneratorFunction]",C="[object Map]",E="[object Number]",j="[object Object]",T="[object Promise]",O="[object RegExp]",N="[object Set]",M="[object String]",L="[object Symbol]",P="[object WeakMap]",A="[object ArrayBuffer]",D="[object DataView]",R="[object Float32Array]",I="[object Float64Array]",F="[object Int8Array]",z="[object Int16Array]",U="[object Int32Array]",W="[object Uint8Array]",H="[object Uint8ClampedArray]",B="[object Uint16Array]",$="[object Uint32Array]",V=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Y=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,K=RegExp(Y.source),Q=RegExp(X.source),J=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ie.source),ae=/^\s+/,se=/\s/,le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ue=/\{\n\/\* \[wrapped with (.+)\] \*/,ce=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fe=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,ve=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,we=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ke=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",je="A-Z\\xc0-\\xd6\\xd8-\\xde",Te="\\ufe0e\\ufe0f",Oe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",Ne="['’]",Me="[\\ud800-\\udfff]",Le="["+Oe+"]",Pe="["+Se+"]",Ae="\\d+",De="[\\u2700-\\u27bf]",Re="["+Ee+"]",Ie="[^\\ud800-\\udfff"+Oe+Ae+Ce+Ee+je+"]",Fe="\\ud83c[\\udffb-\\udfff]",ze="[^\\ud800-\\udfff]",Ue="(?:\\ud83c[\\udde6-\\uddff]){2}",We="[\\ud800-\\udbff][\\udc00-\\udfff]",He="["+je+"]",Be="(?:"+Re+"|"+Ie+")",$e="(?:"+He+"|"+Ie+")",Ve="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Pe+"|"+Fe+")"+"?",Ye="[\\ufe0e\\ufe0f]?",Xe=Ye+Ge+("(?:\\u200d(?:"+[ze,Ue,We].join("|")+")"+Ye+Ge+")*"),Ke="(?:"+[De,Ue,We].join("|")+")"+Xe,Qe="(?:"+[ze+Pe+"?",Pe,Ue,We,Me].join("|")+")",Je=RegExp(Ne,"g"),Ze=RegExp(Pe,"g"),et=RegExp(Fe+"(?="+Fe+")|"+Qe+Xe,"g"),tt=RegExp([He+"?"+Re+"+"+Ve+"(?="+[Le,He,"$"].join("|")+")",$e+"+"+qe+"(?="+[Le,He+Be,"$"].join("|")+")",He+"?"+Be+"+"+Ve,He+"+"+qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,Ke].join("|"),"g"),nt=RegExp("[\\u200d\\ud800-\\udfff"+Se+Te+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["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"],ot=-1,at={};at[R]=at[I]=at[F]=at[z]=at[U]=at[W]=at[H]=at[B]=at[$]=!0,at[y]=at[b]=at[A]=at[w]=at[D]=at[x]=at[k]=at[_]=at[C]=at[E]=at[j]=at[O]=at[N]=at[M]=at[P]=!1;var st={};st[y]=st[b]=st[A]=st[D]=st[w]=st[x]=st[R]=st[I]=st[F]=st[z]=st[U]=st[C]=st[E]=st[j]=st[O]=st[N]=st[M]=st[L]=st[W]=st[H]=st[B]=st[$]=!0,st[k]=st[_]=st[P]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,ct=parseInt,dt="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ft="object"==typeof self&&self&&self.Object===Object&&self,pt=dt||ft||Function("return this")(),ht=t&&!t.nodeType&&t,mt=ht&&e&&!e.nodeType&&e,vt=mt&&mt.exports===ht,gt=vt&&dt.process,yt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||gt&>.binding&>.binding("util")}catch(e){}}(),bt=yt&&yt.isArrayBuffer,wt=yt&&yt.isDate,xt=yt&&yt.isMap,kt=yt&&yt.isRegExp,_t=yt&&yt.isSet,St=yt&&yt.isTypedArray;function Ct(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Et(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function Lt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function tn(e,t){for(var n=e.length;n--&&Wt(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var rn=qt({À:"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"}),on=qt({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(e){return"\\"+lt[e]}function sn(e){return nt.test(e)}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function cn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var gn=function e(t){var n,r=(t=null==t?pt:gn.defaults(pt.Object(),t,gn.pick(pt,it))).Array,se=t.Date,Se=t.Error,Ce=t.Function,Ee=t.Math,je=t.Object,Te=t.RegExp,Oe=t.String,Ne=t.TypeError,Me=r.prototype,Le=Ce.prototype,Pe=je.prototype,Ae=t["__core-js_shared__"],De=Le.toString,Re=Pe.hasOwnProperty,Ie=0,Fe=(n=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",ze=Pe.toString,Ue=De.call(je),We=pt._,He=Te("^"+De.call(Re).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=vt?t.Buffer:i,$e=t.Symbol,Ve=t.Uint8Array,qe=Be?Be.allocUnsafe:i,Ge=un(je.getPrototypeOf,je),Ye=je.create,Xe=Pe.propertyIsEnumerable,Ke=Me.splice,Qe=$e?$e.isConcatSpreadable:i,et=$e?$e.iterator:i,nt=$e?$e.toStringTag:i,lt=function(){try{var e=ho(je,"defineProperty");return e({},"",{}),e}catch(e){}}(),dt=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ft=se&&se.now!==pt.Date.now&&se.now,ht=t.setTimeout!==pt.setTimeout&&t.setTimeout,mt=Ee.ceil,gt=Ee.floor,yt=je.getOwnPropertySymbols,Ft=Be?Be.isBuffer:i,qt=t.isFinite,yn=Me.join,bn=un(je.keys,je),wn=Ee.max,xn=Ee.min,kn=se.now,_n=t.parseInt,Sn=Ee.random,Cn=Me.reverse,En=ho(t,"DataView"),jn=ho(t,"Map"),Tn=ho(t,"Promise"),On=ho(t,"Set"),Nn=ho(t,"WeakMap"),Mn=ho(je,"create"),Ln=Nn&&new Nn,Pn={},An=Wo(En),Dn=Wo(jn),Rn=Wo(Tn),In=Wo(On),Fn=Wo(Nn),zn=$e?$e.prototype:i,Un=zn?zn.valueOf:i,Wn=zn?zn.toString:i;function Hn(e){if(is(e)&&!Ga(e)&&!(e instanceof qn)){if(e instanceof Vn)return e;if(Re.call(e,"__wrapped__"))return Ho(e)}return new Vn(e)}var Bn=function(){function e(){}return function(t){if(!rs(t))return{};if(Ye)return Ye(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function $n(){}function Vn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function qn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function cr(e,t,n,r,o,a){var s,l=1&t,u=2&t,c=4&t;if(n&&(s=o?n(e,r,o,a):n(e)),s!==i)return s;if(!rs(e))return e;var d=Ga(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Re.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Mi(e,s)}else{var f=go(e),p=f==_||f==S;if(Qa(e))return Ci(e,l);if(f==j||f==y||p&&!o){if(s=u||p?{}:bo(e),!l)return u?function(e,t){return Li(e,vo(e),t)}(e,function(e,t){return e&&Li(t,Ds(t),e)}(s,e)):function(e,t){return Li(e,mo(e),t)}(e,ar(s,e))}else{if(!st[f])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case A:return Ei(e);case w:case x:return new r(+e);case D:return function(e,t){var n=t?Ei(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case R:case I:case F:case z:case U:case W:case H:case B:case $:return ji(e,n);case C:return new r;case E:case M:return new r(e);case O:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case N:return new r;case L:return i=e,Un?je(Un.call(i)):{}}var i}(e,f,l)}}a||(a=new Qn);var h=a.get(e);if(h)return h;a.set(e,s),us(e)?e.forEach((function(r){s.add(cr(r,t,n,r,e,a))})):os(e)&&e.forEach((function(r,i){s.set(i,cr(r,t,n,i,e,a))}));var m=d?i:(c?u?ao:oo:u?Ds:As)(e);return jt(m||e,(function(r,i){m&&(r=e[i=r]),rr(s,i,cr(r,t,n,i,e,a))})),s}function dr(e,t,n){var r=n.length;if(null==e)return!r;for(e=je(e);r--;){var o=n[r],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function fr(e,t,n){if("function"!=typeof e)throw new Ne(o);return Ao((function(){e.apply(i,n)}),t)}function pr(e,t,n,r){var i=-1,o=Mt,a=!0,s=e.length,l=[],u=t.length;if(!s)return l;n&&(t=Pt(t,Qt(n))),r?(o=Lt,a=!1):t.length>=200&&(o=Zt,a=!1,t=new Kn(t));e:for(;++i-1},Yn.prototype.set=function(e,t){var n=this.__data__,r=ir(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Gn,map:new(jn||Yn),string:new Gn}},Xn.prototype.delete=function(e){var t=fo(this,e).delete(e);return this.size-=t?1:0,t},Xn.prototype.get=function(e){return fo(this,e).get(e)},Xn.prototype.has=function(e){return fo(this,e).has(e)},Xn.prototype.set=function(e,t){var n=fo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Kn.prototype.add=Kn.prototype.push=function(e){return this.__data__.set(e,a),this},Kn.prototype.has=function(e){return this.__data__.has(e)},Qn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Qn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Qn.prototype.get=function(e){return this.__data__.get(e)},Qn.prototype.has=function(e){return this.__data__.has(e)},Qn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!jn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Xn(r)}return n.set(e,t),this.size=n.size,this};var hr=Di(kr),mr=Di(_r,!0);function vr(e,t){var n=!0;return hr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function gr(e,t,n){for(var r=-1,o=e.length;++r0&&n(s)?t>1?br(s,t-1,n,r,i):At(i,s):r||(i[i.length]=s)}return i}var wr=Ri(),xr=Ri(!0);function kr(e,t){return e&&wr(e,t,As)}function _r(e,t){return e&&xr(e,t,As)}function Sr(e,t){return Nt(t,(function(t){return es(e[t])}))}function Cr(e,t){for(var n=0,r=(t=xi(t,e)).length;null!=e&&nt}function Or(e,t){return null!=e&&Re.call(e,t)}function Nr(e,t){return null!=e&&t in je(e)}function Mr(e,t,n){for(var o=n?Lt:Mt,a=e[0].length,s=e.length,l=s,u=r(s),c=1/0,d=[];l--;){var f=e[l];l&&t&&(f=Pt(f,Qt(t))),c=xn(f.length,c),u[l]=!n&&(t||a>=120&&f.length>=120)?new Kn(l&&f):i}f=e[0];var p=-1,h=u[0];e:for(;++p=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Gr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)s!==e&&Ke.call(s,l,1),Ke.call(e,l,1);return e}function Xr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;xo(i)?Ke.call(e,i,1):pi(e,i)}}return e}function Kr(e,t){return e+gt(Sn()*(t-e+1))}function Qr(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=gt(t/2))&&(e+=e)}while(t);return n}function Jr(e,t){return Do(Oo(e,t,al),e+"")}function Zr(e){return Zn(Bs(e))}function ei(e,t){var n=Bs(e);return Fo(n,ur(t,0,n.length))}function ti(e,t,n,r){if(!rs(e))return e;for(var o=-1,a=(t=xi(t,e)).length,s=a-1,l=e;null!=l&&++oo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i>>1,a=e[o];null!==a&&!ds(a)&&(n?a<=t:a=200){var u=t?null:Qi(e);if(u)return dn(u);a=!1,i=Zt,l=new Kn}else l=t?[]:s;e:for(;++r=r?e:oi(e,t,n)}var Si=dt||function(e){return pt.clearTimeout(e)};function Ci(e,t){if(t)return e.slice();var n=e.length,r=qe?qe(n):new e.constructor(n);return e.copy(r),r}function Ei(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function ji(e,t){var n=t?Ei(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ti(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,a=ds(e),s=t!==i,l=null===t,u=t==t,c=ds(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||r&&s&&u||!n&&u||!o)return 1;if(!r&&!a&&!c&&e1?n[o-1]:i,s=o>2?n[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&ko(n[0],n[1],s)&&(a=o<3?i:a,o=1),t=je(t);++r-1?o[a?t[s]:s]:i}}function Wi(e){return io((function(t){var n=t.length,r=n,a=Vn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new Ne(o);if(a&&!l&&"wrapper"==lo(s))var l=new Vn([],!0)}for(r=l?r:n;++r1&&b.reverse(),p&&cl))return!1;var c=a.get(e),d=a.get(t);if(c&&d)return c==t&&d==e;var f=-1,p=!0,h=2&n?new Kn:i;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(le,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return jt(g,(function(n){var r="_."+n[0];t&n[1]&&!Mt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ue);return t?t[1].split(ce):[]}(r),n)))}function Io(e){var t=0,n=0;return function(){var r=kn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Fo(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,la(e,n)}));function ma(e){var t=Hn(e);return t.__chain__=!0,t}function va(e,t){return t(e)}var ga=io((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return lr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof qn&&xo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:va,args:[o],thisArg:i}),new Vn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var ya=Pi((function(e,t,n){Re.call(e,n)?++e[n]:sr(e,n,1)}));var ba=Ui(qo),wa=Ui(Go);function xa(e,t){return(Ga(e)?jt:hr)(e,co(t,3))}function ka(e,t){return(Ga(e)?Tt:mr)(e,co(t,3))}var _a=Pi((function(e,t,n){Re.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Sa=Jr((function(e,t,n){var i=-1,o="function"==typeof t,a=Xa(e)?r(e.length):[];return hr(e,(function(e){a[++i]=o?Ct(t,e,n):Lr(e,t,n)})),a})),Ca=Pi((function(e,t,n){sr(e,n,t)}));function Ea(e,t){return(Ga(e)?Pt:Wr)(e,co(t,3))}var ja=Pi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ta=Jr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ko(e,t[0],t[1])?t=[]:n>2&&ko(t[0],t[1],t[2])&&(t=[t[0]]),qr(e,br(t,1),[])})),Oa=ft||function(){return pt.Date.now()};function Na(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Zi(e,d,i,i,i,i,t)}function Ma(e,t){var n;if("function"!=typeof t)throw new Ne(o);return e=gs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var La=Jr((function(e,t,n){var r=1;if(n.length){var i=cn(n,uo(La));r|=u}return Zi(e,r,t,n,i)})),Pa=Jr((function(e,t,n){var r=3;if(n.length){var i=cn(n,uo(Pa));r|=u}return Zi(t,r,e,n,i)}));function Aa(e,t,n){var r,a,s,l,u,c,d=0,f=!1,p=!1,h=!0;if("function"!=typeof e)throw new Ne(o);function m(t){var n=r,o=a;return r=a=i,d=t,l=e.apply(o,n)}function v(e){return d=e,u=Ao(y,t),f?m(e):l}function g(e){var n=e-c;return c===i||n>=t||n<0||p&&e-d>=s}function y(){var e=Oa();if(g(e))return b(e);u=Ao(y,function(e){var n=t-(e-c);return p?xn(n,s-(e-d)):n}(e))}function b(e){return u=i,h&&r?m(e):(r=a=i,l)}function w(){var e=Oa(),n=g(e);if(r=arguments,a=this,c=e,n){if(u===i)return v(c);if(p)return Si(u),u=Ao(y,t),m(c)}return u===i&&(u=Ao(y,t)),l}return t=bs(t)||0,rs(n)&&(f=!!n.leading,s=(p="maxWait"in n)?wn(bs(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),w.cancel=function(){u!==i&&Si(u),d=0,r=c=a=u=i},w.flush=function(){return u===i?l:b(Oa())},w}var Da=Jr((function(e,t){return fr(e,1,t)})),Ra=Jr((function(e,t,n){return fr(e,bs(t)||0,n)}));function Ia(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ne(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ia.Cache||Xn),n}function Fa(e){if("function"!=typeof e)throw new Ne(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ia.Cache=Xn;var za=ki((function(e,t){var n=(t=1==t.length&&Ga(t[0])?Pt(t[0],Qt(co())):Pt(br(t,1),Qt(co()))).length;return Jr((function(r){for(var i=-1,o=xn(r.length,n);++i=t})),qa=Pr(function(){return arguments}())?Pr:function(e){return is(e)&&Re.call(e,"callee")&&!Xe.call(e,"callee")},Ga=r.isArray,Ya=bt?Qt(bt):function(e){return is(e)&&jr(e)==A};function Xa(e){return null!=e&&ns(e.length)&&!es(e)}function Ka(e){return is(e)&&Xa(e)}var Qa=Ft||bl,Ja=wt?Qt(wt):function(e){return is(e)&&jr(e)==x};function Za(e){if(!is(e))return!1;var t=jr(e);return t==k||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=jr(e);return t==_||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==gs(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function is(e){return null!=e&&"object"==typeof e}var os=xt?Qt(xt):function(e){return is(e)&&go(e)==C};function as(e){return"number"==typeof e||is(e)&&jr(e)==E}function ss(e){if(!is(e)||jr(e)!=j)return!1;var t=Ge(e);if(null===t)return!0;var n=Re.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Ue}var ls=kt?Qt(kt):function(e){return is(e)&&jr(e)==O};var us=_t?Qt(_t):function(e){return is(e)&&go(e)==N};function cs(e){return"string"==typeof e||!Ga(e)&&is(e)&&jr(e)==M}function ds(e){return"symbol"==typeof e||is(e)&&jr(e)==L}var fs=St?Qt(St):function(e){return is(e)&&ns(e.length)&&!!at[jr(e)]};var ps=Yi(Ur),hs=Yi((function(e,t){return e<=t}));function ms(e){if(!e)return[];if(Xa(e))return cs(e)?hn(e):Mi(e);if(et&&e[et])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[et]());var t=go(e);return(t==C?ln:t==N?dn:Bs)(e)}function vs(e){return e?(e=bs(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function gs(e){var t=vs(e),n=t%1;return t==t?n?t-n:t:0}function ys(e){return e?ur(gs(e),0,v):0}function bs(e){if("number"==typeof e)return e;if(ds(e))return m;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kt(e);var n=ge.test(e);return n||be.test(e)?ct(e.slice(2),n?2:8):ve.test(e)?m:+e}function ws(e){return Li(e,Ds(e))}function xs(e){return null==e?"":di(e)}var ks=Ai((function(e,t){if(Eo(t)||Xa(t))Li(t,As(t),e);else for(var n in t)Re.call(t,n)&&rr(e,n,t[n])})),_s=Ai((function(e,t){Li(t,Ds(t),e)})),Ss=Ai((function(e,t,n,r){Li(t,Ds(t),e,r)})),Cs=Ai((function(e,t,n,r){Li(t,As(t),e,r)})),Es=io(lr);var js=Jr((function(e,t){e=je(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&ko(t[0],t[1],o)&&(r=1);++n1),t})),Li(e,ao(e),n),r&&(n=cr(n,7,no));for(var i=t.length;i--;)pi(n,t[i]);return n}));var zs=io((function(e,t){return null==e?{}:function(e,t){return Gr(e,t,(function(t,n){return Ns(e,n)}))}(e,t)}));function Us(e,t){if(null==e)return{};var n=Pt(ao(e),(function(e){return[e]}));return t=co(t),Gr(e,n,(function(e,n){return t(e,n[0])}))}var Ws=Ji(As),Hs=Ji(Ds);function Bs(e){return null==e?[]:Jt(e,As(e))}var $s=Fi((function(e,t,n){return t=t.toLowerCase(),e+(n?Vs(t):t)}));function Vs(e){return Zs(xs(e).toLowerCase())}function qs(e){return(e=xs(e))&&e.replace(xe,rn).replace(Ze,"")}var Gs=Fi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ys=Fi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Xs=Ii("toLowerCase");var Ks=Fi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Qs=Fi((function(e,t,n){return e+(n?" ":"")+Zs(t)}));var Js=Fi((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Zs=Ii("toUpperCase");function el(e,t,n){return e=xs(e),(t=n?i:t)===i?function(e){return rt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var tl=Jr((function(e,t){try{return Ct(e,i,t)}catch(e){return Za(e)?e:new Se(e)}})),nl=io((function(e,t){return jt(t,(function(t){t=Uo(t),sr(e,t,La(e[t],e))})),e}));function rl(e){return function(){return e}}var il=Wi(),ol=Wi(!0);function al(e){return e}function sl(e){return Ir("function"==typeof e?e:cr(e,1))}var ll=Jr((function(e,t){return function(n){return Lr(n,e,t)}})),ul=Jr((function(e,t){return function(n){return Lr(e,n,t)}}));function cl(e,t,n){var r=As(t),i=Sr(t,r);null!=n||rs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Sr(t,As(t)));var o=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return jt(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Mi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,At([this.value()],arguments))})})),e}function dl(){}var fl=Vi(Pt),pl=Vi(Ot),hl=Vi(It);function ml(e){return _o(e)?Vt(Uo(e)):function(e){return function(t){return Cr(t,e)}}(e)}var vl=Gi(),gl=Gi(!0);function yl(){return[]}function bl(){return!1}var wl=$i((function(e,t){return e+t}),0),xl=Ki("ceil"),kl=$i((function(e,t){return e/t}),1),_l=Ki("floor");var Sl,Cl=$i((function(e,t){return e*t}),1),El=Ki("round"),jl=$i((function(e,t){return e-t}),0);return Hn.after=function(e,t){if("function"!=typeof t)throw new Ne(o);return e=gs(e),function(){if(--e<1)return t.apply(this,arguments)}},Hn.ary=Na,Hn.assign=ks,Hn.assignIn=_s,Hn.assignInWith=Ss,Hn.assignWith=Cs,Hn.at=Es,Hn.before=Ma,Hn.bind=La,Hn.bindAll=nl,Hn.bindKey=Pa,Hn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ga(e)?e:[e]},Hn.chain=ma,Hn.chunk=function(e,t,n){t=(n?ko(e,t,n):t===i)?1:wn(gs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,l=r(mt(o/t));ao?0:o+n),(r=r===i||r>o?o:gs(r))<0&&(r+=o),r=n>r?0:ys(r);n>>0)?(e=xs(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=di(t))&&sn(e)?_i(hn(e),0,n):e.split(t,n):[]},Hn.spread=function(e,t){if("function"!=typeof e)throw new Ne(o);return t=null==t?0:wn(gs(t),0),Jr((function(n){var r=n[t],i=_i(n,0,t);return r&&At(i,r),Ct(e,this,i)}))},Hn.tail=function(e){var t=null==e?0:e.length;return t?oi(e,1,t):[]},Hn.take=function(e,t,n){return e&&e.length?oi(e,0,(t=n||t===i?1:gs(t))<0?0:t):[]},Hn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,(t=r-(t=n||t===i?1:gs(t)))<0?0:t,r):[]},Hn.takeRightWhile=function(e,t){return e&&e.length?mi(e,co(t,3),!1,!0):[]},Hn.takeWhile=function(e,t){return e&&e.length?mi(e,co(t,3)):[]},Hn.tap=function(e,t){return t(e),e},Hn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ne(o);return rs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Aa(e,t,{leading:r,maxWait:t,trailing:i})},Hn.thru=va,Hn.toArray=ms,Hn.toPairs=Ws,Hn.toPairsIn=Hs,Hn.toPath=function(e){return Ga(e)?Pt(e,Uo):ds(e)?[e]:Mi(zo(xs(e)))},Hn.toPlainObject=ws,Hn.transform=function(e,t,n){var r=Ga(e),i=r||Qa(e)||fs(e);if(t=co(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:rs(e)&&es(o)?Bn(Ge(e)):{}}return(i?jt:kr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Hn.unary=function(e){return Na(e,1)},Hn.union=ia,Hn.unionBy=oa,Hn.unionWith=aa,Hn.uniq=function(e){return e&&e.length?fi(e):[]},Hn.uniqBy=function(e,t){return e&&e.length?fi(e,co(t,2)):[]},Hn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?fi(e,i,t):[]},Hn.unset=function(e,t){return null==e||pi(e,t)},Hn.unzip=sa,Hn.unzipWith=la,Hn.update=function(e,t,n){return null==e?e:hi(e,t,wi(n))},Hn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:hi(e,t,wi(n),r)},Hn.values=Bs,Hn.valuesIn=function(e){return null==e?[]:Jt(e,Ds(e))},Hn.without=ua,Hn.words=el,Hn.wrap=function(e,t){return Ua(wi(t),e)},Hn.xor=ca,Hn.xorBy=da,Hn.xorWith=fa,Hn.zip=pa,Hn.zipObject=function(e,t){return yi(e||[],t||[],rr)},Hn.zipObjectDeep=function(e,t){return yi(e||[],t||[],ti)},Hn.zipWith=ha,Hn.entries=Ws,Hn.entriesIn=Hs,Hn.extend=_s,Hn.extendWith=Ss,cl(Hn,Hn),Hn.add=wl,Hn.attempt=tl,Hn.camelCase=$s,Hn.capitalize=Vs,Hn.ceil=xl,Hn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=bs(n))==n?n:0),t!==i&&(t=(t=bs(t))==t?t:0),ur(bs(e),t,n)},Hn.clone=function(e){return cr(e,4)},Hn.cloneDeep=function(e){return cr(e,5)},Hn.cloneDeepWith=function(e,t){return cr(e,5,t="function"==typeof t?t:i)},Hn.cloneWith=function(e,t){return cr(e,4,t="function"==typeof t?t:i)},Hn.conformsTo=function(e,t){return null==t||dr(e,t,As(t))},Hn.deburr=qs,Hn.defaultTo=function(e,t){return null==e||e!=e?t:e},Hn.divide=kl,Hn.endsWith=function(e,t,n){e=xs(e),t=di(t);var r=e.length,o=n=n===i?r:ur(gs(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Hn.eq=Ba,Hn.escape=function(e){return(e=xs(e))&&Q.test(e)?e.replace(X,on):e},Hn.escapeRegExp=function(e){return(e=xs(e))&&oe.test(e)?e.replace(ie,"\\$&"):e},Hn.every=function(e,t,n){var r=Ga(e)?Ot:vr;return n&&ko(e,t,n)&&(t=i),r(e,co(t,3))},Hn.find=ba,Hn.findIndex=qo,Hn.findKey=function(e,t){return zt(e,co(t,3),kr)},Hn.findLast=wa,Hn.findLastIndex=Go,Hn.findLastKey=function(e,t){return zt(e,co(t,3),_r)},Hn.floor=_l,Hn.forEach=xa,Hn.forEachRight=ka,Hn.forIn=function(e,t){return null==e?e:wr(e,co(t,3),Ds)},Hn.forInRight=function(e,t){return null==e?e:xr(e,co(t,3),Ds)},Hn.forOwn=function(e,t){return e&&kr(e,co(t,3))},Hn.forOwnRight=function(e,t){return e&&_r(e,co(t,3))},Hn.get=Os,Hn.gt=$a,Hn.gte=Va,Hn.has=function(e,t){return null!=e&&yo(e,t,Or)},Hn.hasIn=Ns,Hn.head=Xo,Hn.identity=al,Hn.includes=function(e,t,n,r){e=Xa(e)?e:Bs(e),n=n&&!r?gs(n):0;var i=e.length;return n<0&&(n=wn(i+n,0)),cs(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Wt(e,t,n)>-1},Hn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:gs(n);return i<0&&(i=wn(r+i,0)),Wt(e,t,i)},Hn.inRange=function(e,t,n){return t=vs(t),n===i?(n=t,t=0):n=vs(n),function(e,t,n){return e>=xn(t,n)&&e=-9007199254740991&&e<=h},Hn.isSet=us,Hn.isString=cs,Hn.isSymbol=ds,Hn.isTypedArray=fs,Hn.isUndefined=function(e){return e===i},Hn.isWeakMap=function(e){return is(e)&&go(e)==P},Hn.isWeakSet=function(e){return is(e)&&"[object WeakSet]"==jr(e)},Hn.join=function(e,t){return null==e?"":yn.call(e,t)},Hn.kebabCase=Gs,Hn.last=Zo,Hn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=gs(n))<0?wn(r+o,0):xn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Ut(e,Bt,o,!0)},Hn.lowerCase=Ys,Hn.lowerFirst=Xs,Hn.lt=ps,Hn.lte=hs,Hn.max=function(e){return e&&e.length?gr(e,al,Tr):i},Hn.maxBy=function(e,t){return e&&e.length?gr(e,co(t,2),Tr):i},Hn.mean=function(e){return $t(e,al)},Hn.meanBy=function(e,t){return $t(e,co(t,2))},Hn.min=function(e){return e&&e.length?gr(e,al,Ur):i},Hn.minBy=function(e,t){return e&&e.length?gr(e,co(t,2),Ur):i},Hn.stubArray=yl,Hn.stubFalse=bl,Hn.stubObject=function(){return{}},Hn.stubString=function(){return""},Hn.stubTrue=function(){return!0},Hn.multiply=Cl,Hn.nth=function(e,t){return e&&e.length?Vr(e,gs(t)):i},Hn.noConflict=function(){return pt._===this&&(pt._=We),this},Hn.noop=dl,Hn.now=Oa,Hn.pad=function(e,t,n){e=xs(e);var r=(t=gs(t))?pn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return qi(gt(i),n)+e+qi(mt(i),n)},Hn.padEnd=function(e,t,n){e=xs(e);var r=(t=gs(t))?pn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=Sn();return xn(e+o*(t-e+ut("1e-"+((o+"").length-1))),t)}return Kr(e,t)},Hn.reduce=function(e,t,n){var r=Ga(e)?Dt:Gt,i=arguments.length<3;return r(e,co(t,4),n,i,hr)},Hn.reduceRight=function(e,t,n){var r=Ga(e)?Rt:Gt,i=arguments.length<3;return r(e,co(t,4),n,i,mr)},Hn.repeat=function(e,t,n){return t=(n?ko(e,t,n):t===i)?1:gs(t),Qr(xs(e),t)},Hn.replace=function(){var e=arguments,t=xs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Hn.result=function(e,t,n){var r=-1,o=(t=xi(t,e)).length;for(o||(o=1,e=i);++rh)return[];var n=v,r=xn(e,v);t=co(t),e-=v;for(var i=Xt(r,t);++n=a)return e;var l=n-pn(r);if(l<1)return r;var u=s?_i(s,0,l).join(""):e.slice(0,l);if(o===i)return u+r;if(s&&(l+=u.length-l),ls(o)){if(e.slice(l).search(o)){var c,d=u;for(o.global||(o=Te(o.source,xs(me.exec(o))+"g")),o.lastIndex=0;c=o.exec(d);)var f=c.index;u=u.slice(0,f===i?l:f)}}else if(e.indexOf(di(o),l)!=l){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+r},Hn.unescape=function(e){return(e=xs(e))&&K.test(e)?e.replace(Y,vn):e},Hn.uniqueId=function(e){var t=++Ie;return xs(e)+t},Hn.upperCase=Js,Hn.upperFirst=Zs,Hn.each=xa,Hn.eachRight=ka,Hn.first=Xo,cl(Hn,(Sl={},kr(Hn,(function(e,t){Re.call(Hn.prototype,t)||(Sl[t]=e)})),Sl),{chain:!1}),Hn.VERSION="4.17.21",jt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Hn[e].placeholder=Hn})),jt(["drop","take"],(function(e,t){qn.prototype[e]=function(n){n=n===i?1:wn(gs(n),0);var r=this.__filtered__&&!t?new qn(this):this.clone();return r.__filtered__?r.__takeCount__=xn(n,r.__takeCount__):r.__views__.push({size:xn(n,v),type:e+(r.__dir__<0?"Right":"")}),r},qn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),jt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;qn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:co(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),jt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");qn.prototype[e]=function(){return this[n](1).value()[0]}})),jt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");qn.prototype[e]=function(){return this.__filtered__?new qn(this):this[n](1)}})),qn.prototype.compact=function(){return this.filter(al)},qn.prototype.find=function(e){return this.filter(e).head()},qn.prototype.findLast=function(e){return this.reverse().find(e)},qn.prototype.invokeMap=Jr((function(e,t){return"function"==typeof e?new qn(this):this.map((function(n){return Lr(n,e,t)}))})),qn.prototype.reject=function(e){return this.filter(Fa(co(e)))},qn.prototype.slice=function(e,t){e=gs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new qn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=gs(t))<0?n.dropRight(-t):n.take(t-e)),n)},qn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},qn.prototype.toArray=function(){return this.take(v)},kr(qn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Hn[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(Hn.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,l=t instanceof qn,u=s[0],c=l||Ga(t),d=function(e){var t=o.apply(Hn,At([e],s));return r&&f?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var f=this.__chain__,p=!!this.__actions__.length,h=a&&!f,m=l&&!p;if(!a&&c){t=m?t:new qn(this);var v=e.apply(t,s);return v.__actions__.push({func:va,args:[d],thisArg:i}),new Vn(v,f)}return h&&m?e.apply(this,s):(v=this.thru(d),h?r?v.value()[0]:v.value():v)})})),jt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Me[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Hn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ga(i)?i:[],e)}return this[n]((function(n){return t.apply(Ga(n)?n:[],e)}))}})),kr(qn.prototype,(function(e,t){var n=Hn[t];if(n){var r=n.name+"";Re.call(Pn,r)||(Pn[r]=[]),Pn[r].push({name:t,func:n})}})),Pn[Hi(i,2).name]=[{name:"wrapper",func:i}],qn.prototype.clone=function(){var e=new qn(this.__wrapped__);return e.__actions__=Mi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Mi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Mi(this.__views__),e},qn.prototype.reverse=function(){if(this.__filtered__){var e=new qn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},qn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ga(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Hn.prototype.plant=function(e){for(var t,n=this;n instanceof $n;){var r=Ho(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Hn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof qn){var t=e;return this.__actions__.length&&(t=new qn(this)),(t=t.reverse()).__actions__.push({func:va,args:[ra],thisArg:i}),new Vn(t,this.__chain__)}return this.thru(ra)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return vi(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,et&&(Hn.prototype[et]=function(){return this}),Hn}();pt._=gn,(r=function(){return gn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},7418:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var a,s,l=i(e),u=1;u{var r=n(6173);e.exports=p,e.exports.parse=o,e.exports.compile=function(e,t){return s(o(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=f;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,a=0,s="",c=t&&t.delimiter||"/";null!=(n=i.exec(e));){var d=n[0],f=n[1],p=n.index;if(s+=e.slice(a,p),a=p+d.length,f)s+=f[1];else{var h=e[a],m=n[2],v=n[3],g=n[4],y=n[5],b=n[6],w=n[7];s&&(r.push(s),s="");var x=null!=m&&null!=h&&h!==m,k="+"===b||"*"===b,_="?"===b||"*"===b,S=n[2]||c,C=g||y;r.push({name:v||o++,prefix:m||"",delimiter:S,optional:_,repeat:k,partial:x,asterisk:!!w,pattern:C?u(C):w?".*":"[^"+l(S)+"]+?"})}}return a{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},2703:(e,t,n)=>{"use strict";var r=n(414);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9656:(e,t,n)=>{"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t{"use strict";var r=n(7294),i=n(7418),o=n(3840);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n