(e,t,n,r,i)
| 125 | */r=[n(11),n(33)],void 0===(o="function"==typeof(i=function(t){return t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}})?i.apply(e,r):i)||(t.exports=o)},function(t){t.exports={name:"@jupyter-widgets/controls",version:"1.5.3",description:"Jupyter interactive widgets",repository:{type:"git",url:"https://github.com/jupyter-widgets/ipywidgets.git"},license:"BSD-3-Clause",author:"Project Jupyter",files:["lib/**/*.d.ts","lib/**/*.js","css/*.css","dist/"],main:"lib/index.js",typings:"lib/index.d.ts",scripts:{build:"npm run build:src && npm run build:css","build:css":"postcss --use postcss-import --use postcss-cssnext -o css/widgets.built.css css/widgets.css","build:src":"tsc","build:test":"tsc --project test && webpack --config test/webpack.conf.js",clean:"npm run clean:src","clean:src":"rimraf lib && rimraf tsconfig.tsbuildinfo",lint:"tslint --project tslint.json --format stylish",prepublish:"npm run clean && npm run build",test:"npm run test:unit","test:coverage":"npm run build:test && webpack --config test/webpack-cov.conf.js && karma start test/karma-cov.conf.js","test:unit":"npm run test:unit:firefox && npm run test:unit:chrome","test:unit:chrome":"npm run test:unit:default -- --browsers=Chrome","test:unit:default":"npm run build:test && karma start test/karma.conf.js --log-level debug","test:unit:firefox":"npm run test:unit:default -- --browsers=Firefox","test:unit:ie":"npm run test:unit:default -- --browsers=IE"},dependencies:{"@jupyter-widgets/base":"^2.0.2","@phosphor/algorithm":"^1.1.0","@phosphor/domutils":"^1.1.0","@phosphor/messaging":"^1.2.1","@phosphor/signaling":"^1.2.0","@phosphor/widgets":"^1.3.0","d3-format":"^1.3.0",jquery:"^3.1.1","jquery-ui":"^1.12.1",underscore:"^1.8.3"},devDependencies:{"@jupyterlab/services":"^2.0.0 || ^3.0.0 || ^4.0.0","@types/d3-format":"^1.3.1","@types/expect.js":"^0.3.29","@types/mathjax":"^0.0.35","@types/mocha":"^5.2.7","@types/node":"^12.0.10",chai:"^4.0.0","css-loader":"^3.0.0","expect.js":"^0.3.1","file-loader":"^4.0.0","istanbul-instrumenter-loader":"^3.0.1","json-loader":"^0.5.7",karma:"^4.1.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.2","karma-firefox-launcher":"^1.1.0","karma-ie-launcher":"^1.0.0","karma-mocha":"^1.3.0","karma-mocha-reporter":"^2.2.5","karma-webpack":"^4.0.2",mocha:"^6.1.4","npm-run-all":"^4.1.5","postcss-cli":"^6.1.2","postcss-cssnext":"^3.1.0","postcss-import":"^12.0.1","postcss-loader":"^3.0.0",rimraf:"^2.6.1",sinon:"^7.3.2","sinon-chai":"^3.3.0","style-loader":"^0.23.1",tslint:"^5.18.0",typescript:"~3.5.2","url-loader":"^2.0.0",webpack:"^4.35.0"},gitHead:"92d7d42c00a1b0d9ce921533acb08beefdea3eb2"}},function(t,e,n){"use strict";n.r(e);var i=n(1);function r(t,e){return function(n){var r=new i.WrappedError(t,n);return e&&console.error(r),Promise.reject(r)}}function o(t,e){void 0!==e&&(t.textContent=e),void 0!==window.MathJax&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,t])}function s(t){var e=document.createElement("div");return e.textContent=t,e.innerHTML}var a,u=(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(){return(c=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.defaults=function(){return c({},t.prototype.defaults.call(this),{_model_name:"DescriptionStyleModel",_model_module:"@jupyter-widgets/controls",_model_module_version:"1.5.0"})},e.styleProperties={description_width:{selector:".widget-label",attribute:"width",default:null}},e}(i.StyleModel),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.defaults=function(){return c({},t.prototype.defaults.call(this),{_model_name:"DescriptionModel",_view_name:"DescriptionView",_view_module:"@jupyter-widgets/controls",_model_module:"@jupyter-widgets/controls",_view_module_version:"1.5.0",_model_module_version:"1.5.0",description:"",description_tooltip:null})},e}(i.DOMWidgetModel),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.render=function(){this.label=document.createElement("label"),this.el.appendChild(this.label),this.label.className="widget-label",this.label.style.display="none",this.listenTo(this.model,"change:description",this.updateDescription),this.listenTo(this.model,"change:description_tooltip",this.updateDescription),this.updateDescription()},e.prototype.typeset=function(t,e){this.displayed.then(function(){return o(t,e)})},e.prototype.updateDescription=function(){var t=this.model.get("description"),e=this.model.get("description_tooltip");null===e&&(e=t),0===t.length?this.label.style.display="none":(this.label.innerHTML=t,this.typeset(this.label),this.label.style.display=""),this.label.title=e},e}(i.DOMWidgetView),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e}(h),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e}(l),m=n(0),g=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"CoreWidgetModel",_view_module:"@jupyter-widgets/controls",_model_module:"@jupyter-widgets/controls",_view_module_version:"1.5.0",_model_module_version:"1.5.0"})},e}(i.WidgetModel),v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"CoreDOMWidgetModel",_view_module:"@jupyter-widgets/controls",_model_module:"@jupyter-widgets/controls",_view_module_version:"1.5.0",_model_module_version:"1.5.0"})},e}(i.DOMWidgetModel),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"CoreDescriptionModel",_view_module:"@jupyter-widgets/controls",_model_module:"@jupyter-widgets/controls",_view_module_version:"1.5.0",_model_module_version:"1.5.0"})},e}(h),_=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),w=function(){return(w=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{target:void 0,source:void 0,_model_name:"DirectionalLinkModel"})},e.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n),this.on("change",this.updateBindings,this),this.updateBindings()},e.prototype.updateValue=function(t,e,n,i){if(!this._updating){this._updating=!0;try{n&&(n.set(i,t.get(e)),n.save_changes())}finally{this._updating=!1}}},e.prototype.updateBindings=function(){var t,e,n=this;this.cleanup(),t=this.get("source")||[null,null],this.sourceModel=t[0],this.sourceAttr=t[1],e=this.get("target")||[null,null],this.targetModel=e[0],this.targetAttr=e[1],this.sourceModel&&(this.listenTo(this.sourceModel,"change:"+this.sourceAttr,function(){n.updateValue(n.sourceModel,n.sourceAttr,n.targetModel,n.targetAttr)}),this.updateValue(this.sourceModel,this.sourceAttr,this.targetModel,this.targetAttr),this.listenToOnce(this.sourceModel,"destroy",this.cleanup)),this.targetModel&&this.listenToOnce(this.targetModel,"destroy",this.cleanup)},e.prototype.cleanup=function(){this.sourceModel&&(this.stopListening(this.sourceModel,"change:"+this.sourceAttr,null),this.stopListening(this.sourceModel,"destroy",null)),this.targetModel&&this.stopListening(this.targetModel,"destroy",null)},e.serializers=w({},b.serializers,{target:{deserialize:i.unpack_models},source:{deserialize:i.unpack_models}}),e}(b),M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"LinkModel"})},e.prototype.updateBindings=function(){var e=this;t.prototype.updateBindings.call(this),this.targetModel&&this.listenTo(this.targetModel,"change:"+this.targetAttr,function(){e.updateValue(e.targetModel,e.targetAttr,e.sourceModel,e.sourceAttr)})},e.prototype.cleanup=function(){t.prototype.cleanup.call(this),this.targetModel&&this.stopListening(this.targetModel,"change:"+this.targetAttr,null)},e}(x),S=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{value:!1,disabled:!1,_model_name:"BoolModel"})},e}(y),A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{indent:!0,_view_name:"CheckboxView",_model_name:"CheckboxModel"})},e}(y),C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-checkbox"),this.label.innerHTML="​",this.checkboxLabel=document.createElement("label"),this.checkboxLabel.classList.add("widget-label-basic"),this.el.appendChild(this.checkboxLabel),this.checkbox=document.createElement("input"),this.checkbox.setAttribute("type","checkbox"),this.checkboxLabel.appendChild(this.checkbox),this.descriptionSpan=document.createElement("span"),this.checkboxLabel.appendChild(this.descriptionSpan),this.listenTo(this.model,"change:indent",this.updateIndent),this.update(),this.updateDescription(),this.updateIndent()},e.prototype.updateDescription=function(){if(null!=this.checkboxLabel){var t=this.model.get("description");this.descriptionSpan.innerHTML=t,this.typeset(this.descriptionSpan),this.descriptionSpan.title=t,this.checkbox.title=t}},e.prototype.updateIndent=function(){var t=this.model.get("indent");this.label.style.display=t?"":"none"},e.prototype.events=function(){return{'click input[type="checkbox"]':"_handle_click"}},e.prototype._handle_click=function(){var t=this.model.get("value");this.model.set("value",!t,{updated_view:this}),this.touch()},e.prototype.update=function(e){return this.checkbox.checked=this.model.get("value"),void 0!==e&&e.updated_view==this||(this.checkbox.disabled=this.model.get("disabled")),t.prototype.update.call(this)},e}(l),k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_view_name:"ToggleButtonView",_model_name:"ToggleButtonModel",tooltip:"",icon:"",button_style:""})},e}(E),T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("jupyter-button"),this.el.classList.add("widget-toggle-button"),this.listenTo(this.model,"change:button_style",this.update_button_style),this.set_button_style(),this.update()},e.prototype.update_button_style=function(){this.update_mapped_classes(e.class_map,"button_style")},e.prototype.set_button_style=function(){this.set_mapped_classes(e.class_map,"button_style")},e.prototype.update=function(e){if(this.model.get("value")?this.el.classList.add("mod-active"):this.el.classList.remove("mod-active"),void 0===e||e.updated_view!==this){this.el.disabled=this.model.get("disabled"),this.el.setAttribute("title",this.model.get("tooltip"));var n=this.model.get("description"),i=this.model.get("icon");if(0===n.trim().length&&0===i.trim().length)this.el.innerHTML=" ";else{if(this.el.textContent="",i.trim().length){var r=document.createElement("i");this.el.appendChild(r),r.classList.add("fa"),r.classList.add("fa-"+i)}this.el.appendChild(document.createTextNode(n))}}return t.prototype.update.call(this)},e.prototype.events=function(){return{click:"_handle_click"}},e.prototype._handle_click=function(t){t.preventDefault();var e=this.model.get("value");this.model.set("value",!e,{updated_view:this}),this.touch()},Object.defineProperty(e.prototype,"tagName",{get:function(){return"button"},enumerable:!0,configurable:!0}),e.class_map={primary:["mod-primary"],success:["mod-success"],info:["mod-info"],warning:["mod-warning"],danger:["mod-danger"]},e}(i.DOMWidgetView),I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{readout:"Invalid",_view_name:"ValidView",_model_name:"ValidModel"})},e}(E),P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-valid"),this.el.classList.add("widget-inline-hbox");var e=document.createElement("i");this.el.appendChild(e),this.readout=document.createElement("span"),this.readout.classList.add("widget-valid-readout"),this.readout.classList.add("widget-readout"),this.el.appendChild(this.readout),this.update()},e.prototype.update=function(){this.el.classList.remove("mod-valid"),this.el.classList.remove("mod-invalid"),this.readout.textContent=this.model.get("readout"),this.model.get("value")?this.el.classList.add("mod-valid"):this.el.classList.add("mod-invalid")},e}(l),O=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),L=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return O(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"ButtonStyleModel",_model_module:"@jupyter-widgets/controls",_model_module_version:"1.5.0"})},e.styleProperties={button_color:{selector:"",attribute:"background-color",default:null},font_weight:{selector:"",attribute:"font-weight",default:""}},e}(i.StyleModel),j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return O(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{description:"",tooltip:"",disabled:!1,icon:"",button_style:"",_view_name:"ButtonView",_model_name:"ButtonModel",style:null})},e}(v),B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return O(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("jupyter-button"),this.el.classList.add("widget-button"),this.listenTo(this.model,"change:button_style",this.update_button_style),this.set_button_style(),this.update()},e.prototype.update=function(){this.el.disabled=this.model.get("disabled"),this.el.setAttribute("title",this.model.get("tooltip"));var e=this.model.get("description"),n=this.model.get("icon");if(e.length||n.length){if(this.el.textContent="",n.length){var i=document.createElement("i");i.classList.add("fa"),i.classList.add("fa-"+n),0===e.length&&i.classList.add("center"),this.el.appendChild(i)}this.el.appendChild(document.createTextNode(e))}return t.prototype.update.call(this)},e.prototype.update_button_style=function(){this.update_mapped_classes(e.class_map,"button_style")},e.prototype.set_button_style=function(){this.set_mapped_classes(e.class_map,"button_style")},e.prototype.events=function(){return{click:"_handle_click"}},e.prototype._handle_click=function(t){t.preventDefault(),this.send({event:"click"})},Object.defineProperty(e.prototype,"tagName",{get:function(){return"button"},enumerable:!0,configurable:!0}),e.class_map={primary:["mod-primary"],success:["mod-success"],info:["mod-info"],warning:["mod-warning"],danger:["mod-danger"]},e}(i.DOMWidgetView),D=n(4),R=n(7),z=n(5),N=n(11),W=n.n(N),q=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),H=function(){return(H=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return q(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_view_name:"BoxView",_model_name:"BoxModel",children:[],box_style:""})},e.serializers=H({},v.serializers,{children:{deserialize:i.unpack_models}}),e}(v),V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return q(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_view_name:"HBoxView",_model_name:"HBoxModel"})},e}(F),U=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return q(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_view_name:"VBoxView",_model_name:"VBoxModel"})},e}(F),K=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return q(e,t),e.prototype._createElement=function(t){return this.pWidget=new i.JupyterPhosphorPanelWidget({view:this}),this.pWidget.node},e.prototype._setElement=function(t){if(this.el||t!==this.pWidget.node)throw new Error("Cannot reset the DOM element.");this.el=this.pWidget.node,this.$el=W()(this.pWidget.node)},e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.children_views=new i.ViewList(this.add_child_model,null,this),this.listenTo(this.model,"change:children",this.update_children),this.listenTo(this.model,"change:box_style",this.update_box_style),this.pWidget.addClass("jupyter-widgets"),this.pWidget.addClass("widget-container"),this.pWidget.addClass("widget-box")},e.prototype.render=function(){t.prototype.render.call(this),this.update_children(),this.set_box_style()},e.prototype.update_children=function(){this.children_views.update(this.model.get("children")).then(function(t){t.forEach(function(t){R.MessageLoop.postMessage(t.pWidget,z.Widget.ResizeMessage.UnknownSize)})})},e.prototype.update_box_style=function(){this.update_mapped_classes(e.class_map,"box_style")},e.prototype.set_box_style=function(){this.set_mapped_classes(e.class_map,"box_style")},e.prototype.add_child_model=function(t){var e=this,n=new z.Widget;return this.pWidget.addWidget(n),this.create_child_view(t).then(function(t){var i=D.ArrayExt.firstIndexOf(e.pWidget.widgets,n);return e.pWidget.insertWidget(i,t.pWidget),n.dispose(),t}).catch(r("Could not add child view to box",!0))},e.prototype.remove=function(){this.children_views=null,t.prototype.remove.call(this)},e.class_map={success:["alert","alert-success"],info:["alert","alert-info"],warning:["alert","alert-warning"],danger:["alert","alert-danger"]},e}(i.DOMWidgetView),Y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return q(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.pWidget.addClass("widget-hbox")},e}(K),X=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return q(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.pWidget.addClass("widget-vbox")},e}(K),$=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return q(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.pWidget.addClass("widget-gridbox"),this.pWidget.removeClass("widget-box")},e}(K),G=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return q(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_view_name:"GridBoxView",_model_name:"GridBoxModel"})},e}(F),J=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Z=function(){return(Z=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},Q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return J(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"ImageModel",_view_name:"ImageView",format:"png",width:"",height:"",value:new DataView(new ArrayBuffer(0))})},e.serializers=Z({},v.serializers,{value:{serialize:function(t){return new DataView(t.buffer.slice(0))}}}),e}(v),tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return J(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.pWidget.addClass("jupyter-widgets"),this.pWidget.addClass("widget-image"),this.update()},e.prototype.update=function(){var e,n=this.model.get("format"),i=this.model.get("value");if("url"!==n){var r=new Blob([i],{type:"image/"+this.model.get("format")});e=URL.createObjectURL(r)}else e=new TextDecoder("utf-8").decode(i.buffer);var o=this.el.src;this.el.src=e,o&&"string"!=typeof o&&URL.revokeObjectURL(o);var s=this.model.get("width");void 0!==s&&s.length>0?this.el.setAttribute("width",s):this.el.removeAttribute("width");var a=this.model.get("height");return void 0!==a&&a.length>0?this.el.setAttribute("height",a):this.el.removeAttribute("height"),t.prototype.update.call(this)},e.prototype.remove=function(){this.el.src&&URL.revokeObjectURL(this.el.src),t.prototype.remove.call(this)},Object.defineProperty(e.prototype,"tagName",{get:function(){return"img"},enumerable:!0,configurable:!0}),e}(i.DOMWidgetView),et=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),nt=function(){return(nt=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},it=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return et(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"VideoModel",_view_name:"VideoView",format:"mp4",width:"",height:"",autoplay:!0,loop:!0,controls:!0,value:new DataView(new ArrayBuffer(0))})},e.serializers=nt({},v.serializers,{value:{serialize:function(t){return new DataView(t.buffer.slice(0))}}}),e}(v),rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return et(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.pWidget.addClass("jupyter-widgets"),this.pWidget.addClass("widget-image"),this.update()},e.prototype.update=function(){var e,n=this.model.get("format"),i=this.model.get("value");if("url"!==n){var r=new Blob([i],{type:"video/"+this.model.get("format")});e=URL.createObjectURL(r)}else e=new TextDecoder("utf-8").decode(i.buffer);var o=this.el.src;this.el.src=e,o&&"string"!=typeof o&&URL.revokeObjectURL(o);var s=this.model.get("width");void 0!==s&&s.length>0?this.el.setAttribute("width",s):this.el.removeAttribute("width");var a=this.model.get("height");return void 0!==a&&a.length>0?this.el.setAttribute("height",a):this.el.removeAttribute("height"),this.el.loop=this.model.get("loop"),this.el.autoplay=this.model.get("autoplay"),this.el.controls=this.model.get("controls"),t.prototype.update.call(this)},e.prototype.remove=function(){this.el.src&&URL.revokeObjectURL(this.el.src),t.prototype.remove.call(this)},Object.defineProperty(e.prototype,"tagName",{get:function(){return"video"},enumerable:!0,configurable:!0}),e}(i.DOMWidgetView),ot=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),st=function(){return(st=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},at=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ot(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"AudioModel",_view_name:"AudioView",format:"mp3",autoplay:!0,loop:!0,controls:!0,value:new DataView(new ArrayBuffer(0))})},e.serializers=st({},v.serializers,{value:{serialize:function(t){return new DataView(t.buffer.slice(0))}}}),e}(v),ut=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ot(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.pWidget.addClass("jupyter-widgets"),this.update()},e.prototype.update=function(){var e,n=this.model.get("format"),i=this.model.get("value");if("url"!==n){var r=new Blob([i],{type:"audio/"+this.model.get("format")});e=URL.createObjectURL(r)}else e=new TextDecoder("utf-8").decode(i.buffer);var o=this.el.src;return this.el.src=e,o&&"string"!=typeof o&&URL.revokeObjectURL(o),this.el.loop=this.model.get("loop"),this.el.autoplay=this.model.get("autoplay"),this.el.controls=this.model.get("controls"),t.prototype.update.call(this)},e.prototype.remove=function(){this.el.src&&URL.revokeObjectURL(this.el.src),t.prototype.remove.call(this)},Object.defineProperty(e.prototype,"tagName",{get:function(){return"audio"},enumerable:!0,configurable:!0}),e}(i.DOMWidgetView),ct=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),dt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ct(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{value:"black",concise:!1,_model_name:"ColorPickerModel",_view_name:"ColorPickerView"})},e}(y),ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ct(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-colorpicker"),this._color_container=document.createElement("div"),this._color_container.className="widget-inline-hbox widget-colorpicker-input",this.el.appendChild(this._color_container),this._textbox=document.createElement("input"),this._textbox.setAttribute("type","text"),this._textbox.id=this.label.htmlFor=Object(i.uuid)(),this._color_container.appendChild(this._textbox),this._textbox.value=this.model.get("value"),this._colorpicker=document.createElement("input"),this._colorpicker.setAttribute("type","color"),this._color_container.appendChild(this._colorpicker),this.listenTo(this.model,"change:value",this._update_value),this.listenTo(this.model,"change:concise",this._update_concise),this._update_concise(),this._update_value(),this.update()},e.prototype.update=function(e){if(void 0===e||e.updated_view!=this){var n=this.model.get("disabled");this._textbox.disabled=n,this._colorpicker.disabled=n}return t.prototype.update.call(this)},e.prototype.events=function(){return this._picker_change,this._text_change,{'change [type="color"]':"_picker_change",'change [type="text"]':"_text_change"}},e.prototype._update_value=function(){var t,e,n=this.model.get("value");this._colorpicker.value=lt[(t=n).toLowerCase()]||(7===(e=t).length?e:"#"+e.charAt(1)+e.charAt(1)+e.charAt(2)+e.charAt(2)+e.charAt(3)+e.charAt(3)),this._textbox.value=n},e.prototype._update_concise=function(){this.model.get("concise")?(this.el.classList.add("concise"),this._textbox.style.display="none"):(this.el.classList.remove("concise"),this._textbox.style.display="")},e.prototype._picker_change=function(){this.model.set("value",this._colorpicker.value),this.touch()},e.prototype._text_change=function(){var t=this._validate_color(this._textbox.value,this.model.get("value"));this.model.set("value",t),this.touch()},e.prototype._validate_color=function(t,e){return t.match(/#[a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?$/)||lt[t.toLowerCase()]?t:e},e}(l),lt={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",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",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",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgreen:"#90ee90",lightgray:"#d3d3d3",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",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",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"};var ft=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),pt=function(){return(pt=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function mt(t){return null===t?null:{year:t.getUTCFullYear(),month:t.getUTCMonth(),date:t.getUTCDate()}}function gt(t){if(null===t)return null;var e=new Date;return e.setUTCFullYear(t.year,t.month,t.date),e.setUTCHours(0,0,0,0),e}var bt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ft(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{value:null,_model_name:"DatePickerModel",_view_name:"DatePickerView"})},e.serializers=pt({},y.serializers,{value:{serialize:mt,deserialize:gt}}),e}(y),vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ft(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-datepicker"),this._datepicker=document.createElement("input"),this._datepicker.setAttribute("type","date"),this._datepicker.id=this.label.htmlFor=Object(i.uuid)(),this.el.appendChild(this._datepicker),this.listenTo(this.model,"change:value",this._update_value),this._update_value(),this.update()},e.prototype.update=function(e){return void 0!==e&&e.updated_view===this||(this._datepicker.disabled=this.model.get("disabled")),t.prototype.update.call(this)},e.prototype.events=function(){return this._picker_change,this._picker_focusout,{'change [type="date"]':"_picker_change",'focusout [type="date"]':"_picker_focusout"}},e.prototype._update_value=function(){var t=this.model.get("value");this._datepicker.valueAsDate=t},e.prototype._picker_change=function(){this._datepicker.validity.badInput||(this.model.set("value",this._datepicker.valueAsDate),this.touch())},e.prototype._picker_focusout=function(){this._datepicker.validity.badInput&&(this.model.set("value",null),this.touch())},e}(l),yt=function(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]},_t=function(t){return(t=yt(Math.abs(t)))?t[1]:NaN},wt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function xt(t){return new Mt(t)}function Mt(t){if(!(e=wt.exec(t)))throw new Error("invalid format: "+t);var e;this.fill=e[1]||" ",this.align=e[2]||">",this.sign=e[3]||"-",this.symbol=e[4]||"",this.zero=!!e[5],this.width=e[6]&&+e[6],this.comma=!!e[7],this.precision=e[8]&&+e[8].slice(1),this.trim=!!e[9],this.type=e[10]||""}xt.prototype=Mt.prototype,Mt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var St,Et,At,Ct=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(r>0){if(!+t[i])break t;r=0}}return r>0?t.slice(0,r)+t.slice(e+1):t},kt=function(t,e){var n=yt(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")},Tt={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return kt(100*t,e)},r:kt,s:function(t,e){var n=yt(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(St=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+yt(t,Math.max(0,e+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},It=function(t){return t},Pt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];Et=function(t){var e,n,i=t.grouping&&t.thousands?(e=t.grouping,n=t.thousands,function(t,i){for(var r=t.length,o=[],s=0,a=e[0],u=0;r>0&&a>0&&(u+a+1>i&&(a=Math.max(1,i-u)),o.push(t.substring(r-=a,r+a)),!((u+=a+1)>i));)a=e[s=(s+1)%e.length];return o.reverse().join(n)}):It,r=t.currency,o=t.decimal,s=t.numerals?function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(t.numerals):It,a=t.percent||"%";function u(t){var e=(t=xt(t)).fill,n=t.align,u=t.sign,c=t.symbol,d=t.zero,h=t.width,l=t.comma,f=t.precision,p=t.trim,m=t.type;"n"===m?(l=!0,m="g"):Tt[m]||(null==f&&(f=12),p=!0,m="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var g="$"===c?r[0]:"#"===c&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",b="$"===c?r[1]:/[%p]/.test(m)?a:"",v=Tt[m],y=/[defgprs%]/.test(m);function _(t){var r,a,c,_=g,w=b;if("c"===m)w=v(t)+w,t="";else{var x=(t=+t)<0;if(t=v(Math.abs(t),f),p&&(t=Ct(t)),x&&0==+t&&(x=!1),_=(x?"("===u?u:"-":"-"===u||"("===u?"":u)+_,w=("s"===m?Pt[8+St/3]:"")+w+(x&&"("===u?")":""),y)for(r=-1,a=t.length;++r<a;)if(48>(c=t.charCodeAt(r))||c>57){w=(46===c?o+t.slice(r+1):t.slice(r))+w,t=t.slice(0,r);break}}l&&!d&&(t=i(t,1/0));var M=_.length+t.length+w.length,S=M<h?new Array(h-M+1).join(e):"";switch(l&&d&&(t=i(S+t,S.length?h-w.length:1/0),S=""),n){case"<":t=_+t+w+S;break;case"=":t=_+S+t+w;break;case"^":t=S.slice(0,M=S.length>>1)+_+t+w+S.slice(M);break;default:t=S+_+t+w}return s(t)}return f=null==f?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),_.toString=function(){return t+""},_}return{format:u,formatPrefix:function(t,e){var n=u(((t=xt(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(_t(e)/3))),r=Math.pow(10,-i),o=Pt[8+i/3];return function(t){return n(r*t)+o}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),At=Et.format,Et.formatPrefix;n(229);var Ot=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Lt=function(){return(Lt=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},jt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"IntModel",value:0})},e}(y),Bt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"BoundedIntModel",max:100,min:0})},e}(jt),Dt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e.prototype.defaults=function(){return Lt({},t.prototype.defaults.call(this),{_model_name:"SliderStyleModel"})},e.styleProperties=Lt({},d.styleProperties,{handle_color:{selector:".ui-slider-handle",attribute:"background-color",default:null}}),e}(d),Rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"IntSliderModel",_view_name:"IntSliderView",step:1,orientation:"horizontal",readout:!0,readout_format:"d",continuous_update:!0,style:null,disabled:!1})},e.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n),this.on("change:readout_format",this.update_readout_format,this),this.update_readout_format()},e.prototype.update_readout_format=function(){this.readout_formatter=At(this.get("readout_format"))},e}(Bt),zt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e}(Rt),Nt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._parse_value=parseInt,e}return Ot(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-slider"),this.el.classList.add("widget-hslider"),(this.$slider=W()("<div />")).slider({slide:this.handleSliderChange.bind(this),stop:this.handleSliderChanged.bind(this)}).addClass("slider"),this.slider_container=document.createElement("div"),this.slider_container.classList.add("slider-container"),this.slider_container.appendChild(this.$slider[0]),this.el.appendChild(this.slider_container),this.readout=document.createElement("div"),this.el.appendChild(this.readout),this.readout.classList.add("widget-readout"),this.readout.contentEditable="true",this.readout.style.display="none",this.update()},e.prototype.update=function(e){if(void 0===e||e.updated_view!==this){var n=this;n.$slider.slider({}),["step","disabled"].forEach(function(t){var e=n.model.get(t);void 0!==e&&n.$slider.slider("option",t,e)}),this.model.get("disabled")?this.readout.contentEditable="false":this.readout.contentEditable="true";var i=this.model.get("max"),r=this.model.get("min");r<=i&&(void 0!==i&&this.$slider.slider("option","max",i),void 0!==r&&this.$slider.slider("option","min",r));var o=this.model.get("orientation");this.$slider.slider("option","orientation",o),"vertical"===o?(this.el.classList.remove("widget-hslider"),this.el.classList.add("widget-vslider"),this.el.classList.remove("widget-inline-hbox"),this.el.classList.add("widget-inline-vbox")):(this.el.classList.remove("widget-vslider"),this.el.classList.add("widget-hslider"),this.el.classList.remove("widget-inline-vbox"),this.el.classList.add("widget-inline-hbox")),this.model.get("readout")?(this.readout.style.display="",this.displayed.then(function(){n.readout_overflow()?n.readout.classList.add("overflow"):n.readout.classList.remove("overflow")})):this.readout.style.display="none"}return t.prototype.update.call(this)},e.prototype.readout_overflow=function(){return this.readout.scrollWidth>this.readout.clientWidth},e.prototype.events=function(){return{slide:"handleSliderChange",slidestop:"handleSliderChanged","blur [contentEditable=true]":"handleTextChange","keydown [contentEditable=true]":"handleKeyDown"}},e.prototype.handleKeyDown=function(t){13===t.keyCode&&(t.preventDefault(),this.handleTextChange())},e.prototype._validate_slide_value=function(t){return Math.floor(t)},e}(l),Wt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._range_regex=/^\s*([+-]?\d+)\s*[-:–]\s*([+-]?\d+)/,e}return Ot(e,t),e.prototype.update=function(e){t.prototype.update.call(this,e),this.$slider.slider("option","range",!0);var n=this.model.get("value");this.$slider.slider("option","values",n.slice()),this.readout.textContent=this.valueToString(n),this.model.get("value")!==n&&(this.model.set("value",n,{updated_view:this}),this.touch())},e.prototype.valueToString=function(t){var e=this.model.readout_formatter;return t.map(function(t){return e(t)}).join(" – ")},e.prototype.stringToValue=function(t){var e=this._range_regex.exec(t);return e?[this._parse_value(e[1]),this._parse_value(e[2])]:null},e.prototype.handleTextChange=function(){var t=this.stringToValue(this.readout.textContent),e=this.model.get("min"),n=this.model.get("max");null===t||isNaN(t[0])||isNaN(t[1])||t[0]>t[1]?this.readout.textContent=this.valueToString(this.model.get("value")):(t=[Math.max(Math.min(t[0],n),e),Math.max(Math.min(t[1],n),e)])[0]!==this.model.get("value")[0]||t[1]!==this.model.get("value")[1]?(this.readout.textContent=this.valueToString(t),this.model.set("value",t,{updated_view:this}),this.touch()):this.readout.textContent=this.valueToString(this.model.get("value"))},e.prototype.handleSliderChange=function(t,e){var n=e.values.map(this._validate_slide_value);this.readout.textContent=this.valueToString(n),this.model.get("continuous_update")&&this.handleSliderChanged(t,e)},e.prototype.handleSliderChanged=function(t,e){var n=e.values.map(this._validate_slide_value);this.model.set("value",n,{updated_view:this}),this.touch()},e}(Nt),qt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e.prototype.update=function(e){t.prototype.update.call(this,e);var n=this.model.get("min"),i=this.model.get("max"),r=this.model.get("value");r>i?r=i:r<n&&(r=n),this.$slider.slider("option","value",r),this.readout.textContent=this.valueToString(r),this.model.get("value")!==r&&(this.model.set("value",r,{updated_view:this}),this.touch())},e.prototype.valueToString=function(t){return(0,this.model.readout_formatter)(t)},e.prototype.stringToValue=function(t){return this._parse_value(t)},e.prototype.handleTextChange=function(){var t=this.stringToValue(this.readout.textContent),e=this.model.get("min"),n=this.model.get("max");isNaN(t)?this.readout.textContent=this.valueToString(this.model.get("value")):(t=Math.max(Math.min(t,n),e))!==this.model.get("value")?(this.readout.textContent=this.valueToString(t),this.model.set("value",t,{updated_view:this}),this.touch()):this.readout.textContent=this.valueToString(this.model.get("value"))},e.prototype.handleSliderChange=function(t,e){var n=this._validate_slide_value(e.value);this.readout.textContent=this.valueToString(n),this.model.get("continuous_update")&&this.handleSliderChanged(t,e)},e.prototype.handleSliderChanged=function(t,e){var n=this._validate_slide_value(e.value);this.model.set("value",n,{updated_view:this}),this.touch()},e}(Nt),Ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"IntTextModel",_view_name:"IntTextView",disabled:!1,continuous_update:!1})},e}(jt),Ft=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"BoundedIntTextModel",_view_name:"IntTextView",disabled:!1,continuous_update:!1,step:1})},e}(Bt),Vt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._parse_value=parseInt,e._default_step="1",e}return Ot(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-text"),this.textbox=document.createElement("input"),this.textbox.type="number",this.textbox.required=!0,this.textbox.id=this.label.htmlFor=Object(i.uuid)(),this.el.appendChild(this.textbox),this.update()},e.prototype.update=function(e){if(void 0===e||e.updated_view!==this){var n=this.model.get("value");this._parse_value(this.textbox.value)!==n&&(this.textbox.value=n.toString()),void 0!==this.model.get("min")&&(this.textbox.min=this.model.get("min")),void 0!==this.model.get("max")&&(this.textbox.max=this.model.get("max")),void 0!==this.model.get("step")&&null!==this.model.get("step")?this.textbox.step=this.model.get("step"):this.textbox.step=this._default_step,this.textbox.disabled=this.model.get("disabled")}return t.prototype.update.call(this)},e.prototype.events=function(){return{"keydown input":"handleKeyDown","keypress input":"handleKeypress","keyup input":"handleKeyUp","input input":"handleChanging","change input":"handleChanged"}},e.prototype.handleKeyDown=function(t){t.stopPropagation()},e.prototype.handleKeypress=function(t){/[e,.\s]/.test(String.fromCharCode(t.keyCode))&&t.preventDefault()},e.prototype.handleKeyUp=function(t){if(!t.altKey&&!t.ctrlKey){var e=t.target,n=e.value;if((n=n.replace(/[e,.\s]/g,"")).length>=1){var i=n.substr(1);n=n[0]+i.replace(/[+-]/g,"")}e.value!=n&&(t.preventDefault(),e.value=n)}},e.prototype.handleChanging=function(t){var e=t.target.value.trim();""===e||["-","-.",".","+.","+"].indexOf(e)>=0||this.model.get("continuous_update")&&this.handleChanged(t)},e.prototype.handleChanged=function(t){var e=t.target,n=this._parse_value(e.value);if(isNaN(n))e.value=this.model.get("value");else{var i=n;void 0!==this.model.get("max")&&(i=Math.min(this.model.get("max"),i)),void 0!==this.model.get("min")&&(i=Math.max(this.model.get("min"),i)),i!==n&&(e.value=i,n=i),n!==this.model.get("value")&&(this.model.set("value",n,{updated_view:this}),this.touch())}},e}(l),Ut=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e.prototype.defaults=function(){return Lt({},t.prototype.defaults.call(this),{_model_name:"ProgressStyleModel"})},e.styleProperties=Lt({},d.styleProperties,{bar_color:{selector:".progress-bar",attribute:"background-color",default:null}}),e}(d),Kt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"IntProgressModel",_view_name:"ProgressView",orientation:"horizontal",bar_style:"",style:null})},e}(Bt),Yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.listenTo(this.model,"change:bar_style",this.update_bar_style),this.pWidget.addClass("jupyter-widgets")},e.prototype.render=function(){t.prototype.render.call(this);var e="horizontal"===this.model.get("orientation")?"widget-hprogress":"widget-vprogress";this.el.classList.add(e),this.progress=document.createElement("div"),this.progress.classList.add("progress"),this.progress.style.position="relative",this.el.appendChild(this.progress),this.bar=document.createElement("div"),this.bar.classList.add("progress-bar"),this.bar.style.position="absolute",this.bar.style.bottom="0px",this.bar.style.left="0px",this.progress.appendChild(this.bar),this.update(),this.set_bar_style()},e.prototype.update=function(){var e=this.model.get("value"),n=this.model.get("max"),i=this.model.get("min"),r=100*(e-i)/(n-i);return"horizontal"===this.model.get("orientation")?(this.el.classList.remove("widget-inline-vbox"),this.el.classList.remove("widget-vprogress"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-hprogress"),this.bar.style.width=r+"%",this.bar.style.height="100%"):(this.el.classList.remove("widget-inline-hbox"),this.el.classList.remove("widget-hprogress"),this.el.classList.add("widget-inline-vbox"),this.el.classList.add("widget-vprogress"),this.bar.style.width="100%",this.bar.style.height=r+"%"),t.prototype.update.call(this)},e.prototype.update_bar_style=function(){this.update_mapped_classes(e.class_map,"bar_style",this.bar)},e.prototype.set_bar_style=function(){this.set_mapped_classes(e.class_map,"bar_style",this.bar)},e.class_map={success:["progress-bar-success"],info:["progress-bar-info"],warning:["progress-bar-warning"],danger:["progress-bar-danger"]},e}(l),Xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"PlayModel",_view_name:"PlayView",_playing:!1,_repeat:!1,show_repeat:!0,interval:100,step:1,disabled:!1})},e.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n)},e.prototype.loop=function(){if(this.get("_playing")){var t=this.get("value")+this.get("step");t<=this.get("max")?(this.set("value",t),this.schedule_next()):this.get("_repeat")?(this.set("value",this.get("min")),this.schedule_next()):this.set("_playing",!1),this.save_changes()}},e.prototype.schedule_next=function(){window.setTimeout(this.loop.bind(this),this.get("interval"))},e.prototype.stop=function(){this.set("_playing",!1),this.set("value",this.get("min")),this.save_changes()},e.prototype.pause=function(){this.set("_playing",!1),this.save_changes()},e.prototype.play=function(){this.set("_playing",!0),this.get("value")==this.get("max")?(this.set("value",this.get("min")),this.schedule_next(),this.save_changes()):this.loop()},e.prototype.repeat=function(){this.set("_repeat",!this.get("_repeat")),this.save_changes()},e}(Bt),$t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-play"),this.playButton=document.createElement("button"),this.pauseButton=document.createElement("button"),this.stopButton=document.createElement("button"),this.repeatButton=document.createElement("button"),this.playButton.className="jupyter-button",this.pauseButton.className="jupyter-button",this.stopButton.className="jupyter-button",this.repeatButton.className="jupyter-button",this.el.appendChild(this.playButton),this.el.appendChild(this.pauseButton),this.el.appendChild(this.stopButton),this.el.appendChild(this.repeatButton);var e=document.createElement("i");e.className="fa fa-play",this.playButton.appendChild(e);var n=document.createElement("i");n.className="fa fa-pause",this.pauseButton.appendChild(n);var i=document.createElement("i");i.className="fa fa-stop",this.stopButton.appendChild(i);var r=document.createElement("i");r.className="fa fa-retweet",this.repeatButton.appendChild(r),this.playButton.onclick=this.model.play.bind(this.model),this.pauseButton.onclick=this.model.pause.bind(this.model),this.stopButton.onclick=this.model.stop.bind(this.model),this.repeatButton.onclick=this.model.repeat.bind(this.model),this.listenTo(this.model,"change:_playing",this.update_playing),this.listenTo(this.model,"change:_repeat",this.update_repeat),this.listenTo(this.model,"change:show_repeat",this.update_repeat),this.update_playing(),this.update_repeat(),this.update()},e.prototype.update=function(){var t=this.model.get("disabled");this.playButton.disabled=t,this.pauseButton.disabled=t,this.stopButton.disabled=t,this.repeatButton.disabled=t,this.update_playing()},e.prototype.update_playing=function(){var t=this.model.get("_playing"),e=this.model.get("disabled");t?(e||(this.pauseButton.disabled=!1),this.playButton.classList.add("mod-active")):(e||(this.pauseButton.disabled=!0),this.playButton.classList.remove("mod-active"))},e.prototype.update_repeat=function(){var t=this.model.get("_repeat");this.repeatButton.style.display=this.model.get("show_repeat")?this.playButton.style.display:"none",t?this.repeatButton.classList.add("mod-active"):this.repeatButton.classList.remove("mod-active")},e}(i.DOMWidgetView),Gt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Jt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Gt(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"FloatModel",value:0})},e}(y),Zt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Gt(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"BoundedFloatModel",max:100,min:0})},e}(Jt),Qt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Gt(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"FloatSliderModel",_view_name:"FloatSliderView",step:1,orientation:"horizontal",_range:!1,readout:!0,readout_format:".2f",slider_color:null,continuous_update:!0,disabled:!1})},e.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n),this.on("change:readout_format",this.update_readout_format,this),this.update_readout_format()},e.prototype.update_readout_format=function(){this.readout_formatter=At(this.get("readout_format"))},e}(Zt),te=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Gt(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"FloatLogSliderModel",_view_name:"FloatLogSliderView",step:.1,orientation:"horizontal",_range:!1,readout:!0,readout_format:".3g",slider_color:null,continuous_update:!0,disabled:!1,base:10,value:1,min:0,max:4})},e.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n),this.on("change:readout_format",this.update_readout_format,this),this.update_readout_format()},e.prototype.update_readout_format=function(){this.readout_formatter=At(this.get("readout_format"))},e}(Zt),ee=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Gt(e,t),e}(Qt),ne=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._parse_value=parseFloat,e}return Gt(e,t),e.prototype._validate_slide_value=function(t){return t},e}(qt),ie=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._parse_value=parseFloat,e}return Gt(e,t),e.prototype.update=function(e){t.prototype.update.call(this,e);var n=this.model.get("min"),i=this.model.get("max"),r=this.model.get("value"),o=this.model.get("base"),s=Math.log(r)/Math.log(o);s>i?s=i:s<n&&(s=n),this.$slider.slider("option","value",s),this.readout.textContent=this.valueToString(r),this.model.get("value")!==r&&(this.model.set("value",r,{updated_view:this}),this.touch())},e.prototype.valueToString=function(t){return(0,this.model.readout_formatter)(t)},e.prototype.stringToValue=function(t){return this._parse_value(t)},e.prototype.handleTextChange=function(){var t=this.stringToValue(this.readout.textContent),e=this.model.get("min"),n=this.model.get("max"),i=this.model.get("base");isNaN(t)?this.readout.textContent=this.valueToString(this.model.get("value")):(t=Math.max(Math.min(t,Math.pow(i,n)),Math.pow(i,e)))!==this.model.get("value")?(this.readout.textContent=this.valueToString(t),this.model.set("value",t,{updated_view:this}),this.touch()):this.readout.textContent=this.valueToString(this.model.get("value"))},e.prototype.handleSliderChange=function(t,e){var n=this.model.get("base"),i=Math.pow(n,this._validate_slide_value(e.value));this.readout.textContent=this.valueToString(i),this.model.get("continuous_update")&&this.handleSliderChanged(t,e)},e.prototype.handleSliderChanged=function(t,e){var n=this.model.get("base"),i=Math.pow(n,this._validate_slide_value(e.value));this.model.set("value",i,{updated_view:this}),this.touch()},e.prototype._validate_slide_value=function(t){return t},e}(Nt),re=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._parse_value=parseFloat,e._range_regex=/^\s*([+-]?(?:\d*\.?\d+|\d+\.)(?:[eE][-:]?\d+)?)\s*[-:–]\s*([+-]?(?:\d*\.?\d+|\d+\.)(?:[eE][+-]?\d+)?)/,e}return Gt(e,t),e.prototype._validate_slide_value=function(t){return t},e}(Wt),oe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Gt(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"FloatTextModel",_view_name:"FloatTextView",disabled:!1,continuous_update:!1})},e}(Jt),se=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Gt(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"BoundedFloatTextModel",_view_name:"FloatTextView",disabled:!1,continuous_update:!1,step:.1})},e}(Zt),ae=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._parse_value=parseFloat,e._default_step="any",e}return Gt(e,t),e.prototype.handleKeypress=function(t){t.stopPropagation()},e.prototype.handleKeyUp=function(t){},e}(Vt),ue=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Gt(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"FloatProgressModel",_view_name:"ProgressView",orientation:"horizontal",bar_style:"",style:null})},e}(Zt),ce=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),de=function(){return(de=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},he=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ce(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"ControllerButtonModel",_view_name:"ControllerButtonView",value:0,pressed:!1})},e}(v),le=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ce(e,t),e.prototype.render=function(){this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-controller-button"),this.el.style.width="fit-content",this.support=document.createElement("div"),this.support.style.position="relative",this.support.style.margin="1px",this.support.style.width="16px",this.support.style.height="16px",this.support.style.border="1px solid black",this.support.style.background="lightgray",this.el.appendChild(this.support),this.bar=document.createElement("div"),this.bar.style.position="absolute",this.bar.style.width="100%",this.bar.style.bottom="0px",this.bar.style.background="gray",this.support.appendChild(this.bar),this.update(),this.label=document.createElement("div"),this.label.textContent=this.model.get("description"),this.label.style.textAlign="center",this.el.appendChild(this.label)},e.prototype.update=function(){this.bar.style.height=100*this.model.get("value")+"%"},e}(i.DOMWidgetView),fe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ce(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"ControllerAxisModel",_view_name:"ControllerAxisView",value:0})},e}(v),pe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ce(e,t),e.prototype.render=function(){this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-controller-axis"),this.el.style.width="16px",this.el.style.padding="4px",this.support=document.createElement("div"),this.support.style.position="relative",this.support.style.margin="1px",this.support.style.width="4px",this.support.style.height="64px",this.support.style.border="1px solid black",this.support.style.background="lightgray",this.bullet=document.createElement("div"),this.bullet.style.position="absolute",this.bullet.style.margin="-3px",this.bullet.style.boxSizing="unset",this.bullet.style.width="10px",this.bullet.style.height="10px",this.bullet.style.background="gray",this.label=document.createElement("div"),this.label.textContent=this.model.get("description"),this.label.style.textAlign="center",this.support.appendChild(this.bullet),this.el.appendChild(this.support),this.el.appendChild(this.label),this.update()},e.prototype.update=function(){this.bullet.style.top=50*(this.model.get("value")+1)+"%"},e}(i.DOMWidgetView),me=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ce(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"ControllerModel",_view_name:"ControllerView",index:0,name:"",mapping:"",connected:!1,timestamp:0,buttons:[],axes:[]})},e.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n),void 0===navigator.getGamepads?(this.readout="This browser does not support gamepads.",console.error(this.readout)):(this.readout="Connect gamepad and press any button.",this.get("connected")?this.update_loop():this.wait_loop())},e.prototype.wait_loop=function(){var t=this.get("index"),e=navigator.getGamepads()[t];if(e){var n=this;this.setup(e).then(function(t){n.set(t),n.save_changes(),window.requestAnimationFrame(n.update_loop.bind(n))})}else window.requestAnimationFrame(this.wait_loop.bind(this))},e.prototype.setup=function(t){this.set({name:t.id,mapping:t.mapping,connected:t.connected,timestamp:t.timestamp});var e=this;return i.resolvePromisesDict({buttons:Promise.all(t.buttons.map(function(t,n){return e._create_button_model(n)})),axes:Promise.all(t.axes.map(function(t,n){return e._create_axis_model(n)}))})},e.prototype.update_loop=function(){var t=this.get("index"),e=this.get("name"),n=navigator.getGamepads()[t];n&&t===n.index&&e===n.id?(this.set({timestamp:n.timestamp,connected:n.connected}),this.save_changes(),this.get("buttons").forEach(function(t,e){t.set({value:n.buttons[e].value,pressed:n.buttons[e].pressed}),t.save_changes()}),this.get("axes").forEach(function(t,e){t.set("value",n.axes[e]),t.save_changes()}),window.requestAnimationFrame(this.update_loop.bind(this))):this.reset_gamepad()},e.prototype.reset_gamepad=function(){this.get("buttons").forEach(function(t){t.close()}),this.get("axes").forEach(function(t){t.close()}),this.set({name:"",mapping:"",connected:!1,timestamp:0,buttons:[],axes:[]}),this.save_changes(),window.requestAnimationFrame(this.wait_loop.bind(this))},e.prototype._create_button_model=function(t){return this.widget_manager.new_widget({model_name:"ControllerButtonModel",model_module:"@jupyter-widgets/controls",model_module_version:this.get("_model_module_version"),view_name:"ControllerButtonView",view_module:"@jupyter-widgets/controls",view_module_version:this.get("_view_module_version")}).then(function(e){return e.set("description",t),e})},e.prototype._create_axis_model=function(t){return this.widget_manager.new_widget({model_name:"ControllerAxisModel",model_module:"@jupyter-widgets/controls",model_module_version:this.get("_model_module_version"),view_name:"ControllerAxisView",view_module:"@jupyter-widgets/controls",view_module_version:this.get("_view_module_version")}).then(function(e){return e.set("description",t),e})},e.serializers=de({},v.serializers,{buttons:{deserialize:i.unpack_models},axes:{deserialize:i.unpack_models}}),e}(v),ge=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ce(e,t),e.prototype._createElement=function(t){return this.pWidget=new i.JupyterPhosphorPanelWidget({view:this}),this.pWidget.node},e.prototype._setElement=function(t){if(this.el||t!==this.pWidget.node)throw new Error("Cannot reset the DOM element.");this.el=this.pWidget.node,this.$el=W()(this.pWidget.node)},e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.button_views=new i.ViewList(this.add_button,null,this),this.listenTo(this.model,"change:buttons",function(t,e){this.button_views.update(e)}),this.axis_views=new i.ViewList(this.add_axis,null,this),this.listenTo(this.model,"change:axes",function(t,e){this.axis_views.update(e)}),this.listenTo(this.model,"change:name",this.update_label)},e.prototype.render=function(){this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-controller"),this.label=document.createElement("div"),this.el.appendChild(this.label),this.axis_box=new z.Panel,this.axis_box.node.style.display="flex",this.pWidget.addWidget(this.axis_box),this.button_box=new z.Panel,this.button_box.node.style.display="flex",this.pWidget.addWidget(this.button_box),this.button_views.update(this.model.get("buttons")),this.axis_views.update(this.model.get("axes")),this.update_label()},e.prototype.update_label=function(){this.label.textContent=this.model.get("name")||this.model.readout},e.prototype.add_button=function(t){var e=this,n=new z.Widget;return this.button_box.addWidget(n),this.create_child_view(t).then(function(t){var i=D.ArrayExt.firstIndexOf(e.button_box.widgets,n);return e.button_box.insertWidget(i,t.pWidget),n.dispose(),t}).catch(r("Could not add child button view to controller",!0))},e.prototype.add_axis=function(t){var e=this,n=new z.Widget;return this.axis_box.addWidget(n),this.create_child_view(t).then(function(t){var i=D.ArrayExt.firstIndexOf(e.axis_box.widgets,n);return e.axis_box.insertWidget(i,t.pWidget),n.dispose(),t}).catch(r("Could not add child axis view to controller",!0))},e.prototype.remove=function(){t.prototype.remove.call(this),this.button_views.remove(),this.axis_views.remove()},e}(i.DOMWidgetView),be=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ve=function(){return(ve=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ye=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.defaults=function(){return ve({},t.prototype.defaults.call(this),{_model_name:"SelectionModel",index:"",_options_labels:[],disabled:!1})},e}(y),_e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.defaults=function(){return ve({},t.prototype.defaults.call(this),{_model_name:"DropdownModel",_view_name:"DropdownView",button_style:""})},e}(ye),we=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.initialize=function(e){var n=this;t.prototype.initialize.call(this,e),this.listenTo(this.model,"change:_options_labels",function(){return n._updateOptions()})},e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-dropdown"),this.listbox=document.createElement("select"),this.listbox.id=this.label.htmlFor=Object(i.uuid)(),this.el.appendChild(this.listbox),this._updateOptions(),this.update()},e.prototype.update=function(){this.listbox.disabled=this.model.get("disabled");var e=this.model.get("index");return this.listbox.selectedIndex=null===e?-1:e,t.prototype.update.call(this)},e.prototype._updateOptions=function(){this.listbox.textContent="";for(var t=this.model.get("_options_labels"),e=0;e<t.length;e++){var n=t[e],i=document.createElement("option");i.textContent=n.replace(/ /g," "),i.setAttribute("data-value",encodeURIComponent(n)),i.value=n,this.listbox.appendChild(i)}},e.prototype.events=function(){return{"change select":"_handle_change"}},e.prototype._handle_change=function(){this.model.set("index",-1===this.listbox.selectedIndex?null:this.listbox.selectedIndex),this.touch()},e}(l),xe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.defaults=function(){return ve({},t.prototype.defaults.call(this),{_model_name:"SelectModel",_view_name:"SelectView",rows:5})},e}(ye),Me=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.initialize=function(e){var n=this;t.prototype.initialize.call(this,e),this.listenTo(this.model,"change:_options_labels",function(){return n._updateOptions()}),this.listenTo(this.model,"change:index",function(t,e,i){return n.updateSelection(i)}),this.listbox=document.createElement("select")},e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-select"),this.listbox.id=this.label.htmlFor=Object(i.uuid)(),this.el.appendChild(this.listbox),this._updateOptions(),this.update(),this.updateSelection()},e.prototype.update=function(){t.prototype.update.call(this),this.listbox.disabled=this.model.get("disabled");var e=this.model.get("rows");null===e&&(e=""),this.listbox.setAttribute("size",e)},e.prototype.updateSelection=function(t){if(void 0===t&&(t={}),t.updated_view!==this){var e=this.model.get("index");this.listbox.selectedIndex=null===e?-1:e}},e.prototype._updateOptions=function(){this.listbox.textContent="";for(var t=this.model.get("_options_labels"),e=0;e<t.length;e++){var n=t[e],i=document.createElement("option");i.textContent=n.replace(/ /g," "),i.setAttribute("data-value",encodeURIComponent(n)),i.value=n,this.listbox.appendChild(i)}},e.prototype.events=function(){return{"change select":"_handle_change"}},e.prototype._handle_change=function(){this.model.set("index",this.listbox.selectedIndex,{updated_view:this}),this.touch()},e}(l),Se=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.defaults=function(){return ve({},t.prototype.defaults.call(this),{_model_name:"RadioButtonsModel",_view_name:"RadioButtonsView",tooltips:[],icons:[],button_style:""})},e}(ye),Ee=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-radio"),this.container=document.createElement("div"),this.el.appendChild(this.container),this.container.classList.add("widget-radio-box"),this.update()},e.prototype.update=function(e){var n=this,i=this.model.get("_options_labels"),r=m.pluck(this.container.querySelectorAll('input[type="radio"]'),"value"),o=i.length!=r.length;if(!o)for(var s=0,a=i.length;s<a;++s)if(r[s]!==i[s]){o=!0;break}return!o||void 0!==e&&e.updated_view===this||(this.container.textContent="",i.forEach(function(t,e){var i=document.createElement("label");i.textContent=t,n.container.appendChild(i);var r=document.createElement("input");r.setAttribute("type","radio"),r.value=e.toString(),r.setAttribute("data-value",encodeURIComponent(t)),i.appendChild(r)})),i.forEach(function(t,e){var i='input[data-value="'+encodeURIComponent(t)+'"]',r=n.container.querySelectorAll(i);if(r.length>0){var o=r[0];o.checked=n.model.get("index")===e,o.disabled=n.model.get("disabled")}}),setTimeout(this.adjustPadding,0,this),t.prototype.update.call(this,e)},e.prototype.adjustPadding=function(t){var e=window.getComputedStyle(t.el),n=parseInt(e.marginTop,10)+parseInt(e.marginBottom,10),i=t.label.offsetHeight+n,r=window.getComputedStyle(t.container),o=parseInt(r.marginBottom),s=(t.el.offsetHeight+n-o)%i,a=0==s?0:i-s;t.container.style.marginBottom=a+"px"},e.prototype.events=function(){return{'click input[type="radio"]':"_handle_click"}},e.prototype._handle_click=function(t){var e=t.target;this.model.set("index",parseInt(e.value),{updated_view:this}),this.touch()},e}(l),Ae=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"ToggleButtonsStyleModel"})},e.styleProperties=ve({},d.styleProperties,{button_width:{selector:".widget-toggle-button",attribute:"width",default:null},font_weight:{selector:".widget-toggle-button",attribute:"font-weight",default:""}}),e}(d),Ce=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.defaults=function(){return ve({},t.prototype.defaults.call(this),{_model_name:"ToggleButtonsModel",_view_name:"ToggleButtonsView"})},e}(ye),ke=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.initialize=function(e){this._css_state={},t.prototype.initialize.call(this,e),this.listenTo(this.model,"change:button_style",this.update_button_style)},e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-toggle-buttons"),this.buttongroup=document.createElement("div"),this.el.appendChild(this.buttongroup),this.update(),this.set_button_style()},e.prototype.update=function(n){for(var i=this,r=this.model.get("_options_labels"),o=this.model.get("icons")||[],a=this.model.previous("icons")||[],u=e.classMap[this.model.previous("button_style")]||"",c=i.model.get("tooltips")||[],d=this.model.get("disabled"),h=this.buttongroup.querySelectorAll("button"),l=m.pluck(h,"value"),f=!1,p=0,g=r.length;p<g;++p)if(l[p]!==r[p]||o[p]!==a[p]){f=!0;break}return!f||void 0!==n&&n.updated_view===this||(this.buttongroup.textContent="",r.forEach(function(t,e){var n;n=0===t.trim().length&&(!o[e]||0===o[e].trim().length)?" ":s(t);var r=document.createElement("i"),a=document.createElement("button");o[e]&&(r.className="fa fa-"+o[e]),a.setAttribute("type","button"),a.className="widget-toggle-button jupyter-button",u&&a.classList.add(u),a.innerHTML=n,a.setAttribute("data-value",encodeURIComponent(t)),a.setAttribute("value",e.toString()),a.appendChild(r),a.disabled=d,c[e]&&a.setAttribute("title",c[e]),i.update_style_traits(a),i.buttongroup.appendChild(a)})),r.forEach(function(t,e){var n='[data-value="'+encodeURIComponent(t)+'"]',r=i.buttongroup.querySelector(n);i.model.get("index")===e?r.classList.add("mod-active"):r.classList.remove("mod-active")}),this.stylePromise.then(function(t){t&&t.style()}),t.prototype.update.call(this,n)},e.prototype.update_style_traits=function(t){for(var e in this._css_state)if(this._css_state.hasOwnProperty(e))if("margin"===e)this.buttongroup.style[e]=this._css_state[e];else if("width"!==e)if(t)t.style[e]=this._css_state[e];else{var n=this.buttongroup.querySelectorAll("button");n.length&&(n[0].style[e]=this._css_state[e])}},e.prototype.update_button_style=function(){for(var t=this.buttongroup.querySelectorAll("button"),n=0;n<t.length;n++)this.update_mapped_classes(e.classMap,"button_style",t[n])},e.prototype.set_button_style=function(){for(var t=this.buttongroup.querySelectorAll("button"),n=0;n<t.length;n++)this.set_mapped_classes(e.classMap,"button_style",t[n])},e.prototype.events=function(){return{"click button":"_handle_click"}},e.prototype._handle_click=function(t){var e=t.target;this.model.set("index",parseInt(e.value,10),{updated_view:this}),this.touch(),this.send({event:"click"})},e}(l);(ke||(ke={})).classMap={primary:["mod-primary"],success:["mod-success"],info:["mod-info"],warning:["mod-warning"],danger:["mod-danger"]};var Te=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.defaults=function(){return ve({},t.prototype.defaults.call(this),{_model_name:"SelectionSliderModel",_view_name:"SelectionSliderView",orientation:"horizontal",readout:!0,continuous_update:!0})},e}(ye),Ie=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.render=function(){var e=this;t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-hslider"),this.el.classList.add("widget-slider"),(this.$slider=W()("<div />")).slider({slide:this.handleSliderChange.bind(this),stop:this.handleSliderChanged.bind(this)}).addClass("slider"),this.slider_container=document.createElement("div"),this.slider_container.classList.add("slider-container"),this.slider_container.appendChild(this.$slider[0]),this.el.appendChild(this.slider_container),this.readout=document.createElement("div"),this.el.appendChild(this.readout),this.readout.classList.add("widget-readout"),this.readout.style.display="none",this.listenTo(this.model,"change:slider_color",function(t,n){e.$slider.find("a").css("background",n)}),this.$slider.find("a").css("background",this.model.get("slider_color")),this.update()},e.prototype.update=function(e){if(void 0===e||e.updated_view!==this){var n=this.model.get("_options_labels").length-1;this.$slider.slider("option","step",1),this.$slider.slider("option","max",n),this.$slider.slider("option","min",0);var i=this.model.get("orientation");this.$slider.slider("option","value",0),this.$slider.slider("option","orientation",i);var r=this.model.get("disabled");this.$slider.slider("option","disabled",r),this.readout.contentEditable=r?"false":"true","vertical"===i?(this.el.classList.remove("widget-hslider"),this.el.classList.remove("widget-inline-hbox"),this.el.classList.add("widget-vslider"),this.el.classList.add("widget-inline-vbox")):(this.el.classList.remove("widget-vslider"),this.el.classList.remove("widget-inline-vbox"),this.el.classList.add("widget-hslider"),this.el.classList.add("widget-inline-hbox"));var o=this.model.get("readout");this.readout.style.display=o?"":"none",this.updateSelection()}return t.prototype.update.call(this,e)},e.prototype.events=function(){return{slide:"handleSliderChange",slidestop:"handleSliderChanged"}},e.prototype.updateSelection=function(){var t=this.model.get("index");this.$slider.slider("option","value",t),this.updateReadout(t)},e.prototype.updateReadout=function(t){var e=this.model.get("_options_labels")[t];this.readout.textContent=e},e.prototype.handleSliderChange=function(t,e){this.updateReadout(e.value),this.model.get("continuous_update")&&this.handleSliderChanged(t,e)},e.prototype.handleSliderChanged=function(t,e){this.updateReadout(e.value),this.model.set("index",e.value,{updated_view:this}),this.touch()},e}(l),Pe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.defaults=function(){return ve({},t.prototype.defaults.call(this),{_model_name:"MultipleSelectionModel"})},e}(ye),Oe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.defaults=function(){return ve({},t.prototype.defaults.call(this),{_model_name:"SelectMultipleModel",_view_name:"SelectMultipleView",rows:null})},e}(Pe),Le=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.listbox.multiple=!0},e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("widget-select-multiple")},e.prototype.updateSelection=function(t){if(void 0===t&&(t={}),t.updated_view!==this){var e=this.model.get("index")||[],n=this.listbox.options;this.listbox.selectedIndex=-1,e.forEach(function(t){n[t].selected=!0})}},e.prototype._handle_change=function(){var t=Array.prototype.map.call(this.listbox.selectedOptions||[],function(t){return t.index});this.model.set("index",t,{updated_view:this}),this.touch()},e}(Me),je=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.defaults=function(){return ve({},t.prototype.defaults.call(this),{_model_name:"SelectionSliderModel",_view_name:"SelectionSliderView",orientation:"horizontal",readout:!0,continuous_update:!0})},e}(Pe),Be=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.$slider.slider("option","range",!0)},e.prototype.updateSelection=function(){var t=this.model.get("index");this.$slider.slider("option","values",t.slice()),this.updateReadout(t)},e.prototype.updateReadout=function(t){var e=this.model.get("_options_labels"),n=e[t[0]],i=e[t[1]];this.readout.textContent=n+"-"+i},e.prototype.handleSliderChange=function(t,e){this.updateReadout(e.values),this.model.get("continuous_update")&&this.handleSliderChanged(t,e)},e.prototype.handleSliderChanged=function(t,e){this.updateReadout(e.values),this.model.set("index",e.values.slice(),{updated_view:this}),this.touch()},e}(Ie),De=n(8),Re=n(9),ze=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ne=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._widgetRemoved=new De.Signal(e),e}return ze(e,t),Object.defineProperty(e.prototype,"widgetRemoved",{get:function(){return this._widgetRemoved},enumerable:!0,configurable:!0}),e.prototype.onChildRemoved=function(t){this._widgetRemoved.emit(t.child)},e}(z.Panel),We=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;n._currentChanged=new De.Signal(n),n.addClass("p-TabPanel"),n.tabBar=new z.TabBar(e),n.tabBar.addClass("p-TabPanel-tabBar"),n.tabContents=new Ne,n.tabContents.addClass("p-TabPanel-tabContents"),n.tabBar.tabMoved.connect(n._onTabMoved,n),n.tabBar.currentChanged.connect(n._onCurrentChanged,n),n.tabBar.tabCloseRequested.connect(n._onTabCloseRequested,n),n.tabBar.tabActivateRequested.connect(n._onTabActivateRequested,n),n.tabContents.widgetRemoved.connect(n._onWidgetRemoved,n);var i=new z.PanelLayout;return i.addWidget(n.tabBar),i.addWidget(n.tabContents),n.layout=i,n}return ze(e,t),Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){var t=this.tabBar.currentIndex;return-1===t?null:t},set:function(t){this.tabBar.currentIndex=null===t?-1:t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentWidget",{get:function(){var t=this.tabBar.currentTitle;return t?t.owner:null},set:function(t){this.tabBar.currentTitle=t?t.title:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this.tabBar.tabsMovable},set:function(t){this.tabBar.tabsMovable=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgets",{get:function(){return this.tabContents.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(t){this.insertWidget(this.widgets.length,t)},e.prototype.insertWidget=function(t,e){e!==this.currentWidget&&e.hide(),this.tabContents.insertWidget(t,e),this.tabBar.insertTab(t,e.title)},e.prototype._onCurrentChanged=function(t,e){var n=e.previousIndex,i=e.previousTitle,r=e.currentIndex,o=e.currentTitle,s=i?i.owner:null,a=o?o.owner:null;s&&s.hide(),a&&a.show(),this._currentChanged.emit({previousIndex:n,previousWidget:s,currentIndex:r,currentWidget:a}),(Re.Platform.IS_EDGE||Re.Platform.IS_IE)&&R.MessageLoop.flush()},e.prototype._onTabActivateRequested=function(t,e){e.title.owner.activate()},e.prototype._onTabCloseRequested=function(t,e){e.title.owner.close()},e.prototype._onTabMoved=function(t,e){this.tabContents.insertWidget(e.toIndex,e.title.owner)},e.prototype._onWidgetRemoved=function(t,e){this.tabBar.removeTab(e.title)},e}(z.Widget),qe=function(){function t(t,e){void 0===e&&(e={}),this._array=null,this._value=null,this._previousValue=null,this._selectionChanged=new De.Signal(this),this._array=t,this._insertBehavior=e.insertBehavior||"select-item-if-needed",this._removeBehavior=e.removeBehavior||"select-item-after"}return Object.defineProperty(t.prototype,"selectionChanged",{get:function(){return this._selectionChanged},enumerable:!0,configurable:!0}),t.prototype.adjustSelectionForSet=function(t){var e=this.index,n=this.value;if(t===e){this._updateSelectedValue();var i=this.value;this._previousValue=null,n!==i&&this._selectionChanged.emit({previousIndex:e,previousValue:n,currentIndex:e,currentValue:i})}},Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this.index=null===t?null:D.ArrayExt.firstIndexOf(this._array,t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"index",{get:function(){return this._index},set:function(t){var e;if(null!==t?((e=Math.floor(t))<0||e>=this._array.length)&&(e=null):e=null,this._index!==e){var n=this._index,i=this._value;this._index=e,this._updateSelectedValue(),this._previousValue=i,this._selectionChanged.emit({previousIndex:n,previousValue:i,currentIndex:e,currentValue:this._value})}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"insertBehavior",{get:function(){return this._insertBehavior},set:function(t){this._insertBehavior=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"removeBehavior",{get:function(){return this._removeBehavior},set:function(t){this._removeBehavior=t},enumerable:!0,configurable:!0}),t.prototype.adjustSelectionForInsert=function(t,e){var n=this._value,i=this._index,r=this._insertBehavior;if("select-item"===r||"select-item-if-needed"===r&&null===i)return this._index=t,this._value=e,this._previousValue=n,void this._selectionChanged.emit({previousIndex:i,previousValue:n,currentIndex:t,currentValue:e});i>=t&&this._index++},t.prototype.adjustSelectionForMove=function(t,e){this._index===t?this._index=e:this._index<t&&this._index>=e?this._index++:this._index>t&&this._index<=e&&this._index--},t.prototype.clearSelection=function(){var t=this._index,e=this._value;this._index=null,this._value=null,this._previousValue=null,null!==t&&this._selectionChanged.emit({previousIndex:t,previousValue:e,currentIndex:this._index,currentValue:this._value})},t.prototype.adjustSelectionForRemove=function(t,e){var n=this._index,i=this._removeBehavior;if(n===t){if(0===this._array.length)return this._index=null,this._value=null,this._previousValue=null,void this._selectionChanged.emit({previousIndex:t,previousValue:e,currentIndex:this._index,currentValue:this._value});if("select-item-after"===i)return this._index=Math.min(t,this._array.length-1),this._updateSelectedValue(),this._previousValue=null,void this._selectionChanged.emit({previousIndex:t,previousValue:e,currentIndex:this._index,currentValue:this._value});if("select-item-before"===i)return this._index=Math.max(0,t-1),this._updateSelectedValue(),this._previousValue=null,void this._selectionChanged.emit({previousIndex:t,previousValue:e,currentIndex:this._index,currentValue:this._value});if("select-previous-item"===i)return this._previousValue?this.value=this._previousValue:(this._index=Math.min(t,this._array.length-1),this._updateSelectedValue()),this._previousValue=null,void this._selectionChanged.emit({previousIndex:t,previousValue:e,currentIndex:this._index,currentValue:this.value});this._index=null,this._value=null,this._previousValue=null,this._selectionChanged.emit({previousIndex:t,previousValue:e,currentIndex:this._index,currentValue:this._value})}else n>t&&this._index--},t.prototype._updateSelectedValue=function(){var t=this._index;this._value=null!==t?this._array[t]:null},t}(),He=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Fe="p-Collapse",Ve="p-Collapse-header",Ue="p-Collapse-contents",Ke=function(t){function e(e){var n=t.call(this,e)||this;n._collapseChanged=new De.Signal(n),n.addClass(Fe),n._header=new z.Widget,n._header.addClass(Ve),n._header.node.addEventListener("click",n),n._content=new z.Panel,n._content.addClass(Ue);var i=new z.PanelLayout;return n.layout=i,i.addWidget(n._header),i.addWidget(n._content),e.widget&&(n.widget=e.widget),n.collapsed=!1,n}return He(e,t),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._header=null,this._widget=null,this._content=null)},Object.defineProperty(e.prototype,"widget",{get:function(){return this._widget},set:function(t){var e=this._widget;e&&(e.disposed.disconnect(this._onChildDisposed,this),e.title.changed.disconnect(this._onTitleChanged,this),e.parent=null),this._widget=t,t.disposed.connect(this._onChildDisposed,this),t.title.changed.connect(this._onTitleChanged,this),this._onTitleChanged(t.title),this._content.addWidget(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"collapsed",{get:function(){return this._collapsed},set:function(t){t!==this._collapsed&&(t?this._collapse():this._uncollapse())},enumerable:!0,configurable:!0}),e.prototype.toggle=function(){this.collapsed=!this.collapsed},Object.defineProperty(e.prototype,"collapseChanged",{get:function(){return this._collapseChanged},enumerable:!0,configurable:!0}),e.prototype._collapse=function(){this._collapsed=!0,this._content&&this._content.hide(),this.removeClass("p-Collapse-open"),this._collapseChanged.emit(void 0)},e.prototype._uncollapse=function(){this._collapsed=!1,this._content&&this._content.show(),this.addClass("p-Collapse-open"),this._collapseChanged.emit(void 0)},e.prototype.handleEvent=function(t){switch(t.type){case"click":this._evtClick(t)}},e.prototype._evtClick=function(t){this.toggle()},e.prototype._onTitleChanged=function(t){this._header.node.textContent=this._widget.title.label},e.prototype._onChildDisposed=function(t){this.dispose()},e}(z.Widget),Ye="p-Accordion",Xe=function(t){function e(e){var n=t.call(this,e)||this;return n._selection=new qe(n.widgets),n._selection.selectionChanged.connect(n._onSelectionChanged,n),n.addClass(Ye),n}return He(e,t),Object.defineProperty(e.prototype,"collapseWidgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){return this._selection},enumerable:!0,configurable:!0}),e.prototype.indexOf=function(t){return D.ArrayExt.findFirstIndex(this.collapseWidgets,function(e){return e.widget===t})},e.prototype.addWidget=function(e){var n=this._wrapWidget(e);return n.collapsed=!0,t.prototype.addWidget.call(this,n),this._selection.adjustSelectionForInsert(this.widgets.length-1,n),n},e.prototype.insertWidget=function(e,n){var i=this._wrapWidget(n);i.collapsed=!0,t.prototype.insertWidget.call(this,e,i),this._selection.adjustSelectionForInsert(e,i)},e.prototype.removeWidget=function(t){var e=this.indexOf(t);if(e>=0){var n=this.collapseWidgets[e];t.parent=null,n.dispose(),this._selection.adjustSelectionForRemove(e,null)}},e.prototype._wrapWidget=function(t){var e=new Ke({widget:t});return e.addClass("p-Accordion-child"),e.collapseChanged.connect(this._onCollapseChange,this),e},e.prototype._onCollapseChange=function(t){t.collapsed?this._selection.value===t&&t.collapsed&&(this._selection.value=null):this._selection.value=t},e.prototype._onSelectionChanged=function(t,e){var n=e.previousValue,i=e.currentValue;n&&(n.collapsed=!0,n.removeClass("p-Accordion-child-active")),i&&(i.collapsed=!1,i.addClass("p-Accordion-child-active"))},e}(z.Panel),$e=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ge=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $e(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"SelectionContainerModel",selected_index:0,_titles:{}})},e}(F),Je=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $e(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"AccordionModel",_view_name:"AccordionView"})},e}(Ge),Ze=function(t){function e(e){var n=this,i=e.view;return delete e.view,(n=t.call(this,e)||this)._view=i,n}return $e(e,t),e.prototype.processMessage=function(e){t.prototype.processMessage.call(this,e),this._view.processPhosphorMessage(e)},e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._view&&this._view.remove(),this._view=null)},e}(Xe),Qe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $e(e,t),e.prototype._createElement=function(t){return this.pWidget=new Ze({view:this}),this.pWidget.node},e.prototype._setElement=function(t){if(this.el||t!==this.pWidget.node)throw new Error("Cannot reset the DOM element.");this.el=this.pWidget.node,this.$el=W()(this.pWidget.node)},e.prototype.initialize=function(e){var n=this;t.prototype.initialize.call(this,e),this.children_views=new i.ViewList(this.add_child_view,this.remove_child_view,this),this.listenTo(this.model,"change:children",function(){return n.updateChildren()}),this.listenTo(this.model,"change:selected_index",function(){return n.update_selected_index()}),this.listenTo(this.model,"change:_titles",function(){return n.update_titles()})},e.prototype.render=function(){var e=this;t.prototype.render.call(this);var n=this.pWidget;n.addClass("jupyter-widgets"),n.addClass("widget-accordion"),n.addClass("widget-container"),n.selection.selectionChanged.connect(function(t){e.updatingChildren||(e.model.set("selected_index",n.selection.index),e.touch())}),this.children_views.update(this.model.get("children")),this.update_titles(),this.update_selected_index()},e.prototype.updateChildren=function(){this.updatingChildren=!0,this.pWidget.selection.index=null,this.children_views.update(this.model.get("children")),this.update_selected_index(),this.updatingChildren=!1},e.prototype.update_titles=function(){for(var t=this.pWidget.collapseWidgets,e=this.model.get("_titles"),n=0;n<t.length;n++)void 0!==e[n]&&(t[n].widget.title.label=e[n])},e.prototype.update_selected_index=function(){this.pWidget.selection.index=this.model.get("selected_index")},e.prototype.remove_child_view=function(t){this.pWidget.removeWidget(t.pWidget),t.remove()},e.prototype.add_child_view=function(t,e){var n=this.pWidget,i=new z.Widget;return i.title.label=this.model.get("_titles")[e]||"",n.addWidget(i),this.create_child_view(t).then(function(t){var e=t.pWidget;return e.title.label=i.title.label,n.collapseWidgets[n.indexOf(i)].widget=e,i.dispose(),t}).catch(r("Could not add child view to box",!0))},e.prototype.remove=function(){this.children_views=null,t.prototype.remove.call(this)},e}(i.DOMWidgetView),tn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $e(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"TabModel",_view_name:"TabView"})},e}(Ge),en=function(t){function e(e){var n=this,i=e.view;return delete e.view,(n=t.call(this,e)||this)._view=i,R.MessageLoop.installMessageHook(n.tabContents,function(t,e){return n._view.processPhosphorMessage(e),!0}),n}return $e(e,t),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._view&&this._view.remove(),this._view=null)},e}(We),nn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.updatingTabs=!1,e}return $e(e,t),e.prototype._createElement=function(t){return this.pWidget=new en({view:this}),this.pWidget.node},e.prototype._setElement=function(t){if(this.el||t!==this.pWidget.node)throw new Error("Cannot reset the DOM element.");this.el=this.pWidget.node,this.$el=W()(this.pWidget.node)},e.prototype.initialize=function(e){var n=this;t.prototype.initialize.call(this,e),this.childrenViews=new i.ViewList(this.addChildView,function(t){t.remove()},this),this.listenTo(this.model,"change:children",function(){return n.updateTabs()}),this.listenTo(this.model,"change:_titles",function(){return n.updateTitles()})},e.prototype.render=function(){t.prototype.render.call(this);var e=this.pWidget;e.addClass("jupyter-widgets"),e.addClass("widget-container"),e.addClass("widget-tab"),e.tabsMovable=!0,e.tabBar.insertBehavior="none",e.tabBar.currentChanged.connect(this._onTabChanged,this),e.tabBar.tabMoved.connect(this._onTabMoved,this),e.tabBar.addClass("widget-tab-bar"),e.tabContents.addClass("widget-tab-contents"),e.tabBar.tabsMovable=!1,this.updateTabs(),this.update()},e.prototype.updateTabs=function(){this.updatingTabs=!0,this.pWidget.currentIndex=null,this.childrenViews.update(this.model.get("children")),this.pWidget.currentIndex=this.model.get("selected_index"),this.updatingTabs=!1},e.prototype.addChildView=function(t,e){var n=this.model.get("_titles")[e]||"",i=this.pWidget,o=new z.Widget;return o.title.label=n,i.addWidget(o),this.create_child_view(t).then(function(t){var e=t.pWidget;e.title.label=o.title.label,e.title.closable=!1;var n=D.ArrayExt.firstIndexOf(i.widgets,o);return i.insertWidget(n+1,e),o.dispose(),t}).catch(r("Could not add child view to box",!0))},e.prototype.update=function(){return this.updateSelectedIndex(),t.prototype.update.call(this)},e.prototype.updateTitles=function(){var t=this.model.get("_titles")||{};Object(D.each)(this.pWidget.widgets,function(e,n){e.title.label=t[n]||""})},e.prototype.updateSelectedIndex=function(){this.pWidget.currentIndex=this.model.get("selected_index")},e.prototype.remove=function(){this.childrenViews=null,t.prototype.remove.call(this)},e.prototype._onTabChanged=function(t,e){if(!this.updatingTabs){var n=e.currentIndex;this.model.set("selected_index",-1===n?null:n),this.touch()}},e.prototype._onTabMoved=function(t,e){var n=this.model.get("children").slice();D.ArrayExt.move(n,e.fromIndex,e.toIndex),this.model.set("children",n),this.touch()},e}(i.DOMWidgetView),rn=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),on=function(){return(on=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},sn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rn(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{value:"",disabled:!1,placeholder:"",_model_name:"StringModel"})},e}(y),an=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rn(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_view_name:"HTMLView",_model_name:"HTMLModel"})},e}(sn),un=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rn(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-html"),this.content=document.createElement("div"),this.content.classList.add("widget-html-content"),this.el.appendChild(this.content),this.update()},e.prototype.update=function(){return this.content.innerHTML=this.model.get("value"),t.prototype.update.call(this)},e}(l),cn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rn(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_view_name:"HTMLMathView",_model_name:"HTMLMathModel"})},e}(sn),dn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rn(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-htmlmath"),this.content=document.createElement("div"),this.content.classList.add("widget-htmlmath-content"),this.el.appendChild(this.content),this.update()},e.prototype.update=function(){return this.content.innerHTML=this.model.get("value"),this.typeset(this.content),t.prototype.update.call(this)},e}(l),hn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rn(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_view_name:"LabelView",_model_name:"LabelModel"})},e}(sn),ln=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rn(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-label"),this.update()},e.prototype.update=function(){return this.typeset(this.el,this.model.get("value")),t.prototype.update.call(this)},e}(l),fn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rn(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_view_name:"TextareaView",_model_name:"TextareaModel",rows:null,continuous_update:!0})},e}(sn),pn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rn(e,t),e.prototype.render=function(){var e=this;t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-textarea"),this.textbox=document.createElement("textarea"),this.textbox.setAttribute("rows","5"),this.textbox.id=this.label.htmlFor=Object(i.uuid)(),this.el.appendChild(this.textbox),this.update(),this.listenTo(this.model,"change:placeholder",function(t,n,i){e.update_placeholder(n)}),this.update_placeholder()},e.prototype.update_placeholder=function(t){t=t||this.model.get("placeholder"),this.textbox.setAttribute("placeholder",t.toString())},e.prototype.update=function(e){if(void 0===e||e.updated_view!=this){this.textbox.value=this.model.get("value");var n=this.model.get("rows");null===n&&(n=""),this.textbox.setAttribute("rows",n),this.textbox.disabled=this.model.get("disabled")}return t.prototype.update.call(this)},e.prototype.events=function(){return{"keydown input":"handleKeyDown","keypress input":"handleKeypress","input textarea":"handleChanging","change textarea":"handleChanged"}},e.prototype.handleKeyDown=function(t){t.stopPropagation()},e.prototype.handleKeypress=function(t){t.stopPropagation()},e.prototype.handleChanging=function(t){this.model.get("continuous_update")&&this.handleChanged(t)},e.prototype.handleChanged=function(t){var e=t.target;this.model.set("value",e.value,{updated_view:this}),this.touch()},e}(l),mn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rn(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_view_name:"TextView",_model_name:"TextModel",continuous_update:!0})},e}(sn),gn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.inputType="text",e}return rn(e,t),e.prototype.render=function(){var e=this;t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-inline-hbox"),this.el.classList.add("widget-text"),this.textbox=document.createElement("input"),this.textbox.setAttribute("type",this.inputType),this.textbox.id=this.label.htmlFor=Object(i.uuid)(),this.el.appendChild(this.textbox),this.update(),this.listenTo(this.model,"change:placeholder",function(t,n,i){e.update_placeholder(n)}),this.listenTo(this.model,"change:description_tooltip",this.update_title),this.listenTo(this.model,"change:description",this.update_title),this.update_placeholder(),this.update_title()},e.prototype.update_placeholder=function(t){this.textbox.setAttribute("placeholder",t||this.model.get("placeholder"))},e.prototype.update_title=function(){var t=this.model.get("description_tooltip");t?0===this.model.get("description").length&&this.textbox.setAttribute("title",t):this.textbox.removeAttribute("title")},e.prototype.update=function(e){return void 0!==e&&e.updated_view===this||(this.textbox.value!==this.model.get("value")&&(this.textbox.value=this.model.get("value")),this.textbox.disabled=this.model.get("disabled")),t.prototype.update.call(this)},e.prototype.events=function(){return{"keydown input":"handleKeyDown","keypress input":"handleKeypress","input input":"handleChanging","change input":"handleChanged"}},e.prototype.handleKeyDown=function(t){t.stopPropagation()},e.prototype.handleKeypress=function(t){t.stopPropagation(),13===t.keyCode&&this.send({event:"submit"})},e.prototype.handleChanging=function(t){this.model.get("continuous_update")&&this.handleChanged(t)},e.prototype.handleChanged=function(t){var e=t.target;this.model.set("value",e.value,{updated_view:this}),this.touch()},e}(l),bn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rn(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_view_name:"PasswordView",_model_name:"PasswordModel"})},e}(mn),vn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.inputType="password",e}return rn(e,t),e}(gn),yn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rn(e,t),e.prototype.defaults=function(){return on({},t.prototype.defaults.call(this),{_model_name:"ComboboxModel",_view_name:"ComboboxView",options:[],ensure_options:!1})},e}(mn),_n=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isInitialRender=!0,e}return rn(e,t),e.prototype.render=function(){this.datalist=document.createElement("datalist"),this.datalist.id=Object(i.uuid)(),t.prototype.render.call(this),this.textbox.setAttribute("list",this.datalist.id),this.el.appendChild(this.datalist)},e.prototype.update=function(e){if(t.prototype.update.call(this,e),this.datalist){var n=this.isValid(this.model.get("value"));if(this.highlightValidState(n),!(void 0!==e&&e.updated_view||!this.model.hasChanged("options")&&!this.isInitialRender)){this.isInitialRender=!1;var i=this.model.get("options").map(function(t){return'<option value="'+t+'"></option>'});this.datalist.innerHTML=i.join("\n")}}},e.prototype.isValid=function(t){if(!0===this.model.get("ensure_option")&&-1===this.model.get("options").indexOf(t))return!1;return!0},e.prototype.handleChanging=function(e){var n=e.target,i=this.isValid(n.value);this.highlightValidState(i),i&&t.prototype.handleChanging.call(this,e)},e.prototype.handleChanged=function(e){var n=e.target,i=this.isValid(n.value);this.highlightValidState(i),i&&t.prototype.handleChanged.call(this,e)},e.prototype.highlightValidState=function(t){this.textbox.classList.toggle("jpwidgets-invalidComboValue",!t)},e}(gn),wn=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),xn=function(){return(xn=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},Mn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return wn(e,t),e.prototype.defaults=function(){return m.extend(t.prototype.defaults.call(this),{_model_name:"FileUploadModel",_view_name:"FileUploadView",_counter:0,accept:"",description:"Upload",tooltip:"",disabled:!1,icon:"upload",button_style:"",multiple:!1,metadata:[],data:[],error:"",style:null})},e.serializers=xn({},v.serializers,{data:{serialize:function(t){return t.slice()}}}),e}(v),Sn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return wn(e,t),Object.defineProperty(e.prototype,"tagName",{get:function(){return"button"},enumerable:!0,configurable:!0}),e.prototype.render=function(){var e=this;t.prototype.render.call(this),this.el.classList.add("jupyter-widgets"),this.el.classList.add("widget-upload"),this.el.classList.add("jupyter-button"),this.fileInput=document.createElement("input"),this.fileInput.type="file",this.fileInput.style.display="none",this.el.appendChild(this.fileInput),this.el.addEventListener("click",function(){e.fileInput.click()}),this.fileInput.addEventListener("click",function(){e.fileInput.value=""}),this.fileInput.addEventListener("change",function(){var t=[];Array.from(e.fileInput.files).forEach(function(n){t.push(new Promise(function(t,i){var r={name:n.name,type:n.type,size:n.size,lastModified:n.lastModified};e.fileReader=new FileReader,e.fileReader.onload=function(e){var n=e.target.result;t({buffer:n,metadata:r,error:""})},e.fileReader.onerror=function(){i()},e.fileReader.onabort=e.fileReader.onerror,e.fileReader.readAsArrayBuffer(n)}))}),Promise.all(t).then(function(t){var n=[],i=[];t.forEach(function(t){n.push(t.metadata),i.push(t.buffer)});var r=e.model.get("_counter");e.model.set({_counter:r+t.length,metadata:n,data:i,error:""}),e.touch()}).catch(function(t){console.error("error in file upload: %o",t),e.model.set({error:t}),e.touch()})}),this.listenTo(this.model,"change:button_style",this.update_button_style),this.set_button_style(),this.update()},e.prototype.update=function(){this.el.disabled=this.model.get("disabled"),this.el.setAttribute("title",this.model.get("tooltip"));var e=this.model.get("description")+" ("+this.model.get("_counter")+")",n=this.model.get("icon");if(e.length||n.length){if(this.el.textContent="",n.length){var i=document.createElement("i");i.classList.add("fa"),i.classList.add("fa-"+n),0===e.length&&i.classList.add("center"),this.el.appendChild(i)}this.el.appendChild(document.createTextNode(e))}return this.fileInput.accept=this.model.get("accept"),this.fileInput.multiple=this.model.get("multiple"),t.prototype.update.call(this)},e.prototype.update_button_style=function(){this.update_mapped_classes(e.class_map,"button_style",this.el)},e.prototype.set_button_style=function(){this.set_mapped_classes(e.class_map,"button_style",this.el)},e.class_map={primary:["mod-primary"],success:["mod-success"],info:["mod-info"],warning:["mod-warning"],danger:["mod-danger"]},e}(i.DOMWidgetView);n.d(e,"version",function(){return En}),n.d(e,"uuid",function(){return i.uuid}),n.d(e,"WrappedError",function(){return i.WrappedError}),n.d(e,"resolvePromisesDict",function(){return i.resolvePromisesDict}),n.d(e,"reject",function(){return r}),n.d(e,"typeset",function(){return o}),n.d(e,"escape_html",function(){return s}),n.d(e,"JUPYTER_CONTROLS_VERSION",function(){return"1.5.0"}),n.d(e,"DirectionalLinkModel",function(){return x}),n.d(e,"LinkModel",function(){return M}),n.d(e,"BoolModel",function(){return E}),n.d(e,"CheckboxModel",function(){return A}),n.d(e,"CheckboxView",function(){return C}),n.d(e,"ToggleButtonModel",function(){return k}),n.d(e,"ToggleButtonView",function(){return T}),n.d(e,"ValidModel",function(){return I}),n.d(e,"ValidView",function(){return P}),n.d(e,"ButtonStyleModel",function(){return L}),n.d(e,"ButtonModel",function(){return j}),n.d(e,"ButtonView",function(){return B}),n.d(e,"BoxModel",function(){return F}),n.d(e,"HBoxModel",function(){return V}),n.d(e,"VBoxModel",function(){return U}),n.d(e,"BoxView",function(){return K}),n.d(e,"HBoxView",function(){return Y}),n.d(e,"VBoxView",function(){return X}),n.d(e,"GridBoxView",function(){return $}),n.d(e,"GridBoxModel",function(){return G}),n.d(e,"ImageModel",function(){return Q}),n.d(e,"ImageView",function(){return tt}),n.d(e,"VideoModel",function(){return it}),n.d(e,"VideoView",function(){return rt}),n.d(e,"AudioModel",function(){return at}),n.d(e,"AudioView",function(){return ut}),n.d(e,"ColorPickerModel",function(){return dt}),n.d(e,"ColorPickerView",function(){return ht}),n.d(e,"serialize_date",function(){return mt}),n.d(e,"deserialize_date",function(){return gt}),n.d(e,"DatePickerModel",function(){return bt}),n.d(e,"DatePickerView",function(){return vt}),n.d(e,"IntModel",function(){return jt}),n.d(e,"BoundedIntModel",function(){return Bt}),n.d(e,"SliderStyleModel",function(){return Dt}),n.d(e,"IntSliderModel",function(){return Rt}),n.d(e,"IntRangeSliderModel",function(){return zt}),n.d(e,"BaseIntSliderView",function(){return Nt}),n.d(e,"IntRangeSliderView",function(){return Wt}),n.d(e,"IntSliderView",function(){return qt}),n.d(e,"IntTextModel",function(){return Ht}),n.d(e,"BoundedIntTextModel",function(){return Ft}),n.d(e,"IntTextView",function(){return Vt}),n.d(e,"ProgressStyleModel",function(){return Ut}),n.d(e,"IntProgressModel",function(){return Kt}),n.d(e,"ProgressView",function(){return Yt}),n.d(e,"PlayModel",function(){return Xt}),n.d(e,"PlayView",function(){return $t}),n.d(e,"FloatModel",function(){return Jt}),n.d(e,"BoundedFloatModel",function(){return Zt}),n.d(e,"FloatSliderModel",function(){return Qt}),n.d(e,"FloatLogSliderModel",function(){return te}),n.d(e,"FloatRangeSliderModel",function(){return ee}),n.d(e,"FloatSliderView",function(){return ne}),n.d(e,"FloatLogSliderView",function(){return ie}),n.d(e,"FloatRangeSliderView",function(){return re}),n.d(e,"FloatTextModel",function(){return oe}),n.d(e,"BoundedFloatTextModel",function(){return se}),n.d(e,"FloatTextView",function(){return ae}),n.d(e,"FloatProgressModel",function(){return ue}),n.d(e,"ControllerButtonModel",function(){return he}),n.d(e,"ControllerButtonView",function(){return le}),n.d(e,"ControllerAxisModel",function(){return fe}),n.d(e,"ControllerAxisView",function(){return pe}),n.d(e,"ControllerModel",function(){return me}),n.d(e,"ControllerView",function(){return ge}),n.d(e,"SelectionModel",function(){return ye}),n.d(e,"DropdownModel",function(){return _e}),n.d(e,"DropdownView",function(){return we}),n.d(e,"SelectModel",function(){return xe}),n.d(e,"SelectView",function(){return Me}),n.d(e,"RadioButtonsModel",function(){return Se}),n.d(e,"RadioButtonsView",function(){return Ee}),n.d(e,"ToggleButtonsStyleModel",function(){return Ae}),n.d(e,"ToggleButtonsModel",function(){return Ce}),n.d(e,"ToggleButtonsView",function(){return ke}),n.d(e,"SelectionSliderModel",function(){return Te}),n.d(e,"SelectionSliderView",function(){return Ie}),n.d(e,"MultipleSelectionModel",function(){return Pe}),n.d(e,"SelectMultipleModel",function(){return Oe}),n.d(e,"SelectMultipleView",function(){return Le}),n.d(e,"SelectionRangeSliderModel",function(){return je}),n.d(e,"SelectionRangeSliderView",function(){return Be}),n.d(e,"SelectionContainerModel",function(){return Ge}),n.d(e,"AccordionModel",function(){return Je}),n.d(e,"JupyterPhosphorAccordionWidget",function(){return Ze}),n.d(e,"AccordionView",function(){return Qe}),n.d(e,"TabModel",function(){return tn}),n.d(e,"JupyterPhosphorTabPanelWidget",function(){return en}),n.d(e,"TabView",function(){return nn}),n.d(e,"StringModel",function(){return sn}),n.d(e,"HTMLModel",function(){return an}),n.d(e,"HTMLView",function(){return un}),n.d(e,"HTMLMathModel",function(){return cn}),n.d(e,"HTMLMathView",function(){return dn}),n.d(e,"LabelModel",function(){return hn}),n.d(e,"LabelView",function(){return ln}),n.d(e,"TextareaModel",function(){return fn}),n.d(e,"TextareaView",function(){return pn}),n.d(e,"TextModel",function(){return mn}),n.d(e,"TextView",function(){return gn}),n.d(e,"PasswordModel",function(){return bn}),n.d(e,"PasswordView",function(){return vn}),n.d(e,"ComboboxModel",function(){return yn}),n.d(e,"ComboboxView",function(){return _n}),n.d(e,"DescriptionStyleModel",function(){return d}),n.d(e,"DescriptionModel",function(){return h}),n.d(e,"DescriptionView",function(){return l}),n.d(e,"LabeledDOMWidgetModel",function(){return f}),n.d(e,"LabeledDOMWidgetView",function(){return p}),n.d(e,"FileUploadModel",function(){return Mn}),n.d(e,"FileUploadView",function(){return Sn});var En=n(233).version}])});; |
| 126 | |
| 127 | define("@jupyter-widgets/html-manager",["@jupyter-widgets/base","@jupyter-widgets/controls"],function(__WEBPACK_EXTERNAL_MODULE__36__,__WEBPACK_EXTERNAL_MODULE__312__){return function(e){function t(t){for(var n,i,o=t[0],a=t[1],s=0,l=[];s<o.length;s++)i=o[s],r[i]&&l.push(r[i][0]),r[i]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(u&&u(t);l.length;)l.shift()()}var n={},r={0:0};function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var o=new Promise(function(t,i){n=r[e]=[t,i]});t.push(n[2]=o);var a,s=document.createElement("script");s.charset="utf-8",s.timeout=120,i.nc&&s.setAttribute("nonce",i.nc),s.src=function(e){return i.p+""+e+".index.js"}(e);var u=new Error;a=function(t){s.onerror=s.onload=null,clearTimeout(l);var n=r[e];if(0!==n){if(n){var i=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+i+": "+o+")",u.name="ChunkLoadError",u.type=i,u.request=o,n[1](u)}r[e]=void 0}};var l=setTimeout(function(){a({type:"timeout",target:s})},12e4);s.onerror=s.onload=a,document.head.appendChild(s)}return Promise.all(t)},i.m=e,i.c=n,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="https://unpkg.com/@jupyter-widgets/html-manager@0.18.4/dist/",i.oe=function(e){throw console.error(e),e};var o=window.webpackJsonp_jupyter_widgets_html_manager=window.webpackJsonp_jupyter_widgets_html_manager||[],a=o.push.bind(o);o.push=t,o=o.slice();for(var s=0;s<o.length;s++)t(o[s]);var u=a;return i(i.s=671)}([function(e,t,n){(function(e){e.exports=function(){"use strict";var t,r;function i(){return t.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function l(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function c(e,t){var n,r=[];for(n=0;n<e.length;++n)r.push(t(e[n],n));return r}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function f(e,t){for(var n in t)d(t,n)&&(e[n]=t[n]);return d(t,"toString")&&(e.toString=t.toString),d(t,"valueOf")&&(e.valueOf=t.valueOf),e}function h(e,t,n,r){return Tt(e,t,n,r,!0).utc()}function p(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function m(e){if(null==e._isValid){var t=p(e),n=r.call(t.parsedDateParts,function(e){return null!=e}),i=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(i=i&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return i;e._isValid=i}return e._isValid}function g(e){var t=h(NaN);return null!=e?f(p(t),e):p(t).userInvalidated=!0,t}r=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};var y=i.momentProperties=[];function _(e,t){var n,r,i;if(s(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),s(t._i)||(e._i=t._i),s(t._f)||(e._f=t._f),s(t._l)||(e._l=t._l),s(t._strict)||(e._strict=t._strict),s(t._tzm)||(e._tzm=t._tzm),s(t._isUTC)||(e._isUTC=t._isUTC),s(t._offset)||(e._offset=t._offset),s(t._pf)||(e._pf=p(t)),s(t._locale)||(e._locale=t._locale),y.length>0)for(n=0;n<y.length;n++)r=y[n],s(i=t[r])||(e[r]=i);return e}var v=!1;function b(e){_(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===v&&(v=!0,i.updateOffset(this),v=!1)}function w(e){return e instanceof b||null!=e&&null!=e._isAMomentObject}function M(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function x(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=M(t)),n}function k(e,t,n){var r,i=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),a=0;for(r=0;r<i;r++)(n&&e[r]!==t[r]||!n&&x(e[r])!==x(t[r]))&&a++;return a+o}function D(e){!1===i.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function S(e,t){var n=!0;return f(function(){if(null!=i.deprecationHandler&&i.deprecationHandler(null,e),n){for(var r,o=[],a=0;a<arguments.length;a++){if(r="","object"==typeof arguments[a]){for(var s in r+="\n["+a+"] ",arguments[0])r+=s+": "+arguments[0][s]+", ";r=r.slice(0,-2)}else r=arguments[a];o.push(r)}D(e+"\nArguments: "+Array.prototype.slice.call(o).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)},t)}var L,C={};function E(e,t){null!=i.deprecationHandler&&i.deprecationHandler(e,t),C[e]||(D(t),C[e]=!0)}function T(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function A(e,t){var n,r=f({},e);for(n in t)d(t,n)&&(a(e[n])&&a(t[n])?(r[n]={},f(r[n],e[n]),f(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)d(e,n)&&!d(t,n)&&a(e[n])&&(r[n]=f({},r[n]));return r}function j(e){null!=e&&this.set(e)}i.suppressDeprecationWarnings=!1,i.deprecationHandler=null,L=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)d(e,t)&&n.push(t);return n};var I={};function P(e,t){var n=e.toLowerCase();I[n]=I[n+"s"]=I[t]=e}function O(e){return"string"==typeof e?I[e]||I[e.toLowerCase()]:void 0}function N(e){var t,n,r={};for(n in e)d(e,n)&&(t=O(n))&&(r[t]=e[n]);return r}var Y={};function F(e,t){Y[e]=t}function z(e,t,n){var r=""+Math.abs(e),i=t-r.length,o=e>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var R=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,B=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,H={},U={};function W(e,t,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),e&&(U[e]=i),t&&(U[t[0]]=function(){return z(i.apply(this,arguments),t[1],t[2])}),n&&(U[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function q(e,t){return e.isValid()?(t=$(t,e.localeData()),H[t]=H[t]||function(e){var t,n,r,i=e.match(R);for(t=0,n=i.length;t<n;t++)U[i[t]]?i[t]=U[i[t]]:i[t]=(r=i[t]).match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"");return function(t){var r,o="";for(r=0;r<n;r++)o+=T(i[r])?i[r].call(t,e):i[r];return o}}(t),H[t](e)):e.localeData().invalidDate()}function $(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(B.lastIndex=0;n>=0&&B.test(e);)e=e.replace(B,r),B.lastIndex=0,n-=1;return e}var V=/\d/,G=/\d\d/,K=/\d{3}/,J=/\d{4}/,Q=/[+-]?\d{6}/,Z=/\d\d?/,X=/\d\d\d\d?/,ee=/\d\d\d\d\d\d?/,te=/\d{1,3}/,ne=/\d{1,4}/,re=/[+-]?\d{1,6}/,ie=/\d+/,oe=/[+-]?\d+/,ae=/Z|[+-]\d\d:?\d\d/gi,se=/Z|[+-]\d\d(?::?\d\d)?/gi,ue=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,le={};function ce(e,t,n){le[e]=T(t)?t:function(e,r){return e&&n?n:t}}function de(e,t){return d(le,e)?le[e](t._strict,t._locale):new RegExp(fe(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,i){return t||n||r||i})))}function fe(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var he={};function pe(e,t){var n,r=t;for("string"==typeof e&&(e=[e]),u(t)&&(r=function(e,n){n[t]=x(e)}),n=0;n<e.length;n++)he[e[n]]=r}function me(e,t){pe(e,function(e,n,r,i){r._w=r._w||{},t(e,r._w,r,i)})}function ge(e,t,n){null!=t&&d(he,e)&&he[e](t,n._a,n,e)}var ye=0,_e=1,ve=2,be=3,we=4,Me=5,xe=6,ke=7,De=8;function Se(e){return Le(e)?366:365}function Le(e){return e%4==0&&e%100!=0||e%400==0}W("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),W(0,["YY",2],0,function(){return this.year()%100}),W(0,["YYYY",4],0,"year"),W(0,["YYYYY",5],0,"year"),W(0,["YYYYYY",6,!0],0,"year"),P("year","y"),F("year",1),ce("Y",oe),ce("YY",Z,G),ce("YYYY",ne,J),ce("YYYYY",re,Q),ce("YYYYYY",re,Q),pe(["YYYYY","YYYYYY"],ye),pe("YYYY",function(e,t){t[ye]=2===e.length?i.parseTwoDigitYear(e):x(e)}),pe("YY",function(e,t){t[ye]=i.parseTwoDigitYear(e)}),pe("Y",function(e,t){t[ye]=parseInt(e,10)}),i.parseTwoDigitYear=function(e){return x(e)+(x(e)>68?1900:2e3)};var Ce,Ee=Te("FullYear",!0);function Te(e,t){return function(n){return null!=n?(je(this,e,n),i.updateOffset(this,t),this):Ae(this,e)}}function Ae(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function je(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&Le(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Ie(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Ie(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,r=(t%(n=12)+n)%n;return e+=(t-r)/12,1===r?Le(e)?29:28:31-r%7%2}Ce=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},W("M",["MM",2],"Mo",function(){return this.month()+1}),W("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),W("MMMM",0,0,function(e){return this.localeData().months(this,e)}),P("month","M"),F("month",8),ce("M",Z),ce("MM",Z,G),ce("MMM",function(e,t){return t.monthsShortRegex(e)}),ce("MMMM",function(e,t){return t.monthsRegex(e)}),pe(["M","MM"],function(e,t){t[_e]=x(e)-1}),pe(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);null!=i?t[_e]=i:p(n).invalidMonth=e});var Pe=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Oe="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ne="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Ye(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=x(t);else if(!u(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Ie(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Fe(e){return null!=e?(Ye(this,e),i.updateOffset(this,!0),this):Ae(this,"Month")}var ze=ue,Re=ue;function Be(){function e(e,t){return t.length-e.length}var t,n,r=[],i=[],o=[];for(t=0;t<12;t++)n=h([2e3,t]),r.push(this.monthsShort(n,"")),i.push(this.months(n,"")),o.push(this.months(n,"")),o.push(this.monthsShort(n,""));for(r.sort(e),i.sort(e),o.sort(e),t=0;t<12;t++)r[t]=fe(r[t]),i[t]=fe(i[t]);for(t=0;t<24;t++)o[t]=fe(o[t]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function He(e){var t;if(e<100&&e>=0){var n=Array.prototype.slice.call(arguments);n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function Ue(e,t,n){var r=7+t-n,i=(7+He(e,0,r).getUTCDay()-t)%7;return-i+r-1}function We(e,t,n,r,i){var o,a,s=(7+n-r)%7,u=Ue(e,r,i),l=1+7*(t-1)+s+u;return l<=0?a=Se(o=e-1)+l:l>Se(e)?(o=e+1,a=l-Se(e)):(o=e,a=l),{year:o,dayOfYear:a}}function qe(e,t,n){var r,i,o=Ue(e.year(),t,n),a=Math.floor((e.dayOfYear()-o-1)/7)+1;return a<1?(i=e.year()-1,r=a+$e(i,t,n)):a>$e(e.year(),t,n)?(r=a-$e(e.year(),t,n),i=e.year()+1):(i=e.year(),r=a),{week:r,year:i}}function $e(e,t,n){var r=Ue(e,t,n),i=Ue(e+1,t,n);return(Se(e)-r+i)/7}function Ve(e,t){return e.slice(t,7).concat(e.slice(0,t))}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),P("week","w"),P("isoWeek","W"),F("week",5),F("isoWeek",5),ce("w",Z),ce("ww",Z,G),ce("W",Z),ce("WW",Z,G),me(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=x(e)}),W("d",0,"do","day"),W("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),W("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),W("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),P("day","d"),P("weekday","e"),P("isoWeekday","E"),F("day",11),F("weekday",11),F("isoWeekday",11),ce("d",Z),ce("e",Z),ce("E",Z),ce("dd",function(e,t){return t.weekdaysMinRegex(e)}),ce("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ce("dddd",function(e,t){return t.weekdaysRegex(e)}),me(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);null!=i?t.d=i:p(n).invalidWeekday=e}),me(["d","e","E"],function(e,t,n,r){t[r]=x(e)});var Ge="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ke="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Je="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Qe=ue,Ze=ue,Xe=ue;function et(){function e(e,t){return t.length-e.length}var t,n,r,i,o,a=[],s=[],u=[],l=[];for(t=0;t<7;t++)n=h([2e3,1]).day(t),r=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),o=this.weekdays(n,""),a.push(r),s.push(i),u.push(o),l.push(r),l.push(i),l.push(o);for(a.sort(e),s.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)s[t]=fe(s[t]),u[t]=fe(u[t]),l[t]=fe(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function tt(){return this.hours()%12||12}function nt(e,t){W(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function rt(e,t){return t._meridiemParse}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,tt),W("k",["kk",2],0,function(){return this.hours()||24}),W("hmm",0,0,function(){return""+tt.apply(this)+z(this.minutes(),2)}),W("hmmss",0,0,function(){return""+tt.apply(this)+z(this.minutes(),2)+z(this.seconds(),2)}),W("Hmm",0,0,function(){return""+this.hours()+z(this.minutes(),2)}),W("Hmmss",0,0,function(){return""+this.hours()+z(this.minutes(),2)+z(this.seconds(),2)}),nt("a",!0),nt("A",!1),P("hour","h"),F("hour",13),ce("a",rt),ce("A",rt),ce("H",Z),ce("h",Z),ce("k",Z),ce("HH",Z,G),ce("hh",Z,G),ce("kk",Z,G),ce("hmm",X),ce("hmmss",ee),ce("Hmm",X),ce("Hmmss",ee),pe(["H","HH"],be),pe(["k","kk"],function(e,t,n){var r=x(e);t[be]=24===r?0:r}),pe(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),pe(["h","hh"],function(e,t,n){t[be]=x(e),p(n).bigHour=!0}),pe("hmm",function(e,t,n){var r=e.length-2;t[be]=x(e.substr(0,r)),t[we]=x(e.substr(r)),p(n).bigHour=!0}),pe("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[be]=x(e.substr(0,r)),t[we]=x(e.substr(r,2)),t[Me]=x(e.substr(i)),p(n).bigHour=!0}),pe("Hmm",function(e,t,n){var r=e.length-2;t[be]=x(e.substr(0,r)),t[we]=x(e.substr(r))}),pe("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[be]=x(e.substr(0,r)),t[we]=x(e.substr(r,2)),t[Me]=x(e.substr(i))});var it,ot=Te("Hours",!0),at={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Oe,monthsShort:Ne,week:{dow:0,doy:6},weekdays:Ge,weekdaysMin:Je,weekdaysShort:Ke,meridiemParse:/[ap]\.?m?\.?/i},st={},ut={};function lt(e){return e?e.toLowerCase().replace("_","-"):e}function ct(t){var r=null;if(!st[t]&&void 0!==e&&e&&e.exports)try{r=it._abbr,n(545)("./"+t),dt(r)}catch(e){}return st[t]}function dt(e,t){var n;return e&&((n=s(t)?ht(e):ft(e,t))?it=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),it._abbr}function ft(e,t){if(null!==t){var n,r=at;if(t.abbr=e,null!=st[e])E("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=st[e]._config;else if(null!=t.parentLocale)if(null!=st[t.parentLocale])r=st[t.parentLocale]._config;else{if(null==(n=ct(t.parentLocale)))return ut[t.parentLocale]||(ut[t.parentLocale]=[]),ut[t.parentLocale].push({name:e,config:t}),null;r=n._config}return st[e]=new j(A(r,t)),ut[e]&&ut[e].forEach(function(e){ft(e.name,e.config)}),dt(e),st[e]}return delete st[e],null}function ht(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return it;if(!o(e)){if(t=ct(e))return t;e=[e]}return function(e){for(var t,n,r,i,o=0;o<e.length;){for(i=lt(e[o]).split("-"),t=i.length,n=(n=lt(e[o+1]))?n.split("-"):null;t>0;){if(r=ct(i.slice(0,t).join("-")))return r;if(n&&n.length>=t&&k(i,n,!0)>=t-1)break;t--}o++}return it}(e)}function pt(e){var t,n=e._a;return n&&-2===p(e).overflow&&(t=n[_e]<0||n[_e]>11?_e:n[ve]<1||n[ve]>Ie(n[ye],n[_e])?ve:n[be]<0||n[be]>24||24===n[be]&&(0!==n[we]||0!==n[Me]||0!==n[xe])?be:n[we]<0||n[we]>59?we:n[Me]<0||n[Me]>59?Me:n[xe]<0||n[xe]>999?xe:-1,p(e)._overflowDayOfYear&&(t<ye||t>ve)&&(t=ve),p(e)._overflowWeeks&&-1===t&&(t=ke),p(e)._overflowWeekday&&-1===t&&(t=De),p(e).overflow=t),e}function mt(e,t,n){return null!=e?e:null!=t?t:n}function gt(e){var t,n,r,o,a,s=[];if(!e._d){for(r=function(e){var t=new Date(i.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[ve]&&null==e._a[_e]&&function(e){var t,n,r,i,o,a,s,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)o=1,a=4,n=mt(t.GG,e._a[ye],qe(At(),1,4).year),r=mt(t.W,1),((i=mt(t.E,1))<1||i>7)&&(u=!0);else{o=e._locale._week.dow,a=e._locale._week.doy;var l=qe(At(),o,a);n=mt(t.gg,e._a[ye],l.year),r=mt(t.w,l.week),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+o,(t.e<0||t.e>6)&&(u=!0)):i=o}r<1||r>$e(n,o,a)?p(e)._overflowWeeks=!0:null!=u?p(e)._overflowWeekday=!0:(s=We(n,r,i,o,a),e._a[ye]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(a=mt(e._a[ye],r[ye]),(e._dayOfYear>Se(a)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),n=He(a,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ve]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=r[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[be]&&0===e._a[we]&&0===e._a[Me]&&0===e._a[xe]&&(e._nextDay=!0,e._a[be]=0),e._d=(e._useUTC?He:function(e,t,n,r,i,o,a){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,i,o,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,i,o,a),s}).apply(null,s),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[be]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(p(e).weekdayMismatch=!0)}}var yt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,vt=/Z|[+-]\d\d(?::?\d\d)?/,bt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],wt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Mt=/^\/?Date\((\-?\d+)/i;function xt(e){var t,n,r,i,o,a,s=e._i,u=yt.exec(s)||_t.exec(s);if(u){for(p(e).iso=!0,t=0,n=bt.length;t<n;t++)if(bt[t][1].exec(u[1])){i=bt[t][0],r=!1!==bt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=wt.length;t<n;t++)if(wt[t][1].exec(u[3])){o=(u[2]||" ")+wt[t][0];break}if(null==o)return void(e._isValid=!1)}if(!r&&null!=o)return void(e._isValid=!1);if(u[4]){if(!vt.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(o||"")+(a||""),Ct(e)}else e._isValid=!1}var kt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function Dt(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Lt(e){var t,n,r,i,o,a,s,u=kt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(u){var l=(t=u[4],n=u[3],r=u[2],i=u[5],o=u[6],a=u[7],s=[Dt(t),Ne.indexOf(n),parseInt(r,10),parseInt(i,10),parseInt(o,10)],a&&s.push(parseInt(a,10)),s);if(!function(e,t,n){if(e){var r=Ke.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(r!==i)return p(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}(u[1],l,e))return;e._a=l,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var r=parseInt(n,10),i=r%100,o=(r-i)/100;return 60*o+i}(u[8],u[9],u[10]),e._d=He.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),p(e).rfc2822=!0}else e._isValid=!1}function Ct(e){if(e._f!==i.ISO_8601)if(e._f!==i.RFC_2822){e._a=[],p(e).empty=!0;var t,n,r,o,a,s=""+e._i,u=s.length,l=0;for(r=$(e._f,e._locale).match(R)||[],t=0;t<r.length;t++)o=r[t],(n=(s.match(de(o,e))||[])[0])&&((a=s.substr(0,s.indexOf(n))).length>0&&p(e).unusedInput.push(a),s=s.slice(s.indexOf(n)+n.length),l+=n.length),U[o]?(n?p(e).empty=!1:p(e).unusedTokens.push(o),ge(o,n,e)):e._strict&&!n&&p(e).unusedTokens.push(o);p(e).charsLeftOver=u-l,s.length>0&&p(e).unusedInput.push(s),e._a[be]<=12&&!0===p(e).bigHour&&e._a[be]>0&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[be]=function(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}(e._locale,e._a[be],e._meridiem),gt(e),pt(e)}else Lt(e);else xt(e)}function Et(e){var t=e._i,n=e._f;return e._locale=e._locale||ht(e._l),null===t||void 0===n&&""===t?g({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),w(t)?new b(pt(t)):(l(t)?e._d=t:o(n)?function(e){var t,n,r,i,o;if(0===e._f.length)return p(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<e._f.length;i++)o=0,t=_({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Ct(t),m(t)&&(o+=p(t).charsLeftOver,o+=10*p(t).unusedTokens.length,p(t).score=o,(null==r||o<r)&&(r=o,n=t));f(e,n||t)}(e):n?Ct(e):function(e){var t=e._i;s(t)?e._d=new Date(i.now()):l(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=Mt.exec(e._i);null===t?(xt(e),!1===e._isValid&&(delete e._isValid,Lt(e),!1===e._isValid&&(delete e._isValid,i.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):o(t)?(e._a=c(t.slice(0),function(e){return parseInt(e,10)}),gt(e)):a(t)?function(e){if(!e._d){var t=N(e._i);e._a=c([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),gt(e)}}(e):u(t)?e._d=new Date(t):i.createFromInputFallback(e)}(e),m(e)||(e._d=null),e))}function Tt(e,t,n,r,i){var s,u={};return!0!==n&&!1!==n||(r=n,n=void 0),(a(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||o(e)&&0===e.length)&&(e=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=i,u._l=n,u._i=e,u._f=t,u._strict=r,(s=new b(pt(Et(u))))._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function At(e,t,n,r){return Tt(e,t,n,r,!1)}i.createFromInputFallback=S("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),i.ISO_8601=function(){},i.RFC_2822=function(){};var jt=S("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=At.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:g()}),It=S("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=At.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:g()});function Pt(e,t){var n,r;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return At();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}var Ot=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Nt(e){var t=N(e),n=t.year||0,r=t.quarter||0,i=t.month||0,o=t.week||t.isoWeek||0,a=t.day||0,s=t.hour||0,u=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ce.call(Ot,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,r=0;r<Ot.length;++r)if(e[Ot[r]]){if(n)return!1;parseFloat(e[Ot[r]])!==x(e[Ot[r]])&&(n=!0)}return!0}(t),this._milliseconds=+c+1e3*l+6e4*u+1e3*s*60*60,this._days=+a+7*o,this._months=+i+3*r+12*n,this._data={},this._locale=ht(),this._bubble()}function Yt(e){return e instanceof Nt}function Ft(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function zt(e,t){W(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+z(~~(e/60),2)+t+z(~~e%60,2)})}zt("Z",":"),zt("ZZ",""),ce("Z",se),ce("ZZ",se),pe(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Bt(se,e)});var Rt=/([\+\-]|\d\d)/gi;function Bt(e,t){var n=(t||"").match(e);if(null===n)return null;var r=n[n.length-1]||[],i=(r+"").match(Rt)||["-",0,0],o=60*i[1]+x(i[2]);return 0===o?0:"+"===i[0]?o:-o}function Ht(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(w(e)||l(e)?e.valueOf():At(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),i.updateOffset(n,!1),n):At(e).local()}function Ut(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Wt(){return!!this.isValid()&&this._isUTC&&0===this._offset}i.updateOffset=function(){};var qt=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,$t=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Vt(e,t){var n,r,i,o,a,s,l=e,c=null;return Yt(e)?l={ms:e._milliseconds,d:e._days,M:e._months}:u(e)?(l={},t?l[t]=e:l.milliseconds=e):(c=qt.exec(e))?(n="-"===c[1]?-1:1,l={y:0,d:x(c[ve])*n,h:x(c[be])*n,m:x(c[we])*n,s:x(c[Me])*n,ms:x(Ft(1e3*c[xe]))*n}):(c=$t.exec(e))?(n="-"===c[1]?-1:1,l={y:Gt(c[2],n),M:Gt(c[3],n),w:Gt(c[4],n),d:Gt(c[5],n),h:Gt(c[6],n),m:Gt(c[7],n),s:Gt(c[8],n)}):null==l?l={}:"object"==typeof l&&("from"in l||"to"in l)&&(o=At(l.from),a=At(l.to),i=o.isValid()&&a.isValid()?(a=Ht(a,o),o.isBefore(a)?s=Kt(o,a):((s=Kt(a,o)).milliseconds=-s.milliseconds,s.months=-s.months),s):{milliseconds:0,months:0},(l={}).ms=i.milliseconds,l.M=i.months),r=new Nt(l),Yt(e)&&d(e,"_locale")&&(r._locale=e._locale),r}function Gt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Kt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Jt(e,t){return function(n,r){var i;return null===r||isNaN(+r)||(E(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),Qt(this,Vt(n="string"==typeof n?+n:n,r),e),this}}function Qt(e,t,n,r){var o=t._milliseconds,a=Ft(t._days),s=Ft(t._months);e.isValid()&&(r=null==r||r,s&&Ye(e,Ae(e,"Month")+s*n),a&&je(e,"Date",Ae(e,"Date")+a*n),o&&e._d.setTime(e._d.valueOf()+o*n),r&&i.updateOffset(e,a||s))}Vt.fn=Nt.prototype,Vt.invalid=function(){return Vt(NaN)};var Zt=Jt(1,"add"),Xt=Jt(-1,"subtract");function en(e,t){var n,r,i=12*(t.year()-e.year())+(t.month()-e.month()),o=e.clone().add(i,"months");return t-o<0?(n=e.clone().add(i-1,"months"),r=(t-o)/(o-n)):(n=e.clone().add(i+1,"months"),r=(t-o)/(n-o)),-(i+r)||0}function tn(e){var t;return void 0===e?this._locale._abbr:(null!=(t=ht(e))&&(this._locale=t),this)}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var nn=S("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function rn(){return this._locale}var on=1e3,an=60*on,sn=60*an,un=3506328*sn;function ln(e,t){return(e%t+t)%t}function cn(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-un:new Date(e,t,n).valueOf()}function dn(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-un:Date.UTC(e,t,n)}function fn(e,t){W(0,[e,e.length],0,t)}function hn(e,t,n,r,i){var o;return null==e?qe(this,r,i).year:(o=$e(e,r,i),t>o&&(t=o),function(e,t,n,r,i){var o=We(e,t,n,r,i),a=He(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,r,i))}W(0,["gg",2],0,function(){return this.weekYear()%100}),W(0,["GG",2],0,function(){return this.isoWeekYear()%100}),fn("gggg","weekYear"),fn("ggggg","weekYear"),fn("GGGG","isoWeekYear"),fn("GGGGG","isoWeekYear"),P("weekYear","gg"),P("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),ce("G",oe),ce("g",oe),ce("GG",Z,G),ce("gg",Z,G),ce("GGGG",ne,J),ce("gggg",ne,J),ce("GGGGG",re,Q),ce("ggggg",re,Q),me(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=x(e)}),me(["gg","GG"],function(e,t,n,r){t[r]=i.parseTwoDigitYear(e)}),W("Q",0,"Qo","quarter"),P("quarter","Q"),F("quarter",7),ce("Q",V),pe("Q",function(e,t){t[_e]=3*(x(e)-1)}),W("D",["DD",2],"Do","date"),P("date","D"),F("date",9),ce("D",Z),ce("DD",Z,G),ce("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),pe(["D","DD"],ve),pe("Do",function(e,t){t[ve]=x(e.match(Z)[0])});var pn=Te("Date",!0);W("DDD",["DDDD",3],"DDDo","dayOfYear"),P("dayOfYear","DDD"),F("dayOfYear",4),ce("DDD",te),ce("DDDD",K),pe(["DDD","DDDD"],function(e,t,n){n._dayOfYear=x(e)}),W("m",["mm",2],0,"minute"),P("minute","m"),F("minute",14),ce("m",Z),ce("mm",Z,G),pe(["m","mm"],we);var mn=Te("Minutes",!1);W("s",["ss",2],0,"second"),P("second","s"),F("second",15),ce("s",Z),ce("ss",Z,G),pe(["s","ss"],Me);var gn,yn=Te("Seconds",!1);for(W("S",0,0,function(){return~~(this.millisecond()/100)}),W(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,function(){return 10*this.millisecond()}),W(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),W(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),W(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),W(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),W(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),P("millisecond","ms"),F("millisecond",16),ce("S",te,V),ce("SS",te,G),ce("SSS",te,K),gn="SSSS";gn.length<=9;gn+="S")ce(gn,ie);function _n(e,t){t[xe]=x(1e3*("0."+e))}for(gn="S";gn.length<=9;gn+="S")pe(gn,_n);var vn=Te("Milliseconds",!1);W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var bn=b.prototype;function wn(e){return e}bn.add=Zt,bn.calendar=function(e,t){var n=e||At(),r=Ht(n,this).startOf("day"),o=i.calendarFormat(this,r)||"sameElse",a=t&&(T(t[o])?t[o].call(this,n):t[o]);return this.format(a||this.localeData().calendar(o,this,At(n)))},bn.clone=function(){return new b(this)},bn.diff=function(e,t,n){var r,i,o;if(!this.isValid())return NaN;if(!(r=Ht(e,this)).isValid())return NaN;switch(i=6e4*(r.utcOffset()-this.utcOffset()),t=O(t)){case"year":o=en(this,r)/12;break;case"month":o=en(this,r);break;case"quarter":o=en(this,r)/3;break;case"second":o=(this-r)/1e3;break;case"minute":o=(this-r)/6e4;break;case"hour":o=(this-r)/36e5;break;case"day":o=(this-r-i)/864e5;break;case"week":o=(this-r-i)/6048e5;break;default:o=this-r}return n?o:M(o)},bn.endOf=function(e){var t;if(void 0===(e=O(e))||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?dn:cn;switch(e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=sn-ln(t+(this._isUTC?0:this.utcOffset()*an),sn)-1;break;case"minute":t=this._d.valueOf(),t+=an-ln(t,an)-1;break;case"second":t=this._d.valueOf(),t+=on-ln(t,on)-1}return this._d.setTime(t),i.updateOffset(this,!0),this},bn.format=function(e){e||(e=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var t=q(this,e);return this.localeData().postformat(t)},bn.from=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||At(e).isValid())?Vt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},bn.fromNow=function(e){return this.from(At(),e)},bn.to=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||At(e).isValid())?Vt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},bn.toNow=function(e){return this.to(At(),e)},bn.get=function(e){return T(this[e=O(e)])?this[e]():this},bn.invalidAt=function(){return p(this).overflow},bn.isAfter=function(e,t){var n=w(e)?e:At(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=O(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},bn.isBefore=function(e,t){var n=w(e)?e:At(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=O(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},bn.isBetween=function(e,t,n,r){var i=w(e)?e:At(e),o=w(t)?t:At(t);return!!(this.isValid()&&i.isValid()&&o.isValid())&&(("("===(r=r||"()")[0]?this.isAfter(i,n):!this.isBefore(i,n))&&(")"===r[1]?this.isBefore(o,n):!this.isAfter(o,n)))},bn.isSame=function(e,t){var n,r=w(e)?e:At(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=O(t)||"millisecond")?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},bn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},bn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},bn.isValid=function(){return m(this)},bn.lang=nn,bn.locale=tn,bn.localeData=rn,bn.max=It,bn.min=jt,bn.parsingFlags=function(){return f({},p(this))},bn.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:Y[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}(e=N(e)),r=0;r<n.length;r++)this[n[r].unit](e[n[r].unit]);else if(T(this[e=O(e)]))return this[e](t);return this},bn.startOf=function(e){var t;if(void 0===(e=O(e))||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?dn:cn;switch(e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=ln(t+(this._isUTC?0:this.utcOffset()*an),sn);break;case"minute":t=this._d.valueOf(),t-=ln(t,an);break;case"second":t=this._d.valueOf(),t-=ln(t,on)}return this._d.setTime(t),i.updateOffset(this,!0),this},bn.subtract=Xt,bn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},bn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},bn.toDate=function(){return new Date(this.valueOf())},bn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?q(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):T(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",q(n,"Z")):q(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},bn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=t+'[")]';return this.format(n+r+"-MM-DD[T]HH:mm:ss.SSS"+i)},bn.toJSON=function(){return this.isValid()?this.toISOString():null},bn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},bn.unix=function(){return Math.floor(this.valueOf()/1e3)},bn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},bn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},bn.year=Ee,bn.isLeapYear=function(){return Le(this.year())},bn.weekYear=function(e){return hn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},bn.isoWeekYear=function(e){return hn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},bn.quarter=bn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},bn.month=Fe,bn.daysInMonth=function(){return Ie(this.year(),this.month())},bn.week=bn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},bn.isoWeek=bn.isoWeeks=function(e){var t=qe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},bn.weeksInYear=function(){var e=this.localeData()._week;return $e(this.year(),e.dow,e.doy)},bn.isoWeeksInYear=function(){return $e(this.year(),1,4)},bn.date=pn,bn.day=bn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},bn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},bn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},bn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},bn.hour=bn.hours=ot,bn.minute=bn.minutes=mn,bn.second=bn.seconds=yn,bn.millisecond=bn.milliseconds=vn,bn.utcOffset=function(e,t,n){var r,o=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Bt(se,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(r=Ut(this)),this._offset=e,this._isUTC=!0,null!=r&&this.add(r,"m"),o!==e&&(!t||this._changeInProgress?Qt(this,Vt(e-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?o:Ut(this)},bn.utc=function(e){return this.utcOffset(0,e)},bn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ut(this),"m")),this},bn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Bt(ae,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},bn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?At(e).utcOffset():0,(this.utcOffset()-e)%60==0)},bn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},bn.isLocal=function(){return!!this.isValid()&&!this._isUTC},bn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},bn.isUtc=Wt,bn.isUTC=Wt,bn.zoneAbbr=function(){return this._isUTC?"UTC":""},bn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},bn.dates=S("dates accessor is deprecated. Use date instead.",pn),bn.months=S("months accessor is deprecated. Use month instead",Fe),bn.years=S("years accessor is deprecated. Use year instead",Ee),bn.zone=S("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),bn.isDSTShifted=S("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e={};if(_(e,this),(e=Et(e))._a){var t=e._isUTC?h(e._a):At(e._a);this._isDSTShifted=this.isValid()&&k(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted});var Mn=j.prototype;function xn(e,t,n,r){var i=ht(),o=h().set(r,t);return i[n](o,e)}function kn(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return xn(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=xn(e,r,n,"month");return i}function Dn(e,t,n,r){"boolean"==typeof e?(u(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,u(t)&&(n=t,t=void 0),t=t||"");var i,o=ht(),a=e?o._week.dow:0;if(null!=n)return xn(t,(n+a)%7,r,"day");var s=[];for(i=0;i<7;i++)s[i]=xn(t,(i+a)%7,r,"day");return s}Mn.calendar=function(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return T(r)?r.call(t,n):r},Mn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},Mn.invalidDate=function(){return this._invalidDate},Mn.ordinal=function(e){return this._ordinal.replace("%d",e)},Mn.preparse=wn,Mn.postformat=wn,Mn.relativeTime=function(e,t,n,r){var i=this._relativeTime[n];return T(i)?i(e,t,n,r):i.replace(/%d/i,e)},Mn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return T(n)?n(t):n.replace(/%s/i,t)},Mn.set=function(e){var t,n;for(n in e)T(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Mn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Pe).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},Mn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Pe.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Mn.monthsParse=function(e,t,n){var r,i,o;if(this._monthsParseExact)return function(e,t,n){var r,i,o,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)o=h([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=Ce.call(this._shortMonthsParse,a))?i:null:-1!==(i=Ce.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=Ce.call(this._shortMonthsParse,a))?i:-1!==(i=Ce.call(this._longMonthsParse,a))?i:null:-1!==(i=Ce.call(this._longMonthsParse,a))?i:-1!==(i=Ce.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=h([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}},Mn.monthsRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Be.call(this),e?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=Re),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Mn.monthsShortRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Be.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=ze),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Mn.week=function(e){return qe(e,this._week.dow,this._week.doy).week},Mn.firstDayOfYear=function(){return this._week.doy},Mn.firstDayOfWeek=function(){return this._week.dow},Mn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ve(n,this._week.dow):e?n[e.day()]:n},Mn.weekdaysMin=function(e){return!0===e?Ve(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},Mn.weekdaysShort=function(e){return!0===e?Ve(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},Mn.weekdaysParse=function(e,t,n){var r,i,o;if(this._weekdaysParseExact)return function(e,t,n){var r,i,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=h([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=Ce.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ce.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ce.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Ce.call(this._weekdaysParse,a))?i:-1!==(i=Ce.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ce.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ce.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ce.call(this._weekdaysParse,a))?i:-1!==(i=Ce.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ce.call(this._minWeekdaysParse,a))?i:-1!==(i=Ce.call(this._weekdaysParse,a))?i:-1!==(i=Ce.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=h([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}},Mn.weekdaysRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||et.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=Qe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Mn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||et.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ze),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Mn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||et.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Xe),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Mn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Mn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},dt("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===x(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),i.lang=S("moment.lang is deprecated. Use moment.locale instead.",dt),i.langData=S("moment.langData is deprecated. Use moment.localeData instead.",ht);var Sn=Math.abs;function Ln(e,t,n,r){var i=Vt(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Cn(e){return e<0?Math.floor(e):Math.ceil(e)}function En(e){return 4800*e/146097}function Tn(e){return 146097*e/4800}function An(e){return function(){return this.as(e)}}var jn=An("ms"),In=An("s"),Pn=An("m"),On=An("h"),Nn=An("d"),Yn=An("w"),Fn=An("M"),zn=An("Q"),Rn=An("y");function Bn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Hn=Bn("milliseconds"),Un=Bn("seconds"),Wn=Bn("minutes"),qn=Bn("hours"),$n=Bn("days"),Vn=Bn("months"),Gn=Bn("years"),Kn=Math.round,Jn={ss:44,s:45,m:45,h:22,d:26,M:11},Qn=Math.abs;function Zn(e){return(e>0)-(e<0)||+e}function Xn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Qn(this._milliseconds)/1e3,r=Qn(this._days),i=Qn(this._months);e=M(n/60),t=M(e/60),n%=60,e%=60;var o=M(i/12),a=i%=12,s=r,u=t,l=e,c=n?n.toFixed(3).replace(/\.?0+$/,""):"",d=this.asSeconds();if(!d)return"P0D";var f=d<0?"-":"",h=Zn(this._months)!==Zn(d)?"-":"",p=Zn(this._days)!==Zn(d)?"-":"",m=Zn(this._milliseconds)!==Zn(d)?"-":"";return f+"P"+(o?h+o+"Y":"")+(a?h+a+"M":"")+(s?p+s+"D":"")+(u||l||c?"T":"")+(u?m+u+"H":"")+(l?m+l+"M":"")+(c?m+c+"S":"")}var er=Nt.prototype;return er.isValid=function(){return this._isValid},er.abs=function(){var e=this._data;return this._milliseconds=Sn(this._milliseconds),this._days=Sn(this._days),this._months=Sn(this._months),e.milliseconds=Sn(e.milliseconds),e.seconds=Sn(e.seconds),e.minutes=Sn(e.minutes),e.hours=Sn(e.hours),e.months=Sn(e.months),e.years=Sn(e.years),this},er.add=function(e,t){return Ln(this,e,t,1)},er.subtract=function(e,t){return Ln(this,e,t,-1)},er.as=function(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=O(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+En(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Tn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}},er.asMilliseconds=jn,er.asSeconds=In,er.asMinutes=Pn,er.asHours=On,er.asDays=Nn,er.asWeeks=Yn,er.asMonths=Fn,er.asQuarters=zn,er.asYears=Rn,er.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*x(this._months/12):NaN},er._bubble=function(){var e,t,n,r,i,o=this._milliseconds,a=this._days,s=this._months,u=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*Cn(Tn(s)+a),a=0,s=0),u.milliseconds=o%1e3,e=M(o/1e3),u.seconds=e%60,t=M(e/60),u.minutes=t%60,n=M(t/60),u.hours=n%24,a+=M(n/24),i=M(En(a)),s+=i,a-=Cn(Tn(i)),r=M(s/12),s%=12,u.days=a,u.months=s,u.years=r,this},er.clone=function(){return Vt(this)},er.get=function(e){return e=O(e),this.isValid()?this[e+"s"]():NaN},er.milliseconds=Hn,er.seconds=Un,er.minutes=Wn,er.hours=qn,er.days=$n,er.weeks=function(){return M(this.days()/7)},er.months=Vn,er.years=Gn,er.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=function(e,t,n){var r=Vt(e).abs(),i=Kn(r.as("s")),o=Kn(r.as("m")),a=Kn(r.as("h")),s=Kn(r.as("d")),u=Kn(r.as("M")),l=Kn(r.as("y")),c=i<=Jn.ss&&["s",i]||i<Jn.s&&["ss",i]||o<=1&&["m"]||o<Jn.m&&["mm",o]||a<=1&&["h"]||a<Jn.h&&["hh",a]||s<=1&&["d"]||s<Jn.d&&["dd",s]||u<=1&&["M"]||u<Jn.M&&["MM",u]||l<=1&&["y"]||["yy",l];return c[2]=t,c[3]=+e>0,c[4]=n,function(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}.apply(null,c)}(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},er.toISOString=Xn,er.toString=Xn,er.toJSON=Xn,er.locale=tn,er.localeData=rn,er.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Xn),er.lang=nn,W("X",0,0,"unix"),W("x",0,0,"valueOf"),ce("x",oe),ce("X",/[+-]?\d+(\.\d{1,3})?/),pe("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),pe("x",function(e,t,n){n._d=new Date(x(e))}),i.version="2.24.0",t=At,i.fn=bn,i.min=function(){return Pt("isBefore",[].slice.call(arguments,0))},i.max=function(){return Pt("isAfter",[].slice.call(arguments,0))},i.now=function(){return Date.now?Date.now():+new Date},i.utc=h,i.unix=function(e){return At(1e3*e)},i.months=function(e,t){return kn(e,t,"months")},i.isDate=l,i.locale=dt,i.invalid=g,i.duration=Vt,i.isMoment=w,i.weekdays=function(e,t,n){return Dn(e,t,n,"weekdays")},i.parseZone=function(){return At.apply(null,arguments).parseZone()},i.localeData=ht,i.isDuration=Yt,i.monthsShort=function(e,t){return kn(e,t,"monthsShort")},i.weekdaysMin=function(e,t,n){return Dn(e,t,n,"weekdaysMin")},i.defineLocale=ft,i.updateLocale=function(e,t){if(null!=t){var n,r,i=at;null!=(r=ct(e))&&(i=r._config),t=A(i,t),(n=new j(t)).parentLocale=st[e],st[e]=n,dt(e)}else null!=st[e]&&(null!=st[e].parentLocale?st[e]=st[e].parentLocale:null!=st[e]&&delete st[e]);return st[e]},i.locales=function(){return L(st)},i.weekdaysShort=function(e,t,n){return Dn(e,t,n,"weekdaysShort")},i.normalizeUnits=O,i.relativeTimeRounding=function(e){return void 0===e?Kn:"function"==typeof e&&(Kn=e,!0)},i.relativeTimeThreshold=function(e,t){return void 0!==Jn[e]&&(void 0===t?Jn[e]:(Jn[e]=t,"s"===e&&(Jn.ss=t-1),!0))},i.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},i.prototype=bn,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},i}()}).call(this,n(42)(e))},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(365)),r(n(366)),r(n(367)),r(n(368)),r(n(369)),r(n(370)),r(n(23)),r(n(371)),r(n(372)),r(n(373)),r(n(374)),r(n(375)),r(n(376)),r(n(377)),r(n(378)),r(n(379)),r(n(380))},function(e,t,n){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),u=!o&&/WebKit\//.test(e),l=u&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),d=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),m=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),y=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),_=m||/Mac/.test(t),v=/\bCrOS\b/.test(e),b=/win/i.test(t),w=d&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(d=!1,u=!0);var M=_&&(l||d&&(null==w||w<12.11)),x=n||a&&s>=9;function k(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var D,S=function(e,t){var n=e.className,r=k(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 L(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function C(e,t){return L(e).appendChild(t)}function E(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.length;++o)i.appendChild(t[o]);return i}function T(e,t,n,r){var i=E(e,t,n,r);return i.setAttribute("role","presentation"),i}function A(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function j(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function I(e,t){var n=e.className;k(t).test(n)||(e.className+=(n?" ":"")+t)}function P(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!k(n[r]).test(t)&&(t+=" "+n[r]);return t}D=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var O=function(e){e.select()};function N(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Y(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function F(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,a=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?O=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(O=function(e){try{e.select()}catch(e){}});var z=function(){this.id=null};function R(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}z.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var B=30,H={toString:function(){return"CodeMirror.Pass"}},U={scroll:!1},W={origin:"*mouse"},q={origin:"+move"};function $(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var V=[""];function G(e){for(;V.length<=e;)V.push(K(V)+" ");return V[e]}function K(e){return e[e.length-1]}function J(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Q(){}function Z(e,t){var n;return Object.create?n=Object.create(e):(Q.prototype=e,n=new Q),t&&Y(t,n),n}var X=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||X.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\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 ie(e){return e.charCodeAt(0)>=768&&re.test(e)}function oe(e,t,n){for(;(n<0?t>0:t<e.length)&&ie(e.charAt(t));)t+=n;return t}function ae(e,t,n){for(var r=t>n?-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}}var se=null;function ue(e,t,n){var r;se=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:se=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:se=i)}return null!=r?r:se}var le=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,i=/[LRr]/,o=/[Lb1n]/,a=/[1n]/;function s(e,t,n){this.level=e,this.from=t,this.to=n}return function(u,l){var c,d="ltr"==l?"L":"R";if(0==u.length||"ltr"==l&&!n.test(u))return!1;for(var f=u.length,h=[],p=0;p<f;++p)h.push((c=u.charCodeAt(p))<=247?e.charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?t.charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var m=0,g=d;m<f;++m){var y=h[m];"m"==y?h[m]=g:g=y}for(var _=0,v=d;_<f;++_){var b=h[_];"1"==b&&"r"==v?h[_]="n":i.test(b)&&(v=b,"r"==b&&(h[_]="R"))}for(var w=1,M=h[0];w<f-1;++w){var x=h[w];"+"==x&&"1"==M&&"1"==h[w+1]?h[w]="1":","!=x||M!=h[w+1]||"1"!=M&&"n"!=M||(h[w]=M),M=x}for(var k=0;k<f;++k){var D=h[k];if(","==D)h[k]="N";else if("%"==D){var S=void 0;for(S=k+1;S<f&&"%"==h[S];++S);for(var L=k&&"!"==h[k-1]||S<f&&"1"==h[S]?"1":"N",C=k;C<S;++C)h[C]=L;k=S-1}}for(var E=0,T=d;E<f;++E){var A=h[E];"L"==T&&"1"==A?h[E]="L":i.test(A)&&(T=A)}for(var j=0;j<f;++j)if(r.test(h[j])){var I=void 0;for(I=j+1;I<f&&r.test(h[I]);++I);for(var P="L"==(j?h[j-1]:d),O="L"==(I<f?h[I]:d),N=P==O?P?"L":"R":d,Y=j;Y<I;++Y)h[Y]=N;j=I-1}for(var F,z=[],R=0;R<f;)if(o.test(h[R])){var B=R;for(++R;R<f&&o.test(h[R]);++R);z.push(new s(0,B,R))}else{var H=R,U=z.length;for(++R;R<f&&"L"!=h[R];++R);for(var W=H;W<R;)if(a.test(h[W])){H<W&&z.splice(U,0,new s(1,H,W));var q=W;for(++W;W<R&&a.test(h[W]);++W);z.splice(U,0,new s(2,q,W)),H=W}else++W;H<R&&z.splice(U,0,new s(1,H,R))}return"ltr"==l&&(1==z[0].level&&(F=u.match(/^\s+/))&&(z[0].from=F[0].length,z.unshift(new s(0,0,F[0].length))),1==K(z).level&&(F=u.match(/\s+$/))&&(K(z).to-=F[0].length,z.push(new s(0,f-F[0].length,f)))),"rtl"==l?z.reverse():z}}();function ce(e,t){var n=e.order;return null==n&&(n=e.order=le(e.text,t)),n}var de=[],fe=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||de).concat(n)}};function he(e,t){return e._handlers&&e._handlers[t]||de}function pe(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=R(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function me(e,t){var n=he(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function ge(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),me(e,n||t.type,e,t),Me(t)||t.codemirrorIgnore}function ye(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==R(n,t[r])&&n.push(t[r])}function _e(e,t){return he(e,t).length>0}function ve(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){pe(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function we(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Me(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function xe(e){be(e),we(e)}function ke(e){return e.target||e.srcElement}function De(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),_&&e.ctrlKey&&1==t&&(t=3),t}var Se,Le,Ce=function(){if(a&&s<9)return!1;var e=E("div");return"draggable"in e||"dragDrop"in e}();function Ee(e){if(null==Se){var t=E("span","");C(e,E("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Se=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Se?E("span",""):E("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Te(e){if(null!=Le)return Le;var t=C(e,document.createTextNode("AخA")),n=D(t,0,1).getBoundingClientRect(),r=D(t,1,2).getBoundingClientRect();return L(e),!(!n||n.left==n.right)&&(Le=r.right-n.right<3)}var Ae,je=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/)},Ie=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)},Pe="oncopy"in(Ae=E("div"))||(Ae.setAttribute("oncopy","return;"),"function"==typeof Ae.oncopy),Oe=null,Ne={},Ye={};function Fe(e){if("string"==typeof e&&Ye.hasOwnProperty(e))e=Ye[e];else if(e&&"string"==typeof e.name&&Ye.hasOwnProperty(e.name)){var t=Ye[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 Fe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Fe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function ze(e,t){t=Fe(t);var n=Ne[t.name];if(!n)return ze(e,"text/plain");var r=n(e,t);if(Re.hasOwnProperty(t.name)){var i=Re[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 Re={};function Be(e,t){var n=Re.hasOwnProperty(e)?Re[e]:Re[e]={};Y(t,n)}function He(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 Ue(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 We(e,t,n){return!e.startState||e.startState(t,n)}var qe=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 $e(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<o){n=i;break}t-=o}return n.lines[t]}function Ve(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function Ge(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function Ke(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Je(e){if(null==e.parent)return null;for(var t=e.parent,n=R(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Qe(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a],u=s.height;if(t<u)break;t-=u}return n+a}function Ze(e,t){return t>=e.first&&t<e.first+e.size}function Xe(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,n){if(void 0===n&&(n=null),!(this instanceof et))return new et(e,t,n);this.line=e,this.ch=t,this.sticky=n}function tt(e,t){return e.line-t.line||e.ch-t.ch}function nt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function rt(e){return et(e.line,e.ch)}function it(e,t){return tt(e,t)<0?t:e}function ot(e,t){return tt(e,t)<0?e:t}function at(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function st(e,t){if(t.line<e.first)return et(e.first,0);var n=e.first+e.size-1;return t.line>n?et(n,$e(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,$e(e,t.line).text.length)}function ut(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=st(e,t[r]);return n}qe.prototype.eol=function(){return this.pos>=this.string.length},qe.prototype.sol=function(){return this.pos==this.lineStart},qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},qe.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},qe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},qe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},qe.prototype.skipToEnd=function(){this.pos=this.string.length},qe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},qe.prototype.backUp=function(e){this.pos-=e},qe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},qe.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},qe.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return!1!==t&&(this.pos+=e.length),!0},qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},qe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},qe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},qe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var lt=function(e,t){this.state=e,this.lookAhead=t},ct=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 dt(e,t,n,r){var i=[e.state.modeGen],o={};bt(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],u=1,l=0;n.state=!0,bt(e,t.text,s.mode,n,function(e,t){for(var n=u;l<e;){var r=i[u];r>e&&i.splice(u,1,e,i[u+1],r),u+=2,l=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,u-n,e,"overlay "+t),u=n+2;else for(;n<u;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}},o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},u=0;u<e.state.overlays.length;++u)s(u);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function ft(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=ht(e,Je(t)),i=t.text.length>e.options.maxHighlightLength&&He(e.doc.mode,r.state),o=dt(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 ht(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new ct(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var u=$e(o,s-1),l=u.stateAfter;if(l&&(!n||s+(l instanceof lt?l.lookAhead:0)<=o.modeFrontier))return s;var c=F(u.text,null,e.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}(e,t,n),a=o>r.first&&$e(r,o-1).stateAfter,s=a?ct.fromSaved(r,a,o):new ct(r,We(r.mode),o);return r.iter(o,t,function(n){pt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()}),n&&(r.modeFrontier=s.line),s}function pt(e,t,n,r){var i=e.doc.mode,o=new qe(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&mt(i,n.state);!o.eol();)gt(i,o,n.state),o.start=o.pos}function mt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ue(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function gt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Ue(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}ct.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ct.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}},ct.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ct.fromSaved=function(e,t,n){return t instanceof lt?new ct(e,He(e.mode,t.state),n,t.lookAhead):new ct(e,He(e.mode,t),n)},ct.prototype.save=function(e){var t=!1!==e?He(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new lt(t,this.maxLookAhead):t};var yt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function _t(e,t,n,r){var i,o=e.doc,a=o.mode;t=st(o,t);var s,u=$e(o,t.line),l=ht(e,t.line,n),c=new qe(u.text,e.options.tabSize,l);for(r&&(s=[]);(r||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=gt(a,c,l.state),r&&s.push(new yt(c,i,He(o.mode,l.state)));return r?s:new yt(c,i,l.state)}function vt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function bt(e,t,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var u,l=0,c=null,d=new qe(t,e.options.tabSize,r),f=e.options.addModeClass&&[null];for(""==t&&vt(mt(n,r.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(s=!1,a&&pt(e,t,r,d.pos),d.pos=t.length,u=null):u=vt(gt(n,d,r.state,f),o),f){var h=f[0].name;h&&(u="m-"+(u?h+" "+u:h))}if(!s||c!=u){for(;l<d.start;)l=Math.min(d.start,l+5e3),i(l,c);c=u}d.start=d.pos}for(;l<d.pos;){var p=Math.min(d.pos,l+5e3);i(p,c),l=p}}var wt=!1,Mt=!1;function xt(e,t,n){this.marker=e,this.from=t,this.to=n}function kt(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Dt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function St(e,t){if(t.full)return null;var n=Ze(e,t.from.line)&&$e(e,t.from.line).markedSpans,r=Ze(e,t.to.line)&&$e(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==tt(t.from,t.to),s=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(s||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var u=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new xt(a,o.from,u?null:o.to))}}return r}(n,i,a),u=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(s||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var u=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new xt(a,u?null:o.from-t,null==o.to?null:o.to-t))}}return r}(r,o,a),l=1==t.text.length,c=K(t.text).length+(l?i:0);if(s)for(var d=0;d<s.length;++d){var f=s[d];if(null==f.to){var h=kt(u,f.marker);h?l&&(f.to=null==h.to?null:h.to+c):f.to=i}}if(u)for(var p=0;p<u.length;++p){var m=u[p];if(null!=m.to&&(m.to+=c),null==m.from){var g=kt(s,m.marker);g||(m.from=c,l&&(s||(s=[])).push(m))}else m.from+=c,l&&(s||(s=[])).push(m)}s&&(s=Lt(s)),u&&u!=s&&(u=Lt(u));var y=[s];if(!l){var _,v=t.text.length-2;if(v>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(_||(_=[])).push(new xt(s[b].marker,null,null));for(var w=0;w<v;++w)y.push(_);y.push(u)}return y}function Lt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ct(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Et(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Tt(e){return e.inclusiveLeft?-1:0}function At(e){return e.inclusiveRight?1:0}function jt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=tt(r.from,i.from)||Tt(e)-Tt(t);if(o)return-o;var a=tt(r.to,i.to)||At(e)-At(t);return a||t.id-e.id}function It(e,t){var n,r=Mt&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||jt(n,i.marker)<0)&&(n=i.marker);return n}function Pt(e){return It(e,!0)}function Ot(e){return It(e,!1)}function Nt(e,t){var n,r=Mt&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||jt(n,o.marker)<0)&&(n=o.marker)}return n}function Yt(e,t,n,r,i){var o=$e(e,t),a=Mt&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var u=a[s];if(u.marker.collapsed){var l=u.marker.find(0),c=tt(l.from,n)||Tt(u.marker)-Tt(i),d=tt(l.to,r)||At(u.marker)-At(i);if(!(c>=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?tt(l.to,n)>=0:tt(l.to,n)>0)||c>=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?tt(l.from,r)<=0:tt(l.from,r)<0)))return!0}}}function Ft(e){for(var t;t=Pt(e);)e=t.find(-1,!0).line;return e}function zt(e,t){var n=$e(e,t),r=Ft(n);return n==r?t:Je(r)}function Rt(e,t){if(t>e.lastLine())return t;var n,r=$e(e,t);if(!Bt(e,r))return t;for(;n=Ot(r);)r=n.find(1,!0).line;return Je(r)+1}function Bt(e,t){var n=Mt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Ht(e,t,r))return!0}}function Ht(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Ht(e,r.line,kt(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Ht(e,t,i))return!0}function Ut(e){e=Ft(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;t+=s.height}return t}function Wt(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Pt(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=Ot(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,r=o.to.line,n+=r.text.length-o.to.ch}return n}function qt(e){var t=e.display,n=e.doc;t.maxLine=$e(n,n.first),t.maxLineLength=Wt(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=Wt(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var $t=function(e,t,n){this.text=e,Et(this,t),this.height=n?n(this):1};function Vt(e){e.parent=null,Ct(e)}$t.prototype.lineNo=function(){return Je(this)},ve($t);var Gt={},Kt={};function Jt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Kt:Gt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Qt(e,t){var n=T("span",null,null,u?"padding-right: .1px":null),r={pre:T("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=Xt,Te(e.display.measure)&&(a=ce(o,e.doc.direction))&&(r.addToken=en(r.addToken,a)),r.map=[];var s=t!=e.display.externalMeasured&&Je(o);nn(o,r,ft(e,o,s)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=P(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=P(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ee(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(u){var l=r.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return me(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=P(r.pre.className,r.textClass||"")),r}function Zt(e){var t=E("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Xt(e,t,n,r,i,o,u){if(t){var l,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}(t,e.trailingSpace):t,d=e.cm.state.specialChars,f=!1;if(d.test(t)){l=document.createDocumentFragment();for(var h=0;;){d.lastIndex=h;var p=d.exec(t),m=p?p.index-h:t.length-h;if(m){var g=document.createTextNode(c.slice(h,h+m));a&&s<9?l.appendChild(E("span",[g])):l.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!p)break;h+=m+1;var y=void 0;if("\t"==p[0]){var _=e.cm.options.tabSize,v=_-e.col%_;(y=l.appendChild(E("span",G(v),"cm-tab"))).setAttribute("role","presentation"),y.setAttribute("cm-text","\t"),e.col+=v}else"\r"==p[0]||"\n"==p[0]?((y=l.appendChild(E("span","\r"==p[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((y=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),a&&s<9?l.appendChild(E("span",[y])):l.appendChild(y),e.col+=1);e.map.push(e.pos,e.pos+1,y),e.pos++}}else e.col+=t.length,l=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,l),a&&s<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||i||f||o){var b=n||"";r&&(b+=r),i&&(b+=i);var w=E("span",[l],b,o);if(u)for(var M in u)u.hasOwnProperty(M)&&"style"!=M&&"class"!=M&&w.setAttribute(M,u[M]);return e.content.appendChild(w)}e.content.appendChild(l)}}function en(e,t){return function(n,r,i,o,a,s,u){i=i?i+" cm-force-border":"cm-force-border";for(var l=n.pos,c=l+r.length;;){for(var d=void 0,f=0;f<t.length&&!((d=t[f]).to>l&&d.from<=l);f++);if(d.to>=c)return e(n,r,i,o,a,s,u);e(n,r.slice(0,d.to-l),i,o,null,s,u),o=null,r=r.slice(d.to-l),l=d.to}}}function tn(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 nn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,u,l,c,d,f,h=i.length,p=0,m=1,g="",y=0;;){if(y==p){u=l=c=s="",f=null,d=null,y=1/0;for(var _=[],v=void 0,b=0;b<r.length;++b){var w=r[b],M=w.marker;if("bookmark"==M.type&&w.from==p&&M.widgetNode)_.push(M);else if(w.from<=p&&(null==w.to||w.to>p||M.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&y>w.to&&(y=w.to,l=""),M.className&&(u+=" "+M.className),M.css&&(s=(s?s+";":"")+M.css),M.startStyle&&w.from==p&&(c+=" "+M.startStyle),M.endStyle&&w.to==y&&(v||(v=[])).push(M.endStyle,w.to),M.title&&((f||(f={})).title=M.title),M.attributes)for(var x in M.attributes)(f||(f={}))[x]=M.attributes[x];M.collapsed&&(!d||jt(d.marker,M)<0)&&(d=w)}else w.from>p&&y>w.from&&(y=w.from)}if(v)for(var k=0;k<v.length;k+=2)v[k+1]==y&&(l+=" "+v[k]);if(!d||d.from==p)for(var D=0;D<_.length;++D)tn(t,0,_[D]);if(d&&(d.from||0)==p){if(tn(t,(null==d.to?h+1:d.to)-p,d.marker,null==d.from),null==d.to)return;d.to==p&&(d=!1)}}if(p>=h)break;for(var S=Math.min(h,y);;){if(g){var L=p+g.length;if(!d){var C=L>S?g.slice(0,S-p):g;t.addToken(t,C,a?a+u:u,c,p+C.length==y?l:"",s,f)}if(L>=S){g=g.slice(S-p),p=S;break}p=L,c=""}g=i.slice(o,o=n[m++]),a=Jt(n[m++],t.cm.options)}}else for(var E=1;E<n.length;E+=2)t.addToken(t,i.slice(o,o=n[E]),Jt(n[E+1],t.cm.options))}function rn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=Ot(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Je(K(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Bt(e,t)}function on(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new rn(e.doc,$e(e.doc,o),o);r=o+a.size,i.push(a)}return i}var an=null,sn=null;function un(e,t){var n=he(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);an?r=an.delayedCallbacks:sn?r=sn:(r=sn=[],setTimeout(ln,0));for(var o=function(e){r.push(function(){return n[e].apply(null,i)})},a=0;a<n.length;++a)o(a)}}function ln(){var e=sn;sn=null;for(var t=0;t<e.length;++t)e[t]()}function cn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?hn(e,t):"gutter"==o?mn(e,t,n,r):"class"==o?pn(e,t):"widget"==o&&gn(e,t,r)}t.changes=null}function dn(e){return e.node==e.text&&(e.node=E("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function fn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Qt(e,t)}function hn(e,t){var n=t.text.className,r=fn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,pn(e,t)):n&&(t.text.className=n)}function pn(e,t){!function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=dn(t);t.background=r.insertBefore(E("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?dn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function mn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=dn(t);t.gutterBackground=E("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=dn(t),s=t.gutter=E("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(E("div",Xe(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var u=0;u<e.display.gutterSpecs.length;++u){var l=e.display.gutterSpecs[u].className,c=o.hasOwnProperty(l)&&o[l];c&&s.appendChild(E("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[l]+"px; width: "+r.gutterWidth[l]+"px"))}}}function gn(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild,i=void 0;r;r=i)i=r.nextSibling,"CodeMirror-linewidget"==r.className&&t.node.removeChild(r);_n(e,t,n)}function yn(e,t,n,r){var i=fn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),pn(e,t),mn(e,t,n,r),_n(e,t,r),t.node}function _n(e,t,n){if(vn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)vn(e,t.rest[r],t,n,!1)}function vn(e,t,n,r,i){if(t.widgets)for(var o=dn(n),a=0,s=t.widgets;a<s.length;++a){var u=s[a],l=E("div",[u.node],"CodeMirror-linewidget");u.handleMouseEvents||l.setAttribute("cm-ignore-events","true"),bn(u,l,n,r),e.display.input.setUneditable(l),i&&u.above?o.insertBefore(l,n.gutter||n.text):o.appendChild(l),un(u,"redraw")}}function bn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function wn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!A(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),C(t.display.measure,E("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Mn(e,t){for(var n=ke(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function xn(e){return e.lineSpace.offsetTop}function kn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Dn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=C(e.measure,E("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Sn(e){return B-e.display.nativeBarWidth}function Ln(e){return e.display.scroller.clientWidth-Sn(e)-e.display.barWidth}function Cn(e){return e.display.scroller.clientHeight-Sn(e)-e.display.barHeight}function En(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(Je(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Tn(e,t,n,r){return In(e,jn(e,t),n,r)}function An(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ur(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function jn(e,t){var n=Je(t),r=An(e,n);r&&!r.text?r=null:r&&r.changes&&(cn(e,r,n,rr(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=Je(t=Ft(t)),r=e.display.externalMeasured=new rn(e.doc,t,n);r.lineN=n;var i=r.built=Qt(e,r);return r.text=i.pre,C(e.display.lineMeasure,i.pre),r}(e,t));var i=En(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function In(e,t,n,r,i){t.before&&(n=-1);var o,u=n+(r||"");return t.cache.hasOwnProperty(u)?o=t.cache[u]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,i=r&&Ln(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var u=a[s],l=a[s+1];Math.abs(u.bottom-l.bottom)>2&&o.push((u.bottom+l.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=Nn(t.map,n,r),u=o.node,l=o.start,c=o.end,d=o.collapse;if(3==u.nodeType){for(var f=0;f<4;f++){for(;l&&ie(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+c<o.coverEnd&&ie(t.line.text.charAt(o.coverStart+c));)++c;if((i=a&&s<9&&0==l&&c==o.coverEnd-o.coverStart?u.parentNode.getBoundingClientRect():Yn(D(u,l,c).getClientRects(),r)).left||i.right||0==l)break;c=l,l-=1,d="right"}a&&s<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Oe)return Oe;var t=C(e,E("span","x")),n=t.getBoundingClientRect(),r=D(t,0,1).getBoundingClientRect();return Oe=Math.abs(n.left-r.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var h;l>0&&(d=r="right"),i=e.options.lineWrapping&&(h=u.getClientRects()).length>1?h["right"==r?h.length-1:0]:u.getBoundingClientRect()}if(a&&s<9&&!l&&(!i||!i.left&&!i.right)){var p=u.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+nr(e.display),top:p.top,bottom:p.bottom}:On}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,y=(m+g)/2,_=t.view.measure.heights,v=0;v<_.length-1&&!(y<_[v]);v++);var b=v?_[v-1]:0,w=_[v],M={left:("right"==d?i.right:i.left)-t.rect.left,right:("left"==d?i.left:i.right)-t.rect.left,top:b,bottom:w};return i.left||i.right||(M.bogus=!0),e.options.singleCursorHeightPerLine||(M.rtop=m,M.rbottom=g),M}(e,t,n,r)).bogus||(t.cache[u]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Pn,On={left:0,right:0,top:0,bottom:0};function Nn(e,t,n){for(var r,i,o,a,s,u,l=0;l<e.length;l+=3)if(s=e[l],u=e[l+1],t<s?(i=0,o=1,a="left"):t<u?o=1+(i=t-s):(l==e.length-3||t==u&&e[l+3]>t)&&(i=(o=u-s)-1,t>=u&&(a="right")),null!=i){if(r=e[l+2],s==u&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[2+(l-=3)],a="left";if("right"==n&&i==u-s)for(;l<e.length-3&&e[l+3]==e[l+4]&&!e[l+5].insertLeft;)r=e[(l+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:u}}function Yn(e,t){var n=On;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Fn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function zn(e){e.display.externalMeasure=null,L(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Fn(e.display.view[t])}function Rn(e){zn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Bn(){return c&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Hn(){return c&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Un(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=wn(e.widgets[n]));return t}function Wn(e,t,n,r,i){if(!i){var o=Un(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=Ut(t);if("local"==r?a+=xn(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:Hn());var u=s.left+("window"==r?0:Bn());n.left+=u,n.right+=u}return n.top+=a,n.bottom+=a,n}function qn(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=Bn(),i-=Hn();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function $n(e,t,n,r,i){return r||(r=$e(e.doc,t.line)),Wn(e,r,Tn(e,r,t.ch,i),n)}function Vn(e,t,n,r,i,o){function a(t,a){var s=In(e,i,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,Wn(e,r,s,n)}r=r||$e(e.doc,t.line),i||(i=jn(e,r));var s=ce(r,e.doc.direction),u=t.ch,l=t.sticky;if(u>=r.text.length?(u=r.text.length,l="before"):u<=0&&(u=0,l="after"),!s)return a("before"==l?u-1:u,"before"==l);function c(e,t,n){var r=s[t],i=1==r.level;return a(n?e-1:e,i!=n)}var d=ue(s,u,l),f=se,h=c(u,d,"before"==l);return null!=f&&(h.other=c(u,f,"before"!=l)),h}function Gn(e,t){var n=0;t=st(e.doc,t),e.options.lineWrapping||(n=nr(e.display)*t.ch);var r=$e(e.doc,t.line),i=Ut(r)+xn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Kn(e,t,n,r,i){var o=et(e,t,n);return o.xRel=i,r&&(o.outside=!0),o}function Jn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Kn(r.first,0,null,!0,-1);var i=Qe(r,n),o=r.first+r.size-1;if(i>o)return Kn(r.first+r.size-1,$e(r,o).text.length,null,!0,1);t<0&&(t=0);for(var a=$e(r,i);;){var s=er(e,a,i,t,n),u=Nt(a,s.ch+(s.xRel>0?1:0));if(!u)return s;var l=u.find(1);if(l.line==i)return l;a=$e(r,i=l.line)}}function Qn(e,t,n,r){r-=Un(t);var i=t.text.length,o=ae(function(t){return In(e,n,t-1).bottom<=r},i,0);return i=ae(function(t){return In(e,n,t).top>r},o,i),{begin:o,end:i}}function Zn(e,t,n,r){n||(n=jn(e,t));var i=Wn(e,t,In(e,n,r),"line").top;return Qn(e,t,n,i)}function Xn(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-=Ut(t);var o=jn(e,t),a=Un(t),s=0,u=t.text.length,l=!0,c=ce(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?function(e,t,n,r,i,o,a){var s=Qn(e,t,r,a),u=s.begin,l=s.end;/\s/.test(t.text.charAt(l-1))&&l--;for(var c=null,d=null,f=0;f<i.length;f++){var h=i[f];if(!(h.from>=l||h.to<=u)){var p=1!=h.level,m=In(e,r,p?Math.min(l,h.to)-1:Math.max(u,h.from)).right,g=m<o?o-m+1e9:m-o;(!c||d>g)&&(c=h,d=g)}}return c||(c=i[i.length-1]),c.from<u&&(c={from:u,to:c.to,level:c.level}),c.to>l&&(c={from:c.from,to:l,level:c.level}),c}:function(e,t,n,r,i,o,a){var s=ae(function(s){var u=i[s],l=1!=u.level;return Xn(Vn(e,et(n,l?u.to:u.from,l?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),u=i[s];if(s>0){var l=1!=u.level,c=Vn(e,et(n,l?u.from:u.to,l?"after":"before"),"line",t,r);Xn(c,o,a,!0)&&c.top>a&&(u=i[s-1])}return u})(e,t,n,o,c,r,i);l=1!=d.level,s=l?d.from:d.to-1,u=l?d.to:d.from-1}var f,h,p=null,m=null,g=ae(function(t){var n=In(e,o,t);return n.top+=a,n.bottom+=a,!!Xn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,m=n),!0)},s,u),y=!1;if(m){var _=r-m.left<m.right-r,v=_==l;g=p+(v?0:1),h=v?"after":"before",f=_?m.left:m.right}else{l||g!=u&&g!=s||g++,h=0==g?"after":g==t.text.length?"before":In(e,o,g-(l?1:0)).bottom+a<=i==l?"after":"before";var b=Vn(e,et(n,g,h),"line",t,o);f=b.left,y=i<b.top||i>=b.bottom}return g=oe(t.text,g,1),Kn(n,g,h,y,r-f)}function tr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Pn){Pn=E("pre");for(var t=0;t<49;++t)Pn.appendChild(document.createTextNode("x")),Pn.appendChild(E("br"));Pn.appendChild(document.createTextNode("x"))}C(e.measure,Pn);var n=Pn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),L(e.measure),n||1}function nr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=E("span","xxxxxxxxxx"),n=E("pre",[t]);C(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function rr(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:ir(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ir(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function or(e){var t=tr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/nr(e.display)-3);return function(i){if(Bt(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function ar(e){var t=e.doc,n=or(e);t.iter(function(e){var t=n(e);t!=e.height&&Ke(e,t)})}function sr(e,t,n,r){var i=e.display;if(!n&&"true"==ke(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(t){return null}var u,l=Jn(e,o,a);if(r&&1==l.xRel&&(u=$e(e.doc,l.line).text).length==l.ch){var c=F(u,u.length,e.options.tabSize)-u.length;l=et(l.line,Math.max(0,Math.round((o-Dn(e.display).left)/nr(e.display))-c))}return l}function ur(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;r<n.length;r++)if((t-=n[r].size)<0)return r}function lr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Mt&&zt(e.doc,t)<i.viewTo&&dr(e);else if(n<=i.viewFrom)Mt&&Rt(e.doc,n+r)>i.viewFrom?dr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)dr(e);else if(t<=i.viewFrom){var o=fr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):dr(e)}else if(n>=i.viewTo){var a=fr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):dr(e)}else{var s=fr(e,t,t,-1),u=fr(e,n,n+r,1);s&&u?(i.view=i.view.slice(0,s.index).concat(on(e,s.lineN,u.lineN)).concat(i.view.slice(u.index)),i.viewTo+=r):dr(e)}var l=i.externalMeasured;l&&(n<l.lineN?l.lineN+=r:t<l.lineN+l.size&&(i.externalMeasured=null))}function cr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[ur(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==R(a,n)&&a.push(n)}}}function dr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function fr(e,t,n,r){var i,o=ur(e,t),a=e.display.view;if(!Mt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,u=0;u<o;u++)s+=a[u].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;zt(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 hr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function pr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function mr(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();(u||e.options.showCursorWhenSelecting)&&gr(e,s.head,i),u||_r(e,s,o)}}return r}function gr(e,t,n){var r=Vn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(E("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(E("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function yr(e,t){return e.top-t.top||e.left-t.left}function _r(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Dn(e.display),s=a.left,u=Math.max(r.sizerWidth,Ln(e)-r.sizer.offsetLeft)-a.right,l="ltr"==i.direction;function c(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?u-e:n)+"px;\n height: "+(r-t)+"px"))}function d(t,n,r){var o,a,d=$e(i,t),f=d.text.length;function h(n,r){return $n(e,et(t,n),"div",d,r)}function p(t,n,r){var i=Zn(e,d,null,t),o="ltr"==n==("after"==r)?"left":"right",a="after"==r?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1);return h(a,o)[o]}var m=ce(d,i.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||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")}(m,n||0,null==r?f:r,function(e,t,i,d){var g="ltr"==i,y=h(e,g?"left":"right"),_=h(t-1,g?"right":"left"),v=null==n&&0==e,b=null==r&&t==f,w=0==d,M=!m||d==m.length-1;if(_.top-y.top<=3){var x=(l?v:b)&&w,k=(l?b:v)&&M,D=x?s:(g?y:_).left,S=k?u:(g?_:y).right;c(D,y.top,S-D,y.bottom)}else{var L,C,E,T;g?(L=l&&v&&w?s:y.left,C=l?u:p(e,i,"before"),E=l?s:p(t,i,"after"),T=l&&b&&M?u:_.right):(L=l?p(e,i,"before"):s,C=!l&&v&&w?u:y.right,E=!l&&b&&M?s:_.left,T=l?p(t,i,"after"):u),c(L,y.top,C-L,y.bottom),y.bottom<_.top&&c(s,y.bottom,null,_.top),c(E,_.top,T-E,_.bottom)}(!o||yr(y,o)<0)&&(o=y),yr(_,o)<0&&(o=_),(!a||yr(y,a)<0)&&(a=y),yr(_,a)<0&&(a=_)}),{start:o,end:a}}var f=t.from(),h=t.to();if(f.line==h.line)d(f.line,f.ch,h.ch);else{var p=$e(i,f.line),m=$e(i,h.line),g=Ft(p)==Ft(m),y=d(f.line,f.ch,g?p.text.length+1:null).end,_=d(h.line,g?0:null,h.ch).start;g&&(y.top<_.top-2?(c(y.right,y.top,null,y.bottom),c(s,_.top,_.left,_.bottom)):c(y.right,y.top,_.left-y.right,y.bottom)),y.bottom<_.top&&c(s,y.bottom,null,_.top)}n.appendChild(o)}function vr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function br(e){e.state.focused||(e.display.input.focus(),Mr(e))}function wr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,xr(e))},100)}function Mr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(me(e,"focus",e,t),e.state.focused=!0,I(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),u&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),vr(e))}function xr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(me(e,"blur",e,t),e.state.focused=!1,S(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function kr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=e.options.lineWrapping,u=void 0,l=0;if(!i.hidden){if(a&&s<8){var c=i.node.offsetTop+i.node.offsetHeight;u=c-n,n=c}else{var d=i.node.getBoundingClientRect();u=d.bottom-d.top,!o&&i.text.firstChild&&(l=i.text.firstChild.getBoundingClientRect().right-d.left-1)}var f=i.line.height-u;if((f>.005||f<-.005)&&(Ke(i.line,u),Dr(i.line),i.rest))for(var h=0;h<i.rest.length;h++)Dr(i.rest[h]);if(l>e.display.sizerWidth){var p=Math.ceil(l/nr(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Dr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Sr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-xn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=Qe(t,r),a=Qe(t,i);if(n&&n.ensure){var s=n.ensure.from.line,u=n.ensure.to.line;s<o?(o=s,a=Qe(t,Ut($e(t,s))+e.wrapper.clientHeight)):Math.min(u,t.lastLine())>=a&&(o=Qe(t,Ut($e(t,u))-e.wrapper.clientHeight),a=u)}return{from:o,to:Math.max(a,o+1)}}function Lr(e,t){var n=e.display,r=tr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Cn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+kn(n),u=t.top<r,l=t.bottom>s-r;if(t.top<i)a.scrollTop=u?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(l?s:t.bottom)-o);c!=i&&(a.scrollTop=c)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,f=Ln(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left-(h?0:10)):t.right>f+d-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function Cr(e,t){null!=t&&(Ar(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Er(e){Ar(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Tr(e,t,n){null==t&&null==n||Ar(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Ar(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Gn(e,t.from),r=Gn(e,t.to);jr(e,n,r,t.margin)}}function jr(e,t,n,r){var i=Lr(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});Tr(e,i.scrollLeft,i.scrollTop)}function Ir(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||oi(e,{top:t}),Pr(e,t,!0),n&&oi(e),ei(e,100))}function Pr(e,t,n){t=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 Or(e,t,n,r){t=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,ui(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Nr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+kn(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+Sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Yr=function(e,t,n){this.cm=n;var r=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),fe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),fe(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Yr.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}},Yr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Yr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Yr.prototype.zeroWidthHack=function(){var e=_&&!h?"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},Yr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,function r(){var i=e.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.pointerEvents="none":t.set(1e3,r)})},Yr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Fr=function(){};function zr(e,t){t||(t=Nr(e));var n=e.display.barWidth,r=e.display.barHeight;Rr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&kr(e),Rr(e,Nr(e)),n=e.display.barWidth,r=e.display.barHeight}function Rr(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=""}Fr.prototype.update=function(){return{bottom:0,right:0}},Fr.prototype.setScrollLeft=function(){},Fr.prototype.setScrollTop=function(){},Fr.prototype.clear=function(){};var Br={native:Yr,null:Fr};function Hr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Br[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(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?Or(e,t):Ir(e,t)},e),e.display.scrollbars.addClass&&I(e.display.wrapper,e.display.scrollbars.addClass)}var Ur=0;function Wr(e){var t;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:++Ur},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function qr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(n)}finally{an=null,t(n)}}(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)$r(t[n]);for(var r=0;r<t.length;r++)(i=t[r]).updatedDisplay=i.mustUpdate&&ri(i.cm,i.update);for(var i,o=0;o<t.length;o++)Vr(t[o]);for(var a=0;a<t.length;a++)Gr(t[a]);for(var s=0;s<t.length;s++)Kr(t[s])}(e)})}function $r(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Sn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Sn(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&qt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ni(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Vr(e){var t=e.cm,n=t.display;e.updatedDisplay&&kr(t),e.barMeasure=Nr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Tn(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+Sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ln(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Gr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Or(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==j();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&zr(t,e.barMeasure),e.updatedDisplay&&si(t,e.barMeasure),e.selectionChanged&&vr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&br(e.cm)}function Kr(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&ii(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Pr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Or(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t,n="before"==t.sticky?et(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=Vn(e,t),u=n&&n!=t?Vn(e,n):s;i={left:Math.min(s.left,u.left),top:Math.min(s.top,u.top)-r,right:Math.max(s.left,u.left),bottom:Math.max(s.bottom,u.bottom)+r};var l=Lr(e,i),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=l.scrollTop&&(Ir(e,l.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=l.scrollLeft&&(Or(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}(t,st(r,e.scrollToPos.from),st(r,e.scrollToPos.to),e.scrollToPos.margin);!function(e,t){if(!ge(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&&!p){var o=E("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-xn(e.display))+"px;\n height: "+(t.bottom-t.top+Sn(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)}}}(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||me(o[s],"hide");if(a)for(var u=0;u<a.length;++u)a[u].lines.length&&me(a[u],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&me(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Jr(e,t){if(e.curOp)return t();Wr(e);try{return t()}finally{qr(e)}}function Qr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Wr(e);try{return t.apply(e,arguments)}finally{qr(e)}}}function Zr(e){return function(){if(this.curOp)return e.apply(this,arguments);Wr(this);try{return e.apply(this,arguments)}finally{qr(this)}}}function Xr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Wr(t);try{return e.apply(this,arguments)}finally{qr(t)}}}function ei(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,N(ti,e))}function ti(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ht(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?He(t.mode,r.state):null,u=dt(e,o,r,!0);s&&(r.state=s),o.styles=u.styles;var l=o.styleClasses,c=u.classes;c?o.styleClasses=c:l&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||l!=c&&(!l||!c||l.bgClass!=c.bgClass||l.textClass!=c.textClass),f=0;!d&&f<a.length;++f)d=a[f]!=o.styles[f];d&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&pt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ei(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Jr(e,function(){for(var t=0;t<i.length;t++)cr(e,i[t],"text")})}}var ni=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Sr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Ln(e),this.force=n,this.dims=rr(e),this.events=[]};function ri(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return dr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==hr(e))return!1;li(e)&&(dr(e),t.dims=rr(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.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Mt&&(o=zt(e.doc,o),a=Rt(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=on(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=on(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(ur(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(on(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,ur(e,n)))),r.viewTo=n}(e,o,a),n.viewOffset=Ut($e(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 c=function(e){if(e.hasFocus())return null;var t=j();if(!t||!A(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&A(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return l>4&&(n.lineDiv.style.display="none"),function(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 u&&_&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var l=r.view,c=r.viewFrom,d=0;d<l.length;d++){var f=l[d];if(f.hidden);else if(f.node&&f.node.parentNode==o){for(;a!=f.node;)a=s(a);var h=i&&null!=t&&t<=c&&f.lineNumber;f.changes&&(R(f.changes,"gutter")>-1&&(h=!1),cn(e,f,c,n)),h&&(L(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(Xe(e.options,c)))),a=f.node.nextSibling}else{var p=yn(e,f,c,n);o.insertBefore(p,a)}c+=f.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=j()&&(e.activeElt.focus(),e.anchorNode&&A(document.body,e.anchorNode)&&A(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(c),L(n.cursorDiv),L(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ei(e,400)),n.updateLineNumbers=null,!0}function ii(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ln(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+kn(e.display)-Cn(e),n.top)}),t.visible=Sr(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ri(e,t);r=!1){kr(e);var i=Nr(e);pr(e),zr(e,i),si(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 oi(e,t){var n=new ni(e,t);if(ri(e,n)){kr(e),ii(e,n);var r=Nr(e);pr(e),zr(e,r),si(e,r),n.finish()}}function ai(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function si(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+Sn(e)+"px"}function ui(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=ir(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var u=0;u<s.length;u++)s[u].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function li(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Xe(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(E("div",[E("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",ai(e.display),!0}return!1}function ci(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function di(e){var t=e.gutters,n=e.gutterSpecs;L(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,s=t.appendChild(E("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",ai(e)}function fi(e){di(e.display),lr(e),ui(e)}function hi(e,t,r,i){var o=this;this.input=r,o.scrollbarFiller=E("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=E("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=T("div",null,"CodeMirror-code"),o.selectionDiv=E("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=E("div",null,"CodeMirror-cursors"),o.measure=E("div",null,"CodeMirror-measure"),o.lineMeasure=E("div",null,"CodeMirror-measure"),o.lineSpace=T("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var l=T("div",[o.lineSpace],"CodeMirror-lines");o.mover=E("div",[l],null,"position: relative"),o.sizer=E("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=E("div",null,null,"position: absolute; height: "+B+"px; width: 1px;"),o.gutters=E("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=E("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=E("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),u||n&&y||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=ci(i.gutters,i.lineNumbers),di(o),r.init(o)}ni.prototype.signal=function(e,t){_e(e,t)&&this.events.push(arguments)},ni.prototype.finish=function(){for(var e=0;e<this.events.length;e++)me.apply(null,this.events[e])};var pi=0,mi=null;function gi(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function yi(e){var t=gi(e);return t.x*=mi,t.y*=mi,t}function _i(e,t){var r=gi(t),i=r.x,o=r.y,a=e.display,s=a.scroller,l=s.scrollWidth>s.clientWidth,c=s.scrollHeight>s.clientHeight;if(i&&l||o&&c){if(o&&_&&u)e:for(var f=t.target,h=a.view;f!=s;f=f.parentNode)for(var p=0;p<h.length;p++)if(h[p].node==f){e.display.currentWheelTarget=f;break e}if(i&&!n&&!d&&null!=mi)return o&&c&&Ir(e,Math.max(0,s.scrollTop+o*mi)),Or(e,Math.max(0,s.scrollLeft+i*mi)),(!o||o&&c)&&be(t),void(a.wheelStartX=null);if(o&&null!=mi){var m=o*mi,g=e.doc.scrollTop,y=g+a.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):y=Math.min(e.doc.height,y+m+50),oi(e,{top:g,bottom:y})}pi<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout(function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(mi=(mi*pi+n)/(pi+1),++pi)}},200)):(a.wheelDX+=i,a.wheelDY+=o))}}a?mi=-.53:n?mi=15:c?mi=-.7:f&&(mi=-1/3);var vi=function(e,t){this.ranges=e,this.primIndex=t};vi.prototype.primary=function(){return this.ranges[this.primIndex]},vi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!nt(n.anchor,r.anchor)||!nt(n.head,r.head))return!1}return!0},vi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new bi(rt(this.ranges[t].anchor),rt(this.ranges[t].head));return new vi(e,this.primIndex)},vi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},vi.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(tt(t,r.from())>=0&&tt(e,r.to())<=0)return n}return-1};var bi=function(e,t){this.anchor=e,this.head=t};function wi(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(e,t){return tt(e.from(),t.from())}),n=R(t,i);for(var o=1;o<t.length;o++){var a=t[o],s=t[o-1],u=tt(s.to(),a.from());if(r&&!a.empty()?u>0:u>=0){var l=ot(s.from(),a.from()),c=it(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new bi(d?c:l,d?l:c))}}return new vi(t,n)}function Mi(e,t){return new vi([new bi(e,t||e)],0)}function xi(e){return e.text?et(e.from.line+e.text.length-1,K(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function ki(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return xi(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+=xi(t).ch-t.to.ch),et(n,r)}function Di(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new bi(ki(i.anchor,t),ki(i.head,t)))}return wi(e.cm,n,e.sel.primIndex)}function Si(e,t,n){return e.line==t.line?et(n.line,e.ch-t.ch+n.ch):et(n.line+(e.line-t.line),e.ch)}function Li(e){e.doc.mode=ze(e.options,e.doc.modeOption),Ci(e)}function Ci(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ei(e,100),e.state.modeGen++,e.curOp&&lr(e)}function Ei(e,t){return 0==t.from.ch&&0==t.to.ch&&""==K(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ti(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ct(e),Et(e,n);var i=r?r(e):1;i!=e.height&&Ke(e,i)}(e,n,i,r),un(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new $t(l[o],i(o),r));return n}var s=t.from,u=t.to,l=t.text,c=$e(e,s.line),d=$e(e,u.line),f=K(l),h=i(l.length-1),p=u.line-s.line;if(t.full)e.insert(0,a(0,l.length)),e.remove(l.length,e.size-l.length);else if(Ei(e,t)){var m=a(0,l.length-1);o(d,d.text,h),p&&e.remove(s.line,p),m.length&&e.insert(s.line,m)}else if(c==d)if(1==l.length)o(c,c.text.slice(0,s.ch)+f+c.text.slice(u.ch),h);else{var g=a(1,l.length-1);g.push(new $t(f+c.text.slice(u.ch),h,r)),o(c,c.text.slice(0,s.ch)+l[0],i(0)),e.insert(s.line+1,g)}else if(1==l.length)o(c,c.text.slice(0,s.ch)+l[0]+d.text.slice(u.ch),i(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+l[0],i(0)),o(d,f+d.text.slice(u.ch),h);var y=a(1,l.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,y)}un(e,"change",e,t)}function Ai(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;a<r.linked.length;++a){var s=r.linked[a];if(s.doc!=i){var u=o&&s.sharedHist;n&&!u||(t(s.doc,u),e(s.doc,r,u))}}}(e,null,!0)}function ji(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ar(e),Li(e),Ii(e),e.options.lineWrapping||qt(e),e.options.mode=t.modeOption,lr(e)}function Ii(e){("rtl"==e.doc.direction?I:S)(e.display.lineDiv,"CodeMirror-rtl")}function Pi(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Oi(e,t){var n={from:rt(t.from),to:xi(t),text:Ve(e,t.from,t.to)};return Ri(e,n,t.from.line,t.to.line+1),Ai(e,function(e){return Ri(e,n,t.from.line,t.to.line+1)},!0),n}function Ni(e){for(;e.length;){var t=K(e);if(!t.ranges)break;e.pop()}}function Yi(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=function(e,t){return t?(Ni(e.done),K(e.done)):e.done.length&&!K(e.done).ranges?K(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),K(e.done)):void 0}(i,i.lastOp==r)))a=K(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,a.to)?a.to=xi(t):o.changes.push(Oi(e,t));else{var u=K(i.done);for(u&&u.ranges||zi(e.sel,i.done),o={changes:[Oi(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||me(e,"historyAdded")}function Fi(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||function(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)}(e,o,K(i.done),t))?i.done[i.done.length-1]=t:zi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Ni(i.undone)}function zi(e,t){var n=K(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ri(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 Bi(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Hi(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Bi(n[i]));return r}(e,t),r=St(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var s=0;s<a.length;++s){for(var u=a[s],l=0;l<o.length;++l)if(o[l].marker==u.marker)continue e;o.push(u)}else a&&(n[i]=a)}return n}function Ui(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?vi.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];r.push({changes:s});for(var u=0;u<a.length;++u){var l=a[u],c=void 0;if(s.push({from:l.from,to:l.to,text:l.text}),t)for(var d in l)(c=d.match(/^spans_(\d+)$/))&&R(t,Number(c[1]))>-1&&(K(s)[d]=l[d],delete l[d])}}}return r}function Wi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=tt(t,i)<0;o!=tt(n,i)<0?(i=t,t=n):o!=tt(t,n)<0&&(t=n)}return new bi(i,t)}return new bi(n||t,t)}function qi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ji(e,new vi([Wi(e.sel.primary(),t,n,i)],0),r)}function $i(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Wi(e.sel.ranges[o],t[o],null,i);var a=wi(e.cm,r,e.sel.primIndex);Ji(e,a,n)}function Vi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Ji(e,wi(e.cm,i,e.sel.primIndex),r)}function Gi(e,t,n,r){Ji(e,Mi(t,n),r)}function Ki(e,t,n){var r=e.history.done,i=K(r);i&&i.ranges?(r[r.length-1]=t,Qi(e,t,n)):Ji(e,t,n)}function Ji(e,t,n){Qi(e,t,n),Fi(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Qi(e,t,n){(_e(e,"beforeSelectionChange")||e.cm&&_e(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new bi(st(e,t[n].anchor),st(e,t[n].head))},origin:n&&n.origin};return me(e,"beforeSelectionChange",e,r),e.cm&&me(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?wi(e.cm,r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);Zi(e,eo(e,t,r,!0)),n&&!1===n.scroll||!e.cm||Er(e.cm)}function Zi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ye(e.cm)),un(e,"cursorActivity",e))}function Xi(e){Zi(e,eo(e,e.sel,null,!1))}function eo(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],u=no(e,a.anchor,s&&s.anchor,n,r),l=no(e,a.head,s&&s.head,n,r);(i||u!=a.anchor||l!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new bi(u,l))}return i?wi(e.cm,i,t.primIndex):t}function to(e,t,n,r,i){var o=$e(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],u=s.marker;if((null==s.from||(u.inclusiveLeft?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(u.inclusiveRight?s.to>=t.ch:s.to>t.ch))){if(i&&(me(u,"beforeCursorEnter"),u.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!u.atomic)continue;if(n){var l=u.find(r<0?1:-1),c=void 0;if((r<0?u.inclusiveRight:u.inclusiveLeft)&&(l=ro(e,l,-r,l&&l.line==t.line?o:null)),l&&l.line==t.line&&(c=tt(l,n))&&(r<0?c<0:c>0))return to(e,l,t,r,i)}var d=u.find(r<0?-1:1);return(r<0?u.inclusiveLeft:u.inclusiveRight)&&(d=ro(e,d,r,d.line==t.line?o:null)),d?to(e,d,t,r,i):null}}return t}function no(e,t,n,r,i){var o=r||1,a=to(e,t,n,o,i)||!i&&to(e,t,n,o,!0)||to(e,t,n,-o,i)||!i&&to(e,t,n,-o,!0);return a||(e.cantEdit=!0,et(e.first,0))}function ro(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?st(e,et(t.line-1)):null:n>0&&t.ch==(r||$e(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+n)}function io(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),U)}function oo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=st(e,t)),n&&(r.to=st(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),me(e,"beforeChange",e,r),e.cm&&me(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function ao(e,t,n){if(e.cm){if(!e.cm.curOp)return Qr(e.cm,ao)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(_e(e,"beforeChange")||e.cm&&_e(e.cm,"beforeChange"))||(t=oo(e,t,!0))){var r=wt&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=R(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),u=0;u<i.length;++u){var l=i[u];if(!(tt(l.to,s.from)<0||tt(l.from,s.to)>0)){var c=[u,1],d=tt(l.from,s.from),f=tt(l.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:l.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&c.push({from:s.to,to:l.to}),i.splice.apply(i,c),u+=c.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)so(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else so(e,t)}}function so(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=Di(e,t);Yi(e,t,n,e.cm?e.cm.curOp.id:NaN),co(e,t,n,St(e,t));var r=[];Ai(e,function(e,n){n||-1!=R(r,e.history)||(mo(e.history,t),r.push(e.history)),co(e,t,null,St(e,t))})}}function uo(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,u="undo"==t?o.undone:o.done,l=0;l<s.length&&(i=s[l],n?!i.ranges||i.equals(e.sel):i.ranges);l++);if(l!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(r)return void s.push(i);break}if(zi(i,u),n&&!i.equals(e.sel))return void Ji(e,i,{clearRedo:!1});a=i}var c=[];zi(a,u),u.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var d=_e(e,"beforeChange")||e.cm&&_e(e.cm,"beforeChange"),f=function(n){var r=i.changes[n];if(r.origin=t,d&&!oo(e,r,!1))return s.length=0,{};c.push(Oi(e,r));var o=n?Di(e,r):K(s);co(e,r,o,Hi(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:xi(r)});var a=[];Ai(e,function(e,t){t||-1!=R(a,e.history)||(mo(e.history,r),a.push(e.history)),co(e,r,null,Hi(e,r))})},h=i.changes.length-1;h>=0;--h){var p=f(h);if(p)return p.v}}}}function lo(e,t){if(0!=t&&(e.first+=t,e.sel=new vi(J(e.sel.ranges,function(e){return new bi(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){lr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)cr(e.cm,r,"gutter")}}function co(e,t,n,r){if(e.cm&&!e.cm.curOp)return Qr(e.cm,co)(e,t,n,r);if(t.to.line<e.first)lo(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);lo(e,i),t={from:et(e.first,0),to:et(t.to.line+i,t.to.ch),text:[K(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:et(o,$e(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ve(e,t.from,t.to),n||(n=Di(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,u=o.line;e.options.lineWrapping||(u=Je(Ft($e(r,o.line))),r.iter(u,a.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ye(e),Ti(r,t,n,or(e)),e.options.lineWrapping||(r.iter(u,o.line+t.text.length,function(e){var t=Wt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=$e(e,r).stateAfter;if(i&&(!(i instanceof lt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,o.line),ei(e,400);var l=t.text.length-(a.line-o.line)-1;t.full?lr(e):o.line!=a.line||1!=t.text.length||Ei(e.doc,t)?lr(e,o.line,a.line+1,l):cr(e,o.line,"text");var c=_e(e,"changes"),d=_e(e,"change");if(d||c){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&un(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,r):Ti(e,t,r),Qi(e,n,U)}}function fo(e,t,n,r,i){var o;r||(r=n),tt(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),ao(e,{from:n,to:r,text:t,origin:i})}function ho(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function po(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)ho(o.ranges[s].anchor,t,n,r),ho(o.ranges[s].head,t,n,r)}else{for(var u=0;u<o.changes.length;++u){var l=o.changes[u];if(n<l.from.line)l.from=et(l.from.line+r,l.from.ch),l.to=et(l.to.line+r,l.to.ch);else if(t<=l.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function mo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;po(e.done,n,r,i),po(e.undone,n,r,i)}function go(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=$e(e,at(e,t)):i=Je(t),null==i?null:(r(o,i)&&e.cm&&cr(e.cm,i,n),o)}function yo(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function _o(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}bi.prototype.from=function(){return ot(this.anchor,this.head)},bi.prototype.to=function(){return it(this.anchor,this.head)},bi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},yo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Vt(i),un(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},_o.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof yo))){var s=[];this.collapse(s),this.children=[new yo(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var u=new yo(i.lines.slice(s,s+=25));i.height-=u.height,this.children.splice(++r,0,u),u.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new _o(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=R(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new _o(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var vo=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function bo(e,t,n){Ut(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Cr(e,n)}vo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Je(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=wn(this);Ke(n,Math.max(0,n.height-o)),e&&(Jr(e,function(){bo(e,n,-o),cr(e,r,"widget")}),un(e,"lineWidgetCleared",e,this,r))}},vo.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=wn(this)-t;i&&(Bt(this.doc,r)||Ke(r,r.height+i),n&&Jr(n,function(){n.curOp.forceUpdate=!0,bo(n,r,i),un(n,"lineWidgetChanged",n,e,Je(r))}))},ve(vo);var wo=0,Mo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++wo};function xo(e,t,n,r,i){if(r&&r.shared)return function(e,t,n,r,i){(r=Y(r)).shared=!1;var o=[xo(e,t,n,r,i)],a=o[0],s=r.widgetNode;return Ai(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),o.push(xo(e,st(e,t),st(e,n),r,i));for(var u=0;u<e.linked.length;++u)if(e.linked[u].isParent)return;a=K(o)}),new ko(o,a)}(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Qr(e.cm,xo)(e,t,n,r,i);var o=new Mo(e,i),a=tt(t,n);if(r&&Y(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=T("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Yt(e,t.line,t,n,o)||t.line!=n.line&&Yt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Mt=!0}o.addToHistory&&Yi(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,u=t.line,l=e.cm;if(e.iter(u,n.line+1,function(e){l&&o.collapsed&&!l.options.lineWrapping&&Ft(e)==l.display.maxLine&&(s=!0),o.collapsed&&u!=t.line&&Ke(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new xt(o,u==t.line?t.ch:null,u==n.line?n.ch:null)),++u}),o.collapsed&&e.iter(t.line,n.line+1,function(t){Bt(e,t)&&Ke(t,0)}),o.clearOnEnter&&fe(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(wt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++wo,o.atomic=!0),l){if(s&&(l.curOp.updateMaxLine=!0),o.collapsed)lr(l,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++)cr(l,c,"text");o.atomic&&Xi(l.doc),un(l,"markerAdded",l,o)}return o}Mo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Wr(e),_e(this,"clear")){var n=this.find();n&&un(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=kt(a.markedSpans,this);e&&!this.collapsed?cr(e,Je(a),"text"):e&&(null!=s.to&&(i=Je(a)),null!=s.from&&(r=Je(a))),a.markedSpans=Dt(a.markedSpans,s),null==s.from&&this.collapsed&&!Bt(this.doc,a)&&e&&Ke(a,tr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var u=0;u<this.lines.length;++u){var l=Ft(this.lines[u]),c=Wt(l);c>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&lr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xi(e.doc)),e&&un(e,"markerCleared",e,this,r,i),t&&qr(e),this.parent&&this.parent.clear()}},Mo.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=kt(o.markedSpans,this);if(null!=a.from&&(n=et(t?o:Je(o),a.from),-1==e))return n;if(null!=a.to&&(r=et(t?o:Je(o),a.to),1==e))return r}return n&&{from:n,to:r}},Mo.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Jr(r,function(){var i=t.line,o=Je(t.line),a=An(r,o);if(a&&(Fn(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Bt(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var u=wn(n)-s;u&&Ke(i,i.height+u)}un(r,"markerChanged",r,e)})},Mo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=R(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Mo.prototype.detachLine=function(e){if(this.lines.splice(R(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ve(Mo);var ko=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Do(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),function(e){return e.parent})}function So(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Ai(n.primary.doc,function(e){return r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==R(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}ko.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();un(this,"clear")}},ko.prototype.find=function(e,t){return this.primary.find(e,t)},ve(ko);var Lo=0,Co=function(e,t,n,r,i){if(!(this instanceof Co))return new Co(e,t,n,r,i);null==n&&(n=0),_o.call(this,[new yo([new $t("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=et(n,0);this.sel=Mi(o),this.history=new Pi(null),this.id=++Lo,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Ti(this,{from:o,to:o,text:e}),Ji(this,Mi(o),U)};Co.prototype=Z(_o.prototype,{constructor:Co,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ge(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Xr(function(e){var t=et(this.first,0),n=this.first+this.size-1;ao(this,{from:t,to:et(n,$e(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Tr(this.cm,0,0),Ji(this,Mi(t),U)}),replaceRange:function(e,t,n,r){t=st(this,t),n=n?st(this,n):t,fo(this,e,t,n,r)},getRange:function(e,t,n){var r=Ve(this,st(this,e),st(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ze(this,e))return $e(this,e)},getLineNumber:function(e){return Je(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=$e(this,e)),Ft(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Xr(function(e,t,n){Gi(this,st(this,"number"==typeof e?et(e,t||0):e),null,n)}),setSelection:Xr(function(e,t,n){Gi(this,st(this,e),st(this,t||e),n)}),extendSelection:Xr(function(e,t,n){qi(this,st(this,e),t&&st(this,t),n)}),extendSelections:Xr(function(e,t){$i(this,ut(this,e),t)}),extendSelectionsBy:Xr(function(e,t){var n=J(this.sel.ranges,e);$i(this,ut(this,n),t)}),setSelections:Xr(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new bi(st(this,e[i].anchor),st(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Ji(this,wi(this.cm,r,t),n)}}),addSelection:Xr(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new bi(st(this,e),st(this,t||e))),Ji(this,wi(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Ve(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Ve(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Xr(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var s=t&&"end"!=t&&function(e,t,n){for(var r=[],i=et(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],u=Si(s.from,i,o),l=Si(xi(s),i,o);if(i=s.to,o=l,"around"==n){var c=e.sel.ranges[a],d=tt(c.head,c.anchor)<0;r[a]=new bi(d?l:u,d?u:l)}else r[a]=new bi(u,u)}return new vi(r,e.sel.primIndex)}(this,r,t),u=r.length-1;u>=0;u--)ao(this,r[u]);s?Ki(this,s):this.cm&&Er(this.cm)}),undo:Xr(function(){uo(this,"undo")}),redo:Xr(function(){uo(this,"redo")}),undoSelection:Xr(function(){uo(this,"undo",!0)}),redoSelection:Xr(function(){uo(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.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new Pi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ui(this.history.done),undone:Ui(this.history.undone)}},setHistory:function(e){var t=this.history=new Pi(this.history.maxGeneration);t.done=Ui(e.done.slice(0),null,!0),t.undone=Ui(e.undone.slice(0),null,!0)},setGutterMarker:Xr(function(e,t,n){return go(this,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&ne(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Xr(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&go(t,n,"gutter",function(){return n.gutterMarkers[e]=null,ne(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!Ze(this,e))return null;if(t=e,!(e=$e(this,e)))return null}else if(null==(t=Je(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Xr(function(e,t,n){return go(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(k(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0})}),removeLineClass:Xr(function(e,t,n){return go(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(k(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),addLineWidget:Xr(function(e,t,n){return function(e,t,n,r){var i=new vo(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),go(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Bt(e,t)){var r=Ut(t)<e.scrollTop;Ke(t,t.height+wn(i)),r&&Cr(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&un(o,"lineWidgetAdded",o,i,"number"==typeof t?t:Je(t)),i}(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return xo(this,st(this,e),st(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return xo(this,e=st(this,e),e,n,"bookmark")},findMarksAt:function(e){e=st(this,e);var t=[],n=$e(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=st(this,e),t=st(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<a.length;s++){var u=a[s];null!=u.to&&i==e.line&&e.ch>=u.to||null==u.from&&i!=e.line||null!=u.from&&i==t.line&&u.from>=t.ch||n&&!n(u.marker)||r.push(u.marker.parent||u.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),st(this,et(n,t))},indexFromPos:function(e){var t=(e=st(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Co(Ge(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Co(Ge(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(tt(o,a)){var s=xo(e,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}(r,Do(this)),r},unlinkDoc:function(e){if(e instanceof ka&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),So(Do(this));break}}if(e.history==this.history){var r=[e.id];Ai(e,function(e){return r.push(e.id)},!0),e.history=new Pi(null),e.history.done=Ui(this.history.done,r),e.history.undone=Ui(this.history.undone,r)}},iterLinkedDocs:function(e){Ai(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):je(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Xr(function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Jr(t=this.cm,function(){Ii(t),lr(t)}))})}),Co.prototype.eachLine=Co.prototype.iter;var Eo=0;function To(e){var t=this;if(Ao(t),!ge(t,e)&&!Mn(t.display,e)){be(e),a&&(Eo=+new Date);var n=sr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),s=0,u=function(e,r){if(!t.options.allowDropFileTypes||-1!=R(t.options.allowDropFileTypes,e.type)){var a=new FileReader;a.onload=Qr(t,function(){var e=a.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++s==i){var u={from:n=st(t.doc,n),to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};ao(t.doc,u),Ki(t.doc,Mi(n,xi(u)))}}),a.readAsText(e)}},l=0;l<i;++l)u(r[l],l);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),Qi(t.doc,Mi(n,n)),d)for(var f=0;f<d.length;++f)fo(t.doc,"",d[f].anchor,d[f].head,"drag");t.replaceSelection(c,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ao(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function jo(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var t=0;t<n.length;t++)e(n[t])})}}var Io=!1;function Po(){var e;Io||(fe(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,jo(Oo)},100))}),fe(window,"blur",function(){return jo(xr)}),Io=!0)}function Oo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var No={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Yo=0;Yo<10;Yo++)No[Yo+48]=No[Yo+96]=String(Yo);for(var Fo=65;Fo<=90;Fo++)No[Fo]=String.fromCharCode(Fo);for(var zo=1;zo<=12;zo++)No[zo+111]=No[zo+63235]="F"+zo;var Ro={};function Bo(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Ho(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=J(n.split(" "),Bo),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=r):(s=i.slice(0,o+1).join(" "),a="...");var u=t[s];if(u){if(u!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var l in t)e[l]=t[l];return e}function Uo(e,t,n,r){var i=(t=Vo(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Uo(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Uo(e,t.fallthrough[o],n,r);if(a)return a}}}function Wo(e){var t="string"==typeof e?e:No[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function qo(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(M?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(M?t.ctrlKey:t.metaKey)&&"Cmd"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function $o(e,t){if(d&&34==e.keyCode&&e.char)return!1;var n=No[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),qo(n,e,t))}function Vo(e){return"string"==typeof e?Ro[e]:e}function Go(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&tt(o.from,K(r).to)<=0;){var a=r.pop();if(tt(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Jr(e,function(){for(var t=r.length-1;t>=0;t--)fo(e.doc,"",r[t].from,r[t].to,"+delete");Er(e)})}function Ko(e,t,n){var r=oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Jo(e,t,n){var r=Ko(e,t.ch,n);return null==r?null:new et(t.line,r,n<0?"after":"before")}function Qo(e,t,n,r,i){if(e){var o=ce(n,t.doc.direction);if(o){var a,s=i<0?K(o):o[0],u=i<0==(1==s.level),l=u?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=jn(t,n);a=i<0?n.text.length-1:0;var d=In(t,c,a).top;a=ae(function(e){return In(t,c,e).top==d},i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Ko(n,a,1))}else a=i<0?s.to:s.from;return new et(r,a,l)}}return new et(r,i<0?n.text.length:0,i<0?"before":"after")}Ro.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"},Ro.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"},Ro.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"},Ro.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"]},Ro.default=_?Ro.macDefault:Ro.pcDefault;var Zo={selectAll:io,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),U)},killLine:function(e){return Go(e,function(t){if(t.empty()){var n=$e(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Go(e,function(t){return{from:et(t.from().line,0),to:st(e.doc,et(t.to().line+1,0))}})},delLineLeft:function(e){return Go(e,function(e){return{from:et(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return Go(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Go(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Xo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ea(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return function(e,t){var n=$e(e.doc,t),r=function(e){for(var t;t=Ot(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=Je(r)),Qo(!0,e,n,t,-1)}(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},q)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},q)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?ea(e,t.head):r},q)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=F(e.getLine(o.line),o.ch,r);t.push(G(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Jr(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=$e(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new et(i.line,i.ch-1)),i.ch>0)i=new et(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),et(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=$e(e.doc,i.line-1).text;a&&(i=new et(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),et(i.line-1,a.length-1),i,"+transpose"))}n.push(new bi(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Jr(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<t.length;r++)e.indentLine(t[r].from().line,null,!0);Er(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Xo(e,t){var n=$e(e.doc,t),r=Ft(n);return r!=n&&(t=Je(r)),Qo(!0,e,r,t,1)}function ea(e,t){var n=Xo(e,t.line),r=$e(e.doc,n.line),i=ce(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return et(n.line,a?0:o,n.sticky)}return n}function ta(e,t,n){if("string"==typeof t&&!(t=Zo[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=H}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}var na=new z;function ra(e,t,n,r){var i=e.state.keySeq;if(i){if(Wo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:na.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ia(e,i+" "+t,n,r))return!0}return ia(e,t,n,r)}function ia(e,t,n,r){var i=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Uo(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Uo(t,e.options.extraKeys,n,e)||Uo(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&un(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(be(n),vr(e)),!!i}function oa(e,t){var n=$o(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?ra(e,"Shift-"+n,t,function(t){return ta(e,t,!0)})||ra(e,n,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ta(e,t)}):ra(e,n,t,function(t){return ta(e,t)}))}var aa=null;function sa(e){var t=this;if(t.curOp.focus=j(),!ge(t,e)){a&&s<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=oa(t,e);d&&(aa=r?n:null,!r&&88==n&&!Pe&&(_?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(S(t,"CodeMirror-crosshair"),pe(document,"keyup",n),pe(document,"mouseover",n))}I(t,"CodeMirror-crosshair"),fe(document,"keyup",n),fe(document,"mouseover",n)}(t)}}function ua(e){16==e.keyCode&&(this.doc.sel.shift=!1),ge(this,e)}function la(e){var t=this;if(!(Mn(t.display,e)||ge(t,e)||e.ctrlKey&&!e.altKey||_&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(d&&n==aa)return aa=null,void be(e);if(!d||e.which&&!(e.which<10)||!oa(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(e,t,n){return ra(e,"'"+n+"'",t,function(t){return ta(e,t,!0)})}(t,e,i)||t.display.input.onKeyPress(e))}}}var ca,da,fa=function(e,t,n){this.time=e,this.pos=t,this.button=n};function ha(e){var t=this,n=t.display;if(!(ge(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,Mn(n,e))u||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));else if(!ga(t,e)){var r=sr(t,e),i=De(e),o=r?function(e,t){var n=+new Date;return da&&da.compare(n,e,t)?(ca=da=null,"triple"):ca&&ca.compare(n,e,t)?(da=new fa(n,e,t),ca=null,"double"):(ca=new fa(n,e,t),da=null,"single")}(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),ra(e,qo(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,function(t){if("string"==typeof t&&(t=Zo[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=H}finally{e.state.suppressEdits=!1}return r})}(t,i,r,o,e)||(1==i?r?function(e,t,n,r){a?setTimeout(N(br,e),0):e.curOp.focus=j();var i,o=function(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=v?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=_?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(_?n.altKey:n.ctrlKey)),i}(e,n,r),l=e.doc.sel;e.options.dragDrop&&Ce&&!e.isReadOnly()&&"single"==n&&(i=l.contains(t))>-1&&(tt((i=l.ranges[i]).from(),t)<0||t.xRel>0)&&(tt(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,l=Qr(e,function(t){u&&(i.scroller.draggable=!1),e.state.draggingText=!1,pe(i.wrapper.ownerDocument,"mouseup",l),pe(i.wrapper.ownerDocument,"mousemove",c),pe(i.scroller,"dragstart",d),pe(i.scroller,"drop",l),o||(be(t),r.addNew||qi(e.doc,n,null,null,r.extend),u||a&&9==s?setTimeout(function(){i.wrapper.ownerDocument.body.focus(),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};u&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),fe(i.wrapper.ownerDocument,"mouseup",l),fe(i.wrapper.ownerDocument,"mousemove",c),fe(i.scroller,"dragstart",d),fe(i.scroller,"drop",l),wr(e),setTimeout(function(){return i.input.focus()},20)}(e,r,t,o):function(e,t,n,r){var i=e.display,o=e.doc;be(t);var a,s,u=o.sel,l=u.ranges;if(r.addNew&&!r.extend?(s=o.sel.contains(n),a=s>-1?l[s]:new bi(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new bi(n,n)),n=sr(e,t,!0,!0),s=-1;else{var c=pa(e,n,r.unit);a=r.extend?Wi(a,c.anchor,c.head,r.extend):c}r.addNew?-1==s?(s=l.length,Ji(o,wi(e,l.concat([a]),s),{scroll:!1,origin:"*mouse"})):l.length>1&&l[s].empty()&&"char"==r.unit&&!r.extend?(Ji(o,wi(e,l.slice(0,s).concat(l.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):Vi(o,s,a,W):(s=0,Ji(o,new vi([a],0),W),u=o.sel);var d=n;function f(t){if(0!=tt(d,t))if(d=t,"rectangle"==r.unit){for(var i=[],l=e.options.tabSize,c=F($e(o,n.line).text,n.ch,l),f=F($e(o,t.line).text,t.ch,l),h=Math.min(c,f),p=Math.max(c,f),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var y=$e(o,m).text,_=$(y,h,l);h==p?i.push(new bi(et(m,_),et(m,_))):y.length>_&&i.push(new bi(et(m,_),et(m,$(y,p,l))))}i.length||i.push(new bi(n,n)),Ji(o,wi(e,u.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var v,b=a,w=pa(e,t,r.unit),M=b.anchor;tt(w.anchor,M)>0?(v=w.head,M=ot(b.from(),w.anchor)):(v=w.anchor,M=it(b.to(),w.head));var x=u.ranges.slice(0);x[s]=function(e,t){var n=t.anchor,r=t.head,i=$e(e.doc,n.line);if(0==tt(n,r)&&n.sticky==r.sticky)return t;var o=ce(i);if(!o)return t;var a=ue(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var u,l=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==l||l==o.length)return t;if(r.line!=n.line)u=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=ue(o,r.ch,r.sticky),d=c-a||(r.ch-n.ch)*(1==s.level?-1:1);u=c==l-1||c==l?d<0:d>0}var f=o[l+(u?-1:0)],h=u==(1==f.level),p=h?f.from:f.to,m=h?"after":"before";return n.ch==p&&n.sticky==m?t:new bi(new et(n.line,p,m),r)}(e,new bi(st(o,M),v)),Ji(o,wi(e,x,s),W)}}var h=i.wrapper.getBoundingClientRect(),p=0;function m(t){e.state.selectingText=!1,p=1/0,t&&(be(t),i.input.focus()),pe(i.wrapper.ownerDocument,"mousemove",g),pe(i.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var g=Qr(e,function(t){0!==t.buttons&&De(t)?function t(n){var a=++p,s=sr(e,n,!0,"rectangle"==r.unit);if(s)if(0!=tt(s,d)){e.curOp.focus=j(),f(s);var u=Sr(i,o);(s.line>=u.to||s.line<u.from)&&setTimeout(Qr(e,function(){p==a&&t(n)}),150)}else{var l=n.clientY<h.top?-20:n.clientY>h.bottom?20:0;l&&setTimeout(Qr(e,function(){p==a&&(i.scroller.scrollTop+=l,t(n))}),50)}}(t):m(t)}),y=Qr(e,m);e.state.selectingText=y,fe(i.wrapper.ownerDocument,"mousemove",g),fe(i.wrapper.ownerDocument,"mouseup",y)}(e,r,t,o)}(t,r,o,e):ke(e)==n.scroller&&be(e):2==i?(r&&qi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):3==i&&(x?t.display.input.onContextMenu(e):wr(t)))}}function pa(e,t,n){if("char"==n)return new bi(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new bi(et(t.line,0),st(e.doc,et(t.line+1,0)));var r=n(e,t);return new bi(r.from,r.to)}function ma(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(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&be(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!_e(e,n))return Me(t);o-=s.top-a.viewOffset;for(var u=0;u<e.display.gutterSpecs.length;++u){var l=a.gutters.childNodes[u];if(l&&l.getBoundingClientRect().right>=i){var c=Qe(e.doc,o),d=e.display.gutterSpecs[u];return me(e,n,e,c,d.className,t),Me(t)}}}function ga(e,t){return ma(e,t,"gutterClick",!0)}function ya(e,t){Mn(e.display,t)||function(e,t){return!!_e(e,"gutterContextMenu")&&ma(e,t,"gutterContextMenu",!1)}(e,t)||ge(e,t,"contextmenu")||x||e.display.input.onContextMenu(t)}function _a(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Rn(e)}fa.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var va={toString:function(){return"CodeMirror.Init"}},ba={},wa={};function Ma(e,t,n){var r=n&&n!=va;if(!t!=!r){var i=e.display.dragFunctions,o=t?fe:pe;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function xa(e){e.options.lineWrapping?(I(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),qt(e)),ar(e),lr(e),Rn(e),setTimeout(function(){return zr(e)},100)}function ka(e,t){var n=this;if(!(this instanceof ka))return new ka(e,t);this.options=t=t?Y(t):{},Y(ba,t,!1);var r=t.value;"string"==typeof r?r=new Co(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new ka.inputStyles[t.inputStyle](this),o=this.display=new hi(e,r,i,t);for(var l in o.wrapper.CodeMirror=this,_a(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Hr(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&&!y&&o.input.focus(),a&&s<11&&setTimeout(function(){return n.display.input.reset(!0)},20),function(e){var t=e.display;fe(t.scroller,"mousedown",Qr(e,ha)),fe(t.scroller,"dblclick",a&&s<11?Qr(e,function(t){if(!ge(e,t)){var n=sr(e,t);if(n&&!ga(e,t)&&!Mn(e.display,t)){be(t);var r=e.findWordAt(n);qi(e.doc,r.anchor,r.head)}}}):function(t){return ge(e,t)||be(t)}),fe(t.scroller,"contextmenu",function(t){return ya(e,t)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),(r=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}fe(t.scroller,"touchstart",function(i){if(!ge(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!ga(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),fe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),fe(t.scroller,"touchend",function(n){var r=t.activeTouch;if(r&&!Mn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!r.prev||o(r,r.prev)?new bi(s,s):!r.prev.prev||o(r,r.prev.prev)?e.findWordAt(s):new bi(et(s.line,0),st(e.doc,et(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),be(n)}i()}),fe(t.scroller,"touchcancel",i),fe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ir(e,t.scroller.scrollTop),Or(e,t.scroller.scrollLeft,!0),me(e,"scroll",e))}),fe(t.scroller,"mousewheel",function(t){return _i(e,t)}),fe(t.scroller,"DOMMouseScroll",function(t){return _i(e,t)}),fe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){ge(e,t)||xe(t)},over:function(t){ge(e,t)||(function(e,t){var n=sr(e,t);if(n){var r=document.createDocumentFragment();gr(e,n,r),e.display.dragCursor||(e.display.dragCursor=E("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),C(e.display.dragCursor,r)}}(e,t),xe(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Eo<100))xe(t);else if(!ge(e,t)&&!Mn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var n=E("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(e,t)},drop:Qr(e,To),leave:function(t){ge(e,t)||Ao(e)}};var u=t.input.getField();fe(u,"keyup",function(t){return ua.call(e,t)}),fe(u,"keydown",Qr(e,sa)),fe(u,"keypress",Qr(e,la)),fe(u,"focus",function(t){return Mr(e,t)}),fe(u,"blur",function(t){return xr(e,t)})}(this),Po(),Wr(this),this.curOp.forceUpdate=!0,ji(this,r),t.autofocus&&!y||this.hasFocus()?setTimeout(N(Mr,this),20):xr(this),wa)wa.hasOwnProperty(l)&&wa[l](n,t[l],va);li(this),t.finishInit&&t.finishInit(this);for(var c=0;c<Da.length;++c)Da[c](n);qr(this),u&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}ka.defaults=ba,ka.optionHandlers=wa;var Da=[];function Sa(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=ht(e,t).state:n="prev");var a=e.options.tabSize,s=$e(o,t),u=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var l,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((l=o.mode.indent(i,s.text.slice(c.length),s.text))==H||l>150)){if(!r)return;n="prev"}}else l=0,n="not";"prev"==n?l=t>o.first?F($e(o,t-1).text,null,a):0:"add"==n?l=u+e.options.indentUnit:"subtract"==n?l=u-e.options.indentUnit:"number"==typeof n&&(l=u+n),l=Math.max(0,l);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(l/a);h;--h)f+=a,d+="\t";if(f<l&&(d+=G(l-f)),d!=c)return fo(o,d,et(t,0),et(t,c.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<c.length){var g=et(t,c.length);Vi(o,p,new bi(g,g));break}}}ka.defineInitHook=function(e){return Da.push(e)};var La=null;function Ca(e){La=e}function Ea(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,s="paste"==i||e.state.pasteIncoming>a,u=je(t),l=null;if(s&&r.ranges.length>1)if(La&&La.text.join("\n")==t){if(r.ranges.length%La.text.length==0){l=[];for(var c=0;c<La.text.length;c++)l.push(o.splitLines(La.text[c]))}}else u.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(l=J(u,function(e){return[e]}));for(var d=e.curOp.updateInput,f=r.ranges.length-1;f>=0;f--){var h=r.ranges[f],p=h.from(),m=h.to();h.empty()&&(n&&n>0?p=et(p.line,p.ch-n):e.state.overwrite&&!s?m=et(m.line,Math.min($e(o,m.line).text.length,m.ch+K(u).length)):s&&La&&La.lineWise&&La.text.join("\n")==t&&(p=m=et(p.line,0)));var g={from:p,to:m,text:l?l[f%l.length]:u,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};ao(e.doc,g),un(e,"inputRead",e,g)}t&&!s&&Aa(e,t),Er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ta(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Jr(t,function(){return Ea(t,n,0,null,"paste")}),!0}function Aa(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<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){a=Sa(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test($e(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Sa(e,i.head.line,"smart"));a&&un(e,"electricInput",e,i.head.line)}}}function ja(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:et(i,0),head:et(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Ia(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Pa(){var e=E("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=E("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return u?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Ia(e),t}function Oa(e,t,n,r,i){var o=t,a=n,s=$e(e,t.line);function u(r){var o,a;if(null==(o=i?function(e,t,n,r){var i=ce(t,e.doc.direction);if(!i)return Jo(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=ue(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<n.ch))return Jo(t,n,r);var s,u=function(e,n){return Ko(t,e instanceof et?e.ch:e,n)},l=function(n){return e.options.lineWrapping?(s=s||jn(e,t),Zn(e,t,s,n)):{begin:0,end:t.text.length}},c=l("before"==n.sticky?u(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==r<0,f=u(n,d?1:-1);if(null!=f&&(d?f<=a.to&&f<=c.end:f>=a.from&&f>=c.begin)){var h=d?"before":"after";return new et(n.line,f,h)}}var p=function(e,t,r){for(var o=function(e,t){return t?new et(n.line,u(e,1),"before"):new et(n.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],s=t>0==(1!=a.level),l=s?r.begin:u(r.end,-1);if(a.from<=l&&l<a.to)return o(l,s);if(l=s?a.from:u(a.to,-1),r.begin<=l&&l<r.end)return o(l,s)}},m=p(o+r,r,c);if(m)return m;var g=r>0?c.end:u(c.begin,-1);return null==g||r>0&&g==t.text.length||!(m=p(r>0?0:i.length-1,r,l(g)))?null:m}(e.cm,s,t,n):Jo(s,t,n))){if(r||((a=t.line+n)<e.first||a>=e.first+e.size||(t=new et(a,t.ch,t.sticky),!(s=$e(e,a)))))return!1;t=Qo(i,e.cm,s,t.line,n)}else t=o;return!0}if("char"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var l=null,c="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||u(!f);f=!1){var h=s.text.charAt(t.ch)||"\n",p=te(h,d)?"w":c&&"\n"==h?"n":!c||/\s/.test(h)?null:"p";if(!c||f||p||(p="s"),l&&l!=p){n<0&&(n=1,u(),t.sticky="after");break}if(p&&(l=p),n>0&&!u(!f))break}var m=no(e,t,o,a,!0);return nt(o,m)&&(m.hitSide=!0),m}function Na(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var u=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(u-.5*tr(e.display),3);i=(n>0?t.bottom:t.top)+n*l}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Jn(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Ya=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 Fa(e,t){var n=An(e,t.line);if(!n||n.hidden)return null;var r=$e(e.doc,t.line),i=En(n,r,t.line),o=ce(r,e.doc.direction),a="left";if(o){var s=ue(o,t.ch);a=s%2?"right":"left"}var u=Nn(i.map,t.ch,a);return u.offset="right"==u.collapse?u.end:u.start,u}function za(e,t){return t&&(e.bad=!0),e}function Ra(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return za(e.clipPos(et(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Ba(o,t,n)}}function Ba(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!A(r,t))return za(et(Je(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?K(e.rest):e.line;return za(et(Je(o),o.text.length),i)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var u=e.measure,l=u.maps;function c(t,n,r){for(var i=-1;i<(l?l.length:0);i++)for(var o=i<0?u.map:l[i],a=0;a<o.length;a+=3){var s=o[a+2];if(s==t||s==n){var c=Je(i<0?e.line:e.rest[i]),d=o[a]+r;return(r<0||s!=t)&&(d=o[a+(r?1:0)]),et(c,d)}}}var d=c(a,s,n);if(d)return za(d,i);for(var f=s.nextSibling,h=a?a.nodeValue.length-n:0;f;f=f.nextSibling){if(d=c(f,f.firstChild,0))return za(et(d.line,d.ch-h),i);h+=f.textContent.length}for(var p=s.previousSibling,m=n;p;p=p.previousSibling){if(d=c(p,p.firstChild,-1))return za(et(d.line,d.ch+m),i);m+=p.textContent.length}}Ya.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){if(!ge(r,e)){if(r.somethingSelected())Ca({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=ja(r);Ca({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,U),r.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var o=La.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var a=Pa(),s=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),s.value=La.text.join("\n");var u=document.activeElement;O(s),setTimeout(function(){r.display.lineSpace.removeChild(a),u.focus(),u==i&&n.showPrimarySelection()},50)}}Ia(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),fe(i,"paste",function(e){ge(r,e)||Ta(e,r)||s<=11&&setTimeout(Qr(r,function(){return t.updateFromDOM()}),20)}),fe(i,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),fe(i,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),fe(i,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),fe(i,"touchstart",function(){return n.forceCompositionEnd()}),fe(i,"input",function(){t.composing||t.readFromDOMSoon()}),fe(i,"copy",o),fe(i,"cut",o)},Ya.prototype.prepareSelection=function(){var e=mr(this.cm,!1);return e.focus=this.cm.state.focused,e},Ya.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ya.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ya.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=Ra(t,e.anchorNode,e.anchorOffset),s=Ra(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=tt(ot(a,s),i)||0!=tt(it(a,s),o)){var u=t.display.view,l=i.line>=t.display.viewFrom&&Fa(t,i)||{node:u[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&Fa(t,o);if(!c){var d=u[u.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;c={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(l&&c){var h,p=e.rangeCount&&e.getRangeAt(0);try{h=D(l.node,l.offset,c.offset,c.node)}catch(e){}h&&(!n&&t.state.focused?(e.collapse(l.node,l.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),p&&null==e.anchorNode?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ya.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Ya.prototype.showMultipleSelections=function(e){C(this.cm.display.cursorDiv,e.cursors),C(this.cm.display.selectionDiv,e.selection)},Ya.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ya.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return A(this.div,t)},Ya.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ya.prototype.blur=function(){this.div.blur()},Ya.prototype.getField=function(){return this.div},Ya.prototype.supportsTouch=function(){return!0},Ya.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Jr(this.cm,function(){return e.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))})},Ya.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ya.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(g&&c&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Ra(t,e.anchorNode,e.anchorOffset),r=Ra(t,e.focusNode,e.focusOffset);n&&r&&Jr(t,function(){Ji(t.doc,Mi(n,r),U),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Ya.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=et(a.line-1,$e(r.doc,a.line-1).length)),s.ch==$e(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=et(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=ur(r,a.line))?(t=Je(i.view[0].line),n=i.view[0].node):(t=Je(i.view[e].line),n=i.view[e-1].node.nextSibling);var u,l,c=ur(r,s.line);if(c==i.view.length-1?(u=i.viewTo-1,l=i.lineDiv.lastChild):(u=Je(i.view[c+1].line)-1,l=i.view[c+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),u=!1;function l(){a&&(o+=s,u&&(o+=s),a=u=!1)}function c(e){e&&(l(),o+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void c(n);var o,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(et(r,0),et(i+1,0),(g=+f,function(e){return e.id==g}));return void(h.length&&(o=h[0].find(0))&&c(Ve(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&l();for(var m=0;m<t.childNodes.length;m++)d(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(u=!0),p&&(a=!0)}else 3==t.nodeType&&c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var g}for(;d(t),t!=n;)t=t.nextSibling,u=!1;return o}(r,n,l,t,u)),f=Ve(r.doc,et(t,0),et(u,$e(r.doc,u).text.length));d.length>1&&f.length>1;)if(K(d)==K(f))d.pop(),f.pop(),u--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var h=0,p=0,m=d[0],g=f[0],y=Math.min(m.length,g.length);h<y&&m.charCodeAt(h)==g.charCodeAt(h);)++h;for(var _=K(d),v=K(f),b=Math.min(_.length-(1==d.length?h:0),v.length-(1==f.length?h:0));p<b&&_.charCodeAt(_.length-p-1)==v.charCodeAt(v.length-p-1);)++p;if(1==d.length&&1==f.length&&t==a.line)for(;h&&h>a.ch&&_.charCodeAt(_.length-p-1)==v.charCodeAt(v.length-p-1);)h--,p++;d[d.length-1]=_.slice(0,_.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var w=et(t,h),M=et(u,f.length?K(f).length-p:0);return d.length>1||d[0]||tt(w,M)?(fo(r.doc,d,w,M,"+input"),!0):void 0},Ya.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ya.prototype.reset=function(){this.forceCompositionEnd()},Ya.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ya.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))},Ya.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Jr(this.cm,function(){return lr(e.cm)})},Ya.prototype.setUneditable=function(e){e.contentEditable="false"},Ya.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Qr(this.cm,Ea)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ya.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ya.prototype.onContextMenu=function(){},Ya.prototype.resetPosition=function(){},Ya.prototype.needsContentAttribute=!0;var Ha=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};Ha.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ge(r,e)){if(r.somethingSelected())Ca({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=ja(r);Ca({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,U):(n.prevInput="",i.value=t.text.join("\n"),O(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),fe(i,"input",function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),fe(i,"paste",function(e){ge(r,e)||Ta(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())}),fe(i,"cut",o),fe(i,"copy",o),fe(e.scroller,"paste",function(t){if(!Mn(e,t)&&!ge(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)}}),fe(e.lineSpace,"selectstart",function(t){Mn(e,t)||be(t)}),fe(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"})}}),fe(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ha.prototype.createField=function(e){this.wrapper=Pa(),this.textarea=this.wrapper.firstChild},Ha.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=mr(e);if(e.options.moveInputWithCursor){var i=Vn(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},Ha.prototype.showSelection=function(e){var t=this.cm,n=t.display;C(n.cursorDiv,e.cursors),C(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ha.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&&O(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Ha.prototype.getField=function(){return this.textarea},Ha.prototype.supportsTouch=function(){return!1},Ha.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ha.prototype.blur=function(){this.textarea.blur()},Ha.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ha.prototype.receivedFocus=function(){this.slowPoll()},Ha.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ha.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function n(){var r=t.poll();r||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))})},Ha.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ie(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||_&&/[\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 u=0,l=Math.min(r.length,i.length);u<l&&r.charCodeAt(u)==i.charCodeAt(u);)++u;return Jr(t,function(){Ea(t,i.slice(u),r.length-u,null,e.composing?"*compose":null),i.length>1e3||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},Ha.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ha.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Ha.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=sr(n,e),l=r.scroller.scrollTop;if(o&&!d){var c=n.options.resetSelectionOnContextMenu;c&&-1==n.doc.sel.contains(o)&&Qr(n,Ji)(n.doc,Mi(o),U);var f,h=i.style.cssText,p=t.wrapper.style.cssText,m=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-m.top-5)+"px; left: "+(e.clientX-m.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);",u&&(f=window.scrollY),r.input.focus(),u&&window.scrollTo(null,f),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=_,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&y(),x){xe(e);var g=function(){pe(window,"mouseup",g),setTimeout(_,20)};fe(window,"mouseup",g)}else setTimeout(_,50)}function y(){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 _(){if(t.contextMenuPending==_&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=h,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),null!=i.selectionStart)){(!a||a&&s<9)&&y();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?Qr(n,io)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},Ha.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Ha.prototype.setUneditable=function(){},Ha.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=va&&i(e,t,n)}:i)}e.defineOption=n,e.Init=va,n("value","",function(e,t){return e.setValue(t)},!0),n("mode",null,function(e,t){e.doc.modeOption=t,Li(e)},!0),n("indentUnit",2,Li,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(e){Ci(e),Rn(e),lr(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(et(r,o))}r++});for(var i=n.length-1;i>=0;i--)fo(e.doc,t,n[i],et(n[i].line,n[i].ch+t.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=va&&e.refresh()}),n("specialCharPlaceholder",Zt,function(e){return e.refresh()},!0),n("electricChars",!0),n("inputStyle",y?"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",!b),n("wholeLineUpdateBefore",!0),n("theme","default",function(e){_a(e),fi(e)},!0),n("keyMap","default",function(e,t,n){var r=Vo(t),i=n!=va&&Vo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,xa,!0),n("gutters",[],function(e,t){e.display.gutterSpecs=ci(t,e.options.lineNumbers),fi(e)},!0),n("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?ir(e.display)+"px":"0",e.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(e){return zr(e)},!0),n("scrollbarStyle","native",function(e){Hr(e),zr(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=ci(e.options.gutters,t),fi(e)},!0),n("firstLineNumber",1,fi,!0),n("lineNumberFormatter",function(e){return e},fi,!0),n("showCursorWhenSelecting",!1,pr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(e,t){"nocursor"==t&&(xr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),n("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),n("dragDrop",!0,Ma),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,pr,!0),n("singleCursorHeightPerLine",!0,pr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ci,!0),n("addModeClass",!1,Ci,!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,Ci,!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)}(ka),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&Qr(this,t[e])(this,n,i),me(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Vo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Zr(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},function(e){return e.priority}),this.state.modeGen++,lr(this)}),removeOverlay:Zr(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void lr(this)}}),indentLine:Zr(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Ze(this.doc,e)&&Sa(this,e,t,n)}),indentSelection:Zr(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Sa(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Er(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 u=s;u<n;++u)Sa(this,u,e);var l=this.doc.sel.ranges;0==o.ch&&t.length==l.length&&l[r].from().ch>0&&Vi(this.doc,r,new bi(o,l[r].to()),U)}}}),getTokenAt:function(e,t){return _t(this,e,t)},getLineTokens:function(e,t){return _t(this,et(e),t,!0)},getTokenTypeAt:function(e){e=st(this.doc,e);var t,n=ft(this,$e(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)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var s=i[o[t][a]];s&&r.push(s)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var u=0;u<i._global.length;u++){var l=i._global[u];l.pred(o,this)&&-1==R(r,l.val)&&r.push(l.val)}return r},getStateAfter:function(e,t){var n=this.doc;return ht(this,(e=at(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Vn(this,null==e?n.head:"object"==typeof e?st(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return $n(this,st(this.doc,e),t||"page")},coordsChar:function(e,t){return Jn(this,(e=qn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=qn(this,{top:e,left:0},t||"page").top,Qe(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=$e(this.doc,e)}else r=e;return Wn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Ut(r):0)},defaultTextHeight:function(){return tr(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,a,s,u=this.display,l=(e=Vn(this,st(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),u.sizer.appendChild(t),"over"==r)l=e.top;else if("above"==r||"near"==r){var d=Math.max(u.wrapper.clientHeight,this.doc.height),f=Math.max(u.sizer.clientWidth,u.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(l=e.bottom),c+t.offsetWidth>f&&(c=f-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(c=u.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(u.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(o=this,a={left:c,top:l,right:c+t.offsetWidth,bottom:l+t.offsetHeight},null!=(s=Lr(o,a)).scrollTop&&Ir(o,s.scrollTop),null!=s.scrollLeft&&Or(o,s.scrollLeft))},triggerOnKeyDown:Zr(sa),triggerOnKeyPress:Zr(la),triggerOnKeyUp:ua,triggerOnMouseDown:Zr(ha),execCommand:function(e){if(Zo.hasOwnProperty(e))return Zo[e].call(null,this)},triggerElectric:Zr(function(e){Aa(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=st(this.doc,e),a=0;a<t&&!(o=Oa(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:Zr(function(e,t){var n=this;this.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Oa(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},q)}),deleteH:Zr(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Go(this,function(n){var i=Oa(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var a=st(this.doc,e),s=0;s<t;++s){var u=Vn(this,a,"div");if(null==o?o=u.left:u.left=o,(a=Na(this,u,i,n)).hitSide)break}return a},moveV:Zr(function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(o)return e<0?a.from():a.to();var s=Vn(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var u=Na(n,s,e,t);return"page"==t&&a==r.sel.primary()&&Cr(n,$n(n,u,"div").top-s.top),u},q),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,n=$e(t,e.line).text,r=e.ch,i=e.ch;if(n){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=n.length||!r?++i:--r;for(var a=n.charAt(r),s=te(a,o)?function(e){return te(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};r>0&&s(n.charAt(r-1));)--r;for(;i<n.length&&s(n.charAt(i));)++i}return new bi(et(e.line,r),et(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?I(this.display.cursorDiv,"CodeMirror-overwrite"):S(this.display.cursorDiv,"CodeMirror-overwrite"),me(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==j()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Zr(function(e,t){Tr(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Sn(this)-this.display.barHeight,width:e.scrollWidth-Sn(this)-this.display.barWidth,clientHeight:Cn(this),clientWidth:Ln(this)}},scrollIntoView:Zr(function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Ar(e),e.curOp.scrollToPos=t}(this,e):jr(this,e.from,e.to,e.margin)}),setSize:Zr(function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&zn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){cr(n,i,"widget");break}++i}),this.curOp.forceUpdate=!0,me(this,"refresh",this)}),operation:function(e){return Jr(this,e)},startOperation:function(){return Wr(this)},endOperation:function(){return qr(this)},refresh:Zr(function(){var e=this.display.cachedTextHeight;lr(this),this.curOp.forceUpdate=!0,Rn(this),Tr(this,this.doc.scrollLeft,this.doc.scrollTop),ai(this.display),(null==e||Math.abs(e-tr(this.display))>.5)&&ar(this),me(this,"refresh",this)}),swapDoc:Zr(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),ji(this,e),Rn(this),this.display.input.reset(),Tr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,un(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}},ve(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})}}(ka);var Ua="iter insert remove copy getEditor constructor".split(" ");for(var Wa in Co.prototype)Co.prototype.hasOwnProperty(Wa)&&R(Ua,Wa)<0&&(ka.prototype[Wa]=function(e){return function(){return e.apply(this.doc,arguments)}}(Co.prototype[Wa]));return ve(Co),ka.inputStyles={textarea:Ha,contenteditable:Ya},ka.defineMode=function(e){ka.defaults.mode||"null"==e||(ka.defaults.mode=e),function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ne[e]=t}.apply(this,arguments)},ka.defineMIME=function(e,t){Ye[e]=t},ka.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ka.defineMIME("text/plain","null"),ka.defineExtension=function(e,t){ka.prototype[e]=t},ka.defineDocExtension=function(e,t){Co.prototype[e]=t},ka.fromTextArea=function(e,t){if((t=t?Y(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=j();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(fe(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(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(pe(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var s=ka(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s},function(e){e.off=pe,e.on=fe,e.wheelEventPixels=yi,e.Doc=Co,e.splitLines=je,e.countColumn=F,e.findColumn=$,e.isWordChar=ee,e.Pass=H,e.signal=me,e.Line=$t,e.changeEnd=xi,e.scrollbarModel=Br,e.Pos=et,e.cmpPos=tt,e.modes=Ne,e.mimeModes=Ye,e.resolveMode=Fe,e.getMode=ze,e.modeExtensions=Re,e.extendMode=Be,e.copyState=He,e.startState=We,e.innerMode=Ue,e.commands=Zo,e.keyMap=Ro,e.keyName=$o,e.isModifierKey=Wo,e.lookupKey=Uo,e.normalizeKeyMap=Ho,e.StringStream=qe,e.SharedTextMarker=ko,e.TextMarker=Mo,e.LineWidget=vo,e.e_preventDefault=be,e.e_stopPropagation=we,e.e_stop=xe,e.addClass=I,e.contains=A,e.rmClass=S,e.keyNames=No}(ka),ka.version="5.47.0",ka}()},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(1),o=function(){function e(e){this.sender=e}return e.prototype.connect=function(e,t){return r.connect(this,e,t)},e.prototype.disconnect=function(e,t){return r.disconnect(this,e,t)},e.prototype.emit=function(e){r.emit(this,e)},e}();t.Signal=o,function(e){e.disconnectBetween=function(e,t){r.disconnectBetween(e,t)},e.disconnectSender=function(e){r.disconnectSender(e)},e.disconnectReceiver=function(e){r.disconnectReceiver(e)},e.disconnectAll=function(e){r.disconnectAll(e)},e.clearData=function(e){r.disconnectAll(e)},e.getExceptionHandler=function(){return r.exceptionHandler},e.setExceptionHandler=function(e){var t=r.exceptionHandler;return r.exceptionHandler=e,t}}(o=t.Signal||(t.Signal={})),t.Signal=o,function(t){t.exceptionHandler=function(e){console.error(e)},t.connect=function(e,t,i){i=i||void 0;var o=n.get(e.sender);if(o||(o=[],n.set(e.sender,o)),s(o,e,t,i))return!1;var a=i||t,u=r.get(a);u||(u=[],r.set(a,u));var l={signal:e,slot:t,thisArg:i};return o.push(l),u.push(l),!0},t.disconnect=function(e,t,i){i=i||void 0;var o=n.get(e.sender);if(!o||0===o.length)return!1;var a=s(o,e,t,i);if(!a)return!1;var u=i||t,c=r.get(u);return a.signal=null,l(o),l(c),!0},t.disconnectBetween=function(e,t){var o=n.get(e);if(o&&0!==o.length){var a=r.get(t);a&&0!==a.length&&(i.each(a,function(t){t.signal&&t.signal.sender===e&&(t.signal=null)}),l(o),l(a))}},t.disconnectSender=function(e){var t=n.get(e);t&&0!==t.length&&(i.each(t,function(e){if(e.signal){var t=e.thisArg||e.slot;e.signal=null,l(r.get(t))}}),l(t))},t.disconnectReceiver=function(e){var t=r.get(e);t&&0!==t.length&&(i.each(t,function(e){if(e.signal){var t=e.signal.sender;e.signal=null,l(n.get(t))}}),l(t))},t.disconnectAll=function(e){var t=n.get(e);t&&t.length>0&&(i.each(t,function(e){e.signal=null}),l(t));var o=r.get(e);o&&o.length>0&&(i.each(o,function(e){e.signal=null}),l(o))},t.emit=function(e,t){var r=n.get(e.sender);if(r&&0!==r.length)for(var i=0,o=r.length;i<o;++i){var a=r[i];a.signal===e&&u(a,t)}};var n=new WeakMap,r=new WeakMap,o=new Set,a="function"==typeof requestAnimationFrame?requestAnimationFrame:e;function s(e,t,n,r){return i.find(e,function(e){return e.signal===t&&e.slot===n&&e.thisArg===r})}function u(e,n){var r=e.signal,i=e.slot,o=e.thisArg;try{i.call(o,r.sender,n)}catch(e){t.exceptionHandler(e)}}function l(e){0===o.size&&a(c),o.add(e)}function c(){o.forEach(d),o.clear()}function d(e){i.ArrayExt.removeAllWhere(e,f)}function f(e){return null===e.signal}}(r||(r={}))}).call(this,n(29).setImmediate)},function(e,t,n){"use strict";e.exports=n(633)},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(491)),r(n(492)),r(n(493)),r(n(494)),r(n(495)),r(n(500)),r(n(141)),r(n(505)),r(n(506)),r(n(507)),r(n(542)),r(n(543)),r(n(544)),r(n(546)),r(n(140))},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(37)),r(n(63)),r(n(389)),r(n(390)),r(n(479)),r(n(136)),r(n(480)),r(n(481)),r(n(482)),r(n(26)),r(n(135)),r(n(483)),r(n(48)),r(n(38)),r(n(484)),r(n(485)),r(n(137)),r(n(486)),r(n(138)),r(n(139)),r(n(77)),r(n(487)),r(n(64)),r(n(15))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(637);t.TypeStyle=r.TypeStyle;var i=n(639);t.types=i;var o=n(310);t.extend=o.extend,t.classes=o.classes,t.media=o.media;var a=new r.TypeStyle({autoGenerateTag:!0});t.setStylesTarget=a.setStylesTarget,t.cssRaw=a.cssRaw,t.cssRule=a.cssRule,t.forceRenderStyles=a.forceRenderStyles,t.fontFace=a.fontFace,t.getStyles=a.getStyles,t.keyframes=a.keyframes,t.reinit=a.reinit,t.style=a.style,t.stylesheet=a.stylesheet,t.createTypeStyle=function(e){var t=new r.TypeStyle({autoGenerateTag:!1});return e&&t.setStylesTarget(e),t}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(391)),r(n(392)),r(n(393)),r(n(98)),r(n(477)),r(n(478))},function(e,t,n){var r=n(14),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=a),o(i,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a=n(431).Buffer}catch(e){}function s(e,t,n){for(var r=0,i=Math.min(e.length,n),o=t;o<i;o++){var a=e.charCodeAt(o)-48;r<<=4,r|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function u(e,t,n,r){for(var i=0,o=Math.min(e.length,n),a=t;a<o;a++){var s=e.charCodeAt(a)-48;i*=r,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===n)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var r,i,o=0;for(n=e.length-6,r=0;n>=t;n-=6)i=s(e,n,n+6),this.words[r]|=i<<o&67108863,this.words[r+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);n+6!==t&&(i=s(e,t,n+6),this.words[r]|=i<<o&67108863,this.words[r+1]|=i>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,l=0,c=n;c<s;c+=r)l=u(e,c,c+r,t),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==a){var d=1;for(l=u(e,c,e.length,t),c=0;c<a;c++)d*=t;this.imuln(d),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var l=1;l<r;l++){for(var c=u>>>26,d=67108863&u,f=Math.min(l,t.length-1),h=Math.max(0,l-e.length+1);h<=f;h++){var p=l-h|0;c+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}n.words[l]=0|d,u=0|c}return 0!==u?n.words[l]=0|u:n.length--,n.strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);n=0!==(o=s>>>24-i&16777215)||a!==this.length-1?l[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var f=c[e],h=d[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(e);n=(p=p.idivn(h)).isZero()?m+n:l[f-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,l=new e(o),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),l[s]=a;for(;s<o;s++)l[s]=0}else{for(s=0;s<o-i;s++)l[s]=0;for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),l[o-s-1]=a}return l},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o<r.length;o++)t=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<n.length;o++)t=(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a<r.length;a++)o=(t=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<n.length;a++)o=(t=(0|n.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var h=function(e,t,n){var r,i,o,a=e.words,s=t.words,u=n.words,l=0,c=0|a[0],d=8191&c,f=c>>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],y=8191&g,_=g>>>13,v=0|a[3],b=8191&v,w=v>>>13,M=0|a[4],x=8191&M,k=M>>>13,D=0|a[5],S=8191&D,L=D>>>13,C=0|a[6],E=8191&C,T=C>>>13,A=0|a[7],j=8191&A,I=A>>>13,P=0|a[8],O=8191&P,N=P>>>13,Y=0|a[9],F=8191&Y,z=Y>>>13,R=0|s[0],B=8191&R,H=R>>>13,U=0|s[1],W=8191&U,q=U>>>13,$=0|s[2],V=8191&$,G=$>>>13,K=0|s[3],J=8191&K,Q=K>>>13,Z=0|s[4],X=8191&Z,ee=Z>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,le=se>>>13,ce=0|s[8],de=8191&ce,fe=ce>>>13,he=0|s[9],pe=8191&he,me=he>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(l+(r=Math.imul(d,B))|0)+((8191&(i=(i=Math.imul(d,H))+Math.imul(f,B)|0))<<13)|0;l=((o=Math.imul(f,H))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,B),i=(i=Math.imul(p,H))+Math.imul(m,B)|0,o=Math.imul(m,H);var ye=(l+(r=r+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(f,W)|0))<<13)|0;l=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,B),i=(i=Math.imul(y,H))+Math.imul(_,B)|0,o=Math.imul(_,H),r=r+Math.imul(p,W)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,q)|0;var _e=(l+(r=r+Math.imul(d,V)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(f,V)|0))<<13)|0;l=((o=o+Math.imul(f,G)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(b,B),i=(i=Math.imul(b,H))+Math.imul(w,B)|0,o=Math.imul(w,H),r=r+Math.imul(y,W)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(p,V)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,G)|0;var ve=(l+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,Q)|0)+Math.imul(f,J)|0))<<13)|0;l=((o=o+Math.imul(f,Q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(x,B),i=(i=Math.imul(x,H))+Math.imul(k,B)|0,o=Math.imul(k,H),r=r+Math.imul(b,W)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(w,W)|0,o=o+Math.imul(w,q)|0,r=r+Math.imul(y,V)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,G)|0,r=r+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,Q)|0;var be=(l+(r=r+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,X)|0))<<13)|0;l=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(S,B),i=(i=Math.imul(S,H))+Math.imul(L,B)|0,o=Math.imul(L,H),r=r+Math.imul(x,W)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(b,V)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,G)|0,r=r+Math.imul(y,J)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,Q)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var we=(l+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(f,ne)|0))<<13)|0;l=((o=o+Math.imul(f,re)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(E,B),i=(i=Math.imul(E,H))+Math.imul(T,B)|0,o=Math.imul(T,H),r=r+Math.imul(S,W)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,q)|0,r=r+Math.imul(x,V)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,G)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,Q)|0,r=r+Math.imul(y,X)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var Me=(l+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(f,oe)|0))<<13)|0;l=((o=o+Math.imul(f,ae)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(j,B),i=(i=Math.imul(j,H))+Math.imul(I,B)|0,o=Math.imul(I,H),r=r+Math.imul(E,W)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,q)|0,r=r+Math.imul(S,V)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,G)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,Q)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,Q)|0,r=r+Math.imul(b,X)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var xe=(l+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(f,ue)|0))<<13)|0;l=((o=o+Math.imul(f,le)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(O,B),i=(i=Math.imul(O,H))+Math.imul(N,B)|0,o=Math.imul(N,H),r=r+Math.imul(j,W)|0,i=(i=i+Math.imul(j,q)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,q)|0,r=r+Math.imul(E,V)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,G)|0,r=r+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,Q)|0,r=r+Math.imul(x,X)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(b,ne)|0,i=(i=i+Math.imul(b,re)|0)+Math.imul(w,ne)|0,o=o+Math.imul(w,re)|0,r=r+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,le)|0;var ke=(l+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;l=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(F,B),i=(i=Math.imul(F,H))+Math.imul(z,B)|0,o=Math.imul(z,H),r=r+Math.imul(O,W)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,q)|0,r=r+Math.imul(j,V)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,G)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,Q)|0,r=r+Math.imul(S,X)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,r=r+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,le)|0,r=r+Math.imul(p,de)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,fe)|0;var De=(l+(r=r+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(f,pe)|0))<<13)|0;l=((o=o+Math.imul(f,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(F,W),i=(i=Math.imul(F,q))+Math.imul(z,W)|0,o=Math.imul(z,q),r=r+Math.imul(O,V)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,G)|0,r=r+Math.imul(j,J)|0,i=(i=i+Math.imul(j,Q)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,Q)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(S,ne)|0,i=(i=i+Math.imul(S,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,le)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,le)|0,r=r+Math.imul(y,de)|0,i=(i=i+Math.imul(y,fe)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,fe)|0;var Se=(l+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;l=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(F,V),i=(i=Math.imul(F,G))+Math.imul(z,V)|0,o=Math.imul(z,G),r=r+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Q)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,Q)|0,r=r+Math.imul(j,X)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,le)|0,r=r+Math.imul(b,de)|0,i=(i=i+Math.imul(b,fe)|0)+Math.imul(w,de)|0,o=o+Math.imul(w,fe)|0;var Le=(l+(r=r+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(_,pe)|0))<<13)|0;l=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(F,J),i=(i=Math.imul(F,Q))+Math.imul(z,J)|0,o=Math.imul(z,Q),r=r+Math.imul(O,X)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(j,ne)|0,i=(i=i+Math.imul(j,re)|0)+Math.imul(I,ne)|0,o=o+Math.imul(I,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,le)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,le)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,fe)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,fe)|0;var Ce=(l+(r=r+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,me)|0)+Math.imul(w,pe)|0))<<13)|0;l=((o=o+Math.imul(w,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(F,X),i=(i=Math.imul(F,ee))+Math.imul(z,X)|0,o=Math.imul(z,ee),r=r+Math.imul(O,ne)|0,i=(i=i+Math.imul(O,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,le)|0,r=r+Math.imul(S,de)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(L,de)|0,o=o+Math.imul(L,fe)|0;var Ee=(l+(r=r+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(k,pe)|0))<<13)|0;l=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(F,ne),i=(i=Math.imul(F,re))+Math.imul(z,ne)|0,o=Math.imul(z,re),r=r+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,r=r+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,le)|0)+Math.imul(I,ue)|0,o=o+Math.imul(I,le)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,fe)|0;var Te=(l+(r=r+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(L,pe)|0))<<13)|0;l=((o=o+Math.imul(L,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(F,oe),i=(i=Math.imul(F,ae))+Math.imul(z,oe)|0,o=Math.imul(z,ae),r=r+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,le)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,le)|0,r=r+Math.imul(j,de)|0,i=(i=i+Math.imul(j,fe)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,fe)|0;var Ae=(l+(r=r+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(T,pe)|0))<<13)|0;l=((o=o+Math.imul(T,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(F,ue),i=(i=Math.imul(F,le))+Math.imul(z,ue)|0,o=Math.imul(z,le),r=r+Math.imul(O,de)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,fe)|0;var je=(l+(r=r+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(I,pe)|0))<<13)|0;l=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(F,de),i=(i=Math.imul(F,fe))+Math.imul(z,de)|0,o=Math.imul(z,fe);var Ie=(l+(r=r+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,me)|0)+Math.imul(N,pe)|0))<<13)|0;l=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863;var Pe=(l+(r=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,me))+Math.imul(z,pe)|0))<<13)|0;return l=((o=Math.imul(z,me))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,u[0]=ge,u[1]=ye,u[2]=_e,u[3]=ve,u[4]=be,u[5]=we,u[6]=Me,u[7]=xe,u[8]=ke,u[9]=De,u[10]=Se,u[11]=Le,u[12]=Ce,u[13]=Ee,u[14]=Te,u[15]=Ae,u[16]=je,u[17]=Ie,u[18]=Pe,0!==l&&(u[19]=l,n.length++),n};function p(e,t,n){return(new m).mulp(e,t,n)}function m(e,t){this.x=e,this.y=t}Math.imul||(h=f),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?h(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,t.length-1),l=Math.max(0,o-e.length+1);l<=u;l++){var c=o-l,d=(0|e.words[c])*(0|t.words[l]),f=67108863&d;s=67108863&(f=f+s|0),i+=(a=(a=a+(d/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):p(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},m.prototype.revBin=function(e,t,n){if(0===e||e===n-1)return e;for(var r=0,i=0;i<t;i++)r|=(1&e)<<t-i-1,e>>=1;return r},m.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a<o;a++)r[a]=t[e[a]],i[a]=n[e[a]]},m.prototype.transform=function(e,t,n,r,i,o){this.permute(o,e,t,n,r,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),l=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var d=u,f=l,h=0;h<a;h++){var p=n[c+h],m=r[c+h],g=n[c+h+a],y=r[c+h+a],_=d*g-f*y;y=d*y+f*g,g=_,n[c+h]=p+g,r[c+h]=m+y,n[c+h+a]=p-g,r[c+h+a]=m-y,h!==s&&(_=u*d-l*f,f=u*f+l*d,d=_)}},m.prototype.guessLen13b=function(e,t){var n=1|Math.max(t,e),r=1&n,i=0;for(n=n/2|0;n;n>>>=1)i++;return 1<<i+1+r},m.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var i=e[r];e[r]=e[n-r-1],e[n-r-1]=i,i=t[r],t[r]=-t[n-r-1],t[n-r-1]=-i}},m.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var i=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+n;e[r]=67108863&i,n=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,n,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],n[2*a]=8191&o,o>>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)n[a]=0;r(0===o),r(0==(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=0;return t},m.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(r),o=this.stub(r),a=new Array(r),s=new Array(r),u=new Array(r),l=new Array(r),c=new Array(r),d=new Array(r),f=n.words;f.length=r,this.convert13b(e.words,e.length,a,r),this.convert13b(t.words,t.length,l,r),this.transform(a,o,s,u,r,i),this.transform(l,o,c,d,r,i);for(var h=0;h<r;h++){var p=s[h]*c[h]-u[h]*d[h];u[h]=s[h]*d[h]+u[h]*c[h],s[h]=p}return this.conjugate(s,u,r),this.transform(s,u,f,o,r,i),this.conjugate(f,o,r),this.normalize13b(f,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),p(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=(e.words[r]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var i=n.sqr();r<t.length;r++,i=i.sqr())0!==t[r]&&(n=n.mul(i));return n},o.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<n;this.words[t]=u|a,a=s>>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=n;if(i-=a,i=Math.max(0,i),u){for(var l=0;l<a;l++)u.words[l]=this.words[l];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var c=0;for(l=this.length-1;l>=0&&(0!==c||l>=i);l--){var d=0|this.words[l];this.words[l]=c<<26-o|d>>>o,c=d&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n)&&!!(this.words[n]&i)},o.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,n){var i,o,a=e.length+n;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+n])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)s=(o=(0|this.words[i+n])+s)>>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var c=r.clone()._ishlnsubmul(i,1,u);0===c.negative&&(r=c,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(i,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=f)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},o.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),l=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++l;for(var c=n.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(d)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(l)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,c=1;0==(t.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,f=1;0==(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,a=n;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new M(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):n.strip(),n},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(_,y),_.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r<n;r++)t.words[r]=e.words[r];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=4194303&i,r=10;r<e.length;r++){var o=0|e.words[r];e.words[r-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,e.words[r-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(v,y),i(b,y),i(w,y),w.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new v;else if("p192"===e)t=new b;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return g[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},M.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var d=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g<p);var y=this.pow(d,new o(1).iushln(p-g-1));f=f.redMul(y),d=y.redSqr(),h=h.redMul(d),p=g}return f},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new o(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var i=n[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),r=t.length-1;r>=0;r--){for(var l=t.words[r],c=u-1;c>=0;c--){var d=l>>c&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===c)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new x(e)},i(x,M),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(42)(e))},function(e,t,n){"use strict";(function(e,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),s=n(386),u=function(){function e(e){this.type=e}return Object.defineProperty(e.prototype,"isConflatable",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype.conflate=function(e){return!1},e}();t.Message=u;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),Object.defineProperty(t.prototype,"isConflatable",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype.conflate=function(e){return!0},t}(u);t.ConflatableMessage=l,function(t){function n(e,t){var n=o.get(e);n&&0!==n.length?a.every(a.retro(n),function(n){return!n||function(e,t,n){var r=!0;try{r="function"==typeof e?e(t,n):e.messageHook(t,n)}catch(e){l(e)}return r}(n,e,t)})&&p(e,t):p(e,t)}t.sendMessage=n,t.postMessage=function(e,t){t.isConflatable&&a.some(i,function(n){return n.handler===e&&!!n.msg&&n.msg.type===t.type&&!!n.msg.isConflatable&&n.msg.conflate(t)})||m(e,t)},t.installMessageHook=function(e,t){var n=o.get(e);n&&-1!==n.indexOf(t)||(n?n.push(t):o.set(e,[t]))},t.removeMessageHook=function(e,t){var n=o.get(e);if(n){var r=n.indexOf(t);-1!==r&&(n[r]=null,y(n))}},t.clearData=function(e){var t=o.get(e);t&&t.length>0&&(a.ArrayExt.fill(t,null),y(t)),a.each(i,function(t){t.handler===e&&(t.handler=null,t.msg=null)})},t.flush=function(){d||0===c||(h(c),d=!0,g(),d=!1)},t.getExceptionHandler=function(){return l},t.setExceptionHandler=function(e){var t=l;return l=e,t};var i=new s.LinkedList,o=new WeakMap,u=new Set,l=function(e){console.error(e)},c=0,d=!1,f="function"==typeof requestAnimationFrame?requestAnimationFrame:e,h="function"==typeof cancelAnimationFrame?cancelAnimationFrame:r;function p(e,t){try{e.processMessage(t)}catch(e){l(e)}}function m(e,t){i.addLast({handler:e,msg:t}),0===c&&(c=f(g))}function g(){if(c=0,!i.isEmpty){var e={handler:null,msg:null};for(i.addLast(e);;){var t=i.removeFirst();if(t===e)return;t.handler&&t.msg&&n(t.handler,t.msg)}}}function y(e){0===u.size&&f(_),u.add(e)}function _(){u.forEach(v),u.clear()}function v(e){a.ArrayExt.removeAllWhere(e,b)}function b(e){return null===e}}(t.MessageLoop||(t.MessageLoop={}))}).call(this,n(29).setImmediate,n(29).clearImmediate)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(e){ |
| 128 | /*! |
| 129 | * The buffer module from node.js, for the browser. |
| 130 | * |
no test coverage detected